├── .gitignore ├── LICENSE ├── README.md ├── build ├── react-dom.min.js └── react.min.js ├── examples ├── README.md ├── ballmer-peak │ ├── ballmer_peak.png │ ├── example.js │ └── index.html ├── basic-commonjs │ ├── README.md │ ├── index.html │ ├── index.js │ └── package.json ├── basic-jsx-external │ ├── example.js │ └── index.html ├── basic-jsx-harmony │ └── index.html ├── basic-jsx-precompile │ ├── example.js │ └── index.html ├── basic-jsx │ └── index.html ├── basic │ └── index.html ├── jquery-bootstrap │ ├── css │ │ └── example.css │ ├── index.html │ ├── js │ │ └── app.js │ └── thirdparty │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.js ├── jquery-mobile │ ├── README.md │ ├── index.html │ └── js │ │ └── app.js ├── requirejs │ └── build │ │ ├── app.js │ │ └── example-component.js ├── server-rendering │ ├── README.md │ ├── jsapp │ │ ├── package.json │ │ └── src │ │ │ └── App.js │ ├── reactserver │ │ ├── package.json │ │ └── server.js │ └── webapp │ │ ├── index.php │ │ └── static │ │ └── bundle.js ├── shared │ ├── css │ │ └── base.css │ └── thirdparty │ │ ├── console-polyfill.js │ │ ├── es5-sham.min.js │ │ ├── es5-shim.min.js │ │ └── jquery.min.js └── transitions │ ├── index.html │ └── transition.css ├── hello_world.R ├── react-0.12.2.Rproj ├── react_tutorial_in_R.Rproj ├── tutorial1.R ├── tutorial10.R ├── tutorial11.R ├── tutorial12.R ├── tutorial13.R ├── tutorial14.R ├── tutorial2.R ├── tutorial3.R ├── tutorial4.R ├── tutorial5.R ├── tutorial6.R ├── tutorial7.R ├── tutorial8.R └── tutorial9.R /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | ======= 5 | # History files 6 | .Rhistory 7 | 8 | # Example code in package build process 9 | *-Ex.R 10 | 11 | # R data files from past sessions 12 | .Rdata 13 | 14 | # RStudio files 15 | .Rproj.user/ 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | React is [BSD licensed](https://github.com/facebook/react/blob/master/LICENSE). We also provide an additional [patent grant](https://github.com/facebook/react/blob/master/PATENTS). 2 | 3 | React documentation is [Creative Commons licensed](https://github.com/facebook/react/blob/master/LICENSE-docs). 4 | 5 | Examples provided in this repository and in the documentation are [separately licensed](https://github.com/facebook/react/blob/master/LICENSE-examples). 6 | 7 | 8 | For the bits/pieces/translations to R, The MIT License (MIT) applies. 9 | 10 | Copyright (c) 2015 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy 13 | of this software and associated documentation files (the "Software"), to deal 14 | in the Software without restriction, including without limitation the rights 15 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16 | copies of the Software, and to permit persons to whom the Software is 17 | furnished to do so, subject to the following conditions: 18 | 19 | The above copyright notice and this permission notice shall be included in all 20 | copies or substantial portions of the Software. 21 | 22 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 23 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 24 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 25 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 26 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 27 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 28 | SOFTWARE. 29 | 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## React Tutorial in R with htmltools 2 | 3 | Complete the tutorial [Learn how to use React in your own project.](http://facebook.github.io/react/docs/getting-started.html) in R using the [`htmltools`](https://github.com/rstudio/htmltools) package. Please note that most of this is copied and pasted from the tutorial, so nearly all attribution belongs to the original authors from the Facebook React Team and is [BSD licensed](./LICENSE). Content regarding licensing has been retained below. For the tiny bits/pieces/translations that I have added, the [MIT license](./LICENSE) applies. 4 | 5 | 6 | ## Original Important Contents of Facebook Readme.md 7 | ### License 8 | 9 | React is [BSD licensed](https://github.com/facebook/react/blob/master/LICENSE). We also provide an additional [patent grant](https://github.com/facebook/react/blob/master/PATENTS). 10 | 11 | React documentation is [Creative Commons licensed](https://github.com/facebook/react/blob/master/LICENSE-docs). 12 | 13 | Examples provided in this repository and in the documentation are [separately licensed](https://github.com/facebook/react/blob/master/LICENSE-examples). 14 | 15 | -------------------------------------------------------------------------------- /build/react-dom.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * ReactDOM v0.14.8 3 | * 4 | * Copyright 2013-2015, Facebook, Inc. 5 | * All rights reserved. 6 | * 7 | * This source code is licensed under the BSD-style license found in the 8 | * LICENSE file in the root directory of this source tree. An additional grant 9 | * of patent rights can be found in the PATENTS file in the same directory. 10 | * 11 | */ 12 | !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e(require("react"));else if("function"==typeof define&&define.amd)define(["react"],e);else{var f;f="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,f.ReactDOM=e(f.React)}}(function(e){return e.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED}); -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # React Examples 2 | 3 | Here are some small React demos. Some use [JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) and some include third-party library integration. 4 | 5 | For more fully-featured examples, check out [React TodoMVC](http://todomvc.com/architecture-examples/react/) and [React + Backbone TodoMVC](http://todomvc.com/labs/architecture-examples/react-backbone/). 6 | -------------------------------------------------------------------------------- /examples/ballmer-peak/ballmer_peak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timelyportfolio/react_tutorial_in_R/5a45b5d65246e6c3d05ed94bea43ac743f0a2917/examples/ballmer-peak/ballmer_peak.png -------------------------------------------------------------------------------- /examples/ballmer-peak/example.js: -------------------------------------------------------------------------------- 1 | function computeBallmerPeak(x) { 2 | // see: http://ask.metafilter.com/76859/Make-a-function-of-this-graph-Thats-like-an-antigraph 3 | x = x * 100; 4 | return ( 5 | 1-1/(1+Math.exp(-(x-6)))*.5 + Math.exp(-Math.pow(Math.abs(x-10), 2)*10) 6 | ) / 1.6; 7 | } 8 | 9 | function percentage(x) { 10 | return isNaN(x) ? 'N/A' : (100 - Math.round(x * 100)) + '%'; 11 | } 12 | 13 | var BallmerPeakCalculator = React.createClass({ 14 | getInitialState: function() { 15 | return {bac: 0}; 16 | }, 17 | handleChange: function(event) { 18 | this.setState({bac: event.target.value}); 19 | }, 20 | render: function() { 21 | var pct = percentage(computeBallmerPeak(this.state.bac)); 22 | return ( 23 |
24 | 25 |

Credit due to xkcd.

26 |

Compute your Ballmer Peak:

27 |

28 | If your BAC is{' '} 29 | 30 | {', '}then {pct} of your lines of code will be bug free. 31 |

32 |
33 | ); 34 | } 35 | }); 36 | 37 | React.render( 38 | , 39 | document.getElementById('container') 40 | ); 41 | -------------------------------------------------------------------------------- /examples/ballmer-peak/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ballmer Peak Calculator 6 | 7 | 8 | 9 |

Ballmer Peak Calculator

10 |
11 |

12 | If you can see this, React is not working right. This is probably because you're viewing 13 | this on your file system instead of a web server. Try running 14 |

15 |           python -m SimpleHTTPServer
16 |         
17 | and going to http://localhost:8000/. 18 |

19 |
20 |

Example Details

21 |

This is written with JSX in a separate file and transformed in the browser.

22 |

23 | Learn more about React at 24 | facebook.github.io/react. 25 |

26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /examples/basic-commonjs/README.md: -------------------------------------------------------------------------------- 1 | # Basic example of using React with Browserify 2 | 3 | Run `npm install` in the directory to install React from npm. Then run: 4 | 5 | ./node_modules/.bin/browserify --debug --transform reactify ./index.js > ./bundle.js 6 | 7 | to produce `bundle.js` with example code and React. 8 | -------------------------------------------------------------------------------- /examples/basic-commonjs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Basic CommonJS Example with Browserify 6 | 7 | 8 | 9 |

Basic CommonJS Example with Browserify

10 |
11 |

12 | To install React, follow the instructions on 13 | GitHub. 14 |

15 |

16 | If you can see this, React is not working right. 17 | If you checked out the source from GitHub make sure to run grunt. 18 |

19 |
20 |

Example Details

21 |

This is written with JSX in a CommonJS module and precompiled to vanilla JS by running:

22 |
browserify --debug --transform reactify index.js > bundle.js
23 |

24 | Learn more about React at 25 | facebook.github.io/react. 26 |

27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /examples/basic-commonjs/index.js: -------------------------------------------------------------------------------- 1 | var React = require('react'); 2 | 3 | var ExampleApplication = React.createClass({ 4 | render: function() { 5 | var elapsed = Math.round(this.props.elapsed / 100); 6 | var seconds = elapsed / 10 + (elapsed % 10 ? '' : '.0' ); 7 | var message = 8 | 'React has been successfully running for ' + seconds + ' seconds.'; 9 | 10 | return

{message}

; 11 | } 12 | }); 13 | 14 | var start = new Date().getTime(); 15 | 16 | setInterval(function() { 17 | React.render( 18 | , 19 | document.getElementById('container') 20 | ); 21 | }, 50); 22 | -------------------------------------------------------------------------------- /examples/basic-commonjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-basic-commonjs-example", 3 | "description": "Basic example of using React with CommonJS", 4 | "main": "index.js", 5 | "devDependencies": { 6 | "browserify": "^6.3.3", 7 | "envify": "^3.2.0", 8 | "react": "^0.12.0", 9 | "reactify": "^0.17.1" 10 | }, 11 | "scripts": { 12 | "build": "browserify --debug --transform reactify index.js > bundle.js" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/basic-jsx-external/example.js: -------------------------------------------------------------------------------- 1 | var ExampleApplication = React.createClass({ 2 | render: function() { 3 | var elapsed = Math.round(this.props.elapsed / 100); 4 | var seconds = elapsed / 10 + (elapsed % 10 ? '' : '.0' ); 5 | var message = 6 | 'React has been successfully running for ' + seconds + ' seconds.'; 7 | 8 | return

{message}

; 9 | } 10 | }); 11 | 12 | var start = new Date().getTime(); 13 | 14 | setInterval(function() { 15 | React.render( 16 | , 17 | document.getElementById('container') 18 | ); 19 | }, 50); 20 | -------------------------------------------------------------------------------- /examples/basic-jsx-external/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Basic Example with External JSX 6 | 7 | 8 | 9 | 10 |

Basic Example with External JSX

11 |
12 |

13 | If you can see this, React is not working right. This is probably because you're viewing 14 | this on your file system instead of a web server. Try running 15 |

16 |           python -m SimpleHTTPServer
17 |         
18 | and going to http://localhost:8000/. 19 |

20 |
21 |

Example Details

22 |

This is written with JSX in a separate file and transformed in the browser.

23 |

24 | Learn more about React at 25 | facebook.github.io/react. 26 |

27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /examples/basic-jsx-harmony/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Basic Example with JSX with Harmony 6 | 7 | 8 | 9 |

Basic Example with JSX with Harmony

10 |
11 |

12 | To install React, follow the instructions on 13 | GitHub. 14 |

15 |

16 | If you can see this, React is not working right. 17 | If you checked out the source from GitHub make sure to run grunt. 18 |

19 |
20 |

Example Details

21 |

This is written with JSX with Harmony (ES6) syntax and transformed in the browser.

22 |

23 | Learn more about React at 24 | facebook.github.io/react. 25 |

26 | 27 | 28 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /examples/basic-jsx-precompile/example.js: -------------------------------------------------------------------------------- 1 | var ExampleApplication = React.createClass({ 2 | render: function() { 3 | var elapsed = Math.round(this.props.elapsed / 100); 4 | var seconds = elapsed / 10 + (elapsed % 10 ? '' : '.0' ); 5 | var message = 6 | 'React has been successfully running for ' + seconds + ' seconds.'; 7 | 8 | return

{message}

; 9 | } 10 | }); 11 | 12 | var start = new Date().getTime(); 13 | 14 | setInterval(function() { 15 | React.render( 16 | , 17 | document.getElementById('container') 18 | ); 19 | }, 50); 20 | -------------------------------------------------------------------------------- /examples/basic-jsx-precompile/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Basic Example with Precompiled JSX 6 | 7 | 8 | 9 |

Basic Example with Precompiled JSX

10 |
11 |

12 | If you can see this, React is not running. Try running: 13 |

14 |
npm install -g react-tools
15 | cd examples/basic-jsx-precompile/
16 | jsx . build/
17 |
18 |

Example Details

19 |

This is written with JSX in a separate file and precompiled to vanilla JS by running:

20 |
npm install -g react-tools
21 | cd examples/basic-jsx-precompile/
22 | jsx . build/
23 |

24 | Learn more about React at 25 | facebook.github.io/react. 26 |

27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /examples/basic-jsx/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Basic Example with JSX 6 | 7 | 8 | 9 |

Basic Example with JSX

10 |
11 |

12 | To install React, follow the instructions on 13 | GitHub. 14 |

15 |

16 | If you can see this, React is not working right. 17 | If you checked out the source from GitHub make sure to run grunt. 18 |

19 |
20 |

Example Details

21 |

This is written with JSX and transformed in the browser.

22 |

23 | Learn more about React at 24 | facebook.github.io/react. 25 |

26 | 27 | 28 | 29 | 30 | 31 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /examples/basic/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Basic Example 6 | 7 | 8 | 9 |

Basic Example

10 |
11 |

12 | To install React, follow the instructions on 13 | GitHub. 14 |

15 |

16 | If you can see this, React is not working right. 17 | If you checked out the source from GitHub make sure to run grunt. 18 |

19 |
20 |

Example Details

21 |

This is written in vanilla JavaScript (without JSX) and transformed in the browser.

22 |

23 | Learn more about React at 24 | facebook.github.io/react. 25 |

26 | 27 | 28 | 29 | 30 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /examples/jquery-bootstrap/css/example.css: -------------------------------------------------------------------------------- 1 | .example { 2 | margin: 20px; 3 | } -------------------------------------------------------------------------------- /examples/jquery-bootstrap/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | jQuery Integration 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /examples/jquery-bootstrap/js/app.js: -------------------------------------------------------------------------------- 1 | // Simple pure-React component so we don't have to remember 2 | // Bootstrap's classes 3 | var BootstrapButton = React.createClass({ 4 | render: function() { 5 | // transferPropsTo() is smart enough to merge classes provided 6 | // to this component. 7 | return this.transferPropsTo( 8 | 9 | {this.props.children} 10 | 11 | ); 12 | } 13 | }); 14 | 15 | var BootstrapModal = React.createClass({ 16 | // The following two methods are the only places we need to 17 | // integrate with Bootstrap or jQuery! 18 | componentDidMount: function() { 19 | // When the component is added, turn it into a modal 20 | $(this.getDOMNode()) 21 | .modal({backdrop: 'static', keyboard: false, show: false}) 22 | }, 23 | componentWillUnmount: function() { 24 | $(this.getDOMNode()).off('hidden', this.handleHidden); 25 | }, 26 | close: function() { 27 | $(this.getDOMNode()).modal('hide'); 28 | }, 29 | open: function() { 30 | $(this.getDOMNode()).modal('show'); 31 | }, 32 | render: function() { 33 | var confirmButton = null; 34 | var cancelButton = null; 35 | 36 | if (this.props.confirm) { 37 | confirmButton = ( 38 | 41 | {this.props.confirm} 42 | 43 | ); 44 | } 45 | if (this.props.cancel) { 46 | cancelButton = ( 47 | 48 | {this.props.cancel} 49 | 50 | ); 51 | } 52 | 53 | return ( 54 |
55 |
56 |
57 |
58 | 64 |

{this.props.title}

65 |
66 |
67 | {this.props.children} 68 |
69 |
70 | {cancelButton} 71 | {confirmButton} 72 |
73 |
74 |
75 |
76 | ); 77 | }, 78 | handleCancel: function() { 79 | if (this.props.onCancel) { 80 | this.props.onCancel(); 81 | } 82 | }, 83 | handleConfirm: function() { 84 | if (this.props.onConfirm) { 85 | this.props.onConfirm(); 86 | } 87 | } 88 | }); 89 | 90 | var Example = React.createClass({ 91 | handleCancel: function() { 92 | if (confirm('Are you sure you want to cancel?')) { 93 | this.refs.modal.close(); 94 | } 95 | }, 96 | render: function() { 97 | var modal = null; 98 | modal = ( 99 | 106 | This is a React component powered by jQuery and Bootstrap! 107 | 108 | ); 109 | return ( 110 |
111 | {modal} 112 | 113 | Open modal 114 | 115 |
116 | ); 117 | }, 118 | openModal: function() { 119 | this.refs.modal.open(); 120 | }, 121 | closeModal: function() { 122 | this.refs.modal.close(); 123 | } 124 | }); 125 | 126 | React.render(, document.getElementById('jqueryexample')); 127 | -------------------------------------------------------------------------------- /examples/jquery-bootstrap/thirdparty/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.2.0 (http://getbootstrap.com) 3 | * Copyright 2011-2014 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.2.0",d.prototype.close=function(b){function c(){f.detach().trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",c).emulateTransitionEnd(150):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.2.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),d[e](null==f[b]?this.options[b]:f[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b).on("keydown.bs.carousel",a.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.2.0",c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},c.prototype.keydown=function(a){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.to=function(b){var c=this,d=this.getItemIndex(this.$active=this.$element.find(".item.active"));return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in")[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.fn.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('