diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..413e6da1 Binary files /dev/null and b/.DS_Store differ diff --git a/Gemfile b/Gemfile index e87fad5f..5967d3fb 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.7' # Use sqlite3 as the database for Active Record -gem 'sqlite3' + # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets @@ -23,6 +23,7 @@ gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc +gem 'graphviz' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' @@ -35,13 +36,24 @@ gem 'sdoc', '~> 0.4.0', group: :doc group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug' + gem 'sqlite3' end group :development do + gem 'better_errors' + gem 'binding_of_caller' + gem 'pry-rails' # Access an IRB console on exception pages or by using <%= console %> in views gem 'web-console', '~> 2.0' # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' + + gem 'rails-erd' end + +group :production do + gem 'pg' + gem 'rails_12factor' +end diff --git a/Gemfile.lock b/Gemfile.lock index 6c97c19f..13c36d9c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -37,10 +37,16 @@ GEM thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) arel (6.0.3) + better_errors (2.1.1) + coderay (>= 1.0.0) + erubis (>= 2.6.6) + rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) builder (3.2.2) byebug (9.0.6) + choice (0.2.0) + coderay (1.1.1) coffee-rails (4.1.1) coffee-script (>= 2.2.0) railties (>= 4.0.0, < 5.1.x) @@ -54,6 +60,7 @@ GEM execjs (2.7.0) globalid (0.3.7) activesupport (>= 4.1.0) + graphviz (0.3.0) i18n (0.7.0) jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) @@ -67,6 +74,7 @@ GEM nokogiri (>= 1.5.9) mail (2.6.4) mime-types (>= 1.16, < 4) + method_source (0.8.2) mime-types (3.1) mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) @@ -76,7 +84,14 @@ GEM nokogiri (1.6.8) mini_portile2 (~> 2.1.0) pkg-config (~> 1.1.7) + pg (0.19.0) pkg-config (1.1.7) + pry (0.10.4) + coderay (~> 1.1.0) + method_source (~> 0.8.1) + slop (~> 3.4) + pry-rails (0.3.4) + pry (>= 0.9.10) rack (1.6.4) rack-test (0.6.3) rack (>= 1.0) @@ -97,8 +112,18 @@ GEM activesupport (>= 4.2.0.beta, < 5.0) nokogiri (~> 1.6.0) rails-deprecated_sanitizer (>= 1.0.1) + rails-erd (1.5.0) + activerecord (>= 3.2) + activesupport (>= 3.2) + choice (~> 0.2.0) + ruby-graphviz (~> 1.2) rails-html-sanitizer (1.0.3) loofah (~> 2.0) + rails_12factor (0.0.3) + rails_serve_static_assets + rails_stdout_logging + rails_serve_static_assets (0.0.5) + rails_stdout_logging (0.0.5) railties (4.2.7) actionpack (= 4.2.7) activesupport (= 4.2.7) @@ -107,6 +132,7 @@ GEM rake (11.3.0) rdoc (4.2.2) json (~> 1.4) + ruby-graphviz (1.2.2) sass (3.4.22) sass-rails (5.0.6) railties (>= 4.0.0, < 6) @@ -117,6 +143,7 @@ GEM sdoc (0.4.1) json (~> 1.7, >= 1.7.7) rdoc (~> 4.0) + slop (3.6.0) spring (2.0.0) activesupport (>= 4.2) sprockets (3.7.0) @@ -147,11 +174,18 @@ PLATFORMS ruby DEPENDENCIES + better_errors + binding_of_caller byebug coffee-rails (~> 4.1.0) + graphviz jbuilder (~> 2.0) jquery-rails + pg + pry-rails rails (= 4.2.7) + rails-erd + rails_12factor sass-rails (~> 5.0) sdoc (~> 0.4.0) spring diff --git a/app/.DS_Store b/app/.DS_Store new file mode 100644 index 00000000..305847b5 Binary files /dev/null and b/app/.DS_Store differ diff --git a/app/assets/images/tomatoes.jpeg b/app/assets/images/tomatoes.jpeg new file mode 100644 index 00000000..2b6cfe79 Binary files /dev/null and b/app/assets/images/tomatoes.jpeg differ diff --git a/app/assets/javascripts/markets.coffee b/app/assets/javascripts/markets.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/markets.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/products.coffee b/app/assets/javascripts/products.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/products.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/sales.coffee b/app/assets/javascripts/sales.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/sales.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/vendors.coffee b/app/assets/javascripts/vendors.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/vendors.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index f9cd5b34..ed0c2e46 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -1,15 +1,81 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the bottom of the - * compiled file so the styles you add here take precedence over styles defined in any styles - * defined in the other CSS/SCSS files in this directory. It is generally better to create a new - * file per style scope. - * - *= require_tree . - *= require_self - */ +body { + margin: 0; + } + + header { + background-image: url(/assets/tomatoes.jpeg); + height: 15vh; + width: 100vw; + background-size: cover; + margin: 0; + background-position: center center; + text-align: center; + color: white; + font-family: "Special Elite", cursive; + font-size: 2em; + } + + header h1 { + margin: 0; + position: relative; + top: 4vh; + } + + header h1 a { + text-decoration: none; + color: white; + } + +#main { + background-image: url(/assets/tomatoes.jpeg); + height: 100vh; + width: 100vw; + background-size: cover; + margin: 0; + position: absolute; + top: 0; + overflow: hidden; +} + +#main h1 { + text-align: center; + font-size: 3em; + position: relative; + top: 35vh; + font-family: "Special Elite", cursive; + color: white; +} + +#menu { + text-align: center; + margin: 40vh auto; + font-size: 1.5em; +} + +#menu a { + text-decoration: none; + color: white; + font-family: "Molengo"; +} + +h2.section-heading { + margin-top: 6vh; +} + +.centered-list { + list-style: none; + font-family: "Molengo"; + text-align: center; + padding-left: 0; +} + +.add-vendor-edit-market li { + font-family: "Molengo"; + margin-left: 470px; + list-style-type: none; +} +.market-address { + font-family: "Molengo"; + text-align: center; + list-style-type: none; +} diff --git a/app/assets/stylesheets/markets.scss b/app/assets/stylesheets/markets.scss new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/app/assets/stylesheets/markets.scss @@ -0,0 +1 @@ + diff --git a/app/assets/stylesheets/products.scss b/app/assets/stylesheets/products.scss new file mode 100644 index 00000000..bff386e5 --- /dev/null +++ b/app/assets/stylesheets/products.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Products controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/sales.scss b/app/assets/stylesheets/sales.scss new file mode 100644 index 00000000..5126e4bf --- /dev/null +++ b/app/assets/stylesheets/sales.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Sales controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/vendors.scss b/app/assets/stylesheets/vendors.scss new file mode 100644 index 00000000..e77b0e5a --- /dev/null +++ b/app/assets/stylesheets/vendors.scss @@ -0,0 +1,46 @@ +// Place all the styles related to the Vendors controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ + + + +.page-title { + text-align: center; + font-family: "Special Elite", cursive; + font-size: 2em; + margin: 12vh 0 6vh; +} + +h1.page-title { + margin-bottom: 3vh; +} + +.vendor-market, .section-heading { + font-family: "Special Elite", cursive; + font-size: 1.5em; + text-align: center; +} + +.add-product { + list-style: none; + font-family: "Molengo"; + text-align: center; + padding-left: 0; +} + +p.vendor-details, p.market-address { + font-family: "Molengo"; + text-align: center; +} + +table, tr, td { + border: 1px solid black; + width: 80vw; + text-align: center; +} + +.sales_tables { + margin: 5vh auto; + width: 80vw; + font-family: "Molengo", sans-serif; +} diff --git a/app/controllers/markets_controller.rb b/app/controllers/markets_controller.rb new file mode 100644 index 00000000..91de9729 --- /dev/null +++ b/app/controllers/markets_controller.rb @@ -0,0 +1,67 @@ +class MarketsController < ApplicationController + + def mainpage + end + + def index + @markets = Market.all + @link = "market" + end + + def new + @market = Market.new + end + + def create + @new_market_create = Market.new(market_params) + if @new_market_create.save + redirect_to market_path + else + render :new + end + end + + def user_all + @markets = Market.all + @link = "user" + render "index" + end + + def show + id = params[:id] + @market = Market.find(id) + @vendors = @market.vendors + @link = "market" + end + + def user_show + id = params[:id] + @market = Market.find(id) + @vendors = @market.vendors + @link = "user" + render "show" + end + + def destroy + Market.find(params[:id]).destroy + redirect_to markets_path + end + + def edit + @market = Market.find(params[:id]) + end + + def update + @market = Market.find(params[:id]) + if @market.update(market_params) + redirect_to market_path(@market.id) + else + render :edit + end + end + + private + def market_params + params.require(:market).permit(:name, :address, :city, :county, :state, :zip) + end +end diff --git a/app/controllers/products_controller.rb b/app/controllers/products_controller.rb new file mode 100644 index 00000000..4239406a --- /dev/null +++ b/app/controllers/products_controller.rb @@ -0,0 +1,62 @@ +class ProductsController < ApplicationController + def new + vendor_id = params[:vendor_id] + @vendor = Vendor.find(vendor_id) + @vendor_product = @vendor.products.build + end + + def create + vendor_id = params[:vendor_id] + vendor = Vendor.find(vendor_id) + @vendor_product = vendor.products.create(vendor_product_params) + + redirect_to vendor_path(vendor_id) + end + + def show + id = params[:id] + @vendor_product = Product.find(id) + end + + def edit + id = params[:id] + @vendor_product = Product.find(id) +=begin + @vendor = Vendor.find(params[:vendor_id]) + @product = Product.find(params[:id]) +=end + + end + + def update + @vendor_product = Product.find(params[:id]) + if @vendor_product.update(vendor_product_params) + redirect_to vendor_path(params[:vendor_id]) + else + render :edit + end +=begin + @product = Product.find(params[:id]) + @vendor = Vendor.find(params[:vendor_id]) + @product.vendor_id = @vendor.id + if @vendor_product.update(vendor_product_params) + redirect_to vendor_path(params[@vendor.id]) + else + render :edit + end +=end + end + + def destroy + @vendor_product = Product.find(params[:id]) + if @vendor_product.destroy + redirect_to vendor_path(params[:vendor_id]) + end + end + + private + + def vendor_product_params + params.require(:product).permit(:name, :vendor_id) + end +end diff --git a/app/controllers/sales_controller.rb b/app/controllers/sales_controller.rb new file mode 100644 index 00000000..4b038a6b --- /dev/null +++ b/app/controllers/sales_controller.rb @@ -0,0 +1,22 @@ +class SalesController < ApplicationController + def new + # vendor_id = params[:vendor_id] + # @vendor = Vendor.find(vendor_id) + product_id = params[:product_id] + @product = Product.find(product_id) + @sale = @product.sales.build + end + + def create + product_id = params[:product_id] + @product = Product.find(product_id) + @sale = @product.sales.create(sales_params) + redirect_to vendor_path(params[:vendor_id]) + end + + private + + def sales_params + params.require(:sale).permit(:amount, :purchase_time) + end +end diff --git a/app/controllers/vendors_controller.rb b/app/controllers/vendors_controller.rb new file mode 100644 index 00000000..23b296a8 --- /dev/null +++ b/app/controllers/vendors_controller.rb @@ -0,0 +1,68 @@ +class VendorsController < ApplicationController + + def index + @vendors_all = Vendor.all.order(:name) + # a_e = ["a", "b", "c", "d", "e"] + # @vendors_a_e = Vendor.by_letter(a_e) + end + + def show + id = params[:id] + @vendor = Vendor.find(id) + @products = @vendor.products + @sales = @vendor.sales #sales(@products) + @vendor_market_object = Market.find(@vendor.market_id) + @vendor_market = @vendor_market_object.name + @full_address = @vendor_market_object.full_address + @sales_total = @vendor.sales_total(@sales) + @month_sales = @vendor.sales_current_month + @current_month_total = @vendor.current_month_total + + if !(@sales.empty?) + @attribute_keys = @sales.first.attributes.keys #doesn't work if no sales + end + end + + def destroy + @market = Market.find(params[:market_id]) + @vendor = Vendor.find(params[:id]) + @vendor.destroy + redirect_to market_path(@market.id) + end + + def new + @market = Market.find(params[:market_id]) + @vendor = @market.vendors.new + end + + def create + @market = Market.find(params[:market_id]) + @vendor = @market.vendors.new(vendor_params) + if @vendor.save + redirect_to market_path(@market.id) + else + render :new + end + end + + def edit + @vendor = Vendor.find(params[:id]) + @market = Market.find(params[:market_id]) + end + + def update + @market = Market.find(params[:market_id]) + @vendor = Vendor.find(params[:id]) + if @vendor.update(vendor_params) + redirect_to market_path(@market.id) + else + render :edit + end + end + + private + def vendor_params + params.require(:vendor).permit(:name, :number_of_employees, + :markets => [:name, :address, :city, :county, :state, :zip]) + end +end diff --git a/app/helpers/markets_helper.rb b/app/helpers/markets_helper.rb new file mode 100644 index 00000000..655b79b7 --- /dev/null +++ b/app/helpers/markets_helper.rb @@ -0,0 +1,2 @@ +module MarketsHelper +end diff --git a/app/helpers/products_helper.rb b/app/helpers/products_helper.rb new file mode 100644 index 00000000..ab5c42b3 --- /dev/null +++ b/app/helpers/products_helper.rb @@ -0,0 +1,2 @@ +module ProductsHelper +end diff --git a/app/helpers/sales_helper.rb b/app/helpers/sales_helper.rb new file mode 100644 index 00000000..8611c4a0 --- /dev/null +++ b/app/helpers/sales_helper.rb @@ -0,0 +1,2 @@ +module SalesHelper +end diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb new file mode 100644 index 00000000..2310a240 --- /dev/null +++ b/app/helpers/users_helper.rb @@ -0,0 +1,2 @@ +module UsersHelper +end diff --git a/app/helpers/vendors_helper.rb b/app/helpers/vendors_helper.rb new file mode 100644 index 00000000..5429ffa4 --- /dev/null +++ b/app/helpers/vendors_helper.rb @@ -0,0 +1,2 @@ +module VendorsHelper +end diff --git a/app/models/market.rb b/app/models/market.rb new file mode 100644 index 00000000..f8d67d89 --- /dev/null +++ b/app/models/market.rb @@ -0,0 +1,7 @@ +class Market < ActiveRecord::Base + has_many :vendors + + def full_address + "#{address}, #{city}, #{county}, #{state} #{zip}" + end +end diff --git a/app/models/product.rb b/app/models/product.rb new file mode 100644 index 00000000..86f8d94b --- /dev/null +++ b/app/models/product.rb @@ -0,0 +1,4 @@ +class Product < ActiveRecord::Base + belongs_to :vendor + has_many :sales +end diff --git a/app/models/sale.rb b/app/models/sale.rb new file mode 100644 index 00000000..e9af9364 --- /dev/null +++ b/app/models/sale.rb @@ -0,0 +1,3 @@ +class Sale < ActiveRecord::Base + belongs_to :product +end diff --git a/app/models/vendor.rb b/app/models/vendor.rb new file mode 100644 index 00000000..6d5651e9 --- /dev/null +++ b/app/models/vendor.rb @@ -0,0 +1,45 @@ +class Vendor < ActiveRecord::Base + belongs_to :market + has_many :products + + def sales + sales = [] + products.each do |product| + sales += product.sales + end + return sales + end + + def sales_total(sales) + total_amount = 0 + sales.each do |sale| + total_amount += sale.amount + end + total_amount = total_amount/100.0 + return sprintf "%.2f", total_amount + end + + def sales_current_month + current_sales = [] + current_month = DateTime.now + sales.each do |sale| + if ((sale.purchase_time.year == current_month.year) && (sale.purchase_time.month == current_month.month)) + current_sales << sale + end + end + return current_sales + end + + def current_month_total + sales_total(sales_current_month) + end + + # def self.by_letter(array_of_letters) + # results = [] + # array_of_letters.each do |letter| + # letter.upcase! + # results += self.where.("name like?", "#{letter}%").order(:name) + # end + # return results + # end +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 443f3152..227ed444 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,8 +5,13 @@ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> + + +
+

<%= link_to "Farmers Markets", root_path %>

+
<%= yield %> diff --git a/app/views/markets/edit.html.erb b/app/views/markets/edit.html.erb new file mode 100644 index 00000000..a0907853 --- /dev/null +++ b/app/views/markets/edit.html.erb @@ -0,0 +1,17 @@ +
+<%= form_for @market, method: :patch do |f| %> +

<%= f.label :Name %>:

+

<%= f.text_field :name %>

+

<%= f.label :Address %>:

+

<%= f.text_field :address %>

+

<%= f.label :City %>:

+

<%= f.text_field :city %>

+

<%= f.label :County %>:

+

<%= f.text_field :county %>

+

<%= f.label :State %>:

+

<%= f.text_field :state %>

+

<%= f.label :Zip %>:

+

<%= f.text_field :zip %>

+

<%= f.submit "Submit" %>

+<% end %> +
diff --git a/app/views/markets/index.html.erb b/app/views/markets/index.html.erb new file mode 100644 index 00000000..3984ca89 --- /dev/null +++ b/app/views/markets/index.html.erb @@ -0,0 +1,14 @@ +

Pick Your Market

+ + diff --git a/app/views/markets/mainpage.html.erb b/app/views/markets/mainpage.html.erb new file mode 100644 index 00000000..8007b551 --- /dev/null +++ b/app/views/markets/mainpage.html.erb @@ -0,0 +1,8 @@ +
+

Farmers Markets

+ +
diff --git a/app/views/markets/new.html.erb b/app/views/markets/new.html.erb new file mode 100644 index 00000000..fa7785ba --- /dev/null +++ b/app/views/markets/new.html.erb @@ -0,0 +1,17 @@ +
+<%= form_for @market do |f| %> +

<%= f.label :Name %>:

+

<%= f.text_field :name %>

+

<%= f.label :Address %>:

+

<%= f.text_field :address %>

+

<%= f.label :City %>:

+

<%= f.text_field :city %>

+

<%= f.label :County %>:

+

<%= f.text_field :county %>

+

<%= f.label :State %>:

+

<%= f.text_field :state %>

+

<%= f.label :Zip %>:

+

<%= f.text_field :zip %>

+

<%= f.submit "Submit" %>

+<% end %> +
diff --git a/app/views/markets/show.html.erb b/app/views/markets/show.html.erb new file mode 100644 index 00000000..6d433648 --- /dev/null +++ b/app/views/markets/show.html.erb @@ -0,0 +1,42 @@ +
+ +
+ +
+ +

List of Vendors

+ + +
diff --git a/app/views/products/_form.html.erb b/app/views/products/_form.html.erb new file mode 100644 index 00000000..d4240a36 --- /dev/null +++ b/app/views/products/_form.html.erb @@ -0,0 +1,5 @@ +<%= form_for product, method: http_method do |f| %> +

<%= f.label :Name %>:

+

<%= f.text_field :name %>

+

<%= f.submit "Submit" %>

+<% end %> diff --git a/app/views/products/edit.html.erb b/app/views/products/edit.html.erb new file mode 100644 index 00000000..3d199668 --- /dev/null +++ b/app/views/products/edit.html.erb @@ -0,0 +1,14 @@ +<%# form_for vendor_product_path(params[:vendor_id], params[:id]), method: :patch do |f| %> + +<%# form_for @vendor, url: {action: "create"} do, was only using second param? %> +<%# form_for [@market, @vendor] do %> + +
+

<%= @vendor_product.name %>

+

Edit Product

+ <%= form_for @vendor_product, url: {action: "update"} do |f| %> +

<%= f.label :Name %>:

+

<%= f.text_field :name %>

+

<%= f.submit "Submit" %>

+ <% end %> +
diff --git a/app/views/products/new.html.erb b/app/views/products/new.html.erb new file mode 100644 index 00000000..d812f9e4 --- /dev/null +++ b/app/views/products/new.html.erb @@ -0,0 +1,5 @@ +
+

<%= @vendor.name %>

+

Add New Product

+ <%= render partial: "form", locals: { product: [:vendor, @vendor_product], http_method: :post } %> +
diff --git a/app/views/products/show.html.erb b/app/views/products/show.html.erb new file mode 100644 index 00000000..d73402f1 --- /dev/null +++ b/app/views/products/show.html.erb @@ -0,0 +1,6 @@ +

<%= @vendor_product.name %>

+ +

Product Details

+ diff --git a/app/views/sales/new.html.erb b/app/views/sales/new.html.erb new file mode 100644 index 00000000..30abb54b --- /dev/null +++ b/app/views/sales/new.html.erb @@ -0,0 +1,14 @@ + +
+

<%= @product.name %>

+

Add New Sale

+ <%= form_for @sale, url: {action: "create"} do |f| %> +

<%= f.label :Amount %>:

+

<%= f.number_field :amount, required: true %>

+ +

<%= f.label :Purchase_Time %>:

+

<%= f.datetime_local_field :purchase_time, required: true %>

+ +

<%= f.submit "Submit" %>

+ <% end %> +
diff --git a/app/views/vendors/_form.html.erb b/app/views/vendors/_form.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/app/views/vendors/_sales_table.html.erb b/app/views/vendors/_sales_table.html.erb new file mode 100644 index 00000000..8b24a6f5 --- /dev/null +++ b/app/views/vendors/_sales_table.html.erb @@ -0,0 +1,21 @@ + + + + <% @attribute_keys.each do |a| %> + + <% end %> + + + + <% sales.each do |sale| %> + + <% sale.attributes.each do |k, v| %> + + <% end %> + + <% end %> + +
<%= a.to_s %>
+ <%= v %> +
+

<%= "TOTAL: $#{sales_total}" %>

diff --git a/app/views/vendors/edit.html.erb b/app/views/vendors/edit.html.erb new file mode 100644 index 00000000..a5b615e7 --- /dev/null +++ b/app/views/vendors/edit.html.erb @@ -0,0 +1,9 @@ +
+<%= form_for([@market, @vendor]) do |f| %> +

<%= f.label :Name %>:

+

<%= f.text_field :name %>

+

<%= f.label :Number_of_employees %>:

+

<%= f.text_field :number_of_employees %>

+

<%= f.submit "Submit" %>

+<% end %> +
diff --git a/app/views/vendors/index.html.erb b/app/views/vendors/index.html.erb new file mode 100644 index 00000000..c8b63bf5 --- /dev/null +++ b/app/views/vendors/index.html.erb @@ -0,0 +1,9 @@ + +

Pick Your Vendor

+ diff --git a/app/views/vendors/new.html.erb b/app/views/vendors/new.html.erb new file mode 100644 index 00000000..1ac4fd55 --- /dev/null +++ b/app/views/vendors/new.html.erb @@ -0,0 +1,11 @@ + + +
+<%= form_for @vendor, url: {action: "create"} do |f| %> +

<%= f.label :Name %>:

+

<%= f.text_field :name %>

+

<%= f.label :Number_of_employees %>:

+

<%= f.text_field :number_of_employees %>

+

<%= f.submit "Submit" %>

+<% end %> +
diff --git a/app/views/vendors/show.html.erb b/app/views/vendors/show.html.erb new file mode 100644 index 00000000..ad627c60 --- /dev/null +++ b/app/views/vendors/show.html.erb @@ -0,0 +1,30 @@ + +

<%= @vendor.name %>

+

Vendor ID: <%= @vendor.id %> | Number of Employees: <%= @vendor.number_of_employees %>

+

<%= @vendor_market %>

+

<%= @full_address %>

+ +

Products

+

<%= link_to "Add Product", new_vendor_product_path(params[:id]) %>

+ + +
+

Sales

+ <% if @sales.empty? %> +

+ <%= @vendor.name %> has no sales to date. +

+ <% else %> +

ALL SALES

+ <%= render partial: "sales_table", locals: { sales: @sales, sales_total: @sales_total } %> +

CURRENT MONTH SALES

+ <%= render partial: "sales_table", locals: { sales: @month_sales, sales_total: @current_month_total } %> + <% end %> +
diff --git a/config/environments/production.rb b/config/environments/production.rb index 5c1b32e4..4484854c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -23,13 +23,13 @@ # Disable serving static files from the `/public` folder by default since # Apache or NGINX already handles this. config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present? - + config.serve_static_assets = true # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false + config.assets.compile = true # Asset digests allow you to set far-future HTTP expiration dates on all assets, # yet still be able to expire them through the digest params. @@ -38,8 +38,8 @@ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb # Specifies the header that your server uses for sending files. - # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX + # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache + config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true diff --git a/config/routes.rb b/config/routes.rb index 3f66539d..3765e8e2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,23 @@ Rails.application.routes.draw do + root 'markets#mainpage' + + # get '/markets' => 'markets#mainpage' + + get 'markets/user_all' => 'markets#user_all' + + get 'markets/:id/user_show' => 'markets#user_show', as: :user_show + + resources :markets, except: [:destroy] do + resources :vendors, except: [:show] + end + + resources :vendors do + resources :products, except: [:index, :show] do + resources :sales, except: [:index, :show, :destroy] + end + end + + # The priority is based upon order of creation: first created -> highest priority. # See how all your routes lay out with "rake routes". diff --git a/data-diagram.jpg b/data-diagram.jpg new file mode 100644 index 00000000..fb27647e Binary files /dev/null and b/data-diagram.jpg differ diff --git a/db/migrate/20161004215954_create_markets.rb b/db/migrate/20161004215954_create_markets.rb new file mode 100644 index 00000000..92ba65a0 --- /dev/null +++ b/db/migrate/20161004215954_create_markets.rb @@ -0,0 +1,15 @@ +class CreateMarkets < ActiveRecord::Migration + def change + create_table :markets do |t| + t.string :name + t.string :address + t.string :city + t.string :county + t.string :state + t.string :zip + + + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161004220007_create_vendors.rb b/db/migrate/20161004220007_create_vendors.rb new file mode 100644 index 00000000..0b42335b --- /dev/null +++ b/db/migrate/20161004220007_create_vendors.rb @@ -0,0 +1,10 @@ +class CreateVendors < ActiveRecord::Migration + def change + create_table :vendors do |t| + t.belongs_to :market, index: true + t.string :name + t.integer :number_of_employees + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161004220016_create_products.rb b/db/migrate/20161004220016_create_products.rb new file mode 100644 index 00000000..68776730 --- /dev/null +++ b/db/migrate/20161004220016_create_products.rb @@ -0,0 +1,9 @@ +class CreateProducts < ActiveRecord::Migration + def change + create_table :products do |t| + t.belongs_to :vendor, index: true + t.string :name + t.timestamps null: false + end + end +end diff --git a/db/migrate/20161004220021_create_sales.rb b/db/migrate/20161004220021_create_sales.rb new file mode 100644 index 00000000..bffdaa23 --- /dev/null +++ b/db/migrate/20161004220021_create_sales.rb @@ -0,0 +1,11 @@ +class CreateSales < ActiveRecord::Migration + def change + create_table :sales do |t| + t.belongs_to :product, index: true + t.integer :amount + t.datetime :purchase_time + + t.timestamps null: false + end + end +end diff --git a/db/schema.rb b/db/schema.rb new file mode 100644 index 00000000..064ce002 --- /dev/null +++ b/db/schema.rb @@ -0,0 +1,56 @@ +# encoding: UTF-8 +# This file is auto-generated from the current state of the database. Instead +# of editing this file, please use the migrations feature of Active Record to +# incrementally modify your database, and then regenerate this schema definition. +# +# Note that this schema.rb definition is the authoritative source for your +# database schema. If you need to create the application database on another +# system, you should be using db:schema:load, not running all the migrations +# from scratch. The latter is a flawed and unsustainable approach (the more migrations +# you'll amass, the slower it'll run and the greater likelihood for issues). +# +# It's strongly recommended that you check this file into your version control system. + +ActiveRecord::Schema.define(version: 20161004220021) do + + create_table "markets", force: :cascade do |t| + t.string "name" + t.string "address" + t.string "city" + t.string "county" + t.string "state" + t.string "zip" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + create_table "products", force: :cascade do |t| + t.integer "vendor_id" + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "products", ["vendor_id"], name: "index_products_on_vendor_id" + + create_table "sales", force: :cascade do |t| + t.integer "product_id" + t.integer "amount" + t.datetime "purchase_time" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "sales", ["product_id"], name: "index_sales_on_product_id" + + create_table "vendors", force: :cascade do |t| + t.integer "market_id" + t.string "name" + t.integer "number_of_employees" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + + add_index "vendors", ["market_id"], name: "index_vendors_on_market_id" + +end diff --git a/db/seeds.rb b/db/seeds.rb index 4edb1e85..255037e9 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -5,3 +5,40 @@ # # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # Mayor.create(name: 'Emanuel', city: cities.first) + +require 'csv' + +CSV.read('./seed_csvs/markets.csv').each do |line| + Market.create( + id: line[0].to_i, + name: line[1], + address: line[2], + city: line[3], + county: line[4], + state: line[5], + zip: line[6]) + # info << Market.new(id, name, address, city, county, state, zip) +end + +CSV.read('./seed_csvs/vendors.csv').each do |line| + Vendor.create( + id: line[0].to_i, + name: line[1], + number_of_employees: line[2].to_i, + market_id: line[3].to_i) +end + +CSV.read('./seed_csvs/products.csv').each do |line| + Product.create( + id: line[0].to_i, + name: line[1], + vendor_id: line[2].to_i) +end + +CSV.read('./seed_csvs/sales.csv').each do |line| + Sale.create( + id: line[0].to_i, + amount: line[1].to_i, + purchase_time: DateTime.parse(line[2]), + product_id: line[4].to_i) +end diff --git a/erd.pdf b/erd.pdf new file mode 100644 index 00000000..5fab8423 Binary files /dev/null and b/erd.pdf differ diff --git a/public/assets/.sprockets-manifest-a00561ca05a1585ddae2acbaf6f1a92f.json b/public/assets/.sprockets-manifest-a00561ca05a1585ddae2acbaf6f1a92f.json new file mode 100644 index 00000000..f868ea7e --- /dev/null +++ b/public/assets/.sprockets-manifest-a00561ca05a1585ddae2acbaf6f1a92f.json @@ -0,0 +1 @@ +{"files":{"tomatoes-8e4ba6baf2c68b4f0e874edc19506e2965848893d57a3b837daa3b1abe140c26.jpg":{"logical_path":"tomatoes.jpg","mtime":"2016-10-07T12:33:37-07:00","size":1268619,"digest":"8e4ba6baf2c68b4f0e874edc19506e2965848893d57a3b837daa3b1abe140c26","integrity":"sha256-jkumuvLGi08Oh07cGVBuKWWEiJPVejuDfao7Gr4UDCY="},"application-65b06790c910bd8b6e026af00c16cb539012b9dcab62fc2b7effa7d9b2655b44.js":{"logical_path":"application.js","mtime":"2016-10-07T15:55:22-07:00","size":141159,"digest":"65b06790c910bd8b6e026af00c16cb539012b9dcab62fc2b7effa7d9b2655b44","integrity":"sha256-ZbBnkMkQvYtuAmrwDBbLU5ASudyrYvwrfv+n2bJlW0Q="},"application-fb025b2607ad5a7ca969a2bc30eeec01c3b9a7156609245e41b010f7161c50a8.css":{"logical_path":"application.css","mtime":"2016-10-07T17:25:03-07:00","size":1504,"digest":"fb025b2607ad5a7ca969a2bc30eeec01c3b9a7156609245e41b010f7161c50a8","integrity":"sha256-+wJbJgetWnypaaK8MO7sAcO5pxVmCSReQbAQ9xYcUKg="},"application-a7d29684701f6d7c82f9614038c707529599049919dcd2be8367962fd7e3d5d3.css":{"logical_path":"application.css","mtime":"2016-10-08T15:32:08-07:00","size":1525,"digest":"a7d29684701f6d7c82f9614038c707529599049919dcd2be8367962fd7e3d5d3","integrity":"sha256-p9KWhHAfbXyC+WFAOMcHUpWZBJkZ3NK+g2eWL9fj1dM="}},"assets":{"tomatoes.jpg":"tomatoes-8e4ba6baf2c68b4f0e874edc19506e2965848893d57a3b837daa3b1abe140c26.jpg","application.js":"application-65b06790c910bd8b6e026af00c16cb539012b9dcab62fc2b7effa7d9b2655b44.js","application.css":"application-a7d29684701f6d7c82f9614038c707529599049919dcd2be8367962fd7e3d5d3.css"}} \ No newline at end of file diff --git a/public/assets/application-65b06790c910bd8b6e026af00c16cb539012b9dcab62fc2b7effa7d9b2655b44.js b/public/assets/application-65b06790c910bd8b6e026af00c16cb539012b9dcab62fc2b7effa7d9b2655b44.js new file mode 100644 index 00000000..b9881ee4 --- /dev/null +++ b/public/assets/application-65b06790c910bd8b6e026af00c16cb539012b9dcab62fc2b7effa7d9b2655b44.js @@ -0,0 +1,5 @@ +!function(t,e){"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function n(t){var e=!!t&&"length"in t&&t.length,n=ft.type(t);return"function"!==n&&!ft.isWindow(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function r(t,e,n){if(ft.isFunction(e))return ft.grep(t,function(t,r){return!!e.call(t,r,t)!==n});if(e.nodeType)return ft.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(Tt.test(e))return ft.filter(e,t,n);e=ft.filter(e,t)}return ft.grep(t,function(t){return ft.inArray(t,e)>-1!==n})}function i(t,e){do t=t[e];while(t&&1!==t.nodeType);return t}function o(t){var e={};return ft.each(t.match(At)||[],function(t,n){e[n]=!0}),e}function a(){rt.addEventListener?(rt.removeEventListener("DOMContentLoaded",s),t.removeEventListener("load",s)):(rt.detachEvent("onreadystatechange",s),t.detachEvent("onload",s))}function s(){(rt.addEventListener||"load"===t.event.type||"complete"===rt.readyState)&&(a(),ft.ready())}function u(t,e,n){if(void 0===n&&1===t.nodeType){var r="data-"+e.replace(Ht,"-$1").toLowerCase();if(n=t.getAttribute(r),"string"==typeof n){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:jt.test(n)?ft.parseJSON(n):n)}catch(t){}ft.data(t,e,n)}else n=void 0}return n}function l(t){var e;for(e in t)if(("data"!==e||!ft.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function c(t,e,n,r){if(Dt(t)){var i,o,a=ft.expando,s=t.nodeType,u=s?ft.cache:t,l=s?t[a]:t[a]&&a;if(l&&u[l]&&(r||u[l].data)||void 0!==n||"string"!=typeof e)return l||(l=s?t[a]=nt.pop()||ft.guid++:a),u[l]||(u[l]=s?{}:{toJSON:ft.noop}),"object"!=typeof e&&"function"!=typeof e||(r?u[l]=ft.extend(u[l],e):u[l].data=ft.extend(u[l].data,e)),o=u[l],r||(o.data||(o.data={}),o=o.data),void 0!==n&&(o[ft.camelCase(e)]=n),"string"==typeof e?(i=o[e],null==i&&(i=o[ft.camelCase(e)])):i=o,i}}function d(t,e,n){if(Dt(t)){var r,i,o=t.nodeType,a=o?ft.cache:t,s=o?t[ft.expando]:ft.expando;if(a[s]){if(e&&(r=n?a[s]:a[s].data)){ft.isArray(e)?e=e.concat(ft.map(e,ft.camelCase)):e in r?e=[e]:(e=ft.camelCase(e),e=e in r?[e]:e.split(" ")),i=e.length;for(;i--;)delete r[e[i]];if(n?!l(r):!ft.isEmptyObject(r))return}(n||(delete a[s].data,l(a[s])))&&(o?ft.cleanData([t],!0):dt.deleteExpando||a!=a.window?delete a[s]:a[s]=void 0)}}}function p(t,e,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return ft.css(t,e,"")},u=s(),l=n&&n[3]||(ft.cssNumber[e]?"":"px"),c=(ft.cssNumber[e]||"px"!==l&&+u)&&Ft.exec(ft.css(t,e));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,ft.style(t,e,c+l);while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function f(t){var e=Vt.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}function h(t,e){var n,r,i=0,o="undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e||"*"):"undefined"!=typeof t.querySelectorAll?t.querySelectorAll(e||"*"):void 0;if(!o)for(o=[],n=t.childNodes||t;null!=(r=n[i]);i++)!e||ft.nodeName(r,e)?o.push(r):ft.merge(o,h(r,e));return void 0===e||e&&ft.nodeName(t,e)?ft.merge([t],o):o}function m(t,e){for(var n,r=0;null!=(n=t[r]);r++)ft._data(n,"globalEval",!e||ft._data(e[r],"globalEval"))}function y(t){Ot.test(t.type)&&(t.defaultChecked=t.checked)}function g(t,e,n,r,i){for(var o,a,s,u,l,c,d,p=t.length,g=f(e),v=[],b=0;b"!==d[1]||Xt.test(a)?0:u:u.firstChild,o=a&&a.childNodes.length;o--;)ft.nodeName(c=a.childNodes[o],"tbody")&&!c.childNodes.length&&a.removeChild(c);for(ft.merge(v,u.childNodes),u.textContent="";u.firstChild;)u.removeChild(u.firstChild);u=g.lastChild}else v.push(e.createTextNode(a));for(u&&g.removeChild(u),dt.appendChecked||ft.grep(h(v,"input"),y),b=0;a=v[b++];)if(r&&ft.inArray(a,r)>-1)i&&i.push(a);else if(s=ft.contains(a.ownerDocument,a),u=h(g.appendChild(a),"script"),s&&m(u),n)for(o=0;a=u[o++];)Wt.test(a.type||"")&&n.push(a);return u=null,g}function v(){return!0}function b(){return!1}function x(){try{return rt.activeElement}catch(t){}}function w(t,e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=void 0);for(s in e)w(t,s,n,r,e[s],o);return t}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=b;else if(!i)return t;return 1===o&&(a=i,i=function(t){return ft().off(t),a.apply(this,arguments)},i.guid=a.guid||(a.guid=ft.guid++)),t.each(function(){ft.event.add(this,e,i,r,n)})}function E(t,e){return ft.nodeName(t,"table")&&ft.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function T(t){return t.type=(null!==ft.find.attr(t,"type"))+"/"+t.type,t}function S(t){var e=ie.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function C(t,e){if(1===e.nodeType&&ft.hasData(t)){var n,r,i,o=ft._data(t),a=ft._data(e,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;r1&&"string"==typeof f&&!dt.checkClone&&re.test(f))return t.each(function(i){var o=t.eq(i);m&&(e[0]=f.call(this,i,o.html())),L(o,e,n,r)});if(d&&(l=g(e,t[0].ownerDocument,!1,t,r),i=l.firstChild,1===l.childNodes.length&&(l=i),i||r)){for(s=ft.map(h(l,"script"),T),a=s.length;c")).appendTo(e.documentElement),e=(ue[0].contentWindow||ue[0].contentDocument).document,e.write(),e.close(),n=A(t,e),ue.detach()),le[t]=n),n}function R(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function D(t){if(t in Se)return t;for(var e=t.charAt(0).toUpperCase()+t.slice(1),n=Te.length;n--;)if(t=Te[n]+e,t in Se)return t}function j(t,e){for(var n,r,i,o=[],a=0,s=t.length;a=0&&n=0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},isPlainObject:function(t){var e;if(!t||"object"!==ft.type(t)||t.nodeType||ft.isWindow(t))return!1;try{if(t.constructor&&!ct.call(t,"constructor")&&!ct.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}if(!dt.ownFirst)for(e in t)return ct.call(t,e);for(e in t);return void 0===e||ct.call(t,e)},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?ut[lt.call(t)]||"object":typeof t},globalEval:function(e){e&&ft.trim(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(mt,"ms-").replace(yt,gt)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e){var r,i=0;if(n(t))for(r=t.length;iE.cacheLength&&delete t[e.shift()],t[n+" "]=r}var e=[];return t}function r(t){return t[M]=!0,t}function i(t){var e=D.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function o(t,e){for(var n=t.split("|"),r=n.length;r--;)E.attrHandle[n[r]]=e}function a(t,e){var n=e&&t,r=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||X)-(~t.sourceIndex||X);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function s(t){return function(e){var n=e.nodeName.toLowerCase();return"input"===n&&e.type===t}}function u(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function l(t){return r(function(e){return e=+e,r(function(n,r){for(var i,o=t([],n.length,e),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function c(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function d(){}function p(t){for(var e=0,n=t.length,r="";e1?function(e,n,r){for(var i=t.length;i--;)if(!t[i](e,n,r))return!1;return!0}:t[0]}function m(t,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(a[l]=d))}}else b=y(b===a?b.splice(h,b.length):b),o?o(null,a,b,u):Q.apply(a,b)})}function v(t){for(var e,n,r,i=t.length,o=E.relative[t[0].type],a=o||E.relative[" "],s=o?1:0,u=f(function(t){return t===e},a,!0),l=f(function(t){return tt(e,t)>-1},a,!0),c=[function(t,n,r){var i=!o&&(r||n!==N)||((e=n).nodeType?u(t,n,r):l(t,n,r));return e=null,i}];s1&&h(c),s>1&&p(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(st,"$1"),n,s0,o=t.length>0,a=function(r,a,s,u,l){var c,d,p,f=0,h="0",m=r&&[],g=[],v=N,b=r||o&&E.find.TAG("*",l),x=_+=null==v?1:Math.random()||.1,w=b.length;for(l&&(N=a===D||a||l);h!==w&&null!=(c=b[h]);h++){if(o&&c){for(d=0,a||c.ownerDocument===D||(R(c),s=!H);p=t[d++];)if(p(c,a||D,s)){u.push(c);break}l&&(_=x)}i&&((c=!p&&c)&&f--,r&&m.push(c))}if(f+=h,i&&h!==f){for(d=0;p=n[d++];)p(m,g,a,s);if(r){if(f>0)for(;h--;)m[h]||g[h]||(g[h]=Y.call(u));g=y(g)}Q.apply(u,g),l&&!r&&g.length>0&&f+n.length>1&&e.uniqueSort(u)}return l&&(_=x,N=v),m};return i?r(a):a}var x,w,E,T,S,C,k,L,N,A,q,R,D,j,H,P,F,I,B,M="sizzle"+1*new Date,O=t.document,_=0,W=0,z=n(),V=n(),$=n(),U=function(t,e){return t===e&&(q=!0),0},X=1<<31,K={}.hasOwnProperty,G=[],Y=G.pop,J=G.push,Q=G.push,Z=G.slice,tt=function(t,e){for(var n=0,r=t.length;n+~]|"+nt+")"+nt+"*"),ct=new RegExp("="+nt+"*([^\\]'\"]*?)"+nt+"*\\]","g"),dt=new RegExp(ot),pt=new RegExp("^"+rt+"$"),ft={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),TAG:new RegExp("^("+rt+"|[*])"),ATTR:new RegExp("^"+it),PSEUDO:new RegExp("^"+ot),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},ht=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,yt=/^[^{]+\{\s*\[native \w/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,vt=/[+~]/,bt=/'|\\/g,xt=new RegExp("\\\\([\\da-f]{1,6}"+nt+"?|("+nt+")|.)","ig"),wt=function(t,e,n){var r="0x"+e-65536;return r!==r||n?e:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Et=function(){R()};try{Q.apply(G=Z.call(O.childNodes),O.childNodes),G[O.childNodes.length].nodeType}catch(t){Q={apply:G.length?function(t,e){J.apply(t,Z.call(e))}:function(t,e){for(var n=t.length,r=0;t[n++]=e[r++];);t.length=n-1}}}w=e.support={},S=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},R=e.setDocument=function(t){var e,n,r=t?t.ownerDocument||t:O;return r!==D&&9===r.nodeType&&r.documentElement?(D=r,j=D.documentElement,H=!S(D),(n=D.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Et,!1):n.attachEvent&&n.attachEvent("onunload",Et)),w.attributes=i(function(t){return t.className="i",!t.getAttribute("className")}),w.getElementsByTagName=i(function(t){return t.appendChild(D.createComment("")),!t.getElementsByTagName("*").length}),w.getElementsByClassName=yt.test(D.getElementsByClassName),w.getById=i(function(t){return j.appendChild(t).id=M,!D.getElementsByName||!D.getElementsByName(M).length}),w.getById?(E.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&H){var n=e.getElementById(t);return n?[n]:[]}},E.filter.ID=function(t){var e=t.replace(xt,wt);return function(t){return t.getAttribute("id")===e}}):(delete E.find.ID,E.filter.ID=function(t){var e=t.replace(xt,wt);return function(t){var n="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),E.find.TAG=w.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):w.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,r=[],i=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},E.find.CLASS=w.getElementsByClassName&&function(t,e){if("undefined"!=typeof e.getElementsByClassName&&H)return e.getElementsByClassName(t)},F=[],P=[],(w.qsa=yt.test(D.querySelectorAll))&&(i(function(t){j.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+nt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||P.push("\\["+nt+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+M+"-]").length||P.push("~="),t.querySelectorAll(":checked").length||P.push(":checked"),t.querySelectorAll("a#"+M+"+*").length||P.push(".#.+[+~]")}),i(function(t){var e=D.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&P.push("name"+nt+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||P.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),P.push(",.*:")})),(w.matchesSelector=yt.test(I=j.matches||j.webkitMatchesSelector||j.mozMatchesSelector||j.oMatchesSelector||j.msMatchesSelector))&&i(function(t){w.disconnectedMatch=I.call(t,"div"),I.call(t,"[s!='']:x"),F.push("!=",ot)}),P=P.length&&new RegExp(P.join("|")),F=F.length&&new RegExp(F.join("|")),e=yt.test(j.compareDocumentPosition),B=e||yt.test(j.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,r=e&&e.parentNode;return t===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):t.compareDocumentPosition&&16&t.compareDocumentPosition(r)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},U=e?function(t,e){if(t===e)return q=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n?n:(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&n||!w.sortDetached&&e.compareDocumentPosition(t)===n?t===D||t.ownerDocument===O&&B(O,t)?-1:e===D||e.ownerDocument===O&&B(O,e)?1:A?tt(A,t)-tt(A,e):0:4&n?-1:1)}:function(t,e){if(t===e)return q=!0,0;var n,r=0,i=t.parentNode,o=e.parentNode,s=[t],u=[e];if(!i||!o)return t===D?-1:e===D?1:i?-1:o?1:A?tt(A,t)-tt(A,e):0;if(i===o)return a(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===O?-1:u[r]===O?1:0},D):D},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==D&&R(t),n=n.replace(ct,"='$1']"),w.matchesSelector&&H&&!$[n+" "]&&(!F||!F.test(n))&&(!P||!P.test(n)))try{var r=I.call(t,n);if(r||w.disconnectedMatch||t.document&&11!==t.document.nodeType)return r}catch(t){}return e(n,D,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==D&&R(t),B(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==D&&R(t);var n=E.attrHandle[e.toLowerCase()],r=n&&K.call(E.attrHandle,e.toLowerCase())?n(t,e,!H):void 0;return void 0!==r?r:w.attributes||!H?t.getAttribute(e):(r=t.getAttributeNode(e))&&r.specified?r.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],r=0,i=0;if(q=!w.detectDuplicates,A=!w.sortStable&&t.slice(0),t.sort(U),q){for(;e=t[i++];)e===t[i]&&(r=n.push(i));for(;r--;)t.splice(n[r],1)}return A=null,t},T=e.getText=function(t){var e,n="",r=0,i=t.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=T(t)}else if(3===i||4===i)return t.nodeValue}else for(;e=t[r++];)n+=T(e);return n},E=e.selectors={cacheLength:50,createPseudo:r,match:ft,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(xt,wt),t[3]=(t[3]||t[4]||t[5]||"").replace(xt,wt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return ft.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&dt.test(n)&&(e=C(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(xt,wt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=z[t+" "];return e||(e=new RegExp("(^|"+nt+")"+t+"("+nt+"|$)"))&&z(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,r){return function(i){var o=e.attr(i,t);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(at," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(t,e,n,r,i){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===r&&0===i?function(t){return!!t.parentNode}:function(e,n,u){var l,c,d,p,f,h,m=o!==a?"nextSibling":"previousSibling",y=e.parentNode,g=s&&e.nodeName.toLowerCase(),v=!u&&!s,b=!1;if(y){if(o){for(;m;){for(p=e;p=p[m];)if(s?p.nodeName.toLowerCase()===g:1===p.nodeType)return!1;h=m="only"===t&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&v){for(p=y,d=p[M]||(p[M]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),l=c[t]||[],f=l[0]===_&&l[1],b=f&&l[2],p=f&&y.childNodes[f];p=++f&&p&&p[m]||(b=f=0)||h.pop();)if(1===p.nodeType&&++b&&p===e){c[t]=[_,f,b];break}}else if(v&&(p=e,d=p[M]||(p[M]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),l=c[t]||[],f=l[0]===_&&l[1],b=f),b===!1)for(;(p=++f&&p&&p[m]||(b=f=0)||h.pop())&&((s?p.nodeName.toLowerCase()!==g:1!==p.nodeType)||!++b||(v&&(d=p[M]||(p[M]={}),c=d[p.uniqueID]||(d[p.uniqueID]={}),c[t]=[_,b]),p!==e)););return b-=i,b===r||b%r===0&&b/r>=0}}},PSEUDO:function(t,n){var i,o=E.pseudos[t]||E.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[M]?o(n):o.length>1?(i=[t,t,"",n],E.setFilters.hasOwnProperty(t.toLowerCase())?r(function(t,e){for(var r,i=o(t,n),a=i.length;a--;)r=tt(t,i[a]),t[r]=!(e[r]=i[a])}):function(t){return o(t,0,i)}):o}},pseudos:{not:r(function(t){ +var e=[],n=[],i=k(t.replace(st,"$1"));return i[M]?r(function(t,e,n,r){for(var o,a=i(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}}),has:r(function(t){return function(n){return e(t,n).length>0}}),contains:r(function(t){return t=t.replace(xt,wt),function(e){return(e.textContent||e.innerText||T(e)).indexOf(t)>-1}}),lang:r(function(t){return pt.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(xt,wt).toLowerCase(),function(e){var n;do if(n=H?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return n=n.toLowerCase(),n===t||0===n.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===j},focus:function(t){return t===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!E.pseudos.empty(t)},header:function(t){return mt.test(t.nodeName)},input:function(t){return ht.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:l(function(){return[0]}),last:l(function(t,e){return[e-1]}),eq:l(function(t,e,n){return[n<0?n+e:n]}),even:l(function(t,e){for(var n=0;n=0;)t.push(r);return t}),gt:l(function(t,e,n){for(var r=n<0?n+e:n;++r2&&"ID"===(a=o[0]).type&&w.getById&&9===e.nodeType&&H&&E.relative[o[1].type]){if(e=(E.find.ID(a.matches[0].replace(xt,wt),e)||[])[0],!e)return n;l&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(i=ft.needsContext.test(t)?0:o.length;i--&&(a=o[i],!E.relative[s=a.type]);)if((u=E.find[s])&&(r=u(a.matches[0].replace(xt,wt),vt.test(o[0].type)&&c(e.parentNode)||e))){if(o.splice(i,1),t=r.length&&p(o),!t)return Q.apply(n,r),n;break}}return(l||k(t,d))(r,e,!H,n,!e||vt.test(t)&&c(e.parentNode)||e),n},w.sortStable=M.split("").sort(U).join("")===M,w.detectDuplicates=!!q,R(),w.sortDetached=i(function(t){return 1&t.compareDocumentPosition(D.createElement("div"))}),i(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),w.attributes&&i(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),i(function(t){return null==t.getAttribute("disabled")})||o(et,function(t,e,n){var r;if(!n)return t[e]===!0?e.toLowerCase():(r=t.getAttributeNode(e))&&r.specified?r.value:null}),e}(t);ft.find=vt,ft.expr=vt.selectors,ft.expr[":"]=ft.expr.pseudos,ft.uniqueSort=ft.unique=vt.uniqueSort,ft.text=vt.getText,ft.isXMLDoc=vt.isXML,ft.contains=vt.contains;var bt=function(t,e,n){for(var r=[],i=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(i&&ft(t).is(n))break;r.push(t)}return r},xt=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},wt=ft.expr.match.needsContext,Et=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Tt=/^.[^:#\[\.,]*$/;ft.filter=function(t,e,n){var r=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===r.nodeType?ft.find.matchesSelector(r,t)?[r]:[]:ft.find.matches(t,ft.grep(e,function(t){return 1===t.nodeType}))},ft.fn.extend({find:function(t){var e,n=[],r=this,i=r.length;if("string"!=typeof t)return this.pushStack(ft(t).filter(function(){for(e=0;e1?ft.unique(n):n),n.selector=this.selector?this.selector+" "+t:t,n},filter:function(t){return this.pushStack(r(this,t||[],!1))},not:function(t){return this.pushStack(r(this,t||[],!0))},is:function(t){return!!r(this,"string"==typeof t&&wt.test(t)?ft(t):t||[],!1).length}});var St,Ct=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,kt=ft.fn.init=function(t,e,n){var r,i;if(!t)return this;if(n=n||St,"string"==typeof t){if(r="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:Ct.exec(t),!r||!r[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(r[1]){if(e=e instanceof ft?e[0]:e,ft.merge(this,ft.parseHTML(r[1],e&&e.nodeType?e.ownerDocument||e:rt,!0)),Et.test(r[1])&&ft.isPlainObject(e))for(r in e)ft.isFunction(this[r])?this[r](e[r]):this.attr(r,e[r]);return this}if(i=rt.getElementById(r[2]),i&&i.parentNode){if(i.id!==r[2])return St.find(t);this.length=1,this[0]=i}return this.context=rt,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):ft.isFunction(t)?"undefined"!=typeof n.ready?n.ready(t):t(ft):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),ft.makeArray(t,this))};kt.prototype=ft.fn,St=ft(rt);var Lt=/^(?:parents|prev(?:Until|All))/,Nt={children:!0,contents:!0,next:!0,prev:!0};ft.fn.extend({has:function(t){var e,n=ft(t,this),r=n.length;return this.filter(function(){for(e=0;e-1:1===n.nodeType&&ft.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?ft.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?ft.inArray(this[0],ft(t)):ft.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(ft.uniqueSort(ft.merge(this.get(),ft(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),ft.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return bt(t,"parentNode")},parentsUntil:function(t,e,n){return bt(t,"parentNode",n)},next:function(t){return i(t,"nextSibling")},prev:function(t){return i(t,"previousSibling")},nextAll:function(t){return bt(t,"nextSibling")},prevAll:function(t){return bt(t,"previousSibling")},nextUntil:function(t,e,n){return bt(t,"nextSibling",n)},prevUntil:function(t,e,n){return bt(t,"previousSibling",n)},siblings:function(t){return xt((t.parentNode||{}).firstChild,t)},children:function(t){return xt(t.firstChild)},contents:function(t){return ft.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:ft.merge([],t.childNodes)}},function(t,e){ft.fn[t]=function(n,r){var i=ft.map(this,e,n);return"Until"!==t.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=ft.filter(r,i)),this.length>1&&(Nt[t]||(i=ft.uniqueSort(i)),Lt.test(t)&&(i=i.reverse())),this.pushStack(i)}});var At=/\S+/g;ft.Callbacks=function(t){t="string"==typeof t?o(t):ft.extend({},t);var e,n,r,i,a=[],s=[],u=-1,l=function(){for(i=t.once,r=e=!0;s.length;u=-1)for(n=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(t){return t?ft.inArray(t,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return i=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return i=!0,n||c.disable(),this},locked:function(){return!!i},fireWith:function(t,n){return i||(n=n||[],n=[t,n.slice?n.slice():n],s.push(n),e||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},ft.extend({Deferred:function(t){var e=[["resolve","done",ft.Callbacks("once memory"),"resolved"],["reject","fail",ft.Callbacks("once memory"),"rejected"],["notify","progress",ft.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var t=arguments;return ft.Deferred(function(n){ft.each(e,function(e,o){var a=ft.isFunction(t[e])&&t[e];i[o[1]](function(){var t=a&&a.apply(this,arguments);t&&ft.isFunction(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[o[0]+"With"](this===r?n.promise():this,a?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?ft.extend(t,r):r}},i={};return r.pipe=r.then,ft.each(e,function(t,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},e[1^t][2].disable,e[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),t&&t.call(i,i),i},when:function(t){var e,n,r,i=0,o=it.call(arguments),a=o.length,s=1!==a||t&&ft.isFunction(t.promise)?a:0,u=1===s?t:ft.Deferred(),l=function(t,n,r){return function(i){n[t]=this,r[t]=arguments.length>1?it.call(arguments):i,r===e?u.notifyWith(n,r):--s||u.resolveWith(n,r)}};if(a>1)for(e=new Array(a),n=new Array(a),r=new Array(a);i0||(qt.resolveWith(rt,[ft]),ft.fn.triggerHandler&&(ft(rt).triggerHandler("ready"),ft(rt).off("ready"))))}}),ft.ready.promise=function(e){if(!qt)if(qt=ft.Deferred(),"complete"===rt.readyState||"loading"!==rt.readyState&&!rt.documentElement.doScroll)t.setTimeout(ft.ready);else if(rt.addEventListener)rt.addEventListener("DOMContentLoaded",s),t.addEventListener("load",s);else{rt.attachEvent("onreadystatechange",s),t.attachEvent("onload",s);var n=!1;try{n=null==t.frameElement&&rt.documentElement}catch(t){}n&&n.doScroll&&!function e(){if(!ft.isReady){try{n.doScroll("left")}catch(n){return t.setTimeout(e,50)}a(),ft.ready()}}()}return qt.promise(e)},ft.ready.promise();var Rt;for(Rt in ft(dt))break;dt.ownFirst="0"===Rt,dt.inlineBlockNeedsLayout=!1,ft(function(){var t,e,n,r;n=rt.getElementsByTagName("body")[0],n&&n.style&&(e=rt.createElement("div"),r=rt.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(r).appendChild(e),"undefined"!=typeof e.style.zoom&&(e.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",dt.inlineBlockNeedsLayout=t=3===e.offsetWidth,t&&(n.style.zoom=1)),n.removeChild(r))}),function(){var t=rt.createElement("div");dt.deleteExpando=!0;try{delete t.test}catch(t){dt.deleteExpando=!1}t=null}();var Dt=function(t){var e=ft.noData[(t.nodeName+" ").toLowerCase()],n=+t.nodeType||1;return(1===n||9===n)&&(!e||e!==!0&&t.getAttribute("classid")===e)},jt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ht=/([A-Z])/g;ft.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(t){return t=t.nodeType?ft.cache[t[ft.expando]]:t[ft.expando],!!t&&!l(t)},data:function(t,e,n){return c(t,e,n)},removeData:function(t,e){return d(t,e)},_data:function(t,e,n){return c(t,e,n,!0)},_removeData:function(t,e){return d(t,e,!0)}}),ft.fn.extend({data:function(t,e){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length&&(i=ft.data(o),1===o.nodeType&&!ft._data(o,"parsedAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=ft.camelCase(r.slice(5)),u(o,r,i[r])));ft._data(o,"parsedAttrs",!0)}return i}return"object"==typeof t?this.each(function(){ft.data(this,t)}):arguments.length>1?this.each(function(){ft.data(this,t,e)}):o?u(o,t,ft.data(o,t)):void 0},removeData:function(t){return this.each(function(){ft.removeData(this,t)})}}),ft.extend({queue:function(t,e,n){var r;if(t)return e=(e||"fx")+"queue",r=ft._data(t,e),n&&(!r||ft.isArray(n)?r=ft._data(t,e,ft.makeArray(n)):r.push(n)),r||[]},dequeue:function(t,e){e=e||"fx";var n=ft.queue(t,e),r=n.length,i=n.shift(),o=ft._queueHooks(t,e),a=function(){ft.dequeue(t,e)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===e&&n.unshift("inprogress"),delete o.stop,i.call(t,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return ft._data(t,n)||ft._data(t,n,{empty:ft.Callbacks("once memory").add(function(){ft._removeData(t,e+"queue"),ft._removeData(t,n)})})}}),ft.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length
a",dt.leadingWhitespace=3===t.firstChild.nodeType,dt.tbody=!t.getElementsByTagName("tbody").length,dt.htmlSerialize=!!t.getElementsByTagName("link").length,dt.html5Clone="<:nav>"!==rt.createElement("nav").cloneNode(!0).outerHTML,n.type="checkbox",n.checked=!0,e.appendChild(n),dt.appendChecked=n.checked,t.innerHTML="",dt.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,e.appendChild(t),n=rt.createElement("input"),n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),dt.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,dt.noCloneEvent=!!t.addEventListener,t[ft.expando]=1,dt.attributes=!t.getAttribute(ft.expando)}();var $t={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:dt.htmlSerialize?[0,"",""]:[1,"X
","
"]};$t.optgroup=$t.option,$t.tbody=$t.tfoot=$t.colgroup=$t.caption=$t.thead,$t.th=$t.td;var Ut=/<|&#?\w+;/,Xt=/-1&&(h=f.split("."),f=h.shift(),h.sort()),a=f.indexOf(":")<0&&"on"+f,e=e[ft.expando]?e:new ft.Event(f,"object"==typeof e&&e),e.isTrigger=i?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),n=null==n?[e]:ft.makeArray(n,[e]),l=ft.event.special[f]||{},i||!l.trigger||l.trigger.apply(r,n)!==!1)){if(!i&&!l.noBubble&&!ft.isWindow(r)){for(u=l.delegateType||f,Jt.test(u+f)||(s=s.parentNode);s;s=s.parentNode)p.push(s),c=s;c===(r.ownerDocument||rt)&&p.push(c.defaultView||c.parentWindow||t)}for(d=0;(s=p[d++])&&!e.isPropagationStopped();)e.type=d>1?u:l.bindType||f,o=(ft._data(s,"events")||{})[e.type]&&ft._data(s,"handle"),o&&o.apply(s,n),o=a&&s[a],o&&o.apply&&Dt(s)&&(e.result=o.apply(s,n),e.result===!1&&e.preventDefault());if(e.type=f,!i&&!e.isDefaultPrevented()&&(!l._default||l._default.apply(p.pop(),n)===!1)&&Dt(r)&&a&&r[f]&&!ft.isWindow(r)){c=r[a],c&&(r[a]=null),ft.event.triggered=f;try{r[f]()}catch(t){}ft.event.triggered=void 0,c&&(r[a]=c)}return e.result}},dispatch:function(t){t=ft.event.fix(t);var e,n,r,i,o,a=[],s=it.call(arguments),u=(ft._data(this,"events")||{})[t.type]||[],l=ft.event.special[t.type]||{};if(s[0]=t,t.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,t)!==!1){for(a=ft.event.handlers.call(this,t,u),e=0;(i=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(o.namespace)||(t.handleObj=o,t.data=o.data,r=((ft.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s),void 0!==r&&(t.result=r)===!1&&(t.preventDefault(),t.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,r,i,o,a=[],s=e.delegateCount,u=t.target;if(s&&u.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==t.type)){for(r=[],n=0;n-1:ft.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&a.push({elem:u,handlers:r})}return s]","i"),ee=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,ne=/\s*$/g,ae=f(rt),se=ae.appendChild(rt.createElement("div"));ft.extend({htmlPrefilter:function(t){return t.replace(ee,"<$1>")},clone:function(t,e,n){var r,i,o,a,s,u=ft.contains(t.ownerDocument,t);if(dt.html5Clone||ft.isXMLDoc(t)||!te.test("<"+t.nodeName+">")?o=t.cloneNode(!0):(se.innerHTML=t.outerHTML,se.removeChild(o=se.firstChild)),!(dt.noCloneEvent&&dt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||ft.isXMLDoc(t)))for(r=h(o),s=h(t),a=0;null!=(i=s[a]);++a)r[a]&&k(i,r[a]);if(e)if(n)for(s=s||h(t),r=r||h(o),a=0;null!=(i=s[a]);a++)C(i,r[a]);else C(t,o);return r=h(o,"script"),r.length>0&&m(r,!u&&h(t,"script")),r=s=i=null,o},cleanData:function(t,e){for(var n,r,i,o,a=0,s=ft.expando,u=ft.cache,l=dt.attributes,c=ft.event.special;null!=(n=t[a]);a++)if((e||Dt(n))&&(i=n[s],o=i&&u[i])){if(o.events)for(r in o.events)c[r]?ft.event.remove(n,r):ft.removeEvent(n,r,o.handle);u[i]&&(delete u[i],l||"undefined"==typeof n.removeAttribute?n[s]=void 0:n.removeAttribute(s),nt.push(i))}}}),ft.fn.extend({domManip:L,detach:function(t){return N(this,t,!0)},remove:function(t){return N(this,t)},text:function(t){return Mt(this,function(t){return void 0===t?ft.text(this):this.empty().append((this[0]&&this[0].ownerDocument||rt).createTextNode(t))},null,t,arguments.length)},append:function(){return L(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=E(this,t);e.appendChild(t)}})},prepend:function(){return L(this,arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=E(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return L(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return L(this,arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},empty:function(){for(var t,e=0;null!=(t=this[e]);e++){for(1===t.nodeType&&ft.cleanData(h(t,!1));t.firstChild;)t.removeChild(t.firstChild);t.options&&ft.nodeName(t,"select")&&(t.options.length=0)}return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return ft.clone(this,t,e)})},html:function(t){return Mt(this,function(t){var e=this[0]||{},n=0,r=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(Zt,""):void 0;if("string"==typeof t&&!ne.test(t)&&(dt.htmlSerialize||!te.test(t))&&(dt.leadingWhitespace||!zt.test(t))&&!$t[(_t.exec(t)||["",""])[1].toLowerCase()]){t=ft.htmlPrefilter(t);try{for(;nt",l.childNodes[0].style.borderCollapse="separate",e=l.getElementsByTagName("td"), +e[0].style.cssText="margin:0;border:0;padding:0;display:none",o=0===e[0].offsetHeight,o&&(e[0].style.display="",e[1].style.display="none",o=0===e[0].offsetHeight)),d.removeChild(u)}var n,r,i,o,a,s,u=rt.createElement("div"),l=rt.createElement("div");l.style&&(l.style.cssText="float:left;opacity:.5",dt.opacity="0.5"===l.style.opacity,dt.cssFloat=!!l.style.cssFloat,l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",dt.clearCloneStyle="content-box"===l.style.backgroundClip,u=rt.createElement("div"),u.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",l.innerHTML="",u.appendChild(l),dt.boxSizing=""===l.style.boxSizing||""===l.style.MozBoxSizing||""===l.style.WebkitBoxSizing,ft.extend(dt,{reliableHiddenOffsets:function(){return null==n&&e(),o},boxSizingReliable:function(){return null==n&&e(),i},pixelMarginRight:function(){return null==n&&e(),r},pixelPosition:function(){return null==n&&e(),n},reliableMarginRight:function(){return null==n&&e(),a},reliableMarginLeft:function(){return null==n&&e(),s}}))}();var he,me,ye=/^(top|right|bottom|left)$/;t.getComputedStyle?(he=function(e){var n=e.ownerDocument.defaultView;return n&&n.opener||(n=t),n.getComputedStyle(e)},me=function(t,e,n){var r,i,o,a,s=t.style;return n=n||he(t),a=n?n.getPropertyValue(e)||n[e]:void 0,""!==a&&void 0!==a||ft.contains(t.ownerDocument,t)||(a=ft.style(t,e)),n&&!dt.pixelMarginRight()&&de.test(a)&&ce.test(e)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o),void 0===a?a:a+""}):fe.currentStyle&&(he=function(t){return t.currentStyle},me=function(t,e,n){var r,i,o,a,s=t.style;return n=n||he(t),a=n?n[e]:void 0,null==a&&s&&s[e]&&(a=s[e]),de.test(a)&&!ye.test(e)&&(r=s.left,i=t.runtimeStyle,o=i&&i.left,o&&(i.left=t.currentStyle.left),s.left="fontSize"===e?"1em":a,a=s.pixelLeft+"px",s.left=r,o&&(i.left=o)),void 0===a?a:a+""||"auto"});var ge=/alpha\([^)]*\)/i,ve=/opacity\s*=\s*([^)]*)/i,be=/^(none|table(?!-c[ea]).+)/,xe=new RegExp("^("+Pt+")(.*)$","i"),we={position:"absolute",visibility:"hidden",display:"block"},Ee={letterSpacing:"0",fontWeight:"400"},Te=["Webkit","O","Moz","ms"],Se=rt.createElement("div").style;ft.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=me(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,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":dt.cssFloat?"cssFloat":"styleFloat"},style:function(t,e,n,r){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var i,o,a,s=ft.camelCase(e),u=t.style;if(e=ft.cssProps[s]||(ft.cssProps[s]=D(s)||s),a=ft.cssHooks[e]||ft.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(t,!1,r))?i:u[e];if(o=typeof n,"string"===o&&(i=Ft.exec(n))&&i[1]&&(n=p(t,e,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(ft.cssNumber[s]?"":"px")),dt.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),!(a&&"set"in a&&void 0===(n=a.set(t,n,r)))))try{u[e]=n}catch(t){}}},css:function(t,e,n,r){var i,o,a,s=ft.camelCase(e);return e=ft.cssProps[s]||(ft.cssProps[s]=D(s)||s),a=ft.cssHooks[e]||ft.cssHooks[s],a&&"get"in a&&(o=a.get(t,!0,n)),void 0===o&&(o=me(t,e,r)),"normal"===o&&e in Ee&&(o=Ee[e]),""===n||n?(i=parseFloat(o),n===!0||isFinite(i)?i||0:o):o}}),ft.each(["height","width"],function(t,e){ft.cssHooks[e]={get:function(t,n,r){if(n)return be.test(ft.css(t,"display"))&&0===t.offsetWidth?pe(t,we,function(){return F(t,e,r)}):F(t,e,r)},set:function(t,n,r){var i=r&&he(t);return H(t,n,r?P(t,e,r,dt.boxSizing&&"border-box"===ft.css(t,"boxSizing",!1,i),i):0)}}}),dt.opacity||(ft.cssHooks.opacity={get:function(t,e){return ve.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,r=t.currentStyle,i=ft.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(e>=1||""===e)&&""===ft.trim(o.replace(ge,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===e||r&&!r.filter)||(n.filter=ge.test(o)?o.replace(ge,i):o+" "+i)}}),ft.cssHooks.marginRight=R(dt.reliableMarginRight,function(t,e){if(e)return pe(t,{display:"inline-block"},me,[t,"marginRight"])}),ft.cssHooks.marginLeft=R(dt.reliableMarginLeft,function(t,e){if(e)return(parseFloat(me(t,"marginLeft"))||(ft.contains(t.ownerDocument,t)?t.getBoundingClientRect().left-pe(t,{marginLeft:0},function(){return t.getBoundingClientRect().left}):0))+"px"}),ft.each({margin:"",padding:"",border:"Width"},function(t,e){ft.cssHooks[t+e]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[t+It[r]+e]=o[r]||o[r-2]||o[0];return i}},ce.test(t)||(ft.cssHooks[t+e].set=H)}),ft.fn.extend({css:function(t,e){return Mt(this,function(t,e,n){var r,i,o={},a=0;if(ft.isArray(e)){for(r=he(t),i=e.length;a1)},show:function(){return j(this,!0)},hide:function(){return j(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Bt(this)?ft(this).show():ft(this).hide()})}}),ft.Tween=I,I.prototype={constructor:I,init:function(t,e,n,r,i,o){this.elem=t,this.prop=n,this.easing=i||ft.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ft.cssNumber[n]?"":"px")},cur:function(){var t=I.propHooks[this.prop];return t&&t.get?t.get(this):I.propHooks._default.get(this)},run:function(t){var e,n=I.propHooks[this.prop];return this.options.duration?this.pos=e=ft.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):I.propHooks._default.set(this),this}},I.prototype.init.prototype=I.prototype,I.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=ft.css(t.elem,t.prop,""),e&&"auto"!==e?e:0)},set:function(t){ft.fx.step[t.prop]?ft.fx.step[t.prop](t):1!==t.elem.nodeType||null==t.elem.style[ft.cssProps[t.prop]]&&!ft.cssHooks[t.prop]?t.elem[t.prop]=t.now:ft.style(t.elem,t.prop,t.now+t.unit)}}},I.propHooks.scrollTop=I.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},ft.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},ft.fx=I.prototype.init,ft.fx.step={};var Ce,ke,Le=/^(?:toggle|show|hide)$/,Ne=/queueHooks$/;ft.Animation=ft.extend(z,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return p(n.elem,t,Ft.exec(e),n),n}]},tweener:function(t,e){ft.isFunction(t)?(e=t,t=["*"]):t=t.match(At);for(var n,r=0,i=t.length;r
a",t=n.getElementsByTagName("a")[0],e.setAttribute("type","checkbox"),n.appendChild(e),t=n.getElementsByTagName("a")[0],t.style.cssText="top:1px",dt.getSetAttribute="t"!==n.className,dt.style=/top/.test(t.getAttribute("style")),dt.hrefNormalized="/a"===t.getAttribute("href"),dt.checkOn=!!e.value,dt.optSelected=i.selected,dt.enctype=!!rt.createElement("form").enctype,r.disabled=!0,dt.optDisabled=!i.disabled,e=rt.createElement("input"),e.setAttribute("value",""),dt.input=""===e.getAttribute("value"),e.value="t",e.setAttribute("type","radio"),dt.radioValue="t"===e.value}();var Ae=/\r/g,qe=/[\x20\t\r\n\f]+/g;ft.fn.extend({val:function(t){var e,n,r,i=this[0];{if(arguments.length)return r=ft.isFunction(t),this.each(function(n){var i;1===this.nodeType&&(i=r?t.call(this,n,ft(this).val()):t,null==i?i="":"number"==typeof i?i+="":ft.isArray(i)&&(i=ft.map(i,function(t){return null==t?"":t+""})),e=ft.valHooks[this.type]||ft.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,i,"value")||(this.value=i))});if(i)return e=ft.valHooks[i.type]||ft.valHooks[i.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(n=e.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Ae,""):null==n?"":n)}}}),ft.extend({valHooks:{option:{get:function(t){var e=ft.find.attr(t,"value");return null!=e?e:ft.trim(ft.text(t)).replace(qe," ")}},select:{get:function(t){for(var e,n,r=t.options,i=t.selectedIndex,o="select-one"===t.type||i<0,a=o?null:[],s=o?i+1:r.length,u=i<0?s:o?i:0;u-1)try{r.selected=n=!0}catch(t){r.scrollHeight}else r.selected=!1;return n||(t.selectedIndex=-1),i}}}}),ft.each(["radio","checkbox"],function(){ft.valHooks[this]={set:function(t,e){if(ft.isArray(e))return t.checked=ft.inArray(ft(t).val(),e)>-1}},dt.checkOn||(ft.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var Re,De,je=ft.expr.attrHandle,He=/^(?:checked|selected)$/i,Pe=dt.getSetAttribute,Fe=dt.input;ft.fn.extend({attr:function(t,e){return Mt(this,ft.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){ft.removeAttr(this,t)})}}),ft.extend({attr:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof t.getAttribute?ft.prop(t,e,n):(1===o&&ft.isXMLDoc(t)||(e=e.toLowerCase(),i=ft.attrHooks[e]||(ft.expr.match.bool.test(e)?De:Re)),void 0!==n?null===n?void ft.removeAttr(t,e):i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):i&&"get"in i&&null!==(r=i.get(t,e))?r:(r=ft.find.attr(t,e),null==r?void 0:r))},attrHooks:{type:{set:function(t,e){if(!dt.radioValue&&"radio"===e&&ft.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r,i=0,o=e&&e.match(At);if(o&&1===t.nodeType)for(;n=o[i++];)r=ft.propFix[n]||n,ft.expr.match.bool.test(n)?Fe&&Pe||!He.test(n)?t[r]=!1:t[ft.camelCase("default-"+n)]=t[r]=!1:ft.attr(t,n,""),t.removeAttribute(Pe?n:r)}}),De={set:function(t,e,n){return e===!1?ft.removeAttr(t,n):Fe&&Pe||!He.test(n)?t.setAttribute(!Pe&&ft.propFix[n]||n,n):t[ft.camelCase("default-"+n)]=t[n]=!0,n}},ft.each(ft.expr.match.bool.source.match(/\w+/g),function(t,e){var n=je[e]||ft.find.attr;Fe&&Pe||!He.test(e)?je[e]=function(t,e,r){var i,o;return r||(o=je[e],je[e]=i,i=null!=n(t,e,r)?e.toLowerCase():null,je[e]=o),i}:je[e]=function(t,e,n){if(!n)return t[ft.camelCase("default-"+e)]?e.toLowerCase():null}}),Fe&&Pe||(ft.attrHooks.value={set:function(t,e,n){return ft.nodeName(t,"input")?void(t.defaultValue=e):Re&&Re.set(t,e,n)}}),Pe||(Re={set:function(t,e,n){var r=t.getAttributeNode(n);if(r||t.setAttributeNode(r=t.ownerDocument.createAttribute(n)),r.value=e+="","value"===n||e===t.getAttribute(n))return e}},je.id=je.name=je.coords=function(t,e,n){var r;if(!n)return(r=t.getAttributeNode(e))&&""!==r.value?r.value:null},ft.valHooks.button={get:function(t,e){var n=t.getAttributeNode(e);if(n&&n.specified)return n.value},set:Re.set},ft.attrHooks.contenteditable={set:function(t,e,n){Re.set(t,""!==e&&e,n)}},ft.each(["width","height"],function(t,e){ft.attrHooks[e]={set:function(t,n){if(""===n)return t.setAttribute(e,"auto"),n}}})),dt.style||(ft.attrHooks.style={get:function(t){return t.style.cssText||void 0},set:function(t,e){return t.style.cssText=e+""}});var Ie=/^(?:input|select|textarea|button|object)$/i,Be=/^(?:a|area)$/i;ft.fn.extend({prop:function(t,e){return Mt(this,ft.prop,t,e,arguments.length>1)},removeProp:function(t){return t=ft.propFix[t]||t,this.each(function(){try{this[t]=void 0,delete this[t]}catch(t){}})}}),ft.extend({prop:function(t,e,n){var r,i,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ft.isXMLDoc(t)||(e=ft.propFix[e]||e,i=ft.propHooks[e]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:t[e]=n:i&&"get"in i&&null!==(r=i.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=ft.find.attr(t,"tabindex");return e?parseInt(e,10):Ie.test(t.nodeName)||Be.test(t.nodeName)&&t.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),dt.hrefNormalized||ft.each(["href","src"],function(t,e){ft.propHooks[e]={get:function(t){return t.getAttribute(e,4)}}}),dt.optSelected||(ft.propHooks.selected={get:function(t){var e=t.parentNode;return e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex),null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),ft.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ft.propFix[this.toLowerCase()]=this}),dt.enctype||(ft.propFix.enctype="encoding");var Me=/[\t\r\n\f]/g;ft.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(ft.isFunction(t))return this.each(function(e){ft(this).addClass(t.call(this,e,V(this)))});if("string"==typeof t&&t)for(e=t.match(At)||[];n=this[u++];)if(i=V(n),r=1===n.nodeType&&(" "+i+" ").replace(Me," ")){for(a=0;o=e[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=ft.trim(r),i!==s&&ft.attr(n,"class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(ft.isFunction(t))return this.each(function(e){ft(this).removeClass(t.call(this,e,V(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof t&&t)for(e=t.match(At)||[];n=this[u++];)if(i=V(n),r=1===n.nodeType&&(" "+i+" ").replace(Me," ")){for(a=0;o=e[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=ft.trim(r),i!==s&&ft.attr(n,"class",s)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):ft.isFunction(t)?this.each(function(n){ft(this).toggleClass(t.call(this,n,V(this),e),e)}):this.each(function(){var e,r,i,o;if("string"===n)for(r=0,i=ft(this),o=t.match(At)||[];e=o[r++];)i.hasClass(e)?i.removeClass(e):i.addClass(e);else void 0!==t&&"boolean"!==n||(e=V(this),e&&ft._data(this,"__className__",e),ft.attr(this,"class",e||t===!1?"":ft._data(this,"__className__")||""))})},hasClass:function(t){var e,n,r=0;for(e=" "+t+" ";n=this[r++];)if(1===n.nodeType&&(" "+V(n)+" ").replace(Me," ").indexOf(e)>-1)return!0;return!1}}),ft.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(t,e){ft.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),ft.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}});var Oe=t.location,_e=ft.now(),We=/\?/,ze=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;ft.parseJSON=function(e){if(t.JSON&&t.JSON.parse)return t.JSON.parse(e+"");var n,r=null,i=ft.trim(e+"");return i&&!ft.trim(i.replace(ze,function(t,e,i,o){return n&&e&&(r=0),0===r?t:(n=i||e,r+=!o-!i,"")}))?Function("return "+i)():ft.error("Invalid JSON: "+e)},ft.parseXML=function(e){var n,r;if(!e||"string"!=typeof e)return null;try{t.DOMParser?(r=new t.DOMParser,n=r.parseFromString(e,"text/xml")):(n=new t.ActiveXObject("Microsoft.XMLDOM"),n.async="false",n.loadXML(e))}catch(t){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||ft.error("Invalid XML: "+e),n};var Ve=/#.*$/,$e=/([?&])_=[^&]*/,Ue=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Xe=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ke=/^(?:GET|HEAD)$/,Ge=/^\/\//,Ye=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Je={},Qe={},Ze="*/".concat("*"),tn=Oe.href,en=Ye.exec(tn.toLowerCase())||[];ft.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tn,type:"GET",isLocal:Xe.test(en[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ze,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ft.parseJSON,"text xml":ft.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?X(X(t,ft.ajaxSettings),e):X(ft.ajaxSettings,t)},ajaxPrefilter:$(Je),ajaxTransport:$(Qe),ajax:function(e,n){function r(e,n,r,i){var o,d,v,b,w,T=n;2!==x&&(x=2,u&&t.clearTimeout(u),c=void 0,s=i||"",E.readyState=e>0?4:0,o=e>=200&&e<300||304===e,r&&(b=K(p,E,r)),b=G(p,b,E,o),o?(p.ifModified&&(w=E.getResponseHeader("Last-Modified"),w&&(ft.lastModified[a]=w),w=E.getResponseHeader("etag"),w&&(ft.etag[a]=w)),204===e||"HEAD"===p.type?T="nocontent":304===e?T="notmodified":(T=b.state,d=b.data,v=b.error,o=!v)):(v=T,!e&&T||(T="error",e<0&&(e=0))),E.status=e,E.statusText=(n||T)+"",o?m.resolveWith(f,[d,T,E]):m.rejectWith(f,[E,T,v]),E.statusCode(g),g=void 0,l&&h.trigger(o?"ajaxSuccess":"ajaxError",[E,p,o?d:v]),y.fireWith(f,[E,T]),l&&(h.trigger("ajaxComplete",[E,p]),--ft.active||ft.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=void 0),n=n||{};var i,o,a,s,u,l,c,d,p=ft.ajaxSetup({},n),f=p.context||p,h=p.context&&(f.nodeType||f.jquery)?ft(f):ft.event,m=ft.Deferred(),y=ft.Callbacks("once memory"),g=p.statusCode||{},v={},b={},x=0,w="canceled",E={readyState:0,getResponseHeader:function(t){var e;if(2===x){if(!d)for(d={};e=Ue.exec(s);)d[e[1].toLowerCase()]=e[2];e=d[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===x?s:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return x||(t=b[n]=b[n]||t,v[t]=e),this},overrideMimeType:function(t){return x||(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(x<2)for(e in t)g[e]=[g[e],t[e]];else E.always(t[E.status]);return this},abort:function(t){var e=t||w;return c&&c.abort(e),r(0,e),this}};if(m.promise(E).complete=y.add,E.success=E.done,E.error=E.fail,p.url=((e||p.url||tn)+"").replace(Ve,"").replace(Ge,en[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=ft.trim(p.dataType||"*").toLowerCase().match(At)||[""],null==p.crossDomain&&(i=Ye.exec(p.url.toLowerCase()),p.crossDomain=!(!i||i[1]===en[1]&&i[2]===en[2]&&(i[3]||("http:"===i[1]?"80":"443"))===(en[3]||("http:"===en[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=ft.param(p.data,p.traditional)),U(Je,p,n,E),2===x)return E;l=ft.event&&p.global,l&&0===ft.active++&&ft.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Ke.test(p.type),a=p.url,p.hasContent||(p.data&&(a=p.url+=(We.test(a)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=$e.test(a)?a.replace($e,"$1_="+_e++):a+(We.test(a)?"&":"?")+"_="+_e++)),p.ifModified&&(ft.lastModified[a]&&E.setRequestHeader("If-Modified-Since",ft.lastModified[a]),ft.etag[a]&&E.setRequestHeader("If-None-Match",ft.etag[a])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&E.setRequestHeader("Content-Type",p.contentType),E.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Ze+"; q=0.01":""):p.accepts["*"]);for(o in p.headers)E.setRequestHeader(o,p.headers[o]);if(p.beforeSend&&(p.beforeSend.call(f,E,p)===!1||2===x))return E.abort();w="abort";for(o in{success:1,error:1,complete:1})E[o](p[o]);if(c=U(Qe,p,n,E)){if(E.readyState=1,l&&h.trigger("ajaxSend",[E,p]),2===x)return E;p.async&&p.timeout>0&&(u=t.setTimeout(function(){E.abort("timeout")},p.timeout));try{x=1,c.send(v,r)}catch(t){if(!(x<2))throw t;r(-1,t)}}else r(-1,"No Transport");return E},getJSON:function(t,e,n){return ft.get(t,e,n,"json")},getScript:function(t,e){return ft.get(t,void 0,e,"script")}}),ft.each(["get","post"],function(t,e){ft[e]=function(t,n,r,i){return ft.isFunction(n)&&(i=i||r,r=n,n=void 0),ft.ajax(ft.extend({url:t,type:e,dataType:i,data:n,success:r},ft.isPlainObject(t)&&t))}}),ft._evalUrl=function(t){return ft.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},ft.fn.extend({wrapAll:function(t){if(ft.isFunction(t))return this.each(function(e){ft(this).wrapAll(t.call(this,e))});if(this[0]){var e=ft(t,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstChild&&1===t.firstChild.nodeType;)t=t.firstChild;return t}).append(this)}return this},wrapInner:function(t){return ft.isFunction(t)?this.each(function(e){ft(this).wrapInner(t.call(this,e))}):this.each(function(){var e=ft(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=ft.isFunction(t);return this.each(function(n){ft(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){ft.nodeName(this,"body")||ft(this).replaceWith(this.childNodes)}).end()}}),ft.expr.filters.hidden=function(t){return dt.reliableHiddenOffsets()?t.offsetWidth<=0&&t.offsetHeight<=0&&!t.getClientRects().length:J(t)},ft.expr.filters.visible=function(t){return!ft.expr.filters.hidden(t)};var nn=/%20/g,rn=/\[\]$/,on=/\r?\n/g,an=/^(?:submit|button|image|reset|file)$/i,sn=/^(?:input|select|textarea|keygen)/i;ft.param=function(t,e){var n,r=[],i=function(t,e){e=ft.isFunction(e)?e():null==e?"":e,r[r.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=ft.ajaxSettings&&ft.ajaxSettings.traditional),ft.isArray(t)||t.jquery&&!ft.isPlainObject(t))ft.each(t,function(){i(this.name,this.value)});else for(n in t)Q(n,t[n],e,i);return r.join("&").replace(nn,"+")},ft.fn.extend({serialize:function(){return ft.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ft.prop(this,"elements");return t?ft.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ft(this).is(":disabled")&&sn.test(this.nodeName)&&!an.test(t)&&(this.checked||!Ot.test(t))}).map(function(t,e){var n=ft(this).val();return null==n?null:ft.isArray(n)?ft.map(n,function(t){return{name:e.name,value:t.replace(on,"\r\n")}}):{name:e.name,value:n.replace(on,"\r\n")}}).get()}}),ft.ajaxSettings.xhr=void 0!==t.ActiveXObject?function(){return this.isLocal?tt():rt.documentMode>8?Z():/^(get|post|head|put|delete|options)$/i.test(this.type)&&Z()||tt()}:Z;var un=0,ln={},cn=ft.ajaxSettings.xhr();t.attachEvent&&t.attachEvent("onunload",function(){for(var t in ln)ln[t](void 0,!0)}),dt.cors=!!cn&&"withCredentials"in cn,cn=dt.ajax=!!cn,cn&&ft.ajaxTransport(function(e){if(!e.crossDomain||dt.cors){var n;return{send:function(r,i){var o,a=e.xhr(),s=++un;if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)void 0!==r[o]&&a.setRequestHeader(o,r[o]+"");a.send(e.hasContent&&e.data||null),n=function(t,r){var o,u,l;if(n&&(r||4===a.readyState))if(delete ln[s],n=void 0,a.onreadystatechange=ft.noop,r)4!==a.readyState&&a.abort();else{l={},o=a.status,"string"==typeof a.responseText&&(l.text=a.responseText);try{u=a.statusText}catch(t){u=""}o||!e.isLocal||e.crossDomain?1223===o&&(o=204):o=l.text?200:404}l&&i(o,u,l,a.getAllResponseHeaders())},e.async?4===a.readyState?t.setTimeout(n):a.onreadystatechange=ln[s]=n:n()},abort:function(){n&&n(void 0,!0)}}}}),ft.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return ft.globalEval(t),t}}}),ft.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)}),ft.ajaxTransport("script",function(t){if(t.crossDomain){var e,n=rt.head||ft("head")[0]||rt.documentElement;return{send:function(r,i){e=rt.createElement("script"),e.async=!0,t.scriptCharset&&(e.charset=t.scriptCharset),e.src=t.url,e.onload=e.onreadystatechange=function(t,n){(n||!e.readyState||/loaded|complete/.test(e.readyState))&&(e.onload=e.onreadystatechange=null,e.parentNode&&e.parentNode.removeChild(e),e=null,n||i(200,"success"))},n.insertBefore(e,n.firstChild)},abort:function(){e&&e.onload(void 0,!0)}}}});var dn=[],pn=/(=)\?(?=&|$)|\?\?/;ft.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=dn.pop()||ft.expando+"_"+_e++;return this[t]=!0,t}}),ft.ajaxPrefilter("json jsonp",function(e,n,r){var i,o,a,s=e.jsonp!==!1&&(pn.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&pn.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return i=e.jsonpCallback=ft.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(pn,"$1"+i):e.jsonp!==!1&&(e.url+=(We.test(e.url)?"&":"?")+e.jsonp+"="+i),e.converters["script json"]=function(){return a||ft.error(i+" was not called"),a[0]},e.dataTypes[0]="json",o=t[i],t[i]=function(){a=arguments},r.always(function(){void 0===o?ft(t).removeProp(i):t[i]=o,e[i]&&(e.jsonpCallback=n.jsonpCallback,dn.push(i)),a&&ft.isFunction(o)&&o(a[0]),a=o=void 0}),"script"}),ft.parseHTML=function(t,e,n){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(n=e,e=!1),e=e||rt;var r=Et.exec(t),i=!n&&[];return r?[e.createElement(r[1])]:(r=g([t],e,i),i&&i.length&&ft(i).remove(),ft.merge([],r.childNodes))};var fn=ft.fn.load;ft.fn.load=function(t,e,n){if("string"!=typeof t&&fn)return fn.apply(this,arguments);var r,i,o,a=this,s=t.indexOf(" ");return s>-1&&(r=ft.trim(t.slice(s,t.length)),t=t.slice(0,s)),ft.isFunction(e)?(n=e,e=void 0):e&&"object"==typeof e&&(i="POST"),a.length>0&&ft.ajax({url:t,type:i||"GET",dataType:"html",data:e}).done(function(t){o=arguments,a.html(r?ft("
").append(ft.parseHTML(t)).find(r):t)}).always(n&&function(t,e){a.each(function(){n.apply(this,o||[t.responseText,e,t])})}),this},ft.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){ft.fn[e]=function(t){return this.on(e,t)}}),ft.expr.filters.animated=function(t){return ft.grep(ft.timers,function(e){return t===e.elem}).length},ft.offset={setOffset:function(t,e,n){var r,i,o,a,s,u,l,c=ft.css(t,"position"),d=ft(t),p={};"static"===c&&(t.style.position="relative"),s=d.offset(),o=ft.css(t,"top"),u=ft.css(t,"left"),l=("absolute"===c||"fixed"===c)&&ft.inArray("auto",[o,u])>-1,l?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),ft.isFunction(e)&&(e=e.call(t,n,ft.extend({},s))),null!=e.top&&(p.top=e.top-s.top+a),null!=e.left&&(p.left=e.left-s.left+i),"using"in e?e.using.call(t,p):d.css(p)}},ft.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ft.offset.setOffset(this,t,e)});var e,n,r={top:0,left:0},i=this[0],o=i&&i.ownerDocument;if(o)return e=o.documentElement,ft.contains(e,i)?("undefined"!=typeof i.getBoundingClientRect&&(r=i.getBoundingClientRect()),n=et(o),{top:r.top+(n.pageYOffset||e.scrollTop)-(e.clientTop||0),left:r.left+(n.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}):r},position:function(){if(this[0]){var t,e,n={top:0,left:0},r=this[0];return"fixed"===ft.css(r,"position")?e=r.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),ft.nodeName(t[0],"html")||(n=t.offset()),n.top+=ft.css(t[0],"borderTopWidth",!0),n.left+=ft.css(t[0],"borderLeftWidth",!0)),{top:e.top-n.top-ft.css(r,"marginTop",!0),left:e.left-n.left-ft.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&!ft.nodeName(t,"html")&&"static"===ft.css(t,"position");)t=t.offsetParent;return t||fe})}}),ft.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n=/Y/.test(e);ft.fn[t]=function(r){return Mt(this,function(t,r,i){var o=et(t);return void 0===i?o?e in o?o[e]:o.document.documentElement[r]:t[r]:void(o?o.scrollTo(n?ft(o).scrollLeft():i,n?i:ft(o).scrollTop()):t[r]=i)},t,r,arguments.length,null)}}),ft.each(["top","left"],function(t,e){ft.cssHooks[e]=R(dt.pixelPosition,function(t,n){if(n)return n=me(t,e),de.test(n)?ft(t).position()[e]+"px":n})}),ft.each({Height:"height",Width:"width"},function(t,e){ft.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,r){ft.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),a=n||(r===!0||i===!0?"margin":"border");return Mt(this,function(e,n,r){var i;return ft.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(i=e.documentElement,Math.max(e.body["scroll"+t],i["scroll"+t],e.body["offset"+t],i["offset"+t],i["client"+t])):void 0===r?ft.css(e,n,a):ft.style(e,n,r,a)},e,o?r:void 0,o,null)}})}),ft.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,r){return this.on(e,t,n,r)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}}),ft.fn.size=function(){return this.length},ft.fn.andSelf=ft.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ft});var hn=t.jQuery,mn=t.$;return ft.noConflict=function(e){return t.$===ft&&(t.$=mn),e&&t.jQuery===ft&&(t.jQuery=hn),ft},e||(t.jQuery=t.$=ft),ft}),function(t,e){"use strict";t.rails!==e&&t.error("jquery-ujs has already been loaded!");var n,r=t(document);t.rails=n={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",buttonClickSelector:"button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])", +disableSelector:"input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",requiredInputSelector:"input[name][required]:not([disabled]), textarea[name][required]:not([disabled])",fileInputSelector:"input[name][type=file]:not([disabled])",linkDisableSelector:"a[data-disable-with], a[data-disable]",buttonDisableSelector:"button[data-remote][data-disable-with], button[data-remote][data-disable]",csrfToken:function(){return t("meta[name=csrf-token]").attr("content")},csrfParam:function(){return t("meta[name=csrf-param]").attr("content")},CSRFProtection:function(t){var e=n.csrfToken();e&&t.setRequestHeader("X-CSRF-Token",e)},refreshCSRFTokens:function(){t('form input[name="'+n.csrfParam()+'"]').val(n.csrfToken())},fire:function(e,n,r){var i=t.Event(n);return e.trigger(i,r),i.result!==!1},confirm:function(t){return confirm(t)},ajax:function(e){return t.ajax(e)},href:function(t){return t[0].href},isRemote:function(t){return t.data("remote")!==e&&t.data("remote")!==!1},handleRemote:function(r){var i,o,a,s,u,l;if(n.fire(r,"ajax:before")){if(s=r.data("with-credentials")||null,u=r.data("type")||t.ajaxSettings&&t.ajaxSettings.dataType,r.is("form")){i=r.data("ujs:submit-button-formmethod")||r.attr("method"),o=r.data("ujs:submit-button-formaction")||r.attr("action"),a=t(r[0]).serializeArray();var c=r.data("ujs:submit-button");c&&(a.push(c),r.data("ujs:submit-button",null)),r.data("ujs:submit-button-formmethod",null),r.data("ujs:submit-button-formaction",null)}else r.is(n.inputChangeSelector)?(i=r.data("method"),o=r.data("url"),a=r.serialize(),r.data("params")&&(a=a+"&"+r.data("params"))):r.is(n.buttonClickSelector)?(i=r.data("method")||"get",o=r.data("url"),a=r.serialize(),r.data("params")&&(a=a+"&"+r.data("params"))):(i=r.data("method"),o=n.href(r),a=r.data("params")||null);return l={type:i||"GET",data:a,dataType:u,beforeSend:function(t,i){return i.dataType===e&&t.setRequestHeader("accept","*/*;q=0.5, "+i.accepts.script),!!n.fire(r,"ajax:beforeSend",[t,i])&&void r.trigger("ajax:send",t)},success:function(t,e,n){r.trigger("ajax:success",[t,e,n])},complete:function(t,e){r.trigger("ajax:complete",[t,e])},error:function(t,e,n){r.trigger("ajax:error",[t,e,n])},crossDomain:n.isCrossDomain(o)},s&&(l.xhrFields={withCredentials:s}),o&&(l.url=o),n.ajax(l)}return!1},isCrossDomain:function(t){var e=document.createElement("a");e.href=location.href;var n=document.createElement("a");try{return n.href=t,n.href=n.href,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host==n.protocol+"//"+n.host)}catch(t){return!0}},handleMethod:function(r){var i=n.href(r),o=r.data("method"),a=r.attr("target"),s=n.csrfToken(),u=n.csrfParam(),l=t('
'),c='';u===e||s===e||n.isCrossDomain(i)||(c+=''),a&&l.attr("target",a),l.hide().append(c).appendTo("body"),l.submit()},formElements:function(e,n){return e.is("form")?t(e[0].elements).filter(n):e.find(n)},disableFormElements:function(e){n.formElements(e,n.disableSelector).each(function(){n.disableFormElement(t(this))})},disableFormElement:function(t){var n,r;n=t.is("button")?"html":"val",r=t.data("disable-with"),r!==e&&(t.data("ujs:enable-with",t[n]()),t[n](r)),t.prop("disabled",!0),t.data("ujs:disabled",!0)},enableFormElements:function(e){n.formElements(e,n.enableSelector).each(function(){n.enableFormElement(t(this))})},enableFormElement:function(t){var n=t.is("button")?"html":"val";t.data("ujs:enable-with")!==e&&(t[n](t.data("ujs:enable-with")),t.removeData("ujs:enable-with")),t.prop("disabled",!1),t.removeData("ujs:disabled")},allowAction:function(t){var e,r=t.data("confirm"),i=!1;if(!r)return!0;if(n.fire(t,"confirm")){try{i=n.confirm(r)}catch(t){(console.error||console.log).call(console,t.stack||t)}e=n.fire(t,"confirm:complete",[i])}return i&&e},blankInputs:function(e,n,r){var i,o,a,s,u=t(),l=n||"input,textarea",c=e.find(l),d={};return c.each(function(){i=t(this),i.is("input[type=radio]")?(s=i.attr("name"),d[s]||(0===e.find('input[type=radio]:checked[name="'+s+'"]').length&&(a=e.find('input[type=radio][name="'+s+'"]'),u=u.add(a)),d[s]=s)):(o=i.is("input[type=checkbox],input[type=radio]")?i.is(":checked"):!!i.val(),o===r&&(u=u.add(i)))}),!!u.length&&u},nonBlankInputs:function(t,e){return n.blankInputs(t,e,!0)},stopEverything:function(e){return t(e.target).trigger("ujs:everythingStopped"),e.stopImmediatePropagation(),!1},disableElement:function(t){var r=t.data("disable-with");r!==e&&(t.data("ujs:enable-with",t.html()),t.html(r)),t.bind("click.railsDisable",function(t){return n.stopEverything(t)}),t.data("ujs:disabled",!0)},enableElement:function(t){t.data("ujs:enable-with")!==e&&(t.html(t.data("ujs:enable-with")),t.removeData("ujs:enable-with")),t.unbind("click.railsDisable"),t.removeData("ujs:disabled")}},n.fire(r,"rails:attachBindings")&&(t.ajaxPrefilter(function(t,e,r){t.crossDomain||n.CSRFProtection(r)}),t(window).on("pageshow.rails",function(){t(t.rails.enableSelector).each(function(){var e=t(this);e.data("ujs:disabled")&&t.rails.enableFormElement(e)}),t(t.rails.linkDisableSelector).each(function(){var e=t(this);e.data("ujs:disabled")&&t.rails.enableElement(e)})}),r.on("ajax:complete",n.linkDisableSelector,function(){n.enableElement(t(this))}),r.on("ajax:complete",n.buttonDisableSelector,function(){n.enableFormElement(t(this))}),r.on("click.rails",n.linkClickSelector,function(e){var r=t(this),i=r.data("method"),o=r.data("params"),a=e.metaKey||e.ctrlKey;if(!n.allowAction(r))return n.stopEverything(e);if(!a&&r.is(n.linkDisableSelector)&&n.disableElement(r),n.isRemote(r)){if(a&&(!i||"GET"===i)&&!o)return!0;var s=n.handleRemote(r);return s===!1?n.enableElement(r):s.fail(function(){n.enableElement(r)}),!1}return i?(n.handleMethod(r),!1):void 0}),r.on("click.rails",n.buttonClickSelector,function(e){var r=t(this);if(!n.allowAction(r)||!n.isRemote(r))return n.stopEverything(e);r.is(n.buttonDisableSelector)&&n.disableFormElement(r);var i=n.handleRemote(r);return i===!1?n.enableFormElement(r):i.fail(function(){n.enableFormElement(r)}),!1}),r.on("change.rails",n.inputChangeSelector,function(e){var r=t(this);return n.allowAction(r)&&n.isRemote(r)?(n.handleRemote(r),!1):n.stopEverything(e)}),r.on("submit.rails",n.formSubmitSelector,function(r){var i,o,a=t(this),s=n.isRemote(a);if(!n.allowAction(a))return n.stopEverything(r);if(a.attr("novalidate")===e)if(a.data("ujs:formnovalidate-button")===e){if(i=n.blankInputs(a,n.requiredInputSelector,!1),i&&n.fire(a,"ajax:aborted:required",[i]))return n.stopEverything(r)}else a.data("ujs:formnovalidate-button",e);if(s){if(o=n.nonBlankInputs(a,n.fileInputSelector)){setTimeout(function(){n.disableFormElements(a)},13);var u=n.fire(a,"ajax:aborted:file",[o]);return u||setTimeout(function(){n.enableFormElements(a)},13),u}return n.handleRemote(a),!1}setTimeout(function(){n.disableFormElements(a)},13)}),r.on("click.rails",n.formInputClickSelector,function(e){var r=t(this);if(!n.allowAction(r))return n.stopEverything(e);var i=r.attr("name"),o=i?{name:i,value:r.val()}:null,a=r.closest("form");0===a.length&&(a=t("#"+r.attr("form"))),a.data("ujs:submit-button",o),a.data("ujs:formnovalidate-button",r.attr("formnovalidate")),a.data("ujs:submit-button-formaction",r.attr("formaction")),a.data("ujs:submit-button-formmethod",r.attr("formmethod"))}),r.on("ajax:send.rails",n.formSubmitSelector,function(e){this===e.target&&n.disableFormElements(t(this))}),r.on("ajax:complete.rails",n.formSubmitSelector,function(e){this===e.target&&n.enableFormElements(t(this))}),t(function(){n.refreshCSRFTokens()}))}(jQuery),function(){(function(){(function(){this.Turbolinks={supported:function(){return null!=window.history.pushState&&null!=window.requestAnimationFrame}(),visit:function(e,n){return t.controller.visit(e,n)},clearCache:function(){return t.controller.clearCache()}}}).call(this)}).call(this);var t=this.Turbolinks;(function(){(function(){var e,n;t.copyObject=function(t){var e,n,r;n={};for(e in t)r=t[e],n[e]=r;return n},t.closest=function(t,n){return e.call(t,n)},e=function(){var t,e;return t=document.documentElement,null!=(e=t.closest)?e:function(t){var e;for(e=this;e;){if(e.nodeType===Node.ELEMENT_NODE&&n.call(e,t))return e;e=e.parentNode}}}(),t.defer=function(t){return setTimeout(t,1)},t.dispatch=function(t,e){var n,r,i,o,a;return o=null!=e?e:{},a=o.target,n=o.cancelable,r=o.data,i=document.createEvent("Events"),i.initEvent(t,!0,n===!0),i.data=null!=r?r:{},(null!=a?a:document).dispatchEvent(i),i},t.match=function(t,e){return n.call(t,e)},n=function(){var t,e,n,r;return t=document.documentElement,null!=(e=null!=(n=null!=(r=t.matchesSelector)?r:t.webkitMatchesSelector)?n:t.msMatchesSelector)?e:t.mozMatchesSelector}(),t.uuid=function(){var t,e,n;for(n="",t=e=1;36>=e;t=++e)n+=9===t||14===t||19===t||24===t?"-":15===t?"4":20===t?(Math.floor(4*Math.random())+8).toString(16):Math.floor(15*Math.random()).toString(16);return n}}).call(this),function(){t.Location=function(){function t(t){var e,n;null==t&&(t=""),n=document.createElement("a"),n.href=t.toString(),this.absoluteURL=n.href,e=n.hash.length,2>e?this.requestURL=this.absoluteURL:(this.requestURL=this.absoluteURL.slice(0,-e),this.anchor=n.hash.slice(1))}var e,n,r,i;return t.wrap=function(t){return t instanceof this?t:new this(t)},t.prototype.getOrigin=function(){return this.absoluteURL.split("/",3).join("/")},t.prototype.getPath=function(){var t,e;return null!=(t=null!=(e=this.absoluteURL.match(/\/\/[^\/]*(\/[^?;]*)/))?e[1]:void 0)?t:"/"},t.prototype.getPathComponents=function(){return this.getPath().split("/").slice(1)},t.prototype.getLastPathComponent=function(){return this.getPathComponents().slice(-1)[0]},t.prototype.getExtension=function(){var t,e;return null!=(t=null!=(e=this.getLastPathComponent().match(/\.[^.]*$/))?e[0]:void 0)?t:""},t.prototype.isHTML=function(){return this.getExtension().match(/^(?:|\.(?:htm|html|xhtml))$/)},t.prototype.isPrefixedBy=function(t){var e;return e=n(t),this.isEqualTo(t)||i(this.absoluteURL,e)},t.prototype.isEqualTo=function(t){return this.absoluteURL===(null!=t?t.absoluteURL:void 0)},t.prototype.toCacheKey=function(){return this.requestURL},t.prototype.toJSON=function(){return this.absoluteURL},t.prototype.toString=function(){return this.absoluteURL},t.prototype.valueOf=function(){return this.absoluteURL},n=function(t){return e(t.getOrigin()+t.getPath())},e=function(t){return r(t,"/")?t:t+"/"},i=function(t,e){return t.slice(0,e.length)===e},r=function(t,e){return t.slice(-e.length)===e},t}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.HttpRequest=function(){function n(n,r,i){this.delegate=n,this.requestCanceled=e(this.requestCanceled,this),this.requestTimedOut=e(this.requestTimedOut,this),this.requestFailed=e(this.requestFailed,this),this.requestLoaded=e(this.requestLoaded,this),this.requestProgressed=e(this.requestProgressed,this),this.url=t.Location.wrap(r).requestURL,this.referrer=t.Location.wrap(i).absoluteURL,this.createXHR()}return n.NETWORK_FAILURE=0,n.TIMEOUT_FAILURE=-1,n.timeout=60,n.prototype.send=function(){var t;return this.xhr&&!this.sent?(this.notifyApplicationBeforeRequestStart(),this.setProgress(0),this.xhr.send(),this.sent=!0,"function"==typeof(t=this.delegate).requestStarted?t.requestStarted():void 0):void 0},n.prototype.cancel=function(){return this.xhr&&this.sent?this.xhr.abort():void 0},n.prototype.requestProgressed=function(t){return t.lengthComputable?this.setProgress(t.loaded/t.total):void 0},n.prototype.requestLoaded=function(){return this.endRequest(function(t){return function(){var e;return 200<=(e=t.xhr.status)&&300>e?t.delegate.requestCompletedWithResponse(t.xhr.responseText,t.xhr.getResponseHeader("Turbolinks-Location")):(t.failed=!0,t.delegate.requestFailedWithStatusCode(t.xhr.status,t.xhr.responseText))}}(this))},n.prototype.requestFailed=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.NETWORK_FAILURE)}}(this))},n.prototype.requestTimedOut=function(){return this.endRequest(function(t){return function(){return t.failed=!0,t.delegate.requestFailedWithStatusCode(t.constructor.TIMEOUT_FAILURE)}}(this))},n.prototype.requestCanceled=function(){return this.endRequest()},n.prototype.notifyApplicationBeforeRequestStart=function(){return t.dispatch("turbolinks:request-start",{data:{url:this.url,xhr:this.xhr}})},n.prototype.notifyApplicationAfterRequestEnd=function(){return t.dispatch("turbolinks:request-end",{data:{url:this.url,xhr:this.xhr}})},n.prototype.createXHR=function(){return this.xhr=new XMLHttpRequest,this.xhr.open("GET",this.url,!0),this.xhr.timeout=1e3*this.constructor.timeout,this.xhr.setRequestHeader("Accept","text/html, application/xhtml+xml"),this.xhr.setRequestHeader("Turbolinks-Referrer",this.referrer),this.xhr.onprogress=this.requestProgressed,this.xhr.onload=this.requestLoaded,this.xhr.onerror=this.requestFailed,this.xhr.ontimeout=this.requestTimedOut,this.xhr.onabort=this.requestCanceled},n.prototype.endRequest=function(t){return this.xhr?(this.notifyApplicationAfterRequestEnd(),null!=t&&t.call(this),this.destroy()):void 0},n.prototype.setProgress=function(t){var e;return this.progress=t,"function"==typeof(e=this.delegate).requestProgressed?e.requestProgressed(this.progress):void 0},n.prototype.destroy=function(){var t;return this.setProgress(1),"function"==typeof(t=this.delegate).requestFinished&&t.requestFinished(),this.delegate=null,this.xhr=null},n}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.ProgressBar=function(){function t(){this.trickle=e(this.trickle,this),this.stylesheetElement=this.createStylesheetElement(),this.progressElement=this.createProgressElement()}var n;return n=300,t.defaultCSS=".turbolinks-progress-bar {\n position: fixed;\n display: block;\n top: 0;\n left: 0;\n height: 3px;\n background: #0076ff;\n z-index: 9999;\n transition: width "+n+"ms ease-out, opacity "+n/2+"ms "+n/2+"ms ease-in;\n transform: translate3d(0, 0, 0);\n}",t.prototype.show=function(){return this.visible?void 0:(this.visible=!0,this.installStylesheetElement(),this.installProgressElement(),this.startTrickling())},t.prototype.hide=function(){return this.visible&&!this.hiding?(this.hiding=!0,this.fadeProgressElement(function(t){return function(){return t.uninstallProgressElement(),t.stopTrickling(),t.visible=!1,t.hiding=!1}}(this))):void 0},t.prototype.setValue=function(t){return this.value=t,this.refresh()},t.prototype.installStylesheetElement=function(){return document.head.insertBefore(this.stylesheetElement,document.head.firstChild)},t.prototype.installProgressElement=function(){return this.progressElement.style.width=0,this.progressElement.style.opacity=1,document.documentElement.insertBefore(this.progressElement,document.body),this.refresh()},t.prototype.fadeProgressElement=function(t){return this.progressElement.style.opacity=0,setTimeout(t,1.5*n)},t.prototype.uninstallProgressElement=function(){return this.progressElement.parentNode?document.documentElement.removeChild(this.progressElement):void 0},t.prototype.startTrickling=function(){return null!=this.trickleInterval?this.trickleInterval:this.trickleInterval=setInterval(this.trickle,n)},t.prototype.stopTrickling=function(){return clearInterval(this.trickleInterval),this.trickleInterval=null},t.prototype.trickle=function(){return this.setValue(this.value+Math.random()/100)},t.prototype.refresh=function(){return requestAnimationFrame(function(t){return function(){return t.progressElement.style.width=10+90*t.value+"%"}}(this))},t.prototype.createStylesheetElement=function(){var t;return t=document.createElement("style"),t.type="text/css",t.textContent=this.constructor.defaultCSS,t},t.prototype.createProgressElement=function(){var t;return t=document.createElement("div"),t.className="turbolinks-progress-bar",t},t}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.BrowserAdapter=function(){function n(n){this.controller=n,this.showProgressBar=e(this.showProgressBar,this),this.progressBar=new t.ProgressBar}var r,i,o,a;return a=t.HttpRequest,r=a.NETWORK_FAILURE,o=a.TIMEOUT_FAILURE,i=500,n.prototype.visitProposedToLocationWithAction=function(t,e){return this.controller.startVisitToLocationWithAction(t,e)},n.prototype.visitStarted=function(t){return t.issueRequest(),t.changeHistory(),t.loadCachedSnapshot()},n.prototype.visitRequestStarted=function(t){return this.progressBar.setValue(0),t.hasCachedSnapshot()||"restore"!==t.action?this.showProgressBarAfterDelay():this.showProgressBar()},n.prototype.visitRequestProgressed=function(t){return this.progressBar.setValue(t.progress)},n.prototype.visitRequestCompleted=function(t){return t.loadResponse()},n.prototype.visitRequestFailedWithStatusCode=function(t,e){switch(e){case r:case o:return this.reload();default:return t.loadResponse()}},n.prototype.visitRequestFinished=function(){return this.hideProgressBar()},n.prototype.visitCompleted=function(t){return t.followRedirect()},n.prototype.pageInvalidated=function(){return this.reload()},n.prototype.showProgressBarAfterDelay=function(){return this.progressBarTimeout=setTimeout(this.showProgressBar,i)},n.prototype.showProgressBar=function(){return this.progressBar.show()},n.prototype.hideProgressBar=function(){return this.progressBar.hide(),clearTimeout(this.progressBarTimeout)},n.prototype.reload=function(){return window.location.reload()},n}()}.call(this),function(){var e,n=function(t,e){return function(){return t.apply(e,arguments)}};e=!1,addEventListener("load",function(){return t.defer(function(){return e=!0})},!1),t.History=function(){function r(t){this.delegate=t,this.onPopState=n(this.onPopState,this)}return r.prototype.start=function(){return this.started?void 0:(addEventListener("popstate",this.onPopState,!1),this.started=!0)},r.prototype.stop=function(){return this.started?(removeEventListener("popstate",this.onPopState,!1),this.started=!1):void 0},r.prototype.push=function(e,n){return e=t.Location.wrap(e),this.update("push",e,n)},r.prototype.replace=function(e,n){return e=t.Location.wrap(e),this.update("replace",e,n)},r.prototype.onPopState=function(e){var n,r,i,o;return this.shouldHandlePopState()&&(o=null!=(r=e.state)?r.turbolinks:void 0)?(n=t.Location.wrap(window.location),i=o.restorationIdentifier,this.delegate.historyPoppedToLocationWithRestorationIdentifier(n,i)):void 0},r.prototype.shouldHandlePopState=function(){return e===!0},r.prototype.update=function(t,e,n){var r;return r={turbolinks:{restorationIdentifier:n}},history[t+"State"](r,null,e)},r}()}.call(this),function(){t.Snapshot=function(){function e(t){var e,n;n=t.head,e=t.body,this.head=null!=n?n:document.createElement("head"),this.body=null!=e?e:document.createElement("body")}return e.wrap=function(t){return t instanceof this?t:this.fromHTML(t)},e.fromHTML=function(t){var e;return e=document.createElement("html"),e.innerHTML=t,this.fromElement(e)},e.fromElement=function(t){return new this({head:t.querySelector("head"),body:t.querySelector("body")})},e.prototype.clone=function(){return new e({head:this.head.cloneNode(!0),body:this.body.cloneNode(!0)})},e.prototype.getRootLocation=function(){var e,n;return n=null!=(e=this.getSetting("root"))?e:"/",new t.Location(n)},e.prototype.getCacheControlValue=function(){return this.getSetting("cache-control")},e.prototype.hasAnchor=function(t){try{return null!=this.body.querySelector("[id='"+t+"']")}catch(t){}},e.prototype.isPreviewable=function(){return"no-preview"!==this.getCacheControlValue()},e.prototype.isCacheable=function(){return"no-cache"!==this.getCacheControlValue()},e.prototype.getSetting=function(t){var e,n;return n=this.head.querySelectorAll("meta[name='turbolinks-"+t+"']"),e=n[n.length-1],null!=e?e.getAttribute("content"):void 0},e}()}.call(this),function(){var e=[].slice;t.Renderer=function(){function t(){}var n;return t.render=function(){var t,n,r,i;return r=arguments[0],n=arguments[1],t=3<=arguments.length?e.call(arguments,2):[],i=function(t,e,n){n.prototype=t.prototype;var r=new n,i=t.apply(r,e);return Object(i)===i?i:r}(this,t,function(){}),i.delegate=r,i.render(n),i},t.prototype.renderView=function(t){return this.delegate.viewWillRender(this.newBody),t(),this.delegate.viewRendered(this.newBody)},t.prototype.invalidateView=function(){return this.delegate.viewInvalidated()},t.prototype.createScriptElement=function(t){var e;return"false"===t.getAttribute("data-turbolinks-eval")?t:(e=document.createElement("script"),e.textContent=t.textContent,n(e,t),e)},n=function(t,e){var n,r,i,o,a,s,u;for(o=e.attributes,s=[],n=0,r=o.length;r>n;n++)a=o[n],i=a.name,u=a.value,s.push(t.setAttribute(i,u));return s},t}()}.call(this),function(){t.HeadDetails=function(){function t(t){var e,n,o,a,s,u,l;for(this.element=t,this.elements={},l=this.element.childNodes,a=0,u=l.length;u>a;a++)o=l[a],o.nodeType===Node.ELEMENT_NODE&&(s=o.outerHTML,n=null!=(e=this.elements)[s]?e[s]:e[s]={type:i(o),tracked:r(o),elements:[]},n.elements.push(o))}var e,n,r,i;return t.prototype.hasElementWithKey=function(t){return t in this.elements},t.prototype.getTrackedElementSignature=function(){var t,e;return function(){var n,r;n=this.elements,r=[];for(t in n)e=n[t].tracked,e&&r.push(t);return r}.call(this).join("")},t.prototype.getScriptElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("script",t)},t.prototype.getStylesheetElementsNotInDetails=function(t){return this.getElementsMatchingTypeNotInDetails("stylesheet",t)},t.prototype.getElementsMatchingTypeNotInDetails=function(t,e){var n,r,i,o,a,s;i=this.elements,a=[];for(r in i)o=i[r],s=o.type,n=o.elements,s!==t||e.hasElementWithKey(r)||a.push(n[0]);return a},t.prototype.getProvisionalElements=function(){var t,e,n,r,i,o,a;n=[],r=this.elements;for(e in r)i=r[e],a=i.type,o=i.tracked,t=i.elements,null!=a||o?t.length>1&&n.push.apply(n,t.slice(1)):n.push.apply(n,t);return n},i=function(t){return e(t)?"script":n(t)?"stylesheet":void 0},r=function(t){return"reload"===t.getAttribute("data-turbolinks-track")},e=function(t){var e;return e=t.tagName.toLowerCase(),"script"===e},n=function(t){var e;return e=t.tagName.toLowerCase(),"style"===e||"link"===e&&"stylesheet"===t.getAttribute("rel")},t}()}.call(this),function(){var e=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;t.SnapshotRenderer=function(n){function r(e,n){this.currentSnapshot=e,this.newSnapshot=n,this.currentHeadDetails=new t.HeadDetails(this.currentSnapshot.head),this.newHeadDetails=new t.HeadDetails(this.newSnapshot.head),this.newBody=this.newSnapshot.body}return e(r,n),r.prototype.render=function(t){return this.trackedElementsAreIdentical()?(this.mergeHead(),this.renderView(function(e){return function(){return e.replaceBody(),e.focusFirstAutofocusableElement(),t()}}(this))):this.invalidateView()},r.prototype.mergeHead=function(){return this.copyNewHeadStylesheetElements(),this.copyNewHeadScriptElements(),this.removeCurrentHeadProvisionalElements(),this.copyNewHeadProvisionalElements()},r.prototype.replaceBody=function(){return this.activateBodyScriptElements(),this.importBodyPermanentElements(),this.assignNewBody()},r.prototype.trackedElementsAreIdentical=function(){return this.currentHeadDetails.getTrackedElementSignature()===this.newHeadDetails.getTrackedElementSignature()},r.prototype.copyNewHeadStylesheetElements=function(){var t,e,n,r,i;for(r=this.getNewHeadStylesheetElements(),i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(document.head.appendChild(t));return i},r.prototype.copyNewHeadScriptElements=function(){var t,e,n,r,i;for(r=this.getNewHeadScriptElements(),i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(document.head.appendChild(this.createScriptElement(t)));return i},r.prototype.removeCurrentHeadProvisionalElements=function(){var t,e,n,r,i;for(r=this.getCurrentHeadProvisionalElements(),i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(document.head.removeChild(t));return i},r.prototype.copyNewHeadProvisionalElements=function(){var t,e,n,r,i;for(r=this.getNewHeadProvisionalElements(),i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(document.head.appendChild(t));return i},r.prototype.importBodyPermanentElements=function(){var t,e,n,r,i,o;for(r=this.getNewBodyPermanentElements(),o=[],e=0,n=r.length;n>e;e++)i=r[e],(t=this.findCurrentBodyPermanentElement(i))?o.push(i.parentNode.replaceChild(t,i)):o.push(void 0);return o},r.prototype.activateBodyScriptElements=function(){var t,e,n,r,i,o;for(r=this.getNewBodyScriptElements(),o=[],e=0,n=r.length;n>e;e++)i=r[e],t=this.createScriptElement(i),o.push(i.parentNode.replaceChild(t,i));return o},r.prototype.assignNewBody=function(){return document.body=this.newBody},r.prototype.focusFirstAutofocusableElement=function(){var t;return null!=(t=this.findFirstAutofocusableElement())?t.focus():void 0},r.prototype.getNewHeadStylesheetElements=function(){return this.newHeadDetails.getStylesheetElementsNotInDetails(this.currentHeadDetails)},r.prototype.getNewHeadScriptElements=function(){return this.newHeadDetails.getScriptElementsNotInDetails(this.currentHeadDetails)},r.prototype.getCurrentHeadProvisionalElements=function(){return this.currentHeadDetails.getProvisionalElements()},r.prototype.getNewHeadProvisionalElements=function(){return this.newHeadDetails.getProvisionalElements()},r.prototype.getNewBodyPermanentElements=function(){return this.newBody.querySelectorAll("[id][data-turbolinks-permanent]")},r.prototype.findCurrentBodyPermanentElement=function(t){return document.body.querySelector("#"+t.id+"[data-turbolinks-permanent]")},r.prototype.getNewBodyScriptElements=function(){return this.newBody.querySelectorAll("script")},r.prototype.findFirstAutofocusableElement=function(){return document.body.querySelector("[autofocus]")},r}(t.Renderer)}.call(this),function(){var e=function(t,e){function r(){this.constructor=t}for(var i in e)n.call(e,i)&&(t[i]=e[i]);return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t},n={}.hasOwnProperty;t.ErrorRenderer=function(t){function n(t){this.html=t}return e(n,t),n.prototype.render=function(t){return this.renderView(function(e){return function(){return e.replaceDocumentHTML(),e.activateBodyScriptElements(),t()}}(this))},n.prototype.replaceDocumentHTML=function(){return document.documentElement.innerHTML=this.html},n.prototype.activateBodyScriptElements=function(){var t,e,n,r,i,o;for(r=this.getScriptElements(),o=[],e=0,n=r.length;n>e;e++)i=r[e],t=this.createScriptElement(i),o.push(i.parentNode.replaceChild(t,i));return o},n.prototype.getScriptElements=function(){return document.documentElement.querySelectorAll("script")},n}(t.Renderer)}.call(this),function(){t.View=function(){function e(t){this.delegate=t,this.element=document.documentElement}return e.prototype.getRootLocation=function(){return this.getSnapshot().getRootLocation()},e.prototype.getSnapshot=function(){return t.Snapshot.fromElement(this.element)},e.prototype.render=function(t,e){var n,r,i;return i=t.snapshot,n=t.error,r=t.isPreview,this.markAsPreview(r),null!=i?this.renderSnapshot(i,e):this.renderError(n,e)},e.prototype.markAsPreview=function(t){return t?this.element.setAttribute("data-turbolinks-preview",""):this.element.removeAttribute("data-turbolinks-preview")},e.prototype.renderSnapshot=function(e,n){return t.SnapshotRenderer.render(this.delegate,n,this.getSnapshot(),t.Snapshot.wrap(e))},e.prototype.renderError=function(e,n){return t.ErrorRenderer.render(this.delegate,n,e)},e}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.ScrollManager=function(){function t(t){this.delegate=t,this.onScroll=e(this.onScroll,this)}return t.prototype.start=function(){return this.started?void 0:(addEventListener("scroll",this.onScroll,!1),this.onScroll(),this.started=!0)},t.prototype.stop=function(){return this.started?(removeEventListener("scroll",this.onScroll,!1),this.started=!1):void 0},t.prototype.scrollToElement=function(t){return t.scrollIntoView()},t.prototype.scrollToPosition=function(t){var e,n;return e=t.x,n=t.y,window.scrollTo(e,n)},t.prototype.onScroll=function(){return this.updatePosition({x:window.pageXOffset,y:window.pageYOffset})},t.prototype.updatePosition=function(t){var e;return this.position=t,null!=(e=this.delegate)?e.scrollPositionChanged(this.position):void 0},t}()}.call(this),function(){t.SnapshotCache=function(){function e(t){this.size=t,this.keys=[],this.snapshots={}}var n;return e.prototype.has=function(t){var e;return e=n(t),e in this.snapshots},e.prototype.get=function(t){var e;if(this.has(t))return e=this.read(t),this.touch(t),e},e.prototype.put=function(t,e){return this.write(t,e),this.touch(t),e},e.prototype.read=function(t){var e;return e=n(t),this.snapshots[e]},e.prototype.write=function(t,e){var r;return r=n(t),this.snapshots[r]=e},e.prototype.touch=function(t){var e,r;return r=n(t),e=this.keys.indexOf(r),e>-1&&this.keys.splice(e,1),this.keys.unshift(r),this.trim()},e.prototype.trim=function(){var t,e,n,r,i;for(r=this.keys.splice(this.size),i=[],t=0,n=r.length;n>t;t++)e=r[t],i.push(delete this.snapshots[e]);return i},n=function(e){return t.Location.wrap(e).toCacheKey()},e}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.Visit=function(){function n(n,r,i){this.controller=n,this.action=i,this.performScroll=e(this.performScroll,this),this.identifier=t.uuid(),this.location=t.Location.wrap(r),this.adapter=this.controller.adapter,this.state="initialized",this.timingMetrics={}}var r;return n.prototype.start=function(){return"initialized"===this.state?(this.recordTimingMetric("visitStart"),this.state="started",this.adapter.visitStarted(this)):void 0},n.prototype.cancel=function(){var t;return"started"===this.state?(null!=(t=this.request)&&t.cancel(),this.cancelRender(),this.state="canceled"):void 0},n.prototype.complete=function(){var t;return"started"===this.state?(this.recordTimingMetric("visitEnd"),this.state="completed","function"==typeof(t=this.adapter).visitCompleted&&t.visitCompleted(this),this.controller.visitCompleted(this)):void 0},n.prototype.fail=function(){var t;return"started"===this.state?(this.state="failed","function"==typeof(t=this.adapter).visitFailed?t.visitFailed(this):void 0):void 0},n.prototype.changeHistory=function(){var t,e;return this.historyChanged?void 0:(t=this.location.isEqualTo(this.referrer)?"replace":this.action,e=r(t),this.controller[e](this.location,this.restorationIdentifier),this.historyChanged=!0)},n.prototype.issueRequest=function(){return this.shouldIssueRequest()&&null==this.request?(this.progress=0,this.request=new t.HttpRequest(this,this.location,this.referrer),this.request.send()):void 0},n.prototype.getCachedSnapshot=function(){var t;return!(t=this.controller.getCachedSnapshotForLocation(this.location))||null!=this.location.anchor&&!t.hasAnchor(this.location.anchor)||"restore"!==this.action&&!t.isPreviewable()?void 0:t},n.prototype.hasCachedSnapshot=function(){return null!=this.getCachedSnapshot()},n.prototype.loadCachedSnapshot=function(){var t,e;return(e=this.getCachedSnapshot())?(t=this.shouldIssueRequest(),this.render(function(){var n;return this.cacheSnapshot(),this.controller.render({snapshot:e,isPreview:t},this.performScroll),"function"==typeof(n=this.adapter).visitRendered&&n.visitRendered(this),t?void 0:this.complete()})):void 0},n.prototype.loadResponse=function(){return null!=this.response?this.render(function(){var t,e;return this.cacheSnapshot(),this.request.failed?(this.controller.render({error:this.response},this.performScroll),"function"==typeof(t=this.adapter).visitRendered&&t.visitRendered(this),this.fail()):(this.controller.render({snapshot:this.response},this.performScroll),"function"==typeof(e=this.adapter).visitRendered&&e.visitRendered(this),this.complete())}):void 0},n.prototype.followRedirect=function(){return this.redirectedToLocation&&!this.followedRedirect?(this.location=this.redirectedToLocation,this.controller.replaceHistoryWithLocationAndRestorationIdentifier(this.redirectedToLocation,this.restorationIdentifier),this.followedRedirect=!0):void 0},n.prototype.requestStarted=function(){var t;return this.recordTimingMetric("requestStart"),"function"==typeof(t=this.adapter).visitRequestStarted?t.visitRequestStarted(this):void 0; +},n.prototype.requestProgressed=function(t){var e;return this.progress=t,"function"==typeof(e=this.adapter).visitRequestProgressed?e.visitRequestProgressed(this):void 0},n.prototype.requestCompletedWithResponse=function(e,n){return this.response=e,null!=n&&(this.redirectedToLocation=t.Location.wrap(n)),this.adapter.visitRequestCompleted(this)},n.prototype.requestFailedWithStatusCode=function(t,e){return this.response=e,this.adapter.visitRequestFailedWithStatusCode(this,t)},n.prototype.requestFinished=function(){var t;return this.recordTimingMetric("requestEnd"),"function"==typeof(t=this.adapter).visitRequestFinished?t.visitRequestFinished(this):void 0},n.prototype.performScroll=function(){return this.scrolled?void 0:("restore"===this.action?this.scrollToRestoredPosition()||this.scrollToTop():this.scrollToAnchor()||this.scrollToTop(),this.scrolled=!0)},n.prototype.scrollToRestoredPosition=function(){var t,e;return t=null!=(e=this.restorationData)?e.scrollPosition:void 0,null!=t?(this.controller.scrollToPosition(t),!0):void 0},n.prototype.scrollToAnchor=function(){return null!=this.location.anchor?(this.controller.scrollToAnchor(this.location.anchor),!0):void 0},n.prototype.scrollToTop=function(){return this.controller.scrollToPosition({x:0,y:0})},n.prototype.recordTimingMetric=function(t){var e;return null!=(e=this.timingMetrics)[t]?e[t]:e[t]=(new Date).getTime()},n.prototype.getTimingMetrics=function(){return t.copyObject(this.timingMetrics)},r=function(t){switch(t){case"replace":return"replaceHistoryWithLocationAndRestorationIdentifier";case"advance":case"restore":return"pushHistoryWithLocationAndRestorationIdentifier"}},n.prototype.shouldIssueRequest=function(){return"restore"!==this.action||!this.hasCachedSnapshot()},n.prototype.cacheSnapshot=function(){return this.snapshotCached?void 0:(this.controller.cacheSnapshot(),this.snapshotCached=!0)},n.prototype.render=function(t){return this.cancelRender(),this.frame=requestAnimationFrame(function(e){return function(){return e.frame=null,t.call(e)}}(this))},n.prototype.cancelRender=function(){return this.frame?cancelAnimationFrame(this.frame):void 0},n}()}.call(this),function(){var e=function(t,e){return function(){return t.apply(e,arguments)}};t.Controller=function(){function n(){this.clickBubbled=e(this.clickBubbled,this),this.clickCaptured=e(this.clickCaptured,this),this.pageLoaded=e(this.pageLoaded,this),this.history=new t.History(this),this.view=new t.View(this),this.scrollManager=new t.ScrollManager(this),this.restorationData={},this.clearCache()}return n.prototype.start=function(){return t.supported&&!this.started?(addEventListener("click",this.clickCaptured,!0),addEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.start(),this.startHistory(),this.started=!0,this.enabled=!0):void 0},n.prototype.disable=function(){return this.enabled=!1},n.prototype.stop=function(){return this.started?(removeEventListener("click",this.clickCaptured,!0),removeEventListener("DOMContentLoaded",this.pageLoaded,!1),this.scrollManager.stop(),this.stopHistory(),this.started=!1):void 0},n.prototype.clearCache=function(){return this.cache=new t.SnapshotCache(10)},n.prototype.visit=function(e,n){var r,i;return null==n&&(n={}),e=t.Location.wrap(e),this.applicationAllowsVisitingLocation(e)?this.locationIsVisitable(e)?(r=null!=(i=n.action)?i:"advance",this.adapter.visitProposedToLocationWithAction(e,r)):window.location=e:void 0},n.prototype.startVisitToLocationWithAction=function(e,n,r){var i;return t.supported?(i=this.getRestorationDataForIdentifier(r),this.startVisit(e,n,{restorationData:i})):window.location=e},n.prototype.startHistory=function(){return this.location=t.Location.wrap(window.location),this.restorationIdentifier=t.uuid(),this.history.start(),this.history.replace(this.location,this.restorationIdentifier)},n.prototype.stopHistory=function(){return this.history.stop()},n.prototype.pushHistoryWithLocationAndRestorationIdentifier=function(e,n){return this.restorationIdentifier=n,this.location=t.Location.wrap(e),this.history.push(this.location,this.restorationIdentifier)},n.prototype.replaceHistoryWithLocationAndRestorationIdentifier=function(e,n){return this.restorationIdentifier=n,this.location=t.Location.wrap(e),this.history.replace(this.location,this.restorationIdentifier)},n.prototype.historyPoppedToLocationWithRestorationIdentifier=function(e,n){var r;return this.restorationIdentifier=n,this.enabled?(r=this.getRestorationDataForIdentifier(this.restorationIdentifier),this.startVisit(e,"restore",{restorationIdentifier:this.restorationIdentifier,restorationData:r,historyChanged:!0}),this.location=t.Location.wrap(e)):this.adapter.pageInvalidated()},n.prototype.getCachedSnapshotForLocation=function(t){var e;return e=this.cache.get(t),e?e.clone():void 0},n.prototype.shouldCacheSnapshot=function(){return this.view.getSnapshot().isCacheable()},n.prototype.cacheSnapshot=function(){var t;return this.shouldCacheSnapshot()?(this.notifyApplicationBeforeCachingSnapshot(),t=this.view.getSnapshot(),this.cache.put(this.lastRenderedLocation,t.clone())):void 0},n.prototype.scrollToAnchor=function(t){var e;return(e=document.getElementById(t))?this.scrollToElement(e):this.scrollToPosition({x:0,y:0})},n.prototype.scrollToElement=function(t){return this.scrollManager.scrollToElement(t)},n.prototype.scrollToPosition=function(t){return this.scrollManager.scrollToPosition(t)},n.prototype.scrollPositionChanged=function(t){var e;return e=this.getCurrentRestorationData(),e.scrollPosition=t},n.prototype.render=function(t,e){return this.view.render(t,e)},n.prototype.viewInvalidated=function(){return this.adapter.pageInvalidated()},n.prototype.viewWillRender=function(t){return this.notifyApplicationBeforeRender(t)},n.prototype.viewRendered=function(){return this.lastRenderedLocation=this.currentVisit.location,this.notifyApplicationAfterRender()},n.prototype.pageLoaded=function(){return this.lastRenderedLocation=this.location,this.notifyApplicationAfterPageLoad()},n.prototype.clickCaptured=function(){return removeEventListener("click",this.clickBubbled,!1),addEventListener("click",this.clickBubbled,!1)},n.prototype.clickBubbled=function(t){var e,n,r;return this.enabled&&this.clickEventIsSignificant(t)&&(n=this.getVisitableLinkForNode(t.target))&&(r=this.getVisitableLocationForLink(n))&&this.applicationAllowsFollowingLinkToLocation(n,r)?(t.preventDefault(),e=this.getActionForLink(n),this.visit(r,{action:e})):void 0},n.prototype.applicationAllowsFollowingLinkToLocation=function(t,e){var n;return n=this.notifyApplicationAfterClickingLinkToLocation(t,e),!n.defaultPrevented},n.prototype.applicationAllowsVisitingLocation=function(t){var e;return e=this.notifyApplicationBeforeVisitingLocation(t),!e.defaultPrevented},n.prototype.notifyApplicationAfterClickingLinkToLocation=function(e,n){return t.dispatch("turbolinks:click",{target:e,data:{url:n.absoluteURL},cancelable:!0})},n.prototype.notifyApplicationBeforeVisitingLocation=function(e){return t.dispatch("turbolinks:before-visit",{data:{url:e.absoluteURL},cancelable:!0})},n.prototype.notifyApplicationAfterVisitingLocation=function(e){return t.dispatch("turbolinks:visit",{data:{url:e.absoluteURL}})},n.prototype.notifyApplicationBeforeCachingSnapshot=function(){return t.dispatch("turbolinks:before-cache")},n.prototype.notifyApplicationBeforeRender=function(e){return t.dispatch("turbolinks:before-render",{data:{newBody:e}})},n.prototype.notifyApplicationAfterRender=function(){return t.dispatch("turbolinks:render")},n.prototype.notifyApplicationAfterPageLoad=function(e){return null==e&&(e={}),t.dispatch("turbolinks:load",{data:{url:this.location.absoluteURL,timing:e}})},n.prototype.startVisit=function(t,e,n){var r;return null!=(r=this.currentVisit)&&r.cancel(),this.currentVisit=this.createVisit(t,e,n),this.currentVisit.start(),this.notifyApplicationAfterVisitingLocation(t)},n.prototype.createVisit=function(e,n,r){var i,o,a,s,u;return o=null!=r?r:{},s=o.restorationIdentifier,a=o.restorationData,i=o.historyChanged,u=new t.Visit(this,e,n),u.restorationIdentifier=null!=s?s:t.uuid(),u.restorationData=t.copyObject(a),u.historyChanged=i,u.referrer=this.location,u},n.prototype.visitCompleted=function(t){return this.notifyApplicationAfterPageLoad(t.getTimingMetrics())},n.prototype.clickEventIsSignificant=function(t){return!(t.defaultPrevented||t.target.isContentEditable||t.which>1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey)},n.prototype.getVisitableLinkForNode=function(e){return this.nodeIsVisitable(e)?t.closest(e,"a[href]:not([target])"):void 0},n.prototype.getVisitableLocationForLink=function(e){var n;return n=new t.Location(e.getAttribute("href")),this.locationIsVisitable(n)?n:void 0},n.prototype.getActionForLink=function(t){var e;return null!=(e=t.getAttribute("data-turbolinks-action"))?e:"advance"},n.prototype.nodeIsVisitable=function(e){var n;return!(n=t.closest(e,"[data-turbolinks]"))||"false"!==n.getAttribute("data-turbolinks")},n.prototype.locationIsVisitable=function(t){return t.isPrefixedBy(this.view.getRootLocation())&&t.isHTML()},n.prototype.getCurrentRestorationData=function(){return this.getRestorationDataForIdentifier(this.restorationIdentifier)},n.prototype.getRestorationDataForIdentifier=function(t){var e;return null!=(e=this.restorationData)[t]?e[t]:e[t]={}},n}()}.call(this),function(){var e,n,r;t.start=function(){return n()?(null==t.controller&&(t.controller=e()),t.controller.start()):void 0},n=function(){return null==window.Turbolinks&&(window.Turbolinks=t),r()},e=function(){var e;return e=new t.Controller,e.adapter=new t.BrowserAdapter(e),e},r=function(){return window.Turbolinks===t},r()&&t.start()}.call(this)}).call(this),"object"==typeof module&&module.exports?module.exports=t:"function"==typeof define&&define.amd&&define(t)}.call(this),function(){}.call(this),function(){}.call(this),function(){}.call(this),function(){}.call(this); \ No newline at end of file diff --git a/public/assets/application-65b06790c910bd8b6e026af00c16cb539012b9dcab62fc2b7effa7d9b2655b44.js.gz b/public/assets/application-65b06790c910bd8b6e026af00c16cb539012b9dcab62fc2b7effa7d9b2655b44.js.gz new file mode 100644 index 00000000..5684264a Binary files /dev/null and b/public/assets/application-65b06790c910bd8b6e026af00c16cb539012b9dcab62fc2b7effa7d9b2655b44.js.gz differ diff --git a/public/assets/application-a7d29684701f6d7c82f9614038c707529599049919dcd2be8367962fd7e3d5d3.css b/public/assets/application-a7d29684701f6d7c82f9614038c707529599049919dcd2be8367962fd7e3d5d3.css new file mode 100644 index 00000000..53d8a5db --- /dev/null +++ b/public/assets/application-a7d29684701f6d7c82f9614038c707529599049919dcd2be8367962fd7e3d5d3.css @@ -0,0 +1 @@ +.add-vendor-edit-market li{font-family:"Molengo";margin-left:470px;list-style-type:none}.market-address{font-family:"Molengo";text-align:center;list-style-type:none}.page-title{text-align:center;font-family:"Special Elite", cursive;font-size:2em;margin:12vh 0 6vh}h1.page-title{margin-bottom:3vh}.vendor-market,.section-heading{font-family:"Special Elite", cursive;font-size:1.5em;text-align:center}.add-product{list-style:none;font-family:"Molengo";text-align:center;padding-left:0}p.vendor-details,p.market-address{font-family:"Molengo";text-align:center}table,tr,td{border:1px solid black;width:80vw;text-align:center}.sales_tables{margin:5vh auto;width:80vw;font-family:"Molengo", sans-serif}body{margin:0}header{background-image:url(/assets/tomatoes.jpeg);height:15vh;width:100vw;background-size:cover;margin:0;background-position:center center;text-align:center;color:white;font-family:"Special Elite", cursive;font-size:2em}header h1{margin:0;position:relative;top:4vh}header h1 a{text-decoration:none;color:white}#main{background-image:url(/assets/tomatoes.jpeg);height:100vh;width:100vw;background-size:cover;margin:0;position:absolute;top:0;overflow:hidden}#main h1{text-align:center;font-size:3em;position:relative;top:35vh;font-family:"Special Elite", cursive;color:white}#menu{text-align:center;margin:40vh auto;font-size:1.5em}#menu a{text-decoration:none;color:white;font-family:"Molengo"}h2.section-heading{margin-top:6vh}.centered-list{list-style:none;font-family:"Molengo";text-align:center;padding-left:0} diff --git a/public/assets/application-a7d29684701f6d7c82f9614038c707529599049919dcd2be8367962fd7e3d5d3.css.gz b/public/assets/application-a7d29684701f6d7c82f9614038c707529599049919dcd2be8367962fd7e3d5d3.css.gz new file mode 100644 index 00000000..70c42a5b Binary files /dev/null and b/public/assets/application-a7d29684701f6d7c82f9614038c707529599049919dcd2be8367962fd7e3d5d3.css.gz differ diff --git a/public/assets/application-fb025b2607ad5a7ca969a2bc30eeec01c3b9a7156609245e41b010f7161c50a8.css b/public/assets/application-fb025b2607ad5a7ca969a2bc30eeec01c3b9a7156609245e41b010f7161c50a8.css new file mode 100644 index 00000000..cfc17587 --- /dev/null +++ b/public/assets/application-fb025b2607ad5a7ca969a2bc30eeec01c3b9a7156609245e41b010f7161c50a8.css @@ -0,0 +1 @@ +#edit{font-family:"Molengo";text-align:center;list-style-type:none}.market-address{font-family:"Molengo";text-align:center;list-style-type:none}.page-title{text-align:center;font-family:"Special Elite", cursive;font-size:2em;margin:12vh 0 6vh}h1.page-title{margin-bottom:3vh}.vendor-market,.section-heading{font-family:"Special Elite", cursive;font-size:1.5em;text-align:center}.add-product{list-style:none;font-family:"Molengo";text-align:center;padding-left:0}p.vendor-details,p.market-address{font-family:"Molengo";text-align:center}table,tr,td{border:1px solid black;width:80vw;text-align:center}.sales_tables{margin:5vh auto;width:80vw;font-family:"Molengo", sans-serif}body{margin:0}header{background-image:url(/assets/tomatoes.jpeg);height:15vh;width:100vw;background-size:cover;margin:0;background-position:center center;text-align:center;color:white;font-family:"Special Elite", cursive;font-size:2em}header h1{margin:0;position:relative;top:4vh}header h1 a{text-decoration:none;color:white}#main{background-image:url(/assets/tomatoes.jpeg);height:100vh;width:100vw;background-size:cover;margin:0;position:absolute;top:0;overflow:hidden}#main h1{text-align:center;font-size:3em;position:relative;top:35vh;font-family:"Special Elite", cursive;color:white}#menu{text-align:center;margin:40vh auto;font-size:1.5em}#menu a{text-decoration:none;color:white;font-family:"Molengo"}h2.section-heading{margin-top:6vh}.centered-list{list-style:none;font-family:"Molengo";text-align:center;padding-left:0} diff --git a/public/assets/application-fb025b2607ad5a7ca969a2bc30eeec01c3b9a7156609245e41b010f7161c50a8.css.gz b/public/assets/application-fb025b2607ad5a7ca969a2bc30eeec01c3b9a7156609245e41b010f7161c50a8.css.gz new file mode 100644 index 00000000..63a7000b Binary files /dev/null and b/public/assets/application-fb025b2607ad5a7ca969a2bc30eeec01c3b9a7156609245e41b010f7161c50a8.css.gz differ diff --git a/public/assets/tomatoes-8e4ba6baf2c68b4f0e874edc19506e2965848893d57a3b837daa3b1abe140c26.jpg b/public/assets/tomatoes-8e4ba6baf2c68b4f0e874edc19506e2965848893d57a3b837daa3b1abe140c26.jpg new file mode 100644 index 00000000..2b6cfe79 Binary files /dev/null and b/public/assets/tomatoes-8e4ba6baf2c68b4f0e874edc19506e2965848893d57a3b837daa3b1abe140c26.jpg differ diff --git a/test/controllers/markets_controller_test.rb b/test/controllers/markets_controller_test.rb new file mode 100644 index 00000000..f43ed535 --- /dev/null +++ b/test/controllers/markets_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MarketsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/products_controller_test.rb b/test/controllers/products_controller_test.rb new file mode 100644 index 00000000..c881fa68 --- /dev/null +++ b/test/controllers/products_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ProductsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/sales_controller_test.rb b/test/controllers/sales_controller_test.rb new file mode 100644 index 00000000..669ca5cf --- /dev/null +++ b/test/controllers/sales_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SalesControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/users_controller_test.rb b/test/controllers/users_controller_test.rb new file mode 100644 index 00000000..d23f1829 --- /dev/null +++ b/test/controllers/users_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class UsersControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/controllers/vendors_controller_test.rb b/test/controllers/vendors_controller_test.rb new file mode 100644 index 00000000..2a6edb24 --- /dev/null +++ b/test/controllers/vendors_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class VendorsControllerTest < ActionController::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/fixtures/markets.yml b/test/fixtures/markets.yml new file mode 100644 index 00000000..937a0c00 --- /dev/null +++ b/test/fixtures/markets.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/products.yml b/test/fixtures/products.yml new file mode 100644 index 00000000..937a0c00 --- /dev/null +++ b/test/fixtures/products.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/sales.yml b/test/fixtures/sales.yml new file mode 100644 index 00000000..937a0c00 --- /dev/null +++ b/test/fixtures/sales.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/fixtures/vendors.yml b/test/fixtures/vendors.yml new file mode 100644 index 00000000..937a0c00 --- /dev/null +++ b/test/fixtures/vendors.yml @@ -0,0 +1,11 @@ +# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html + +# This model initially had no columns defined. If you add columns to the +# model remove the '{}' from the fixture names and add the columns immediately +# below each fixture, per the syntax in the comments below +# +one: {} +# column: value +# +two: {} +# column: value diff --git a/test/models/market_test.rb b/test/models/market_test.rb new file mode 100644 index 00000000..62e16016 --- /dev/null +++ b/test/models/market_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class MarketTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/product_test.rb b/test/models/product_test.rb new file mode 100644 index 00000000..211cdd0b --- /dev/null +++ b/test/models/product_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class ProductTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/sale_test.rb b/test/models/sale_test.rb new file mode 100644 index 00000000..8f0c60c0 --- /dev/null +++ b/test/models/sale_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class SaleTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end diff --git a/test/models/vendor_test.rb b/test/models/vendor_test.rb new file mode 100644 index 00000000..07dd4193 --- /dev/null +++ b/test/models/vendor_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class VendorTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end