text
stringlengths
184
4.48M
import { useEffect, useState } from 'react'; import { loadMapApi } from '../../../utils/GoogleMapsUtils'; import './Main.scss'; import Map from '../../small-parts/Main/Map'; import Products from '../../small-parts/Main/Products'; import Events from '../../small-parts/Main/Events'; const Main = () => { const [scriptLoaded, setScriptLoaded] = useState(false); const [distanceInKm, setDistanceInKm] = useState<number>(-1); useEffect(() => { const googleMapScript = loadMapApi(); googleMapScript.addEventListener('load', function () { setScriptLoaded(true); }); }, []); const renderDistanceSentence = () => { return ( <div className="distance-info"> {`Distance between selected marker and home address is ${distanceInKm}km.`} </div> ); }; return ( <main className="main"> <Products /> <Events /> {scriptLoaded && ( <Map mapType={google.maps.MapTypeId.SATELLITE} mapTypeControl={true} setDistanceInKm={setDistanceInKm} /> )} {distanceInKm > -1 && renderDistanceSentence()} </main> ); }; export default Main;
var pokémon = [ { "id": 1, "name": "Bulbasaur", "types": ["poison", "grass"] }, { "id": 5, "name": "Charmeleon", "types": ["fire"] }, { "id": 9, "name": "Blastoise", "types": ["water"] }, { "id": 12, "name": "Butterfree", "types": ["bug", "flying"] }, { "id": 16, "name": "Pidgey", "types": ["normal", "flying"] }, { "id": 23, "name": "Ekans", "types": ["poison"] }, { "id": 24, "name": "Arbok", "types": ["poison"] }, { "id": 25, "name": "Pikachu", "types": ["electric"] }, { "id": 37, "name": "Vulpix", "types": ["fire"] }, { "id": 52, "name": "Meowth", "types": ["normal"] }, { "id": 63, "name": "Abra", "types": ["psychic"] }, { "id": 67, "name": "Machamp", "types": ["fighting"] }, { "id": 72, "name": "Tentacool", "types": ["water", "poison"] }, { "id": 74, "name": "Geodude", "types": ["rock", "ground"] }, { "id": 87, "name": "Dewgong", "types": ["water", "ice"] }, { "id": 98, "name": "Krabby", "types": ["water"] }, { "id": 115, "name": "Kangaskhan", "types": ["normal"] }, { "id": 122, "name": "Mr. Mime", "types": ["psychic"] }, { "id": 133, "name": "Eevee", "types": ["normal"] }, { "id": 144, "name": "Articuno", "types": ["ice", "flying"] }, { "id": 145, "name": "Zapdos", "types": ["electric", "flying"] }, { "id": 146, "name": "Moltres", "types": ["fire", "flying"] }, { "id": 148, "name": "Dragonair", "types": ["dragon"] } ]; function greater(num) { console.log("These Pokemon have an id greater than " + num); for (i = 1; i < pokémon.length; i++) { if (pokémon[i].id > num) { console.log(pokémon[i].name); } } console.log(""); } function remainder(num) { console.log("These pokemon are divible by " + num); for (i = 1; i < pokémon.length; i++) { if (pokémon[i].id % num == 0) { console.log(pokémon[i].name); } } console.log(""); } function typeCount(num) { console.log("These pokemon have " + num + " or more types"); for (i = 1; i < pokémon.length; i++) { if (pokémon[i].types.length >= num) { console.log(pokémon[i].name); } } console.log(""); } function type(type) { console.log("These pokemon have " + type + " as their type"); for (i = 1; i < pokémon.length; i++) { if (pokémon[i].types == type) { console.log(pokémon[i].name); } } console.log(""); } function flyingSecond() { console.log("These pokemon have flying as their second type"); for (i = 1; i < pokémon.length; i++) { if (pokémon[i].types[1] == "flying") { console.log(pokémon[i].name); } } console.log(""); } function typeReverse(type) { console.log("This is the list of pokemon that have " + type + " as their type, but in reverse") for (i = pokémon.length - 1; i >= 0; i--) { if (pokémon[i].types == type) { console.log(pokémon[i].name); } } console.log(""); } greater(99); remainder(3); typeCount(2); type("poison"); flyingSecond(); typeReverse("fire");
#include "main.h" #include <stdlib.h> /** * str_concat - concatenates two strings * With return pointer to the newly allocated * memory with the new string * @s1: the first string * @s2: the second string * Return: new combined string or null on failure */ char *str_concat(char *s1, char *s2) { int length1 = 0, length2 = 0, i, j; char *newString; if (s1 == NULL) s1 = ""; if (s2 == NULL) s2 = ""; while (s1[length1] != '\0') length1++; while (s2[length2] != '\0') length2++; newString = (char *)malloc((length1 + length2 + 1) * sizeof(char)); if (newString == NULL) return (NULL); for (i = 0; i < length1; i++) newString[i] = s1[i]; for (j = 0; j < length2; j++) newString[i + j] = s2[j]; newString[i + j] = '\0'; return (newString); }
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <stdlib.h> /* Example grammar used: E -> E + E E -> E * E E -> (E) E -> id */ // Enter the left hand side of the grammar as an array of characters starting with the starting symbol. char grammar_lhs[] = {'E', 'E', 'E', 'E'}; // Enter the right hand side of the grammar as array of strings in correct order. char grammar_rhs[][10] = {"E+E", "E*E", "(E)", "id"}; char grammar_length = sizeof(grammar_lhs); char input[100] = "$"; char stack[100]; // Stack also behaves as a string. int stack_length = 0; // For pushing characters into stack. void stack_push(char c) { stack[stack_length] = c; stack_length++; stack[stack_length] = '\0'; } // For popping characters from stack. char stack_pop() { char c = stack[stack_length]; stack[stack_length] = '\0'; stack_length--; return c; } // Shift action. void shift(int *i) { // i is taken as pointer because we want to increment it twice in case the token is id. // If the input token is id then we push i and d as separate tokens into stack instead of a single token. if (input[*i] == 'i' && input[*i+1] == 'd') { stack_push('i'); stack_push('d'); ++(*i); printf("Shifted for id: %s\n", stack); } // Otherwise we can push token into the stack as it is. else { stack_push(input[*i]); printf("Shifted for %c: %s\n", input[*i], stack); } } // Function that checks the top of the stack before reducing. If reducing is not possible then -1 is returned. int check_top_of_stack() { char top_of_stack[10]; for (int i=stack_length-1; i>0; i--) { strncpy(top_of_stack, stack+i, stack_length-i+1); for (int j=0; j<grammar_length; j++) { if (strcmp(top_of_stack, grammar_rhs[j]) == 0){ return j; } } } return -1; } // Reduce action. void reduce() { int pos = check_top_of_stack(); if (pos != -1) { for (int i=0; i<strlen(grammar_rhs[pos]); i++) { stack_pop(); } stack_push(grammar_lhs[pos]); printf("Stack after reducing %c->%s : %s\n", grammar_lhs[pos], grammar_rhs[pos], stack); // After reducing once we recursively check if it is possible to reduce the top of stack again until reducing is not possible. reduce(); } } void main() { char string[100]; // We get the input string from user and concatenates $ at the end of it. printf("Enter the input: "); scanf("%s", string); strcat(input, string); strcat(input, "$"); // Initially we push the $ sign into the stack. stack_push(input[0]); // Until the end of the input string we repeat the process of shift and reducing until either the grammar is accepted or rejected. for (int i=1; i<strlen(input); i++) { reduce(); if (input[i] == '$') { if (stack[0] == '$' && stack[1] == grammar_lhs[0] && stack[2] == '\0') { printf("The input string is accepted by the grammar\n"); } else { printf("The input string is not accepted by the grammar\n"); } exit(0); } shift(&i); } }
package ui import ( "Golang-Calculator/calculator" "bufio" "errors" "fmt" "os" "strconv" "strings" ) // Array operasi kalkulator beserta namanya // Di buat demikian agar switch case bisa dipersingkat var calcFunc = []calculator.CalculatorFunction{ {Title: "Addition", Function: calculator.Addition}, {Title: "Subtraction", Function: calculator.Subtraction}, {Title: "Multiplication", Function: calculator.Multiplication}, {Title: "Division", Function: calculator.Division}, {Title: "Power", Function: calculator.Power}, {Title: "Square Root", Function: calculator.SquareRoot}, {Title: "Sine", Function: calculator.Sine}, {Title: "Cosine", Function: calculator.Cosine}, {Title: "Tangent", Function: calculator.Tangent}, } // Program kalkulator di terminal func CalcProgram() { for { // Tampilkan menu pilihan operation, err := menu() // Jika terjadi error, skip switch dan lanjut ke loop selanjutnya if printError(err) { continue } fmt.Println("\n---") switch operation { case "1", "2", "3", "4", "5", "6", "7", "8", "9": // Parse string ke integer index, _ := strconv.ParseInt(operation, 10, 64) // SubMenu untuk ambil inputan pertama dan kedua num1, num2, err := subMenu(calcFunc[index-1].Title) if printError(err) { break } // Jalankan operasi kalkulator sesuai dengan operasi yang dipilih result, err := calcFunc[index-1].Function(num1, num2) if printError(err) { break } // %.10f berarti tampilkan float sampai 10 desimal fmt.Printf("\nResult: %.10f\n", result) case "0": // Hentikan program fmt.Println("Goodbye") return default: // Infokan apabila pilihan tidak tersedia fmt.Println("Invalid Operation") } fmt.Println("---") } } // Menu utama func menu() (string, error) { reader := bufio.NewReader(os.Stdin) fmt.Println("\n--- CALCULATOR ---") fmt.Println("Choose Operation:") // Loop print seluruh operasi kalkulator yang tersedia for index, value := range calcFunc { // Contoh format "1. Addition" fmt.Printf("%v. %v\n", (index + 1), value.Title) } fmt.Println("0. Exit") operation, err := getInput("\n-> ", reader) if err != nil { return "", err } return operation, nil } // SubMenu dari operasi yang dipilih user func subMenu(title string) (float64, float64, error) { reader := bufio.NewReader(os.Stdin) fmt.Printf("%v\n\n", title) var firstNum, secondNum float64 num1, err := getInput("First number: ", reader) if err != nil { return 0, 0, err } // Coba parsing string inputan ke float firstNum, err = strconv.ParseFloat(num1, 64) if err != nil { return 0, 0, errors.New("input must be a number") } // Hanya tampilkan inputan kedua apabila bukan akar kuadrat if title != "Square Root" && title != "Sine" && title != "Cosine" && title != "Tangent" { num2, err := getInput("Second number [exponent if Power]: ", reader) if err != nil { return 0, 0, err } // Coba parsing string inputan ke float secondNum, err = strconv.ParseFloat(num2, 64) if err != nil { return 0, 0, errors.New("input must be a number") } } // Kembalikan angka pertama dan kedua apabila berhasil parsing return firstNum, secondNum, nil } // Tampilkan pesan dan baca inputan user // Parameter reader pakai pointer (*) agar tidak perlu dibuat ulang variabelnya func getInput(prompt string, r *bufio.Reader) (string, error) { fmt.Print(prompt) input, err := r.ReadString('\n') // Apabila terjadi error ketika menginput (seperti ^C) if err != nil { return "", errors.New("reading input interrupted") } // Hapus spasi di depan dan belakang inputan return strings.TrimSpace(input), err } // Print pesan error apabila terjadi kesalahan func printError(err error) bool { if err != nil { fmt.Printf("\n[ERROR] %v\n", err) return true } return false }
from typing import List, Tuple from aiohttp import ClientSession from forestadmin.datasource_toolkit.context.collection_context import CollectionCustomizationContext from forestadmin.datasource_toolkit.decorators.computed.types import ComputedDefinition from forestadmin.datasource_toolkit.interfaces.fields import Operator, PrimitiveType from forestadmin.datasource_toolkit.interfaces.query.aggregation import ( Aggregation, PlainAggregation, PlainAggregationGroup, ) from forestadmin.datasource_toolkit.interfaces.query.condition_tree.nodes.leaf import ConditionTreeLeaf from forestadmin.datasource_toolkit.interfaces.query.filter.unpaginated import Filter from forestadmin.datasource_toolkit.interfaces.records import RecordsDataAlias # segments async def high_delivery_address_segment(context: CollectionCustomizationContext): rows = await context.datasource.get_collection("order").aggregate( context.caller, Filter({}), Aggregation( component=PlainAggregation( PlainAggregation(operation="Count", groups=[PlainAggregationGroup(field="delivering_address_id")]) ) ), 100, ) return ConditionTreeLeaf( field="pk", operator=Operator.IN, value=[row["group"]["delivering_address_id"] for row in rows] ) # computed fields def address_full_name_computed(country_field_name: str) -> Tuple[str, ComputedDefinition]: async def _get_full_address_values(records: List[RecordsDataAlias], _: CollectionCustomizationContext): return [f"{record['street']} {record['city']} {record[country_field_name]}" for record in records] return ComputedDefinition( column_type=PrimitiveType.STRING, dependencies=["street", country_field_name, "city"], get_values=_get_full_address_values, ) # or { # "column_type": PrimitiveType.STRING, # "dependencies": ["street", country_field_name, "city"], # "get_values": _get_full_address_values, # }, def computed_full_address_caps(): return ComputedDefinition( column_type=PrimitiveType.STRING, dependencies=["full address"], get_values=lambda records, context: [record["full address"].upper() for record in records], ) async def get_postal_code(record: RecordsDataAlias, context: CollectionCustomizationContext): async with ClientSession() as session: async with session.get( f"https://apicarto.ign.fr/api/codes-postaux/communes/{record['zip_code']}", verify_ssl=False ) as response: if response.status == 200: return await response.json() else: return []
import { createSlice, PayloadAction } from "@reduxjs/toolkit"; import { RootState } from "../../store"; interface TitleBarState { user: string; } const initialState: TitleBarState = { user: "", }; const slice = createSlice({ name: "titleBar", initialState, reducers: { setUser: (state, action: PayloadAction<string>): void => { state.user = action.payload; }, }, }); export const { setUser } = slice.actions; export const selectUser = (state: RootState): string => state.titleBar.user; export default slice.reducer;
<?php namespace App\Http\Controllers\Webpage; use App\Http\Controllers\Controller; use Illuminate\Http\Response; use Illuminate\Http\RedirectResponse; use Illuminate\Support\Facades\Storage; use App\Models\QAAC; use App\Http\Requests\QAAC\StoreRequest; use App\Http\Requests\QAAC\UpdateRequest; use Illuminate\Http\Request; class QAACController extends Controller { /** * Display a listing of the resource. */ public function index(): Response { return response()->view('qaacs.index', [ 'qaacs' => QAAC::orderBy('updated_at', 'desc')->get(), ]); } /** * Show the form for creating a new resource. */ public function create(): Response { return response()->view('qaacs.form'); } /** * Store a newly created resource in storage. */ public function store(StoreRequest $request): RedirectResponse { $validated = $request->validated(); if ($request->hasFile('img')) { // put img in the public storage $filePath = Storage::disk('public')->put('qaacimg/qaacs/imgs', request()->file('img')); $validated['img'] = $filePath; } // insert only requests that already validated in the StoreRequest $create = QAAC::create($validated); if($create) { // add flash for the success notification session()->flash('notif.success', 'Content created successfully!'); return redirect()->route('qaacs.index'); } return abort(500); } /** * Display the specified resource. */ public function show(string $id): Response { return response()->view('qaacs.show', [ 'qaac' => QAAC::findOrFail($id), ]); } /** * Show the form for editing the specified resource. */ public function edit(string $id): Response { return response()->view('qaacs.form', [ 'qaac' => QAAC::findOrFail($id), ]); } /** * Update the specified resource in storage. */ public function update(UpdateRequest $request, string $id): RedirectResponse { $qaac = QAAC::findOrFail($id); $validated = $request->validated(); if ($request->hasFile('img')) { // delete img Storage::disk('public')->delete($qaac->img); $filePath = Storage::disk('public')->put('qaacimg/qaacs/imgs', request()->file('img'), 'public'); $validated['img'] = $filePath; } $update = $qaac->update($validated); if($update) { session()->flash('notif.success', 'Content updated successfully!'); return redirect()->route('qaacs.index'); } return abort(500); } /** * Remove the specified resource from storage. */ public function destroy(string $id): RedirectResponse { $qaac = QAAC::findOrFail($id); Storage::disk('public')->delete($qaac->img); $delete = $qaac->delete($id); if($delete) { session()->flash('notif.success', 'Content deleted successfully!'); return redirect()->route('qaacs.index'); } return abort(500); } }
using System.Security.Claims; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using SSSKLv2.Components.Account; using SSSKLv2.Data.DAL.Exceptions; using SSSKLv2.Data.DAL.Interfaces; namespace SSSKLv2.Data.DAL; public class TopUpRepository( IDbContextFactory<ApplicationDbContext> _dbContextFactory) : ITopUpRepository { public async Task<IQueryable<TopUp>> GetAllQueryable() { await using var context = await _dbContextFactory.CreateDbContextAsync(); return (await context.TopUp .Include(x => x.User) .ToListAsync()) .AsQueryable(); } public async Task<IQueryable<TopUp>> GetPersonalQueryable(string username) { await using var context = await _dbContextFactory.CreateDbContextAsync(); return (await context.TopUp .Where(x => x.User.UserName == username) .Include(x => x.User) .ToListAsync()) .AsQueryable(); } public async Task<TopUp> GetById(Guid id) { await using var context = await _dbContextFactory.CreateDbContextAsync(); var topup = await context.TopUp .Include(x => x.User) .FirstOrDefaultAsync(x => x.Id == id)!; if (topup != null) { return topup; } throw new NotFoundException("TopUp not found"); } public async Task Create(TopUp obj) { await using var context = await _dbContextFactory.CreateDbContextAsync(); obj.User.Saldo += obj.Saldo; context.Users.Update(obj.User); context.TopUp.Add(obj); await context.SaveChangesAsync(); } public async Task Delete(Guid id) { await using var context = await _dbContextFactory.CreateDbContextAsync(); var entry = await context.TopUp .Include(x => x.User) .FirstOrDefaultAsync(x => x.Id == id)!; if (entry != null) { entry.User.Saldo -= entry.Saldo; context.Users.Update(entry.User); context.TopUp.Remove(entry); await context.SaveChangesAsync(); } else throw new NotFoundException("TopUp Not Found"); } }
defmodule ToiaWeb.ConversationLogController do use ToiaWeb, :controller alias Toia.ConversationsLogs alias Toia.ConversationsLogs.ConversationLog action_fallback ToiaWeb.FallbackController def index(conn, _params) do conversations_log = ConversationsLogs.list_conversations_log() render(conn, :index, conversations_log: conversations_log) end def create(conn, %{"conversation_log" => conversation_log_params}) do with {:ok, %ConversationLog{} = conversation_log} <- ConversationsLogs.create_conversation_log(conversation_log_params) do conn |> put_status(:created) |> render(:show, conversation_log: conversation_log) end end def show(conn, %{"id" => id}) do conversation_log = ConversationsLogs.get_conversation_log!(id) render(conn, :show, conversation_log: conversation_log) end def update(conn, %{"id" => id, "conversation_log" => conversation_log_params}) do conversation_log = ConversationsLogs.get_conversation_log!(id) with {:ok, %ConversationLog{} = conversation_log} <- ConversationsLogs.update_conversation_log(conversation_log, conversation_log_params) do render(conn, :show, conversation_log: conversation_log) end end def delete(conn, %{"id" => id}) do conversation_log = ConversationsLogs.get_conversation_log!(id) with {:ok, %ConversationLog{}} <- ConversationsLogs.delete_conversation_log(conversation_log) do send_resp(conn, :no_content, "") end end end
<?php namespace App\Mail; use App\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Mail\Mailables\Content; use Illuminate\Queue\SerializesModels; use Illuminate\Mail\Mailables\Envelope; use Illuminate\Contracts\Queue\ShouldQueue; class WelcomeEmail extends Mailable { use Queueable, SerializesModels; public string $subj; public string $template; public array $data; /** /** * Create a new message instance. */ public function __construct($subj, $template, $data) { // $this->subj = $subj; $this->template = $template; $this->data = $data; } /** * Get the message envelope. */ public function envelope(): Envelope { return new Envelope( subject: $this->subj, ); } /** * Get the message content definition. */ public function content(): Content { return new Content( view: "mails.".$this->template, ); } /** * Get the attachments for the message. * * @return array<int, \Illuminate\Mail\Mailables\Attachment> */ public function attachments(): array { return []; } }
import sql from "mssql"; import conf from "../db-conf"; type Comparison = "=" | "<" | ">" | "<=" | ">=" | "<>" | "!=" | "LIKE" | "NOT LIKE" | "IN" | "NOT IN" | "BETWEEN" | "NOT BETWEEN" | "IS" | "IS NOT"; export default class DB<T> { _query = ""; _model = DB; constructor(model: any) { this._query = ""; this._model = model; } static select(model: any, args: Array<string> | string = "*") { return new DB<typeof model>(model).select(args); } static insert(model: any) { return new DB<typeof model>(model).insert(model.name); } select(args: Array<string> | string = "*") { this._query += `SELECT ${String(args)} `; return this.from(this._model.name); } from(args: string) { this._query += `FROM ${args} `; return this; } where(a: string, comparison: Comparison, b: string = "") { this._query += `WHERE ${a} ${comparison} ${b}`; return this; } insert(table: string) { this._query += `INSERT INTO ${table}`; return { columns: this.columns.bind(this), }; } columns(...arr: Array<string>) { // @ts-ignore this._query += `(${String(arr.reduce((a , b) => `${String(a)}, ${String(b)}`))}) `; return { values: this.values.bind(this), }; } values(...arr: Array<string>) { // @ts-ignore this._query += `VALUES (${String(arr.reduce((a , b) => `${String(a)}, ${String(b)}`))})`; return { run: this.run.bind(this), where: this.where.bind(this), }; } async run() { // @ts-ignore await sql.connect(conf) this._query = this._query.trim(); this._query += ";"; return await sql.query(this._query); } toString() { this._query = this._query.trim(); this._query += ";"; return this._query.trim(); } }
import React, { useState, useEffect, useContext } from 'react'; import { MainContext } from '../context.js'; import CharacterModal from './CharacterModal.js'; import { checkRowDecrease } from './HandleTeamsContainerHeightAndGrids.js'; const UniqueCharacters = ({ character }) => { const { name, inFriendlyParty, inEnemyTeam, showModal, cssName, cssBorderColor, health, armour, initiative, image, baseStats } = character; const { strength, dexterity, constitution, intelligence, wisdom, charisma } = baseStats; const { friendlyParty, setFriendlyParty } = useContext(MainContext); const { enemyTeam, setEnemyTeam } = useContext(MainContext); const { numberOfAllies, setNumberOfAllies } = useContext(MainContext); const { numberOfEnemies, setNumberOfEnemies } = useContext(MainContext); const { setModalIsShowing } = useContext(MainContext); const { numberOfRows, setNumberOfRows } = useContext(MainContext); const { teamsContainerHeight, setTeamsContainerHeight } = useContext(MainContext); const { containerRowHeight } = useContext(MainContext); const handleDragStart = (e, character) => { e.dataTransfer.setData('text/plain', character.name); } const removeCharacter = (character) => { //Call the 'checkRowDecrease' function to handle the display of each team (see 'HandleTeamsContainerHeightAndGrid.js') const updatedSizing = character.inFriendlyParty === true ? checkRowDecrease(friendlyParty.length, enemyTeam.length, numberOfRows, containerRowHeight) : checkRowDecrease(enemyTeam.length, friendlyParty.length, numberOfRows, containerRowHeight); setNumberOfRows(updatedSizing[0]); setTeamsContainerHeight(teamsContainerHeight - updatedSizing[1]); let newParty = []; const whichSide = character.inFriendlyParty === true ? friendlyParty : enemyTeam; const sideCount = character.inFriendlyParty === true ? numberOfAllies : numberOfEnemies; const setSideCount = character.inFriendlyParty === true ? setNumberOfAllies : setNumberOfEnemies; setSideCount(sideCount - 1); for (let i = 0; i < whichSide.length; i++) { if (character.id > whichSide[i].props.character.id) { newParty.push(whichSide[i]); } else if (character.id < whichSide[i].props.character.id) { const updatedCharacter = whichSide[i]; updatedCharacter.props.character.id = updatedCharacter.props.character.id - 1; newParty.push(updatedCharacter); } } character.inFriendlyParty === true ? setFriendlyParty(newParty) : setEnemyTeam(newParty); } const unhideCharacterModal = (character) => { setModalIsShowing(true); const newParty = character.inFriendlyParty === true ? [...friendlyParty] : [...enemyTeam]; const indexToUpdate = newParty.findIndex(index => index.props.character.id === character.id); if (indexToUpdate !== -1) { newParty[indexToUpdate].props.character.showModal = true; character.inFriendlyParty === true ? setFriendlyParty(newParty) : setEnemyTeam(newParty); } } let content; inFriendlyParty || inEnemyTeam ? content = <div className={`${cssName} characterContainer`} style={{ border: `0.25em ridge ${cssBorderColor}` }}> {/* Conditionally render either the characterModal or the show modal and remove hover options. This was done to eliminate any interactivity with these options while the modal is open. */} {showModal ? <CharacterModal character={character} /> : <div> <div className="moreInfo characterHover"> <div onClick={(e) => unhideCharacterModal(character)} className="moreInfoText textEnlarge">More Info</div> </div> <div className="fillerShade characterHover"></div> <div className="remove characterHover"> <div onClick={(e) => removeCharacter(character)} className="removeText textEnlarge">Remove</div> </div> </div>} <div className="character"> <div className="characterImage" style={{ backgroundImage: `url(${image})` }}></div> <div className="characterName">{name}</div> <div className="characterHealth">Health: {health}</div> <div className="characterArmourClass">AC: {armour}</div> <div className="characterInitiative">Initiative: {initiative}</div> <div className="characterStrength baseStat">Str: {strength}</div> <div className="characterDexterity baseStat">Dex: {dexterity}</div> <div className="characterConstitution baseStat">Con: {constitution}</div> <div className="characterIntelligence baseStat">Int: {intelligence}</div> <div className="characterWisdom baseStat">Wis: {wisdom}</div> <div className="characterCharisma baseStat">Cha: {charisma}</div> </div> </div> : content = <div draggable onDragStart={(e) => handleDragStart(e, character)} className={`${cssName} characterContainer`} style={{ cursor: "pointer", border: `0.25em ridge ${cssBorderColor}` }}> <div className="character"> <div className="characterImage" style={{ backgroundImage: `url(${image})` }}></div> <div className="characterName">{name}</div> <div className="characterHealth">Health: {health}</div> <div className="characterArmourClass">AC: {armour}</div> <div className="characterInitiative">Initiative: {initiative}</div> <div className="characterStrength baseStat">Str: {strength}</div> <div className="characterDexterity baseStat">Dex: {dexterity}</div> <div className="characterConstitution baseStat">Con: {constitution}</div> <div className="characterIntelligence baseStat">Int: {intelligence}</div> <div className="characterWisdom baseStat">Wis: {wisdom}</div> <div className="characterCharisma baseStat">Cha: {charisma}</div> </div> </div> return content; } export default UniqueCharacters;
import { setupSequelize } from "../../../../@seedwork/infra/db/testing/helpers/db"; import { DataType, Sequelize } from "sequelize-typescript"; import { CategorySequelize } from "./category-sequelize"; describe("Category unit test", () => { setupSequelize({ models: [CategorySequelize.CategoryModel] }); test("mapping props", () => { const attributesMap = CategorySequelize.CategoryModel.getAttributes(); const attributes = Object.keys( CategorySequelize.CategoryModel.getAttributes() ); expect(attributes).toStrictEqual([ "id", "name", "description", "is_active", "created_at", ]); const idAttr = attributesMap.id; expect(idAttr).toMatchObject({ field: "id", fieldName: "id", primaryKey: true, type: DataType.UUID(), }); const nameAttr = attributesMap.name; expect(nameAttr).toMatchObject({ field: "name", fieldName: "name", allowNull: false, type: DataType.STRING(255), }); const descriptionAttr = attributesMap.description; expect(descriptionAttr).toMatchObject({ field: "description", fieldName: "description", allowNull: true, type: DataType.TEXT(), }); const isActiveAttr = attributesMap.is_active; expect(isActiveAttr).toMatchObject({ field: "is_active", fieldName: "is_active", allowNull: false, type: DataType.BOOLEAN(), }); const createAtAttr = attributesMap.created_at; expect(createAtAttr).toMatchObject({ field: "created_at", fieldName: "created_at", allowNull: false, type: DataType.DATE(), }); }); test("create category", async () => { const arrange = { id: "d1ef5ca3-ad63-4bfb-8120-d7ea5a2bed92", name: "some name", is_active: true, created_at: new Date(), }; const category = await CategorySequelize.CategoryModel.create(arrange); expect(category.toJSON()).toStrictEqual(arrange); }); });
/******************************************************************************* * SPDX-License-Identifier: EUPL-1.2 * Copyright Regione Piemonte - 2020 ******************************************************************************/ package it.csi.conam.conambl.integration.mapper.entity.impl; import it.csi.conam.conambl.business.service.util.UtilsDate; import it.csi.conam.conambl.common.security.SecurityUtils; import it.csi.conam.conambl.integration.entity.CnmTCalendario; import it.csi.conam.conambl.integration.mapper.entity.CalendarioEntityMapper; import it.csi.conam.conambl.integration.mapper.entity.ComuneEntityMapper; import it.csi.conam.conambl.integration.mapper.entity.ProvinciaEntityMapper; import it.csi.conam.conambl.integration.mapper.entity.RegioneEntityMapper; import it.csi.conam.conambl.integration.repositories.CnmDComuneRepository; import it.csi.conam.conambl.integration.repositories.CnmDGruppoRepository; import it.csi.conam.conambl.util.DateConamUtils; import it.csi.conam.conambl.vo.calendario.CalendarEventVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import java.util.Date; @Component public class CalendarioEntityMapperImpl implements CalendarioEntityMapper { @Autowired private UtilsDate utilsDate; @Autowired private ComuneEntityMapper comuneEntityMapper; @Autowired private ProvinciaEntityMapper provinciaEntityMapper; @Autowired private RegioneEntityMapper regioneEntityMapper; @Autowired private CnmDComuneRepository cnmDComuneRepository; @Autowired private CnmDGruppoRepository cnmDGruppoRepository; @Override public CalendarEventVO mapEntityToVO(CnmTCalendario dto) { if (dto == null) return null; CalendarEventVO cal = new CalendarEventVO(); cal.setCap(dto.getCapUdienza()); cal.setCivico(dto.getNumeroCivicoUdienza()); cal.setCognomeFunzionarioSanzionatore(dto.getCognomeFunzionarioSanzion()); cal.setNomeFunzionarioSanzionatore(dto.getNomeFunzionarioSanzion()); cal.setColor(dto.getColore()); cal.setCognomeGiudice(dto.getCognomeGiudice()); cal.setComune(comuneEntityMapper.mapEntityToVO(dto.getCnmDComune())); cal.setDataFine(utilsDate.asLocalDateTime(dto.getFineUdienza())); cal.setDataInizio(utilsDate.asLocalDateTime(dto.getInizioUdienza())); cal.setId(dto.getIdCalendario()); cal.setNomeGiudice(dto.getNomeGiudice()); cal.setNote(dto.getNote()); cal.setProvincia(provinciaEntityMapper.mapEntityToVO(dto.getCnmDComune().getCnmDProvincia())); cal.setRegione(regioneEntityMapper.mapEntityToVO(dto.getCnmDComune().getCnmDProvincia().getCnmDRegione())); cal.setTribunale(dto.getTribunale()); cal.setVia(dto.getIndirizzoUdienza()); cal.setCodiceFiscaleProprietario(dto.getCnmTUser2().getNome() + " " + dto.getCnmTUser2().getCognome()); cal.setEmailGiudice(dto.getEmailGiudice()); if (dto.getDataPromemoriaUdienza() != null) { cal.setSendPromemoriaUdienza(true); cal.setUdienzaAdvanceDay( DateConamUtils.getDayBetweenDates( dto.getDataPromemoriaUdienza(), dto.getInizioUdienza() ) ); }else { cal.setSendPromemoriaUdienza(false); } if (dto.getDataPromemoriaDocumentazione() != null) { cal.setSendPromemoriaDocumentazione(true); cal.setDocumentazioneAdvanceDay( DateConamUtils.getDayBetweenDates( dto.getDataPromemoriaDocumentazione(), dto.getInizioUdienza() ) ); }else { cal.setSendPromemoriaDocumentazione(false); } return cal; } @Override public CnmTCalendario mapVOtoEntity(CalendarEventVO vo) { CnmTCalendario cnmTCalendario = new CnmTCalendario(); return mapVOtoEntityUpdate(vo, cnmTCalendario); } @Override public CnmTCalendario mapVOtoEntityUpdate(CalendarEventVO vo, CnmTCalendario cnmTCalendario) { long idGruppo = SecurityUtils.getUser().getIdGruppo(); cnmTCalendario.setCapUdienza(vo.getCap()); cnmTCalendario.setCnmDGruppo(cnmDGruppoRepository.findOne(idGruppo)); cnmTCalendario.setCnmDComune(cnmDComuneRepository.findOne(vo.getComune().getId())); cnmTCalendario.setCognomeFunzionarioSanzion(vo.getCognomeFunzionarioSanzionatore()); cnmTCalendario.setNomeFunzionarioSanzion(vo.getNomeFunzionarioSanzionatore()); cnmTCalendario.setCognomeGiudice(vo.getCognomeGiudice()); cnmTCalendario.setColore(vo.getColor()); cnmTCalendario.setFineUdienza(utilsDate.asTimeStamp(vo.getDataFine())); cnmTCalendario.setIndirizzoUdienza(vo.getVia()); cnmTCalendario.setInizioUdienza(utilsDate.asTimeStamp(vo.getDataInizio())); cnmTCalendario.setNomeGiudice(vo.getNomeGiudice()); cnmTCalendario.setCognomeGiudice(vo.getCognomeGiudice()); cnmTCalendario.setNote(vo.getNote()); cnmTCalendario.setNumeroCivicoUdienza(vo.getCivico()); cnmTCalendario.setTribunale(vo.getTribunale()); //PROMEMORI UDIENZA Date dataPromemoriaUdienza = null; if (vo.getSendPromemoriaUdienza()) { dataPromemoriaUdienza = DateConamUtils.subtractDaysToDate( utilsDate.asTimeStamp(vo.getDataInizio()), vo.getUdienzaAdvanceDay() ); dataPromemoriaUdienza = DateConamUtils.getStartOfTheDay(dataPromemoriaUdienza); } cnmTCalendario.setDataPromemoriaUdienza(dataPromemoriaUdienza); //PROMEMORI DOCUMENTAZIONE Date dataPromemoriaDocumentazione = null; if (vo.getSendPromemoriaDocumentazione()) { dataPromemoriaDocumentazione = DateConamUtils.subtractDaysToDate( utilsDate.asTimeStamp(vo.getDataInizio()), vo.getDocumentazioneAdvanceDay() ); dataPromemoriaDocumentazione = DateConamUtils.getStartOfTheDay(dataPromemoriaDocumentazione); } cnmTCalendario.setDataPromemoriaDocumentazione(dataPromemoriaDocumentazione); cnmTCalendario.setEmailGiudice(vo.getEmailGiudice()); return cnmTCalendario; } }
package com.boyumi.yumitianqi; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; import org.json.JSONArray; import org.json.JSONObject; import android.content.Context; import android.util.Log; import android.view.View; public class JuheWeather implements Weather { private String CityName; private String WeatherCondition; private String Temperature; private String Date; private Context context; private int wid; private List<Map<String, Object>> ForecastList = new ArrayList<Map<String, Object>>(); private int[] weatherIcon = new int[] { R.drawable.windrain, R.drawable.thunderstorm, R.drawable.snowrain, R.drawable.rain, R.drawable.snow, R.drawable.fog, R.drawable.wind, R.drawable.cloudy, R.drawable.sunny,R.drawable.themperature }; private Map<String, String> AirQualityMap = new HashMap<String, String>(); /** * * @param view * @param cityname */ public JuheWeather(View view, String cityname) { setContext(view.getContext()); setCityName(cityname); getWeather(); } @Override public void getWeather() { // TODO Auto-generated method stub if (CityName == null) { System.out.println("error:" + "didn't get a cityname!!"); return; } final String juhe_url = "http://v.juhe.cn/weather/index?format=2&cityname=" + getCityName() + "&key=b4815115e391e0460400617affd166a1"; Thread gw = new Thread() { @Override public void run() { super.run(); try { DefaultHttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(juhe_url); HttpResponse httpResponse = httpClient.execute(httpPost); String strResult = EntityUtils.toString(httpResponse .getEntity()); // Log.i("cat", ">>>>>>" + strResult); // current Weather setTemperature(new JSONObject(strResult) .getJSONObject("result").getJSONObject("sk") .getString("temp") + ("\u2103")); setDate(new JSONObject(strResult).getJSONObject("result") .getJSONObject("today").getString("date_y") + new JSONObject(strResult).getJSONObject("result") .getJSONObject("sk").getString("time")); setWeatherCondition(new JSONObject(strResult) .getJSONObject("result").getJSONObject("today") .getString("weather")); setWid(transfer(Integer.valueOf(new JSONObject(strResult).getJSONObject("result").getJSONObject("today").getJSONObject("weather_id").getString("fa")))); // System.out.println(CityName + Temperature + Date // + WeatherCondition+getWid()); // future weather JSONArray futuredata = new JSONObject(strResult) .getJSONObject("result").getJSONArray("future"); for (int i = 0; i < 6; i++) { JSONObject temp = futuredata.getJSONObject(i); String day = temp.getString("week"); String weather = temp.getString("weather"); String temprang = temp.getString("temperature"); Map<String, Object> listItem = new HashMap<String, Object>(); listItem.put("day", day); listItem.put("weather", weather); listItem.put("temprang", temprang); ForecastList.add(listItem); } // System.out.println(ForecastList.toString()); } catch (Exception e) { e.printStackTrace(); } } }; gw.start(); try { gw.join(); getPM25(CityName); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } /** * get pm2.5 info */ public void getPM25(String cityname){ final String pmURL = "http://www.pm25.in/api/querys/pm2_5.json?city="+cityname+"&token=5j1znBVAsnSf5xQyNQyq"; Thread gpm = new Thread() { @Override public void run() { super.run(); try { URL url = new URL(pmURL); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); InputStream inStream = conn.getInputStream(); InputStreamReader read = new InputStreamReader(inStream, "UTF-8"); BufferedReader br = new BufferedReader(read); String strResult =""; String tempLine; while ((tempLine = br.readLine()) != null) { strResult += tempLine; } JSONObject jsonObject = new JSONObject(strResult); Log.i("cat", ">>>>>>" + jsonObject); }catch(Exception e){ e.printStackTrace(); } } }; gpm.start(); try { gpm.join(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public int transfer(int wid) { switch (wid) { case 0: return 8; case 1: return 7; case 2: return 7; case 3: return 3; case 4: return 1; case 5: return 2; case 6: return 2; case 7: return 3; case 8: return 3; case 9: return 3; case 10: return 3; case 11: return 3; case 12: return 3; case 13: return 4; case 14: return 4; case 15: case 16: case 17: return 4; case 18: return 5; case 19: return 3; case 20: return 5; case 21: return 3; case 22: return 3; case 23: return 3; case 24: return 3; case 25: return 3; case 26: return 4; case 27: return 4; case 28: return 4; case 29: case 30: case 31: case 53: return 5; } return 9; } /** * * geter and seter */ public String getCityName() { return CityName; } public void setCityName(String cityName) { CityName = cityName; } public String getWeatherCondition() { return WeatherCondition; } public void setWeatherCondition(String weatherCondition) { WeatherCondition = weatherCondition; } public String getTemperature() { return Temperature; } public void setTemperature(String temperature) { Temperature = temperature; } public String getDate() { return Date; } public void setDate(String date) { Date = date; } public Context getContext() { return context; } public void setContext(Context context) { this.context = context; } public List<Map<String, Object>> getForecastList() { return ForecastList; } public void setForecastList(List<Map<String, Object>> forecastList) { ForecastList = forecastList; } public int getWid() { return wid; } public void setWid(int wid) { this.wid = wid; } @Override public int getWeatherIconNum() { // TODO Auto-generated method stub return weatherIcon[getWid()]; } @Override public Map<String, String> getAirQualityMap() { // TODO Auto-generated method stub return null; } }
import React from 'react'; import style from './Team.module.scss'; import Title from '@/app/components/Title/Title'; import Image from 'next/image'; import useMockData from '@/app/hooks/useMockData'; function Member({ member }: { member: MemberT }) { return ( <div className={style.member}> <Image className={style.img} width={124} height={124} alt={member.name + 'image'} src={`https://random.imagecdn.app/124/124/?avoidCachingSoItwillBeDifferentImages=${member.name}`} /> <p className={style.name}>{member.name}</p> <p className={style.position}>{member.position}</p> </div> ); } function Team() { const { members } = useMockData(); return ( <> <Title title='News Pulse Team' className={style.title} /> <div className={style.team}> {members.map((member) => { return <Member member={member} key={member.name} />; })} </div> </> ); } export default Team;
import 'package:codelingo/Screens/Select_Course_Screen/components/Course_Select_Appbar.dart'; import 'package:codelingo/Screens/home.dart'; import 'package:codelingo/Screens/home_screen/home_screen.dart'; import 'package:flutter/material.dart'; class CourseSelectTypePage extends StatefulWidget { @override _CourseSelectPageState createState() => _CourseSelectPageState(); } class _CourseSelectPageState extends State<CourseSelectTypePage> { String selectedUserType = ''; @override Widget build(BuildContext context) { return Scaffold( appBar: CourseSelectAppBar(), backgroundColor: Colors.grey[200], body: Center( child: Padding( padding: const EdgeInsets.all(20.0), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ const Text( 'SELECT COURSE', style: TextStyle( fontSize: 24, fontWeight: FontWeight.bold, color: Colors.black87, ), ), const SizedBox(height: 10), Container( height: 2, width: 50, color: const Color(0xFF2AE69B), ), const SizedBox(height: 30), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ UserTypeCard( iconPath: 'assets/icons/cplus.png', title: 'C++', isSelected: selectedUserType == 'C++', onTap: () { setState(() { selectedUserType = 'C++'; }); }, ), SizedBox(width: 20), UserTypeCard( iconPath: 'assets/icons/java.png', title: 'Java', isSelected: selectedUserType == 'Java', onTap: () { setState(() { selectedUserType = 'Java'; }); }, ), SizedBox(width: 20), UserTypeCard( iconPath: 'assets/icons/python.png', title: 'Python', isSelected: selectedUserType == 'Python', onTap: () { setState(() { selectedUserType = 'Python'; }); }, ), ], ), SizedBox(height: 50), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ ElevatedButton( onPressed: () { Navigator.pop(context); }, style: ElevatedButton.styleFrom( backgroundColor: Colors.grey, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), ) , ), child: Text('Back', style: TextStyle( color: Colors.white, // Set the text color to white ),), ), SizedBox(width: 20), ElevatedButton( onPressed: () { Navigator.of(context).push( MaterialPageRoute( builder: (context) => const HomeScreen(), )); }, style: ElevatedButton.styleFrom( backgroundColor: const Color(0xFF2AE69B), shape: CircleBorder(), padding: EdgeInsets.all(20), ), child: Icon(Icons.arrow_forward, color: Colors.white,), ), ], ), ], ), ), ), ); } } class UserTypeCard extends StatelessWidget { final String iconPath; final String title; final bool isSelected; final VoidCallback onTap; UserTypeCard({ required this.iconPath, required this.title, required this.isSelected, required this.onTap, }); @override Widget build(BuildContext context) { return GestureDetector( onTap: onTap, child: Container( width: 100, height: 120, decoration: BoxDecoration( color: isSelected ? const Color(0xFF2AE69B).withOpacity(0.1) : Colors.white, borderRadius: BorderRadius.circular(20), border: Border.all( color: isSelected ? Color(0xFF2AE69B) : Colors.white, width: 2, ), boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.3), spreadRadius: 2, blurRadius: 5, offset: Offset(0, 3), ), ], ), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Image.asset( iconPath, width: 40, height: 40, ), SizedBox(height: 10), Text( title, style: TextStyle( fontSize: 16, fontWeight: FontWeight.bold, color: isSelected ? Color(0xFF2AE69B): Colors.black54, ), ), ], ), ), ); } }
package admin import ( "context" "fmt" "github.com/MamushevArup/typeracer/internal/models" "github.com/google/uuid" "time" ) func (s *service) ApproveContent(ctx context.Context, modId string) error { if modId == "" { return fmt.Errorf("moderation id is empty") } modUUID, err := uuid.Parse(modId) if err != nil { return fmt.Errorf("moderation id is not valid") } info, err := s.repo.Admin.ModerationById(ctx, modUUID) if err != nil { return fmt.Errorf("%w", err) } textDetails, err := s.convertToText(info) if err != nil { return fmt.Errorf("%w", err) } contributor := s.convertToContributor(info, textDetails.TextID) transaction := models.TextAcceptTransaction{Text: textDetails, Contributor: contributor} err = s.repo.Admin.ApproveContent(ctx, transaction) if err != nil { return fmt.Errorf("%w", err) } err = s.repo.Admin.DeleteModerationText(ctx, modUUID) if err != nil { return fmt.Errorf("%w", err) } return nil } func (s *service) convertToText(info models.ModerationApprove) (models.ApproveToText, error) { textId, err := uuid.NewUUID() if err != nil { return models.ApproveToText{}, fmt.Errorf("can't generate text id") } return models.ApproveToText{ TextID: textId, ContributorID: info.RacerID, Content: info.Content, Author: info.Author, AcceptedAt: time.Now(), Length: len(info.Content), Source: info.Source, SourceTitle: info.SourceTitle, }, nil } func (s *service) convertToContributor(info models.ModerationApprove, textUUID uuid.UUID) models.ApproveToContributor { return models.ApproveToContributor{ ContributorID: info.RacerID, SentAt: info.SentAt, TextID: textUUID, } }
// ignore_for_file: library_private_types_in_public_api, avoid_print import 'package:camera/camera.dart'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'scan_controller.dart'; import 'sensor_info.dart'; import 'speech_menu.dart'; late List<CameraDescription> cameras; Future<Null> main() async { WidgetsFlutterBinding.ensureInitialized(); try { cameras = await availableCameras(); } on CameraException catch (e) { print('Error: ${e.code}\nError Message: ${e.description}'); } runApp(const MenuApp()); } class MenuApp extends StatefulWidget { const MenuApp({super.key}); @override _MenuAppState createState() => _MenuAppState(); } class _MenuAppState extends State<MenuApp> { late CameraController _controller; late Future<void> _initializeControllerFuture; @override void initState() { super.initState(); _initializeCamera(); } void _initializeCamera() async { final cameras = await availableCameras(); final firstCamera = cameras.first; _controller = CameraController(firstCamera, ResolutionPreset.medium); _initializeControllerFuture = _controller.initialize(); } @override void dispose() { _controller.dispose(); super.dispose(); } @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, title: 'Flutter Menu', theme: ThemeData( primarySwatch: Colors.red, fontFamily: 'Montserrat', ), home: const MenuScreen(), routes: { '/sensor_info': (context) => const SensorInfo(), '/speech_recognition': (context) => SpeechMenu(), '/camera_view': (context) => CameraView( key: UniqueKey(), controller: _controller, ), }, ); } } class MenuScreen extends StatelessWidget { const MenuScreen({super.key}); @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text( '', style: TextStyle( color: Colors.white, fontSize: 40, fontFamily: '', // Custom font fontWeight: FontWeight.bold, // Make it bold letterSpacing: 2.0, // Add some letter spacing shadows: [ Shadow( blurRadius: 5.0, color: Colors.black, offset: Offset(2.0, 2.0), ), ], ), ), centerTitle: true, backgroundColor: Colors.transparent, elevation: 0, ), extendBodyBehindAppBar: true, body: Stack( children: [ // Background gradient Container( decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.bottomRight, end: Alignment.topLeft, colors: [Color(0xFFD4145A), Color(0xFFFBB03B)], ), ), ), // Suncloud image Positioned( top: -160, // Move it further upwards right: -20, child: Transform.scale( scale: 0.6, // Scale down by 25% child: Transform( transform: Matrix4.rotationY(180 * 3.1415927 / 180), // Flip vertically alignment: Alignment.topCenter, child: Opacity( opacity: 0.3, // 30% opacity child: Image.asset( 'assets/suncloud.png', fit: BoxFit.fitWidth, // Fit the image width ), ), ), ), ), // Content Center( child: Column( mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ SizedBox( height: MediaQuery.of(context).size.height * 0.27), // Added SizedBox to create space MenuButton( text: 'Sensor Info', icon: Icons.sensors, onPressed: () { Navigator.pushNamed(context, '/sensor_info'); }, ), const SizedBox(height: 20), MenuButton( text: 'Camera View', icon: Icons.camera_alt, onPressed: () async { Navigator.pushNamed( context, '/camera_view', ); }, ), const SizedBox(height: 20), MenuButton( text: 'Speech Recognition', icon: Icons.mic, onPressed: () { Navigator.pushNamed(context, '/speech_recognition'); }, ), ], ), ), // Background image with 50% opacity Positioned( left: 0, right: 0, bottom: 0, child: Opacity( opacity: 0.4, child: Image.asset( 'assets/home.png', // Adjust path as necessary fit: BoxFit.scaleDown, // Scale down the image to fit ), ), ), ], ), ); } } class MenuButton extends StatelessWidget { final String text; final IconData icon; final VoidCallback onPressed; const MenuButton({ super.key, required this.text, required this.icon, required this.onPressed, }); @override Widget build(BuildContext context) { return GestureDetector( onTap: onPressed, child: Container( width: 250, padding: const EdgeInsets.symmetric(vertical: 15), decoration: BoxDecoration( color: const Color.fromARGB(255, 255, 249, 221), borderRadius: BorderRadius.circular(30), boxShadow: [ BoxShadow( color: const Color.fromARGB(255, 0, 0, 0).withOpacity(0.3), blurRadius: 10, offset: const Offset(0, 5), ), ], ), child: _buildContent(), ), ); } Widget _buildContent() { return Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon(icon, color: const Color(0xFFFBB03B)), const SizedBox(width: 10), Text( text, style: const TextStyle( fontSize: 18, fontWeight: FontWeight.bold, color: Color(0xFFD4145A), ), ), ], ); } } class CameraView extends StatelessWidget { const CameraView({Key? key, required this.controller}) : super(key: key); final CameraController controller; @override Widget build(BuildContext context) { return Container( decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.bottomRight, end: Alignment.topLeft, colors: [Color(0xFFD4145A), Color(0xFFFBB03B)], ), ), child: Scaffold( appBar: AppBar( title: const Text('Camera View'), centerTitle: true, backgroundColor: Colors.transparent, elevation: 0, flexibleSpace: Container( decoration: const BoxDecoration( gradient: LinearGradient( begin: Alignment.bottomRight, end: Alignment.topLeft, colors: [Color(0xFFD4145A), Color(0xFFFBB03B)], ), ), ), ), extendBodyBehindAppBar: false, body: GetBuilder<ScanController>( init: ScanController(), builder: (controller) { return Stack( children: [ // Camera Preview controller.isCameraInitialized.value ? CameraPreview(controller.cameraController) : const Center(child: Text("Loading")), // Detected Object Text Overlay Positioned( bottom: 0, left: 16, child: Obx(() => Text( controller.detectedObject.value, style: const TextStyle( color: Colors.white, fontSize: 24, fontWeight: FontWeight.bold, ), )), ), ], ); }, ), ), ); } }
from typing import overload import pandas as pd # from src.ix.bt.asset import Asset from src.ix.core import StandardScaler, to_log_return, to_pri_return class Signal: normalize_window: int = 200 def __init__(self) -> None: self.signal = self.compute() def compute(self) -> pd.Series: raise NotImplementedError(f"Must Implement `{self.compute.__name__}` method.") def normalize(self) -> pd.Series: data = self.compute() normalized = ( data.rolling(self.normalize_window) .apply(StandardScaler(lower=-3, upper=3).latest) .divide(2) ) return normalized @overload def get_performance(self, px: pd.Series, periods: int) -> pd.Series: ... @overload def get_performance(self, px: pd.Series, periods: list[int]) -> pd.DataFrame: ... def get_performance( self, px: pd.Series, periods: int | list[int] = 1 ) -> pd.Series | pd.DataFrame: if isinstance(periods, list): performances = [] for period in periods: performance = self.get_performance(px=px, periods=period) performances.append(performance) return pd.concat(performances, axis=1) pri_return = to_pri_return(px=px, periods=periods, forward=True) pri_return = (1 + pri_return) ** (1 / periods) - 1 w = self.signal.reindex(pri_return.index).ffill() p = pri_return.mul(w).add(1).cumprod() p.name = periods return p def get_signal_performances( signal: pd.Series, px: pd.Series, periods: int | list[int] ) -> pd.Series | pd.DataFrame: if isinstance(periods, list): performances = [] for period in periods: performance = get_signal_performances(signal=signal, px=px, periods=period) performances.append(performance) return pd.concat(performances, axis=1) pri_return = to_pri_return(px=px, periods=periods, forward=True) pri_return = (1 + pri_return) ** (1 / periods) - 1 w = signal.reindex(pri_return.index).ffill() p = pri_return.mul(w).add(1).cumprod() p.name = periods return p
import 'package:flutter/material.dart'; import 'package:flutter/src/widgets/container.dart'; import 'package:flutter/src/widgets/framework.dart'; import 'package:provider/provider.dart'; import 'package:shop_application/provider/product.dart'; import 'package:shop_application/provider/products.dart'; class EditProductScreen extends StatefulWidget { static const String routeName = "/editProduct"; const EditProductScreen({super.key}); @override State<EditProductScreen> createState() => _EditProductScreenState(); } class _EditProductScreenState extends State<EditProductScreen> { final _priceFocusNode = FocusNode(); final _descrpitionFocusNode = FocusNode(); final _imageUrlController = TextEditingController(); final _imageUrlFocusNode = FocusNode(); final _form = GlobalKey<FormState>(); var _editedProduct = Product(price: 0, description: '', id: null, imageUrl: "", title: ''); var _isloading = false; void initState() { // TODO: implement initState _imageUrlFocusNode.addListener(_updateTextController); } bool isdid = false; @override void didChangeDependencies() { if (!isdid) { var productid = ModalRoute.of(context)!.settings.arguments; if (productid != null) { _editedProduct = Provider.of<Products>(context, listen: false) .findById(productid as String); _imageUrlController.text = _editedProduct.imageUrl!; } } isdid = true; super.didChangeDependencies(); } @override void dispose() { _imageUrlFocusNode.removeListener(_updateTextController); _priceFocusNode.dispose(); _descrpitionFocusNode.dispose(); _imageUrlController.dispose(); _imageUrlFocusNode.dispose(); super.dispose(); } void _updateTextController() { if (!_imageUrlFocusNode.hasFocus) { if (_imageUrlController.text!.isEmpty || (!_imageUrlController.text.startsWith('http') && !_imageUrlController.text.startsWith('https'))) { return; } setState(() {}); } } Future<void> _saveForm() async { final isValid = _form.currentState!.validate(); if (!isValid) { return; } _form.currentState!.save(); setState(() { _isloading = true; print(" isloading = $_isloading "); }); if (_editedProduct.id != null) { await Provider.of<Products>(context, listen: false) .updateproduct(_editedProduct.id!, _editedProduct); } else { try { await Provider.of<Products>(context, listen: false) .addProductToJson(_editedProduct); } catch (error) { await showDialog<Null>( context: context, builder: (ctx) { return AlertDialog( title: Text("An error occured"), content: Text("somthing wrong"), actions: [ TextButton( onPressed: () { Navigator.of(ctx).pop(); }, child: Text('Okay')) ], ); }); } } setState(() { _isloading = false; print(" isloading = $_isloading "); }); Navigator.pop(context); print(_editedProduct.title); print(_editedProduct.description); print(_editedProduct.imageUrl); print(_editedProduct.price); } @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text("edit product"), actions: [ IconButton( onPressed: () { _saveForm(); }, icon: Icon(Icons.save)) ], ), body: (_isloading) ? Center(child: CircularProgressIndicator()) : Padding( padding: const EdgeInsets.all(16), child: Form( key: _form, child: ListView( children: [ TextFormField( initialValue: _editedProduct.title, decoration: InputDecoration(labelText: "Title"), textInputAction: TextInputAction.next, onFieldSubmitted: (_) => FocusScope.of(context).requestFocus(_priceFocusNode), onSaved: (value) { _editedProduct = Product( price: _editedProduct.price, description: _editedProduct.description, id: _editedProduct.id, imageUrl: _editedProduct.imageUrl, title: value!, isFavorite: _editedProduct.isFavorite); }, validator: (value) { if (value!.isEmpty) { return "please provide a value!"; } return null; }, ), TextFormField( initialValue: _editedProduct.price.toString(), decoration: InputDecoration(labelText: "Price"), textInputAction: TextInputAction.next, keyboardType: TextInputType.number, focusNode: _priceFocusNode, onFieldSubmitted: (_) => FocusScope.of(context) .requestFocus(_descrpitionFocusNode), onSaved: (value) { _editedProduct = Product( price: double.parse(value!), description: _editedProduct.description, id: _editedProduct.id, imageUrl: _editedProduct.imageUrl, title: _editedProduct.title, isFavorite: _editedProduct.isFavorite); }, validator: (value) { if (value!.isEmpty) { return "please provide a value!"; } if (double.parse(value) == null) { return "please enter a valid number"; } if (double.parse(value) <= 0) { return "please enter a number greater than 0"; } return null; }, ), TextFormField( initialValue: _editedProduct.description, decoration: InputDecoration(labelText: "Description"), textInputAction: TextInputAction.next, keyboardType: TextInputType.text, maxLines: 3, focusNode: _descrpitionFocusNode, onSaved: (value) { _editedProduct = Product( price: _editedProduct.price, description: value!, id: _editedProduct.id, imageUrl: _editedProduct.imageUrl, title: _editedProduct.title, isFavorite: _editedProduct.isFavorite); }, validator: (value) { if (value!.isEmpty) { return "please provide a value!"; } if (value!.length < 10) { return "should be at least 10 charachter least"; } }, ), Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( width: 100, height: 100, margin: EdgeInsets.only(top: 8, right: 10), decoration: BoxDecoration( border: Border.all(width: 1, color: Colors.grey), ), child: _imageUrlController.text.isEmpty ? Text('Enter a UrL') : FittedBox( child: Image.network( _imageUrlController.text, fit: BoxFit.cover, ), ), ), Expanded( child: TextFormField( decoration: InputDecoration(labelText: 'Image URL'), keyboardType: TextInputType.url, textInputAction: TextInputAction.done, controller: _imageUrlController, focusNode: _imageUrlFocusNode, onEditingComplete: () { setState(() {}); }, onFieldSubmitted: (value) { _saveForm(); }, onSaved: (value) { _editedProduct = Product( price: _editedProduct.price, description: _editedProduct.description, // id: _editedProduct.id, id: _editedProduct.id, imageUrl: value!, title: _editedProduct.title, isFavorite: _editedProduct.isFavorite); }, validator: (value) { if (value!.isEmpty) { return "please provide a value"; } if (!value.startsWith('http') || !value.startsWith('https')) { return "please enter a valid URL"; } return null; }, )), ], ) ], ), ), ), ); } }
<template> <div class="list-group" style="width: 70%;"> <!-- <p>this is online_test component</p>--> <test_problem class="list-group-item" style="border-left:none;border-right:none" v-for = "(prob,index) in probList" :title = "prob.title" :options = "prob.options" :key = "index" :ref = "index" :answer.sync = "answer[index]" :index="index" ></test_problem> <button @click="submit" class="btn btn-info btn-lg" >提交</button> </div> </template> <script> // eslint-disable-next-line no-unused-vars import test_problem from "./test_problem"; export default { name: "online_test", // eslint-disable-next-line vue/no-unused-components components:{test_problem}, data(){ return { probList:[ { title:"'OW'的意思是?", options:[ "ow", "overwatch", "overweight", "orbitwave", ] }, { title:"1+1=?", options:[ "1", "2", "3", "4", ] }, { title: "你很少出于纯粹的好奇心做什么事。", options: [ "同意", "反对" ] }, { title: "下列哪一种学习方式比较适合你?", options: [ "丰富的学术依据,详尽的解析", "听老师讲课就足够,不需要其他辅助材料", "有其他辅助材料", "体验式的学习方式" ] } ], answer:[ undefined, undefined ], }; }, methods:{ submit:function(){ // eslint-disable-next-line no-unused-vars for(let [key, value] of this.probList.entries()){ let refVal = key.toString(); this.answer[key]=this.$refs[refVal][0].answer; if(this.answer[key] === undefined){ alert("有题目未答,请答完再提交"); return; } } console.log(this.answer); //submit answer to server let tid = this.$route.params.testid; let url = process.env.VUE_APP_BASE_URL+"/php/submitTest.php"; let params = new URLSearchParams(); params.append('testid', tid); params.append('answer', this.answer); params.append("uid",this.$store.state.userInfo.uid); //let postid = {postid: 1}; this.axios.post(url, params).then((resp) => { console.log(resp.data); if(resp.data == "0"){ alert("提交失败"); } else{ alert("提交成功"); } }); }, getProblems(){ let tid = this.$route.params.testid; let url = process.env.VUE_APP_BASE_URL+"/php/getProblems.php"; let params = new URLSearchParams(); params.append('testid', tid); //let postid = {postid: 1}; this.axios.post(url, params).then((resp) => { console.log(resp.data); this.probList = resp.data; }); }, }, mounted() { this.getProblems(); } } </script> <style scoped> </style>
package problem1; import java.util.Scanner; public class SolutionHM { static StringBuilder sb = new StringBuilder(); // 이동 순서가 담길 배열 static int count = 0; // 이동 횟수 public static void main(String[] args) { Scanner sc = new Scanner(System.in); int num = sc.nextInt(); hanoi(num, 1, 2, 3); // 막대기 세 개를 순서대로 1, 2, 3으로 지정해줌 System.out.println(count); // 이동 횟수 System.out.println(sb); // 이동 순서 } public static void hanoi(int num, int start, int mid, int end) { count++; // 이동 횟수 증가 (저장) // 이동할 원반의 수가 1개라면 // sb에 start에서 end로 이동하는 것을 추가하고 함수를 종료 if( num == 1 ) { sb.append(start + " " + end + "\n"); // 1번에서 3번으로 이동 return; } // 이동할 원판의 수가 1개가 아닐 때 --> 재귀적으로 하노이 함수를 호출 hanoi(num-1, start, end, mid); // 1->3->2 순서 (num-1개의 원판을 start에서 mid로 이동) // 제일 큰 원판을 1번에서 3번으로 이동 (start에서 end로 이동) sb.append(start + " " + end + "\n"); // 셋째: n-1개를 2번에서 3번으로 이동 (mid에서 end로 이동) // 2번에 남아있는 원판들을 1번을 이용해서 3번으로 옮기기 hanoi(num-1, mid, start, end); // 2->1->3 순서 } }
import * as vscode from "vscode"; import { TextDecoder, TextEncoder } from "util"; import { CANNOT_READ_FILE_ERROR, CANNOT_WRITE_FILE_ERROR, FILE_IS_NOT_UTF8_ERROR, } from "./constants"; const os = globalThis?.process?.platform, seemsLikeAbsoluteFilePath = os === "win32" ? (value: string) => /^([/\\]|[A-Za-z]:)/.test(value) : (value: string) => value[0] === "/"; /** * Joins a URI to some segments; segments may be absolute URIs to resources with * _different_ schemes. * * @see {@link vscode.Uri.joinPath()} */ export function joinMixed( base: vscode.Uri, ...segments: readonly string[] ): vscode.Uri { for (let i = 0; i < segments.length; i++) { const segment = segments[i]; if (seemsLikeAbsoluteFilePath(segment)) { base = vscode.Uri.file(segment); } else if (/^[a-z]+:/.test(segment)) { base = vscode.Uri.parse(segment); } else { continue; } segments = segments.slice(i + 1); i = 0; } return vscode.Uri.joinPath(base, ...segments); } /** * Parses an absolute URI, preferring file URIs. * * @see {@link vscode.Uri.parse()} */ export function parseUri(value: string): vscode.Uri { if (seemsLikeAbsoluteFilePath(value)) { return vscode.Uri.file(value); } return vscode.Uri.parse(value); } /** * Resolves the URI to an extension resource. */ export function resolveExtensionPath( context: vscode.ExtensionContext, path: string, ): vscode.Uri { return DEV ? vscode.Uri.joinPath(context.extensionUri, "out", path) : vscode.Uri.joinPath(context.extensionUri, path); } /** * Reads the file at `uri` into a string, assuming that its contents are valid * UTF-8. */ export async function readFile(uri: vscode.Uri): Promise<string | Error> { let bytes: Uint8Array; try { bytes = await vscode.workspace.fs.readFile(uri); } catch { return new Error(CANNOT_READ_FILE_ERROR); } try { return new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }).decode( bytes, ); } catch { return new Error(FILE_IS_NOT_UTF8_ERROR); } } /** * Reads the file at `uri` into a string, assuming that its contents are valid * UTF-8. */ export async function writeFile( uri: vscode.Uri, text: string, ): Promise<undefined | Error> { // Write configuration text to file. try { await vscode.workspace.fs.writeFile(uri, new TextEncoder().encode(text)); return; } catch { return new Error(CANNOT_WRITE_FILE_ERROR); } } /** * Calls `f` for all setting values in the */ function forAllSettingValues<T>( context: vscode.ExtensionContext, section: string, property: string, f: ( value: T | undefined, configFileUri: vscode.Uri, resolutionBaseUri: vscode.Uri | undefined, ) => void, ): void { // This should work for all platforms: // https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations // // `.../Code/User/globalStorage/extension.id` // ↓ // `.../Code/User/settings.json` const userSettingsPath = vscode.Uri.joinPath( context.globalStorageUri, "..", "..", "settings.json", ); // Note that relative schemas are not supported for the global config. const config = vscode.workspace.getConfiguration(section).inspect<T>( property, ); f(config?.globalValue, userSettingsPath, undefined); if (vscode.workspace.isTrusted) { const { workspaceFile, workspaceFolders } = vscode.workspace; if (workspaceFile !== undefined) { f( config?.workspaceValue, workspaceFile, vscode.Uri.joinPath(workspaceFile, ".."), ); } else if (workspaceFolders?.length === 1) { const workspaceFolder = workspaceFolders[0]; const workspaceSettingsPath = vscode.Uri.joinPath( workspaceFolder.uri, ".vscode", "settings.json", ); f(config?.workspaceValue, workspaceSettingsPath, workspaceFolder.uri); } else if (workspaceFolders?.length ?? 0 > 1) { for (const workspaceFolder of workspaceFolders!) { const workspaceSettingsPath = vscode.Uri.joinPath( workspaceFolder.uri, ".vscode", "settings.json", ); const config = vscode.workspace.getConfiguration( section, workspaceFolder.uri, ); f(config.get(property), workspaceSettingsPath, workspaceFolder.uri); } } } } /** * Runs {@link forAllSettingValues()} now and whenever the requested settings * may have changed. */ export function registerForAllSettingsValues< KV extends Record<`${string}.${string}`, any>, >( context: vscode.ExtensionContext, watchers: { readonly [PropertyAndSection in keyof KV]: ( value: KV[PropertyAndSection] | undefined, configFileUri: vscode.Uri, resolutionBaseUri: vscode.Uri | undefined, ) => void; }, ): void { const parsedWatchers: [string, string, (typeof watchers)[any]][] = []; for (const [propertyAndSection, handler] of Object.entries(watchers)) { const dotIndex = propertyAndSection.lastIndexOf("."); const section = propertyAndSection.slice(0, dotIndex); const property = propertyAndSection.slice(dotIndex + 1); parsedWatchers.push([section, property, handler]); } const callWatchers = () => { for (const [section, property, handler] of parsedWatchers) { forAllSettingValues(context, section, property, handler); } }; callWatchers(); context.subscriptions.push( vscode.workspace.onDidChangeWorkspaceFolders(() => { if (!vscode.workspace.isTrusted) { return; } callWatchers(); }), vscode.workspace.onDidGrantWorkspaceTrust(callWatchers), vscode.workspace.onDidChangeConfiguration((e) => { for (const [section, property, handler] of parsedWatchers) { if (e.affectsConfiguration(`${section}.${property}`)) { forAllSettingValues(context, section, property, handler); } } }), ); } /** * Calls `register` with {@link vscode.DocumentSelector document selectors} that * match JSON documents. */ export function registerForJsonDocuments( context: vscode.ExtensionContext, register: (selector: vscode.DocumentSelector) => vscode.Disposable, ) { for (const scheme of ["file", "vscode-userdata"]) { for (const language of ["json", "jsonc"]) { context.subscriptions.push(register({ scheme, language })); } } }
/*Multi-threading programming using c*/ #include<stdio.h> #include<pthread.h> #define NUM_THREADS 5 void *threadFunction(void *arg) { int threadNumber=*(int *)arg; printf("Thread %d is running \n",threadNumber); return NULL; } int main() { pthread_t threads[NUM_THREADS]; int threadArgs[NUM_THREADS]; int i; for(i=0;i<NUM_THREADS;i++) { threadArgs[i]=i; pthread_create(&threads,NULL,threadFunction,&threadArgs[i]); } for(i=0;i<NUM_THREADS;i++) { pthread_join(threads[i],NULL); } printf("ALL threads have completed"); return 0; } /*OUTPUT IS:Thread 4 is running ALL threads have completed */ /*NOTES: After creating the threads, we use pthread_join to wait for each thread to finish its execution. This ensures that the main thread waits until all the other threads have completed before proceeding. Finally, a message is printed to indicate that all threads have completed. */
## Scroll #### Scroll无法滚动 Scroll内部需添加一个Column 容器组件,否则Item会全屏显示 Scroll内部的Column不能设置高度,否则无法滚动 ``` Scroll(this.scroller){ Column(){ ForEach(this.arr,(item:number,index)=>{ Text("数据:"+item) .height('30%') .width('30%') .borderWidth(2) .borderColor(Color.Black) .borderRadius(2) }, item => item) } .width('100%') }.height('100%') .width('100%') .scrollable(ScrollDirection.Vertical) // 滚动方向纵向 .scrollBar(BarState.On) // 滚动条常驻显示 .scrollBarColor(Color.Gray) // 滚动条颜色 .scrollBarWidth(30) // 滚动条宽度 ``` ### Scroll和List复合时阴影效果 Scroll和List复合使用时,需要在List处添加才会有阴影效果 ``` Scroll(){ Column(){ List({scroller: this.scrollerController }) { LazyForEach(this.livingData,(item:SearchLiveRoomBean)=>{ ListItem() { LiveRoomItem({ item: item }) .margin(4) } },(item:SearchLiveRoomBean)=>item.roomid+item.uname) }.edgeEffect(EdgeEffect.Fade)//这里才会有效果 .lanes(2) .width('100%') .height('100%') } } // 在这里添加属性,没有下拉阴影 .edgeEffect(EdgeEffect.Fade) ``` ### 布局的小心得 layoutWeight(1) 默认会填充当前父容器的主轴的剩余部分。如果当前父容器在主轴上没有设置大小,会填充父容器的父容器的剩余部分 比如父容器时Row,就会在横轴上填充。父容器时Colum就会在纵轴上填充 没有设置宽高,就会类似于wrap_content效果 设置宽高的百分比,就会找寻父容器的大小,父容器没有设置,就会继续往上找 设置layoutWeight(1),当前父容器的主轴方向设置大小都是无效的 ```typescript ``` ### JS是单线程的 JS本身是单线程的,相比于多线程,省去了线程同步问题,资源竞争(cpu分配)的问题。 而且,省去了Cpu切换线程时,保存数据至寄存器的时间。以及分配线程内存的空间 ### promise async await async await 用于使代码以同步的方式执行异步代码。由于JS内部是单线程的。 因此内部有某种机制,不会卡顿主线程 await 需要修饰Promise对象 如果异步代码返回值是用await修饰。且是在async的函数中,该函数执行顺序一定是同步的 就像是下列的this.test()方法。输出结果为:1, 2.1, 2.2, 3 但是在aboutToAppear中,在等待await this.test1()的结果时,会优先打印 console.log("我是4") ```typescript class test{ aboutToAppear(){ this.test() console.log("我是4") } async test(){ console.log("我是1") await this.test1() await this.test2() console.log("我是3") } test1(){ return new Promise((resolve)=>{ setTimeout(()=>{ resolve(console.log("我是2.1")) },3000) }) } test2(){ return new Promise((resolve)=>{ setTimeout(()=>{ resolve(console.log("我是2.2")) },1000) }) } } ``` #### TypeScript string的全局替换 replace 的第一个参数,不要加引号,而是/。如果要是全局替换,要加上/g。例如下面 ``` @Entry @Component struct Index { @State message: string = 'Hello World' msg = '123&uuu&zhi&uiosd' build() { Row() { Column() { Button(this.message) .onClick(() => { this.message = this.msg.replace(/&/g, ';') }) }.width('100%') } } } ``` #### 观察内部对象属性的变化,除了@Observe和@ObjectLink外(双向的)。还有@Observe和@Prop(单向的) ``` let NextID: number = 1; @Observed class ClassA { public id: number; public c: number; constructor(c: number) { this.id = NextID++; this.c = c; } } class ClassB { public a: ClassA; constructor(a: ClassA) { this.a = a; } } @Component struct ViewA { label: string = 'ViewA1'; // @ObjectLink a: ClassA; // 双向的,会报错,但是可以运行 @Prop a: ClassA; // 单项的 build() { Row() { Button(`ViewA [${this.label}] this.a.c=${this.a.c} +1`) .onClick(() => { this.a.c += 1; }) } } } @Preview @Component export struct NewPage { @State b: ClassB = new ClassB(new ClassA(0)); build() { Column() { ViewA({ label: 'ViewA #1', a: this.b.a }) ViewA({ label: 'ViewA #2', a: this.b.a }) Button(`ViewB: this.b.a.c+= 1`) .onClick(() => { this.b.a.c += 1; }) Button(`ViewB: this.b.a = new ClassA(0)`) .onClick(() => { this.b.a = new ClassA(0); }) Button(`ViewB: this.b = new ClassB(ClassA(0))`) .onClick(() => { this.b = new ClassB(new ClassA(0)); }) } } } ``` #### 手势使用 简单的滑动。来判断移动的距离 ```typescript Blank("亮度") .gesture(GestureGroup(GestureMode.Exclusive, PanGesture({direction:PanDirection.Vertical}) .onActionStart((event?:GestureEvent)=>{ // 向上为负,向下为正,以当前点为起始点 event.offsetY console.log('Gesture:onActionStart:'+ event.offsetY) }) .onActionUpdate((event?:GestureEvent)=>{ // 向上为负,向下为正,以onActionUpdate的值为起始点,返回的都是当前点和起始点的差值 event.offsetY console.log('Gesture:onActionUpdate:'+ event.offsetY) }).onActionEnd((event?:GestureEvent)=>{ event.offsetY console.log('Gesture:onActionEnd:'+ event.offsetY) }) )) ``` #### 修改声音和亮度 需要修改这个权限 {"name" :'ohos.permission.ACCESS_NOTIFICATION_POLICY'} ```typescript // 屏幕亮度范围 0~1 adjustBrightness(brightness: number) { window.getLastWindow(getContext(this), (err: object, data: window.Window) => { let tempBrightness = brightness if (tempBrightness > 1) { tempBrightness = 1 } else if (brightness <= 0) { tempBrightness = 0 } data.setWindowBrightness(tempBrightness) }); } getBright():Promise<number>{ return new Promise<number>((resolve, reject) => { window.getLastWindow(getContext(this), (err: object, data: window.Window) => { resolve(data.getWindowProperties().brightness) }) }) } // 声音设置0-15 adjustVolume(volume: number) { if (volume>15) { volume = 15 }else if(volume<0){ volume = 0 } audio.getAudioManager().setVolume(audio.AudioVolumeType.MEDIA,volume) } getVolume():Promise<number> { return audio.getAudioManager().getVolume(audio.AudioVolumeType.MEDIA) } ``` #### 字符串slice slice截取字符串,start起始位置,end结束位置,其中,start位置的字符会被返回,end位置的会被丢弃 ``` let num='123456789' // 起始位置下标为0,end位置下标为8 // 下标0的结果保存,8下标结果被扔弃 // 所以temp结果为:12345678。 let temp = num.slice(0,8) ``` #### onBackPress 只在entry页面有效果,return true时会不执行系统的返回方法。
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Http\RedirectResponse; use App\Models\Siswa; use App\Models\Kelas; use Illuminate\Support\Str; class SiswaController extends Controller { /** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $siswa = Siswa::all(); return view('siswa.index')->with('siswa', $siswa); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create() { $kelas = Kelas::pluck('nama_kelas', 'id_kelas'); // Menyimpan data kelas dalam format yang sesuai // Melewatkan data kelas ke view return view('siswa.create', compact('kelas')); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Request $request) { $validatedData = $request->validate([ 'nis' => 'required|unique:siswas,nis', 'nama_siswa' => 'required', 'tempat_lahir' => 'required', 'tanggal_lahir' => 'required', 'jenis_kelamin' => 'required', 'agama' => 'required', 'alamat' => 'required', 'no_telp' => 'required', 'kelas' => 'required' ]); // Dapatkan kelas yang dipilih dari request $kelas = $request->input('kelas'); // Temukan kelas yang sesuai berdasarkan nilai kelas yang dipilih $kelasModel = Kelas::where('kelas', $kelas)->first(); if (!$kelasModel) { // Handle jika kelas tidak ditemukan return redirect()->back()->withErrors(['kelas' => 'Kelas tidak valid']); } // Tetapkan id_kelas dari siswa ke id kelas yang sesuai $validatedData['id_kelas'] = $kelasModel->id_kelas; // Tetapkan nama_kelas dengan nilai acak sesuai dengan data kelas yang ada $validatedData['nama_kelas'] = $this->generateRandomNamaKelas($kelasModel->nama_kelas); // Simpan data siswa ke dalam database Siswa::create($validatedData); // Redirect ke halaman yang sesuai return redirect()->route('admin.siswa.index')->with('flash_message', 'Siswa Added!'); } // Method untuk menghasilkan string acak untuk nama_kelas private function generateRandomNamaKelas($kelas) { // Implementasi logika Anda untuk menghasilkan nama_kelas secara acak return $kelas . ' ' . Str::random(2); // Misalnya, "X MIPA 1" } /** * Assign class automatically. * * @return int|null */ private function assignClassAutomatically() { // Implement your logic here to assign class automatically // Misalnya, Anda bisa menggunakan logika acak untuk memilih kelas $randomClass = Kelas::inRandomOrder()->first(); // Mengembalikan ID kelas atau null jika tidak ada kelas yang tersedia return $randomClass ? $randomClass->id_kelas : null; } public function show($nis) { $siswa = Siswa::findOrFail($nis); return view('siswa.show', compact('siswa')); } /** * Show the form for editing the specified resource. * * @param int $nis * @return \Illuminate\Http\Response */ public function edit($nis) { $siswa = Siswa::findOrFail($nis); $kelas = Kelas::pluck('nama_kelas', 'id_kelas'); // Mendapatkan daftar kelas return view('siswa.edit', compact('siswa', 'kelas')); // Meneruskan data siswa dan kelas ke view } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $nis * @return \Illuminate\Http\Response */ public function update(Request $request, $nis) { $validatedData = $request->validate([ 'nama_siswa' => 'required', 'tempat_lahir' => 'required', 'tanggal_lahir' => 'required', 'jenis_kelamin' => 'required', 'agama' => 'required', 'alamat' => 'required', 'no_telp' => 'required', 'id_kelas' => 'nullable|exists:kelas,id', ]); $siswa = Siswa::findOrFail($nis); $siswa->fill($validatedData)->save(); return redirect()->route('admin.siswa.index')->with('flash_message', 'Siswa Updated!'); } /** * Remove the specified resource from storage. * * @param int $nis * @return \Illuminate\Http\Response */ public function destroy($nis) { Siswa::findOrFail($nis)->delete(); return redirect()->route('admin.siswa.index')->with('flash_message', 'Siswa deleted!'); } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body ng-app="myApp"> <!-- <div ng-app="myApp" ng-controller="myCtrl"> <div ng-bind-html="resposta"></div> </div> --> <!-- <div ng-app="myApp" ng-controller="myCtrl"> <p>The is name {{lastName|uppercase}}</p> </div> --> <p><a href="#/!">ajax</a></p> <a href="#!red">Red</a> <a href="#!carrinho">Carrinho</a> <div ng-view></div> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular-route.js"></script> <script> /* var obj = { method : "GET", url : "ajax.html", }; var app = angular.module('myApp', []); app.controller('myCtrl', function($scope, $http, $sce) { $http(obj).then(function mySuccess(response) { $scope.resposta = $sce.trustAsHtml(response.data); }, function myError(response) { $scope.resposta = response.statusText; }); }); var obj ={ method : "GET", url : "ajax.html", }; var app = angular.module('myApp',[]); app.controller('myCtrl', function($scope, $http, $sce){ $scope.lastName = "Grillo"; }); */ var app = angular.module("myApp", ["ngRoute"]); app.config(function($routeProvider) { $routeProvider .when("/", { templateUrl : "ajax.html" }) .when("/red", { templateUrl : "red.php" }) .when("/carrinho", { templateUrl : "carrinho.html" }) }); </script> </script> </body> </html>
/* * This file is part of the ONT API. * The contents of this file are subject to the LGPL License, Version 3.0. * Copyright (c) 2023, owl.cs group. * * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. * * Alternatively, the contents of this file may be used under the terms of the Apache License, Version 2.0 in which case, the provisions of the Apache License Version 2.0 are applicable instead of those above. * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package com.github.owlcs.ontapi.internal.axioms; import com.github.owlcs.ontapi.config.AxiomsSettings; import com.github.owlcs.ontapi.internal.ModelObjectFactory; import com.github.owlcs.ontapi.internal.ONTObject; import com.github.owlcs.ontapi.internal.objects.ONTAxiomImpl; import com.github.owlcs.ontapi.internal.objects.ONTObjectImpl; import com.github.owlcs.ontapi.internal.objects.WithContent; import com.github.owlcs.ontapi.internal.objects.WithoutAnnotations; import com.github.owlcs.ontapi.jena.model.OntModel; import com.github.owlcs.ontapi.jena.model.OntStatement; import com.github.owlcs.ontapi.jena.utils.Iterators; import com.github.owlcs.ontapi.owlapi.OWLObjectImpl; import org.apache.jena.graph.Triple; import org.apache.jena.util.iterator.ExtendedIterator; import org.semanticweb.owlapi.model.OWLAnnotation; import org.semanticweb.owlapi.model.OWLAxiom; import org.semanticweb.owlapi.model.OWLObject; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.List; import java.util.Set; import java.util.function.BiFunction; import java.util.function.ObjIntConsumer; import java.util.function.Predicate; import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.Stream; /** * A technical interface that describes an n-ary axiom, * which may be presented as a triple (arity is {@code 2}) or as * []-list based section (e.g. {@link com.github.owlcs.ontapi.jena.vocabulary.OWL#AllDisjointClasses owl:AllDisjointClasses}). * Note: for internal usage only, it is just to avoid copy-pasting. * <p> * Created by @ssz on 02.10.2019. * * @param <E> - any subtype of {@link OWLObject} (the type of axiom components) * @since 2.0.0 */ @SuppressWarnings("rawtypes") interface WithManyObjects<E extends OWLObject> extends WithTriple { /** * Gets the {@link ONTObject}-wrapper from the factory. * * @param uri String, an entity URI, not {@code null} * @param factory {@link ModelObjectFactory}, not {@code null} * @return {@link ONTObject} of {@link E} */ ONTObject<? extends E> findByURI(String uri, ModelObjectFactory factory); /** * Extracts and lists all elements from the given statement. * * @param statement {@link OntStatement}, the source, not {@code null} * @param factory {@link ModelObjectFactory}, not {@code null} * @return an {@link ExtendedIterator} of {@link ONTObject} with type {@link E} */ ExtendedIterator<ONTObject<? extends E>> listONTComponents(OntStatement statement, ModelObjectFactory factory); /** * Returns a sorted and distinct {@code Stream} over all components (annotations are not included). * * @param factory {@link ModelObjectFactory}, not {@code null} * @return a {@code Stream} of {@link ONTObject}s that wrap {@link E}s */ Stream<ONTObject<? extends E>> sorted(ModelObjectFactory factory); /** * Lists all components of this axiom. * * @param factory {@link ModelObjectFactory}, not {@code null} * @return a {@code Stream} of {@link ONTObject}s that wrap {@link E}s */ Stream<ONTObject<? extends E>> members(ModelObjectFactory factory); /** * Lists all components and annotations of this axiom. * * @param factory {@link ModelObjectFactory}, not {@code null} * @return a {@code Stream} of {@link ONTObject}s that wrap either {@link E}s or {@link OWLAnnotation}s */ Stream<ONTObject<? extends OWLObject>> objects(ModelObjectFactory factory); /** * Gets all components (as {@link ONTObject}s) in the form of sorted {@code Set}. * * @param statement {@link OntStatement}, the source, not {@code null} * @param factory {@link ModelObjectFactory}, not {@code null} * @return a {@code Set} of {@link ONTObject} with type {@link E} */ default Set<ONTObject<? extends E>> fetchONTComponents(OntStatement statement, ModelObjectFactory factory) { return Iterators.addAll(listONTComponents(statement, factory), ONTObjectImpl.createContentSet()); } /** * Sorts and lists all components of this axiom. * * @return a sorted {@code Stream} of {@link ONTObject}s that wrap {@link E}s */ default Stream<ONTObject<? extends E>> sorted() { return sorted(getObjectFactory()); } /** * Lists all characteristic (i.e. without annotations) components of this axiom. * * @return an unsorted {@code Stream} of {@link ONTObject}s that wrap {@link E}s */ default Stream<ONTObject<? extends E>> members() { return members(getObjectFactory()); } @Override default Stream<ONTObject<? extends OWLObject>> objects() { return objects(getObjectFactory()); } /** * Gets all components as a sorted {@code Set} with exclusion of the specified. * * @param excludes an {@code Array} of {@link E}s, not {@code null} * @return a {@link Set} of {@link E}s */ @SuppressWarnings("unchecked") default Set<E> getSetMinus(E... excludes) { return sorted().map(ONTObject::getOWLObject) .filter(negationPredicate(excludes)) .collect(Collectors.toCollection(LinkedHashSet::new)); } /** * Creates a {@code Predicate} that allows everything with exclusion of specified elements. * * @param excludes an {@code Array} of {@link X}-elements to exclude, not {@code null} * @param <X> - anything * @return a {@link Predicate} for {@link X} */ @SafeVarargs static <X> Predicate<X> negationPredicate(X... excludes) { if (excludes.length == 0) { return x -> true; } Set<X> set = new HashSet<>(Arrays.asList(excludes)); return x -> !set.contains(x); } /** * Creates an {@link ONTObject} container for the given {@link OntStatement}; * the returned object is also {@link R}. * Impl notes: * If there is no sub-annotations, * and the subject and object are URI-{@link org.apache.jena.rdf.model.Resource}s, which correspond operands, * then a simplified instance of {@link Simple} is returned, for this the factory {@code simple} is used. * Otherwise, the instance is {@link Complex}, it is created by the factory {@code complex} and has a cache inside. * Note: this is an auxiliary method as shortcut to reduce copy-pasting, it is for internal usage only. * * @param <R> the desired {@link OWLAxiom axiom}-type * @param statement {@link OntStatement}, the source to parse, not {@code null} * @param simple factory (as {@link BiFunction}) to provide {@link Simple} instance, not {@code null} * @param complex factory (as {@link BiFunction}) to provide {@link Complex} instance, not {@code null} * @param setHash {@code ObjIntConsumer<OWLAxiom>}, facility to assign {@code hashCode}, not {@code null} * @param factory {@link ModelObjectFactory} (singleton), not {@code null} * @param config {@link AxiomsSettings} (singleton), not {@code null} * @return {@link R} */ static <R extends ONTObject & WithManyObjects> R create(OntStatement statement, BiFunction<Triple, Supplier<OntModel>, ? extends R> simple, BiFunction<Triple, Supplier<OntModel>, ? extends R> complex, ObjIntConsumer<OWLAxiom> setHash, ModelObjectFactory factory, AxiomsSettings config) { R c = complex.apply(statement.asTriple(), factory.model()); Object[] content = Complex.initContent((Complex) c, statement, setHash, true, factory, config); if (content != null) { ((WithContent<?>) c).putContent(content); return c; } R s = simple.apply(statement.asTriple(), factory.model()); setHash.accept(s, c.hashCode()); return s; } /** * Creates an {@link ONTObject} container for the given {@link OntStatement}; * the returned object is also {@link R}. * This method is intended to produce {@code n-ary} axioms * that are mapped from {@link com.github.owlcs.ontapi.jena.model.OntDisjoint} list-based anonymous resources. * * @param <R> the desired {@link OWLAxiom axiom}-type * @param statement {@link OntStatement}, the source to parse, not {@code null} * @param maker factory (as {@link BiFunction}) to provide {@link Complex} instance, not {@code null} * @param setHash {@code ObjIntConsumer<OWLAxiom>}, facility to assign {@code hashCode}, not {@code null} * @param factory {@link ModelObjectFactory} (singleton), not {@code null} * @param config {@link AxiomsSettings} (singleton), not {@code null} * @return {@link R} */ static <R extends ONTObject & Complex> R create(OntStatement statement, BiFunction<Triple, Supplier<OntModel>, ? extends R> maker, ObjIntConsumer<OWLAxiom> setHash, ModelObjectFactory factory, AxiomsSettings config) { R res = maker.apply(statement.asTriple(), factory.model()); res.putContent(Complex.initContent(res, statement, setHash, false, factory, config)); return res; } /** * Represents the simplest case of unannotated axiom with arity {@code 2}, * that corresponds a single triple consisting of URI nodes. * * @param <E> - any subtype of {@link OWLObject} (the type of axiom components) */ interface Simple<E extends OWLObject> extends WithManyObjects<E>, WithoutAnnotations { @Override default boolean isAnnotated() { return false; } @SuppressWarnings({"unchecked", "RedundantCast"}) @Override default Stream<ONTObject<? extends E>> members(ModelObjectFactory factory) { return (Stream<ONTObject<? extends E>>) ((Stream) objects(getObjectFactory())); } default Stream<ONTObject<? extends OWLObject>> objects(ModelObjectFactory factory) { return Stream.of(findByURI(getSubjectURI(), factory), findByURI(getObjectURI(), factory)); } @Override default Stream<ONTObject<? extends E>> sorted(ModelObjectFactory factory) { Set<ONTObject<? extends E>> res = ONTObjectImpl.createContentSet(); res.add(findByURI(getSubjectURI(), factory)); res.add(findByURI(getObjectURI(), factory)); return res.stream(); } @Override default Set<? extends OWLObject> getOWLComponentsAsSet(ModelObjectFactory factory) { Set<OWLObject> res = OWLObjectImpl.createSortedSet(); res.add(findByURI(getSubjectURI(), factory).getOWLObject()); res.add(findByURI(getObjectURI(), factory).getOWLObject()); return res; } } /** * Represents the axiom which cannot be present in simplified form (i.e. as {@link Simple}). * It has annotations or b-nodes as components, or does not correspond a single triple. * * @param <A> - any subtype of {@link OWLAxiom} which is implemented by the instance of this interface * @param <E> - any subtype of {@link OWLObject} (the type of axiom components) */ interface Complex<A extends OWLAxiom, E extends OWLObject> extends WithManyObjects<E>, WithList<A, E> { /** * Calculates the content and {@code hashCode} simultaneously. * Such a way was chosen for performance’s sake. * * @param axiom - a {@link WithTwoObjects} instance, the axiom, not {@code null} * @param statement - a {@link OntStatement}, the source statement, not {@code null} * @param setHash - a {@code ObjIntConsumer<OWLAxiom>}, facility to assign {@code hashCode}, not {@code null} * @param simplify - boolean, if {@code true}, and the given statement is simple * (no annotations, uri subject and object), an {@code null} array is returned * @param factory - a {@link ModelObjectFactory} singleton, not {@code null} * @param config - a {@link AxiomsSettings} singleton, not {@code null} * @return an {@code Array} with content or {@code null} if no content is needed */ @SuppressWarnings("unchecked") static Object[] initContent(Complex axiom, OntStatement statement, ObjIntConsumer<OWLAxiom> setHash, boolean simplify, ModelObjectFactory factory, AxiomsSettings config) { Collection annotations = ONTAxiomImpl.collectAnnotations(statement, factory, config); Set<ONTObject> components = axiom.fetchONTComponents(statement, factory); Object[] res = new Object[components.size() + annotations.size()]; int index = 0; int h = 1; for (ONTObject c : components) { res[index++] = axiom.toContentItem(c); h = WithContent.hashIteration(h, c.hashCode()); } int hash = OWLObject.hashIteration(axiom.hashIndex(), h); h = 1; for (Object a : annotations) { res[index++] = a; h = WithContent.hashIteration(h, a.hashCode()); } setHash.accept(axiom, OWLObject.hashIteration(hash, h)); if (simplify && annotations.isEmpty()) { if (res.length == 1 && res[0] instanceof String) { // symmetric triple 's p s' return null; } if (res.length == 2 && res[0] instanceof String && res[1] instanceof String) { // 's p o' return null; } } return res; } @Override default Object[] collectContent() { OntStatement statement = asStatement(); ModelObjectFactory factory = getObjectFactory(); List<Object> res = new ArrayList<>(2); fetchONTComponents(statement, factory).forEach(c -> res.add(toContentItem(c))); res.addAll(ONTAxiomImpl.collectAnnotations(statement, factory, getConfig())); return res.toArray(); } @Override default ONTObject fromContentItem(Object x, ModelObjectFactory factory) { return x instanceof String ? findByURI((String) x, factory) : (ONTObject) x; } @SuppressWarnings("unchecked") @Override default Stream<ONTObject<? extends OWLObject>> objects(ModelObjectFactory factory) { Stream res = Arrays.stream(getContent()); return (Stream<ONTObject<? extends OWLObject>>) res.map(x -> fromContentItem(x, factory)); } @Override default Stream<ONTObject<? extends E>> members(ModelObjectFactory factory) { return sorted(factory); } @SuppressWarnings("unchecked") @Override default Stream<ONTObject<? extends E>> sorted(ModelObjectFactory factory) { Stream res = Arrays.stream(getContent()) .map(x -> fromContentItem(x, factory)) .filter(x -> WithList.toOWLAnnotation(x) == null); return (Stream<ONTObject<? extends E>>) res; } @Override default Set<? extends OWLObject> getOWLComponentsAsSet(ModelObjectFactory factory) { Set<OWLObject> res = OWLObjectImpl.createSortedSet(); Arrays.stream(getContent()) .map(x -> fromContentItem(x, factory)) .filter(x -> WithList.toOWLAnnotation(x) == null) .forEach(x -> res.add(x.getOWLObject())); return res; } } }
<p>اینم یه تجربه پراکنده دیگه!</p> <p>خب الان که من فرصت نوشتن بیشتر دارم تصمیم گرفتم یکم در مورد <a href="https://www.gerritcodereview.com/">gerrit</a> بنویسم. توی هر شرکتی معمولا یه چیزی به اسم «چرخه حیات توسعه نرم افزار» وجود داره که آدم‌ها ازش بصورت آگاهانه یا به وسیله اونچیزی که فرهنگ اون تیم یا گروه دیکته میکنه ازش استفاده می‌کنند. که اگه عمری بود بیشتر در موردش می‌نویسم. چرخه حیات کارهایی که ما در شرکت انجام می‌دیم به این شکله که:</p> <ul> <li>کارهای موجود بصورت فردی از لیست کارها انتخاب میشه و انجام میشه</li> <li>پس از نهایی شدن کار کدها برای <a href="https://git-scm.com/docs/git-merge">merge</a> در اختیار بقیه قرار می‌گیرن</li> <li>پس از تایید توسط <a href="https://jenkins-ci.org/">jenkins</a> و حداقل یکی از افراد تیم بسته به تشخیص بررسی کننده کارها <a href="https://git-scm.com/docs/git-merge">merge</a> میشن</li> <li>پس از این مراحل هم که تسترها شروع به بررسی کد می‌کنند.</li> </ul> <h1>معرفی <a href="https://www.gerritcodereview.com/">gerrit</a></h1> <p>حالا پست امروز یه معرفی کوتاه و از ابزاری هست به اسم <a href="https://www.gerritcodereview.com/">gerrit</a> که ما از اون برای <a href="https://git-scm.com/docs/git-merge">merge</a> استفاده می‌کنیم.</p> <p>روند هم اینه که با امکاناتی که <a href="https://www.gerritcodereview.com/">gerrit</a> در اختیار ما قرار میده، بعد از ارسال کد یک مرج محلی اتفاق میفته و کد توسط ci که همون <a href="https://jenkins-ci.org/">jenkins</a> باشه کنترل و کامپایل میشه. اگه این مرحله درست بود <a href="https://jenkins-ci.org/">jenkins</a> به <a href="https://www.gerritcodereview.com/">gerrit</a> میگه که اگه کسی <a href="https://en.wikipedia.org/wiki/Code_review">review</a> کرده میتونه تغییرات رو <a href="https://git-scm.com/docs/git-merge">merge</a> کنه و گرنه تا عدم موفقیت <a href="https://jenkins-ci.org/">jenkins</a> کسی نمی‌تونه کد رو اشتباهی <a href="https://git-scm.com/docs/git-merge">merge</a> کنه. این تضمین میکنه که دیگه کسی چیز اساسی رو خراب نمی‌کنه. پس از تایید <a href="https://jenkins-ci.org/">jenkins</a> هم افراد میتونن کد رو بررسی و تغییرات رو <a href="https://git-scm.com/docs/git-merge">merge</a> کنن. همچنین <a href="https://www.gerritcodereview.com/">gerrit</a> پلاگین‌هایی داره که کمک میکنه تا ما اون رو به جاهای مختلف مثل <a href="https://www.atlassian.com/software/jira">jira</a> وصل کنیم و از اینکه یه کار آماده‌است و یا یه کار <a href="https://git-scm.com/docs/git-merge">merge</a> شده با خبر بشیم و حتی وضعیت موارد رو تغییر بدیم.</p> <p>بعد از بررسی روند کا نوبت به پیش فرضهای هست که توی <a href="https://www.gerritcodereview.com/">gerrit</a> وجود داره.</p> <ol> <li>اینکه مدیریت منبع <a href="https://en.wikipedia.org/wiki/Git">git</a> در کنترل <a href="https://www.gerritcodereview.com/">gerrit</a> هست و ازش به عنوان یک <a href="https://en.wikipedia.org/wiki/Git#Git_server">git server</a> استفاده می‌شه. یعنی اگه سرور دیگه‌ای مثل <a href="https://github.com/">github</a> هم وجود داره کپی <a href="https://www.gerritcodereview.com/">gerrit</a> هست نه بالعکس</li> <li>اینکه تغییرات هرچقدر هم که زیاد و مداوم باشن در نهایت در قالب یک <a href="https://git-scm.com/docs/git-commit">commit</a> ارسال میشن. ممکنه بگید که خب اگه من خواستم وسط کارم <a href="https://git-scm.com/docs/git-push">push</a> کنم چی؟ جواب اینه که هر کامیت یک تغییر هست و تغییر میتونه draft باشه که یعنی هنوز کامل نشده</li> <li>اینکه <a href="https://www.gerritcodereview.com/">gerrit</a> تلاش میکنه که تاریخچه کد خطی بمونه و این در مجموع خوبه. برای خطی نگه داشتن تاریخچه به شدت از <a href="https://git-scm.com/docs/git-rebase">rebase</a> استفاده می‌کنه</li> </ol> <p>حالا اگه بخوام بصورت خلاصه مزایا و معایب رو بگم هم اینا به ذهنم میرسه</p> <h1>مزایا و معایب <a href="https://www.gerritcodereview.com/">gerrit</a></h1> <p>مزایا:</p> <ol> <li>تاریخچه خطی</li> <li>ثبات در عملکرد</li> <li>وجود ابزار <a href="https://github.com/openstack-infra/git-review">git review</a> برای ارسال به <a href="https://www.gerritcodereview.com/">gerrit</a> و راحت کردن استفاده از <a href="https://www.gerritcodereview.com/">gerrit</a></li> <li>شفافیت روند کاری بررسی کرد</li> <li>راحتی <a href="https://en.wikipedia.org/wiki/System_integration">integrate</a> شدن با ابزارهای دیگه مثل <a href="https://www.atlassian.com/software/jira">jira</a> و <a href="https://jenkins-ci.org/">jenkins</a> و <a href="https://about.gitlab.com/">gitlab</a></li> </ol> <p>معایب:</p> <ol> <li>مستندات گنگ. خیلی پیدا کردن چیزهای ساده توی <a href="https://www.gerritcodereview.com/">gerrit</a> آسون نیست</li> <li>زمان زیادی برای یادگیری استفاده از <a href="https://www.gerritcodereview.com/">gerrit</a> مورد نیاز هست</li> </ol> <p>در آخر بگم که بگم که روند کاری که هریک از این ابزارها پیشنهاد میدن یک روند دیکته شده است و ممکن به مذاق شما خوش نیاد پس از هر روشی که به مذاقتون خوش میاد استفاده کنید. ما هم یه مدت از <a href="https://www.gerritcodereview.com/">gerrit</a> استفاده کردیم بعدش از <a href="https://about.gitlab.com/">gitlab</a> و دوباره برگشتیم <a href="https://www.gerritcodereview.com/">gerrit</a> چون به نظرمون <a href="https://www.gerritcodereview.com/">gerrit</a> بهتر بود</p> <p>همین!</p>
import { Button, Modal, ModalHeader, ModalBody, Form, FormGroup, Label, Input, } from "reactstrap"; import { v4 as uuidv4 } from "uuid"; import { useContext, useState } from "react"; import { observer } from "mobx-react-lite"; import ItemStore from "../store"; function ItemModel() { const itemStore = useContext(ItemStore); const { addItemDb } = itemStore; const [modal, setModal] = useState(false); const toggle = () => setModal(!modal); const [textInput, setTextInput] = useState(''); const handleChange = (event) => { setTextInput(event.target.value); } return ( <div> <Button color="dark" style={{ marginBottom: "2rem" }} variant="primary" onClick={toggle}> add Item </Button> <Modal toggle={toggle} isOpen={modal}> <ModalHeader toggle={toggle}>Add to Shopping list</ModalHeader> <ModalBody> <Form> <FormGroup> <Label for="item">Item</Label> <Input type="text" name="name" id="item" placeholder="Add shopping item" onChange={handleChange} ></Input> </FormGroup> <Button color="dark" style={{ marginTop: "2rem" }} onClick={(_) => { if (textInput) { addItemDb({ _id: uuidv4(), name: textInput, }) } toggle() }} block> Add Item </Button> </Form> </ModalBody> </Modal> </div> ); } export default observer(ItemModel);
const loginForm = document.querySelector("#login-form"); const loginInput = document.querySelector("#login-form input"); const greeting = document.querySelector("#greeting"); const link = document.querySelector("a"); // 반복되는 string은 대문자로 명시해놓는다. 실수를 줄일 수 있음! const HIDDEN_CLASSNAME = "hidden"; const USERNAME_KEY = "username"; function onLoginSubmit(event) { // 브라우저의 기본 동작을 막아줌(여기서는 새로고침) event.preventDefault(); // 다시 form 숨기기 loginForm.classList.add(HIDDEN_CLASSNAME); // username에 이름 저장해주기 const username = loginInput.value; // localStorage에 저장, 새로고침하면 없어지니까 저장해놓기 localStorage.setItem(USERNAME_KEY, username); // greeting.innerText = 'Hello ' + username; // paintGreetings 호출하기 paintGreetings(username); } loginForm.addEventListener("submit", onLoginSubmit); // 함수이름 뒤에 () 붙이면 바로 실행 >> 자동으로 바로 실행! // addEventListener를 활용할 땐 func의 이름만 지정! 직접실행 X!!! function paintGreetings(username) { greeting.innerText = `Hello ${username}`; greeting.classList.remove(HIDDEN_CLASSNAME); } //localStorage는 브라우저가 가지고 있는 작은 DB같은 API // savedUsername은 null 아니면 채은인 상태 const savedUsername = localStorage.getItem(USERNAME_KEY); // localStorage에 없는 값을 받아오면 'null'값이 뜸 if (savedUsername === null) { // show the form loginForm.classList.remove(HIDDEN_CLASSNAME); loginForm.addEventListener("submit", onLoginSubmit); } else { // show the greetings paintGreetings(savedUsername); }
import Block from './block'; import Collider from './collider'; import Game from './game'; import Input from './input'; import Item, { ItemType, ItemTypeEnum } from './item'; import UI from './ui'; import { distance, lerp } from './utils'; export type Inventory = { [key in ItemTypeEnum]?: number }; export default class Player { public name = 'Player'; public health = 0; public maxHealth = 100; private width = 16; private height = 32; public x; public y; get right(): number { return this.x + this.width; } get bottom(): number { return this.y + this.height; } get midX(): number { return this.x + this.width / 2; } get midY(): number { return this.y + this.height / 2; } public forceX = 0; public forceY = 0; private forceDrag = 0.9; private collider: Collider; private inventory: Inventory = {}; private inventoryOpen = false; public selectedItem: ItemTypeEnum | false = false; constructor(spawnX: number, spawnY: number) { this.x = spawnX; this.y = spawnY; this.collider = new Collider(this.x, this.y, this.width, this.height); this.init(); } public addToInventory(item: ItemTypeEnum, count: number) { if (!this.inventory[item]) { this.inventory[item] = count; UI.instance.updateInventory(this.inventory, this); return; } this.inventory[item]! += count; UI.instance.updateInventory(this.inventory, this); } public removeFromInventory(item: ItemTypeEnum, count: number) { if (!this.inventory[item]) { UI.instance.updateInventory(this.inventory, this); return false; } this.inventory[item]! -= count; if (this.inventory[item]! <= 0) delete this.inventory[item]; UI.instance.updateInventory(this.inventory, this); return true; } private openInventory(): void { this.inventoryOpen = true; UI.instance.openInventory(); } private closeInventory(): void { this.inventoryOpen = false; UI.instance.closeInventory(); } private toggleInventory(): void { this.inventoryOpen = !this.inventoryOpen; UI.instance.toggleInventory(); } public selectItem(item: ItemTypeEnum | false): void { this.selectedItem = item; UI.instance.selectItem(item); } private init(): void { this.health = this.maxHealth; Input.onKeyDown.push([' ', () => this.jump()]); Input.onMouseMove.push(this.onMouseMove.bind(this)); Input.onMouseDown.push([0, this.onClick.bind(this)]); Input.onMouseDown.push([2, this.onRightClick.bind(this)]); Input.onKeyDown.push(['e', () => this.toggleInventory()]); } private onMouseMove(x: number, y: number): void { const worldPoint = Game.instance.getWorldPointAtScreenPoint(x, y); const block = Game.instance.getBlockAtScreenPoint(x, y); if ( block && block.type !== ItemType.B_Empty && distance( worldPoint[0], worldPoint[1], this.x + this.width / 2, this.y + this.height / 2 ) < 56 ) { Input.cursorElement.classList.add('can-mine'); } else { Input.cursorElement.classList.remove('can-mine'); } } private onClick(x: number, y: number): void { const worldPoint = Game.instance.getWorldPointAtScreenPoint(x, y); const block = Game.instance.getBlockAtScreenPoint(x, y); if ( block && distance( worldPoint[0], worldPoint[1], this.x + this.width / 2, this.y + this.height / 2 ) < 56 ) { if (block.type === ItemType.B_Empty) return; Game.instance.addItem( new Item( block.type, block.x + block.collider.width / 2 + Math.random() * 2 - 1, block.y + block.collider.height / 2 ) ); block.setType(ItemType.B_Empty); } } private onRightClick(x: number, y: number): void { if (!this.selectedItem) return; const worldPoint = Game.instance.getWorldPointAtScreenPoint(x, y); const block = Game.instance.getBlockAtScreenPoint(x, y); if ( block && distance( worldPoint[0], worldPoint[1], this.x + this.width / 2, this.y + this.height / 2 ) < 56 ) { if (block.type !== ItemType.B_Empty) return; if (this.inventory[this.selectedItem] === undefined) return; const blockUp = Game.instance.getBlock(block.gridX, block.gridY - 1); const blockDown = Game.instance.getBlock(block.gridX, block.gridY + 1); const blockLeft = Game.instance.getBlock(block.gridX - 1, block.gridY); const blockRight = Game.instance.getBlock(block.gridX + 1, block.gridY); if ( blockUp === undefined || blockDown === undefined || blockLeft === undefined || blockRight === undefined ) return; // if all blocks around are empty then return if ( blockUp.type === ItemType.B_Empty && blockDown.type === ItemType.B_Empty && blockLeft.type === ItemType.B_Empty && blockRight.type === ItemType.B_Empty ) return; if (!this.removeFromInventory(this.selectedItem, 1)) return; block.setType(this.selectedItem); } } public render(ctx: CanvasRenderingContext2D): void { ctx.fillStyle = 'black'; ctx.fillRect( Game.instance.camera.getRenderX(this.x), Game.instance.camera.getRenderY(this.y), Game.instance.camera.getRenderWidth(this.width), Game.instance.camera.getRenderHeight(this.height) ); } public toString(): string { return `${this.name} (${this.health}/${this.maxHealth}) at (${this.x}, ${this.y})`; } public update(deltaTime: number): void { this.move(); // Horizontal movement const xChange = this.forceX * deltaTime; this.collider.x += xChange; const blocksLeft = Game.instance.getBlocksInArea( Math.round(this.collider.x) - 1, this.y, 2, this.height ); const blocksRight = Game.instance.getBlocksInArea( Math.round(this.collider.x) + this.width - 1, this.y, 2, this.height ); // if any horizontal blocks are colliding with player, revert movement if ( blocksLeft.some( (block) => block.type !== ItemType.B_Empty && block.collider.isCollidingWith(this.collider) ) ) { this.collider.x -= xChange; this.collider.x = Math.round(this.collider.x / Block.size) * Block.size; this.forceX = 0; // reset forceX when hitting wall } else if ( blocksRight.some( (block) => block.type !== ItemType.B_Empty && block.collider.isCollidingWith(this.collider) ) ) { this.collider.x -= xChange; this.collider.x = Math.round(this.collider.x / Block.size) * Block.size; this.forceX = 0; // reset forceX when hitting wall } // Vertical movement const yChange = this.forceY * deltaTime; this.collider.y += yChange; const blocksAbove = Game.instance.getBlocksInArea( this.x, Math.round(this.collider.y) - 1, this.width, 2 ); const blocksBelow = Game.instance.getBlocksInArea( this.x, Math.round(this.collider.y) + this.height - 1, this.width, 2 ); // if any vertical blocks are colliding with player, revert movement if ( blocksBelow.some( (block) => block.type !== ItemType.B_Empty && block.collider.isCollidingWith(this.collider) ) ) { this.collider.y -= yChange; // snap to block? (round to nearest block) // bad performance ? not sure // seems to work great though (no jittering) this.collider.y = Math.round(this.collider.y / Block.size) * Block.size; this.forceY = 0; // reset forceY when hitting ground } else if ( blocksAbove.some( (block) => block.type !== ItemType.B_Empty && block.collider.isCollidingWith(this.collider) ) ) { this.collider.y -= yChange; this.collider.y = Math.round(this.collider.y / Block.size) * Block.size; this.forceY = 0; // reset forceY when hitting ceiling // gravity this.forceY = lerp(this.forceY, 60, deltaTime * 2); } else { // gravity this.forceY = lerp(this.forceY, 60, deltaTime * 2); } // set player position after all collider calculations this.x = this.collider.x; this.y = this.collider.y; // Slow down horizontal movement this.forceX *= this.forceDrag; // Move camera to center of player Game.instance.camera.setX( this.x + this.width / 2 - Game.instance.canvas.width / Game.instance.camera.zoom / 2 ); Game.instance.camera.setY( this.y - Game.instance.canvas.height / Game.instance.camera.zoom / 2 ); } public move(): void { if (Input.keys['d']) { this.forceX = Math.min(this.forceX + 10, 50); } else if (Input.keys['a']) { this.forceX = Math.max(this.forceX - 10, -50); } } public jump(): void { this.forceY = -150; } public attack(): void {} }
import React, {useEffect} from 'react'; import { styled } from '@mui/material/styles'; import Button from '@mui/material/Button'; import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; import DialogTitle from '@mui/material/DialogTitle'; import List from '@mui/material/List'; import ListItem from '@mui/material/ListItem'; import ListItemIcon from '@mui/material/ListItemIcon'; import ListItemText from '@mui/material/ListItemText'; import Checkbox from '@mui/material/Checkbox'; import { CardContent } from '@mui/material'; import CardHeader from '@mui/material/CardHeader'; import Divider from '@mui/material/Divider'; const PREFIX = 'MythicTransferList'; export const classes = { button: `${PREFIX}-button`, divider: `${PREFIX}-divider` }; export const StyledDivider = styled(Divider)(( { theme } ) => ({ [`&.${classes.divider}`]: { backgroundColor: "rgb(100, 170, 204)", border: "2px solid rgba(100, 170, 204)" } })); export const StyledButton = styled(Button)(( { theme } ) => ({ [`&.${classes.button}`]: { margin: theme.spacing(0.5, 0), }, })); export function MythicTransferListDialog(props) { const [checked, setChecked] = React.useState([]); const [left, setLeft] = React.useState([]); const [right, setRight] = React.useState([]); const [leftTitle, setLeftTitle] = React.useState(""); const [rightTitle, setRightTitle] = React.useState(""); const leftChecked = intersection(checked, left); const rightChecked = intersection(checked, right); function not(a, b) { if(props.itemKey){ return a.filter( (value) => b.find( (element) => element[props.itemKey] === value[props.itemKey] ) === undefined) } return a.filter((value) => b.indexOf(value) === -1); } function intersection(a, b) { if(props.itemKey){ return a.filter( (value) => b.find( (element) => element[props.itemKey] === value[props.itemKey] ) !== undefined) } return a.filter((value) => b.indexOf(value) !== -1); } const handleToggle = (value) => () => { let currentIndex = -1; if(props.itemKey){ currentIndex = checked.findIndex( (element) => element[props.itemKey] === value[props.itemKey]); }else{ currentIndex = checked.indexOf(value); } const newChecked = [...checked]; if (currentIndex === -1) { newChecked.push(value); } else { newChecked.splice(currentIndex, 1); } setChecked(newChecked); }; const handleAllRight = () => { setRight(right.concat(left)); setLeft([]); }; const handleCheckedRight = () => { setRight(right.concat(leftChecked)); setLeft(not(left, leftChecked)); setChecked(not(checked, leftChecked)); }; const handleCheckedLeft = () => { setLeft(left.concat(rightChecked)); setRight(not(right, rightChecked)); setChecked(not(checked, rightChecked)); }; const handleAllLeft = () => { setLeft(left.concat(right)); setRight([]); }; useEffect( () => { const left = props.left.reduce( (prev, cur) => { if(props.itemKey === undefined){ if(props.right.includes(cur)){ return [...prev]; } return [...prev, cur]; }else{ if(props.right.find( element => element[props.itemKey] === cur[props.itemKey])){ return [...prev] } return [...prev, cur]; } }, []) setLeft(left); setRight(props.right); setLeftTitle(props.leftTitle); setRightTitle(props.rightTitle); }, [props.left, props.right, props.leftTitle, props.rightTitle, props.itemKey]); const customList = (title, items) => ( <> <CardHeader title={title} /> <StyledDivider classes={{root: classes.divider}}/> <CardContent style={{flexGrow: 1, height: "100%", width: "100%", overflowY: "auto", padding: 0}}> <List dense component="div" role="list" style={{padding:0}}> {items.map((valueObj) => { const value = props.itemKey === undefined ? valueObj : valueObj[props.itemKey]; const labelId = `transfer-list-item-${value}-label`; return ( <ListItem style={{padding:0}} key={value} role="listitem" button onClick={handleToggle(valueObj)}> <ListItemIcon> <Checkbox checked={props.itemKey === undefined ? checked.indexOf(value) !== -1 : checked.findIndex( (element) => element[props.itemKey] === value) !== -1} tabIndex={-1} disableRipple inputProps={{ 'aria-labelledby': labelId }} /> </ListItemIcon> <ListItemText id={labelId} primary={value} /> </ListItem> ); })} <ListItem /> </List> </CardContent> </> ); const setFinalTags = () => { props.onSubmit({left, right}); props.onClose(); } return ( <> <DialogTitle id="form-dialog-title">{props.dialogTitle}</DialogTitle> <DialogContent dividers={true}> <div style={{display: "flex", flexDirection: "row", overflowY: "auto", flexGrow: 1, minHeight: 0}}> <div style={{paddingLeft: 0, flexGrow: 1, marginLeft: 0, marginRight: "10px", position: "relative", overflowY: "auto", display: "flex", flexDirection: "column" }}> {customList(leftTitle, left)} </div> <div style={{display: "flex", flexDirection: "column", justifyContent: "center"}}> <StyledButton variant="contained" size="small" className={classes.button} onClick={handleAllRight} disabled={left.length === 0} aria-label="move all right" > &gt;&gt; </StyledButton> <StyledButton variant="contained" size="small" className={classes.button} onClick={handleCheckedRight} disabled={leftChecked.length === 0} aria-label="move selected right" > &gt; </StyledButton> <StyledButton variant="contained" size="small" className={classes.button} onClick={handleCheckedLeft} disabled={rightChecked.length === 0} aria-label="move selected left" > &lt; </StyledButton> <StyledButton variant="contained" size="small" className={classes.button} onClick={handleAllLeft} disabled={right.length === 0} aria-label="move all left" > &lt;&lt; </StyledButton> </div> <div style={{marginLeft: "10px", position: "relative", flexGrow: 1, display: "flex", overflowY: "auto", flexDirection: "column" }}> {customList(rightTitle, right)} </div> </div> </DialogContent> <DialogActions> <Button onClick={props.onClose} variant="contained" color="primary"> Close </Button> <Button onClick={setFinalTags} variant="contained" color="success"> Submit </Button> </DialogActions> </> ); }
using BDMS.Models; using CsvHelper; using CsvHelper.Configuration.Attributes; using NetTopologySuite.Utilities; namespace BDMS.BoreholeGeometry; /// <summary> /// Accepts a CSV file where every data point has a Pitch, Roll and Yaw angle. /// </summary> internal sealed class PitchRollFormat : IBoreholeGeometryFormat { public string Key => "PitchRoll"; public string Name => "Pitch Roll"; private Lazy<string> expectedCsvHeader = new(Helper.GetCSVHeader<Geometry>); public string CsvHeader => expectedCsvHeader.Value; public IList<BoreholeGeometryElement> ReadCsv(IFormFile file, int boreholeId) { using var reader = new StreamReader(file.OpenReadStream()); using var csv = new CsvReader(reader, Helper.CsvConfig); var data = csv.GetRecords<Geometry>().ToList(); // Convert degrees to radians foreach (var entry in data) { entry.PitchRad = Degrees.ToRadians(entry.PitchRad); entry.RollRad = Degrees.ToRadians(entry.RollRad); entry.YawRad = Degrees.ToRadians(entry.YawRad); } return XYZFormat.ToBoreholeGeometry(AzIncFormat.ConvertToXYZ(ConvertToAzInc(data)), boreholeId); } /// <summary> /// Convert the <see cref="Geometry"/> data to <see cref="AzIncFormat.Geometry"/> data by /// calculating the Azimuth and Inclination of a the vector tangential to the borehole. /// </summary> /// <param name="data">The <see cref="Geometry"/> data.</param> public static IList<AzIncFormat.Geometry> ConvertToAzInc(IEnumerable<Geometry> data) { return data.Select(d => { var result = new AzIncFormat.Geometry() { MeasuredDepth = d.MeasuredDepth }; var alpha = d.YawRad; // Rotation around z axis (down) var beta = d.PitchRad; // Rotation around y axis (north) var gamma = d.RollRad; // Rotation around x axis (east) // Unit vector tangential to the borehole path var x = (Math.Cos(alpha) * Math.Sin(beta) * Math.Cos(gamma)) + (Math.Sin(alpha) * Math.Sin(gamma)); var y = (Math.Sin(alpha) * Math.Sin(beta) * Math.Cos(gamma)) - (Math.Cos(alpha) * Math.Sin(gamma)); var z = Math.Cos(beta) * Math.Cos(gamma); result.AzimuthRad = Math.Atan2(y, x); result.InclinationRad = Math.Acos(z); result.Azimuth = Radians.ToDegrees(result.AzimuthRad); result.Inclination = Radians.ToDegrees(result.InclinationRad); return result; }).ToList(); } internal sealed class Geometry { [Name("MD_m")] public double MeasuredDepth { get; set; } [Name("Roll_deg")] public double RollRad { get; set; } [Name("Pitch_deg")] public double PitchRad { get; set; } [Name("Yaw_deg")] public double YawRad { get; set; } } }
import express, { NextFunction } from 'express'; import bodyParser from 'body-parser'; import {Application, Request, Response} from 'express'; import { userRouter } from './routers/userRouter'; import { reimbursementRouter } from './routers/reimbursementRouter'; import { loggingMiddleware } from './middleware/loggingMiddleware'; import { sessionMiddleware } from './middleware/sessionMiddleware'; import { connectionPool } from './repository'; import { PoolClient, QueryResult } from 'pg'; import { getUserByUsernamePassword } from './repository/userDataAccess'; import { authRoleFactory } from './middleware/authMiddleware'; import { corsFilter } from './middleware/corsFilter'; const app: Application = express(); // // Check if webhook works by pushing new endpoint: app.get('/new-endpoint', (req: Request, res: Response) => { res.send('Webhooks worked!'); }) app.use(corsFilter); app.use(bodyParser.json()); // session middleware for keeping track of session data app.use(sessionMiddleware); // logging middleware to make note of all requests app.use(loggingMiddleware); // login endpoint app.post('/login', async (req: Request, res: Response, next:NextFunction) => { // lets user log in console.log('In login'); console.log(req.body); const {username, password} = req.body; if(!username || !password) { res.status(400).json({ message: "Invalid Credentials" }); } else { try { console.log("I am here"); const user = await getUserByUsernamePassword(username, password); console.log("but not here"); if(req.session){ req.session.user = user; res.json(user) } else { res.sendStatus(400); } } catch(e) { res.status(401).json({message: e.message}); } } }) // require login app.use(authRoleFactory(['employee','finance-manager','admin'])) // endpoints to /users app.use('/users',userRouter); //endpoints to /reimbursements app.use('/reimbursements',reimbursementRouter); app.listen(1313, async ()=> { console.log('Reimbursement Server has started. Testing connection...'); try { let client : PoolClient = await connectionPool.connect(); console.log('Connected'); } catch(e) { console.error(`Failed to connect: ${e.message}`); } });
Building Aseba Requierements & Dependencies ---------------------------- Aseba requires a C++17 compatible compiler. We recommend ``GCC 8``, ``Clang 8`` or ``MSVC 19`` (Visual Studio 2019). Aseba depends on Qt5.12 or greater. You will also need ``cmake`` 3.14 or greater, we recommend you use the latest version available. Getting the source code ----------------------- The `source code of Aseba <https://github.com/mobsya/aseba>`_ is hosted on GitHub. To fetch the source, you must first `install Git <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`_ . Then, to clone aseba, execute: :: git clone --recursive https://github.com/mobsya/aseba.git cd aseba When pulling, it might be necessary to update the submodules with ``git submodule update --init``. Alternatively, git can do that for you if you configure it with ``git config --global submodule.recurse true``. All the commands given in the rest of this document assume the current path is the root folder of the cloned repository. Getting all web base software ---------------------------- - Download `https://github.com/Mobsya/scratch-gui/releases/` latest release and extract it into the main directory with the name ``scratch`` - Download `https://github.com/Mobsya/thymio-blockly-standalone/releases` latest release and extract it into the main directory with the name ``thymio_blockly`` - Download `https://github.com/Mobsya/ci-data/releases/download/data/vpl3-thymio-suite.tar.gz` and extract it into the main directory with the name ``tvpl3-thymio-suite``. Getting Started on Windows with MSVC ------------------------------------ Aseba Builds on Windows Seven SP1 or greater. Download and install the following components: .. csv-table:: :header: "Dep", "Dowload", "Notes" "Visual Studio 2019 (16.2+)", "`Download <https://visualstudio.microsoft.com/downloads/>`_", Install the "Desktop development with C++" workload and the MSVC v142 - VS 2019 C++ x64/x86 Build Tools (v14.25) "Cmake 3.14+", `Website <https://cmake.org/download/>`__, Make sure the version of boost you choose is compatible with the cmake version "Qt 5.12+", `Installer <https://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe>`_, Install the MSVC 2017 binaries as well as the ``Qt WebEngine`` and ``Qt Charts`` components. For ``x86`` you can choose the ``MSVC 2015 32 bits`` binaries instead in the Qt installer components screen. Node & Npm, "`Download <https://nodejs.org/en/download/>`_", ``npm.exe`` must be in the path 7Zip, "`Download <https://www.7-zip.org/download.html>`_" NSIS 2, "`Download <https://nsis.sourceforge.io/Download>`_", For building the installer; ``nsis.exe`` must be in the path; Python, "`Download <https://www.python.org/downloads/windows/>`_", For signing the installer; ``python.exe`` must be in the path; To build Aseba, you first need to generate a Visual Studio Solution. To do so: 1. Launch ``Developer Command Prompt for VS 2019`` Navigate to the directory in which you want to build aseba. It is recommended not to build in the source directory 2. `Clone VCPKG <https://github.com/Mobsya/vcpkg>`_ from the Mobsya repository and install it runing ``.\bootstrap-vcpkg.bat`` and navigate to VCPKG directory 3. Install the required packages ``vcpkg install @<ASEBA_SOURCE_DIRECTORY>\vcpkg-list.txt --triplet x64-windows-static``. Or run ``vcpkg install openssl zlib boost-signals2 boost-program-options boost-filesystem boost-scope-exit boost-asio boost-uuid boost-asio boost-date-time boost-thread boost-beast boost-interprocess --triplet x64-windows-static`` if previous is not working. This might take a while. Replace `x64` by `x86` if you target a 32 buits build. 4. To build for x64: :: cmake -G"Visual Studio 16 2019" -A x64 -T version=14.25 -DBUILD_SHARED_LIBS=OFF "-DCMAKE_PREFIX_PATH=C:\<QT_INSTALLATION_PATH>\<QT_VERTION>\msvc2017_64;" -DCMAKE_TOOLCHAIN_FILE=<VCPKG_INSTALLATION_PATH>/scripts/buildsystems/vcpkg.cmake "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=<ASEBA_SOURCE_DIRECTORY>\windows\cl-toolchain.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows-static" <ASEBA_SOURCE_DIRECTORY> where - ``<QT_INSTALLATION_PATH>`` is the path where Qt is installed. - ``<QT_VERTION>`` is the version of Qt you installed. A folder of that name exists in the Qt installation directory. - ``<ASEBA_SOURCE_DIRECTORY>`` is the directory containing the aseba repository. - ``<VCPKG_INSTALLATION_PATH>`` is the path where Qt is cloned. To build for x86: :: cmake -G"Visual Studio 16 2019" -A Win32 -T version=14.25 -DBUILD_SHARED_LIBS=OFF "-DCMAKE_PREFIX_PATH=C:\<QT_INSTALLATION_PATH>\<QT_VERTION>\msvc2017;" -DCMAKE_TOOLCHAIN_FILE=<VCPKG_INSTALLATION_PATH>/scripts/buildsystems/vcpkg.cmake "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=<ASEBA_SOURCE_DIRECTORY>\windows\cl-toolchain.cmake" "-DVCPKG_TARGET_TRIPLET=x86-windows-static" <ASEBA_SOURCE_DIRECTORY> Then, to build the project, you can either run ``msbuild ThymioSuite.sln`` or open ``ThymioSuite.sln`` with Visual Studio 2019. Refer to the documentation of msbuild and Visual Studio for more informations. Getting Started on OSX ---------------------- You will need OSX 10.11 or greater - Install `Homebrew <https://brew.sh/>`__. - In the cloned repository run :: brew update brew tap homebrew/bundle brew bundle Then you can create a build directory and build Aseba :: mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF .. make Getting Started on Linux ------------------------ Dependencies On Ubuntu & Debian ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ You will need a C++17 able compiler. GCC 8 is known to work. The requireded dependency may vary accros distributions. The following instructions are given for Ubuntu 18.10 cosmic Install the following packages: :: sudo apt-get install mesa-common-dev libgl1-mesa-dev \ clang clang-format g++-multilib gdb \ git \ cmake \ ninja-build \ libavahi-compat-libdnssd-dev \ libudev-dev \ libssl-dev \ libfreetype6 \ libfontconfig \ libnss3 libasound2 libxtst6 libxrender1 libxi6 libxcursor1 libxcomposite1 `Download Qt 5.12 <https://www.qt.io/download-qt-installer>`__ You will need to select the QtWebEngine, QtCharts components. .. image:: qt-linux.png You then need to define an environment variable CMAKE_PREFIX_PATH pointing to the Qt installation folder: :: export CMAKE_PREFIX_PATH=<Qt_Install_Directory/<version>/gcc_64> Docker Image ~~~~~~~~~~~~ We also provide a docker image `Docker Image <https://hub.docker.com/r/mobsya/linux-dev-env>`__ with the dependencies already installed. Building Aseba ~~~~~~~~~~~~~~ :: mkdir build && cd build cmake -DMOBSYA_WEBAPPS_ROOT_DIR=share/ -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF .. make A note about permissions ~~~~~~~~~~~~~~~~~~~~~~~~ If you will be connecting to your robot through a serial port, you might need to add yourself to the group that has permission for that port. In many distributions, this is the "dialout" group and you can add yourself to that group and use the associated permissions by running the following commands: :: sudo usermod -a -G dialout $USER newgrp dialout Getting Started on Android -------------------------- Please refer to the dedicated in `documentation in android-build.md <https://github.com/Mobsya/aseba/blob/master/docs/en/development/android-build.md>`_. VPL 2 - Deprecated ~~~~~~~~~~~~~~~~~~ VPL 2 can be built for Android. Other tools such as studio, playground, and the old VPL are not compatible with Android. To build the Android version you will need: * `The Android tools for your system <https://developer.android.com/studio/index.html#downloads>`_ * `The Android NDK <https://developer.android.com/ndk/downloads/index.html>`_ - tested with version 10 - currently not compatible with newer NDK * Qt 5.10 for Android - which you can install through the Qt installer * CMake 3.7 or greater Building VPL 2 """""""""""""" First, you need to prepare some environment variables :: export ANDROID_SDK=<path_of_the_android_sdk> export ANDROID_NDK=<path_of_the_android_ndk> export CMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}:$HOME/<path_of_qt5_for_android>" Then you can build vpl2 with cmake. An APK will be generated in ``build/bin`` :: mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_NATIVE_API_LEVEL=14 -DANDROID_STL=gnustl_shared -DCMAKE_TOOLCHAIN_FILE=`pwd`/../android/qt-android-cmake/toolchain/android.toolchain.cmake make Getting Started on iOS -------------------------- Require a recent version of Xcode and QT. Building the output require xcode to sign the binary. You'll also need to be able to build part of the project for macOS. installing the brew bundle is also advised. :: brew update brew tap homebrew/bundle brew bundle Generic commands :: mkdir build cd build export QTDIR=<YOUR_BASE_QT_DIR> Building Thymio Suite lanncher. This require to generate the xcode project, and use it via xcodebuild command line. :: cmake -DIOS_ARCH="arm64" -DENABLE_BITCODE=NO -DIOS_DEPLOYMENT_TARGET=11.0 -DCMAKE_TOOLCHAIN_FILE=./ios/ios-cmake/ios.toolchain.cmake -DCMAKE_PREFIX_PATH="${QTDIR}/ios" -G Xcode -DIOS_ARCHIVE_BUILD=1 .. Building and archiving the build :: xcodebuild -scheme thymio-launcher -configuration Release -derivedDataPath ./bin/datas/libraries -sdk iphoneos clean archive -archivePath ./bin/launcher.xcarchive -IPHONEOS_DEPLOYMENT_TARGET=11.0 Generation the IPA :: xcodebuild -exportArchive -archivePath ./bin/launcher.xcarchive -exportOptionsPlist ../ios/exportOptions.plist -exportPath ./bin/storebuild -allowProvisioningUpdates Note that to generate the IPA without error you'll need to have the Provisioning profile and the related certificate installed. Provisioning profile You must have at least one valid provisioning profile installed in `~/Library/MobileDevice/Provisioning Profiles`. The codesign process will look in this folder for a valid one. :: mv <valid_provisioining_profile> ~/Library/MobileDevice/Provisioning\ Profiles Installing the certificate : if `error: exportArchive: No valid Apple Distribution certificate found.` Allows the code sign process to access a certificate and import the new certificate :: security unlock-keychain -p <user_keychain_access_password> security import <Certificate_p12_path> -k ~/Library/Keychains/login.keychain -P <certificate_p12_password> -T /usr/bin/codesign Running tests ~~~~~~~~~~~~~ Once the build is complete, you can run ``ctest`` in the build directory to run the tests. Ninja ~~~~~ The compilation of Aseba can be significantly speedup using ``ninja`` instead of make. Refer to the documentation of ``cmake`` and ``ninja``.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Flot Examples</title> <link href="layout.css" rel="stylesheet" type="text/css"> <!--[if lte IE 8]><script language="javascript" type="text/javascript" src="../excanvas.min.js"></script><![endif]--> <script language="javascript" type="text/javascript" src="../jquery.js"></script> <script language="javascript" type="text/javascript" src="../jquery.flot.js"></script> <script language="javascript" type="text/javascript" src="../jquery.flot.navigate.js"></script> <style type="text/css"> #placeholder .button { position: absolute; cursor: pointer; } #placeholder div.button { font-size: smaller; color: #999; background-color: #eee; padding: 2px; } .message { padding-left: 50px; font-size: smaller; } </style> </head> <body> <h1>Flot Examples</h1> <div id="placeholder" style="width:600px;height:300px;"></div> <p class="message"></p> <p>With the navigate plugin it is easy to add panning and zooming. Drag to pan, double click to zoom (or use the mouse scrollwheel).</p> <p>The plugin fires events (useful for synchronizing several plots) and adds a couple of public methods so you can easily build a little user interface around it, like the little buttons at the top right in the plot.</p> <script type="text/javascript"> $(function () { // generate data set from a parametric function with a fractal // look function sumf(f, t, m) { var res = 0; for (var i = 1; i < m; ++i) res += f(i * i * t) / (i * i); return res; } var d1 = []; for (var t = 0; t <= 2 * Math.PI; t += 0.01) d1.push([sumf(Math.cos, t, 10), sumf(Math.sin, t, 10)]); var data = [ d1 ]; var placeholder = $("#placeholder"); var options = { series: { lines: { show: true }, shadowSize: 0 }, xaxis: { zoomRange: [0.1, 10], panRange: [-10, 10] }, yaxis: { zoomRange: [0.1, 10], panRange: [-10, 10] }, zoom: { interactive: true }, pan: { interactive: true } }; var plot = $.plot(placeholder, data, options); // show pan/zoom messages to illustrate events placeholder.bind('plotpan', function (event, plot) { var axes = plot.getAxes(); $(".message").html("Panning to x: " + axes.xaxis.min.toFixed(2) + " &ndash; " + axes.xaxis.max.toFixed(2) + " and y: " + axes.yaxis.min.toFixed(2) + " &ndash; " + axes.yaxis.max.toFixed(2)); }); placeholder.bind('plotzoom', function (event, plot) { var axes = plot.getAxes(); $(".message").html("Zooming to x: " + axes.xaxis.min.toFixed(2) + " &ndash; " + axes.xaxis.max.toFixed(2) + " and y: " + axes.yaxis.min.toFixed(2) + " &ndash; " + axes.yaxis.max.toFixed(2)); }); // add zoom out button $('<div class="button" style="right:20px;top:20px">zoom out</div>').appendTo(placeholder).click(function (e) { e.preventDefault(); plot.zoomOut(); }); // and add panning buttons // little helper for taking the repetitive work out of placing // panning arrows function addArrow(dir, right, top, offset) { $('<img class="button" src="arrow-' + dir + '.gif" style="right:' + right + 'px;top:' + top + 'px">').appendTo(placeholder).click(function (e) { e.preventDefault(); plot.pan(offset); }); } addArrow('left', 55, 60, { left: -100 }); addArrow('right', 25, 60, { left: 100 }); addArrow('up', 40, 45, { top: -100 }); addArrow('down', 40, 75, { top: 100 }); }); </script> </body> </html>
<?php namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; use App\Models\AdminNotification; use App\Models\Deposit; use App\Models\GeneralSetting; use App\Models\Transaction; use App\Models\WithdrawMethod; use App\Models\Withdrawal; use App\Rules\FileTypeValidate; use Exception; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Str; use Illuminate\Validation\Rules\Password; class UserController extends Controller { public function submitProfile(Request $request) { $validator = Validator::make($request->all(), [ 'firstname' => 'required|string|max:50', 'lastname' => 'required|string|max:50', 'address' => 'sometimes|required|max:80', 'state' => 'sometimes|required|max:80', 'zip' => 'sometimes|required|max:40', 'city' => 'sometimes|required|max:50', 'image' => ['image', new FileTypeValidate(['jpg', 'jpeg', 'png'])] ], [ 'firstname.required' => 'First name field is required', 'lastname.required' => 'Last name field is required' ]); if ($validator->fails()) { return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $validator->errors()->all()], ]); } $user = auth()->user(); $in['firstname'] = $request->firstname; $in['lastname'] = $request->lastname; $in['address'] = [ 'address' => $request->address, 'state' => $request->state, 'zip' => $request->zip, 'country' => @$user->address->country, 'city' => $request->city, ]; if ($request->hasFile('image')) { $location = imagePath()['profile']['user']['path']; $size = imagePath()['profile']['user']['size']; $filename = uploadImage($request->image, $location, $size, $user->image); $in['image'] = $filename; } $user->fill($in)->save(); $notify[] = ['success', 'Profile updated successfully.']; return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['success' => $notify], ]); } public function submitPassword(Request $request) { $password_validation = Password::min(6); $general = GeneralSetting::first(); if ($general->secure_password) { $password_validation = $password_validation->mixedCase()->numbers()->symbols()->uncompromised(); } $validator = Validator::make($request->all(), [ 'current_password' => 'required', 'password' => ['required', 'confirmed', $password_validation] ]); if ($validator->fails()) { return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $validator->errors()->all()], ]); } $user = auth()->user(); if (Hash::check($request->current_password, $user->password)) { $password = Hash::make($request->password); $user->password = $password; $user->save(); $notify[] = 'Password changes successfully'; } else { $notify[] = 'The password doesn\'t match!'; } return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $notify], ]); } public function withdrawMethods() { $withdrawMethod = WithdrawMethod::where('status', 1)->get(); $notify[] = 'Withdraw methods'; return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['success' => $notify], 'data' => [ 'methods' => $withdrawMethod, 'image_path' => imagePath()['withdraw']['method']['path'] ], ]); } public function withdrawStore(Request $request) { $validator = Validator::make($request->all(), [ 'method_code' => 'required', 'amount' => 'required|numeric' ]); if ($validator->fails()) { return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $validator->errors()->all()], ]); } $method = WithdrawMethod::where('id', $request->method_code)->where('status', 1)->first(); if (!$method) { $notify[] = 'Method not found.'; return response()->json([ 'code' => 404, 'status' => 'error', 'message' => ['error' => $notify], ]); } $user = auth()->user(); if ($request->amount < $method->min_limit) { $notify[] = 'Your requested amount is smaller than minimum amount.'; return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $notify], ]); } if ($request->amount > $method->max_limit) { $notify[] = 'Your requested amount is larger than maximum amount.'; return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $notify], ]); } if ($request->amount > $user->balance) { $notify[] = 'You do not have sufficient balance for withdraw.'; return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $notify], ]); } $charge = $method->fixed_charge + ($request->amount * $method->percent_charge / 100); $afterCharge = $request->amount - $charge; $finalAmount = $afterCharge * $method->rate; $withdraw = new Withdrawal(); $withdraw->method_id = $method->id; // wallet method ID $withdraw->user_id = $user->id; $withdraw->amount = $request->amount; $withdraw->currency = $method->currency; $withdraw->rate = $method->rate; $withdraw->charge = $charge; $withdraw->final_amount = $finalAmount; $withdraw->after_charge = $afterCharge; $withdraw->trx = getTrx(); $withdraw->save(); $notify[] = 'Withdraw request stored successfully'; return response()->json([ 'code' => 202, 'status' => 'created', 'message' => ['success' => $notify], 'data' => $withdraw ]); } public function withdrawConfirm(Request $request) { $withdraw = Withdrawal::with('method', 'user')->where('trx', $request->transaction)->where('status', 0)->orderBy('id', 'desc')->first(); if (!$withdraw) { $notify[] = 'Withdraw request not found'; return response()->json([ 'code' => 404, 'status' => 'error', 'message' => ['error' => $notify], ]); } $rules = []; $inputField = []; if ($withdraw->method->user_data != null) { foreach ($withdraw->method->user_data as $key => $cus) { $rules[$key] = [$cus->validation]; if ($cus->type == 'file') { array_push($rules[$key], 'image'); array_push($rules[$key], new FileTypeValidate(['jpg', 'jpeg', 'png'])); array_push($rules[$key], 'max:2048'); } if ($cus->type == 'text') { array_push($rules[$key], 'max:191'); } if ($cus->type == 'textarea') { array_push($rules[$key], 'max:300'); } $inputField[] = $key; } } $rules['transaction'] = 'required'; $validator = Validator::make($request->all(), $rules); if ($validator->fails()) { return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $validator->errors()->all()], ]); } $user = auth()->user(); if ($user->ts) { $response = verifyG2fa($user, $request->authenticator_code); if (!$response) { $notify[] = 'Wrong verification code'; return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $notify], ]); } } if ($withdraw->amount > $user->balance) { $notify[] = 'Your request amount is larger then your current balance.'; return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['error' => $notify], ]); } $directory = date("Y") . "/" . date("m") . "/" . date("d"); $path = imagePath()['verify']['withdraw']['path'] . '/' . $directory; $collection = collect($request); $reqField = []; if ($withdraw->method->user_data != null) { foreach ($collection as $k => $v) { foreach ($withdraw->method->user_data as $inKey => $inVal) { if ($k != $inKey) { continue; } else { if ($inVal->type == 'file') { if ($request->hasFile($inKey)) { try { $reqField[$inKey] = [ 'field_name' => $directory . '/' . uploadImage($request[$inKey], $path), 'type' => $inVal->type, ]; } catch (Exception $exp) { $notify[] = 'Could not upload your ' . $request[$inKey]; return response()->json([ 'message' => ['error' => $notify], ]); } } } else { $reqField[$inKey] = $v; $reqField[$inKey] = [ 'field_name' => $v, 'type' => $inVal->type, ]; } } } } $withdraw['withdraw_information'] = $reqField; } else { $withdraw['withdraw_information'] = null; } $withdraw->status = 2; $withdraw->save(); $user->balance -= $withdraw->amount; $user->save(); $transaction = new Transaction(); $transaction->user_id = $withdraw->user_id; $transaction->amount = $withdraw->amount; $transaction->post_balance = $user->balance; $transaction->charge = $withdraw->charge; $transaction->trx_type = '-'; $transaction->details = getAmount($withdraw->final_amount) . ' ' . $withdraw->currency . ' Withdraw Via ' . $withdraw->method->name; $transaction->trx = $withdraw->trx; $transaction->save(); $adminNotification = new AdminNotification(); $adminNotification->user_id = $user->id; $adminNotification->title = 'New withdraw request from ' . $user->username; $adminNotification->click_url = urlPath('admin.withdraw.details', $withdraw->id); $adminNotification->save(); $general = GeneralSetting::first(); notify($user, 'WITHDRAW_REQUEST', [ 'method_name' => $withdraw->method->name, 'method_currency' => $withdraw->currency, 'method_amount' => getAmount($withdraw->final_amount), 'amount' => getAmount($withdraw->amount), 'charge' => getAmount($withdraw->charge), 'currency' => $general->cur_text, 'rate' => getAmount($withdraw->rate), 'trx' => $withdraw->trx, 'post_balance' => getAmount($user->balance), 'delay' => $withdraw->method->delay ]); $notify[] = 'Withdraw request sent successfully'; return response()->json([ 'code' => 200, 'status' => 'ok', 'message' => ['success' => $notify], ]); } public function withdrawLog() { $withdrawals = Withdrawal::where('user_id', auth()->user()->id)->where('status', '!=', 0)->with('method')->orderBy('id', 'desc')->paginate(getPaginate()); return response()->json([ 'code' => 200, 'status' => 'ok', 'data' => [ 'withdrawals' => $withdrawals, 'verification_file_path' => imagePath()['verify']['withdraw']['path'], ] ]); } public function depositHistory() { $deposits = Deposit::where('user_id', auth()->user()->id)->where('status', '!=', 0)->with('gateway')->orderBy('id', 'desc')->paginate(getPaginate()); return response()->json([ 'code' => 200, 'status' => 'ok', 'data' => [ 'deposit' => $deposits, 'verification_file_path' => imagePath()['verify']['deposit']['path'], ] ]); } public function transactions() { $user = auth()->user(); $transactions = $user->transactions()->paginate(getPaginate()); return response()->json([ 'code' => 200, 'status' => 'ok', 'data' => [ 'transactions' => $transactions, ] ]); } }
--- title: How to fix iCloud lock from your Apple iPhone SE and iPad date: 2024-05-19T06:51:55.475Z updated: 2024-05-20T06:51:55.475Z tags: - unlock - bypass activation lock categories: - ios - iphone description: This article describes How to fix iCloud lock from your Apple iPhone SE and iPad excerpt: This article describes How to fix iCloud lock from your Apple iPhone SE and iPad keywords: ipad 3 ipad 2 icloud bypass,how to fix icloud lock,how to remove activation lock without apple id,bypass icloud by checkra1n,bypass iphone icloud activation lock,checkra1n error 31,apple watch activation lock,icloud unlocker download,unlock icloud lock,4 ways to bypass activation lock,check icloud activation lock status,icloud bypass tools,remove iphone activation lock,iphone bypass,imei icloud unlock,how to unlock icloud account,how to unlock apple id disabled activation lock,how to remove activation lock without previous owner,how to bypass icloud activation lock screen on ios 17,unlock icloud activation,how to remove find my iphone activation lock without apple id thumbnail: https://www.lifewire.com/thmb/eYqxG8EorGAmKcW0zOiG4PnWFkw=/400x300/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/homeweatherstation-34f9e9a9aaf64446a8f21ff05991c079.jpg --- ## How to fix iCloud lock on your Apple iPhone SE and iPad There’s no sad thing like working your entire life just to get yourself the latest brand of your favorite iPhone or iPad device only for you to realize that the all-too-important iCloud option has been locked out of reach either by the owner or by the company that sold it to you. Without the iCloud option, you can’t back up your information, and neither can you secure your privacy. It’s for this reason that I have with me the how-to-fix iCloud lock method. A lot of people have always argued that the iCloud lock cannot be surpassed due to certain factors. However, thanks to technology, I’m here to prove all the doubting Toms otherwise. With the how-to-fix iCloud lock method at hand, you no longer have to worry or get stressed when purchasing an iPhone or an iPad for your own pleasure or comfort. In this article, I’m going to lay down three of the most basic and simple steps on how to fix iCloud lock in a matter of minutes. ## Method 1: Fix iCloud lock via Apple In the recent past, Apple has tried to bar its users from unlocking iCloud storage perhaps due to the increased cases of theft and privacy breach. It, however, seems too late for the company to stop this iCloud lock fix process as they nowadays help their users in unlocking the iCloud lock. The following is one of the most commonly used iCloud lock fix methods offered by Apple as a company. #### **Step 1:** Enter your Login Details To gain access to your device, you first need to enter your unique Apple ID and your password and log into your device. #### **Step 2:** Find My iPhone Once you have gained access to your device, locate the "Find My iPhone" option and turn it off. This particular option functions by locking your iCloud as a security measure. It's also the main reason why you can't access your iCloud account. #### **Step 3:** Restore your Device With the "Find My iPhone" option turned off, reset your device by deleting all your data and settings. You can do this by following this procedure. Click on Settings> General> Reset> Erase Content and all Settings. This process will completely erase your device to its default state. You should also note that this procedure may vary from one version to another. #### **Step 4:** Sign In With your phone back to its default state, sign in using your Apple details as explained in step 1. Once you are logged in, just set up your iPad or iPhone with new details. Also, try to access the iCloud option to make sure that the lock is no longer available. Once you are satisfied with what you see, simply sign out and sign in back again just to be sure. If everything is okay, then you are good to go. ## Method 2: How to fix iCloud lock through the owner Another easy iCloud lock fix method is by directly contacting the owner. In most circumstances, many iPhone and iPad users usually lock up the iCloud option as a way of protecting their privacy. If the person who sold you the Apple iPhone SE device happens to be the real owner, then he/she should be in a position to give you the iCloud unlock codes. This approach, however, has a downside. It's only applicable if you can track down the rightful owner of the iPad or iPhone device or if the company that sold it to you know how to remove the lock. If you can’t get through to the owner, then I would recommend you to look for other alternatives as we’re going to see in this article. ## Method 3: How to fix iCloud lock via Official iPhoneUnlock One of the greatest, safest and swift methods of fixing the iCloud lock is by using the [Official iPhoneUnlock](https://appleiphoneunlock.uk/network/Special%20Services/Activation%20Lock?aff=wondershare). With the help of the iCloud Activation Lock Removal process, you can easily bypass the iCloud Activation Lock and remove it completely from your device. The following is a detailed process on how you can seamlessly do it with the peace of mind that your data and all valuable information will be kept in place. #### **Step 1:** Purchase the Service For you to unlock the iCloud lock, using this method, you first have to obtain the rights to do so. Securing these rights is simply done by purchasing their services. The price at which you’ll be charged will depend on the model of your device. To buy these services, visit [the webiste](https://appleiphoneunlock.uk/network/Special%20Services/Activation%20Lock?aff=wondershare) of Official iPhoneUnlock and select "iCloud Unlock" to its "iCloud Unlock/Activation Lock Removal" feature, then enter your IMEI number from the drop-down list as illustrated below. Once you have located your phone make or model, click on the "Add to Cart" tab. The price at which you are going to be charged will be displayed on your right-hand side. ![fix icloud lock](https://images.wondershare.com/drfone/article/2016/08/14719794951413.jpg) #### **Step 2:** Enter your Email Address A new page with your purchase details as shown below will open up. Enter your email address as requested and click on the "Continue" button. Make sure that you have entered the correct email address as it will be used to inform you that your iCloud lock is no longer active. ![how to fix icloud lock](https://images.wondershare.com/drfone/article/2016/08/14719796268564.jpg) #### **Step 3:** Pay Options Once you have entered your email address, a new interface requesting you to choose your preferred payment method will be displayed. Choose your best-preferred method by clicking on the "Pay with Credit or Debit Card" tab and enter your bank details. Once you submit your payment, your iCloud lock will be unlocked after a period of between 2-3 days. A confirmation email will be sent to your designated email address. Just like that, your iCloud lock fix is removed, and you are free to use iCloud. ![fix icloud activation lock](https://images.wondershare.com/drfone/article/2016/08/14719797331077.jpg) ## Method 4: How to Fix iCloud with Efficient Tool If you aren’t able to fix iCloud lock with the provided methods above, we would like to recommend you Dr.Fone – [Unlock (iOS)](https://tools.techidaily.com/wondershare/drfone/iphone-unlock/) – one of its kind tools that work when you wish to unlock screen locks effortlessly. It shows great compatibility with the latest iPhones and iOS versions. In addition, you don’t need to be tech-savvy to play with this tool. Let us know how it works to fix iCloud lock. ### [Dr.Fone - Screen Unlock](https://tools.techidaily.com/wondershare/drfone/iphone-unlock/) Fix the "iPhone Is Disabled Connect to iTunes" Error In 5 Minutes - The welcoming solution to fix "iPhone is disabled, connect to iTunes" - Effectively remove iPhone lock screen without the passcode. - Works for all models of iPhone, iPad, and iPod touch. - Fully compatible with the latest iOS.![New icon](https://images.wondershare.com/drfone/others/new_23.png) **3,238,377** people have downloaded it ### How to fix iCloud Lock using Dr.Fone – [Screen Unlock (iOS)](https://tools.techidaily.com/wondershare/drfone/iphone-unlock/) #### **Step 1:** Allow the Program to Start After you download and install Dr.Fone – [Screen Unlock (iOS)](https://tools.techidaily.com/wondershare/drfone/iphone-unlock/) from its official website, launch it. Now, with the help of a USB cord, plug your device into the PC. Click “Unlock” from the main interface. ![drfone-home-interface](https://images.wondershare.com/drfone/guide/drfone-home.png) #### **Step 2:** Select Unlock Apple ID When the next screen appears, you are required to hit on the “Remove Apple ID”. ![new-interface](https://images.wondershare.com/drfone/guide/android-screen-unlock-2.png) #### **Step 3:** Key in the Password As the next step, make sure to enter the screen password. Move ahead to trust the computer thereby letting the program scan the Apple iPhone SE device further. ![trust computer](https://images.wondershare.com/drfone/drfone/trust-computer-1.jpg) #### **Step 4:** Enter Recovery mode You will be given some instructions on the following screen. Ensure to follow them carefully and put your device into recovery mode. ![interface](https://images.wondershare.com/drfone/guide/remove-apple-id-5.png) #### **Step 5:** Get iCloud Lock Fixed When the Apple iPhone SE device restarts, the program will start fixing the iCloud lock. You just need to wait patiently until the process is over. ![process-of-unlocking](https://images.wondershare.com/drfone/guide/remove-apple-id-7.png) #### **Step 6:** Check the iCloud ID In the last, you will receive a new window where you can check whether you have fixed iCloud or not. ![complete](https://images.wondershare.com/drfone/guide/remove-apple-id-8.png) As we have seen, different methods of how to fix iCloud lock are available to choose from. The method you chose will solely depend on your own preferences. The various methods as we have seen have their own advantages and disadvantages. Some will delete your entire data while some will charge you a particular amount. What you should always keep in mind is the fact that you can fix iCloud lock at your own will and wish. You no longer have to be worried about being locked out of your iCloud account. ## How to Unlock iCloud lock on your Apple iPhone SE and iPad? ## Part 1: Is it possible to unlock the iCloud lock on iPhone At the start of 2014, apple introduced what they call "iCloud Activation Lock". This means that your iPad, iPhone, or Apple Watch is now locked to your iCloud account unless you decide to share your login details with someone. Therefore, the only way you can access your device is by entering the iCloud user ID and password. Essentially what this means is that your Apple device is useless unless you find a way to unlock it. The good news is that it is possible to unlock the iCloud lock on iPhone or iPad even if you don't have the credentials using third-party software. <iframe width="100%" height="450" src="https://www.youtube.com/embed/3vsQWFTA1UY" frameborder="0" allowfullscreen="allowfullscreen"></iframe> ![Safe download](https://images.wondershare.com/drfone/article/2022/05/security.svg)safe & secure ## Part 2: One-click to unlock iCloud ID with a convenient tool Sometimes, getting some penny spent is a great idea. And in case you want to unlock the iCloud locked device, spending is indeed a perfect idea. We would here like to suggest to you Dr.Fone - [Screen Unlock (iOS)](https://tools.techidaily.com/wondershare/drfone/iphone-unlock/) – a tool that assures unlocking iCloud ID in a few clicks and gives satisfying results. ### [Dr.Fone - Screen Unlock](https://tools.techidaily.com/wondershare/drfone/iphone-unlock/) Remove iCloud Lock from Any iPhone and iPad without Hassle. - Unlock iCloud activation lock on iPhones and iPads without an iCloud account. - Save your Apple iPhone SE quickly from the disabled state. - Free your sim out of any carrier worldwide. - Completely unlinked from the previous iCloud account, it won’t be traced or blocked by it anymore. - Fully compatible with the latest iOS.![New icon](https://images.wondershare.com/drfone/others/new_23.png) **4,008,669** people have downloaded it #### Pros - User friendly; anyone can handle it. - No need for an IMEI number or email ID/security answers. - Can easily unlock iCloud without a password. - Support for a wide range of iOS devices and works fast. - Can bypass activation lock in a trouble-free way. #### Cons - No free version **Step 1: Download [Dr.Fone](https://tools.techidaily.com/wondershare/drfone/drfone-toolkit/) and open the Screen Unlock (iOS)** To begin with, get the tool downloaded and installed on your PC. Launch it and click on the “Screen Unlock” option from the main screen. Connect your device to the computer now. **Step 2: Choose the option "Unlock Apple ID"** From the following screen, press the “Unlock Apple ID” button. ![new-interface](https://images.wondershare.com/drfone/guide/android-screen-unlock-2.png) **Step 3: Select "Remove Active Lock"** ![select remove active lock](https://images.wondershare.com/drfone/drfone/remove-activation-lock-1.jpg) **Step 4: Start to unlock** If your Apple iPhone SE has been jailbroken, click the button "Finished Jailbreak". For those who haven't done it, you can follow the [jailbreak guide](https://drfone.wondershare.com/guide/how-to-jailbreak-ios-on-mac.html) to go on. ![jailbreak iphone](https://images.wondershare.com/drfone/drfone/remove-activation-lock-2.jpg) Confirm the Apple iPhone SE device model and start to unlock safely. ![jailbreak iphone](https://images.wondershare.com/drfone/guide/bypass-activation-lock-8.png) **Step 5: Unlock completed.** Lastly, all you need is to check if you succeeded in unlocking the iCloud lock. This can be done on the new window that appears. ![complete](https://images.wondershare.com/drfone/guide/bypass-activation-lock-9.png) ## Part 3: How to Free Unlock the iCloud Lock on iPhone Since your Apple iPhone SE is locked, you will not be able to access files until you unlock iCloud on your Apple device. One way to unlock iCloud locked phone is to bypass the iCloud activation lock by following the steps below Step 1. Take your Apple iPhone SE and while on the "Activate iPhone" screen, press the home button and then press the "Wi-Fi" settings. Next to the "Wi-Fi" symbol, tap on "i". Now you need to change the existing DNS settings. The DNS settings you need to type are as follows: 1. If you are in the USA type in 104.154.51.7 2. In Europe, type 104.155.28.90 3. In Asia, type 104.155.220.58 4. The rest of the world, please type in 78.109.17.60 Step 2. Tap on the "Back" button then click "Done". Next, click "Activation help". Once you have done that, you will see a message that says: You have successfully connected to my server." If you tap on the menu, you will be able to access different iCloud services such as iCloud Locked User Chat, Mail, Social, Maps, Video, YouTube, Audia, and games, among others. ## Part 4: How to unlock iCloud lock by Apple iPhone Unlock Sometimes it may not be possible to completely unlock your iCloud Lock. For instance, the free method of unlocking your iCloud Lock only works on iOS 9 and iOS 8 for iPhones. Anything else will not work properly. Moreover, you may not be able to know how to unlock iCloud lock-free if you are in certain countries. That is when you can think of using the Official iPhone Unlock service which will completely unlock your Apple iPhone SE without any hassle. The iCloud Activation Lock Removal tool will quickly remove the iCloud activation lock from the previous owner's account. In short, this is an easy and seamless tool for removing the iCloud lock to set your own. Step 1 - Visit the [Apple iPhone unlock](https://appleiphoneunlock.uk/network/Special%20Services/Activation%20Lock?aff=wondershare) by clicking on this link. Step 2 - Enter the IMEI/Serial number of your device and send it. ![Enter your IMEI/Serial number](https://images.wondershare.com/drfone/article/2016/08/14720745007162.jpg) Step 3 - Just wait for a confirmation message telling you that the iCloud Lock has been removed. Step 4 - Now create a new iCloud account and start using your device This tool works on all iPhone 6, 6+, 5S, 5C, 5, 4S, 4, and iPad 4, 3, 2 Air 2 and also works on iOS, and it doesn't matter why you are unlocking it from. ### Wrap it up Unlike the free iCloud Lock unlock solution, Dr.Fone - Screen Unlock (iCloud Activation Lock Removal) tool provides a permanent solution to the problem of how to unlock iCloud locked irrespective of your country. It will only cost you a couple of dollars pounds to unlock your Phone. This is a small price to pay because you might have spent hundreds of dollars to purchase a new iPhone or iPad. ## A How-To Guide on Bypassing Apple iPhone SE iCloud Activation Lock iCloud Activation Lock is a feature for Find My iPhone capability. You will need your Apple ID and its code to switch off the "Find My iPhone" feature when it is enabled. You may also need it to erase your data or reactivate and utilize your device. That is to say, iCloud Activation Lock keeps your device from getting into the wrong hands. Regarding this security plan, if you purchased a second-hand iDevice with "Find My iPhone" enabled, you would be stuck after resetting it without a passcode. Therefore, the best way is to **bypass Apple iPhone SE** Activation Lock to utilize the phone. You can bypass the lock but can't eliminate the Activation Lock by iTunes. So, to dispose of the Activation Lock, here, we will provide the best ways possible for **Apple iPhone SE iCloud bypass**. All the solutions mentioned here are effective and work almost 100% of the time. ## Part 1: 4 Quick Methods to Bypass Apple iPhone SE iCloud activation lock ### Method 1. Ask the previous owner for Apple ID and passcode The first thing you can do is to [ask the previous owner](https://drfone.wondershare.com/icloud/how-to-remove-activation-lock-without-previous-owner.html) for their Apple iCloud account credentials. You can use these details to open the account and use it for the **Apple iPhone SE bypass**. However, it is the least suggested and least effective method. It is because asking someone about their account details is unethical. The iCloud account has a lot of personal information about the user. Therefore, no one will be willing to hand you the account credentials unless they are your close relatives. ### Method 2. Ask the previous owner to bypass it (iCloud) remotely The best **Apple iPhone SE bypass** method is connecting with the past user and having them erase the Apple iPhone SE from their Apple ID. The previous user can enter their password on the Activation Lock screen or access iCloud. The following are the steps that the past user ought to follow: - Sign in to iCloud.com and go to Find iPhone. - Click “All Devices” from the top to open a rundown of the phones connected to their account. It will show all the phones connected to the iCloud account, regardless of whether it's on the web. If this is a family account, it shows every accessory. - Scroll down until you find the phone you need to eliminate. Click it. - The site page will show a couple of choices for it. Click "Remove from Account" to disassociate it from iCloud. ### Method 3. Use iCloud DNS Bypass DNS represents the domain name and is a supportive method for bypassing the Apple iPhone SE activation lock. It controls the DNS server and redirects the authentication way of your phone. It assists you with the Apple iPhone SE iCloud bypass using these steps: ![dns bypass](https://images.wondershare.com/drfone/article/2022/10/iphone-se-icloud-bypass-1.jpg) **Step 1.** Go to the Wi-Fi settings and click Configure IP. Then choose Manual and click "Add Server." **Step 2.** Click on the "i" and enter the DNS server IP according to your area, which is: - USA: 104.154.51.7 - South America: 35.199.88.219 - Europe: 104.155.28.90 - Asia: 104.155.220.58 - Australia and Oceania: 35.189.47.23 - The rest: 78.100.17.60 **Step 3.** Go back and turn on Wi-Fi. **Step 4.** Tap on Next Page and go back to bypass the lock. **Step 5.** Set up the gadget according to your liking. The downside of this strategy is that it is short-term. When you reboot your iOS gadget, the activation lock comes back up, and you'll need to do it again. That can get irritating and wasteful. ### Method 4. [Dr.Fone - Screen Unlock (iOS)](https://tools.techidaily.com/wondershare/drfone/iphone-unlock/) As one of the most well-known and proficient [iCloud Activation bypass software for iOS](https://drfone.wondershare.com/icloud/mac-activation-lock.html), Dr.Fone - Screen Unlock is the best way to **bypass Apple iPhone SE** Activation Lock. As a complete iOS unlocking tool, Dr.Fone can satisfy your unlocking needs, regardless of whether your Apple iPhone SE is connected to an Apple ID, you want to eliminate your Apple ID, or you fail to remember your ID credentials. By utilizing its iCloud Activation Unlocker feature, you can bypass the lock without requiring an Apple ID. **Steps to Follow:** **Step 1:** Click Toolbox on the homepage of Wondershare Dr.Fone. Then click **Screen Unlock** > **iOS**. ![click unlock button](https://images.wondershare.com/drfone/guide/bypass-activation-lock-1.png) **Step 2:** Initiate the **iCloud Activation Lock Removal** feature and tab the **Start** button. Read carefully and confirm the prompt on the next window. Continue the process by tabbing “**Got it!**”. ![confirm prompt](https://images.wondershare.com/drfone/guide/bypass-activation-lock-2.png) **Step 3:** If your Apple iPhone SE is not jailbroken, follow on-screen prompts to initiate the process. Opt for [Jailbreak Guide](https://drfone.wondershare.com/guide/how-to-jailbreak-ios-on-windows.html) for textual instructions. ![put iDevice in DFU Mode](https://images.wondershare.com/drfone/guide/bypass-activation-lock-5.png) **Step 4:** Once jailbroken, the computer’s screen will start displaying the removal of the iCloud Activation Lock. When it’s done, click **Done** in the next window. ![process done](https://images.wondershare.com/drfone/guide/bypass-activation-lock-16.png) **You can watch the video below to get your Apple iPhone SE Cloud activation bypassed with Wondershare Dr.Fone** <iframe allowfullscreen="allowfullscreen" frameborder="0" src="https://www.youtube.com/embed/k_54CmjPC7I"></iframe> ## Part 2: What is Find My? By all accounts, Apple's Find My feature does what it says. If you lose your Apple iPhone SE, you can recognize its latest area using the iCloud Site, and you can make it play a sound. Yet, Find My iPhone does substantially more! You can utilize it to find a missing Macintosh, iPad, iPod, and even AirPods. It also safeguards your data on the off chance a gadget is stolen. It even works with Family Sharing to find phones claimed by anybody in your family. ## Part 3: How to Disable Find My? When you switch off Find My feature on your iDevice, the Activation Lock is naturally switched off. Here's how: - Go to Settings, click on your account (your account name) and click the "Find My" option on your iDevice. ![click on your name](https://images.wondershare.com/drfone/article/2022/10/iphone-se-icloud-bypass-2.jpg) - Tap iCloud > Find My \[iDevice\], then switch it off. ![disable find my](https://images.wondershare.com/drfone/article/2022/10/iphone-se-icloud-bypass-3.jpg) ## Conclusion Getting suck on the activation lock screen can be frustrating. Therefore, this **Apple iPhone SE bypass** guide tries to answer all your questions. We have listed several solutions to help you **bypass Apple iPhone SE** Activation lock. However, we strongly recommend [Dr.Fone - Screen Unlock (iOS)](https://tools.techidaily.com/wondershare/drfone/iphone-unlock/) as a fast and effective solution. <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-7571918770474297" data-ad-slot="1223367746"></ins> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-7571918770474297" data-ad-slot="8358498916" data-ad-format="auto" data-full-width-responsive="true"></ins> <span class="atpl-alsoreadstyle">Also read:</span> <div><ul> <li><a href="https://activate-lock.techidaily.com/in-2024-latest-guide-on-ipad-23-and-apple-iphone-12-pro-max-icloud-activation-lock-bypass-by-drfone-ios/"><u>In 2024, Latest Guide on iPad 2/3 and Apple iPhone 12 Pro Max iCloud Activation Lock Bypass</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-new-multiple-ways-how-to-remove-icloud-activation-lock-from-your-apple-iphone-se-by-drfone-ios/"><u>In 2024, New Multiple Ways How To Remove iCloud Activation Lock From your Apple iPhone SE</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-3-effective-ways-to-bypass-activation-lock-on-iphone-x-by-drfone-ios/"><u>In 2024, 3 Effective Ways to Bypass Activation Lock on iPhone X</u></a></li> <li><a href="https://activate-lock.techidaily.com/how-to-remove-icloud-from-apple-iphone-11-smoothly-by-drfone-ios/"><u>How To Remove iCloud From Apple iPhone 11 Smoothly</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-icloud-unlocker-download-unlock-icloud-lock-for-your-apple-iphone-15-pro-max-by-drfone-ios/"><u>In 2024, iCloud Unlocker Download Unlock iCloud Lock for your Apple iPhone 15 Pro Max</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-how-to-bypass-activation-lock-from-iphone-11-pro-or-ipad-by-drfone-ios/"><u>In 2024, How to Bypass Activation Lock from iPhone 11 Pro or iPad?</u></a></li> <li><a href="https://activate-lock.techidaily.com/easy-tutorial-for-activating-icloud-from-iphone-6-safe-and-legal-by-drfone-ios/"><u>Easy Tutorial for Activating iCloud from iPhone 6 Safe and Legal</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-how-to-unlock-apple-id-activation-lock-on-apple-iphone-11-by-drfone-ios/"><u>In 2024, How to Unlock Apple ID Activation Lock On Apple iPhone 11?</u></a></li> <li><a href="https://activate-lock.techidaily.com/effective-ways-to-fix-checkra1n-error-31-from-iphone-7-by-drfone-ios/"><u>Effective Ways To Fix Checkra1n Error 31 From iPhone 7</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-how-to-unlock-icloud-lock-on-your-iphone-13-pro-and-ipad-by-drfone-ios/"><u>In 2024, How to Unlock iCloud lock on your iPhone 13 Pro and iPad?</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-new-guide-how-to-check-icloud-activation-lock-status-from-your-iphone-8-by-drfone-ios/"><u>In 2024, New Guide How To Check iCloud Activation Lock Status From Your iPhone 8</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-how-to-remove-activation-lock-from-the-apple-iphone-xr-without-previous-owner-by-drfone-ios/"><u>In 2024, How to Remove Activation Lock From the Apple iPhone XR Without Previous Owner?</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-apple-iphone-13-pro-icloud-activation-lock-bypass-by-drfone-ios/"><u>In 2024, Apple iPhone 13 Pro iCloud Activation Lock Bypass</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-iphone-12-pro-icloud-activation-lock-bypass-by-drfone-ios/"><u>In 2024, iPhone 12 Pro iCloud Activation Lock Bypass</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-easy-fixes-how-to-recover-forgotten-icloud-password-from-your-apple-iphone-se-by-drfone-ios/"><u>In 2024, Easy Fixes How To Recover Forgotten iCloud Password From your Apple iPhone SE</u></a></li> <li><a href="https://activate-lock.techidaily.com/how-to-bypass-icloud-lock-on-apple-iphone-13-mini-by-drfone-ios/"><u>How to Bypass iCloud Lock on Apple iPhone 13 mini</u></a></li> <li><a href="https://activate-lock.techidaily.com/latest-guide-on-ipad-23-and-iphone-12-icloud-activation-lock-bypass-by-drfone-ios/"><u>Latest Guide on iPad 2/3 and iPhone 12 iCloud Activation Lock Bypass</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-unlocking-an-icloud-locked-ipad-and-iphone-12-mini-by-drfone-ios/"><u>In 2024, Unlocking an iCloud Locked iPad and iPhone 12 mini</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-how-to-unlock-icloud-lock-from-your-iphone-se-2020-and-ipad-by-drfone-ios/"><u>In 2024, How to Unlock iCloud lock from your iPhone SE (2020) and iPad?</u></a></li> <li><a href="https://activate-lock.techidaily.com/how-to-unlock-icloud-activation-lock-and-icloud-account-from-iphone-se-by-drfone-ios/"><u>How to Unlock iCloud Activation Lock and iCloud Account From iPhone SE?</u></a></li> <li><a href="https://activate-lock.techidaily.com/how-to-unlock-icloud-lock-from-your-apple-iphone-x-and-ipad-by-drfone-ios/"><u>How to Unlock iCloud lock from your Apple iPhone X and iPad?</u></a></li> <li><a href="https://activate-lock.techidaily.com/unlock-your-device-icloud-dns-bypass-explained-and-tested-plus-easy-alternatives-on-apple-iphone-x-by-drfone-ios/"><u>Unlock Your Device iCloud DNS Bypass Explained and Tested, Plus Easy Alternatives On Apple iPhone X</u></a></li> <li><a href="https://activate-lock.techidaily.com/how-to-bypass-icloud-lock-from-iphone-se-2022-by-drfone-ios/"><u>How to Bypass iCloud Lock from iPhone SE (2022)</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-4-things-you-must-know-about-iphone-6-plus-activation-lock-by-drfone-ios/"><u>In 2024, 4 Things You Must Know About iPhone 6 Plus Activation Lock</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-what-you-want-to-know-about-two-factor-authentication-for-icloud-from-your-iphone-11-pro-by-drfone-ios/"><u>In 2024, What You Want To Know About Two-Factor Authentication for iCloud From your iPhone 11 Pro</u></a></li> <li><a href="https://activate-lock.techidaily.com/how-to-bypass-activation-lock-on-iphone-se-2020-or-ipad-by-drfone-ios/"><u>How to Bypass Activation Lock on iPhone SE (2020) or iPad?</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-what-you-want-to-know-about-two-factor-authentication-for-icloud-from-your-apple-iphone-14-plus-by-drfone-ios/"><u>In 2024, What You Want To Know About Two-Factor Authentication for iCloud From your Apple iPhone 14 Plus</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-the-10-best-tools-to-bypass-icloud-activation-lock-from-iphone-11-pro-you-should-try-out-by-drfone-ios/"><u>In 2024, The 10 Best Tools to Bypass iCloud Activation Lock From iPhone 11 Pro You Should Try Out</u></a></li> <li><a href="https://activate-lock.techidaily.com/unlock-your-device-icloud-dns-bypass-explained-and-tested-plus-easy-alternatives-on-iphone-6-by-drfone-ios/"><u>Unlock Your Device iCloud DNS Bypass Explained and Tested, Plus Easy Alternatives On iPhone 6</u></a></li> <li><a href="https://activate-lock.techidaily.com/in-2024-best-ways-to-bypass-icloud-activation-lock-on-iphone-se-2020ipadipod-by-drfone-ios/"><u>In 2024, Best Ways to Bypass iCloud Activation Lock on iPhone SE (2020)/iPad/iPod</u></a></li> <li><a href="https://activate-lock.techidaily.com/effective-ways-to-fix-checkra1n-error-31-from-iphone-12-pro-by-drfone-ios/"><u>Effective Ways To Fix Checkra1n Error 31 From iPhone 12 Pro</u></a></li> <li><a href="https://screen-mirror.techidaily.com/how-can-you-cast-your-apple-iphone-11-pro-to-windows-pc-with-ease-drfone-by-drfone-ios/"><u>How Can You Cast Your Apple iPhone 11 Pro to Windows PC With Ease? | Dr.fone</u></a></li> <li><a href="https://location-social.techidaily.com/simple-and-effective-ways-to-change-your-country-on-youtube-app-of-your-nokia-g42-5g-drfone-by-drfone-virtual-android/"><u>Simple and Effective Ways to Change Your Country on YouTube App Of your Nokia G42 5G | Dr.fone</u></a></li> <li><a href="https://change-location.techidaily.com/the-magnificent-art-of-pokemon-go-streaming-on-vivo-x90s-drfone-by-drfone-virtual-android/"><u>The Magnificent Art of Pokemon Go Streaming On Vivo X90S? | Dr.fone</u></a></li> <li><a href="https://location-fake.techidaily.com/10-best-fake-gps-location-spoofers-for-vivo-y27-4g-drfone-by-drfone-virtual-android/"><u>10 Best Fake GPS Location Spoofers for Vivo Y27 4G | Dr.fone</u></a></li> <li><a href="https://blog-min.techidaily.com/how-to-fix-iphone-se-2020-storage-not-loadingshowing-stellar-by-stellar-data-recovery-ios-iphone-data-recovery/"><u>How to Fix iPhone SE (2020) Storage Not Loading/Showing | Stellar</u></a></li> <li><a href="https://location-fake.techidaily.com/a-detailed-guide-on-faking-your-location-in-mozilla-firefox-on-vivo-y77t-drfone-by-drfone-virtual-android/"><u>A Detailed Guide on Faking Your Location in Mozilla Firefox On Vivo Y77t | Dr.fone</u></a></li> <li><a href="https://location-social.techidaily.com/in-2024-how-to-change-your-oneplus-nord-ce-3-5g-location-on-twitter-drfone-by-drfone-virtual-android/"><u>In 2024, How to Change your OnePlus Nord CE 3 5G Location on Twitter | Dr.fone</u></a></li> <li><a href="https://fake-location.techidaily.com/how-to-sharefake-gps-on-uber-for-itel-a05s-drfone-by-drfone-virtual-android/"><u>How to share/fake gps on Uber for Itel A05s | Dr.fone</u></a></li> <li><a href="https://android-pokemon-go.techidaily.com/planning-to-use-a-pokemon-go-joystick-on-motorola-g54-5g-drfone-by-drfone-virtual-android/"><u>Planning to Use a Pokemon Go Joystick on Motorola G54 5G? | Dr.fone</u></a></li> <li><a href="https://howto.techidaily.com/google-pixel-8-stuck-on-screen-finding-solutions-for-stuck-on-boot-drfone-by-drfone-fix-android-problems-fix-android-problems/"><u>Google Pixel 8 Stuck on Screen – Finding Solutions For Stuck on Boot | Dr.fone</u></a></li> </ul></div>
/* -*- c++ -*- */ /* * Copyright 2021 Free Software Foundation, Inc. * * This file is part of VOLK * * SPDX-License-Identifier: LGPL-3.0-or-later */ /*! * \page volk_32fc_index_min_32u * * \b Overview * * Returns Argmin_i mag(x[i]). Finds and returns the index which contains the * minimum magnitude for complex points in the given vector. * * <b>Dispatcher Prototype</b> * \code * void volk_32fc_index_min_32u(uint32_t* target, lv_32fc_t* source, uint32_t * num_points) \endcode * * \b Inputs * \li source: The complex input vector. * \li num_points: The number of samples. * * \b Outputs * \li target: The index of the point with minimum magnitude. * * \b Example * Calculate the index of the minimum value of \f$x^2 + x\f$ for points around * the unit circle. * \code * int N = 10; * uint32_t alignment = volk_get_alignment(); * lv_32fc_t* in = (lv_32fc_t*)volk_malloc(sizeof(lv_32fc_t)*N, alignment); * uint32_t* min = (uint32_t*)volk_malloc(sizeof(uint32_t), alignment); * * for(uint32_t ii = 0; ii < N/2; ++ii){ * float real = 2.f * ((float)ii / (float)N) - 1.f; * float imag = std::sqrt(1.f - real * real); * in[ii] = lv_cmake(real, imag); * in[ii] = in[ii] * in[ii] + in[ii]; * in[N-ii] = lv_cmake(real, imag); * in[N-ii] = in[N-ii] * in[N-ii] + in[N-ii]; * } * * volk_32fc_index_min_32u(min, in, N); * * printf("index of min value = %u\n", *min); * * volk_free(in); * volk_free(min); * \endcode */ #ifndef INCLUDED_volk_32fc_index_min_32u_a_H #define INCLUDED_volk_32fc_index_min_32u_a_H #include <inttypes.h> #include <stdio.h> #include <volk/volk_common.h> #include <volk/volk_complex.h> #ifdef LV_HAVE_AVX2 #include <immintrin.h> #include <volk/volk_avx2_intrinsics.h> static inline void volk_32fc_index_min_32u_a_avx2_variant_0(uint32_t* target, const lv_32fc_t* source, uint32_t num_points) { const __m256i indices_increment = _mm256_set1_epi32(8); /* * At the start of each loop iteration current_indices holds the indices of * the complex numbers loaded from memory. Explanation for odd order is given * in implementation of vector_32fc_index_min_variant0(). */ __m256i current_indices = _mm256_set_epi32(7, 6, 3, 2, 5, 4, 1, 0); __m256 min_values = _mm256_set1_ps(FLT_MAX); __m256i min_indices = _mm256_setzero_si256(); for (unsigned i = 0; i < num_points / 8u; ++i) { __m256 in0 = _mm256_load_ps((float*)source); __m256 in1 = _mm256_load_ps((float*)(source + 4)); vector_32fc_index_min_variant0( in0, in1, &min_values, &min_indices, &current_indices, indices_increment); source += 8; } // determine minimum value and index in the result of the vectorized loop __VOLK_ATTR_ALIGNED(32) float min_values_buffer[8]; __VOLK_ATTR_ALIGNED(32) uint32_t min_indices_buffer[8]; _mm256_store_ps(min_values_buffer, min_values); _mm256_store_si256((__m256i*)min_indices_buffer, min_indices); float min = FLT_MAX; uint32_t index = 0; for (unsigned i = 0; i < 8; i++) { if (min_values_buffer[i] < min) { min = min_values_buffer[i]; index = min_indices_buffer[i]; } } // handle tail not processed by the vectorized loop for (unsigned i = num_points & (~7u); i < num_points; ++i) { const float abs_squared = lv_creal(*source) * lv_creal(*source) + lv_cimag(*source) * lv_cimag(*source); if (abs_squared < min) { min = abs_squared; index = i; } ++source; } *target = index; } #endif /*LV_HAVE_AVX2*/ #ifdef LV_HAVE_AVX2 #include <immintrin.h> #include <volk/volk_avx2_intrinsics.h> static inline void volk_32fc_index_min_32u_a_avx2_variant_1(uint32_t* target, const lv_32fc_t* source, uint32_t num_points) { const __m256i indices_increment = _mm256_set1_epi32(8); /* * At the start of each loop iteration current_indices holds the indices of * the complex numbers loaded from memory. Explanation for odd order is given * in implementation of vector_32fc_index_min_variant0(). */ __m256i current_indices = _mm256_set_epi32(7, 6, 3, 2, 5, 4, 1, 0); __m256 min_values = _mm256_set1_ps(FLT_MAX); __m256i min_indices = _mm256_setzero_si256(); for (unsigned i = 0; i < num_points / 8u; ++i) { __m256 in0 = _mm256_load_ps((float*)source); __m256 in1 = _mm256_load_ps((float*)(source + 4)); vector_32fc_index_min_variant1( in0, in1, &min_values, &min_indices, &current_indices, indices_increment); source += 8; } // determine minimum value and index in the result of the vectorized loop __VOLK_ATTR_ALIGNED(32) float min_values_buffer[8]; __VOLK_ATTR_ALIGNED(32) uint32_t min_indices_buffer[8]; _mm256_store_ps(min_values_buffer, min_values); _mm256_store_si256((__m256i*)min_indices_buffer, min_indices); float min = FLT_MAX; uint32_t index = 0; for (unsigned i = 0; i < 8; i++) { if (min_values_buffer[i] < min) { min = min_values_buffer[i]; index = min_indices_buffer[i]; } } // handle tail not processed by the vectorized loop for (unsigned i = num_points & (~7u); i < num_points; ++i) { const float abs_squared = lv_creal(*source) * lv_creal(*source) + lv_cimag(*source) * lv_cimag(*source); if (abs_squared < min) { min = abs_squared; index = i; } ++source; } *target = index; } #endif /*LV_HAVE_AVX2*/ #ifdef LV_HAVE_SSE3 #include <pmmintrin.h> #include <xmmintrin.h> static inline void volk_32fc_index_min_32u_a_sse3(uint32_t* target, const lv_32fc_t* source, uint32_t num_points) { union bit128 holderf; union bit128 holderi; float sq_dist = 0.0; union bit128 xmm5, xmm4; __m128 xmm1, xmm2, xmm3; __m128i xmm8, xmm11, xmm12, xmm9, xmm10; xmm5.int_vec = _mm_setzero_si128(); xmm4.int_vec = _mm_setzero_si128(); holderf.int_vec = _mm_setzero_si128(); holderi.int_vec = _mm_setzero_si128(); xmm8 = _mm_setr_epi32(0, 1, 2, 3); xmm9 = _mm_setzero_si128(); xmm10 = _mm_setr_epi32(4, 4, 4, 4); xmm3 = _mm_set_ps1(FLT_MAX); int bound = num_points >> 2; for (int i = 0; i < bound; ++i) { xmm1 = _mm_load_ps((float*)source); xmm2 = _mm_load_ps((float*)&source[2]); source += 4; xmm1 = _mm_mul_ps(xmm1, xmm1); xmm2 = _mm_mul_ps(xmm2, xmm2); xmm1 = _mm_hadd_ps(xmm1, xmm2); xmm3 = _mm_min_ps(xmm1, xmm3); xmm4.float_vec = _mm_cmpgt_ps(xmm1, xmm3); xmm5.float_vec = _mm_cmpeq_ps(xmm1, xmm3); xmm11 = _mm_and_si128(xmm8, xmm5.int_vec); xmm12 = _mm_and_si128(xmm9, xmm4.int_vec); xmm9 = _mm_add_epi32(xmm11, xmm12); xmm8 = _mm_add_epi32(xmm8, xmm10); } if (num_points >> 1 & 1) { xmm2 = _mm_load_ps((float*)source); xmm1 = _mm_movelh_ps(bit128_p(&xmm8)->float_vec, bit128_p(&xmm8)->float_vec); xmm8 = bit128_p(&xmm1)->int_vec; xmm2 = _mm_mul_ps(xmm2, xmm2); source += 2; xmm1 = _mm_hadd_ps(xmm2, xmm2); xmm3 = _mm_min_ps(xmm1, xmm3); xmm10 = _mm_setr_epi32(2, 2, 2, 2); xmm4.float_vec = _mm_cmpgt_ps(xmm1, xmm3); xmm5.float_vec = _mm_cmpeq_ps(xmm1, xmm3); xmm11 = _mm_and_si128(xmm8, xmm5.int_vec); xmm12 = _mm_and_si128(xmm9, xmm4.int_vec); xmm9 = _mm_add_epi32(xmm11, xmm12); xmm8 = _mm_add_epi32(xmm8, xmm10); } if (num_points & 1) { sq_dist = lv_creal(source[0]) * lv_creal(source[0]) + lv_cimag(source[0]) * lv_cimag(source[0]); xmm2 = _mm_load1_ps(&sq_dist); xmm1 = xmm3; xmm3 = _mm_min_ss(xmm3, xmm2); xmm4.float_vec = _mm_cmpgt_ps(xmm1, xmm3); xmm5.float_vec = _mm_cmpeq_ps(xmm1, xmm3); xmm8 = _mm_shuffle_epi32(xmm8, 0x00); xmm11 = _mm_and_si128(xmm8, xmm4.int_vec); xmm12 = _mm_and_si128(xmm9, xmm5.int_vec); xmm9 = _mm_add_epi32(xmm11, xmm12); } _mm_store_ps((float*)&(holderf.f), xmm3); _mm_store_si128(&(holderi.int_vec), xmm9); target[0] = holderi.i[0]; sq_dist = holderf.f[0]; target[0] = (holderf.f[1] < sq_dist) ? holderi.i[1] : target[0]; sq_dist = (holderf.f[1] < sq_dist) ? holderf.f[1] : sq_dist; target[0] = (holderf.f[2] < sq_dist) ? holderi.i[2] : target[0]; sq_dist = (holderf.f[2] < sq_dist) ? holderf.f[2] : sq_dist; target[0] = (holderf.f[3] < sq_dist) ? holderi.i[3] : target[0]; sq_dist = (holderf.f[3] < sq_dist) ? holderf.f[3] : sq_dist; } #endif /*LV_HAVE_SSE3*/ #ifdef LV_HAVE_GENERIC static inline void volk_32fc_index_min_32u_generic(uint32_t* target, const lv_32fc_t* source, uint32_t num_points) { float sq_dist = 0.0; float min = FLT_MAX; uint32_t index = 0; for (uint32_t i = 0; i < num_points; ++i) { sq_dist = lv_creal(source[i]) * lv_creal(source[i]) + lv_cimag(source[i]) * lv_cimag(source[i]); if (sq_dist < min) { index = i; min = sq_dist; } } target[0] = index; } #endif /*LV_HAVE_GENERIC*/ #endif /*INCLUDED_volk_32fc_index_min_32u_a_H*/ #ifndef INCLUDED_volk_32fc_index_min_32u_u_H #define INCLUDED_volk_32fc_index_min_32u_u_H #include <inttypes.h> #include <stdio.h> #include <volk/volk_common.h> #include <volk/volk_complex.h> #ifdef LV_HAVE_AVX2 #include <immintrin.h> #include <volk/volk_avx2_intrinsics.h> static inline void volk_32fc_index_min_32u_u_avx2_variant_0(uint32_t* target, const lv_32fc_t* source, uint32_t num_points) { const __m256i indices_increment = _mm256_set1_epi32(8); /* * At the start of each loop iteration current_indices holds the indices of * the complex numbers loaded from memory. Explanation for odd order is given * in implementation of vector_32fc_index_min_variant0(). */ __m256i current_indices = _mm256_set_epi32(7, 6, 3, 2, 5, 4, 1, 0); __m256 min_values = _mm256_set1_ps(FLT_MAX); __m256i min_indices = _mm256_setzero_si256(); for (unsigned i = 0; i < num_points / 8u; ++i) { __m256 in0 = _mm256_loadu_ps((float*)source); __m256 in1 = _mm256_loadu_ps((float*)(source + 4)); vector_32fc_index_min_variant0( in0, in1, &min_values, &min_indices, &current_indices, indices_increment); source += 8; } // determine minimum value and index in the result of the vectorized loop __VOLK_ATTR_ALIGNED(32) float min_values_buffer[8]; __VOLK_ATTR_ALIGNED(32) uint32_t min_indices_buffer[8]; _mm256_store_ps(min_values_buffer, min_values); _mm256_store_si256((__m256i*)min_indices_buffer, min_indices); float min = FLT_MAX; uint32_t index = 0; for (unsigned i = 0; i < 8; i++) { if (min_values_buffer[i] < min) { min = min_values_buffer[i]; index = min_indices_buffer[i]; } } // handle tail not processed by the vectorized loop for (unsigned i = num_points & (~7u); i < num_points; ++i) { const float abs_squared = lv_creal(*source) * lv_creal(*source) + lv_cimag(*source) * lv_cimag(*source); if (abs_squared < min) { min = abs_squared; index = i; } ++source; } *target = index; } #endif /*LV_HAVE_AVX2*/ #ifdef LV_HAVE_AVX2 #include <immintrin.h> #include <volk/volk_avx2_intrinsics.h> static inline void volk_32fc_index_min_32u_u_avx2_variant_1(uint32_t* target, const lv_32fc_t* source, uint32_t num_points) { const __m256i indices_increment = _mm256_set1_epi32(8); /* * At the start of each loop iteration current_indices holds the indices of * the complex numbers loaded from memory. Explanation for odd order is given * in implementation of vector_32fc_index_min_variant0(). */ __m256i current_indices = _mm256_set_epi32(7, 6, 3, 2, 5, 4, 1, 0); __m256 min_values = _mm256_set1_ps(FLT_MAX); __m256i min_indices = _mm256_setzero_si256(); for (unsigned i = 0; i < num_points / 8u; ++i) { __m256 in0 = _mm256_loadu_ps((float*)source); __m256 in1 = _mm256_loadu_ps((float*)(source + 4)); vector_32fc_index_min_variant1( in0, in1, &min_values, &min_indices, &current_indices, indices_increment); source += 8; } // determine minimum value and index in the result of the vectorized loop __VOLK_ATTR_ALIGNED(32) float min_values_buffer[8]; __VOLK_ATTR_ALIGNED(32) uint32_t min_indices_buffer[8]; _mm256_store_ps(min_values_buffer, min_values); _mm256_store_si256((__m256i*)min_indices_buffer, min_indices); float min = FLT_MAX; uint32_t index = 0; for (unsigned i = 0; i < 8; i++) { if (min_values_buffer[i] < min) { min = min_values_buffer[i]; index = min_indices_buffer[i]; } } // handle tail not processed by the vectorized loop for (unsigned i = num_points & (~7u); i < num_points; ++i) { const float abs_squared = lv_creal(*source) * lv_creal(*source) + lv_cimag(*source) * lv_cimag(*source); if (abs_squared < min) { min = abs_squared; index = i; } ++source; } *target = index; } #endif /*LV_HAVE_AVX2*/ #ifdef LV_HAVE_NEON #include <arm_neon.h> #include <volk/volk_neon_intrinsics.h> static inline void volk_32fc_index_min_32u_neon(uint32_t* target, const lv_32fc_t* source, uint32_t num_points) { const uint32_t quarter_points = num_points / 4; const lv_32fc_t* sourcePtr = source; uint32_t indices[4] = { 0, 1, 2, 3 }; const uint32x4_t vec_indices_incr = vdupq_n_u32(4); uint32x4_t vec_indices = vld1q_u32(indices); uint32x4_t vec_min_indices = vec_indices; if (num_points) { float min = FLT_MAX; uint32_t index = 0; float32x4_t vec_min = vdupq_n_f32(FLT_MAX); for (uint32_t number = 0; number < quarter_points; number++) { // Load complex and compute magnitude squared const float32x4_t vec_mag2 = _vmagnitudesquaredq_f32(vld2q_f32((float*)sourcePtr)); __VOLK_PREFETCH(sourcePtr += 4); // a < b? const uint32x4_t lt_mask = vcltq_f32(vec_mag2, vec_min); vec_min = vbslq_f32(lt_mask, vec_mag2, vec_min); vec_min_indices = vbslq_u32(lt_mask, vec_indices, vec_min_indices); vec_indices = vaddq_u32(vec_indices, vec_indices_incr); } uint32_t tmp_min_indices[4]; float tmp_min[4]; vst1q_u32(tmp_min_indices, vec_min_indices); vst1q_f32(tmp_min, vec_min); for (int i = 0; i < 4; i++) { if (tmp_min[i] < min) { min = tmp_min[i]; index = tmp_min_indices[i]; } } // Deal with the rest for (uint32_t number = quarter_points * 4; number < num_points; number++) { const float re = lv_creal(*sourcePtr); const float im = lv_cimag(*sourcePtr); const float sq_dist = re * re + im * im; if (sq_dist < min) { min = sq_dist; index = number; } sourcePtr++; } *target = index; } } #endif /*LV_HAVE_NEON*/ #endif /*INCLUDED_volk_32fc_index_min_32u_u_H*/
# REGRESIONES LINEALES de una variable data(cars) data plot(cars$speed,cars$dist) modelo <- lm(dist ~ speed, data = cars) summary(modelo) abline(modelo$coefficients[1], modelo$coefficients[2], col="red") # Predicción predict(modelo, data.frame(speed=100)) # Error cometido RMSE RMSE <- function(error){ sqrt(mean(error^2)) } # MAE mae <- function(error){ mean(abs(error)) } pr = predict (modelo,cars) error = pr-cars$dist modelo$residuals RMSE(error) mae(error) # Regersión Lineal de varias variables install.packages("carData") library(carData) data("Salaries") Salaries modelo2 <- lm(salary~sex, data=Salaries) # cocatenar sex+rank summary(modelo2) modelo2 <- lm(salary~., data=Salaries) summary(modelo2) predict(modelo2, data.frame(rank="Prof", discipline="A", yrs.since.phd=20, yrs.service=20, sex="Female"))
.. _quickstart/Animation: Animations with Dojo :Status: Draft :Version: 1.0 .. contents:: :depth: 2 Dojo provides several layers of Animation helpers, starting with Base Dojo (dojo.js), and adding in levels of incremental additions through the module system. All Animations in Dojo revolve around a single class: dojo._Animation. The underscore denotes a private constructor, and is not meant to be created directly, but rather used as the underlying control mechanism for the flexible FX API Dojo provides. Getting to know dojo._Animation As mentioned, dojo._Animation is the foundation for all Dojo Animations. It provides several simple methods good for controlling your animation, such as `play`, `pause`, `stop`, and `gotoPercent`. The most simple, and required of all animations is `play`: .. code-block :: javascript :linenos: var animation = dojo.fadeOut({ // returns a dojo._Animation // this is the "magic object" used to define the animation node:"aStringId" }); // call play() on the returned _Animation instance: animation.play(); If you are into chaining, and don't need the variable pointing to the animation instance, you can simply call .play() immediately after creation: .. code-block :: javascript :linenos: dojo.fadeOut({ node:"someId" }).play(); All Animations in Dojo (with the exception of dojo.anim, introduced in Dojo 1.2) use the "magic object" as a means of configuration. The `node:` parameter is the most important, and points to a node in the DOM on which to apply the animation. It can be a string ID of a DOM node, or a direct reference to a DOM node you already have: .. code-block :: javascript :linenos: var target = dojo.byId("someId").parentNode; dojo.fadeOut({ node: target }).play(); Animation Options, or "The Magic Object" ---------------------------------------- `TODOC:` node, delay, duration, rate, easing, events (onEnd, etc), repeat, curve `API reference for _Animation <http://api.dojotoolkit.org/jsdoc/dojo/1.2/dojo._Animation>`_ Animation Events ---------------- The next most important public-facing aspect of the "private" _Animation class is the event handling: stub functions fired at various stages of an animation's life-cycle. Consider this simple fade animation, and all the potential callbacks registered: .. code-block :: javascript :linenos: dojo.fadeOut({ // some node, by id to animate: node:"someId", beforeBegin: function(){ // executed synchronously before playing }, onBegin: function(){ // executed asynchronously immediately after starting }, onEnd: function(){ // executed when the animation is done }, onPlay: function(){ // executed when the animation is played }, onAnimate: function(values){ // fired for every step of the animation, passing // a value from a dojo._Line for this animation } }).play(); You can define them as part of the "magic object" used to define the animation initially (as seen above) or use :ref:`dojo.connect <dojo/connect>` to connect directly to the instance and listen for the function calls. .. code-block :: javascript :linenos: var animation = dojo.fadeOut({ node:"someNodebyId" }); dojo.connect(animation, "onEnd", function(){ // connect externally to this animation instance's onEnd function }); animation.play(); // start it up Base Animations Base Dojo provides the animation framework as well as several simple helper animations for fading, and one incredibly useful function `dojo.animateProperty` (the workhorse of most CSS-based animations). All use the same "magic object" for definition, though introduces several optioned in advanced cases. Fading Example -------------- To fade out a node, alter it's contents, and fade it back in: .. code-block :: javascript :linenos: var node = dojo.byId("someId"); dojo.fadeOut({ node: node, onEnd: function(){ node.innerHTML = "<p>Like magic!</p>" dojo.fadeIn({ node: node }).play() } }).play(); Here, we've created a fadeOut animation, and run it immediately. At the end of the animation (set here to use the default duration by omitting the `duration:` parameter), we set the node reference's `.innerHTML` property to something new, and fade it back in, again using the default duration. animateProperty Intro --------------------- `TODOC` Core Animations: Advanced helpers Above the Base Animations (those contained entirely within dojo.js), there are several modules available within the toolkit for advanced animation control. To use these extended functions, you must include the `dojo.fx` module: .. code-block :: javascript :linenos: dojo.require("dojo.fx"); The namespace `dojo.fx` has been reserved for all these animation, including `dojo.fx.chain` and `dojo.fx.combine`. Chaining and Combining Animations Two convenience functions provided in the `dojo.fx` module named `combine` and `chain` create an animation from a series of Animations in an array. `combine` merges the array of animations them into one `dojo._Animation` instance to control them all in parallel, whereas `chain` merges the animations into a single `dojo._Animation`, playing back each of the animations in series, or one right after the other. To fade out two nodes simultaneously: .. code-block :: javascript :linenos: dojo.require("dojo.fx"); dojo.addOnLoad(function(){ // create two animations var anim1 = dojo.fadeOut({ node: "someId" }); var anim2 = dojo.fadeOut({ node: "someOtherId" }); // and play them at the same moment dojo.fx.combine([anim1, anim2]).play(); }); (Notice we wraped the animation call in and addOnLoad function this time. This is required always, as you cannot modify the DOM before the DOM is ready, which :ref:`addOnLoad <dojo/addOnLoad>` alerts us to. Also, we need to ensure the `dojo.fx` module has been loaded properly) Javascript is rather flexible about return values and where functions are called. The above example can be written in a shorthand like: .. code-block :: javascript :linenos: dojo.require("dojo.fx"); dojo.addOnLoad(function(){ // create and play two fade animations at the same moment dojo.fx.combine([ dojo.fadeOut({ node: "someId" }), dojo.fadeOut({ node: "someOtherId" }) ]).play(); }); The same rules apply to a combined animation as do a normal _Animation, though with no direct way to mix event callbacks into the combine() call, you are left using the `dojo.connect` method to attach event handlers: .. code-block :: javascript :linenos: var anim = dojo.fx.combine([ dojo.fadeOut({ node: "id", duration:1000 }), dojo.fadeIn({ node: "otherId", duration:2000 }) ]); dojo.connect(anim, "onEnd", function(){ // fired after the full 2000ms }); Alternately, you can mix event handler into your individual animations passed to dojo.fx.combine: .. code-block :: javascript :linenos: var animA = dojo.fadeOut({ node:"someNode", duration: 500, onEnd: function(){ // fired after 500ms } }); var animB = dojo.fadeIn({ node:"otherNode" }); dojo.fx.combine([animA, animB]).play(); Chain works in much the same way - though plays each animation one right after the other: .. code-block :: javascript :linenos: dojo.fx.chain([ dojo.fadeIn({ node: "foo" }), dojo.fadeIn({ node: "bar" }) ]).play(); All of the same patterns apply to chain as to other dojo._Animation instances. A good article covering `advanced usage of combine and chain <http://dojocampus.org/content/2008/04/11/staggering-animations/>`_ is available at DojoCampus. combine and chain accept an Array, and will work on a one-element array. This is interesting because you can manually create animations, pushing each into the array, and chain or combine the resulting set of animations. This is useful when you need to conditionally exclude some Animations from being created: .. code-block :: javascript :linenos: // create the array var anims = []; // simulated condition, an array of id's: dojo.forEach(["one", "two", "three"], function(id){ if(id !== "two"){ // only animate id="one" and id="three" anims.push(dojo.fadeOut({ node: id })); } }); // combine and play any available animations waiting dojo.fx.combine(anims).play(); Obviously, any logic for determining if a node should participate in an Animation sequence is in the realm of the developer, but the syntax should be clear. Create an empty Array, push whichever style and types of animations you want into the Array, and call combine() on the list. Animation Easing `TODOC`
#define USECHRONO #include <cassert> #include <climits> #include <cstdlib> #include <stack> #include <map> #include <numeric> #include "eval.hpp" using namespace aed; using namespace std; /* COMIENZO DE DESCRIPCION __USE_WIKI__ #sum_sublist:# Implemente la funcion que dada una lista de enteros #L# y un entero #S,# encuentre y retorne una sublista cuya suma sea S. #discrete_moving_mean:# Implemente la funcion que dada una lista de enteros #L# y un entero #w,# retorne una lista con los valores de la media movil con ventana fija de tamano #w.# #d10s:# Implemente la funcion que reciba un AOO #T# y retorne el camino desde la raiz hasta el nodo con la etiqueta 10. #is_cycle:# Implemente una funcion que determine si el grafo #G# es un ciclo dirigido o no. #existe_subc:# Implementar una funcion que dado un conjunto #S# y un valor #n,# determine si existe un subconjunto de #S# para el cual la suma de sus elementos sea n. #replace_btree:# Implemente una funcion que busque los nodos que cumplan con la condicion #pred# y los reemplace por el primero de sus descendientes que no la cumpla. [Tomado en el TPL Recup de 2017-11-09]. keywords: arbol binario, arbol orientado, conjunto, lista, programacion funcional FIN DE DESCRIPCION */ //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> // sum_sublist (Valido para el TPL 1) list<int> sum_sublist(list<int>& L, int S){ list<int> R; if(S==0) return R; list<int>::iterator it = L.begin(); while(it!=L.end()){ int acum = 0; auto it2 = it; while(it2!=L.end()){ acum += *it2; if(acum==S){ R.insert(R.begin(),it,++it2); return R; } it2++; } it++; } return R; } //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> // discrete_moving_mean (Valido para el TPL 1) list<int> discrete_moving_mean(list<int>& L, int w){ list<int> R; list<int>::iterator it = L.begin(); list<int> Laux; for(;it!=L.end();it++){ Laux.push_back(*it); if(Laux.size()==w){ R.push_back(accumulate(Laux.begin(),Laux.end(),0)/w); Laux.pop_front(); } } return R; } //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> // d10s (Valido para el TPL 2) list<int> d10s(tree<int> &T, tree<int>::iterator nodo){ if(*nodo==10){ return {*nodo}; } tree<int>::iterator c = nodo.lchild(); while(c!=T.end()){ list<int> aux = d10s(T,c); if(aux.size()){ aux.push_front(*nodo); return aux; } c++; } return {}; } list<int> d10s(tree<int> &T){ return d10s(T,T.begin()); } //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> // is_cycle (Valido para el TPL 2) bool is_cycle(graph_t &G){ set<int> visited; int v = G.begin()->first; int first = v; while(visited.size()<G.size()){ if(visited.count(v)) return false; visited.insert(v); if(G[v].size()!=1) return false; v = *(G[v].begin()); } return (v==first); } //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> // existe_subc (Valido para el TPL 3) bool existe_subc(set<int>S,int n, set<int> S2){ if(S.empty()){ return (accumulate(S2.begin(),S2.end(),0)==n); } int x = *S.begin(); S.erase(x); if(existe_subc(S,n,S2)) return true; S2.insert(x); if(existe_subc(S,n,S2)) return true; return false; } bool existe_subc(set<int> &S, int n) { return existe_subc(S,n,{}); } //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> // replace_btree (Valido para el TPL 3) // Funcion auxiliar. // Encuentra el primer nodo que no cumple el pred btree<int>::iterator findX(btree<int>&T,btree<int>::iterator it,bt_fun_t f){ if(it==T.end()) return it; if(!f(*it)) return it; btree<int>::iterator itl,itr; itl = findX(T,it.left(),f); itr = findX(T,it.right(),f); if(itl != T.end()) return itl; else return itr; } void replaceBtree(btree<int>&T,btree<int>::iterator it,bt_fun_t f){ if(it==T.end()) return; if(f(*it)){ btree<int>::iterator aux = findX(T,it,f); if(aux != T.end()){ int remp = *aux; *it = remp; }else it = T.erase(it); } if(it != T.end()){ replaceBtree(T,it.left(),f); replaceBtree(T,it.right(),f); } } void replaceBtree(btree<int>&T,bt_fun_t f){ replaceBtree(T,T.begin(),f); } //---:---<*>---:---<*>---:---<*>---:---<*>---:---<*> int main() { Eval ev; int vrbs = 0; int seed = 123; int h1=0,h2=0,h3=0,h4,h5,h6; do { ev.eval<1>(sum_sublist,vrbs); h1 = ev.evalr<1>(sum_sublist,seed,vrbs); ev.eval<2>(discrete_moving_mean,vrbs); h2 = ev.evalr<2>(discrete_moving_mean,seed,vrbs); ev.eval<3>(d10s,vrbs); h3 = ev.evalr<3>(d10s,seed,vrbs); ev.eval<4>(is_cycle,vrbs); h4 = ev.evalr<4>(is_cycle,seed,vrbs); ev.eval<5>(existe_subc,vrbs); h5 = ev.evalr<5>(existe_subc,seed,vrbs); //ev.eval<6>(replace_btree,vrbs); //h6 = ev.evalr<6>(replace_btree,seed,vrbs); printf("S=%03d -> H1=%03d H2=%03d H3=%03d H4=%03d H5=%03d H6=%03d\n", seed,h1,h2,h3,h4,h5,h6); printf("\n\nIngrese un valor para la semilla:"); } while (cin>>seed); return 0; }
package days.year2023 import days.Day import kotlin.math.* fun main() { println(Day7().solve()) } class Day7 : Day(7, 2023) { fun solve(): Any { return inputList.map { getBestVersion(it) } .sortedWith(::customSortingFunction) .mapIndexed { i, it -> it.split(" ")[1].toLong() * (i + 1) }.sum() } private fun getBestVersion(it: String): String { val (hand, score) = it.split(" ") val comb = generateCombinations(hand) val best = comb.sortedWith(::customSortingFunction).last() return "$best $score $hand"; } fun generateCombinations(input: String): List<String> { val result = mutableListOf<String>() fun generateCombinationsRecursive(current: String, index: Int) { if (index == input.length) { result.add(current) return } if (input[index] == 'J') { for (char in "AKQT987654321") { generateCombinationsRecursive(current + char, index + 1) } } else { generateCombinationsRecursive(current + input[index], index + 1) } } generateCombinationsRecursive("", 0) return result } fun getScore(hand: String): Int { val cardCounts = mutableMapOf<Char, Int>() for (card in hand) { cardCounts[card] = cardCounts.getOrDefault(card, 0) + 1 } val sortedCounts = cardCounts.values.sortedDescending() return when (sortedCounts) { listOf(5) -> 6 listOf(4, 1) -> 5 listOf(3, 2) -> 4 listOf(3, 1, 1) -> 3 listOf(2, 2, 1) -> 2 listOf(2, 1, 1, 1) -> 1 else -> 0 } } fun customSortingFunction(card1: String, card2: String): Int { var hand1 = card1.split(" ")[0] var hand2 = card2.split(" ")[0] val score1 = getScore(hand1) val score2 = getScore(hand2) val order = "AKQT987654321J" if (score1 == score2) { if (card1.split(" ").size > 2) hand1 = card1.split(" ")[2] if (card2.split(" ").size > 2) hand2 = card2.split(" ")[2] for (i in 0..4) { val order1 = order.indexOf(hand1[i]) val order2 = order.indexOf(hand2[i]) if (order1 != order2) return order2 - order1 } } return score1 - score2 } }
const express = require('express'); const cookie = require('cookie-parser') const userOTP = require('../database/models/userOTP') const generateOTP= require('../utils/generateOTP') const router = express.Router(); const ErrorHandler = require("../utils/ErrorHandler"); const sendMail = require("../utils/mail"); const sendToken = require('../utils/usertoken'); const {User }= require('../database/models/user'); const resetPasswordOTP = require('../database/models/resetPasswordOTP') const {isAuthenticated} = require('../middleware/auth') const bcrypt = require('bcryptjs'); const catchAsyncErrors = require('../middleware/catchAsyncErrors') const jwt = require('jsonwebtoken') router.post('/create-user', catchAsyncErrors (async (req, res) => { try { const { Email, Password, } = req.body; if ( !Email || !Password ) { return res.status(400).json({ message: 'All required fields must be provided.' }); } const existingUser = await User.findOne({ where: { Email } }); if (existingUser) { return res.status(400).json({ message: 'Email already in use.' }); } const otpLength = 5; const generatedOTP = generateOTP(otpLength); const currentDate = new Date(); const expirationTime= new Date(currentDate); expirationTime.setMinutes(currentDate.getMinutes() + 3); await userOTP.create({ Email, Password, OTP: generatedOTP, createdAt: new Date(), expiresAt: expirationTime, }); const user= { Email, Password } res.cookie('userEmail',user.Email,{httpOnly:true}) try { await sendMail({ Email: user.Email, subject: "Activate your account", message: `Hello ${user.firstName}, this is your OTP code: ${generatedOTP} it expires in three minutes`, }); res.status(201).json({ success: true, message: `please check your email:- ${user.Email} for your OTP!`, }); } catch (error) { return next(new ErrorHandler(error.message, 500)); } } catch (error) { console.error("Error object:", error); console.error("Error message:", error.message); return (new ErrorHandler(error.message, 400)); } })); router.post('/activation', catchAsyncErrors(async (req, res, next) => { try { const { Email, OTP } = req.body; const otpRecords = await userOTP.findAll({ where: { email: Email } }); // Loop through the OTP records to verify and handle each one for (const otpRecord of otpRecords) { if (otpRecord.expiresAt < new Date()) { // Expired OTP, continue to the next OTP record continue; } if (otpRecord.OTP === OTP) { // Valid and unexpired OTP, handle it and break out of the loop const { Password} = otpRecord; let user = await User.findOne({ where: { Email } }); if (user) { return next(new ErrorHandler('User already exists', 400)); } // Create a new user record in the database user = await User.create({ Email, Password, }); // Remove the OTP record after it has been used await userOTP.destroy({where:{ Email }}); // Send a success response return res.status(201).json({ message: 'User created successfully.' }); } } // If the loop completes without a valid OTP, return an error response return res.status(400).json({ message: 'Invalid or expired OTP.' }); } catch (error) { return next(new ErrorHandler(error.message, 500)); } })); router.post( "/forget-password",catchAsyncErrors(async (req, res, next) => { try { const { Email } = req.body; let user = await User.findOne({ where: { Email } }); if (!user) { return next(new ErrorHandler("User do not exists", 400)); } const otpLength = 5; const generatedOTP = generateOTP(otpLength); const currentDate = new Date(); const expirationTime= new Date(currentDate); expirationTime.setMinutes(currentDate.getMinutes() + 3); await resetPasswordOTP.create({ Email, OTP: generatedOTP, createdAt: new Date(), expiresAt: expirationTime, }); const User1= { Email } res.cookie('userEmail',User1.Email,{httpOnly:true}) try { await sendMail({ Email: User1.Email, subject: "reset password", message: `Hello ${User1.firstName}, OTP has been sent to reset password: ${generatedOTP}`, }); res.status(201).json({ success: true, message: `please check your email:- ${User1.Email} for your reset password OTP`, }); } catch (error) { return next(new ErrorHandler(error.message, 500)); } } catch (error) { return next(new ErrorHandler(error.message, 500)); } }) ); router.put("/forget-password-activation", catchAsyncErrors(async (req, res, next) => { try { const { Password, confirmPassword, OTP } = req.body; if (Password !== confirmPassword) { return next( new ErrorHandler("Password doesn't match with each other!", 400) ); } const otpRecords = await resetPasswordOTP.findAll({ where: { OTP: OTP } }); let user; for (const otpRecord of otpRecords) { if (otpRecord.expiresAt < new Date()) { continue; } if (otpRecord.OTP === OTP) { user = await User.findOne({ where: { Email: otpRecord.Email } }); if (!user) { return next(new ErrorHandler('User does not exist', 400)); } const hashedPassword = await bcrypt.hash(Password, 10); user.Password = hashedPassword; await user.save(); await resetPasswordOTP.destroy({ where: { Email: otpRecord.Email } }); break; } } if (!user) { // No valid OTP was found return res.status(400).json({ message: 'Invalid or expired OTP.' }); } res.status(201).json({ success: true, }); } catch (error) { return next(new ErrorHandler(error.message, 500)); } })); router.put( "/personal-details", isAuthenticated, catchAsyncErrors(async (req, res, next) => { try { const { Email,PhoneNumber, firstName, lastName,Year_of_birth, Nationality,Gender, } = req.body; if (!firstName || !lastName || !Email || !Nationality || !Gender ||!PhoneNumber ||!Year_of_birth) { return res.status(400).json({ message: 'All required fields must be provided.' }); } const user = await User.findOne({where:{ Email }}) if (!user) { return next(new ErrorHandler("User not found", 400)); } user.firstName =firstName, user.lastName=lastName user.PhoneNumber=PhoneNumber user.Year_of_birth=Year_of_birth user.Nationality=Nationality user.Gender=Gender await user.save(); res.status(201).json({ success: true, user, }); } catch (error) { return next(new ErrorHandler(error.message, 500)); } }) ); router.post( "/login-user",catchAsyncErrors(async (req, res, next) => { try { const { Email, Password } = req.body; const user = await User.findOne( {where:{ email:Email }}) if (!Email || !Password) { return next(new ErrorHandler("Please provide the all fields!", 400)); } if (!user) { return next(new ErrorHandler("User doesn't exists!", 400)); } const PasswordValid = await user.comparePassword(Password); if (!PasswordValid) { return next(new ErrorHandler("password is incorrect", 400)); }; sendToken(user, 201, res); } catch (error) { return next(new ErrorHandler(error.message, 500)); } }) ); router.post('/resendotp', catchAsyncErrors(async (req, res) => { try { const Email = req.cookies.userEmail const existingUser = await userOTP.findOne({ where: { Email } }); if (!existingUser) { return res.status(400).json({ message: 'user doesnt exist go back to registration' }); } const otpLength = 5; const generatedOTP = generateOTP(otpLength); const currentDate = new Date(); const expirationTime= new Date(currentDate); expirationTime.setMinutes(currentDate.getMinutes() + 5); const { Password} = existingUser await userOTP.create({ Email, Password, OTP: generatedOTP, createdAt: new Date(), expiresAt: expirationTime, }); const user= { Email, Password, } try { await sendMail({ Email: user.Email, subject: "Activate your account", message: `Hello ${user.firstName}, this is your new OTP code: ${generatedOTP} it expires in three minutes`, }); res.status(201).json({ success: true, message: `please check your email:- ${user.Email} for your newOTP!`, }); } catch (error) { return next(new ErrorHandler(error.message, 500)); } } catch (error) { console.error("Error object:", error); console.error("Error message:", error.message); return (new ErrorHandler(error.message, 400)); } })); router.post('/resendotp-forget-password', catchAsyncErrors(async (req, res) => { try { const Email = req.cookies.userEmail const existingUser = await resetPasswordOTP.findOne({ where: { Email } }); if (!existingUser) { return res.status(400).json({ message: 'user doesnt exist go back to registration' }); } const otpLength = 5; const generatedOTP = generateOTP(otpLength); const currentDate = new Date(); const expirationTime= new Date(currentDate); expirationTime.setMinutes(currentDate.getMinutes() + 5); const { Password} = existingUser await resetPasswordOTP.create({ Email, Password, OTP: generatedOTP, createdAt: new Date(), expiresAt: expirationTime, }); const user= { Email, Password, } try { await sendMail({ Email: user.Email, subject: "forget password your account", message: `Hello ${user.firstName}, this is your new OTP code: ${generatedOTP} it expires in three minutes`, }); res.status(201).json({ success: true, message: `please check your email:- ${user.Email} for your newOTP!`, }); } catch (error) { return next(new ErrorHandler(error.message, 500)); } } catch (error) { console.error("Error object:", error); console.error("Error message:", error.message); return (new ErrorHandler(error.message, 400)); } })); router.get( "/getuser", isAuthenticated, catchAsyncErrors(async (req, res, next) => { try { const user = await User.findByPk(req.user.id); if (!user) { return next(new ErrorHandler("User doesn't exists", 400)); } res.status(200).json({ success: true, user, }); } catch (error) { return next(new ErrorHandler(error.message, 500)); } }) ); router.get( "/logout", catchAsyncErrors(async (req, res, next) => { try { res.cookie("token", null, { expires: new Date(Date.now()), httpOnly: true, sameSite: "none", secure: true, }); res.status(201).json({ success: true, message: "Log out successful!", }); } catch (error) { return next(new ErrorHandler(error.message, 500)); } }) ); module.exports = router;
# Use Case: Shopify Integration with Freshdesk - [Use Case: Shopify Integration with Freshdesk](#use-case-shopify-integration-with-freshdesk) - [Problem Statement](#problem-statement) - [Solution Overview](#solution-overview) - [Implementation Steps](#implementation-steps) - [Wireframe](#wireframe) - [Benefits](#benefits) ## Problem Statement - E-commerce businesses using Shopify may receive customer inquiries, order-related questions, or support requests through Freshdesk. - Manually accessing and retrieving order details from Shopify to address customer inquiries can be time-consuming and inefficient. - Integrating Shopify with Freshdesk can streamline support workflows and improve customer service by providing agents with access to real-time order information within Freshdesk. ## Solution Overview - Integrate Shopify with Freshdesk to enable support agents to retrieve order details, track shipments, and resolve customer inquiries directly from Freshdesk. - Utilize Freddy Copilot to simplify the integration process and accelerate app development. ## Implementation Steps 1. **Authentication and Setup**: - Authenticate with the Shopify API and obtain necessary credentials. - Configure access permissions and define default settings for order retrieval. 2. **Integration with Freshdesk**: - Use Freddy Copilot to access Freshdesk APIs and SDKs for ticket management and conversation handling. - Implement custom actions or triggers within Freshdesk to initiate order retrieval from Shopify. 3. **Retrieving Order Details**: - Integrate Shopify functionality within Freshdesk ticket interface. - Enable agents to retrieve order details by entering relevant order IDs or customer information directly from ticket conversations. 4. **Displaying Order Information**: - Display order details, including order status, items purchased, shipping information, etc., within Freshdesk ticket interface. - Ensure that agents have access to real-time order updates and tracking information to provide timely support to customers. 5. **Updating Order Status and Notes**: - Enable agents to update order status, add internal notes, or communicate with customers regarding order-related inquiries directly within Freshdesk. ## Wireframe ![Shopify Wireframe](../../assets/shopify/shopify-order-sample-wireframe.png) ## Benefits - **Improved Customer Service**: Agents can access real-time order information within Freshdesk, enabling them to provide faster and more accurate support to customers. - **Enhanced Efficiency**: Integration streamlines support workflows by eliminating the need for agents to switch between Freshdesk and Shopify platforms. - **Reduced Response Times**: Access to real-time order updates and tracking information enables agents to respond promptly to customer inquiries and address order-related issues effectively. - **Increased Customer Satisfaction**: Faster resolution of order-related inquiries leads to improved customer satisfaction and loyalty.
import cv2 import numpy as np import tensorflow as tf from keras.preprocessing.image import ImageDataGenerator # Cargar el modelo entrenado model = tf.keras.models.load_model('Entrenamientos/CNN_Modelo8.h5') # Abrir el archivo .mp4 video_path = 'Videos/Arma.mp4' cap = cv2.VideoCapture(video_path) # Crear el generador de datos para normalización data_gen = ImageDataGenerator( rotation_range=90, # Rango de rotación aleatoria de hasta 90 grados horizontal_flip=True # Reflejo horizontal aleatorio ) # Inicializar la ventana para mostrar el video cv2.namedWindow('Video', cv2.WINDOW_NORMAL) # Procesar el video fotograma por fotograma while cap.isOpened(): ret, frame = cap.read() if not ret: break # Redimensionar el fotograma a 150x150 píxeles frame = cv2.resize(frame, (150, 150)) # Normalizar la imagen frame = data_gen.standardize(np.array([frame])) # Realizar la inferencia con el modelo predictions = model.predict(frame) # Interpretar las predicciones class_index = np.argmax(predictions) class_labels = ['risk', 'no_risk' ] class_label = f"Clase predicha: {class_labels[class_index]}" # Dibujar el cuadro de texto en el fotograma cv2.putText(frame[0], class_label, (10, 30), cv2.FONT_HERSHEY_SIMPLEX, 0.3, (0, 0, 255), 2) cv2.imshow('Video', frame[0]) # Mostrar el fotograma if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()
<!DOCTYPE html> <html lang="ru"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> <link href="https://fonts.googleapis.com/css2?family=Raleway:wght@700&family=Roboto:wght@500;700;900&display=swap" rel="stylesheet"/> <link rel="stylesheet" href="./css/styles.css"/> </head> <body> <header> <nav> <a href="./index.html" class="upper-logo"> <span class="colortext">Web</span> Studio </a> <ul> <li ><a href="./index.html" class="current">Студия</a></li> <li><a href="./portfolio.html" class="site-nav">Портфолио</a></li> <li><a href="" class="site-nav">Контакты</a></li> </ul> </nav> <address> <ul class="site-nav-adress"> <li><a href="mailto:info@devstudio.com" >info@devstudio.com</a></li> <li><a href="tel:+380961111111" >+38 096 111 11 11</a></li> </ul> </address> </header> <main> <section class="hero"> <h1 class="hero-title">эффективные решения для вашего бизнеса</h1> <button type="button" class="button">Заказать услугу</button> </section> <section class="section"> <!--преимущества--> <ul class="advantages"> <li> <a href=""> <img src="./images/antenna.svg" class="icon" alt="Внимание к деталям"/> </a> <h3 class="advantages-title">Внимание к деталям</h3> <p class="advantages-text">Идейные соображения, а также начало повседневной работы по формированию позиции.</p> </li> <li> <img src="./images/clock.svg" class="icon" alt="Пунктуальность"/> <h3 class="advantages-title">Пунктуальность</h3> <p class="advantages-text">Задача организации, в особенности же рамки и место обучения кадров влечет за собой.</p> </li> <li> <img src="./images/pc.svg" class="icon" alt="Планирование"/> <h3 class="advantages-title">Планирование</h3> <p class="advantages-text">Равным образом консультация с широким активом в значительной степени обуславливает.</p> </li> <li> <img src="./images/astronaut.svg" class="icon" alt="Современные технологии"/> <h3 class="advantages-title">Современные технологии</h3> <p class="advantages-text">Значимость этих проблем настолько очевидна, что реализация плановых заданий.</p> </li> </ul> </section> <section class="section"> <h2 class="section-title">Чем мы занимаемся</h2> <ul> <li> <a href=""> <img src="./images/app1.jpg" alt="Десктопные приложения" width="380" height="294"/> </a> <h3 class="section-list">Десктопные приложения</h3> </li> <li> <a href=""> <img src="./images/app2.jpg" alt="Мобильные приложения" width="380" height="294"/> </a> <h3 class="section-list">Мобильные приложения</h3> </li> <li> <a href=""> <img src="./images/app3.jpg" alt="Дизайнерские решения" width="380" height="294"/> </a> <h3 class="section-list">Дизайнерские решения</h3> </li> </ul> </section> <section class="section-team"> <h2 class="section-title">Наша команда</h2> <ul class="team-names"> <li> <a href=""> <img src="./images/john_smith.jpg" alt="John Smith" width="278" height="260"/> </a> <h3>John Smith</h3> <p class="occupation">Product Designer</p> <ul> <li><a href="" class="social-links" aria-label="Instagram"></a></li> <li><a href="" class="social-links" aria-label="Twitter"></a></li> <li><a href="" class="social-links" aria-label="Facebook"></a></li> <li><a href="" class="social-links" aria-label="Linkedin"></a></li> </ul> </li> <li> <a href=""> <img src="./images/marta_stewart.jpg" alt="Marta Stewart" width="278" height="260"/> </a> <h3>Marta Stewart</h3> <p class="occupation">Frontend Developer</p> <ul> <li><a href="" class="social-links" aria-label="Instagram"></a></li> <li><a href="" class="social-links" aria-label="Twitter"></a></li> <li><a href="" class="social-links" aria-label="Facebook"></a></li> <li><a href="" class="social-links" aria-label="Linkedin"></a></li> </ul> </li> <li> <a href=""> <img src="./images/robert_jakis.jpg" alt="Robert Jakis" width="278" height="260"/> </a> <h3>Robert Jakis</h3> <p class="occupation">Marketing</p> <ul> <li><a href="" class="social-links" aria-label="Instagram"></a></li> <li><a href="" class="social-links" aria-label="Twitter"></a></li> <li><a href="" class="social-links" aria-label="Facebook"></a></li> <li><a href="" class="social-links" aria-label="Linkedin"></a></li> </ul> </li> <li> <a href=""> <img src="./images/martin_doe.jpg" alt="Martin Doe" width="278" height="260"/> </a> <h3>Martin Doe</h3> <p class="occupation">UI Designer</p> <ul> <li><a href="" class="social-links" aria-label="Instagram"></a></li> <li><a href="" class="social-links" aria-label="Twitter"></a></li> <li><a href="" class="social-links" aria-label="Facebook"></a></li> <li><a href="" class="social-links" aria-label="Linkedin"></a></li> </ul> </li> </ul> </section> <section > <h2 class="section-title">Постоянные клиенты</h2> <ul> <li class="section-companies"> <a href=""> <img src="./images/logo1.svg" alt="Ya&Co" /> </a> </li> <li class="section-companies"> <a href=""> <img src="./images/logo2.svg" alt="Company"/> </a> </li> <li class="section-companies"> <a href=""> <img src="./images/logo3.svg" alt="Company"/> </a> </li> <li class="section-companies"> <a href=""> <img src="./images/logo4.svg" alt="Foster Peters"/> </a> </li> <li class="section-companies"> <a href=""> <img src="./images/logo5.svg" alt="Brand"/> </a> </li> <li class="section-companies"> <a href=""> <img src="./images/logo6.svg" alt="Company"/> </a> </li> </ul> </section> </main> <footer class="footer"> <a href="./index.html" class="logo"> <span class="colortext">Web</span> Studio </a> <address class="adress"> <ul> <li> г. Киев, пр-т Леси Украинки, 26 <br> </li> <li> <a href="mailto:info@example.com" class="mail">info@example.com</a> <br> </li> <li> <a href="tel:+380991111111" class="mail">+38 099 111 11 11</a> </li> </ul> </address> <div > <b class="join">присоединяйтесь</b> <ul> <li><a href="" class="social-links" aria-label="Instagram"></a></li> <li><a href="" class="social-links" aria-label="Twitter"></a></li> <li><a href="" class="social-links" aria-label="Facebook"></a></li> <li><a href="" class="social-links" aria-label="Linkedin"></a></li> </ul> </div> <div> <b class="join">подписаться на рассылку</b><br> <button type="button" class="button-footer">Подписаться</button> </div> <div> <p class="dev">2020 Developed by GoIT Students </p> </div> </footer> </body> </html>
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>filters</title> <script type="text/javascript" src='js/vue.js'></script> <script> window.onload = function(){ //全局过滤器 //过滤器使用:{{}} v-bind Vue.filter('addZero',function(type){ return type<10 ? '0'+type : type; }); new Vue({ el:'#my', data:{ str:123, d:1556025620, }, filters:{ //局部过滤器 number:function(data,n){ //n参数 return data.toFixed(n); }, toShortShow:function(data,n){ if(data.length >=n){ var str = data.substr(0,n); return str +'...'; }else { return data; } }, date:function(data){ var d = new Date(data*1000); return d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate(); }, msg:function(data){ return data.replace(/world/,'guys'); } } }) } </script> </head> <body> <div id="my"> <h1> {{ 1 | addZero}}</h1> <div v-bind:id="1 | addZero"></div> <h1> {{ 3.1113325325 | number(2)}}</h1> <div> <input type="text" v-model="str" /> <span :title="str">{{str | toShortShow(10)}}</span> </div> <h1> {{d | date}}</h1> <div v-html="$options.filters.msg('<h1>hello world</h1>')"></div> </div> </body> </html>
using System.ComponentModel.DataAnnotations; namespace LeaveManagementWeb.Models { public class EmployeeListVM { public string Id { get; set; } [Display(Name = "First Name")] public string Firstname { get; set; } [Display(Name = "Last Name")] public string Lastname { get; set; } [Display(Name = "Date Joined")] [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}")] //The display format annotation helps to format the date to the required format [DataType(DataType.Date)] //This ensure datatype that we is displayed gets converted from datetime to date public DateTime DateJoined { get; set; } [Display(Name = "Email")] public string Email { get; set; } } }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="author" content="Stark"> <meta name="keywords" content="cars, automobiles, history, technology"> <meta name="description" content="Exploring the evolution of automobiles"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Evolution of Automobiles: From Past to Present</title> <!-- links --> <script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.12/typed.min.js"></script> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" /> <link rel="stylesheet" href="styles.css"> </head> <body> <div class="image"> <img src="./images/bugatti.jpeg"> </div> <div class="nav-content"> <a href="#introduction">Introduction</a> <a href="#history">History of Automobiles</a> <a href="#technology">Technological Advancements</a> <a href="#environment">Environmental Impact</a> <a href="#future">Future Trends</a> <a href="./contact.html">Contact</a> <a href="./learn.html">More</a> <!-- <button type="button" class="btn1">Contact</button> --> </div> <!-- navigation menu --> <div id="myNav" class="overlay"> <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">x</a> <div class="overlay-content"> <a href="#introduction">Introduction</a> <a href="#history">History of Automobiles</a> <a href="#technology">Technological Advancements</a> <a href="#environment">Environmental Impact</a> <a href="#future">Future Trends</a> <a href="./contact.html">Contact</a> <a href="./learn.html">More</a> <!-- <button type="button" class="btn1">Contact</button> --> </div> </div> <div class="hide"> <span style="font-size: 30px; cursor: pointer;" onclick="openNav()">&#9776;</span> </div> <main> <h1>Evolution of Automobiles: From Past to Present</h1> <section id="introduction"> <h2>Introduction</h2> <p> Automobiles have revolutionized the way we travel and interact with the world. Since the inception of the first automobile, these machines have not only transformed transportation but have also significantly impacted various aspects of our lives. This section explores the profound influence of automobiles on society, economy, and culture. </p> <img src="./images/bugatti.jpeg" class="automobile" alt=""> </section> <section id="history"> <h2>History of Automobiles</h2> <p> A fascinating journey spanning decades, the history of automobiles features many innovators, breakthroughs, and technological advancements. This is a succinct summary of significant turning points in the history of cars.Throughout the history of autos, there has been constant improvement, from the earliest steam-powered cars to the present day of electric and driverless vehicles. The travel business has changed significantly, impacting not only how individuals travel but also the economy, society, and culture. </p> <img src="./images/hist.jpg" class="automobile" alt=""> <p>The history of automobiles dates back to the late 19th century when Karl Benz patented the first gasoline-powered automobile. From the Model T to the modern-day sleek vehicles, automobiles have undergone remarkable transformations. Each era brought innovations, designs, and cultural shifts that shaped the automotive industry.</p> </section> <section id="technology"> <h2>Technological Advancements</h2> <p> The automotive industry is at the forefront of technological advancements. From hybrid engines to self-driving technology, the evolution of cars continues to push boundaries. Innovations in safety features, connectivity, and fuel efficiency are revolutionizing the driving experience, paving the way for a more efficient and intelligent automotive future. </p> <img src="./images/tech.jpeg" class="automobile" alt=""> </section> <section id="environment"> <h2>Environmental Impact</h2> <p>While automobiles have offered unparalleled convenience, they have also contributed to environmental challenges. The combustion engine's emissions and the dependence on fossil fuels have raised concerns about pollution and climate change. However, the rise of electric vehicles and sustainable mobility initiatives aim to mitigate these impacts and steer the industry toward eco-friendly alternatives.</p> <img src="./images/impact.png" class="automobile" alt=""> </section> <section id="future"> <h2>Future Trends</h2> <p>The future of automobiles holds exciting prospects. Advancements in electric and autonomous vehicles, along with developments in AI and smart infrastructure,...</p> <img src="./images/future.png" class="automobile" alt=""> <p> By 2030, societal anxiety and chaos are being driven by unrelenting technological evolution, causing cyber-crime, generational conflicts and class polarisation to increase. In addition to this, advancements in AI are threatening to markedly increase competition across humanity. Due to these pressures, consumers will demand spaces and experiences that alleviate their anxieties and provide healing qualities. Transport will no longer be simply a means of getting from A to B, but also a space for escapism, and the interior spaces of vehicles will be utilised according to user needs. </p> </section> </main> <!-- footer section --> <div class="footer"> <h5>You can also find us on social media</h5> <div class="icons"> <a href="#"><i class="fab fa-facebook-f"></i></a> <a href="#"><i class="fab fa-twitter"></i></a> <a href="#"><i class="fab fa-youtube"></i></a> <a href="#"><i class="fab fa-instagram"></i></a> </div> <div> <h5>This Website showcases <span class="typing"></span></h5> </div> <p>Copyright &copy; <span id="currentYear"></span> All Rights Reserved</p> </div> <script src="./index.js" async defer></script> </body> </html>
# Atividade 6 - Implemente o perceptron para identificar portas lógicas AND, NAND, OR e XOR. # Importings import numpy as np import os from time import sleep from tqdm import tqdm # Logic Gates truth tables # AND Gate - 0 0 = 0, 0 1 = 0, 1 0 = 0, 1 1 = 1 # NAND Gate - 0 0 = 1, 0 1 = 1, 1 0 = 1, 1 1 = 0 # OR Gate - 0 0 = 0, 0 1 = 1, 1 0 = 1, 1 1 = 1 # XOR Gate - 0 0 = 0, 0 1 = 1, 1 0 = 1, 1 1 = 0 class Perceptron: def __init__(self, num_inputs: list, epochs: int): self.weights = np.random.rand(num_inputs) self.bias = 0.0 self.epochs = epochs def step_function(self, x): return 1 if x >= 0 else 0 def train(self, inputs, outputs, learning_rate=0.1): for self.epoch in tqdm(range(1, self.epochs + 1), desc="Treinando", colour='green', unit=' Épocas'): for i in range(len(inputs)): input_data = inputs[i] target_output = outputs[i] weighted_sum = np.dot(input_data, self.weights) + self.bias output = self.step_function(weighted_sum) error = target_output - output self.weights += learning_rate * error * input_data self.bias += learning_rate * error # self.display_progress() def test(self, inputs): results = [] for input_data in inputs: weighted_sum = np.dot(input_data, self.weights) + self.bias output = self.step_function(weighted_sum) results.append(output) return results #def display_progress(self): # print(f"Epoch {self.epoch}/{self.epochs} - Weights: {self.weights}, Bias: {self.bias}") def main(): gate_types = ['AND', 'OR', 'NAND', 'XOR'] print("Escolha o tipo de porta lógica:") for i, gate in enumerate(gate_types, start=1): print(f"{i}. {gate}") choice = int(input("Digite o número correspondente: ")) epochs = int(input("Digite o número de épocas: ")) if choice < 1 or choice > len(gate_types): print("Escolha inválida. Saindo...") exit() selected_gate = gate_types[choice - 1] if selected_gate == 'AND': outputs = np.array([0, 0, 0, 1]) elif selected_gate == 'OR': outputs = np.array([0, 1, 1, 1]) elif selected_gate == 'NAND': outputs = np.array([1, 1, 1, 0]) elif selected_gate == 'XOR': outputs = np.array([0, 1, 1, 0]) inputs = np.array([[0, 0], [0, 1], [1, 0], [1, 1]]) perceptron = Perceptron(num_inputs=len(inputs[0]), epochs=epochs) perceptron.train(inputs, outputs) results = perceptron.test(inputs) print(f"\nPorta selecionada: {selected_gate}\n") print(f'Predições: {results}') print(f'Valores esperados: {outputs}') print(f'Pesos: {perceptron.weights}') print(f'Viés: {perceptron.bias}') sleep(10) os.system('cls' if os.name == 'nt' else 'clear') if __name__ == "__main__": while True: main()
import * as child_process from "child_process"; import { Component } from "projen"; import { NodeProject } from "projen/lib/javascript"; import * as shell from "shelljs"; import "shelljs-plugin-authors"; import { DeepRequired } from "../util/deep-required"; import { Dynamic, resolve } from "../util/dynamic"; import { Entity } from "./organisational"; /** * Contributors options */ export type ContributorsOptions = { contributors?: boolean; autoPopulateFromGit?: boolean; additionalContributors?: (string | Entity)[]; }; /** * The `Contributors` component adds contributor information to the project */ export class Contributors extends Component { static defaultOptions: DeepRequired<ContributorsOptions> = { contributors: true, autoPopulateFromGit: true, additionalContributors: [], }; contributors: Set<string | Entity>; options: DeepRequired<ContributorsOptions>; nodeProject: NodeProject; //options: ContributorsOptions; /** * creates the contributors component * * @param project the project to add to * @param options options */ constructor( project: NodeProject, options?: Dynamic<ContributorsOptions, NodeProject> ) { super(project); this.nodeProject = project; this.options = resolve(project, options, Contributors.defaultOptions); this.contributors = new Set<string | Entity>(); if (this.options.autoPopulateFromGit) { // If we don't have the full depth and cannot // get the full author list, so convert to full depth child_process.execSync( "if [ $(git rev-parse --is-shallow-repository) = true ];then git fetch --unshallow; fi" ); const authors = (shell as any).default.authors(); this.contributors = new Set<string | Entity>([ ...this.options.additionalContributors, ...authors.stdout.split("\n"), ]); /* istanbul ignore next */ if (process.env.CI === undefined || !process.env.CI) { this.contributors.add( `${child_process .execSync("git config user.name") .toString() .trim()} <${child_process .execSync("git config user.email") .toString() .trim()}>` ); } } else { this.contributors = new Set<string | Entity>( this.options.additionalContributors ); } } /** * adds the contributors to the package.json file. */ preSynthesize(): void { if (this.options.contributors && this.contributors.size > 0) { this.nodeProject.package.addField("contributors", [...this.contributors]); } } /** * adds contributors to the project * * @param {...any} contributors the contributors to add */ addContributors(...contributors: (string | Entity)[]): void { this.contributors = new Set([...this.contributors, ...contributors]); } }
code 1) public class Multithread1 extends Thread { public void run() { try { System.out.println("thread is executing now........"); } catch (Exception e) { } } public static void main(String[] args) { Multithread1 m1 = new Multithread1(); m1.start(); m1.start(); } } Output: thread is executing now........Exception in thread "main" java.lang.IllegalThreadStateException at java.base/java.lang.Thread.start(Unknown Source) at Multithread1.main(Multithread1.java:11) code 2) import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; public class TestThread { public static void main(final String[] arguments) throws InterruptedException { ExecutorService e = Executors.newSingleThreadExecutor(); try { e.submit(new Thread()); System.out.println("Shutdown executor"); e.shutdown(); e.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException ex) { System.err.println("tasks interrupted"); } finally { if (!e.isTerminated()) { System.err.println("cancel non-finished tasks"); } e.shutdownNow(); System.out.println("shutdown finished"); } } static class Task implements Runnable { public void run() { try { Long duration = (long)(Math.random() * 20); System.out.println("Running Task!"); TimeUnit.SECONDS.sleep(duration); } catch (InterruptedException ex) { ex.printStackTrace(); } } } } Output: Shutdown executor shutdown finished code 3): import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import java.util.logging.Level; import java.util.logging.Logger; public class ProducerConsumerProblem { public static void main(String args[]) { BlockingQueue sharedQueue = new LinkedBlockingQueue(); Thread prod = new Thread(new Producer(sharedQueue)); Thread cons = new Thread(new Consumer(sharedQueue)); prod.start(); cons.start(); } } class Producer implements Runnable { private final BlockingQueue sharedQueue; public Producer(BlockingQueue sharedQueue) { this.sharedQueue = sharedQueue; } @Override public void run() { for (int i = 0; i < 10; i++) { try { System.out.println("Produced: " + i); sharedQueue.put(i); } catch (InterruptedException ex) { Logger.getLogger(Producer.class.getName()).log(Level.SEVERE, null, ex); } } } } class Consumer implements Runnable { private final BlockingQueue sharedQueue; public Consumer(BlockingQueue sharedQueue) { this.sharedQueue = sharedQueue; } @Override public void run() { while (true) { try { System.out.println("Consumed: " + sharedQueue.take()); } catch (InterruptedException ex) { Logger.getLogger(Consumer.class.getName()).log(Level.SEVERE, null, ex); } } } } Output: Produced: 0 Produced: 1 Produced: 2 Produced: 3 Produced: 4 Produced: 5 Produced: 6 Produced: 7 Produced: 8 Produced: 9 Consumed: 0 Consumed: 1 Consumed: 2 Consumed: 3 Consumed: 4 Consumed: 5 Consumed: 6 Consumed: 7 Consumed: 8 Consumed: 9 code 4) import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; public class TestThread { public static void main(final String[] arguments) throws InterruptedException { Executor e = Executors.newCachedThreadPool(); e.execute(new Thread()); ThreadPoolExecutor pool = (ThreadPoolExecutor)e; pool.shutdown(); } static class Thread implements Runnable { public void run() { try { Long duration = (long)(Math.random() * 5); System.out.println("Running Thread!"); TimeUnit.SECONDS.sleep(duration); System.out.println("Thread Completed"); } catch (InterruptedException ex) { ex.printStackTrace(); } } } } Output: Running Thread! Thread Completed code 5)
/* Copyright 2008, 2009 (C) Nicira, Inc. * * This file is part of NOX. * * NOX is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * NOX is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with NOX. If not, see <http://www.gnu.org/licenses/>. */ #ifndef CONNECTION_HH #define CONNECTION_HH 1 #include <string> #include <boost/aligned_storage.hpp> #include <boost/asio.hpp> #include <boost/enable_shared_from_this.hpp> #include <boost/function.hpp> #include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> namespace vigil { // Class to manage the memory to be used for handler-based custom allocation. // It contains a single block of memory which may be returned for allocation // requests. If the memory is in use when an allocation request is made, the // allocator delegates allocation to the global heap. class handler_allocator : private boost::noncopyable { public: handler_allocator() { in_use_ = false; } void* allocate(std::size_t size) { if (!in_use_ && size < storage_.size) { in_use_ = true; return storage_.address(); } return ::operator new(size); } void deallocate(void* pointer) { if (pointer == storage_.address()) { in_use_ = false; return; } ::operator delete(pointer); } private: std::size_t count; // Storage space used for handler-based custom memory allocation. boost::aligned_storage<1024> storage_; // Whether the handler-based custom allocation storage has been used. bool in_use_; }; /* Abstract class for a connection */ class Connection : public boost::enable_shared_from_this<Connection>, private boost::noncopyable { public: typedef boost::function<void()> Close_callback; typedef boost::function<void(const size_t&)> Recv_callback; typedef boost::function<void(const size_t&)> Send_callback; Connection(); virtual ~Connection() {} virtual void register_cb(Close_callback&, Recv_callback&, Send_callback&) = 0; virtual void close(const boost::system::error_code&); virtual void send(const boost::asio::streambuf&) = 0; virtual void recv(boost::asio::mutable_buffers_1) = 0; virtual std::string to_string() = 0; protected: Close_callback close_cb; Recv_callback recv_cb; Send_callback send_cb; handler_allocator rx_allocator_; handler_allocator tx_allocator_; }; /* Wrapper for carrying traffic over a stream connection, * e.g. TCP or SSL. */ template <typename Async_stream> class Stream_connection : public Connection { public: Stream_connection(boost::shared_ptr<Async_stream>); ~Stream_connection(); boost::shared_ptr<Stream_connection> shared_from_this() { return boost::static_pointer_cast<Stream_connection>( Connection::shared_from_this()); } boost::shared_ptr<Stream_connection const> shared_from_this() const { return boost::static_pointer_cast<Stream_connection const>( Connection::shared_from_this()); } virtual void register_cb(Close_callback&, Recv_callback&, Send_callback&); virtual void close(const boost::system::error_code&); virtual void send(const boost::asio::streambuf&); virtual void recv(boost::asio::mutable_buffers_1); virtual std::string to_string(); private: boost::shared_ptr<Async_stream> stream; boost::asio::strand strand; size_t tx_bytes; size_t rx_bytes; void handle_recv(const boost::system::error_code&, const size_t&); void handle_send(const boost::system::error_code&, const size_t&); }; } // namespace vigil #endif
import React, {useState} from 'react'; import {Box, CircularProgress, useMediaQuery, Typography} from '@mui/material'; import { useSelector } from 'react-redux'; import { useGetMoviesQuery } from '../../services/TMDB'; import { MovieList, Pagination, FeaturedMovie } from '..'; const Movies = () => { const [page, setPage] = useState(1); const {genreIdOrCategoryName, searchQuery} = useSelector((state) => state.currentGenreOrCategory); const {data, error, isFetching} = useGetMoviesQuery({genreIdOrCategoryName, page, searchQuery}); const lg = useMediaQuery((theme) => theme.breakpoints.only('lg')); const numberOfMovies = lg ? 17 : 19; if(isFetching){ return( <Box display='flex' justifyContent="center"> <CircularProgress size="4rem"/> </Box> ); } if(!data.results.length){ return ( <Box display="flex" alignItems="center" mt="20px"> <Typography variant="h4"> No movies that match that name. <br /> Please search for something else. </Typography> </Box> ) } if (error) return 'An error has happened.'; return ( <div> <FeaturedMovie movie={data.results[0]}/> <MovieList movies={data} numberOfMovies={numberOfMovies} excludeFirst /> <Pagination currentPage={page} setPage={setPage} totalPages={data.total_pages}/> </div> ) } export default Movies
{% extends 'base.html' %} {% load static %} {% block content %} <section class="section-content padding-y bg"> <div class="container"> <div class="card"> <div class="row no-gutters"> <aside class="col-md-6"> <article class="gallery-wrap"> <div class="img-big-wrap mainImage"> <center> <img src="{{single_product.image.url}}" /> </center> </div> <!-- img-big-wrap.// --> </article> <!-- gallery-wrap .end// --> <ul class="thumb"> <li> <a href="{{img.image.url}}" target="mainImage"> <img src="{{single_product.image.url}}" alt="Prouct Image"> {% for img in product_gallery %} <a href="{{img.image.url}}" target="mainImage"> <img src="{{img.image.url}}" alt="Prouct Image"> </a> {% endfor %} </li> </ul> </aside> <main class="col-md-6 border-left"> <form action="{% url 'add_cart' single_product.id %}" method="post"> {% csrf_token %} <article class="content-body"> <h2 class="title">{{single_product.product_name}}</h2> <!-- avg rating --> <div class="rating-star"> <span> <i class="fa fa-star{% if single_product.averageReview < 0.5 %}-o{% elif single_product.averageReview >= 0.5 and single_product.averageReview < 1 %}-half-o {% endif %} "></i> <i class="fa fa-star{% if single_product.averageReview < 1.5 %}-o{% elif single_product.averageReview >= 1.5 and single_product.averageReview < 2 %}-half-o {% endif %} "></i> <i class="fa fa-star{% if single_product.averageReview < 2.5 %}-o{% elif single_product.averageReview >= 2.5 and single_product.averageReview < 3 %}-half-o {% endif %} "></i> <i class="fa fa-star{% if single_product.averageReview < 3.5 %}-o{% elif single_product.averageReview >= 3.5 and single_product.averageReview < 4 %}-half-o {% endif %} "></i> <i class="fa fa-star{% if single_product.averageReview < 4.5 %}-o{% elif single_product.averageReview >= 4.5 and single_product.averageReview < 5 %}-half-o {% endif %} "></i> <!-- we are using < and > because avg can be anything like 3.78 --> </span> </div> <div class="mb-3"> <var class="price h4">${{single_product.price}}</var> </div> <p>{{single_product.Description}}</p> <hr /> <div class="row"> <div class="item-option-select"> <h6>Choose Color</h6> <select name="color" id="" class="form-control" required> <option value="" disabled selected>select</option> {% for i in single_product.variation_set.colors %} <option value="{{ i.variation_value | lower }}">{{ i.variation_value | capfirst }}</option> {% endfor %} </select> </div> </div> <!-- row.// --> <div class="row"> <div class="item-option-select"> <h6>Select Size</h6> <select name="size" id="" class="form-control"> <option value="" disabled selected>select</option> {% for i in single_product.variation_set.sizes %} <option value="{{ i.variation_value | lower }}">{{ i.variation_value | capfirst}}</option> {% endfor %} </select> </div> </div> <!-- row.// --> <hr /> {% if single_product.stock <= 0 %} <h5 class="text-danger">Out of Stock</h5> {% else %} <button type="submit" class="btn btn-primary"> <span class="text">Add to cart</span> <i class="fas fa-shopping-cart"></i> </button> {% endif %} </article> <!-- product-info-aside .// --> </form> </main> <!-- col.// --> </div> <!-- row.// --> </div> <!-- card.// --> <br /> <div class="row"> <div class="col-md-9"> {% comment %} modelform {% endcomment %} <form action="{% url 'submit_review' single_product.id %}" method="POST"> {% csrf_token %} <h5>Write Your Review</h5> {{single_product.averageReview}} <div> <!-- Rating stars --> <label for="">How to you rate this product?</label> <br> <div class="rate"> <input type="radio" name="rating" id="rating10" value="5" required> <label for="rating10" title="5"></label> <input type="radio" name="rating" id="rating9" value="4.5" required> <label for="rating9" title="4.5" class="half"></label> <input type="radio" name="rating" id="rating8" value="4" required> <label for="rating8" title="4"></label> <input type="radio" name="rating" id="rating7" value="3.5" required> <label for="rating7" title="3.5" class="half"></label> <input type="radio" name="rating" id="rating6" value="3" required> <label for="rating6" title="3"></label> <input type="radio" name="rating" id="rating5" value="2.5" required> <label for="rating5" title="2.5" class="half"></label> <input type="radio" name="rating" id="rating4" value="2" required> <label for="rating4" title="2"></label> <input type="radio" name="rating" id="rating3" value="1.5" required> <label for="rating3" title="1.5" class="half"></label> <input type="radio" name="rating" id="rating2" value="1" required> <label for="rating2" title="1"></label> <input type="radio" name="rating" id="rating1" value="0.5" required> <label for="rating1" title="0.5" class="half"></label> </div> <br> Review Tite : <input type="text" name="subject" class="form-control" id=""> <br> <textarea name="review" class="form-control" rows="4"></textarea> <br> {% if user.is_authenticated %} {% if ordered_product %} <input type="submit" value="Submit Review" class="btn btn-primary"> {% else %} <p>You must purchase this product to post your review .</p> {% endif %} {% else %} <p>You must login to post your review . <span> <a href="{% url 'login' %}">Login now</a></span> </p> {% endif %} </div> </form> <br> {% include "includes/alerts.html" %} <header class="section-heading"> <h3>Customer Reviews</h3> <div class="rating-star"> <span> <i class="fa fa-star{% if single_product.averageReview < 0.5 %}-o{% elif single_product.averageReview >= 0.5 and single_product.averageReview < 1 %}-half-o {% endif %} "></i> <i class="fa fa-star{% if single_product.averageReview < 1.5 %}-o{% elif single_product.averageReview >= 1.5 and single_product.averageReview < 2 %}-half-o {% endif %} "></i> <i class="fa fa-star{% if single_product.averageReview < 2.5 %}-o{% elif single_product.averageReview >= 2.5 and single_product.averageReview < 3 %}-half-o {% endif %} "></i> <i class="fa fa-star{% if single_product.averageReview < 3.5 %}-o{% elif single_product.averageReview >= 3.5 and single_product.averageReview < 4 %}-half-o {% endif %} "></i> <i class="fa fa-star{% if single_product.averageReview < 4.5 %}-o{% elif single_product.averageReview >= 4.5 and single_product.averageReview < 5 %}-half-o {% endif %} "></i> <!-- we are using < and > because avg can be anything like 3.78 --> <span> {{ single_product.countReviews }} reviews</span> </span> </div> </header> {% for review in reviews %} <article class="box mb-3"> <div class="icontext w-100"> <!-- <img src="{% static 'images/avatars/avatar1.jpg' %}" class="img-xs icon rounded-circle" /> --> <!-- {{review.rating}} --> <div class="text"> <span class="date text-muted float-md-right">{{review.modified_date}} </span> <h6 class="mb-1">{{review.user.full_name}}</h6> <div class="rating-star"> <span> <i class="fa fa-star{% if review.rating == 0.5 %}-half-o{% elif review.rating < 1 %}-o {% endif %} "></i> <i class="fa fa-star{% if review.rating == 1.5 %}-half-o{% elif review.rating < 2 %}-o {% endif %} "></i> <i class="fa fa-star{% if review.rating == 2.5 %}-half-o{% elif review.rating < 3 %}-o {% endif %} "></i> <i class="fa fa-star{% if review.rating == 3.5 %}-half-o{% elif review.rating < 4 %}-o {% endif %} "></i> <i class="fa fa-star{% if review.rating == 4.5 %}-half-o{% elif review.rating < 5 %}-o {% endif %} "></i> </span> </div> </div> </div> <!-- icontext.// --> <div class="mt-3"> <h6>{{review.subject}}</h6> <p> {{review.review}} </p> </div> </article> {% endfor %} </div> <!-- col.// --> </div> <!-- row.// --> </div> <!-- container .// --> </section> {% endblock content %}
import React, { memo, useMemo } from "react"; import { TouchableOpacity, View } from "react-native"; import { useNavigation } from "@react-navigation/native"; import moment from "moment"; import Config from "react-native-config"; import FastImage from "react-native-fast-image"; import { useTheme } from "react-native-paper"; import { useSelector } from "react-redux"; import tagsCardStyles from "./TagsCard.styles"; import { PostType } from "./TagsCard.types"; import { RootState } from "~/redux/store"; import { CText, Icon, IconTypes, RatingBar } from "~/components/"; import { Favourite } from "~/components/property"; import { getPropertyById } from "~/redux/selectors"; import { AppStackRoutesCityCountryRegionProps } from "~/router/AppStackRoutes/AppStackRoutes.type"; import { logEvent, NAVIGATE_TO_CITY_COUNTRY_REGION, NAVIGATE_TO_PROPERTY } from "~/services/"; import { moderateScale, scale } from "~/utils/"; const ANALYTICS_SOURCE = "post_tag_card"; const TagsCard = (props: PostType): JSX.Element => { const { tag: _tag, tagsLength = 1, index = 0, isInsidePostDetails = false } = props; const propertyByIdSelector = useMemo(() => getPropertyById(_tag.pkey), [_tag.pkey]); const property = useSelector((state: RootState) => _tag?.type === "property" ? propertyByIdSelector(state) : null ); const tag = property || _tag; const { colors } = useTheme(); const navigation = useNavigation<AppStackRoutesCityCountryRegionProps["navigation"]>(); const language = useSelector((state: RootState) => state.settings.language || "ar"); const { containerStyle, imageStyle, ratingAndNameContainerStyle, favouriteIconStyle, lastTagContainerStyle } = tagsCardStyles(colors, moderateScale(60), moderateScale(80), tagsLength); const handleTagPressed = async () => { const { type, slug, title } = tag; if (property || type === "property") { await logEvent(NAVIGATE_TO_PROPERTY, { source: ANALYTICS_SOURCE, slug, is_inside_post_details: isInsidePostDetails }); return navigation.navigate({ name: "Property", params: { slug }, key: `${moment().unix()}` }); } await logEvent(NAVIGATE_TO_CITY_COUNTRY_REGION, { source: ANALYTICS_SOURCE, title, slug, type, is_inside_post_details: isInsidePostDetails }); navigation.navigate({ name: "CityCountryRegion", params: { title, slug, type }, key: `${moment().unix()}` }); }; const tagContainerStyles = [ containerStyle, tagsLength - 1 === index ? lastTagContainerStyle : {} ]; return ( <TouchableOpacity style={tagContainerStyles} onPress={handleTagPressed}> <FastImage style={imageStyle} source={{ uri: `${Config.CONTENT_MEDIA_PREFIX}/${tag.featured_image?.image_uuid}_sm.jpg` }} /> <View style={ratingAndNameContainerStyle}> <CText fontSize={12}>{_tag?.title[language]}</CText> {tag?.type === "city" && ( <CText fontSize={11} color="gray" fontFamily="light"> {tag?.country?.name} </CText> )} {_tag?.type === "property" && ( <RatingBar disabled ratingCount={5} defaultValue={tag.rate?.rating} size={scale(16)} spacing={2} /> )} </View> {_tag?.type === "property" && ( <View style={favouriteIconStyle}> <Favourite size={moderateScale(22)} color={colors.grayBB} isFavorite={!!tag?.is_favorite} pkey={tag?.pkey} /> </View> // <TouchableOpacity style={favouriteIconStyle}> // <Icon // type={IconTypes.MATERIAL_ICONS} // name={tag?.is_favorite ? "favorite" : "favorite-border"} // size={22} // color={tag?.is_favorite ? colors.darkRed : colors.text} // /> // </TouchableOpacity> )} </TouchableOpacity> ); }; export default memo(TagsCard);
<?php declare(strict_types=1); namespace App\Entity; use App\Repository\CurrencyRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; #[ORM\Entity(repositoryClass: CurrencyRepository::class)] class Currency { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 4)] private ?string $currencyCode = null; #[ORM\Column(length: 255)] private ?string $currencyName = null; #[ORM\Column(length: 10, nullable: true)] private ?string $symbol = null; #[ORM\ManyToMany(targetEntity: Country::class, inversedBy: 'currencies')] private Collection $countries; public function __construct() { $this->countries = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getCurrencyCode(): ?string { return $this->currencyCode; } public function setCode(string $currencyCode): static { $this->currencyCode = $currencyCode; return $this; } public function getCurrencyName(): ?string { return $this->currencyName; } public function setCurrencyName(string $currencyName): static { $this->currencyName = $currencyName; return $this; } public function getSymbol(): ?string { return $this->symbol; } public function setSymbol(?string $symbol): static { $this->symbol = $symbol; return $this; } /** * @return Collection<int, Country> */ public function getCountries(): Collection { return $this->countries; } public function addCountry(Country $country): static { if (!$this->countries->contains($country)) { $this->countries->add($country); } return $this; } public function removeCountry(Country $country): static { $this->countries->removeElement($country); return $this; } }
#!/usr/bin/python3 ''' module to check if the object is an instance of a class that inherited (directly or indirectly) from the specified class ''' def inherits_from(obj, a_class): """ Args: obj: The object to be checked. a_class: The class to compare the object with. Returns: bool: True if the object is an instance of a subclass of the specified class; otherwise, False. """ return issubclass(type(obj), a_class) and type(obj) != a_class
const userModel = require("../models/userModel"); const bcrypt = require('bcrypt'); //get all users exports.getAllUsers = async (req, res) => { try { const users = await userModel.find({}); return res.status(200).send({ userCount: users.length, success: true, message: "all users data", users, }); } catch (error) { console.log(error); return res.status(500).send({ success: false, message: "Error In Getting All Users", error, }); } }; //create/register user exports.registerUser = async (req, res) => { try { const { username, email, password } = req.body; //validation if (!username || !email || !password) { return res.status(400).send({ success: false, message: "Please Fill all fields", }); } //exisiting user const exisitingUser = await userModel.findOne({ email }); if (exisitingUser) { return res.status(401).send({ success: false, message: "user already exisits", }); } const hashedPassword = await bcrypt.hash(password, 10); //save new user const user = new userModel({username, email, password: hashedPassword}); await user.save(); return res.status(200).send({ success: true, message:'New User Created', user }) } catch (error) { console.log(error); return res.status(500).send({ message: "Error in registering user", success: false, error, }); } }; //login user exports.loginUser = async (req, res) => { try { const { email, password } = req.body; //validation if (!email || !password) { return res.status(401).send({ success: false, message: "Please provide email or password", }); } //check if registered or not const user = await userModel.findOne({ email }); if (!user) { return res.status(200).send({ success: false, message: "email is not registered", }); } //password const isMatch = await bcrypt.compare(password, user.password); if (!isMatch) { return res.status(401).send({ success: false, message: "Invalid username or password", }); } return res.status(200).send({ success: true, messgae: "login successfully", user, }); } catch (error) { console.log(error); return res.status(500).send({ success: false, message: "Error In Login Callback", error, }); } };
import React, { useState, useEffect } from 'react'; import { Link } from 'react-router-dom'; import './Quiz.css'; function Quiz({ quizData }) { const [selectedAnswer, setSelectedAnswer] = useState(null); const [message, setMessage] = useState(''); const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0); const [correctCount, setCorrectCount] = useState(0); // Counter for correct guesses const [incorrectCount, setIncorrectCount] = useState(0); const [pointCount, setPointCount] = useState(0); const [gameEnded, setGameEnded] = useState(false); const [incorrectSelection, setIncorrectSelection] = useState(false); const maxIncorrectGuesses = 3; // Shuffle the quizData to randomize question order (only on initial load) useEffect(() => { shuffleQuizData(); }, []); // Shuffle the quizData array const shuffleQuizData = () => { const shuffledData = [...quizData]; for (let i = shuffledData.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [shuffledData[i], shuffledData[j]] = [shuffledData[j], shuffledData[i]]; } return shuffledData; }; const handleAnswerClick = (option, correctAnswer, points) => { if (option === correctAnswer) { setMessage('Correct!'); setCorrectCount(correctCount + 1); // Increment correct count //setPointCount(pointCount + 100); // Increment point count by fixed temp amount setPointCount(pointCount + points); // Increment point count by question points } else { setMessage('Sorry, the correct answer was ' + correctAnswer); setIncorrectCount(incorrectCount + 1); // Increment incorrect count // Set a flag to indicate incorrect selection for this question setIncorrectSelection(true); if (incorrectCount + 1 === maxIncorrectGuesses) { // If the player reaches the maximum incorrect guesses, trigger end of the game endGame(); } } setSelectedAnswer(option); }; const endGame = () => { setGameEnded(true); // Add this state using useState }; const returnHome = () => { //Return home window.location.href = '..'; }; const handleNextQuestion = () => { // Clear selected answer and message setSelectedAnswer(null); setMessage(''); // Get the next question at random const nextQuestionIndex = (currentQuestionIndex + 1) % quizData.length; setCurrentQuestionIndex(nextQuestionIndex); // Shuffle the quizData array if all questions have been shown once if (nextQuestionIndex === 0) { shuffleQuizData(); } }; const currentQuestion = quizData[currentQuestionIndex]; return ( <div className="quiz-container"> {currentQuestion && !gameEnded && ( <div className="quiz-content"> {currentQuestion.image && ( <img src={currentQuestion.image} alt="Question" className="question-image" /> )} <h2 className="question-text">{currentQuestion.questionText}</h2> <ul> {currentQuestion.options.map((option, optionIndex) => ( <li key={optionIndex}> <button onClick={() => handleAnswerClick(option, currentQuestion.correctAnswer, currentQuestion.points) } className={ selectedAnswer === option ? option === currentQuestion.correctAnswer ? 'correct selected' : incorrectSelection && selectedAnswer === option ? 'incorrect selected' : 'selected' : '' } disabled={selectedAnswer !== null} > {option} </button> </li> ))} </ul> {message && <p className="message">{message}</p>} <button className="next-btn" onClick={returnHome}>Return Home</button> <button className="next-btn" onClick={handleNextQuestion}>Next Question</button> <div className="counter"> <p className="correct">Correct Guesses: {correctCount}</p> <p className="incorrect">Incorrect Guesses: {incorrectCount}</p> <p className="points">Your Score: {pointCount}</p> </div> </div> )} {/* Rendering the score screen when gameEnded is true */} {gameEnded && ( <div className="score-screen"> <h2>Game Over</h2> <p>Your Final Score: {pointCount}</p> <button onClick={() => setGameEnded(false)}>Continue Playing in Study Mode?</button> <Link to="/"> <button>Category Select</button> </Link> </div> )} </div> ); } export default Quiz;
import { useEffect } from 'react'; import WorkoutForm from './workoutForm'; import WorkoutWidget from './workoutWidget'; // create a new workouts and set it in the given workouts state function createNewWorkout( workoutCounter, setWorkoutCounter, workouts, setWorkouts, setHighlightWorkout ) { // create new workout with the workout counter as key const newWorkout = { [workoutCounter]: { markerCounter: 0, workoutDate: null, markers: {}, geometry: '', distance: null, workoutType: null, cadence: null, elevation: null, duration: null, }, }; // highlight the workout being edited setHighlightWorkout(workoutCounter); // send to workouts state setWorkouts({ ...workouts, ...newWorkout }); // increase workout counter setWorkoutCounter(workoutCounter + 1); } function CreateWorkoutButton(props) { if (props.editWorkout != -1) { return ''; } return ( <button className="button-3 m-auto" onClick={() => { createNewWorkout( props.workoutCounter, props.setWorkoutCounter, props.workouts, props.setWorkouts, props.setHighlightWorkout ); props.setEditWorkout(props.workoutCounter); // set the created workout as the one being edited }} > Create new Workout </button> ); } export default function Sidebar(props) { // what workout should be rendered with a form rather than a widget, meaning that it is currently being edited return ( <div className="sidebar"> <img src="/logo.png" alt="Logo" className="logo" /> <ui className="workouts"> {Object.keys(props.workouts).map(key => key == props.editWorkout ? ( <WorkoutForm key={key} workoutKey={key} workouts={props.workouts} workoutCounter={props.workoutCounter} setWorkouts={props.setWorkouts} editWorkout={props.editWorkout} setMapFocus={props.setMapFocus} setEditWorkout={props.setEditWorkout} setHighlightWorkout={props.setHighlightWorkout} /> ) : ( <WorkoutWidget key={key} setMapFocus={props.setMapFocus} workoutKey={key} workouts={props.workouts} setWorkouts={props.setWorkouts} editWorkout={props.editWorkout} setEditWorkout={props.setEditWorkout} highlightWorkout={props.highlightWorkout} setHighlightWorkout={props.setHighlightWorkout} /> ) )} </ui> <CreateWorkoutButton workouts={props.workouts} setWorkouts={props.setWorkouts} workoutCounter={props.workoutCounter} setWorkoutCounter={props.setWorkoutCounter} editWorkout={props.editWorkout} setEditWorkout={props.setEditWorkout} setHighlightWorkout={props.setHighlightWorkout} ></CreateWorkoutButton> </div> ); }
/* Using WaitGroup for goroutine synchronization */ /* Modify the below to execute the f2 concurrently */ package main import ( "fmt" "sync" "time" ) func main() { wg := &sync.WaitGroup{} wg.Add(1) // increment the wg counter by 1 go f1(wg) wg.Add(1) // increment the wg counter by 1 go f2(wg) wg.Wait() // block until the wg counter becomes 0 } func f1(wg *sync.WaitGroup) { fmt.Println("f1 started") time.Sleep(5 * time.Second) fmt.Println("f1 completed") wg.Done() // decrement the wg counter by 1 } func f2(wg *sync.WaitGroup) { defer wg.Done() fmt.Println("f2 invoked") }
const Joi = require("joi"); const { User } = require("../Models"); const APIError = require("../util/APIError"); const bcrypt = require('bcrypt'); const BCRYPT_SALT = Number(process.env.BCRYPT_SALT); const controllers = {}; controllers.getUserData = async (userId) => { const data = await User.findById(userId, {password: 0}); return { status: 200, message: 'Fetched user data', data, } } controllers.updateProfile = async (userId, body) => { const { name, email, oldPassword, newPassword, preferredLanguage } = body; const updateObj = {}; if(name){ updateObj.name = name; } if(email){ const check = await User.findOne({email}); if(check){ throw new APIError("Conflict: Email already exists", 409); } updateObj.email = email; } if(preferredLanguage){ updateObj.languagePreference = preferredLanguage; } if(newPassword){ if (!oldPassword) { throw new APIError("Current password is required", 400); } if (oldPassword === newPassword) { throw new APIError("New password is same as current password", 422); } const userObj = await User.findById(userId); const checkPassword = await bcrypt.compare( oldPassword, userObj.password ); if (!checkPassword) { throw new APIError("Incorrect current password", 400); } const hashedPassword = await bcrypt.hash(newPassword, BCRYPT_SALT); updateObj.password = hashedPassword; } if(Object.keys(updateObj).length === 0){ return { status: 200, message: "Nothing was updated" } } const data = await User.findByIdAndUpdate(userId, updateObj, {projection: {password: 0}}); return { status: 200, message: 'Profile updated successfully.', data, } } controllers.setPreferredLanguage = async (userId, language) => { const { error } = Joi.string().validate(language); if (error) { throw new APIError(error.message, 400); } const res = await User.findByIdAndUpdate(userId, { $set: { languagePreference: language }, }); return { status: 200, message: "Language preference updated successfully.", }; }; controllers.resetProgress = async (userId) => { await User.findByIdAndUpdate(userId, { progress: [] }); return { status: 200, message: "Progress reset successfully.", }; }; controllers.leaderboard = async (language) => { const data = await User.aggregate([ { $match: { "progress.language": language } }, { $project: {name: 1, "progress.language": 1, "progress.score": 1}}, { $sort: {"progress.score": -1}} ]); return { status: 200, message: 'Fetched leaderboard successfully', data: data, } }; module.exports = controllers;
<?xml version="1.0" encoding="UTF-8"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> <test name="AdminMoveCategoryToAnotherPositionInCategoryTreeTest"> <annotations> <stories value="Move categories"/> <title value="Move Category to Another Position in Category Tree"/> <description value="Test log in to Move Category and Move Category to Another Position in Category Tree"/> <testCaseId value="MC-13612"/> <severity value="BLOCKER"/> <group value="catalog"/> <group value="mtf_migrated"/> </annotations> <before> <actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> <createData entity="_defaultCategory" stepKey="createDefaultCategory"/> </before> <after> <deleteData createDataKey="createDefaultCategory" stepKey="deleteDefaultCategory"/> <actionGroup ref="DeleteCategoryActionGroup" stepKey="SecondLevelSubCat"> <argument name="categoryEntity" value="SecondLevelSubCat"/> </actionGroup> <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> </after> <!-- Open Category Page --> <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openAdminCategoryIndexPage"/> <actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickExpandTree"/> <click selector="{{AdminCategorySidebarTreeSection.categoryInTree(_defaultCategory.name)}}" stepKey="selectCategory"/> <waitForPageLoad stepKey="waitForPageToLoad"/> <!-- Create three level deep sub Category --> <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickAddSubCategoryButton"/> <waitForPageLoad stepKey="waitForAddSubCategoryClick1"/> <waitForElementVisible selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" stepKey="waitForSubCategoryName1"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{FirstLevelSubCat.name}}" stepKey="fillSubCategoryName"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveFirstLevelSubCategory"/> <waitForElementVisible selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSuccessMessage"/> <click selector="{{AdminCategorySidebarActionSection.AddSubcategoryButton}}" stepKey="clickOnAddSubCategoryButtonAgain"/> <waitForPageLoad stepKey="waitForAddSubCategoryClick2"/> <waitForElementVisible selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" stepKey="waitForSubCategoryName2"/> <fillField selector="{{AdminCategoryBasicFieldSection.CategoryNameInput}}" userInput="{{SecondLevelSubCat.name}}" stepKey="fillSecondLevelSubCategoryName"/> <actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveSecondLevelSubCategory"/> <waitForElementVisible selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="seeSaveSuccessMessage"/> <grabFromCurrentUrl stepKey="categoryId" regex="#\/([0-9]*)?\/$#" /> <!-- Move Category to another position in category tree, but click cancel button --> <dragAndDrop selector1="{{AdminCategorySidebarTreeSection.categoryInTree(SecondLevelSubCat.name)}}" selector2="{{AdminCategorySidebarTreeSection.categoryInTree('Default Category')}}" stepKey="moveCategory"/> <waitForText selector="{{AdminCategoryModalSection.message}}" userInput="This operation can take a long time" stepKey="seeWarningMessage"/> <click selector="{{AdminCategoryModalSection.cancel}}" stepKey="clickCancelButtonOnWarningPopup"/> <!-- Verify Category in store front page after clicking cancel button --> <amOnPage url="/$$createDefaultCategory.custom_attributes[url_key]$$/{{FirstLevelSubCat.urlKey}}/{{SecondLevelSubCat.urlKey}}.html" stepKey="seeTheCategoryInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageLoad"/> <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(_defaultCategory.name)}}" stepKey="seeDefaultCategoryOnStoreNavigationBar"/> <dontSeeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName(SimpleSubCategory.name)}}" stepKey="dontSeeSubCategoryOnStoreNavigationBar"/> <!-- Verify breadcrumbs in store front page after clicking cancel button --> <grabMultiple selector="{{StorefrontNavigationSection.categoryBreadcrumbs}}" stepKey="breadcrumbs"/> <assertEquals stepKey="verifyTheCategoryInStoreFrontPage"> <expectedResult type="array">['Home', $$createDefaultCategory.name$$,{{FirstLevelSubCat.name}},{{SecondLevelSubCat.name}}]</expectedResult> <actualResult type="variable">breadcrumbs</actualResult> </assertEquals> <!-- Move Category to another position in category tree and click ok button--> <actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openTheAdminCategoryIndexPage"/> <actionGroup ref="AdminExpandCategoryTreeActionGroup" stepKey="clickOnExpandTree"/> <dragAndDrop selector1="{{AdminCategorySidebarTreeSection.categoryInTree(SecondLevelSubCat.name)}}" selector2="{{AdminCategorySidebarTreeSection.categoryInTree('Default Category')}}" stepKey="DragCategory"/> <waitForText selector="{{AdminCategoryModalSection.message}}" userInput="This operation can take a long time" stepKey="seeWarningMessageForOneMoreTime"/> <waitForElementVisible selector="{{AdminCategoryModalSection.ok}}" stepKey="waitForOkButtonOnWarningPopup"/> <click selector="{{AdminCategoryModalSection.ok}}" stepKey="clickOkButtonOnWarningPopup"/> <waitForPageLoad stepKey="waitTheForPageToLoad"/> <waitForText selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You moved the category." stepKey="seeSuccessMoveMessage"/> <amOnPage url="/{{SimpleSubCategory.urlKey}}.html" stepKey="seeCategoryNameInStoreFrontPage"/> <waitForPageLoad stepKey="waitForStoreFrontPageToLoad"/> <!-- Verify Category in store front after moving category to another position in category tree --> <amOnPage url="{{StorefrontCategoryPage.url(SecondLevelSubCat.urlKey)}}" stepKey="amOnCategoryPage"/> <waitForPageLoad stepKey="waitForPageToBeLoaded"/> <waitForElementVisible selector="{{StorefrontCategoryMainSection.CategoryTitle(SecondLevelSubCat.name)}}" stepKey="seeCategoryInTitle"/> <waitForElementVisible selector="{{StorefrontHeaderSection.NavigationCategoryByName(SecondLevelSubCat.name)}}" stepKey="seeCategoryOnStoreNavigationBarAfterMove"/> <!-- Verify breadcrumbs in store front page after moving category to another position in category tree --> <click selector="{{StorefrontHeaderSection.NavigationCategoryByName(SecondLevelSubCat.name)}}" stepKey="clickCategoryOnNavigation"/> <waitForPageLoad stepKey="waitForCategoryLoad"/> <grabMultiple selector="{{StorefrontNavigationSection.categoryBreadcrumbs}}" stepKey="breadcrumbsAfterMove"/> <assertEquals stepKey="verifyBreadcrumbsInFrontPageAfterMove"> <expectedResult type="array">['Home',{{SecondLevelSubCat.name}}]</expectedResult> <actualResult type="variable">breadcrumbsAfterMove</actualResult> </assertEquals> <!-- Open Url Rewrite page and see the url rewrite for the moved category --> <amOnPage url="{{AdminUrlRewriteIndexPage.url}}" stepKey="openUrlRewriteIndexPage"/> <waitForPageLoad stepKey="waitForUrlRewritePageLoad"/> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters"/> <waitForElementVisible selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" stepKey="waitForCategoryUrlKey"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SecondLevelSubCat.name_lwr}}.html" stepKey="fillCategoryUrlKey"/> <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters"/> <waitForPageLoad stepKey="waitForSearch"/> <!-- Verify new Redirect Path after move --> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('2', 'Request Path')}}" userInput="{{SecondLevelSubCat.name_lwr}}.html" stepKey="verifyTheRequestPathAfterMove"/> <!-- Verify new Target Path after move --> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('2', 'Target Path')}}" userInput="catalog/category/view/id/{$categoryId}" stepKey="verifyTheTargetPathAfterMove"/> <!-- Verify new RedirectType after move --> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('2', 'Redirect Type')}}" userInput="No" stepKey="verifyTheRedirectTypeAfterMove"/> <!-- Verify before move Redirect Path displayed with associated Target Path and Redirect Type--> <click selector="{{AdminDataGridHeaderSection.filters}}" stepKey="openUrlRewriteGridFilters1"/> <waitForElementVisible selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" stepKey="waitForTheCategoryUrlKey"/> <fillField selector="{{AdminDataGridHeaderSection.filterFieldInput('request_path')}}" userInput="{{SecondLevelSubCat.name_lwr}}" stepKey="fillTheCategoryUrlKey"/> <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickOrderApplyFilters1"/> <waitForPageLoad stepKey="waitForSearch1"/> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Redirect Type')}}" userInput="Permanent (301)" stepKey="verifyTheRedirectTypeBeforeMove"/> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Request Path')}}" userInput="{{_defaultCategory.name_lwr}}2/{{FirstLevelSubCat.name_lwr}}/{{SecondLevelSubCat.name_lwr}}.html" stepKey="verifyTheRequestPathBeforeMove"/> <see selector="{{AdminUrlRewriteIndexSection.gridCellByColumnRowNumber('1', 'Target Path')}}" userInput="{{SecondLevelSubCat.name_lwr}}.html" stepKey="verifyTheTargetPathBeforeMove"/> </test> </tests>
module; #include <vector> #include <span> #include "DxDef.h" export module Brawler.D3D12.GPUBarrierGroup; import Brawler.D3D12.GPUSplitBarrierToken; import Brawler.D3D12.GPUResourceHandle; export namespace Brawler { namespace D3D12 { class GPUBarrierGroup { public: GPUBarrierGroup() = default; GPUBarrierGroup(const GPUBarrierGroup& rhs) = delete; GPUBarrierGroup& operator=(const GPUBarrierGroup& rhs) = delete; GPUBarrierGroup(GPUBarrierGroup&& rhs) noexcept = default; GPUBarrierGroup& operator=(GPUBarrierGroup&& rhs) noexcept = default; /// <summary> /// Adds a resource transition which must be executed by the GPU before additional work /// can proceed. This ensures that a resource is in its proper state for whatever its /// next use will be. /// /// [UNCONFIRMED - PLEASE VERIFY] A resource transition can be used in place of a UAV /// barrier if a resource which was previously in the D3D12_RESOURCE_STATE_UNORDERED_ACCESS /// state is to be moved to a different state. /// /// When possible, try to use the GPUBarrierGroup::BeginSplitResourceTransition() and /// GPUBarrierGroup::EndSplitResourceTransition() functions instead. However, if no work /// on the GPU can proceed until the resource transition is finished, then calling this /// function instead of those two makes more sense. /// </summary> /// <param name="hResource"> /// - A handle with write privileges to the resource which is to be transitioned. /// </param> /// <param name="desiredState"> /// - The state which the resource specified by hResource will be in once the barrier /// is completed. /// </param> void AddImmediateResourceTransition(const GPUResourceWriteHandle hResource, const D3D12_RESOURCE_STATES desiredState); GPUSplitBarrierToken BeginSplitResourceTransition(const GPUResourceWriteHandle hResource, const D3D12_RESOURCE_STATES desiredState); void EndSplitResourceTransition(GPUSplitBarrierToken&& splitBarrierToken); void AddUAVBarrier(const GPUResourceWriteHandle hResource); std::span<const CD3DX12_RESOURCE_BARRIER> GetResourceBarriers() const; private: std::vector<CD3DX12_RESOURCE_BARRIER> mBarrierArr; }; } }
package edu.shily.demo /** * 1.Groovy使用def定义属性、方法,def支持动态类型声明 * 2.单行注释// 多行注释/** * 3.groovy语句最后面的分号可以省略 * 4.groovy可以自动为属性生成getter、setter方法 * 5.方法声明时:参数类型、返回值类型、return关键字可以省略,在不引起歧义的地方()括号可以省略 * 6.变量引用时:在不引起歧义的前提下{}大括号也可以省略 * 7.对象属性赋值: * 方式1:对象.属性名= * 方式2:对象["属性名"]= * 方式3:对象.属性setter方法() * 方式4:具名构造器的方式 * 读取属性值: * 方式1:对象.属性名 * 方式2:对象["属性名"] * 方式3:对象.属性getter方法() */ class Demo01BasicNotice { def description="斗破苍穹" def bookname="斗罗大陆" def sale(price){ "the book is $price" } def sum(price1,price2){ "$price1 + $price2 = ${price1+price2}" } }
package miniboxing.test.scalatests.unrelevant import org.scalatest.FunSuite /** * Checks the behavior of the actual Scala {@link HashMap}. * */ class HashMapScalaTest extends FunSuite { test("Immutable HashMap: map function") { def rec0(hashmap: scala.collection.immutable.HashMap[Int,String], i: Int): scala.collection.immutable.HashMap[Int,String] = if (i == 10) hashmap else rec0(hashmap.updated(i, "" + i), i+1) val hashMap = rec0(new scala.collection.immutable.HashMap[Int,String],1) val mappedHashMap = hashMap.map(pair => (pair._1 * 10, "new " + pair._2)) assert(mappedHashMap.forall(pair => ("new " + pair._1/10).equals(pair._2))) assert(mappedHashMap.get(40) match { case Some(str) => "new 4".equals(str) case None => false }) } test("Mutable HashMap: map function") { val hashMap = new scala.collection.mutable.HashMap[Int,String] for (i <- (0 until 10)) { hashMap.put(i, i.toString) } hashMap.remove(7) val mappedHashMap = hashMap.map(pair => (pair._1 * 10, "new " + pair._2)) assert(mappedHashMap.forall(pair => ("new " + pair._1/10).equals(pair._2))) assert(mappedHashMap.get(40) match { case Some(str) => "new 4".equals(str) case None => false }) } }
import styled from "styled-components"; import { Search } from "../features/Search/Search"; import { CustomSelect } from "./CustomSelect"; import { setSelect } from "../features/Select/select-slice"; import { useSelector } from "react-redux"; import { selectSelect } from "features/Select/select-selectors"; import { useAppDispatch } from "hooks"; import { Region, handleSetRegionType } from "types"; const optionsMap: Record<Region, { value: Region; label: Region }> = { Africa: { value: "Africa", label: "Africa" }, America: { value: "America", label: "America" }, Asia: { value: "Asia", label: "Asia" }, Europe: { value: "Europe", label: "Europe" }, Oceania: { value: "Oceania", label: "Oceania" }, }; const options = Object.values(optionsMap); const Wrapper = styled.div` display: flex; flex-direction: column; align-items: flex-start; @media (min-width: 767px) { flex-direction: row; justify-content: space-between; align-items: center; } `; export const Controls = () => { const dispatch = useAppDispatch(); const region = useSelector(selectSelect); const handleSetRegion: handleSetRegionType = (r) => { if (r) { dispatch(setSelect(r?.value)); } else { dispatch(setSelect("")); } }; return ( <Wrapper> <Search /> <CustomSelect options={options} placeholder="Filter by Region" isClearable isSearchable={false} value={region ? optionsMap[region] : ""} onChange={(e) => handleSetRegion(e)} /> </Wrapper> ); };
= 查找资产信息 :imagesdir:./_images Exchange可帮助您找到资产。您可以搜索资产,单击所有类型以筛选特定资产,或合并搜索 带有所有类型过滤器的文本。 == 关于所有类型的过滤器 * 连接器 - 与使用第三方API和标准集成协议在Anypoint Platform上开发和部署的端点的打包连接。 * 模板 - 打包的集成模式,用于解决常见用例,并建立在最佳实践基础之上。您可以添加您的信息以完成模板的用例或解决方案。 * 示例 - 准备在Anypoint Studio中运行的应用程序,并演示一个用例或解决方案。 * REST API - RAML或OAS API规范。 * SOAP API - WSDL中的API描述,可帮助您更轻松,更快地采用Anypoint Platform。 * HTTP API - 端点的占位符,供希望使用API​​ Manager管理端点的私有Exchange用户使用。 * RAML片段 - 具有版本和标识符的RAML文档,但本身不是完整的RAML规范。 * 自定义 - 博客,文章等 - 帮助进行知识共享的链接。 == 关于资产详情 当您单击资产时,Exchange会提供详细信息: * 左侧导航区域 - 列出其他页面,保存的搜索项,应用程序名称,实例以及REST API, REST规范中的HTTP函数。 * 右侧详细信息面板 - 列出资产类型,资产何时创建以及哪个组织在上次发布资产时的版本和资产的相关性。对于REST API,右侧面板允许您通过创建示例调用,测试数据(模拟)以及将数据发送到API并查看结果的能力来测试API。 == 关于Exchange搜索 通过搜索,您可以找到包含一个或多个字词的Exchange资产 资产标题,资产ID或资产中的标签。您还可以将搜索词与所有类型中列出的过滤器结合使用。 搜索仅适用于您正在查看的Exchange。 如果您在私人交易所搜索,搜索仅列出 私人交易所资产而不是公共交易所资产。 == 搜索词组 您可以在单词之间放置一个空格以进行搜索 不区分大小写的文本,以您指定的每个词开头。 这与在每个单词后放置`*`通配符正则表达式类似。 例如,搜索`mq module`可以找到具有文本的任何资产 以`mq`或`module`开头。 多个词组中的每个词都需要出现在资产名称,资产ID或标签中 寻找成功。 如果您将搜索词与空间以外的任何其他字符分开,则Exchange 在搜索之前将角色转换为空格。 === 关于搜索分隔符 通过搜索,您可以找到包含资产名称,资产ID或代码中的一个或多个条款的Exchange资产。 如果输入由非字母数字符号连接的搜索词,则Exchange在搜索该术语之前用空格替换符号。如果两个单词出现在结果中,搜索字符串只会成功。这与`word1 AND word2`关系相同。 Exchange搜索资产名称,资产ID值和标记值。从Exchange 1迁移的资产还允许搜索在资产描述中包含文本。 示例搜索条件: [source,example,linenums] ---- sales:connect Sales-Connect connect:/sales -connect -sales ---- 下面的表格显示了每个搜索项的解释方式取决于资产名称中的值, 资产ID和资产的标签。如果搜索项正确映射到值,则会发生匹配。如果不, 原因提供。 [%header%autowidth.spread] |=== |资产名称 |资产ID |标签 |匹配吗? | Salesforce API | salesforce-api | mule-Connector |是 | Salesforce连接器 | salesforce连接器 | REST |是 |验证API |验证-api | salesforce-connecting |是 |优化的API |优化的api |资源:/ connect,salesforce:已启用 |是 |思科销售API | cisco-sales-api |连接,高效 |是 | Cisco连接器 | cisco-connector | com.cisco.connector.sales |是的,因为该标签被分割成单独的字词。 | Salesforce API | salesforce-api | muleconnector,MuleConnector |否。未找到`connect`。 | Salesforce Connec | salesforce-connec | REST |否。未找到`connect`。 |验证API |验证-api |连接器 |否。未找到`sales`。 |思科Presales API | cisco-presales-api |连接器,api |否。未找到`sales`。 |=== === 关于短语搜索分隔符 Exchange搜索功能词组搜索,它允许您查询引号内的一组词条。短语搜索仅在引号内的所有确切词汇以连续顺序出现时才与资产匹配。 如果您在Exchange中输入以下任何搜索,则在搜索资产之前,Exchange会将非字母数字符号替换为空格。 示例搜索条件: [source,example,linenums] ---- Api: "Sales connect" Api "Sales-connect" Api "Sales:/connect" Api-"Sales/connect" "Sales connect":Api ---- 下面的表格显示了每个搜索项的解释方式取决于资产名称中的值, 资产ID和资产的标签。如果搜索项正确映射到值,则会发生匹配。如果不, 原因提供。 [%header%autowidth.spread] |=== |资产名称 |资产ID |标签 |匹配吗? | Salesforce API | salesforce-api | mule-Connector |否。未找到`sales connect`。 | Salesforce连接器 | salesforce连接器 | REST |否 | Sales Connect Asset |验证-api | mule-connector |是 | Sales Connect图片 |验证图片 | mule-connector |否。未找到`api`。 |已优化的API |优化的api |资源:/ connect,sales:已启用 |否。未找到`sales connect`。 |优化的API |优化的api |资源:/ sales,connect:启用 |否。没有找到`sales connect`,因为每个词语都有不同的标签。 |优化API |优化-api |销售:/ connect |是 |=== == 关于使用查询语言的搜索 使用查询语言,您可以按标签,类别和自定义字段搜索资产。 === 按标签搜索 您可以使用以下结构按标签进行搜索:`tag:"some value"`或`tag:value` 如果标签没有空格,则不需要双引号。 此外,标签搜索不区分大小写。 下面的表格显示了与搜索到的资产匹配或不匹配的示例: [%header%autowidth.spread] |=== |搜索 | {标签{2}}匹配? |标记:"some value" |有些值 |是的 |标签:"some value" |值 |无 |标签:"value" |值 |是 |标签:值 |的值 |是 |标签:VALUE |的值 |是 |标签:值 |的值 |是 |标签:值 | VAL |无 |=== === 按类别搜索 您可以使用以下结构按类别搜索:`category:"some key" = "some value"` 如果类别在键或值中没有空格,则不需要双引号。 密钥可以包含星号(`*`)正则表达式来搜索类别名称中的字符。 此外,键和值区分大小写,但如果以小写字母搜索值,则无论如何都会匹配。 下面的表格显示了与搜索到的资产匹配或不匹配的示例: [%header%autowidth.spread] |=== |搜索 | {分类{2}}匹配? |类别:my-key = my-value | my-key:my-value |是 |类别:my-key = MY-VALUE | my-key:MY-VALUE |是 |类别:my-key = my-value | my-key:MY-VALUE |是 |类别:"my key" = "my value" |我的密钥:我的价值 |是 |类别:"key" = "value" |我的密钥:我的价值 |否 |类别:key = value | my-key:my-value |否 |类别:this。* = value | this.is.my.key:value |是 |类别:* my.key =值 | this.is.my.key:value |是 |类别:this。* = value | this.is.my.key:some-value |否 |类别:此* = some-* | this.is.my.key:一些值 |无 |=== === 按自定义字段搜索 与按类别搜索类似,您可以在查询语言中搜索`field`,而不是`category`。 您可以使用以下结构按类别搜索:`field:"some key" = "some value"` 如果自定义字段在键或值中没有空格,则不需要双引号。 密钥可以包含星号(`*`)正则表达式来搜索字段名称中的字符。 此外,键和值区分大小写,但如果以小写字母搜索值,则无论如何都会匹配。 下面的表格显示了与搜索到的资产匹配或不匹配的示例: [%header%autowidth.spread] |=== |搜索 |字段 |匹配? |字段:my-key = my-value | my-key:my-value |是 |字段:my-key = MY-VALUE | my-key:MY-VALUE |是 |字段:my-key = my-value | my-key:MY-VALUE |是 |字段:my-key = My-ValUe | my-key:MY-VALUE |否 |字段:MY-KEY = my-value | my-key:my-value |否 |字段:my-key = 10 | my-key:10 |是的 |字段:"my key" = "my value" |我的密钥:我的价值 |是 |字段:"key" = "value" |我的密钥:我的价值 |否 |字段:key =值 | my-key:my-value |否 |字段:this。* = value | this.is.my.key:value |是 |字段:* my.key =值 | this.is.my.key:value |是 |字段:this。* = value | this.is.my.key:some-value |否 |字段:此* = some-* | this.is.my.key:一些值 |无 |=== == 保存搜索 . 输入搜索字词并点击保存此搜索。 . Exchange会提示您为搜索提供名称,并选择搜索是针对您的组织还是个人。管理员可以将搜索结果保存到当前业务组中的任何人。个人搜索只对创建它们的人可见。 . 查看左侧导航栏以查看保存的搜索。 Exchange列出特定于您的业务组的搜索条件。这些条款下面是您创建的保存搜索。 + image:ex2-saved-searches-groups.png[保存的搜索组] == 查看资产中的REST API元素 . 在左侧导航区域中,您可以查看RAML或OAS API规范信息,例如资源和每个资源中的方法。点击方法按钮查看关于API的信息: + image:ex2-rest-ftns.png[屏幕截图 - 左侧导航栏中的REST API功能按钮] + . 使用方法视图的右侧来试验API。这个功能类似于Postman这样的程序,您可以指定自定义HTTP标头并使用API​​的端点测试每个API的方法。 . 单击“请求访问”将您正在查看的API与您的某个应用程序绑定,以便您可以使用API​​发送和接收应用程序可以使用的数据。 == 使用API​​ Notebook测试API . 如果API可用,请点击内容页面中的API Notebook。 . 阅读使用信息说明后,您可以尝试使用代码块中的示例尝试不同的参数和值,并实时查看结果。 . 点击播放以测试代码示例中的方法并查看结果。 == 按业务组查看资产 Anypoint Platform为将内容组织到不同类别的业务组提供了选项。 在Anypoint Exchange中,不同的资产可能出现在每个业务组中。每个组织 选择每个业务组中的哪些资产。 如果你找不到 一个组中的资产,它可能在另一个业务组中。如果您无法查看业务组,请联系您的网站管理员。 要更改业务组,请单击任务栏中的组名称。 image:ex2-biz-groups.png[屏幕截图 - 上方任务栏下拉菜单中的业务组] == 另请参阅 * link:/anypoint-exchange/about-my-applications[关于我的应用程序] * link:/anypoint-exchange/to-configure-api-settings[配置API实例] * link:/anypoint-studio/v/6/exchange-integration[Anypoint Studio与Exchange集成] * https://beta-anypt.docs-stgx.mulesoft.com/anypoint-studio/v/7/export-to-exchange-task [从Studio到Exchange共享示例或模板]
// // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2015 Marius-Valeriu Stanciu <stanciumarius94@gmail.com> // #ifndef MARBLE_OSMPLACEMARKDATA_H #define MARBLE_OSMPLACEMARKDATA_H // Qt #include <QHash> #include <QMetaType> #include <QString> // Marble #include "GeoDataCoordinates.h" #include <marble_export.h> #include "GeoDocument.h" class QXmlStreamAttributes; namespace Marble { /** * This class is used to encapsulate the osm data fields kept within a placemark's extendedData. * It stores OSM server generated data: id, version, changeset, uid, visible, user, timestamp; * It also stores a hash map of <tags> ( key-value mappings ) and a hash map of component osm * placemarks @see m_nodeReferences @see m_memberReferences * * The usual workflow with osmData goes as follows: * * Parsing stage: * The OsmParser parses tags (they have server-generated attributes), creates new placemarks and * assigns them new OsmPlacemarkData objects with all the needed information. * * Editing stage: * While editing placemarks that have OsmPlacemarkData, all relevant changes reflect on the * OsmPlacemarkData object as well, so as not to uncorrelate data from the actual placemarks. * * Writing stage: * The OsmObjectManager assigns OsmPlacemarkData objects to placemarks that do not have it * ( these are usually newly created placemarks within the editor, or placemarks loaded from * ".kml" files ). Placemarks that already have it, are simply written as-is. */ class MARBLE_EXPORT OsmPlacemarkData: public GeoNode { public: OsmPlacemarkData(); qint64 id() const; qint64 oid() const; QString version() const; QString changeset() const; QString uid() const; QString isVisible() const; QString user() const; QString timestamp() const; QString action() const; const char* nodeType() const; void setId( qint64 id ); void setVersion( const QString& version ); void setChangeset( const QString& changeset ); void setUid( const QString& uid ); void setVisible( const QString& visible ); void setUser( const QString& user ); void setTimestamp( const QString& timestamp ); void setAction( const QString& action ); /** * @brief tagValue returns the value of the tag that has @p key as key * or an empty qstring if there is no such tag */ QString tagValue( const QString &key ) const; /** * @brief addTag this function inserts a string key=value mapping, * equivalent to the <tag k="@p key" v="@p value"> osm core data * element */ void addTag( const QString& key, const QString& value ); /** * @brief removeTag removes the tag from the tag hash */ void removeTag( const QString& key ); /** * @brief containsTag returns true if the tag hash contains an entry with * the @p key as key and @p value as value */ bool containsTag( const QString& key, const QString& value ) const; /** * @brief containsTagKey returns true if the tag hash contains an entry with * the @p key as key */ bool containsTagKey( const QString& key ) const; /** * @brief tagValue returns a pointer to the tag that has @p key as key * or the end iterator if there is no such tag */ QHash<QString, QString>::const_iterator findTag(const QString &key) const; /** * @brief iterators for the tags hash. */ QHash< QString, QString >::const_iterator tagsBegin() const; QHash< QString, QString >::const_iterator tagsEnd() const; /** * @brief this function returns the osmData associated with a nd */ OsmPlacemarkData &nodeReference( const GeoDataCoordinates& coordinates ); OsmPlacemarkData nodeReference( const GeoDataCoordinates& coordinates ) const; /** * @brief addRef this function inserts a GeoDataCoordinates = OsmPlacemarkData * mapping into the reference hash, equivalent to the <member ref="@p key" > * osm core data element */ void addNodeReference( const GeoDataCoordinates& key, const OsmPlacemarkData &value ); void removeNodeReference( const GeoDataCoordinates& key ); bool containsNodeReference( const GeoDataCoordinates& key ) const; /** * @brief changeNodeReference is a convenience function that allows the quick change of * a node hash entry. This is generally used to update the osm data in case * nodes are being moved in the editor. */ void changeNodeReference( const GeoDataCoordinates& oldKey, const GeoDataCoordinates &newKey ); /** * @brief iterators for the reference hashes. */ QHash< GeoDataCoordinates, OsmPlacemarkData > & nodeReferences(); QHash< GeoDataCoordinates, OsmPlacemarkData >::const_iterator nodeReferencesBegin() const; QHash< GeoDataCoordinates, OsmPlacemarkData >::const_iterator nodeReferencesEnd() const; /** * @brief this function returns the osmData associated with a member boundary's index * -1 represents the outer boundary of a polygon, and 0,1,2... the inner boundaries, * in the order provided by polygon->innerBoundaries(); */ OsmPlacemarkData &memberReference( int key ); OsmPlacemarkData memberReference( int key ) const; /** * @brief addRef this function inserts a int = OsmplacemarkData * mapping into the reference hash, equivalent to the osm <nd ref="@p boundary of index @key" > * core data element * @see m_memberReferences */ void addMemberReference( int key, const OsmPlacemarkData &value ); void removeMemberReference( int key ); bool containsMemberReference( int key ) const; QHash< int, OsmPlacemarkData > & memberReferences(); QHash< int, OsmPlacemarkData >::const_iterator memberReferencesBegin() const; QHash< int, OsmPlacemarkData >::const_iterator memberReferencesEnd() const; /** * @brief addRelation calling this makes the osm placemark a member of the relation * with @p id as id, while having the role @p role */ void addRelation( qint64 id, const QString &role ); void removeRelation( qint64 id ); bool containsRelation( qint64 id ) const; QHash< qint64, QString >::const_iterator relationReferencesBegin() const; QHash< qint64, QString >::const_iterator relationReferencesEnd() const; /** * @brief osmData is stored within a placemark's extended data hash * at an entry with osmKey */ static QString osmHashKey(); /** * @brief isNull returns false if the osmData is loaded from a source * or true if its just default constructed */ bool isNull() const; /** * @brief isEmpty returns true if no attribute other than the id has been set */ bool isEmpty() const; /** * @brief fromParserAttributes is a convenience function that parses all osm-related * arguments of a tag * @return an OsmPlacemarkData object containing all the necessary data */ static OsmPlacemarkData fromParserAttributes( const QXmlStreamAttributes &attributes ); private: qint64 m_id; QString m_version; QString m_changeset; QString m_uid; QString m_visible; QString m_user; QString m_timestamp; QString m_action; QHash<QString, QString> m_tags; static const QString osmDataKey; /** * @brief m_ndRefs is used to store a way's component nodes * ( It is empty for other placemark types ) */ QHash< GeoDataCoordinates, OsmPlacemarkData > m_nodeReferences; /** * @brief m_memberRefs is used to store a polygon's member boundaries * the key represents the index of the boundary within the polygon geometry: * -1 represents the outerBoundary, and 0,1,2... its innerBoundaries, in the * order provided by polygon->innerBoundaries() */ QHash<int, OsmPlacemarkData> m_memberReferences; /** * @brief m_relationReferences is used to store the relations the placemark is part of * and the role it has within them. * Eg. an entry ( "123", "stop" ) means that the parent placemark is a member of * the relation with id "123", while having the "stop" role */ QHash<qint64, QString> m_relationReferences; }; } // Makes qvariant_cast possible for OsmPlacemarkData objects Q_DECLARE_METATYPE( Marble::OsmPlacemarkData ) #endif
/* Copyright © 2013 Adobe Systems Incorporated. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * See <a href="http://jquery.com">http://jquery.com</a>. * @name jquery * @class * See the jQuery Library (<a href="http://jquery.com">http://jquery.com</a>) for full details. This just * documents the function and classes that are added to jQuery by this plug-in. */ /** * See <a href="http://jquery.com">http://jquery.com</a> * @name fn * @class * See the jQuery Library (<a href="http://jquery.com">http://jquery.com</a>) for full details. This just * documents the function and classes that are added to jQuery by this plug-in. * @memberOf jquery */ /** * @fileOverview accessibleMegaMenu plugin * *<p>Licensed under the Apache License, Version 2.0 (the “License”) *<br />Copyright © 2013 Adobe Systems Incorporated. *<br />Project page <a href="https://github.com/adobe-accessibility/Accessible-Mega-Menu">https://github.com/adobe-accessibility/Accessible-Mega-Menu</a> * @version 0.1 * @author Michael Jordan * @requires jquery */ /*jslint browser: true, devel: true, plusplus: true, nomen: true */ /*global jQuery */ (function ($, window, document) { "use strict"; var pluginName = "accessibleMegaMenu", defaults = { uuidPrefix: "accessible-megamenu", // unique ID's are required to indicate aria-owns, aria-controls and aria-labelledby menuClass: "accessible-megamenu", // default css class used to define the megamenu styling topNavItemClass: "accessible-megamenu-top-nav-item", // default css class for a top-level navigation item in the megamenu panelClass: "accessible-megamenu-panel", // default css class for a megamenu panel panelGroupClass: "accessible-megamenu-panel-group", // default css class for a group of items within a megamenu panel hoverClass: "hover", // default css class for the hover state focusClass: "focus", // default css class for the focus state openClass: "open", // default css class for the open state openDelay: 0 // default open delay when opening menu via mouseover }, Keyboard = { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38, keyMap: { 48: "0", 49: "1", 50: "2", 51: "3", 52: "4", 53: "5", 54: "6", 55: "7", 56: "8", 57: "9", 59: ";", 65: "a", 66: "b", 67: "c", 68: "d", 69: "e", 70: "f", 71: "g", 72: "h", 73: "i", 74: "j", 75: "k", 76: "l", 77: "m", 78: "n", 79: "o", 80: "p", 81: "q", 82: "r", 83: "s", 84: "t", 85: "u", 86: "v", 87: "w", 88: "x", 89: "y", 90: "z", 96: "0", 97: "1", 98: "2", 99: "3", 100: "4", 101: "5", 102: "6", 103: "7", 104: "8", 105: "9", 190: "." } }; /** * @desc Creates a new accessible mega menu instance. * @param {jquery} element * @param {object} [options] Mega Menu options * @param {string} [options.uuidPrefix=accessible-megamenu] - Prefix for generated unique id attributes, which are required to indicate aria-owns, aria-controls and aria-labelledby * @param {string} [options.menuClass=accessible-megamenu] - CSS class used to define the megamenu styling * @param {string} [options.topNavItemClass=accessible-megamenu-top-nav-item] - CSS class for a top-level navigation item in the megamenu * @param {string} [options.panelClass=accessible-megamenu-panel] - CSS class for a megamenu panel * @param {string} [options.panelGroupClass=accessible-megamenu-panel-group] - CSS class for a group of items within a megamenu panel * @param {string} [options.hoverClass=hover] - CSS class for the hover state * @param {string} [options.focusClass=focus] - CSS class for the focus state * @param {string} [options.openClass=open] - CSS class for the open state * @constructor */ function AccessibleMegaMenu(element, options) { this.element = element; // merge optional settings and defaults into settings this.settings = $.extend({}, defaults, options); this._defaults = defaults; this._name = pluginName; this.mouseTimeoutID = null; this.focusTimeoutID = null; this.mouseFocused = false; this.justFocused = false; this.init(); } AccessibleMegaMenu.prototype = (function () { /* private attributes and methods ------------------------ */ var uuid = 0, keydownTimeoutDuration = 1000, keydownSearchString = "", isTouch = typeof window.hasOwnProperty === "function" && !!window.hasOwnProperty("ontouchstart"), _getPlugin, _addUniqueId, _togglePanel, _clickHandler, _clickOutsideHandler, _DOMAttrModifiedHandler, _focusInHandler, _focusOutHandler, _keyDownHandler, _mouseDownHandler, _mouseOverHandler, _mouseOutHandler, _toggleExpandedEventHandlers; /** * @name jQuery.fn.accessibleMegaMenu~_getPlugin * @desc Returns the parent accessibleMegaMenu instance for a given element * @param {jQuery} element * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _getPlugin = function (element) { return $(element).closest(':data(plugin_' + pluginName + ')').data("plugin_" + pluginName); }; /** * @name jQuery.fn.accessibleMegaMenu~_addUniqueId * @desc Adds a unique id and element. * The id string starts with the * string defined in settings.uuidPrefix. * @param {jQuery} element * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _addUniqueId = function (element) { element = $(element); var settings = this.settings; if (!element.attr("id")) { element.attr("id", settings.uuidPrefix + "-" + new Date().getTime() + "-" + (++uuid)); } }; /** * @name jQuery.fn.accessibleMegaMenu~_togglePanel * @desc Toggle the display of mega menu panels in response to an event. * The optional boolean value 'hide' forces all panels to hide. * @param {event} event * @param {Boolean} [hide] Hide all mega menu panels when true * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _togglePanel = function (event, hide) { var target = $(event.target), that = this, settings = this.settings, menu = this.menu, topli = target.closest('.' + settings.topNavItemClass), panel = target.hasClass(settings.panelClass) ? target : target.closest('.' + settings.panelClass), newfocus; _toggleExpandedEventHandlers.call(this, true); if (hide) { topli = menu.find('.' + settings.topNavItemClass + ' .' + settings.openClass + ':first').closest('.' + settings.topNavItemClass); if (!(topli.is(event.relatedTarget) || topli.has(event.relatedTarget).length > 0)) { if ((event.type === 'mouseout' || event.type === 'focusout') && topli.has(document.activeElement).length > 0) { return; } topli.find('[aria-expanded]') .attr('aria-expanded', 'false') .removeClass(settings.openClass) .filter('.' + settings.panelClass) .attr('aria-hidden', 'true'); if ((event.type === 'keydown' && event.keyCode === Keyboard.ESCAPE) || event.type === 'DOMAttrModified') { newfocus = topli.find(':tabbable:first'); setTimeout(function () { menu.find('[aria-expanded].' + that.settings.panelClass).off('DOMAttrModified.accessible-megamenu'); newfocus.focus(); that.justFocused = false; }, 99); } } else if (topli.length === 0) { menu.find('[aria-expanded=true]') .attr('aria-expanded', 'false') .removeClass(settings.openClass) .filter('.' + settings.panelClass) .attr('aria-hidden', 'true'); } } else { clearTimeout(that.focusTimeoutID); topli.siblings() .find('[aria-expanded]') .attr('aria-expanded', 'false') .removeClass(settings.openClass) .filter('.' + settings.panelClass) .attr('aria-hidden', 'true'); topli.find('[aria-expanded]') .attr('aria-expanded', 'true') .addClass(settings.openClass) .filter('.' + settings.panelClass) .attr('aria-hidden', 'false'); if (event.type === 'mouseover' && target.is(':tabbable') && topli.length === 1 && panel.length === 0 && menu.has(document.activeElement).length > 0) { target.focus(); that.justFocused = false; } _toggleExpandedEventHandlers.call(that); } }; /** * @name jQuery.fn.accessibleMegaMenu~_clickHandler * @desc Handle click event on mega menu item * @param {event} Event object * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _clickHandler = function (event) { var target = $(event.target).closest(':tabbable'), topli = target.closest('.' + this.settings.topNavItemClass), panel = target.closest('.' + this.settings.panelClass); if (topli.length === 1 && panel.length === 0 && topli.find('.' + this.settings.panelClass).length === 1) { if (!target.hasClass(this.settings.openClass)) { event.preventDefault(); event.stopPropagation(); _togglePanel.call(this, event); this.justFocused = false; } else { if (this.justFocused) { event.preventDefault(); event.stopPropagation(); this.justFocused = false; } else if (isTouch) { event.preventDefault(); event.stopPropagation(); _togglePanel.call(this, event, target.hasClass(this.settings.openClass)); } } } }; /** * @name jQuery.fn.accessibleMegaMenu~_clickOutsideHandler * @desc Handle click event outside of a the megamenu * @param {event} Event object * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _clickOutsideHandler = function (event) { if ($(event.target).closest(this.menu).length === 0) { event.preventDefault(); event.stopPropagation(); _togglePanel.call(this, event, true); } }; /** * @name jQuery.fn.accessibleMegaMenu~_DOMAttrModifiedHandler * @desc Handle DOMAttrModified event on panel to respond to Windows 8 Narrator ExpandCollapse pattern * @param {event} Event object * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _DOMAttrModifiedHandler = function (event) { if (event.originalEvent.attrName === 'aria-expanded' && event.originalEvent.newValue === 'false' && $(event.target).hasClass(this.settings.openClass)) { event.preventDefault(); event.stopPropagation(); _togglePanel.call(this, event, true); } }; /** * @name jQuery.fn.accessibleMegaMenu~_focusInHandler * @desc Handle focusin event on mega menu item. * @param {event} Event object * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _focusInHandler = function (event) { clearTimeout(this.focusTimeoutID); var target = $(event.target), panel = target.closest('.' + this.settings.panelClass); target .addClass(this.settings.focusClass) .on('click.accessible-megamenu', $.proxy(_clickHandler, this)); this.justFocused = !this.mouseFocused; this.mouseFocused = false; if (this.panels.not(panel).filter('.' + this.settings.openClass).length) { _togglePanel.call(this, event); } }; /** * @name jQuery.fn.accessibleMegaMenu~_focusOutHandler * @desc Handle focusout event on mega menu item. * @param {event} Event object * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _focusOutHandler = function (event) { this.justFocused = false; var that = this, target = $(event.target), topli = target.closest('.' + this.settings.topNavItemClass), keepOpen = false; target .removeClass(this.settings.focusClass) .off('click.accessible-megamenu'); if (window.cvox) { // If ChromeVox is running... that.focusTimeoutID = setTimeout(function () { window.cvox.Api.getCurrentNode(function (node) { if (topli.has(node).length) { // and the current node being voiced is in // the mega menu, clearTimeout, // so the panel stays open. clearTimeout(that.focusTimeoutID); } else { that.focusTimeoutID = setTimeout(function (scope, event, hide) { _togglePanel.call(scope, event, hide); }, 275, that, event, true); } }); }, 25); } else { that.focusTimeoutID = setTimeout(function () { _togglePanel.call(that, event, true); }, 300); } }; /** * @name jQuery.fn.accessibleMegaMenu~_keyDownHandler * @desc Handle keydown event on mega menu. * @param {event} Event object * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _keyDownHandler = function (event) { var that = (this.constructor === AccessibleMegaMenu) ? this : _getPlugin(this), // determine the AccessibleMegaMenu plugin instance settings = that.settings, target = $($(this).is('.' + settings.hoverClass + ':tabbable') ? this : event.target), // if the element is hovered the target is this, otherwise, its the focused element menu = that.menu, topnavitems = that.topnavitems, topli = target.closest('.' + settings.topNavItemClass), tabbables = menu.find(':tabbable'), panel = target.hasClass(settings.panelClass) ? target : target.closest('.' + settings.panelClass), panelGroups = panel.find('.' + settings.panelGroupClass), currentPanelGroup = target.closest('.' + settings.panelGroupClass), next, keycode = event.keyCode || event.which, start, i, o, label, found = false, newString = Keyboard.keyMap[event.keyCode] || '', regex, isTopNavItem = (topli.length === 1 && panel.length === 0); if (target.is("input:focus, select:focus, textarea:focus, button:focus")) { // if the event target is a form element we should handle keydown normally return; } if (target.is('.' + settings.hoverClass + ':tabbable')) { $('html').off('keydown.accessible-megamenu'); } switch (keycode) { case Keyboard.ESCAPE: _togglePanel.call(that, event, true); break; case Keyboard.DOWN: event.preventDefault(); if (isTopNavItem) { _togglePanel.call(that, event); found = (topli.find('.' + settings.panelClass + ' :tabbable:first').focus().length === 1); } else { found = (tabbables.filter(':gt(' + tabbables.index(target) + '):first').focus().length === 1); } if (!found && window.opera && opera.toString() === "[object Opera]" && (event.ctrlKey || event.metaKey)) { tabbables = $(':tabbable'); i = tabbables.index(target); found = ($(':tabbable:gt(' + $(':tabbable').index(target) + '):first').focus().length === 1); } break; case Keyboard.UP: event.preventDefault(); if (isTopNavItem && target.hasClass(settings.openClass)) { _togglePanel.call(that, event, true); next = topnavitems.filter(':lt(' + topnavitems.index(topli) + '):last'); if (next.children('.' + settings.panelClass).length) { found = (next.children() .attr('aria-expanded', 'true') .addClass(settings.openClass) .filter('.' + settings.panelClass) .attr('aria-hidden', 'false') .find(':tabbable:last') .focus() === 1); } } else if (!isTopNavItem) { found = (tabbables.filter(':lt(' + tabbables.index(target) + '):last').focus().length === 1); } if (!found && window.opera && opera.toString() === "[object Opera]" && (event.ctrlKey || event.metaKey)) { tabbables = $(':tabbable'); i = tabbables.index(target); found = ($(':tabbable:lt(' + $(':tabbable').index(target) + '):first').focus().length === 1); } break; case Keyboard.RIGHT: event.preventDefault(); if (isTopNavItem) { found = (topnavitems.filter(':gt(' + topnavitems.index(topli) + '):first').find(':tabbable:first').focus().length === 1); } else { if (panelGroups.length && currentPanelGroup.length) { // if the current panel contains panel groups, and we are able to focus the first tabbable element of the next panel group found = (panelGroups.filter(':gt(' + panelGroups.index(currentPanelGroup) + '):first').find(':tabbable:first').focus().length === 1); } if (!found) { found = (topli.find(':tabbable:first').focus().length === 1); } } break; case Keyboard.LEFT: event.preventDefault(); if (isTopNavItem) { found = (topnavitems.filter(':lt(' + topnavitems.index(topli) + '):last').find(':tabbable:first').focus().length === 1); } else { if (panelGroups.length && currentPanelGroup.length) { // if the current panel contains panel groups, and we are able to focus the first tabbable element of the previous panel group found = (panelGroups.filter(':lt(' + panelGroups.index(currentPanelGroup) + '):last').find(':tabbable:first').focus().length === 1); } if (!found) { found = (topli.find(':tabbable:first').focus().length === 1); } } break; case Keyboard.TAB: i = tabbables.index(target); if (event.shiftKey && isTopNavItem && target.hasClass(settings.openClass)) { _togglePanel.call(that, event, true); next = topnavitems.filter(':lt(' + topnavitems.index(topli) + '):last'); if (next.children('.' + settings.panelClass).length) { found = next.children() .attr('aria-expanded', 'true') .addClass(settings.openClass) .filter('.' + settings.panelClass) .attr('aria-hidden', 'false') .find(':tabbable:last') .focus(); } } else if (event.shiftKey && i > 0) { found = (tabbables.filter(':lt(' + i + '):last').focus().length === 1); } else if (!event.shiftKey && i < tabbables.length - 1) { found = (tabbables.filter(':gt(' + i + '):first').focus().length === 1); } else if (window.opera && opera.toString() === "[object Opera]") { tabbables = $(':tabbable'); i = tabbables.index(target); if (event.shiftKey) { found = ($(':tabbable:lt(' + $(':tabbable').index(target) + '):last').focus().length === 1); } else { found = ($(':tabbable:gt(' + $(':tabbable').index(target) + '):first').focus().length === 1); } } if (found) { event.preventDefault(); } break; case Keyboard.SPACE: if (isTopNavItem) { event.preventDefault(); _clickHandler.call(that, event); } else { return true; } break; case Keyboard.ENTER: return true; default: // alphanumeric filter clearTimeout(this.keydownTimeoutID); keydownSearchString += newString !== keydownSearchString ? newString : ''; if (keydownSearchString.length === 0) { return; } this.keydownTimeoutID = setTimeout(function () { keydownSearchString = ''; }, keydownTimeoutDuration); if (isTopNavItem && !target.hasClass(settings.openClass)) { tabbables = tabbables.filter(':not(.' + settings.panelClass + ' :tabbable)'); } else { tabbables = topli.find(':tabbable'); } if (event.shiftKey) { tabbables = $(tabbables.get() .reverse()); } for (i = 0; i < tabbables.length; i++) { o = tabbables.eq(i); if (o.is(target)) { start = (keydownSearchString.length === 1) ? i + 1 : i; break; } } regex = new RegExp('^' + keydownSearchString.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&'), 'i'); for (i = start; i < tabbables.length; i++) { o = tabbables.eq(i); label = $.trim(o.text()); if (regex.test(label)) { found = true; o.focus(); break; } } if (!found) { for (i = 0; i < start; i++) { o = tabbables.eq(i); label = $.trim(o.text()); if (regex.test(label)) { o.focus(); break; } } } break; } that.justFocused = false; }; /** * @name jQuery.fn.accessibleMegaMenu~_mouseDownHandler * @desc Handle mousedown event on mega menu. * @param {event} Event object * @memberof accessibleMegaMenu * @inner * @private */ _mouseDownHandler = function (event) { if ($(event.target).is(this.settings.panelClass) || $(event.target).closest(":focusable").length) { this.mouseFocused = true; } clearTimeout(this.mouseTimeoutID); this.mouseTimeoutID = setTimeout(function () { clearTimeout(this.focusTimeoutID); }, 1); }; /** * @name jQuery.fn.accessibleMegaMenu~_mouseOverHandler * @desc Handle mouseover event on mega menu. * @param {event} Event object * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _mouseOverHandler = function (event) { clearTimeout(this.mouseTimeoutID); var that = this; this.mouseTimeoutID = setTimeout(function () { $(event.target).addClass(that.settings.hoverClass); _togglePanel.call(that, event); if ($(event.target).is(':tabbable')) { $('html').on('keydown.accessible-megamenu', $.proxy(_keyDownHandler, event.target)); } }, this.settings.openDelay); }; /** * @name jQuery.fn.accessibleMegaMenu~_mouseOutHandler * @desc Handle mouseout event on mega menu. * @param {event} Event object * @memberof jQuery.fn.accessibleMegaMenu * @inner * @private */ _mouseOutHandler = function (event) { clearTimeout(this.mouseTimeoutID); var that = this; $(event.target) .removeClass(that.settings.hoverClass); that.mouseTimeoutID = setTimeout(function () { _togglePanel.call(that, event, true); }, 250); if ($(event.target).is(':tabbable')) { $('html').off('keydown.accessible-megamenu'); } }; _toggleExpandedEventHandlers = function (hide) { var menu = this.menu; if (hide) { $('html').off('mouseup.outside-accessible-megamenu, touchend.outside-accessible-megamenu, mspointerup.outside-accessible-megamenu, pointerup.outside-accessible-megamenu'); menu.find('[aria-expanded].' + this.settings.panelClass).off('DOMAttrModified.accessible-megamenu'); } else { $('html').on('mouseup.outside-accessible-megamenu, touchend.outside-accessible-megamenu, mspointerup.outside-accessible-megamenu, pointerup.outside-accessible-megamenu', $.proxy(_clickOutsideHandler, this)); /* Narrator in Windows 8 automatically toggles the aria-expanded property on double tap or click. To respond to the change to collapse the panel, we must add a listener for a DOMAttrModified event. */ menu.find('[aria-expanded=true].' + this.settings.panelClass).on('DOMAttrModified.accessible-megamenu', $.proxy(_DOMAttrModifiedHandler, this)); } }; /* public attributes and methods ------------------------- */ return { constructor: AccessibleMegaMenu, /** * @lends jQuery.fn.accessibleMegaMenu * @desc Initializes an instance of the accessibleMegaMenu plugins * @memberof jQuery.fn.accessibleMegaMenu * @instance */ init: function () { var settings = this.settings, nav = $(this.element), menu = nav.children().first(), topnavitems = menu.children(); this.start(settings, nav, menu, topnavitems); }, start: function(settings, nav, menu, topnavitems) { var that = this; this.settings = settings; this.menu = menu; this.topnavitems = topnavitems; nav.attr("role", "navigation"); menu.addClass(settings.menuClass); topnavitems.each(function (i, topnavitem) { var topnavitemlink, topnavitempanel; topnavitem = $(topnavitem); topnavitem.addClass(settings.topNavItemClass); topnavitemlink = topnavitem.find(":tabbable:first"); topnavitempanel = topnavitem.children(":not(:tabbable):last"); _addUniqueId.call(that, topnavitemlink); if (topnavitempanel.length) { _addUniqueId.call(that, topnavitempanel); topnavitemlink.attr({ // "aria-haspopup": true, //"aria-controls": topnavitempanel.attr("id"), "aria-expanded": false }); topnavitempanel.attr({ "role": "region", "aria-expanded": false, "aria-hidden": true }) .addClass(settings.panelClass) .not("[aria-labelledby]") .attr("aria-labelledby", topnavitemlink.attr("id")); } }); this.panels = menu.find("." + settings.panelClass); menu.on("focusin.accessible-megamenu", ":focusable, ." + settings.panelClass, $.proxy(_focusInHandler, this)) .on("focusout.accessible-megamenu", ":focusable, ." + settings.panelClass, $.proxy(_focusOutHandler, this)) .on("keydown.accessible-megamenu", $.proxy(_keyDownHandler, this)) .on("mouseover.accessible-megamenu", $.proxy(_mouseOverHandler, this)) .on("mouseout.accessible-megamenu", $.proxy(_mouseOutHandler, this)) .on("mousedown.accessible-megamenu", $.proxy(_mouseDownHandler, this)); if (isTouch) { menu.on("touchstart.accessible-megamenu", $.proxy(_clickHandler, this)); } menu.find("hr").attr("role", "separator"); if ($(document.activeElement).closest(menu).length) { $(document.activeElement).trigger("focusin.accessible-megamenu"); } }, /** * @desc Get default values * @example $(selector).accessibleMegaMenu("getDefaults"); * @return {object} * @memberof jQuery.fn.accessibleMegaMenu * @instance */ getDefaults: function () { return this._defaults; }, /** * @desc Get any option set to plugin using its name (as string) * @example $(selector).accessibleMegaMenu("getOption", some_option); * @param {string} opt * @return {string} * @memberof jQuery.fn.accessibleMegaMenu * @instance */ getOption: function (opt) { return this.settings[opt]; }, /** * @desc Get all options * @example $(selector).accessibleMegaMenu("getAllOptions"); * @return {object} * @memberof jQuery.fn.accessibleMegaMenu * @instance */ getAllOptions: function () { return this.settings; }, /** * @desc Set option * @example $(selector).accessibleMegaMenu("setOption", "option_name", "option_value", reinitialize); * @param {string} opt - Option name * @param {string} val - Option value * @param {boolean} [reinitialize] - boolean to re-initialize the menu. * @memberof jQuery.fn.accessibleMegaMenu * @instance */ setOption: function (opt, value, reinitialize) { this.settings[opt] = value; if (reinitialize) { this.init(); } } }; }()); /* lightweight plugin wrapper around the constructor, to prevent against multiple instantiations */ /** * @class accessibleMegaMenu * @memberOf jQuery.fn * @classdesc Implements an accessible mega menu as a jQuery plugin. * <p>The mega-menu It is modeled after the mega menu on {@link http://adobe.com|adobe.com} but has been simplified for use by others. A brief description of the interaction design choices can be found in a blog post at {@link http://blogs.adobe.com/accessibility/2013/05/adobe-com.html|Mega menu accessibility on adobe.com}.</p> * <h3>Keyboard Accessibility</h3> * <p>The accessible mega menu supports keyboard interaction modeled after the behavior described in the {@link http://www.w3.org/TR/wai-aria-practices/#menu|WAI-ARIA Menu or Menu bar (widget) design pattern}, however we also try to respect users' general expectations for the behavior of links in a global navigation. To this end, the accessible mega menu implementation permits tab focus on each of the six top-level menu items. When one of the menu items has focus, pressing the Enter key, Spacebar or Down arrow will open the submenu panel, and pressing the Left or Right arrow key will shift focus to the adjacent menu item. Links within the submenu panels are included in the tab order when the panel is open. They can also be navigated with the arrow keys or by typing the first character in the link name, which speeds up keyboard navigation considerably. Pressing the Escape key closes the submenu and restores focus to the parent menu item.</p> * <h3>Screen Reader Accessibility</h3> * <p>The accessible mega menu models its use of WAI-ARIA Roles, States, and Properties after those described in the {@link http://www.w3.org/TR/wai-aria-practices/#menu|WAI-ARIA Menu or Menu bar (widget) design pattern} with some notable exceptions, so that it behaves better with screen reader user expectations for global navigation. We don't use <code class="prettyprint prettyprinted" style=""><span class="pln">role</span><span class="pun">=</span><span class="str">"menu"</span></code> for the menu container and <code class="prettyprint prettyprinted" style=""><span class="pln">role</span><span class="pun">=</span><span class="str">"menuitem"</span></code> for each of the links therein, because if we do, assistive technology will no longer interpret the links as links, but instead, as menu items, and the links in our global navigation will no longer show up when a screen reader user executes a shortcut command to bring up a list of links in the page.</p> * @example <h4>HTML</h4><hr/> &lt;nav&gt; &lt;ul class=&quot;nav-menu&quot;&gt; &lt;li class=&quot;nav-item&quot;&gt; &lt;a href=&quot;?movie&quot;&gt;Movies&lt;/a&gt; &lt;div class=&quot;sub-nav&quot;&gt; &lt;ul class=&quot;sub-nav-group&quot;&gt; &lt;li&gt;&lt;a href=&quot;?movie&amp;genre=0&quot;&gt;Action &amp;amp; Adventure&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;?movie&amp;genre=2&quot;&gt;Children &amp;amp; Family&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&amp;#8230;&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;sub-nav-group&quot;&gt; &lt;li&gt;&lt;a href=&quot;?movie&amp;genre=7&quot;&gt;Dramas&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;?movie&amp;genre=9&quot;&gt;Foreign&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&amp;#8230;&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;sub-nav-group&quot;&gt; &lt;li&gt;&lt;a href=&quot;?movie&amp;genre=14&quot;&gt;Musicals&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;?movie&amp;genre=15&quot;&gt;Romance&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&amp;#8230;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/li&gt; &lt;li class=&quot;nav-item&quot;&gt; &lt;a href=&quot;?tv&quot;&gt;TV Shows&lt;/a&gt; &lt;div class=&quot;sub-nav&quot;&gt; &lt;ul class=&quot;sub-nav-group&quot;&gt; &lt;li&gt;&lt;a href=&quot;?tv&amp;genre=20&quot;&gt;Classic TV&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;?tv&amp;genre=21&quot;&gt;Crime TV&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&amp;#8230;&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;sub-nav-group&quot;&gt; &lt;li&gt;&lt;a href=&quot;?tv&amp;genre=27&quot;&gt;Reality TV&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;?tv&amp;genre=30&quot;&gt;TV Action&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&amp;#8230;&lt;/li&gt; &lt;/ul&gt; &lt;ul class=&quot;sub-nav-group&quot;&gt; &lt;li&gt;&lt;a href=&quot;?tv&amp;genre=33&quot;&gt;TV Dramas&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href=&quot;?tv&amp;genre=34&quot;&gt;TV Horror&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&amp;#8230;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; * @example <h4>CSS</h4><hr/> &#47;* Rudimentary mega menu CSS for demonstration *&#47; &#47;* mega menu list *&#47; .nav-menu { display: block; position: relative; list-style: none; margin: 0; padding: 0; z-index: 15; } &#47;* a top level navigation item in the mega menu *&#47; .nav-item { list-style: none; display: inline-block; padding: 0; margin: 0; } &#47;* first descendant link within a top level navigation item *&#47; .nav-item &gt; a { position: relative; display: inline-block; padding: 0.5em 1em; margin: 0 0 -1px 0; border: 1px solid transparent; } &#47;* focus/open states of first descendant link within a top level navigation item *&#47; .nav-item &gt; a:focus, .nav-item &gt; a.open { border: 1px solid #dedede; } &#47;* open state of first descendant link within a top level navigation item *&#47; .nav-item &gt; a.open { background-color: #fff; border-bottom: none; z-index: 1; } &#47;* sub-navigation panel *&#47; .sub-nav { position: absolute; display: none; top: 2.2em; margin-top: -1px; padding: 0.5em 1em; border: 1px solid #dedede; background-color: #fff; } &#47;* sub-navigation panel open state *&#47; .sub-nav.open { display: block; } &#47;* list of items within sub-navigation panel *&#47; .sub-nav ul { display: inline-block; vertical-align: top; margin: 0 1em 0 0; padding: 0; } &#47;* list item within sub-navigation panel *&#47; .sub-nav li { display: block; list-style-type: none; margin: 0; padding: 0; } * @example <h4>JavaScript</h4><hr/> &lt;!-- include jquery --&gt; &lt;script src=&quot;http://code.jquery.com/jquery-1.10.1.min.js&quot;&gt;&lt;/script&gt; &lt;!-- include the jquery-accessibleMegaMenu plugin script --&gt; &lt;script src=&quot;js/jquery-accessibleMegaMenu.js&quot;&gt;&lt;/script&gt; &lt;!-- initialize a selector as an accessibleMegaMenu --&gt; &lt;script&gt; $(&quot;nav:first&quot;).accessibleMegaMenu({ &#47;* prefix for generated unique id attributes, which are required to indicate aria-owns, aria-controls and aria-labelledby *&#47; uuidPrefix: &quot;accessible-megamenu&quot;, &#47;* css class used to define the megamenu styling *&#47; menuClass: &quot;nav-menu&quot;, &#47;* css class for a top-level navigation item in the megamenu *&#47; topNavItemClass: &quot;nav-item&quot;, &#47;* css class for a megamenu panel *&#47; panelClass: &quot;sub-nav&quot;, &#47;* css class for a group of items within a megamenu panel *&#47; panelGroupClass: &quot;sub-nav-group&quot;, &#47;* css class for the hover state *&#47; hoverClass: &quot;hover&quot;, &#47;* css class for the focus state *&#47; focusClass: &quot;focus&quot;, &#47;* css class for the open state *&#47; openClass: &quot;open&quot; }); &lt;/script&gt; * @param {object} [options] Mega Menu options * @param {string} [options.uuidPrefix=accessible-megamenu] - Prefix for generated unique id attributes, which are required to indicate aria-owns, aria-controls and aria-labelledby * @param {string} [options.menuClass=accessible-megamenu] - CSS class used to define the megamenu styling * @param {string} [options.topNavItemClass=accessible-megamenu-top-nav-item] - CSS class for a top-level navigation item in the megamenu * @param {string} [options.panelClass=accessible-megamenu-panel] - CSS class for a megamenu panel * @param {string} [options.panelGroupClass=accessible-megamenu-panel-group] - CSS class for a group of items within a megamenu panel * @param {string} [options.hoverClass=hover] - CSS class for the hover state * @param {string} [options.focusClass=focus] - CSS class for the focus state * @param {string} [options.openClass=open] - CSS class for the open state * @param {string} [options.openDelay=0] - Open delay when opening menu via mouseover */ $.fn[pluginName] = function (options) { return this.each(function () { if (!$.data(this, "plugin_" + pluginName)) { $.data(this, "plugin_" + pluginName, new $.fn[pluginName].AccessibleMegaMenu(this, options)); } }); }; $.fn[pluginName].AccessibleMegaMenu = AccessibleMegaMenu; /* :focusable and :tabbable selectors from https://raw.github.com/jquery/jquery-ui/master/ui/jquery.ui.core.js */ /** * @private */ function visible(element) { return $.expr.filters.visible(element) && !$(element).parents().addBack().filter(function () { return $.css(this, "visibility") === "hidden"; }).length; } /** * @private */ function focusable(element, isTabIndexNotNaN) { var map, mapName, img, nodeName = element.nodeName.toLowerCase(); if ("area" === nodeName) { map = element.parentNode; mapName = map.name; if (!element.href || !mapName || map.nodeName.toLowerCase() !== "map") { return false; } img = $("img[usemap=#" + mapName + "]")[0]; return !!img && visible(img); } return (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : "a" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && // the element and all of its ancestors must be visible visible(element); } $.extend($.expr[":"], { data: $.expr.createPseudo ? $.expr.createPseudo(function (dataName) { return function (elem) { return !!$.data(elem, dataName); }; }) : // support: jQuery <1.8 function (elem, i, match) { return !!$.data(elem, match[3]); }, focusable: function (element) { return focusable(element, !isNaN($.attr(element, "tabindex"))); }, tabbable: function (element) { var tabIndex = $.attr(element, "tabindex"), isTabIndexNaN = isNaN(tabIndex); return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN); } }); }(jQuery, window, document)); /* */ "format cjs"; // Underscore.js 1.8.3 // http://underscorejs.org // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. (function() { // Baseline setup // -------------- // Establish the root object, `window` in the browser, or `exports` on the server. var root = this; // Save the previous value of the `_` variable. var previousUnderscore = root._; // Save bytes in the minified (but not gzipped) version: var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; // Create quick reference variables for speed access to core prototypes. var push = ArrayProto.push, slice = ArrayProto.slice, toString = ObjProto.toString, hasOwnProperty = ObjProto.hasOwnProperty; // All **ECMAScript 5** native function implementations that we hope to use // are declared here. var nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeBind = FuncProto.bind, nativeCreate = Object.create; // Naked function reference for surrogate-prototype-swapping. var Ctor = function(){}; // Create a safe reference to the Underscore object for use below. var _ = function(obj) { if (obj instanceof _) return obj; if (!(this instanceof _)) return new _(obj); this._wrapped = obj; }; // Export the Underscore object for **Node.js**, with // backwards-compatibility for the old `require()` API. If we're in // the browser, add `_` as a global object. if (typeof exports !== 'undefined') { if (typeof module !== 'undefined' && module.exports) { exports = module.exports = _; } exports._ = _; } else { root._ = _; } // Current version. _.VERSION = '1.8.3'; // Internal function that returns an efficient (for current engines) version // of the passed-in callback, to be repeatedly applied in other Underscore // functions. var optimizeCb = function(func, context, argCount) { if (context === void 0) return func; switch (argCount == null ? 3 : argCount) { case 1: return function(value) { return func.call(context, value); }; case 2: return function(value, other) { return func.call(context, value, other); }; case 3: return function(value, index, collection) { return func.call(context, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(context, accumulator, value, index, collection); }; } return function() { return func.apply(context, arguments); }; }; // A mostly-internal function to generate callbacks that can be applied // to each element in a collection, returning the desired result — either // identity, an arbitrary callback, a property matcher, or a property accessor. var cb = function(value, context, argCount) { if (value == null) return _.identity; if (_.isFunction(value)) return optimizeCb(value, context, argCount); if (_.isObject(value)) return _.matcher(value); return _.property(value); }; _.iteratee = function(value, context) { return cb(value, context, Infinity); }; // An internal function for creating assigner functions. var createAssigner = function(keysFunc, undefinedOnly) { return function(obj) { var length = arguments.length; if (length < 2 || obj == null) return obj; for (var index = 1; index < length; index++) { var source = arguments[index], keys = keysFunc(source), l = keys.length; for (var i = 0; i < l; i++) { var key = keys[i]; if (!undefinedOnly || obj[key] === void 0) obj[key] = source[key]; } } return obj; }; }; // An internal function for creating a new object that inherits from another. var baseCreate = function(prototype) { if (!_.isObject(prototype)) return {}; if (nativeCreate) return nativeCreate(prototype); Ctor.prototype = prototype; var result = new Ctor; Ctor.prototype = null; return result; }; var property = function(key) { return function(obj) { return obj == null ? void 0 : obj[key]; }; }; // Helper for collection methods to determine whether a collection // should be iterated as an array or as an object // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; var getLength = property('length'); var isArrayLike = function(collection) { var length = getLength(collection); return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX; }; // Collection Functions // -------------------- // The cornerstone, an `each` implementation, aka `forEach`. // Handles raw objects in addition to array-likes. Treats all // sparse array-likes as if they were dense. _.each = _.forEach = function(obj, iteratee, context) { iteratee = optimizeCb(iteratee, context); var i, length; if (isArrayLike(obj)) { for (i = 0, length = obj.length; i < length; i++) { iteratee(obj[i], i, obj); } } else { var keys = _.keys(obj); for (i = 0, length = keys.length; i < length; i++) { iteratee(obj[keys[i]], keys[i], obj); } } return obj; }; // Return the results of applying the iteratee to each element. _.map = _.collect = function(obj, iteratee, context) { iteratee = cb(iteratee, context); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, results = Array(length); for (var index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; results[index] = iteratee(obj[currentKey], currentKey, obj); } return results; }; // Create a reducing function iterating left or right. function createReduce(dir) { // Optimized iterator function as using arguments.length // in the main function will deoptimize the, see #1991. function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; } return function(obj, iteratee, memo, context) { iteratee = optimizeCb(iteratee, context, 4); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length, index = dir > 0 ? 0 : length - 1; // Determine the initial value if none is provided. if (arguments.length < 3) { memo = obj[keys ? keys[index] : index]; index += dir; } return iterator(obj, iteratee, memo, keys, index, length); }; } // **Reduce** builds up a single result from a list of values, aka `inject`, // or `foldl`. _.reduce = _.foldl = _.inject = createReduce(1); // The right-associative version of reduce, also known as `foldr`. _.reduceRight = _.foldr = createReduce(-1); // Return the first value which passes a truth test. Aliased as `detect`. _.find = _.detect = function(obj, predicate, context) { var key; if (isArrayLike(obj)) { key = _.findIndex(obj, predicate, context); } else { key = _.findKey(obj, predicate, context); } if (key !== void 0 && key !== -1) return obj[key]; }; // Return all the elements that pass a truth test. // Aliased as `select`. _.filter = _.select = function(obj, predicate, context) { var results = []; predicate = cb(predicate, context); _.each(obj, function(value, index, list) { if (predicate(value, index, list)) results.push(value); }); return results; }; // Return all the elements for which a truth test fails. _.reject = function(obj, predicate, context) { return _.filter(obj, _.negate(cb(predicate)), context); }; // Determine whether all of the elements match a truth test. // Aliased as `all`. _.every = _.all = function(obj, predicate, context) { predicate = cb(predicate, context); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (!predicate(obj[currentKey], currentKey, obj)) return false; } return true; }; // Determine if at least one element in the object matches a truth test. // Aliased as `any`. _.some = _.any = function(obj, predicate, context) { predicate = cb(predicate, context); var keys = !isArrayLike(obj) && _.keys(obj), length = (keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = keys ? keys[index] : index; if (predicate(obj[currentKey], currentKey, obj)) return true; } return false; }; // Determine if the array or object contains a given item (using `===`). // Aliased as `includes` and `include`. _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) { if (!isArrayLike(obj)) obj = _.values(obj); if (typeof fromIndex != 'number' || guard) fromIndex = 0; return _.indexOf(obj, item, fromIndex) >= 0; }; // Invoke a method (with arguments) on every item in a collection. _.invoke = function(obj, method) { var args = slice.call(arguments, 2); var isFunc = _.isFunction(method); return _.map(obj, function(value) { var func = isFunc ? method : value[method]; return func == null ? func : func.apply(value, args); }); }; // Convenience version of a common use case of `map`: fetching a property. _.pluck = function(obj, key) { return _.map(obj, _.property(key)); }; // Convenience version of a common use case of `filter`: selecting only objects // containing specific `key:value` pairs. _.where = function(obj, attrs) { return _.filter(obj, _.matcher(attrs)); }; // Convenience version of a common use case of `find`: getting the first object // containing specific `key:value` pairs. _.findWhere = function(obj, attrs) { return _.find(obj, _.matcher(attrs)); }; // Return the maximum element (or element-based computation). _.max = function(obj, iteratee, context) { var result = -Infinity, lastComputed = -Infinity, value, computed; if (iteratee == null && obj != null) { obj = isArrayLike(obj) ? obj : _.values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value > result) { result = value; } } } else { iteratee = cb(iteratee, context); _.each(obj, function(value, index, list) { computed = iteratee(value, index, list); if (computed > lastComputed || computed === -Infinity && result === -Infinity) { result = value; lastComputed = computed; } }); } return result; }; // Return the minimum element (or element-based computation). _.min = function(obj, iteratee, context) { var result = Infinity, lastComputed = Infinity, value, computed; if (iteratee == null && obj != null) { obj = isArrayLike(obj) ? obj : _.values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value < result) { result = value; } } } else { iteratee = cb(iteratee, context); _.each(obj, function(value, index, list) { computed = iteratee(value, index, list); if (computed < lastComputed || computed === Infinity && result === Infinity) { result = value; lastComputed = computed; } }); } return result; }; // Shuffle a collection, using the modern version of the // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). _.shuffle = function(obj) { var set = isArrayLike(obj) ? obj : _.values(obj); var length = set.length; var shuffled = Array(length); for (var index = 0, rand; index < length; index++) { rand = _.random(0, index); if (rand !== index) shuffled[index] = shuffled[rand]; shuffled[rand] = set[index]; } return shuffled; }; // Sample **n** random values from a collection. // If **n** is not specified, returns a single random element. // The internal `guard` argument allows it to work with `map`. _.sample = function(obj, n, guard) { if (n == null || guard) { if (!isArrayLike(obj)) obj = _.values(obj); return obj[_.random(obj.length - 1)]; } return _.shuffle(obj).slice(0, Math.max(0, n)); }; // Sort the object's values by a criterion produced by an iteratee. _.sortBy = function(obj, iteratee, context) { iteratee = cb(iteratee, context); return _.pluck(_.map(obj, function(value, index, list) { return { value: value, index: index, criteria: iteratee(value, index, list) }; }).sort(function(left, right) { var a = left.criteria; var b = right.criteria; if (a !== b) { if (a > b || a === void 0) return 1; if (a < b || b === void 0) return -1; } return left.index - right.index; }), 'value'); }; // An internal function used for aggregate "group by" operations. var group = function(behavior) { return function(obj, iteratee, context) { var result = {}; iteratee = cb(iteratee, context); _.each(obj, function(value, index) { var key = iteratee(value, index, obj); behavior(result, value, key); }); return result; }; }; // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. _.groupBy = group(function(result, value, key) { if (_.has(result, key)) result[key].push(value); else result[key] = [value]; }); // Indexes the object's values by a criterion, similar to `groupBy`, but for // when you know that your index values will be unique. _.indexBy = group(function(result, value, key) { result[key] = value; }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. _.countBy = group(function(result, value, key) { if (_.has(result, key)) result[key]++; else result[key] = 1; }); // Safely create a real, live array from anything iterable. _.toArray = function(obj) { if (!obj) return []; if (_.isArray(obj)) return slice.call(obj); if (isArrayLike(obj)) return _.map(obj, _.identity); return _.values(obj); }; // Return the number of elements in an object. _.size = function(obj) { if (obj == null) return 0; return isArrayLike(obj) ? obj.length : _.keys(obj).length; }; // Split a collection into two arrays: one whose elements all satisfy the given // predicate, and one whose elements all do not satisfy the predicate. _.partition = function(obj, predicate, context) { predicate = cb(predicate, context); var pass = [], fail = []; _.each(obj, function(value, key, obj) { (predicate(value, key, obj) ? pass : fail).push(value); }); return [pass, fail]; }; // Array Functions // --------------- // Get the first element of an array. Passing **n** will return the first N // values in the array. Aliased as `head` and `take`. The **guard** check // allows it to work with `_.map`. _.first = _.head = _.take = function(array, n, guard) { if (array == null) return void 0; if (n == null || guard) return array[0]; return _.initial(array, array.length - n); }; // Returns everything but the last entry of the array. Especially useful on // the arguments object. Passing **n** will return all the values in // the array, excluding the last N. _.initial = function(array, n, guard) { return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); }; // Get the last element of an array. Passing **n** will return the last N // values in the array. _.last = function(array, n, guard) { if (array == null) return void 0; if (n == null || guard) return array[array.length - 1]; return _.rest(array, Math.max(0, array.length - n)); }; // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. // Especially useful on the arguments object. Passing an **n** will return // the rest N values in the array. _.rest = _.tail = _.drop = function(array, n, guard) { return slice.call(array, n == null || guard ? 1 : n); }; // Trim out all falsy values from an array. _.compact = function(array) { return _.filter(array, _.identity); }; // Internal implementation of a recursive `flatten` function. var flatten = function(input, shallow, strict, startIndex) { var output = [], idx = 0; for (var i = startIndex || 0, length = getLength(input); i < length; i++) { var value = input[i]; if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) { //flatten current level of array or arguments object if (!shallow) value = flatten(value, shallow, strict); var j = 0, len = value.length; output.length += len; while (j < len) { output[idx++] = value[j++]; } } else if (!strict) { output[idx++] = value; } } return output; }; // Flatten out an array, either recursively (by default), or just one level. _.flatten = function(array, shallow) { return flatten(array, shallow, false); }; // Return a version of the array that does not contain the specified value(s). _.without = function(array) { return _.difference(array, slice.call(arguments, 1)); }; // Produce a duplicate-free version of the array. If the array has already // been sorted, you have the option of using a faster algorithm. // Aliased as `unique`. _.uniq = _.unique = function(array, isSorted, iteratee, context) { if (!_.isBoolean(isSorted)) { context = iteratee; iteratee = isSorted; isSorted = false; } if (iteratee != null) iteratee = cb(iteratee, context); var result = []; var seen = []; for (var i = 0, length = getLength(array); i < length; i++) { var value = array[i], computed = iteratee ? iteratee(value, i, array) : value; if (isSorted) { if (!i || seen !== computed) result.push(value); seen = computed; } else if (iteratee) { if (!_.contains(seen, computed)) { seen.push(computed); result.push(value); } } else if (!_.contains(result, value)) { result.push(value); } } return result; }; // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. _.union = function() { return _.uniq(flatten(arguments, true, true)); }; // Produce an array that contains every item shared between all the // passed-in arrays. _.intersection = function(array) { var result = []; var argsLength = arguments.length; for (var i = 0, length = getLength(array); i < length; i++) { var item = array[i]; if (_.contains(result, item)) continue; for (var j = 1; j < argsLength; j++) { if (!_.contains(arguments[j], item)) break; } if (j === argsLength) result.push(item); } return result; }; // Take the difference between one array and a number of other arrays. // Only the elements present in just the first array will remain. _.difference = function(array) { var rest = flatten(arguments, true, true, 1); return _.filter(array, function(value){ return !_.contains(rest, value); }); }; // Zip together multiple lists into a single array -- elements that share // an index go together. _.zip = function() { return _.unzip(arguments); }; // Complement of _.zip. Unzip accepts an array of arrays and groups // each array's elements on shared indices _.unzip = function(array) { var length = array && _.max(array, getLength).length || 0; var result = Array(length); for (var index = 0; index < length; index++) { result[index] = _.pluck(array, index); } return result; }; // Converts lists into objects. Pass either a single array of `[key, value]` // pairs, or two parallel arrays of the same length -- one of keys, and one of // the corresponding values. _.object = function(list, values) { var result = {}; for (var i = 0, length = getLength(list); i < length; i++) { if (values) { result[list[i]] = values[i]; } else { result[list[i][0]] = list[i][1]; } } return result; }; // Generator function to create the findIndex and findLastIndex functions function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); var length = getLength(array); var index = dir > 0 ? 0 : length - 1; for (; index >= 0 && index < length; index += dir) { if (predicate(array[index], index, array)) return index; } return -1; }; } // Returns the first index on an array-like that passes a predicate test _.findIndex = createPredicateIndexFinder(1); _.findLastIndex = createPredicateIndexFinder(-1); // Use a comparator function to figure out the smallest index at which // an object should be inserted so as to maintain order. Uses binary search. _.sortedIndex = function(array, obj, iteratee, context) { iteratee = cb(iteratee, context, 1); var value = iteratee(obj); var low = 0, high = getLength(array); while (low < high) { var mid = Math.floor((low + high) / 2); if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; } return low; }; // Generator function to create the indexOf and lastIndexOf functions function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if (typeof idx == 'number') { if (dir > 0) { i = idx >= 0 ? idx : Math.max(idx + length, i); } else { length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; } } else if (sortedIndex && idx && length) { idx = sortedIndex(array, item); return array[idx] === item ? idx : -1; } if (item !== item) { idx = predicateFind(slice.call(array, i, length), _.isNaN); return idx >= 0 ? idx + i : -1; } for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { if (array[idx] === item) return idx; } return -1; }; } // Return the position of the first occurrence of an item in an array, // or -1 if the item is not included in the array. // If the array is large and already in sort order, pass `true` // for **isSorted** to use binary search. _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex); _.lastIndexOf = createIndexFinder(-1, _.findLastIndex); // Generate an integer Array containing an arithmetic progression. A port of // the native Python `range()` function. See // [the Python documentation](http://docs.python.org/library/functions.html#range). _.range = function(start, stop, step) { if (stop == null) { stop = start || 0; start = 0; } step = step || 1; var length = Math.max(Math.ceil((stop - start) / step), 0); var range = Array(length); for (var idx = 0; idx < length; idx++, start += step) { range[idx] = start; } return range; }; // Function (ahem) Functions // ------------------ // Determines whether to execute a function as a constructor // or a normal function with the provided arguments var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) { if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); var self = baseCreate(sourceFunc.prototype); var result = sourceFunc.apply(self, args); if (_.isObject(result)) return result; return self; }; // Create a function bound to a given object (assigning `this`, and arguments, // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if // available. _.bind = function(func, context) { if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function'); var args = slice.call(arguments, 2); var bound = function() { return executeBound(func, bound, context, this, args.concat(slice.call(arguments))); }; return bound; }; // Partially apply a function by creating a version that has had some of its // arguments pre-filled, without changing its dynamic `this` context. _ acts // as a placeholder, allowing any combination of arguments to be pre-filled. _.partial = function(func) { var boundArgs = slice.call(arguments, 1); var bound = function() { var position = 0, length = boundArgs.length; var args = Array(length); for (var i = 0; i < length; i++) { args[i] = boundArgs[i] === _ ? arguments[position++] : boundArgs[i]; } while (position < arguments.length) args.push(arguments[position++]); return executeBound(func, bound, this, this, args); }; return bound; }; // Bind a number of an object's methods to that object. Remaining arguments // are the method names to be bound. Useful for ensuring that all callbacks // defined on an object belong to it. _.bindAll = function(obj) { var i, length = arguments.length, key; if (length <= 1) throw new Error('bindAll must be passed function names'); for (i = 1; i < length; i++) { key = arguments[i]; obj[key] = _.bind(obj[key], obj); } return obj; }; // Memoize an expensive function by storing its results. _.memoize = function(func, hasher) { var memoize = function(key) { var cache = memoize.cache; var address = '' + (hasher ? hasher.apply(this, arguments) : key); if (!_.has(cache, address)) cache[address] = func.apply(this, arguments); return cache[address]; }; memoize.cache = {}; return memoize; }; // Delays a function for the given number of milliseconds, and then calls // it with the arguments supplied. _.delay = function(func, wait) { var args = slice.call(arguments, 2); return setTimeout(function(){ return func.apply(null, args); }, wait); }; // Defers a function, scheduling it to run after the current call stack has // cleared. _.defer = _.partial(_.delay, _, 1); // Returns a function, that, when invoked, will only be triggered at most once // during a given window of time. Normally, the throttled function will run // as much as it can, without ever going more than once per `wait` duration; // but if you'd like to disable the execution on the leading edge, pass // `{leading: false}`. To disable execution on the trailing edge, ditto. _.throttle = function(func, wait, options) { var context, args, result; var timeout = null; var previous = 0; if (!options) options = {}; var later = function() { previous = options.leading === false ? 0 : _.now(); timeout = null; result = func.apply(context, args); if (!timeout) context = args = null; }; return function() { var now = _.now(); if (!previous && options.leading === false) previous = now; var remaining = wait - (now - previous); context = this; args = arguments; if (remaining <= 0 || remaining > wait) { if (timeout) { clearTimeout(timeout); timeout = null; } previous = now; result = func.apply(context, args); if (!timeout) context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; }; }; // Returns a function, that, as long as it continues to be invoked, will not // be triggered. The function will be called after it stops being called for // N milliseconds. If `immediate` is passed, trigger the function on the // leading edge, instead of the trailing. _.debounce = function(func, wait, immediate) { var timeout, args, context, timestamp, result; var later = function() { var last = _.now() - timestamp; if (last < wait && last >= 0) { timeout = setTimeout(later, wait - last); } else { timeout = null; if (!immediate) { result = func.apply(context, args); if (!timeout) context = args = null; } } }; return function() { context = this; args = arguments; timestamp = _.now(); var callNow = immediate && !timeout; if (!timeout) timeout = setTimeout(later, wait); if (callNow) { result = func.apply(context, args); context = args = null; } return result; }; }; // Returns the first function passed as an argument to the second, // allowing you to adjust arguments, run code before and after, and // conditionally execute the original function. _.wrap = function(func, wrapper) { return _.partial(wrapper, func); }; // Returns a negated version of the passed-in predicate. _.negate = function(predicate) { return function() { return !predicate.apply(this, arguments); }; }; // Returns a function that is the composition of a list of functions, each // consuming the return value of the function that follows. _.compose = function() { var args = arguments; var start = args.length - 1; return function() { var i = start; var result = args[start].apply(this, arguments); while (i--) result = args[i].call(this, result); return result; }; }; // Returns a function that will only be executed on and after the Nth call. _.after = function(times, func) { return function() { if (--times < 1) { return func.apply(this, arguments); } }; }; // Returns a function that will only be executed up to (but not including) the Nth call. _.before = function(times, func) { var memo; return function() { if (--times > 0) { memo = func.apply(this, arguments); } if (times <= 1) func = null; return memo; }; }; // Returns a function that will be executed at most one time, no matter how // often you call it. Useful for lazy initialization. _.once = _.partial(_.before, 2); // Object Functions // ---------------- // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; function collectNonEnumProps(obj, keys) { var nonEnumIdx = nonEnumerableProps.length; var constructor = obj.constructor; var proto = (_.isFunction(constructor) && constructor.prototype) || ObjProto; // Constructor is a special case. var prop = 'constructor'; if (_.has(obj, prop) && !_.contains(keys, prop)) keys.push(prop); while (nonEnumIdx--) { prop = nonEnumerableProps[nonEnumIdx]; if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) { keys.push(prop); } } } // Retrieve the names of an object's own properties. // Delegates to **ECMAScript 5**'s native `Object.keys` _.keys = function(obj) { if (!_.isObject(obj)) return []; if (nativeKeys) return nativeKeys(obj); var keys = []; for (var key in obj) if (_.has(obj, key)) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; }; // Retrieve all the property names of an object. _.allKeys = function(obj) { if (!_.isObject(obj)) return []; var keys = []; for (var key in obj) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; }; // Retrieve the values of an object's properties. _.values = function(obj) { var keys = _.keys(obj); var length = keys.length; var values = Array(length); for (var i = 0; i < length; i++) { values[i] = obj[keys[i]]; } return values; }; // Returns the results of applying the iteratee to each element of the object // In contrast to _.map it returns an object _.mapObject = function(obj, iteratee, context) { iteratee = cb(iteratee, context); var keys = _.keys(obj), length = keys.length, results = {}, currentKey; for (var index = 0; index < length; index++) { currentKey = keys[index]; results[currentKey] = iteratee(obj[currentKey], currentKey, obj); } return results; }; // Convert an object into a list of `[key, value]` pairs. _.pairs = function(obj) { var keys = _.keys(obj); var length = keys.length; var pairs = Array(length); for (var i = 0; i < length; i++) { pairs[i] = [keys[i], obj[keys[i]]]; } return pairs; }; // Invert the keys and values of an object. The values must be serializable. _.invert = function(obj) { var result = {}; var keys = _.keys(obj); for (var i = 0, length = keys.length; i < length; i++) { result[obj[keys[i]]] = keys[i]; } return result; }; // Return a sorted list of the function names available on the object. // Aliased as `methods` _.functions = _.methods = function(obj) { var names = []; for (var key in obj) { if (_.isFunction(obj[key])) names.push(key); } return names.sort(); }; // Extend a given object with all the properties in passed-in object(s). _.extend = createAssigner(_.allKeys); // Assigns a given object with all the own properties in the passed-in object(s) // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) _.extendOwn = _.assign = createAssigner(_.keys); // Returns the first key on an object that passes a predicate test _.findKey = function(obj, predicate, context) { predicate = cb(predicate, context); var keys = _.keys(obj), key; for (var i = 0, length = keys.length; i < length; i++) { key = keys[i]; if (predicate(obj[key], key, obj)) return key; } }; // Return a copy of the object only containing the whitelisted properties. _.pick = function(object, oiteratee, context) { var result = {}, obj = object, iteratee, keys; if (obj == null) return result; if (_.isFunction(oiteratee)) { keys = _.allKeys(obj); iteratee = optimizeCb(oiteratee, context); } else { keys = flatten(arguments, false, false, 1); iteratee = function(value, key, obj) { return key in obj; }; obj = Object(obj); } for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i]; var value = obj[key]; if (iteratee(value, key, obj)) result[key] = value; } return result; }; // Return a copy of the object without the blacklisted properties. _.omit = function(obj, iteratee, context) { if (_.isFunction(iteratee)) { iteratee = _.negate(iteratee); } else { var keys = _.map(flatten(arguments, false, false, 1), String); iteratee = function(value, key) { return !_.contains(keys, key); }; } return _.pick(obj, iteratee, context); }; // Fill in a given object with default properties. _.defaults = createAssigner(_.allKeys, true); // Creates an object that inherits from the given prototype object. // If additional properties are provided then they will be added to the // created object. _.create = function(prototype, props) { var result = baseCreate(prototype); if (props) _.extendOwn(result, props); return result; }; // Create a (shallow-cloned) duplicate of an object. _.clone = function(obj) { if (!_.isObject(obj)) return obj; return _.isArray(obj) ? obj.slice() : _.extend({}, obj); }; // Invokes interceptor with the obj, and then returns obj. // The primary purpose of this method is to "tap into" a method chain, in // order to perform operations on intermediate results within the chain. _.tap = function(obj, interceptor) { interceptor(obj); return obj; }; // Returns whether an object has a given set of `key:value` pairs. _.isMatch = function(object, attrs) { var keys = _.keys(attrs), length = keys.length; if (object == null) return !length; var obj = Object(object); for (var i = 0; i < length; i++) { var key = keys[i]; if (attrs[key] !== obj[key] || !(key in obj)) return false; } return true; }; // Internal recursive comparison function for `isEqual`. var eq = function(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). if (a === b) return a !== 0 || 1 / a === 1 / b; // A strict comparison is necessary because `null == undefined`. if (a == null || b == null) return a === b; // Unwrap any wrapped objects. if (a instanceof _) a = a._wrapped; if (b instanceof _) b = b._wrapped; // Compare `[[Class]]` names. var className = toString.call(a); if (className !== toString.call(b)) return false; switch (className) { // Strings, numbers, regular expressions, dates, and booleans are compared by value. case '[object RegExp]': // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') case '[object String]': // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is // equivalent to `new String("5")`. return '' + a === '' + b; case '[object Number]': // `NaN`s are equivalent, but non-reflexive. // Object(NaN) is equivalent to NaN if (+a !== +a) return +b !== +b; // An `egal` comparison is performed for other numeric values. return +a === 0 ? 1 / +a === 1 / b : +a === +b; case '[object Date]': case '[object Boolean]': // Coerce dates and booleans to numeric primitive values. Dates are compared by their // millisecond representations. Note that invalid dates with millisecond representations // of `NaN` are not equivalent. return +a === +b; } var areArrays = className === '[object Array]'; if (!areArrays) { if (typeof a != 'object' || typeof b != 'object') return false; // Objects with different constructors are not equivalent, but `Object`s or `Array`s // from different frames are. var aCtor = a.constructor, bCtor = b.constructor; if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor && _.isFunction(bCtor) && bCtor instanceof bCtor) && ('constructor' in a && 'constructor' in b)) { return false; } } // Assume equality for cyclic structures. The algorithm for detecting cyclic // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. // Initializing stack of traversed objects. // It's done here since we only need them for objects and arrays comparison. aStack = aStack || []; bStack = bStack || []; var length = aStack.length; while (length--) { // Linear search. Performance is inversely proportional to the number of // unique nested structures. if (aStack[length] === a) return bStack[length] === b; } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); // Recursively compare objects and arrays. if (areArrays) { // Compare array lengths to determine if a deep comparison is necessary. length = a.length; if (length !== b.length) return false; // Deep compare the contents, ignoring non-numeric properties. while (length--) { if (!eq(a[length], b[length], aStack, bStack)) return false; } } else { // Deep compare objects. var keys = _.keys(a), key; length = keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality. if (_.keys(b).length !== length) return false; while (length--) { // Deep compare each member key = keys[length]; if (!(_.has(b, key) && eq(a[key], b[key], aStack, bStack))) return false; } } // Remove the first object from the stack of traversed objects. aStack.pop(); bStack.pop(); return true; }; // Perform a deep comparison to check if two objects are equal. _.isEqual = function(a, b) { return eq(a, b); }; // Is a given array, string, or object empty? // An "empty" object has no enumerable own-properties. _.isEmpty = function(obj) { if (obj == null) return true; if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0; return _.keys(obj).length === 0; }; // Is a given value a DOM element? _.isElement = function(obj) { return !!(obj && obj.nodeType === 1); }; // Is a given value an array? // Delegates to ECMA5's native Array.isArray _.isArray = nativeIsArray || function(obj) { return toString.call(obj) === '[object Array]'; }; // Is a given variable an object? _.isObject = function(obj) { var type = typeof obj; return type === 'function' || type === 'object' && !!obj; }; // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError. _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error'], function(name) { _['is' + name] = function(obj) { return toString.call(obj) === '[object ' + name + ']'; }; }); // Define a fallback version of the method in browsers (ahem, IE < 9), where // there isn't any inspectable "Arguments" type. if (!_.isArguments(arguments)) { _.isArguments = function(obj) { return _.has(obj, 'callee'); }; } // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8, // IE 11 (#1621), and in Safari 8 (#1929). if (typeof /./ != 'function' && typeof Int8Array != 'object') { _.isFunction = function(obj) { return typeof obj == 'function' || false; }; } // Is a given object a finite number? _.isFinite = function(obj) { return isFinite(obj) && !isNaN(parseFloat(obj)); }; // Is the given value `NaN`? (NaN is the only number which does not equal itself). _.isNaN = function(obj) { return _.isNumber(obj) && obj !== +obj; }; // Is a given value a boolean? _.isBoolean = function(obj) { return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; }; // Is a given value equal to null? _.isNull = function(obj) { return obj === null; }; // Is a given variable undefined? _.isUndefined = function(obj) { return obj === void 0; }; // Shortcut function for checking if an object has a given property directly // on itself (in other words, not on a prototype). _.has = function(obj, key) { return obj != null && hasOwnProperty.call(obj, key); }; // Utility Functions // ----------------- // Run Underscore.js in *noConflict* mode, returning the `_` variable to its // previous owner. Returns a reference to the Underscore object. _.noConflict = function() { root._ = previousUnderscore; return this; }; // Keep the identity function around for default iteratees. _.identity = function(value) { return value; }; // Predicate-generating functions. Often useful outside of Underscore. _.constant = function(value) { return function() { return value; }; }; _.noop = function(){}; _.property = property; // Generates a function for a given object that returns a given property. _.propertyOf = function(obj) { return obj == null ? function(){} : function(key) { return obj[key]; }; }; // Returns a predicate for checking whether an object has a given set of // `key:value` pairs. _.matcher = _.matches = function(attrs) { attrs = _.extendOwn({}, attrs); return function(obj) { return _.isMatch(obj, attrs); }; }; // Run a function **n** times. _.times = function(n, iteratee, context) { var accum = Array(Math.max(0, n)); iteratee = optimizeCb(iteratee, context, 1); for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; }; // Return a random integer between min and max (inclusive). _.random = function(min, max) { if (max == null) { max = min; min = 0; } return min + Math.floor(Math.random() * (max - min + 1)); }; // A (possibly faster) way to get the current timestamp as an integer. _.now = Date.now || function() { return new Date().getTime(); }; // List of HTML entities for escaping. var escapeMap = { '&': '&amp;', '<': '&lt;', '>': '&gt;', '"': '&quot;', "'": '&#x27;', '`': '&#x60;' }; var unescapeMap = _.invert(escapeMap); // Functions for escaping and unescaping strings to/from HTML interpolation. var createEscaper = function(map) { var escaper = function(match) { return map[match]; }; // Regexes for identifying a key that needs to be escaped var source = '(?:' + _.keys(map).join('|') + ')'; var testRegexp = RegExp(source); var replaceRegexp = RegExp(source, 'g'); return function(string) { string = string == null ? '' : '' + string; return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; }; _.escape = createEscaper(escapeMap); _.unescape = createEscaper(unescapeMap); // If the value of the named `property` is a function then invoke it with the // `object` as context; otherwise, return it. _.result = function(object, property, fallback) { var value = object == null ? void 0 : object[property]; if (value === void 0) { value = fallback; } return _.isFunction(value) ? value.call(object) : value; }; // Generate a unique integer id (unique within the entire client session). // Useful for temporary DOM ids. var idCounter = 0; _.uniqueId = function(prefix) { var id = ++idCounter + ''; return prefix ? prefix + id : id; }; // By default, Underscore uses ERB-style template delimiters, change the // following template settings to use alternative delimiters. _.templateSettings = { evaluate : /<%([\s\S]+?)%>/g, interpolate : /<%=([\s\S]+?)%>/g, escape : /<%-([\s\S]+?)%>/g }; // When customizing `templateSettings`, if you don't want to define an // interpolation, evaluation or escaping regex, we need one that is // guaranteed not to match. var noMatch = /(.)^/; // Certain characters need to be escaped so that they can be put into a // string literal. var escapes = { "'": "'", '\\': '\\', '\r': 'r', '\n': 'n', '\u2028': 'u2028', '\u2029': 'u2029' }; var escaper = /\\|'|\r|\n|\u2028|\u2029/g; var escapeChar = function(match) { return '\\' + escapes[match]; }; // JavaScript micro-templating, similar to John Resig's implementation. // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. // NB: `oldSettings` only exists for backwards compatibility. _.template = function(text, settings, oldSettings) { if (!settings && oldSettings) settings = oldSettings; settings = _.defaults({}, settings, _.templateSettings); // Combine delimiters into one regular expression via alternation. var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source ].join('|') + '|$', 'g'); // Compile the template source, escaping string literals appropriately. var index = 0; var source = "__p+='"; text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { source += text.slice(index, offset).replace(escaper, escapeChar); index = offset + match.length; if (escape) { source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; } else if (interpolate) { source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; } else if (evaluate) { source += "';\n" + evaluate + "\n__p+='"; } // Adobe VMs need the match returned to produce the correct offest. return match; }); source += "';\n"; // If a variable is not specified, place data values in local scope. if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + source + 'return __p;\n'; try { var render = new Function(settings.variable || 'obj', '_', source); } catch (e) { e.source = source; throw e; } var template = function(data) { return render.call(this, data, _); }; // Provide the compiled source as a convenience for precompilation. var argument = settings.variable || 'obj'; template.source = 'function(' + argument + '){\n' + source + '}'; return template; }; // Add a "chain" function. Start chaining a wrapped Underscore object. _.chain = function(obj) { var instance = _(obj); instance._chain = true; return instance; }; // OOP // --------------- // If Underscore is called as a function, it returns a wrapped object that // can be used OO-style. This wrapper holds altered versions of all the // underscore functions. Wrapped objects may be chained. // Helper function to continue chaining intermediate results. var result = function(instance, obj) { return instance._chain ? _(obj).chain() : obj; }; // Add your own custom functions to the Underscore object. _.mixin = function(obj) { _.each(_.functions(obj), function(name) { var func = _[name] = obj[name]; _.prototype[name] = function() { var args = [this._wrapped]; push.apply(args, arguments); return result(this, func.apply(_, args)); }; }); }; // Add all of the Underscore functions to the wrapper object. _.mixin(_); // Add all mutator Array functions to the wrapper. _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { var obj = this._wrapped; method.apply(obj, arguments); if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0]; return result(this, obj); }; }); // Add all accessor Array functions to the wrapper. _.each(['concat', 'join', 'slice'], function(name) { var method = ArrayProto[name]; _.prototype[name] = function() { return result(this, method.apply(this._wrapped, arguments)); }; }); // Extracts the result from a wrapped and chained object. _.prototype.value = function() { return this._wrapped; }; // Provide unwrapping proxy for some methods used in engine operations // such as arithmetic and JSON stringification. _.prototype.valueOf = _.prototype.toJSON = _.prototype.value; _.prototype.toString = function() { return '' + this._wrapped; }; // AMD registration happens at the end for compatibility with AMD loaders // that may not enforce next-turn semantics on modules. Even though general // practice for AMD registration is to be anonymous, underscore registers // as a named module because, like jQuery, it is a base library that is // popular enough to be bundled in a third party lib, but not be part of // an AMD load request. Those cases could generate an error when an // anonymous define() is called outside of a loader request. if (typeof define === 'function' && define.amd) { define('underscore', [], function() { return _; }); } }.call(this)); /*! * intention.js Library v0.9.9 * http://intentionjs.com/ * * Copyright 2011, 2013 Dowjones and other contributors * Released under the MIT license * */ (function(root, factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define('intention', ['jquery', 'underscore'], factory); } else { root.Intention = factory(root.jQuery, root._); } }(this, function($, _) { 'use strict'; var Intention = function(params){ var intent = _.extend(this, params, {_listeners:{}, contexts:[], elms:$(), axes:{}, priority:[]}); return intent; }; Intention.prototype = { // public methods responsive:function responsive(contexts, options){ // for generating random ids for axis when not specified var idChars = 'abcdefghijklmnopqrstuvwxyz0123456789', id='', i; // create a random id for the axis for(i=0; i<5; i++){ id += idChars[Math.floor(Math.random() * idChars.length)]; } var defaults = { // if no matcher function is specified expect to compare a // string to the ctx.name property matcher: function(measure, ctx){ return measure === ctx.name; }, // function takes one arg and returns it measure: _.identity, ID: id }; if(_.isObject(options) === false) { options = {}; } if((_.isArray(contexts)) && (_.isArray(contexts[0].contexts))){ _.each(contexts, function(axis){ responsive.apply(this, axis); }, this); return; } if((_.isArray(contexts) === false) && _.isObject(contexts)){ options = contexts; } else { options.contexts = contexts; } // fill in the options options = _.extend({}, defaults, options); // bind an the respond function to the axis ID and prefix it // with an underscore so that it does not get whomped accidentally this.on('_' + options.ID + ':', _.bind( function(e){ this.axes = this._contextualize( options.ID, e.context, this.axes); this._respond(this.axes, this.elms); }, this)); var axis = { ID:options.ID, current:null, contexts:options.contexts, respond:_.bind(this._responder(options.ID, options.contexts, options.matcher, options.measure), this) }; this.axes[options.ID] = axis; this.axes.__keys__ = this.priority; this.priority.unshift(options.ID); return axis; }, elements: function(scope){ // find all responsive elms in a specific dom scope if(!scope){ scope = document; } $('[data-intent],[intent],[data-in],[in]', scope).each(_.bind(function(i, elm){ this.add($(elm)); }, this)); return this; }, add: function(elms, options){ var spec; if(!options) { options = {}; } // is expecting a jquery object elms.each(_.bind(function(i, elm){ var exists = false; this.elms.each(function(i, respElm){ if(elm === respElm) { exists=true; return false; } return true; }); if(exists === false){ // create the elements responsive data spec = this._fillSpec( _.extend(options, this._attrsToSpec(elm.attributes, this.axes))); // make any appropriate changes based on the current contexts this._makeChanges($(elm), spec, this.axes); this.elms.push({ elm: elm, spec: spec }); } }, this)); return this; }, remove: function(elms){ // is expecting a jquery object var respElms = this.elms; // elms to remove elms.each(function(i, elm){ // elms to check against respElms.each(function(i, candidate){ if(elm === candidate.elm){ respElms.splice(i, 1); // found the match, break the loop return false; } return true; }); }); return this; }, is: function(ctxName){ var axes = this.axes; return _.some(axes.__keys__, function(key){ return ctxName === axes[key].current; }); }, current: function(axisName){ if(this.axes.hasOwnProperty(axisName)){ return this.axes[axisName].current; } else { return false; } }, // code and concept taken from simple implementation of // observer pattern outlined here: // http://www.nczonline.net/blog/2010/03/09/custom-events-in-javascript/ on: function(type, listener){ var events = type.split(' '), i=0; for(i;i<events.length;i++){ if(this._listeners[events[i]] === undefined) { this._listeners[events[i]]=[]; } this._listeners[events[i]].push(listener); } return this; }, off: function(type, listener){ if(_.isArray(this._listeners[type])){ var listeners = this._listeners[type], i; for(i=0;listeners.length; i++){ if(listeners[i] === listener){ listeners.splice(i,1); break; } } } return this; }, // privates _responder: function(axisID, contexts, matcher, measure){ var currentContext; // called to perform a check return function(){ var measurement = measure.apply(this, arguments); _.every(contexts, function(ctx){ if( matcher(measurement, ctx)) { // first time, or different than last context if( (currentContext===undefined) || (ctx.name !== currentContext.name)){ currentContext = ctx; // event emitting! // emit the private axis event this._emitter( {_type: '_' + axisID + ':', context:currentContext.name}, currentContext, this) // emit the public axis event ._emitter({_type: axisID + ':', context:currentContext.name}, currentContext, this) // attempt to trigger the axis to context pair ._emitter(_.extend({}, {_type: axisID + ':' + currentContext.name}, currentContext), currentContext, this) // then emit the context event (second ensures the context // changes happen after all dom manipulations) ._emitter(_.extend({}, {_type:currentContext.name}, currentContext), currentContext, this); // done, break the loop return false; } // same context, break the loop return false; } return true; }, this); // return the intention object for chaining return this; }; }, _emitter: function(event){ if(typeof event === 'string') { event={_type:event}; } if(!event.target){ event.target=this; } if(!event._type){ throw new Error(event._type + ' is not a supported event.'); } if(_.isArray(this._listeners[event._type])){ var listeners = this._listeners[event._type], i; for(i=0; i<listeners.length; i++){ listeners[i].apply(this, arguments); } } return this; }, _fillSpec: function(spec){ var applySpec = function(fn){ _.each(spec, function(axisOptions, axis){ _.each(axisOptions, function(ctxOptions, ctx){ fn(ctxOptions, ctx, axis); }); }); }, filler={}; applySpec(function(options){ // check to see if the ctx val is an object, could be a string if(_.isObject(options)){ _.each(options, function(val, func){ filler[func] = ''; }); } }); applySpec(function(options, ctx, axis){ if(_.isObject(options)){ spec[axis][ctx] = _.extend({}, filler, options); } }); return spec; }, _assocAxis: function(ctx, axes){ var match=false; _.every(axes.__keys__, function(axis){ if(match === false){ _.every(axes[axis].contexts, function(ctxCandidate){ if(ctxCandidate.name === ctx){ match = axis; return false; } return true; }); return true; }else { return false; } }); return match; }, _makeSpec: function(axis, ctx, sAttr, value, spec){ var axisObj, ctxObj; if(spec[axis] !== undefined){ axisObj = spec[axis]; if(axisObj[ctx] === undefined) { axisObj[ctx] = {}; } } else { axisObj = {}; axisObj[ctx] = {}; spec[axis] = axisObj; } axisObj[ctx][sAttr] = value; return spec; }, _attrsToSpec: function(attrs, axes){ var spec={}, fullPattern = new RegExp( '^(data-)?(in|intent)-(([a-zA-Z0-9][a-zA-Z0-9]*:)?([a-zA-Z0-9]*))-([A-Za-z:-]+)'), axisPattern = new RegExp( '^(data-)?(in|intent)-([a-zA-Z0-9][_a-zA-Z0-9]*):$'); _.each(attrs, function(attr){ var specMatch = attr.name.match(fullPattern), axisName; if(specMatch !== null) { specMatch = specMatch.slice(-3); axisName = specMatch[0]; if((specMatch[0] === undefined) || (specMatch[0] === '')){ // if there is no axis find one: specMatch[0] = this._assocAxis(specMatch[1], axes); if(specMatch[0] === false) { // there is no context, so get outa here return; // skipt the attr } } else { specMatch[0] = specMatch[0].replace(/:$/, '');} specMatch.push(attr.value); specMatch.push(spec); spec = this._makeSpec.apply(this, specMatch); } else if(axisPattern.test(attr.name)){ axisName = attr.name.match(axisPattern)[3]; _.each(axes[axisName].contexts, function(context){ this._makeSpec(axisName, context.name, 'class', context.name + ' ' + attr.value, spec); }, this);}}, this); return spec; }, _contextSpec: function(ctxObj, specs){ if(specs.hasOwnProperty(ctxObj.axis) && specs[ctxObj.axis].hasOwnProperty(ctxObj.ctx)){ return specs[ctxObj.axis][ctxObj.ctx]; } return {}; }, _resolveSpecs: function(currentContexts, specs){ var changes={}, moveFuncs=['append', 'prepend', 'before', 'after']; _.each(currentContexts, function(ctxObj){ // if the axis or the context to not exist in the specs object // skip to the next one _.each(this._contextSpec(ctxObj, specs), function(val, func){ if(func==='class'){ if(!changes[func]){ changes[func] = []; } changes[func] = _.union(changes[func], val.split(' ')); } else if(((changes.move === undefined) || (changes.move.value === '')) && ($.inArray(func, moveFuncs) !== -1)){ changes.move = {value:val, placement:func}; } else { if((changes[func] === undefined) || (changes[func] === '')){ changes[func]=val; } } }, this); }, this); return changes; }, _currentContexts: function(axes) { var contexts = []; _.each(axes.__keys__, function(ID){ if(axes[ID].current !== null) { contexts.push({ctx:axes[ID].current, axis:ID}); return; } }); return contexts; }, _removeClasses: function(specs, axes) { var toRemove = []; _.each(axes.__keys__, function(key){ var axis = axes[key]; _.each(axis.contexts, function(ctx){ // ignore the current context, those classes SHOULD be applied if(ctx.name === axis.current) { return; } var contextSpec = this._contextSpec( {axis:axis.ID, ctx:ctx.name}, specs), classes; if(contextSpec !== undefined) { if(contextSpec['class'] !== undefined) { classes = contextSpec['class'].split(' '); if(classes !== undefined){ toRemove = _.union(toRemove, classes); } } } }, this); }, this); return toRemove; }, _contextConfig: function(specs, axes){ return this._resolveSpecs(this._currentContexts(axes), specs, axes); }, _makeChanges: function(elm, specs, axes){ if(_.isEmpty(axes)===false){ var ctxConfig = this._contextConfig(specs, axes); _.each(ctxConfig, function(change, func){ if(func==='move'){ if( (specs.__placement__ !== change.placement) || (specs.__move__ !== change.value)){ $(change.value)[change.placement](elm); // save the last placement of the element so // we're not moving it around for no good reason specs.__placement__ = change.placement; specs.__move__ = change.value; } } else if(func === 'class') { var classes = elm.attr('class') || ''; // the class add/remove formula classes = _.union(change, _.difference(classes.split(' '), this._removeClasses(specs, axes))); elm.attr('class', classes.join(' ')); } else { elm.attr(func, change); } }, this); } return elm; }, _respond: function(axes, elms){ // go through all of the responsive elms elms.each(_.bind(function(i, elm){ var $elm = $(elm.elm); this._makeChanges($elm, elm.spec, axes); $elm.trigger('intent', this); }, this)); }, _contextualize: function(axisID, context, axes){ axes[axisID].current = context; return axes; }, // private props // axis test, does it begin with an underscore? for testing inside // spec objects _axis_test_pattern: new RegExp("^_[a-zA-Z0-9]"), // match a group after the underscore: _axis_match_pattern: new RegExp("^_([a-zA-Z0-9][_a-zA-Z0-9]*)"), // simple trim _trim_pattern:new RegExp( "^\s+|\s+$", "g" ) }; return Intention; })); //! moment.js //! version : 2.10.6 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() }(this, function () { 'use strict'; var hookCallback; function utils_hooks__hooks () { return hookCallback.apply(null, arguments); } // This is done to register the method called with moment() // without creating circular dependencies. function setHookCallback (callback) { hookCallback = callback; } function isArray(input) { return Object.prototype.toString.call(input) === '[object Array]'; } function isDate(input) { return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; } function map(arr, fn) { var res = [], i; for (i = 0; i < arr.length; ++i) { res.push(fn(arr[i], i)); } return res; } function hasOwnProp(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } function extend(a, b) { for (var i in b) { if (hasOwnProp(b, i)) { a[i] = b[i]; } } if (hasOwnProp(b, 'toString')) { a.toString = b.toString; } if (hasOwnProp(b, 'valueOf')) { a.valueOf = b.valueOf; } return a; } function create_utc__createUTC (input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, true).utc(); } function defaultParsingFlags() { // We need to deep clone this object. return { empty : false, unusedTokens : [], unusedInput : [], overflow : -2, charsLeftOver : 0, nullInput : false, invalidMonth : null, invalidFormat : false, userInvalidated : false, iso : false }; } function getParsingFlags(m) { if (m._pf == null) { m._pf = defaultParsingFlags(); } return m._pf; } function valid__isValid(m) { if (m._isValid == null) { var flags = getParsingFlags(m); m._isValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated; if (m._strict) { m._isValid = m._isValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; } } return m._isValid; } function valid__createInvalid (flags) { var m = create_utc__createUTC(NaN); if (flags != null) { extend(getParsingFlags(m), flags); } else { getParsingFlags(m).userInvalidated = true; } return m; } var momentProperties = utils_hooks__hooks.momentProperties = []; function copyConfig(to, from) { var i, prop, val; if (typeof from._isAMomentObject !== 'undefined') { to._isAMomentObject = from._isAMomentObject; } if (typeof from._i !== 'undefined') { to._i = from._i; } if (typeof from._f !== 'undefined') { to._f = from._f; } if (typeof from._l !== 'undefined') { to._l = from._l; } if (typeof from._strict !== 'undefined') { to._strict = from._strict; } if (typeof from._tzm !== 'undefined') { to._tzm = from._tzm; } if (typeof from._isUTC !== 'undefined') { to._isUTC = from._isUTC; } if (typeof from._offset !== 'undefined') { to._offset = from._offset; } if (typeof from._pf !== 'undefined') { to._pf = getParsingFlags(from); } if (typeof from._locale !== 'undefined') { to._locale = from._locale; } if (momentProperties.length > 0) { for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; if (typeof val !== 'undefined') { to[prop] = val; } } } return to; } var updateInProgress = false; // Moment prototype object function Moment(config) { copyConfig(this, config); this._d = new Date(config._d != null ? config._d.getTime() : NaN); // Prevent infinite loop in case updateOffset creates new moment // objects. if (updateInProgress === false) { updateInProgress = true; utils_hooks__hooks.updateOffset(this); updateInProgress = false; } } function isMoment (obj) { return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); } function absFloor (number) { if (number < 0) { return Math.ceil(number); } else { return Math.floor(number); } } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; } function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ((dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { diffs++; } } return diffs + lengthDiff; } function Locale() { } var locales = {}; var globalLocale; function normalizeLocale(key) { return key ? key.toLowerCase().replace('_', '-') : key; } // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return null; } function loadLocale(name) { var oldLocale = null; // TODO: Find a better way to register and load all the locales in Node if (!locales[name] && typeof module !== 'undefined' && module && module.exports) { try { oldLocale = globalLocale._abbr; require('./locale/' + name); // because defineLocale currently also sets the global locale, we // want to undo that for lazy loaded locales locale_locales__getSetGlobalLocale(oldLocale); } catch (e) { } } return locales[name]; } // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. function locale_locales__getSetGlobalLocale (key, values) { var data; if (key) { if (typeof values === 'undefined') { data = locale_locales__getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } } return globalLocale._abbr; } function defineLocale (name, values) { if (values !== null) { values.abbr = name; locales[name] = locales[name] || new Locale(); locales[name].set(values); // backwards compat for now: also set the locale locale_locales__getSetGlobalLocale(name); return locales[name]; } else { // useful for testing delete locales[name]; return null; } } // returns locale data function locale_locales__getLocale (key) { var locale; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return globalLocale; } if (!isArray(key)) { //short-circuit everything else locale = loadLocale(key); if (locale) { return locale; } key = [key]; } return chooseLocale(key); } var aliases = {}; function addUnitAlias (unit, shorthand) { var lowerCase = unit.toLowerCase(); aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; } function normalizeUnits(units) { return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (hasOwnProp(inputObject, prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } function makeGetSet (unit, keepTime) { return function (value) { if (value != null) { get_set__set(this, unit, value); utils_hooks__hooks.updateOffset(this, keepTime); return this; } else { return get_set__get(this, unit); } }; } function get_set__get (mom, unit) { return mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit](); } function get_set__set (mom, unit, value) { return mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); } // MOMENTS function getSet (units, value) { var unit; if (typeof units === 'object') { for (unit in units) { this.set(unit, units[unit]); } } else { units = normalizeUnits(units); if (typeof this[units] === 'function') { return this[units](value); } } return this; } function zeroFill(number, targetLength, forceSign) { var absNumber = '' + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign = number >= 0; return (sign ? (forceSign ? '+' : '') : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; } var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; var formatFunctions = {}; var formatTokenFunctions = {}; // token: 'M' // padded: ['MM', 2] // ordinal: 'Mo' // callback: function () { this.month() + 1 } function addFormatToken (token, padded, ordinal, callback) { var func = callback; if (typeof callback === 'string') { func = function () { return this[callback](); }; } if (token) { formatTokenFunctions[token] = func; } if (padded) { formatTokenFunctions[padded[0]] = function () { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }; } if (ordinal) { formatTokenFunctions[ordinal] = function () { return this.localeData().ordinal(func.apply(this, arguments), token); }; } } function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ''); } return input.replace(/\\/g, ''); } function makeFormatFunction(format) { var array = format.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function (mom) { var output = ''; for (i = 0; i < length; i++) { output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; } return output; }; } // format date using native date object function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format)) { format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); localFormattingTokens.lastIndex = 0; i -= 1; } return format; } var match1 = /\d/; // 0 - 9 var match2 = /\d\d/; // 00 - 99 var match3 = /\d{3}/; // 000 - 999 var match4 = /\d{4}/; // 0000 - 9999 var match6 = /[+-]?\d{6}/; // -999999 - 999999 var match1to2 = /\d\d?/; // 0 - 99 var match1to3 = /\d{1,3}/; // 0 - 999 var match1to4 = /\d{1,4}/; // 0 - 9999 var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 var matchUnsigned = /\d+/; // 0 - inf var matchSigned = /[+-]?\d+/; // -inf - inf var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; var regexes = {}; function isFunction (sth) { // https://github.com/moment/moment/issues/2325 return typeof sth === 'function' && Object.prototype.toString.call(sth) === '[object Function]'; } function addRegexToken (token, regex, strictRegex) { regexes[token] = isFunction(regex) ? regex : function (isStrict) { return (isStrict && strictRegex) ? strictRegex : regex; }; } function getParseRegexForToken (token, config) { if (!hasOwnProp(regexes, token)) { return new RegExp(unescapeFormat(token)); } return regexes[token](config._strict, config._locale); } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { return s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; }).replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } var tokens = {}; function addParseToken (token, callback) { var i, func = callback; if (typeof token === 'string') { token = [token]; } if (typeof callback === 'number') { func = function (input, array) { array[callback] = toInt(input); }; } for (i = 0; i < token.length; i++) { tokens[token[i]] = func; } } function addWeekParseToken (token, callback) { addParseToken(token, function (input, array, config, token) { config._w = config._w || {}; callback(input, config._w, config, token); }); } function addTimeToArrayFromToken(token, input, config) { if (input != null && hasOwnProp(tokens, token)) { tokens[token](input, config._a, config, token); } } var YEAR = 0; var MONTH = 1; var DATE = 2; var HOUR = 3; var MINUTE = 4; var SECOND = 5; var MILLISECOND = 6; function daysInMonth(year, month) { return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); } // FORMATTING addFormatToken('M', ['MM', 2], 'Mo', function () { return this.month() + 1; }); addFormatToken('MMM', 0, 0, function (format) { return this.localeData().monthsShort(this, format); }); addFormatToken('MMMM', 0, 0, function (format) { return this.localeData().months(this, format); }); // ALIASES addUnitAlias('month', 'M'); // PARSING addRegexToken('M', match1to2); addRegexToken('MM', match1to2, match2); addRegexToken('MMM', matchWord); addRegexToken('MMMM', matchWord); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; }); addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid. if (month != null) { array[MONTH] = month; } else { getParsingFlags(config).invalidMonth = input; } }); // LOCALES var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); function localeMonths (m) { return this._months[m.month()]; } var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); function localeMonthsShort (m) { return this._monthsShort[m.month()]; } function localeMonthsParse (monthName, format, strict) { var i, mom, regex; if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = create_utc__createUTC([2000, i]); if (strict && !this._longMonthsParse[i]) { this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); } if (!strict && !this._monthsParse[i]) { regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { return i; } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { return i; } else if (!strict && this._monthsParse[i].test(monthName)) { return i; } } } // MOMENTS function setMonth (mom, value) { var dayOfMonth; // TODO: Move this out of here! if (typeof value === 'string') { value = mom.localeData().monthsParse(value); // TODO: Another silent failure? if (typeof value !== 'number') { return mom; } } dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); return mom; } function getSetMonth (value) { if (value != null) { setMonth(this, value); utils_hooks__hooks.updateOffset(this, true); return this; } else { return get_set__get(this, 'Month'); } } function getDaysInMonth () { return daysInMonth(this.year(), this.month()); } function checkOverflow (m) { var overflow; var a = m._a; if (a && getParsingFlags(m).overflow === -2) { overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { overflow = DATE; } getParsingFlags(m).overflow = overflow; } return m; } function warn(msg) { if (utils_hooks__hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { console.warn('Deprecation warning: ' + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function () { if (firstTime) { warn(msg + '\n' + (new Error()).stack); firstTime = false; } return fn.apply(this, arguments); }, fn); } var deprecations = {}; function deprecateSimple(name, msg) { if (!deprecations[name]) { warn(msg); deprecations[name] = true; } } utils_hooks__hooks.suppressDeprecationWarnings = false; var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/; var isoDates = [ ['YYYYYY-MM-DD', /[+-]\d{6}-\d{2}-\d{2}/], ['YYYY-MM-DD', /\d{4}-\d{2}-\d{2}/], ['GGGG-[W]WW-E', /\d{4}-W\d{2}-\d/], ['GGGG-[W]WW', /\d{4}-W\d{2}/], ['YYYY-DDD', /\d{4}-\d{3}/] ]; // iso time formats and regexes var isoTimes = [ ['HH:mm:ss.SSSS', /(T| )\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss', /(T| )\d\d:\d\d:\d\d/], ['HH:mm', /(T| )\d\d:\d\d/], ['HH', /(T| )\d\d/] ]; var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; // date from iso format function configFromISO(config) { var i, l, string = config._i, match = from_string__isoRegex.exec(string); if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDates.length; i < l; i++) { if (isoDates[i][1].exec(string)) { config._f = isoDates[i][0]; break; } } for (i = 0, l = isoTimes.length; i < l; i++) { if (isoTimes[i][1].exec(string)) { // match[6] should be 'T' or space config._f += (match[6] || ' ') + isoTimes[i][0]; break; } } if (string.match(matchOffset)) { config._f += 'Z'; } configFromStringAndFormat(config); } else { config._isValid = false; } } // date from iso format or fallback function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; utils_hooks__hooks.createFromInputFallback(config); } } utils_hooks__hooks.createFromInputFallback = deprecate( 'moment construction falls back to js Date. This is ' + 'discouraged and will be removed in upcoming major ' + 'release. Please refer to ' + 'https://github.com/moment/moment/issues/1407 for more info.', function (config) { config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); } ); function createDate (y, m, d, h, M, s, ms) { //can't just apply() to create a date: //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply var date = new Date(y, m, d, h, M, s, ms); //the date constructor doesn't accept years < 1970 if (y < 1970) { date.setFullYear(y); } return date; } function createUTCDate (y) { var date = new Date(Date.UTC.apply(null, arguments)); if (y < 1970) { date.setUTCFullYear(y); } return date; } addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); addFormatToken(0, ['YYYY', 4], 0, 'year'); addFormatToken(0, ['YYYYY', 5], 0, 'year'); addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // ALIASES addUnitAlias('year', 'y'); // PARSING addRegexToken('Y', matchSigned); addRegexToken('YY', match1to2, match2); addRegexToken('YYYY', match1to4, match4); addRegexToken('YYYYY', match1to6, match6); addRegexToken('YYYYYY', match1to6, match6); addParseToken(['YYYYY', 'YYYYYY'], YEAR); addParseToken('YYYY', function (input, array) { array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input); }); addParseToken('YY', function (input, array) { array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); }); // HELPERS function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } function isLeapYear(year) { return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; } // HOOKS utils_hooks__hooks.parseTwoDigitYear = function (input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); }; // MOMENTS var getSetYear = makeGetSet('FullYear', false); function getIsLeapYear () { return isLeapYear(this.year()); } addFormatToken('w', ['ww', 2], 'wo', 'week'); addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // ALIASES addUnitAlias('week', 'w'); addUnitAlias('isoWeek', 'W'); // PARSING addRegexToken('w', match1to2); addRegexToken('ww', match1to2, match2); addRegexToken('W', match1to2); addRegexToken('WW', match1to2, match2); addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { week[token.substr(0, 1)] = toInt(input); }); // HELPERS // firstDayOfWeek 0 = sun, 6 = sat // the day of the week that starts the week // (usually sunday or monday) // firstDayOfWeekOfYear 0 = sun, 6 = sat // the first week is the week that contains the first // of this day of the week // (eg. ISO weeks use thursday (4)) function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { var end = firstDayOfWeekOfYear - firstDayOfWeek, daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(), adjustedMoment; if (daysToDayOfWeek > end) { daysToDayOfWeek -= 7; } if (daysToDayOfWeek < end - 7) { daysToDayOfWeek += 7; } adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, 'd'); return { week: Math.ceil(adjustedMoment.dayOfYear() / 7), year: adjustedMoment.year() }; } // LOCALES function localeWeek (mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; } var defaultLocaleWeek = { dow : 0, // Sunday is the first day of the week. doy : 6 // The week that contains Jan 1st is the first week of the year. }; function localeFirstDayOfWeek () { return this._week.dow; } function localeFirstDayOfYear () { return this._week.doy; } // MOMENTS function getSetWeek (input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, 'd'); } function getSetISOWeek (input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, 'd'); } addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // ALIASES addUnitAlias('dayOfYear', 'DDD'); // PARSING addRegexToken('DDD', match1to3); addRegexToken('DDDD', match3); addParseToken(['DDD', 'DDDD'], function (input, array, config) { config._dayOfYear = toInt(input); }); // HELPERS //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { var week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, janX = createUTCDate(year, 0, 1 + week1Jan), d = janX.getUTCDay(), dayOfYear; if (d < firstDayOfWeek) { d += 7; } weekday = weekday != null ? 1 * weekday : firstDayOfWeek; dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + weekday; return { year: dayOfYear > 0 ? year : year - 1, dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear }; } // MOMENTS function getSetDayOfYear (input) { var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); } // Pick the first defined of two or three arguments. function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; } function currentDateArray(config) { var now = new Date(); if (config._useUTC) { return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]; } return [now.getFullYear(), now.getMonth(), now.getDate()]; } // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function configFromArray (config) { var i, date, input = [], currentDate, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if (config._dayOfYear > daysInYear(yearToUse)) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } } function dayOfYearFromWeekInfo(config) { var w, weekYear, week, weekday, dow, doy, temp; w = config._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); week = defaults(w.W, 1); weekday = defaults(w.E, 1); } else { dow = config._locale._week.dow; doy = config._locale._week.doy; weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year); week = defaults(w.w, 1); if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; if (weekday < dow) { ++week; } } else if (w.e != null) { // local weekday -- counting starts from begining of week weekday = w.e + dow; } else { // default to begining of week weekday = dow; } } temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow); config._a[YEAR] = temp.year; config._dayOfYear = temp.dayOfYear; } utils_hooks__hooks.ISO_8601 = function () {}; // date from string and format string function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === utils_hooks__hooks.ISO_8601) { configFromISO(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; for (i = 0; i < tokens.length; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice(string.indexOf(parsedInput) + parsedInput.length); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if (getParsingFlags(config).bigHour === true && config._a[HOUR] <= 12 && config._a[HOUR] > 0) { getParsingFlags(config).bigHour = undefined; } // handle meridiem config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); configFromArray(config); checkOverflow(config); } function meridiemFixWrap (locale, hour, meridiem) { var isPm; if (meridiem == null) { // nothing to do return hour; } if (locale.meridiemHour != null) { return locale.meridiemHour(hour, meridiem); } else if (locale.isPM != null) { // Fallback isPm = locale.isPM(meridiem); if (isPm && hour < 12) { hour += 12; } if (!isPm && hour === 12) { hour = 0; } return hour; } else { // this is not supposed to happen return hour; } } function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore; if (config._f.length === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < config._f.length; i++) { currentScore = 0; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (!valid__isValid(tempConfig)) { continue; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (scoreToBeat == null || currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } extend(config, bestMoment || tempConfig); } function configFromObject(config) { if (config._d) { return; } var i = normalizeObjectUnits(config._i); config._a = [i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond]; configFromArray(config); } function createFromConfig (config) { var res = new Moment(checkOverflow(prepareConfig(config))); if (res._nextDay) { // Adding is smart enough around DST res.add(1, 'd'); res._nextDay = undefined; } return res; } function prepareConfig (config) { var input = config._i, format = config._f; config._locale = config._locale || locale_locales__getLocale(config._l); if (input === null || (format === undefined && input === '')) { return valid__createInvalid({nullInput: true}); } if (typeof input === 'string') { config._i = input = config._locale.preparse(input); } if (isMoment(input)) { return new Moment(checkOverflow(input)); } else if (isArray(format)) { configFromStringAndArray(config); } else if (format) { configFromStringAndFormat(config); } else if (isDate(input)) { config._d = input; } else { configFromInput(config); } return config; } function configFromInput(config) { var input = config._i; if (input === undefined) { config._d = new Date(); } else if (isDate(input)) { config._d = new Date(+input); } else if (typeof input === 'string') { configFromString(config); } else if (isArray(input)) { config._a = map(input.slice(0), function (obj) { return parseInt(obj, 10); }); configFromArray(config); } else if (typeof(input) === 'object') { configFromObject(config); } else if (typeof(input) === 'number') { // from milliseconds config._d = new Date(input); } else { utils_hooks__hooks.createFromInputFallback(config); } } function createLocalOrUTC (input, format, locale, strict, isUTC) { var c = {}; if (typeof(locale) === 'boolean') { strict = locale; locale = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c._isAMomentObject = true; c._useUTC = c._isUTC = isUTC; c._l = locale; c._i = input; c._f = format; c._strict = strict; return createFromConfig(c); } function local__createLocal (input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, false); } var prototypeMin = deprecate( 'moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); return other < this ? this : other; } ); var prototypeMax = deprecate( 'moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', function () { var other = local__createLocal.apply(null, arguments); return other > this ? this : other; } ); // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return local__createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; } // TODO: Use [].sort instead? function min () { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); } function max () { var args = [].slice.call(arguments, 0); return pickBy('isAfter', args); } function Duration (duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; // representation for dateAddRemove this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 hours * 36e5; // 1000 * 60 * 60 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + weeks * 7; // It is impossible translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months = +months + quarters * 3 + years * 12; this._data = {}; this._locale = locale_locales__getLocale(); this._bubble(); } function isDuration (obj) { return obj instanceof Duration; } function offset (token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(); var sign = '+'; if (offset < 0) { offset = -offset; sign = '-'; } return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); }); } offset('Z', ':'); offset('ZZ', ''); // PARSING addRegexToken('Z', matchOffset); addRegexToken('ZZ', matchOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; config._tzm = offsetFromString(input); }); // HELPERS // timezone chunker // '+10:00' > ['10', '00'] // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(string) { var matches = ((string || '').match(matchOffset) || []); var chunk = matches[matches.length - 1] || []; var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; var minutes = +(parts[1] * 60) + toInt(parts[2]); return parts[0] === '+' ? minutes : -minutes; } // Return a moment from input, that is local/utc/zone equivalent to model. function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - (+res); // Use low-level api, because this fn is low-level api. res._d.setTime(+res._d + diff); utils_hooks__hooks.updateOffset(res, false); return res; } else { return local__createLocal(input).local(); } } function getDateOffset (m) { // On Firefox.24 Date#getTimezoneOffset returns a floating point. // https://github.com/moment/moment/pull/1871 return -Math.round(m._d.getTimezoneOffset() / 15) * 15; } // HOOKS // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. utils_hooks__hooks.updateOffset = function () {}; // MOMENTS // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. function getSetOffset (input, keepLocalTime) { var offset = this._offset || 0, localAdjust; if (input != null) { if (typeof input === 'string') { input = offsetFromString(input); } if (Math.abs(input) < 16) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false); } else if (!this._changeInProgress) { this._changeInProgress = true; utils_hooks__hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } } function getSetZone (input, keepLocalTime) { if (input != null) { if (typeof input !== 'string') { input = -input; } this.utcOffset(input, keepLocalTime); return this; } else { return -this.utcOffset(); } } function setOffsetToUTC (keepLocalTime) { return this.utcOffset(0, keepLocalTime); } function setOffsetToLocal (keepLocalTime) { if (this._isUTC) { this.utcOffset(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.subtract(getDateOffset(this), 'm'); } } return this; } function setOffsetToParsedOffset () { if (this._tzm) { this.utcOffset(this._tzm); } else if (typeof this._i === 'string') { this.utcOffset(offsetFromString(this._i)); } return this; } function hasAlignedHourOffset (input) { input = input ? local__createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; } function isDaylightSavingTime () { return ( this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() ); } function isDaylightSavingTimeShifted () { if (typeof this._isDSTShifted !== 'undefined') { return this._isDSTShifted; } var c = {}; copyConfig(c, this); c = prepareConfig(c); if (c._a) { var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a); this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; } else { this._isDSTShifted = false; } return this._isDSTShifted; } function isLocal () { return !this._isUTC; } function isUtcOffset () { return this._isUTC; } function isUtc () { return this._isUTC && this._offset === 0; } var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/; // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere var create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; function create__createDuration (input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, diffRes; if (isDuration(input)) { duration = { ms : input._milliseconds, d : input._days, M : input._months }; } else if (typeof input === 'number') { duration = {}; if (key) { duration[key] = input; } else { duration.milliseconds = input; } } else if (!!(match = aspNetRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : 0, d : toInt(match[DATE]) * sign, h : toInt(match[HOUR]) * sign, m : toInt(match[MINUTE]) * sign, s : toInt(match[SECOND]) * sign, ms : toInt(match[MILLISECOND]) * sign }; } else if (!!(match = create__isoRegex.exec(input))) { sign = (match[1] === '-') ? -1 : 1; duration = { y : parseIso(match[2], sign), M : parseIso(match[3], sign), d : parseIso(match[4], sign), h : parseIso(match[5], sign), m : parseIso(match[6], sign), s : parseIso(match[7], sign), w : parseIso(match[8], sign) }; } else if (duration == null) {// checks for null or undefined duration = {}; } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to)); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (isDuration(input) && hasOwnProp(input, '_locale')) { ret._locale = input._locale; } return ret; } create__createDuration.fn = Duration.prototype; function parseIso (inp, sign) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { var res = {milliseconds: 0, months: 0}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +(base.clone().add(res.months, 'M')); return res; } function momentsDifference(base, other) { var res; other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).'); tmp = val; val = period; period = tmp; } val = typeof val === 'string' ? +val : val; dur = create__createDuration(val, period); add_subtract__addSubtract(this, dur, direction); return this; }; } function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = duration._days, months = duration._months; updateOffset = updateOffset == null ? true : updateOffset; if (milliseconds) { mom._d.setTime(+mom._d + milliseconds * isAdding); } if (days) { get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding); } if (months) { setMonth(mom, get_set__get(mom, 'Month') + months * isAdding); } if (updateOffset) { utils_hooks__hooks.updateOffset(mom, days || months); } } var add_subtract__add = createAdder(1, 'add'); var add_subtract__subtract = createAdder(-1, 'subtract'); function moment_calendar__calendar (time, formats) { // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're local/utc/offset or not. var now = time || local__createLocal(), sod = cloneWithOffset(now, this).startOf('day'), diff = this.diff(sod, 'days', true), format = diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); } function clone () { return new Moment(this); } function isAfter (input, units) { var inputMs; units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); if (units === 'millisecond') { input = isMoment(input) ? input : local__createLocal(input); return +this > +input; } else { inputMs = isMoment(input) ? +input : +local__createLocal(input); return inputMs < +this.clone().startOf(units); } } function isBefore (input, units) { var inputMs; units = normalizeUnits(typeof units !== 'undefined' ? units : 'millisecond'); if (units === 'millisecond') { input = isMoment(input) ? input : local__createLocal(input); return +this < +input; } else { inputMs = isMoment(input) ? +input : +local__createLocal(input); return +this.clone().endOf(units) < inputMs; } } function isBetween (from, to, units) { return this.isAfter(from, units) && this.isBefore(to, units); } function isSame (input, units) { var inputMs; units = normalizeUnits(units || 'millisecond'); if (units === 'millisecond') { input = isMoment(input) ? input : local__createLocal(input); return +this === +input; } else { inputMs = +local__createLocal(input); return +(this.clone().startOf(units)) <= inputMs && inputMs <= +(this.clone().endOf(units)); } } function diff (input, units, asFloat) { var that = cloneWithOffset(input, this), zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4, delta, output; units = normalizeUnits(units); if (units === 'year' || units === 'month' || units === 'quarter') { output = monthDiff(this, that); if (units === 'quarter') { output = output / 3; } else if (units === 'year') { output = output / 12; } } else { delta = this - that; output = units === 'second' ? delta / 1e3 : // 1000 units === 'minute' ? delta / 6e4 : // 1000 * 60 units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60 units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst delta; } return asFloat ? output : absFloor(output); } function monthDiff (a, b) { // difference in months var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), // b is in (anchor - 1 month, anchor + 1 month) anchor = a.clone().add(wholeMonthDiff, 'months'), anchor2, adjust; if (b - anchor < 0) { anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor - anchor2); } else { anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor2 - anchor); } return -(wholeMonthDiff + adjust); } utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; function toString () { return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); } function moment_format__toISOString () { var m = this.clone().utc(); if (0 < m.year() && m.year() <= 9999) { if ('function' === typeof Date.prototype.toISOString) { // native implementation is ~50x faster, use it when we can return this.toDate().toISOString(); } else { return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } } else { return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); } } function format (inputString) { var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat); return this.localeData().postformat(output); } function from (time, withoutSuffix) { if (!this.isValid()) { return this.localeData().invalidDate(); } return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); } function fromNow (withoutSuffix) { return this.from(local__createLocal(), withoutSuffix); } function to (time, withoutSuffix) { if (!this.isValid()) { return this.localeData().invalidDate(); } return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); } function toNow (withoutSuffix) { return this.to(local__createLocal(), withoutSuffix); } function locale (key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = locale_locales__getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } } var lang = deprecate( 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) { if (key === undefined) { return this.localeData(); } else { return this.locale(key); } } ); function localeData () { return this._locale; } function startOf (units) { units = normalizeUnits(units); // the following switch intentionally omits break keywords // to utilize falling through the cases. switch (units) { case 'year': this.month(0); /* falls through */ case 'quarter': case 'month': this.date(1); /* falls through */ case 'week': case 'isoWeek': case 'day': this.hours(0); /* falls through */ case 'hour': this.minutes(0); /* falls through */ case 'minute': this.seconds(0); /* falls through */ case 'second': this.milliseconds(0); } // weeks are a special case if (units === 'week') { this.weekday(0); } if (units === 'isoWeek') { this.isoWeekday(1); } // quarters are also special if (units === 'quarter') { this.month(Math.floor(this.month() / 3) * 3); } return this; } function endOf (units) { units = normalizeUnits(units); if (units === undefined || units === 'millisecond') { return this; } return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); } function to_type__valueOf () { return +this._d - ((this._offset || 0) * 60000); } function unix () { return Math.floor(+this / 1000); } function toDate () { return this._offset ? new Date(+this) : this._d; } function toArray () { var m = this; return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; } function toObject () { var m = this; return { years: m.year(), months: m.month(), date: m.date(), hours: m.hours(), minutes: m.minutes(), seconds: m.seconds(), milliseconds: m.milliseconds() }; } function moment_valid__isValid () { return valid__isValid(this); } function parsingFlags () { return extend({}, getParsingFlags(this)); } function invalidAt () { return getParsingFlags(this).overflow; } addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); addFormatToken(0, ['GG', 2], 0, function () { return this.isoWeekYear() % 100; }); function addWeekYearFormatToken (token, getter) { addFormatToken(0, [token, token.length], 0, getter); } addWeekYearFormatToken('gggg', 'weekYear'); addWeekYearFormatToken('ggggg', 'weekYear'); addWeekYearFormatToken('GGGG', 'isoWeekYear'); addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES addUnitAlias('weekYear', 'gg'); addUnitAlias('isoWeekYear', 'GG'); // PARSING addRegexToken('G', matchSigned); addRegexToken('g', matchSigned); addRegexToken('GG', match1to2, match2); addRegexToken('gg', match1to2, match2); addRegexToken('GGGG', match1to4, match4); addRegexToken('gggg', match1to4, match4); addRegexToken('GGGGG', match1to6, match6); addRegexToken('ggggg', match1to6, match6); addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { week[token.substr(0, 2)] = toInt(input); }); addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { week[token] = utils_hooks__hooks.parseTwoDigitYear(input); }); // HELPERS function weeksInYear(year, dow, doy) { return weekOfYear(local__createLocal([year, 11, 31 + dow - doy]), dow, doy).week; } // MOMENTS function getSetWeekYear (input) { var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; return input == null ? year : this.add((input - year), 'y'); } function getSetISOWeekYear (input) { var year = weekOfYear(this, 1, 4).year; return input == null ? year : this.add((input - year), 'y'); } function getISOWeeksInYear () { return weeksInYear(this.year(), 1, 4); } function getWeeksInYear () { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } addFormatToken('Q', 0, 0, 'quarter'); // ALIASES addUnitAlias('quarter', 'Q'); // PARSING addRegexToken('Q', match1); addParseToken('Q', function (input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); // MOMENTS function getSetQuarter (input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); } addFormatToken('D', ['DD', 2], 'Do', 'date'); // ALIASES addUnitAlias('date', 'D'); // PARSING addRegexToken('D', match1to2); addRegexToken('DD', match1to2, match2); addRegexToken('Do', function (isStrict, locale) { return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; }); addParseToken(['D', 'DD'], DATE); addParseToken('Do', function (input, array) { array[DATE] = toInt(input.match(match1to2)[0], 10); }); // MOMENTS var getSetDayOfMonth = makeGetSet('Date', true); addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { return this.localeData().weekdaysMin(this, format); }); addFormatToken('ddd', 0, 0, function (format) { return this.localeData().weekdaysShort(this, format); }); addFormatToken('dddd', 0, 0, function (format) { return this.localeData().weekdays(this, format); }); addFormatToken('e', 0, 0, 'weekday'); addFormatToken('E', 0, 0, 'isoWeekday'); // ALIASES addUnitAlias('day', 'd'); addUnitAlias('weekday', 'e'); addUnitAlias('isoWeekday', 'E'); // PARSING addRegexToken('d', match1to2); addRegexToken('e', match1to2); addRegexToken('E', match1to2); addRegexToken('dd', matchWord); addRegexToken('ddd', matchWord); addRegexToken('dddd', matchWord); addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config) { var weekday = config._locale.weekdaysParse(input); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; } else { getParsingFlags(config).invalidWeekday = input; } }); addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { week[token] = toInt(input); }); // HELPERS function parseWeekday(input, locale) { if (typeof input !== 'string') { return input; } if (!isNaN(input)) { return parseInt(input, 10); } input = locale.weekdaysParse(input); if (typeof input === 'number') { return input; } return null; } // LOCALES var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); function localeWeekdays (m) { return this._weekdays[m.day()]; } var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); function localeWeekdaysShort (m) { return this._weekdaysShort[m.day()]; } var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); function localeWeekdaysMin (m) { return this._weekdaysMin[m.day()]; } function localeWeekdaysParse (weekdayName) { var i, mom, regex; this._weekdaysParse = this._weekdaysParse || []; for (i = 0; i < 7; i++) { // make the regex if we don't have it already if (!this._weekdaysParse[i]) { mom = local__createLocal([2000, 1]).day(i); regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if (this._weekdaysParse[i].test(weekdayName)) { return i; } } } // MOMENTS function getSetDayOfWeek (input) { var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, 'd'); } else { return day; } } function getSetLocaleDayOfWeek (input) { var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek (input) { // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); } addFormatToken('H', ['HH', 2], 0, 'hour'); addFormatToken('h', ['hh', 2], 0, function () { return this.hours() % 12 || 12; }); function meridiem (token, lowercase) { addFormatToken(token, 0, 0, function () { return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); }); } meridiem('a', true); meridiem('A', false); // ALIASES addUnitAlias('hour', 'h'); // PARSING function matchMeridiem (isStrict, locale) { return locale._meridiemParse; } addRegexToken('a', matchMeridiem); addRegexToken('A', matchMeridiem); addRegexToken('H', match1to2); addRegexToken('h', match1to2); addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); addParseToken(['H', 'HH'], HOUR); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); config._meridiem = input; }); addParseToken(['h', 'hh'], function (input, array, config) { array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); // LOCALES function localeIsPM (input) { // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return ((input + '').toLowerCase().charAt(0) === 'p'); } var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; function localeMeridiem (hours, minutes, isLower) { if (hours > 11) { return isLower ? 'pm' : 'PM'; } else { return isLower ? 'am' : 'AM'; } } // MOMENTS // Setting the hour should keep the time, because the user explicitly // specified which hour he wants. So trying to maintain the same hour (in // a new timezone) makes sense. Adding/subtracting hours does not follow // this rule. var getSetHour = makeGetSet('Hours', true); addFormatToken('m', ['mm', 2], 0, 'minute'); // ALIASES addUnitAlias('minute', 'm'); // PARSING addRegexToken('m', match1to2); addRegexToken('mm', match1to2, match2); addParseToken(['m', 'mm'], MINUTE); // MOMENTS var getSetMinute = makeGetSet('Minutes', false); addFormatToken('s', ['ss', 2], 0, 'second'); // ALIASES addUnitAlias('second', 's'); // PARSING addRegexToken('s', match1to2); addRegexToken('ss', match1to2, match2); addParseToken(['s', 'ss'], SECOND); // MOMENTS var getSetSecond = makeGetSet('Seconds', false); addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); addFormatToken(0, ['SS', 2], 0, function () { return ~~(this.millisecond() / 10); }); addFormatToken(0, ['SSS', 3], 0, 'millisecond'); addFormatToken(0, ['SSSS', 4], 0, function () { return this.millisecond() * 10; }); addFormatToken(0, ['SSSSS', 5], 0, function () { return this.millisecond() * 100; }); addFormatToken(0, ['SSSSSS', 6], 0, function () { return this.millisecond() * 1000; }); addFormatToken(0, ['SSSSSSS', 7], 0, function () { return this.millisecond() * 10000; }); addFormatToken(0, ['SSSSSSSS', 8], 0, function () { return this.millisecond() * 100000; }); addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { return this.millisecond() * 1000000; }); // ALIASES addUnitAlias('millisecond', 'ms'); // PARSING addRegexToken('S', match1to3, match1); addRegexToken('SS', match1to3, match2); addRegexToken('SSS', match1to3, match3); var token; for (token = 'SSSS'; token.length <= 9; token += 'S') { addRegexToken(token, matchUnsigned); } function parseMs(input, array) { array[MILLISECOND] = toInt(('0.' + input) * 1000); } for (token = 'S'; token.length <= 9; token += 'S') { addParseToken(token, parseMs); } // MOMENTS var getSetMillisecond = makeGetSet('Milliseconds', false); addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS function getZoneAbbr () { return this._isUTC ? 'UTC' : ''; } function getZoneName () { return this._isUTC ? 'Coordinated Universal Time' : ''; } var momentPrototype__proto = Moment.prototype; momentPrototype__proto.add = add_subtract__add; momentPrototype__proto.calendar = moment_calendar__calendar; momentPrototype__proto.clone = clone; momentPrototype__proto.diff = diff; momentPrototype__proto.endOf = endOf; momentPrototype__proto.format = format; momentPrototype__proto.from = from; momentPrototype__proto.fromNow = fromNow; momentPrototype__proto.to = to; momentPrototype__proto.toNow = toNow; momentPrototype__proto.get = getSet; momentPrototype__proto.invalidAt = invalidAt; momentPrototype__proto.isAfter = isAfter; momentPrototype__proto.isBefore = isBefore; momentPrototype__proto.isBetween = isBetween; momentPrototype__proto.isSame = isSame; momentPrototype__proto.isValid = moment_valid__isValid; momentPrototype__proto.lang = lang; momentPrototype__proto.locale = locale; momentPrototype__proto.localeData = localeData; momentPrototype__proto.max = prototypeMax; momentPrototype__proto.min = prototypeMin; momentPrototype__proto.parsingFlags = parsingFlags; momentPrototype__proto.set = getSet; momentPrototype__proto.startOf = startOf; momentPrototype__proto.subtract = add_subtract__subtract; momentPrototype__proto.toArray = toArray; momentPrototype__proto.toObject = toObject; momentPrototype__proto.toDate = toDate; momentPrototype__proto.toISOString = moment_format__toISOString; momentPrototype__proto.toJSON = moment_format__toISOString; momentPrototype__proto.toString = toString; momentPrototype__proto.unix = unix; momentPrototype__proto.valueOf = to_type__valueOf; // Year momentPrototype__proto.year = getSetYear; momentPrototype__proto.isLeapYear = getIsLeapYear; // Week Year momentPrototype__proto.weekYear = getSetWeekYear; momentPrototype__proto.isoWeekYear = getSetISOWeekYear; // Quarter momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter; // Month momentPrototype__proto.month = getSetMonth; momentPrototype__proto.daysInMonth = getDaysInMonth; // Week momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek; momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek; momentPrototype__proto.weeksInYear = getWeeksInYear; momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear; // Day momentPrototype__proto.date = getSetDayOfMonth; momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek; momentPrototype__proto.weekday = getSetLocaleDayOfWeek; momentPrototype__proto.isoWeekday = getSetISODayOfWeek; momentPrototype__proto.dayOfYear = getSetDayOfYear; // Hour momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour; // Minute momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute; // Second momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond; // Millisecond momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond; // Offset momentPrototype__proto.utcOffset = getSetOffset; momentPrototype__proto.utc = setOffsetToUTC; momentPrototype__proto.local = setOffsetToLocal; momentPrototype__proto.parseZone = setOffsetToParsedOffset; momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset; momentPrototype__proto.isDST = isDaylightSavingTime; momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted; momentPrototype__proto.isLocal = isLocal; momentPrototype__proto.isUtcOffset = isUtcOffset; momentPrototype__proto.isUtc = isUtc; momentPrototype__proto.isUTC = isUtc; // Timezone momentPrototype__proto.zoneAbbr = getZoneAbbr; momentPrototype__proto.zoneName = getZoneName; // Deprecations momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone); var momentPrototype = momentPrototype__proto; function moment__createUnix (input) { return local__createLocal(input * 1000); } function moment__createInZone () { return local__createLocal.apply(null, arguments).parseZone(); } var defaultCalendar = { sameDay : '[Today at] LT', nextDay : '[Tomorrow at] LT', nextWeek : 'dddd [at] LT', lastDay : '[Yesterday at] LT', lastWeek : '[Last] dddd [at] LT', sameElse : 'L' }; function locale_calendar__calendar (key, mom, now) { var output = this._calendar[key]; return typeof output === 'function' ? output.call(mom, now) : output; } var defaultLongDateFormat = { LTS : 'h:mm:ss A', LT : 'h:mm A', L : 'MM/DD/YYYY', LL : 'MMMM D, YYYY', LLL : 'MMMM D, YYYY h:mm A', LLLL : 'dddd, MMMM D, YYYY h:mm A' }; function longDateFormat (key) { var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; if (format || !formatUpper) { return format; } this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { return val.slice(1); }); return this._longDateFormat[key]; } var defaultInvalidDate = 'Invalid date'; function invalidDate () { return this._invalidDate; } var defaultOrdinal = '%d'; var defaultOrdinalParse = /\d{1,2}/; function ordinal (number) { return this._ordinal.replace('%d', number); } function preParsePostFormat (string) { return string; } var defaultRelativeTime = { future : 'in %s', past : '%s ago', s : 'a few seconds', m : 'a minute', mm : '%d minutes', h : 'an hour', hh : '%d hours', d : 'a day', dd : '%d days', M : 'a month', MM : '%d months', y : 'a year', yy : '%d years' }; function relative__relativeTime (number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return (typeof output === 'function') ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture (diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; return typeof format === 'function' ? format(output) : format.replace(/%s/i, output); } function locale_set__set (config) { var prop, i; for (i in config) { prop = config[i]; if (typeof prop === 'function') { this[i] = prop; } else { this['_' + i] = prop; } } // Lenient ordinal parsing accepts just a number in addition to // number + (possibly) stuff coming from _ordinalParseLenient. this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); } var prototype__proto = Locale.prototype; prototype__proto._calendar = defaultCalendar; prototype__proto.calendar = locale_calendar__calendar; prototype__proto._longDateFormat = defaultLongDateFormat; prototype__proto.longDateFormat = longDateFormat; prototype__proto._invalidDate = defaultInvalidDate; prototype__proto.invalidDate = invalidDate; prototype__proto._ordinal = defaultOrdinal; prototype__proto.ordinal = ordinal; prototype__proto._ordinalParse = defaultOrdinalParse; prototype__proto.preparse = preParsePostFormat; prototype__proto.postformat = preParsePostFormat; prototype__proto._relativeTime = defaultRelativeTime; prototype__proto.relativeTime = relative__relativeTime; prototype__proto.pastFuture = pastFuture; prototype__proto.set = locale_set__set; // Month prototype__proto.months = localeMonths; prototype__proto._months = defaultLocaleMonths; prototype__proto.monthsShort = localeMonthsShort; prototype__proto._monthsShort = defaultLocaleMonthsShort; prototype__proto.monthsParse = localeMonthsParse; // Week prototype__proto.week = localeWeek; prototype__proto._week = defaultLocaleWeek; prototype__proto.firstDayOfYear = localeFirstDayOfYear; prototype__proto.firstDayOfWeek = localeFirstDayOfWeek; // Day of Week prototype__proto.weekdays = localeWeekdays; prototype__proto._weekdays = defaultLocaleWeekdays; prototype__proto.weekdaysMin = localeWeekdaysMin; prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin; prototype__proto.weekdaysShort = localeWeekdaysShort; prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort; prototype__proto.weekdaysParse = localeWeekdaysParse; // Hours prototype__proto.isPM = localeIsPM; prototype__proto._meridiemParse = defaultLocaleMeridiemParse; prototype__proto.meridiem = localeMeridiem; function lists__get (format, index, field, setter) { var locale = locale_locales__getLocale(); var utc = create_utc__createUTC().set(setter, index); return locale[field](utc, format); } function list (format, index, field, count, setter) { if (typeof format === 'number') { index = format; format = undefined; } format = format || ''; if (index != null) { return lists__get(format, index, field, setter); } var i; var out = []; for (i = 0; i < count; i++) { out[i] = lists__get(format, i, field, setter); } return out; } function lists__listMonths (format, index) { return list(format, index, 'months', 12, 'month'); } function lists__listMonthsShort (format, index) { return list(format, index, 'monthsShort', 12, 'month'); } function lists__listWeekdays (format, index) { return list(format, index, 'weekdays', 7, 'day'); } function lists__listWeekdaysShort (format, index) { return list(format, index, 'weekdaysShort', 7, 'day'); } function lists__listWeekdaysMin (format, index) { return list(format, index, 'weekdaysMin', 7, 'day'); } locale_locales__getSetGlobalLocale('en', { ordinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal : function (number) { var b = number % 10, output = (toInt(number % 100 / 10) === 1) ? 'th' : (b === 1) ? 'st' : (b === 2) ? 'nd' : (b === 3) ? 'rd' : 'th'; return number + output; } }); // Side effect imports utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale); utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale); var mathAbs = Math.abs; function duration_abs__abs () { var data = this._data; this._milliseconds = mathAbs(this._milliseconds); this._days = mathAbs(this._days); this._months = mathAbs(this._months); data.milliseconds = mathAbs(data.milliseconds); data.seconds = mathAbs(data.seconds); data.minutes = mathAbs(data.minutes); data.hours = mathAbs(data.hours); data.months = mathAbs(data.months); data.years = mathAbs(data.years); return this; } function duration_add_subtract__addSubtract (duration, input, value, direction) { var other = create__createDuration(input, value); duration._milliseconds += direction * other._milliseconds; duration._days += direction * other._days; duration._months += direction * other._months; return duration._bubble(); } // supports only 2.0-style add(1, 's') or add(duration) function duration_add_subtract__add (input, value) { return duration_add_subtract__addSubtract(this, input, value, 1); } // supports only 2.0-style subtract(1, 's') or subtract(duration) function duration_add_subtract__subtract (input, value) { return duration_add_subtract__addSubtract(this, input, value, -1); } function absCeil (number) { if (number < 0) { return Math.floor(number); } else { return Math.ceil(number); } } function bubble () { var milliseconds = this._milliseconds; var days = this._days; var months = this._months; var data = this._data; var seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first // check: https://github.com/moment/moment/issues/2166 if (!((milliseconds >= 0 && days >= 0 && months >= 0) || (milliseconds <= 0 && days <= 0 && months <= 0))) { milliseconds += absCeil(monthsToDays(months) + days) * 864e5; days = 0; months = 0; } // The following code bubbles up values, see the tests for // examples of what that means. data.milliseconds = milliseconds % 1000; seconds = absFloor(milliseconds / 1000); data.seconds = seconds % 60; minutes = absFloor(seconds / 60); data.minutes = minutes % 60; hours = absFloor(minutes / 60); data.hours = hours % 24; days += absFloor(hours / 24); // convert days to months monthsFromDays = absFloor(daysToMonths(days)); months += monthsFromDays; days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year years = absFloor(months / 12); months %= 12; data.days = days; data.months = months; data.years = years; return this; } function daysToMonths (days) { // 400 years have 146097 days (taking into account leap year rules) // 400 years have 12 months === 4800 return days * 4800 / 146097; } function monthsToDays (months) { // the reverse of daysToMonths return months * 146097 / 4800; } function as (units) { var days; var months; var milliseconds = this._milliseconds; units = normalizeUnits(units); if (units === 'month' || units === 'year') { days = this._days + milliseconds / 864e5; months = this._months + daysToMonths(days); return units === 'month' ? months : months / 12; } else { // handle milliseconds separately because of floating point math errors (issue #1867) days = this._days + Math.round(monthsToDays(this._months)); switch (units) { case 'week' : return days / 7 + milliseconds / 6048e5; case 'day' : return days + milliseconds / 864e5; case 'hour' : return days * 24 + milliseconds / 36e5; case 'minute' : return days * 1440 + milliseconds / 6e4; case 'second' : return days * 86400 + milliseconds / 1000; // Math.floor prevents floating point math errors here case 'millisecond': return Math.floor(days * 864e5) + milliseconds; default: throw new Error('Unknown unit ' + units); } } } // TODO: Use this.as('ms')? function duration_as__valueOf () { return ( this._milliseconds + this._days * 864e5 + (this._months % 12) * 2592e6 + toInt(this._months / 12) * 31536e6 ); } function makeAs (alias) { return function () { return this.as(alias); }; } var asMilliseconds = makeAs('ms'); var asSeconds = makeAs('s'); var asMinutes = makeAs('m'); var asHours = makeAs('h'); var asDays = makeAs('d'); var asWeeks = makeAs('w'); var asMonths = makeAs('M'); var asYears = makeAs('y'); function duration_get__get (units) { units = normalizeUnits(units); return this[units + 's'](); } function makeGetter(name) { return function () { return this._data[name]; }; } var milliseconds = makeGetter('milliseconds'); var seconds = makeGetter('seconds'); var minutes = makeGetter('minutes'); var hours = makeGetter('hours'); var days = makeGetter('days'); var months = makeGetter('months'); var years = makeGetter('years'); function weeks () { return absFloor(this.days() / 7); } var round = Math.round; var thresholds = { s: 45, // seconds to minute m: 45, // minutes to hour h: 22, // hours to day d: 26, // days to month M: 11 // months to year }; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) { var duration = create__createDuration(posNegDuration).abs(); var seconds = round(duration.as('s')); var minutes = round(duration.as('m')); var hours = round(duration.as('h')); var days = round(duration.as('d')); var months = round(duration.as('M')); var years = round(duration.as('y')); var a = seconds < thresholds.s && ['s', seconds] || minutes === 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours === 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days === 1 && ['d'] || days < thresholds.d && ['dd', days] || months === 1 && ['M'] || months < thresholds.M && ['MM', months] || years === 1 && ['y'] || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; a[4] = locale; return substituteTimeAgo.apply(null, a); } // This function allows you to set a threshold for relative time strings function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; return true; } function humanize (withSuffix) { var locale = this.localeData(); var output = duration_humanize__relativeTime(this, !withSuffix, locale); if (withSuffix) { output = locale.pastFuture(+this, output); } return locale.postformat(output); } var iso_string__abs = Math.abs; function iso_string__toISOString() { // for ISO strings we do not use the normal bubbling rules: // * milliseconds bubble up until they become hours // * days do not bubble at all // * months bubble up until they become years // This is because there is no context-free conversion between hours and days // (think of clock changes) // and also not between days and months (28-31 days per month) var seconds = iso_string__abs(this._milliseconds) / 1000; var days = iso_string__abs(this._days); var months = iso_string__abs(this._months); var minutes, hours, years; // 3600 seconds -> 60 minutes -> 1 hour minutes = absFloor(seconds / 60); hours = absFloor(minutes / 60); seconds %= 60; minutes %= 60; // 12 months -> 1 year years = absFloor(months / 12); months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js var Y = years; var M = months; var D = days; var h = hours; var m = minutes; var s = seconds; var total = this.asSeconds(); if (!total) { // this is the same as C#'s (Noda) and python (isodate)... // but not other JS (goog.date) return 'P0D'; } return (total < 0 ? '-' : '') + 'P' + (Y ? Y + 'Y' : '') + (M ? M + 'M' : '') + (D ? D + 'D' : '') + ((h || m || s) ? 'T' : '') + (h ? h + 'H' : '') + (m ? m + 'M' : '') + (s ? s + 'S' : ''); } var duration_prototype__proto = Duration.prototype; duration_prototype__proto.abs = duration_abs__abs; duration_prototype__proto.add = duration_add_subtract__add; duration_prototype__proto.subtract = duration_add_subtract__subtract; duration_prototype__proto.as = as; duration_prototype__proto.asMilliseconds = asMilliseconds; duration_prototype__proto.asSeconds = asSeconds; duration_prototype__proto.asMinutes = asMinutes; duration_prototype__proto.asHours = asHours; duration_prototype__proto.asDays = asDays; duration_prototype__proto.asWeeks = asWeeks; duration_prototype__proto.asMonths = asMonths; duration_prototype__proto.asYears = asYears; duration_prototype__proto.valueOf = duration_as__valueOf; duration_prototype__proto._bubble = bubble; duration_prototype__proto.get = duration_get__get; duration_prototype__proto.milliseconds = milliseconds; duration_prototype__proto.seconds = seconds; duration_prototype__proto.minutes = minutes; duration_prototype__proto.hours = hours; duration_prototype__proto.days = days; duration_prototype__proto.weeks = weeks; duration_prototype__proto.months = months; duration_prototype__proto.years = years; duration_prototype__proto.humanize = humanize; duration_prototype__proto.toISOString = iso_string__toISOString; duration_prototype__proto.toString = iso_string__toISOString; duration_prototype__proto.toJSON = iso_string__toISOString; duration_prototype__proto.locale = locale; duration_prototype__proto.localeData = localeData; // Deprecations duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString); duration_prototype__proto.lang = lang; // Side effect imports addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); // PARSING addRegexToken('x', matchSigned); addRegexToken('X', matchTimestamp); addParseToken('X', function (input, array, config) { config._d = new Date(parseFloat(input, 10) * 1000); }); addParseToken('x', function (input, array, config) { config._d = new Date(toInt(input)); }); // Side effect imports utils_hooks__hooks.version = '2.10.6'; setHookCallback(local__createLocal); utils_hooks__hooks.fn = momentPrototype; utils_hooks__hooks.min = min; utils_hooks__hooks.max = max; utils_hooks__hooks.utc = create_utc__createUTC; utils_hooks__hooks.unix = moment__createUnix; utils_hooks__hooks.months = lists__listMonths; utils_hooks__hooks.isDate = isDate; utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale; utils_hooks__hooks.invalid = valid__createInvalid; utils_hooks__hooks.duration = create__createDuration; utils_hooks__hooks.isMoment = isMoment; utils_hooks__hooks.weekdays = lists__listWeekdays; utils_hooks__hooks.parseZone = moment__createInZone; utils_hooks__hooks.localeData = locale_locales__getLocale; utils_hooks__hooks.isDuration = isDuration; utils_hooks__hooks.monthsShort = lists__listMonthsShort; utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; utils_hooks__hooks.defineLocale = defineLocale; utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; utils_hooks__hooks.normalizeUnits = normalizeUnits; utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; var _moment = utils_hooks__hooks; return _moment; })); /*! jQuery Mobile v1.4.5 | Copyright 2010, 2014 jQuery Foundation, Inc. | jquery.org/license */ (function(e,t,n){typeof define=="function"&&define.amd?define(["jquery"],function(r){return n(r,e,t),r.mobile}):n(e.jQuery,e,t)})(this,document,function(e,t,n,r){(function(e,t,n,r){function T(e){while(e&&typeof e.originalEvent!="undefined")e=e.originalEvent;return e}function N(t,n){var i=t.type,s,o,a,l,c,h,p,d,v;t=e.Event(t),t.type=n,s=t.originalEvent,o=e.event.props,i.search(/^(mouse|click)/)>-1&&(o=f);if(s)for(p=o.length,l;p;)l=o[--p],t[l]=s[l];i.search(/mouse(down|up)|click/)>-1&&!t.which&&(t.which=1);if(i.search(/^touch/)!==-1){a=T(s),i=a.touches,c=a.changedTouches,h=i&&i.length?i[0]:c&&c.length?c[0]:r;if(h)for(d=0,v=u.length;d<v;d++)l=u[d],t[l]=h[l]}return t}function C(t){var n={},r,s;while(t){r=e.data(t,i);for(s in r)r[s]&&(n[s]=n.hasVirtualBinding=!0);t=t.parentNode}return n}function k(t,n){var r;while(t){r=e.data(t,i);if(r&&(!n||r[n]))return t;t=t.parentNode}return null}function L(){g=!1}function A(){g=!0}function O(){E=0,v.length=0,m=!1,A()}function M(){L()}function _(){D(),c=setTimeout(function(){c=0,O()},e.vmouse.resetTimerDuration)}function D(){c&&(clearTimeout(c),c=0)}function P(t,n,r){var i;if(r&&r[t]||!r&&k(n.target,t))i=N(n,t),e(n.target).trigger(i);return i}function H(t){var n=e.data(t.target,s),r;!m&&(!E||E!==n)&&(r=P("v"+t.type,t),r&&(r.isDefaultPrevented()&&t.preventDefault(),r.isPropagationStopped()&&t.stopPropagation(),r.isImmediatePropagationStopped()&&t.stopImmediatePropagation()))}function B(t){var n=T(t).touches,r,i,o;n&&n.length===1&&(r=t.target,i=C(r),i.hasVirtualBinding&&(E=w++,e.data(r,s,E),D(),M(),d=!1,o=T(t).touches[0],h=o.pageX,p=o.pageY,P("vmouseover",t,i),P("vmousedown",t,i)))}function j(e){if(g)return;d||P("vmousecancel",e,C(e.target)),d=!0,_()}function F(t){if(g)return;var n=T(t).touches[0],r=d,i=e.vmouse.moveDistanceThreshold,s=C(t.target);d=d||Math.abs(n.pageX-h)>i||Math.abs(n.pageY-p)>i,d&&!r&&P("vmousecancel",t,s),P("vmousemove",t,s),_()}function I(e){if(g)return;A();var t=C(e.target),n,r;P("vmouseup",e,t),d||(n=P("vclick",e,t),n&&n.isDefaultPrevented()&&(r=T(e).changedTouches[0],v.push({touchID:E,x:r.clientX,y:r.clientY}),m=!0)),P("vmouseout",e,t),d=!1,_()}function q(t){var n=e.data(t,i),r;if(n)for(r in n)if(n[r])return!0;return!1}function R(){}function U(t){var n=t.substr(1);return{setup:function(){q(this)||e.data(this,i,{});var r=e.data(this,i);r[t]=!0,l[t]=(l[t]||0)+1,l[t]===1&&b.bind(n,H),e(this).bind(n,R),y&&(l.touchstart=(l.touchstart||0)+1,l.touchstart===1&&b.bind("touchstart",B).bind("touchend",I).bind("touchmove",F).bind("scroll",j))},teardown:function(){--l[t],l[t]||b.unbind(n,H),y&&(--l.touchstart,l.touchstart||b.unbind("touchstart",B).unbind("touchmove",F).unbind("touchend",I).unbind("scroll",j));var r=e(this),s=e.data(this,i);s&&(s[t]=!1),r.unbind(n,R),q(this)||r.removeData(i)}}}var i="virtualMouseBindings",s="virtualTouchID",o="vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "),u="clientX clientY pageX pageY screenX screenY".split(" "),a=e.event.mouseHooks?e.event.mouseHooks.props:[],f=e.event.props.concat(a),l={},c=0,h=0,p=0,d=!1,v=[],m=!1,g=!1,y="addEventListener"in n,b=e(n),w=1,E=0,S,x;e.vmouse={moveDistanceThreshold:10,clickDistanceThreshold:10,resetTimerDuration:1500};for(x=0;x<o.length;x++)e.event.special[o[x]]=U(o[x]);y&&n.addEventListener("click",function(t){var n=v.length,r=t.target,i,o,u,a,f,l;if(n){i=t.clientX,o=t.clientY,S=e.vmouse.clickDistanceThreshold,u=r;while(u){for(a=0;a<n;a++){f=v[a],l=0;if(u===r&&Math.abs(f.x-i)<S&&Math.abs(f.y-o)<S||e.data(u,s)===f.touchID){t.preventDefault(),t.stopPropagation();return}}u=u.parentNode}}},!0)})(e,t,n),function(e){e.mobile={}}(e),function(e,t){var r={touch:"ontouchend"in n};e.mobile.support=e.mobile.support||{},e.extend(e.support,r),e.extend(e.mobile.support,r)}(e),function(e,t,r){function l(t,n,i,s){var o=i.type;i.type=n,s?e.event.trigger(i,r,t):e.event.dispatch.call(t,i),i.type=o}var i=e(n),s=e.mobile.support.touch,o="touchmove scroll",u=s?"touchstart":"mousedown",a=s?"touchend":"mouseup",f=s?"touchmove":"mousemove";e.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "),function(t,n){e.fn[n]=function(e){return e?this.bind(n,e):this.trigger(n)},e.attrFn&&(e.attrFn[n]=!0)}),e.event.special.scrollstart={enabled:!0,setup:function(){function s(e,n){r=n,l(t,r?"scrollstart":"scrollstop",e)}var t=this,n=e(t),r,i;n.bind(o,function(t){if(!e.event.special.scrollstart.enabled)return;r||s(t,!0),clearTimeout(i),i=setTimeout(function(){s(t,!1)},50)})},teardown:function(){e(this).unbind(o)}},e.event.special.tap={tapholdThreshold:750,emitTapOnTaphold:!0,setup:function(){var t=this,n=e(t),r=!1;n.bind("vmousedown",function(s){function a(){clearTimeout(u)}function f(){a(),n.unbind("vclick",c).unbind("vmouseup",a),i.unbind("vmousecancel",f)}function c(e){f(),!r&&o===e.target?l(t,"tap",e):r&&e.preventDefault()}r=!1;if(s.which&&s.which!==1)return!1;var o=s.target,u;n.bind("vmouseup",a).bind("vclick",c),i.bind("vmousecancel",f),u=setTimeout(function(){e.event.special.tap.emitTapOnTaphold||(r=!0),l(t,"taphold",e.Event("taphold",{target:o}))},e.event.special.tap.tapholdThreshold)})},teardown:function(){e(this).unbind("vmousedown").unbind("vclick").unbind("vmouseup"),i.unbind("vmousecancel")}},e.event.special.swipe={scrollSupressionThreshold:30,durationThreshold:1e3,horizontalDistanceThreshold:30,verticalDistanceThreshold:30,getLocation:function(e){var n=t.pageXOffset,r=t.pageYOffset,i=e.clientX,s=e.clientY;if(e.pageY===0&&Math.floor(s)>Math.floor(e.pageY)||e.pageX===0&&Math.floor(i)>Math.floor(e.pageX))i-=n,s-=r;else if(s<e.pageY-r||i<e.pageX-n)i=e.pageX-n,s=e.pageY-r;return{x:i,y:s}},start:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y],origin:e(t.target)}},stop:function(t){var n=t.originalEvent.touches?t.originalEvent.touches[0]:t,r=e.event.special.swipe.getLocation(n);return{time:(new Date).getTime(),coords:[r.x,r.y]}},handleSwipe:function(t,n,r,i){if(n.time-t.time<e.event.special.swipe.durationThreshold&&Math.abs(t.coords[0]-n.coords[0])>e.event.special.swipe.horizontalDistanceThreshold&&Math.abs(t.coords[1]-n.coords[1])<e.event.special.swipe.verticalDistanceThreshold){var s=t.coords[0]>n.coords[0]?"swipeleft":"swiperight";return l(r,"swipe",e.Event("swipe",{target:i,swipestart:t,swipestop:n}),!0),l(r,s,e.Event(s,{target:i,swipestart:t,swipestop:n}),!0),!0}return!1},eventInProgress:!1,setup:function(){var t,n=this,r=e(n),s={};t=e.data(this,"mobile-events"),t||(t={length:0},e.data(this,"mobile-events",t)),t.length++,t.swipe=s,s.start=function(t){if(e.event.special.swipe.eventInProgress)return;e.event.special.swipe.eventInProgress=!0;var r,o=e.event.special.swipe.start(t),u=t.target,l=!1;s.move=function(t){if(!o||t.isDefaultPrevented())return;r=e.event.special.swipe.stop(t),l||(l=e.event.special.swipe.handleSwipe(o,r,n,u),l&&(e.event.special.swipe.eventInProgress=!1)),Math.abs(o.coords[0]-r.coords[0])>e.event.special.swipe.scrollSupressionThreshold&&t.preventDefault()},s.stop=function(){l=!0,e.event.special.swipe.eventInProgress=!1,i.off(f,s.move),s.move=null},i.on(f,s.move).one(a,s.stop)},r.on(u,s.start)},teardown:function(){var t,n;t=e.data(this,"mobile-events"),t&&(n=t.swipe,delete t.swipe,t.length--,t.length===0&&e.removeData(this,"mobile-events")),n&&(n.start&&e(this).off(u,n.start),n.move&&i.off(f,n.move),n.stop&&i.off(a,n.stop))}},e.each({scrollstop:"scrollstart",taphold:"tap",swipeleft:"swipe.left",swiperight:"swipe.right"},function(t,n){e.event.special[t]={setup:function(){e(this).bind(n,e.noop)},teardown:function(){e(this).unbind(n)}}})}(e,this)}); /*! * Bootstrap v3.3.2 (http://getbootstrap.com) * Copyright 2011-2015 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.2",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.2",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.2",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a(this.options.trigger).filter('[href="#'+b.id+'"], [data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.2",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":a.extend({},e.data(),{trigger:this});c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.2",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f,g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',g.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.3.2",c.TRANSITION_DURATION=300,c.BACKDROP_TRANSITION_DURATION=150,c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var d=this,e=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var e=a.support.transition&&d.$element.hasClass("fade");d.$element.parent().length||d.$element.appendTo(d.$body),d.$element.show().scrollTop(0),d.options.backdrop&&d.adjustBackdrop(),d.adjustDialog(),e&&d.$element[0].offsetWidth,d.$element.addClass("in").attr("aria-hidden",!1),d.enforceFocus();var f=a.Event("shown.bs.modal",{relatedTarget:b});e?d.$element.find(".modal-dialog").one("bsTransitionEnd",function(){d.$element.trigger("focus").trigger(f)}).emulateTransitionEnd(c.TRANSITION_DURATION):d.$element.trigger("focus").trigger(f)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(c.TRANSITION_DURATION):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},c.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$body.removeClass("modal-open"),a.resetAdjustments(),a.resetScrollbar(),a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var d=this,e=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var f=a.support.transition&&e;if(this.$backdrop=a('<div class="modal-backdrop '+e+'" />').prependTo(this.$element).on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.options.backdrop&&this.adjustBackdrop(),this.adjustDialog()},c.prototype.adjustBackdrop=function(){this.$backdrop.css("height",0).css("height",this.$element[0].scrollHeight)},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){this.bodyIsOverflowing=document.body.scrollHeight>document.documentElement.clientHeight,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.2",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m<p.top?"bottom":"right"==h&&k.right+l>p.width?"left":"left"==h&&k.left-l<p.left?"right":h,f.removeClass(n).addClass(h)}var q=this.getCalculatedOffset(h,k,l,m);this.applyPlacement(q,h);var r=function(){var a=e.hoverState;e.$element.trigger("shown.bs."+e.type),e.hoverState=null,"out"==a&&e.leave(e)};a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",r).emulateTransitionEnd(c.TRANSITION_DURATION):r()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=/top|bottom/.test(c),m=l?2*k.left-e+i:2*k.top-f+j,n=l?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(m,d[0][n],l)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c?"left":"top",50*(1-a/b)+"%").css(c?"top":"left","")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(b){function d(){"in"!=e.hoverState&&f.detach(),e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),b&&b()}var e=this,f=this.tip(),g=a.Event("hide.bs."+this.type);return this.$element.trigger(g),g.isDefaultPrevented()?void 0:(f.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?f.one("bsTransitionEnd",d).emulateTransitionEnd(c.TRANSITION_DURATION):d(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName,e=c.getBoundingClientRect();null==e.width&&(e=a.extend({},e,{width:e.right-e.left,height:e.bottom-e.top}));var f=d?{top:0,left:0}:b.offset(),g={scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop()},h=d?{width:a(window).width(),height:a(window).height()}:null;return a.extend({},e,g,h,f)},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.2",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.2",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<e[0])return this.activeTarget=null,this.clear();for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.2",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e() }var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.2",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a("body").height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */ window.matchMedia || (window.matchMedia = function() { "use strict"; // For browsers that support matchMedium api such as IE 9 and webkit var styleMedia = (window.styleMedia || window.media); // For those that don't support matchMedium if (!styleMedia) { var style = document.createElement('style'), script = document.getElementsByTagName('script')[0], info = null; style.type = 'text/css'; style.id = 'matchmediajs-test'; script.parentNode.insertBefore(style, script); // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle; styleMedia = { matchMedium: function(media) { var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers if (style.styleSheet) { style.styleSheet.cssText = text; } else { style.textContent = text; } // Test if media query is true or false return info.width === '1px'; } }; } return function(media) { return { matches: styleMedia.matchMedium(media || 'all'), media: media || 'all' }; }; }()); /** Custom build of jQueryUI Only inclused selectmenu, datepicker and their dependancies **/ /*! jQuery UI - v1.11.4 - 2015-05-01 * http://jqueryui.com * Includes: core.js, widget.js, position.js, datepicker.js, menu.js, selectmenu.js * Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */ (function( factory ) { if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define([ "jquery" ], factory ); } else { // Browser globals factory( jQuery ); } }(function( $ ) { /*! * jQuery UI Core 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/category/ui-core/ */ // $.ui might exist from components with no dependencies, e.g., $.ui.position $.ui = $.ui || {}; $.extend( $.ui, { version: "1.11.4", keyCode: { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 } }); // plugins $.fn.extend({ scrollParent: function( includeHidden ) { var position = this.css( "position" ), excludeStaticParent = position === "absolute", overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, scrollParent = this.parents().filter( function() { var parent = $( this ); if ( excludeStaticParent && parent.css( "position" ) === "static" ) { return false; } return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) ); }).eq( 0 ); return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; }, uniqueId: (function() { var uuid = 0; return function() { return this.each(function() { if ( !this.id ) { this.id = "ui-id-" + ( ++uuid ); } }); }; })(), removeUniqueId: function() { return this.each(function() { if ( /^ui-id-\d+$/.test( this.id ) ) { $( this ).removeAttr( "id" ); } }); } }); // selectors function focusable( element, isTabIndexNotNaN ) { var map, mapName, img, nodeName = element.nodeName.toLowerCase(); if ( "area" === nodeName ) { map = element.parentNode; mapName = map.name; if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { return false; } img = $( "img[usemap='#" + mapName + "']" )[ 0 ]; return !!img && visible( img ); } return ( /^(input|select|textarea|button|object)$/.test( nodeName ) ? !element.disabled : "a" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && // the element and all of its ancestors must be visible visible( element ); } function visible( element ) { return $.expr.filters.visible( element ) && !$( element ).parents().addBack().filter(function() { return $.css( this, "visibility" ) === "hidden"; }).length; } $.extend( $.expr[ ":" ], { data: $.expr.createPseudo ? $.expr.createPseudo(function( dataName ) { return function( elem ) { return !!$.data( elem, dataName ); }; }) : // support: jQuery <1.8 function( elem, i, match ) { return !!$.data( elem, match[ 3 ] ); }, focusable: function( element ) { return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) ); }, tabbable: function( element ) { var tabIndex = $.attr( element, "tabindex" ), isTabIndexNaN = isNaN( tabIndex ); return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN ); } }); // support: jQuery <1.8 if ( !$( "<a>" ).outerWidth( 1 ).jquery ) { $.each( [ "Width", "Height" ], function( i, name ) { var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ], type = name.toLowerCase(), orig = { innerWidth: $.fn.innerWidth, innerHeight: $.fn.innerHeight, outerWidth: $.fn.outerWidth, outerHeight: $.fn.outerHeight }; function reduce( elem, size, border, margin ) { $.each( side, function() { size -= parseFloat( $.css( elem, "padding" + this ) ) || 0; if ( border ) { size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0; } if ( margin ) { size -= parseFloat( $.css( elem, "margin" + this ) ) || 0; } }); return size; } $.fn[ "inner" + name ] = function( size ) { if ( size === undefined ) { return orig[ "inner" + name ].call( this ); } return this.each(function() { $( this ).css( type, reduce( this, size ) + "px" ); }); }; $.fn[ "outer" + name] = function( size, margin ) { if ( typeof size !== "number" ) { return orig[ "outer" + name ].call( this, size ); } return this.each(function() { $( this).css( type, reduce( this, size, true, margin ) + "px" ); }); }; }); } // support: jQuery <1.8 if ( !$.fn.addBack ) { $.fn.addBack = function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter( selector ) ); }; } // support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413) if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) { $.fn.removeData = (function( removeData ) { return function( key ) { if ( arguments.length ) { return removeData.call( this, $.camelCase( key ) ); } else { return removeData.call( this ); } }; })( $.fn.removeData ); } // deprecated $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); $.fn.extend({ focus: (function( orig ) { return function( delay, fn ) { return typeof delay === "number" ? this.each(function() { var elem = this; setTimeout(function() { $( elem ).focus(); if ( fn ) { fn.call( elem ); } }, delay ); }) : orig.apply( this, arguments ); }; })( $.fn.focus ), disableSelection: (function() { var eventType = "onselectstart" in document.createElement( "div" ) ? "selectstart" : "mousedown"; return function() { return this.bind( eventType + ".ui-disableSelection", function( event ) { event.preventDefault(); }); }; })(), enableSelection: function() { return this.unbind( ".ui-disableSelection" ); }, zIndex: function( zIndex ) { if ( zIndex !== undefined ) { return this.css( "zIndex", zIndex ); } if ( this.length ) { var elem = $( this[ 0 ] ), position, value; while ( elem.length && elem[ 0 ] !== document ) { // Ignore z-index if position is set to a value where z-index is ignored by the browser // This makes behavior of this function consistent across browsers // WebKit always returns auto if the element is positioned position = elem.css( "position" ); if ( position === "absolute" || position === "relative" || position === "fixed" ) { // IE returns 0 when zIndex is not specified // other browsers return a string // we ignore the case of nested elements with an explicit value of 0 // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> value = parseInt( elem.css( "zIndex" ), 10 ); if ( !isNaN( value ) && value !== 0 ) { return value; } } elem = elem.parent(); } } return 0; } }); // $.ui.plugin is deprecated. Use $.widget() extensions instead. $.ui.plugin = { add: function( module, option, set ) { var i, proto = $.ui[ module ].prototype; for ( i in set ) { proto.plugins[ i ] = proto.plugins[ i ] || []; proto.plugins[ i ].push( [ option, set[ i ] ] ); } }, call: function( instance, name, args, allowDisconnected ) { var i, set = instance.plugins[ name ]; if ( !set ) { return; } if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) { return; } for ( i = 0; i < set.length; i++ ) { if ( instance.options[ set[ i ][ 0 ] ] ) { set[ i ][ 1 ].apply( instance.element, args ); } } } }; /*! * jQuery UI Widget 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/jQuery.widget/ */ var widget_uuid = 0, widget_slice = Array.prototype.slice; $.cleanData = (function( orig ) { return function( elems ) { var events, elem, i; for ( i = 0; (elem = elems[i]) != null; i++ ) { try { // Only trigger remove when necessary to save time events = $._data( elem, "events" ); if ( events && events.remove ) { $( elem ).triggerHandler( "remove" ); } // http://bugs.jquery.com/ticket/8235 } catch ( e ) {} } orig( elems ); }; })( $.cleanData ); $.widget = function( name, base, prototype ) { var fullName, existingConstructor, constructor, basePrototype, // proxiedPrototype allows the provided prototype to remain unmodified // so that it can be used as a mixin for multiple widgets (#8876) proxiedPrototype = {}, namespace = name.split( "." )[ 0 ]; name = name.split( "." )[ 1 ]; fullName = namespace + "-" + name; if ( !prototype ) { prototype = base; base = $.Widget; } // create selector for plugin $.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) { return !!$.data( elem, fullName ); }; $[ namespace ] = $[ namespace ] || {}; existingConstructor = $[ namespace ][ name ]; constructor = $[ namespace ][ name ] = function( options, element ) { // allow instantiation without "new" keyword if ( !this._createWidget ) { return new constructor( options, element ); } // allow instantiation without initializing for simple inheritance // must use "new" keyword (the code above always passes args) if ( arguments.length ) { this._createWidget( options, element ); } }; // extend with the existing constructor to carry over any static properties $.extend( constructor, existingConstructor, { version: prototype.version, // copy the object used to create the prototype in case we need to // redefine the widget later _proto: $.extend( {}, prototype ), // track widgets that inherit from this widget in case this widget is // redefined after a widget inherits from it _childConstructors: [] }); basePrototype = new base(); // we need to make the options hash a property directly on the new instance // otherwise we'll modify the options hash on the prototype that we're // inheriting from basePrototype.options = $.widget.extend( {}, basePrototype.options ); $.each( prototype, function( prop, value ) { if ( !$.isFunction( value ) ) { proxiedPrototype[ prop ] = value; return; } proxiedPrototype[ prop ] = (function() { var _super = function() { return base.prototype[ prop ].apply( this, arguments ); }, _superApply = function( args ) { return base.prototype[ prop ].apply( this, args ); }; return function() { var __super = this._super, __superApply = this._superApply, returnValue; this._super = _super; this._superApply = _superApply; returnValue = value.apply( this, arguments ); this._super = __super; this._superApply = __superApply; return returnValue; }; })(); }); constructor.prototype = $.widget.extend( basePrototype, { // TODO: remove support for widgetEventPrefix // always use the name + a colon as the prefix, e.g., draggable:start // don't prefix for widgets that aren't DOM-based widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name }, proxiedPrototype, { constructor: constructor, namespace: namespace, widgetName: name, widgetFullName: fullName }); // If this widget is being redefined then we need to find all widgets that // are inheriting from it and redefine all of them so that they inherit from // the new version of this widget. We're essentially trying to replace one // level in the prototype chain. if ( existingConstructor ) { $.each( existingConstructor._childConstructors, function( i, child ) { var childPrototype = child.prototype; // redefine the child widget using the same prototype that was // originally used, but inherit from the new version of the base $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); }); // remove the list of existing child constructors from the old constructor // so the old child constructors can be garbage collected delete existingConstructor._childConstructors; } else { base._childConstructors.push( constructor ); } $.widget.bridge( name, constructor ); return constructor; }; $.widget.extend = function( target ) { var input = widget_slice.call( arguments, 1 ), inputIndex = 0, inputLength = input.length, key, value; for ( ; inputIndex < inputLength; inputIndex++ ) { for ( key in input[ inputIndex ] ) { value = input[ inputIndex ][ key ]; if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) { // Clone objects if ( $.isPlainObject( value ) ) { target[ key ] = $.isPlainObject( target[ key ] ) ? $.widget.extend( {}, target[ key ], value ) : // Don't extend strings, arrays, etc. with objects $.widget.extend( {}, value ); // Copy everything else by reference } else { target[ key ] = value; } } } } return target; }; $.widget.bridge = function( name, object ) { var fullName = object.prototype.widgetFullName || name; $.fn[ name ] = function( options ) { var isMethodCall = typeof options === "string", args = widget_slice.call( arguments, 1 ), returnValue = this; if ( isMethodCall ) { this.each(function() { var methodValue, instance = $.data( this, fullName ); if ( options === "instance" ) { returnValue = instance; return false; } if ( !instance ) { return $.error( "cannot call methods on " + name + " prior to initialization; " + "attempted to call method '" + options + "'" ); } if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) { return $.error( "no such method '" + options + "' for " + name + " widget instance" ); } methodValue = instance[ options ].apply( instance, args ); if ( methodValue !== instance && methodValue !== undefined ) { returnValue = methodValue && methodValue.jquery ? returnValue.pushStack( methodValue.get() ) : methodValue; return false; } }); } else { // Allow multiple hashes to be passed on init if ( args.length ) { options = $.widget.extend.apply( null, [ options ].concat(args) ); } this.each(function() { var instance = $.data( this, fullName ); if ( instance ) { instance.option( options || {} ); if ( instance._init ) { instance._init(); } } else { $.data( this, fullName, new object( options, this ) ); } }); } return returnValue; }; }; $.Widget = function( /* options, element */ ) {}; $.Widget._childConstructors = []; $.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "<div>", options: { disabled: false, // callbacks create: null }, _createWidget: function( options, element ) { element = $( element || this.defaultElement || this )[ 0 ]; this.element = $( element ); this.uuid = widget_uuid++; this.eventNamespace = "." + this.widgetName + this.uuid; this.bindings = $(); this.hoverable = $(); this.focusable = $(); if ( element !== this ) { $.data( element, this.widgetFullName, this ); this._on( true, this.element, { remove: function( event ) { if ( event.target === element ) { this.destroy(); } } }); this.document = $( element.style ? // element within the document element.ownerDocument : // element is window or document element.document || element ); this.window = $( this.document[0].defaultView || this.document[0].parentWindow ); } this.options = $.widget.extend( {}, this.options, this._getCreateOptions(), options ); this._create(); this._trigger( "create", null, this._getCreateEventData() ); this._init(); }, _getCreateOptions: $.noop, _getCreateEventData: $.noop, _create: $.noop, _init: $.noop, destroy: function() { this._destroy(); // we can probably remove the unbind calls in 2.0 // all event bindings should go through this._on() this.element .unbind( this.eventNamespace ) .removeData( this.widgetFullName ) // support: jquery <1.6.3 // http://bugs.jquery.com/ticket/9413 .removeData( $.camelCase( this.widgetFullName ) ); this.widget() .unbind( this.eventNamespace ) .removeAttr( "aria-disabled" ) .removeClass( this.widgetFullName + "-disabled " + "ui-state-disabled" ); // clean up events and states this.bindings.unbind( this.eventNamespace ); this.hoverable.removeClass( "ui-state-hover" ); this.focusable.removeClass( "ui-state-focus" ); }, _destroy: $.noop, widget: function() { return this.element; }, option: function( key, value ) { var options = key, parts, curOption, i; if ( arguments.length === 0 ) { // don't return a reference to the internal hash return $.widget.extend( {}, this.options ); } if ( typeof key === "string" ) { // handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } options = {}; parts = key.split( "." ); key = parts.shift(); if ( parts.length ) { curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); for ( i = 0; i < parts.length - 1; i++ ) { curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; curOption = curOption[ parts[ i ] ]; } key = parts.pop(); if ( arguments.length === 1 ) { return curOption[ key ] === undefined ? null : curOption[ key ]; } curOption[ key ] = value; } else { if ( arguments.length === 1 ) { return this.options[ key ] === undefined ? null : this.options[ key ]; } options[ key ] = value; } } this._setOptions( options ); return this; }, _setOptions: function( options ) { var key; for ( key in options ) { this._setOption( key, options[ key ] ); } return this; }, _setOption: function( key, value ) { this.options[ key ] = value; if ( key === "disabled" ) { this.widget() .toggleClass( this.widgetFullName + "-disabled", !!value ); // If the widget is becoming disabled, then nothing is interactive if ( value ) { this.hoverable.removeClass( "ui-state-hover" ); this.focusable.removeClass( "ui-state-focus" ); } } return this; }, enable: function() { return this._setOptions({ disabled: false }); }, disable: function() { return this._setOptions({ disabled: true }); }, _on: function( suppressDisabledCheck, element, handlers ) { var delegateElement, instance = this; // no suppressDisabledCheck flag, shuffle arguments if ( typeof suppressDisabledCheck !== "boolean" ) { handlers = element; element = suppressDisabledCheck; suppressDisabledCheck = false; } // no element argument, shuffle and use this.element if ( !handlers ) { handlers = element; element = this.element; delegateElement = this.widget(); } else { element = delegateElement = $( element ); this.bindings = this.bindings.add( element ); } $.each( handlers, function( event, handler ) { function handlerProxy() { // allow widgets to customize the disabled handling // - disabled as an array instead of boolean // - disabled class as method for disabling individual parts if ( !suppressDisabledCheck && ( instance.options.disabled === true || $( this ).hasClass( "ui-state-disabled" ) ) ) { return; } return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } // copy the guid so direct unbinding works if ( typeof handler !== "string" ) { handlerProxy.guid = handler.guid = handler.guid || handlerProxy.guid || $.guid++; } var match = event.match( /^([\w:-]*)\s*(.*)$/ ), eventName = match[1] + instance.eventNamespace, selector = match[2]; if ( selector ) { delegateElement.delegate( selector, eventName, handlerProxy ); } else { element.bind( eventName, handlerProxy ); } }); }, _off: function( element, eventName ) { eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; element.unbind( eventName ).undelegate( eventName ); // Clear the stack to avoid memory leaks (#10056) this.bindings = $( this.bindings.not( element ).get() ); this.focusable = $( this.focusable.not( element ).get() ); this.hoverable = $( this.hoverable.not( element ).get() ); }, _delay: function( handler, delay ) { function handlerProxy() { return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } var instance = this; return setTimeout( handlerProxy, delay || 0 ); }, _hoverable: function( element ) { this.hoverable = this.hoverable.add( element ); this._on( element, { mouseenter: function( event ) { $( event.currentTarget ).addClass( "ui-state-hover" ); }, mouseleave: function( event ) { $( event.currentTarget ).removeClass( "ui-state-hover" ); } }); }, _focusable: function( element ) { this.focusable = this.focusable.add( element ); this._on( element, { focusin: function( event ) { $( event.currentTarget ).addClass( "ui-state-focus" ); }, focusout: function( event ) { $( event.currentTarget ).removeClass( "ui-state-focus" ); } }); }, _trigger: function( type, event, data ) { var prop, orig, callback = this.options[ type ]; data = data || {}; event = $.Event( event ); event.type = ( type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type ).toLowerCase(); // the original event may come from any element // so we need to reset the target on the new event event.target = this.element[ 0 ]; // copy original event properties over to the new event orig = event.originalEvent; if ( orig ) { for ( prop in orig ) { if ( !( prop in event ) ) { event[ prop ] = orig[ prop ]; } } } this.element.trigger( event, data ); return !( $.isFunction( callback ) && callback.apply( this.element[0], [ event ].concat( data ) ) === false || event.isDefaultPrevented() ); } }; $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { if ( typeof options === "string" ) { options = { effect: options }; } var hasOptions, effectName = !options ? method : options === true || typeof options === "number" ? defaultEffect : options.effect || defaultEffect; options = options || {}; if ( typeof options === "number" ) { options = { duration: options }; } hasOptions = !$.isEmptyObject( options ); options.complete = callback; if ( options.delay ) { element.delay( options.delay ); } if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { element[ method ]( options ); } else if ( effectName !== method && element[ effectName ] ) { element[ effectName ]( options.duration, options.easing, callback ); } else { element.queue(function( next ) { $( this )[ method ](); if ( callback ) { callback.call( element[ 0 ] ); } next(); }); } }; }); var widget = $.widget; /*! * jQuery UI Position 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/position/ */ (function() { $.ui = $.ui || {}; var cachedScrollbarWidth, supportsOffsetFractions, max = Math.max, abs = Math.abs, round = Math.round, rhorizontal = /left|center|right/, rvertical = /top|center|bottom/, roffset = /[\+\-]\d+(\.[\d]+)?%?/, rposition = /^\w+/, rpercent = /%$/, _position = $.fn.position; function getOffsets( offsets, width, height ) { return [ parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) ]; } function parseCss( element, property ) { return parseInt( $.css( element, property ), 10 ) || 0; } function getDimensions( elem ) { var raw = elem[0]; if ( raw.nodeType === 9 ) { return { width: elem.width(), height: elem.height(), offset: { top: 0, left: 0 } }; } if ( $.isWindow( raw ) ) { return { width: elem.width(), height: elem.height(), offset: { top: elem.scrollTop(), left: elem.scrollLeft() } }; } if ( raw.preventDefault ) { return { width: 0, height: 0, offset: { top: raw.pageY, left: raw.pageX } }; } return { width: elem.outerWidth(), height: elem.outerHeight(), offset: elem.offset() }; } $.position = { scrollbarWidth: function() { if ( cachedScrollbarWidth !== undefined ) { return cachedScrollbarWidth; } var w1, w2, div = $( "<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>" ), innerDiv = div.children()[0]; $( "body" ).append( div ); w1 = innerDiv.offsetWidth; div.css( "overflow", "scroll" ); w2 = innerDiv.offsetWidth; if ( w1 === w2 ) { w2 = div[0].clientWidth; } div.remove(); return (cachedScrollbarWidth = w1 - w2); }, getScrollInfo: function( within ) { var overflowX = within.isWindow || within.isDocument ? "" : within.element.css( "overflow-x" ), overflowY = within.isWindow || within.isDocument ? "" : within.element.css( "overflow-y" ), hasOverflowX = overflowX === "scroll" || ( overflowX === "auto" && within.width < within.element[0].scrollWidth ), hasOverflowY = overflowY === "scroll" || ( overflowY === "auto" && within.height < within.element[0].scrollHeight ); return { width: hasOverflowY ? $.position.scrollbarWidth() : 0, height: hasOverflowX ? $.position.scrollbarWidth() : 0 }; }, getWithinInfo: function( element ) { var withinElement = $( element || window ), isWindow = $.isWindow( withinElement[0] ), isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9; return { element: withinElement, isWindow: isWindow, isDocument: isDocument, offset: withinElement.offset() || { left: 0, top: 0 }, scrollLeft: withinElement.scrollLeft(), scrollTop: withinElement.scrollTop(), // support: jQuery 1.6.x // jQuery 1.6 doesn't support .outerWidth/Height() on documents or windows width: isWindow || isDocument ? withinElement.width() : withinElement.outerWidth(), height: isWindow || isDocument ? withinElement.height() : withinElement.outerHeight() }; } }; $.fn.position = function( options ) { if ( !options || !options.of ) { return _position.apply( this, arguments ); } // make a copy, we don't want to modify arguments options = $.extend( {}, options ); var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, target = $( options.of ), within = $.position.getWithinInfo( options.within ), scrollInfo = $.position.getScrollInfo( within ), collision = ( options.collision || "flip" ).split( " " ), offsets = {}; dimensions = getDimensions( target ); if ( target[0].preventDefault ) { // force left top to allow flipping options.at = "left top"; } targetWidth = dimensions.width; targetHeight = dimensions.height; targetOffset = dimensions.offset; // clone to reuse original targetOffset later basePosition = $.extend( {}, targetOffset ); // force my and at to have valid horizontal and vertical positions // if a value is missing or invalid, it will be converted to center $.each( [ "my", "at" ], function() { var pos = ( options[ this ] || "" ).split( " " ), horizontalOffset, verticalOffset; if ( pos.length === 1) { pos = rhorizontal.test( pos[ 0 ] ) ? pos.concat( [ "center" ] ) : rvertical.test( pos[ 0 ] ) ? [ "center" ].concat( pos ) : [ "center", "center" ]; } pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; // calculate offsets horizontalOffset = roffset.exec( pos[ 0 ] ); verticalOffset = roffset.exec( pos[ 1 ] ); offsets[ this ] = [ horizontalOffset ? horizontalOffset[ 0 ] : 0, verticalOffset ? verticalOffset[ 0 ] : 0 ]; // reduce to just the positions without the offsets options[ this ] = [ rposition.exec( pos[ 0 ] )[ 0 ], rposition.exec( pos[ 1 ] )[ 0 ] ]; }); // normalize collision option if ( collision.length === 1 ) { collision[ 1 ] = collision[ 0 ]; } if ( options.at[ 0 ] === "right" ) { basePosition.left += targetWidth; } else if ( options.at[ 0 ] === "center" ) { basePosition.left += targetWidth / 2; } if ( options.at[ 1 ] === "bottom" ) { basePosition.top += targetHeight; } else if ( options.at[ 1 ] === "center" ) { basePosition.top += targetHeight / 2; } atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); basePosition.left += atOffset[ 0 ]; basePosition.top += atOffset[ 1 ]; return this.each(function() { var collisionPosition, using, elem = $( this ), elemWidth = elem.outerWidth(), elemHeight = elem.outerHeight(), marginLeft = parseCss( this, "marginLeft" ), marginTop = parseCss( this, "marginTop" ), collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, position = $.extend( {}, basePosition ), myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); if ( options.my[ 0 ] === "right" ) { position.left -= elemWidth; } else if ( options.my[ 0 ] === "center" ) { position.left -= elemWidth / 2; } if ( options.my[ 1 ] === "bottom" ) { position.top -= elemHeight; } else if ( options.my[ 1 ] === "center" ) { position.top -= elemHeight / 2; } position.left += myOffset[ 0 ]; position.top += myOffset[ 1 ]; // if the browser doesn't support fractions, then round for consistent results if ( !supportsOffsetFractions ) { position.left = round( position.left ); position.top = round( position.top ); } collisionPosition = { marginLeft: marginLeft, marginTop: marginTop }; $.each( [ "left", "top" ], function( i, dir ) { if ( $.ui.position[ collision[ i ] ] ) { $.ui.position[ collision[ i ] ][ dir ]( position, { targetWidth: targetWidth, targetHeight: targetHeight, elemWidth: elemWidth, elemHeight: elemHeight, collisionPosition: collisionPosition, collisionWidth: collisionWidth, collisionHeight: collisionHeight, offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], my: options.my, at: options.at, within: within, elem: elem }); } }); if ( options.using ) { // adds feedback as second argument to using callback, if present using = function( props ) { var left = targetOffset.left - position.left, right = left + targetWidth - elemWidth, top = targetOffset.top - position.top, bottom = top + targetHeight - elemHeight, feedback = { target: { element: target, left: targetOffset.left, top: targetOffset.top, width: targetWidth, height: targetHeight }, element: { element: elem, left: position.left, top: position.top, width: elemWidth, height: elemHeight }, horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" }; if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { feedback.horizontal = "center"; } if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { feedback.vertical = "middle"; } if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { feedback.important = "horizontal"; } else { feedback.important = "vertical"; } options.using.call( this, props, feedback ); }; } elem.offset( $.extend( position, { using: using } ) ); }); }; $.ui.position = { fit: { left: function( position, data ) { var within = data.within, withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, outerWidth = within.width, collisionPosLeft = position.left - data.collisionPosition.marginLeft, overLeft = withinOffset - collisionPosLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, newOverRight; // element is wider than within if ( data.collisionWidth > outerWidth ) { // element is initially over the left side of within if ( overLeft > 0 && overRight <= 0 ) { newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; position.left += overLeft - newOverRight; // element is initially over right side of within } else if ( overRight > 0 && overLeft <= 0 ) { position.left = withinOffset; // element is initially over both left and right sides of within } else { if ( overLeft > overRight ) { position.left = withinOffset + outerWidth - data.collisionWidth; } else { position.left = withinOffset; } } // too far left -> align with left edge } else if ( overLeft > 0 ) { position.left += overLeft; // too far right -> align with right edge } else if ( overRight > 0 ) { position.left -= overRight; // adjust based on position and margin } else { position.left = max( position.left - collisionPosLeft, position.left ); } }, top: function( position, data ) { var within = data.within, withinOffset = within.isWindow ? within.scrollTop : within.offset.top, outerHeight = data.within.height, collisionPosTop = position.top - data.collisionPosition.marginTop, overTop = withinOffset - collisionPosTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, newOverBottom; // element is taller than within if ( data.collisionHeight > outerHeight ) { // element is initially over the top of within if ( overTop > 0 && overBottom <= 0 ) { newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; position.top += overTop - newOverBottom; // element is initially over bottom of within } else if ( overBottom > 0 && overTop <= 0 ) { position.top = withinOffset; // element is initially over both top and bottom of within } else { if ( overTop > overBottom ) { position.top = withinOffset + outerHeight - data.collisionHeight; } else { position.top = withinOffset; } } // too far up -> align with top } else if ( overTop > 0 ) { position.top += overTop; // too far down -> align with bottom edge } else if ( overBottom > 0 ) { position.top -= overBottom; // adjust based on position and margin } else { position.top = max( position.top - collisionPosTop, position.top ); } } }, flip: { left: function( position, data ) { var within = data.within, withinOffset = within.offset.left + within.scrollLeft, outerWidth = within.width, offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, collisionPosLeft = position.left - data.collisionPosition.marginLeft, overLeft = collisionPosLeft - offsetLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, myOffset = data.my[ 0 ] === "left" ? -data.elemWidth : data.my[ 0 ] === "right" ? data.elemWidth : 0, atOffset = data.at[ 0 ] === "left" ? data.targetWidth : data.at[ 0 ] === "right" ? -data.targetWidth : 0, offset = -2 * data.offset[ 0 ], newOverRight, newOverLeft; if ( overLeft < 0 ) { newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { position.left += myOffset + atOffset + offset; } } else if ( overRight > 0 ) { newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { position.left += myOffset + atOffset + offset; } } }, top: function( position, data ) { var within = data.within, withinOffset = within.offset.top + within.scrollTop, outerHeight = within.height, offsetTop = within.isWindow ? within.scrollTop : within.offset.top, collisionPosTop = position.top - data.collisionPosition.marginTop, overTop = collisionPosTop - offsetTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, top = data.my[ 1 ] === "top", myOffset = top ? -data.elemHeight : data.my[ 1 ] === "bottom" ? data.elemHeight : 0, atOffset = data.at[ 1 ] === "top" ? data.targetHeight : data.at[ 1 ] === "bottom" ? -data.targetHeight : 0, offset = -2 * data.offset[ 1 ], newOverTop, newOverBottom; if ( overTop < 0 ) { newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { position.top += myOffset + atOffset + offset; } } else if ( overBottom > 0 ) { newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { position.top += myOffset + atOffset + offset; } } } }, flipfit: { left: function() { $.ui.position.flip.left.apply( this, arguments ); $.ui.position.fit.left.apply( this, arguments ); }, top: function() { $.ui.position.flip.top.apply( this, arguments ); $.ui.position.fit.top.apply( this, arguments ); } } }; // fraction support test (function() { var testElement, testElementParent, testElementStyle, offsetLeft, i, body = document.getElementsByTagName( "body" )[ 0 ], div = document.createElement( "div" ); //Create a "fake body" for testing based on method used in jQuery.support testElement = document.createElement( body ? "div" : "body" ); testElementStyle = { visibility: "hidden", width: 0, height: 0, border: 0, margin: 0, background: "none" }; if ( body ) { $.extend( testElementStyle, { position: "absolute", left: "-1000px", top: "-1000px" }); } for ( i in testElementStyle ) { testElement.style[ i ] = testElementStyle[ i ]; } testElement.appendChild( div ); testElementParent = body || document.documentElement; testElementParent.insertBefore( testElement, testElementParent.firstChild ); div.style.cssText = "position: absolute; left: 10.7432222px;"; offsetLeft = $( div ).offset().left; supportsOffsetFractions = offsetLeft > 10 && offsetLeft < 11; testElement.innerHTML = ""; testElementParent.removeChild( testElement ); })(); })(); var position = $.ui.position; /*! * jQuery UI Datepicker 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/datepicker/ */ $.extend($.ui, { datepicker: { version: "1.11.4" } }); var datepicker_instActive; function datepicker_getZindex( elem ) { var position, value; while ( elem.length && elem[ 0 ] !== document ) { // Ignore z-index if position is set to a value where z-index is ignored by the browser // This makes behavior of this function consistent across browsers // WebKit always returns auto if the element is positioned position = elem.css( "position" ); if ( position === "absolute" || position === "relative" || position === "fixed" ) { // IE returns 0 when zIndex is not specified // other browsers return a string // we ignore the case of nested elements with an explicit value of 0 // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> value = parseInt( elem.css( "zIndex" ), 10 ); if ( !isNaN( value ) && value !== 0 ) { return value; } } elem = elem.parent(); } return 0; } /* Date picker manager. Use the singleton instance of this class, $.datepicker, to interact with the date picker. Settings for (groups of) date pickers are maintained in an instance object, allowing multiple different settings on the same page. */ function Datepicker() { this._curInst = null; // The current instance in use this._keyEvent = false; // If the last event was a key event this._disabledInputs = []; // List of date picker inputs that have been disabled this._datepickerShowing = false; // True if the popup picker is showing , false if not this._inDialog = false; // True if showing within a "dialog", false if not this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class this._appendClass = "ui-datepicker-append"; // The name of the append marker class this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class this.regional = []; // Available regional settings, indexed by language code this.regional[""] = { // Default regional settings closeText: "Done", // Display text for close link prevText: "Prev", // Display text for previous month link nextText: "Next", // Display text for next month link currentText: "Today", // Display text for current month link monthNames: ["January","February","March","April","May","June", "July","August","September","October","November","December"], // Names of months for drop-down and formatting monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], // For formatting dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], // For formatting dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], // For formatting dayNamesMin: ["Su","Mo","Tu","We","Th","Fr","Sa"], // Column headings for days starting at Sunday weekHeader: "Wk", // Column header for week of the year dateFormat: "mm/dd/yy", // See format options on parseDate firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... isRTL: false, // True if right-to-left language, false if left-to-right showMonthAfterYear: false, // True if the year select precedes month, false for month then year yearSuffix: "" // Additional text to append to the year in the month headers }; this._defaults = { // Global defaults for all the date picker instances showOn: "focus", // "focus" for popup on focus, // "button" for trigger button, or "both" for either showAnim: "fadeIn", // Name of jQuery animation for popup showOptions: {}, // Options for enhanced animations defaultDate: null, // Used when field is blank: actual date, // +/-number for offset from today, null for today appendText: "", // Display text following the input box, e.g. showing the format buttonText: "...", // Text for trigger button buttonImage: "", // URL for trigger button image buttonImageOnly: false, // True if the image appears alone, false if it appears on a button hideIfNoPrevNext: false, // True to hide next/previous month links // if not applicable, false to just disable them navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links gotoCurrent: false, // True if today link goes back to current selection instead changeMonth: false, // True if month can be selected directly, false if only prev/next changeYear: false, // True if year can be selected directly, false if only prev/next yearRange: "c-10:c+10", // Range of years to display in drop-down, // either relative to today's year (-nn:+nn), relative to currently displayed year // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) showOtherMonths: false, // True to show dates in other months, false to leave blank selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable showWeek: false, // True to show week of the year, false to not show it calculateWeek: this.iso8601Week, // How to calculate the week of the year, // takes a Date and returns the number of the week for it shortYearCutoff: "+10", // Short year values < this are in the current century, // > this are in the previous century, // string value starting with "+" for current year + value minDate: null, // The earliest selectable date, or null for no limit maxDate: null, // The latest selectable date, or null for no limit duration: "fast", // Duration of display/closure beforeShowDay: null, // Function that takes a date and returns an array with // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "", // [2] = cell title (optional), e.g. $.datepicker.noWeekends beforeShow: null, // Function that takes an input field and // returns a set of custom settings for the date picker onSelect: null, // Define a callback function when a date is selected onChangeMonthYear: null, // Define a callback function when the month or year is changed onClose: null, // Define a callback function when the datepicker is closed numberOfMonths: 1, // Number of months to show at a time showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) stepMonths: 1, // Number of months to step back/forward stepBigMonths: 12, // Number of months to step back/forward for the big links altField: "", // Selector for an alternate field to store selected dates into altFormat: "", // The date format to use for the alternate field constrainInput: true, // The input is constrained by the current date format showButtonPanel: false, // True to show button panel, false to not show it autoSize: false, // True to size the input for the date format, false to leave as is disabled: false // The initial disabled state }; $.extend(this._defaults, this.regional[""]); this.regional.en = $.extend( true, {}, this.regional[ "" ]); this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en ); this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")); } $.extend(Datepicker.prototype, { /* Class name added to elements to indicate already configured with a date picker. */ markerClassName: "hasDatepicker", //Keep track of the maximum number of rows displayed (see #7043) maxRows: 4, // TODO rename to "widget" when switching to widget factory _widgetDatepicker: function() { return this.dpDiv; }, /* Override the default settings for all instances of the date picker. * @param settings object - the new settings to use as defaults (anonymous object) * @return the manager object */ setDefaults: function(settings) { datepicker_extendRemove(this._defaults, settings || {}); return this; }, /* Attach the date picker to a jQuery selection. * @param target element - the target input field or division or span * @param settings object - the new settings to use for this date picker instance (anonymous) */ _attachDatepicker: function(target, settings) { var nodeName, inline, inst; nodeName = target.nodeName.toLowerCase(); inline = (nodeName === "div" || nodeName === "span"); if (!target.id) { this.uuid += 1; target.id = "dp" + this.uuid; } inst = this._newInst($(target), inline); inst.settings = $.extend({}, settings || {}); if (nodeName === "input") { this._connectDatepicker(target, inst); } else if (inline) { this._inlineDatepicker(target, inst); } }, /* Create a new instance object. */ _newInst: function(target, inline) { var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1"); // escape jQuery meta chars return {id: id, input: target, // associated target selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection drawMonth: 0, drawYear: 0, // month being drawn inline: inline, // is datepicker inline or not dpDiv: (!inline ? this.dpDiv : // presentation div datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")))}; }, /* Attach the date picker to an input field. */ _connectDatepicker: function(target, inst) { var input = $(target); inst.append = $([]); inst.trigger = $([]); if (input.hasClass(this.markerClassName)) { return; } this._attachments(input, inst); input.addClass(this.markerClassName).keydown(this._doKeyDown). keypress(this._doKeyPress).keyup(this._doKeyUp); this._autoSize(inst); $.data(target, "datepicker", inst); //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665) if( inst.settings.disabled ) { this._disableDatepicker( target ); } }, /* Make attachments based on settings. */ _attachments: function(input, inst) { var showOn, buttonText, buttonImage, appendText = this._get(inst, "appendText"), isRTL = this._get(inst, "isRTL"); if (inst.append) { inst.append.remove(); } if (appendText) { inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>"); input[isRTL ? "before" : "after"](inst.append); } input.unbind("focus", this._showDatepicker); if (inst.trigger) { inst.trigger.remove(); } showOn = this._get(inst, "showOn"); if (showOn === "focus" || showOn === "both") { // pop-up date picker when in the marked field input.focus(this._showDatepicker); } if (showOn === "button" || showOn === "both") { // pop-up date picker when button clicked buttonText = this._get(inst, "buttonText"); buttonImage = this._get(inst, "buttonImage"); inst.trigger = $(this._get(inst, "buttonImageOnly") ? $("<img/>").addClass(this._triggerClass). attr({ src: buttonImage, alt: buttonText, title: buttonText }) : $("<button type='button'></button>").addClass(this._triggerClass). html(!buttonImage ? buttonText : $("<img/>").attr( { src:buttonImage, alt:buttonText, title:buttonText }))); input[isRTL ? "before" : "after"](inst.trigger); inst.trigger.click(function() { if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) { $.datepicker._hideDatepicker(); } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) { $.datepicker._hideDatepicker(); $.datepicker._showDatepicker(input[0]); } else { $.datepicker._showDatepicker(input[0]); } return false; }); } }, /* Apply the maximum length for the date format. */ _autoSize: function(inst) { if (this._get(inst, "autoSize") && !inst.inline) { var findMax, max, maxI, i, date = new Date(2009, 12 - 1, 20), // Ensure double digits dateFormat = this._get(inst, "dateFormat"); if (dateFormat.match(/[DM]/)) { findMax = function(names) { max = 0; maxI = 0; for (i = 0; i < names.length; i++) { if (names[i].length > max) { max = names[i].length; maxI = i; } } return maxI; }; date.setMonth(findMax(this._get(inst, (dateFormat.match(/MM/) ? "monthNames" : "monthNamesShort")))); date.setDate(findMax(this._get(inst, (dateFormat.match(/DD/) ? "dayNames" : "dayNamesShort"))) + 20 - date.getDay()); } inst.input.attr("size", this._formatDate(inst, date).length); } }, /* Attach an inline date picker to a div. */ _inlineDatepicker: function(target, inst) { var divSpan = $(target); if (divSpan.hasClass(this.markerClassName)) { return; } divSpan.addClass(this.markerClassName).append(inst.dpDiv); $.data(target, "datepicker", inst); this._setDate(inst, this._getDefaultDate(inst), true); this._updateDatepicker(inst); this._updateAlternate(inst); //If disabled option is true, disable the datepicker before showing it (see ticket #5665) if( inst.settings.disabled ) { this._disableDatepicker( target ); } // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height inst.dpDiv.css( "display", "block" ); }, /* Pop-up the date picker in a "dialog" box. * @param input element - ignored * @param date string or Date - the initial date to display * @param onSelect function - the function to call when a date is selected * @param settings object - update the dialog date picker instance's settings (anonymous object) * @param pos int[2] - coordinates for the dialog's position within the screen or * event - with x/y coordinates or * leave empty for default (screen centre) * @return the manager object */ _dialogDatepicker: function(input, date, onSelect, settings, pos) { var id, browserWidth, browserHeight, scrollX, scrollY, inst = this._dialogInst; // internal instance if (!inst) { this.uuid += 1; id = "dp" + this.uuid; this._dialogInput = $("<input type='text' id='" + id + "' style='position: absolute; top: -100px; width: 0px;'/>"); this._dialogInput.keydown(this._doKeyDown); $("body").append(this._dialogInput); inst = this._dialogInst = this._newInst(this._dialogInput, false); inst.settings = {}; $.data(this._dialogInput[0], "datepicker", inst); } datepicker_extendRemove(inst.settings, settings || {}); date = (date && date.constructor === Date ? this._formatDate(inst, date) : date); this._dialogInput.val(date); this._pos = (pos ? (pos.length ? pos : [pos.pageX, pos.pageY]) : null); if (!this._pos) { browserWidth = document.documentElement.clientWidth; browserHeight = document.documentElement.clientHeight; scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; scrollY = document.documentElement.scrollTop || document.body.scrollTop; this._pos = // should use actual width/height below [(browserWidth / 2) - 100 + scrollX, (browserHeight / 2) - 150 + scrollY]; } // move input on screen for focus, but hidden behind dialog this._dialogInput.css("left", (this._pos[0] + 20) + "px").css("top", this._pos[1] + "px"); inst.settings.onSelect = onSelect; this._inDialog = true; this.dpDiv.addClass(this._dialogClass); this._showDatepicker(this._dialogInput[0]); if ($.blockUI) { $.blockUI(this.dpDiv); } $.data(this._dialogInput[0], "datepicker", inst); return this; }, /* Detach a datepicker from its control. * @param target element - the target input field or division or span */ _destroyDatepicker: function(target) { var nodeName, $target = $(target), inst = $.data(target, "datepicker"); if (!$target.hasClass(this.markerClassName)) { return; } nodeName = target.nodeName.toLowerCase(); $.removeData(target, "datepicker"); if (nodeName === "input") { inst.append.remove(); inst.trigger.remove(); $target.removeClass(this.markerClassName). unbind("focus", this._showDatepicker). unbind("keydown", this._doKeyDown). unbind("keypress", this._doKeyPress). unbind("keyup", this._doKeyUp); } else if (nodeName === "div" || nodeName === "span") { $target.removeClass(this.markerClassName).empty(); } if ( datepicker_instActive === inst ) { datepicker_instActive = null; } }, /* Enable the date picker to a jQuery selection. * @param target element - the target input field or division or span */ _enableDatepicker: function(target) { var nodeName, inline, $target = $(target), inst = $.data(target, "datepicker"); if (!$target.hasClass(this.markerClassName)) { return; } nodeName = target.nodeName.toLowerCase(); if (nodeName === "input") { target.disabled = false; inst.trigger.filter("button"). each(function() { this.disabled = false; }).end(). filter("img").css({opacity: "1.0", cursor: ""}); } else if (nodeName === "div" || nodeName === "span") { inline = $target.children("." + this._inlineClass); inline.children().removeClass("ui-state-disabled"); inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). prop("disabled", false); } this._disabledInputs = $.map(this._disabledInputs, function(value) { return (value === target ? null : value); }); // delete entry }, /* Disable the date picker to a jQuery selection. * @param target element - the target input field or division or span */ _disableDatepicker: function(target) { var nodeName, inline, $target = $(target), inst = $.data(target, "datepicker"); if (!$target.hasClass(this.markerClassName)) { return; } nodeName = target.nodeName.toLowerCase(); if (nodeName === "input") { target.disabled = true; inst.trigger.filter("button"). each(function() { this.disabled = true; }).end(). filter("img").css({opacity: "0.5", cursor: "default"}); } else if (nodeName === "div" || nodeName === "span") { inline = $target.children("." + this._inlineClass); inline.children().addClass("ui-state-disabled"); inline.find("select.ui-datepicker-month, select.ui-datepicker-year"). prop("disabled", true); } this._disabledInputs = $.map(this._disabledInputs, function(value) { return (value === target ? null : value); }); // delete entry this._disabledInputs[this._disabledInputs.length] = target; }, /* Is the first field in a jQuery collection disabled as a datepicker? * @param target element - the target input field or division or span * @return boolean - true if disabled, false if enabled */ _isDisabledDatepicker: function(target) { if (!target) { return false; } for (var i = 0; i < this._disabledInputs.length; i++) { if (this._disabledInputs[i] === target) { return true; } } return false; }, /* Retrieve the instance data for the target control. * @param target element - the target input field or division or span * @return object - the associated instance data * @throws error if a jQuery problem getting data */ _getInst: function(target) { try { return $.data(target, "datepicker"); } catch (err) { throw "Missing instance data for this datepicker"; } }, /* Update or retrieve the settings for a date picker attached to an input field or division. * @param target element - the target input field or division or span * @param name object - the new settings to update or * string - the name of the setting to change or retrieve, * when retrieving also "all" for all instance settings or * "defaults" for all global defaults * @param value any - the new value for the setting * (omit if above is an object or to retrieve a value) */ _optionDatepicker: function(target, name, value) { var settings, date, minDate, maxDate, inst = this._getInst(target); if (arguments.length === 2 && typeof name === "string") { return (name === "defaults" ? $.extend({}, $.datepicker._defaults) : (inst ? (name === "all" ? $.extend({}, inst.settings) : this._get(inst, name)) : null)); } settings = name || {}; if (typeof name === "string") { settings = {}; settings[name] = value; } if (inst) { if (this._curInst === inst) { this._hideDatepicker(); } date = this._getDateDatepicker(target, true); minDate = this._getMinMaxDate(inst, "min"); maxDate = this._getMinMaxDate(inst, "max"); datepicker_extendRemove(inst.settings, settings); // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) { inst.settings.minDate = this._formatDate(inst, minDate); } if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) { inst.settings.maxDate = this._formatDate(inst, maxDate); } if ( "disabled" in settings ) { if ( settings.disabled ) { this._disableDatepicker(target); } else { this._enableDatepicker(target); } } this._attachments($(target), inst); this._autoSize(inst); this._setDate(inst, date); this._updateAlternate(inst); this._updateDatepicker(inst); } }, // change method deprecated _changeDatepicker: function(target, name, value) { this._optionDatepicker(target, name, value); }, /* Redraw the date picker attached to an input field or division. * @param target element - the target input field or division or span */ _refreshDatepicker: function(target) { var inst = this._getInst(target); if (inst) { this._updateDatepicker(inst); } }, /* Set the dates for a jQuery selection. * @param target element - the target input field or division or span * @param date Date - the new date */ _setDateDatepicker: function(target, date) { var inst = this._getInst(target); if (inst) { this._setDate(inst, date); this._updateDatepicker(inst); this._updateAlternate(inst); } }, /* Get the date(s) for the first entry in a jQuery selection. * @param target element - the target input field or division or span * @param noDefault boolean - true if no default date is to be used * @return Date - the current date */ _getDateDatepicker: function(target, noDefault) { var inst = this._getInst(target); if (inst && !inst.inline) { this._setDateFromField(inst, noDefault); } return (inst ? this._getDate(inst) : null); }, /* Handle keystrokes. */ _doKeyDown: function(event) { var onSelect, dateStr, sel, inst = $.datepicker._getInst(event.target), handled = true, isRTL = inst.dpDiv.is(".ui-datepicker-rtl"); inst._keyEvent = true; if ($.datepicker._datepickerShowing) { switch (event.keyCode) { case 9: $.datepicker._hideDatepicker(); handled = false; break; // hide on tab out case 13: sel = $("td." + $.datepicker._dayOverClass + ":not(." + $.datepicker._currentClass + ")", inst.dpDiv); if (sel[0]) { $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]); } onSelect = $.datepicker._get(inst, "onSelect"); if (onSelect) { dateStr = $.datepicker._formatDate(inst); // trigger custom callback onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); } else { $.datepicker._hideDatepicker(); } return false; // don't submit the form case 27: $.datepicker._hideDatepicker(); break; // hide on escape case 33: $.datepicker._adjustDate(event.target, (event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths")), "M"); break; // previous month/year on page up/+ ctrl case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths")), "M"); break; // next month/year on page down/+ ctrl case 35: if (event.ctrlKey || event.metaKey) { $.datepicker._clearDate(event.target); } handled = event.ctrlKey || event.metaKey; break; // clear on ctrl or command +end case 36: if (event.ctrlKey || event.metaKey) { $.datepicker._gotoToday(event.target); } handled = event.ctrlKey || event.metaKey; break; // current on ctrl or command +home case 37: if (event.ctrlKey || event.metaKey) { $.datepicker._adjustDate(event.target, (isRTL ? +1 : -1), "D"); } handled = event.ctrlKey || event.metaKey; // -1 day on ctrl or command +left if (event.originalEvent.altKey) { $.datepicker._adjustDate(event.target, (event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths")), "M"); } // next month/year on alt +left on Mac break; case 38: if (event.ctrlKey || event.metaKey) { $.datepicker._adjustDate(event.target, -7, "D"); } handled = event.ctrlKey || event.metaKey; break; // -1 week on ctrl or command +up case 39: if (event.ctrlKey || event.metaKey) { $.datepicker._adjustDate(event.target, (isRTL ? -1 : +1), "D"); } handled = event.ctrlKey || event.metaKey; // +1 day on ctrl or command +right if (event.originalEvent.altKey) { $.datepicker._adjustDate(event.target, (event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths")), "M"); } // next month/year on alt +right break; case 40: if (event.ctrlKey || event.metaKey) { $.datepicker._adjustDate(event.target, +7, "D"); } handled = event.ctrlKey || event.metaKey; break; // +1 week on ctrl or command +down default: handled = false; } } else if (event.keyCode === 36 && event.ctrlKey) { // display the date picker on ctrl+home $.datepicker._showDatepicker(this); } else { handled = false; } if (handled) { event.preventDefault(); event.stopPropagation(); } }, /* Filter entered characters - based on date format. */ _doKeyPress: function(event) { var chars, chr, inst = $.datepicker._getInst(event.target); if ($.datepicker._get(inst, "constrainInput")) { chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat")); chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode); return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1); } }, /* Synchronise manual entry and field/alternate field. */ _doKeyUp: function(event) { var date, inst = $.datepicker._getInst(event.target); if (inst.input.val() !== inst.lastVal) { try { date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), (inst.input ? inst.input.val() : null), $.datepicker._getFormatConfig(inst)); if (date) { // only if valid $.datepicker._setDateFromField(inst); $.datepicker._updateAlternate(inst); $.datepicker._updateDatepicker(inst); } } catch (err) { } } return true; }, /* Pop-up the date picker for a given input field. * If false returned from beforeShow event handler do not show. * @param input element - the input field attached to the date picker or * event - if triggered by focus */ _showDatepicker: function(input) { input = input.target || input; if (input.nodeName.toLowerCase() !== "input") { // find from button/image trigger input = $("input", input.parentNode)[0]; } if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) { // already here return; } var inst, beforeShow, beforeShowSettings, isFixed, offset, showAnim, duration; inst = $.datepicker._getInst(input); if ($.datepicker._curInst && $.datepicker._curInst !== inst) { $.datepicker._curInst.dpDiv.stop(true, true); if ( inst && $.datepicker._datepickerShowing ) { $.datepicker._hideDatepicker( $.datepicker._curInst.input[0] ); } } beforeShow = $.datepicker._get(inst, "beforeShow"); beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {}; if(beforeShowSettings === false){ return; } datepicker_extendRemove(inst.settings, beforeShowSettings); inst.lastVal = null; $.datepicker._lastInput = input; $.datepicker._setDateFromField(inst); if ($.datepicker._inDialog) { // hide cursor input.value = ""; } if (!$.datepicker._pos) { // position below input $.datepicker._pos = $.datepicker._findPos(input); $.datepicker._pos[1] += input.offsetHeight; // add the height } isFixed = false; $(input).parents().each(function() { isFixed |= $(this).css("position") === "fixed"; return !isFixed; }); offset = {left: $.datepicker._pos[0], top: $.datepicker._pos[1]}; $.datepicker._pos = null; //to avoid flashes on Firefox inst.dpDiv.empty(); // determine sizing offscreen inst.dpDiv.css({position: "absolute", display: "block", top: "-1000px"}); $.datepicker._updateDatepicker(inst); // fix width for dynamic number of date pickers // and adjust position before showing offset = $.datepicker._checkOffset(inst, offset, isFixed); inst.dpDiv.css({position: ($.datepicker._inDialog && $.blockUI ? "static" : (isFixed ? "fixed" : "absolute")), display: "none", left: offset.left + "px", top: offset.top + "px"}); if (!inst.inline) { showAnim = $.datepicker._get(inst, "showAnim"); duration = $.datepicker._get(inst, "duration"); inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 ); $.datepicker._datepickerShowing = true; if ( $.effects && $.effects.effect[ showAnim ] ) { inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration); } else { inst.dpDiv[showAnim || "show"](showAnim ? duration : null); } if ( $.datepicker._shouldFocusInput( inst ) ) { inst.input.focus(); } $.datepicker._curInst = inst; } }, /* Generate the date picker content. */ _updateDatepicker: function(inst) { this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) datepicker_instActive = inst; // for delegate hover events inst.dpDiv.empty().append(this._generateHTML(inst)); this._attachHandlers(inst); var origyearshtml, numMonths = this._getNumberOfMonths(inst), cols = numMonths[1], width = 17, activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ); if ( activeCell.length > 0 ) { datepicker_handleMouseover.apply( activeCell.get( 0 ) ); } inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""); if (cols > 1) { inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", (width * cols) + "em"); } inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi"); inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"); if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) { inst.input.focus(); } // deffered render of the years select (to avoid flashes on Firefox) if( inst.yearshtml ){ origyearshtml = inst.yearshtml; setTimeout(function(){ //assure that inst.yearshtml didn't change. if( origyearshtml === inst.yearshtml && inst.yearshtml ){ inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml); } origyearshtml = inst.yearshtml = null; }, 0); } }, // #6694 - don't focus the input if it's already focused // this breaks the change event in IE // Support: IE and jQuery <1.9 _shouldFocusInput: function( inst ) { return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" ); }, /* Check positioning to remain on screen. */ _checkOffset: function(inst, offset, isFixed) { var dpWidth = inst.dpDiv.outerWidth(), dpHeight = inst.dpDiv.outerHeight(), inputWidth = inst.input ? inst.input.outerWidth() : 0, inputHeight = inst.input ? inst.input.outerHeight() : 0, viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()), viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop()); offset.left -= (this._get(inst, "isRTL") ? (dpWidth - inputWidth) : 0); offset.left -= (isFixed && offset.left === inst.input.offset().left) ? $(document).scrollLeft() : 0; offset.top -= (isFixed && offset.top === (inst.input.offset().top + inputHeight)) ? $(document).scrollTop() : 0; // now check if datepicker is showing outside window viewport - move to a better place if so. offset.left -= Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? Math.abs(offset.left + dpWidth - viewWidth) : 0); offset.top -= Math.min(offset.top, (offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? Math.abs(dpHeight + inputHeight) : 0); return offset; }, /* Find an object's position on the screen. */ _findPos: function(obj) { var position, inst = this._getInst(obj), isRTL = this._get(inst, "isRTL"); while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) { obj = obj[isRTL ? "previousSibling" : "nextSibling"]; } position = $(obj).offset(); return [position.left, position.top]; }, /* Hide the date picker from view. * @param input element - the input field attached to the date picker */ _hideDatepicker: function(input) { var showAnim, duration, postProcess, onClose, inst = this._curInst; if (!inst || (input && inst !== $.data(input, "datepicker"))) { return; } if (this._datepickerShowing) { showAnim = this._get(inst, "showAnim"); duration = this._get(inst, "duration"); postProcess = function() { $.datepicker._tidyDialog(inst); }; // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) { inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess); } else { inst.dpDiv[(showAnim === "slideDown" ? "slideUp" : (showAnim === "fadeIn" ? "fadeOut" : "hide"))]((showAnim ? duration : null), postProcess); } if (!showAnim) { postProcess(); } this._datepickerShowing = false; onClose = this._get(inst, "onClose"); if (onClose) { onClose.apply((inst.input ? inst.input[0] : null), [(inst.input ? inst.input.val() : ""), inst]); } this._lastInput = null; if (this._inDialog) { this._dialogInput.css({ position: "absolute", left: "0", top: "-100px" }); if ($.blockUI) { $.unblockUI(); $("body").append(this.dpDiv); } } this._inDialog = false; } }, /* Tidy up after a dialog display. */ _tidyDialog: function(inst) { inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar"); }, /* Close date picker if clicked elsewhere. */ _checkExternalClick: function(event) { if (!$.datepicker._curInst) { return; } var $target = $(event.target), inst = $.datepicker._getInst($target[0]); if ( ( ( $target[0].id !== $.datepicker._mainDivId && $target.parents("#" + $.datepicker._mainDivId).length === 0 && !$target.hasClass($.datepicker.markerClassName) && !$target.closest("." + $.datepicker._triggerClass).length && $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) ) ) || ( $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst ) ) { $.datepicker._hideDatepicker(); } }, /* Adjust one of the date sub-fields. */ _adjustDate: function(id, offset, period) { var target = $(id), inst = this._getInst(target[0]); if (this._isDisabledDatepicker(target[0])) { return; } this._adjustInstDate(inst, offset + (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning period); this._updateDatepicker(inst); }, /* Action for current link. */ _gotoToday: function(id) { var date, target = $(id), inst = this._getInst(target[0]); if (this._get(inst, "gotoCurrent") && inst.currentDay) { inst.selectedDay = inst.currentDay; inst.drawMonth = inst.selectedMonth = inst.currentMonth; inst.drawYear = inst.selectedYear = inst.currentYear; } else { date = new Date(); inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); } this._notifyChange(inst); this._adjustDate(target); }, /* Action for selecting a new month/year. */ _selectMonthYear: function(id, select, period) { var target = $(id), inst = this._getInst(target[0]); inst["selected" + (period === "M" ? "Month" : "Year")] = inst["draw" + (period === "M" ? "Month" : "Year")] = parseInt(select.options[select.selectedIndex].value,10); this._notifyChange(inst); this._adjustDate(target); }, /* Action for selecting a day. */ _selectDay: function(id, month, year, td) { var inst, target = $(id); if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) { return; } inst = this._getInst(target[0]); inst.selectedDay = inst.currentDay = $("a", td).html(); inst.selectedMonth = inst.currentMonth = month; inst.selectedYear = inst.currentYear = year; this._selectDate(id, this._formatDate(inst, inst.currentDay, inst.currentMonth, inst.currentYear)); }, /* Erase the input field and hide the date picker. */ _clearDate: function(id) { var target = $(id); this._selectDate(target, ""); }, /* Update the input field with the selected date. */ _selectDate: function(id, dateStr) { var onSelect, target = $(id), inst = this._getInst(target[0]); dateStr = (dateStr != null ? dateStr : this._formatDate(inst)); if (inst.input) { inst.input.val(dateStr); } this._updateAlternate(inst); onSelect = this._get(inst, "onSelect"); if (onSelect) { onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]); // trigger custom callback } else if (inst.input) { inst.input.trigger("change"); // fire the change event } if (inst.inline){ this._updateDatepicker(inst); } else { this._hideDatepicker(); this._lastInput = inst.input[0]; if (typeof(inst.input[0]) !== "object") { inst.input.focus(); // restore focus } this._lastInput = null; } }, /* Update any alternate field to synchronise with the main field. */ _updateAlternate: function(inst) { var altFormat, date, dateStr, altField = this._get(inst, "altField"); if (altField) { // update alternate field too altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat"); date = this._getDate(inst); dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst)); $(altField).each(function() { $(this).val(dateStr); }); } }, /* Set as beforeShowDay function to prevent selection of weekends. * @param date Date - the date to customise * @return [boolean, string] - is this date selectable?, what is its CSS class? */ noWeekends: function(date) { var day = date.getDay(); return [(day > 0 && day < 6), ""]; }, /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. * @param date Date - the date to get the week for * @return number - the number of the week within the year that contains this date */ iso8601Week: function(date) { var time, checkDate = new Date(date.getTime()); // Find Thursday of this week starting on Monday checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7)); time = checkDate.getTime(); checkDate.setMonth(0); // Compare with Jan 1 checkDate.setDate(1); return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; }, /* Parse a string value into a date object. * See formatDate below for the possible formats. * * @param format string - the expected format of the date * @param value string - the date in the above format * @param settings Object - attributes include: * shortYearCutoff number - the cutoff year for determining the century (optional) * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) * dayNames string[7] - names of the days from Sunday (optional) * monthNamesShort string[12] - abbreviated names of the months (optional) * monthNames string[12] - names of the months (optional) * @return Date - the extracted date value or null if value is blank */ parseDate: function (format, value, settings) { if (format == null || value == null) { throw "Invalid arguments"; } value = (typeof value === "object" ? value.toString() : value + ""); if (value === "") { return null; } var iFormat, dim, extra, iValue = 0, shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff, shortYearCutoff = (typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp : new Date().getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10)), dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, year = -1, month = -1, day = -1, doy = -1, literal = false, date, // Check whether a format character is doubled lookAhead = function(match) { var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); if (matches) { iFormat++; } return matches; }, // Extract a number from the string value getNumber = function(match) { var isDoubled = lookAhead(match), size = (match === "@" ? 14 : (match === "!" ? 20 : (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))), minSize = (match === "y" ? size : 1), digits = new RegExp("^\\d{" + minSize + "," + size + "}"), num = value.substring(iValue).match(digits); if (!num) { throw "Missing number at position " + iValue; } iValue += num[0].length; return parseInt(num[0], 10); }, // Extract a name from the string value and convert to an index getName = function(match, shortNames, longNames) { var index = -1, names = $.map(lookAhead(match) ? longNames : shortNames, function (v, k) { return [ [k, v] ]; }).sort(function (a, b) { return -(a[1].length - b[1].length); }); $.each(names, function (i, pair) { var name = pair[1]; if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) { index = pair[0]; iValue += name.length; return false; } }); if (index !== -1) { return index + 1; } else { throw "Unknown name at position " + iValue; } }, // Confirm that a literal character matches the string value checkLiteral = function() { if (value.charAt(iValue) !== format.charAt(iFormat)) { throw "Unexpected literal at position " + iValue; } iValue++; }; for (iFormat = 0; iFormat < format.length; iFormat++) { if (literal) { if (format.charAt(iFormat) === "'" && !lookAhead("'")) { literal = false; } else { checkLiteral(); } } else { switch (format.charAt(iFormat)) { case "d": day = getNumber("d"); break; case "D": getName("D", dayNamesShort, dayNames); break; case "o": doy = getNumber("o"); break; case "m": month = getNumber("m"); break; case "M": month = getName("M", monthNamesShort, monthNames); break; case "y": year = getNumber("y"); break; case "@": date = new Date(getNumber("@")); year = date.getFullYear(); month = date.getMonth() + 1; day = date.getDate(); break; case "!": date = new Date((getNumber("!") - this._ticksTo1970) / 10000); year = date.getFullYear(); month = date.getMonth() + 1; day = date.getDate(); break; case "'": if (lookAhead("'")){ checkLiteral(); } else { literal = true; } break; default: checkLiteral(); } } } if (iValue < value.length){ extra = value.substr(iValue); if (!/^\s+/.test(extra)) { throw "Extra/unparsed characters found in date: " + extra; } } if (year === -1) { year = new Date().getFullYear(); } else if (year < 100) { year += new Date().getFullYear() - new Date().getFullYear() % 100 + (year <= shortYearCutoff ? 0 : -100); } if (doy > -1) { month = 1; day = doy; do { dim = this._getDaysInMonth(year, month - 1); if (day <= dim) { break; } month++; day -= dim; } while (true); } date = this._daylightSavingAdjust(new Date(year, month - 1, day)); if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) { throw "Invalid date"; // E.g. 31/02/00 } return date; }, /* Standard date formats. */ ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601) COOKIE: "D, dd M yy", ISO_8601: "yy-mm-dd", RFC_822: "D, d M y", RFC_850: "DD, dd-M-y", RFC_1036: "D, d M y", RFC_1123: "D, d M yy", RFC_2822: "D, d M yy", RSS: "D, d M y", // RFC 822 TICKS: "!", TIMESTAMP: "@", W3C: "yy-mm-dd", // ISO 8601 _ticksTo1970: (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000), /* Format a date object into a string value. * The format can be combinations of the following: * d - day of month (no leading zero) * dd - day of month (two digit) * o - day of year (no leading zeros) * oo - day of year (three digit) * D - day name short * DD - day name long * m - month of year (no leading zero) * mm - month of year (two digit) * M - month name short * MM - month name long * y - year (two digit) * yy - year (four digit) * @ - Unix timestamp (ms since 01/01/1970) * ! - Windows ticks (100ns since 01/01/0001) * "..." - literal text * '' - single quote * * @param format string - the desired format of the date * @param date Date - the date value to format * @param settings Object - attributes include: * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) * dayNames string[7] - names of the days from Sunday (optional) * monthNamesShort string[12] - abbreviated names of the months (optional) * monthNames string[12] - names of the months (optional) * @return string - the date in the above format */ formatDate: function (format, date, settings) { if (!date) { return ""; } var iFormat, dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort, dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames, monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort, monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames, // Check whether a format character is doubled lookAhead = function(match) { var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); if (matches) { iFormat++; } return matches; }, // Format a number, with leading zero if necessary formatNumber = function(match, value, len) { var num = "" + value; if (lookAhead(match)) { while (num.length < len) { num = "0" + num; } } return num; }, // Format a name, short or long as requested formatName = function(match, value, shortNames, longNames) { return (lookAhead(match) ? longNames[value] : shortNames[value]); }, output = "", literal = false; if (date) { for (iFormat = 0; iFormat < format.length; iFormat++) { if (literal) { if (format.charAt(iFormat) === "'" && !lookAhead("'")) { literal = false; } else { output += format.charAt(iFormat); } } else { switch (format.charAt(iFormat)) { case "d": output += formatNumber("d", date.getDate(), 2); break; case "D": output += formatName("D", date.getDay(), dayNamesShort, dayNames); break; case "o": output += formatNumber("o", Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3); break; case "m": output += formatNumber("m", date.getMonth() + 1, 2); break; case "M": output += formatName("M", date.getMonth(), monthNamesShort, monthNames); break; case "y": output += (lookAhead("y") ? date.getFullYear() : (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100); break; case "@": output += date.getTime(); break; case "!": output += date.getTime() * 10000 + this._ticksTo1970; break; case "'": if (lookAhead("'")) { output += "'"; } else { literal = true; } break; default: output += format.charAt(iFormat); } } } } return output; }, /* Extract all possible characters from the date format. */ _possibleChars: function (format) { var iFormat, chars = "", literal = false, // Check whether a format character is doubled lookAhead = function(match) { var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match); if (matches) { iFormat++; } return matches; }; for (iFormat = 0; iFormat < format.length; iFormat++) { if (literal) { if (format.charAt(iFormat) === "'" && !lookAhead("'")) { literal = false; } else { chars += format.charAt(iFormat); } } else { switch (format.charAt(iFormat)) { case "d": case "m": case "y": case "@": chars += "0123456789"; break; case "D": case "M": return null; // Accept anything case "'": if (lookAhead("'")) { chars += "'"; } else { literal = true; } break; default: chars += format.charAt(iFormat); } } } return chars; }, /* Get a setting value, defaulting if necessary. */ _get: function(inst, name) { return inst.settings[name] !== undefined ? inst.settings[name] : this._defaults[name]; }, /* Parse existing date and initialise date picker. */ _setDateFromField: function(inst, noDefault) { if (inst.input.val() === inst.lastVal) { return; } var dateFormat = this._get(inst, "dateFormat"), dates = inst.lastVal = inst.input ? inst.input.val() : null, defaultDate = this._getDefaultDate(inst), date = defaultDate, settings = this._getFormatConfig(inst); try { date = this.parseDate(dateFormat, dates, settings) || defaultDate; } catch (event) { dates = (noDefault ? "" : dates); } inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); inst.currentDay = (dates ? date.getDate() : 0); inst.currentMonth = (dates ? date.getMonth() : 0); inst.currentYear = (dates ? date.getFullYear() : 0); this._adjustInstDate(inst); }, /* Retrieve the default date shown on opening. */ _getDefaultDate: function(inst) { return this._restrictMinMax(inst, this._determineDate(inst, this._get(inst, "defaultDate"), new Date())); }, /* A date may be specified as an exact value or a relative one. */ _determineDate: function(inst, date, defaultDate) { var offsetNumeric = function(offset) { var date = new Date(); date.setDate(date.getDate() + offset); return date; }, offsetString = function(offset) { try { return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), offset, $.datepicker._getFormatConfig(inst)); } catch (e) { // Ignore } var date = (offset.toLowerCase().match(/^c/) ? $.datepicker._getDate(inst) : null) || new Date(), year = date.getFullYear(), month = date.getMonth(), day = date.getDate(), pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, matches = pattern.exec(offset); while (matches) { switch (matches[2] || "d") { case "d" : case "D" : day += parseInt(matches[1],10); break; case "w" : case "W" : day += parseInt(matches[1],10) * 7; break; case "m" : case "M" : month += parseInt(matches[1],10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break; case "y": case "Y" : year += parseInt(matches[1],10); day = Math.min(day, $.datepicker._getDaysInMonth(year, month)); break; } matches = pattern.exec(offset); } return new Date(year, month, day); }, newDate = (date == null || date === "" ? defaultDate : (typeof date === "string" ? offsetString(date) : (typeof date === "number" ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : new Date(date.getTime())))); newDate = (newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate); if (newDate) { newDate.setHours(0); newDate.setMinutes(0); newDate.setSeconds(0); newDate.setMilliseconds(0); } return this._daylightSavingAdjust(newDate); }, /* Handle switch to/from daylight saving. * Hours may be non-zero on daylight saving cut-over: * > 12 when midnight changeover, but then cannot generate * midnight datetime, so jump to 1AM, otherwise reset. * @param date (Date) the date to check * @return (Date) the corrected date */ _daylightSavingAdjust: function(date) { if (!date) { return null; } date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0); return date; }, /* Set the date(s) directly. */ _setDate: function(inst, date, noChange) { var clear = !date, origMonth = inst.selectedMonth, origYear = inst.selectedYear, newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date())); inst.selectedDay = inst.currentDay = newDate.getDate(); inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) { this._notifyChange(inst); } this._adjustInstDate(inst); if (inst.input) { inst.input.val(clear ? "" : this._formatDate(inst)); } }, /* Retrieve the date(s) directly. */ _getDate: function(inst) { var startDate = (!inst.currentYear || (inst.input && inst.input.val() === "") ? null : this._daylightSavingAdjust(new Date( inst.currentYear, inst.currentMonth, inst.currentDay))); return startDate; }, /* Attach the onxxx handlers. These are declared statically so * they work with static code transformers like Caja. */ _attachHandlers: function(inst) { var stepMonths = this._get(inst, "stepMonths"), id = "#" + inst.id.replace( /\\\\/g, "\\" ); inst.dpDiv.find("[data-handler]").map(function () { var handler = { prev: function () { $.datepicker._adjustDate(id, -stepMonths, "M"); }, next: function () { $.datepicker._adjustDate(id, +stepMonths, "M"); }, hide: function () { $.datepicker._hideDatepicker(); }, today: function () { $.datepicker._gotoToday(id); }, selectDay: function () { $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this); return false; }, selectMonth: function () { $.datepicker._selectMonthYear(id, this, "M"); return false; }, selectYear: function () { $.datepicker._selectMonthYear(id, this, "Y"); return false; } }; $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")]); }); }, /* Generate the HTML for the current state of the date picker. */ _generateHTML: function(inst) { var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, monthNames, monthNamesShort, beforeShowDay, showOtherMonths, selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, printDate, dRow, tbody, daySettings, otherMonth, unselectable, tempDate = new Date(), today = this._daylightSavingAdjust( new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())), // clear time isRTL = this._get(inst, "isRTL"), showButtonPanel = this._get(inst, "showButtonPanel"), hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"), navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"), numMonths = this._getNumberOfMonths(inst), showCurrentAtPos = this._get(inst, "showCurrentAtPos"), stepMonths = this._get(inst, "stepMonths"), isMultiMonth = (numMonths[0] !== 1 || numMonths[1] !== 1), currentDate = this._daylightSavingAdjust((!inst.currentDay ? new Date(9999, 9, 9) : new Date(inst.currentYear, inst.currentMonth, inst.currentDay))), minDate = this._getMinMaxDate(inst, "min"), maxDate = this._getMinMaxDate(inst, "max"), drawMonth = inst.drawMonth - showCurrentAtPos, drawYear = inst.drawYear; if (drawMonth < 0) { drawMonth += 12; drawYear--; } if (maxDate) { maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), maxDate.getMonth() - (numMonths[0] * numMonths[1]) + 1, maxDate.getDate())); maxDraw = (minDate && maxDraw < minDate ? minDate : maxDraw); while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) { drawMonth--; if (drawMonth < 0) { drawMonth = 11; drawYear--; } } } inst.drawMonth = drawMonth; inst.drawYear = drawYear; prevText = this._get(inst, "prevText"); prevText = (!navigationAsDateFormat ? prevText : this.formatDate(prevText, this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), this._getFormatConfig(inst))); prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" + " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" : (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>")); nextText = this._get(inst, "nextText"); nextText = (!navigationAsDateFormat ? nextText : this.formatDate(nextText, this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), this._getFormatConfig(inst))); next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" + " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" : (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>")); currentText = this._get(inst, "currentText"); gotoDate = (this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today); currentText = (!navigationAsDateFormat ? currentText : this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); controls = (!inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(inst, "closeText") + "</button>" : ""); buttonPanel = (showButtonPanel) ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") + (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" + ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : ""; firstDay = parseInt(this._get(inst, "firstDay"),10); firstDay = (isNaN(firstDay) ? 0 : firstDay); showWeek = this._get(inst, "showWeek"); dayNames = this._get(inst, "dayNames"); dayNamesMin = this._get(inst, "dayNamesMin"); monthNames = this._get(inst, "monthNames"); monthNamesShort = this._get(inst, "monthNamesShort"); beforeShowDay = this._get(inst, "beforeShowDay"); showOtherMonths = this._get(inst, "showOtherMonths"); selectOtherMonths = this._get(inst, "selectOtherMonths"); defaultDate = this._getDefaultDate(inst); html = ""; dow; for (row = 0; row < numMonths[0]; row++) { group = ""; this.maxRows = 4; for (col = 0; col < numMonths[1]; col++) { selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay)); cornerClass = " ui-corner-all"; calender = ""; if (isMultiMonth) { calender += "<div class='ui-datepicker-group"; if (numMonths[1] > 1) { switch (col) { case 0: calender += " ui-datepicker-group-first"; cornerClass = " ui-corner-" + (isRTL ? "right" : "left"); break; case numMonths[1]-1: calender += " ui-datepicker-group-last"; cornerClass = " ui-corner-" + (isRTL ? "left" : "right"); break; default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break; } } calender += "'>"; } calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" + (/all|left/.test(cornerClass) && row === 0 ? (isRTL ? next : prev) : "") + (/all|right/.test(cornerClass) && row === 0 ? (isRTL ? prev : next) : "") + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, row > 0 || col > 0, monthNames, monthNamesShort) + // draw month headers "</div><table class='ui-datepicker-calendar'><thead>" + "<tr>"; thead = (showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : ""); for (dow = 0; dow < 7; dow++) { // days of the week day = (dow + firstDay) % 7; thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>"; } calender += thead + "</tr></thead><tbody>"; daysInMonth = this._getDaysInMonth(drawYear, drawMonth); if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) { inst.selectedDay = Math.min(inst.selectedDay, daysInMonth); } leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7; curRows = Math.ceil((leadDays + daysInMonth) / 7); // calculate the number of rows to generate numRows = (isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows); //If multiple months, use the higher number of rows (see #7043) this.maxRows = numRows; printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays)); for (dRow = 0; dRow < numRows; dRow++) { // create date picker rows calender += "<tr>"; tbody = (!showWeek ? "" : "<td class='ui-datepicker-week-col'>" + this._get(inst, "calculateWeek")(printDate) + "</td>"); for (dow = 0; dow < 7; dow++) { // create date picker days daySettings = (beforeShowDay ? beforeShowDay.apply((inst.input ? inst.input[0] : null), [printDate]) : [true, ""]); otherMonth = (printDate.getMonth() !== drawMonth); unselectable = (otherMonth && !selectOtherMonths) || !daySettings[0] || (minDate && printDate < minDate) || (maxDate && printDate > maxDate); tbody += "<td class='" + ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + // highlight weekends (otherMonth ? " ui-datepicker-other-month" : "") + // highlight days from other months ((printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent) || // user pressed key (defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime()) ? // or defaultDate is current printedDate and defaultDate is selectedDate " " + this._dayOverClass : "") + // highlight selected day (unselectable ? " " + this._unselectableClass + " ui-state-disabled": "") + // highlight unselectable days (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + // highlight custom dates (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + // highlight selected day (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + // highlight today (if different) ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + // cell title (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + // actions (otherMonth && !showOtherMonths ? "&#xa0;" : // display for other months (unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" + (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") + (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + // highlight selected day (otherMonth ? " ui-priority-secondary" : "") + // distinguish dates from other months "' href='#'>" + printDate.getDate() + "</a>")) + "</td>"; // display selectable date printDate.setDate(printDate.getDate() + 1); printDate = this._daylightSavingAdjust(printDate); } calender += tbody + "</tr>"; } drawMonth++; if (drawMonth > 11) { drawMonth = 0; drawYear++; } calender += "</tbody></table>" + (isMultiMonth ? "</div>" + ((numMonths[0] > 0 && col === numMonths[1]-1) ? "<div class='ui-datepicker-row-break'></div>" : "") : ""); group += calender; } html += group; } html += buttonPanel; inst._keyEvent = false; return html; }, /* Generate the month and year header. */ _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, secondary, monthNames, monthNamesShort) { var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, changeMonth = this._get(inst, "changeMonth"), changeYear = this._get(inst, "changeYear"), showMonthAfterYear = this._get(inst, "showMonthAfterYear"), html = "<div class='ui-datepicker-title'>", monthHtml = ""; // month selection if (secondary || !changeMonth) { monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>"; } else { inMinYear = (minDate && minDate.getFullYear() === drawYear); inMaxYear = (maxDate && maxDate.getFullYear() === drawYear); monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>"; for ( month = 0; month < 12; month++) { if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) { monthHtml += "<option value='" + month + "'" + (month === drawMonth ? " selected='selected'" : "") + ">" + monthNamesShort[month] + "</option>"; } } monthHtml += "</select>"; } if (!showMonthAfterYear) { html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : ""); } // year selection if ( !inst.yearshtml ) { inst.yearshtml = ""; if (secondary || !changeYear) { html += "<span class='ui-datepicker-year'>" + drawYear + "</span>"; } else { // determine range of years to display years = this._get(inst, "yearRange").split(":"); thisYear = new Date().getFullYear(); determineYear = function(value) { var year = (value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) : (value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) : parseInt(value, 10))); return (isNaN(year) ? thisYear : year); }; year = determineYear(years[0]); endYear = Math.max(year, determineYear(years[1] || "")); year = (minDate ? Math.max(year, minDate.getFullYear()) : year); endYear = (maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear); inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>"; for (; year <= endYear; year++) { inst.yearshtml += "<option value='" + year + "'" + (year === drawYear ? " selected='selected'" : "") + ">" + year + "</option>"; } inst.yearshtml += "</select>"; html += inst.yearshtml; inst.yearshtml = null; } } html += this._get(inst, "yearSuffix"); if (showMonthAfterYear) { html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml; } html += "</div>"; // Close datepicker_header return html; }, /* Adjust one of the date sub-fields. */ _adjustInstDate: function(inst, offset, period) { var year = inst.drawYear + (period === "Y" ? offset : 0), month = inst.drawMonth + (period === "M" ? offset : 0), day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0), date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day))); inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); if (period === "M" || period === "Y") { this._notifyChange(inst); } }, /* Ensure a date is within any min/max bounds. */ _restrictMinMax: function(inst, date) { var minDate = this._getMinMaxDate(inst, "min"), maxDate = this._getMinMaxDate(inst, "max"), newDate = (minDate && date < minDate ? minDate : date); return (maxDate && newDate > maxDate ? maxDate : newDate); }, /* Notify change of month/year. */ _notifyChange: function(inst) { var onChange = this._get(inst, "onChangeMonthYear"); if (onChange) { onChange.apply((inst.input ? inst.input[0] : null), [inst.selectedYear, inst.selectedMonth + 1, inst]); } }, /* Determine the number of months to show. */ _getNumberOfMonths: function(inst) { var numMonths = this._get(inst, "numberOfMonths"); return (numMonths == null ? [1, 1] : (typeof numMonths === "number" ? [1, numMonths] : numMonths)); }, /* Determine the current maximum date - ensure no time components are set. */ _getMinMaxDate: function(inst, minMax) { return this._determineDate(inst, this._get(inst, minMax + "Date"), null); }, /* Find the number of days in a given month. */ _getDaysInMonth: function(year, month) { return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate(); }, /* Find the day of the week of the first of a month. */ _getFirstDayOfMonth: function(year, month) { return new Date(year, month, 1).getDay(); }, /* Determines if we should allow a "next/prev" month display change. */ _canAdjustMonth: function(inst, offset, curYear, curMonth) { var numMonths = this._getNumberOfMonths(inst), date = this._daylightSavingAdjust(new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1)); if (offset < 0) { date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth())); } return this._isInRange(inst, date); }, /* Is the given date in the accepted range? */ _isInRange: function(inst, date) { var yearSplit, currentYear, minDate = this._getMinMaxDate(inst, "min"), maxDate = this._getMinMaxDate(inst, "max"), minYear = null, maxYear = null, years = this._get(inst, "yearRange"); if (years){ yearSplit = years.split(":"); currentYear = new Date().getFullYear(); minYear = parseInt(yearSplit[0], 10); maxYear = parseInt(yearSplit[1], 10); if ( yearSplit[0].match(/[+\-].*/) ) { minYear += currentYear; } if ( yearSplit[1].match(/[+\-].*/) ) { maxYear += currentYear; } } return ((!minDate || date.getTime() >= minDate.getTime()) && (!maxDate || date.getTime() <= maxDate.getTime()) && (!minYear || date.getFullYear() >= minYear) && (!maxYear || date.getFullYear() <= maxYear)); }, /* Provide the configuration settings for formatting/parsing. */ _getFormatConfig: function(inst) { var shortYearCutoff = this._get(inst, "shortYearCutoff"); shortYearCutoff = (typeof shortYearCutoff !== "string" ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt(shortYearCutoff, 10)); return {shortYearCutoff: shortYearCutoff, dayNamesShort: this._get(inst, "dayNamesShort"), dayNames: this._get(inst, "dayNames"), monthNamesShort: this._get(inst, "monthNamesShort"), monthNames: this._get(inst, "monthNames")}; }, /* Format the given date for display. */ _formatDate: function(inst, day, month, year) { if (!day) { inst.currentDay = inst.selectedDay; inst.currentMonth = inst.selectedMonth; inst.currentYear = inst.selectedYear; } var date = (day ? (typeof day === "object" ? day : this._daylightSavingAdjust(new Date(year, month, day))) : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay))); return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst)); } }); /* * Bind hover events for datepicker elements. * Done via delegate so the binding only occurs once in the lifetime of the parent div. * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. */ function datepicker_bindHover(dpDiv) { var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; return dpDiv.delegate(selector, "mouseout", function() { $(this).removeClass("ui-state-hover"); if (this.className.indexOf("ui-datepicker-prev") !== -1) { $(this).removeClass("ui-datepicker-prev-hover"); } if (this.className.indexOf("ui-datepicker-next") !== -1) { $(this).removeClass("ui-datepicker-next-hover"); } }) .delegate( selector, "mouseover", datepicker_handleMouseover ); } function datepicker_handleMouseover() { if (!$.datepicker._isDisabledDatepicker( datepicker_instActive.inline? datepicker_instActive.dpDiv.parent()[0] : datepicker_instActive.input[0])) { $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"); $(this).addClass("ui-state-hover"); if (this.className.indexOf("ui-datepicker-prev") !== -1) { $(this).addClass("ui-datepicker-prev-hover"); } if (this.className.indexOf("ui-datepicker-next") !== -1) { $(this).addClass("ui-datepicker-next-hover"); } } } /* jQuery extend now ignores nulls! */ function datepicker_extendRemove(target, props) { $.extend(target, props); for (var name in props) { if (props[name] == null) { target[name] = props[name]; } } return target; } /* Invoke the datepicker functionality. @param options string - a command, optionally followed by additional parameters or Object - settings for attaching new datepicker functionality @return jQuery object */ $.fn.datepicker = function(options){ /* Verify an empty collection wasn't passed - Fixes #6976 */ if ( !this.length ) { return this; } /* Initialise the date picker. */ if (!$.datepicker.initialized) { $(document).mousedown($.datepicker._checkExternalClick); $.datepicker.initialized = true; } /* Append datepicker main container to body if not exist. */ if ($("#"+$.datepicker._mainDivId).length === 0) { $("body").append($.datepicker.dpDiv); } var otherArgs = Array.prototype.slice.call(arguments, 1); if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) { return $.datepicker["_" + options + "Datepicker"]. apply($.datepicker, [this[0]].concat(otherArgs)); } if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") { return $.datepicker["_" + options + "Datepicker"]. apply($.datepicker, [this[0]].concat(otherArgs)); } return this.each(function() { typeof options === "string" ? $.datepicker["_" + options + "Datepicker"]. apply($.datepicker, [this].concat(otherArgs)) : $.datepicker._attachDatepicker(this, options); }); }; $.datepicker = new Datepicker(); // singleton instance $.datepicker.initialized = false; $.datepicker.uuid = new Date().getTime(); $.datepicker.version = "1.11.4"; var datepicker = $.datepicker; /*! * jQuery UI Menu 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/menu/ */ var menu = $.widget( "ui.menu", { version: "1.11.4", defaultElement: "<ul>", delay: 300, options: { icons: { submenu: "ui-icon-carat-1-e" }, items: "> *", menus: "ul", position: { my: "left-1 top", at: "right top" }, role: "menu", // callbacks blur: null, focus: null, select: null }, _create: function() { this.activeMenu = this.element; // Flag used to prevent firing of the click handler // as the event bubbles up through nested menus this.mouseHandled = false; this.element .uniqueId() .addClass( "ui-menu ui-widget ui-widget-content" ) .toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ) .attr({ role: this.options.role, tabIndex: 0 }); if ( this.options.disabled ) { this.element .addClass( "ui-state-disabled" ) .attr( "aria-disabled", "true" ); } this._on({ // Prevent focus from sticking to links inside menu after clicking // them (focus should always stay on UL during navigation). "mousedown .ui-menu-item": function( event ) { event.preventDefault(); }, "click .ui-menu-item": function( event ) { var target = $( event.target ); if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { this.select( event ); // Only set the mouseHandled flag if the event will bubble, see #9469. if ( !event.isPropagationStopped() ) { this.mouseHandled = true; } // Open submenu on click if ( target.has( ".ui-menu" ).length ) { this.expand( event ); } else if ( !this.element.is( ":focus" ) && $( this.document[ 0 ].activeElement ).closest( ".ui-menu" ).length ) { // Redirect focus to the menu this.element.trigger( "focus", [ true ] ); // If the active item is on the top level, let it stay active. // Otherwise, blur the active item since it is no longer visible. if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { clearTimeout( this.timer ); } } } }, "mouseenter .ui-menu-item": function( event ) { // Ignore mouse events while typeahead is active, see #10458. // Prevents focusing the wrong item when typeahead causes a scroll while the mouse // is over an item in the menu if ( this.previousFilter ) { return; } var target = $( event.currentTarget ); // Remove ui-state-active class from siblings of the newly focused menu item // to avoid a jump caused by adjacent elements both having a class with a border target.siblings( ".ui-state-active" ).removeClass( "ui-state-active" ); this.focus( event, target ); }, mouseleave: "collapseAll", "mouseleave .ui-menu": "collapseAll", focus: function( event, keepActiveItem ) { // If there's already an active item, keep it active // If not, activate the first item var item = this.active || this.element.find( this.options.items ).eq( 0 ); if ( !keepActiveItem ) { this.focus( event, item ); } }, blur: function( event ) { this._delay(function() { if ( !$.contains( this.element[0], this.document[0].activeElement ) ) { this.collapseAll( event ); } }); }, keydown: "_keydown" }); this.refresh(); // Clicks outside of a menu collapse any open menus this._on( this.document, { click: function( event ) { if ( this._closeOnDocumentClick( event ) ) { this.collapseAll( event ); } // Reset the mouseHandled flag this.mouseHandled = false; } }); }, _destroy: function() { // Destroy (sub)menus this.element .removeAttr( "aria-activedescendant" ) .find( ".ui-menu" ).addBack() .removeClass( "ui-menu ui-widget ui-widget-content ui-menu-icons ui-front" ) .removeAttr( "role" ) .removeAttr( "tabIndex" ) .removeAttr( "aria-labelledby" ) .removeAttr( "aria-expanded" ) .removeAttr( "aria-hidden" ) .removeAttr( "aria-disabled" ) .removeUniqueId() .show(); // Destroy menu items this.element.find( ".ui-menu-item" ) .removeClass( "ui-menu-item" ) .removeAttr( "role" ) .removeAttr( "aria-disabled" ) .removeUniqueId() .removeClass( "ui-state-hover" ) .removeAttr( "tabIndex" ) .removeAttr( "role" ) .removeAttr( "aria-haspopup" ) .children().each( function() { var elem = $( this ); if ( elem.data( "ui-menu-submenu-carat" ) ) { elem.remove(); } }); // Destroy menu dividers this.element.find( ".ui-menu-divider" ).removeClass( "ui-menu-divider ui-widget-content" ); }, _keydown: function( event ) { var match, prev, character, skip, preventDefault = true; switch ( event.keyCode ) { case $.ui.keyCode.PAGE_UP: this.previousPage( event ); break; case $.ui.keyCode.PAGE_DOWN: this.nextPage( event ); break; case $.ui.keyCode.HOME: this._move( "first", "first", event ); break; case $.ui.keyCode.END: this._move( "last", "last", event ); break; case $.ui.keyCode.UP: this.previous( event ); break; case $.ui.keyCode.DOWN: this.next( event ); break; case $.ui.keyCode.LEFT: this.collapse( event ); break; case $.ui.keyCode.RIGHT: if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { this.expand( event ); } break; case $.ui.keyCode.ENTER: case $.ui.keyCode.SPACE: this._activate( event ); break; case $.ui.keyCode.ESCAPE: this.collapse( event ); break; default: preventDefault = false; prev = this.previousFilter || ""; character = String.fromCharCode( event.keyCode ); skip = false; clearTimeout( this.filterTimer ); if ( character === prev ) { skip = true; } else { character = prev + character; } match = this._filterMenuItems( character ); match = skip && match.index( this.active.next() ) !== -1 ? this.active.nextAll( ".ui-menu-item" ) : match; // If no matches on the current filter, reset to the last character pressed // to move down the menu to the first item that starts with that character if ( !match.length ) { character = String.fromCharCode( event.keyCode ); match = this._filterMenuItems( character ); } if ( match.length ) { this.focus( event, match ); this.previousFilter = character; this.filterTimer = this._delay(function() { delete this.previousFilter; }, 1000 ); } else { delete this.previousFilter; } } if ( preventDefault ) { event.preventDefault(); } }, _activate: function( event ) { if ( !this.active.is( ".ui-state-disabled" ) ) { if ( this.active.is( "[aria-haspopup='true']" ) ) { this.expand( event ); } else { this.select( event ); } } }, refresh: function() { var menus, items, that = this, icon = this.options.icons.submenu, submenus = this.element.find( this.options.menus ); this.element.toggleClass( "ui-menu-icons", !!this.element.find( ".ui-icon" ).length ); // Initialize nested menus submenus.filter( ":not(.ui-menu)" ) .addClass( "ui-menu ui-widget ui-widget-content ui-front" ) .hide() .attr({ role: this.options.role, "aria-hidden": "true", "aria-expanded": "false" }) .each(function() { var menu = $( this ), item = menu.parent(), submenuCarat = $( "<span>" ) .addClass( "ui-menu-icon ui-icon " + icon ) .data( "ui-menu-submenu-carat", true ); item .attr( "aria-haspopup", "true" ) .prepend( submenuCarat ); menu.attr( "aria-labelledby", item.attr( "id" ) ); }); menus = submenus.add( this.element ); items = menus.find( this.options.items ); // Initialize menu-items containing spaces and/or dashes only as dividers items.not( ".ui-menu-item" ).each(function() { var item = $( this ); if ( that._isDivider( item ) ) { item.addClass( "ui-widget-content ui-menu-divider" ); } }); // Don't refresh list items that are already adapted items.not( ".ui-menu-item, .ui-menu-divider" ) .addClass( "ui-menu-item" ) .uniqueId() .attr({ tabIndex: -1, role: this._itemRole() }); // Add aria-disabled attribute to any disabled menu item items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); // If the active item has been removed, blur the menu if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { this.blur(); } }, _itemRole: function() { return { menu: "menuitem", listbox: "option" }[ this.options.role ]; }, _setOption: function( key, value ) { if ( key === "icons" ) { this.element.find( ".ui-menu-icon" ) .removeClass( this.options.icons.submenu ) .addClass( value.submenu ); } if ( key === "disabled" ) { this.element .toggleClass( "ui-state-disabled", !!value ) .attr( "aria-disabled", value ); } this._super( key, value ); }, focus: function( event, item ) { var nested, focused; this.blur( event, event && event.type === "focus" ); this._scrollIntoView( item ); this.active = item.first(); focused = this.active.addClass( "ui-state-focus" ).removeClass( "ui-state-active" ); // Only update aria-activedescendant if there's a role // otherwise we assume focus is managed elsewhere if ( this.options.role ) { this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); } // Highlight active parent menu item, if any this.active .parent() .closest( ".ui-menu-item" ) .addClass( "ui-state-active" ); if ( event && event.type === "keydown" ) { this._close(); } else { this.timer = this._delay(function() { this._close(); }, this.delay ); } nested = item.children( ".ui-menu" ); if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) { this._startOpening(nested); } this.activeMenu = item.parent(); this._trigger( "focus", event, { item: item } ); }, _scrollIntoView: function( item ) { var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; if ( this._hasScroll() ) { borderTop = parseFloat( $.css( this.activeMenu[0], "borderTopWidth" ) ) || 0; paddingTop = parseFloat( $.css( this.activeMenu[0], "paddingTop" ) ) || 0; offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; scroll = this.activeMenu.scrollTop(); elementHeight = this.activeMenu.height(); itemHeight = item.outerHeight(); if ( offset < 0 ) { this.activeMenu.scrollTop( scroll + offset ); } else if ( offset + itemHeight > elementHeight ) { this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); } } }, blur: function( event, fromFocus ) { if ( !fromFocus ) { clearTimeout( this.timer ); } if ( !this.active ) { return; } this.active.removeClass( "ui-state-focus" ); this.active = null; this._trigger( "blur", event, { item: this.active } ); }, _startOpening: function( submenu ) { clearTimeout( this.timer ); // Don't open if already open fixes a Firefox bug that caused a .5 pixel // shift in the submenu position when mousing over the carat icon if ( submenu.attr( "aria-hidden" ) !== "true" ) { return; } this.timer = this._delay(function() { this._close(); this._open( submenu ); }, this.delay ); }, _open: function( submenu ) { var position = $.extend({ of: this.active }, this.options.position ); clearTimeout( this.timer ); this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) .hide() .attr( "aria-hidden", "true" ); submenu .show() .removeAttr( "aria-hidden" ) .attr( "aria-expanded", "true" ) .position( position ); }, collapseAll: function( event, all ) { clearTimeout( this.timer ); this.timer = this._delay(function() { // If we were passed an event, look for the submenu that contains the event var currentMenu = all ? this.element : $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); // If we found no valid submenu ancestor, use the main menu to close all sub menus anyway if ( !currentMenu.length ) { currentMenu = this.element; } this._close( currentMenu ); this.blur( event ); this.activeMenu = currentMenu; }, this.delay ); }, // With no arguments, closes the currently active menu - if nothing is active // it closes all menus. If passed an argument, it will search for menus BELOW _close: function( startMenu ) { if ( !startMenu ) { startMenu = this.active ? this.active.parent() : this.element; } startMenu .find( ".ui-menu" ) .hide() .attr( "aria-hidden", "true" ) .attr( "aria-expanded", "false" ) .end() .find( ".ui-state-active" ).not( ".ui-state-focus" ) .removeClass( "ui-state-active" ); }, _closeOnDocumentClick: function( event ) { return !$( event.target ).closest( ".ui-menu" ).length; }, _isDivider: function( item ) { // Match hyphen, em dash, en dash return !/[^\-\u2014\u2013\s]/.test( item.text() ); }, collapse: function( event ) { var newItem = this.active && this.active.parent().closest( ".ui-menu-item", this.element ); if ( newItem && newItem.length ) { this._close(); this.focus( event, newItem ); } }, expand: function( event ) { var newItem = this.active && this.active .children( ".ui-menu " ) .find( this.options.items ) .first(); if ( newItem && newItem.length ) { this._open( newItem.parent() ); // Delay so Firefox will not hide activedescendant change in expanding submenu from AT this._delay(function() { this.focus( event, newItem ); }); } }, next: function( event ) { this._move( "next", "first", event ); }, previous: function( event ) { this._move( "prev", "last", event ); }, isFirstItem: function() { return this.active && !this.active.prevAll( ".ui-menu-item" ).length; }, isLastItem: function() { return this.active && !this.active.nextAll( ".ui-menu-item" ).length; }, _move: function( direction, filter, event ) { var next; if ( this.active ) { if ( direction === "first" || direction === "last" ) { next = this.active [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) .eq( -1 ); } else { next = this.active [ direction + "All" ]( ".ui-menu-item" ) .eq( 0 ); } } if ( !next || !next.length || !this.active ) { next = this.activeMenu.find( this.options.items )[ filter ](); } this.focus( event, next ); }, nextPage: function( event ) { var item, base, height; if ( !this.active ) { this.next( event ); return; } if ( this.isLastItem() ) { return; } if ( this._hasScroll() ) { base = this.active.offset().top; height = this.element.height(); this.active.nextAll( ".ui-menu-item" ).each(function() { item = $( this ); return item.offset().top - base - height < 0; }); this.focus( event, item ); } else { this.focus( event, this.activeMenu.find( this.options.items ) [ !this.active ? "first" : "last" ]() ); } }, previousPage: function( event ) { var item, base, height; if ( !this.active ) { this.next( event ); return; } if ( this.isFirstItem() ) { return; } if ( this._hasScroll() ) { base = this.active.offset().top; height = this.element.height(); this.active.prevAll( ".ui-menu-item" ).each(function() { item = $( this ); return item.offset().top - base + height > 0; }); this.focus( event, item ); } else { this.focus( event, this.activeMenu.find( this.options.items ).first() ); } }, _hasScroll: function() { return this.element.outerHeight() < this.element.prop( "scrollHeight" ); }, select: function( event ) { // TODO: It should never be possible to not have an active item at this // point, but the tests don't trigger mouseenter before click. this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); var ui = { item: this.active }; if ( !this.active.has( ".ui-menu" ).length ) { this.collapseAll( event, true ); } this._trigger( "select", event, ui ); }, _filterMenuItems: function(character) { var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ), regex = new RegExp( "^" + escapedCharacter, "i" ); return this.activeMenu .find( this.options.items ) // Only match on items, not dividers or other content (#10571) .filter( ".ui-menu-item" ) .filter(function() { return regex.test( $.trim( $( this ).text() ) ); }); } }); /*! * jQuery UI Selectmenu 1.11.4 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/selectmenu */ var selectmenu = $.widget( "ui.selectmenu", { version: "1.11.4", defaultElement: "<select>", options: { appendTo: null, disabled: null, icons: { button: "ui-icon-triangle-1-s" }, position: { my: "left top", at: "left bottom", collision: "none" }, width: null, // callbacks change: null, close: null, focus: null, open: null, select: null }, _create: function() { var selectmenuId = this.element.uniqueId().attr( "id" ); this.ids = { element: selectmenuId, button: selectmenuId + "-button", menu: selectmenuId + "-menu" }; this._drawButton(); this._drawMenu(); if ( this.options.disabled ) { this.disable(); } }, _drawButton: function() { var that = this; // Associate existing label with the new button this.label = $( "label[for='" + this.ids.element + "']" ).attr( "for", this.ids.button ); this._on( this.label, { click: function( event ) { this.button.focus(); event.preventDefault(); } }); // Hide original select element this.element.hide(); // Create button this.button = $( "<span>", { "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all", tabindex: this.options.disabled ? -1 : 0, id: this.ids.button, role: "combobox", "aria-expanded": "false", "aria-autocomplete": "list", "aria-owns": this.ids.menu, "aria-haspopup": "true" }) .insertAfter( this.element ); $( "<span>", { "class": "ui-icon " + this.options.icons.button }) .prependTo( this.button ); this.buttonText = $( "<span>", { "class": "ui-selectmenu-text" }) .appendTo( this.button ); this._setText( this.buttonText, this.element.find( "option:selected" ).text() ); this._resizeButton(); this._on( this.button, this._buttonEvents ); this.button.one( "focusin", function() { // Delay rendering the menu items until the button receives focus. // The menu may have already been rendered via a programmatic open. if ( !that.menuItems ) { that._refreshMenu(); } }); this._hoverable( this.button ); this._focusable( this.button ); }, _drawMenu: function() { var that = this; // Create menu this.menu = $( "<ul>", { "aria-hidden": "true", "aria-labelledby": this.ids.button, id: this.ids.menu }); // Wrap menu this.menuWrap = $( "<div>", { "class": "ui-selectmenu-menu ui-front" }) .append( this.menu ) .appendTo( this._appendTo() ); // Initialize menu widget this.menuInstance = this.menu .menu({ role: "listbox", select: function( event, ui ) { event.preventDefault(); // support: IE8 // If the item was selected via a click, the text selection // will be destroyed in IE that._setSelection(); that._select( ui.item.data( "ui-selectmenu-item" ), event ); }, focus: function( event, ui ) { var item = ui.item.data( "ui-selectmenu-item" ); // Prevent inital focus from firing and check if its a newly focused item if ( that.focusIndex != null && item.index !== that.focusIndex ) { that._trigger( "focus", event, { item: item } ); if ( !that.isOpen ) { that._select( item, event ); } } that.focusIndex = item.index; that.button.attr( "aria-activedescendant", that.menuItems.eq( item.index ).attr( "id" ) ); } }) .menu( "instance" ); // Adjust menu styles to dropdown this.menu .addClass( "ui-corner-bottom" ) .removeClass( "ui-corner-all" ); // Don't close the menu on mouseleave this.menuInstance._off( this.menu, "mouseleave" ); // Cancel the menu's collapseAll on document click this.menuInstance._closeOnDocumentClick = function() { return false; }; // Selects often contain empty items, but never contain dividers this.menuInstance._isDivider = function() { return false; }; }, refresh: function() { this._refreshMenu(); this._setText( this.buttonText, this._getSelectedItem().text() ); if ( !this.options.width ) { this._resizeButton(); } }, _refreshMenu: function() { this.menu.empty(); var item, options = this.element.find( "option" ); if ( !options.length ) { return; } this._parseOptions( options ); this._renderMenu( this.menu, this.items ); this.menuInstance.refresh(); this.menuItems = this.menu.find( "li" ).not( ".ui-selectmenu-optgroup" ); item = this._getSelectedItem(); // Update the menu to have the correct item focused this.menuInstance.focus( null, item ); this._setAria( item.data( "ui-selectmenu-item" ) ); // Set disabled state this._setOption( "disabled", this.element.prop( "disabled" ) ); }, open: function( event ) { if ( this.options.disabled ) { return; } // If this is the first time the menu is being opened, render the items if ( !this.menuItems ) { this._refreshMenu(); } else { // Menu clears focus on close, reset focus to selected item this.menu.find( ".ui-state-focus" ).removeClass( "ui-state-focus" ); this.menuInstance.focus( null, this._getSelectedItem() ); } this.isOpen = true; this._toggleAttr(); this._resizeMenu(); this._position(); this._on( this.document, this._documentClick ); this._trigger( "open", event ); }, _position: function() { this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) ); }, close: function( event ) { if ( !this.isOpen ) { return; } this.isOpen = false; this._toggleAttr(); this.range = null; this._off( this.document ); this._trigger( "close", event ); }, widget: function() { return this.button; }, menuWidget: function() { return this.menu; }, _renderMenu: function( ul, items ) { var that = this, currentOptgroup = ""; $.each( items, function( index, item ) { if ( item.optgroup !== currentOptgroup ) { $( "<li>", { "class": "ui-selectmenu-optgroup ui-menu-divider" + ( item.element.parent( "optgroup" ).prop( "disabled" ) ? " ui-state-disabled" : "" ), text: item.optgroup }) .appendTo( ul ); currentOptgroup = item.optgroup; } that._renderItemData( ul, item ); }); }, _renderItemData: function( ul, item ) { return this._renderItem( ul, item ).data( "ui-selectmenu-item", item ); }, _renderItem: function( ul, item ) { var li = $( "<li>" ); if ( item.disabled ) { li.addClass( "ui-state-disabled" ); } this._setText( li, item.label ); return li.appendTo( ul ); }, _setText: function( element, value ) { if ( value ) { element.text( value ); } else { element.html( "&#160;" ); } }, _move: function( direction, event ) { var item, next, filter = ".ui-menu-item"; if ( this.isOpen ) { item = this.menuItems.eq( this.focusIndex ); } else { item = this.menuItems.eq( this.element[ 0 ].selectedIndex ); filter += ":not(.ui-state-disabled)"; } if ( direction === "first" || direction === "last" ) { next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 ); } else { next = item[ direction + "All" ]( filter ).eq( 0 ); } if ( next.length ) { this.menuInstance.focus( event, next ); } }, _getSelectedItem: function() { return this.menuItems.eq( this.element[ 0 ].selectedIndex ); }, _toggle: function( event ) { this[ this.isOpen ? "close" : "open" ]( event ); }, _setSelection: function() { var selection; if ( !this.range ) { return; } if ( window.getSelection ) { selection = window.getSelection(); selection.removeAllRanges(); selection.addRange( this.range ); // support: IE8 } else { this.range.select(); } // support: IE // Setting the text selection kills the button focus in IE, but // restoring the focus doesn't kill the selection. this.button.focus(); }, _documentClick: { mousedown: function( event ) { if ( !this.isOpen ) { return; } if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + this.ids.button ).length ) { this.close( event ); } } }, _buttonEvents: { // Prevent text selection from being reset when interacting with the selectmenu (#10144) mousedown: function() { var selection; if ( window.getSelection ) { selection = window.getSelection(); if ( selection.rangeCount ) { this.range = selection.getRangeAt( 0 ); } // support: IE8 } else { this.range = document.selection.createRange(); } }, click: function( event ) { this._setSelection(); this._toggle( event ); }, keydown: function( event ) { var preventDefault = true; switch ( event.keyCode ) { case $.ui.keyCode.TAB: case $.ui.keyCode.ESCAPE: this.close( event ); preventDefault = false; break; case $.ui.keyCode.ENTER: if ( this.isOpen ) { this._selectFocusedItem( event ); } break; case $.ui.keyCode.UP: if ( event.altKey ) { this._toggle( event ); } else { this._move( "prev", event ); } break; case $.ui.keyCode.DOWN: if ( event.altKey ) { this._toggle( event ); } else { this._move( "next", event ); } break; case $.ui.keyCode.SPACE: if ( this.isOpen ) { this._selectFocusedItem( event ); } else { this._toggle( event ); } break; case $.ui.keyCode.LEFT: this._move( "prev", event ); break; case $.ui.keyCode.RIGHT: this._move( "next", event ); break; case $.ui.keyCode.HOME: case $.ui.keyCode.PAGE_UP: this._move( "first", event ); break; case $.ui.keyCode.END: case $.ui.keyCode.PAGE_DOWN: this._move( "last", event ); break; default: this.menu.trigger( event ); preventDefault = false; } if ( preventDefault ) { event.preventDefault(); } } }, _selectFocusedItem: function( event ) { var item = this.menuItems.eq( this.focusIndex ); if ( !item.hasClass( "ui-state-disabled" ) ) { this._select( item.data( "ui-selectmenu-item" ), event ); } }, _select: function( item, event ) { var oldIndex = this.element[ 0 ].selectedIndex; // Change native select element this.element[ 0 ].selectedIndex = item.index; this._setText( this.buttonText, item.label ); this._setAria( item ); this._trigger( "select", event, { item: item } ); if ( item.index !== oldIndex ) { this._trigger( "change", event, { item: item } ); } this.close( event ); }, _setAria: function( item ) { var id = this.menuItems.eq( item.index ).attr( "id" ); this.button.attr({ "aria-labelledby": id, "aria-activedescendant": id }); this.menu.attr( "aria-activedescendant", id ); }, _setOption: function( key, value ) { if ( key === "icons" ) { this.button.find( "span.ui-icon" ) .removeClass( this.options.icons.button ) .addClass( value.button ); } this._super( key, value ); if ( key === "appendTo" ) { this.menuWrap.appendTo( this._appendTo() ); } if ( key === "disabled" ) { this.menuInstance.option( "disabled", value ); this.button .toggleClass( "ui-state-disabled", value ) .attr( "aria-disabled", value ); this.element.prop( "disabled", value ); if ( value ) { this.button.attr( "tabindex", -1 ); this.close(); } else { this.button.attr( "tabindex", 0 ); } } if ( key === "width" ) { this._resizeButton(); } }, _appendTo: function() { var element = this.options.appendTo; if ( element ) { element = element.jquery || element.nodeType ? $( element ) : this.document.find( element ).eq( 0 ); } if ( !element || !element[ 0 ] ) { element = this.element.closest( ".ui-front" ); } if ( !element.length ) { element = this.document[ 0 ].body; } return element; }, _toggleAttr: function() { this.button .toggleClass( "ui-corner-top", this.isOpen ) .toggleClass( "ui-corner-all", !this.isOpen ) .attr( "aria-expanded", this.isOpen ); this.menuWrap.toggleClass( "ui-selectmenu-open", this.isOpen ); this.menu.attr( "aria-hidden", !this.isOpen ); }, _resizeButton: function() { var width = this.options.width; if ( !width ) { width = this.element.show().outerWidth(); this.element.hide(); } this.button.outerWidth( width ); }, _resizeMenu: function() { this.menu.outerWidth( Math.max( this.button.outerWidth(), // support: IE10 // IE10 wraps long text (possibly a rounding bug) // so we add 1px to avoid the wrapping this.menu.width( "" ).outerWidth() + 1 ) ); }, _getCreateOptions: function() { return { disabled: this.element.prop( "disabled" ) }; }, _parseOptions: function( options ) { var data = []; options.each(function( index, item ) { var option = $( item ), optgroup = option.parent( "optgroup" ); data.push({ element: option, index: index, value: option.val(), label: option.text(), optgroup: optgroup.attr( "label" ) || "", disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" ) }); }); this.items = data; }, _destroy: function() { this.menuWrap.remove(); this.button.remove(); this.element.show(); this.element.removeUniqueId(); this.label.attr( "for", this.ids.element ); } }); })); /* Custom build of Modernizr Only container HTML video test */ /* Modernizr 2.8.3 (Custom Build) | MIT & BSD * Build: http://modernizr.com/download/#-video-shiv-cssclasses-load */ ;window.Modernizr=function(a,b,c){function u(a){j.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}var d="2.8.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e}),m.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c};for(var z in m)t(m,z)&&(r=z.toLowerCase(),e[r]=m[z](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)t(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},u(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+p.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))}; /*! Picturefill - v2.3.1 - 2015-04-09 * http://scottjehl.github.io/picturefill * Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT */ window.matchMedia||(window.matchMedia=function(){"use strict";var a=window.styleMedia||window.media;if(!a){var b=document.createElement("style"),c=document.getElementsByTagName("script")[0],d=null;b.type="text/css",b.id="matchmediajs-test",c.parentNode.insertBefore(b,c),d="getComputedStyle"in window&&window.getComputedStyle(b,null)||b.currentStyle,a={matchMedium:function(a){var c="@media "+a+"{ #matchmediajs-test { width: 1px; } }";return b.styleSheet?b.styleSheet.cssText=c:b.textContent=c,"1px"===d.width}}}return function(b){return{matches:a.matchMedium(b||"all"),media:b||"all"}}}()),function(a,b,c){"use strict";function d(b){"object"==typeof module&&"object"==typeof module.exports?module.exports=b:"function"==typeof define&&define.amd&&define("picturefill",function(){return b}),"object"==typeof a&&(a.picturefill=b)}function e(a){var b,c,d,e,f,i=a||{};b=i.elements||g.getAllElements();for(var j=0,k=b.length;k>j;j++)if(c=b[j],d=c.parentNode,e=void 0,f=void 0,"IMG"===c.nodeName.toUpperCase()&&(c[g.ns]||(c[g.ns]={}),i.reevaluate||!c[g.ns].evaluated)){if(d&&"PICTURE"===d.nodeName.toUpperCase()){if(g.removeVideoShim(d),e=g.getMatch(c,d),e===!1)continue}else e=void 0;(d&&"PICTURE"===d.nodeName.toUpperCase()||!g.sizesSupported&&c.srcset&&h.test(c.srcset))&&g.dodgeSrcset(c),e?(f=g.processSourceSet(e),g.applyBestCandidate(f,c)):(f=g.processSourceSet(c),(void 0===c.srcset||c[g.ns].srcset)&&g.applyBestCandidate(f,c)),c[g.ns].evaluated=!0}}function f(){function c(){clearTimeout(d),d=setTimeout(h,60)}g.initTypeDetects(),e();var d,f=setInterval(function(){return e(),/^loaded|^i|^c/.test(b.readyState)?void clearInterval(f):void 0},250),h=function(){e({reevaluate:!0})};a.addEventListener?a.addEventListener("resize",c,!1):a.attachEvent&&a.attachEvent("onresize",c)}if(a.HTMLPictureElement)return void d(function(){});b.createElement("picture");var g=a.picturefill||{},h=/\s+\+?\d+(e\d+)?w/;g.ns="picturefill",function(){g.srcsetSupported="srcset"in c,g.sizesSupported="sizes"in c,g.curSrcSupported="currentSrc"in c}(),g.trim=function(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")},g.makeUrl=function(){var a=b.createElement("a");return function(b){return a.href=b,a.href}}(),g.restrictsMixedContent=function(){return"https:"===a.location.protocol},g.matchesMedia=function(b){return a.matchMedia&&a.matchMedia(b).matches},g.getDpr=function(){return a.devicePixelRatio||1},g.getWidthFromLength=function(a){var c;if(!a||a.indexOf("%")>-1!=!1||!(parseFloat(a)>0||a.indexOf("calc(")>-1))return!1;a=a.replace("vw","%"),g.lengthEl||(g.lengthEl=b.createElement("div"),g.lengthEl.style.cssText="border:0;display:block;font-size:1em;left:0;margin:0;padding:0;position:absolute;visibility:hidden",g.lengthEl.className="helper-from-picturefill-js"),g.lengthEl.style.width="0px";try{g.lengthEl.style.width=a}catch(d){}return b.body.appendChild(g.lengthEl),c=g.lengthEl.offsetWidth,0>=c&&(c=!1),b.body.removeChild(g.lengthEl),c},g.detectTypeSupport=function(b,c){var d=new a.Image;return d.onerror=function(){g.types[b]=!1,e()},d.onload=function(){g.types[b]=1===d.width,e()},d.src=c,"pending"},g.types=g.types||{},g.initTypeDetects=function(){g.types["image/jpeg"]=!0,g.types["image/gif"]=!0,g.types["image/png"]=!0,g.types["image/svg+xml"]=b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"),g.types["image/webp"]=g.detectTypeSupport("image/webp","data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=")},g.verifyTypeSupport=function(a){var b=a.getAttribute("type");if(null===b||""===b)return!0;var c=g.types[b];return"string"==typeof c&&"pending"!==c?(g.types[b]=g.detectTypeSupport(b,c),"pending"):"function"==typeof c?(c(),"pending"):c},g.parseSize=function(a){var b=/(\([^)]+\))?\s*(.+)/g.exec(a);return{media:b&&b[1],length:b&&b[2]}},g.findWidthFromSourceSize=function(c){for(var d,e=g.trim(c).split(/\s*,\s*/),f=0,h=e.length;h>f;f++){var i=e[f],j=g.parseSize(i),k=j.length,l=j.media;if(k&&(!l||g.matchesMedia(l))&&(d=g.getWidthFromLength(k)))break}return d||Math.max(a.innerWidth||0,b.documentElement.clientWidth)},g.parseSrcset=function(a){for(var b=[];""!==a;){a=a.replace(/^\s+/g,"");var c,d=a.search(/\s/g),e=null;if(-1!==d){c=a.slice(0,d);var f=c.slice(-1);if((","===f||""===c)&&(c=c.replace(/,+$/,""),e=""),a=a.slice(d+1),null===e){var g=a.indexOf(",");-1!==g?(e=a.slice(0,g),a=a.slice(g+1)):(e=a,a="")}}else c=a,a="";(c||e)&&b.push({url:c,descriptor:e})}return b},g.parseDescriptor=function(a,b){var c,d=b||"100vw",e=a&&a.replace(/(^\s+|\s+$)/g,""),f=g.findWidthFromSourceSize(d);if(e)for(var h=e.split(" "),i=h.length-1;i>=0;i--){var j=h[i],k=j&&j.slice(j.length-1);if("h"!==k&&"w"!==k||g.sizesSupported){if("x"===k){var l=j&&parseFloat(j,10);c=l&&!isNaN(l)?l:1}}else c=parseFloat(parseInt(j,10)/f)}return c||1},g.getCandidatesFromSourceSet=function(a,b){for(var c=g.parseSrcset(a),d=[],e=0,f=c.length;f>e;e++){var h=c[e];d.push({url:h.url,resolution:g.parseDescriptor(h.descriptor,b)})}return d},g.dodgeSrcset=function(a){a.srcset&&(a[g.ns].srcset=a.srcset,a.srcset="",a.setAttribute("data-pfsrcset",a[g.ns].srcset))},g.processSourceSet=function(a){var b=a.getAttribute("srcset"),c=a.getAttribute("sizes"),d=[];return"IMG"===a.nodeName.toUpperCase()&&a[g.ns]&&a[g.ns].srcset&&(b=a[g.ns].srcset),b&&(d=g.getCandidatesFromSourceSet(b,c)),d},g.backfaceVisibilityFix=function(a){var b=a.style||{},c="webkitBackfaceVisibility"in b,d=b.zoom;c&&(b.zoom=".999",c=a.offsetWidth,b.zoom=d)},g.setIntrinsicSize=function(){var c={},d=function(a,b,c){b&&a.setAttribute("width",parseInt(b/c,10))};return function(e,f){var h;e[g.ns]&&!a.pfStopIntrinsicSize&&(void 0===e[g.ns].dims&&(e[g.ns].dims=e.getAttribute("width")||e.getAttribute("height")),e[g.ns].dims||(f.url in c?d(e,c[f.url],f.resolution):(h=b.createElement("img"),h.onload=function(){if(c[f.url]=h.width,!c[f.url])try{b.body.appendChild(h),c[f.url]=h.width||h.offsetWidth,b.body.removeChild(h)}catch(a){}e.src===f.url&&d(e,c[f.url],f.resolution),e=null,h.onload=null,h=null},h.src=f.url)))}}(),g.applyBestCandidate=function(a,b){var c,d,e;a.sort(g.ascendingSort),d=a.length,e=a[d-1];for(var f=0;d>f;f++)if(c=a[f],c.resolution>=g.getDpr()){e=c;break}e&&(e.url=g.makeUrl(e.url),b.src!==e.url&&(g.restrictsMixedContent()&&"http:"===e.url.substr(0,"http:".length).toLowerCase()?void 0!==window.console&&console.warn("Blocked mixed content image "+e.url):(b.src=e.url,g.curSrcSupported||(b.currentSrc=b.src),g.backfaceVisibilityFix(b))),g.setIntrinsicSize(b,e))},g.ascendingSort=function(a,b){return a.resolution-b.resolution},g.removeVideoShim=function(a){var b=a.getElementsByTagName("video");if(b.length){for(var c=b[0],d=c.getElementsByTagName("source");d.length;)a.insertBefore(d[0],c);c.parentNode.removeChild(c)}},g.getAllElements=function(){for(var a=[],c=b.getElementsByTagName("img"),d=0,e=c.length;e>d;d++){var f=c[d];("PICTURE"===f.parentNode.nodeName.toUpperCase()||null!==f.getAttribute("srcset")||f[g.ns]&&null!==f[g.ns].srcset)&&a.push(f)}return a},g.getMatch=function(a,b){for(var c,d=b.childNodes,e=0,f=d.length;f>e;e++){var h=d[e];if(1===h.nodeType){if(h===a)return c;if("SOURCE"===h.nodeName.toUpperCase()){null!==h.getAttribute("src")&&void 0!==typeof console&&console.warn("The `src` attribute is invalid on `picture` `source` element; instead, use `srcset`.");var i=h.getAttribute("media");if(h.getAttribute("srcset")&&(!i||g.matchesMedia(i))){var j=g.verifyTypeSupport(h);if(j===!0){c=h;break}if("pending"===j)return!1}}}}return c},f(),e._=g,d(e)}(window,window.document,new window.Image); /*! * context.js Library associated with > v0.9.6.2 of intention.js * http://intentionjs.com/ * * Copyright 2011, 2013 Dowjones and other contributors * Released under the MIT license * */ /** * Shipped context.js from intention.js with modifications to horizontal_axis to enable breakpoints equal to bootstrap's */ (function () { 'use strict'; var context = function ($, Intention) { // create a brand spankin new intention object var intent = new Intention(), // placeholder for the horizontal axis horizontal_axis, orientation_axis; // throttle funtion used for keeping calls to the resize responive // callback to a minimum function throttle(callback, interval) { var lastExec = new Date(), timer = null; return function (e) { var d = new Date(); if (d - lastExec < interval) { if (timer) { window.clearTimeout(timer); } var callbackWrapper = function (event) { return function () { callback(event); }; }; timer = window.setTimeout(callbackWrapper(e), interval); return false; } callback(e); lastExec = d; }; } // catchall intent.responsive([{name: 'base'}]).respond('base'); // width context? horizontal_axis = intent.responsive({ ID: 'width', contexts: [ {name: 'xs', max: 767}, {name: 'sm', min: 768, max: 991}, {name: 'md', min: 992, max: 1439}, {name: 'lg', min: 1440} ], // compare the return value of the callback to each context // return true for a match matcher: function (test, context) { if (typeof test === 'string') { return test === context.name; } if (context.min) { if (context.max) { return (test >= context.min && test <= context.max); } else { return test >= context.min; } } else if (context.max) { return test <= context.max; } return false; }, // callback, return value is passed to matcher() // to compare against current context measure: function (arg) { if (typeof arg === 'string') { return arg; } return $(window).width(); } }); // orientation context? orientation_axis = intent.responsive({ ID: 'orientation', contexts: [{name: 'portrait', rotation: 0}, {name: 'landscape', rotation: 90}], matcher: function (measure, ctx) { return measure === ctx.rotation; }, measure: function () { var test = Math.abs(window.orientation); if (test > 0) { test = 180 - test; } return test; } }); // ONE TIME CHECK AXES: // touch device? intent.responsive({ ID: 'touch', contexts: [{name: 'touch'}], matcher: function () { return "ontouchstart" in window; } }).respond(); // retina display? intent.responsive({ ID: 'highres', // contexts contexts: [{name: 'highres'}], // matching: matcher: function () { return window.devicePixelRatio > 1; } }).respond(); // bind events to the window $(window).on('resize', throttle(horizontal_axis.respond, 100)) .on('orientationchange', horizontal_axis.respond) .on('orientationchange', orientation_axis.respond); // register the current width and orientation without waiting for a window // resize horizontal_axis.respond(); orientation_axis.respond(); $(function () { // at doc ready grab all of the elements in the doc intent.elements(document); }); // return the intention object so that it can be extended by other plugins return intent; }; (function (root, factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define('context', ['jquery', '../../bower_components/intentionjs/intention'], factory); } else { // Browser globals root.intent = factory(root.jQuery, root.Intention); } }(this, function ($, Intention) { return context($, Intention); })); }).call(this); (function(exports, $) { var Hippo = {}; var defaultOptions = { url: 'https://feed-aggregator.sydney.edu.au/json.php', limit: 20, // Max number of stories to retrieve. Supercedes any larger per-feed limits merged: true, // Return a merged feed of stories, or maintain grouping by feed timeout: 15, feeds: { // Feeds can be configured like this: // feedName: { Client-side identifier for the feed responses // key: 'xxxxxxxxxxxxxxx', ID of the feed to retrieve // limit: 10, Optional max number of stories to retrieve from this feed // range: { Optional range of dates to retrieve stories for (before/after are optional) // before: new Date(), Date to retrieve stories before // after: new Date() Date to retrieve stories after // } // } } }; Hippo.get = function(opts) { var def = $.Deferred(); opts = $.extend(true, {}, defaultOptions, opts); $.ajax({ dataType: 'jsonp', url: opts.url, data: { merged: opts.merged, limit: opts.limit, feeds: opts.feeds }, cache: false, timeout: opts.timeout * 1000 }).done(function(data) { def.resolve(data); }).fail(function() { def.reject.apply(def, Array.prototype.slice.apply(arguments)); }); return def.promise(); }; $.fn.hippo = function() { var $els = $(this); $els.each(function() { var $el = $(this), data = $el.data(), opts = { merged: true, feeds: {} }, dataKey, feedName; if(data.feedLimit) { opts.limit = data.feedLimit; delete data.feedLimit; } for(dataKey in data) { if(data.hasOwnProperty(dataKey) && dataKey !== "feed" && dataKey.indexOf("feed") === 0) { feedName = dataKey.substring(4, 5).toLowerCase() + dataKey.substring(5); opts.feeds[feedName] = { key: data[dataKey] }; } } if(opts.feeds.length == 0) { // This should NEVER happen $el.trigger("hippo:error", [ 'config' ]); return; } function loadFeed() { var loadingEvent = new $.Event("hippo:loading"); $el.trigger(loadingEvent); if(!loadingEvent.isDefaultPrevented()) { Hippo.get(opts).done(function(data) { $el.trigger("hippo:data", [ data ]); }).fail(function() { $el.trigger("hippo:error", [ 'request' ].push(Array.prototype.slice.apply(arguments))) }); } } // Listen for requests to load $el.on("hippo:load", function() { loadFeed(); }); loadFeed(); }); }; $(function() { $('*[data-feed]').hippo(); }); exports.Hippo = Hippo; })(window, jQuery); (function(exports, $) { var defaultOpts = { append: true }; function remove() { $(this).find('.spinner').remove(); } function add(opts) { var i, $el = $(this), $spinnerEl = $el; opts = $.extend(true, {}, defaultOpts, opts); if(opts.append) { $spinnerEl = $('<div class="spinner"></div>'); } for(i = 0; i < 5; i++) { $spinnerEl.append('<div class="rect' + i + '"></div>'); } if(opts.append) { $el.append($spinnerEl); } } $.fn.spinner = function(opts) { if(opts === false) { $(this).each(remove); } else { $(this).each(function() { add.call(this, opts); }); } }; $(function() { $('.spinner').spinner({ append: false }); }); })(window, jQuery); (function (_this, $) { _this.initialise = function () { $(function () { initialiseSelectLists(); initialiseDatePickers(); }); return _this; } //FIXME: Using the 'select' element makes the code hard to maintain //DROPDOWN event names are defined in var initialiseSelectLists = function() { var selects = $('select').not('.b-dropdown__select').selectmenu( { 'appendTo' : $('select').parent(), blur: function(e, data){ $('select').trigger("DROPDOWN_BLUR", data) }, focus: function(e, data){ $('select').trigger("DROPDOWN_FOCUS", data) }, select: function(e, data){ $('select').trigger("DROPDOWN_SELECT", data) } } ); var resize = function() { $('select').not('.b-dropdown__select').selectmenu('refresh').each(function(i, select){ var selectContainer = $(select).parents('.b-input-group').first(); // If the select is inside an input group... if (selectContainer.length > 0) { setTimeout(function () { // ..set the width of the select's inner text (the "button") to the width of the parent // input-group container, minus the width of the border (because jQ's width functions don't take // the border into account) var selectButton = selectContainer.find('.ui-selectmenu-button'); var buttonWidth = selectContainer.innerWidth() - (parseInt(selectContainer.find('.b-input-group__wrapper').css('border-left-width'), 10) * 2); selectButton.outerWidth(buttonWidth); selectContainer.find(".ui-menu").outerWidth(buttonWidth); }, 10); } }); }; // Listen for orientation changes $(window).on('orientationchange', resize, false); $(window).on('resize', resize); //AEM author is able to dropdown option with dialog by calling $(window).trigger('DROPDOWN_UPDATE'); $(window).on('DROPDOWN_UPDATE', resize); }; var initialiseDatePickers = function() { $('.datepicker').each(function() { var minYear = $(this).attr('minYear'); var maxYear = $(this).attr('maxYear'); var yearRange = minYear + ':' + maxYear; $(this).datepicker({ dateFormat: "dd/mm/yy", changeMonth: true, changeYear: true, yearRange: yearRange }); }); } // Initialise & assign to global scope window.USydWidgets = _this.initialise(); })(window.USydWidgets || {}, jQuery); (function (_this, $) { var hamburgerMenuRevealed = false; var checkScrollingInterval = 1000; var lastScrollPosition = -1; var currentScrollPosition = 0; var scrollDelta = 20; var WRAPPER_SELECTOR = ".b-js-stickler-wrapper"; //It is duplicated from /src/stickler/stickler.js var $body = $('body'); function bindHamburgerMenu() { $('.mobileNavigationModule').on('click', function(event) { if ($('.mobileNavigationModule').is(event.target)) { _this.closeHamburgerMenu(); } }); $('.hamburgerIcon').on('click',function(e) { e.preventDefault(); if(_this.isHamburgerMenuRevealed()) { _this.closeHamburgerMenu(); } else { _this.openHamburgerMenu(); } }); } function getWindowSize() { return { width: window.innerWidth || window.document.documentElement.clientWidth || (window.document.body || window.document.getElementsByTagName('body')[0]).clientWidth, height: window.innerHeight || window.document.documentElement.clientHeight || (window.document.body || window.document.getElementsByTagName('body')[0]).clientHeight }; } function getScrollTop(){ if(typeof pageYOffset !== 'undefined'){ //most browsers except IE before #9 return pageYOffset; } else{ var B = document.body; //IE 'quirks' var D = document.documentElement; //IE with doctype D = (D.clientHeight)? D: B; return D.scrollTop; } } function showHeader() { $(WRAPPER_SELECTOR).removeClass('hideMobile'); $body.removeClass('globalHeaderModuleHidden'); } function hideHeader() { $(WRAPPER_SELECTOR).addClass('hideMobile'); $body.addClass('globalHeaderModuleHidden'); } function saveCurrentScrollPosition() { lastScrollPosition = currentScrollPosition; } function bindScrollHandler() { // Debounce scroll events by only checking for them after a certain interval setInterval(function() { currentScrollPosition = getScrollTop(); // console.log("last scroll position: ", lastScrollPosition); // console.log("current scroll position: ", currentScrollPosition); //Return if no scrolling happens if (Math.abs(lastScrollPosition - currentScrollPosition) < scrollDelta) { // console.log("no scrolling happens,skip"); saveCurrentScrollPosition(); return; } // Keep the header visible while the user's near the top of the document and until // the user scrolls down enough so it can be hidden without leaving a huge space if ( $(WRAPPER_SELECTOR).hasClass('hideMobile') && (currentScrollPosition < $(WRAPPER_SELECTOR).outerHeight(true) / 2) ) { showHeader(); } //Handle header state changes when side panel close and on tablet view if(hamburgerMenuRevealed !== true && getWindowSize().width < 992) { if (currentScrollPosition < lastScrollPosition) { showHeader(); // Scrolling up } else { hideHeader(); // Scrolling down } } saveCurrentScrollPosition(); }, checkScrollingInterval); } _this.openHamburgerMenu = function () { $(WRAPPER_SELECTOR).addClass('mobileMenuOpen'); $('.mobileNavigationModule').addClass('revealed'); $('header.mobile a.hamburgerIcon').addClass('open'); hamburgerMenuRevealed = true; }; _this.closeHamburgerMenu = function () { $(WRAPPER_SELECTOR).removeClass('mobileMenuOpen'); $('.mobileNavigationModule').removeClass('revealed'); $('header.mobile a.hamburgerIcon').removeClass('open'); hamburgerMenuRevealed = false; }; _this.isHamburgerMenuRevealed = function () { return hamburgerMenuRevealed; }; /** * waiting for wrapper selector ready * @param {function} cb - execute function after wrapper dom element is ready on the page */ function detectWrapper() { if(!$(WRAPPER_SELECTOR).size()) { window.requestAnimationFrame(detectWrapper); } else { $(function () { bindHamburgerMenu(); bindScrollHandler(); }); } } _this.initialise = function () { //wait for the WRAPPER_SELECTOR dom element ready detectWrapper(); return _this; }; // Initialise & assign to global scope window.MobileNavigationModule = _this.initialise(); })(window.MobileNavigationModule || {}, jQuery); (function (_this, MobileNavigationModule, $) { _this.close = function () { $('.searchDropDown').slideUp(); // Stop listening for focus events since we just needed them to know when to close $('body').off('focusin.searchDropDown'); // Focus on whichever search icon is visible $('.mainNav .searchIcon:visible, header.mobile .searchIcon:visible').each(function() { $(this).focus(); }); }; _this.open = function () { $('.searchDropDown').slideDown(400, function() { $('.searchDropDown .searchInput').focus(); // If the user focuses on an element outside this dropdown then we auto-close it $('body').on('focusin.searchDropDown', function(e) { if(!$.contains($('.searchDropDown')[0], e.target)) { e.preventDefault(); _this.close(); } }); }); if (MobileNavigationModule && MobileNavigationModule.isHamburgerMenuRevealed()) { MobileNavigationModule.closeHamburgerMenu(); } }; _this.initialise = function () { $(function () { $('.mainNav .searchIcon, header.mobile .searchIcon').on('click', function(e) { e.preventDefault(); _this.open(); }); $('.searchDropDown .closeIcon').on('click', function(e) { e.preventDefault(); _this.close(); }); // Listen for any escape keypresses $('.searchDropDown').on('keyup', function(e) { if(e.keyCode == 27) { e.preventDefault(); _this.close(); } }); }); return _this; }; // Initialise & assign to global scope window.SearchDropDown = _this.initialise(); })(window.SearchDropDown || {}, window.MobileNavigationModule, jQuery); (function (exports, $) { function init() { var $el = $(this); var $filterChildrenSelected = $el.find('.filter.current'); var $filterExpander = $el.next('.search-filter-expand'); // Ignore groups without an expander button if($filterExpander.size() > 0) { $el.css('max-height', $el.height()); if($filterChildrenSelected.length == 0){ $el.toggleClass('collapsed'); } else { $filterExpander.toggleClass('collapsed'); } $filterExpander.on('click', function(e) { e.preventDefault(); $('.search-filter-expand').toggleClass('collapsed'); $el.toggleClass('collapsed'); }); } } $.fn.searchFacetFilter = function() { $(this).each(init); }; $(function() { $('.filterGroup').searchFacetFilter(); }); })(window, jQuery); (function (_this, $) { _this.initialise = function () { $(function () { $.each( $('.campus-coordinates'), function( index, value ) { var splittedCoordinates = value.innerText.split(","); _this.getAddress( splittedCoordinates[0], splittedCoordinates[1], value); }); }); return _this; }; _this.getAddress = function(lat, lng, obj){ var geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(lat, lng); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { if(results[0].formatted_address != ''){ obj.innerText = results[0].formatted_address; } } else { console.log('No results found for this lat and lng'); } } else { console.log('Geocoder failed due to: ' + status); } }); }; // Initialise & assign to global scope window.searchFindAddress = _this.initialise(); })(window.searchFindAddress || {}, jQuery); (function (exports, $) { var init; init = function(el) { var $el = $(el); $el.find('.icons a').on('click', function(e) { e.preventDefault(); var currentFeedName = $(this).parent().find('a.active').attr('data-panel'); var targetFeedName = $(this).attr('data-panel'); // Highlight the correct icon $(this).parent().find('a').removeClass('active'); $(this).addClass('active'); // Position the arrow repositionArrow($el); // Display the correct feed var $currentFeed = $el.find('.feeds ' + currentFeedName); var $targetFeed = $el.find('.feeds ' + targetFeedName); $currentFeed.slideUp(400, function() { $targetFeed.slideDown(); }); }); $el.find('*[data-feed]').each(function() { var $el = $(this); $el.data('template', $el.find('.feedItem').remove()); $el.data('errorTemplate', $el.find('.feedError').css("display", "").remove()); $el.on('hippo:loading', function() { $el.empty().spinner(); $el.addClass('loading'); }); }); $el.on('hippo:data', function(event, stories) { var $el = $(event.target), story, template = $el.data('template'); $el.removeClass('loading'); $el.empty(); stories.forEach(function(story) { var storyTemplate = template.clone(); storyTemplate.find(".feedText").html(story.title); storyTemplate.find(".postLink").html($('<a>').attr({href: story.url}).text("See post")); storyTemplate.find(".postedDate").text(moment(story.date).fromNow()); if(storyTemplate.find(".feedImage").length) { if(story.image_url != undefined) { storyTemplate.find(".feedImage").html('<img src="' + story.image_url + '" />'); storyTemplate.find(".feedImage").css('display','block'); } } $el.append(storyTemplate); }); }); $el.on('hippo:error', function(event, type, exception) { var $el = $(event.target), template = $el.data('errorTemplate'), errorTemplate = template.clone(); errorTemplate.find(".errorDetail").text(exception); $el.empty().append(errorTemplate); }); $el.on('click', '.reload', function(event) { event.preventDefault(); $(event.target).trigger('hippo:load'); }); // Reposition arrow on screen resize $(window).on('resize', function() { repositionArrow($el); }); }; function repositionArrow(el) { var $el = $(el); var $activeIcon = $el.find('.icons a.active'); var $arrow = $el.find('.arrowLine .arrow'); if ($arrow.length > 0) { $arrow.css('left', ($activeIcon.position().left - 7) + 'px'); } } $.fn.socialFeed = function() { $(this).each(function() { init($(this)); }); }; $(function() { $('.socialFeedModule').socialFeed(); }); })(window, jQuery); (function (_this, $) { _this.tabAnimationDuration = 400; _this.initialise = function () { $(function () { resizeTabs(); bindTabClicks(); bindTriggerClicks(); }); return _this; } var resizeTabs = function() { $('.tabsModule').each(function() { var maxHeight = 0; $(this).find('.tab').each(function() { var numTabs = $(this).parent('.tabs').children('.tab').length; var width = 100/numTabs; $(this).css('width', width + '%'); if($(this).height() > maxHeight) { maxHeight = $(this).height(); } }); $(this).find('.tab').each(function() { $(this).height(maxHeight); }); }); } var bindTabClicks = function() { $('.tabsModule .tabs .tab a').on('click', function(e) { e.preventDefault(); if( !$(this).parents('.tab').hasClass('open') ) { // Display correct contents var currentlyOpen = '#' + $(this).parents('.tabs').find('.tab.open').attr('data-opens'); var toOpen = '#' + $(this).parents('.tab').attr('data-opens'); $(currentlyOpen).find('.content').slideUp(_this.tabAnimationDuration, function() { $(toOpen).find('.content').slideDown(_this.tabAnimationDuration); }); // Highlight new tab $(this).parents('.tabs').find('.tab').removeClass('open'); $(this).parents('.tab').addClass('open'); // Highlight correct trigger var targetItem = $(this).parents('.tab').attr('data-opens'); $(this).parents('.tabsModule').find('.contentItem').removeClass('open'); $('#' + targetItem).addClass('open'); // Update the aria-selected attributes $(this).parents('.tabs').find('.tab').attr('aria-selected', 'false'); $(this).parents('.tab').attr('aria-selected', 'true'); } }); } var bindTriggerClicks = function() { $('.tabsModule .contentItem .trigger a').on('click', function(e) { e.preventDefault(); if(!$(this).parents('.contentItem').hasClass('open')) { var contentItemID = $(this).parents('.contentItem').attr('id'); // Display correct content $(this).parents('.contentItems').find('.contentItem.open .content').slideUp(); $(this).parents('.contentItem').find('.content').slideDown(); // Highlight new tab $(this).parents('.tabsModule').find('.tab').removeClass('open'); $(this).parents('.tabsModule').find('.tab[data-opens="' + contentItemID + '"]').addClass('open'); // Highlight correct trigger $(this).parents('.contentItems').find('.contentItem').removeClass('open'); $(this).parents('.contentItem').addClass('open'); } }); } // Initialise & assign to global scope window.TabsModule = _this.initialise(); })(window.TabsModule || {}, jQuery); (function (_this, $) { _this.tabAnimationDuration = 400; _this.shownTagsOnMobile = 4; _this.initialise = function () { $(function () { bindSeeMoreButton(); }); return _this; } var bindSeeMoreButton = function() { // Remove the see more button if there are less than 5 tags $('.tagsModule').each(function() { if($(this).find('.tags .tag').length <= _this.shownTagsOnMobile) { $(this).find('.seeMoreButton').remove(); } }); $('.tagsModule .seeMoreButton').on('click', function(e) { e.preventDefault(); var $module = $(this).parents('.tagsModule').eq(0); $module.toggleClass('open'); }) } // Initialise & assign to global scope window.TagsModule = _this.initialise(); })(window.TagsModule || {}, jQuery); (function (exports, $, intent) { "use strict"; function init() { var $el = $(this); // Don't double init if($el.data('timeline')) { return; } function bottom(el) { var $el = $(el); if($el.size() == 0) { return null; } return $el.offset().top + $el.outerHeight(); } function reposition() { var $segments = $el.find('.timelineSegment'), containerTop = $el.find('.timelineSegments').offset().top; // Reset all the offsets and column sides $segments.css('margin-top', '').removeClass('left right'); // On xs everything collapses into a single column so we're done if(intent.is('xs')) { return; } // Go through each timeline event and try to assign it to the left and right column, // depending on which side will allow it to be placed higher. When putting stories in the columns, // try to bring them up so that they align with the adjacent story's summary but make sure to keep // a reasonable distance from the story directly above. $segments.each(function() { var $segment = $(this), $lastLeft = $segments.filter('.left:last'), $lastLeftSummary, leftBottom = bottom($lastLeft), $lastRight = $segments.filter('.right:last'), $lastRightSummary, rightBottom = bottom($lastRight), targetTop, side; // We can pick a side easily if there's nothing in one or the other if($lastLeft.size() == 0) { leftBottom = containerTop; side = "left"; } else if($lastRight.size() == 0) { rightBottom = containerTop; side = "right"; } else { // Both sides have something in them, pick the side which will allow the story to be placed // higher up if(leftBottom > rightBottom) { side = "right"; } else { side = "left"; } } if(side == "left") { // Try to align the story with either the bottom of the left column or the summary of the // last item in the right column; whichever will prevent overlapping with the story above. targetTop = leftBottom; if($lastRight.size() > 0) { $lastRightSummary = $lastRight.find(".summary"); if($lastRightSummary.size() > 0) { targetTop = Math.max($lastRightSummary.offset().top, targetTop); } } } else { // As above except for the right side targetTop = rightBottom; if($lastLeft.size() > 0) { $lastLeftSummary = $lastLeft.find(".summary"); if($lastLeftSummary.size() > 0) { targetTop = Math.max($lastLeftSummary.offset().top, targetTop); } } } $segment.addClass(side).css("margin-top", targetTop - $segment.offset().top); }); } $el.find('.seeMoreButton a').on('click', function(e) { e.preventDefault(); $el.toggleClass('open'); }); // Handle all breakpoint changes [ 'sm', 'md', 'lg', 'xs' ].forEach(function(size) { intent.on(size, reposition); }); // IntentionJS has probably already fired events by now so manually call reposition for init reposition(); // Mark initialised so we can skip it next time $el.data('timeline', true); } $.fn.timeline = function() { $(this).each(init); }; $(function() { $('.timelineModule').timeline(); }); })(window, jQuery, intent); (function (_this, $) { _this.initialise = function () { $(function () { bindSeeMoreButtons(); bindCalendarDayLinks(); }); return _this; } var bindSeeMoreButtons = function() { $('.eventsCalendarModule .showMoreButton').on('click', function(e) { e.preventDefault(); $(this).parents('.eventDate').find('.eventList').toggleClass('open'); }); } var bindCalendarDayLinks = function() { $('.eventsCalendarModule .calendarDays a').on('click', function(e) { e.preventDefault(); var $currentDate = $(this).parents('.eventsCalendarModule').find('.eventDate.open'); var $targetDate = $(this).parents('.eventsCalendarModule').find('.eventDate[data-date="' + $(this).attr('data-date') + '"]'); $currentDate.removeClass('open'); $targetDate.addClass('open'); $(this).parents('.eventsCalendarModule').find('.calendarDays > div, .calendarDays > a').removeClass('selected'); $(this).addClass('selected'); }) } // Initialise & assign to global scope window.EventsCalendarModule = _this.initialise(); })(window.EventsCalendarModule || {}, jQuery); function hasValue(v) { return (v !== undefined && v !== null && v !== ""); } function googleMapInitialize(mapDivId, options) { var mapOptions = { center: new google.maps.LatLng(options.latitude, options.longitude), zoom: options.zoomLevel }; var map = new google.maps.Map(document.getElementById(mapDivId), mapOptions); var marker = new google.maps.Marker({ map: map, position: map.getCenter() }); if (hasValue(options.infoContent)) { var infoWindow = new google.maps.InfoWindow(); infoWindow.setContent('<b>' + options.infoContent + '</b>'); google.maps.event.addListener(marker, 'click', function() { infoWindow.open(map, marker); }); } } (function (_this, $) { _this.initialise = function () { $(function () { initialiseFormReset(); }); return _this; } var initialiseFormReset = function(){ $('.cancel').on('click', function() { var formID = $('.cancel').closest('form').attr('id'); $('#'+formID).trigger('reset'); }); } // Initialise & assign to global scope window.FormResetModule = _this.initialise(); })(window.FormResetModule || {}, jQuery); (function (_this, $) { _this.initialise = function () { $(function () { bindPlayButtons(); bindProgressBarClick(); bindTimeUpdate(); initialiseDurations(); bindPlaybackComplete(); }); return _this; } var bindPlayButtons = function() { $('.podcastModule .podcastControls .playButton').on('click', function(e) { e.preventDefault(); var $podcast = $(this).closest('.podcast'); var audio = $podcast.find('audio')[0]; $podcast.toggleClass('playing'); if($podcast.hasClass('playing')) { audio.play(); } else { audio.pause(); } }); } var bindProgressBarClick = function() { $('.podcastModule .podcastControls .progressBar').on('click', function(e) { var x = e.pageX - $(this).offset().left; var width = $(this).width(); var fraction = x/width; var audio = $(this).closest('.podcast').find('audio')[0]; audio.currentTime = audio.duration * fraction; }); } var bindTimeUpdate = function() { $('.podcastModule audio').on('timeupdate', function() { var currentTime = $(this)[0].currentTime; var duration = $(this)[0].duration; var percentageComplete = (currentTime/duration) * 100.0; var $podcast = $(this).closest('.podcast'); var $progressBar = $podcast.find('.progressBarProgress'); $progressBar.css('width', percentageComplete + '%'); var $elapsedTime = $podcast.find('.podcastProgress .elapsedTime'); $elapsedTime.text(getTimeString(currentTime)); }); } var initialiseDurations = function() { $('.podcastModule audio').on('durationchange', function() { var duration = $(this)[0].duration; $(this).closest('.podcast').find('.podcastProgress .duration').text(getTimeString(duration)); }); // IE fix setTimeout(function() { $('.podcastModule audio').each(function() { var duration = $(this)[0].duration; $(this).closest('.podcast').find('.podcastProgress .duration').text(getTimeString(duration)); }); },2000); } var getTimeString = function(secs) { var seconds = parseInt(secs); var hours = Math.floor(secs / (60 * 60)); seconds = seconds - (hours * (60 * 60)); var minutes = Math.floor(seconds / 60); var seconds = seconds - (minutes * 60); var timeString = ""; if(hours > 0) { timeString = timeString + hours + ' hour '; } if(minutes > 0) { timeString = timeString + minutes + ' min '; } timeString = timeString + seconds + ' sec'; return timeString; } var bindPlaybackComplete = function() { $('.podcastModule audio').on('ended', function() { $(this).closest('.podcast').removeClass('playing'); $(this)[0].pause(); $(this)[0].currentTime = 0; }); } // Initialise & assign to global scope window.PodcastModule = _this.initialise(); })(window.PodcastModule || {}, jQuery); (function(root, $) { var defaultOpts = { attribute: 'data-autosubmit' }; /** * Allows registering form elements to automatically submit the form when they change or when other events * occur. Examples: * <select name="something" data-autosubmit="click change"></select> * <select name="something" data-autosubmit="true"></select> or <select name="something" data-autosubmit></select> * * Usage: * $.autoSubmit([opts]) to configure * $.autoSubmit(false) to turn off again * * Will automatically configure any element with data-autosubmit attribute by default. */ $.fn.autoSubmit = function(opts) { // Deregister selected items if(opts === false) { $(this).off('.autosubmit'); return; } opts = $.extend(true, {}, defaultOpts, opts); $(this).each(function() { // selectmenuchange is triggered by jQuery UI, which helpfully doesn't fire the change event for you // (thanks guys) var autoSubmitEvents = [ 'change.autosubmit', 'selectmenuchange.autosubmit'], $el = $(this); // Check to see if the user provided their own options if($el.attr(opts.attribute) != '' && $el.attr(opts.attribute) != 'true') { autoSubmitEvents = $el.attr(opts.attribute).split(/\s+/).map(function(eventName) { return eventName + ".autosubmit"; }); } $el.on(autoSubmitEvents.join(' '), function() { $(this).closest('form').submit(); }); }); }; // Set up by looking for elements automatically $(root.document).ready(function() { $('*[data-autosubmit]').autoSubmit(); }); })(window, window.jQuery); (function(root, $) { var defaultOpts = { targetHref: "data-href", displayHref: "data-display-href", className: "linked" }; $.fn.linker = function(opts) { var $els = $(this); if(opts === false) { $els.off('.linker'); $els.each(function() { var $el = $(this), opts = $el.data("linkerOpts"); $el.removeClass(opts.className); $el.data("linkerOpts", null); }); return; } opts = $.extend(true, {}, opts, defaultOpts); $els.addClass(opts.className); $els.on("click.linker", function(event) { var $el = $(this), destination = $el.attr(opts.targetHref); event.preventDefault(); root.location.href = destination; }); // Mask where the link is actually going by showing the display URL as the href $els.each(function() { var $el = $(this), displayUrl = $el.attr(opts.displayHref); $el.attr("href", displayUrl); $el.data("linkerOpts", opts); }); }; $(function() { $('*[data-linker]').linker(); }); })(window, window.jQuery); !function(t){function e(t,e,r){return 4===arguments.length?n.apply(this,arguments):void i(t,{declarative:!0,deps:e,declare:r})}function n(t,e,n,r){i(t,{declarative:!1,deps:e,executingRequire:n,execute:r})}function i(t,e){e.name=t,t in p||(p[t]=e),e.normalizedDeps=e.deps}function r(t){var e=p[t];e.groupIndex=0;var n=[];!function t(e,n){if(n[e.groupIndex]=n[e.groupIndex]||[],-1==d.call(n[e.groupIndex],e)){n[e.groupIndex].push(e);for(var i=0,r=e.normalizedDeps.length;r>i;i++){var o=e.normalizedDeps[i],s=p[o];if(s&&!s.evaluated){var a=e.groupIndex+(s.declarative!=e.declarative);if(void 0===s.groupIndex||s.groupIndex<a){if(void 0!==s.groupIndex&&(n[s.groupIndex].splice(d.call(n[s.groupIndex],s),1),0==n[s.groupIndex].length))throw new TypeError("Mixed dependency cycle detected");s.groupIndex=a}t(s,n)}}}}(e,n);for(var i=!!e.declarative==n.length%2,r=n.length-1;r>=0;r--){for(var s=n[r],u=0;u<s.length;u++){var l=s[u];i?o(l):a(l)}i=!i}}function o(e){if(!e.module){var n=e.module=function(t){return v[t]||(v[t]={name:t,dependencies:[],exports:{},importers:[]})}(e.name),i=e.module.exports,r=e.declare.call(t,function(t,e){if(n.locked=!0,"object"==typeof t)for(var r in t)i[r]=t[r];else i[t]=e;for(var o=0,s=n.importers.length;s>o;o++){var a=n.importers[o];if(!a.locked)for(var u=0;u<a.dependencies.length;++u)a.dependencies[u]===n&&a.setters[u](i)}return n.locked=!1,e},{id:e.name});n.setters=r.setters,n.execute=r.execute;for(var s=0,a=e.normalizedDeps.length;a>s;s++){var u,l=e.normalizedDeps[s],c=p[l],h=v[l];h?u=h.exports:c&&!c.declarative?u=c.esModule:c?(o(c),u=(h=c.module).exports):u=f(l),h&&h.importers?(h.importers.push(n),n.dependencies.push(h)):n.dependencies.push(null),n.setters[s]&&n.setters[s](u)}}}function s(t){var e,n=p[t];if(n)n.declarative?c(t,[]):n.evaluated||a(n),e=n.module.exports;else if(!(e=f(t)))throw new Error("Unable to load dependency "+t+".");return(!n||n.declarative)&&e&&e.__useDefault?e.default:e}function a(e){if(!e.module){var n={},i=e.module={exports:n,id:e.name};if(!e.executingRequire)for(var r=0,o=e.normalizedDeps.length;o>r;r++){var l=e.normalizedDeps[r],c=p[l];c&&a(c)}e.evaluated=!0;var f=e.execute.call(t,function(t){for(var n=0,i=e.deps.length;i>n;n++)if(e.deps[n]==t)return s(e.normalizedDeps[n]);throw new TypeError("Module "+t+" not declared as a dependency.")},n,i);void 0!==f&&(i.exports=f),(n=i.exports)&&n.__esModule?e.esModule=n:e.esModule=u(n)}}function u(e){var n={};if(("object"==typeof e||"function"==typeof e)&&e!==t)if(m)for(var i in e)"default"!==i&&l(n,e,i);else{var r=e&&e.hasOwnProperty;for(var i in e)"default"===i||r&&!e.hasOwnProperty(i)||(n[i]=e[i])}return n.default=e,h(n,"__useDefault",{value:!0}),n}function l(t,e,n){try{var i;(i=Object.getOwnPropertyDescriptor(e,n))&&h(t,n,i)}catch(i){return t[n]=e[n],!1}}function c(e,n){var i=p[e];if(i&&!i.evaluated&&i.declarative){n.push(e);for(var r=0,o=i.normalizedDeps.length;o>r;r++){var s=i.normalizedDeps[r];-1==d.call(n,s)&&(p[s]?c(s,n):f(s))}i.evaluated||(i.evaluated=!0,i.module.execute.call(t))}}function f(t){if(y[t])return y[t];if("@node/"==t.substr(0,6))return y[t]=u(g(t.substr(6)));var e=p[t];if(!e)throw"Module "+t+" not present.";return r(t),c(t,[]),p[t]=void 0,e.declarative&&h(e.module.exports,"__esModule",{value:!0}),y[t]=e.declarative?e.module.exports:e.esModule}var h,p={},d=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},m=!0;try{Object.getOwnPropertyDescriptor({a:0},"a")}catch(t){m=!1}!function(){try{Object.defineProperty({},"a",{})&&(h=Object.defineProperty)}catch(t){h=function(t,e,n){try{t[e]=n.value||n.get.call(t)}catch(t){}}}}();var v={},g="undefined"!=typeof System&&System._nodeRequire||"undefined"!=typeof require&&void 0!==require.resolve&&"undefined"!=typeof process&&process.platform&&require,y={"@empty":{}};return function(t,i,r,o){return function(s){s(function(s){for(var a={_nodeRequire:g,register:e,registerDynamic:n,get:f,set:function(t,e){y[t]=e},newModule:function(t){return t}},l=0;l<i.length;l++)!function(t,e){e&&e.__esModule?y[t]=e:y[t]=u(e)}(i[l],arguments[l]);o(a);var c=f(t[0]);if(t.length>1)for(l=1;l<t.length;l++)f(t[l]);return r?c.default:c})}}}("undefined"!=typeof self?self:global)(["main.js"],["github:components/jquery@1.11.3.js"],!1,function($__System){var require=this.require,exports=this.exports,module=this.module;!function(t){function e(t,e){for(var n=t.split(".");n.length;)e=e[n.shift()];return e}function n(n){if("string"==typeof n)return e(n,t);if(!(n instanceof Array))throw new Error("Global exports must be a string or array.");for(var i={},r=!0,o=0;o<n.length;o++){var s=e(n[o],t);r&&(i.default=s,r=!1),i[n[o].split(".").pop()]=s}return i}function i(e){!function(e){if(Object.keys)Object.keys(t).forEach(e);else for(var n in t)s.call(t,n)&&e(n)}(function(n){if(-1==a.call(u,n)){try{var i=t[n]}catch(t){u.push(n)}e(n,i)}})}var r,o=$__System,s=Object.prototype.hasOwnProperty,a=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},u=["_g","sessionStorage","localStorage","clipboardData","frames","frameElement","external","mozAnimationStartTime","webkitStorageInfo","webkitIndexedDB","mozInnerScreenY","mozInnerScreenX"];o.set("@@global-helpers",o.newModule({prepareGlobal:function(e,o,s){var a,u=t.define;if(t.define=void 0,s)for(var l in a={},s)a[l]=t[l],t[l]=s[l];return o||(r={},i(function(t,e){r[t]=e})),function(){var e,s,l;o?e=n(o):(e={},i(function(t,n){r[t]!==n&&void 0!==n&&(e[t]=n,void 0!==s?l||s===n||(l=!0):s=n)}),e=l?e:s);if(a)for(var c in a)t[c]=a[c];return t.define=u,e}}}))}("undefined"!=typeof self?self:global),function(t){function e(t,e){var n=((t=t.replace(s,"")).match(l)[1].split(",")[e]||"require").replace(c,""),i=f[n]||(f[n]=new RegExp(a+n+u,"g"));i.lastIndex=0;for(var r,o=[];r=i.exec(t);)o.push(r[2]||r[3]);return o}function n(t,e,i,o){if("object"==typeof t&&!(t instanceof Array))return n.apply(null,Array.prototype.splice.call(arguments,1,arguments.length-1));if("string"==typeof t&&"function"==typeof e&&(t=[t]),!(t instanceof Array)){if("string"==typeof t){var s=r.get(t);return s.__useDefault?s.default:s}throw new TypeError("Invalid require")}for(var a=[],u=0;u<t.length;u++)a.push(r.import(t[u],o));Promise.all(a).then(function(t){e&&e.apply(null,t)},i)}function i(i,s,a){var u,l,c;"string"!=typeof i&&(a=s,s=i,i=null),s instanceof Array||(s=["require","exports","module"].splice(0,(a=s).length)),"function"!=typeof a&&(a=function(t){return function(){return t}}(a)),void 0===s[s.length-1]&&s.pop(),-1!=(u=o.call(s,"require"))&&(s.splice(u,1),i||(s=s.concat(e(a.toString(),u)))),-1!=(l=o.call(s,"exports"))&&s.splice(l,1),-1!=(c=o.call(s,"module"))&&s.splice(c,1);var f={name:i,deps:s,execute:function(e,i,o){for(var f=[],h=0;h<s.length;h++)f.push(e(s[h]));o.uri=o.id,o.config=function(){},-1!=c&&f.splice(c,0,o),-1!=l&&f.splice(l,0,i),-1!=u&&f.splice(u,0,function(t,i,s){return"string"==typeof t&&"function"!=typeof i?e(t):n.call(r,t,i,s,o.id)});var p=a.apply(-1==l?t:i,f);return void 0===p&&o&&(p=o.exports),void 0!==p?p:void 0}};if(i)h.anonDefine||h.isBundle?h.anonDefine&&h.anonDefine.name&&(h.anonDefine=null):h.anonDefine=f,h.isBundle=!0,r.registerDynamic(f.name,f.deps,!1,f.execute);else{if(h.anonDefine&&!h.anonDefine.name)throw new Error("Multiple anonymous defines in module "+i);h.anonDefine=f}}var r=$__System,o=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(this[e]===t)return e;return-1},s=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/gm,a="(?:^|[^$_a-zA-Z\\xA0-\\uFFFF.])",u="\\s*\\(\\s*(\"([^\"]+)\"|'([^']+)')\\s*\\)",l=/\(([^\)]*)\)/,c=/^\s+|\s+$/g,f={};i.amd={};var h={isBundle:!1,anonDefine:null};r.amdDefine=i,r.amdRequire=n}("undefined"!=typeof self?self:global),$__System.register("lib/garfield.js",[],function(t){"use strict";return{setters:[],execute:function(){var t,e,n,i,r,o,s,a;s={}.toString,a=0,e=function(t,e){var n=[],i=0;for(i=0;i<t.length;i++)e(t[i])&&n.push(t[i]);return n},n=function(t,e){var n;for(n=0;n<t.length;n++)e(t[n],n)},i=function(t){return"[object Array]"===s.call(t)},r=function(t){return"function"==typeof t},o=function(t,e,n,i,o){try{return t.apply(e,n)}catch(t){if(!r(o))throw t;try{o(t)}catch(e){throw t}}return i},(t=function(e){var i=this;this.bindings=[],this.hooks={},e=e||{},this.options={init:e.init||t.defaults.init,initAll:e.initAll||t.defaults.initAll,loader:e.loader||t.defaults.loader},n(["beforeInit","beforeInitAll","afterInit","afterInitAll","beforeLoad","afterLoad","onBind","onInit","onSkipBinding","onSkipInit","onSkipInitAll","onError"],function(t){void 0!==e[t]&&i.addHook(t,e[t])}),this.select=e.select||t.defaults.select,this.require=e.require||t.defaults.require}).defaults={init:"init",initAll:"initAll",select:function(t,e){return e.querySelectorAll(t)},require:window.require,loader:"require"},t.loaders={require:function(t,e,n){this.require([t],e,n)},systemjs:function(t,e,n){System.import(t).then(e,n)}},t.prototype.load=function(e,n,i){t.loaders[this.options.loader].call(this,e,n,i)},t.prototype.processElementConfig=function(t,e){return e.config},t.prototype.addHook=function(t,e){if(i(this.hooks[t])||(this.hooks[t]=[]),i(e))this.hooks[t].push.apply(this.hooks[t],e);else{if(!r(e))throw new Error("Invalid hook "+typeof e+": "+e);this.hooks[t].push(e)}},t.prototype.callHook=function(t){var e,i=this;return void 0!==this.hooks[t]&&(e=[].slice.call(arguments,1),n(this.hooks[t],function(n){try{n.apply(i,e)}catch(e){if("onError"===t)throw e;i.callHook("onError",e)}}),!0)},t.prototype.bind=function(){var t=this;if("string"==typeof arguments[0])this.bindings.push({id:a++,selector:arguments[0],module:arguments[1]}),this.callHook("onBind",this.bindings[this.bindings.length-1]);else if(i(arguments[0]))n(arguments[0],function(e){e.id=a++,e.module=e.module||e.require||void 0,t.bindings.push(e),t.callHook("onBind",t.bindings[t.bindings.length-1])});else{if("object"!=typeof arguments[0])throw new Error("Invalid binding format.");arguments[0].id=a++,arguments[0].module=arguments[0].module||arguments[0].require||void 0,this.bindings.push(arguments[0]),this.callHook("onBind",this.bindings[this.bindings.length-1])}},t.prototype.applyBinding=function(t,s){var a,u=this,l=function(t){if(!u.callHook("onError",t))throw t};0!==(t=e(t,function(t){return!("function"==typeof s.filter&&o(s.filter,s,[t],!1,l)||!s.multiple&&void 0!==t._garfieldBound&&t._garfieldBound[s.id]||"object"==typeof s.config&&s.config.disabled)})).length?(a=function(e){var i,a,c,f;r(s.initAll)&&(i=s.initAll,a=u),r(s.init)&&(c=s.init,f=u),("object"==typeof e||r(e))&&(i||(i=e[s.initAll||u.options.initAll],a=e),c||(c=e[s.init||u.options.init],f=e),!r(e)||i||c||(c=e,f=e)),u.callHook("afterLoad",t,s),r(i)&&("object"==typeof s.config&&s.config.disabled?u.callHook("onSkipInitAll",t,s):(u.callHook("beforeInitAll",t,s),o(i,a,[t,s.config],null,l),n(t,function(t){(t._garfieldBound=t._garfieldBound||{})[s.id]=!0}),u.callHook("afterInitAll",t,s))),r(c)&&n(t,function(t){var e=u.processElementConfig(t,s);"object"==typeof e&&e.disabled?u.callHook("onSkipInit",t,s):(u.callHook("beforeInit",t,s),o(c,f,[t,e],null,l),(t._garfieldBound=t._garfieldBound||{})[s.id]=!0,u.callHook("afterInit",t,s))})},"string"==typeof s.module||i(s.module)?(this.callHook("beforeLoad",t,s),this.load(s.module,a,function(t){u.callHook("onError",t)})):(r(s.module)||"object"==typeof s.module)&&a(s.module)):u.callHook("onSkipBinding",s)},t.prototype.init=function(t){var e=this;void 0===t&&(t=window.document),this.callHook("onInit",t),n(this.bindings,function(n){var i;if("string"!=typeof n.selector)throw new Error("Invalid binding selector.");(i=e.select(n.selector,t)).length>0?e.applyBinding(i,n):e.callHook("onSkipBinding",n)})},void 0!==window.define&&define.amd?define(function(){return t}):window.Garfield=t}}}),$__System.register("components/audio-player/audio-player-tpl.js",["npm:incremental-dom@0.5.1.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c,f,h,p,d,m;return t("audioPlayerTplFn",function(t){e("div","7e52ea0d-6ffa-44b8-bd34-c093a87f0e24",r),e("div","cd91ca2e-14c7-4477-8469-dd8ed7711ede",o),e("a","096a7899-302d-4a5a-b39e-a1e2e5d152ef",s,"class","b-audio-player__play-button "+t.proxy.buttonPlayClass,"onclick",function(e){t.handlers.clickPlayButton()}),e("span","1331400a-9b66-4050-852e-ef412198eef7",a),i("audio play button"),n("span"),e("i","47c8c50b-1342-4e85-ad6f-0fb556aee02a",u),n("i"),e("i","0cb7a652-5f0a-4bc6-a41f-45a4e96e2754",l),n("i"),n("a"),n("div"),e("div","5ea3d7bc-e129-49b5-b056-5e8d2d6c6720",c),e("a","8fe7f585-c2e5-4f99-bf94-8eb3952e8b5b",f,"onclick",function(e){t.handlers.clickProgressBar(event)}),e("div","acb63693-0606-4677-aa98-e5aea3783906",h),n("div"),n("a"),n("div"),n("div"),e("div","33cd40dc-31fd-4ef3-a5a0-0d2857a0eab7",p),e("span","e59b6d70-5d74-4eb5-b7e4-611cc0b30ea3",d),i(""+t.handlers.getTimeString(t.proxy.currentTime)),n("span"),i(" /"),e("span","294a76cd-d8e2-413c-ae56-2b09da2b5d61",m),i(""+t.handlers.getTimeString(t.proxy.duration)),n("span"),n("div")}),{setters:[function(t){t.patch,e=t.elementOpen,n=t.elementClose,i=t.text,t.skip,t.currentElement}],execute:function(){r=["class","b-position__container b-position__container--vertical"],o=["class","b-audio-player__control b-audio-player__control--play-button b-position__content b-position__content--top"],s=["href","javascript:void(0);","data-js-el","play-button","title","audio play button"],a=["class","b-audio-player__play-button-text sr-only"],u=["class","b-audio-player__play-icon glyphicon glyphicon-play"],l=["class","b-audio-player__pause-icon glyphicon glyphicon-pause"],c=["class","b-audio-player__control b-audio-player__control--progress-bar b-position__content b-position__content--top"],f=["class","b-audio-player__progress-bar","href","javascript:void(0);","data-js-el","progress-bar","title","audio progress bar"],h=["class"," b-audio-player__progress-bar-progress","data-js-el","progress-bar-progress"],p=["class","b-text b-text--font-label b-text--size-small"],d=["data-js-el","timeElapsed"],m=["data-js-el","timeDuration"]}}}),$__System.register("components/audio-player/audio-player.js",["lib/featured-component.js","lib/config.js","helpers/helpers.js","components/audio-player/audio-player-tpl.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c,f=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),h=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.configurable},function(t){i=t.Helpers},function(t){r=t.audioPlayerTplFn}],execute:function(){o="state_playing",s="state_paused",a="state_stopped",u="b-audio-player__play-button--pausing",l="b-audio-player__play-button--playing",c=function(t){function c(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p),h(Object.getPrototypeOf(p.prototype),"constructor",this).call(this,t,e),this._data={state:a,duration:0,currentTime:0,buttonPlayClass:l},this._partial=this._createDynamicPartial({templateFn:r,callback:this.handleProxyChanges}),this._initialise()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,e),f(c,[{key:"_initialise",value:function(){var t=this;this._childElements.audio.ontimeupdate=this.handleAudioTimeUpdate,this._childElements.audio.onended=this.handleAudioComplete,this._childElements.audio.onloadedmetadata=function(){t._partial.vm.proxy.duration=t._childElements.audio.duration,t._updateProgressBar()},this._childElements.audio.load()}},{key:"handleAudioTimeUpdate",value:function(){this._partial.vm.proxy.currentTime=this._childElements.audio.currentTime}},{key:"handleAudioComplete",value:function(){this._updateAudioState()}},{key:"handleProxyChanges",value:function(t,e,n){"currentTime"===e&&(this._childElements.audio.currentTime=this._partial.vm.proxy.currentTime),this._updateProgressBar(),this._partial.view.render()}},{key:"clickPlayButton",value:function(){this._updateAudioState(this._partial.vm.proxy.state)}},{key:"clickProgressBar",value:function(t){var e=this._childElements.$progressBar,n=(t.pageX-e.offset().left)/e.width();this._partial.vm.proxy.currentTime=this._childElements.audio.duration*n}},{key:"getTimeString",value:function(t){return i.Strings.getMediaTimeStringFromSeconds(t)}},{key:"_updateProgressBar",value:function(){this._childElements.$progressBarProgress.css("width",this._partial.vm.proxy.currentTime/this._partial.vm.proxy.duration*100+"%")}},{key:"_updateAudioState",value:function(t){switch(t){case a:this._childElements.audio.play(),this._partial.vm.proxy.state=o,this._partial.vm.proxy.buttonPlayClass=u;break;case o:this._childElements.audio.pause(),this._partial.vm.proxy.state=s,this._partial.vm.proxy.buttonPlayClass=l;break;case s:this._childElements.audio.play(),this._partial.vm.proxy.state=o,this._partial.vm.proxy.buttonPlayClass=u;break;default:return this._childElements.audio.pause(),this._childElements.audio.currentTime=0,this._partial.vm.proxy.state=a,void(this._partial.vm.proxy.buttonPlayClass=l)}}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new c(t,e)}}]);var p=c;return c=n({})(c)||c}(),t("AudioPlayer",c)}}}),$__System.register("components/anchor-in-accordion/anchor-in-accordion.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","components/constants/constants.js","components/events/accordion-events.js","npm:lodash@4.17.4.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),f=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable},function(t){o=t.Constants},function(t){s=t.AccordionEvents},function(t){a=t.default}],execute:function(){u=o.ANCHOR_SCROLL_START_DELAY-600,l=function(t){function l(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),f(Object.getPrototypeOf(h.prototype),"constructor",this).call(this,t,e),this._handleLocationHashChange=this._handleLocationHashChange.bind(this),this._searchAnchorItem=this._searchAnchorItem.bind(this),this._scrollToTargetItem=this._scrollToTargetItem.bind(this),this._handleClickEvent=this._handleClickEvent.bind(this),this._handlePanelShownCallback=null,this._lastHashName=null,this._registerEventHandlers(),window.setTimeout(this._handleLocationHashChange,u)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,n),c(l,[{key:"_getStickyMainNavigationHeight",value:function(){return i(this.config.stickNavigationElement||o.GLOBAL_NAVIGATION_CLASS,e("body"))?i(this.config.stickNavigationElement||o.GLOBAL_NAVIGATION_CLASS,e("body")).height():0}},{key:"_registerEventHandlers",value:function(){window.addEventListener("hashchange",this._handleLocationHashChange),document.documentElement.addEventListener("click",this._handleClickEvent,!1)}},{key:"_handleClickEvent",value:function(t){e(t.target).attr("href")&&"#"===e(t.target).attr("href").charAt(0)&&e(t.target).attr("href")===window.location.hash&&(t.stopPropagation(),this._handleLocationHashChange())}},{key:"_handleLocationHashChange",value:function(){var t=this;if(this._lastHashName!==window.location.hash){var n,r=void 0;this._lastHashName=window.location.hash,n=a.find(i(this.config.accordionItemElement,this.$el),function(n){return void 0!==(r=a.find(e(n).find("a"),function(e){return void 0!==t._searchAnchorItem(e)}.bind(t)))}.bind(this)),void 0!==r&&void 0!==n&&(e(n).trigger(s.EXPANDING_ACCORDION_PANEL),window.setTimeout(function(){t._scrollToTargetItem(r)}.bind(this),u),this._collapseAccordionPanels(e(n)))}}},{key:"_searchAnchorItem",value:function(t){if(e(t).attr("name")&&"#".concat(e(t).attr("name"))==window.location.hash)return e(t)}},{key:"_collapseAccordionPanels",value:function(t){if(console.log("this.config.openSingle RESULT: ",!0!==this.config.openSingle||!t),!0===this.config.openSingle&&t){for(var n=i(this.config.accordionItemElement,this.$el),r=0;r<n.length;r++)e(t).attr("id")!==e(n[r]).attr("id")&&e(n[r]).trigger(s.COLLAPSING_ACCORDION_PANEL);return!1}}},{key:"_scrollToTargetItem",value:function(t){var n=this._getStickyMainNavigationHeight()+o.ANCHOR_SCROLL_TARGET_DEFAULT_OFFSET;e("html, body").animate({scrollTop:e(t).offset().top-n},o.ANIMATION_DURATION_NORMAL)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new l(t,e)}}]);var h=l;return l=r({accordionItemElement:".b-js-accordion-item",accordionButtonElement:".b-js-accordion-button",stickNavigationElement:null,scrollOffset:null,openSingle:!1,jqNs:"anchorInAccordion"})(l)||l}(),t("AnchorInAccordion",l)}}}),$__System.register("components/anchor-in-accordion/accordion-button.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js","components/events/accordion-events.js"],function(t){"use strict";var e,n,i,r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){t.default},function(t){n=t.default},function(t){t.default},function(t){i=t.configurable},function(t){t.AccordionEvents}],execute:function(){r=function(t){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),s(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,t,e),this._handleButtonClick=this._handleButtonClick.bind(this),this.registerEventListeners()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,n),o(r,[{key:"registerEventListeners",value:function(){this.$el.on("click",this._handleButtonClick)}},{key:"_handleButtonClick",value:function(t){var n=e(t.target).attr("name");void 0!==n&&(window.location.hash=n)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new r(t,e)}}]);var a=r;return r=i({scrollOffset:null,collapsedClass:".collapsed"})(r)||r}(),t("AccordionButton",r)}}}),$__System.register("components/events/accordion-events.js",[],function(t){"use strict";return{setters:[],execute:function(){t("AccordionEvents",{SHOW:"show.bs.collapse",HIDE:"hide.bs.collapse",SHOWN:"shown.bs.collapse",HIDDEN:"hidden.bs.collapse",EXPANDING_ACCORDION_PANEL:"EXPANDING_ACCORDION_PANEL",COLLAPSING_ACCORDION_PANEL:"COLLAPSING_ACCORDION_PANEL"})}}}),$__System.register("components/anchor-in-accordion/accordion-item.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js","components/events/accordion-events.js","helpers/helpers.js"],function(t){"use strict";var e,n,i,r,o,s,a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){t.default},function(t){e=t.default},function(t){n=t.default},function(t){i=t.configurable},function(t){r=t.AccordionEvents},function(t){o=t.Helpers}],execute:function(){s=function(t){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),u(Object.getPrototypeOf(l.prototype),"constructor",this).call(this,t,e),this.$el.attr("id",o.Strings.random(8)),this._handleCollapsing=this._handleCollapsing.bind(this),this._handleExpanding=this._handleExpanding.bind(this),this._setElementAriaExpandedVal=this._setElementAriaExpandedVal.bind(this),this.registerEventListeners()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,e),a(s,[{key:"registerEventListeners",value:function(){this.on(r.EXPANDING_ACCORDION_PANEL,this._handleExpanding),this.on(r.COLLAPSING_ACCORDION_PANEL,this._handleCollapsing)}},{key:"_handleExpanding",value:function(){var t=n(this.config.buttonSelector,this.$el),e=n(t.attr("data-target"),this.$el);this._setElementAriaExpandedVal(t,!0),this._setElementAriaExpandedVal(e,!0),t.removeClass(this.config.buttonCollapsedClass).addClass(this.config.buttonExpandedClass),e.removeClass(this.config.panelCollapsedClass).addClass(this.config.panelExpandedClass)}},{key:"_handleCollapsing",value:function(){var t=n(this.config.buttonSelector,this.$el),e=n(t.attr("data-target"),this.$el);this._setElementAriaExpandedVal(t,!1),this._setElementAriaExpandedVal(e,!1),t.removeClass(this.config.buttonExpandedClass).addClass(this.config.buttonCollapsedClass),e.removeClass(this.config.panelExpandedClass).addClass(this.config.panelCollapsedClass)}},{key:"_setElementAriaExpandedVal",value:function(t,e){t.attr("aria-expanded",e)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new s(t,e)}}]);var l=s;return s=i({buttonSelector:".b-js-accordion-button",buttonCollapsedClass:"collapsed",buttonExpandedClass:"",panelSelector:"",panelCollapsedClass:"collapse",panelExpandedClass:"collapse in",jqNs:"anchorInAccordionItem"})(s)||s}(),t("AccordionItem",s)}}}),$__System.register("components/nav-tabs/nav-tabs.js",["github:components/jquery@1.11.3.js","lib/config.js"],function(t){"use strict";var e,n,i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default},function(t){n=t.mergeConfig}],execute:function(){i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return r(t,null,[{key:"init",value:function(t,i){e(t).accessibleMegaMenu(n({topNavItemClass:"b-nav-tabs__tab",panelClass:"b-nav-tabs__dropdown",openClass:"b-nav-tabs__dropdown--open"},i))}}]),t}(),t("NavTabs",i)}}}),$__System.register("components/tab-collapser/tab-collapser.js",["github:components/jquery@1.11.3.js","lib/config.js","lib/grab.js","lib/component.js","github:components/handlebars.js@4.0.5.js"],function(t){"use strict";var e,n,i,r,o,s,a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.configurable},function(t){i=t.default},function(t){r=t.default},function(t){o=t.default}],execute:function(){s=function(t){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),u(Object.getPrototypeOf(l.prototype),"constructor",this).call(this,t,e);var n=i(this.config.template,this.$el);this.template=o.compile(n.html()||""),this.$el.hide()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,r),a(s,[{key:"update",value:function(){var t=this,n=void 0;"left"==this.config.direction?n="before":"right"==this.config.direction&&(n="after");var r=i(this.config.collapse,this.$el,n);this.$el.show();var o=Math.min.apply(Math,r.show().map(function(t,n){return e(n).offset().top})),s=r.show().filter(function(n,i){var r=e(i);if(t.$el.offset().top>o)return r.hide(),!0});0===s.length&&this.$el.hide();var a=s.map(function(t,n){var r=e(n),o=i("@collapsed-label",r);return{label:o.text(),href:o.attr("href")}}).get();"left"==this.config.direction&&(a=a.reverse()),i(this.config.collapseTo,this.$el).html(this.template({collapsed:a}))}},{key:"watch",value:function(){this.update(),e(window).on("resize."+this.config.jsNs,this.update.bind(this))}},{key:"destroy",value:function(){e(window).off("resize."+this.config.jsNs)}}],[{key:"init",value:function(t,e){var n=new s(t,e);return setTimeout(function(){return n.watch()},1),n}}]);var l=s;return s=n({collapse:null,collapseTo:null,direction:"left",template:".b-js--template",jqNs:"tab-collapser"})(s)||s}(),t("TabCollapser",s)}}}),$__System.register("components/caret-slider/caret-slider.js",["github:components/jquery@1.11.3.js","lib/config.js","lib/grab.js","lib/component.js"],function(t){"use strict";var e,n,i,r,o,s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.configurable},function(t){i=t.default},function(t){r=t.default}],execute:function(){o=function(t){function o(t,n){var r=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a(Object.getPrototypeOf(u.prototype),"constructor",this).call(this,t,n),this.$caret=e('<div class="b-caret-slider__caret b-caret-slider__caret--'+this.config.axis+" b-caret-slider__caret--"+this.config.type+'"></div>'),this.$el.append(this.$caret),this.$el.addClass("b-caret-slider"),this.config.activeStop&&this.slideTo(i(this.config.activeStop,this.$el)),this.config.followFocus&&(this.$caret.addClass("b-caret-slider__caret--inactive"),this.on("mouseenter focus click activate",this.config.stops,function(t){r.$caret.removeClass("b-caret-slider__caret--inactive").addClass("b-caret-slider__caret--active"),r.slideTo(t.currentTarget),r._watch()}))}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,r),s(o,[{key:"slideTo",value:function(t){var n=void 0,i=void 0;if("horizontal"==this.config.axis){if("left"!==this.config.anchor&&"right"!==this.config.anchor&&"centre"!==this.config.anchor)return void console.warn("Invalid anchor position: "+this.config.anchor+".");n="left",i="width"}else if("vertical"==this.config.axis){if("top"!==this.config.anchor&&"bottom"!==this.config.anchor&&"centre"!==this.config.anchor)return void console.warn("Invalid anchor position: "+this.config.anchor+" .");n="top",i="height"}var r=0;if("number"==typeof t)r=t;else{var o=e(t);if(r=o.position()[n],"centre"===this.config.anchor){r+="width"==i?o.innerWidth()/2-this.$caret.outerWidth(!0)/2:o.innerHeight()/2-this.$caret.outerHeight(!0)/2}}this.$caret.css(n,r)}},{key:"_watch",value:function(){var t=this;this.watching||(this.watching=!0,this.one("mouseleave blur",this.config.stops,function(){t.$caret.addClass("b-caret-slider__caret--inactive").removeClass("b-caret-slider__caret--active"),t.watching=!1}))}},{key:"destroy",value:function(){a(Object.getPrototypeOf(u.prototype),"destroy",this).call(this),this.$caret.remove()}}],[{key:"init",value:function(t,e){return new o(t,e)}}]);var u=o;return o=n({type:"black-hollow",stops:null,activeStop:null,axis:"horizontal",followFocus:!0,anchor:"centre",jqNs:"caret-slider"})(o)||o}(),t("CaretSlider",o)}}}),$__System.register("components/events/predictive-input-events.js",[],function(t){"use strict";return{setters:[],execute:function(){t("PredictiveInputEvents",{SELECT:"predictive-input:selected",TYPEAHEAD_SELECT:"typeahead:select",TYPEAHEAD_CHANGE:"typeahead:change"})}}}),$__System.registerDynamic("npm:jquery@1.11.3/dist/jquery.js",["github:jspm/nodelibs-process@0.1.2.js"],!0,function(t,e,n){"format cjs";this||self;!function(t){var e,i;e="undefined"!=typeof window?window:this,i=function(t,e){var n=[],i=n.slice,r=n.concat,o=n.push,s=n.indexOf,a={},u=a.toString,l=a.hasOwnProperty,c={},f=function(t,e){return new f.fn.init(t,e)},h=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,d=/-([\da-z])/gi,m=function(t,e){return e.toUpperCase()};function v(t){var e="length"in t&&t.length,n=f.type(t);return"function"!==n&&!f.isWindow(t)&&(!(1!==t.nodeType||!e)||("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t))}f.fn=f.prototype={jquery:"1.11.3",constructor:f,selector:"",length:0,toArray:function(){return i.call(this)},get:function(t){return null!=t?t<0?this[t+this.length]:this[t]:i.call(this)},pushStack:function(t){var e=f.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return f.each(this,t,e)},map:function(t){return this.pushStack(f.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:o,sort:n.sort,splice:n.splice},f.extend=f.fn.extend=function(){var t,e,n,i,r,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[a]||{},a++),"object"==typeof s||f.isFunction(s)||(s={}),a===u&&(s=this,a--);a<u;a++)if(null!=(r=arguments[a]))for(i in r)t=s[i],s!==(n=r[i])&&(l&&n&&(f.isPlainObject(n)||(e=f.isArray(n)))?(e?(e=!1,o=t&&f.isArray(t)?t:[]):o=t&&f.isPlainObject(t)?t:{},s[i]=f.extend(l,o,n)):void 0!==n&&(s[i]=n));return s},f.extend({expando:"jQuery"+("1.11.3"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===f.type(t)},isArray:Array.isArray||function(t){return"array"===f.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){return!f.isArray(t)&&t-parseFloat(t)+1>=0},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},isPlainObject:function(t){var e;if(!t||"object"!==f.type(t)||t.nodeType||f.isWindow(t))return!1;try{if(t.constructor&&!l.call(t,"constructor")&&!l.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}if(c.ownLast)for(e in t)return l.call(t,e);for(e in t);return void 0===e||l.call(t,e)},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?a[u.call(t)]||"object":typeof t},globalEval:function(e){e&&f.trim(e)&&(t.execScript||function(e){t.eval.call(t,e)})(e)},camelCase:function(t){return t.replace(p,"ms-").replace(d,m)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,n){var i=0,r=t.length,o=v(t);if(n){if(o)for(;i<r&&!1!==e.apply(t[i],n);i++);else for(i in t)if(!1===e.apply(t[i],n))break}else if(o)for(;i<r&&!1!==e.call(t[i],i,t[i]);i++);else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},trim:function(t){return null==t?"":(t+"").replace(h,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(v(Object(t))?f.merge(n,"string"==typeof t?[t]:t):o.call(n,t)),n},inArray:function(t,e,n){var i;if(e){if(s)return s.call(e,t,n);for(i=e.length,n=n?n<0?Math.max(0,i+n):n:0;n<i;n++)if(n in e&&e[n]===t)return n}return-1},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;i<n;)t[r++]=e[i++];if(n!=n)for(;void 0!==e[i];)t[r++]=e[i++];return t.length=r,t},grep:function(t,e,n){for(var i=[],r=0,o=t.length,s=!n;r<o;r++)!e(t[r],r)!==s&&i.push(t[r]);return i},map:function(t,e,n){var i,o=0,s=t.length,a=[];if(v(t))for(;o<s;o++)null!=(i=e(t[o],o,n))&&a.push(i);else for(o in t)null!=(i=e(t[o],o,n))&&a.push(i);return r.apply([],a)},guid:1,proxy:function(t,e){var n,r,o;if("string"==typeof e&&(o=t[e],e=t,t=o),f.isFunction(t))return n=i.call(arguments,2),(r=function(){return t.apply(e||this,n.concat(i.call(arguments)))}).guid=t.guid=t.guid||f.guid++,r},now:function(){return+new Date},support:c}),f.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){a["[object "+e+"]"]=e.toLowerCase()});var g=function(t){var e,n,i,r,o,s,a,u,l,c,f,h,p,d,m,v,g,y,_,b="sizzle"+1*new Date,w=t.document,k=0,S=0,x=st(),j=st(),E=st(),C=function(t,e){return t===e&&(f=!0),0},T=1<<31,O={}.hasOwnProperty,P=[],A=P.pop,D=P.push,L=P.push,N=P.slice,I=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},M="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",$="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",R=$.replace("w","w#"),H="\\["+F+"*("+$+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+F+"*\\]",B=":("+$+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+H+")*)|.*)\\)|)",W=new RegExp(F+"+","g"),Y=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),V=new RegExp("^"+F+"*,"+F+"*"),q=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),z=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),U=new RegExp(B),G=new RegExp("^"+R+"$"),K={ID:new RegExp("^#("+$+")"),CLASS:new RegExp("^\\.("+$+")"),TAG:new RegExp("^("+$.replace("w","w*")+")"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Q=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,J=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=/'|\\/g,nt=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),it=function(t,e,n){var i="0x"+e-65536;return i!=i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},rt=function(){h()};try{L.apply(P=N.call(w.childNodes),w.childNodes),P[w.childNodes.length].nodeType}catch(t){L={apply:P.length?function(t,e){D.apply(t,N.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function ot(t,e,i,r){var o,a,l,c,f,d,g,y,k,S;if((e?e.ownerDocument||e:w)!==p&&h(e),e=e||p,i=i||[],c=e.nodeType,"string"!=typeof t||!t||1!==c&&9!==c&&11!==c)return i;if(!r&&m){if(11!==c&&(o=Z.exec(t)))if(l=o[1]){if(9===c){if(!(a=e.getElementById(l))||!a.parentNode)return i;if(a.id===l)return i.push(a),i}else if(e.ownerDocument&&(a=e.ownerDocument.getElementById(l))&&_(e,a)&&a.id===l)return i.push(a),i}else{if(o[2])return L.apply(i,e.getElementsByTagName(t)),i;if((l=o[3])&&n.getElementsByClassName)return L.apply(i,e.getElementsByClassName(l)),i}if(n.qsa&&(!v||!v.test(t))){if(y=g=b,k=e,S=1!==c&&t,1===c&&"object"!==e.nodeName.toLowerCase()){for(d=s(t),(g=e.getAttribute("id"))?y=g.replace(et,"\\$&"):e.setAttribute("id",y),y="[id='"+y+"'] ",f=d.length;f--;)d[f]=y+vt(d[f]);k=tt.test(t)&&dt(e.parentNode)||e,S=d.join(",")}if(S)try{return L.apply(i,k.querySelectorAll(S)),i}catch(t){}finally{g||e.removeAttribute("id")}}}return u(t.replace(Y,"$1"),e,i,r)}function st(){var t=[];return function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function at(t){return t[b]=!0,t}function ut(t){var e=p.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function lt(t,e){for(var n=t.split("|"),r=t.length;r--;)i.attrHandle[n[r]]=e}function ct(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||T)-(~t.sourceIndex||T);if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function ft(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function pt(t){return at(function(e){return e=+e,at(function(n,i){for(var r,o=t([],n.length,e),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))})})}function dt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=ot.support={},o=ot.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},h=ot.setDocument=function(t){var e,r,s=t?t.ownerDocument||t:w;return s!==p&&9===s.nodeType&&s.documentElement?(p=s,d=s.documentElement,(r=s.defaultView)&&r!==r.top&&(r.addEventListener?r.addEventListener("unload",rt,!1):r.attachEvent&&r.attachEvent("onunload",rt)),m=!o(s),n.attributes=ut(function(t){return t.className="i",!t.getAttribute("className")}),n.getElementsByTagName=ut(function(t){return t.appendChild(s.createComment("")),!t.getElementsByTagName("*").length}),n.getElementsByClassName=J.test(s.getElementsByClassName),n.getById=ut(function(t){return d.appendChild(t).id=b,!s.getElementsByName||!s.getElementsByName(b).length}),n.getById?(i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(t){var e=t.replace(nt,it);return function(t){return t.getAttribute("id")===e}}):(delete i.find.ID,i.filter.ID=function(t){var e=t.replace(nt,it);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(m)return e.getElementsByClassName(t)},g=[],v=[],(n.qsa=J.test(s.querySelectorAll))&&(ut(function(t){d.appendChild(t).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\f]' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+F+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||v.push("\\["+F+"*(?:value|"+M+")"),t.querySelectorAll("[id~="+b+"-]").length||v.push("~="),t.querySelectorAll(":checked").length||v.push(":checked"),t.querySelectorAll("a#"+b+"+*").length||v.push(".#.+[+~]")}),ut(function(t){var e=s.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&v.push("name"+F+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||v.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),v.push(",.*:")})),(n.matchesSelector=J.test(y=d.matches||d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(t){n.disconnectedMatch=y.call(t,"div"),y.call(t,"[s!='']:x"),g.push("!=",B)}),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),e=J.test(d.compareDocumentPosition),_=e||J.test(d.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},C=e?function(t,e){if(t===e)return f=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t===s||t.ownerDocument===w&&_(w,t)?-1:e===s||e.ownerDocument===w&&_(w,e)?1:c?I(c,t)-I(c,e):0:4&i?-1:1)}:function(t,e){if(t===e)return f=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,a=[t],u=[e];if(!r||!o)return t===s?-1:e===s?1:r?-1:o?1:c?I(c,t)-I(c,e):0;if(r===o)return ct(t,e);for(n=t;n=n.parentNode;)a.unshift(n);for(n=e;n=n.parentNode;)u.unshift(n);for(;a[i]===u[i];)i++;return i?ct(a[i],u[i]):a[i]===w?-1:u[i]===w?1:0},s):p},ot.matches=function(t,e){return ot(t,null,null,e)},ot.matchesSelector=function(t,e){if((t.ownerDocument||t)!==p&&h(t),e=e.replace(z,"='$1']"),n.matchesSelector&&m&&(!g||!g.test(e))&&(!v||!v.test(e)))try{var i=y.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return ot(e,p,null,[t]).length>0},ot.contains=function(t,e){return(t.ownerDocument||t)!==p&&h(t),_(t,e)},ot.attr=function(t,e){(t.ownerDocument||t)!==p&&h(t);var r=i.attrHandle[e.toLowerCase()],o=r&&O.call(i.attrHandle,e.toLowerCase())?r(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},ot.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},ot.uniqueSort=function(t){var e,i=[],r=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(C),f){for(;e=t[o++];)e===t[o]&&(r=i.push(o));for(;r--;)t.splice(i[r],1)}return c=null,t},r=ot.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=r(e);return n},(i=ot.selectors={cacheLength:50,createPseudo:at,match:K,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(nt,it),t[3]=(t[3]||t[4]||t[5]||"").replace(nt,it),"~="===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]||ot.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]&&ot.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return K.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&U.test(n)&&(e=s(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(nt,it).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=x[t+" "];return e||(e=new RegExp("(^|"+F+")"+t+"("+F+"|$)"))&&x(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,e,n){return function(i){var r=ot.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(W," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,u){var l,c,f,h,p,d,m=o!==s?"nextSibling":"previousSibling",v=e.parentNode,g=a&&e.nodeName.toLowerCase(),y=!u&&!a;if(v){if(o){for(;m;){for(f=e;f=f[m];)if(a?f.nodeName.toLowerCase()===g:1===f.nodeType)return!1;d=m="only"===t&&!d&&"nextSibling"}return!0}if(d=[s?v.firstChild:v.lastChild],s&&y){for(p=(l=(c=v[b]||(v[b]={}))[t]||[])[0]===k&&l[1],h=l[0]===k&&l[2],f=p&&v.childNodes[p];f=++p&&f&&f[m]||(h=p=0)||d.pop();)if(1===f.nodeType&&++h&&f===e){c[t]=[k,p,h];break}}else if(y&&(l=(e[b]||(e[b]={}))[t])&&l[0]===k)h=l[1];else for(;(f=++p&&f&&f[m]||(h=p=0)||d.pop())&&((a?f.nodeName.toLowerCase()!==g:1!==f.nodeType)||!++h||(y&&((f[b]||(f[b]={}))[t]=[k,h]),f!==e)););return(h-=r)===i||h%i==0&&h/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||ot.error("unsupported pseudo: "+t);return r[b]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?at(function(t,n){for(var i,o=r(t,e),s=o.length;s--;)t[i=I(t,o[s])]=!(n[i]=o[s])}):function(t){return r(t,0,n)}):r}},pseudos:{not:at(function(t){var e=[],n=[],i=a(t.replace(Y,"$1"));return i[b]?at(function(t,e,n,r){for(var o,s=i(t,null,r,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))}):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}}),has:at(function(t){return function(e){return ot(t,e).length>0}}),contains:at(function(t){return t=t.replace(nt,it),function(e){return(e.textContent||e.innerText||r(e)).indexOf(t)>-1}}),lang:at(function(t){return G.test(t||"")||ot.error("unsupported lang: "+t),t=t.replace(nt,it).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===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===d},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},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,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return X.test(t.nodeName)},input:function(t){return Q.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:pt(function(){return[0]}),last:pt(function(t,e){return[e-1]}),eq:pt(function(t,e,n){return[n<0?n+e:n]}),even:pt(function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t}),odd:pt(function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t}),lt:pt(function(t,e,n){for(var i=n<0?n+e:n;--i>=0;)t.push(i);return t}),gt:pt(function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t})}}).pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[e]=ft(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=ht(e);function mt(){}function vt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function gt(t,e,n){var i=e.dir,r=n&&"parentNode"===i,o=S++;return e.first?function(e,n,o){for(;e=e[i];)if(1===e.nodeType||r)return t(e,n,o)}:function(e,n,s){var a,u,l=[k,o];if(s){for(;e=e[i];)if((1===e.nodeType||r)&&t(e,n,s))return!0}else for(;e=e[i];)if(1===e.nodeType||r){if((a=(u=e[b]||(e[b]={}))[i])&&a[0]===k&&a[1]===o)return l[2]=a[2];if(u[i]=l,l[2]=t(e,n,s))return!0}}}function yt(t){return t.length>1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function _t(t,e,n,i,r){for(var o,s=[],a=0,u=t.length,l=null!=e;a<u;a++)(o=t[a])&&(n&&!n(o,i,r)||(s.push(o),l&&e.push(a)));return s}function bt(t,e,n,i,r,o){return i&&!i[b]&&(i=bt(i)),r&&!r[b]&&(r=bt(r,o)),at(function(o,s,a,u){var l,c,f,h=[],p=[],d=s.length,m=o||function(t,e,n){for(var i=0,r=e.length;i<r;i++)ot(t,e[i],n);return n}(e||"*",a.nodeType?[a]:a,[]),v=!t||!o&&e?m:_t(m,h,t,a,u),g=n?r||(o?t:d||i)?[]:s:v;if(n&&n(v,g,a,u),i)for(l=_t(g,p),i(l,[],a,u),c=l.length;c--;)(f=l[c])&&(g[p[c]]=!(v[p[c]]=f));if(o){if(r||t){if(r){for(l=[],c=g.length;c--;)(f=g[c])&&l.push(v[c]=f);r(null,g=[],l,u)}for(c=g.length;c--;)(f=g[c])&&(l=r?I(o,f):h[c])>-1&&(o[l]=!(s[l]=f))}}else g=_t(g===s?g.splice(d,g.length):g),r?r(null,s,g,u):L.apply(s,g)})}function wt(t){for(var e,n,r,o=t.length,s=i.relative[t[0].type],a=s||i.relative[" "],u=s?1:0,c=gt(function(t){return t===e},a,!0),f=gt(function(t){return I(e,t)>-1},a,!0),h=[function(t,n,i){var r=!s&&(i||n!==l)||((e=n).nodeType?c(t,n,i):f(t,n,i));return e=null,r}];u<o;u++)if(n=i.relative[t[u].type])h=[gt(yt(h),n)];else{if((n=i.filter[t[u].type].apply(null,t[u].matches))[b]){for(r=++u;r<o&&!i.relative[t[r].type];r++);return bt(u>1&&yt(h),u>1&&vt(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(Y,"$1"),n,u<r&&wt(t.slice(u,r)),r<o&&wt(t=t.slice(r)),r<o&&vt(t))}h.push(n)}return yt(h)}return mt.prototype=i.filters=i.pseudos,i.setFilters=new mt,s=ot.tokenize=function(t,e){var n,r,o,s,a,u,l,c=j[t+" "];if(c)return e?0:c.slice(0);for(a=t,u=[],l=i.preFilter;a;){for(s in n&&!(r=V.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=q.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(Y," ")}),a=a.slice(n.length)),i.filter)!(r=K[s].exec(a))||l[s]&&!(r=l[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return e?a.length:a?ot.error(t):j(t,u).slice(0)},a=ot.compile=function(t,e){var n,r=[],o=[],a=E[t+" "];if(!a){for(e||(e=s(t)),n=e.length;n--;)(a=wt(e[n]))[b]?r.push(a):o.push(a);(a=E(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,s,a,u,c){var f,h,d,m=0,v="0",g=o&&[],y=[],_=l,b=o||r&&i.find.TAG("*",c),w=k+=null==_?1:Math.random()||.1,S=b.length;for(c&&(l=s!==p&&s);v!==S&&null!=(f=b[v]);v++){if(r&&f){for(h=0;d=t[h++];)if(d(f,s,a)){u.push(f);break}c&&(k=w)}n&&((f=!d&&f)&&m--,o&&g.push(f))}if(m+=v,n&&v!==m){for(h=0;d=e[h++];)d(g,y,s,a);if(o){if(m>0)for(;v--;)g[v]||y[v]||(y[v]=A.call(u));y=_t(y)}L.apply(u,y),c&&!o&&y.length>0&&m+e.length>1&&ot.uniqueSort(u)}return c&&(k=w,l=_),g};return n?at(o):o}(o,r))).selector=t}return a},u=ot.select=function(t,e,r,o){var u,l,c,f,h,p="function"==typeof t&&t,d=!o&&s(t=p.selector||t);if(r=r||[],1===d.length){if((l=d[0]=d[0].slice(0)).length>2&&"ID"===(c=l[0]).type&&n.getById&&9===e.nodeType&&m&&i.relative[l[1].type]){if(!(e=(i.find.ID(c.matches[0].replace(nt,it),e)||[])[0]))return r;p&&(e=e.parentNode),t=t.slice(l.shift().value.length)}for(u=K.needsContext.test(t)?0:l.length;u--&&(c=l[u],!i.relative[f=c.type]);)if((h=i.find[f])&&(o=h(c.matches[0].replace(nt,it),tt.test(l[0].type)&&dt(e.parentNode)||e))){if(l.splice(u,1),!(t=o.length&&vt(l)))return L.apply(r,o),r;break}}return(p||a(t,d))(o,e,!m,r,tt.test(t)&&dt(e.parentNode)||e),r},n.sortStable=b.split("").sort(C).join("")===b,n.detectDuplicates=!!f,h(),n.sortDetached=ut(function(t){return 1&t.compareDocumentPosition(p.createElement("div"))}),ut(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||lt("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),n.attributes&&ut(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||lt("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),ut(function(t){return null==t.getAttribute("disabled")})||lt(M,function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),ot}(t);f.find=g,f.expr=g.selectors,f.expr[":"]=f.expr.pseudos,f.unique=g.uniqueSort,f.text=g.getText,f.isXMLDoc=g.isXML,f.contains=g.contains;var y=f.expr.match.needsContext,_=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,b=/^.[^:#\[\.,]*$/;function w(t,e,n){if(f.isFunction(e))return f.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return f.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(b.test(e))return f.filter(e,t,n);e=f.filter(e,t)}return f.grep(t,function(t){return f.inArray(t,e)>=0!==n})}f.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?f.find.matchesSelector(i,t)?[i]:[]:f.find.matches(t,f.grep(e,function(t){return 1===t.nodeType}))},f.fn.extend({find:function(t){var e,n=[],i=this,r=i.length;if("string"!=typeof t)return this.pushStack(f(t).filter(function(){for(e=0;e<r;e++)if(f.contains(i[e],this))return!0}));for(e=0;e<r;e++)f.find(t,i[e],n);return(n=this.pushStack(r>1?f.unique(n):n)).selector=this.selector?this.selector+" "+t:t,n},filter:function(t){return this.pushStack(w(this,t||[],!1))},not:function(t){return this.pushStack(w(this,t||[],!0))},is:function(t){return!!w(this,"string"==typeof t&&y.test(t)?f(t):t||[],!1).length}});var k,S=t.document,x=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(f.fn.init=function(t,e){var n,i;if(!t)return this;if("string"==typeof t){if(!(n="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:x.exec(t))||!n[1]&&e)return!e||e.jquery?(e||k).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof f?e[0]:e,f.merge(this,f.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:S,!0)),_.test(n[1])&&f.isPlainObject(e))for(n in e)f.isFunction(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}if((i=S.getElementById(n[2]))&&i.parentNode){if(i.id!==n[2])return k.find(t);this.length=1,this[0]=i}return this.context=S,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):f.isFunction(t)?void 0!==k.ready?k.ready(t):t(f):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),f.makeArray(t,this))}).prototype=f.fn,k=f(S);var j=/^(?:parents|prev(?:Until|All))/,E={children:!0,contents:!0,next:!0,prev:!0};function C(t,e){do{t=t[e]}while(t&&1!==t.nodeType);return t}f.extend({dir:function(t,e,n){for(var i=[],r=t[e];r&&9!==r.nodeType&&(void 0===n||1!==r.nodeType||!f(r).is(n));)1===r.nodeType&&i.push(r),r=r[e];return i},sibling:function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n}}),f.fn.extend({has:function(t){var e,n=f(t,this),i=n.length;return this.filter(function(){for(e=0;e<i;e++)if(f.contains(this,n[e]))return!0})},closest:function(t,e){for(var n,i=0,r=this.length,o=[],s=y.test(t)||"string"!=typeof t?f(t,e||this.context):0;i<r;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&f.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?f.unique(o):o)},index:function(t){return t?"string"==typeof t?f.inArray(this[0],f(t)):f.inArray(t.jquery?t[0]:t,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(f.unique(f.merge(this.get(),f(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),f.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return f.dir(t,"parentNode")},parentsUntil:function(t,e,n){return f.dir(t,"parentNode",n)},next:function(t){return C(t,"nextSibling")},prev:function(t){return C(t,"previousSibling")},nextAll:function(t){return f.dir(t,"nextSibling")},prevAll:function(t){return f.dir(t,"previousSibling")},nextUntil:function(t,e,n){return f.dir(t,"nextSibling",n)},prevUntil:function(t,e,n){return f.dir(t,"previousSibling",n)},siblings:function(t){return f.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return f.sibling(t.firstChild)},contents:function(t){return f.nodeName(t,"iframe")?t.contentDocument||t.contentWindow.document:f.merge([],t.childNodes)}},function(t,e){f.fn[t]=function(n,i){var r=f.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=f.filter(i,r)),this.length>1&&(E[t]||(r=f.unique(r)),j.test(t)&&(r=r.reverse())),this.pushStack(r)}});var T,O=/\S+/g,P={};function A(){S.addEventListener?(S.removeEventListener("DOMContentLoaded",D,!1),t.removeEventListener("load",D,!1)):(S.detachEvent("onreadystatechange",D),t.detachEvent("onload",D))}function D(){(S.addEventListener||"load"===event.type||"complete"===S.readyState)&&(A(),f.ready())}f.Callbacks=function(t){var e,n,i,r,o,s,a=[],u=!(t="string"==typeof t?P[t]||function(t){var e=P[t]={};return f.each(t.match(O)||[],function(t,n){e[n]=!0}),e}(t):f.extend({},t)).once&&[],l=function(f){for(n=t.memory&&f,i=!0,o=s||0,s=0,r=a.length,e=!0;a&&o<r;o++)if(!1===a[o].apply(f[0],f[1])&&t.stopOnFalse){n=!1;break}e=!1,a&&(u?u.length&&l(u.shift()):n?a=[]:c.disable())},c={add:function(){if(a){var i=a.length;!function e(n){f.each(n,function(n,i){var r=f.type(i);"function"===r?t.unique&&c.has(i)||a.push(i):i&&i.length&&"string"!==r&&e(i)})}(arguments),e?r=a.length:n&&(s=i,l(n))}return this},remove:function(){return a&&f.each(arguments,function(t,n){for(var i;(i=f.inArray(n,a,i))>-1;)a.splice(i,1),e&&(i<=r&&r--,i<=o&&o--)}),this},has:function(t){return t?f.inArray(t,a)>-1:!(!a||!a.length)},empty:function(){return a=[],r=0,this},disable:function(){return a=u=n=void 0,this},disabled:function(){return!a},lock:function(){return u=void 0,n||c.disable(),this},locked:function(){return!u},fireWith:function(t,n){return!a||i&&!u||(n=[t,(n=n||[]).slice?n.slice():n],e?u.push(n):l(n)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},f.extend({Deferred:function(t){var e=[["resolve","done",f.Callbacks("once memory"),"resolved"],["reject","fail",f.Callbacks("once memory"),"rejected"],["notify","progress",f.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var t=arguments;return f.Deferred(function(n){f.each(e,function(e,o){var s=f.isFunction(t[e])&&t[e];r[o[1]](function(){var t=s&&s.apply(this,arguments);t&&f.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[o[0]+"With"](this===i?n.promise():this,s?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?f.extend(t,i):i}},r={};return i.pipe=i.then,f.each(e,function(t,o){var s=o[2],a=o[3];i[o[1]]=s.add,a&&s.add(function(){n=a},e[1^t][2].disable,e[2][2].lock),r[o[0]]=function(){return r[o[0]+"With"](this===r?i:this,arguments),this},r[o[0]+"With"]=s.fireWith}),i.promise(r),t&&t.call(r,r),r},when:function(t){var e,n,r,o=0,s=i.call(arguments),a=s.length,u=1!==a||t&&f.isFunction(t.promise)?a:0,l=1===u?t:f.Deferred(),c=function(t,n,r){return function(o){n[t]=this,r[t]=arguments.length>1?i.call(arguments):o,r===e?l.notifyWith(n,r):--u||l.resolveWith(n,r)}};if(a>1)for(e=new Array(a),n=new Array(a),r=new Array(a);o<a;o++)s[o]&&f.isFunction(s[o].promise)?s[o].promise().done(c(o,r,s)).fail(l.reject).progress(c(o,n,e)):--u;return u||l.resolveWith(r,s),l.promise()}}),f.fn.ready=function(t){return f.ready.promise().done(t),this},f.extend({isReady:!1,readyWait:1,holdReady:function(t){t?f.readyWait++:f.ready(!0)},ready:function(t){if(!0===t?!--f.readyWait:!f.isReady){if(!S.body)return setTimeout(f.ready);f.isReady=!0,!0!==t&&--f.readyWait>0||(T.resolveWith(S,[f]),f.fn.triggerHandler&&(f(S).triggerHandler("ready"),f(S).off("ready")))}}}),f.ready.promise=function(e){if(!T)if(T=f.Deferred(),"complete"===S.readyState)setTimeout(f.ready);else if(S.addEventListener)S.addEventListener("DOMContentLoaded",D,!1),t.addEventListener("load",D,!1);else{S.attachEvent("onreadystatechange",D),t.attachEvent("onload",D);var n=!1;try{n=null==t.frameElement&&S.documentElement}catch(t){}n&&n.doScroll&&function t(){if(!f.isReady){try{n.doScroll("left")}catch(e){return setTimeout(t,50)}A(),f.ready()}}()}return T.promise(e)};var L,N="undefined";for(L in f(c))break;c.ownLast="0"!==L,c.inlineBlockNeedsLayout=!1,f(function(){var t,e,n,i;(n=S.getElementsByTagName("body")[0])&&n.style&&(e=S.createElement("div"),(i=S.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(e),typeof e.style.zoom!==N&&(e.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",c.inlineBlockNeedsLayout=t=3===e.offsetWidth,t&&(n.style.zoom=1)),n.removeChild(i))}),function(){var t=S.createElement("div");if(null==c.deleteExpando){c.deleteExpando=!0;try{delete t.test}catch(t){c.deleteExpando=!1}}t=null}(),f.acceptData=function(t){var e=f.noData[(t.nodeName+" ").toLowerCase()],n=+t.nodeType||1;return(1===n||9===n)&&(!e||!0!==e&&t.getAttribute("classid")===e)};var I=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,M=/([A-Z])/g;function F(t,e,n){if(void 0===n&&1===t.nodeType){var i="data-"+e.replace(M,"-$1").toLowerCase();if("string"==typeof(n=t.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:I.test(n)?f.parseJSON(n):n)}catch(t){}f.data(t,e,n)}else n=void 0}return n}function $(t){var e;for(e in t)if(("data"!==e||!f.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}function R(t,e,i,r){if(f.acceptData(t)){var o,s,a=f.expando,u=t.nodeType,l=u?f.cache:t,c=u?t[a]:t[a]&&a;if(c&&l[c]&&(r||l[c].data)||void 0!==i||"string"!=typeof e)return c||(c=u?t[a]=n.pop()||f.guid++:a),l[c]||(l[c]=u?{}:{toJSON:f.noop}),"object"!=typeof e&&"function"!=typeof e||(r?l[c]=f.extend(l[c],e):l[c].data=f.extend(l[c].data,e)),s=l[c],r||(s.data||(s.data={}),s=s.data),void 0!==i&&(s[f.camelCase(e)]=i),"string"==typeof e?null==(o=s[e])&&(o=s[f.camelCase(e)]):o=s,o}}function H(t,e,n){if(f.acceptData(t)){var i,r,o=t.nodeType,s=o?f.cache:t,a=o?t[f.expando]:f.expando;if(s[a]){if(e&&(i=n?s[a]:s[a].data)){r=(e=f.isArray(e)?e.concat(f.map(e,f.camelCase)):e in i?[e]:(e=f.camelCase(e))in i?[e]:e.split(" ")).length;for(;r--;)delete i[e[r]];if(n?!$(i):!f.isEmptyObject(i))return}(n||(delete s[a].data,$(s[a])))&&(o?f.cleanData([t],!0):c.deleteExpando||s!=s.window?delete s[a]:s[a]=null)}}}f.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(t){return!!(t=t.nodeType?f.cache[t[f.expando]]:t[f.expando])&&!$(t)},data:function(t,e,n){return R(t,e,n)},removeData:function(t,e){return H(t,e)},_data:function(t,e,n){return R(t,e,n,!0)},_removeData:function(t,e){return H(t,e,!0)}}),f.fn.extend({data:function(t,e){var n,i,r,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(r=f.data(o),1===o.nodeType&&!f._data(o,"parsedAttrs"))){for(n=s.length;n--;)s[n]&&0===(i=s[n].name).indexOf("data-")&&F(o,i=f.camelCase(i.slice(5)),r[i]);f._data(o,"parsedAttrs",!0)}return r}return"object"==typeof t?this.each(function(){f.data(this,t)}):arguments.length>1?this.each(function(){f.data(this,t,e)}):o?F(o,t,f.data(o,t)):void 0},removeData:function(t){return this.each(function(){f.removeData(this,t)})}}),f.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=f._data(t,e),n&&(!i||f.isArray(n)?i=f._data(t,e,f.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=f.queue(t,e),i=n.length,r=n.shift(),o=f._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,function(){f.dequeue(t,e)},o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return f._data(t,n)||f._data(t,n,{empty:f.Callbacks("once memory").add(function(){f._removeData(t,e+"queue"),f._removeData(t,n)})})}}),f.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?f.queue(this[0],t):void 0===e?this:this.each(function(){var n=f.queue(this,t,e);f._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&f.dequeue(this,t)})},dequeue:function(t){return this.each(function(){f.dequeue(this,t)})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=f.Deferred(),o=this,s=this.length,a=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=f._data(o[s],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(e)}});var B=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,W=["Top","Right","Bottom","Left"],Y=function(t,e){return t=e||t,"none"===f.css(t,"display")||!f.contains(t.ownerDocument,t)},V=f.access=function(t,e,n,i,r,o,s){var a=0,u=t.length,l=null==n;if("object"===f.type(n))for(a in r=!0,n)f.access(t,e,a,n[a],!0,o,s);else if(void 0!==i&&(r=!0,f.isFunction(i)||(s=!0),l&&(s?(e.call(t,i),e=null):(l=e,e=function(t,e,n){return l.call(f(t),n)})),e))for(;a<u;a++)e(t[a],n,s?i:i.call(t[a],a,e(t[a],n)));return r?t:l?e.call(t):u?e(t[0],n):o},q=/^(?:checkbox|radio)$/i;!function(){var t=S.createElement("input"),e=S.createElement("div"),n=S.createDocumentFragment();if(e.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",c.leadingWhitespace=3===e.firstChild.nodeType,c.tbody=!e.getElementsByTagName("tbody").length,c.htmlSerialize=!!e.getElementsByTagName("link").length,c.html5Clone="<:nav></:nav>"!==S.createElement("nav").cloneNode(!0).outerHTML,t.type="checkbox",t.checked=!0,n.appendChild(t),c.appendChecked=t.checked,e.innerHTML="<textarea>x</textarea>",c.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue,n.appendChild(e),e.innerHTML="<input type='radio' checked='checked' name='t'/>",c.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,c.noCloneEvent=!0,e.attachEvent&&(e.attachEvent("onclick",function(){c.noCloneEvent=!1}),e.cloneNode(!0).click()),null==c.deleteExpando){c.deleteExpando=!0;try{delete e.test}catch(t){c.deleteExpando=!1}}}(),function(){var e,n,i=S.createElement("div");for(e in{submit:!0,change:!0,focusin:!0})n="on"+e,(c[e+"Bubbles"]=n in t)||(i.setAttribute(n,"t"),c[e+"Bubbles"]=!1===i.attributes[n].expando);i=null}();var z=/^(?:input|select|textarea)$/i,U=/^key/,G=/^(?:mouse|pointer|contextmenu)|click/,K=/^(?:focusinfocus|focusoutblur)$/,Q=/^([^.]*)(?:\.(.+)|)$/;function X(){return!0}function J(){return!1}function Z(){try{return S.activeElement}catch(t){}}function tt(t){var e=et.split("|"),n=t.createDocumentFragment();if(n.createElement)for(;e.length;)n.createElement(e.pop());return n}f.event={global:{},add:function(t,e,n,i,r){var o,s,a,u,l,c,h,p,d,m,v,g=f._data(t);if(g){for(n.handler&&(n=(u=n).handler,r=u.selector),n.guid||(n.guid=f.guid++),(s=g.events)||(s=g.events={}),(c=g.handle)||((c=g.handle=function(t){return typeof f===N||t&&f.event.triggered===t.type?void 0:f.event.dispatch.apply(c.elem,arguments)}).elem=t),a=(e=(e||"").match(O)||[""]).length;a--;)d=v=(o=Q.exec(e[a])||[])[1],m=(o[2]||"").split(".").sort(),d&&(l=f.event.special[d]||{},d=(r?l.delegateType:l.bindType)||d,l=f.event.special[d]||{},h=f.extend({type:d,origType:v,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&f.expr.match.needsContext.test(r),namespace:m.join(".")},u),(p=s[d])||((p=s[d]=[]).delegateCount=0,l.setup&&!1!==l.setup.call(t,i,m,c)||(t.addEventListener?t.addEventListener(d,c,!1):t.attachEvent&&t.attachEvent("on"+d,c))),l.add&&(l.add.call(t,h),h.handler.guid||(h.handler.guid=n.guid)),r?p.splice(p.delegateCount++,0,h):p.push(h),f.event.global[d]=!0);t=null}},remove:function(t,e,n,i,r){var o,s,a,u,l,c,h,p,d,m,v,g=f.hasData(t)&&f._data(t);if(g&&(c=g.events)){for(l=(e=(e||"").match(O)||[""]).length;l--;)if(d=v=(a=Q.exec(e[l])||[])[1],m=(a[2]||"").split(".").sort(),d){for(h=f.event.special[d]||{},p=c[d=(i?h.delegateType:h.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=p.length;o--;)s=p[o],!r&&v!==s.origType||n&&n.guid!==s.guid||a&&!a.test(s.namespace)||i&&i!==s.selector&&("**"!==i||!s.selector)||(p.splice(o,1),s.selector&&p.delegateCount--,h.remove&&h.remove.call(t,s));u&&!p.length&&(h.teardown&&!1!==h.teardown.call(t,m,g.handle)||f.removeEvent(t,d,g.handle),delete c[d])}else for(d in c)f.event.remove(t,d+e[l],n,i,!0);f.isEmptyObject(c)&&(delete g.handle,f._removeData(t,"events"))}},trigger:function(e,n,i,r){var o,s,a,u,c,h,p,d=[i||S],m=l.call(e,"type")?e.type:e,v=l.call(e,"namespace")?e.namespace.split("."):[];if(a=h=i=i||S,3!==i.nodeType&&8!==i.nodeType&&!K.test(m+f.event.triggered)&&(m.indexOf(".")>=0&&(m=(v=m.split(".")).shift(),v.sort()),s=m.indexOf(":")<0&&"on"+m,(e=e[f.expando]?e:new f.Event(m,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=v.join("."),e.namespace_re=e.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=i),n=null==n?[e]:f.makeArray(n,[e]),c=f.event.special[m]||{},r||!c.trigger||!1!==c.trigger.apply(i,n))){if(!r&&!c.noBubble&&!f.isWindow(i)){for(u=c.delegateType||m,K.test(u+m)||(a=a.parentNode);a;a=a.parentNode)d.push(a),h=a;h===(i.ownerDocument||S)&&d.push(h.defaultView||h.parentWindow||t)}for(p=0;(a=d[p++])&&!e.isPropagationStopped();)e.type=p>1?u:c.bindType||m,(o=(f._data(a,"events")||{})[e.type]&&f._data(a,"handle"))&&o.apply(a,n),(o=s&&a[s])&&o.apply&&f.acceptData(a)&&(e.result=o.apply(a,n),!1===e.result&&e.preventDefault());if(e.type=m,!r&&!e.isDefaultPrevented()&&(!c._default||!1===c._default.apply(d.pop(),n))&&f.acceptData(i)&&s&&i[m]&&!f.isWindow(i)){(h=i[s])&&(i[s]=null),f.event.triggered=m;try{i[m]()}catch(t){}f.event.triggered=void 0,h&&(i[s]=h)}return e.result}},dispatch:function(t){t=f.event.fix(t);var e,n,r,o,s,a,u=i.call(arguments),l=(f._data(this,"events")||{})[t.type]||[],c=f.event.special[t.type]||{};if(u[0]=t,t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){for(a=f.event.handlers.call(this,t,l),e=0;(o=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,s=0;(r=o.handlers[s++])&&!t.isImmediatePropagationStopped();)t.namespace_re&&!t.namespace_re.test(r.namespace)||(t.handleObj=r,t.data=r.data,void 0!==(n=((f.event.special[r.origType]||{}).handle||r.handler).apply(o.elem,u))&&!1===(t.result=n)&&(t.preventDefault(),t.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,i,r,o,s=[],a=e.delegateCount,u=t.target;if(a&&u.nodeType&&(!t.button||"click"!==t.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(!0!==u.disabled||"click"!==t.type)){for(r=[],o=0;o<a;o++)void 0===r[n=(i=e[o]).selector+" "]&&(r[n]=i.needsContext?f(n,this).index(u)>=0:f.find(n,this,null,[u]).length),r[n]&&r.push(i);r.length&&s.push({elem:u,handlers:r})}return a<e.length&&s.push({elem:this,handlers:e.slice(a)}),s},fix:function(t){if(t[f.expando])return t;var e,n,i,r=t.type,o=t,s=this.fixHooks[r];for(s||(this.fixHooks[r]=s=G.test(r)?this.mouseHooks:U.test(r)?this.keyHooks:{}),i=s.props?this.props.concat(s.props):this.props,t=new f.Event(o),e=i.length;e--;)t[n=i[e]]=o[n];return t.target||(t.target=o.srcElement||S),3===t.target.nodeType&&(t.target=t.target.parentNode),t.metaKey=!!t.metaKey,s.filter?s.filter(t,o):t},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var n,i,r,o=e.button,s=e.fromElement;return null==t.pageX&&null!=e.clientX&&(r=(i=t.target.ownerDocument||S).documentElement,n=i.body,t.pageX=e.clientX+(r&&r.scrollLeft||n&&n.scrollLeft||0)-(r&&r.clientLeft||n&&n.clientLeft||0),t.pageY=e.clientY+(r&&r.scrollTop||n&&n.scrollTop||0)-(r&&r.clientTop||n&&n.clientTop||0)),!t.relatedTarget&&s&&(t.relatedTarget=s===t.target?e.toElement:s),t.which||void 0===o||(t.which=1&o?1:2&o?3:4&o?2:0),t}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Z()&&this.focus)try{return this.focus(),!1}catch(t){}},delegateType:"focusin"},blur:{trigger:function(){if(this===Z()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(f.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1},_default:function(t){return f.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n,i){var r=f.extend(new f.Event,n,{type:t,isSimulated:!0,originalEvent:{}});i?f.event.trigger(r,null,e):f.event.dispatch.call(e,r),r.isDefaultPrevented()&&n.preventDefault()}},f.removeEvent=S.removeEventListener?function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)}:function(t,e,n){var i="on"+e;t.detachEvent&&(typeof t[i]===N&&(t[i]=null),t.detachEvent(i,n))},f.Event=function(t,e){if(!(this instanceof f.Event))return new f.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?X:J):this.type=t,e&&f.extend(this,e),this.timeStamp=t&&t.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=X,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=X,t&&(t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0)},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=X,t&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),this.stopPropagation()}},f.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(t,e){f.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=t.relatedTarget,r=t.handleObj;return i&&(i===this||f.contains(this,i))||(t.type=r.origType,n=r.handler.apply(this,arguments),t.type=e),n}}}),c.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(t){var e=t.target,n=f.nodeName(e,"input")||f.nodeName(e,"button")?e.form:void 0;n&&!f._data(n,"submitBubbles")&&(f.event.add(n,"submit._submit",function(t){t._submit_bubble=!0}),f._data(n,"submitBubbles",!0))})},postDispatch:function(t){t._submit_bubble&&(delete t._submit_bubble,this.parentNode&&!t.isTrigger&&f.event.simulate("submit",this.parentNode,t,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),c.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName))return"checkbox"!==this.type&&"radio"!==this.type||(f.event.add(this,"propertychange._change",function(t){"checked"===t.originalEvent.propertyName&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(t){this._just_changed&&!t.isTrigger&&(this._just_changed=!1),f.event.simulate("change",this,t,!0)})),!1;f.event.add(this,"beforeactivate._change",function(t){var e=t.target;z.test(e.nodeName)&&!f._data(e,"changeBubbles")&&(f.event.add(e,"change._change",function(t){!this.parentNode||t.isSimulated||t.isTrigger||f.event.simulate("change",this.parentNode,t,!0)}),f._data(e,"changeBubbles",!0))})},handle:function(t){var e=t.target;if(this!==e||t.isSimulated||t.isTrigger||"radio"!==e.type&&"checkbox"!==e.type)return t.handleObj.handler.apply(this,arguments)},teardown:function(){return f.event.remove(this,"._change"),!z.test(this.nodeName)}}),c.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(t,e){var n=function(t){f.event.simulate(e,t.target,f.event.fix(t),!0)};f.event.special[e]={setup:function(){var i=this.ownerDocument||this,r=f._data(i,e);r||i.addEventListener(t,n,!0),f._data(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this,r=f._data(i,e)-1;r?f._data(i,e,r):(i.removeEventListener(t,n,!0),f._removeData(i,e))}}}),f.fn.extend({on:function(t,e,n,i,r){var o,s;if("object"==typeof t){for(o in"string"!=typeof e&&(n=n||e,e=void 0),t)this.on(o,e,n,t[o],r);return this}if(null==n&&null==i?(i=e,n=e=void 0):null==i&&("string"==typeof e?(i=n,n=void 0):(i=n,n=e,e=void 0)),!1===i)i=J;else if(!i)return this;return 1===r&&(s=i,(i=function(t){return f().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=f.guid++)),this.each(function(){f.event.add(this,t,i,n,e)})},one:function(t,e,n,i){return this.on(t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,f(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=J),this.each(function(){f.event.remove(this,t,n,e)})},trigger:function(t,e){return this.each(function(){f.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return f.event.trigger(t,e,n,!0)}});var et="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",nt=/ jQuery\d+="(?:null|\d+)"/g,it=new RegExp("<(?:"+et+")[\\s/>]","i"),rt=/^\s+/,ot=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,st=/<([\w:]+)/,at=/<tbody/i,ut=/<|&#?\w+;/,lt=/<(?:script|style|link)/i,ct=/checked\s*(?:[^=]|=\s*.checked.)/i,ft=/^$|\/(?:java|ecma)script/i,ht=/^true\/(.*)/,pt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,dt={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:c.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},mt=tt(S).appendChild(S.createElement("div"));function vt(t,e){var n,i,r=0,o=typeof t.getElementsByTagName!==N?t.getElementsByTagName(e||"*"):typeof t.querySelectorAll!==N?t.querySelectorAll(e||"*"):void 0;if(!o)for(o=[],n=t.childNodes||t;null!=(i=n[r]);r++)!e||f.nodeName(i,e)?o.push(i):f.merge(o,vt(i,e));return void 0===e||e&&f.nodeName(t,e)?f.merge([t],o):o}function gt(t){q.test(t.type)&&(t.defaultChecked=t.checked)}function yt(t,e){return f.nodeName(t,"table")&&f.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!==f.find.attr(t,"type"))+"/"+t.type,t}function bt(t){var e=ht.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function wt(t,e){for(var n,i=0;null!=(n=t[i]);i++)f._data(n,"globalEval",!e||f._data(e[i],"globalEval"))}function kt(t,e){if(1===e.nodeType&&f.hasData(t)){var n,i,r,o=f._data(t),s=f._data(e,o),a=o.events;if(a)for(n in delete s.handle,s.events={},a)for(i=0,r=a[n].length;i<r;i++)f.event.add(e,n,a[n][i]);s.data&&(s.data=f.extend({},s.data))}}function St(t,e){var n,i,r;if(1===e.nodeType){if(n=e.nodeName.toLowerCase(),!c.noCloneEvent&&e[f.expando]){for(i in(r=f._data(e)).events)f.removeEvent(e,i,r.handle);e.removeAttribute(f.expando)}"script"===n&&e.text!==t.text?(_t(e).text=t.text,bt(e)):"object"===n?(e.parentNode&&(e.outerHTML=t.outerHTML),c.html5Clone&&t.innerHTML&&!f.trim(e.innerHTML)&&(e.innerHTML=t.innerHTML)):"input"===n&&q.test(t.type)?(e.defaultChecked=e.checked=t.checked,e.value!==t.value&&(e.value=t.value)):"option"===n?e.defaultSelected=e.selected=t.defaultSelected:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}}dt.optgroup=dt.option,dt.tbody=dt.tfoot=dt.colgroup=dt.caption=dt.thead,dt.th=dt.td,f.extend({clone:function(t,e,n){var i,r,o,s,a,u=f.contains(t.ownerDocument,t);if(c.html5Clone||f.isXMLDoc(t)||!it.test("<"+t.nodeName+">")?o=t.cloneNode(!0):(mt.innerHTML=t.outerHTML,mt.removeChild(o=mt.firstChild)),!(c.noCloneEvent&&c.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||f.isXMLDoc(t)))for(i=vt(o),a=vt(t),s=0;null!=(r=a[s]);++s)i[s]&&St(r,i[s]);if(e)if(n)for(a=a||vt(t),i=i||vt(o),s=0;null!=(r=a[s]);s++)kt(r,i[s]);else kt(t,o);return(i=vt(o,"script")).length>0&&wt(i,!u&&vt(t,"script")),i=a=r=null,o},buildFragment:function(t,e,n,i){for(var r,o,s,a,u,l,h,p=t.length,d=tt(e),m=[],v=0;v<p;v++)if((o=t[v])||0===o)if("object"===f.type(o))f.merge(m,o.nodeType?[o]:o);else if(ut.test(o)){for(a=a||d.appendChild(e.createElement("div")),u=(st.exec(o)||["",""])[1].toLowerCase(),h=dt[u]||dt._default,a.innerHTML=h[1]+o.replace(ot,"<$1></$2>")+h[2],r=h[0];r--;)a=a.lastChild;if(!c.leadingWhitespace&&rt.test(o)&&m.push(e.createTextNode(rt.exec(o)[0])),!c.tbody)for(r=(o="table"!==u||at.test(o)?"<table>"!==h[1]||at.test(o)?0:a:a.firstChild)&&o.childNodes.length;r--;)f.nodeName(l=o.childNodes[r],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(f.merge(m,a.childNodes),a.textContent="";a.firstChild;)a.removeChild(a.firstChild);a=d.lastChild}else m.push(e.createTextNode(o));for(a&&d.removeChild(a),c.appendChecked||f.grep(vt(m,"input"),gt),v=0;o=m[v++];)if((!i||-1===f.inArray(o,i))&&(s=f.contains(o.ownerDocument,o),a=vt(d.appendChild(o),"script"),s&&wt(a),n))for(r=0;o=a[r++];)ft.test(o.type||"")&&n.push(o);return a=null,d},cleanData:function(t,e){for(var i,r,o,s,a=0,u=f.expando,l=f.cache,h=c.deleteExpando,p=f.event.special;null!=(i=t[a]);a++)if((e||f.acceptData(i))&&(s=(o=i[u])&&l[o])){if(s.events)for(r in s.events)p[r]?f.event.remove(i,r):f.removeEvent(i,r,s.handle);l[o]&&(delete l[o],h?delete i[u]:typeof i.removeAttribute!==N?i.removeAttribute(u):i[u]=null,n.push(o))}}}),f.fn.extend({text:function(t){return V(this,function(t){return void 0===t?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||S).createTextNode(t))},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||yt(this,t).appendChild(t)})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=yt(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var n,i=t?f.filter(t,this):this,r=0;null!=(n=i[r]);r++)e||1!==n.nodeType||f.cleanData(vt(n)),n.parentNode&&(e&&f.contains(n.ownerDocument,n)&&wt(vt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++){for(1===t.nodeType&&f.cleanData(vt(t,!1));t.firstChild;)t.removeChild(t.firstChild);t.options&&f.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 f.clone(this,t,e)})},html:function(t){return V(this,function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t)return 1===e.nodeType?e.innerHTML.replace(nt,""):void 0;if("string"==typeof t&&!lt.test(t)&&(c.htmlSerialize||!it.test(t))&&(c.leadingWhitespace||!rt.test(t))&&!dt[(st.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(ot,"<$1></$2>");try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&(f.cleanData(vt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)},null,t,arguments.length)},replaceWith:function(){var t=arguments[0];return this.domManip(arguments,function(e){t=this.parentNode,f.cleanData(vt(this)),t&&t.replaceChild(e,this)}),t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=r.apply([],t);var n,i,o,s,a,u,l=0,h=this.length,p=this,d=h-1,m=t[0],v=f.isFunction(m);if(v||h>1&&"string"==typeof m&&!c.checkClone&&ct.test(m))return this.each(function(n){var i=p.eq(n);v&&(t[0]=m.call(this,n,i.html())),i.domManip(t,e)});if(h&&(n=(u=f.buildFragment(t,this[0].ownerDocument,!1,this)).firstChild,1===u.childNodes.length&&(u=n),n)){for(o=(s=f.map(vt(u,"script"),_t)).length;l<h;l++)i=u,l!==d&&(i=f.clone(i,!0,!0),o&&f.merge(s,vt(i,"script"))),e.call(this[l],i,l);if(o)for(a=s[s.length-1].ownerDocument,f.map(s,bt),l=0;l<o;l++)i=s[l],ft.test(i.type||"")&&!f._data(i,"globalEval")&&f.contains(a,i)&&(i.src?f._evalUrl&&f._evalUrl(i.src):f.globalEval((i.text||i.textContent||i.innerHTML||"").replace(pt,"")));u=n=null}return this}}),f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(t,e){f.fn[t]=function(t){for(var n,i=0,r=[],s=f(t),a=s.length-1;i<=a;i++)n=i===a?this:this.clone(!0),f(s[i])[e](n),o.apply(r,n.get());return this.pushStack(r)}});var xt,jt,Et={};function Ct(e,n){var i,r=f(n.createElement(e)).appendTo(n.body),o=t.getDefaultComputedStyle&&(i=t.getDefaultComputedStyle(r[0]))?i.display:f.css(r[0],"display");return r.detach(),o}function Tt(t){var e=S,n=Et[t];return n||("none"!==(n=Ct(t,e))&&n||((e=((xt=(xt||f("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement))[0].contentWindow||xt[0].contentDocument).document).write(),e.close(),n=Ct(t,e),xt.detach()),Et[t]=n),n}c.shrinkWrapBlocks=function(){return null!=jt?jt:(jt=!1,(e=S.getElementsByTagName("body")[0])&&e.style?(t=S.createElement("div"),(n=S.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",e.appendChild(n).appendChild(t),typeof t.style.zoom!==N&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(S.createElement("div")).style.width="5px",jt=3!==t.offsetWidth),e.removeChild(n),jt):void 0);var t,e,n};var Ot,Pt,At=/^margin/,Dt=new RegExp("^("+B+")(?!px)[a-z%]+$","i"),Lt=/^(top|right|bottom|left)$/;function Nt(t,e){return{get:function(){var n=t();if(null!=n){if(!n)return(this.get=e).apply(this,arguments);delete this.get}}}}t.getComputedStyle?(Ot=function(e){return e.ownerDocument.defaultView.opener?e.ownerDocument.defaultView.getComputedStyle(e,null):t.getComputedStyle(e,null)},Pt=function(t,e,n){var i,r,o,s,a=t.style;return s=(n=n||Ot(t))?n.getPropertyValue(e)||n[e]:void 0,n&&(""!==s||f.contains(t.ownerDocument,t)||(s=f.style(t,e)),Dt.test(s)&&At.test(e)&&(i=a.width,r=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=i,a.minWidth=r,a.maxWidth=o)),void 0===s?s:s+""}):S.documentElement.currentStyle&&(Ot=function(t){return t.currentStyle},Pt=function(t,e,n){var i,r,o,s,a=t.style;return null==(s=(n=n||Ot(t))?n[e]:void 0)&&a&&a[e]&&(s=a[e]),Dt.test(s)&&!Lt.test(e)&&(i=a.left,(o=(r=t.runtimeStyle)&&r.left)&&(r.left=t.currentStyle.left),a.left="fontSize"===e?"1em":s,s=a.pixelLeft+"px",a.left=i,o&&(r.left=o)),void 0===s?s:s+""||"auto"}),function(){var e,n,i,r,o,s,a;function u(){var e,n,i,u;(n=S.getElementsByTagName("body")[0])&&n.style&&(e=S.createElement("div"),(i=S.createElement("div")).style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(e),e.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",r=o=!1,a=!0,t.getComputedStyle&&(r="1%"!==(t.getComputedStyle(e,null)||{}).top,o="4px"===(t.getComputedStyle(e,null)||{width:"4px"}).width,(u=e.appendChild(S.createElement("div"))).style.cssText=e.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",u.style.marginRight=u.style.width="0",e.style.width="1px",a=!parseFloat((t.getComputedStyle(u,null)||{}).marginRight),e.removeChild(u)),e.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(u=e.getElementsByTagName("td"))[0].style.cssText="margin:0;border:0;padding:0;display:none",(s=0===u[0].offsetHeight)&&(u[0].style.display="",u[1].style.display="none",s=0===u[0].offsetHeight),n.removeChild(i))}(e=S.createElement("div")).innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",(n=(i=e.getElementsByTagName("a")[0])&&i.style)&&(n.cssText="float:left;opacity:.5",c.opacity="0.5"===n.opacity,c.cssFloat=!!n.cssFloat,e.style.backgroundClip="content-box",e.cloneNode(!0).style.backgroundClip="",c.clearCloneStyle="content-box"===e.style.backgroundClip,c.boxSizing=""===n.boxSizing||""===n.MozBoxSizing||""===n.WebkitBoxSizing,f.extend(c,{reliableHiddenOffsets:function(){return null==s&&u(),s},boxSizingReliable:function(){return null==o&&u(),o},pixelPosition:function(){return null==r&&u(),r},reliableMarginRight:function(){return null==a&&u(),a}}))}(),f.swap=function(t,e,n,i){var r,o,s={};for(o in e)s[o]=t.style[o],t.style[o]=e[o];for(o in r=n.apply(t,i||[]),e)t.style[o]=s[o];return r};var It=/alpha\([^)]*\)/i,Mt=/opacity\s*=\s*([^)]*)/,Ft=/^(none|table(?!-c[ea]).+)/,$t=new RegExp("^("+B+")(.*)$","i"),Rt=new RegExp("^([+-])=("+B+")","i"),Ht={position:"absolute",visibility:"hidden",display:"block"},Bt={letterSpacing:"0",fontWeight:"400"},Wt=["Webkit","O","Moz","ms"];function Yt(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),i=e,r=Wt.length;r--;)if((e=Wt[r]+n)in t)return e;return i}function Vt(t,e){for(var n,i,r,o=[],s=0,a=t.length;s<a;s++)(i=t[s]).style&&(o[s]=f._data(i,"olddisplay"),n=i.style.display,e?(o[s]||"none"!==n||(i.style.display=""),""===i.style.display&&Y(i)&&(o[s]=f._data(i,"olddisplay",Tt(i.nodeName)))):(r=Y(i),(n&&"none"!==n||!r)&&f._data(i,"olddisplay",r?n:f.css(i,"display"))));for(s=0;s<a;s++)(i=t[s]).style&&(e&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=e?o[s]||"":"none"));return t}function qt(t,e,n){var i=$t.exec(e);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):e}function zt(t,e,n,i,r){for(var o=n===(i?"border":"content")?4:"width"===e?1:0,s=0;o<4;o+=2)"margin"===n&&(s+=f.css(t,n+W[o],!0,r)),i?("content"===n&&(s-=f.css(t,"padding"+W[o],!0,r)),"margin"!==n&&(s-=f.css(t,"border"+W[o]+"Width",!0,r))):(s+=f.css(t,"padding"+W[o],!0,r),"padding"!==n&&(s+=f.css(t,"border"+W[o]+"Width",!0,r)));return s}function Ut(t,e,n){var i=!0,r="width"===e?t.offsetWidth:t.offsetHeight,o=Ot(t),s=c.boxSizing&&"border-box"===f.css(t,"boxSizing",!1,o);if(r<=0||null==r){if(((r=Pt(t,e,o))<0||null==r)&&(r=t.style[e]),Dt.test(r))return r;i=s&&(c.boxSizingReliable()||r===t.style[e]),r=parseFloat(r)||0}return r+zt(t,e,n||(s?"border":"content"),i,o)+"px"}function Gt(t,e,n,i,r){return new Gt.prototype.init(t,e,n,i,r)}f.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=Pt(t,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:c.cssFloat?"cssFloat":"styleFloat"},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=f.camelCase(e),u=t.style;if(e=f.cssProps[a]||(f.cssProps[a]=Yt(u,a)),s=f.cssHooks[e]||f.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(t,!1,i))?r:u[e];if("string"===(o=typeof n)&&(r=Rt.exec(n))&&(n=(r[1]+1)*r[2]+parseFloat(f.css(t,e)),o="number"),null!=n&&n==n&&("number"!==o||f.cssNumber[a]||(n+="px"),c.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),!(s&&"set"in s&&void 0===(n=s.set(t,n,i)))))try{u[e]=n}catch(t){}}},css:function(t,e,n,i){var r,o,s,a=f.camelCase(e);return e=f.cssProps[a]||(f.cssProps[a]=Yt(t.style,a)),(s=f.cssHooks[e]||f.cssHooks[a])&&"get"in s&&(o=s.get(t,!0,n)),void 0===o&&(o=Pt(t,e,i)),"normal"===o&&e in Bt&&(o=Bt[e]),""===n||n?(r=parseFloat(o),!0===n||f.isNumeric(r)?r||0:o):o}}),f.each(["height","width"],function(t,e){f.cssHooks[e]={get:function(t,n,i){if(n)return Ft.test(f.css(t,"display"))&&0===t.offsetWidth?f.swap(t,Ht,function(){return Ut(t,e,i)}):Ut(t,e,i)},set:function(t,n,i){var r=i&&Ot(t);return qt(0,n,i?zt(t,e,i,c.boxSizing&&"border-box"===f.css(t,"boxSizing",!1,r),r):0)}}}),c.opacity||(f.cssHooks.opacity={get:function(t,e){return Mt.test((e&&t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":e?"1":""},set:function(t,e){var n=t.style,i=t.currentStyle,r=f.isNumeric(e)?"alpha(opacity="+100*e+")":"",o=i&&i.filter||n.filter||"";n.zoom=1,(e>=1||""===e)&&""===f.trim(o.replace(It,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===e||i&&!i.filter)||(n.filter=It.test(o)?o.replace(It,r):o+" "+r)}}),f.cssHooks.marginRight=Nt(c.reliableMarginRight,function(t,e){if(e)return f.swap(t,{display:"inline-block"},Pt,[t,"marginRight"])}),f.each({margin:"",padding:"",border:"Width"},function(t,e){f.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+W[i]+e]=o[i]||o[i-2]||o[0];return r}},At.test(t)||(f.cssHooks[t+e].set=qt)}),f.fn.extend({css:function(t,e){return V(this,function(t,e,n){var i,r,o={},s=0;if(f.isArray(e)){for(i=Ot(t),r=e.length;s<r;s++)o[e[s]]=f.css(t,e[s],!1,i);return o}return void 0!==n?f.style(t,e,n):f.css(t,e)},t,e,arguments.length>1)},show:function(){return Vt(this,!0)},hide:function(){return Vt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Y(this)?f(this).show():f(this).hide()})}}),f.Tween=Gt,Gt.prototype={constructor:Gt,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||"swing",this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(f.cssNumber[n]?"":"px")},cur:function(){var t=Gt.propHooks[this.prop];return t&&t.get?t.get(this):Gt.propHooks._default.get(this)},run:function(t){var e,n=Gt.propHooks[this.prop];return this.options.duration?this.pos=e=f.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):Gt.propHooks._default.set(this),this}},Gt.prototype.init.prototype=Gt.prototype,Gt.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=f.css(t.elem,t.prop,""))&&"auto"!==e?e:0:t.elem[t.prop]},set:function(t){f.fx.step[t.prop]?f.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[f.cssProps[t.prop]]||f.cssHooks[t.prop])?f.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},Gt.propHooks.scrollTop=Gt.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},f.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},f.fx=Gt.prototype.init,f.fx.step={};var Kt,Qt,Xt,Jt,Zt,te,ee,ne=/^(?:toggle|show|hide)$/,ie=new RegExp("^(?:([+-])=|)("+B+")([a-z%]*)$","i"),re=/queueHooks$/,oe=[function(t,e,n){var i,r,o,s,a,u,l,h=this,p={},d=t.style,m=t.nodeType&&Y(t),v=f._data(t,"fxshow");n.queue||(null==(a=f._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,u=a.empty.fire,a.empty.fire=function(){a.unqueued||u()}),a.unqueued++,h.always(function(){h.always(function(){a.unqueued--,f.queue(t,"fx").length||a.empty.fire()})}));1===t.nodeType&&("height"in e||"width"in e)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],l=f.css(t,"display"),"inline"===("none"===l?f._data(t,"olddisplay")||Tt(t.nodeName):l)&&"none"===f.css(t,"float")&&(c.inlineBlockNeedsLayout&&"inline"!==Tt(t.nodeName)?d.zoom=1:d.display="inline-block"));n.overflow&&(d.overflow="hidden",c.shrinkWrapBlocks()||h.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in e)if(r=e[i],ne.exec(r)){if(delete e[i],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!v||void 0===v[i])continue;m=!0}p[i]=v&&v[i]||f.style(t,i)}else l=void 0;if(f.isEmptyObject(p))"inline"===("none"===l?Tt(t.nodeName):l)&&(d.display=l);else for(i in v?"hidden"in v&&(m=v.hidden):v=f._data(t,"fxshow",{}),o&&(v.hidden=!m),m?f(t).show():h.done(function(){f(t).hide()}),h.done(function(){var e;for(e in f._removeData(t,"fxshow"),p)f.style(t,e,p[e])}),p)s=le(m?v[i]:0,i,h),i in v||(v[i]=s.start,m&&(s.end=s.start,s.start="width"===i||"height"===i?1:0))}],se={"*":[function(t,e){var n=this.createTween(t,e),i=n.cur(),r=ie.exec(e),o=r&&r[3]||(f.cssNumber[t]?"":"px"),s=(f.cssNumber[t]||"px"!==o&&+i)&&ie.exec(f.css(n.elem,t)),a=1,u=20;if(s&&s[3]!==o){o=o||s[3],r=r||[],s=+i||1;do{s/=a=a||".5",f.style(n.elem,t,s+o)}while(a!==(a=n.cur()/i)&&1!==a&&--u)}return r&&(s=n.start=+s||+i||0,n.unit=o,n.end=r[1]?s+(r[1]+1)*r[2]:+r[2]),n}]};function ae(){return setTimeout(function(){Kt=void 0}),Kt=f.now()}function ue(t,e){var n,i={height:t},r=0;for(e=e?1:0;r<4;r+=2-e)i["margin"+(n=W[r])]=i["padding"+n]=t;return e&&(i.opacity=i.width=t),i}function le(t,e,n){for(var i,r=(se[e]||[]).concat(se["*"]),o=0,s=r.length;o<s;o++)if(i=r[o].call(n,e,t))return i}function ce(t,e,n){var i,r,o=0,s=oe.length,a=f.Deferred().always(function(){delete u.elem}),u=function(){if(r)return!1;for(var e=Kt||ae(),n=Math.max(0,l.startTime+l.duration-e),i=1-(n/l.duration||0),o=0,s=l.tweens.length;o<s;o++)l.tweens[o].run(i);return a.notifyWith(t,[l,i,n]),i<1&&s?n:(a.resolveWith(t,[l]),!1)},l=a.promise({elem:t,props:f.extend({},e),opts:f.extend(!0,{specialEasing:{}},n),originalProperties:e,originalOptions:n,startTime:Kt||ae(),duration:n.duration,tweens:[],createTween:function(e,n){var i=f.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(i),i},stop:function(e){var n=0,i=e?l.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)l.tweens[n].run(1);return e?a.resolveWith(t,[l,e]):a.rejectWith(t,[l,e]),this}}),c=l.props;for(!function(t,e){var n,i,r,o,s;for(n in t)if(r=e[i=f.camelCase(n)],o=t[n],f.isArray(o)&&(r=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),(s=f.cssHooks[i])&&"expand"in s)for(n in o=s.expand(o),delete t[i],o)n in t||(t[n]=o[n],e[n]=r);else e[i]=r}(c,l.opts.specialEasing);o<s;o++)if(i=oe[o].call(l,t,c,l.opts))return i;return f.map(c,le,l),f.isFunction(l.opts.start)&&l.opts.start.call(t,l),f.fx.timer(f.extend(u,{elem:t,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}f.Animation=f.extend(ce,{tweener:function(t,e){f.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var n,i=0,r=t.length;i<r;i++)n=t[i],se[n]=se[n]||[],se[n].unshift(e)},prefilter:function(t,e){e?oe.unshift(t):oe.push(t)}}),f.speed=function(t,e,n){var i=t&&"object"==typeof t?f.extend({},t):{complete:n||!n&&e||f.isFunction(t)&&t,duration:t,easing:n&&e||e&&!f.isFunction(e)&&e};return i.duration=f.fx.off?0:"number"==typeof i.duration?i.duration:i.duration in f.fx.speeds?f.fx.speeds[i.duration]:f.fx.speeds._default,null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){f.isFunction(i.old)&&i.old.call(this),i.queue&&f.dequeue(this,i.queue)},i},f.fn.extend({fadeTo:function(t,e,n,i){return this.filter(Y).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=f.isEmptyObject(t),o=f.speed(e,n,i),s=function(){var e=ce(this,f.extend({},t),o);(r||f._data(this,"finish"))&&e.stop(!0)};return s.finish=s,r||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&!1!==t&&this.queue(t||"fx",[]),this.each(function(){var e=!0,r=null!=t&&t+"queueHooks",o=f.timers,s=f._data(this);if(r)s[r]&&s[r].stop&&i(s[r]);else for(r in s)s[r]&&s[r].stop&&re.test(r)&&i(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=t&&o[r].queue!==t||(o[r].anim.stop(n),e=!1,o.splice(r,1));!e&&n||f.dequeue(this,t)})},finish:function(t){return!1!==t&&(t=t||"fx"),this.each(function(){var e,n=f._data(this),i=n[t+"queue"],r=n[t+"queueHooks"],o=f.timers,s=i?i.length:0;for(n.finish=!0,f.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<s;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish})}}),f.each(["toggle","show","hide"],function(t,e){var n=f.fn[e];f.fn[e]=function(t,i,r){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(ue(e,!0),t,i,r)}}),f.each({slideDown:ue("show"),slideUp:ue("hide"),slideToggle:ue("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(t,e){f.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}}),f.timers=[],f.fx.tick=function(){var t,e=f.timers,n=0;for(Kt=f.now();n<e.length;n++)(t=e[n])()||e[n]!==t||e.splice(n--,1);e.length||f.fx.stop(),Kt=void 0},f.fx.timer=function(t){f.timers.push(t),t()?f.fx.start():f.timers.pop()},f.fx.interval=13,f.fx.start=function(){Qt||(Qt=setInterval(f.fx.tick,f.fx.interval))},f.fx.stop=function(){clearInterval(Qt),Qt=null},f.fx.speeds={slow:600,fast:200,_default:400},f.fn.delay=function(t,e){return t=f.fx&&f.fx.speeds[t]||t,e=e||"fx",this.queue(e,function(e,n){var i=setTimeout(e,t);n.stop=function(){clearTimeout(i)}})},(Jt=S.createElement("div")).setAttribute("className","t"),Jt.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",te=Jt.getElementsByTagName("a")[0],ee=(Zt=S.createElement("select")).appendChild(S.createElement("option")),Xt=Jt.getElementsByTagName("input")[0],te.style.cssText="top:1px",c.getSetAttribute="t"!==Jt.className,c.style=/top/.test(te.getAttribute("style")),c.hrefNormalized="/a"===te.getAttribute("href"),c.checkOn=!!Xt.value,c.optSelected=ee.selected,c.enctype=!!S.createElement("form").enctype,Zt.disabled=!0,c.optDisabled=!ee.disabled,(Xt=S.createElement("input")).setAttribute("value",""),c.input=""===Xt.getAttribute("value"),Xt.value="t",Xt.setAttribute("type","radio"),c.radioValue="t"===Xt.value;var fe=/\r/g;f.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=f.isFunction(t),this.each(function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,f(this).val()):t)?r="":"number"==typeof r?r+="":f.isArray(r)&&(r=f.map(r,function(t){return null==t?"":t+""})),(e=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))})):r?(e=f.valHooks[r.type]||f.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(fe,""):null==n?"":n:void 0}}),f.extend({valHooks:{option:{get:function(t){var e=f.find.attr(t,"value");return null!=e?e:f.trim(f.text(t))}},select:{get:function(t){for(var e,n,i=t.options,r=t.selectedIndex,o="select-one"===t.type||r<0,s=o?null:[],a=o?r+1:i.length,u=r<0?a:o?r:0;u<a;u++)if(((n=i[u]).selected||u===r)&&(c.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!f.nodeName(n.parentNode,"optgroup"))){if(e=f(n).val(),o)return e;s.push(e)}return s},set:function(t,e){for(var n,i,r=t.options,o=f.makeArray(e),s=r.length;s--;)if(i=r[s],f.inArray(f.valHooks.option.get(i),o)>=0)try{i.selected=n=!0}catch(t){i.scrollHeight}else i.selected=!1;return n||(t.selectedIndex=-1),r}}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]={set:function(t,e){if(f.isArray(e))return t.checked=f.inArray(f(t).val(),e)>=0}},c.checkOn||(f.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})});var he,pe,de=f.expr.attrHandle,me=/^(?:checked|selected)$/i,ve=c.getSetAttribute,ge=c.input;f.fn.extend({attr:function(t,e){return V(this,f.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){f.removeAttr(this,t)})}}),f.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o)return typeof t.getAttribute===N?f.prop(t,e,n):(1===o&&f.isXMLDoc(t)||(e=e.toLowerCase(),i=f.attrHooks[e]||(f.expr.match.bool.test(e)?pe:he)),void 0===n?i&&"get"in i&&null!==(r=i.get(t,e))?r:null==(r=f.find.attr(t,e))?void 0:r:null!==n?i&&"set"in i&&void 0!==(r=i.set(t,n,e))?r:(t.setAttribute(e,n+""),n):void f.removeAttr(t,e))},removeAttr:function(t,e){var n,i,r=0,o=e&&e.match(O);if(o&&1===t.nodeType)for(;n=o[r++];)i=f.propFix[n]||n,f.expr.match.bool.test(n)?ge&&ve||!me.test(n)?t[i]=!1:t[f.camelCase("default-"+n)]=t[i]=!1:f.attr(t,n,""),t.removeAttribute(ve?n:i)},attrHooks:{type:{set:function(t,e){if(!c.radioValue&&"radio"===e&&f.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}}}),pe={set:function(t,e,n){return!1===e?f.removeAttr(t,n):ge&&ve||!me.test(n)?t.setAttribute(!ve&&f.propFix[n]||n,n):t[f.camelCase("default-"+n)]=t[n]=!0,n}},f.each(f.expr.match.bool.source.match(/\w+/g),function(t,e){var n=de[e]||f.find.attr;de[e]=ge&&ve||!me.test(e)?function(t,e,i){var r,o;return i||(o=de[e],de[e]=r,r=null!=n(t,e,i)?e.toLowerCase():null,de[e]=o),r}:function(t,e,n){if(!n)return t[f.camelCase("default-"+e)]?e.toLowerCase():null}}),ge&&ve||(f.attrHooks.value={set:function(t,e,n){if(!f.nodeName(t,"input"))return he&&he.set(t,e,n);t.defaultValue=e}}),ve||(he={set:function(t,e,n){var i=t.getAttributeNode(n);if(i||t.setAttributeNode(i=t.ownerDocument.createAttribute(n)),i.value=e+="","value"===n||e===t.getAttribute(n))return e}},de.id=de.name=de.coords=function(t,e,n){var i;if(!n)return(i=t.getAttributeNode(e))&&""!==i.value?i.value:null},f.valHooks.button={get:function(t,e){var n=t.getAttributeNode(e);if(n&&n.specified)return n.value},set:he.set},f.attrHooks.contenteditable={set:function(t,e,n){he.set(t,""!==e&&e,n)}},f.each(["width","height"],function(t,e){f.attrHooks[e]={set:function(t,n){if(""===n)return t.setAttribute(e,"auto"),n}}})),c.style||(f.attrHooks.style={get:function(t){return t.style.cssText||void 0},set:function(t,e){return t.style.cssText=e+""}});var ye=/^(?:input|select|textarea|button|object)$/i,_e=/^(?:a|area)$/i;f.fn.extend({prop:function(t,e){return V(this,f.prop,t,e,arguments.length>1)},removeProp:function(t){return t=f.propFix[t]||t,this.each(function(){try{this[t]=void 0,delete this[t]}catch(t){}})}}),f.extend({propFix:{for:"htmlFor",class:"className"},prop:function(t,e,n){var i,r,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o)return(1!==o||!f.isXMLDoc(t))&&(e=f.propFix[e]||e,r=f.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=f.find.attr(t,"tabindex");return e?parseInt(e,10):ye.test(t.nodeName)||_e.test(t.nodeName)&&t.href?0:-1}}}}),c.hrefNormalized||f.each(["href","src"],function(t,e){f.propHooks[e]={get:function(t){return t.getAttribute(e,4)}}}),c.optSelected||(f.propHooks.selected={get:function(t){var e=t.parentNode;return e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex),null}}),f.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){f.propFix[this.toLowerCase()]=this}),c.enctype||(f.propFix.enctype="encoding");var be=/[\t\r\n\f]/g;f.fn.extend({addClass:function(t){var e,n,i,r,o,s,a=0,u=this.length,l="string"==typeof t&&t;if(f.isFunction(t))return this.each(function(e){f(this).addClass(t.call(this,e,this.className))});if(l)for(e=(t||"").match(O)||[];a<u;a++)if(i=1===(n=this[a]).nodeType&&(n.className?(" "+n.className+" ").replace(be," "):" ")){for(o=0;r=e[o++];)i.indexOf(" "+r+" ")<0&&(i+=r+" ");s=f.trim(i),n.className!==s&&(n.className=s)}return this},removeClass:function(t){var e,n,i,r,o,s,a=0,u=this.length,l=0===arguments.length||"string"==typeof t&&t;if(f.isFunction(t))return this.each(function(e){f(this).removeClass(t.call(this,e,this.className))});if(l)for(e=(t||"").match(O)||[];a<u;a++)if(i=1===(n=this[a]).nodeType&&(n.className?(" "+n.className+" ").replace(be," "):"")){for(o=0;r=e[o++];)for(;i.indexOf(" "+r+" ")>=0;)i=i.replace(" "+r+" "," ");s=t?f.trim(i):"",n.className!==s&&(n.className=s)}return this},toggleClass:function(t,e){var n=typeof t;return"boolean"==typeof e&&"string"===n?e?this.addClass(t):this.removeClass(t):f.isFunction(t)?this.each(function(n){f(this).toggleClass(t.call(this,n,this.className,e),e)}):this.each(function(){if("string"===n)for(var e,i=0,r=f(this),o=t.match(O)||[];e=o[i++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else n!==N&&"boolean"!==n||(this.className&&f._data(this,"__className__",this.className),this.className=this.className||!1===t?"":f._data(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,i=this.length;n<i;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(be," ").indexOf(e)>=0)return!0;return!1}}),f.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){f.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}),f.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},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,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)}});var we=f.now(),ke=/\?/,Se=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;f.parseJSON=function(e){if(t.JSON&&t.JSON.parse)return t.JSON.parse(e+"");var n,i=null,r=f.trim(e+"");return r&&!f.trim(r.replace(Se,function(t,e,r,o){return n&&e&&(i=0),0===i?t:(n=r||e,i+=!o-!r,"")}))?Function("return "+r)():f.error("Invalid JSON: "+e)},f.parseXML=function(e){var n;if(!e||"string"!=typeof e)return null;try{t.DOMParser?n=(new DOMParser).parseFromString(e,"text/xml"):((n=new ActiveXObject("Microsoft.XMLDOM")).async="false",n.loadXML(e))}catch(t){n=void 0}return n&&n.documentElement&&!n.getElementsByTagName("parsererror").length||f.error("Invalid XML: "+e),n};var xe,je,Ee=/#.*$/,Ce=/([?&])_=[^&]*/,Te=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Oe=/^(?:GET|HEAD)$/,Pe=/^\/\//,Ae=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,De={},Le={},Ne="*/".concat("*");try{je=location.href}catch(t){(je=S.createElement("a")).href="",je=je.href}function Ie(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(O)||[];if(f.isFunction(n))for(;i=o[r++];)"+"===i.charAt(0)?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Me(t,e,n,i){var r={},o=t===Le;function s(a){var u;return r[a]=!0,f.each(t[a]||[],function(t,a){var l=a(e,n,i);return"string"!=typeof l||o||r[l]?o?!(u=l):void 0:(e.dataTypes.unshift(l),s(l),!1)}),u}return s(e.dataTypes[0])||!r["*"]&&s("*")}function Fe(t,e){var n,i,r=f.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&f.extend(!0,t,n),t}xe=Ae.exec(je.toLowerCase())||[],f.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:je,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(xe[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ne,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Fe(Fe(t,f.ajaxSettings),e):Fe(f.ajaxSettings,t)},ajaxPrefilter:Ie(De),ajaxTransport:Ie(Le),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,i,r,o,s,a,u,l,c=f.ajaxSetup({},e),h=c.context||c,p=c.context&&(h.nodeType||h.jquery)?f(h):f.event,d=f.Deferred(),m=f.Callbacks("once memory"),v=c.statusCode||{},g={},y={},_=0,b="canceled",w={readyState:0,getResponseHeader:function(t){var e;if(2===_){if(!l)for(l={};e=Te.exec(o);)l[e[1].toLowerCase()]=e[2];e=l[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===_?o:null},setRequestHeader:function(t,e){var n=t.toLowerCase();return _||(t=y[n]=y[n]||t,g[t]=e),this},overrideMimeType:function(t){return _||(c.mimeType=t),this},statusCode:function(t){var e;if(t)if(_<2)for(e in t)v[e]=[v[e],t[e]];else w.always(t[w.status]);return this},abort:function(t){var e=t||b;return u&&u.abort(e),k(0,e),this}};if(d.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,c.url=((t||c.url||je)+"").replace(Ee,"").replace(Pe,xe[1]+"//"),c.type=e.method||e.type||c.method||c.type,c.dataTypes=f.trim(c.dataType||"*").toLowerCase().match(O)||[""],null==c.crossDomain&&(n=Ae.exec(c.url.toLowerCase()),c.crossDomain=!(!n||n[1]===xe[1]&&n[2]===xe[2]&&(n[3]||("http:"===n[1]?"80":"443"))===(xe[3]||("http:"===xe[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=f.param(c.data,c.traditional)),Me(De,c,e,w),2===_)return w;for(i in(a=f.event&&c.global)&&0==f.active++&&f.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Oe.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(ke.test(r)?"&":"?")+c.data,delete c.data),!1===c.cache&&(c.url=Ce.test(r)?r.replace(Ce,"$1_="+we++):r+(ke.test(r)?"&":"?")+"_="+we++)),c.ifModified&&(f.lastModified[r]&&w.setRequestHeader("If-Modified-Since",f.lastModified[r]),f.etag[r]&&w.setRequestHeader("If-None-Match",f.etag[r])),(c.data&&c.hasContent&&!1!==c.contentType||e.contentType)&&w.setRequestHeader("Content-Type",c.contentType),w.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+Ne+"; q=0.01":""):c.accepts["*"]),c.headers)w.setRequestHeader(i,c.headers[i]);if(c.beforeSend&&(!1===c.beforeSend.call(h,w,c)||2===_))return w.abort();for(i in b="abort",{success:1,error:1,complete:1})w[i](c[i]);if(u=Me(Le,c,e,w)){w.readyState=1,a&&p.trigger("ajaxSend",[w,c]),c.async&&c.timeout>0&&(s=setTimeout(function(){w.abort("timeout")},c.timeout));try{_=1,u.send(g,k)}catch(t){if(!(_<2))throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,n,i){var l,g,y,b,k,S=e;2!==_&&(_=2,s&&clearTimeout(s),u=void 0,o=i||"",w.readyState=t>0?4:0,l=t>=200&&t<300||304===t,n&&(b=function(t,e,n){for(var i,r,o,s,a=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=t.mimeType||e.getResponseHeader("Content-Type"));if(r)for(s in a)if(a[s]&&a[s].test(r)){u.unshift(s);break}if(u[0]in n)o=u[0];else{for(s in n){if(!u[0]||t.converters[s+" "+u[0]]){o=s;break}i||(i=s)}o=o||i}if(o)return o!==u[0]&&u.unshift(o),n[o]}(c,w,n)),b=function(t,e,n,i){var r,o,s,a,u,l={},c=t.dataTypes.slice();if(c[1])for(s in t.converters)l[s.toLowerCase()]=t.converters[s];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!u&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(r in l)if((a=r.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[r]:!0!==l[r]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+u+" to "+o}}}return{state:"success",data:e}}(c,b,w,l),l?(c.ifModified&&((k=w.getResponseHeader("Last-Modified"))&&(f.lastModified[r]=k),(k=w.getResponseHeader("etag"))&&(f.etag[r]=k)),204===t||"HEAD"===c.type?S="nocontent":304===t?S="notmodified":(S=b.state,g=b.data,l=!(y=b.error))):(y=S,!t&&S||(S="error",t<0&&(t=0))),w.status=t,w.statusText=(e||S)+"",l?d.resolveWith(h,[g,S,w]):d.rejectWith(h,[w,S,y]),w.statusCode(v),v=void 0,a&&p.trigger(l?"ajaxSuccess":"ajaxError",[w,c,l?g:y]),m.fireWith(h,[w,S]),a&&(p.trigger("ajaxComplete",[w,c]),--f.active||f.event.trigger("ajaxStop")))}return w},getJSON:function(t,e,n){return f.get(t,e,n,"json")},getScript:function(t,e){return f.get(t,void 0,e,"script")}}),f.each(["get","post"],function(t,e){f[e]=function(t,n,i,r){return f.isFunction(n)&&(r=r||i,i=n,n=void 0),f.ajax({url:t,type:e,dataType:r,data:n,success:i})}}),f._evalUrl=function(t){return f.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},f.fn.extend({wrapAll:function(t){if(f.isFunction(t))return this.each(function(e){f(this).wrapAll(t.call(this,e))});if(this[0]){var e=f(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 f.isFunction(t)?this.each(function(e){f(this).wrapInner(t.call(this,e))}):this.each(function(){var e=f(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)})},wrap:function(t){var e=f.isFunction(t);return this.each(function(n){f(this).wrapAll(e?t.call(this,n):t)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()}}),f.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0||!c.reliableHiddenOffsets()&&"none"===(t.style&&t.style.display||f.css(t,"display"))},f.expr.filters.visible=function(t){return!f.expr.filters.hidden(t)};var $e=/%20/g,Re=/\[\]$/,He=/\r?\n/g,Be=/^(?:submit|button|image|reset|file)$/i,We=/^(?:input|select|textarea|keygen)/i;function Ye(t,e,n,i){var r;if(f.isArray(e))f.each(e,function(e,r){n||Re.test(t)?i(t,r):Ye(t+"["+("object"==typeof r?e:"")+"]",r,n,i)});else if(n||"object"!==f.type(e))i(t,e);else for(r in e)Ye(t+"["+r+"]",e[r],n,i)}f.param=function(t,e){var n,i=[],r=function(t,e){e=f.isFunction(e)?e():null==e?"":e,i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=f.ajaxSettings&&f.ajaxSettings.traditional),f.isArray(t)||t.jquery&&!f.isPlainObject(t))f.each(t,function(){r(this.name,this.value)});else for(n in t)Ye(n,t[n],e,r);return i.join("&").replace($e,"+")},f.fn.extend({serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=f.prop(this,"elements");return t?f.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!f(this).is(":disabled")&&We.test(this.nodeName)&&!Be.test(t)&&(this.checked||!q.test(t))}).map(function(t,e){var n=f(this).val();return null==n?null:f.isArray(n)?f.map(n,function(t){return{name:e.name,value:t.replace(He,"\r\n")}}):{name:e.name,value:n.replace(He,"\r\n")}}).get()}}),f.ajaxSettings.xhr=void 0!==t.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Ue()||function(){try{return new t.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}()}:Ue;var Ve=0,qe={},ze=f.ajaxSettings.xhr();function Ue(){try{return new t.XMLHttpRequest}catch(t){}}t.attachEvent&&t.attachEvent("onunload",function(){for(var t in qe)qe[t](void 0,!0)}),c.cors=!!ze&&"withCredentials"in ze,(ze=c.ajax=!!ze)&&f.ajaxTransport(function(t){var e;if(!t.crossDomain||c.cors)return{send:function(n,i){var r,o=t.xhr(),s=++Ve;if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)o[r]=t.xhrFields[r];for(r in t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),n)void 0!==n[r]&&o.setRequestHeader(r,n[r]+"");o.send(t.hasContent&&t.data||null),e=function(n,r){var a,u,l;if(e&&(r||4===o.readyState))if(delete qe[s],e=void 0,o.onreadystatechange=f.noop,r)4!==o.readyState&&o.abort();else{l={},a=o.status,"string"==typeof o.responseText&&(l.text=o.responseText);try{u=o.statusText}catch(t){u=""}a||!t.isLocal||t.crossDomain?1223===a&&(a=204):a=l.text?200:404}l&&i(a,u,l,o.getAllResponseHeaders())},t.async?4===o.readyState?setTimeout(e):o.onreadystatechange=qe[s]=e:e()},abort:function(){e&&e(void 0,!0)}}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return f.globalEval(t),t}}}),f.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET",t.global=!1)}),f.ajaxTransport("script",function(t){if(t.crossDomain){var e,n=S.head||f("head")[0]||S.documentElement;return{send:function(i,r){(e=S.createElement("script")).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||r(200,"success"))},n.insertBefore(e,n.firstChild)},abort:function(){e&&e.onload(void 0,!0)}}}});var Ge=[],Ke=/(=)\?(?=&|$)|\?\?/;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ge.pop()||f.expando+"_"+we++;return this[t]=!0,t}}),f.ajaxPrefilter("json jsonp",function(e,n,i){var r,o,s,a=!1!==e.jsonp&&(Ke.test(e.url)?"url":"string"==typeof e.data&&!(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ke.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=f.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ke,"$1"+r):!1!==e.jsonp&&(e.url+=(ke.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return s||f.error(r+" was not called"),s[0]},e.dataTypes[0]="json",o=t[r],t[r]=function(){s=arguments},i.always(function(){t[r]=o,e[r]&&(e.jsonpCallback=n.jsonpCallback,Ge.push(r)),s&&f.isFunction(o)&&o(s[0]),s=o=void 0}),"script"}),f.parseHTML=function(t,e,n){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(n=e,e=!1),e=e||S;var i=_.exec(t),r=!n&&[];return i?[e.createElement(i[1])]:(i=f.buildFragment([t],e,r),r&&r.length&&f(r).remove(),f.merge([],i.childNodes))};var Qe=f.fn.load;f.fn.load=function(t,e,n){if("string"!=typeof t&&Qe)return Qe.apply(this,arguments);var i,r,o,s=this,a=t.indexOf(" ");return a>=0&&(i=f.trim(t.slice(a,t.length)),t=t.slice(0,a)),f.isFunction(e)?(n=e,e=void 0):e&&"object"==typeof e&&(o="POST"),s.length>0&&f.ajax({url:t,type:o,dataType:"html",data:e}).done(function(t){r=arguments,s.html(i?f("<div>").append(f.parseHTML(t)).find(i):t)}).complete(n&&function(t,e){s.each(n,r||[t.responseText,e,t])}),this},f.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){f.fn[e]=function(t){return this.on(e,t)}}),f.expr.filters.animated=function(t){return f.grep(f.timers,function(e){return t===e.elem}).length};var Xe=t.document.documentElement;function Je(t){return f.isWindow(t)?t:9===t.nodeType&&(t.defaultView||t.parentWindow)}f.offset={setOffset:function(t,e,n){var i,r,o,s,a,u,l=f.css(t,"position"),c=f(t),h={};"static"===l&&(t.style.position="relative"),a=c.offset(),o=f.css(t,"top"),u=f.css(t,"left"),("absolute"===l||"fixed"===l)&&f.inArray("auto",[o,u])>-1?(s=(i=c.position()).top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(u)||0),f.isFunction(e)&&(e=e.call(t,n,a)),null!=e.top&&(h.top=e.top-a.top+s),null!=e.left&&(h.left=e.left-a.left+r),"using"in e?e.using.call(t,h):c.css(h)}},f.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){f.offset.setOffset(this,t,e)});var e,n,i={top:0,left:0},r=this[0],o=r&&r.ownerDocument;return o?(e=o.documentElement,f.contains(e,r)?(typeof r.getBoundingClientRect!==N&&(i=r.getBoundingClientRect()),n=Je(o),{top:i.top+(n.pageYOffset||e.scrollTop)-(e.clientTop||0),left:i.left+(n.pageXOffset||e.scrollLeft)-(e.clientLeft||0)}):i):void 0},position:function(){if(this[0]){var t,e,n={top:0,left:0},i=this[0];return"fixed"===f.css(i,"position")?e=i.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),f.nodeName(t[0],"html")||(n=t.offset()),n.top+=f.css(t[0],"borderTopWidth",!0),n.left+=f.css(t[0],"borderLeftWidth",!0)),{top:e.top-n.top-f.css(i,"marginTop",!0),left:e.left-n.left-f.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||Xe;t&&!f.nodeName(t,"html")&&"static"===f.css(t,"position");)t=t.offsetParent;return t||Xe})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var n=/Y/.test(e);f.fn[t]=function(i){return V(this,function(t,i,r){var o=Je(t);if(void 0===r)return o?e in o?o[e]:o.document.documentElement[i]:t[i];o?o.scrollTo(n?f(o).scrollLeft():r,n?r:f(o).scrollTop()):t[i]=r},t,i,arguments.length,null)}}),f.each(["top","left"],function(t,e){f.cssHooks[e]=Nt(c.pixelPosition,function(t,n){if(n)return n=Pt(t,e),Dt.test(n)?f(t).position()[e]+"px":n})}),f.each({Height:"height",Width:"width"},function(t,e){f.each({padding:"inner"+t,content:e,"":"outer"+t},function(n,i){f.fn[i]=function(i,r){var o=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===r?"margin":"border");return V(this,function(e,n,i){var r;return f.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===i?f.css(e,n,s):f.style(e,n,i,s)},e,o?i:void 0,o,null)}})}),f.fn.size=function(){return this.length},f.fn.andSelf=f.fn.addBack;var Ze=t.jQuery,tn=t.$;return f.noConflict=function(e){return t.$===f&&(t.$=tn),e&&t.jQuery===f&&(t.jQuery=Ze),f},typeof e===N&&(t.jQuery=t.$=f),f},"object"==typeof n&&"object"==typeof n.exports?n.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}(t("github:jspm/nodelibs-process@0.1.2.js"))}),$__System.registerDynamic("npm:jquery@1.11.3.js",["npm:jquery@1.11.3/dist/jquery.js"],!0,function(t,e,n){this||self;n.exports=t("npm:jquery@1.11.3/dist/jquery.js")}),$__System.registerDynamic("github:twitter/typeahead.js@0.11.1/dist/typeahead.bundle.js",["npm:jquery@1.11.3.js"],!1,function(t,e,n){var i=$__System.get("@@global-helpers").prepareGlobal(n.id,null,null);return function(t){"format global";"deps jquery";var e,n;e=this,n=function(t){var e=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(e){return e instanceof t},toStr:function(t){return e.isUndefined(t)||null===t?"":t+""},bind:t.proxy,each:function(e,n){t.each(e,function(t,e){return n(e,t)})},map:t.map,filter:t.grep,every:function(e,n){var i=!0;return e?(t.each(e,function(t,r){if(!(i=n.call(null,r,t,e)))return!1}),!!i):i},some:function(e,n){var i=!1;return e?(t.each(e,function(t,r){if(i=n.call(null,r,t,e))return!1}),!!i):i},mixin:t.extend,identity:function(t){return t},clone:function(e){return t.extend(!0,{},e)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(e){return t.isFunction(e)?e:function(){return String(e)}},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,r;return function(){var o,s,a=this,u=arguments;return o=function(){i=null,n||(r=t.apply(a,u))},s=n&&!i,clearTimeout(i),i=setTimeout(o,e),s&&(r=t.apply(a,u)),r}},throttle:function(t,e){var n,i,r,o,s,a;return s=0,a=function(){s=new Date,r=null,o=t.apply(n,i)},function(){var u=new Date,l=e-(u-s);return n=this,i=arguments,l<=0?(clearTimeout(r),r=null,s=u,o=t.apply(n,i)):r||(r=setTimeout(a,l)),o}},stringify:function(t){return e.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),n="0.11.1",i=function(){"use strict";return{nonword:n,whitespace:t,obj:{nonword:i(n),whitespace:i(t)}};function t(t){return(t=e.toStr(t))?t.split(/\s+/):[]}function n(t){return(t=e.toStr(t))?t.split(/\W+/):[]}function i(t){return function(n){return n=e.isArray(n)?n:[].slice.call(arguments,0),function(i){var r=[];return e.each(n,function(n){r=r.concat(t(e.toStr(i[n])))}),r}}}}(),r=function(){"use strict";function n(n){this.maxSize=e.isNumber(n)?n:100,this.reset(),this.maxSize<=0&&(this.set=this.get=t.noop)}function i(){this.head=this.tail=null}return e.mixin(n.prototype,{set:function(t,e){var n,i=this.list.tail;this.size>=this.maxSize&&(this.list.remove(i),delete this.hash[i.key],this.size--),(n=this.hash[t])?(n.val=e,this.list.moveToFront(n)):(n=new function(t,e){this.key=t,this.val=e,this.prev=this.next=null}(t,e),this.list.add(n),this.hash[t]=n,this.size++)},get:function(t){var e=this.hash[t];if(e)return this.list.moveToFront(e),e.val},reset:function(){this.size=0,this.hash={},this.list=new i}}),e.mixin(i.prototype,{add:function(t){this.head&&(t.next=this.head,this.head.prev=t),this.head=t,this.tail=this.tail||t},remove:function(t){t.prev?t.prev.next=t.next:this.head=t.next,t.next?t.next.prev=t.prev:this.tail=t.prev},moveToFront:function(t){this.remove(t),this.add(t)}}),n}(),o=function(){"use strict";var n;try{(n=window.localStorage).setItem("~~~","!"),n.removeItem("~~~")}catch(t){n=null}function i(t,i){this.prefix=["__",t,"__"].join(""),this.ttlKey="__ttl__",this.keyMatcher=new RegExp("^"+e.escapeRegExChars(this.prefix)),this.ls=i||n,!this.ls&&this._noop()}return e.mixin(i.prototype,{_prefix:function(t){return this.prefix+t},_ttlKey:function(t){return this._prefix(t)+this.ttlKey},_noop:function(){this.get=this.set=this.remove=this.clear=this.isExpired=e.noop},_safeSet:function(t,e){try{this.ls.setItem(t,e)}catch(t){"QuotaExceededError"===t.name&&(this.clear(),this._noop())}},get:function(t){return this.isExpired(t)&&this.remove(t),s(this.ls.getItem(this._prefix(t)))},set:function(t,n,i){return e.isNumber(i)?this._safeSet(this._ttlKey(t),o(r()+i)):this.ls.removeItem(this._ttlKey(t)),this._safeSet(this._prefix(t),o(n))},remove:function(t){return this.ls.removeItem(this._ttlKey(t)),this.ls.removeItem(this._prefix(t)),this},clear:function(){var t,e=function(t){var e,i,r=[],o=n.length;for(e=0;e<o;e++)(i=n.key(e)).match(t)&&r.push(i.replace(t,""));return r}(this.keyMatcher);for(t=e.length;t--;)this.remove(e[t]);return this},isExpired:function(t){var n=s(this.ls.getItem(this._ttlKey(t)));return!!(e.isNumber(n)&&r()>n)}}),i;function r(){return(new Date).getTime()}function o(t){return JSON.stringify(e.isUndefined(t)?null:t)}function s(e){return t.parseJSON(e)}}(),s=function(){"use strict";var n=0,i={},o=6,s=new r(10);function a(t){t=t||{},this.cancelled=!1,this.lastReq=null,this._send=t.transport,this._get=t.limiter?t.limiter(this._get):this._get,this._cache=!1===t.cache?new r(0):s}return a.setMaxPendingRequests=function(t){o=t},a.resetCache=function(){s.reset()},e.mixin(a.prototype,{_fingerprint:function(e){return(e=e||{}).url+e.type+t.param(e.data||{})},_get:function(t,e){var r,s,a=this;function u(t){e(null,t),a._cache.set(r,t)}function l(){e(!0)}r=this._fingerprint(t),this.cancelled||r!==this.lastReq||((s=i[r])?s.done(u).fail(l):n<o?(n++,i[r]=this._send(t).done(u).fail(l).always(function(){n--,delete i[r],a.onDeckRequestArgs&&(a._get.apply(a,a.onDeckRequestArgs),a.onDeckRequestArgs=null)})):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(n,i){var r,o;i=i||t.noop,n=e.isString(n)?{url:n}:n||{},o=this._fingerprint(n),this.cancelled=!1,this.lastReq=o,(r=this._cache.get(o))?i(null,r):this._get(n,i)},cancel:function(){this.cancelled=!0}}),a}(),a=window.SearchIndex=function(){"use strict";var n="c",i="i";function r(n){(n=n||{}).datumTokenizer&&n.queryTokenizer||t.error("datumTokenizer and queryTokenizer are both required"),this.identify=n.identify||e.stringify,this.datumTokenizer=n.datumTokenizer,this.queryTokenizer=n.queryTokenizer,this.reset()}return e.mixin(r.prototype,{bootstrap:function(t){this.datums=t.datums,this.trie=t.trie},add:function(t){var r=this;t=e.isArray(t)?t:[t],e.each(t,function(t){var a,u;r.datums[a=r.identify(t)]=t,u=o(r.datumTokenizer(t)),e.each(u,function(t){var e,o,u;for(e=r.trie,o=t.split("");u=o.shift();)(e=e[n][u]||(e[n][u]=s()))[i].push(a)})})},get:function(t){var n=this;return e.map(t,function(t){return n.datums[t]})},search:function(t){var r,s,a=this;return r=o(this.queryTokenizer(t)),e.each(r,function(t){var e,r,o,u;if(s&&0===s.length)return!1;for(e=a.trie,r=t.split("");e&&(o=r.shift());)e=e[n][o];if(!e||0!==r.length)return s=[],!1;u=e[i].slice(0),s=s?function(t,e){var n=0,i=0,r=[];t=t.sort(),e=e.sort();var o=t.length,s=e.length;for(;n<o&&i<s;)t[n]<e[i]?n++:t[n]>e[i]?i++:(r.push(t[n]),n++,i++);return r}(s,u):u}),s?e.map(function(t){for(var e={},n=[],i=0,r=t.length;i<r;i++)e[t[i]]||(e[t[i]]=!0,n.push(t[i]));return n}(s),function(t){return a.datums[t]}):[]},all:function(){var t=[];for(var e in this.datums)t.push(this.datums[e]);return t},reset:function(){this.datums={},this.trie=s()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),r;function o(t){return t=e.filter(t,function(t){return!!t}),t=e.map(t,function(t){return t.toLowerCase()})}function s(){var t={};return t[i]=[],t[n]={},t}}(),u=function(){"use strict";var t;function n(t){this.url=t.url,this.ttl=t.ttl,this.cache=t.cache,this.prepare=t.prepare,this.transform=t.transform,this.transport=t.transport,this.thumbprint=t.thumbprint,this.storage=new o(t.cacheKey)}return t={data:"data",protocol:"protocol",thumbprint:"thumbprint"},e.mixin(n.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},store:function(e){this.cache&&(this.storage.set(t.data,e,this.ttl),this.storage.set(t.protocol,location.protocol,this.ttl),this.storage.set(t.thumbprint,this.thumbprint,this.ttl))},fromCache:function(){var e,n={};return this.cache?(n.data=this.storage.get(t.data),n.protocol=this.storage.get(t.protocol),n.thumbprint=this.storage.get(t.thumbprint),e=n.thumbprint!==this.thumbprint||n.protocol!==location.protocol,n.data&&!e?n.data:null):null},fromNetwork:function(t){var e,n=this;t&&(e=this.prepare(this._settings()),this.transport(e).fail(function(){t(!0)}).done(function(e){t(null,n.transform(e))}))},clear:function(){return this.storage.clear(),this}}),n}(),l=function(){"use strict";function t(t){this.url=t.url,this.prepare=t.prepare,this.transform=t.transform,this.transport=new s({cache:t.cache,limiter:t.limiter,transport:t.transport})}return e.mixin(t.prototype,{_settings:function(){return{url:this.url,type:"GET",dataType:"json"}},get:function(t,e){var n,i=this;if(e)return t=t||"",n=this.prepare(t,this._settings()),this.transport.get(n,function(t,n){e(t?[]:i.transform(n))})},cancelLastRequest:function(){this.transport.cancel()}}),t}(),c=function(){"use strict";return function(r){var o,s;return o={initialize:!0,identify:e.stringify,datumTokenizer:null,queryTokenizer:null,sufficient:5,sorter:null,local:[],prefetch:null,remote:null},!(r=e.mixin(o,r||{})).datumTokenizer&&t.error("datumTokenizer is required"),!r.queryTokenizer&&t.error("queryTokenizer is required"),s=r.sorter,r.sorter=s?function(t){return t.sort(s)}:e.identity,r.local=e.isFunction(r.local)?r.local():r.local,r.prefetch=function(r){var o;if(!r)return null;return o={url:null,ttl:864e5,cache:!0,cacheKey:null,thumbprint:"",prepare:e.identity,transform:e.identity,transport:null},r=e.isString(r)?{url:r}:r,!(r=e.mixin(o,r)).url&&t.error("prefetch requires url to be set"),r.transform=r.filter||r.transform,r.cacheKey=r.cacheKey||r.url,r.thumbprint=n+r.thumbprint,r.transport=r.transport?i(r.transport):t.ajax,r}(r.prefetch),r.remote=function(n){var r;if(!n)return;return r={url:null,cache:!0,prepare:null,replace:null,wildcard:null,limiter:null,rateLimitBy:"debounce",rateLimitWait:300,transform:e.identity,transport:null},n=e.isString(n)?{url:n}:n,!(n=e.mixin(r,n)).url&&t.error("remote requires url to be set"),n.transform=n.filter||n.transform,n.prepare=function(t){var e,n,i;return e=t.prepare,n=t.replace,i=t.wildcard,e||(e=n?function(t,e){return e.url=n(e.url,t),e}:t.wildcard?function(t,e){return e.url=e.url.replace(i,encodeURIComponent(t)),e}:function(t,e){return e})}(n),n.limiter=function(t){var n,i,r;return n=t.limiter,i=t.rateLimitBy,r=t.rateLimitWait,n||(n=/^throttle$/i.test(i)?function(t){return function(n){return e.throttle(n,t)}}(r):function(t){return function(n){return e.debounce(n,t)}}(r)),n}(n),n.transport=n.transport?i(n.transport):t.ajax,delete n.replace,delete n.wildcard,delete n.rateLimitBy,delete n.rateLimitWait,n}(r.remote),r};function i(n){return function(i){var r=t.Deferred();return n(i,function(t){e.defer(function(){r.resolve(t)})},function(t){e.defer(function(){r.reject(t)})}),r}}}();return function(){"use strict";var n;function r(t){t=c(t),this.sorter=t.sorter,this.identify=t.identify,this.sufficient=t.sufficient,this.local=t.local,this.remote=t.remote?new l(t.remote):null,this.prefetch=t.prefetch?new u(t.prefetch):null,this.index=new a({identify:this.identify,datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer}),!1!==t.initialize&&this.initialize()}return n=window&&window.Bloodhound,r.noConflict=function(){return window&&(window.Bloodhound=n),r},r.tokenizers=i,e.mixin(r.prototype,{__ttAdapter:function(){var t=this;return this.remote?function(e,n,i){return t.search(e,n,i)}:function(e,n){return t.search(e,n)}},_loadPrefetch:function(){var e,n,i=this;return e=t.Deferred(),this.prefetch?(n=this.prefetch.fromCache())?(this.index.bootstrap(n),e.resolve()):this.prefetch.fromNetwork(function(t,n){if(t)return e.reject();i.add(n),i.prefetch.store(i.index.serialize()),e.resolve()}):e.resolve(),e.promise()},_initialize:function(){var t=this;return this.clear(),(this.initPromise=this._loadPrefetch()).done(function(){t.add(t.local)}),this.initPromise},initialize:function(t){return!this.initPromise||t?this._initialize():this.initPromise},add:function(t){return this.index.add(t),this},get:function(t){return t=e.isArray(t)?t:[].slice.call(arguments),this.index.get(t)},search:function(t,n,i){var r,o=this;return r=this.sorter(this.index.search(t)),n(this.remote?r.slice():r),this.remote&&r.length<this.sufficient?this.remote.get(t,function(t){var n=[];e.each(t,function(t){!e.some(r,function(e){return o.identify(t)===o.identify(e)})&&n.push(t)}),i&&i(n)}):this.remote&&this.remote.cancelLastRequest(),this},all:function(){return this.index.all()},clear:function(){return this.index.reset(),this},clearPrefetchCache:function(){return this.prefetch&&this.prefetch.clear(),this},clearRemoteCache:function(){return s.resetCache(),this},ttAdapter:function(){return this.__ttAdapter()}}),r}()},"function"==typeof define&&define.amd?define("bloodhound",["jquery"],function(t){return e.Bloodhound=n(t)}):"object"==typeof exports?module.exports=n(require("jquery")):e.Bloodhound=n(jQuery),function(t,e){"function"==typeof define&&define.amd?define("typeahead.js",["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(0,function(t){var e=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(t){return!t||/^\s*$/.test(t)},escapeRegExChars:function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isArray:t.isArray,isFunction:t.isFunction,isObject:t.isPlainObject,isUndefined:function(t){return void 0===t},isElement:function(t){return!(!t||1!==t.nodeType)},isJQuery:function(e){return e instanceof t},toStr:function(t){return e.isUndefined(t)||null===t?"":t+""},bind:t.proxy,each:function(e,n){t.each(e,function(t,e){return n(e,t)})},map:t.map,filter:t.grep,every:function(e,n){var i=!0;return e?(t.each(e,function(t,r){if(!(i=n.call(null,r,t,e)))return!1}),!!i):i},some:function(e,n){var i=!1;return e?(t.each(e,function(t,r){if(i=n.call(null,r,t,e))return!1}),!!i):i},mixin:t.extend,identity:function(t){return t},clone:function(e){return t.extend(!0,{},e)},getIdGenerator:function(){var t=0;return function(){return t++}},templatify:function(e){return t.isFunction(e)?e:function(){return String(e)}},defer:function(t){setTimeout(t,0)},debounce:function(t,e,n){var i,r;return function(){var o,s,a=this,u=arguments;return o=function(){i=null,n||(r=t.apply(a,u))},s=n&&!i,clearTimeout(i),i=setTimeout(o,e),s&&(r=t.apply(a,u)),r}},throttle:function(t,e){var n,i,r,o,s,a;return s=0,a=function(){s=new Date,r=null,o=t.apply(n,i)},function(){var u=new Date,l=e-(u-s);return n=this,i=arguments,l<=0?(clearTimeout(r),r=null,s=u,o=t.apply(n,i)):r||(r=setTimeout(a,l)),o}},stringify:function(t){return e.isString(t)?t:JSON.stringify(t)},noop:function(){}}}(),n=function(){"use strict";var t={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return function(n){var i,r;return r=e.mixin({},t,n),{css:(i={css:(s={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}},e.isMsie()&&e.mixin(s.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),s),classes:r,html:(o=r,{wrapper:'<span class="'+o.wrapper+'"></span>',menu:'<div class="'+o.menu+'"></div>'}),selectors:function(t){var n={};return e.each(t,function(t,e){n[e]="."+t}),n}(r)}).css,html:i.html,classes:i.classes,selectors:i.selectors,mixin:function(t){e.mixin(t,i)}};var o;var s}}(),i=function(){"use strict";var n;function i(e){e&&e.el||t.error("EventBus initialized without el"),this.$el=t(e.el)}return"typeahead:",n={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},e.mixin(i.prototype,{_trigger:function(e,n){var i;return i=t.Event("typeahead:"+e),(n=n||[]).unshift(i),this.$el.trigger.apply(this.$el,n),i},before:function(t){var e;return e=[].slice.call(arguments,1),this._trigger("before"+t,e).isDefaultPrevented()},trigger:function(t){var e;this._trigger(t,[].slice.call(arguments,1)),(e=n[t])&&this._trigger(e,[].slice.call(arguments,1))}}),i}(),r=function(){"use strict";var t=/\s+/,e=function(){var t;t=window.setImmediate?function(t){setImmediate(function(){t()})}:function(t){setTimeout(function(){t()},0)};return t}();return{onSync:function(t,e,i){return n.call(this,"sync",t,e,i)},onAsync:function(t,e,i){return n.call(this,"async",t,e,i)},off:function(e){var n;if(!this._callbacks)return this;e=e.split(t);for(;n=e.shift();)delete this._callbacks[n];return this},trigger:function(n){var r,o,s,a,u;if(!this._callbacks)return this;n=n.split(t),s=[].slice.call(arguments,1);for(;(r=n.shift())&&(o=this._callbacks[r]);)a=i(o.sync,this,[r].concat(s)),u=i(o.async,this,[r].concat(s)),a()&&e(u);return this}};function n(e,n,i,r){var o;if(!i)return this;for(n=n.split(t),i=r?function(t,e){return t.bind?t.bind(e):function(){t.apply(e,[].slice.call(arguments,0))}}(i,r):i,this._callbacks=this._callbacks||{};o=n.shift();)this._callbacks[o]=this._callbacks[o]||{sync:[],async:[]},this._callbacks[o][e].push(i);return this}function i(t,e,n){return function(){for(var i,r=0,o=t.length;!i&&r<o;r+=1)i=!1===t[r].apply(e,n);return!i}}}(),o=function(t){"use strict";var n={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(i){var r;(i=e.mixin({},n,i)).node&&i.pattern&&(i.pattern=e.isArray(i.pattern)?i.pattern:[i.pattern],r=function(t,n,i){for(var r,o=[],s=0,a=t.length;s<a;s++)o.push(e.escapeRegExChars(t[s]));return r=i?"\\b("+o.join("|")+")\\b":"("+o.join("|")+")",n?new RegExp(r):new RegExp(r,"i")}(i.pattern,i.caseSensitive,i.wordsOnly),function t(e,n){var i;for(var r=0;r<e.childNodes.length;r++)3===(i=e.childNodes[r]).nodeType?r+=n(i)?1:0:t(i,n)}(i.node,function(e){var n,o,s;(n=r.exec(e.data))&&(s=t.createElement(i.tagName),i.className&&(s.className=i.className),(o=e.splitText(n.index)).splitText(n[0].length),s.appendChild(o.cloneNode(!0)),e.parentNode.replaceChild(s,o));return!!n}))}}(window.document),s=function(){"use strict";var n;function i(n,i){var r;(n=n||{}).input||t.error("input is missing"),i.mixin(this),this.$hint=t(n.hint),this.$input=t(n.input),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=(r=this.$input,t('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:r.css("font-family"),fontSize:r.css("font-size"),fontStyle:r.css("font-style"),fontVariant:r.css("font-variant"),fontWeight:r.css("font-weight"),wordSpacing:r.css("word-spacing"),letterSpacing:r.css("letter-spacing"),textIndent:r.css("text-indent"),textRendering:r.css("text-rendering"),textTransform:r.css("text-transform")}).insertAfter(r)),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=e.noop)}return n={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},i.normalizeQuery=function(t){return e.toStr(t).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},e.mixin(i.prototype,r,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(t){var e=n[t.which||t.keyCode];this._managePreventDefault(e,t),e&&this._shouldTrigger(e,t)&&this.trigger(e+"Keyed",t)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(t,e){var n;switch(t){case"up":case"down":n=!o(e);break;default:n=!1}n&&e.preventDefault()},_shouldTrigger:function(t,e){var n;switch(t){case"tab":n=!o(e);break;default:n=!0}return n},_checkLanguageDirection:function(){var t=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==t&&(this.dir=t,this.$hint.attr("dir",t),this.trigger("langDirChanged",t))},_setQuery:function(t,e){var n,r,o,s;o=t,s=this.query,r=!!(n=i.normalizeQuery(o)===i.normalizeQuery(s))&&this.query.length!==t.length,this.query=t,e||n?!e&&r&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},bind:function(){var t,i,r,o,s=this;return t=e.bind(this._onBlur,this),i=e.bind(this._onFocus,this),r=e.bind(this._onKeydown,this),o=e.bind(this._onInput,this),this.$input.on("blur.tt",t).on("focus.tt",i).on("keydown.tt",r),!e.isMsie()||e.isMsie()>9?this.$input.on("input.tt",o):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(t){n[t.which||t.keyCode]||e.defer(e.bind(s._onInput,s,t))}),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(t,e){this.setInputValue(t),this._setQuery(t,e)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(t){this.$input.val(t),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(t){this.$hint.val(t)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var t,e,n;n=(t=this.getInputValue())!==(e=this.getHint())&&0===e.indexOf(t),!(""!==t&&n&&!this.hasOverflow())&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var t=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=t},isCursorAtEnd:function(){var t,n,i;return t=this.$input.val().length,n=this.$input[0].selectionStart,e.isNumber(n)?n===t:!document.selection||((i=document.selection.createRange()).moveStart("character",-t),t===i.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=t("<div>")}}),i;function o(t){return t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}}(),a=function(){"use strict";var n,i;function s(n,r){var o;(n=n||{}).templates=n.templates||{},n.templates.notFound=n.templates.notFound||n.templates.empty,n.source||t.error("missing source"),n.node||t.error("missing node"),n.name&&(o=n.name,!/^[_a-zA-Z0-9-]+$/.test(o))&&t.error("invalid dataset name: "+n.name),r.mixin(this),this.highlight=!!n.highlight,this.name=n.name||i(),this.limit=n.limit||5,this.displayFn=function(t){return t=t||e.stringify,e.isFunction(t)?t:function(e){return e[t]}}(n.display||n.displayKey),this.templates=function(n,i){return{notFound:n.notFound&&e.templatify(n.notFound),pending:n.pending&&e.templatify(n.pending),header:n.header&&e.templatify(n.header),footer:n.footer&&e.templatify(n.footer),suggestion:n.suggestion||function(e){return t("<div>").text(i(e))}}}(n.templates,this.displayFn),this.source=n.source.__ttAdapter?n.source.__ttAdapter():n.source,this.async=e.isUndefined(n.async)?this.source.length>2:!!n.async,this._resetLastSuggestion(),this.$el=t(n.node).addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}return n={val:"tt-selectable-display",obj:"tt-selectable-object"},i=e.getIdGenerator(),s.extractData=function(e){var i=t(e);return i.data(n.obj)?{val:i.data(n.val)||"",obj:i.data(n.obj)||null}:null},e.mixin(s.prototype,r,{_overwrite:function(t,e){(e=e||[]).length?this._renderSuggestions(t,e):this.async&&this.templates.pending?this._renderPending(t):!this.async&&this.templates.notFound?this._renderNotFound(t):this._empty(),this.trigger("rendered",this.name,e,!1)},_append:function(t,e){(e=e||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(t,e):e.length?this._renderSuggestions(t,e):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(t),this.trigger("rendered",this.name,e,!0)},_renderSuggestions:function(t,e){var n;n=this._getSuggestionsFragment(t,e),this.$lastSuggestion=n.children().last(),this.$el.html(n).prepend(this._getHeader(t,e)).append(this._getFooter(t,e))},_appendSuggestions:function(t,e){var n,i;i=(n=this._getSuggestionsFragment(t,e)).children().last(),this.$lastSuggestion.after(n),this.$lastSuggestion=i},_renderPending:function(t){var e=this.templates.pending;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_renderNotFound:function(t){var e=this.templates.notFound;this._resetLastSuggestion(),e&&this.$el.html(e({query:t,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(i,r){var s,a=this;return s=document.createDocumentFragment(),e.each(r,function(e){var r,o;o=a._injectQuery(i,e),r=t(a.templates.suggestion(o)).data(n.obj,e).data(n.val,a.displayFn(e)).addClass(a.classes.suggestion+" "+a.classes.selectable),s.appendChild(r[0])}),this.highlight&&o({className:this.classes.highlight,node:s,pattern:i}),t(s)},_getFooter:function(t,e){return this.templates.footer?this.templates.footer({query:t,suggestions:e,dataset:this.name}):null},_getHeader:function(t,e){return this.templates.header?this.templates.header({query:t,suggestions:e,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=t()},_injectQuery:function(t,n){return e.isObject(n)?e.mixin({_query:t},n):n},update:function(e){var n=this,i=!1,r=!1,o=0;function s(t){r||(r=!0,t=(t||[]).slice(0,n.limit),o=t.length,n._overwrite(e,t),o<n.limit&&n.async&&n.trigger("asyncRequested",e))}this.cancel(),this.cancel=function(){i=!0,n.cancel=t.noop,n.async&&n.trigger("asyncCanceled",e)},this.source(e,s,function(r){r=r||[],!i&&o<n.limit&&(n.cancel=t.noop,o+=r.length,n._append(e,r.slice(0,n.limit-o)),n.async&&n.trigger("asyncReceived",e))}),!r&&s([])},cancel:t.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=t("<div>")}}),s}(),u=function(){"use strict";function n(n,i){var r=this;(n=n||{}).node||t.error("node is required"),i.mixin(this),this.$node=t(n.node),this.query=null,this.datasets=e.map(n.datasets,function(e){var n=r.$node.find(e.node).first();return e.node=n.length?n:t("<div>").appendTo(r.$node),new a(e,i)})}return e.mixin(n.prototype,r,{_onSelectableClick:function(e){this.trigger("selectableClicked",t(e.currentTarget))},_onRendered:function(t,e,n,i){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",e,n,i)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){return e.every(this.datasets,function(t){return t.isEmpty()})},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var t=this.getActiveSelectable();t&&t.removeClass(this.classes.cursor)},_ensureVisible:function(t){var e,n,i,r;n=(e=t.position().top)+t.outerHeight(!0),i=this.$node.scrollTop(),r=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),e<0?this.$node.scrollTop(i+e):r<n&&this.$node.scrollTop(i+(n-r))},bind:function(){var t,n=this;return t=e.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,t),e.each(this.datasets,function(t){t.onSync("asyncRequested",n._propagate,n).onSync("asyncCanceled",n._propagate,n).onSync("asyncReceived",n._propagate,n).onSync("rendered",n._onRendered,n).onSync("cleared",n._onCleared,n)}),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.addClass(this.classes.open)},close:function(){this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(t){this.$node.attr("dir",t)},selectableRelativeToCursor:function(t){var e,n,i;return n=this.getActiveSelectable(),e=this._getSelectables(),-1===(i=(i=((i=(n?e.index(n):-1)+t)+1)%(e.length+1)-1)<-1?e.length-1:i)?null:e.eq(i)},setCursor:function(t){this._removeCursor(),(t=t&&t.first())&&(t.addClass(this.classes.cursor),this._ensureVisible(t))},getSelectableData:function(t){return t&&t.length?a.extractData(t):null},getActiveSelectable:function(){var t=this._getSelectables().filter(this.selectors.cursor).first();return t.length?t:null},getTopSelectable:function(){var t=this._getSelectables().first();return t.length?t:null},update:function(t){var n=t!==this.query;return n&&(this.query=t,e.each(this.datasets,function(e){e.update(t)})),n},empty:function(){e.each(this.datasets,function(t){t.clear()}),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){this.$node.off(".tt"),this.$node=t("<div>"),e.each(this.datasets,function(t){t.destroy()})}}),n}(),l=function(){"use strict";var t=u.prototype;function n(){u.apply(this,[].slice.call(arguments,0))}return e.mixin(n.prototype,u.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),t.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),t.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),t._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(e){return this.$node.css("ltr"===e?this.css.ltr:this.css.rtl),t.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),n}(),c=function(){"use strict";function n(n,r){var o,s,a,u,l,c,f,h,p,d,m;(n=n||{}).input||t.error("missing input"),n.menu||t.error("missing menu"),n.eventBus||t.error("missing event bus"),r.mixin(this),this.eventBus=n.eventBus,this.minLength=e.isNumber(n.minLength)?n.minLength:1,this.input=n.input,this.menu=n.menu,this.enabled=!0,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),o=i(this,"activate","open","_onFocused"),s=i(this,"deactivate","_onBlurred"),a=i(this,"isActive","isOpen","_onEnterKeyed"),u=i(this,"isActive","isOpen","_onTabKeyed"),l=i(this,"isActive","_onEscKeyed"),c=i(this,"isActive","open","_onUpKeyed"),f=i(this,"isActive","open","_onDownKeyed"),h=i(this,"isActive","isOpen","_onLeftKeyed"),p=i(this,"isActive","isOpen","_onRightKeyed"),d=i(this,"_openIfActive","_onQueryChanged"),m=i(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",o,this).onSync("blurred",s,this).onSync("enterKeyed",a,this).onSync("tabKeyed",u,this).onSync("escKeyed",l,this).onSync("upKeyed",c,this).onSync("downKeyed",f,this).onSync("leftKeyed",h,this).onSync("rightKeyed",p,this).onSync("queryChanged",d,this).onSync("whitespaceChanged",m,this).onSync("langDirChanged",this._onLangDirChanged,this)}return e.mixin(n.prototype,{_hacks:function(){var n,i;n=this.input.$input||t("<div>"),i=this.menu.$node||t("<div>"),n.on("blur.tt",function(t){var r,o,s;r=document.activeElement,o=i.is(r),s=i.has(r).length>0,e.isMsie()&&(o||s)&&(t.preventDefault(),t.stopImmediatePropagation(),e.defer(function(){n.focus()}))}),i.on("mousedown.tt",function(t){t.preventDefault()})},_onSelectableClicked:function(t,e){this.select(e)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(t,e,n,i){this._updateHint(),this.eventBus.trigger("render",n,i,e)},_onAsyncRequested:function(t,e,n){this.eventBus.trigger("asyncrequest",n,e)},_onAsyncCanceled:function(t,e,n){this.eventBus.trigger("asynccancel",n,e)},_onAsyncReceived:function(t,e,n){this.eventBus.trigger("asyncreceive",n,e)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())&&this.select(n)&&e.preventDefault()},_onTabKeyed:function(t,e){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&e.preventDefault():(n=this.menu.getTopSelectable())&&this.autocomplete(n)&&e.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getTopSelectable())},_onQueryChanged:function(t,e){this._minLengthMet(e)?this.menu.update(e):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(t,e){this.dir!==e&&(this.dir=e,this.menu.setLanguageDirection(e))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(t){return(t=e.isString(t)?t:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var t,n,i,r,o,a;t=this.menu.getTopSelectable(),n=this.menu.getSelectableData(t),i=this.input.getInputValue(),!n||e.isBlankString(i)||this.input.hasOverflow()?this.input.clearHint():(r=s.normalizeQuery(i),o=e.escapeRegExChars(r),(a=new RegExp("^(?:"+o+")(.+$)","i").exec(n.val))&&this.input.setHint(i+a[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(t){this.input.setQuery(e.toStr(t))},getVal:function(){return this.input.getQuery()},select:function(t){var e=this.menu.getSelectableData(t);return!(!e||this.eventBus.before("select",e.obj))&&(this.input.setQuery(e.val,!0),this.eventBus.trigger("select",e.obj),this.close(),!0)},autocomplete:function(t){var e,n;return e=this.input.getQuery(),!(!((n=this.menu.getSelectableData(t))&&e!==n.val)||this.eventBus.before("autocomplete",n.obj))&&(this.input.setQuery(n.val),this.eventBus.trigger("autocomplete",n.obj),!0)},moveCursor:function(t){var e,n,i,r;return e=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(t),r=(i=this.menu.getSelectableData(n))?i.obj:null,!(this._minLengthMet()&&this.menu.update(e))&&!this.eventBus.before("cursorchange",r)&&(this.menu.setCursor(n),i?this.input.setInputValue(i.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",r),!0)},destroy:function(){this.input.destroy(),this.menu.destroy()}}),n;function i(t){var n=[].slice.call(arguments,1);return function(){var i=[].slice.call(arguments);e.each(n,function(e){return t[e].apply(t,i)})}}}();!function(){"use strict";var r,o,a;function f(e,n){e.each(function(){var e,i=t(this);(e=i.data(o.typeahead))&&n(e,i)})}function h(n){var i;return(i=e.isJQuery(n)||e.isElement(n)?t(n).first():[]).length?i:null}r=t.fn.typeahead,o={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},a={initialize:function(r,a){var f;return a=e.isArray(a)?a:[].slice.call(arguments,1),f=n((r=r||{}).classNames),this.each(function(){var n,p,d,m,v,g,y,_,b,w,k;e.each(a,function(t){t.highlight=!!r.highlight}),n=t(this),p=t(f.html.wrapper),d=h(r.hint),m=h(r.menu),v=!1!==r.hint&&!d,g=!1!==r.menu&&!m,v&&(d=function(t,e){return t.clone().addClass(e.classes.hint).removeData().css(e.css.hint).css((n=t,{backgroundAttachment:n.css("background-attachment"),backgroundClip:n.css("background-clip"),backgroundColor:n.css("background-color"),backgroundImage:n.css("background-image"),backgroundOrigin:n.css("background-origin"),backgroundPosition:n.css("background-position"),backgroundRepeat:n.css("background-repeat"),backgroundSize:n.css("background-size")})).prop("readonly",!0).removeAttr("id name placeholder required").attr({autocomplete:"off",spellcheck:"false",tabindex:-1});var n}(n,f)),g&&(m=t(f.html.menu).css(f.css.menu)),d&&d.val(""),n=function(t,e){t.data(o.attrs,{dir:t.attr("dir"),autocomplete:t.attr("autocomplete"),spellcheck:t.attr("spellcheck"),style:t.attr("style")}),t.addClass(e.classes.input).attr({autocomplete:"off",spellcheck:!1});try{!t.attr("dir")&&t.attr("dir","auto")}catch(t){}return t}(n,f),(v||g)&&(p.css(f.css.wrapper),n.css(v?f.css.input:f.css.inputWithNoHint),n.wrap(p).parent().prepend(v?d:null).append(g?m:null));k=g?l:u,y=new i({el:n}),_=new s({hint:d,input:n},f),b=new k({node:m,datasets:a},f),w=new c({input:_,menu:b,eventBus:y,minLength:r.minLength},f),n.data(o.www,f),n.data(o.typeahead,w)})},isEnabled:function(){var t;return f(this.first(),function(e){t=e.isEnabled()}),t},enable:function(){return f(this,function(t){t.enable()}),this},disable:function(){return f(this,function(t){t.disable()}),this},isActive:function(){var t;return f(this.first(),function(e){t=e.isActive()}),t},activate:function(){return f(this,function(t){t.activate()}),this},deactivate:function(){return f(this,function(t){t.deactivate()}),this},isOpen:function(){var t;return f(this.first(),function(e){t=e.isOpen()}),t},open:function(){return f(this,function(t){t.open()}),this},close:function(){return f(this,function(t){t.close()}),this},select:function(e){var n=!1,i=t(e);return f(this.first(),function(t){n=t.select(i)}),n},autocomplete:function(e){var n=!1,i=t(e);return f(this.first(),function(t){n=t.autocomplete(i)}),n},moveCursor:function(t){var e=!1;return f(this.first(),function(n){e=n.moveCursor(t)}),e},val:function(t){var e;return arguments.length?(f(this,function(e){e.setVal(t)}),this):(f(this.first(),function(t){e=t.getVal()}),e)},destroy:function(){return f(this,function(t,n){!function(t){var n,i;n=t.data(o.www),i=t.parent().filter(n.selectors.wrapper),e.each(t.data(o.attrs),function(n,i){e.isUndefined(n)?t.removeAttr(i):t.attr(i,n)}),t.removeData(o.typeahead).removeData(o.www).removeData(o.attr).removeClass(n.classes.input),i.length&&(t.detach().insertAfter(i),i.remove())}(n),t.destroy()}),this}},t.fn.typeahead=function(t){return a[t]?a[t].apply(this,[].slice.call(arguments,1)):a.initialize.apply(this,arguments)},t.fn.typeahead.noConflict=function(){return t.fn.typeahead=r,this}}()})}(),i()}),$__System.registerDynamic("github:twitter/typeahead.js@0.11.1.js",["github:twitter/typeahead.js@0.11.1/dist/typeahead.bundle.js"],!0,function(t,e,n){this||self;n.exports=t("github:twitter/typeahead.js@0.11.1/dist/typeahead.bundle.js")}),$__System.register("components/predictive-input/predictive-input.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","components/events/form-events.js","components/events/predictive-input-events.js","github:twitter/typeahead.js@0.11.1.js"],function(t){"use strict";var e,n,i,r,o,s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){n=t.default},function(t){i=t.configurable},function(t){t.FormEvents},function(t){r=t.PredictiveInputEvents},function(t){}],execute:function(){o=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a(Object.getPrototypeOf(u.prototype),"constructor",this).call(this,t,e),this._initialize()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,e),s(o,[{key:"_initialize",value:function(){this._initialiseTypeahead(),this._registerEventHandlers()}},{key:"_initialiseTypeahead",value:function(){var t=this.config.datasource,e=this.config.datasourceDataType,i=void 0,r={datumTokenizer:Bloodhound.tokenizers.obj.whitespace("disp"),queryTokenizer:Bloodhound.tokenizers.whitespace};"string"==typeof t?(r.remote={url:t,wildcard:"%QUERY",prepare:function(t,n){return n.url=n.url.replace("%QUERY",t),n.dataType=e,n}},i=new Bloodhound(r)):(r.local=t,i=new Bloodhound(r));"hash"!==this.config.datasourceType&&"remote-hash"!==this.config.datasourceType||this.config.datasourceDisplayKey,this.predictiveInputElement=n(this.config.elementInputSelector,this.$el).typeahead({highlight:!1,hint:!1,minLength:this.config.minLength,classNames:{wrapper:"b-predictive-input__wrapper",menu:"b-predictive-input__menu",suggestion:"b-predictive-input__suggestion",cursor:"b-predictive-input__cursor"}},{name:"suggestion-engine",display:"disp",source:i,limit:this.config.resultsCount})}},{key:"_registerEventHandlers",value:function(){this.predictiveInputElement.on(r.TYPEAHEAD_SELECT,this._handleSelectOption.bind(this)),this.config.clearInputOnSelect&&this.predictiveInputElement.on(r.TYPEAHEAD_CHANGE,this._clearFormElement.bind(this))}},{key:"_handleSelectOption",value:function(t,e){var n=e;"string"==typeof e&&(n={}),n.searchTerm=this.predictiveInputElement.typeahead("val"),this.$el.trigger(r.SELECT,n)}},{key:"_clearFormElement",value:function(){this.predictiveInputElement.val("")}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new o(t,e)}}]);var u=o;return o=i({minLength:3,datasource:[],datasourceType:"array",datasourceDataType:"jsonp",datasourceDisplayKey:"name",resultsCount:5,elementInputSelector:".b-predictive-input__input",elementSelectedValueSelector:".b-js-predictive-input-hidden-input",clearInputOnSelect:!1})(o)||o}(),t("PredictiveInput",o)}}}),$__System.register("components/stickler/stickler.js",["github:components/jquery@1.11.3.js","lib/config.js","lib/grab.js","lib/component.js","helpers/helpers.js"],function(t){"use strict";var e,n,i,r,o,s,a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.configurable},function(t){n=t.default},function(t){i=t.default},function(t){r=t.Helpers}],execute:function(){o="b-js-stickler-wrapper",s=function(t){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),u(Object.getPrototypeOf(l.prototype),"constructor",this).call(this,t,e),this._checkStatus=this._checkStatus.bind(this),this._attach=this._attach.bind(this),this._release=this._release.bind(this),this._checkStatus(),this._registerEventListeners()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,i),a(s,[{key:"_registerEventListeners",value:function(){window.addEventListener("scroll",this._checkStatus),window.addEventListener("resize",this._checkStatus),window.addEventListener("orientationchange",this._checkStatus)}},{key:"_checkStatus",value:function(){(r.Browser.getScrollTopPosition()>this.$el.position().top?this._attach:this._release)()}},{key:"_attach",value:function(){this.$el.css("height",n("."+o,this.$el).height()+"px"),n("."+o,this.$el).addClass(this.config.stickyClass)}},{key:"_release",value:function(){this.$el.css("height","auto"),n("."+o,this.$el).removeClass(this.config.stickyClass)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new s(t,e)}}]);var l=s;return s=e({stayInside:null,stickyClass:null,stickTo:null,offset:null,jqNs:"stickler"})(s)||s}(),t("Stickler",s)}}}),$__System.register("components/tooltip/tooltip.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","components/events/tooltip-events.js"],function(t){"use strict";var e,n,i,r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){t.default},function(t){n=t.configurable},function(t){i=t.TooltipEvents}],execute:function(){r=function(t){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),s(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,t,e),this._initialize(),this._registerEventHandlers()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,e),o(r,[{key:"_initialize",value:function(){this.$el.attr("data-balloon",""),this.$el.attr("data-balloon-pos",this.config.tooltipPosition||"up")}},{key:"_registerEventHandlers",value:function(){this.on(i.SHOW,this._show.bind(this)),this.on(i.HIDE,this._hide.bind(this))}},{key:"_show",value:function(t,e){"object"==typeof e&&this.$el.attr("data-balloon",e.text).addClass("b-tooltip--force-show")}},{key:"_hide",value:function(t){this.$el.removeClass("b-tooltip--force-show")}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new r(t,e)}}]);var a=r;return r=n({tooltipPosition:"up",jqNs:"tooltipEvents"})(r)||r}(),t("Tooltip",r)}}}),$__System.register("components/dynamic-mobile-navigation/dynamic-mobile-navigation.js",["lib/component.js","lib/grab.js","lib/config.js"],function(t){"use strict";var e,n,i,r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.configurable}],execute:function(){r=function(t){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),s(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,t,e),this._buildLeftNav()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,e),o(r,[{key:"_buildLeftNav",value:function(){var t=n(this.config.sourceNavSelector,n(this.config.sourceNavContainer,this.$el)),e=n(this.config.targetNavSelector,n(this.config.targetNavContainer,this.$el)),i=new RegExp(this.config.reversedRegex);this.config.reversedRegex&&i.test(window.location.href)?t.html(e.html()):e.html(t.html()),n(this.config.sourceNavContainer,this.$el).removeClass("b-hidden--opacity"),n(this.config.targetNavContainer,this.$el).removeClass("b-hidden--opacity")}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new r(t,e)}}]);var a=r;return r=i({reversedRegex:null,sourceNavContainer:".b-js-dynamic-mobile-nav-source-container",sourceNavSelector:".leftHandNavigationModule",targetNavContainer:".b-js-dynamic-mobile-nav-target-container",targetNavSelector:".leftHandNavigationModule"})(r)||r}(),t("DynamicMobileNavigation",r)}}}),$__System.register("components/events-list/events-list.js",["npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js","helpers/helpers.js","components/constants/constants.js","components/events/dropdown-events.js"],function(t){"use strict";var e,n,i,r,o,s,a,u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){n=t.default},function(t){i=t.configurable},function(t){t.Helpers},function(t){r=t.Constants},function(t){o=t.DropdownEvents}],execute:function(){s=r.SECTION_MAX_WIDTH/3+1,a=function(t){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),l(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,t,e),this.fullVersionMinWidth=this.config.fullVersionMinWidth||s,this.dateFilterData=null,this._updateState=this._updateState.bind(this),this._showEvents=this._showEvents.bind(this),this._handleDateFilterChange=this._handleDateFilterChange.bind(this),this._updateState(),this._showEvents(this.config.defaultDisplayDateList),window.addEventListener("resize",this._updateState),window.addEventListener("orientationchange",this._updateState),0!=n(this.config.dateFilterHolderSelector,this.$el).length&&this.on(o.DROPDOWN_SELECT,this._handleDateFilterChange)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,e),u(r,[{key:"_updateState",value:function(){this.$el.width()>=this.fullVersionMinWidth?this.$el.addClass(this.config.fullVersionCssClass):this.$el.removeClass(this.config.fullVersionCssClass)}},{key:"_showEvents",value:function(t){this.$el.find(""+this.config.dateListSelector).hide(),this.$el.find(this.config.dateListSelector+'[data-option="'+t+'"]').show()}},{key:"_handleDateFilterChange",value:function(t){this._showEvents($(t.target).val())}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new r(t,e)}}]);var a=r;return r=i({fullVersionMinWidth:null,fullVersionCssClass:"b-events-list--full-version",dateListSelector:".b-js-events-list__date-list",dateFilterHolderSelector:".b-js-events-list__date-filter-holder",defaultDisplayDateList:"All events"})(r)||r}(),t("EventsList",a)}}}),$__System.register("components/component-ctrl/component-ctrl.js",["lib/component.js","lib/grab.js","lib/config.js","helpers/helpers.js","components/constants/constants.js"],function(t){"use strict";var e,n,i,r,o,s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){t.default},function(t){n=t.configurable},function(t){t.Helpers},function(t){i=t.Constants}],execute:function(){r=i.SECTION_MAX_WIDTH/3+1,o=function(t){function i(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),a(Object.getPrototypeOf(o.prototype),"constructor",this).call(this,t,e),this.breakPointWidth=this.config.breakPointWidth,this._updateState=this._updateState.bind(this),this._updateState(),this.config.classHidden&&this.$el.removeClass(this.config.classHidden),window.addEventListener("resize",this._updateState),window.addEventListener("orientationchange",this._updateState)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(i,e),s(i,[{key:"_updateState",value:function(){this.$el.width()>=this.config.breakPoint?(this.config.classSmWidth&&this.$el.removeClass(this.config.classSmWidth),this.config.classLgWidth&&this.$el.addClass(this.config.classLgWidth)):(this.config.classLgWidth&&this.$el.removeClass(this.config.classLgWidth),this.config.classSmWidth&&this.$el.addClass(this.config.classSmWidth))}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new i(t,e)}}]);var o=i;return i=n({breakPoint:r,classSmWidth:null,classLgWidth:null,classHidden:null})(i)||i}(),t("ComponentCtrl",o)}}}),$__System.registerDynamic("npm:incremental-dom@0.5.1/dist/incremental-dom-cjs.js",["github:jspm/nodelibs-process@0.1.2.js"],!0,function(t,e,n){this||self;!function(t){"use strict";var n=Object.prototype.hasOwnProperty;function i(){}i.prototype=Object.create(null);var r=function(){return new i};var o=function(t,e,n){var i=new function(t,e){this.attrs=r(),this.attrsArr=[],this.newAttrs=r(),this.staticsApplied=!1,this.key=e,this.keyMap=r(),this.keyMapValid=!0,this.focused=!1,this.nodeName=t,this.text=null}(e,n);return t.__incrementalDOMData=i,i},s=function(t){return a(t),t.__incrementalDOMData},a=function(t){if(!t.__incrementalDOMData){var e=t instanceof Element,n=e?t.localName:t.nodeName,i=e?t.getAttribute("key"):null,r=o(t,n,i);if(i&&(s(t.parentNode).keyMap[i]=t),e)for(var u=t.attributes,l=r.attrs,c=r.newAttrs,f=r.attrsArr,h=0;h<u.length;h+=1){var p=u[h],d=p.name,m=p.value;l[d]=m,c[d]=void 0,f.push(d),f.push(m)}for(var v=t.firstChild;v;v=v.nextSibling)a(v)}},u=function(t,e,n,i){var r=function(t,e){return"svg"===t?"http://www.w3.org/2000/svg":"foreignObject"===s(e).nodeName?null:e.namespaceURI}(n,e),a=void 0;return a=r?t.createElementNS(r,n):t.createElement(n),o(a,n,i),a},l={nodesCreated:null,nodesDeleted:null};function c(){this.created=l.nodesCreated&&[],this.deleted=l.nodesDeleted&&[]}c.prototype.markCreated=function(t){this.created&&this.created.push(t)},c.prototype.markDeleted=function(t){this.deleted&&this.deleted.push(t)},c.prototype.notifyChanges=function(){this.created&&this.created.length>0&&l.nodesCreated(this.created),this.deleted&&this.deleted.length>0&&l.nodesDeleted(this.deleted)};var f=function(t){var e=function(t){for(var e=t,n=e;e;)n=e,e=e.parentNode;return n}(t);return function(t){return t instanceof Document||t instanceof DocumentFragment}(e)?e.activeElement:null},h=null,p=null,d=null,m=null,v=function(t,e){for(var n=0;n<t.length;n+=1)s(t[n]).focused=e},g=function(t){return function(e,n,i){var r=h,o=m,s=p,a=d;h=new c,m=e.ownerDocument;var u=function(t,e){var n=f(t);return n&&t.contains(n)?function(t,e){for(var n=[],i=t;i!==e;)n.push(i),i=i.parentNode;return n}(n,e):[]}(e,d=e.parentNode);v(u,!0);var l=t(e,n,i);return v(u,!1),h.notifyChanges(),h=r,m=o,p=s,d=a,l}},y=g(function(t,e,n){return p=t,S(),e(n),E(),t}),_=g(function(t,e,n){var i={nextSibling:t};return p=i,e(n),t!==p&&t.parentNode&&k(d,t,s(d).keyMap),i===p?null:p}),b=function(t,e,n){var i=s(t);return e===i.nodeName&&n==i.key},w=function(t,e){if(!p||!b(p,t,e)){var n=s(d),i=p&&s(p),r=n.keyMap,a=void 0;if(e){var l=r[e];l&&(b(l,t,e)?a=l:l===p?h.markDeleted(l):k(d,l,r))}a||(a="#text"===t?function(t){var e=t.createTextNode("");return o(e,"#text",null),e}(m):u(m,d,t,e),e&&(r[e]=a),h.markCreated(a)),s(a).focused?function(t,e,n){for(var i=e.nextSibling,r=n;r!==e;){var o=r.nextSibling;t.insertBefore(r,i),r=o}}(d,a,p):i&&i.key&&!i.focused?(d.replaceChild(a,p),n.keyMapValid=!1):d.insertBefore(a,p),p=a}},k=function(t,e,n){t.removeChild(e),h.markDeleted(e);var i=s(e).key;i&&delete n[i]},S=function(){d=p,p=null},x=function(){return p?p.nextSibling:d.firstChild},j=function(){p=x()},E=function(){!function(){var t=d,e=s(t),n=e.keyMap,i=e.keyMapValid,r=t.lastChild,o=void 0;if(r!==p||!i){for(;r!==p;)k(t,r,n),r=t.lastChild;if(!i){for(o in n)(r=n[o]).parentNode!==t&&(h.markDeleted(r),delete n[o]);e.keyMapValid=!0}}}(),p=d,d=d.parentNode},C=j,T={default:"__default"},O=function(t,e,n){if(null==n)t.removeAttribute(e);else{var i=function(t){return 0===t.lastIndexOf("xml:",0)?"http://www.w3.org/XML/1998/namespace":0===t.lastIndexOf("xlink:",0)?"http://www.w3.org/1999/xlink":void 0}(e);i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}},P=function(t,e,n){t[e]=n},A=function(t,e,n){e.indexOf("-")>=0?t.setProperty(e,n):t[e]=n},D=function(t,e,n){var i=s(t).attrs;i[e]!==n&&((L[e]||L[T.default])(t,e,n),i[e]=n)},L=r();L[T.default]=function(t,e,n){var i=typeof n;"object"===i||"function"===i?P(t,e,n):O(t,e,n)},L.style=function(t,e,i){if("string"==typeof i)t.style.cssText=i;else{t.style.cssText="";var r=t.style,o=i;for(var s in o)a=o,u=s,n.call(a,u)&&A(r,s,o[s])}var a,u};var N=[],I=function(t,e,n,i){var r=function(t,e){return j(),w(t,e),S(),d}(t,e),o=s(r);if(!o.staticsApplied){if(n)for(var a=0;a<n.length;a+=2){var u=n[a],l=n[a+1];D(r,u,l)}o.staticsApplied=!0}for(var c=o.attrsArr,f=o.newAttrs,h=!c.length,p=3,m=0;p<arguments.length;p+=2,m+=2){var v=arguments[p];if(h)c[m]=v,f[v]=void 0;else if(c[m]!==v)break;l=arguments[p+1];(h||c[m+1]!==l)&&(c[m+1]=l,D(r,v,l))}if(p<arguments.length||m<c.length){for(;p<arguments.length;p+=1,m+=1)c[m]=arguments[p];for(m<c.length&&(c.length=m),p=0;p<c.length;p+=2){u=c[p],l=c[p+1];f[u]=l}for(var g in f)D(r,g,f[g]),f[g]=void 0}return r},M=function(t){var e=(E(),p);return e};e.patch=y,e.patchInner=y,e.patchOuter=_,e.currentElement=function(){return d},e.currentPointer=function(){return x()},e.skip=function(){p=d.lastChild},e.skipNode=C,e.elementVoid=function(t,e,n,i){return I.apply(null,arguments),M()},e.elementOpenStart=function(t,e,n){N[0]=t,N[1]=e,N[2]=n},e.elementOpenEnd=function(){var t=I.apply(null,N);return N.length=0,t},e.elementOpen=I,e.elementClose=M,e.text=function(t,e){var n=(j(),w("#text",null),p),i=s(n);if(i.text!==t){i.text=t;for(var r=t,o=1;o<arguments.length;o+=1)r=(0,arguments[o])(r);n.data=r}return n},e.attr=function(t,e){N.push(t),N.push(e)},e.symbols=T,e.attributes=L,e.applyAttr=O,e.applyProp=P,e.notifications=l,e.importNode=a}(t("github:jspm/nodelibs-process@0.1.2.js"))}),$__System.registerDynamic("npm:incremental-dom@0.5.1.js",["npm:incremental-dom@0.5.1/dist/incremental-dom-cjs.js"],!0,function(t,e,n){this||self;n.exports=t("npm:incremental-dom@0.5.1/dist/incremental-dom-cjs.js")}),$__System.register("lib/dynamic-view.js",["github:components/jquery@1.11.3.js","helpers/helpers.js","npm:incremental-dom@0.5.1.js"],function(t){"use strict";var e,n,i,r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default},function(t){n=t.Helpers},function(t){i=t.default}],execute:function(){r=function(){function t(){var i=arguments.length<=0||void 0===arguments[0]?{templateFn:templateFn,$container:$container,vm:vm,id:id}:arguments[0];if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Object.is(i,void 0))throw new Error("options params is not provided");if(Object.is(i.templateFn,void 0))throw new Error("to initialise a view template function is necessary ");if(Object.is(i.$container,void 0))throw new Error("to initialise a container to mount template on is necessary ");this._id=i.id?i.id+"-view":n.Strings.random(8)+"-view",this._el=document.createElement("div"),n.Element.addProperty(this._id,this._el),this._$container=i.$container,this._templateFn=i.templateFn,this._vm=i.vm,this.render(),e(this._$container).append(this._el)}return o(t,[{key:"render",value:function(){i.patch(this._el,this._templateFn,this._vm)}},{key:"destroy",value:function(){for(var t in e(this._el).empty(),e(this._$container).empty(),this)this.hasOwnProperty(t)&&delete this[t]}}]),t}(),t("DynamicView",r)}}}),$__System.registerDynamic("github:ElliotNB/observable-slim@master/observable-slim.js",[],!0,function(t,e,n){this||self;var i,r,o,s,a,u=(i=[],r=[],o=[],s=null,a=function(t,e,n,u){var l=n||null,c=u||"",f=[],h=function(t,e){return t instanceof Array?""!==c?c:e:""!==c?c+"."+e:e},p=function(t){if(!0!==l.paused)if(!0===e)setTimeout(function(){if(t===f.length){for(var e=0;e<l.observers.length;e++)l.observers[e](f);f=[]}},10);else{for(var n=0;n<l.observers.length;n++)l.observers[n](f);f=[]}},d={get:function(t,n){if("__getTarget"===n)return t;if("__isProxy"===n)return!0;if("__getParent"===n)return function(e){if(void 0===e)e=1;var n,i=h(t,"__getParent").split(".");return i.splice(-(e+1),e+1),n=l.parentProxy,i.join(".").split(".").reduce(function(t,e){return t?t[e]:void 0},n||self)};var i=t[n];if(!(i instanceof Object&&null!==i&&t.hasOwnProperty(n)))return i;!0===i.__isProxy&&(i=i.__getTarget);for(var r=-1,o=l.targets,s=0,u=o.length;s<u;s++)if(i===o[s]){r=s;break}return r>-1?l.proxies[r]:a(i,e,l,""!==c?c+"."+n:n)},deleteProperty:function(t,e){var n=!0;s===m&&(n=!1,s=null);var i=Object.assign({},t),a=h(t,e);if(f.push({type:"delete",target:t,property:e,newValue:null,previousValue:i[e],currentPath:a,proxy:m}),!0===n){for(var u=0,l=r.length;u<l&&t!==r[u];u++);for(var c=o[u],d=c.length;d--;)c[d].proxy!==m&&(s=c[d].proxy,delete c[d].proxy[e]);delete t[e]}return p(f.length),!0},set:function(t,e,n,i){var a=!0;s===m&&(a=!1,s=null);var u=t[e];if(u!==n||!1===a){var c=typeof u,d=h(t,e),v="update";if("undefined"===c&&(v="add"),f.push({type:v,target:t,property:e,newValue:n,previousValue:i[e],currentPath:d,proxy:m}),!0===a){for(var g=0,y=r.length;g<y&&t!==r[g];g++);var _=o[g],b=0;for(y=_.length;b<y;b++)_[b].proxy!==m&&(s=_[b].proxy,_[b].proxy[e]=n);setTimeout(function(){"object"===c&&null!==u&&function t(e){for(var n=Object.keys(e),i=0,s=n.length;i<s;i++){var a=e[n[i]];a instanceof Object&&null!==a&&t(a)}var u=-1;for(i=0,s=r.length;i<s;i++)if(e===r[i]){u=i;break}if(u>-1){for(var c=o[u],f=c.length;f--;)if(l===c[f].observable){c.splice(f,1);break}0==c.length&&(o.splice(u,1),r.splice(u,1))}}(u)},1e4),t[e]=n}p(f.length)}return!0}},m=new Proxy(t,d);null===l?(l={parentTarget:t,domDelay:e,parentProxy:m,observers:[],targets:[t],proxies:[m],paused:!1,path:c},i.push(l)):(l.targets.push(t),l.proxies.push(m));for(var v={target:t,proxy:m,observable:l},g=-1,y=0,_=r.length;y<_;y++)if(t===r[y]){g=y;break}return g>-1?o[g].push(v):(r.push(t),o.push([v]),g=r.length-1),m},{create:function(t,e,n){!0===t.__isProxy&&(t=t.__getTarget);var i=a(t,e);return"function"==typeof n&&this.observe(i,n),function t(e){for(var n=e.__getTarget,i=Object.keys(n),r=0,o=i.length;r<o;r++){var s=i[r];n[s]instanceof Object&&null!==n[s]&&t(e[s])}}(i),i},observe:function(t,e){for(var n=i.length;n--;)if(i[n].parentProxy===t){i[n].observers.push(e);break}},pause:function(t){for(var e=i.length,n=!1;e--;)if(i[e].parentProxy===t){i[e].paused=!0,n=!0;break}if(0==n)throw new Error("ObseravableSlim could not pause observable -- matching proxy not found.")},resume:function(t){for(var e=i.length,n=!1;e--;)if(i[e].parentProxy===t){i[e].paused=!1,n=!0;break}if(0==n)throw new Error("ObseravableSlim could not resume observable -- matching proxy not found.")},remove:function(t){for(var e=null,n=!1,s=i.length;s--;)if(i[s].parentProxy===t){e=i[s],n=!0;break}for(var a=o.length;a--;)for(var u=o[a].length;u--;)o[a][u].observable===e&&(o[a].splice(u,1),0==o[a].length&&(o.splice(a,1),r.splice(a,1)));!0===n&&i.splice(s,1)}});try{n.exports=u}catch(t){}}),$__System.registerDynamic("github:ElliotNB/observable-slim@master.js",["github:ElliotNB/observable-slim@master/observable-slim.js"],!0,function(t,e,n){this||self;n.exports=t("github:ElliotNB/observable-slim@master/observable-slim.js")}),$__System.register("lib/featured-component.js",["github:components/jquery@1.11.3.js","lib/constants.js","helpers/helpers.js","lib/dynamic-view.js","npm:lodash@4.17.4.js","github:ElliotNB/observable-slim@master.js"],function(t){"use strict";var e,n,i,r,o,s,a,u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default},function(t){n=t.Constants},function(t){i=t.Helpers},function(t){r=t.DynamicView},function(t){o=t.default},function(t){s=t.default}],execute:function(){a=function(){function t(n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$el=e(n),this._id=this.constructor.name+"-"+i.Strings.random(4),"function"==typeof this.configure&&this.configure(r,this.$el),this._childElements=this._createChildElements(this.$el),this._data={},this._dynamicPartials=new Set,this._notifications=this._initNotifications(),this._bindThisToHandlers()}return u(t,[{key:"_createDynamicPartial",value:function(){var t=arguments.length<=0||void 0===arguments[0]?{templateFn:templateFn,$container:$container,vm:{data:data,proxy:proxy,handlers:handlers},data:data,proxy:proxy,handlers:handlers,callback:callback}:arguments[0];return function(){if(Object.is(t,void 0))console.error("options params is not provided");else{if(!Object.is(t.templateFn,void 0)){var e,n=this._id+"-"+i.Strings.random(4),r=t.$container||this.$el,o=void 0,s=void 0,a=void 0,u=void 0,l=void 0,c=t.callback||function(t){o&&o.render()};return Object.is(t.vm,void 0)?(a=t.data||this._data,u=t.handlers||this._createDefaultViewHandlers(),l=t.proxy||this._createProxy(a,t.callback||c),s=this._createViewModel({data:a,proxy:l,handlers:u,id:n})):s=t.vm,e={id:n,view:o=this._createDynamicView({templateFn:t.templateFn,$container:r,vm:s,id:n}),vm:s,$container:r,callback:c},this._dynamicPartials.add(e),e}console.error("to initialise an dynamic partial, a template function is necessary ")}}.apply(this,arguments)}},{key:"_createDefaultViewHandlers",value:function(){var t=this;return new Proxy({},{get:function(e,n,i){if(t._validateHandlerProperty(n))return t[n];console.error("a view handler shouldn't be a private function or compnent destroy function")}})}},{key:"_createDynamicView",value:function(t){var e=t.templateFn,n=t.$container,i=void 0===n?this.$el:n,o=t.vm,s=t.id;return new r({templateFn:e,$container:i,vm:o,id:s})}},{key:"_createViewModel",value:function(){var t=arguments.length<=0||void 0===arguments[0]?{data:data,proxy:proxy,handlers:handlers,id:id}:arguments[0];return{id:t.id?t.id+"-vm":"vm-"+i.Strings.random(8),data:t.data,proxy:t.proxy,handlers:t.handlers}}},{key:"_createProxy",value:function(t,e){return s.create(t,!0,e)}},{key:"_createChildElements",value:function(t){return new Proxy(t,{get:function(t,e,n){return i.Element.get(e,t)}})}},{key:"_getElement",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?n.ELEMENT_PROPERTY:arguments[1];return i.Element.get(t,this.$el,{attribute:e})}},{key:"_listElements",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?n.ELEMENT_PROPERTY:arguments[1];return i.Element.listElements(t,this.$el,{attribute:e})}},{key:"_bindThisToHandlers",value:function(){var t=!0,e=!1,n=void 0;try{for(var i,r=Object.getOwnPropertyNames(Object.getPrototypeOf(this))[Symbol.iterator]();!(t=(i=r.next()).done);t=!0){var o=i.value,s=this[o];s instanceof Function&&s!==this&&this._validateHandlerProperty(o)&&(this[o]=this[o].bind(this))}}catch(t){e=!0,n=t}finally{try{!t&&r.return&&r.return()}finally{if(e)throw n}}}},{key:"_validateHandlerProperty",value:function(t){return!(t.startsWith("_")||"function"!=typeof this[t]||!Object.is(["destroy","on","off","configure"].find(function(e){return e===t}),void 0))}},{key:"_callHook",value:function(){var t=arguments.length<=0||void 0===arguments[0]?this.$el[0]:arguments[0];if(!window[n.GLOBAL_INSTANCE])throw new Error("Global instance missing, call hook fail");window[n.GLOBAL_INSTANCE].garfield.init(t)}},{key:"_subscribeToData",value:function(t,e){var n=arguments.length<=2||void 0===arguments[2]?this.handleNotification:arguments[2];Object.is(t,void 0)?console.error("dataService is not provided"):Object.is(e,void 0)?console.error("mapping keyPath is not provided"):this._notifications.push(t.subscribe(e,n,this._id))}},{key:"_createSubscriptionData",value:function(t,e){var n=this,i=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=arguments.length<=3||void 0===arguments[3]?this.handleNotification:arguments[3];if(Object.is(t,void 0))console.error("dataService is not provided");else{if(!Object.is(e,void 0)){Object.is(this._notifications,void 0)&&(this._notifications=this._initNotifications());var s=Object.assign({},i),a=Array.isArray(e)?e:[e];return Array.isArray(a)&&o.forEach(a,function(e){var i=t.subscribe(e,r,n._id);n._notifications.push(i),s[e]=i.proxy}),s}console.error("mapping keyPaths are not provided")}}},{key:"_initNotifications",value:function(){return new Proxy([],{get:function(t,e){if(e in t)return t[e];var n=void 0,i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done);i=!0){var u=s.value;u.keyPath===e&&(n=u)}}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}})}},{key:"handleNotification",value:function(t,e){}},{key:"_unsubscribe",value:function(t,e){t&&t.unsubscribe(this._notifications[e]),this._notifications.splice(this._notifications.indexOf(this._notifications[e]),1)}},{key:"_namespaceEvents",value:function(t){var e=this;return this.config&&this.config.jqNs?"string"!=typeof t?(console.warn("Auto-namespacing doesn't work for events passed as an object; calling 'off' won't work as expected and may break your code."),t):t.split(/\s+/).map(function(t){return t+"."+e.config.jqNs}).join(" "):(console.warn("You need to set this.config.jqNs for event auto-namespacing to work."),t)}},{key:"on",value:function(t){for(var e,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(e=this.$el.on).call.apply(e,[this.$el,this._namespaceEvents(t)].concat(i))}},{key:"one",value:function(t){for(var e,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(e=this.$el.one).call.apply(e,[this.$el,this._namespaceEvents(t)].concat(i))}},{key:"off",value:function(t){var e;t=!t&&this.config&&this.config.jqNs?"."+this.config.jqNs:this._namespaceEvents(t);for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(e=this.$el.off).call.apply(e,[this.$el,t].concat(i))}},{key:"destroy",value:function(){delete this._data,this._dynamicPartials.clear(),this.$el.empty(),i.Objects.destroy(this),this.off()}}],[{key:"init",value:function(t,e){return console.warn("Using inherited init method from Component may not work in IE9."),new this(t,e)}}]),t}(),t("default",a)}}}),$__System.register("components/content-support/content-support.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","lib/featured-component.js","lib/grab.js","lib/config.js"],function(t){"use strict";var e,n,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){t.default},function(t){e=t.default},function(t){t.default},function(t){t.configurable}],execute:function(){n=function(t){function n(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),r(Object.getPrototypeOf(n.prototype),"constructor",this).call(this,t,e);var i=this._highlightSpecialCharacters(this.$el.html());this.$el.html(i)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(n,e),i(n,[{key:"_highlightSpecialCharacters",value:function(t){return t.replace(/[^\x00-\x7F]/g,function(t){return'<span class="b-content-support__highlight">'+t+"</span>"})}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new n(t,e)}}]),n}(),t("ContentSupport",n)}}}),$__System.register("components/form/form.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","npm:bluebird@3.3.4.js","lib/component.js","lib/grab.js","lib/config.js","lib/validate.js","components/events/form-events.js"],function(t){"use strict";var e,n,i,r,o,s,a,u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.default},function(t){o=t.configurable},function(t){t.Validate},function(t){s=t.FormEvents}],execute:function(){a=function(t){function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),l(Object.getPrototypeOf(c.prototype),"constructor",this).call(this,t,e),this._validationResults=[],this._childrenRequests=[],this.on(s.VALIDATED,this._handleValidated.bind(this)),this.$el.on("submit",this._handleSubmit.bind(this)),this.on(s.ELEMENT_CHANGE,this._handleChildElementChange.bind(this)),this.on(s.REQUEST_TO_LISTEN_TO_ELEMENT_CHANGE,this._handleChildrenRequests.bind(this))}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,i),u(a,[{key:"_handleValidated",value:function(t,e){this._validationResults.push(e)}},{key:"_handleSubmit",value:function(t,i){var o=this;i=i||{},this._validationResults=[],this._submitPromise&&this._submitPromise.cancel(),!0!==i.isValidationCompleted&&(t.preventDefault(),this._submitPromise=n.all(Array.prototype.map.call(r(this.config.validationElements,this.$el),this._validateElementAsync.bind(this))).then(function(n){e(t.currentTarget).trigger("submit",{isValidationCompleted:!0})}.bind(this)).catch(function(t){o.$el.trigger(new e.Event(s.SUBMISSION_FAILED))}.bind(this)).finally(function(){i.isValidationCompleted=!0}.bind(this)))}},{key:"_validateElementAsync",value:function(t){return new n(function(n,i,r){e(t).on(s.VALIDATED,function o(a,u){r(function(){e(t).off(s.VALIDATED,o)}),(u&&u.message?i:n)(u)}),e(t).trigger(new e.Event(s.VALIDATE))})}},{key:"_handleChildElementChange",value:function(t,n){var i=this;"object"==typeof n&&n.elementId?this._childrenRequests.forEach(function(t,o){if(t.listenElementId==n.elementId){var s=new e.Event(t.event);r("#"+t.elementId,i.$el).trigger(s,n)}}):console.warn("form _handleChildElementChange data and data.elementId is required")}},{key:"_handleChildrenRequests",value:function(t,e){"object"==typeof e?t.type==s.REQUEST_TO_LISTEN_TO_ELEMENT_CHANGE&&this._childrenRequests.push(e):console.warn("form _handleChildrenRequests data object is required")}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new a(t,e)}}]);var c=a;return a=o({validationElements:null,jqNs:"formEvent"})(a)||a}(),t("Form",a)}}}),$__System.register("components/form/element-validator.js",["npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js","lib/validate.js","helpers/helpers.js","components/events/form-events.js","components/events/tooltip-events.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),c=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable},function(t){o=t.Validate},function(t){s=t.Helpers},function(t){a=t.FormEvents},function(t){t.TooltipEvents}],execute:function(){u=function(t){function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),c(Object.getPrototypeOf(f.prototype),"constructor",this).call(this,t,e),this._registerEventListeners()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,n),l(u,[{key:"_createElementHTMLAttributes",value:function(){this.config.required&&this.$el.attr("required",!0)}},{key:"_registerEventListeners",value:function(){this.on("blur keyup",this._handleChanges.bind(this)),this.on(a.VALIDATE,this._handleValidate.bind(this)),this._checkAndSendRequestToFormForAssociateElement(this.config.requiredElementId),this._checkAndSendRequestToFormForAssociateElement(this.config.matchElementId)}},{key:"_checkAndSendRequestToFormForAssociateElement",value:function(t){if(t){var e=s.Strings.random();this.$el.trigger(a.REQUEST_TO_LISTEN_TO_ELEMENT_CHANGE,{elementId:this.$el.attr("id"),listenElementId:t,event:e}),this.on(e,this._handleFormNotificationForAssociateElement.bind(this))}}},{key:"_handleFormNotificationForAssociateElement",value:function(t,e){var n=this._validateValue(this.$el.val());n?this._handleInvalidResult(n):this._handleValidResult(n)}},{key:"_handleChanges",value:function(t){this.$el.trigger(a.ELEMENT_CHANGE,{elementId:this.$el.attr("id"),value:this.$el.val()});var e=this._validateValue(t.target.value);e?(this._handleInvalidResult(e),t.preventDefault()):this._handleValidResult(e)}},{key:"_handleValidate",value:function(t){var e=this._validateValue($(t.target).val());e?(t.preventDefault(),this._handleInvalidResult(e)):this._handleValidResult(),this.$el.trigger(a.VALIDATED,{elementName:this.$el.attr("name"),value:this.$el.val(),message:e})}},{key:"_handleInvalidResult",value:function(t){this.$el.trigger(a.ELEMENT_VALIDATION_FAILED,{text:t})}},{key:"_handleValidResult",value:function(){this.$el.trigger(a.ELEMENT_VALIDATION_PASS)}},{key:"_validateValue",value:function(t){var n={};return e.assign(n,this._checkAndGetMatchObject.call(this)||{},this._checkAndGetRequiredObject.call(this)||{},this.config),o.exec({value:t,options:n})}},{key:"_checkAndGetMatchObject",value:function(){return this.config.matchElementId&&i("#"+this.config.matchElementId,this.$el)?{match:i("#"+this.config.matchElementId,this.$el).val()}:null}},{key:"_checkAndGetRequiredObject",value:function(){return this.config.requiredElementName&&this.config.requiredElementId&&i("#"+this.config.requiredElementId,this.$el)?{requires:{value:i("#"+this.config.requiredElementId,this.$el).val(),elementName:this.config.requiredElementName}}:null}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new u(t,e)}}]);var f=u;return u=r({required:null,requiredMessage:null,pattern:null,patternMessage:null,maxLength:null,maxLengthMessage:null,minLength:null,minLengthMessage:null,maxValue:null,maxValueMessage:null,minValue:null,minValueMessage:null,presets:null,message:null,matchMessage:null,matchElementId:null,requiresMessage:null,requiredElementId:null,requiredElementName:null,jqNs:"formElementValidator"})(u)||u}(),t("ElementValidator",u)}}}),$__System.register("components/form/element-restriction.js",["npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js","helpers/helpers.js","components/events/keycode-events.js"],function(t){"use strict";var e,n,i,r,o,s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){t.default},function(t){n=t.configurable},function(t){i=t.Helpers},function(t){r=t.KeyEvents}],execute:function(){o=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a(Object.getPrototypeOf(u.prototype),"constructor",this).call(this,t,e),this._registerEventListeners()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,e),s(o,[{key:"_registerEventListeners",value:function(){"number"==this.config.type&&(this.$el.keydown(this._handleNumericalInputRestrictions.bind(this)),this.$el.on("paste",this._handleNumericalInputPaste.bind(this)))}},{key:"_handleNumericalInputRestrictions",value:function(t){-1!==$.inArray(t.keyCode,[r.KEY_BACK_SPACE,r.KEY_DELETE,r.KEY_TAB,r.KEY_ESCAPE,r.KEY_RETURN,r.KEY_DECIMAL,r.KEY_DASH,r.KEY_PERIOD])||t.keyCode==r.KEY_A&&(!0===t.ctrlKey||!0===t.metaKey)||t.keyCode==r.KEY_V&&(!0===t.ctrlKey||!0===t.metaKey)||t.keyCode>=r.KEY_END&&t.keyCode<=r.KEY_DOWN||(t.shiftKey||t.keyCode<r.KEY_0||t.keyCode>r.KEY_9)&&(t.keyCode<r.KEY_NUMPAD0||t.keyCode>r.KEY_NUMPAD9)&&t.preventDefault()}},{key:"_handleNumericalInputPaste",value:function(t){var e=$(t.target).css("color");$(t.target).css("color",i.Colors.rgb2rgba(e,0)),window.setTimeout(function(){i.Numbers.isNumber($(t.target).val())||$(t.target).val(""),$(t.target).css("color",e)},50)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new o(t,e)}}]);var u=o;return o=n({type:null,jqNs:"formElementRestriction",htmlAttributes:{required:"required",maxLength:"maxlength",minLength:"minLength",maxValue:"max",minValue:"min"}})(o)||o}(),t("ElementRestriction",o)}}}),$__System.register("components/dropdown/dropdown.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","components/events/form-events.js","components/events/dropdown-events.js"],function(t){"use strict";var e,n,i,r,o,s,a,u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable},function(t){o=t.FormEvents},function(t){s=t.DropdownEvents}],execute:function(){a=function(t){function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),l(Object.getPrototypeOf(c.prototype),"constructor",this).call(this,t,e),this._isOpen=!1,this._refresh=this._refresh.bind(this),this._initialize()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,n),u(a,[{key:"_initialize",value:function(){this._initialiseSelectLists(),this._registerEventHandlers()}},{key:"_initialiseSelectLists",value:function(){var t=i(this.config.selectElementSelector,this.$el),e=this;t.selectmenu({appendTo:e.$el,open:function(){e._isOpen=!0,e._copyDataAttributes(t)},close:function(){e._isOpen=!1},blur:function(e,n){t.trigger(s.DROPDOWN_BLUR,n)},focus:function(e,n){t.trigger(s.DROPDOWN_FOCUS,n)},select:function(n,i){t.trigger(s.DROPDOWN_SELECT,i),e._copyDataAttributes(t,!1)}})}},{key:"_registerEventHandlers",value:function(){i(this.config.selectElementSelector,this.$el).on(s.DROPDOWN_SELECT,this._handleSelectOption.bind(this)),e(window).on("orientationchange",this._refresh,!1),e(window).on("resize",this._refresh),e(window).on(s.DROPDOWN_UPDATE,this._refresh)}},{key:"_handleSelectOption",value:function(t,e){var n=i(this.config.selectElementSelector,this.$el);null!==e&&null!==e.item&&(n.data("update-url")&&(window.location=e.item.value),i(this.config.textElementSelector,this.$el)&&(i(this.config.textElementSelector,this.$el).val(e.item.value),i(this.config.textElementSelector,this.$el).trigger(o.VALIDATE)))}},{key:"_copyDataAttributes",value:function(t){var n=this,i=arguments.length<=1||void 0===arguments[1]||arguments[1];t.data("copy")&&function(){if(i){t.closest(n.$el).find(n.config.optionsContainerSelector+" "+n.config.optionsItemSelector).each(function(n){e(this).addClass(t.find("option").eq(n).data("class"))})}else{var r=t.find(":selected").data("class"),o=t.closest(n.$el).find(n.config.selectButtonTextSelector);o.removeClass(function(t,e){return(e.match(/\bb-coloured-bar--\S+/g)||[]).join(" ")}),o.addClass(r)}}()}},{key:"_refresh",value:function(){var t=i(this.config.selectElementSelector,this.$el),e=this;t.data("uiSelectmenu")||t.selectmenu(),t.selectmenu("refresh").each(function(n,r){var o=t.parents(e.config.inputGroupSelector).first();o.length>0&&setTimeout(function(){var t=o.innerWidth()-2*parseInt(i(e.config.inputGroupWrapperSelector,o).css("border-left-width"),10);t>0&&(i(e.config.selectButtonSelector,o).outerWidth(t),i(e.config.optionsContainerSelector,o).outerWidth(t))}.bind(this),10)}),!0===this._isOpen&&(t.selectmenu("close"),t.selectmenu("open"))}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new a(t,e)}}]);var c=a;return a=r({selectElementSelector:".b-dropdown__select",textElementSelector:".b-js-dropdown-hidden-input",optionsContainerSelector:".ui-menu",optionsItemSelector:".ui-menu-item",selectButtonSelector:".ui-selectmenu-button",selectButtonTextSelector:".ui-selectmenu-text",inputGroupWrapperSelector:".b-input-group__wrapper",inputGroupSelector:".b-input-group"})(a)||a}(),t("Dropdown",a)}}}),$__System.register("components/events/tooltip-events.js",[],function(t){"use strict";return{setters:[],execute:function(){t("TooltipEvents",{SHOW:"TooltipEvents_SHOW",HIDE:"TooltipEvents_HIDE"})}}}),$__System.register("components/input-group/input-group.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","components/events/form-events.js","components/events/tooltip-events.js"],function(t){"use strict";var e,n,i,r,o,s,a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){n=t.default},function(t){i=t.configurable},function(t){r=t.FormEvents},function(t){o=t.TooltipEvents}],execute:function(){s=function(t){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),u(Object.getPrototypeOf(l.prototype),"constructor",this).call(this,t,e),this._registerEventHandlers()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,e),a(s,[{key:"_registerEventHandlers",value:function(){this.$el.on(r.ELEMENT_VALIDATION_FAILED,this._handleElementValidationFailed.bind(this)),this.$el.on(r.ELEMENT_VALIDATION_PASS,this._handleElementValidationPass.bind(this))}},{key:"_handleElementValidationFailed",value:function(t,e){"object"==typeof e&&(this._showTooltip(e.text),this._setWrapperInvalidState(),this._showValidationHelperInvalidState(e.text))}},{key:"_handleElementValidationPass",value:function(t){this._hideTooltip(),this._setWrapperValidState(),this._hideValidationHelperInvalidState()}},{key:"_showTooltip",value:function(t){this.config.tooltip&&n(this.config.tooltip,this.$el)&&n(this.config.tooltip,this.$el).trigger(o.SHOW,{text:t})}},{key:"_hideTooltip",value:function(){this.config.tooltip&&n(this.config.tooltip,this.$el)&&n(this.config.tooltip,this.$el).trigger(o.HIDE)}},{key:"_showValidationHelperInvalidState",value:function(t){this.config.helperValidation&&n(this.config.helperValidation,this.$el)&&n(this.config.helperValidation,this.$el).addClass(this.config.helperValidationInvalidClass).text(t).addClass(this.config.helperValidationShowClass)}},{key:"_hideValidationHelperInvalidState",value:function(){this.config.helperValidation&&n(this.config.helperValidation,this.$el)&&n(this.config.helperValidation,this.$el).removeClass(this.config.helperValidationShowClass)}},{key:"_setWrapperValidState",value:function(){this.config.wrapper&&n(this.config.wrapper,this.$el)&&n(this.config.wrapper,this.$el).removeClass(this.config.wrapperInvalidClass)}},{key:"_setWrapperInvalidState",value:function(){this.config.wrapper&&n(this.config.wrapper,this.$el)&&n(this.config.wrapper,this.$el).addClass(this.config.wrapperInvalidClass)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new s(t,e)}}]);var l=s;return s=i({tooltip:".b-js-tooltip",wrapper:".b-input-group__wrapper",wrapperInvalidClass:"b-input-group__wrapper--invalid",helperValidation:".b-input-group__helper--validation",helperValidationShowClass:"b-input-group__helper--validation--show",helperValidationInvalidClass:"b-input-group__helper--validation--invalid"})(s)||s}(),t("InputGroup",s)}}}),$__System.register("lib/validate.js",["helpers/helpers.js","npm:lodash@4.17.4.js"],function(_export){"use strict";var Helpers,_,_presets,_conditions,Validate,_createClass=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}return{setters:[function(t){Helpers=t.Helpers},function(t){_=t.default}],execute:function(){var _arguments=arguments;_presets={currency:{pattern:/^-?\$?(([1-9][0-9]{0,2}(, ?[0-9]{3})*)|[0-9]+)?(\.[0-9]{1,2})?$/,message:"You must enter a valid dollar amount"},usydEmail:{presets:["email"],pattern:/^\S+@(.+\.)?(sydney|usyd)\.edu\.au$/,message:"Your email must end with sydney.edu.au or usyd.edu.au"},email:{pattern:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-z\-0-9]+\.)+[a-z]{2,}))$/,message:"You must enter a valid email address"},number:{pattern:/^-?[0-9]\d*(\.\d+)?$/,message:"You must enter a number"}},_conditions={function:{},maxValue:{validate:function(t,e){return null===e?null:Helpers.Numbers.isNumber(t)&&Helpers.Numbers.stripNonNumericCharacters(t)<=e?null:"You must enter a number of no more than "+e}},minValue:{validate:function(t,e){return null===e?null:Helpers.Numbers.isNumber(t)&&Helpers.Numbers.stripNonNumericCharacters(t)>=e?null:"You must enter a number of at least "+e}},maxLength:{validate:function(t,e){return null===e?null:t.toString().length<=e?null:"You can only enter up to "+e+" characters"}},minLength:{validate:function(t,e){return null===e?null:t.toString().length>=e?null:"You must enter at least "+e+" characters"}},pattern:{validate:function(t,e){return null===e?null:RegExp(e).test(t)?null:"Your input must match the pattern "+e}},required:{validate:function(t,e){return e?/^(?!\s*$).+/.test(Helpers.Booleans.isTruthyValue(t)?t:"")?null:"You must complete this field":null}},requires:{validate:function(t,e){return Helpers.Booleans.isTruthyValue(t)?(null!==e&&void 0!==e&&(!e||"object"==typeof e&&e.hasOwnProperty("value")&&e.hasOwnProperty("elementName"))||console.error("You need to provide an object with the properties {value, elementName} for 'requires' validation",_arguments),Helpers.Booleans.isTruthyValue(t)&&Helpers.Booleans.isTruthyValue(e)&&"object"==typeof e&&Helpers.Booleans.isTruthyValue(e.value)?null:Helpers.Booleans.isTruthyValue(e)&&"object"==typeof e?"You must complete "+e.elementName+" first":"You must provide correct settings for required element first"):null}},match:{validate:function(t,e){return t==e?null:"Doesn't match"}},presets:{validate:function validate(val,presets){if(null===presets)return null;"string"==typeof presets&&(presets=eval("("+presets+")"));for(var i=0;i<presets.length;i++){var result=Validate.exec({value:val,options:Validate.getPreset(presets[i])});if(result)return result}return null}}},Validate=function(){function t(){_classCallCheck(this,t)}return _createClass(t,null,[{key:"exec",value:function(t){if(!t.options)return null;if(!Helpers.Booleans.isTruthyValue(t.value)&&!t.options.required)return null;for(var e in t.options){var n=this.getCondition(e),i=null;if(n&&(i=n.validate(t.value,t.options[e]),!_.isEmpty(i)))return t.options.message||t.options[e+"Message"]||i||"You must enter a valid value"}return null}},{key:"getCondition",value:function(t){return _conditions[t]}},{key:"getPreset",value:function(t){return _presets[t]}},{key:"addPreset",value:function(t,e){return _presets[t]?console.warn("Preset "+t+" has already been defined, ignoring"):_presets[t]=e,null}}]),t}(),_export("Validate",Validate)}}}),$__System.register("components/alumni-donation-form/alumni-donation-form.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","lib/validate.js","components/events/form-events.js"],function(t){"use strict";var e,n,i,r,o,s,a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){n=t.default},function(t){i=t.configurable},function(t){r=t.Validate},function(t){o=t.FormEvents}],execute:function(){r.addPreset("alumniDonation",{presets:["currency"],presetsMessage:"You must enter a valid dollar amount",minValue:1,minValueMessage:"You must enter a value of at least $1"}),s=function(t){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),u(Object.getPrototypeOf(s.prototype),"constructor",this).call(this,t,e),this._setDefaultInputFields(),this._registerEventHandlers()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,e),a(r,[{key:"_setDefaultInputFields",value:function(){n(this.config.inputNow,this.$el).attr("disabled",!1),n(this.config.inputMonthly,this.$el).attr("disabled",!0)}},{key:"_registerEventHandlers",value:function(){this.on(o.SUBMISSION_FAILED,this._setDefaultInputFields.bind(this)),n(this.config.buttonMonthly,this.$el).on("mousedown",this._onSubmitMonthly.bind(this))}},{key:"_onSubmitMonthly",value:function(t){n(this.config.inputNow,this.$el).attr("disabled",!0),n(this.config.inputMonthly,this.$el).attr("disabled",!1),this.$el.submit()}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new r(t,e)}}]);var s=r;return r=i({inputMonthly:".b-js-alumni-donation-form__monthly-param",inputNow:".b-js-alumni-donation-form__immediate-param",buttonMonthly:"#b-js-alumni-donation-form__monthly-button",buttonNow:"#b-js-alumni-donation-form__immediate-button",inputParam:"#b-js-alumni-donation-form__amount-param",jqNs:"alumniDonationFormEvent"})(r)||r}(),t("AlumniDonationForm",s)}}}),$__System.register("components/events/dropdown-events.js",[],function(t){"use strict";return{setters:[],execute:function(){t("DropdownEvents",{DROPDOWN_BLUR:"DROPDOWN_BLUR",DROPDOWN_FOCUS:"DROPDOWN_FOCUS",DROPDOWN_SELECT:"DROPDOWN_SELECT",SELECT:"selectmenuselect",DROPDOWN_UPDATE:"DROPDOWN_UPDATE"})}}}),$__System.register("components/atar-form/atar-form.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","npm:bluebird@3.3.4.js","github:components/handlebars.js@4.0.5.js","lib/component.js","lib/grab.js","lib/config.js","components/events/form-events.js","components/events/dropdown-events.js","lib/http.js","components/constants/constants.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),f=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){t.default},function(t){t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable},function(t){o=t.FormEvents},function(t){s=t.DropdownEvents},function(t){a=t.Http},function(t){u=t.Constants}],execute:function(){l=function(t){function l(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),f(Object.getPrototypeOf(h.prototype),"constructor",this).call(this,t,e),this._courses=null,this.shortCode="",this.config.atarUrl?(this._hideControls(),this._showDefaultValues(),this._loadData(),this._hideFilterTemplate()):this._showError()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,n),c(l,[{key:"_loadData",value:function(){var t=this;this._showLoadingAnimation(),a.get(this.config.atarUrl).then(function(e){t._courses=e,t._populateCoursesDropdown(e),t._registerEventHandlers(),t._showControls()}.bind(this)).catch(this._showError.bind(this)).finally(this._hideLoadingAnimation.bind(this))}},{key:"_populateCoursesDropdown",value:function(t){var e=[];if(void 0!==t)for(var n in t.enrollments)e.push({name:t.enrollments[n].courseName,value:t.enrollments[n].shortCode});this._populateDropdown(this.config.courseDropdownSelector,e)}},{key:"_showError",value:function(){i(this.config.contentSelector,this.$el).html(u.LOAD_DATA_FAIL_HTML)}},{key:"_hideControls",value:function(){i(this.config.hiddenWhileLoadingSelector,this.$el).addClass(this.config.hiddenControlClass)}},{key:"_showControls",value:function(){i(this.config.hiddenWhileLoadingSelector,this.$el).removeClass(this.config.hiddenControlClass)}},{key:"_showLoadingAnimation",value:function(){this.$el.addClass(this.config.loadingClass)}},{key:"_hideLoadingAnimation",value:function(){this.$el.removeClass(this.config.loadingClass)}},{key:"_hideFilterTemplate",value:function(){this.$el.removeClass(this.config.hiddenControlClass)}},{key:"_showDefaultValues",value:function(){var t=i(this.config.contentSelector,this.$el),e={message:this.config.defaultMessage,formData:{faculty:"?","faculty-text":"?",course:"?","course-text":"?",pathway:"?","pathway-text":"?"},requirementsData:{averageConPoints:"?",upperQuartile:"?",meanATAR:"?",maxATAR:"?",minATAR:"?",lowerQuartile:"?",medianATAR:"?"}};t.html(this.templates.base(e))}},{key:"_registerEventHandlers",value:function(){i(this.config.courseDropdownSelector,this.$el).on(o.JQUERYUI_SELECTMENU_CHANGE,this._handleCourseChange.bind(this)),i(this.config.filterDropdownSelector,this.$el).on(o.JQUERYUI_SELECTMENU_CHANGE,this._handleFilterChange.bind(this))}},{key:"_handleCourseChange",value:function(t,e){this.shortCode=i(this.config.courseDropdownSelector,this.$el).val(),this._showRequirements(this.shortCode)}},{key:"_handleFilterChange",value:function(t,e){var n=i(this.config.filterDropdownSelector,this.$el).val();this.config.currentFilter=n,"admissions"!==this.config.currentFilter&&this._hideFilterTemplate(),this._showRequirements(this.shortCode,this.config.currentFilter)}},{key:"_showRequirements",value:function(t,n){if(""!==t){var r=n?n.toString():this.config.currentFilter,o=this._courses[r];"admissions"!==r?i(this.config.contentSelector,this.$el).html(this.templates.base(e.find(o,{shortCode:t}))):i(this.config.contentSelector,this.$el).html(this.templates.admissions(e.find(o,{shortCode:t})))}else this._showDefaultValues()}},{key:"_populateDropdown",value:function(t,e){var n=i(t,this.$el);n.html('<option value="">Select</option>'),e.forEach(function(t){var e='<option value="'+t.value+'">'+t.name+"</option>\n";n.append(e)}),this._setDropdownValue(t,"")}},{key:"_setDropdownValue",value:function(t,e){var n=i(t,this.$el),r=n.find('[value="'+e+'"]'),a={item:{element:r,index:r.index(),label:r.text(),value:r.attr("value"),disabled:r.is(":disabled")}};n.val(e).trigger(o.JQUERYUI_SELECTMENU_CHANGE,a).trigger(s.DROPDOWN_UPDATE)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new l(t,e)}}]);var h=l;return l=r({atarUrl:null,defaultMessage:"Please select a course",defaultFilter:null,currentFilter:"offers",loadingClass:"b-loading-spinner__container--loading",hiddenWhileLoadingSelector:".b-atar-form__hidden-while-loading",hiddenControlClass:"b-atar-form__control--hidden",courseDropdownSelector:"#b-js-atar-form-course",filterDropdownSelector:"#b-js-atar-form-filter",contentTemplateSelector:".b-js-atar-form-content-template",contentSelector:".b-js-atar-form-content",templateSelectors:{base:".b-js-atar-form-content-template",admissions:".b-js-atar-form-admissions-template"}})(l)||l}(),t("AtarForm",l)}}}),$__System.register("components/spinner/spinner.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","components/events/loading-spinner-events.js"],function(t){"use strict";var e,n,i,r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){t.default},function(t){n=t.configurable},function(t){i=t.LoadingSpinnerEvents}],execute:function(){r=function(t){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),s(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,t,e),this._initialize()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,e),o(r,[{key:"_initialize",value:function(){this.$el.hide(),this.$el.addClass("b-spinner"),this._appendTemplate(),this._registerEventHandlers()}},{key:"_appendTemplate",value:function(){this.$el.html('\n <i class="b-spinner__child b-spinner__child--1"></i>\n <i class="b-spinner__child b-spinner__child--2"></i>\n <i class="b-spinner__child b-spinner__child--3"></i>\n <i class="b-spinner__child b-spinner__child--4"></i>\n <i class="b-spinner__child b-spinner__child--5"></i>\n <i class="b-spinner__child b-spinner__child--6"></i>\n ')}},{key:"_registerEventHandlers",value:function(){this.$el.on(i.SHOW,this._show.bind(this)),this.$el.on(i.HIDE,this._hide.bind(this))}},{key:"_show",value:function(){this.$el.show()}},{key:"_hide",value:function(){this.$el.hide()}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new r(t,e)}}]);var a=r;return r=n({})(r)||r}(),t("Spinner",r)}}}),$__System.register("lib/hippo.js",["github:components/jquery@1.11.3.js"],function(t){"use strict";var e,n,i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default}],execute:function(){n={url:"https://feed-aggregator.sydney.edu.au/json.php",limit:20,merged:!0,timeout:15,feeds:{}},i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return r(t,null,[{key:"get",value:function(t){return new Promise(function(i,r){var o=Object.assign({},n,t);e.ajax({dataType:"jsonp",url:o.url,data:{merged:o.merged,limit:o.limit,feeds:o.feeds},cache:!1,timeout:1e3*o.timeout}).done(i).fail(function(t){console.warn("couldn't get the hippo data from the server",t),r("couldn't get the hippo data from the server")})})}}]),t}(),t("Hippo",i)}}}),$__System.register("components/social-feed/social-feed.js",["github:components/jquery@1.11.3.js","npm:moment@2.11.1.js","lib/component.js","lib/grab.js","lib/hippo.js","lib/config.js","components/events/loading-spinner-events.js","components/constants/constants.js","helpers/helpers.js","npm:lodash@4.17.4.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c,f,h,p=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),d=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.default},function(t){o=t.Hippo},function(t){s=t.configurable},function(t){a=t.LoadingSpinnerEvents},function(t){u=t.Constants},function(t){l=t.Helpers},function(t){c=t.default}],execute:function(){"landscape","portrait",f="b-social-feed__button--activated",h=function(t){function h(t,e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,m),d(Object.getPrototypeOf(m.prototype),"constructor",this).call(this,t,e),this._handleButtonClick=this._handleButtonClick.bind(this),this._handleLoadDataFail=this._handleLoadDataFail.bind(this),this._renderButtons=this._renderButtons.bind(this),this._renderActivatedFeed=this._renderActivatedFeed.bind(this),this._setActivatedFeed=this._setActivatedFeed.bind(this),this._setActivatedButton=this._setActivatedButton.bind(this),this._updateLandscapeStyleFeedLimit=this._updateLandscapeStyleFeedLimit.bind(this),this.feedOptions=this._getFeedOptions(),this.acivatedFeed=null,this.data=null,this.displayFeedLimit=this.config.feedLimit,this._fetchFeedsData(this.feedOptions).then(function(t){n.data=t,n.acivatedFeed=t[0],n._renderButtons(t),n._registerButtonEventListeners(t),n._updateLandscapeStyleFeedLimit(),n._setActivatedFeed(t[0])}),window.addEventListener("resize",this._updateLandscapeStyleFeedLimit),window.addEventListener("orientationchange",this._updateLandscapeStyleFeedLimit)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(h,i),p(h,[{key:"_registerButtonEventListeners",value:function(t){var n=this;c.each(t,function(t){t&&t.options&&e(r("#"+t.options.buttonId,n.$el)).on("click",n._handleButtonClick)})}},{key:"_getFeedOptions",value:function(){return c.map(r(this.config.selectorFeedOptions,this.$el),function(t){return{buttonId:l.Strings.random(),key:e(t).attr("data-feed-key"),name:e(t).attr("data-feed-name"),limit:e(t).attr("data-feed-limit"),url:e(t).attr("data-feed-url"),icon:e(t).attr("data-feed-icon")}})}},{key:"_fetchFeedsData",value:function(t){var e=this;return r(u.SPINNER_SELECTOR,this.$el).trigger(a.SHOW),new Promise(function(n,i){Promise.all(c.map(t,function(t){var n={};return n[t.name]={key:t.key,limit:e.config.feedLimit},new Promise(function(e,i){o.get({limit:t.limit,feeds:n}).then(function(n){e({items:n,options:t})}).catch(i)})})).then(function(t){e._formatFeedItems(t.filter(function(t){return"facebook"===t.options.name})),n(t)}).catch(function(t){e._handleLoadDataFail(t),i(t)}).finally(function(){r(".b-js-spinner",e.$el).trigger(a.HIDE)})})}},{key:"_formatFeedItems",value:function(t){return t[0].items.map(function(t){var e=t.sizes.find(function(t){return 480===t.height});t.image_url=e.source})}},{key:"_handleLoadDataFail",value:function(t){console.warn("cannot load social feed data: ",t),r(this.config.selectorFeedListContainer,this.$el).html(u.LOAD_DATA_FAIL_HTML)}},{key:"_renderButtons",value:function(t){r(this.config.selectorFeedButtonsContainer,this.$el).append(this.templates.buttons({buttons:c.map(t,function(t){return Object.assign({},t.options,{name:t.options.name+" feed",title:"click to show "+t.options.name+" feed"})})}))}},{key:"_setActivatedFeed",value:function(t){this.acivatedFeed=t,this._renderActivatedFeed(t),this._setActivatedButton(t),this._repositionArrow(t)}},{key:"_renderActivatedFeed",value:function(t){r(this.config.selectorFeedListContainer,this.$el).html(""),r(this.config.selectorFeedListContainer,this.$el).append(this.templates.activatedFeed({options:t.options,readMoreLink:{name:"Read more "+t.options.name+" feeds",url:t.options.url},items:c.map(c.dropRight(t.items,this.config.feedLimit-this.displayFeedLimit),function(t){return Object.assign({},t,{text:t.title,postedDate:n(t.date).fromNow()})})}))}},{key:"_setActivatedButton",value:function(t){var e=this;c.each(this.data,function(t){r("#"+t.options.buttonId,e.$el).removeClass(f)}),r("#"+t.options.buttonId,this.$el).addClass(f)}},{key:"_handleButtonClick",value:function(t){t.preventDefault();var n=c.find(this.data,function(n){var i=e(t.target);return i.is("a")||(i=i.parent("a")),n.options.buttonId===i.attr("id")});this._setActivatedFeed(n)}},{key:"_updateLandscapeStyleFeedLimit",value:function(){this.displayFeedLimit=this.config.feedLimit,l.Browser.getWindowSize().width<=u.TABLET_DOWN&&l.Browser.getWindowSize().width>=u.MOBILE_LANDSCAPE_UP&&(this.displayFeedLimit=3),this._renderActivatedFeed(this.acivatedFeed)}},{key:"_repositionArrow",value:function(){var t=this,e=c.findIndex(this.data,function(e){return r("#"+e.options.buttonId,t.$el).hasClass(f)});r(this.config.selectorFeedArrow,this.$el).animate({left:50*e-50+"px"})}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new h(t,e)}}]);var m=h;return h=s({style:null,feedLimit:4,selectorFeedOptions:".b-js-social-feed-options",selectorFeedButtonsContainer:".b-js-social-feed-buttons-container",selectorFeedListContainer:".b-js-social-feed-list-container",selectorFeedArrow:".b-js-social-feed-arrow",templateSelectors:{buttons:".b-js-social-feed-buttons",activatedFeed:".b-js-social-feed-activated-feed"}})(h)||h}(),t("SocialFeed",h)}}}),$__System.register("components/swiper-carousel/swiper-carousel.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","github:nolimits4web/Swiper@2.7.6.js","helpers/helpers.js","components/constants/constants.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c,f=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),h=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable},function(t){o=t.default},function(t){s=t.Helpers},function(t){a=t.Constants}],execute:function(){u=1e3,l=240,c=function(t){function c(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p),h(Object.getPrototypeOf(p.prototype),"constructor",this).call(this,t,e),this._prevWindowWidth=null,this._slidesPerView=this.config.slidesPerView,this._carousel=null,1!=this.config.disableCarousel?(this._updateSlidesPerViewParam=this._updateSlidesPerViewParam.bind(this),this._handleScreenSizeChange=this._handleScreenSizeChange.bind(this),this._updateSlidesPerViewParam(),this._initialize()):this._hideSlideNavButtonGroup()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,n),f(c,[{key:"_initialize",value:function(){var t=this;if(0!==i(this.config.slideSelector,this.$el).length){var e="carousel-"+s.Strings.random(8);i(this.config.swiperSelector,this.$el).attr("id",e),setTimeout(function(){t._carousel=new o("#"+e,{mode:"horizontal",loop:t.config.loop,autoplay:t.config.loop?t.config.autoplay:0,autoplayDisableOnInteraction:t.config.autoplayDisableOnInteraction,speed:1e3,cssWidthAndHeight:t.config.cssWidthAndHeight,calculateHeight:t.config.calculateHeight,slidesPerView:t.config.slidesPerView,touchRatio:t.config.touchRatio}),t._registerEventListeners(),t._handleScreenSizeChange(),setInterval(t._handleScreenSizeChange,u)},this.config.initDelay),setTimeout(function(){t._removeHintStyle(s.Browser.getWindowSize().width),t._carousel.resizeFix(),t._carousel.reInit(),t._addHintStyle(s.Browser.getWindowSize().width)},this.config.initDelay+2500)}}},{key:"_updateSlidesPerViewParam",value:function(){this._slidesPerView=this.config.responsive?0==Math.floor(this.$el.width()/this.config.slideMinWidth)?1:Math.floor(this.$el.width()/this.config.slideMinWidth):this.config.slidesPerView,this._slidesPerView>this.config.responsiveSlidesMaxNumber&&(this._slidesPerView=this.config.responsiveSlidesMaxNumber),i(this.config.slideSelector,this.$el).length>this._slidesPerView?this._showSlideNavButtonGroup():(this._slidesPerView=i(this.config.slideSelector,this.$el).length,this._hideSlideNavButtonGroup())}},{key:"_handleScreenSizeChange",value:function(){var t=s.Browser.getWindowSize().width;null!==this._prevWindowWidth&&this._prevWindowWidth==t||(this._updateSlidesPerViewParam(),this._carousel.params.slidesPerView=this._slidesPerView,this._removeHintStyle(t),this._carousel.resizeFix(),this._carousel.reInit(),this._addHintStyle(t),this._prevWindowWidth=t)}},{key:"_addHintStyle",value:function(t){var e=this;1==this.config.enableHintStyle&&t<=a.MOBILE_LANDSCAPE_DOWN&&setTimeout(function(){e.$el.addClass(e.config.hintStyleClass),i(e.config.swiperSelector,e.$el).width("110%"),i(e.config.swiperSelector,e.$el).css("left","-10px")},3500)}},{key:"_removeHintStyle",value:function(t){1==this.config.enableHintStyle&&t>a.MOBILE_LANDSCAPE_DOWN&&(this.$el.removeClass(this.config.hintStyleClass),i(this.config.swiperSelector,this.$el).width("100%"),i(this.config.swiperSelector,this.$el).css("left","0"))}},{key:"_showSlideNavButtonGroup",value:function(){this.config.buttonGroupStateClass&&this.$el.addClass(this.config.buttonGroupStateClass),i(this.config.selectorButtonPrev,this.$el).show(),i(this.config.selectorButtonNext,this.$el).show()}},{key:"_hideSlideNavButtonGroup",value:function(){this.config.buttonGroupStateClass&&this.$el.removeClass(this.config.buttonGroupStateClass),i(this.config.selectorButtonPrev,this.$el).hide(),i(this.config.selectorButtonNext,this.$el).hide()}},{key:"_registerEventListeners",value:function(){var t=this,n=e(this._carousel.container).parent().find(this.config.selectorButtonPrev),i=e(this._carousel.container).parent().find(this.config.selectorButtonNext);0!==n.length&&n.click(function(e){e.preventDefault(),t._carousel.swipePrev()}),0!==i.length&&i.click(function(e){e.preventDefault(),t._carousel.swipeNext()})}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new c(t,e)}}]);var p=c;return c=r({swiperSelector:".b-js-swiper-carousel-container",slideSelector:".b-js-swiper-carousel-slide",buttonGroupStateClass:"b-swiper-image-gallery--has-nav-buttons",selectorButtonPrev:".b-js-swiper-carousel-button-prev",selectorButtonNext:".b-js-swiper-carousel-button-next",calculateHeight:!0,cssWidthAndHeight:!1,slidesPerView:1,touchRatio:.5,speed:1e3,initDelay:0,loop:!0,autoplayDisableOnInteraction:!1,autoplay:3e3,responsive:!1,responsiveSlidesMaxNumber:3,slideMinWidth:l,disableCarousel:!1,enableHintStyle:!1,hintStyleClass:"b-swiper-carousel--hint-style"})(c)||c}(),t("SwiperCarousel",c)}}}),$__System.register("components/swiper-image-gallery/swiper-image-gallery.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","github:nolimits4web/Swiper@2.7.6.js","helpers/helpers.js","components/constants/constants.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c,f,h=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),p=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable},function(t){o=t.default},function(t){s=t.Helpers},function(t){a=t.Constants}],execute:function(){u=a.TABLET_UP,l=3,c=4,1e3,f=function(t){function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),p(Object.getPrototypeOf(f.prototype),"constructor",this).call(this,t,e),this._prevWindowWidth=null,this._galleryTop=null,this._galleryCarousel=null,this._handleClickThumb=this._handleClickThumb.bind(this),this._initialize()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,n),h(a,[{key:"_initialize",value:function(){if(0!==i(this.config.selectorSlide,e(i(this.config.selectorGalleryTop,this.$el))).length){var t="image-gallery-"+s.Strings.random(8);i(this.config.selectorGalleryTop,this.$el).attr("id",t+"-top"),i(this.config.selectorGalleryCarousel,this.$el).attr("id",t+"-thumbs"),this._galleryTop=new o("#"+t+"-top",{mode:"horizontal",calculateHeight:!0,touchRatio:this.config.touchRatio}),this._galleryCarousel=new o("#"+t+"-thumbs",{mode:"horizontal",onSlideClick:this._handleClickThumb,slidesPerView:this.config.totalSlides&&this.config.totalSlides<c?this.config.totalSlides:c,roundLengths:!0,calculateHeight:!0,touchRatio:this.config.touchRatio}),this._registerEventListeners()}}},{key:"_handleScreenSizeChange",value:function(){this._prevWindowWidth!==s.Browser.getWindowSize().width&&(this._prevWindowWidth=s.Browser.getWindowSize().width,this._prevWindowWidth>u?this._galleryCarousel.params.slidesPerView=c:this._galleryCarousel.params.slidesPerView=l,this._galleryTop.resizeFix(),this._galleryTop.reInit(),this._galleryCarousel.resizeFix(),this._galleryCarousel.reInit())}},{key:"_registerEventListeners",value:function(){this._registerButtonEvents(this._galleryTop),this._registerButtonEvents(this._galleryCarousel)}},{key:"_registerButtonEvents",value:function(t){var n=e(t.container).parent().find(this.config.selectorButtonPrev),i=e(t.container).parent().find(this.config.selectorButtonNext);0!==n.length&&n.click(function(e){e.stopPropagation(),e.preventDefault(),t.swipePrev()}),0!==i.length&&i.click(function(e){e.stopPropagation(),e.preventDefault(),t.swipeNext()})}},{key:"_handleClickThumb",value:function(t){this._galleryTop.swipeTo(t.clickedSlideIndex)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new a(t,e)}}]);var f=a;return a=r({totalSlides:null,selectorGalleryTop:".b-js-swiper-image-gallery-top",selectorGalleryCarousel:".b-js-swiper-image-gallery-thumbs",selectorSlide:".b-js-swiper-carousel-slide",selectorButtonPrev:".b-js-swiper-carousel-button-prev",selectorButtonNext:".b-js-swiper-carousel-button-next",touchRatio:.5})(a)||a}(),t("SwiperImageGallery",f)}}}),$__System.register("components/json-link-list/json-link-list.js",["npm:lodash@4.17.4.js","github:components/handlebars.js@4.0.5.js","components/abstract-ajax-component/abstract-ajax-component.js","lib/grab.js","lib/config.js"],function(t){"use strict";var e,n,i,r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){t.default},function(t){n=t.default},function(t){t.default},function(t){i=t.configurable}],execute:function(){r=function(t){function r(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),s(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,t,e)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,n),o(r,[{key:"_buildContent",value:function(t){var n=this;e.forEach(t,function(t){n.$el.append(n.templates.item(t))}.bind(this))}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new r(t,e)}}]);var a=r;return r=i({sourceUrl:"",templateSelectors:{item:".b-js-json-link-list__item"}})(r)||r}(),t("JsonLinkList",r)}}}),$__System.register("components/events/form-events.js",[],function(t){"use strict";return{setters:[],execute:function(){t("FormEvents",{VALIDATED:"validated",VALIDATE:"validate",SUBMISSION_FAILED:"formSubmissionFailed",ELEMENT_CHANGE:"element_change",ELEMENT_VALIDATION_FAILED:"element_validation_failed",ELEMENT_VALIDATION_PASS:"element_validation_pass",REQUEST_TO_LISTEN_TO_ELEMENT_CHANGE:"request_to_listen_to_element_change",JQUERYUI_SELECTMENU_CHANGE:"selectmenuchange"})}}}),$__System.register("components/feedback/feedback.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","lib/http.js","helpers/helpers.js","components/events/form-events.js","components/events/loading-spinner-events.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),c=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable},function(t){t.Http},function(t){o=t.Helpers},function(t){s=t.FormEvents},function(t){a=t.LoadingSpinnerEvents}],execute:function(){u=function(t){function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),c(Object.getPrototypeOf(f.prototype),"constructor",this).call(this,t,e),this._registerEventHandlers()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,n),l(u,[{key:"_registerEventHandlers",value:function(){i(this.config.buttonCancel,this.$el).on("click",this._onClickButtonCancel.bind(this)),i(this.config.buttonShowForm,this.$el).on("click",this._onClickButtonShowForm.bind(this)),i(this.config.buttonSubmit,this.$el).on("click",this._onSubmit.bind(this))}},{key:"_onClickButtonCancel",value:function(){this._showElement(i(this.config.buttonShowForm,this.$el)),this._hideElement(i(this.config.formElement,this.$el))}},{key:"_onClickButtonShowForm",value:function(){this._showElement(i(this.config.formElement,this.$el)),this._hideElement(i(this.config.buttonShowForm,this.$el))}},{key:"_onSubmit",value:function(){i(this.config.inputElement,this.$el).trigger(s.VALIDATE),i(this.config.inputElement,this.$el).val()&&0!==i(this.config.inputElement,this.$el).val().trim().length&&grecaptcha&&0!==grecaptcha.getResponse().length&&(this._hideElement(i(this.config.buttonShowForm,this.$el)),this._hideElement(i(this.config.formElement,this.$el)),i(this.config.spinner,this.$el).trigger(a.SHOW),this._sendFeedback(this.config.postUrl,this._createSendingData()).then(this._handleFormSubmitSuccess.bind(this)).catch(this._handleFormSubmitFailure.bind(this)))}},{key:"_handleFormSubmitSuccess",value:function(t){i(this.config.spinner,this.$el).trigger(a.HIDE),this._handleAnalytics(),"true"==t?this._showElement(i(this.config.messageSuccessElement,this.$el)):this._showElement(i(this.config.messageFailureElement,this.$el))}},{key:"_handleFormSubmitFailure",value:function(){i(this.config.spinner,this.$el).trigger(a.HIDE),this._showElement(i(this.config.messageFailureElement,this.$el))}},{key:"_handleAnalytics",value:function(){try{void 0!==USYD&&void 0!==USYD.Analytics&&void 0!==Analytics&&(USYD.Analytics.formSubmissionName=this.config.analyticsName,Analytics.satelliteTrack(this.config.analyticsTrack))}catch(t){console.warn(t)}}},{key:"_sendFeedback",value:function(t,n){return new Promise(function(i,r,o){e.ajax(t,{method:"get",data:n}).then(function(t){i(t)},function(t,e,n){console.log("BBBB"),r(new Error(n))})})}},{key:"_createSendingData",value:function(){return{message:i(this.config.inputElement,this.$el).val()+"\n"+o.Browser.getUserAgent(),url:window.location.href,timeStamp:new Date}}},{key:"_showElement",value:function(t){t.removeClass(this.config.hideElementSelector),t.show()}},{key:"_hideElement",value:function(t){t.addClass(this.config.hideElementSelector),t.hide()}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new u(t,e)}}]);var f=u;return u=r({formElement:".b-js-feedback-form",buttonCancel:".b-js-feedback-button-cancel",buttonShowForm:".b-js-feedback-button-show-form",buttonSubmit:".b-js-feedback__submit-button",inputElement:"#b-feedback-form-input",hideElementSelector:"b-component--hidden",messageSuccessElement:".b-js-feedback__message--success",messageFailureElement:".b-js-feedback__message--failure",spinner:".b-js-spinner",postUrl:null,analyticsName:null,analyticsTrack:null})(u)||u}(),t("Feedback",u)}}}),$__System.register("components/featured-article/featured-article.js",["lib/component.js","lib/grab.js","lib/config.js","helpers/helpers.js","components/constants/constants.js"],function(t){"use strict";var e,n,i,r,o,s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){t.default},function(t){n=t.configurable},function(t){t.Helpers},function(t){t.Constants}],execute:function(){i=1e3,r=240,o=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a(Object.getPrototypeOf(u.prototype),"constructor",this).call(this,t,e),this._updateState=this._updateState.bind(this),this.previousWidth=null,setTimeout(this._updateState,0),window.addEventListener("resize",this._updateState),window.addEventListener("orientationchange",this._updateState),setInterval(this._updateState,i)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,e),s(o,[{key:"_updateState",value:function(){this.previousWidth!=this.$el.width()&&(this.previousWidth=this.$el.width(),this.$el.width()>=this.config.minWidth?(this.config.wideShapeClass&&this.$el.addClass(this.config.wideShapeClass),this.config.narrowShapeClass&&this.$el.removeClass(this.config.narrowShapeClass)):(this.config.wideShapeClass&&this.$el.removeClass(this.config.wideShapeClass),this.config.narrowShapeClass&&this.$el.addClass(this.config.narrowShapeClass)))}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new o(t,e)}}]);var u=o;return o=n({wideShapeClass:null,narrowShapeClass:null,minWidth:r})(o)||o}(),t("FeaturedArticle",o)}}}),function(){var t=$__System.amdDefine,e=function(t,e){"use strict";if(!document.body.outerHTML&&document.body.__defineGetter__&&HTMLElement){var n=HTMLElement.prototype;n.__defineGetter__&&n.__defineGetter__("outerHTML",function(){return(new XMLSerializer).serializeToString(this)})}if(window.getComputedStyle||(window.getComputedStyle=function(t,e){return this.el=t,this.getPropertyValue=function(e){var n=/(\-([a-z]){1})/g;return"float"===e&&(e="styleFloat"),n.test(e)&&(e=e.replace(n,function(){return arguments[2].toUpperCase()})),t.currentStyle[e]?t.currentStyle[e]:null},this}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){for(var n=e||0,i=this.length;n<i;n++)if(this[n]===t)return n;return-1}),(document.querySelectorAll||window.jQuery)&&void 0!==t&&(t.nodeType||0!==P(t).length)){var i,r,o,s,a,u,l=this;l.touches={start:0,startX:0,startY:0,current:0,currentX:0,currentY:0,diff:0,abs:0},l.positions={start:0,abs:0,diff:0,current:0},l.times={start:0,end:0},l.id=(new Date).getTime(),l.container=t.nodeType?t:P(t)[0],l.isTouched=!1,l.isMoved=!1,l.activeIndex=0,l.centerIndex=0,l.activeLoaderIndex=0,l.activeLoopIndex=0,l.previousIndex=null,l.velocity=0,l.snapGrid=[],l.slidesGrid=[],l.imagesToLoad=[],l.imagesLoaded=0,l.wrapperLeft=0,l.wrapperRight=0,l.wrapperTop=0,l.wrapperBottom=0,l.isAndroid=navigator.userAgent.toLowerCase().indexOf("android")>=0;var c={eventTarget:"wrapper",mode:"horizontal",touchRatio:1,speed:300,freeMode:!1,freeModeFluid:!1,momentumRatio:1,momentumBounce:!0,momentumBounceRatio:1,slidesPerView:1,slidesPerGroup:1,slidesPerViewFit:!0,simulateTouch:!0,followFinger:!0,shortSwipes:!0,longSwipesRatio:.5,moveStartThreshold:!1,onlyExternal:!1,createPagination:!0,pagination:!1,paginationElement:"span",paginationClickable:!1,paginationAsRange:!0,resistance:!0,scrollContainer:!1,preventLinks:!0,preventLinksPropagation:!1,noSwiping:!1,noSwipingClass:"swiper-no-swiping",initialSlide:0,keyboardControl:!1,mousewheelControl:!1,mousewheelControlForceToAxis:!1,useCSS3Transforms:!0,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,loop:!1,loopAdditionalSlides:0,roundLengths:!1,calculateHeight:!1,cssWidthAndHeight:!1,updateOnImagesReady:!0,releaseFormElements:!0,watchActiveIndex:!1,visibilityFullFit:!1,offsetPxBefore:0,offsetPxAfter:0,offsetSlidesBefore:0,offsetSlidesAfter:0,centeredSlides:!1,queueStartCallbacks:!1,queueEndCallbacks:!1,autoResize:!0,resizeReInit:!1,DOMAnimation:!0,loader:{slides:[],slidesHTMLType:"inner",surroundGroups:1,logic:"reload",loadAllSlides:!1},swipeToPrev:!0,swipeToNext:!0,slideElement:"div",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",wrapperClass:"swiper-wrapper",paginationElementClass:"swiper-pagination-switch",paginationActiveClass:"swiper-active-switch",paginationVisibleClass:"swiper-visible-switch"};for(var f in e=e||{},c)if(f in e&&"object"==typeof e[f])for(var h in c[f])h in e[f]||(e[f][h]=c[f][h]);else f in e||(e[f]=c[f]);l.params=e,e.scrollContainer&&(e.freeMode=!0,e.freeModeFluid=!0),e.loop&&(e.resistance="100%");var p="horizontal"===e.mode,d=["mousedown","mousemove","mouseup"];l.browser.ie10&&(d=["MSPointerDown","MSPointerMove","MSPointerUp"]),l.browser.ie11&&(d=["pointerdown","pointermove","pointerup"]),l.touchEvents={touchStart:l.support.touch||!e.simulateTouch?"touchstart":d[0],touchMove:l.support.touch||!e.simulateTouch?"touchmove":d[1],touchEnd:l.support.touch||!e.simulateTouch?"touchend":d[2]};for(var m=l.container.childNodes.length-1;m>=0;m--)if(l.container.childNodes[m].className)for(var v=l.container.childNodes[m].className.split(/\s+/),g=0;g<v.length;g++)v[g]===e.wrapperClass&&(i=l.container.childNodes[m]);l.wrapper=i,l._extendSwiperSlide=function(t){return t.append=function(){return e.loop?t.insertAfter(l.slides.length-l.loopedSlides):(l.wrapper.appendChild(t),l.reInit()),t},t.prepend=function(){return e.loop?(l.wrapper.insertBefore(t,l.slides[l.loopedSlides]),l.removeLoopedSlides(),l.calcSlides(),l.createLoop()):l.wrapper.insertBefore(t,l.wrapper.firstChild),l.reInit(),t},t.insertAfter=function(n){return void 0!==n&&(e.loop?((i=l.slides[n+1+l.loopedSlides])?l.wrapper.insertBefore(t,i):l.wrapper.appendChild(t),l.removeLoopedSlides(),l.calcSlides(),l.createLoop()):(i=l.slides[n+1],l.wrapper.insertBefore(t,i)),l.reInit(),t);var i},t.clone=function(){return l._extendSwiperSlide(t.cloneNode(!0))},t.remove=function(){l.wrapper.removeChild(t),l.reInit()},t.html=function(e){return void 0===e?t.innerHTML:(t.innerHTML=e,t)},t.index=function(){for(var e,n=l.slides.length-1;n>=0;n--)t===l.slides[n]&&(e=n);return e},t.isActive=function(){return t.index()===l.activeIndex},t.swiperSlideDataStorage||(t.swiperSlideDataStorage={}),t.getData=function(e){return t.swiperSlideDataStorage[e]},t.setData=function(e,n){return t.swiperSlideDataStorage[e]=n,t},t.data=function(e,n){return void 0===n?t.getAttribute("data-"+e):(t.setAttribute("data-"+e,n),t)},t.getWidth=function(e,n){return l.h.getWidth(t,e,n)},t.getHeight=function(e,n){return l.h.getHeight(t,e,n)},t.getOffset=function(){return l.h.getOffset(t)},t},l.calcSlides=function(t){var n=!!l.slides&&l.slides.length;l.slides=[],l.displaySlides=[];for(var i=0;i<l.wrapper.childNodes.length;i++)if(l.wrapper.childNodes[i].className)for(var r=l.wrapper.childNodes[i].className.split(/\s+/),o=0;o<r.length;o++)r[o]===e.slideClass&&l.slides.push(l.wrapper.childNodes[i]);for(i=l.slides.length-1;i>=0;i--)l._extendSwiperSlide(l.slides[i]);!1!==n&&(n!==l.slides.length||t)&&(L(),D(),l.updateActiveSlide(),l.params.pagination&&l.createPagination(),l.callPlugins("numberOfSlidesChanged"))},l.createSlide=function(t,n,i){n=n||l.params.slideClass,i=i||e.slideElement;var r=document.createElement(i);return r.innerHTML=t||"",r.className=n,l._extendSwiperSlide(r)},l.appendSlide=function(t,e,n){if(t)return t.nodeType?l._extendSwiperSlide(t).append():l.createSlide(t,e,n).append()},l.prependSlide=function(t,e,n){if(t)return t.nodeType?l._extendSwiperSlide(t).prepend():l.createSlide(t,e,n).prepend()},l.insertSlideAfter=function(t,e,n,i){return void 0!==t&&(e.nodeType?l._extendSwiperSlide(e).insertAfter(t):l.createSlide(e,n,i).insertAfter(t))},l.removeSlide=function(t){if(l.slides[t]){if(e.loop){if(!l.slides[t+l.loopedSlides])return!1;l.slides[t+l.loopedSlides].remove(),l.removeLoopedSlides(),l.calcSlides(),l.createLoop()}else l.slides[t].remove();return!0}return!1},l.removeLastSlide=function(){return l.slides.length>0&&(e.loop?(l.slides[l.slides.length-1-l.loopedSlides].remove(),l.removeLoopedSlides(),l.calcSlides(),l.createLoop()):l.slides[l.slides.length-1].remove(),!0)},l.removeAllSlides=function(){for(var t=l.slides.length,e=l.slides.length-1;e>=0;e--)l.slides[e].remove(),e===t-1&&l.setWrapperTranslate(0)},l.getSlide=function(t){return l.slides[t]},l.getLastSlide=function(){return l.slides[l.slides.length-1]},l.getFirstSlide=function(){return l.slides[0]},l.activeSlide=function(){return l.slides[l.activeIndex]},l.fireCallback=function(){var t=arguments[0];if("[object Array]"===Object.prototype.toString.call(t))for(var n=0;n<t.length;n++)"function"==typeof t[n]&&t[n](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);else"[object String]"===Object.prototype.toString.call(t)?e["on"+t]&&l.fireCallback(e["on"+t],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]):t(arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},l.addCallback=function(t,e){var n,i;return this.params["on"+t]?(i=this.params["on"+t],"[object Array]"===Object.prototype.toString.apply(i)?this.params["on"+t].push(e):"function"==typeof this.params["on"+t]?(n=this.params["on"+t],this.params["on"+t]=[],this.params["on"+t].push(n),this.params["on"+t].push(e)):void 0):(this.params["on"+t]=[],this.params["on"+t].push(e))},l.removeCallbacks=function(t){l.params["on"+t]&&(l.params["on"+t]=null)};var y=[];for(var _ in l.plugins)if(e[_]){var b=l.plugins[_](l,e[_]);b&&y.push(b)}l.callPlugins=function(t,e){e||(e={});for(var n=0;n<y.length;n++)t in y[n]&&y[n][t](e)},!l.browser.ie10&&!l.browser.ie11||e.onlyExternal||l.wrapper.classList.add("swiper-wp8-"+(p?"horizontal":"vertical")),e.freeMode&&(l.container.className+=" swiper-free-mode"),l.initialized=!1,l.init=function(t,n){var i=l.h.getWidth(l.container,!1,e.roundLengths),s=l.h.getHeight(l.container,!1,e.roundLengths);if(i!==l.width||s!==l.height||t){var a,c,f,h,d,m,v;l.width=i,l.height=s,u=p?i:s;var g=l.wrapper;if(t&&l.calcSlides(n),"auto"===e.slidesPerView){var y=0,_=0;e.slidesOffset>0&&(g.style.paddingLeft="",g.style.paddingRight="",g.style.paddingTop="",g.style.paddingBottom=""),g.style.width="",g.style.height="",e.offsetPxBefore>0&&(p?l.wrapperLeft=e.offsetPxBefore:l.wrapperTop=e.offsetPxBefore),e.offsetPxAfter>0&&(p?l.wrapperRight=e.offsetPxAfter:l.wrapperBottom=e.offsetPxAfter),e.centeredSlides&&(p?(l.wrapperLeft=(u-this.slides[0].getWidth(!0,e.roundLengths))/2,l.wrapperRight=(u-l.slides[l.slides.length-1].getWidth(!0,e.roundLengths))/2):(l.wrapperTop=(u-l.slides[0].getHeight(!0,e.roundLengths))/2,l.wrapperBottom=(u-l.slides[l.slides.length-1].getHeight(!0,e.roundLengths))/2)),p?(l.wrapperLeft>=0&&(g.style.paddingLeft=l.wrapperLeft+"px"),l.wrapperRight>=0&&(g.style.paddingRight=l.wrapperRight+"px")):(l.wrapperTop>=0&&(g.style.paddingTop=l.wrapperTop+"px"),l.wrapperBottom>=0&&(g.style.paddingBottom=l.wrapperBottom+"px")),m=0;var b=0;for(l.snapGrid=[],l.slidesGrid=[],f=0,v=0;v<l.slides.length;v++){a=l.slides[v].getWidth(!0,e.roundLengths),c=l.slides[v].getHeight(!0,e.roundLengths),e.calculateHeight&&(f=Math.max(f,c));var w=p?a:c;if(e.centeredSlides){var k=v===l.slides.length-1?0:l.slides[v+1].getWidth(!0,e.roundLengths),S=v===l.slides.length-1?0:l.slides[v+1].getHeight(!0,e.roundLengths),x=p?k:S;if(w>u){if(e.slidesPerViewFit)l.snapGrid.push(m+l.wrapperLeft),l.snapGrid.push(m+w-u+l.wrapperLeft);else for(var j=0;j<=Math.floor(w/(u+l.wrapperLeft));j++)0===j?l.snapGrid.push(m+l.wrapperLeft):l.snapGrid.push(m+l.wrapperLeft+u*j);l.slidesGrid.push(m+l.wrapperLeft)}else l.snapGrid.push(b),l.slidesGrid.push(b);b+=w/2+x/2}else{if(w>u)if(e.slidesPerViewFit)l.snapGrid.push(m),l.snapGrid.push(m+w-u);else if(0!==u)for(var E=0;E<=Math.floor(w/u);E++)l.snapGrid.push(m+u*E);else l.snapGrid.push(m);else l.snapGrid.push(m);l.slidesGrid.push(m)}m+=w,y+=a,_+=c}e.calculateHeight&&(l.height=f),p?(o=y+l.wrapperRight+l.wrapperLeft,e.cssWidthAndHeight&&"height"!==e.cssWidthAndHeight||(g.style.width=y+"px"),e.cssWidthAndHeight&&"width"!==e.cssWidthAndHeight||(g.style.height=l.height+"px")):(e.cssWidthAndHeight&&"height"!==e.cssWidthAndHeight||(g.style.width=l.width+"px"),e.cssWidthAndHeight&&"width"!==e.cssWidthAndHeight||(g.style.height=_+"px"),o=_+l.wrapperTop+l.wrapperBottom)}else if(e.scrollContainer)g.style.width="",g.style.height="",h=l.slides[0].getWidth(!0,e.roundLengths),d=l.slides[0].getHeight(!0,e.roundLengths),o=p?h:d,g.style.width=h+"px",g.style.height=d+"px",r=p?h:d;else{if(e.calculateHeight){for(f=0,d=0,p||(l.container.style.height=""),g.style.height="",v=0;v<l.slides.length;v++)l.slides[v].style.height="",f=Math.max(l.slides[v].getHeight(!0),f),p||(d+=l.slides[v].getHeight(!0));c=f,l.height=c,p?d=c:(u=c,l.container.style.height=u+"px")}else c=p?l.height:l.height/e.slidesPerView,e.roundLengths&&(c=Math.ceil(c)),d=p?l.height:l.slides.length*c;for(a=p?l.width/e.slidesPerView:l.width,e.roundLengths&&(a=Math.ceil(a)),h=p?l.slides.length*a:l.width,r=p?a:c,e.offsetSlidesBefore>0&&(p?l.wrapperLeft=r*e.offsetSlidesBefore:l.wrapperTop=r*e.offsetSlidesBefore),e.offsetSlidesAfter>0&&(p?l.wrapperRight=r*e.offsetSlidesAfter:l.wrapperBottom=r*e.offsetSlidesAfter),e.offsetPxBefore>0&&(p?l.wrapperLeft=e.offsetPxBefore:l.wrapperTop=e.offsetPxBefore),e.offsetPxAfter>0&&(p?l.wrapperRight=e.offsetPxAfter:l.wrapperBottom=e.offsetPxAfter),e.centeredSlides&&(p?(l.wrapperLeft=(u-r)/2,l.wrapperRight=(u-r)/2):(l.wrapperTop=(u-r)/2,l.wrapperBottom=(u-r)/2)),p?(l.wrapperLeft>0&&(g.style.paddingLeft=l.wrapperLeft+"px"),l.wrapperRight>0&&(g.style.paddingRight=l.wrapperRight+"px")):(l.wrapperTop>0&&(g.style.paddingTop=l.wrapperTop+"px"),l.wrapperBottom>0&&(g.style.paddingBottom=l.wrapperBottom+"px")),o=p?h+l.wrapperRight+l.wrapperLeft:d+l.wrapperTop+l.wrapperBottom,parseFloat(h)>0&&(!e.cssWidthAndHeight||"height"===e.cssWidthAndHeight)&&(g.style.width=h+"px"),parseFloat(d)>0&&(!e.cssWidthAndHeight||"width"===e.cssWidthAndHeight)&&(g.style.height=d+"px"),m=0,l.snapGrid=[],l.slidesGrid=[],v=0;v<l.slides.length;v++)l.snapGrid.push(m),l.slidesGrid.push(m),m+=r,parseFloat(a)>0&&(!e.cssWidthAndHeight||"height"===e.cssWidthAndHeight)&&(l.slides[v].style.width=a+"px"),parseFloat(c)>0&&(!e.cssWidthAndHeight||"width"===e.cssWidthAndHeight)&&(l.slides[v].style.height=c+"px")}l.initialized?(l.callPlugins("onInit"),e.onInit&&l.fireCallback(e.onInit,l)):(l.callPlugins("onFirstInit"),e.onFirstInit&&l.fireCallback(e.onFirstInit,l)),l.initialized=!0}},l.reInit=function(t){l.init(!0,t)},l.resizeFix=function(t){l.callPlugins("beforeResizeFix"),l.init(e.resizeReInit||t),e.freeMode?l.getWrapperTranslate()<-A()&&(l.setWrapperTransition(0),l.setWrapperTranslate(-A())):(l.swipeTo(e.loop?l.activeLoopIndex:l.activeIndex,0,!1),e.autoplay&&(l.support.transitions&&void 0!==E?void 0!==E&&(clearTimeout(E),E=void 0,l.startAutoplay()):void 0!==C&&(clearInterval(C),C=void 0,l.startAutoplay()))),l.callPlugins("afterResizeFix")},l.destroy=function(t){var n=l.h.removeEventListener,i="wrapper"===e.eventTarget?l.wrapper:l.container;if(l.browser.ie10||l.browser.ie11?(n(i,l.touchEvents.touchStart,B),n(document,l.touchEvents.touchMove,W),n(document,l.touchEvents.touchEnd,Y)):(l.support.touch&&(n(i,"touchstart",B),n(i,"touchmove",W),n(i,"touchend",Y)),e.simulateTouch&&(n(i,"mousedown",B),n(document,"mousemove",W),n(document,"mouseup",Y))),e.autoResize&&n(window,"resize",l.resizeFix),L(),e.paginationClickable&&U(),e.mousewheelControl&&l._wheelEvent&&n(l.container,l._wheelEvent,I),e.keyboardControl&&n(document,"keydown",N),e.autoplay&&l.stopAutoplay(),t){l.wrapper.removeAttribute("style");for(var r=0;r<l.slides.length;r++)l.slides[r].removeAttribute("style")}l.callPlugins("onDestroy"),window.jQuery&&window.jQuery(l.container).data("swiper")&&window.jQuery(l.container).removeData("swiper"),window.Zepto&&window.Zepto(l.container).data("swiper")&&window.Zepto(l.container).removeData("swiper"),l=null},l.disableKeyboardControl=function(){e.keyboardControl=!1,l.h.removeEventListener(document,"keydown",N)},l.enableKeyboardControl=function(){e.keyboardControl=!0,l.h.addEventListener(document,"keydown",N)};var w=(new Date).getTime();if(l.disableMousewheelControl=function(){return!!l._wheelEvent&&(e.mousewheelControl=!1,l.h.removeEventListener(l.container,l._wheelEvent,I),!0)},l.enableMousewheelControl=function(){return!!l._wheelEvent&&(e.mousewheelControl=!0,l.h.addEventListener(l.container,l._wheelEvent,I),!0)},e.grabCursor){var k=l.container.style;k.cursor="move",k.cursor="grab",k.cursor="-moz-grab",k.cursor="-webkit-grab"}l.allowSlideClick=!0,l.allowLinks=!0;var S,x,j,E,C,T=!1,O=!0;l.swipeNext=function(t,n){void 0===t&&(t=!0),!n&&e.loop&&l.fixLoop(),!n&&e.autoplay&&l.stopAutoplay(!0),l.callPlugins("onSwipeNext");var i=l.getWrapperTranslate().toFixed(2),o=i;if("auto"===e.slidesPerView){for(var s=0;s<l.snapGrid.length;s++)if(-i>=l.snapGrid[s].toFixed(2)&&-i<l.snapGrid[s+1].toFixed(2)){o=-l.snapGrid[s+1];break}}else{var a=r*e.slidesPerGroup;o=-(Math.floor(Math.abs(i)/Math.floor(a))*a+a)}return o<-A()&&(o=-A()),o!==i&&(z(o,"next",{runCallbacks:t}),!0)},l.swipePrev=function(t,n){void 0===t&&(t=!0),!n&&e.loop&&l.fixLoop(),!n&&e.autoplay&&l.stopAutoplay(!0),l.callPlugins("onSwipePrev");var i,o=Math.ceil(l.getWrapperTranslate());if("auto"===e.slidesPerView){i=0;for(var s=1;s<l.snapGrid.length;s++){if(-o===l.snapGrid[s]){i=-l.snapGrid[s-1];break}if(-o>l.snapGrid[s]&&-o<l.snapGrid[s+1]){i=-l.snapGrid[s];break}}}else{var a=r*e.slidesPerGroup;i=-(Math.ceil(-o/a)-1)*a}return i>0&&(i=0),i!==o&&(z(i,"prev",{runCallbacks:t}),!0)},l.swipeReset=function(t){void 0===t&&(t=!0),l.callPlugins("onSwipeReset");var n,i=l.getWrapperTranslate(),o=r*e.slidesPerGroup;A();if("auto"===e.slidesPerView){n=0;for(var s=0;s<l.snapGrid.length;s++){if(-i===l.snapGrid[s])return;if(-i>=l.snapGrid[s]&&-i<l.snapGrid[s+1]){n=l.positions.diff>0?-l.snapGrid[s+1]:-l.snapGrid[s];break}}-i>=l.snapGrid[l.snapGrid.length-1]&&(n=-l.snapGrid[l.snapGrid.length-1]),i<=-A()&&(n=-A())}else n=i<0?Math.round(i/o)*o:0,i<=-A()&&(n=-A());return e.scrollContainer&&(n=i<0?i:0),n<-A()&&(n=-A()),e.scrollContainer&&u>r&&(n=0),n!==i&&(z(n,"reset",{runCallbacks:t}),!0)},l.swipeTo=function(t,n,i){t=parseInt(t,10),l.callPlugins("onSwipeTo",{index:t,speed:n}),e.loop&&(t+=l.loopedSlides);var o,s=l.getWrapperTranslate();if(!(!isFinite(t)||t>l.slides.length-1||t<0))return(o="auto"===e.slidesPerView?-l.slidesGrid[t]:-t*r)<-A()&&(o=-A()),o!==s&&(void 0===i&&(i=!0),z(o,"to",{index:t,speed:n,runCallbacks:i}),!0)},l._queueStartCallbacks=!1,l._queueEndCallbacks=!1,l.updateActiveSlide=function(t){if(l.initialized&&0!==l.slides.length){var n;if(l.previousIndex=l.activeIndex,void 0===t&&(t=l.getWrapperTranslate()),t>0&&(t=0),"auto"===e.slidesPerView){if(l.activeIndex=l.slidesGrid.indexOf(-t),l.activeIndex<0){for(n=0;n<l.slidesGrid.length-1&&!(-t>l.slidesGrid[n]&&-t<l.slidesGrid[n+1]);n++);var i=Math.abs(l.slidesGrid[n]+t),o=Math.abs(l.slidesGrid[n+1]+t);l.activeIndex=i<=o?n:n+1}}else l.activeIndex=Math[e.visibilityFullFit?"ceil":"round"](-t/r);if(l.activeIndex===l.slides.length&&(l.activeIndex=l.slides.length-1),l.activeIndex<0&&(l.activeIndex=0),l.slides[l.activeIndex]){if(l.calcVisibleSlides(t),l.support.classList){var s;for(n=0;n<l.slides.length;n++)(s=l.slides[n]).classList.remove(e.slideActiveClass),l.visibleSlides.indexOf(s)>=0?s.classList.add(e.slideVisibleClass):s.classList.remove(e.slideVisibleClass);l.slides[l.activeIndex].classList.add(e.slideActiveClass)}else{var a=new RegExp("\\s*"+e.slideActiveClass),u=new RegExp("\\s*"+e.slideVisibleClass);for(n=0;n<l.slides.length;n++)l.slides[n].className=l.slides[n].className.replace(a,"").replace(u,""),l.visibleSlides.indexOf(l.slides[n])>=0&&(l.slides[n].className+=" "+e.slideVisibleClass);l.slides[l.activeIndex].className+=" "+e.slideActiveClass}if(e.loop){var c=l.loopedSlides;l.activeLoopIndex=l.activeIndex-c,l.activeLoopIndex>=l.slides.length-2*c&&(l.activeLoopIndex=l.slides.length-2*c-l.activeLoopIndex),l.activeLoopIndex<0&&(l.activeLoopIndex=l.slides.length-2*c+l.activeLoopIndex),l.activeLoopIndex<0&&(l.activeLoopIndex=0)}else l.activeLoopIndex=l.activeIndex;e.pagination&&l.updatePagination(t)}}},l.createPagination=function(t){if(e.paginationClickable&&l.paginationButtons&&U(),l.paginationContainer=e.pagination.nodeType?e.pagination:P(e.pagination)[0],e.createPagination){var n="",i=l.slides.length;e.loop&&(i-=2*l.loopedSlides);for(var r=0;r<i;r++)n+="<"+e.paginationElement+' class="'+e.paginationElementClass+'"></'+e.paginationElement+">";l.paginationContainer.innerHTML=n}l.paginationButtons=P("."+e.paginationElementClass,l.paginationContainer),t||l.updatePagination(),l.callPlugins("onCreatePagination"),e.paginationClickable&&function(){var t=l.paginationButtons;if(t)for(var e=0;e<t.length;e++)l.h.addEventListener(t[e],"click",G)}()},l.updatePagination=function(t){if(e.pagination&&(!(l.slides.length<1)&&P("."+e.paginationActiveClass,l.paginationContainer))){var n=l.paginationButtons;if(0!==n.length){for(var i=0;i<n.length;i++)n[i].className=e.paginationElementClass;var r=e.loop?l.loopedSlides:0;if(e.paginationAsRange){l.visibleSlides||l.calcVisibleSlides(t);var o,s=[];for(o=0;o<l.visibleSlides.length;o++){var a=l.slides.indexOf(l.visibleSlides[o])-r;e.loop&&a<0&&(a=l.slides.length-2*l.loopedSlides+a),e.loop&&a>=l.slides.length-2*l.loopedSlides&&(a=l.slides.length-2*l.loopedSlides-a,a=Math.abs(a)),s.push(a)}for(o=0;o<s.length;o++)n[s[o]]&&(n[s[o]].className+=" "+e.paginationVisibleClass);e.loop?void 0!==n[l.activeLoopIndex]&&(n[l.activeLoopIndex].className+=" "+e.paginationActiveClass):n[l.activeIndex]&&(n[l.activeIndex].className+=" "+e.paginationActiveClass)}else e.loop?n[l.activeLoopIndex]&&(n[l.activeLoopIndex].className+=" "+e.paginationActiveClass+" "+e.paginationVisibleClass):n[l.activeIndex]&&(n[l.activeIndex].className+=" "+e.paginationActiveClass+" "+e.paginationVisibleClass)}}},l.calcVisibleSlides=function(t){var n=[],i=0,o=0,s=0;p&&l.wrapperLeft>0&&(t+=l.wrapperLeft),!p&&l.wrapperTop>0&&(t+=l.wrapperTop);for(var a=0;a<l.slides.length;a++){s=(i+=o)+(o="auto"===e.slidesPerView?p?l.h.getWidth(l.slides[a],!0,e.roundLengths):l.h.getHeight(l.slides[a],!0,e.roundLengths):r);var c=!1;e.visibilityFullFit?(i>=-t&&s<=-t+u&&(c=!0),i<=-t&&s>=-t+u&&(c=!0)):(s>-t&&s<=-t+u&&(c=!0),i>=-t&&i<-t+u&&(c=!0),i<-t&&s>-t+u&&(c=!0)),c&&n.push(l.slides[a])}0===n.length&&(n=[l.slides[l.activeIndex]]),l.visibleSlides=n},l.startAutoplay=function(){if(l.support.transitions){if(void 0!==E)return!1;if(!e.autoplay)return;l.callPlugins("onAutoplayStart"),e.onAutoplayStart&&l.fireCallback(e.onAutoplayStart,l),K()}else{if(void 0!==C)return!1;if(!e.autoplay)return;l.callPlugins("onAutoplayStart"),e.onAutoplayStart&&l.fireCallback(e.onAutoplayStart,l),C=setInterval(function(){e.loop?(l.fixLoop(),l.swipeNext(!0,!0)):l.swipeNext(!0,!0)||(e.autoplayStopOnLast?(clearInterval(C),C=void 0):l.swipeTo(0))},e.autoplay)}},l.stopAutoplay=function(t){if(l.support.transitions){if(!E)return;E&&clearTimeout(E),E=void 0,t&&!e.autoplayDisableOnInteraction&&l.wrapperTransitionEnd(function(){K()}),l.callPlugins("onAutoplayStop"),e.onAutoplayStop&&l.fireCallback(e.onAutoplayStop,l)}else C&&clearInterval(C),C=void 0,l.callPlugins("onAutoplayStop"),e.onAutoplayStop&&l.fireCallback(e.onAutoplayStop,l)},l.loopCreated=!1,l.removeLoopedSlides=function(){if(l.loopCreated)for(var t=0;t<l.slides.length;t++)!0===l.slides[t].getData("looped")&&l.wrapper.removeChild(l.slides[t])},l.createLoop=function(){if(0!==l.slides.length){"auto"===e.slidesPerView?l.loopedSlides=e.loopedSlides||1:l.loopedSlides=Math.floor(e.slidesPerView)+e.loopAdditionalSlides,l.loopedSlides>l.slides.length&&(l.loopedSlides=l.slides.length);var t,n="",r="",o="",s=l.slides.length,a=Math.floor(l.loopedSlides/s),u=l.loopedSlides%s;for(t=0;t<a*s;t++){var c=t;if(t>=s)c=t-s*Math.floor(t/s);o+=l.slides[c].outerHTML}for(t=0;t<u;t++)r+=q(e.slideDuplicateClass,l.slides[t].outerHTML);for(t=s-u;t<s;t++)n+=q(e.slideDuplicateClass,l.slides[t].outerHTML);var f=n+o+i.innerHTML+o+r;for(i.innerHTML=f,l.loopCreated=!0,l.calcSlides(),t=0;t<l.slides.length;t++)(t<l.loopedSlides||t>=l.slides.length-l.loopedSlides)&&l.slides[t].setData("looped",!0);l.callPlugins("onCreateLoop")}},l.fixLoop=function(){var t;l.activeIndex<l.loopedSlides?(t=l.slides.length-3*l.loopedSlides+l.activeIndex,l.swipeTo(t,0,!1)):("auto"===e.slidesPerView&&l.activeIndex>=2*l.loopedSlides||l.activeIndex>l.slides.length-2*e.slidesPerView)&&(t=-l.slides.length+l.activeIndex+l.loopedSlides,l.swipeTo(t,0,!1))},l.loadSlides=function(){var t="";l.activeLoaderIndex=0;for(var n=e.loader.slides,i=e.loader.loadAllSlides?n.length:e.slidesPerView*(1+e.loader.surroundGroups),r=0;r<i;r++)"outer"===e.loader.slidesHTMLType?t+=n[r]:t+="<"+e.slideElement+' class="'+e.slideClass+'" data-swiperindex="'+r+'">'+n[r]+"</"+e.slideElement+">";l.wrapper.innerHTML=t,l.calcSlides(!0),e.loader.loadAllSlides||l.wrapperTransitionEnd(l.reloadSlides,!0)},l.reloadSlides=function(){var t=e.loader.slides,n=parseInt(l.activeSlide().data("swiperindex"),10);if(!(n<0||n>t.length-1)){l.activeLoaderIndex=n;var i,o=Math.max(0,n-e.slidesPerView*e.loader.surroundGroups),s=Math.min(n+e.slidesPerView*(1+e.loader.surroundGroups)-1,t.length-1);if(n>0){var a=-r*(n-o);l.setWrapperTranslate(a),l.setWrapperTransition(0)}if("reload"===e.loader.logic){l.wrapper.innerHTML="";var u="";for(i=o;i<=s;i++)u+="outer"===e.loader.slidesHTMLType?t[i]:"<"+e.slideElement+' class="'+e.slideClass+'" data-swiperindex="'+i+'">'+t[i]+"</"+e.slideElement+">";l.wrapper.innerHTML=u}else{var c=1e3,f=0;for(i=0;i<l.slides.length;i++){var h=l.slides[i].data("swiperindex");h<o||h>s?l.wrapper.removeChild(l.slides[i]):(c=Math.min(h,c),f=Math.max(h,f))}for(i=o;i<=s;i++){var p;i<c&&((p=document.createElement(e.slideElement)).className=e.slideClass,p.setAttribute("data-swiperindex",i),p.innerHTML=t[i],l.wrapper.insertBefore(p,l.wrapper.firstChild)),i>f&&((p=document.createElement(e.slideElement)).className=e.slideClass,p.setAttribute("data-swiperindex",i),p.innerHTML=t[i],l.wrapper.appendChild(p))}}l.reInit(!0)}},l.calcSlides(),e.loader.slides.length>0&&0===l.slides.length&&l.loadSlides(),e.loop&&l.createLoop(),l.init(),function(){var t,n,i,r,o=l.h.addEventListener,s="wrapper"===e.eventTarget?l.wrapper:l.container;if(l.browser.ie10||l.browser.ie11?(o(s,l.touchEvents.touchStart,B),o(document,l.touchEvents.touchMove,W),o(document,l.touchEvents.touchEnd,Y)):(l.support.touch&&(o(s,"touchstart",B),o(s,"touchmove",W),o(s,"touchend",Y)),e.simulateTouch&&(o(s,"mousedown",B),o(document,"mousemove",W),o(document,"mouseup",Y))),e.autoResize&&o(window,"resize",l.resizeFix),D(),l._wheelEvent=!1,e.mousewheelControl){if(void 0!==document.onmousewheel&&(l._wheelEvent="mousewheel"),!l._wheelEvent)try{new WheelEvent("wheel"),l._wheelEvent="wheel"}catch(t){}l._wheelEvent||(l._wheelEvent="DOMMouseScroll"),l._wheelEvent&&o(l.container,l._wheelEvent,I)}if(e.keyboardControl&&o(document,"keydown",N),e.updateOnImagesReady){l.imagesToLoad=P("img",l.container);for(var a=0;a<l.imagesToLoad.length;a++)t=l.imagesToLoad[a],n=void 0,i=void 0,r=function(){void 0!==l&&null!==l&&(void 0!==l.imagesLoaded&&l.imagesLoaded++,l.imagesLoaded===l.imagesToLoad.length&&(l.reInit(),e.onImagesReady&&l.fireCallback(e.onImagesReady,l)))},t.complete?r():(i=t.currentSrc||t.getAttribute("src"))?((n=new Image).onload=r,n.onerror=r,n.src=i):r()}}(),e.pagination&&l.createPagination(!0),e.loop||e.initialSlide>0?l.swipeTo(e.initialSlide,0,!1):l.updateActiveSlide(0),e.autoplay&&l.startAutoplay(),l.centerIndex=l.activeIndex,e.onSwiperCreated&&l.fireCallback(e.onSwiperCreated,l),l.callPlugins("onSwiperCreated")}function P(t,e){return document.querySelectorAll?(e||document).querySelectorAll(t):jQuery(t,e)}function A(){var t=o-u;return e.freeMode&&(t=o-u),e.slidesPerView>l.slides.length&&!e.centeredSlides&&(t=0),t<0&&(t=0),t}function D(){var t,n=l.h.addEventListener;if(e.preventLinks){var i=P("a",l.container);for(t=0;t<i.length;t++)n(i[t],"click",R)}if(e.releaseFormElements){var r=P("input, textarea, select",l.container);for(t=0;t<r.length;t++)n(r[t],l.touchEvents.touchStart,H,!0),l.support.touch&&e.simulateTouch&&n(r[t],"mousedown",H,!0)}if(e.onSlideClick)for(t=0;t<l.slides.length;t++)n(l.slides[t],"click",M);if(e.onSlideTouch)for(t=0;t<l.slides.length;t++)n(l.slides[t],l.touchEvents.touchStart,F)}function L(){var t,n=l.h.removeEventListener;if(e.onSlideClick)for(t=0;t<l.slides.length;t++)n(l.slides[t],"click",M);if(e.onSlideTouch)for(t=0;t<l.slides.length;t++)n(l.slides[t],l.touchEvents.touchStart,F);if(e.releaseFormElements){var i=P("input, textarea, select",l.container);for(t=0;t<i.length;t++)n(i[t],l.touchEvents.touchStart,H,!0),l.support.touch&&e.simulateTouch&&n(i[t],"mousedown",H,!0)}if(e.preventLinks){var r=P("a",l.container);for(t=0;t<r.length;t++)n(r[t],"click",R)}}function N(t){var e=t.keyCode||t.charCode;if(!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)){if(37===e||39===e||38===e||40===e){for(var n=!1,i=l.h.getOffset(l.container),r=l.h.windowScroll().left,o=l.h.windowScroll().top,s=l.h.windowWidth(),a=l.h.windowHeight(),u=[[i.left,i.top],[i.left+l.width,i.top],[i.left,i.top+l.height],[i.left+l.width,i.top+l.height]],c=0;c<u.length;c++){var f=u[c];f[0]>=r&&f[0]<=r+s&&f[1]>=o&&f[1]<=o+a&&(n=!0)}if(!n)return}p?(37!==e&&39!==e||(t.preventDefault?t.preventDefault():t.returnValue=!1),39===e&&l.swipeNext(),37===e&&l.swipePrev()):(38!==e&&40!==e||(t.preventDefault?t.preventDefault():t.returnValue=!1),40===e&&l.swipeNext(),38===e&&l.swipePrev())}}function I(t){var n=l._wheelEvent,i=0;if(t.detail)i=-t.detail;else if("mousewheel"===n)if(e.mousewheelControlForceToAxis)if(p){if(!(Math.abs(t.wheelDeltaX)>Math.abs(t.wheelDeltaY)))return;i=t.wheelDeltaX}else{if(!(Math.abs(t.wheelDeltaY)>Math.abs(t.wheelDeltaX)))return;i=t.wheelDeltaY}else i=t.wheelDelta;else if("DOMMouseScroll"===n)i=-t.detail;else if("wheel"===n)if(e.mousewheelControlForceToAxis)if(p){if(!(Math.abs(t.deltaX)>Math.abs(t.deltaY)))return;i=-t.deltaX}else{if(!(Math.abs(t.deltaY)>Math.abs(t.deltaX)))return;i=-t.deltaY}else i=Math.abs(t.deltaX)>Math.abs(t.deltaY)?-t.deltaX:-t.deltaY;if(e.freeMode){var r=l.getWrapperTranslate()+i;if(r>0&&(r=0),r<-A()&&(r=-A()),l.setWrapperTransition(0),l.setWrapperTranslate(r),l.updateActiveSlide(r),0===r||r===-A())return}else(new Date).getTime()-w>60&&(i<0?l.swipeNext():l.swipePrev()),w=(new Date).getTime();return e.autoplay&&l.stopAutoplay(!0),t.preventDefault?t.preventDefault():t.returnValue=!1,!1}function M(t){l.allowSlideClick&&($(t),l.fireCallback(e.onSlideClick,l,t))}function F(t){$(t),l.fireCallback(e.onSlideTouch,l,t)}function $(t){if(t.currentTarget)l.clickedSlide=t.currentTarget;else{var n=t.srcElement;do{if(n.className.indexOf(e.slideClass)>-1)break;n=n.parentNode}while(n);l.clickedSlide=n}l.clickedSlideIndex=l.slides.indexOf(l.clickedSlide),l.clickedSlideLoopIndex=l.clickedSlideIndex-(l.loopedSlides||0)}function R(t){if(!l.allowLinks)return t.preventDefault?t.preventDefault():t.returnValue=!1,e.preventLinksPropagation&&"stopPropagation"in t&&t.stopPropagation(),!1}function H(t){return t.stopPropagation?t.stopPropagation():t.returnValue=!1,!1}function B(t){if(e.preventLinks&&(l.allowLinks=!0),l.isTouched||e.onlyExternal)return!1;var n=t.target||t.srcElement;document.activeElement&&document.activeElement!==document.body&&document.activeElement!==n&&document.activeElement.blur();var i="input select textarea".split(" ");if(e.noSwiping&&n&&function(t){var n=!1;do{V(t,e.noSwipingClass)&&(n=!0),t=t.parentElement}while(!n&&t.parentElement&&!V(t,e.wrapperClass));!n&&V(t,e.wrapperClass)&&V(t,e.noSwipingClass)&&(n=!0);return n}(n))return!1;if(O=!1,l.isTouched=!0,!(T="touchstart"===t.type)&&"which"in t&&3===t.which)return l.isTouched=!1,!1;if(!T||1===t.targetTouches.length){l.callPlugins("onTouchStartBegin"),!T&&!l.isAndroid&&i.indexOf(n.tagName.toLowerCase())<0&&(t.preventDefault?t.preventDefault():t.returnValue=!1);var r=T?t.targetTouches[0].pageX:t.pageX||t.clientX,o=T?t.targetTouches[0].pageY:t.pageY||t.clientY;l.touches.startX=l.touches.currentX=r,l.touches.startY=l.touches.currentY=o,l.touches.start=l.touches.current=p?r:o,l.setWrapperTransition(0),l.positions.start=l.positions.current=l.getWrapperTranslate(),l.setWrapperTranslate(l.positions.start),l.times.start=(new Date).getTime(),a=void 0,e.moveStartThreshold>0&&(S=!1),e.onTouchStart&&l.fireCallback(e.onTouchStart,l,t),l.callPlugins("onTouchStartEnd")}}function W(t){if(l.isTouched&&!e.onlyExternal&&(!T||"mousemove"!==t.type)){var n=T?t.targetTouches[0].pageX:t.pageX||t.clientX,i=T?t.targetTouches[0].pageY:t.pageY||t.clientY;if(void 0===a&&p&&(a=!!(a||Math.abs(i-l.touches.startY)>Math.abs(n-l.touches.startX))),void 0!==a||p||(a=!!(a||Math.abs(i-l.touches.startY)<Math.abs(n-l.touches.startX))),a)l.isTouched=!1;else{if(p){if(!e.swipeToNext&&n<l.touches.startX||!e.swipeToPrev&&n>l.touches.startX)return}else if(!e.swipeToNext&&i<l.touches.startY||!e.swipeToPrev&&i>l.touches.startY)return;if(t.assignedToSwiper)l.isTouched=!1;else if(t.assignedToSwiper=!0,e.preventLinks&&(l.allowLinks=!1),e.onSlideClick&&(l.allowSlideClick=!1),e.autoplay&&l.stopAutoplay(!0),!T||1===t.touches.length){var r;if(l.isMoved||(l.callPlugins("onTouchMoveStart"),e.loop&&(l.fixLoop(),l.positions.start=l.getWrapperTranslate()),e.onTouchMoveStart&&l.fireCallback(e.onTouchMoveStart,l)),l.isMoved=!0,t.preventDefault?t.preventDefault():t.returnValue=!1,l.touches.current=p?n:i,l.positions.current=(l.touches.current-l.touches.start)*e.touchRatio+l.positions.start,l.positions.current>0&&e.onResistanceBefore&&l.fireCallback(e.onResistanceBefore,l,l.positions.current),l.positions.current<-A()&&e.onResistanceAfter&&l.fireCallback(e.onResistanceAfter,l,Math.abs(l.positions.current+A())),e.resistance&&"100%"!==e.resistance)if(l.positions.current>0&&(r=1-l.positions.current/u/2,l.positions.current=r<.5?u/2:l.positions.current*r),l.positions.current<-A()){var o=(l.touches.current-l.touches.start)*e.touchRatio+(A()+l.positions.start);r=(u+o)/u;var s=l.positions.current-o*(1-r)/2,c=-A()-u/2;l.positions.current=s<c||r<=0?c:s}if(e.resistance&&"100%"===e.resistance&&(l.positions.current>0&&(!e.freeMode||e.freeModeFluid)&&(l.positions.current=0),l.positions.current<-A()&&(!e.freeMode||e.freeModeFluid)&&(l.positions.current=-A())),!e.followFinger)return;if(e.moveStartThreshold)if(Math.abs(l.touches.current-l.touches.start)>e.moveStartThreshold||S){if(!S)return S=!0,void(l.touches.start=l.touches.current);l.setWrapperTranslate(l.positions.current)}else l.positions.current=l.positions.start;else l.setWrapperTranslate(l.positions.current);return(e.freeMode||e.watchActiveIndex)&&l.updateActiveSlide(l.positions.current),e.grabCursor&&(l.container.style.cursor="move",l.container.style.cursor="grabbing",l.container.style.cursor="-moz-grabbin",l.container.style.cursor="-webkit-grabbing"),x||(x=l.touches.current),j||(j=(new Date).getTime()),l.velocity=(l.touches.current-x)/((new Date).getTime()-j)/2,Math.abs(l.touches.current-x)<2&&(l.velocity=0),x=l.touches.current,j=(new Date).getTime(),l.callPlugins("onTouchMoveEnd"),e.onTouchMove&&l.fireCallback(e.onTouchMove,l,t),!1}}}}function Y(t){if(a&&l.swipeReset(),!e.onlyExternal&&l.isTouched){l.isTouched=!1,e.grabCursor&&(l.container.style.cursor="move",l.container.style.cursor="grab",l.container.style.cursor="-moz-grab",l.container.style.cursor="-webkit-grab"),l.positions.current||0===l.positions.current||(l.positions.current=l.positions.start),e.followFinger&&l.setWrapperTranslate(l.positions.current),l.times.end=(new Date).getTime(),l.touches.diff=l.touches.current-l.touches.start,l.touches.abs=Math.abs(l.touches.diff),l.positions.diff=l.positions.current-l.positions.start,l.positions.abs=Math.abs(l.positions.diff);var n=l.positions.diff,i=l.positions.abs,o=l.times.end-l.times.start;i<5&&o<300&&!1===l.allowLinks&&(e.freeMode||0===i||l.swipeReset(),e.preventLinks&&(l.allowLinks=!0),e.onSlideClick&&(l.allowSlideClick=!0)),setTimeout(function(){void 0!==l&&null!==l&&(e.preventLinks&&(l.allowLinks=!0),e.onSlideClick&&(l.allowSlideClick=!0))},100);var c=A();if(!l.isMoved&&e.freeMode)return l.isMoved=!1,e.onTouchEnd&&l.fireCallback(e.onTouchEnd,l,t),void l.callPlugins("onTouchEnd");if(!l.isMoved||l.positions.current>0||l.positions.current<-c)return l.swipeReset(),e.onTouchEnd&&l.fireCallback(e.onTouchEnd,l,t),void l.callPlugins("onTouchEnd");if(l.isMoved=!1,e.freeMode){if(e.freeModeFluid){var f,h=1e3*e.momentumRatio,d=l.velocity*h,m=l.positions.current+d,v=!1,g=20*Math.abs(l.velocity)*e.momentumBounceRatio;m<-c&&(e.momentumBounce&&l.support.transitions?(m+c<-g&&(m=-c-g),f=-c,v=!0,O=!0):m=-c),m>0&&(e.momentumBounce&&l.support.transitions?(m>g&&(m=g),f=0,v=!0,O=!0):m=0),0!==l.velocity&&(h=Math.abs((m-l.positions.current)/l.velocity)),l.setWrapperTranslate(m),l.setWrapperTransition(h),e.momentumBounce&&v&&l.wrapperTransitionEnd(function(){O&&(e.onMomentumBounce&&l.fireCallback(e.onMomentumBounce,l),l.callPlugins("onMomentumBounce"),l.setWrapperTranslate(f),l.setWrapperTransition(300))}),l.updateActiveSlide(m)}return(!e.freeModeFluid||o>=300)&&l.updateActiveSlide(l.positions.current),e.onTouchEnd&&l.fireCallback(e.onTouchEnd,l,t),void l.callPlugins("onTouchEnd")}"toNext"===(s=n<0?"toNext":"toPrev")&&o<=300&&(i<30||!e.shortSwipes?l.swipeReset():l.swipeNext(!0,!0)),"toPrev"===s&&o<=300&&(i<30||!e.shortSwipes?l.swipeReset():l.swipePrev(!0,!0));var y=0;if("auto"===e.slidesPerView){for(var _,b=Math.abs(l.getWrapperTranslate()),w=0,k=0;k<l.slides.length;k++)if((w+=_=p?l.slides[k].getWidth(!0,e.roundLengths):l.slides[k].getHeight(!0,e.roundLengths))>b){y=_;break}y>u&&(y=u)}else y=r*e.slidesPerView;"toNext"===s&&o>300&&(i>=y*e.longSwipesRatio?l.swipeNext(!0,!0):l.swipeReset()),"toPrev"===s&&o>300&&(i>=y*e.longSwipesRatio?l.swipePrev(!0,!0):l.swipeReset()),e.onTouchEnd&&l.fireCallback(e.onTouchEnd,l,t),l.callPlugins("onTouchEnd")}}function V(t,e){return t&&t.getAttribute("class")&&t.getAttribute("class").indexOf(e)>-1}function q(t,e){var n,i=document.createElement("div");return i.innerHTML=e,(n=i.firstChild).className+=" "+t,n.outerHTML}function z(t,n,i){var r="to"===n&&i.speed>=0?i.speed:e.speed,o=+new Date;if(l.support.transitions||!e.DOMAnimation)l.setWrapperTranslate(t),l.setWrapperTransition(r);else{var s=l.getWrapperTranslate(),a=Math.ceil((t-s)/r*(1e3/60)),u=s>t?"toNext":"toPrev";if(l._DOMAnimating)return;!function r(){var c=+new Date;s+=a*(c-o)/(1e3/60),("toNext"===u?s>t:s<t)?(l.setWrapperTranslate(Math.ceil(s)),l._DOMAnimating=!0,window.setTimeout(function(){r()},1e3/60)):(e.onSlideChangeEnd&&("to"===n?!0===i.runCallbacks&&l.fireCallback(e.onSlideChangeEnd,l,u):l.fireCallback(e.onSlideChangeEnd,l,u)),l.setWrapperTranslate(t),l._DOMAnimating=!1)}()}l.updateActiveSlide(t),e.onSlideNext&&"next"===n&&!0===i.runCallbacks&&l.fireCallback(e.onSlideNext,l,t),e.onSlidePrev&&"prev"===n&&!0===i.runCallbacks&&l.fireCallback(e.onSlidePrev,l,t),e.onSlideReset&&"reset"===n&&!0===i.runCallbacks&&l.fireCallback(e.onSlideReset,l,t),"next"!==n&&"prev"!==n&&"to"!==n||!0!==i.runCallbacks||function(t){if(l.callPlugins("onSlideChangeStart"),e.onSlideChangeStart)if(e.queueStartCallbacks&&l.support.transitions){if(l._queueStartCallbacks)return;l._queueStartCallbacks=!0,l.fireCallback(e.onSlideChangeStart,l,t),l.wrapperTransitionEnd(function(){l._queueStartCallbacks=!1})}else l.fireCallback(e.onSlideChangeStart,l,t);if(e.onSlideChangeEnd)if(l.support.transitions)if(e.queueEndCallbacks){if(l._queueEndCallbacks)return;l._queueEndCallbacks=!0,l.wrapperTransitionEnd(function(n){l.fireCallback(e.onSlideChangeEnd,n,t)})}else l.wrapperTransitionEnd(function(n){l.fireCallback(e.onSlideChangeEnd,n,t)});else e.DOMAnimation||setTimeout(function(){l.fireCallback(e.onSlideChangeEnd,l,t)},10)}(n)}function U(){var t=l.paginationButtons;if(t)for(var e=0;e<t.length;e++)l.h.removeEventListener(t[e],"click",G)}function G(t){for(var n,i=t.target||t.srcElement,r=l.paginationButtons,o=0;o<r.length;o++)i===r[o]&&(n=o);e.autoplay&&l.stopAutoplay(!0),l.swipeTo(n)}function K(){E=setTimeout(function(){e.loop?(l.fixLoop(),l.swipeNext(!0,!0)):l.swipeNext(!0,!0)||(e.autoplayStopOnLast?(clearTimeout(E),E=void 0):l.swipeTo(0)),l.wrapperTransitionEnd(function(){void 0!==E&&K()})},e.autoplay)}};e.prototype={plugins:{},wrapperTransitionEnd:function(t,e){"use strict";var n,i=this,r=i.wrapper,o=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"];function s(a){if(a.target===r&&(t(i),i.params.queueEndCallbacks&&(i._queueEndCallbacks=!1),!e))for(n=0;n<o.length;n++)i.h.removeEventListener(r,o[n],s)}if(t)for(n=0;n<o.length;n++)i.h.addEventListener(r,o[n],s)},getWrapperTranslate:function(t){"use strict";var e,n,i,r,o=this.wrapper;return void 0===t&&(t="horizontal"===this.params.mode?"x":"y"),this.support.transforms&&this.params.useCSS3Transforms?(i=window.getComputedStyle(o,null),window.WebKitCSSMatrix?r=new WebKitCSSMatrix("none"===i.webkitTransform?"":i.webkitTransform):e=(r=i.MozTransform||i.OTransform||i.MsTransform||i.msTransform||i.transform||i.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===t&&(n=window.WebKitCSSMatrix?r.m41:16===e.length?parseFloat(e[12]):parseFloat(e[4])),"y"===t&&(n=window.WebKitCSSMatrix?r.m42:16===e.length?parseFloat(e[13]):parseFloat(e[5]))):("x"===t&&(n=parseFloat(o.style.left,10)||0),"y"===t&&(n=parseFloat(o.style.top,10)||0)),n||0},setWrapperTranslate:function(t,e,n){"use strict";var i,r=this.wrapper.style,o={x:0,y:0,z:0};3===arguments.length?(o.x=t,o.y=e,o.z=n):(void 0===e&&(e="horizontal"===this.params.mode?"x":"y"),o[e]=t),this.support.transforms&&this.params.useCSS3Transforms?(i=this.support.transforms3d?"translate3d("+o.x+"px, "+o.y+"px, "+o.z+"px)":"translate("+o.x+"px, "+o.y+"px)",r.webkitTransform=r.MsTransform=r.msTransform=r.MozTransform=r.OTransform=r.transform=i):(r.left=o.x+"px",r.top=o.y+"px"),this.callPlugins("onSetWrapperTransform",o),this.params.onSetWrapperTransform&&this.fireCallback(this.params.onSetWrapperTransform,this,o)},setWrapperTransition:function(t){"use strict";var e=this.wrapper.style;e.webkitTransitionDuration=e.MsTransitionDuration=e.msTransitionDuration=e.MozTransitionDuration=e.OTransitionDuration=e.transitionDuration=t/1e3+"s",this.callPlugins("onSetWrapperTransition",{duration:t}),this.params.onSetWrapperTransition&&this.fireCallback(this.params.onSetWrapperTransition,this,t)},h:{getWidth:function(t,e,n){"use strict";var i=window.getComputedStyle(t,null).getPropertyValue("width"),r=parseFloat(i);return(isNaN(r)||i.indexOf("%")>0||r<0)&&(r=t.offsetWidth-parseFloat(window.getComputedStyle(t,null).getPropertyValue("padding-left"))-parseFloat(window.getComputedStyle(t,null).getPropertyValue("padding-right"))),e&&(r+=parseFloat(window.getComputedStyle(t,null).getPropertyValue("padding-left"))+parseFloat(window.getComputedStyle(t,null).getPropertyValue("padding-right"))),n?Math.ceil(r):r},getHeight:function(t,e,n){"use strict";if(e)return t.offsetHeight;var i=window.getComputedStyle(t,null).getPropertyValue("height"),r=parseFloat(i);return(isNaN(r)||i.indexOf("%")>0||r<0)&&(r=t.offsetHeight-parseFloat(window.getComputedStyle(t,null).getPropertyValue("padding-top"))-parseFloat(window.getComputedStyle(t,null).getPropertyValue("padding-bottom"))),e&&(r+=parseFloat(window.getComputedStyle(t,null).getPropertyValue("padding-top"))+parseFloat(window.getComputedStyle(t,null).getPropertyValue("padding-bottom"))),n?Math.ceil(r):r},getOffset:function(t){"use strict";var e=t.getBoundingClientRect(),n=document.body,i=t.clientTop||n.clientTop||0,r=t.clientLeft||n.clientLeft||0,o=window.pageYOffset||t.scrollTop,s=window.pageXOffset||t.scrollLeft;return document.documentElement&&!window.pageYOffset&&(o=document.documentElement.scrollTop,s=document.documentElement.scrollLeft),{top:e.top+o-i,left:e.left+s-r}},windowWidth:function(){"use strict";return window.innerWidth?window.innerWidth:document.documentElement&&document.documentElement.clientWidth?document.documentElement.clientWidth:void 0},windowHeight:function(){"use strict";return window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight?document.documentElement.clientHeight:void 0},windowScroll:function(){"use strict";return"undefined"!=typeof pageYOffset?{left:window.pageXOffset,top:window.pageYOffset}:document.documentElement?{left:document.documentElement.scrollLeft,top:document.documentElement.scrollTop}:void 0},addEventListener:function(t,e,n,i){"use strict";void 0===i&&(i=!1),t.addEventListener?t.addEventListener(e,n,i):t.attachEvent&&t.attachEvent("on"+e,n)},removeEventListener:function(t,e,n,i){"use strict";void 0===i&&(i=!1),t.removeEventListener?t.removeEventListener(e,n,i):t.detachEvent&&t.detachEvent("on"+e,n)}},setTransform:function(t,e){"use strict";var n=t.style;n.webkitTransform=n.MsTransform=n.msTransform=n.MozTransform=n.OTransform=n.transform=e},setTranslate:function(t,e){"use strict";var n=t.style,i=e.x||0,r=e.y||0,o=e.z||0,s=this.support.transforms3d?"translate3d("+i+"px,"+r+"px,"+o+"px)":"translate("+i+"px,"+r+"px)";n.webkitTransform=n.MsTransform=n.msTransform=n.MozTransform=n.OTransform=n.transform=s,this.support.transforms||(n.left=i+"px",n.top=r+"px")},setTransition:function(t,e){"use strict";var n=t.style;n.webkitTransitionDuration=n.MsTransitionDuration=n.msTransitionDuration=n.MozTransitionDuration=n.OTransitionDuration=n.transitionDuration=e+"ms"},support:{touch:window.Modernizr&&!0===Modernizr.touch||function(){"use strict";return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&!0===Modernizr.csstransforms3d||function(){"use strict";var t=document.createElement("div").style;return"webkitPerspective"in t||"MozPerspective"in t||"OPerspective"in t||"MsPerspective"in t||"perspective"in t}(),transforms:window.Modernizr&&!0===Modernizr.csstransforms||function(){"use strict";var t=document.createElement("div").style;return"transform"in t||"WebkitTransform"in t||"MozTransform"in t||"msTransform"in t||"MsTransform"in t||"OTransform"in t}(),transitions:window.Modernizr&&!0===Modernizr.csstransitions||function(){"use strict";var t=document.createElement("div").style;return"transition"in t||"WebkitTransition"in t||"MozTransition"in t||"msTransition"in t||"MsTransition"in t||"OTransition"in t}(),classList:function(){"use strict";return"classList"in document.createElement("div")}()},browser:{ie8:function(){"use strict";var t=-1;if("Microsoft Internet Explorer"===navigator.appName){var e=navigator.userAgent;null!==new RegExp(/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(e)&&(t=parseFloat(RegExp.$1))}return-1!==t&&t<9}(),ie10:window.navigator.msPointerEnabled,ie11:window.navigator.pointerEnabled}},(window.jQuery||window.Zepto)&&function(t){"use strict";t.fn.swiper=function(n){var i;return this.each(function(r){var o=t(this),s=new e(o[0],n);r||(i=s),o.data("swiper",s)}),i}}(window.jQuery||window.Zepto),void 0!==module?module.exports=e:"function"==typeof t&&t.amd&&t("github:nolimits4web/Swiper@2.7.6/dist/idangerous.swiper.js",[],function(){"use strict";return e})}(),(0,$__System.amdDefine)("github:nolimits4web/Swiper@2.7.6.js",["github:nolimits4web/Swiper@2.7.6/dist/idangerous.swiper.js"],function(t){return t}),$__System.register("components/featured-article-carousel/featured-article-carousel.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","github:nolimits4web/Swiper@2.7.6.js","helpers/helpers.js","components/constants/constants.js"],function(t){"use strict";var e,n,i,r,o,s,a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){t.default},function(t){n=t.configurable},function(t){t.default},function(t){i=t.Helpers},function(t){r=t.Constants}],execute:function(){o=1e3,s=function(t){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),u(Object.getPrototypeOf(l.prototype),"constructor",this).call(this,t,e),this._prevWindowWidth=null,this._handleScreenSizeChange=this._handleScreenSizeChange.bind(this),this._initialize()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,e),a(s,[{key:"_initialize",value:function(){this._handleScreenSizeChange(),setInterval(this._handleScreenSizeChange,o)}},{key:"_handleScreenSizeChange",value:function(){this._prevWindowWidth!==i.Browser.getWindowSize().width&&(this._prevWindowWidth=i.Browser.getWindowSize().width,this.$el.width()>=(this.config.fullsizeWidthPoint||r.TABLET_UP)?this.$el.addClass(this.config.fullsizeStateClass):this.$el.removeClass(this.config.fullsizeStateClass))}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new s(t,e)}}]);var l=s;return s=n({fullsizeStateClass:"b-featured-article-carousel--full-size",fullsizeWidthPoint:null,containerSelector:".b-js-swiper-carousel-container"})(s)||s}(),t("FeaturedArticleCarousel",s)}}}),$__System.register("components/more-information-content/more-information-content.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js","components/events/loading-spinner-events.js","helpers/helpers.js"],function(t){"use strict";var e,n,i,r,o,s,a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable},function(t){t.LoadingSpinnerEvents},function(t){o=t.Helpers}],execute:function(){s=function(t){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),u(Object.getPrototypeOf(l.prototype),"constructor",this).call(this,t,e),this._buttonId=o.Strings.random(8),this._collapsedContent="",this._expandingContent="",this._expandedContent="",this._initialize()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,n),a(s,[{key:"_initialize",value:function(){this._setBriefContent(),this._appendButton()}},{key:"_setBriefContent",value:function(){this._collapsedContent=i(this.config.containerSelector,this.$el).html(),this._expandingContent=o.Strings.removeLineBreaks(o.Strings.removeEmptyHtmlTags(i(this.config.containerSelector,this.$el).html())),this._expandedContent=o.Strings.truncateHtmlContent(i(this.config.containerSelector,this.$el),this._expandingContent,this.config.contentLength,64),i(this.config.containerSelector,this.$el).html(this._expandedContent)}},{key:"_appendButton",value:function(){this._expandingContent!=this._expandedContent&&(this.$el.append(e.parseHTML(this.config.buttonTemplate.replace("{{id}}",this._buttonId))),i("#"+this._buttonId,this.$el).html(this.config.expandButtonText),i("#"+this._buttonId,this.$el).click(this._onClickToggleButton.bind(this)))}},{key:"_onClickToggleButton",value:function(t){e(t.target).html()==this.config.expandButtonText?(this._collapsePanel(),e(t.target).html(this.config.collapseButtonText)):(this._expandPanel(),e(t.target).html(this.config.expandButtonText))}},{key:"_expandPanel",value:function(){i(this.config.containerSelector,this.$el).html(this._expandedContent)}},{key:"_collapsePanel",value:function(){i(this.config.containerSelector,this.$el).html(this._collapsedContent)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new s(t,e)}}]);var l=s;return s=r({containerSelector:".b-more-information-content__content-wrapper",buttonTemplate:'<a class="b-link b-link--block b-link--underline" id="{{id}}" href="javascript:void(0);"></a>',expandButtonText:"more information",collapseButtonText:"less information",contentLength:240,contentHeight:64})(s)||s}(),t("MoreInformationContent",s)}}}),$__System.register("components/category-navigation/category-navigation.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","github:components/handlebars.js@4.0.5.js","lib/component.js","lib/grab.js","lib/config.js","lib/http.js","components/events/loading-spinner-events.js","components/constants/constants.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c,f=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),h=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.default},function(t){o=t.default},function(t){s=t.configurable},function(t){a=t.Http},function(t){u=t.LoadingSpinnerEvents},function(t){l=t.Constants}],execute:function(){c=function(t){function c(t,e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p),h(Object.getPrototypeOf(p.prototype),"constructor",this).call(this,t,e),this.templates=this._compileTemplates(),o(l.SPINNER_SELECTOR,this.$el).trigger(u.SHOW),this._loadData().then(this._handleCompletedDataLoading.bind(this)).catch(this._handleLoadDataFail.bind(this)).finally(function(){o(l.SPINNER_SELECTOR,n.$el).trigger(u.HIDE)}.bind(this))}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(c,r),f(c,[{key:"_compileTemplates",value:function(){return{cell:i.compile(o(this.config.templateCategoryCell,this.$el).html()||""),row:i.compile(o(this.config.templateCategoryRow,this.$el).html()||"")}}},{key:"_loadData",value:function(){return a.get(this.config.categoriesUrl)}},{key:"_handleCompletedDataLoading",value:function(t){o(l.SPINNER_SELECTOR,this.$el).trigger(u.HIDE),this.data=t,this._buildContent(this._addRedirectLink(n.pickBy(t,n.isPlainObject)))}},{key:"_handleLoadDataFail",value:function(){o(".b-js-spinner",this.$el).trigger(u.HIDE),o(this.config.navigationListContent,this.$el).html(l.LOAD_DATA_FAIL_HTML)}},{key:"_addRedirectLink",value:function(t){var e=this;return n.forEach(t,function(t,n){t.redirectLink=e.config.redirectPage+"?category="+n})}},{key:"_buildContent",value:function(t){n.map(n.groupBy(n.map(this._addIndex(n.values(t)),this._buildCategoryData.bind(this)),"rowIndex"),this._buildRow.bind(this))}},{key:"_addIndex",value:function(t){return n.forEach(t,function(t,e){t.index=e})}},{key:"_buildCategoryData",value:function(t){return{data:t,rowIndex:parseInt(t.index/this.config.rowCategoryNumber,10)}}},{key:"_buildCell",value:function(t){return this.templates.cell(t.data)}},{key:"_buildRow",value:function(t){var i=this,r=e(this.templates.row());return n.map(t,function(t){r.append(i._buildCell(t))}.bind(this)),o(this.config.navigationListContent,this.$el).append(r)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new c(t,e)}}]);var p=c;return c=s({rowCategoryNumber:3,categoriesUrl:"",redirectPage:"",templateCategoryCell:".b-js-category-navigation-template-category-cell",templateCategoryRow:".b-js-category-navigation-template-category-row",navigationListContent:".b-js-category-navigation-list-content"})(c)||c}(),t("CategoryNavigation",c)}}}),$__System.register("lib/animation.js",["helpers/helpers.js","npm:lodash@4.17.4.js","github:components/jquery@1.11.3.js"],function(t){"use strict";var e,n,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){t.Helpers},function(t){t.default},function(t){e=t.default}],execute:function(){n=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,null,[{key:"scrollTop",value:function(t,n){t=t||0,n=n||100,e("html, body").animate({scrollTop:t},n)}}]),t}(),t("Animation",n)}}}),$__System.register("components/category-topic-navigation/category-topic-navigation.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","components/abstract-ajax-component/abstract-ajax-component.js","lib/grab.js","lib/config.js","helpers/helpers.js","lib/animation.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),c=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.default},function(t){o=t.configurable},function(t){s=t.Helpers},function(t){a=t.Animation}],execute:function(){u=function(t){function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),c(Object.getPrototypeOf(f.prototype),"constructor",this).call(this,t,e),window.addEventListener("popstate",this._handleUriQueries.bind(this))}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,i),l(u,[{key:"_buildContent",value:function(t){return this.data=this._buildMappingData(t),this._buildCategoryList(this.data),this._handleUriQueries(),null}},{key:"_buildMappingData",value:function(t){var e=this,i={};return i=this._buildMappingObject(t,this._handleClickCategory.bind(this)),n.forEach(n.pickBy(t,n.isPlainObject),function(t,n){i[n].topics=e._buildMappingObject(t,e._handleClickTopic.bind(e))}.bind(this)),i}},{key:"_buildMappingObject",value:function(t,e){var i=this,r={};return n.forEach(n.pickBy(t,n.isPlainObject),function(t,o){r[o]=n.assign({},{key:o,id:s.Strings.random(8),onClick:function(){return function(){return e.call(i,r[o])}.bind(i)}.call(i)},t)}.bind(this)),r}},{key:"_handleClickCategory",value:function(t){this._buildCategoryTopicList(t),this._setUriParams({category:t.key}),a.scrollTop(),this._updateBreadCrumb(),this._updateColumnState(),this._setSelectedItemsState()}},{key:"_handleClickTopic",value:function(t){this._setUriParams({category:s.URI.getParams().category,topic:t.key}),this._buildTopicSubjectList(t),a.scrollTop(),this._updateBreadCrumb(),this._updateColumnState(),this._setSelectedItemsState()}},{key:"_buildCategoryList",value:function(t){this._emptyColumns(["category_body"]),this._buildColumn({items:n.pickBy(t,n.isPlainObject),columnName:"category"})}},{key:"_buildCategoryTopicList",value:function(t){this._emptyColumns(["topic_title","topic_body","subject_title","subject_body"]),this._buildColumn({title:t,items:t.topics,columnName:"topic"})}},{key:"_buildColumn",value:function(t){var e=this;t.title&&r(this.config.columnContainerSelectors[t.columnName+"_title"],this.$el).append(this.templates[t.columnName+"_title"](t.title));var i=r(this.config.columnContainerSelectors[t.columnName+"_body"],this.$el);n.each(n.orderBy(t.items,["jcr:title"],["asc"]),function(n){i.append(e.templates[t.columnName](n)),r("#"+n.id,i).click(n.onClick.bind(e))}.bind(this))}},{key:"_buildTopicSubjectList",value:function(t){this._emptyColumns(["subject_title","subject_body"]);var n=r(this.config.columnContainerSelectors.subject_body,this.$el),i=t.id+"_topic_subject_list";r(this.config.columnContainerSelectors.subject_title,this.$el).append(this.templates.topic_title(t)),n.append(this.templates.subject({id:i,dataSourceUrl:this.config.subjectDataUrl+"?"+(s.URI.getParams()?e.param(s.URI.getParams()):"")})),window.UsydWeb.garfield.init()}},{key:"_emptyColumns",value:function(t){var e=this;n.each(t,function(t){r(e.config.columnContainerSelectors[t],e.$el).html("")}.bind(this))}},{key:"_updateColumnState",value:function(){var t=this,e=s.URI.getParams(),i=[],r="category";e.category&&e.topic?(i=["category","topic"],r="subject"):e.category&&!e.topic?(i=["category","subject"],r="topic"):(i=["topic","subject"],r="category"),n.each(i,function(e){t._setColumnNormalState(e)}.bind(this)),this._setColumnActivatedState(r)}},{key:"_setColumnActivatedState",value:function(t){r(this.config.columnContainerSelectors[t+"_column"],this.$el).addClass("b-category-topic-navigation__column--activated").removeClass("hidden-xs hidden-sm")}},{key:"_setColumnNormalState",value:function(t){r(this.config.columnContainerSelectors[t+"_column"],this.$el).removeClass("b-category-topic-navigation__column--activated").addClass("hidden-xs hidden-sm")}},{key:"_setSelectedItemsState",value:function(){var t=s.URI.getParams();t.category&&(this._refreshListSelectedItem(this.data,t.category,"category"),t.topic&&this._refreshListSelectedItem(this.data[t.category].topics,t.topic,"topic"))}},{key:"_refreshListSelectedItem",value:function(t,e,i){var o=this;n.each(t,function(t){r("#"+t.id,o.$el).removeClass("b-box--lightest-grey")}),r("#"+t[e].id,this.$el).addClass("b-box--lightest-grey")}},{key:"_updateBreadCrumb",value:function(){var t=this,e=s.URI.getParams(),i=r(this.config.breadcrumbSelector,this.$el);i.html(""),e.category&&(i.append(this.templates.breadcrumb_item(n.assign({},this.data[e.category],{id:this.data[e.category].id+"_breadcrumb"}))),r("#"+this.data[e.category].id+"_breadcrumb",i).click(function(){t._setUriParams(),t._handleUriQueries()}.bind(this)),e.topic&&(i.append(this.templates.breadcrumb_item(n.assign({},this.data[e.category].topics[e.topic],{id:this.data[e.category].topics[e.topic].id+"_breadcrumb"}))),r("#"+this.data[e.category].topics[e.topic].id+"_breadcrumb",i).click(function(){t._setUriParams({category:s.URI.getParams().category}),t._handleUriQueries()}.bind(this))))}},{key:"_handleUriQueries",value:function(){var t=s.URI.getParams();t.category?(this._buildCategoryTopicList(this.data[t.category]),t.topic&&this._buildTopicSubjectList(this.data[t.category].topics[t.topic])):this._emptyColumns(["topic_title","topic_body","subject_title","subject_body"]),this._updateBreadCrumb(),this._updateColumnState(),this._setSelectedItemsState()}},{key:"_setUriParams",value:function(t){s.URI.setUriParams(t?e.param(t):"")}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new u(t,e)}}]);var f=u;return u=o({subjectDataUrl:"",sourceUrl:"",columnContainerSelectors:{category_column:".b-category-topic-navigation__column--category",category_body:".b-category-topic-navigation__column--category",topic_column:".b-category-topic-navigation__column--topic",topic_body:".b-category-topic-navigation__column--topic-body",topic_title:".b-category-topic-navigation__column--topic-title",subject_column:".b-category-topic-navigation__column--subject",subject_body:".b-category-topic-navigation__column--subject-body",subject_title:".b-category-topic-navigation__column--subject-title"},templateSelectors:{category:".b-js-category-topic-navigation-template-category-item",topic:".b-js-category-topic-navigation-template-topic-item",subject:".b-js-category-topic-navigation-template-topic-subject-list",topic_title:".b-js-category-topic-navigation-template-topic-title",subject_title:".b-js-category-topic-navigation-template-subject-title",breadcrumb_item:".b-js-category-topic-navigation-template-breadcrumb-item"},breadcrumbSelector:".b-category-topic-navigation__breadcrumb-wrapper",bodyContainer:".b-js-category-topic-navigation__body-container"})(u)||u}(),t("CategoryTopicNavigation",u)}}}),$__System.register("components/category-topic-navigation/topic-subject-list.js",["npm:lodash@4.17.4.js","github:components/handlebars.js@4.0.5.js","components/abstract-ajax-component/abstract-ajax-component.js","lib/grab.js","lib/config.js"],function(t){"use strict";var e,n,i,r,o,s,a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.default},function(t){o=t.configurable}],execute:function(){s=function(t){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),u(Object.getPrototypeOf(l.prototype),"constructor",this).call(this,t,e)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,i),a(s,[{key:"_prepareTemplates",value:function(){var t=this;return e.mapValues(this.config.templateSelectors,function(e){return n.compile(r(e,t.$el.parent().parent()).html()||"")}.bind(this))}},{key:"_buildContent",value:function(t){var n=this,i=r(this.config.listSelector,this.$el);i.html(""),e.forEach(e.orderBy(e.pickBy(t,e.isPlainObject),["jcr:title"],["asc"]),function(t){i.append(n.templates.subject(t))}.bind(this))}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new s(t,e)}}]);var l=s;return s=o({sourceUrl:"",listSelector:".b-category-topic-navigation__topic-subject-list",templateSelectors:{subject:".b-js-category-topic-navigation-template-subject-item"}})(s)||s}(),t("TopicSubjectList",s)}}}),$__System.register("components/filter-component/notices-filter-component.js",["npm:lodash@4.17.4.js","lib/grab.js","lib/config.js","helpers/helpers.js","components/filter-component/abstract-filter-component.js"],function(t){"use strict";var e,n,i,r,o,s,a,u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.configurable},function(t){r=t.Helpers},function(t){o=t.default}],execute:function(){s="b-box--lightest-grey",a=function(t){function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),l(Object.getPrototypeOf(c.prototype),"constructor",this).call(this,t,e),this._persistantNotices={}}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,o),u(a,[{key:"_buildMappingData",value:function(t){var n=this;this._filteringItems={},this._persistantNotices={};var i={};e.forEach(e.pickBy(t,e.isPlainObject),function(t,e){t.persistant?(n._persistantNotices[e]=n._buildMappingItemData(t,e,s),i[e]=n._persistantNotices[e]):(n._filteringItems[e]=n._buildMappingItemData(t,e),i[e]=n._filteringItems[e])}),this._filterOptions=this._buildFilterOptionsMappingData(i)}},{key:"_handleFilteredResult",value:function(t){var i=this;e.forEach(e.transform(this._filteringItems,function(n,i,r){n[r]=e.assign({show:!1},i),t[r]&&(n[r].show=!0)},{}),function(t,e){t.show?n("#"+t.id,n(i.config.resultListContainer,i.$el)).show():n("#"+t.id,n(i.config.resultListContainer,i.$el)).hide()})}},{key:"_renderBody",value:function(){this._buildItemList(this._persistantNotices),this._buildItemList(this._filteringItems),this._buildFilterGroups(this._buildGroups()),UsydWeb.garfield.init(n(this.config.resultListContainer,this.$el).content)}},{key:"_buildGroups",value:function(){var t=e.orderBy(e.transform(this._filterOptions,function(t,n,i){t[n.groupName]||(t[n.groupName]={id:r.Strings.random(8),name:e.upperFirst(n.groupName),sortIndex:"Year"===e.upperFirst(n.groupName)?2:1,options:[]}),t[n.groupName].options.push(n)},{}),["name"],["asc"]);return e.concat(e.find(t,function(t){return"Filter by..."===t.name})||[],e.partition(t,function(t){return"Filter by..."!==t.name&&"Year"!==t.name})[0]||[],e.find(t,function(t){return"Year"===t.name})||[])}},{key:"_buildItemList",value:function(t){var i=this;e.forEach(e.orderBy(t,["startDate"],["desc"]),function(t){n(i.config.resultListContainer,i.$el).append(i.templates.resultItem(t))})}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new a(t,e)}}]);var c=a;return a=i({sourceUrl:"",templateSelectors:{resultItem:".b-js-filter-component-result-item",filterOption:".b-js-filter-component-filter-option",filterGroup:".b-js-filter-component-filter-group"},filterGroupsContainer:".b-js-filter-component-container-filter-groups",filterGroupOptionsContainer:".b-js-filter-component-container-filter-options",resultListContainer:".b-js-filter-component-result-container",buttonGroupClearFilter:".b-js-filter-component-button-group-clear-filter"})(a)||a}(),t("NoticesFilterComponent",a)}}}),$__System.registerDynamic("npm:bluebird@3.3.4/js/browser/bluebird.js",[],!1,function(t,e,n){var i=$__System.get("@@global-helpers").prepareGlobal(n.id,null,null);return function(t){"format global";!function(t){if("object"==typeof exports&&void 0!==module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,n;return function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n||t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(t,e,n){"use strict";e.exports=function(t){var e=t._SomePromiseArray;function n(t){var n=new e(t),i=n.promise();return n.setHowMany(1),n.setUnwrap(),n.init(),i}t.any=function(t){return n(t)},t.prototype.any=function(){return n(this)}}},{}],2:[function(t,e,n){"use strict";var i;try{throw new Error}catch(t){i=t}var r=t("./schedule"),o=t("./queue"),s=t("./util");function a(){this._isTickUsed=!1,this._lateQueue=new o(16),this._normalQueue=new o(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=r}function u(t,e,n){this._lateQueue.push(t,e,n),this._queueTick()}function l(t,e,n){this._normalQueue.push(t,e,n),this._queueTick()}function c(t){this._normalQueue._pushOne(t),this._queueTick()}a.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},a.prototype.disableTrampolineIfNecessary=function(){s.hasDevTools&&(this._trampolineEnabled=!1)},a.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},a.prototype.fatalError=function(t,e){e?(process.stderr.write("Fatal "+(t instanceof Error?t.stack:t)+"\n"),process.exit(2)):this.throwLater(t)},a.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.hasDevTools?(a.prototype.invokeLater=function(t,e,n){this._trampolineEnabled?u.call(this,t,e,n):this._schedule(function(){setTimeout(function(){t.call(e,n)},100)})},a.prototype.invoke=function(t,e,n){this._trampolineEnabled?l.call(this,t,e,n):this._schedule(function(){t.call(e,n)})},a.prototype.settlePromises=function(t){this._trampolineEnabled?c.call(this,t):this._schedule(function(){t._settlePromises()})}):(a.prototype.invokeLater=u,a.prototype.invoke=l,a.prototype.settlePromises=c),a.prototype.invokeFirst=function(t,e,n){this._normalQueue.unshift(t,e,n),this._queueTick()},a.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var n=t.shift(),i=t.shift();e.call(n,i)}else e._settlePromises()}},a.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},a.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},a.prototype._reset=function(){this._isTickUsed=!1},e.exports=a,e.exports.firstLineError=i},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,n){"use strict";e.exports=function(t,e,n,i){var r=!1,o=function(t,e){this._reject(e)},s=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},a=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){r||(r=!0,t.prototype._propagateFrom=i.propagateFromFunction(),t.prototype._boundValue=i.boundValueFunction());var l=n(o),c=new t(e);c._propagateFrom(this,1);var f=this._target();if(c._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:c,target:f,bindingPromise:l};f._then(e,s,void 0,c,h),l._then(a,u,void 0,c,h),c._setOnCancel(l)}else c._resolveCallback(f);return c},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,n){return t.resolve(n).bind(e)}}},{}],4:[function(t,e,n){"use strict";var i;"undefined"!=typeof Promise&&(i=Promise);var r=t("./promise")();r.noConflict=function(){try{Promise===r&&(Promise=i)}catch(t){}return r},e.exports=r},{"./promise":22}],5:[function(t,e,n){"use strict";var i=Object.create;if(i){var r=i(null),o=i(null);r[" size"]=o[" size"]=0}e.exports=function(e){var n,i=t("./util"),r=i.canEvaluate;i.isIdentifier;function o(t,n){var r;if(null!=t&&(r=t[n]),"function"!=typeof r){var o="Object "+i.classString(t)+" has no method '"+i.toString(n)+"'";throw new e.TypeError(o)}return r}function s(t){return o(t,this.pop()).apply(t,this)}function a(t){return t[this]}function u(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(s,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e;if("number"==typeof t)e=u;else if(r){var i=n(t);e=null!==i?i:a}else e=a;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,n){"use strict";e.exports=function(e,n,i,r){var o=t("./util"),s=o.tryCatch,a=o.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!r.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t.isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var n=t._cancellationParent;if(null==n||!n.isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),e=t,t=n}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this.isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n<t.length;++n)this._doInvokeOnCancel(t[n],e);else if(void 0!==t)if("function"==typeof t){if(!e){var i=s(t).call(this._boundValue());i===a&&(this._attachExtraTrace(i.e),u.throwLater(i.e))}}else t._resultCancelled(this)},e.prototype._invokeOnCancel=function(){var t=this._onCancel();this._unsetOnCancel(),u.invoke(this._doInvokeOnCancel,this,t)},e.prototype._invokeInternalOnCancel=function(){this.isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},e.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(t,e,n){"use strict";e.exports=function(e){var n=t("./util"),i=t("./es5").keys,r=n.tryCatch,o=n.errorObj;return function(t,s,a){return function(u){var l=a._boundValue();t:for(var c=0;c<t.length;++c){var f=t[c];if(f===Error||null!=f&&f.prototype instanceof Error){if(u instanceof f)return r(s).call(l,u)}else if("function"==typeof f){var h=r(f).call(l,u);if(h===o)return h;if(h)return r(s).call(l,u)}else if(n.isObject(u)){for(var p=i(f),d=0;d<p.length;++d){var m=p[d];if(f[m]!=u[m])continue t}return r(s).call(l,u)}}return e}}}},{"./es5":13,"./util":36}],8:[function(t,e,n){"use strict";e.exports=function(t){var e=!1,n=[];function i(){this._trace=new i.CapturedTrace(r())}function r(){var t=n.length-1;if(t>=0)return n[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},i.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,n.push(this._trace))},i.prototype._popContext=function(){if(void 0!==this._trace){var t=n.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},i.CapturedTrace=null,i.create=function(){if(e)return new i},i.deactivateLongStackTraces=function(){},i.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,s=t._peekContext,a=t.prototype._peekContext,u=t.prototype._promiseCreated;i.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=s,t.prototype._peekContext=a,t.prototype._promiseCreated=u,e=!1},e=!0,t.prototype._pushContext=i.prototype._pushContext,t.prototype._popContext=i.prototype._popContext,t._peekContext=t.prototype._peekContext=r,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},i}},{}],9:[function(t,e,n){"use strict";e.exports=function(e,n){var i,r,o,s=e._getDomain,a=e._async,u=t("./errors").Warning,l=t("./util"),c=l.canAttachTrace,f=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,h=null,p=null,d=!1,m=!(0==l.env("BLUEBIRD_DEBUG")),v=!(0==l.env("BLUEBIRD_WARNINGS")||!m&&!l.env("BLUEBIRD_WARNINGS")),g=!(0==l.env("BLUEBIRD_LONG_STACK_TRACES")||!m&&!l.env("BLUEBIRD_LONG_STACK_TRACES")),y=0!=l.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(v||!!l.env("BLUEBIRD_W_FORGOTTEN_RETURN"));e.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},e.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),a.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){H("rejectionHandled",i,void 0,this)},e.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},e.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),H("unhandledRejection",r,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},e.prototype._warn=function(t,e,n){return M(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=s();r="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=s();i="function"==typeof t?null===e?t:e.bind(t):void 0};var _=function(){};e.longStackTraces=function(){if(a.haveItemsQueued()&&!G.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!G.longStackTraces&&W()){var t=e.prototype._captureStackTrace,i=e.prototype._attachExtraTrace;G.longStackTraces=!0,_=function(){if(a.haveItemsQueued()&&!G.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=i,n.deactivateLongStackTraces(),a.enableTrampoline(),G.longStackTraces=!1},e.prototype._captureStackTrace=N,e.prototype._attachExtraTrace=I,n.activateLongStackTraces(),a.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return G.longStackTraces&&W()};var b=function(){try{var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),l.global.dispatchEvent(t),function(t,e){var n=document.createEvent("CustomEvent");return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!l.global.dispatchEvent(n)}}catch(t){}return function(){return!1}}(),w=l.isNode?function(){return process.emit.apply(process,arguments)}:l.global?function(t){var e="on"+t.toLowerCase(),n=l.global[e];return!!n&&(n.apply(l.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function k(t,e){return{promise:e}}var S={promiseCreated:k,promiseFulfilled:k,promiseRejected:k,promiseResolved:k,promiseCancelled:k,promiseChained:function(t,e,n){return{promise:e,child:n}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,n){return{reason:e,promise:n}},rejectionHandled:k},x=function(t){var e=!1;try{e=w.apply(null,arguments)}catch(t){a.throwLater(t),e=!0}var n=!1;try{n=b(t,S[t].apply(null,arguments))}catch(t){a.throwLater(t),n=!0}return n||e};function j(){return!1}function E(t,e,n){var i=this;try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+l.toString(t));i._attachCancellationCallback(t)})}catch(t){return t}}function C(t){if(!this.isCancellable())return this;var e=this._onCancel();void 0!==e?l.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function T(){return this._onCancelField}function O(t){this._onCancelField=t}function P(){this._cancellationParent=void 0,this._onCancelField=void 0}function A(t,e){if(0!=(1&e)){this._cancellationParent=t;var n=t._branchesRemainingToCancel;void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}e.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&_()),"warnings"in t){var n=t.warnings;G.warnings=!!n,y=G.warnings,l.isObject(n)&&"wForgottenReturn"in n&&(y=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!G.cancellation){if(a.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");e.prototype._clearCancellationData=P,e.prototype._propagateFrom=A,e.prototype._onCancel=T,e.prototype._setOnCancel=O,e.prototype._attachCancellationCallback=C,e.prototype._execute=E,D=A,G.cancellation=!0}"monitoring"in t&&(t.monitoring&&!G.monitoring?(G.monitoring=!0,e.prototype._fireEvent=x):!t.monitoring&&G.monitoring&&(G.monitoring=!1,e.prototype._fireEvent=j))},e.prototype._fireEvent=j,e.prototype._execute=function(t,e,n){try{t(e,n)}catch(t){return t}},e.prototype._onCancel=function(){},e.prototype._setOnCancel=function(t){},e.prototype._attachCancellationCallback=function(t){},e.prototype._captureStackTrace=function(){},e.prototype._attachExtraTrace=function(){},e.prototype._clearCancellationData=function(){},e.prototype._propagateFrom=function(t,e){};var D=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function L(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function N(){this._trace=new z(this._peekContext())}function I(t,e){if(c(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=$(t);l.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),l.notEnumerableProp(t,"__stackCleaned__",!0)}}}function M(t,n,i){if(G.warnings){var r,o=new u(t);if(n)i._attachExtraTrace(o);else if(G.longStackTraces&&(r=e._peekContext()))r.attachExtraTrace(o);else{var s=$(o);o.stack=s.message+"\n"+s.stack.join("\n")}x("warning",o)||R(o,"",!0)}}function F(t){for(var e=[],n=0;n<t.length;++n){var i=t[n],r=" (No stack trace)"===i||h.test(i),o=r&&Y(i);r&&!o&&(d&&" "!==i.charAt(0)&&(i=" "+i),e.push(i))}return e}function $(t){var e=t.stack;return{message:t.toString(),stack:F(e="string"==typeof e&&e.length>0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n<e.length;++n){var i=e[n];if(" (No stack trace)"===i||h.test(i))break}return n>0&&(e=e.slice(n)),e}(t):[" (No stack trace)"])}}function R(t,e,n){if("undefined"!=typeof console){var i;if(l.isObject(t)){var r=t.stack;i=e+p(r,t)}else i=e+String(t);"function"==typeof o?o(i,n):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(i)}}function H(t,e,n,i){var r=!1;try{"function"==typeof e&&(r=!0,"rejectionHandled"===t?e(i):e(n,i))}catch(t){a.throwLater(t)}"unhandledRejection"===t?x(t,n,i)||r||R(n,"Unhandled rejection "):x(t,i)}function B(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():l.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){if(t.length<41)return t;return t.substr(0,38)+"..."}(e)+">, no stack trace)"}function W(){return"function"==typeof U}var Y=function(){return!1},V=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function q(t){var e=t.match(V);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function z(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);U(this,z),e>32&&this.uncycle()}l.inherits(z,Error),n.CapturedTrace=z,z.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],n={},i=0,r=this;void 0!==r;++i)e.push(r),r=r._parent;for(i=(t=this._length=i)-1;i>=0;--i){var o=e[i].stack;void 0===n[o]&&(n[o]=i)}for(i=0;i<t;++i){var s=n[e[i].stack];if(void 0!==s&&s!==i){s>0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[i]._parent=void 0,e[i]._length=1;var a=i>0?e[i-1]:this;s<t-1?(a._parent=e[s+1],a._parent.uncycle(),a._length=a._parent._length+1):(a._parent=void 0,a._length=1);for(var u=a._length+1,l=i-2;l>=0;--l)e[l]._length=u,u++;return}}}},z.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=$(t),n=e.message,i=[e.stack],r=this;void 0!==r;)i.push(F(r.stack.split("\n"))),r=r._parent;!function(t){for(var e=t[0],n=1;n<t.length;++n){for(var i=t[n],r=e.length-1,o=e[r],s=-1,a=i.length-1;a>=0;--a)if(i[a]===o){s=a;break}for(a=s;a>=0;--a){var u=i[a];if(e[r]!==u)break;e.pop(),r--}e=i}}(i),function(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}(i),l.notEnumerableProp(t,"stack",function(t,e){for(var n=0;n<e.length-1;++n)e[n].push("From previous event:"),e[n]=e[n].join("\n");return n<e.length&&(e[n]=e[n].join("\n")),t+"\n"+e.join("\n")}(n,i)),l.notEnumerableProp(t,"__stackCleaned__",!0)}};var U=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():B(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,h=t,p=e;var n=Error.captureStackTrace;return Y=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var i,r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return h=/@/,p=e,d=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){i="stack"in t}return"stack"in r||!i||"number"!=typeof Error.stackTraceLimit?(p=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?B(e):e.toString()},null):(h=t,p=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(o=function(t){console.warn(t)},l.isNode&&process.stderr.isTTY?o=function(t,e){var n=e?"":"";console.warn(n+t+"\n")}:l.isNode||"string"!=typeof(new Error).stack||(o=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var G={warnings:v,longStackTraces:!1,cancellation:!1,monitoring:!1};return g&&e.longStackTraces(),{longStackTraces:function(){return G.longStackTraces},warnings:function(){return G.warnings},cancellation:function(){return G.cancellation},monitoring:function(){return G.monitoring},propagateFromFunction:function(){return D},boundValueFunction:function(){return L},checkForgottenReturns:function(t,e,n,i,r){if(void 0===t&&null!==e&&y){if(void 0!==r&&r._returnedNonUndefined())return;if(0==(65535&i._bitField))return;n&&(n+=" ");var o="a promise was created in a "+n+"handler but was not returned from it";i._warn(o,!0,e)}},setBounds:function(t,e){if(W()){for(var n,i,r=t.stack.split("\n"),o=e.stack.split("\n"),s=-1,a=-1,u=0;u<r.length;++u)if(l=q(r[u])){n=l.fileName,s=l.line;break}for(u=0;u<o.length;++u){var l;if(l=q(o[u])){i=l.fileName,a=l.line;break}}s<0||a<0||!n||!i||n!==i||s>=a||(Y=function(t){if(f.test(t))return!0;var e=q(t);return!!(e&&e.fileName===n&&s<=e.line&&e.line<=a)})}},warn:M,deprecated:function(t,e){var n=t+" is deprecated and will be removed in a future version.";return e&&(n+=" Use "+e+" instead."),M(n)},CapturedTrace:z,fireDomEvent:b,fireGlobalEvent:w}}},{"./errors":12,"./util":36}],10:[function(t,e,n){"use strict";e.exports=function(t){function e(){return this.value}function n(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(n){return n instanceof t&&n.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:n},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(n,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,function(){throw e})},t.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof t&&n.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:n},void 0);var i=arguments[1];i instanceof t&&i.suppressUnhandledRejections();return this.caught(n,function(){return i})}}},{}],11:[function(t,e,n){"use strict";e.exports=function(t,e){var n=t.reduce,i=t.all;function r(){return i(this)}function o(t,i){return n(t,i,e,e)}t.prototype.each=function(t){return this.mapSeries(t)._then(r,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return n(this,t,e,e)},t.each=function(t,e){return o(t,e)._then(r,void 0,void 0,t,void 0)},t.mapSeries=o}},{}],12:[function(t,e,n){"use strict";var i,r,o=t("./es5"),s=o.freeze,a=t("./util"),u=a.inherits,l=a.notEnumerableProp;function c(t,e){function n(i){if(!(this instanceof n))return new n(i);l(this,"message","string"==typeof i?i:e),l(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return u(n,Error),n}var f=c("Warning","warning"),h=c("CancellationError","cancellation error"),p=c("TimeoutError","timeout error"),d=c("AggregateError","aggregate error");try{i=TypeError,r=RangeError}catch(t){i=c("TypeError","type error"),r=c("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v<m.length;++v)"function"==typeof Array.prototype[m[v]]&&(d.prototype[m[v]]=Array.prototype[m[v]]);o.defineProperty(d.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),d.prototype.isOperational=!0;var g=0;function y(t){if(!(this instanceof y))return new y(t);l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}d.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var n=0;n<this.length;++n){for(var i=this[n]===this?"[Circular AggregateError]":this[n]+"",r=i.split("\n"),o=0;o<r.length;++o)r[o]=t+r[o];e+=(i=r.join("\n"))+"\n"}return g--,e},u(y,Error);var _=Error.__BluebirdErrorTypes__;_||(_=s({CancellationError:h,TimeoutError:p,OperationalError:y,RejectionError:y,AggregateError:d}),o.defineProperty(Error,"__BluebirdErrorTypes__",{value:_,writable:!1,enumerable:!1,configurable:!1})),e.exports={Error:Error,TypeError:i,RangeError:r,CancellationError:_.CancellationError,OperationalError:_.OperationalError,TimeoutError:_.TimeoutError,AggregateError:_.AggregateError,Warning:f}},{"./es5":13,"./util":36}],13:[function(t,e,n){var i=function(){"use strict";return void 0===this}();if(i)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:i,propertyIsWritable:function(t,e){var n=Object.getOwnPropertyDescriptor(t,e);return!(n&&!n.writable&&!n.set)}};else{var r={}.hasOwnProperty,o={}.toString,s={}.constructor.prototype,a=function(t){var e=[];for(var n in t)r.call(t,n)&&e.push(n);return e};e.exports={isArray:function(t){try{return"[object Array]"===o.call(t)}catch(t){return!1}},keys:a,names:a,defineProperty:function(t,e,n){return t[e]=n.value,t},getDescriptor:function(t,e){return{value:t[e]}},freeze:function(t){return t},getPrototypeOf:function(t){try{return Object(t).constructor.prototype}catch(t){return s}},isES5:i,propertyIsWritable:function(){return!0}}}},{}],14:[function(t,e,n){"use strict";e.exports=function(t,e){var n=t.map;t.prototype.filter=function(t,i){return n(this,t,i,e)},t.filter=function(t,i,r){return n(t,i,r,e)}}},{}],15:[function(t,e,n){"use strict";e.exports=function(e,n){var i=t("./util"),r=e.CancellationError,o=i.errorObj;function s(t,e,n){this.promise=t,this.type=e,this.handler=n,this.called=!1,this.cancelPromise=null}function a(t){this.finallyHandler=t}function u(t,e){return null!=t.cancelPromise&&(arguments.length>1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function l(){return f.call(this,this.promise._target()._settledValue())}function c(t){if(!u(this,t))return o.e=t,o}function f(t){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var f=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),t);if(void 0!==f){i._setReturnedNonUndefined();var h=n(f,i);if(h instanceof e){if(null!=this.cancelPromise){if(h.isCancelled()){var p=new r("late cancellation observer");return i._attachExtraTrace(p),o.e=p,o}h.isPending()&&h._attachCancellationCallback(new a(this))}return h._then(l,c,void 0,this,void 0)}}}return i.isRejected()?(u(this),o.e=t,o):(u(this),t)}return s.prototype.isFinallyHandler=function(){return 0===this.type},a.prototype._resultCancelled=function(){u(this.finallyHandler)},e.prototype._passThrough=function(t,e,n,i){return"function"!=typeof t?this.then():this._then(n,i,void 0,new s(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,f,f)},e.prototype.tap=function(t){return this._passThrough(t,1,f)},s}},{"./util":36}],16:[function(t,e,n){"use strict";e.exports=function(e,n,i,r,o,s){var a=t("./errors").TypeError,u=t("./util"),l=u.errorObj,c=u.tryCatch,f=[];function h(t,n,r,o){var s=this._promise=new e(i);s._captureStackTrace(),s._setOnCancel(this),this._stack=o,this._generatorFunction=t,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof r?[r].concat(f):f,this._yieldedPromise=null}u.inherits(h,o),h.prototype._isResolved=function(){return null===this._promise},h.prototype._cleanup=function(){this._promise=this._generator=null},h.prototype._promiseCancelled=function(){if(!this._isResolved()){var t;if(void 0!==this._generator.return)this._promise._pushContext(),t=c(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var n=new e.CancellationError("generator .return() sentinel");e.coroutine.returnSentinel=n,this._promise._attachExtraTrace(n),this._promise._pushContext(),t=c(this._generator.throw).call(this._generator,n),this._promise._popContext(),t===l&&t.e===n&&(t=null)}var i=this._promise;this._cleanup(),t===l?i._rejectCallback(t.e,!1):i.cancel()}},h.prototype._promiseFulfilled=function(t){this._yieldedPromise=null,this._promise._pushContext();var e=c(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},h.prototype._promiseRejected=function(t){this._yieldedPromise=null,this._promise._attachExtraTrace(t),this._promise._pushContext();var e=c(this._generator.throw).call(this._generator,t);this._promise._popContext(),this._continue(e)},h.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof e){var t=this._yieldedPromise;this._yieldedPromise=null,this._promiseCancelled(),t.cancel()}},h.prototype.promise=function(){return this._promise},h.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},h.prototype._continue=function(t){var n=this._promise;if(t===l)return this._cleanup(),n._rejectCallback(t.e,!1);var i=t.value;if(!0===t.done)return this._cleanup(),n._resolveCallback(i);var o=r(i,this._promise);if(o instanceof e||null!==(o=function(t,n,i){for(var o=0;o<n.length;++o){i._pushContext();var s=c(n[o])(t);if(i._popContext(),s===l){i._pushContext();var a=e.reject(l.e);return i._popContext(),a}var u=r(s,i);if(u instanceof e)return u}return null}(o,this._yieldHandlers,this._promise))){var s=(o=o._target())._bitField;0==(50397184&s)?(this._yieldedPromise=o,o._proxy(this,null)):0!=(33554432&s)?this._promiseFulfilled(o._value()):0!=(16777216&s)?this._promiseRejected(o._reason()):this._promiseCancelled()}else this._promiseRejected(new a("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/MqrFmX\n\n".replace("%s",i)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")))},e.coroutine=function(t,e){if("function"!=typeof t)throw new a("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var n=Object(e).yieldHandler,i=h,r=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new i(void 0,void 0,n,r),s=o.promise();return o._generator=e,o._promiseFulfilled(void 0),s}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new a("expecting a function but got "+u.classString(t));f.push(t)},e.spawn=function(t){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof t)return n("generatorFunction must be a function\n\n See http://goo.gl/MqrFmX\n");var i=new h(t,this),r=i.promise();return i._run(e.spawn),r}}},{"./errors":12,"./util":36}],17:[function(t,e,n){"use strict";e.exports=function(e,n,i,r){var o=t("./util");o.canEvaluate,o.tryCatch,o.errorObj;e.join=function(){var t,e=arguments.length-1;e>0&&"function"==typeof arguments[e]&&(t=arguments[e]);var i=[].slice.call(arguments);t&&i.pop();var r=new n(i).promise();return void 0!==t?r.spread(t):r}}},{"./util":36}],18:[function(t,e,n){"use strict";e.exports=function(e,n,i,r,o,s){var a=e._getDomain,u=t("./util"),l=u.tryCatch,c=u.errorObj,f=[];function h(t,e,n,i){this.constructor$(t),this._promise._captureStackTrace();var r=a();this._callback=null===r?e:r.bind(e),this._preservedValues=i===o?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=n>=1?[]:f,this._init$(void 0,-2)}function p(t,e,n,r){if("function"!=typeof e)return i("expecting a function but got "+u.classString(e));var o="object"==typeof n&&null!==n?n.concurrency:0;return new h(t,e,o="number"==typeof o&&isFinite(o)&&o>=1?o:0,r).promise()}u.inherits(h,n),h.prototype._init=function(){},h.prototype._promiseFulfilled=function(t,n){var i=this._values,o=this.length(),a=this._preservedValues,u=this._limit;if(n<0){if(i[n=-1*n-1]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return i[n]=t,this._queue.push(n),!1;null!==a&&(a[n]=t);var f=this._promise,h=this._callback,p=f._boundValue();f._pushContext();var d=l(h).call(p,t,n,o),m=f._popContext();if(s.checkForgottenReturns(d,m,null!==a?"Promise.filter":"Promise.map",f),d===c)return this._reject(d.e),!0;var v=r(d,this._promise);if(v instanceof e){var g=(v=v._target())._bitField;if(0==(50397184&g))return u>=1&&this._inFlight++,i[n]=v,v._proxy(this,-1*(n+1)),!1;if(0==(33554432&g))return 0!=(16777216&g)?(this._reject(v._reason()),!0):(this._cancel(),!0);d=v._value()}i[n]=d}return++this._totalResolved>=o&&(null!==a?this._filter(i,a):this._resolve(i),!0)},h.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,n=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var i=t.pop();this._promiseFulfilled(n[i],i)}},h.prototype._filter=function(t,e){for(var n=e.length,i=new Array(n),r=0,o=0;o<n;++o)t[o]&&(i[r++]=e[o]);i.length=r,this._resolve(i)},h.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return p(this,t,e,null)},e.map=function(t,e,n,i){return p(t,e,n,i)}}},{"./util":36}],19:[function(t,e,n){"use strict";e.exports=function(e,n,i,r,o){var s=t("./util"),a=s.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+s.classString(t));return function(){var i=new e(n);i._captureStackTrace(),i._pushContext();var r=a(t).apply(this,arguments),s=i._popContext();return o.checkForgottenReturns(r,s,"Promise.method",i),i._resolveFromSyncValue(r),i}},e.attempt=e.try=function(t){if("function"!=typeof t)return r("expecting a function but got "+s.classString(t));var i,u=new e(n);if(u._captureStackTrace(),u._pushContext(),arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],c=arguments[2];i=s.isArray(l)?a(t).apply(c,l):a(t).call(c,l)}else i=a(t)();var f=u._popContext();return o.checkForgottenReturns(i,f,"Promise.try",u),u._resolveFromSyncValue(i),u},e.prototype._resolveFromSyncValue=function(t){t===s.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,n){"use strict";var i=t("./util"),r=i.maybeWrapAsError,o=t("./errors").OperationalError,s=t("./es5");var a=/^(?:name|message|stack|cause)$/;function u(t){var e;if(function(t){return t instanceof Error&&s.getPrototypeOf(t)===Error.prototype}(t)){(e=new o(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var n=s.keys(t),r=0;r<n.length;++r){var u=n[r];a.test(u)||(e[u]=t[u])}return e}return i.markAsOriginatingFromRejection(t),t}e.exports=function(t,e){return function(n,i){if(null!==t){if(n){var o=u(r(n));t._attachExtraTrace(o),t._reject(o)}else if(e){var s=[].slice.call(arguments,1);t._fulfill(s)}else t._fulfill(i);t=null}}}},{"./errors":12,"./es5":13,"./util":36}],21:[function(t,e,n){"use strict";e.exports=function(e){var n=t("./util"),i=e._async,r=n.tryCatch,o=n.errorObj;function s(t,e){if(!n.isArray(t))return a.call(this,t,e);var s=r(e).apply(this._boundValue(),[null].concat(t));s===o&&i.throwLater(s.e)}function a(t,e){var n=this._boundValue(),s=void 0===t?r(e).call(n,null):r(e).call(n,null,t);s===o&&i.throwLater(s.e)}function u(t,e){if(!t){var n=new Error(t+"");n.cause=t,t=n}var s=r(e).call(this._boundValue(),t);s===o&&i.throwLater(s.e)}e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var n=a;void 0!==e&&Object(e).spread&&(n=s),this._then(n,u,void 0,this,t)}return this}}},{"./util":36}],22:[function(t,e,n){"use strict";e.exports=function(){var e=function(){return new h("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},n=function(){return new C.PromiseInspection(this._target())},i=function(t){return C.reject(new h(t))};function r(){}var o,s={},a=t("./util");o=a.isNode?function(){var t=process.domain;return void 0===t&&(t=null),t}:function(){return null},a.notEnumerableProp(C,"_getDomain",o);var u=t("./es5"),l=t("./async"),c=new l;u.defineProperty(C,"_async",{value:c});var f=t("./errors"),h=C.TypeError=f.TypeError;C.RangeError=f.RangeError;var p=C.CancellationError=f.CancellationError;C.TimeoutError=f.TimeoutError,C.OperationalError=f.OperationalError,C.RejectionError=f.OperationalError,C.AggregateError=f.AggregateError;var d=function(){},m={},v={},g=t("./thenables")(C,d),y=t("./promise_array")(C,d,g,i,r),_=t("./context")(C),b=_.create,w=t("./debuggability")(C,_),k=(w.CapturedTrace,t("./finally")(C,g)),S=t("./catch_filter")(v),x=t("./nodeback"),j=a.errorObj,E=a.tryCatch;function C(t){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,t!==d&&(!function(t,e){if("function"!=typeof e)throw new h("expecting a function but got "+a.classString(e));if(t.constructor!==C)throw new h("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n")}(this,t),this._resolveFromExecutor(t)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function T(t){this.promise._resolveCallback(t)}function O(t){this.promise._rejectCallback(t,!1)}function P(t){var e=new C(d);e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}return C.prototype.toString=function(){return"[object Promise]"},C.prototype.caught=C.prototype.catch=function(t){var e=arguments.length;if(e>1){var n,r=new Array(e-1),o=0;for(n=0;n<e-1;++n){var s=arguments[n];if(!a.isObject(s))return i("expecting an object but got "+a.classString(s));r[o++]=s}return r.length=o,t=arguments[n],this.then(void 0,S(r,t,this))}return this.then(void 0,t)},C.prototype.reflect=function(){return this._then(n,n,void 0,this,void 0)},C.prototype.then=function(t,e){if(w.warnings()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+a.classString(t);arguments.length>1&&(n+=", "+a.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},C.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},C.prototype.spread=function(t){return"function"!=typeof t?i("expecting a function but got "+a.classString(t)):this.all()._then(t,void 0,void 0,m,void 0)},C.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},C.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new y(this).promise()},C.prototype.error=function(t){return this.caught(a.originatesFromRejection,t)},C.is=function(t){return t instanceof C},C.fromNode=C.fromCallback=function(t){var e=new C(d);e._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,i=E(t)(x(e,n));return i===j&&e._rejectCallback(i.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},C.all=function(t){return new y(t).promise()},C.cast=function(t){var e=g(t);return e instanceof C||((e=new C(d))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},C.resolve=C.fulfilled=C.cast,C.reject=C.rejected=function(t){var e=new C(d);return e._captureStackTrace(),e._rejectCallback(t,!0),e},C.setScheduler=function(t){if("function"!=typeof t)throw new h("expecting a function but got "+a.classString(t));var e=c._schedule;return c._schedule=t,e},C.prototype._then=function(t,e,n,i,r){var s=void 0!==r,a=s?r:new C(d),u=this._target(),l=u._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===i&&0!=(2097152&this._bitField)&&(i=0!=(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var f=o();if(0!=(50397184&l)){var h,m,v=u._settlePromiseCtx;0!=(33554432&l)?(m=u._rejectionHandler0,h=t):0!=(16777216&l)?(m=u._fulfillmentHandler0,h=e,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,m=new p("late cancellation observer"),u._attachExtraTrace(m),h=e),c.invoke(v,u,{handler:null===f?h:"function"==typeof h&&f.bind(h),promise:a,receiver:i,value:m})}else u._addCallbacks(t,e,a,i,f);return a},C.prototype._length=function(){return 65535&this._bitField},C.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},C.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},C.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},C.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},C.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},C.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},C.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},C.prototype._isFinal=function(){return(4194304&this._bitField)>0},C.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},C.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},C.prototype._setAsyncGuaranteed=function(){this._bitField=134217728|this._bitField},C.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==s)return void 0===e&&this._isBound()?this._boundValue():e},C.prototype._promiseAt=function(t){return this[4*t-4+2]},C.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},C.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},C.prototype._boundValue=function(){},C.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,n=t._rejectionHandler0,i=t._promise0,r=t._receiverAt(0);void 0===r&&(r=s),this._addCallbacks(e,n,i,r,null)},C.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),i=t._rejectionHandlerAt(e),r=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=s),this._addCallbacks(n,i,r,o,null)},C.prototype._addCallbacks=function(t,e,n,i,r){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=i,"function"==typeof t&&(this._fulfillmentHandler0=null===r?t:r.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===r?e:r.bind(e));else{var s=4*o-4;this[s+2]=n,this[s+3]=i,"function"==typeof t&&(this[s+0]=null===r?t:r.bind(t)),"function"==typeof e&&(this[s+1]=null===r?e:r.bind(e))}return this._setLength(o+1),o},C.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},C.prototype._resolveCallback=function(t,n){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(e(),!1);var i=g(t,this);if(!(i instanceof C))return this._fulfill(t);n&&this._propagateFrom(i,2);var r=i._target();if(r!==this){var o=r._bitField;if(0==(50397184&o)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;a<s;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!=(33554432&o))this._fulfill(r._value());else if(0!=(16777216&o))this._reject(r._reason());else{var u=new p("late cancellation observer");r._attachExtraTrace(u),this._reject(u)}}else this._reject(e())}},C.prototype._rejectCallback=function(t,e,n){var i=a.ensureErrorObject(t),r=i===t;if(!r&&!n&&w.warnings()){var o="a promise was rejected with a non-error: "+a.classString(t);this._warn(o,!0)}this._attachExtraTrace(i,!!e&&r),this._reject(t)},C.prototype._resolveFromExecutor=function(t){var e=this;this._captureStackTrace(),this._pushContext();var n=!0,i=this._execute(t,function(t){e._resolveCallback(t)},function(t){e._rejectCallback(t,n)});n=!1,this._popContext(),void 0!==i&&e._rejectCallback(i,!0)},C.prototype._settlePromiseFromHandler=function(t,e,n,i){var r=i._bitField;if(0==(65536&r)){var o;i._pushContext(),e===m?n&&"number"==typeof n.length?o=E(t).apply(this._boundValue(),n):(o=j).e=new h("cannot .spread() a non-array: "+a.classString(n)):o=E(t).call(e,n);var s=i._popContext();0==(65536&(r=i._bitField))&&(o===v?i._reject(n):o===j?i._rejectCallback(o.e,!1):(w.checkForgottenReturns(o,s,"",i,this),i._resolveCallback(o)))}},C.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},C.prototype._followee=function(){return this._rejectionHandler0},C.prototype._setFollowee=function(t){this._rejectionHandler0=t},C.prototype._settlePromise=function(t,e,i,o){var s=t instanceof C,a=this._bitField,u=0!=(134217728&a);0!=(65536&a)?(s&&t._invokeInternalOnCancel(),i instanceof k&&i.isFinallyHandler()?(i.cancelPromise=t,E(e).call(i,o)===j&&t._reject(j.e)):e===n?t._fulfill(n.call(i)):i instanceof r?i._promiseCancelled(t):s||t instanceof y?t._cancel():i.cancel()):"function"==typeof e?s?(u&&t._setAsyncGuaranteed(),this._settlePromiseFromHandler(e,i,o,t)):e.call(i,o,t):i instanceof r?i._isResolved()||(0!=(33554432&a)?i._promiseFulfilled(o,t):i._promiseRejected(o,t)):s&&(u&&t._setAsyncGuaranteed(),0!=(33554432&a)?t._fulfill(o):t._reject(o))},C.prototype._settlePromiseLateCancellationObserver=function(t){var e=t.handler,n=t.promise,i=t.receiver,r=t.value;"function"==typeof e?n instanceof C?this._settlePromiseFromHandler(e,i,r,n):e.call(i,r,n):n instanceof C&&n._reject(r)},C.prototype._settlePromiseCtx=function(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)},C.prototype._settlePromise0=function(t,e,n){var i=this._promise0,r=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(i,t,r,e)},C.prototype._clearCallbackDataAtIndex=function(t){var e=4*t-4;this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0},C.prototype._fulfill=function(t){var n=this._bitField;if(!((117506048&n)>>>16)){if(t===this){var i=e();return this._attachExtraTrace(i),this._reject(i)}this._setFulfilled(),this._rejectionHandler0=t,(65535&n)>0&&(0!=(134217728&n)?this._settlePromises():c.settlePromises(this))}},C.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return c.fatalError(t,a.isNode);(65535&e)>0?c.settlePromises(this):this._ensurePossibleRejectionHandled()}},C.prototype._fulfillPromises=function(t,e){for(var n=1;n<t;n++){var i=this._fulfillmentHandlerAt(n),r=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(r,i,o,e)}},C.prototype._rejectPromises=function(t,e){for(var n=1;n<t;n++){var i=this._rejectionHandlerAt(n),r=this._promiseAt(n),o=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(r,i,o,e)}},C.prototype._settlePromises=function(){var t=this._bitField,e=65535&t;if(e>0){if(0!=(16842752&t)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var i=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,i,t),this._fulfillPromises(e,i)}this._setLength(0)}this._clearCancellationData()},C.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},C.defer=C.pending=function(){return w.deprecated("Promise.defer","new Promise"),{promise:new C(d),resolve:T,reject:O}},a.notEnumerableProp(C,"_makeSelfResolutionError",e),t("./method")(C,d,g,i,w),t("./bind")(C,d,g,w),t("./cancel")(C,y,i,w),t("./direct_resolve")(C),t("./synchronous_inspection")(C),t("./join")(C,y,g,d,w),C.Promise=C,t("./map.js")(C,y,i,g,d,w),t("./using.js")(C,i,g,b,d,w),t("./timers.js")(C,d,w),t("./generators.js")(C,i,d,g,r,w),t("./nodeify.js")(C),t("./call_get.js")(C),t("./props.js")(C,y,g,i),t("./race.js")(C,d,g,i),t("./reduce.js")(C,y,i,g,d,w),t("./settle.js")(C,y,w),t("./some.js")(C,y,i),t("./promisify.js")(C,d),t("./any.js")(C),t("./each.js")(C,d),t("./filter.js")(C,d),a.toFastProperties(C),a.toFastProperties(C.prototype),P({a:1}),P({b:2}),P({c:3}),P(1),P(function(){}),P(void 0),P(!1),P(new C(d)),w.setBounds(l.firstLineError,a.lastLineError),C}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,n){"use strict";e.exports=function(e,n,i,r,o){var s=t("./util");s.isArray;function a(t){var i=this._promise=new e(n);t instanceof e&&i._propagateFrom(t,3),i._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return s.inherits(a,o),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function t(n,o){var a=i(this._values,this._promise);if(a instanceof e){var u=(a=a._target())._bitField;if(this._values=a,0==(50397184&u))return this._promise._setAsyncGuaranteed(),a._then(t,this._reject,void 0,this,o);if(0==(33554432&u))return 0!=(16777216&u)?this._reject(a._reason()):this._cancel();a=a._value()}if(null!==(a=s.asArray(a)))0!==a.length?this._iterate(a):-5===o?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{}}}(o));else{var l=r("expecting an array or an iterable object but got "+s.classString(a)).reason();this._promise._rejectCallback(l,!1)}},a.prototype._iterate=function(t){var n=this.getActualLength(t.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var r=this._promise,o=!1,s=null,a=0;a<n;++a){var u=i(t[a],r);s=u instanceof e?(u=u._target())._bitField:null,o?null!==s&&u.suppressUnhandledRejections():null!==s?0==(50397184&s)?(u._proxy(this,a),this._values[a]=u):o=0!=(33554432&s)?this._promiseFulfilled(u._value(),a):0!=(16777216&s)?this._promiseRejected(u._reason(),a):this._promiseCancelled(a):o=this._promiseFulfilled(u,a)}o||r._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},a.prototype._cancel=function(){!this._isResolved()&&this._promise.isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1)},a.prototype._promiseFulfilled=function(t,e){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var n=0;n<t.length;++n)t[n]instanceof e&&t[n].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(t){return t},a}},{"./util":36}],24:[function(t,e,n){"use strict";e.exports=function(e,n){var i={},r=t("./util"),o=t("./nodeback"),s=r.withAppended,a=r.maybeWrapAsError,u=r.canEvaluate,l=t("./errors").TypeError,c={__isPromisified__:!0},f=new RegExp("^(?:"+["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"].join("|")+")$"),h=function(t){return r.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t};function p(t){return!f.test(t)}function d(t){try{return!0===t.__isPromisified__}catch(t){return!1}}function m(t,e,n){var i=r.getDataPropertyOrDefault(t,e+n,c);return!!i&&d(i)}function v(t,e,n,i){for(var o=r.inheritedDataKeys(t),s=[],a=0;a<o.length;++a){var u=o[a],c=t[u],f=i===h||h(u,c,t);"function"!=typeof c||d(c)||m(t,u,e)||!i(u,c,t,f)||s.push(u,c)}return function(t,e,n){for(var i=0;i<t.length;i+=2){var r=t[i];if(n.test(r))for(var o=r.replace(n,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new l("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/MqrFmX\n".replace("%s",e))}}(s,e,n),s}var g,y=function(t){return t.replace(/([$])/,"\\$")};var _=u?g:function(t,u,l,c,f,h){var p=function(){return this}(),d=t;function m(){var r=u;u===i&&(r=this);var l=new e(n);l._captureStackTrace();var c="string"==typeof d&&this!==p?this[d]:t,f=o(l,h);try{c.apply(r,s(arguments,f))}catch(t){l._rejectCallback(a(t),!0,!0)}return l._isFateSealed()||l._setAsyncGuaranteed(),l}return"string"==typeof d&&(t=c),r.notEnumerableProp(m,"__isPromisified__",!0),m};function b(t,e,n,o,s){for(var a=new RegExp(y(e)+"$"),u=v(t,e,a,n),l=0,c=u.length;l<c;l+=2){var f=u[l],h=u[l+1],p=f+e;if(o===_)t[p]=_(f,i,f,h,e,s);else{var d=o(h,function(){return _(f,i,f,h,e,s)});r.notEnumerableProp(d,"__isPromisified__",!0),t[p]=d}}return r.toFastProperties(t),t}e.promisify=function(t,e){if("function"!=typeof t)throw new l("expecting a function but got "+r.classString(t));if(d(t))return t;var n=function(t,e,n){return _(t,e,void 0,t,null,n)}(t,void 0===(e=Object(e)).context?i:e.context,!!e.multiArgs);return r.copyDescriptors(t,n,p),n},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new l("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/MqrFmX\n");var n=!!(e=Object(e)).multiArgs,i=e.suffix;"string"!=typeof i&&(i="Async");var o=e.filter;"function"!=typeof o&&(o=h);var s=e.promisifier;if("function"!=typeof s&&(s=_),!r.isIdentifier(i))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/MqrFmX\n");for(var a=r.inheritedDataKeys(t),u=0;u<a.length;++u){var c=t[a[u]];"constructor"!==a[u]&&r.isClass(c)&&(b(c.prototype,i,o,s,n),b(c,i,o,s,n))}return b(t,i,o,s,n)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(t,e,n){"use strict";e.exports=function(e,n,i,r){var o,s=t("./util"),a=s.isObject,u=t("./es5");"function"==typeof Map&&(o=Map);var l=function(){var t=0,e=0;function n(n,i){this[t]=n,this[t+e]=i,t++}return function(i){e=i.size,t=0;var r=new Array(2*i.size);return i.forEach(n,r),r}}();function c(t){var e,n=!1;if(void 0!==o&&t instanceof o)e=l(t),n=!0;else{var i=u.keys(t),r=i.length;e=new Array(2*r);for(var s=0;s<r;++s){var a=i[s];e[s]=t[a],e[s+r]=a}}this.constructor$(e),this._isMap=n,this._init$(void 0,-3)}function f(t){var n,o=i(t);return a(o)?(n=o instanceof e?o._then(e.props,void 0,void 0,void 0,void 0):new c(o).promise(),o instanceof e&&n._propagateFrom(o,2),n):r("cannot await properties of a non-object\n\n See http://goo.gl/MqrFmX\n")}s.inherits(c,n),c.prototype._init=function(){},c.prototype._promiseFulfilled=function(t,e){if(this._values[e]=t,++this._totalResolved>=this._length){var n;if(this._isMap)n=function(t){for(var e=new o,n=t.length/2|0,i=0;i<n;++i){var r=t[n+i],s=t[i];e.set(r,s)}return e}(this._values);else{n={};for(var i=this.length(),r=0,s=this.length();r<s;++r)n[this._values[r+i]]=this._values[r]}return this._resolve(n),!0}return!1},c.prototype.shouldCopyValues=function(){return!1},c.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return f(this)},e.props=function(t){return f(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,n){"use strict";function i(t){this._capacity=t,this._length=0,this._front=0}i.prototype._willBeOverCapacity=function(t){return this._capacity<t},i.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1),this[this._front+e&this._capacity-1]=t,this._length=e+1},i.prototype._unshiftOne=function(t){var e=this._capacity;this._checkCapacity(this.length()+1);var n=(this._front-1&e-1^e)-e;this[n]=t,this._front=n,this._length=this.length()+1},i.prototype.unshift=function(t,e,n){this._unshiftOne(n),this._unshiftOne(e),this._unshiftOne(t)},i.prototype.push=function(t,e,n){var i=this.length()+3;if(this._willBeOverCapacity(i))return this._pushOne(t),this._pushOne(e),void this._pushOne(n);var r=this._front+i-3;this._checkCapacity(i);var o=this._capacity-1;this[r+0&o]=t,this[r+1&o]=e,this[r+2&o]=n,this._length=i},i.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},i.prototype.length=function(){return this._length},i.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},i.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t,function(t,e,n,i,r){for(var o=0;o<r;++o)n[o+i]=t[o+e],t[o+e]=void 0}(this,0,this,e,this._front+this._length&e-1)},e.exports=i},{}],27:[function(t,e,n){"use strict";e.exports=function(e,n,i,r){var o=t("./util"),s=function(t){return t.then(function(e){return a(e,t)})};function a(t,a){var u=i(t);if(u instanceof e)return s(u);if(null===(t=o.asArray(t)))return r("expecting an array or an iterable object but got "+o.classString(t));var l=new e(n);void 0!==a&&l._propagateFrom(a,3);for(var c=l._fulfill,f=l._reject,h=0,p=t.length;h<p;++h){var d=t[h];(void 0!==d||h in t)&&e.cast(d)._then(c,f,void 0,l,null)}return l}e.race=function(t){return a(t,void 0)},e.prototype.race=function(){return a(this,void 0)}}},{"./util":36}],28:[function(t,e,n){"use strict";e.exports=function(e,n,i,r,o,s){var a=e._getDomain,u=t("./util"),l=u.tryCatch;function c(t,n,i,r){this.constructor$(t);var s=a();this._fn=null===s?n:s.bind(n),void 0!==i&&(i=e.resolve(i))._attachCancellationCallback(this),this._initialValue=i,this._currentCancellable=null,this._eachValues=r===o?[]:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function f(t,e){this.isFulfilled()?e._resolve(t):e._reject(t)}function h(t,e,n,r){return"function"!=typeof e?i("expecting a function but got "+u.classString(e)):new c(t,e,n,r).promise()}function p(t){this.accum=t,this.array._gotAccum(t);var n=r(this.value,this.array._promise);return n instanceof e?(this.array._currentCancellable=n,n._then(d,void 0,void 0,this,void 0)):d.call(this,n)}function d(t){var n,i=this.array,r=i._promise,o=l(i._fn);r._pushContext(),(n=void 0!==i._eachValues?o.call(r._boundValue(),t,this.index,this.length):o.call(r._boundValue(),this.accum,t,this.index,this.length))instanceof e&&(i._currentCancellable=n);var a=r._popContext();return s.checkForgottenReturns(n,a,void 0!==i._eachValues?"Promise.each":"Promise.reduce",r),n}u.inherits(c,n),c.prototype._gotAccum=function(t){void 0!==this._eachValues&&t!==o&&this._eachValues.push(t)},c.prototype._eachComplete=function(t){return this._eachValues.push(t),this._eachValues},c.prototype._init=function(){},c.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},c.prototype.shouldCopyValues=function(){return!1},c.prototype._resolve=function(t){this._promise._resolveCallback(t),this._values=null},c.prototype._resultCancelled=function(t){if(t===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof e&&this._currentCancellable.cancel(),this._initialValue instanceof e&&this._initialValue.cancel())},c.prototype._iterate=function(t){var n,i;this._values=t;var r=t.length;if(void 0!==this._initialValue?(n=this._initialValue,i=0):(n=e.resolve(t[0]),i=1),this._currentCancellable=n,!n.isRejected())for(;i<r;++i){var o={accum:null,value:t[i],index:i,length:r,array:this};n=n._then(p,void 0,void 0,o,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(f,f,void 0,n,this)},e.prototype.reduce=function(t,e){return h(this,t,e,null)},e.reduce=function(t,e,n,i){return h(t,e,n,i)}}},{"./util":36}],29:[function(t,e,n){"use strict";var i,r=t("./util");if(r.isNode&&"undefined"==typeof MutationObserver){var o=global.setImmediate,s=process.nextTick;i=r.isRecentNode?function(t){o.call(global,t)}:function(t){s.call(process,t)}}else i="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?"undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:function(){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}:function(){var t=document.createElement("div"),e={attributes:!0},n=!1,i=document.createElement("div");new MutationObserver(function(){t.classList.toggle("foo"),n=!1}).observe(i,e);return function(r){var o=new MutationObserver(function(){o.disconnect(),r()});o.observe(t,e),n||(n=!0,i.classList.toggle("foo"))}}();e.exports=i},{"./util":36}],30:[function(t,e,n){"use strict";e.exports=function(e,n,i){var r=e.PromiseInspection;function o(t){this.constructor$(t)}t("./util").inherits(o,n),o.prototype._promiseResolved=function(t,e){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(t,e){var n=new r;return n._bitField=33554432,n._settledValueField=t,this._promiseResolved(e,n)},o.prototype._promiseRejected=function(t,e){var n=new r;return n._bitField=16777216,n._settledValueField=t,this._promiseResolved(e,n)},e.settle=function(t){return i.deprecated(".settle()",".reflect()"),new o(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,n){"use strict";e.exports=function(e,n,i){var r=t("./util"),o=t("./errors").RangeError,s=t("./errors").AggregateError,a=r.isArray,u={};function l(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function c(t,e){if((0|e)!==e||e<0)return i("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var n=new l(t),r=n.promise();return n.setHowMany(e),n.init(),r}r.inherits(l,n),l.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=a(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},l.prototype.init=function(){this._initialized=!0,this._init()},l.prototype.setUnwrap=function(){this._unwrap=!0},l.prototype.howMany=function(){return this._howMany},l.prototype.setHowMany=function(t){this._howMany=t},l.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},l.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},l.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},l.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new s,e=this.length();e<this._values.length;++e)this._values[e]!==u&&t.push(this._values[e]);return t.length>0?this._reject(t):this._cancel(),!0}return!1},l.prototype._fulfilled=function(){return this._totalResolved},l.prototype._rejected=function(){return this._values.length-this.length()},l.prototype._addRejected=function(t){this._values.push(t)},l.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},l.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},l.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new o(e)},l.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return c(t,e)},e.prototype.some=function(t){return c(this,t)},e._SomePromiseArray=l}},{"./errors":12,"./util":36}],32:[function(t,e,n){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var n=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},r=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},s=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},a=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=t.prototype._isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype.isCancelled=function(){return this._target()._isCancelled()},t.prototype.isPending=function(){return s.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return r.call(this._target())},t.prototype.isResolved=function(){return a.call(this._target())},t.prototype.value=function(){return n.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),i.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,n){"use strict";e.exports=function(e,n){var i=t("./util"),r=i.errorObj,o=i.isObject;var s={}.hasOwnProperty;return function(t,a){if(o(t)){if(t instanceof e)return t;var u=function(t){try{return function(t){return t.then}(t)}catch(t){return r.e=t,r}}(t);if(u===r){a&&a._pushContext();var l=e.reject(u.e);return a&&a._popContext(),l}if("function"==typeof u)return function(t){return s.call(t,"_promise0")}(t)?(l=new e(n),t._then(l._fulfill,l._reject,void 0,l,null),l):function(t,o,s){var a=new e(n),u=a;s&&s._pushContext(),a._captureStackTrace(),s&&s._popContext();var l=!0,c=i.tryCatch(o).call(t,function(t){a&&(a._resolveCallback(t),a=null)},function(t){a&&(a._rejectCallback(t,l,!0),a=null)});return l=!1,a&&c===r&&(a._rejectCallback(c.e,!0,!0),a=null),u}(t,u,a)}return t}}},{"./util":36}],34:[function(t,e,n){"use strict";e.exports=function(e,n,i){var r=t("./util"),o=e.TimeoutError;function s(t){this.handle=t}s.prototype._resultCancelled=function(){clearTimeout(this.handle)};var a=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,r){var o,u;return void 0!==r?(o=e.resolve(r)._then(a,null,null,t,void 0),i.cancellation()&&r instanceof e&&o._setOnCancel(r)):(o=new e(n),u=setTimeout(function(){o._fulfill()},+t),i.cancellation()&&o._setOnCancel(new s(u))),o._setAsyncGuaranteed(),o};e.prototype.delay=function(t){return u(t,this)};function l(t){return clearTimeout(this.handle),t}function c(t){throw clearTimeout(this.handle),t}e.prototype.timeout=function(t,e){var n,a;t=+t;var u=new s(setTimeout(function(){n.isPending()&&function(t,e,n){var i;i="string"!=typeof e?e instanceof Error?e:new o("operation timed out"):new o(e),r.markAsOriginatingFromRejection(i),t._attachExtraTrace(i),t._reject(i),null!=n&&n.cancel()}(n,e,a)},t));return i.cancellation()?(a=this.then(),(n=a._then(l,c,void 0,u,void 0))._setOnCancel(u)):n=this._then(l,c,void 0,u,void 0),n}}},{"./util":36}],35:[function(t,e,n){"use strict";e.exports=function(e,n,i,r,o,s){var a=t("./util"),u=t("./errors").TypeError,l=t("./util").inherits,c=a.errorObj,f=a.tryCatch;function h(t){setTimeout(function(){throw t},0)}function p(t,n){var r=0,s=t.length,a=new e(o);return function o(){if(r>=s)return a._fulfill();var u=function(t){var e=i(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(t[r++]);if(u instanceof e&&u._isDisposable()){try{u=i(u._getDisposer().tryDispose(n),t.promise)}catch(t){return h(t)}if(u instanceof e)return u._then(o,h,null,null,null)}o()}(),a}function d(t,e,n){this._data=t,this._promise=e,this._context=n}function m(t,e,n){this.constructor$(t,e,n)}function v(t){return d.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function g(t){this.length=t,this.promise=null,this[t-1]=null}d.prototype.data=function(){return this._data},d.prototype.promise=function(){return this._promise},d.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},d.prototype.tryDispose=function(t){var e=this.resource(),n=this._context;void 0!==n&&n._pushContext();var i=null!==e?this.doDispose(e,t):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,i},d.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},l(m,d),m.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},g.prototype._resultCancelled=function(){for(var t=this.length,n=0;n<t;++n){var i=this[n];i instanceof e&&i.cancel()}},e.using=function(){var t=arguments.length;if(t<2)return n("you must pass at least 2 arguments to Promise.using");var r,o=arguments[t-1];if("function"!=typeof o)return n("expecting a function but got "+a.classString(o));var u=!0;2===t&&Array.isArray(arguments[0])?(t=(r=arguments[0]).length,u=!1):(r=arguments,t--);for(var l=new g(t),h=0;h<t;++h){var m=r[h];if(d.isDisposer(m)){var y=m;(m=m.promise())._setDisposable(y)}else{var _=i(m);_ instanceof e&&(m=_._then(v,null,null,{resources:l,index:h},void 0))}l[h]=m}var b=new Array(l.length);for(h=0;h<b.length;++h)b[h]=e.resolve(l[h]).reflect();var w=e.all(b).then(function(t){for(var e=0;e<t.length;++e){var n=t[e];if(n.isRejected())return c.e=n.error(),c;if(!n.isFulfilled())return void w.cancel();t[e]=n.value()}k._pushContext(),o=f(o);var i=u?o.apply(void 0,t):o(t),r=k._popContext();return s.checkForgottenReturns(i,r,"Promise.using",k),i}),k=w.lastly(function(){var t=new e.PromiseInspection(w);return p(l,t)});return l.promise=k,k._setOnCancel(l),k},e.prototype._setDisposable=function(t){this._bitField=131072|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(131072&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new m(t,this,r());throw new u}}},{"./errors":12,"./util":36}],36:[function(t,e,n){"use strict";var i=t("./es5"),r="undefined"==typeof navigator,o={e:{}},s,a="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null;function u(){try{var t=s;return s=null,t.apply(this,arguments)}catch(t){return o.e=t,o}}function l(t){return s=t,u}var c=function(t,e){var n={}.hasOwnProperty;function i(){for(var i in this.constructor=t,this.constructor$=e,e.prototype)n.call(e.prototype,i)&&"$"!==i.charAt(i.length-1)&&(this[i+"$"]=e.prototype[i])}return i.prototype=e.prototype,t.prototype=new i,t.prototype};function f(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function h(t){return"function"==typeof t||"object"==typeof t&&null!==t}function p(t){return f(t)?new Error(j(t)):t}function d(t,e){var n,i=t.length,r=new Array(i+1);for(n=0;n<i;++n)r[n]=t[n];return r[n]=e,r}function m(t,e,n){if(!i.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var r=Object.getOwnPropertyDescriptor(t,e);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function v(t,e,n){if(f(t))return t;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return i.defineProperty(t,e,r),t}function g(t){throw t}var y=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n<t.length;++n)if(t[n]===e)return!0;return!1};if(i.isES5){var n=Object.getOwnPropertyNames;return function(t){for(var r=[],o=Object.create(null);null!=t&&!e(t);){var s;try{s=n(t)}catch(t){return r}for(var a=0;a<s.length;++a){var u=s[a];if(!o[u]){o[u]=!0;var l=Object.getOwnPropertyDescriptor(t,u);null!=l&&null==l.get&&null==l.set&&r.push(u)}}t=i.getPrototypeOf(t)}return r}}var r={}.hasOwnProperty;return function(n){if(e(n))return[];var i=[];t:for(var o in n)if(r.call(n,o))i.push(o);else{for(var s=0;s<t.length;++s)if(r.call(t[s],o))continue t;i.push(o)}return i}}(),_=/this\s*\.\s*\S+\s*=/;function b(t){try{if("function"==typeof t){var e=i.names(t.prototype),n=i.isES5&&e.length>1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),o=_.test(t+"")&&i.names(t).length>0;if(n||r||o)return!0}return!1}catch(t){return!1}}function w(t){function e(){}e.prototype=t;for(var n=8;n--;)new e;return t}var k=/^[a-z$_][a-z$_0-9]*$/i;function S(t){return k.test(t)}function x(t,e,n){for(var i=new Array(t),r=0;r<t;++r)i[r]=e+r+n;return i}function j(t){try{return t+""}catch(t){return"[no string representation]"}}function E(t){return null!==t&&"object"==typeof t&&"string"==typeof t.message&&"string"==typeof t.name}function C(t){try{v(t,"isOperational",!0)}catch(t){}}function T(t){return null!=t&&(t instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===t.isOperational)}function O(t){return E(t)&&i.propertyIsWritable(t,"stack")}var P="stack"in new Error?function(t){return O(t)?t:new Error(j(t))}:function(t){if(O(t))return t;try{throw new Error(j(t))}catch(t){return t}};function A(t){return{}.toString.call(t)}function D(t,e,n){for(var r=i.names(t),o=0;o<r.length;++o){var s=r[o];if(n(s))try{i.defineProperty(e,s,i.getDescriptor(t,s))}catch(t){}}}var L=function(t){return i.isArray(t)?t:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var N="function"==typeof Array.from?function(t){return Array.from(t)}:function(t){for(var e,n=[],i=t[Symbol.iterator]();!(e=i.next()).done;)n.push(e.value);return n};L=function(t){return i.isArray(t)?t:null!=t&&"function"==typeof t[Symbol.iterator]?N(t):null}}var I="undefined"!=typeof process&&"[object process]"===A(process).toLowerCase();function M(t,e){return I?process.env[t]:e}var F={isClass:b,isIdentifier:S,inheritedDataKeys:y,getDataPropertyOrDefault:m,thrower:g,isArray:i.isArray,asArray:L,notEnumerableProp:v,isPrimitive:f,isObject:h,isError:E,canEvaluate:r,errorObj:o,tryCatch:l,inherits:c,withAppended:d,maybeWrapAsError:p,toFastProperties:w,filledRange:x,toString:j,canAttachTrace:O,ensureErrorObject:P,originatesFromRejection:T,markAsOriginatingFromRejection:C,classString:A,copyDescriptors:D,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:I,env:M,global:a},$;F.isRecentNode=F.isNode&&($=process.versions.node.split(".").map(Number),0===$[0]&&$[1]>10||$[0]>0),F.isNode&&F.toFastProperties(process);try{throw new Error}catch(t){F.lastLineError=t}e.exports=F},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}(this),i()}),$__System.registerDynamic("npm:bluebird@3.3.4.js",["npm:bluebird@3.3.4/js/browser/bluebird.js"],!0,function(t,e,n){this||self;n.exports=t("npm:bluebird@3.3.4/js/browser/bluebird.js")}),$__System.register("lib/http.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","npm:bluebird@3.3.4.js"],function(t){"use strict";var e,n,i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default},function(t){t.default},function(t){n=t.default}],execute:function(){i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return r(t,null,[{key:"get",value:function(t){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=i.type,o=void 0===r?"json":r,s=i.data,a=i.cb;return new n(function(n,i,r){return e.ajax(t,{method:"get",data:s,dataType:o,contentType:o}).done(function(t){return"function"==typeof a&&a(t),n(t)}).fail(function(t,e,n){return i(console.error(n))}).always(n)})}},{key:"post",value:function(t,i){var r=i.type,o=void 0===r?"json":r,s=i.data,a=i.cb;return new n(function(n,i,r){o=o||"json",e.ajax(t,{method:"post",data:s,dataType:o,contentType:o}).then(function(t){n(t),"function"==typeof a&&a(t)},function(t,e,n){i(new Error(n))})})}},{key:"list",value:function(){}},{key:"put",value:function(){}}]),t}(),t("Http",i)}}}),$__System.register("components/events/loading-spinner-events.js",[],function(t){"use strict";return{setters:[],execute:function(){t("LoadingSpinnerEvents",{SHOW:"show_corporate_style_loading_spinner",HIDE:"hide_corporate_style_loading_spinner"})}}}),$__System.register("components/abstract-ajax-component/abstract-ajax-component.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","github:components/handlebars.js@4.0.5.js","lib/component.js","lib/grab.js","lib/config.js","lib/http.js","components/events/loading-spinner-events.js","components/constants/constants.js"],function(t){"use strict";var e,n,i,r,o,s,a,u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){t.default},function(t){n=t.default},function(t){i=t.default},function(t){t.configurable},function(t){r=t.Http},function(t){o=t.LoadingSpinnerEvents},function(t){s=t.Constants}],execute:function(){a=function(t){function a(t,e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),l(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,t,e),this.data=null,i(s.SPINNER_SELECTOR,this.$el).trigger(o.SHOW),this._loadData().then(function(t){return n._handleCompletedDataLoading(t),null}.bind(this)).catch(this._handleLoadDataFail.bind(this)).finally(function(){i(s.SPINNER_SELECTOR,n.$el).trigger(o.HIDE)}.bind(this))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,n),u(a,[{key:"_loadData",value:function(){var t=this;return this.config.sourceUrl?1===this.config.sourceUrl.split(",").length?r.get(this.config.sourceUrl,{type:this.config.sourceType}):Promise.all(e.map(this.config.sourceUrl.split(","),function(e){return r.get(e,{type:t.config.sourceType})})):new Promise(function(t,e){e(null)})}},{key:"_handleCompletedDataLoading",value:function(t){i(s.SPINNER_SELECTOR,this.$el).trigger(o.HIDE),this._buildContent(t)}},{key:"_handleLoadDataFail",value:function(t){console.error("Load data fail: ",t),i(".b-js-spinner",this.$el).trigger(o.HIDE),this.config.bodyContainer&&i(this.config.bodyContainer,this.$el)?i(this.config.bodyContainer,this.$el).html(s.LOAD_DATA_FAIL_HTML):this.$el.html(s.LOAD_DATA_FAIL_HTML)}},{key:"_buildContent",value:function(t){}}]),a}(),t("default",a)}}}),$__System.register("components/filter-component/abstract-filter-component.js",["npm:lodash@4.17.4.js","components/abstract-ajax-component/abstract-ajax-component.js","lib/grab.js","lib/config.js","helpers/helpers.js"],function(t){"use strict";var e,n,i,r,o,s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){t.configurable},function(t){r=t.Helpers}],execute:function(){o=function(t){function o(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),a(Object.getPrototypeOf(o.prototype),"constructor",this).call(this,t,e),this._selectedOptions=[],this._filterOptions=[],this._filterGroups=[],this._filteringItems={}}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,n),s(o,[{key:"_buildContent",value:function(t){return this.data=t,this._buildMappingData(t),this._renderBody(),this._initState(),null}},{key:"_buildMappingData",value:function(t){}},{key:"_renderBody",value:function(){}},{key:"_initState",value:function(){}},{key:"_buildFilterOptionsMappingData",value:function(t){var n={};return e.forEach(e.pickBy(t,e.isPlainObject),function(t,i){e.forEach(t.tags,function(t){var e=t.split(":")[1].split("/")[0],o=t.split(":")[1].split("/")[1];n[o]||(n[o]={id:r.Strings.random(8),groupName:e,name:o,items:[]}),n[o].items.push(i)})}),n}},{key:"_buildMappingItemData",value:function(t,n,i){return e.assign({key:n,id:r.Strings.random(8),displayDate:this._buildItemDisplayDate(t.startDate,t.endDate),classes:i||""},t)}},{key:"_buildItemDisplayDate",value:function(t,e){return r.Dates.getHourMinuteAndDate(t,e)}},{key:"_onClickFilterOption",value:function(t,n,i){!0!==i?(this._selectedOptions=e.remove(this._selectedOptions,function(e){return e.id!==t.id}),this._setGroupAllUnchecked(n)):(this._selectedOptions.push(t),this._toggleGroupAllButtonState(n)),this._handleApplyingFilter()}},{key:"_toggleGroupAllButtonState",value:function(t){e.uniqBy(e.concat(this._selectedOptions,t.options),"id").length===this._selectedOptions.length?this._setGroupAllChecked(t):this._setGroupAllUnchecked(t)}},{key:"_onClickGroupClearFilter",value:function(t){var n=e.assign([],this._selectedOptions);this._selectedOptions=e.map(t.options,function(t,i){n=e.remove(n,function(e){return e.id!==t.id})}),this._setOptionsUnchecked(t.options),this._setGroupAllUnchecked(t),this._selectedOptions=n,this._handleApplyingFilter()}},{key:"_onClickGroupAllFilter",value:function(t){!0===i("#"+t.id+"-selected-all",i(this.config.filterGroupOptionsContainer,i("#"+t.id,this.$el))).prop("checked")?(this._selectedOptions=e.uniqBy(e.concat(this._selectedOptions,t.options),"id"),this._setOptionsChecked(t.options),this._handleApplyingFilter()):this._onClickGroupClearFilter(t)}},{key:"_handleApplyingFilter",value:function(){this._handleFilteredResult(this._getFilteredItemList())}},{key:"_onClickClearFilter",value:function(){this._resetSelectedOptions(),this._setGroupsAllButtonsUnchecked(),this._handleApplyingFilter()}},{key:"_getFilteredItemList",value:function(){var t=this;if(e.isEmpty(this._selectedOptions))return this._filteringItems;var n=e.transform(e.groupBy(this._selectedOptions,"groupName"),function(t,n,i){t.push(e.uniq(e.flatten(e.map(n,function(t){return t.items}))))},[]);return n.length>1?e.transform(n.shift().filter(function(t){return n.every(function(e){return-1!==e.indexOf(t)})}),function(e,n,i){e[n]=t._filteringItems[n]},{}):1===n.length?e.transform(n[0],function(e,n,i){e[n]=t._filteringItems[n]},{}):this._filteringItems}},{key:"_handleFilteredResult",value:function(t){}},{key:"_appendContentData",value:function(){this._buildItemList(this._filteringItems),this._buildFilterGroups(this._buildGroups()),UsydWeb.garfield.init(i(this.config.itemListContainer,this.$el).content)}},{key:"_buildGroups",value:function(){var t=e.orderBy(e.transform(this._filterOptions,function(t,n,i){t[n.groupName]||(t[n.groupName]={id:r.Strings.random(8),name:e.upperFirst(n.groupName),sortIndex:"Year"===e.upperFirst(n.groupName)?2:1,options:[]}),t[n.groupName].options.push(n)},{}),["name"],["asc"]);return e.concat(e.find(t,function(t){return"Filter by..."===t.name})||[],e.partition(t,function(t){return"Filter by..."!==t.name&&"Year"!==t.name})[0]||[],e.find(t,function(t){return"Year"===t.name})||[])}},{key:"_buildFilterGroups",value:function(t){var n=this;e.forEach(t,function(t){i(n.config.filterGroupsContainer,n.$el).append(n.templates.filterGroup(t));var r=i(n.config.filterGroupOptionsContainer,i("#"+t.id,n.$el));e.forEach(e.orderBy(t.options,["name"],["asc"]),function(e){r.append(n.templates.filterOption(e)),i("#"+e.id,r).click(function(i){n._onClickFilterOption.call(n,e,t,$(i.target).context.checked)}.bind(n))}.bind(n)),i("#"+t.id+"-clear-button",r).click(n._onClickGroupClearFilter.bind(n,t)),i("#"+t.id+"-selected-all",r).click(n._onClickGroupAllFilter.bind(n,t))}),this._filterGroups=t}},{key:"_buildItemList",value:function(t){}},{key:"_resetSelectedOptions",value:function(){this._selectedOptions=[],this._setOptionsUnchecked(this._filterOptions)}},{key:"_setGroupsAllButtonsUnchecked",value:function(){var t=this;e.forEach(this._filterGroups,function(e){var n=i(t.config.filterGroupOptionsContainer,i("#"+e.id,t.$el));i("#"+e.id+"-selected-all",n).prop("checked",!1)})}},{key:"_setOptionsUnchecked",value:function(t){var n=this;e.forEach(t,function(t){i("#"+t.id,i(n.config.filterGroupOptionsContainer,n.$el)).prop("checked",!1)})}},{key:"_setOptionsChecked",value:function(t){var n=this;e.forEach(t,function(t){i("#"+t.id,i(n.config.filterGroupOptionsContainer,n.$el)).prop("checked",!0)})}},{key:"_setGroupAllChecked",value:function(t){i("#"+t.id+"-selected-all",i(this.config.filterGroupOptionsContainer,i("#"+t.id,this.$el))).prop("checked",!0)}},{key:"_setGroupAllUnchecked",value:function(t){i("#"+t.id+"-selected-all",i(this.config.filterGroupOptionsContainer,i("#"+t.id,this.$el))).prop("checked",!1)}}]),o}(),t("default",o)}}}),$__System.register("components/filter-component/dates-filter-component.js",["npm:lodash@4.17.4.js","components/filter-component/abstract-filter-component.js","lib/grab.js","lib/config.js","helpers/helpers.js","npm:moment@2.11.1.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),c=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable},function(t){o=t.Helpers},function(t){s=t.default}],execute:function(){a="b-box--lightest-grey",u=function(t){function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),c(Object.getPrototypeOf(f.prototype),"constructor",this).call(this,t,e),this._resultHeadingHtml=""}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,n),l(u,[{key:"_renderBody",value:function(){this._getResultTableHeader(),this._buildItemList(this._filteringItems),this._buildFilterGroups(this._buildGroups()),UsydWeb.garfield.init(i(this.config.resultListContainer,this.$el).content)}},{key:"_initState",value:function(){this._applyCurrentYearFilter()}},{key:"_applyCurrentYearFilter",value:function(){var t=this,n=o.Dates.getCurrentYear();e.forEach(this._filterOptions,function(e){e.name==n&&t._selectedOptions.push(e)}.bind(this)),this._setOptionsChecked(this._selectedOptions),this._handleApplyingFilter()}},{key:"_getResultTableHeader",value:function(){this._resultHeadingHtml=i(this.config.resultListContainer,this.$el).html()}},{key:"_buildMappingData",value:function(t){var n=this;this._filteringItems={},e.forEach(e.pickBy(t,e.isPlainObject),function(t,e){n._filteringItems[e]=n._buildMappingItemData(t,e)}),this._filterOptions=e.assign(this._buildFilterYearGroupOptionsMappingData(this._filteringItems),this._buildFilterOptionsMappingData(this._filteringItems))}},{key:"_buildFilterYearGroupOptionsMappingData",value:function(t){var n={},i=o.Dates.getCurrentYear();return e.forEach(e.pickBy(t,e.isPlainObject),function(t,e){var r=s(t.startDate).year();r!=i+1&&r!=i-1&&r!=i||(n[r]||(n[r]={id:o.Strings.random(8),groupName:"Year",name:r,items:[]}),n[r].items.push(e))}),n}},{key:"_buildItemDisplayDate",value:function(t,e){return o.Dates.getDate(t)+(e?" to "+o.Dates.getDate(e):"")}},{key:"_handleFilteredResult",value:function(t){this._buildItemList(t)}},{key:"_buildGroups",value:function(){var t=e.orderBy(e.transform(this._filterOptions,function(t,n,i){t[n.groupName]||(t[n.groupName]={id:o.Strings.random(8),name:e.upperFirst(n.groupName),sortIndex:"Year"===e.upperFirst(n.groupName)?2:1,options:[]}),t[n.groupName].options.push(n)},{}),["name"],["asc"]);return e.concat(e.find(t,function(t){return"Filter by..."===t.name})||[],e.partition(t,function(t){return"Filter by..."!==t.name&&"Year"!==t.name})[0]||[],e.find(t,function(t){return"Year"===t.name})||[])}},{key:"_buildItemList",value:function(t){var n=this;i(this.config.resultListContainer,this.$el).empty(),i(this.config.resultListContainer,this.$el).append(this._resultHeadingHtml),e.forEach(e.orderBy(t,["startDate"],["asc"]),function(t,e){t.classes=e%2!=0?a:"",i(n.config.resultListContainer,n.$el).append(n.templates.resultItem(t))})}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new u(t,e)}}]);var f=u;return u=r({sourceUrl:"",templateSelectors:{resultItem:".b-js-filter-component-result-item",filterOption:".b-js-filter-component-filter-option",filterGroup:".b-js-filter-component-filter-group"},filterGroupsContainer:".b-js-filter-component-container-filter-groups",filterGroupOptionsContainer:".b-js-filter-component-container-filter-options",resultListContainer:".b-js-filter-component-result-container",buttonGroupClearFilter:".b-js-filter-component-button-group-clear-filter"})(u)||u}(),t("DatesFilterComponent",u)}}}),$__System.register("components/table-of-contents/table-of-contents.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js","helpers/helpers.js"],function(t){"use strict";var e,n,i,r,o,s,a=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.default},function(t){o=t.configurable},function(t){t.Helpers}],execute:function(){s=function(t){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),u(Object.getPrototypeOf(l.prototype),"constructor",this).call(this,t,e),this._buildTwoColumnContents(r("li",this.$el)),r(this.config.defaultListHolder,this.$el).html("").hide()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,i),a(s,[{key:"_buildTwoColumnContents",value:function(t){var i=n.map(t,function(t,n){return'<div class="row">\n <div class="col-xs-1 col-sm-1 col-md-1">'+(n+1)+'.</div>\n <div class="col-xs-11 col-sm-11 col-md-11">'+e(t).html()+"</div>\n </div>"});e(r(this.config.columnSelector,this.$el)[0]).html(n.take(i,i.length-Math.floor(i.length/2))),e(r(this.config.columnSelector,this.$el)[1]).html(n.takeRight(i,Math.floor(i.length/2)))}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new s(t,e)}}]);var l=s;return s=o({columnSelector:".b-table-of-contents__column",defaultListHolder:".b-table-of-contents__holder--default"})(s)||s}(),t("TableOfContents",s)}}}),$__System.register("components/events/keycode-events.js",[],function(t){"use strict";return{setters:[],execute:function(){t("KeyEvents",{KEY_CANCEL:3,KEY_HELP:6,KEY_BACK_SPACE:8,KEY_TAB:9,KEY_CLEAR:12,KEY_RETURN:13,KEY_ENTER:14,KEY_SHIFT:16,KEY_CONTROL:17,KEY_ALT:18,KEY_PAUSE:19,KEY_CAPS_LOCK:20,KEY_ESCAPE:27,KEY_SPACE:32,KEY_PAGE_UP:33,KEY_PAGE_DOWN:34,KEY_END:35,KEY_HOME:36,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_PRINTSCREEN:44,KEY_INSERT:45,KEY_DELETE:46,KEY_0:48,KEY_1:49,KEY_2:50,KEY_3:51,KEY_4:52,KEY_5:53,KEY_6:54,KEY_7:55,KEY_8:56,KEY_9:57,KEY_SEMICOLON:59,KEY_EQUALS:61,KEY_A:65,KEY_B:66,KEY_C:67,KEY_D:68,KEY_E:69,KEY_F:70,KEY_G:71,KEY_H:72,KEY_I:73,KEY_J:74,KEY_K:75,KEY_L:76,KEY_M:77,KEY_N:78,KEY_O:79,KEY_P:80,KEY_Q:81,KEY_R:82,KEY_S:83,KEY_T:84,KEY_U:85,KEY_V:86,KEY_W:87,KEY_X:88,KEY_Y:89,KEY_Z:90,KEY_CONTEXT_MENU:93,KEY_NUMPAD0:96,KEY_NUMPAD1:97,KEY_NUMPAD2:98,KEY_NUMPAD3:99,KEY_NUMPAD4:100,KEY_NUMPAD5:101,KEY_NUMPAD6:102,KEY_NUMPAD7:103,KEY_NUMPAD8:104,KEY_NUMPAD9:105,KEY_MULTIPLY:106,KEY_ADD:107,KEY_SEPARATOR:108,KEY_SUBTRACT:109,KEY_DECIMAL:110,KEY_DIVIDE:111,KEY_F1:112,KEY_F2:113,KEY_F3:114,KEY_F4:115,KEY_F5:116,KEY_F6:117,KEY_F7:118,KEY_F8:119,KEY_F9:120,KEY_F10:121,KEY_F11:122,KEY_F12:123,KEY_F13:124,KEY_F14:125,KEY_F15:126,KEY_F16:127,KEY_F17:128,KEY_F18:129,KEY_F19:130,KEY_F20:131,KEY_F21:132,KEY_F22:133,KEY_F23:134,KEY_F24:135,KEY_NUM_LOCK:144,KEY_SCROLL_LOCK:145,KEY_COMMA:188,KEY_DASH:189,KEY_PERIOD:190,KEY_SLASH:191,KEY_BACK_QUOTE:192,KEY_OPEN_BRACKET:219,KEY_BACK_SLASH:220,KEY_CLOSE_BRACKET:221,KEY_QUOTE:222,KEY_META:224})}}}),$__System.register("components/anchor-scroll-hack/anchor-scroll-hack.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js","components/constants/constants.js","helpers/helpers.js","components/events/keycode-events.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),f=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.default},function(t){o=t.configurable},function(t){s=t.Constants},function(t){t.Helpers},function(t){a=t.KeyEvents}],execute:function(){u=s.ANCHOR_SCROLL_START_DELAY+100,l=function(t){function l(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),f(Object.getPrototypeOf(h.prototype),"constructor",this).call(this,t,e),this._findTargetInAnchors=this._findTargetInAnchors.bind(this),this._handleClickEvent=this._handleClickEvent.bind(this),this._handleClickTarget=this._handleClickTarget.bind(this),this._handleHashTarget=this._handleHashTarget.bind(this),this._handleLocationHashChange=this._handleLocationHashChange.bind(this),this._scrollToTarget=this._scrollToTarget.bind(this),this._handleShiftTab=this._handleShiftTab.bind(this),document.documentElement.addEventListener("click",this._handleClickEvent,!1),document.documentElement.addEventListener("keyup",this._handleShiftTab,!1),window.addEventListener("hashchange",this._handleLocationHashChange),window.setTimeout(this._handleLocationHashChange,u)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(l,i),c(l,[{key:"_handleLocationHashChange",value:function(t){this._findTargetInAnchors(this._handleHashTarget)}},{key:"_handleHashTarget",value:function(t){var n=e(t).attr("name");n&&"#".concat(n)===window.location.hash&&this._scrollToTarget(t)}},{key:"_handleClickEvent",value:function(t){var n=e(t.target).attr("href");n&&"#"===n.charAt(0)&&n===window.location.hash&&this._findTargetInAnchors(this._handleClickTarget)}},{key:"_findTargetInAnchors",value:function(t){n.forEach(this.$el.find("a"),t)}},{key:"_handleClickTarget",value:function(t){e(t).attr("name")&&"#".concat(e(t).attr("name"))==window.location.hash&&this._scrollToTarget(t)}},{key:"_handleShiftTab",value:function(t){if(t.which==a.KEY_TAB&&t.shiftKey){var n=this._getStickyMainNavigationHeight()+(this.config.scrollOffset||s.ANCHOR_SCROLL_TARGET_DEFAULT_OFFSET);e("html, body").animate({scrollTop:e(t.srcElement).offset().top-n},s.ANCHOR_SCROLL_WITHOUT_DELAY)}}},{key:"_scrollToTarget",value:function(t){var n=this._getStickyMainNavigationHeight()+(this.config.scrollOffset||s.ANCHOR_SCROLL_TARGET_DEFAULT_OFFSET);e("html, body").animate({scrollTop:e(t).offset().top-n},s.ANIMATION_DURATION_NORMAL)}},{key:"_getStickyMainNavigationHeight",value:function(){return r(this.config.stickNavigationElement||s.GLOBAL_NAVIGATION_CLASS,e("body"))?r(this.config.stickNavigationElement||s.GLOBAL_NAVIGATION_CLASS,e("body")).height():0}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new l(t,e)}}]);var h=l;return l=o({scrollOffset:null})(l)||l}(),t("AnchorScrollHack",l)}}}),$__System.register("components/jumbotron-navigation/jumbotron-navigation.js",["lib/component.js","lib/grab.js","lib/config.js","helpers/helpers.js","components/constants/constants.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),c=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.configurable},function(t){r=t.Helpers},function(t){o=t.Constants}],execute:function(){s="b-icon--hamburger",a="b-icon--close",u=function(t){function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),c(Object.getPrototypeOf(f.prototype),"constructor",this).call(this,t,e),this._updateState=this._updateState.bind(this),this._handleClickButton=this._handleClickButton.bind(this),this._checkVisibility=this._checkVisibility.bind(this),this._isMenuVisible=null,this.buttonId=r.Strings.random(),this.nav=this._getMenuContent(),this._updateState(),window.addEventListener("resize",this._updateState),window.addEventListener("orientationchange",this._updateState)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,e),l(u,[{key:"_getMenuContent",value:function(){return this.templates.nav({buttonId:this.buttonId,content:$($(this.config.targetNav).find("nav").parent()).html()})}},{key:"_show",value:function(){this.$el.removeClass(this.config.activatedState),n(this.config.selectorMenuContent,this.$el).html(""),n(this.config.selectorMenuContent,this.$el).append(this.nav),n(this.config.selectorMenuContent,this.$el).find("nav").css("visibility","hidden"),this._setButtonOpenedState(n("#"+this.buttonId,this.$el)),n("#"+this.buttonId,this.$el).on("click",this._handleClickButton)}},{key:"_hide",value:function(){this.$el.removeClass(this.config.activatedState),n(this.config.selectorMenuContent,this.$el).html("")}},{key:"_showTarget",value:function(){$(this.config.targetNav).css("visibility","")}},{key:"_hideTarget",value:function(){$(this.config.targetNav).css("visibility","hidden")}},{key:"_checkVisibility",value:function(){return o[this.config.breakpoint]>=r.Browser.getWindowSize().width}},{key:"_updateState",value:function(){this._checkVisibility()!==this._isMenuVisible&&(this._checkVisibility()?(this._isMenuVisible=!0,this._show(),this._hideTarget()):(this._isMenuVisible=!1,this._hide(),this._showTarget()))}},{key:"_handleClickButton",value:function(t){var e=$(t.target).has("a")?$(t.target).parent():$(t.target);$(e.find(".b-icon")).hasClass(s)?(this._setButtonClosedState(e),n(this.config.selectorMenuContent,this.$el).find("nav").css("visibility",""),this.$el.addClass(this.config.activatedState)):(this._setButtonOpenedState(e),n(this.config.selectorMenuContent,this.$el).find("nav").css("visibility","hidden"),this.$el.removeClass(this.config.activatedState))}},{key:"_setButtonOpenedState",value:function(t){$(t.find(".b-icon")).removeClass(a),$(t.find(".b-icon")).addClass(s),t.attr("title","open menu"),t.find(".b-js-icon-text").text("open menu")}},{key:"_setButtonClosedState",value:function(t){$(t.find(".b-icon")).removeClass(s),$(t.find(".b-icon")).addClass(a),t.attr("title","close menu"),t.find(".b-js-icon-text").text("close menu")}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new u(t,e)}}]);var f=u;return u=i({breakpoint:"SMALL_DESKTOP_UP",activatedState:"b-jumbotron-navigation--show",targetNav:".b-js-jumbotron-nav-target",selectorMenuContent:".b-js-jumbotron-nav-content",templateSelectors:{nav:".b-js-jumbotron-nav-template"}})(u)||u}(),t("JumbotronNavigation",u)}}}),$__System.register("components/constants/constants.js",[],function(t){"use strict";return{setters:[],execute:function(){t("Constants",{ANIMATION_DURATION_NORMAL:400,SPINNER_SELECTOR:".b-js-spinner",LOAD_DATA_FAIL_HTML:'<div class="alert alert-danger" role="alert">There was an error getting data, please try again later</div>',GLOBAL_NAVIGATION_CLASS:".globalHeaderModule",ANCHOR_SCROLL_TARGET_DEFAULT_OFFSET:10,ANCHOR_SCROLL_START_DELAY:800,ANCHOR_SCROLL_WITHOUT_DELAY:0,SECTION_MAX_WIDTH:1020,MOBILE_LANDSCAPE_DOWN:479,MOBILE_LANDSCAPE_UP:480,TABLET_DOWN:767,TABLET_UP:768,SMALL_DESKTOP_DOWN:991,SMALL_DESKTOP_UP:992,LARGE_DESKTOP_DOWN:1199,LARGE_DESKTOP_UP:1200,HIDDEN_FIXED:"b-hidden--fixed",HIDDEN_OPACITY:"b-hidden--opacity"})}}}),$__System.register("components/remove-main-secondary-navigation/remove-main-secondary-navigation.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js","components/constants/constants.js","helpers/helpers.js"],function(t){"use strict";var e,n,i,r,o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){t.default},function(t){e=t.default},function(t){n=t.default},function(t){i=t.configurable},function(t){t.Constants},function(t){t.Helpers}],execute:function(){r=function(t){function r(t,e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),s(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,t,e),window.setTimeout(function(){n._removeMainNavigationDropdown()}.bind(this),500)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,e),o(r,[{key:"_removeMainNavigationDropdown",value:function(){n(this.config.mainNavDropdown,n(this.config.mainNavContainer,this.$el)).remove()}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new r(t,e)}}]);var a=r;return r=i({mainNavContainer:'nav[aria-label="Main menu"]',navItemHolder:".navItem",mainNavDropdown:".mainNavDropdown"})(r)||r}(),t("RemoveMainSecondaryNavigation",r)}}}),$__System.register("components/dynamic-left-side-navigation/dynamic-left-side-navigation.js",["npm:lodash@4.17.4.js","lib/component.js","lib/grab.js","lib/config.js"],function(t){"use strict";var e,n,i,r,o,s,a,u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),l=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.configurable}],execute:function(){o='\n <ul role="menubar" class="signposts">\n <li class="signpost">\n <a role="menuitem" href="{{homePageUrl}}" class="signpostLabel">{{homePageName}}</a>\n \n \x3c!--/* Menu list holder */--\x3e\n <ul role="menubar" class="menu">{{itemHolder}}</ul>\n </li>\n </ul>\n ',s='\n <li class="hasChildren menuItem" role="presentation">\n <a role="menuitem" href="{{link}}" class="menuItemLabel">\n {{text}}\n </a>\n </li>\n ',a=function(t){function a(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),l(Object.getPrototypeOf(c.prototype),"constructor",this).call(this,t,e),this._loadCustomNavs(),this._replacePageLoadedSideMenu(this._createLeftSideMenu(this._generateListData(this._getGlobalHeaderList())))}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(a,n),u(a,[{key:"_getGlobalHeaderList",value:function(){var t=this.config.mainNavItem;return e.map($(i(this.config.mainNavContainer,this.$el)).find(this.config.mainNavItemHolder),function(e){return $($(e).find(t)[0])})}},{key:"_loadCustomNavs",value:function(){var t,e=this;if(null!==this.config.customNavs){var n=(t=[],e.config.customNavs.replace(/\[(.+?)\]\((.+?)\)/g,function(e,n,i){t.push({text:n,link:i})}),{v:t});if("object"==typeof n)return n.v}return null}},{key:"_generateListData",value:function(t){return e.concat(e.map(t,function(t){return{link:$(t).attr("href"),text:$(t).text()}}),this._loadCustomNavs()||[])}},{key:"_createLeftSideMenu",value:function(t){return o.replace("{{homePageUrl}}",this.config.homePageUrl).replace("{{homePageName}}",this.config.homePageName).replace("{{itemHolder}}",e.map(t,function(t){return s.replace("{{link}}",t.link).replace("{{text}}",t.text)}).join(""))}},{key:"_replacePageLoadedSideMenu",value:function(t){i(this.config.leftSideNavContainer,this.$el).html(t)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new a(t,e)}}]);var c=a;return a=r({mainNavContainer:'nav[aria-label="Main menu"]',mainNavItemHolder:".navItem",mainNavItem:'a[role="menuitem"]',leftSideNavContainer:".leftHandNavigationModule",homePageUrl:"/home.html",homePageName:"Home",customNavs:null})(a)||a}(),t("DynamicLeftSideNavigation",a)}}}),function(){var t=$__System.amdDefine;!function(){"use strict";var e={};function n(t,e,n){for(var i=n.data,r=n.width,o=~~t.x,s=~~(t.x+t.width),a=~~t.y,u=~~(t.y+t.height),l=255*t.weight,c=a;c<u;c++)for(var f=o;f<s;f++){i[4*(c*r+f)+3]+=l}}function i(t,e,n){for(var i={detail:0,saturation:0,skin:0,boost:0,total:0},o=e.data,s=t.scoreDownSample,a=1/s,u=e.height*s,l=e.width*s,c=e.width,f=0;f<u;f+=s)for(var h=0;h<l;h+=s){var p=4*(~~(f*a)*c+~~(h*a)),d=r(t,n,h,f),m=o[p+1]/255;i.skin+=o[p]/255*(m+t.skinBias)*d,i.detail+=m*d,i.saturation+=o[p+2]/255*(m+t.saturationBias)*d,i.boost+=o[p+3]/255*d}return i.total=(i.detail*t.detailWeight+i.skin*t.skinWeight+i.saturation*t.saturationWeight+i.boost*t.boostWeight)/(n.width*n.height),i}function r(t,e,n,i){if(e.x>n||n>=e.x+e.width||e.y>i||i>=e.y+e.height)return t.outsideImportance;n=(n-e.x)/e.width,i=(i-e.y)/e.height;var r=2*h(.5-n),o=2*h(.5-i),s=Math.max(r-1+t.edgeRadius,0),a=Math.max(o-1+t.edgeRadius,0),u=(s*s+a*a)*t.edgeWeight,l=1.41-p(r*r+o*o);return t.ruleOfThirds&&(l+=1.2*Math.max(0,l+u+.5)*(m(r)+m(o))),l+u}function o(t,e,n,i){var r=p(e*e+n*n+i*i),o=e/r-t.skinColor[0],s=n/r-t.skinColor[1],a=i/r-t.skinColor[2];return 1-p(o*o+s*s+a*a)}function s(t,e,n){this.width=t,this.height=e,this.data=n?new Uint8ClampedArray(n):new Uint8ClampedArray(t*e*4)}function a(t,e){for(var n=t.data,i=t.width,r=Math.floor(t.width/e),o=Math.floor(t.height/e),a=new s(r,o),u=a.data,l=1/(e*e),c=0;c<o;c++)for(var f=0;f<r;f++){for(var h=4*(c*r+f),p=0,d=0,m=0,v=0,g=0,y=0,_=0,b=0;b<e;b++)for(var w=0;w<e;w++){var k=4*((c*e+b)*i+(f*e+w));p+=n[k],d+=n[k+1],m+=n[k+2],v+=n[k+3],g=Math.max(g,n[k]),y=Math.max(y,n[k+1]),_=Math.max(_,n[k+2])}u[h]=p*l*.5+.5*g,u[h+1]=d*l*.7+.3*y,u[h+2]=m*l,u[h+3]=v*l}return a}function u(t,e){var n=document.createElement("canvas");return n.width=t,n.height=e,n}function l(t){return{open:function(n){var i=n.naturalWidth||n.width,r=n.naturalHeight||n.height,o=t(i,r),s=o.getContext("2d");return!n.naturalWidth||n.naturalWidth==n.width&&n.naturalHeight==n.height?(o.width=n.width,o.height=n.height):(o.width=n.naturalWidth,o.height=n.naturalHeight),s.drawImage(n,0,0),e.Promise.resolve(o)},resample:function(n,i,r){return Promise.resolve(n).then(function(n){var o=t(~~i,~~r);return o.getContext("2d").drawImage(n,0,0,n.width,n.height,0,0,o.width,o.height),e.Promise.resolve(o)})},getData:function(t){return Promise.resolve(t).then(function(t){var e=t.getContext("2d").getImageData(0,0,t.width,t.height);return new s(t.width,t.height,e.data)})}}}e.Promise="undefined"!=typeof Promise?Promise:function(){throw new Error("No native promises and smartcrop.Promise not set.")},e.DEFAULTS={width:0,height:0,aspect:0,cropWidth:0,cropHeight:0,detailWeight:.2,skinColor:[.78,.57,.44],skinBias:.01,skinBrightnessMin:.2,skinBrightnessMax:1,skinThreshold:.8,skinWeight:1.8,saturationBrightnessMin:.05,saturationBrightnessMax:.9,saturationThreshold:.4,saturationBias:.2,saturationWeight:.3,scoreDownSample:8,step:8,scaleStep:.1,minScale:1,maxScale:1,edgeRadius:.4,edgeWeight:-20,outsideImportance:-.5,boostWeight:100,ruleOfThirds:!0,prescale:!0,imageOperations:null,canvasFactory:u,debug:!1},e.crop=function(t,r,u){var h=d({},e.DEFAULTS,r);h.aspect&&(h.width=h.aspect,h.height=1),null===h.imageOperations&&(h.imageOperations=l(h.canvasFactory));var p=h.imageOperations,m=1,_=1;return p.open(t,h.input).then(function(t){return h.width&&h.height&&(m=c(t.width/h.width,t.height/h.height),h.cropWidth=~~(h.width*m),h.cropHeight=~~(h.height*m),h.minScale=c(h.maxScale,f(1/m,h.minScale)),!1!==h.prescale&&((_=1/m/h.minScale)<1?(t=p.resample(t,t.width*_,t.height*_),h.cropWidth=~~(h.cropWidth*_),h.cropHeight=~~(h.cropHeight*_),h.boost&&(h.boost=h.boost.map(function(t){return{x:~~(t.x*_),y:~~(t.y*_),width:~~(t.width*_),height:~~(t.height*_),weight:t.weight}}))):_=1)),t}).then(function(t){return p.getData(t).then(function(t){for(var e=function(t,e){var r={},u=new s(e.width,e.height);(function(t,e){for(var n=t.data,i=e.data,r=t.width,o=t.height,s=0;s<o;s++)for(var a=0;a<r;a++){var u,l=4*(s*r+a);u=0===a||a>=r-1||0===s||s>=o-1?g(n,l):4*g(n,l)-g(n,l-4*r)-g(n,l-4)-g(n,l+4)-g(n,l+4*r),i[l+1]=u}})(e,u),function(t,e,n){for(var i=e.data,r=n.data,s=e.width,a=e.height,u=0;u<a;u++)for(var l=0;l<s;l++){var c=4*(u*s+l),f=v(i[c],i[c+1],i[c+2])/255,h=o(t,i[c],i[c+1],i[c+2]),p=h>t.skinThreshold,d=f>=t.skinBrightnessMin&&f<=t.skinBrightnessMax;r[c]=p&&d?(h-t.skinThreshold)*(255/(1-t.skinThreshold)):0}}(t,e,u),function(t,e,n){for(var i=e.data,r=n.data,o=e.width,s=e.height,a=0;a<s;a++)for(var u=0;u<o;u++){var l=4*(a*o+u),c=v(i[l],i[l+1],i[l+2])/255,f=y(i[l],i[l+1],i[l+2]),h=(t.saturationThreshold,c>=t.saturationBrightnessMin&&c<=t.saturationBrightnessMax);r[l+2]=h&&h?(f-t.saturationThreshold)*(255/(1-t.saturationThreshold)):0}}(t,e,u),function(t,e){if(!t.boost)return;for(var i=e.data,r=0;r<e.width;r+=4)i[r+3]=0;for(r=0;r<t.boost.length;r++)n(t.boost[r],t,e)}(t,u);for(var l=a(u,t.scoreDownSample),f=-1/0,h=null,p=function(t,e,n){for(var i=[],r=c(e,n),o=t.cropWidth||r,s=t.cropHeight||r,a=t.maxScale;a>=t.minScale;a-=t.scaleStep)for(var u=0;u+s*a<=n;u+=t.step)for(var l=0;l+o*a<=e;l+=t.step)i.push({x:l,y:u,width:o*a,height:s*a});return i}(t,e.width,e.height),m=0,_=p.length;m<_;m++){var b=p[m];b.score=i(t,l,b),b.score.total>f&&(h=b,f=b.score.total)}r.topCrop=h,t.debug&&h&&(r.crops=p,r.debugOutput=u,r.debugOptions=t,r.debugTopCrop=d({},r.topCrop));return r}(h,t),r=e.crops||[e.topCrop],l=0,f=r.length;l<f;l++){var p=r[l];p.x=~~(p.x/_),p.y=~~(p.y/_),p.width=~~(p.width/_),p.height=~~(p.height/_)}return u&&u(e),e})})},e.isAvailable=function(t){if(!e.Promise)return!1;if((t?t.canvasFactory:u)===u&&!document.createElement("canvas").getContext("2d"))return!1;return!0},e.importance=r,e.ImgData=s,e._downSample=a,e._canvasImageOperations=l;var c=Math.min,f=Math.max,h=Math.abs,p=(Math.ceil,Math.sqrt);function d(t){for(var e=1,n=arguments.length;e<n;e++){var i=arguments[e];if(i)for(var r in i)t[r]=i[r]}return t}function m(t){return t=16*((t-1/3+1)%2*.5-.5),Math.max(1-t*t,0)}function v(t,e,n){return.5126*n+.7152*e+.0722*t}function g(t,e){return v(t[e],t[e+1],t[e+2])}function y(t,e,n){var i=f(t/255,e/255,n/255),r=c(t/255,e/255,n/255);if(i===r)return 0;var o=i-r;return(i+r)/2>.5?o/(2-i-r):o/(i+r)}void 0!==t&&t.amd&&t("github:jwagner/smartcrop.js@1.1.1/smartcrop.js",[],function(){return e}),void 0!==exports?exports.smartcrop=e:"undefined"!=typeof navigator&&(window.SmartCrop=window.smartcrop=e),void 0!==module&&(module.exports=e)}()}(),(0,$__System.amdDefine)("github:jwagner/smartcrop.js@1.1.1.js",["github:jwagner/smartcrop.js@1.1.1/smartcrop.js"],function(t){return t}),$__System.register("components/smartcrop/smartcrop.js",["lib/component.js","lib/grab.js","npm:lodash@4.17.4.js","lib/config.js","github:jwagner/smartcrop.js@1.1.1.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),c=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){e=t.default},function(t){t.default},function(t){t.default},function(t){n=t.configurable},function(t){i=t.default}],execute:function(){r="b-hidden--opacity",o="/AcademicProfiles/profile",s="http://api.profiles.sydney.edu.au",a={dev:"https://cws-dev.sydney.edu.au",train:"https://cws-train.sydney.edu.au",test:"https://cws-test.sydney.edu.au",prod:"https://sydney.edu.au"},u=function(t){function u(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),c(Object.getPrototypeOf(f.prototype),"constructor",this).call(this,t,e),this.redirectSite=a[this.config.env],this._centerImage=this._centerImage.bind(this),this._initialise()}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,e),l(u,[{key:"_initialise",value:function(){var t=this,e=this._getImageUrl();if(e){var n=new Image;n.src=e;try{i.crop(n,{width:this.config.cropWidth,height:this.config.cropHeight}).then(function(e){t._updateTargetImagePosition({x:e.topCrop.x,y:e.topCrop.y,width:n.naturalWidth||n.width,height:n.naturalHeight||n.height})}).catch(function(i){console.warn("smart crop image failed, so center the image: ",e,i),t._centerImage(n)})}catch(t){console.warn("smart crop image failed, so center the image: ",e,t),this._centerImage(n)}}}},{key:"_getImageUrl",value:function(){var t=this.$el.css("background-image").match(/\((.*?)\)/)[1].replace(/('|")/g,"");return t&&t.startsWith(""+s+o)?t=t.replace(s,this.redirectSite):t}},{key:"_centerImage",value:function(t){this._updateTargetImagePosition({x:(t.naturalWidth||t.width)/2,y:(t.naturalHeight||t.height)/2,width:t.naturalWidth,height:t.naturalHeight})}},{key:"_updateTargetImagePosition",value:function(t){var e=t.x/t.width*100+"%",n=t.y/t.height*100+"%";this.$el.css("background-position",e+" "+n),this.$el.removeClass(r)}},{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new u(t,e)}}]);var f=u;return u=n({cropWidth:110,cropHeight:110,env:"dev"})(u)||u}(),t("Smartcrop",u)}}}),$__System.registerDynamic("github:components/handlebars.js@4.0.5/handlebars.js",[],!1,function(t,e,n){var i=$__System.get("@@global-helpers").prepareGlobal(n.id,"Handlebars",null);return function(t){"format global";"exports Handlebars";var e,n;e=this,n=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,n),r.loaded=!0,r.exports}return n.m=t,n.c=e,n.p="",n(0)}([function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0;var r=i(n(2)),o=i(n(21)),s=n(22),a=n(27),u=i(n(28)),l=i(n(25)),c=i(n(20)),f=r.default.create;function h(){var t=f();return t.compile=function(e,n){return a.compile(e,n,t)},t.precompile=function(e,n){return a.precompile(e,n,t)},t.AST=o.default,t.Compiler=a.Compiler,t.JavaScriptCompiler=u.default,t.Parser=s.parser,t.parse=s.parse,t}var p=h();p.create=h,c.default(p),p.Visitor=l.default,p.default=p,e.default=p,t.exports=e.default},function(t,e){"use strict";e.default=function(t){return t&&t.__esModule?t:{default:t}},e.__esModule=!0},function(t,e,n){"use strict";var i=n(3).default,r=n(1).default;e.__esModule=!0;var o=i(n(4)),s=r(n(18)),a=r(n(6)),u=i(n(5)),l=i(n(19)),c=r(n(20));function f(){var t=new o.HandlebarsEnvironment;return u.extend(t,o),t.SafeString=s.default,t.Exception=a.default,t.Utils=u,t.escapeExpression=u.escapeExpression,t.VM=l,t.template=function(e){return l.template(e,t)},t}var h=f();h.create=f,c.default(h),h.default=h,e.default=h,t.exports=e.default},function(t,e){"use strict";e.default=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},e.__esModule=!0},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0,e.HandlebarsEnvironment=l;var r=n(5),o=i(n(6)),s=n(7),a=n(15),u=i(n(17));e.VERSION="4.0.5";e.COMPILER_REVISION=7;e.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0"};function l(t,e,n){this.helpers=t||{},this.partials=e||{},this.decorators=n||{},s.registerDefaultHelpers(this),a.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:u.default,log:u.default.log,registerHelper:function(t,e){if("[object Object]"===r.toString.call(t)){if(e)throw new o.default("Arg not supported with multiple helpers");r.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if("[object Object]"===r.toString.call(t))r.extend(this.partials,t);else{if(void 0===e)throw new o.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if("[object Object]"===r.toString.call(t)){if(e)throw new o.default("Arg not supported with multiple decorators");r.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]}};var c=u.default.log;e.log=c,e.createFrame=r.createFrame,e.logger=u.default},function(t,e){"use strict";e.__esModule=!0,e.extend=s,e.indexOf=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},e.escapeExpression=function(t){if("string"!=typeof t){if(t&&t.toHTML)return t.toHTML();if(null==t)return"";if(!t)return t+"";t=""+t}if(!r.test(t))return t;return t.replace(i,o)},e.isEmpty=function(t){return!t&&0!==t||!(!l(t)||0!==t.length)},e.createFrame=function(t){var e=s({},t);return e._parent=t,e},e.blockParams=function(t,e){return t.path=e,t},e.appendContextPath=function(t,e){return(t?t+".":"")+e};var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},i=/[&<>"'`=]/g,r=/[&<>"'`=]/;function o(t){return n[t]}function s(t){for(var e=1;e<arguments.length;e++)for(var n in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],n)&&(t[n]=arguments[e][n]);return t}var a=Object.prototype.toString;e.toString=a;var u=function(t){return"function"==typeof t};u(/x/)&&(e.isFunction=u=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)}),e.isFunction=u;var l=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===a.call(t)};e.isArray=l},function(t,e){"use strict";e.__esModule=!0;var n=["description","fileName","lineNumber","message","name","number","stack"];function i(t,e){var r=e&&e.loc,o=void 0,s=void 0;r&&(t+=" - "+(o=r.start.line)+":"+(s=r.start.column));for(var a=Error.prototype.constructor.call(this,t),u=0;u<n.length;u++)this[n[u]]=a[n[u]];Error.captureStackTrace&&Error.captureStackTrace(this,i),r&&(this.lineNumber=o,this.column=s)}i.prototype=new Error,e.default=i,t.exports=e.default},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0,e.registerDefaultHelpers=function(t){r.default(t),o.default(t),s.default(t),a.default(t),u.default(t),l.default(t),c.default(t)};var r=i(n(8)),o=i(n(9)),s=i(n(10)),a=i(n(11)),u=i(n(12)),l=i(n(13)),c=i(n(14))},function(t,e,n){"use strict";e.__esModule=!0;var i=n(5);e.default=function(t){t.registerHelper("blockHelperMissing",function(e,n){var r=n.inverse,o=n.fn;if(!0===e)return o(this);if(!1===e||null==e)return r(this);if(i.isArray(e))return e.length>0?(n.ids&&(n.ids=[n.name]),t.helpers.each(e,n)):r(this);if(n.data&&n.ids){var s=i.createFrame(n.data);s.contextPath=i.appendContextPath(n.data.contextPath,n.name),n={data:s}}return o(e,n)})},t.exports=e.default},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0;var r=n(5),o=i(n(6));e.default=function(t){t.registerHelper("each",function(t,e){if(!e)throw new o.default("Must pass iterator to #each");var n=e.fn,i=e.inverse,s=0,a="",u=void 0,l=void 0;function c(e,i,o){u&&(u.key=e,u.index=i,u.first=0===i,u.last=!!o,l&&(u.contextPath=l+e)),a+=n(t[e],{data:u,blockParams:r.blockParams([t[e],e],[l+e,null])})}if(e.data&&e.ids&&(l=r.appendContextPath(e.data.contextPath,e.ids[0])+"."),r.isFunction(t)&&(t=t.call(this)),e.data&&(u=r.createFrame(e.data)),t&&"object"==typeof t)if(r.isArray(t))for(var f=t.length;s<f;s++)s in t&&c(s,s,s===t.length-1);else{var h=void 0;for(var p in t)t.hasOwnProperty(p)&&(void 0!==h&&c(h,s-1),h=p,s++);void 0!==h&&c(h,s-1,!0)}return 0===s&&(a=i(this)),a})},t.exports=e.default},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0;var r=i(n(6));e.default=function(t){t.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new r.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var i=n(5);e.default=function(t){t.registerHelper("if",function(t,e){return i.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||i.isEmpty(t)?e.inverse(this):e.fn(this)}),t.registerHelper("unless",function(e,n){return t.helpers.if.call(this,e,{fn:n.inverse,inverse:n.fn,hash:n.hash})})},t.exports=e.default},function(t,e){"use strict";e.__esModule=!0,e.default=function(t){t.registerHelper("log",function(){for(var e=[void 0],n=arguments[arguments.length-1],i=0;i<arguments.length-1;i++)e.push(arguments[i]);var r=1;null!=n.hash.level?r=n.hash.level:n.data&&null!=n.data.level&&(r=n.data.level),e[0]=r,t.log.apply(t,e)})},t.exports=e.default},function(t,e){"use strict";e.__esModule=!0,e.default=function(t){t.registerHelper("lookup",function(t,e){return t&&t[e]})},t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var i=n(5);e.default=function(t){t.registerHelper("with",function(t,e){i.isFunction(t)&&(t=t.call(this));var n=e.fn;if(i.isEmpty(t))return e.inverse(this);var r=e.data;return e.data&&e.ids&&((r=i.createFrame(e.data)).contextPath=i.appendContextPath(e.data.contextPath,e.ids[0])),n(t,{data:r,blockParams:i.blockParams([t],[r&&r.contextPath])})})},t.exports=e.default},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0,e.registerDefaultDecorators=function(t){r.default(t)};var r=i(n(16))},function(t,e,n){"use strict";e.__esModule=!0;var i=n(5);e.default=function(t){t.registerDecorator("inline",function(t,e,n,r){var o=t;return e.partials||(e.partials={},o=function(r,o){var s=n.partials;n.partials=i.extend({},s,e.partials);var a=t(r,o);return n.partials=s,a}),e.partials[r.args[0]]=r.fn,o})},t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var i=n(5),r={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if("string"==typeof t){var e=i.indexOf(r.methodMap,t.toLowerCase());t=e>=0?e:parseInt(t,10)}return t},log:function(t){if(t=r.lookupLevel(t),"undefined"!=typeof console&&r.lookupLevel(r.level)<=t){var e=r.methodMap[t];console[e]||(e="log");for(var n=arguments.length,i=Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];console[e].apply(console,i)}}};e.default=r,t.exports=e.default},function(t,e){"use strict";function n(t){this.string=t}e.__esModule=!0,n.prototype.toString=n.prototype.toHTML=function(){return""+this.string},e.default=n,t.exports=e.default},function(t,e,n){"use strict";var i=n(3).default,r=n(1).default;e.__esModule=!0,e.checkRevision=function(t){var e=t&&t[0]||1,n=a.COMPILER_REVISION;if(e!==n){if(e<n){var i=a.REVISION_CHANGES[n],r=a.REVISION_CHANGES[e];throw new s.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+i+") or downgrade your runtime to an older version ("+r+").")}throw new s.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")}},e.template=function(t,e){if(!e)throw new s.default("No environment passed to template");if(!t||!t.main)throw new s.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var n={strict:function(t,e){if(!(e in t))throw new s.default('"'+e+'" not defined in '+t);return t[e]},lookup:function(t,e){for(var n=t.length,i=0;i<n;i++)if(t[i]&&null!=t[i][e])return t[i][e]},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:o.escapeExpression,invokePartial:function(n,i,r){r.hash&&(i=o.extend({},i,r.hash),r.ids&&(r.ids[0]=!0));n=e.VM.resolvePartial.call(this,n,i,r);var a=e.VM.invokePartial.call(this,n,i,r);null==a&&e.compile&&(r.partials[r.name]=e.compile(n,t.compilerOptions,e),a=r.partials[r.name](i,r));if(null!=a){if(r.indent){for(var u=a.split("\n"),l=0,c=u.length;l<c&&(u[l]||l+1!==c);l++)u[l]=r.indent+u[l];a=u.join("\n")}return a}throw new s.default("The partial "+r.name+" could not be compiled when running in runtime-only mode")},fn:function(e){var n=t[e];return n.decorator=t[e+"_d"],n},programs:[],program:function(t,e,n,i,r){var o=this.programs[t],s=this.fn(t);return e||r||i||n?o=u(this,t,s,e,n,i,r):o||(o=this.programs[t]=u(this,t,s)),o},data:function(t,e){for(;t&&e--;)t=t._parent;return t},merge:function(t,e){var n=t||e;return t&&e&&t!==e&&(n=o.extend({},e,t)),n},noop:e.VM.noop,compilerInfo:t.compiler};function i(e){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=r.data;i._setup(r),!r.partial&&t.useData&&(o=function(t,e){e&&"root"in e||((e=e?a.createFrame(e):{}).root=t);return e}(e,o));var s=void 0,u=t.useBlockParams?[]:void 0;function l(e){return""+t.main(n,e,n.helpers,n.partials,o,u,s)}return t.useDepths&&(s=r.depths?e!==r.depths[0]?[e].concat(r.depths):r.depths:[e]),(l=c(t.main,l,n,r.depths||[],o,u))(e,r)}return i.isTop=!0,i._setup=function(i){i.partial?(n.helpers=i.helpers,n.partials=i.partials,n.decorators=i.decorators):(n.helpers=n.merge(i.helpers,e.helpers),t.usePartial&&(n.partials=n.merge(i.partials,e.partials)),(t.usePartial||t.useDecorators)&&(n.decorators=n.merge(i.decorators,e.decorators)))},i._child=function(e,i,r,o){if(t.useBlockParams&&!r)throw new s.default("must pass block params");if(t.useDepths&&!o)throw new s.default("must pass parent depths");return u(n,e,t[e],i,0,r,o)},i},e.wrapProgram=u,e.resolvePartial=function(t,e,n){t?t.call||n.name||(n.name=t,t=n.partials[t]):t="@partial-block"===n.name?n.data["partial-block"]:n.partials[n.name];return t},e.invokePartial=function(t,e,n){n.partial=!0,n.ids&&(n.data.contextPath=n.ids[0]||n.data.contextPath);var i=void 0;n.fn&&n.fn!==l&&(n.data=a.createFrame(n.data),(i=n.data["partial-block"]=n.fn).partials&&(n.partials=o.extend({},n.partials,i.partials)));void 0===t&&i&&(t=i);if(void 0===t)throw new s.default("The partial "+n.name+" could not be found");if(t instanceof Function)return t(e,n)},e.noop=l;var o=i(n(5)),s=r(n(6)),a=n(4);function u(t,e,n,i,r,o,s){function a(e){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],a=s;return s&&e!==s[0]&&(a=[e].concat(s)),n(t,e,t.helpers,t.partials,r.data||i,o&&[r.blockParams].concat(o),a)}return(a=c(n,a,t,s,i,o)).program=e,a.depth=s?s.length:0,a.blockParams=r||0,a}function l(){return""}function c(t,e,n,i,r,s){if(t.decorator){var a={};e=t.decorator(e,a,n,i&&i[0],r,s,i),o.extend(e,a)}return e}},function(t,e){(function(n){"use strict";e.__esModule=!0,e.default=function(t){var e=void 0!==n?n:window,i=e.Handlebars;t.noConflict=function(){return e.Handlebars===t&&(e.Handlebars=i),t}},t.exports=e.default}).call(e,function(){return this}())},function(t,e){"use strict";e.__esModule=!0;var n={helpers:{helperExpression:function(t){return"SubExpression"===t.type||("MustacheStatement"===t.type||"BlockStatement"===t.type)&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return 1===t.parts.length&&!n.helpers.scopedId(t)&&!t.depth}}};e.default=n,t.exports=e.default},function(t,e,n){"use strict";var i=n(1).default,r=n(3).default;e.__esModule=!0,e.parse=function(t,e){if("Program"===t.type)return t;return o.default.yy=l,l.locInfo=function(t){return new l.SourceLocation(e&&e.srcName,t)},new s.default(e).accept(o.default.parse(t))};var o=i(n(23)),s=i(n(24)),a=r(n(26)),u=n(5);e.parser=o.default;var l={};u.extend(l,a)},function(t,e){"use strict";var n=function(){var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition_plus0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,1],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(t,e,n,i,r,o,s){var a=o.length-1;switch(r){case 1:return o[a-1];case 2:this.$=i.prepareProgram(o[a]);break;case 3:case 4:case 5:case 6:case 7:case 8:this.$=o[a];break;case 9:this.$={type:"CommentStatement",value:i.stripComment(o[a]),strip:i.stripFlags(o[a],o[a]),loc:i.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:o[a],value:o[a],loc:i.locInfo(this._$)};break;case 11:this.$=i.prepareRawBlock(o[a-2],o[a-1],o[a],this._$);break;case 12:this.$={path:o[a-3],params:o[a-2],hash:o[a-1]};break;case 13:this.$=i.prepareBlock(o[a-3],o[a-2],o[a-1],o[a],!1,this._$);break;case 14:this.$=i.prepareBlock(o[a-3],o[a-2],o[a-1],o[a],!0,this._$);break;case 15:this.$={open:o[a-5],path:o[a-4],params:o[a-3],hash:o[a-2],blockParams:o[a-1],strip:i.stripFlags(o[a-5],o[a])};break;case 16:case 17:this.$={path:o[a-4],params:o[a-3],hash:o[a-2],blockParams:o[a-1],strip:i.stripFlags(o[a-5],o[a])};break;case 18:this.$={strip:i.stripFlags(o[a-1],o[a-1]),program:o[a]};break;case 19:var u=i.prepareBlock(o[a-2],o[a-1],o[a],o[a],!1,this._$),l=i.prepareProgram([u],o[a-1].loc);l.chained=!0,this.$={strip:o[a-2].strip,program:l,chain:!0};break;case 20:this.$=o[a];break;case 21:this.$={path:o[a-1],strip:i.stripFlags(o[a-2],o[a])};break;case 22:case 23:this.$=i.prepareMustache(o[a-3],o[a-2],o[a-1],o[a-4],i.stripFlags(o[a-4],o[a]),this._$);break;case 24:this.$={type:"PartialStatement",name:o[a-3],params:o[a-2],hash:o[a-1],indent:"",strip:i.stripFlags(o[a-4],o[a]),loc:i.locInfo(this._$)};break;case 25:this.$=i.preparePartialBlock(o[a-2],o[a-1],o[a],this._$);break;case 26:this.$={path:o[a-3],params:o[a-2],hash:o[a-1],strip:i.stripFlags(o[a-4],o[a])};break;case 27:case 28:this.$=o[a];break;case 29:this.$={type:"SubExpression",path:o[a-3],params:o[a-2],hash:o[a-1],loc:i.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:o[a],loc:i.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:i.id(o[a-2]),value:o[a],loc:i.locInfo(this._$)};break;case 32:this.$=i.id(o[a-1]);break;case 33:case 34:this.$=o[a];break;case 35:this.$={type:"StringLiteral",value:o[a],original:o[a],loc:i.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(o[a]),original:Number(o[a]),loc:i.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===o[a],original:"true"===o[a],loc:i.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:i.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:i.locInfo(this._$)};break;case 40:case 41:this.$=o[a];break;case 42:this.$=i.preparePath(!0,o[a],this._$);break;case 43:this.$=i.preparePath(!1,o[a],this._$);break;case 44:o[a-2].push({part:i.id(o[a]),original:o[a],separator:o[a-1]}),this.$=o[a-2];break;case 45:this.$=[{part:i.id(o[a]),original:o[a]}];break;case 46:this.$=[];break;case 47:o[a-1].push(o[a]);break;case 48:this.$=[o[a]];break;case 49:o[a-1].push(o[a]);break;case 50:this.$=[];break;case 51:o[a-1].push(o[a]);break;case 58:this.$=[];break;case 59:o[a-1].push(o[a]);break;case 64:this.$=[];break;case 65:o[a-1].push(o[a]);break;case 70:this.$=[];break;case 71:o[a-1].push(o[a]);break;case 78:this.$=[];break;case 79:o[a-1].push(o[a]);break;case 82:this.$=[];break;case 83:o[a-1].push(o[a]);break;case 86:this.$=[];break;case 87:o[a-1].push(o[a]);break;case 90:this.$=[];break;case 91:o[a-1].push(o[a]);break;case 94:this.$=[];break;case 95:o[a-1].push(o[a]);break;case 98:this.$=[o[a]];break;case 99:o[a-1].push(o[a]);break;case 100:this.$=[o[a]];break;case 101:o[a-1].push(o[a])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{13:40,15:[1,20],17:39},{20:42,56:41,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:45,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:48,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:42,56:49,64:43,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:50,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,51]},{72:[1,35],86:52},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:53,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:54,38:56,39:[1,58],43:57,44:[1,59],45:55,47:[2,54]},{28:60,43:61,44:[1,59],47:[2,56]},{13:63,15:[1,20],18:[1,62]},{15:[2,48],18:[2,48]},{33:[2,86],57:64,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:65,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:66,47:[1,67]},{30:68,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:69,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:70,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:71,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:75,33:[2,80],50:72,63:73,64:76,65:[1,44],69:74,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,80]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,51]},{20:75,53:81,54:[2,84],63:82,64:76,65:[1,44],69:83,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:84,47:[1,67]},{47:[2,55]},{4:85,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:86,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:87,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:88,47:[1,67]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:75,33:[2,88],58:89,63:90,64:76,65:[1,44],69:91,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:92,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:93,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,31:94,33:[2,60],63:95,64:76,65:[1,44],69:96,70:77,71:78,72:[1,79],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,66],36:97,63:98,64:76,65:[1,44],69:99,70:77,71:78,72:[1,79],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,22:100,23:[2,52],63:101,64:76,65:[1,44],69:102,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:75,33:[2,92],62:103,63:104,64:76,65:[1,44],69:105,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,106]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:107,72:[1,108],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,109],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,110]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:56,39:[1,58],43:57,44:[1,59],45:112,46:111,47:[2,76]},{33:[2,70],40:113,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,114]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:75,63:116,64:76,65:[1,44],67:115,68:[2,96],69:117,70:77,71:78,72:[1,79],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,118]},{32:119,33:[2,62],74:120,75:[1,121]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:122,74:123,75:[1,121]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,124]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,125]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,109]},{20:75,63:126,64:76,65:[1,44],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:75,33:[2,72],41:127,63:128,64:76,65:[1,44],69:129,70:77,71:78,72:[1,79],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,130]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,131]},{33:[2,63]},{72:[1,133],76:132},{33:[1,134]},{33:[2,69]},{15:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:135,74:136,75:[1,121]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,138],77:[1,137]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,139]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],55:[2,55],57:[2,20],61:[2,57],74:[2,81],83:[2,85],87:[2,18],91:[2,89],102:[2,53],105:[2,93],111:[2,19],112:[2,77],117:[2,97],120:[2,63],123:[2,69],124:[2,12],136:[2,75],137:[2,32]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,n=[0],i=[null],r=[],o=this.table,s="",a=0,u=0,l=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var c=this.lexer.yylloc;r.push(c);var f=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var h,p,d,m,v,g,y,_,b,w,k={};;){if(d=n[n.length-1],this.defaultActions[d]?m=this.defaultActions[d]:(null!==h&&void 0!==h||(w=void 0,"number"!=typeof(w=e.lexer.lex()||1)&&(w=e.symbols_[w]||w),h=w),m=o[d]&&o[d][h]),void 0===m||!m.length||!m[0]){var S="";if(!l){for(g in b=[],o[d])this.terminals_[g]&&g>2&&b.push("'"+this.terminals_[g]+"'");S=this.lexer.showPosition?"Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[h]||h)+"'":"Parse error on line "+(a+1)+": Unexpected "+(1==h?"end of input":"'"+(this.terminals_[h]||h)+"'"),this.parseError(S,{text:this.lexer.match,token:this.terminals_[h]||h,line:this.lexer.yylineno,loc:c,expected:b})}}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+d+", token: "+h);switch(m[0]){case 1:n.push(h),i.push(this.lexer.yytext),r.push(this.lexer.yylloc),n.push(m[1]),h=null,p?(h=p,p=null):(u=this.lexer.yyleng,s=this.lexer.yytext,a=this.lexer.yylineno,c=this.lexer.yylloc,l>0&&l--);break;case 2:if(y=this.productions_[m[1]][1],k.$=i[i.length-y],k._$={first_line:r[r.length-(y||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(y||1)].first_column,last_column:r[r.length-1].last_column},f&&(k._$.range=[r[r.length-(y||1)].range[0],r[r.length-1].range[1]]),void 0!==(v=this.performAction.call(k,s,u,a,this.yy,m[1],i,r)))return v;y&&(n=n.slice(0,-1*y*2),i=i.slice(0,-1*y),r=r.slice(0,-1*y)),n.push(this.productions_[m[1]][0]),i.push(k.$),r.push(k._$),_=o[n[n.length-2]][n[n.length-1]],n.push(_);break;case 3:return!0}}return!0}},e=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,n,i,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),s=0;s<o.length&&(!(n=this._input.match(this.rules[o[s]]))||e&&!(n[0].length>e[0].length)||(e=n,i=s,this.options.flex));s++);return e?((r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,o[i],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,n,i){function r(t,n){return e.yytext=e.yytext.substr(t,e.yyleng-n)}switch(n){case 0:if("\\\\"===e.yytext.slice(-2)?(r(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(r(0,1),this.begin("emu")):this.begin("mu"),e.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(e.yytext=e.yytext.substr(5,e.yyleng-9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(e.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return e.yytext=r(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=r(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return e.yytext=e.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return t}();function n(){this.yy={}}return t.lexer=e,n.prototype=t,t.Parser=n,new n}();e.__esModule=!0,e.default=n},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0;var r=i(n(25));function o(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=t}function s(t,e,n){void 0===e&&(e=t.length);var i=t[e-1],r=t[e-2];return i?"ContentStatement"===i.type?(r||!n?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(i.original):void 0:n}function a(t,e,n){void 0===e&&(e=-1);var i=t[e+1],r=t[e+2];return i?"ContentStatement"===i.type?(r||!n?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(i.original):void 0:n}function u(t,e,n){var i=t[null==e?0:e+1];if(i&&"ContentStatement"===i.type&&(n||!i.rightStripped)){var r=i.value;i.value=i.value.replace(n?/^\s+/:/^[ \t]*\r?\n?/,""),i.rightStripped=i.value!==r}}function l(t,e,n){var i=t[null==e?t.length-1:e-1];if(i&&"ContentStatement"===i.type&&(n||!i.leftStripped)){var r=i.value;return i.value=i.value.replace(n?/\s+$/:/[ \t]+$/,""),i.leftStripped=i.value!==r,i.leftStripped}}o.prototype=new r.default,o.prototype.Program=function(t){var e=!this.options.ignoreStandalone,n=!this.isRootSeen;this.isRootSeen=!0;for(var i=t.body,r=0,o=i.length;r<o;r++){var c=i[r],f=this.accept(c);if(f){var h=s(i,r,n),p=a(i,r,n),d=f.openStandalone&&h,m=f.closeStandalone&&p,v=f.inlineStandalone&&h&&p;f.close&&u(i,r,!0),f.open&&l(i,r,!0),e&&v&&(u(i,r),l(i,r)&&"PartialStatement"===c.type&&(c.indent=/([ \t]+$)/.exec(i[r-1].original)[1])),e&&d&&(u((c.program||c.inverse).body),l(i,r)),e&&m&&(u(i,r),l((c.inverse||c.program).body))}}return t},o.prototype.BlockStatement=o.prototype.DecoratorBlock=o.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,n=t.program&&t.inverse,i=n,r=n;if(n&&n.chained)for(i=n.body[0].program;r.chained;)r=r.body[r.body.length-1].program;var o={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:a(e.body),closeStandalone:s((i||e).body)};if(t.openStrip.close&&u(e.body,null,!0),n){var c=t.inverseStrip;c.open&&l(e.body,null,!0),c.close&&u(i.body,null,!0),t.closeStrip.open&&l(r.body,null,!0),!this.options.ignoreStandalone&&s(e.body)&&a(i.body)&&(l(e.body),u(i.body))}else t.closeStrip.open&&l(e.body,null,!0);return o},o.prototype.Decorator=o.prototype.MustacheStatement=function(t){return t.strip},o.prototype.PartialStatement=o.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}},e.default=o,t.exports=e.default},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0;var r=i(n(6));function o(){this.parents=[]}function s(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function a(t){s.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function u(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}o.prototype={constructor:o,mutating:!1,acceptKey:function(t,e){var n=this.accept(t[e]);if(this.mutating){if(n&&!o.prototype[n.type])throw new r.default('Unexpected node type "'+n.type+'" found when accepting '+e+" on "+t.type);t[e]=n}},acceptRequired:function(t,e){if(this.acceptKey(t,e),!t[e])throw new r.default(t.type+" requires "+e)},acceptArray:function(t){for(var e=0,n=t.length;e<n;e++)this.acceptKey(t,e),t[e]||(t.splice(e,1),e--,n--)},accept:function(t){if(t){if(!this[t.type])throw new r.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var e=this[t.type](t);return this.current=this.parents.shift(),!this.mutating||e?e:!1!==e?t:void 0}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:s,Decorator:s,BlockStatement:a,DecoratorBlock:a,PartialStatement:u,PartialBlockStatement:function(t){u.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:s,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}},e.default=o,t.exports=e.default},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0,e.SourceLocation=function(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}},e.id=function(t){return/^\[.*\]$/.test(t)?t.substr(1,t.length-2):t},e.stripFlags=function(t,e){return{open:"~"===t.charAt(2),close:"~"===e.charAt(e.length-3)}},e.stripComment=function(t){return t.replace(/^\{\{~?\!-?-?/,"").replace(/-?-?~?\}\}$/,"")},e.preparePath=function(t,e,n){n=this.locInfo(n);for(var i=t?"@":"",o=[],s=0,a=0,u=e.length;a<u;a++){var l=e[a].part,c=e[a].original!==l;if(i+=(e[a].separator||"")+l,c||".."!==l&&"."!==l&&"this"!==l)o.push(l);else{if(o.length>0)throw new r.default("Invalid path: "+i,{loc:n});".."===l&&(s++,"../")}}return{type:"PathExpression",data:t,depth:s,parts:o,original:i,loc:n}},e.prepareMustache=function(t,e,n,i,r,o){var s=i.charAt(3)||i.charAt(2),a="{"!==s&&"&"!==s;return{type:/\*/.test(i)?"Decorator":"MustacheStatement",path:t,params:e,hash:n,escaped:a,strip:r,loc:this.locInfo(o)}},e.prepareRawBlock=function(t,e,n,i){o(t,n),i=this.locInfo(i);var r={type:"Program",body:e,strip:{},loc:i};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:r,openStrip:{},inverseStrip:{},closeStrip:{},loc:i}},e.prepareBlock=function(t,e,n,i,s,a){i&&i.path&&o(t,i);var u=/\*/.test(t.open);e.blockParams=t.blockParams;var l=void 0,c=void 0;if(n){if(u)throw new r.default("Unexpected inverse block on decorator",n);n.chain&&(n.program.body[0].closeStrip=i.strip),c=n.strip,l=n.program}s&&(s=l,l=e,e=s);return{type:u?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:l,openStrip:t.strip,inverseStrip:c,closeStrip:i&&i.strip,loc:this.locInfo(a)}},e.prepareProgram=function(t,e){if(!e&&t.length){var n=t[0].loc,i=t[t.length-1].loc;n&&i&&(e={source:n.source,start:{line:n.start.line,column:n.start.column},end:{line:i.end.line,column:i.end.column}})}return{type:"Program",body:t,strip:{},loc:e}},e.preparePartialBlock=function(t,e,n,i){return o(t,n),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:n&&n.strip,loc:this.locInfo(i)}};var r=i(n(6));function o(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var n={loc:t.path.loc};throw new r.default(t.path.original+" doesn't match "+e,n)}}},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0,e.Compiler=u,e.precompile=function(t,e,n){if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new r.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);"data"in(e=e||{})||(e.data=!0);e.compat&&(e.useDepths=!0);var i=n.parse(t,e),o=(new n.Compiler).compile(i,e);return(new n.JavaScriptCompiler).compile(o,e)},e.compile=function(t,e,n){void 0===e&&(e={});if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new r.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);"data"in e||(e.data=!0);e.compat&&(e.useDepths=!0);var i=void 0;function o(){var i=n.parse(t,e),r=(new n.Compiler).compile(i,e),o=(new n.JavaScriptCompiler).compile(r,e,void 0,!0);return n.template(o)}function s(t,e){return i||(i=o()),i.call(this,t,e)}return s._setup=function(t){return i||(i=o()),i._setup(t)},s._child=function(t,e,n,r){return i||(i=o()),i._child(t,e,n,r)},s};var r=i(n(6)),o=n(5),s=i(n(21)),a=[].slice;function u(){}function l(t,e){if(t===e)return!0;if(o.isArray(t)&&o.isArray(e)&&t.length===e.length){for(var n=0;n<t.length;n++)if(!l(t[n],e[n]))return!1;return!0}}function c(t){if(!t.path.parts){var e=t.path;t.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}u.prototype={compiler:u,equals:function(t){var e=this.opcodes.length;if(t.opcodes.length!==e)return!1;for(var n=0;n<e;n++){var i=this.opcodes[n],r=t.opcodes[n];if(i.opcode!==r.opcode||!l(i.args,r.args))return!1}e=this.children.length;for(n=0;n<e;n++)if(!this.children[n].equals(t.children[n]))return!1;return!0},guid:0,compile:function(t,e){this.sourceNode=[],this.opcodes=[],this.children=[],this.options=e,this.stringParams=e.stringParams,this.trackIds=e.trackIds,e.blockParams=e.blockParams||[];var n=e.knownHelpers;if(e.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},n)for(var i in n)i in n&&(e.knownHelpers[i]=n[i]);return this.accept(t)},compileProgram:function(t){var e=(new this.compiler).compile(t,this.options),n=this.guid++;return this.usePartial=this.usePartial||e.usePartial,this.children[n]=e,this.useDepths=this.useDepths||e.useDepths,n},accept:function(t){if(!this[t.type])throw new r.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var e=this[t.type](t);return this.sourceNode.shift(),e},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var e=t.body,n=e.length,i=0;i<n;i++)this.accept(e[i]);return this.options.blockParams.shift(),this.isSimple=1===n,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){c(t);var e=t.program,n=t.inverse;e=e&&this.compileProgram(e),n=n&&this.compileProgram(n);var i=this.classifySexpr(t);"helper"===i?this.helperSexpr(t,e,n):"simple"===i?(this.simpleSexpr(t),this.opcode("pushProgram",e),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,e,n),this.opcode("pushProgram",e),this.opcode("pushProgram",n),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var e=t.program&&this.compileProgram(t.program),n=this.setupFullMustacheParams(t,e,void 0),i=t.path;this.useDecorators=!0,this.opcode("registerDecorator",n.length,i.original)},PartialStatement:function(t){this.usePartial=!0;var e=t.program;e&&(e=this.compileProgram(t.program));var n=t.params;if(n.length>1)throw new r.default("Unsupported number of partial arguments: "+n.length,t);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var i=t.name.original,o="SubExpression"===t.name.type;o&&this.accept(t.name),this.setupFullMustacheParams(t,e,void 0,!0);var s=t.indent||"";this.options.preventIndent&&s&&(this.opcode("appendContent",s),s=""),this.opcode("invokePartial",o,i,s),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){c(t);var e=this.classifySexpr(t);"simple"===e?this.simpleSexpr(t):"helper"===e?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,e,n){var i=t.path,r=i.parts[0],o=null!=e||null!=n;this.opcode("getContext",i.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",n),i.strict=!0,this.accept(i),this.opcode("invokeAmbiguous",r,o)},simpleSexpr:function(t){var e=t.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,e,n){var i=this.setupFullMustacheParams(t,e,n),o=t.path,a=o.parts[0];if(this.options.knownHelpers[a])this.opcode("invokeKnownHelper",i.length,a);else{if(this.options.knownHelpersOnly)throw new r.default("You specified knownHelpersOnly, but used the unknown helper "+a,t);o.strict=!0,o.falsy=!0,this.accept(o),this.opcode("invokeHelper",i.length,o.original,s.default.helpers.simpleId(o))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var e=t.parts[0],n=s.default.helpers.scopedId(t),i=!t.depth&&!n&&this.blockParamIndex(e);i?this.opcode("lookupBlockParam",i,t.parts):e?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,n):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var e=t.pairs,n=0,i=e.length;for(this.opcode("pushHash");n<i;n++)this.pushParam(e[n].value);for(;n--;)this.opcode("assignToHash",e[n].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:a.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var e=s.default.helpers.simpleId(t.path),n=e&&!!this.blockParamIndex(t.path.parts[0]),i=!n&&s.default.helpers.helperExpression(t),r=!n&&(i||e);if(r&&!i){var o=t.path.parts[0],a=this.options;a.knownHelpers[o]?i=!0:a.knownHelpersOnly&&(r=!1)}return i?"helper":r?"ambiguous":"simple"},pushParams:function(t){for(var e=0,n=t.length;e<n;e++)this.pushParam(t[e])},pushParam:function(t){var e=null!=t.value?t.value:t.original||"";if(this.stringParams)e.replace&&(e=e.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",e,t.type),"SubExpression"===t.type&&this.accept(t);else{if(this.trackIds){var n=void 0;if(!t.parts||s.default.helpers.scopedId(t)||t.depth||(n=this.blockParamIndex(t.parts[0])),n){var i=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",n,i)}else(e=t.original||e).replace&&(e=e.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,e)}this.accept(t)}},setupFullMustacheParams:function(t,e,n,i){var r=t.params;return this.pushParams(r),this.opcode("pushProgram",e),this.opcode("pushProgram",n),t.hash?this.accept(t.hash):this.opcode("emptyHash",i),r},blockParamIndex:function(t){for(var e=0,n=this.options.blockParams.length;e<n;e++){var i=this.options.blockParams[e],r=i&&o.indexOf(i,t);if(i&&r>=0)return[e,r]}}}},function(t,e,n){"use strict";var i=n(1).default;e.__esModule=!0;var r=n(4),o=i(n(6)),s=n(5),a=i(n(29));function u(t){this.value=t}function l(){}l.prototype={nameLookup:function(t,e){return l.isValidJavaScriptVariableName(e)?[t,".",e]:[t,"[",JSON.stringify(e),"]"]},depthedLookup:function(t){return[this.aliasable("container.lookup"),'(depths, "',t,'")']},compilerInfo:function(){var t=r.COMPILER_REVISION;return[t,r.REVISION_CHANGES[t]]},appendToBuffer:function(t,e,n){return s.isArray(t)||(t=[t]),t=this.source.wrap(t,e),this.environment.isSimple?["return ",t,";"]:n?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function(){return this.quotedString("")},compile:function(t,e,n,i){this.environment=t,this.options=e,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!i,this.name=this.environment.name,this.isChild=!!n,this.context=n||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,e),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var r=t.opcodes,s=void 0,a=void 0,u=void 0,l=void 0;for(u=0,l=r.length;u<l;u++)s=r[u],this.source.currentLocation=s.loc,a=a||s.loc,this[s.opcode].apply(this,s.args);if(this.source.currentLocation=a,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new o.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),i?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var c=this.createFunctionContext(i);if(this.isChild)return c;var f={compiler:this.compilerInfo(),main:c};this.decorators&&(f.main_d=this.decorators,f.useDecorators=!0);var h=this.context,p=h.programs,d=h.decorators;for(u=0,l=p.length;u<l;u++)p[u]&&(f[u]=p[u],d[u]&&(f[u+"_d"]=d[u],f.useDecorators=!0));return this.environment.usePartial&&(f.usePartial=!0),this.options.data&&(f.useData=!0),this.useDepths&&(f.useDepths=!0),this.useBlockParams&&(f.useBlockParams=!0),this.options.compat&&(f.compat=!0),i?f.compilerOptions=this.options:(f.compiler=JSON.stringify(f.compiler),this.source.currentLocation={start:{line:1,column:0}},f=this.objectLiteral(f),e.srcName?(f=f.toStringWithSourceMap({file:e.destName})).map=f.map&&f.map.toString():f=f.toString()),f},preamble:function(){this.lastContext=0,this.source=new a.default(this.options.srcName),this.decorators=new a.default(this.options.srcName)},createFunctionContext:function(t){var e="",n=this.stackVars.concat(this.registers.list);n.length>0&&(e+=", "+n.join(", "));var i=0;for(var r in this.aliases){var o=this.aliases[r];this.aliases.hasOwnProperty(r)&&o.children&&o.referenceCount>1&&(e+=", alias"+ ++i+"="+r,o.children[0]="alias"+i)}var s=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&s.push("blockParams"),this.useDepths&&s.push("depths");var a=this.mergeSource(e);return t?(s.push(a),Function.apply(this,s)):this.source.wrap(["function(",s.join(","),") {\n ",a,"}"])},mergeSource:function(t){var e=this.environment.isSimple,n=!this.forceBuffer,i=void 0,r=void 0,o=void 0,s=void 0;return this.source.each(function(t){t.appendToBuffer?(o?t.prepend(" + "):o=t,s=t):(o&&(r?o.prepend("buffer += "):i=!0,s.add(";"),o=s=void 0),r=!0,e||(n=!1))}),n?o?(o.prepend("return "),s.add(";")):r||this.source.push('return "";'):(t+=", buffer = "+(i?"":this.initializeBuffer()),o?(o.prepend("return buffer + "),s.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(i?"":";\n")),this.source.merge()},blockValue:function(t){var e=this.aliasable("helpers.blockHelperMissing"),n=[this.contextName(0)];this.setupHelperArgs(t,0,n);var i=this.popStack();n.splice(1,0,i),this.push(this.source.functionCall(e,"call",n))},ambiguousBlockValue:function(){var t=this.aliasable("helpers.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var n=this.topStack();e.splice(1,0,n),this.pushSource(["if (!",this.lastHelper,") { ",n," = ",this.source.functionCall(t,"call",e),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack(function(t){return[" != null ? ",t,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,e,n,i){var r=0;i||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[r++])),this.resolvePath("context",t,r,e,n)},lookupBlockParam:function(t,e){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(t,e,n){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,n)},resolvePath:function(t,e,n,i,r){var o=this;if(this.options.strict||this.options.assumeObjects)this.push(function(t,e,n,i){var r=e.popStack(),o=0,s=n.length;t&&s--;for(;o<s;o++)r=e.nameLookup(r,n[o],i);return t?[e.aliasable("container.strict"),"(",r,", ",e.quotedString(n[o]),")"]:r}(this.options.strict&&r,this,e,t));else for(var s=e.length;n<s;n++)this.replaceStack(function(r){var s=o.nameLookup(r,e[n],t);return i?[" && ",s]:[" != null ? ",s," : ",r]})},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,e){this.pushContext(),this.pushString(e),"SubExpression"!==e&&("string"==typeof t?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:[],types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){null!=t?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,e){var n=this.nameLookup("decorators",e,"decorator"),i=this.setupHelperArgs(e,t);this.decorators.push(["fn = ",this.decorators.functionCall(n,"",["fn","props","container",i])," || fn;"])},invokeHelper:function(t,e,n){var i=this.popStack(),r=this.setupHelper(t,e),o=n?[r.name," || "]:"",s=["("].concat(o,i);this.options.strict||s.push(" || ",this.aliasable("helpers.helperMissing")),s.push(")"),this.push(this.source.functionCall(s,"call",r.callParams))},invokeKnownHelper:function(t,e){var n=this.setupHelper(t,e);this.push(this.source.functionCall(n.name,"call",n.callParams))},invokeAmbiguous:function(t,e){this.useRegister("helper");var n=this.popStack();this.emptyHash();var i=this.setupHelper(0,t,e),r=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",t,"helper")," || ",n,")"];this.options.strict||(r[0]="(helper = ",r.push(" != null ? helper : ",this.aliasable("helpers.helperMissing"))),this.push(["(",r,i.paramsInit?["),(",i.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",i.callParams)," : helper))"])},invokePartial:function(t,e,n){var i=[],r=this.setupParams(e,1,i);t&&(e=this.popStack(),delete r.name),n&&(r.indent=JSON.stringify(n)),r.helpers="helpers",r.partials="partials",r.decorators="container.decorators",t?i.unshift(e):i.unshift(this.nameLookup("partials",e,"partial")),this.options.compat&&(r.depths="depths"),r=this.objectLiteral(r),i.push(r),this.push(this.source.functionCall("container.invokePartial","",i))},assignToHash:function(t){var e=this.popStack(),n=void 0,i=void 0,r=void 0;this.trackIds&&(r=this.popStack()),this.stringParams&&(i=this.popStack(),n=this.popStack());var o=this.hash;n&&(o.contexts[t]=n),i&&(o.types[t]=i),r&&(o.ids[t]=r),o.values[t]=e},pushId:function(t,e,n){"BlockParam"===t?this.pushStackLiteral("blockParams["+e[0]+"].path["+e[1]+"]"+(n?" + "+JSON.stringify("."+n):"")):"PathExpression"===t?this.pushString(e):"SubExpression"===t?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:l,compileChildren:function(t,e){for(var n=t.children,i=void 0,r=void 0,o=0,s=n.length;o<s;o++){i=n[o],r=new this.compiler;var a=this.matchExistingProgram(i);null==a?(this.context.programs.push(""),a=this.context.programs.length,i.index=a,i.name="program"+a,this.context.programs[a]=r.compile(i,e,this.context,!this.precompile),this.context.decorators[a]=r.decorators,this.context.environments[a]=i,this.useDepths=this.useDepths||r.useDepths,this.useBlockParams=this.useBlockParams||r.useBlockParams):(i.index=a,i.name="program"+a,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams)}},matchExistingProgram:function(t){for(var e=0,n=this.context.environments.length;e<n;e++){var i=this.context.environments[e];if(i&&i.equals(t))return e}},programExpression:function(t){var e=this.environment.children[t],n=[e.index,"data",e.blockParams];return(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths"),"container.program("+n.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof u||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new u(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var e=["("],n=void 0,i=void 0,r=void 0;if(!this.isInline())throw new o.default("replaceStack on non-inline");var s=this.popStack(!0);if(s instanceof u)e=["(",n=[s.value]],r=!0;else{i=!0;var a=this.incrStack();e=["((",this.push(a)," = ",s,")"],n=this.topStack()}var l=t.call(this,n);r||this.popStack(),i&&this.stackSlot--,this.push(e.concat(l,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var e=0,n=t.length;e<n;e++){var i=t[e];if(i instanceof u)this.compileStack.push(i);else{var r=this.incrStack();this.pushSource([r," = ",i,";"]),this.compileStack.push(r)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var e=this.isInline(),n=(e?this.inlineStack:this.compileStack).pop();if(!t&&n instanceof u)return n.value;if(!e){if(!this.stackSlot)throw new o.default("Invalid stack pop");this.stackSlot--}return n},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,e=t[t.length-1];return e instanceof u?e.value:e},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var e=this.aliases[t];return e?(e.referenceCount++,e):((e=this.aliases[t]=this.source.wrap(t)).aliasable=!0,e.referenceCount=1,e)},setupHelper:function(t,e,n){var i=[];return{params:i,paramsInit:this.setupHelperArgs(e,t,i,n),name:this.nameLookup("helpers",e,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : {}")].concat(i)}},setupParams:function(t,e,n){var i={},r=[],o=[],s=[],a=!n,u=void 0;a&&(n=[]),i.name=this.quotedString(t),i.hash=this.popStack(),this.trackIds&&(i.hashIds=this.popStack()),this.stringParams&&(i.hashTypes=this.popStack(),i.hashContexts=this.popStack());var l=this.popStack(),c=this.popStack();(c||l)&&(i.fn=c||"container.noop",i.inverse=l||"container.noop");for(var f=e;f--;)u=this.popStack(),n[f]=u,this.trackIds&&(s[f]=this.popStack()),this.stringParams&&(o[f]=this.popStack(),r[f]=this.popStack());return a&&(i.args=this.source.generateArray(n)),this.trackIds&&(i.ids=this.source.generateArray(s)),this.stringParams&&(i.types=this.source.generateArray(o),i.contexts=this.source.generateArray(r)),this.options.data&&(i.data="data"),this.useBlockParams&&(i.blockParams="blockParams"),i},setupHelperArgs:function(t,e,n,i){var r=this.setupParams(t,e,n);return r=this.objectLiteral(r),i?(this.useRegister("options"),n.push("options"),["options=",r]):n?(n.push(r),""):r}},function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=l.RESERVED_WORDS={},n=0,i=t.length;n<i;n++)e[t[n]]=!0}(),l.isValidJavaScriptVariableName=function(t){return!l.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)},e.default=l,t.exports=e.default},function(t,e,n){"use strict";e.__esModule=!0;var i=n(5),r=void 0;try{}catch(t){}function o(t,e,n){if(i.isArray(t)){for(var r=[],o=0,s=t.length;o<s;o++)r.push(e.wrap(t[o],n));return r}return"boolean"==typeof t||"number"==typeof t?t+"":t}function s(t){this.srcFile=t,this.source=[]}r||((r=function(t,e,n,i){this.src="",i&&this.add(i)}).prototype={add:function(t){i.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){i.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),s.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,e){this.source.unshift(this.wrap(t,e))},push:function(t,e){this.source.push(this.wrap(t,e))},merge:function(){var t=this.empty();return this.each(function(e){t.add([" ",e,"\n"])}),t},each:function(t){for(var e=0,n=this.source.length;e<n;e++)t(this.source[e])},empty:function(){var t=this.currentLocation||{start:{}};return new r(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var e=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return t instanceof r?t:(t=o(t,this,e),new r(e.start.line,e.start.column,this.srcFile,t))},functionCall:function(t,e,n){return n=this.generateList(n),this.wrap([t,e?"."+e+"(":"(",n,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var e=[];for(var n in t)if(t.hasOwnProperty(n)){var i=o(t[n],this);"undefined"!==i&&e.push([this.quotedString(n),":",i])}var r=this.generateList(e);return r.prepend("{"),r.add("}"),r},generateList:function(t){for(var e=this.empty(),n=0,i=t.length;n<i;n++)n&&e.add(","),e.add(o(t[n],this));return e},generateArray:function(t){var e=this.generateList(t);return e.prepend("["),e.add("]"),e}},e.default=s,t.exports=e.default}])},"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.Handlebars=n():e.Handlebars=n()}(),i()}),$__System.registerDynamic("github:components/handlebars.js@4.0.5.js",["github:components/handlebars.js@4.0.5/handlebars.js"],!0,function(t,e,n){this||self;n.exports=t("github:components/handlebars.js@4.0.5/handlebars.js")}),$__System.register("handlebars-helpers/replace.js",[],function(t){"use strict";return t("replace",function(t,e){var n=arguments[arguments.length-1];if("string"!=typeof t)return n.inverse(this);var i=new RegExp((r=t,r.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")),"g");var r;return"string"==typeof e&&i.test(e)?e.replace(i,n.fn(this)):n.inverse(this)}),{setters:[],execute:function(){}}}),$__System.register("handlebars-helpers/handlebars.js",["github:components/handlebars.js@4.0.5.js","handlebars-helpers/replace.js"],function(t){"use strict";var e,n;return{setters:[function(t){e=t.default},function(t){n=t.replace}],execute:function(){e.registerHelper("replace",n)}}}),$__System.register("lib/component.js",["github:components/jquery@1.11.3.js","github:components/handlebars.js@4.0.5.js","npm:lodash@4.17.4.js","lib/grab.js","handlebars-helpers/handlebars.js"],function(t){"use strict";var e,n,i,r,o,s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.default},function(t){r=t.default},function(t){}],execute:function(){o=function(){function t(n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$el=e(n),"function"==typeof this.configure&&this.configure(i,this.$el),this.templates=this._prepareTemplates()}return s(t,[{key:"on",value:function(t){for(var e,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(e=this.$el.on).call.apply(e,[this.$el,this._namespaceEvents(t)].concat(i))}},{key:"one",value:function(t){for(var e,n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(e=this.$el.one).call.apply(e,[this.$el,this._namespaceEvents(t)].concat(i))}},{key:"off",value:function(t){var e;t=!t&&this.config&&this.config.jqNs?"."+this.config.jqNs:this._namespaceEvents(t);for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return(e=this.$el.off).call.apply(e,[this.$el,t].concat(i))}},{key:"destroy",value:function(){this.off(),delete this.$el}},{key:"_namespaceEvents",value:function(t){var e=this;return this.config&&this.config.jqNs?"string"!=typeof t?(console.warn("Auto-namespacing doesn't work for events passed as an object; calling 'off' won't work as expected and may break your code."),t):t.split(/\s+/).map(function(t){return t+"."+e.config.jqNs}).join(" "):(console.warn("You need to set this.config.jqNs for event auto-namespacing to work."),t)}},{key:"_prepareTemplates",value:function(){var t=this;if(this.config.templateSelectors)return i.mapValues(this.config.templateSelectors,function(e){return n.compile(r(e,t.$el).html()||"")}.bind(this))}}],[{key:"init",value:function(t,e){return console.warn("Using inherited init method from Component may not work in IE9."),new this(t,e)}}]),t}(),t("default",o)}}}),$__System.register("lib/config.js",["github:components/jquery@1.11.3.js"],function(t){"use strict";var e;function n(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.forEach(function(n){if(n instanceof Element||n instanceof e){var i=e(n).data();n={};var r=Object.keys(i);for(var o in r){var s=r[o];t.hasOwnProperty(s)&&(n[s]=i[s])}}e.extend(!0,t,n)}),t}function i(t){return function(i){Object.keys(t);return i.prototype.configure=function(){void 0===this.config&&(this.config=e.extend(!0,{},t));for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];n.apply(void 0,[this.config].concat(r))},i}}function r(t,e){var n=arguments.length<=2||void 0===arguments[2]||arguments[2],i={};for(var r in e)e.hasOwnProperty(r)&&(n||void 0!==t[r])&&(i[t[r]||r]=e[r]);return i}return{setters:[function(t){e=t.default}],execute:function(){t("mergeConfig",n),t("configurable",i),t("mapKeys",r)}}}),$__System.register("helpers/booleans.js",[],function(t){"use strict";var e,n=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[],execute:function(){e=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return n(t,null,[{key:"isTruthyValue",value:function(t){return!(!t&&0!==parseInt(t,10))}}]),t}(),t("Booleans",e)}}}),$__System.register("helpers/browser.js",["github:components/jquery@1.11.3.js"],function(t){"use strict";var e,n,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default}],execute:function(){n=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,null,[{key:"getAgent",value:function(){var t,e=navigator.userAgent,n=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?"IE "+((t=/\brv[ :]+(\d+)/g.exec(e)||[])[1]||""):"Chrome"===n[1]&&null!==(t=e.match(/\b(OPR|Edge)\/(\d+)/))?t.slice(1).join(" ").replace("OPR","Opera"):(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],null!==(t=e.match(/version\/(\d+)/i))&&n.splice(1,1,t[1]),n.join(" "))}},{key:"getScrollTopPosition",value:function(){if("undefined"!=typeof pageYOffset)return pageYOffset;var t=document.body,e=document.documentElement;return(e=e.clientHeight?e:t).scrollTop}},{key:"getScrollLeftPosition",value:function(){return(window.pageXOffset||document.documentElement.scrollLeft)-(document.documentElement.clientLeft||0)}},{key:"getUserAgent",value:function(){return navigator.userAgent}},{key:"getWindowSize",value:function(){return{width:e(window).width()||window.innerWidth||window.document.documentElement.clientWidth||(window.document.body||window.document.getElementsByTagName("body")[0]).clientWidth,height:e(window).height()||window.innerHeight||window.document.documentElement.clientHeight||(window.document.body||window.document.getElementsByTagName("body")[0]).clientHeight}}}]),t}(),t("Browser",n)}}}),$__System.register("helpers/colors.js",[],function(t){"use strict";var e,n=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[],execute:function(){e=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return n(t,null,[{key:"rgb2rgba",value:function(t,e){return t?(e=Helpers.Booleans.isTruthyValue(e)?e:1,t.replace(/rgb/i,"rgba").replace(/\)/i,", "+e+")")):null}},{key:"hex2rgb",value:function(t){return t?(n=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,t=t.replace(n,function(t,e,n,i){return e+e+n+n+i+i}),(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t))?"rgb("+parseInt(e[1],16)+","+parseInt(e[2],16)+","+parseInt(e[3],16)+")":null):null;var e,n}},{key:"rgb2hex",value:function(t,e,n){return t&&e&&n?t>255||e>255||n>255?null:t<0||e<0||n<0?null:"#"+(i=function(t){var e;return 1===(e=t.toString(16)).length?"0"+e:e})(t)+i(e)+i(n):null;var i}},{key:"colorLuminance",value:function(t,e){if(!this.hex2rgb(t)||e>1||e<-1)return null;var n,i,r,o="#";for((t=String(t).replace(/[^0-9a-f]/gi,"")).length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),e=e||0,i=r=0;r<=2;i=r+=1)n=parseInt(t.substr(2*i,2),16),o+=("00"+(n=Math.round(Math.min(Math.max(0,n+n*e),255)).toString(16))).substr(n.length);return o}}]),t}(),t("Colors",e)}}}),function(){var t,e,n=$__System.amdDefine;t=this,e=function(){"use strict";var t;function e(){return t.apply(null,arguments)}function n(t){return"[object Array]"===Object.prototype.toString.call(t)}function i(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function r(t,e){var n,i=[];for(n=0;n<t.length;++n)i.push(e(t[n],n));return i}function o(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function s(t,e){for(var n in e)o(e,n)&&(t[n]=e[n]);return o(e,"toString")&&(t.toString=e.toString),o(e,"valueOf")&&(t.valueOf=e.valueOf),t}function a(t,e,n,i){return ne(t,e,n,i,!0).utc()}function u(t){return null==t._pf&&(t._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}),t._pf}function l(t){if(null==t._isValid){var e=u(t);t._isValid=!(isNaN(t._d.getTime())||!(e.overflow<0)||e.empty||e.invalidMonth||e.invalidWeekday||e.nullInput||e.invalidFormat||e.userInvalidated),t._strict&&(t._isValid=t._isValid&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour)}return t._isValid}function c(t){var e=a(NaN);return null!=t?s(u(e),t):u(e).userInvalidated=!0,e}function f(t){return void 0===t}var h=e.momentProperties=[];function p(t,e){var n,i,r;if(f(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),f(e._i)||(t._i=e._i),f(e._f)||(t._f=e._f),f(e._l)||(t._l=e._l),f(e._strict)||(t._strict=e._strict),f(e._tzm)||(t._tzm=e._tzm),f(e._isUTC)||(t._isUTC=e._isUTC),f(e._offset)||(t._offset=e._offset),f(e._pf)||(t._pf=u(e)),f(e._locale)||(t._locale=e._locale),h.length>0)for(n in h)f(r=e[i=h[n]])||(t[i]=r);return t}var d=!1;function m(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),!1===d&&(d=!0,e.updateOffset(this),d=!1)}function v(t){return t instanceof m||null!=t&&null!=t._isAMomentObject}function g(t){return t<0?Math.ceil(t):Math.floor(t)}function y(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=g(e)),n}function _(t,e,n){var i,r=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),s=0;for(i=0;i<r;i++)(n&&t[i]!==e[i]||!n&&y(t[i])!==y(e[i]))&&s++;return s+o}function b(){}var w,k={};function S(t){return t?t.toLowerCase().replace("_","-"):t}function x(t){var e=null;if(!k[t]&&void 0!==module&&module&&module.exports)try{e=w._abbr,require("./locale/"+t),j(e)}catch(t){}return k[t]}function j(t,e){var n;return t&&(n=f(e)?C(t):E(t,e))&&(w=n),w._abbr}function E(t,e){return null!==e?(e.abbr=t,k[t]=k[t]||new b,k[t].set(e),j(t),k[t]):(delete k[t],null)}function C(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return w;if(!n(t)){if(e=x(t))return e;t=[t]}return function(t){for(var e,n,i,r,o=0;o<t.length;){for(e=(r=S(t[o]).split("-")).length,n=(n=S(t[o+1]))?n.split("-"):null;e>0;){if(i=x(r.slice(0,e).join("-")))return i;if(n&&n.length>=e&&_(r,n,!0)>=e-1)break;e--}o++}return null}(t)}var T={};function O(t,e){var n=t.toLowerCase();T[n]=T[n+"s"]=T[e]=t}function P(t){return"string"==typeof t?T[t]||T[t.toLowerCase()]:void 0}function A(t){var e,n,i={};for(n in t)o(t,n)&&(e=P(n))&&(i[e]=t[n]);return i}function D(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function L(t,n){return function(i){return null!=i?(I(this,t,i),e.updateOffset(this,n),this):N(this,t)}}function N(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function I(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function M(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(D(this[t=P(t)]))return this[t](e);return this}function F(t,e,n){var i=""+Math.abs(t),r=e-i.length;return(t>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}var $=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,H={},B={};function W(t,e,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),t&&(B[t]=r),e&&(B[e[0]]=function(){return F(r.apply(this,arguments),e[1],e[2])}),n&&(B[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),t)})}function Y(t,e){return t.isValid()?(e=V(e,t.localeData()),H[e]=H[e]||function(t){var e,n,i,r=t.match($);for(e=0,n=r.length;e<n;e++)B[r[e]]?r[e]=B[r[e]]:r[e]=(i=r[e]).match(/\[[\s\S]/)?i.replace(/^\[|\]$/g,""):i.replace(/\\/g,"");return function(i){var o="";for(e=0;e<n;e++)o+=r[e]instanceof Function?r[e].call(i,t):r[e];return o}}(e),H[e](t)):t.localeData().invalidDate()}function V(t,e){var n=5;function i(t){return e.longDateFormat(t)||t}for(R.lastIndex=0;n>=0&&R.test(t);)t=t.replace(R,i),R.lastIndex=0,n-=1;return t}var q=/\d/,z=/\d\d/,U=/\d{3}/,G=/\d{4}/,K=/[+-]?\d{6}/,Q=/\d\d?/,X=/\d\d\d\d?/,J=/\d\d\d\d\d\d?/,Z=/\d{1,3}/,tt=/\d{1,4}/,et=/[+-]?\d{1,6}/,nt=/\d+/,it=/[+-]?\d+/,rt=/Z|[+-]\d\d:?\d\d/gi,ot=/Z|[+-]\d\d(?::?\d\d)?/gi,st=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,at={};function ut(t,e,n){at[t]=D(e)?e:function(t,i){return t&&n?n:e}}function lt(t,e){return o(at,t)?at[t](e._strict,e._locale):new RegExp(ct(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,i,r){return e||n||i||r})))}function ct(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var ft={};function ht(t,e){var n,i=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(i=function(t,n){n[e]=y(t)}),n=0;n<t.length;n++)ft[t[n]]=i}function pt(t,e){ht(t,function(t,n,i,r){i._w=i._w||{},e(t,i._w,i,r)})}function dt(t,e,n){null!=e&&o(ft,t)&&ft[t](e,n._a,n,t)}var mt=0,vt=1,gt=2,yt=3,_t=4,bt=5,wt=6,kt=7,St=8;function xt(t,e){return new Date(Date.UTC(t,e+1,0)).getUTCDate()}W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),W("MMMM",0,0,function(t){return this.localeData().months(this,t)}),O("month","M"),ut("M",Q),ut("MM",Q,z),ut("MMM",function(t,e){return e.monthsShortRegex(t)}),ut("MMMM",function(t,e){return e.monthsRegex(t)}),ht(["M","MM"],function(t,e){e[vt]=y(t)-1}),ht(["MMM","MMMM"],function(t,e,n,i){var r=n._locale.monthsParse(t,i,n._strict);null!=r?e[vt]=r:u(n).invalidMonth=t});var jt=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Et="January_February_March_April_May_June_July_August_September_October_November_December".split("_");var Ct="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_");function Tt(t,e){var n;return t.isValid()?"string"==typeof e&&"number"!=typeof(e=t.localeData().monthsParse(e))?t:(n=Math.min(t.date(),xt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t):t}function Ot(t){return null!=t?(Tt(this,t),e.updateOffset(this,!0),this):N(this,"Month")}var Pt=st;var At=st;function Dt(){function t(t,e){return e.length-t.length}var e,n,i=[],r=[],o=[];for(e=0;e<12;e++)n=a([2e3,e]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(i.sort(t),r.sort(t),o.sort(t),e=0;e<12;e++)i[e]=ct(i[e]),r[e]=ct(r[e]),o[e]=ct(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")$","i")}function Lt(t){var e,n=t._a;return n&&-2===u(t).overflow&&(e=n[vt]<0||n[vt]>11?vt:n[gt]<1||n[gt]>xt(n[mt],n[vt])?gt:n[yt]<0||n[yt]>24||24===n[yt]&&(0!==n[_t]||0!==n[bt]||0!==n[wt])?yt:n[_t]<0||n[_t]>59?_t:n[bt]<0||n[bt]>59?bt:n[wt]<0||n[wt]>999?wt:-1,u(t)._overflowDayOfYear&&(e<mt||e>gt)&&(e=gt),u(t)._overflowWeeks&&-1===e&&(e=kt),u(t)._overflowWeekday&&-1===e&&(e=St),u(t).overflow=e),t}function Nt(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function It(t,e){var n=!0;return s(function(){return n&&(Nt(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}var Mt={};e.suppressDeprecationWarnings=!1;var Ft=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,$t=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Rt=/Z|[+-]\d\d(?::?\d\d)?/,Ht=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Bt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Wt=/^\/?Date\((\-?\d+)/i;function Yt(t){var e,n,i,r,o,s,a=t._i,l=Ft.exec(a)||$t.exec(a);if(l){for(u(t).iso=!0,e=0,n=Ht.length;e<n;e++)if(Ht[e][1].exec(l[1])){r=Ht[e][0],i=!1!==Ht[e][2];break}if(null==r)return void(t._isValid=!1);if(l[3]){for(e=0,n=Bt.length;e<n;e++)if(Bt[e][1].exec(l[3])){o=(l[2]||" ")+Bt[e][0];break}if(null==o)return void(t._isValid=!1)}if(!i&&null!=o)return void(t._isValid=!1);if(l[4]){if(!Rt.exec(l[4]))return void(t._isValid=!1);s="Z"}t._f=r+(o||"")+(s||""),te(t)}else t._isValid=!1}function Vt(t){var e=new Date(Date.UTC.apply(null,arguments));return t<100&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function qt(t){return zt(t)?366:365}function zt(t){return t%4==0&&t%100!=0||t%400==0}e.createFromInputFallback=It("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),W("Y",0,0,function(){var t=this.year();return t<=9999?""+t:"+"+t}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),O("year","y"),ut("Y",it),ut("YY",Q,z),ut("YYYY",tt,G),ut("YYYYY",et,K),ut("YYYYYY",et,K),ht(["YYYYY","YYYYYY"],mt),ht("YYYY",function(t,n){n[mt]=2===t.length?e.parseTwoDigitYear(t):y(t)}),ht("YY",function(t,n){n[mt]=e.parseTwoDigitYear(t)}),ht("Y",function(t,e){e[mt]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return y(t)+(y(t)>68?1900:2e3)};var Ut=L("FullYear",!1);function Gt(t,e,n){var i=7+e-n;return-((7+Vt(t,0,i).getUTCDay()-e)%7)+i-1}function Kt(t,e,n,i,r){var o,s,a=1+7*(e-1)+(7+n-i)%7+Gt(t,i,r);return a<=0?s=qt(o=t-1)+a:a>qt(t)?(o=t+1,s=a-qt(t)):(o=t,s=a),{year:o,dayOfYear:s}}function Qt(t,e,n){var i,r,o=Gt(t.year(),e,n),s=Math.floor((t.dayOfYear()-o-1)/7)+1;return s<1?i=s+Xt(r=t.year()-1,e,n):s>Xt(t.year(),e,n)?(i=s-Xt(t.year(),e,n),r=t.year()+1):(r=t.year(),i=s),{week:i,year:r}}function Xt(t,e,n){var i=Gt(t,e,n),r=Gt(t+1,e,n);return(qt(t)-i+r)/7}function Jt(t,e,n){return null!=t?t:null!=e?e:n}function Zt(t){var n,i,r,o,s=[];if(!t._d){for(r=function(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}(t),t._w&&null==t._a[gt]&&null==t._a[vt]&&function(t){var e,n,i,r,o,s,a,l;null!=(e=t._w).GG||null!=e.W||null!=e.E?(o=1,s=4,n=Jt(e.GG,t._a[mt],Qt(ie(),1,4).year),i=Jt(e.W,1),((r=Jt(e.E,1))<1||r>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,n=Jt(e.gg,t._a[mt],Qt(ie(),o,s).year),i=Jt(e.w,1),null!=e.d?((r=e.d)<0||r>6)&&(l=!0):null!=e.e?(r=e.e+o,(e.e<0||e.e>6)&&(l=!0)):r=o);i<1||i>Xt(n,o,s)?u(t)._overflowWeeks=!0:null!=l?u(t)._overflowWeekday=!0:(a=Kt(n,i,r,o,s),t._a[mt]=a.year,t._dayOfYear=a.dayOfYear)}(t),t._dayOfYear&&(o=Jt(t._a[mt],r[mt]),t._dayOfYear>qt(o)&&(u(t)._overflowDayOfYear=!0),i=Vt(o,0,t._dayOfYear),t._a[vt]=i.getUTCMonth(),t._a[gt]=i.getUTCDate()),n=0;n<3&&null==t._a[n];++n)t._a[n]=s[n]=r[n];for(;n<7;n++)t._a[n]=s[n]=null==t._a[n]?2===n?1:0:t._a[n];24===t._a[yt]&&0===t._a[_t]&&0===t._a[bt]&&0===t._a[wt]&&(t._nextDay=!0,t._a[yt]=0),t._d=(t._useUTC?Vt:function(t,e,n,i,r,o,s){var a=new Date(t,e,n,i,r,o,s);return t<100&&t>=0&&isFinite(a.getFullYear())&&a.setFullYear(t),a}).apply(null,s),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[yt]=24)}}function te(t){if(t._f!==e.ISO_8601){t._a=[],u(t).empty=!0;var n,i,r,o,s,a=""+t._i,l=a.length,c=0;for(r=V(t._f,t._locale).match($)||[],n=0;n<r.length;n++)o=r[n],(i=(a.match(lt(o,t))||[])[0])&&((s=a.substr(0,a.indexOf(i))).length>0&&u(t).unusedInput.push(s),a=a.slice(a.indexOf(i)+i.length),c+=i.length),B[o]?(i?u(t).empty=!1:u(t).unusedTokens.push(o),dt(o,i,t)):t._strict&&!i&&u(t).unusedTokens.push(o);u(t).charsLeftOver=l-c,a.length>0&&u(t).unusedInput.push(a),!0===u(t).bigHour&&t._a[yt]<=12&&t._a[yt]>0&&(u(t).bigHour=void 0),t._a[yt]=function(t,e,n){var i;if(null==n)return e;return null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((i=t.isPM(n))&&e<12&&(e+=12),i||12!==e||(e=0),e):e}(t._locale,t._a[yt],t._meridiem),Zt(t),Lt(t)}else Yt(t)}function ee(t){var o=t._i,a=t._f;return t._locale=t._locale||C(t._l),null===o||void 0===a&&""===o?c({nullInput:!0}):("string"==typeof o&&(t._i=o=t._locale.preparse(o)),v(o)?new m(Lt(o)):(n(a)?function(t){var e,n,i,r,o;if(0===t._f.length)return u(t).invalidFormat=!0,void(t._d=new Date(NaN));for(r=0;r<t._f.length;r++)o=0,e=p({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[r],te(e),l(e)&&(o+=u(e).charsLeftOver,o+=10*u(e).unusedTokens.length,u(e).score=o,(null==i||o<i)&&(i=o,n=e));s(t,n||e)}(t):a?te(t):i(o)?t._d=o:function(t){var o=t._i;void 0===o?t._d=new Date(e.now()):i(o)?t._d=new Date(+o):"string"==typeof o?function(t){var n=Wt.exec(t._i);null===n?(Yt(t),!1===t._isValid&&(delete t._isValid,e.createFromInputFallback(t))):t._d=new Date(+n[1])}(t):n(o)?(t._a=r(o.slice(0),function(t){return parseInt(t,10)}),Zt(t)):"object"==typeof o?function(t){if(!t._d){var e=A(t._i);t._a=r([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Zt(t)}}(t):"number"==typeof o?t._d=new Date(o):e.createFromInputFallback(t)}(t),l(t)||(t._d=null),t))}function ne(t,e,n,i,r){var o,s={};return"boolean"==typeof n&&(i=n,n=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=r,s._l=n,s._i=t,s._f=e,s._strict=i,(o=new m(Lt(ee(s))))._nextDay&&(o.add(1,"d"),o._nextDay=void 0),o}function ie(t,e,n,i){return ne(t,e,n,i,!1)}e.ISO_8601=function(){};var re=It("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=ie.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:c()}),oe=It("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=ie.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:c()});function se(t,e){var i,r;if(1===e.length&&n(e[0])&&(e=e[0]),!e.length)return ie();for(i=e[0],r=1;r<e.length;++r)e[r].isValid()&&!e[r][t](i)||(i=e[r]);return i}function ae(t){var e=A(t),n=e.year||0,i=e.quarter||0,r=e.month||0,o=e.week||0,s=e.day||0,a=e.hour||0,u=e.minute||0,l=e.second||0,c=e.millisecond||0;this._milliseconds=+c+1e3*l+6e4*u+36e5*a,this._days=+s+7*o,this._months=+r+3*i+12*n,this._data={},this._locale=C(),this._bubble()}function ue(t){return t instanceof ae}function le(t,e){W(t,0,0,function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+F(~~(t/60),2)+e+F(~~t%60,2)})}le("Z",":"),le("ZZ",""),ut("Z",ot),ut("ZZ",ot),ht(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=fe(ot,t)});var ce=/([\+\-]|\d\d)/gi;function fe(t,e){var n=(e||"").match(t)||[],i=((n[n.length-1]||[])+"").match(ce)||["-",0,0],r=60*i[1]+y(i[2]);return"+"===i[0]?r:-r}function he(t,n){var r,o;return n._isUTC?(r=n.clone(),o=(v(t)||i(t)?+t:+ie(t))-+r,r._d.setTime(+r._d+o),e.updateOffset(r,!1),r):ie(t).local()}function pe(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function de(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}e.updateOffset=function(){};var me=/(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,ve=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;function ge(t,e){var n,i,r,s=t,a=null;return ue(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(s={},e?s[e]=t:s.milliseconds=t):(a=me.exec(t))?(n="-"===a[1]?-1:1,s={y:0,d:y(a[gt])*n,h:y(a[yt])*n,m:y(a[_t])*n,s:y(a[bt])*n,ms:y(a[wt])*n}):(a=ve.exec(t))?(n="-"===a[1]?-1:1,s={y:ye(a[2],n),M:ye(a[3],n),d:ye(a[4],n),h:ye(a[5],n),m:ye(a[6],n),s:ye(a[7],n),w:ye(a[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(r=function(t,e){var n;if(!t.isValid()||!e.isValid())return{milliseconds:0,months:0};e=he(e,t),t.isBefore(e)?n=_e(t,e):((n=_e(e,t)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(ie(s.from),ie(s.to)),(s={}).ms=r.milliseconds,s.M=r.months),i=new ae(s),ue(t)&&o(t,"_locale")&&(i._locale=t._locale),i}function ye(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function _e(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function be(t,e){return function(n,i){var r;return null===i||isNaN(+i)||(!function(t,e){Mt[t]||(Nt(e),Mt[t]=!0)}(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),r=n,n=i,i=r),we(this,ge(n="string"==typeof n?+n:n,i),t),this}}function we(t,n,i,r){var o=n._milliseconds,s=n._days,a=n._months;t.isValid()&&(r=null==r||r,o&&t._d.setTime(+t._d+o*i),s&&I(t,"Date",N(t,"Date")+s*i),a&&Tt(t,N(t,"Month")+a*i),r&&e.updateOffset(t,s||a))}ge.fn=ae.prototype;var ke=be(1,"add"),Se=be(-1,"subtract");function xe(t){var e;return void 0===t?this._locale._abbr:(null!=(e=C(t))&&(this._locale=e),this)}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var je=It("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});function Ee(){return this._locale}function Ce(t,e){W(0,[t,t.length],0,e)}function Te(t,e,n,i,r){var o;return null==t?Qt(this,i,r).year:(e>(o=Xt(t,i,r))&&(e=o),function(t,e,n,i,r){var o=Kt(t,e,n,i,r),s=Vt(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}.call(this,t,e,n,i,r))}W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ce("gggg","weekYear"),Ce("ggggg","weekYear"),Ce("GGGG","isoWeekYear"),Ce("GGGGG","isoWeekYear"),O("weekYear","gg"),O("isoWeekYear","GG"),ut("G",it),ut("g",it),ut("GG",Q,z),ut("gg",Q,z),ut("GGGG",tt,G),ut("gggg",tt,G),ut("GGGGG",et,K),ut("ggggg",et,K),pt(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,i){e[i.substr(0,2)]=y(t)}),pt(["gg","GG"],function(t,n,i,r){n[r]=e.parseTwoDigitYear(t)}),W("Q",0,"Qo","quarter"),O("quarter","Q"),ut("Q",q),ht("Q",function(t,e){e[vt]=3*(y(t)-1)}),W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),O("week","w"),O("isoWeek","W"),ut("w",Q),ut("ww",Q,z),ut("W",Q),ut("WW",Q,z),pt(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=y(t)});W("D",["DD",2],"Do","date"),O("date","D"),ut("D",Q),ut("DD",Q,z),ut("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),ht(["D","DD"],gt),ht("Do",function(t,e){e[gt]=y(t.match(Q)[0])});var Oe=L("Date",!0);W("d",0,"do","day"),W("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),W("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),W("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),O("day","d"),O("weekday","e"),O("isoWeekday","E"),ut("d",Q),ut("e",Q),ut("E",Q),ut("dd",st),ut("ddd",st),ut("dddd",st),pt(["dd","ddd","dddd"],function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);null!=r?e.d=r:u(n).invalidWeekday=t}),pt(["d","e","E"],function(t,e,n,i){e[i]=y(t)});var Pe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_");var Ae="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_");var De="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Le(){return this.hours()%12||12}function Ne(t,e){W(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function Ie(t,e){return e._meridiemParse}W("DDD",["DDDD",3],"DDDo","dayOfYear"),O("dayOfYear","DDD"),ut("DDD",Z),ut("DDDD",U),ht(["DDD","DDDD"],function(t,e,n){n._dayOfYear=y(t)}),W("H",["HH",2],0,"hour"),W("h",["hh",2],0,Le),W("hmm",0,0,function(){return""+Le.apply(this)+F(this.minutes(),2)}),W("hmmss",0,0,function(){return""+Le.apply(this)+F(this.minutes(),2)+F(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+F(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+F(this.minutes(),2)+F(this.seconds(),2)}),Ne("a",!0),Ne("A",!1),O("hour","h"),ut("a",Ie),ut("A",Ie),ut("H",Q),ut("h",Q),ut("HH",Q,z),ut("hh",Q,z),ut("hmm",X),ut("hmmss",J),ut("Hmm",X),ut("Hmmss",J),ht(["H","HH"],yt),ht(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ht(["h","hh"],function(t,e,n){e[yt]=y(t),u(n).bigHour=!0}),ht("hmm",function(t,e,n){var i=t.length-2;e[yt]=y(t.substr(0,i)),e[_t]=y(t.substr(i)),u(n).bigHour=!0}),ht("hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[yt]=y(t.substr(0,i)),e[_t]=y(t.substr(i,2)),e[bt]=y(t.substr(r)),u(n).bigHour=!0}),ht("Hmm",function(t,e,n){var i=t.length-2;e[yt]=y(t.substr(0,i)),e[_t]=y(t.substr(i))}),ht("Hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[yt]=y(t.substr(0,i)),e[_t]=y(t.substr(i,2)),e[bt]=y(t.substr(r))});var Me=L("Hours",!0);W("m",["mm",2],0,"minute"),O("minute","m"),ut("m",Q),ut("mm",Q,z),ht(["m","mm"],_t);var Fe=L("Minutes",!1);W("s",["ss",2],0,"second"),O("second","s"),ut("s",Q),ut("ss",Q,z),ht(["s","ss"],bt);var $e,Re=L("Seconds",!1);for(W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return 10*this.millisecond()}),W(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),W(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),W(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),W(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),W(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),O("millisecond","ms"),ut("S",Z,q),ut("SS",Z,z),ut("SSS",Z,U),$e="SSSS";$e.length<=9;$e+="S")ut($e,nt);function He(t,e){e[wt]=y(1e3*("0."+t))}for($e="S";$e.length<=9;$e+="S")ht($e,He);var Be=L("Milliseconds",!1);W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");var We=m.prototype;We.add=ke,We.calendar=function(t,e){var n=t||ie(),i=he(n,this).startOf("day"),r=this.diff(i,"days",!0),o=r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse",s=e&&(D(e[o])?e[o]():e[o]);return this.format(s||this.localeData().calendar(o,this,ie(n)))},We.clone=function(){return new m(this)},We.diff=function(t,e,n){var i,r,o,s;return this.isValid()&&(i=he(t,this)).isValid()?(r=6e4*(i.utcOffset()-this.utcOffset()),"year"===(e=P(e))||"month"===e||"quarter"===e?(a=this,u=i,f=12*(u.year()-a.year())+(u.month()-a.month()),h=a.clone().add(f,"months"),u-h<0?(l=a.clone().add(f-1,"months"),c=(u-h)/(h-l)):(l=a.clone().add(f+1,"months"),c=(u-h)/(l-h)),s=-(f+c),"quarter"===e?s/=3:"year"===e&&(s/=12)):(o=this-i,s="second"===e?o/1e3:"minute"===e?o/6e4:"hour"===e?o/36e5:"day"===e?(o-r)/864e5:"week"===e?(o-r)/6048e5:o),n?s:g(s)):NaN;var a,u,l,c,f,h},We.endOf=function(t){return void 0===(t=P(t))||"millisecond"===t?this:this.startOf(t).add(1,"isoWeek"===t?"week":t).subtract(1,"ms")},We.format=function(t){var n=Y(this,t||e.defaultFormat);return this.localeData().postformat(n)},We.from=function(t,e){return this.isValid()&&(v(t)&&t.isValid()||ie(t).isValid())?ge({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},We.fromNow=function(t){return this.from(ie(),t)},We.to=function(t,e){return this.isValid()&&(v(t)&&t.isValid()||ie(t).isValid())?ge({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},We.toNow=function(t){return this.to(ie(),t)},We.get=M,We.invalidAt=function(){return u(this).overflow},We.isAfter=function(t,e){var n=v(t)?t:ie(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=P(f(e)?"millisecond":e))?+this>+n:+n<+this.clone().startOf(e))},We.isBefore=function(t,e){var n=v(t)?t:ie(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=P(f(e)?"millisecond":e))?+this<+n:+this.clone().endOf(e)<+n)},We.isBetween=function(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)},We.isSame=function(t,e){var n,i=v(t)?t:ie(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=P(e||"millisecond"))?+this==+i:(n=+i,+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e)))},We.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)},We.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)},We.isValid=function(){return l(this)},We.lang=je,We.locale=xe,We.localeData=Ee,We.max=oe,We.min=re,We.parsingFlags=function(){return s({},u(this))},We.set=M,We.startOf=function(t){switch(t=P(t)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===t&&this.weekday(0),"isoWeek"===t&&this.isoWeekday(1),"quarter"===t&&this.month(3*Math.floor(this.month()/3)),this},We.subtract=Se,We.toArray=function(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]},We.toObject=function(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}},We.toDate=function(){return this._offset?new Date(+this):this._d},We.toISOString=function(){var t=this.clone().utc();return 0<t.year()&&t.year()<=9999?D(Date.prototype.toISOString)?this.toDate().toISOString():Y(t,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):Y(t,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},We.toJSON=function(){return this.isValid()?this.toISOString():"null"},We.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},We.unix=function(){return Math.floor(+this/1e3)},We.valueOf=function(){return+this._d-6e4*(this._offset||0)},We.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},We.year=Ut,We.isLeapYear=function(){return zt(this.year())},We.weekYear=function(t){return Te.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},We.isoWeekYear=function(t){return Te.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},We.quarter=We.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},We.month=Ot,We.daysInMonth=function(){return xt(this.year(),this.month())},We.week=We.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},We.isoWeek=We.isoWeeks=function(t){var e=Qt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},We.weeksInYear=function(){var t=this.localeData()._week;return Xt(this.year(),t.dow,t.doy)},We.isoWeeksInYear=function(){return Xt(this.year(),1,4)},We.date=Oe,We.day=We.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},We.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},We.isoWeekday=function(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN},We.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},We.hour=We.hours=Me,We.minute=We.minutes=Fe,We.second=We.seconds=Re,We.millisecond=We.milliseconds=Be,We.utcOffset=function(t,n){var i,r=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=fe(ot,t):Math.abs(t)<16&&(t*=60),!this._isUTC&&n&&(i=pe(this)),this._offset=t,this._isUTC=!0,null!=i&&this.add(i,"m"),r!==t&&(!n||this._changeInProgress?we(this,ge(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?r:pe(this):null!=t?this:NaN},We.utc=function(t){return this.utcOffset(0,t)},We.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(pe(this),"m")),this},We.parseZone=function(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(fe(rt,this._i)),this},We.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?ie(t).utcOffset():0,(this.utcOffset()-t)%60==0)},We.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},We.isDSTShifted=function(){if(!f(this._isDSTShifted))return this._isDSTShifted;var t={};if(p(t,this),(t=ee(t))._a){var e=t._isUTC?a(t._a):ie(t._a);this._isDSTShifted=this.isValid()&&_(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted},We.isLocal=function(){return!!this.isValid()&&!this._isUTC},We.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},We.isUtc=de,We.isUTC=de,We.zoneAbbr=function(){return this._isUTC?"UTC":""},We.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},We.dates=It("dates accessor is deprecated. Use date instead.",Oe),We.months=It("months accessor is deprecated. Use month instead",Ot),We.years=It("years accessor is deprecated. Use year instead",Ut),We.zone=It("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()});var Ye=We;function Ve(t){return t}var qe=b.prototype;function ze(t,e,n,i){var r=C(),o=a().set(i,e);return r[n](o,t)}function Ue(t,e,n,i,r){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return ze(t,e,n,r);var o,s=[];for(o=0;o<i;o++)s[o]=ze(t,o,n,r);return s}qe._calendar={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},qe.calendar=function(t,e,n){var i=this._calendar[t];return D(i)?i.call(e,n):i},qe._longDateFormat={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},qe.longDateFormat=function(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])},qe._invalidDate="Invalid date",qe.invalidDate=function(){return this._invalidDate},qe._ordinal="%d",qe.ordinal=function(t){return this._ordinal.replace("%d",t)},qe._ordinalParse=/\d{1,2}/,qe.preparse=Ve,qe.postformat=Ve,qe._relativeTime={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},qe.relativeTime=function(t,e,n,i){var r=this._relativeTime[n];return D(r)?r(t,e,n,i):r.replace(/%d/i,t)},qe.pastFuture=function(t,e){var n=this._relativeTime[t>0?"future":"past"];return D(n)?n(e):n.replace(/%s/i,e)},qe.set=function(t){var e,n;for(n in t)D(e=t[n])?this[n]=e:this["_"+n]=e;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},qe.months=function(t,e){return n(this._months)?this._months[t.month()]:this._months[jt.test(e)?"format":"standalone"][t.month()]},qe._months=Et,qe.monthsShort=function(t,e){return n(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[jt.test(e)?"format":"standalone"][t.month()]},qe._monthsShort=Ct,qe.monthsParse=function(t,e,n){var i,r,o;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=a([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[i].test(t))return i;if(n&&"MMM"===e&&this._shortMonthsParse[i].test(t))return i;if(!n&&this._monthsParse[i].test(t))return i}},qe._monthsRegex=At,qe.monthsRegex=function(t){return this._monthsParseExact?(o(this,"_monthsRegex")||Dt.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex},qe._monthsShortRegex=Pt,qe.monthsShortRegex=function(t){return this._monthsParseExact?(o(this,"_monthsRegex")||Dt.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex},qe.week=function(t){return Qt(t,this._week.dow,this._week.doy).week},qe._week={dow:0,doy:6},qe.firstDayOfYear=function(){return this._week.doy},qe.firstDayOfWeek=function(){return this._week.dow},qe.weekdays=function(t,e){return n(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]},qe._weekdays=Pe,qe.weekdaysMin=function(t){return this._weekdaysMin[t.day()]},qe._weekdaysMin=De,qe.weekdaysShort=function(t){return this._weekdaysShort[t.day()]},qe._weekdaysShort=Ae,qe.weekdaysParse=function(t,e,n){var i,r,o;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=ie([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".",".?")+"$","i")),this._weekdaysParse[i]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[i].test(t))return i;if(n&&"ddd"===e&&this._shortWeekdaysParse[i].test(t))return i;if(n&&"dd"===e&&this._minWeekdaysParse[i].test(t))return i;if(!n&&this._weekdaysParse[i].test(t))return i}},qe.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},qe._meridiemParse=/[ap]\.?m?\.?/i,qe.meridiem=function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},j("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===y(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),e.lang=It("moment.lang is deprecated. Use moment.locale instead.",j),e.langData=It("moment.langData is deprecated. Use moment.localeData instead.",C);var Ge=Math.abs;function Ke(t,e,n,i){var r=ge(e,n);return t._milliseconds+=i*r._milliseconds,t._days+=i*r._days,t._months+=i*r._months,t._bubble()}function Qe(t){return t<0?Math.floor(t):Math.ceil(t)}function Xe(t){return 4800*t/146097}function Je(t){return 146097*t/4800}function Ze(t){return function(){return this.as(t)}}var tn=Ze("ms"),en=Ze("s"),nn=Ze("m"),rn=Ze("h"),on=Ze("d"),sn=Ze("w"),an=Ze("M"),un=Ze("y");function ln(t){return function(){return this._data[t]}}var cn=ln("milliseconds"),fn=ln("seconds"),hn=ln("minutes"),pn=ln("hours"),dn=ln("days"),mn=ln("months"),vn=ln("years");var gn=Math.round,yn={s:45,m:45,h:22,d:26,M:11};var _n=Math.abs;function bn(){var t,e,n=_n(this._milliseconds)/1e3,i=_n(this._days),r=_n(this._months);e=g((t=g(n/60))/60),n%=60,t%=60;var o=g(r/12),s=r%=12,a=i,u=e,l=t,c=n,f=this.asSeconds();return f?(f<0?"-":"")+"P"+(o?o+"Y":"")+(s?s+"M":"")+(a?a+"D":"")+(u||l||c?"T":"")+(u?u+"H":"")+(l?l+"M":"")+(c?c+"S":""):"P0D"}var wn=ae.prototype;return wn.abs=function(){var t=this._data;return this._milliseconds=Ge(this._milliseconds),this._days=Ge(this._days),this._months=Ge(this._months),t.milliseconds=Ge(t.milliseconds),t.seconds=Ge(t.seconds),t.minutes=Ge(t.minutes),t.hours=Ge(t.hours),t.months=Ge(t.months),t.years=Ge(t.years),this},wn.add=function(t,e){return Ke(this,t,e,1)},wn.subtract=function(t,e){return Ke(this,t,e,-1)},wn.as=function(t){var e,n,i=this._milliseconds;if("month"===(t=P(t))||"year"===t)return e=this._days+i/864e5,n=this._months+Xe(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Je(this._months)),t){case"week":return e/7+i/6048e5;case"day":return e+i/864e5;case"hour":return 24*e+i/36e5;case"minute":return 1440*e+i/6e4;case"second":return 86400*e+i/1e3;case"millisecond":return Math.floor(864e5*e)+i;default:throw new Error("Unknown unit "+t)}},wn.asMilliseconds=tn,wn.asSeconds=en,wn.asMinutes=nn,wn.asHours=rn,wn.asDays=on,wn.asWeeks=sn,wn.asMonths=an,wn.asYears=un,wn.valueOf=function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*y(this._months/12)},wn._bubble=function(){var t,e,n,i,r,o=this._milliseconds,s=this._days,a=this._months,u=this._data;return o>=0&&s>=0&&a>=0||o<=0&&s<=0&&a<=0||(o+=864e5*Qe(Je(a)+s),s=0,a=0),u.milliseconds=o%1e3,t=g(o/1e3),u.seconds=t%60,e=g(t/60),u.minutes=e%60,n=g(e/60),u.hours=n%24,a+=r=g(Xe(s+=g(n/24))),s-=Qe(Je(r)),i=g(a/12),a%=12,u.days=s,u.months=a,u.years=i,this},wn.get=function(t){return this[(t=P(t))+"s"]()},wn.milliseconds=cn,wn.seconds=fn,wn.minutes=hn,wn.hours=pn,wn.days=dn,wn.weeks=function(){return g(this.days()/7)},wn.months=mn,wn.years=vn,wn.humanize=function(t){var e=this.localeData(),n=function(t,e,n){var i=ge(t).abs(),r=gn(i.as("s")),o=gn(i.as("m")),s=gn(i.as("h")),a=gn(i.as("d")),u=gn(i.as("M")),l=gn(i.as("y")),c=r<yn.s&&["s",r]||o<=1&&["m"]||o<yn.m&&["mm",o]||s<=1&&["h"]||s<yn.h&&["hh",s]||a<=1&&["d"]||a<yn.d&&["dd",a]||u<=1&&["M"]||u<yn.M&&["MM",u]||l<=1&&["y"]||["yy",l];return c[2]=e,c[3]=+t>0,c[4]=n,function(t,e,n,i,r){return r.relativeTime(e||1,!!n,t,i)}.apply(null,c)}(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)},wn.toISOString=bn,wn.toString=bn,wn.toJSON=bn,wn.locale=xe,wn.localeData=Ee,wn.toIsoString=It("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",bn),wn.lang=je,W("X",0,0,"unix"),W("x",0,0,"valueOf"),ut("x",it),ut("X",/[+-]?\d+(\.\d{1,3})?/),ht("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),ht("x",function(t,e,n){n._d=new Date(y(t))}),e.version="2.11.1",t=ie,e.fn=Ye,e.min=function(){return se("isBefore",[].slice.call(arguments,0))},e.max=function(){return se("isAfter",[].slice.call(arguments,0))},e.now=function(){return Date.now?Date.now():+new Date},e.utc=a,e.unix=function(t){return ie(1e3*t)},e.months=function(t,e){return Ue(t,e,"months",12,"month")},e.isDate=i,e.locale=j,e.invalid=c,e.duration=ge,e.isMoment=v,e.weekdays=function(t,e){return Ue(t,e,"weekdays",7,"day")},e.parseZone=function(){return ie.apply(null,arguments).parseZone()},e.localeData=C,e.isDuration=ue,e.monthsShort=function(t,e){return Ue(t,e,"monthsShort",12,"month")},e.weekdaysMin=function(t,e){return Ue(t,e,"weekdaysMin",7,"day")},e.defineLocale=E,e.weekdaysShort=function(t,e){return Ue(t,e,"weekdaysShort",7,"day")},e.normalizeUnits=P,e.relativeTimeThreshold=function(t,e){return void 0!==yn[t]&&(void 0===e?yn[t]:(yn[t]=e,!0))},e.prototype=Ye,e},"object"==typeof exports&&void 0!==module?module.exports=e():"function"==typeof n&&n.amd?n("npm:moment@2.11.1/moment.js",[],e):t.moment=e()}(),(0,$__System.amdDefine)("npm:moment@2.11.1.js",["npm:moment@2.11.1/moment.js"],function(t){return t}),$__System.register("helpers/dates.js",["npm:moment@2.11.1.js"],function(t){"use strict";var e,n,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default}],execute:function(){n=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,null,[{key:"getDateUTCFormat",value:function(t){return e.utc(t)._f}},{key:"getCurrentYear",value:function(){return(new Date).getFullYear()}},{key:"getHour",value:function(t){return _.includes(this.getDateUTCFormat(t),"HH")?e(t).format("ha"):""}},{key:"getHourMinute",value:function(t){return _.includes(this.getDateUTCFormat(t),"HH:mm")?e(t).format("h.mma").replace(".00",""):""}},{key:"getDate",value:function(t){return e(t).format("D")+" "+e(t).format("MMMM")+" "+e(t).format("YYYY")}},{key:"getHourAndDate",value:function(t){return _.isEmpty(this.getHour(t))?this.getDate(t):this.getHour(t)+", "+this.getDate(t)}},{key:"getHourMinuteAndDate",value:function(t){return _.isEmpty(this.getHour(t))?this.getDate(t):this.getHourMinute(t)+", "+this.getDate(t)}}]),t}(),t("Dates",n)}}}),$__System.register("lib/constants.js",[],function(t){"use strict";return{setters:[],execute:function(){t("Constants",{ELEMENT_PROPERTY:"data-js-el",GLOBAL_INSTANCE:"UsydWeb"})}}}),$__System.register("lib/grab.js",["github:components/jquery@1.11.3.js"],function(t){"use strict";var e;return{setters:[function(t){e=t.default}],execute:function(){t("default",function(t,n){var i=arguments.length<=2||void 0===arguments[2]?"inside":arguments[2];if(t instanceof e)return t;if(t instanceof Element)return e(t);if("string"!=typeof t)return console.warn("Invalid target type."),e();if("@"==t.charAt(0)&&(t=e(n).data()[e.camelCase(t.substring(1))]),"#"==t.charAt(0))return i&&"inside"!=i&&console.warn("ID selector ("+i+") combined with direction '"+i+"' won't work as expected."),e(t);var r=void 0;return"before"==i?r="prevAll":"next"==i?r="nextAll":(i&&"inside"!=i&&console.warn("Trying to use invalid grab direction '"+i+"'."),r="find"),e(n)[r](t)})}}}),$__System.register("helpers/element.js",["github:components/jquery@1.11.3.js","npm:lodash@4.17.4.js","lib/constants.js","lib/grab.js"],function(t){"use strict";var e,n,i,r,o,s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default},function(t){n=t.default},function(t){i=t.Constants},function(t){r=t.default}],execute:function(){o=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return s(t,null,[{key:"get",value:function(o,s){var a=arguments.length<=2||void 0===arguments[2]?{attribute:i.ELEMENT_PROPERTY}:arguments[2];return o.startsWith("$")?e(t.get(o.substr(1),s)):o?r("["+a.attribute+"='"+n.kebabCase(o)+"']",s)[0]:null}},{key:"addProperty",value:function(t,r){var o=arguments.length<=2||void 0===arguments[2]?{attribute:i.ELEMENT_PROPERTY}:arguments[2];e(r).attr(o.attribute,n.kebabCase(t))}},{key:"listElements",value:function(o,s){var a=arguments.length<=2||void 0===arguments[2]?{attribute:i.ELEMENT_PROPERTY}:arguments[2];return Array.isArray(o)?n.map(o,function(e){return{name:e,el:t.get(e,s)}}):n.isString(o)?n.map(r("["+a.attribute+'="'+n.kebabCase(o)+'"]',s),function(t){return e(t)}):void 0}}]),t}(),t("Element",o)}}}),$__System.register("helpers/objects.js",["npm:lodash@4.17.4.js"],function(t){"use strict";var e,n,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default}],execute:function(){n=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,null,[{key:"filterObjectProperties",value:function(t,n){var i={};if(!e.isUndefined(t)&&!e.isUndefined(instance)){if(e.isObject(t))return e.forOwn(t,function(t,e){instance.hasOwnProperty(e)&&(i[e]=t)}),i;console.warn("invalid object to convert: ",t)}}},{key:"destroy",value:function(t){for(var e in t)t.hasOwnProperty(e)&&delete t[e];return t}},{key:"makeEnum",value:function(t,e){return new Proxy(e,{set:function(t,e,n){throw new TypeError("Enum is read only")},get:function(n,i){if("nameOf"===i)return function(n){for(var i=Object.keys(e),r=0;r<i.length;r+=1){var o=i[r];if(e[o]===n)return t+"."+o}}.bind(n);if(!(i in n))throw new ReferenceError('Unknown enum key "'+i+'"');return Reflect.get(n,i)},deleteProperty:function(t,e){throw new TypeError("Enum is read only")}})}}]),t}(),t("Objects",n)}}}),$__System.register("helpers/numbers.js",[],function(t){"use strict";var e,n=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[],execute:function(){e=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return n(t,null,[{key:"isNumber",value:function(t){return!isNaN(parseFloat(t))&&isFinite(t)}},{key:"stripNonNumericCharacters",value:function(t){return parseFloat(t.toString().replace(/[^\d.-]/g,""),10)}}]),t}(),t("Numbers",e)}}}),$__System.registerDynamic("npm:html-truncate@1.2.1/lib/truncate.js",["github:jspm/nodelibs-process@0.1.2.js"],!0,function(t,e,n){this||self;!function(t){n.exports=function(t,e,n){var i,r,o,s,a,u=10>e?e:10,l=["img"],c=[],f=0,h="",p='([\\w|-]+\\s*=\\s*"[^"]*"\\s*)*',d=new RegExp("<\\/?\\w+\\s*"+p+"\\s*\\/\\s*>"),m=new RegExp("<\\/?\\w+\\s*"+p+"\\s*\\/?\\s*>"),v=/(((ftp|https?):\/\/)[\-\w@:%_\+.~#?,&\/\/=]+)|((mailto:)?[_.\w\-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3})/g,g=new RegExp("<img\\s*"+p+"\\s*\\/?\\s*>"),y=new RegExp("\\W+","g"),_=!0;function b(t){var e=t.indexOf(" ");if(-1===e&&-1===(e=t.indexOf(">")))throw new Error("HTML tag is not well-formed : "+t);return t.substring(1,e)}function w(t,i){var r,o,s=e-f,a=s,u=s<n.slop,l=u?s:n.slop-1,c=u?0:s-n.slop,h=i||s+n.slop;if(!n.truncateLastWord){if(r=t.slice(c,h),i&&r.length<=i)a=r.length;else for(;null!==(o=y.exec(r));){if(!(o.index<l)){if(o.index===l){a=s;break}a=s+(o.index-l);break}if(a=s-(l-o.index),0===o.index&&s<=1)break}t.charAt(a-1).match(/\s$/)&&a--}return a}for((n=n||{}).ellipsis=void 0!==n.ellipsis?n.ellipsis:"...",n.truncateLastWord=void 0===n.truncateLastWord||n.truncateLastWord,n.slop=void 0!==n.slop?n.slop:u;_;){if(!(_=m.exec(t))){if(f>=e)break;if(!(_=v.exec(t))||_.index>=e){h+=t.substring(0,w(t));break}for(;_;)i=_[0],r=_.index,h+=t.substring(0,r+i.length-f),t=t.substring(r+i.length),_=v.exec(t);break}if(i=_[0],r=_.index,f+r>e){h+=t.substring(0,w(t,r));break}f+=r,h+=t.substring(0,r),"/"===i[1]?(c.pop(),s=null):(s=d.exec(i))||(o=b(i),c.push(o)),h+=s?s[0]:i,t=t.substring(r+i.length)}return t.length>e-f&&n.ellipsis&&(h+=n.ellipsis),h+=(a="",c.reverse().forEach(function(t,e){-1===l.indexOf(t)&&(a+="</"+t+">")}),a),n.keepImageTag||(h=function(t){var e,n,i=g.exec(t);return i?(e=i.index,n=i[0].length,t.substring(0,e)+t.substring(e+n)):t}(h)),h}}(t("github:jspm/nodelibs-process@0.1.2.js"))}),$__System.registerDynamic("npm:html-truncate@1.2.1.js",["npm:html-truncate@1.2.1/lib/truncate.js"],!0,function(t,e,n){this||self;n.exports=t("npm:html-truncate@1.2.1/lib/truncate.js")}),$__System.register("helpers/strings.js",["npm:html-truncate@1.2.1.js","github:components/jquery@1.11.3.js"],function(t){"use strict";var e,n,i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default},function(t){n=t.default}],execute:function(){i=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return r(t,null,[{key:"random",value:function(t){return Math.random().toString(36).substr(2,t&&t<=12?t:12)}},{key:"truncate",value:function(t,e,n){n=n||!0;var i=t.length>e,r=i?t.substr(0,e-1):t;return r=n&&i?r.substr(0,r.lastIndexOf(" ")):r,i?r+"...":r}},{key:"truncateHtmlContent",value:function(t,n,i,r,o){i=i||250,r=r||64;var s=e(n,i,{ellipsis:o=o||"..."});if(t.html(s).height()%r>0)return e(s,s.length/(t.html(s).height()/r*2),{ellipsis:o});var a=this.removeEmptyHtmlTags(s,o);return a!==s?e(s,a.length-10,{ellipsis:o}):s}},{key:"trimEmptyTags",value:function(t){return t.each(function(){""===n.trim(n(this).text())&&n(this).remove()}),t}},{key:"removeEmptyHtmlTags",value:function(t,e){return t.replace(e,"").replace(/(<(?!\/)[^>]+>)+(<\/[^>]+>)/gm,"")}},{key:"strip",value:function(t){var e=document.createElement("DIV");return e.innerHTML=t,e.textContent||e.innerText||""}},{key:"removeLineBreaks",value:function(t){return t.replace(/\r?\n|\r|&lt;br&gt;|<br>|<br\/>/g,"")}},{key:"getMediaTimeStringFromSeconds",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0],e=parseInt(t),n=Math.floor(t/3600);e-=3600*n;var i=Math.floor(e/60);e-=60*i;var r="";return n>0&&(r=r+n+" hour "),i>0&&(r=r+i+" min "),r=r+e+" sec"}}]),t}(),t("Strings",i)}}}),$__System.register("helpers/uri.js",[],function(t){"use strict";var e,n=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[],execute:function(){e=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return n(t,null,[{key:"getParams",value:function(){var t={};return window.location.search.replace(new RegExp("([^?=&]+)(=([^&]*))?","g"),function(e,n,i,r){t[n]=r}),t}},{key:"setUriParams",value:function(t){var e=window.location.protocol+"//"+window.location.host+window.location.pathname+(t?"?"+t:"");window.history.pushState({path:e},"",e)}}]),t}(),t("URI",e)}}}),$__System.registerDynamic("npm:lodash@4.17.4/lodash.js",["@empty"],!0,function(t,e,n){"format cjs";var i=this||self;!function(t,r){(function(){var t,r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="__lodash_hash_undefined__",u=500,l="__lodash_placeholder__",c=1,f=2,h=4,p=1,d=2,m=1,v=2,g=4,y=8,_=16,b=32,w=64,k=128,S=256,x=512,j=30,E="...",C=800,T=16,O=1,P=2,A=1/0,D=9007199254740991,L=1.7976931348623157e308,N=NaN,I=4294967295,M=I-1,F=I>>>1,$=[["ary",k],["bind",m],["bindKey",v],["curry",y],["curryRight",_],["flip",x],["partial",b],["partialRight",w],["rearg",S]],R="[object Arguments]",H="[object Array]",B="[object AsyncFunction]",W="[object Boolean]",Y="[object Date]",V="[object DOMException]",q="[object Error]",z="[object Function]",U="[object GeneratorFunction]",G="[object Map]",K="[object Number]",Q="[object Null]",X="[object Object]",J="[object Proxy]",Z="[object RegExp]",tt="[object Set]",et="[object String]",nt="[object Symbol]",it="[object Undefined]",rt="[object WeakMap]",ot="[object WeakSet]",st="[object ArrayBuffer]",at="[object DataView]",ut="[object Float32Array]",lt="[object Float64Array]",ct="[object Int8Array]",ft="[object Int16Array]",ht="[object Int32Array]",pt="[object Uint8Array]",dt="[object Uint8ClampedArray]",mt="[object Uint16Array]",vt="[object Uint32Array]",gt=/\b__p \+= '';/g,yt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bt=/&(?:amp|lt|gt|quot|#39);/g,wt=/[&<>"']/g,kt=RegExp(bt.source),St=RegExp(wt.source),xt=/<%-([\s\S]+?)%>/g,jt=/<%([\s\S]+?)%>/g,Et=/<%=([\s\S]+?)%>/g,Ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tt=/^\w*$/,Ot=/^\./,Pt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,At=/[\\^$.*+?()[\]{}|]/g,Dt=RegExp(At.source),Lt=/^\s+|\s+$/g,Nt=/^\s+/,It=/\s+$/,Mt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ft=/\{\n\/\* \[wrapped with (.+)\] \*/,$t=/,? & /,Rt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ht=/\\(\\)?/g,Bt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Wt=/\w*$/,Yt=/^[-+]0x[0-9a-f]+$/i,Vt=/^0b[01]+$/i,qt=/^\[object .+?Constructor\]$/,zt=/^0o[0-7]+$/i,Ut=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Kt=/($^)/,Qt=/['\n\r\u2028\u2029\\]/g,Xt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Jt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Zt="[\\ud800-\\udfff]",te="["+Jt+"]",ee="["+Xt+"]",ne="\\d+",ie="[\\u2700-\\u27bf]",re="[a-z\\xdf-\\xf6\\xf8-\\xff]",oe="[^\\ud800-\\udfff"+Jt+ne+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",ae="[^\\ud800-\\udfff]",ue="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",ce="[A-Z\\xc0-\\xd6\\xd8-\\xde]",fe="(?:"+re+"|"+oe+")",he="(?:"+ce+"|"+oe+")",pe="(?:"+ee+"|"+se+")"+"?",de="[\\ufe0e\\ufe0f]?"+pe+("(?:\\u200d(?:"+[ae,ue,le].join("|")+")[\\ufe0e\\ufe0f]?"+pe+")*"),me="(?:"+[ie,ue,le].join("|")+")"+de,ve="(?:"+[ae+ee+"?",ee,ue,le,Zt].join("|")+")",ge=RegExp("['’]","g"),ye=RegExp(ee,"g"),_e=RegExp(se+"(?="+se+")|"+ve+de,"g"),be=RegExp([ce+"?"+re+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[te,ce,"$"].join("|")+")",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[te,ce+fe,"$"].join("|")+")",ce+"?"+fe+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ce+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:(?:1ST|2ND|3RD|(?![123])\\dTH)\\b)","\\d*(?:(?:1st|2nd|3rd|(?![123])\\dth)\\b)",ne,me].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+Xt+"\\ufe0e\\ufe0f]"),ke=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xe=-1,je={};je[ut]=je[lt]=je[ct]=je[ft]=je[ht]=je[pt]=je[dt]=je[mt]=je[vt]=!0,je[R]=je[H]=je[st]=je[W]=je[at]=je[Y]=je[q]=je[z]=je[G]=je[K]=je[X]=je[Z]=je[tt]=je[et]=je[rt]=!1;var Ee={};Ee[R]=Ee[H]=Ee[st]=Ee[at]=Ee[W]=Ee[Y]=Ee[ut]=Ee[lt]=Ee[ct]=Ee[ft]=Ee[ht]=Ee[G]=Ee[K]=Ee[X]=Ee[Z]=Ee[tt]=Ee[et]=Ee[nt]=Ee[pt]=Ee[dt]=Ee[mt]=Ee[vt]=!0,Ee[q]=Ee[z]=Ee[rt]=!1;var Ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Te=parseFloat,Oe=parseInt,Pe="object"==typeof i&&i&&i.Object===Object&&i,Ae="object"==typeof self&&self&&self.Object===Object&&self,De=Pe||Ae||Function("return this")(),Le="object"==typeof e&&e&&!e.nodeType&&e,Ne=Le&&"object"==typeof n&&n&&!n.nodeType&&n,Ie=Ne&&Ne.exports===Le,Me=Ie&&Pe.process,Fe=function(){try{return Me&&Me.binding&&Me.binding("util")}catch(t){}}(),$e=Fe&&Fe.isArrayBuffer,Re=Fe&&Fe.isDate,He=Fe&&Fe.isMap,Be=Fe&&Fe.isRegExp,We=Fe&&Fe.isSet,Ye=Fe&&Fe.isTypedArray;function Ve(t,e){return t.set(e[0],e[1]),t}function qe(t,e){return t.add(e),t}function ze(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ue(t,e,n,i){for(var r=-1,o=null==t?0:t.length;++r<o;){var s=t[r];e(i,s,n(s),t)}return i}function Ge(t,e){for(var n=-1,i=null==t?0:t.length;++n<i&&!1!==e(t[n],n,t););return t}function Ke(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Qe(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(!e(t[n],n,t))return!1;return!0}function Xe(t,e){for(var n=-1,i=null==t?0:t.length,r=0,o=[];++n<i;){var s=t[n];e(s,n,t)&&(o[r++]=s)}return o}function Je(t,e){return!!(null==t?0:t.length)&&ln(t,e,0)>-1}function Ze(t,e,n){for(var i=-1,r=null==t?0:t.length;++i<r;)if(n(e,t[i]))return!0;return!1}function tn(t,e){for(var n=-1,i=null==t?0:t.length,r=Array(i);++n<i;)r[n]=e(t[n],n,t);return r}function en(t,e){for(var n=-1,i=e.length,r=t.length;++n<i;)t[r+n]=e[n];return t}function nn(t,e,n,i){var r=-1,o=null==t?0:t.length;for(i&&o&&(n=t[++r]);++r<o;)n=e(n,t[r],r,t);return n}function rn(t,e,n,i){var r=null==t?0:t.length;for(i&&r&&(n=t[--r]);r--;)n=e(n,t[r],r,t);return n}function on(t,e){for(var n=-1,i=null==t?0:t.length;++n<i;)if(e(t[n],n,t))return!0;return!1}var sn=pn("length");function an(t,e,n){var i;return n(t,function(t,n,r){if(e(t,n,r))return i=n,!1}),i}function un(t,e,n,i){for(var r=t.length,o=n+(i?1:-1);i?o--:++o<r;)if(e(t[o],o,t))return o;return-1}function ln(t,e,n){return e==e?function(t,e,n){var i=n-1,r=t.length;for(;++i<r;)if(t[i]===e)return i;return-1}(t,e,n):un(t,fn,n)}function cn(t,e,n,i){for(var r=n-1,o=t.length;++r<o;)if(i(t[r],e))return r;return-1}function fn(t){return t!=t}function hn(t,e){var n=null==t?0:t.length;return n?vn(t,e)/n:N}function pn(e){return function(n){return null==n?t:n[e]}}function dn(e){return function(n){return null==e?t:e[n]}}function mn(t,e,n,i,r){return r(t,function(t,r,o){n=i?(i=!1,t):e(n,t,r,o)}),n}function vn(e,n){for(var i,r=-1,o=e.length;++r<o;){var s=n(e[r]);s!==t&&(i=i===t?s:i+s)}return i}function gn(t,e){for(var n=-1,i=Array(t);++n<t;)i[n]=e(n);return i}function yn(t){return function(e){return t(e)}}function _n(t,e){return tn(e,function(e){return t[e]})}function bn(t,e){return t.has(e)}function wn(t,e){for(var n=-1,i=t.length;++n<i&&ln(e,t[n],0)>-1;);return n}function kn(t,e){for(var n=t.length;n--&&ln(e,t[n],0)>-1;);return n}var Sn=dn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),xn=dn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function jn(t){return"\\"+Ce[t]}function En(t){return we.test(t)}function Cn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,i){n[++e]=[i,t]}),n}function Tn(t,e){return function(n){return t(e(n))}}function On(t,e){for(var n=-1,i=t.length,r=0,o=[];++n<i;){var s=t[n];s!==e&&s!==l||(t[n]=l,o[r++]=n)}return o}function Pn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function An(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}function Dn(t){return En(t)?function(t){var e=_e.lastIndex=0;for(;_e.test(t);)++e;return e}(t):sn(t)}function Ln(t){return En(t)?function(t){return t.match(_e)||[]}(t):function(t){return t.split("")}(t)}var Nn=dn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var In=function e(n){var i,Xt=(n=null==n?De:In.defaults(De.Object(),n,In.pick(De,Se))).Array,Jt=n.Date,Zt=n.Error,te=n.Function,ee=n.Math,ne=n.Object,ie=n.RegExp,re=n.String,oe=n.TypeError,se=Xt.prototype,ae=te.prototype,ue=ne.prototype,le=n["__core-js_shared__"],ce=ae.toString,fe=ue.hasOwnProperty,he=0,pe=(i=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"",de=ue.toString,me=ce.call(ne),ve=De._,_e=ie("^"+ce.call(fe).replace(At,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),we=Ie?n.Buffer:t,Ce=n.Symbol,Pe=n.Uint8Array,Ae=we?we.allocUnsafe:t,Le=Tn(ne.getPrototypeOf,ne),Ne=ne.create,Me=ue.propertyIsEnumerable,Fe=se.splice,sn=Ce?Ce.isConcatSpreadable:t,dn=Ce?Ce.iterator:t,Mn=Ce?Ce.toStringTag:t,Fn=function(){try{var t=Wo(ne,"defineProperty");return t({},"",{}),t}catch(t){}}(),$n=n.clearTimeout!==De.clearTimeout&&n.clearTimeout,Rn=Jt&&Jt.now!==De.Date.now&&Jt.now,Hn=n.setTimeout!==De.setTimeout&&n.setTimeout,Bn=ee.ceil,Wn=ee.floor,Yn=ne.getOwnPropertySymbols,Vn=we?we.isBuffer:t,qn=n.isFinite,zn=se.join,Un=Tn(ne.keys,ne),Gn=ee.max,Kn=ee.min,Qn=Jt.now,Xn=n.parseInt,Jn=ee.random,Zn=se.reverse,ti=Wo(n,"DataView"),ei=Wo(n,"Map"),ni=Wo(n,"Promise"),ii=Wo(n,"Set"),ri=Wo(n,"WeakMap"),oi=Wo(ne,"create"),si=ri&&new ri,ai={},ui=ps(ti),li=ps(ei),ci=ps(ni),fi=ps(ii),hi=ps(ri),pi=Ce?Ce.prototype:t,di=pi?pi.valueOf:t,mi=pi?pi.toString:t;function vi(t){if(Pa(t)&&!_a(t)&&!(t instanceof bi)){if(t instanceof _i)return t;if(fe.call(t,"__wrapped__"))return ds(t)}return new _i(t)}var gi=function(){function e(){}return function(n){if(!Oa(n))return{};if(Ne)return Ne(n);e.prototype=n;var i=new e;return e.prototype=t,i}}();function yi(){}function _i(e,n){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=t}function bi(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=I,this.__views__=[]}function wi(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function ki(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function Si(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var i=t[e];this.set(i[0],i[1])}}function xi(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Si;++e<n;)this.add(t[e])}function ji(t){var e=this.__data__=new ki(t);this.size=e.size}function Ei(t,e){var n=_a(t),i=!n&&ya(t),r=!n&&!i&&Sa(t),o=!n&&!i&&!r&&$a(t),s=n||i||r||o,a=s?gn(t.length,re):[],u=a.length;for(var l in t)!e&&!fe.call(t,l)||s&&("length"==l||r&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||Ko(l,u))||a.push(l);return a}function Ci(e){var n=e.length;return n?e[xr(0,n-1)]:t}function Ti(t,e){return cs(oo(t),Fi(e,0,t.length))}function Oi(t){return cs(oo(t))}function Pi(e,n,i){(i===t||ma(e[n],i))&&(i!==t||n in e)||Ii(e,n,i)}function Ai(e,n,i){var r=e[n];fe.call(e,n)&&ma(r,i)&&(i!==t||n in e)||Ii(e,n,i)}function Di(t,e){for(var n=t.length;n--;)if(ma(t[n][0],e))return n;return-1}function Li(t,e,n,i){return Wi(t,function(t,r,o){e(i,t,n(t),o)}),i}function Ni(t,e){return t&&so(e,su(e),t)}function Ii(t,e,n){"__proto__"==e&&Fn?Fn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Mi(e,n){for(var i=-1,r=n.length,o=Xt(r),s=null==e;++i<r;)o[i]=s?t:eu(e,n[i]);return o}function Fi(e,n,i){return e==e&&(i!==t&&(e=e<=i?e:i),n!==t&&(e=e>=n?e:n)),e}function $i(e,n,i,r,o,s){var a,u=n&c,l=n&f,p=n&h;if(i&&(a=o?i(e,r,o,s):i(e)),a!==t)return a;if(!Oa(e))return e;var d=_a(e);if(d){if(a=function(t){var e=t.length,n=t.constructor(e);return e&&"string"==typeof t[0]&&fe.call(t,"index")&&(n.index=t.index,n.input=t.input),n}(e),!u)return oo(e,a)}else{var m=qo(e),v=m==z||m==U;if(Sa(e))return Zr(e,u);if(m==X||m==R||v&&!o){if(a=l||v?{}:Uo(e),!u)return l?function(t,e){return so(t,Vo(t),e)}(e,function(t,e){return t&&so(e,au(e),t)}(a,e)):function(t,e){return so(t,Yo(t),e)}(e,Ni(a,e))}else{if(!Ee[m])return o?e:{};a=function(t,e,n,i){var r,o,s,a=t.constructor;switch(e){case st:return to(t);case W:case Y:return new a(+t);case at:return function(t,e){var n=e?to(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,i);case ut:case lt:case ct:case ft:case ht:case pt:case dt:case mt:case vt:return eo(t,i);case G:return function(t,e,n){return nn(e?n(Cn(t),c):Cn(t),Ve,new t.constructor)}(t,i,n);case K:case et:return new a(t);case Z:return(s=new(o=t).constructor(o.source,Wt.exec(o))).lastIndex=o.lastIndex,s;case tt:return function(t,e,n){return nn(e?n(Pn(t),c):Pn(t),qe,new t.constructor)}(t,i,n);case nt:return r=t,di?ne(di.call(r)):{}}}(e,m,$i,u)}}s||(s=new ji);var g=s.get(e);if(g)return g;s.set(e,a);var y=d?t:(p?l?Io:No:l?au:su)(e);return Ge(y||e,function(t,r){y&&(t=e[r=t]),Ai(a,r,$i(t,n,i,r,e,s))}),a}function Ri(e,n,i){var r=i.length;if(null==e)return!r;for(e=ne(e);r--;){var o=i[r],s=n[o],a=e[o];if(a===t&&!(o in e)||!s(a))return!1}return!0}function Hi(e,n,i){if("function"!=typeof e)throw new oe(s);return ss(function(){e.apply(t,i)},n)}function Bi(t,e,n,i){var o=-1,s=Je,a=!0,u=t.length,l=[],c=e.length;if(!u)return l;n&&(e=tn(e,yn(n))),i?(s=Ze,a=!1):e.length>=r&&(s=bn,a=!1,e=new xi(e));t:for(;++o<u;){var f=t[o],h=null==n?f:n(f);if(f=i||0!==f?f:0,a&&h==h){for(var p=c;p--;)if(e[p]===h)continue t;l.push(f)}else s(e,h,i)||l.push(f)}return l}vi.templateSettings={escape:xt,evaluate:jt,interpolate:Et,variable:"",imports:{_:vi}},vi.prototype=yi.prototype,vi.prototype.constructor=vi,_i.prototype=gi(yi.prototype),_i.prototype.constructor=_i,bi.prototype=gi(yi.prototype),bi.prototype.constructor=bi,wi.prototype.clear=function(){this.__data__=oi?oi(null):{},this.size=0},wi.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},wi.prototype.get=function(e){var n=this.__data__;if(oi){var i=n[e];return i===a?t:i}return fe.call(n,e)?n[e]:t},wi.prototype.has=function(e){var n=this.__data__;return oi?n[e]!==t:fe.call(n,e)},wi.prototype.set=function(e,n){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=oi&&n===t?a:n,this},ki.prototype.clear=function(){this.__data__=[],this.size=0},ki.prototype.delete=function(t){var e=this.__data__,n=Di(e,t);return!(n<0||(n==e.length-1?e.pop():Fe.call(e,n,1),--this.size,0))},ki.prototype.get=function(e){var n=this.__data__,i=Di(n,e);return i<0?t:n[i][1]},ki.prototype.has=function(t){return Di(this.__data__,t)>-1},ki.prototype.set=function(t,e){var n=this.__data__,i=Di(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this},Si.prototype.clear=function(){this.size=0,this.__data__={hash:new wi,map:new(ei||ki),string:new wi}},Si.prototype.delete=function(t){var e=Ho(this,t).delete(t);return this.size-=e?1:0,e},Si.prototype.get=function(t){return Ho(this,t).get(t)},Si.prototype.has=function(t){return Ho(this,t).has(t)},Si.prototype.set=function(t,e){var n=Ho(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this},xi.prototype.add=xi.prototype.push=function(t){return this.__data__.set(t,a),this},xi.prototype.has=function(t){return this.__data__.has(t)},ji.prototype.clear=function(){this.__data__=new ki,this.size=0},ji.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},ji.prototype.get=function(t){return this.__data__.get(t)},ji.prototype.has=function(t){return this.__data__.has(t)},ji.prototype.set=function(t,e){var n=this.__data__;if(n instanceof ki){var i=n.__data__;if(!ei||i.length<r-1)return i.push([t,e]),this.size=++n.size,this;n=this.__data__=new Si(i)}return n.set(t,e),this.size=n.size,this};var Wi=lo(Qi),Yi=lo(Xi,!0);function Vi(t,e){var n=!0;return Wi(t,function(t,i,r){return n=!!e(t,i,r)}),n}function qi(e,n,i){for(var r=-1,o=e.length;++r<o;){var s=e[r],a=n(s);if(null!=a&&(u===t?a==a&&!Fa(a):i(a,u)))var u=a,l=s}return l}function zi(t,e){var n=[];return Wi(t,function(t,i,r){e(t,i,r)&&n.push(t)}),n}function Ui(t,e,n,i,r){var o=-1,s=t.length;for(n||(n=Go),r||(r=[]);++o<s;){var a=t[o];e>0&&n(a)?e>1?Ui(a,e-1,n,i,r):en(r,a):i||(r[r.length]=a)}return r}var Gi=co(),Ki=co(!0);function Qi(t,e){return t&&Gi(t,e,su)}function Xi(t,e){return t&&Ki(t,e,su)}function Ji(t,e){return Xe(e,function(e){return Ea(t[e])})}function Zi(e,n){for(var i=0,r=(n=Kr(n,e)).length;null!=e&&i<r;)e=e[hs(n[i++])];return i&&i==r?e:t}function tr(t,e,n){var i=e(t);return _a(t)?i:en(i,n(t))}function er(e){return null==e?e===t?it:Q:Mn&&Mn in ne(e)?function(e){var n=fe.call(e,Mn),i=e[Mn];try{e[Mn]=t;var r=!0}catch(t){}var o=de.call(e);return r&&(n?e[Mn]=i:delete e[Mn]),o}(e):function(t){return de.call(t)}(e)}function nr(t,e){return t>e}function ir(t,e){return null!=t&&fe.call(t,e)}function rr(t,e){return null!=t&&e in ne(t)}function or(e,n,i){for(var r=i?Ze:Je,o=e[0].length,s=e.length,a=s,u=Xt(s),l=1/0,c=[];a--;){var f=e[a];a&&n&&(f=tn(f,yn(n))),l=Kn(f.length,l),u[a]=!i&&(n||o>=120&&f.length>=120)?new xi(a&&f):t}f=e[0];var h=-1,p=u[0];t:for(;++h<o&&c.length<l;){var d=f[h],m=n?n(d):d;if(d=i||0!==d?d:0,!(p?bn(p,m):r(c,m,i))){for(a=s;--a;){var v=u[a];if(!(v?bn(v,m):r(e[a],m,i)))continue t}p&&p.push(m),c.push(d)}}return c}function sr(e,n,i){var r=null==(e=rs(e,n=Kr(n,e)))?e:e[hs(js(n))];return null==r?t:ze(r,e,i)}function ar(t){return Pa(t)&&er(t)==R}function ur(e,n,i,r,o){return e===n||(null==e||null==n||!Pa(e)&&!Pa(n)?e!=e&&n!=n:function(e,n,i,r,o,s){var a=_a(e),u=_a(n),l=a?H:qo(e),c=u?H:qo(n),f=(l=l==R?X:l)==X,h=(c=c==R?X:c)==X,m=l==c;if(m&&Sa(e)){if(!Sa(n))return!1;a=!0,f=!1}if(m&&!f)return s||(s=new ji),a||$a(e)?Do(e,n,i,r,o,s):function(t,e,n,i,r,o,s){switch(n){case at:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case st:return!(t.byteLength!=e.byteLength||!o(new Pe(t),new Pe(e)));case W:case Y:case K:return ma(+t,+e);case q:return t.name==e.name&&t.message==e.message;case Z:case et:return t==e+"";case G:var a=Cn;case tt:var u=i&p;if(a||(a=Pn),t.size!=e.size&&!u)return!1;var l=s.get(t);if(l)return l==e;i|=d,s.set(t,e);var c=Do(a(t),a(e),i,r,o,s);return s.delete(t),c;case nt:if(di)return di.call(t)==di.call(e)}return!1}(e,n,l,i,r,o,s);if(!(i&p)){var v=f&&fe.call(e,"__wrapped__"),g=h&&fe.call(n,"__wrapped__");if(v||g){var y=v?e.value():e,_=g?n.value():n;return s||(s=new ji),o(y,_,i,r,s)}}return!!m&&(s||(s=new ji),function(e,n,i,r,o,s){var a=i&p,u=No(e),l=u.length,c=No(n).length;if(l!=c&&!a)return!1;for(var f=l;f--;){var h=u[f];if(!(a?h in n:fe.call(n,h)))return!1}var d=s.get(e);if(d&&s.get(n))return d==n;var m=!0;s.set(e,n),s.set(n,e);for(var v=a;++f<l;){h=u[f];var g=e[h],y=n[h];if(r)var _=a?r(y,g,h,n,e,s):r(g,y,h,e,n,s);if(!(_===t?g===y||o(g,y,i,r,s):_)){m=!1;break}v||(v="constructor"==h)}if(m&&!v){var b=e.constructor,w=n.constructor;b!=w&&"constructor"in e&&"constructor"in n&&!("function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w)&&(m=!1)}return s.delete(e),s.delete(n),m}(e,n,i,r,o,s))}(e,n,i,r,ur,o))}function lr(e,n,i,r){var o=i.length,s=o,a=!r;if(null==e)return!s;for(e=ne(e);o--;){var u=i[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<s;){var l=(u=i[o])[0],c=e[l],f=u[1];if(a&&u[2]){if(c===t&&!(l in e))return!1}else{var h=new ji;if(r)var m=r(c,f,l,e,n,h);if(!(m===t?ur(f,c,p|d,r,h):m))return!1}}return!0}function cr(t){return!(!Oa(t)||pe&&pe in t)&&(Ea(t)?_e:qt).test(ps(t))}function fr(t){return"function"==typeof t?t:null==t?Du:"object"==typeof t?_a(t)?gr(t[0],t[1]):vr(t):Bu(t)}function hr(t){if(!ts(t))return Un(t);var e=[];for(var n in ne(t))fe.call(t,n)&&"constructor"!=n&&e.push(n);return e}function pr(t){if(!Oa(t))return function(t){var e=[];if(null!=t)for(var n in ne(t))e.push(n);return e}(t);var e=ts(t),n=[];for(var i in t)("constructor"!=i||!e&&fe.call(t,i))&&n.push(i);return n}function dr(t,e){return t<e}function mr(t,e){var n=-1,i=wa(t)?Xt(t.length):[];return Wi(t,function(t,r,o){i[++n]=e(t,r,o)}),i}function vr(t){var e=Bo(t);return 1==e.length&&e[0][2]?ns(e[0][0],e[0][1]):function(n){return n===t||lr(n,t,e)}}function gr(e,n){return Xo(e)&&es(n)?ns(hs(e),n):function(i){var r=eu(i,e);return r===t&&r===n?nu(i,e):ur(n,r,p|d)}}function yr(e,n,i,r,o){e!==n&&Gi(n,function(s,a){if(Oa(s))o||(o=new ji),function(e,n,i,r,o,s,a){var u=e[i],l=n[i],c=a.get(l);if(c)Pi(e,i,c);else{var f=s?s(u,l,i+"",e,n,a):t,h=f===t;if(h){var p=_a(l),d=!p&&Sa(l),m=!p&&!d&&$a(l);f=l,p||d||m?_a(u)?f=u:ka(u)?f=oo(u):d?(h=!1,f=Zr(l,!0)):m?(h=!1,f=eo(l,!0)):f=[]:La(l)||ya(l)?(f=u,ya(u)?f=za(u):(!Oa(u)||r&&Ea(u))&&(f=Uo(l))):h=!1}h&&(a.set(l,f),o(f,l,r,s,a),a.delete(l)),Pi(e,i,f)}}(e,n,a,i,yr,r,o);else{var u=r?r(e[a],s,a+"",e,n,o):t;u===t&&(u=s),Pi(e,a,u)}},au)}function _r(e,n){var i=e.length;if(i)return Ko(n+=n<0?i:0,i)?e[n]:t}function br(t,e,n){var i=-1;return e=tn(e.length?e:[Du],yn(Ro())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(mr(t,function(t,n,r){return{criteria:tn(e,function(e){return e(t)}),index:++i,value:t}}),function(t,e){return function(t,e,n){for(var i=-1,r=t.criteria,o=e.criteria,s=r.length,a=n.length;++i<s;){var u=no(r[i],o[i]);if(u){if(i>=a)return u;var l=n[i];return u*("desc"==l?-1:1)}}return t.index-e.index}(t,e,n)})}function wr(t,e,n){for(var i=-1,r=e.length,o={};++i<r;){var s=e[i],a=Zi(t,s);n(a,s)&&Or(o,Kr(s,t),a)}return o}function kr(t,e,n,i){var r=i?cn:ln,o=-1,s=e.length,a=t;for(t===e&&(e=oo(e)),n&&(a=tn(t,yn(n)));++o<s;)for(var u=0,l=e[o],c=n?n(l):l;(u=r(a,c,u,i))>-1;)a!==t&&Fe.call(a,u,1),Fe.call(t,u,1);return t}function Sr(t,e){for(var n=t?e.length:0,i=n-1;n--;){var r=e[n];if(n==i||r!==o){var o=r;Ko(r)?Fe.call(t,r,1):Br(t,r)}}return t}function xr(t,e){return t+Wn(Jn()*(e-t+1))}function jr(t,e){var n="";if(!t||e<1||e>D)return n;do{e%2&&(n+=t),(e=Wn(e/2))&&(t+=t)}while(e);return n}function Er(t,e){return as(is(t,e,Du),t+"")}function Cr(t){return Ci(mu(t))}function Tr(t,e){var n=mu(t);return cs(n,Fi(e,0,n.length))}function Or(e,n,i,r){if(!Oa(e))return e;for(var o=-1,s=(n=Kr(n,e)).length,a=s-1,u=e;null!=u&&++o<s;){var l=hs(n[o]),c=i;if(o!=a){var f=u[l];(c=r?r(f,l,u):t)===t&&(c=Oa(f)?f:Ko(n[o+1])?[]:{})}Ai(u,l,c),u=u[l]}return e}var Pr=si?function(t,e){return si.set(t,e),t}:Du,Ar=Fn?function(t,e){return Fn(t,"toString",{configurable:!0,enumerable:!1,value:Ou(e),writable:!0})}:Du;function Dr(t){return cs(mu(t))}function Lr(t,e,n){var i=-1,r=t.length;e<0&&(e=-e>r?0:r+e),(n=n>r?r:n)<0&&(n+=r),r=e>n?0:n-e>>>0,e>>>=0;for(var o=Xt(r);++i<r;)o[i]=t[i+e];return o}function Nr(t,e){var n;return Wi(t,function(t,i,r){return!(n=e(t,i,r))}),!!n}function Ir(t,e,n){var i=0,r=null==t?i:t.length;if("number"==typeof e&&e==e&&r<=F){for(;i<r;){var o=i+r>>>1,s=t[o];null!==s&&!Fa(s)&&(n?s<=e:s<e)?i=o+1:r=o}return r}return Mr(t,e,Du,n)}function Mr(e,n,i,r){n=i(n);for(var o=0,s=null==e?0:e.length,a=n!=n,u=null===n,l=Fa(n),c=n===t;o<s;){var f=Wn((o+s)/2),h=i(e[f]),p=h!==t,d=null===h,m=h==h,v=Fa(h);if(a)var g=r||m;else g=c?m&&(r||p):u?m&&p&&(r||!d):l?m&&p&&!d&&(r||!v):!d&&!v&&(r?h<=n:h<n);g?o=f+1:s=f}return Kn(s,M)}function Fr(t,e){for(var n=-1,i=t.length,r=0,o=[];++n<i;){var s=t[n],a=e?e(s):s;if(!n||!ma(a,u)){var u=a;o[r++]=0===s?0:s}}return o}function $r(t){return"number"==typeof t?t:Fa(t)?N:+t}function Rr(t){if("string"==typeof t)return t;if(_a(t))return tn(t,Rr)+"";if(Fa(t))return mi?mi.call(t):"";var e=t+"";return"0"==e&&1/t==-A?"-0":e}function Hr(t,e,n){var i=-1,o=Je,s=t.length,a=!0,u=[],l=u;if(n)a=!1,o=Ze;else if(s>=r){var c=e?null:Eo(t);if(c)return Pn(c);a=!1,o=bn,l=new xi}else l=e?[]:u;t:for(;++i<s;){var f=t[i],h=e?e(f):f;if(f=n||0!==f?f:0,a&&h==h){for(var p=l.length;p--;)if(l[p]===h)continue t;e&&l.push(h),u.push(f)}else o(l,h,n)||(l!==u&&l.push(h),u.push(f))}return u}function Br(t,e){return null==(t=rs(t,e=Kr(e,t)))||delete t[hs(js(e))]}function Wr(t,e,n,i){return Or(t,e,n(Zi(t,e)),i)}function Yr(t,e,n,i){for(var r=t.length,o=i?r:-1;(i?o--:++o<r)&&e(t[o],o,t););return n?Lr(t,i?0:o,i?o+1:r):Lr(t,i?o+1:0,i?r:o)}function Vr(t,e){var n=t;return n instanceof bi&&(n=n.value()),nn(e,function(t,e){return e.func.apply(e.thisArg,en([t],e.args))},n)}function qr(t,e,n){var i=t.length;if(i<2)return i?Hr(t[0]):[];for(var r=-1,o=Xt(i);++r<i;)for(var s=t[r],a=-1;++a<i;)a!=r&&(o[r]=Bi(o[r]||s,t[a],e,n));return Hr(Ui(o,1),e,n)}function zr(e,n,i){for(var r=-1,o=e.length,s=n.length,a={};++r<o;){var u=r<s?n[r]:t;i(a,e[r],u)}return a}function Ur(t){return ka(t)?t:[]}function Gr(t){return"function"==typeof t?t:Du}function Kr(t,e){return _a(t)?t:Xo(t,e)?[t]:fs(Ua(t))}var Qr=Er;function Xr(e,n,i){var r=e.length;return i=i===t?r:i,!n&&i>=r?e:Lr(e,n,i)}var Jr=$n||function(t){return De.clearTimeout(t)};function Zr(t,e){if(e)return t.slice();var n=t.length,i=Ae?Ae(n):new t.constructor(n);return t.copy(i),i}function to(t){var e=new t.constructor(t.byteLength);return new Pe(e).set(new Pe(t)),e}function eo(t,e){var n=e?to(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function no(e,n){if(e!==n){var i=e!==t,r=null===e,o=e==e,s=Fa(e),a=n!==t,u=null===n,l=n==n,c=Fa(n);if(!u&&!c&&!s&&e>n||s&&a&&l&&!u&&!c||r&&a&&l||!i&&l||!o)return 1;if(!r&&!s&&!c&&e<n||c&&i&&o&&!r&&!s||u&&i&&o||!a&&o||!l)return-1}return 0}function io(t,e,n,i){for(var r=-1,o=t.length,s=n.length,a=-1,u=e.length,l=Gn(o-s,0),c=Xt(u+l),f=!i;++a<u;)c[a]=e[a];for(;++r<s;)(f||r<o)&&(c[n[r]]=t[r]);for(;l--;)c[a++]=t[r++];return c}function ro(t,e,n,i){for(var r=-1,o=t.length,s=-1,a=n.length,u=-1,l=e.length,c=Gn(o-a,0),f=Xt(c+l),h=!i;++r<c;)f[r]=t[r];for(var p=r;++u<l;)f[p+u]=e[u];for(;++s<a;)(h||r<o)&&(f[p+n[s]]=t[r++]);return f}function oo(t,e){var n=-1,i=t.length;for(e||(e=Xt(i));++n<i;)e[n]=t[n];return e}function so(e,n,i,r){var o=!i;i||(i={});for(var s=-1,a=n.length;++s<a;){var u=n[s],l=r?r(i[u],e[u],u,i,e):t;l===t&&(l=e[u]),o?Ii(i,u,l):Ai(i,u,l)}return i}function ao(t,e){return function(n,i){var r=_a(n)?Ue:Li,o=e?e():{};return r(n,t,Ro(i,2),o)}}function uo(e){return Er(function(n,i){var r=-1,o=i.length,s=o>1?i[o-1]:t,a=o>2?i[2]:t;for(s=e.length>3&&"function"==typeof s?(o--,s):t,a&&Qo(i[0],i[1],a)&&(s=o<3?t:s,o=1),n=ne(n);++r<o;){var u=i[r];u&&e(n,u,r,s)}return n})}function lo(t,e){return function(n,i){if(null==n)return n;if(!wa(n))return t(n,i);for(var r=n.length,o=e?r:-1,s=ne(n);(e?o--:++o<r)&&!1!==i(s[o],o,s););return n}}function co(t){return function(e,n,i){for(var r=-1,o=ne(e),s=i(e),a=s.length;a--;){var u=s[t?a:++r];if(!1===n(o[u],u,o))break}return e}}function fo(e){return function(n){var i=En(n=Ua(n))?Ln(n):t,r=i?i[0]:n.charAt(0),o=i?Xr(i,1).join(""):n.slice(1);return r[e]()+o}}function ho(t){return function(e){return nn(Eu(yu(e).replace(ge,"")),t,"")}}function po(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=gi(t.prototype),i=t.apply(n,e);return Oa(i)?i:n}}function mo(e){return function(n,i,r){var o=ne(n);if(!wa(n)){var s=Ro(i,3);n=su(n),i=function(t){return s(o[t],t,o)}}var a=e(n,i,r);return a>-1?o[s?n[a]:a]:t}}function vo(e){return Lo(function(n){var i=n.length,r=i,o=_i.prototype.thru;for(e&&n.reverse();r--;){var a=n[r];if("function"!=typeof a)throw new oe(s);if(o&&!u&&"wrapper"==Fo(a))var u=new _i([],!0)}for(r=u?r:i;++r<i;){var l=Fo(a=n[r]),c="wrapper"==l?Mo(a):t;u=c&&Jo(c[0])&&c[1]==(k|y|b|S)&&!c[4].length&&1==c[9]?u[Fo(c[0])].apply(u,c[3]):1==a.length&&Jo(a)?u[l]():u.thru(a)}return function(){var t=arguments,e=t[0];if(u&&1==t.length&&_a(e))return u.plant(e).value();for(var r=0,o=i?n[r].apply(this,t):e;++r<i;)o=n[r].call(this,o);return o}})}function go(e,n,i,r,o,s,a,u,l,c){var f=n&k,h=n&m,p=n&v,d=n&(y|_),g=n&x,b=p?t:po(e);return function m(){for(var v=arguments.length,y=Xt(v),_=v;_--;)y[_]=arguments[_];if(d)var w=$o(m),k=function(t,e){for(var n=t.length,i=0;n--;)t[n]===e&&++i;return i}(y,w);if(r&&(y=io(y,r,o,d)),s&&(y=ro(y,s,a,d)),v-=k,d&&v<c){var S=On(y,w);return xo(e,n,go,m.placeholder,i,y,S,u,l,c-v)}var x=h?i:this,j=p?x[e]:e;return v=y.length,u?y=function(e,n){for(var i=e.length,r=Kn(n.length,i),o=oo(e);r--;){var s=n[r];e[r]=Ko(s,i)?o[s]:t}return e}(y,u):g&&v>1&&y.reverse(),f&&l<v&&(y.length=l),this&&this!==De&&this instanceof m&&(j=b||po(j)),j.apply(x,y)}}function yo(t,e){return function(n,i){return function(t,e,n,i){return Qi(t,function(t,r,o){e(i,n(t),r,o)}),i}(n,t,e(i),{})}}function _o(e,n){return function(i,r){var o;if(i===t&&r===t)return n;if(i!==t&&(o=i),r!==t){if(o===t)return r;"string"==typeof i||"string"==typeof r?(i=Rr(i),r=Rr(r)):(i=$r(i),r=$r(r)),o=e(i,r)}return o}}function bo(t){return Lo(function(e){return e=tn(e,yn(Ro())),Er(function(n){var i=this;return t(e,function(t){return ze(t,i,n)})})})}function wo(e,n){var i=(n=n===t?" ":Rr(n)).length;if(i<2)return i?jr(n,e):n;var r=jr(n,Bn(e/Dn(n)));return En(n)?Xr(Ln(r),0,e).join(""):r.slice(0,e)}function ko(e){return function(n,i,r){return r&&"number"!=typeof r&&Qo(n,i,r)&&(i=r=t),n=Wa(n),i===t?(i=n,n=0):i=Wa(i),function(t,e,n,i){for(var r=-1,o=Gn(Bn((e-t)/(n||1)),0),s=Xt(o);o--;)s[i?o:++r]=t,t+=n;return s}(n,i,r=r===t?n<i?1:-1:Wa(r),e)}}function So(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=qa(e),n=qa(n)),t(e,n)}}function xo(e,n,i,r,o,s,a,u,l,c){var f=n&y;n|=f?b:w,(n&=~(f?w:b))&g||(n&=~(m|v));var h=[e,n,o,f?s:t,f?a:t,f?t:s,f?t:a,u,l,c],p=i.apply(t,h);return Jo(e)&&os(p,h),p.placeholder=r,us(p,e,n)}function jo(t){var e=ee[t];return function(t,n){if(t=qa(t),n=null==n?0:Kn(Ya(n),292)){var i=(Ua(t)+"e").split("e");return+((i=(Ua(e(i[0]+"e"+(+i[1]+n)))+"e").split("e"))[0]+"e"+(+i[1]-n))}return e(t)}}var Eo=ii&&1/Pn(new ii([,-0]))[1]==A?function(t){return new ii(t)}:Fu;function Co(t){return function(e){var n=qo(e);return n==G?Cn(e):n==tt?An(e):function(t,e){return tn(e,function(e){return[e,t[e]]})}(e,t(e))}}function To(e,n,i,r,o,a,u,c){var f=n&v;if(!f&&"function"!=typeof e)throw new oe(s);var h=r?r.length:0;if(h||(n&=~(b|w),r=o=t),u=u===t?u:Gn(Ya(u),0),c=c===t?c:Ya(c),h-=o?o.length:0,n&w){var p=r,d=o;r=o=t}var x=f?t:Mo(e),j=[e,n,i,r,o,p,d,a,u,c];if(x&&function(t,e){var n=t[1],i=e[1],r=n|i,o=r<(m|v|k),s=i==k&&n==y||i==k&&n==S&&t[7].length<=e[8]||i==(k|S)&&e[7].length<=e[8]&&n==y;if(!o&&!s)return t;i&m&&(t[2]=e[2],r|=n&m?0:g);var a=e[3];if(a){var u=t[3];t[3]=u?io(u,a,e[4]):a,t[4]=u?On(t[3],l):e[4]}(a=e[5])&&(u=t[5],t[5]=u?ro(u,a,e[6]):a,t[6]=u?On(t[5],l):e[6]),(a=e[7])&&(t[7]=a),i&k&&(t[8]=null==t[8]?e[8]:Kn(t[8],e[8])),null==t[9]&&(t[9]=e[9]),t[0]=e[0],t[1]=r}(j,x),e=j[0],n=j[1],i=j[2],r=j[3],o=j[4],!(c=j[9]=j[9]===t?f?0:e.length:Gn(j[9]-h,0))&&n&(y|_)&&(n&=~(y|_)),n&&n!=m)E=n==y||n==_?function(e,n,i){var r=po(e);return function o(){for(var s=arguments.length,a=Xt(s),u=s,l=$o(o);u--;)a[u]=arguments[u];var c=s<3&&a[0]!==l&&a[s-1]!==l?[]:On(a,l);return(s-=c.length)<i?xo(e,n,go,o.placeholder,t,a,c,t,t,i-s):ze(this&&this!==De&&this instanceof o?r:e,this,a)}}(e,n,c):n!=b&&n!=(m|b)||o.length?go.apply(t,j):function(t,e,n,i){var r=e&m,o=po(t);return function e(){for(var s=-1,a=arguments.length,u=-1,l=i.length,c=Xt(l+a),f=this&&this!==De&&this instanceof e?o:t;++u<l;)c[u]=i[u];for(;a--;)c[u++]=arguments[++s];return ze(f,r?n:this,c)}}(e,n,i,r);else var E=function(t,e,n){var i=e&m,r=po(t);return function e(){return(this&&this!==De&&this instanceof e?r:t).apply(i?n:this,arguments)}}(e,n,i);return us((x?Pr:os)(E,j),e,n)}function Oo(e,n,i,r){return e===t||ma(e,ue[i])&&!fe.call(r,i)?n:e}function Po(e,n,i,r,o,s){return Oa(e)&&Oa(n)&&(s.set(n,e),yr(e,n,t,Po,s),s.delete(n)),e}function Ao(e){return La(e)?t:e}function Do(e,n,i,r,o,s){var a=i&p,u=e.length,l=n.length;if(u!=l&&!(a&&l>u))return!1;var c=s.get(e);if(c&&s.get(n))return c==n;var f=-1,h=!0,m=i&d?new xi:t;for(s.set(e,n),s.set(n,e);++f<u;){var v=e[f],g=n[f];if(r)var y=a?r(g,v,f,n,e,s):r(v,g,f,e,n,s);if(y!==t){if(y)continue;h=!1;break}if(m){if(!on(n,function(t,e){if(!bn(m,e)&&(v===t||o(v,t,i,r,s)))return m.push(e)})){h=!1;break}}else if(v!==g&&!o(v,g,i,r,s)){h=!1;break}}return s.delete(e),s.delete(n),h}function Lo(e){return as(is(e,t,bs),e+"")}function No(t){return tr(t,su,Yo)}function Io(t){return tr(t,au,Vo)}var Mo=si?function(t){return si.get(t)}:Fu;function Fo(t){for(var e=t.name+"",n=ai[e],i=fe.call(ai,e)?n.length:0;i--;){var r=n[i],o=r.func;if(null==o||o==t)return r.name}return e}function $o(t){return(fe.call(vi,"placeholder")?vi:t).placeholder}function Ro(){var t=vi.iteratee||Lu;return t=t===Lu?fr:t,arguments.length?t(arguments[0],arguments[1]):t}function Ho(t,e){var n,i,r=t.__data__;return("string"==(i=typeof(n=e))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map}function Bo(t){for(var e=su(t),n=e.length;n--;){var i=e[n],r=t[i];e[n]=[i,r,es(r)]}return e}function Wo(e,n){var i=function(e,n){return null==e?t:e[n]}(e,n);return cr(i)?i:t}var Yo=Yn?function(t){return null==t?[]:(t=ne(t),Xe(Yn(t),function(e){return Me.call(t,e)}))}:Vu,Vo=Yn?function(t){for(var e=[];t;)en(e,Yo(t)),t=Le(t);return e}:Vu,qo=er;function zo(t,e,n){for(var i=-1,r=(e=Kr(e,t)).length,o=!1;++i<r;){var s=hs(e[i]);if(!(o=null!=t&&n(t,s)))break;t=t[s]}return o||++i!=r?o:!!(r=null==t?0:t.length)&&Ta(r)&&Ko(s,r)&&(_a(t)||ya(t))}function Uo(t){return"function"!=typeof t.constructor||ts(t)?{}:gi(Le(t))}function Go(t){return _a(t)||ya(t)||!!(sn&&t&&t[sn])}function Ko(t,e){return!!(e=null==e?D:e)&&("number"==typeof t||Ut.test(t))&&t>-1&&t%1==0&&t<e}function Qo(t,e,n){if(!Oa(n))return!1;var i=typeof e;return!!("number"==i?wa(n)&&Ko(e,n.length):"string"==i&&e in n)&&ma(n[e],t)}function Xo(t,e){if(_a(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Fa(t))||Tt.test(t)||!Ct.test(t)||null!=e&&t in ne(e)}function Jo(t){var e=Fo(t),n=vi[e];if("function"!=typeof n||!(e in bi.prototype))return!1;if(t===n)return!0;var i=Mo(n);return!!i&&t===i[0]}(ti&&qo(new ti(new ArrayBuffer(1)))!=at||ei&&qo(new ei)!=G||ni&&"[object Promise]"!=qo(ni.resolve())||ii&&qo(new ii)!=tt||ri&&qo(new ri)!=rt)&&(qo=function(e){var n=er(e),i=n==X?e.constructor:t,r=i?ps(i):"";if(r)switch(r){case ui:return at;case li:return G;case ci:return"[object Promise]";case fi:return tt;case hi:return rt}return n});var Zo=le?Ea:qu;function ts(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ue)}function es(t){return t==t&&!Oa(t)}function ns(e,n){return function(i){return null!=i&&i[e]===n&&(n!==t||e in ne(i))}}function is(e,n,i){return n=Gn(n===t?e.length-1:n,0),function(){for(var t=arguments,r=-1,o=Gn(t.length-n,0),s=Xt(o);++r<o;)s[r]=t[n+r];r=-1;for(var a=Xt(n+1);++r<n;)a[r]=t[r];return a[n]=i(s),ze(e,this,a)}}function rs(t,e){return e.length<2?t:Zi(t,Lr(e,0,-1))}var os=ls(Pr),ss=Hn||function(t,e){return De.setTimeout(t,e)},as=ls(Ar);function us(t,e,n){var i=e+"";return as(t,function(t,e){var n=e.length;if(!n)return t;var i=n-1;return e[i]=(n>1?"& ":"")+e[i],e=e.join(n>2?", ":" "),t.replace(Mt,"{\n/* [wrapped with "+e+"] */\n")}(i,function(t,e){return Ge($,function(n){var i="_."+n[0];e&n[1]&&!Je(t,i)&&t.push(i)}),t.sort()}(function(t){var e=t.match(Ft);return e?e[1].split($t):[]}(i),n)))}function ls(e){var n=0,i=0;return function(){var r=Qn(),o=T-(r-i);if(i=r,o>0){if(++n>=C)return arguments[0]}else n=0;return e.apply(t,arguments)}}function cs(e,n){var i=-1,r=e.length,o=r-1;for(n=n===t?r:n;++i<n;){var s=xr(i,o),a=e[s];e[s]=e[i],e[i]=a}return e.length=n,e}var fs=function(t){var e=la(t,function(t){return n.size===u&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return Ot.test(t)&&e.push(""),t.replace(Pt,function(t,n,i,r){e.push(i?r.replace(Ht,"$1"):n||t)}),e});function hs(t){if("string"==typeof t||Fa(t))return t;var e=t+"";return"0"==e&&1/t==-A?"-0":e}function ps(t){if(null!=t){try{return ce.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function ds(t){if(t instanceof bi)return t.clone();var e=new _i(t.__wrapped__,t.__chain__);return e.__actions__=oo(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var ms=Er(function(t,e){return ka(t)?Bi(t,Ui(e,1,ka,!0)):[]}),vs=Er(function(e,n){var i=js(n);return ka(i)&&(i=t),ka(e)?Bi(e,Ui(n,1,ka,!0),Ro(i,2)):[]}),gs=Er(function(e,n){var i=js(n);return ka(i)&&(i=t),ka(e)?Bi(e,Ui(n,1,ka,!0),t,i):[]});function ys(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:Ya(n);return r<0&&(r=Gn(i+r,0)),un(t,Ro(e,3),r)}function _s(e,n,i){var r=null==e?0:e.length;if(!r)return-1;var o=r-1;return i!==t&&(o=Ya(i),o=i<0?Gn(r+o,0):Kn(o,r-1)),un(e,Ro(n,3),o,!0)}function bs(t){return null!=t&&t.length?Ui(t,1):[]}function ws(e){return e&&e.length?e[0]:t}var ks=Er(function(t){var e=tn(t,Ur);return e.length&&e[0]===t[0]?or(e):[]}),Ss=Er(function(e){var n=js(e),i=tn(e,Ur);return n===js(i)?n=t:i.pop(),i.length&&i[0]===e[0]?or(i,Ro(n,2)):[]}),xs=Er(function(e){var n=js(e),i=tn(e,Ur);return(n="function"==typeof n?n:t)&&i.pop(),i.length&&i[0]===e[0]?or(i,t,n):[]});function js(e){var n=null==e?0:e.length;return n?e[n-1]:t}var Es=Er(Cs);function Cs(t,e){return t&&t.length&&e&&e.length?kr(t,e):t}var Ts=Lo(function(t,e){var n=null==t?0:t.length,i=Mi(t,e);return Sr(t,tn(e,function(t){return Ko(t,n)?+t:t}).sort(no)),i});function Os(t){return null==t?t:Zn.call(t)}var Ps=Er(function(t){return Hr(Ui(t,1,ka,!0))}),As=Er(function(e){var n=js(e);return ka(n)&&(n=t),Hr(Ui(e,1,ka,!0),Ro(n,2))}),Ds=Er(function(e){var n=js(e);return n="function"==typeof n?n:t,Hr(Ui(e,1,ka,!0),t,n)});function Ls(t){if(!t||!t.length)return[];var e=0;return t=Xe(t,function(t){if(ka(t))return e=Gn(t.length,e),!0}),gn(e,function(e){return tn(t,pn(e))})}function Ns(e,n){if(!e||!e.length)return[];var i=Ls(e);return null==n?i:tn(i,function(e){return ze(n,t,e)})}var Is=Er(function(t,e){return ka(t)?Bi(t,e):[]}),Ms=Er(function(t){return qr(Xe(t,ka))}),Fs=Er(function(e){var n=js(e);return ka(n)&&(n=t),qr(Xe(e,ka),Ro(n,2))}),$s=Er(function(e){var n=js(e);return n="function"==typeof n?n:t,qr(Xe(e,ka),t,n)}),Rs=Er(Ls);var Hs=Er(function(e){var n=e.length,i=n>1?e[n-1]:t;return Ns(e,i="function"==typeof i?(e.pop(),i):t)});function Bs(t){var e=vi(t);return e.__chain__=!0,e}function Ws(t,e){return e(t)}var Ys=Lo(function(e){var n=e.length,i=n?e[0]:0,r=this.__wrapped__,o=function(t){return Mi(t,e)};return!(n>1||this.__actions__.length)&&r instanceof bi&&Ko(i)?((r=r.slice(i,+i+(n?1:0))).__actions__.push({func:Ws,args:[o],thisArg:t}),new _i(r,this.__chain__).thru(function(e){return n&&!e.length&&e.push(t),e})):this.thru(o)});var Vs=ao(function(t,e,n){fe.call(t,n)?++t[n]:Ii(t,n,1)});var qs=mo(ys),zs=mo(_s);function Us(t,e){return(_a(t)?Ge:Wi)(t,Ro(e,3))}function Gs(t,e){return(_a(t)?Ke:Yi)(t,Ro(e,3))}var Ks=ao(function(t,e,n){fe.call(t,n)?t[n].push(e):Ii(t,n,[e])});var Qs=Er(function(t,e,n){var i=-1,r="function"==typeof e,o=wa(t)?Xt(t.length):[];return Wi(t,function(t){o[++i]=r?ze(e,t,n):sr(t,e,n)}),o}),Xs=ao(function(t,e,n){Ii(t,n,e)});function Js(t,e){return(_a(t)?tn:mr)(t,Ro(e,3))}var Zs=ao(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var ta=Er(function(t,e){if(null==t)return[];var n=e.length;return n>1&&Qo(t,e[0],e[1])?e=[]:n>2&&Qo(e[0],e[1],e[2])&&(e=[e[0]]),br(t,Ui(e,1),[])}),ea=Rn||function(){return De.Date.now()};function na(e,n,i){return n=i?t:n,n=e&&null==n?e.length:n,To(e,k,t,t,t,t,n)}function ia(e,n){var i;if("function"!=typeof n)throw new oe(s);return e=Ya(e),function(){return--e>0&&(i=n.apply(this,arguments)),e<=1&&(n=t),i}}var ra=Er(function(t,e,n){var i=m;if(n.length){var r=On(n,$o(ra));i|=b}return To(t,i,e,n,r)}),oa=Er(function(t,e,n){var i=m|v;if(n.length){var r=On(n,$o(oa));i|=b}return To(e,i,t,n,r)});function sa(e,n,i){var r,o,a,u,l,c,f=0,h=!1,p=!1,d=!0;if("function"!=typeof e)throw new oe(s);function m(n){var i=r,s=o;return r=o=t,f=n,u=e.apply(s,i)}function v(e){var i=e-c;return c===t||i>=n||i<0||p&&e-f>=a}function g(){var t=ea();if(v(t))return y(t);l=ss(g,function(t){var e=n-(t-c);return p?Kn(e,a-(t-f)):e}(t))}function y(e){return l=t,d&&r?m(e):(r=o=t,u)}function _(){var e=ea(),i=v(e);if(r=arguments,o=this,c=e,i){if(l===t)return function(t){return f=t,l=ss(g,n),h?m(t):u}(c);if(p)return l=ss(g,n),m(c)}return l===t&&(l=ss(g,n)),u}return n=qa(n)||0,Oa(i)&&(h=!!i.leading,a=(p="maxWait"in i)?Gn(qa(i.maxWait)||0,n):a,d="trailing"in i?!!i.trailing:d),_.cancel=function(){l!==t&&Jr(l),f=0,r=c=o=l=t},_.flush=function(){return l===t?u:y(ea())},_}var aa=Er(function(t,e){return Hi(t,1,e)}),ua=Er(function(t,e,n){return Hi(t,qa(e)||0,n)});function la(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new oe(s);var n=function(){var i=arguments,r=e?e.apply(this,i):i[0],o=n.cache;if(o.has(r))return o.get(r);var s=t.apply(this,i);return n.cache=o.set(r,s)||o,s};return n.cache=new(la.Cache||Si),n}function ca(t){if("function"!=typeof t)throw new oe(s);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}la.Cache=Si;var fa=Qr(function(t,e){var n=(e=1==e.length&&_a(e[0])?tn(e[0],yn(Ro())):tn(Ui(e,1),yn(Ro()))).length;return Er(function(i){for(var r=-1,o=Kn(i.length,n);++r<o;)i[r]=e[r].call(this,i[r]);return ze(t,this,i)})}),ha=Er(function(e,n){var i=On(n,$o(ha));return To(e,b,t,n,i)}),pa=Er(function(e,n){var i=On(n,$o(pa));return To(e,w,t,n,i)}),da=Lo(function(e,n){return To(e,S,t,t,t,n)});function ma(t,e){return t===e||t!=t&&e!=e}var va=So(nr),ga=So(function(t,e){return t>=e}),ya=ar(function(){return arguments}())?ar:function(t){return Pa(t)&&fe.call(t,"callee")&&!Me.call(t,"callee")},_a=Xt.isArray,ba=$e?yn($e):function(t){return Pa(t)&&er(t)==st};function wa(t){return null!=t&&Ta(t.length)&&!Ea(t)}function ka(t){return Pa(t)&&wa(t)}var Sa=Vn||qu,xa=Re?yn(Re):function(t){return Pa(t)&&er(t)==Y};function ja(t){if(!Pa(t))return!1;var e=er(t);return e==q||e==V||"string"==typeof t.message&&"string"==typeof t.name&&!La(t)}function Ea(t){if(!Oa(t))return!1;var e=er(t);return e==z||e==U||e==B||e==J}function Ca(t){return"number"==typeof t&&t==Ya(t)}function Ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=D}function Oa(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Pa(t){return null!=t&&"object"==typeof t}var Aa=He?yn(He):function(t){return Pa(t)&&qo(t)==G};function Da(t){return"number"==typeof t||Pa(t)&&er(t)==K}function La(t){if(!Pa(t)||er(t)!=X)return!1;var e=Le(t);if(null===e)return!0;var n=fe.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ce.call(n)==me}var Na=Be?yn(Be):function(t){return Pa(t)&&er(t)==Z};var Ia=We?yn(We):function(t){return Pa(t)&&qo(t)==tt};function Ma(t){return"string"==typeof t||!_a(t)&&Pa(t)&&er(t)==et}function Fa(t){return"symbol"==typeof t||Pa(t)&&er(t)==nt}var $a=Ye?yn(Ye):function(t){return Pa(t)&&Ta(t.length)&&!!je[er(t)]};var Ra=So(dr),Ha=So(function(t,e){return t<=e});function Ba(t){if(!t)return[];if(wa(t))return Ma(t)?Ln(t):oo(t);if(dn&&t[dn])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[dn]());var e=qo(t);return(e==G?Cn:e==tt?Pn:mu)(t)}function Wa(t){return t?(t=qa(t))===A||t===-A?(t<0?-1:1)*L:t==t?t:0:0===t?t:0}function Ya(t){var e=Wa(t),n=e%1;return e==e?n?e-n:e:0}function Va(t){return t?Fi(Ya(t),0,I):0}function qa(t){if("number"==typeof t)return t;if(Fa(t))return N;if(Oa(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Oa(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Lt,"");var n=Vt.test(t);return n||zt.test(t)?Oe(t.slice(2),n?2:8):Yt.test(t)?N:+t}function za(t){return so(t,au(t))}function Ua(t){return null==t?"":Rr(t)}var Ga=uo(function(t,e){if(ts(e)||wa(e))so(e,su(e),t);else for(var n in e)fe.call(e,n)&&Ai(t,n,e[n])}),Ka=uo(function(t,e){so(e,au(e),t)}),Qa=uo(function(t,e,n,i){so(e,au(e),t,i)}),Xa=uo(function(t,e,n,i){so(e,su(e),t,i)}),Ja=Lo(Mi);var Za=Er(function(e){return e.push(t,Oo),ze(Qa,t,e)}),tu=Er(function(e){return e.push(t,Po),ze(lu,t,e)});function eu(e,n,i){var r=null==e?t:Zi(e,n);return r===t?i:r}function nu(t,e){return null!=t&&zo(t,e,rr)}var iu=yo(function(t,e,n){t[e]=n},Ou(Du)),ru=yo(function(t,e,n){fe.call(t,e)?t[e].push(n):t[e]=[n]},Ro),ou=Er(sr);function su(t){return wa(t)?Ei(t):hr(t)}function au(t){return wa(t)?Ei(t,!0):pr(t)}var uu=uo(function(t,e,n){yr(t,e,n)}),lu=uo(function(t,e,n,i){yr(t,e,n,i)}),cu=Lo(function(t,e){var n={};if(null==t)return n;var i=!1;e=tn(e,function(e){return e=Kr(e,t),i||(i=e.length>1),e}),so(t,Io(t),n),i&&(n=$i(n,c|f|h,Ao));for(var r=e.length;r--;)Br(n,e[r]);return n});var fu=Lo(function(t,e){return null==t?{}:function(t,e){return wr(t,e,function(e,n){return nu(t,n)})}(t,e)});function hu(t,e){if(null==t)return{};var n=tn(Io(t),function(t){return[t]});return e=Ro(e),wr(t,n,function(t,n){return e(t,n[0])})}var pu=Co(su),du=Co(au);function mu(t){return null==t?[]:_n(t,su(t))}var vu=ho(function(t,e,n){return e=e.toLowerCase(),t+(n?gu(e):e)});function gu(t){return ju(Ua(t).toLowerCase())}function yu(t){return(t=Ua(t))&&t.replace(Gt,Sn).replace(ye,"")}var _u=ho(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),bu=ho(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),wu=fo("toLowerCase");var ku=ho(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var Su=ho(function(t,e,n){return t+(n?" ":"")+ju(e)});var xu=ho(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),ju=fo("toUpperCase");function Eu(e,n,i){return e=Ua(e),(n=i?t:n)===t?function(t){return ke.test(t)}(e)?function(t){return t.match(be)||[]}(e):function(t){return t.match(Rt)||[]}(e):e.match(n)||[]}var Cu=Er(function(e,n){try{return ze(e,t,n)}catch(t){return ja(t)?t:new Zt(t)}}),Tu=Lo(function(t,e){return Ge(e,function(e){e=hs(e),Ii(t,e,ra(t[e],t))}),t});function Ou(t){return function(){return t}}var Pu=vo(),Au=vo(!0);function Du(t){return t}function Lu(t){return fr("function"==typeof t?t:$i(t,c))}var Nu=Er(function(t,e){return function(n){return sr(n,t,e)}}),Iu=Er(function(t,e){return function(n){return sr(t,n,e)}});function Mu(t,e,n){var i=su(e),r=Ji(e,i);null!=n||Oa(e)&&(r.length||!i.length)||(n=e,e=t,t=this,r=Ji(e,su(e)));var o=!(Oa(n)&&"chain"in n&&!n.chain),s=Ea(t);return Ge(r,function(n){var i=e[n];t[n]=i,s&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__);return(n.__actions__=oo(this.__actions__)).push({func:i,args:arguments,thisArg:t}),n.__chain__=e,n}return i.apply(t,en([this.value()],arguments))})}),t}function Fu(){}var $u=bo(tn),Ru=bo(Qe),Hu=bo(on);function Bu(t){return Xo(t)?pn(hs(t)):function(t){return function(e){return Zi(e,t)}}(t)}var Wu=ko(),Yu=ko(!0);function Vu(){return[]}function qu(){return!1}var zu=_o(function(t,e){return t+e},0),Uu=jo("ceil"),Gu=_o(function(t,e){return t/e},1),Ku=jo("floor");var Qu,Xu=_o(function(t,e){return t*e},1),Ju=jo("round"),Zu=_o(function(t,e){return t-e},0);return vi.after=function(t,e){if("function"!=typeof e)throw new oe(s);return t=Ya(t),function(){if(--t<1)return e.apply(this,arguments)}},vi.ary=na,vi.assign=Ga,vi.assignIn=Ka,vi.assignInWith=Qa,vi.assignWith=Xa,vi.at=Ja,vi.before=ia,vi.bind=ra,vi.bindAll=Tu,vi.bindKey=oa,vi.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return _a(t)?t:[t]},vi.chain=Bs,vi.chunk=function(e,n,i){n=(i?Qo(e,n,i):n===t)?1:Gn(Ya(n),0);var r=null==e?0:e.length;if(!r||n<1)return[];for(var o=0,s=0,a=Xt(Bn(r/n));o<r;)a[s++]=Lr(e,o,o+=n);return a},vi.compact=function(t){for(var e=-1,n=null==t?0:t.length,i=0,r=[];++e<n;){var o=t[e];o&&(r[i++]=o)}return r},vi.concat=function(){var t=arguments.length;if(!t)return[];for(var e=Xt(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return en(_a(n)?oo(n):[n],Ui(e,1))},vi.cond=function(t){var e=null==t?0:t.length,n=Ro();return t=e?tn(t,function(t){if("function"!=typeof t[1])throw new oe(s);return[n(t[0]),t[1]]}):[],Er(function(n){for(var i=-1;++i<e;){var r=t[i];if(ze(r[0],this,n))return ze(r[1],this,n)}})},vi.conforms=function(t){return function(t){var e=su(t);return function(n){return Ri(n,t,e)}}($i(t,c))},vi.constant=Ou,vi.countBy=Vs,vi.create=function(t,e){var n=gi(t);return null==e?n:Ni(n,e)},vi.curry=function e(n,i,r){var o=To(n,y,t,t,t,t,t,i=r?t:i);return o.placeholder=e.placeholder,o},vi.curryRight=function e(n,i,r){var o=To(n,_,t,t,t,t,t,i=r?t:i);return o.placeholder=e.placeholder,o},vi.debounce=sa,vi.defaults=Za,vi.defaultsDeep=tu,vi.defer=aa,vi.delay=ua,vi.difference=ms,vi.differenceBy=vs,vi.differenceWith=gs,vi.drop=function(e,n,i){var r=null==e?0:e.length;return r?Lr(e,(n=i||n===t?1:Ya(n))<0?0:n,r):[]},vi.dropRight=function(e,n,i){var r=null==e?0:e.length;return r?Lr(e,0,(n=r-(n=i||n===t?1:Ya(n)))<0?0:n):[]},vi.dropRightWhile=function(t,e){return t&&t.length?Yr(t,Ro(e,3),!0,!0):[]},vi.dropWhile=function(t,e){return t&&t.length?Yr(t,Ro(e,3),!0):[]},vi.fill=function(e,n,i,r){var o=null==e?0:e.length;return o?(i&&"number"!=typeof i&&Qo(e,n,i)&&(i=0,r=o),function(e,n,i,r){var o=e.length;for((i=Ya(i))<0&&(i=-i>o?0:o+i),(r=r===t||r>o?o:Ya(r))<0&&(r+=o),r=i>r?0:Va(r);i<r;)e[i++]=n;return e}(e,n,i,r)):[]},vi.filter=function(t,e){return(_a(t)?Xe:zi)(t,Ro(e,3))},vi.flatMap=function(t,e){return Ui(Js(t,e),1)},vi.flatMapDeep=function(t,e){return Ui(Js(t,e),A)},vi.flatMapDepth=function(e,n,i){return i=i===t?1:Ya(i),Ui(Js(e,n),i)},vi.flatten=bs,vi.flattenDeep=function(t){return null!=t&&t.length?Ui(t,A):[]},vi.flattenDepth=function(e,n){return null!=e&&e.length?Ui(e,n=n===t?1:Ya(n)):[]},vi.flip=function(t){return To(t,x)},vi.flow=Pu,vi.flowRight=Au,vi.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,i={};++e<n;){var r=t[e];i[r[0]]=r[1]}return i},vi.functions=function(t){return null==t?[]:Ji(t,su(t))},vi.functionsIn=function(t){return null==t?[]:Ji(t,au(t))},vi.groupBy=Ks,vi.initial=function(t){return null!=t&&t.length?Lr(t,0,-1):[]},vi.intersection=ks,vi.intersectionBy=Ss,vi.intersectionWith=xs,vi.invert=iu,vi.invertBy=ru,vi.invokeMap=Qs,vi.iteratee=Lu,vi.keyBy=Xs,vi.keys=su,vi.keysIn=au,vi.map=Js,vi.mapKeys=function(t,e){var n={};return e=Ro(e,3),Qi(t,function(t,i,r){Ii(n,e(t,i,r),t)}),n},vi.mapValues=function(t,e){var n={};return e=Ro(e,3),Qi(t,function(t,i,r){Ii(n,i,e(t,i,r))}),n},vi.matches=function(t){return vr($i(t,c))},vi.matchesProperty=function(t,e){return gr(t,$i(e,c))},vi.memoize=la,vi.merge=uu,vi.mergeWith=lu,vi.method=Nu,vi.methodOf=Iu,vi.mixin=Mu,vi.negate=ca,vi.nthArg=function(t){return t=Ya(t),Er(function(e){return _r(e,t)})},vi.omit=cu,vi.omitBy=function(t,e){return hu(t,ca(Ro(e)))},vi.once=function(t){return ia(2,t)},vi.orderBy=function(e,n,i,r){return null==e?[]:(_a(n)||(n=null==n?[]:[n]),_a(i=r?t:i)||(i=null==i?[]:[i]),br(e,n,i))},vi.over=$u,vi.overArgs=fa,vi.overEvery=Ru,vi.overSome=Hu,vi.partial=ha,vi.partialRight=pa,vi.partition=Zs,vi.pick=fu,vi.pickBy=hu,vi.property=Bu,vi.propertyOf=function(e){return function(n){return null==e?t:Zi(e,n)}},vi.pull=Es,vi.pullAll=Cs,vi.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?kr(t,e,Ro(n,2)):t},vi.pullAllWith=function(e,n,i){return e&&e.length&&n&&n.length?kr(e,n,t,i):e},vi.pullAt=Ts,vi.range=Wu,vi.rangeRight=Yu,vi.rearg=da,vi.reject=function(t,e){return(_a(t)?Xe:zi)(t,ca(Ro(e,3)))},vi.remove=function(t,e){var n=[];if(!t||!t.length)return n;var i=-1,r=[],o=t.length;for(e=Ro(e,3);++i<o;){var s=t[i];e(s,i,t)&&(n.push(s),r.push(i))}return Sr(t,r),n},vi.rest=function(e,n){if("function"!=typeof e)throw new oe(s);return Er(e,n=n===t?n:Ya(n))},vi.reverse=Os,vi.sampleSize=function(e,n,i){return n=(i?Qo(e,n,i):n===t)?1:Ya(n),(_a(e)?Ti:Tr)(e,n)},vi.set=function(t,e,n){return null==t?t:Or(t,e,n)},vi.setWith=function(e,n,i,r){return r="function"==typeof r?r:t,null==e?e:Or(e,n,i,r)},vi.shuffle=function(t){return(_a(t)?Oi:Dr)(t)},vi.slice=function(e,n,i){var r=null==e?0:e.length;return r?(i&&"number"!=typeof i&&Qo(e,n,i)?(n=0,i=r):(n=null==n?0:Ya(n),i=i===t?r:Ya(i)),Lr(e,n,i)):[]},vi.sortBy=ta,vi.sortedUniq=function(t){return t&&t.length?Fr(t):[]},vi.sortedUniqBy=function(t,e){return t&&t.length?Fr(t,Ro(e,2)):[]},vi.split=function(e,n,i){return i&&"number"!=typeof i&&Qo(e,n,i)&&(n=i=t),(i=i===t?I:i>>>0)?(e=Ua(e))&&("string"==typeof n||null!=n&&!Na(n))&&!(n=Rr(n))&&En(e)?Xr(Ln(e),0,i):e.split(n,i):[]},vi.spread=function(t,e){if("function"!=typeof t)throw new oe(s);return e=null==e?0:Gn(Ya(e),0),Er(function(n){var i=n[e],r=Xr(n,0,e);return i&&en(r,i),ze(t,this,r)})},vi.tail=function(t){var e=null==t?0:t.length;return e?Lr(t,1,e):[]},vi.take=function(e,n,i){return e&&e.length?Lr(e,0,(n=i||n===t?1:Ya(n))<0?0:n):[]},vi.takeRight=function(e,n,i){var r=null==e?0:e.length;return r?Lr(e,(n=r-(n=i||n===t?1:Ya(n)))<0?0:n,r):[]},vi.takeRightWhile=function(t,e){return t&&t.length?Yr(t,Ro(e,3),!1,!0):[]},vi.takeWhile=function(t,e){return t&&t.length?Yr(t,Ro(e,3)):[]},vi.tap=function(t,e){return e(t),t},vi.throttle=function(t,e,n){var i=!0,r=!0;if("function"!=typeof t)throw new oe(s);return Oa(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),sa(t,e,{leading:i,maxWait:e,trailing:r})},vi.thru=Ws,vi.toArray=Ba,vi.toPairs=pu,vi.toPairsIn=du,vi.toPath=function(t){return _a(t)?tn(t,hs):Fa(t)?[t]:oo(fs(Ua(t)))},vi.toPlainObject=za,vi.transform=function(t,e,n){var i=_a(t),r=i||Sa(t)||$a(t);if(e=Ro(e,4),null==n){var o=t&&t.constructor;n=r?i?new o:[]:Oa(t)&&Ea(o)?gi(Le(t)):{}}return(r?Ge:Qi)(t,function(t,i,r){return e(n,t,i,r)}),n},vi.unary=function(t){return na(t,1)},vi.union=Ps,vi.unionBy=As,vi.unionWith=Ds,vi.uniq=function(t){return t&&t.length?Hr(t):[]},vi.uniqBy=function(t,e){return t&&t.length?Hr(t,Ro(e,2)):[]},vi.uniqWith=function(e,n){return n="function"==typeof n?n:t,e&&e.length?Hr(e,t,n):[]},vi.unset=function(t,e){return null==t||Br(t,e)},vi.unzip=Ls,vi.unzipWith=Ns,vi.update=function(t,e,n){return null==t?t:Wr(t,e,Gr(n))},vi.updateWith=function(e,n,i,r){return r="function"==typeof r?r:t,null==e?e:Wr(e,n,Gr(i),r)},vi.values=mu,vi.valuesIn=function(t){return null==t?[]:_n(t,au(t))},vi.without=Is,vi.words=Eu,vi.wrap=function(t,e){return ha(Gr(e),t)},vi.xor=Ms,vi.xorBy=Fs,vi.xorWith=$s,vi.zip=Rs,vi.zipObject=function(t,e){return zr(t||[],e||[],Ai)},vi.zipObjectDeep=function(t,e){return zr(t||[],e||[],Or)},vi.zipWith=Hs,vi.entries=pu,vi.entriesIn=du,vi.extend=Ka,vi.extendWith=Qa,Mu(vi,vi),vi.add=zu,vi.attempt=Cu,vi.camelCase=vu,vi.capitalize=gu,vi.ceil=Uu,vi.clamp=function(e,n,i){return i===t&&(i=n,n=t),i!==t&&(i=(i=qa(i))==i?i:0),n!==t&&(n=(n=qa(n))==n?n:0),Fi(qa(e),n,i)},vi.clone=function(t){return $i(t,h)},vi.cloneDeep=function(t){return $i(t,c|h)},vi.cloneDeepWith=function(e,n){return $i(e,c|h,n="function"==typeof n?n:t)},vi.cloneWith=function(e,n){return $i(e,h,n="function"==typeof n?n:t)},vi.conformsTo=function(t,e){return null==e||Ri(t,e,su(e))},vi.deburr=yu,vi.defaultTo=function(t,e){return null==t||t!=t?e:t},vi.divide=Gu,vi.endsWith=function(e,n,i){e=Ua(e),n=Rr(n);var r=e.length,o=i=i===t?r:Fi(Ya(i),0,r);return(i-=n.length)>=0&&e.slice(i,o)==n},vi.eq=ma,vi.escape=function(t){return(t=Ua(t))&&St.test(t)?t.replace(wt,xn):t},vi.escapeRegExp=function(t){return(t=Ua(t))&&Dt.test(t)?t.replace(At,"\\$&"):t},vi.every=function(e,n,i){var r=_a(e)?Qe:Vi;return i&&Qo(e,n,i)&&(n=t),r(e,Ro(n,3))},vi.find=qs,vi.findIndex=ys,vi.findKey=function(t,e){return an(t,Ro(e,3),Qi)},vi.findLast=zs,vi.findLastIndex=_s,vi.findLastKey=function(t,e){return an(t,Ro(e,3),Xi)},vi.floor=Ku,vi.forEach=Us,vi.forEachRight=Gs,vi.forIn=function(t,e){return null==t?t:Gi(t,Ro(e,3),au)},vi.forInRight=function(t,e){return null==t?t:Ki(t,Ro(e,3),au)},vi.forOwn=function(t,e){return t&&Qi(t,Ro(e,3))},vi.forOwnRight=function(t,e){return t&&Xi(t,Ro(e,3))},vi.get=eu,vi.gt=va,vi.gte=ga,vi.has=function(t,e){return null!=t&&zo(t,e,ir)},vi.hasIn=nu,vi.head=ws,vi.identity=Du,vi.includes=function(t,e,n,i){t=wa(t)?t:mu(t),n=n&&!i?Ya(n):0;var r=t.length;return n<0&&(n=Gn(r+n,0)),Ma(t)?n<=r&&t.indexOf(e,n)>-1:!!r&&ln(t,e,n)>-1},vi.indexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var r=null==n?0:Ya(n);return r<0&&(r=Gn(i+r,0)),ln(t,e,r)},vi.inRange=function(e,n,i){return n=Wa(n),i===t?(i=n,n=0):i=Wa(i),function(t,e,n){return t>=Kn(e,n)&&t<Gn(e,n)}(e=qa(e),n,i)},vi.invoke=ou,vi.isArguments=ya,vi.isArray=_a,vi.isArrayBuffer=ba,vi.isArrayLike=wa,vi.isArrayLikeObject=ka,vi.isBoolean=function(t){return!0===t||!1===t||Pa(t)&&er(t)==W},vi.isBuffer=Sa,vi.isDate=xa,vi.isElement=function(t){return Pa(t)&&1===t.nodeType&&!La(t)},vi.isEmpty=function(t){if(null==t)return!0;if(wa(t)&&(_a(t)||"string"==typeof t||"function"==typeof t.splice||Sa(t)||$a(t)||ya(t)))return!t.length;var e=qo(t);if(e==G||e==tt)return!t.size;if(ts(t))return!hr(t).length;for(var n in t)if(fe.call(t,n))return!1;return!0},vi.isEqual=function(t,e){return ur(t,e)},vi.isEqualWith=function(e,n,i){var r=(i="function"==typeof i?i:t)?i(e,n):t;return r===t?ur(e,n,t,i):!!r},vi.isError=ja,vi.isFinite=function(t){return"number"==typeof t&&qn(t)},vi.isFunction=Ea,vi.isInteger=Ca,vi.isLength=Ta,vi.isMap=Aa,vi.isMatch=function(t,e){return t===e||lr(t,e,Bo(e))},vi.isMatchWith=function(e,n,i){return i="function"==typeof i?i:t,lr(e,n,Bo(n),i)},vi.isNaN=function(t){return Da(t)&&t!=+t},vi.isNative=function(t){if(Zo(t))throw new Zt(o);return cr(t)},vi.isNil=function(t){return null==t},vi.isNull=function(t){return null===t},vi.isNumber=Da,vi.isObject=Oa,vi.isObjectLike=Pa,vi.isPlainObject=La,vi.isRegExp=Na,vi.isSafeInteger=function(t){return Ca(t)&&t>=-D&&t<=D},vi.isSet=Ia,vi.isString=Ma,vi.isSymbol=Fa,vi.isTypedArray=$a,vi.isUndefined=function(e){return e===t},vi.isWeakMap=function(t){return Pa(t)&&qo(t)==rt},vi.isWeakSet=function(t){return Pa(t)&&er(t)==ot},vi.join=function(t,e){return null==t?"":zn.call(t,e)},vi.kebabCase=_u,vi.last=js,vi.lastIndexOf=function(e,n,i){var r=null==e?0:e.length;if(!r)return-1;var o=r;return i!==t&&(o=(o=Ya(i))<0?Gn(r+o,0):Kn(o,r-1)),n==n?function(t,e,n){for(var i=n+1;i--;)if(t[i]===e)return i;return i}(e,n,o):un(e,fn,o,!0)},vi.lowerCase=bu,vi.lowerFirst=wu,vi.lt=Ra,vi.lte=Ha,vi.max=function(e){return e&&e.length?qi(e,Du,nr):t},vi.maxBy=function(e,n){return e&&e.length?qi(e,Ro(n,2),nr):t},vi.mean=function(t){return hn(t,Du)},vi.meanBy=function(t,e){return hn(t,Ro(e,2))},vi.min=function(e){return e&&e.length?qi(e,Du,dr):t},vi.minBy=function(e,n){return e&&e.length?qi(e,Ro(n,2),dr):t},vi.stubArray=Vu,vi.stubFalse=qu,vi.stubObject=function(){return{}},vi.stubString=function(){return""},vi.stubTrue=function(){return!0},vi.multiply=Xu,vi.nth=function(e,n){return e&&e.length?_r(e,Ya(n)):t},vi.noConflict=function(){return De._===this&&(De._=ve),this},vi.noop=Fu,vi.now=ea,vi.pad=function(t,e,n){t=Ua(t);var i=(e=Ya(e))?Dn(t):0;if(!e||i>=e)return t;var r=(e-i)/2;return wo(Wn(r),n)+t+wo(Bn(r),n)},vi.padEnd=function(t,e,n){t=Ua(t);var i=(e=Ya(e))?Dn(t):0;return e&&i<e?t+wo(e-i,n):t},vi.padStart=function(t,e,n){t=Ua(t);var i=(e=Ya(e))?Dn(t):0;return e&&i<e?wo(e-i,n)+t:t},vi.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),Xn(Ua(t).replace(Nt,""),e||0)},vi.random=function(e,n,i){if(i&&"boolean"!=typeof i&&Qo(e,n,i)&&(n=i=t),i===t&&("boolean"==typeof n?(i=n,n=t):"boolean"==typeof e&&(i=e,e=t)),e===t&&n===t?(e=0,n=1):(e=Wa(e),n===t?(n=e,e=0):n=Wa(n)),e>n){var r=e;e=n,n=r}if(i||e%1||n%1){var o=Jn();return Kn(e+o*(n-e+Te("1e-"+((o+"").length-1))),n)}return xr(e,n)},vi.reduce=function(t,e,n){var i=_a(t)?nn:mn,r=arguments.length<3;return i(t,Ro(e,4),n,r,Wi)},vi.reduceRight=function(t,e,n){var i=_a(t)?rn:mn,r=arguments.length<3;return i(t,Ro(e,4),n,r,Yi)},vi.repeat=function(e,n,i){return n=(i?Qo(e,n,i):n===t)?1:Ya(n),jr(Ua(e),n)},vi.replace=function(){var t=arguments,e=Ua(t[0]);return t.length<3?e:e.replace(t[1],t[2])},vi.result=function(e,n,i){var r=-1,o=(n=Kr(n,e)).length;for(o||(o=1,e=t);++r<o;){var s=null==e?t:e[hs(n[r])];s===t&&(r=o,s=i),e=Ea(s)?s.call(e):s}return e},vi.round=Ju,vi.runInContext=e,vi.sample=function(t){return(_a(t)?Ci:Cr)(t)},vi.size=function(t){if(null==t)return 0;if(wa(t))return Ma(t)?Dn(t):t.length;var e=qo(t);return e==G||e==tt?t.size:hr(t).length},vi.snakeCase=ku,vi.some=function(e,n,i){var r=_a(e)?on:Nr;return i&&Qo(e,n,i)&&(n=t),r(e,Ro(n,3))},vi.sortedIndex=function(t,e){return Ir(t,e)},vi.sortedIndexBy=function(t,e,n){return Mr(t,e,Ro(n,2))},vi.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var i=Ir(t,e);if(i<n&&ma(t[i],e))return i}return-1},vi.sortedLastIndex=function(t,e){return Ir(t,e,!0)},vi.sortedLastIndexBy=function(t,e,n){return Mr(t,e,Ro(n,2),!0)},vi.sortedLastIndexOf=function(t,e){if(null!=t&&t.length){var n=Ir(t,e,!0)-1;if(ma(t[n],e))return n}return-1},vi.startCase=Su,vi.startsWith=function(t,e,n){return t=Ua(t),n=null==n?0:Fi(Ya(n),0,t.length),e=Rr(e),t.slice(n,n+e.length)==e},vi.subtract=Zu,vi.sum=function(t){return t&&t.length?vn(t,Du):0},vi.sumBy=function(t,e){return t&&t.length?vn(t,Ro(e,2)):0},vi.template=function(e,n,i){var r=vi.templateSettings;i&&Qo(e,n,i)&&(n=t),e=Ua(e),n=Qa({},n,r,Oo);var o,s,a=Qa({},n.imports,r.imports,Oo),u=su(a),l=_n(a,u),c=0,f=n.interpolate||Kt,h="__p += '",p=ie((n.escape||Kt).source+"|"+f.source+"|"+(f===Et?Bt:Kt).source+"|"+(n.evaluate||Kt).source+"|$","g"),d="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++xe+"]")+"\n";e.replace(p,function(t,n,i,r,a,u){return i||(i=r),h+=e.slice(c,u).replace(Qt,jn),n&&(o=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),i&&(h+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),h+="';\n";var m=n.variable;m||(h="with (obj) {\n"+h+"\n}\n"),h=(s?h.replace(gt,""):h).replace(yt,"$1").replace(_t,"$1;"),h="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var v=Cu(function(){return te(u,d+"return "+h).apply(t,l)});if(v.source=h,ja(v))throw v;return v},vi.times=function(t,e){if((t=Ya(t))<1||t>D)return[];var n=I,i=Kn(t,I);e=Ro(e),t-=I;for(var r=gn(i,e);++n<t;)e(n);return r},vi.toFinite=Wa,vi.toInteger=Ya,vi.toLength=Va,vi.toLower=function(t){return Ua(t).toLowerCase()},vi.toNumber=qa,vi.toSafeInteger=function(t){return t?Fi(Ya(t),-D,D):0===t?t:0},vi.toString=Ua,vi.toUpper=function(t){return Ua(t).toUpperCase()},vi.trim=function(e,n,i){if((e=Ua(e))&&(i||n===t))return e.replace(Lt,"");if(!e||!(n=Rr(n)))return e;var r=Ln(e),o=Ln(n);return Xr(r,wn(r,o),kn(r,o)+1).join("")},vi.trimEnd=function(e,n,i){if((e=Ua(e))&&(i||n===t))return e.replace(It,"");if(!e||!(n=Rr(n)))return e;var r=Ln(e);return Xr(r,0,kn(r,Ln(n))+1).join("")},vi.trimStart=function(e,n,i){if((e=Ua(e))&&(i||n===t))return e.replace(Nt,"");if(!e||!(n=Rr(n)))return e;var r=Ln(e);return Xr(r,wn(r,Ln(n))).join("")},vi.truncate=function(e,n){var i=j,r=E;if(Oa(n)){var o="separator"in n?n.separator:o;i="length"in n?Ya(n.length):i,r="omission"in n?Rr(n.omission):r}var s=(e=Ua(e)).length;if(En(e)){var a=Ln(e);s=a.length}if(i>=s)return e;var u=i-Dn(r);if(u<1)return r;var l=a?Xr(a,0,u).join(""):e.slice(0,u);if(o===t)return l+r;if(a&&(u+=l.length-u),Na(o)){if(e.slice(u).search(o)){var c,f=l;for(o.global||(o=ie(o.source,Ua(Wt.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var h=c.index;l=l.slice(0,h===t?u:h)}}else if(e.indexOf(Rr(o),u)!=u){var p=l.lastIndexOf(o);p>-1&&(l=l.slice(0,p))}return l+r},vi.unescape=function(t){return(t=Ua(t))&&kt.test(t)?t.replace(bt,Nn):t},vi.uniqueId=function(t){var e=++he;return Ua(t)+e},vi.upperCase=xu,vi.upperFirst=ju,vi.each=Us,vi.eachRight=Gs,vi.first=ws,Mu(vi,(Qu={},Qi(vi,function(t,e){fe.call(vi.prototype,e)||(Qu[e]=t)}),Qu),{chain:!1}),vi.VERSION="4.17.4",Ge(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){vi[t].placeholder=vi}),Ge(["drop","take"],function(e,n){bi.prototype[e]=function(i){i=i===t?1:Gn(Ya(i),0);var r=this.__filtered__&&!n?new bi(this):this.clone();return r.__filtered__?r.__takeCount__=Kn(i,r.__takeCount__):r.__views__.push({size:Kn(i,I),type:e+(r.__dir__<0?"Right":"")}),r},bi.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),Ge(["filter","map","takeWhile"],function(t,e){var n=e+1,i=n==O||3==n;bi.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Ro(t,3),type:n}),e.__filtered__=e.__filtered__||i,e}}),Ge(["head","last"],function(t,e){var n="take"+(e?"Right":"");bi.prototype[t]=function(){return this[n](1).value()[0]}}),Ge(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");bi.prototype[t]=function(){return this.__filtered__?new bi(this):this[n](1)}}),bi.prototype.compact=function(){return this.filter(Du)},bi.prototype.find=function(t){return this.filter(t).head()},bi.prototype.findLast=function(t){return this.reverse().find(t)},bi.prototype.invokeMap=Er(function(t,e){return"function"==typeof t?new bi(this):this.map(function(n){return sr(n,t,e)})}),bi.prototype.reject=function(t){return this.filter(ca(Ro(t)))},bi.prototype.slice=function(e,n){e=Ya(e);var i=this;return i.__filtered__&&(e>0||n<0)?new bi(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),n!==t&&(i=(n=Ya(n))<0?i.dropRight(-n):i.take(n-e)),i)},bi.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},bi.prototype.toArray=function(){return this.take(I)},Qi(bi.prototype,function(e,n){var i=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),o=vi[r?"take"+("last"==n?"Right":""):n],s=r||/^find/.test(n);o&&(vi.prototype[n]=function(){var n=this.__wrapped__,a=r?[1]:arguments,u=n instanceof bi,l=a[0],c=u||_a(n),f=function(t){var e=o.apply(vi,en([t],a));return r&&h?e[0]:e};c&&i&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,p=!!this.__actions__.length,d=s&&!h,m=u&&!p;if(!s&&c){n=m?n:new bi(this);var v=e.apply(n,a);return v.__actions__.push({func:Ws,args:[f],thisArg:t}),new _i(v,h)}return d&&m?e.apply(this,a):(v=this.thru(f),d?r?v.value()[0]:v.value():v)})}),Ge(["pop","push","shift","sort","splice","unshift"],function(t){var e=se[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",i=/^(?:pop|shift)$/.test(t);vi.prototype[t]=function(){var t=arguments;if(i&&!this.__chain__){var r=this.value();return e.apply(_a(r)?r:[],t)}return this[n](function(n){return e.apply(_a(n)?n:[],t)})}}),Qi(bi.prototype,function(t,e){var n=vi[e];if(n){var i=n.name+"";(ai[i]||(ai[i]=[])).push({name:e,func:n})}}),ai[go(t,v).name]=[{name:"wrapper",func:t}],bi.prototype.clone=function(){var t=new bi(this.__wrapped__);return t.__actions__=oo(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=oo(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=oo(this.__views__),t},bi.prototype.reverse=function(){if(this.__filtered__){var t=new bi(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},bi.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=_a(t),i=e<0,r=n?t.length:0,o=function(t,e,n){for(var i=-1,r=n.length;++i<r;){var o=n[i],s=o.size;switch(o.type){case"drop":t+=s;break;case"dropRight":e-=s;break;case"take":e=Kn(e,t+s);break;case"takeRight":t=Gn(t,e-s)}}return{start:t,end:e}}(0,r,this.__views__),s=o.start,a=o.end,u=a-s,l=i?a:s-1,c=this.__iteratees__,f=c.length,h=0,p=Kn(u,this.__takeCount__);if(!n||!i&&r==u&&p==u)return Vr(t,this.__actions__);var d=[];t:for(;u--&&h<p;){for(var m=-1,v=t[l+=e];++m<f;){var g=c[m],y=g.iteratee,_=g.type,b=y(v);if(_==P)v=b;else if(!b){if(_==O)continue t;break t}}d[h++]=v}return d},vi.prototype.at=Ys,vi.prototype.chain=function(){return Bs(this)},vi.prototype.commit=function(){return new _i(this.value(),this.__chain__)},vi.prototype.next=function(){this.__values__===t&&(this.__values__=Ba(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?t:this.__values__[this.__index__++]}},vi.prototype.plant=function(e){for(var n,i=this;i instanceof yi;){var r=ds(i);r.__index__=0,r.__values__=t,n?o.__wrapped__=r:n=r;var o=r;i=i.__wrapped__}return o.__wrapped__=e,n},vi.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof bi){var n=e;return this.__actions__.length&&(n=new bi(this)),(n=n.reverse()).__actions__.push({func:Ws,args:[Os],thisArg:t}),new _i(n,this.__chain__)}return this.thru(Os)},vi.prototype.toJSON=vi.prototype.valueOf=vi.prototype.value=function(){return Vr(this.__wrapped__,this.__actions__)},vi.prototype.first=vi.prototype.head,dn&&(vi.prototype[dn]=function(){return this}),vi}();"function"==typeof t&&"object"==typeof define.amd&&define.amd?(De._=In,define(function(){return In})):Ne?((Ne.exports=In)._=In,Le._=In):De._=In}).call(this)}(t("@empty").Buffer,t("@empty"))}),$__System.registerDynamic("npm:lodash@4.17.4.js",["npm:lodash@4.17.4/lodash.js"],!0,function(t,e,n){this||self;n.exports=t("npm:lodash@4.17.4/lodash.js")}),$__System.register("helpers/xml.js",["npm:lodash@4.17.4.js"],function(t){"use strict";var e,n,i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}();return{setters:[function(t){e=t.default}],execute:function(){n=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,null,[{key:"flatten",value:function(n){return e.isPlainObject(n)&&1===e.size(n)?t.flatten(e.values(n)[0]):n}},{key:"parse",value:function(n){var i={},r=3===n.nodeType,o=1===n.nodeType,s=n.textContent&&n.textContent.trim(),a=n.children&&n.children.length,u=n.attributes&&n.attributes.length;return r?n.nodeValue.trim():a||u?(!a&&s.length&&(i.text=s),o&&u&&(i.attributes=e.reduce(n.attributes,function(t,e,i){var r=n.attributes.item(i);return t[r.name]=r.value,t},{})),e.each(n.children,function(n){var r=n.nodeName;e.has(i,r)?(e.isArray(i[r])||(i[r]=[i[r]]),i[r].push(t.parse(n))):i[r]=t.parse(n)}),e.each(i.attributes,function(t,e){null==i[e]&&(i[e]=t,delete i.attributes[e])}),e.isEmpty(i.attributes)&&delete i.attributes,t.flatten(i)):s}}]),t}(),t("XML",n)}}}),$__System.register("helpers/helpers.js",["helpers/booleans.js","helpers/browser.js","helpers/colors.js","helpers/dates.js","helpers/element.js","helpers/objects.js","helpers/numbers.js","helpers/strings.js","helpers/uri.js","helpers/xml.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c;return{setters:[function(t){e=t.Booleans},function(t){n=t.Browser},function(t){i=t.Colors},function(t){r=t.Dates},function(t){o=t.Element},function(t){s=t.Objects},function(t){a=t.Numbers},function(t){u=t.Strings},function(t){l=t.URI},function(t){c=t.XML}],execute:function(){t("Helpers",{Booleans:e,Browser:n,Colors:i,Dates:r,Element:o,Numbers:a,Objects:s,Strings:u,URI:l,XML:c})}}}),$__System.registerDynamic("npm:iframe-resizer@3.5.16/js/iframeResizer.js",["github:jspm/nodelibs-process@0.1.2.js"],!0,function(t,e,n){"format cjs";this||self;t("github:jspm/nodelibs-process@0.1.2.js"),function(t){"use strict";if("undefined"!=typeof window){var e,i=0,r=!1,o=!1,s="message".length,a="[iFrameSizer]",u=a.length,l=null,c=window.requestAnimationFrame,f={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},h={},p=null,d={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",closedCallback:function(){},initCallback:function(){},messageCallback:function(){w("MessageCallback function not defined")},resizedCallback:function(){},scrollCallback:function(){return!0}};window.jQuery&&((e=window.jQuery).fn?e.fn.iFrameResize||(e.fn.iFrameResize=function(t){return this.filter("iframe").each(function(e,n){N(n,t)}).end()}):b("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof t&&define.amd?define([],R):"object"==typeof n&&"object"==typeof n.exports?n.exports=R():window.iFrameResize=window.iFrameResize||R()}function m(t,e,n){"addEventListener"in window?t.addEventListener(e,n,!1):"attachEvent"in window&&t.attachEvent("on"+e,n)}function v(t,e,n){"removeEventListener"in window?t.removeEventListener(e,n,!1):"detachEvent"in window&&t.detachEvent("on"+e,n)}function g(t){return a+"["+function(t){var e="Host page: "+t;return window.top!==window.self&&(e=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+t:"Nested host page: "+t),e}(t)+"]"}function y(t){return h[t]?h[t].log:r}function _(t,e){k("log",t,e,y(t))}function b(t,e){k("info",t,e,y(t))}function w(t,e){k("warn",t,e,!0)}function k(t,e,n,i){!0===i&&"object"==typeof window.console&&console[t](g(e),n)}function S(t){function e(){n("Height"),n("Width"),A(function(){P(S),C(N),p("resizedCallback",S)},S,"init")}function n(t){var e=Number(h[N]["max"+t]),n=Number(h[N]["min"+t]),i=t.toLowerCase(),r=Number(S[i]);_(N,"Checking "+i+" is in range "+n+"-"+e),r<n&&(r=n,_(N,"Set "+i+" to min value")),r>e&&(r=e,_(N,"Set "+i+" to max value")),S[i]=""+r}function i(t){return k.substr(k.indexOf(":")+s+t)}function r(t,e){I(function(){var n,i;D("Send Page Info","pageInfo:"+(n=document.body.getBoundingClientRect(),i=S.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-n.top,10),offsetLeft:parseInt(i.left-n.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset})),t,e)},32)}function o(t){var e=t.getBoundingClientRect();return E(N),{x:Math.floor(Number(e.left)+Number(l.x)),y:Math.floor(Number(e.top)+Number(l.y))}}function c(t){var e=t?o(S.iframe):{x:0,y:0},n={x:Number(S.width)+e.x,y:Number(S.height)+e.y};_(N,"Reposition requested from iFrame (offset x:"+e.x+" y:"+e.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(t?"Offset":"")](n.x,n.y):w(N,"Unable to scroll to requested position, window.parentIFrame not found"):(l=n,f(),_(N,"--"))}function f(){!1!==p("scrollCallback",l)?C(N):T()}function p(t,e){return x(N,t,e)}var d,g,y,k=t.data,S={},N=null;"[iFrameResizerChild]Ready"===k?function(){for(var t in h)D("iFrame requested init",L(t),document.getElementById(t),t)}():a===(""+k).substr(0,u)&&k.substr(u).split(":")[0]in h?(y=k.substr(u).split(":"),S={iframe:h[y[0]]&&h[y[0]].iframe,id:y[0],height:y[1],width:y[2],type:y[3]},N=S.id,h[N]&&(h[N].loaded=!0),(g=S.type in{true:1,false:1,undefined:1})&&_(N,"Ignoring init message from meta parent page"),!g&&function(t){var e=!0;return h[t]||(e=!1,w(S.type+" No settings for "+t+". Message was: "+k)),e}(N)&&(_(N,"Received: "+k),d=!0,null===S.iframe&&(w(N,"IFrame ("+S.id+") not found"),d=!1),d&&function(){var e,n=t.origin,i=h[N]&&h[N].checkOrigin;if(i&&""+n!="null"&&!(i.constructor===Array?function(){var t=0,e=!1;for(_(N,"Checking connection is from allowed list of origins: "+i);t<i.length;t++)if(i[t]===n){e=!0;break}return e}():(e=h[N]&&h[N].remoteHost,_(N,"Checking connection is from: "+e),n===e)))throw new Error("Unexpected message received from: "+n+" for "+S.iframe.id+". Message was: "+t.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(h[N]&&h[N].firstRun&&h[N]&&(h[N].firstRun=!1),S.type){case"close":h[N].closeRequestCallback?x(N,"closeRequestCallback",h[N].iframe):j(S.iframe);break;case"message":d=i(6),_(N,"MessageCallback passed: {iframe: "+S.iframe.id+", message: "+d+"}"),p("messageCallback",{iframe:S.iframe,message:JSON.parse(d)}),_(N,"--");break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":r(h[N]&&h[N].iframe,N),function(){function t(t,i){function o(){h[n]?r(h[n].iframe,n):e()}["scroll","resize"].forEach(function(e){_(n,t+e+" listener for sendPageInfo"),i(window,e,o)})}function e(){t("Remove ",v)}var n=N;t("Add ",m),h[n]&&(h[n].stopPageInfo=e)}();break;case"pageInfoStop":h[N]&&h[N].stopPageInfo&&(h[N].stopPageInfo(),delete h[N].stopPageInfo);break;case"inPageLink":t=i(9),s=t.split("#")[1]||"",a=decodeURIComponent(s),(u=document.getElementById(a)||document.getElementsByName(a)[0])?(n=o(u),_(N,"Moving to in page link (#"+s+") at x: "+n.x+" y: "+n.y),l={x:n.x,y:n.y},f(),_(N,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(s):_(N,"In page link #"+s+" not found and window.parentIFrame not found"):_(N,"In page link #"+s+" not found");break;case"reset":O(S);break;case"init":e(),p("initCallback",S.iframe);break;default:e()}var t,n,s,a,u,d}())):b(N,"Ignored: "+k)}function x(t,e,n){var i=null,r=null;if(h[t]){if("function"!=typeof(i=h[t][e]))throw new TypeError(e+" on iFrame["+t+"] is not a function");r=i(n)}return r}function j(t){var e=t.id;_(e,"Removing iFrame: "+e),t.parentNode&&t.parentNode.removeChild(t),x(e,"closedCallback",e),_(e,"--"),delete h[e]}function E(e){null===l&&_(e,"Get page position: "+(l={x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop}).x+","+l.y)}function C(t){null!==l&&(window.scrollTo(l.x,l.y),_(t,"Set page position: "+l.x+","+l.y),T())}function T(){l=null}function O(t){_(t.id,"Size reset requested by "+("init"===t.type?"host page":"iFrame")),E(t.id),A(function(){P(t),D("reset","reset",t.iframe,t.id)},t,"reset")}function P(t){function e(e){o||"0"!==t[e]||(o=!0,_(i,"Hidden iFrame detected, creating visibility listener"),function(){function t(){function t(t){function e(e){return"0px"===(h[t]&&h[t].iframe.style[e])}h[t]&&null!==h[t].iframe.offsetParent&&(e("height")||e("width"))&&D("Visibility change","resize",h[t].iframe,t)}for(var e in h)t(e)}function e(e){_("window","Mutation observed: "+e[0].target+" "+e[0].type),I(t,16)}var n,i=window.MutationObserver||window.WebKitMutationObserver;i&&(n=document.querySelector("body"),new i(e).observe(n,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function n(n){!function(e){t.iframe.style[e]=t[e]+"px",_(t.id,"IFrame ("+i+") "+e+" set to "+t[e]+"px")}(n),e(n)}var i=t.iframe.id;h[i]&&(h[i].sizeHeight&&n("height"),h[i].sizeWidth&&n("width"))}function A(t,e,n){n!==e.type&&c?(_(e.id,"Requesting animation frame"),c(t)):t()}function D(t,e,n,i,r){var o,s=!1;i=i||n.id,h[i]&&(n&&"contentWindow"in n&&null!==n.contentWindow?(o=h[i]&&h[i].targetOrigin,_(i,"["+t+"] Sending msg to iframe["+i+"] ("+e+") targetOrigin: "+o),n.contentWindow.postMessage(a+e,o)):w(i,"["+t+"] IFrame("+i+") not found"),r&&h[i]&&h[i].warningTimeout&&(h[i].msgTimeout=setTimeout(function(){!h[i]||h[i].loaded||s||(s=!0,w(i,"IFrame has not responded within "+h[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ingored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))},h[i].warningTimeout)))}function L(t){return t+":"+h[t].bodyMarginV1+":"+h[t].sizeWidth+":"+h[t].log+":"+h[t].interval+":"+h[t].enablePublicMethods+":"+h[t].autoResize+":"+h[t].bodyMargin+":"+h[t].heightCalculationMethod+":"+h[t].bodyBackground+":"+h[t].bodyPadding+":"+h[t].tolerance+":"+h[t].inPageLinks+":"+h[t].resizeFrom+":"+h[t].widthCalculationMethod}function N(e,n){var o,s=function(t){var o;return""===t&&(e.id=(o=n&&n.id||d.id+i++,null!==document.getElementById(o)&&(o+=i++),t=o),r=(n||{}).log,_(t,"Added missing iframe ID: "+t+" ("+e.src+")")),t}(e.id);s in h&&"iFrameResizer"in e?w(s,"Ignored iFrame, already setup."):(function(t){var n;t=t||{},h[s]={firstRun:!0,iframe:e,remoteHost:e.src.split("/").slice(0,3).join("/")},function(t){if("object"!=typeof t)throw new TypeError("Options is not an object")}(t),function(t){for(var e in d)d.hasOwnProperty(e)&&(h[s][e]=t.hasOwnProperty(e)?t[e]:d[e])}(t),h[s]&&(h[s].targetOrigin=!0===h[s].checkOrigin?""===(n=h[s].remoteHost)||"file://"===n?"*":n:"*")}(n),function(){switch(_(s,"IFrame scrolling "+(h[s]&&h[s].scrolling?"enabled":"disabled")+" for "+s),e.style.overflow=!1===(h[s]&&h[s].scrolling)?"hidden":"auto",h[s]&&h[s].scrolling){case!0:e.scrolling="yes";break;case!1:e.scrolling="no";break;default:e.scrolling=h[s]?h[s].scrolling:"no"}}(),function(){function t(t){1/0!==h[s][t]&&0!==h[s][t]&&(e.style[t]=h[s][t]+"px",_(s,"Set "+t+" = "+h[s][t]+"px"))}function n(t){if(h[s]["min"+t]>h[s]["max"+t])throw new Error("Value for min"+t+" can not be greater than max"+t)}n("Height"),n("Width"),t("maxHeight"),t("minHeight"),t("maxWidth"),t("minWidth")}(),"number"!=typeof(h[s]&&h[s].bodyMargin)&&"0"!==(h[s]&&h[s].bodyMargin)||(h[s].bodyMarginV1=h[s].bodyMargin,h[s].bodyMargin=h[s].bodyMargin+"px"),o=L(s),m(e,"load",function(){var n,i;D("iFrame.onload",o,e,t,!0),n=h[s]&&h[s].firstRun,i=h[s]&&h[s].heightCalculationMethod in f,!n&&i&&O({iframe:e,height:0,width:0,type:"init"})}),D("init",o,e,t,!0),Function.prototype.bind&&h[s]&&(h[s].iframe.iFrameResizer={close:j.bind(null,h[s].iframe),resize:D.bind(null,"Window resize","resize",h[s].iframe),moveToAnchor:function(t){D("Move to anchor","moveToAnchor:"+t,h[s].iframe,s)},sendMessage:function(t){D("Send Message","message:"+(t=JSON.stringify(t)),h[s].iframe,s)}}))}function I(t,e){null===p&&(p=setTimeout(function(){p=null,t()},e))}function M(t){_("window","Trigger event: "+t),I(function(){$("Window "+t,"resize")},16)}function F(){"hidden"!==document.visibilityState&&(_("document","Trigger event: Visiblity change"),I(function(){$("Tab Visable","resize")},16))}function $(t,e){function n(t){return h[t]&&"parent"===h[t].resizeFrom&&h[t].autoResize&&!h[t].firstRun}for(var i in h)n(i)&&D(t,e,document.getElementById(i),i)}function R(){function e(t,e){e&&(function(){if(!e.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==e.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+e.tagName+">")}(),N(e,t),n.push(e))}var n;return function(){var t,e=["moz","webkit","o","ms"];for(t=0;t<e.length&&!c;t+=1)c=window[e[t]+"RequestAnimationFrame"];c||_("setup","RequestAnimationFrame not supported")}(),m(window,"message",S),m(window,"resize",function(){M("resize")}),m(document,"visibilitychange",F),m(document,"-webkit-visibilitychange",F),m(window,"focusin",function(){M("focus")}),m(window,"focus",function(){M("focus")}),function(i,r){switch(n=[],function(t){t&&t.enablePublicMethods&&w("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof r){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(r||"iframe"),e.bind(t,i));break;case"object":e(i,r);break;default:throw new TypeError("Unexpected data type ("+typeof r+")")}return n}}}()}),$__System.registerDynamic("npm:process@0.11.9/browser.js",[],!0,function(t,e,n){this||self;var i,r,o=n.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var l,c=[],f=!1,h=-1;function p(){f&&l&&(f=!1,l.length?c=l.concat(c):h=-1,c.length&&d())}function d(){if(!f){var t=u(p);f=!0;for(var e=c.length;e;){for(l=c,c=[];++h<e;)l&&l[h].run();h=-1,e=c.length}l=null,f=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function v(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new m(t,e)),1!==c.length||f||u(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}}),$__System.registerDynamic("npm:process@0.11.9.js",["npm:process@0.11.9/browser.js"],!0,function(t,e,n){this||self;n.exports=t("npm:process@0.11.9/browser.js")}),$__System.registerDynamic("github:jspm/nodelibs-process@0.1.2/index.js",["npm:process@0.11.9.js"],!0,function(t,e,n){this||self;n.exports=$__System._nodeRequire?process:t("npm:process@0.11.9.js")}),$__System.registerDynamic("github:jspm/nodelibs-process@0.1.2.js",["github:jspm/nodelibs-process@0.1.2/index.js"],!0,function(t,e,n){this||self;n.exports=t("github:jspm/nodelibs-process@0.1.2/index.js")}),$__System.registerDynamic("npm:iframe-resizer@3.5.16/js/iframeResizer.contentWindow.js",["github:jspm/nodelibs-process@0.1.2.js"],!0,function(t,e,n){this||self;t("github:jspm/nodelibs-process@0.1.2.js"),function(t){"use strict";if("undefined"!=typeof window){var e,i,r,o,s,a,u,l=!0,c=10,f="",h=0,p="",d=null,m="",v=!1,g={resize:1,click:1},y=128,_=!0,b=1,w="bodyOffset",k=w,S=!0,x="",j={},E=32,C=null,T=!1,O="[iFrameSizer]",P=O.length,A="",D={max:1,min:1,bodyScroll:1,documentElementScroll:1},L="child",N=!0,I=window.parent,M="*",F=0,$=!1,R=null,H=16,B=1,W="scroll",Y=W,V=window,q=function(){ot("MessageCallback function not defined")},z=function(){},U=function(){},G={height:function(){return ot("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return ot("Custom width calculation function not defined"),document.body.scrollWidth}},K={},Q=Date.now||function(){return(new Date).getTime()},X={bodyOffset:function(){return document.body.offsetHeight+vt("marginTop")+vt("marginBottom")},offset:function(){return X.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return G.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,yt(X))},min:function(){return Math.min.apply(null,yt(X))},grow:function(){return X.max()},lowestElement:function(){return Math.max(X.bodyOffset(),gt("bottom",bt()))},taggedElement:function(){return _t("bottom","data-iframe-height")}},J={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return G.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(J.bodyScroll(),J.documentElementScroll())},max:function(){return Math.max.apply(null,yt(J))},min:function(){return Math.min.apply(null,yt(J))},rightMostElement:function(){return gt("right",bt())},taggedElement:function(){return _t("right","data-iframe-width")}},Z=(e=wt,s=null,a=0,u=function(){a=Q(),s=null,o=e.apply(i,r),s||(i=r=null)},function(){var t=Q();a||(a=t);var n=H-(t-a);return i=this,r=arguments,n<=0||n>H?(s&&(clearTimeout(s),s=null),a=t,o=e.apply(i,r),s||(i=r=null)):s||(s=setTimeout(u,n)),o});tt(window,"message",Ct),"loading"!==document.readyState&&window.parent.postMessage("[iFrameResizerChild]Ready","*")}function tt(t,e,n){"addEventListener"in window?t.addEventListener(e,n,!1):"attachEvent"in window&&t.attachEvent("on"+e,n)}function et(t,e,n){"removeEventListener"in window?t.removeEventListener(e,n,!1):"detachEvent"in window&&t.detachEvent("on"+e,n)}function nt(t){return t.charAt(0).toUpperCase()+t.slice(1)}function it(t){return O+"["+A+"] "+t}function rt(t){T&&"object"==typeof window.console&&console.log(it(t))}function ot(t){"object"==typeof window.console&&console.warn(it(t))}function st(){var e,n,i;!function(){function e(t){return"true"===t}var n=x.substr(P).split(":");A=n[0],h=t!==n[1]?Number(n[1]):h,v=t!==n[2]?e(n[2]):v,T=t!==n[3]?e(n[3]):T,E=t!==n[4]?Number(n[4]):E,l=t!==n[6]?e(n[6]):l,p=n[7],k=t!==n[8]?n[8]:k,f=n[9],m=n[10],F=t!==n[11]?Number(n[11]):F,j.enable=t!==n[12]&&e(n[12]),L=t!==n[13]?n[13]:L,Y=t!==n[14]?n[14]:Y}(),rt("Initialising iFrame ("+location.href+")"),function(){function t(t,e){return"function"==typeof t&&(rt("Setup custom "+e+"CalcMethod"),G[e]=t,t="custom"),t}var e;"iFrameResizer"in window&&Object===window.iFrameResizer.constructor&&(e=window.iFrameResizer,rt("Reading data from page: "+JSON.stringify(e)),q="messageCallback"in e?e.messageCallback:q,z="readyCallback"in e?e.readyCallback:z,M="targetOrigin"in e?e.targetOrigin:M,k="heightCalculationMethod"in e?e.heightCalculationMethod:k,Y="widthCalculationMethod"in e?e.widthCalculationMethod:Y,k=t(k,"height"),Y=t(Y,"width")),rt("TargetOrigin for parent set to: "+M)}(),t===p&&(p=h+"px"),at("margin",(n="margin",-1!==(i=p).indexOf("-")&&(ot("Negative CSS value ignored for "+n),i=""),i)),at("background",f),at("padding",m),(e=document.createElement("div")).style.clear="both",e.style.display="block",document.body.appendChild(e),ft(),ht(),document.documentElement.style.height="",document.body.style.height="",rt('HTML & body height set to "auto"'),rt("Enable public methods"),V.parentIFrame={autoResize:function(t){return!0===t&&!1===l?(l=!0,pt()):!1===t&&!0===l&&(l=!1,dt()),l},close:function(){Et(0,0,"close"),rt("Disable outgoing messages"),N=!1,rt("Remove event listener: Message"),et(window,"message",Ct),!0===l&&dt()},getId:function(){return A},getPageInfo:function(t){"function"==typeof t?(U=t,Et(0,0,"pageInfo")):(U=function(){},Et(0,0,"pageInfoStop"))},moveToAnchor:function(t){j.findTarget(t)},reset:function(){jt("parentIFrame.reset")},scrollTo:function(t,e){Et(e,t,"scrollTo")},scrollToOffset:function(t,e){Et(e,t,"scrollToOffset")},sendMessage:function(t,e){Et(0,0,"message",JSON.stringify(t),e)},setHeightCalculationMethod:function(t){k=t,ft()},setWidthCalculationMethod:function(t){Y=t,ht()},setTargetOrigin:function(t){rt("Set targetOrigin: "+t),M=t},size:function(t,e){var n=(t||"")+(e?","+e:"");kt("size","parentIFrame.size("+n+")",t,e)}},pt(),j=function(){function e(e){var n=e.getBoundingClientRect(),i={x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop};return{x:parseInt(n.left,10)+parseInt(i.x,10),y:parseInt(n.top,10)+parseInt(i.y,10)}}function n(n){var i=n.split("#")[1]||n,r=decodeURIComponent(i),o=document.getElementById(r)||document.getElementsByName(r)[0];t!==o?function(t){var n=e(t);rt("Moving to in page link (#"+i+") at x: "+n.x+" y: "+n.y),Et(n.y,n.x,"scrollToOffset")}(o):(rt("In page link (#"+i+") not found in iFrame, so sending to parent"),Et(0,0,"inPageLink","#"+i))}function i(){""!==location.hash&&"#"!==location.hash&&n(location.href)}return j.enable?Array.prototype.forEach&&document.querySelectorAll?(rt("Setting up location.hash handlers"),Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'),function(t){"#"!==t.getAttribute("href")&&tt(t,"click",function(t){t.preventDefault(),n(this.getAttribute("href"))})}),tt(window,"hashchange",i),setTimeout(i,y)):ot("In page linking not fully supported in this browser! (See README.md for IE8 workaround)"):rt("In page linking not enabled"),{findTarget:n}}(),kt("init","Init message from host page"),z()}function at(e,n){t!==n&&""!==n&&"null"!==n&&(document.body.style[e]=n,rt("Body "+e+' set to "'+n+'"'))}function ut(t){var e={add:function(e){function n(){kt(t.eventName,t.eventType)}K[e]=n,tt(window,e,n)},remove:function(t){var e=K[t];delete K[t],et(window,t,e)}};t.eventNames&&Array.prototype.map?(t.eventName=t.eventNames[0],t.eventNames.map(e[t.method])):e[t.method](t.eventName),rt(nt(t.method)+" event listener: "+t.eventType)}function lt(t){ut({method:t,eventType:"Animation Start",eventNames:["animationstart","webkitAnimationStart"]}),ut({method:t,eventType:"Animation Iteration",eventNames:["animationiteration","webkitAnimationIteration"]}),ut({method:t,eventType:"Animation End",eventNames:["animationend","webkitAnimationEnd"]}),ut({method:t,eventType:"Input",eventName:"input"}),ut({method:t,eventType:"Mouse Up",eventName:"mouseup"}),ut({method:t,eventType:"Mouse Down",eventName:"mousedown"}),ut({method:t,eventType:"Orientation Change",eventName:"orientationchange"}),ut({method:t,eventType:"Print",eventName:["afterprint","beforeprint"]}),ut({method:t,eventType:"Ready State Change",eventName:"readystatechange"}),ut({method:t,eventType:"Touch Start",eventName:"touchstart"}),ut({method:t,eventType:"Touch End",eventName:"touchend"}),ut({method:t,eventType:"Touch Cancel",eventName:"touchcancel"}),ut({method:t,eventType:"Transition Start",eventNames:["transitionstart","webkitTransitionStart","MSTransitionStart","oTransitionStart","otransitionstart"]}),ut({method:t,eventType:"Transition Iteration",eventNames:["transitioniteration","webkitTransitionIteration","MSTransitionIteration","oTransitionIteration","otransitioniteration"]}),ut({method:t,eventType:"Transition End",eventNames:["transitionend","webkitTransitionEnd","MSTransitionEnd","oTransitionEnd","otransitionend"]}),"child"===L&&ut({method:t,eventType:"IFrame Resized",eventName:"resize"})}function ct(t,e,n,i){return e!==t&&(t in n||(ot(t+" is not a valid option for "+i+"CalculationMethod."),t=e),rt(i+' calculation method set to "'+t+'"')),t}function ft(){k=ct(k,w,X,"height")}function ht(){Y=ct(Y,W,J,"width")}function pt(){var e;!0===l?(lt("add"),e=0>E,window.MutationObserver||window.WebKitMutationObserver?e?mt():d=function(){function e(t){function e(t){!1===t.complete&&(rt("Attach listeners to "+t.src),t.addEventListener("load",r,!1),t.addEventListener("error",o,!1),u.push(t))}"attributes"===t.type&&"src"===t.attributeName?e(t.target):"childList"===t.type&&Array.prototype.forEach.call(t.target.querySelectorAll("img"),e)}function n(t){rt("Remove listeners from "+t.src),t.removeEventListener("load",r,!1),t.removeEventListener("error",o,!1),function(t){u.splice(u.indexOf(t),1)}(t)}function i(e,i,r){n(e.target),kt(i,r+": "+e.target.src,t,t)}function r(t){i(t,"imageLoad","Image loaded")}function o(t){i(t,"imageLoadFailed","Image load failed")}function s(t){kt("mutationObserver","mutationObserver: "+t[0].target+" "+t[0].type),t.forEach(e)}var a,u=[],l=window.MutationObserver||window.WebKitMutationObserver,c=(a=document.querySelector("body"),c=new l(s),rt("Create body MutationObserver"),c.observe(a,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),c);return{disconnect:function(){"disconnect"in c&&(rt("Disconnect body MutationObserver"),c.disconnect(),u.forEach(n))}}}():(rt("MutationObserver not supported in this browser!"),mt())):rt("Auto Resize disabled")}function dt(){lt("remove"),null!==d&&d.disconnect(),clearInterval(C)}function mt(){0!==E&&(rt("setInterval: "+E+"ms"),C=setInterval(function(){kt("interval","setInterval: "+E)},Math.abs(E)))}function vt(t,e){var n=0;return e=e||document.body,n="defaultView"in document&&"getComputedStyle"in document.defaultView?null!==(n=document.defaultView.getComputedStyle(e,null))?n[t]:0:function(t){if(/^\d+(px)?$/i.test(t))return parseInt(t,c);var n=e.style.left,i=e.runtimeStyle.left;return e.runtimeStyle.left=e.currentStyle.left,e.style.left=t||0,t=e.style.pixelLeft,e.style.left=n,e.runtimeStyle.left=i,t}(e.currentStyle[t]),parseInt(n,c)}function gt(t,e){for(var n=e.length,i=0,r=0,o=nt(t),s=Q(),a=0;a<n;a++)(i=e[a].getBoundingClientRect()[t]+vt("margin"+o,e[a]))>r&&(r=i);return s=Q()-s,rt("Parsed "+n+" HTML elements"),rt("Element position calculated in "+s+"ms"),function(t){t>H/2&&rt("Event throttle increased to "+(H=2*t)+"ms")}(s),r}function yt(t){return[t.bodyOffset(),t.bodyScroll(),t.documentElementOffset(),t.documentElementScroll()]}function _t(t,e){var n=document.querySelectorAll("["+e+"]");return 0===n.length&&(ot("No tagged elements ("+e+") found on page"),document.querySelectorAll("body *")),gt(t,n)}function bt(){return document.querySelectorAll("body *")}function wt(e,n,i,r){var o,s;!function(){function e(t,e){return!(Math.abs(t-e)<=F)}return o=t!==i?i:X[k](),s=t!==r?r:J[Y](),e(b,o)||v&&e(B,s)}()&&"init"!==e?e in{init:1,interval:1,size:1}||!(k in D||v&&Y in D)?e in{interval:1}||rt("No change in size detected"):jt(n):(St(),Et(b=o,B=s,e))}function kt(t,e,n,i){$&&t in g?rt("Trigger event cancelled: "+t):(t in{reset:1,resetPage:1,init:1}||rt("Trigger event: "+e),"init"===t?wt(t,e,n,i):Z(t,e,n,i))}function St(){$||($=!0,rt("Trigger event lock on")),clearTimeout(R),R=setTimeout(function(){$=!1,rt("Trigger event lock off"),rt("--")},y)}function xt(t){b=X[k](),B=J[Y](),Et(b,B,t)}function jt(t){var e=k;k=w,rt("Reset trigger event: "+t),St(),xt("reset"),k=e}function Et(e,n,i,r,o){var s;!0===N&&(t===o?o=M:rt("Message targetOrigin: "+o),rt("Sending message to host page ("+(s=A+":"+e+":"+n+":"+i+(t!==r?":"+r:""))+")"),I.postMessage(O+s,o))}function Ct(t){var e={init:function(){"interactive"===document.readyState||"complete"===document.readyState?(x=t.data,I=t.source,st(),_=!1,setTimeout(function(){S=!1},y)):(rt("Waiting for page ready"),tt(window,"readystatechange",e.initFromParent))},reset:function(){S?rt("Page reset ignored by init"):(rt("Page size reset by host page"),xt("resetPage"))},resize:function(){kt("resizeParent","Parent window requested size check")},moveToAnchor:function(){j.findTarget(r())},inPageLink:function(){this.moveToAnchor()},pageInfo:function(){var t=r();rt("PageInfoFromParent called from parent: "+t),U(JSON.parse(t)),rt(" --")},message:function(){var t=r();rt("MessageCallback called from parent: "+t),q(JSON.parse(t)),rt(" --")}};function i(){return t.data.split("]")[1].split(":")[0]}function r(){return t.data.substr(t.data.indexOf(":")+1)}function o(){return t.data.split(":")[2]in{true:1,false:1}}function s(){var r=i();r in e?e[r]():(void 0===n||!n.exports)&&"iFrameResize"in window||o()||ot("Unexpected message ("+t.data+")")}O===(""+t.data).substr(0,P)&&(!1===_?s():o()?e.init():rt('Ignored message of type "'+i()+'". Received before initialization.'))}}()}),$__System.registerDynamic("npm:iframe-resizer@3.5.16/js/index.js",["npm:iframe-resizer@3.5.16/js/iframeResizer.js","npm:iframe-resizer@3.5.16/js/iframeResizer.contentWindow.js"],!0,function(t,e,n){this||self;e.iframeResizer=t("npm:iframe-resizer@3.5.16/js/iframeResizer.js"),e.iframeResizerContentWindow=t("npm:iframe-resizer@3.5.16/js/iframeResizer.contentWindow.js")}),$__System.registerDynamic("npm:iframe-resizer@3.5.16/index.js",["npm:iframe-resizer@3.5.16/js/index.js"],!0,function(t,e,n){"use strict";this||self;n.exports=t("npm:iframe-resizer@3.5.16/js/index.js")}),$__System.registerDynamic("npm:iframe-resizer@3.5.16.js",["npm:iframe-resizer@3.5.16/index.js"],!0,function(t,e,n){this||self;n.exports=t("npm:iframe-resizer@3.5.16/index.js")}),$__System.register("components/iframe/iframe.js",["github:components/jquery@1.11.3.js","lib/component.js","lib/grab.js","lib/config.js","helpers/helpers.js","npm:iframe-resizer@3.5.16.js"],function(t){"use strict";var e,n,i,r,o,s=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=function(t,e,n){for(var i=!0;i;){var r=t,o=e,s=n;i=!1,null===r&&(r=Function.prototype);var a=Object.getOwnPropertyDescriptor(r,o);if(void 0!==a){if("value"in a)return a.value;var u=a.get;if(void 0===u)return;return u.call(s)}var l=Object.getPrototypeOf(r);if(null===l)return;t=l,e=o,n=s,i=!0,a=l=void 0}};return{setters:[function(t){t.default},function(t){e=t.default},function(t){t.default},function(t){n=t.configurable},function(t){i=t.Helpers},function(t){r=t.default}],execute:function(){o=function(t){function o(t,e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u),a(Object.getPrototypeOf(u.prototype),"constructor",this).call(this,t,e),this._id=i.Strings.random(6),this.$el.attr("id",this._id);var o=!1;setTimeout(function(){r.iframeResizer({resizedCallback:function(){o||(n.$el.removeClass("b-hidden--height"),o=!0)}},"#"+n._id)},0)}!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,e),s(o,[{key:"destroy",value:function(){this.off()}}],[{key:"init",value:function(t,e){return new o(t,e)}}]);var u=o;return o=n({})(o)||o}(),t("IFrame",o)}}}),$__System.register("main.js",["lib/garfield.js","github:components/jquery@1.11.3.js","npm:bluebird@3.3.4.js","lib/constants.js","components/audio-player/audio-player.js","components/anchor-in-accordion/anchor-in-accordion.js","components/anchor-in-accordion/accordion-button.js","components/anchor-in-accordion/accordion-item.js","components/nav-tabs/nav-tabs.js","components/tab-collapser/tab-collapser.js","components/caret-slider/caret-slider.js","components/predictive-input/predictive-input.js","components/stickler/stickler.js","components/tooltip/tooltip.js","components/dynamic-mobile-navigation/dynamic-mobile-navigation.js","components/events-list/events-list.js","components/component-ctrl/component-ctrl.js","components/content-support/content-support.js","components/form/form.js","components/form/element-validator.js","components/form/element-restriction.js","components/dropdown/dropdown.js","components/input-group/input-group.js","components/alumni-donation-form/alumni-donation-form.js","components/atar-form/atar-form.js","components/spinner/spinner.js","components/social-feed/social-feed.js","components/swiper-carousel/swiper-carousel.js","components/swiper-image-gallery/swiper-image-gallery.js","components/json-link-list/json-link-list.js","components/feedback/feedback.js","components/featured-article/featured-article.js","components/featured-article-carousel/featured-article-carousel.js","components/more-information-content/more-information-content.js","components/category-navigation/category-navigation.js","components/category-topic-navigation/category-topic-navigation.js","components/category-topic-navigation/topic-subject-list.js","components/filter-component/notices-filter-component.js","components/filter-component/dates-filter-component.js","components/table-of-contents/table-of-contents.js","components/anchor-scroll-hack/anchor-scroll-hack.js","components/jumbotron-navigation/jumbotron-navigation.js","components/remove-main-secondary-navigation/remove-main-secondary-navigation.js","components/dynamic-left-side-navigation/dynamic-left-side-navigation.js","components/smartcrop/smartcrop.js","components/iframe/iframe.js"],function(t){"use strict";var e,n,i,r,o,s,a,u,l,c,f,h,p,d,m,v,g,y,_,b,w,k,S,x,j,E,C,T,O,P,A,D,L,N,I,M,F,$,R,H,B,W,Y,V,q,z;return{setters:[function(t){},function(t){e=t.default},function(t){n=t.default},function(t){i=t.Constants},function(t){r=t.AudioPlayer},function(t){o=t.AnchorInAccordion},function(t){s=t.AccordionButton},function(t){a=t.AccordionItem},function(t){u=t.NavTabs},function(t){l=t.TabCollapser},function(t){c=t.CaretSlider},function(t){f=t.PredictiveInput},function(t){h=t.Stickler},function(t){p=t.Tooltip},function(t){d=t.DynamicMobileNavigation},function(t){m=t.EventsList},function(t){v=t.ComponentCtrl},function(t){g=t.ContentSupport},function(t){y=t.Form},function(t){_=t.ElementValidator},function(t){b=t.ElementRestriction},function(t){w=t.Dropdown},function(t){k=t.InputGroup},function(t){S=t.AlumniDonationForm},function(t){x=t.AtarForm},function(t){j=t.Spinner},function(t){E=t.SocialFeed},function(t){C=t.SwiperCarousel},function(t){T=t.SwiperImageGallery},function(t){O=t.JsonLinkList},function(t){P=t.Feedback},function(t){A=t.FeaturedArticle},function(t){D=t.FeaturedArticleCarousel},function(t){L=t.MoreInformationContent},function(t){N=t.CategoryNavigation},function(t){I=t.CategoryTopicNavigation},function(t){M=t.TopicSubjectList},function(t){F=t.NoticesFilterComponent},function(t){$=t.DatesFilterComponent},function(t){R=t.TableOfContents},function(t){H=t.AnchorScrollHack},function(t){B=t.JumbotronNavigation},function(t){W=t.RemoveMainSecondaryNavigation},function(t){Y=t.DynamicLeftSideNavigation},function(t){V=t.Smartcrop},function(t){q=t.IFrame}],execute:function(){try{n.config({cancellation:!0})}catch(t){console.warn(t)}window[i.GLOBAL_INSTANCE]||(window[i.GLOBAL_INSTANCE]={}),window[i.GLOBAL_INSTANCE].garfield||(window[i.GLOBAL_INSTANCE].garfield=new Garfield),(z=window[i.GLOBAL_INSTANCE].garfield).bind(".mainNav nav",{initAll:function(t){e(t).accessibleMegaMenu({menuClass:"navMenu",topNavItemClass:"navItem",panelClass:"mainNavDropdown",panelGroupClass:"navGroup"})}}),z.bind({selector:".b-js-anchor-in-accordion",module:o,config:{accordionButtons:".b-js-accordion-button",accordionItems:".b-js-accordion-item"}}),z.bind(".b-js-audio-player",r),z.bind(".b-js-accordion-button",s),z.bind(".b-js-accordion-item",a),z.bind(".b-js-anchor-scroll-hack",H),z.bind(".b-js-content-support",g),z.bind(".b-js-nav-tabs",u),z.bind(".b-js-tab-collapser",l),z.bind(".b-js-caret-slider",c),z.bind(".b-js-stickler",h),z.bind(".b-js-tooltip",p),z.bind(".b-js-dynamic-mobile-navigation",d),z.bind(".b-js-swiper-carousel",C),z.bind(".b-js-swiper-image-gallery",T),z.bind({selector:".b-js-form",module:y,config:{validationElements:".b-js-element-validator",restrictionElements:".b-js-restriction-validator"}}),z.bind(".b-js-input-group",k),z.bind(".b-js-dropdown",w),z.bind(".b-js-table-of-contents",R),z.bind(".b-js-json-link-list",O),z.bind(".b-js-events-list",m),z.bind(".b-js-component-ctrl",v),z.bind(".b-js-element-validator",_),z.bind(".b-js-element-restriction",b),z.bind(".b-js-alumni-donation-form",S),z.bind(".b-js-atar-form",x),z.bind(".b-js-spinner",j),z.bind(".b-js-feedback",P),z.bind(".b-js-featured-article",A),z.bind(".b-js-featured-article-carousel",D),z.bind(".b-js-more-information-content",L),z.bind(".b-js-category-navigation",N),z.bind({selector:".b-js-category-topic-navigation",module:I,config:{TopicSubjectList:".b-js-topic-subject-list"}}),z.bind(".b-js-topic-subject-list",M),z.bind(".b-js-notices-filter-component",F),z.bind(".b-js-dates-filter-component",$),z.bind(".b-js-remove-main-secondary-navigation",W),z.bind(".b-js-dynamic-left-side-navigation",Y),z.bind(".b-js-jumbotron-navigation",B),z.bind(".b-js-predictive-input",f),z.bind(".b-js-social-feed",E),z.bind(".b-js-smartcrop",V),z.bind(".b-js-iframe",q),z.bind(".b-js--show",function(t){e(t).removeClass("b-js--show")}),z.bind(".b-js--hide",function(t){e(t).hide().removeClass("b-js--hide")}),z.init()}}})})(function(t){t(jQuery)});
function solve() { class Furniture { constructor(name, img, price, decFactor) { this.name = name, this.img = img, this.price = price, this.decFactor = decFactor } } const buttons = Array.from(document.getElementsByTagName("button")); const textAreas = Array.from(document.querySelectorAll("textarea")); const generateButton = buttons[0]; const tableRowsArray = []; function createRow(el, propertyObj, tableRow) { const Cell = document.createElement("td"); const element = document.createElement(el); if (el === "img") { element.src = propertyObj; } else if (el === "input") { element.type = "checkbox"; } else { element.textContent = propertyObj; } Cell.appendChild(element); tableRow.appendChild(Cell); } generateButton.addEventListener("click", () => { let arrayCounter = 0; const furnituresArray = []; const inputValueArray = JSON.parse(textAreas[0].value); inputValueArray.forEach(object => { const inputValue = object; furnituresArray.push(new Furniture(inputValue["name"], inputValue["img"], inputValue["price"], inputValue["decFactor"])); const tableRow = document.createElement("tr"); createRow("img", furnituresArray[arrayCounter].img, tableRow); createRow("p", furnituresArray[arrayCounter].name, tableRow); createRow("p", furnituresArray[arrayCounter].price, tableRow); createRow("p", furnituresArray[arrayCounter].decFactor, tableRow); const checkCell = document.createElement("td"); const checkBox = document.createElement("input"); checkBox.type = "checkbox"; checkCell.appendChild(checkBox); tableRow.appendChild(checkCell); const tableBody = document.querySelector("tBody"); tableBody.appendChild(tableRow); tableRowsArray.push(tableRow); arrayCounter++; }); }); const buyButton = buttons[1]; buyButton.addEventListener("click", () => { const furnitureNames = []; const furniturePrices = []; const furnitureDecFactors = []; const resultTextArea = textAreas[1]; resultTextArea.value = ""; tableRowsArray.forEach(row => { const checkedInputs = row.lastChild.lastChild; if (checkedInputs.checked) { const tableCells = Array.from(row.children); furnitureNames.push(tableCells[1].firstChild.textContent); furniturePrices.push(tableCells[2].firstChild.textContent); furnitureDecFactors.push(tableCells[3].firstChild.textContent); } }); const totalPrice = furniturePrices.reduce((acc, curr) => { return acc + Number(curr); }, 0).toFixed(2); let averageDecorationFactor = 0; if (furnitureDecFactors.length > 0) { averageDecorationFactor = furnitureDecFactors.reduce((acc, curr) => { return acc + Number(curr); }, 0) / furnitureDecFactors.length; } resultTextArea.value = `Bought furniture: ${furnitureNames.join(", ")}\nTotal price: ${totalPrice}\nAverage decoration factor: ${averageDecorationFactor}`; }); }
import { ConflictException, ForbiddenException, Injectable, NotFoundException, } from "@nestjs/common"; import { UpdateUserDto } from "./dto/update-user.dto"; import { UsersRepository } from "./repository/users.repository"; import { MediaService } from "src/global/media/providers/media.service"; import { MediaFile } from "src/shared/types/media"; @Injectable() export class UsersService { constructor( private readonly repository: UsersRepository, private readonly media: MediaService ) {} async getBanned(uid: string) { return this.repository.getBanned(uid); } async friendsLeaderboard(user: string) { const friends = await this.repository.friendsLeaderborad(user); return { data: friends, }; } findAll() { return this.repository.findAll(); } findMeAll(uid: string) { return this.repository.findMeAll(uid); } findOne(id: string, user?: string) { return this.repository.findOne(id, user); } update(id: string, updateUserDto: UpdateUserDto) { const { lastName, firstName, login } = updateUserDto; return this.repository.updateOne({ lastName, firstName, login }, id); } async acceptFriend(uid: string, user: string) { const friendship = await this.repository.getInvitation(uid, user); if (!friendship) throw new NotFoundException(); this.repository.acceptFriend(friendship.uid); } async getAllFriends(user: string) { return this.repository.getAllFriends(user); } async getAllInvitations(user: string) { return this.repository.getAllInvitations(user); } async getAllUsers(user: string) { return this.repository.getAllUsers(user); } async addFriend(uid: string, user: string) { const friendship = await this.repository.getFriendship(uid, user); if (friendship) throw new ConflictException(); return this.repository.addFriend(uid, user); } async ban(uid: string, user: string) { const friendship = await this.repository.getFriendship(uid, user); if (friendship && friendship.status === "Banned") { throw new ConflictException(); } if (friendship) { await this.repository.removeFriend(uid, user) } return this.repository.createbanned(uid, user); } async unban(uid: string, user: string) { const friendship = await this.repository.getBan(user, uid); if (!friendship) throw new NotFoundException(); if (friendship.status !== "Banned") { throw new ConflictException(); } if (friendship.bannedBy !== user) throw new ForbiddenException(); return this.repository.unban(friendship.uid); } async searchForUser(search: string, user: string) { const data = await this.repository.searchForUser(search, user); return { data, }; } async getFriends(uid: string) { return this.repository.getAllFriends(uid); } async removeFriend(uid: string, user: string) { return this.repository.removeFriend(uid, user); } remove(id: string) { return this.repository.deleteOne(id); } async changeProfilePicture(file: MediaFile, uid: string) { const added_file = await this.media.uploadFile(file, uid, true); const data = await this.repository.updateOne( { profileImage: added_file.url, }, uid ); return { status: "success", data, }; } }
# Teacher Application Letters Generator ## Introduction and Inspiration The Teacher Application Letters Generator is a web application developed by Wisdom Edem Sena to address the recurring need among teachers in Ghana for efficient letter-writing assistance. Inspired by the frequent requests from teachers seeking support in drafting professional letters such as those for upgrading, appointment acceptance, salary re-activation, reposting and transfers. By leveraging technology, the Teacher Application Letters Generator aims to simplify the creation of personalized letters for teachers. - **Demo:** [Teacher Application Letters Generator Demo](https://youtu.be/heUotyHo0Kk?si=5SeHmYdBE7ucyVsN) - **Deployed Site:** [Teacher Application Letters Generator](#) (link pending deployment) - **Final Project Blog Article:** [Link to Blog Article](#) (link pending) - **Author(s) LinkedIn:** [Wisdom Edem Sena](https://www.linkedin.com/in/wisdom-edem-sena-226704191?lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_contact_details%3Bpy4hhQ7FQv2LmroNcaVXFQ%3D%3D) ## Screenshots ![image](https://github.com/wisdomsena36/MVP-Review/assets/57534261/2e062224-d9d4-4d59-9537-8ef23ceae0c1) ![image](https://github.com/wisdomsena36/MVP-Review/assets/57534261/efcd72e7-bcfb-4f76-bbfc-3c75f93d3707) ## Project Overview ### [Presentation Overview](https://docs.google.com/presentation/d/1hY8vQNDcaD-K7wtVg69NvnBVksSEAHWO2Haj8mA6eb0/edit?usp=drivesdk) ### [MVP for Teacher Application Letters Generator](https://github.com/wisdomsena36/MVP-Review/blob/main/README.md) ## Installation To utilize the Teacher Application Letters Generator locally, follow these installation steps: 1. Clone this repository to your local machine. 2. Navigate to the project directory. 3. Install dependencies using `pip install -r requirements.txt`. 4. Add your Google Developer Console credentials to the `credentials.py` file. (Instructions for obtaining these credentials can be found [here](https://dev.to/mar1anna/flask-app-login-with-google-3j24)). 5. Run the application using `python app.py`. 6. Access the application through your web browser at `http://localhost:5000`. ## Usage Upon launching the application, users gain access to a user-friendly dashboard with various functionalities: - **Home:** Provides an overview and access to different letter categories. - **Demo:** Offers a comprehensive guide on navigating the website effectively. - **Feedback:** Allows users to share insights and suggestions for improvement. - **Report Bugs:** Provides a channel for reporting encountered issues for swift resolution. ## Contributing Contributions to the Teacher Application Letters Generator project are welcomed. Follow these steps to contribute: 1. Fork the repository. 2. Create a new branch for your feature (`git checkout -b feature/your-feature-name`). 3. Commit your changes (`git commit -am 'Add new feature'`). 4. Push to the branch (`git push origin feature/your-feature-name`). 5. Create a new pull request. ## Technology Stack ### Backend Development: - Python - Flask Web Framework ### User Authentication: - Google Developer Console ### Frontend Development: - CSS - HTML - JavaScript ## Meet the Team ### Wisdom Edem Sena - Project Lead and Developer Wisdom spearheaded the development of the Teacher Application Letters Generator, leveraging expertise in backend and frontend technologies. ## Licensing This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
from client_lib import quiz_rapid from client_lib.config import HOSTED_KAFKA import base64 import requests import json # LEESAH QUIZ GAME CLIENT # 1. Change TEAM_NAME variable to your team name # 2. make sure you have downloaded and unpacked the credential files in the certs/ dir # Config ########################################################################################################## TEAM_NAME = "TeamImsdal" QUIZ_TOPIC = "quiz-rapid" CONSUMER_GROUP_ID = f"cg-leesah-team-${TEAM_NAME}-1" assert TEAM_NAME is not None and TEAM_NAME != "CHANGE ME", "Husk å gi teamet ditt et navn" assert QUIZ_TOPIC is not None and QUIZ_TOPIC != "CHANGE ME", "Husk å sett riktig topic navn" # ################################################################################################################## class MyParticipant(quiz_rapid.QuizParticipant): def __init__(self): super().__init__(TEAM_NAME) self.dedup = [] with open("dedup.txt", "r") as f: for line in f: self.dedup.append(line) with open("saldo.txt", "w") as f: f.write("0") def handle_question(self, question: quiz_rapid.Question): if question.category == "team-registration": self.handle_register_team(question) if question.category == "arithmetic": self.handle_arithmetic(question) if question.category == "ping-pong": self.handle_ping(question) if question.category == "NAV": self.handle_nav(question) if question.category == "base64": self.handle_base64(question) if question.category == "is-a-prime": self.handle_prime(question) if question.category == "deduplication": self.handle_deduplication(question) if question.category == "transactions": self.handle_transaction(question) if question.category == "grunnbelop": self.handle_grunn(question) def handle_assessment(self, assessment: quiz_rapid.Assessment): pass # Question handlers ################################################################################################ def handle_register_team(self, question: quiz_rapid.Question): if question.question == "Register a new team": self.publish_answer( question_id=question.messageId, category=question.category, answer=TEAM_NAME ) def handle_arithmetic(self, question: quiz_rapid.Question): a, operator, b = question.question.split(" ") a=int(a) b=int(b) if operator == "+": self.publish_answer( question_id=question.messageId, category=question.category, answer=a + b ) if operator == "-": self.publish_answer( question_id=question.messageId, category=question.category, answer=a - b ) if operator == "*": self.publish_answer( question_id=question.messageId, category=question.category, answer=a * b ) if operator == "/": self.publish_answer( question_id=question.messageId, category=question.category, answer=int(a / b) ) def handle_ping(self, question: quiz_rapid.Question): if question.question == "ping": self.publish_answer( question_id=question.messageId, category=question.category, answer="pong" ) if question.question == "pong": self.publish_answer( question_id=question.messageId, category=question.category, answer="ping" ) def handle_nav(self, question: quiz_rapid.Question): if question.question == "P\u00e5 hvilken nettside finner man informasjon om rekruttering til NAV IT?": self.publish_answer( question_id=question.messageId, category=question.category, answer="detsombetyrnoe.no" ) if question.question == "Hva heter applikasjonsplattformen til NAV?": self.publish_answer( question_id=question.messageId, category=question.category, answer="NAIS" ) def handle_base64(self, question: quiz_rapid.Question): value = question.question[5:] self.publish_answer( question_id=question.messageId, category=question.category, answer=base64.b64decode(value).decode('ascii') ) def handle_prime(self, question: quiz_rapid.Question): ans = True n = int(question.question.split(" ")[-1]) for i in range(2, n): if (n % i) == 0: ans = False break self.publish_answer( question_id=question.messageId, category=question.category, answer=ans ) def handle_deduplication(self, question: quiz_rapid.Question): if question.question not in self.dedup: self.dedup.append(question.question) with open("dedup.txt", "a") as f: f.write(question.question + "\n") self.publish_answer( question_id=question.messageId, category=question.category, answer="you wont dupe me!" ) """self.publish_answer( question_id=question.messageId, category=question.category, answer="you duped me!" )""" def handle_transaction(self, question: quiz_rapid.Question): action, value = question.question.split(" ") value = int(value) saldo = 0 with open("saldo.txt", "r") as f: saldo = int(f.read()) if (action == "UTTREKK"): saldo -= value else: saldo += value with open("saldo.txt", "w") as f: f.write(str(saldo)) self.publish_answer( question_id=question.messageId, category=question.category, answer=saldo ) def handle_grunn(self, question: quiz_rapid.Question): dato = question.question.split(" ")[-1] req = requests.get("http://g.nav.no/api/v1/grunnbeløp?name={}".format(dato)) data = req.json() self.publish_answer( question_id=question.messageId, category=question.category, answer=str(data["grunnbeløp"]) ) ##################################################################################################################### def main(): rapid = quiz_rapid.QuizRapid( team_name=TEAM_NAME, topic=QUIZ_TOPIC, bootstrap_servers=HOSTED_KAFKA, consumer_group_id=CONSUMER_GROUP_ID, auto_commit=False, # Bare sku på denne om du vet hva du driver med :) logg_questions=True, # Logg spørsmålene appen mottar logg_answers=True, # Logg svarene appen sender short_log_line=False, # Logg bare en forkortet versjon av meldingene log_ignore_list=["arithmetic", "team-registration", "ping-pong", "base64", "is-a-prime", "deduplication"] # Liste med spørsmålskategorier loggingen skal ignorere ) return MyParticipant(), rapid
// // SoundViewController.swift // SoundBoard // // Created by Jose Falconi on 5/20/22. // Copyright © 2022 empresa. All rights reserved. // import UIKit import AVFoundation class SoundViewController: UIViewController { @IBOutlet weak var grabarButton: UIButton! @IBOutlet weak var reproducirButton: UIButton! @IBOutlet weak var nombreTextField: UITextField! @IBOutlet weak var agregarButton: UIButton! @IBOutlet weak var tiempoTranscurrido: UILabel! @IBOutlet weak var slider: UISlider! var timer:Timer = Timer() var grabarAudio:AVAudioRecorder? var reproducirAudio:AVAudioPlayer? var audioURL:URL? var grabando:Bool = false @IBAction func grabarTapped(_ sender: Any) { if grabarAudio!.isRecording { grabando = false grabarAudio?.stop() timer.invalidate() grabarButton.setTitle("GRABAR", for: .normal) reproducirButton.isEnabled = true agregarButton.isEnabled = true } else { grabando = true grabarAudio?.record() timer = Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(duracion), userInfo: nil, repeats: true) grabarButton.setTitle("DETENER", for: .normal) reproducirButton.isEnabled = false // let tmp = Double(grabarAudio!.currentTime)*60 // print("timepo -> \(String(tmp))") // tiempoTranscurrido?.text = String(tmp) } } @objc func duracion() -> Void { let timeDuration = Int(grabarAudio!.currentTime) let horas = timeDuration / 3600 let minutos = (timeDuration % 3600)/60 let segundos = (timeDuration % 3600) % 60 var tiempo = "" tiempo += String(format: "%02d", horas) tiempo += ":" tiempo += String(format: "%02d", minutos) tiempo += ":" tiempo += String(format: "%02d", segundos) tiempoTranscurrido.text = tiempo } @IBAction func reproducirTapped(_ sender: Any) { do { try reproducirAudio = AVAudioPlayer(contentsOf: audioURL!) reproducirAudio!.play() } catch { } } @IBAction func agregarTapped(_ sender: Any) { let context = (UIApplication.shared.delegate as! AppDelegate).persistentContainer.viewContext let grabacion = Grabacion(context: context) grabacion.nombre = nombreTextField.text grabacion.audio = NSData(contentsOf: audioURL!)! as Data grabacion.duracion = tiempoTranscurrido.text (UIApplication.shared.delegate as! AppDelegate).saveContext() navigationController?.popViewController(animated: true) } func configurarGrabacion(){ do { //creando sesion de audio let session = AVAudioSession.sharedInstance() try session.setCategory(AVAudioSession.Category.playAndRecord, mode: AVAudioSession.Mode.default,options: []) try session.overrideOutputAudioPort(.speaker) try session.setActive(true) //creando direccion para el archivo de audio let basePath:String = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! let pathComponents = [basePath, "audio.m4a"] audioURL = NSURL.fileURL(withPathComponents: pathComponents)! //impresion de ruta donde guardan los archivos print("*****************") print(audioURL!) print("*****************") //crear opciones para el grabador de audio var settings:[String:AnyObject] = [:] settings[AVFormatIDKey] = Int(kAudioFormatMPEG4AAC) as AnyObject? settings[AVSampleRateKey] = 44100.0 as AnyObject? settings[AVNumberOfChannelsKey] = 2 as AnyObject? //crear el objeto de grabacion de audio grabarAudio = try AVAudioRecorder(url: audioURL!, settings: settings) grabarAudio!.prepareToRecord() } catch let error as NSError { print(error) } } @IBAction func controlVolumen(_ sender: Any) { reproducirAudio?.stop() reproducirAudio?.volume = slider.value reproducirAudio?.prepareToPlay() reproducirAudio?.play() } override func viewDidLoad() { super.viewDidLoad() configurarGrabacion() reproducirButton.isEnabled = false agregarButton.isEnabled = false tiempoTranscurrido.text = "0.0" } /* // MARK: - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // Get the new view controller using segue.destination. // Pass the selected object to the new view controller. } */ }
<?php namespace App\Livewire; use Livewire\Component; use App\Models\Profile; use App\Models\User; use Livewire\Attributes\Rule; class AddUser extends Component { public $profiles; #[Rule('required|integer', as: "Perfil")] public $profile_id; #[Rule('required|string|min:3', as: "Nome")] public $name; public function addUser() { #valida o form de acordo com as regras definidas nas propriedades #caso haja erro de validação, o método validate() retorna uma mensagem de erro disponível na view $this->validate(); //cria o objeto do modelo $user = new User(); //copia os dados sincronazidos do formulario para o objeto $user->profile_id = $this->profile_id; $user->name = $this->name; //mando salvar no BD $user->save(); //Vou gravar mensagem na sessão //O flash é para que a mensagem seja apagada da sessão logo após ser exibida session()->flash('response', 'Usuário cadastrado com sucesso!'); //Redireciona para a lista de usuários $this->redirect('/users', navigate: true); } public function render() { $this->profiles = Profile::all(); return view('livewire.add-user'); } }
/** ****************************************************************************** * @file stm32f7xx_hal_uart_ex.h * @author MCD Application Team * @brief Header file of UART HAL Extended module. ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef STM32F7xx_HAL_UART_EX_H #define STM32F7xx_HAL_UART_EX_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f7xx_hal_def.h" /** @addtogroup STM32F7xx_HAL_Driver * @{ */ /** @addtogroup UARTEx * @{ */ /* Exported types ------------------------------------------------------------*/ /** @defgroup UARTEx_Exported_Types UARTEx Exported Types * @{ */ #if defined(USART_CR1_UESM) /** * @brief UART wake up from stop mode parameters */ typedef struct { uint32_t WakeUpEvent; /*!< Specifies which event will activate the Wakeup from Stop mode flag (WUF). This parameter can be a value of @ref UART_WakeUp_from_Stop_Selection. If set to UART_WAKEUP_ON_ADDRESS, the two other fields below must be filled up. */ uint16_t AddressLength; /*!< Specifies whether the address is 4 or 7-bit long. This parameter can be a value of @ref UARTEx_WakeUp_Address_Length. */ uint8_t Address; /*!< UART/USART node address (7-bit long max). */ } UART_WakeUpTypeDef; #endif /* USART_CR1_UESM */ /** * @} */ /* Exported constants --------------------------------------------------------*/ /** @defgroup UARTEx_Exported_Constants UARTEx Exported Constants * @{ */ /** @defgroup UARTEx_Word_Length UARTEx Word Length * @{ */ #define UART_WORDLENGTH_7B USART_CR1_M1 /*!< 7-bit long UART frame */ #define UART_WORDLENGTH_8B 0x00000000U /*!< 8-bit long UART frame */ #define UART_WORDLENGTH_9B USART_CR1_M0 /*!< 9-bit long UART frame */ /** * @} */ /** @defgroup UARTEx_WakeUp_Address_Length UARTEx WakeUp Address Length * @{ */ #define UART_ADDRESS_DETECT_4B 0x00000000U /*!< 4-bit long wake-up address */ #define UART_ADDRESS_DETECT_7B USART_CR2_ADDM7 /*!< 7-bit long wake-up address */ /** * @} */ /** * @} */ /* Exported macros -----------------------------------------------------------*/ /* Exported functions --------------------------------------------------------*/ /** @addtogroup UARTEx_Exported_Functions * @{ */ /** @addtogroup UARTEx_Exported_Functions_Group1 * @{ */ /* Initialization and de-initialization functions ****************************/ HAL_StatusTypeDef HAL_RS485Ex_Init(UART_HandleTypeDef *huart, uint32_t Polarity, uint32_t AssertionTime, uint32_t DeassertionTime); /** * @} */ /** @addtogroup UARTEx_Exported_Functions_Group2 * @{ */ #if defined(USART_CR1_UESM) void HAL_UARTEx_WakeupCallback(UART_HandleTypeDef *huart); #endif /* USART_CR1_UESM */ /** * @} */ /** @addtogroup UARTEx_Exported_Functions_Group3 * @{ */ /* Peripheral Control functions **********************************************/ #if defined(USART_CR1_UESM) HAL_StatusTypeDef HAL_UARTEx_StopModeWakeUpSourceConfig(UART_HandleTypeDef *huart, UART_WakeUpTypeDef WakeUpSelection); HAL_StatusTypeDef HAL_UARTEx_EnableStopMode(UART_HandleTypeDef *huart); HAL_StatusTypeDef HAL_UARTEx_DisableStopMode(UART_HandleTypeDef *huart); #endif /* USART_CR1_UESM */ #if defined(USART_CR3_UCESM) HAL_StatusTypeDef HAL_UARTEx_EnableClockStopMode(UART_HandleTypeDef *huart); HAL_StatusTypeDef HAL_UARTEx_DisableClockStopMode(UART_HandleTypeDef *huart); #endif /* USART_CR3_UCESM */ HAL_StatusTypeDef HAL_MultiProcessorEx_AddressLength_Set(UART_HandleTypeDef *huart, uint32_t AddressLength); HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint16_t *RxLen, uint32_t Timeout); HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size); HAL_StatusTypeDef HAL_UARTEx_ReceiveToIdle_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size); HAL_UART_RxEventTypeTypeDef HAL_UARTEx_GetRxEventType(UART_HandleTypeDef *huart); /** * @} */ /** * @} */ /* Private macros ------------------------------------------------------------*/ /** @defgroup UARTEx_Private_Macros UARTEx Private Macros * @{ */ /** @brief Report the UART clock source. * @param __HANDLE__ specifies the UART Handle. * @param __CLOCKSOURCE__ output variable. * @retval UART clocking source, written in __CLOCKSOURCE__. */ #define UART_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ do { \ if((__HANDLE__)->Instance == USART1) \ { \ switch(__HAL_RCC_GET_USART1_SOURCE()) \ { \ case RCC_USART1CLKSOURCE_PCLK2: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK2; \ break; \ case RCC_USART1CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ break; \ case RCC_USART1CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_USART1CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if((__HANDLE__)->Instance == USART2) \ { \ switch(__HAL_RCC_GET_USART2_SOURCE()) \ { \ case RCC_USART2CLKSOURCE_PCLK1: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ break; \ case RCC_USART2CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ break; \ case RCC_USART2CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_USART2CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if((__HANDLE__)->Instance == USART3) \ { \ switch(__HAL_RCC_GET_USART3_SOURCE()) \ { \ case RCC_USART3CLKSOURCE_PCLK1: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ break; \ case RCC_USART3CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ break; \ case RCC_USART3CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_USART3CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if((__HANDLE__)->Instance == UART4) \ { \ switch(__HAL_RCC_GET_UART4_SOURCE()) \ { \ case RCC_UART4CLKSOURCE_PCLK1: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ break; \ case RCC_UART4CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ break; \ case RCC_UART4CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_UART4CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if ((__HANDLE__)->Instance == UART5) \ { \ switch(__HAL_RCC_GET_UART5_SOURCE()) \ { \ case RCC_UART5CLKSOURCE_PCLK1: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ break; \ case RCC_UART5CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ break; \ case RCC_UART5CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_UART5CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if((__HANDLE__)->Instance == USART6) \ { \ switch(__HAL_RCC_GET_USART6_SOURCE()) \ { \ case RCC_USART6CLKSOURCE_PCLK2: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK2; \ break; \ case RCC_USART6CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ break; \ case RCC_USART6CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_USART6CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if ((__HANDLE__)->Instance == UART7) \ { \ switch(__HAL_RCC_GET_UART7_SOURCE()) \ { \ case RCC_UART7CLKSOURCE_PCLK1: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ break; \ case RCC_UART7CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ break; \ case RCC_UART7CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_UART7CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else if ((__HANDLE__)->Instance == UART8) \ { \ switch(__HAL_RCC_GET_UART8_SOURCE()) \ { \ case RCC_UART8CLKSOURCE_PCLK1: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_PCLK1; \ break; \ case RCC_UART8CLKSOURCE_HSI: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_HSI; \ break; \ case RCC_UART8CLKSOURCE_SYSCLK: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_SYSCLK; \ break; \ case RCC_UART8CLKSOURCE_LSE: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_LSE; \ break; \ default: \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ break; \ } \ } \ else \ { \ (__CLOCKSOURCE__) = UART_CLOCKSOURCE_UNDEFINED; \ } \ } while(0U) /** @brief Report the UART mask to apply to retrieve the received data * according to the word length and to the parity bits activation. * @note If PCE = 1, the parity bit is not included in the data extracted * by the reception API(). * This masking operation is not carried out in the case of * DMA transfers. * @param __HANDLE__ specifies the UART Handle. * @retval None, the mask to apply to UART RDR register is stored in (__HANDLE__)->Mask field. */ #define UART_MASK_COMPUTATION(__HANDLE__) \ do { \ if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_9B) \ { \ if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ { \ (__HANDLE__)->Mask = 0x01FFU ; \ } \ else \ { \ (__HANDLE__)->Mask = 0x00FFU ; \ } \ } \ else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_8B) \ { \ if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ { \ (__HANDLE__)->Mask = 0x00FFU ; \ } \ else \ { \ (__HANDLE__)->Mask = 0x007FU ; \ } \ } \ else if ((__HANDLE__)->Init.WordLength == UART_WORDLENGTH_7B) \ { \ if ((__HANDLE__)->Init.Parity == UART_PARITY_NONE) \ { \ (__HANDLE__)->Mask = 0x007FU ; \ } \ else \ { \ (__HANDLE__)->Mask = 0x003FU ; \ } \ } \ else \ { \ (__HANDLE__)->Mask = 0x0000U; \ } \ } while(0U) /** * @brief Ensure that UART frame length is valid. * @param __LENGTH__ UART frame length. * @retval SET (__LENGTH__ is valid) or RESET (__LENGTH__ is invalid) */ #define IS_UART_WORD_LENGTH(__LENGTH__) (((__LENGTH__) == UART_WORDLENGTH_7B) || \ ((__LENGTH__) == UART_WORDLENGTH_8B) || \ ((__LENGTH__) == UART_WORDLENGTH_9B)) /** * @brief Ensure that UART wake-up address length is valid. * @param __ADDRESS__ UART wake-up address length. * @retval SET (__ADDRESS__ is valid) or RESET (__ADDRESS__ is invalid) */ #define IS_UART_ADDRESSLENGTH_DETECT(__ADDRESS__) (((__ADDRESS__) == UART_ADDRESS_DETECT_4B) || \ ((__ADDRESS__) == UART_ADDRESS_DETECT_7B)) /** * @} */ /* Private functions ---------------------------------------------------------*/ /** * @} */ /** * @} */ #ifdef __cplusplus } #endif #endif /* STM32F7xx_HAL_UART_EX_H */
// UIGuildInfo.h #pragma once #include "UIWindows.h" class CUIManager; class CUIGuildInfo; class CUIGuildMaster; extern int s_nTargetFireMemberIndex; enum GUILD_STATUS { G_NONE = (BYTE)-1, G_PERSON = 0, G_MASTER = 128, G_SUB_MASTER = 64, G_BATTLE_MASTER = 32 }; enum GUILD_TYPE { GT_NORMAL = 0x00, GT_ANGEL = 0x01 }; enum GUILD_RELATIONSHIP { GR_NONE = 0x00, GR_UNION = 0x01, GR_UNIONMASTER = 0x04, GR_RIVAL = 0x02, GR_RIVALUNION = 0x08 }; class CUIGuildInfo : public CUIControl { public: CUIGuildInfo(); virtual ~CUIGuildInfo(); protected: bool m_bOpened; int m_nCurrentTab; BOOL m_bRequestUnionList; char m_szRivalGuildName[MAX_GUILDNAME+1]; CUINewGuildMemberListBox m_GuildMemberListBox; CUIGuildNoticeListBox m_GuildNoticeListBox; CUIUnionGuildListBox m_UnionListBox; DWORD m_dwPopupID; CUIButton m_BreakUpGuildButton; CUIButton m_AppointButton; CUIButton m_DisbandButton; CUIButton m_FireButton; CUIButton m_BreakUnionButton; CUIButton m_BanUnionButton; protected: BOOL IsGuildMaster() { return ( Hero->GuildStatus == G_MASTER ); } BOOL IsSubGuildMaster() { return ( Hero->GuildStatus == G_SUB_MASTER ); } BOOL IsBattleMaster() { return ( Hero->GuildStatus == G_BATTLE_MASTER ); } int GetGuildMemberIndex( char* szName ); const char* GetGuildMasterName(); const char* GetSubGuildMasterName(); const char* GetBattleMasterName(); void CloseMyPopup(); void DoGuildInfoTabMouseAction(); void RenderGuildInfoTab(); void DoGuildMemberTabMouseAction(); void RenderGuildMemberTab(); void DoGuildUnionMouseAction(); void RenderGuildUnionTab(); public: void SetRivalGuildName( char* szName ); void AddGuildNotice( char* szText ); void ClearGuildLog(); void AddMemberList( GUILD_LIST_t* pInfo ); void ClearMemberList(); void AddUnionList( BYTE* pGuildMark, char* szGuildName, int nMemberCount ); int GetUnionCount(); void ClearUnionList(); virtual BOOL DoMouseAction(); virtual void Render(); void Open(); bool IsOpen(); virtual void Close(); }; void UseBattleMasterSkill ( void );
import Cart from "../../entities/Cart"; import ToBuyBook from "../../entities/ToBuyBook"; import IPago from "../../ports/IPago"; import IPersistenciaCarrito from "../../ports/persistencia/IPersistenciaCarrito"; import IPersistenciaLibro from "../../ports/persistencia/IPersistenciaLibro"; import GestionDeLibros from "../admin/GestionDeLibros"; export default class GestionDelCarrito { // rome-ignore lint/suspicious/noExplicitAny: <explanation> public static async pagarCarritoEnCaja(iPersistenciaLibro: IPersistenciaLibro, iPago: IPago, cart: Cart): Promise<any> { // 1. RESTAR LIBROS DEL STOCK DISPONIBLE const boughtBooks: ToBuyBook[] = []; for (const toBuyBook of cart.getToBuyBooks()) { const stockBook = await iPersistenciaLibro.buscarUnLibroPorISBN(toBuyBook.getIsbn()); if (stockBook) { // CONTINUAR SI ALGÚN LIBRO NO SE ACTUALIZA try { if (stockBook.getStock() >= toBuyBook.getCant() && toBuyBook.getCant() > 0) { stockBook.setStock(stockBook.getStock() - toBuyBook.getCant()); // Posible Error if (await GestionDeLibros.actualizarLibro(iPersistenciaLibro, stockBook)) boughtBooks.push(toBuyBook); } else if (stockBook.getStock() < toBuyBook.getCant() && stockBook.getStock() > 0 && toBuyBook.getCant() > 0) { toBuyBook.setCant(stockBook.getStock()); stockBook.setStock(0); // Posible Error if (await GestionDeLibros.actualizarLibro(iPersistenciaLibro, stockBook)) boughtBooks.push(toBuyBook); } } catch (error) { console.error(error); } } } if (boughtBooks.length === 0) return []; // if (boughtBooks = empty) return [] // 2. RECALCULAR CON LIBROS COMPRADOS cart.setToBuyBooks(boughtBooks); // 3. PROCESAR PAGO return { payment: await iPago.procesarPago(cart.getTotalPrice()), boughtBooks }; } public static guardarCarrito(iPersistenciaCarrito: IPersistenciaCarrito, cart: Cart): Promise<boolean> { return iPersistenciaCarrito.guardarCarrito(cart); } public static recuperarCarrito(iPersistenciaCarrito: IPersistenciaCarrito): Promise<Cart | null> { return iPersistenciaCarrito.recuperarCarrito(); } public static async agregarLibroAlCarrito(cart: Cart, toBuyBook: ToBuyBook): Promise<boolean> { cart.addToBuyBook(toBuyBook); return cart.getToBuyBooks().includes(toBuyBook); } public static async quitarLibroDelCarrito(cart: Cart, toBuyBook: ToBuyBook): Promise<boolean> { cart.rmToBuyBook(toBuyBook); return !cart.getToBuyBooks().includes(toBuyBook); } }
{% extends 'layout/base.html' %} {% load humanize %} {% block content%} {% load static %} <style> .lead { text-decoration: none; } .lead:hover { text-decoration: underline; } </style> <div class="container"> <div class="row d-flex justify-content-center"> <div class="col-8 mt-4"> {% if not cart_items%} <h2>No have no item in cart</h2> <a href="{% url 'home' %}"> <h4>Let's add some...</h4> </a> {%else%} <div class="card bg-dark text-light ml-0 mb-3"> <div class="card-body d-flex justify-content-between"> <div> <i class="fa fa-shopping-cart"></i> &nbsp; Shopping Cart </div> <a href="{% url 'home' %}" class="btn btn-outline-info btn-sm">Continue Shopping</a> </div> </div> <div class="card p-3 border-white border-3 shadow-sm"> <table class="table text-center align-middle"> <thead> <tr> <td></td> <td>Product list</td> <td>Price</td> <td>Quantity</td> <td>Total</td> <td></td> </tr> </thead> <tbody> {% for item in cart_items %} <tr> <td> <a href="{{item.product.get_detail}}"><img src="{{item.product.image.url}}" alt="" width="60px" height="60px"></a> </td> <td> <a class="lead" href="{{item.product.get_detail}}">{{item.product.name}}</a> </td> <td id="item_price_{{forloop.counter}}"> <p>{{item.product.price|intcomma}}</p> </td> <td> <button type="button" class="btn btn-light" onclick="onDecrease({{forloop.counter}})"><i class="fas fa-minus"></i></button> <span class="h4 mx-3" id="item_qty_{{forloop.counter}}">{{item.quantity}}</span> <button type="button" class="btn btn-light" onclick="onIncrease({{forloop.counter}})"><i class="fas fa-plus"></i></button> </td> <td id="item_subtotal_{{forloop.counter}}"> {{item.sub_total|intcomma}} </td> <td> <a class="btn btn-danger" onclick="return confirm('Are you sure?')" href="{% url 'removeFromCart' item.product.id %}"><i class="fa fa-trash"></i></a> </td> </tr> {%endfor%} </tbody> </table> <div class="float-end d-flex flex-column align-items-end"> <h4 class="mb-4">ยอดชำระเงิน {{total|intcomma}} บาท</h4> <form method="POST"> {% csrf_token %} <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="{{ data_key }}" data-amount="{{ stripe_total }}" data-name="Moo-Shop" data-description="{{ description }}" data-locale="thailand" data-currency="thb" data-shipping-address="true" data-billing-address="true" data-zip-code="true"> </script> </form> </div> </div> {%endif%} </div> </div> </div> <script> const onIncrease = (index) => { let qty = document.getElementById("item_qty_" + index) qty.innerText++ } const onDecrease = (index) => { let qty = document.getElementById("item_qty_" + index) if (qty.innerHTML < 2) { qty.innerHTML = 1 } else { qty.innerHTML-- } } </script> {% endblock %}
package hello.servlet.domain.member; import lombok.AccessLevel; import lombok.NoArgsConstructor; import java.util.*; @NoArgsConstructor(access = AccessLevel.PRIVATE) public class MemberRepository { private static Map<Long, Member> store = new HashMap<>(); private static long sequence = 0L; private static final MemberRepository instance = new MemberRepository(); public static MemberRepository getInstance() { return instance; } public Member save(Member member) { member.setId(++sequence); store.put(member.getId(), member); return member; } public Member findById(Long id) { return store.get(id); } public List<Member> findAll() { return new ArrayList<>(store.values()); } public void clearStore() { store.clear(); } }
# Chapter 20 : Callback - There are 2 Parts of Callback: 1. Good Part of callback - Callbacks are super important while writing asynchronous code in JS 2. Bad Part of Callback - callbacks inside callback leads to issues like - - Callback Hell - Inversion of control - Understanding Bad part of callback is super important to learn Promise in next chapter. > 💡 JavaScript is synchronous, single threaded language. It can Just do one thing at a time . JS Engine has just one call-stack where it executes code line by line, it does not wait. ```js console.log("Namaste"); console.log("JavaScript"); console.log("Season 2"); // Namaste // JavaScript // Season 2 // 💡 It is quickly printing because `Time, tide & Javascript waits for none.` ``` But what if we have to delay code execution of any line. We could utilize callback. ```js console.log("Namaste"); setTimeout(function () { console.log("JavaScript"); }, 5000); console.log("Season 2"); // Namaste // Season 2 // JavaScript // 💡 Here we are delaying the execution using callback approach of setTimeout. ``` **CALLBACK HELL** ----------------- ### 🛒 e-Commerce web app situation Assume a scenario of e-Commerce web, where one user is placing order, he has added items like, shoes, pants and kurta in cart and now he is placing order. So in backend the situation could look something like this. ```js const cart = ["shoes", "pants", "kurta"]; // Two steps to place an order // 1. Create a Order // 2. Proceed to Payment // It could look something like this: api.createOrder(); api.proceedToPayment(); ``` Assumption, once order is created then only we can proceed to payment, so there is a dependency. So How to manage this dependency. Callback can come to the rescue, How? ```js api.createOrder(cart, function () { api.proceedToPayment(); }); // 💡 Over here `createOrder` api is first creating a order then it is responsible to call `api.proceedToPayment()` as part of callback approach. ``` To make it a bit complicated, what if after the payment, you have to show Order summary by calling `api.showOrderSummary()` and now it has dependency on `api.proceedToPayment()` Now my code should look something like this: ```js api.createOrder(cart, function () { api.proceedToPayment(function () { api.showOrderSummary(); }); }); ``` Now what if we have to update the wallet, now this will have a dependency over `showOrderSummary` ```js api.createOrder(cart, function () { api.proceedToPayment(function () { api.showOrderSummary(function () { api.updateWallet(); }); }); }); // 💡 Callback Hell - callbacks inside callback creates a call back hell structure. ``` When we have a large codebase having numbers of APIs with internal dependancies to each other, then we fall into callback hell where the code will grow horizontally and it is very difficult to read and maintain.This callback hell structure is also known as **Pyramid of Doom**. Till this point we are comfortable with concept of callback hell but now lets discuss about `Inversion of Control`. It is very important to understand in order to get comfortable around the concept of promise. **INVERSION OF CONTROL** ------------------------ > 💡 Inversion of control is like, you lose the control of code when we are using callbacks. Let's understand with the help of example code and comments: ```js api.createOrder(cart, function () { api.proceedToPayment(); }); // 💡 So over here, we are creating an order and then we are blindly trusting `createOrder`API to call `proceedToPayment`. // 💡 It is risky, as `proceedToPayment` is important part of code and we are blindly trusting `createOrder` to call it and handle it. // 💡 When we pass a function as a callback, basically we are dependant on our parent function that it is his responsibility to run that function. This is called `inversion of control` because we are dependant on that function. What if parent function stopped working, what if it was developed by another programmer or callback runs two times or it never runs at all. // 💡 In next chapter, we will see how we can fix such problems. ``` > 💡 Async programming in JavaScript exists because callback exits. more at `http://callbackhell.com/` <hr> Watch Live On Youtube below: <a href="https://www.youtube.com/watch?v=yEKtJGha3yM&list=PLlasXeu85E9eWOpw9jxHOQyGMRiBZ60aX" target="_blank"><img src="https://img.youtube.com/vi/yEKtJGha3yM/0.jpg" width="750" alt="callback Youtube Link"/></a>
/* * @Author: Carlos * @Date: 2023-01-16 14:11:09 * @LastEditTime: 2023-05-22 22:36:01 * @FilePath: /vite-react-swc/src/pages/blog/blog-hero/index.tsx * @Description: */ import clsx from 'clsx' import { useEffect, useLayoutEffect, useRef } from 'react' import { useSpring, animated } from '@react-spring/web' import { OverlayPanel } from 'primereact/overlaypanel' import ResentPosts from './ResentPost' import useImage from '@/hooks/useImage' import Loading from '@/components/base/Loading' import styled from './blog-hero.module.scss' import sharedStyled from '../blog.module.scss' import { isMobile } from '@/const' const CARD_IMAGE = '/static-api/blog/undraw_augmented_reality.svg' const CLOUD_BG = '/static-api/blog/cloud.png' const MOUNTAIN_BG = '/static-api/blog/painting-bg-m.png' type Props = {} function BlogHero({}: Props) { const op = useRef<OverlayPanel>(null) const [personStyles, personApi] = useSpring(() => ({ from: { opacity: 0, x: -300 } })) const [bgStyles, bgApi] = useSpring(() => ({ from: { opacity: 0, y: 300 } })) const [textStyles, textApi] = useSpring(() => ({ from: { opacity: 0, y: 300 } })) const [imageStyles, imageApi] = useSpring(() => ({ from: { opacity: 0, x: 300 } })) const [resentStyles, resentApi] = useSpring(() => ({ from: { opacity: 0, y: 300 } })) const { done: cardImageDone } = useImage(CARD_IMAGE) const { done: mountainBgDone } = useImage(MOUNTAIN_BG) useLayoutEffect(() => { if (!cardImageDone) return const baseDelay = 300 personApi.start({ to: { opacity: 1, x: 0 }, delay: baseDelay, config: { duration: 500 } }) textApi.start({ to: { opacity: 1, y: 0 }, delay: baseDelay + 300, config: { duration: 800 } }) imageApi.start({ to: { opacity: 1, x: 0 }, delay: baseDelay + 600, config: { duration: 500 } }) resentApi.start({ to: { opacity: 1, y: 0 }, delay: baseDelay + 1000, config: { duration: 500 } }) }, [cardImageDone]) useLayoutEffect(() => { bgApi.start({ to: { opacity: 1, y: 0 }, config: { duration: 6000 } }) }, [mountainBgDone]) useEffect(() => { window.scrollTo(0, 0) }, []) return ( <div className={clsx('min-h-[calc(100vh-49px)]', { // [sharedStyled['paint-bg']]: mountainBgDone })} > <animated.div className={clsx('fixed w-full min-h-[calc(100vh-49px)]', { [sharedStyled['paint-bg']]: mountainBgDone })} style={bgStyles} /> {(!cardImageDone || !mountainBgDone) && ( <div className="fixed mt-32 mx-auto text-center w-full"> <Loading.Circle /> </div> )} <div className="relative"> <div className="bg-cover bg-no-repeat" style={{ backgroundImage: `url(${CLOUD_BG})` }} > <div className={clsx('w-full sm:max-w-[960px] m-auto ', { 'pt-16': !isMobile })} > <div className="grid grid-cols-1 sm:grid-cols-2"> <div className="text-right"> <div className="pr-12"> <animated.div className="inline-flex justify-center items-center rounded-xl px-6 py-4" style={{ ...personStyles }} > <div className="mt-6 mb-2 mr-8"> <img className="h-[100px] aspect-square rounded-[30%] bg-gray-100" style={{ boxShadow: '-5px -5px 8px #ffffff7a, 5px 5px 8px #a9a9aa7a' }} alt="" src="https://i.ibb.co/kKrFWfS/Wechat-IMG28.jpg" /> </div> <div className="mt-2"> <div className={clsx(styled.info, 'info text-center mt-2')}> <p className="font-bold text-xl">Carlos Woo</p> <p className="font-bold text-sm">Web Dev</p> </div> <button className={clsx(styled.button, 'mt-3 color-white px-4 py-1 rounded-xl')} onClick={e => op.current!.toggle(e)} > Contact </button> <OverlayPanel ref={op}> <div>WeChat: tabe1991</div> <div>Email: kaijinwooo@gmail.com</div> </OverlayPanel> </div> </animated.div> </div> <animated.div className="text-left text-xl px-4" style={{ ...textStyles }}> <p className="text-2xl text-left">Hello, this is Carlos. </p> <p> This blog records some personal experience in learning programming, and the articles would be write with Markdown syntax. It is more about notes or snippets than tutorials. </p> <p>Thanks for visit!</p> </animated.div> </div> <div className={clsx({ 'pt-12': !isMobile, 'pt-2': isMobile })} > <animated.div style={{ ...imageStyles }}> <img src={CARD_IMAGE} alt="" /> </animated.div> </div> </div> </div> </div> </div> <animated.div className={clsx('container sm:min-w-[600px] lg:max-w-[1200px] m-auto')} style={{ ...resentStyles }} > <ResentPosts /> </animated.div> </div> ) } export default BlogHero
@extends('app') @section('title', 'Lista de estudantes') @section('content') <h1>Lista Estudantes</h1> <table class="table"> <thead> <tr> <th scope="col">ID</th> <th scope="col">Nome</th> <th scope="col">Cpf</th> <th scope="col">Data Nascimento</th> </tr> </thead> <tbody> @foreach ($students as $student) <tr> <th space="row"> {{ $student->id }} </th> <td> <a href="{{ route('students.show', $student)}}"> {{ $student->nome }} </a> </td> <td> {{ $student->cpf }} </td> <td id="btnAcao"> <a class="btn btn-primary" href="{{route('students.edit', $student)}}">Editar</a> <form action="{{route('students.destroy', $student)}}" method="POST"> @csrf @method('DELETE') <button class="btn btn-danger" type="submit" onclick="return confirm('Tem certeza que deseja apagar?')"> Deletar </button> </form> </td> </tr> @endforeach </tbody> </table> <a class="btn btn-success" href="{{ route('students.create') }}">Novo Estudante</a> @endsection
html { font-size: 100%; box-sizing: border-box; } *, *::before, *::after { box-sizing: inherit; } body { margin: 0; padding: 0; font-family: "Public Sans", sans-serif; font-size: $font-med; font-weight: 300; color: $grayishBlue; line-height: 1.3; &.noscroll { overflow: hidden; } @include breakpoint-up(large) { font-size: $font-med; } } section { overflow: hidden; } ul, ol { list-style: none; margin: 0; padding: 0; } a, a:visited, a:hover { text-decoration: none; cursor: pointer; } p { margin: 0; line-height: 1.5; } h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 300; color: $darkBlue; } h1 { margin-bottom: 1.5rem; font-size: 2.3125rem; @include breakpoint-up(large) { font-size: $font-xlg; } } h2 { margin-bottom: 1.5625rem; font-size: 1.875rem; @include breakpoint-up(large) { font-size: 2.25rem; } } button, .button { position: relative; display: inline-block; cursor: pointer; border-radius: 50px; border: 0; padding: 0.875rem 2.1875rem; background-image: linear-gradient(to right, $limeGreen, $brightCyan); font-size: $font-sm; font-weight: 400; color: $white; &::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; border-radius: 50px; background-color: rgba(255, 255, 255, 0.25); transition: opacity 300ms ease-in-out; } &:hover::before { opacity: 1; } } // Spacing .container { margin: 0 auto; max-width: 69.375rem; &--pall { padding-top: 4.375rem; padding-right: 1.5rem; padding-bottom: 4.375rem; padding-left: 1.5rem; @include breakpoint-up(large) { padding-top: 6rem; padding-bottom: 6rem; } } } // Flexbox .flex { display: flex; &-jc-sb { justify-content: space-between; } &-jc-c { justify-content: center; } &-ai-c { align-items: center; } } // Visibility .hide-for-mobile { //hide for tablet and mobile @include breakpoint-down(medium) { display: none; } } .hide-for-desktop { //hide for desktop viewport widths @include breakpoint-up(large) { display: none; } }
#include <condition_variable> #include <cstdlib> #include <ctime> #include <future> #include <iostream> #include <mutex> #include <string> #include <thread> std::mutex mut; std::condition_variable reporter; bool finished_1st = false; bool finished_2nd = false; bool finished_3rd = false; double arr_fill(double *nums, int size) { srand(time(NULL)); for (int i = 0; i < size; i++) { int ran = rand() % 1000; nums[i] = ran + 1; std::cout << nums[i] << " "; } std::cout << std::endl; return *nums; } void sorter(double *nums, int start_point, int end_point, const std::string name) { int temp = 0; for (int i = start_point; i < end_point - 1; i++) { int min = i; for (int j = i + 1; j < end_point; j++) { if (nums[j] < nums[min]) { min = j; } } temp = nums[i]; nums[i] = nums[min]; nums[min] = temp; } for (size_t i = start_point; i < end_point; ++i) { std::cout << name << " "; std::this_thread::sleep_for(std::chrono::milliseconds(10)); std::cout << nums[i] << std::endl; } if (name == "threads_1" or name == "asyncs_1") { finished_1st = true; reporter.notify_one(); } if (name == "threads_2" or name == "asyncs_2") { finished_2nd = true; reporter.notify_one(); } if (name == "threads_3" or name == "asyncs_3") { finished_3rd = true; reporter.notify_one(); } } int main() { int size = 12; double *arr_async = new double[size]; double *arr_thread = new double[size]; std::cout << "Array for async" << std::endl; arr_fill(arr_async, size); std::cout << std::endl; { std::unique_lock<std::mutex> lock(mut); std::future<void> async_1 = std::async(sorter, arr_async, 0, 6, "asyncs_1"); while (!finished_1st) { reporter.wait(lock); } finished_1st = false; std::cout << "\nFirst async ready\n" << std::endl; std::future<void> async_2 = std::async(sorter, arr_async, 6, 12, "asyncs_2"); while (!finished_2nd) { reporter.wait(lock); } finished_2nd = false; std::cout << "\nSecond async ready\n" << std::endl; std::future<void> async_3 = std::async(sorter, arr_async, 0, 12, "asyncs_3"); while (!finished_3rd) { reporter.wait(lock); } finished_3rd = false; std::cout << "\nThird async ready\n" << std::endl; std::cout << "Array for async after sort" << std::endl; for (int i = 0; i < size; i++) { std::cout << arr_async[i] << " "; } std::cout << std::endl << std::endl; } std::cout << "Array for thread" << std::endl; arr_fill(arr_thread, size); std::cout << std::endl; { std::unique_lock<std::mutex> lock(mut); std::thread thread_1(sorter, arr_thread, 0, 6, "threads_1"); while (!finished_1st) { reporter.wait(lock); } thread_1.join(); std::cout << "\nFirst thread ready\n" << std::endl; std::thread thread_2(sorter, arr_thread, 6, 12, "threads_2"); while (!finished_2nd) { reporter.wait(lock); } thread_2.join(); std::cout << "\nSecond thread ready\n" << std::endl; std::thread thread_3(sorter, arr_thread, 0, 12, "threads_3"); while (!finished_3rd) { reporter.wait(lock); } thread_3.join(); std::cout << "\nThird thread ready\n" << std::endl; std::cout << "Array for thread after sort" << std::endl; for (int i = 0; i < size; i++) { std::cout << arr_thread[i] << " "; } std::cout << std::endl; } }
# Copyright (c) 2023. LanceDB Developers # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from functools import cached_property from typing import List, Union import numpy as np import pyarrow as pa from ..util import attempt_import_or_raise from .base import EmbeddingFunction from .registry import register from .utils import AUDIO, IMAGES, TEXT from lancedb.pydantic import PYDANTIC_VERSION @register("imagebind") class ImageBindEmbeddings(EmbeddingFunction): """ An embedding function that uses the ImageBind API For generating multi-modal embeddings across six different modalities: images, text, audio, depth, thermal, and IMU data to download package, run : `pip install imagebind-packaged==0.1.2` """ name: str = "imagebind_huge" device: str = "cpu" normalize: bool = False if PYDANTIC_VERSION < (2, 0): # Pydantic 1.x compat class Config: keep_untouched = (cached_property,) else: model_config = dict() model_config["ignored_types"] = (cached_property,) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._ndims = 1024 self._audio_extensions = (".mp3", ".wav", ".flac", ".ogg", ".aac") self._image_extensions = (".jpg", ".jpeg", ".png", ".gif", ".bmp") @cached_property def embedding_model(self): """ Get the embedding model. This is cached so that the model is only loaded once per process. """ return self.get_embedding_model() @cached_property def _data(self): """ Get the data module from imagebind """ data = attempt_import_or_raise("imagebind.data", "imagebind") return data @cached_property def _ModalityType(self): """ Get the ModalityType from imagebind """ imagebind = attempt_import_or_raise("imagebind", "imagebind") return imagebind.imagebind_model.ModalityType def ndims(self): return self._ndims def compute_query_embeddings( self, query: Union[str], *args, **kwargs ) -> List[np.ndarray]: """ Compute the embeddings for a given user query Parameters ---------- query : Union[str] The query to embed. A query can be either text, image paths or audio paths. """ query = self.sanitize_input(query) if query[0].endswith(self._audio_extensions): return [self.generate_audio_embeddings(query)] elif query[0].endswith(self._image_extensions): return [self.generate_image_embeddings(query)] else: return [self.generate_text_embeddings(query)] def generate_image_embeddings(self, image: IMAGES) -> np.ndarray: torch = attempt_import_or_raise("torch") inputs = { self._ModalityType.VISION: self._data.load_and_transform_vision_data( image, self.device ) } with torch.no_grad(): image_features = self.embedding_model(inputs)[self._ModalityType.VISION] if self.normalize: image_features /= image_features.norm(dim=-1, keepdim=True) return image_features.cpu().numpy().squeeze() def generate_audio_embeddings(self, audio: AUDIO) -> np.ndarray: torch = attempt_import_or_raise("torch") inputs = { self._ModalityType.AUDIO: self._data.load_and_transform_audio_data( audio, self.device ) } with torch.no_grad(): audio_features = self.embedding_model(inputs)[self._ModalityType.AUDIO] if self.normalize: audio_features /= audio_features.norm(dim=-1, keepdim=True) return audio_features.cpu().numpy().squeeze() def generate_text_embeddings(self, text: TEXT) -> np.ndarray: torch = attempt_import_or_raise("torch") inputs = { self._ModalityType.TEXT: self._data.load_and_transform_text( text, self.device ) } with torch.no_grad(): text_features = self.embedding_model(inputs)[self._ModalityType.TEXT] if self.normalize: text_features /= text_features.norm(dim=-1, keepdim=True) return text_features.cpu().numpy().squeeze() def compute_source_embeddings( self, source: Union[IMAGES, AUDIO], *args, **kwargs ) -> List[np.array]: """ Get the embeddings for the given sourcefield column in the pydantic model. """ source = self.sanitize_input(source) embeddings = [] if source[0].endswith(self._audio_extensions): embeddings.extend(self.generate_audio_embeddings(source)) return embeddings elif source[0].endswith(self._image_extensions): embeddings.extend(self.generate_image_embeddings(source)) return embeddings else: embeddings.extend(self.generate_text_embeddings(source)) return embeddings def sanitize_input( self, input: Union[IMAGES, AUDIO] ) -> Union[List[bytes], np.ndarray]: """ Sanitize the input to the embedding function. """ if isinstance(input, (str, bytes)): input = [input] elif isinstance(input, pa.Array): input = input.to_pylist() elif isinstance(input, pa.ChunkedArray): input = input.combine_chunks().to_pylist() return input def get_embedding_model(self): """ fetches the imagebind embedding model """ imagebind = attempt_import_or_raise("imagebind", "imagebind") model = imagebind.imagebind_model.imagebind_huge(pretrained=True) model.eval() model.to(self.device) return model
<template> <div class="container text-start"> <h1 class="text-primary fw-bold">Agregar Nuevo Producto</h1> <div class="card"> <div class="card-header fw-bold">Producto</div> <div class="card-body"> <form @submit.prevent="createProduct"> <div class="row mb-3"> <label for="name" class="form-label">Nombre</label> <div class="input-group"> <div class="input-group-text"> <font-awesome-icon icon="tag" /> </div> <input type="text" class="form-control" id="name" placeholder="Nombre" v-model="product.name" required /> </div> </div> <div class="row mb-3"> <label for="price" class="form-label">Precio</label> <div class="input-group"> <div class="input-group-text"> <font-awesome-icon icon="dollar-sign" /> </div> <input type="number" class="form-control" id="price" placeholder="Precio" v-model="product.price" required /> </div> </div> <div class="row mb-3"> <label for="stock" class="form-label">Stock</label> <div class="input-group"> <div class="input-group-text"> <font-awesome-icon icon="boxes" /> </div> <input type="number" class="form-control" id="stock" placeholder="Stock" v-model="product.stock" required /> </div> </div> <div class="row mb-3"> <label for="category_id" class="form-label">Categoría</label> <div class="input-group"> <div class="input-group-text"> <font-awesome-icon icon="folder" /> </div> <select class="form-select" id="category_id" v-model="product.category_id" required> <option v-for="categoria in categorias" :value="categoria.id">{{ categoria.name }}</option> </select> </div> </div> <button type="submit" class="btn btn-success">Agregar</button> <button type="button" class="btn btn-secondary mx-2" @click="cancelar">Cancelar</button> </form> </div> </div> </div> </template> <script> import axios from 'axios'; import Swal from 'sweetalert2'; export default { name: 'NewProducto', data() { return { product: { name: '', price: 0, stock: 0, category_id: '' }, categorias: [], errorMessage: '' }; }, methods: { cancelar() { this.$router.push({ name: 'productos' }); }, async createProduct() { try { const res = await axios.post('http://127.0.0.1:8000/api/productos', this.product); if (res.status === 201) { this.$router.push({ name: 'productos' }); Swal.fire({ position: 'center', icon: 'success', title: 'Producto creado exitosamente', showConfirmButton: false, timer: 2000 }); } } catch (error) { if (error.response && error.response.status === 422) { this.errorMessage = 'El nombre del producto ya existe.'; } else { this.errorMessage = 'Ocurrió un error al crear el producto.'; } } }, async loadCategorias() { try { const response = await axios.get('http://127.0.0.1:8000/api/categorias'); this.categorias = response.data.categorias; } catch (error) { this.errorMessage = 'Ocurrió un error al cargar las categorías.'; } } }, mounted() { this.loadCategorias(); } } </script> <style scoped> /* Tus estilos aquí */ </style>
package com.benewake.system.controller; import com.alibaba.excel.EasyExcel; import com.benewake.system.entity.Result; import com.benewake.system.entity.dto.ApsDailyDataUploadDto; import com.benewake.system.entity.enums.ExcelOperationEnum; import com.benewake.system.entity.vo.*; import com.benewake.system.entity.vo.baseParam.SearchLikeParam; import com.benewake.system.excel.entity.ExcelDailyDataUploadTemplate; import com.benewake.system.exception.BeneWakeException; import com.benewake.system.service.ApsDailyDataUploadService; import com.benewake.system.service.InterfaceService; import com.benewake.system.utils.ResponseUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.servlet.http.HttpServletResponse; import javax.websocket.server.PathParam; import java.time.LocalDateTime; import java.util.Collection; import java.util.List; import java.util.Objects; @Slf4j @Api(tags = "接口数据") @RestController @RequestMapping("/interface") public class InterfaceController { @Autowired private InterfaceService interfaceService; @Autowired private ApsDailyDataUploadService dailyDataUploadService; @ApiOperation("查询") @GetMapping("/getAllPage/{page}/{size}") public Result getAllPage(@PathVariable("page") Integer page, @PathVariable("size") Integer size, @PathParam("type") Integer type) { PageResultVo<Object> apsResult = interfaceService.getAllPage(page, size, type); return Result.ok(apsResult); } @ApiOperation("查询筛选") @PostMapping("/getPageFiltrate/{page}/{size}") public Result getPageFiltrate(@PathVariable("page") Integer page, @PathVariable("size") Integer size, @RequestBody(required = false) QueryViewParams queryViewParams) { ResultColPageVo<Object> apsResult = interfaceService.getPageFiltrate(page, size, queryViewParams); return Result.ok(apsResult); } @ApiOperation("新增") @PostMapping("/add") public Result add(@RequestBody String request, @PathParam("type") Integer type) { Boolean res = interfaceService.add(request, type); return res ? Result.ok() : Result.fail(); } @ApiOperation("修改") @PostMapping("/update") public Result update(@RequestBody String request, @PathParam("type") Integer type) { Boolean res = interfaceService.update(request, type); return res ? Result.ok() : Result.fail(); } @ApiOperation("删除") @PostMapping("/delete") public Result delete(@RequestBody List<Integer> ids, @PathParam("type") Integer type) { if (CollectionUtils.isEmpty(ids)) { return Result.fail("id不能为null"); } Boolean res = interfaceService.delete(ids, type); return res ? Result.ok() : Result.fail(); } @ApiOperation("自动补全") @PostMapping("/searchLike") public Result searchLike(@RequestBody SearchLikeParam searchLikeParam) { List<Object> res = interfaceService.searchLike(searchLikeParam); return Result.ok(res); } @ApiOperation("导出接口数据") @PostMapping("/downloadInterfaceDate") public void downloadSchemeManagement(@RequestBody DownloadViewParams downloadParam, HttpServletResponse response) { if (downloadParam == null || downloadParam.getTableId() == null || downloadParam.getType() == null || (downloadParam.getType() == ExcelOperationEnum.CURRENT_PAGE.getCode() && (downloadParam.getPage() == null || downloadParam.getSize() == null))) { throw new BeneWakeException("数据不正确"); } interfaceService.downloadInterfaceDate(response, downloadParam); } @ApiOperation("下载导入模板") @PostMapping("/downloadInterfaceTemplate") public void downloadInterfaceTemplate(@PathParam("type") Integer type, HttpServletResponse response) { interfaceService.downloadInterfaceTemplate(type, response); } @ApiOperation("导入接口数据") @PostMapping("/importInterfaceData") public Result importInterfaceData(@PathParam("code") Integer code, @PathParam("type") Integer type, @RequestParam("file") MultipartFile file) { if (file.isEmpty()) { return Result.fail("文件为空!"); } String[] split = Objects.requireNonNull(file.getOriginalFilename()).split("\\."); if (!"xlsx".equals(split[1]) && !"xls".equals(split[1])) { return Result.fail("请提供.xlsx或.xls为后缀的Excel文件"); } Boolean res = interfaceService.importInterfaceData(code, type, file); return res ? Result.ok() : Result.fail(); } // -----------------MES集合--------------------- // @ApiOperation("获取日别数据") // @GetMapping("/getMesList/{page}/{size}") // public Result getMesList(@PathVariable Integer page, @PathVariable Integer size) { // Result result = interfaceService.getMesList(page, size); // return result; // } // ---------------日别数据-------------------- // @ApiOperation("获取日别数据") // @GetMapping("/getDailyDataList/{page}/{size}") // public Result getDailyDataList(@PathVariable Integer page, @PathVariable Integer size) { // PageResultVo<ApsDailyDataUploadDto> pageResultVo = dailyDataUploadService.getDailyDataListPage(page, size); // return Result.ok(pageResultVo); // } @ApiOperation("获取日别数据") @PostMapping("/getDailyDataFilter/{page}/{size}") public Result getDailyDataFilter(@PathVariable Integer page, @PathVariable Integer size, @RequestBody(required = false) QueryViewParams queryViewParams) { ResultColPageVo<ApsDailyDataUploadDto> pageResultVo = dailyDataUploadService.getDailyDataFilter(page, size, queryViewParams); return Result.ok(pageResultVo); } @ApiOperation("自动补全") @PostMapping("/dailyDatasearchLike") public Result dailyDatasearchLike(@RequestBody SearchLikeParam searchLikeParam) { List<Object> res = dailyDataUploadService.searchLike(searchLikeParam); return Result.ok(res); } @ApiOperation("增加或修改日别数据") @PostMapping("/addOrUpdateDailyData") public Result addOrUpdateDailyData(@RequestBody ApsDailyDataUploadParam dailyDataUploadParam) { if (dailyDataUploadParam == null) { return Result.fail("数据不能为null"); } Boolean res = dailyDataUploadService.addOrUpdateDailyData(dailyDataUploadParam); return res ? Result.ok() : Result.fail(); } @ApiOperation("删除日别数据") @PostMapping("/removeDailyData") public Result removeDailyData(@RequestBody List<Integer> ids) { if (CollectionUtils.isEmpty(ids)) { return Result.fail("id不能为null"); } Boolean res = dailyDataUploadService.removeByIdList(ids); return res ? Result.ok() : Result.fail(); } @ApiOperation("导出日别数据") @PostMapping("/downloadDailyData") public void downloadDailyData(@RequestBody DownloadViewParams downloadParam, HttpServletResponse response) { if (downloadParam == null || downloadParam.getType() == null || (downloadParam.getType() == ExcelOperationEnum.CURRENT_PAGE.getCode() && (downloadParam.getPage() == null || downloadParam.getSize() == null))) { throw new BeneWakeException("数据不正确"); } dailyDataUploadService.downloadDailyData(response, downloadParam); } @ApiOperation("导入日别数据") @PostMapping("/importloadDailyData") public Result importloadDailyData(@PathParam("type") Integer type, @RequestParam("file") MultipartFile file) { if (file.isEmpty()) { return Result.fail("文件为空!"); } String[] split = Objects.requireNonNull(file.getOriginalFilename()).split("\\."); if (!"xlsx".equals(split[1]) && !"xls".equals(split[1])) { return Result.fail("请提供.xlsx或.xls为后缀的Excel文件"); } Boolean res = dailyDataUploadService.importloadDailyData(type, file); return res ? Result.ok() : Result.fail(); } @ApiOperation("下载导入日别数据模板") @PostMapping("/downloadDailyDataUploadTemplate") public void downloadDailyDataUploadTemplate(HttpServletResponse response) { try { ResponseUtil.setFileResp(response, "日别数据模板"); EasyExcel.write(response.getOutputStream(), ExcelDailyDataUploadTemplate.class) .sheet("sheet1").doWrite((Collection<?>) null); } catch (Exception e) { log.info("下载导入日别数据模板失败" + LocalDateTime.now()); throw new BeneWakeException("下载导入日别数据模板失败"); } } }
package com.example.completablefuture.completionstage; import lombok.extern.slf4j.Slf4j; import java.util.concurrent.CompletionStage; import java.util.concurrent.Executor; import java.util.concurrent.Executors; @Slf4j public class CompletionStageThenAcceptAsyncExecutorExample { public static void main(String[] args) throws InterruptedException { var single = Executors.newSingleThreadExecutor(); var fixed = Executors.newFixedThreadPool(10); log.info("start main"); CompletionStage<Integer> stage = Helper.completionStage(); // 종료 // 바로 종료 stage.thenAcceptAsync(i -> { // 별도 실행 log.info("{} in thenAcceptAsync", i); }, fixed).thenAcceptAsync(i -> { // 별도 실행 log.info("{} in thenAcceptAsync2", i); }, single); log.info("after thenAccept"); Thread.sleep(200); single.shutdown(); fixed.shutdown(); // ForkJoinPool 외 다른 쓰레드에서 실행 시키는 것도 가능하다! } }
package cli import ( "context" "fmt" "os" "slices" "strconv" "strings" "text/tabwriter" "time" "github.com/enrichman/kubectl-epinio/pkg/epinio" "k8s.io/client-go/kubernetes" _ "embed" ) const format = "%-15s %s\n" // EpinioCLI handles the CLI commands, calling the Kubernetes API and handling the display type EpinioCLI struct { KubeClient *epinio.KubeClient //TODO: add output and logs } func NewEpinioCLI(kubeClient kubernetes.Interface) (e *EpinioCLI) { return &EpinioCLI{ KubeClient: epinio.NewKubeClient(kubeClient), } } func (e *EpinioCLI) GetUsers(ctx context.Context, usernames []string) error { users, err := e.KubeClient.ListUsers(ctx) if err != nil { return err } users = filterAndSortUsers(usernames, users) w := new(tabwriter.Writer) w.Init(os.Stdout, 0, 8, 2, '\t', 0) fmt.Fprintln(w, "USERNAME\tADMIN\tROLES\tAGE") for _, u := range users { var roles int if u.Role != "" { roles = 1 } else if len(u.Roles) > 0 { roles = len(u.Roles) } age := "-" if u.CreationTimestamp.Unix() > 0 { age = time.Since(u.CreationTimestamp).Truncate(time.Second).String() } fmt.Fprintf(w, "%s\t%t\t%d\t%s\n", u.Username, u.IsAdmin(), roles, age) } return w.Flush() } func (e *EpinioCLI) DescribeUsers(ctx context.Context, usernames []string) error { users, err := e.KubeClient.ListUsers(ctx) if err != nil { return err } users = filterAndSortUsers(usernames, users) format := "%-15s %s\n" for i, u := range users { if i != 0 { fmt.Println("---") } fmt.Printf(format, "Username:", u.Username) fmt.Printf(format, "Password:", u.Password) printArray("Roles:", u.Roles) printArray("Namespaces:", u.Namespaces) } return nil } func (e *EpinioCLI) DescribeRoles(ctx context.Context, ids []string) error { roles, err := e.KubeClient.ListRoles(ctx) if err != nil { return err } roles = filterAndSortRoles(ids, roles) format := "%-15s %s\n" for i, r := range roles { if i != 0 { fmt.Println("---") } fmt.Printf(format, "ID:", r.ID) fmt.Printf(format, "Name:", r.Name) fmt.Printf(format, "Default:", strconv.FormatBool(r.Default)) printArray("Actions:", r.Actions) } return nil } func filterAndSortUsers(usernames []string, users []epinio.User) []epinio.User { // if usernames are not specified sort and return all if len(usernames) == 0 { slices.SortFunc(users, func(i, j epinio.User) int { return strings.Compare(i.Username, j.Username) }) return users } return filterUsers(usernames, users) } func filterUsers(usernames []string, users []epinio.User) []epinio.User { usersMap := map[string]epinio.User{} for _, u := range users { usersMap[u.Username] = u } filtered := []epinio.User{} for _, username := range usernames { if _, found := usersMap[username]; found { filtered = append(filtered, usersMap[username]) } } return filtered } func printArray(description string, arr []string) { if len(arr) == 0 { fmt.Printf(format, description, "") } for i, ns := range arr { var leftCol string if i == 0 { leftCol = description } fmt.Printf(format, leftCol, ns) } fmt.Println() }
"""Month table model.""" from PyQt5 import QtCore, QtGui, QtWidgets from scheduler.api.common.date_time import Date, TimeDelta from ._base_table_model import BaseTableModel class BaseMonthModel(BaseTableModel): """Base model for month table.""" def __init__( self, calendar, calendar_month=None, weekday_start=0, parent=None): """Initialise calendar month model. Args: calendar (Calendar): the calendar this is using. calendar_month (CalendarMonth or None): the calendar month this is modelling. If not given, use current month. weekday_start (int or str): week starting day, ie. day that the leftmost column should represent. parent (QtWidgets.QWidget or None): QWidget that this models. """ if isinstance(weekday_start, str): weekday_start = Date.weekday_int_from_string(weekday_start) self.weekday_start = weekday_start if calendar_month is None: date = Date.now() calendar_month = calendar.get_month(date.year, date.month) num_rows = len(calendar_month.get_calendar_weeks(weekday_start)) num_cols = 7 super(BaseMonthModel, self).__init__( calendar, calendar_month, num_rows, num_cols, parent=parent, ) @property def calendar_month(self): """Get calendar month. Returns: (CalendarMonth): calendar month. """ return self.calendar_period def set_calendar_month(self, calendar_month): """Set calendar month. Args: calendar_month (CalendarMonth): new calendar month to set. """ self.num_rows = len( calendar_month.get_calendar_weeks(self.weekday_start) ) self.update_data() self.set_calendar_period(calendar_month) def set_week_start_day(self, week_start_day): """Set week start day to given day. Args: week_start_day (int or str): day week is considered to start from. """ if isinstance(week_start_day, str): week_start_day = Date.weekday_int_from_string(week_start_day) self.weekday_start = week_start_day self.num_rows = len( self.calendar_month.get_calendar_weeks(week_start_day) ) self.update_data() def day_from_row_and_column(self, row, column): """Get calendar day at given row and column. Args: row (int): row to check. column (int): column to check. Returns: (CalendarDay): calendar day at given cell in table. """ month_start_date = self.calendar_month.start_day.date start_weekday = month_start_date.weekday start_column = (start_weekday - self.weekday_start) % 7 time_delta = TimeDelta( days=(column - start_column + row * 7) ) return self.calendar.get_day(month_start_date + time_delta) def data(self, index, role): """Get data for given item item and role. Args: index (QtCore.QModelIndex): index of item item. role (QtCore.Qt.Role): role we want data for. Returns: (QtCore.QVariant): data for given item and role. """ if index.isValid(): day = self.day_from_row_and_column(index.row(), index.column()) if role == QtCore.Qt.ItemDataRole.TextAlignmentRole: return ( QtCore.Qt.AlignmentFlag.AlignTop | QtCore.Qt.AlignmentFlag.AlignLeft ) if role == QtCore.Qt.ItemDataRole.DisplayRole: return day.date.ordinal_string() return QtCore.QVariant() def flags(self, index): """Get flags for given item item. Args: index (QtCore.QModelIndex): index of item item. Returns: (QtCore.Qt.Flag): Qt flags for item. """ if index.isValid(): day = self.day_from_row_and_column(index.row(), index.column()) if day.calendar_month == self.calendar_month: return QtCore.Qt.ItemFlag.ItemIsEnabled return QtCore.Qt.ItemFlag.NoItemFlags def headerData(self, section, orientation, role): """Get header data. Args: section (int): row/column we want header data for. orientation (QtCore.Qt.Orientaion): orientation of widget. role (QtCore.Qt.Role): role we want header data for. Returns: (QtCore.QVariant): header data. """ if role == QtCore.Qt.ItemDataRole.DisplayRole: if orientation == QtCore.Qt.Horizontal: return Date.weekday_string_from_int( section - self.weekday_start ) return QtCore.QVariant() class TrackerMonthModel(BaseMonthModel): """Month model used by tracker.""" class SchedulerMonthModel(BaseMonthModel): """Month model used by calendar."""
import type { DeleteProjectMutationVariables, FindProjects, } from 'types/graphql' import { Link, routes } from '@redwoodjs/router' import { useMutation } from '@redwoodjs/web' import { toast } from '@redwoodjs/web/toast' import { QUERY } from 'src/components/Project/ProjectsCell' import { truncate } from 'src/lib/formatters' const DELETE_PROJECT_MUTATION = gql` mutation DeleteProjectMutation($id: Int!) { deleteProject(id: $id) { id } } ` const ProjectsList = ({ projects }: FindProjects) => { const [deleteProject] = useMutation(DELETE_PROJECT_MUTATION, { onCompleted: () => { toast.success('Project deleted') }, onError: (error) => { toast.error(error.message) }, // This refetches the query on the list page. Read more about other ways to // update the cache over here: // https://www.apollographql.com/docs/react/data/mutations/#making-all-other-cache-updates refetchQueries: [{ query: QUERY }], awaitRefetchQueries: true, }) const onDeleteClick = (id: DeleteProjectMutationVariables['id']) => { if (confirm('Are you sure you want to delete project ' + id + '?')) { deleteProject({ variables: { id } }) } } return ( <div className="rw-segment rw-table-wrapper-responsive"> <table className="rw-table"> <thead> <tr> <th>Id</th> <th>Name</th> <th>Description</th> <th>Manager id</th> <th>&nbsp;</th> </tr> </thead> <tbody> {projects.map((project) => ( <tr key={project.id}> <td>{truncate(project.id)}</td> <td>{truncate(project.name)}</td> <td>{truncate(project.description)}</td> <td> {project.manager != null ? ( <Link to={routes.employee({ id: project.manager.id })}> {truncate(project.manager.name) + ' ' + truncate(project.manager.surname)} </Link> ) : null} </td> <td> <nav className="rw-table-actions"> <Link to={routes.project({ id: project.id })} title={'Show project ' + project.id + ' detail'} className="rw-button rw-button-small" > Show </Link> <Link to={routes.editProject({ id: project.id })} title={'Edit project ' + project.id} className="rw-button rw-button-small rw-button-blue" > Edit </Link> <button type="button" title={'Delete project ' + project.id} className="rw-button rw-button-small rw-button-red" onClick={() => onDeleteClick(project.id)} > Delete </button> </nav> </td> </tr> ))} </tbody> </table> </div> ) } export default ProjectsList
# StableDiffusionBackground Generator Welcome to the StableDiffusionBackground Generator! This tool allows you to generate detailed images based on textual prompts using the power of machine learning and the Stable Diffusion model. ## Getting Started ### Prerequisites - Git (for cloning the repository) - Anaconda (for creating and managing the environment) - Python 3.8 or later - Packages: Hugging Face Diffuser, NumPy, PyTorch (CUDA) ### Installation 1. Clone the repository to your local machine: ``` git clone https://github.com/hunterdih/StableDiffusionBackground.git ``` 2. Navigate into the cloned repository directory: ``` cd StableDiffusionBackground ``` 3. Create a new Anaconda environment: ``` conda create --name stable_diffusion python=3.8 ``` 4. Activate the Anaconda environment: ``` conda activate stable_diffusion ``` 5. Install the required packages ## Usage After installation, you can run the program from the command line. The script supports various options that you can specify to customize the output. ### Command-Line Options Here's a list of available options you can use: - `--prompt`: The image prompt. (required) - `--width`: Initial width of the image. (default: 640) - `--height`: Initial height of the image. (default: 360) - `--desired_width`: Desired width after increasing resolution. (default: 2560) - `--desired_height`: Desired height after increasing resolution. (default: 1440) - `--overlap`: Overlap size for image parts. (default: 30) - `--blend_width`: Width for blending image parts. (default: 120) - `--output`: Optional output directory suffix. If set, changes the output directory. - `--increase_res`: Flag to increase resolution. (default: True) To generate an image, use the following command: ``` python stable_diffusion_background.py --prompt "astronaut frog in space" ``` If you want to customize the dimensions and other settings: ``` python stable_diffusion_background.py --prompt "a puffer fish with a tiara" --width 800 --height 450 --desired_width 3200 --desired_height 1800 ``` The program will produce a low-resolution preview of the image. If you're satisfied with the preview, the high-resolution image generation will proceed. ### Saving Images By default, the program saves all images and intermediate files in the `outputs/` directory followed by the prompt. If you specify the `--output` option, it will save them in `outputs/[your_output_suffix]`. ### Documentation To view the complete documentation and all available options, you can invoke the help command: ``` python stable_diffusion_background.py --help ``` This will display all the command-line options along with their descriptions. Enjoy creating with the StableDiffusionBackground Generator!
local images = require("ext.images") local cache = {} local module = { keyword = "nf", useFzf = true, cache = cache, placeholder = "search for nerd fonts glyphs", tip = { text = "nf⇥ to search nerd fonts glyphs" }, } local log local nerdFontsCacher local function cacheNerdFonts() if nerdFontsCacher and coroutine.status(nerdFontsCacher) ~= "dead" then return end cache.choices = {} cache.totalChoices = 0 local cachingStart = hs.timer.secondsSinceEpoch() nerdFontsCacher = coroutine.create(function() log.d("caching Nerd Fonts glyphs") local nerdFontsGlyphs = images.nerdFontsGlyphs() or {} cache.totalChoices = #nerdFontsGlyphs for i, nf in ipairs(nerdFontsGlyphs) do if i % 10 == 1 then coroutine.applicationYield() end table.insert(cache.choices, { text = nf.name, subText = nf.group or nf.groupKey, glyph = nf.glyph, id = nf.id, source = module.requireName, image = images.nerdFontsIcon(nf.glyph, "brown"), }) end local elapsedTime = hs.timer.secondsSinceEpoch() - cachingStart log.df("cached %d Nerd Fonts glyphs in %.2f seconds", #cache.choices, elapsedTime) end) local progressTimer progressTimer = hs.timer.doEvery(0.25, function() log.v("progressTimer callback", hs.inspect(nerdFontsCacher), coroutine.status(nerdFontsCacher)) if coroutine.status(nerdFontsCacher) == "dead" then progressTimer:stop() end module.main.chooser:refreshChoicesCallback() end) coroutine.resume(nerdFontsCacher) end module.compileChoices = function(query) log.v("compileChoices " .. hs.inspect(query)) if cache.choices == nil or #cache.choices == 0 then cacheNerdFonts() end if nerdFontsCacher and coroutine.status(nerdFontsCacher) ~= "dead" then log.v("show progress", hs.inspect(nerdFontsCacher), coroutine.status(nerdFontsCacher)) local progress = cache.totalChoices and cache.totalChoices > 0 and math.floor(#cache.choices / cache.totalChoices * 100) or 0 return { { text = string.format( "Loading Nerd Fonts glyphs %d%% [%d / %d]", progress, #cache.choices, cache.totalChoices or 0 ), valid = false, id = module.requireName .. "-progress", source = module.requireName, image = images.progressIcon(progress), }, } else log.v("show choices", hs.inspect(nerdFontsCacher), coroutine.status(nerdFontsCacher)) return cache.choices or {} end end module.complete = function(choice) log.v("complete choice: " .. hs.inspect(choice)) if choice then if choice.glyph then hs.pasteboard.setContents(choice.glyph) else log.wf("couldn't find glyph attribute on choice: %s", hs.inspect(choice)) end end end module.start = function(main, _) module.main = main log = hs.logger.new(module.requireName, "debug") end module.stop = function() end return module