commit d89b82be4aab48e7109b0e1490897172aa59200e Author: Kasiaaaaaa Date: Tue Sep 22 11:52:03 2026 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46e731a --- /dev/null +++ b/.gitignore @@ -0,0 +1,16 @@ +stimuli_store/ +results/ +tmp/ +logs/ +tmp2/ +logs/ +other/ +.DS_Store +*.wav +*.pyc +genPythonCode.py +*.xar +*.xml +*.pml +*.mp3 +*.MTSq \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..1c1c7b1 --- /dev/null +++ b/README.md @@ -0,0 +1,162 @@ +                                    + + + +# PICKA – Perception of Indexical Cues in Kids and Adults + +PICKA is a test battery developed by the University Medical Center Groningen to evaluate the development of the perception of indexical cues through childhood. + +## Requirements +The following requirements are necessary for both PyWORLD and naoqi to run +- python 2.7.10+ + + __Note:__ naoqi is not yet comaptible with python 3 +- Linux (Ubuntu 14.04 or 16.04) or Mac OS (appears to work up to Catalina - further testing may still be required) + + __Note:__ Although naoqi can run on Windows, PyWORLD is not compatible with python 2.7+ on Windows, only python 3+ +- naoqi (currently tested and working on version 2.5.5) + + Can be downloaded from SoftBank Robotics Community Website + + __Note:__ This requires you to have a SoftBank Robotics account to access + + __Note:__ naoqi cannot be installed with PyPi (i.e. pip) + + Installation instructions for python SDK can be found in the SoftBank Robotics Documentation + + +## Installation + +Run the requirements.txt file to install the necessary python packages. The package that generates the stimuli is WORLD, which is python wrapped with PyWORLD. This can cause some difficulties when installing. If installing directly from pip doesn't work, see the PyWORLD Github page. + +``` +$ pip install -r requirements.txt +``` + +## Running PICKA on Nao +### Webserver + +The webserver that runs the experiments can be started using the `app.py` script in the `www/` by simply running `python app.py`. The website can then be accessed by going to `http://[IP of either Nao or laptop]:5000`. The specific game can then be selected. A pop-up box will then open where the participant information can be filled in. This will then check if the participant already has a file assigned to them, or if a new one should be created. + +The following data is requred for the pop-up box: +- Participant ID following the template: `[NH|CI|HI][A|K][000]`, that is a description of the group (in capitals, normal hearing: `NH`, hearing-impaired: `HI` or cochlear implant: `CI`), immediately followed by the age group (`A` for adults and `K` for kids), and finally the subject number as a 3-digit zero-padded number. Here are a few examples: + - `NHA001` + - `CIK123` +- Phase of the experiment (training or test) +- Language the experiment should be conducted in (English or Dutch) + +### Without webserver + +The experiment can also be run by executing the `picka.py` file with python from a terminal session on Nao. The file takes multiple arguments to run. Required arguments are game, subject, phase, language, ip, and port. + +``` +$ python picka.py --help +usage: picka.py [-h] [-ip IPADRESS] [-pp PORT] -g {gender,fishy} [--version] + -s SUBJECT -p PHASE -l {EN,NL} + +The main script used to run SAM + +optional arguments: + -h, --help show this help message and exit + -ip IPADRESS, --ipadress IPADRESS + The ipadress of SAM. + -pp PORT, --port PORT + Port that SAM has open for connection. + -g {gender,fishy}, --game {gender,fishy} + The game for the current experiment. + --version Displays current version + -s SUBJECT, --subject SUBJECT + Name of the subject perfomring the test. + -p PHASE, --phase PHASE + Phase of testing. Test or training + -l {EN,NL}, --lang {EN,NL} + Language in which experiment should be conducted. + +Written by Luke Meyer , adapted from MATLAB script by Etienne Gaudrain +Copyright 2017 CNRS (FR), UMCG (NL) +``` + +The naming convention for participant ID must be kept identical to that for the webserver. + +If a participant already exists, you will receive a message in the terminal console, as well as asking if you want to continue with the selected file. If the file does not exist, you will be asked if you want to create it. It should also be checked here if the correct ID format has been followed. + +## Experiments + +The current version of PICKA on a Nao humanoid robot contains 4 experiments: + +- **fishy**: an adaptive tracking of the just-noticeable-difference for F0 and VTL (see [details](Experiments/fishy/README.md)). +- **gender**: subjective categorisation of gender based on F0 anf VTL vocal cues (see [details](Experiments/gender/README.md)) +- **emotion**: classification of emotion based on a presented voice (see [details](Experiments/emotion/README.md)) +- **speech-on-speech**: speech-on-speech perception based on the coordinate response method (see [details](Experiments/crm/README.md)) + +## Results files + +Each experiment is storing its own results in the form of a single MAT file per subject. These files are located in the `results` folder, and should not be renamed or deleted. You should make a backup of these files regularly, preferably at the end of each testing session. + +**Renaming the file has no effect on the subject name!** See the section "Ensuring data consistency" for more details. + +### Export formats + + +There is a `createJson.py` script that will export the results value of the experiment into JSON. + + + + +__CSV__ is comma separated values. It is widely recognized, including by Excel, R and Python. (Note that non-English Excel can sometimes struggle CSV files when the decimal separation symbol is a comma. In that case, LibreOffice provides a more reliable way of opening CSV files for visual inspection.) + + + +__JSON__ stands for “JavaScript Object Notation”, It’s used to store and exchange data as an alternative solution for XML. JSON is easier to parse, quicker to read and write. JSON sytnax is based on JavaScript Object Literals, But it’s a text format. + +### Ensuring data consistency + +The experiments are coded in a way that prevents data to be overwritten or lost. If an experiment crashes in the middle, restarting it with the same participant ID will continue where it stopped. This ensures the robustness of the data collection, but has two downsides: + +- The participant ID is extremely important. If there is a mix up, e.g. if participant John Doe is tested on day 1 with ID `nl_NHA003` but on day 2 with ID `nl_NHA008`, the experiment will either restart from the beginning; or if `nl_NHA008` already existed and had started the experiment, the data will get mixed in the result file with no way of knowing which one belong to which one apart from the date and time of testing. **So it is imperative to keep a lab book and an up to date list of the link between ID and name.** Also, it means that merely renaming the file will not solve the problem. The participant ID is stored in the file as well as in the filename. **Don't rename the files!** + +- The result file contains all the options, which makes it self reliable, and prevents option details to be lost. However, if the option file (`expe_build_conditions.py`) is modified during the experiment, the options for all the participants who had started before that will remain unchanged. What we gain in robustness, we lose in flexibility. + +## Calibration + +Calibration is an important part of any psychophysical experiment, especially when a population with hearing deficiencies is tested. The calibration procedure not only ensures that the experiment is repeatable, but also that the presentation level is appropriate for the listeners taking part in the experiment. + +For PICKA, the aim of the calibration is that all stimuli are presented at a sound pressure level of __70 dB(A)__. This level ensures audibility in normal hearing listeners, as well as hearing impaired listeners using a prosthetic device. + +Calibration is easiest done locally on the Nao robot by using ssh. +``` +$ ssh nao@[Nao IP address] +Password: nao +``` +You can then navigate to `~/pyworld-test/pyworld-0.2.8/`. The file `sam_calibration.py` can then be run. + +Then, take the following steps: + +1. Set the volume on the Nao robot to __75__ by navigating to the robot's home page (enter the IP address into a web browser). + +2. Run the `sam_calibration.py` file passing in a language parameter i.e. + +``` +$ python sam_calibration.py EN +``` + + - This will generate a single `calibration.wav`file in the current directory made up of a random selection of previously generated files in the `./tmp/` folder. + +1. Measure the sound level from a KEMAR attached to a sound level meter. + +2. Adjust the gain field so reach a level of 70 dB(A). Larger values will attenuate the sound where 0 is no attenuation. This value can be changed in the `expe_build_conditions.py` file under the variable `options["attenuation_dB"]`. + + +## Folder tree + +Here's a description of the content of the PICKA folder: + +- `Python_scripts` contains all the python scripts relevant to running the just noticeable difference experiment on the Nao robot. + + + + `logs` contains logging files. This includes files that track the time for generation of the stimuli files, tracking of the adaptive procedure, and general logging of information and warnings + + + `pyworld` contains the `pyworld.so` (may need to be regenerated upon installing - see able for PYWORLD Github) and the `pyworld.pyx` files used to communicate with WORLD. + + + `results` contains the `.mat` and `.json` files for each of the participants + + + `stimuli` contains the sound files used for the experiment. This is further subdivided into the two language directories `en` and `nl`. + + + `stimuli_store` contains the `.mat` files containing the data of the stimuli files in `./stimlui` + + + `tmp` contains the cache of generated files using PyWORLD diff --git a/Robot/Robot.py b/Robot/Robot.py new file mode 100644 index 0000000..2b7c5c0 --- /dev/null +++ b/Robot/Robot.py @@ -0,0 +1,772 @@ +# -------------------------------------------------------------------------- +# Authors: +# 2017-03-06: Thirsa +# 2020-01-28: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- + +from naoqi import ALProxy +import random +import math +import time +import paramiko +import sys +import tools.settings as settings +import qi + + +class Robot(object): + + def __init__(self, IPADRESS, PORT, LANG, SUBJECT): + self.language = LANG + self.ipadress = str(IPADRESS) + # port = 54011 + self.port = int(PORT) + self.subject = SUBJECT + # self.speaking_volume = 65 + # self.stimulus_volume = 75 + self.speaking_volume = 40 + self.stimulus_volume = 45 + + self.say_0 = '' + self.say_1 = '' + self.say_2 = '' + self.say_3 = '' + self.say_4 = '' + self.say_5 = '' + self.encouragement_pos = [] + self.encouragement_neg = [] + self.hips = ["LHipYawPitch", "RHipYawPitch", "LHipPitch", "RHipPitch"] + from naoqi import ALProxy + self.mtn = ALProxy("ALMotion", self.ipadress, self.port) + self.tts = ALProxy("ALTextToSpeech", self.ipadress, self.port) + self.mem = ALProxy("ALMemory", self.ipadress, self.port) + self.pst = ALProxy("ALRobotPosture", self.ipadress, self.port) + self.aas = ALProxy("ALAnimatedSpeech", self.ipadress, self.port) + self.aap = ALProxy("ALAudioPlayer", self.ipadress, self.port) + self.aad = ALProxy("ALAudioDevice", self.ipadress, self.port) + self.all = ALProxy("ALLeds", self.ipadress, self.port) + self.asr = ALProxy("ALSpeechRecognition", self.ipadress, self.port) + self.bms = ALProxy("ALBehaviorManager", self.ipadress, self.port) + self.aad.setOutputVolume(self.speaking_volume) + + if self.language == 'EN': + self.tts.setLanguage("English") + elif self.language == 'NL': + self.tts.setLanguage("Dutch") + # Only work when connecting to an actual robot. Does not work with a virtual robot. + # self.afr = ALProxy("ALFaceDetection",self.ipadress,self.port) + + def buiging(self): + ''' + Choregraphe bezier export in Python. + + Bowing gesture + ''' + self.mtn.wakeUp() + names = list() + times = list() + keys = list() + + names.append("HeadPitch") + times.append([0.6, 1.84, 3]) + keys.append([[-0.159578, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.116626, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.159578, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("HeadYaw") + times.append([0.6, 1.84, 3]) + keys.append([[-0.0123138, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.0123138, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.0123138, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LAnklePitch") + times.append([0.6, 1.84, 3]) + keys.append([[0.0904641, [3, -0.2, 0], [3, 0.413333, 0]], + [0.115008, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.0904641, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LAnkleRoll") + times.append([0.6, 1.84, 3]) + keys.append([[-0.12728, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.151824, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.12728, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LElbowRoll") + times.append([0.6, 1.84, 3]) + keys.append([[-0.45709, [3, -0.2, 0], [3, 0.413333, 0]], + [-1.50481, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.45709, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LElbowYaw") + times.append([0.6, 1.84, 3]) + keys.append([[-1.15054, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.529273, [3, -0.413333, 0], [3, 0.386667, 0]], + [-1.15054, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LHand") + times.append([0.6, 1.84, 3]) + keys.append([[0.2832, [3, -0.2, 0], [3, 0.413333, 0]], + [0.2832, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.2832, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LHipPitch") + times.append([0.6, 1.84, 3]) + keys.append([[0.131966, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.363515, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.131966, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LHipRoll") + times.append([0.6, 1.84, 3]) + keys.append([[0.107422, [3, -0.2, 0], [3, 0.413333, 0]], + [0.0951499, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.107422, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LHipYawPitch") + times.append([0.6, 1.84, 3]) + keys.append([[-0.162562, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.25767, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.162562, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LKneePitch") + times.append([0.6, 1.84, 3]) + keys.append([[-0.0844118, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.0844118, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.0844118, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LShoulderPitch") + times.append([0.6, 1.84, 3]) + keys.append([[1.48334, [3, -0.2, 0], [3, 0.413333, 0]], + [1.14432, [3, -0.413333, 0], [3, 0.386667, 0]], + [1.48334, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LShoulderRoll") + times.append([0.6, 1.84, 3]) + keys.append([[0.11194, [3, -0.2, 0], [3, 0.413333, 0]], + [0.130348, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.11194, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("LWristYaw") + times.append([0.6, 1.84, 3]) + keys.append([[0.0459781, [3, -0.2, 0], [3, 0.413333, 0]], + [-1.09225, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.0459781, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RAnklePitch") + times.append([0.6, 1.84, 3]) + keys.append([[0.0982179, [3, -0.2, 0], [3, 0.413333, 0]], + [0.0798099, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.0982179, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RAnkleRoll") + times.append([0.6, 1.84, 3]) + keys.append([[0.135034, [3, -0.2, 0], [3, 0.413333, 0]], + [0.145772, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.135034, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RElbowRoll") + times.append([0.6, 1.84, 3]) + keys.append([[0.385075, [3, -0.2, 0], [3, 0.413333, 0]], + [0.360533, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.385075, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RElbowYaw") + times.append([0.6, 1.84, 3]) + keys.append([[1.20415, [3, -0.2, 0], [3, 0.413333, 0]], + [1.39897, [3, -0.413333, 0], [3, 0.386667, 0]], + [1.20415, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RHand") + times.append([0.6, 1.84, 3]) + keys.append([[0.2916, [3, -0.2, 0], [3, 0.413333, 0]], + [0.2916, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.2916, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RHipPitch") + times.append([0.6, 1.84, 3]) + keys.append([[0.130348, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.322183, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.130348, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RHipRoll") + times.append([0.6, 1.84, 3]) + keys.append([[-0.0996681, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.0413762, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.0996681, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RHipYawPitch") + times.append([0.6, 1.84, 3]) + keys.append([[-0.162562, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.25767, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.162562, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RKneePitch") + times.append([0.6, 1.84, 3]) + keys.append([[-0.0858622, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.0923279, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.0858622, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RShoulderPitch") + times.append([0.6, 1.84, 3]) + keys.append([[1.46961, [3, -0.2, 0], [3, 0.413333, 0]], + [0.93118, [3, -0.413333, 0], [3, 0.386667, 0]], + [1.46961, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RShoulderRoll") + times.append([0.6, 1.84, 3]) + keys.append([[-0.136568, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.306841, [3, -0.413333, 0], [3, 0.386667, 0]], + [-0.136568, [3, -0.386667, 0], [3, 0, 0]]]) + + names.append("RWristYaw") + times.append([0.6, 1.84, 3]) + keys.append([[0.076658, [3, -0.2, 0], [3, 0.413333, 0]], + [-0.372804, [3, -0.413333, 0], [3, 0.386667, 0]], + [0.076658, [3, -0.386667, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + self.aas.say( + "^start(animations/Stand/Gestures/Explain_2)Je gaat 3 keer een triplet van verschillende lettergrepen horen. 1 van de tripletten wordt gezegd met een andere stem. Het is jouw taak om aan te geven welke anders klinkt. Je kunt antwoorden door je hand op mijn rechterhand, \\pau=500\\ hoofd \\pau=500\\of linkerhand te leggen. Laten we het proberen. ^wait(animations/Stand/Gestures/Explain_2)" + ) + + except BaseException, err: + print err + self.mtn.rest() + self.mtn.setStiffnesses(self.hips, 1.0) + + def intro(self): + ''' + The intriduction to the experiment. Sam explains how the task will + work and what to do, as well as a demonstration on how to touch + the head and hands + ''' + if self.language == "EN": + self.say_0 = "^start(animations/stand/Gestures/Enthusiastic_4) Hi there! My name is Sammmy.\\pau=500\\ Welcome to the PICKA auditory performance game.\\pau=500\\ Lets have some fun!" + elif self.language == 'NL': + if "HIK" in self.subject: + self.say_0 = "^start(animations/stand/Gestures/Enthusiastic_4) Hoi! \\pau=250\\ Ik ben Sam." + else: + self.say_0 = "^start(animations/stand/Gestures/Enthusiastic_4) Hallo! \\pau=250\\ Ik ben Sammmy. \\pau=500\\ Welkom bij de PICKA auditieve optreden spelletje. \\pau=500\\ Laten we wat plezier hebben!" + self.mtn.wakeUp() + self.aas.say(self.say_0) + + def play_audio(self, stimulus): + ''' + Uploads the stimuli files to Sam using a paramiko sftp server. + Sam then plays the files, then deletes them off its main storage. + ''' + NAO_USERNAME = "nao" + NAO_PASSWORD = "nao" + t = paramiko.Transport((self.ipadress, 22)) + t.connect(username=NAO_USERNAME, password=NAO_PASSWORD) + sftp = paramiko.SFTPClient.from_transport(t) + sftp.chdir('/home/nao/tests/') + remotepath = str('/home/nao/tests/' + stimulus) + + try: + print "Uploading file..." + sftp.put(stimulus, remotepath) + print "File Uploaded" + except: + raise ValueError('No file provided for upload.') + for i in range(1, 1000): + dir_list = sftp.listdir() + if stimulus in dir_list: + break + else: + time.sleep(0.01) + if i == 999: + raise ValueError('File was not uploaded to nao') + + # localpath = ( + # 'C:\\Users\\Nao\\Documents\\Nao scripts\\Expe_files\\' + soundfile) + try: + # aap = self.aap.playFile(remotepath) + qi.async(self.aap.playFile, remotepath, delay=0) + except RuntimeError as e: + print e + sys.exit(0) + + # sftp.remove(stimulus) + time.sleep(0.5) + + return True + + def game_break(self): + ''' + Waits for a response from the subject to start the experiment. + ''' + if self.language == 'EN': + self.say_1 = "When you're ready to begin, you can start the game by touching the top of my head." + self.say_2 = "Let's begin!" + self.say_3 = "Ok. Goodbye." + elif self.language == 'NL': + self.say_1 = "Wanneer je klaar bent om te beginnen, kun je het experiment starten door je hand op mijn hoofd te leggen." + self.say_2 = 'Hier gaan we' + self.say_3 = "Ok. Tot ziens." + self.tts.say(self.say_1) + self.mtn.setStiffnesses(["HeadYaw", "HeadPitch"], [1.0, 1.0]) + self.hoofd_beweging() + # current_running_time = 0 + # start_time = time.time() + # while current_running_time < (start_time+120): + # # check the data continously for 120 seconds + # head1 = self.mem.getData('RearTactilTouched') + # head2 = self.mem.getData('FrontTactilTouched')ell + # head = [head1, head2, head3] + # if any(head): + # break + # current_running_time = time.time() + self.tts.say(self.say_2) + + def encouragement(self, robot_input): + '''Issues an encouragement message depending on how the subject is doing.''' + if self.language == 'EN': + self.encouragement_pos = [ + "\\vct=110\\You're doing great!\\vct=100\\", + '\\vct=110\\ Keep going! \\vct=100\\', + '\\vct=110\\ Doing well!\\vct=100\\', + "\\vct=110\\ Great!\\vct=100\\" + ] + self.encouragement_neg = [ + "\\vct=110\\ You can do it! \\vct=100\\", + "\\vct=110\\ Keep trying! \\vct=100\\", + "\\vct=110\\ Give it another go! \\vct=100\\", + "\\vct=110\\ Don't give up!\\vct=100\\" + ] + elif self.language == 'NL': + self.encouragement_pos = [ + "\\vct=110\\ Goed bezig!\\vct=100\\", + '\\vct=110\\ Ga zo door! \\vct=100\\', + '\\vct=110\\ Je doet het super!\\vct=100\\', + "\\vct=110\\ Super!\\vct=100\\" + ] + self.encouragement_neg = [ + "\\vct=110\\ Je kunt het! \\vct=100\\", + "\\vct=110\\ Blijf proberen! \\vct=100\\", + "\\vct=110\\ Nog even doorgaan! \\vct=100\\", + "\\vct=110\\ Niet opgeven!\\vct=100\\" + ] + answer = str(robot_input) + if answer == 'correct': + encouragement_options_positive = self.encouragement_pos + prob = random.randint(0, len(encouragement_options_positive) - 1) + encou = encouragement_options_positive[prob] + else: + encouragement_options_negative = self.encouragement_neg + prob = random.randint(0, len(encouragement_options_negative) - 1) + encou = encouragement_options_negative[prob] + self.tts.say(encou) + + def ending(self): + '''Performs the ending of the experiment.''' + if self.language == 'EN': + self.say_1 = '^start(animations/Stand/Gestures/Enthusiastic_5) That\'s the end of our game! ^wait(animations/Stand/Gestures/Enthusiastic_5) \\pau=200\\ ^start(animations/Stand/Gestures/Explain_1)Thank you for playing with me! ^wait(animations/Stand/Gestures/Explain_1) ^start(animations/Stand/Gestures/Hey_6) Goodbye! ^wait(animations/Stand/Gestures/Hey_6)' + elif self.language == 'NL': + self.say_1 = '^start(animations/Stand/Gestures/Enthusiastic_5) Dit is het einde van ons spel! ^wait(animations/Stand/Gestures/Enthusiastic_5) \\pau=200\\ ^start(animations/Stand/Gestures/Explain_1)Dankjewel voor het meespelen ^wait(animations/Stand/Gestures/Explain_1) ^start(animations/Stand/Gestures/Hey_6)en tot ziens! ^wait(animations/Stand/Gestures/Hey_6)' + self.mtn.wakeUp() + self.aas.setBodyLanguageMode = 2 + self.aas.say(self.say_1) + self.mtn.rest() + + def head_shake(self): + # Choregraphe bezier export in Python. + names = list() + times = list() + keys = list() + + names.append("HeadPitch") + times.append([0.8, 1.6, 2.4]) + keys.append([[-0.0782759, [3, -0.266667, 0], [3, 0.266667, 0]], + [-0.090548, [3, -0.266667, 0], [3, 0.266667, 0]], + [-0.07214, [3, -0.266667, 0], [3, 0, 0]]]) + + names.append("HeadYaw") + times.append([0.8, 1.6, 2.4]) + keys.append([[-0.842209, [3, -0.266667, 0], [3, 0.266667, 0]], + [0.619695, [3, -0.266667, 0], [3, 0.266667, 0]], + [-0.0107799, [3, -0.266667, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + except BaseException, err: + print err + + def head_nod(self): + + # Choregraphe bezier export in Python. + names = list() + times = list() + keys = list() + + names.append("HeadPitch") + times.append([0.8, 1.6]) + keys.append([[0.18864, [3, -0.266667, 0], [3, 0.266667, 0]], + [-0.0567999, [3, -0.266667, 0], [3, 0, 0]]]) + + names.append("HeadYaw") + times.append([0.8, 1.6]) + keys.append([[-0.0567999, [3, -0.266667, 0], [3, 0.266667, 0]], + [-0.0322559, [3, -0.266667, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + except BaseException, err: + print err + + def retry(self): + if self.language == 'EN': + # \\pau=500\\ If yes \\pau=500\\ touch my head \\pau=500\\ if no \\pau=500\\ touch my left or right hand." + self.say_1 = "Would you like to try again?" + + self.tts.say(self.say_1) + current_running_time = 0 + start_time = time.time() + self.asr.subscribe("retry") + while current_running_time < (start_time + 120): + if self.mem.getData("WordRecognized")[0] == "yes": + self.asr.unsubscribe("retry") + return True + elif self.mem.getData("WordRecognized")[0] == "no": + self.asr.unsubscribe("retry") + return False + + def simple_say(self, msg): + self.tts.say(msg) + + def take_break(self): + + behaviour_name = "custom_packages-8cd326/take_break" + if self.bms.isBehaviorInstalled(behaviour_name): + if self.bms.isBehaviorRunning(behaviour_name) == True: + self.bms.stopBehavior(behaviour_name) + self.mtn.setStiffnesses(self.hips, 0.0) + self.bms.runBehavior(behaviour_name) + else: + self.tts.say( + "I don't appear to be able to take a break right now.") + self.mtn.setStiffnesses(self.hips, 1.0) + + def hoofd_beweging(self): + '''Moves the head down for the subject to test the tactile function of Sam during the introduction.''' + + names = list() + times = list() + keys = list() + + names.append("HeadPitch") + times.append([0.7]) + keys.append([[0.35738, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("HeadYaw") + times.append([0.7]) + keys.append([[-0.0399261, [3, -0.133333, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + except BaseException, err: + print err + + start_time = time.time() + current_running_time = 0 + while current_running_time < (start_time + 120): + # check the data continously for 7 seconds + head1 = self.mem.getData('RearTactilTouched') + head2 = self.mem.getData('FrontTactilTouched') + head3 = self.mem.getData('MiddleTactilTouched') + head = [head1, head2, head3] + if any(head): + answer_given = 2 + break + current_running_time = time.time() + + names = list() + times = list() + keys = list() + + names.append("HeadPitch") + times.append([0.7]) + keys.append([[-0.17185, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("HeadYaw") + times.append([0.7]) + keys.append([[-0.0153821, [3, -0.133333, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + except BaseException, err: + print err + + def rechterhand_beweging(self): + '''Moves the right hand up for the subject to test the tactile function of Sam during the introduction.''' + names = list() + times = list() + keys = list() + + names.append("LElbowRoll") + times.append([0.7]) + keys.append([[-0.412604, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LElbowYaw") + times.append([0.7]) + keys.append([[-1.19349, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LHand") + times.append([0.7]) + keys.append([[0.2904, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LShoulderPitch") + times.append([0.7]) + keys.append([[1.52169, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LShoulderRoll") + times.append([0.7]) + keys.append([[0.10427, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LWristYaw") + times.append([0.7]) + keys.append([[0.108872, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RElbowRoll") + times.append([0.7]) + keys.append([[0.04146, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RElbowYaw") + times.append([0.7]) + keys.append([[1.12131, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RHand") + times.append([0.7]) + keys.append([[0.29, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RShoulderPitch") + times.append([0.7]) + keys.append([[0.457174, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RShoulderRoll") + times.append([0.7]) + keys.append([[0.254602, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RWristYaw") + times.append([0.7]) + keys.append([[-1.03549, [3, -0.133333, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + except BaseException, err: + print err + start_time = time.time() + current_running_time = 0 + while current_running_time < (start_time + 120): + right1 = self.mem.getData('HandRightRightTouched') + right2 = self.mem.getData('HandRightBackTouched') + right3 = self.mem.getData('HandRightLeftTouched') + right = [right1, right2, right3] + if any(right): + break + current_running_time = time.time() + + names = list() + times = list() + keys = list() + + names.append("LElbowRoll") + times.append([0.7]) + keys.append([[-0.412604, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LElbowYaw") + times.append([0.7]) + keys.append([[-1.19349, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LHand") + times.append([0.7]) + keys.append([[0.2904, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LShoulderPitch") + times.append([0.7]) + keys.append([[1.52169, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LShoulderRoll") + times.append([0.7]) + keys.append([[0.102736, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LWristYaw") + times.append([0.7]) + keys.append([[0.108872, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RElbowRoll") + times.append([0.7]) + keys.append([[0.382008, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RElbowYaw") + times.append([0.7]) + keys.append([[1.16733, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RHand") + times.append([0.7]) + keys.append([[0.29, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RShoulderPitch") + times.append([0.7]) + keys.append([[1.45274, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RShoulderRoll") + times.append([0.7]) + keys.append([[-0.0752079, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RWristYaw") + times.append([0.7]) + keys.append([[0.0413761, [3, -0.133333, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + except BaseException, err: + print err + + def linkerhand_beweging(self): + '''Moves the left hand up for the subject to test the tactile function of Sam during the introduction.''' + + names = list() + times = list() + keys = list() + + names.append("LElbowRoll") + times.append([0.7]) + keys.append([[-0.0367742, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LElbowYaw") + times.append([0.7]) + keys.append([[-0.974132, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LHand") + times.append([0.7]) + keys.append([[0.2904, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LShoulderPitch") + times.append([0.7]) + keys.append([[0.624296, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LShoulderRoll") + times.append([0.7]) + keys.append([[-0.227074, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LWristYaw") + times.append([0.7]) + keys.append([[0.88661, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RElbowRoll") + times.append([0.7]) + keys.append([[0.382008, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RElbowYaw") + times.append([0.7]) + keys.append([[1.16733, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RHand") + times.append([0.7]) + keys.append([[0.29, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RShoulderPitch") + times.append([0.7]) + keys.append([[1.45274, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RShoulderRoll") + times.append([0.7]) + keys.append([[-0.0752079, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RWristYaw") + times.append([0.7]) + keys.append([[0.0413761, [3, -0.133333, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + except BaseException, err: + print err + current_running_time = 0 + start_time = time.time() + while current_running_time < (start_time + 120): + left1 = self.mem.getData('HandLeftRightTouched') + left2 = self.mem.getData('HandLeftBackTouched') + left3 = self.mem.getData('HandLeftLeftTouched') + left = [left1, left2, left3] + if any(left): + break + current_running_time = time.time() + + names = list() + times = list() + keys = list() + + names.append("LElbowRoll") + times.append([0.7]) + keys.append([[-0.412604, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LElbowYaw") + times.append([0.7]) + keys.append([[-1.19349, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LHand") + times.append([0.7]) + keys.append([[0.2904, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LShoulderPitch") + times.append([0.7]) + keys.append([[1.52169, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LShoulderRoll") + times.append([0.7]) + keys.append([[0.102736, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("LWristYaw") + times.append([0.7]) + keys.append([[0.108872, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RElbowRoll") + times.append([0.7]) + keys.append([[0.382008, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RElbowYaw") + times.append([0.7]) + keys.append([[1.16733, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RHand") + times.append([0.7]) + keys.append([[0.29, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RShoulderPitch") + times.append([0.7]) + keys.append([[1.45274, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RShoulderRoll") + times.append([0.7]) + keys.append([[-0.0752079, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("RWristYaw") + times.append([0.7]) + keys.append([[0.0413761, [3, -0.133333, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + except BaseException, err: + print err + + +if __name__ == "__main__": + nao = Robot('127.0.0.1', 9559, "EN") + nao.buiging() diff --git a/Robot/RobotCRM.py b/Robot/RobotCRM.py new file mode 100644 index 0000000..5930828 --- /dev/null +++ b/Robot/RobotCRM.py @@ -0,0 +1,121 @@ +from Robot import Robot +import paramiko +import os +import sys +import cPickle as pickle +import time +from naoqi import ALProxy + + +class RobotCRM(Robot): + + def crmIntro(self): + if self.language == "EN": + self.say_1 = "^start(animations/Stand/Gestures/Explain_2)You are going to hear a sentence that sounds like it is spoken in a noisy room. \\pau=500\\ \ + It is your task to determine what was said in the sentence. An example sentence is, show the dog where the green 4 is.\\pau=500\\ \ + To enter your answer, you will have to use the coloured grid on the tablet provided. You must choose both the correct color and number that was spoken.\ + ^wait(animations/Stand/Gestures/Explain_2)" + self.say_2 = "\\pau=500\\ During the experiment, when my eyes turn green like this," + self.say_3 = "I am ready for your answer. \\pau=500\\" + self.say_4 = "Now I will try to make myself as quiet as possible." + elif self.language == "NL": + self.say_1 = "^start(animations/Stand/Gestures/Explain_2)You are going to hear a sentence that sounds like it is spoken in a noisy room. \\pau=500\\ \ + It is your task to determine what was said in the sentence. An example sentence is, show the dog where the green 4 is.\\pau=500\\ \ + To enter your answer, you will have to use the coloured grid on the tablet provided. You must choose both the correct color and number that was spoken.\ + ^wait(animations/Stand/Gestures/Explain_2)" + self.say_2 = "\\pau=500\\ During the experiment, when my eyes turn green like this," + self.say_3 = "I am ready for your answer. \\pau=500\\" + self.say_4 = "Now I will try to make myself as quiet as possible." + self.mtn.wakeUp() + self.aas.say(self.say_1) + self.aas.say(self.say_2) + self.all.fadeRGB("FaceLeds", "green", 0.01) + self.tts.say("\\pau=500\\") + self.aas.say(self.say_3) + self.all.fadeRGB("FaceLeds", "white", 0.01) + self.aas.say(self.say_4) + self.mtn.rest() + self.mtn.setStiffnesses(self.hips, 1.0) + + def play_sounds(self, stimulus, lang): + ''' + Uploads the stimuli files to Sam using a paramiko sftp server. + Sam then plays the files, then deletes them off its main storage. + ''' + NAO_USERNAME = "nao" + NAO_PASSWORD = "nao" + t = paramiko.Transport((self.ipadress, 22)) + t.connect(username=NAO_USERNAME, password=NAO_PASSWORD) + sftp = paramiko.SFTPClient.from_transport(t) + sftp.chdir('/home/nao/tests/') + remotepath = str('/home/nao/tests/' + stimulus) + + print "trying to upload" + + try: + sftp.put(stimulus, remotepath) + except: + raise ValueError('No file provided for upload.') + for i in range(1, 1000): + dir_list = sftp.listdir() + if stimulus in dir_list: + break + else: + time.sleep(0.01) + if i == 999: + raise ValueError('File was not uploaded to nao') + + # localpath = ( + # 'C:\\Users\\Nao\\Documents\\Nao scripts\\Expe_files\\' + soundfile) + remotepath = str('/home/nao/tests/' + stimulus) + print "uploaded, now playing" + try: + self.aap.playFile(remotepath) + except RuntimeError: + sys.exit(0) + + sftp.remove(stimulus) + time.sleep(0.5) + + return True + + def answer(self, correct_answer, feedback, current_trial, total_trials): + + self.mtn.setStiffnesses(self.hips, 1.0) + self.all.fadeRGB("FaceLeds", "green", 0.01) + start_time = time.time() + current_running_time = 0 + folder = os.path.dirname("./crm/") + ans_file = 'answer.p' + answer = {} + while current_running_time < start_time + 120: + dirs = os.listdir('./crm') + if ans_file in dirs: + try: + with open('./crm/answer.p', 'rb') as f: + answer = pickle.load(f) + break + except EOFError as e: + print e + + current_running_time = time.time() + answer["number"] = int(answer["number"]) + response_time = time.time() - start_time + if feedback: + self.mtn.setStiffnesses(["HeadYaw", "HeadPitch"], [1.0, 1.0]) + if answer["colour"] == correct_answer["colour"] and answer["number"] == correct_answer["number"]: + self.head_nod() + else: + self.head_shake() + self.mtn.setStiffnesses(["HeadYaw", "HeadPitch"], [0.0, 0.0]) + self.all.fadeRGB("FaceLeds", "white", 0.01) + os.remove(os.path.join(folder, ans_file)) + + trial_track = {"current_trial": current_trial + 1, + "total_trials": total_trials} + with open('./crm/trials.p', 'wb') as f: + pickle.dump(trial_track, f) + + print current_trial + + return answer, response_time diff --git a/Robot/RobotEmotion.py b/Robot/RobotEmotion.py new file mode 100644 index 0000000..191d5ea --- /dev/null +++ b/Robot/RobotEmotion.py @@ -0,0 +1,190 @@ +import paramiko +import time +import os +import sys +from naoqi import ALProxy +from Robot import Robot +from RobotGender import RobotGender + + +def printTotals(transferred, toBeTransferred): + print "Transferred: {0}\tOut of: {1}".format(transferred, toBeTransferred) + + +class RobotEmotion(RobotGender): + + def emotionIntro(self): + if self.language == "EN": + self.say_1 = "^start(animations/Stand/Gestures/Explain_2)You are going to hear a voice that sounds either happy, sad, or angry. \ + It is your task to determine the emotion of the voice. \ + ^wait(animations/Stand/Gestures/Explain_2)" + self.say_2 = "\\pau=500\\ During the experiment, when my eyes turn green like this," + self.say_3 = "I am ready for your answer. You can answer by touching my right hand, head, or left hand. Let's try it. \\pau=500\\" + self.say_4 = "\\pau=500\\ Now I will try to make myself as quite as possible so we can get started." + self.say_5 = "Touch my right hand if the voice sounds happy" + self.say_6 = "My head if the voice sounds angry." + self.say_7 = "Or my left hand if the voice sounds sad." + elif self.language == "NL": + if "HIK" in self.subject: + self.say_1 = "^start(animations/Stand/Gestures/Explain_2)Je gaat een stem horen die blij, verdrietig, of boos klinkt. \ + Jouw taak is om te zeggen welke emotie je hebt gehoord. \ + ^wait(animations/Stand/Gestures/Explain_2)" + self.say_2 = "Prima!\\pau=500\\ Tijdens het experiment, als mijn ogen zo groen worden," + self.say_3 = "Mag jij antwoord geven." + self.say_4 = "Nog een ding. Als je het experiment tussendoor wilt stoppen, wacht dan tot ik ben gestopt met praten en raak dan mijn rechtervoet aan. \\pau=500\\ Nou zal ik me nu zo stil mogelijk maken." + self.say_5 = "Als de stem blij klinkt, raak dan mijn rechterhand aan. Probeer maar." + self.say_6 = "Super! \\pau=150\\ Als de stem boos klinkt, raak dan mijn hoofd aan." + self.say_7 = "Heel goed! \\pau=150\\ Of als de stem verdrietig klinkt, raak dan mijn linkerhand aan." + + else: + self.say_1 = "^start(animations/Stand/Gestures/Explain_2)Je gaat een stem horen die blij, verdrietig, of boos klinkt. \ + Jouw taak is om te zeggen welke emotie je hebt gehoord. \ + ^wait(animations/Stand/Gestures/Explain_2)" + self.say_2 = "Prima!\\pau=500\\ Tijdens het experiment, als mijn ogen zo groen worden," + self.say_3 = "Mag jij antwoord geven." + self.say_4 = "Nog een ding. Als je het experiment tussendoor wilt stoppen, wacht dan tot ik ben gestopt met praten en raak dan mijn rechtervoet aan. \\pau=500\\ Nou zal ik me nu zo stil mogelijk maken." + self.say_5 = "Als de stem blij klinkt, raak dan mijn rechterhand aan. Probeer maar." + self.say_6 = "Super! \\pau=150\\ Als de stem boos klinkt, raak dan mijn hoofd aan." + self.say_7 = "Heel goed! \\pau=150\\ Of als de stem verdrietig klinkt, raak dan mijn linkerhand aan." + self.mtn.wakeUp() + self.aas.say(self.say_1) + self.aas.setBodyLanguageMode = 0 + # self.pst.goToPosture("Stand", 0.7) + # self.rightHandMotion(self.say_5) + self.aas.say(self.say_2) + self.all.fadeRGB("FaceLeds", "green", 0.01) + self.tts.say("\\pau=500\\") + self.aas.say(self.say_3) + self.all.fadeRGB("FaceLeds", "white", 0.01) + self.aas.say(self.say_5) + self.rechterhand_beweging() + # self.tts.say("\\pau=250\\") + # self.headMovement(self.say_6) + self.aas.say(self.say_6) + self.hoofd_beweging() + # self.tts.say("\\pau=250\\") + # self.leftHandMove(self.say_7) + self.aas.say(self.say_7) + self.linkerhand_beweging() + self.aas.say(self.say_4) + self.mtn.rest() + self.mtn.setStiffnesses(self.hips, 1.0) + + def play_sounds(self, stimulus, lang): + ''' + Uploads the stimuli files to Sam using a paramiko sftp server. + Sam then plays the files, then deletes them off its main storage. + ''' + NAO_USERNAME = "nao" + NAO_PASSWORD = "nao" + t = paramiko.Transport((self.ipadress, 22)) + t.connect(username=NAO_USERNAME, password=NAO_PASSWORD) + sftp = paramiko.SFTPClient.from_transport(t) + sftp.chdir('/home/nao/tests/') + remotepath = str('/home/nao/tests/' + stimulus) + + try: + sftp.put(stimulus, remotepath) + except: + raise ValueError('No file provided for upload.') + for i in range(1, 1000): + dir_list = sftp.listdir() + if stimulus in dir_list: + break + else: + time.sleep(0.01) + if i == 999: + raise ValueError('File was not uploaded to nao') + + # localpath = ( + # 'C:\\Users\\Nao\\Documents\\Nao scripts\\Expe_files\\' + soundfile) + try: + self.aap.playFile(remotepath) + except RuntimeError: + sys.exit(0) + + sftp.remove(stimulus) + time.sleep(0.5) + + def answer(self, correct_answer, feedback): + self.mtn.setStiffnesses(self.hips, 1.0) + start_time = time.time() + self.all.fadeRGB("FaceLeds", "green", 0.01) + current_running_time = 0 + answer_given = 0 + while current_running_time < (start_time + 120): + try: + head1 = self.mem.getData('RearTactilTouched') + head2 = self.mem.getData('FrontTactilTouched') + head3 = self.mem.getData('MiddleTactilTouched') + head = [head1, head2, head3] + left1 = self.mem.getData('HandLeftRightTouched') + left2 = self.mem.getData('HandLeftBackTouched') + left3 = self.mem.getData('HandLeftLeftTouched') + left = [left1, left2, left3] + right1 = self.mem.getData('HandRightRightTouched') + right2 = self.mem.getData('HandRightBackTouched') + right3 = self.mem.getData('HandRightLeftTouched') + right = [right1, right2, right3] + + if any(right): + answer_given = "happy" + break + elif any(left): + answer_given = "sad" + break + elif any(head): + answer_given = "angry" + break + current_running_time = time.time() + except RuntimeError as e: + print e + sys.exit(0) + if feedback == 1: + self.mtn.setStiffnesses(["HeadYaw", "HeadPitch"], [1.0, 1.0]) + if answer_given == correct_answer: + self.head_nod() + elif answer_given != correct_answer: + self.head_shake() + else: + self.tts.say(self.say_3) + self.mtn.setStiffnesses(["HeadYaw", "HeadPitch"], [0.0, 0.0]) + self.all.fadeRGB("FaceLeds", "white", 0.01) + return answer_given + + def headMovement(self, string): + '''Moves the head down for the subject to test the tactile function of Sam during the introduction.''' + + names = list() + times = list() + keys = list() + + names.append("HeadPitch") + times.append([0.7]) + keys.append([[0.35738, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("HeadYaw") + times.append([0.7]) + keys.append([[-0.0399261, [3, -0.133333, 0], [3, 0, 0]]]) + + try: + motion = ALProxy("ALMotion") + motion.moveInit() + w = motion.post.angleInterpolationBezier(names, times, keys) + self.tts.say(string) + motion.wait(w, 0) + except BaseException, err: + print err + + names.append("HeadPitch") + times.append([0.7]) + keys.append([[-0.17185, [3, -0.133333, 0], [3, 0, 0]]]) + + names.append("HeadYaw") + times.append([0.7]) + keys.append([[-0.0153821, [3, -0.133333, 0], [3, 0, 0]]]) + + try: + self.mtn.angleInterpolationBezier(names, times, keys) + except BaseException, err: + print err diff --git a/Robot/RobotFishy.py b/Robot/RobotFishy.py new file mode 100644 index 0000000..8a7e031 --- /dev/null +++ b/Robot/RobotFishy.py @@ -0,0 +1,180 @@ +from Robot import Robot +import paramiko +import time +import sys + + +class RobotFishy(Robot): + + def fishyIntro(self): + ''' + The intriduction to the experiment. Sam explains how the task will + work and what to do, as well as a demonstration on how to touch + the head and hands + ''' + if self.language == 'EN': + self.say_1 = "^start(animations/Stand/Gestures/Explain_2)You are goint to hear a triplet of three different syllables. \ + One of the triplets is said in a different voice. \ + It is your task to determine which triplet is said in a different voice. \ + You can answer by touching my right hand, \\pau=500\\ head \\pau=500\\or left hand. \ + Lets give it a try. ^wait(animations/Stand/Gestures/Explain_2)" + + self.say_2 = "If the first word is said in a different voice, then touch the top of my right hand. Try it." + self.say_3 = "Great! \\pau=500\\ and if the second sound is said differently, then touch the top of my head." + self.say_4 = "Super! \\pau=500\\ and if the last sound is said in a different voice, then touch the top of my left hand." + self.say_5 = "Very good!. During the experiment, when my eyes turn green like this," + + self.say_6 = "I am ready for your answer." + # self.say_7 = "One last thing. If at any point you want to stop the experiment, wait for me to stop talking, and then press my right foot. \\pau=500\\ Now I will try to make myself as quite as possible." + self.say_7 = "\\pau=500\\ Now I will try to make myself as quite as possible." + elif self.language == 'NL': + self.say_1 = "^start(animations/Stand/Gestures/Explain_2)Je gaat 3 keer een triplet van verschillende lettergrepen horen.\ + 1 van de tripletten wordt gezegd met een andere stem. Het is jouw taak om aan te geven welke anders klinkt. \ + Je kunt antwoorden door je hand op mijn rechterhand, \\pau=500\\ hoofd \\pau=500\\of linkerhand te leggen. \ + Laten we het proberen. ^wait(animations/Stand/Gestures/Explain_2)" + self.say_2 = "Als het eerste woord met een andere stem gezegd wordt, leg je jouw hand op de bovenkant van mijn rechterhand. Probeer maar" + self.say_3 = "Heel goed \\pau=500\\ en als het tweede woord met een andere stem gezegd wordt, leg je jouw hand op de bovenkant van mijn hoofd" + self.say_4 = "Super \\pau=500\\ en als laatste de bovenkant van mijn linkerhand" + self.say_5 = "Heel goed. Dan zal ik me nu zo stil mogelijk maken" + self.mtn.wakeUp() + self.aas.say(self.say_1) + self.aas.setBodyLanguageMode = 0 + self.pst.goToPosture("Stand", 0.7) + self.aas.say(self.say_2) + self.rechterhand_beweging() + self.aas.say(self.say_3) + self.hoofd_beweging() + self.aas.say(self.say_4) + self.linkerhand_beweging() + # time.sleep(1) + self.aas.say(self.say_5) + self.all.fadeRGB("FaceLeds", "green", 0.01) + self.tts.say("\\pau=500\\") + self.aas.say(self.say_6) + self.all.fadeRGB("FaceLeds", "white", 0.01) + self.aas.say(self.say_7) + self.mtn.rest() + self.mtn.setStiffnesses(self.hips, 1.0) + + def play_sounds(self, soundfiles_att): + ''' + Uploads the stimuli files to Sam using a paramiko sftp server. + Sam then plays the files, then deletes them off its main storage. + ''' + soundfiles = list(soundfiles_att.split(", ")) + # soundfiles = [] + # filename = "" + # for i in soundfiles_att: + # if i == ',': + # soundfiles.append(filename) + # filename = '' + # else: + # filename = filename+i + NAO_USERNAME = "nao" + NAO_PASSWORD = "nao" + t = paramiko.Transport((self.ipadress, 22)) + t.connect(username=NAO_USERNAME, password=NAO_PASSWORD) + sftp = paramiko.SFTPClient.from_transport(t) + sftp.chdir('/home/nao/tests/') + for soundfile in soundfiles: + # localpath = ( + # 'C:\\Users\\Nao\\Documents\\Nao\\Python_scripts\\tmp\\' + soundfile) + # localpath = "./" + soundfile.strip() + remotepath = str('/home/nao/tests/' + soundfile) + + try: + sftp.put(soundfile, remotepath) + except: + raise ValueError('Yo cannot find the right stuff') + for i in range(1, 1000): + dir_list = sftp.listdir() + if soundfile in dir_list: + break + else: + time.sleep(0.01) + if i == 999: + raise ValueError('File was not uploaded to nao') + + sys.exit() + for soundfile in soundfiles: + # localpath = ( + # 'C:\\Users\\Nao\\Documents\\Nao scripts\\Expe_files\\' + soundfile) + localpath = "./tmp/" + soundfile + remotepath = str('/home/nao/tests/' + soundfile) + try: + self.aap.playFile(remotepath) + except RuntimeError: + # raise ValueError( + # 'stupid thing needs to be string check type') + sys.exit(0) + + sys.exit(0) + sftp.remove(soundfile) + time.sleep(0.5) + + def answer(self, robot_input): + ''' + Waits for the response from the subject on which of the sounds was different. + ''' + try: + if self.language == 'EN': + self.say_1 = "That is correct." + self.say_2 = "That is incorrect." + self.say_3 = "You did not give an answer." + elif self.language == 'NL': + self.say_1 = "Dat is correct." + self.say_2 = "Dat is niet correct." + self.say_3 = "Je hebt geen antwoord gegeven." + correct_answer = int(robot_input[0]) + feedback = int(robot_input[1]) + # this function returns the answer given by the participant. As input it requires the correct answer (from matlab) and it has an option for feedback (0 or 1). + start_time = time.time() + # LEDs change colour to indicate Sam is ready for a response + self.all.fadeRGB("FaceLeds", "green", 0.01) + current_running_time = 0 + answer_given = 0 + # TODO maybe add a warning after 7 seconds. + # TODO add a way to replay the sounds if necessary? + + while current_running_time < (start_time+120): + # check the data continously for 7 seconds + try: + head1 = self.mem.getData('RearTactilTouched') + head2 = self.mem.getData('FrontTactilTouched') + head3 = self.mem.getData('MiddleTactilTouched') + head = [head1, head2, head3] + left1 = self.mem.getData('HandLeftRightTouched') + left2 = self.mem.getData('HandLeftBackTouched') + left3 = self.mem.getData('HandLeftLeftTouched') + left = [left1, left2, left3] + right1 = self.mem.getData('HandRightRightTouched') + right2 = self.mem.getData('HandRightBackTouched') + right3 = self.mem.getData('HandRightLeftTouched') + right = [right1, right2, right3] + if any(right): + answer_given = 0 + break + elif any(head): + answer_given = 1 + break + elif any(left): + answer_given = 2 + break + current_running_time = time.time() + except RuntimeError: + sys.exit(0) + if feedback == 1: + self.mtn.setStiffnesses(["HeadYaw", "HeadPitch"], [1.0, 1.0]) + if answer_given == correct_answer: + self.head_nod() + elif answer_given != correct_answer: + self.head_shake() + else: + self.tts.say(self.say_3) + self.mtn.setStiffnesses(["HeadYaw", "HeadPitch"], [0.0, 0.0]) + self.all.fadeRGB("FaceLeds", "white", 0.1) + return answer_given + except RuntimeError: + sys.exit(0) + + # === Custom movements === diff --git a/Robot/RobotGender.py b/Robot/RobotGender.py new file mode 100644 index 0000000..ff7b4bc --- /dev/null +++ b/Robot/RobotGender.py @@ -0,0 +1,231 @@ +from naoqi import ALProxy +from Robot import Robot +import paramiko +import time +import sys +import os +import numpy as np + + +class RobotGender(Robot): + + def genderIntro(self): + if self.language == "EN": + self.say_1 = "^start(animations/Stand/Gestures/Explain_2)You are going to hear a voice that sounds either like a boy, or a girl. \ + It is your task to determine the gender of the voice. \ + You can answer by touching my right hand, \\pau=500\\or left hand. \ + Each time you hear a voice, I will tell you which of my hands is for boy, and which hand is for girl. \ + ^wait(animations/Stand/Gestures/Explain_2)" + self.say_2 = "\\pau=500\\ During the experiment, when my eyes turn green like this," + self.say_3 = "I am ready for your answer." + # self.say_4 = "One last thing. If at any point you want to stop the experiment, wait for me to stop talking, and then press my right foot. \\pau=500\\ Now I will try to make myself as quite as possible." + self.say_4 = "Now I will try to make myself as quite as possible." + + if self.language == "NL": + self.say_1 = "^start(animations/Stand/Gestures/Explain_2)Je gaat een stem horen die zoals een jongen of een meisje klinkt. \ + Ik vraag dan aan jou of je de stem van een jongen of een meisje hebt gehoord. \ + Je kunt antwoorden door mijn rechterhand, \\pau=500\\of linkerhand aan te raken. \ + Elke keer als je een stem hoort, zal ik je vertellen welke hand voor jongen is, en welke hand voor meisje is. \ + ^wait(animations/Stand/Gestures/Explain_2)" + self.say_2 = "\\pau=500\\ Tijdens het experiment, als mijn ogen zo groen worden," + self.say_3 = "Mag jij antwoord geven." + self.say_4 = "Nog een ding. Als je het experiment tussendoor wilt stoppen, wacht dan tot ik ben gestopt met praten en raak dan mijn rechtervoet aan. \\pau=500\\ Nou zal ik me nu zo stil mogelijk maken." + + self.mtn.wakeUp() + self.aas.say(self.say_1) + self.aas.setBodyLanguageMode = 0 + self.pst.goToPosture("Stand", 0.7) + self.aas.say(self.say_2) + self.all.fadeRGB("FaceLeds", "green", 0.01) + self.tts.say("\\pau=150\\") + self.aas.say(self.say_3) + self.all.fadeRGB("FaceLeds", "white", 0.01) + self.aas.say(self.say_4) + self.mtn.rest() + self.mtn.setStiffnesses(self.hips, 1.0) + + def play_sounds(self, stimulus, lang): + ''' + Uploads the stimuli files to Sam using a paramiko sftp server. + Sam then plays the files, then deletes them off its main storage. + ''' + + NAO_USERNAME = "nao" + NAO_PASSWORD = "nao" + t = paramiko.Transport((self.ipadress, 22)) + t.connect(username=NAO_USERNAME, password=NAO_PASSWORD) + sftp = paramiko.SFTPClient.from_transport(t) + sftp.chdir('/home/nao/tests/') + remotepath = str('/home/nao/tests/' + stimulus) + + try: + sftp.put(stimulus, remotepath) + except: + raise ValueError('No file provided for upload.') + for i in range(1, 1000): + dir_list = sftp.listdir() + if stimulus in dir_list: + break + else: + time.sleep(0.01) + if i == 999: + raise ValueError('File was not uploaded to nao') + + # localpath = ( + # 'C:\\Users\\Nao\\Documents\\Nao scripts\\Expe_files\\' + soundfile) + remotepath = str('/home/nao/tests/' + stimulus) + try: + self.aap.playFile(remotepath) + except RuntimeError: + # raise ValueError( + # 'stupid thing needs to be string check type') + sys.exit(0) + + sftp.remove(stimulus) + time.sleep(0.5) + + def answer(self): + self.mtn.setStiffnesses(self.hips, 1.0) + self.mtn.setStiffnesses( + ["RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll", "RWristYaw", "LShoulderPitch", "LShoulderRoll", "LElbowYaw", "LElbowRoll", "LWristYaw"], 1.0) + OR = "" + if self.language == "EN": + gender = np.array(["Boy?", "Girl?"]) + OR = "or" + elif self.language == "NL": + gender = np.array(["Jongen?", "Meisje?"]) + OR = "of" + np.random.shuffle(gender) + self.rightHandMotion(gender[0]) + self.tts.say(OR) + self.leftHandMove(gender[1]) + self.mtn.setStiffnesses( + ["RShoulderPitch", "RShoulderRoll", "RElbowYaw", "RElbowRoll", "RWristYaw", "LShoulderPitch", "LShoulderRoll", "LElbowYaw", "LElbowRoll", "LWristYaw"], 0.0) + start_time = time.time() + self.all.fadeRGB("FaceLeds", "green", 0.01) + current_running_time = 0 + answer_given = 0 + gender_chosen = "" + while current_running_time < (start_time + 120): + try: + left1 = self.mem.getData('HandLeftRightTouched') + left2 = self.mem.getData('HandLeftBackTouched') + left3 = self.mem.getData('HandLeftLeftTouched') + left = [left1, left2, left3] + right1 = self.mem.getData('HandRightRightTouched') + right2 = self.mem.getData('HandRightBackTouched') + right3 = self.mem.getData('HandRightLeftTouched') + right = [right1, right2, right3] + + if any(right): + answer_given = 1 + gender_chosen = gender[0].split(" ")[-1][:-1] + break + elif any(left): + answer_given = 2 + gender_chosen = gender[1].split(" ")[-1][:-1] + break + current_running_time = time.time() + except RuntimeError: + sys.exit(0) + self.all.fadeRGB("FaceLeds", "white", 0.01) + resp = {"answer": answer_given, "gender": gender_chosen} + return resp, gender_chosen + + # === Custom movements === + + def rightHandMotion(self, gender): + + # Choregraphe bezier export in Python. + names = list() + times = list() + keys = list() + + names.append("RElbowRoll") + times.append([1, 1.48, 1.96]) + keys.append([[0.90817, [3, -0.333333, 0], [3, 0.16, 0]], [0.909704, + [3, -0.16, 0], [3, 0.16, 0]], [0.865218, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("RElbowYaw") + times.append([1, 1.48, 1.96]) + keys.append([[0.493906, [3, -0.333333, 0], [3, 0.16, 0]], [1.00626, + [3, -0.16, 0], [3, 0.16, 0]], [0.486236, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("RHand") + times.append([1, 1.48, 1.96]) + keys.append([[0.3544, [3, -0.333333, 0], [3, 0.16, 0]], [0.3544, + [3, -0.16, 0], [3, 0.16, 0]], [0.3544, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("RShoulderPitch") + times.append([1, 1.48, 1.96]) + keys.append([[1.21804, [3, -0.333333, 0], [3, 0.16, 0]], [1.05083, + [3, -0.16, 0], [3, 0.16, 0]], [1.23338, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("RShoulderRoll") + times.append([1, 1.48, 1.96]) + keys.append([[-0.0552659, [3, -0.333333, 0], [3, 0.16, 0]], [-0.305308, + [3, -0.16, 0], [3, 0.16, 0]], [0.0229681, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("RWristYaw") + times.append([1, 1.48, 1.96]) + keys.append([[0.23466, [3, -0.333333, 0], [3, 0.16, 0]], [1.41737, + [3, -0.16, 0], [3, 0.16, 0]], [0.0429101, [3, -0.16, 0], [3, 0, 0]]]) + + try: + # uncomment the following line and modify the IP if you use this script outside Choregraphe. + # motion = ALProxy("ALMotion", IP, 9559) + motion = ALProxy("ALMotion") + motion.moveInit() + w = motion.post.angleInterpolationBezier(names, times, keys) + self.tts.say(gender) + motion.wait(w, 0) + except BaseException, err: + print err + + def leftHandMove(self, gender): + + # Choregraphe bezier export in Python. + names = list() + times = list() + keys = list() + + names.append("LElbowRoll") + times.append([1, 1.48]) + keys.append([[-1.03848, [3, -0.333333, 0], [3, 0.16, 0]], + [-1.04921, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("LElbowYaw") + times.append([1, 1.48]) + keys.append([[-1.71505, [3, -0.333333, 0], [3, 0.16, 0]], + [-1.49416, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("LHand") + times.append([1, 1.48]) + keys.append([[0.0296, [3, -0.333333, 0], [3, 0.16, 0]], + [0.0296, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("LShoulderPitch") + times.append([1, 1.48]) + keys.append([[1.20875, [3, -0.333333, 0], [3, 0.16, 0]], + [1.53856, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("LShoulderRoll") + times.append([1, 1.48]) + keys.append([[0.171766, [3, -0.333333, 0], [3, 0.16, 0]], + [-0.220938, [3, -0.16, 0], [3, 0, 0]]]) + + names.append("LWristYaw") + times.append([1, 1.48]) + keys.append([[-0.983336, [3, -0.333333, 0], [3, 0.16, 0]], + [0.96331, [3, -0.16, 0], [3, 0, 0]]]) + + try: + # uncomment the following line and modify the IP if you use this script outside Choregraphe. + # motion = ALProxy("ALMotion", IP, 9559) + motion = ALProxy("ALMotion") + motion.moveInit() + w = motion.post.angleInterpolationBezier(names, times, keys) + self.tts.say(gender) + motion.wait(w, 0) + except BaseException, err: + print err diff --git a/Robot/__init__.py b/Robot/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/calibration.mat b/calibration.mat new file mode 100644 index 0000000..080734e Binary files /dev/null and b/calibration.mat differ diff --git a/calibration.py b/calibration.py new file mode 100644 index 0000000..52bc36e --- /dev/null +++ b/calibration.py @@ -0,0 +1,194 @@ +import numpy as np +import importlib +import os +import soundfile as sf +import sounddevice as sd +import scipy.signal as sis +from picka_definition import main as pickaDef +from tools.to_noise import noise +from gender.cosgate import cosgate +from tools.load_matrix import loadmat +from scipy.io import savemat +from Robot.Robot import Robot +from naoqi import ALBroker +from tools.exit_condition import ExitExperimentModule + + +def main(language, game, att, interface): + # TODO Add interface part + # gain_field_colour = np.array([6.3, 74.5, 41.6]) / 100 * .4 + .6 + + calibration = {} + att = float(att) + + if not os.path.exists('./calibration.mat'): + calibration["fishy"] = 0 + calibration["gender"] = 0 + calibration["emotion"] = 0 + calibration["crm"] = 0 + else: + mat = loadmat('./calibration.mat') + calibration = mat["calibration"] + + options = {} + options["subject_name"] = "" + options["language"] = language + + if game == "fishy": + folder = "./fishy" + fx_prefix = "expe" + calibration["fishy"] = att + elif game == "gender": + folder = "./gender" + fx_prefix = "gender" + options["phase"] = "generation" + options["language"] = language + calibration["gender"] = att + elif game == "emotion": + folder = "./emotion" + fx_prefix = "emotion" + calibration["emotion"] = att + elif game == "crm": + folder = "./crm" + fx_prefix = "crm" + calibration["crm"] = att + + scripts = [] + PICKA = pickaDef() + + for i in range(len(PICKA)): + scripts.append(os.path.join( + PICKA["def" + str(i)]["folder"], PICKA["def" + str(i)]["prefix"])) + + length_sample = 30 + spectrum_max = -np.inf + + experiments = {} + + # for i in range(len(scripts)): + # script = scripts[i] + # folder, fx_prefix = os.path.split(script) + experiments["scr" + str(i)] = {} + experiments["scr" + str(i)]["folder"] = folder + experiments["scr" + str(i)]["fx_prefix"] = fx_prefix + + # os.chdir(folder) + # print os.getcwd() + # try: + + package = folder.split("/")[1] + fh_options = importlib.import_module( + "..{}_options".format(fx_prefix), package="{}.{}_options".format(package, fx_prefix)) + fh_build = importlib.import_module( + "..{}_build_conditions".format(fx_prefix), package="{}.{}_build_conditions".format(package, fx_prefix)) + + experiments["scr" + str(i)]["fh_options"] = fh_options + experiments["scr" + str(i)]["fh_build"] = fh_build + + options = fh_options.expe_options(options) + _, options = fh_build.expe_build_conditions(options) + + if not "sounds_for_calibration" in options: + raise ValueError( + "Options does not contain sounds_for_calibration") + + if len(options["sounds_for_calibration"]) == 0: + raise ValueError( + "There are no sounds for calibration. Try preprocessing first.") + + print "Checking if RMS of calibration sounds are equal." + + x = np.array([]) + + RMSs = np.zeros(len(options["sounds_for_calibration"])) + + previous_fs = [] + + for k in range(len(options["sounds_for_calibration"])): + y, fs = sf.read(options["sounds_for_calibration"][k]) + + if previous_fs and previous_fs != fs: + raise ValueError("File {} does not have the same sampling frequency ({} Hz) as the previous one ({} Hz).".format( + options["sounds_for_calibration"][k], fs, previous_fs)) + previous_fs = fs + + RMSs[k] = np.sqrt(np.mean(y**2)) + x = np.hstack((x, y)) + + mRMS = np.mean(RMSs) + + print "RMS: min=%.3f, avg=%.3f, max=%.3f" % ( + np.min(RMSs), mRMS, np.max(RMSs)) + + print "The sampling frequency is %d Hz." % fs + print "Converting to noise..." + print np.size(x) + + noisy_x = noise(x, fs) + + if len(noisy_x) < fs*length_sample: + noisy_x = np.tile(noisy_x, int(np.ceil( + fs*length_sample/len(noisy_x)))) + + noisy_x = noisy_x[:np.min(len(noisy_x))] + + NOISY_X = 20 * np.log10(np.abs(np.fft.fft(noisy_x)) / + np.sqrt(len(noisy_x))) + + w = sis.hann(256) + w = w / np.sum(w) + + NOISY_X = np.convolve(NOISY_X, w, mode='same') + + f = (np.arange(len(noisy_x)))/(len(noisy_x)) * fs + + spectrum_max = np.max(np.array([spectrum_max, int(max(NOISY_X))])) + + experiments["scr" + str(i)]["fs"] = fs + experiments["scr" + str(i)]["noise"] = cosgate(noisy_x, fs, 50e-3) + + experiments["scr" + str(i)]["noise"] = experiments["scr" + + str(i)]["noise"] * 10.0 ** att/20 + + # experiments["scr" + str(i)]["gain"] = fh_gain + if interface == "laptop": + sd.play(experiments["scr" + str(i)]["noise"], fs) + elif interface.lower() == "sam": + + sam = Robot("sam.local", 9559, language) + sam.aad.setOutputVolume(sam.stimulus_volume) + sf.write("calibration_{}.wav".format(game), + experiments["scr" + str(i)]["noise"], fs) + sam.play_audio("calibration_{}.wav".format(game)) + + r = raw_input("Save this attenuation value?: ") + + if r.lower() == "y": + savemat('./calibration.mat', mdict={"calibration": calibration}) + elif r.lower() == 'n': + pass + else: + raise ValueError("That is not a valid option.") + + print "done" + + # except: + # raise Exception("Error") + + +if __name__ == "__main__": + import argparse + myBroker = ALBroker("myBroker", "0.0.0.0", 0, "sam.local", 9559) + stop_audio = ExitExperimentModule("stop_audio", myBroker) + + parser = argparse.ArgumentParser() + parser.add_argument( + "--language", "-l", help="Language of sound files to calibrate.", choices=["EN", "NL"]) + parser.add_argument("--game", "-g", help="Game for calibration", + choices=["fishy", "gender", "emotion", "crm"]) + parser.add_argument("--attenuation", "-a", + help="Attenuation to be applied.") + parser.add_argument( + "--interface", "-i", help="Interface that calibration must be perfored for.", choices=["sam", "laptop"]) + args = parser.parse_args() + main(args.language, args.game, args.attenuation, args.interface) diff --git a/crm/__init__.py b/crm/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/crm/crm_build_conditions.py b/crm/crm_build_conditions.py new file mode 100644 index 0000000..07b6f5b --- /dev/null +++ b/crm/crm_build_conditions.py @@ -0,0 +1,236 @@ +import numpy as np +import os + +from pick import pick +from parse_corpus import parseCorpus +from scipy.io import savemat +import warnings +from tools.load_matrix import loadmat + +CALIBRATE = False + + +def expe_build_conditions(options): + options["fs"] = 44100 + options["gain"] = 0 + mat = loadmat('./calibration.mat') + cal = mat["calibration"] + options["attenuation_dB"] = cal["crm"] + # options["attenuation_dB"] = 10 # Calibrated attenuation from fishy + + options["target_corpus_language"] = options["language"] + options["target_corpus_path"] = "./stimuli/crm/spk1F-" + \ + options["language"].lower() + + if options["target_corpus_language"] == "tr_tr": + options["target_corpus_filemask"] = 'cat_*.wav' + else: + options["target_corpus_filemask"] = 'dog_*.wav' + + options["target_corpus"] = parseCorpus(options["target_corpus_path"], + options["target_corpus_filemask"]) + + options["n_colours"] = len(options["target_corpus"]["colours"]) + options["n_numbers"] = len(options["target_corpus"]["numbers"]) + options["n_call_signs"] = len(options["target_corpus"]["call_signs"]) + + np.random.shuffle(options["target_corpus"]["colours"]) + + if options["target_corpus_language"] == "tr_tr": + options["images"] = "girl+cat.jpg" + else: + options["images"] = "woman+dog.jpg" + + # Masker options + options["masker_corpus_language"] = options["language"] + options["masker_corpus_path"] = options["target_corpus_path"] + if options["target_corpus_language"] == "tr_tr": + options["masker_corpus_filemask"] = "rabbit_*.wav" + else: + options["masker_corpus_filemask"] = "cat_*.wav" + + lst = [ + f for f in os.listdir(options["masker_corpus_path"]) + if f.startswith(options["masker_corpus_filemask"].split('_')[0]) + and f.endswith('.wav') + ] + options["masker_corpus"] = lst + + options["sounds_for_calibration"] = [] + + lst = [ + f for f in os.listdir(options["target_corpus_path"]) + if f.startswith(options["target_corpus_filemask"].split('_')[0]) + and f.endswith('.wav') + ] + + if not CALIBRATE: + for k in range(len(lst)): + options["sounds_for_calibration"].append( + os.path.join(options["target_corpus_path"], lst[k])) + + for k in range(len(options["masker_corpus"])): + options["sounds_for_calibration"].append( + os.path.join(options["masker_corpus_path"], lst[k])) + else: + for k in range(10): + options["sounds_for_calibration"].append( + os.path.join(options["target_corpus_path"], lst[k])) + + for k in range(10): + options["sounds_for_calibration"].append( + os.path.join(options["masker_corpus_path"], lst[k])) + + options["cache_path"] = "./stimuli_store/crm/spk1F-" + \ + options["masker_corpus_language"].lower() + + if not os.path.exists(options["cache_path"]): + os.makedirs(options["cache_path"]) + + options["voices"] = {} + + i = 1 + + for dF0 in np.linspace(0, -12, 3): + for dVTL in np.linspace(0, 3.8, 3): + options["voices"]["v" + str(i)] = {} + options["voices"]["v" + str(i)]["dF0"] = dF0 + options["voices"]["v" + str(i)]["dVTL"] = dVTL + i += 1 + + options["n_voices"] = len(options["voices"]) + + # Check if NH or HI + grp = "" + if "subject_name" in options and options["subject_name"] != "": + grp = options["subject_name"][0:2] + else: + grp = "NH" + if grp == "NH": + options["tmrs"] = np.array([-6, 0, 6, np.inf]) + elif grp == "HI" or grp == "CI": + options["tmrs"] = np.array([0, 6, 12, np.inf]) + + # Strategy on hoe to change the TMR + # - In the 'louder_constant' strategy, the TMR is such that we keep the target level constant for TMRs>0, and the masker level constant for TMRs<0 + # - In the 'constant_level' strategy, we keep the overall level constant + + options["tmr_strategy"] = 'constant_level' + + options["target_delay"] = 750e-3 + options["masker_end_delay"] = 250e-3 + options["masker_min_chunk_duration"] = 150e-3 + options["masker_max_chunk_duration"] = 300e-3 + options["masker_chunk_ramp"] = 2e-3 + options["masker_ramp"] = 50e-3 + + options["test"] = {} + options["training"] = {} + + options["test"]["n_repeat"] = 7 + options["training"]["n_repeat"] = 1 + + options["training"]["block_size"] = 20 + options["test"]["block_size"] = 30 + + test = {} + + for i_repeat in range(options["test"]["n_repeat"]): + for i_tmr in range(len(options["tmrs"])): + if options["tmrs"][i_tmr] == np.inf: + i_voices = np.array([1]) + else: + i_voices = np.array([1, 3, 7, 9]) + + for i_voice in i_voices: + trial = {} + trial["target"] = {} + + trial["target"]["colour"], trial["target"][ + "colour_index"] = pick(options["target_corpus"]["colours"]) + number, trial["target"]["number_index"] = pick( + options["target_corpus"]["numbers"]) + + trial["target"]["number"] = int(number) + + trial["target"]["call_sign"] = options[ + "target_corpus_filemask"].split('_')[0] + trial["target"]["sound_file"] = '{}_{}_{}.wav'.format( + trial["target"]["call_sign"], trial["target"]["colour"], + trial["target"]["number"]) + + trial["image"] = options["images"][0] + + trial["voice"] = options["voices"]["v" + str(i_voice)] + trial["voice"]["index"] = i_voice + + trial["i_repeat"] = i_repeat + trial["tmr"] = options["tmrs"][i_tmr] + trial["visual_feedback"] = 1 + trial["done"] = 0 + + if 'trials' not in test: + test["trials"] = [trial] + else: + test["trials"].append(trial) + + np.random.shuffle(test["trials"]) + + training = {} + i = 1 + for i_repeat in range(options["training"]["n_repeat"]): + for i_voice in range(options["n_voices"]): + + trial = {} + trial["target"] = {} + + trial["target"]["colour"], trial["target"]["colour_index"] = pick( + options["target_corpus"]["colours"]) + number, trial["target"]["number_index"] = pick( + options["target_corpus"]["numbers"]) + + trial["target"]["number"] = int(number) + + trial["target"]["call_sign"] = options[ + "target_corpus_filemask"].split('_')[0] + trial["target"]["sound_file"] = '{}_{}_{}.wav'.format( + trial["target"]["call_sign"], trial["target"]["colour"], + trial["target"]["number"]) + + trial["image"] = options["images"][0] + + trial["voice"] = options["voices"]["v" + str(i_voice + 1)] + trial["voice"]["index"] = i_voice + + trial["i_repeat"] = i_repeat + + if i <= 2: + trial["tmr"] = np.inf + else: + trial["tmr"] = 6 + i += 1 + + trial["visual_feedback"] = 1 + trial["done"] = 0 + + if 'trials' not in training: + training["trials"] = [trial] + else: + training["trials"].append(trial) + + training_short = {} + training_short["trials"] = training["trials"][:4] + expe = {} + expe["test"] = test + expe["training"] = training_short + + if "res_filename" in options: + savemat(options["res_filename"], + mdict={ + "expe": expe, + "options": options + }) + else: + warnings.warn("The test file was not saved: no filename provided") + + return expe, options diff --git a/crm/crm_make_stimulus.py b/crm/crm_make_stimulus.py new file mode 100644 index 0000000..4af161e --- /dev/null +++ b/crm/crm_make_stimulus.py @@ -0,0 +1,326 @@ +import os +import sys +from resampy import resample +from scipy.signal import resample_poly +import nnresample +import soundfile as sf +import numpy as np +from pick import pick +from pyworld import pyworld as pw +from gender.cosgate import cosgate +import scipy.io as spio +from scipy import interpolate as spi +from tools.load_matrix import loadmat + +np.set_printoptions(threshold=sys.maxsize) + + +def makeStim(options, trial, is_demo=False): + # trial["target"]["sound_file"] = 'dog_green_8.wav' + + print "Reading soundfile '{}' as target...\n".format( + trial["target"]["sound_file"]) + + x, fs = sf.read(os.path.join( + options["target_corpus_path"], trial["target"]["sound_file"])) + + # if fs != options["fs"]: + # x = resample(x, fs, options["fs"], filter='kaiser_fast') + # fs = options["fs"] + + x_rms = np.sqrt(np.mean(x**2)) + + options["reference_rms"] = x_rms + + if trial["tmr"] < np.inf: + x = (x / x_rms) * 10 ** (trial["tmr"]/20.0) + else: + x = x / x_rms + + options["target_delay"] = 750e-3 + options["masker_end_delay"] = 250e-3 + + target = np.array([]) + + target = np.append(target, np.zeros( + int(np.round(options["target_delay"] * fs)))) + target = np.append(target, x) + target = np.append(target, np.zeros( + int(np.round(options["masker_end_delay"] * fs)))) + + masker, masker_dict = create_masker(options, trial, len(target)) + + masker_rms = np.sqrt(np.nanmean(masker**2)) + if trial["tmr"] < np.inf: + masker = masker / masker_rms + else: + masker = 0 * masker + + z = np.add(target, masker) + + z_rms = np.sqrt(np.nanmean(z ** 2)) + + z = z/z_rms * options["reference_rms"] + + info = {} + + info["masker"] = masker_dict + + + return z, fs, info + + +def create_masker(options, trial, n_samples): + fs = options["fs"] + + masker_dict = {} + masker = np.array([]) + + n_chunk = 1 + + while len(masker) < n_samples: + sound_file, _ = pick(options["masker_corpus"]) + # sound_file = 'cat_pink_6.wav' + masker_dict["stim_" + str(n_chunk)] = {} + masker_dict["stim_" + str(n_chunk)]["soundfile"] = sound_file + + y, fs = pyworld_process(os.path.join( + options["masker_corpus_path"], sound_file.strip()), trial["voice"]["dF0"], trial["voice"]["dVTL"], options) + # y = y * np.power(10, -options["attenuation_dB"]/20.0) + y = y * 10.0 ** (options["attenuation_dB"]/20) + + chunk_duration = np.random.rand() * (options["masker_max_chunk_duration"] - + options["masker_min_chunk_duration"]) + options["masker_min_chunk_duration"] + chunk_duration = np.round(chunk_duration*fs) + + chunk_start = np.random.randint(len(y)-chunk_duration) + + chunk_ind = chunk_start + np.array([0, chunk_duration-1]) + masker_dict["stim_" + str(n_chunk)]["chunk_indices"] = chunk_ind + + chunk = y[int(chunk_ind[0]):int(chunk_ind[1])] + + chunk = cosgate(chunk, fs, options["masker_chunk_ramp"]) + + masker = np.append(masker, chunk) + + n_chunk = n_chunk + 1 + + masker = masker[:n_samples] + masker = cosgate(masker, fs, options["masker_ramp"]) + + return masker, masker_dict + + +def pyworld_process(wavIn, dF0, dVTL, options): + # dF0 = 0 + # dVTL = 0 + _, wavIn_file = os.path.split(wavIn) + wavIn_name, _ = os.path.splitext(wavIn_file) + cache_path = options["cache_path"] + + wavOut = make_fname(wavIn, dF0, dVTL, cache_path) + + if not os.path.exists(wavOut) or options["force_rebuild_straight_output"]: + if not os.path.exists(cache_path): + os.mkdir(cache_path) + + mat = os.path.join(cache_path, wavIn_name + ".pyworld.mat") + + f0 = [] + fs = 0 + sp = [] + ap = [] + x_rms = 0 + + if os.path.exists(mat): + load_mat = loadmat(mat) + f0 = load_mat['f0'] + fs = load_mat['fs'] + freq = load_mat['frequencies'] + sp = load_mat['sp'] + ap = load_mat['ap'] + t = load_mat['temporal_positions'] + x_rms = load_mat['x_rms'] + else: + x, fs = sf.read(wavIn) + + # if fs != options['fs']: + # x = resample(x, fs, options["fs"], filter='kaiser_best') + # fs = options["fs"] + _f0, t = pw.dio(x, fs) + + f0, sp, ap = pw.wav2world(x, fs) + freq = np.arange(0, np.size(sp, axis=1), + dtype='float64') / (np.size(sp)) * fs/2 + x_rms = np.sqrt(np.mean(x**2)) + duration = len(x/fs) + + # spio.savemat(mat, mdict={'fs': fs, 'f0': f0, + # 'sp': sp, 'ap': ap, + # 'x_rms': x_rms, + # 'frequencies': freq, + # 'temporal_positions': t, + # 'duration': duration + # }) + + f0 = f0 * 2.0 ** (dF0/12) + mapp = mapp * 2.0 ** -(dVTL/12) + + f0 = f0 * mapp + + nfft = (sp.shape[1]-1)*2 + f = np.arange(sp.shape[1]) / float(nfft) * float(fs) + t = np.arange(sp.shape[0]) / pw.default_frame_period + + sp = Fast2DInterp(t, f, sp, type="cubic")(t, f) + ap = Fast2DInterp(t, f, ap, type="cubic")(t, f) + + # sp = sp_ap_creation(sp, t, f, mapp) + # ap = sp_ap_creation(ap, t, f, mapp) + # if f0.flags['C_CONTIGUOUS']: + # f0 = np.ascontiguousarray(f0, dtype=np.float) + # # sp = np.ascontiguousarray( + # # sp, dtype=np.float) + # # ap = np.ascontiguousarray( + # # ap, dtype=np.float) + f0, sp, ap = regularize_arrays(f0, sp, ap) + y_mat = pw.synthesize(f0, sp, ap, fs) + + y = np.array(y_mat) + + y = y / np.sqrt(np.mean(y ** 2)) * x_rms + + my = np.amax(np.absolute(y)) + + if np.amax(np.absolute(y)) > 1: + # expe_logger.warn("Output was normalised for {}".format(wavOut)) + y_magnitude_factor = my/0.98 + y = 0.98 * y / np.amax(np.absolute(y)) + else: + y_magnitude_factor = 1.0 + + sf.write(wavOut, y, fs) + + else: + y, fs = sf.read(wavOut) + + return y, fs + + +def make_fname(wav, f0, vtl, destPath): + _, namext = os.path.split(wav) + name, ext = os.path.splitext(namext) + + fname = "{}_dF0{}_dVTL{}{}".format(name, f0, vtl, ext) + fname = os.path.join(destPath, fname) + + return fname + + +def sp_ap_creation(mat, temp, freq, vtl, type='cubic'): + ''' + Interpolates the spectrogram and aperiodicity, respectively + using the same temporal positions, but new freq that takes + into account the ser value (ser = np.power(2, -dVTL/12)). + Ser is usually provided by the defined options in + expe_build_conditions + ''' + # x = np.arange(1, mat.shape[1]+1) + # y = np.arange(1, mat.shape[0]+1) + + # f = interpolate.interp2d(x, y, mat, kind='cubic') + # f = interpolate.RectBivariateSpline(temp, freq, mat) + + if type == 'cubic': + f = spi.RectBivariateSpline(temp, freq, mat) + elif type == 'linear': + f = spi.interp2d(freq, temp, mat, kind='linear') + else: + raise ValueError('Interpolant type unknown: "%s"' % type) + + if vtl != 0.0: + interp = f(temp, freq.T/vtl) + else: + interp = f(temp, freq.T/1.0) + + return interp + + # xs = np.arange(1, spe["spectrogram"].shape[1]+1) + # ys = np.arange(1, spe["spectrogram"].shape[0]+1) + # fis = interp2d(xs, ys, spe["spectrogram"], 'cubic') + # spe["spectrogram"] = fis(spe["temporal_positions"], + # spe["frequencies"]/ser) + + +def regularize_arrays(*args): + """ + Making sure the arrays passed as arguments are in the right format for pyworld. + """ + out = list() + for x in args: + out.append(np.require(x, requirements='C')) + return tuple(out) + + +class Fast2DInterp(): + """ + Creates an interpolant object based on ``scipy.interpolate.RectBivariateSpline`` but + dealing with out of range values. + The constructor is: ``Fast2DInterp(x, y, z, ofrv=None)`` where ``x`` and ``y`` + are 1D arrays and ``z`` is a 2D array. The optional argument ``ofrv`` defines + the value used for out of range inputs. If ``ofrv`` is ``None``, then the + default behaviour of ``RectBivariateSpline`` is kept, i.e. the closest value is + returned. + The default type is ``linear``, which then makes use of ``scipy.interpolate.interp2d``. + With ``cubic``, the ``RectBivariateSpline`` is used. + Note that the class is not so useful in the end when used with ``linear``, but + is useful if you want to use cubic-splines. + """ + + def __init__(self, x, y, z, ofrv=None, type='linear'): + self.type = type + + if self.type == 'cubic': + self.interpolant = spi.RectBivariateSpline(x, y, z) + elif self.type == 'linear': + self.interpolant = spi.interp2d(y, x, z, kind='linear') + else: + raise ValueError('Interpolant type unknown: "%s"' % type) + + self.x_range = (x[0], x[-1]) + self.y_range = (y[0], y[-1]) + + # Out of range value: + self.ofrv = ofrv + + def is_in_range(self, w, r): + return np.logical_and(w >= r[0], w <= r[1]) + + def __call__(self, x, y): + return self.interp(x, y) + + def interp_(self, x, y): + if self.type == 'cubic': + return self.interpolant(x, y) + elif self.type == 'linear': + return self.interpolant(y, x) + + def interp(self, x, y): + if (np.isscalar(x) or len(x) == 1) and (np.isscalar(y) or len(y) == 1): + if self.ofrv is not None: + if self.is_in_range(x, self.x_range) and self.is_in_range(y, self.y_range): + o = self.interp_(x, y)[0, 0] + else: + o = self.ofrv + else: + o = self.interp_(x, y)[0, 0] + else: + o = self.interp_(x, y) + + if self.ofrv is not None: + s = np.logical_and(self.is_in_range( + xx, self.x_range), self.is_in_range(yy, self.y_range)) + o[s] = self.ofrv + + return o diff --git a/crm/crm_options.py b/crm/crm_options.py new file mode 100644 index 0000000..f065f2e --- /dev/null +++ b/crm/crm_options.py @@ -0,0 +1,18 @@ +import os + + +def expe_options(options): + + options["result_path"] = "./results/" + options["subject_name"] + + if not os.path.exists(options["result_path"]): + os.mkdir(options["result_path"]) + + options["result_prefix"] = "crm_" + + options["experiment_label"] = "PICKA :: CRM" + + options["force_rebuild_straight_output"] = False + options["experiment_begin"] = 1 + + return options diff --git a/crm/crm_robot.py b/crm/crm_robot.py new file mode 100644 index 0000000..23b4dc8 --- /dev/null +++ b/crm/crm_robot.py @@ -0,0 +1,219 @@ +import numpy as np +import soundfile as sf +import time +import datetime +import sys +import os +import cPickle as pickle +from tools.load_matrix import loadmat +from scipy.io import savemat +from Robot.RobotCRM import RobotCRM +from crm_make_stimulus import makeStim + + +def robot(ip, port, lang, options, phase): + results = {} + sam = RobotCRM(ip, port, lang, options["subject_name"]) + try: + saveFromPickle(options) + except IOError: + pass + mat = loadmat(options["res_filename"]) + expe = mat["expe"] + options = mat["options"] + if "results" in mat: + results = mat["results"] + + track = loadmat(options["res_tracker"]) + exp = track["tracker"] + + nbreak = 0 + starting = 1 + + simulate = False + + done = [] + while np.mean(done) != 1: + done = [] + for i in range(len(expe[phase]["trials"])): + done.append(expe[phase]["trials"][i]["done"]) + nbreak += 1 + if nbreak > options[phase]["block_size"]: + nbreak = 0 + # TODO: Something to add a break. + try: + i_trial = done.index(0) + except ValueError: + break + track_trial = i_trial + 1 + if exp["experiment_begin"]: + trials = { + "current_trial": track_trial, + "total_trials": len(expe[phase]["trials"]) + } + with open('./crm/trials.p', 'wb') as f: + pickle.dump(trials, f) + time.sleep(5) + # sam.intro() + exp["experiment_begin"] = 0 + savemat(options["res_tracker"], mdict={"tracker": exp}) + if starting: + trials = { + "current_trial": track_trial, + "total_trials": len(expe[phase]["trials"]) + } + with open('./crm/trials.p', 'wb') as f: + pickle.dump(trials, f) + if phase == "test": + if lang == "EN": + sam.simple_say("Welcome to the testing phase of the game.") + elif lang == "NL": + sam.simple_say( + "Welkom bij de testronde van dit spelletje.") + else: + # sam.crmIntro() + pass + # sam.crmIntro() + sam.game_break() + + if phase == "test" and i_trial == np.round(len(done) / 2): + if lang == "EN": + sam.simple_say("You've reached halfway.") + if lang == "NL": + sam.simple_say("") + sam.take_break() + + starting = 0 + + # for i in range(len(expe[phase]["trials"])): + # done.append(expe[phase]["trials"][i]["done"]) + # nbreak += 1 + # if nbreak > options[phase]["block_size"]: + # nbreak = 0 + # # TODO: Something to add a break. + + # try: + # i_trial = done.index(0) + # except ValueError: + # break + + trial = expe[phase]["trials"][i_trial] + + xOut, fs, info = makeStim(options, trial) + + # xOut = xOut*np.power(10, options["attenuation_dB"]/20) + xOut = xOut * 10.0**(options["attenuation_dB"] / 20) + + m = np.max(np.abs(xOut)) + + if m > .98: + xOut = xOut / m * .98 + print "xOut was rescaled to avoid clipping by a factor %.2f" % ( + 0.98 / m) + sf.write('stimulus.wav', xOut, fs) + correct_answer = { + "colour": trial["target"]["colour"], + "number": trial["target"]["number"] + } + # === Play stimulus then delete file + sam.aad.setOutputVolume(sam.stimulus_volume) + sam.play_sounds('stimulus.wav', lang) + sam.aad.setOutputVolume(sam.speaking_volume) + + # os.remove('stimulus.wav) + + # === Get response + + response = {} + + response["timestamp"] = str(datetime.datetime.now()) + if not simulate: + resp, resp_time = sam.answer(correct_answer, + trial["visual_feedback"], track_trial, + len(expe[phase]["trials"])) + + else: + resp = {"number": 4, "colour": "pink"} + resp_time = 1.0 + response["response_time(ms)"] = round(resp_time * 100, 2) + # resp = correct_answer + response["colour"] = resp["colour"] + response["number"] = resp["number"] + response["correct"] = response["colour"] == correct_answer[ + "colour"] and response["number"] == correct_answer["number"] + response["info"] = info + response["trial"] = trial + + # === Save results + if not phase in results: + results[phase] = {} + results[phase]["responses"] = np.array([response]) + else: + results[phase]["responses"] = np.append( + results[phase]["responses"], response) + + expe[phase]["trials"][i_trial]["done"] = 1 + a = time.time() + + pickle.dump( + expe, open("{}/expe_temp.p".format(options["result_path"]), 'wb')) + pickle.dump( + options, + open("{}/options_temp.p".format(options["result_path"]), 'wb')) + pickle.dump( + results, + open("{}/results_temp.p".format(options["result_path"]), 'wb')) + + print "results saved: " + str(time.time() - a) + + if phase == "training": + if lang == "EN": + sam.simple_say("That's the end of the training phase.") + elif lang == "NL": + sam.simple_say("Dit is het einde van de oefenronde ") + else: + exp["experiments"]["crm"] = 1 + savemat(options["res_tracker"], mdict={"tracker": exp}) + if lang == "EN": + sam.simple_say("That's the end of the testing phase. Well done.") + elif lang == "NL": + sam.simple_say("Dit is het einde van de test. Goed gedaan.") + exp_tracker = np.array( + [exp["experiments"][key] for key in exp["experiments"].keys()]) + + saveFromPickle(options) + + if np.mean(exp_tracker) == 1: + sam.ending() + + # except: + # saveFromPickle(options) + # savemat(options["res_filename"], mdict={ + # "expe": expe, "options": opt, "results": results}) + + +def saveFromPickle(options): + print "-------" + print "Loading results" + print "-------" + try: + expe = pickle.load( + open("{}/expe_temp.p".format(options["result_path"]), 'rb')) + opt = pickle.load( + open("{}/options_temp.p".format(options["result_path"]), 'rb')) + results = pickle.load( + open("{}/results_temp.p".format(options["result_path"]), 'rb')) + + os.remove("{}/expe_temp.p".format(options["result_path"])) + os.remove("{}/options_temp.p".format(options["result_path"])) + os.remove("{}/results_temp.p".format(options["result_path"])) + savemat(options["res_filename"], + mdict={ + "expe": expe, + "options": opt, + "results": results + }) + except Exception as e: + print e + + return diff --git a/crm/crm_run.py b/crm/crm_run.py new file mode 100644 index 0000000..b1302de --- /dev/null +++ b/crm/crm_run.py @@ -0,0 +1,42 @@ +import os +from crm_options import expe_options as crmOptions +from scipy.io import savemat +from crm_robot import robot +from crm_build_conditions import expe_build_conditions as buildConditions +from tools.load_matrix import loadmat + + +def main(options, subject, phase, lang, p_exists, ip, port): + options = {} + options["subject_name"] = subject + options = crmOptions(options) + + options["language"] = lang + + res_filename = os.path.join(options["result_path"], '{}{}_{}_robot.mat'.format( + options["result_prefix"], lang.lower(), subject)) + options["res_filename"] = res_filename + + res_tracker = os.path.join( + options["result_path"], '{}_tracker.mat'.format(subject)) + options["res_tracker"] = res_tracker + if not os.path.exists(res_tracker): + track = {} + track["experiment_begin"] = 1 + + track["experiments"] = {} + track["experiments"]["fishy"] = 0 + track["experiments"]["gender"] = 0 + track["experiments"]["emotion"] = 0 + track["experiments"]["crm"] = 0 + + savemat(res_tracker, mdict={"tracker": track}) + + if not os.path.exists(res_filename): + expe, options = buildConditions(options) + else: + mat = loadmat(options["res_filename"]) + expe = mat["expe"] + options = mat["options"] + + robot(ip, port, lang, options, phase) diff --git a/crm/parse_corpus.py b/crm/parse_corpus.py new file mode 100644 index 0000000..5c671bd --- /dev/null +++ b/crm/parse_corpus.py @@ -0,0 +1,28 @@ +import os +import numpy as np + + +def parseCorpus(folder, filemask): + + lst = [f for f in os.listdir( + folder) if f.startswith(filemask.split('_')[0])] + call_signs = [] + colours = [] + numbers = [] + + for i in range(len(lst)): + _, filename = os.path.split(lst[i]) + f, _ = os.path.splitext(filename) + + parts = f.split('_') + + call_signs.append(parts[0]) + colours.append(parts[1]) + numbers.append(int(parts[2])) + + corpus = {} + corpus["call_signs"] = np.unique(call_signs) + corpus["colours"] = np.unique(colours) + corpus["numbers"] = np.unique(numbers) + + return corpus diff --git a/crm/pick.py b/crm/pick.py new file mode 100644 index 0000000..74db596 --- /dev/null +++ b/crm/pick.py @@ -0,0 +1,14 @@ +import numpy as np + + +def pick(lst): + if len(locals()) < 2: + n = 1 + + lst = np.array(lst) + # i = np.random.permutation(len(lst)) + i = np.random.randint(len(lst)) + + k = lst[i] + + return k, i diff --git a/crm/preprocess_corpus.py b/crm/preprocess_corpus.py new file mode 100644 index 0000000..c7d0892 --- /dev/null +++ b/crm/preprocess_corpus.py @@ -0,0 +1,50 @@ +import os +import numpy as np +from crm_options import expe_options as crmOptions +from crm_build_conditions import expe_build_conditions as buildConditions +from crm_make_stimulus import pyworld_process + + +def preprocess(mode, language, force): + options = {} + options["language"] = language + options["subject_name"] = "" + options = crmOptions(options) + + expe, options = buildConditions(options) + + options["force_rebuild_pyworld_output"] = force + + print "=== Analysing all masker files ===" + + for i in range(len(options["masker_corpus"])): + fname = options["masker_corpus"][i] + fname = os.path.join(options["masker_corpus_path"], fname) + print "%02d/%d Analysing '%s' \n" % (i + 1, + len(options["masker_corpus"]), fname) + for j in range(1, len(options["voices"]) + 1): + + voice = options["voices"]["v" + str(j)] + pyworld_process(fname, voice["dF0"], voice["dVTL"], options) + + if mode == "all": + print "=== Synthesizing for all masker files ===" + trials = expe["training"]["trials"] + expe["test"]["trials"] + + k = 1 + + for i in range(len(trials)): + trial = trials[i] + + for j in range(len(options["masker_corpus"])): + fname = options["masker_corpus"][j] + fname = os.path.join( + options["masker_corpus_path"], fname) + print "%04d/%d Synthesizing'%s' for dF0=%.2f st, dVTL=%.2f st\n" % (k, len(trials) * len( + options["masker_corpus"]), fname, trial["voice"]["dF0"], trial["voice"]["dVTL"]) + pyworld_process( + fname, trial["voice"]["dF0"], trial["voice"]["dVTL"], options) + + k += 1 + + print "\n" diff --git a/emotion/__init__.py b/emotion/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/emotion/emotion_build_conditions.py b/emotion/emotion_build_conditions.py new file mode 100644 index 0000000..0830f8f --- /dev/null +++ b/emotion/emotion_build_conditions.py @@ -0,0 +1,187 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# Paolo Toffanin , RuG, UMCG, Groningen, NL +# Jacqueline Libert +# Leanne Nagels < leanne.nagels@rug.nl > +# Etienne Gaudrain - 2017-12-05 +# CNRS, CRNL, Lyon, FR | RuG, UMCG, Groningen, NL +# ------ Python ------ +# 2020-04-13: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- + +import numpy as np +from scipy import io as sio +import warnings +import os +import re +from tools.load_matrix import loadmat + + +def expe_build_conditions(options): + ''' + Creates the EXPE structure that contains the trials for the PICKA + Emotion experiment. + + Note: the emotion names listed in options[test][emotions] must coincide + with the file names of the sound material, as well as with the file + names of the sprite images. + ''' + # options["sound_folder"] = "./stimuli/emotion/en" + options["sound_folder"] = "./stimuli/emotion/" + options["sound_filemask"] = ".wav" + + mat = loadmat('./calibration.mat') + cal = mat["calibration"] + options["attenuation_dB"] = cal["emotion"] + # Parse the corpus + options = parse_corpus(options) + + # Select emotions for test + options["test"]["emotions"] = ['angry', 'sad', 'happy'] + options["order_button_emotions"] = np.random.permutation( + options["test"]["emotions"]) + + # Select emotions for training + options["training"]["emotions"] = ['angry', 'sad', 'happy'] + options["order_button_emotions"] = np.random.permutation( + options["training"]["emotions"]) + + for e in range(len(options["test"]["emotions"])): + if options["test"]["emotions"][e] not in options["test"]["corpus"]: + raise ValueError("Emotion '{}' was not found in the selected corpus...".format( + options["test"]["emotions"][e])) + + # Number of repetitions per emotion + options["test"]["n_repeat"] = float("Inf") + + # === Create the test trials === + + test = {} + + for i_emotion in range(len(options["test"]["emotions"])): + emotion = options["test"]["emotions"][i_emotion] + n = len(options["test"]["corpus"][emotion]) + + if np.isinf(options["test"]["n_repeat"]): + item_order = np.array(range(0, n)) + else: + item_order = [] + while len(item_order) < options["test"]["n_repeat"]: + item_order.append(np.random.permutation( + np.min([options["test"]["n_repeat"], n]))) + + for ir in range(int(np.min([options["test"]["n_repeat"], len(item_order)]))): + trial = options["test"]["corpus"][emotion][item_order[ir]] + trial["emotion"] = emotion + + trial["i_repeat"] = ir + trial["done"] = 0 + + if not "trials" in test: + test["trials"] = [trial] + else: + test["trials"].append(trial) + expe = {} + expe["test"] = {} + expe["test"]["trials"] = np.random.permutation(test["trials"]) + + # === Create the training trials === + training = {} + + for i_trial in range(len(options["training"]["corpus"])): + trial = options["training"]["corpus"][i_trial] + trial["done"] = 0 + + if not "trials" in training: + training["trials"] = [trial] + else: + training["trials"].append(trial) + + expe["training"] = {} + expe["training"]["trials"] = np.random.permutation(training["trials"]) + + if "res_filename" in options: + sio.savemat(options["res_filename"], mdict={ + 'expe': expe, 'options': options}) + else: + warnings.warn("The test file was not saved: no filename provided.") + + return expe, options + + +def parse_corpus(options): + + options["sounds_for_calibration"] = {} + if not "test" in options: + options["test"] = {} + + if not "training" in options: + options["training"] = {} + + options["test"]["corpus"] = {} + + lst = [f for f in os.listdir(os.path.join( + options["sound_folder"])) if f.endswith(options["sound_filemask"])] + + for k in range(len(lst)): + options["sounds_for_calibration"][k] = os.path.join( + options["sound_folder"], lst[k]) + + _, fname = os.path.split(lst[k]) + + tokens = re.split("[" + re.escape("_") + "]", fname) + + if tokens[0] == "training": + item = {} + item["file"] = lst[k] + item["talker"] = float(tokens[1][1:]) + item["emotion"] = tokens[2] + item["sentence"] = float(tokens[3][1:]) + item["utterance"] = float(tokens[4][1:].split(".")[0]) + + if not "corpus" in options["training"]: + options["training"]["corpus"] = [item] + else: + options["training"]["corpus"].append(item) + else: + item = {} + item["file"] = lst[k] + item["talker"] = float(tokens[0][1:]) + emotion = tokens[1] + item["sentence"] = float(tokens[2][1:]) + item["utterance"] = float(tokens[3][1:].split(".")[0]) + + if not emotion in options["test"]["corpus"]: + options["test"]["corpus"][emotion] = [item] + else: + options["test"]["corpus"][emotion].append(item) + + return options + + +def explode(sep, string): + rem = string + table = [] + while rem: + tokens = re.split("[" + re.escape(sep) + "]", rem) + token = tokens[0] + rem = sep.join(tokens[1:]) + table.append(token) + return table diff --git a/emotion/emotion_options.py b/emotion/emotion_options.py new file mode 100644 index 0000000..53bc824 --- /dev/null +++ b/emotion/emotion_options.py @@ -0,0 +1,49 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# Paolo Toffanin , RuG, UMCG, Groningen, NL +# Jacqueline Libert +# Leanne Nagels < leanne.nagels@rug.nl > +# Etienne Gaudrain - 2017-12-05 +# CNRS, CRNL, Lyon, FR | RuG, UMCG, Groningen, NL +# ------ Python ------ +# 2020-04-13: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- +import os + + +def expe_options(options): + options["result_path"] = "./results/" + options["subject_name"] + + if not os.path.exists(options["result_path"]): + os.mkdir(options["result_path"]) + + # result prefix + options["result_prefix"] = "emo_" + + # label + options["experiment_label"] = "PICKA :: Emotion" + + # options["subject_age"] = subject["age"] + # options["subject_sex"] = subject["sex"] + options["res_filename"] = os.path.join(options["result_path"], "{}{}_{}_robot.mat".format( + options["result_prefix"], options["language"].lower(), options["subject_name"])) + options["experiment_begin"] = 1 + + return options diff --git a/emotion/emotion_robot.py b/emotion/emotion_robot.py new file mode 100644 index 0000000..90cdc43 --- /dev/null +++ b/emotion/emotion_robot.py @@ -0,0 +1,169 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# Paolo Toffanin , RuG, UMCG, Groningen, NL +# Jacqueline Libert +# Leanne Nagels < leanne.nagels@rug.nl > +# Etienne Gaudrain - 2017-12-05 +# CNRS, CRNL, Lyon, FR | RuG, UMCG, Groningen, NL +# ------ Python ------ +# 2020-04-13: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- +import os +import numpy as np +import soundfile as sf +import datetime +import time +from Robot.RobotEmotion import RobotEmotion +from tools.load_matrix import loadmat +from scipy import io as sio + + +def robot(ip, port, lang, options, phase): + # -- Start an instance of SAM + sam = RobotEmotion(ip, port, lang) + # -- Set initial volume + # NAO + simulateSubj = False + + if options["subject_name"] == "test": + simulateSubj = True + + # Create the result dictionary and load the subject's results/options file + results = {} + + mat_contents = loadmat(options["res_filename"]) + expe = mat_contents['expe'] + options = mat_contents['options'] + + track = loadmat(options["res_tracker"]) + exp = track["tracker"] + + if not "gain" in options: + options["gain"] = 0 + + # === Main Loop === + ladderstep = 1 + starting = 1 + + itrial_session = 0 + + done = [] + # === Main Loop that runs experiment === + while np.mean(done) != 1: + # Reintialises the done array and reappend for when a task has been completed + done = [] + + for i in range(len(expe[phase]["trials"])): + done.append(expe[phase]["trials"][i]["done"]) + + try: + i_trial = done.index(0) + itrial_session = itrial_session + 1 + except ValueError: + break + + print "Trial {} of {}".format(itrial_session, len(done) + 1) + if exp["experiment_begin"]: + # NAO + sam.intro() + exp["experiment_begin"] = 0 + sio.savemat(options["res_tracker"], mdict={"tracker": exp}) + if starting: + if phase == "test": + if lang == "EN": + sam.simple_say("Welcome to the testing phase of the game.") + elif lang == "NL": + sam.simple_say( + "Welkom bij de testronde van dit spelletje.") + + else: + # NAO + sam.emotionIntro() + pass + sam.game_break() + + starting = 0 + + trial = expe[phase]["trials"][i_trial] + + # y, fs = sf.read(os.path.join(options["sound_folder"], trial["file"])) + os.chdir(options["sound_folder"]) + x, fs = sf.read(trial["file"]) + x = x * 10.0 ** options["attenuation_dB"]/20 + sf.write('./gen_stimulus.wav', x, fs) + # NAO + sam.aad.setOutputVolume(sam.stimulus_volume) + sam.play_sounds('gen_stimulus.wav', lang) + sam.aad.setOutputVolume(sam.speaking_volume) + os.remove('./gen_stimulus.wav') + + os.chdir('../../') + tic = time.time() + response = {} + response["trial"] = trial + + if simulateSubj: + # response["timestamp"] = datetime.datetime.now() + response["response_time(ms)"] = round((time.time() - tic)*100, 2) + response["emotion"] = options[phase]["emotions"][np.random.randint( + len(options[phase]["emotions"]))] + response["correct"] = response["emotion"] == trial["emotion"] + else: + response["timestamp"] = datetime.datetime.now() + response["emotion"] = sam.answer(trial["emotion"], 1) + response["response_time"] = round((time.time() - tic)*100, 2) + response["correct"] = response["emotion"] == trial["emotion"] + + print("Clicked button: {}\n".format(response["emotion"])) + print("Response time: {} ms\n".format( + round(response["response_time"] * 1000))) + print("Response correct: {} \n\n".format(response["correct"])) + + expe[phase]["trials"][i_trial]["done"] = 1 + + if not phase in results: + results[phase] = {} + results[phase]["responses"] = [response] + else: + results[phase]["responses"].append(response) + + sio.savemat(options["res_filename"], mdict={ + "options": options, "expe": expe, "results": results}) + if phase == "training": + if lang == "EN": + sam.simple_say("That's the end of the training phase") + elif lang == "NL": + sam.simple_say("Dit is het einde van de oefenronde ") + else: + + exp["experiments"]["emotion"] = 1 + sio.savemat(options["res_tracker"], mdict={"tracker": exp}) + if lang == "EN": + sam.simple_say( + "That's the end of the testing phase, and the end of this game.") + elif lang == "NL": + sam.simple_say( + "Dit is het einde van de test, en het einde van dit spelletje.") + + exp_tracker = np.array([exp["experiments"][key] + for key in exp["experiments"].keys()]) + + if np.mean(exp_tracker) == 1: + sam.ending() diff --git a/emotion/emotion_run.py b/emotion/emotion_run.py new file mode 100644 index 0000000..d2c2a5a --- /dev/null +++ b/emotion/emotion_run.py @@ -0,0 +1,95 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# Paolo Toffanin , RuG, UMCG, Groningen, NL +# Jacqueline Libert +# Leanne Nagels < leanne.nagels@rug.nl > +# Etienne Gaudrain - 2017-12-05 +# CNRS, CRNL, Lyon, FR | RuG, UMCG, Groningen, NL +# ------ Python ------ +# 2020-04-13: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- +import os +import sys +from scipy.io import savemat +from emotion_options import expe_options as emotion_options +from emotion_build_conditions import expe_build_conditions as build_conditions +from emotion_robot import robot + + +def main(options, subject, phase, lang, p_exists, ip, port): + options = {} + options["subject_name"] = subject + options["language"] = lang + options = emotion_options(options) + if p_exists is not None: + + res_tracker = os.path.join( + options["result_path"], '{}_tracker.mat'.format(subject)) + options["res_tracker"] = res_tracker + if not os.path.exists(res_tracker): + track = {} + track["experiment_begin"] = 1 + track["experiments"] = {} + track["experiments"]["fishy"] = 0 + track["experiments"]["gender"] = 0 + track["experiments"]["emotion"] = 0 + track["experiments"]["crm"] = 0 + + savemat(res_tracker, mdict={"tracker": track}) + + if not p_exists: + build_conditions(options) + else: + res_tracker = os.path.join( + options["result_path"], '{}_tracker.mat'.format(subject)) + options["res_tracker"] = res_tracker + if not os.path.exists(res_tracker): + track = {} + track["experiment_begin"] = 1 + track["experiments"] = {} + track["experiments"]["fishy"] = 0 + track["experiments"]["gender"] = 0 + track["experiments"]["emotion"] = 0 + track["experiments"]["crm"] = 0 + + savemat(res_tracker, mdict={"tracker": track}) + + if not os.path.exists(options["res_filename"]): + msg = "The subject '{}' does not exist. Create it?".format( + options["subject_name"]) + print msg + ans = raw_input("(Y/n): ") + + if ans.lower() == 'y': + build_conditions(options) + elif ans.lower() == 'n': + sys.exit() + else: + raise "that is not a valid choice" + + else: + msg = "Found {}. Use this file?".format(subject) + print msg + ans = raw_input("(Y/n): ") + + if ans.lower() == 'n': + sys.exit() + + robot(ip, port, lang, options, phase) diff --git a/fishy/__init__.py b/fishy/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/fishy/expe_build_conditions.py b/fishy/expe_build_conditions.py new file mode 100644 index 0000000..f81cd0f --- /dev/null +++ b/fishy/expe_build_conditions.py @@ -0,0 +1,327 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# 2010-03-15: Etienne Gaudrain < etienne.gaudrain@mrc-cbu.cam.ac.uk > +# 2011-10-20: Etienne Gaudrain < etienne.gaudrain@mrc-cbu.cam.ac.uk > +# 2013-04-22: Etienne Gaudrain < e.p.c.gaudrain@rug.nl > +# 2017-03-27: Etienne Gaudrain < etienne.gaudrain@cnrs.fr > +# ------ Python ------ +# 2020-01-28: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- +from expe_options import expe_options +from collections import OrderedDict +import warnings +import scipy.io as sio +import cPickle +import random +import numpy as np +import glob +import os +from tools.load_matrix import loadmat + + +def expe_build_conditions(options): + ''' + This function creates the list of conditions that will be tested in the + experiment. + + Without argument, it just returns the `expe` structure as well as the + list of `options`. + + With an option argument that contains a `res_filename` field, it saves + them in a result file. + + Modify the "Build test block" section to change which conditions are to + be stested. + + WARNING: Once saved in a result file, the conditions are not modified + anymore at runtime even if the code is modified. This is done on purpose + so that we always know what were the options used for a specific + experimental session. + ''' + + # If all syllables need to be rebuilt (overwrites cached files) + FORCE_REBUIL_SYLLS = 0 + # --- GUI options --- + options["instructions"] = {} + options["instructions"]["training"] = "You are going to hear three triplets of different syllables. \n" +\ + "One of the triplets is said with a different voice. \n" +\ + "Your task is to click on the button that corresponds to the different voice. \n" + + options["instructions"]["test"] = options["instructions"]["training"] + # --- Signal options --- + options["fs"] = 44100 + # options["attenuation_dB"] = 27 # General attenuation + + mat = loadmat('./calibration.mat') + cal = mat["calibration"] + options["attenuation_dB"] = cal["fishy"] # Calibrated attenuation + options["ear"] = "both" # right, left, or both + + # --- Design specifications --- + + options["test"] = {} + options["test"]["n_repeat"] = 1 # Number of repetition per condition + options["test"]["step_size_modifier"] = 1/np.sqrt(2) + # When difference <= to this times the step-size, decrease the step size + options["test"]["change_step_size_condition"] = 2 + # Change step-size every n trials + options["test"]["change_step_size_n_trials"] = 15 + options["test"]["initial_step_size"] = 2 # Semitones + options["test"]["starting_difference"] = 12 # Semitones + options["test"]["down_up"] = np.array([2, 1]) # 2-down, 1-up => 70.7% + options["test"]["terminate_on_n_turns"] = 8 + options["test"]["terminate_on_n_trials"] = 100 + options["test"]["retry"] = 1 # number of retries if measure failed + options["test"]["threshold_on_last_n_trials"] = 6 + + options["training"] = {} + options["training"]["n_repeat"] = 1 # Number of repetition per condition + options["training"]["step_size_modifier"] = 1 + # When difference <= to this times the step-size, decrease the step size + options["training"]["change_step_size_condition"] = 1 + # Change step-size every n trials + options["training"]["change_step_size_n_trials"] = 15 + options["training"]["initial_step_size"] = 3 # Semitones + options["training"]["starting_difference"] = 6 # Semitones + options["training"]["down_up"] = np.array([2, 1]) # 2-down, 1-up => 70.7% + options["training"]["terminate_on_n_turns"] = 0 + options["training"]["terminate_on_n_trials"] = 6 + options["training"]["retry"] = 0 # number of retries if measure failed + options["training"]["threshold_on_last_n_trials"] = 5 + + # --- Stimuli options --- + ref_f0 = 242.0 # This is the average pitch of the original voice + options["ref_f0"] = ref_f0 + + options["test"]["voices"] = {} + options["test"]["voices"]["v1"] = {} + options["test"]["voices"]["v1"]["label"] = 'female' + options["test"]["voices"]["v1"]["f0"] = ref_f0 + options["test"]["voices"]["v1"]["ser"] = 1.0 + + options["test"]["voices"]["v2"] = {} + options["test"]["voices"]["v2"]["label"] = 'male' + options["test"]["voices"]["v2"]["f0"] = ref_f0/2.0 + options["test"]["voices"]["v2"]["ser"] = 1 * np.power(2, -3.8/12) + + options["test"]["voices"]["v3"] = {} + options["test"]["voices"]["v3"]["label"] = 'child' + options["test"]["voices"]["v3"]["f0"] = round(ref_f0*np.power(2, 5.0/12)) + options["test"]["voices"]["v3"]["ser"] = 1 * np.power(2, 7.0/12) + + options["test"]["voices"]["v4"] = {} + options["test"]["voices"]["v4"]["label"] = 'male-gpr' + options["test"]["voices"]["v4"]["f0"] = ref_f0/2.0 + options["test"]["voices"]["v4"]["ser"] = 1.0 + + options["test"]["voices"]["v5"] = {} + options["test"]["voices"]["v5"]["label"] = 'male-vtl' + options["test"]["voices"]["v5"]["f0"] = options["test"]["voices"]["v1"]["f0"] + options["test"]["voices"]["v5"]["ser"] = 1 * np.power(2, -3.8/12) + + options["test"]["voices"]["v6"] = {} + options["test"]["voices"]["v6"]["label"] = 'child-gpr' + options["test"]["voices"]["v6"]["f0"] = round(ref_f0*np.power(2, 5.0/12)) + options["test"]["voices"]["v6"]["ser"] = 1.0 + + options["test"]["voices"]["v7"] = {} + options["test"]["voices"]["v7"]["label"] = 'child-vtl' + options["test"]["voices"]["v7"]["f0"] = options["test"]["voices"]["v1"]["f0"] + options["test"]["voices"]["v7"]["ser"] = 1 * np.power(2, 7.0/12) + + options["training"]["voices"] = options["test"]["voices"] + # -- Voice pairing choices + # 1 2 : female -> Male + # 1 4 : Female -> Male GPR + # 1 5 : Female -> Male VTL + # 1 3 : Female -> Child + # 1 6 : Female -> Child GPR + # 1 7 : Female -> Child VTL + + options["test"]["voice_pairs"] = np.matrix('1 4; 1 5; 1 6; 1 7') + options["training"]["voice_pairs"] = np.matrix('1 2; 1 3') + + if options["language"] == "EN": + options["sound_path"] = './stimuli/fishy/en' + options["sound_path_store"] = './stimuli_store/en' + options["tmp_path"] = './tmp/en' + elif options["language"] == "NL": + options["sound_path"] = './stimuli/fishy/nl' + options["sound_path_store"] = './stimuli_store/nl' + options["tmp_path"] = './tmp/nl' + + if not os.path.exists(options["tmp_path"]): + os.mkdir(options["tmp_path"]) + + if not os.path.exists(options["sound_path_store"]): + os.mkdir(options["sound_path_store"]) + + syllable_list = [] + + dir_waves = [f for f in os.listdir( + options["sound_path"]) if f.endswith(".wav")] + + for file in dir_waves: + if file.endswith(".wav"): + syllable_list.append(file) + + for i in range(len(syllable_list)): + syllable_list[i] = syllable_list[i].replace('.wav', '') + + options["syllables"] = np.array(syllable_list) + + options["sounds_for_calibration"] = [] + + for f in range(len(dir_waves)): + options["sounds_for_calibration"].append( + os.path.join(options["sound_path"], dir_waves[f])) + + options["n_syll"] = 3 + + options["inter_syllable_silence"] = 50.0e-3 + options["syllable_duration"] = 200.0e-3 + + options["f0_contour_step_size"] = 1.0/3.0 # semitones + # options["f0_contours"] = np.array([[-1, 0, +1], [+1, 0, -1], np.add([-1.0, 1.0, -1.0], 1.0/3), np.subtract([1, -1, 1], 1.0/3), np.add( + # [-1, -1, 1], 1.0/3), np.subtract([1, 1, -1], 1.0/3), np.subtract([-1, 1, 1], 1.0/3), np.add([1, -1, -1], 1.0/3)]) + options["f0_contours"] = np.array([[1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [ + 1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 1.0]]) + options["inter_triplet_interval"] = 250.0e-3 + options["force_rebuild_sylls"] = FORCE_REBUIL_SYLLS + + # --- Vocoder options --- + # Base Parameters + p = {} + p["envelope"] = {} + p["envelope"]["method"] = 'low-pass' + p["envelope"]["rectify"] = 'half-wave' + p["envelope"]["order"] = 2 + + p["synth"] = {} + p["synth"]["carrier"] = 'noise' + p["synth"]["filter_before"] = False + p["synth"]["filter_after"] = True + p["synth"]["f0"] = 1.0 + + options["vocoder"] = {} + options["vocoder"]['v1'] = {} + options["vocoder"]['v1']["label"] = 'noise' + options["vocoder"]['v1']["description"] = 'Noise-band vocoder, 6 bands from 1250 to 7000, envelope cutoff defined per band.' + options["vocoder"]['v1']["parameters"] = p + + options["vocoder"]['v2'] = {} + options["vocoder"]['v2']["label"] = 'sin' + options["vocoder"]['v2']["description"] = 'Sinewave vocoder, 6 bands from 1250 to 7000, envelope cutoff defined per band, not refiltered after modulation.' + options["vocoder"]['v2']["parameters"] = p + options["vocoder"]['v2']["parameters"]["synth"]["carrier"] = 'sin' + options["vocoder"]['v2']["parameters"]["synth"]["filter_after"] = False + + options["vocoder"]['v3'] = {} + options["vocoder"]['v3']["label"] = 'lownoise' + options["vocoder"]['v3']["description"] = 'Low-noise-noise-band vocoder, 6 bands from 1250 to 7000, envelope cutoff defined per band.' + options["vocoder"]['v3']["parameters"] = p + options["vocoder"]['v3']["parameters"]["synth"]["carrier"] = 'low-noise' + + options["vocoder"]["v4"] = {} + options["vocoder"]['v4']["label"] = 'pshc' + options["vocoder"]['v4']["description"] = 'PSHC vocoder, 6 bands from 1250 to 7000, envelope cutoff defined per band.' + options["vocoder"]['v4']["parameters"] = p + options["vocoder"]['v4']["parameters"]["synth"]["carrier"] = 'pshc' + + # === Build test block === + + test = {} + + # def update(d1, d2): + # for k, v in d2.items(): + # if k in d1 and isinstance(v, dict) and isinstance(d1[k], dict): + # update(d1[k], v) + # else: + # d1[k] = v + + m, _ = options["test"]["voice_pairs"].shape + for ir in range(options["test"]["n_repeat"]): + for i_vp in range(m): # iterate for each row in voice_pairs + condition = {} + + condition["ref_voice"] = options["test"]["voice_pairs"][i_vp, 0] + condition["dir_voice"] = options["test"]["voice_pairs"][i_vp, 1] + + condition["visual_feedback"] = 1.0 + condition["sound_feedback"] = 1.0 + + # Should not be removed + condition["i_repeat"] = ir + condition["done"] = 0 + condition["attempts"] = 0 + + if not "conditions" in test: + test["conditions"] = [condition] + else: + test["conditions"].append(condition) + + # items = test["conditions"].items() + test["conditions"] = random.sample( + test["conditions"], len(test["conditions"])) + + # === Build training block === + + training = {} + + m, _ = options["training"]["voice_pairs"].shape + for ir in range(options["training"]["n_repeat"]): + for i_vp in range(m): # iterate for each row in voice_pairs + condition = {} + + condition["ref_voice"] = options["training"]["voice_pairs"][i_vp, 0] + condition["dir_voice"] = options["training"]["voice_pairs"][i_vp, 1] + + condition["visual_feedback"] = 1.0 + condition["sound_feedback"] = 1.0 + + # Should not be removed + condition["i_repeat"] = ir + condition["done"] = 0 + condition["attempts"] = 0 + + if not "conditions" in training: + training["conditions"] = [condition] + else: + training["conditions"].append(condition) + + # items = test["conditions"].items() + # Randomise the order of the conditions + training["conditions"] = random.sample( + training["conditions"], len(training["conditions"])) + + # === Create expe dictionary and save .mat file === + expe = {} + + expe["test"] = test + expe["training"] = training + + if "res_filename" in options: + # with open(options["res_filename"], 'w') as f: + # cPickle.dump([options, expe, p], f) + sio.savemat(options["res_filename"], mdict={ + 'expe': expe, 'options': options, 'p': p}) + else: + warnings.warn("The test file was not saved: no filename provided.") + return expe, options diff --git a/fishy/expe_make_stim.py b/fishy/expe_make_stim.py new file mode 100644 index 0000000..f6cc2df --- /dev/null +++ b/fishy/expe_make_stim.py @@ -0,0 +1,339 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# 2010-03-16: Etienne Gaudrain +# 2011-10-20: Etienne Gaudrain +# 2013-04-22: Etienne Gaudrain +# 2017-03-27: Etienne Gaudrain +# ------ Python ------ +# 2020-02-10: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- + +from pyworld import pyworld as pw +import numpy as np +import os +import math +import warnings +import logging +from time import clock +from scipy import interpolate +import scipy.io as spio +import soundfile as sf +from resampy import resample +import random +import collections +import matplotlib.pyplot as plt +# from audiotsm import phasevocoder +# from audiotsm.io.wav import WavReader, WavWriter +from tools.load_matrix import loadmat + +import sys + +# -- Uncomment for when using the MATLAB/Python API --- +# import matlab.engine +# future = matlab.engine.start_matlab(async=True) +# eng = future.result() +# eng.addpath('../Nao-PICKA scripts/Expe_files/lib/STRAIGHTV40_006b') + + +time_logger = logging.getLogger("time_logger") +expe_logger = logging.getLogger("expe_logger") + + +def expe_make_stim(options, trial, p): + ''' + Generates the stimuli files for a given trial + and how the trial has been specified + ''' + + xOut_temp = collections.OrderedDict() + f0 = [trial["f0"][0], trial["f0"][1]] + ser = [trial["ser"][0], trial["ser"][1]] + + for i in range(len(trial["syllables"])): + + sylls = trial["syllables"][i] + x = np.array([]) + + for j in range(len(sylls)): + + tmp = f0[i] + octave = options["f0_contour_step_size"] * \ + (trial["f0_contours"][j, i] / 12.0) + + sf0 = tmp * np.power(2, octave) + t = clock() + y, fs = straight_process(sylls[j], sf0, ser[i], options, p, trial) + # y = y * np.power(10, -options["attenuation_dB"]/20.0) + y = y * 10 ** options["attenuation_dB"]/20.0 + stim_time = clock() - t + time_logger.info( + "Time to generate single stimulus: {}".format(stim_time)) + + if fs != options["fs"]: + y = resample(y, options["fs"], fs, filter="kaiser_fast") + options["fs"] = fs + + d1 = int(round(options["syllable_duration"]*fs) - len(y)) + + if d1 > 0: + # Adds padding because the syllable signal is too short + npad_L = int(math.floor(d1/20)) + npad_R = int(d1-npad_L) + + nr = int(math.floor(1e-3 * fs)) + y[0:nr] = y[0:nr] * np.linspace(0, 1, num=nr).conj().T + y[len(y)-nr:] = y[len(y)-nr:] * np.linspace(1, 0, num=nr).T + + y = np.concatenate( + (np.zeros((npad_L,)), y, np.zeros((npad_R,)))) + + elif d1 < 0: + # The synthesised signal is too long + y = y[0:len(y)-d1] + nr = int(math.floor(1e-3 * fs)) # 1 ms linear ramp at the end + y[len(y)-nr:] = y[len(y)-nr:] * np.linspace(1, 0, num=nr).T + + else: + nr = int(math.floor(1e-3 * fs)) + y[0:nr] = y[0:nr] * np.linspace(0, 1, num=nr).conj().T + y[len(y)-nr:] = y[len(y)-nr:] * np.linspace(1, 0, num=nr).T + + x = np.concatenate((x, y)) + zeros = np.zeros( + (int(math.floor(fs*options["inter_syllable_silence"])),)) + + if j != len(sylls): + x = np.concatenate((x, zeros)) + + # TODO come back to coding in the vocoder + # if trial["vocoder"] > 0: + # pass + + if options["ear"] == 'right': + x = np.matrix([np.zeros(np.size(x))], x) + elif options["ear"] == 'left': + x = np.matrix([x], [np.zeros(np.size(x))]) + elif options["ear"] == 'both': + x = np.tile(x, (2, 1)).T + else: + raise ValueError( + "Options.ear = {} is not implemented.".format(options["ear"])) + + if i == 0: + xOut_temp[0] = x + xOut_temp[1] = x + else: + xOut_temp[2] = x + + # Create a random permutation array according to the length of xOut_temp + i_order = np.random.permutation(len(xOut_temp)) + + keys = list(xOut_temp.keys()) + keys = [keys[i] for i in i_order] + # Create the ordered dictionary that holds the randomised stimuli in the order given + xOut = collections.OrderedDict() + i = 0 + for key in keys: + xOut[i] = xOut_temp[key] + i += 1 + i_correct = np.where(i_order == 2) + i_correct = i_correct[0][0] + + return xOut, fs, i_correct + + +def straight_process(syll, t_f0, ser, options, p, trial): + ''' + Generates the individual stimuli files + ''' + + wavIn = os.path.join(options["sound_path"], syll + ".wav") + wavOut = make_fname( + wavIn, t_f0, ser, options["syllable_duration"], options["tmp_path"], trial) + y = [] + fs = 0 + + if not os.path.exists(wavOut) or options["force_rebuild_sylls"]: + + # Matlab + # mat = os.path.join(options["sound_path"], syll + '.straight.mat') + # PyWorld + mat = os.path.join(options["sound_path_store"], syll + '.pyworld.mat') + # Intialise varibales so they are accessible in the correct scope + f0 = [] + fs = 0 + sp = [] + ap = [] + freq = [] + temp_pos = [] + x_rms = 0 + + if os.path.exists(mat): + # Load the data from the .mat file + load_mat = loadmat(mat) + f0 = load_mat['f0'] + fs = load_mat['fs'] + sp = np.array(load_mat['sp']) + ap = np.array(load_mat['ap']) + # Needed for PyWorld + freq = np.array(load_mat["frequencies"]) + temp_pos = np.array(load_mat["temporal_positions"]) + x_rms = load_mat['x_rms'] + else: + pass + x, fs = sf.read(wavIn) + + # --- Using MATLAB scripts + # x = x.tolist() + # mat_x = matlab.double(x) + # mat_fs = matlab.single([fs]) + # f0, ap = eng.exstraightsource(mat_x, mat_fs) + + # --- Using PyWORLD script + # -- Works for f0 and VTL changes + _f0, t = pw.dio(x, fs) + f0 = pw.stonemask(x, _f0, t, fs) + sp = pw.cheaptrick(x, f0, t, fs) + ap = pw.d4c(x, f0, t, fs) + freq = np.arange(0, np.size(sp, axis=1), + dtype='float64') / (np.size(sp)) * fs/2 + temp_pos = t + + x_rms = np.sqrt(np.mean(x**2)) + duration = len(x/fs) + + spio.savemat(mat, mdict={'fs': fs, 'f0': f0, + 'sp': sp, 'ap': ap, + 'x_rms': x_rms, + 'frequencies': freq, + 'temporal_positions': t, + 'duration': duration + }) + + mf0_arr = [] + + for i in f0: + if i != 0: + mf0_arr.append(np.log(i)) + + mf0 = np.e**(np.mean(np.array(mf0_arr))) + + for i in range(len(f0)): + if f0[i] != 0: + f0[i] = f0[i] / mf0 * t_f0 + + # Only necessary when running the MATLAB code + try: + p["timeAxisMappingTable"] = ( + options["syllable_duration"] * 1e3)/len(f0) + + except ZeroDivisionError as e: + print "-------- ERROR : " + str(e) + ' ------------' + print "length f0 was 0" + p["timeAxisMappingTable"] = 0 + p["frequencyAxisMappingTable"] = ser.item() + + # --- Uncomment when using the MATLAB scripts + # mat_f0 = f0.tolist() + # mat_f0 = matlab.double(mat_f0) + # mat_sp = sp.tolist() + # mat_sp = matlab.double(mat_sp) + # mat_ap = ap.tolist() + # mat_ap = matlab.double(mat_ap) + # mat_fs = matlab.single([fs]) + # y_mat = eng.exstraightsynth(mat_f0, mat_sp, mat_ap, mat_fs, p) + + # --- Uncomment when using PyWORLD script + sp = sp_ap_creation(sp, temp_pos, freq, ser) + ap = sp_ap_creation(ap, temp_pos, freq, ser) + if f0.flags['C_CONTIGUOUS']: + f0 = np.ascontiguousarray(f0, dtype=np.float) + sp = np.ascontiguousarray( + sp, dtype=np.float) + ap = np.ascontiguousarray( + ap, dtype=np.float) + + y_mat = pw.synthesize(f0, sp, ap, fs) + + y = np.array(y_mat) + + y = y / np.sqrt(np.mean(y**2)) * x_rms + + if np.amax(np.absolute(y)) > 1: + expe_logger.warn("Output was normalised for {}".format(wavOut)) + y = 0.98 * y / np.amax(np.absolute(y)) + + sf.write(wavOut, y, fs) + + y, fs = sf.read(wavOut) + + # axes = np.arange(0, len(y)) + # ax.plot(axes, y) + # fig.savefig("test1.png") + # plt.show() + + else: + y, fs = sf.read(wavOut) + + return y, fs + + +def make_fname(wav, f0, ser, d, destPath, trial): + '''Generates the file name for the new stimulus''' + + _, namext = os.path.split(wav) + name, ext = os.path.splitext(namext) + + try: + int(math.floor(f0)) + except ValueError as e: + print e + + # fname = "{}_GPR{}_ser{}_D{}".format(name, math.floor(f0), ser, math.floor(d*1e3)) + fname = "%s_GPR%d_ser%.2f_D%d" % ( + name, int(math.floor(f0)), ser, int(math.floor(d*1e3))) + fname = os.path.join(destPath, fname + ext) + + return fname + + +def sp_ap_creation(mat, temp, freq, ser): + ''' + Interpolates the spectrogram and aperiodicity, respectively + using the same temporal positions, but new freq that takes + into account the ser value (ser = np.power(2, -dVTL/12)). + Ser is usually provided by the defined options in + expe_build_conditions + ''' + # x = np.arange(1, mat.shape[1]+1) + # y = np.arange(1, mat.shape[0]+1) + + # f = interpolate.interp2d(x, y, mat, kind='cubic') + f = interpolate.RectBivariateSpline(temp, freq, mat) + + interp = f(temp, freq.T/ser) + + return interp + + # xs = np.arange(1, spe["spectrogram"].shape[1]+1) + # ys = np.arange(1, spe["spectrogram"].shape[0]+1) + # fis = interp2d(xs, ys, spe["spectrogram"], 'cubic') + # spe["spectrogram"] = fis(spe["temporal_positions"], + # spe["frequencies"]/ser) diff --git a/fishy/expe_options.py b/fishy/expe_options.py new file mode 100644 index 0000000..bdcb10d --- /dev/null +++ b/fishy/expe_options.py @@ -0,0 +1,46 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# 2017-03-29: Etienne Gaudrain +# ------ Python ------ +# 2020-01-27: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- + +import os + + +def expe_options(options): + '''Defines the basic options''' + + options["result_path"] = "./results/" + options["subject_name"] + + options["result_prefix"] = 'jnd_' + options["logs_path"] = './logs/fishy' + + options["log_file"] = os.path.join(options["result_path"], 'status.txt') + + # DELETE Relevant paths, but may not be necessary + options["path"] = {} + options["path"]["straight"] = 'straight' + options["path"]["sqlite"] = 'sqlite' + options["path"]["vocoder"] = 'vocoder' + options["path"]["audio"] = 'audiotsm' + options["experiment_begin"] = 1 + + return options diff --git a/fishy/expe_robot.py b/fishy/expe_robot.py new file mode 100644 index 0000000..cea7603 --- /dev/null +++ b/fishy/expe_robot.py @@ -0,0 +1,924 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# 2013-02-24: Etienne Gaudrain +# 2017-03-29: Etienne Gaudrain +# ------ Python ------ +# 2020-01-28: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- + +# ----- System packages +import sys +import os +import warnings +import datetime +import pickle +import random +import time +import logging +from collections import OrderedDict +# ----- Third party packages +import numpy as np +# import matplotlib.pyplot as plt +import soundfile as sf +import scipy.io as sio +# from matplotlib.animation import FuncAnimation +from naoqi import ALBroker +# ----- File imports +from Robot.RobotFishy import RobotFishy +import tools.settings as settings +from tools.exit_condition import ExitExperimentModule +from expe_make_stim import expe_make_stim +from tools.load_matrix import loadmat + +# Ignores division and invalid warnings sent to the console +np.seterr(divide='ignore', invalid='ignore') + +# Global variables that assit in live tracking the responses in each trial +global PLT_CLOSED +global FIG +global AX1 + +PLT_CLOSED = True + +# --- Create a log file + + +def expe_robot(ip, port, lang, options, phase, subject): + global PLT_CLOSED + if os.path.exists("{}/thresholds_temp.p".format(options["result_path"])): + print "Checking previous save data" + saveFromPickle(options) + # -- Start an instance of SAM + sam = type('', (), {})() + create_sam = True + if create_sam: + sam = RobotFishy(ip, port, lang, subject) + # -- Set initial volume + # print 'Connected to SAM' + ave_time = np.array([]) + # gen_logger = logging.getLogger("gen_logger") + expe_logger = logging.getLogger("expe_logger") + time_logger = logging.getLogger("time_logger") + halfWay = [ + "\\vct=110\\You're about halfway. Keep going!\\vct=100\\", + "\\vct=110\\You've reached the halfway point. Great!\\vct=100\\", + "\\vct=110\\Half down, half to go!\\vct=100\\" + ] + threeQuarters = [ + "\\vct=110\\You're almost done!\\vct=100\\", + "\\vct=110\\Just a few more left!\\vct=100\\", + "\\vct=110\\You're nearing the end!\\vct=100\\" + ] + + # with open(options["res_filename"], 'r') as f: + # options, expe, p = pickle.load(f) + # -- Load the .mat file + mat_contents = loadmat(options["res_filename"]) + expe = mat_contents['expe'] + options = mat_contents['options'] + try: + results = mat_contents['results'] + except KeyError: + # Create a new results dictionary if one is not found or this is a new subject + results = {} + try: + thresholds_dict = mat_contents["thresholds"] + except KeyError: + thresholds_dict = OrderedDict() + p = mat_contents['p'] + + track = loadmat(options["res_tracker"]) + exp = track["tracker"] + starting = 1 + # SIMUL = 0 - Run the experiment with a participant + # SIMUL = 1 - Autonomously mimick step process + # SIMUL = 2 - Always give correct answer + # SIMUL = 3 - Always give random answer + + SIMUL = 0 + DEBUG = 1 + PILOT = 3 + PRESENT = 1 + terminate = 0 + + beginning_of_session = datetime.datetime.now() + # Intialise the done array to store if a task has been completed + done = [] + pilot = 0 + # === Main Loop that runs experiment === + while np.mean(done) != 1: + # while pilot < PILOT: + pilot += 1 + # Reintialises the done array and reappend for when a task has been completed + done = [] + + for i in range(len(expe[phase]["conditions"])): + done.append(expe[phase]["conditions"][i]["done"]) + + # If this is the beginning of the test, Sam introduces the experiment and what to do + if options["instructions"][ + phase] and starting and phase == "training" and exp[ + "experiment_begin"]: + try: + sam.intro() + + except AttributeError: + pass + exp["experiment_begin"] = 0 + sio.savemat(options["res_tracker"], mdict={"tracker": exp}) + pass + if starting: + try: + if phase == "test": + sam.simple_say("Welcome to the testing phase of the game.") + pass + else: + sam.fishyIntro() + pass + pass + sam.game_break() + except AttributeError: + pass + + starting = 0 + # Find the next task that has not yet been completed + try: + i_condition = done.index(0) + # i_condition = 7 + except ValueError: + break + + expe_logger.info( + "\n=============== Testing condition {} / {} ============\n\n". + format(i_condition + 1, len(expe[phase]["conditions"]))) + print "\n=============== Testing condition {} / {} ============\n\n".format( + i_condition + 1, len(expe[phase]["conditions"])) + condition = expe[phase]["conditions"][i_condition] + + # if condition["vocoder"] > 0: + # print "{}\n\n".format(options["vocoder"][condition["vocoder"]]["label"]) + + # --- Prepare unitary vector for this voice direction --- + u_f0 = 12 * np.log2( + options["test"]["voices"]['v' + str(condition["dir_voice"])]["f0"] + / + options["test"]["voices"]['v' + str(condition["ref_voice"])]["f0"]) + u_ser = 12 * np.log2( + options["test"]["voices"]['v' + str(condition["dir_voice"])]["ser"] + / options["test"]["voices"]['v' + + str(condition["ref_voice"])]["ser"]) + u = np.array([u_f0, u_ser]) + u = u / np.sqrt(np.sum(np.power(u, 2))) + + expe_logger.info( + "\n=============== Unitary vector {} ============\n\n".format( + str(u))) + + # --- Adaptive procedure --- + + difference = options[phase]["starting_difference"] + step_size = options[phase]["initial_step_size"] + + response_correct = np.array([]) + decision_vector = [] + steps = np.array([]) + differences = np.array([difference]) + + beginning_of_run = datetime.datetime.now() + # Set probability of encouragement + prob_encou = 0.1 + response_tracker = 0 + half_way = 1 + three_quarter = 1 + + while True: + + expe_logger.info("========== Trial========\n\n") + + # Prepare the trial + trial = condition + + # Compute the test voice + new_voice_st = difference * u + trial["f0"] = options["test"]["voices"][ + 'v' + str(trial["ref_voice"])]["f0"] * np.array( + [1, np.power(2, new_voice_st[0] / 12)]) + trial["ser"] = options["test"]["voices"][ + 'v' + str(condition["ref_voice"])]["ser"] * np.array( + [1, np.power(2, new_voice_st[1] / 12)]) + + options["f0_contours"] = np.array(options["f0_contours"]) + + c, _ = options["f0_contours"].shape + ifc = np.random.permutation(c) + + trial["f0_contours"] = options["f0_contours"][ifc[0:3], :] + + isyll = np.random.permutation(len(options["syllables"])) + trial["syllables"] = [] + syll_array = np.array([x.strip() for x in options["syllables"]]) + options["syllables"] = syll_array + + for _ in range(2): + + trial["syllables"].append( + options["syllables"][isyll[0:options["n_syll"]]]) + + # Prepare the stimulus + if PRESENT == 0: + i_correct = 1 + ave_time = np.append(ave_time, 1) + else: + settings.time_taken = time.time() + xOut, fs, i_correct = expe_make_stim(options, trial, p) + filenames = [] + # Create the files with the stimuli + for i in range(len(xOut)): + filenames.append('stimulus_{}.wav'.format(i + 1)) + # x = xOut[i] * 10 ** -options["attenuation_dB"]/20 + sf.write( + filenames[i], + np.concatenate((np.zeros( + (1024 * 3, 2)), xOut[i], np.zeros((1024 * 3, 2)))), + fs) + tme = time.time() - settings.time_taken + time_logger.info( + "Time to generate 3 stimulus files: {}".format(tme)) + ave_time = np.append(ave_time, tme) + filenames_combined = '{}, {}, {}'.format( + filenames[0], filenames[1], filenames[2]) + + # Send the stimuli files to Sam + try: + sam.aad.setOutputVolume(sam.stimulus_volume) + sam.play_sounds(filenames_combined) + sam.aad.setOutputVolume(sam.speaking_volume) + except AttributeError: + pass + + # for i in range(len(xOut)): + # os.remove(filenames[i]) + + pass + + # Start time for response time of subject + t = time.time() + + # -- Collect the response --- + # Fill the response dictionary + + response = {} + response["input"] = [i_correct, 1] + if SIMUL == 1: + i_clicked = i_correct + while differences[-1] < 0.01: + i_clicked = i_correct - 1 + break + elif SIMUL == 3: + if difference + np.random.randn(1) > 1: + i_clicked = i_correct + else: + i_clicked = i_correct + 1 + else: + try: + i_clicked = sam.answer(response["input"]) + except AttributeError: + pass + pass + # + # i_clicked = random.randint(0, 3) + response["response_time"] = time.time() - t + response["timestamp"] = 'Timestamp: {:%Y-%m-%d %H:%M:%S}'.format( + datetime.datetime.now()) + response["button_clicked"] = i_clicked + if i_correct == i_clicked: + response["correct"] = True + else: + response["correct"] = False + response_correct = np.append(response_correct, response["correct"]) + + decision_vector.append(response["correct"]) + response["condition"] = condition + response["condition"]["u"] = u + response["trial"] = trial + response["trial"]["v"] = difference * u + + expe_logger.info( + 'Difference \t\t\t: {:1f} st ({:1f} st GPR, {:1f} st VTL) \n'. + format(difference, difference * u[0], difference * u[1])) + expe_logger.info('Correct button\t\t\t: {}\n'.format(i_correct)) + expe_logger.info('Clicked response\t\t\t: {}\n'.format(i_clicked)) + expe_logger.info('Response time\t\t\t: {} ms\n'.format( + round(response["response_time"] * 1000))) + expe_logger.info( + 'Time since beginning of run\t: {}\n'.format(beginning_of_run)) + expe_logger.info('Time since beginning of session\t: {}\n'.format( + beginning_of_session)) + + # Add response to results structure + + n_attempt = expe[phase]["conditions"][i_condition]["attempts"] + 1 + attempt_idx = n_attempt - 1 + if not phase in results or i_condition <= len( + results[phase]["conditions"]): + att = {} + if not phase in results: + results[phase] = {} + + keys = ["differences", "steps", "diff_i_top", "sd"] + att = dict.fromkeys(keys, np.empty([])) + att["threshold"] = 0 + att["responses"] = {} + + if i_condition == 1: + pass + + if not "conditions" in results[phase]: + # results[phase]["conditions"] = np.array([attempt]) + results[phase]["conditions"] = {} + if not "c" + str(i_condition) in results[phase]["conditions"]: + results[phase]["conditions"]["c" + str(i_condition)] = {} + # results[phase]["conditions"]["c" + str(i_condition)]["att"] = np.array([att]) + results[phase]["conditions"]["c" + + str(i_condition)]["att"] = { + "responses": {}, + "differences": [], + "steps": [], + "diff_i_tp": [], + "threshold": 0, + "sd": 0, + "duration": 0, + "exit_reason": "" + } + # else: + # # results[phase]["conditions"] = np.append( + # # results[phase]["conditions"], attempt) + # try: + # # results[phase]["conditions"]["c" + str(i_condition)]["att"] = np.append( + # # results[phase]["conditions"]["c" + str(i_condition)]["att"], att) + # results[phase]["conditions"]["c" + + # str(i_condition)]["att"] = {""} + # except KeyError: + # results[phase]["conditions"]["c" + + # str(i_condition)] = {} + # results[phase]["conditions"]["c" + str(i_condition)]["att"] = np.array([ + # att]) + + # if not results[phase]["conditions"]["c" + str(i_condition)]["att"][attempt_idx]["responses"]: + # results[phase]["conditions"]["c" + str(i_condition)]["att"][attempt_idx]["responses"] = [ + # response] + # if not results[phase]["conditions"]["c" + str(i_condition)]["att"]["responses"]: + # results[phase]["conditions"]["c" + + # str(i_condition)]["att"]["responses"] = [response] + # else: + # # results[phase]["conditions"]["c" + str(i_condition)]["att"][attempt_idx]["responses"].append( + # # response) + # results[phase]["conditions"]["c" + + # str(i_condition)]["att"]["responses"].append(response) + + results[phase]["conditions"]["c" + + str(i_condition)]["att"]["responses"][ + "r" + + str(response_tracker)] = response + response_tracker += 1 + + # --- Probability for encourangement --- + if phase == "test": + encou_answer = 'correct' + if i_clicked != i_correct: + prob_encou = prob_encou + 0.05 + encou_answer = 'wrong' + + if np.random.rand() < prob_encou: + try: + resp = sam.encouragement(encou_answer) + except AttributeError: + pass + prob_encou = 0.1 + time.sleep(0.5) + + # --- Prepare parameters for next trial --- + if len(decision_vector) >= options[phase]["down_up"][0] and all( + v == 1 + for v in decision_vector[-1 - + options[phase]["down_up"][1]:]): + # The last n_down responses were correct -> Reduce + # difference by step_size, then update step_size + + expe_logger.info( + '-- Where going down by {} st \n'.format(step_size)) + + difference = difference - step_size + steps = np.append(steps, -step_size) + differences = np.append(differences, difference) + + # Update step size. + + if difference <= options[phase][ + "change_step_size_condition"] * step_size or len( + differences + ) % options[phase]["change_step_size_n_trials"] == 0: + expe_logger.info( + 'Step size is getting updated; was {} st'.format( + step_size)) + step_size = step_size * \ + options[phase]["step_size_modifier"] + expe_logger.info( + 'step size is now {} st\n'.format(step_size)) + + # Reset decision vector + decision_vector = [] + + elif len(decision_vector) >= options[phase]["down_up"][1] and all( + v == 0 + for v in decision_vector[-1 - + options[phase]["down_up"][1]:]): + # The last n_up responses were incorrect -> Increase + # difference by step_size. No update of step_size when going up + + expe_logger.info('-- Where going up by {}\n'.format(step_size)) + + difference = difference + step_size + steps = np.append(steps, step_size) + differences = np.append(differences, difference) + + decision_vector = [] + + else: + expe_logger.info('-- Where going neither up or down\n') + + steps = np.append(steps, 0) + differences = np.append(differences, difference) + + # x = np.abs(np.sign(steps[np.nonzero(steps)])) + # x = x[np.nonzero(np.diff(x))] + nturns = np.sum(np.diff(np.sign(steps[steps != 0])) != 0) + # nturns = np.sum(np.nonzero(np.diff(np.sign(np.nonzero(steps))))) + + # --- Check if an exit condition has been reached --- + print nturns + if phase == "test": + if nturns == (options[phase]["terminate_on_n_turns"] / + 2) and half_way: + n = random.randint(0, 2) + sam.simple_say(halfWay[n]) + half_way = 0 + elif nturns == ((3 * options[phase]["terminate_on_n_turns"]) / + 4) and three_quarter: + n = random.randint(0, 2) + sam.simple_say(threeQuarters[n]) + three_quarter = 0 + + if phase == "test": + if nturns >= options[phase]["terminate_on_n_turns"]: + + expe_logger.info( + '====== END OF RUN due to enough turns =========\n') + print '==== END OF RUN due to enough turns =========\n' + + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["exit_reason"] = 'nturns' + results[phase]["conditions"][ + "c" + + str(i_condition)]["att"]["exit_reason"] = 'nturns' + expe[phase]["conditions"][i_condition]["done"] = 1 + expe[phase]["conditions"][i_condition]["attempts"] += 1 + + i_nz = np.nonzero(steps) + i_d = np.nonzero(np.diff(np.sign(steps[steps != 0])) != 0) + i_tp = i_nz[0][i_d] + 1 + i_tp = np.append(i_tp, len(differences)) + i_tp = i_tp[-1 - + options[phase]["threshold_on_last_n_trials"]:] + + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["diff_i_tp"] = i_tp + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["diff_i_tp"] = [i_tp] + thr = np.mean(differences[i_tp - 1]) + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["threshold"] = thr + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["threshold"] = thr + sd = np.std(differences[i_tp - 1], ddof=1) + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["sd"] = sd + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["sd"] = sd + + expe_logger.info( + 'Threshold: {} st ({} st GPR, {} st VTL)\n'.format( + thr, thr * u[0], thr * u[1])) + print 'Threshold: {} st ({} st GPR, {} st VTL)\n'.format( + thr, thr * u[0], thr * u[1]) + thresholds_dict["Trial_" + + str(i_condition + 1)] = OrderedDict() + + f0_1 = condition["f0"][0] + f0_2 = condition["f0"][1] + ser_1 = condition["ser"][0] + ser_2 = condition["ser"][1] + if f0_1 != f0_2 and ser_1 != ser_2: + thresholds_dict["Trial_" + + str(i_condition + + 1)]["condition"] = "f0&VTL" + elif ser_1 != ser_2: + thresholds_dict["Trial_" + str(i_condition + + 1)]["condition"] = "VTL" + elif f0_1 != f0_2: + thresholds_dict["Trial_" + str(i_condition + + 1)]["condition"] = "f0" + thresholds_dict["Trial_" + + str(i_condition + 1)]["threshold"] = {} + thresholds_dict["Trial_" + + str(i_condition + + 1)]["threshold"]["threshold"] = thr + thresholds_dict["Trial_" + + str(i_condition + + 1)]["threshold"]["f0"] = thr * u[0] + thresholds_dict["Trial_" + + str(i_condition + + 1)]["threshold"]["vtl"] = thr * u[1] + # thresholds_dict["Trial_"+str(i_condition)]["threshold"] = 'Threshold: {} st ({} st GPR, {} st VTL)\n'.format( + # thr, thr*u[0], thr*u[1]) + break + # elif len(response_correct) >= 20: + elif len(response_correct + ) >= options[phase]["terminate_on_n_trials"]: + expe_logger.info( + '====== END OF RUN due to too many trials ======\n') + print '====== END OF RUN due to too many trials ======\n' + + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["exit_reason"] = 'ntrials' + results[phase]["conditions"][ + "c" + + str(i_condition)]["att"]["exit_reason"] = 'ntrials' + expe[phase]["conditions"][i_condition]["attempts"] += 1 + + # Should we retry? + + if expe[phase]["conditions"][i_condition][ + "attempts"] >= options[phase]["retry"] + 1: + # retry = sam.retry() + # retry = 0 + # if retry: + # pass + # else: + # # sam.ending() + # pass + expe[phase]["conditions"][i_condition]["done"] = 1 + + # results[phase]["conditions"]["c" + str(i_condition)]["att"][attempt_idx]["diff_i_tp"] = np.empty([ + # ]) + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["diff_i_tp"] = np.empty( + []) + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["threshold"] = 0 + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["threshold"] = 0 + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["sd"] = 0 + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["sd"] = 0 + + break + + elif len(response_correct) >= options[phase][ + "change_step_size_n_trials"] and all( + v == 0 for v in response_correct[ + -1 - + options[phase]["change_step_size_n_trials"]:]): + # All last trials are incorrect + + expe_logger.info( + '====== END OF RUN due to too many incorrect answers ======\n' + ) + print '====== END OF RUN due to too many incorrect answers ======\n' + + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["exit_reason"] = 'nwrong' + results[phase]["conditions"][ + "c" + + str(i_condition)]["att"]["exit_reason"] = 'nwrong' + expe[phase]["conditions"][i_condition]["attempts"] += 1 + + # Try again? + if expe[phase]["conditions"][i_condition][ + "attempts"] >= options[phase]["retry"] + 1: + # retry = sam.retry() + # if retry: + # pass + # else: + # sam.ending() + # pass + expe[phase]["conditions"][i_condition]["done"] = 1 + + break + + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["differences"] = differences + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["steps"] = steps + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["differences"] = differences + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["steps"] = steps + + else: + if len(response_correct + ) >= options[phase]["terminate_on_n_trials"]: + expe_logger.info( + '====== END OF Training RUN due to too many trials ======\n' + ) + print '====== END OF Training RUN due to too many trials ======\n' + + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["exit_reason"] = 'ntrials' + results[phase]["conditions"][ + "c" + + str(i_condition)]["att"]["exit_reason"] = 'ntrials' + expe[phase]["conditions"][i_condition]["attempts"] += 1 + + # Should we retry? + + if expe[phase]["conditions"][i_condition][ + "attempts"] >= options[phase]["retry"] + 1: + # retry = sam.retry() + # retry = 0 + # if retry: + # pass + # else: + # # sam.ending() + # pass + expe[phase]["conditions"][i_condition]["done"] = 1 + + # results[phase]["conditions"]["c" + str(i_condition)]["att"][attempt_idx]["diff_i_tp"] = np.empty([ + # ]) + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["threshold"] = 0 + # results[phase]["conditions"]["c" + str( + # i_condition)]["att"][attempt_idx]["sd"] = 0 + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["diff_i_tp"] = np.empty( + []) + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["threshold"] = 0 + results[phase]["conditions"][ + "c" + str(i_condition)]["att"]["sd"] = 0 + + break + # if DEBUG: + # # Plot the matplotlib graphs if DEBUG is True + # plot_differences(results, differences, response_correct) + + # --- Save the response of the current task in .mat file --- + + check = 1 + # Close the current open plot and set the plot tracker to True so a new figure can be created for the next trial + # plt.close() + PLT_CLOSED = True + delete_last_lines(n=6) + avg_time = np.mean(ave_time) + time_logger.info( + "Average time taken to generate three stimulus files for one trial: {}" + .format(avg_time)) + time_logger.info("Average time (min): {}".format( + str(datetime.timedelta(seconds=avg_time)))) + tot_time = avg_time * len(ave_time) + time_logger.info("Total time of trial: {}".format( + datetime.timedelta(seconds=tot_time))) + try: + sam.simple_say("Thats the end of this task.") + except AttributeError: + pass + if i_condition == len(done) - 1: + terminate = 1 + + pickle.dump( + expe, open("{}/expe_temp.p".format(options["result_path"]), 'wb')) + pickle.dump( + options, + open("{}/options_temp.p".format(options["result_path"]), 'wb')) + pickle.dump( + results, + open("{}/results_temp.p".format(options["result_path"]), 'wb')) + pickle.dump( + thresholds_dict, + open("{}/thresholds_temp.p".format(options["result_path"]), 'wb')) + pickle.dump(p, open("{}/p_temp.p".format(options["result_path"]), + 'wb')) + # sio.savemat(options["res_filename"], mdict={ + # 'expe': expe, + # 'options': options, + # 'results': results, + # 'thresholds': thresholds_dict, + # 'p': p}) + + if phase == "test": + if np.mean(done) == 1: + break + if not terminate: + try: + sam.take_break() + except AttributeError: + pass + pass + elif phase == "training": + done = [ + expe[phase]["conditions"][i]["done"] + for i in range(len(expe[phase]["conditions"])) + ] + + if np.mean(done) == 1: + break + try: + sam.simple_say( + "When you're ready to continue, touch the top of my head.") + sam.mtn.setStiffnesses(["HeadYaw", "HeadPitch"], [1.0, 1.0]) + sam.hoofd_beweging() + sam.mtn.setStiffnesses(["HeadYaw", "HeadPitch"], [0.0, 0.0]) + except AttributeError: + pass + + # --- End of adaptive loop --- + # --- Save the response of the whole trial in .mat file --- + saveFromPickle(options) + # sio.savemat(options["res_filename"], mdict={ + # 'expe': expe, 'options': options, 'results': results, 'thresholds': thresholds_dict, 'p': p}, appendmat=True) + complete = [] + + for i in expe[phase]["conditions"]: + complete.append(i["done"]) + + # --- Create the report status for the trial --- + report_status(options["subject_name"], phase, np.sum(complete), + len(complete), options["log_file"]) + + # TODO Possibly add a game break message + + # Once out of the main loop, tell the researcher + sys.stdout.write("==== END OF EXPERIMENT. ====\n") + for k, v in thresholds_dict.iteritems(): + for key, value in v.iteritems(): + if v[key] == "VTL" or v[key] == "f0": + + expe_logger.info(k) + expe_logger.info("Condition: " + v[key]) + + if phase == "test": + exp["experiments"]["fishy"] = 1 + sio.savemat(options["res_tracker"], mdict={"tracker": exp}) + try: + sam.simple_say(" and also the end of the testing phase.") + except AttributeError: + pass + else: + try: + sam.simple_say(" and also the end of the training phase") + except AttributeError: + pass + pass + exp_tracker = np.array( + [exp["experiments"][key] for key in exp["experiments"].keys()]) + + if np.mean(exp_tracker) == 1: + try: + sam.ending() + except AttributeError: + pass + expe_logger.info( + "==== END OF EXPERIMENT ({}). Thank you for your participation". + format(phase)) + + +def report_status(subj, phase, i, n, logFile): + with open(logFile, 'w') as f: + f.write('{} : {} : {}/{}\n'.format(subj, phase, i, n)) + + f.close() + + +# def plot_differences(results, differences, response_correct): +# ''' +# Creates the matplotlib graphs of the responses. +# ax1 shows the steps of the adaptive loop and ax2 shows something else... +# ''' +# global PLT_CLOSED +# global FIG +# global AX1 +# if PLT_CLOSED: +# create_fig() +# fig = FIG +# ax1 = AX1 +# plt.cla() +# x = np.arange(len(differences)-1) +# y = np.array(differences[:-1]) +# ax1.plot(x, y, 'r--') +# ax1.plot(len(differences) + +# np.array([-1, 0]), differences[len(differences)-2:], 'b--') + +# ax1.plot(x[np.where(response_correct == 1)], +# y[np.where(response_correct == 1)], 'g--') + +# ax1.plot(x[np.where(response_correct == 0)], +# y[np.where(response_correct == 0)], 'y--') +# # ax2.plot([options[phase]["voices"]["v" + str(condition["ref_voice"])]["f0"], +# # options[phase]["voices"]["v" + str(condition["dir_voice"])]["f0"]], +# # [options[phase]["voices"]["v" + str(condition["ref_voice"])]["ser"], +# # options[phase]["voices"]["v" + str(condition["dir_voice"])]["ser"]]) + +# # for i_resp in range(len(results[phase]["conditions"]["c" + str(i_condition)]["att"][attempt_idx]["responses"])): +# # if results[phase]["conditions"]["c" + str(i_condition)]["att"][attempt_idx]["responses"][i_resp]["correct"]: +# # ax2.plot(results[phase]["conditions"]["c" + str(i_condition)] +# # ["att"][attempt_idx]["responses"][i_resp]["trial"]["f0"][1], +# # results[phase]["conditions"]["c" + str(i_condition)] +# # ["att"][attempt_idx]["responses"][i_resp]["trial"]["ser"][1], 'm-') +# # else: +# # ax2.plot(results[phase]["conditions"]["c" + str(i_condition)] +# # ["att"][attempt_idx]["responses"][i_resp]["trial"]["f0"][1], +# # results[phase]["conditions"]["c" + str(i_condition)] +# # ["att"][attempt_idx]["responses"][i_resp]["trial"]["ser"][1], 'm-') + +# # for i_sp in range(len(options[phase]["voices"])): +# # ax2.plot(options[phase]["voices"]["v" + str(i_sp+1)]["f0"], +# # options[phase]["voices"]["v" + str(i_sp+1)]["ser"], 'g:') +# # plt.tight_layout() +# # plt.show() + +# # plt.draw() +# fig.canvas.draw() +# plt.pause(0.0001) + +# def create_fig(): +# '''Creates an instance of a matplotlib figure and sets the global variables accordingly.''' +# global PLT_CLOSED +# global FIG +# global AX1 +# if PLT_CLOSED: +# (FIG, AX1) = plt.subplots(1) +# FIG.suptitle("Debug Mode") +# PLT_CLOSED = False + + +def delete_last_lines(n=1): + CURSOR_UP_ONE = '\x1b[1A' + ERASE_LINE = '\x1b[2K' + for _ in range(n): + sys.stdout.write(CURSOR_UP_ONE) + sys.stdout.write(ERASE_LINE) + + +def saveFromPickle(options): + print "-------" + print "Loading results" + print "-------" + try: + expe = pickle.load( + open("{}/expe_temp.p".format(options["result_path"]), 'rb')) + opt = pickle.load( + open("{}/options_temp.p".format(options["result_path"]), 'rb')) + results = pickle.load( + open("{}/results_temp.p".format(options["result_path"]), 'rb')) + thresholds_dict = pickle.load( + open("{}/thresholds_temp.p".format(options["result_path"]), 'rb')) + p = pickle.load( + open("{}/p_temp.p".format(options["result_path"]), 'rb')) + + sio.savemat(options["res_filename"], + mdict={ + "expe": expe, + "options": opt, + "results": results, + "thresholds": thresholds_dict, + "p": p + }) + + os.remove("{}/expe_temp.p".format(options["result_path"])) + os.remove("{}/options_temp.p".format(options["result_path"])) + os.remove("{}/results_temp.p".format(options["result_path"])) + os.remove("{}/thresholds_temp.p".format(options["result_path"])) + os.remove("{}/p_temp.p".format(options["result_path"])) + + except Exception as e: + print e + + return diff --git a/fishy/expe_run.py b/fishy/expe_run.py new file mode 100644 index 0000000..2e30ca0 --- /dev/null +++ b/fishy/expe_run.py @@ -0,0 +1,174 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# 2010-03-16: Etienne Gaudrain +# 2013-02-24: Etienne Gaudrain +# 2017-03-29: Etienne Gaudrain +# ------ Python ------ +# 2020-01-28: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- +import sys +import os +import expe_robot +import ctypes +import time +import logging +import datetime +import expe_build_conditions +import expe_options +import tools.settings as settings +from scipy.io import savemat + +from naoqi import ALBroker +from tools.exit_condition import ExitExperimentModule + +VERSION = 20202801 + +expe_exit = None + + +def setup_logger(name, log_file, level=logging.INFO): + """To setup as many loggers as you want""" + formatter = logging.Formatter('%(levelname)s:%(message)s') + handler = logging.FileHandler(log_file) + handler.setFormatter(formatter) + + logger = logging.getLogger(name) + logger.setLevel(level) + logger.addHandler(handler) + logger.propagate = False + + return logger + + +def main(options, subject, phase, lang, p_exists, ip='127.0.0.1', port=9559): + ''' + Runs the experiment. + + SUBJECT is a string identifying the subject. + PHASE is either 'training' or 'test' + IP is the ipaddress of Sam when connected to a relevant network + PORT is the port for connection to Sam + + ''' + options["subject_name"] = subject + options["language"] = lang + + options = expe_options.expe_options(options) + + # Adds necessary paths. So far not in use. + added_path = [] + added_path.append(options["path"]["audio"]) + added_path.append(options["path"]["vocoder"]) + + # Create the results directory in the current directory if it does not already exist + if not os.path.exists(options["result_path"]): + os.mkdir(options["result_path"]) + + # Create the logs directory in the current directory if it does not already exist + if not os.path.exists(options["logs_path"]): + os.mkdir(options["logs_path"]) + + # Create the subject's file path + res_filename = os.path.join( + options["result_path"], + "{}{}_{}_robot.mat".format(options["result_prefix"], lang.lower(), + subject)) + options["res_filename"] = res_filename + + res_tracker = os.path.join(options["result_path"], + '{}_tracker.mat'.format(subject)) + options["res_tracker"] = res_tracker + if not os.path.exists(res_tracker): + track = {} + track["experiment_begin"] = 1 + + track["experiments"] = {} + track["experiments"]["fishy"] = 0 + track["experiments"]["gender"] = 0 + track["experiments"]["emotion"] = 0 + track["experiments"]["crm"] = 0 + + savemat(res_tracker, mdict={"tracker": track}) + + # Create various loggers to track different elements + log_filename = os.path.join( + options["logs_path"], + "{}{}_{}_robot.mat".format(options["result_prefix"], lang.lower(), + subject)) + + options["log_filename"] = log_filename + + # tracks participants progress + expe_logger = setup_logger("expe_logger", options["log_filename"]) + # tracks general information + gen_logger = setup_logger("gen_logger", "./logs/general.log") + time_logger = setup_logger("time_logger", "./logs/time_check.log") + # gen_logger = setup_logger("gen_logger", gen_logs) + + # Check if the subject's file already exists, otherwise create it + if p_exists is None: + if not os.path.exists(res_filename): + msg = "The subject '{}' does not exist. Create it?".format(subject) + print msg + ans = raw_input("(Y/n): ") + + if ans.lower() == 'y': + expe_build_conditions.expe_build_conditions(options, lang) + # -- Create new logging file + expe_logger.info( + "====== Beginning new log for subject: {} ======".format( + subject)) + expe_logger.info("====== Date of creation: {} \n\n".format( + datetime.datetime.today())) + elif ans.lower() == 'n': + sys.exit() + else: + raise "that is not a valid choice" + + else: + msg = "Found {}. Use this file?".format(subject) + print msg + ans = raw_input("(Y/n): ") + + expe_logger.info( + "===== Continuing previous created experiment =====") + expe_logger.info("===== Date: {}\n\n".format( + datetime.datetime.today())) + + if ans.lower() == 'n': + sys.exit() + elif not p_exists: + expe_build_conditions.expe_build_conditions(options) + + # run the robot experiment + gen_logger.info("***** Starting general logging *****\n\n") + time_logger.info("***** Starting time check logging *****\n\n") + # Used when testing the time it takes to generate stimulus files + matlab = True + if matlab: + time_logger.info("=== Using matlab stimulus generation ===\n") + else: + time_logger.info("=== Using PyWorld stimulus generation === \n") + expe_robot.expe_robot(ip, port, lang, options, phase, subject) + + +if __name__ == "__main__": + options = {} + main(options, "test", "test", "en") diff --git a/fishy/preprocess.py b/fishy/preprocess.py new file mode 100644 index 0000000..97d1a32 --- /dev/null +++ b/fishy/preprocess.py @@ -0,0 +1,46 @@ +import os +import soundfile as sf +import pyworld as pw +import numpy as np +import scipy.io as spio +from expe_options import expe_options +from expe_build_conditions import expe_build_conditions + + +def preprocess(language): + options = {} + options["language"] = language + options["subject_name"] = '' + options = expe_options(options) + + _, options = expe_build_conditions(options) + + for i in range(len(options["syllables"])): + syll = options["syllables"][i] + print "%02d/%02d - %s\n" % (i, len(options["syllables"]), syll) + + wavIn = os.path.join(options["sound_path"], syll + ".wav") + + mat = os.path.join(options["sound_path_store"], syll + '.pyworld.mat') + + if not os.path.exists(mat): + x, fs = sf.read(wavIn) + + _f0, t = pw.dio(x, fs) + f0 = pw.stonemask(x, _f0, t, fs) + sp = pw.cheaptrick(x, f0, t, fs) + ap = pw.d4c(x, f0, t, fs) + freq = np.arange(0, np.size(sp, axis=1), + dtype='float64') / (np.size(sp)) * fs/2 + temp_pos = t + + x_rms = np.sqrt(np.mean(x**2)) + duration = len(x/fs) + + spio.savemat(mat, mdict={'fs': fs, 'f0': f0, + 'sp': sp, 'ap': ap, + 'x_rms': x_rms, + 'frequencies': freq, + 'temporal_positions': t, + 'duration': duration + }) diff --git a/gender/__init__.py b/gender/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gender/cosgate.py b/gender/cosgate.py new file mode 100644 index 0000000..4607385 --- /dev/null +++ b/gender/cosgate.py @@ -0,0 +1,40 @@ +import math +import warnings +import numpy as np + + +def cosgate(x, fs, d): + if type(d) == 'list': + if len(d) == 1: + d = np.array([d, d]) + elif len(d) > 2: + raise ValueError( + "The ramp duration argument can only be of length 1 or 2.") + else: + d = np.array([d]) + + d = d * fs + + # Onset + + k = np.array(range(0, int(d[0]-1))) + # if np.size(x, 2) == 1: + # k = k.T + + x[[k+1]] = np.multiply(x[[k+1]], 1 - + (1 + np.cos(k * np.pi / (d[0]-1)) / 2)) + + # Offset + try: + k = np.array(range(0, int(d[1]-1))) + x[[-k]] = np.multiply(x[[-k]], 1 - + (1 + np.cos(k * np.pi / (d[1]-1)) / 2)) + except IndexError: + k = np.array(range(0, int(d[0]-1))) + x[[-k]] = np.multiply(x[[-k]], 1 - + (1 + np.cos(k * np.pi / (d[0]-1)) / 2)) + # if np.size(x, 2) == 1: + # k = k.T + y = x + + return y diff --git a/gender/gender_build_conditions.py b/gender/gender_build_conditions.py new file mode 100644 index 0000000..867cfd6 --- /dev/null +++ b/gender/gender_build_conditions.py @@ -0,0 +1,202 @@ +import numpy as np +import os +import wave +import math +from scipy.io import savemat +import warnings +from gender_options import expe_options +from tools.load_matrix import loadmat + + +def expe_build_conditions(options): + # Build Signal conditions + options["fs"] = 44100 + # options["attenuation_dB"] = 7 + + mat = loadmat('./calibration.mat') + cal = mat["calibration"] + options["attenuation_dB"] = cal["gender"] + # options["attenuation_dB"] = 10 # Calibrated attenuation + + options["ear"] = "both" + + # Design specifications + options["test"] = {} + options["training"] = {} + options["test"]["n_repeat"] = 1 + options["training"]["n_repeat"] = 1 + word_list = [] + + if options["Bert"]: + + options["test"]["f0s"] = np.array([0.0, -3.0, -6.0, -9.0, -12.0]) + options["test"]["vtls"] = np.array([0, 0.7, 1.6, 2.4, 3.0, 3.6]) + else: + options["test"]["f0s"] = np.array([0.0, -6.0, -12.0]) + options["test"]["vtls"] = np.array([0, 1.8, 3.6]) + + options["training"]["f0s"] = np.array([0.0, -12.0]) + options["training"]["vtls"] = np.array([0.0, 3.6]) + + nF0 = len(options["test"]["f0s"]) + nVTL = len(options["test"]["vtls"]) + + if options["phase"] == "generation": + word_list = ["Bus", "Leeg", "Pen", "Vaak"] + elif options["phase"] == "test" or options["phase"] == "training": + if options["language"].lower() == "nl": + word_list = ["Bus", "Leeg", "Pen", "Vaak"] + elif options["language"].lower() == "en": + word_list = ["bike", "hat", "pool", "watch"] + + options["test"]["word_list"] = word_list + options["training"]["word_list"] = word_list + + nWords = len(word_list) + + options["sound_path_local"] = os.path.join( + options["sound_path"], options["language"]) + options["tmp_path_local"] = options["tmp_path"] + + options["sounds_for_calibration"] = [] + lst = [f for f in os.listdir( + options["tmp_path_local"]) if f.endswith(".wav")] + for f in range(len(lst)): + options["sounds_for_calibration"].append( + os.path.join(options["tmp_path_local"], lst[f])) + + options["test"]["total_ntrials"] = nWords * nVTL * nF0 + # oneSampleFile = os.path.join(options["tmp_path"], "{}_GPR{}_VTL{}.wav".format(word_list[0], + # options["test"]["f0s"][0], options["test"]["vtls"][0])) + # options["training"]["total_ntrials"] = len( + # word_list) * len(options["training"]["f0s"]) * len(options["training"]["vtls"]) + options["training"]["total_ntrials"] = 7 + + # if os.path.exists(oneSampleFile): + # w = wave.open(oneSampleFile, 'r') + # frames = w.getnframes() + # rate = w.getframerate() + # duration = frames/float(rate) + # options["word_duration"] = duration + # else: + # options["word_duration"] = 850e-3 + + options["lowpass"] = 4000 + options["force_rebuild_sylls"] = 0 + + # Build test block + + # options["test"]["faces"] = np.array(["woman_1", "woman_2", "woman_3", "woman_4", "woman_5", + # "woman_6", "woman_7", "man_1", "man_2", "man_3", "man_4", + # "man_5", "man_6", "man_7"]) + + options["test"]["face_genders"] = ['man', 'woman'] + options["test"]["number_faces"] = 7 + + options["training"]["face_genders"] = options["test"]["face_genders"] + options["training"]["number_faces"] = options["test"]["number_faces"] + # nFaces = len(options["test"]["faces"]) + # nRepetitions = math.ceil(options["test"]["total_ntrials"]/nFaces) + # nFemales = sum([True for s in options["test"] + # ["faces"] if s.startswith("woman")]) + # nMales = nFaces - nFemales + # indexes = np.tile(range(1, nFemales), int(nRepetitions)) + # np.random.shuffle(indexes) + # indexes = np.delete( + # indexes, np.s_[options["test"]["total_ntrials"]/2:], None) + # indexesM = np.tile(range(1+nFemales, nMales+nFemales), int(nRepetitions)) + # np.random.shuffle(indexesM) + # indexesM = np.delete( + # indexesM, np.s_[options["test"]["total_ntrials"]/2:], None) + # indexes = [indexes, indexesM] + # np.random.shuffle(indexes) + # np.random.shuffle(options["test"]["faces"]) + # options["test"]["faces"] = options["test"]["faces"][indexes] + + # TODO test Hands + + test = {} + + counter = 1 + + for ir in range(options["test"]["n_repeat"]): + for f0 in range(nF0): + for vtl in range(nVTL): + i_words = np.random.permutation(nWords) + for i_face_gender in range(2): + face_gender = options["test"]["face_genders"][i_face_gender] + i_word_start = i_face_gender * nWords / 2 + 1 + for i_word in np.arange(nWords/2) - 1+i_word_start: + trial = {} + trial["f0"] = options["test"]["f0s"][f0] + trial["vtl"] = options["test"]["vtls"][vtl] + trial["word"] = options["test"]["word_list"][i_words[i_word]] + trial["i_repeat"] = ir + trial["done"] = 0 + trial["face"] = '{}_{}'.format( + face_gender, np.random.randint(options["test"]["number_faces"])) + trial["face_gender"] = face_gender + + if not "trials" in test: + test["trials"] = [trial] + else: + test["trials"].append(trial) + + training = {} + + nWords = len(options["training"]["word_list"]) + + for ir in range(options["training"]["n_repeat"]): + + for i_v in range(len(options["training"]["f0s"])): + i_f0 = i_v + i_vtl = i_v + i_words = np.random.permutation(nWords) + for i_face_gender in range(2): + face_gender = options["training"]["face_genders"][i_face_gender] + i_word_start = i_face_gender*nWords/2+1 + for i_word in np.arange(nWords/2) - 1+i_word_start: + + trial = {} + trial["f0"] = options["training"]["f0s"][i_f0] + trial["vtl"] = options["training"]["vtls"][i_vtl] + trial["word"] = options["training"]["word_list"][i_words[i_word]] + trial["i_repeat"] = ir + trial["done"] = 0 + trial["face"] = '{}_{}'.format( + face_gender, np.random.randint(options["test"]["number_faces"])) + trial["face_gender"] = face_gender + if not "trials" in training: + training["trials"] = [trial] + else: + training["trials"].append(trial) + + # Create expe dictionary and save + expe = {} + if options["phase"] == "generation": + expe["test"] = {} + expe["test"]["trials"] = test["trials"] + else: + expe["test"] = {} + expe["training"] = {} + i_order = np.random.permutation(len(test["trials"])) + expe["test"]["trials"] = [] + for i in i_order: + expe["test"]["trials"].append(test["trials"][i]) + i_order = np.random.permutation(len(training["trials"])) + expe["training"]["trials"] = [] + for i in i_order: + expe["training"]["trials"].append(training["trials"][i]) + + if "res_filename" in options: + savemat(options["res_filename"], mdict={ + "expe": expe, "options": options}) + else: + warnings.warn("The test file was not saved: no filename provided") + + return expe, options + + +if __name__ == "__main__": + options = expe_options() + buildConditions(options) diff --git a/gender/gender_generateStimuli.py b/gender/gender_generateStimuli.py new file mode 100644 index 0000000..76200f8 --- /dev/null +++ b/gender/gender_generateStimuli.py @@ -0,0 +1,37 @@ +import os +import numpy as np +from gender_build_conditions import expe_build_conditions as buildConditions +from gender_makeStimuli import makeStimuli + + +def generateStimuli(options, phase): + if os.path.exists(options["res_filename"]): + os.remove(options["res_filename"]) + + opt = raw_input("Delete previously processed sound files? (Y/n): ") + if opt.lower() == "y": + # os.remove(os.path.join(options["sound_path"], '*.wav')) + old = [f for f in os.listdir( + options["tmp_path"]) if f.endswith(".wav")] + for o in old: + os.remove(os.path.join(options["tmp_path"], o)) + elif opt.lower() == 'n': + return + else: + raise ValueError("That is not a valid option") + + expe, options = buildConditions(options) + + done = [] + while np.mean(done) != 1: + done = [] + + for i in range(len(expe[phase]["trials"])): + done.append(expe[phase]["trials"][i]["done"]) + try: + itrial = done.index(0) + except ValueError: + break + trial = expe[phase]["trials"][itrial] + makeStimuli(options, trial) + expe[phase]["trials"][itrial]["done"] = 1 diff --git a/gender/gender_makeStimuli.py b/gender/gender_makeStimuli.py new file mode 100644 index 0000000..d389a41 --- /dev/null +++ b/gender/gender_makeStimuli.py @@ -0,0 +1,285 @@ +# -------------------------------------------------------------------------- +# Authors: +# ------ MATlAB ------ +# 2010-03-16: Etienne Gaudrain +# 2011-10-20: Etienne Gaudrain +# 2013-04-22: Etienne Gaudrain +# 2017-03-27: Etienne Gaudrain +# ------ Python ------ +# 2020-02-10: Luke Meyer < l.meyer.5@student.rug.nl > + +# Copyright MRC-CBSU(UK), CNRS(FR), UMCG(NL) and the author(s). + +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY +# without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see < http: // www.gnu.org/licenses/>. +# -------------------------------------------------------------------------- + +from pyworld import pyworld as pw +import numpy as np +import os +import math +import warnings +import logging +from time import clock +from scipy import interpolate +import scipy.io as spio +from scipy.signal import butter, filtfilt +import soundfile as sf +from playsound import playsound +from resampy import resample +import random +import collections +import matplotlib.pyplot as plt +# from audiotsm import phasevocoder +# from audiotsm.io.wav import WavReader, WavWriter +from tools.load_matrix import loadmat +from gender_removeSilence import removeSilence + +import sys + +# -- Uncomment for when using the MATLAB/Python API --- +# import matlab.engine +# future = matlab.engine.start_matlab(async=True) +# eng = future.result() +# eng.addpath('../Nao-PICKA scripts/Expe_files/lib/STRAIGHTV40_006b') + + +time_logger = logging.getLogger("time_logger") +expe_logger = logging.getLogger("expe_logger") + + +def makeStimuli(options, trial): + ''' + Generates the stimuli files for a given trial + and how the trial has been specified + ''' + + x = np.array([]) + t = clock() + y, fs = straight_process( + trial["word"], trial["f0"], trial["vtl"], None, options) + y = y * np.power(10, -options["attenuation_dB"]/20.0) + stim_time = clock() - t + time_logger.info( + "Time to generate single stimulus: {}".format(stim_time)) + + if fs != options["fs"]: + y = resample(y, options["fs"], fs, filter="kaiser_fast") + options["fs"] = fs + + # dl = int(round(options["word_duration"]*fs) - len(y)) + + # if dl > 0: + # # Adds padding because the syllable signal is too short + # npad_L = int(math.floor(dl/20)) + # npad_R = int(dl-npad_L) + + # nr = int(math.floor(1e-3 * fs)) + # y[0:nr] = y[0:nr] * np.linspace(0, 1, num=nr).conj().T + # y[len(y)-nr:] = y[len(y)-nr:] * np.linspace(1, 0, num=nr).T + + # y = np.concatenate( + # (np.zeros((npad_L,)), y, np.zeros((npad_R,)))) + + # elif dl < 0: + # # The synthesised signal is too long + # y = y[0:len(y)-dl] + # nr = int(math.floor(1e-3 * fs)) # 1 ms linear ramp at the end + # y[len(y)-nr:] = y[len(y)-nr:] * np.linspace(1, 0, num=nr).T + + # else: + # nr = int(math.floor(1e-3 * fs)) + # y[0:nr] = y[0:nr] * np.linspace(0, 1, num=nr).conj().T + # y[len(y)-nr:] = y[len(y)-nr:] * np.linspace(1, 0, num=nr).T + + # x = np.concatenate((x, y)) + + print "%s -- F0: %5.1f Hz, VTL: %4.2f \n" % ( + trial["word"], trial["f0"], trial["vtl"]) + + if options["lowpass"] != None: + b, a = butter(4, (options["lowpass"] * 2.0)/fs, 'low') + x = filtfilt(b, a, y) + + if options["ear"] == 'right': + x = np.matrix([np.zeros(np.size(x))], x) + elif options["ear"] == 'left': + x = np.matrix([x], [np.zeros(np.size(x))]) + elif options["ear"] == 'both': + x = np.tile(x, (2, 1)).T + else: + raise ValueError( + "Options.ear = {} is not implemented.".format(options["ear"])) + + return x, fs + + +def straight_process(word, nb_st, vtl, d, options): + ''' + Generates the individual stimuli files + ''' + + wavIn = os.path.join(options["sound_path"], word + ".wav") + wavOut = make_fname( + wavIn, nb_st, vtl, d, options["tmp_path"]) + y = [] + + if not os.path.exists(wavOut) or options["force_rebuild_sylls"]: + + mat = os.path.join(options["sound_path_store"], word + '.pyworld.mat') + # Intialise variables so they are accessible in the correct scope + f0 = [] + fs = 0 + sp = [] + ap = [] + freq = [] + temp_pos = [] + x_rms = 0 + + if os.path.exists(mat): + # Load the data from the .mat file + load_mat = loadmat(mat) + f0 = load_mat['f0'] + fs = load_mat['fs'] + sp = np.array(load_mat['sp']) + ap = np.array(load_mat['ap']) + # Needed for PyWorld + freq = np.array(load_mat["frequencies"]) + temp_pos = np.array(load_mat["temporal_positions"]) + x_rms = load_mat['x_rms'] + else: + pass + x, fs = sf.read(wavIn) + try: + x = x[:, 0] + except IndexError: + x = x[:] + x = np.ascontiguousarray(x, dtype=np.float) + # --- Using PyWORLD script + _f0, t = pw.dio(x, fs) + f0 = pw.stonemask(x, _f0, t, fs) + sp = pw.cheaptrick(x, f0, t, fs) + ap = pw.d4c(x, f0, t, fs) + freq = np.arange(0, np.size(sp, axis=1), + dtype='float64') / (np.size(sp)) * fs/2 + temp_pos = t + duration = len(x/fs) + + x_rms = np.sqrt(np.mean(x**2)) + + spio.savemat(mat, mdict={'fs': fs, 'f0': f0, + 'sp': sp, 'ap': ap, + 'x_rms': x_rms, + 'frequencies': freq, + 'temporal_positions': t, + 'duration': duration + }) + + f0[np.where(f0 != 0)] = f0[np.where(f0 != 0)] * \ + np.power(2, (nb_st/12)) + + mapp = 1 * np.power(2, -(vtl/12)) + + sp = sp_ap_creation(sp, temp_pos, freq, mapp) + ap = sp_ap_creation(ap, temp_pos, freq, mapp) + if f0.flags['C_CONTIGUOUS']: + f0 = np.ascontiguousarray(f0, dtype=np.float) + sp = np.ascontiguousarray( + sp, dtype=np.float) + ap = np.ascontiguousarray( + ap, dtype=np.float) + + y_mat = pw.synthesize(f0, sp, ap, fs) + + y = np.array(y_mat) + + y = y / np.sqrt(np.mean(y**2)) * x_rms + + my = np.amax(np.absolute(y)) + + y_magnitude_factor = 0 + + if np.amax(np.absolute(y)) > 1: + expe_logger.warn("Output was normalised for {}".format(wavOut)) + y_magnitude_factor = my/0.98 + y = 0.98 * y / np.amax(np.absolute(y)) + else: + y_magnitude_factor = 1.0 + + # y = removeSilence(y, fs, 50e-3) + + sf.write(wavOut, y, fs) + + y, fs = sf.read(wavOut) + + # axes = np.arange(0, len(y)) + # ax.plot(axes, y) + # fig.savefig("test1.png") + # plt.show() + + else: + y, fs = sf.read(wavOut) + + return y, fs + + +def make_fname(wav, f0, vtl, d, destPath): + '''Generates the file name for the new stimulus''' + + _, namext = os.path.split(wav) + name, ext = os.path.splitext(namext) + + try: + int(math.floor(f0)) + except ValueError as e: + print e + + if d == None: + fname = "%s_GPR%d_VTL%.2f" % ( + name, int(math.floor(f0)), vtl) + else: + + fname = "%s_GPR%d_VTL%.2f_D%d" % ( + name, int(math.floor(f0)), vtl, int(math.floor(d*1e3))) + fname = os.path.join(destPath, fname + ext) + + return fname + + +def sp_ap_creation(mat, temp, freq, vtl): + ''' + Interpolates the spectrogram and aperiodicity, respectively + using the same temporal positions, but new freq that takes + into account the ser value (ser = np.power(2, -dVTL/12)). + Ser is usually provided by the defined options in + expe_build_conditions + ''' + # x = np.arange(1, mat.shape[1]+1) + # y = np.arange(1, mat.shape[0]+1) + + # f = interpolate.interp2d(x, y, mat, kind='cubic') + f = interpolate.RectBivariateSpline(temp, freq, mat) + + if vtl != 0.0: + interp = f(temp, freq.T/vtl) + else: + interp = f(temp, freq.T/1.0) + + return interp + + # xs = np.arange(1, spe["spectrogram"].shape[1]+1) + # ys = np.arange(1, spe["spectrogram"].shape[0]+1) + # fis = interp2d(xs, ys, spe["spectrogram"], 'cubic') + # spe["spectrogram"] = fis(spe["temporal_positions"], + # spe["frequencies"]/ser) diff --git a/gender/gender_options.py b/gender/gender_options.py new file mode 100644 index 0000000..a9b3db1 --- /dev/null +++ b/gender/gender_options.py @@ -0,0 +1,51 @@ +import os +import warnings +import sys + + +def expe_options(options): + # options["result_path"] = "./results/gender" + options["result_path"] = "./results/" + options["subject_name"] + + options["sound_path"] = "./stimuli/gender/{}".format( + options["language"].lower()) + options["sound_path_store"] = "./stimuli_store/gender/{}".format( + options["language"].lower()) + if not os.path.exists(options["sound_path_store"]): + os.makedirs(options["sound_path_store"]) + if not os.path.exists(options["sound_path"]): + os.makedirs(options["sound_path"]) + + if not "Bert" in options: + options["Bert"] = False + + if options["Bert"]: + options["tmp_path"] = "./stimuli/gender/{}/processed/Bert".format( + options["language"].lower()) + else: + options["tmp_path"] = "./stimuli/gender/{}/processed".format( + options["language"].lower()) + + options["result_prefix"] = "gen_" + + if not os.listdir(options["sound_path"]): + raise ValueError("Sound path cannot be empty") + + if not os.path.exists(options["tmp_path"]): + os.makedirs(options["tmp_path"]) + + # if not os.listdir(options["tmp_path"]) and options["phase"] != "generation": + # opt = raw_input( + # "Running experiment without preprocessing sounds? (Y/n)") + # if opt.lower() == "y": + # warnings.warn( + # "This will slow down the experiment substantially. Press ctrl+c to cancel if unhappy") + # elif opt.lower() == "n": + # warnings.warn( + # "Recommended to preprocess stimuli files before running the experiment.") + # sys.exit() + # else: + # raise ValueError("That is not a valid option") + options["experiment_begin"] = 1 + + return options diff --git a/gender/gender_removeSilence.py b/gender/gender_removeSilence.py new file mode 100644 index 0000000..865db28 --- /dev/null +++ b/gender/gender_removeSilence.py @@ -0,0 +1,39 @@ +from cosgate import cosgate +from scipy.signal import butter, filtfilt +import numpy as np +import math + + +def removeSilence(y, fs, sampleDuration=750e-3): + + sampleDuration = np.array([sampleDuration, sampleDuration]) + + d1 = sampleDuration[0] + d2 = sampleDuration[1] + + b, a = butter(3, 50*2.0/fs, 'low') + fil = filtfilt(b, a, y) + fil = np.expand_dims(fil, axis=1) + e = np.max(fil, 1) + + e = cosgate(e, fs, 20e-3) + + c = 2 * np.max([np.array([[e[0:int(math.floor(d1*fs))]], + [e[len(e)-int(math.floor(d2*fs)):]]])]) + # FIXME : There is a clicking at the beginning and end of sound. Speak to Etienne + # Onset + i1 = np.min(((e[:-1] < c) & (e[1:] >= c)).nonzero()[0]) + + # offset + i2 = np.max(((e[:-1] < c) & (e[1:] >= c)).nonzero()[0]) + + m = math.floor(20e-3 * fs) + + i1 = int(np.max([1, i1 - m])) + i2 = int(np.max([len(y), i2 - m])) + + y = cosgate(y[i1:i2], fs, 1e-3) + + # bounds = np.array([i1, i2]) + + return y diff --git a/gender/gender_robot.py b/gender/gender_robot.py new file mode 100644 index 0000000..97d99a1 --- /dev/null +++ b/gender/gender_robot.py @@ -0,0 +1,218 @@ +import numpy as np +import os +import sys +import re +import random +import datetime +import soundfile as sf +import time +import logging +from playsound import playsound +from scipy.io import savemat +from gender_build_conditions import expe_build_conditions as buildConditions +from gender_makeStimuli import makeStimuli +from Robot.RobotGender import RobotGender +from tools.load_matrix import loadmat + + +def robot(expe, options, phase, lang, ip, port): + results = {} + gender_resp = {} + gender_resp[phase] = {} + starting = 1 + # if phase == "training": + # starting = 1 + + mat = loadmat(options["res_filename"]) + options = mat["options"] + expe = mat["expe"] + try: + results = mat['results'] + except KeyError: + # Create a new results dictionary if one is not found or this is a new subject + results = {} + + track = loadmat(options["res_tracker"]) + exp = track["tracker"] + # --- Start an instance of Sam + sam = type('', (), {})() + create_sam = True + if create_sam: + sam = RobotGender(ip, port, lang) + # --- Set the initial volume + # --- Open loggers + expe_logger = logging.getLogger("expe_logger") + time_logger = logging.getLogger("time_logger") + + autoplayer = False + terminate = 0 + if options["subject_name"] == 'NHAtest': + os.remove(options["res_filename"]) + autoplayer = True + + resultsFiles = [os.path.join(options["result_path"], f) for f in os.listdir( + options["result_path"]) if f.endswith(".mat")] + nRep = len(resultsFiles) - sum([bool(re.search(options["subject_name"], + resultsFiles[i])) for i in range(len(resultsFiles))]) + nRep = nRep + 1 + options["subject_name"] = "NHAtest" + options["res_filename"] = os.path.join( + options["result_path"], "%sen_%s_robot.mat" % ( + options["result_prefix"], options["subject_name"])) + + # expe, options = buildConditions(options) + + # === Main loop === + # Intialise the done array to store if a task has been completed + done = [] + expe_logger.info("##########\n\nStarting Gender experiment\n\n##########") + time_logger.info("##########\n\nStarting Gender experiment\n\n##########") + if starting and exp["experiment_begin"]: + try: + sam.intro() + sam.genderIntro() + except AttributeError: + pass + exp["experiment_begin"] = 0 + savemat(options["res_tracker"], mdict={"tracker": exp}) + elif starting: + try: + if phase == "test": + if lang == "EN": + sam.simple_say("Welcome to the testing phase of the game.") + elif lang == "NL": + sam.simple_say( + "Welkom bij de testronde van dit spelletje.") + except AttributeError: + pass + pass + starting = 0 + try: + sam.game_break() + except AttributeError: + pass + response_tracker = 0 + while np.mean(done) != 1: + response = {} + done = [expe[phase]["trials"][i]["done"] + for i in range(len(expe[phase]["trials"]))] + + if autoplayer: + starting = 1 + try: + itrial = done.index(0) + except ValueError: + break + expe_logger.info("\n=============== Testing trial {} / {} ============\n\n".format( + itrial+1, len(expe[phase]["trials"]))) + print "\n=============== Testing condition {} / {} ============\n\n".format( + itrial + 1, len(expe[phase]["trials"])) + trial = expe[phase]["trials"][itrial] + + t = time.time() + xOut, fs = makeStimuli(options, trial) + sf.write('stimulus.wav', xOut, fs) + time_logger.info( + "Time to generate sound file: {}".format(time.time() - t)) + + t = time.time() + # time.sleep(1) + try: + sam.aad.setOutputVolume(sam.stimulus_volume) + sam.play_sounds('stimulus.wav', lang) + sam.aad.setOutputVolume(sam.speaking_volume) + except AttributeError: + pass + # time.sleep(2) + time_logger.info( + "Time to upload and play sound file: {}".format(time.time() - t)) + + os.remove('stimulus.wav') + + try: + resp, chosen_gen = sam.answer() + except AttributeError: + pass + # resp = random.randint(0, 1) + # chosen_gen = ["Boy", "Girl"][np.random.randint(2)] + if autoplayer: + response["response_answer"] = { + "answer": [0, 1][np.random.randint(0, 2)], + "gender": ["Girl", "Boy"][np.random.randint(0, 2)] + } + response["response_time"] = 0 + response["timestamp"] = str(datetime.datetime.now()) + else: + t = time.time() + response["response_answer"] = resp + response["response_time"] = time.time() - t + response["timestamp"] = str(datetime.datetime.now()) + + response["trial"] = trial + + if not phase in results: + results[phase] = {} + results[phase]["responses"] = {} + # results[phase]["responses"] = [] + + # else: + # results[phase]["responses"] = np.append( + # results[phase]["responses"], response) + + results[phase]["responses"]["r" + str(response_tracker)] = response + response_tracker += 1 + + expe[phase]["trials"][itrial]["done"] = 1 + try: + gender_resp_temp = {} + gender_resp_temp["answer"] = chosen_gen + gender_resp_temp["f0(st)"] = trial["f0"] + gender_resp_temp["VTL(st)"] = trial["vtl"] + gender_resp_temp["face_used"] = trial["face_gender"] + + gender_resp[phase]["trial_" + str(itrial + 1)] = gender_resp_temp + except UnboundLocalError: + pass + + if gender_resp_temp: + savemat(options["res_filename"], mdict={ + "options": options, "expe": expe, "results": results, "gender_response": gender_resp}) + else: + savemat(options["res_filename"], mdict={ + "options": options, "expe": expe, "results": results}) + + if itrial == options[phase]["total_ntrials"]: + break + + if phase == "training": + try: + if lang == "EN": + sam.simple_say("That's the end of the training phase") + elif lang == "NL": + sam.simple_say("Dit is het einde van de oefenronde ") + except AttributeError: + pass + pass + else: + exp["experiments"]["gender"] = 1 + savemat(options["res_tracker"], mdict={"tracker": exp}) + + exp_tracker = np.array([exp["experiments"][key] + for key in exp["experiments"].keys()]) + try: + if lang == "EN": + sam.simple_say( + "That's the end of the testing phase, and the end of this game.") + elif lang == "NL": + sam.simple_say( + "Dit is het einde van de test, en het einde van dit spelletje.") + + except AttributeError: + pass + + if np.mean(exp_tracker) == 1: + try: + sam.ending() + except AttributeError: + pass + pass diff --git a/gender/gender_run.py b/gender/gender_run.py new file mode 100644 index 0000000..8586b94 --- /dev/null +++ b/gender/gender_run.py @@ -0,0 +1,56 @@ +import os +from gender_options import expe_options as genOptions +from gender_build_conditions import expe_build_conditions as buildConditions +from gender_generateStimuli import generateStimuli +from gender_robot import robot +from tools.load_matrix import loadmat +from scipy.io import savemat + + +def main(options, subject, phase, language, p_exists=None, ip="127.0.0.1", port=9559): + options["subject_name"] = subject + options["language"] = language + options["phase"] = phase + options["Bert"] = False + options = genOptions(options) + try: + if not os.path.exists(options["result_path"]): + os.makedirs(options["result_path"]) + except Exception as e: + print e + res_filename = os.path.join(options["result_path"], "{}{}_{}_robot.mat".format( + options["result_prefix"], language.lower(), subject)) + options["res_filename"] = res_filename + + res_tracker = os.path.join( + options["result_path"], '{}_tracker.mat'.format(subject)) + options["res_tracker"] = res_tracker + if not os.path.exists(res_tracker): + track = {} + track["experiments"] = {} + track["experiment_begin"] = 1 + track["experiments"]["fishy"] = 0 + track["experiments"]["gender"] = 0 + track["experiments"]["emotion"] = 0 + track["experiments"]["crm"] = 0 + + savemat(res_tracker, mdict={"tracker": track}) + + if options["subject_name"] == "generation": + generateStimuli(options, phase) + else: + if not os.path.exists(res_filename): + expe, options = buildConditions(options) + else: + mat = loadmat(options["res_filename"]) + expe = mat["expe"] + options = mat["options"] + + robot(expe, options, phase, language, ip, port) + + +if __name__ == "__main__": + options = {} + options["experiment_begin"] = 1 + + main(options, "generation", "test", "nl") diff --git a/gender/gender_run.py.a4ae285b051cd69ff41d07bef6652974.tmp b/gender/gender_run.py.a4ae285b051cd69ff41d07bef6652974.tmp new file mode 100644 index 0000000..e69de29 diff --git a/html/nao_sayingvvvv.png b/html/nao_sayingvvvv.png new file mode 100644 index 0000000..53d3fcd Binary files /dev/null and b/html/nao_sayingvvvv.png differ diff --git a/picka.py b/picka.py new file mode 100644 index 0000000..20f9db0 --- /dev/null +++ b/picka.py @@ -0,0 +1,121 @@ +import tools.settings as settings +import logging +import os +from fishy.expe_run import main as fishy_main +from gender.gender_run import main as gender_main +# from emotion.emotion_run import main as emotion_main +from crm.crm_run import main as crm_main +from naoqi import ALBroker +from tools.exit_condition import ExitExperimentModule +import tools.settings as settings +import pathlib + +VERSION = 20202801 +expe_exit = None + + +def setup_logger(name, log_file, level=logging.INFO): + """To setup as many loggers as you want""" + formatter = logging.Formatter('%(levelname)s:%(message)s') + handler = logging.FileHandler(log_file) + handler.setFormatter(formatter) + + logger = logging.getLogger(name) + logger.setLevel(level) + logger.addHandler(handler) + logger.propagate = False + + return logger + + +def pickaMain(subject, + game, + phase, + lang, + p_exists, + ip='127.0.0.1', + port=9559, + broker=False, + cel_id=None): + global expe_exit + settings.task_id = cel_id + print settings.task_id + if not os.path.exists('./calibration.mat'): + raise "Calibration has not been done for any of the sound files yet. \ + Please do this before before continuing with the PICKA experiment." + + try: + if not broker: + myBroker = ALBroker("myBroker", "0.0.0.0", 0, str(ip), port) + expe_exit = ExitExperimentModule("expe_exit", myBroker, lang) + pass + else: + gameBroker = ALBroker("gameBroker", "0.0.0.1", 0, str(ip), port) + except RuntimeError as e: + print e + pass + + options = {} + p_exists = p_exists == 'true' + if game.lower() == "fishy": + fishy_main(options, subject, phase, lang, p_exists, ip, port) + elif game.lower() == "gender": + gender_main(options, subject, phase, lang, p_exists, ip, port) + elif game.lower() == "emotion": + emotion_main(options, subject, phase, lang, p_exists, ip, port) + elif game.lower() == "crm": + crm_main(options, subject, phase, lang, p_exists, ip, port) + + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser( + description="The main script used to run SAM", + epilog= + "Written by Luke Meyer , adapted from MATLAB script by Etienne Gaudrain \nCopyright 2017 CNRS (FR), UMCG (NL)", + formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('-ip', + '--ipadress', + help="The ipadress of SAM.", + default='127.0.0.1') + parser.add_argument('-pp', + '--port', + help="Port that SAM has open for connection.", + default=9559, + type=int) + parser.add_argument('-g', + '--game', + help="The game for the current experiment.", + choices=["gender", "fishy", "emotion", "crm"], + required=True) + parser.add_argument('--version', + help="Displays current version", + action='version', + version='Version = {}'.format(VERSION)) + parser.add_argument('-s', + '--subject', + help="Name of the subject perfomring the test.", + required=True) + parser.add_argument('-p', + '--phase', + help="Phase of testing. Test or training", + required=True) + parser.add_argument( + '-l', + '--lang', + help="Language in which experiment should be conducted.", + default="EN", + choices=["EN", "NL"], + required=True) + parser.add_argument( + '-e', + '--file_exists', + help= + "Optional parameter if it is already known that a participant's results file already exists or not." + ) + + args = parser.parse_args() + + pickaMain(args.subject, args.game, args.phase, args.lang, args.file_exists, + args.ipadress, 9559) diff --git a/picka_definition.py b/picka_definition.py new file mode 100644 index 0000000..3867d27 --- /dev/null +++ b/picka_definition.py @@ -0,0 +1,25 @@ +def main(): + PICKA = {} + + i = 0 + + PICKA["def" + str(i)] = {} + PICKA["def" + str(i)]["folder"] = "./fishy" + PICKA["def" + str(i)]["prefix"] = "expe" + + i += 1 + PICKA["def" + str(i)] = {} + PICKA["def" + str(i)]["folder"] = "./gender" + PICKA["def" + str(i)]["prefix"] = "gender" + + i += 1 + PICKA["def" + str(i)] = {} + PICKA["def" + str(i)]["folder"] = "./emotion" + PICKA["def" + str(i)]["prefix"] = "emotion" + + i += 1 + PICKA["def" + str(i)] = {} + PICKA["def" + str(i)]["folder"] = "./crm" + PICKA["def" + str(i)]["prefix"] = "crm" + + return PICKA diff --git a/preprocess_picka.py b/preprocess_picka.py new file mode 100644 index 0000000..ce26a8d --- /dev/null +++ b/preprocess_picka.py @@ -0,0 +1,53 @@ +import sys + +from gender.gender_run import main as gender_run +from fishy.preprocess import preprocess as fishy_preprocess +from crm.preprocess_corpus import preprocess as crm_preprocess_corpus + + +def preprocess(language): + r = raw_input( + "Would you like to preprocess all stimuli? It will take approx. 5 min. (Y/n): ") + + if r.lower() == 'y': + pass + elif r.lower() == 'n': + sys.exit() + else: + raise "That is not a valid option." + + print "==== Preprocessing for fishy ====" + try: + fishy_preprocess(language) + except: + raise Exception("There was an error with fishy preprocess.") + + print "==== Preprocessing for Gender ====" + + try: + options = {} + gender_run(options, "generation", "test", language) + except: + raise Exception( + "There was an error preporocessing the gender stimuli.") + + print "==== Preprocessing for CRM ====" + + try: + crm_preprocess_corpus("all", language, 0) + except: + raise Exception("There was an error preprocessing the CRM corpus.") + + print "Preprocessing completed." + print "Calibration must still be performed." + + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser() + parser.add_argument("--language", "-l", + help="Language for preprocessing", required=True) + + args = parser.parse_args() + preprocess(args.language) diff --git a/pyworld/pyworld.pyx b/pyworld/pyworld.pyx new file mode 100644 index 0000000..6c8f9ab --- /dev/null +++ b/pyworld/pyworld.pyx @@ -0,0 +1,658 @@ +from __future__ import division +import cython + +import numpy as np +cimport numpy as np +np.import_array() + + +cdef extern from "world/synthesis.h": + void Synthesis(const double *f0, + int f0_length, const double * const *spectrogram, + const double * const *aperiodicity, + int fft_size, double frame_period, + int fs, int y_length, double *y) except + + + +cdef extern from "world/cheaptrick.h": + ctypedef struct CheapTrickOption: + double q1 + double f0_floor + int fft_size + + int GetFFTSizeForCheapTrick(int fs, const CheapTrickOption *option) except + + double GetF0FloorForCheapTrick(int fs, int fft_size) except + + void InitializeCheapTrickOption(int fs, CheapTrickOption *option) except + + void CheapTrick(const double *x, int x_length, int fs, const double *temporal_positions, + const double *f0, int f0_length, const CheapTrickOption *option, + double **spectrogram) except + + + +cdef extern from "world/dio.h": + ctypedef struct DioOption: + double f0_floor + double f0_ceil + double channels_in_octave + double frame_period + int speed + double allowed_range + + void InitializeDioOption(DioOption *option) except + + int GetSamplesForDIO(int fs, int x_length, double frame_period) + void Dio(const double *x, int x_length, int fs, const DioOption *option, + double *temporal_positions, double *f0) except + + + +cdef extern from "world/harvest.h": + ctypedef struct HarvestOption: + double f0_floor + double f0_ceil + double frame_period + + void InitializeHarvestOption(HarvestOption *option) + int GetSamplesForHarvest(int fs, int x_length, double frame_period) + void Harvest(const double *x, int x_length, int fs, const HarvestOption *option, + double *temporal_positions, double *f0) except + + + +cdef extern from "world/d4c.h": + ctypedef struct D4COption: + double threshold + + void InitializeD4COption(D4COption *option) except + + void D4C(const double *x, int x_length, int fs, const double *temporal_positions, + const double *f0, int f0_length, int fft_size, const D4COption *option, + double **aperiodicity) except + + + +cdef extern from "world/stonemask.h": + void StoneMask(const double *x, int x_length, int fs, + const double *temporal_positions, const double *f0, int f0_length, + double *refined_f0) except + + + +cdef extern from "world/codec.h": + int GetNumberOfAperiodicities(int fs) + void CodeAperiodicity(const double * const *aperiodicity, int f0_length, + int fs, int fft_size, double **coded_aperiodicity) except + + void DecodeAperiodicity(const double * const *coded_aperiodicity, + int f0_length, int fs, int fft_size, double **aperiodicity) except + + void CodeSpectralEnvelope(const double * const *spectrogram, int f0_length, + int fs, int fft_size, int number_of_dimensions, + double **coded_spectral_envelope) except + + void DecodeSpectralEnvelope(const double * const *coded_spectral_envelope, + int f0_length, int fs, int fft_size, int number_of_dimensions, + double **spectrogram) except + + + +default_frame_period = 5.0 +default_f0_floor = 71.0 +default_f0_ceil = 800.0 + + +def dio(np.ndarray[double, ndim=1, mode="c"] x not None, int fs, + f0_floor=default_f0_floor, f0_ceil=default_f0_ceil, + channels_in_octave=2.0, frame_period=default_frame_period, + speed=1, allowed_range=0.1): + """DIO F0 extraction algorithm. + + Parameters + ---------- + x : ndarray + Input waveform signal. + fs : int + Sample rate of input signal in Hz. + f0_floor : float + Lower F0 limit in Hz. + Default: 71.0 + f0_ceil : float + Upper F0 limit in Hz. + Default: 800.0 + channels_in_octave : float + Resolution of multiband processing; normally shouldn't be changed. + Default: 2.0 + frame_period : float + Period between consecutive frames in milliseconds. + Default: 5.0 + speed : int + The F0 estimator may downsample the input signal using this integer factor + (range [1;12]). The algorithm will then operate on a signal at fs/speed Hz + to reduce computational complexity, but high values may negatively impact + accuracy. + Default: 1 (no downsampling) + allowed_range : float + Threshold for voiced/unvoiced decision. Can be any value >= 0, but 0.02 to 0.2 + is a reasonable range. Lower values will cause more frames to be considered + unvoiced (in the extreme case of `threshold=0`, almost all frames will be unvoiced). + Default: 0.1 + + Returns + ------- + f0 : ndarray + Estimated F0 contour. + temporal_positions : ndarray + Temporal position of each frame. + """ + cdef int x_length = len(x) + cdef DioOption option + InitializeDioOption(&option) + option.channels_in_octave = channels_in_octave + option.f0_floor = f0_floor + option.f0_ceil = f0_ceil + option.frame_period = frame_period + option.speed = speed + option.allowed_range = allowed_range + f0_length = GetSamplesForDIO(fs, x_length, option.frame_period) + cdef np.ndarray[double, ndim=1, mode="c"] f0 = \ + np.zeros(f0_length, dtype=np.dtype('float64')) + cdef np.ndarray[double, ndim=1, mode="c"] temporal_positions = \ + np.zeros(f0_length, dtype=np.dtype('float64')) + Dio(&x[0], x_length, fs, &option, &temporal_positions[0], &f0[0]) + return f0, temporal_positions + + +def harvest(np.ndarray[double, ndim=1, mode="c"] x not None, int fs, + f0_floor=default_f0_floor, f0_ceil=default_f0_ceil, + frame_period=default_frame_period): + """Harvest F0 extraction algorithm. + + Parameters + ---------- + x : ndarray + Input waveform signal. + fs : int + Sample rate of input signal in Hz. + f0_floor : float + Lower F0 limit in Hz. + Default: 71.0 + f0_ceil : float + Upper F0 limit in Hz. + Default: 800.0 + frame_period : float + Period between consecutive frames in milliseconds. + Default: 5.0 + + Returns + ------- + f0 : ndarray + Estimated F0 contour. + temporal_positions : ndarray + Temporal position of each frame. + """ + cdef int x_length = len(x) + cdef HarvestOption option + InitializeHarvestOption(&option) + option.f0_floor = f0_floor + option.f0_ceil = f0_ceil + option.frame_period = frame_period + f0_length = GetSamplesForHarvest(fs, x_length, option.frame_period) + cdef np.ndarray[double, ndim=1, mode="c"] f0 = \ + np.zeros(f0_length, dtype=np.dtype('float64')) + cdef np.ndarray[double, ndim=1, mode="c"] temporal_positions = \ + np.zeros(f0_length, dtype=np.dtype('float64')) + Harvest(&x[0], x_length, fs, &option, &temporal_positions[0], &f0[0]) + return f0, temporal_positions + + +def stonemask(np.ndarray[double, ndim=1, mode="c"] x not None, + np.ndarray[double, ndim=1, mode="c"] f0 not None, + np.ndarray[double, ndim=1, mode="c"] temporal_positions not None, + int fs): + """StoneMask F0 refinement algorithm. + + Parameters + ---------- + x : ndarray + Input waveform signal. + f0 : ndarray + Input F0 contour. + temporal_positions : ndarray + Temporal positions of each frame. + fs : int + Sample rate of input signal in Hz. + + Returns + ------- + refined_f0 : ndarray + Refined F0 contour. + """ + cdef int x_length = len(x) + cdef int f0_length = len(f0) + cdef np.ndarray[double, ndim=1, mode="c"] refined_f0 = \ + np.zeros(f0_length, dtype=np.dtype('float64')) + StoneMask(&x[0], x_length, fs, &temporal_positions[0], + &f0[0], f0_length, &refined_f0[0]) + return refined_f0 + + +def get_cheaptrick_fft_size(fs, f0_floor=default_f0_floor): + """Calculate suitable FFT size for CheapTrick given F0 floor. + + Parameters + ---------- + fs : int + Sample rate of input signal in Hz. + f0_floor : float + Lower F0 limit in Hz. The required FFT size is a direct + consequence of the F0 floor used. + Default: 71.0 + + Returns + ------- + fft_size : int + Resulting FFT size. + """ + cdef CheapTrickOption option + option.f0_floor = f0_floor + cdef int fft_size = GetFFTSizeForCheapTrick(fs, &option) + return fft_size + +def get_cheaptrick_f0_floor(fs, fft_size): + """Calculates actual lower F0 limit for CheapTrick + based on the sampling frequency and FFT size used. Whenever F0 is below + this threshold the spectrum will be analyzed as if the frame is unvoiced + (using kDefaultF0 defined in constantnumbers.h). + + Parameters + ---------- + fs : int + Sample rate of input signal in Hz. + fft_size : int + FFT size used for CheapTrick. + + Returns + ------- + f0_floor : float + Resulting lower F0 limit in Hz. + """ + cdef double f0_floor = GetF0FloorForCheapTrick(fs, fft_size) + return f0_floor + +def cheaptrick(np.ndarray[double, ndim=1, mode="c"] x not None, + np.ndarray[double, ndim=1, mode="c"] f0 not None, + np.ndarray[double, ndim=1, mode="c"] temporal_positions not None, + int fs, + q1=-0.15, f0_floor=default_f0_floor, fft_size=None): + """CheapTrick harmonic spectral envelope estimation algorithm. + + Parameters + ---------- + x : ndarray + Input waveform signal. + f0 : ndarray + Input F0 contour. + temporal_positions : ndarray + Temporal positions of each frame. + fs : int + Sample rate of input signal in Hz. + q1 : float + Spectral recovery parameter. + Default: -0.15 (this value was tuned and normally does not need adjustment) + f0_floor : float, None + Lower F0 limit in Hz. Not used in case `fft_size` is specified. + Default: 71.0 + fft_size : int, None + FFT size to be used. When `None` (default) is used, the FFT size is computed + automatically as a function of the given input sample rate and F0 floor. + When `fft_size` is specified, the given `f0_floor` parameter is ignored. + Default: None + + Returns + ------- + spectrogram : ndarray + Spectral envelope (squared magnitude). + """ + cdef CheapTrickOption option + InitializeCheapTrickOption(fs, &option) + option.q1 = q1 + if fft_size is None: + option.f0_floor = f0_floor # CheapTrickOption.f0_floor is only used in GetFFTSizeForCheapTrick() + option.fft_size = GetFFTSizeForCheapTrick(fs, &option) + else: + option.fft_size = fft_size + # the f0_floor used by CheapTrick() will be re-compute from this given fft_size + cdef int x_length = len(x) + cdef int f0_length = len(f0) + + cdef double[:, ::1] spectrogram = np.zeros((f0_length, option.fft_size//2 + 1), + dtype=np.dtype('float64')) + cdef np.intp_t[:] tmp = np.zeros(f0_length, dtype=np.intp) + cdef double **cpp_spectrogram = ( &tmp[0]) + cdef np.intp_t i + for i in range(f0_length): + cpp_spectrogram[i] = &spectrogram[i, 0] + + CheapTrick(&x[0], x_length, fs, &temporal_positions[0], + &f0[0], f0_length, &option, cpp_spectrogram) + return np.array(spectrogram, dtype=np.float64) + + +def d4c(np.ndarray[double, ndim=1, mode="c"] x not None, + np.ndarray[double, ndim=1, mode="c"] f0 not None, + np.ndarray[double, ndim=1, mode="c"] temporal_positions not None, + int fs, + threshold=0.85, fft_size=None): + """D4C aperiodicity estimation algorithm. + + Parameters + ---------- + x : ndarray + Input waveform signal. + f0 : ndarray + Input F0 contour. + temporal_positions : ndarray + Temporal positions of each frame. + fs : int + Sample rate of input signal in Hz. + q1 : float + Spectral recovery parameter. + Default: -0.15 (this value was tuned and normally does not need adjustment) + threshold : float + Threshold for aperiodicity-based voiced/unvoiced decision, in range 0 to 1. + If a value of 0 is used, voiced frames will be kept voiced. If a value > 0 is + used some voiced frames can be considered unvoiced by setting their aperiodicity + to 1 (thus synthesizing them with white noise). Using `threshold=0` will result + in the behavior of older versions of D4C. The current default of 0.85 is meant + to be used in combination with the Harvest F0 estimator, which was designed to have + a high voiced/unvoiced threshold (i.e. most frames will be considered voiced). + Default: 0.85 + fft_size : int, None + FFT size to be used. When `None` (default) is used, the FFT size is computed + automatically as a function of the given input sample rate and the default F0 floor. + When `fft_size` is specified, it should match the FFT size used to compute + the spectral envelope (i.e. `fft_size=2*(sp.shape[1] - 1)`) in order to get the + desired results when resynthesizing. + Default: None + + Returns + ------- + aperiodicity : ndarray + Aperiodicity (envelope, linear magnitude relative to spectral envelope). + """ + cdef int x_length = len(x) + cdef int f0_length = len(f0) + cdef int fft_size0 + if fft_size is None: + fft_size0 = get_cheaptrick_fft_size(fs, default_f0_floor) + else: + fft_size0 = fft_size + + cdef D4COption option + InitializeD4COption(&option) + option.threshold = threshold + + cdef double[:, ::1] aperiodicity = np.zeros((f0_length, fft_size0//2 + 1), + dtype=np.dtype('float64')) + cdef np.intp_t[:] tmp = np.zeros(f0_length, dtype=np.intp) + cdef double **cpp_aperiodicity = ( &tmp[0]) + cdef np.intp_t i + for i in range(f0_length): + cpp_aperiodicity[i] = &aperiodicity[i, 0] + + D4C(&x[0], x_length, fs, &temporal_positions[0], + &f0[0], f0_length, fft_size0, &option, + cpp_aperiodicity) + return np.array(aperiodicity, dtype=np.float64) + + + def synthesize(np.ndarray[double, ndim=1, mode="c"] f0 not None, + np.ndarray[double, ndim=2, mode="c"] spectrogram not None, + np.ndarray[double, ndim=2, mode="c"] aperiodicity not None, + int fs, + double frame_period=default_frame_period): + """WORLD synthesis from parametric representation. + + Parameters + ---------- + f0 : ndarray + Input F0 contour. + spectrogram : ndarray + Spectral envelope. + aperiodicity : ndarray + Aperodicity envelope. + fs : int + Sample rate of input signal in Hz. + frame_period : float + Period between consecutive frames in milliseconds. + Default: 5.0 + + Returns + ------- + y : ndarray + Output waveform signal. + """ + if (f0.shape[0] != spectrogram.shape[0] or + f0.shape[0] != aperiodicity.shape[0]): + raise ValueError('Mismatched number of frames between F0 ({:d}), ' + 'spectrogram ({:d}) and aperiodicty ({:d})' + .format(f0.shape[0], spectrogram.shape[0], + aperiodicity.shape[0])) + if spectrogram.shape[1] != aperiodicity.shape[1]: + raise ValueError('Mismatched dimensionality (spec size) between ' + 'spectrogram ({:d}) and aperiodicity ({:d})' + .format(spectrogram.shape[1], aperiodicity.shape[1])) + + cdef int f0_length = len(f0) + y_length = int(f0_length * frame_period * fs / 1000) + cdef int fft_size = (spectrogram.shape[1] - 1)*2 + cdef np.ndarray[double, ndim=1, mode="c"] y = \ + np.zeros(y_length, dtype=np.dtype('float64')) + + cdef double[:, ::1] spectrogram0 = spectrogram + cdef double[:, ::1] aperiodicity0 = aperiodicity + cdef np.intp_t[:] tmp = np.zeros(f0_length, dtype=np.intp) + cdef np.intp_t[:] tmp2 = np.zeros(f0_length, dtype=np.intp) + cdef double **cpp_spectrogram = ( &tmp[0]) + cdef double **cpp_aperiodicity = ( &tmp2[0]) + cdef np.intp_t i + for i in range(f0_length): + cpp_spectrogram[i] = &spectrogram0[i, 0] + cpp_aperiodicity[i] = &aperiodicity0[i, 0] + + Synthesis(&f0[0], f0_length, cpp_spectrogram, + cpp_aperiodicity, fft_size, frame_period, fs, y_length, &y[0]) + return y + + +def get_num_aperiodicities(fs): + """Calculate the required dimensionality to code D4C aperiodicity. + + Parameters + ---------- + fs : int + Sample rate of input signal in Hz. + + Returns + ------- + n_aper : int + Required number of coefficients. + """ + cdef int n_aper = GetNumberOfAperiodicities(fs) + return n_aper + +def code_aperiodicity(np.ndarray[double, ndim=2, mode="c"] aperiodicity, fs): + """Reduce dimensionality of D4C aperiodicity. + + Parameters + ---------- + aperiodicity : ndarray + Aperodicity envelope. + fs : int + Sample rate of input signal in Hz. + + Returns + ------- + coded_aperiodicity : ndarray + Coded aperiodicity envelope. + """ + cdef int ap_length = len(aperiodicity) + cdef int fft_size = (aperiodicity.shape[1] - 1)*2 + cdef int n_coded_aper = get_num_aperiodicities(fs) + + cdef double[:, ::1] aper = aperiodicity + cdef double[:, ::1] coded_aper = np.zeros((ap_length, n_coded_aper), + dtype=np.dtype('float64')) + cdef np.intp_t[:] tmp1 = np.zeros(ap_length, dtype=np.intp) + cdef np.intp_t[:] tmp2 = np.zeros(ap_length, dtype=np.intp) + cdef double **cpp_aper = ( &tmp1[0]) + cdef double **cpp_coded_aper = ( &tmp2[0]) + cdef np.intp_t i + for i in range(ap_length): + cpp_aper[i] = &aper[i, 0] + cpp_coded_aper[i] = &coded_aper[i, 0] + + CodeAperiodicity(cpp_aper, ap_length, fs, + fft_size, cpp_coded_aper) + + return np.array(coded_aper, dtype=np.float64) + +def decode_aperiodicity(np.ndarray[double, ndim=2, mode="c"] coded_aperiodicity, + fs, fft_size): + """Restore full dimensionality of coded D4C aperiodicity. + + Parameters + ---------- + coded_aperiodicity : ndarray + Coded aperodicity envelope. + fs : int + Sample rate of input signal in Hz. + fft_size : int + FFT size corresponding to the full dimensional aperiodicity. + + Returns + ------- + aperiodicity : ndarray + Aperiodicity envelope. + """ + cdef int ap_length = len(coded_aperiodicity) + cdef int n_coded_aper = get_num_aperiodicities(fs) + if n_coded_aper != coded_aperiodicity.shape[1]: + raise ValueError('Invalid aperiodicity code dimensionality ' + '(was: {:d}, expected: {:d})' + .format(coded_aperiodicity.shape[1], n_coded_aper)) + + cdef double[:, ::1] coded_aper = coded_aperiodicity + cdef double[:, ::1] aper = np.zeros((ap_length, fft_size//2 + 1), + dtype=np.dtype('float64')) + cdef np.intp_t[:] tmp1 = np.zeros(ap_length, dtype=np.intp) + cdef np.intp_t[:] tmp2 = np.zeros(ap_length, dtype=np.intp) + cdef double **cpp_coded_aper = ( &tmp1[0]) + cdef double **cpp_aper = ( &tmp2[0]) + cdef np.intp_t i + for i in range(ap_length): + cpp_coded_aper[i] = &coded_aper[i, 0] + cpp_aper[i] = &aper[i, 0] + + DecodeAperiodicity(cpp_coded_aper, ap_length, fs, fft_size, cpp_aper) + + return np.array(aper, dtype=np.float64) + +def code_spectral_envelope(np.ndarray[double, ndim=2, mode="c"] spectrogram, fs, + number_of_dimensions): + """Reduce dimensionality of spectral envelope. + + Parameters + ---------- + spectrogram : ndarray + Spectral envelope. + fs : int + Sample rate of input signal in Hz. + number_of_dimensions : int + Number of dimentions of coded spectral envelope + + Returns + ------- + coded_spectral_envelope : ndarray + Coded spectral envelope. + """ + cdef int sp_length = len(spectrogram) + cdef int fft_size = (spectrogram.shape[1] - 1)*2 + + cdef double[:, ::1] sp = spectrogram + cdef double[:, ::1] coded_sp = np.zeros((sp_length, number_of_dimensions), + dtype=np.dtype('float64')) + cdef np.intp_t[:] tmp1 = np.zeros(sp_length, dtype=np.intp) + cdef np.intp_t[:] tmp2 = np.zeros(sp_length, dtype=np.intp) + cdef double **cpp_sp = ( &tmp1[0]) + cdef double **cpp_coded_sp = ( &tmp2[0]) + cdef np.intp_t i + for i in range(sp_length): + cpp_sp[i] = &sp[i, 0] + cpp_coded_sp[i] = &coded_sp[i, 0] + + CodeSpectralEnvelope(cpp_sp, sp_length, fs, fft_size, + number_of_dimensions, cpp_coded_sp) + + return np.array(coded_sp, dtype=np.float64) + +def decode_spectral_envelope(np.ndarray[double, ndim=2, mode="c"] coded_spectral_envelope, + fs, fft_size): + """Restore full dimensionality of coded spectral envelope. + + Parameters + ---------- + coded_spectral_envelope : ndarray + Coded spectral envelope. + fs : int + Sample rate of input signal in Hz. + fft_size : int + FFT size corresponding to the full dimensional spectral envelope. + + Returns + ------- + spectrogram : ndarray + Spectral envelope. + """ + cdef int sp_length = len(coded_spectral_envelope) + cdef int number_of_dimensions = len(coded_spectral_envelope[0]) + cdef double[:, ::1] coded_sp = coded_spectral_envelope + cdef double[:, ::1] sp = np.zeros((sp_length, fft_size//2 + 1), + dtype=np.dtype('float64')) + cdef np.intp_t[:] tmp1 = np.zeros(sp_length, dtype=np.intp) + cdef np.intp_t[:] tmp2 = np.zeros(sp_length, dtype=np.intp) + cdef double **cpp_coded_sp = ( &tmp1[0]) + cdef double **cpp_sp = ( &tmp2[0]) + cdef np.intp_t i + for i in range(sp_length): + cpp_coded_sp[i] = &coded_sp[i, 0] + cpp_sp[i] = &sp[i, 0] + + DecodeSpectralEnvelope(cpp_coded_sp, sp_length, fs, fft_size, + number_of_dimensions, cpp_sp) + + return np.array(sp, dtype=np.float64) + +def wav2world(x, fs, fft_size=None, frame_period=default_frame_period): + """Convenience function to do all WORLD analysis steps in a single call. + + In this case only `frame_period` can be configured and other parameters + are fixed to their defaults. Likewise, F0 estimation is fixed to + DIO plus StoneMask refinement. + + Parameters + ---------- + x : ndarray + Input waveform signal. + fs : int + Sample rate of input signal in Hz. + frame_period : float + Period between consecutive frames in milliseconds. + Default: 5.0 + fft_size : int + Length of Fast Fourier Transform (in number of samples) + The resulting dimension of `ap` adn `sp` will be `fft_size` // 2 + 1 + + Returns + ------- + f0 : ndarray + F0 contour. + sp : ndarray + Spectral envelope. + ap : ndarray + Aperiodicity. + """ + _f0, t = dio(x, fs, frame_period=frame_period) + f0 = stonemask(x, _f0, t, fs) + sp = cheaptrick(x, f0, t, fs, fft_size=fft_size) + ap = d4c(x, f0, t, fs, fft_size=fft_size) + return f0, sp, ap diff --git a/pyworld/pyworld.so b/pyworld/pyworld.so new file mode 100644 index 0000000..85f4f9f Binary files /dev/null and b/pyworld/pyworld.so differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a3e56cc Binary files /dev/null and b/requirements.txt differ diff --git a/spaeker_compare.txt b/spaeker_compare.txt new file mode 100644 index 0000000..23201e3 --- /dev/null +++ b/spaeker_compare.txt @@ -0,0 +1,25 @@ + +65 dB calibrated laptop -14 attenuation + +24.6, 24.6, 24.6, 24.6, 24.6, 24.6, 27.6, 24.6, 41.0, 41.5, 39.3, 53.6, 58.9, 52.6, 54.1, 51.8, 61.1, 53.6, 52.5, 45.8, 38.4, 40.8, 39.0, 39.3, 40.6, 41.4 + +unattenuated laptop + +24.6, 24.6, 24.6, 24.6, 24.6, 27.6, 60.6, 38.4, 51.9, 55.0, 58.1, 68.4, 69.7, 65.8, 67.6, 68.3, 75.4, 71.3, 65.2, 62.1, 49.8, 54.0, 46.0, 39.6, 40.3, 41.4 + +65 dB calibrated Sam -16 attenuation + +24.6, 24.6, 24.6, 24.6, 24.6, 37.6, 33.6, 32.3, 55.5, 54.0, 63.7, 49.1, 39.6, 38.7, 47.0, 44.6, 49.1, 51.5, 45.8, 38.4, 40.3, 38.4, 38.4, 39.6, 40.3, 41.4 + +unattenuated Sam + +24.6, 24.6, 24.6, 24.6, 30.6, 53.3, 48.4, 48.0, 70.9, 69.1, 78.3, 64.4, 55.2, 54.3, 62.8, 60.2, 64.8, 67.3, 61.1, 51.5, 54.3, 47.5, 40.3, 39.6, 40.6, 41.4 + + +65 dB calibrated DIN Robin laptop -8 attenuation + +24.6, 24.6, 24.6, 24.6, 24.6, 27.6, 46.4, 43.4, 41.4, 45.8, 44.5, 53.2, 57.4, 48.7, 42.3, 51.9, 56.8, 57.9, 59.6, 53.8, 42.0, 45.5, 46.4, 40.8, 40.8, 41.4 + +unattenuated DIN + +24.6, 24.6, 24.6, 24.6, 24.6, 38.7, 53.6, 50.6, 49.0, 53.6, 52.0, 60.9, 65.1, 56.8, 50.1, 59.5, 64.7, 65.8, 67.3, 61.5, 48.8, 52.6, 53.6, 44.4, 42.6, 41.4 \ No newline at end of file diff --git a/stimuli/README.txt b/stimuli/README.txt new file mode 100644 index 0000000..e5519bf --- /dev/null +++ b/stimuli/README.txt @@ -0,0 +1,11 @@ +This file was created as a result of running /Users/egaudrain/Sounds/Emotions/PICKA/script/prepare_equalized on 04-Dec-2017 17:33:38. + +The files have been read from "../original/*.wav", then silence has been removed using remove_silence(x, fs, 75e-3). +They were then normalized and their RMS was calculated. The normalized files were saved in the destination folder +with a quantization of 24 bits per sample to avoid aliasing problems. The reference RMS was calculated as the +smallest RMS amongst the normalized files. They were then all scaled again to have that same RMS, and saved +again with a quantization of 16 bits per sample. + +Files have been renamed using /Users/egaudrain/Sounds/Emotions/PICKA/script/rename_files.py applying the following nomenclature: +s[talker]e[emotion number]s[sentence]_{p,t}[utterance] + -> t[talker]_[emotion]_s[sentence]_u[utterance] diff --git a/tools/__init__.py b/tools/__init__.py new file mode 100644 index 0000000..1573d27 --- /dev/null +++ b/tools/__init__.py @@ -0,0 +1 @@ +import to_noise diff --git a/tools/calibrate.py b/tools/calibrate.py new file mode 100644 index 0000000..c18da8b --- /dev/null +++ b/tools/calibrate.py @@ -0,0 +1,55 @@ +import numpy as np + +# L = np.array([24.6, 24.6, 24.6, 24.6, 24.6, 24.6, 27.6, 24.6, 41.0, 41.5, 39.3, 53.6, 58.9, 52.6, 54.1, 51.8, 61.1, 53.6, 52.5, 45.8, 38.4, 40.8, 39.0, 39.3, 40.6, 41.4]) + +# L = np.array([ +# 24.6, 24.6, 24.6, 24.6, 24.6, 27.6, 46.4, 43.4, 41.4, 45.8, 44.5, 53.2, +# 57.4, 48.7, 42.3, 51.9, 56.8, 57.9, 59.6, 53.8, 42.0, 45.5, 46.4, 40.8, +# 40.8, 41.4 +# ]) + +# SAM 75 dB, attenuation = -1.0 +# L = np.array([ +# 35.3, 30.6, 24.6, 24.6, 24.6, 30.6, 35.3, 45.0, 54.2, 64.5, 71.2, 66.9, +# 59.7, 55.9, 60.1, 62.1, 59.0, 63.6, 62.8, 59.1, 49.3, 45.3, 42.9, 40.6, +# 40.6, 40.6, 41.4 +# ]) + +# Surface Pro 75 dB, attenuation = -13 +# L = np.array([ +# 36.6, 30.6, 24.6, 27.6, 35.3, 55.8, 61.8, 61.1, 59.8, 63.6, 58.4, 61.6, +# 65.6, 61.5, 58.6, 61.1, 63.5, 67.5, 65.4, 61.4, 56.1, 48.6, 44.3, 57.6, +# 50.5, 41.0, 41.4 +# ]) + +#ROBIN 75 dB, attenuation = -0.5 +# L = np.array([ +# 34.6, 27.6, 24.6, 24.6, 24.6, 32.3, 41.4, 50.9, 58.2, 65.3, 64.4, 64.7, +# 63.5, 60.5, 61.1, 65.7, 66.7, 64.1, 64.3, 60.4, 52.7, 50.7, 48.5, 41.9, +# 39.9, 40.6, 41.4 +# ]) +# HP Pavillion 75 dB, attenuation = 7.5 +# L = np.array([ +# 27.6, 24.6, 27.6, 36.0, 56.0, 62.3, 61.8, 61.1, 65.3, 59.8, 64.5, 66.0, +# 62.4, 63.6, 64.2, 60.7, 65.5, 64.0, 60.7, 52.6, 45.8, 43.8, 57.3, 50.1, +# 41.4, 41.4 +# ]) + +#Sam Laptop 65 dB, attenuation = -21 +# L = np.array([ +# 24.6, 24.6, 24.6, 24.6, 27.6, 24.6, 24.6, 30.6, 30.6, 39.9, 42.2, 54.3, +# 56.4, 59.7, 55.2, 53.5, 57.4, 54.6, 50.2, 41.7, 38.0, 43.6, 41.2, 39.6, +# 40.3, 41.4 +# ]) + +#SAM 65dB, attenuation = -11.8 +L = np.array([ + 24.6, 24.6, 24.6, 24.6, 30.6, 27.6, 35.3, 43.7, 54.0, 62.4, 56.3, 48.7, + 45.7, 50.7, 47.7, 46.3, 53.1, 50.4, 47.0, 39.9, 37.6, 38.0, 38.7, 39.6, + 40.3, 41.4 +]) + +total_power = np.sum(np.power(10, L / 10)) +L_total = 10.0 * np.log10(total_power) + +print L_total diff --git a/tools/calibration.py b/tools/calibration.py new file mode 100644 index 0000000..bd1d2be --- /dev/null +++ b/tools/calibration.py @@ -0,0 +1,62 @@ +from playsound import playsound +import os +import random +import time +import numpy as np +import soundfile as sf +# from expe_options import expe_options +# from expe_build_conditions import expe_build_conditions +from tqdm import tqdm +from to_noise import noise + + +def main(source): + ''' + Simply plays the stimulus files in the tmp folders generated either by: + PyWorld - source is either "python" or "p"; + or Matalb - source is either "matlab" or "m" + ''' + folder = '' + if source[0].lower() == "p": + folder = "/home/nao/Documents/Sam_files/Python_scripts/tmp/" + elif source[0].lower() == 'm': + folder = "/home/nao/Documents/Sam_files/Nao-PICKA scripts/Expe_files/tmp/" + elif source[0].lower() == 'e': + folder = "/home/nao/Documents/Sam_files/Python_scripts/stimuli/emotion/" + files = os.listdir(folder) + y = np.array([]) + + for i in tqdm(range(len(files))): + if files[i].endswith(".wav"): + r = random.randint(0, len(files) - 1) + x, fs = sf.read(os.path.join(folder, str(files[r]))) + # x = x * np.power(10, -(options["attenuation_dB"]/20.0)) + # sf.write("cal_" + str(i) + ".wav", np.concatenate((np.zeros((1024*3, 2)), + # np.tile(x, (2, 1)).T, np.zeros((1024*3, 2)))), fs) + # sfile = os.path.join( + # "/home/nao/Documents/Sam_files/Python_scripts/", "cal_" + str(i) + ".wav") + + # playsound(sfile) + # os.remove("cal_" + str(i) + ".wav") + # time.sleep(0.05) + y = np.append(y, x) + y = noise(y, 44100) + sf.write( + "calibration_emotion.wav", + np.concatenate((np.zeros( + (1024 * 3, 2)), np.tile(y, (2, 1)).T, np.zeros((1024 * 3, 2)))), + fs) + sfile = os.path.join("/home/nao/Documents/Sam_files/Python_scripts", + "calibration_e.wav") + # playsound(sfile) + + +if __name__ == "__main__": + # options = expe_options() + # expe_build_conditions(options) + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("source", type=str, help="Source for the play files") + args = parser.parse_args() + + main(args.source) diff --git a/tools/calibration_simple.py b/tools/calibration_simple.py new file mode 100644 index 0000000..e225dca --- /dev/null +++ b/tools/calibration_simple.py @@ -0,0 +1,16 @@ +import soundfile as sf +from playsound import playsound +import numpy as np +import sys +from threading import Thread + +z, fs = sf.read('./calibration_emotion_cut.wav') + +# options.attenuation_dB = 36; +z = z * np.power(10.0, (-21.0 / 20)) + +sf.write("calibration_e.wav", z, fs) +try: + Thread(target=playsound, args=("calibration_e.wav", )).start() +except KeyboardInterrupt: + sys.exit() diff --git a/tools/createJson.py b/tools/createJson.py new file mode 100644 index 0000000..3efed79 --- /dev/null +++ b/tools/createJson.py @@ -0,0 +1,31 @@ +#!/usr/bin/python + +import json +from load_matrix import loadmat +from pymatreader import read_mat +import os + + +def main(f): + + matFile = os.path.join( + "/home/nao/Documents/Backups/Participant results/Sam/", f) + mat = loadmat(matFile) + results = mat["results"] + jsonFile = os.path.join( + "/home/nao/Documents/Backups/Participant results/Sam/", os.path.splitext(f)[0] + ".json") + with open(jsonFile, 'w+') as fl: + fl.write(json.dumps(results, indent=4, sort_keys=True)) + fl.close() + + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser() + parser.add_argument('f', help='.mat file to be created into json') + + args = parser.parse_args() + + main(args.f) + print '--- Operation Completed ---' diff --git a/tools/exit_condition.py b/tools/exit_condition.py new file mode 100644 index 0000000..1ed1ca4 --- /dev/null +++ b/tools/exit_condition.py @@ -0,0 +1,80 @@ +import sys +import time +import os +from naoqi import ALProxy +from naoqi import ALModule +from celery.task.control import revoke + +memory = None +a = 0 + + +class ExitExperimentModule(ALModule): + '''Module that will exit the experiment when one of the foot bumpers is touched''' + + def __init__(self, name, broker, language): + ALModule.__init__(self, name) + + self.tts = ALProxy("ALTextToSpeech") + self.con = ALProxy("ALConnectionManager") + self.spr = ALProxy("ALSpeechRecognition") + self.all = ALProxy("ALLeds") + answers = ["yes", "no"] + self.spr.setVocabulary(answers, False) + self.broker = broker + self.name = name + self.language = language + + global memory + memory = ALProxy("ALMemory") + memory.subscribeToEvent("RightBumperPressed", + name, "onBumperPressed") + + def onBumperPressed(self, *_args): + import settings + if self.name == "stop_audio": + aap = ALProxy("ALAudioPlayer") + aap.stopAll() + return + global a + print settings.task_id + + memory.unsubscribeToEvent( + "RightBumperPressed", self.name) + + if self. language == "EN": + self.tts.say( + "If you're sure you want to exit, \\pau=500\\ press my \\pau=500\\ left foot.") + elif self.language == "NL": + self.tts.say( + "Als je zeker weet dat je wilt stoppen, \\pau=500\\ raak dan mijn linkervoet aan.") + # self.tts.say("Exit?") + + memory.subscribeToEvent( + "LeftBumperPressed", self.name, "onLeftBumperPressed") + + time.sleep(5) + if a == 1: + revoke(self.task_id, terminate=True) + else: + memory.unsubscribeToEvent( + "LeftBumperPressed", self.name) + if self. language == "EN": + self.tts.say("Ok then. Let's continue.") + elif self.language == "NL": + self.tts.say("Ok, laten we dan verder gaan.") + + memory.subscribeToEvent("RightBumperPressed", + "expe_exit", "onBumperPressed") + + def onLeftBumperPressed(self, *_args): + global a + a = 1 + memory.unsubscribeToEvent( + "LeftBumperPressed", self.name) + self.all.fadeRGB("FaceLeds", "white", 0.05) + if self. language == "EN": + self.tts.say("Goodbye") + elif self.language == "NL": + self.tts.say("Tot ziens") + self.broker.shutdown() diff --git a/tools/export_results.py b/tools/export_results.py new file mode 100644 index 0000000..0581e2a --- /dev/null +++ b/tools/export_results.py @@ -0,0 +1,285 @@ +import os +import sys +import pandas as pd +import numpy as np + +from load_matrix import loadmat + + +def main(game, path, lang, age, des): + os.chdir(path) + + if game == "fishy": + export_jnd(lang, age, des) + elif game == "gender": + export_gender(lang, age, des) + elif game == "emotion": + export_emotion(lang, age, des) + elif game == "crm": + export_crm(lang, age, des) + + +def export_jnd(lang, age, des): + res_path = "./" + output_path = des + + export_filename = os.path.join( + output_path, "JND_" + lang + "_" + age + ".csv") + table = pd.DataFrame(columns=["subject", "ref_f0", "dir_f0", "ref_ser", "dir_ser", "ref_voice", + "dir_voice", "threshold", "threshold_f0", "threshold_vtl", "sd", "response_datetime"]) + for d in os.listdir(res_path): + if d.startswith("NH" + age): + subject_dir = os.path.join(res_path, d) + f = os.path.join(subject_dir, "jnd_" + + lang.lower() + "_" + d + "_robot.mat") + + try: + mat = loadmat(f) + results = mat["results"] + options = mat["options"] + for i in range(0, len(results["test"]["conditions"])): + responses = {} + att = {} + try: + att = results["test"]["conditions"]["c" + + str(i)]["att"] + responses = att["responses"] + resp = responses["r" + str(len(responses)-1)] + + except (KeyError, TypeError): + att = results["test"]["conditions"]["c" + + str(i)]["att"][0] + responses = att["responses"] + resp = responses[len(responses)-1] + + subject = options["subject_name"] + + trial = resp["trial"] + u_f0 = 12 * np.log2(options["test"]["voices"]['v' + str(trial["dir_voice"])] + ["f0"] / options["test"]["voices"]['v' + str(trial["ref_voice"])]["f0"]) + u_ser = 12 * np.log2(options["test"]["voices"]['v' + str(trial["dir_voice"])] + ["ser"] / options["test"]["voices"]['v' + str(trial["ref_voice"])]["ser"]) + u = np.array([u_f0, u_ser]) + u = u / np.sqrt(np.sum(np.power(u, 2))) + ex = { + "subject": subject, + "ref_f0": options["test"]["voices"]["v" + str(trial["ref_voice"])]["f0"], + "dir_f0": options["test"]["voices"]["v" + str(trial["dir_voice"])]["f0"], + "ref_ser": options["test"]["voices"]["v" + str(trial["ref_voice"])]["ser"], + "dir_ser": options["test"]["voices"]["v" + str(trial["dir_voice"])]["ser"], + "ref_voice": options["test"]["voices"]["v" + str(trial["ref_voice"])]["label"], + "dir_voice": options["test"]["voices"]["v" + str(trial["dir_voice"])]["label"], + "threshold": att["threshold"], + "threshold_f0": att["threshold"] * u[0], + "threshold_vtl": att["threshold"] * u[1], + "sd": att["sd"], + "response_datetime": resp["timestamp"], + } + table = table.append(ex, True) + + except (KeyError, IOError) as e: + print e + print "Could not retrieve necessary matrices. \n Skipping participant: " + d + + table.to_csv(export_filename) + + +def export_gender(lang, age, des): + res_path = "./" + output_path = des + + export_filename = os.path.join( + output_path, "Gender_" + lang + "_" + age + ".csv") + table = pd.DataFrame(columns=["subject", "df0", "dvtl", "word", + "answer", "gender", "response_datetime", "response_time"]) + for d in os.listdir(res_path): + if d.startswith("NH" + age): + subject_dir = os.path.join(res_path, d) + f = os.path.join(subject_dir, "gen_" + + lang.lower() + "_" + d + "_robot.mat") + + try: + mat = loadmat(f) + results = mat["results"] + options = mat["options"] + gen_responses = mat["gender_response"] + resp = {} + i = 1 + for r in results["test"]["responses"]: + + subject = options["subject_name"] + + try: + trial = r["trial"] + if "trial " in list(gen_responses["test"].keys())[0]: + gen_trial = gen_responses["test"]["trial " + + str(i)] + elif "trial_" in list(gen_responses["test"].keys())[0]: + gen_trial = gen_responses["test"]["trial_" + + str(i)] + resp = r + resp_ans = r["response_answer"] + except TypeError: + resp = results["test"]["responses"][r] + if "trial " in list(gen_responses["test"].keys())[0]: + gen_trial = gen_responses["test"]["trial " + + str(int(r[1:])+1)] + elif "trial_" in list(gen_responses["test"].keys())[0]: + gen_trial = gen_responses["test"]["trial_" + + str(int(r[1:])+1)] + trial = resp["trial"] + resp_ans = resp["response_answer"] + ex = { + "subject": subject, + "df0": gen_trial["f0(st)"], + "dvtl": gen_trial["VTL(st)"], + "word": trial["word"], + "answer": resp_ans["answer"], + "gender": gen_trial["answer"], + "is_female": 1 if gen_trial["answer"] == "Girl" else 0, + "response_datetime": resp["timestamp"], + "response_time": resp["response_time"], + } + table = table.append(ex, True) + i += 1 + + except (KeyError, IOError) as e: + print e + print "Could not retrieve necessary matrices. \n Skipping participant: " + d + + table.to_csv(export_filename) + + +def export_emotion(lang, age, des): + res_path = './' + output_path = des + + export_filename = os.path.join( + output_path, "Emotion_" + lang + "_" + age + ".csv") + + table = pd.DataFrame(columns=[ + "subject", "emotion", "file", "utterance", "talker", "sentence", "correct", "response_time"]) + + for d in os.listdir(res_path): + if d.startswith("NH" + age): + subject_dir = os.path.join(res_path, d) + f = os.path.join(subject_dir, "emo_" + + lang.lower() + "_" + d + "_robot.mat") + + try: + mat = loadmat(f) + results = mat["results"] + options = mat["options"] + resp = {} + + for r in results["test"]["responses"]: + + subject = options["subject_name"] + + try: + trial = r["trial"] + resp = r + except TypeError: + resp = results["test"]["responses"][r] + trial = resp["trial"] + ex = { + "subject": subject, + "emotion": trial["emotion"], + "file": trial["file"], + "utterance": trial["utterance"], + "talker": trial["talker"], + "sentence": trial["sentence"], + "correct": resp["correct"], + "response_time": resp["response_time"], + } + table = table.append(ex, True) + + except (KeyError, IOError) as e: + print e + print "Could not retrieve necessary matrices. \n Skipping participant: " + d + + table.to_csv(export_filename) + + +def export_crm(lang, age, des): + + res_path = './' + output_path = des + + export_filename = os.path.join( + output_path, "CRM_" + lang + "_" + age + ".csv") + + table = pd.DataFrame(columns=[ + "subject", "correct", "colour", "number", "call_sign", "sound_file", "dF0", "dVTL", "tmr", "response_time"]) + + for d in os.listdir(res_path): + if d.startswith("NH" + age): + subject_dir = os.path.join(res_path, d) + f = os.path.join(subject_dir, "crm_" + + lang.lower() + "_" + d + "_robot.mat") + + try: + mat = loadmat(f) + results = mat["results"] + options = mat["options"] + resp = {} + + for r in results["test"]["responses"]: + + subject = options["subject_name"] + + try: + trial = r["trial"] + resp = r + except TypeError: + resp = results["test"]["responses"][r] + trial = resp["trial"] + ex = { + "subject": subject, + "correct": resp["correct"], + "colour": trial["target"]["colour"], + "number": trial["target"]["number"], + "call_sign": trial["target"]["call_sign"], + "sound_file": trial["target"]["sound_file"], + "dF0": trial["voice"]["dF0"], + "dVTL": trial["voice"]["dVTL"], + "tmr": trial["tmr"], + "response_time": resp["response_time"] + } + table = table.append(ex, True) + + except (KeyError, IOError) as e: + print e + print "Could not retrieve necessary matrices. Skipping participant: " + d + + table.to_csv(export_filename) + + +if __name__ == "__main__": + import argparse + + parser = argparse.ArgumentParser(description="The main script used to run SAM", + epilog="Written by Luke Meyer , adapted from MATLAB script by Etienne Gaudrain \nCopyright 2017 CNRS (FR), UMCG (NL)", formatter_class=argparse.RawDescriptionHelpFormatter) + # parser.add_argument( + # '-f', '--file', help="Path to results file", required=True) + # parser.add_argument( + # '-pp', '--port', help="Port that SAM has open for connection.", default=9559, type=int) + parser.add_argument( + '-g', '--game', help="The game for the current experiment.", choices=["gender", "fishy", "emotion", "crm"], required=True) + # parser.add_argument('--version', help="Displays current version", + # action='version', version='Version = {}'.format(VERSION)) + parser.add_argument( + '-p', '--path', help="Path to results folder if not in current directory, INCLUDING ./results. Please use absolute path.", default='./') + parser.add_argument( + '-a', '--age', help="Age group to be exported.", default="A", choices=["A", "K"], required=True) + parser.add_argument( + '-l', '--lang', help="Experiment language to be exported.", default="EN", choices=["EN", "NL"], required=True) + parser.add_argument('-d', '--destination', + help="Path to destination of exported results.", default="./", required=True) + + args = parser.parse_args() + # mat = loadmat(args.file) + # options = mat["options"] + # results = mat["results"] + # os.chdir("/home/nao/Documents/Sam_files/Python_scripts") + main(args.game, args.path, args.lang, args.age, args.destination) diff --git a/tools/face_detection.py b/tools/face_detection.py new file mode 100644 index 0000000..e3c06b8 --- /dev/null +++ b/tools/face_detection.py @@ -0,0 +1,108 @@ +# -*- encoding: UTF-8 -*- +""" Say 'hello, you' each time a human face is detected + +""" + +import sys +import time + +from naoqi import ALProxy +from naoqi import ALBroker +from naoqi import ALModule + +from optparse import OptionParser + +NAO_IP = "nao.local" + + +# Global variable to store the HumanGreeter module instance +HumanGreeter = None +memory = None + + +class HumanGreeterModule(ALModule): + """ A simple module able to react + to facedetection events + + """ + + def __init__(self, name): + ALModule.__init__(self, name) + # No need for IP and port here because + # we have our Python broker connected to NAOqi broker + + # Create a proxy to ALTextToSpeech for later use + self.tts = ALProxy("ALTextToSpeech") + + # Subscribe to the FaceDetected event: + global memory + memory = ALProxy("ALMemory") + memory.subscribeToEvent("FaceDetected", + "HumanGreeter", + "onFaceDetected") + + def onFaceDetected(self, *_args): + """ This will be called each time a face is + detected. + + """ + # Unsubscribe to the event when talking, + # to avoid repetitions + memory.unsubscribeToEvent("FaceDetected", + "HumanGreeter") + + self.tts.say("Hello, you") + + # Subscribe again to the event + memory.subscribeToEvent("FaceDetected", + "HumanGreeter", + "onFaceDetected") + + +def main(): + """ Main entry point + + """ + parser = OptionParser() + parser.add_option("--pip", + help="Parent broker port. The IP address or your robot", + dest="pip") + parser.add_option("--pport", + help="Parent broker port. The port NAOqi is listening to", + dest="pport", + type="int") + parser.set_defaults( + pip=NAO_IP, + pport=9559) + + (opts, args_) = parser.parse_args() + pip = opts.pip + pport = opts.pport + + # We need this broker to be able to construct + # NAOqi modules and subscribe to other modules + # The broker must stay alive until the program exists + myBroker = ALBroker("myBroker", + "0.0.0.0", # listen to anyone + 0, # find a free port and use it + pip, # parent broker IP + pport) # parent broker port + + # Warning: HumanGreeter must be a global variable + # The name given to the constructor must be the name of the + # variable + global HumanGreeter + HumanGreeter = HumanGreeterModule("HumanGreeter") + + try: + while True: + time.sleep(1) + except KeyboardInterrupt: + print + print "Interrupted by user, shutting down" + myBroker.shutdown() + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git a/tools/gen_emo_stimulus.py b/tools/gen_emo_stimulus.py new file mode 100644 index 0000000..07c042a --- /dev/null +++ b/tools/gen_emo_stimulus.py @@ -0,0 +1,17 @@ + import soundfile as sf + +def generate(stimulus, attenuation): + x, fs = sf.read("/home/nao/PICKA/Python_scripts/stimuli/emotion/" + stimulus) + x = x * 10.0 ** float(attenuation)/20 + sf.write('/home/nao/PICKA/Python_scripts/stimuli/emotion/gen_stimulus.wav', x,fs) + + +if __name__ == "__main__": + import argparse + parser = argparse.ArgumentParser(description="Generates stimulus for emotion PICKA test") + parser.add_argument('-s', '--stimulus', help="Stimulus to be generated") + parser.add_argument('-a', '--attenuation', help="Attenuation to be applied") + args = parser.parse_args() + generate(args.stimulus, args.attenuation) + + diff --git a/tools/groupTracker.py b/tools/groupTracker.py new file mode 100644 index 0000000..cd5163a --- /dev/null +++ b/tools/groupTracker.py @@ -0,0 +1,47 @@ +import numpy as np +import os +import pickle + +global groups + + +groups = [] +groupsPkl = os.path.join('../other/', 'groups.pkl') + + +def rewritePkl(arr, filePath): + with open(filePath, 'w') as f: + pickle.dump(arr, f) + + +def readPkl(filePath): + with open(filePath, 'r') as f: + loaded = pickle.load(f) + return loaded + + +def getPkl(): + global groups + if os.path.exists(groupsPkl): + groups = readPkl(groupsPkl) + print groups + else: + for _ in range(10): + groups.append("Sam") + groups.append("Laptop") + + np.random.shuffle(groups) + # rewritePkl(groups, groupsPkl) + + +if __name__ == '__main__': + getPkl() + try: + subject = groups.pop() + print "\nParticipant will be starting with: \n\n\t" + subject + "\n\n" + except IndexError: + os.remove(groupsPkl) + print '-- Regenerating file -- ' + getPkl() + + rewritePkl(groups, groupsPkl) diff --git a/tools/json_view.py b/tools/json_view.py new file mode 100644 index 0000000..b65f67c --- /dev/null +++ b/tools/json_view.py @@ -0,0 +1,176 @@ +#!/usr/bin/env python3 + +__author__ = "Ashwin Nanjappa" + +# GUI viewer to view JSON data as tree. +# Ubuntu packages needed: +# python3-pyqt5 + +# Std +import argparse +import collections +import json +import sys + +# External +from PyQt5 import QtCore +from PyQt5 import QtGui +from PyQt5 import QtWidgets + + +class TextToTreeItem: + + def __init__(self): + self.text_list = [] + self.titem_list = [] + + def append(self, text_list, titem): + for text in text_list: + self.text_list.append(text) + self.titem_list.append(titem) + + # Return model indices that match string + def find(self, find_str): + + titem_list = [] + for i, s in enumerate(self.text_list): + if find_str in s: + titem_list.append(self.titem_list[i]) + + return titem_list + + +class JsonView(QtWidgets.QWidget): + + def __init__(self, fpath): + super(JsonView, self).__init__() + + self.find_box = None + self.tree_widget = None + self.text_to_titem = TextToTreeItem() + self.find_str = "" + self.found_titem_list = [] + self.found_idx = 0 + + jfile = open(fpath) + jdata = json.load(jfile, object_pairs_hook=collections.OrderedDict) + + # Find UI + + find_layout = self.make_find_ui() + + # Tree + + self.tree_widget = QtWidgets.QTreeWidget() + self.tree_widget.setHeaderLabels(["Key", "Value"]) + self.tree_widget.header().setSectionResizeMode(QtWidgets.QHeaderView.Stretch) + + root_item = QtWidgets.QTreeWidgetItem(["Root"]) + self.recurse_jdata(jdata, root_item) + self.tree_widget.addTopLevelItem(root_item) + + # Add table to layout + + layout = QtWidgets.QHBoxLayout() + layout.addWidget(self.tree_widget) + + # Group box + + gbox = QtWidgets.QGroupBox(fpath) + gbox.setLayout(layout) + + layout2 = QtWidgets.QVBoxLayout() + layout2.addLayout(find_layout) + layout2.addWidget(gbox) + + self.setLayout(layout2) + + def make_find_ui(self): + + # Text box + self.find_box = QtWidgets.QLineEdit() + self.find_box.returnPressed.connect(self.find_button_clicked) + + # Find Button + find_button = QtWidgets.QPushButton("Find") + find_button.clicked.connect(self.find_button_clicked) + + layout = QtWidgets.QHBoxLayout() + layout.addWidget(self.find_box) + layout.addWidget(find_button) + + return layout + + def find_button_clicked(self): + + find_str = self.find_box.text() + + # Very common for use to click Find on empty string + if find_str == "": + return + + # New search string + if find_str != self.find_str: + self.find_str = find_str + self.found_titem_list = self.text_to_titem.find(self.find_str) + self.found_idx = 0 + else: + item_num = len(self.found_titem_list) + self.found_idx = (self.found_idx + 1) % item_num + + self.tree_widget.setCurrentItem(self.found_titem_list[self.found_idx]) + + def recurse_jdata(self, jdata, tree_widget): + + if isinstance(jdata, dict): + for key, val in jdata.items(): + self.tree_add_row(key, val, tree_widget) + elif isinstance(jdata, list): + for i, val in enumerate(jdata): + key = str(i) + self.tree_add_row(key, val, tree_widget) + else: + print("This should never be reached!") + + def tree_add_row(self, key, val, tree_widget): + + text_list = [] + + if isinstance(val, dict) or isinstance(val, list): + text_list.append(key) + row_item = QtWidgets.QTreeWidgetItem([key]) + self.recurse_jdata(val, row_item) + else: + text_list.append(key) + text_list.append(str(val)) + row_item = QtWidgets.QTreeWidgetItem([key, str(val)]) + + tree_widget.addChild(row_item) + self.text_to_titem.append(text_list, row_item) + + +class JsonViewer(QtWidgets.QMainWindow): + + def __init__(self): + super(JsonViewer, self).__init__() + + fpath = sys.argv[1] + json_view = JsonView(fpath) + + self.setCentralWidget(json_view) + self.setWindowTitle("JSON Viewer") + self.show() + + def keyPressEvent(self, e): + if e.key() == QtCore.Qt.Key_Escape: + self.close() + + +def main(): + qt_app = QtWidgets.QApplication(sys.argv) + json_viewer = JsonViewer() + sys.exit(qt_app.exec_()) + + +if "__main__" == __name__: + main() diff --git a/tools/load_matrix.py b/tools/load_matrix.py new file mode 100644 index 0000000..8d77bec --- /dev/null +++ b/tools/load_matrix.py @@ -0,0 +1,53 @@ +import scipy.io as spio +import numpy as np + + +def loadmat(filename): + ''' + this function should be called instead of direct spio.loadmat + as it cures the problem of not properly recovering python dictionaries + from mat files. It calls the function check keys to cure all entries + which are still mat-objects + ''' + def _check_keys(d): + ''' + checks if entries in dictionary are mat-objects. If yes + todict is called to change them to nested dictionaries + ''' + for key in d: + if isinstance(d[key], spio.matlab.mio5_params.mat_struct): + d[key] = _todict(d[key]) + return d + + def _todict(matobj): + ''' + A recursive function which constructs from matobjects nested dictionaries + ''' + d = {} + for strg in matobj._fieldnames: + elem = matobj.__dict__[strg] + if isinstance(elem, spio.matlab.mio5_params.mat_struct): + d[strg] = _todict(elem) + elif isinstance(elem, np.ndarray): + d[strg] = _tolist(elem) + else: + d[strg] = elem + return d + + def _tolist(ndarray): + ''' + A recursive function which constructs lists from cellarrays + (which are loaded as numpy ndarrays), recursing into the elements + if they contain matobjects. + ''' + elem_list = [] + for sub_elem in ndarray: + if isinstance(sub_elem, spio.matlab.mio5_params.mat_struct): + elem_list.append(_todict(sub_elem)) + elif isinstance(sub_elem, np.ndarray): + elem_list.append(_tolist(sub_elem)) + else: + elem_list.append(sub_elem) + return elem_list + data = spio.loadmat(filename, struct_as_record=False, squeeze_me=True) + return _check_keys(data) diff --git a/tools/newStimuliGeneration.py b/tools/newStimuliGeneration.py new file mode 100644 index 0000000..d76ff79 --- /dev/null +++ b/tools/newStimuliGeneration.py @@ -0,0 +1,65 @@ +import scipy.io as spio +import os +import soundfile as sf +import numpy as np +from pyworld import pyworld as pw +from expe_options import expe_options +from expe_build_conditions import expe_build_conditions +from tqdm import tqdm + +global f0_arr +f0_arr = np.array([]) + + +def pyworld_process(syll, lang): + ''' + Generates the individual stimuli files + ''' + global f0_arr + fs = 0 + wavIn = os.path.join( + './stimuli/'+lang.lower(), str(syll) + '.wav') + mat = os.path.join("./stimuli_store/"+lang.lower(), syll + '.pyworld.mat') + # Intialise varibales so they are accessible in the correct scope + + if not os.path.exists(mat): + + x, fs = sf.read(wavIn) + + # --- Using PyWORLD script + _f0, t = pw.dio(x, fs) + f0 = pw.stonemask(x, _f0, t, fs) + sp = pw.cheaptrick(x, f0, t, fs) + ap = pw.d4c(x, f0, t, fs) + freq = np.arange(0, np.size(sp, axis=1), + dtype='float64') / (np.size(sp)) * fs/2 + + x_rms = np.sqrt(np.mean(x**2)) + duration = len(x/fs) + + spio.savemat(mat, mdict={'fs': fs, 'f0': f0, + 'sp': sp, 'ap': ap, + 'x_rms': x_rms, + 'frequencies': freq, + 'temporal_positions': t, + 'duration': duration + }) + f0_arr = np.append(f0_arr, f0) + + +if __name__ == "__main__": + import argparse + parser = argparse.ArgumentParser() + parser.add_argument("language", help="Language of files to test") + + args = parser.parse_args() + lang = args.language + options = expe_options() + expe_build_conditions(options, lang) + + new_files = os.path.join( + './stimuli/'+lang.lower(), '*') + for f in tqdm(os.listdir('./stimuli/'+lang.lower())): + syll = os.path.splitext(f)[0] + pyworld_process(syll, lang) + print "Avg f0 for all files: " + str(np.mean(f0_arr)) diff --git a/tools/robot_calibration.py b/tools/robot_calibration.py new file mode 100644 index 0000000..882a008 --- /dev/null +++ b/tools/robot_calibration.py @@ -0,0 +1,28 @@ +from expe_build_conditions import expe_build_conditions +from expe_options import expe_options +import os +import soundfile as sf +import numpy as np +from naoqi import ALProxy +from tqdm import tqdm +import random + + +# aap = ALProxy("ALAudioPlayer", "", 9559) + + +options = expe_options() +expe_build_conditions(options) + +files = os.listdir(options["tmp_path"] + "2") +y = np.array([]) +for i in tqdm(range(len(files))): + r = random.randint(0, len(files)-1) + x, fs = sf.read(os.path.join(options["tmp_path"] + "2", str(files[r]))) + x = x * np.power(10, -(options["attenuation_dB"]/20.0)) + y = np.append(y, x) + +sf.write("calibration.wav", np.concatenate( + (np.zeros((1024*3, 2)), np.tile(y, (2, 1)).T, np.zeros((1024*3, 2)))), fs) + +# aap.ALAudioPlayer.play() diff --git a/tools/segment_extract.py b/tools/segment_extract.py new file mode 100644 index 0000000..aa00da2 --- /dev/null +++ b/tools/segment_extract.py @@ -0,0 +1,231 @@ +import csv +import json +import os +import datetime +import ffmpeg +import re +import subprocess +import time + +import multiprocessing +from contextlib import contextmanager +from functools import partial + +stream_segments = [] + + +def getGame(angle, game, s, iface, f, subject, upper): + if upper: + game = game.upper() + else: + game = game.capitalize() + try: + + if angle in s[iface][game].keys(): + for seg, time in s[iface][game][angle]["times"].items(): + stream_segments.append(create_streams( + f, time, subject, iface, game, angle, seg)) + except KeyError: + pass + + +def extract_durations(fpath): + timestamps = {} + + with open(fpath) as csvfie: + reader = csv.reader(csvfie) + for n, row in enumerate(reader): + if not n: + continue + subject, _, iface, angle, segment, game, start, end, duration = row + if subject not in timestamps: + timestamps[subject] = {} + if iface not in timestamps[subject]: + timestamps[subject][iface] = {} + if game not in timestamps[subject][iface]: + timestamps[subject][iface][game] = {} + if angle not in timestamps[subject][iface][game]: + timestamps[subject][iface][game][angle] = {} + if "times" not in timestamps[subject][iface][game][angle]: + timestamps[subject][iface][game][angle]["times"] = {} + if segment not in timestamps[subject][iface][game][angle]["times"]: + timestamps[subject][iface][game][angle]["times"][segment] = {} + if start not in timestamps[subject][iface][game][angle]["times"][segment]: + timestamps[subject][iface][game][angle]["times"][segment]["start"] = start + if end not in timestamps[subject][iface][game][angle]["times"][segment]: + timestamps[subject][iface][game][angle]["times"][segment]["end"] = end + if duration not in timestamps[subject][iface][game][angle]["times"][segment]: + timestamps[subject][iface][game][angle]["times"][segment]["duration"] = duration + + os.chdir("/Volumes/LaCie/Videos to analyse/Separate videos/to split/") + + cwd = os.getcwd() + + files = os.listdir(cwd) + + subject = '' + + for f in files: + s = None + for subject in timestamps: + # with poolcontext as pool: + stream = "" + # o = subprocess.check_output( + # ["ffprobe", "-hide_banner", f], stderr=subprocess.STDOUT) + # mediaprobe_re = re.compile( + # r"Duration:\s+(?P(?:(?:\d:?)+[.]?\d*)|N/A)(?:.+start:\s+(?P\d+[.]\d+))?.+bitrate:\s+(?P(?:\d+\s*..[/]s)|N/A)") + # probe = mediaprobe_re.findall(o.decode("utf-8")) + # duration = datetime.datetime.strptime(probe[0][0], "%H:%M:%S.%f") + # d_hour, d_min, d_sec = duration.hour, duration.minute, duration.second + if subject in f: + if not s: + for k, v in timestamps.items(): + if k in f: + subject = k + s = timestamps[k] + break + + if "lap" in f.lower(): + if "front" in f.lower(): + getGame("front", "crm", s, "lap", f, subject, True) + getGame("front", "emotion", s, + "lap", f, subject, False) + getGame("front", "jnd", s, "lap", f, subject, True) + getGame("front", "gender", s, + "lap", f, subject, False) + # a = 'front' + # game = "jnd" + # if a in s[iface][game.upper()].keys(): + # for seg, time in s[iface][game.upper()][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + # game = "gender" + # if a in s[iface][game.capitalize()].keys(): + # for seg, time in s[iface][game.capitalize()][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + if "side" in f.lower(): + getGame("side", "crm", s, "lap", f, subject, True) + getGame("side", "emotion", s, + "lap", f, subject, False) + getGame("side", "jnd", s, "lap", f, subject, True) + getGame("side", "gender", s, + "lap", f, subject, False) + # a = 'side' + # game = "jnd" + # if a in s[iface][game.upper()].keys(): + + # for seg, time in s[iface][game.upper()][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + + # game = "gender" + # if a in s[iface][game.capitalize()].keys(): + + # for seg, time in s[iface][game.capitalize()][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + + elif "sam" in f.lower(): + if "front" in f.lower(): + getGame("front", "crm", s, "sam", f, subject, True) + getGame("front", "emotion", s, "sam", f, subject, False) + getGame("front", "jnd", s, "sam", f, subject, True) + getGame("front", "gender", s, "sam", f, subject, False) + # a = 'front' + # game = "jnd" + # if a in s[iface][game.upper()].keys(): + + # for seg, time in s[iface][game.upper()][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + + # game = "gender" + # if a in s[iface][game.capitalize()].keys(): + + # for seg, time in s[iface][game.capitalize()][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + # try: + # game = "PICKA" + # for seg, time in s[iface][game][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + # except KeyError: + # pass + + if "side" in f.lower(): + getGame("side", "crm", s, "sam", f, subject, True) + getGame("side", "emotion", s, + "sam", f, subject, False) + getGame("side", "jnd", s, "sam", f, subject, True) + getGame("side", "gender", s, + "sam", f, subject, False) + # a = 'side' + # game = "jnd" + # if a in s[iface][game.upper()].keys(): + + # for seg, time in s[iface][game.upper()][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + + # game = "gender" + # if a in s[iface][game.capitalize()].keys(): + + # for seg, time in s[iface][game.capitalize()][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + # try: + # game = "PICKA" + # for seg, time in s[iface][game][a]["times"].items(): + # stream_segments.append(create_streams( + # f, time, subject, iface, game, a, seg)) + # except KeyError: + # pass + + return stream_segments + + +@contextmanager +def poolcontext(*args, **kwargs): + pool = multiprocessing.Pool(*args, **kwargs) + yield pool + pool.terminate() + + +def run_ffmpeg(stream_segment, dirpath): + save_path = "/Volumes/LaCie/Videos to analyse/Separate videos/split/" + \ + dirpath + "/extracted/" + stream = stream_segment[0] + fname = save_path + stream_segment[1] + ".mp4" + if not os.path.exists(fname): + stream = ffmpeg.output(stream, fname, **{"async": 1}) + # stream = ffmpeg.overwrite_output(stream) + print(stream) + ffmpeg.run(stream) + + +def create_fname(subject, iface, game, angle, segment): + return "{}-{}-{}-{}-{}".format(subject, iface, angle, game, segment) + + +def create_streams(filename, times, subject, iface, game, angle, segment): + s = ffmpeg.input(filename, ss=times["start"], to=times["end"]) + f = create_fname(subject, iface.capitalize(), game, angle, segment) + + return s, f + + +if __name__ == '__main__': + import argparse + parser = argparse.ArgumentParser() + parser.add_argument( + "-t", "--tstamps", default="/Users/lukemeyer/Desktop/RUG/PhD/Results/Experiment_1/Video Coding/timestamps2.csv") + parser.add_argument("-d", "--dirpath", required=True) + args = parser.parse_args() + stream_segments = extract_durations(args.tstamps) + with poolcontext() as pool: + for x in pool.imap(partial(run_ffmpeg, dirpath=args.dirpath), stream_segments, chunksize=1): + time.sleep(1) + +# print(json.dumps(timestamps, sort_keys=True, indent=4)) diff --git a/tools/settings.py b/tools/settings.py new file mode 100644 index 0000000..83d978d --- /dev/null +++ b/tools/settings.py @@ -0,0 +1,12 @@ + +time_taken = 0 +experiment_begin = 1 +expe_exit = None +task_id = None + + +def init(): + global time_taken + global experiment_begin + global expe_exit + global task_id diff --git a/tools/timestamps.csv b/tools/timestamps.csv new file mode 100644 index 0000000..0f7a5c0 --- /dev/null +++ b/tools/timestamps.csv @@ -0,0 +1,39 @@ +Subject,Experiment,Interface,Angle,Segment,Game,Start,End,Duration,, +NHA030,1,lap,side,train,JND,,,01:25,, +NHA030,1,lap,side,trial-1,JND,,,06:10,, +NHA030,1,lap,side,trial-2,JND,,,04:14,, +NHA030,1,lap,side,trial-3,JND,,,05:47,, +NHA030,1,lap,side,trial-4,JND,,,06:44,, +NHA030,1,lap,side,train,Gender,,,00:40,, +NHA030,1,lap,side,test,Gender,,,03:06,, +NHA030,1,lap,front,train,JND,00:00:10,00:01:35,01:25,, +NHA030,1,lap,front,trial-1,JND,00:01:57,00:08:07,06:10,, +NHA030,1,lap,front,trial-2,JND,00:08:08,00:12:22,04:14,, +NHA030,1,lap,front,trial-3,JND,00:13:04,00:18:51,05:47,, +NHA030,1,lap,front,trial-4,JND,00:18:51,00:25:35,06:44,, +NHA030,1,lap,front,train,Gender,00:27:03,00:27:43,00:40,, +NHA030,1,lap,front,test,Gender,00:28:10,00:31:16,03:06,, +NHA030,1,sam,side,intro,JND,,,0,, +NHA030,1,sam,side,train,JND,,,0,, +NHA030,1,sam,side,trial-1,JND,,,0,, +NHA030,1,sam,side,break-1,JND,,,0,, +NHA030,1,sam,side,trial-2,JND,,,0,, +NHA030,1,sam,side,break-2,JND,,,0,, +NHA030,1,sam,side,trial-3,JND,,,0,, +NHA030,1,sam,side,break-3,JND,,,0,, +NHA030,1,sam,side,trial-4,JND,,,0,, +NHA030,1,sam,side,intro,Gender,,,0,, +NHA030,1,sam,side,train,Gender,,,0,, +NHA030,1,sam,side,test,Gender,,,0,, +NHA030,1,sam,front,intro,JND,00:02:14,00:03:37,01:23,, +NHA030,1,sam,front,train,JND,00:03:37,00:06:10,02:33,, +NHA030,1,sam,front,trial-1,JND,00:07:22,00:16:00,08:38,, +NHA030,1,sam,front,break-1,JND,00:16:00,00:16:18,00:18,, +NHA030,1,sam,front,trial-2,JND,00:16:18,00:22:15,05:57,, +NHA030,1,sam,front,break-2,JND,00:22:15,00:22:24,00:09,, +NHA030,1,sam,front,trial-3,JND,00:22:24,00:28:09,05:45,, +NHA030,1,sam,front,break-3,JND,00:28:09,00:28:17,00:08,, +NHA030,1,sam,front,trial-4,JND,00:28:17,00:34:06,05:49,, +NHA030,1,sam,front,intro,Gender,00:36:08,00:36:48,00:40,, +NHA030,1,sam,front,train,Gender,00:36:48,00:38:08,01:20,, +NHA030,1,sam,front,test,Gender,00:38:45,00:44:46,06:01,, diff --git a/tools/timestamps2.csv b/tools/timestamps2.csv new file mode 100644 index 0000000..f081557 --- /dev/null +++ b/tools/timestamps2.csv @@ -0,0 +1,420 @@ +Subject,Experiment,Interface,Angle,Segment,Game,Start,End,Duration,, +NHA026,1,lap,side,train,JND,00:00:00,00:00:53,00:53,, +NHA026,1,lap,side,trial-1,JND,00:01:05,00:06:03,04:58,, +NHA026,1,lap,side,trial-2,JND,00:06:03,00:11:53,05:50,, +NHA026,1,lap,side,trial-3,JND,00:11:53,00:16:20,04:27,, +NHA026,1,lap,side,trial-4,JND,00:16:20,00:20:40,04:20,, +NHA026,1,lap,side,train,Gender,00:21:51,00:22:37,00:46,, +NHA026,1,lap,side,test,Gender,00:23:00,00:25:50,02:50,, +NHA026,1,lap,front,train,JND,00:00:00,00:01:03,01:03,, +NHA026,1,lap,front,trial-1,JND,00:01:15,00:06:13,04:58,, +NHA026,1,lap,front,trial-2,JND,00:06:13,00:12:03,05:50,, +NHA026,1,lap,front,trial-3,JND,00:12:03,00:16:30,04:27,, +NHA026,1,lap,front,trial-4,JND,00:16:30,00:20:50,04:20,, +NHA026,1,lap,front,train,Gender,00:22:01,00:22:47,00:46,, +NHA026,1,lap,front,test,Gender,00:23:10,00:26:00,02:50,, +NHA026,1,sam,side,intro,JND,00:00:57,00:02:16,01:19,, +NHA026,1,sam,side,train,JND,00:02:16,00:04:21,02:05,, +NHA026,1,sam,side,trial-1,JND,00:05:38,00:13:19,07:41,, +NHA026,1,sam,side,break-1,JND,00:13:19,00:13:30,00:11,, +NHA026,1,sam,side,trial-2,JND,00:13:30,00:23:37,10:07,, +NHA026,1,sam,side,break-2,JND,00:23:37,00:23:52,00:15,, +NHA026,1,sam,side,trial-3,JND,00:23:52,00:29:15,05:23,, +NHA026,1,sam,side,break-3,JND,00:29:15,00:29:37,00:22,, +NHA026,1,sam,side,trial-4,JND,00:29:37,00:37:10,07:33,, +NHA026,1,sam,side,intro,Gender,00:39:10,00:40:01,00:51,, +NHA026,1,sam,side,train,Gender,00:40:01,00:41:18,01:17,, +NHA026,1,sam,side,test,Gender,00:41:43,00:49:14,07:31,, +NHA026,1,sam,front,intro,JND,00:01:06,00:02:27,01:21,, +NHA026,1,sam,front,train,JND,00:02:27,00:04:32,02:05,, +NHA026,1,sam,front,trial-1,JND,00:05:49,00:13:30,07:41,, +NHA026,1,sam,front,break-1,JND,00:13:30,00:13:41,00:11,, +NHA026,1,sam,front,trial-2,JND,00:13:41,00:23:48,10:07,, +NHA026,1,sam,front,break-2,JND,00:23:48,00:24:04,00:16,, +NHA026,1,sam,front,trial-3,JND,00:24:04,00:29:26,05:22,, +NHA026,1,sam,front,break-3,JND,00:29:26,00:29:48,00:22,, +NHA026,1,sam,front,trial-4,JND,00:29:48,00:37:21,07:33,, +NHA026,1,sam,front,intro,Gender,00:39:21,00:40:12,00:51,, +NHA026,1,sam,front,train,Gender,00:41:29,00:41:54,00:25,, +NHA026,1,sam,front,test,Gender,00:49:54,00:49:25,-00:29,, +NHA027,1,lap,side,train,JND,00:00:42,00:01:41,00:59,, +NHA027,1,lap,side,trial-1,JND,00:02:02,00:08:23,06:21,, +NHA027,1,lap,side,trial-2,JND,00:08:23,00:12:46,04:23,, +NHA027,1,lap,side,trial-3,JND,00:15:03,00:19:04,04:01,, +NHA027,1,lap,side,trial-4,JND,00:23:44,00:27:49,04:05,, +NHA027,1,lap,side,train,Gender,00:28:49,00:29:30,00:41,, +NHA027,1,lap,side,test,Gender,00:29:45,00:33:10,03:25,, +NHA027,1,lap,front,train,JND,00:00:45,00:01:44,00:59,, +NHA027,1,lap,front,trial-1,JND,00:02:05,00:08:26,06:21,, +NHA027,1,lap,front,trial-2,JND,00:08:26,00:12:49,04:23,, +NHA027,1,lap,front,trial-3,JND,00:15:06,00:19:07,04:01,, +NHA027,1,lap,front,trial-4,JND,00:23:47,00:27:52,04:05,, +NHA027,1,lap,front,train,Gender,00:28:52,00:29:33,00:41,, +NHA027,1,lap,front,test,Gender,00:29:48,00:33:13,03:25,, +NHA027,1,sam,side,intro,JND,00:00:00,00:01:49,01:49,, +NHA027,1,sam,side,train,JND,00:01:49,00:03:04,01:15,, +NHA027,1,sam,side,trial-1,JND,00:03:24,00:11:02,07:38,, +NHA027,1,sam,side,break-1,JND,00:11:02,00:12:22,01:20,, +NHA027,1,sam,side,trial-2,JND,00:12:22,00:17:32,05:10,, +NHA027,1,sam,side,break-2,JND,00:17:32,00:18:19,00:47,, +NHA027,1,sam,side,trial-3,JND,00:18:19,00:23:37,05:18,, +NHA027,1,sam,side,break-3,JND,00:23:37,00:23:50,00:13,, +NHA027,1,sam,side,trial-4,JND,00:23:50,00:31:26,07:36,, +NHA027,1,sam,side,intro,Gender,00:33:18,00:34:03,00:45,, +NHA027,1,sam,side,train,Gender,00:34:03,00:35:20,01:17,, +NHA027,1,sam,side,test,Gender,00:35:52,00:42:17,06:25,, +NHA027,1,sam,front,intro,JND,00:00:00,00:01:43,01:43,, +NHA027,1,sam,front,train,JND,00:01:43,00:02:58,01:15,, +NHA027,1,sam,front,trial-1,JND,00:03:16,00:10:56,07:40,, +NHA027,1,sam,front,break-1,JND,00:10:56,00:12:16,01:20,, +NHA027,1,sam,front,trial-2,JND,00:12:16,00:17:26,05:10,, +NHA027,1,sam,front,break-2,JND,00:17:26,00:18:13,00:47,, +NHA027,1,sam,front,trial-3,JND,00:18:13,00:23:31,05:18,, +NHA027,1,sam,front,break-3,JND,00:23:31,00:23:44,00:13,, +NHA027,1,sam,front,trial-4,JND,00:23:44,00:31:20,07:36,, +NHA027,1,sam,front,intro,Gender,00:33:12,00:33:57,00:45,, +NHA027,1,sam,front,train,Gender,00:33:57,00:35:14,01:17,, +NHA027,1,sam,front,test,Gender,00:35:46,00:42:11,06:25,, +NHA029,1,lap,side,train,JND,00:00:38,00:01:45,01:12,, +NHA029,1,lap,side,trial-1,JND,00:02:49,00:08:11,05:07,, +NHA029,1,lap,side,trial-2,JND,00:08:11,00:12:31,04:21,, +NHA029,1,lap,side,trial-3,JND,00:12:31,00:17:49,05:18,, +NHA029,1,lap,side,trial-4,JND,00:17:49,00:22:23,04:34,, +NHA029,1,lap,side,train,Gender,00:23:49,00:24:32,00:39,, +NHA029,1,lap,side,test,Gender,00:24:59,00:28:38,03:34,, +NHA029,1,lap,front,train,JND,00:00:30,00:01:42,01:12,, +NHA029,1,lap,front,trial-1,JND,00:02:53,00:08:00,05:07,, +NHA029,1,lap,front,trial-2,JND,00:08:00,00:12:21,04:21,, +NHA029,1,lap,front,trial-3,JND,00:12:21,00:17:39,05:18,, +NHA029,1,lap,front,trial-4,JND,00:17:39,00:22:13,04:34,, +NHA029,1,lap,front,train,Gender,00:23:44,00:24:23,00:39,, +NHA029,1,lap,front,test,Gender,00:24:59,00:28:33,03:34,, +NHA029,1,sam,side,intro,JND,00:00:00,00:01:01,01:01,, +NHA029,1,sam,side,train,JND,00:01:01,00:03:08,02:07,, +NHA029,1,sam,side,trial-1,JND,00:04:03,00:10:53,06:50,, +NHA029,1,sam,side,break-1,JND,00:10:53,00:11:58,01:05,, +NHA029,1,sam,side,trial-2,JND,00:11:58,00:17:04,05:06,, +NHA029,1,sam,side,break-2,JND,00:17:04,00:17:14,00:10,, +NHA029,1,sam,side,trial-3,JND,00:17:14,00:24:24,07:10,, +NHA029,1,sam,side,break-3,JND,00:24:24,00:24:32,00:08,, +NHA029,1,sam,side,trial-4,JND,00:24:32,00:29:52,05:20,, +NHA029,1,sam,side,intro,Gender,00:32:02,00:32:39,00:37,, +NHA029,1,sam,side,train,Gender,00:32:39,00:34:03,01:24,, +NHA029,1,sam,side,test,Gender,00:34:30,00:40:54,06:24,, +NHA029,1,sam,front,intro,JND,00:00:00,00:01:05,01:05,, +NHA029,1,sam,front,train,JND,00:01:05,00:03:12,02:07,, +NHA029,1,sam,front,trial-1,JND,00:04:10,00:10:55,06:45,, +NHA029,1,sam,front,break-1,JND,00:10:55,00:12:00,01:05,, +NHA029,1,sam,front,trial-2,JND,00:12:00,00:17:03,05:03,, +NHA029,1,sam,front,break-2,JND,00:17:03,00:17:16,00:13,, +NHA029,1,sam,front,trial-3,JND,00:17:16,00:24:26,07:10,, +NHA029,1,sam,front,break-3,JND,00:24:26,00:24:35,00:09,, +NHA029,1,sam,front,trial-4,JND,00:24:35,00:29:56,05:21,, +NHA029,1,sam,front,intro,Gender,00:32:02,00:32:42,00:40,, +NHA029,1,sam,front,train,Gender,00:32:42,00:34:04,01:22,, +NHA029,1,sam,front,test,Gender,00:34:31,00:40:57,06:26,, +NHA030,1,lap,side,train,JND,,,01:25,, +NHA030,1,lap,side,trial-1,JND,,,06:10,, +NHA030,1,lap,side,trial-2,JND,,,04:14,, +NHA030,1,lap,side,trial-3,JND,,,05:47,, +NHA030,1,lap,side,trial-4,JND,,,06:44,, +NHA030,1,lap,side,train,Gender,,,00:40,, +NHA030,1,lap,side,test,Gender,,,03:06,, +NHA030,1,lap,front,train,JND,00:00:10,00:01:35,01:25,, +NHA030,1,lap,front,trial-1,JND,00:01:57,00:08:07,06:10,, +NHA030,1,lap,front,trial-2,JND,00:08:08,00:12:22,04:14,, +NHA030,1,lap,front,trial-3,JND,00:13:04,00:18:51,05:47,, +NHA030,1,lap,front,trial-4,JND,00:18:51,00:25:35,06:44,, +NHA030,1,lap,front,train,Gender,00:27:03,00:27:43,00:40,, +NHA030,1,lap,front,test,Gender,00:28:10,00:31:16,03:06,, +NHA030,1,sam,side,intro,JND,,,0,, +NHA030,1,sam,side,train,JND,,,0,, +NHA030,1,sam,side,trial-1,JND,,,0,, +NHA030,1,sam,side,break-1,JND,,,0,, +NHA030,1,sam,side,trial-2,JND,,,0,, +NHA030,1,sam,side,break-2,JND,,,0,, +NHA030,1,sam,side,trial-3,JND,,,0,, +NHA030,1,sam,side,break-3,JND,,,0,, +NHA030,1,sam,side,trial-4,JND,,,0,, +NHA030,1,sam,side,intro,Gender,,,0,, +NHA030,1,sam,side,train,Gender,,,0,, +NHA030,1,sam,side,test,Gender,,,0,, +NHA030,1,sam,front,intro,JND,00:02:14,00:03:37,01:23,, +NHA030,1,sam,front,train,JND,00:03:37,00:06:10,02:33,, +NHA030,1,sam,front,trial-1,JND,00:07:22,00:16:00,08:38,, +NHA030,1,sam,front,break-1,JND,00:16:00,00:16:18,00:18,, +NHA030,1,sam,front,trial-2,JND,00:16:18,00:22:15,05:57,, +NHA030,1,sam,front,break-2,JND,00:22:15,00:22:24,00:09,, +NHA030,1,sam,front,trial-3,JND,00:22:24,00:28:09,05:45,, +NHA030,1,sam,front,break-3,JND,00:28:09,00:28:17,00:08,, +NHA030,1,sam,front,trial-4,JND,00:28:17,00:34:06,05:49,, +NHA030,1,sam,front,intro,Gender,00:36:08,00:36:48,00:40,, +NHA030,1,sam,front,train,Gender,00:36:48,00:38:08,01:20,, +NHA030,1,sam,front,test,Gender,00:38:45,00:44:46,06:01,, +NHA033,1,lap,side,train,JND,,,01:04,, +NHA033,1,lap,side,trial-1,JND,,,04:20,, +NHA033,1,lap,side,trial-2,JND,,,06:56,, +NHA033,1,lap,side,trial-3,JND,,,04:47,, +NHA033,1,lap,side,trial-4,JND,,,07:17,, +NHA033,1,lap,side,train,Gender,,,00:35,, +NHA033,1,lap,side,test,Gender,,,03:43,, +NHA033,1,lap,front,train,JND,00:00:13,00:01:17,01:04,, +NHA033,1,lap,front,trial-1,JND,00:01:53,00:06:13,04:20,, +NHA033,1,lap,front,trial-2,JND,00:06:13,00:13:09,06:56,, +NHA033,1,lap,front,trial-3,JND,00:13:09,00:17:56,04:47,, +NHA033,1,lap,front,trial-4,JND,00:17:56,00:25:13,07:17,, +NHA033,1,lap,front,train,Gender,00:26:57,00:27:32,00:35,, +NHA033,1,lap,front,test,Gender,00:28:13,00:31:56,03:43,, +NHA033,1,sam,side,intro,JND,,,0,, +NHA033,1,sam,side,train,JND,,,0,, +NHA033,1,sam,side,trial-1,JND,,,0,, +NHA033,1,sam,side,break-1,JND,,,0,, +NHA033,1,sam,side,trial-2,JND,,,0,, +NHA033,1,sam,side,break-2,JND,,,0,, +NHA033,1,sam,side,trial-3,JND,,,0,, +NHA033,1,sam,side,break-3,JND,,,0,, +NHA033,1,sam,side,trial-4,JND,,,0,, +NHA033,1,sam,side,intro,Gender,,,0,, +NHA033,1,sam,side,train,Gender,,,0,, +NHA033,1,sam,side,test,Gender,,,0,, +NHA033,1,sam,front,intro,JND,00:00:00,00:01:09,01:09,, +NHA033,1,sam,front,train,JND,00:01:09,00:03:40,02:31,, +NHA033,1,sam,front,trial-1,JND,00:06:40,00:15:49,09:09,, +NHA033,1,sam,front,break-1,JND,00:15:49,00:15:59,00:10,, +NHA033,1,sam,front,trial-2,JND,00:15:59,00:20:47,04:48,, +NHA033,1,sam,front,break-2,JND,00:20:47,00:21:52,01:05,, +NHA033,1,sam,front,trial-3,JND,00:21:52,00:29:33,07:41,, +NHA033,1,sam,front,break-3,JND,00:29:33,00:30:50,01:17,, +NHA033,1,sam,front,trial-4,JND,00:30:50,00:37:57,07:07,, +NHA033,1,sam,front,intro,Gender,00:40:16,00:40:55,00:39,, +NHA033,1,sam,front,train,Gender,00:40:55,00:42:18,01:23,, +NHA033,1,sam,front,test,Gender,00:42:59,00:49:36,06:37,, +NHA034,1,lap,side,train,JND,,,00:58,, +NHA034,1,lap,side,trial-1,JND,,,03:37,, +NHA034,1,lap,side,trial-2,JND,,,04:53,, +NHA034,1,lap,side,trial-3,JND,,,04:17,, +NHA034,1,lap,side,trial-4,JND,,,05:35,, +NHA034,1,lap,side,train,Gender,,,00:40,, +NHA034,1,lap,side,test,Gender,,,03:04,, +NHA034,1,lap,front,train,JND,00:00:07,00:01:05,00:58,, +NHA034,1,lap,front,trial-1,JND,00:01:22,00:04:59,03:37,, +NHA034,1,lap,front,trial-2,JND,00:04:59,00:09:52,04:53,, +NHA034,1,lap,front,trial-3,JND,00:09:52,00:14:09,04:17,, +NHA034,1,lap,front,trial-4,JND,00:14:09,00:19:44,05:35,, +NHA034,1,lap,front,train,Gender,00:21:12,00:21:52,00:40,, +NHA034,1,lap,front,test,Gender,00:22:12,00:25:16,03:04,, +NHA034,1,sam,side,intro,JND,00:01:38,00:02:44,01:06,, +NHA034,1,sam,side,train,JND,00:02:44,00:05:16,02:32,, +NHA034,1,sam,side,trial-1,JND,00:07:25,00:14:36,07:11,, +NHA034,1,sam,side,break-1,JND,00:14:36,00:14:46,00:10,, +NHA034,1,sam,side,trial-2,JND,00:14:46,00:22:14,07:28,, +NHA034,1,sam,side,break-2,JND,00:22:14,00:22:23,00:09,, +NHA034,1,sam,side,trial-3,JND,00:22:23,00:30:01,07:38,, +NHA034,1,sam,side,break-3,JND,00:30:01,00:30:30,00:29,, +NHA034,1,sam,side,trial-4,JND,00:30:30,00:38:02,07:32,, +NHA034,1,sam,side,intro,Gender,00:39:41,00:40:20,00:39,, +NHA034,1,sam,side,train,Gender,00:40:20,00:41:37,01:17,, +NHA034,1,sam,side,test,Gender,00:42:37,00:50:31,07:54,, +NHA034,1_2,sam,side,end,PICKA,00:50:31,00:50:49,00:18,, +NHA034,1,sam,front,intro,JND,,,0,, +NHA034,1,sam,front,train,JND,,,0,, +NHA034,1,sam,front,trial-1,JND,,,0,, +NHA034,1,sam,front,break-1,JND,,,0,, +NHA034,1,sam,front,trial-2,JND,,,0,, +NHA034,1,sam,front,break-2,JND,,,0,, +NHA034,1,sam,front,trial-3,JND,,,0,, +NHA034,1,sam,front,break-3,JND,,,0,, +NHA034,1,sam,front,trial-4,JND,,,0,, +NHA034,1,sam,front,intro,Gender,,,0,, +NHA034,1,sam,front,train,Gender,,,0,, +NHA034,1,sam,front,test,Gender,,,0,, +NHA035,1,lap,side,train,JND,,,00:23,, +NHA035,1,lap,side,trial-1,JND,,,04:05,, +NHA035,1,lap,side,trial-2,JND,,,04:32,, +NHA035,1,lap,side,trial-3,JND,,,03:19,, +NHA035,1,lap,side,trial-4,JND,,,16:27,, +NHA035,1,lap,side,train,Gender,,,00:41,, +NHA035,1,lap,side,test,Gender,,,02:55,, +NHA035,1,lap,front,train,JND,00:00:09,00:00:32,00:23,, +NHA035,1,lap,front,trial-1,JND,00:01:10,00:05:15,04:05,, +NHA035,1,lap,front,trial-2,JND,00:05:15,00:09:47,04:32,, +NHA035,1,lap,front,trial-3,JND,00:09:47,00:13:06,03:19,, +NHA035,1,lap,front,trial-4,JND,00:13:06,00:29:33,16:27,, +NHA035,1,lap,front,train,Gender,00:21:06,00:21:47,00:41,, +NHA035,1,lap,front,test,Gender,00:22:17,00:25:12,02:55,, +NHA035,1,sam,side,train,JND,00:00:20,00:02:20,02:00,, +NHA035,1,sam,side,trial-1,JND,00:04:01,00:10:16,06:15,, +NHA035,1,sam,side,break-1,JND,00:10:16,00:10:26,00:10,, +NHA035,1,sam,side,trial-2,JND,00:10:26,00:15:39,05:13,, +NHA035,1,sam,side,break-2,JND,00:15:39,00:16:37,00:58,, +NHA035,1,sam,side,trial-3,JND,00:16:37,00:26:12,09:35,, +NHA035,1,sam,side,break-3,JND,00:26:12,00:26:21,00:09,, +NHA035,1,sam,side,trial-4,JND,00:26:21,00:33:18,06:57,, +NHA035,1,sam,side,intro,Gender,00:35:17,00:35:57,00:40,, +NHA035,1,sam,side,train,Gender,00:35:57,00:37:20,01:23,, +NHA035,1,sam,side,test,Gender,00:37:48,00:43:59,06:11,, +NHA035,1,sam,front,intro,JND,,,0,, +NHA035,1,sam,front,train,JND,,,0,, +NHA035,1,sam,front,trial-1,JND,,,0,, +NHA035,1,sam,front,break-1,JND,,,0,, +NHA035,1,sam,front,trial-2,JND,,,0,, +NHA035,1,sam,front,break-2,JND,,,0,, +NHA035,1,sam,front,trial-3,JND,,,0,, +NHA035,1,sam,front,break-3,JND,,,0,, +NHA035,1,sam,front,trial-4,JND,,,0,, +NHA035,1,sam,front,intro,Gender,,,0,, +NHA035,1,sam,front,train,Gender,,,0,, +NHA035,1,sam,front,test,Gender,,,0,, +NHA036,1,lap,side,train,JND,,,01:01,, +NHA036,1,lap,side,trial-1,JND,,,07:22,, +NHA036,1,lap,side,trial-2,JND,,,04:40,, +NHA036,1,lap,side,trial-3,JND,,,05:43,, +NHA036,1,lap,side,trial-4,JND,,,04:09,, +NHA036,1,lap,side,train,Gender,,,00:44,, +NHA036,1,lap,side,test,Gender,,,03:55,, +NHA036,1,lap,front,train,JND,00:00:07,00:01:08,01:01,, +NHA036,1,lap,front,trial-1,JND,00:01:25,00:08:47,07:22,, +NHA036,1,lap,front,trial-2,JND,00:08:59,00:13:39,04:40,, +NHA036,1,lap,front,trial-3,JND,00:13:39,00:19:22,05:43,, +NHA036,1,lap,front,trial-4,JND,00:19:22,00:23:31,04:09,, +NHA036,1,lap,front,train,Gender,00:25:05,00:25:49,00:44,, +NHA036,1,lap,front,test,Gender,00:26:43,00:30:38,03:55,, +NHA036,1,sam,side,intro,JND,00:01:54,00:03:06,01:12,, +NHA036,1,sam,side,train,JND,00:03:06,00:05:15,02:09,, +NHA036,1,sam,side,trial-1,JND,00:05:47,00:14:04,08:17,, +NHA036,1,sam,side,break-1,JND,00:14:04,00:15:01,00:57,, +NHA036,1,sam,side,trial-2,JND,00:15:01,00:23:22,08:21,, +NHA036,1,sam,side,break-2,JND,00:23:22,00:23:50,00:28,, +NHA036,1,sam,side,trial-3,JND,00:23:50,00:31:09,07:19,, +NHA036,1,sam,side,break-3,JND,00:31:09,00:32:16,01:07,, +NHA036,1,sam,side,trial-4,JND,00:32:16,00:37:40,05:24,, +NHA036,1,sam,side,intro,Gender,00:42:18,00:42:54,00:36,, +NHA036,1,sam,side,train,Gender,00:42:54,00:44:16,01:22,, +NHA036,1,sam,side,test,Gender,00:45:00,00:53:15,08:15,, +NHA036,1_2,sam,side,end,PICKA,00:53:15,00:53:32,00:17,, +NHA036,1,sam,front,intro,JND,,,0,, +NHA036,1,sam,front,train,JND,,,0,, +NHA036,1,sam,front,trial-1,JND,,,0,, +NHA036,1,sam,front,break-1,JND,,,0,, +NHA036,1,sam,front,trial-2,JND,,,0,, +NHA036,1,sam,front,break-2,JND,,,0,, +NHA036,1,sam,front,trial-3,JND,,,0,, +NHA036,1,sam,front,break-3,JND,,,0,, +NHA036,1,sam,front,trial-4,JND,,,0,, +NHA036,1,sam,front,intro,Gender,,,0,, +NHA036,1,sam,front,train,Gender,,,0,, +NHA036,1,sam,front,test,Gender,00:42:59,00:49:36,06:37,, +NHA038,1,lap,side,train,JND,,,01:18,, +NHA038,1,lap,side,trial-1,JND,,,05:20,, +NHA038,1,lap,side,trial-2,JND,,,06:33,, +NHA038,1,lap,side,trial-3,JND,,,05:43,, +NHA038,1,lap,side,trial-4,JND,,,05:34,, +NHA038,1,lap,side,train,Gender,,,00:46,, +NHA038,1,lap,side,test,Gender,,,03:45,, +NHA038,1,lap,front,train,JND,00:01:38,00:02:56,01:18,, +NHA038,1,lap,front,trial-1,JND,00:04:06,00:09:26,05:20,, +NHA038,1,lap,front,trial-2,JND,00:09:42,00:16:15,06:33,, +NHA038,1,lap,front,trial-3,JND,00:16:38,00:22:21,05:43,, +NHA038,1,lap,front,trial-4,JND,00:22:30,00:28:04,05:34,, +NHA038,1,lap,front,train,Gender,00:30:03,00:30:49,00:46,, +NHA038,1,lap,front,test,Gender,00:31:34,00:35:19,03:45,, +NHA038,1,sam,side,intro,JND,00:00:30,00:01:45,01:15,, +NHA038,1,sam,side,train,JND,00:01:45,00:04:12,02:27,, +NHA038,1,sam,side,trial-1,JND,00:07:32,00:13:32,06:00,, +NHA038,1,sam,side,break-1,JND,00:13:32,00:13:49,00:17,, +NHA038,1,sam,side,trial-2,JND,00:13:49,00:20:49,07:00,, +NHA038,1,sam,side,break-2,JND,00:20:49,00:20:57,00:08,, +NHA038,1,sam,side,trial-3,JND,00:20:57,00:31:35,10:38,, +NHA038,1,sam,side,break-3,JND,00:31:35,00:31:44,00:09,, +NHA038,1,sam,side,trial-4,JND,00:31:44,00:38:19,06:35,, +NHA038,1,sam,side,intro,Gender,00:41:42,00:42:22,00:40,, +NHA038,1,sam,side,train,Gender,00:42:22,00:43:43,01:21,, +NHA038,1,sam,side,test,Gender,00:45:08,00:51:39,06:31,, +NHA038,1,sam,front,intro,JND,00:00:36,00:01:51,01:15,, +NHA038,1,sam,front,train,JND,00:01:51,00:04:19,02:28,, +NHA038,1,sam,front,trial-1,JND,00:07:38,00:13:38,06:00,, +NHA038,1,sam,front,break-1,JND,00:13:38,00:13:56,00:18,, +NHA038,1,sam,front,trial-2,JND,00:13:56,00:20:56,07:00,, +NHA038,1,sam,front,break-2,JND,00:20:56,00:21:05,00:09,, +NHA038,1,sam,front,trial-3,JND,00:21:05,00:31:42,10:37,, +NHA038,1,sam,front,break-3,JND,00:31:42,00:31:50,00:08,, +NHA038,1,sam,front,trial-4,JND,00:31:50,00:38:26,06:36,, +NHA038,1,sam,front,intro,Gender,00:41:49,00:42:29,00:40,, +NHA038,1,sam,front,train,Gender,00:42:29,00:43:49,01:20,, +NHA038,1,sam,front,test,Gender,00:45:15,00:51:46,06:31,, +NHA039,1,lap,side,train,JND,,,00:57,, +NHA039,1,lap,side,trial-1,JND,,,03:31,, +NHA039,1,lap,side,trial-2,JND,,,04:54,, +NHA039,1,lap,side,trial-3,JND,,,04:31,, +NHA039,1,lap,side,trial-4,JND,,,03:55,, +NHA039,1,lap,side,train,Gender,,,00:40,, +NHA039,1,lap,side,test,Gender,,,03:03,, +NHA039,1,lap,front,train,JND,00:00:13,00:01:10,00:57,, +NHA039,1,lap,front,trial-1,JND,00:01:29,00:05:00,03:31,, +NHA039,1,lap,front,trial-2,JND,00:05:00,00:09:54,04:54,, +NHA039,1,lap,front,trial-3,JND,00:09:54,00:14:25,04:31,, +NHA039,1,lap,front,trial-4,JND,00:14:25,00:18:20,03:55,, +NHA039,1,lap,front,train,Gender,00:19:30,00:20:10,00:40,, +NHA039,1,lap,front,test,Gender,00:20:34,00:23:37,03:03,, +NHA039,1,sam,side,intro,JND,00:00:00,00:01:10,01:10,, +NHA039,1,sam,side,train,JND,00:01:10,00:03:16,02:06,, +NHA039,1,sam,side,trial-1,JND,00:03:59,00:12:34,08:35,, +NHA039,1,sam,side,break-1,JND,00:12:34,00:12:50,00:16,, +NHA039,1,sam,side,trial-2,JND,00:12:50,00:17:14,04:24,, +NHA039,1,sam,side,break-2,JND,00:17:14,00:17:23,00:09,, +NHA039,1,sam,side,trial-3,JND,00:17:23,00:24:23,07:00,, +NHA039,1,sam,side,break-3,JND,00:24:23,00:24:31,00:08,, +NHA039,1,sam,side,trial-4,JND,00:24:31,00:29:03,04:32,, +NHA039,1,sam,side,intro,Gender,00:30:50,00:31:29,00:39,, +NHA039,1,sam,side,train,Gender,00:31:29,00:32:48,01:19,, +NHA039,1,sam,side,test,Gender,00:33:31,00:39:02,05:31,, +NHA039,1,sam,front,intro,JND,00:00:10,00:01:20,01:10,, +NHA039,1,sam,front,train,JND,00:01:20,00:03:26,02:06,, +NHA039,1,sam,front,trial-1,JND,00:04:08,00:12:43,08:35,, +NHA039,1,sam,front,break-1,JND,00:12:43,00:12:59,00:16,, +NHA039,1,sam,front,trial-2,JND,00:12:59,00:17:23,04:24,, +NHA039,1,sam,front,break-2,JND,00:17:23,00:17:32,00:09,, +NHA039,1,sam,front,trial-3,JND,00:17:32,00:24:31,06:59,, +NHA039,1,sam,front,break-3,JND,00:24:31,00:24:40,00:09,, +NHA039,1,sam,front,trial-4,JND,00:24:40,00:29:12,04:32,, +NHA039,1,sam,front,intro,Gender,00:30:59,00:31:39,00:40,, +NHA039,1,sam,front,train,Gender,00:31:39,00:32:57,01:18,, +NHA039,1,sam,front,test,Gender,00:33:40,00:39:13,05:33,, +NHA041,1,lap,side,train,JND,00:00:23,00:01:19,0,, +NHA041,1,lap,side,trial-1,JND,00:01:50,00:07:13,0,, +NHA041,1,lap,side,trial-2,JND,00:07:13,00:12:36,0,, +NHA041,1,lap,side,trial-3,JND,00:12:36,00:18:15,0,, +NHA041,1,lap,side,trial-4,JND,00:18:15,00:23:55,0,, +NHA041,1,lap,side,train,Gender,00:26:52,00:27:39,00:45,, +NHA041,1,lap,side,test,Gender,00:28:00,00:31:54,03:55,, +NHA041,1,lap,front,train,JND,,,0,, +NHA041,1,lap,front,trial-1,JND,,,0,, +NHA041,1,lap,front,trial-2,JND,,,0,, +NHA041,1,lap,front,trial-3,JND,,,0,, +NHA041,1,lap,front,trial-4,JND,,,0,, +NHA041,1,lap,front,train,Gender,00:00:43,00:01:28,00:45,, +NHA041,1,lap,front,test,Gender,00:01:49,00:05:44,03:55,, +NHA041,1,sam,side,intro,JND,,,0,, +NHA041,1,sam,side,train,JND,,,0,, +NHA041,1,sam,side,trial-1,JND,,,0,, +NHA041,1,sam,side,break-1,JND,,,0,, +NHA041,1,sam,side,trial-2,JND,,,0,, +NHA041,1,sam,side,break-2,JND,,,0,, +NHA041,1,sam,side,trial-3,JND,,,0,, +NHA041,1,sam,side,break-3,JND,,,0,, +NHA041,1,sam,side,trial-4,JND,,,0,, +NHA041,1,sam,side,intro,Gender,,,0,, +NHA041,1,sam,side,train,Gender,,,0,, +NHA041,1,sam,side,test,Gender,,,0,, +NHA041,1,sam,front,intro,JND,00:00:00,00:00:59,00:59,, +NHA041,1,sam,front,train,JND,00:00:59,00:03:20,02:21,, +NHA041,1,sam,front,trial-1,JND,00:08:04,00:16:59,08:55,, +NHA041,1,sam,front,break-1,JND,00:16:59,00:18:03,01:04,, +NHA041,1,sam,front,trial-2,JND,00:18:03,00:24:09,06:06,, +NHA041,1,sam,front,break-2,JND,00:24:09,00:25:07,00:58,, +NHA041,1,sam,front,trial-3,JND,00:25:07,00:29:58,04:51,, +NHA041,1,sam,front,break-3,JND,00:29:58,00:31:04,01:06,, +NHA041,1,sam,front,trial-4,JND,00:31:04,00:37:20,06:16,, +NHA041,1,sam,front,intro,Gender,00:39:14,00:39:53,00:39,, +NHA041,1,sam,front,train,Gender,00:39:53,00:41:17,01:24,, +NHA041,1,sam,front,test,Gender,00:41:56,00:48:33,06:37,, \ No newline at end of file diff --git a/tools/to_noise.py b/tools/to_noise.py new file mode 100644 index 0000000..73e0d49 --- /dev/null +++ b/tools/to_noise.py @@ -0,0 +1,23 @@ +import numpy as np +from scipy.fftpack import fft + + +def noise(x, fs, do_am=False, smooth=False): + X = fft(x) + n = len(X) + + if n % 2 == 0: + p = np.random.rand((n-2)/2) + p = np.hstack((0, p, 0, -p)) + else: + p = np.random.rand((n-1)/2) + p = np.hstack((0, p, -p)) + + if not smooth: + Y = np.abs(X) * np.exp(1j*2*np.pi*p) + + y = np.real(np.fft.ifft(Y)) + + y = y * np.sqrt(np.mean(x**2)) / np.sqrt(np.mean(y**2)) + + return y diff --git a/tools/volume_test.py b/tools/volume_test.py new file mode 100644 index 0000000..72e928e --- /dev/null +++ b/tools/volume_test.py @@ -0,0 +1,25 @@ +from numpy import sort +from playsound import playsound +import paramiko +import os +from naoqi import ALProxy + +pth = "/home/nao/Documents/Pure tones/" + +files = os.listdir(pth) + +# for f, file_as_num in enumerate(sorted(int(os.path.splitext(file)[0][:-2]) for file in files)): +# print(file_as_num) +# playsound(os.path.join(pth,str(file_as_num) + "Hz.wav")) +# raw_input("Continue?") + +aap = ALProxy("ALAudioPlayer", "sam.local", 9559) +aad = ALProxy("ALAudioDevice", "sam.local",9559) + +aad.setOutputVolume(10) + +sam_pth = "/home/nao/volume_test/" +for f, file_as_num in enumerate(sorted(int(os.path.splitext(file)[0][:-2]) for file in files)): + print(file_as_num) + aap.playFile(sam_pth + str(file_as_num) + "Hz.wav") + raw_input("Continue?") \ No newline at end of file diff --git a/www/__init__.py b/www/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/www/app.py b/www/app.py new file mode 100644 index 0000000..ab7fe37 --- /dev/null +++ b/www/app.py @@ -0,0 +1,193 @@ +from flask import Flask, render_template, request, url_for, redirect, jsonify +from celery import Celery +from naoqi import ALBroker +import subprocess +import os +import sys +import pickle +import time + +from multiprocessing import Pool + +if True: + sys.path.append("../") + from tools.exit_condition import ExitExperimentModule + import tools.settings as settings + +app = Flask(__name__) +_pool = None +# app.config['CELERY_BROKER_URL'] = 'redis://localhost:6379/0' +# app.config['CELERY_RESULT_BACKEND'] = 'redis://localhost:6379/0' +# website_url = "picka-exp.xyx:5000" +# app.config["SERVER_NAME"] = website_url +# celery = Celery(app.name, broker=app.config["CELERY_BROKER_URL"]) +# celery.conf.update(app.config) +expe_exit = None +global language + +IP_ADDRESS = "169.254.165.5" +# IP_ADDRESS = "sam.local" +# @celery.task(bind=True) +# def runPickaExp(self, subject, game, phase, lang, p_exists, ip): + + +def runPickaExp(subject, game, phase, lang, p_exists, ip): + sys.path.append(os.getcwd()) + from picka import pickaMain + # + # This might take several minutes to complete + # @celery.task(bind=True) + + # def runPickaExp(self, subject, game, phase, lang, p_exists, ip): + print("Started picka!!") + if os.getcwd() != '/home/nao/Documents/Sam_files/Python_scripts': + os.chdir('../') + pickaMain(subject, game, phase, lang, p_exists, ip, broker=True) + # main(subject, game, phase, lang, p_exists, + # ip, broker=True, cel_id=self.request.id) + print "End of running process." + + +@app.route('/') +def hello(): + return render_template("main.html") + + +@app.route("/run_picka", methods=["GET", "POST"]) +def runPicka(): + global language + + error = 0 + p_exists = request.form.get("p_exists") + game = request.form.get("game") + subject = request.form.get("participant").strip() + phase = request.form.get("phase").strip().lower() + lang = request.form.get("lang").strip() + language = lang + ip = IP_ADDRESS + p_exists = int(p_exists == 'true') + port = "9559" + try: + if p_exists != None: + # runPickaExp.delay(subject, game, phase, lang, p_exists, ip) + try: + # runPickaExp(subject, game, phase, lang, p_exists, ip) + begin = _pool.apply_async( + runPickaExp, [subject, game, phase, lang, p_exists, ip]) + except: + raise Exception() + return jsonify({'game': game}) + except RuntimeError as e: + error = 1 + print e + print "There was an error." + return jsonify({'game': game, "error": error}) + # cmd = "/usr/bin/python picka.py -s {} -g {} -p {} -l {} -e {}".format( + # subject, game, phase, lang, p_exists) + # print cmd + # subprocess.call(cmd, shell=True) + + +@app.route('/check_participant', methods=['GET', 'POST']) +def check_participant(): + if os.getcwd() != "/home/nao/Documents/Sam_files/Python_scripts/www": + os.chdir("./www") + game = request.form.get("game") + subject = request.form.get("participant").strip() + phase = request.form.get("phase").strip().lower() + lang = request.form.get("lang").strip() + + if game == "fishy": + + participant = os.path.join( + "../results/" + subject, + "jnd_{}_{}_robot.mat".format(lang.lower(), subject)) + else: + participant = os.path.join( + "../results/" + subject, + "{}_{}_{}_robot.mat".format(game[:3], lang.lower(), subject)) + # subprocess.call(cmd, shell=True) + p_exists = 0 + if os.path.exists(participant): + p_exists = 1 + # os.chdir("www/") + # return redirect(url_for('checkParticipant', participant=participant)) + return jsonify({ + 'p_exists': p_exists, + "game": game, + "subject": subject, + "phase": phase, + "lang": lang + }) + + +@app.route('/no-interaction') +def noInt(): + return render_template('no-int.html') + + +@app.route('/no-interaction-diagram') +def noIntDiagram(): + return render_template('no-int-w-diagram.html') + + +@app.route('/crm-game') +def runCRM(): + global language + while not os.path.exists('../crm/trials.p'): + time.sleep(0.01) + if os.path.isfile('../crm/trials.p'): + try: + with open('../crm/trials.p', 'rb') as f: + data = pickle.load(f) + except EOFError as e: + print e + + os.remove('../crm/trials.p') + language = 'en' + return render_template("crm-game.html", + lang=language, + current_trial=int(data["current_trial"]), + total_trials=int(data["total_trials"])) + + +@app.route('/crm_answer', methods=["GET", "POST"]) +def save_answer(): + colour = request.form.get("colour") + number = request.form.get("number") + + answer = {"colour": colour, "number": number} + + pickle.dump(answer, open('../crm/answer.p', 'wb')) + while not os.path.exists('../crm/trials.p'): + time.sleep(0.01) + + if os.path.isfile('../crm/trials.p'): + try: + with open('../crm/trials.p', 'rb') as f: + data = pickle.load(f) + except EOFError as e: + print e + os.remove('../crm/trials.p') + + resp = {"answer": answer, "trials": data} + + # return redirect(url_for('runCRM')) + return jsonify(resp) + + +if __name__ == "__main__": + # runPickaExp("NHA927", "crm", "training", "EN", 0, IP_ADDRESS) + global expe_exit + settings.init() + _pool = Pool(processes=4) + + try: + # myBroker = ALBroker("myBroker", "0.0.0.0", 0, IP_ADDRESS, 9559) + # expe_exit = ExitExperimentModule("expe_exit", myBroker, "EN") + app.run(host="0.0.0.0", debug=True) + except SystemError as e: + print e + _pool.close() + _pool.join() + os._exit(1) diff --git a/www/celery.sh b/www/celery.sh new file mode 100644 index 0000000..aac9ca6 --- /dev/null +++ b/www/celery.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +echo "test" + +celery -A app.celery worker --loglevel=debug diff --git a/www/static/css/bootstrap.min.css b/www/static/css/bootstrap.min.css new file mode 100644 index 0000000..8fbe5a1 --- /dev/null +++ b/www/static/css/bootstrap.min.css @@ -0,0 +1,11416 @@ +/*! + * Bootstrap v4.4.1 (https://getbootstrap.com/) + * Copyright 2011-2019 The Bootstrap Authors + * Copyright 2011-2019 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: #6c757d; + --gray-dark: #343a40; + --primary: #007bff; + --secondary: #6c757d; + --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, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + --font-family-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace +} + +*, +::after, +::before { + box-sizing: border-box +} + +html { + font-family: sans-serif; + line-height: 1.15; + -webkit-text-size-adjust: 100%; + -webkit-tap-highlight-color: transparent +} + +article, +aside, +figcaption, +figure, +footer, +header, +hgroup, +main, +nav, +section { + display: block +} + +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #212529; + text-align: left; + background-color: #fff +} + +[tabindex="-1"]:focus:not(:focus-visible) { + 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; + -webkit-text-decoration-skip-ink: none; + text-decoration-skip-ink: none +} + +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 +} + +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 +} + +a:hover { + color: #0056b3; + text-decoration: underline +} + +a:not([href]) { + color: inherit; + text-decoration: none +} + +a:not([href]):hover { + color: inherit; + text-decoration: none +} + +code, +kbd, +pre, +samp { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-size: 1em +} + +pre { + margin-top: 0; + margin-bottom: 1rem; + overflow: auto +} + +figure { + margin: 0 0 1rem +} + +img { + vertical-align: middle; + border-style: none +} + +svg { + overflow: hidden; + vertical-align: middle +} + +table { + border-collapse: collapse +} + +caption { + padding-top: .75rem; + padding-bottom: .75rem; + color: #6c757d; + 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 +} + +select { + word-wrap: normal +} + +[type=button], +[type=reset], +[type=submit], +button { + -webkit-appearance: button +} + +[type=button]:not(:disabled), +[type=reset]:not(:disabled), +[type=submit]:not(:disabled), +button:not(:disabled) { + cursor: pointer +} + +[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-decoration { + -webkit-appearance: none +} + +::-webkit-file-upload-button { + font: inherit; + -webkit-appearance: button +} + +output { + display: inline-block +} + +summary { + display: list-item; + cursor: pointer +} + +template { + display: none +} + +[hidden] { + display: none !important +} + +.h1, +.h2, +.h3, +.h4, +.h5, +.h6, +h1, +h2, +h3, +h4, +h5, +h6 { + margin-bottom: .5rem; + font-weight: 500; + line-height: 1.2 +} + +.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: .5rem +} + +.initialism { + font-size: 90%; + text-transform: uppercase +} + +.blockquote { + margin-bottom: 1rem; + font-size: 1.25rem +} + +.blockquote-footer { + display: block; + font-size: 80%; + color: #6c757d +} + +.blockquote-footer::before { + content: "\2014\00A0" +} + +.img-fluid { + max-width: 100%; + height: auto +} + +.img-thumbnail { + padding: .25rem; + background-color: #fff; + border: 1px solid #dee2e6; + border-radius: .25rem; + max-width: 100%; + height: auto +} + +.figure { + display: inline-block +} + +.figure-img { + margin-bottom: .5rem; + line-height: 1 +} + +.figure-caption { + font-size: 90%; + color: #6c757d +} + +code { + font-size: 87.5%; + color: #e83e8c; + word-wrap: break-word +} + +a>code { + color: inherit +} + +kbd { + padding: .2rem .4rem; + font-size: 87.5%; + color: #fff; + background-color: #212529; + border-radius: .2rem +} + +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: 700 +} + +pre { + display: block; + font-size: 87.5%; + color: #212529 +} + +pre code { + font-size: inherit; + color: inherit; + word-break: normal +} + +.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, +.container-lg, +.container-md, +.container-sm, +.container-xl { + width: 100%; + padding-right: 15px; + padding-left: 15px; + margin-right: auto; + margin-left: auto +} + +@media (min-width:576px) { + + .container, + .container-sm { + max-width: 540px + } +} + +@media (min-width:768px) { + + .container, + .container-md, + .container-sm { + max-width: 720px + } +} + +@media (min-width:992px) { + + .container, + .container-lg, + .container-md, + .container-sm { + max-width: 960px + } +} + +@media (min-width:1200px) { + + .container, + .container-lg, + .container-md, + .container-sm, + .container-xl { + max-width: 1140px + } +} + +.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%; + 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% +} + +.row-cols-1>* { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100% +} + +.row-cols-2>* { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50% +} + +.row-cols-3>* { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333% +} + +.row-cols-4>* { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25% +} + +.row-cols-5>* { + -ms-flex: 0 0 20%; + flex: 0 0 20%; + max-width: 20% +} + +.row-cols-6>* { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667% +} + +.col-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: 100% +} + +.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-last { + -ms-flex-order: 13; + order: 13 +} + +.order-0 { + -ms-flex-order: 0; + order: 0 +} + +.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% + } + + .row-cols-sm-1>* { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100% + } + + .row-cols-sm-2>* { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50% + } + + .row-cols-sm-3>* { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333% + } + + .row-cols-sm-4>* { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25% + } + + .row-cols-sm-5>* { + -ms-flex: 0 0 20%; + flex: 0 0 20%; + max-width: 20% + } + + .row-cols-sm-6>* { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667% + } + + .col-sm-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: 100% + } + + .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-last { + -ms-flex-order: 13; + order: 13 + } + + .order-sm-0 { + -ms-flex-order: 0; + order: 0 + } + + .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% + } + + .row-cols-md-1>* { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100% + } + + .row-cols-md-2>* { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50% + } + + .row-cols-md-3>* { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333% + } + + .row-cols-md-4>* { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25% + } + + .row-cols-md-5>* { + -ms-flex: 0 0 20%; + flex: 0 0 20%; + max-width: 20% + } + + .row-cols-md-6>* { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667% + } + + .col-md-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: 100% + } + + .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-last { + -ms-flex-order: 13; + order: 13 + } + + .order-md-0 { + -ms-flex-order: 0; + order: 0 + } + + .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% + } + + .row-cols-lg-1>* { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100% + } + + .row-cols-lg-2>* { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50% + } + + .row-cols-lg-3>* { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333% + } + + .row-cols-lg-4>* { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25% + } + + .row-cols-lg-5>* { + -ms-flex: 0 0 20%; + flex: 0 0 20%; + max-width: 20% + } + + .row-cols-lg-6>* { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667% + } + + .col-lg-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: 100% + } + + .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-last { + -ms-flex-order: 13; + order: 13 + } + + .order-lg-0 { + -ms-flex-order: 0; + order: 0 + } + + .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% + } + + .row-cols-xl-1>* { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100% + } + + .row-cols-xl-2>* { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50% + } + + .row-cols-xl-3>* { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333% + } + + .row-cols-xl-4>* { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25% + } + + .row-cols-xl-5>* { + -ms-flex: 0 0 20%; + flex: 0 0 20%; + max-width: 20% + } + + .row-cols-xl-6>* { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667% + } + + .col-xl-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: 100% + } + + .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-last { + -ms-flex-order: 13; + order: 13 + } + + .order-xl-0 { + -ms-flex-order: 0; + order: 0 + } + + .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%; + margin-bottom: 1rem; + color: #212529 +} + +.table td, +.table th { + padding: .75rem; + vertical-align: top; + border-top: 1px solid #dee2e6 +} + +.table thead th { + vertical-align: bottom; + border-bottom: 2px solid #dee2e6 +} + +.table tbody+tbody { + border-top: 2px solid #dee2e6 +} + +.table-sm td, +.table-sm th { + padding: .3rem +} + +.table-bordered { + border: 1px solid #dee2e6 +} + +.table-bordered td, +.table-bordered th { + border: 1px solid #dee2e6 +} + +.table-bordered thead td, +.table-bordered thead th { + border-bottom-width: 2px +} + +.table-borderless tbody+tbody, +.table-borderless td, +.table-borderless th, +.table-borderless thead th { + border: 0 +} + +.table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(0, 0, 0, .05) +} + +.table-hover tbody tr:hover { + color: #212529; + background-color: rgba(0, 0, 0, .075) +} + +.table-primary, +.table-primary>td, +.table-primary>th { + background-color: #b8daff +} + +.table-primary tbody+tbody, +.table-primary td, +.table-primary th, +.table-primary thead th { + border-color: #7abaff +} + +.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: #d6d8db +} + +.table-secondary tbody+tbody, +.table-secondary td, +.table-secondary th, +.table-secondary thead th { + border-color: #b3b7bb +} + +.table-hover .table-secondary:hover { + background-color: #c8cbcf +} + +.table-hover .table-secondary:hover>td, +.table-hover .table-secondary:hover>th { + background-color: #c8cbcf +} + +.table-success, +.table-success>td, +.table-success>th { + background-color: #c3e6cb +} + +.table-success tbody+tbody, +.table-success td, +.table-success th, +.table-success thead th { + border-color: #8fd19e +} + +.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-info tbody+tbody, +.table-info td, +.table-info th, +.table-info thead th { + border-color: #86cfda +} + +.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-warning tbody+tbody, +.table-warning td, +.table-warning th, +.table-warning thead th { + border-color: #ffdf7e +} + +.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-danger tbody+tbody, +.table-danger td, +.table-danger th, +.table-danger thead th { + border-color: #ed969e +} + +.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-light tbody+tbody, +.table-light td, +.table-light th, +.table-light thead th { + border-color: #fbfcfc +} + +.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-dark tbody+tbody, +.table-dark td, +.table-dark th, +.table-dark thead th { + border-color: #95999c +} + +.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: #343a40; + border-color: #454d55 +} + +.table .thead-light th { + color: #495057; + background-color: #e9ecef; + border-color: #dee2e6 +} + +.table-dark { + color: #fff; + background-color: #343a40 +} + +.table-dark td, +.table-dark th, +.table-dark thead th { + border-color: #454d55 +} + +.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 { + color: #fff; + background-color: rgba(255, 255, 255, .075) +} + +@media (max-width:575.98px) { + .table-responsive-sm { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch + } + + .table-responsive-sm>.table-bordered { + border: 0 + } +} + +@media (max-width:767.98px) { + .table-responsive-md { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch + } + + .table-responsive-md>.table-bordered { + border: 0 + } +} + +@media (max-width:991.98px) { + .table-responsive-lg { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch + } + + .table-responsive-lg>.table-bordered { + border: 0 + } +} + +@media (max-width:1199.98px) { + .table-responsive-xl { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch + } + + .table-responsive-xl>.table-bordered { + border: 0 + } +} + +.table-responsive { + display: block; + width: 100%; + overflow-x: auto; + -webkit-overflow-scrolling: touch +} + +.table-responsive>.table-bordered { + border: 0 +} + +.form-control { + display: block; + width: 100%; + height: calc(1.5em + .75rem + 2px); + padding: .375rem .75rem; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #495057; + background-color: #fff; + background-clip: padding-box; + border: 1px solid #ced4da; + border-radius: .25rem; + transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out +} + +@media (prefers-reduced-motion:reduce) { + .form-control { + transition: none + } +} + +.form-control::-ms-expand { + background-color: transparent; + border: 0 +} + +.form-control:-moz-focusring { + color: transparent; + text-shadow: 0 0 0 #495057 +} + +.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: #6c757d; + opacity: 1 +} + +.form-control::-moz-placeholder { + color: #6c757d; + opacity: 1 +} + +.form-control:-ms-input-placeholder { + color: #6c757d; + opacity: 1 +} + +.form-control::-ms-input-placeholder { + color: #6c757d; + opacity: 1 +} + +.form-control::placeholder { + color: #6c757d; + opacity: 1 +} + +.form-control:disabled, +.form-control[readonly] { + background-color: #e9ecef; + opacity: 1 +} + +select.form-control:focus::-ms-value { + color: #495057; + background-color: #fff +} + +.form-control-file, +.form-control-range { + display: block; + width: 100% +} + +.col-form-label { + padding-top: calc(.375rem + 1px); + padding-bottom: calc(.375rem + 1px); + margin-bottom: 0; + font-size: inherit; + 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 +} + +.form-control-plaintext { + display: block; + width: 100%; + padding: .375rem 0; + margin-bottom: 0; + font-size: 1rem; + line-height: 1.5; + color: #212529; + background-color: transparent; + border: solid transparent; + border-width: 1px 0 +} + +.form-control-plaintext.form-control-lg, +.form-control-plaintext.form-control-sm { + padding-right: 0; + padding-left: 0 +} + +.form-control-sm { + height: calc(1.5em + .5rem + 2px); + padding: .25rem .5rem; + font-size: .875rem; + line-height: 1.5; + border-radius: .2rem +} + +.form-control-lg { + height: calc(1.5em + 1rem + 2px); + padding: .5rem 1rem; + font-size: 1.25rem; + line-height: 1.5; + border-radius: .3rem +} + +select.form-control[multiple], +select.form-control[size] { + height: auto +} + +textarea.form-control { + height: auto +} + +.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; + padding-left: 1.25rem +} + +.form-check-input { + position: absolute; + margin-top: .3rem; + margin-left: -1.25rem +} + +.form-check-input:disabled~.form-check-label, +.form-check-input[disabled]~.form-check-label { + color: #6c757d +} + +.form-check-label { + margin-bottom: 0 +} + +.form-check-inline { + display: -ms-inline-flexbox; + display: inline-flex; + -ms-flex-align: center; + align-items: center; + padding-left: 0; + margin-right: .75rem +} + +.form-check-inline .form-check-input { + position: static; + margin-top: 0; + margin-right: .3125rem; + margin-left: 0 +} + +.valid-feedback { + display: none; + width: 100%; + margin-top: .25rem; + font-size: 80%; + color: #28a745 +} + +.valid-tooltip { + position: absolute; + top: 100%; + z-index: 5; + display: none; + max-width: 100%; + padding: .25rem .5rem; + margin-top: .1rem; + font-size: .875rem; + line-height: 1.5; + color: #fff; + background-color: rgba(40, 167, 69, .9); + border-radius: .25rem +} + +.is-valid~.valid-feedback, +.is-valid~.valid-tooltip, +.was-validated :valid~.valid-feedback, +.was-validated :valid~.valid-tooltip { + display: block +} + +.form-control.is-valid, +.was-validated .form-control:valid { + border-color: #28a745; + padding-right: calc(1.5em + .75rem); + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e"); + background-repeat: no-repeat; + background-position: right calc(.375em + .1875rem) center; + background-size: calc(.75em + .375rem) calc(.75em + .375rem) +} + +.form-control.is-valid:focus, +.was-validated .form-control:valid:focus { + border-color: #28a745; + box-shadow: 0 0 0 .2rem rgba(40, 167, 69, .25) +} + +.was-validated textarea.form-control:valid, +textarea.form-control.is-valid { + padding-right: calc(1.5em + .75rem); + background-position: top calc(.375em + .1875rem) right calc(.375em + .1875rem) +} + +.custom-select.is-valid, +.was-validated .custom-select:valid { + border-color: #28a745; + padding-right: calc(.75em + 2.3125rem); + background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px, url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem) +} + +.custom-select.is-valid:focus, +.was-validated .custom-select:valid:focus { + border-color: #28a745; + box-shadow: 0 0 0 .2rem rgba(40, 167, 69, .25) +} + +.form-check-input.is-valid~.form-check-label, +.was-validated .form-check-input:valid~.form-check-label { + color: #28a745 +} + +.form-check-input.is-valid~.valid-feedback, +.form-check-input.is-valid~.valid-tooltip, +.was-validated .form-check-input:valid~.valid-feedback, +.was-validated .form-check-input:valid~.valid-tooltip { + display: block +} + +.custom-control-input.is-valid~.custom-control-label, +.was-validated .custom-control-input:valid~.custom-control-label { + color: #28a745 +} + +.custom-control-input.is-valid~.custom-control-label::before, +.was-validated .custom-control-input:valid~.custom-control-label::before { + border-color: #28a745 +} + +.custom-control-input.is-valid:checked~.custom-control-label::before, +.was-validated .custom-control-input:valid:checked~.custom-control-label::before { + border-color: #34ce57; + background-color: #34ce57 +} + +.custom-control-input.is-valid:focus~.custom-control-label::before, +.was-validated .custom-control-input:valid:focus~.custom-control-label::before { + box-shadow: 0 0 0 .2rem rgba(40, 167, 69, .25) +} + +.custom-control-input.is-valid:focus:not(:checked)~.custom-control-label::before, +.was-validated .custom-control-input:valid:focus:not(:checked)~.custom-control-label::before { + border-color: #28a745 +} + +.custom-file-input.is-valid~.custom-file-label, +.was-validated .custom-file-input:valid~.custom-file-label { + border-color: #28a745 +} + +.custom-file-input.is-valid:focus~.custom-file-label, +.was-validated .custom-file-input:valid:focus~.custom-file-label { + border-color: #28a745; + box-shadow: 0 0 0 .2rem rgba(40, 167, 69, .25) +} + +.invalid-feedback { + display: none; + width: 100%; + margin-top: .25rem; + font-size: 80%; + color: #dc3545 +} + +.invalid-tooltip { + position: absolute; + top: 100%; + z-index: 5; + display: none; + max-width: 100%; + padding: .25rem .5rem; + margin-top: .1rem; + font-size: .875rem; + line-height: 1.5; + color: #fff; + background-color: rgba(220, 53, 69, .9); + border-radius: .25rem +} + +.is-invalid~.invalid-feedback, +.is-invalid~.invalid-tooltip, +.was-validated :invalid~.invalid-feedback, +.was-validated :invalid~.invalid-tooltip { + display: block +} + +.form-control.is-invalid, +.was-validated .form-control:invalid { + border-color: #dc3545; + padding-right: calc(1.5em + .75rem); + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e"); + background-repeat: no-repeat; + background-position: right calc(.375em + .1875rem) center; + background-size: calc(.75em + .375rem) calc(.75em + .375rem) +} + +.form-control.is-invalid:focus, +.was-validated .form-control:invalid:focus { + border-color: #dc3545; + box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .25) +} + +.was-validated textarea.form-control:invalid, +textarea.form-control.is-invalid { + padding-right: calc(1.5em + .75rem); + background-position: top calc(.375em + .1875rem) right calc(.375em + .1875rem) +} + +.custom-select.is-invalid, +.was-validated .custom-select:invalid { + border-color: #dc3545; + padding-right: calc(.75em + 2.3125rem); + background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/8px 10px, url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") #fff no-repeat center right 1.75rem/calc(.75em + .375rem) calc(.75em + .375rem) +} + +.custom-select.is-invalid:focus, +.was-validated .custom-select:invalid:focus { + border-color: #dc3545; + box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .25) +} + +.form-check-input.is-invalid~.form-check-label, +.was-validated .form-check-input:invalid~.form-check-label { + color: #dc3545 +} + +.form-check-input.is-invalid~.invalid-feedback, +.form-check-input.is-invalid~.invalid-tooltip, +.was-validated .form-check-input:invalid~.invalid-feedback, +.was-validated .form-check-input:invalid~.invalid-tooltip { + display: block +} + +.custom-control-input.is-invalid~.custom-control-label, +.was-validated .custom-control-input:invalid~.custom-control-label { + color: #dc3545 +} + +.custom-control-input.is-invalid~.custom-control-label::before, +.was-validated .custom-control-input:invalid~.custom-control-label::before { + border-color: #dc3545 +} + +.custom-control-input.is-invalid:checked~.custom-control-label::before, +.was-validated .custom-control-input:invalid:checked~.custom-control-label::before { + border-color: #e4606d; + background-color: #e4606d +} + +.custom-control-input.is-invalid:focus~.custom-control-label::before, +.was-validated .custom-control-input:invalid:focus~.custom-control-label::before { + box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .25) +} + +.custom-control-input.is-invalid:focus:not(:checked)~.custom-control-label::before, +.was-validated .custom-control-input:invalid:focus:not(:checked)~.custom-control-label::before { + border-color: #dc3545 +} + +.custom-file-input.is-invalid~.custom-file-label, +.was-validated .custom-file-input:invalid~.custom-file-label { + border-color: #dc3545 +} + +.custom-file-input.is-invalid:focus~.custom-file-label, +.was-validated .custom-file-input:invalid:focus~.custom-file-label { + border-color: #dc3545; + 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 .custom-select, + .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; + padding-left: 0 + } + + .form-inline .form-check-input { + position: relative; + -ms-flex-negative: 0; + flex-shrink: 0; + margin-top: 0; + margin-right: .25rem; + margin-left: 0 + } + + .form-inline .custom-control { + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: center; + justify-content: center + } + + .form-inline .custom-control-label { + margin-bottom: 0 + } +} + +.btn { + display: inline-block; + font-weight: 400; + color: #212529; + text-align: center; + vertical-align: middle; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-color: transparent; + border: 1px solid transparent; + padding: .375rem .75rem; + font-size: 1rem; + line-height: 1.5; + border-radius: .25rem; + transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out +} + +@media (prefers-reduced-motion:reduce) { + .btn { + transition: none + } +} + +.btn:hover { + color: #212529; + 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 +} + +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 { + color: #fff; + background-color: #0069d9; + border-color: #0062cc; + box-shadow: 0 0 0 .2rem rgba(38, 143, 255, .5) +} + +.btn-primary.disabled, +.btn-primary:disabled { + color: #fff; + 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 +} + +.btn-primary:not(:disabled):not(.disabled).active:focus, +.btn-primary:not(:disabled):not(.disabled):active:focus, +.show>.btn-primary.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(38, 143, 255, .5) +} + +.btn-secondary { + color: #fff; + background-color: #6c757d; + border-color: #6c757d +} + +.btn-secondary:hover { + color: #fff; + background-color: #5a6268; + border-color: #545b62 +} + +.btn-secondary.focus, +.btn-secondary:focus { + color: #fff; + background-color: #5a6268; + border-color: #545b62; + box-shadow: 0 0 0 .2rem rgba(130, 138, 145, .5) +} + +.btn-secondary.disabled, +.btn-secondary:disabled { + color: #fff; + background-color: #6c757d; + border-color: #6c757d +} + +.btn-secondary:not(:disabled):not(.disabled).active, +.btn-secondary:not(:disabled):not(.disabled):active, +.show>.btn-secondary.dropdown-toggle { + color: #fff; + background-color: #545b62; + border-color: #4e555b +} + +.btn-secondary:not(:disabled):not(.disabled).active:focus, +.btn-secondary:not(:disabled):not(.disabled):active:focus, +.show>.btn-secondary.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(130, 138, 145, .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 { + color: #fff; + background-color: #218838; + border-color: #1e7e34; + box-shadow: 0 0 0 .2rem rgba(72, 180, 97, .5) +} + +.btn-success.disabled, +.btn-success:disabled { + color: #fff; + 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 +} + +.btn-success:not(:disabled):not(.disabled).active:focus, +.btn-success:not(:disabled):not(.disabled):active:focus, +.show>.btn-success.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(72, 180, 97, .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 { + color: #fff; + background-color: #138496; + border-color: #117a8b; + box-shadow: 0 0 0 .2rem rgba(58, 176, 195, .5) +} + +.btn-info.disabled, +.btn-info:disabled { + color: #fff; + 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 +} + +.btn-info:not(:disabled):not(.disabled).active:focus, +.btn-info:not(:disabled):not(.disabled):active:focus, +.show>.btn-info.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(58, 176, 195, .5) +} + +.btn-warning { + color: #212529; + background-color: #ffc107; + border-color: #ffc107 +} + +.btn-warning:hover { + color: #212529; + background-color: #e0a800; + border-color: #d39e00 +} + +.btn-warning.focus, +.btn-warning:focus { + color: #212529; + background-color: #e0a800; + border-color: #d39e00; + box-shadow: 0 0 0 .2rem rgba(222, 170, 12, .5) +} + +.btn-warning.disabled, +.btn-warning:disabled { + color: #212529; + 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: #212529; + background-color: #d39e00; + border-color: #c69500 +} + +.btn-warning:not(:disabled):not(.disabled).active:focus, +.btn-warning:not(:disabled):not(.disabled):active:focus, +.show>.btn-warning.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(222, 170, 12, .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 { + color: #fff; + background-color: #c82333; + border-color: #bd2130; + box-shadow: 0 0 0 .2rem rgba(225, 83, 97, .5) +} + +.btn-danger.disabled, +.btn-danger:disabled { + color: #fff; + 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 +} + +.btn-danger:not(:disabled):not(.disabled).active:focus, +.btn-danger:not(:disabled):not(.disabled):active:focus, +.show>.btn-danger.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(225, 83, 97, .5) +} + +.btn-light { + color: #212529; + background-color: #f8f9fa; + border-color: #f8f9fa +} + +.btn-light:hover { + color: #212529; + background-color: #e2e6ea; + border-color: #dae0e5 +} + +.btn-light.focus, +.btn-light:focus { + color: #212529; + background-color: #e2e6ea; + border-color: #dae0e5; + box-shadow: 0 0 0 .2rem rgba(216, 217, 219, .5) +} + +.btn-light.disabled, +.btn-light:disabled { + color: #212529; + 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: #212529; + background-color: #dae0e5; + border-color: #d3d9df +} + +.btn-light:not(:disabled):not(.disabled).active:focus, +.btn-light:not(:disabled):not(.disabled):active:focus, +.show>.btn-light.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(216, 217, 219, .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 { + color: #fff; + background-color: #23272b; + border-color: #1d2124; + box-shadow: 0 0 0 .2rem rgba(82, 88, 93, .5) +} + +.btn-dark.disabled, +.btn-dark:disabled { + color: #fff; + 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 +} + +.btn-dark:not(:disabled):not(.disabled).active:focus, +.btn-dark:not(:disabled):not(.disabled):active:focus, +.show>.btn-dark.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(82, 88, 93, .5) +} + +.btn-outline-primary { + color: #007bff; + 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 +} + +.btn-outline-primary:not(:disabled):not(.disabled).active:focus, +.btn-outline-primary:not(:disabled):not(.disabled):active:focus, +.show>.btn-outline-primary.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .5) +} + +.btn-outline-secondary { + color: #6c757d; + border-color: #6c757d +} + +.btn-outline-secondary:hover { + color: #fff; + background-color: #6c757d; + border-color: #6c757d +} + +.btn-outline-secondary.focus, +.btn-outline-secondary:focus { + box-shadow: 0 0 0 .2rem rgba(108, 117, 125, .5) +} + +.btn-outline-secondary.disabled, +.btn-outline-secondary:disabled { + color: #6c757d; + 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: #6c757d; + border-color: #6c757d +} + +.btn-outline-secondary:not(:disabled):not(.disabled).active:focus, +.btn-outline-secondary:not(:disabled):not(.disabled):active:focus, +.show>.btn-outline-secondary.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(108, 117, 125, .5) +} + +.btn-outline-success { + color: #28a745; + 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 +} + +.btn-outline-success:not(:disabled):not(.disabled).active:focus, +.btn-outline-success:not(:disabled):not(.disabled):active:focus, +.show>.btn-outline-success.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(40, 167, 69, .5) +} + +.btn-outline-info { + color: #17a2b8; + 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 +} + +.btn-outline-info:not(:disabled):not(.disabled).active:focus, +.btn-outline-info:not(:disabled):not(.disabled):active:focus, +.show>.btn-outline-info.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(23, 162, 184, .5) +} + +.btn-outline-warning { + color: #ffc107; + border-color: #ffc107 +} + +.btn-outline-warning:hover { + color: #212529; + 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: #212529; + background-color: #ffc107; + border-color: #ffc107 +} + +.btn-outline-warning:not(:disabled):not(.disabled).active:focus, +.btn-outline-warning:not(:disabled):not(.disabled):active:focus, +.show>.btn-outline-warning.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(255, 193, 7, .5) +} + +.btn-outline-danger { + color: #dc3545; + 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 +} + +.btn-outline-danger:not(:disabled):not(.disabled).active:focus, +.btn-outline-danger:not(:disabled):not(.disabled):active:focus, +.show>.btn-outline-danger.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .5) +} + +.btn-outline-light { + color: #f8f9fa; + 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 +} + +.btn-outline-light:not(:disabled):not(.disabled).active:focus, +.btn-outline-light:not(:disabled):not(.disabled):active:focus, +.show>.btn-outline-light.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(248, 249, 250, .5) +} + +.btn-outline-dark { + color: #343a40; + 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 +} + +.btn-outline-dark:not(:disabled):not(.disabled).active:focus, +.btn-outline-dark:not(:disabled):not(.disabled):active:focus, +.show>.btn-outline-dark.dropdown-toggle:focus { + box-shadow: 0 0 0 .2rem rgba(52, 58, 64, .5) +} + +.btn-link { + font-weight: 400; + color: #007bff; + text-decoration: none +} + +.btn-link:hover { + color: #0056b3; + text-decoration: underline +} + +.btn-link.focus, +.btn-link:focus { + text-decoration: underline; + box-shadow: none +} + +.btn-link.disabled, +.btn-link:disabled { + color: #6c757d; + pointer-events: none +} + +.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 { + transition: opacity .15s linear +} + +@media (prefers-reduced-motion:reduce) { + .fade { + transition: none + } +} + +.fade:not(.show) { + opacity: 0 +} + +.collapse:not(.show) { + display: none +} + +.collapsing { + position: relative; + height: 0; + overflow: hidden; + transition: height .35s ease +} + +@media (prefers-reduced-motion:reduce) { + .collapsing { + transition: none + } +} + +.dropdown, +.dropleft, +.dropright, +.dropup { + position: relative +} + +.dropdown-toggle { + white-space: nowrap +} + +.dropdown-toggle::after { + display: inline-block; + 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 +} + +.dropdown-menu-left { + right: auto; + left: 0 +} + +.dropdown-menu-right { + right: 0; + left: auto +} + +@media (min-width:576px) { + .dropdown-menu-sm-left { + right: auto; + left: 0 + } + + .dropdown-menu-sm-right { + right: 0; + left: auto + } +} + +@media (min-width:768px) { + .dropdown-menu-md-left { + right: auto; + left: 0 + } + + .dropdown-menu-md-right { + right: 0; + left: auto + } +} + +@media (min-width:992px) { + .dropdown-menu-lg-left { + right: auto; + left: 0 + } + + .dropdown-menu-lg-right { + right: 0; + left: auto + } +} + +@media (min-width:1200px) { + .dropdown-menu-xl-left { + right: auto; + left: 0 + } + + .dropdown-menu-xl-right { + right: 0; + left: auto + } +} + +.dropup .dropdown-menu { + top: auto; + bottom: 100%; + margin-top: 0; + margin-bottom: .125rem +} + +.dropup .dropdown-toggle::after { + display: inline-block; + 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 +} + +.dropright .dropdown-menu { + top: 0; + right: auto; + left: 100%; + margin-top: 0; + margin-left: .125rem +} + +.dropright .dropdown-toggle::after { + display: inline-block; + margin-left: .255em; + vertical-align: .255em; + content: ""; + border-top: .3em solid transparent; + border-right: 0; + border-bottom: .3em solid transparent; + border-left: .3em solid +} + +.dropright .dropdown-toggle:empty::after { + margin-left: 0 +} + +.dropright .dropdown-toggle::after { + vertical-align: 0 +} + +.dropleft .dropdown-menu { + top: 0; + right: 100%; + left: auto; + margin-top: 0; + margin-right: .125rem +} + +.dropleft .dropdown-toggle::after { + display: inline-block; + margin-left: .255em; + vertical-align: .255em; + content: "" +} + +.dropleft .dropdown-toggle::after { + display: none +} + +.dropleft .dropdown-toggle::before { + display: inline-block; + margin-right: .255em; + vertical-align: .255em; + content: ""; + border-top: .3em solid transparent; + border-right: .3em solid; + border-bottom: .3em solid transparent +} + +.dropleft .dropdown-toggle:empty::after { + margin-left: 0 +} + +.dropleft .dropdown-toggle::before { + vertical-align: 0 +} + +.dropdown-menu[x-placement^=bottom], +.dropdown-menu[x-placement^=left], +.dropdown-menu[x-placement^=right], +.dropdown-menu[x-placement^=top] { + right: auto; + bottom: auto +} + +.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-color: transparent; + 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: #6c757d; + pointer-events: none; + background-color: transparent +} + +.dropdown-menu.show { + display: block +} + +.dropdown-header { + display: block; + padding: .5rem 1.5rem; + margin-bottom: 0; + font-size: .875rem; + color: #6c757d; + white-space: nowrap +} + +.dropdown-item-text { + display: block; + padding: .25rem 1.5rem; + color: #212529 +} + +.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: 1 1 auto; + flex: 1 1 auto +} + +.btn-group-vertical>.btn:hover, +.btn-group>.btn:hover { + z-index: 1 +} + +.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: 1 +} + +.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-group:not(:first-child), +.btn-group>.btn:not(:first-child) { + margin-left: -1px +} + +.btn-group>.btn-group:not(:last-child)>.btn, +.btn-group>.btn:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0 +} + +.btn-group>.btn-group:not(:first-child)>.btn, +.btn-group>.btn:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0 +} + +.dropdown-toggle-split { + padding-right: .5625rem; + padding-left: .5625rem +} + +.dropdown-toggle-split::after, +.dropright .dropdown-toggle-split::after, +.dropup .dropdown-toggle-split::after { + margin-left: 0 +} + +.dropleft .dropdown-toggle-split::before { + margin-right: 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-group:not(:first-child), +.btn-group-vertical>.btn:not(:first-child) { + margin-top: -1px +} + +.btn-group-vertical>.btn-group:not(:last-child)>.btn, +.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle) { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0 +} + +.btn-group-vertical>.btn-group:not(:first-child)>.btn, +.btn-group-vertical>.btn:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0 +} + +.btn-group-toggle>.btn, +.btn-group-toggle>.btn-group>.btn { + margin-bottom: 0 +} + +.btn-group-toggle>.btn input[type=checkbox], +.btn-group-toggle>.btn input[type=radio], +.btn-group-toggle>.btn-group>.btn input[type=checkbox], +.btn-group-toggle>.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-wrap: wrap; + flex-wrap: wrap; + -ms-flex-align: stretch; + align-items: stretch; + width: 100% +} + +.input-group>.custom-file, +.input-group>.custom-select, +.input-group>.form-control, +.input-group>.form-control-plaintext { + position: relative; + -ms-flex: 1 1 0%; + flex: 1 1 0%; + min-width: 0; + margin-bottom: 0 +} + +.input-group>.custom-file+.custom-file, +.input-group>.custom-file+.custom-select, +.input-group>.custom-file+.form-control, +.input-group>.custom-select+.custom-file, +.input-group>.custom-select+.custom-select, +.input-group>.custom-select+.form-control, +.input-group>.form-control+.custom-file, +.input-group>.form-control+.custom-select, +.input-group>.form-control+.form-control, +.input-group>.form-control-plaintext+.custom-file, +.input-group>.form-control-plaintext+.custom-select, +.input-group>.form-control-plaintext+.form-control { + margin-left: -1px +} + +.input-group>.custom-file .custom-file-input:focus~.custom-file-label, +.input-group>.custom-select:focus, +.input-group>.form-control:focus { + z-index: 3 +} + +.input-group>.custom-file .custom-file-input:focus { + z-index: 4 +} + +.input-group>.custom-select:not(:last-child), +.input-group>.form-control:not(:last-child) { + border-top-right-radius: 0; + border-bottom-right-radius: 0 +} + +.input-group>.custom-select:not(:first-child), +.input-group>.form-control:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0 +} + +.input-group>.custom-file { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center +} + +.input-group>.custom-file:not(:last-child) .custom-file-label, +.input-group>.custom-file:not(:last-child) .custom-file-label::after { + border-top-right-radius: 0; + border-bottom-right-radius: 0 +} + +.input-group>.custom-file:not(:first-child) .custom-file-label { + border-top-left-radius: 0; + border-bottom-left-radius: 0 +} + +.input-group-append, +.input-group-prepend { + display: -ms-flexbox; + display: flex +} + +.input-group-append .btn, +.input-group-prepend .btn { + position: relative; + z-index: 2 +} + +.input-group-append .btn:focus, +.input-group-prepend .btn:focus { + z-index: 3 +} + +.input-group-append .btn+.btn, +.input-group-append .btn+.input-group-text, +.input-group-append .input-group-text+.btn, +.input-group-append .input-group-text+.input-group-text, +.input-group-prepend .btn+.btn, +.input-group-prepend .btn+.input-group-text, +.input-group-prepend .input-group-text+.btn, +.input-group-prepend .input-group-text+.input-group-text { + margin-left: -1px +} + +.input-group-prepend { + margin-right: -1px +} + +.input-group-append { + margin-left: -1px +} + +.input-group-text { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + padding: .375rem .75rem; + margin-bottom: 0; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #495057; + text-align: center; + white-space: nowrap; + background-color: #e9ecef; + border: 1px solid #ced4da; + border-radius: .25rem +} + +.input-group-text input[type=checkbox], +.input-group-text input[type=radio] { + margin-top: 0 +} + +.input-group-lg>.custom-select, +.input-group-lg>.form-control:not(textarea) { + height: calc(1.5em + 1rem + 2px) +} + +.input-group-lg>.custom-select, +.input-group-lg>.form-control, +.input-group-lg>.input-group-append>.btn, +.input-group-lg>.input-group-append>.input-group-text, +.input-group-lg>.input-group-prepend>.btn, +.input-group-lg>.input-group-prepend>.input-group-text { + padding: .5rem 1rem; + font-size: 1.25rem; + line-height: 1.5; + border-radius: .3rem +} + +.input-group-sm>.custom-select, +.input-group-sm>.form-control:not(textarea) { + height: calc(1.5em + .5rem + 2px) +} + +.input-group-sm>.custom-select, +.input-group-sm>.form-control, +.input-group-sm>.input-group-append>.btn, +.input-group-sm>.input-group-append>.input-group-text, +.input-group-sm>.input-group-prepend>.btn, +.input-group-sm>.input-group-prepend>.input-group-text { + padding: .25rem .5rem; + font-size: .875rem; + line-height: 1.5; + border-radius: .2rem +} + +.input-group-lg>.custom-select, +.input-group-sm>.custom-select { + padding-right: 1.75rem +} + +.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle), +.input-group>.input-group-append:last-child>.input-group-text:not(:last-child), +.input-group>.input-group-append:not(:last-child)>.btn, +.input-group>.input-group-append:not(:last-child)>.input-group-text, +.input-group>.input-group-prepend>.btn, +.input-group>.input-group-prepend>.input-group-text { + border-top-right-radius: 0; + border-bottom-right-radius: 0 +} + +.input-group>.input-group-append>.btn, +.input-group>.input-group-append>.input-group-text, +.input-group>.input-group-prepend:first-child>.btn:not(:first-child), +.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child), +.input-group>.input-group-prepend:not(:first-child)>.btn, +.input-group>.input-group-prepend:not(:first-child)>.input-group-text { + border-top-left-radius: 0; + border-bottom-left-radius: 0 +} + +.custom-control { + position: relative; + display: block; + min-height: 1.5rem; + padding-left: 1.5rem +} + +.custom-control-inline { + display: -ms-inline-flexbox; + display: inline-flex; + margin-right: 1rem +} + +.custom-control-input { + position: absolute; + left: 0; + z-index: -1; + width: 1rem; + height: 1.25rem; + opacity: 0 +} + +.custom-control-input:checked~.custom-control-label::before { + color: #fff; + border-color: #007bff; + background-color: #007bff +} + +.custom-control-input:focus~.custom-control-label::before { + box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25) +} + +.custom-control-input:focus:not(:checked)~.custom-control-label::before { + border-color: #80bdff +} + +.custom-control-input:not(:disabled):active~.custom-control-label::before { + color: #fff; + background-color: #b3d7ff; + border-color: #b3d7ff +} + +.custom-control-input:disabled~.custom-control-label, +.custom-control-input[disabled]~.custom-control-label { + color: #6c757d +} + +.custom-control-input:disabled~.custom-control-label::before, +.custom-control-input[disabled]~.custom-control-label::before { + background-color: #e9ecef +} + +.custom-control-label { + position: relative; + margin-bottom: 0; + vertical-align: top +} + +.custom-control-label::before { + position: absolute; + top: .25rem; + left: -1.5rem; + display: block; + width: 1rem; + height: 1rem; + pointer-events: none; + content: ""; + background-color: #fff; + border: #adb5bd solid 1px +} + +.custom-control-label::after { + position: absolute; + top: .25rem; + left: -1.5rem; + display: block; + width: 1rem; + height: 1rem; + content: ""; + background: no-repeat 50%/50% 50% +} + +.custom-checkbox .custom-control-label::before { + border-radius: .25rem +} + +.custom-checkbox .custom-control-input:checked~.custom-control-label::after { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26l2.974 2.99L8 2.193z'/%3e%3c/svg%3e") +} + +.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::before { + border-color: #007bff; + background-color: #007bff +} + +.custom-checkbox .custom-control-input:indeterminate~.custom-control-label::after { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3e%3cpath stroke='%23fff' d='M0 2h4'/%3e%3c/svg%3e") +} + +.custom-checkbox .custom-control-input:disabled:checked~.custom-control-label::before { + background-color: rgba(0, 123, 255, .5) +} + +.custom-checkbox .custom-control-input:disabled:indeterminate~.custom-control-label::before { + background-color: rgba(0, 123, 255, .5) +} + +.custom-radio .custom-control-label::before { + border-radius: 50% +} + +.custom-radio .custom-control-input:checked~.custom-control-label::after { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") +} + +.custom-radio .custom-control-input:disabled:checked~.custom-control-label::before { + background-color: rgba(0, 123, 255, .5) +} + +.custom-switch { + padding-left: 2.25rem +} + +.custom-switch .custom-control-label::before { + left: -2.25rem; + width: 1.75rem; + pointer-events: all; + border-radius: .5rem +} + +.custom-switch .custom-control-label::after { + top: calc(.25rem + 2px); + left: calc(-2.25rem + 2px); + width: calc(1rem - 4px); + height: calc(1rem - 4px); + background-color: #adb5bd; + border-radius: .5rem; + transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out, -webkit-transform .15s ease-in-out; + transition: transform .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; + transition: transform .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out, -webkit-transform .15s ease-in-out +} + +@media (prefers-reduced-motion:reduce) { + .custom-switch .custom-control-label::after { + transition: none + } +} + +.custom-switch .custom-control-input:checked~.custom-control-label::after { + background-color: #fff; + -webkit-transform: translateX(.75rem); + transform: translateX(.75rem) +} + +.custom-switch .custom-control-input:disabled:checked~.custom-control-label::before { + background-color: rgba(0, 123, 255, .5) +} + +.custom-select { + display: inline-block; + width: 100%; + height: calc(1.5em + .75rem + 2px); + padding: .375rem 1.75rem .375rem .75rem; + font-size: 1rem; + font-weight: 400; + line-height: 1.5; + color: #495057; + vertical-align: middle; + background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='4' height='5' viewBox='0 0 4 5'%3e%3cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3e%3c/svg%3e") no-repeat right .75rem center/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; + box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25) +} + +.custom-select:focus::-ms-value { + color: #495057; + background-color: #fff +} + +.custom-select[multiple], +.custom-select[size]:not([size="1"]) { + height: auto; + padding-right: .75rem; + background-image: none +} + +.custom-select:disabled { + color: #6c757d; + background-color: #e9ecef +} + +.custom-select::-ms-expand { + display: none +} + +.custom-select:-moz-focusring { + color: transparent; + text-shadow: 0 0 0 #495057 +} + +.custom-select-sm { + height: calc(1.5em + .5rem + 2px); + padding-top: .25rem; + padding-bottom: .25rem; + padding-left: .5rem; + font-size: .875rem +} + +.custom-select-lg { + height: calc(1.5em + 1rem + 2px); + padding-top: .5rem; + padding-bottom: .5rem; + padding-left: 1rem; + font-size: 1.25rem +} + +.custom-file { + position: relative; + display: inline-block; + width: 100%; + height: calc(1.5em + .75rem + 2px); + margin-bottom: 0 +} + +.custom-file-input { + position: relative; + z-index: 2; + width: 100%; + height: calc(1.5em + .75rem + 2px); + margin: 0; + opacity: 0 +} + +.custom-file-input:focus~.custom-file-label { + border-color: #80bdff; + box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25) +} + +.custom-file-input:disabled~.custom-file-label, +.custom-file-input[disabled]~.custom-file-label { + background-color: #e9ecef +} + +.custom-file-input:lang(en)~.custom-file-label::after { + content: "Browse" +} + +.custom-file-input~.custom-file-label[data-browse]::after { + content: attr(data-browse) +} + +.custom-file-label { + position: absolute; + top: 0; + right: 0; + left: 0; + z-index: 1; + height: calc(1.5em + .75rem + 2px); + padding: .375rem .75rem; + font-weight: 400; + line-height: 1.5; + color: #495057; + background-color: #fff; + border: 1px solid #ced4da; + border-radius: .25rem +} + +.custom-file-label::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + z-index: 3; + display: block; + height: calc(1.5em + .75rem); + padding: .375rem .75rem; + line-height: 1.5; + color: #495057; + content: "Browse"; + background-color: #e9ecef; + border-left: inherit; + border-radius: 0 .25rem .25rem 0 +} + +.custom-range { + width: 100%; + height: 1.4rem; + padding: 0; + background-color: transparent; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none +} + +.custom-range:focus { + outline: 0 +} + +.custom-range:focus::-webkit-slider-thumb { + box-shadow: 0 0 0 1px #fff, 0 0 0 .2rem rgba(0, 123, 255, .25) +} + +.custom-range:focus::-moz-range-thumb { + box-shadow: 0 0 0 1px #fff, 0 0 0 .2rem rgba(0, 123, 255, .25) +} + +.custom-range:focus::-ms-thumb { + box-shadow: 0 0 0 1px #fff, 0 0 0 .2rem rgba(0, 123, 255, .25) +} + +.custom-range::-moz-focus-outer { + border: 0 +} + +.custom-range::-webkit-slider-thumb { + width: 1rem; + height: 1rem; + margin-top: -.25rem; + background-color: #007bff; + border: 0; + border-radius: 1rem; + -webkit-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; + transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; + -webkit-appearance: none; + appearance: none +} + +@media (prefers-reduced-motion:reduce) { + .custom-range::-webkit-slider-thumb { + -webkit-transition: none; + transition: none + } +} + +.custom-range::-webkit-slider-thumb:active { + background-color: #b3d7ff +} + +.custom-range::-webkit-slider-runnable-track { + width: 100%; + height: .5rem; + color: transparent; + cursor: pointer; + background-color: #dee2e6; + border-color: transparent; + border-radius: 1rem +} + +.custom-range::-moz-range-thumb { + width: 1rem; + height: 1rem; + background-color: #007bff; + border: 0; + border-radius: 1rem; + -moz-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; + transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; + -moz-appearance: none; + appearance: none +} + +@media (prefers-reduced-motion:reduce) { + .custom-range::-moz-range-thumb { + -moz-transition: none; + transition: none + } +} + +.custom-range::-moz-range-thumb:active { + background-color: #b3d7ff +} + +.custom-range::-moz-range-track { + width: 100%; + height: .5rem; + color: transparent; + cursor: pointer; + background-color: #dee2e6; + border-color: transparent; + border-radius: 1rem +} + +.custom-range::-ms-thumb { + width: 1rem; + height: 1rem; + margin-top: 0; + margin-right: .2rem; + margin-left: .2rem; + background-color: #007bff; + border: 0; + border-radius: 1rem; + -ms-transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; + transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; + appearance: none +} + +@media (prefers-reduced-motion:reduce) { + .custom-range::-ms-thumb { + -ms-transition: none; + transition: none + } +} + +.custom-range::-ms-thumb:active { + background-color: #b3d7ff +} + +.custom-range::-ms-track { + width: 100%; + height: .5rem; + color: transparent; + cursor: pointer; + background-color: transparent; + border-color: transparent; + border-width: .5rem +} + +.custom-range::-ms-fill-lower { + background-color: #dee2e6; + border-radius: 1rem +} + +.custom-range::-ms-fill-upper { + margin-right: 15px; + background-color: #dee2e6; + border-radius: 1rem +} + +.custom-range:disabled::-webkit-slider-thumb { + background-color: #adb5bd +} + +.custom-range:disabled::-webkit-slider-runnable-track { + cursor: default +} + +.custom-range:disabled::-moz-range-thumb { + background-color: #adb5bd +} + +.custom-range:disabled::-moz-range-track { + cursor: default +} + +.custom-range:disabled::-ms-thumb { + background-color: #adb5bd +} + +.custom-control-label::before, +.custom-file-label, +.custom-select { + transition: background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out +} + +@media (prefers-reduced-motion:reduce) { + + .custom-control-label::before, + .custom-file-label, + .custom-select { + transition: none + } +} + +.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: #6c757d; + pointer-events: none; + cursor: default +} + +.nav-tabs { + border-bottom: 1px solid #dee2e6 +} + +.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 #dee2e6 +} + +.nav-tabs .nav-link.disabled { + color: #6c757d; + 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: #dee2e6 #dee2e6 #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, +.navbar .container-lg, +.navbar .container-md, +.navbar .container-sm, +.navbar .container-xl { + 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-color: transparent; + 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:575.98px) { + + .navbar-expand-sm>.container, + .navbar-expand-sm>.container-fluid, + .navbar-expand-sm>.container-lg, + .navbar-expand-sm>.container-md, + .navbar-expand-sm>.container-sm, + .navbar-expand-sm>.container-xl { + 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 .nav-link { + padding-right: .5rem; + padding-left: .5rem + } + + .navbar-expand-sm>.container, + .navbar-expand-sm>.container-fluid, + .navbar-expand-sm>.container-lg, + .navbar-expand-sm>.container-md, + .navbar-expand-sm>.container-sm, + .navbar-expand-sm>.container-xl { + -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 + } +} + +@media (max-width:767.98px) { + + .navbar-expand-md>.container, + .navbar-expand-md>.container-fluid, + .navbar-expand-md>.container-lg, + .navbar-expand-md>.container-md, + .navbar-expand-md>.container-sm, + .navbar-expand-md>.container-xl { + 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 .nav-link { + padding-right: .5rem; + padding-left: .5rem + } + + .navbar-expand-md>.container, + .navbar-expand-md>.container-fluid, + .navbar-expand-md>.container-lg, + .navbar-expand-md>.container-md, + .navbar-expand-md>.container-sm, + .navbar-expand-md>.container-xl { + -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 + } +} + +@media (max-width:991.98px) { + + .navbar-expand-lg>.container, + .navbar-expand-lg>.container-fluid, + .navbar-expand-lg>.container-lg, + .navbar-expand-lg>.container-md, + .navbar-expand-lg>.container-sm, + .navbar-expand-lg>.container-xl { + 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 .nav-link { + padding-right: .5rem; + padding-left: .5rem + } + + .navbar-expand-lg>.container, + .navbar-expand-lg>.container-fluid, + .navbar-expand-lg>.container-lg, + .navbar-expand-lg>.container-md, + .navbar-expand-lg>.container-sm, + .navbar-expand-lg>.container-xl { + -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 + } +} + +@media (max-width:1199.98px) { + + .navbar-expand-xl>.container, + .navbar-expand-xl>.container-fluid, + .navbar-expand-xl>.container-lg, + .navbar-expand-xl>.container-md, + .navbar-expand-xl>.container-sm, + .navbar-expand-xl>.container-xl { + 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 .nav-link { + padding-right: .5rem; + padding-left: .5rem + } + + .navbar-expand-xl>.container, + .navbar-expand-xl>.container-fluid, + .navbar-expand-xl>.container-lg, + .navbar-expand-xl>.container-md, + .navbar-expand-xl>.container-sm, + .navbar-expand-xl>.container-xl { + -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 { + -ms-flex-flow: row nowrap; + flex-flow: row nowrap; + -ms-flex-pack: start; + justify-content: flex-start +} + +.navbar-expand>.container, +.navbar-expand>.container-fluid, +.navbar-expand>.container-lg, +.navbar-expand>.container-md, +.navbar-expand>.container-sm, +.navbar-expand>.container-xl { + 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 .nav-link { + padding-right: .5rem; + padding-left: .5rem +} + +.navbar-expand>.container, +.navbar-expand>.container-fluid, +.navbar-expand>.container-lg, +.navbar-expand>.container-md, +.navbar-expand>.container-sm, +.navbar-expand>.container-xl { + -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-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,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' 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,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' 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; + min-height: 1px; + 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, +.card-img-bottom, +.card-img-top { + -ms-flex-negative: 0; + flex-shrink: 0; + width: 100% +} + +.card-img, +.card-img-top { + border-top-left-radius: calc(.25rem - 1px); + border-top-right-radius: calc(.25rem - 1px) +} + +.card-img, +.card-img-bottom { + border-bottom-right-radius: calc(.25rem - 1px); + border-bottom-left-radius: calc(.25rem - 1px) +} + +.card-deck .card { + margin-bottom: 15px +} + +@media (min-width:576px) { + .card-deck { + display: -ms-flexbox; + display: flex; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + margin-right: -15px; + margin-left: -15px + } + + .card-deck .card { + -ms-flex: 1 0 0%; + flex: 1 0 0%; + margin-right: 15px; + margin-bottom: 0; + margin-left: 15px + } +} + +.card-group>.card { + margin-bottom: 15px +} + +@media (min-width:576px) { + .card-group { + display: -ms-flexbox; + display: flex; + -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:not(:last-child) { + border-top-right-radius: 0; + border-bottom-right-radius: 0 + } + + .card-group>.card:not(:last-child) .card-header, + .card-group>.card:not(:last-child) .card-img-top { + border-top-right-radius: 0 + } + + .card-group>.card:not(:last-child) .card-footer, + .card-group>.card:not(:last-child) .card-img-bottom { + border-bottom-right-radius: 0 + } + + .card-group>.card:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0 + } + + .card-group>.card:not(:first-child) .card-header, + .card-group>.card:not(:first-child) .card-img-top { + border-top-left-radius: 0 + } + + .card-group>.card:not(:first-child) .card-footer, + .card-group>.card:not(:first-child) .card-img-bottom { + border-bottom-left-radius: 0 + } +} + +.card-columns .card { + margin-bottom: .75rem +} + +@media (min-width:576px) { + .card-columns { + -webkit-column-count: 3; + -moz-column-count: 3; + column-count: 3; + -webkit-column-gap: 1.25rem; + -moz-column-gap: 1.25rem; + column-gap: 1.25rem; + orphans: 1; + widows: 1 + } + + .card-columns .card { + display: inline-block; + width: 100% + } +} + +.accordion>.card { + overflow: hidden +} + +.accordion>.card:not(:last-of-type) { + border-bottom: 0; + border-bottom-right-radius: 0; + border-bottom-left-radius: 0 +} + +.accordion>.card:not(:first-of-type) { + border-top-left-radius: 0; + border-top-right-radius: 0 +} + +.accordion>.card>.card-header { + border-radius: 0; + margin-bottom: -1px +} + +.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 { + padding-left: .5rem +} + +.breadcrumb-item+.breadcrumb-item::before { + display: inline-block; + padding-right: .5rem; + color: #6c757d; + content: "/" +} + +.breadcrumb-item+.breadcrumb-item:hover::before { + text-decoration: underline +} + +.breadcrumb-item+.breadcrumb-item:hover::before { + text-decoration: none +} + +.breadcrumb-item.active { + color: #6c757d +} + +.pagination { + display: -ms-flexbox; + display: flex; + padding-left: 0; + list-style: none; + border-radius: .25rem +} + +.page-link { + position: relative; + display: block; + padding: .5rem .75rem; + margin-left: -1px; + line-height: 1.25; + color: #007bff; + background-color: #fff; + border: 1px solid #dee2e6 +} + +.page-link:hover { + z-index: 2; + color: #0056b3; + text-decoration: none; + background-color: #e9ecef; + border-color: #dee2e6 +} + +.page-link:focus { + z-index: 3; + outline: 0; + box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .25) +} + +.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: 3; + color: #fff; + background-color: #007bff; + border-color: #007bff +} + +.page-item.disabled .page-link { + color: #6c757d; + pointer-events: none; + cursor: auto; + background-color: #fff; + border-color: #dee2e6 +} + +.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; + transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out +} + +@media (prefers-reduced-motion:reduce) { + .badge { + transition: none + } +} + +a.badge:focus, +a.badge:hover { + text-decoration: none +} + +.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 +} + +a.badge-primary:focus, +a.badge-primary:hover { + color: #fff; + background-color: #0062cc +} + +a.badge-primary.focus, +a.badge-primary:focus { + outline: 0; + box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .5) +} + +.badge-secondary { + color: #fff; + background-color: #6c757d +} + +a.badge-secondary:focus, +a.badge-secondary:hover { + color: #fff; + background-color: #545b62 +} + +a.badge-secondary.focus, +a.badge-secondary:focus { + outline: 0; + box-shadow: 0 0 0 .2rem rgba(108, 117, 125, .5) +} + +.badge-success { + color: #fff; + background-color: #28a745 +} + +a.badge-success:focus, +a.badge-success:hover { + color: #fff; + background-color: #1e7e34 +} + +a.badge-success.focus, +a.badge-success:focus { + outline: 0; + box-shadow: 0 0 0 .2rem rgba(40, 167, 69, .5) +} + +.badge-info { + color: #fff; + background-color: #17a2b8 +} + +a.badge-info:focus, +a.badge-info:hover { + color: #fff; + background-color: #117a8b +} + +a.badge-info.focus, +a.badge-info:focus { + outline: 0; + box-shadow: 0 0 0 .2rem rgba(23, 162, 184, .5) +} + +.badge-warning { + color: #212529; + background-color: #ffc107 +} + +a.badge-warning:focus, +a.badge-warning:hover { + color: #212529; + background-color: #d39e00 +} + +a.badge-warning.focus, +a.badge-warning:focus { + outline: 0; + box-shadow: 0 0 0 .2rem rgba(255, 193, 7, .5) +} + +.badge-danger { + color: #fff; + background-color: #dc3545 +} + +a.badge-danger:focus, +a.badge-danger:hover { + color: #fff; + background-color: #bd2130 +} + +a.badge-danger.focus, +a.badge-danger:focus { + outline: 0; + box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .5) +} + +.badge-light { + color: #212529; + background-color: #f8f9fa +} + +a.badge-light:focus, +a.badge-light:hover { + color: #212529; + background-color: #dae0e5 +} + +a.badge-light.focus, +a.badge-light:focus { + outline: 0; + box-shadow: 0 0 0 .2rem rgba(248, 249, 250, .5) +} + +.badge-dark { + color: #fff; + background-color: #343a40 +} + +a.badge-dark:focus, +a.badge-dark:hover { + color: #fff; + background-color: #1d2124 +} + +a.badge-dark.focus, +a.badge-dark:focus { + outline: 0; + box-shadow: 0 0 0 .2rem rgba(52, 58, 64, .5) +} + +.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 { + padding-right: 4rem +} + +.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: #383d41; + background-color: #e2e3e5; + border-color: #d6d8db +} + +.alert-secondary hr { + border-top-color: #c8cbcf +} + +.alert-secondary .alert-link { + color: #202326 +} + +.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-direction: column; + flex-direction: column; + -ms-flex-pack: center; + justify-content: center; + overflow: hidden; + color: #fff; + text-align: center; + white-space: nowrap; + background-color: #007bff; + transition: width .6s ease +} + +@media (prefers-reduced-motion:reduce) { + .progress-bar { + transition: none + } +} + +.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 (prefers-reduced-motion:reduce) { + .progress-bar-animated { + -webkit-animation: none; + animation: none + } +} + +.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 { + z-index: 1; + 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; + 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 { + border-bottom-right-radius: .25rem; + border-bottom-left-radius: .25rem +} + +.list-group-item.disabled, +.list-group-item:disabled { + color: #6c757d; + pointer-events: none; + background-color: #fff +} + +.list-group-item.active { + z-index: 2; + color: #fff; + background-color: #007bff; + border-color: #007bff +} + +.list-group-item+.list-group-item { + border-top-width: 0 +} + +.list-group-item+.list-group-item.active { + margin-top: -1px; + border-top-width: 1px +} + +.list-group-horizontal { + -ms-flex-direction: row; + flex-direction: row +} + +.list-group-horizontal .list-group-item:first-child { + border-bottom-left-radius: .25rem; + border-top-right-radius: 0 +} + +.list-group-horizontal .list-group-item:last-child { + border-top-right-radius: .25rem; + border-bottom-left-radius: 0 +} + +.list-group-horizontal .list-group-item.active { + margin-top: 0 +} + +.list-group-horizontal .list-group-item+.list-group-item { + border-top-width: 1px; + border-left-width: 0 +} + +.list-group-horizontal .list-group-item+.list-group-item.active { + margin-left: -1px; + border-left-width: 1px +} + +@media (min-width:576px) { + .list-group-horizontal-sm { + -ms-flex-direction: row; + flex-direction: row + } + + .list-group-horizontal-sm .list-group-item:first-child { + border-bottom-left-radius: .25rem; + border-top-right-radius: 0 + } + + .list-group-horizontal-sm .list-group-item:last-child { + border-top-right-radius: .25rem; + border-bottom-left-radius: 0 + } + + .list-group-horizontal-sm .list-group-item.active { + margin-top: 0 + } + + .list-group-horizontal-sm .list-group-item+.list-group-item { + border-top-width: 1px; + border-left-width: 0 + } + + .list-group-horizontal-sm .list-group-item+.list-group-item.active { + margin-left: -1px; + border-left-width: 1px + } +} + +@media (min-width:768px) { + .list-group-horizontal-md { + -ms-flex-direction: row; + flex-direction: row + } + + .list-group-horizontal-md .list-group-item:first-child { + border-bottom-left-radius: .25rem; + border-top-right-radius: 0 + } + + .list-group-horizontal-md .list-group-item:last-child { + border-top-right-radius: .25rem; + border-bottom-left-radius: 0 + } + + .list-group-horizontal-md .list-group-item.active { + margin-top: 0 + } + + .list-group-horizontal-md .list-group-item+.list-group-item { + border-top-width: 1px; + border-left-width: 0 + } + + .list-group-horizontal-md .list-group-item+.list-group-item.active { + margin-left: -1px; + border-left-width: 1px + } +} + +@media (min-width:992px) { + .list-group-horizontal-lg { + -ms-flex-direction: row; + flex-direction: row + } + + .list-group-horizontal-lg .list-group-item:first-child { + border-bottom-left-radius: .25rem; + border-top-right-radius: 0 + } + + .list-group-horizontal-lg .list-group-item:last-child { + border-top-right-radius: .25rem; + border-bottom-left-radius: 0 + } + + .list-group-horizontal-lg .list-group-item.active { + margin-top: 0 + } + + .list-group-horizontal-lg .list-group-item+.list-group-item { + border-top-width: 1px; + border-left-width: 0 + } + + .list-group-horizontal-lg .list-group-item+.list-group-item.active { + margin-left: -1px; + border-left-width: 1px + } +} + +@media (min-width:1200px) { + .list-group-horizontal-xl { + -ms-flex-direction: row; + flex-direction: row + } + + .list-group-horizontal-xl .list-group-item:first-child { + border-bottom-left-radius: .25rem; + border-top-right-radius: 0 + } + + .list-group-horizontal-xl .list-group-item:last-child { + border-top-right-radius: .25rem; + border-bottom-left-radius: 0 + } + + .list-group-horizontal-xl .list-group-item.active { + margin-top: 0 + } + + .list-group-horizontal-xl .list-group-item+.list-group-item { + border-top-width: 1px; + border-left-width: 0 + } + + .list-group-horizontal-xl .list-group-item+.list-group-item.active { + margin-left: -1px; + border-left-width: 1px + } +} + +.list-group-flush .list-group-item { + border-right-width: 0; + border-left-width: 0; + border-radius: 0 +} + +.list-group-flush .list-group-item:first-child { + border-top-width: 0 +} + +.list-group-flush:last-child .list-group-item:last-child { + border-bottom-width: 0 +} + +.list-group-item-primary { + color: #004085; + background-color: #b8daff +} + +.list-group-item-primary.list-group-item-action:focus, +.list-group-item-primary.list-group-item-action:hover { + color: #004085; + background-color: #9fcdff +} + +.list-group-item-primary.list-group-item-action.active { + color: #fff; + background-color: #004085; + border-color: #004085 +} + +.list-group-item-secondary { + color: #383d41; + background-color: #d6d8db +} + +.list-group-item-secondary.list-group-item-action:focus, +.list-group-item-secondary.list-group-item-action:hover { + color: #383d41; + background-color: #c8cbcf +} + +.list-group-item-secondary.list-group-item-action.active { + color: #fff; + background-color: #383d41; + border-color: #383d41 +} + +.list-group-item-success { + color: #155724; + background-color: #c3e6cb +} + +.list-group-item-success.list-group-item-action:focus, +.list-group-item-success.list-group-item-action:hover { + color: #155724; + background-color: #b1dfbb +} + +.list-group-item-success.list-group-item-action.active { + color: #fff; + background-color: #155724; + border-color: #155724 +} + +.list-group-item-info { + color: #0c5460; + background-color: #bee5eb +} + +.list-group-item-info.list-group-item-action:focus, +.list-group-item-info.list-group-item-action:hover { + color: #0c5460; + background-color: #abdde5 +} + +.list-group-item-info.list-group-item-action.active { + color: #fff; + background-color: #0c5460; + border-color: #0c5460 +} + +.list-group-item-warning { + color: #856404; + background-color: #ffeeba +} + +.list-group-item-warning.list-group-item-action:focus, +.list-group-item-warning.list-group-item-action:hover { + color: #856404; + background-color: #ffe8a1 +} + +.list-group-item-warning.list-group-item-action.active { + color: #fff; + background-color: #856404; + border-color: #856404 +} + +.list-group-item-danger { + color: #721c24; + background-color: #f5c6cb +} + +.list-group-item-danger.list-group-item-action:focus, +.list-group-item-danger.list-group-item-action:hover { + color: #721c24; + background-color: #f1b0b7 +} + +.list-group-item-danger.list-group-item-action.active { + color: #fff; + background-color: #721c24; + border-color: #721c24 +} + +.list-group-item-light { + color: #818182; + background-color: #fdfdfe +} + +.list-group-item-light.list-group-item-action:focus, +.list-group-item-light.list-group-item-action:hover { + color: #818182; + background-color: #ececf6 +} + +.list-group-item-light.list-group-item-action.active { + color: #fff; + background-color: #818182; + border-color: #818182 +} + +.list-group-item-dark { + color: #1b1e21; + background-color: #c6c8ca +} + +.list-group-item-dark.list-group-item-action:focus, +.list-group-item-dark.list-group-item-action:hover { + color: #1b1e21; + background-color: #b9bbbe +} + +.list-group-item-dark.list-group-item-action.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:hover { + color: #000; + text-decoration: none +} + +.close:not(:disabled):not(.disabled):focus, +.close:not(:disabled):not(.disabled):hover { + opacity: .75 +} + +button.close { + padding: 0; + background-color: transparent; + border: 0; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none +} + +a.close.disabled { + pointer-events: none +} + +.toast { + max-width: 350px; + overflow: hidden; + font-size: .875rem; + background-color: rgba(255, 255, 255, .85); + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .1); + -webkit-backdrop-filter: blur(10px); + backdrop-filter: blur(10px); + opacity: 0; + border-radius: .25rem +} + +.toast:not(:last-child) { + margin-bottom: .75rem +} + +.toast.showing { + opacity: 1 +} + +.toast.show { + display: block; + opacity: 1 +} + +.toast.hide { + display: none +} + +.toast-header { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + padding: .25rem .75rem; + color: #6c757d; + background-color: rgba(255, 255, 255, .85); + background-clip: padding-box; + border-bottom: 1px solid rgba(0, 0, 0, .05) +} + +.toast-body { + padding: .75rem +} + +.modal-open { + overflow: hidden +} + +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto +} + +.modal { + position: fixed; + top: 0; + left: 0; + z-index: 1050; + display: none; + width: 100%; + height: 100%; + overflow: hidden; + outline: 0 +} + +.modal-dialog { + position: relative; + width: auto; + margin: .5rem; + pointer-events: none +} + +.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, -50px); + transform: translate(0, -50px) +} + +@media (prefers-reduced-motion:reduce) { + .modal.fade .modal-dialog { + transition: none + } +} + +.modal.show .modal-dialog { + -webkit-transform: none; + transform: none +} + +.modal.modal-static .modal-dialog { + -webkit-transform: scale(1.02); + transform: scale(1.02) +} + +.modal-dialog-scrollable { + display: -ms-flexbox; + display: flex; + max-height: calc(100% - 1rem) +} + +.modal-dialog-scrollable .modal-content { + max-height: calc(100vh - 1rem); + overflow: hidden +} + +.modal-dialog-scrollable .modal-footer, +.modal-dialog-scrollable .modal-header { + -ms-flex-negative: 0; + flex-shrink: 0 +} + +.modal-dialog-scrollable .modal-body { + overflow-y: auto +} + +.modal-dialog-centered { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + min-height: calc(100% - 1rem) +} + +.modal-dialog-centered::before { + display: block; + height: calc(100vh - 1rem); + content: "" +} + +.modal-dialog-centered.modal-dialog-scrollable { + -ms-flex-direction: column; + flex-direction: column; + -ms-flex-pack: center; + justify-content: center; + height: 100% +} + +.modal-dialog-centered.modal-dialog-scrollable .modal-content { + max-height: none +} + +.modal-dialog-centered.modal-dialog-scrollable::before { + content: none +} + +.modal-content { + position: relative; + display: -ms-flexbox; + display: flex; + -ms-flex-direction: column; + flex-direction: column; + width: 100%; + 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; + left: 0; + z-index: 1040; + width: 100vw; + height: 100vh; + 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: 1rem 1rem; + border-bottom: 1px solid #dee2e6; + border-top-left-radius: calc(.3rem - 1px); + border-top-right-radius: calc(.3rem - 1px) +} + +.modal-header .close { + padding: 1rem 1rem; + margin: -1rem -1rem -1rem auto +} + +.modal-title { + margin-bottom: 0; + line-height: 1.5 +} + +.modal-body { + position: relative; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + padding: 1rem +} + +.modal-footer { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: end; + justify-content: flex-end; + padding: .75rem; + border-top: 1px solid #dee2e6; + border-bottom-right-radius: calc(.3rem - 1px); + border-bottom-left-radius: calc(.3rem - 1px) +} + +.modal-footer>* { + margin: .25rem +} + +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll +} + +@media (min-width:576px) { + .modal-dialog { + max-width: 500px; + margin: 1.75rem auto + } + + .modal-dialog-scrollable { + max-height: calc(100% - 3.5rem) + } + + .modal-dialog-scrollable .modal-content { + max-height: calc(100vh - 3.5rem) + } + + .modal-dialog-centered { + min-height: calc(100% - 3.5rem) + } + + .modal-dialog-centered::before { + height: calc(100vh - 3.5rem) + } + + .modal-sm { + max-width: 300px + } +} + +@media (min-width:992px) { + + .modal-lg, + .modal-xl { + max-width: 800px + } +} + +@media (min-width:1200px) { + .modal-xl { + max-width: 1140px + } +} + +.tooltip { + position: absolute; + z-index: 1070; + display: block; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-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: .8rem; + height: .4rem +} + +.tooltip .arrow::before { + position: absolute; + content: ""; + border-color: transparent; + border-style: solid +} + +.bs-tooltip-auto[x-placement^=top], +.bs-tooltip-top { + padding: .4rem 0 +} + +.bs-tooltip-auto[x-placement^=top] .arrow, +.bs-tooltip-top .arrow { + bottom: 0 +} + +.bs-tooltip-auto[x-placement^=top] .arrow::before, +.bs-tooltip-top .arrow::before { + top: 0; + border-width: .4rem .4rem 0; + border-top-color: #000 +} + +.bs-tooltip-auto[x-placement^=right], +.bs-tooltip-right { + padding: 0 .4rem +} + +.bs-tooltip-auto[x-placement^=right] .arrow, +.bs-tooltip-right .arrow { + left: 0; + width: .4rem; + height: .8rem +} + +.bs-tooltip-auto[x-placement^=right] .arrow::before, +.bs-tooltip-right .arrow::before { + right: 0; + border-width: .4rem .4rem .4rem 0; + border-right-color: #000 +} + +.bs-tooltip-auto[x-placement^=bottom], +.bs-tooltip-bottom { + padding: .4rem 0 +} + +.bs-tooltip-auto[x-placement^=bottom] .arrow, +.bs-tooltip-bottom .arrow { + top: 0 +} + +.bs-tooltip-auto[x-placement^=bottom] .arrow::before, +.bs-tooltip-bottom .arrow::before { + bottom: 0; + border-width: 0 .4rem .4rem; + border-bottom-color: #000 +} + +.bs-tooltip-auto[x-placement^=left], +.bs-tooltip-left { + padding: 0 .4rem +} + +.bs-tooltip-auto[x-placement^=left] .arrow, +.bs-tooltip-left .arrow { + right: 0; + width: .4rem; + height: .8rem +} + +.bs-tooltip-auto[x-placement^=left] .arrow::before, +.bs-tooltip-left .arrow::before { + left: 0; + border-width: .4rem 0 .4rem .4rem; + border-left-color: #000 +} + +.tooltip-inner { + max-width: 200px; + padding: .25rem .5rem; + 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, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + 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: 1rem; + height: .5rem; + margin: 0 .3rem +} + +.popover .arrow::after, +.popover .arrow::before { + position: absolute; + display: block; + content: ""; + border-color: transparent; + border-style: solid +} + +.bs-popover-auto[x-placement^=top], +.bs-popover-top { + margin-bottom: .5rem +} + +.bs-popover-auto[x-placement^=top]>.arrow, +.bs-popover-top>.arrow { + bottom: calc(-.5rem - 1px) +} + +.bs-popover-auto[x-placement^=top]>.arrow::before, +.bs-popover-top>.arrow::before { + bottom: 0; + border-width: .5rem .5rem 0; + border-top-color: rgba(0, 0, 0, .25) +} + +.bs-popover-auto[x-placement^=top]>.arrow::after, +.bs-popover-top>.arrow::after { + bottom: 1px; + border-width: .5rem .5rem 0; + border-top-color: #fff +} + +.bs-popover-auto[x-placement^=right], +.bs-popover-right { + margin-left: .5rem +} + +.bs-popover-auto[x-placement^=right]>.arrow, +.bs-popover-right>.arrow { + left: calc(-.5rem - 1px); + width: .5rem; + height: 1rem; + margin: .3rem 0 +} + +.bs-popover-auto[x-placement^=right]>.arrow::before, +.bs-popover-right>.arrow::before { + left: 0; + border-width: .5rem .5rem .5rem 0; + border-right-color: rgba(0, 0, 0, .25) +} + +.bs-popover-auto[x-placement^=right]>.arrow::after, +.bs-popover-right>.arrow::after { + left: 1px; + border-width: .5rem .5rem .5rem 0; + border-right-color: #fff +} + +.bs-popover-auto[x-placement^=bottom], +.bs-popover-bottom { + margin-top: .5rem +} + +.bs-popover-auto[x-placement^=bottom]>.arrow, +.bs-popover-bottom>.arrow { + top: calc(-.5rem - 1px) +} + +.bs-popover-auto[x-placement^=bottom]>.arrow::before, +.bs-popover-bottom>.arrow::before { + top: 0; + border-width: 0 .5rem .5rem .5rem; + border-bottom-color: rgba(0, 0, 0, .25) +} + +.bs-popover-auto[x-placement^=bottom]>.arrow::after, +.bs-popover-bottom>.arrow::after { + top: 1px; + border-width: 0 .5rem .5rem .5rem; + border-bottom-color: #fff +} + +.bs-popover-auto[x-placement^=bottom] .popover-header::before, +.bs-popover-bottom .popover-header::before { + position: absolute; + top: 0; + left: 50%; + display: block; + width: 1rem; + margin-left: -.5rem; + content: ""; + border-bottom: 1px solid #f7f7f7 +} + +.bs-popover-auto[x-placement^=left], +.bs-popover-left { + margin-right: .5rem +} + +.bs-popover-auto[x-placement^=left]>.arrow, +.bs-popover-left>.arrow { + right: calc(-.5rem - 1px); + width: .5rem; + height: 1rem; + margin: .3rem 0 +} + +.bs-popover-auto[x-placement^=left]>.arrow::before, +.bs-popover-left>.arrow::before { + right: 0; + border-width: .5rem 0 .5rem .5rem; + border-left-color: rgba(0, 0, 0, .25) +} + +.bs-popover-auto[x-placement^=left]>.arrow::after, +.bs-popover-left>.arrow::after { + right: 1px; + border-width: .5rem 0 .5rem .5rem; + border-left-color: #fff +} + +.popover-header { + padding: .5rem .75rem; + margin-bottom: 0; + font-size: 1rem; + 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.pointer-event { + -ms-touch-action: pan-y; + touch-action: pan-y +} + +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden +} + +.carousel-inner::after { + display: block; + clear: both; + content: "" +} + +.carousel-item { + position: relative; + display: none; + float: left; + width: 100%; + margin-right: -100%; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + transition: -webkit-transform .6s ease-in-out; + transition: transform .6s ease-in-out; + transition: transform .6s ease-in-out, -webkit-transform .6s ease-in-out +} + +@media (prefers-reduced-motion:reduce) { + .carousel-item { + transition: none + } +} + +.carousel-item-next, +.carousel-item-prev, +.carousel-item.active { + display: block +} + +.active.carousel-item-right, +.carousel-item-next:not(.carousel-item-left) { + -webkit-transform: translateX(100%); + transform: translateX(100%) +} + +.active.carousel-item-left, +.carousel-item-prev:not(.carousel-item-right) { + -webkit-transform: translateX(-100%); + transform: translateX(-100%) +} + +.carousel-fade .carousel-item { + opacity: 0; + transition-property: opacity; + -webkit-transform: none; + transform: none +} + +.carousel-fade .carousel-item-next.carousel-item-left, +.carousel-fade .carousel-item-prev.carousel-item-right, +.carousel-fade .carousel-item.active { + z-index: 1; + opacity: 1 +} + +.carousel-fade .active.carousel-item-left, +.carousel-fade .active.carousel-item-right { + z-index: 0; + opacity: 0; + transition: opacity 0s .6s +} + +@media (prefers-reduced-motion:reduce) { + + .carousel-fade .active.carousel-item-left, + .carousel-fade .active.carousel-item-right { + transition: none + } +} + +.carousel-control-next, +.carousel-control-prev { + position: absolute; + top: 0; + bottom: 0; + z-index: 1; + 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; + transition: opacity .15s ease +} + +@media (prefers-reduced-motion:reduce) { + + .carousel-control-next, + .carousel-control-prev { + transition: none + } +} + +.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: no-repeat 50%/100% 100% +} + +.carousel-control-prev-icon { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M5.25 0l-4 4 4 4 1.5-1.5L4.25 4l2.5-2.5L5.25 0z'/%3e%3c/svg%3e") +} + +.carousel-control-next-icon { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' width='8' height='8' viewBox='0 0 8 8'%3e%3cpath d='M2.75 0l-1.5 1.5L3.75 4l-2.5 2.5L2.75 8l4-4-4-4z'/%3e%3c/svg%3e") +} + +.carousel-indicators { + position: absolute; + right: 0; + bottom: 0; + 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 { + box-sizing: content-box; + -ms-flex: 0 1 auto; + flex: 0 1 auto; + width: 30px; + height: 3px; + margin-right: 3px; + margin-left: 3px; + text-indent: -999px; + cursor: pointer; + background-color: #fff; + background-clip: padding-box; + border-top: 10px solid transparent; + border-bottom: 10px solid transparent; + opacity: .5; + transition: opacity .6s ease +} + +@media (prefers-reduced-motion:reduce) { + .carousel-indicators li { + transition: none + } +} + +.carousel-indicators .active { + opacity: 1 +} + +.carousel-caption { + position: absolute; + right: 15%; + bottom: 20px; + left: 15%; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #fff; + text-align: center +} + +@-webkit-keyframes spinner-border { + to { + -webkit-transform: rotate(360deg); + transform: rotate(360deg) + } +} + +@keyframes spinner-border { + to { + -webkit-transform: rotate(360deg); + transform: rotate(360deg) + } +} + +.spinner-border { + display: inline-block; + width: 2rem; + height: 2rem; + vertical-align: text-bottom; + border: .25em solid currentColor; + border-right-color: transparent; + border-radius: 50%; + -webkit-animation: spinner-border .75s linear infinite; + animation: spinner-border .75s linear infinite +} + +.spinner-border-sm { + width: 1rem; + height: 1rem; + border-width: .2em +} + +@-webkit-keyframes spinner-grow { + 0% { + -webkit-transform: scale(0); + transform: scale(0) + } + + 50% { + opacity: 1 + } +} + +@keyframes spinner-grow { + 0% { + -webkit-transform: scale(0); + transform: scale(0) + } + + 50% { + opacity: 1 + } +} + +.spinner-grow { + display: inline-block; + width: 2rem; + height: 2rem; + vertical-align: text-bottom; + background-color: currentColor; + border-radius: 50%; + opacity: 0; + -webkit-animation: spinner-grow .75s linear infinite; + animation: spinner-grow .75s linear infinite +} + +.spinner-grow-sm { + width: 1rem; + height: 1rem +} + +.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, +button.bg-primary:focus, +button.bg-primary:hover { + background-color: #0062cc !important +} + +.bg-secondary { + background-color: #6c757d !important +} + +a.bg-secondary:focus, +a.bg-secondary:hover, +button.bg-secondary:focus, +button.bg-secondary:hover { + background-color: #545b62 !important +} + +.bg-success { + background-color: #28a745 !important +} + +a.bg-success:focus, +a.bg-success:hover, +button.bg-success:focus, +button.bg-success:hover { + background-color: #1e7e34 !important +} + +.bg-info { + background-color: #17a2b8 !important +} + +a.bg-info:focus, +a.bg-info:hover, +button.bg-info:focus, +button.bg-info:hover { + background-color: #117a8b !important +} + +.bg-warning { + background-color: #ffc107 !important +} + +a.bg-warning:focus, +a.bg-warning:hover, +button.bg-warning:focus, +button.bg-warning:hover { + background-color: #d39e00 !important +} + +.bg-danger { + background-color: #dc3545 !important +} + +a.bg-danger:focus, +a.bg-danger:hover, +button.bg-danger:focus, +button.bg-danger:hover { + background-color: #bd2130 !important +} + +.bg-light { + background-color: #f8f9fa !important +} + +a.bg-light:focus, +a.bg-light:hover, +button.bg-light:focus, +button.bg-light:hover { + background-color: #dae0e5 !important +} + +.bg-dark { + background-color: #343a40 !important +} + +a.bg-dark:focus, +a.bg-dark:hover, +button.bg-dark:focus, +button.bg-dark:hover { + background-color: #1d2124 !important +} + +.bg-white { + background-color: #fff !important +} + +.bg-transparent { + background-color: transparent !important +} + +.border { + border: 1px solid #dee2e6 !important +} + +.border-top { + border-top: 1px solid #dee2e6 !important +} + +.border-right { + border-right: 1px solid #dee2e6 !important +} + +.border-bottom { + border-bottom: 1px solid #dee2e6 !important +} + +.border-left { + border-left: 1px solid #dee2e6 !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: #6c757d !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-sm { + border-radius: .2rem !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-lg { + border-radius: .3rem !important +} + +.rounded-circle { + border-radius: 50% !important +} + +.rounded-pill { + border-radius: 50rem !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 + } +} + +@media print { + .d-print-none { + display: none !important + } + + .d-print-inline { + display: inline !important + } + + .d-print-inline-block { + display: inline-block !important + } + + .d-print-block { + display: block !important + } + + .d-print-table { + display: table !important + } + + .d-print-table-row { + display: table-row !important + } + + .d-print-table-cell { + display: table-cell !important + } + + .d-print-flex { + display: -ms-flexbox !important; + display: flex !important + } + + .d-print-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !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 +} + +.flex-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important +} + +.flex-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important +} + +.flex-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important +} + +.flex-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important +} + +.flex-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !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 + } + + .flex-sm-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important + } + + .flex-sm-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important + } + + .flex-sm-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important + } + + .flex-sm-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important + } + + .flex-sm-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !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 + } + + .flex-md-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important + } + + .flex-md-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important + } + + .flex-md-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important + } + + .flex-md-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important + } + + .flex-md-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !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 + } + + .flex-lg-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important + } + + .flex-lg-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important + } + + .flex-lg-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important + } + + .flex-lg-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important + } + + .flex-lg-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !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 + } + + .flex-xl-fill { + -ms-flex: 1 1 auto !important; + flex: 1 1 auto !important + } + + .flex-xl-grow-0 { + -ms-flex-positive: 0 !important; + flex-grow: 0 !important + } + + .flex-xl-grow-1 { + -ms-flex-positive: 1 !important; + flex-grow: 1 !important + } + + .flex-xl-shrink-0 { + -ms-flex-negative: 0 !important; + flex-shrink: 0 !important + } + + .flex-xl-shrink-1 { + -ms-flex-negative: 1 !important; + flex-shrink: 1 !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 + } +} + +.overflow-auto { + overflow: auto !important +} + +.overflow-hidden { + overflow: hidden !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; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0 +} + +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + overflow: visible; + clip: auto; + white-space: normal +} + +.shadow-sm { + box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important +} + +.shadow { + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important +} + +.shadow-lg { + box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175) !important +} + +.shadow-none { + box-shadow: none !important +} + +.w-25 { + width: 25% !important +} + +.w-50 { + width: 50% !important +} + +.w-75 { + width: 75% !important +} + +.w-100 { + width: 100% !important +} + +.w-auto { + width: auto !important +} + +.h-25 { + height: 25% !important +} + +.h-50 { + height: 50% !important +} + +.h-75 { + height: 75% !important +} + +.h-100 { + height: 100% !important +} + +.h-auto { + height: auto !important +} + +.mw-100 { + max-width: 100% !important +} + +.mh-100 { + max-height: 100% !important +} + +.min-vw-100 { + min-width: 100vw !important +} + +.min-vh-100 { + min-height: 100vh !important +} + +.vw-100 { + width: 100vw !important +} + +.vh-100 { + height: 100vh !important +} + +.stretched-link::after { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1; + pointer-events: auto; + content: ""; + background-color: rgba(0, 0, 0, 0) +} + +.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-n1 { + margin: -.25rem !important +} + +.mt-n1, +.my-n1 { + margin-top: -.25rem !important +} + +.mr-n1, +.mx-n1 { + margin-right: -.25rem !important +} + +.mb-n1, +.my-n1 { + margin-bottom: -.25rem !important +} + +.ml-n1, +.mx-n1 { + margin-left: -.25rem !important +} + +.m-n2 { + margin: -.5rem !important +} + +.mt-n2, +.my-n2 { + margin-top: -.5rem !important +} + +.mr-n2, +.mx-n2 { + margin-right: -.5rem !important +} + +.mb-n2, +.my-n2 { + margin-bottom: -.5rem !important +} + +.ml-n2, +.mx-n2 { + margin-left: -.5rem !important +} + +.m-n3 { + margin: -1rem !important +} + +.mt-n3, +.my-n3 { + margin-top: -1rem !important +} + +.mr-n3, +.mx-n3 { + margin-right: -1rem !important +} + +.mb-n3, +.my-n3 { + margin-bottom: -1rem !important +} + +.ml-n3, +.mx-n3 { + margin-left: -1rem !important +} + +.m-n4 { + margin: -1.5rem !important +} + +.mt-n4, +.my-n4 { + margin-top: -1.5rem !important +} + +.mr-n4, +.mx-n4 { + margin-right: -1.5rem !important +} + +.mb-n4, +.my-n4 { + margin-bottom: -1.5rem !important +} + +.ml-n4, +.mx-n4 { + margin-left: -1.5rem !important +} + +.m-n5 { + margin: -3rem !important +} + +.mt-n5, +.my-n5 { + margin-top: -3rem !important +} + +.mr-n5, +.mx-n5 { + margin-right: -3rem !important +} + +.mb-n5, +.my-n5 { + margin-bottom: -3rem !important +} + +.ml-n5, +.mx-n5 { + margin-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-n1 { + margin: -.25rem !important + } + + .mt-sm-n1, + .my-sm-n1 { + margin-top: -.25rem !important + } + + .mr-sm-n1, + .mx-sm-n1 { + margin-right: -.25rem !important + } + + .mb-sm-n1, + .my-sm-n1 { + margin-bottom: -.25rem !important + } + + .ml-sm-n1, + .mx-sm-n1 { + margin-left: -.25rem !important + } + + .m-sm-n2 { + margin: -.5rem !important + } + + .mt-sm-n2, + .my-sm-n2 { + margin-top: -.5rem !important + } + + .mr-sm-n2, + .mx-sm-n2 { + margin-right: -.5rem !important + } + + .mb-sm-n2, + .my-sm-n2 { + margin-bottom: -.5rem !important + } + + .ml-sm-n2, + .mx-sm-n2 { + margin-left: -.5rem !important + } + + .m-sm-n3 { + margin: -1rem !important + } + + .mt-sm-n3, + .my-sm-n3 { + margin-top: -1rem !important + } + + .mr-sm-n3, + .mx-sm-n3 { + margin-right: -1rem !important + } + + .mb-sm-n3, + .my-sm-n3 { + margin-bottom: -1rem !important + } + + .ml-sm-n3, + .mx-sm-n3 { + margin-left: -1rem !important + } + + .m-sm-n4 { + margin: -1.5rem !important + } + + .mt-sm-n4, + .my-sm-n4 { + margin-top: -1.5rem !important + } + + .mr-sm-n4, + .mx-sm-n4 { + margin-right: -1.5rem !important + } + + .mb-sm-n4, + .my-sm-n4 { + margin-bottom: -1.5rem !important + } + + .ml-sm-n4, + .mx-sm-n4 { + margin-left: -1.5rem !important + } + + .m-sm-n5 { + margin: -3rem !important + } + + .mt-sm-n5, + .my-sm-n5 { + margin-top: -3rem !important + } + + .mr-sm-n5, + .mx-sm-n5 { + margin-right: -3rem !important + } + + .mb-sm-n5, + .my-sm-n5 { + margin-bottom: -3rem !important + } + + .ml-sm-n5, + .mx-sm-n5 { + margin-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-n1 { + margin: -.25rem !important + } + + .mt-md-n1, + .my-md-n1 { + margin-top: -.25rem !important + } + + .mr-md-n1, + .mx-md-n1 { + margin-right: -.25rem !important + } + + .mb-md-n1, + .my-md-n1 { + margin-bottom: -.25rem !important + } + + .ml-md-n1, + .mx-md-n1 { + margin-left: -.25rem !important + } + + .m-md-n2 { + margin: -.5rem !important + } + + .mt-md-n2, + .my-md-n2 { + margin-top: -.5rem !important + } + + .mr-md-n2, + .mx-md-n2 { + margin-right: -.5rem !important + } + + .mb-md-n2, + .my-md-n2 { + margin-bottom: -.5rem !important + } + + .ml-md-n2, + .mx-md-n2 { + margin-left: -.5rem !important + } + + .m-md-n3 { + margin: -1rem !important + } + + .mt-md-n3, + .my-md-n3 { + margin-top: -1rem !important + } + + .mr-md-n3, + .mx-md-n3 { + margin-right: -1rem !important + } + + .mb-md-n3, + .my-md-n3 { + margin-bottom: -1rem !important + } + + .ml-md-n3, + .mx-md-n3 { + margin-left: -1rem !important + } + + .m-md-n4 { + margin: -1.5rem !important + } + + .mt-md-n4, + .my-md-n4 { + margin-top: -1.5rem !important + } + + .mr-md-n4, + .mx-md-n4 { + margin-right: -1.5rem !important + } + + .mb-md-n4, + .my-md-n4 { + margin-bottom: -1.5rem !important + } + + .ml-md-n4, + .mx-md-n4 { + margin-left: -1.5rem !important + } + + .m-md-n5 { + margin: -3rem !important + } + + .mt-md-n5, + .my-md-n5 { + margin-top: -3rem !important + } + + .mr-md-n5, + .mx-md-n5 { + margin-right: -3rem !important + } + + .mb-md-n5, + .my-md-n5 { + margin-bottom: -3rem !important + } + + .ml-md-n5, + .mx-md-n5 { + margin-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-n1 { + margin: -.25rem !important + } + + .mt-lg-n1, + .my-lg-n1 { + margin-top: -.25rem !important + } + + .mr-lg-n1, + .mx-lg-n1 { + margin-right: -.25rem !important + } + + .mb-lg-n1, + .my-lg-n1 { + margin-bottom: -.25rem !important + } + + .ml-lg-n1, + .mx-lg-n1 { + margin-left: -.25rem !important + } + + .m-lg-n2 { + margin: -.5rem !important + } + + .mt-lg-n2, + .my-lg-n2 { + margin-top: -.5rem !important + } + + .mr-lg-n2, + .mx-lg-n2 { + margin-right: -.5rem !important + } + + .mb-lg-n2, + .my-lg-n2 { + margin-bottom: -.5rem !important + } + + .ml-lg-n2, + .mx-lg-n2 { + margin-left: -.5rem !important + } + + .m-lg-n3 { + margin: -1rem !important + } + + .mt-lg-n3, + .my-lg-n3 { + margin-top: -1rem !important + } + + .mr-lg-n3, + .mx-lg-n3 { + margin-right: -1rem !important + } + + .mb-lg-n3, + .my-lg-n3 { + margin-bottom: -1rem !important + } + + .ml-lg-n3, + .mx-lg-n3 { + margin-left: -1rem !important + } + + .m-lg-n4 { + margin: -1.5rem !important + } + + .mt-lg-n4, + .my-lg-n4 { + margin-top: -1.5rem !important + } + + .mr-lg-n4, + .mx-lg-n4 { + margin-right: -1.5rem !important + } + + .mb-lg-n4, + .my-lg-n4 { + margin-bottom: -1.5rem !important + } + + .ml-lg-n4, + .mx-lg-n4 { + margin-left: -1.5rem !important + } + + .m-lg-n5 { + margin: -3rem !important + } + + .mt-lg-n5, + .my-lg-n5 { + margin-top: -3rem !important + } + + .mr-lg-n5, + .mx-lg-n5 { + margin-right: -3rem !important + } + + .mb-lg-n5, + .my-lg-n5 { + margin-bottom: -3rem !important + } + + .ml-lg-n5, + .mx-lg-n5 { + margin-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-n1 { + margin: -.25rem !important + } + + .mt-xl-n1, + .my-xl-n1 { + margin-top: -.25rem !important + } + + .mr-xl-n1, + .mx-xl-n1 { + margin-right: -.25rem !important + } + + .mb-xl-n1, + .my-xl-n1 { + margin-bottom: -.25rem !important + } + + .ml-xl-n1, + .mx-xl-n1 { + margin-left: -.25rem !important + } + + .m-xl-n2 { + margin: -.5rem !important + } + + .mt-xl-n2, + .my-xl-n2 { + margin-top: -.5rem !important + } + + .mr-xl-n2, + .mx-xl-n2 { + margin-right: -.5rem !important + } + + .mb-xl-n2, + .my-xl-n2 { + margin-bottom: -.5rem !important + } + + .ml-xl-n2, + .mx-xl-n2 { + margin-left: -.5rem !important + } + + .m-xl-n3 { + margin: -1rem !important + } + + .mt-xl-n3, + .my-xl-n3 { + margin-top: -1rem !important + } + + .mr-xl-n3, + .mx-xl-n3 { + margin-right: -1rem !important + } + + .mb-xl-n3, + .my-xl-n3 { + margin-bottom: -1rem !important + } + + .ml-xl-n3, + .mx-xl-n3 { + margin-left: -1rem !important + } + + .m-xl-n4 { + margin: -1.5rem !important + } + + .mt-xl-n4, + .my-xl-n4 { + margin-top: -1.5rem !important + } + + .mr-xl-n4, + .mx-xl-n4 { + margin-right: -1.5rem !important + } + + .mb-xl-n4, + .my-xl-n4 { + margin-bottom: -1.5rem !important + } + + .ml-xl-n4, + .mx-xl-n4 { + margin-left: -1.5rem !important + } + + .m-xl-n5 { + margin: -3rem !important + } + + .mt-xl-n5, + .my-xl-n5 { + margin-top: -3rem !important + } + + .mr-xl-n5, + .mx-xl-n5 { + margin-right: -3rem !important + } + + .mb-xl-n5, + .my-xl-n5 { + margin-bottom: -3rem !important + } + + .ml-xl-n5, + .mx-xl-n5 { + margin-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-monospace { + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important +} + +.text-justify { + text-align: justify !important +} + +.text-wrap { + white-space: normal !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-lighter { + font-weight: lighter !important +} + +.font-weight-normal { + font-weight: 400 !important +} + +.font-weight-bold { + font-weight: 700 !important +} + +.font-weight-bolder { + font-weight: bolder !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: #0056b3 !important +} + +.text-secondary { + color: #6c757d !important +} + +a.text-secondary:focus, +a.text-secondary:hover { + color: #494f54 !important +} + +.text-success { + color: #28a745 !important +} + +a.text-success:focus, +a.text-success:hover { + color: #19692c !important +} + +.text-info { + color: #17a2b8 !important +} + +a.text-info:focus, +a.text-info:hover { + color: #0f6674 !important +} + +.text-warning { + color: #ffc107 !important +} + +a.text-warning:focus, +a.text-warning:hover { + color: #ba8b00 !important +} + +.text-danger { + color: #dc3545 !important +} + +a.text-danger:focus, +a.text-danger:hover { + color: #a71d2a !important +} + +.text-light { + color: #f8f9fa !important +} + +a.text-light:focus, +a.text-light:hover { + color: #cbd3da !important +} + +.text-dark { + color: #343a40 !important +} + +a.text-dark:focus, +a.text-dark:hover { + color: #121416 !important +} + +.text-body { + color: #212529 !important +} + +.text-muted { + color: #6c757d !important +} + +.text-black-50 { + color: rgba(0, 0, 0, .5) !important +} + +.text-white-50 { + color: rgba(255, 255, 255, .5) !important +} + +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0 +} + +.text-decoration-none { + text-decoration: none !important +} + +.text-break { + word-break: break-word !important; + overflow-wrap: break-word !important +} + +.text-reset { + color: inherit !important +} + +.visible { + visibility: visible !important +} + +.invisible { + visibility: hidden !important +} + +@media print { + + *, + ::after, + ::before { + text-shadow: none !important; + box-shadow: none !important + } + + a:not(.btn) { + text-decoration: underline + } + + abbr[title]::after { + content: " ("attr(title) ")" + } + + pre { + white-space: pre-wrap !important + } + + blockquote, + pre { + border: 1px solid #adb5bd; + 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 + } + + @page { + size: a3 + } + + body { + min-width: 992px !important + } + + .container { + min-width: 992px !important + } + + .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 #dee2e6 !important + } + + .table-dark { + color: inherit + } + + .table-dark tbody+tbody, + .table-dark td, + .table-dark th, + .table-dark thead th { + border-color: #dee2e6 + } + + .table .thead-dark th { + color: inherit; + border-color: #dee2e6 + } +} + +/*# sourceMappingURL=bootstrap.min.css.map */ diff --git a/www/static/css/jquery-ui.min.css b/www/static/css/jquery-ui.min.css new file mode 100644 index 0000000..ce11dd3 --- /dev/null +++ b/www/static/css/jquery-ui.min.css @@ -0,0 +1,1953 @@ +/*! jQuery UI - v1.12.1 - 2016-09-14 +* http://jqueryui.com +* Includes: core.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, draggable.css, resizable.css, progressbar.css, selectable.css, selectmenu.css, slider.css, sortable.css, spinner.css, tabs.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?bgShadowXPos=&bgOverlayXPos=&bgErrorXPos=&bgHighlightXPos=&bgContentXPos=&bgHeaderXPos=&bgActiveXPos=&bgHoverXPos=&bgDefaultXPos=&bgShadowYPos=&bgOverlayYPos=&bgErrorYPos=&bgHighlightYPos=&bgContentYPos=&bgHeaderYPos=&bgActiveYPos=&bgHoverYPos=&bgDefaultYPos=&bgShadowRepeat=&bgOverlayRepeat=&bgErrorRepeat=&bgHighlightRepeat=&bgContentRepeat=&bgHeaderRepeat=&bgActiveRepeat=&bgHoverRepeat=&bgDefaultRepeat=&iconsHover=url(%22images%2Fui-icons_555555_256x240.png%22)&iconsHighlight=url(%22images%2Fui-icons_777620_256x240.png%22)&iconsHeader=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsError=url(%22images%2Fui-icons_cc0000_256x240.png%22)&iconsDefault=url(%22images%2Fui-icons_777777_256x240.png%22)&iconsContent=url(%22images%2Fui-icons_444444_256x240.png%22)&iconsActive=url(%22images%2Fui-icons_ffffff_256x240.png%22)&bgImgUrlShadow=&bgImgUrlOverlay=&bgImgUrlHover=&bgImgUrlHighlight=&bgImgUrlHeader=&bgImgUrlError=&bgImgUrlDefault=&bgImgUrlContent=&bgImgUrlActive=&opacityFilterShadow=Alpha(Opacity%3D30)&opacityFilterOverlay=Alpha(Opacity%3D30)&opacityShadowPerc=30&opacityOverlayPerc=30&iconColorHover=%23555555&iconColorHighlight=%23777620&iconColorHeader=%23444444&iconColorError=%23cc0000&iconColorDefault=%23777777&iconColorContent=%23444444&iconColorActive=%23ffffff&bgImgOpacityShadow=0&bgImgOpacityOverlay=0&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityContent=75&bgImgOpacityHeader=75&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgTextureShadow=flat&bgTextureOverlay=flat&bgTextureError=flat&bgTextureHighlight=flat&bgTextureContent=flat&bgTextureHeader=flat&bgTextureActive=flat&bgTextureHover=flat&bgTextureDefault=flat&cornerRadius=3px&fwDefault=normal&ffDefault=Arial%2CHelvetica%2Csans-serif&fsDefault=1em&cornerRadiusShadow=8px&thicknessShadow=5px&offsetLeftShadow=0px&offsetTopShadow=0px&opacityShadow=.3&bgColorShadow=%23666666&opacityOverlay=.3&bgColorOverlay=%23aaaaaa&fcError=%235f3f3f&borderColorError=%23f1a899&bgColorError=%23fddfdf&fcHighlight=%23777620&borderColorHighlight=%23dad55e&bgColorHighlight=%23fffa90&fcContent=%23333333&borderColorContent=%23dddddd&bgColorContent=%23ffffff&fcHeader=%23333333&borderColorHeader=%23dddddd&bgColorHeader=%23e9e9e9&fcActive=%23ffffff&borderColorActive=%23003eff&bgColorActive=%23007fff&fcHover=%232b2b2b&borderColorHover=%23cccccc&bgColorHover=%23ededed&fcDefault=%23454545&borderColorDefault=%23c5c5c5&bgColorDefault=%23f6f6f6 +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +.ui-helper-hidden { + display: none +} + +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px +} + +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none +} + +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse +} + +.ui-helper-clearfix:after { + clear: both +} + +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter: Alpha(Opacity=0) +} + +.ui-front { + z-index: 100 +} + +.ui-state-disabled { + cursor: default !important; + pointer-events: none +} + +.ui-icon { + display: inline-block; + vertical-align: middle; + margin-top: -.25em; + position: relative; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat +} + +.ui-widget-icon-block { + left: 50%; + margin-left: -8px; + display: block +} + +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100% +} + +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin: 2px 0 0 0; + padding: .5em .5em .5em .7em; + font-size: 100% +} + +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto +} + +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default +} + +.ui-menu { + list-style: none; + padding: 0; + margin: 0; + display: block; + outline: 0 +} + +.ui-menu .ui-menu { + position: absolute +} + +.ui-menu .ui-menu-item { + margin: 0; + cursor: pointer; + list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7") +} + +.ui-menu .ui-menu-item-wrapper { + position: relative; + padding: 3px 1em 3px .4em +} + +.ui-menu .ui-menu-divider { + margin: 5px 0; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0 +} + +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: -1px +} + +.ui-menu-icons { + position: relative +} + +.ui-menu-icons .ui-menu-item-wrapper { + padding-left: 2em +} + +.ui-menu .ui-icon { + position: absolute; + top: 0; + bottom: 0; + left: .2em; + margin: auto 0 +} + +.ui-menu .ui-menu-icon { + left: auto; + right: 0 +} + +.ui-button { + padding: .4em 1em; + display: inline-block; + position: relative; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + overflow: visible +} + +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none +} + +.ui-button-icon-only { + width: 2em; + box-sizing: border-box; + text-indent: -9999px; + white-space: nowrap +} + +input.ui-button.ui-button-icon-only { + text-indent: 0 +} + +.ui-button-icon-only .ui-icon { + position: absolute; + top: 50%; + left: 50%; + margin-top: -8px; + margin-left: -8px +} + +.ui-button.ui-icon-notext .ui-icon { + padding: 0; + width: 2.1em; + height: 2.1em; + text-indent: -9999px; + white-space: nowrap +} + +input.ui-button.ui-icon-notext .ui-icon { + width: auto; + height: auto; + text-indent: 0; + white-space: normal; + padding: .4em 1em +} + +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0 +} + +.ui-controlgroup { + vertical-align: middle; + display: inline-block +} + +.ui-controlgroup>.ui-controlgroup-item { + float: left; + margin-left: 0; + margin-right: 0 +} + +.ui-controlgroup>.ui-controlgroup-item:focus, +.ui-controlgroup>.ui-controlgroup-item.ui-visual-focus { + z-index: 9999 +} + +.ui-controlgroup-vertical>.ui-controlgroup-item { + display: block; + float: none; + width: 100%; + margin-top: 0; + margin-bottom: 0; + text-align: left +} + +.ui-controlgroup-vertical .ui-controlgroup-item { + box-sizing: border-box +} + +.ui-controlgroup .ui-controlgroup-label { + padding: .4em 1em +} + +.ui-controlgroup .ui-controlgroup-label span { + font-size: 80% +} + +.ui-controlgroup-horizontal .ui-controlgroup-label+.ui-controlgroup-item { + border-left: none +} + +.ui-controlgroup-vertical .ui-controlgroup-label+.ui-controlgroup-item { + border-top: none +} + +.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { + border-right: none +} + +.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { + border-bottom: none +} + +.ui-controlgroup-vertical .ui-spinner-input { + width: 75%; + width: calc(100% - 2.4em) +} + +.ui-controlgroup-vertical .ui-spinner .ui-spinner-up { + border-top-style: solid +} + +.ui-checkboxradio-label .ui-icon-background { + box-shadow: inset 1px 1px 1px #ccc; + border-radius: .12em; + border: none +} + +.ui-checkboxradio-radio-label .ui-icon-background { + width: 16px; + height: 16px; + border-radius: 1em; + overflow: visible; + border: none +} + +.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, +.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { + background-image: none; + width: 8px; + height: 8px; + border-width: 4px; + border-style: solid +} + +.ui-checkboxradio-disabled { + pointer-events: none +} + +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none +} + +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0 +} + +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em +} + +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px +} + +.ui-datepicker .ui-datepicker-prev { + left: 2px +} + +.ui-datepicker .ui-datepicker-next { + right: 2px +} + +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px +} + +.ui-datepicker .ui-datepicker-next-hover { + right: 1px +} + +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px +} + +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center +} + +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0 +} + +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 45% +} + +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em +} + +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0 +} + +.ui-datepicker td { + border: 0; + padding: 1px +} + +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none +} + +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0 +} + +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible +} + +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left +} + +.ui-datepicker.ui-datepicker-multi { + width: auto +} + +.ui-datepicker-multi .ui-datepicker-group { + float: left +} + +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em +} + +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50% +} + +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3% +} + +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25% +} + +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0 +} + +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left +} + +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0 +} + +.ui-datepicker-rtl { + direction: rtl +} + +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto +} + +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto +} + +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto +} + +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto +} + +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right +} + +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left +} + +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right +} + +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px +} + +.ui-datepicker .ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; + left: .5em; + top: .3em +} + +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0 +} + +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative +} + +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis +} + +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 20px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px +} + +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto +} + +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em +} + +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right +} + +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer +} + +.ui-dialog .ui-resizable-n { + height: 2px; + top: 0 +} + +.ui-dialog .ui-resizable-e { + width: 2px; + right: 0 +} + +.ui-dialog .ui-resizable-s { + height: 2px; + bottom: 0 +} + +.ui-dialog .ui-resizable-w { + width: 2px; + left: 0 +} + +.ui-dialog .ui-resizable-se, +.ui-dialog .ui-resizable-sw, +.ui-dialog .ui-resizable-ne, +.ui-dialog .ui-resizable-nw { + width: 7px; + height: 7px +} + +.ui-dialog .ui-resizable-se { + right: 0; + bottom: 0 +} + +.ui-dialog .ui-resizable-sw { + left: 0; + bottom: 0 +} + +.ui-dialog .ui-resizable-ne { + right: 0; + top: 0 +} + +.ui-dialog .ui-resizable-nw { + left: 0; + top: 0 +} + +.ui-draggable .ui-dialog-titlebar { + cursor: move +} + +.ui-draggable-handle { + -ms-touch-action: none; + touch-action: none +} + +.ui-resizable { + position: relative +} + +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; + -ms-touch-action: none; + touch-action: none +} + +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none +} + +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0 +} + +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0 +} + +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100% +} + +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100% +} + +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px +} + +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px +} + +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px +} + +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px +} + +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden +} + +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100% +} + +.ui-progressbar .ui-progressbar-overlay { + background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25 +} + +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none +} + +.ui-selectable { + -ms-touch-action: none; + touch-action: none +} + +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black +} + +.ui-selectmenu-menu { + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + display: none +} + +.ui-selectmenu-menu .ui-menu { + overflow: auto; + overflow-x: hidden; + padding-bottom: 1px +} + +.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { + font-size: 1em; + font-weight: bold; + line-height: 1.5; + padding: 2px 0.4em; + margin: 0.5em 0 0 0; + height: auto; + border: 0 +} + +.ui-selectmenu-open { + display: block +} + +.ui-selectmenu-text { + display: block; + margin-right: 20px; + overflow: hidden; + text-overflow: ellipsis +} + +.ui-selectmenu-button.ui-button { + text-align: left; + white-space: nowrap; + width: 14em +} + +.ui-selectmenu-icon.ui-icon { + float: right; + margin-top: 0 +} + +.ui-slider { + position: relative; + text-align: left +} + +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; + -ms-touch-action: none; + touch-action: none +} + +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0 +} + +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit +} + +.ui-slider-horizontal { + height: .8em +} + +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em +} + +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100% +} + +.ui-slider-horizontal .ui-slider-range-min { + left: 0 +} + +.ui-slider-horizontal .ui-slider-range-max { + right: 0 +} + +.ui-slider-vertical { + width: .8em; + height: 100px +} + +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em +} + +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100% +} + +.ui-slider-vertical .ui-slider-range-min { + bottom: 0 +} + +.ui-slider-vertical .ui-slider-range-max { + top: 0 +} + +.ui-sortable-handle { + -ms-touch-action: none; + touch-action: none +} + +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle +} + +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: .222em 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 2em +} + +.ui-spinner-button { + width: 1.6em; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0 +} + +.ui-spinner a.ui-spinner-button { + border-top-style: none; + border-bottom-style: none; + border-right-style: none +} + +.ui-spinner-up { + top: 0 +} + +.ui-spinner-down { + bottom: 0 +} + +.ui-tabs { + position: relative; + padding: .2em +} + +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0 +} + +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap +} + +.ui-tabs .ui-tabs-nav .ui-tabs-anchor { + float: left; + padding: .5em 1em; + text-decoration: none +} + +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px +} + +.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { + cursor: text +} + +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { + cursor: pointer +} + +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none +} + +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px +} + +body .ui-tooltip { + border-width: 2px +} + +.ui-widget { + font-family: Arial, Helvetica, sans-serif; + font-size: 1em +} + +.ui-widget .ui-widget { + font-size: 1em +} + +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Arial, Helvetica, sans-serif; + font-size: 1em +} + +.ui-widget.ui-widget-content { + border: 1px solid #c5c5c5 +} + +.ui-widget-content { + border: 1px solid #ddd; + background: #fff; + color: #333 +} + +.ui-widget-content a { + color: #333 +} + +.ui-widget-header { + border: 1px solid #ddd; + background: #e9e9e9; + color: #333; + font-weight: bold +} + +.ui-widget-header a { + color: #333 +} + +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default, +.ui-button, +html .ui-button.ui-state-disabled:hover, +html .ui-button.ui-state-disabled:active { + border: 1px solid #c5c5c5; + background: #f6f6f6; + font-weight: normal; + color: #454545 +} + +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited, +a.ui-button, +a:link.ui-button, +a:visited.ui-button, +.ui-button { + color: #454545; + text-decoration: none +} + +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus, +.ui-button:hover, +.ui-button:focus { + border: 1px solid #ccc; + background: #ededed; + font-weight: normal; + color: #2b2b2b +} + +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited, +.ui-state-focus a, +.ui-state-focus a:hover, +.ui-state-focus a:link, +.ui-state-focus a:visited, +a.ui-button:hover, +a.ui-button:focus { + color: #2b2b2b; + text-decoration: none +} + +.ui-visual-focus { + box-shadow: 0 0 3px 1px rgb(94, 158, 214) +} + +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + border: 1px solid #003eff; + background: #007fff; + font-weight: normal; + color: #fff +} + +.ui-icon-background, +.ui-state-active .ui-icon-background { + border: #003eff; + background-color: #fff +} + +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #fff; + text-decoration: none +} + +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #dad55e; + background: #fffa90; + color: #777620 +} + +.ui-state-checked { + border: 1px solid #dad55e; + background: #fffa90 +} + +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #777620 +} + +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #f1a899; + background: #fddfdf; + color: #5f3f3f +} + +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #5f3f3f +} + +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #5f3f3f +} + +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold +} + +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter: Alpha(Opacity=70); + font-weight: normal +} + +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter: Alpha(Opacity=35); + background-image: none +} + +.ui-state-disabled .ui-icon { + filter: Alpha(Opacity=35) +} + +.ui-icon { + width: 16px; + height: 16px +} + +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url("images/ui-icons_444444_256x240.png") +} + +.ui-widget-header .ui-icon { + background-image: url("images/ui-icons_444444_256x240.png") +} + +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon, +.ui-button:hover .ui-icon, +.ui-button:focus .ui-icon { + background-image: url("images/ui-icons_555555_256x240.png") +} + +.ui-state-active .ui-icon, +.ui-button:active .ui-icon { + background-image: url("images/ui-icons_ffffff_256x240.png") +} + +.ui-state-highlight .ui-icon, +.ui-button .ui-state-highlight.ui-icon { + background-image: url("images/ui-icons_777620_256x240.png") +} + +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url("images/ui-icons_cc0000_256x240.png") +} + +.ui-button .ui-icon { + background-image: url("images/ui-icons_777777_256x240.png") +} + +.ui-icon-blank { + background-position: 16px 16px +} + +.ui-icon-caret-1-n { + background-position: 0 0 +} + +.ui-icon-caret-1-ne { + background-position: -16px 0 +} + +.ui-icon-caret-1-e { + background-position: -32px 0 +} + +.ui-icon-caret-1-se { + background-position: -48px 0 +} + +.ui-icon-caret-1-s { + background-position: -65px 0 +} + +.ui-icon-caret-1-sw { + background-position: -80px 0 +} + +.ui-icon-caret-1-w { + background-position: -96px 0 +} + +.ui-icon-caret-1-nw { + background-position: -112px 0 +} + +.ui-icon-caret-2-n-s { + background-position: -128px 0 +} + +.ui-icon-caret-2-e-w { + background-position: -144px 0 +} + +.ui-icon-triangle-1-n { + background-position: 0 -16px +} + +.ui-icon-triangle-1-ne { + background-position: -16px -16px +} + +.ui-icon-triangle-1-e { + background-position: -32px -16px +} + +.ui-icon-triangle-1-se { + background-position: -48px -16px +} + +.ui-icon-triangle-1-s { + background-position: -65px -16px +} + +.ui-icon-triangle-1-sw { + background-position: -80px -16px +} + +.ui-icon-triangle-1-w { + background-position: -96px -16px +} + +.ui-icon-triangle-1-nw { + background-position: -112px -16px +} + +.ui-icon-triangle-2-n-s { + background-position: -128px -16px +} + +.ui-icon-triangle-2-e-w { + background-position: -144px -16px +} + +.ui-icon-arrow-1-n { + background-position: 0 -32px +} + +.ui-icon-arrow-1-ne { + background-position: -16px -32px +} + +.ui-icon-arrow-1-e { + background-position: -32px -32px +} + +.ui-icon-arrow-1-se { + background-position: -48px -32px +} + +.ui-icon-arrow-1-s { + background-position: -65px -32px +} + +.ui-icon-arrow-1-sw { + background-position: -80px -32px +} + +.ui-icon-arrow-1-w { + background-position: -96px -32px +} + +.ui-icon-arrow-1-nw { + background-position: -112px -32px +} + +.ui-icon-arrow-2-n-s { + background-position: -128px -32px +} + +.ui-icon-arrow-2-ne-sw { + background-position: -144px -32px +} + +.ui-icon-arrow-2-e-w { + background-position: -160px -32px +} + +.ui-icon-arrow-2-se-nw { + background-position: -176px -32px +} + +.ui-icon-arrowstop-1-n { + background-position: -192px -32px +} + +.ui-icon-arrowstop-1-e { + background-position: -208px -32px +} + +.ui-icon-arrowstop-1-s { + background-position: -224px -32px +} + +.ui-icon-arrowstop-1-w { + background-position: -240px -32px +} + +.ui-icon-arrowthick-1-n { + background-position: 1px -48px +} + +.ui-icon-arrowthick-1-ne { + background-position: -16px -48px +} + +.ui-icon-arrowthick-1-e { + background-position: -32px -48px +} + +.ui-icon-arrowthick-1-se { + background-position: -48px -48px +} + +.ui-icon-arrowthick-1-s { + background-position: -64px -48px +} + +.ui-icon-arrowthick-1-sw { + background-position: -80px -48px +} + +.ui-icon-arrowthick-1-w { + background-position: -96px -48px +} + +.ui-icon-arrowthick-1-nw { + background-position: -112px -48px +} + +.ui-icon-arrowthick-2-n-s { + background-position: -128px -48px +} + +.ui-icon-arrowthick-2-ne-sw { + background-position: -144px -48px +} + +.ui-icon-arrowthick-2-e-w { + background-position: -160px -48px +} + +.ui-icon-arrowthick-2-se-nw { + background-position: -176px -48px +} + +.ui-icon-arrowthickstop-1-n { + background-position: -192px -48px +} + +.ui-icon-arrowthickstop-1-e { + background-position: -208px -48px +} + +.ui-icon-arrowthickstop-1-s { + background-position: -224px -48px +} + +.ui-icon-arrowthickstop-1-w { + background-position: -240px -48px +} + +.ui-icon-arrowreturnthick-1-w { + background-position: 0 -64px +} + +.ui-icon-arrowreturnthick-1-n { + background-position: -16px -64px +} + +.ui-icon-arrowreturnthick-1-e { + background-position: -32px -64px +} + +.ui-icon-arrowreturnthick-1-s { + background-position: -48px -64px +} + +.ui-icon-arrowreturn-1-w { + background-position: -64px -64px +} + +.ui-icon-arrowreturn-1-n { + background-position: -80px -64px +} + +.ui-icon-arrowreturn-1-e { + background-position: -96px -64px +} + +.ui-icon-arrowreturn-1-s { + background-position: -112px -64px +} + +.ui-icon-arrowrefresh-1-w { + background-position: -128px -64px +} + +.ui-icon-arrowrefresh-1-n { + background-position: -144px -64px +} + +.ui-icon-arrowrefresh-1-e { + background-position: -160px -64px +} + +.ui-icon-arrowrefresh-1-s { + background-position: -176px -64px +} + +.ui-icon-arrow-4 { + background-position: 0 -80px +} + +.ui-icon-arrow-4-diag { + background-position: -16px -80px +} + +.ui-icon-extlink { + background-position: -32px -80px +} + +.ui-icon-newwin { + background-position: -48px -80px +} + +.ui-icon-refresh { + background-position: -64px -80px +} + +.ui-icon-shuffle { + background-position: -80px -80px +} + +.ui-icon-transfer-e-w { + background-position: -96px -80px +} + +.ui-icon-transferthick-e-w { + background-position: -112px -80px +} + +.ui-icon-folder-collapsed { + background-position: 0 -96px +} + +.ui-icon-folder-open { + background-position: -16px -96px +} + +.ui-icon-document { + background-position: -32px -96px +} + +.ui-icon-document-b { + background-position: -48px -96px +} + +.ui-icon-note { + background-position: -64px -96px +} + +.ui-icon-mail-closed { + background-position: -80px -96px +} + +.ui-icon-mail-open { + background-position: -96px -96px +} + +.ui-icon-suitcase { + background-position: -112px -96px +} + +.ui-icon-comment { + background-position: -128px -96px +} + +.ui-icon-person { + background-position: -144px -96px +} + +.ui-icon-print { + background-position: -160px -96px +} + +.ui-icon-trash { + background-position: -176px -96px +} + +.ui-icon-locked { + background-position: -192px -96px +} + +.ui-icon-unlocked { + background-position: -208px -96px +} + +.ui-icon-bookmark { + background-position: -224px -96px +} + +.ui-icon-tag { + background-position: -240px -96px +} + +.ui-icon-home { + background-position: 0 -112px +} + +.ui-icon-flag { + background-position: -16px -112px +} + +.ui-icon-calendar { + background-position: -32px -112px +} + +.ui-icon-cart { + background-position: -48px -112px +} + +.ui-icon-pencil { + background-position: -64px -112px +} + +.ui-icon-clock { + background-position: -80px -112px +} + +.ui-icon-disk { + background-position: -96px -112px +} + +.ui-icon-calculator { + background-position: -112px -112px +} + +.ui-icon-zoomin { + background-position: -128px -112px +} + +.ui-icon-zoomout { + background-position: -144px -112px +} + +.ui-icon-search { + background-position: -160px -112px +} + +.ui-icon-wrench { + background-position: -176px -112px +} + +.ui-icon-gear { + background-position: -192px -112px +} + +.ui-icon-heart { + background-position: -208px -112px +} + +.ui-icon-star { + background-position: -224px -112px +} + +.ui-icon-link { + background-position: -240px -112px +} + +.ui-icon-cancel { + background-position: 0 -128px +} + +.ui-icon-plus { + background-position: -16px -128px +} + +.ui-icon-plusthick { + background-position: -32px -128px +} + +.ui-icon-minus { + background-position: -48px -128px +} + +.ui-icon-minusthick { + background-position: -64px -128px +} + +.ui-icon-close { + background-position: -80px -128px +} + +.ui-icon-closethick { + background-position: -96px -128px +} + +.ui-icon-key { + background-position: -112px -128px +} + +.ui-icon-lightbulb { + background-position: -128px -128px +} + +.ui-icon-scissors { + background-position: -144px -128px +} + +.ui-icon-clipboard { + background-position: -160px -128px +} + +.ui-icon-copy { + background-position: -176px -128px +} + +.ui-icon-contact { + background-position: -192px -128px +} + +.ui-icon-image { + background-position: -208px -128px +} + +.ui-icon-video { + background-position: -224px -128px +} + +.ui-icon-script { + background-position: -240px -128px +} + +.ui-icon-alert { + background-position: 0 -144px +} + +.ui-icon-info { + background-position: -16px -144px +} + +.ui-icon-notice { + background-position: -32px -144px +} + +.ui-icon-help { + background-position: -48px -144px +} + +.ui-icon-check { + background-position: -64px -144px +} + +.ui-icon-bullet { + background-position: -80px -144px +} + +.ui-icon-radio-on { + background-position: -96px -144px +} + +.ui-icon-radio-off { + background-position: -112px -144px +} + +.ui-icon-pin-w { + background-position: -128px -144px +} + +.ui-icon-pin-s { + background-position: -144px -144px +} + +.ui-icon-play { + background-position: 0 -160px +} + +.ui-icon-pause { + background-position: -16px -160px +} + +.ui-icon-seek-next { + background-position: -32px -160px +} + +.ui-icon-seek-prev { + background-position: -48px -160px +} + +.ui-icon-seek-end { + background-position: -64px -160px +} + +.ui-icon-seek-start { + background-position: -80px -160px +} + +.ui-icon-seek-first { + background-position: -80px -160px +} + +.ui-icon-stop { + background-position: -96px -160px +} + +.ui-icon-eject { + background-position: -112px -160px +} + +.ui-icon-volume-off { + background-position: -128px -160px +} + +.ui-icon-volume-on { + background-position: -144px -160px +} + +.ui-icon-power { + background-position: 0 -176px +} + +.ui-icon-signal-diag { + background-position: -16px -176px +} + +.ui-icon-signal { + background-position: -32px -176px +} + +.ui-icon-battery-0 { + background-position: -48px -176px +} + +.ui-icon-battery-1 { + background-position: -64px -176px +} + +.ui-icon-battery-2 { + background-position: -80px -176px +} + +.ui-icon-battery-3 { + background-position: -96px -176px +} + +.ui-icon-circle-plus { + background-position: 0 -192px +} + +.ui-icon-circle-minus { + background-position: -16px -192px +} + +.ui-icon-circle-close { + background-position: -32px -192px +} + +.ui-icon-circle-triangle-e { + background-position: -48px -192px +} + +.ui-icon-circle-triangle-s { + background-position: -64px -192px +} + +.ui-icon-circle-triangle-w { + background-position: -80px -192px +} + +.ui-icon-circle-triangle-n { + background-position: -96px -192px +} + +.ui-icon-circle-arrow-e { + background-position: -112px -192px +} + +.ui-icon-circle-arrow-s { + background-position: -128px -192px +} + +.ui-icon-circle-arrow-w { + background-position: -144px -192px +} + +.ui-icon-circle-arrow-n { + background-position: -160px -192px +} + +.ui-icon-circle-zoomin { + background-position: -176px -192px +} + +.ui-icon-circle-zoomout { + background-position: -192px -192px +} + +.ui-icon-circle-check { + background-position: -208px -192px +} + +.ui-icon-circlesmall-plus { + background-position: 0 -208px +} + +.ui-icon-circlesmall-minus { + background-position: -16px -208px +} + +.ui-icon-circlesmall-close { + background-position: -32px -208px +} + +.ui-icon-squaresmall-plus { + background-position: -48px -208px +} + +.ui-icon-squaresmall-minus { + background-position: -64px -208px +} + +.ui-icon-squaresmall-close { + background-position: -80px -208px +} + +.ui-icon-grip-dotted-vertical { + background-position: 0 -224px +} + +.ui-icon-grip-dotted-horizontal { + background-position: -16px -224px +} + +.ui-icon-grip-solid-vertical { + background-position: -32px -224px +} + +.ui-icon-grip-solid-horizontal { + background-position: -48px -224px +} + +.ui-icon-gripsmall-diagonal-se { + background-position: -64px -224px +} + +.ui-icon-grip-diagonal-se { + background-position: -80px -224px +} + +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 3px +} + +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 3px +} + +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 3px +} + +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 3px +} + +.ui-widget-overlay { + background: #aaa; + opacity: .003; + filter: Alpha(Opacity=.3) +} + +.ui-widget-shadow { + -webkit-box-shadow: 0 0 5px #666; + box-shadow: 0 0 5px #666 +} diff --git a/www/static/css/styles.css b/www/static/css/styles.css new file mode 100644 index 0000000..d0d1efd --- /dev/null +++ b/www/static/css/styles.css @@ -0,0 +1,252 @@ +.game_img { + width: 200px; +} + +.main_img { + display: block; + margin-left: auto; + margin-right: auto; + width: 50%; +} + +.fullwidth-div { + position: absolute; + width: 100%; + height: 100%; + left: 0; + margin: 0; +} + +button.game-btn { + background-color: #6AD9D9; + background-repeat: no-repeat; + border: #6AD9D9; + cursor: pointer; + overflow: hidden; + outline: none; + box-shadow: 10px 10px 5px; + border-radius: 10px; + height: 100%; + width: 100%; +} + +.create-participant:hover { + background-color: #F6454F !important; + border: #F6454F; +} + +.create-participant:active { + color: black !important; + background-color: #FFD503 !important; + border: #FFD503 !important; +} + +.create-participant:focus { + background-color: #6AD9D9 !important; +} + +.main-logos { + background-color: #ECDFCD; + margin-bottom: 10%; +} + +#main_logos { + padding-top: 1%; +} + +/* .game-logos { + margin-left: 2%; +} */ + +#no-interaction { + font-size: 5em; + color: red; + background: #ECDFCD; + border-radius: 30px; + padding: 0.5% 5%; + text-align: center; +} + +#no-interaction-diagram { + font-size: 5em; + color: red; + background: #ECDFCD; + border-radius: 30px; + padding: 0.5% 5%; + text-align: center; +} + +.no-interaction { + margin-top: 20%; + text-align: center; +} + +.no-interaction-diagram { + margin-top: 5%; + text-align: center; +} + +label, +input { + display: block; +} + +input.text { + margin-bottom: 12px; + width: 95%; + padding: .4em; +} + +fieldset { + padding: 0; + border: 0; +} + +h1 { + font-size: 1.2em; + margin: .6em 0; +} + +div#users-contain { + width: 350px; + margin: 20px 0; +} + +div#dialog-form { + height: 290px !important; +} + +div#users-contain table { + margin: 1em 0; + border-collapse: collapse; + width: 100%; +} + +div#users-contain table td, +div#users-contain table th { + border: 1px solid #eee; + padding: .6em 10px; + text-align: left; +} + +.ui-dialog .ui-state-error { + padding: .3em; +} + +.validateTips { + border: 1px solid transparent; + padding: 0.3em; +} + +#crm-grid { + text-align: center; + color: white; + width: 100%; + margin: 0 auto; +} + +#crm-grid>tbody>tr>td { + height: 5em; + width: 2em; + +} + +#crm-parent { + padding: 1% 10% 10% 10%; +} + +.crm-holder { + background: rgb(44, 44, 44); + margin-top: 5%; + padding: 3% 4% 4% 10%; + width: 100%; + border-radius: 2em; +} + +.crm-button { + width: 100%; + height: 100%; + border: none; + color: white; +} + +.crm-button:hover { + background-color: grey; +} + +.crm-cell { + border: 1px solid black; +} + +.crm-blue { + background-color: blue; + +} + +.crm-black { + background-color: black; +} + +.crm-white { + background-color: white; + color: black; +} + +.crm-red { + background-color: red; +} + +.crm-pink { + background-color: pink; + color: black; +} + +.crm-green { + background-color: green; +} + +.crm-name { + font-weight: bold; +} + + +#myProgress { + width: 100%; + background-color: grey; + margin-left: -3.5%; +} + +.ui-progressbar-value { + margin: 0 !important; + background-color: green; +} + +#sam-diagram { + text-align: center; + height: 40em; + width: auto; +} + +@media only screen and (max-width: 1365px) { + #sam-diagram { + height: 30em; + margin-top: 1%; + } + #no-interaction-diagram { + font-size: 2em; + border-radius: 15px; + padding: 0.5% 5%; + text-align: center; + } + .no-interaction-diagram { + margin-top: 2%; + } + #woman_holding_dog { + width: 15%; + } + #woman_holding_dog img { + width: 120%; + position: relative; + top: 25%; + } +} diff --git a/www/static/images/._fishy.png b/www/static/images/._fishy.png new file mode 100644 index 0000000..a2479b6 Binary files /dev/null and b/www/static/images/._fishy.png differ diff --git a/www/static/images/._rug.png b/www/static/images/._rug.png new file mode 100644 index 0000000..c59b73d Binary files /dev/null and b/www/static/images/._rug.png differ diff --git a/www/static/images/._umcg.png b/www/static/images/._umcg.png new file mode 100644 index 0000000..b86159c Binary files /dev/null and b/www/static/images/._umcg.png differ diff --git a/www/static/images/._woman.png b/www/static/images/._woman.png new file mode 100644 index 0000000..b9657a0 Binary files /dev/null and b/www/static/images/._woman.png differ diff --git a/www/static/images/PICKA.png b/www/static/images/PICKA.png new file mode 100644 index 0000000..6f32006 Binary files /dev/null and b/www/static/images/PICKA.png differ diff --git a/www/static/images/angry.png b/www/static/images/angry.png new file mode 100644 index 0000000..f18c217 Binary files /dev/null and b/www/static/images/angry.png differ diff --git a/www/static/images/dog.png b/www/static/images/dog.png new file mode 100644 index 0000000..99cc025 Binary files /dev/null and b/www/static/images/dog.png differ diff --git a/www/static/images/fishy.png b/www/static/images/fishy.png new file mode 100644 index 0000000..f182ef7 Binary files /dev/null and b/www/static/images/fishy.png differ diff --git a/www/static/images/happy.png b/www/static/images/happy.png new file mode 100644 index 0000000..2282649 Binary files /dev/null and b/www/static/images/happy.png differ diff --git a/www/static/images/man.png b/www/static/images/man.png new file mode 100644 index 0000000..b662b5c Binary files /dev/null and b/www/static/images/man.png differ diff --git a/www/static/images/nao.png b/www/static/images/nao.png new file mode 100644 index 0000000..53d3fcd Binary files /dev/null and b/www/static/images/nao.png differ diff --git a/www/static/images/rug.png b/www/static/images/rug.png new file mode 100644 index 0000000..e4f7002 Binary files /dev/null and b/www/static/images/rug.png differ diff --git a/www/static/images/sad.png b/www/static/images/sad.png new file mode 100644 index 0000000..9850cb7 Binary files /dev/null and b/www/static/images/sad.png differ diff --git a/www/static/images/sam_emotion_diagram.png b/www/static/images/sam_emotion_diagram.png new file mode 100644 index 0000000..10450a5 Binary files /dev/null and b/www/static/images/sam_emotion_diagram.png differ diff --git a/www/static/images/umcg.png b/www/static/images/umcg.png new file mode 100644 index 0000000..295af09 Binary files /dev/null and b/www/static/images/umcg.png differ diff --git a/www/static/images/woman+dog.jpg b/www/static/images/woman+dog.jpg new file mode 100644 index 0000000..063ce23 Binary files /dev/null and b/www/static/images/woman+dog.jpg differ diff --git a/www/static/images/woman.png b/www/static/images/woman.png new file mode 100644 index 0000000..9231d6e Binary files /dev/null and b/www/static/images/woman.png differ diff --git a/www/static/js/jquery-ui.min.js b/www/static/js/jquery-ui.min.js new file mode 100644 index 0000000..9e086e8 --- /dev/null +++ b/www/static/js/jquery-ui.min.js @@ -0,0 +1,13 @@ +/*! jQuery UI - v1.12.1 - 2016-09-14 +* http://jqueryui.com +* Includes: widget.js, position.js, data.js, disable-selection.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/draggable.js, widgets/droppable.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/resizable.js, widgets/selectable.js, widgets/selectmenu.js, widgets/slider.js, widgets/sortable.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("
"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(m.inline?m.dpDiv.parent()[0]:m.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var h=0,l=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var l=h+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,s,n=l.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=l.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each(function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")}):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("
"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widthi?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});var c="ui-effects-",u="ui-effects-style",d="ui-effects-animated",p=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("

")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(p),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(p.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),l=l.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(d)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(c+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(c+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("

").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(u,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(u)||"",t.removeData(u)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(c+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=c+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(d),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(h)&&h.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[l](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===l:"show"===l)?(r[l](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",h=s.complete,l=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,l)||o;i.data(d,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?l?this[l](s.duration,h):this.each(function(){h&&h.call(this)}):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n) +}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("
").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var f=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},h=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),h&&h.css(t.effects.clipToBox(r)),r.clip=a),h&&h.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,h="hide"===r,l="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(l||h?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),l&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),h&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=h?2*u:u/2;h&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,h=r||"horizontal"===a,l=r||"vertical"===a;s=o.cssClip(),n.clip={top:l?(s.bottom-s.top)/2:s.top,right:h?(s.right-s.left)/2:s.right,bottom:l?(s.bottom-s.top)/2:s.bottom,left:h?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r?"-=":"+=",c="+="===l?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,u[h]=l+s,a&&(n.css(u),u[h]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,l=a-(d-1)/2,p.clone().appendTo("body").wrap("
").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?l*_:0),top:h+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:l*_),top:h+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,h=/([0-9]+)%/.exec(r),l=!!e.horizFirst,c=l?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;h&&(r=parseInt(h[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,h,n.from.y,_),v=t.effects.setTransition(a,h,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,l,n.from.x,_),v=t.effects.setTransition(a,l,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(h=h.concat(["marginTop","marginBottom"]).concat(r),l=l.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,h,n.from.y,o),a=t.effects.setTransition(i,h,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,l,n.from.x,o),a=t.effects.setTransition(i,l,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,h=2*(e.times||5)+(r?1:0),l=e.duration/h,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);h>u;u++)s.animate({opacity:c},l,e.easing),c=1-c;s.animate({opacity:c},l,e.easing),s.queue(i),t.effects.unshift(s,d,h+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,h=2*r+1,l=Math.round(e.duration/h),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,l,e.easing);r>s;s++)n.animate(p,l,e.easing).animate(f,l,e.easing);n.animate(p,l,e.easing).animate(d,l/2,e.easing).queue(i),t.effects.unshift(n,g,h+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u=e.distance||o["top"===l?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[l],d[l]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[h][1]]=d.clip[a[h][0]],"show"===r&&(o.cssClip(d.clip),o.css(l,d[l]),d.clip=s,d[l]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var f;t.uiBackCompat!==!1&&(f=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)})),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t(""),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void 0)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],h=r&&n.collapsible,l=h?t():a.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:h?t():a,newPanel:l};e.preventDefault(),r&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=h?!1:this.headers.index(a),this.active=r?t():a,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!e.length||t.index()",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,h=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=h.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=h.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n; +this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("