From 1395669d677cad20a5f9ce4a84d0619b60505b60 Mon Sep 17 00:00:00 2001 From: val966 Date: Mon, 18 May 2026 15:01:11 +0200 Subject: [PATCH] add comms --- .gitignore | 27 + README.md | 25 + .../webTemplates/BASIC/css/bootstrap.min.css | 7 + assets/webTemplates/BASIC/css/style.css | 18 + assets/webTemplates/BASIC/dist/bundle.js | 342 +++++++ assets/webTemplates/BASIC/index.html | 21 + build.gradle | 70 ++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 54708 bytes gradle/wrapper/gradle-wrapper.properties | 5 + gradlew | 172 ++++ gradlew.bat | 84 ++ skill.properties | 15 + .../kotlin/furhatos/app/blank/flow/init.kt | 26 + .../app/blank/flow/main/SessionLogger.kt | 433 +++++++++ .../app/blank/flow/main/StartQuestion.kt | 58 ++ .../app/blank/flow/main/attention/AST.kt | 106 ++ .../blank/flow/main/attention/AskAttention.kt | 634 ++++++++++++ .../furhatos/app/blank/flow/main/greeting.kt | 119 +++ .../app/blank/flow/main/handlers/Goodbye.kt | 26 + .../blank/flow/main/handlers/RepeatHandler.kt | 86 ++ .../flow/main/handlers/RephraseHandler.kt | 40 + .../blank/flow/main/handlers/StopHandler.kt | 62 ++ .../furhatos/app/blank/flow/main/idle.kt | 27 + .../app/blank/flow/main/memory/AskSequence.kt | 642 +++++++++++++ .../app/blank/flow/main/memory/MemoryHint.kt | 64 ++ .../blank/flow/main/memory/WordsCompare.kt | 52 + .../app/blank/flow/main/say_time/AskTime.kt | 907 ++++++++++++++++++ .../app/blank/flow/main/say_time/STT.kt | 158 +++ .../blank/flow/main/say_time/TimeCompare.kt | 358 +++++++ .../app/blank/flow/main/say_time/TimeHint.kt | 363 +++++++ .../flow/main/supporting/AskToContinue.kt | 35 + .../flow/main/supporting/CheckCondition.kt | 106 ++ .../blank/flow/main/supporting/Difficulty.kt | 37 + .../blank/flow/main/supporting/HintOffer.kt | 44 + .../blank/flow/main/supporting/Reactions.kt | 73 ++ .../blank/flow/main/supporting/SmallTalk.kt | 75 ++ .../blank/flow/main/supporting/WrongAnswer.kt | 52 + .../main/supporting/general/ProxyClient.kt | 181 ++++ .../main/supporting/general/SessionState.kt | 18 + .../main/supporting/general/SmallTalkProxy.kt | 128 +++ .../flow/main/supporting/general/Test.kt | 12 + .../flow/main/supporting/general/Words.kt | 79 ++ .../kotlin/furhatos/app/blank/flow/parent.kt | 56 ++ src/main/kotlin/furhatos/app/blank/main.kt | 18 + .../app/blank/nlu/AttentionTraining.kt | 24 + .../furhatos/app/blank/nlu/MemoryTraining.kt | 25 + .../furhatos/app/blank/nlu/TimeTraining.kt | 18 + .../furhatos/app/blank/nlu/base_answer/Ano.kt | 30 + .../app/blank/nlu/base_answer/DontKnow.kt | 24 + .../app/blank/nlu/base_answer/Help.kt | 19 + .../furhatos/app/blank/nlu/base_answer/Nie.kt | 27 + .../app/blank/nlu/base_answer/Repeat.kt | 18 + .../app/blank/nlu/base_answer/Rephrase.kt | 23 + .../app/blank/nlu/base_answer/StopTraining.kt | 40 + .../app/blank/nlu/other_responses/Feeling.kt | 29 + .../app/blank/setting/interactionParams.kt | 5 + src/main/realtime/main.py | 290 ++++++ src/main/realtime/requirements.txt | 4 + src/main/resources/wordbank.csv | 159 +++ 59 files changed, 6596 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 assets/webTemplates/BASIC/css/bootstrap.min.css create mode 100644 assets/webTemplates/BASIC/css/style.css create mode 100644 assets/webTemplates/BASIC/dist/bundle.js create mode 100644 assets/webTemplates/BASIC/index.html create mode 100644 build.gradle create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat create mode 100644 skill.properties create mode 100644 src/main/kotlin/furhatos/app/blank/flow/init.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/SessionLogger.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/StartQuestion.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/attention/AST.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/attention/AskAttention.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/greeting.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/handlers/Goodbye.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/handlers/RepeatHandler.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/handlers/RephraseHandler.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/handlers/StopHandler.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/idle.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/memory/AskSequence.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/memory/MemoryHint.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/memory/WordsCompare.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/say_time/AskTime.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/say_time/STT.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/say_time/TimeCompare.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/say_time/TimeHint.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/AskToContinue.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/CheckCondition.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/Difficulty.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/HintOffer.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/Reactions.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/SmallTalk.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/WrongAnswer.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/ProxyClient.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/SessionState.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/SmallTalkProxy.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/Test.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/Words.kt create mode 100644 src/main/kotlin/furhatos/app/blank/flow/parent.kt create mode 100644 src/main/kotlin/furhatos/app/blank/main.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/AttentionTraining.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/MemoryTraining.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/TimeTraining.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/base_answer/Ano.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/base_answer/DontKnow.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/base_answer/Help.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/base_answer/Nie.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/base_answer/Repeat.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/base_answer/Rephrase.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/base_answer/StopTraining.kt create mode 100644 src/main/kotlin/furhatos/app/blank/nlu/other_responses/Feeling.kt create mode 100644 src/main/kotlin/furhatos/app/blank/setting/interactionParams.kt create mode 100644 src/main/realtime/main.py create mode 100644 src/main/realtime/requirements.txt create mode 100644 src/main/resources/wordbank.csv diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3dcaf1c --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +node_modules/ +/out +/build +build/ +/.gradle +/logs +/.idea + +save_flow.xml +*.iml + +.env +.env.* +!.env.example + +.DS_Store +Thumbs.db + +# Python virtual environment +**/.venv/ +**/venv/ + +# Python cache +**/__pycache__/ +*.py[cod] +*.pyo +*.pyd diff --git a/README.md b/README.md new file mode 100644 index 0000000..f7cabbb --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +### Projekt obsahuje Furhat skill určený na podporu vybraných kognitívnych funkcií používateľa. + +## Obsah projektu + +- `src/main/kotlin` – hlavná implementácia Furhat skillu +- `src/main/resources` – zdroje používané skillom +- `src/main/realtime` – proxy modul pre komunikáciu s OpenAI Realtime API +- `assets` – doplnkové súbory aplikácie, ak sa používajú +- `skill.properties` – konfiguračný súbor Furhat skillu + +## Spustenie skillu + +1. Otvoriť projekt v IntelliJ IDEA. +2. Skontrolovať konfiguráciu Furhat SDK. +3. Spustiť skill cez Gradle alebo cez Run konfiguráciu. + +## Spustenie proxy modulu + +1. Vytvoriť `.env` podľa súboru `.env.example`. +2. Nainštalovať potrebné Python balíky. +3. Spustiť FastAPI server. + +## Poznámka + +Súbory s logmi a súkromné konfiguračné údaje nie sú súčasťou repozitára. \ No newline at end of file diff --git a/assets/webTemplates/BASIC/css/bootstrap.min.css b/assets/webTemplates/BASIC/css/bootstrap.min.css new file mode 100644 index 0000000..ad65b4e --- /dev/null +++ b/assets/webTemplates/BASIC/css/bootstrap.min.css @@ -0,0 +1,7 @@ +/*! + * Bootstrap v4.0.0-beta.2 (https://getbootstrap.com) + * Copyright 2011-2017 The Bootstrap Authors + * Copyright 2011-2017 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#868e96;--gray-dark:#343a40;--primary:#007bff;--secondary:#868e96;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--font-family-monospace:"SFMono-Regular",Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}@media print{*,::after,::before{text-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap!important}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:5px}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#868e96}.blockquote-footer::before{content:"\2014 \00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #ddd;border-radius:.25rem;transition:all .2s ease-in-out;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#868e96}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}code{padding:.2rem .4rem;font-size:90%;color:#bd4147;background-color:#f8f9fa;border-radius:.25rem}a>code{padding:0;color:inherit;background-color:inherit}kbd{padding:.2rem .4rem;font-size:90%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;margin-top:0;margin-bottom:1rem;font-size:90%;color:#212529}pre code{padding:0;font-size:inherit;color:inherit;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.333333%}.offset-xl-2{margin-left:16.666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.333333%}.offset-xl-5{margin-left:41.666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.333333%}.offset-xl-8{margin-left:66.666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.333333%}.offset-xl-11{margin-left:91.666667%}}.table{width:100%;max-width:100%;margin-bottom:1rem;background-color:transparent}.table td,.table th{padding:.75rem;vertical-align:top;border-top:1px solid #e9ecef}.table thead th{vertical-align:bottom;border-bottom:2px solid #e9ecef}.table tbody+tbody{border-top:2px solid #e9ecef}.table .table{background-color:#fff}.table-sm td,.table-sm th{padding:.3rem}.table-bordered{border:1px solid #e9ecef}.table-bordered td,.table-bordered th{border:1px solid #e9ecef}.table-bordered thead td,.table-bordered thead th{border-bottom-width:2px}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,.05)}.table-hover tbody tr:hover{background-color:rgba(0,0,0,.075)}.table-primary,.table-primary>td,.table-primary>th{background-color:#b8daff}.table-hover .table-primary:hover{background-color:#9fcdff}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#9fcdff}.table-secondary,.table-secondary>td,.table-secondary>th{background-color:#dddfe2}.table-hover .table-secondary:hover{background-color:#cfd2d6}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#cfd2d6}.table-success,.table-success>td,.table-success>th{background-color:#c3e6cb}.table-hover .table-success:hover{background-color:#b1dfbb}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#b1dfbb}.table-info,.table-info>td,.table-info>th{background-color:#bee5eb}.table-hover .table-info:hover{background-color:#abdde5}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#abdde5}.table-warning,.table-warning>td,.table-warning>th{background-color:#ffeeba}.table-hover .table-warning:hover{background-color:#ffe8a1}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#ffe8a1}.table-danger,.table-danger>td,.table-danger>th{background-color:#f5c6cb}.table-hover .table-danger:hover{background-color:#f1b0b7}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#f1b0b7}.table-light,.table-light>td,.table-light>th{background-color:#fdfdfe}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>td,.table-dark>th{background-color:#c6c8ca}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>td,.table-active>th{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,.075)}.table .thead-dark th{color:#fff;background-color:#212529;border-color:#32383e}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#e9ecef}.table-dark{color:#fff;background-color:#212529}.table-dark td,.table-dark th,.table-dark thead th{border-color:#32383e}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,.05)}.table-dark.table-hover tbody tr:hover{background-color:rgba(255,255,255,.075)}@media (max-width:575px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-sm.table-bordered{border:0}}@media (max-width:767px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-md.table-bordered{border:0}}@media (max-width:991px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-lg.table-bordered{border:0}}@media (max-width:1199px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-xl.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive.table-bordered{border:0}.form-control{display:block;width:100%;padding:.375rem .75rem;font-size:1rem;line-height:1.5;color:#495057;background-color:#fff;background-image:none;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.form-control::-webkit-input-placeholder{color:#868e96;opacity:1}.form-control:-ms-input-placeholder{color:#868e96;opacity:1}.form-control::-ms-input-placeholder{color:#868e96;opacity:1}.form-control::placeholder{color:#868e96;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:not([size]):not([multiple]){height:calc(2.25rem + 2px)}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block}.col-form-label{padding-top:calc(.375rem + 1px);padding-bottom:calc(.375rem + 1px);margin-bottom:0;line-height:1.5}.col-form-label-lg{padding-top:calc(.5rem + 1px);padding-bottom:calc(.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(.25rem + 1px);padding-bottom:calc(.25rem + 1px);font-size:.875rem;line-height:1.5}.col-form-legend{padding-top:.375rem;padding-bottom:.375rem;margin-bottom:0;font-size:1rem}.form-control-plaintext{padding-top:.375rem;padding-bottom:.375rem;margin-bottom:0;line-height:1.5;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-lg,.form-control-plaintext.form-control-sm,.input-group-lg>.form-control-plaintext.form-control,.input-group-lg>.form-control-plaintext.input-group-addon,.input-group-lg>.input-group-btn>.form-control-plaintext.btn,.input-group-sm>.form-control-plaintext.form-control,.input-group-sm>.form-control-plaintext.input-group-addon,.input-group-sm>.input-group-btn>.form-control-plaintext.btn{padding-right:0;padding-left:0}.form-control-sm,.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.input-group-sm>.input-group-btn>select.btn:not([size]):not([multiple]),.input-group-sm>select.form-control:not([size]):not([multiple]),.input-group-sm>select.input-group-addon:not([size]):not([multiple]),select.form-control-sm:not([size]):not([multiple]){height:calc(1.8125rem + 2px)}.form-control-lg,.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.input-group-lg>.input-group-btn>select.btn:not([size]):not([multiple]),.input-group-lg>select.form-control:not([size]):not([multiple]),.input-group-lg>select.input-group-addon:not([size]):not([multiple]),select.form-control-lg:not([size]):not([multiple]){height:calc(2.875rem + 2px)}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:.25rem}.form-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*=col-]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;margin-bottom:.5rem}.form-check.disabled .form-check-label{color:#868e96}.form-check-label{padding-left:1.25rem;margin-bottom:0}.form-check-input{position:absolute;margin-top:.25rem;margin-left:-1.25rem}.form-check-inline{display:inline-block;margin-right:.75rem}.form-check-inline .form-check-label{vertical-align:middle}.valid-feedback{display:none;margin-top:.25rem;font-size:.875rem;color:#28a745}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;width:250px;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(40,167,69,.8);border-radius:.2rem}.custom-select.is-valid,.form-control.is-valid,.was-validated .custom-select:valid,.was-validated .form-control:valid{border-color:#28a745}.custom-select.is-valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.was-validated .form-control:valid:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.custom-select.is-valid~.valid-feedback,.custom-select.is-valid~.valid-tooltip,.form-control.is-valid~.valid-feedback,.form-control.is-valid~.valid-tooltip,.was-validated .custom-select:valid~.valid-feedback,.was-validated .custom-select:valid~.valid-tooltip,.was-validated .form-control:valid~.valid-feedback,.was-validated .form-control:valid~.valid-tooltip{display:block}.form-check-input.is-valid+.form-check-label,.was-validated .form-check-input:valid+.form-check-label{color:#28a745}.custom-control-input.is-valid~.custom-control-indicator,.was-validated .custom-control-input:valid~.custom-control-indicator{background-color:rgba(40,167,69,.25)}.custom-control-input.is-valid~.custom-control-description,.was-validated .custom-control-input:valid~.custom-control-description{color:#28a745}.custom-file-input.is-valid~.custom-file-control,.was-validated .custom-file-input:valid~.custom-file-control{border-color:#28a745}.custom-file-input.is-valid~.custom-file-control::before,.was-validated .custom-file-input:valid~.custom-file-control::before{border-color:inherit}.custom-file-input.is-valid:focus,.was-validated .custom-file-input:valid:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.25)}.invalid-feedback{display:none;margin-top:.25rem;font-size:.875rem;color:#dc3545}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;width:250px;padding:.5rem;margin-top:.1rem;font-size:.875rem;line-height:1;color:#fff;background-color:rgba(220,53,69,.8);border-radius:.2rem}.custom-select.is-invalid,.form-control.is-invalid,.was-validated .custom-select:invalid,.was-validated .form-control:invalid{border-color:#dc3545}.custom-select.is-invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.was-validated .form-control:invalid:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.custom-select.is-invalid~.invalid-feedback,.custom-select.is-invalid~.invalid-tooltip,.form-control.is-invalid~.invalid-feedback,.form-control.is-invalid~.invalid-tooltip,.was-validated .custom-select:invalid~.invalid-feedback,.was-validated .custom-select:invalid~.invalid-tooltip,.was-validated .form-control:invalid~.invalid-feedback,.was-validated .form-control:invalid~.invalid-tooltip{display:block}.form-check-input.is-invalid+.form-check-label,.was-validated .form-check-input:invalid+.form-check-label{color:#dc3545}.custom-control-input.is-invalid~.custom-control-indicator,.was-validated .custom-control-input:invalid~.custom-control-indicator{background-color:rgba(220,53,69,.25)}.custom-control-input.is-invalid~.custom-control-description,.was-validated .custom-control-input:invalid~.custom-control-description{color:#dc3545}.custom-file-input.is-invalid~.custom-file-control,.was-validated .custom-file-input:invalid~.custom-file-control{border-color:#dc3545}.custom-file-input.is-invalid~.custom-file-control::before,.was-validated .custom-file-input:invalid~.custom-file-control::before{border-color:inherit}.custom-file-input.is-invalid:focus,.was-validated .custom-file-input:invalid:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.25)}.form-inline{display:-ms-flexbox;display:flex;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width:576px){.form-inline label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-ms-flex-flow:row wrap;flex-flow:row wrap;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .input-group{width:auto}.form-inline .form-check{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;margin-top:0;margin-bottom:0}.form-inline .form-check-label{padding-left:0}.form-inline .form-check-input{position:relative;margin-top:0;margin-right:.25rem;margin-left:0}.form-inline .custom-control{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding-left:0}.form-inline .custom-control-indicator{position:static;display:inline-block;margin-right:.25rem;vertical-align:text-bottom}.form-inline .has-feedback .form-control-feedback{top:0}}.btn{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem;transition:background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out}.btn:focus,.btn:hover{text-decoration:none}.btn.focus,.btn:focus{outline:0;box-shadow:0 0 0 .2rem rgba(0,123,255,.25)}.btn.disabled,.btn:disabled{opacity:.65}.btn:not([disabled]):not(.disabled).active,.btn:not([disabled]):not(.disabled):active{background-image:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#007bff;border-color:#007bff}.btn-primary:hover{color:#fff;background-color:#0069d9;border-color:#0062cc}.btn-primary.focus,.btn-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-primary.disabled,.btn-primary:disabled{background-color:#007bff;border-color:#007bff}.btn-primary:not([disabled]):not(.disabled).active,.btn-primary:not([disabled]):not(.disabled):active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#0062cc;border-color:#005cbf;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-secondary{color:#fff;background-color:#868e96;border-color:#868e96}.btn-secondary:hover{color:#fff;background-color:#727b84;border-color:#6c757d}.btn-secondary.focus,.btn-secondary:focus{box-shadow:0 0 0 .2rem rgba(134,142,150,.5)}.btn-secondary.disabled,.btn-secondary:disabled{background-color:#868e96;border-color:#868e96}.btn-secondary:not([disabled]):not(.disabled).active,.btn-secondary:not([disabled]):not(.disabled):active,.show>.btn-secondary.dropdown-toggle{color:#fff;background-color:#6c757d;border-color:#666e76;box-shadow:0 0 0 .2rem rgba(134,142,150,.5)}.btn-success{color:#fff;background-color:#28a745;border-color:#28a745}.btn-success:hover{color:#fff;background-color:#218838;border-color:#1e7e34}.btn-success.focus,.btn-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-success.disabled,.btn-success:disabled{background-color:#28a745;border-color:#28a745}.btn-success:not([disabled]):not(.disabled).active,.btn-success:not([disabled]):not(.disabled):active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#1e7e34;border-color:#1c7430;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-info{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-info:hover{color:#fff;background-color:#138496;border-color:#117a8b}.btn-info.focus,.btn-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-info.disabled,.btn-info:disabled{background-color:#17a2b8;border-color:#17a2b8}.btn-info:not([disabled]):not(.disabled).active,.btn-info:not([disabled]):not(.disabled):active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#117a8b;border-color:#10707f;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-warning{color:#111;background-color:#ffc107;border-color:#ffc107}.btn-warning:hover{color:#111;background-color:#e0a800;border-color:#d39e00}.btn-warning.focus,.btn-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-warning.disabled,.btn-warning:disabled{background-color:#ffc107;border-color:#ffc107}.btn-warning:not([disabled]):not(.disabled).active,.btn-warning:not([disabled]):not(.disabled):active,.show>.btn-warning.dropdown-toggle{color:#111;background-color:#d39e00;border-color:#c69500;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-danger{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-danger:hover{color:#fff;background-color:#c82333;border-color:#bd2130}.btn-danger.focus,.btn-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-danger.disabled,.btn-danger:disabled{background-color:#dc3545;border-color:#dc3545}.btn-danger:not([disabled]):not(.disabled).active,.btn-danger:not([disabled]):not(.disabled):active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#bd2130;border-color:#b21f2d;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-light{color:#111;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#111;background-color:#e2e6ea;border-color:#dae0e5}.btn-light.focus,.btn-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-light.disabled,.btn-light:disabled{background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not([disabled]):not(.disabled).active,.btn-light:not([disabled]):not(.disabled):active,.show>.btn-light.dropdown-toggle{color:#111;background-color:#dae0e5;border-color:#d3d9df;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark.focus,.btn-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-dark.disabled,.btn-dark:disabled{background-color:#343a40;border-color:#343a40}.btn-dark:not([disabled]):not(.disabled).active,.btn-dark:not([disabled]):not(.disabled):active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-primary{color:#007bff;background-color:transparent;background-image:none;border-color:#007bff}.btn-outline-primary:hover{color:#fff;background-color:#007bff;border-color:#007bff}.btn-outline-primary.focus,.btn-outline-primary:focus{box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#007bff;background-color:transparent}.btn-outline-primary:not([disabled]):not(.disabled).active,.btn-outline-primary:not([disabled]):not(.disabled):active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#007bff;border-color:#007bff;box-shadow:0 0 0 .2rem rgba(0,123,255,.5)}.btn-outline-secondary{color:#868e96;background-color:transparent;background-image:none;border-color:#868e96}.btn-outline-secondary:hover{color:#fff;background-color:#868e96;border-color:#868e96}.btn-outline-secondary.focus,.btn-outline-secondary:focus{box-shadow:0 0 0 .2rem rgba(134,142,150,.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#868e96;background-color:transparent}.btn-outline-secondary:not([disabled]):not(.disabled).active,.btn-outline-secondary:not([disabled]):not(.disabled):active,.show>.btn-outline-secondary.dropdown-toggle{color:#fff;background-color:#868e96;border-color:#868e96;box-shadow:0 0 0 .2rem rgba(134,142,150,.5)}.btn-outline-success{color:#28a745;background-color:transparent;background-image:none;border-color:#28a745}.btn-outline-success:hover{color:#fff;background-color:#28a745;border-color:#28a745}.btn-outline-success.focus,.btn-outline-success:focus{box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#28a745;background-color:transparent}.btn-outline-success:not([disabled]):not(.disabled).active,.btn-outline-success:not([disabled]):not(.disabled):active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#28a745;border-color:#28a745;box-shadow:0 0 0 .2rem rgba(40,167,69,.5)}.btn-outline-info{color:#17a2b8;background-color:transparent;background-image:none;border-color:#17a2b8}.btn-outline-info:hover{color:#fff;background-color:#17a2b8;border-color:#17a2b8}.btn-outline-info.focus,.btn-outline-info:focus{box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#17a2b8;background-color:transparent}.btn-outline-info:not([disabled]):not(.disabled).active,.btn-outline-info:not([disabled]):not(.disabled):active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#17a2b8;border-color:#17a2b8;box-shadow:0 0 0 .2rem rgba(23,162,184,.5)}.btn-outline-warning{color:#ffc107;background-color:transparent;background-image:none;border-color:#ffc107}.btn-outline-warning:hover{color:#fff;background-color:#ffc107;border-color:#ffc107}.btn-outline-warning.focus,.btn-outline-warning:focus{box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#ffc107;background-color:transparent}.btn-outline-warning:not([disabled]):not(.disabled).active,.btn-outline-warning:not([disabled]):not(.disabled):active,.show>.btn-outline-warning.dropdown-toggle{color:#fff;background-color:#ffc107;border-color:#ffc107;box-shadow:0 0 0 .2rem rgba(255,193,7,.5)}.btn-outline-danger{color:#dc3545;background-color:transparent;background-image:none;border-color:#dc3545}.btn-outline-danger:hover{color:#fff;background-color:#dc3545;border-color:#dc3545}.btn-outline-danger.focus,.btn-outline-danger:focus{box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#dc3545;background-color:transparent}.btn-outline-danger:not([disabled]):not(.disabled).active,.btn-outline-danger:not([disabled]):not(.disabled):active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#dc3545;border-color:#dc3545;box-shadow:0 0 0 .2rem rgba(220,53,69,.5)}.btn-outline-light{color:#f8f9fa;background-color:transparent;background-image:none;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light.focus,.btn-outline-light:focus{box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not([disabled]):not(.disabled).active,.btn-outline-light:not([disabled]):not(.disabled):active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa;box-shadow:0 0 0 .2rem rgba(248,249,250,.5)}.btn-outline-dark{color:#343a40;background-color:transparent;background-image:none;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark.focus,.btn-outline-dark:focus{box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not([disabled]):not(.disabled).active,.btn-outline-dark:not([disabled]):not(.disabled):active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40;box-shadow:0 0 0 .2rem rgba(52,58,64,.5)}.btn-link{font-weight:400;color:#007bff;background-color:transparent}.btn-link:hover{color:#0056b3;text-decoration:underline;background-color:transparent;border-color:transparent}.btn-link.focus,.btn-link:focus{border-color:transparent;box-shadow:none}.btn-link.disabled,.btn-link:disabled{color:#868e96}.btn-group-lg>.btn,.btn-lg{padding:.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:.3rem}.btn-group-sm>.btn,.btn-sm{padding:.25rem .5rem;font-size:.875rem;line-height:1.5;border-radius:.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:.5rem}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;transition:opacity .15s linear}.fade.show{opacity:1}.collapse{display:none}.collapse.show{display:block}tr.collapse.show{display:table-row}tbody.collapse.show{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;transition:height .35s ease}.dropdown,.dropup{position:relative}.dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:.3em solid;border-right:.3em solid transparent;border-bottom:0;border-left:.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem}.dropup .dropdown-menu{margin-top:0;margin-bottom:.125rem}.dropup .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:.255em;vertical-align:.255em;content:"";border-top:0;border-right:.3em solid transparent;border-bottom:.3em solid;border-left:.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropdown-divider{height:0;margin:.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:.25rem 1.5rem;clear:both;font-weight:400;color:#212529;text-align:inherit;white-space:nowrap;background:0 0;border:0}.dropdown-item:focus,.dropdown-item:hover{color:#16181b;text-decoration:none;background-color:#f8f9fa}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#007bff}.dropdown-item.disabled,.dropdown-item:disabled{color:#868e96;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:.5rem 1.5rem;margin-bottom:0;font-size:.875rem;color:#868e96;white-space:nowrap}.btn-group,.btn-group-vertical{position:relative;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;-ms-flex:0 1 auto;flex:0 1 auto}.btn-group-vertical>.btn:hover,.btn-group>.btn:hover{z-index:2}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group,.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn+.dropdown-toggle-split{padding-right:.5625rem;padding-left:.5625rem}.btn+.dropdown-toggle-split::after{margin-left:0}.btn-group-sm>.btn+.dropdown-toggle-split,.btn-sm+.dropdown-toggle-split{padding-right:.375rem;padding-left:.375rem}.btn-group-lg>.btn+.dropdown-toggle-split,.btn-lg+.dropdown-toggle-split{padding-right:.75rem;padding-left:.75rem}.btn-group-vertical{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:center;justify-content:center}.btn-group-vertical .btn,.btn-group-vertical .btn-group{width:100%}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group .form-control{position:relative;z-index:2;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group .form-control:active,.input-group .form-control:focus,.input-group .form-control:hover{z-index:3}.input-group .form-control,.input-group-addon,.input-group-btn{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{white-space:nowrap}.input-group-addon{padding:.375rem .75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;background-color:#e9ecef;border:1px solid #ced4da;border-radius:.25rem}.input-group-addon.form-control-sm,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.input-group-addon.btn{padding:.25rem .5rem;font-size:.875rem;border-radius:.2rem}.input-group-addon.form-control-lg,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.input-group-addon.btn{padding:.5rem 1rem;font-size:1.25rem;border-radius:.3rem}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:not(:last-child),.input-group-addon:not(:last-child),.input-group-btn:not(:first-child)>.btn-group:not(:last-child)>.btn,.input-group-btn:not(:first-child)>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:not(:last-child)>.btn,.input-group-btn:not(:last-child)>.btn-group>.btn,.input-group-btn:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:not(:last-child){border-right:0}.input-group .form-control:not(:first-child),.input-group-addon:not(:first-child),.input-group-btn:not(:first-child)>.btn,.input-group-btn:not(:first-child)>.btn-group>.btn,.input-group-btn:not(:first-child)>.dropdown-toggle,.input-group-btn:not(:last-child)>.btn-group:not(:first-child)>.btn,.input-group-btn:not(:last-child)>.btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.form-control+.input-group-addon:not(:first-child){border-left:0}.input-group-btn{position:relative;-ms-flex-align:stretch;align-items:stretch;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:3}.input-group-btn:first-child>.btn+.btn{margin-left:0}.input-group-btn:not(:last-child)>.btn,.input-group-btn:not(:last-child)>.btn-group{margin-right:-1px}.input-group-btn:not(:first-child)>.btn,.input-group-btn:not(:first-child)>.btn-group{z-index:2;margin-left:0}.input-group-btn:not(:first-child)>.btn-group:first-child,.input-group-btn:not(:first-child)>.btn:first-child{margin-left:-1px}.input-group-btn:not(:first-child)>.btn-group:active,.input-group-btn:not(:first-child)>.btn-group:focus,.input-group-btn:not(:first-child)>.btn-group:hover,.input-group-btn:not(:first-child)>.btn:active,.input-group-btn:not(:first-child)>.btn:focus,.input-group-btn:not(:first-child)>.btn:hover{z-index:3}.custom-control{position:relative;display:-ms-inline-flexbox;display:inline-flex;min-height:1.5rem;padding-left:1.5rem;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked~.custom-control-indicator{color:#fff;background-color:#007bff}.custom-control-input:focus~.custom-control-indicator{box-shadow:0 0 0 1px #fff,0 0 0 .2rem rgba(0,123,255,.25)}.custom-control-input:active~.custom-control-indicator{color:#fff;background-color:#b3d7ff}.custom-control-input:disabled~.custom-control-indicator{background-color:#e9ecef}.custom-control-input:disabled~.custom-control-description{color:#868e96}.custom-control-indicator{position:absolute;top:.25rem;left:0;display:block;width:1rem;height:1rem;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#ddd;background-repeat:no-repeat;background-position:center center;background-size:50% 50%}.custom-checkbox .custom-control-indicator{border-radius:.25rem}.custom-checkbox .custom-control-input:checked~.custom-control-indicator{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate~.custom-control-indicator{background-color:#007bff;background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-radio .custom-control-indicator{border-radius:50%}.custom-radio .custom-control-input:checked~.custom-control-indicator{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E")}.custom-controls-stacked{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.custom-controls-stacked .custom-control{margin-bottom:.25rem}.custom-controls-stacked .custom-control+.custom-control{margin-left:0}.custom-select{display:inline-block;max-width:100%;height:calc(2.25rem + 2px);padding:.375rem 1.75rem .375rem .75rem;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right .75rem center;background-size:8px 10px;border:1px solid #ced4da;border-radius:.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#80bdff;outline:0}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple]{height:auto;background-image:none}.custom-select:disabled{color:#868e96;background-color:#e9ecef}.custom-select::-ms-expand{opacity:0}.custom-select-sm{height:calc(1.8125rem + 2px);padding-top:.375rem;padding-bottom:.375rem;font-size:75%}.custom-file{position:relative;display:inline-block;max-width:100%;height:calc(2.25rem + 2px);margin-bottom:0}.custom-file-input{min-width:14rem;max-width:100%;height:calc(2.25rem + 2px);margin:0;opacity:0}.custom-file-input:focus~.custom-file-control{box-shadow:0 0 0 .075rem #fff,0 0 0 .2rem #007bff}.custom-file-control{position:absolute;top:0;right:0;left:0;z-index:5;height:calc(2.25rem + 2px);padding:.375rem .75rem;line-height:1.5;color:#495057;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff;border:1px solid #ced4da;border-radius:.25rem}.custom-file-control:lang(en):empty::after{content:"Choose file..."}.custom-file-control::before{position:absolute;top:-1px;right:-1px;bottom:-1px;z-index:6;display:block;height:calc(2.25rem + 2px);padding:.375rem .75rem;line-height:1.5;color:#495057;background-color:#e9ecef;border:1px solid #ced4da;border-radius:0 .25rem .25rem 0}.custom-file-control:lang(en)::before{content:"Browse"}.nav{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:.5rem 1rem}.nav-link:focus,.nav-link:hover{text-decoration:none}.nav-link.disabled{color:#868e96}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:.25rem;border-top-right-radius:.25rem}.nav-tabs .nav-link:focus,.nav-tabs .nav-link:hover{border-color:#e9ecef #e9ecef #ddd}.nav-tabs .nav-link.disabled{color:#868e96;background-color:transparent;border-color:transparent}.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{color:#495057;background-color:#fff;border-color:#ddd #ddd #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#007bff}.nav-fill .nav-item{-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:.5rem 1rem}.navbar>.container,.navbar>.container-fluid{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:.3125rem;padding-bottom:.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-nav{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:.5rem;padding-bottom:.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:.25rem .75rem;font-size:1.25rem;line-height:1;background:0 0;border:1px solid transparent;border-radius:.25rem}.navbar-toggler:focus,.navbar-toggler:hover{text-decoration:none}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width:575px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:576px){.navbar-expand-sm{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-sm .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}.navbar-expand-sm .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:767px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:768px){.navbar-expand-md{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-md .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}.navbar-expand-md .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:991px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:992px){.navbar-expand-lg{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-lg .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}.navbar-expand-lg .dropup .dropdown-menu{top:auto;bottom:100%}}@media (max-width:1199px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width:1200px){.navbar-expand-xl{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand-xl .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}.navbar-expand-xl .dropup .dropdown-menu{top:auto;bottom:100%}}.navbar-expand{-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .dropdown-menu-right{right:0;left:auto}.navbar-expand .navbar-nav .nav-link{padding-right:.5rem;padding-left:.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-ms-flexbox!important;display:flex!important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-expand .dropup .dropdown-menu{top:auto;bottom:100%}.navbar-light .navbar-brand{color:rgba(0,0,0,.9)}.navbar-light .navbar-brand:focus,.navbar-light .navbar-brand:hover{color:rgba(0,0,0,.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,.5)}.navbar-light .navbar-nav .nav-link:focus,.navbar-light .navbar-nav .nav-link:hover{color:rgba(0,0,0,.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,.3)}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:rgba(0,0,0,.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,.5);border-color:rgba(0,0,0,.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,.9)}.navbar-light .navbar-text a:focus,.navbar-light .navbar-text a:hover{color:rgba(0,0,0,.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:focus,.navbar-dark .navbar-brand:hover{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,.5)}.navbar-dark .navbar-nav .nav-link:focus,.navbar-dark .navbar-nav .nav-link:hover{color:rgba(255,255,255,.75)}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,.25)}.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.active,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .show>.nav-link{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,.5);border-color:rgba(255,255,255,.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:rgba(255,255,255,.5)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:focus,.navbar-dark .navbar-text a:hover{color:#fff}.card{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-body{-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:.75rem}.card-subtitle{margin-top:-.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,.03);border-bottom:1px solid rgba(0,0,0,.125)}.card-header:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:.75rem 1.25rem;background-color:rgba(0,0,0,.03);border-top:1px solid rgba(0,0,0,.125)}.card-footer:last-child{border-radius:0 0 calc(.25rem - 1px) calc(.25rem - 1px)}.card-header-tabs{margin-right:-.625rem;margin-bottom:-.75rem;margin-left:-.625rem;border-bottom:0}.card-header-pills{margin-right:-.625rem;margin-left:-.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(.25rem - 1px);border-top-right-radius:calc(.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(.25rem - 1px);border-bottom-left-radius:calc(.25rem - 1px)}.card-deck{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width:576px){.card-deck{-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{display:-ms-flexbox;display:flex;-ms-flex:1 0 0%;flex:1 0 0%;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.card-group .card{margin-bottom:15px}@media (min-width:576px){.card-group{-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group .card{-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group .card+.card{margin-left:0;border-left:0}.card-group .card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group .card:first-child .card-img-top{border-top-right-radius:0}.card-group .card:first-child .card-img-bottom{border-bottom-right-radius:0}.card-group .card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group .card:last-child .card-img-top{border-top-left-radius:0}.card-group .card:last-child .card-img-bottom{border-bottom-left-radius:0}.card-group .card:only-child{border-radius:.25rem}.card-group .card:only-child .card-img-top{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.card-group .card:only-child .card-img-bottom{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.card-group .card:not(:first-child):not(:last-child):not(:only-child){border-radius:0}.card-group .card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,.card-group .card:not(:first-child):not(:last-child):not(:only-child) .card-img-top{border-radius:0}}.card-columns .card{margin-bottom:.75rem}@media (min-width:576px){.card-columns{-webkit-column-count:3;column-count:3;-webkit-column-gap:1.25rem;column-gap:1.25rem}.card-columns .card{display:inline-block;width:100%}}.breadcrumb{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:.25rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:.5rem;padding-left:.5rem;color:#868e96;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#868e96}.pagination{display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:.25rem}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.page-item:last-child .page-link{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.page-item.active .page-link{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.page-item.disabled .page-link{color:#868e96;pointer-events:none;background-color:#fff;border-color:#ddd}.page-link{position:relative;display:block;padding:.5rem .75rem;margin-left:-1px;line-height:1.25;color:#007bff;background-color:#fff;border:1px solid #ddd}.page-link:focus,.page-link:hover{color:#0056b3;text-decoration:none;background-color:#e9ecef;border-color:#ddd}.pagination-lg .page-link{padding:.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:.3rem;border-bottom-left-radius:.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:.3rem;border-bottom-right-radius:.3rem}.pagination-sm .page-link{padding:.25rem .5rem;font-size:.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:.2rem;border-bottom-left-radius:.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:.2rem;border-bottom-right-radius:.2rem}.badge{display:inline-block;padding:.25em .4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25rem}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:.6em;padding-left:.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#007bff}.badge-primary[href]:focus,.badge-primary[href]:hover{color:#fff;text-decoration:none;background-color:#0062cc}.badge-secondary{color:#fff;background-color:#868e96}.badge-secondary[href]:focus,.badge-secondary[href]:hover{color:#fff;text-decoration:none;background-color:#6c757d}.badge-success{color:#fff;background-color:#28a745}.badge-success[href]:focus,.badge-success[href]:hover{color:#fff;text-decoration:none;background-color:#1e7e34}.badge-info{color:#fff;background-color:#17a2b8}.badge-info[href]:focus,.badge-info[href]:hover{color:#fff;text-decoration:none;background-color:#117a8b}.badge-warning{color:#111;background-color:#ffc107}.badge-warning[href]:focus,.badge-warning[href]:hover{color:#111;text-decoration:none;background-color:#d39e00}.badge-danger{color:#fff;background-color:#dc3545}.badge-danger[href]:focus,.badge-danger[href]:hover{color:#fff;text-decoration:none;background-color:#bd2130}.badge-light{color:#111;background-color:#f8f9fa}.badge-light[href]:focus,.badge-light[href]:hover{color:#111;text-decoration:none;background-color:#dae0e5}.badge-dark{color:#fff;background-color:#343a40}.badge-dark[href]:focus,.badge-dark[href]:hover{color:#fff;text-decoration:none;background-color:#1d2124}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:.3rem}@media (min-width:576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible .close{position:absolute;top:0;right:0;padding:.75rem 1.25rem;color:inherit}.alert-primary{color:#004085;background-color:#cce5ff;border-color:#b8daff}.alert-primary hr{border-top-color:#9fcdff}.alert-primary .alert-link{color:#002752}.alert-secondary{color:#464a4e;background-color:#e7e8ea;border-color:#dddfe2}.alert-secondary hr{border-top-color:#cfd2d6}.alert-secondary .alert-link{color:#2e3133}.alert-success{color:#155724;background-color:#d4edda;border-color:#c3e6cb}.alert-success hr{border-top-color:#b1dfbb}.alert-success .alert-link{color:#0b2e13}.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb}.alert-info hr{border-top-color:#abdde5}.alert-info .alert-link{color:#062c33}.alert-warning{color:#856404;background-color:#fff3cd;border-color:#ffeeba}.alert-warning hr{border-top-color:#ffe8a1}.alert-warning .alert-link{color:#533f03}.alert-danger{color:#721c24;background-color:#f8d7da;border-color:#f5c6cb}.alert-danger hr{border-top-color:#f1b0b7}.alert-danger .alert-link{color:#491217}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;font-size:.75rem;background-color:#e9ecef;border-radius:.25rem}.progress-bar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#fff;background-color:#007bff}.progress-bar-striped{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}.media{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start}.media-body{-ms-flex:1;flex:1}.list-group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:focus,.list-group-item-action:hover{color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#212529;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,.125)}.list-group-item:first-child{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.list-group-item:focus,.list-group-item:hover{text-decoration:none}.list-group-item.disabled,.list-group-item:disabled{color:#868e96;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#007bff;border-color:#007bff}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{border-bottom:0}.list-group-item-primary{color:#004085;background-color:#b8daff}a.list-group-item-primary,button.list-group-item-primary{color:#004085}a.list-group-item-primary:focus,a.list-group-item-primary:hover,button.list-group-item-primary:focus,button.list-group-item-primary:hover{color:#004085;background-color:#9fcdff}a.list-group-item-primary.active,button.list-group-item-primary.active{color:#fff;background-color:#004085;border-color:#004085}.list-group-item-secondary{color:#464a4e;background-color:#dddfe2}a.list-group-item-secondary,button.list-group-item-secondary{color:#464a4e}a.list-group-item-secondary:focus,a.list-group-item-secondary:hover,button.list-group-item-secondary:focus,button.list-group-item-secondary:hover{color:#464a4e;background-color:#cfd2d6}a.list-group-item-secondary.active,button.list-group-item-secondary.active{color:#fff;background-color:#464a4e;border-color:#464a4e}.list-group-item-success{color:#155724;background-color:#c3e6cb}a.list-group-item-success,button.list-group-item-success{color:#155724}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#155724;background-color:#b1dfbb}a.list-group-item-success.active,button.list-group-item-success.active{color:#fff;background-color:#155724;border-color:#155724}.list-group-item-info{color:#0c5460;background-color:#bee5eb}a.list-group-item-info,button.list-group-item-info{color:#0c5460}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#0c5460;background-color:#abdde5}a.list-group-item-info.active,button.list-group-item-info.active{color:#fff;background-color:#0c5460;border-color:#0c5460}.list-group-item-warning{color:#856404;background-color:#ffeeba}a.list-group-item-warning,button.list-group-item-warning{color:#856404}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#856404;background-color:#ffe8a1}a.list-group-item-warning.active,button.list-group-item-warning.active{color:#fff;background-color:#856404;border-color:#856404}.list-group-item-danger{color:#721c24;background-color:#f5c6cb}a.list-group-item-danger,button.list-group-item-danger{color:#721c24}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#721c24;background-color:#f1b0b7}a.list-group-item-danger.active,button.list-group-item-danger.active{color:#fff;background-color:#721c24;border-color:#721c24}.list-group-item-light{color:#818182;background-color:#fdfdfe}a.list-group-item-light,button.list-group-item-light{color:#818182}a.list-group-item-light:focus,a.list-group-item-light:hover,button.list-group-item-light:focus,button.list-group-item-light:hover{color:#818182;background-color:#ececf6}a.list-group-item-light.active,button.list-group-item-light.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}a.list-group-item-dark,button.list-group-item-dark{color:#1b1e21}a.list-group-item-dark:focus,a.list-group-item-dark:hover,button.list-group-item-dark:focus,button.list-group-item-dark:hover{color:#1b1e21;background-color:#b9bbbe}a.list-group-item-dark.active,button.list-group-item-dark.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:focus,.close:hover{color:#000;text-decoration:none;opacity:.75}button.close{padding:0;background:0 0;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;outline:0}.modal.fade .modal-dialog{transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.show .modal-dialog{-webkit-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px;pointer-events:none}.modal-content{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:.5}.modal-header{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:flex-start;-ms-flex-pack:justify;justify-content:space-between;padding:15px;border-bottom:1px solid #e9ecef;border-top-left-radius:.3rem;border-top-right-radius:.3rem}.modal-header .close{padding:15px;margin:-15px -15px -15px auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-ms-flex:1 1 auto;flex:1 1 auto;padding:15px}.modal-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;padding:15px;border-top:1px solid #e9ecef}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:576px){.modal-dialog{max-width:500px;margin:30px auto}.modal-sm{max-width:300px}}@media (min-width:992px){.modal-lg{max-width:800px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:.9}.tooltip .arrow{position:absolute;display:block;width:5px;height:5px}.tooltip .arrow::before{position:absolute;border-color:transparent;border-style:solid}.tooltip.bs-tooltip-auto[x-placement^=top],.tooltip.bs-tooltip-top{padding:5px 0}.tooltip.bs-tooltip-auto[x-placement^=top] .arrow,.tooltip.bs-tooltip-top .arrow{bottom:0}.tooltip.bs-tooltip-auto[x-placement^=top] .arrow::before,.tooltip.bs-tooltip-top .arrow::before{margin-left:-3px;content:"";border-width:5px 5px 0;border-top-color:#000}.tooltip.bs-tooltip-auto[x-placement^=right],.tooltip.bs-tooltip-right{padding:0 5px}.tooltip.bs-tooltip-auto[x-placement^=right] .arrow,.tooltip.bs-tooltip-right .arrow{left:0}.tooltip.bs-tooltip-auto[x-placement^=right] .arrow::before,.tooltip.bs-tooltip-right .arrow::before{margin-top:-3px;content:"";border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.bs-tooltip-auto[x-placement^=bottom],.tooltip.bs-tooltip-bottom{padding:5px 0}.tooltip.bs-tooltip-auto[x-placement^=bottom] .arrow,.tooltip.bs-tooltip-bottom .arrow{top:0}.tooltip.bs-tooltip-auto[x-placement^=bottom] .arrow::before,.tooltip.bs-tooltip-bottom .arrow::before{margin-left:-3px;content:"";border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bs-tooltip-auto[x-placement^=left],.tooltip.bs-tooltip-left{padding:0 5px}.tooltip.bs-tooltip-auto[x-placement^=left] .arrow,.tooltip.bs-tooltip-left .arrow{right:0}.tooltip.bs-tooltip-auto[x-placement^=left] .arrow::before,.tooltip.bs-tooltip-left .arrow::before{right:0;margin-top:-3px;content:"";border-width:5px 0 5px 5px;border-left-color:#000}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:.3rem}.popover .arrow{position:absolute;display:block;width:.8rem;height:.4rem}.popover .arrow::after,.popover .arrow::before{position:absolute;display:block;border-color:transparent;border-style:solid}.popover .arrow::before{content:"";border-width:.8rem}.popover .arrow::after{content:"";border-width:.8rem}.popover.bs-popover-auto[x-placement^=top],.popover.bs-popover-top{margin-bottom:.8rem}.popover.bs-popover-auto[x-placement^=top] .arrow,.popover.bs-popover-top .arrow{bottom:0}.popover.bs-popover-auto[x-placement^=top] .arrow::after,.popover.bs-popover-auto[x-placement^=top] .arrow::before,.popover.bs-popover-top .arrow::after,.popover.bs-popover-top .arrow::before{border-bottom-width:0}.popover.bs-popover-auto[x-placement^=top] .arrow::before,.popover.bs-popover-top .arrow::before{bottom:-.8rem;margin-left:-.8rem;border-top-color:rgba(0,0,0,.25)}.popover.bs-popover-auto[x-placement^=top] .arrow::after,.popover.bs-popover-top .arrow::after{bottom:calc((.8rem - 1px) * -1);margin-left:-.8rem;border-top-color:#fff}.popover.bs-popover-auto[x-placement^=right],.popover.bs-popover-right{margin-left:.8rem}.popover.bs-popover-auto[x-placement^=right] .arrow,.popover.bs-popover-right .arrow{left:0}.popover.bs-popover-auto[x-placement^=right] .arrow::after,.popover.bs-popover-auto[x-placement^=right] .arrow::before,.popover.bs-popover-right .arrow::after,.popover.bs-popover-right .arrow::before{margin-top:-.8rem;border-left-width:0}.popover.bs-popover-auto[x-placement^=right] .arrow::before,.popover.bs-popover-right .arrow::before{left:-.8rem;border-right-color:rgba(0,0,0,.25)}.popover.bs-popover-auto[x-placement^=right] .arrow::after,.popover.bs-popover-right .arrow::after{left:calc((.8rem - 1px) * -1);border-right-color:#fff}.popover.bs-popover-auto[x-placement^=bottom],.popover.bs-popover-bottom{margin-top:.8rem}.popover.bs-popover-auto[x-placement^=bottom] .arrow,.popover.bs-popover-bottom .arrow{top:0}.popover.bs-popover-auto[x-placement^=bottom] .arrow::after,.popover.bs-popover-auto[x-placement^=bottom] .arrow::before,.popover.bs-popover-bottom .arrow::after,.popover.bs-popover-bottom .arrow::before{margin-left:-.8rem;border-top-width:0}.popover.bs-popover-auto[x-placement^=bottom] .arrow::before,.popover.bs-popover-bottom .arrow::before{top:-.8rem;border-bottom-color:rgba(0,0,0,.25)}.popover.bs-popover-auto[x-placement^=bottom] .arrow::after,.popover.bs-popover-bottom .arrow::after{top:calc((.8rem - 1px) * -1);border-bottom-color:#fff}.popover.bs-popover-auto[x-placement^=bottom] .popover-header::before,.popover.bs-popover-bottom .popover-header::before{position:absolute;top:0;left:50%;display:block;width:20px;margin-left:-10px;content:"";border-bottom:1px solid #f7f7f7}.popover.bs-popover-auto[x-placement^=left],.popover.bs-popover-left{margin-right:.8rem}.popover.bs-popover-auto[x-placement^=left] .arrow,.popover.bs-popover-left .arrow{right:0}.popover.bs-popover-auto[x-placement^=left] .arrow::after,.popover.bs-popover-auto[x-placement^=left] .arrow::before,.popover.bs-popover-left .arrow::after,.popover.bs-popover-left .arrow::before{margin-top:-.8rem;border-right-width:0}.popover.bs-popover-auto[x-placement^=left] .arrow::before,.popover.bs-popover-left .arrow::before{right:-.8rem;border-left-color:rgba(0,0,0,.25)}.popover.bs-popover-auto[x-placement^=left] .arrow::after,.popover.bs-popover-left .arrow::after{right:calc((.8rem - 1px) * -1);border-left-color:#fff}.popover-header{padding:.5rem .75rem;margin-bottom:0;font-size:1rem;color:inherit;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(.3rem - 1px);border-top-right-radius:calc(.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:.5rem .75rem;color:#212529}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-item{position:relative;display:none;-ms-flex-align:center;align-items:center;width:100%;transition:-webkit-transform .6s ease;transition:transform .6s ease;transition:transform .6s ease,-webkit-transform .6s ease;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-item-next,.carousel-item-prev,.carousel-item.active{display:block}.carousel-item-next,.carousel-item-prev{position:absolute;top:0}.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translateX(0);transform:translateX(0)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.active.carousel-item-right,.carousel-item-next{-webkit-transform:translateX(100%);transform:translateX(100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-right,.carousel-item-next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translateX(-100%);transform:translateX(-100%)}@supports ((-webkit-transform-style:preserve-3d) or (transform-style:preserve-3d)){.active.carousel-item-left,.carousel-item-prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}.carousel-control-next,.carousel-control-prev{position:absolute;top:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:.5}.carousel-control-next:focus,.carousel-control-next:hover,.carousel-control-prev:focus,.carousel-control-prev:hover{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-next-icon,.carousel-control-prev-icon{display:inline-block;width:20px;height:20px;background:transparent no-repeat center center;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{position:absolute;right:0;bottom:10px;left:0;z-index:15;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{position:relative;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;background-color:rgba(255,255,255,.5)}.carousel-indicators li::before{position:absolute;top:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators li::after{position:absolute;bottom:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}.align-baseline{vertical-align:baseline!important}.align-top{vertical-align:top!important}.align-middle{vertical-align:middle!important}.align-bottom{vertical-align:bottom!important}.align-text-bottom{vertical-align:text-bottom!important}.align-text-top{vertical-align:text-top!important}.bg-primary{background-color:#007bff!important}a.bg-primary:focus,a.bg-primary:hover{background-color:#0062cc!important}.bg-secondary{background-color:#868e96!important}a.bg-secondary:focus,a.bg-secondary:hover{background-color:#6c757d!important}.bg-success{background-color:#28a745!important}a.bg-success:focus,a.bg-success:hover{background-color:#1e7e34!important}.bg-info{background-color:#17a2b8!important}a.bg-info:focus,a.bg-info:hover{background-color:#117a8b!important}.bg-warning{background-color:#ffc107!important}a.bg-warning:focus,a.bg-warning:hover{background-color:#d39e00!important}.bg-danger{background-color:#dc3545!important}a.bg-danger:focus,a.bg-danger:hover{background-color:#bd2130!important}.bg-light{background-color:#f8f9fa!important}a.bg-light:focus,a.bg-light:hover{background-color:#dae0e5!important}.bg-dark{background-color:#343a40!important}a.bg-dark:focus,a.bg-dark:hover{background-color:#1d2124!important}.bg-white{background-color:#fff!important}.bg-transparent{background-color:transparent!important}.border{border:1px solid #e9ecef!important}.border-0{border:0!important}.border-top-0{border-top:0!important}.border-right-0{border-right:0!important}.border-bottom-0{border-bottom:0!important}.border-left-0{border-left:0!important}.border-primary{border-color:#007bff!important}.border-secondary{border-color:#868e96!important}.border-success{border-color:#28a745!important}.border-info{border-color:#17a2b8!important}.border-warning{border-color:#ffc107!important}.border-danger{border-color:#dc3545!important}.border-light{border-color:#f8f9fa!important}.border-dark{border-color:#343a40!important}.border-white{border-color:#fff!important}.rounded{border-radius:.25rem!important}.rounded-top{border-top-left-radius:.25rem!important;border-top-right-radius:.25rem!important}.rounded-right{border-top-right-radius:.25rem!important;border-bottom-right-radius:.25rem!important}.rounded-bottom{border-bottom-right-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-left{border-top-left-radius:.25rem!important;border-bottom-left-radius:.25rem!important}.rounded-circle{border-radius:50%!important}.rounded-0{border-radius:0!important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none!important}.d-inline{display:inline!important}.d-inline-block{display:inline-block!important}.d-block{display:block!important}.d-table{display:table!important}.d-table-row{display:table-row!important}.d-table-cell{display:table-cell!important}.d-flex{display:-ms-flexbox!important;display:flex!important}.d-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}@media (min-width:576px){.d-sm-none{display:none!important}.d-sm-inline{display:inline!important}.d-sm-inline-block{display:inline-block!important}.d-sm-block{display:block!important}.d-sm-table{display:table!important}.d-sm-table-row{display:table-row!important}.d-sm-table-cell{display:table-cell!important}.d-sm-flex{display:-ms-flexbox!important;display:flex!important}.d-sm-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:768px){.d-md-none{display:none!important}.d-md-inline{display:inline!important}.d-md-inline-block{display:inline-block!important}.d-md-block{display:block!important}.d-md-table{display:table!important}.d-md-table-row{display:table-row!important}.d-md-table-cell{display:table-cell!important}.d-md-flex{display:-ms-flexbox!important;display:flex!important}.d-md-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:992px){.d-lg-none{display:none!important}.d-lg-inline{display:inline!important}.d-lg-inline-block{display:inline-block!important}.d-lg-block{display:block!important}.d-lg-table{display:table!important}.d-lg-table-row{display:table-row!important}.d-lg-table-cell{display:table-cell!important}.d-lg-flex{display:-ms-flexbox!important;display:flex!important}.d-lg-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}@media (min-width:1200px){.d-xl-none{display:none!important}.d-xl-inline{display:inline!important}.d-xl-inline-block{display:inline-block!important}.d-xl-block{display:block!important}.d-xl-table{display:table!important}.d-xl-table-row{display:table-row!important}.d-xl-table-cell{display:table-cell!important}.d-xl-flex{display:-ms-flexbox!important;display:flex!important}.d-xl-inline-flex{display:-ms-inline-flexbox!important;display:inline-flex!important}}.d-print-block{display:none!important}@media print{.d-print-block{display:block!important}}.d-print-inline{display:none!important}@media print{.d-print-inline{display:inline!important}}.d-print-inline-block{display:none!important}@media print{.d-print-inline-block{display:inline-block!important}}@media print{.d-print-none{display:none!important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.857143%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}.float-left{float:left!important}.float-right{float:right!important}.float-none{float:none!important}@media (min-width:576px){.float-sm-left{float:left!important}.float-sm-right{float:right!important}.float-sm-none{float:none!important}}@media (min-width:768px){.float-md-left{float:left!important}.float-md-right{float:right!important}.float-md-none{float:none!important}}@media (min-width:992px){.float-lg-left{float:left!important}.float-lg-right{float:right!important}.float-lg-none{float:none!important}}@media (min-width:1200px){.float-xl-left{float:left!important}.float-xl-right{float:right!important}.float-xl-none{float:none!important}}.position-static{position:static!important}.position-relative{position:relative!important}.position-absolute{position:absolute!important}.position-fixed{position:fixed!important}.position-sticky{position:-webkit-sticky!important;position:sticky!important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports ((position:-webkit-sticky) or (position:sticky)){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;-webkit-clip-path:inset(50%);clip-path:inset(50%);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;-webkit-clip-path:none;clip-path:none}.w-25{width:25%!important}.w-50{width:50%!important}.w-75{width:75%!important}.w-100{width:100%!important}.h-25{height:25%!important}.h-50{height:50%!important}.h-75{height:75%!important}.h-100{height:100%!important}.mw-100{max-width:100%!important}.mh-100{max-height:100%!important}.m-0{margin:0!important}.mt-0,.my-0{margin-top:0!important}.mr-0,.mx-0{margin-right:0!important}.mb-0,.my-0{margin-bottom:0!important}.ml-0,.mx-0{margin-left:0!important}.m-1{margin:.25rem!important}.mt-1,.my-1{margin-top:.25rem!important}.mr-1,.mx-1{margin-right:.25rem!important}.mb-1,.my-1{margin-bottom:.25rem!important}.ml-1,.mx-1{margin-left:.25rem!important}.m-2{margin:.5rem!important}.mt-2,.my-2{margin-top:.5rem!important}.mr-2,.mx-2{margin-right:.5rem!important}.mb-2,.my-2{margin-bottom:.5rem!important}.ml-2,.mx-2{margin-left:.5rem!important}.m-3{margin:1rem!important}.mt-3,.my-3{margin-top:1rem!important}.mr-3,.mx-3{margin-right:1rem!important}.mb-3,.my-3{margin-bottom:1rem!important}.ml-3,.mx-3{margin-left:1rem!important}.m-4{margin:1.5rem!important}.mt-4,.my-4{margin-top:1.5rem!important}.mr-4,.mx-4{margin-right:1.5rem!important}.mb-4,.my-4{margin-bottom:1.5rem!important}.ml-4,.mx-4{margin-left:1.5rem!important}.m-5{margin:3rem!important}.mt-5,.my-5{margin-top:3rem!important}.mr-5,.mx-5{margin-right:3rem!important}.mb-5,.my-5{margin-bottom:3rem!important}.ml-5,.mx-5{margin-left:3rem!important}.p-0{padding:0!important}.pt-0,.py-0{padding-top:0!important}.pr-0,.px-0{padding-right:0!important}.pb-0,.py-0{padding-bottom:0!important}.pl-0,.px-0{padding-left:0!important}.p-1{padding:.25rem!important}.pt-1,.py-1{padding-top:.25rem!important}.pr-1,.px-1{padding-right:.25rem!important}.pb-1,.py-1{padding-bottom:.25rem!important}.pl-1,.px-1{padding-left:.25rem!important}.p-2{padding:.5rem!important}.pt-2,.py-2{padding-top:.5rem!important}.pr-2,.px-2{padding-right:.5rem!important}.pb-2,.py-2{padding-bottom:.5rem!important}.pl-2,.px-2{padding-left:.5rem!important}.p-3{padding:1rem!important}.pt-3,.py-3{padding-top:1rem!important}.pr-3,.px-3{padding-right:1rem!important}.pb-3,.py-3{padding-bottom:1rem!important}.pl-3,.px-3{padding-left:1rem!important}.p-4{padding:1.5rem!important}.pt-4,.py-4{padding-top:1.5rem!important}.pr-4,.px-4{padding-right:1.5rem!important}.pb-4,.py-4{padding-bottom:1.5rem!important}.pl-4,.px-4{padding-left:1.5rem!important}.p-5{padding:3rem!important}.pt-5,.py-5{padding-top:3rem!important}.pr-5,.px-5{padding-right:3rem!important}.pb-5,.py-5{padding-bottom:3rem!important}.pl-5,.px-5{padding-left:3rem!important}.m-auto{margin:auto!important}.mt-auto,.my-auto{margin-top:auto!important}.mr-auto,.mx-auto{margin-right:auto!important}.mb-auto,.my-auto{margin-bottom:auto!important}.ml-auto,.mx-auto{margin-left:auto!important}@media (min-width:576px){.m-sm-0{margin:0!important}.mt-sm-0,.my-sm-0{margin-top:0!important}.mr-sm-0,.mx-sm-0{margin-right:0!important}.mb-sm-0,.my-sm-0{margin-bottom:0!important}.ml-sm-0,.mx-sm-0{margin-left:0!important}.m-sm-1{margin:.25rem!important}.mt-sm-1,.my-sm-1{margin-top:.25rem!important}.mr-sm-1,.mx-sm-1{margin-right:.25rem!important}.mb-sm-1,.my-sm-1{margin-bottom:.25rem!important}.ml-sm-1,.mx-sm-1{margin-left:.25rem!important}.m-sm-2{margin:.5rem!important}.mt-sm-2,.my-sm-2{margin-top:.5rem!important}.mr-sm-2,.mx-sm-2{margin-right:.5rem!important}.mb-sm-2,.my-sm-2{margin-bottom:.5rem!important}.ml-sm-2,.mx-sm-2{margin-left:.5rem!important}.m-sm-3{margin:1rem!important}.mt-sm-3,.my-sm-3{margin-top:1rem!important}.mr-sm-3,.mx-sm-3{margin-right:1rem!important}.mb-sm-3,.my-sm-3{margin-bottom:1rem!important}.ml-sm-3,.mx-sm-3{margin-left:1rem!important}.m-sm-4{margin:1.5rem!important}.mt-sm-4,.my-sm-4{margin-top:1.5rem!important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem!important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem!important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem!important}.m-sm-5{margin:3rem!important}.mt-sm-5,.my-sm-5{margin-top:3rem!important}.mr-sm-5,.mx-sm-5{margin-right:3rem!important}.mb-sm-5,.my-sm-5{margin-bottom:3rem!important}.ml-sm-5,.mx-sm-5{margin-left:3rem!important}.p-sm-0{padding:0!important}.pt-sm-0,.py-sm-0{padding-top:0!important}.pr-sm-0,.px-sm-0{padding-right:0!important}.pb-sm-0,.py-sm-0{padding-bottom:0!important}.pl-sm-0,.px-sm-0{padding-left:0!important}.p-sm-1{padding:.25rem!important}.pt-sm-1,.py-sm-1{padding-top:.25rem!important}.pr-sm-1,.px-sm-1{padding-right:.25rem!important}.pb-sm-1,.py-sm-1{padding-bottom:.25rem!important}.pl-sm-1,.px-sm-1{padding-left:.25rem!important}.p-sm-2{padding:.5rem!important}.pt-sm-2,.py-sm-2{padding-top:.5rem!important}.pr-sm-2,.px-sm-2{padding-right:.5rem!important}.pb-sm-2,.py-sm-2{padding-bottom:.5rem!important}.pl-sm-2,.px-sm-2{padding-left:.5rem!important}.p-sm-3{padding:1rem!important}.pt-sm-3,.py-sm-3{padding-top:1rem!important}.pr-sm-3,.px-sm-3{padding-right:1rem!important}.pb-sm-3,.py-sm-3{padding-bottom:1rem!important}.pl-sm-3,.px-sm-3{padding-left:1rem!important}.p-sm-4{padding:1.5rem!important}.pt-sm-4,.py-sm-4{padding-top:1.5rem!important}.pr-sm-4,.px-sm-4{padding-right:1.5rem!important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem!important}.pl-sm-4,.px-sm-4{padding-left:1.5rem!important}.p-sm-5{padding:3rem!important}.pt-sm-5,.py-sm-5{padding-top:3rem!important}.pr-sm-5,.px-sm-5{padding-right:3rem!important}.pb-sm-5,.py-sm-5{padding-bottom:3rem!important}.pl-sm-5,.px-sm-5{padding-left:3rem!important}.m-sm-auto{margin:auto!important}.mt-sm-auto,.my-sm-auto{margin-top:auto!important}.mr-sm-auto,.mx-sm-auto{margin-right:auto!important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto!important}.ml-sm-auto,.mx-sm-auto{margin-left:auto!important}}@media (min-width:768px){.m-md-0{margin:0!important}.mt-md-0,.my-md-0{margin-top:0!important}.mr-md-0,.mx-md-0{margin-right:0!important}.mb-md-0,.my-md-0{margin-bottom:0!important}.ml-md-0,.mx-md-0{margin-left:0!important}.m-md-1{margin:.25rem!important}.mt-md-1,.my-md-1{margin-top:.25rem!important}.mr-md-1,.mx-md-1{margin-right:.25rem!important}.mb-md-1,.my-md-1{margin-bottom:.25rem!important}.ml-md-1,.mx-md-1{margin-left:.25rem!important}.m-md-2{margin:.5rem!important}.mt-md-2,.my-md-2{margin-top:.5rem!important}.mr-md-2,.mx-md-2{margin-right:.5rem!important}.mb-md-2,.my-md-2{margin-bottom:.5rem!important}.ml-md-2,.mx-md-2{margin-left:.5rem!important}.m-md-3{margin:1rem!important}.mt-md-3,.my-md-3{margin-top:1rem!important}.mr-md-3,.mx-md-3{margin-right:1rem!important}.mb-md-3,.my-md-3{margin-bottom:1rem!important}.ml-md-3,.mx-md-3{margin-left:1rem!important}.m-md-4{margin:1.5rem!important}.mt-md-4,.my-md-4{margin-top:1.5rem!important}.mr-md-4,.mx-md-4{margin-right:1.5rem!important}.mb-md-4,.my-md-4{margin-bottom:1.5rem!important}.ml-md-4,.mx-md-4{margin-left:1.5rem!important}.m-md-5{margin:3rem!important}.mt-md-5,.my-md-5{margin-top:3rem!important}.mr-md-5,.mx-md-5{margin-right:3rem!important}.mb-md-5,.my-md-5{margin-bottom:3rem!important}.ml-md-5,.mx-md-5{margin-left:3rem!important}.p-md-0{padding:0!important}.pt-md-0,.py-md-0{padding-top:0!important}.pr-md-0,.px-md-0{padding-right:0!important}.pb-md-0,.py-md-0{padding-bottom:0!important}.pl-md-0,.px-md-0{padding-left:0!important}.p-md-1{padding:.25rem!important}.pt-md-1,.py-md-1{padding-top:.25rem!important}.pr-md-1,.px-md-1{padding-right:.25rem!important}.pb-md-1,.py-md-1{padding-bottom:.25rem!important}.pl-md-1,.px-md-1{padding-left:.25rem!important}.p-md-2{padding:.5rem!important}.pt-md-2,.py-md-2{padding-top:.5rem!important}.pr-md-2,.px-md-2{padding-right:.5rem!important}.pb-md-2,.py-md-2{padding-bottom:.5rem!important}.pl-md-2,.px-md-2{padding-left:.5rem!important}.p-md-3{padding:1rem!important}.pt-md-3,.py-md-3{padding-top:1rem!important}.pr-md-3,.px-md-3{padding-right:1rem!important}.pb-md-3,.py-md-3{padding-bottom:1rem!important}.pl-md-3,.px-md-3{padding-left:1rem!important}.p-md-4{padding:1.5rem!important}.pt-md-4,.py-md-4{padding-top:1.5rem!important}.pr-md-4,.px-md-4{padding-right:1.5rem!important}.pb-md-4,.py-md-4{padding-bottom:1.5rem!important}.pl-md-4,.px-md-4{padding-left:1.5rem!important}.p-md-5{padding:3rem!important}.pt-md-5,.py-md-5{padding-top:3rem!important}.pr-md-5,.px-md-5{padding-right:3rem!important}.pb-md-5,.py-md-5{padding-bottom:3rem!important}.pl-md-5,.px-md-5{padding-left:3rem!important}.m-md-auto{margin:auto!important}.mt-md-auto,.my-md-auto{margin-top:auto!important}.mr-md-auto,.mx-md-auto{margin-right:auto!important}.mb-md-auto,.my-md-auto{margin-bottom:auto!important}.ml-md-auto,.mx-md-auto{margin-left:auto!important}}@media (min-width:992px){.m-lg-0{margin:0!important}.mt-lg-0,.my-lg-0{margin-top:0!important}.mr-lg-0,.mx-lg-0{margin-right:0!important}.mb-lg-0,.my-lg-0{margin-bottom:0!important}.ml-lg-0,.mx-lg-0{margin-left:0!important}.m-lg-1{margin:.25rem!important}.mt-lg-1,.my-lg-1{margin-top:.25rem!important}.mr-lg-1,.mx-lg-1{margin-right:.25rem!important}.mb-lg-1,.my-lg-1{margin-bottom:.25rem!important}.ml-lg-1,.mx-lg-1{margin-left:.25rem!important}.m-lg-2{margin:.5rem!important}.mt-lg-2,.my-lg-2{margin-top:.5rem!important}.mr-lg-2,.mx-lg-2{margin-right:.5rem!important}.mb-lg-2,.my-lg-2{margin-bottom:.5rem!important}.ml-lg-2,.mx-lg-2{margin-left:.5rem!important}.m-lg-3{margin:1rem!important}.mt-lg-3,.my-lg-3{margin-top:1rem!important}.mr-lg-3,.mx-lg-3{margin-right:1rem!important}.mb-lg-3,.my-lg-3{margin-bottom:1rem!important}.ml-lg-3,.mx-lg-3{margin-left:1rem!important}.m-lg-4{margin:1.5rem!important}.mt-lg-4,.my-lg-4{margin-top:1.5rem!important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem!important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem!important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem!important}.m-lg-5{margin:3rem!important}.mt-lg-5,.my-lg-5{margin-top:3rem!important}.mr-lg-5,.mx-lg-5{margin-right:3rem!important}.mb-lg-5,.my-lg-5{margin-bottom:3rem!important}.ml-lg-5,.mx-lg-5{margin-left:3rem!important}.p-lg-0{padding:0!important}.pt-lg-0,.py-lg-0{padding-top:0!important}.pr-lg-0,.px-lg-0{padding-right:0!important}.pb-lg-0,.py-lg-0{padding-bottom:0!important}.pl-lg-0,.px-lg-0{padding-left:0!important}.p-lg-1{padding:.25rem!important}.pt-lg-1,.py-lg-1{padding-top:.25rem!important}.pr-lg-1,.px-lg-1{padding-right:.25rem!important}.pb-lg-1,.py-lg-1{padding-bottom:.25rem!important}.pl-lg-1,.px-lg-1{padding-left:.25rem!important}.p-lg-2{padding:.5rem!important}.pt-lg-2,.py-lg-2{padding-top:.5rem!important}.pr-lg-2,.px-lg-2{padding-right:.5rem!important}.pb-lg-2,.py-lg-2{padding-bottom:.5rem!important}.pl-lg-2,.px-lg-2{padding-left:.5rem!important}.p-lg-3{padding:1rem!important}.pt-lg-3,.py-lg-3{padding-top:1rem!important}.pr-lg-3,.px-lg-3{padding-right:1rem!important}.pb-lg-3,.py-lg-3{padding-bottom:1rem!important}.pl-lg-3,.px-lg-3{padding-left:1rem!important}.p-lg-4{padding:1.5rem!important}.pt-lg-4,.py-lg-4{padding-top:1.5rem!important}.pr-lg-4,.px-lg-4{padding-right:1.5rem!important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem!important}.pl-lg-4,.px-lg-4{padding-left:1.5rem!important}.p-lg-5{padding:3rem!important}.pt-lg-5,.py-lg-5{padding-top:3rem!important}.pr-lg-5,.px-lg-5{padding-right:3rem!important}.pb-lg-5,.py-lg-5{padding-bottom:3rem!important}.pl-lg-5,.px-lg-5{padding-left:3rem!important}.m-lg-auto{margin:auto!important}.mt-lg-auto,.my-lg-auto{margin-top:auto!important}.mr-lg-auto,.mx-lg-auto{margin-right:auto!important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto!important}.ml-lg-auto,.mx-lg-auto{margin-left:auto!important}}@media (min-width:1200px){.m-xl-0{margin:0!important}.mt-xl-0,.my-xl-0{margin-top:0!important}.mr-xl-0,.mx-xl-0{margin-right:0!important}.mb-xl-0,.my-xl-0{margin-bottom:0!important}.ml-xl-0,.mx-xl-0{margin-left:0!important}.m-xl-1{margin:.25rem!important}.mt-xl-1,.my-xl-1{margin-top:.25rem!important}.mr-xl-1,.mx-xl-1{margin-right:.25rem!important}.mb-xl-1,.my-xl-1{margin-bottom:.25rem!important}.ml-xl-1,.mx-xl-1{margin-left:.25rem!important}.m-xl-2{margin:.5rem!important}.mt-xl-2,.my-xl-2{margin-top:.5rem!important}.mr-xl-2,.mx-xl-2{margin-right:.5rem!important}.mb-xl-2,.my-xl-2{margin-bottom:.5rem!important}.ml-xl-2,.mx-xl-2{margin-left:.5rem!important}.m-xl-3{margin:1rem!important}.mt-xl-3,.my-xl-3{margin-top:1rem!important}.mr-xl-3,.mx-xl-3{margin-right:1rem!important}.mb-xl-3,.my-xl-3{margin-bottom:1rem!important}.ml-xl-3,.mx-xl-3{margin-left:1rem!important}.m-xl-4{margin:1.5rem!important}.mt-xl-4,.my-xl-4{margin-top:1.5rem!important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem!important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem!important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem!important}.m-xl-5{margin:3rem!important}.mt-xl-5,.my-xl-5{margin-top:3rem!important}.mr-xl-5,.mx-xl-5{margin-right:3rem!important}.mb-xl-5,.my-xl-5{margin-bottom:3rem!important}.ml-xl-5,.mx-xl-5{margin-left:3rem!important}.p-xl-0{padding:0!important}.pt-xl-0,.py-xl-0{padding-top:0!important}.pr-xl-0,.px-xl-0{padding-right:0!important}.pb-xl-0,.py-xl-0{padding-bottom:0!important}.pl-xl-0,.px-xl-0{padding-left:0!important}.p-xl-1{padding:.25rem!important}.pt-xl-1,.py-xl-1{padding-top:.25rem!important}.pr-xl-1,.px-xl-1{padding-right:.25rem!important}.pb-xl-1,.py-xl-1{padding-bottom:.25rem!important}.pl-xl-1,.px-xl-1{padding-left:.25rem!important}.p-xl-2{padding:.5rem!important}.pt-xl-2,.py-xl-2{padding-top:.5rem!important}.pr-xl-2,.px-xl-2{padding-right:.5rem!important}.pb-xl-2,.py-xl-2{padding-bottom:.5rem!important}.pl-xl-2,.px-xl-2{padding-left:.5rem!important}.p-xl-3{padding:1rem!important}.pt-xl-3,.py-xl-3{padding-top:1rem!important}.pr-xl-3,.px-xl-3{padding-right:1rem!important}.pb-xl-3,.py-xl-3{padding-bottom:1rem!important}.pl-xl-3,.px-xl-3{padding-left:1rem!important}.p-xl-4{padding:1.5rem!important}.pt-xl-4,.py-xl-4{padding-top:1.5rem!important}.pr-xl-4,.px-xl-4{padding-right:1.5rem!important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem!important}.pl-xl-4,.px-xl-4{padding-left:1.5rem!important}.p-xl-5{padding:3rem!important}.pt-xl-5,.py-xl-5{padding-top:3rem!important}.pr-xl-5,.px-xl-5{padding-right:3rem!important}.pb-xl-5,.py-xl-5{padding-bottom:3rem!important}.pl-xl-5,.px-xl-5{padding-left:3rem!important}.m-xl-auto{margin:auto!important}.mt-xl-auto,.my-xl-auto{margin-top:auto!important}.mr-xl-auto,.mx-xl-auto{margin-right:auto!important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto!important}.ml-xl-auto,.mx-xl-auto{margin-left:auto!important}}.text-justify{text-align:justify!important}.text-nowrap{white-space:nowrap!important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left!important}.text-right{text-align:right!important}.text-center{text-align:center!important}@media (min-width:576px){.text-sm-left{text-align:left!important}.text-sm-right{text-align:right!important}.text-sm-center{text-align:center!important}}@media (min-width:768px){.text-md-left{text-align:left!important}.text-md-right{text-align:right!important}.text-md-center{text-align:center!important}}@media (min-width:992px){.text-lg-left{text-align:left!important}.text-lg-right{text-align:right!important}.text-lg-center{text-align:center!important}}@media (min-width:1200px){.text-xl-left{text-align:left!important}.text-xl-right{text-align:right!important}.text-xl-center{text-align:center!important}}.text-lowercase{text-transform:lowercase!important}.text-uppercase{text-transform:uppercase!important}.text-capitalize{text-transform:capitalize!important}.font-weight-light{font-weight:300!important}.font-weight-normal{font-weight:400!important}.font-weight-bold{font-weight:700!important}.font-italic{font-style:italic!important}.text-white{color:#fff!important}.text-primary{color:#007bff!important}a.text-primary:focus,a.text-primary:hover{color:#0062cc!important}.text-secondary{color:#868e96!important}a.text-secondary:focus,a.text-secondary:hover{color:#6c757d!important}.text-success{color:#28a745!important}a.text-success:focus,a.text-success:hover{color:#1e7e34!important}.text-info{color:#17a2b8!important}a.text-info:focus,a.text-info:hover{color:#117a8b!important}.text-warning{color:#ffc107!important}a.text-warning:focus,a.text-warning:hover{color:#d39e00!important}.text-danger{color:#dc3545!important}a.text-danger:focus,a.text-danger:hover{color:#bd2130!important}.text-light{color:#f8f9fa!important}a.text-light:focus,a.text-light:hover{color:#dae0e5!important}.text-dark{color:#343a40!important}a.text-dark:focus,a.text-dark:hover{color:#1d2124!important}.text-muted{color:#868e96!important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.visible{visibility:visible!important}.invisible{visibility:hidden!important} +/*# sourceMappingURL=bootstrap.min.css.map */ \ No newline at end of file diff --git a/assets/webTemplates/BASIC/css/style.css b/assets/webTemplates/BASIC/css/style.css new file mode 100644 index 0000000..caa6be1 --- /dev/null +++ b/assets/webTemplates/BASIC/css/style.css @@ -0,0 +1,18 @@ +*{ + box-sizing: border-box; +} + +body{ + background: linear-gradient(-60deg, #ff5858 0%, #f09819 100%); +} + +.center{ + text-align: center; +} + +p{ + font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; + font-size: 30px; + font-weight: 700; + color: #fff; +} \ No newline at end of file diff --git a/assets/webTemplates/BASIC/dist/bundle.js b/assets/webTemplates/BASIC/dist/bundle.js new file mode 100644 index 0000000..4b5cf45 --- /dev/null +++ b/assets/webTemplates/BASIC/dist/bundle.js @@ -0,0 +1,342 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/dist/"; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 2); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(3) + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(4) + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _furhatCore = __webpack_require__(0); + +var _furhatCore2 = _interopRequireDefault(_furhatCore); + +var _furhatGui = __webpack_require__(1); + +var _furhatGui2 = _interopRequireDefault(_furhatGui); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +(0, _furhatGui2.default)(function (furhat) { + furhat.subscribe('furhatos.event.responses.ResponseSkillGUIName', function (data) { + if (data.port == window.location.port) { + setPageTitle(data.name); + } + }); + + furhat.subscribe('furhatos.event.actions.ActionSkillGUIClear', function (data) { + if (data.port == window.location.port) { + clearScreen(); + } + }); + + furhat.subscribe('furhatos.event.actions.ActionSkillGUIWrite', function (data) { + if (data.port == window.location.port) { + clearScreen(); + appendText(data.text); + } + }); + + furhat.subscribe('furhatos.event.actions.ActionSkillGUIAppend', function (data) { + if (data.port == window.location.port) { + appendText(data.text); + } + }); + + furhat.send({ + event_name: 'furhatos.event.requests.RequestSkillGUIName', + port: window.location.port + }); +}); + +function setPageTitle(title) { + document.getElementsByTagName("title")[0].innerText = title; +} + +function appendText(text) { + var p = document.createElement('p'); + + p.innerText = text; + document.getElementById('root').appendChild(p); +} + +function clearScreen() { + var root = document.getElementById('root'); + + while (root.firstChild) { + root.removeChild(root.firstChild); + } +} + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +// Constants +const OPEN = 'open'; +const CLOSE = 'closed'; +const FAIL = 'failed'; + +/** + * Furhat main class. Maintains the websocket connection to furhatOS and + * has methods to send events, subscribe to events and helper methods such as say, + * gesture, etc. + */ +class Furhat { + constructor() { + this.eventFunctions = {}; + } + + /** + * Initializes the furhat socket connection and executes the callback method. + * @param domain IP Address for furhatOS - localhost if SDK. + * @param port port for RealTimeAPI module of furhatOS. + * @param route route for RealTimeAPI module of furhatOS. + * @param callback callback method to be executed on successful opening of websocket. + */ + init(domain, port, route, callback) { + if (this.socket !== undefined) { + this.socket.close(); + } + console.log(`initializing ws://${domain}:${port}/${route}`); // eslint-disable-line no-console + this.socket = new window.WebSocket(`ws://${domain}:${port}/${route}`); // eslint-disable-line no-undef + + this.socket.onopen = () => { + this.status = OPEN; + if (callback !== undefined) { + callback(OPEN, this); + } + }; + this.socket.onmessage = event => { + if (this.eventFunctions[JSON.parse(event.data).event_name] !== undefined) { + this.eventFunctions[JSON.parse(event.data).event_name](JSON.parse(event.data)); + } + }; + this.socket.onclose = () => { + this.status = CLOSE; + if (callback !== undefined) { + callback(CLOSE, this); + } + }; + this.socket.onerror = () => { + this.status = FAIL; + if (callback !== undefined) { + callback(FAIL, this); + } + }; + } + + /** + * Sends an event to furhatOS + * @param event Object containing the event. Mandtory to have event_name parameter in the object + */ + send(event) { + if (this.socket.readyState === 2 || this.socket.readyState === 3) { + // SHIT + } else if (this.socket.readyState === 1) { + this.socket.send(JSON.stringify(event)); + } + } + + /** + * Subscribes to the given event and triggers the supplied callback on event + * @param eventName Name of the event to subscribe + * @param callback Function which needs to be triggered when the given event is recieved + * @param dontSend [Optional] [false by default] Boolean which determines wether to send + * the subscribe event or not. use it to set callbacks for event that are already subscribed to, + * for instance with group subscriptions + */ + subscribe(eventName, callback, dontSend = false) { + const event = { event_name: 'furhatos.event.actions.ActionRealTimeAPISubscribe', name: eventName }; + this.eventFunctions[eventName] = callback; + if (!dontSend) { + this.send(event); + } + } + + /** + * Subscribes to the given event group + * @param groupNumber Number(Assigned ENUM) of the group that needs to be subscribed to + */ + subscribeGroup(groupNumber) { + const event = { event_name: 'furhatos.event.actions.ActionRealTimeAPISubscribe', group: groupNumber }; + this.send(event); + } + + /** + * Says a given text + * @param text Text which needs to be said by Furhat + */ + say(text) { + const event = { event_name: 'furhatos.event.actions.ActionSpeech', text }; + this.send(event); + } + + /** + * Stimulates the speech of a user in the interaction space + * @param text Text which needs to be said by the user + */ + userSpeech(text) { + const event = { event_name: 'furhatos.event.senses.SenseTypingEnd', messageText: text }; + this.send(event); + } + + /** + * Stimulates SenseSpeechStart event. Can be used to stimulate user speech via typing + */ + userSpeechStart() { + const event = { event_name: 'furhatos.event.senses.SenseTypingStart' }; + this.send(event); + } + + /** + * Performs the given gesture + * @param name Name of the gesture that needs to be performed + */ + gesture(name) { + const event = { event_name: 'furhatos.event.actions.ActionGesture', name }; + this.send(event); + } +} + +exports.default = Furhat; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _furhatCore = __webpack_require__(0); + +var _furhatCore2 = _interopRequireDefault(_furhatCore); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +let portNumber; +let callbackFun; + +const InitCallback = (status, hat) => { + if (status === 'open') { + hat.send({ + event_name: 'furhatos.event.senses.SenseSkillGUIConnected', + port: portNumber + }); + callbackFun(hat); + } +}; + +/** + * FurhatGUI Function which sets up a connection to the furhat skill and gives + * the furhat object to send and recieve events to the skill. + * @param callback callback that needs to be triggered when a sucessful connection is established + */ +const FurhatGUI = callback => { + if (callback !== undefined && typeof callback === 'function') { + window.fetch('/port', { method: 'GET' }).then(r => { + // eslint-disable-line no-undef + r.json().then(o => { + const furhat = new _furhatCore2.default(); + portNumber = o.port; + callbackFun = callback; + furhat.init(o.address, o.port, 'api', InitCallback); // eslint-disable-line no-undef + }); + }); + } +}; + +exports.default = FurhatGUI; + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/assets/webTemplates/BASIC/index.html b/assets/webTemplates/BASIC/index.html new file mode 100644 index 0000000..739a184 --- /dev/null +++ b/assets/webTemplates/BASIC/index.html @@ -0,0 +1,21 @@ + + + + + + + + Furhat Skill + + +
+
+
+
+
+
+
+
+ + + diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..52c756e --- /dev/null +++ b/build.gradle @@ -0,0 +1,70 @@ +plugins { + id 'org.jetbrains.kotlin.jvm' version '1.8.21' + id 'com.github.johnrengelman.shadow' version '6.1.0' +} + +apply plugin: 'java' +apply plugin: 'kotlin' + +//Defines what version of Java to use. +sourceCompatibility = 1.8 + +//Defines how Kotlin should compile. +compileKotlin { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + kotlinOptions { + //Defines what jvm bytecode to use, 1.8 rather than 1.6 + jvmTarget = "1.8" + apiVersion = "1.8" + languageVersion = "1.8" + } +} + +//Defines how Kotlin should compile when testingTry to keep it the same as compileKotlin. +compileTestKotlin { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + kotlinOptions { + //Defines what jvm bytecode to use, 1.8 rather than 1.6 + jvmTarget = "1.8" + apiVersion = "1.8" + languageVersion = "1.8" + } +} + +repositories { + mavenLocal() + mavenCentral() + maven { url "https://s3-eu-west-1.amazonaws.com/furhat-maven/releases"} + maven { url 'https://repo.gradle.org/gradle/libs-releases' } + maven { url { "https://repo1.maven.org/maven2/" } } +} + + +dependencies { + implementation 'com.furhatrobotics.furhatos:furhat-commons:2.9.0' + implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3" +} + +jar { + def lowerCasedName = baseName.toLowerCase() + def normalizedName = lowerCasedName.substring(0,1).toUpperCase() + lowerCasedName.substring(1) + manifest.attributes( + 'Class-Path': configurations.compileClasspath.collect { it.getName() }.join(' '), + 'Main-Class': "furhatos.app.${lowerCasedName}.${normalizedName}Skill" + ) +} + +//ShadowJar depends on jar being finished properly. +shadowJar { + manifest { + exclude '**/Log4j2Plugins.dat' + exclude '**/node_modules' + } + from "skill.properties" + from "assets" + extension 'skill' +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..7a3265ee94c0ab25cf079ac8ccdf87f41d455d42 GIT binary patch literal 54708 zcmagFV|ZrKvM!pAZQHhO+qP}9lTNj?q^^Y^VFp)SH8qbSJ)2BQ2girk4u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aPl;cm$=I0u*WP}aVE!lCYw2Ht{Z_j9mp1h>dHGKkEZP6f^6O@J zndJ2+rWjxp|3#<2oO=8v!oHMX{|Vb|^G~pU_A6=ckBQvt>o+dpgYy(D=VCj65GE&jJj{&-*iq?z)PHNee&-@Mie~#LD*={ex8h(-)<@|55 zUr(}L?mz#;d|mrD%zrh<-*=;5*7K$B`zPjJ%m2pwr*G6tf8tN%a

_x$+l{{cH8$W#CT literal 0 HcmV?d00001 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..273a260 --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-bin.zip diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..f955316 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/skill.properties b/skill.properties new file mode 100644 index 0000000..0e3807c --- /dev/null +++ b/skill.properties @@ -0,0 +1,15 @@ +name = Blank +mainclass = furhatos.app.blank.BlankSkill +version = 1.0.0 +language = en-US +logLevel = INFO +#You may set this to a Furhat version. +requiresVersion = false +#Set to true if this skill should fail if there is no camera +requiresCamera = false +#Set to true if this skill should fail if there is no speaker +requiresSpeaker = false +#Set to true if this skill should fail if there is no microphone +requiresMicrophone = false +#Set to true if this skill should fail if there is no active recognizer +requiresRecognizer = false \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/init.kt b/src/main/kotlin/furhatos/app/blank/flow/init.kt new file mode 100644 index 0000000..15e18dc --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/init.kt @@ -0,0 +1,26 @@ +package furhatos.app.blank.flow + +import furhatos.app.blank.flow.main.Idle +import furhatos.app.blank.flow.main.supporting.SmileIdle +import furhatos.app.blank.setting.DISTANCE_TO_ENGAGE +import furhatos.app.blank.setting.MAX_NUMBER_OF_USERS +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.furhat +import furhatos.flow.kotlin.state +import furhatos.flow.kotlin.users +import furhatos.util.Gender +import furhatos.util.Language + +val Init: State = state { + init { + /** Set our default interaction parameters */ + users.setSimpleEngagementPolicy(DISTANCE_TO_ENGAGE, MAX_NUMBER_OF_USERS) + furhat.setVoice(Language.SLOVAK, gender = Gender.FEMALE) + furhat.gesture(SmileIdle, async = true) + } + onEntry { + + goto(Idle) + } + +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/SessionLogger.kt b/src/main/kotlin/furhatos/app/blank/flow/main/SessionLogger.kt new file mode 100644 index 0000000..b66b247 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/SessionLogger.kt @@ -0,0 +1,433 @@ +package furhatos.app.blank.flow.main + +import furhatos.app.blank.flow.main.supporting.general.sendLogEvent +import furhatos.app.blank.flow.main.supporting.general.sendLogJsonLine +import java.nio.file.Files +import java.nio.file.Path +import java.nio.file.Paths +import java.nio.file.StandardOpenOption +import java.util.UUID +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter +import kotlin.concurrent.thread +import java.util.concurrent.atomic.AtomicBoolean + +object SessionLogger { + + private val logsDir: Path = Paths.get(System.getProperty("user.dir"), "logs") + private val csvLogFile: Path = logsDir.resolve("sessions_log.csv") + private val pendingLogFile: Path = logsDir.resolve("pending_logs.jsonl") + private var sessionId: String = "" + + private val pendingFileLock = Any() + private val flushInProgress = AtomicBoolean(false) + + init { + if (!Files.exists(logsDir)) { + Files.createDirectories(logsDir) + } + + if (!Files.exists(csvLogFile)) { + Files.write( + csvLogFile, + "timestamp;session_id;game;phase;question;attempt;result;correct_answer;user_answer;hint_used\n" + .toByteArray(Charsets.UTF_8), + StandardOpenOption.CREATE, + StandardOpenOption.APPEND + ) + } + + if (!Files.exists(pendingLogFile)) { + Files.createFile(pendingLogFile) + } + } + + private fun newSessionId(): String { + return UUID.randomUUID() + .toString() + .replace("-", "") + .take(6) + .uppercase() + } + + private fun esc(value: String?): String { + if (value == null) return "" + return value + .replace("\"", "\"\"") + .replace("\n", " ") + .replace("\r", " ") + .trim() + } + + private fun jsonEscape(value: String?): String { + if (value == null) return "" + return value + .replace("\\", "\\\\") + .replace("\"", "\\\"") + .replace("\n", "\\n") + .replace("\r", "\\r") + .replace("\t", "\\t") + } + + private fun buildCsvLine( + ts: String, + sessionId: String, + game: String, + phase: String, + question: String, + attempt: Int, + result: String, + correctAnswer: String, + userAnswer: String?, + hintUsed: Boolean + ): String { + return buildString { + append('"').append(esc(ts)).append('"').append(';') + append('"').append(esc(sessionId)).append('"').append(';') + append('"').append(esc(game)).append('"').append(';') + append('"').append(esc(phase)).append('"').append(';') + append('"').append(esc(question)).append('"').append(';') + append(attempt).append(';') + append('"').append(esc(result)).append('"').append(';') + append('"').append(esc(correctAnswer)).append('"').append(';') + append('"').append(esc(userAnswer)).append('"').append(';') + append(hintUsed) + append('\n') + } + } + + private fun buildJsonLine( + ts: String, + sessionId: String, + game: String, + phase: String, + question: String, + attempt: Int, + result: String, + correctAnswer: String, + userAnswer: String?, + hintUsed: Boolean + ): String { + return buildString { + append("{") + append("\"created_at\":\"").append(jsonEscape(ts)).append("\",") + append("\"session_id\":\"").append(jsonEscape(sessionId)).append("\",") + append("\"game\":\"").append(jsonEscape(game)).append("\",") + append("\"phase\":\"").append(jsonEscape(phase)).append("\",") + append("\"question\":\"").append(jsonEscape(question)).append("\",") + append("\"attempt\":").append(attempt).append(",") + append("\"result\":\"").append(jsonEscape(result)).append("\",") + + append("\"user_answer\":") + if (userAnswer.isNullOrBlank()) append("null") + else append("\"").append(jsonEscape(userAnswer)).append("\"") + append(",") + + append("\"correct_answer\":") + if (correctAnswer.isBlank()) append("null") + else append("\"").append(jsonEscape(correctAnswer)).append("\"") + append(",") + + append("\"hint_used\":").append(hintUsed) + append("}") + } + } + + // NEW: all pending-file operations go through one lock + private fun readPendingLinesLocked(): List { + if (!Files.exists(pendingLogFile)) return emptyList() + + return Files.readAllLines(pendingLogFile, Charsets.UTF_8) + .map { it.trim() } + .filter { it.isNotBlank() } + } + + // NEW + private fun writePendingLinesLocked(lines: List) { + val content = + if (lines.isEmpty()) "" + else lines.joinToString(separator = "\n", postfix = "\n") + + Files.write( + pendingLogFile, + content.toByteArray(Charsets.UTF_8), + StandardOpenOption.CREATE, + StandardOpenOption.TRUNCATE_EXISTING + ) + } + + private fun appendPendingJsonLine(jsonLine: String) { + synchronized(pendingFileLock) { + Files.write( + pendingLogFile, + (jsonLine + "\n").toByteArray(Charsets.UTF_8), + StandardOpenOption.CREATE, + StandardOpenOption.APPEND + ) + } + } + +// private fun appendPendingJsonLine(jsonLine: String) { +// Files.write( +// pendingLogFile, +// (jsonLine + "\n").toByteArray(Charsets.UTF_8), +// StandardOpenOption.CREATE, +// StandardOpenOption.APPEND +// ) +// } + +// @Synchronized +// fun flushPendingLogs() { +// if (!Files.exists(pendingLogFile)) return +// +// val lines = Files.readAllLines(pendingLogFile, Charsets.UTF_8) +// .map { it.trim() } +// .filter { it.isNotBlank() } +// +// if (lines.isEmpty()) return +// +// val failedLines = mutableListOf() +// +// for (line in lines) { +// val sent = try { +// sendLogJsonLine(line) +// } catch (e: Exception) { +// println("flushPendingLogs exception: ${e.message}") +// false +// } +// +// if (!sent) { +// failedLines.add(line) +// } +// } +// +// val newContent = +// if (failedLines.isEmpty()) "" +// else failedLines.joinToString(separator = "\n", postfix = "\n") +// +// Files.write( +// pendingLogFile, +// newContent.toByteArray(Charsets.UTF_8), +// StandardOpenOption.TRUNCATE_EXISTING +// ) +// } + + // NEW: background flush + fun flushPendingLogsAsync() { + if (!flushInProgress.compareAndSet(false, true)) { + println("SessionLogger: flush already in progress, skip") + return + } + + thread(isDaemon = true, name = "pending-log-flush") { + try { + // 1) Take current batch and immediately free file for new records + val batch = synchronized(pendingFileLock) { + val lines = readPendingLinesLocked() + if (lines.isNotEmpty()) { + writePendingLinesLocked(emptyList()) + } + lines + } + + if (batch.isEmpty()) { + println("SessionLogger: no pending logs to flush") + return@thread + } + + // 2) Send outside file lock + val failedLines = mutableListOf() + + for (line in batch) { + val sent = try { + sendLogJsonLine(line) + } catch (e: Exception) { + println("flushPendingLogsAsync exception: ${e.message}") + false + } + + if (!sent) { + failedLines.add(line) + } + } + + // 3) Put back only failed old lines + lines added meanwhile + synchronized(pendingFileLock) { + val freshLines = readPendingLinesLocked() + val merged = failedLines + freshLines + writePendingLinesLocked(merged) + } + + println("SessionLogger: background flush finished, failed=${failedLines.size}") + } finally { + flushInProgress.set(false) + } + } + } + + @Synchronized + fun startNewSession() { + sessionId = newSessionId() + + log( + game = "system", + phase = "session", + question = "greeting", + attempt = 0, + result = "session_started", + correctAnswer = "", + userAnswer = "", + hintUsed = false + ) + } + + @Synchronized + fun log( + game: String, + phase: String, + question: String, + attempt: Int, + result: String, + correctAnswer: String = "", + userAnswer: String? = "", + hintUsed: Boolean = false + ) { + if (sessionId.isBlank()) { + sessionId = newSessionId() + } + + val ts = OffsetDateTime.now().format(DateTimeFormatter.ISO_OFFSET_DATE_TIME) +// val ts = OffsetDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME) + + val csvLine = buildCsvLine( + ts = ts, + sessionId = sessionId, + game = game, + phase = phase, + question = question, + attempt = attempt, + result = result, + correctAnswer = correctAnswer, + userAnswer = userAnswer, + hintUsed = hintUsed + ) + + val jsonLine = buildJsonLine( + ts = ts, + sessionId = sessionId, + game = game, + phase = phase, + question = question, + attempt = attempt, + result = result, + correctAnswer = correctAnswer, + userAnswer = userAnswer, + hintUsed = hintUsed + ) + + // локальный архив + if (shouldWriteCsv()) { + Files.write( + csvLogFile, + csvLine.toByteArray(Charsets.UTF_8), + StandardOpenOption.CREATE, + StandardOpenOption.APPEND + ) + } else { + println("SessionLogger: CSV logging skipped because skill is running on robot") + } +// Files.write( +// csvLogFile, +// csvLine.toByteArray(Charsets.UTF_8), +// StandardOpenOption.CREATE, +// StandardOpenOption.APPEND +// ) + + // потом текущую + val sent = try { + sendLogEvent( + createdAt = ts, + sessionId = sessionId, + game = game, + phase = phase, + question = question, + attempt = attempt, + result = result, + userAnswer = userAnswer?.ifBlank { null }, + correctAnswer = correctAnswer.ifBlank { null }, + hintUsed = hintUsed + ) +// sendLogJsonLine(jsonLine) + } catch (e: Exception) { + println("SessionLogger remote send exception: ${e.message}") + false + } + + if (!sent) { + appendPendingJsonLine(jsonLine) + println("SessionLogger: remote logging failed, saved to pending_logs.jsonl") + } else { + println("SessionLogger: remote logging success") + } + } + + fun isLocalProjectRun(): Boolean { + val userDir = Paths.get(System.getProperty("user.dir")) + + val localMarkers = listOf( + ".idea", + "src", + "build.gradle", + "settings.gradle", + "gradlew", + "gradlew.bat" + ) + + return localMarkers.any { marker -> + Files.exists(userDir.resolve(marker)) + } + } + + fun isRunningOnRobot(): Boolean = !isLocalProjectRun() + + fun shouldWriteCsv(): Boolean = isLocalProjectRun() + + @Synchronized + fun clearCsvIfRunningOnRobot() { + if (!isRunningOnRobot()) return + if (!Files.exists(csvLogFile)) return + + Files.write( + csvLogFile, + "timestamp;session_id;game;phase;question;attempt;result;correct_answer;user_answer;hint_used\n" + .toByteArray(Charsets.UTF_8), + StandardOpenOption.TRUNCATE_EXISTING + ) + + println("SessionLogger: CSV cleared because skill is running on robot") + } + + fun getSessionId(): String = sessionId +} + +//==== test ====== +fun pendingFileStatusMessage(): String { + return try { + val file = Paths.get(System.getProperty("user.dir"), "logs", "pending_logs.jsonl") + + if (!Files.exists(file)) { + return "Pending súbor neexistuje." + } + + val lines = Files.readAllLines(file, Charsets.UTF_8) + .map { it.trim() } + .filter { it.isNotBlank() } + + when { + lines.isEmpty() -> "Pending súbor je prázdny." + else -> "Pending súbor obsahuje ${lines.size} záznamov." + } + } catch (e: Exception) { + "Nepodarilo sa skontrolovať pending súbor." + } +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/StartQuestion.kt b/src/main/kotlin/furhatos/app/blank/flow/main/StartQuestion.kt new file mode 100644 index 0000000..a10d209 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/StartQuestion.kt @@ -0,0 +1,58 @@ +package furhatos.app.blank.flow.main + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.attention.AttentionTrainingIntro +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.* +import furhatos.flow.kotlin.furhat +import furhatos.app.blank.flow.main.say_time.TimeTrainingIntro +import furhatos.app.blank.flow.main.memory.MemoryTrainingIntro +import furhatos.app.blank.flow.main.say_time.resetTimeQuestions +import furhatos.app.blank.flow.main.supporting.calm +import kotlin.random.Random + +// 1 = TimeTrainingIntro, 2 = MemoryTrainingIntro, 3 = AttentionTrainingIntro + +private var gameBag: MutableList = mutableListOf() + +private fun nextGameFromBag(): Int { + if (gameBag.isEmpty()) { + gameBag = mutableListOf(1, 2, 3).also { it.shuffle() } + } + return gameBag.removeAt(0) +} + +// Reset bag for a new user/session +fun resetTrainingGameBag() { + gameBag.clear() +} + +val StartQuestion: State = state(Parent) { + onEntry { + calm() + when (nextGameFromBag()) { + 1 -> { + furhat.say("Poďme zahrať hru na orientáciu v čase.") + furhat.say("Budem Vám klásť rôzne otázky a Vašou úlohou bude správne pomenovať aktuálny čas.") + delay(1000) + resetTimeQuestions() + goto(TimeTrainingIntro) + } + 2 -> { +// furhat.say("Poviem Vám zoznam slov a Vašou úlohou bude ho zopakovať.") + furhat.say("Poďme zahrať hru na pamäť.") + delay(1000) + resetTimeQuestions() + goto(MemoryTrainingIntro) + } + 3 -> { + furhat.say("Poďme zahrať hru na pozornosť.") + furhat.say("Budem hovoriť slová a pri jednom z nich ma budete musieť zastaviť.") + delay(1000) + resetTimeQuestions() + goto(AttentionTrainingIntro) + } + } + } +} + diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/attention/AST.kt b/src/main/kotlin/furhatos/app/blank/flow/main/attention/AST.kt new file mode 100644 index 0000000..5da43c5 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/attention/AST.kt @@ -0,0 +1,106 @@ +package furhatos.app.blank.flow.main.attention + +object AttentionSmallTalkPhrases { + + fun questionFor(theme: String, target: String): String { + val byTheme = when (theme.lowercase()) { + "ovocie" -> listOf( + "Povedali ste stop pri slove „$target“. Máte radi ovocie?", + "Aké ovocie vám chutí najviac?", + "Dávate si ovocie skôr ráno, alebo počas dňa?" + ) + + "sladké" -> listOf( + "Povedali ste stop pri slove „$target“. Máte radi sladké?", + "Doprajete si občas niečo sladké, alebo skôr nie?", + "Ak by ste si mali vybrať niečo sladké, čo by to bolo?" + ) + + "zelenina" -> listOf( + "„$target“ je zelenina. Máte radi zeleninu?", + "Ktorú zeleninu máte najradšej?", + "Jedávate zeleninu skôr surovú, alebo varenú?" + ) + + "jedlo" -> listOf( + "Slovo „$target“ patrí medzi jedlo. Máte nejaké jedlo, ktoré máte obzvlášť radi?", + "Keď sa povie „$target“, napadne vám naň chuť?", + "Varíte si radšej doma, alebo máte radi aj jedálne či reštaurácie?" + ) + + "bobuľa" -> listOf( + "„$target“ patrí medzi bobule. Máte radi bobuľové ovocie?", + "Spájate si „$target“ skôr s letom, alebo si ho dávate aj počas roka?", + "Máte radšej čerstvé bobule, alebo napríklad v koláči či jogurte?" + ) + + "nápoje" -> listOf( + "„$target“ patrí medzi nápoje. Čo najčastejšie pijete počas dňa?", + "Máte radšej teplé nápoje alebo studené?", + "Keď si chcete oddýchnuť, aký nápoj vám spraví najväčšiu radosť?" + ) + + "prísady" -> listOf( + "„$target“ patrí medzi prísady. Radi varíte alebo pečiete?", + "Používate pri varení skôr jednoduché prísady, alebo radi skúšate nové veci?", + "Máte nejakú prísadu, bez ktorej si varenie neviete predstaviť?" + ) + + "dom" -> listOf( + "Slovo „$target“ patrí k téme domov. Máte doma nejaké miesto, kde sa cítite najlepšie?", + "Máte radšej, keď je doma ticho, alebo keď je tam „živo“?", + "Keď si chcete oddýchnuť doma, čo vám najviac pomáha?" + ) + + "domáce potreby" -> listOf( + "„$target“ patrí medzi domáce potreby. Máte doma veci, ktoré používate každý deň?", + "Máte radi poriadok a systém, alebo skôr „prirodzený chaos“?", + "Keď niečo v domácnosti chýba, všimnete si to hneď?" + ) + + "technika" -> listOf( + "„$target“ patrí medzi techniku. Používate techniku radi, alebo len keď treba?", + "Ktoré zariadenie vám doma najviac uľahčuje život?", + "Skôr máte radi jednoduché veci, alebo vás baví skúšať nové technológie?" + ) + + "príroda" -> listOf( + "„$target“ patrí k prírode. Máte radi pobyt vonku?", + "Čo vám je v prírode príjemnejšie — les, voda, alebo hory?", + "Chodíte radšej na krátke prechádzky, alebo na dlhšie výlety?" + ) + + "mesto" -> listOf( + "„$target“ patrí k téme mesto. Máte radi ruch mesta, alebo skôr pokoj?", + "Keď ste v meste, čo je pre vás najdôležitejšie — doprava, služby, alebo atmosféra?", + "Máte v meste nejaké obľúbené miesto, kam sa radi vraciate?" + ) + + "telo" -> listOf( + "„$target“ súvisí s telom. Venujete sa počas dňa aspoň trochu pohybu?", + "Máte radi, keď je deň aktívny, alebo skôr pokojný?", + "Čo vám najviac pomáha cítiť sa dobre — prechádzka, oddych, alebo rutina?" + ) + + "oblečenie" -> listOf( + "„$target“ patrí k oblečeniu. Máte radi pohodlné oblečenie, alebo skôr elegantné?", + "Vyberáte si oblečenie podľa počasia, alebo skôr podľa nálady?", + "Máte nejakú farbu, ktorú nosíte najradšej?" + ) + + "druh zábavy" -> listOf( + "„$target“ patrí k zábave. Ako najradšej trávite voľný čas?", + "Máte radšej spoločnú zábavu s ľuďmi, alebo pokojnejšie aktivity?", + "Keď si chcete oddýchnuť, čo vás poteší najviac?" + ) + + else -> listOf( + "Zachytili ste slovo „$target“. Je to téma „$theme“. Máte k tomu nejaký vzťah?", + "„$target“ — je to z oblasti „$theme“. Páči sa vám táto téma, alebo skôr nie?", + "Keď počujete „$target“, napadne vám niečo príjemné, alebo skôr neutrálne?" + ) + } + + return byTheme.random() + } +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/attention/AskAttention.kt b/src/main/kotlin/furhatos/app/blank/flow/main/attention/AskAttention.kt new file mode 100644 index 0000000..b47c3b4 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/attention/AskAttention.kt @@ -0,0 +1,634 @@ +package furhatos.app.blank.flow.main.attention + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.SessionLogger +import furhatos.app.blank.flow.main.StartQuestion +import furhatos.app.blank.flow.main.handlers.Goodbye +import furhatos.app.blank.flow.main.handlers.handleRepeat +import furhatos.app.blank.flow.main.handlers.handleStop +import furhatos.app.blank.flow.main.supporting.AskToContinue +import furhatos.app.blank.flow.main.supporting.general.WordBank +import furhatos.app.blank.flow.main.supporting.general.WordEntry +import furhatos.app.blank.flow.main.supporting.empathy +import furhatos.app.blank.flow.main.supporting.littleSad +import furhatos.app.blank.flow.main.supporting.veryHappy +import furhatos.app.blank.flow.main.supporting.AskIncreaseDifficulty +import furhatos.app.blank.flow.main.memory.WordsChecker +import furhatos.app.blank.flow.main.supporting.AskDecreaseDifficulty +import furhatos.app.blank.flow.main.supporting.ReadyToTrain +import furhatos.app.blank.flow.main.supporting.SmallTalk +import furhatos.app.blank.flow.main.supporting.general.SmallTalkContext +import furhatos.app.blank.flow.main.supporting.general.TrainingMenuFlags +import furhatos.app.blank.flow.main.supporting.general.callProxyRespond +import furhatos.app.blank.flow.main.supporting.general.genericSmallTalk +import furhatos.app.blank.flow.main.supporting.general.isProxyAvailable +import furhatos.app.blank.flow.main.supporting.general.requestSmallTalk +import furhatos.app.blank.flow.main.supporting.happyNod +import furhatos.app.blank.flow.main.supporting.happyShake +import furhatos.app.blank.nlu.base_answer.Repeat +import furhatos.app.blank.nlu.base_answer.StopTraining +import furhatos.flow.kotlin.* +import furhatos.gestures.Gestures +import kotlin.random.Random + +// -------------------- parametre -------------------- + +// na sledovanie toku otázok +private const val MAX_LEVEL = 3 +private const val QUESTIONS_PER_LEVEL = 2 +private const val MAX_SMALLTALK_PER_SESSION = 3 +private const val MAX_SAME_LEVEL_QUESTIONS = 6 + +var sameLevelQuestionsDone: Int = 0 +var difficultyWasIncreased: Boolean = false + +// koľko kôl v aktuálnom bloku z 2 bolo neúspešných +var failedQuestions: Int = 0 + +// Bol aktuálny blok z 2 kôl začatý po zvýšení náročnosti +var currentBlockWasIncreased: Boolean = false + +// príznak výsledku aktuálneho kola pre AfterAttentionResolved +private var attentionRoundFailed: Boolean = false + +// pomocne premenne pre SmallTak +var attentionSmallTalkUsed = 0 +var lastAttentionTheme: String = "" +var lastAttentionTarget: String = "" + +// dĺžka radu slov rastie s úrovňou +private fun lengthForLevel(level: Int, rng: Random = Random.Default): Int = when (level) { + 1 -> listOf(4, 5).random(rng) + 2 -> listOf(8, 9).random(rng) + else -> listOf(10, 11).random(rng) +} + +// okno čakania na „stop“ po každom slove +private fun listenWindowForLevel(level: Int): Long = when (level) { + 1 -> 3800 + 2 -> 3500 + else -> 3200 +// 1 -> 1800 +// 2 -> 1500 +// else -> 1200 +} + +// -------------------- stav sedenia -------------------- + +var attentionLevel: Int = 1 +var doneAtLevel: Int = 0 + +private var wrongAttempts: Int = 0 + +private var targetWord: WordEntry? = null +private var targetIndex: Int = -1 +private var sequence: List = emptyList() +private var currentIndex: Int = 0 + +// -------------------- generovanie zoznamu -------------------- + +private fun buildNewAttentionRound() { + val len = lengthForLevel(attentionLevel) + + // target sa vyberá podľa úrovne + val target = WordBank.pickSequence(length = 1, maxDifficulty = attentionLevel).first() + + // vyberáju sa ostatné slovaokrem target + val others = mutableListOf() + while (others.size < len - 1) { + val cand = WordBank.pickSequence(length = 1, maxDifficulty = attentionLevel).first() + if (cand.canonical != target.canonical && others.none { it.canonical == cand.canonical }) { + others.add(cand) + } + } + + // vkladánie target do náhodnej pozície + val insertAt = Random.nextInt(0, len) + val mixed = others.toMutableList() + mixed.add(insertAt, target) + + targetWord = target + targetIndex = insertAt + sequence = mixed + + currentIndex = 0 + wrongAttempts = 0 +} + +// -------------------- helpery -------------------- + +private fun userSaidStop(text: String?): Boolean { + val t = text ?: return false + val tokens = WordsChecker.tokenizeMeaningful(t) + return tokens.any { it == "stop" } +} + +private fun FlowControlRunner.restartSameRound() { + currentIndex = 0 + // sequence/target остаются те же, чтобы попытка была честной + goto(SayNextWord) +} + +fun requestAttentionExplainWrong(mistakeType: String): String { + val target = targetWord?.canonical ?: "" + val position = targetIndex + 1 + + if (!isProxyAvailable()) { + return "" + } + + return callProxyRespond( + userText = "Používateľ urobil chybu v cvičení pozornosti.", + task = "explain_wrong", + context = mapOf( + "exercise" to "attention", + "mistake_type" to mistakeType, // early_stop / missed_target / wrong_word + "target_word" to target, + "target_position" to position, + "theme" to (targetWord?.theme ?: ""), + "level" to attentionLevel + ) + ) ?: "" +} + +//============================================================== +// Hint +//============================================================== +fun requestAttentionHint(mistakeType: String): String { + val target = targetWord?.canonical ?: "" + + if (!isProxyAvailable()) { + return "" + } + + return callProxyRespond( + userText = "Používateľ potrebuje nápovedu.", + task = "hint", + context = mapOf( + "exercise" to "attention", + "mistake_type" to mistakeType, // early_stop / missed_target + "target_word" to target, + "theme" to (targetWord?.theme ?: ""), + "level" to attentionLevel + ) + ) ?: "" +} + + +//============================================================== +// Small Talk +//============================================================== +val AttentionThemeSmallTalk: State by lazy { + SmallTalk(nextState = AfterAttentionResolved) { + AttentionSmallTalkPhrases.questionFor(lastAttentionTheme, lastAttentionTarget) + } +} + +fun nextStateAfterCorrectAttention(): State { + if (attentionSmallTalkUsed >= MAX_SMALLTALK_PER_SESSION) return AfterAttentionResolved + + // šanca dostať dodatočnú otázku + val totalPlanned = MAX_LEVEL * QUESTIONS_PER_LEVEL // условные 6 заданий + val progress = (attentionLevel - 1) * QUESTIONS_PER_LEVEL + doneAtLevel + val denom = (totalPlanned - progress).coerceAtLeast(1) + + val smallTalkLeft = MAX_SMALLTALK_PER_SESSION - attentionSmallTalkUsed + val percent = minOf(0.5, smallTalkLeft.toDouble() / denom.toDouble()) + + val doSmallTalk = Random.nextDouble() < percent + if (!doSmallTalk) return AfterAttentionResolved + + attentionSmallTalkUsed++ + return AttentionThemeSmallTalk +} + +fun buildSmallTalkContextAttention(): SmallTalkContext { + return SmallTalkContext( + exercise = "attention", + topic = lastAttentionTheme, + subtopic = "theme_question", + targetWord = lastAttentionTarget, + responseMode = "open" + ) +} + +fun smallTalkManagerAttention(): State { + if (attentionSmallTalkUsed >= MAX_SMALLTALK_PER_SESSION) return AfterAttentionResolved + + val totalPlanned = MAX_LEVEL * QUESTIONS_PER_LEVEL + val progress = (attentionLevel - 1) * QUESTIONS_PER_LEVEL + doneAtLevel + val denom = (totalPlanned - progress).coerceAtLeast(1) + + val smallTalkLeft = MAX_SMALLTALK_PER_SESSION - attentionSmallTalkUsed + val percent = minOf(0.5, smallTalkLeft.toDouble() / denom.toDouble()) + + val doSmallTalk = Random.nextDouble() < percent + if (!doSmallTalk) return AfterAttentionResolved + + val ctx = buildSmallTalkContextAttention() + val proxyQuestion = requestSmallTalk(ctx) + + attentionSmallTalkUsed++ + + return if (proxyQuestion.isNotBlank()) { + genericSmallTalk( + context = ctx, + nextState = AfterAttentionResolved, + preparedQuestion = proxyQuestion + ) + } else { + AttentionThemeSmallTalk + } +} + +//============================================================== +// Proces hry +//============================================================== + +// Intro +val AttentionTrainingIntro: State = state(Parent) { + onEntry { + attentionLevel = 1 + doneAtLevel = 0 + attentionSmallTalkUsed = 0 + + sameLevelQuestionsDone = 0 + difficultyWasIncreased = false + + failedQuestions = 0 + currentBlockWasIncreased = false + attentionRoundFailed = false + + buildNewAttentionRound() + goto(AskAttention) + } +} + +// Inštrukcia a začiatok +val AskAttention: State = state(Parent) { + onEntry { + val target = targetWord ?: run { + buildNewAttentionRound() + targetWord!! + } + + delay(1000) + furhat.say("Pripravte sa.") + furhat.say("Keď budete počuť slovo „${target.canonical}“, povedzte prosím: stop.") + delay(1000) + furhat.say("Začíname.") + + SessionLogger.log( + game = "attention", + phase = "question_shown", + question = "LEVEL_${attentionLevel}", + attempt = wrongAttempts + 1, + result = "asked", + correctAnswer = "${target.canonical}@${targetIndex + 1}", + userAnswer = "", + hintUsed = wrongAttempts > 0 + ) + + + + goto(SayNextWord) + } +} + +// ďalšie iné slovo +val SayNextWord: State = state(Parent) { + onEntry { + if (currentIndex >= sequence.size) { + goto(HandleMissedStop) + return@onEntry + } + + val w = sequence[currentIndex] + furhat.say(w.canonical) + + // сразу после слова — короткое окно "молчаливого слушания" + goto(ListenForStop) + } +} + +// počuvanie stop +val ListenForStop: State = state(Parent) { + onEntry { + furhat.param.endSilTimeout = 350 + furhat.param.noSpeechTimeout = listenWindowForLevel(attentionLevel).toInt() + + furhat.attend(users.current) + furhat.listen() + } + + onResponse { + if (handleStop(it.intent, + "attention", + "LEVEL_${attentionLevel}", + it.text ?: "")) + { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onResponse + } + } + +// onResponse{ +// if (handleRepeat( +// it.intent, +// "attention", +// "LEVEL_${attentionLevel}", +// "${targetWord?.canonical}@${targetIndex + 1}", +// it.text ?: "", +// true +// )) { +// return@onResponse +// } +// } + + onResponse { + if (userSaidStop(it.text)) { + val isCorrectMoment = (currentIndex == targetIndex) + + if (isCorrectMoment) { + SessionLogger.log( + game = "attention", + phase = "answer", + question = "LEVEL_${attentionLevel}", + attempt = wrongAttempts + 1, + result = "success", + correctAnswer = "${targetWord?.canonical}@${targetIndex + 1}", + userAnswer = it.text ?: "", + hintUsed = wrongAttempts > 0 + ) + + furhat.gesture(Gestures.Nod, async = true) + veryHappy() + furhat.say("Výborne! Správne ste zareagovali.") + delay(1000) + + val t = targetWord!! + lastAttentionTheme = t.theme + lastAttentionTarget = t.canonical + + attentionRoundFailed = false + +// goto(nextStateAfterCorrectAttention()) + goto(smallTalkManagerAttention()) + } else { + // 'stop' na inom slove + wrongAttempts++ + + SessionLogger.log( + game = "attention", + phase = "answer", + question = "LEVEL_${attentionLevel}", + attempt = wrongAttempts, + result = "early_stop", + correctAnswer = "${targetWord?.canonical}@${targetIndex + 1}", + userAnswer = it.text ?: "", + hintUsed = wrongAttempts >= 2 + ) + + when (wrongAttempts) { + 1 -> { + littleSad() + furhat.say("Zastavili ste ma pri inom slove.") + + val hint = requestAttentionHint("early_stop") + + SessionLogger.log( + game = "attention", + phase = "event", + question = "LEVEL_${attentionLevel}", + attempt = wrongAttempts, + result = "hint_requested_early_stop", + correctAnswer = "${targetWord?.canonical}@${targetIndex + 1}", + userAnswer = it.text ?: "", + hintUsed = true + ) + + if (hint.isNotBlank()){ + furhat.say("Trochu pomôžem Vám! Dajte mi chvíľu, prosím") + furhat.say(hint) + delay(1300) + }else{ + happyShake() + furhat.say("Nevadí.") + furhat.say("Skúsme to ešte raz. Povedzte stop až keď zaznie správne slovo.") + } + + restartSameRound() + } + 2 -> { + val explanation = requestAttentionExplainWrong("early_stop") + val target = targetWord!!.canonical + + if (explanation.isNotBlank()){ + furhat.say(explanation) + }else{ + empathy() + furhat.say("Pomôžem Vám. Správne slovo je „$target“. Skúsme znova.") + } + + restartSameRound() + } + else -> { + goto(FinalWrongAnswer) + } + } + } + return@onResponse + } + + // používateľ povedal niečo iné — ignorovať + currentIndex++ + goto(SayNextWord) + + } + + onNoResponse { + currentIndex++ + goto(SayNextWord) + } +} + +// -------------------- nebolo žiadného stop -------------------- + +val HandleMissedStop: State = state(Parent) { + onEntry { + wrongAttempts++ + + SessionLogger.log( + game = "attention", + phase = "answer", + question = "LEVEL_${attentionLevel}", + attempt = wrongAttempts, + result = "missed_target", + correctAnswer = "${targetWord?.canonical}@${targetIndex + 1}", + userAnswer = "", + hintUsed = wrongAttempts >= 2 + ) + + when (wrongAttempts) { + 1 -> { + littleSad() + furhat.say("Zmeškali ste správny moment, keď ste ma mali zastaviť.") + + val hint = requestAttentionHint("missed_target") + + if (hint.isNotBlank()){ + furhat.say("Trochu pomôžem Vám! Dajte mi chvíľu, prosím") + furhat.say(hint) + }else{ + happyShake() + furhat.say("Nevadí.") + furhat.say("Skúsme to ešte raz. Keď zaznie správne slovo, povedzte stop.") + } + + restartSameRound() + } + 2 -> { + val explanation = requestAttentionExplainWrong("missed_target") + val target = targetWord!!.canonical + + if (explanation.isNotBlank()){ + furhat.say(explanation) + }else{ + happyNod() + furhat.say("Pomôžem Vám. Správne slovo bolo „$target“. Skúsme to znova.") + } + + restartSameRound() + } + else -> goto(FinalWrongAnswer) + } + } +} + +/* -------------------- 3. chyba -------------------- */ + +val FinalWrongAnswer: State = state(Parent) { + onEntry { + empathy() + + val target = targetWord!!.canonical + val position = targetIndex + 1 + + SessionLogger.log( + game = "attention", + phase = "resolved", + question = "LEVEL_${attentionLevel}", + attempt = wrongAttempts, + result = "final_fail", + correctAnswer = "$target@$position", + userAnswer = "", + hintUsed = true + ) + + furhat.say("Tentoraz to nevyšlo,") + happyShake() + furhat.say("ale nič sa nedeje.") + furhat.say("Povedať stop ste mali pri slove „$target“, ktoré bolo na pozícii $position .") + delay(1000) + + attentionRoundFailed = true + + goto(AfterAttentionResolved) + } +} + +/* -------------------- prechod medzi urovni -------------------- */ + +val AfterAttentionResolved: State = state(Parent) { + onEntry { + doneAtLevel++ + + if (attentionRoundFailed) { + failedQuestions++ + } + attentionRoundFailed = false + + + if (!difficultyWasIncreased) { + sameLevelQuestionsDone++ + + if (sameLevelQuestionsDone >= MAX_SAME_LEVEL_QUESTIONS) { + veryHappy() + furhat.say("Výborne, dnes už stačí. Ukončíme toto cvičenie pozornosti. Ďakujem Vám!") + delay(1000) + + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onEntry + } + } + + + if (doneAtLevel < QUESTIONS_PER_LEVEL) { + buildNewAttentionRound() + goto(AskAttention) + return@onEntry + } + + // max -> koniec + if (attentionLevel >= MAX_LEVEL) { + veryHappy() + furhat.say("Týmto sme ukončili hru pozornosti. Ďakujem Vám!") + delay(1000) + + TrainingMenuFlags.allAttentionQuestionsCompleted = true + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onEntry + } + + // pokaračovanie + val wantsToContinue = call(AskToContinue()) as Boolean + if (!wantsToContinue) { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onEntry + } + + // 2 otázky neúspešné -> znižiť uroveň + if (currentBlockWasIncreased && + failedQuestions >= QUESTIONS_PER_LEVEL && + attentionLevel > 1 + ) { + val goBack = call(AskDecreaseDifficulty) as Boolean + + if (goBack) { + attentionLevel-- + furhat.say("Dobre, vrátime sa na ľahšiu úroveň.") + } else { + furhat.say("Dobre, zostaneme na rovnakej úrovni.") + } + + doneAtLevel = 0 + failedQuestions = 0 + currentBlockWasIncreased = false + + buildNewAttentionRound() + goto(AskAttention) + return@onEntry + } + + // zväčšiť uroveň + val increase = call(AskIncreaseDifficulty) as Boolean + if (increase && attentionLevel < MAX_LEVEL) { + difficultyWasIncreased = true + attentionLevel++ + currentBlockWasIncreased = true + furhat.say("Dobre, zvýšime náročnosť.") + } else { + currentBlockWasIncreased = false + furhat.say("Dobre, zostaneme na rovnakej úrovni.") + } + + doneAtLevel = 0 + failedQuestions = 0 + + buildNewAttentionRound() + goto(AskAttention) + } +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/greeting.kt b/src/main/kotlin/furhatos/app/blank/flow/main/greeting.kt new file mode 100644 index 0000000..ff295d9 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/greeting.kt @@ -0,0 +1,119 @@ +package furhatos.app.blank.flow.main + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.attention.AttentionTrainingIntro +import furhatos.app.blank.flow.main.handlers.Goodbye +import furhatos.app.blank.flow.main.handlers.handleRepeat +import furhatos.app.blank.flow.main.handlers.handleRephrase +import furhatos.app.blank.flow.main.handlers.handleStop +import furhatos.app.blank.flow.main.memory.MemoryTrainingIntro +import furhatos.app.blank.flow.main.say_time.TimeTrainingIntro +import furhatos.app.blank.flow.main.supporting.CheckCondition +import furhatos.app.blank.flow.main.supporting.happyNod +import furhatos.app.blank.flow.main.SessionLogger +import furhatos.app.blank.flow.main.memory.currentSequence +import furhatos.app.blank.flow.main.memory.memoryLevel +import furhatos.app.blank.flow.main.supporting.ReadyToTrain +import furhatos.app.blank.flow.main.supporting.general.TrainingMenuFlags +import furhatos.app.blank.flow.main.supporting.general.isProxyAvailable +import furhatos.app.blank.flow.main.supporting.littleSad +import furhatos.app.blank.nlu.base_answer.Repeat +import furhatos.app.blank.nlu.base_answer.StopTraining +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.onResponse +import furhatos.flow.kotlin.state +import furhatos.flow.kotlin.* +import java.net.HttpURLConnection +import java.net.URL +import kotlin.concurrent.thread + +import java.nio.file.Files +import java.nio.file.Paths +import java.nio.file.StandardOpenOption + +private const val PROXY_BASE_URL = "http://127.0.0.1:8000" + +fun resetRealtimeProxyAsync() { + thread(isDaemon = true) { + try { + val url = URL("$PROXY_BASE_URL/reset") + val conn = url.openConnection() as HttpURLConnection + conn.requestMethod = "POST" + conn.setRequestProperty("Content-Type", "application/json") + conn.doOutput = true + conn.outputStream.use { it.write("{}".toByteArray()) } + conn.inputStream.use { it.readBytes() } // просто чтобы завершить запрос корректно + conn.disconnect() + } catch (e: Exception) { + // не ломаем диалог, если прокси недоступен + } + } +} + +val Greeting: State = state(Parent) { + onEntry { + resetTrainingGameBag() // новый пользователь => новая случайная тройка игр + TrainingMenuFlags.hasTrainedOnce = false; + + resetRealtimeProxyAsync() // сброс прокси + + println("user.dir = ${System.getProperty("user.dir")}") + println("isLocalProjectRun = ${SessionLogger.isLocalProjectRun()}") + println("isRunningOnRobot = ${SessionLogger.isRunningOnRobot()}") + + SessionLogger.clearCsvIfRunningOnRobot() +// SessionLogger.flushPendingLogs() + SessionLogger.flushPendingLogsAsync() + SessionLogger.startNewSession() + + happyNod() + furhat.say { + random { + +"Ahoj! Teším sa na náš rozhovor." + +"Dobrý deň! Ďakujem, že ste prišli." + +"Dobrý deň, vítam vás." + +"Dobrý deň! Som ráda, že vás vidím." + } + } + + furhat.say(pendingFileStatusMessage()) + + furhat.listen() + } + + onResponse { + if (handleStop(it.intent, + "system", + "greeting", + it.text ?: "")) + { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onResponse + } + } + + onResponse{ + if (handleRepeat( + it.intent, + "repeat", + "system", + "greeting", + it.text ?: "" + )) + { + return@onResponse + } + } + + onResponse { + if (handleRephrase(it.intent)){ + return@onResponse + } + + goto(CheckCondition) +// goto(TimeTrainingIntro) +// goto(MemoryTrainingIntro) + } +} + diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/handlers/Goodbye.kt b/src/main/kotlin/furhatos/app/blank/flow/main/handlers/Goodbye.kt new file mode 100644 index 0000000..f6db2b1 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/handlers/Goodbye.kt @@ -0,0 +1,26 @@ +package furhatos.app.blank.flow.main.handlers +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.Idle +import furhatos.app.blank.flow.main.supporting.calm +import furhatos.flow.kotlin.* +import furhatos.gestures.Gestures + +val Goodbye: State = state(Parent) { + + onEntry { + furhat.gesture(Gestures.BigSmile, async = true) + furhat.say { + random { + +"Ďakujem za dnešok. Prajem vám pekný deň!" + +"Bolo mi potešením. Dovidenia!" + +"Ďakujem, že ste so mnou cvičili. Majte sa krásne." + +"Oddýchnite si a uvidíme sa nabudúce. Dovidenia!" + +"Ak budete chcieť pokračovať, som tu pre vás. Dovidenia!" + +"Majte sa dobre a dávajte na seba pozor. Dovidenia!" + +"Dovidenia!" + } + } + furhat.attendNobody() + goto(Idle) + } +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/handlers/RepeatHandler.kt b/src/main/kotlin/furhatos/app/blank/flow/main/handlers/RepeatHandler.kt new file mode 100644 index 0000000..cdeb418 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/handlers/RepeatHandler.kt @@ -0,0 +1,86 @@ +package furhatos.app.blank.flow.main.handlers +import furhatos.app.blank.flow.main.SessionLogger +import furhatos.app.blank.flow.main.say_time.wrongAttempts +import furhatos.app.blank.flow.main.supporting.happyNod +import furhatos.app.blank.nlu.base_answer.Repeat +import furhatos.flow.kotlin.* +import furhatos.nlu.IntentInstance + +var lastPhrase: String? = null +var lastPhraseIsQuestion: Boolean = false + +fun FlowControlRunner.askRepeatable(text: String) { + lastPhrase = text + lastPhraseIsQuestion = true + furhat.ask(text) +} + +fun FlowControlRunner.sayRepeatable(text: String) { + lastPhrase = text + lastPhraseIsQuestion = false + furhat.say(text) +} + +//fun FlowControlRunner.handleRepeat(intent: IntentInstance?): Boolean { +// if (intent is Repeat) { +// val phrase = lastPhrase +// if (phrase != null) { +// happyNod() +// furhat.say("Samozrejme môžem zopakovať.") +// +// if (lastPhraseIsQuestion) { +// furhat.ask(phrase) +// } else { +// furhat.say(phrase) +// furhat.listen() +// } +// } else { +// furhat.say("Prepáčte, momentálne nemám čo zopakovať.") +// furhat.listen() +// } +// return true +// } +// return false +//} + +fun FlowControlRunner.handleRepeat( + intent: IntentInstance?, + game: String, + question: String, + correctAnswer: String = "", + userAnswer: String = "", + hintUsed: Boolean = false +): Boolean { + if (intent is Repeat) { + val phrase = lastPhrase + + SessionLogger.log( + game = game, + phase = "event", + question = question, + attempt = wrongAttempts + 1, + result = "repeat_requested", + correctAnswer = correctAnswer, + userAnswer = userAnswer, + hintUsed = hintUsed + ) + + if (phrase != null) { + happyNod() + furhat.say("Samozrejme môžem zopakovať.") + + if (lastPhraseIsQuestion) { + furhat.ask(phrase) + } else { + furhat.say(phrase) + furhat.listen() + } + } else { + furhat.say("Prepáčte, momentálne nemám čo zopakovať.") + furhat.listen() + } + return true + } + return false +} + diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/handlers/RephraseHandler.kt b/src/main/kotlin/furhatos/app/blank/flow/main/handlers/RephraseHandler.kt new file mode 100644 index 0000000..c8ce3ea --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/handlers/RephraseHandler.kt @@ -0,0 +1,40 @@ +package furhatos.app.blank.flow.main.handlers + +import furhatos.app.blank.flow.main.supporting.general.callProxyRespond +import furhatos.app.blank.flow.main.supporting.general.isProxyAvailable +import furhatos.app.blank.flow.main.supporting.veryHappy +import furhatos.app.blank.nlu.base_answer.Rephrase +import furhatos.flow.kotlin.FlowControlRunner +import furhatos.flow.kotlin.furhat +import furhatos.nlu.IntentInstance + +fun FlowControlRunner.handleRephrase(intent: IntentInstance?): Boolean { + if (intent is Rephrase) { + val phrase = lastPhrase + + if (phrase != null) { + if (isProxyAvailable()) { + val rephrased = callProxyRespond( + userText = phrase, + task = "rephrase", + context = mapOf( + "original_question" to phrase + ) + ) + + if (!rephrased.isNullOrBlank()) { + veryHappy() + furhat.say("Poviem to pre Vas inak.") + askRepeatable(rephrased) + } + }else{ + furhat.say("Poviem to pre Vas inak.") + askRepeatable(phrase) + } + } else { + furhat.say("Prepáčte, momentálne nemám čo preformulovať.") + } + return true + } + return false +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/handlers/StopHandler.kt b/src/main/kotlin/furhatos/app/blank/flow/main/handlers/StopHandler.kt new file mode 100644 index 0000000..dd9ccaf --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/handlers/StopHandler.kt @@ -0,0 +1,62 @@ +package furhatos.app.blank.flow.main.handlers + +import furhatos.app.blank.flow.main.SessionLogger +import furhatos.app.blank.flow.main.say_time.hintUsedForCurrentQuestion +import furhatos.app.blank.flow.main.say_time.questionsSinceLastCheck +import furhatos.app.blank.flow.main.say_time.wrongAttempts +import furhatos.app.blank.flow.main.supporting.empathy +import furhatos.app.blank.nlu.base_answer.StopTraining +import furhatos.flow.kotlin.FlowControlRunner +import furhatos.flow.kotlin.furhat +import furhatos.nlu.IntentInstance + +//fun FlowControlRunner.handleStop(intent: IntentInstance?): Boolean { +// if (intent is StopTraining) { +// empathy() +// furhat.say{ +// random{ +// +"Rozumiem. Zastavíme to, nič sa nedeje." +// +"Dobre, zastavme sa tu." +// } +// } +// +// wrongAttempts = 0 +// questionsSinceLastCheck = 0 +// return true +// } +// return false +//} + +fun FlowControlRunner.handleStop( + intent: IntentInstance?, + game: String, + question: String, + userAnswer: String = "" +): Boolean { + if (intent is StopTraining) { + println("DEBUG handleStop: StopTraining matched") + SessionLogger.log( + game = game, + phase = "event", + question = question, + attempt = wrongAttempts + 1, + result = "stop_requested", + correctAnswer = "", + userAnswer = userAnswer, + hintUsed = hintUsedForCurrentQuestion + ) + + empathy() + furhat.say { + random { + +"Rozumiem. Zastavíme to, nič sa nedeje." + +"Dobre, zastavme sa tu." + } + } + + wrongAttempts = 0 + questionsSinceLastCheck = 0 + return true + } + return false +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/idle.kt b/src/main/kotlin/furhatos/app/blank/flow/main/idle.kt new file mode 100644 index 0000000..706923c --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/idle.kt @@ -0,0 +1,27 @@ +package furhatos.app.blank.flow.main + +import furhatos.app.blank.flow.main.supporting.general.Test +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.furhat +import furhatos.flow.kotlin.onUserEnter +import furhatos.flow.kotlin.onUserLeave +import furhatos.flow.kotlin.state + +val Idle: State = state { + onEntry { + furhat.attendNobody() + } + + onUserEnter { + furhat.attend(it) + goto(Greeting) +// goto(Test) + } + + onUserLeave(){ +// furhat.attend(it) +// sayGoodbye() + furhat.attendNobody() + } + +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/memory/AskSequence.kt b/src/main/kotlin/furhatos/app/blank/flow/main/memory/AskSequence.kt new file mode 100644 index 0000000..9b7cd33 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/memory/AskSequence.kt @@ -0,0 +1,642 @@ +package furhatos.app.blank.flow.main.memory + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.SessionLogger +import furhatos.app.blank.flow.main.StartQuestion +import furhatos.app.blank.flow.main.handlers.Goodbye +import furhatos.app.blank.flow.main.handlers.handleRepeat +import furhatos.app.blank.flow.main.handlers.handleStop +import furhatos.app.blank.flow.main.supporting.AskToContinue +import furhatos.app.blank.flow.main.supporting.general.WordBank +import furhatos.app.blank.flow.main.supporting.general.WordEntry +import furhatos.app.blank.flow.main.supporting.empathy +import furhatos.app.blank.flow.main.supporting.sayPhraseForWrongAnswer +import furhatos.app.blank.flow.main.supporting.littleSad +import furhatos.app.blank.flow.main.supporting.veryHappy +import furhatos.app.blank.nlu.base_answer.DontKnow +import furhatos.app.blank.nlu.base_answer.Help +import furhatos.app.blank.nlu.base_answer.Repeat +import furhatos.app.blank.nlu.base_answer.StopTraining +import furhatos.flow.kotlin.* +import kotlin.math.ceil +import kotlin.random.Random +import furhatos.app.blank.flow.main.say_time.wrongAttempts +import furhatos.app.blank.flow.main.say_time.hintUsedForCurrentQuestion +import furhatos.app.blank.flow.main.supporting.AskDecreaseDifficulty +import furhatos.app.blank.flow.main.supporting.AskIncreaseDifficulty +import furhatos.app.blank.flow.main.supporting.ReadyToTrain +import furhatos.app.blank.flow.main.supporting.general.SmallTalkContext +import furhatos.app.blank.flow.main.supporting.general.TrainingMenuFlags +import furhatos.app.blank.flow.main.supporting.general.callProxyRespond +import furhatos.app.blank.flow.main.supporting.general.genericSmallTalk +import furhatos.app.blank.flow.main.supporting.general.isProxyAvailable +import furhatos.app.blank.flow.main.supporting.general.requestSmallTalk +import furhatos.app.blank.flow.main.supporting.general.sendLogEvent +import furhatos.gestures.Gestures + +// -------------------- parametre -------------------- + +private const val MAX_LEVEL = 3 +private const val QUESTIONS_PER_LEVEL = 2 + +private const val SUCCESS_THRESHOLD = 0.90 +private const val NEAR_SUCCESS_THRESHOLD = 0.60 + +private const val MAX_SAME_LEVEL_QUESTIONS = 6 + +var memoryLevel: Int = 1 +var sequencesDoneAtLevel: Int = 0 + +var sameLevelQuestionsDone: Int = 0 +var difficultyWasIncreased: Boolean = false + +// koľko otázok v aktuálnom bloku z 2 bolo neúspešných +var failedQuestions: Int = 0 + +// Bol aktuálny blok z 2 kôl začatý po zvýšení náročnosti +var currentBlockWasIncreased: Boolean = false + +private var sequencePresented: Boolean = false +var currentSequence: List = emptyList() + +// slová používateľa po jednom +val collectedTokens: MutableList = mutableListOf() + +// pozície chýb v poslednom pokuse +var lastWrongPositions: List = emptyList() + +var memoryHintReason: String = "general" + +// -------------------- hodnotenie pokusu -------------------- +private fun requiredCorrectCount(n: Int, threshold: Double): Int = + ceil(n * threshold).toInt().coerceAtLeast(1) + + +private fun evaluateCollected(collected: List, target: List): Pair> { + val n = target.size + var correct = 0 + val wrongPos = mutableListOf() + + for (i in 0 until n) { + val userTok = collected.getOrNull(i) + val ok = userTok != null && WordsChecker.matchesWord(userTok, target[i]) + if (ok) correct++ else wrongPos.add(i + 1) + } + return Pair(correct, wrongPos) +} + +// -------------------- generovanie postupnosti -------------------- + +private fun lengthForLevel(level: Int, rng: Random = Random.Default): Int = when (level) { + 1 -> listOf(3, 3).random(rng) + 2 -> listOf(5, 6).random(rng) + else -> listOf(6, 7).random(rng) +} + +private fun buildNewSequence() { + val len = lengthForLevel(memoryLevel) + currentSequence = WordBank.pickSequence( + length = len, + maxDifficulty = memoryLevel + ) + sequencePresented = false + lastWrongPositions = emptyList() + collectedTokens.clear() +} +//============================================================== +// Small Talk +//============================================================== +fun buildMemorySmallTalkContext(): SmallTalkContext { + val theme = currentSequence.firstOrNull()?.theme ?: "memory" + + return SmallTalkContext( + exercise = "memory", + topic = theme, + subtopic = "sequence_recall", + targetWord = currentSequence.firstOrNull()?.canonical, + responseMode = "open" + ) +} + +fun memorySmallTalkSmart(nextState: State): State { + val ctx = buildMemorySmallTalkContext() + val proxyQuestion = requestSmallTalk(ctx) + + return if (proxyQuestion.isNotBlank()) { + genericSmallTalk( + context = ctx, + nextState = nextState, + fallbackQuestion = "Spája sa Vám niektoré z týchto slov s niečím známym?", + preparedQuestion = proxyQuestion + ) + } else { + genericSmallTalk( + context = ctx, + nextState = nextState, + fallbackQuestion = "Spája sa Vám niektoré z týchto slov s niečím známym?" + ) + } +} +//============================================================== +// Hint +//============================================================== + +fun requestMemoryExplainWrong(mistakeType: String): String { + val sequenceWords = currentSequence.map { it.canonical }.joinToString(", ") + val pos = lastWrongPositions.distinct().sorted().joinToString(", ") + + if (!isProxyAvailable()) { + return "" + } + + return callProxyRespond( + userText = "Používateľ urobil chybu v cvičení pamäte.", + task = "explain_wrong", + context = mapOf( + "exercise" to "memory", + "mistake_type" to mistakeType, // final_failure / partial_wrong + "level" to memoryLevel, + "sequence_length" to currentSequence.size, + "target_sequence" to sequenceWords, + "wrong_positions" to pos + ) + ) ?: "" +} +//=============================================== +// Proces hry +//=============================================== +// Intro + +val MemoryTrainingIntro: State = state(Parent) { + onEntry { + wrongAttempts = 0 + hintUsedForCurrentQuestion = false + + sameLevelQuestionsDone = 0 + difficultyWasIncreased = false + + failedQuestions = 0 + currentBlockWasIncreased = false + + memoryLevel = 1 + sequencesDoneAtLevel = 0 + + buildNewSequence() + goto(AskSequence) + } +} + +// -------------------- AskSequence - zobrazuje zoznam 1 raz, potom prejde k zberu -------------------- + +val AskSequence: State = state(Parent) { + + onEntry { + furhat.say("Teraz pomenujem niekoľko pojmov.") + + if (!sequencePresented) { + furhat.say("Pozorne počúvajte a zapamätajte si ich.") + //delay(1000) + furhat.say("Poradie slov je také:") + delay(1000) + + currentSequence.forEachIndexed { i, w -> + furhat.say(w.canonical) + if (i != currentSequence.lastIndex) delay(1700) + } + + delay(1300) + furhat.say("Skúste ich teraz zopakovať v rovnakom poradí.") + sequencePresented = true + + memoryLogWithDebug("question_shown / asked"){ + SessionLogger.log( + game = "memory", + phase = "question_shown", + question = "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", + attempt = wrongAttempts + 1, + result = "asked", + correctAnswer = currentSequence.joinToString(", ") { it.canonical }, + userAnswer = "", + hintUsed = hintUsedForCurrentQuestion + )} + } + + collectedTokens.clear() + goto(CollectSequence) + } +} + +// -------------------- CollectSequence: pocuvanie slov ---------------- + +val CollectSequence: State = state(Parent) { + + onEntry { + furhat.param.endSilTimeout = 400 + furhat.attend(users.current) + + furhat.listen() + } + + onResponse { + memoryLogWithDebug("Don't know"){ + SessionLogger.log( + game = "memory", + phase = "event", + question = "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", + attempt = wrongAttempts + 1, + result = "dont_know", + correctAnswer = currentSequence.joinToString(", ") { it.canonical }, + userAnswer = it.text ?: "", + hintUsed = hintUsedForCurrentQuestion + )} + + empathy() + furhat.say("Rozumiem, to je v poriadku.") + + if (!hintUsedForCurrentQuestion) { + memoryHintReason = "dont_know" + if (wrongAttempts < 2) wrongAttempts = 2 + goto(MemoryHintOffer) + return@onResponse + } + + // napoveda uz bola + wrongAttempts = 3 + lastWrongPositions = (1..currentSequence.size).toList() + goto(AfterSequenceResolved) + } + + onResponse { + memoryLogWithDebug("Help"){ + SessionLogger.log( + game = "memory", + phase = "event", + question = "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", + attempt = wrongAttempts + 1, + result = "help_requested", + correctAnswer = currentSequence.joinToString(", ") { it.canonical }, + userAnswer = it.text ?: "", + hintUsed = hintUsedForCurrentQuestion + )} + + if (!hintUsedForCurrentQuestion) { + veryHappy() + + memoryHintReason = "help" + furhat.say("Samozrejme, pomôžem Vám!") + + if (wrongAttempts < 2) wrongAttempts = 2 + goto(MemoryHintOffer) + return@onResponse + } + + empathy() + furhat.say("Už som Vám raz zopakoval zoznam.") + + furhat.gesture(Gestures.ExpressSad(strength = 0.35, duration = 0.8), async = true) + furhat.say("Je mi ľúto, že Vám nepomohol. Skúste to ešte raz.") + collectedTokens.clear() + reentry() + } + + onResponse { + if (handleStop(it.intent, + "memory", + "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", + it.text ?: "")) + { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onResponse + } + } + +// onResponse { +// if (handleRepeat( +// it.intent, +// "memory", +// "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", +// currentSequence.joinToString(", ") { it.canonical }, +// it.text ?: "", +// true +// )) +// { +// return@onResponse +// } +// } + + onResponse { + if (it.intent is Repeat) { + SessionLogger.log( + game = "memory", + phase = "event", + question = "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", + attempt = wrongAttempts + 1, + result = "repeat_requested", + correctAnswer = currentSequence.joinToString(", ") { it.canonical }, + userAnswer = it.text ?: "", + hintUsed = true + ) + + hintUsedForCurrentQuestion = true + collectedTokens.clear() + + furhat.say("Zopakujem Vám zoznam ešte raz.") + delay(1000) + furhat.say("Slová sú:") + delay(1000) + currentSequence.forEachIndexed { i, w -> + furhat.say(w.canonical) + if (i != currentSequence.lastIndex) delay(1200) + } + reentry() + return@onResponse + } + + val text = it.text ?: "" + val token = WordsChecker.tokenizeMeaningful(text).firstOrNull() + + if (token == null) { + // nic zmyslene nebolo + + memoryLogWithDebug("Zber sekvencii - null"){ + SessionLogger.log( + game = "memory", + phase = "event", + question = "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", + attempt = wrongAttempts + 1, + result = "unrecognized_token", + correctAnswer = currentSequence.joinToString(", ") { it.canonical }, + userAnswer = text, + hintUsed = hintUsedForCurrentQuestion + )} + + littleSad() + reentry() + return@onResponse + } + + collectedTokens.add(token) + + furhat.gesture(Gestures.Nod, async = true) + + if (collectedTokens.size < currentSequence.size) { + reentry() + return@onResponse + } + + // pokus je cely -> hodnotenie + val n = currentSequence.size + val requiredSuccess = requiredCorrectCount(n, SUCCESS_THRESHOLD) + val requiredNear = requiredCorrectCount(n, NEAR_SUCCESS_THRESHOLD) + + val (correct, wrongPos) = evaluateCollected(collectedTokens, currentSequence) + lastWrongPositions = wrongPos + + val targetSequence = currentSequence.joinToString(", ") { it.canonical } + val userSequence = collectedTokens.joinToString(", ") + + val resultForLog = when { + correct >= requiredSuccess -> "success" + correct >= requiredNear -> "partial_success" + else -> "fail" + } + + memoryLogWithDebug("Zber sekvencii / answer"){ + SessionLogger.log( + game = "memory", + phase = "answer", + question = "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", + attempt = wrongAttempts + 1, + result = resultForLog, + correctAnswer = targetSequence, + userAnswer = userSequence, + hintUsed = hintUsedForCurrentQuestion + )} + + when { + // full uspech + correct >= requiredSuccess -> { + wrongAttempts = 0 + hintUsedForCurrentQuestion = false + + veryHappy() + furhat.say("Výborne! To bolo správne.") + delay(1000) + + goto(memorySmallTalkSmart(AfterSequenceResolved)) + return@onResponse + } + + // >= 60% a < 80% + correct >= requiredNear -> { + wrongAttempts = 0 + hintUsedForCurrentQuestion = false + + veryHappy() + furhat.say("Takmer všetky slová ste pomenovali správne!") + delay(1000) + + goto(memorySmallTalkSmart(AfterSequenceResolved)) + return@onResponse + } + + else -> { + wrongAttempts++ + when (wrongAttempts) { + 1 -> { + val hint = requestMemoryHint("partial_wrong") + + if (hint.isNotBlank()){ + furhat.say("Dajte mi chvíľu. Pokúsim sa Vám pomôcť.") + furhat.say(hint) + } + else{ + littleSad() + furhat.say("Nie celkom správne. Skúste to ešte raz.") + } + + + collectedTokens.clear() + reentry() + } + 2 -> { + sayPhraseForWrongAnswer() + collectedTokens.clear() + goto(MemoryHintOffer) + } + else -> goto(AfterSequenceResolved) + } + } + } + } + + onNoResponse { + memoryLogWithDebug("No response"){ + SessionLogger.log( + game = "memory", + phase = "answer", + question = "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", + attempt = wrongAttempts + 1, + result = "no_response", + correctAnswer = currentSequence.joinToString(", ") { it.canonical }, + userAnswer = "", + hintUsed = hintUsedForCurrentQuestion + )} + + if (!hintUsedForCurrentQuestion) { + if (wrongAttempts < 2) wrongAttempts = 2 + goto(MemoryHintOffer) + } else { + wrongAttempts = 3 + lastWrongPositions = (1..currentSequence.size).toList() + goto(AfterSequenceResolved) + } + } +} + +// -------------------- prechod medzi urovni -------------------- + +val AfterSequenceResolved: State = state(Parent) { + onEntry { + if (wrongAttempts >= 3) { + memoryLogWithDebug("Resolved sequence"){ + SessionLogger.log( + game = "memory", + phase = "resolved", + question = "LEVEL_${memoryLevel}_LEN_${currentSequence.size}", + attempt = wrongAttempts, + result = "final_fail", + correctAnswer = currentSequence.joinToString(", ") { it.canonical }, + userAnswer = collectedTokens.joinToString(", "), + hintUsed = hintUsedForCurrentQuestion + )} + + val pos = lastWrongPositions.distinct().sorted().joinToString(", ") + val explanation = requestMemoryExplainWrong("final_failure") + + littleSad() + furhat.say("Je mi ľúto, ale nedali ste správnu odpoveď. Tentoraz to nevyšlo, ale to nevadí.") + + if (explanation.isNotBlank()){ + furhat.say(explanation) + } + else{ + furhat.say("V poslednej odpovedi boli nesprávne slová na pozíciách: $pos.") + } + + delay(1000) + } + + // zatvorenie otazky + val questionFailed = wrongAttempts >= 3 + wrongAttempts = 0 + hintUsedForCurrentQuestion = false + collectedTokens.clear() + lastWrongPositions = emptyList() + + sequencesDoneAtLevel++ + + if (questionFailed) { + failedQuestions++ + } + + if (!difficultyWasIncreased) { + sameLevelQuestionsDone++ + + if (sameLevelQuestionsDone >= MAX_SAME_LEVEL_QUESTIONS) { + veryHappy() + furhat.say("Výborne, dnes už stačí. Ukončíme tuto hru na pamäť. Ďakujem Vám!") + delay(1000) + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onEntry + } + } + + if (sequencesDoneAtLevel < QUESTIONS_PER_LEVEL) { + buildNewSequence() + goto(AskSequence) + return@onEntry + } + + if (memoryLevel >= MAX_LEVEL) { + veryHappy() + furhat.say("Týmto sme ukončili dnešnú hru na pamäť. Ďakujem Vám!") + delay(1000) + + TrainingMenuFlags.allMemoryQuestionsCompleted = true + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onEntry + } + + val wantsToContinue = call(AskToContinue()) as Boolean + if (!wantsToContinue) { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onEntry + } + + // vrátiť sa, ak boli obe otázky na novej úrovni neúspešné + if (currentBlockWasIncreased && failedQuestions >= QUESTIONS_PER_LEVEL && memoryLevel > 1) { + + val goBack = call(AskDecreaseDifficulty) as Boolean + + if (goBack) { + memoryLevel-- + furhat.say("Dobre, vrátime sa na ľahšiu úroveň.") + } else { + furhat.say("Dobre, zostaneme na rovnakej úrovni.") + } + + sequencesDoneAtLevel = 0 + failedQuestions = 0 + currentBlockWasIncreased = false + + buildNewSequence() + goto(AskSequence) + return@onEntry + } + + + val increase = call(AskIncreaseDifficulty) as Boolean + if (increase && memoryLevel < MAX_LEVEL) { + difficultyWasIncreased = true + memoryLevel++ + currentBlockWasIncreased = true + furhat.say("Dobre, zvýšime náročnosť.") + } else { + currentBlockWasIncreased = false + furhat.say("Dobre, zostaneme na rovnakej úrovni.") + } + + sequencesDoneAtLevel = 0 + failedQuestions = 0 + buildNewSequence() + goto(AskSequence) + } +} + + +private fun memoryLogDebug(stage: String) { + val now = java.time.LocalTime.now() + println("[MEMORY DEBUG $now] $stage") +} + +private inline fun memoryLogWithDebug( + stage: String, + block: () -> Unit +) { + val start = System.currentTimeMillis() + memoryLogDebug("START log -> $stage") + + try { + block() + val elapsed = System.currentTimeMillis() - start + memoryLogDebug("END log -> $stage (${elapsed} ms)") + } catch (e: Exception) { + val elapsed = System.currentTimeMillis() - start + memoryLogDebug("ERROR log -> $stage (${elapsed} ms): ${e.message}") + throw e + } +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/memory/MemoryHint.kt b/src/main/kotlin/furhatos/app/blank/flow/main/memory/MemoryHint.kt new file mode 100644 index 0000000..5d0d2e7 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/memory/MemoryHint.kt @@ -0,0 +1,64 @@ +package furhatos.app.blank.flow.main.memory + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.say_time.hintUsedForCurrentQuestion +import furhatos.app.blank.flow.main.supporting.HintOffer +import furhatos.app.blank.flow.main.supporting.general.callProxyRespond +import furhatos.app.blank.flow.main.supporting.general.isProxyAvailable +import furhatos.app.blank.flow.main.supporting.veryHappy +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.furhat +import furhatos.flow.kotlin.state + +fun requestMemoryHint(mistakeType: String): String { + val sequenceWords = currentSequence.map { it.canonical }.joinToString(", ") + + if (!isProxyAvailable()) { + return "" + } + + return callProxyRespond( + userText = "Používateľ potrebuje nápovedu v cvičení pamäte.", + task = "hint", + context = mapOf( + "exercise" to "memory", + "mistake_type" to mistakeType, // partial_wrong / dont_know / no_response / help + "level" to memoryLevel, + "sequence_length" to currentSequence.size, + "target_sequence" to sequenceWords, + "wrong_positions" to lastWrongPositions.joinToString(", ") + ) + ) ?: "" +} + +val MemoryHintOffer: State by lazy { + HintOffer(nextState = MemoryHint, exitState = CollectSequence) +} + +val MemoryHint: State = state(Parent) { + onEntry { + hintUsedForCurrentQuestion = true + collectedTokens.clear() + + val proxyHint = requestMemoryHint(memoryHintReason) + + if (proxyHint.isNotBlank()){ + furhat.say(proxyHint) + } + else{ + veryHappy() + furhat.say("Dobre! Zopakujem Vám zoznam ešte raz.") + + furhat.say("Slová sú:") + + currentSequence.forEachIndexed { i, w -> + furhat.say(w.canonical) + if (i != currentSequence.lastIndex) delay(1300) + } + + } + + furhat.say("Prosím, pokračujte.") + goto(CollectSequence) + } +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/memory/WordsCompare.kt b/src/main/kotlin/furhatos/app/blank/flow/main/memory/WordsCompare.kt new file mode 100644 index 0000000..96b2028 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/memory/WordsCompare.kt @@ -0,0 +1,52 @@ +package furhatos.app.blank.flow.main.memory + +import furhatos.app.blank.flow.main.supporting.general.WordEntry +import java.text.Normalizer + +// -------------------- zbytocne slova -------------------- +private val STOPWORDS: Set = setOf( + "eee", "ehm", "hm", "hmm", "mmm", + "no", "tak", "teda", "proste", "akoze", "akože", "vlastne", + "prosím", "prosim", "prosímťa", "prosimta", + "a", "aj", "že", "ze", "potom", "takže", "takze", "iii", "i" +) + +object WordsChecker { + // normalizacia + private fun stripDiacritics(s: String): String { + val norm = Normalizer.normalize(s, Normalizer.Form.NFD) + return norm.replace("\\p{Mn}+".toRegex(), "") + } + + private fun normalizeToken(token: String): String = + stripDiacritics(token.lowercase()) + .replace("[^a-z0-9]".toRegex(), "") + + fun tokenizeMeaningful(text: String): List { + val cleaned = text + .lowercase() + .replace("[,.;:!?()\\[\\]{}\"“”„–—]".toRegex(), " ") + .replace("\\s+".toRegex(), " ") + .trim() + + if (cleaned.isEmpty()) return emptyList() + + return cleaned.split(" ") + .map { it.trim() } + .filter { it.isNotEmpty() } + .filter { normalizeToken(it).isNotEmpty() } + .filter { normalizeToken(it) !in STOPWORDS } + } + + fun matchesWord(userToken: String, target: WordEntry): Boolean { + val userNorm = normalizeToken(userToken) + if (userNorm.isEmpty()) return false + + val acceptable = (target.variants + target.canonical) + .map { normalizeToken(it) } + .filter { it.isNotEmpty() } + .toSet() + + return userNorm in acceptable + } +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/say_time/AskTime.kt b/src/main/kotlin/furhatos/app/blank/flow/main/say_time/AskTime.kt new file mode 100644 index 0000000..9a9ca69 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/say_time/AskTime.kt @@ -0,0 +1,907 @@ +package furhatos.app.blank.flow.main.say_time + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.SessionLogger +import furhatos.app.blank.flow.main.StartQuestion +import furhatos.app.blank.flow.main.handlers.Goodbye +import furhatos.app.blank.flow.main.handlers.askRepeatable +import furhatos.app.blank.flow.main.handlers.handleRepeat +import furhatos.app.blank.flow.main.handlers.handleRephrase +import furhatos.app.blank.flow.main.handlers.handleStop +import furhatos.app.blank.nlu.base_answer.StopTraining +import furhatos.app.blank.flow.main.memory.currentSequence +import furhatos.app.blank.flow.main.memory.memoryLevel +import furhatos.app.blank.flow.main.pendingFileStatusMessage +import furhatos.app.blank.flow.main.supporting.AskToContinue +import furhatos.app.blank.nlu.base_answer.DontKnow +import furhatos.app.blank.nlu.base_answer.Rephrase +import furhatos.app.blank.nlu.base_answer.Help +import furhatos.app.blank.flow.main.supporting.CurrentMonthSmallTalk +import furhatos.app.blank.flow.main.supporting.CurrentTimeSmallTalk +import furhatos.app.blank.flow.main.supporting.DayPeriodSmallTalk +import furhatos.app.blank.flow.main.supporting.ReadyToTrain +import furhatos.app.blank.flow.main.supporting.TodayDateSmallTalk +import furhatos.app.blank.flow.main.supporting.TomorrowDateSmallTalk +import furhatos.app.blank.flow.main.supporting.general.TrainingMenuFlags +import furhatos.app.blank.flow.main.supporting.WeekdaySmallTalk +import furhatos.app.blank.flow.main.supporting.calm +import furhatos.app.blank.flow.main.supporting.empathy +import furhatos.app.blank.flow.main.supporting.happyShake +import furhatos.app.blank.flow.main.supporting.littleSad +import furhatos.app.blank.flow.main.supporting.explainWhyWrong +import furhatos.app.blank.flow.main.supporting.general.SmallTalkContext +import furhatos.app.blank.flow.main.supporting.general.genericSmallTalk +import furhatos.app.blank.flow.main.supporting.general.requestSmallTalk +import furhatos.app.blank.flow.main.supporting.sayPhraseForWrongAnswer +import furhatos.app.blank.flow.main.supporting.veryHappy +import furhatos.app.blank.nlu.base_answer.Repeat +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.furhat +import furhatos.flow.kotlin.state +import furhatos.flow.kotlin.* +import kotlin.random.Random + + +var TimeQuestionTypes: MutableList = mutableListOf( + TimeQuestionType.CURRENT_TIME, + TimeQuestionType.TODAY_DATE, + TimeQuestionType.TOMORROW_DATE, + TimeQuestionType.CURRENT_MONTH, + TimeQuestionType.TODAY_WEEKDAY, + TimeQuestionType.DAY_PERIOD +) + +val priorityTimeQuestionOrder: List = listOf( + TimeQuestionType.CURRENT_MONTH, + TimeQuestionType.TODAY_DATE, + TimeQuestionType.TOMORROW_DATE +) + +var priorityIndex: Int = 0 +private const val MAX_SMALLTALK_PER_SESSION = 3 // половина из 6 +var smallTalkUsed = 0 + + +//============================================================== +// Small Talk +//============================================================== +fun buildSmallTalkContextTime(question: TimeQuestionType): SmallTalkContext { + return when (question) { + TimeQuestionType.CURRENT_TIME -> SmallTalkContext( + exercise = "time", + topic = "time", + subtopic = "current_time", + responseMode = "open" + ) + + TimeQuestionType.TODAY_DATE -> SmallTalkContext( + exercise = "time", + topic = "date", + subtopic = "today_date", + responseMode = "open" + ) + + TimeQuestionType.TOMORROW_DATE -> SmallTalkContext( + exercise = "time", + topic = "date", + subtopic = "tomorrow_date", + responseMode = "open" + ) + + TimeQuestionType.CURRENT_MONTH -> SmallTalkContext( + exercise = "time", + topic = "month", + subtopic = "current_month", + responseMode = "open" + ) + + TimeQuestionType.TODAY_WEEKDAY -> SmallTalkContext( + exercise = "time", + topic = "weekday", + subtopic = DateTimeChecker.CorrectTodayWeekday(), + responseMode = "open" + ) + + TimeQuestionType.DAY_PERIOD -> SmallTalkContext( + exercise = "time", + topic = "day_period", + subtopic = lastDayPeriod, + responseMode = "yes_no" + ) + } +} + +fun fallbackSmallTalk(question: TimeQuestionType): State { + return when (question) { + TimeQuestionType.CURRENT_TIME -> CurrentTimeSmallTalk + TimeQuestionType.TODAY_DATE -> TodayDateSmallTalk + TimeQuestionType.TOMORROW_DATE -> TomorrowDateSmallTalk + TimeQuestionType.CURRENT_MONTH -> CurrentMonthSmallTalk + TimeQuestionType.TODAY_WEEKDAY -> WeekdaySmallTalk + TimeQuestionType.DAY_PERIOD -> DayPeriodSmallTalk + } +} + +fun smallTalkManagerTime(question: TimeQuestionType): State { + if (smallTalkUsed >= MAX_SMALLTALK_PER_SESSION) return TimeTrainingSuccess + + // kolko otazok este su v liste + val denom = TimeQuestionTypes.size + 1 + val smallTalkLeft = MAX_SMALLTALK_PER_SESSION - smallTalkUsed + + // výpočty šancov + val percent = minOf(0.5, smallTalkLeft.toDouble() / denom.toDouble()) + val doSmallTalk = Random.nextDouble() < percent + + if (!doSmallTalk) return TimeTrainingSuccess + if (TimeQuestionTypes.isEmpty()) return TimeTrainingSuccess + + val ctx = buildSmallTalkContextTime(question) + val proxyQuestion = requestSmallTalk(ctx) + + smallTalkUsed++ + + return if (proxyQuestion.isNotBlank()) { + genericSmallTalk( + context = ctx, + nextState = TimeTrainingSuccess, + preparedQuestion = proxyQuestion + ) + } else { + fallbackSmallTalk(question) + } +} + +fun smallTalkAfterQuestion(question: TimeQuestionType): State { + if (smallTalkUsed >= MAX_SMALLTALK_PER_SESSION) return TimeTrainingSuccess + + // kolko otazok este su v liste + val denom = TimeQuestionTypes.size + 1 + + val smallTalkLeft = MAX_SMALLTALK_PER_SESSION - smallTalkUsed + + // výpočty šancov + val percent = minOf(0.5, smallTalkLeft.toDouble() / denom.toDouble()) + val doSmallTalk = Random.nextDouble() < percent + + if (!doSmallTalk) return TimeTrainingSuccess + if (TimeQuestionTypes.isEmpty()) return TimeTrainingSuccess + + smallTalkUsed++ + return when (question) { + TimeQuestionType.CURRENT_TIME -> CurrentTimeSmallTalk + TimeQuestionType.TODAY_DATE -> TodayDateSmallTalk + TimeQuestionType.TOMORROW_DATE -> TomorrowDateSmallTalk + TimeQuestionType.CURRENT_MONTH -> CurrentMonthSmallTalk + TimeQuestionType.TODAY_WEEKDAY -> WeekdaySmallTalk + TimeQuestionType.DAY_PERIOD -> DayPeriodSmallTalk + } +} +//----------------------------------------------------------------- + +// vráti náhodný ešte nepoužitý typ a zároveň ho odstráni zo zoznamu. +fun pickRandomTimeQuestionType(): TimeQuestionType { + // prioritne otazky -> potom ostatne + while (priorityIndex < priorityTimeQuestionOrder.size) { + val candidate = priorityTimeQuestionOrder[priorityIndex] + priorityIndex++ + + if (TimeQuestionTypes.remove(candidate)) { + return candidate + } + } + + val chosen = TimeQuestionTypes.random() + TimeQuestionTypes.remove(chosen) + return chosen +} + +fun resetTimeQuestions() { + TimeQuestionTypes = mutableListOf( + TimeQuestionType.CURRENT_TIME, + TimeQuestionType.TODAY_DATE, + TimeQuestionType.TOMORROW_DATE, + TimeQuestionType.CURRENT_MONTH, + TimeQuestionType.TODAY_WEEKDAY, + TimeQuestionType.DAY_PERIOD + ) + priorityIndex = 0 +} + +private fun correctAnswerFor(question: TimeQuestionType): String = when (question) { + TimeQuestionType.CURRENT_TIME -> DateTimeChecker.CorrectCurrentTime() + TimeQuestionType.TODAY_DATE -> DateTimeChecker.CorrectTodayDate() + TimeQuestionType.TOMORROW_DATE -> DateTimeChecker.CorrectTomorrowDate() + TimeQuestionType.CURRENT_MONTH -> DateTimeChecker.CorrectCurrentMonth() + TimeQuestionType.TODAY_WEEKDAY -> DateTimeChecker.CorrectTodayWeekday() + TimeQuestionType.DAY_PERIOD -> DateTimeChecker.CorrectCurrentDayPeriod() +} + +// pre treti nespravny pokus +fun FlowControlRunner.finalWrongAnswer() { + val correct = correctAnswerFor(currentTimeQuestionType) + + SessionLogger.log( + game = "time", + phase = "resolved", + question = currentTimeQuestionType.name, + attempt = wrongAttempts, + result = "final_fail", + correctAnswer = correct, + userAnswer = "", + hintUsed = hintUsedForCurrentQuestion + ) + + lastWrongAttemptsForQuestion = wrongAttempts + wrongAttempts = 0 + + when (currentTimeQuestionType) { + TimeQuestionType.CURRENT_TIME -> { + happyShake() + furhat.say( + "Dali ste nesprávnu odpoveď, ale nič sa nedeje! " + + "Správna odpoveď by bola, že je teraz $correct." + ) + delay(1000) + } + + TimeQuestionType.TODAY_DATE -> { + happyShake() + furhat.say( + "Nevyšlo Vám to, ale vôbec to neprekáža. " + + "Správna odpoveď by bola, že dnes je $correct. " + + "Teraz si to pamätáte!" + ) + delay(1000) + } + + TimeQuestionType.TOMORROW_DATE -> { + empathy() + furhat.say( + "Vyzerá to, že je to dnes náročné, ale to je v poriadku " + + "Správna odpoveď by bola, že zajtra bude $correct. " + ) + furhat.say("Teraz si to pamätáte!") + delay(1000) + } + + TimeQuestionType.CURRENT_MONTH -> { + empathy() + furhat.say( + "Nechajte to tak, dnes je to náročné. " + + "Správna odpoveď by bola, že je teraz mesiac $correct. " + ) + delay(1000) + } + + TimeQuestionType.TODAY_WEEKDAY -> { + calm() + furhat.say( + "Tentoraz to nevyšlo, ale nevadí. " + + "Správna odpoveď by bola: $correct." + ) + delay(1000) + } + + TimeQuestionType.DAY_PERIOD -> { + happyShake() + furhat.say( + "Dali ste nesprávnu odpoveď, ale nič sa nedeje! " + + "Správna odpoveď by bola, že je teraz $correct." + ) + delay(1000) + } + } + + goto(TimeTrainingSuccess) +} + +//-------------------------------------------------------------- +// Pomocne premenne +//-------------------------------------------------------------- + +var currentTimeQuestionType: TimeQuestionType = TimeQuestionType.CURRENT_TIME +var questionsSinceLastCheck = 0 +var questionText: String = "" + +var wrongAttempts = 0 +var lastWrongAttemptsForQuestion = 0 + +var hintUsedForCurrentQuestion: Boolean = false + +var lastDayPeriod: String = "" + +//============================================================== +// Proces hry +//============================================================== + +// Intro +val TimeTrainingIntro: State = state(Parent) { + onEntry { + wrongAttempts = 0 + smallTalkUsed = 0 + questionsSinceLastCheck = 0 + resetTimeQuestions() //ранее не было + hintUsedForCurrentQuestion = false + + currentTimeQuestionType = pickRandomTimeQuestionType() + goto(AskTime) + } +} + +// AskTime: otazky a reakcia na vysledok +val AskTime: State = state(Parent) { + onEntry { + questionText = when (currentTimeQuestionType) { + TimeQuestionType.CURRENT_TIME -> "Môžete mi, prosím, povedať, koľko je teraz hodín?" + TimeQuestionType.TODAY_DATE -> "Viete mi povedať, aký je dnes dátum?" + TimeQuestionType.TOMORROW_DATE -> "Aký dátum bude zajtra?" + TimeQuestionType.CURRENT_MONTH -> "Viete, aký je práve mesiac?" + TimeQuestionType.TODAY_WEEKDAY -> "Aký je dnes deň v týždni?" + TimeQuestionType.DAY_PERIOD -> "Povedzte, prosím, aká je teraz približne denná doba?" + } + askRepeatable(questionText) + + SessionLogger.log( + game = "time", + phase = "question_shown", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = "asked", + correctAnswer = correctAnswerFor(currentTimeQuestionType), + userAnswer = "", + hintUsed = hintUsedForCurrentQuestion + ) + } + + onResponse { + + SessionLogger.log( + game = "time", + phase = "answer", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = "dont_know", + correctAnswer = correctAnswerFor(currentTimeQuestionType), + userAnswer = it.text ?: "", + hintUsed = hintUsedForCurrentQuestion + ) + + furhat.say(pendingFileStatusMessage()) + + empathy() + furhat.say("Rozumiem, to je v poriadku.") + + // este nebola napoveda + if (!hintUsedForCurrentQuestion) { + if (wrongAttempts < 2) wrongAttempts = 2 + goto(TimeHintOffer) + return@onResponse + } + + wrongAttempts = 3 + finalWrongAnswer() + } + + onResponse { + handleRephrase(it.intent) + } + + onResponse { + + SessionLogger.log( + game = "time", + phase = "event", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = "help_requested", + correctAnswer = correctAnswerFor(currentTimeQuestionType), + userAnswer = it.text ?: "", + hintUsed = hintUsedForCurrentQuestion + ) + + if (!hintUsedForCurrentQuestion) { + veryHappy() + furhat.say("Samozrejme, pomôžem Vám! Dajte mi chvíľu, prosím") + if (wrongAttempts < 2) wrongAttempts = 2 + goto(TimeHint) + return@onResponse + } + + empathy() + furhat.say("Prepáčte, už som Vám dala nápovedu.") + delay(700) + + littleSad() + furhat.say("Je mi ľúto, že Vám nepomohla. Skúste odpovedať podľa toho, čo si pamätáte.") + + val questionText = when (currentTimeQuestionType) { + TimeQuestionType.CURRENT_TIME -> + "Môžete mi ešte raz povedať, koľko je teraz približne hodín?" + + TimeQuestionType.TODAY_DATE -> + "Skúste mi ešte raz povedať, aký je dnes dátum." + + TimeQuestionType.TOMORROW_DATE -> + "Skúste mi ešte raz povedať, aký dátum bude zajtra." + + TimeQuestionType.CURRENT_MONTH -> + "Skúste mi, prosím, ešte raz povedať, aký je teraz mesiac." + + TimeQuestionType.TODAY_WEEKDAY -> + "Skúste mi ešte raz povedať, aký je dnes deň v týždni." + + TimeQuestionType.DAY_PERIOD -> + "Skúste mi, prosím, ešte raz povedať, či je teraz ráno, deň alebo večer." + } + + askRepeatable(questionText) + } + + onResponse { + if (handleStop(it.intent, + "time", + currentTimeQuestionType.name, + it.text ?: "")) + { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onResponse + } + } + + onResponse{ + if (handleRepeat( + it.intent, + "time", + currentTimeQuestionType.name, + correctAnswerFor(currentTimeQuestionType), + it.text ?: "", + hintUsedForCurrentQuestion)) + { + return@onResponse + } + } + + onResponse { + val text = it.text ?: "" + + when (currentTimeQuestionType) { + TimeQuestionType.CURRENT_TIME -> { + val success = DateTimeChecker.isCorrectCurrentTime(text) + val correct = correctAnswerFor(currentTimeQuestionType) + + SessionLogger.log( + game = "time", + phase = "answer", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = if (success) "success" else "fail", + correctAnswer = correct, + userAnswer = text, + hintUsed = hintUsedForCurrentQuestion + ) + + if (success) { + lastWrongAttemptsForQuestion = wrongAttempts + wrongAttempts = 0 + veryHappy() + furhat.say("Správne! Povedali ste aktuálny čas. ") + goto(smallTalkManagerTime(currentTimeQuestionType)) + } else { + wrongAttempts++ + when (wrongAttempts) { + 1 -> { + littleSad() + furhat.say( + "Nezdá sa, že to bol aktuálny čas. " + + "Skúste ho povedať napríklad ako „je päť hodín“ alebo „je 5:00“." + ) + delay(700) + reentry() + } + + 2 -> { +// val correct = correctAnswerFor(currentTimeQuestionType) + explainWhyWrong( + question = questionText, + correctAnswer = correct, + userAnswer = text, + attempt = wrongAttempts + ) + goto(TimeHintOffer) + } + + else -> { + finalWrongAnswer() + } + } + } + +// if (DateTimeChecker.isCorrectCurrentTime(text)) { +// lastWrongAttemptsForQuestion = wrongAttempts +// wrongAttempts = 0 +// veryHappy() +// furhat.say("Správne! Povedali ste aktuálny čas. ") +// goto(smallTalkManagerTime(currentTimeQuestionType)) +// } else { +// wrongAttempts++ +// when (wrongAttempts) { +// 1 -> { +// littleSad() +// furhat.say( +// "Nezdá sa, že to bol aktuálny čas. " + +// "Skúste ho povedať napríklad ako „je päť hodín“ alebo „je 5:00“." +// ) +// delay(700) +// reentry() +// } +// +// 2 -> { +//// val correct = correctAnswerFor(currentTimeQuestionType) +// explainWhyWrong( +// question = questionText, +// correctAnswer = correct, +// userAnswer = text, +// attempt = wrongAttempts +// ) +// goto(TimeHintOffer) +// } +// +// else -> { +// finalWrongAnswer() +// } +// } +// } + } + + TimeQuestionType.TODAY_DATE -> { + val success = DateTimeChecker.isCorrectTodayDate(text) + val correct = correctAnswerFor(currentTimeQuestionType) + + SessionLogger.log( + game = "time", + phase = "answer", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = if (success) "success" else "fail", + correctAnswer = correct, + userAnswer = text, + hintUsed = hintUsedForCurrentQuestion + ) + + if (success) { + lastWrongAttemptsForQuestion = wrongAttempts + wrongAttempts = 0 + veryHappy() + furhat.say("Správne, dnes je takýto dátum.") + goto(smallTalkManagerTime(currentTimeQuestionType)) + } else { + wrongAttempts++ + when (wrongAttempts) { + 1 -> { + littleSad() + furhat.say( + "Zdá sa, že to nie je dnešný dátum. " + + "Skúste ho povedať ešte raz, napríklad \"dnes je dvadsiatý decembr\"." + ) + delay(700) + reentry() + } + 2 -> { + val correct = correctAnswerFor(currentTimeQuestionType) + explainWhyWrong( + question = questionText, + correctAnswer = correct, + userAnswer = text, + attempt = wrongAttempts + ) + goto(TimeHintOffer) + } + else -> { + finalWrongAnswer() + } + } + } + } + + TimeQuestionType.TOMORROW_DATE -> { + val success = DateTimeChecker.isCorrectTomorrowDate(text) + val correct = correctAnswerFor(currentTimeQuestionType) + + SessionLogger.log( + game = "time", + phase = "answer", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = if (success) "success" else "fail", + correctAnswer = correct, + userAnswer = text, + hintUsed = hintUsedForCurrentQuestion + ) + + if (success) { + lastWrongAttemptsForQuestion = wrongAttempts + wrongAttempts = 0 + veryHappy() + furhat.say("Správne! To je zajtrajší dátum.") + goto(smallTalkManagerTime(currentTimeQuestionType)) + } else { + wrongAttempts++ + when (wrongAttempts) { + 1 -> { + littleSad() + furhat.say( + "Nie som si istá, že to je zajtrajší dátum. " + + "Skúste ho povedať ešte raz." + ) + delay(700) + reentry() + } + 2 -> { + val correct = correctAnswerFor(currentTimeQuestionType) + explainWhyWrong( + question = questionText, + correctAnswer = correct, + userAnswer = text, + attempt = wrongAttempts + ) + goto(TimeHintOffer) + } + else -> { + finalWrongAnswer() + } + } + } + } + + TimeQuestionType.CURRENT_MONTH -> { + val success = DateTimeChecker.isCorrectCurrentMonth(text) + val correct = correctAnswerFor(currentTimeQuestionType) + + SessionLogger.log( + game = "time", + phase = "answer", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = if (success) "success" else "fail", + correctAnswer = correct, + userAnswer = text, + hintUsed = hintUsedForCurrentQuestion + ) + + if (success) { + lastWrongAttemptsForQuestion = wrongAttempts + wrongAttempts = 0 + veryHappy() + furhat.say("Správne, je to aktuálny mesiac.") + goto(smallTalkManagerTime(currentTimeQuestionType)) + } else { + wrongAttempts++ + when (wrongAttempts) { + 1 -> { + littleSad() + furhat.say( + "Nezdá sa, že to bol aktuálny mesiac. " + + "Skúste ho povedať ešte raz." + ) + delay(700) + reentry() + } + 2 -> { + val correct = correctAnswerFor(currentTimeQuestionType) + explainWhyWrong( + question = questionText, + correctAnswer = correct, + userAnswer = text, + attempt = wrongAttempts + ) + goto(TimeHintOffer) + } + else -> { + finalWrongAnswer() + } + } + } + } + + TimeQuestionType.TODAY_WEEKDAY -> { + val success = DateTimeChecker.isCorrectTodayWeekday(text) + val correct = correctAnswerFor(currentTimeQuestionType) + + SessionLogger.log( + game = "time", + phase = "answer", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = if (success) "success" else "fail", + correctAnswer = correct, + userAnswer = text, + hintUsed = hintUsedForCurrentQuestion + ) + + if (success) { + lastWrongAttemptsForQuestion = wrongAttempts + wrongAttempts = 0 + veryHappy() + furhat.say("Správne! Povedali ste dnešný deň v týždni.") + goto(smallTalkManagerTime(currentTimeQuestionType)) + } else { + wrongAttempts++ + when (wrongAttempts) { + 1 -> { + littleSad() + furhat.say( + "Nezdá sa, že to bol správny deň v týždni. " + + "Skúste to povedať inak." + ) + delay(700) + reentry() + } + 2 -> { + val correct = correctAnswerFor(currentTimeQuestionType) + explainWhyWrong( + question = questionText, + correctAnswer = correct, + userAnswer = text, + attempt = wrongAttempts + ) + goto(TimeHintOffer) + } + else -> { + finalWrongAnswer() + } + } + } + } + + TimeQuestionType.DAY_PERIOD -> { + val success = DateTimeChecker.isCorrectCurrentDayPeriod(text) + val correct = correctAnswerFor(currentTimeQuestionType) + + SessionLogger.log( + game = "time", + phase = "answer", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = if (success) "success" else "fail", + correctAnswer = correct, + userAnswer = text, + hintUsed = hintUsedForCurrentQuestion + ) + + if (success) { + lastWrongAttemptsForQuestion = wrongAttempts + wrongAttempts = 0 + veryHappy() + furhat.say("Správne! Povedali ste dnešný deň v týždni.") + goto(smallTalkManagerTime(currentTimeQuestionType)) + } else { + wrongAttempts++ + + when (wrongAttempts) { + 1 -> { + littleSad() + furhat.say( + "Nie som si istá, že to sedí s aktuálnou dennou dobou. " + + "Skúste povedať, či je teraz skôr ráno, deň alebo večer." + ) + delay(700) + reentry() + } + + 2 -> { + val correct = correctAnswerFor(currentTimeQuestionType) + explainWhyWrong( + question = questionText, + correctAnswer = correct, + userAnswer = text, + attempt = wrongAttempts + ) + goto(TimeHintOffer) + } + + else -> { + finalWrongAnswer() + } + } + } + } + } + } + + onNoResponse { + SessionLogger.log( + game = "time", + phase = "answer", + question = currentTimeQuestionType.name, + attempt = wrongAttempts + 1, + result = "no_response", + correctAnswer = correctAnswerFor(currentTimeQuestionType), + userAnswer = "", + hintUsed = hintUsedForCurrentQuestion + ) + + when { + wrongAttempts < 2 -> { + wrongAttempts = 2 + goto(TimeHintOffer) + } + + // napoveda uz bola -> znova nespravny pokus -> hovori odpoved' + else -> { + val correct = correctAnswerFor(currentTimeQuestionType) + + lastWrongAttemptsForQuestion = 3 + wrongAttempts = 0 + + empathy() + furhat.say( + "Zdá sa, že je to teraz pre Vás náročné, ale to je v poriadku. " + + "Správna odpoveď na otázku je $correct." + ) + delay(1000) + goto(TimeTrainingSuccess) + } + } + } + +} + +val TimeTrainingSuccess: State = state(Parent) { + onEntry { + when (lastWrongAttemptsForQuestion) { + 1 -> { + veryHappy() + furhat.say("Vy ste šikovný!") + delay(1000) + } + 2 -> { + calm() + furhat.say("Aj keď Vám to zabralo čas, zvládli ste to dobre.") + delay(1000) + } + 3 -> { + empathy() + furhat.say("Nezvladli ste to, ale to je v pohode. Teraz je to pre Vás náročné, ale nezúfajte, časom si to osvojíte.") + delay(1000) + } + + else -> { + veryHappy() + furhat.say("Zvládli ste to veľmi dobre.") + } + } + + if (TimeQuestionTypes.isEmpty()) { + calm() + furhat.say("Týmto sme ukončili hru s časom.") + veryHappy() + furhat.say("Ďakujem, bolo to výborné.") + delay(1000) + + TrainingMenuFlags.allTimeQuestionsCompleted = true + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + } + + questionsSinceLastCheck++ + + val continueOffer = questionsSinceLastCheck >= 2 + + if (continueOffer) { + val wantsToContinue = call(AskToContinue()) as Boolean + if (!wantsToContinue) { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onEntry + } + questionsSinceLastCheck = 0 + } + wrongAttempts = 0 + hintUsedForCurrentQuestion = false + + currentTimeQuestionType = pickRandomTimeQuestionType() + goto(AskTime) + } +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/say_time/STT.kt b/src/main/kotlin/furhatos/app/blank/flow/main/say_time/STT.kt new file mode 100644 index 0000000..0fbb256 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/say_time/STT.kt @@ -0,0 +1,158 @@ +package furhatos.app.blank.flow.main.supporting + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.StartQuestion +import furhatos.app.blank.flow.main.handlers.Goodbye +import furhatos.app.blank.flow.main.handlers.askRepeatable +import furhatos.app.blank.flow.main.handlers.handleRepeat +import furhatos.app.blank.flow.main.handlers.handleRephrase +import furhatos.app.blank.flow.main.handlers.handleStop +import furhatos.app.blank.flow.main.say_time.DateTimeChecker +import furhatos.app.blank.flow.main.say_time.DayPeriod +import furhatos.app.blank.flow.main.say_time.TimeTrainingSuccess +import furhatos.app.blank.flow.main.say_time.currentTimeQuestionType +import furhatos.app.blank.flow.main.say_time.lastDayPeriod +import furhatos.app.blank.flow.main.supporting.general.TrainingMenuFlags +import furhatos.flow.kotlin.* +import furhatos.app.blank.nlu.base_answer.Ano +import furhatos.app.blank.nlu.base_answer.Nie +import furhatos.app.blank.nlu.base_answer.Rephrase +import furhatos.app.blank.nlu.base_answer.StopTraining + +val DayPeriodSmallTalk: State = state(Parent) { + + onEntry { + val question4 = when (lastDayPeriod.lowercase()) { + "ráno" -> "Povedali ste, že je teraz ráno. Na dobré ráno patria chutné raňajky – už ste raňajkovali?" + "deň" -> "Povedali ste, že je teraz deň. Počas dňa sa zíde mať plán – máte dnes niečo naplánované?" + else-> "Povedali ste, že je teraz večer. Večer je dobrý na oddych – už ste si dnes trochu oddýchli?" + } + + askRepeatable(question4) + } + + onResponse { + furhat.say("To je výborne. Pokračujme ďalej.") + goto(TimeTrainingSuccess) + } + + onResponse { + furhat.say("To nevadí. Dôležité je, že sa snažíte. Pokračujme ďalej.") + goto(TimeTrainingSuccess) + } + + onResponse { + handleRephrase(it.intent) + } + + onResponse { + if (handleStop(it.intent, + "time", + currentTimeQuestionType.name, + it.text ?: "")) + { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onResponse + } + } + + onResponse { + if (handleStop(it.intent, "time", "small_talk", it.text ?: "")){ + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onResponse + } +// if (handleRepeat(it.intent)){ +// return@onResponse +// } + + furhat.ask("Prepáčte, stačí povedať áno alebo nie.") + } +} + +// -------------------- CURRENT TIME -------------------- + +val CurrentTimeSmallTalk: State = SmallTalk { + val period = DateTimeChecker.currentDayPeriod() + val questionHodiny = when (period) { + DayPeriod.MORNING -> "Ešte je ráno, máte celý deň pred sebou. Máte dnes ešte niečo, čo chcete stihnúť?" + DayPeriod.DAY -> "Je ešte deň. Máte dnes ešte niečo, čo chcete stihnúť?" + DayPeriod.EVENING -> "Už je večer. Máte ešte dnes niečo, čo by ste chceli stihnúť?" + } + + listOf( + "Ste skôr ranný typ, alebo nočná sova?", + questionHodiny + ).random() +} + +// -------------------- TODAY DATE -------------------- + +val TodayDateSmallTalk: State = SmallTalk { + listOf( + "Máte dnes nejakú drobnosť, na ktorú sa tešíte?", + "Viete si spomenúť, či je dnes niečí sviatok alebo meniny vo vašom okolí?", + "Máte radšej začiatok mesiaca, alebo jeho koniec?" + ).random() +} + +// -------------------- TOMORROW DATE -------------------- + +val TomorrowDateSmallTalk: State = SmallTalk { + listOf( + "Máte zajtra niečo naplánované?", + "Tešíte sa viac na zajtrajšok, alebo ste spokojní s dneškom?", + "Zajtra je nový deň — chcete si zajtra niečo dopriať alebo urobiť inak?", + "Čo by vám zajtra urobilo radosť, aj keby to bola maličkosť?" + ).random() +} + +// -------------------- CURRENT MONTH -------------------- + +val CurrentMonthSmallTalk: State = SmallTalk { + listOf( + "Čím si ho najviac spájate — počasím, sviatkami, alebo niečím iným?", + "Máte v tomto mesiaci niečo, na čo sa radi pripravujete?", + "Viete, čo máte na tomto mesiaci najradšej?", + "Je tento mesiac pre vás skôr pokojný, alebo máte veľa povinností?" + ).random() +} + +//------------------------------ +private fun weekdayInPhrase(day: String): String = when (day.lowercase()) { + "pondelok" -> "v pondelok" + "utorok" -> "v utorok" + "streda" -> "v stredu" + "štvrtok" -> "vo štvrtok" + "piatok" -> "v piatok" + "sobota" -> "v sobotu" + "nedeľa", "nedela" -> "v nedeľu" + else -> "dnes" +} + +val WeekdaySmallTalk: State = SmallTalk { + val day = DateTimeChecker.CorrectTodayWeekday() + val dayLc = day.lowercase() + val dayPrep = weekdayInPhrase(day) + + val daySpecific = when (dayLc) { + "pondelok" -> "Povedali ste, že je dnes pondelok. Pondelok je často štart týždňa – máte chuť začať deň pomalšie, alebo hneď naplno?" + "utorok" -> "Povedali ste, že je dnes utorok. Utorok býva taký pracovný rozbeh – máte dnes niečo, čo chcete vybaviť?" + "streda" -> "Povedali ste, že je dnes streda. Streda je polovica týždňa – máte pocit, že týždeň ide rýchlo, alebo pomaly?" + "štvrtok" -> "Povedali ste, že je dnes štvrtok. Už sa blíži víkend – tešíte sa na niečo v najbližších dňoch?" + "piatok" -> "Povedali ste, že je dnes piatok. Piatok znie príjemne – plánujete si dnes dopriať trochu oddychu?" + "sobota" -> "Povedali ste, že je dnes sobota. Sobota je často na oddych – máte dnes niečo príjemné v pláne?" + "nedeľa", "nedela" -> "Povedali ste, že je dnes nedeľa. Nedeľa býva pokojná – ako najradšej trávite nedeľu?" + else -> "Ďakujem. A aký máte dnes deň?" + } + + val universal = listOf( + "Je pre vás $day skôr \"pracovný\" alebo \"oddychový\"?", + "Máte $dayPrep nejaký malý zvyk alebo rutinu?", + "Chcete si dnes radšej naplánovať niečo, alebo nechať deň plynúť voľne?", + "Keby ste si mali vybrať jednu vec na dnes, čo by to bolo?" + ) + + listOf(daySpecific, universal.random()).random() +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/say_time/TimeCompare.kt b/src/main/kotlin/furhatos/app/blank/flow/main/say_time/TimeCompare.kt new file mode 100644 index 0000000..9e695e7 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/say_time/TimeCompare.kt @@ -0,0 +1,358 @@ +package furhatos.app.blank.flow.main.say_time + +import java.time.* +import java.time.format.DateTimeFormatter + +enum class TimeQuestionType { + CURRENT_TIME, + TODAY_DATE, + TOMORROW_DATE, + CURRENT_MONTH, + TODAY_WEEKDAY, + DAY_PERIOD +} + +enum class DayPeriod { + MORNING, + DAY, + EVENING +} + + +object DateTimeChecker { + + private fun now(): LocalDateTime = LocalDateTime.now() + + // ---------- 'slovo -> cislo' pre mesiac a hodiny ---------- + + private val NUMBER_WORDS = mapOf( + "nula" to 0, "nultý" to 0, + "jeden" to 1, "jedna" to 1, "jedno" to 1, "prvý" to 1, "prvá" to 1, + "dva" to 2, "dve" to 2, "druhý" to 2, "druhá" to 2, + "tri" to 3, "tretí" to 3, "tretia" to 3, + "štyri" to 4, "styri" to 4, "štvrtý" to 4, "štvrtá" to 4, + "päť" to 5, "pat" to 5, "piaty" to 5, "piata" to 5, + "šesť" to 6, "sest" to 6, "šiesty" to 6, "šiesta" to 6, + "sedem" to 7, "siedmy" to 7, "siedma" to 7, + "osem" to 8, "ôsmy" to 8, "ôsma" to 8, + "deväť" to 9, "devat" to 9, "deviaty" to 9, "deviatá" to 9, + + "desať" to 10, "desat" to 10, "desiaty" to 10, "desiatá" to 10, + "jedenásť" to 11, "jedenast" to 11, "jedenásty" to 11, "jedenásta" to 11, + "dvanásť" to 12, "dvanast" to 12, "dvanásty" to 12, "dvanásta" to 12, + "trinásť" to 13, "trinast" to 13, "trinásty" to 13, "trinásta" to 13, + "štrnásť" to 14, "strnast" to 14, "štrnact" to 14, "štrnásty" to 14, "štrnásta" to 14, + "pätnásť" to 15, "patnast" to 15, "pätnásty" to 15, "pätnásta" to 15, + "šestnásť" to 16, "sestnast" to 16, "šestnásty" to 16, "šestnásta" to 16, + "sedemnásť" to 17, "sedemnast" to 17, "sedemnásty" to 17, "sedemnástá" to 17, + "osemnásť" to 18, "osemnast" to 18, "osemnásty" to 18, "osemnásta" to 18, + "devätnásť" to 19, "devatnast" to 19, "devätnásty" to 19, "devätnásta" to 19, + + "dvadsať" to 20, "dvadsat" to 20, "dvadsiatá" to 20, + "dvadsaťjeden" to 21, "dvadsať jedna" to 21, "dvadsiaty prvý" to 21, "dvadsiať prvá" to 21, + "dvadsaťdva" to 22, "dvadsať dva" to 22, "dvadsiaty druhý" to 22, "dvadsiať druhá" to 22, + "dvadsaťtri" to 23, "dvadsať tri" to 23, "dvadsiaty tretí" to 23, "dvadsiať treťa" to 23 + ) + + private fun numberFromWord(raw: String): Int? { + val cleaned = raw + .trim('.', ',', ';') + .lowercase() + return NUMBER_WORDS[cleaned] + } + + // -------------- HODINY ---------------------------------- + fun parseClockTime(text: String): LocalTime? { + val regex = Regex("""\b(\d{1,2})[ ](\d{1,2})\b""") + val match = regex.find(text) ?: return null + + val (hStr, mStr) = match.destructured + val hour = hStr.toIntOrNull() ?: return null + val minute = mStr.toIntOrNull() ?: return null + + if (hour !in 0..23 || minute !in 0..59) return null + + return LocalTime.of(hour, minute) + } + // -------------- HODINY (len cas ) ---------------------------------- + private fun parseHour(text: String): Int? { + + val digitRegex = Regex("""\b(\d{1,2})\b""") + val digitMatch = digitRegex.find(text) + val hDigit = digitMatch?.groupValues?.get(1)?.toIntOrNull() + if (hDigit != null && hDigit in 0..23) { + return hDigit + } + + val wordRegex = Regex("""\b([\p{L}]+)\b""") + for (m in wordRegex.findAll(text.lowercase())) { + val word = m.groupValues[1] + val num = numberFromWord(word) ?: continue + if (num in 0..23) { + return num + } + } + + return null + } + + fun isCorrectCurrentTime( + text: String, + toleranceMinutes: Long = 10, + hourToleranceHours: Int = 1 // допуск по часам для "примерного" ответа + ): Boolean { + val nowTime = now().toLocalTime() + + // ak presny cas + val detailed = parseClockTime(text) + if (detailed != null) { + val diffMin = Duration.between(detailed, nowTime).abs().toMinutes() + return diffMin <= toleranceMinutes + } + + // ak len hodina + val hourOnly = parseHour(text) ?: return false + val diffHours = kotlin.math.abs(hourOnly - nowTime.hour) + return diffHours <= hourToleranceHours + } + + // -------------- DATUM ---------------------------- + private val MONTH_WORDS = mapOf( + "januar" to 1, "január" to 1, "januara" to 1, "januára" to 1, + "februar" to 2, "február" to 2, "februara" to 2, "februára" to 2, + "marec" to 3, "marca" to 3, + "april" to 4, "apríl" to 4, "aprila" to 4, "apríla" to 4, + "maj" to 5, "máj" to 5, "maja" to 5, "mája" to 5, + "jun" to 6, "jún" to 6, "juna" to 6, "júna" to 6, + "jul" to 7, "júl" to 7, "jula" to 7, "júla" to 7, + "august" to 8, "augusta" to 8, + "september" to 9, "septembra" to 9, + "oktober" to 10, "október" to 10, "oktobra" to 10, "októbra" to 10, + "november" to 11, "novembra" to 11, + "december" to 12, "decembra" to 12 + ) + + private fun monthFromWord(raw: String): Int? { + val cleaned = raw + .trim('.', ',', ';') + .lowercase() + return MONTH_WORDS[cleaned] + } + + private fun findAllNumbers(text: String): List { + val regex = Regex("""\b(\d{1,2})\b""") + return regex.findAll(text) + .mapNotNull { it.groupValues[1].toIntOrNull() } + .toList() + } + + fun parseDay(text: String): Int? { + val nums = findAllNumbers(text) + val digitDay = nums.firstOrNull { it in 1..31 } + if (digitDay != null) return digitDay + + // nie su cisla + val wordRegex = Regex("""\b([\p{L}]+)\b""") + for (m in wordRegex.findAll(text.lowercase())) { + val word = m.groupValues[1] + val num = numberFromWord(word) ?: continue + if (num in 1..31) { + return num + } + } + + return null + } + + fun parseMonth(text: String): Int? { + val normalized = text.lowercase() + + // standartne nazvy + val wordRegex = Regex("""\b([\p{L}]+)\b""") + for (m in wordRegex.findAll(normalized)) { + val word = m.groupValues[1] + val month = monthFromWord(word) + if (month != null) return month + } + + // cisla + val ordinalMonthRegex = Regex("""\b([\p{L}]+)\s+mesiac\w*\b""") + val ordMatch = ordinalMonthRegex.find(normalized) + if (ordMatch != null) { + val ordinalWord = ordMatch.groupValues[1] + val num = numberFromWord(ordinalWord) + if (num != null && num in 1..12) return num + } + + val nums = findAllNumbers(text) + if (nums.size >= 2) { + val month = nums[1] + if (month in 1..12) return month + } + val single = nums.firstOrNull { it in 1..12 } + return single + } + + // Dnesny datum -------------------- + fun isCorrectTodayDate(text: String): Boolean { + val today = LocalDate.now() + val day = parseDay(text) ?: return false + val month = parseMonth(text) + + return if (month == null) { + // пользователь сказал только число + day == today.dayOfMonth + } else { + // пользователь сказал и число, и месяц + day == today.dayOfMonth && month == today.monthValue + } + } + + // Zajtra --------------------------------------------------- + fun isCorrectTomorrowDate(text: String): Boolean { + val tomorrow = LocalDate.now().plusDays(1) + val day = parseDay(text) ?: return false + val month = parseMonth(text) + + return if (month == null) { + day == tomorrow.dayOfMonth + } else { + day == tomorrow.dayOfMonth && month == tomorrow.monthValue + } + } + + // Mesiac ----------------------------------------- + fun isCorrectCurrentMonth(text: String): Boolean { + val today = LocalDate.now() + val month = parseMonth(text) ?: return false + return month == today.monthValue + } + + // ---------- DEN TYZDN'A ---------- + + private val WEEKDAY_WORDS = mapOf( + "pondelok" to DayOfWeek.MONDAY, "pondelka" to DayOfWeek.MONDAY, + "utorok" to DayOfWeek.TUESDAY, "utorka" to DayOfWeek.TUESDAY, + "streda" to DayOfWeek.WEDNESDAY, "stredu" to DayOfWeek.WEDNESDAY, + "štvrtok" to DayOfWeek.THURSDAY, "stvrtok" to DayOfWeek.THURSDAY, + "štvrtka" to DayOfWeek.THURSDAY, "stvrtka" to DayOfWeek.THURSDAY, + "piatok" to DayOfWeek.FRIDAY, "piatka" to DayOfWeek.FRIDAY, + "sobota" to DayOfWeek.SATURDAY, "sobotu" to DayOfWeek.SATURDAY, + "nedeľa" to DayOfWeek.SUNDAY, "nedela" to DayOfWeek.SUNDAY, "nedeľu" to DayOfWeek.SUNDAY, "nedelu" to DayOfWeek.SUNDAY + ) + + private fun weekdayFromWord(raw: String): DayOfWeek? { + val cleaned = raw + .trim('.', ',', ';') + .lowercase() + return WEEKDAY_WORDS[cleaned] + } + + fun parseWeekday(text: String): DayOfWeek? { + val normalized = text.lowercase() + val wordRegex = Regex("""\b([\p{L}]+)\b""") + for (m in wordRegex.findAll(normalized)) { + val word = m.groupValues[1] + val weekday = weekdayFromWord(word) + if (weekday != null) return weekday + } + return null + } + + fun isCorrectTodayWeekday(text: String): Boolean { + val today = LocalDate.now() + val weekday = parseWeekday(text) ?: return false + + return weekday == today.dayOfWeek + } + + // ---------- DOBA ---------- + fun currentDayPeriod(): DayPeriod { + val t = now().toLocalTime() + return when { + t.hour in 5..11 -> DayPeriod.MORNING + t.hour in 12..17 -> DayPeriod.DAY + else -> DayPeriod.EVENING + } + } + + private fun parseDayPeriod(text: String): DayPeriod? { + val normalized = text.lowercase() + // ráno + if (Regex("""\b(ráno|rano|doobeda|dopoludnie)\b""").containsMatchIn(normalized)) + return DayPeriod.MORNING + // deň + if (Regex("""\b(deň|den|obed|na obed|poobede|popoludnie)\b""").containsMatchIn(normalized)) + return DayPeriod.DAY + // večer + if (Regex("""\b(večer|vecer|podvečer|podvecer)\b""").containsMatchIn(normalized)) + return DayPeriod.EVENING + return null + } + + /** Проверка: правильно ли пользователь назвал текущую "dennú dobu" (ráno / deň / večer). */ + fun isCorrectCurrentDayPeriod(text: String): Boolean { + val userPeriod = parseDayPeriod(text) ?: return false + val nowPeriod = currentDayPeriod() + return userPeriod == nowPeriod + } + + // ---------- format pre robota ---------- + + private val MONTHS_NOMINATIVE = listOf( + "január", "február", "marec", "apríl", "máj", "jún", + "júl", "august", "september", "október", "november", "december" + ) + +// private val MONTHS_GENITIVE = listOf( +// "januára", "februára", "marca", "apríla", "mája", "júna", +// "júla", "augusta", "septembra", "októbra", "novembra", "decembra" +// ) + + private val WEEKDAYS = mapOf( + DayOfWeek.MONDAY to "pondelok", + DayOfWeek.TUESDAY to "utorok", + DayOfWeek.WEDNESDAY to "streda", + DayOfWeek.THURSDAY to "štvrtok", + DayOfWeek.FRIDAY to "piatok", + DayOfWeek.SATURDAY to "sobota", + DayOfWeek.SUNDAY to "nedeľa" + ) + + // hodiny + fun CorrectCurrentTime(): String { + val t = now().toLocalTime() + return t.format(DateTimeFormatter.ofPattern("HH:mm")) + } + + // dnes + fun CorrectTodayDate(): String = formatDate(LocalDate.now()) + + // zajtra + fun CorrectTomorrowDate(): String = formatDate(LocalDate.now().plusDays(1)) + + // mesiac + fun CorrectCurrentMonth(): String { + val m = LocalDate.now().monthValue + return MONTHS_NOMINATIVE[m - 1] + } + + // dan tyzdna + fun CorrectTodayWeekday(): String { + val d = LocalDate.now() + val wd = WEEKDAYS[d.dayOfWeek] ?: d.dayOfWeek.name.lowercase() + return "$wd" + } + + // doba + fun CorrectCurrentDayPeriod(): String = when (currentDayPeriod()) { + DayPeriod.MORNING -> "ráno" + DayPeriod.DAY -> "deň" + DayPeriod.EVENING -> "večer" + } + + private fun formatDate(d: LocalDate): String { + val monthGen = MONTHS_NOMINATIVE[d.monthValue - 1] + return "${d.dayOfMonth}. $monthGen" + } +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/say_time/TimeHint.kt b/src/main/kotlin/furhatos/app/blank/flow/main/say_time/TimeHint.kt new file mode 100644 index 0000000..ad3f199 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/say_time/TimeHint.kt @@ -0,0 +1,363 @@ +package furhatos.app.blank.flow.main.say_time + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.supporting.HintOffer +import furhatos.app.blank.flow.main.supporting.calm +import furhatos.app.blank.flow.main.supporting.general.callProxyRespond +import furhatos.app.blank.flow.main.supporting.general.isProxyAvailable +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.furhat +import furhatos.flow.kotlin.state +import java.time.LocalDate +import java.time.LocalTime +import java.time.DayOfWeek +import java.time.YearMonth + +//-------- Hours ------------ +private fun hourQuarter(minute: Int): String = when (minute) { + in 0..14 -> "prvej" + in 15..29 -> "druhej" + in 30..44 -> "tretej" + else -> "štvrtej" +} +//------- Date --------- + +private data class DateData( + val monthName: String, + val lastDay: Int, // 28/29/30/31 + val rangeStart: Int, + val rangeEnd: Int, + val section: String // opis pra napovedu +) + +private fun getDateData(date: LocalDate): DateData { + val lastDay = YearMonth.of(date.year, date.month).lengthOfMonth() + val day = date.dayOfMonth + + val (start, end, label) = when { + day <= 9 -> Triple(1, minOf(9, lastDay), "začiatok mesiaca") + day <= 19 -> Triple(10, minOf(19, lastDay), "desiate dni mesiaca") + day <= 26 -> Triple(20, minOf(26, lastDay), "dvadsiate dni mesiaca") + else -> Triple(27, lastDay, "koniec mesiaca") + } + + return DateData( + monthName = MonthNominative(date.monthValue), + lastDay = lastDay, + rangeStart = start, + rangeEnd = end, + section = label + ) +} + +//---------------------- + +private fun MonthNominative(m: Int): String = when (m) { + 1 -> "január" + 2 -> "február" + 3 -> "marec" + 4 -> "apríl" + 5 -> "máj" + 6 -> "jún" + 7 -> "júl" + 8 -> "august" + 9 -> "september" + 10 -> "október" + 11 -> "november" + else -> "december" +} + +//--------- den tyzdna ---------- +private fun weekdays(d: java.time.DayOfWeek): String = when (d) { + java.time.DayOfWeek.MONDAY -> "pondelok" + java.time.DayOfWeek.TUESDAY -> "utorok" + java.time.DayOfWeek.WEDNESDAY -> "streda" + java.time.DayOfWeek.THURSDAY -> "štvrtok" + java.time.DayOfWeek.FRIDAY -> "piatok" + java.time.DayOfWeek.SATURDAY -> "sobota" + java.time.DayOfWeek.SUNDAY -> "nedeľa" +} + +private fun weekdayIndex(d: java.time.DayOfWeek): Int = when (d) { + java.time.DayOfWeek.MONDAY -> 1 + java.time.DayOfWeek.TUESDAY -> 2 + java.time.DayOfWeek.WEDNESDAY -> 3 + java.time.DayOfWeek.THURSDAY -> 4 + java.time.DayOfWeek.FRIDAY -> 5 + java.time.DayOfWeek.SATURDAY -> 6 + java.time.DayOfWeek.SUNDAY -> 7 +} +private fun weekdayNumber(n: Int): String = when (n) { + 1 -> "prvý" + 2 -> "druhý" + 3 -> "tretí" + 4 -> "štvrtý" + 5 -> "piaty" + 6 -> "šiesty" + else -> "siedmy" +} + +private fun prevDay(d: DayOfWeek): DayOfWeek = + if (d == DayOfWeek.MONDAY) DayOfWeek.SUNDAY else DayOfWeek.of(d.value - 1) + +private fun nextDay(d: DayOfWeek): DayOfWeek = + if (d == DayOfWeek.SUNDAY) DayOfWeek.MONDAY else DayOfWeek.of(d.value + 1) + +private fun weekSection(idx: Int): String = when (idx) { + 1, 2 -> "začiatok týždňa" + 3, 4 -> "stred týždňa" + else -> "koniec týždňa" +} + +//----------- Mesiac ------------ +private data class SeasonMonth( + val season: String, + val n: Int +) + +private fun seasonMonth(month: Int): SeasonMonth = when (month) { + 12 -> SeasonMonth("zimy", 1) + 1 -> SeasonMonth("zimy", 2) + 2 -> SeasonMonth("zimy", 3) + + 3 -> SeasonMonth("jari", 1) + 4 -> SeasonMonth("jari", 2) + 5 -> SeasonMonth("jari", 3) + + 6 -> SeasonMonth("leta", 1) + 7 -> SeasonMonth("leta", 2) + 8 -> SeasonMonth("leta", 3) + + 9 -> SeasonMonth("jesene", 1) + 10 -> SeasonMonth("jesene", 2) + else -> SeasonMonth("jesene", 3) +} + +private fun seasonNumber(n: Int): String = when (n) { + 1 -> "prvý" + 2 -> "druhý" + else -> "tretí" +} + +private fun season(month: Int): String = when (month) { + 12, 1, 2 -> "Teraz je zima." + 3, 4, 5 -> "Teraz je jar." + 6, 7, 8 -> "Teraz je leto." + else -> "Teraz je jeseň." +} + +private fun buildHintContext(type: TimeQuestionType, baseHint: String): Map { + val ctx = mutableMapOf( + "task" to "hint", + "language" to "sk", + "question_type" to type.name, + "base_hint" to baseHint, + "rules" to mapOf( + "do_not_reveal_exact_answer" to true, + "max_sentences" to 2, + "keep_game_rules" to true + ) + ) + + // Если у тебя есть lastQuestionText (мы добавляли для explain_wrong) — раскомментируй: + // ctx["question"] = lastQuestionText + + when (type) { + TimeQuestionType.CURRENT_TIME -> { + val now = LocalTime.now() + val h = now.hour + val next = (h + 1) % 24 + ctx["hour_from"] = if (h == 0) "0" else h.toString() + ctx["hour_to"] = if (next == 0) "0" else next.toString() + ctx["minute_hint"] = hourQuarter(now.minute) + ctx["suggested_formats"] = listOf("je päť hodín", "5:00", "okolo piatej") + } + + TimeQuestionType.TODAY_DATE -> { + val d = getDateData(LocalDate.now()) + ctx["expected_format"] = "DD.MM.YYYY" + ctx["range_start"] = d.rangeStart + ctx["range_end"] = d.rangeEnd + ctx["section"] = d.section + ctx["month_name"] = d.monthName + ctx["year"] = LocalDate.now().year + } + + TimeQuestionType.TOMORROW_DATE -> { + val today = LocalDate.now() + val tomorrow = today.plusDays(1) + val d = getDateData(tomorrow) + val isNewMonth = tomorrow.dayOfMonth == 1 || tomorrow.month != today.month + + ctx["expected_format"] = "DD.MM.YYYY" + ctx["rule"] = "Zajtra je o jeden deň neskôr ako dnes." + ctx["is_new_month"] = isNewMonth + ctx["month_name"] = d.monthName + ctx["range_start"] = d.rangeStart + ctx["range_end"] = d.rangeEnd + ctx["section"] = d.section + ctx["year"] = tomorrow.year + } + + TimeQuestionType.CURRENT_MONTH -> { + val month = LocalDate.now().monthValue + val info = seasonMonth(month) + ctx["answer_kind"] = "month_name" + ctx["season"] = info.season + ctx["month_in_season"] = info.n + ctx["allowed_hints"] = listOf("season", "month_number_without_name", "first_letter") + } + + TimeQuestionType.TODAY_WEEKDAY -> { + val today = LocalDate.now() + val wd = today.dayOfWeek + val i = weekdayIndex(wd) + + ctx["answer_kind"] = "weekday_name" + ctx["weekday_index"] = i + ctx["week_section"] = weekSection(i) + ctx["yesterday"] = weekdays(prevDay(wd)) + ctx["tomorrow"] = weekdays(nextDay(wd)) + ctx["allowed_hints"] = listOf("weekday_or_weekend", "order_in_week_without_name") + } + + TimeQuestionType.DAY_PERIOD -> { + ctx["options"] = listOf("ráno", "deň", "večer") + ctx["rough_ranges"] = mapOf( + "ráno" to "5–11", + "deň" to "12–17", + "večer" to "18–23" + ) + } + } + + return ctx +} + +//---------------------------------------------------------------- + +val TimeHintOffer: State by lazy { + HintOffer(nextState = TimeHint, exitState = AskTime) +} + +val TimeHint = state(Parent) { + onEntry { + hintUsedForCurrentQuestion = true + val baseHint = when (currentTimeQuestionType) { + + TimeQuestionType.CURRENT_TIME -> { + val now = LocalTime.now() + val h = now.hour + val next = (h + 1) % 24 + val quarter = hourQuarter(now.minute) + + val hourFrom = if (h == 0) "0" else h.toString() + val hourTo = if (next == 0) "0" else next.toString() + + val hints = listOf( + "Malá nápoveda: je to medzi $hourFrom a $hourTo hodinou.", + "Dobre! Tu je moja nápoveda: teraz je čas niekde medzi $hourFrom a $hourTo hodinou, skôr v $quarter časti tejto hodiny.", + "Skúste odhad: je to medzi $hourFrom a $hourTo hodinou. A minúty sú približne v $quarter časti hodiny." + ) + + calm() + hints.random() + } + + TimeQuestionType.TODAY_DATE -> { + val d = getDateData(LocalDate.now()) + + val hints = listOf( + "Pomôcka: dnešné číslo je medzi ${d.rangeStart} a ${d.rangeEnd}", + "Teraz je ${d.section}, teda číslo je medzi ${d.rangeStart} a ${d.rangeEnd}." + ) + + calm() + hints.random() + } + + TimeQuestionType.TOMORROW_DATE -> { + val today = LocalDate.now() + val tomorrow = today.plusDays(1) + val d = getDateData(tomorrow) + + val isNewMonth = tomorrow.dayOfMonth == 1 || tomorrow.month != today.month + + val hints = mutableListOf() + + if (!isNewMonth) { + hints += "Malá nápoveda: zajtra bude stále v mesiaci ${d.monthName}." + } + if (isNewMonth) { + hints += "Malá nápoveda: zajtra už bude v mesiaci ${d.monthName}." + } + + hints += "Zajtra spadá do časti ${d.section}. Skúste číslo medzi ${d.rangeStart} a ${d.rangeEnd}." + hints += "Dobre! Tu je moja nápoveda: číslo zajtrajšieho dňa je medzi ${d.rangeStart} a ${d.rangeEnd}" + + calm() + hints.random() + } + + TimeQuestionType.CURRENT_MONTH -> { + + + val month = LocalDate.now().monthValue + val info = seasonMonth(month) + val number = seasonNumber(info.n) + + val hints = listOf( + "Malá nápoveda: teraz je $number mesiac ${info.season}. Pamätáte si, ktorý mesiac to je?", + "Dobre! Tu je moja nápoveda: sme v $number mesiaci ${info.season}.", + "Fajn! Skúsme to takto: ${season(month)}, čiže ide o $number mesiac ${info.season}. Ktorý mesiac to môže byť?", + ) + + calm() + hints.random() + } + + TimeQuestionType.TODAY_WEEKDAY -> { + val today = LocalDate.now() + val wd = today.dayOfWeek + + val i = weekdayIndex(today.dayOfWeek) + val n = weekdayNumber(i) + + val yesterdayWd = weekdays(prevDay(wd)) + val tomorrowWd = weekdays(nextDay(wd)) + + val section = weekSection(i) + + val hints = listOf( + "Fajn! Moja malá nápoveda: dnes je $n deň v týždni.", + "Tak teda, moja nápoveda: v týždni je to $n deň (počítame od pondelka).", + "Včera bol $yesterdayWd a zajtra bude $tomorrowWd. Aký deň je potom dnes?", + "Teraz je $section. Skúste si spomenúť, aký to je konkrétny deň." + ) + + calm() + hints.random() + } + + TimeQuestionType.DAY_PERIOD -> { + calm() + "Fajn! Malá pomôcka: ráno je približne päť až jedenásť, deň dvanásť až sedemnásť a večer osemnásť až dvadsaťtri. Čo z toho je teraz najbližšie?" + } + } + + val ctx = buildHintContext(currentTimeQuestionType, baseHint) + + val gptHint = if (isProxyAvailable()) { + callProxyRespond( + userText = "HINT_REQUEST", + task = "hint", + context = ctx + ) + } else null + + val finalHint = if (!gptHint.isNullOrBlank()) gptHint else baseHint + furhat.say(finalHint) + + goto(AskTime) + } +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/AskToContinue.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/AskToContinue.kt new file mode 100644 index 0000000..bd7f919 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/AskToContinue.kt @@ -0,0 +1,35 @@ +package furhatos.app.blank.flow.main.supporting + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.nlu.base_answer.Ano +import furhatos.app.blank.nlu.base_answer.Nie +import furhatos.flow.kotlin.* + +fun AskToContinue() = state(Parent) { + + onEntry { + furhat.ask( + "Chcete pokračovať hrať alebo by ste chceli skončiť?" + ) + } + + onResponse { + veryHappy() + furhat.say("Výborne, budeme pokračovať.") + delay(700) + terminate(true) + } + + onResponse { + empathy() + furhat.say("Rozumiem, nebudeme pokračovať hráť v tuto hru.") + delay(700) + terminate(false) + } + + onResponse { + furhat.say("Prepáčte, nerozumel som. Odpovedzte prosím chcete pokračovať alebo nechcete.") + delay(700) + reentry() + } +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/CheckCondition.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/CheckCondition.kt new file mode 100644 index 0000000..562422f --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/CheckCondition.kt @@ -0,0 +1,106 @@ +package furhatos.app.blank.flow.main.supporting +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.StartQuestion +import furhatos.app.blank.flow.main.handlers.Goodbye +import furhatos.app.blank.flow.main.handlers.handleRepeat +import furhatos.app.blank.flow.main.handlers.handleRephrase +import furhatos.app.blank.flow.main.handlers.handleStop +import furhatos.app.blank.flow.main.supporting.general.TrainingMenuFlags +import furhatos.flow.kotlin.* +import furhatos.app.blank.nlu.other_responses.FeelGood +import furhatos.app.blank.nlu.other_responses.FeelBad +import furhatos.app.blank.nlu.base_answer.Ano +import furhatos.app.blank.nlu.base_answer.Nie + + +val CheckCondition: State = state(Parent) { + + onEntry { + TrainingMenuFlags.resetAll() + + furhat.ask { + random { + +"Ako sa máte?" + +"Ako sa dnes cítite?" + +"Ako sa vám dnes darí?" + +"Máte sa dobre?" + +"Ako sa cítite práve teraz?" + +"Ako sa cítite po dnešku?" + +"Je vám dnes dobre?" + } + } + } + + onResponse { + veryHappy() + furhat.say("Som rád, že sa cítite dobre.") + delay(1000) + goto(ReadyToTrain(StartQuestion, Goodbye)) + } + + + onResponse { + empathy() + furhat.say( + "Rozumiem, nechcem vás dnes zaťažovať. " + + "Dnes je lepšie odpočívať." + ) + goto(Goodbye) + } + + onResponse { + happyNod() + furhat.say("Ďakujem za odpoveď. Môžme skusíť si napriek tomu krátku hru.") + goto(StartQuestion) + } +} + +fun ReadyToTrain(nextState: State, exitState: State): State = state(Parent) { + + fun prompt(): String { + return if (TrainingMenuFlags.allExercisesCompleted()) + "Dnes sme už už odohrali všetky hry. Chcete si niektoré zopakovať?" + else if (TrainingMenuFlags.hasTrainedOnce) + "Chcete si zahrať inú hru?" + else + "Chcete si zahrať hru?" + } + + onEntry { + furhat.ask(prompt()) + } + + onReentry { + furhat.ask(prompt()) + } + + onResponse { + veryHappy() + furhat.say("Výborne, tak poďme na to.") + delay(1000) + goto(nextState) + } + + onResponse { + empathy() + furhat.say("Rozumiem, môžeme to skúsiť inokedy.") + goto(exitState) + } + + onResponse { + if (handleRephrase(it.intent)){ + return@onResponse + } +// if (handleRepeat(it.intent)){ +// return@onResponse +// } + if (handleStop(it.intent, "system", "check_condition", it.text ?: "")){ + goto(Goodbye) + return@onResponse + } + + furhat.say("Prepáčte, nerozumela som.") + reentry() + } +} + diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/Difficulty.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/Difficulty.kt new file mode 100644 index 0000000..0f70b42 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/Difficulty.kt @@ -0,0 +1,37 @@ +package furhatos.app.blank.flow.main.supporting + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.nlu.base_answer.Ano +import furhatos.app.blank.nlu.base_answer.Nie +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.furhat +import furhatos.flow.kotlin.onResponse +import furhatos.flow.kotlin.state + +val AskIncreaseDifficulty: State = state(Parent) { + onEntry { + furhat.ask("Chcete, aby som povedal viac slov?") + } + + onResponse { terminate(true) } + onResponse { terminate(false) } + + onResponse { + furhat.say("Prepáčte, odpovedzte prosím áno alebo nie.") + reentry() + } +} + +val AskDecreaseDifficulty: State = state(Parent) { + onEntry { + furhat.ask("Chcete sa vrátiť na predchádzajúcu, ľahšiu úroveň náročnosti?") + } + + onResponse { terminate(true) } + onResponse { terminate(false) } + + onResponse { + furhat.say("Prepáčte, odpovedzte prosím áno alebo nie.") + reentry() + } +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/HintOffer.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/HintOffer.kt new file mode 100644 index 0000000..39fbf45 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/HintOffer.kt @@ -0,0 +1,44 @@ +package furhatos.app.blank.flow.main.supporting +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.Idle +import furhatos.app.blank.flow.main.handlers.handleRepeat +import furhatos.app.blank.flow.main.handlers.handleStop +import furhatos.flow.kotlin.* +import furhatos.app.blank.nlu.base_answer.Ano +import furhatos.app.blank.nlu.base_answer.Nie +import furhatos.gestures.Gestures + + +fun HintOffer(nextState: State, exitState: State): State = state(Parent) { + onEntry { + calm() + furhat.ask { + random { + +"Chcete malú nápovedu?" + +"Pomôže Vám malá nápoveda?" + +"Možno by som mala Vám dať nápovedu?" + } + } + } + + onResponse { + calm() + goto(nextState) + } + + onResponse { + empathy() + furhat.say("Dobre! Tak potom jednoducho budeme pokračovať.") + goto(exitState) + } + + onResponse { + furhat.say { + random { + +"Stačí povedať áno alebo nie." + +"Prosím, povedzte áno alebo nie." + } + } + reentry() + } +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/Reactions.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/Reactions.kt new file mode 100644 index 0000000..d45e4b8 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/Reactions.kt @@ -0,0 +1,73 @@ +package furhatos.app.blank.flow.main.supporting + +import furhatos.flow.kotlin.FlowControlRunner +import furhatos.flow.kotlin.furhat +import furhatos.gestures.BasicParams +import furhatos.gestures.Gesture +import furhatos.gestures.Gestures +import furhatos.gestures.defineGesture + +fun FlowControlRunner.happyNod(async: Boolean = true) { + furhat.gesture(Gestures.Smile, async = async) + furhat.gesture(Gestures.Nod, async = async) +} + +fun FlowControlRunner.happyShake(async: Boolean = true) { + furhat.gesture(Gestures.Shake, async = async) + furhat.gesture(Gestures.Smile, async = async) +} + +val LittleSadHeadDown: Gesture = defineGesture("LittleSadHeadDown") { + frame(0.25) { + BasicParams.NECK_TILT to 2.0 + } + frame(0.55) { + BasicParams.NECK_TILT to 5.0 + } + frame(0.9, 2.0) { + BasicParams.NECK_TILT to 9.0 + } + + // плавное возвращение + frame(2.35) { + BasicParams.NECK_TILT to 5.0 + } + frame(2.65) { + BasicParams.NECK_TILT to 1.0 + } + reset(3.0) +} +fun FlowControlRunner.littleSad(async: Boolean = true) { + // грустная эмоция + furhat.gesture(Gestures.ExpressSad(strength = 0.4, duration = 0.8), async = true) + + // лёгкий наклон головы вниз примерно на 2 секунды + furhat.gesture(LittleSadHeadDown, async = async) +} + +fun FlowControlRunner.empathy(async: Boolean = true) { + furhat.gesture(Gestures.CloseEyes, async = false) + furhat.gesture(Gestures.Nod, async = async) + delay(700) + furhat.gesture(Gestures.OpenEyes, async = false) +} + +fun FlowControlRunner.calm(async: Boolean = true) { + furhat.gesture(Gestures.Smile, async = async) + furhat.gesture(Gestures.Blink, async = async) +} + +fun FlowControlRunner.veryHappy(async: Boolean = true) { + furhat.gesture(Gestures.BigSmile, async = async) + furhat.gesture(Gestures.BrowRaise, async = async) +} + +val SmileIdle: Gesture = defineGesture("SmileIdle") { + frame(0.2, persist = true) { + BasicParams.SMILE_CLOSED to 0.70 + BasicParams.BROW_UP_LEFT to 0.05 + BasicParams.BROW_UP_RIGHT to 0.05 + } +} + + diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/SmallTalk.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/SmallTalk.kt new file mode 100644 index 0000000..a383df7 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/SmallTalk.kt @@ -0,0 +1,75 @@ +package furhatos.app.blank.flow.main.supporting + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.StartQuestion +import furhatos.app.blank.flow.main.handlers.Goodbye +import furhatos.app.blank.flow.main.handlers.askRepeatable +import furhatos.app.blank.flow.main.handlers.handleRepeat +import furhatos.app.blank.flow.main.handlers.handleRephrase +import furhatos.app.blank.flow.main.handlers.handleStop +import furhatos.app.blank.flow.main.say_time.TimeTrainingSuccess +import furhatos.app.blank.flow.main.supporting.general.TrainingMenuFlags +import furhatos.app.blank.nlu.base_answer.Ano +import furhatos.app.blank.nlu.base_answer.Rephrase +import furhatos.flow.kotlin.* + +fun neutralAck(): String = listOf( + "Rozumiem, ďakujem.", + "Rozumiem. Vážim si, že ste mi to povedali.", + "Ďakujem, že ste mi to povedali.", + "Je dobre, že o tom môžeme hovoriť.", + "Ďakujem, že ste mi venovali čas a porozprávali mi o tom.", + "Dobre, vnímam to. Ďakujem, že ste sa otvorili.", + "Ďakujem za vaše slová.", +).random() + +fun positiveAck(): String = listOf( + "To ma veľmi teší.", + "To je príjemné počuť.", + "Som rada, že to takto vnímate.", + "To znie naozaj dobre.", + "Teší ma, že sa vám darí.", + "To je skvelé, ďakujem, že ste sa podelili.", +).random() + +//private fun negativeAck(): String = listOf( +// "To ma mrzí.", +// "Je mi ľúto, že to takto dopadlo.", +// "Chápem. Musí to byť náročné.", +// "Mrzí ma to počuť. Verím, že sa situácia postupne zlepší.", +//).random() + +fun SmallTalk(nextState: State, question: () -> String): State = state(Parent) { + onEntry { + askRepeatable(question()) + } + + onResponse { + happyNod() + furhat.say(positiveAck()) + delay(1000) + goto(nextState) + } + + onResponse { + handleRephrase(it.intent) + } + + onResponse { +// if (handleRepeat(it.intent)) { +// return@onResponse +// } + if (handleStop(it.intent, "system", "small_talk", it.text ?: "")) { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onResponse + } + + happyNod() + furhat.say(neutralAck()) + delay(1000) + goto(nextState) + } +} + +fun SmallTalk(question: () -> String): State = SmallTalk(TimeTrainingSuccess, question) diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/WrongAnswer.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/WrongAnswer.kt new file mode 100644 index 0000000..e9bf5f6 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/WrongAnswer.kt @@ -0,0 +1,52 @@ +package furhatos.app.blank.flow.main.supporting + +import furhatos.app.blank.flow.main.supporting.general.callProxyRespond +import furhatos.app.blank.flow.main.supporting.general.isProxyAvailable +import furhatos.flow.kotlin.FlowControlRunner +import furhatos.flow.kotlin.furhat + +fun FlowControlRunner.sayPhraseForWrongAnswer() { + littleSad() + furhat.say { + random { + +"Nie celkom, ale nevadí. " + +"Tentoraz to ešte nesedí. " + +"Ešte to nie je správne. " + +"Nie úplne, ale sme blízko. " + +"Ešte sa netrafili, ale je to v poriadku. " + +"Zatiaľ to nesedí. " + +"Nie je to správne, no vôbec to neprekáža. " + +"Bohužiaľ, opäť je to nesprávne. Ale nič sa nedeje!" + } + } +} + +fun FlowControlRunner.explainWhyWrong( + question: String, + correctAnswer: String, + userAnswer: String, + attempt: Int +) { + if (attempt >= 2) { + sayPhraseForWrongAnswer() + + val ctx = mapOf( + "question" to question, + "correct_answer" to correctAnswer, + "user_answer" to userAnswer, + "attempt" to attempt + ) + + val gptText = if (isProxyAvailable()){ + callProxyRespond( + userText = userAnswer, + task = "explain_wrong", + context = ctx + ) + } else null + + if (!gptText.isNullOrBlank()) { + furhat.say(gptText) + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/ProxyClient.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/ProxyClient.kt new file mode 100644 index 0000000..8df800b --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/ProxyClient.kt @@ -0,0 +1,181 @@ +package furhatos.app.blank.flow.main.supporting.general + +import java.net.HttpURLConnection +import java.net.URL +import java.time.Instant + + // IP PC, where is running FastAPI-proxy. +private const val PROXY_URL = "http://127.0.0.1:8000" + +val PROXY_BASE_URL: String = + System.getenv("PROXY_BASE_URL") + ?.takeIf { it.isNotBlank() } + ?: System.getProperty("proxy.baseUrl") + ?.takeIf { it.isNotBlank() } + ?: PROXY_URL + + +fun isProxyAvailable(): Boolean { + return try { + val url = URL("$PROXY_BASE_URL/test") + val conn = (url.openConnection() as HttpURLConnection).apply { + requestMethod = "GET" + setRequestProperty("Accept", "application/json") + connectTimeout = 500 + readTimeout = 500 + } + + val code = conn.responseCode + code in 200..299 + } catch (e: Exception) { + false + } +} + +fun callProxyRespond( + userText: String, + task: String, + context: Map = emptyMap() +): String? { + val url = URL("$PROXY_BASE_URL/respond") + val conn = (url.openConnection() as HttpURLConnection).apply { + requestMethod = "POST" + setRequestProperty("Content-Type", "application/json; charset=UTF-8") + setRequestProperty("Accept", "application/json") + connectTimeout = 4000 + readTimeout = 4000 + doOutput = true + } + + val safeText = jsonEscape(userText) + val safeTask = jsonEscape(task) + val ctxJson = mapToJson(context) + + // context вставляем как JSON-объект, а не строкой + val body = """{"user_text":"$safeText","task":"$safeTask","context":$ctxJson}""" + + return try { + conn.outputStream.use { it.write(body.toByteArray(Charsets.UTF_8)) } + + val code = conn.responseCode + val stream = if (code in 200..299) conn.inputStream else conn.errorStream + val raw = stream?.bufferedReader(Charsets.UTF_8)?.use { it.readText() } + + println("Proxy respond: $PROXY_BASE_URL/respond -> HTTP $code") + println("Proxy raw response: $raw") + + if (code !in 200..299 || raw.isNullOrBlank()) { + return null + } + + // Простой парсинг поля "answer" + val match = Regex("\"answer\"\\s*:\\s*\"(.*?)\"").find(raw) ?: return null + match.groupValues[1] + .replace("\\n", "\n") + .replace("\\\"", "\"") + .replace("\\\\", "\\") + } catch (e: Exception) { + println("Proxy request failed: ${e.message}") + null + } finally { + conn.disconnect() + } +} + +private fun jsonEscape(s: String): String = + s.replace("\\", "\\\\") + .replace("\"", "\\\"") + .replace("\n", "\\n") + .replace("\r", "\\r") + .replace("\t", "\\t") + +private fun valueToJson(v: Any?): String = when (v) { + null -> "null" + is String -> "\"${jsonEscape(v)}\"" + is Number, is Boolean -> v.toString() + is Map<*, *> -> mapToJson(v.entries.associate { it.key.toString() to it.value }) + is List<*> -> v.joinToString(prefix = "[", postfix = "]") { valueToJson(it) } + else -> "\"${jsonEscape(v.toString())}\"" +} + +private fun mapToJson(map: Map): String = + map.entries.joinToString(prefix = "{", postfix = "}") { (k, v) -> + "\"${jsonEscape(k)}\":${valueToJson(v)}" + } + +fun sendLogEvent( + createdAt: String, + sessionId: String, + game: String, + phase: String, + question: String, + attempt: Int, + result: String, + userAnswer: String? = null, + correctAnswer: String? = null, + hintUsed: Boolean = false, +): Boolean { + val url = URL("$PROXY_BASE_URL/log") + val conn = (url.openConnection() as HttpURLConnection).apply { + requestMethod = "POST" + setRequestProperty("Content-Type", "application/json") + connectTimeout = 700 + readTimeout = 1000 + doOutput = true + } + + val payload = mapOf( + "session_id" to sessionId, + "game" to game, + "phase" to phase, + "question" to question, + "attempt" to attempt, + "result" to result, + "user_answer" to userAnswer, + "correct_answer" to correctAnswer, + "hint_used" to hintUsed, + "created_at" to createdAt + ) + + val body = mapToJson(payload) + + return try { + conn.outputStream.use { it.write(body.toByteArray(Charsets.UTF_8)) } + + val code = conn.responseCode + println("Proxy log: $PROXY_BASE_URL/log -> HTTP $code") + + code in 200..299 + } catch (e: Exception) { + println("LOG SEND ERROR: ${e.message}") + false + } finally { + conn.disconnect() + } +} + +fun sendLogJsonLine(jsonLine: String): Boolean { + val url = URL("$PROXY_BASE_URL/log") + val conn = (url.openConnection() as HttpURLConnection).apply { + requestMethod = "POST" + setRequestProperty("Content-Type", "application/json; charset=UTF-8") + setRequestProperty("Accept", "application/json") + connectTimeout = 600 + readTimeout = 900 + doOutput = true + } + + return try { + conn.outputStream.use { it.write(jsonLine.toByteArray(Charsets.UTF_8)) } + + val code = conn.responseCode + println("sendLogJsonLine -> HTTP $code") + + code in 200..299 + } catch (e: Exception) { + println("sendLogJsonLine ERROR: ${e.message}") + false + } finally { + conn.disconnect() + } +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/SessionState.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/SessionState.kt new file mode 100644 index 0000000..7851838 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/SessionState.kt @@ -0,0 +1,18 @@ +package furhatos.app.blank.flow.main.supporting.general + +object TrainingMenuFlags { + var hasTrainedOnce: Boolean = false + + var allTimeQuestionsCompleted: Boolean = false + var allAttentionQuestionsCompleted: Boolean = false + var allMemoryQuestionsCompleted: Boolean = false + + fun resetAll() { + allTimeQuestionsCompleted = false + allAttentionQuestionsCompleted = false + allMemoryQuestionsCompleted = false + } + + fun allExercisesCompleted(): Boolean = + allTimeQuestionsCompleted && allAttentionQuestionsCompleted && allMemoryQuestionsCompleted +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/SmallTalkProxy.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/SmallTalkProxy.kt new file mode 100644 index 0000000..4480220 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/SmallTalkProxy.kt @@ -0,0 +1,128 @@ +package furhatos.app.blank.flow.main.supporting.general + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.StartQuestion +import furhatos.app.blank.flow.main.handlers.Goodbye +import furhatos.app.blank.flow.main.handlers.askRepeatable +import furhatos.app.blank.flow.main.handlers.handleRepeat +import furhatos.app.blank.flow.main.handlers.handleRephrase +import furhatos.app.blank.flow.main.handlers.handleStop +import furhatos.app.blank.flow.main.handlers.lastPhrase +import furhatos.app.blank.flow.main.supporting.ReadyToTrain +import furhatos.app.blank.flow.main.supporting.empathy +import furhatos.app.blank.flow.main.supporting.neutralAck +import furhatos.app.blank.flow.main.supporting.veryHappy +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.furhat +import furhatos.flow.kotlin.onNoResponse +import furhatos.flow.kotlin.onResponse +import furhatos.flow.kotlin.state + +data class SmallTalkContext( + val exercise: String, + val topic: String, + val subtopic: String? = null, + val targetWord: String? = null, + val responseMode: String = "open" // open / yes_no +) + +fun requestSmallTalk(context: SmallTalkContext): String { + if (!isProxyAvailable()) { + return "" + } + + return callProxyRespond( + userText = "Vygeneruj small talk otázku", + task = "smalltalk", + context = mapOf( + "exercise" to context.exercise, + "topic" to context.topic, + "subtopic" to context.subtopic, + "target_word" to context.targetWord, + "response_mode" to context.responseMode + ) + ) ?: "" +} + +fun genericSmallTalk( + context: SmallTalkContext, + nextState: State, + fallbackQuestion: String = "Ako sa dnes máte?", + preparedQuestion: String? = null +): State = state(Parent) { + + onEntry { + val generated = preparedQuestion ?: requestSmallTalk(context) + val finalQuestion = if (generated.isNotBlank()) generated else fallbackQuestion + askRepeatable(finalQuestion) + } + + onResponse { + if (handleRephrase(it.intent)) return@onResponse +// if (handleRepeat(it.intent)) return@onResponse + + if (handleStop(it.intent, "time", "small_talk_proxy", it.text ?: "")) { + TrainingMenuFlags.hasTrainedOnce = true + goto(ReadyToTrain(StartQuestion, Goodbye)) + return@onResponse + } + + val reaction = requestSmallTalkReaction( + userAnswer = it.text, + robotQuestion = lastPhrase + ) + + if (reaction != null) { + when (reaction.type) { + "positive" -> veryHappy() + else -> empathy() + } + furhat.say(reaction.text) + } else { + empathy() + furhat.say(neutralAck()) + } + + goto(nextState) + } + + onNoResponse { + goto(nextState) + } +} + +//---------------------------------------------------------- +// Reactions +//---------------------------------------------------------- +data class SmallTalkReaction( + val type: String, + val text: String +) + +fun requestSmallTalkReaction( + userAnswer: String, + robotQuestion: String? +): SmallTalkReaction? { + if (!isProxyAvailable()) { + return null + } + + val raw = callProxyRespond( + userText = userAnswer, + task = "reaction", + context = mapOf( + "question" to robotQuestion, + "user_answer" to userAnswer + ) + ) ?: return null + + val parts = raw.split("||", limit = 2) + if (parts.size < 2) return null + + val type = parts[0].trim().lowercase() + val text = parts[1].trim() + + if (text.isBlank()) return null + + return SmallTalkReaction(type = type, text = text) +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/Test.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/Test.kt new file mode 100644 index 0000000..156432c --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/Test.kt @@ -0,0 +1,12 @@ +package furhatos.app.blank.flow.main.supporting.general + +import furhatos.app.blank.flow.Parent +import furhatos.app.blank.flow.main.supporting.littleSad +import furhatos.flow.kotlin.State +import furhatos.flow.kotlin.state + +val Test: State = state(Parent) { + onEntry { + littleSad() + } +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/Words.kt b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/Words.kt new file mode 100644 index 0000000..0c28092 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/main/supporting/general/Words.kt @@ -0,0 +1,79 @@ +package furhatos.app.blank.flow.main.supporting.general + +import java.io.BufferedReader +import java.io.InputStreamReader +import kotlin.random.Random + +data class WordEntry( + val canonical: String, + val theme: String, + val difficulty: Int, + val variants: Set +) + +object WordBank { + + private const val RESOURCE_PATH = "wordbank.csv" + + val entries: List by lazy { loadCsv(RESOURCE_PATH) } + + fun pickSequence( + length: Int, + allowedThemes: Set? = null, + maxDifficulty: Int? = null, + rng: Random = Random.Default + ): List { + val pool = entries.asSequence() + .filter { allowedThemes == null || it.theme in allowedThemes } + .filter { maxDifficulty == null || it.difficulty <= maxDifficulty } + .distinctBy { it.canonical.lowercase() } + .toList() + + require(pool.size >= length) { + "WordBank: There aren't enough words for the filters. Need to $length, there is ${pool.size}." + } + + return pool.shuffled(rng).take(length) + } + + private fun loadCsv(path: String): List { + val stream = Thread.currentThread().contextClassLoader.getResourceAsStream(path) + ?: error("WordBank: Resource is not found '$path' в src/main/resources") + + BufferedReader(InputStreamReader(stream, Charsets.UTF_8)).use { br -> + return br.lineSequence() + .map { it.trim() } + .filter { it.isNotEmpty() } + .filter { !it.startsWith("#") } + .mapIndexed { idx, line -> + // canonical,theme,difficulty,variants + val parts = line.split(',', limit = 4) + require(parts.size >= 3) { + "WordBank CSV error (line ${idx + 1}): At least 3 fields 'canonical;theme;difficulty'" + } + + val canonical = parts[0].trim() + val theme = parts[1].trim() + val difficulty = parts[2].trim().toIntOrNull() + ?: error("WordBank CSV error (line ${idx + 1}): difficulty is not a number") + + val variantsRaw = parts.getOrNull(3)?.trim().orEmpty() + val variants = variantsRaw + .split('|') + .map { it.trim() } + .filter { it.isNotEmpty() } + .toMutableSet() + + variants.add(canonical) + + WordEntry( + canonical = canonical, + theme = theme, + difficulty = difficulty, + variants = variants + ) + } + .toList() + } + } +} diff --git a/src/main/kotlin/furhatos/app/blank/flow/parent.kt b/src/main/kotlin/furhatos/app/blank/flow/parent.kt new file mode 100644 index 0000000..7cee90e --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/flow/parent.kt @@ -0,0 +1,56 @@ +package furhatos.app.blank.flow + +import furhatos.app.blank.flow.main.handlers.Goodbye +import furhatos.app.blank.flow.main.handlers.lastPhrase +import furhatos.app.blank.flow.main.supporting.SmileIdle +import furhatos.flow.kotlin.* +import furhatos.app.blank.nlu.base_answer.Repeat + +val Parent: State = state { + + onEntry(inherit = true, priority = true) { + furhat.param.noSpeechTimeout = 60_000 + furhat.param.endSilTimeout = 1_000 + furhat.param.maxSpeechTimeout = 120_000 + furhat.gesture(SmileIdle, async = true) + propagate() + } + + onUserEnter(instant = true) { + when { // "it" is the user that entered + furhat.isAttendingUser -> furhat.glance(it) // Glance at new users entering + !furhat.isAttendingUser -> furhat.attend(it) // Attend user if not attending anyone + } + } + + onUserLeave(instant = true) { + when { + !users.hasAny() -> { // last user left + goto(Goodbye) + } + furhat.isAttending(it) -> furhat.attend(users.other) // current user left + !furhat.isAttending(it) -> furhat.glance(it.head.location) // other user left, just glance + } + } + + onResponse { + val phrase = lastPhrase + if (phrase != null) { + furhat.say("Samozrejme, zopakujem. ") + furhat.ask(phrase) + } else { + furhat.say("Momentálne nemám čo zopakovať.") + furhat.listen() + } + } + +// onResponse { +// handleStop(it.intent) +// } + + onNoResponse { + furhat.say("Je v poriadku, môžete si dať čas. Keď budete pripravení, odpovedzte, prosím.") + reentry() + } + +} diff --git a/src/main/kotlin/furhatos/app/blank/main.kt b/src/main/kotlin/furhatos/app/blank/main.kt new file mode 100644 index 0000000..069d819 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/main.kt @@ -0,0 +1,18 @@ +package furhatos.app.blank + +import furhatos.app.blank.flow.Init +import furhatos.flow.kotlin.Flow +import furhatos.skills.Skill + +class BlankSkill : Skill() { + override fun start() { + Flow().run(Init) + } +} + +fun main(args: Array) { + Skill.main(args) +} + + + diff --git a/src/main/kotlin/furhatos/app/blank/nlu/AttentionTraining.kt b/src/main/kotlin/furhatos/app/blank/nlu/AttentionTraining.kt new file mode 100644 index 0000000..c534b91 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/AttentionTraining.kt @@ -0,0 +1,24 @@ +package furhatos.app.blank.nlu + +import furhatos.nlu.Intent +import furhatos.util.Language + +class AttentionTraining : Intent() { + override fun getExamples(lang: Language) = listOf( + "pozornosť", + "trénovať pozornosť", + "chcem trénovať pozornosť", + "chcem si precvičiť pozornosť", + "chcem skúšať pozornosť", + "chcem skúsiť pozornosť", + "chcem otestovať pozornosť", + "otestovať pozornosť", + "skúšať pozornosť", + "test pozornosti", + "trénovať pozornosť teraz", + "poďme na pozornosť", + "ideme na pozornosť", + "chcem test pozornosti", + "chcem precvičiť sústredenie" + ) +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/nlu/MemoryTraining.kt b/src/main/kotlin/furhatos/app/blank/nlu/MemoryTraining.kt new file mode 100644 index 0000000..f110f1e --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/MemoryTraining.kt @@ -0,0 +1,25 @@ +package furhatos.app.blank.nlu + +import furhatos.nlu.Intent +import furhatos.util.Language + +class MemoryTraining : Intent() { + override fun getExamples(lang: Language) = listOf( + "pamäť", + "cvičenie na pamäť", + "pamäťové cvičenie", + "trénovať pamäť", + "precvičiť pamäť", + "chcem trénovať pamäť", + "tréning pamäti", + "skúsme si pamäť", + "chcem skúsiť čas", + "chcem si vyskúšať zapamätanie slov", + "Ideme na pamäťové slová", + "Môžeme začať s pamäťou?", + "Chcem trénovať pamäť so slovami", + "Rád by som si skúsil pamäť", + "Rada by som si skúsila pamäť", + "chcem otestovať pamäť" + ) +} diff --git a/src/main/kotlin/furhatos/app/blank/nlu/TimeTraining.kt b/src/main/kotlin/furhatos/app/blank/nlu/TimeTraining.kt new file mode 100644 index 0000000..fd8caee --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/TimeTraining.kt @@ -0,0 +1,18 @@ +package furhatos.app.blank.nlu + +import furhatos.nlu.Intent +import furhatos.util.Language + +class TimeTraining : Intent() { + override fun getExamples(lang: Language) = listOf( + "orientáciu v čase", + "čas", + "trénovať čas", + "chcem trénovať čas", + "chcem trénovať orientáciu v čase", + "povedať čas", + "chcem skúšať čas", + "chcem skúsiť čas", + "chcem otestovať čas" + ) +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Ano.kt b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Ano.kt new file mode 100644 index 0000000..8e2936f --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Ano.kt @@ -0,0 +1,30 @@ +package furhatos.app.blank.nlu.base_answer + +import furhatos.nlu.Intent +import furhatos.util.Language + +class Ano : Intent() { + override fun getExamples(lang: Language): List = listOf( + "ano", + "áno", + "hej", + "jasné", + "samozrejme", + "určite", + "áno, prosím", + "áno, mám", + "ok", + "pokračujme", + "môžeme pokračovať", + "poďme ďalej", + "áno, prosím", + "áno, môžeme", + "áno, chcem pokračovať", + "chcela by som pokračovať", + "chcel by som pokračovať", + "chcem pokračovať", + "mám rada", + "mám rad" + ) +} + diff --git a/src/main/kotlin/furhatos/app/blank/nlu/base_answer/DontKnow.kt b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/DontKnow.kt new file mode 100644 index 0000000..242ca05 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/DontKnow.kt @@ -0,0 +1,24 @@ +package furhatos.app.blank.nlu.base_answer + +import furhatos.nlu.Intent +import furhatos.util.Language + +class DontKnow: Intent() { + override fun getExamples(lang: Language) = listOf( + "Neviem", + "Neviem to", + "Nie som si istý", + "Nie som si istá", + "Nepamätám si", + "Nemám tušenie.", + "Netuším", + "Vypadlo mi to z hlavy", + "Zabudol som", + "Zabudola som", + "Neviem to povedať", + "Neviem sa rozhodnúť", + "Bez tušenia", + "Je to pre mňa ťažké", + "Neviem si spomenúť" + ) +} diff --git a/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Help.kt b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Help.kt new file mode 100644 index 0000000..f73e4f9 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Help.kt @@ -0,0 +1,19 @@ +package furhatos.app.blank.nlu.base_answer + +import furhatos.nlu.Intent +import furhatos.util.Language + +class Help: Intent() { + override fun getExamples(lang: Language) = listOf( + "Potrebujem pomoc", + "Môžete mi pomôcť?", + "Pomôž mi, prosím", + "Prosím o pomoc", + "Daj mi nápovedu, prosím", + "Nemám tušenie.", + "Netuším", + "chcem nápovedu", + "potrebujem nápovedu", + "daj mi napovedu" + ) +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Nie.kt b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Nie.kt new file mode 100644 index 0000000..3d6ed31 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Nie.kt @@ -0,0 +1,27 @@ +package furhatos.app.blank.nlu.base_answer + +import furhatos.nlu.Intent +import furhatos.util.Language + +class Nie : Intent() { + override fun getExamples(lang: Language): List = listOf( + "nie", + "nie, nemám", + "vôbec nie", + "ani náhodou", + "nie, ďakujem", + "nie, prosím", + "nie, nechcem", + "nechcem pokračovať", + "nechcem ďalej", + "už nechcem", + "stačí", + "to stačí", + "pre dnešok stačí", + "radšej nie", + "asi nie", + "dnes nie", + "môžeme to ukončiť", + "chcem skončiť" + ) +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Repeat.kt b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Repeat.kt new file mode 100644 index 0000000..fb1efcb --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Repeat.kt @@ -0,0 +1,18 @@ +package furhatos.app.blank.nlu.base_answer + +import furhatos.nlu.Intent +import furhatos.util.Language + +class Repeat: Intent() { + override fun getExamples(lang: Language) = listOf( + "môžeš to zopakovať", + "prosím zopakuj", + "môžeš to povedať ešte raz", + "ešte raz prosím", + "nepočul som ťa", + "môžeš zopakovať otázku", + "čo si povedal", + "čo si povedala", + "zopakuj" + ) +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Rephrase.kt b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Rephrase.kt new file mode 100644 index 0000000..55d92a8 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/Rephrase.kt @@ -0,0 +1,23 @@ +package furhatos.app.blank.nlu.base_answer + +import furhatos.nlu.Intent +import furhatos.util.Language + +class Rephrase : Intent() { + override fun getExamples(lang: Language)= listOf( + "nerozumiem", + "povedz to inak", + "môžeš to povedať jednoduchšie", + "povedz to prosím inak", + "preformuluj to prosím", + "ja som tomu nerozumel", + "ja som tomu nerozumela", + "skúste to povedať inak", + "môžeš to vysvetliť jednoduchšie", + "nepochopil som", + "nepochopila som", + "perifrázuj to", + "prefrázuj to", + "povedz to ešte inak" + ) +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/nlu/base_answer/StopTraining.kt b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/StopTraining.kt new file mode 100644 index 0000000..86af312 --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/base_answer/StopTraining.kt @@ -0,0 +1,40 @@ +package furhatos.app.blank.nlu.base_answer + +import furhatos.nlu.Intent +import furhatos.util.Language + +class StopTraining: Intent() { + override fun getExamples(lang: Language) = listOf( + "zastaviť", + "zastav sa", + "zastavme sa", + "zastavme sa prosím", + "stačí", + "dosť", + "koniec", + "ukončiť", + "ukonči to", + "ukonči cvičenie", + "skončiť", + "skončime", + "môžeme prestať", + "prestať", + "chcem prestať", + "chcem skončiť", + "chcem ukončiť cvičenie", + "už nechcem pokračovať", + "nechcem pokračovať", + "nechcem ďalej", + "chcela by som skončiť", + "chcel by som skončiť", + "skončiť", + + // bez diakritiky + "chcem skoncit", + "chcem prestat", + "ukoncit cvicenie", + "nechcem pokracovat", + "chcela by som skoncit", + "chcel by som skoncit" + ) +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/nlu/other_responses/Feeling.kt b/src/main/kotlin/furhatos/app/blank/nlu/other_responses/Feeling.kt new file mode 100644 index 0000000..37f0dea --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/nlu/other_responses/Feeling.kt @@ -0,0 +1,29 @@ +package furhatos.app.blank.nlu.other_responses + +import furhatos.util.Language +import furhatos.nlu.Intent + +class FeelGood : Intent() { + override fun getExamples(lang: Language) = listOf( + "Cítim sa dobre", + "Cítim sa fajn", + "Som v poriadku", + "Je mi dobre", + "Cítim sa výborne", + "dobre", + "super" + ) +} + +class FeelBad : Intent() { + override fun getExamples(lang: Language) = listOf( + "Som unavený", + "Som unavená", + "Cítim sa unavene", + "Necítim sa dobre", + "Je mi zle", + "Nie veľmi dobré", + "zle", + "hrozne" + ) +} \ No newline at end of file diff --git a/src/main/kotlin/furhatos/app/blank/setting/interactionParams.kt b/src/main/kotlin/furhatos/app/blank/setting/interactionParams.kt new file mode 100644 index 0000000..1deeb2b --- /dev/null +++ b/src/main/kotlin/furhatos/app/blank/setting/interactionParams.kt @@ -0,0 +1,5 @@ +package furhatos.app.blank.setting + +/** Engagement parameters */ +const val MAX_NUMBER_OF_USERS = 2 // Max amount of people that Furhat will recognize as users simultaneously +const val DISTANCE_TO_ENGAGE = 1.0 // Min distance for people to be recognised as users \ No newline at end of file diff --git a/src/main/realtime/main.py b/src/main/realtime/main.py new file mode 100644 index 0000000..4a51095 --- /dev/null +++ b/src/main/realtime/main.py @@ -0,0 +1,290 @@ +import os +import asyncio +from typing import Optional, Dict, Any + +from fastapi import FastAPI, HTTPException +from pydantic import BaseModel, Field + +from openai import AsyncOpenAI + +import pymysql +from datetime import datetime + +from dotenv import load_dotenv +load_dotenv() + +# ----------------------------- +# Config +# ----------------------------- +OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") +if not OPENAI_API_KEY: + # Лучше падать сразу, чтобы не ловить странные ошибки позже + raise RuntimeError("Environment variable OPENAI_API_KEY is not set.") + +# Вы можете поменять на нужную realtime-модель +REALTIME_MODEL = os.getenv("REALTIME_MODEL", "gpt-realtime") + +BASE_INSTRUCTIONS = os.getenv( + "REALTIME_INSTRUCTIONS", + # Эти инструкции НЕ должны дублировать весь ваш сценарий из Kotlin. + # Это только общий стиль/ограничения. + ( + "Si sociálny robot, ktorý pomáha ľuďom s kognitívno-komunikačnými problémami pomocou krátkych hier a dialógov. " + "Vždy odpovedaj po slovensky. " + "Odpovedaj veľmi stručne v rozsahu 1–2 viet, priateľsky a s použitím jednoduchého slovníka. " + "Nevymýšľaj nové pravidlá hry. Ak nemáš dosť informácií, polož jednu krátku otázku. " + ), +) + +print("ENV KEY PRESENT:", bool(os.getenv("OPENAI_API_KEY"))) +print("MODEL:", os.getenv("REALTIME_MODEL")) + +OUTPUT_MODALITIES = ["text"] # мы используем только текстовый realtime :contentReference[oaicite:1]{index=1} + +MYSQL_HOST = os.getenv("MYSQL_HOST", "127.0.0.1") +MYSQL_PORT = int(os.getenv("MYSQL_PORT", "3306")) +MYSQL_DATABASE = os.getenv("MYSQL_DATABASE", "furhat_logs") +MYSQL_USER = os.getenv("MYSQL_USER", "localhost") +MYSQL_PASSWORD = os.getenv("MYSQL_PASSWORD", "") + +# ----------------------------- +# HTTP API models +# ----------------------------- +class RespondRequest(BaseModel): +# session_id: str = Field(..., description="ID логической сессии (пришлёт Kotlin).") +# user_text: str = Field(..., description="Текст пользователя из Furhat STT / onResponse.") + user_text: str + # Опционально: чтобы Kotlin мог попросить конкретный тип помощи + task: Optional[str] = Field( + default=None, + description="Напр. 'hint', 'rephrase', 'explain_wrong', 'smalltalk' и т.п.", + ) + # Опционально: краткий контекст текущего шага (вопрос, попытки и т.д.) + context: Optional[Dict[str, Any]] = Field(default=None) + + +class RespondResponse(BaseModel): + answer: str + +# ----------------------------- +# DB +# ----------------------------- +class LogRequest(BaseModel): + session_id: str + game: str + phase: str + question: str + attempt: int + result: str + user_answer: Optional[str] = None + correct_answer: Optional[str] = None + hint_used: bool = False + created_at: Optional[datetime] = None + +def get_db_connection(): + return pymysql.connect( + host=MYSQL_HOST, + port=MYSQL_PORT, + user=MYSQL_USER, + password=MYSQL_PASSWORD, + database=MYSQL_DATABASE, + charset="utf8mb4", + cursorclass=pymysql.cursors.DictCursor, + autocommit=True, + ) + +# ----------------------------- +# Realtime connection manager +# ----------------------------- +app = FastAPI(title="Realtime Proxy", version="0.1.0") + +openai_client = AsyncOpenAI(api_key=OPENAI_API_KEY) + +def _build_prompt(task: Optional[str], context: Optional[Dict[str, Any]]) -> str: + ctx = context or {} + + if task == "hint": + return ( + "Daj veľmi jemnú, ale konkretnú nápovedu bez toho, aby si prezradil správnu odpoveď. 1-2 vety" + f"Kontekst: {ctx}" + ) + if task == "rephrase": + return ( + "Preformuluj otázku jednoduchšie, použivaj jednoduche slova, ale zachovaj význam, 1-2 vety. NEPREZRAĎ správnu odpoveď. " + f"Kontekst: {ctx}" + ) + if task == "explain_wrong": + return ( + "Vysvetli stručne, PREČO odpoveď nie je správna, ale NEPREZRAĎ správnu odpoveď. " + "Namiesto toho daj jemnú nápovedu jednou vetou (napríklad „Poplietli ste poradie slov“ alebo „Uviedli ste čas o 2 hodiny skôr, než je aktuálny“). " + "Povzbuď na ďalší pokus. " + f"Kontekst: {ctx}" + ) + if task == "reaction": + return ( + "Vyhodnoť odpoveď používateľa na small-talk otázku robota. " + "Rozhodni iba medzi dvoma typmi reakcie: positive alebo neutral. " + "positive použi, ak odpoveď znie príjemne, pozitívne, radostne alebo povzbudivo. " + "neutral použi, ak je odpoveď vecná, nejasná, krátka, zmiešaná alebo ju nemožno bezpečne chápať ako pozitívnu. " + "Potom vytvor veľmi krátku empatickú reakciu robota v jednoduchej slovenčine. " + "Štýl má byť priateľský a úprimný, napríklad: 'To ma veľmi teší.', 'Ďakujem, že ste mi to povedali.', atď. Nepoužívaj ich stále, použivaj rôzne" + "Nevysvetľuj svoje rozhodnutie. " + "Výstup musí mať presne formát: typ||reakcia " + "kde typ je iba positive alebo neutral. " + f"Kontekst: {ctx}" + ) + if task == "smalltalk": + exercise = ctx.get("exercise", "") + topic = ctx.get("topic", "") + subtopic = ctx.get("subtopic", "") + target_word = ctx.get("target_word", "") + response_mode = ctx.get("response_mode", "open") + return ( + "Polož krátku prirodzenú small-talk otázku súvisiacu s témou aktuálneho cvičenia. " + "Použi jednoduché slová, 1-2 vety. " + "Nemeň tému a nevymýšľaj nové pravidlá hry. " + "Nevypisuj viac otázok naraz. " + f"Typ cvičenia: {exercise}. " + f"Téma: {topic}. " + f"Podtéma: {subtopic}. " + f"Kľúčové slovo: {target_word}. " + f"Formát odpovede používateľa: {response_mode}. " + "Ak je formát 'yes_no', vytvor otázku, na ktorú sa prirodzene odpovedá áno alebo nie. " + "Ak je formát 'open', vytvor otvorenú každodennú otázku. " + ) + + # default + return f"Odpovedaj stručne a vecne. Kontekst: {ctx}" + + +async def _ask_realtime(user_text: str, task: Optional[str], context: Optional[Dict[str, Any]]) -> str: + per_turn_instructions = _build_prompt(task, context) + + async with openai_client.realtime.connect(model=REALTIME_MODEL) as conn: + await conn.session.update( + session={ + "type": "realtime", + "output_modalities": ["text"], + "instructions": BASE_INSTRUCTIONS, + "tool_choice": "none", + "tools": [], + "audio": {"input": {"turn_detection": None}}, + } + ) + + await conn.conversation.item.create( + item={ + "type": "message", + "role": "user", + "content": [{"type": "input_text", "text": user_text}], + } + ) + + await conn.response.create( + response={ + "instructions": per_turn_instructions, + "max_output_tokens": 70, + } + ) + + chunks = [] + + async for event in conn: +# print("EV:", event.type) + + if event.type in ("response.output_text.delta", "response.text.delta"): + chunks.append(event.delta) + + elif event.type == "response.done": + # ЛОГИ — всегда, чтобы видеть, что реально пришло в DONE + resp = getattr(event, "response", None) + output = getattr(resp, "output", None) or [] +# print("DONE output len:", len(output)) +# print("DONE output raw:", output) +# print("DONE response obj:", resp) + + # Если дельт не было — пробуем достать финальный текст из response.output + if not chunks: + for item in output: + if getattr(item, "type", None) == "message": + for c in getattr(item, "content", []) or []: + ctype = getattr(c, "type", None) + if ctype in ("output_text", "text"): + txt = getattr(c, "text", "") or "" + if txt: + chunks.append(txt) + + break + + elif event.type == "error": + raise RuntimeError(f"Realtime error: {event.error}") + + answer = "".join(chunks).strip() + return answer or "Prepáčte, môžete to prosím zopakovať?" + + +# ----------------------------- +# FastAPI endpoints +# ----------------------------- +@app.get("/test") +async def health(): + return {"status": "ok"} + + +@app.post("/respond", response_model=RespondResponse) +async def respond(req: RespondRequest): + try: + answer = await _ask_realtime(req.user_text, req.task, req.context) + print("RESPOND:", req.user_text, req.task) + return RespondResponse(answer=answer) + except Exception as e: + raise HTTPException(status_code=500, detail=str(e)) + +@app.post("/reset") +async def reset(): + print("RESET called") + return {"status": "reset"} + +@app.post("/log") +async def log_event(req: LogRequest): + try: + conn = get_db_connection() + try: + with conn.cursor() as cur: + cur.execute( + """ + INSERT INTO session_logs ( + session_id, + game, + phase, + question, + attempt, + result, + user_answer, + correct_answer, + hint_used, + created_at + ) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) + """, + ( + req.session_id, + req.game, + req.phase, + req.question, + req.attempt, + req.result, + req.user_answer, + req.correct_answer, + req.hint_used, + req.created_at or datetime.utcnow(), + ) + ) + finally: + conn.close() + + return {"status": "ok"} + + except Exception as e: + print("LOG ERROR:", repr(e)) + traceback.print_exc() + raise HTTPException(status_code=500, detail=f"log insert failed: {str(e)}") \ No newline at end of file diff --git a/src/main/realtime/requirements.txt b/src/main/realtime/requirements.txt new file mode 100644 index 0000000..4cb1d0f --- /dev/null +++ b/src/main/realtime/requirements.txt @@ -0,0 +1,4 @@ +fastapi +uvicorn[standard] +openai +python-dotenv \ No newline at end of file diff --git a/src/main/resources/wordbank.csv b/src/main/resources/wordbank.csv new file mode 100644 index 0000000..ff71a85 --- /dev/null +++ b/src/main/resources/wordbank.csv @@ -0,0 +1,159 @@ + +jablko,ovocie,1,jablka|jablk|jablky +hruška,ovocie,1,hruska|hruška|hrušk +banán,ovocie,1,banan|banán|banana +pomaranč,ovocie,2,pomaranc|pomaranče +citrón,ovocie,2,citron|citróny|citróne +jahoda,bobuľa,1,jahoda|jahod|jahda +malina,bobuľa,2,malina|maliny +orech,jedlo,1,orech +chlieb,jedlo,1,chlieb +maslo,jedlo,1,maslo +syr,jedlo,1,syr +mlieko,nápoje,1,mlieko +voda,nápoje,1,voda +čaj,nápoje,1,caj|čaj +káva,nápoje,1,kava|káva +polievka,jedlo,2,polievka +ryža,jedlo,2,ryza|ryža +cestovina,jedlo,2,cestovina +mäso,jedlo,1,maso|mäso +kurča,jedlo,2,kurca|kurča +ryba,jedlo,1,ryba +vajce,jedlo,1,vajce +soľ,prísady,1,sol|soľ +cukor,prísady,1,cukor +med,sladké,1,med +jogurt,jedlo,2,jogurt +koláč,sladké,2,kolac|koláč +čokoláda,sladké,2,cokolada|čokoláda +zmrzlina,sladké,2,zmrzlina +paradajka,zelenina,1,paradajka +uhorka,zelenina,1,uhorka +zemiak,zelenina,1,zemiaky +mrkva,zelenina,1,mrkva +cibuľa,zelenina,2,cibula|cibuľa +cesnak,zelenina,1,cesnak +paprika,zelenina,1,paprika +šalát,zelenina,2,salat|šalát +fazuľa,zelenina,2,fazula|fazuľa +hrášok,zelenina,2,hrasok|hrášok +múka,jedlo,2,muka|múka +ocot,prísady,2,ocot +stôl,domáce potreby,1,stol|stôl +stolička,domáce potreby,1,stolicka|stolička +posteľ,domáce potreby,2,postel|posteľ +vankúš,domáce potreby,2,vankus|vankúš +deka,domáce potreby,1,deka +skriňa,domáce potreby,2,skrina|skriňa +dvere,dom,1,dvere +okno,dom,1,okno +lampa,technika,1,lampa +koberec,domáce potreby,2,koberec +zrkadlo,domáce potreby,2,zrkadlo +kľúč,dom,1,kluc|kľúč +zásuvka,dom,2,zasuvka|zásuvka +polica,dom,1,polica +chladnička,dom,3,chladnicka|chladnička +rúra,dom,2,rura|rúra +sporák,dom,3,sporak|sporák +umývadlo,hygiena,3,umyvadlo|umývadlo +sprcha,hygiena,2,sprcha +vaňa,dom,2,vana|vaňa +uterák,dom,2,uterak|uterák +mydlo,hygiena,1,mydlo +šampón,hygiena,3,sampón|sampon|šampón +práčka,technika,3,pracka|práčka +žehlička,technika,3,zehlicka|žehlička +televízor,druh zábavy,3,televizor|televízor +rádio,technika,2,radio|rádio +počítač,technika,3,pocitac|počítač +telefón,technika,2,telefon|telefón +hodiny,technika,2,hodiny +vypínač,technika,3,vypinac|vypínač +batéria,technika,2,bateria|batéria +strom,príroda,1,strom +kvet,príroda,1,kvet +tráva,príroda,1,trava|tráva +list,príroda,1,list +vetva,príroda,1,vetva +rieka,príroda,1,rieka +jazero,príroda,2,jazero +more,príroda,1,more +hora,príroda,1,hora +les,príroda,1,les +lúka,príroda,2,luka|lúka +dážď,príroda,2,dazd|dážď +sneh,príroda,1,sneh +vietor,príroda,1,vietor +slnko,príroda,1,slnko +oblak,príroda,1,oblak +hviezda,príroda,2,hviezda +mesiac,príroda,1,mesiac +kameň,príroda,2,kamen|kameň +piesok,príroda,1,piesok +pôda,príroda,2,poda|pôda +oheň,príroda,2,ohen|oheň +plameň,príroda,3,plamen|plameň +vlna,príroda,2,vlna +hmla,príroda,2,hmla +ulica,mesto,1,ulica +námestie,mesto,2,namestie|námestie +škola,mesto,1,skola|škola +obchod,mesto,1,obchod +trh,mesto,2,trh +banka,mesto,1,banka +pošta,mesto,2,posta|pošta +nemocnica,mesto,3,nemocnica +lekáreň,mesto,3,lekaren|lekáreň +stanica,mesto,2,stanica +zastávka,mesto,2,zastavka|zastávka +autobus,mesto,1,autobus +vlak,mesto,1,vlak +taxi,mesto,2,taxi +most,mesto,1,most +park,mesto,1,park +kino,druh zábavy,1,kino +divadlo,druh zábavy,2,divadlo +reštaurácia,mesto,3,restauracia|reštaurácia +kaviareň,mesto,3,kavieren|kaviareň +hotel,mesto,2,hotel +múzeum,druh zábavy,3,muzeum|múzeum +knižnica,mesto,3,kniznica|knižnica +polícia,mesto,3,policia|polícia +hlava,telo,1,hlava +oko,telo,1,oko +ucho,telo,1,ucho +nos,telo,1,nos +ústa,telo,2,usta|ústa +zub,telo,1,zub +jazyk,telo,2,jazyk +krk,telo,1,krk +rameno,telo,2,rameno +ruka,telo,1,ruka +dlaň,telo,2,dlan|dlaň +prst,telo,1,prst +lakeť,telo,3,laket|lakeť +chrbát,telo,3,chrbat|chrbát +brucho,telo,1,brucho +noha,telo,1,noha +koleno,telo,1,koleno +členok,telo,3,clenok|členok +päta,telo,2,peta|päta +srdce,telo,2,srdce +pľúca,telo,3,pluca|pľúca +žalúdok,telo,3,zaludok|žalúdok +pečeň,telo,3,pecen|pečeň +tričko,oblečenie,2,tricko|tričko +nohavice,oblečenie,1,nohavice +sukňa,oblečenie,2,sukna|sukňa +šaty,oblečenie,1,saty|šaty +sveter,oblečenie,2,sveter +bunda,oblečenie,1,bunda +kabát,oblečenie,2,kabat|kabát +topánka,oblečenie,2,topanka|topánka +ponožka,oblečenie,2,ponozka|ponožka +čiapka,oblečenie,2,ciapka|čiapka +šál,oblečenie,2,sal|šál +rukavica,oblečenie,2,rukavica +opasok,oblečenie,2,opasok