is a ramification from any other timeline. It is like a copy repository within the main repository, which is created to test changes that may or may not be implemented in the `main` timeline. Ideally, each developer creates a branch to test the changes they deem necessary and submit these changes to their colleagues' judgment before implementing them in the `main`.
+
+### Copying repositories from the 'cloud' to the computer (or, working offline):
+
+Repositories can be created online and many things can be done there. However, in order to work locally on a repository, i.e. to work offline, we need to create a **clone** of the repository we have online. A clone is a synchronised copy of your online repository. Everything you do in your local working directory (corresponding to the clone) will be synchronized with the online repository.
+
+### Copying online repositories
+
+In turn, **forks**
are complete, independent copies of a repository. We use a fork (not a clone) when we want to change the direction of the project, or when we want to contribute to someone else's project independently and only then suggest changes to the original project. If you need to update your fork with the newest version of the project, you can do that by requesting a **fetch** to Git.
+
+### General workflow vocabulary
+
+When we change some file and save the new version, we do a **commit**
. Commits should be accompanied by short but sufficiently descriptive comments, so that you can understand what the difference in that version is and locate it more easily. With commits you can track what change was made, where, by whom and when.
+
+
+
+After changing a file and saving the new version, this version needs to be given a tag (an identification code), and then uploaded to the online repository. We call this a **push**. To update your local directory with the newest versions of files, you must tell Git to **pull** them.
+
+When working on a branch, you can request that the changes you have made be implemented in the main branch of your *workflow* (or any other branch). To do this you request a **merge** via a **pull request**
. In a pull request, you ask a repository owner or contributor to accept the changes you made to a fork or branch into another branch. If they accept, you are listed as a contributor to the project.
+
+## Working remotely
+
+The online portal of your Git server allows you to do most of the tasks described above in a very intuitive way. You can edit some files, upload others, request a merge, create and delete a branch, etc. Once you know the Git logic and architecture, it is easy to work online.
+For a detailed walkthrough, take a look at [this page](https://mozillascience.github.io/WOW-2017/github/).
+
+## Working locally
+
+However, the changes we need to make cannot always be done directly in the portal, or would be done more efficiently if we worked on our computer, with our preferred software. To work on your repository from your computer, you only need to install Git itself (https://git-scm.com/downloads). Some softwares allow you to visualize the timeline and operations being made, such as GitKraken (https://www.gitkraken.com/) and some extentions for VSCode and RStudio.
+
+Once you've installed Git, the there are two possible ways to start:
+
+* You can create your online repository directly on your Git host server (such as GitHub, GitLab or Bitbucket);
+
+* Or you can "transform" a local directory into a Git controlled project.
+
+In the first case, to have a copy of your online repository on your computer, just clone your directory, either by downloading all the files in a .zip or by copying the ssh key or html address to use in a Git command.
+
+
+
+You can also clone from GitKraken, by clicking on the little folder on the top left corner or on "File" on the menu.
+
+
+In the second case, you must right-click on your workbook and open the Git Bash; alternatively, in GitKraken, you can click on "Init" in the same window shown above and indicate the directory of your workbook in "New repository path".
+
+## Basic Commands
+
+The following commands will give us an idea of a *workflow* in Git.
+
+To use Git, you need to configure it so that your account on your Git server is recognised by it. In Git Bash:
+
+```bash
+git config --global user.name "username"
+git config --global user.email "iamawesome@email.com"
+git config --list #Confirm your settings
+```
+There, now Git knows who you are.
+
+
+
+To start a repository from your computer, you can tell Git to start or "watch" a folder.
+First, check what the working directory is and change it if necessary.
+
+
+```bash
+pwd # prints the working directory
+cd # takes you to the root
+cd .. # takes you to one level up directory
+cd "your/directory" # changes your working directory
+```
+
+
+To clone your repository, copy the url as shown in the picture above and ask Git to clone the repository into the directory you indicated.
+
+```bash
+git clone https://github.com/graciellehigino/bios2.github.io.git
+```
+The above command will create a folder with the same name as the repository in your working directory. If you want the folder created to have another name, include that after the repository address. This process works if you have an online repository and want it to exist on your computer. You can also do it the other way round. If you have not yet created a folder for your project, you can ask Git to create one for you:
+
+```bash
+mkdir "web-repo-github"
+```
+
+But if you already have a folder and want Git to "watch over" it, start a local repository in the directory indicated:
+
+```bash
+git init
+```
+You can (maybe you need to) tell Git where your remote repository is:
+```bash
+git remote add origin https://github.com/graciellehigino/bios2.github.io.git
+```
+Ok, now your repository is ready to use.
+Check if there are new files in your folder or modified files that haven't been pushed yet:
+```bash
+git status
+```
+
+Hey, couldn't you find an important file? Add it to the Git vision field now!
+
+```bash
+git add file # adds a file
+
+git add -u # updates the file tracking
+
+git add -A # all the above
+```
+To make additions interactively via the terminal, use:
+```bash
+git add -i
+```
+
+Follow the instructions provided by the terminal and include as many files as you want before committing.
+
+Now that Git is keeping an eye on all your files, any changes you make (and want them to be recorded in this file's timeline) will be detected. To make sure your changes are recorded, "commit" the changed file with a comment so you can remember what the difference is in that version.
+
+```bash
+git commit -m "it's awesome now"
+```
+
+A `commit` only updates the local repository if you are working locally, or the remote repository if you are working remotely. To synchronize the two repositories, you must either `push` updates to the remote repository or `pull` updates to the local repository.
+```bash
+git push origin master
+#"Git, please take the updated files to the remote repository 'origin', on the 'main' branch."
+
+git pull
+#"Git, please bring the updated files from the remote repository to my local repository"
+```
+### How to track changes in my files?
+Check the changes in the content of the files (e.g. new lines added):
+```bash
+git diff
+```
+
+Check the files and their changes that are in the stage area:
+```bash
+git diff --staged
+```
+If you are lost between the different versions of your files, check the commit history! :)
+```bash
+git log # history of project commits since the beginning
+git log -p # detailed historic of commits (i.e. git log + git diff)
+```
+
+Depending on the size of the changes, the log may be very large and you will need to press "return" to each page to see all the changes. At the end you will see `(END)`, then press the letter 'q' to finish reading.
+If you only want to check the latest commits, limit the list with `git log -p -1` (replace the 1 with the number of commits you wish to see). You can also check out the entire change history of the working directories with the Git viewer with `gitk`. Isn't that cool!
+
+### Working with branches
+*Branches* are ramifications of other timelines. They are very useful when you need to test or work on large changes without changing what is on the main branch. It is very important to maintain branches in your collaborative work, because it reduces the chance of the main branch suffering accidental major changes and simplifies the management of file versions.
+
+```bash
+git show-branch -a # lists all branches
+
+git branch name_of_branch # creates a new branch
+
+git checkout name_of_branch # transfers the workspace to the new branch
+
+git checkout -b name_of_branch # creates a branch and transfers the workspace
+```
+When all the changes you have made to your branch are done and you think it is time to merge them into the `main` (or any other branch), move to the target branch and request a merge:
+
+```bash
+git merge new_branch # merges the changes from 'new_branch' to 'main'
+```
+
+If you no longer need the branch and want to delete it, use the `git branch -d new_branch` command.
+It can often happen that your working branch is not up to date with the `main`. This can be a problem if the `main` has important updates for the development of your project on the branch. To bring the `main` updates to your branch, follow these steps:
+1. Check if your workspace is on the `main` branch. If not, transfer it:
+```bash
+git checkout master
+```
+2. On the `main`, update your local directory:
+```bash
+git pull
+```
+3. After updating your local directory, move to your branch, merge the `main` updates into your branch and upload to the remote repository:
+```bash
+git checkout your-branch
+git merge main your-branch
+git push
+```
+That's it! Now your branch contains everything that was new in the `main`. :)
+
+## Oh, my Git! D=
+Did you mess up commits? Want to revert a change? Don't despair!
+If you made a commit and regret it, but don't even remember which commit it was (["Find out commits associated for a specific file"](http://stackoverflow.com/questions/3701404/list-all-commits-for-a-specific-file)):
+
+```bash
+git log -p filename`
+```
+If you want to include new edits to the last commit, replacing it:
+```bash
+git commit --amend -m "message"
+```
+
+If you want to remove any file from the stage area after a `git add .`:
+
+```bash
+git reset HEAD new_file.R
+```
+
+But if you want to remove it from your *working tree* and the set of added files:
+
+```bash
+git rm new_file.R
+```
+
+If all that goes wrong, try the following (tips taken [from here](https://stackoverflow.com/questions/23068790/git-revert-certain-files)):
+
+```bash
+git revert --no-commit | this | +is | +a | +table | +
|---|---|---|---|
| a | +table | +this | +is | +
A seven-day detox routine to improve the reproducibility of your projects!
+Have you ever felt lost in your own projects? Do you feel like your workflow is quite effective, but itโs not transparent enough? This detox routine can help you regain control over your (very messy - I know!) project structure and discover a marvelous world of collaboration and contribution in open science!
+Reproducibility is a principle that resonates to the most used concept of science, assuring that a hypothesis is testable. It means that the process to test an idea - from data to results - can be repeated. It is different from replicability, which means the process can be repeated, but using different data.
+In this detox week we will reflect and experiment with open science, using our skills for project design, version control, virtual environments and automation. We will reevaluate our current workflow and fine-tune where needed, to reach the most reproducible workflow possible for us.
+++ +Self-care task of the day
+Go to a calm place. No need of silence, just a place where you can just be still. Set a timer for 5min. Take a deep breath in, and a deep breath out. Give your body a scan-through: concentrate in each centimeter of it and try to be aware of how does your body feel there. Everytime you find a contracted muscle, try to relax it. Pay attention to the sounds around you. When the timer is off, take another deep breath.
+
On the first day of this detox journey, letโs reflect on our way to work and how it could be better. Take a moment of your day and think about:
+What is your current workflow when you develop a project? Take a pen and paper (physical or digital) and sketch your usual process, step-by-step. Add as much details as you can (and take this chance to get creative!). Make sure to save this sketch in a place that is easy to access, youโre gonna need it in the following days.
How do we build trust and facilitate collaboration in our projects?
How can be inclusive by design - what can we do in our projects to invite collaboration?
Is reproducibility openness? If a project is reproducible, does that mean it is accessible?
++Self-care task of the day
+Go to somewhere where you feel in peace or happy. Take paper and something to write - even better if itโs colorful! Set a timer for 30 minutes and doodle something that reflects how you are feeling, something that represents a happy thought you had today, or something that represents the place you are right now.
+
In this step we will squeeze our creativity out of our brains to come up with a project that is reproducible by design. Is there a hierarchy between your folders? Which folders do you need? Should you mix raw and clean data? Did this last question offend you?
+There are a couple of tools you can use to automatically create a project structure for you, such as RProject and its combination with the R package minimaltemplate, or the PkgTemplate.jl for development of packages in Julia.
The main things you need to reflect on when designing your open project are:
+Will I use data? If yes, will I need to treat/clean/subset them?
Will I use code?
Will it be shared? If yes, how? Do I want people to cite me, for exemple?
Will I need to generate manuscripts/reports/figures?
Will it be useful for people to know how to navigate my project? Will I welcome collaborators and contributors?
What is the naming system I will use - for both folders and files?
See an example of a structured project below (adapted from here):
+## /home/awesome-manuscript
+## โโโ .github
+## โโโ .gitignore
+## โโโ .travis.yml
+## โโโ DESCRIPTION
+## โโโ LICENSE.md
+## โโโ R
+## โ โโโ analysis.Rmd
+## โ โโโ local_functions.R
+## โ โโโ package_list.R
+## โโโ README.md
+## โโโ awesome-manuscript.Rproj
+## โโโ data
+## โ โโโ clean
+## โ โโโ raw
+## โ โโโ temp
+## โโโ main-script.Rmd
+## โโโ manuscript
+## โ โโโ sources
+## โ โโโ ecology-letters.csl
+## โ โโโ library.bib
+## โ โโโ packages.bib
+## โ โโโ template.docx
+## โโโ output
+## โ โโโ figures
+## โ โโโ results
+## โ โโโ supp
+## โโโ todo.txt
+Very nice, but the TL;DR version is:
+Consider having a dedicated folder for your data and split them into clean and raw data (alternatively, you can store your cleaned data inside an โoutputโ folder, where other sorts of outputs will also be). If needed, create another folder for โsandbox dataโ - we need to have room for creativity in science! Also make sure to store the metadata in these folders, alongside their respective data, where they belong.
If you will produce reports/manuscripts, maybe itโs a good idea to have a dedicated folder for them too. Store there everything youโll need to render your files, such as bibliography and templates.
Figures should go in their own folder too.
Code usually go in their own folder too, but if the code is about making the project work and putting everything together, it should go in the root.
Your project is so awesome that it needs the coolest names in its folders and files! Good names are informative and consistent. It is a hard exercise, but we do get better with time. The main things to think about when naming your things are:
+Does it describe whatโs inside without being verbose?
Does it allow for correct ordering?
Is it easily searchable (a.k.a., machine readable)? Will my computer crash if I need to change to this directory?
An important part of making your work reproducible by anyone is to share it, and to do that safely, it is important to connect your project to a license. This is a statement about what and how people can use any part of your project. +Chosing a license can be a difficult task at first, but if your projects have a common structure, they should be ok with the same license. When chosing a license, it is important to ask yourself (and your collaborators) the following questions:
+Do we want people to give us credit for our work when this projects is distributed, derived, performed or displayed?
Do we want the derivatives of this project be shared with the same license that we chose?
Are we ok with this project being used for commercial purposes?
A combination of your answers will guide you to find the best license for your project which is adequate for your community. There are a couple of online tools that can help you with that! For example, if you are sharing creative work, you can consult the Creative Commons - Choose a License tool. For other open source software licenses, you can take a look at the Choose A License website. The cool thing is: you can also create your own license! In any case, once you chose the appropriate license for your project, save it in your project root folder with the name โLICENSEโ (as a text file). This way, your version control host system will automatically recognize it and display something like โhey, this project has a license!โ when someone finds your project.
+Take a moment to evaluate your current project design. How would you make it better? If there is something missing (a license, cool names, a good structure), try to implement what youโve learned: one simple thing is enough! Pick one project + one improvement and do it / +You can start even with pen and paper! Scketch whatโs the flow of information inside your project right now. Is there any redundancies? Could a path between righly connected directories be shorter? Could the names of the folders be shorter if they were arranged some other way?
+Need help? Ask a friend to do it with you!
+++Self-care task of the day
+YouTube is full of people making their own version of their favorite songs. The self-care task of the day is to pick one song and look for versions of it on YouTube. Maybe start looking for you favorite song. What are the differences between the versions? Which one did you like the most? Have you discovered a cool artist because of this search? If you couldnโt find a cool version of your favorite song, take a moment to imagine how your own version would sound like.
+

A version control system allows changes made to a file to be recorded in a timeline, and it is possible to retrieve previous versions at any time.
+This is possible because with version control you donโt save copies of your work, but its history, avoiding things like this in your working directory:
+- project/
+ |- scripts/
+ |- script-v0.1.R
+ |- script-after-review-from-Princess-Lea.R
+ |- script-merged.R
+ |- script-not-working-anymore.R
+ |- script-wtf.R
+Git is a distributed version control system, which means the snapshots of your work are stored in your local drive, but also can be distributed from the cloud to other developers.
+The basic architecture we have to deal with is composed of a branches (including one weโll call โmainโ, but is sometimes called โmasterโ), clones and forks.
+
The main is the primary timeline of your repository (a project with the files required to develop it). There the files will ideally only be changed when strictly necessary, i.e.ย when a change is critical to the progress of the project.
A branch
is a ramification from any other timeline. It is like a copy repository within the main repository, which is created to test changes that may or may not be implemented in the main timeline. Ideally, each developer creates a branch to test the changes they deem necessary and submit these changes to their colleaguesโ judgment before implementing them in the main.
Repositories can be created online and many things can be done there. However, in order to work locally on a repository, i.e.ย to work offline, we need to create a clone of the repository we have online. A clone is a synchronised copy of your online repository. Everything you do in your local working directory (corresponding to the clone) will be synchronized with the online repository.
+In turn, forks
are complete, independent copies of a repository. We use a fork (not a clone) when we want to change the direction of the project, or when we want to contribute to someone elseโs project independently and only then suggest changes to the original project. If you need to update your fork with the newest version of the project, you can do that by requesting a fetch to Git.
When we change some file and save the new version, we do a commit
. Commits should be accompanied by short but sufficiently descriptive comments, so that you can understand what the difference in that version is and locate it more easily. With commits you can track what change was made, where, by whom and when.
+
+After changing a file and saving the new version, this version needs to be given a tag (an identification code), and then uploaded to the online repository. We call this a push. To update your local directory with the newest versions of files, you must tell Git to pull them.
+When working on a branch, you can request that the changes you have made be implemented in the main branch of your workflow (or any other branch). To do this you request a merge via a pull request
. In a pull request, you ask a repository owner or contributor to accept the changes you made to a fork or branch into another branch. If they accept, you are listed as a contributor to the project.
The online portal of your Git server allows you to do most of the tasks described above in a very intuitive way. You can edit some files, upload others, request a merge, create and delete a branch, etc. Once you know the Git logic and architecture, it is easy to work online.
+For a detailed walkthrough, take a look at this page.
However, the changes we need to make cannot always be done directly in the portal, or would be done more efficiently if we worked on our computer, with our preferred software. To work on your repository from your computer, you only need to install Git itself (https://git-scm.com/downloads). Some softwares allow you to visualize the timeline and operations being made, such as GitKraken (https://www.gitkraken.com/) and some extentions for VSCode and RStudio.
+Once youโve installed Git, the there are two possible ways to start:
+You can create your online repository directly on your Git host server (such as GitHub, GitLab or Bitbucket);
Or you can โtransformโ a local directory into a Git controlled project.
In the first case, to have a copy of your online repository on your computer, just clone your directory, either by downloading all the files in a .zip or by copying the ssh key or html address to use in a Git command.
+
You can also clone from GitKraken, by clicking on the little folder on the top left corner or on โFileโ on the menu.
+
In the second case, you must right-click on your workbook and open the Git Bash; alternatively, in GitKraken, you can click on โInitโ in the same window shown above and indicate the directory of your workbook in โNew repository pathโ.
+The following commands will give us an idea of a workflow in Git.
+To use Git, you need to configure it so that your account on your Git server is recognised by it. In Git Bash:
+git config --global user.name "username"
+git config --global user.email "iamawesome@email.com"
+git config --list #Confirm your settingsThere, now Git knows who you are.
+
To start a repository from your computer, you can tell Git to start or โwatchโ a folder.
+First, check what the working directory is and change it if necessary.
pwd # prints the working directory
+cd # takes you to the root
+cd .. # takes you to one level up directory
+cd "your/directory" # changes your working directoryTo clone your repository, copy the url as shown in the picture above and ask Git to clone the repository into the directory you indicated.
+git clone https://github.com/graciellehigino/bios2.github.io.gitThe above command will create a folder with the same name as the repository in your working directory. If you want the folder created to have another name, include that after the repository address. This process works if you have an online repository and want it to exist on your computer. You can also do it the other way round. If you have not yet created a folder for your project, you can ask Git to create one for you:
+mkdir "web-repo-github"But if you already have a folder and want Git to โwatch overโ it, start a local repository in the directory indicated:
+git initYou can (maybe you need to) tell Git where your remote repository is:
+git remote add origin https://github.com/graciellehigino/bios2.github.io.gitOk, now your repository is ready to use.
+Check if there are new files in your folder or modified files that havenโt been pushed yet:
git statusHey, couldnโt you find an important file? Add it to the Git vision field now!
+git add file # adds a file
+
+git add -u # updates the file tracking
+
+git add -A # all the aboveTo make additions interactively via the terminal, use:
+git add -iFollow the instructions provided by the terminal and include as many files as you want before committing.
+Now that Git is keeping an eye on all your files, any changes you make (and want them to be recorded in this fileโs timeline) will be detected. To make sure your changes are recorded, โcommitโ the changed file with a comment so you can remember what the difference is in that version.
+git commit -m "it's awesome now"A commit only updates the local repository if you are working locally, or the remote repository if you are working remotely. To synchronize the two repositories, you must either push updates to the remote repository or pull updates to the local repository.
git push origin master
+#"Git, please take the updated files to the remote repository 'origin', on the 'main' branch."
+
+git pull
+#"Git, please bring the updated files from the remote repository to my local repository"Check the changes in the content of the files (e.g.ย new lines added):
+git diffCheck the files and their changes that are in the stage area:
+git diff --stagedIf you are lost between the different versions of your files, check the commit history! :)
+git log # history of project commits since the beginning
+git log -p # detailed historic of commits (i.e. git log + git diff)Depending on the size of the changes, the log may be very large and you will need to press โreturnโ to each page to see all the changes. At the end you will see (END), then press the letter โqโ to finish reading.
+If you only want to check the latest commits, limit the list with git log -p -1 (replace the 1 with the number of commits you wish to see). You can also check out the entire change history of the working directories with the Git viewer with gitk. Isnโt that cool!
Branches are ramifications of other timelines. They are very useful when you need to test or work on large changes without changing what is on the main branch. It is very important to maintain branches in your collaborative work, because it reduces the chance of the main branch suffering accidental major changes and simplifies the management of file versions.
+git show-branch -a # lists all branches
+
+git branch name_of_branch # creates a new branch
+
+git checkout name_of_branch # transfers the workspace to the new branch
+
+git checkout -b name_of_branch # creates a branch and transfers the workspaceWhen all the changes you have made to your branch are done and you think it is time to merge them into the main (or any other branch), move to the target branch and request a merge:
git merge new_branch # merges the changes from 'new_branch' to 'main'If you no longer need the branch and want to delete it, use the git branch -d new_branch command.
+It can often happen that your working branch is not up to date with the main. This can be a problem if the main has important updates for the development of your project on the branch. To bring the main updates to your branch, follow these steps:
+1. Check if your workspace is on the main branch. If not, transfer it:
git checkout mastermain, update your local directory:git pullmain updates into your branch and upload to the remote repository:git checkout your-branch
+git merge main your-branch
+git pushThatโs it! Now your branch contains everything that was new in the main. :)
Did you mess up commits? Want to revert a change? Donโt despair!
+If you made a commit and regret it, but donโt even remember which commit it was (โFind out commits associated for a specific fileโ):
git log -p filename`If you want to include new edits to the last commit, replacing it:
+git commit --amend -m "message"If you want to remove any file from the stage area after a git add .:
git reset HEAD new_file.RBut if you want to remove it from your working tree and the set of added files:
+git rm new_file.RIf all that goes wrong, try the following (tips taken from here):
+git revert --no-commit <commit hash> # Revert, but don't commit yet
+git reset # Take everything from the stage area
+git add yourFilesToRevert # Add files to revert
+git commit -m "commit message"
+git reset --hard # Undo changes not commitedIf you want to remove all local changes and commits, retrieve the most recent history from the server and point to your local branch main like this:
git fetch origin
+git reset --hard origin/masterThatโs it! Thereโs a lot more in the git world, but I hope this guide can help you on your version control journey.
+Remember: keep the main as untouched as possible, work with branches to test your ideas, and always push your modifications before going to bed.
Set up the tracking system in your project! Create a remote repository and connect it with your local directory. If you already use a version control system, review your workflow both when working alone and in collaboration: what are the actions most likely to cause a problem? Can you make it simpler?
+++hint: make a colorful and friendly sketch of your current workflow!
+
++Self-care task of the day
+What is your favorite food? Do you have a story of a special meal prepared by a loved one? The self-care task of the day is to call someone you love and ask them to explain how to prepare a special meal: one that you really like or one of their favorites. If youโre feeling adventurous, try to reproduce it before the next task tomorrow!
+
Today is the day to make your future-self thank you! We will go through some tips and tricks to make your code more friendly, surviving the test of time and of your own memory.
+A reproducible code is an essential part of a reproducible project. Having a code to reproduce your analysis is already a great start, congrats for that! :crown:
+Today weโll try to go a step forward and write a love letter for your future-self by adding comments on your code, rethinking about object names, investigate how we can compile chuncks of code inside functions and, finally, think about reproducible manuscripts. +### Style +There are no right or wrong when it comes to style: there are best-practices and what works better for you or your project.
+For example, Google has a series of style guides they use to standardize code writing in the company. There is a Googleโs R Style Guide and a tydiverse style guide which can be a good inspiration to find your own. Hereโs an idea: create a document whre you usually store code. List all conventions you use and have never thought about why you use them and reflect if they still make sense for you. If they do, keep them. If they donโt, try to improve them. Is there any other thing you never thought it was important, but it could be? Do you have a convention for function names, for example?
+Object names
+Object names are the major source of wasted time for me, especially when the code is already super long with numerous objects. What helps is to know they should be descriptive, yet concise. A good tip is to name objects as nouns and functions as verbs.
++What do you think is important when naming objects in the languages that you use? Take 5 mins to write a list!
+
Another good practice is to always comment your code. It will help you understand the decisions youโve made throughout this process, thatโs why a good tip is to write simple comments that state why you wrote that line of code. What do you think of buying a friend a coffee and ask them to review your code annotation? Maybe you can make some lines clearer while hanging out in a park!
+In a larger scale, it is important to have other kinds of notes: session info (e.g., in R you can use the command sessionInfo()), package versions (e.g., using the checkpoint package), dependencies and connections between code scripts and data files. A good example of documentation is this README file written by our colleague Gabriel Dansereau: it contains clear instructions of how to use the code, how the respsitory is organized and even notes on possible warnings and what they mean.
It can be complicated to keep track of everything everyday, so hereโs a tip: schedule a day in your month (or week) to update the documentation of your project! People call it โdocumentation dayโ out there, and youโll find lots of blogposts about it online.
+Functions can help you keep your code cleaner and avoid errors when you repeat actions. They should replace redundancies in your code. In the same way, when you notice you have to repeat a certain routine in many of your projects, it might be worth writing a package - which is basically a set of functions. When you do that, donโt forget to include in your functions some commands that check for errors, like when you try to use a type of variable that is not compatible with the analysis that run inside the function.
+++Take a few minutes to have a look at your code now. Can you see something that could be a function?
+
From reproducible code to reproducible manuscripts is one small leap! It means your manuscript is readable across platforms and systems, and can be compiled locally, and even be automatically updated if your data or analyses change! +It doesnโt mean that the interpretation of the results will be automatically updated aswell - which seems to be a concern for some people, that argue that reproducible manuscripts turn the science activity into a mechanic thing. On the contrary: it allows you to not worry about making figures over and over again, and concentrate in the philosophical part of your science!
+There are three basic things we need to understand to produce a reproducible academic manuscript: the YAML, the markup language (such as Markdown) and the citation/references management.
+YAML (YAML Ainโt a Markup Language - metalingustics!) is a language that defines the metadata of your document and helps in the compiling process. It tells your computer if the output you need is a *.pdf or a *.doc file, for example. A YAML block will be the first thing youโll add on your document, and the only tricky thing is to get the indentation right.
For example, the YAML of this very webpage looks like this:
+---
+title: "(un)Reproducibility Detox"
+description: |
+ A seven-day detox routine to improve the reproducibility of your projects!
+author: Gracielle Higino
+preview: thumb.png
+categories:
+ - Technical
+ - EN
+date: 06-13-2021
+output:
+ distill::distill_article:
+ self_contained: false
+ toc: true
+---You should add to your manuscript a bibliography argument with the path to your *.bib file and change the output according to your needs. If you use RStudio, these things are easier to change as it has built-in templates with pre-filled YAML header.
Another cool thing to add in your YAML header is a reference to a template. This will make your computer compile your manuscript in the same format as your template - which helps a lot when you submit the manuscript to a journal.
+A couple of packages can help you put together all these pieces. The rticles package imports LaTeX templates from scientific journals and implements a dialog box in RStudio. The rmdTemplates package has also slides, Word and PDF templates. It helps a lot starting with a template and fill in the blanks![=
A very complete introduction to R Markdown is provided by RStudio here (also make sure to consult the R Markdown Cheat Sheet). This basic syntax is the same used in Markdown and other similar markup languages. For example:
+**this is bold** -> this is bold
+*this is italic* -> this is italic
|this|is|a|table|
+|:---|:---:|---:||
+|a|table|this|is|| +this + | ++is + | ++a + | ++table + | +
|---|---|---|---|
| +a + | ++table + | ++this + | ++is + | +
A good idea is to keep an up-to-date text file containing all your bibliography that can be referenced in your manuscript. For example, you can ask your reference manager software to generate a *.bib file, which usually contains a specific tag for each citation. This tag will then be used in your file as something like [@TagPaper].
The citation style, on the other hand, is usually defined by a *.csl file (https://citationstyles.org/). These files can be found, for example, on the Zotero Style Repository, and all you need to do is download the file and keep in in the same directory as your manuscript.
Can you โtransformโ one of your manuscripts into a reproducible file? What are the steps you need to take to get there?
+Do you already have all your manuscripts in a reproducible format? Congratulations! Your task will be to help a friend that is learning how to make one!
+Methods in Ecology and Evolution blog post with tips and tricks for reproducible code
YAML front matter, in the โpapaja: Reproducible APA manuscripts with R Markdownโ
++Self-care task of the day
+Itโs time to update all those packages (and maybe even language version) - you deserve to be able to play with the newest toys on the block. While all this is happening in the background put your feet up and hit play on the TV or podcast series youโve been meaning to catch up on.
+
So youโve commented, documented, and shared your code meaning that itโs ready to be used by the rest of the world, right? Well maybe for now but you know what they say about time - all hours wound; the last one kills. Okay so it might not be that dramatic but there is of course the problem that as time progresses our code becomes out-dated and (worst case scenario) non-functional. Programming languages (and packages) are continually evolving as developers work at squashing bugs and making performance upgrades. Sometimes these upgrades might result in a fundamental change in how the a language or package functions e.g. a function name might change or some functionality will be removed in favour of another. This means that in a few years that beautifully documented chunk of code that weโve written today might not even run.
+Oh dearโฆ
+
What this boils down to is that we need to not only think about documenting the code itself but also all the โbackendโ features that make it tick i.e. not only what packages weโre using but also what version. This can also extend to language and operating system (OS) type or version used.
+Although this may seem daunting itโs important to remember that the journey to
+reproducibility is much like how one approaches eating an elephant - we take
+it one bite at a time. So donโt be afraid to take a little nibble before biting off more than you can chew.
The good news is that there is a lot of functionality out there to help us on our reproducibility journey. Different languages have different ways we can document and โkeepโ the package version that we are using. The main focus will be using R as it is the current lingua franca of most ecologists and it also straddles the middle ground between being very โpickyโ like python and literally having a built in system like Julia.
The big (language agnostic) take home message here though is that itโs important to (at minimum) keep record of the versions of things you used if you want your work to work a few months/years down the line. By keeping a record of the package, software and OS versions used we give other users (and our future selves) a chance to recreate the environment that allowed our project/code to run should things change or be updated.
+The three main approaches and packages I will discuss are {groundhog}, {renv} and, docker. There are of course other ways to document package versions but these are (somewhat user friendly) and will give you different โlevelsโ of reproducibility. It is of course also possible to mix and match these different platforms.
{groundhog}{groundhog} is a relatively new kid on the block -and apparently refers to a film of the same name (no comment on my side as this is a facet of pop culture the eludes me). This is a super easy package to implement (think one function easy) and is a really nice way to โretrofitโ some of your older code.
How it works: Essentially {groundhog} will install the version of a package that was available on CRAN for a specified date. This is done by โreplacingโ the library("package") with groundhog.library("package", date). This means its easy to go back and set a more suitable date for your script e.g.ย maybe the date it was created or last time it was saved.
# a mini example
+install.packages("groundhog")
+library("groundhog")
+groundhog.library("tidyverse", "2018-07-07")
+
+# you can also call multiple packages
+pkgs <- c("tidyverse","ggforce")
+groundhog.library(pkgs, "2018-07-07")
+
+# working with an 'active' script
+library(groundhog)
+groundhog.day = "2021-07-07"
+groundhog.library(pkgs, groundhog.day)
+Limitations: Although {groundhog} will call the correct/desired packages version there is of course the potential problem that that package version is no longer compatible with the version of R that youโre running on your machine โ this means you might have to have multiple version of R on you machine and have to switch between them depending on what project youโre using. Another issue could arise when retrofitting your workflow. Although you might have a starting date/groundhog day you might not have been using the most up-to-date version available at that date - so you would be retrieving the wrong version.
Pros: To end on a positive note though - {groundhog} is at least a solid starting point for documenting package version and its very easy to implement, especially if you are retrofitting your code.
+{renv}As highlighted above one of the potential issues with {groundhog} is that you might run into language version incompatibility - and by extension still have non-working code (bleak). Enter {renv}, a handy-dandy, easy to use, dependency management package for your projects. {renv} records both R and package versions through a series of user called functions. This is very similar to Julia where all packages are โstoredโ in Project.toml. {renv} works by crawling through your project directory and recording package version and dependencies in use. This is then saved in the renv.lock file and is used to โloadโ the project state further down the line.
How it works: The bare bones overview is that you 1) initialise the project-local environment using renv::init(), 2) continue tinkering as you go, 3) call renv::snapshot() to update renv.lock with any new additions, and 4) if things broke along the way you can call renv::restore() to revert back to the previous project state you had saved in your lock file (which hopefully did run).
Limitations: One limitation is that {renv} relies on you saving a currently working/functioning state (if you want recall it and have it to work in the future). This makes it a bit tricky to try and quickly โfixโ old code - something that {groundhog} is probably more suited for, whereas {renv} is a solid choice when starting a new project form scratch.
Pros: {renv} saves both package and R versions - which is great as it โdoubles downโ on having things work in harmony. It is also very easy to use - once again you can get away by using a few lines of code.
Docker, a term that can strike trepidation in even some of the most hardened of researchers (although they have the cutest whale as a logo and that 100% drops the scary factor if you as me). Briefly Docker is a program that allows you to host different mini computers on your computer. This of course means its not just an R-specific tool but one that could probably cover a lot of reproducibility bases for most languages. But there is a reason this is last on the list and that is because it takes a bit more work to implement. So think of this as a long-term project/goal to set yourself up for.
+How it works: As I said earlier with Docker you can run multiple mini computers (containers) built from an โimageโ of your machine (the host). The catch though - you need to build the image from scratch from OS all the way through to you specific script/code chunk. These build instructions are contained in a Dockerfile - which you save in your working directory. Inside this file is the โrecipeโ for building your image (and spoiler alert it looks a lot like a series of command line calls). Colin Fay wrote this really nice blog about using docker and R for beginners. If your interested I suggest starting there! Alternatively {renv} also plays well with Docker - have a look at this vignette
Limitations: In the context of what has been discussed in this post Docker is hard yo! In order to write a Docker file you will benefit a lot from being comfortable using and thinking of things in terms of command line. Since you are โcreatingโ you mini computer you need to install a lot of moving parts and components. This means you might be moving from your comfort zone when it comes to programming and could put you off trying the whole reproducibility thing all together. So set realistic expectations here and donโt be too hard on yourself!
+Pros: Docker is very flexible! You can build your mini computer to your specifications and keep your โnormal computerโ intact. For example if I am running MacOS, R 3.5 on my normal computer but can build an image that runs Linux and R 3.1. Also because the recipe is contained in the Dockerfile anyone can build the image for that project on their machine and have it all โjustโ work (avoiding the whole โbut it works on my machineโ scenario).
If you want to keep your project pipeline working in the long-term it is important to account for the fact that languages are evolving - which means the scaffold on which your code rests also needs to be documented in some way. That being said asking yourself as to how paramount the longevity of your project is a good way to identify and allocate resources to documenting and accommodating for this. For smaller projects you could probably get away with a simple documentation process e.g.ย Juliaโs Project.toml system or {renv} for R. But if the longevity of the project is of high importance itโs probably recommended to give something like Docker a try.
First sit down and think about your project and how important longevity is. Do future generations depend on your code being able to run and execute tasks flawlessly? Or it it more important that the workflow is well documented and understood i.e. it could be easily be โtranslatedโ to the shiny new programming language people are using?
+Pick and choose the task(s) that you want to take on (or remix one of them)
+Open one of the older projects on you computer. Does the code run? If no see if you can retrofit it using {groundhog}
Open the (or one of many) project you are currently working on and run renv::init() and see what happens
Install Docker and work through Colin Fayโs tutorial

Documentation for {groundhog}
Documentation for {renv}
++Self-care task of the day
+
++Self-care task of the day
+
`,e.githubCompareUpdatesUrl&&(t+=`View all changes to this article since it was first published.`),t+=` + If you see mistakes or want to suggest changes, please create an issue on GitHub.
+ `);const n=e.journal;return'undefined'!=typeof n&&'Distill'===n.title&&(t+=` +Diagrams and text are licensed under Creative Commons Attribution CC-BY 4.0 with the source available on GitHub, unless noted otherwise. The figures that have been reused from other sources donโt fall under this license and can be recognized by a note in their caption: โFigure from โฆโ.
+ `),'undefined'!=typeof e.publishedDate&&(t+=` +For attribution in academic contexts, please cite this work as
+${e.concatenatedAuthors}, "${e.title}", Distill, ${e.publishedYear}.
+ BibTeX citation
+${m(e)}
+ `),t}var An=Math.sqrt,En=Math.atan2,Dn=Math.sin,Mn=Math.cos,On=Math.PI,Un=Math.abs,In=Math.pow,Nn=Math.LN10,jn=Math.log,Rn=Math.max,qn=Math.ceil,Fn=Math.floor,Pn=Math.round,Hn=Math.min;const zn=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],Bn=['Jan.','Feb.','March','April','May','June','July','Aug.','Sept.','Oct.','Nov.','Dec.'],Wn=(e)=>10>e?'0'+e:e,Vn=function(e){const t=zn[e.getDay()].substring(0,3),n=Wn(e.getDate()),i=Bn[e.getMonth()].substring(0,3),a=e.getFullYear().toString(),d=e.getUTCHours().toString(),r=e.getUTCMinutes().toString(),o=e.getUTCSeconds().toString();return`${t}, ${n} ${i} ${a} ${d}:${r}:${o} Z`},$n=function(e){const t=Array.from(e).reduce((e,[t,n])=>Object.assign(e,{[t]:n}),{});return t},Jn=function(e){const t=new Map;for(var n in e)e.hasOwnProperty(n)&&t.set(n,e[n]);return t};class Qn{constructor(e){this.name=e.author,this.personalURL=e.authorURL,this.affiliation=e.affiliation,this.affiliationURL=e.affiliationURL,this.affiliations=e.affiliations||[]}get firstName(){const e=this.name.split(' ');return e.slice(0,e.length-1).join(' ')}get lastName(){const e=this.name.split(' ');return e[e.length-1]}}class Gn{constructor(){this.title='unnamed article',this.description='',this.authors=[],this.bibliography=new Map,this.bibliographyParsed=!1,this.citations=[],this.citationsCollected=!1,this.journal={},this.katex={},this.publishedDate=void 0}set url(e){this._url=e}get url(){if(this._url)return this._url;return this.distillPath&&this.journal.url?this.journal.url+'/'+this.distillPath:this.journal.url?this.journal.url:void 0}get githubUrl(){return this.githubPath?'https://github.com/'+this.githubPath:void 0}set previewURL(e){this._previewURL=e}get previewURL(){return this._previewURL?this._previewURL:this.url+'/thumbnail.jpg'}get publishedDateRFC(){return Vn(this.publishedDate)}get updatedDateRFC(){return Vn(this.updatedDate)}get publishedYear(){return this.publishedDate.getFullYear()}get publishedMonth(){return Bn[this.publishedDate.getMonth()]}get publishedDay(){return this.publishedDate.getDate()}get publishedMonthPadded(){return Wn(this.publishedDate.getMonth()+1)}get publishedDayPadded(){return Wn(this.publishedDate.getDate())}get publishedISODateOnly(){return this.publishedDate.toISOString().split('T')[0]}get volume(){const e=this.publishedYear-2015;if(1>e)throw new Error('Invalid publish date detected during computing volume');return e}get issue(){return this.publishedDate.getMonth()+1}get concatenatedAuthors(){if(2 tag. We found the following text: '+t);const n=document.createElement('span');n.innerHTML=e.nodeValue,e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e)}}}}).observe(this,{childList:!0})}}var Ti='undefined'==typeof window?'undefined'==typeof global?'undefined'==typeof self?{}:self:global:window,_i=f(function(e,t){(function(e){function t(){this.months=['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec'],this.notKey=[',','{','}',' ','='],this.pos=0,this.input='',this.entries=[],this.currentEntry='',this.setInput=function(e){this.input=e},this.getEntries=function(){return this.entries},this.isWhitespace=function(e){return' '==e||'\r'==e||'\t'==e||'\n'==e},this.match=function(e,t){if((void 0==t||null==t)&&(t=!0),this.skipWhitespace(t),this.input.substring(this.pos,this.pos+e.length)==e)this.pos+=e.length;else throw'Token mismatch, expected '+e+', found '+this.input.substring(this.pos);this.skipWhitespace(t)},this.tryMatch=function(e,t){return(void 0==t||null==t)&&(t=!0),this.skipWhitespace(t),this.input.substring(this.pos,this.pos+e.length)==e},this.matchAt=function(){for(;this.input.length>this.pos&&'@'!=this.input[this.pos];)this.pos++;return!('@'!=this.input[this.pos])},this.skipWhitespace=function(e){for(;this.isWhitespace(this.input[this.pos]);)this.pos++;if('%'==this.input[this.pos]&&!0==e){for(;'\n'!=this.input[this.pos];)this.pos++;this.skipWhitespace(e)}},this.value_braces=function(){var e=0;this.match('{',!1);for(var t=this.pos,n=!1;;){if(!n)if('}'==this.input[this.pos]){if(0 =k&&(++x,i=k);if(d[x]instanceof n||d[T-1].greedy)continue;w=T-x,y=e.slice(i,k),v.index-=i}if(v){g&&(h=v[1].length);var S=v.index+h,v=v[0].slice(h),C=S+v.length,_=y.slice(0,S),L=y.slice(C),A=[x,w];_&&A.push(_);var E=new n(o,u?a.tokenize(v,u):v,b,v,f);A.push(E),L&&A.push(L),Array.prototype.splice.apply(d,A)}}}}}return d},hooks:{all:{},add:function(e,t){var n=a.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=a.hooks.all[e];if(n&&n.length)for(var d,r=0;d=n[r++];)d(t)}}},i=a.Token=function(e,t,n,i,a){this.type=e,this.content=t,this.alias=n,this.length=0|(i||'').length,this.greedy=!!a};if(i.stringify=function(e,t,n){if('string'==typeof e)return e;if('Array'===a.util.type(e))return e.map(function(n){return i.stringify(n,t,e)}).join('');var d={type:e.type,content:i.stringify(e.content,t,n),tag:'span',classes:['token',e.type],attributes:{},language:t,parent:n};if('comment'==d.type&&(d.attributes.spellcheck='true'),e.alias){var r='Array'===a.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(d.classes,r)}a.hooks.run('wrap',d);var l=Object.keys(d.attributes).map(function(e){return e+'="'+(d.attributes[e]||'').replace(/"/g,'"')+'"'}).join(' ');return'<'+d.tag+' class="'+d.classes.join(' ')+'"'+(l?' '+l:'')+'>'+d.content+''+d.tag+'>'},!t.document)return t.addEventListener?(t.addEventListener('message',function(e){var n=JSON.parse(e.data),i=n.language,d=n.code,r=n.immediateClose;t.postMessage(a.highlight(d,a.languages[i],i)),r&&t.close()},!1),t.Prism):t.Prism;var d=document.currentScript||[].slice.call(document.getElementsByTagName('script')).pop();return d&&(a.filename=d.src,document.addEventListener&&!d.hasAttribute('data-manual')&&('loading'===document.readyState?document.addEventListener('DOMContentLoaded',a.highlightAll):window.requestAnimationFrame?window.requestAnimationFrame(a.highlightAll):window.setTimeout(a.highlightAll,16))),t.Prism}();e.exports&&(e.exports=n),'undefined'!=typeof Ti&&(Ti.Prism=n),n.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/?[\da-z]{1,8};/i},n.hooks.add('wrap',function(e){'entity'===e.type&&(e.attributes.title=e.content.replace(/&/,'&'))}),n.languages.xml=n.languages.markup,n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},n.languages.css.atrule.inside.rest=n.util.clone(n.languages.css),n.languages.markup&&(n.languages.insertBefore('markup','tag',{style:{pattern:/(
+
+
+ ${e.map(l).map((e)=>`
`)}}const Mi=`
+d-citation-list {
+ contain: layout style;
+}
+
+d-citation-list .references {
+ grid-column: text;
+}
+
+d-citation-list .references .title {
+ font-weight: 500;
+}
+`;class Oi extends HTMLElement{static get is(){return'd-citation-list'}connectedCallback(){this.hasAttribute('distill-prerendered')||(this.style.display='none')}set citations(e){x(this,e)}}var Ui=f(function(e){var t='undefined'==typeof window?'undefined'!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}:window,n=function(){var e=/\blang(?:uage)?-(\w+)\b/i,n=0,a=t.Prism={util:{encode:function(e){return e instanceof i?new i(e.type,a.util.encode(e.content),e.alias):'Array'===a.util.type(e)?e.map(a.util.encode):e.replace(/&/g,'&').replace(/e.length)break tokenloop;if(!(y instanceof n)){c.lastIndex=0;var v=c.exec(y),w=1;if(!v&&f&&x!=d.length-1){if(c.lastIndex=i,v=c.exec(e),!v)break;for(var S=v.index+(g?v[1].length:0),C=v.index+v[0].length,T=x,k=i,p=d.length;T
+
+`);class Ni extends ei(Ii(HTMLElement)){renderContent(){if(this.languageName=this.getAttribute('language'),!this.languageName)return void console.warn('You need to provide a language attribute to your Footnotes
+
+`,!1);class Fi extends qi(HTMLElement){connectedCallback(){super.connectedCallback(),this.list=this.root.querySelector('ol'),this.root.style.display='none'}set footnotes(e){if(this.list.innerHTML='',e.length){this.root.style.display='';for(const t of e){const e=document.createElement('li');e.id=t.id+'-listing',e.innerHTML=t.innerHTML;const n=document.createElement('a');n.setAttribute('class','footnote-backlink'),n.textContent='[\u21A9]',n.href='#'+t.id,e.appendChild(n),this.list.appendChild(e)}}else this.root.style.display='none'}}const Pi=ti('d-hover-box',`
+
+
+
a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h
","
"],tr:[2,"","
"],col:[2,"
"],td:[3,"
"],_default:k.htmlSerialize?[0,"",""]:[1,"X"," "!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1>$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="
a",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="
",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){
+return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();ct a",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("