/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */

/*
 * jQuery Hotkeys Plugin
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * Based upon the plugin by Tzury Bar Yochay:
 * https://github.com/tzuryby/jquery.hotkeys
 *
 * Original idea by:
 * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
 */

/* MediaMatch v.2.0.2 - Testing css media queries in Javascript. Authors & copyright (c) 2013: WebLinc, David Knight. */

//     (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors

//     Underscore may be freely distributed under the MIT license.

/*!
 * Bootstrap v3.3.7 (http://getbootstrap.com)
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under the MIT license
 */

/* ========================================================================
 * Bootstrap: transition.js v3.3.7
 * http://getbootstrap.com/javascript/#transitions
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: alert.js v3.3.7
 * http://getbootstrap.com/javascript/#alerts
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: button.js v3.3.7
 * http://getbootstrap.com/javascript/#buttons
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: carousel.js v3.3.7
 * http://getbootstrap.com/javascript/#carousel
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: collapse.js v3.3.7
 * http://getbootstrap.com/javascript/#collapse
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: dropdown.js v3.3.7
 * http://getbootstrap.com/javascript/#dropdowns
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: modal.js v3.3.7
 * http://getbootstrap.com/javascript/#modals
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: tooltip.js v3.3.7
 * http://getbootstrap.com/javascript/#tooltip
 * Inspired by the original jQuery.tipsy by Jason Frame
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: popover.js v3.3.7
 * http://getbootstrap.com/javascript/#popovers
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: scrollspy.js v3.3.7
 * http://getbootstrap.com/javascript/#scrollspy
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: tab.js v3.3.7
 * http://getbootstrap.com/javascript/#tabs
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/* ========================================================================
 * Bootstrap: affix.js v3.3.7
 * http://getbootstrap.com/javascript/#affix
 * ========================================================================
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * ======================================================================== */

/*
Copyright 2012 Igor Vaynberg

Version: 3.5.2 Timestamp: Sat Nov  1 14:43:36 EDT 2014

This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
General Public License version 2 (the "GPL License"). You may choose either license to govern your
use of this software only upon the condition that you accept all of the terms of either the Apache
License or the GPL License.

You may obtain a copy of the Apache License and the GPL License at:

    http://www.apache.org/licenses/LICENSE-2.0
    http://www.gnu.org/licenses/gpl-2.0.html

Unless required by applicable law or agreed to in writing, software distributed under the
Apache License or the GPL License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the Apache License and the GPL License for
the specific language governing permissions and limitations under the Apache License and the GPL License.
*/

/*
 * jQuery.bind-first library v0.2.3
 * Copyright (c) 2013 Vladimir Zhuravlev
 *
 * Released under MIT License
 * @license
 *
 * Date: Thu Feb  6 10:13:59 ICT 2014
 **/

/*! ========================================================================
 * Bootstrap Toggle: bootstrap-toggle.js v2.2.0
 * http://www.bootstraptoggle.com
 * ========================================================================
 * Copyright 2014 Min Hur, The New York Times Company
 * Licensed under MIT
 * ======================================================================== */

//! moment.js
//! version : 2.29.4
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com

/**
 * Trumbowyg v2.18.0 - A lightweight WYSIWYG editor
 * Trumbowyg core file
 * ------------------------
 * @link http://alex-d.github.io/Trumbowyg
 * @license MIT
 * @author Alexandre Demode (Alex-D)
 *         Twitter : @AlexandreDemode
 *         Website : alex-d.fr
 */

/*
 jQuery Masked Input Plugin
 Copyright (c) 2007 - 2015 Josh Bush (digitalbush.com)
 Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
 Version: 1.4.1
 */

/*!
 * bootstrap-fileinput v4.4.7
 * http://plugins.krajee.com/file-input
 *
 * Author: Kartik Visweswaran
 * Copyright: 2014 - 2017, Kartik Visweswaran, Krajee.com
 *
 * Licensed under the BSD 3-Clause
 * https://github.com/kartik-v/bootstrap-fileinput/blob/master/LICENSE.md
 */

/**
*  Ajax Autocomplete for jQuery, version %version%
*  (c) 2017 Tomas Kirda
*
*  Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
*  For details, see the web site: https://github.com/devbridge/jQuery-Autocomplete
*/

/*!
 * Signature Pad v3.0.0-beta.3 | https://github.com/szimek/signature_pad
 * (c) 2018 Szymon Nowak | Released under the MIT license
 */

/*

highlight v3

Highlights arbitrary terms.

<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html>

MIT license.

Johann Burkard
<http://johannburkard.de>
<mailto:jb@eaio.com>

*/

/*
 * jQuery.plainOverlay
 * https://github.com/anseki/jquery-plainoverlay
 *
 * Copyright (c) 2015 anseki
 * Licensed under the MIT license.
 */

/**
 * bootbox.js 5.5.2
 *
 * http://bootboxjs.com/license.txt
 */

/*!
 * jQuery Validation Plugin v1.19.5
 *
 * https://jqueryvalidation.org/
 *
 * Copyright (c) 2022 Jörn Zaefferer
 * Released under the MIT license
 */

// Copyright (c) 2010-2013 Diego Perini, MIT licensed

/*!
 * jQuery Form Plugin
 * version: 3.51.0-2014.06.20
 * Requires jQuery v1.5 or later
 * Copyright (c) 2014 M. Alsup
 * Examples and documentation at: http://malsup.com/jquery/form/
 * Project repository: https://github.com/malsup/form
 * Dual licensed under the MIT and GPL licenses.
 * https://github.com/malsup/form#copyright-and-license
 */

/*! Magnific Popup - v0.9.9 - 2013-11-15
* http://dimsemenov.com/plugins/magnific-popup/
* Copyright (c) 2013 Dmitry Semenov; */

/*! Copyright (c) 2011 by Jonas Mosbech - https://github.com/jmosbech/StickyTableHeaders
    MIT license info: https://github.com/jmosbech/StickyTableHeaders/blob/master/license.txt */

/*!
 * Knockout JavaScript library v3.5.1
 * (c) The Knockout.js team - http://knockoutjs.com/
 * License: MIT (http://www.opensource.org/licenses/mit-license.php)
 */

/*! MooTools: the javascript framework. license: MIT-style license. copyright: Copyright (c) 2006-2015 [Valerio Proietti](http://mad4milk.net/).*/

if(define("pgui.localizer",[],function(){var e=null,t={translations:{}};return{load:function(){return e=e||$.getJSON("components/js/jslang.php").done(function(e){t=e})},getString:function(e,n){return void 0!==t.translations[e]?t.translations[e]:n||e},getFirstDayOfWeek:function(){return t.firstDayOfWeek||0}}}),function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e,t,n){var i,r,o=(n=n||de).createElement("script");if(o.text=e,t)for(i in he)(r=t[i]||t.getAttribute&&t.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function i(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?ie[re.call(e)]||"object":typeof e}function r(e){var t=!!e&&"length"in e&&e.length,n=i(e);return!ce(e)&&!ue(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function o(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function a(e,t,n){return ce(t)?pe.grep(e,function(e,i){return!!t.call(e,i,e)!==n}):t.nodeType?pe.grep(e,function(e){return e===t!==n}):"string"!=typeof t?pe.grep(e,function(e){return-1<ne.call(t,e)!==n}):pe.filter(t,e,n)}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function l(e){return e}function c(e){throw e}function u(e,t,n,i){var r;try{e&&ce(r=e.promise)?r.call(e).done(t).fail(n):e&&ce(r=e.then)?r.call(e,t,n):t.apply(void 0,[e].slice(i))}catch(e){n.apply(void 0,[e])}}function d(){de.removeEventListener("DOMContentLoaded",d),e.removeEventListener("load",d),pe.ready()}function h(e,t){return t.toUpperCase()}function f(e){return e.replace(De,"ms-").replace($e,h)}function p(){this.expando=pe.expando+p.uid++}function m(e,t,n){var i,r;if(void 0===n&&1===e.nodeType)if(i="data-"+t.replace(Ie,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(i))){try{n="true"===(r=n)||"false"!==r&&("null"===r?null:r===+r+""?+r:Oe.test(r)?JSON.parse(r):r)}catch(e){}Pe.set(e,t,n)}else n=void 0;return n}function g(e,t,n,i){var r,o,a=20,s=i?function(){return i.cur()}:function(){return pe.css(e,t,"")},l=s(),c=n&&n[3]||(pe.cssNumber[t]?"":"px"),u=e.nodeType&&(pe.cssNumber[t]||"px"!==c&&+l)&&Ne.exec(pe.css(e,t));if(u&&u[3]!==c){for(l/=2,c=c||u[3],u=+l||1;a--;)pe.style(e,t,u+c),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),u/=o;u*=2,pe.style(e,t,u+c),n=n||[]}return n&&(u=+u||+l||0,r=n[1]?u+(n[1]+1)*n[2]:+n[2],i&&(i.unit=c,i.start=u,i.end=r)),r}function v(e,t){for(var n,i,r,o,a,s,l,c=[],u=0,d=e.length;u<d;u++)(i=e[u]).style&&(n=i.style.display,t?("none"===n&&(c[u]=je.get(i,"display")||null,c[u]||(i.style.display="")),""===i.style.display&&He(i)&&(c[u]=(l=a=o=void 0,a=(r=i).ownerDocument,s=r.nodeName,(l=Be[s])||(o=a.body.appendChild(a.createElement(s)),l=pe.css(o,"display"),o.parentNode.removeChild(o),"none"===l&&(l="block"),Be[s]=l)))):"none"!==n&&(c[u]="none",je.set(i,"display",n)));for(u=0;u<d;u++)null!=c[u]&&(e[u].style.display=c[u]);return e}function b(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&o(e,t)?pe.merge([e],n):n}function y(e,t){for(var n=0,i=e.length;n<i;n++)je.set(e[n],"globalEval",!t||je.get(t[n],"globalEval"))}function w(e,t,n,r,o){for(var a,s,l,c,u,d,h=t.createDocumentFragment(),f=[],p=0,m=e.length;p<m;p++)if((a=e[p])||0===a)if("object"===i(a))pe.merge(f,a.nodeType?[a]:a);else if(Ze.test(a)){for(s=s||h.appendChild(t.createElement("div")),l=(Ve.exec(a)||["",""])[1].toLowerCase(),c=Ge[l]||Ge._default,s.innerHTML=c[1]+pe.htmlPrefilter(a)+c[2],d=c[0];d--;)s=s.lastChild;pe.merge(f,s.childNodes),(s=h.firstChild).textContent=""}else f.push(t.createTextNode(a));for(h.textContent="",p=0;a=f[p++];)if(r&&-1<pe.inArray(a,r))o&&o.push(a);else if(u=Le(a),s=b(h.appendChild(a),"script"),u&&y(s),n)for(d=0;a=s[d++];)Ye.test(a.type||"")&&n.push(a);return h}function x(){return!0}function C(){return!1}function k(e,t){return e===function(){try{return de.activeElement}catch(e){}}()==("focus"===t)}function _(e,t,n,i,r,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(i=i||n,n=void 0),t)_(e,s,n,i,t[s],o);return e}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=C;else if(!r)return e;return 1===o&&(a=r,(r=function(e){return pe().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,r,i,n)})}function S(e,t,n){n?(je.set(e,t,!1),pe.event.add(e,t,{namespace:!1,handler:function(e){var i,r,o=je.get(this,t);if(1&e.isTrigger&&this[t]){if(o.length)(pe.event.special[t]||{}).delegateType&&e.stopPropagation();else if(o=J.call(arguments),je.set(this,t,o),i=n(this,t),this[t](),o!==(r=je.get(this,t))||i?je.set(this,t,!1):r={},o!==r)return e.stopImmediatePropagation(),e.preventDefault(),r&&r.value}else o.length&&(je.set(this,t,{value:pe.event.trigger(pe.extend(o[0],pe.Event.prototype),o.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===je.get(e,t)&&pe.event.add(e,t,x)}function E(e,t){return o(e,"table")&&o(11!==t.nodeType?t:t.firstChild,"tr")&&pe(e).children("tbody")[0]||e}function T(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function D(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function $(e,t){var n,i,r,o,a,s;if(1===t.nodeType){if(je.hasData(e)&&(s=je.get(e).events))for(r in je.remove(t,"handle events"),s)for(n=0,i=s[r].length;n<i;n++)pe.event.add(t,r,s[r][n]);Pe.hasData(e)&&(o=Pe.access(e),a=pe.extend({},o),Pe.set(t,a))}}function A(e,t,i,r){t=ee(t);var o,a,s,l,c,u,d=0,h=e.length,f=h-1,p=t[0],m=ce(p);if(m||1<h&&"string"==typeof p&&!le.checkClone&&Xe.test(p))return e.each(function(n){var o=e.eq(n);m&&(t[0]=p.call(this,n,o.html())),A(o,t,i,r)});if(h&&(a=(o=w(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=a),a||r)){for(l=(s=pe.map(b(o,"script"),T)).length;d<h;d++)c=o,d!==f&&(c=pe.clone(c,!0,!0),l&&pe.merge(s,b(c,"script"))),i.call(e[d],c,d);if(l)for(u=s[s.length-1].ownerDocument,pe.map(s,D),d=0;d<l;d++)c=s[d],Ye.test(c.type||"")&&!je.access(c,"globalEval")&&pe.contains(u,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?pe._evalUrl&&!c.noModule&&pe._evalUrl(c.src,{nonce:c.nonce||c.getAttribute("nonce")},u):n(c.textContent.replace(Je,""),c,u))}return e}function j(e,t,n){for(var i,r=t?pe.filter(t,e):e,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||pe.cleanData(b(i)),i.parentNode&&(n&&Le(i)&&y(b(i,"script")),i.parentNode.removeChild(i));return e}function P(e,t,n){var i,r,o,a,s=e.style;return(n=n||tt(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||Le(e)||(a=pe.style(e,t)),!le.pixelBoxStyles()&&et.test(a)&&it.test(t)&&(i=s.width,r=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=i,s.minWidth=r,s.maxWidth=o)),void 0!==a?a+"":a}function O(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}function I(e){return pe.cssProps[e]||at[e]||(e in ot?e:at[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=rt.length;n--;)if((e=rt[n]+t)in ot)return e}(e)||e)}function M(e,t,n){var i=Ne.exec(t);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):t}function N(e,t,n,i,r,o){var a="width"===t?1:0,s=0,l=0;if(n===(i?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=pe.css(e,n+Fe[a],!0,r)),i?("content"===n&&(l-=pe.css(e,"padding"+Fe[a],!0,r)),"margin"!==n&&(l-=pe.css(e,"border"+Fe[a]+"Width",!0,r))):(l+=pe.css(e,"padding"+Fe[a],!0,r),"padding"!==n?l+=pe.css(e,"border"+Fe[a]+"Width",!0,r):s+=pe.css(e,"border"+Fe[a]+"Width",!0,r));return!i&&0<=o&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l}function F(e,t,n){var i=tt(e),r=(!le.boxSizingReliable()||n)&&"border-box"===pe.css(e,"boxSizing",!1,i),a=r,s=P(e,t,i),l="offset"+t[0].toUpperCase()+t.slice(1);if(et.test(s)){if(!n)return s;s="auto"}return(!le.boxSizingReliable()&&r||!le.reliableTrDimensions()&&o(e,"tr")||"auto"===s||!parseFloat(s)&&"inline"===pe.css(e,"display",!1,i))&&e.getClientRects().length&&(r="border-box"===pe.css(e,"boxSizing",!1,i),(a=l in e)&&(s=e[l])),(s=parseFloat(s)||0)+N(e,t,n||(r?"border":"content"),a,i,s)+"px"}function R(e,t,n,i,r){return new R.prototype.init(e,t,n,i,r)}function L(){ht&&(!1===de.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(L):e.setTimeout(L,pe.fx.interval),pe.fx.tick())}function z(){return e.setTimeout(function(){dt=void 0}),dt=Date.now()}function H(e,t){var n,i=0,r={height:e};for(t=t?1:0;i<4;i+=2-t)r["margin"+(n=Fe[i])]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}function B(e,t,n){for(var i,r=(U.tweeners[t]||[]).concat(U.tweeners["*"]),o=0,a=r.length;o<a;o++)if(i=r[o].call(n,t,e))return i}function U(e,t,n){var i,r,o=0,a=U.prefilters.length,s=pe.Deferred().always(function(){delete l.elem}),l=function(){if(r)return!1;for(var t=dt||z(),n=Math.max(0,c.startTime+c.duration-t),i=1-(n/c.duration||0),o=0,a=c.tweens.length;o<a;o++)c.tweens[o].run(i);return s.notifyWith(e,[c,i,n]),i<1&&a?n:(a||s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:pe.extend({},t),opts:pe.extend(!0,{specialEasing:{},easing:pe.easing._default},n),originalProperties:t,originalOptions:n,startTime:dt||z(),duration:n.duration,tweens:[],createTween:function(t,n){var i=pe.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(i),i},stop:function(t){var n=0,i=t?c.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)c.tweens[n].run(1);return t?(s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c,t])):s.rejectWith(e,[c,t]),this}}),u=c.props;for((!function(e,t){var n,i,r,o,a;for(n in e)if(r=t[i=f(n)],o=e[n],Array.isArray(o)&&(r=o[1],o=e[n]=o[0]),n!==i&&(e[i]=o,delete e[n]),(a=pe.cssHooks[i])&&"expand"in a)for(n in o=a.expand(o),delete e[i],o)n in e||(e[n]=o[n],t[n]=r);else t[i]=r}(u,c.opts.specialEasing));o<a;o++)if(i=U.prefilters[o].call(c,e,u,c.opts))return ce(i.stop)&&(pe._queueHooks(c.elem,c.opts.queue).stop=i.stop.bind(i)),i;return pe.map(u,B,c),ce(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),pe.fx.timer(pe.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c}function q(e){return(e.match(_e)||[]).join(" ")}function W(e){return e.getAttribute&&e.getAttribute("class")||""}function V(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(_e)||[]}function Y(e,t,n,r){var o;if(Array.isArray(t))pe.each(t,function(t,i){n||Tt.test(e)?r(e,i):Y(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==i(t))r(e,t);else for(o in t)Y(e+"["+o+"]",t[o],n,r)}function G(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var i,r=0,o=t.toLowerCase().match(_e)||[];if(ce(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(e[i]=e[i]||[]).unshift(n)):(e[i]=e[i]||[]).push(n)}}function Z(e,t,n,i){function r(s){var l;return o[s]=!0,pe.each(e[s]||[],function(e,s){var c=s(t,n,i);return"string"!=typeof c||a||o[c]?a?!(l=c):void 0:(t.dataTypes.unshift(c),r(c),!1)}),l}var o={},a=e===Rt;return r(t.dataTypes[0])||!o["*"]&&r("*")}function Q(e,t){var n,i,r=pe.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((r[n]?e:i||(i={}))[n]=t[n]);return i&&pe.extend(!0,e,i),e}var K=[],X=Object.getPrototypeOf,J=K.slice,ee=K.flat?function(e){return K.flat.call(e)}:function(e){return K.concat.apply([],e)},te=K.push,ne=K.indexOf,ie={},re=ie.toString,oe=ie.hasOwnProperty,ae=oe.toString,se=ae.call(Object),le={},ce=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},ue=function(e){return null!=e&&e===e.window},de=e.document,he={type:!0,src:!0,nonce:!0,noModule:!0},fe="3.6.0",pe=function(e,t){return new pe.fn.init(e,t)};pe.fn=pe.prototype={jquery:fe,constructor:pe,length:0,toArray:function(){return J.call(this)},get:function(e){return null==e?J.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=pe.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return pe.each(this,e)},map:function(e){return this.pushStack(pe.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(J.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(pe.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(pe.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:te,sort:K.sort,splice:K.splice},pe.extend=pe.fn.extend=function(){var e,t,n,i,r,o,a=arguments[0]||{},s=1,l=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[s]||{},s++),"object"==typeof a||ce(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(e=arguments[s]))for(t in e)i=e[t],"__proto__"!==t&&a!==i&&(c&&i&&(pe.isPlainObject(i)||(r=Array.isArray(i)))?(n=a[t],o=r&&!Array.isArray(n)?[]:r||pe.isPlainObject(n)?n:{},r=!1,a[t]=pe.extend(c,o,i)):void 0!==i&&(a[t]=i));return a},pe.extend({expando:"jQuery"+(fe+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==re.call(e)||(t=X(e))&&("function"!=typeof(n=oe.call(t,"constructor")&&t.constructor)||ae.call(n)!==se))},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,i){n(e,{nonce:t&&t.nonce},i)},each:function(e,t){var n,i=0;if(r(e))for(n=e.length;i<n&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(r(Object(e))?pe.merge(n,"string"==typeof e?[e]:e):te.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:ne.call(t,e,n)},merge:function(e,t){for(var n=+t.length,i=0,r=e.length;i<n;i++)e[r++]=t[i];return e.length=r,e},grep:function(e,t,n){for(var i=[],r=0,o=e.length,a=!n;r<o;r++)!t(e[r],r)!==a&&i.push(e[r]);return i},map:function(e,t,n){var i,o,a=0,s=[];if(r(e))for(i=e.length;a<i;a++)null!=(o=t(e[a],a,n))&&s.push(o);else for(a in e)null!=(o=t(e[a],a,n))&&s.push(o);return ee(s)},guid:1,support:le}),"function"==typeof Symbol&&(pe.fn[Symbol.iterator]=K[Symbol.iterator]),pe.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){ie["[object "+t+"]"]=t.toLowerCase()});var me=function(e){function t(e,t,n,i){var r,o,a,s,l,u,h,f=t&&t.ownerDocument,p=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==p&&9!==p&&11!==p)return n;if(!i&&(D(t),t=t||$,j)){if(11!==p&&(l=me.exec(e)))if(r=l[1]){if(9===p){if(!(a=t.getElementById(r)))return n;if(a.id===r)return n.push(a),n}else if(f&&(a=f.getElementById(r))&&M(t,a)&&a.id===r)return n.push(a),n}else{if(l[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((r=l[3])&&b.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(r)),n}if(b.qsa&&!U[e+" "]&&(!P||!P.test(e))&&(1!==p||"object"!==t.nodeName.toLowerCase())){if(h=e,f=t,1===p&&(se.test(e)||ae.test(e))){for((f=ge.test(e)&&c(t.parentNode)||t)===t&&b.scope||((s=t.getAttribute("id"))?s=s.replace(ye,we):t.setAttribute("id",s=N)),o=(u=C(e)).length;o--;)u[o]=(s?"#"+s:":scope")+" "+d(u[o]);h=u.join(",")}try{return Z.apply(n,f.querySelectorAll(h)),n}catch(t){U(e,!0)}finally{s===N&&t.removeAttribute("id")}}}return _(e.replace(re,"$1"),t,n,i)}function n(){var e=[];return function t(n,i){return e.push(n+" ")>y.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function i(e){return e[N]=!0,e}function r(e){var t=$.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),i=n.length;i--;)y.attrHandle[n[i]]=t}function a(e,t){var n=t&&e,i=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Ce(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function l(e){return i(function(t){return t=+t,i(function(n,i){for(var r,o=e([],n.length,t),a=o.length;a--;)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))})})}function c(e){return e&&void 0!==e.getElementsByTagName&&e}function u(){}function d(e){for(var t=0,n=e.length,i="";t<n;t++)i+=e[t].value;return i}function h(e,t,n){var i=t.dir,r=t.next,o=r||i,a=n&&"parentNode"===o,s=L++;return t.first?function(t,n,r){for(;t=t[i];)if(1===t.nodeType||a)return e(t,n,r);return!1}:function(t,n,l){var c,u,d,h=[R,s];if(l){for(;t=t[i];)if((1===t.nodeType||a)&&e(t,n,l))return!0}else for(;t=t[i];)if(1===t.nodeType||a)if(u=(d=t[N]||(t[N]={}))[t.uniqueID]||(d[t.uniqueID]={}),r&&r===t.nodeName.toLowerCase())t=t[i]||t;else{if((c=u[o])&&c[0]===R&&c[1]===s)return h[2]=c[2];if((u[o]=h)[2]=e(t,n,l))return!0}return!1}}function f(e){return 1<e.length?function(t,n,i){for(var r=e.length;r--;)if(!e[r](t,n,i))return!1;return!0}:e[0]}function p(e,t,n,i,r){for(var o,a=[],s=0,l=e.length,c=null!=t;s<l;s++)(o=e[s])&&(n&&!n(o,i,r)||(a.push(o),c&&t.push(s)));return a}function m(e,n,r,o,a,s){return o&&!o[N]&&(o=m(o)),a&&!a[N]&&(a=m(a,s)),i(function(i,s,l,c){var u,d,h,f=[],m=[],g=s.length,v=i||function(e,n,i){for(var r=0,o=n.length;r<o;r++)t(e,n[r],i);return i}(n||"*",l.nodeType?[l]:l,[]),b=!e||!i&&n?v:p(v,f,e,l,c),y=r?a||(i?e:g||o)?[]:s:b;if(r&&r(b,y,l,c),o)for(u=p(y,m),o(u,[],l,c),d=u.length;d--;)(h=u[d])&&(y[m[d]]=!(b[m[d]]=h));if(i){if(a||e){if(a){for(u=[],d=y.length;d--;)(h=y[d])&&u.push(b[d]=h);a(null,y=[],u,c)}for(d=y.length;d--;)(h=y[d])&&-1<(u=a?K(i,h):f[d])&&(i[u]=!(s[u]=h))}}else y=p(y===s?y.splice(g,y.length):y),a?a(null,s,y,c):Z.apply(s,y)})}function g(e){for(var t,n,i,r=e.length,o=y.relative[e[0].type],a=o||y.relative[" "],s=o?1:0,l=h(function(e){return e===t},a,!0),c=h(function(e){return-1<K(t,e)},a,!0),u=[function(e,n,i){var r=!o&&(i||n!==S)||((t=n).nodeType?l(e,n,i):c(e,n,i));return t=null,r}];s<r;s++)if(n=y.relative[e[s].type])u=[h(f(u),n)];else{if((n=y.filter[e[s].type].apply(null,e[s].matches))[N]){for(i=++s;i<r&&!y.relative[e[i].type];i++);return m(1<s&&f(u),1<s&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(re,"$1"),n,s<i&&g(e.slice(s,i)),i<r&&g(e=e.slice(i)),i<r&&d(e))}u.push(n)}return f(u)}var v,b,y,w,x,C,k,_,S,E,T,D,$,A,j,P,O,I,M,N="sizzle"+1*new Date,F=e.document,R=0,L=0,z=n(),H=n(),B=n(),U=n(),q=function(e,t){return e===t&&(T=!0),0},W={}.hasOwnProperty,V=[],Y=V.pop,G=V.push,Z=V.push,Q=V.slice,K=function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},X="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",J="[\\x20\\t\\r\\n\\f]",ee="(?:\\\\[\\da-fA-F]{1,6}"+J+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",te="\\["+J+"*("+ee+")(?:"+J+"*([*^$|!~]?=)"+J+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+ee+"))|)"+J+"*\\]",ne=":("+ee+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+te+")*)|.*)\\)|)",ie=new RegExp(J+"+","g"),re=new RegExp("^"+J+"+|((?:^|[^\\\\])(?:\\\\.)*)"+J+"+$","g"),oe=new RegExp("^"+J+"*,"+J+"*"),ae=new RegExp("^"+J+"*([>+~]|"+J+")"+J+"*"),se=new RegExp(J+"|>"),le=new RegExp(ne),ce=new RegExp("^"+ee+"$"),ue={ID:new RegExp("^#("+ee+")"),CLASS:new RegExp("^\\.("+ee+")"),TAG:new RegExp("^("+ee+"|[*])"),ATTR:new RegExp("^"+te),PSEUDO:new RegExp("^"+ne),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+J+"*(even|odd|(([+-]|)(\\d*)n|)"+J+"*(?:([+-]|)"+J+"*(\\d+)|))"+J+"*\\)|)","i"),bool:new RegExp("^(?:"+X+")$","i"),needsContext:new RegExp("^"+J+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+J+"*((?:-\\d)?\\d*)"+J+"*\\)|)(?=[^-]|$)","i")},de=/HTML$/i,he=/^(?:input|select|textarea|button)$/i,fe=/^h\d$/i,pe=/^[^{]+\{\s*\[native \w/,me=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ge=/[+~]/,ve=new RegExp("\\\\[\\da-fA-F]{1,6}"+J+"?|\\\\([^\\r\\n\\f])","g"),be=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},ye=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,we=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},xe=function(){D()},Ce=h(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{Z.apply(V=Q.call(F.childNodes),F.childNodes),V[F.childNodes.length].nodeType}catch(v){Z={apply:V.length?function(e,t){G.apply(e,Q.call(t))}:function(e,t){for(var n=e.length,i=0;e[n++]=t[i++];);e.length=n-1}}}for(v in b=t.support={},x=t.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!de.test(t||n&&n.nodeName||"HTML")},D=t.setDocument=function(e){var t,n,i=e?e.ownerDocument||e:F;return i!=$&&9===i.nodeType&&i.documentElement&&(A=($=i).documentElement,j=!x($),F!=$&&(n=$.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",xe,!1):n.attachEvent&&n.attachEvent("onunload",xe)),b.scope=r(function(e){return A.appendChild(e).appendChild($.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),b.attributes=r(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByTagName=r(function(e){return e.appendChild($.createComment("")),!e.getElementsByTagName("*").length}),b.getElementsByClassName=pe.test($.getElementsByClassName),b.getById=r(function(e){return A.appendChild(e).id=N,!$.getElementsByName||!$.getElementsByName(N).length}),b.getById?(y.filter.ID=function(e){var t=e.replace(ve,be);return function(e){return e.getAttribute("id")===t}},y.find.ID=function(e,t){if(void 0!==t.getElementById&&j){var n=t.getElementById(e);return n?[n]:[]}}):(y.filter.ID=function(e){var t=e.replace(ve,be);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},y.find.ID=function(e,t){if(void 0!==t.getElementById&&j){var n,i,r,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(r=t.getElementsByName(e),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),y.find.TAG=b.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):b.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,i=[],r=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},y.find.CLASS=b.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&j)return t.getElementsByClassName(e)},O=[],P=[],(b.qsa=pe.test($.querySelectorAll))&&(r(function(e){var t;A.appendChild(e).innerHTML="<a id='"+N+"'></a><select id='"+N+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&P.push("[*^$]="+J+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||P.push("\\["+J+"*(?:value|"+X+")"),e.querySelectorAll("[id~="+N+"-]").length||P.push("~="),(t=$.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||P.push("\\["+J+"*name"+J+"*="+J+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||P.push(":checked"),e.querySelectorAll("a#"+N+"+*").length||P.push(".#.+[+~]"),e.querySelectorAll("\\\f"),P.push("[\\r\\n\\f]")}),r(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=$.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&P.push("name"+J+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&P.push(":enabled",":disabled"),A.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&P.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),P.push(",.*:")})),(b.matchesSelector=pe.test(I=A.matches||A.webkitMatchesSelector||A.mozMatchesSelector||A.oMatchesSelector||A.msMatchesSelector))&&r(function(e){b.disconnectedMatch=I.call(e,"*"),I.call(e,"[s!='']:x"),O.push("!=",ne)}),P=P.length&&new RegExp(P.join("|")),O=O.length&&new RegExp(O.join("|")),t=pe.test(A.compareDocumentPosition),M=t||pe.test(A.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,i=t&&t.parentNode;return e===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):e.compareDocumentPosition&&16&e.compareDocumentPosition(i)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},q=t?function(e,t){if(e===t)return T=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!b.sortDetached&&t.compareDocumentPosition(e)===n?e==$||e.ownerDocument==F&&M(F,e)?-1:t==$||t.ownerDocument==F&&M(F,t)?1:E?K(E,e)-K(E,t):0:4&n?-1:1)}:function(e,t){if(e===t)return T=!0,0;var n,i=0,r=e.parentNode,o=t.parentNode,s=[e],l=[t];if(!r||!o)return e==$?-1:t==$?1:r?-1:o?1:E?K(E,e)-K(E,t):0;if(r===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)l.unshift(n);for(;s[i]===l[i];)i++;return i?a(s[i],l[i]):s[i]==F?-1:l[i]==F?1:0}),$},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if(D(e),b.matchesSelector&&j&&!U[n+" "]&&(!O||!O.test(n))&&(!P||!P.test(n)))try{var i=I.call(e,n);if(i||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return i}catch(e){U(n,!0)}return 0<t(n,$,null,[e]).length},t.contains=function(e,t){return(e.ownerDocument||e)!=$&&D(e),M(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!=$&&D(e);var n=y.attrHandle[t.toLowerCase()],i=n&&W.call(y.attrHandle,t.toLowerCase())?n(e,t,!j):void 0;return void 0!==i?i:b.attributes||!j?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null},t.escape=function(e){return(e+"").replace(ye,we)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],i=0,r=0;if(T=!b.detectDuplicates,E=!b.sortStable&&e.slice(0),e.sort(q),T){for(;t=e[r++];)t===e[r]&&(i=n.push(r));for(;i--;)e.splice(n[i],1)}return E=null,e},w=t.getText=function(e){var t,n="",i=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=w(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[i++];)n+=w(t);return n},(y=t.selectors={cacheLength:50,createPseudo:i,match:ue,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ve,be),e[3]=(e[3]||e[4]||e[5]||"").replace(ve,be),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return ue.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&le.test(n)&&(t=C(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ve,be).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+J+")"+e+"("+J+"|$)"))&&z(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,i){return function(r){var o=t.attr(r,e);return null==o?"!="===n:!n||(o+="","="===n?o===i:"!="===n?o!==i:"^="===n?i&&0===o.indexOf(i):"*="===n?i&&-1<o.indexOf(i):"$="===n?i&&o.slice(-i.length)===i:"~="===n?-1<(" "+o.replace(ie," ")+" ").indexOf(i):"|="===n&&(o===i||o.slice(0,i.length+1)===i+"-"))}},CHILD:function(e,t,n,i,r){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===i&&0===r?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,h,f,p,m=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),b=!l&&!s,y=!1;if(g){if(o){for(;m;){for(h=t;h=h[m];)if(s?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&b){for(y=(f=(c=(u=(d=(h=g)[N]||(h[N]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===R&&c[1])&&c[2],h=f&&g.childNodes[f];h=++f&&h&&h[m]||(y=f=0)||p.pop();)if(1===h.nodeType&&++y&&h===t){u[e]=[R,f,y];break}}else if(b&&(y=f=(c=(u=(d=(h=t)[N]||(h[N]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]||[])[0]===R&&c[1]),!1===y)for(;(h=++f&&h&&h[m]||(y=f=0)||p.pop())&&((s?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++y||(b&&((u=(d=h[N]||(h[N]={}))[h.uniqueID]||(d[h.uniqueID]={}))[e]=[R,y]),h!==t)););return(y-=r)===i||y%i==0&&0<=y/i}}},PSEUDO:function(e,n){var r,o=y.pseudos[e]||y.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[N]?o(n):1<o.length?(r=[e,e,"",n],y.setFilters.hasOwnProperty(e.toLowerCase())?i(function(e,t){for(var i,r=o(e,n),a=r.length;a--;)e[i=K(e,r[a])]=!(t[i]=r[a])}):function(e){return o(e,0,r)}):o}},pseudos:{not:i(function(e){var t=[],n=[],r=k(e.replace(re,"$1"));return r[N]?i(function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:i(function(e){return function(n){return 0<t(e,n).length}}),contains:i(function(e){return e=e.replace(ve,be),function(t){return-1<(t.textContent||w(t)).indexOf(e)}}),lang:i(function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ve,be).toLowerCase(),function(t){var n;do{if(n=j?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===A},focus:function(e){return e===$.activeElement&&(!$.hasFocus||$.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:s(!1),disabled:s(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!y.pseudos.empty(e)},header:function(e){return fe.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[n<0?n+t:n]}),even:l(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:l(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:l(function(e,t,n){for(var i=n<0?n+t:t<n?t:n;0<=--i;)e.push(i);return e}),gt:l(function(e,t,n){for(var i=n<0?n+t:n;++i<t;)e.push(i);return e})}}).pseudos.nth=y.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})y.pseudos[v]=function(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}(v);for(v in{submit:!0,reset:!0})y.pseudos[v]=function(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}(v);return u.prototype=y.filters=y.pseudos,y.setFilters=new u,C=t.tokenize=function(e,n){var i,r,o,a,s,l,c,u=H[e+" "];if(u)return n?0:u.slice(0);for(s=e,l=[],c=y.preFilter;s;){for(a in i&&!(r=oe.exec(s))||(r&&(s=s.slice(r[0].length)||s),l.push(o=[])),i=!1,(r=ae.exec(s))&&(i=r.shift(),o.push({value:i,type:r[0].replace(re," ")}),s=s.slice(i.length)),
y.filter)!(r=ue[a].exec(s))||c[a]&&!(r=c[a](r))||(i=r.shift(),o.push({value:i,type:a,matches:r}),s=s.slice(i.length));if(!i)break}return n?s.length:s?t.error(e):H(e,l).slice(0)},k=t.compile=function(e,n){var r,o,a,s,l,c,u=[],d=[],h=B[e+" "];if(!h){for(n||(n=C(e)),r=n.length;r--;)(h=g(n[r]))[N]?u.push(h):d.push(h);(h=B(e,(o=d,s=0<(a=u).length,l=0<o.length,c=function(e,n,i,r,c){var u,d,h,f=0,m="0",g=e&&[],v=[],b=S,w=e||l&&y.find.TAG("*",c),x=R+=null==b?1:Math.random()||.1,C=w.length;for(c&&(S=n==$||n||c);m!==C&&null!=(u=w[m]);m++){if(l&&u){for(d=0,n||u.ownerDocument==$||(D(u),i=!j);h=o[d++];)if(h(u,n||$,i)){r.push(u);break}c&&(R=x)}s&&((u=!h&&u)&&f--,e&&g.push(u))}if(f+=m,s&&m!==f){for(d=0;h=a[d++];)h(g,v,n,i);if(e){if(0<f)for(;m--;)g[m]||v[m]||(v[m]=Y.call(r));v=p(v)}Z.apply(r,v),c&&!e&&0<v.length&&1<f+a.length&&t.uniqueSort(r)}return c&&(R=x,S=b),g},s?i(c):c))).selector=e}return h},_=t.select=function(e,t,n,i){var r,o,a,s,l,u="function"==typeof e&&e,h=!i&&C(e=u.selector||e);if(n=n||[],1===h.length){if(2<(o=h[0]=h[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&j&&y.relative[o[1].type]){if(!(t=(y.find.ID(a.matches[0].replace(ve,be),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(r=ue.needsContext.test(e)?0:o.length;r--&&(a=o[r],!y.relative[s=a.type]);)if((l=y.find[s])&&(i=l(a.matches[0].replace(ve,be),ge.test(o[0].type)&&c(t.parentNode)||t))){if(o.splice(r,1),!(e=i.length&&d(o)))return Z.apply(n,i),n;break}}return(u||k(e,h))(i,t,!j,n,!t||ge.test(e)&&c(t.parentNode)||t),n},b.sortStable=N.split("").sort(q).join("")===N,b.detectDuplicates=!!T,D(),b.sortDetached=r(function(e){return 1&e.compareDocumentPosition($.createElement("fieldset"))}),r(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),b.attributes&&r(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),r(function(e){return null==e.getAttribute("disabled")})||o(X,function(e,t,n){var i;if(!n)return!0===e[t]?t.toLowerCase():(i=e.getAttributeNode(t))&&i.specified?i.value:null}),t}(e);pe.find=me,pe.expr=me.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=me.uniqueSort,pe.text=me.getText,pe.isXMLDoc=me.isXML,pe.contains=me.contains,pe.escapeSelector=me.escape;var ge=function(e,t,n){for(var i=[],r=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(r&&pe(e).is(n))break;i.push(e)}return i},ve=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},be=pe.expr.match.needsContext,ye=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;pe.filter=function(e,t,n){var i=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===i.nodeType?pe.find.matchesSelector(i,e)?[i]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n,i=this.length,r=this;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t<i;t++)if(pe.contains(r[t],this))return!0}));for(n=this.pushStack([]),t=0;t<i;t++)pe.find(e,r[t],n);return 1<i?pe.uniqueSort(n):n},filter:function(e){return this.pushStack(a(this,e||[],!1))},not:function(e){return this.pushStack(a(this,e||[],!0))},is:function(e){return!!a(this,"string"==typeof e&&be.test(e)?pe(e):e||[],!1).length}});var we,xe=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(pe.fn.init=function(e,t,n){var i,r;if(!e)return this;if(n=n||we,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:xe.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:de,!0)),ye.test(i[1])&&pe.isPlainObject(t))for(i in t)ce(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(r=de.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ce(e)?void 0!==n.ready?n.ready(e):e(pe):pe.makeArray(e,this)}).prototype=pe.fn,we=pe(de);var Ce=/^(?:parents|prev(?:Until|All))/,ke={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t=pe(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(pe.contains(this,t[e]))return!0})},closest:function(e,t){var n,i=0,r=this.length,o=[],a="string"!=typeof e&&pe(e);if(!be.test(e))for(;i<r;i++)for(n=this[i];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?ne.call(pe(e),this[0]):ne.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ge(e,"parentNode")},parentsUntil:function(e,t,n){return ge(e,"parentNode",n)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return ge(e,"nextSibling")},prevAll:function(e){return ge(e,"previousSibling")},nextUntil:function(e,t,n){return ge(e,"nextSibling",n)},prevUntil:function(e,t,n){return ge(e,"previousSibling",n)},siblings:function(e){return ve((e.parentNode||{}).firstChild,e)},children:function(e){return ve(e.firstChild)},contents:function(e){return null!=e.contentDocument&&X(e.contentDocument)?e.contentDocument:(o(e,"template")&&(e=e.content||e),pe.merge([],e.childNodes))}},function(e,t){pe.fn[e]=function(n,i){var r=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=pe.filter(i,r)),1<this.length&&(ke[e]||pe.uniqueSort(r),Ce.test(e)&&r.reverse()),this.pushStack(r)}});var _e=/[^\x20\t\r\n\f]+/g;pe.Callbacks=function(e){var t,n;e="string"==typeof e?(t=e,n={},pe.each(t.match(_e)||[],function(e,t){n[t]=!0}),n):pe.extend({},e);var r,o,a,s,l=[],c=[],u=-1,d=function(){for(s=s||e.once,a=r=!0;c.length;u=-1)for(o=c.shift();++u<l.length;)!1===l[u].apply(o[0],o[1])&&e.stopOnFalse&&(u=l.length,o=!1);e.memory||(o=!1),r=!1,s&&(l=o?[]:"")},h={add:function(){return l&&(o&&!r&&(u=l.length-1,c.push(o)),function t(n){pe.each(n,function(n,r){ce(r)?e.unique&&h.has(r)||l.push(r):r&&r.length&&"string"!==i(r)&&t(r)})}(arguments),o&&!r&&d()),this},remove:function(){return pe.each(arguments,function(e,t){for(var n;-1<(n=pe.inArray(t,l,n));)l.splice(n,1),n<=u&&u--}),this},has:function(e){return e?-1<pe.inArray(e,l):0<l.length},empty:function(){return l&&(l=[]),this},disable:function(){return s=c=[],l=o="",this},disabled:function(){return!l},lock:function(){return s=c=[],o||r||(l=o=""),this},locked:function(){return!!s},fireWith:function(e,t){return s||(t=[e,(t=t||[]).slice?t.slice():t],c.push(t),r||d()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!a}};return h},pe.extend({Deferred:function(t){var n=[["notify","progress",pe.Callbacks("memory"),pe.Callbacks("memory"),2],["resolve","done",pe.Callbacks("once memory"),pe.Callbacks("once memory"),0,"resolved"],["reject","fail",pe.Callbacks("once memory"),pe.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return pe.Deferred(function(t){pe.each(n,function(n,i){var r=ce(e[i[4]])&&e[i[4]];o[i[1]](function(){var e=r&&r.apply(this,arguments);e&&ce(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[i[0]+"With"](this,r?[e]:arguments)})}),e=null}).promise()},then:function(t,i,r){function o(t,n,i,r){return function(){var s=this,u=arguments,d=function(){var e,d;if(!(t<a)){if((e=i.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");d=e&&("object"==typeof e||"function"==typeof e)&&e.then,ce(d)?r?d.call(e,o(a,n,l,r),o(a,n,c,r)):(a++,d.call(e,o(a,n,l,r),o(a,n,c,r),o(a,n,l,n.notifyWith))):(i!==l&&(s=void 0,u=[e]),(r||n.resolveWith)(s,u))}},h=r?d:function(){try{d()}catch(e){pe.Deferred.exceptionHook&&pe.Deferred.exceptionHook(e,h.stackTrace),a<=t+1&&(i!==c&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?h():(pe.Deferred.getStackHook&&(h.stackTrace=pe.Deferred.getStackHook()),e.setTimeout(h))}}var a=0;return pe.Deferred(function(e){n[0][3].add(o(0,e,ce(r)?r:l,e.notifyWith)),n[1][3].add(o(0,e,ce(t)?t:l)),n[2][3].add(o(0,e,ce(i)?i:c))}).promise()},promise:function(e){return null!=e?pe.extend(e,r):r}},o={};return pe.each(n,function(e,t){var a=t[2],s=t[5];r[t[1]]=a.add,s&&a.add(function(){i=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),r.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,i=Array(n),r=J.call(arguments),o=pe.Deferred(),a=function(e){return function(n){i[e]=this,r[e]=1<arguments.length?J.call(arguments):n,--t||o.resolveWith(i,r)}};if(t<=1&&(u(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||ce(r[n]&&r[n].then)))return o.then();for(;n--;)u(r[n],a(n),o.reject);return o.promise()}});var Se=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;pe.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Se.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},pe.readyException=function(t){e.setTimeout(function(){throw t})};var Ee=pe.Deferred();pe.fn.ready=function(e){return Ee.then(e).catch(function(e){pe.readyException(e)}),this},pe.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--pe.readyWait:pe.isReady)||(pe.isReady=!0)!==e&&0<--pe.readyWait||Ee.resolveWith(de,[pe])}}),pe.ready.then=Ee.then,"complete"===de.readyState||"loading"!==de.readyState&&!de.documentElement.doScroll?e.setTimeout(pe.ready):(de.addEventListener("DOMContentLoaded",d),e.addEventListener("load",d));var Te=function(e,t,n,r,o,a,s){var l=0,c=e.length,u=null==n;if("object"===i(n))for(l in o=!0,n)Te(e,t,l,n[l],!0,a,s);else if(void 0!==r&&(o=!0,ce(r)||(s=!0),u&&(s?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(pe(e),n)})),t))for(;l<c;l++)t(e[l],n,s?r:r.call(e[l],l,t(e[l],n)));return o?e:u?t.call(e):c?t(e[0],n):a},De=/^-ms-/,$e=/-([a-z])/g,Ae=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};p.uid=1,p.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Ae(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var i,r=this.cache(e);if("string"==typeof t)r[f(t)]=n;else for(i in t)r[f(i)]=t[i];return r},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][f(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,i=e[this.expando];if(void 0!==i){if(void 0!==t){n=(t=Array.isArray(t)?t.map(f):(t=f(t))in i?[t]:t.match(_e)||[]).length;for(;n--;)delete i[t[n]]}(void 0===t||pe.isEmptyObject(i))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!pe.isEmptyObject(t)}};var je=new p,Pe=new p,Oe=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Ie=/[A-Z]/g;pe.extend({hasData:function(e){return Pe.hasData(e)||je.hasData(e)},data:function(e,t,n){return Pe.access(e,t,n)},removeData:function(e,t){Pe.remove(e,t)},_data:function(e,t,n){return je.access(e,t,n)},_removeData:function(e,t){je.remove(e,t)}}),pe.fn.extend({data:function(e,t){var n,i,r,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(r=Pe.get(o),1===o.nodeType&&!je.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(i=a[n].name).indexOf("data-")&&(i=f(i.slice(5)),m(o,i,r[i]));je.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof e?this.each(function(){Pe.set(this,e)}):Te(this,function(t){var n;if(o&&void 0===t)return void 0!==(n=Pe.get(o,e))?n:void 0!==(n=m(o,e))?n:void 0;this.each(function(){Pe.set(this,e,t)})},null,t,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Pe.remove(this,e)})}}),pe.extend({queue:function(e,t,n){var i;if(e)return t=(t||"fx")+"queue",i=je.get(e,t),n&&(!i||Array.isArray(n)?i=je.access(e,t,pe.makeArray(n)):i.push(n)),i||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),i=n.length,r=n.shift(),o=pe._queueHooks(e,t);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===t&&n.unshift("inprogress"),delete o.stop,r.call(e,function(){pe.dequeue(e,t)},o)),!i&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return je.get(e,n)||je.access(e,n,{empty:pe.Callbacks("once memory").add(function(){je.remove(e,[t+"queue",n])})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?pe.queue(this[0],e):void 0===t?this:this.each(function(){var n=pe.queue(this,e,t);pe._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&pe.dequeue(this,e)})},dequeue:function(e){return this.each(function(){pe.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,i=1,r=pe.Deferred(),o=this,a=this.length,s=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=je.get(o[a],e+"queueHooks"))&&n.empty&&(i++,n.empty.add(s));return s(),r.promise(t)}});var Me=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Ne=new RegExp("^(?:([+-])=|)("+Me+")([a-z%]*)$","i"),Fe=["Top","Right","Bottom","Left"],Re=de.documentElement,Le=function(e){return pe.contains(e.ownerDocument,e)},ze={composed:!0};Re.getRootNode&&(Le=function(e){return pe.contains(e.ownerDocument,e)||e.getRootNode(ze)===e.ownerDocument});var He=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&Le(e)&&"none"===pe.css(e,"display")},Be={};pe.fn.extend({show:function(){return v(this,!0)},hide:function(){return v(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){He(this)?pe(this).show():pe(this).hide()})}});var Ue,qe,We=/^(?:checkbox|radio)$/i,Ve=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ye=/^$|^module$|\/(?:java|ecma)script/i;Ue=de.createDocumentFragment().appendChild(de.createElement("div")),(qe=de.createElement("input")).setAttribute("type","radio"),qe.setAttribute("checked","checked"),qe.setAttribute("name","t"),Ue.appendChild(qe),le.checkClone=Ue.cloneNode(!0).cloneNode(!0).lastChild.checked,Ue.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!Ue.cloneNode(!0).lastChild.defaultValue,Ue.innerHTML="<option></option>",le.option=!!Ue.lastChild;var Ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Ge.tbody=Ge.tfoot=Ge.colgroup=Ge.caption=Ge.thead,Ge.th=Ge.td,le.option||(Ge.optgroup=Ge.option=[1,"<select multiple='multiple'>","</select>"]);var Ze=/<|&#?\w+;/,Qe=/^([^.]*)(?:\.(.+)|)/;pe.event={global:{},add:function(e,t,n,i,r){var o,a,s,l,c,u,d,h,f,p,m,g=je.get(e);if(Ae(e))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&pe.find.matchesSelector(Re,r),n.guid||(n.guid=pe.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==pe&&pe.event.triggered!==t.type?pe.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(_e)||[""]).length;c--;)f=m=(s=Qe.exec(t[c])||[])[1],p=(s[2]||"").split(".").sort(),f&&(d=pe.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=pe.event.special[f]||{},u=pe.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&pe.expr.match.needsContext.test(r),namespace:p.join(".")},o),(h=l[f])||((h=l[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,i,p,a)||e.addEventListener&&e.addEventListener(f,a)),d.add&&(d.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,u):h.push(u),pe.event.global[f]=!0)},remove:function(e,t,n,i,r){var o,a,s,l,c,u,d,h,f,p,m,g=je.hasData(e)&&je.get(e);if(g&&(l=g.events)){for(c=(t=(t||"").match(_e)||[""]).length;c--;)if(f=m=(s=Qe.exec(t[c])||[])[1],p=(s[2]||"").split(".").sort(),f){for(d=pe.event.special[f]||{},h=l[f=(i?d.delegateType:d.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=h.length;o--;)u=h[o],!r&&m!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||i&&i!==u.selector&&("**"!==i||!u.selector)||(h.splice(o,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(e,u));a&&!h.length&&(d.teardown&&!1!==d.teardown.call(e,p,g.handle)||pe.removeEvent(e,f,g.handle),delete l[f])}else for(f in l)pe.event.remove(e,f+t[c],n,i,!0);pe.isEmptyObject(l)&&je.remove(e,"handle events")}},dispatch:function(e){var t,n,i,r,o,a,s=new Array(arguments.length),l=pe.event.fix(e),c=(je.get(this,"events")||Object.create(null))[l.type]||[],u=pe.event.special[l.type]||{};for(s[0]=l,t=1;t<arguments.length;t++)s[t]=arguments[t];if(l.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,l)){for(a=pe.event.handlers.call(this,l,c),t=0;(r=a[t++])&&!l.isPropagationStopped();)for(l.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(i=((pe.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,s))&&!1===(l.result=i)&&(l.preventDefault(),l.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,l),l.result}},handlers:function(e,t){var n,i,r,o,a,s=[],l=t.delegateCount,c=e.target;if(l&&c.nodeType&&!("click"===e.type&&1<=e.button))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],a={},n=0;n<l;n++)void 0===a[r=(i=t[n]).selector+" "]&&(a[r]=i.needsContext?-1<pe(r,this).index(c):pe.find(r,this,null,[c]).length),a[r]&&o.push(i);o.length&&s.push({elem:c,handlers:o})}return c=this,l<t.length&&s.push({elem:c,handlers:t.slice(l)}),s},addProp:function(e,t){Object.defineProperty(pe.Event.prototype,e,{enumerable:!0,configurable:!0,get:ce(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[pe.expando]?e:new pe.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return We.test(t.type)&&t.click&&o(t,"input")&&S(t,"click",x),!1},trigger:function(e){var t=this||e;return We.test(t.type)&&t.click&&o(t,"input")&&S(t,"click"),!0},_default:function(e){var t=e.target;return We.test(t.type)&&t.click&&o(t,"input")&&je.get(t,"click")||o(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},pe.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},pe.Event=function(e,t){if(!(this instanceof pe.Event))return new pe.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?x:C,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&pe.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[pe.expando]=!0},pe.Event.prototype={constructor:pe.Event,isDefaultPrevented:C,isPropagationStopped:C,isImmediatePropagationStopped:C,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=x,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=x,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=x,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},pe.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},pe.event.addProp),pe.each({focus:"focusin",blur:"focusout"},function(e,t){pe.event.special[e]={setup:function(){return S(this,e,k),!1},trigger:function(){return S(this,e),!0},_default:function(){return!0},delegateType:t}}),pe.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){pe.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,i=e.relatedTarget,r=e.handleObj;return i&&(i===this||pe.contains(this,i))||(e.type=r.origType,n=r.handler.apply(this,arguments),e.type=t),n}}}),pe.fn.extend({on:function(e,t,n,i){return _(this,e,t,n,i)},one:function(e,t,n,i){return _(this,e,t,n,i,1)},off:function(e,t,n){var i,r;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,pe(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(r in e)this.off(r,t,e[r]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=C),this.each(function(){pe.event.remove(this,e,n,t)})}});var Ke=/<script|<style|<link/i,Xe=/checked\s*(?:[^=]|=\s*.checked.)/i,Je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;pe.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var i,r,o,a,s,l,c,u=e.cloneNode(!0),d=Le(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(a=b(u),i=0,r=(o=b(e)).length;i<r;i++)s=o[i],l=a[i],"input"===(c=l.nodeName.toLowerCase())&&We.test(s.type)?l.checked=s.checked:"input"!==c&&"textarea"!==c||(l.defaultValue=s.defaultValue);if(t)if(n)for(o=o||b(e),a=a||b(u),i=0,r=o.length;i<r;i++)$(o[i],a[i]);else $(e,u);return 0<(a=b(u,"script")).length&&y(a,!d&&b(e,"script")),u},cleanData:function(e){for(var t,n,i,r=pe.event.special,o=0;void 0!==(n=e[o]);o++)if(Ae(n)){if(t=n[je.expando]){if(t.events)for(i in t.events)r[i]?pe.event.remove(n,i):pe.removeEvent(n,i,t.handle);n[je.expando]=void 0}n[Pe.expando]&&(n[Pe.expando]=void 0)}}}),pe.fn.extend({detach:function(e){return j(this,e,!0)},remove:function(e){return j(this,e)},text:function(e){return Te(this,function(e){return void 0===e?pe.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return A(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||E(this,e).appendChild(e)})},prepend:function(){return A(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=E(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return A(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return A(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(pe.cleanData(b(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Te(this,function(e){var t=this[0]||{},n=0,i=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ke.test(e)&&!Ge[(Ve.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;n<i;n++)1===(t=this[n]||{}).nodeType&&(pe.cleanData(b(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return A(this,arguments,function(t){var n=this.parentNode;pe.inArray(this,e)<0&&(pe.cleanData(b(this)),n&&n.replaceChild(t,this))},e)}}),pe.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){pe.fn[e]=function(e){for(var n,i=[],r=pe(e),o=r.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),pe(r[a])[t](n),te.apply(i,n.get());return this.pushStack(i)}});var et=new RegExp("^("+Me+")(?!px)[a-z%]+$","i"),tt=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},nt=function(e,t,n){var i,r,o={};for(r in t)o[r]=e.style[r],e.style[r]=t[r];for(r in i=n.call(e),t)e.style[r]=o[r];return i},it=new RegExp(Fe.join("|"),"i");!function(){function t(){if(u){c.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",Re.appendChild(c).appendChild(u);var t=e.getComputedStyle(u);i="1%"!==t.top,l=12===n(t.marginLeft),u.style.right="60%",a=36===n(t.right),r=36===n(t.width),u.style.position="absolute",o=12===n(u.offsetWidth/3),Re.removeChild(c),u=null}}function n(e){return Math.round(parseFloat(e))}var i,r,o,a,s,l,c=de.createElement("div"),u=de.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===u.style.backgroundClip,pe.extend(le,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,n,i,r;return null==s&&(t=de.createElement("table"),n=de.createElement("tr"),i=de.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",n.style.cssText="border:1px solid",n.style.height="1px",i.style.height="9px",i.style.display="block",Re.appendChild(t).appendChild(n).appendChild(i),r=e.getComputedStyle(n),s=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===n.offsetHeight,Re.removeChild(t)),s}}))}();var rt=["Webkit","Moz","ms"],ot=de.createElement("div").style,at={},st=/^(none|table(?!-c[ea]).+)/,lt=/^--/,ct={position:"absolute",visibility:"hidden",display:"block"},ut={letterSpacing:"0",fontWeight:"400"};pe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=P(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var r,o,a,s=f(t),l=lt.test(t),c=e.style;if(l||(t=I(s)),a=pe.cssHooks[t]||pe.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(r=a.get(e,!1,i))?r:c[t];"string"==(o=typeof n)&&(r=Ne.exec(n))&&r[1]&&(n=g(e,t,r),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=r&&r[3]||(pe.cssNumber[s]?"":"px")),le.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,i))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,i){var r,o,a,s=f(t);return lt.test(t)||(t=I(s)),(a=pe.cssHooks[t]||pe.cssHooks[s])&&"get"in a&&(r=a.get(e,!0,n)),void 0===r&&(r=P(e,t,i)),"normal"===r&&t in ut&&(r=ut[t]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),pe.each(["height","width"],function(e,t){pe.cssHooks[t]={get:function(e,n,i){if(n)return!st.test(pe.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?F(e,t,i):nt(e,ct,function(){return F(e,t,i)})},set:function(e,n,i){var r,o=tt(e),a=!le.scrollboxSize()&&"absolute"===o.position,s=(a||i)&&"border-box"===pe.css(e,"boxSizing",!1,o),l=i?N(e,t,i,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-N(e,t,"border",!1,o)-.5)),l&&(r=Ne.exec(n))&&"px"!==(r[3]||"px")&&(e.style[t]=n,n=pe.css(e,t)),M(0,n,l)}}}),pe.cssHooks.marginLeft=O(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(P(e,"marginLeft"))||e.getBoundingClientRect().left-nt(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),pe.each({margin:"",padding:"",border:"Width"},function(e,t){pe.cssHooks[e+t]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[e+Fe[i]+t]=o[i]||o[i-2]||o[0];return r}},"margin"!==e&&(pe.cssHooks[e+t].set=M)}),pe.fn.extend({css:function(e,t){return Te(this,function(e,t,n){var i,r,o={},a=0;if(Array.isArray(t)){for(i=tt(e),r=t.length;a<r;a++)o[t[a]]=pe.css(e,t[a],!1,i);return o}return void 0!==n?pe.style(e,t,n):pe.css(e,t)},e,t,1<arguments.length)}}),((pe.Tween=R).prototype={constructor:R,init:function(e,t,n,i,r,o){this.elem=e,this.prop=n,this.easing=r||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=i,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=R.propHooks[this.prop];return e&&e.get?e.get(this):R.propHooks._default.get(this)},run:function(e){var t,n=R.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):R.propHooks._default.set(this),this}}).init.prototype=R.prototype,(R.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||!pe.cssHooks[e.prop]&&null==e.elem.style[I(e.prop)]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=R.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=R.prototype.init,pe.fx.step={};var dt,ht,ft,pt,mt=/^(?:toggle|show|hide)$/,gt=/queueHooks$/;pe.Animation=pe.extend(U,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return g(n.elem,e,Ne.exec(t),n),n}]},tweener:function(e,t){ce(e)?(t=e,e=["*"]):e=e.match(_e);for(var n,i=0,r=e.length;i<r;i++)n=e[i],U.tweeners[n]=U.tweeners[n]||[],U.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var i,r,o,a,s,l,c,u,d="width"in t||"height"in t,h=this,f={},p=e.style,m=e.nodeType&&He(e),g=je.get(e,"fxshow");for(i in n.queue||(null==(a=pe._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,h.always(function(){h.always(function(){a.unqueued--,pe.queue(e,"fx").length||a.empty.fire()})})),t)if(r=t[i],mt.test(r)){if(delete t[i],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[i])continue;m=!0}f[i]=g&&g[i]||pe.style(e,i)}if((l=!pe.isEmptyObject(t))||!pe.isEmptyObject(f))for(i in d&&1===e.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(c=g&&g.display)&&(c=je.get(e,"display")),"none"===(u=pe.css(e,"display"))&&(c?u=c:(v([e],!0),c=e.style.display||c,u=pe.css(e,"display"),v([e]))),("inline"===u||"inline-block"===u&&null!=c)&&"none"===pe.css(e,"float")&&(l||(h.done(function(){p.display=c}),null==c&&(u=p.display,c="none"===u?"":u)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",h.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]})),l=!1,f)l||(g?"hidden"in g&&(m=g.hidden):g=je.access(e,"fxshow",{display:c}),o&&(g.hidden=!m),m&&v([e],!0),h.done(function(){for(i in m||v([e]),je.remove(e,"fxshow"),f)pe.style(e,i,f[i])})),l=B(m?g[i]:0,i,h),i in g||(g[i]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(e,t){t?U.prefilters.unshift(e):U.prefilters.push(e)}}),pe.speed=function(e,t,n){
var i=e&&"object"==typeof e?pe.extend({},e):{complete:n||!n&&t||ce(e)&&e,duration:e,easing:n&&t||t&&!ce(t)&&t};return pe.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in pe.fx.speeds?i.duration=pe.fx.speeds[i.duration]:i.duration=pe.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){ce(i.old)&&i.old.call(this),i.queue&&pe.dequeue(this,i.queue)},i},pe.fn.extend({fadeTo:function(e,t,n,i){return this.filter(He).css("opacity",0).show().end().animate({opacity:t},e,n,i)},animate:function(e,t,n,i){var r=pe.isEmptyObject(e),o=pe.speed(t,n,i),a=function(){var t=U(this,pe.extend({},e),o);(r||je.get(this,"finish"))&&t.stop(!0)};return a.finish=a,r||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var i=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&this.queue(e||"fx",[]),this.each(function(){var t=!0,r=null!=e&&e+"queueHooks",o=pe.timers,a=je.get(this);if(r)a[r]&&a[r].stop&&i(a[r]);else for(r in a)a[r]&&a[r].stop&&gt.test(r)&&i(a[r]);for(r=o.length;r--;)o[r].elem!==this||null!=e&&o[r].queue!==e||(o[r].anim.stop(n),t=!1,o.splice(r,1));!t&&n||pe.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=je.get(this),i=n[e+"queue"],r=n[e+"queueHooks"],o=pe.timers,a=i?i.length:0;for(n.finish=!0,pe.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)i[t]&&i[t].finish&&i[t].finish.call(this);delete n.finish})}}),pe.each(["toggle","show","hide"],function(e,t){var n=pe.fn[t];pe.fn[t]=function(e,i,r){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(H(t,!0),e,i,r)}}),pe.each({slideDown:H("show"),slideUp:H("hide"),slideToggle:H("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){pe.fn[e]=function(e,n,i){return this.animate(t,e,n,i)}}),pe.timers=[],pe.fx.tick=function(){var e,t=0,n=pe.timers;for(dt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||pe.fx.stop(),dt=void 0},pe.fx.timer=function(e){pe.timers.push(e),pe.fx.start()},pe.fx.interval=13,pe.fx.start=function(){ht||(ht=!0,L())},pe.fx.stop=function(){ht=null},pe.fx.speeds={slow:600,fast:200,_default:400},pe.fn.delay=function(t,n){return t=pe.fx&&pe.fx.speeds[t]||t,n=n||"fx",this.queue(n,function(n,i){var r=e.setTimeout(n,t);i.stop=function(){e.clearTimeout(r)}})},ft=de.createElement("input"),pt=de.createElement("select").appendChild(de.createElement("option")),ft.type="checkbox",le.checkOn=""!==ft.value,le.optSelected=pt.selected,(ft=de.createElement("input")).value="t",ft.type="radio",le.radioValue="t"===ft.value;var vt,bt=pe.expr.attrHandle;pe.fn.extend({attr:function(e,t){return Te(this,pe.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(r=pe.attrHooks[t.toLowerCase()]||(pe.expr.match.bool.test(t)?vt:void 0)),void 0!==n?null===n?void pe.removeAttr(e,t):r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:(e.setAttribute(t,n+""),n):r&&"get"in r&&null!==(i=r.get(e,t))?i:null==(i=pe.find.attr(e,t))?void 0:i)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&o(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,i=0,r=t&&t.match(_e);if(r&&1===e.nodeType)for(;n=r[i++];)e.removeAttribute(n)}}),vt={set:function(e,t,n){return!1===t?pe.removeAttr(e,n):e.setAttribute(n,n),n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=bt[t]||pe.find.attr;bt[t]=function(e,t,i){var r,o,a=t.toLowerCase();return i||(o=bt[a],bt[a]=r,r=null!=n(e,t,i)?a:null,bt[a]=o),r}});var yt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Te(this,pe.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[pe.propFix[e]||e]})}}),pe.extend({prop:function(e,t,n){var i,r,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,r=pe.propHooks[t]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(e,n,t))?i:e[t]=n:r&&"get"in r&&null!==(i=r.get(e,t))?i:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):yt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),le.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),pe.fn.extend({addClass:function(e){var t,n,i,r,o,a,s,l=0;if(ce(e))return this.each(function(t){pe(this).addClass(e.call(this,t,W(this)))});if((t=V(e)).length)for(;n=this[l++];)if(r=W(n),i=1===n.nodeType&&" "+q(r)+" "){for(a=0;o=t[a++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(s=q(i))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,i,r,o,a,s,l=0;if(ce(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,W(this)))});if(!arguments.length)return this.attr("class","");if((t=V(e)).length)for(;n=this[l++];)if(r=W(n),i=1===n.nodeType&&" "+q(r)+" "){for(a=0;o=t[a++];)for(;-1<i.indexOf(" "+o+" ");)i=i.replace(" "+o+" "," ");r!==(s=q(i))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,i="string"===n||Array.isArray(e);return"boolean"==typeof t&&i?t?this.addClass(e):this.removeClass(e):ce(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,W(this),t),t)}):this.each(function(){var t,r,o,a;if(i)for(r=0,o=pe(this),a=V(e);t=a[r++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==n||((t=W(this))&&je.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":je.get(this,"__className__")||""))})},hasClass:function(e){var t,n,i=0;for(t=" "+e+" ";n=this[i++];)if(1===n.nodeType&&-1<(" "+q(W(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;pe.fn.extend({val:function(e){var t,n,i,r=this[0];return arguments.length?(i=ce(e),this.each(function(n){var r;1===this.nodeType&&(null==(r=i?e.call(this,n,pe(this).val()):e)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=pe.map(r,function(e){return null==e?"":e+""})),(t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,r,"value")||(this.value=r))})):r?(t=pe.valHooks[r.type]||pe.valHooks[r.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(xt,""):null==n?"":n:void 0}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:q(pe.text(e))}},select:{get:function(e){var t,n,i,r=e.options,a=e.selectedIndex,s="select-one"===e.type,l=s?null:[],c=s?a+1:r.length;for(i=a<0?c:s?a:0;i<c;i++)if(((n=r[i]).selected||i===a)&&!n.disabled&&(!n.parentNode.disabled||!o(n.parentNode,"optgroup"))){if(t=pe(n).val(),s)return t;l.push(t)}return l},set:function(e,t){for(var n,i,r=e.options,o=pe.makeArray(t),a=r.length;a--;)((i=r[a]).selected=-1<pe.inArray(pe.valHooks.option.get(i),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<pe.inArray(pe(e).val(),t)}},le.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),le.focusin="onfocusin"in e;var Ct=/^(?:focusinfocus|focusoutblur)$/,kt=function(e){e.stopPropagation()};pe.extend(pe.event,{trigger:function(t,n,i,r){var o,a,s,l,c,u,d,h,f=[i||de],p=oe.call(t,"type")?t.type:t,m=oe.call(t,"namespace")?t.namespace.split("."):[];if(a=h=s=i=i||de,3!==i.nodeType&&8!==i.nodeType&&!Ct.test(p+pe.event.triggered)&&(-1<p.indexOf(".")&&(p=(m=p.split(".")).shift(),m.sort()),c=p.indexOf(":")<0&&"on"+p,(t=t[pe.expando]?t:new pe.Event(p,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:pe.makeArray(n,[t]),d=pe.event.special[p]||{},r||!d.trigger||!1!==d.trigger.apply(i,n))){if(!r&&!d.noBubble&&!ue(i)){for(l=d.delegateType||p,Ct.test(l+p)||(a=a.parentNode);a;a=a.parentNode)f.push(a),s=a;s===(i.ownerDocument||de)&&f.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=f[o++])&&!t.isPropagationStopped();)h=a,t.type=1<o?l:d.bindType||p,(u=(je.get(a,"events")||Object.create(null))[t.type]&&je.get(a,"handle"))&&u.apply(a,n),(u=c&&a[c])&&u.apply&&Ae(a)&&(t.result=u.apply(a,n),!1===t.result&&t.preventDefault());return t.type=p,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(f.pop(),n)||!Ae(i)||c&&ce(i[p])&&!ue(i)&&((s=i[c])&&(i[c]=null),pe.event.triggered=p,t.isPropagationStopped()&&h.addEventListener(p,kt),i[p](),t.isPropagationStopped()&&h.removeEventListener(p,kt),pe.event.triggered=void 0,s&&(i[c]=s)),t.result}},simulate:function(e,t,n){var i=pe.extend(new pe.Event,n,{type:e,isSimulated:!0});pe.event.trigger(i,null,t)}}),pe.fn.extend({trigger:function(e,t){return this.each(function(){pe.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return pe.event.trigger(e,t,n,!0)}}),le.focusin||pe.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){pe.event.simulate(t,e.target,pe.event.fix(e))};pe.event.special[t]={setup:function(){var i=this.ownerDocument||this.document||this,r=je.access(i,t);r||i.addEventListener(e,n,!0),je.access(i,t,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=je.access(i,t)-1;r?je.access(i,t,r):(i.removeEventListener(e,n,!0),je.remove(i,t))}}});var _t=e.location,St={guid:Date.now()},Et=/\?/;pe.parseXML=function(t){var n,i;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=n&&n.getElementsByTagName("parsererror")[0],n&&!i||pe.error("Invalid XML: "+(i?pe.map(i.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var Tt=/\[\]$/,Dt=/\r?\n/g,$t=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,i=[],r=function(e,t){var n=ce(t)?t():t;i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){r(this.name,this.value)});else for(n in e)Y(n,e[n],t,r);return i.join("&")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&At.test(this.nodeName)&&!$t.test(e)&&(this.checked||!We.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:Array.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var jt=/%20/g,Pt=/#.*$/,Ot=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Mt=/^(?:GET|HEAD)$/,Nt=/^\/\//,Ft={},Rt={},Lt="*/".concat("*"),zt=de.createElement("a");zt.href=_t.href,pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_t.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(_t.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Lt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Q(Q(e,pe.ajaxSettings),t):Q(pe.ajaxSettings,e)},ajaxPrefilter:G(Ft),ajaxTransport:G(Rt),ajax:function(t,n){function i(t,n,i,s){var c,h,f,w,x,C=n;u||(u=!0,l&&e.clearTimeout(l),r=void 0,a=s||"",k.readyState=0<t?4:0,c=200<=t&&t<300||304===t,i&&(w=function(e,t,n){for(var i,r,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===i&&(i=e.mimeType||t.getResponseHeader("Content-Type"));if(i)for(r in s)if(s[r]&&s[r].test(i)){l.unshift(r);break}if(l[0]in n)o=l[0];else{for(r in n){if(!l[0]||e.converters[r+" "+l[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,k,i)),!c&&-1<pe.inArray("script",p.dataTypes)&&pe.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(e,t,n,i){var r,o,a,s,l,c={},u=e.dataTypes.slice();if(u[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&i&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=c[l+" "+o]||c["* "+o]))for(r in c)if((s=r.split(" "))[1]===o&&(a=c[l+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[r]:!0!==c[r]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(p,w,k,c),c?(p.ifModified&&((x=k.getResponseHeader("Last-Modified"))&&(pe.lastModified[o]=x),(x=k.getResponseHeader("etag"))&&(pe.etag[o]=x)),204===t||"HEAD"===p.type?C="nocontent":304===t?C="notmodified":(C=w.state,h=w.data,c=!(f=w.error))):(f=C,!t&&C||(C="error",t<0&&(t=0))),k.status=t,k.statusText=(n||C)+"",c?v.resolveWith(m,[h,C,k]):v.rejectWith(m,[k,C,f]),k.statusCode(y),y=void 0,d&&g.trigger(c?"ajaxSuccess":"ajaxError",[k,p,c?h:f]),b.fireWith(m,[k,C]),d&&(g.trigger("ajaxComplete",[k,p]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var r,o,a,s,l,c,u,d,h,f,p=pe.ajaxSetup({},n),m=p.context||p,g=p.context&&(m.nodeType||m.jquery)?pe(m):pe.event,v=pe.Deferred(),b=pe.Callbacks("once memory"),y=p.statusCode||{},w={},x={},C="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(u){if(!s)for(s={};t=It.exec(a);)s[t[1].toLowerCase()+" "]=(s[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=s[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?a:null},setRequestHeader:function(e,t){return null==u&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==u&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)k.always(e[k.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||C;return r&&r.abort(t),i(0,t),this}};if(v.promise(k),p.url=((t||p.url||_t.href)+"").replace(Nt,_t.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(_e)||[""],null==p.crossDomain){c=de.createElement("a");try{c.href=p.url,c.href=c.href,p.crossDomain=zt.protocol+"//"+zt.host!=c.protocol+"//"+c.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=pe.param(p.data,p.traditional)),Z(Ft,p,n,k),u)return k;for(h in(d=pe.event&&p.global)&&0==pe.active++&&pe.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Mt.test(p.type),o=p.url.replace(Pt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(jt,"+")):(f=p.url.slice(o.length),p.data&&(p.processData||"string"==typeof p.data)&&(o+=(Et.test(o)?"&":"?")+p.data,delete p.data),!1===p.cache&&(o=o.replace(Ot,"$1"),f=(Et.test(o)?"&":"?")+"_="+St.guid+++f),p.url=o+f),p.ifModified&&(pe.lastModified[o]&&k.setRequestHeader("If-Modified-Since",pe.lastModified[o]),pe.etag[o]&&k.setRequestHeader("If-None-Match",pe.etag[o])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&k.setRequestHeader("Content-Type",p.contentType),k.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Lt+"; q=0.01":""):p.accepts["*"]),p.headers)k.setRequestHeader(h,p.headers[h]);if(p.beforeSend&&(!1===p.beforeSend.call(m,k,p)||u))return k.abort();if(C="abort",b.add(p.complete),k.done(p.success),k.fail(p.error),r=Z(Rt,p,n,k)){if(k.readyState=1,d&&g.trigger("ajaxSend",[k,p]),u)return k;p.async&&0<p.timeout&&(l=e.setTimeout(function(){k.abort("timeout")},p.timeout));try{u=!1,r.send(w,i)}catch(t){if(u)throw t;i(-1,t)}}else i(-1,"No Transport");return k},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,i,r){return ce(n)&&(r=r||i,i=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:r,data:n,success:i},pe.isPlainObject(e)&&e))}}),pe.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),pe._evalUrl=function(e,t,n){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){pe.globalEval(e,t,n)}})},pe.fn.extend({wrapAll:function(e){var t;return this[0]&&(ce(e)&&(e=e.call(this[0])),t=pe(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return ce(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ce(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){pe(this).replaceWith(this.childNodes)}),this}}),pe.expr.pseudos.hidden=function(e){return!pe.expr.pseudos.visible(e)},pe.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},pe.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Ht={0:200,1223:204},Bt=pe.ajaxSettings.xhr();le.cors=!!Bt&&"withCredentials"in Bt,le.ajax=Bt=!!Bt,pe.ajaxTransport(function(t){var n,i;if(le.cors||Bt&&!t.crossDomain)return{send:function(r,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)s.setRequestHeader(a,r[a]);n=function(e){return function(){n&&(n=i=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ht[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),i=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=i:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&i()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(r){if(n)throw r}},abort:function(){n&&n()}}}),pe.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),pe.ajaxTransport("script",function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(i,r){t=pe("<script>").attr(e.scriptAttrs||{}).prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&r("error"===e.type?404:200,e.type)}),de.head.appendChild(t[0])},abort:function(){n&&n()}}});var Ut,qt=[],Wt=/(=)\?(?=&|$)|\?\?/;pe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=qt.pop()||pe.expando+"_"+St.guid++;return this[e]=!0,e}}),pe.ajaxPrefilter("json jsonp",function(t,n,i){var r,o,a,s=!1!==t.jsonp&&(Wt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Wt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=ce(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Wt,"$1"+r):!1!==t.jsonp&&(t.url+=(Et.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return a||pe.error(r+" was not called"),a[0]},t.dataTypes[0]="json",o=e[r],e[r]=function(){a=arguments},i.always(function(){void 0===o?pe(e).removeProp(r):e[r]=o,t[r]&&(t.jsonpCallback=n.jsonpCallback,qt.push(r)),a&&ce(o)&&o(a[0]),a=o=void 0}),"script"}),le.createHTMLDocument=((Ut=de.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),pe.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((i=(t=de.implementation.createHTMLDocument("")).createElement("base")).href=de.location.href,t.head.appendChild(i)):t=de),o=!n&&[],(r=ye.exec(e))?[t.createElement(r[1])]:(r=w([e],t,o),o&&o.length&&pe(o).remove(),pe.merge([],r.childNodes)));var i,r,o},pe.fn.load=function(e,t,n){var i,r,o,a=this,s=e.indexOf(" ");return-1<s&&(i=q(e.slice(s)),e=e.slice(0,s)),ce(t)?(n=t,t=void 0):t&&"object"==typeof t&&(r="POST"),0<a.length&&pe.ajax({url:e,type:r||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(i?pe("<div>").append(pe.parseHTML(e)).find(i):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},pe.expr.pseudos.animated=function(e){return pe.grep(pe.timers,function(t){return e===t.elem}).length},pe.offset={setOffset:function(e,t,n){var i,r,o,a,s,l,c=pe.css(e,"position"),u=pe(e),d={};"static"===c&&(e.style.position="relative"),s=u.offset(),o=pe.css(e,"top"),l=pe.css(e,"left"),("absolute"===c||"fixed"===c)&&-1<(o+l).indexOf("auto")?(a=(i=u.position()).top,r=i.left):(a=parseFloat(o)||0,r=parseFloat(l)||0),ce(t)&&(t=t.call(e,n,pe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+r),"using"in t?t.using.call(e,d):u.css(d)}},pe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){pe.offset.setOffset(this,e,t)});var t,n,i=this[0];return i?i.getClientRects().length?(t=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,i=this[0],r={top:0,left:0};if("fixed"===pe.css(i,"position"))t=i.getBoundingClientRect();else{for(t=this.offset(),n=i.ownerDocument,e=i.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===pe.css(e,"position");)e=e.parentNode;e&&e!==i&&1===e.nodeType&&((r=pe(e).offset()).top+=pe.css(e,"borderTopWidth",!0),r.left+=pe.css(e,"borderLeftWidth",!0))}return{top:t.top-r.top-pe.css(i,"marginTop",!0),left:t.left-r.left-pe.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===pe.css(e,"position");)e=e.offsetParent;return e||Re})}}),pe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;pe.fn[e]=function(i){return Te(this,function(e,i,r){var o;if(ue(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===r)return o?o[t]:e[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):e[i]=r},e,i,arguments.length)}}),pe.each(["top","left"],function(e,t){pe.cssHooks[t]=O(le.pixelPosition,function(e,n){if(n)return n=P(e,t),et.test(n)?pe(e).position()[t]+"px":n})}),pe.each({Height:"height",Width:"width"},function(e,t){pe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,i){pe.fn[i]=function(r,o){var a=arguments.length&&(n||"boolean"!=typeof r),s=n||(!0===r||!0===o?"margin":"border");return Te(this,function(t,n,r){var o;return ue(t)?0===i.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===r?pe.css(t,n,s):pe.style(t,n,r,s)},t,a?r:void 0,a)}})}),pe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){pe.fn[t]=function(e){return this.on(t,e)}}),pe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,i){return this.on(t,e,n,i)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),pe.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return 0<arguments.length?this.on(t,null,e,n):this.trigger(t)}});var Vt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;pe.proxy=function(e,t){var n,i,r;if("string"==typeof t&&(n=e[t],t=e,e=n),ce(e))return i=J.call(arguments,2),(r=function(){return e.apply(t||this,i.concat(J.call(arguments)))}).guid=e.guid=e.guid||pe.guid++,r},pe.holdReady=function(e){e?pe.readyWait++:pe.ready(!0)},pe.isArray=Array.isArray,pe.parseJSON=JSON.parse,pe.nodeName=o,pe.isFunction=ce,pe.isWindow=ue,pe.camelCase=f,pe.type=i,pe.now=Date.now,pe.isNumeric=function(e){var t=pe.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},pe.trim=function(e){return null==e?"":(e+"").replace(Vt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return pe});var Yt=e.jQuery,Gt=e.$;return pe.noConflict=function(t){return e.$===pe&&(e.$=Gt),t&&e.jQuery===pe&&(e.jQuery=Yt),pe},void 0===t&&(e.jQuery=e.$=pe),pe}),function(e){function t(t){if("string"==typeof t.data&&(t.data={keys:t.data}),t.data&&t.data.keys&&"string"==typeof t.data.keys){var n=t.handler,i=t.data.keys.toLowerCase().split(" ");t.handler=function(t){if(this===t.target||!(e.hotkeys.options.filterInputAcceptingElements&&e.hotkeys.textInputTypes.test(t.target.nodeName)||e.hotkeys.options.filterContentEditable&&e(t.target).attr("contenteditable")||e.hotkeys.options.filterTextInputs&&e.inArray(t.target.type,e.hotkeys.textAcceptingInputTypes)>-1)){var r="keypress"!==t.type&&e.hotkeys.specialKeys[t.which],o=String.fromCharCode(t.which).toLowerCase(),a="",s={};e.each(["alt","ctrl","shift"],function(e,n){t[n+"Key"]&&r!==n&&(a+=n+"+")}),t.metaKey&&!t.ctrlKey&&"meta"!==r&&(a+="meta+"),t.metaKey&&"meta"!==r&&a.indexOf("alt+ctrl+shift+")>-1&&(a=a.replace("alt+ctrl+shift+","hyper+")),r?s[a+r]=!0:(s[a+o]=!0,s[a+e.hotkeys.shiftNums[o]]=!0,"shift+"===a&&(s[e.hotkeys.shiftNums[o]]=!0));for(var l=0,c=i.length;l<c;l++)if(s[i[l]])return n.apply(this,arguments)}}}}e.hotkeys={version:"0.2.0",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},e.each(["keydown","keyup","keypress"],function(){e.event.special[this]={add:t}})}(jQuery||this.jQuery||window.jQuery),define("jquery.hotkeys",["jquery"],function(){}),define("pgui.shortcuts",["jquery.hotkeys"],function(){function e(e,t,n,i){return r[e]||(r[e]=function(e){if("common"!==i&&-1===o[o.length-1].indexOf(i))return!0;if(!t&&/textarea|input|select/i.test(e.target.nodeName))return!0;var r=$(n).get(0);return r&&r.click(),!1}),r[e]}function t(t){t=t||["grid","form"],o.push(t),$.each(i,function(n,i){if(-1!==t.indexOf(i.scope)){var r=i.keys.join("")+i.scope,o=e(r,i.ignoreFocusedInputs,i.selector,i.scope);$document.off("keydown",o),$.each(i.keys,function(e,t){$document.on("keydown",null,t,o)});var a=$(i.selector);if(a.length){var s=a.attr("title");s=s?s+" ":"",a.attr("title",s+"("+i.keys.join(", ")+")")}}})}function n(){o.pop()}$.hotkeys.options=$.extend($.hotkeys.options,{filterInputAcceptingElements:!1,filterContentEditable:!1,filterTextInputs:!1});var i=[{keys:["Ctrl+[","Ctrl+]"],selector:".toggle-sidebar",scope:"common"},{keys:["Ctrl+left"],selector:".pgui-pagination .pgui-pagination-prev",scope:"grid"},{keys:["Ctrl+right"],selector:".pgui-pagination  .pgui-pagination-next",scope:"grid"},{keys:["Alt+Ctrl+I","Alt+Insert"],selector:".grid:first .pgui-add",scope:"grid"},{keys:["Ctrl+Shift+/"],selector:".grid:first .expand-all-details",scope:"grid"},{keys:["Ctrl+Shift+F"],selector:".grid:first .js-filter-builder-open",scope:"grid"},{keys:["Ctrl+Return"],selector:".js-form-container:visible .js-primary-save",ignoreFocusedInputs:!0,scope:"form"},{keys:["Ctrl+Shift+Return"],selector:".js-form-container:visible .js-save-insert",ignoreFocusedInputs:!0,scope:"form"},{keys:["Alt+Ctrl+I","Alt+Insert"],selector:".js-form-add:visible",scope:"form"},{keys:["Alt+Ctrl+I","Alt+Insert"],selector:".modal:visible .js-group-action-select[data-action=add-condition]",ignoreFocusedInputs:!0,scope:"filter_builder"},{keys:["Ctrl+Return"],selector:".modal:visible .js-filter-builder-commit",ignoreFocusedInputs:!0,scope:"filter_builder"},{keys:["Ctrl+Return"],selector:".webui-popover-content .js-save",ignoreFocusedInputs:!0,scope:"quick_edit"}],r={};$document=$(document);var o=[];return $(function(){t(["common"])}),{push:t,pop:n}}),window.matchMedia||(window.matchMedia=function(e){var t=e.document,n=t.documentElement,i=[],r=0,o="",a={},s=/\s*(only|not)?\s*(screen|print|[a-z\-]+)\s*(and)?\s*/i,l=/^\s*\(\s*(-[a-z]+-)?(min-|max-)?([a-z\-]+)\s*(:?\s*([0-9]+(\.[0-9]+)?|portrait|landscape)(px|em|dppx|dpcm|rem|%|in|cm|mm|ex|pt|pc|\/([0-9]+(\.[0-9]+)?))?)?\s*\)\s*$/,c=0,u=function(e){var t=-1!==e.indexOf(",")&&e.split(",")||[e],n=t.length-1,i=n,r=null,c=null,u="",d=0,h=!1,f="",p="",r=null,c=0,p=null,m="",g="",v="",b="",y="",m=!1;if(""===e)return!0;do{if(r=t[i-n],h=!1,(c=r.match(s))&&(u=c[0],d=c.index),!c||-1===r.substring(0,d).indexOf("(")&&(d||!c[3]&&u!==c.input))m=!1;else{if(p=r,h="not"===c[1],d||(f=c[2],p=r.substring(u.length)),m=f===o||"all"===f||""===f,r=-1!==p.indexOf(" and ")&&p.split(" and ")||[p],c=r.length-1,m&&0<=c&&""!==p)do{if(!(p=r[c].match(l))||!a[p[3]]){m=!1;break}if(m=p[2],b=g=p[5],v=p[7],y=a[p[3]],v&&(b="px"===v?Number(g):"em"===v||"rem"===v?16*g:p[8]?(g/p[8]).toFixed(2):"dppx"===v?96*g:"dpcm"===v?.3937*g:Number(g)),!(m="min-"===m&&b?y>=b:"max-"===m&&b?y<=b:b?y===b:!!y))break}while(c--);if(m)break}}while(n--);return h?!m:m},d=function(){var t=e.innerWidth||n.clientWidth,i=e.innerHeight||n.clientHeight,r=e.screen.width,o=e.screen.height,s=e.screen.colorDepth,l=e.devicePixelRatio;a.width=t,a.height=i,a["aspect-ratio"]=(t/i).toFixed(2),a["device-width"]=r,a["device-height"]=o,a["device-aspect-ratio"]=(r/o).toFixed(2),a.color=s,a["color-index"]=Math.pow(2,s),a.orientation=i>=t?"portrait":"landscape",a.resolution=l&&96*l||e.screen.deviceXDPI||96,a["device-pixel-ratio"]=l||1},h=function(){
clearTimeout(c),c=setTimeout(function(){var t=null,n=r-1,o=n,a=!1;if(0<=n){d();do{if((t=i[o-n])&&((a=u(t.mql.media))&&!t.mql.matches||!a&&t.mql.matches)&&(t.mql.matches=a,t.listeners))for(var a=0,s=t.listeners.length;a<s;a++)t.listeners[a]&&t.listeners[a].call(e,t.mql)}while(n--)}},10)},f=t.getElementsByTagName("head")[0],t=t.createElement("style"),p=null,m="screen print speech projection handheld tv braille embossed tty".split(" "),g=0,v=m.length,b="#mediamatchjs { position: relative; z-index: 0; }",y="",w=e.addEventListener||(y="on")&&e.attachEvent;for(t.type="text/css",t.id="mediamatchjs",f.appendChild(t),p=e.getComputedStyle&&e.getComputedStyle(t)||t.currentStyle;g<v;g++)b+="@media "+m[g]+" { #mediamatchjs { position: relative; z-index: "+g+" } }";return t.styleSheet?t.styleSheet.cssText=b:t.textContent=b,o=m[1*p.zIndex||0],f.removeChild(t),d(),w(y+"resize",h),w(y+"orientationchange",h),function(e){var t=r,n={matches:!1,media:e,addListener:function(e){i[t].listeners||(i[t].listeners=[]),e&&i[t].listeners.push(e)},removeListener:function(e){var n=i[t],r=0,o=0;if(n)for(o=n.listeners.length;r<o;r++)n.listeners[r]===e&&n.listeners.splice(r,1)}};return""===e?(n.matches=!0,n):(n.matches=u(e),r=i.push({mql:n,listeners:null}),n)}}(window)),define("libs/match-media",function(){}),define("pgui.sidebar",["pgui.shortcuts","libs/match-media"],function(){return function(e){function t(){var t=window.matchMedia("(max-width: 991px)").matches?"sidebar-active":"sidebar-desktop-active";e.toggleClass(t)}e.on("click touchstart",".sidebar-backdrop",t),e.on("click",".toggle-sidebar",t)}}),function(){function e(e){function t(t,n,i,r,o,a){for(;o>=0&&a>o;o+=e){var s=r?r[o]:o;i=n(i,t[s],s,t)}return i}return function(n,i,r,o){i=y(i,o,4);var a=!E(n)&&b.keys(n),s=(a||n).length,l=e>0?0:s-1;return arguments.length<3&&(r=n[a?a[l]:l],l+=e),t(n,i,r,a,l,s)}}function t(e){return function(t,n,i){n=w(n,i);for(var r=S(t),o=e>0?0:r-1;o>=0&&r>o;o+=e)if(n(t[o],o,t))return o;return-1}}function n(e,t,n){return function(i,r,o){var a=0,s=S(i);if("number"==typeof o)e>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return o=n(i,r),i[o]===r?o:-1;if(r!==r)return o=t(u.call(i,a,s),b.isNaN),o>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&s>o;o+=e)if(i[o]===r)return o;return-1}}function i(e,t){var n=j.length,i=e.constructor,r=b.isFunction(i)&&i.prototype||s,o="constructor";for(b.has(e,o)&&!b.contains(t,o)&&t.push(o);n--;)(o=j[n])in e&&e[o]!==r[o]&&!b.contains(t,o)&&t.push(o)}var r=this,o=r._,a=Array.prototype,s=Object.prototype,l=Function.prototype,c=a.push,u=a.slice,d=s.toString,h=s.hasOwnProperty,f=Array.isArray,p=Object.keys,m=l.bind,g=Object.create,v=function(){},b=function(e){return e instanceof b?e:this instanceof b?void(this._wrapped=e):new b(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports._=b):r._=b,b.VERSION="1.8.3";var y=function(e,t,n){if(void 0===t)return e;switch(null==n?3:n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)};case 4:return function(n,i,r,o){return e.call(t,n,i,r,o)}}return function(){return e.apply(t,arguments)}},w=function(e,t,n){return null==e?b.identity:b.isFunction(e)?y(e,t,n):b.isObject(e)?b.matcher(e):b.property(e)};b.iteratee=function(e,t){return w(e,t,1/0)};var x=function(e,t){return function(n){var i=arguments.length;if(2>i||null==n)return n;for(var r=1;i>r;r++)for(var o=arguments[r],a=e(o),s=a.length,l=0;s>l;l++){var c=a[l];t&&void 0!==n[c]||(n[c]=o[c])}return n}},C=function(e){if(!b.isObject(e))return{};if(g)return g(e);v.prototype=e;var t=new v;return v.prototype=null,t},k=function(e){return function(t){return null==t?void 0:t[e]}},_=Math.pow(2,53)-1,S=k("length"),E=function(e){var t=S(e);return"number"==typeof t&&t>=0&&_>=t};b.each=b.forEach=function(e,t,n){t=y(t,n);var i,r;if(E(e))for(i=0,r=e.length;r>i;i++)t(e[i],i,e);else{var o=b.keys(e);for(i=0,r=o.length;r>i;i++)t(e[o[i]],o[i],e)}return e},b.map=b.collect=function(e,t,n){t=w(t,n);for(var i=!E(e)&&b.keys(e),r=(i||e).length,o=Array(r),a=0;r>a;a++){var s=i?i[a]:a;o[a]=t(e[s],s,e)}return o},b.reduce=b.foldl=b.inject=e(1),b.reduceRight=b.foldr=e(-1),b.find=b.detect=function(e,t,n){var i;return i=E(e)?b.findIndex(e,t,n):b.findKey(e,t,n),void 0!==i&&-1!==i?e[i]:void 0},b.filter=b.select=function(e,t,n){var i=[];return t=w(t,n),b.each(e,function(e,n,r){t(e,n,r)&&i.push(e)}),i},b.reject=function(e,t,n){return b.filter(e,b.negate(w(t)),n)},b.every=b.all=function(e,t,n){t=w(t,n);for(var i=!E(e)&&b.keys(e),r=(i||e).length,o=0;r>o;o++){var a=i?i[o]:o;if(!t(e[a],a,e))return!1}return!0},b.some=b.any=function(e,t,n){t=w(t,n);for(var i=!E(e)&&b.keys(e),r=(i||e).length,o=0;r>o;o++){var a=i?i[o]:o;if(t(e[a],a,e))return!0}return!1},b.contains=b.includes=b.include=function(e,t,n,i){return E(e)||(e=b.values(e)),("number"!=typeof n||i)&&(n=0),b.indexOf(e,t,n)>=0},b.invoke=function(e,t){var n=u.call(arguments,2),i=b.isFunction(t);return b.map(e,function(e){var r=i?t:e[t];return null==r?r:r.apply(e,n)})},b.pluck=function(e,t){return b.map(e,b.property(t))},b.where=function(e,t){return b.filter(e,b.matcher(t))},b.findWhere=function(e,t){return b.find(e,b.matcher(t))},b.max=function(e,t,n){var i,r,o=-1/0,a=-1/0;if(null==t&&null!=e){e=E(e)?e:b.values(e);for(var s=0,l=e.length;l>s;s++)(i=e[s])>o&&(o=i)}else t=w(t,n),b.each(e,function(e,n,i){((r=t(e,n,i))>a||r===-1/0&&o===-1/0)&&(o=e,a=r)});return o},b.min=function(e,t,n){var i,r,o=1/0,a=1/0;if(null==t&&null!=e){e=E(e)?e:b.values(e);for(var s=0,l=e.length;l>s;s++)i=e[s],o>i&&(o=i)}else t=w(t,n),b.each(e,function(e,n,i){r=t(e,n,i),(a>r||1/0===r&&1/0===o)&&(o=e,a=r)});return o},b.shuffle=function(e){for(var t,n=E(e)?e:b.values(e),i=n.length,r=Array(i),o=0;i>o;o++)t=b.random(0,o),t!==o&&(r[o]=r[t]),r[t]=n[o];return r},b.sample=function(e,t,n){return null==t||n?(E(e)||(e=b.values(e)),e[b.random(e.length-1)]):b.shuffle(e).slice(0,Math.max(0,t))},b.sortBy=function(e,t,n){return t=w(t,n),b.pluck(b.map(e,function(e,n,i){return{value:e,index:n,criteria:t(e,n,i)}}).sort(function(e,t){var n=e.criteria,i=t.criteria;if(n!==i){if(n>i||void 0===n)return 1;if(i>n||void 0===i)return-1}return e.index-t.index}),"value")};var T=function(e){return function(t,n,i){var r={};return n=w(n,i),b.each(t,function(i,o){var a=n(i,o,t);e(r,i,a)}),r}};b.groupBy=T(function(e,t,n){b.has(e,n)?e[n].push(t):e[n]=[t]}),b.indexBy=T(function(e,t,n){e[n]=t}),b.countBy=T(function(e,t,n){b.has(e,n)?e[n]++:e[n]=1}),b.toArray=function(e){return e?b.isArray(e)?u.call(e):E(e)?b.map(e,b.identity):b.values(e):[]},b.size=function(e){return null==e?0:E(e)?e.length:b.keys(e).length},b.partition=function(e,t,n){t=w(t,n);var i=[],r=[];return b.each(e,function(e,n,o){(t(e,n,o)?i:r).push(e)}),[i,r]},b.first=b.head=b.take=function(e,t,n){return null==e?void 0:null==t||n?e[0]:b.initial(e,e.length-t)},b.initial=function(e,t,n){return u.call(e,0,Math.max(0,e.length-(null==t||n?1:t)))},b.last=function(e,t,n){return null==e?void 0:null==t||n?e[e.length-1]:b.rest(e,Math.max(0,e.length-t))},b.rest=b.tail=b.drop=function(e,t,n){return u.call(e,null==t||n?1:t)},b.compact=function(e){return b.filter(e,b.identity)};var D=function(e,t,n,i){for(var r=[],o=0,a=i||0,s=S(e);s>a;a++){var l=e[a];if(E(l)&&(b.isArray(l)||b.isArguments(l))){t||(l=D(l,t,n));var c=0,u=l.length;for(r.length+=u;u>c;)r[o++]=l[c++]}else n||(r[o++]=l)}return r};b.flatten=function(e,t){return D(e,t,!1)},b.without=function(e){return b.difference(e,u.call(arguments,1))},b.uniq=b.unique=function(e,t,n,i){b.isBoolean(t)||(i=n,n=t,t=!1),null!=n&&(n=w(n,i));for(var r=[],o=[],a=0,s=S(e);s>a;a++){var l=e[a],c=n?n(l,a,e):l;t?(a&&o===c||r.push(l),o=c):n?b.contains(o,c)||(o.push(c),r.push(l)):b.contains(r,l)||r.push(l)}return r},b.union=function(){return b.uniq(D(arguments,!0,!0))},b.intersection=function(e){for(var t=[],n=arguments.length,i=0,r=S(e);r>i;i++){var o=e[i];if(!b.contains(t,o)){for(var a=1;n>a&&b.contains(arguments[a],o);a++);a===n&&t.push(o)}}return t},b.difference=function(e){var t=D(arguments,!0,!0,1);return b.filter(e,function(e){return!b.contains(t,e)})},b.zip=function(){return b.unzip(arguments)},b.unzip=function(e){for(var t=e&&b.max(e,S).length||0,n=Array(t),i=0;t>i;i++)n[i]=b.pluck(e,i);return n},b.object=function(e,t){for(var n={},i=0,r=S(e);r>i;i++)t?n[e[i]]=t[i]:n[e[i][0]]=e[i][1];return n},b.findIndex=t(1),b.findLastIndex=t(-1),b.sortedIndex=function(e,t,n,i){n=w(n,i,1);for(var r=n(t),o=0,a=S(e);a>o;){var s=Math.floor((o+a)/2);n(e[s])<r?o=s+1:a=s}return o},b.indexOf=n(1,b.findIndex,b.sortedIndex),b.lastIndexOf=n(-1,b.findLastIndex),b.range=function(e,t,n){null==t&&(t=e||0,e=0),n=n||1;for(var i=Math.max(Math.ceil((t-e)/n),0),r=Array(i),o=0;i>o;o++,e+=n)r[o]=e;return r};var $=function(e,t,n,i,r){if(!(i instanceof t))return e.apply(n,r);var o=C(e.prototype),a=e.apply(o,r);return b.isObject(a)?a:o};b.bind=function(e,t){if(m&&e.bind===m)return m.apply(e,u.call(arguments,1));if(!b.isFunction(e))throw new TypeError("Bind must be called on a function");var n=u.call(arguments,2),i=function(){return $(e,i,t,this,n.concat(u.call(arguments)))};return i},b.partial=function(e){var t=u.call(arguments,1),n=function(){for(var i=0,r=t.length,o=Array(r),a=0;r>a;a++)o[a]=t[a]===b?arguments[i++]:t[a];for(;i<arguments.length;)o.push(arguments[i++]);return $(e,n,this,this,o)};return n},b.bindAll=function(e){var t,n,i=arguments.length;if(1>=i)throw new Error("bindAll must be passed function names");for(t=1;i>t;t++)n=arguments[t],e[n]=b.bind(e[n],e);return e},b.memoize=function(e,t){var n=function(i){var r=n.cache,o=""+(t?t.apply(this,arguments):i);return b.has(r,o)||(r[o]=e.apply(this,arguments)),r[o]};return n.cache={},n},b.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)},b.defer=b.partial(b.delay,b,1),b.throttle=function(e,t,n){var i,r,o,a=null,s=0;n||(n={});var l=function(){s=!1===n.leading?0:b.now(),a=null,o=e.apply(i,r),a||(i=r=null)};return function(){var c=b.now();s||!1!==n.leading||(s=c);var u=t-(c-s);return i=this,r=arguments,0>=u||u>t?(a&&(clearTimeout(a),a=null),s=c,o=e.apply(i,r),a||(i=r=null)):a||!1===n.trailing||(a=setTimeout(l,u)),o}},b.debounce=function(e,t,n){var i,r,o,a,s,l=function(){var c=b.now()-a;t>c&&c>=0?i=setTimeout(l,t-c):(i=null,n||(s=e.apply(o,r),i||(o=r=null)))};return function(){o=this,r=arguments,a=b.now();var c=n&&!i;return i||(i=setTimeout(l,t)),c&&(s=e.apply(o,r),o=r=null),s}},b.wrap=function(e,t){return b.partial(t,e)},b.negate=function(e){return function(){return!e.apply(this,arguments)}},b.compose=function(){var e=arguments,t=e.length-1;return function(){for(var n=t,i=e[t].apply(this,arguments);n--;)i=e[n].call(this,i);return i}},b.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},b.before=function(e,t){var n;return function(){return--e>0&&(n=t.apply(this,arguments)),1>=e&&(t=null),n}},b.once=b.partial(b.before,2);var A=!{toString:null}.propertyIsEnumerable("toString"),j=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];b.keys=function(e){if(!b.isObject(e))return[];if(p)return p(e);var t=[];for(var n in e)b.has(e,n)&&t.push(n);return A&&i(e,t),t},b.allKeys=function(e){if(!b.isObject(e))return[];var t=[];for(var n in e)t.push(n);return A&&i(e,t),t},b.values=function(e){for(var t=b.keys(e),n=t.length,i=Array(n),r=0;n>r;r++)i[r]=e[t[r]];return i},b.mapObject=function(e,t,n){t=w(t,n);for(var i,r=b.keys(e),o=r.length,a={},s=0;o>s;s++)i=r[s],a[i]=t(e[i],i,e);return a},b.pairs=function(e){for(var t=b.keys(e),n=t.length,i=Array(n),r=0;n>r;r++)i[r]=[t[r],e[t[r]]];return i},b.invert=function(e){for(var t={},n=b.keys(e),i=0,r=n.length;r>i;i++)t[e[n[i]]]=n[i];return t},b.functions=b.methods=function(e){var t=[];for(var n in e)b.isFunction(e[n])&&t.push(n);return t.sort()},b.extend=x(b.allKeys),b.extendOwn=b.assign=x(b.keys),b.findKey=function(e,t,n){t=w(t,n);for(var i,r=b.keys(e),o=0,a=r.length;a>o;o++)if(i=r[o],t(e[i],i,e))return i},b.pick=function(e,t,n){var i,r,o={},a=e;if(null==a)return o;b.isFunction(t)?(r=b.allKeys(a),i=y(t,n)):(r=D(arguments,!1,!1,1),i=function(e,t,n){return t in n},a=Object(a));for(var s=0,l=r.length;l>s;s++){var c=r[s],u=a[c];i(u,c,a)&&(o[c]=u)}return o},b.omit=function(e,t,n){if(b.isFunction(t))t=b.negate(t);else{var i=b.map(D(arguments,!1,!1,1),String);t=function(e,t){return!b.contains(i,t)}}return b.pick(e,t,n)},b.defaults=x(b.allKeys,!0),b.create=function(e,t){var n=C(e);return t&&b.extendOwn(n,t),n},b.clone=function(e){return b.isObject(e)?b.isArray(e)?e.slice():b.extend({},e):e},b.tap=function(e,t){return t(e),e},b.isMatch=function(e,t){var n=b.keys(t),i=n.length;if(null==e)return!i;for(var r=Object(e),o=0;i>o;o++){var a=n[o];if(t[a]!==r[a]||!(a in r))return!1}return!0};var P=function(e,t,n,i){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof b&&(e=e._wrapped),t instanceof b&&(t=t._wrapped);var r=d.call(e);if(r!==d.call(t))return!1;switch(r){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t}var o="[object Array]"===r;if(!o){if("object"!=typeof e||"object"!=typeof t)return!1;var a=e.constructor,s=t.constructor;if(a!==s&&!(b.isFunction(a)&&a instanceof a&&b.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}n=n||[],i=i||[];for(var l=n.length;l--;)if(n[l]===e)return i[l]===t;if(n.push(e),i.push(t),o){if((l=e.length)!==t.length)return!1;for(;l--;)if(!P(e[l],t[l],n,i))return!1}else{var c,u=b.keys(e);if(l=u.length,b.keys(t).length!==l)return!1;for(;l--;)if(c=u[l],!b.has(t,c)||!P(e[c],t[c],n,i))return!1}return n.pop(),i.pop(),!0};b.isEqual=function(e,t){return P(e,t)},b.isEmpty=function(e){return null==e||(E(e)&&(b.isArray(e)||b.isString(e)||b.isArguments(e))?0===e.length:0===b.keys(e).length)},b.isElement=function(e){return!(!e||1!==e.nodeType)},b.isArray=f||function(e){return"[object Array]"===d.call(e)},b.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},b.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){b["is"+e]=function(t){return d.call(t)==="[object "+e+"]"}}),b.isArguments(arguments)||(b.isArguments=function(e){return b.has(e,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(b.isFunction=function(e){return"function"==typeof e||!1}),b.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},b.isNaN=function(e){return b.isNumber(e)&&e!==+e},b.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"===d.call(e)},b.isNull=function(e){return null===e},b.isUndefined=function(e){return void 0===e},b.has=function(e,t){return null!=e&&h.call(e,t)},b.noConflict=function(){return r._=o,this},b.identity=function(e){return e},b.constant=function(e){return function(){return e}},b.noop=function(){},b.property=k,b.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},b.matcher=b.matches=function(e){return e=b.extendOwn({},e),function(t){return b.isMatch(t,e)}},b.times=function(e,t,n){var i=Array(Math.max(0,e));t=y(t,n,1);for(var r=0;e>r;r++)i[r]=t(r);return i},b.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},b.now=Date.now||function(){return(new Date).getTime()};var O={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},I=b.invert(O),M=function(e){var t=function(t){return e[t]},n="(?:"+b.keys(e).join("|")+")",i=RegExp(n),r=RegExp(n,"g");return function(e){return e=null==e?"":""+e,i.test(e)?e.replace(r,t):e}};b.escape=M(O),b.unescape=M(I),b.result=function(e,t,n){var i=null==e?void 0:e[t];return void 0===i&&(i=n),b.isFunction(i)?i.call(e):i};var N=0;b.uniqueId=function(e){var t=++N+"";return e?e+t:t},b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,R={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\u2028|\u2029/g,z=function(e){return"\\"+R[e]};b.template=function(e,t,n){!t&&n&&(t=n),t=b.defaults({},t,b.templateSettings);var i=RegExp([(t.escape||F).source,(t.interpolate||F).source,(t.evaluate||F).source].join("|")+"|$","g"),r=0,o="__p+='";e.replace(i,function(t,n,i,a,s){return o+=e.slice(r,s).replace(L,z),r=s+t.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":i?o+="'+\n((__t=("+i+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n",t.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(t.variable||"obj","_",o)}catch(e){throw e.source=o,e}var s=function(e){return a.call(this,e,b)};return s.source="function("+(t.variable||"obj")+"){\n"+o+"}",s},b.chain=function(e){var t=b(e);return t._chain=!0,t};var H=function(e,t){return e._chain?b(t).chain():t};b.mixin=function(e){b.each(b.functions(e),function(t){var n=b[t]=e[t];b.prototype[t]=function(){var e=[this._wrapped];return c.apply(e,arguments),H(this,n.apply(b,e))}})},b.mixin(b),b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=a[e];b.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),"shift"!==e&&"splice"!==e||0!==n.length||delete n[0],H(this,n)}}),b.each(["concat","join","slice"],function(e){var t=a[e];b.prototype[e]=function(){return H(this,t.apply(this._wrapped,arguments))}}),b.prototype.value=function(){return this._wrapped},b.prototype.valueOf=b.prototype.toJSON=b.prototype.value,b.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return b})}.call(this),define("class",["require","exports","module"],function(e,t,n){var i=!1,r=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;n.exports=function(){},n.exports.extend=function(e){function t(){!i&&this.init&&this.init.apply(this,arguments)}var n=this.prototype;i=!0;var o=new this;i=!1;for(var a in e)o[a]="function"==typeof e[a]&&"function"==typeof n[a]&&r.test(e[a])?function(e,t){return function(){var i=this._super;this._super=n[e];var r=t.apply(this,arguments);return this._super=i,r}}(a,e[a]):e[a];return t.prototype=o,t.prototype.constructor=t,t.extend=arguments.callee,t}}),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");if(function(e){"use strict";var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1||t[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in t)if(void 0!==e.style[n])return{end:t[n]};return!1}e.fn.emulateTransitionEnd=function(t){var n=!1,i=this;e(this).one("bsTransitionEnd",function(){n=!0});var r=function(){n||e(i).trigger(e.support.transition.end)};return setTimeout(r,t),this},e(function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var n=e(this),r=n.data("bs.alert");r||n.data("bs.alert",r=new i(this)),"string"==typeof t&&r[t].call(n)})}var n='[data-dismiss="alert"]',i=function(t){e(t).on("click",n,this.close)};i.VERSION="3.3.7",i.TRANSITION_DURATION=150,i.prototype.close=function(t){function n(){a.detach().trigger("closed.bs.alert").remove()}var r=e(this),o=r.attr("data-target");o||(o=r.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,""));var a=e("#"===o?[]:o);t&&t.preventDefault(),a.length||(a=r.closest(".alert")),a.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(a.removeClass("in"),e.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",n).emulateTransitionEnd(i.TRANSITION_DURATION):n())};var r=e.fn.alert;e.fn.alert=t,e.fn.alert.Constructor=i,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",n,i.prototype.close)}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.button"),o="object"==typeof t&&t;r||i.data("bs.button",r=new n(this,o)),"toggle"==t?r.toggle():t&&r.setState(t)})}var n=function(t,i){this.$element=e(t),this.options=e.extend({},n.DEFAULTS,i),this.isLoading=!1};n.VERSION="3.3.7",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var n="disabled",i=this.$element,r=i.is("input")?"val":"html",o=i.data();t+="Text",null==o.resetText&&i.data("resetText",i[r]()),setTimeout(e.proxy(function(){i[r](null==o[t]?this.options[t]:o[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(n).attr(n,n).prop(n,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(n).removeAttr(n).prop(n,!1))},this),0)},n.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var n=this.$element.find("input");"radio"==n.prop("type")?(n.prop("checked")&&(e=!1),t.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(e=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),e&&n.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var i=e.fn.button;e.fn.button=t,e.fn.button.Constructor=n,e.fn.button.noConflict=function(){return e.fn.button=i,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(n){var i=e(n.target).closest(".btn");t.call(i,"toggle"),e(n.target).is('input[type="radio"], input[type="checkbox"]')||(n.preventDefault(),i.is("input,button")?i.trigger("focus"):i.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.carousel"),o=e.extend({},n.DEFAULTS,i.data(),"object"==typeof t&&t),a="string"==typeof t?t:o.slide;r||i.data("bs.carousel",r=new n(this,o)),"number"==typeof t?r.to(t):a?r[a]():o.interval&&r.pause().cycle()})}var n=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};n.VERSION="3.3.7",n.TRANSITION_DURATION=600,n.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},n.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},n.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},n.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},n.prototype.getItemForDirection=function(e,t){var n=this.getItemIndex(t);if(("prev"==e&&0===n||"next"==e&&n==this.$items.length-1)&&!this.options.wrap)return t;var i="prev"==e?-1:1,r=(n+i)%this.$items.length;return this.$items.eq(r)},n.prototype.to=function(e){var t=this,n=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){t.to(e)}):n==e?this.pause().cycle():this.slide(e>n?"next":"prev",this.$items.eq(e))},n.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},n.prototype.next=function(){if(!this.sliding)return this.slide("next")},n.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},n.prototype.slide=function(t,i){var r=this.$element.find(".item.active"),o=i||this.getItemForDirection(t,r),a=this.interval,s="next"==t?"left":"right",l=this;if(o.hasClass("active"))return this.sliding=!1;var c=o[0],u=e.Event("slide.bs.carousel",{relatedTarget:c,direction:s});if(this.$element.trigger(u),!u.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=e(this.$indicators.children()[this.getItemIndex(o)]);d&&d.addClass("active")}var h=e.Event("slid.bs.carousel",{relatedTarget:c,direction:s});return e.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),o[0].offsetWidth,r.addClass(s),o.addClass(s),r.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active"),r.removeClass(["active",s].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(h)},0)}).emulateTransitionEnd(n.TRANSITION_DURATION)):(r.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(h)),a&&this.cycle(),this}};var i=e.fn.carousel;e.fn.carousel=t,e.fn.carousel.Constructor=n,e.fn.carousel.noConflict=function(){return e.fn.carousel=i,this};var r=function(n){var i,r=e(this),o=e(r.attr("data-target")||(i=r.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,""));if(o.hasClass("carousel")){var a=e.extend({},o.data(),r.data()),s=r.attr("data-slide-to");s&&(a.interval=!1),t.call(o,a),s&&o.data("bs.carousel").to(s),n.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var n=e(this);t.call(n,n.data())})})}(jQuery),function(e){"use strict";function t(t){var n,i=t.attr("data-target")||(n=t.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,"");return e(i)}function n(t){return this.each(function(){var n=e(this),r=n.data("bs.collapse"),o=e.extend({},i.DEFAULTS,n.data(),"object"==typeof t&&t);!r&&o.toggle&&/show|hide/.test(t)&&(o.toggle=!1),r||n.data("bs.collapse",r=new i(this,o)),"string"==typeof t&&r[t]()})}var i=function(t,n){this.$element=e(t),this.options=e.extend({},i.DEFAULTS,n),this.$trigger=e('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};i.VERSION="3.3.7",i.TRANSITION_DURATION=350,i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(r&&r.length&&(t=r.data("bs.collapse"))&&t.transitioning)){var o=e.Event("show.bs.collapse");if(this.$element.trigger(o),!o.isDefaultPrevented()){r&&r.length&&(n.call(r,"hide"),t||r.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this);var l=e.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",e.proxy(s,this)).emulateTransitionEnd(i.TRANSITION_DURATION)[a](this.$element[0][l])}}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var n=this.dimension();this.$element[n](this.$element[n]())[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 r=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!e.support.transition)return r.call(this);this.$element[n](0).one("bsTransitionEnd",e.proxy(r,this)).emulateTransitionEnd(i.TRANSITION_DURATION)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},i.prototype.getParent=function(){return e(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy(function(n,i){var r=e(i);this.addAriaAndCollapsedClass(t(r),r)},this)).end()},i.prototype.addAriaAndCollapsedClass=function(e,t){var n=e.hasClass("in");e.attr("aria-expanded",n),t.toggleClass("collapsed",!n).attr("aria-expanded",n)};var r=e.fn.collapse;e.fn.collapse=n,e.fn.collapse.Constructor=i,e.fn.collapse.noConflict=function(){return e.fn.collapse=r,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(i){var r=e(this);r.attr("data-target")||i.preventDefault();var o=t(r),a=o.data("bs.collapse"),s=a?"toggle":r.data();n.call(o,s)})}(jQuery),function(e){"use strict";function t(t){var n=t.attr("data-target");n||(n=t.attr("href"),n=n&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i=n&&e(n);return i&&i.length?i:t.parent()}function n(n){n&&3===n.which||(e(r).remove(),e(o).each(function(){var i=e(this),r=t(i),o={relatedTarget:this};r.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&e.contains(r[0],n.target)||(r.trigger(n=e.Event("hide.bs.dropdown",o)),n.isDefaultPrevented()||(i.attr("aria-expanded","false"),r.removeClass("open").trigger(e.Event("hidden.bs.dropdown",o)))))}))}function i(t){return this.each(function(){var n=e(this),i=n.data("bs.dropdown");i||n.data("bs.dropdown",i=new a(this)),"string"==typeof t&&i[t].call(n)})}var r=".dropdown-backdrop",o='[data-toggle="dropdown"]',a=function(t){e(t).on("click.bs.dropdown",this.toggle)};a.VERSION="3.3.7",a.prototype.toggle=function(i){var r=e(this);if(!r.is(".disabled, :disabled")){var o=t(r),a=o.hasClass("open");if(n(),!a){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&e(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(e(this)).on("click",n);var s={relatedTarget:this};if(o.trigger(i=e.Event("show.bs.dropdown",s)),i.isDefaultPrevented())return;r.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger(e.Event("shown.bs.dropdown",s))}return!1}},a.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var i=e(this);if(n.preventDefault(),n.stopPropagation(),!i.is(".disabled, :disabled")){var r=t(i),a=r.hasClass("open");if(!a&&27!=n.which||a&&27==n.which)return 27==n.which&&r.find(o).trigger("focus"),i.trigger("click");var s=r.find(".dropdown-menu li:not(.disabled):visible a");if(s.length){var l=s.index(n.target);38==n.which&&l>0&&l--,40==n.which&&l<s.length-1&&l++,~l||(l=0),s.eq(l).trigger("focus")}}}};var s=e.fn.dropdown;e.fn.dropdown=i,e.fn.dropdown.Constructor=a,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.bs.dropdown.data-api",n).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()
}).on("click.bs.dropdown.data-api",o,a.prototype.toggle).on("keydown.bs.dropdown.data-api",o,a.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",a.prototype.keydown)}(jQuery),function(e){"use strict";function t(t,i){return this.each(function(){var r=e(this),o=r.data("bs.modal"),a=e.extend({},n.DEFAULTS,r.data(),"object"==typeof t&&t);o||r.data("bs.modal",o=new n(this,a)),"string"==typeof t?o[t](i):a.show&&o.show(i)})}var n=function(t,n){this.options=n,this.$body=e(document.body),this.$element=e(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};n.VERSION="3.3.7",n.TRANSITION_DURATION=300,n.BACKDROP_TRANSITION_DURATION=150,n.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},n.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)},n.prototype.show=function(t){var i=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r),this.isShown||r.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"]',e.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){i.$element.one("mouseup.dismiss.bs.modal",function(t){e(t.target).is(i.$element)&&(i.ignoreBackdropClick=!0)})}),this.backdrop(function(){var r=e.support.transition&&i.$element.hasClass("fade");i.$element.parent().length||i.$element.appendTo(i.$body),i.$element.show().scrollTop(0),i.adjustDialog(),r&&i.$element[0].offsetWidth,i.$element.addClass("in"),i.enforceFocus();var o=e.Event("shown.bs.modal",{relatedTarget:t});r?i.$dialog.one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(o)}).emulateTransitionEnd(n.TRANSITION_DURATION):i.$element.trigger("focus").trigger(o)}))},n.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(n.TRANSITION_DURATION):this.hideModal())},n.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){document===e.target||this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},n.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},n.prototype.resize=function(){this.isShown?e(window).on("resize.bs.modal",e.proxy(this.handleUpdate,this)):e(window).off("resize.bs.modal")},n.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},n.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},n.prototype.backdrop=function(t){var i=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=e.support.transition&&r;if(this.$backdrop=e(document.createElement("div")).addClass("modal-backdrop "+r).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",e.proxy(function(e){if(this.ignoreBackdropClick)return void(this.ignoreBackdropClick=!1);e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){i.removeBackdrop(),t&&t()};e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(n.BACKDROP_TRANSITION_DURATION):a()}else t&&t()},n.prototype.handleUpdate=function(){this.adjustDialog()},n.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},n.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},n.prototype.checkScrollbar=function(){var e=window.innerWidth;if(!e){var t=document.documentElement.getBoundingClientRect();e=t.right-Math.abs(t.left)}this.bodyIsOverflowing=document.body.clientWidth<e,this.scrollbarWidth=this.measureScrollbar()},n.prototype.setScrollbar=function(){var e=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",e+this.scrollbarWidth)},n.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},n.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",this.$body.append(e);var t=e.offsetWidth-e.clientWidth;return this.$body[0].removeChild(e),t};var i=e.fn.modal;e.fn.modal=t,e.fn.modal.Constructor=n,e.fn.modal.noConflict=function(){return e.fn.modal=i,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(n){var i=e(this),r=i.attr("href"),o=e(i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),a=o.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},o.data(),i.data());i.is("a")&&n.preventDefault(),o.one("show.bs.modal",function(e){e.isDefaultPrevented()||o.one("hidden.bs.modal",function(){i.is(":visible")&&i.trigger("focus")})}),t.call(o,a,this)})}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.tooltip"),o="object"==typeof t&&t;!r&&/destroy|hide/.test(t)||(r||i.data("bs.tooltip",r=new n(this,o)),"string"==typeof t&&r[t]())})}var n=function(e,t){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",e,t)};n.VERSION="3.3.7",n.TRANSITION_DURATION=150,n.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}},n.prototype.init=function(t,n,i){if(this.enabled=!0,this.type=t,this.$element=e(n),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&e(e.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var r=this.options.trigger.split(" "),o=r.length;o--;){var a=r[o];if("click"==a)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=a){var s="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},n.prototype.getDelegateOptions=function(){var t={},n=this.getDefaults();return this._options&&e.each(this._options,function(e,i){n[e]!=i&&(t[e]=i)}),t},n.prototype.enter=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusin"==t.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState?void(n.hoverState="in"):(clearTimeout(n.timeout),n.hoverState="in",n.options.delay&&n.options.delay.show?void(n.timeout=setTimeout(function(){"in"==n.hoverState&&n.show()},n.options.delay.show)):n.show())},n.prototype.isInStateTrue=function(){for(var e in this.inState)if(this.inState[e])return!0;return!1},n.prototype.leave=function(t){var n=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n)),t instanceof e.Event&&(n.inState["focusout"==t.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout(function(){"out"==n.hoverState&&n.hide()},n.options.delay.hide)}},n.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var i=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!i)return;var r=this,o=this.tip(),a=this.getUID(this.type);this.setContent(),o.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,c=l.test(s);c&&(s=s.replace(l,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(this.options.container):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var u=this.getPosition(),d=o[0].offsetWidth,h=o[0].offsetHeight;if(c){var f=s,p=this.getPosition(this.$viewport);s="bottom"==s&&u.bottom+h>p.bottom?"top":"top"==s&&u.top-h<p.top?"bottom":"right"==s&&u.right+d>p.width?"left":"left"==s&&u.left-d<p.left?"right":s,o.removeClass(f).addClass(s)}var m=this.getCalculatedOffset(s,u,d,h);this.applyPlacement(m,s);var g=function(){var e=r.hoverState;r.$element.trigger("shown.bs."+r.type),r.hoverState=null,"out"==e&&r.leave(r)};e.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",g).emulateTransitionEnd(n.TRANSITION_DURATION):g()}},n.prototype.applyPlacement=function(t,n){var i=this.tip(),r=i[0].offsetWidth,o=i[0].offsetHeight,a=parseInt(i.css("margin-top"),10),s=parseInt(i.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(s)&&(s=0),t.top+=a,t.left+=s,e.offset.setOffset(i[0],e.extend({using:function(e){i.css({top:Math.round(e.top),left:Math.round(e.left)})}},t),0),i.addClass("in");var l=i[0].offsetWidth,c=i[0].offsetHeight;"top"==n&&c!=o&&(t.top=t.top+o-c);var u=this.getViewportAdjustedDelta(n,t,l,c);u.left?t.left+=u.left:t.top+=u.top;var d=/top|bottom/.test(n),h=d?2*u.left-r+l:2*u.top-o+c,f=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(h,i[0][f],d)},n.prototype.replaceArrow=function(e,t,n){this.arrow().css(n?"left":"top",50*(1-e/t)+"%").css(n?"top":"left","")},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},n.prototype.hide=function(t){function i(){"in"!=r.hoverState&&o.detach(),r.$element&&r.$element.removeAttr("aria-describedby").trigger("hidden.bs."+r.type),t&&t()}var r=this,o=e(this.$tip),a=e.Event("hide.bs."+this.type);if(this.$element.trigger(a),!a.isDefaultPrevented())return o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",i).emulateTransitionEnd(n.TRANSITION_DURATION):i(),this.hoverState=null,this},n.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},n.prototype.hasContent=function(){return this.getTitle()},n.prototype.getPosition=function(t){t=t||this.$element;var n=t[0],i="BODY"==n.tagName,r=n.getBoundingClientRect();null==r.width&&(r=e.extend({},r,{width:r.right-r.left,height:r.bottom-r.top}));var o=window.SVGElement&&n instanceof window.SVGElement,a=i?{top:0,left:0}:o?null:t.offset(),s={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},l=i?{width:e(window).width(),height:e(window).height()}:null;return e.extend({},r,s,l,a)},n.prototype.getCalculatedOffset=function(e,t,n,i){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-n/2}:"top"==e?{top:t.top-i,left:t.left+t.width/2-n/2}:"left"==e?{top:t.top+t.height/2-i/2,left:t.left-n}:{top:t.top+t.height/2-i/2,left:t.left+t.width}},n.prototype.getViewportAdjustedDelta=function(e,t,n,i){var r={top:0,left:0};if(!this.$viewport)return r;var o=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(e)){var s=t.top-o-a.scroll,l=t.top+o-a.scroll+i;s<a.top?r.top=a.top-s:l>a.top+a.height&&(r.top=a.top+a.height-l)}else{var c=t.left-o,u=t.left+o+n;c<a.left?r.left=a.left-c:u>a.right&&(r.left=a.left+a.width-u)}return r},n.prototype.getTitle=function(){var e=this.$element,t=this.options;return e.attr("data-original-title")||("function"==typeof t.title?t.title.call(e[0]):t.title)},n.prototype.getUID=function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},n.prototype.tip=function(){if(!this.$tip&&(this.$tip=e(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},n.prototype.enable=function(){this.enabled=!0},n.prototype.disable=function(){this.enabled=!1},n.prototype.toggleEnabled=function(){this.enabled=!this.enabled},n.prototype.toggle=function(t){var n=this;t&&((n=e(t.currentTarget).data("bs."+this.type))||(n=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,n))),t?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},n.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide(function(){e.$element.off("."+e.type).removeData("bs."+e.type),e.$tip&&e.$tip.detach(),e.$tip=null,e.$arrow=null,e.$viewport=null,e.$element=null})};var i=e.fn.tooltip;e.fn.tooltip=t,e.fn.tooltip.Constructor=n,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=i,this}}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.popover"),o="object"==typeof t&&t;!r&&/destroy|hide/.test(t)||(r||i.data("bs.popover",r=new n(this,o)),"string"==typeof t&&r[t]())})}var n=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");n.VERSION="3.3.7",n.DEFAULTS=e.extend({},e.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>'}),n.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),n.prototype.constructor=n,n.prototype.getDefaults=function(){return n.DEFAULTS},n.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof n?"html":"append":"text"](n),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},n.prototype.hasContent=function(){return this.getTitle()||this.getContent()},n.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},n.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var i=e.fn.popover;e.fn.popover=t,e.fn.popover.Constructor=n,e.fn.popover.noConflict=function(){return e.fn.popover=i,this}}(jQuery),function(e){"use strict";function t(n,i){this.$body=e(document.body),this.$scrollElement=e(e(n).is(document.body)?window:n),this.options=e.extend({},t.DEFAULTS,i),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.proxy(this.process,this)),this.refresh(),this.process()}function n(n){return this.each(function(){var i=e(this),r=i.data("bs.scrollspy"),o="object"==typeof n&&n;r||i.data("bs.scrollspy",r=new t(this,o)),"string"==typeof n&&r[n]()})}t.VERSION="3.3.7",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t=this,n="offset",i=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),e.isWindow(this.$scrollElement[0])||(n="position",i=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=e(this),r=t.data("target")||t.attr("href"),o=/^#./.test(r)&&e(r);return o&&o.length&&o.is(":visible")&&[[o[n]().top+i,r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,n=this.getScrollHeight(),i=this.options.offset+n-this.$scrollElement.height(),r=this.offsets,o=this.targets,a=this.activeTarget;if(this.scrollHeight!=n&&this.refresh(),t>=i)return a!=(e=o[o.length-1])&&this.activate(e);if(a&&t<r[0])return this.activeTarget=null,this.clear();for(e=r.length;e--;)a!=o[e]&&t>=r[e]&&(void 0===r[e+1]||t<r[e+1])&&this.activate(o[e])},t.prototype.activate=function(t){this.activeTarget=t,this.clear();var n=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=e(n).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},t.prototype.clear=function(){e(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var i=e.fn.scrollspy;e.fn.scrollspy=n,e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=i,this},e(window).on("load.bs.scrollspy.data-api",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);n.call(t,t.data())})})}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.tab");r||i.data("bs.tab",r=new n(this)),"string"==typeof t&&r[t]()})}var n=function(t){this.element=e(t)};n.VERSION="3.3.7",n.TRANSITION_DURATION=150,n.prototype.show=function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=n.find(".active:last a"),o=e.Event("hide.bs.tab",{relatedTarget:t[0]}),a=e.Event("show.bs.tab",{relatedTarget:r[0]});if(r.trigger(o),t.trigger(a),!a.isDefaultPrevented()&&!o.isDefaultPrevented()){var s=e(i);this.activate(t.closest("li"),n),this.activate(s,s.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})})}}},n.prototype.activate=function(t,i,r){function o(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),r&&r()}var a=i.find("> .active"),s=r&&e.support.transition&&(a.length&&a.hasClass("fade")||!!i.find("> .fade").length);a.length&&s?a.one("bsTransitionEnd",o).emulateTransitionEnd(n.TRANSITION_DURATION):o(),a.removeClass("in")};var i=e.fn.tab;e.fn.tab=t,e.fn.tab.Constructor=n,e.fn.tab.noConflict=function(){return e.fn.tab=i,this};var r=function(n){n.preventDefault(),t.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',r).on("click.bs.tab.data-api",'[data-toggle="pill"]',r)}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.affix"),o="object"==typeof t&&t;r||i.data("bs.affix",r=new n(this,o)),"string"==typeof t&&r[t]()})}var n=function(t,i){this.options=e.extend({},n.DEFAULTS,i),this.$target=e(this.options.target).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};n.VERSION="3.3.7",n.RESET="affix affix-top affix-bottom",n.DEFAULTS={offset:0,target:window},n.prototype.getState=function(e,t,n,i){var r=this.$target.scrollTop(),o=this.$element.offset(),a=this.$target.height();if(null!=n&&"top"==this.affixed)return r<n&&"top";if("bottom"==this.affixed)return null!=n?!(r+this.unpin<=o.top)&&"bottom":!(r+a<=e-i)&&"bottom";var s=null==this.affixed,l=s?r:o.top,c=s?a:t;return null!=n&&r<=n?"top":null!=i&&l+c>=e-i&&"bottom"},n.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(n.RESET).addClass("affix");var e=this.$target.scrollTop(),t=this.$element.offset();return this.pinnedOffset=t.top-e},n.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},n.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),i=this.options.offset,r=i.top,o=i.bottom,a=Math.max(e(document).height(),e(document.body).height());"object"!=typeof i&&(o=r=i),"function"==typeof r&&(r=i.top(this.$element)),"function"==typeof o&&(o=i.bottom(this.$element));var s=this.getState(a,t,r,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var l="affix"+(s?"-"+s:""),c=e.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(n.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:a-t-o})}};var i=e.fn.affix;e.fn.affix=t,e.fn.affix.Constructor=n,e.fn.affix.noConflict=function(){return e.fn.affix=i,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var n=e(this),i=n.data();i.offset=i.offset||{},null!=i.offsetBottom&&(i.offset.bottom=i.offsetBottom),null!=i.offsetTop&&(i.offset.top=i.offsetTop),t.call(n,i)})})}(jQuery),define("bootstrap",["jquery"],function(){}),new function(e){var t=e.separator||"&",n=!1!==e.spaces,i=!1!==e.prefix,r=i?!0===e.hash?"#":"?":"",o=!1!==e.numbers;jQuery.query=new function(){var e=function(e,t){return void 0!=e&&null!==e&&(!t||e.constructor==t)},i=function(e){for(var t,n=/\[([^[]*)\]/g,i=/^([^[]+)(\[.*\])?$/.exec(e),r=i[1],o=[];t=n.exec(i[2]);)o.push(t[1]);return[r,o]},a=function(t,n,i){var r=n.shift();if("object"!=typeof t&&(t=null),""===r)if(t||(t=[]),e(t,Array))t.push(0==n.length?i:a(null,n.slice(0),i));else if(e(t,Object)){for(var o=0;null!=t[o++];);t[--o]=0==n.length?i:a(t[o],n.slice(0),i)}else t=[],t.push(0==n.length?i:a(null,n.slice(0),i));else if(r&&r.match(/^\s*[0-9]+\s*$/)){var s=parseInt(r,10);t||(t=[]),t[s]=0==n.length?i:a(t[s],n.slice(0),i)}else{if(!r)return i;var s=r.replace(/^\s*|\s*$/g,"");if(t||(t={}),e(t,Array)){for(var l={},o=0;o<t.length;++o)l[o]=t[o];t=l}t[s]=0==n.length?i:a(t[s],n.slice(0),i)}return t},s=function(e){var t=this;return t.keys={},e.queryObject?jQuery.each(e.get(),function(e,n){t.SET(e,n)}):t.parseNew.apply(t,arguments),t};return s.prototype={queryObject:!0,parseNew:function(){var e=this;return e.keys={},jQuery.each(arguments,function(){var t=""+this;t=t.replace(/^[?#]/,""),t=t.replace(/[;&]$/,""),n&&(t=t.replace(/[+]/g," ")),jQuery.each(t.split(/[&;]/),function(){var t=decodeURIComponent(this.split("=")[0]||""),n=decodeURIComponent(this.split("=")[1]||"");t&&(o&&(/^[+-]?[0-9]+\.[0-9]*$/.test(n)?n=parseFloat(n):/^[+-]?[1-9][0-9]*$/.test(n)&&(n=parseInt(n,10))),n=!n&&0!==n||n,e.SET(t,n))})}),e},has:function(t,n){var i=this.get(t);return e(i,n)},GET:function(t){if(!e(t))return this.keys;for(var n=i(t),r=n[0],o=n[1],a=this.keys[r];null!=a&&0!=o.length;)a=a[o.shift()];return"number"==typeof a?a:a||""},get:function(t){var n=this.GET(t);return e(n,Object)?jQuery.extend(!0,{},n):e(n,Array)?n.slice(0):n},SET:function(t,n){var r=e(n)?n:null,o=i(t),s=o[0],l=o[1],c=this.keys[s];return this.keys[s]=a(c,l.slice(0),r),this},set:function(e,t){return this.copy().SET(e,t)},REMOVE:function(t,n){if(n){var i=this.GET(t);if(e(i,Array)){for(tval in i)i[tval]=i[tval].toString();var r=$.inArray(n,i);if(!(r>=0))return;t=i.splice(r,1),t=t[r]}else if(n!=i)return}return this.SET(t,null).COMPACT()},remove:function(e,t){return this.copy().REMOVE(e,t)},EMPTY:function(){var e=this;return jQuery.each(e.keys,function(t,n){delete e.keys[t]}),e},load:function(e){var t=e.replace(/^.*?[#](.+?)(?:\?.+)?$/,"$1"),n=e.replace(/^.*?[?](.+?)(?:#.+)?$/,"$1");return new s(e.length==n.length?"":n,e.length==t.length?"":t)},empty:function(){return this.copy().EMPTY()},copy:function(){return new s(this)},COMPACT:function(){function t(n){function i(t,n,i){e(t,Array)?t.push(i):t[n]=i}var r="object"==typeof n?e(n,Array)?[]:{}:n;return"object"==typeof n&&jQuery.each(n,function(n,o){if(!e(o))return!0;i(r,n,t(o))}),r}return this.keys=t(this.keys),this},compact:function(){return this.copy().COMPACT()},toString:function(){var i=[],o=[],a=function(e){return e+="",e=encodeURIComponent(e),n&&(e=e.replace(/%20/g,"+")),e},s=function(t,n,i){if(e(i)&&!1!==i){var r=[a(n)];!0!==i&&(r.push("="),r.push(a(i))),t.push(r.join(""))}},l=function(e,t){var n=function(e){return t&&""!=t?[t,"[",e,"]"].join(""):[e].join("")};jQuery.each(e,function(e,t){"object"==typeof t?l(t,n(e)):s(o,n(e),t)})};return l(this.keys),o.length>0&&i.push(r),i.push(o.join(t)),i.join("")}},new s(location.search,location.hash)}}(jQuery.query||{}),define("jquery.query",function(){}),define("pgui.page_settings",["class","underscore","bootstrap","jquery.query"],function(e,t){var n=e.extend({init:function(e){this.container=e,this._initializeElements(),this._initializeParameters(),this._initializeEvents(),this._selectDefaults()},_initializeElements:function(){this.$Dialog=this.container.find(".js-page-settings-dialog"),this.$PageSizeContainer=this.container.find(".js-page-settings-page-size-container"),this.$PageSizeControl=this.container.find(".js-page-settings-page-size-control"),this.$PageSizeCustomContainer=this.container.find(".js-page-settings-custom-page-size-container"),this.$PageSizeCustomControl=this.container.find(".js-page-settings-custom-page-size-control"),this.$PageSizeCustomCounter=this.container.find(".js-page-settings-custom-page-size-pager"),this.$PageSizeSave=this.container.find(".js-page-settings-save"),this.$PageSizeCancel=this.container.find(".js-page-settings-cancel"),this.$ViewModeControl=this.container.find(".js-page-settings-viewmode-control"),this.$CardColumnCount=this.container.find(".js-page-settings-card-column-count")},_initializeParameters:function(){this.totalRecordCount=this.$Dialog.data("total-record-count"),this.defaultRecordCountPerPage=parseInt(this.$Dialog.data("record-count-per-page")),this.pageSizeIsCustom=!1,this.initValues={viewMode:this.$ViewModeControl.val(),cardsCount:this._getCardCountValues(),recordPerPage:this.defaultRecordCountPerPage}},_getCardCountValues:function(){return t.reduce(this.$CardColumnCount.toArray(),function(e,t){var n=$(t);return e[n.data("size")]=n.val(),e},{})},_initializeEvents:function(){var e=this;this.$PageSizeControl.on("change",function(){"custom"==$(this).val()&&e._selectCustomPageSize()}),this.$PageSizeCustomControl.on("keyup, change",function(){e._calcCustomCountPage($(this).val())}),this.$PageSizeSave.on("click",function(){e._applyPageSettings()}),this.$ViewModeControl.on("change",function(){e._changeModeHandler()}),this.$PageSizeCancel.on("click",function(){e.$ViewModeControl.val(e.initValues.viewMode),e.$CardColumnCount.each(function(t,n){var i=$(n);i.val(e.initValues.cardsCount[i.data("size")])}),e._selectDefaults()})},_pageSizeValues:[],_getPageSizeValues:function(){if(0==this._pageSizeValues.length){var e=[];this.$PageSizeControl.find("option").each(function(){e.push(parseInt($(this).val()))}),this._pageSizeValues=e}return this._pageSizeValues},_selectDefaults:function(){if(this._changeModeHandler(),this._isPageSizeVariable()){-1===this._getPageSizeValues().indexOf(this.defaultRecordCountPerPage)?(this._selectCustomPageSize(),this._calcCustomCountPage(this.defaultRecordCountPerPage)):(this._selectPredefinedPageSize(),this.$PageSizeControl.val(this.defaultRecordCountPerPage))}},_isPageSizeVariable:function(){return this.$PageSizeCustomControl.length>0&&this.$PageSizeControl.length>0},_getPageCountForPageSize:function(e,t){return e>0?Math.floor(t/e)+(Math.floor(t/e)==t/e?0:1):1},_calcCustomCountPage:function(e){this.$PageSizeCustomCounter.text(this._getPageCountForPageSize(e,this.totalRecordCount))},_selectCustomPageSize:function(){this.$PageSizeContainer.hide(),this.$PageSizeCustomContainer.show(),this.pageSizeIsCustom=!0,this.$PageSizeCustomControl.val(this.defaultRecordCountPerPage),this._calcCustomCountPage(this.defaultRecordCountPerPage)},_selectPredefinedPageSize:function(){this.$PageSizeContainer.show(),this.$PageSizeCustomContainer.hide(),this.pageSizeIsCustom=!1},_changeModeHandler:function(){var e=this.$ViewModeControl.find("option:selected").data("name");this.$CardColumnCount.prop("disabled","CardViewMode"!=e)},_applyPageSettings:function(){var e=this,t=jQuery.query;t=t.set("viewmode",e.$ViewModeControl.val()),t=t.set("cardcountinrow",e._getCardCountValues()),e._isPageSizeVariable()&&(t=t.set("recperpage",e.pageSizeIsCustom?e.$PageSizeCustomControl.val():e.$PageSizeControl.val())),window.location=t}});return function(e){new n(e)}}),define("pgui.filter_common",["class","underscore"],function(e,t){var n=e.extend({init:function(e){this.operator=e,this.enabled=!0},isEnabled:function(){return this.enabled},setEnabled:function(e){return this.enabled=e,this},getOperator:function(){return this.operator},setOperator:function(e){return this.operator=e,this},isGroup:function(){return!1},isCondition:function(){return!1}}),i=n.extend({init:function(e,t){this._super(e||l.OPERATOR_AND),this.children=t||{}},setChildren:function(e){return this.children=e,this},addChild:function(e,t){return t=t||Date.now(),this.children[t]=e,this},removeChild:function(e){var n=t.findKey(this.children,function(t){return t===e});return t.isUndefined(n)?t.each(this.children,function(t){t.removeChild(e)}):delete this.children[n],this},getChildren:function(){return this.children},getChild:function(e){return this.children[e]},deserialize:function(e,n){return this.setOperator(n.operator).setEnabled(n.isEnabled).setChildren(t.mapObject(n.children,t.bind(function(t){return(t.type===a.GROUP?new this.constructor:this.createCondition()).deserialize(e,t)},this)))},serialize:function(){return{type:a.GROUP,isEnabled:this.isEnabled(),operator:this.getOperator(),
children:t.mapObject(this.children,function(e){return e.serialize()})}},isEmpty:function(){return!t.find(this.children,function(e){return!e.isEmpty()})},createCondition:function(){return new r},isGroup:function(){return!0}}),r=n.extend({init:function(e,n,i){this._super(n||e?t.first(e.getOperators()):s.EQUALS),this.column=e,this.values=i||[],this.displayValues=t.clone(this.values)},getColumnName:function(){return this.column.getName()},setColumn:function(e){return this.column=e,this.values=[],this.displayValues=[],this.setOperator(t.first(e.getOperators())),this},getValues:function(){return this.values},getValueAt:function(e){return void 0===this.values[e]?null:this.values[e]},setValues:function(e){return this.values=e,this},setValueAt:function(e,t){return this.values[e]=t,this},setDisplayValues:function(e){return this.displayValues=e,this},setDisplayValueAt:function(e,t){return this.displayValues[e]=t,this},getDisplayValues:function(e){return this.displayValues},getDisplayValueAt:function(e){return void 0===this.displayValues[e]?null:this.displayValues[e]},serialize:function(){return{type:a.CONDITION,isEnabled:this.isEnabled(),column:this.column.getName(),operator:this.getOperator(),values:this.getValues(),displayValues:this.getDisplayValues()}},deserialize:function(e,n){return this.setColumn(t.find(e,function(e){return e.getName()===n.column})).setOperator(n.operator).setValues(n.values).setDisplayValues(n.displayValues).setEnabled(n.isEnabled)},isEmpty:function(){return!1},removeChild:function(){},isCondition:function(){return!0}}),o=e.extend({init:function(e,t,n){this.name=e,this.caption=t,this.operators=n},getName:function(){return this.name},getCaption:function(){return this.caption},getOperators:function(){return this.operators}}),a={GROUP:"group",CONDITION:"condition"},s={EQUALS:"Equals",DOES_NOT_EQUAL:"DoesNotEqual",IS_GREATER_THAN:"IsGreaterThan",IS_GREATER_THAN_OR_EQUAL_TO:"IsGreaterThanOrEqualTo",IS_LESS_THAN:"IsLessThan",IS_LESS_THAN_OR_EQUAL_TO:"IsLessThanOrEqualTo",IS_BETWEEN:"IsBetween",IS_NOT_BETWEEN:"IsNotBetween",CONTAINS:"Contains",DOES_NOT_CONTAIN:"DoesNotContain",BEGINS_WITH:"BeginsWith",ENDS_WITH:"EndsWith",IS_LIKE:"IsLike",IS_NOT_LIKE:"IsNotLike",IS_BLANK:"IsBlank",IS_NOT_BLANK:"IsNotBlank",DATE_EQUALS:"DateEquals",DATE_DOES_NOT_EQUAL:"DateDoesNotEqual",YEAR_EQUALS:"YearEquals",YEAR_DOES_NOT_EQUAL:"YearDoesNotEqual",MONTH_EQUALS:"MonthEquals",MONTH_DOES_NOT_EQUAL:"MonthDoesNotEqual",IN:"In",NOT_IN:"NotIn",TODAY:"Today",THIS_MONTH:"ThisMonth",PREV_MONTH:"PrevMonth",THIS_YEAR:"ThisYear",PREV_YEAR:"PrevYear"},l={OPERATOR_AND:"AND",OPERATOR_OR:"OR",OPERATOR_NONE:"NONE"};return{Column:o,Group:i,Condition:r,ComponentType:a,ConditionOperator:s,GroupOperator:l}}),define("microevent",["require","exports","module"],function(e,t,n){var i=function(){};i.prototype={bind:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},once:function(e,t){this._onceEvents=this._onceEvents||{},this._onceEvents[e]=this._onceEvents[e]||[],this._onceEvents[e].push(t)},unbind:function(e,t){this._events=this._events||{},e in this._events!=!1&&this._events[e].splice(this._events[e].indexOf(t),1)},trigger:function(e){this._events=this._events||{},this._onceEvents=this._onceEvents||{};var t;if(e in this._events!=!1)for(t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1));if(e in this._onceEvents!=!1){for(t=0;t<this._onceEvents[e].length;t++)this._onceEvents[e][t].apply(this,Array.prototype.slice.call(arguments,1));this._onceEvents[e].splice(0,this._onceEvents[e].length)}}},i.mixin=function(e){for(var t=["bind","unbind","trigger","once"],n=0;n<t.length;n++)e.prototype[t[n]]=i.prototype[t[n]];return e},void 0!==n&&"exports"in n&&(n.exports=i)}),define("pgui.events",["class","microevent"],function(e,t){var n=e.extend({init:function(e){this.$input=e},onChange:function(e){this.bind("changed",e)},changed:function(){this.trigger("changed")}});return{InputEvents:t.mixin(n),setupInputEvents:function(e){e.data("pg-events",new n(e))}}}),define("pgui.editors/custom",["class","microevent","underscore"],function(e,t,n){return t.mixin(e.extend({init:function(e,t){this.rootElement=e,this.fieldName=this.rootElement.attr("data-field-name");var i=e.data("editor-visible");n.isUndefined(i)||this.setVisible(i),n.isFunction(t)&&t(this)},doChanged:function(){this.trigger("onChangeEvent",this,0)},getValue:function(){return null},getValueEx:function(){return this.getValue()},setValue:function(e){return this},setValueEx:function(e){this.setValue(e)},getDisplayValue:function(){return this.getValue()},getData:function(){return this.getValue()},setData:function(e){return this.setValue(e),this},onChange:function(e){return this.bind("onChangeEvent",e),this},getRootElement:function(){return this.rootElement},getFieldName:function(){return this.fieldName},isReadOnly:function(){return this.readonly()},getVisible:function(){return this.rootElement.closest(".form-group").is(":visible")},setVisible:function(e){return this.rootElement.closest(".form-group").toggle(e).prev(".form-group-label").toggle(e),this._getLabelGroup().toggle(e),this},visible:function(e){if(0!==this.rootElement.closest(".form-group").length)return n.isUndefined(e)?this.getVisible():void this.setVisible(e)},enabled:function(e){if(n.isUndefined(e))return this.getEnabled();this.getEnabled()!=e&&this.setEnabled(e)},getEnabled:function(){return!0},setEnabled:function(e){return this},readonly:function(e){if(n.isUndefined(e))return this.getReadonly();this.getReadonly()!=e&&this.setReadonly(e)},getReadonly:function(){return!1},setReadonly:function(e){return this},setValidationErrorMessage:function(e,t){var n=this.rootElement.closest("form").data("validator");if(!n)return this;var i=this.rootElement.closest(".col-input").find("input,select,textarea").first().attr("name");return i&&n.settings.messages[i]&&(n.settings.messages[i][e]=t,"required"===e&&(n.settings.messages[i].required_custom=t)),this},getState:function(){var e=this.rootElement.closest(".form-group"),t=["warning","error","success"];for(var n in t)if(e.hasClass("has-"+t[n]))return t[n];return"normal"},setState:function(e){if(-1!==["normal","warning","error","info","success"].indexOf(e)){var t="has-warning has-error has-success",n=this._getLabelGroup().removeClass(t),i=this.rootElement.closest(".form-group").removeClass(t);return"normal"===e?this:(n.addClass("has-"+e),i.addClass("has-"+e),this)}},setHint:function(e){var t=this.rootElement.closest(".form-group"),n=t.find(".help-block");return e?(0===n.length?t.append($("<p>").addClass("help-block").html(e)):n.html(e),this):(n.remove(),this)},isMultivalue:function(){return!1},destroy:function(){},setRequired:function(e){this._getLabelGroup().find("span.required-mark").toggle(Boolean(e));var t=e?"add":"remove",n=this._getSetRequiredTarget();return n.rules(t,"required_custom"),n.rules(t,"required"),this},getRequired:function(){return this._getLabelGroup().find("span.required-mark").is(":visible")},_getSetRequiredTarget:function(){return this.getRootElement()},_getLabelGroup:function(){return $(".control-label[for="+this._getId()+"]").closest(".form-group")},_getId:function(){return this.rootElement.attr("id")}}))}),define("pgui.editors/select2_format",["class"],function(Class){return Class.extend({init:function(){this._formatCallbacks=[]},setCallback:function(e,t,n){if("function"!=typeof t)return void console.error("select2: callback argument must be a valid function");n=n||0,this._formatCallbacks[n]||(this._formatCallbacks[n]={}),this._formatCallbacks[n][e]=t},setFormatCallbacksFromElement:function(e,t){t=t||0;var n=this._evalFormatFunction(e.data("format-result")),i=this._evalFormatFunction(e.data("format-selection"));n&&this.setCallback("result",n,t),i&&this.setCallback("selection",i,t)},getFormatClojure:function(e,t){var n=this;return t=t||0,function(i){return n._hasFormatCallback(e,t)?n._formatCallbacks[t][e](i):i.text}},_hasFormatCallback:function(e,t){return!!this._formatCallbacks[t]&&!!this._formatCallbacks[t][e]},_evalFormatFunction:function(expr){if(!expr)return null;var result=void 0;return eval("var result = function (item) { "+expr+" };"),result}})}),function(e){function t(){var e=arguments[0],n=t.cache;return n[e]&&n.hasOwnProperty(e)||(n[e]=t.parse(e)),t.format.call(null,n[e],arguments)}function n(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function i(e,t){return Array(t+1).join(e)}var r={not_string:/[^s]/,number:/[dief]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};t.format=function(e,o){var a,s,l,c,u,d,h,f=1,p=e.length,m="",g=[],v=!0,b="";for(s=0;s<p;s++)if("string"===(m=n(e[s])))g[g.length]=e[s];else if("array"===m){if(c=e[s],c[2])for(a=o[f],l=0;l<c[2].length;l++){if(!a.hasOwnProperty(c[2][l]))throw new Error(t("[sprintf] property '%s' does not exist",c[2][l]));a=a[c[2][l]]}else a=c[1]?o[c[1]]:o[f++];if("function"==n(a)&&(a=a()),r.not_string.test(c[8])&&r.not_json.test(c[8])&&"number"!=n(a)&&isNaN(a))throw new TypeError(t("[sprintf] expecting number but found %s",n(a)));switch(r.number.test(c[8])&&(v=a>=0),c[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,c[6]?parseInt(c[6]):0);break;case"e":a=c[7]?a.toExponential(c[7]):a.toExponential();break;case"f":a=c[7]?parseFloat(a).toFixed(c[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&c[7]?a.substring(0,c[7]):a;break;case"u":a>>>=0;break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}r.json.test(c[8])?g[g.length]=a:(!r.number.test(c[8])||v&&!c[3]?b="":(b=v?"+":"-",a=a.toString().replace(r.sign,"")),d=c[4]?"0"===c[4]?"0":c[4].charAt(1):" ",h=c[6]-(b+a).length,u=c[6]&&h>0?i(d,h):"",g[g.length]=c[5]?b+a+u:"0"===d?b+u+a:u+b+a)}return g.join("")},t.cache={},t.parse=function(e){for(var t=e,n=[],i=[],o=0;t;){if(null!==(n=r.text.exec(t)))i[i.length]=n[0];else if(null!==(n=r.modulo.exec(t)))i[i.length]="%";else{if(null===(n=r.placeholder.exec(t)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){o|=1;var a=[],s=n[2],l=[];if(null===(l=r.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=r.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=r.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}n[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i[i.length]=n}t=t.substring(n[0].length)}return i};var o=function(e,n,i){return i=(n||[]).slice(0),i.splice(0,0,e),t.apply(null,i)};"undefined"!=typeof exports?(exports.sprintf=t,exports.vsprintf=o):(e.sprintf=t,e.vsprintf=o,"function"==typeof define&&define.amd&&define("libs/sprintf",[],function(){return{sprintf:t,vsprintf:o}}))}("undefined"==typeof window?this:window),function(e){void 0===e.fn.each2&&e.extend(e.fn,{each2:function(t){for(var n=e([0]),i=-1,r=this.length;++i<r&&(n.context=n[0]=this[i])&&!1!==t.call(n[0],i,n););return this}})}(jQuery),function(e,t){"use strict";function n(t){var n=e(document.createTextNode(""));t.before(n),n.before(t),n.remove()}function i(e){function t(e){return z[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function r(e,t){for(var n=0,i=t.length;n<i;n+=1)if(a(e,t[n]))return n;return-1}function o(){var t=e(L);t.appendTo(document.body);var n={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),n}function a(e,n){return e===n||e!==t&&n!==t&&(null!==e&&null!==n&&(e.constructor===String?e+""==n+"":n.constructor===String&&n+""==e+""))}function s(e,t,n){var i,r,o;if(null===e||e.length<1)return[];for(i=e.split(t),r=0,o=i.length;r<o;r+=1)i[r]=n(i[r]);return i}function l(e){return e.outerWidth(!1)-e.width()}function c(n){var i="keyup-change-value";n.on("keydown",function(){e.data(n,i)===t&&e.data(n,i,n.val())}),n.on("keyup",function(){var r=e.data(n,i);r!==t&&n.val()!==r&&(e.removeData(n,i),n.trigger("keyup-change"))})}function u(n){n.on("mousemove",function(n){var i=F;i!==t&&i.x===n.pageX&&i.y===n.pageY||e(n.target).trigger("mousemove-filtered",n)})}function d(e,n,i){i=i||t;var r;return function(){var t=arguments;window.clearTimeout(r),r=window.setTimeout(function(){n.apply(i,t)},e)}}function h(e,t){var n=d(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){r(e.target,t.get())>=0&&n(e)})}function f(e){e[0]!==document.activeElement&&window.setTimeout(function(){var t,n=e[0],i=e.val().length;e.focus(),(n.offsetWidth>0||n.offsetHeight>0)&&n===document.activeElement&&(n.setSelectionRange?n.setSelectionRange(i,i):n.createTextRange&&(t=n.createTextRange(),t.collapse(!1),t.select()))},0)}function p(t){t=e(t)[0];var n=0,i=0;if("selectionStart"in t)n=t.selectionStart,i=t.selectionEnd-n;else if("selection"in document){t.focus();var r=document.selection.createRange();i=document.selection.createRange().text.length,r.moveStart("character",-t.value.length),n=r.text.length-i}return{offset:n,length:i}}function m(e){e.preventDefault(),e.stopPropagation()}function g(e){e.preventDefault(),e.stopImmediatePropagation()}function v(t){if(!I){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);I=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),I.attr("class","select2-sizer"),e(document.body).append(I)}return I.text(t.val()),I.width()}function b(t,n,i){var r,o,a=[];r=e.trim(t.attr("class")),r&&(r=""+r,e(r.split(/\s+/)).each2(function(){0===this.indexOf("select2-")&&a.push(this)})),r=e.trim(n.attr("class")),r&&(r=""+r,e(r.split(/\s+/)).each2(function(){0!==this.indexOf("select2-")&&(o=i(this))&&a.push(o)})),t.attr("class",a.join(" "))}function y(e,t,n,r){var o=i(e.toUpperCase()).indexOf(i(t.toUpperCase())),a=t.length;if(o<0)return void n.push(r(e));n.push(r(e.substring(0,o))),n.push("<span class='select2-match'>"),n.push(r(e.substring(o,o+a))),n.push("</span>"),n.push(r(e.substring(o+a,e.length)))}function w(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function x(n){var i,r=null,o=n.quietMillis||100,a=n.url,s=this;return function(l){window.clearTimeout(i),i=window.setTimeout(function(){var i=n.data,o=a,c=n.transport||e.fn.select2.ajaxDefaults.transport,u={type:n.type||"GET",cache:n.cache||!1,jsonpCallback:n.jsonpCallback||t,dataType:n.dataType||"json"},d=e.extend({},e.fn.select2.ajaxDefaults.params,u);i=i?i.call(s,l.term,l.page,l.context):null,o="function"==typeof o?o.call(s,l.term,l.page,l.context):o,r&&"function"==typeof r.abort&&r.abort(),n.params&&(e.isFunction(n.params)?e.extend(d,n.params.call(s)):e.extend(d,n.params)),e.extend(d,{url:o,dataType:n.dataType,data:i,success:function(e){var t=n.results(e,l.page,l);l.callback(t)},error:function(e,t,n){var i={hasError:!0,jqXHR:e,textStatus:t,errorThrown:n};l.callback(i)}}),r=c.call(s,d)},o)}}function C(t){var n,i,r=t,o=function(e){return""+e.text};e.isArray(r)&&(i=r,r={results:i}),!1===e.isFunction(r)&&(i=r,r=function(){return i});var a=r();return a.text&&(o=a.text,e.isFunction(o)||(n=a.text,o=function(e){return e[n]})),function(t){var n,i=t.term,a={results:[]};if(""===i)return void t.callback(r());n=function(r,a){var s,l;if(r=r[0],r.children){s={};for(l in r)r.hasOwnProperty(l)&&(s[l]=r[l]);s.children=[],e(r.children).each2(function(e,t){n(t,s.children)}),(s.children.length||t.matcher(i,o(s),r))&&a.push(s)}else t.matcher(i,o(r),r)&&a.push(r)},e(r().results).each2(function(e,t){n(t,a.results)}),t.callback(a)}}function k(n){var i=e.isFunction(n);return function(r){var o=r.term,a={results:[]},s=i?n(r):n;e.isArray(s)&&(e(s).each(function(){var e=this.text!==t,n=e?this.text:this;(""===o||r.matcher(o,n))&&a.results.push(e?this:{id:this,text:this})}),r.callback(a))}}function _(t,n){if(e.isFunction(t))return!0;if(!t)return!1;if("string"==typeof t)return!0;throw new Error(n+" must be a string, function, or falsy value")}function S(t,n){if(e.isFunction(t)){var i=Array.prototype.slice.call(arguments,2);return t.apply(n,i)}return t}function E(t){var n=0;return e.each(t,function(e,t){t.children?n+=E(t.children):n++}),n}function T(e,n,i,r){var o,s,l,c,u,d=e,h=!1;if(!r.createSearchChoice||!r.tokenSeparators||r.tokenSeparators.length<1)return t;for(;;){for(s=-1,l=0,c=r.tokenSeparators.length;l<c&&(u=r.tokenSeparators[l],!((s=e.indexOf(u))>=0));l++);if(s<0)break;if(o=e.substring(0,s),e=e.substring(s+u.length),o.length>0&&(o=r.createSearchChoice.call(this,o,n))!==t&&null!==o&&r.id(o)!==t&&null!==r.id(o)){for(h=!1,l=0,c=n.length;l<c;l++)if(a(r.id(o),r.id(n[l]))){h=!0;break}h||i(o)}}return d!==e?e:void 0}function D(){var t=this;e.each(arguments,function(e,n){t[n].remove(),t[n]=null})}function $(t,n){var i=function(){};return i.prototype=new t,i.prototype.constructor=i,i.prototype.parent=t.prototype,i.prototype=e.extend(i.prototype,n),i}if(window.Select2===t){var A,j,P,O,I,M,N,F={x:0,y:0},R={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case R.LEFT:case R.RIGHT:case R.UP:case R.DOWN:return!0}return!1},isControl:function(e){switch(e.which){case R.SHIFT:case R.CTRL:case R.ALT:return!0}return!!e.metaKey},isFunctionKey:function(e){return(e=e.which?e.which:e)>=112&&e<=123}},L="<div class='select2-measure-scrollbar'></div>",z={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};M=e(document),O=function(){var e=1;return function(){return e++}}(),A=$(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var i,r;this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&null!==n.element.data("select2")&&n.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=e(".select2-hidden-accessible"),0==this.liveRegion.length&&(this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body)),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+O()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",n.element.attr("title")),this.body=e(document.body),b(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",n.element.attr("style")),this.container.css(S(n.containerCss,this.opts.element)),this.container.addClass(S(n.containerCssClass,this.opts.element)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",m),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),b(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(S(n.dropdownCssClass,this.opts.element)),this.dropdown.data("select2",this),this.dropdown.on("click",m),this.results=i=this.container.find(".select2-results"),this.search=r=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",m),u(this.results),this.dropdown.on("mousemove-filtered",".select2-results",this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",".select2-results",this.bind(function(e){this._touchEvent=!0,this.highlightUnderEvent(e)})),this.dropdown.on("touchmove",".select2-results",this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",".select2-results",this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(e){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),h(80,this.results),this.dropdown.on("scroll-debounced",".select2-results",this.bind(this.loadMoreIfNeeded)),e(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),e(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),e.fn.mousewheel&&i.mousewheel(function(e,t,n,r){var o=i.scrollTop();r>0&&o-r<=0?(i.scrollTop(0),m(e)):r<0&&i.get(0).scrollHeight-i.scrollTop()+r<=i.height()&&(i.scrollTop(i.get(0).scrollHeight-i.height()),m(e))}),c(r),r.on("keyup-change input paste",this.bind(this.updateResults)),r.on("focus",function(){r.addClass("select2-focused")}),r.on("blur",function(){r.removeClass("select2-focused")}),this.dropdown.on("mouseup",".select2-results",this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.nextSearchTerm=t,e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==n.maximumInputLength&&this.search.attr("maxlength",n.maximumInputLength);var a=n.element.prop("disabled");a===t&&(a=!1),this.enable(!a);var s=n.element.prop("readonly");s===t&&(s=!1),this.readonly(s),N=N||o(),this.autofocus=n.element.prop("autofocus"),n.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",n.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,n=e.data("select2"),i=this;this.close(),e.length&&e[0].detachEvent&&i._sync&&e.each(function(){i._sync&&this.detachEvent("onpropertychange",i._sync)}),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),this._sync=null,n!==t&&(n.container.remove(),n.liveRegion.remove(),n.dropdown.remove(),e.show().removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show()),D.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:a(e.attr("locked"),"locked")||a(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(n){var i,r,o,l,c=this;if(i=n.element,"select"===i.get(0).tagName.toLowerCase()&&(this.select=r=n.element),r&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(i,r,o){var a,s=this.opts.id,l=this.liveRegion;(a=function(i,r,u){var d,h,f,p,m,g,v,b,y,w;i=n.sortResults(i,r,o);var x=[];for(d=0,h=i.length;d<h;d+=1)f=i[d],m=!0===f.disabled,p=!m&&s(f)!==t,g=f.children&&f.children.length>0,v=e("<li></li>"),v.addClass("select2-results-dept-"+u),v.addClass("select2-result"),v.addClass(p?"select2-result-selectable":"select2-result-unselectable"),m&&v.addClass("select2-disabled"),g&&v.addClass("select2-result-with-children"),v.addClass(c.opts.formatResultCssClass(f)),v.attr("role","presentation"),b=e(document.createElement("div")),b.addClass("select2-result-label"),b.attr("id","select2-result-label-"+O()),b.attr("role","option"),w=n.formatResult(f,b,o,c.opts.escapeMarkup),w!==t&&(b.html(w),v.append(b)),g&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),a(f.children,y,u+1),v.append(y)),v.data("select2-data",f),x.push(v[0]);r.append(x),l.text(n.formatMatches(i.length))})(r,i,0)}},e.fn.select2.defaults,n),"function"!=typeof n.id&&(o=n.id,n.id=function(e){return e[o]}),e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.data("select2Tags")}if(r?(n.query=this.bind(function(e){var n,r,o,a={results:[],more:!1},s=e.term;o=function(t,n){var i;t.is("option")?e.matcher(s,t.text(),t)&&n.push(c.optionToData(t)):t.is("optgroup")&&(i=c.optionToData(t),t.children().each2(function(e,t){o(t,i.children)}),i.children.length>0&&n.push(i))},n=i.children(),this.getPlaceholder()!==t&&n.length>0&&(r=this.getPlaceholderOption())&&(n=n.not(r)),n.each2(function(e,t){o(t,a.results)}),e.callback(a)}),n.id=function(e){return e.id}):"query"in n||("ajax"in n?(l=n.element.data("ajax-url"),l&&l.length>0&&(n.ajax.url=l),n.query=x.call(n.element,n.ajax)):"data"in n?n.query=C(n.data):"tags"in n&&(n.query=k(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(t){return{id:e.trim(t),text:e.trim(t)}}),n.initSelection===t&&(n.initSelection=function(t,i){var r=[];e(s(t.val(),n.separator,n.transformVal)).each(function(){var t={id:this,text:this},i=n.tags;e.isFunction(i)&&(i=i()),e(i).each(function(){if(a(this.id,t.id))return t=this,!1}),
r.push(t)}),i(r)}))),"function"!=typeof n.query)throw"query function not defined for Select2 "+n.element.attr("id");if("top"===n.createSearchChoicePosition)n.createSearchChoicePosition=function(e,t){e.unshift(t)};else if("bottom"===n.createSearchChoicePosition)n.createSearchChoicePosition=function(e,t){e.push(t)};else if("function"!=typeof n.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return n},monitorSource:function(){var n,i=this.opts.element,r=this;i.on("change.select2",this.bind(function(e){!0!==this.opts.element.data("select2-change-triggered")&&this.initSelection()})),this._sync=this.bind(function(){var e=i.prop("disabled");e===t&&(e=!1),this.enable(!e);var n=i.prop("readonly");n===t&&(n=!1),this.readonly(n),this.container&&(b(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(S(this.opts.containerCssClass,this.opts.element))),this.dropdown&&(b(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(S(this.opts.dropdownCssClass,this.opts.element)))}),i.length&&i[0].attachEvent&&i.each(function(){this.attachEvent("onpropertychange",r._sync)}),(n=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)!==t&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new n(function(t){e.each(t,r._sync)}),this.propertyObserver.observe(i.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var n=e.Event("select2-selecting",{val:this.id(t),object:t,choice:t});return this.opts.element.trigger(n),!n.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return!0===this.enabledInterface},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e!==this.enabledInterface&&(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===t&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(e){e===t&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface())},opened:function(){return!!this.container&&this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,n,i,r,o,a=this.dropdown,s=this.container,l=s.offset(),c=s.outerHeight(!1),u=s.outerWidth(!1),d=a.outerHeight(!1),h=e(window),f=h.width(),p=h.height(),m=h.scrollLeft()+f,g=h.scrollTop()+p,v=l.top+c,b=l.left,y=v+d<=g,w=l.top-d>=h.scrollTop(),x=a.outerWidth(!1),C=a.hasClass("select2-drop-above");C?(n=!0,!w&&y&&(i=!0,n=!1)):(n=!1,!y&&w&&(i=!0,n=!0)),i&&(a.hide(),l=this.container.offset(),c=this.container.outerHeight(!1),u=this.container.outerWidth(!1),d=a.outerHeight(!1),m=h.scrollLeft()+f,g=h.scrollTop()+p,v=l.top+c,b=l.left,x=a.outerWidth(!1),a.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(o=e(".select2-results",a)[0],a.addClass("select2-drop-auto-width"),a.css("width",""),x=a.outerWidth(!1)+(o.scrollHeight===o.clientHeight?0:N.width),x>u?u=x:x=u,d=a.outerHeight(!1)):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(t=this.body.offset(),v-=t.top,b-=t.left),!function(){return b+x<=m}()&&function(){return l.left+m+s.outerWidth(!1)>x}()&&(b=l.left+this.container.outerWidth(!1)-x),r={left:b,width:u},n?(r.top=l.top-d,r.bottom="auto",this.container.addClass("select2-drop-above"),a.addClass("select2-drop-above")):(r.top=v,r.bottom="auto",this.container.removeClass("select2-drop-above"),a.removeClass("select2-drop-above")),r=e.extend(r,S(this.opts.dropdownCss,this.opts.element)),a.css(r)},shouldOpen:function(){var t;return!this.opened()&&(!1!==this._enabled&&!0!==this._readonly&&(t=e.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented()))},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return!!this.shouldOpen()&&(this.opening(),M.on("mousemove.select2Event",function(e){F.x=e.pageX,F.y=e.pageY}),!0)},opening:function(){var t,i=this.containerEventName,r="scroll."+i,o="resize."+i,a="orientationchange."+i;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),t=e("#select2-drop-mask"),0===t.length&&(t=e(document.createElement("div")),t.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),t.hide(),t.appendTo(this.body),t.on("mousedown touchstart click",function(i){n(t);var r,o=e("#select2-drop");o.length>0&&(r=o.data("select2"),r.opts.selectOnBlur&&r.selectHighlighted({noFocus:!0}),r.close(),i.preventDefault(),i.stopPropagation())})),this.dropdown.prev()[0]!==t[0]&&this.dropdown.before(t),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),t.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var s=this;this.container.parents().add(window).each(function(){e(this).on(o+" "+r+" "+a,function(e){s.opened()&&s.positionDropdown()})})},close:function(){if(this.opened()){var t=this.containerEventName,n="scroll."+t,i="resize."+t,r="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).off(n).off(i).off(r)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),M.off("mousemove.select2Event"),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(e.Event("select2-close"))}},externalSearch:function(e){this.open(),this.search.val(e),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return S(this.opts.maximumSelectionSize,this.opts.element)},ensureHighlightVisible:function(){var t,n,i,r,o,a,s,l,c=this.results;if(!((n=this.highlight())<0)){if(0==n)return void c.scrollTop(0);t=this.findHighlightableChoices().find(".select2-result-label"),i=e(t[n]),l=(i.offset()||{}).top||0,r=l+i.outerHeight(!0),n===t.length-1&&(s=c.find("li.select2-more-results"),s.length>0&&(r=s.offset().top+s.outerHeight(!0))),o=c.offset().top+c.outerHeight(!1),r>o&&c.scrollTop(c.scrollTop()+(r-o)),a=l-c.offset().top,a<0&&"none"!=i.css("display")&&c.scrollTop(c.scrollTop()+a)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(t){for(var n=this.findHighlightableChoices(),i=this.highlight();i>-1&&i<n.length;){i+=t;var r=e(n[i]);if(r.hasClass("select2-result-selectable")&&!r.hasClass("select2-disabled")&&!r.hasClass("select2-selected")){this.highlight(i);break}}},highlight:function(t){var n,i,o=this.findHighlightableChoices();if(0===arguments.length)return r(o.filter(".select2-highlighted")[0],o.get());t>=o.length&&(t=o.length-1),t<0&&(t=0),this.removeHighlight(),n=e(o[t]),n.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",n.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(n.text()),(i=n.data("select2-data"))&&this.opts.element.trigger({type:"select2-highlight",val:this.id(i),choice:i})},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var i=this.findHighlightableChoices();this.highlight(i.index(n))}else 0==n.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var e=this.results,t=e.find("li.select2-more-results"),n=this.resultsPage+1,i=this,r=this.search.val(),o=this.context;0!==t.length&&t.offset().top-e.offset().top-e.height()<=this.opts.loadMorePadding&&(t.addClass("select2-active"),this.opts.query({element:this.opts.element,term:r,page:n,context:o,matcher:this.opts.matcher,callback:this.bind(function(a){i.opened()&&(i.opts.populateResults.call(this,e,a.results,{term:r,page:n,context:o}),i.postprocessResults(a,!1,!1),!0===a.more?(t.detach().appendTo(e).html(i.opts.escapeMarkup(S(i.opts.formatLoadMore,i.opts.element,n+1))),window.setTimeout(function(){i.loadMoreIfNeeded()},10)):t.remove(),i.positionDropdown(),i.resultsPage=n,i.context=a.context,this.opts.element.trigger({type:"select2-loaded",items:a}))})}))},tokenize:function(){},updateResults:function(n){function i(){c.removeClass("select2-active"),h.positionDropdown(),u.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?h.liveRegion.text(u.text()):h.liveRegion.text(h.opts.formatMatches(u.find('.select2-result-selectable:not(".select2-selected")').length))}function r(e){u.html(e),i()}var o,s,l,c=this.search,u=this.results,d=this.opts,h=this,f=c.val(),p=e.data(this.container,"select2-last-term");if((!0===n||!p||!a(f,p))&&(e.data(this.container,"select2-last-term",f),!0===n||!1!==this.showSearchInput&&this.opened())){l=++this.queryCount;var m=this.getMaximumSelectionSize();if(m>=1&&(o=this.data(),e.isArray(o)&&o.length>=m&&_(d.formatSelectionTooBig,"formatSelectionTooBig")))return void r("<li class='select2-selection-limit'>"+S(d.formatSelectionTooBig,d.element,m)+"</li>");if(c.val().length<d.minimumInputLength)return r(_(d.formatInputTooShort,"formatInputTooShort")?"<li class='select2-no-results'>"+S(d.formatInputTooShort,d.element,c.val(),d.minimumInputLength)+"</li>":""),void(n&&this.showSearch&&this.showSearch(!0));if(d.maximumInputLength&&c.val().length>d.maximumInputLength)return void r(_(d.formatInputTooLong,"formatInputTooLong")?"<li class='select2-no-results'>"+S(d.formatInputTooLong,d.element,c.val(),d.maximumInputLength)+"</li>":"");d.formatSearching&&0===this.findHighlightableChoices().length&&r("<li class='select2-searching'>"+S(d.formatSearching,d.element)+"</li>"),c.addClass("select2-active"),this.removeHighlight(),s=this.tokenize(),s!=t&&null!=s&&c.val(s),this.resultsPage=1,d.query({element:d.element,term:c.val(),page:this.resultsPage,context:null,matcher:d.matcher,callback:this.bind(function(o){var s;if(l==this.queryCount){if(!this.opened())return void this.search.removeClass("select2-active");if(o.hasError!==t&&_(d.formatAjaxError,"formatAjaxError"))return void r("<li class='select2-ajax-error'>"+S(d.formatAjaxError,d.element,o.jqXHR,o.textStatus,o.errorThrown)+"</li>");if(this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&""!==c.val()&&(s=this.opts.createSearchChoice.call(h,c.val(),o.results))!==t&&null!==s&&h.id(s)!==t&&null!==h.id(s)&&0===e(o.results).filter(function(){return a(h.id(this),h.id(s))}).length&&this.opts.createSearchChoicePosition(o.results,s),0===o.results.length&&_(d.formatNoMatches,"formatNoMatches"))return void r("<li class='select2-no-results'>"+S(d.formatNoMatches,d.element,c.val())+"</li>");u.empty(),h.opts.populateResults.call(this,u,o.results,{term:c.val(),page:this.resultsPage,context:null}),!0===o.more&&_(d.formatLoadMore,"formatLoadMore")&&(u.append("<li class='select2-more-results'>"+d.escapeMarkup(S(d.formatLoadMore,d.element,this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),i(),this.opts.element.trigger({type:"select2-loaded",items:o})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){f(this.search)},selectHighlighted:function(e){if(this._touchMoved)return void this.clearTouchMoved();var t=this.highlight(),n=this.results.find(".select2-highlighted"),i=n.closest(".select2-result").data("select2-data");i?(this.highlight(t),this.onSelect(i,e)):e&&e.noFocus&&this.close()},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==t?e.text():t)},getPlaceholderOption:function(){if(this.select){var n=this.select.children("option").first();if(this.opts.placeholderOption!==t)return"first"===this.opts.placeholderOption&&n||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===e.trim(n.text())&&""===n.val())return n}},initContainerWidth:function(){function n(){var n,i,r,o,a,s;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if((n=this.opts.element.attr("style"))!==t)for(i=n.split(";"),o=0,a=i.length;o<a;o+=1)if(s=i[o].replace(/\s/g,""),null!==(r=s.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i))&&r.length>=1)return r[1];return"resolve"===this.opts.width?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var i=n.call(this);null!==i&&this.container.css("width",i)}}),j=$(A,{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>","   <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>","   <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <label for='' class='select2-offscreen'></label>","       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'","       aria-autocomplete='list' />","   </div>","   <ul class='select2-results' role='listbox'>","   </ul>","</div>"].join(""))},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var n,i,r;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),!1!==this.showSearchInput&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),n=this.search.get(0),n.createTextRange?(i=n.createTextRange(),i.collapse(!1),i.select()):n.setSelectionRange&&(r=this.search.val().length,n.setSelectionRange(r,r))),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){e("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),D.call(this,"selection","focusser")},initContainer:function(){var t,i,r=this.container,o=this.dropdown,a=O();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=r.find(".select2-choice"),this.focusser=r.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+a),this.focusser.attr("aria-labelledby","select2-chosen-"+a),this.results.attr("id","select2-results-"+a),this.search.attr("aria-owns","select2-results-"+a),this.focusser.attr("id","s2id_autogen"+a),i=e("label[for='"+this.opts.element.attr("id")+"']"),this.opts.element.focus(this.bind(function(){this.focus()})),this.focusser.prev().text(i.text()).attr("for",this.focusser.attr("id"));var s=this.opts.element.attr("title");this.opts.element.attr("title",s||i.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(e("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&229!=e.keyCode){if(e.which===R.PAGE_UP||e.which===R.PAGE_DOWN)return void m(e);switch(e.which){case R.UP:case R.DOWN:return this.moveHighlight(e.which===R.UP?-1:1),void m(e);case R.ENTER:return this.selectHighlighted(),void m(e);case R.TAB:return void this.selectHighlighted({noFocus:!0});case R.ESC:return this.cancel(e),void m(e)}}})),this.search.on("blur",this.bind(function(e){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==R.TAB&&!R.isControl(e)&&!R.isFunctionKey(e)&&e.which!==R.ESC){if(!1===this.opts.openOnEnter&&e.which===R.ENTER)return void m(e);if(e.which==R.DOWN||e.which==R.UP||e.which==R.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void m(e)}return e.which==R.DELETE||e.which==R.BACKSPACE?(this.opts.allowClear&&this.clear(),void m(e)):void 0}})),c(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),g(e),this.close(),this.selection&&this.selection.focus())})),t.on("mousedown touchstart",this.bind(function(i){n(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),m(i)})),o.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),t.on("focus",this.bind(function(e){m(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.hide(),this.setPlaceholder()},clear:function(t){var n=this.selection.data("select2-data");if(n){var i=e.Event("select2-clearing");if(this.opts.element.trigger(i),i.isDefaultPrevented())return;var r=this.getPlaceholderOption();this.opts.element.val(r?r.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),!1!==t&&(this.opts.element.trigger({type:"select2-removed",val:this.id(n),choice:n}),this.triggerChange({removed:n}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,function(n){n!==t&&null!==n&&(e.updateSelection(n),e.close(),e.setPlaceholder(),e.nextSearchTerm=e.opts.nextSearchTerm(n,e.search.val()))})}},isPlaceholderOptionSelected:function(){var e;return this.getPlaceholder()!==t&&((e=this.getPlaceholderOption())!==t&&e.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===t||null===this.opts.element.val())},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),n=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var i=e.find("option").filter(function(){return this.selected&&!this.disabled});t(n.optionToData(i))}:"data"in t&&(t.initSelection=t.initSelection||function(n,i){var r=n.val(),o=null;t.query({matcher:function(e,n,i){var s=a(r,t.id(i));return s&&(o=i),s},callback:e.isFunction(i)?function(){i(o)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===t?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==t){if(this.select&&this.getPlaceholderOption()===t)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,n){var i=0,r=this;if(this.findHighlightableChoices().each2(function(e,t){if(a(r.id(t.data("select2-data")),r.opts.element.val()))return i=e,!1}),!1!==n&&(!0===t&&i>=0?this.highlight(i):this.highlight(0)),!0===t){var o=this.opts.minimumResultsForSearch;o>=0&&this.showSearch(E(e.results)>=o)}},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(e,t){if(this.triggerSelect(e)){var n=this.opts.element.val(),i=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.close(),t&&t.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),a(n,this.id(e))||this.triggerChange({added:e,removed:i})}},updateSelection:function(e){var n,i,r=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),r.empty(),null!==e&&(n=this.opts.formatSelection(e,r,this.opts.escapeMarkup)),n!==t&&r.append(n),i=this.opts.formatSelectionCssClass(e,r),i!==t&&r.addClass(i),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,n=!1,i=null,r=this,o=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(n=arguments[1]),this.select)this.select.val(e).find("option").filter(function(){return this.selected}).each2(function(e,t){return i=r.optionToData(t),!1}),this.updateSelection(i),this.setPlaceholder(),n&&this.triggerChange({added:i,removed:o});else{if(!e&&0!==e)return void this.clear(n);if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){r.opts.element.val(e?r.id(e):""),r.updateSelection(e),r.setPlaceholder(),n&&r.triggerChange({added:e,removed:o})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n,i=!1;if(0===arguments.length)return n=this.selection.data("select2-data"),n==t&&(n=null),n;arguments.length>1&&(i=arguments[1]),e?(n=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),i&&this.triggerChange({added:e,removed:n})):this.clear(i)}}),P=$(A,{createContainer:function(){return e(document.createElement("div")).attr({class:"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>","  <li class='select2-search-field'>","    <label for='' class='select2-offscreen'></label>","    <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""))},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),n=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var i=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){i.push(n.optionToData(t))}),t(i)}:"data"in t&&(t.initSelection=t.initSelection||function(n,i){var r=s(n.val(),t.separator,t.transformVal),o=[];t.query({matcher:function(n,i,s){var l=e.grep(r,function(e){return a(e,t.id(s))}).length;return l&&o.push(s),l},callback:e.isFunction(i)?function(){for(var e=[],n=0;n<r.length;n++)for(var s=r[n],l=0;l<o.length;l++){var c=o[l];if(a(s,t.id(c))){e.push(c),o.splice(l,1);break}}i(e)}:e.noop})}),t},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},destroy:function(){e("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),D.call(this,"searchContainer","selection")},initContainer:function(){var t,n=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(n);var i=this;this.selection.on("click",".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)",function(t){i.search[0].focus(),i.selectChoice(e(this))}),this.search.attr("id","s2id_autogen"+O()),this.search.prev().text(e("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.opts.element.focus(this.bind(function(){this.focus()})),this.search.on("input paste",this.bind(function(){this.search.attr("placeholder")&&0==this.search.val().length||this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var n=t.find(".select2-search-choice-focus"),i=n.prev(".select2-search-choice:not(.select2-locked)"),r=n.next(".select2-search-choice:not(.select2-locked)"),o=p(this.search);if(n.length&&(e.which==R.LEFT||e.which==R.RIGHT||e.which==R.BACKSPACE||e.which==R.DELETE||e.which==R.ENTER)){var a=n;return e.which==R.LEFT&&i.length?a=i:e.which==R.RIGHT?a=r.length?r:null:e.which===R.BACKSPACE?this.unselect(n.first())&&(this.search.width(10),a=i.length?i:r):e.which==R.DELETE?this.unselect(n.first())&&(this.search.width(10),a=r.length?r:null):e.which==R.ENTER&&(a=null),this.selectChoice(a),m(e),void(a&&a.length||this.open())}if((e.which===R.BACKSPACE&&1==this.keydowns||e.which==R.LEFT)&&0==o.offset&&!o.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),void m(e);if(this.selectChoice(null),this.opened())switch(e.which){case R.UP:case R.DOWN:return this.moveHighlight(e.which===R.UP?-1:1),void m(e);case R.ENTER:return this.selectHighlighted(),void m(e);case R.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case R.ESC:return this.cancel(e),void m(e)}if(e.which!==R.TAB&&!R.isControl(e)&&!R.isFunctionKey(e)&&e.which!==R.BACKSPACE&&e.which!==R.ESC){if(e.which===R.ENTER){if(!1===this.opts.openOnEnter)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),e.which!==R.PAGE_UP&&e.which!==R.PAGE_DOWN||m(e),e.which===R.ENTER&&m(e)}}})),this.search.on("keyup",this.bind(function(e){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(e.Event("select2-blur"))})),this.container.on("click",n,this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",n,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.hide(),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,function(n){n!==t&&null!==n&&(e.updateSelection(n),e.close(),e.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),n=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&!1===this.search.hasClass("select2-focused")?(this.search.val(e).addClass("select2-default"),this.search.width(n>0?n:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],i=[],o=this;e(t).each(function(){r(o.id(this),n)<0&&(n.push(o.id(this)),i.push(this))}),t=i,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){o.addSelectedChoice(this)}),o.postprocessResults()},tokenize:function(){var e=this.search.val();null!=(e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts))&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,n){this.triggerSelect(e)&&""!==e.text&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.clearSearch(),this.updateResults(),!this.select&&this.opts.closeOnSelect||this.postprocessResults(e,!1,!0===this.opts.closeOnSelect),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),
this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),n&&n.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var i,r,o=!n.locked,a=e("<li class='select2-search-choice'>    <div></div>    <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),l=o?a:s,c=this.id(n),u=this.getVal();i=this.opts.formatSelection(n,l.find("div"),this.opts.escapeMarkup),i!=t&&l.find("div").replaceWith(e("<div></div>").html(i)),r=this.opts.formatSelectionCssClass(n,l.find("div")),r!=t&&l.addClass(r),o&&l.find(".select2-search-choice-close").on("mousedown",m).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),m(t),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),l.data("select2-data",n),l.insertBefore(this.searchContainer),u.push(c),this.setVal(u)},unselect:function(t){var n,i,o=this.getVal();if(t=t.closest(".select2-search-choice"),0===t.length)throw"Invalid argument: "+t+". Must be .select2-search-choice";if(n=t.data("select2-data")){var a=e.Event("select2-removing");if(a.val=this.id(n),a.choice=n,this.opts.element.trigger(a),a.isDefaultPrevented())return!1;for(;(i=r(this.id(n),o))>=0;)o.splice(i,1),this.setVal(o),this.select&&this.postprocessResults();return t.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(n),choice:n}),this.triggerChange({removed:n}),!0}},postprocessResults:function(e,t,n){var i=this.getVal(),o=this.results.find(".select2-result"),a=this.results.find(".select2-result-with-children"),s=this;o.each2(function(e,t){r(s.id(t.data("select2-data")),i)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),a.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&!1!==n&&!0===this.opts.closeOnSelect&&s.highlight(0),!this.opts.createSearchChoice&&!o.filter(".select2-result:not(.select2-selected)").length>0&&(!e||e&&!e.more&&0===this.results.find(".select2-no-results").length)&&_(s.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+S(s.opts.formatNoMatches,s.opts.element,s.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-l(this.search)},resizeSearch:function(){var e,t,n,i,r,o=l(this.search);e=v(this.search)+10,t=this.search.offset().left,n=this.selection.width(),i=this.selection.offset().left,r=n-(t-i)-o,r<e&&(r=n-o),r<40&&(r=n-o),r<=0&&(r=e),this.search.width(Math.floor(r))},getVal:function(){var e;return this.select?(e=this.select.val(),null===e?[]:e):(e=this.opts.element.val(),s(e,this.opts.separator,this.opts.transformVal))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){r(this,n)<0&&n.push(this)}),this.opts.element.val(0===n.length?"":n.join(this.opts.separator)))},buildChangeDetails:function(e,t){for(var t=t.slice(0),e=e.slice(0),n=0;n<t.length;n++)for(var i=0;i<e.length;i++)a(this.opts.id(t[n]),this.opts.id(e[i]))&&(t.splice(n,1),n>0&&n--,e.splice(i,1),i--);return{added:t,removed:e}},val:function(n,i){var r,o=this;if(0===arguments.length)return this.getVal();if(r=this.data(),r.length||(r=[]),!n&&0!==n)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(i&&this.triggerChange({added:this.data(),removed:r}));if(this.setVal(n),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),i&&this.triggerChange(this.buildChangeDetails(r,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e.map(t,o.id);o.setVal(n),o.updateSelection(t),o.clearSearch(),i&&o.triggerChange(o.buildChangeDetails(r,o.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,n){var i,r,o=this;if(0===arguments.length)return this.selection.children(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get();r=this.data(),t||(t=[]),i=e.map(t,function(e){return o.opts.id(e)}),this.setVal(i),this.updateSelection(t),this.clearSearch(),n&&this.triggerChange(this.buildChangeDetails(r,this.data()))}}),e.fn.select2=function(){var n,i,o,a,s,l=Array.prototype.slice.call(arguments,0),c=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],u=["opened","isFocused","container","dropdown"],d=["val","data"],h={search:"externalSearch"};return this.each(function(){if(0===l.length||"object"==typeof l[0])n=0===l.length?{}:e.extend({},l[0]),n.element=e(this),"select"===n.element.get(0).tagName.toLowerCase()?s=n.element.prop("multiple"):(s=n.multiple||!1,"tags"in n&&(n.multiple=s=!0)),i=s?new window.Select2.class.multi:new window.Select2.class.single,i.init(n);else{if("string"!=typeof l[0])throw"Invalid arguments to select2 plugin: "+l;if(r(l[0],c)<0)throw"Unknown method: "+l[0];if(a=t,(i=e(this).data("select2"))===t)return;if(o=l[0],"container"===o?a=i.container:"dropdown"===o?a=i.dropdown:(h[o]&&(o=h[o]),a=i[o].apply(i,l.slice(1))),r(l[0],u)>=0||r(l[0],d)>=0&&1==l.length)return!1}}),a===t?this:a},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,i){var r=[];return y(this.text(e),n.term,r,i),r.join("")},transformVal:function(t){return e.trim(t)},formatSelection:function(e,n,i){return e?i(this.text(e)):t},sortResults:function(e,t,n){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(e,n){return t},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==t?null:e.id},text:function(t){return t&&this.data&&this.data.text?e.isFunction(this.data.text)?this.data.text(t):t[this.data.text]:t.text},matcher:function(e,t){return i(""+t).toUpperCase().indexOf(i(""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:T,escapeMarkup:w,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(e){return null},nextSearchTerm:function(e,n){return t},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){return!(("ontouchstart"in window||navigator.msMaxTouchPoints>0)&&e.opts.minimumResultsForSearch<0)}},e.fn.select2.locales=[],e.fn.select2.locales.en={formatMatches:function(e){return 1===e?"One result is available, press enter to select it.":e+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatAjaxError:function(e,t,n){return"Loading failed"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" or more character"+(1==n?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please delete "+n+" character"+(1==n?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(e){return"Loading more results…"},formatSearching:function(){return"Searching…"}},e.extend(e.fn.select2.defaults,e.fn.select2.locales.en),e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:x,local:C,tags:k},util:{debounce:d,markMatch:y,escapeMarkup:w,stripDiacritics:i},class:{abstract:A,single:j,multi:P}}}}(jQuery),define("libs/select2",function(){}),define("locales/select2_locale",["libs/sprintf","pgui.localizer","libs/select2"],function(e,t){var n=e.sprintf;$.fn.select2.locales.php_gen={formatMatches:function(e){return 1===e?t.getString("Select2MatchesOne"):n(t.getString("Select2MatchesMoreOne"),e)},formatNoMatches:function(){return t.getString("Select2NoMatches")},formatAjaxError:function(e,n,i){return t.getString(t.getString("Select2AjaxError"))},formatInputTooShort:function(e,i){var r=i-e.length;return n(t.getString("Select2InputTooShort"),r)},formatInputTooLong:function(e,i){var r=e.length-i;return n(t.getString("Select2InputTooLong"),r)},formatSelectionTooBig:function(e){return n(t.getString("Select2SelectionTooBig"),e)},formatLoadMore:function(e){return t.getString("Select2LoadMore")},formatSearching:function(){return t.getString("Select2Searching")}},$.extend($.fn.select2.defaults,$.fn.select2.locales.php_gen)}),define("pgui.editors/dynamic_combobox",["pgui.editors/custom","pgui.editors/select2_format","locales/select2_locale","libs/select2"],function(e,t){return e.extend({init:function(e,n){this.queryFunction=function(e){return{term:e}},this._super(e,n),this.formatFunctions=new t,this.formatFunctions.setFormatCallbacksFromElement($(e)),this.processElement(e),this.bind("submit.pgui.nested-insert",function(e,t){this.setValue(t)}.bind(this))},processElement:function(){var e=this,t=$(this.rootElement);t.on("change",function(n,i){if("function"==typeof t.valid){var r=$(this.form);r.length&&_.keys(r.data("validator").submitted).length&&t.valid()}i||e.doChanged()}),$("label[for="+t.attr("id")+"]").on("click",function(){t.select2("focus")}),t.select2({ajax:{url:t.attr("data-url"),dataType:"json",results:function(e){return{results:$.map(e,function(e){return{id:e.id,text:e.value,formatted_value:e.formatted_value,fields:e.fields}})}},data:function(t){return e.queryFunction(t)}},initSelection:function(n,i){var r=n.val();$.ajax({url:t.data("url"),data:{id:r},dataType:"json"}).done(function(t){$.each(t,function(t,n){if(n.id==r)return i({id:n.id,text:n.value,formatted_value:n.formatted_value,fields:n.fields}),e.rootElement.trigger("select2-init"),!1})})},width:"100%",minimumInputLength:t.data("minimal-input-length"),allowClear:t.data("allowclear"),formatSelection:e.formatFunctions.getFormatClojure("selection"),formatResult:e.formatFunctions.getFormatClojure("result")})},setValue:function(e){return this.rootElement.val(e),this.rootElement.select2&&(this.rootElement.select2("val",this.rootElement.val()),this.rootElement.trigger("change")),this},getValue:function(){return this.rootElement.select2("val")},getDisplayValue:function(){var e=this.getData();return e&&e.text?e.text:this.getValue()},getData:function(){return this.rootElement.select2("data")},setData:function(e){return this.rootElement.select2("data",e),this},setEnabled:function(e){return this.rootElement.prop("disabled",!e),this.rootElement.select2("enable",!!e),this},getEnabled:function(){return!this.rootElement.prop("disabled")},getReadonly:function(){return!!this.rootElement.prop("readonly")},setReadonly:function(e){return this.rootElement.select2("readonly",!!e),this.rootElement.prop("readonly",!!e),this},setFormatSelection:function(e){return this.formatFunctions.setCallback("selection",e),$(this.rootElement).trigger("change",!0),this},setFormatResult:function(e){return this.formatFunctions.setCallback("result",e),$(this.rootElement).trigger("change",!0),this},setQueryFunction:function(e){return this.queryFunction=e,this}})}),define("pgui.editors/plain",["underscore","pgui.editors/custom"],function(e,t){return t.extend({init:function(t,n){this._super(t,n),this.rootElement.change(e.bind(function(){this.doChanged()},this))},_getAttribute:function(e){return this.rootElement.attr(e)},_setAttribute:function(e,t){this.rootElement.attr(e,t)},getValue:function(){return this.rootElement.val()},setValue:function(e){return this.rootElement.val(e),this},getEnabled:function(){return!this.rootElement.prop("disabled")},setEnabled:function(e){return this.rootElement.prop("disabled",!e),this},getReadonly:function(){return Boolean(this.rootElement.attr("readonly"))},setReadonly:function(e){return this.rootElement.prop("readonly",e),this},doChanged:function(){this.trigger("onChangeEvent",this,0)},onChange:function(e){return this.bind("onChangeEvent",e),this}})}),function(e){function t(t){return l?t.data("events"):e._data(t[0]).events}function n(e,n,i){var r=t(e),o=r[n];if(!l){var a=i?o.splice(o.delegateCount-1,1)[0]:o.pop();return void o.splice(i?0:o.delegateCount||0,0,a)}i?r.live.unshift(r.live.pop()):o.unshift(o.pop())}function i(t,i,r){var o=i.split(/\s+/);t.each(function(){for(var t=0;t<o.length;++t){var i=e.trim(o[t]).match(/[^\.]+/i)[0];n(e(this),i,r)}})}function r(t){e.fn[t+"First"]=function(){var n=e.makeArray(arguments),r=n.shift();return r&&(e.fn[t].apply(this,arguments),i(this,r)),this}}var o=e.fn.jquery.split("."),a=parseInt(o[0]),s=parseInt(o[1]),l=a<1||1==a&&s<7;r("bind"),r("one"),e.fn.delegateFirst=function(){var t=e.makeArray(arguments),n=t[1];return n&&(t.splice(0,2),e.fn.delegate.apply(this,arguments),i(this,n,!0)),this},e.fn.liveFirst=function(){var t=e.makeArray(arguments);return t.unshift(this.selector),e.fn.delegateFirst.apply(e(document),t),this},l||(e.fn.onFirst=function(t,n){var r=e(this),o="string"==typeof n;if(e.fn.on.apply(r,arguments),"object"==typeof t)for(type in t)t.hasOwnProperty(type)&&i(r,type,o);else"string"==typeof t&&i(r,t,o);return r})}(jQuery),define("jquery.bind-first",function(){}),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.toggle"),o="object"==typeof t&&t;r||i.data("bs.toggle",r=new n(this,o)),"string"==typeof t&&r[t]&&r[t]()})}var n=function(t,n){this.$element=e(t),this.options=e.extend({},this.defaults(),n),this.render()};n.VERSION="2.2.0",n.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"small",style:"",width:null,height:null},n.prototype.defaults=function(){return{on:this.$element.attr("data-on")||n.DEFAULTS.on,off:this.$element.attr("data-off")||n.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||n.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||n.DEFAULTS.offstyle,size:this.$element.attr("data-size")||n.DEFAULTS.size,style:this.$element.attr("data-style")||n.DEFAULTS.style,width:this.$element.attr("data-width")||n.DEFAULTS.width,height:this.$element.attr("data-height")||n.DEFAULTS.height}},n.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var t="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",n=e('<label class="btn">').html(this.options.on).addClass(this._onstyle+" "+t),i=n.clone(),r=e('<label class="btn">').html(this.options.off).addClass(this._offstyle+" "+t+" active"),o=r.clone(),a=e('<span class="toggle-handle btn btn-default">').addClass(t),s=a.clone(),l=e('<div class="toggle-group">').append(n,r,a),c=e('<div class="toggle btn" data-toggle="toggle">').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(t).addClass(this.options.style);this.$element.wrap(c),e.extend(this,{$toggle:this.$element.parent(),$toggleOn:n,$toggleOff:r,$toggleGroup:l}),this.$toggle.append(l),i.hide().appendTo(document.body),o.hide().appendTo(document.body),s.hide().appendTo(document.body);var u=this.options.width||Math.max(i.outerWidth(),o.outerWidth())+s.outerWidth()/2,d=this.options.height||Math.max(i.outerHeight(),o.outerHeight());i.remove(),o.remove(),s.remove(),n.addClass("toggle-on"),r.addClass("toggle-off"),this.$toggle.css({width:u,height:d}),this.options.height&&(n.css("line-height",n.height()+"px"),r.css("line-height",r.height()+"px")),this.update(!0),this.trigger(!0)},n.prototype.toggle=function(){this.$element.prop("checked")?this.off():this.on()},n.prototype.on=function(e){if(this.$element.prop("disabled")||this.$element.prop("readonly"))return!1;this.$toggle.removeClass(this._offstyle+" off").addClass(this._onstyle),this.$element.prop("checked",!0),e||this.trigger()},n.prototype.off=function(e){if(this.$element.prop("disabled")||this.$element.prop("readonly"))return!1;this.$toggle.removeClass(this._onstyle).addClass(this._offstyle+" off"),this.$element.prop("checked",!1),e||this.trigger()},n.prototype.enable=function(){this.$toggle.removeAttr("disabled"),this.$element.prop("disabled",!1)},n.prototype.disable=function(){this.$toggle.attr("disabled","disabled"),this.$element.prop("disabled",!0)},n.prototype.update=function(e){this.$element.prop("disabled")?this.disable():this.enable(),this.$element.prop("checked")?this.on(e):this.off(e)},n.prototype.trigger=function(t){this.$element.off("change.bs.toggle"),t||this.$element.change(),this.$element.on("change.bs.toggle",e.proxy(function(){this.update()},this))},n.prototype.destroy=function(){this.$element.off("change.bs.toggle"),this.$toggleGroup.remove(),this.$element.removeData("bs.toggle"),this.$element.unwrap()};var i=e.fn.bootstrapToggle;e.fn.bootstrapToggle=t,e.fn.bootstrapToggle.Constructor=n,e.fn.toggle.noConflict=function(){return e.fn.bootstrapToggle=i,this},e(function(){e("input[type=checkbox][data-toggle^=toggle]").bootstrapToggle()}),e(document).on("click.bs.toggle","div[data-toggle^=toggle]",function(t){e(this).find("input[type=checkbox]").bootstrapToggle("toggle"),t.preventDefault()})}(jQuery),define("bootstrap.toggle",["jquery"],function(){}),define("pgui.editors/checkbox",["pgui.editors/plain","jquery.bind-first","bootstrap.toggle"],function(e){return e.extend({init:function(e,t){if(this._super(e,t),"toggle"===e.attr("data-editor")){var n={on:e.data("toggle-on-caption"),off:e.data("toggle-off-caption"),size:e.data("toggle-size"),onstyle:e.data("toggle-on-style"),offstyle:e.data("toggle-off-style")};e.data("toggle-width")&&(n.width=e.data("toggle-width")),e.data("toggle-height")&&(n.height=e.data("toggle-height")),e.bootstrapToggle(n)}},getValue:function(){return this.rootElement.is(":checked")},setValue:function(e){return this.rootElement.prop("checked",!!e),this},setReadonly:function(e){this._super(e);var t=this.rootElement;return e?(t.onFirst("click.AUX",function(){return event.preventDefault(),event.stopImmediatePropagation(),!1}),t.onFirst("change.AUX",function(e){return e.preventDefault(),e.stopImmediatePropagation(),!1})):(t.off("click.AUX"),t.off("change.AUX")),this}})}),define("pgui.editors/checkboxgroup",["pgui.editors/plain","underscore","pgui.editors/checkbox"],function(e,t,n){var i='<input type="checkbox" name="<%=editorName%>[]" value="<%=value%>"><%=caption%>',r=t.template('<div class="checkbox js-value"><label>'+i+"</label></div>"),o=t.template('<label class="checkbox-inline js-value">'+i+"</label>");return e.extend({init:function(e,n){this._super(e,n),this.rootElement.find("input").change(t.bind(function(){this.doChanged()},this)),this.bind("submit.pgui.nested-insert",function(e,t,n){this.addItem(n[e.data("stored-field-name")],n[e.data("display-field-name")],!0)}.bind(this))},getValue:function(){return t.toArray(this.rootElement.find("input:checked").map(function(e,t){return $(t).attr("value")}))},getDisplayValue:function(){return t.toArray(this.rootElement.find("input:checked").map(function(e,t){return $(t).closest("label").text()}))},setValue:function(e){if(e.split){var t,n=e.split(",");this.rootElement.find("input").each(function(e,i){var r=!1;for(t=0;t<n.length;++t)if($(i).attr("value")==n[t]){$(i).prop("checked",!0),r=!0;break}r||$(i).prop("checked",!1)})}},getEnabled:function(){return this.rootElement.find("input:enabled").length>0},setEnabled:function(e){this.rootElement.find("input").each(function(t,i){new n($(i)).setEnabled(e)})},getReadonly:function(){return 1===this.rootElement.find("input:enabled").length},setReadonly:function(e){this.rootElement.find("input").each(function(t,i){new n($(i)).setReadonly(e)})},clear:function(){this.rootElement.find(".checkbox, .checkbox-inline").remove()},addItem:function(e,t,n){var i=this.rootElement,a=i.data("inline"),s={editorName:i.attr("data-editor-name"),value:e,caption:t},l=$(a?o(s):r(s));return"boolean"==typeof n&&n&&l.find("input").prop("checked",!0),this.getItemCount()>0?i.find(".js-value").last().after(l):i.prepend(l),this},removeItem:function(e){this.rootElement.find("input[value='"+e+"']").parent().remove()},getItems:function(){return this.rootElement.find("input").map(function(e,t){return{value:$(t).attr("value"),caption:$(t).closest("label").text()}})},getItemCount:function(){return this.rootElement.find("input").length},isMultivalue:function(){return!0},_getSetRequiredTarget:function(){return this.rootElement.find("input[type=checkbox]")}})}),define("pgui.editors/combobox",["pgui.editors/plain"],function(e){return e.extend({init:function(e,t){this._super(e,t),this.setReadonly(this.getReadonly()),this.bind("submit.pgui.nested-insert",function(e,t,n){this.addItem(t,n[e.data("display-field-name")]),this.setValue(t)}.bind(this))},clear:function(){return this.rootElement.find("option:enabled[value!='']").remove(),this},addItem:function(e,t){return this.rootElement.append($("<option></option>").attr("value",e).html(t)),this},removeItem:function(e){return this.rootElement.find("option[value='"+e+"']").remove(),this},getItems:function(){return this.rootElement.find("option:enabled[value!='']").map(function(e,t){return{value:$(t).attr("value"),caption:$(t).text()}})},getItemCount:function(){return this.rootElement.find("option[value!='']").length},setValue:function(e){this.setReadonly(!1),this._super(e),this.setReadonly(this.getReadonly())},getReadonly:function(){return Boolean(this.rootElement.attr("readonly"))||this.rootElement.prop("readonly")},setReadonly:function(e){this._super(e),e?(this.rootElement.attr("readonly","readonly"),this.rootElement.closest(".input-group").find(".js-nested-insert").first().attr("disabled","disabled")):(this.rootElement.removeAttr("readonly"),this.rootElement.closest(".input-group").find(".js-nested-insert").first().removeAttr("disabled"));var t=this.getValue();return this.rootElement.find("option").each(function(n,i){var r=$(i);r.prop("disabled",e&&r.attr("value")!=t)}),this},getCaption:function(){return this.rootElement.find("option:selected").text()},getDisplayValue:function(){return this.rootElement.find("option:selected").first().text()}})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("moment",t):e.moment=t()}(this,function(){"use strict";function e(){return er.apply(null,arguments)}function t(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function n(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function r(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(i(e,t))return!1;return!0}function o(e){return void 0===e}function a(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function s(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function l(e,t){var n,i=[],r=e.length;for(n=0;n<r;++n)i.push(t(e[n],n));return i}function c(e,t){for(var n in t)i(t,n)&&(e[n]=t[n]);return i(t,"toString")&&(e.toString=t.toString),i(t,"valueOf")&&(e.valueOf=t.valueOf),e}function u(e,t,n,i){return St(e,t,n,i,!0).utc()}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return null==e._pf&&(e._pf=d()),e._pf}function f(e){if(null==e._isValid){var t=h(e),n=tr.call(t.parsedDateParts,function(e){return null!=e}),i=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function p(e){var t=u(NaN);return null!=e?c(h(t),e):h(t).userInvalidated=!0,t}function m(e,t){var n,i,r,a=nr.length;if(o(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),o(t._i)||(e._i=t._i),o(t._f)||(e._f=t._f),o(t._l)||(e._l=t._l),o(t._strict)||(e._strict=t._strict),o(t._tzm)||(e._tzm=t._tzm),o(t._isUTC)||(e._isUTC=t._isUTC),o(t._offset)||(e._offset=t._offset),o(t._pf)||(e._pf=h(t)),o(t._locale)||(e._locale=t._locale),a>0)for(n=0;n<a;n++)i=nr[n],r=t[i],o(r)||(e[i]=r);return e}function g(t){m(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===ir&&(ir=!0,e.updateOffset(this),ir=!1)}function v(e){return e instanceof g||null!=e&&null!=e._isAMomentObject}function b(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function y(t,n){var r=!0;return c(function(){if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),r){var o,a,s,l=[],c=arguments.length;for(a=0;a<c;a++){if(o="","object"==typeof arguments[a]){o+="\n["+a+"] ";for(s in arguments[0])i(arguments[0],s)&&(o+=s+": "+arguments[0][s]+", ");o=o.slice(0,-2)}else o=arguments[a];l.push(o)}b(t+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),r=!1}return n.apply(this,arguments)},n)}function w(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),rr[t]||(b(n),rr[t]=!0)}function x(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function C(e){var t,n;for(n in e)i(e,n)&&(t=e[n],x(t)?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function k(e,t){var r,o=c({},e);for(r in t)i(t,r)&&(n(e[r])&&n(t[r])?(o[r]={},c(o[r],e[r]),c(o[r],t[r])):null!=t[r]?o[r]=t[r]:delete o[r]);for(r in e)i(e,r)&&!i(t,r)&&n(e[r])&&(o[r]=c({},o[r]));return o}function _(e){null!=e&&this.set(e)}function S(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return x(i)?i.call(t,n):i}function E(e,t,n){var i=""+Math.abs(e),r=t-i.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}function T(e,t,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),e&&(dr[e]=r),t&&(dr[t[0]]=function(){return E(r.apply(this,arguments),t[1],t[2])}),n&&(dr[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function D(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function $(e){var t,n,i=e.match(lr);for(t=0,n=i.length;t<n;t++)dr[i[t]]?i[t]=dr[i[t]]:i[t]=D(i[t]);return function(t){var r,o="";for(r=0;r<n;r++)o+=x(i[r])?i[r].call(t,e):i[r];return o}}function A(e,t){return e.isValid()?(t=j(t,e.localeData()),ur[t]=ur[t]||$(t),ur[t](e)):e.localeData().invalidDate()}function j(e,t){function n(e){return t.longDateFormat(e)||e}var i=5;for(cr.lastIndex=0;i>=0&&cr.test(e);)e=e.replace(cr,n),cr.lastIndex=0,i-=1;return e}function P(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(lr).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])}function O(){return this._invalidDate}function I(e){return this._ordinal.replace("%d",e)}function M(e,t,n,i){var r=this._relativeTime[n];return x(r)?r(e,t,n,i):r.replace(/%d/i,e)}function N(e,t){var n=this._relativeTime[e>0?"future":"past"];return x(n)?n(t):n.replace(/%s/i,t)}function F(e,t){var n=e.toLowerCase();mr[n]=mr[n+"s"]=mr[t]=e}function R(e){return"string"==typeof e?mr[e]||mr[e.toLowerCase()]:void 0}function L(e){var t,n,r={};for(n in e)i(e,n)&&(t=R(n))&&(r[t]=e[n]);return r}function z(e,t){gr[e]=t}function H(e){var t,n=[];for(t in e)i(e,t)&&n.push({unit:t,priority:gr[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}function B(e){return e%4==0&&e%100!=0||e%400==0}function U(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function q(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=U(t)),n}function W(t,n){return function(i){return null!=i?(Y(this,t,i),e.updateOffset(this,n),this):V(this,t)}}function V(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Y(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&B(e.year())&&1===e.month()&&29===e.date()?(n=q(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),re(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function G(e){return e=R(e),x(this[e])?this[e]():this}function Z(e,t){if("object"==typeof e){e=L(e);var n,i=H(e),r=i.length;for(n=0;n<r;n++)this[i[n].unit](e[i[n].unit])}else if(e=R(e),x(this[e]))return this[e](t);return this}function Q(e,t,n){ar[e]=x(t)?t:function(e,i){return e&&n?n:t}}function K(e,t){return i(ar,e)?ar[e](t._strict,t._locale):new RegExp(X(e))}function X(e){return J(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,i,r){return t||n||i||r}))}function J(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function ee(e,t){var n,i,r=t;for("string"==typeof e&&(e=[e]),a(t)&&(r=function(e,n){n[t]=q(e)}),i=e.length,n=0;n<i;n++)Mr[e[n]]=r}function te(e,t){ee(e,function(e,n,i,r){i._w=i._w||{},t(e,i._w,i,r)})}function ne(e,t,n){null!=t&&i(Mr,e)&&Mr[e](t,n._a,n,e)}function ie(e,t){return(e%t+t)%t}function re(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=ie(t,12);return e+=(t-n)/12,1===n?B(e)?29:28:31-n%7%2}function oe(e,n){return e?t(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Yr).test(n)?"format":"standalone"][e.month()]:t(this._months)?this._months:this._months.standalone}function ae(e,n){return e?t(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Yr.test(n)?"format":"standalone"][e.month()]:t(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function se(e,t,n){var i,r,o,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)o=u([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(o,"").toLocaleLowerCase();return n?"MMM"===t?(r=Ir.call(this._shortMonthsParse,a),-1!==r?r:null):(r=Ir.call(this._longMonthsParse,a),-1!==r?r:null):"MMM"===t?-1!==(r=Ir.call(this._shortMonthsParse,a))?r:(r=Ir.call(this._longMonthsParse,a),-1!==r?r:null):-1!==(r=Ir.call(this._longMonthsParse,a))?r:(r=Ir.call(this._shortMonthsParse,a),-1!==r?r:null)}function le(e,t,n){var i,r,o;if(this._monthsParseExact)return se.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=u([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"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}}function ce(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=q(t);else if(t=e.localeData().monthsParse(t),!a(t))return e;return n=Math.min(e.date(),re(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function ue(t){return null!=t?(ce(this,t),e.updateOffset(this,!0),this):V(this,"Month")}function de(){return re(this.year(),this.month())}function he(e){return this._monthsParseExact?(i(this,"_monthsRegex")||pe.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(i(this,"_monthsShortRegex")||(this._monthsShortRegex=Gr),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function fe(e){return this._monthsParseExact?(i(this,"_monthsRegex")||pe.call(this),e?this._monthsStrictRegex:this._monthsRegex):(i(this,"_monthsRegex")||(this._monthsRegex=Zr),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function pe(){function e(e,t){return t.length-e.length}var t,n,i=[],r=[],o=[];for(t=0;t<12;t++)n=u([2e3,t]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(i.sort(e),r.sort(e),o.sort(e),t=0;t<12;t++)i[t]=J(i[t]),r[t]=J(r[t]);for(t=0;t<24;t++)o[t]=J(o[t]);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 me(e){return B(e)?366:365}function ge(){return B(this.year())}function ve(e,t,n,i,r,o,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,i,r,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,i,r,o,a),s}function be(e){var t,n;return e<100&&e>=0?(n=Array.prototype.slice.call(arguments),n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function ye(e,t,n){var i=7+t-n;return-(7+be(e,0,i).getUTCDay()-t)%7+i-1}function we(e,t,n,i,r){var o,a,s=(7+n-i)%7,l=ye(e,i,r),c=1+7*(t-1)+s+l;return c<=0?(o=e-1,a=me(o)+c):c>me(e)?(o=e+1,a=c-me(e)):(o=e,a=c),{year:o,dayOfYear:a}}function xe(e,t,n){var i,r,o=ye(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?(r=e.year()-1,i=a+Ce(r,t,n)):a>Ce(e.year(),t,n)?(i=a-Ce(e.year(),t,n),r=e.year()+1):(r=e.year(),i=a),{week:i,year:r}}function Ce(e,t,n){var i=ye(e,t,n),r=ye(e+1,t,n);return(me(e)-i+r)/7}function ke(e){return xe(e,this._week.dow,this._week.doy).week}function _e(){return this._week.dow}function Se(){return this._week.doy}function Ee(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function Te(e){var t=xe(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function De(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function $e(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Ae(e,t){return e.slice(t,7).concat(e.slice(0,t))}function je(e,n){var i=t(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(n)?"format":"standalone"];return!0===e?Ae(i,this._week.dow):e?i[e.day()]:i}function Pe(e){return!0===e?Ae(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Oe(e){return!0===e?Ae(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Ie(e,t,n){var i,r,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)o=u([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?(r=Ir.call(this._weekdaysParse,a),-1!==r?r:null):"ddd"===t?(r=Ir.call(this._shortWeekdaysParse,a),-1!==r?r:null):(r=Ir.call(this._minWeekdaysParse,a),-1!==r?r:null):"dddd"===t?-1!==(r=Ir.call(this._weekdaysParse,a))?r:-1!==(r=Ir.call(this._shortWeekdaysParse,a))?r:(r=Ir.call(this._minWeekdaysParse,a),-1!==r?r:null):"ddd"===t?-1!==(r=Ir.call(this._shortWeekdaysParse,a))?r:-1!==(r=Ir.call(this._weekdaysParse,a))?r:(r=Ir.call(this._minWeekdaysParse,a),-1!==r?r:null):-1!==(r=Ir.call(this._minWeekdaysParse,a))?r:-1!==(r=Ir.call(this._weekdaysParse,a))?r:(r=Ir.call(this._shortWeekdaysParse,a),-1!==r?r:null)}function Me(e,t,n){var i,r,o;if(this._weekdaysParseExact)return Ie.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=u([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"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}}function Ne(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=De(e,this.localeData()),this.add(e-t,"d")):t}function Fe(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Re(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=$e(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Le(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(i(this,"_weekdaysRegex")||(this._weekdaysRegex=to),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function ze(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=no),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function He(e){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||Be.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=io),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Be(){function e(e,t){return t.length-e.length}var t,n,i,r,o,a=[],s=[],l=[],c=[];for(t=0;t<7;t++)n=u([2e3,1]).day(t),i=J(this.weekdaysMin(n,"")),r=J(this.weekdaysShort(n,"")),o=J(this.weekdays(n,"")),a.push(i),s.push(r),l.push(o),c.push(i),c.push(r),c.push(o);a.sort(e),s.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Ue(){return this.hours()%12||12}function qe(){return this.hours()||24}function We(e,t){T(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ve(e,t){return t._meridiemParse}function Ye(e){return"p"===(e+"").toLowerCase().charAt(0)}function Ge(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function Ze(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n<i;n+=1)if(e[n]!==t[n])return n;return i}function Qe(e){return e?e.toLowerCase().replace("_","-"):e}function Ke(e){for(var t,n,i,r,o=0;o<e.length;){for(r=Qe(e[o]).split("-"),t=r.length,n=Qe(e[o+1]),n=n?n.split("-"):null;t>0;){if(i=Je(r.slice(0,t).join("-")))return i;if(n&&n.length>=t&&Ze(r,n)>=t-1)break;t--}o++}return ro}function Xe(e){return null!=e.match("^[^/\\\\]*$")}function Je(e){var t,n=null;if(void 0===lo[e]&&"undefined"!=typeof module&&module&&module.exports&&Xe(e))try{n=ro._abbr,t=require,t("./locale/"+e),et(n)}catch(t){lo[e]=null}return lo[e]}function et(e,t){var n;return e&&(n=o(t)?it(e):tt(e,t),n?ro=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ro._abbr}function tt(e,t){if(null!==t){var n,i=so;if(t.abbr=e,null!=lo[e])w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=lo[e]._config;else if(null!=t.parentLocale)if(null!=lo[t.parentLocale])i=lo[t.parentLocale]._config;else{if(null==(n=Je(t.parentLocale)))return co[t.parentLocale]||(co[t.parentLocale]=[]),co[t.parentLocale].push({name:e,config:t}),null;i=n._config}return lo[e]=new _(k(i,t)),co[e]&&co[e].forEach(function(e){tt(e.name,e.config)}),et(e),lo[e]}return delete lo[e],null}function nt(e,t){if(null!=t){var n,i,r=so;null!=lo[e]&&null!=lo[e].parentLocale?lo[e].set(k(lo[e]._config,t)):(i=Je(e),null!=i&&(r=i._config),t=k(r,t),null==i&&(t.abbr=e),n=new _(t),n.parentLocale=lo[e],lo[e]=n),et(e)}else null!=lo[e]&&(null!=lo[e].parentLocale?(lo[e]=lo[e].parentLocale,e===et()&&et(e)):null!=lo[e]&&delete lo[e]);return lo[e]}function it(e){var n;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return ro;if(!t(e)){if(n=Je(e))return n;e=[e]}return Ke(e)}function rt(){return or(lo)}function ot(e){var t,n=e._a;return n&&-2===h(e).overflow&&(t=n[Fr]<0||n[Fr]>11?Fr:n[Rr]<1||n[Rr]>re(n[Nr],n[Fr])?Rr:n[Lr]<0||n[Lr]>24||24===n[Lr]&&(0!==n[zr]||0!==n[Hr]||0!==n[Br])?Lr:n[zr]<0||n[zr]>59?zr:n[Hr]<0||n[Hr]>59?Hr:n[Br]<0||n[Br]>999?Br:-1,h(e)._overflowDayOfYear&&(t<Nr||t>Rr)&&(t=Rr),h(e)._overflowWeeks&&-1===t&&(t=Ur),h(e)._overflowWeekday&&-1===t&&(t=qr),h(e).overflow=t),e}function at(e){var t,n,i,r,o,a,s=e._i,l=uo.exec(s)||ho.exec(s),c=po.length,u=mo.length;if(l){for(h(e).iso=!0,t=0,n=c;t<n;t++)if(po[t][1].exec(l[1])){r=po[t][0],i=!1!==po[t][2];break}if(null==r)return void(e._isValid=!1);if(l[3]){for(t=0,n=u;t<n;t++)if(mo[t][1].exec(l[3])){o=(l[2]||" ")+mo[t][0];break}if(null==o)return void(e._isValid=!1)}if(!i&&null!=o)return void(e._isValid=!1);if(l[4]){if(!fo.exec(l[4]))return void(e._isValid=!1);a="Z"}e._f=r+(o||"")+(a||""),bt(e)}else e._isValid=!1}function st(e,t,n,i,r,o){var a=[lt(e),Vr.indexOf(t),parseInt(n,10),parseInt(i,10),parseInt(r,10)];return o&&a.push(parseInt(o,10)),a}function lt(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function ct(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ut(e,t,n){if(e){if(Jr.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay())return h(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function dt(e,t,n){if(e)return bo[e];if(t)return 0;var i=parseInt(n,10),r=i%100;return(i-r)/100*60+r}function ht(e){var t,n=vo.exec(ct(e._i));if(n){if(t=st(n[4],n[3],n[2],n[5],n[6],n[7]),!ut(n[1],t,e))return;e._a=t,e._tzm=dt(n[8],n[9],n[10]),e._d=be.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function ft(t){var n=go.exec(t._i);if(null!==n)return void(t._d=new Date(+n[1]));at(t),!1===t._isValid&&(delete t._isValid,ht(t),!1===t._isValid&&(delete t._isValid,t._strict?t._isValid=!1:e.createFromInputFallback(t)))}function pt(e,t,n){return null!=e?e:null!=t?t:n}function mt(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function gt(e){var t,n,i,r,o,a=[];if(!e._d){for(i=mt(e),e._w&&null==e._a[Rr]&&null==e._a[Fr]&&vt(e),null!=e._dayOfYear&&(o=pt(e._a[Nr],i[Nr]),(e._dayOfYear>me(o)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=be(o,0,e._dayOfYear),e._a[Fr]=n.getUTCMonth(),e._a[Rr]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=i[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[Lr]&&0===e._a[zr]&&0===e._a[Hr]&&0===e._a[Br]&&(e._nextDay=!0,e._a[Lr]=0),e._d=(e._useUTC?be:ve).apply(null,a),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Lr]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(h(e).weekdayMismatch=!0)}}function vt(e){var t,n,i,r,o,a,s,l,c;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(o=1,a=4,n=pt(t.GG,e._a[Nr],xe(Et(),1,4).year),i=pt(t.W,1),((r=pt(t.E,1))<1||r>7)&&(l=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,c=xe(Et(),o,a),n=pt(t.gg,e._a[Nr],c.year),i=pt(t.w,c.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+o,(t.e<0||t.e>6)&&(l=!0)):r=o),i<1||i>Ce(n,o,a)?h(e)._overflowWeeks=!0:null!=l?h(e)._overflowWeekday=!0:(s=we(n,i,r,o,a),e._a[Nr]=s.year,e._dayOfYear=s.dayOfYear)}function bt(t){if(t._f===e.ISO_8601)return void at(t);if(t._f===e.RFC_2822)return void ht(t);t._a=[],h(t).empty=!0;var n,i,r,o,a,s,l,c=""+t._i,u=c.length,d=0;for(r=j(t._f,t._locale).match(lr)||[],l=r.length,n=0;n<l;n++)o=r[n],i=(c.match(K(o,t))||[])[0],i&&(a=c.substr(0,c.indexOf(i)),a.length>0&&h(t).unusedInput.push(a),c=c.slice(c.indexOf(i)+i.length),d+=i.length),dr[o]?(i?h(t).empty=!1:h(t).unusedTokens.push(o),ne(o,i,t)):t._strict&&!i&&h(t).unusedTokens.push(o);h(t).charsLeftOver=u-d,c.length>0&&h(t).unusedInput.push(c),t._a[Lr]<=12&&!0===h(t).bigHour&&t._a[Lr]>0&&(h(t).bigHour=void 0),h(t).parsedDateParts=t._a.slice(0),h(t).meridiem=t._meridiem,t._a[Lr]=yt(t._locale,t._a[Lr],t._meridiem),s=h(t).era,null!==s&&(t._a[Nr]=t._locale.erasConvertYear(s,t._a[Nr])),gt(t),ot(t)}function yt(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?(i=e.isPM(n),i&&t<12&&(t+=12),i||12!==t||(t=0),t):t}function wt(e){var t,n,i,r,o,a,s=!1,l=e._f.length;if(0===l)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<l;r++)o=0,a=!1,t=m({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],bt(t),f(t)&&(a=!0),o+=h(t).charsLeftOver,o+=10*h(t).unusedTokens.length,h(t).score=o,s?o<i&&(i=o,n=t):(null==i||o<i||a)&&(i=o,n=t,a&&(s=!0));c(e,n||t)}function xt(e){if(!e._d){var t=L(e._i),n=void 0===t.day?t.date:t.day;e._a=l([t.year,t.month,n,t.hour,t.minute,t.second,t.millisecond],function(e){return e&&parseInt(e,10)}),gt(e)}}function Ct(e){var t=new g(ot(kt(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function kt(e){var n=e._i,i=e._f;return e._locale=e._locale||it(e._l),null===n||void 0===i&&""===n?p({nullInput:!0}):("string"==typeof n&&(e._i=n=e._locale.preparse(n)),v(n)?new g(ot(n)):(s(n)?e._d=n:t(i)?wt(e):i?bt(e):_t(e),f(e)||(e._d=null),e))}function _t(i){var r=i._i;o(r)?i._d=new Date(e.now()):s(r)?i._d=new Date(r.valueOf()):"string"==typeof r?ft(i):t(r)?(i._a=l(r.slice(0),function(e){return parseInt(e,10)}),gt(i)):n(r)?xt(i):a(r)?i._d=new Date(r):e.createFromInputFallback(i)}function St(e,i,o,a,s){var l={};return!0!==i&&!1!==i||(a=i,i=void 0),!0!==o&&!1!==o||(a=o,o=void 0),(n(e)&&r(e)||t(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=s,l._l=o,l._i=e,l._f=i,l._strict=a,Ct(l)}function Et(e,t,n,i){return St(e,t,n,i,!1)}function Tt(e,n){var i,r;if(1===n.length&&t(n[0])&&(n=n[0]),!n.length)return Et();for(i=n[0],r=1;r<n.length;++r)n[r].isValid()&&!n[r][e](i)||(i=n[r]);return i}function Dt(){return Tt("isBefore",[].slice.call(arguments,0))}function $t(){return Tt("isAfter",[].slice.call(arguments,0))}function At(e){var t,n,r=!1,o=Co.length;for(t in e)if(i(e,t)&&(-1===Ir.call(Co,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<o;++n)if(e[Co[n]]){if(r)return!1;parseFloat(e[Co[n]])!==q(e[Co[n]])&&(r=!0)}return!0}function jt(){return this._isValid}function Pt(){return Xt(NaN)}function Ot(e){var t=L(e),n=t.year||0,i=t.quarter||0,r=t.month||0,o=t.week||t.isoWeek||0,a=t.day||0,s=t.hour||0,l=t.minute||0,c=t.second||0,u=t.millisecond||0;this._isValid=At(t),this._milliseconds=+u+1e3*c+6e4*l+1e3*s*60*60,this._days=+a+7*o,this._months=+r+3*i+12*n,this._data={},this._locale=it(),this._bubble()}function It(e){return e instanceof Ot}function Mt(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Nt(e,t,n){var i,r=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0;for(i=0;i<r;i++)(n&&e[i]!==t[i]||!n&&q(e[i])!==q(t[i]))&&a++;return a+o}function Ft(e,t){T(e,0,0,function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+E(~~(e/60),2)+t+E(~~e%60,2)})}function Rt(e,t){var n,i,r,o=(t||"").match(e);return null===o?null:(n=o[o.length-1]||[],i=(n+"").match(ko)||["-",0,0],r=60*i[1]+q(i[2]),0===r?0:"+"===i[0]?r:-r)}function Lt(t,n){var i,r;return n._isUTC?(i=n.clone(),r=(v(t)||s(t)?t.valueOf():Et(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+r),e.updateOffset(i,!1),i):Et(t).local()}function zt(e){return-Math.round(e._d.getTimezoneOffset())}function Ht(t,n,i){var r,o=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Rt(jr,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&n&&(r=zt(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),o!==t&&(!n||this._changeInProgress?rn(this,Xt(t-o,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?o:zt(this)}function Bt(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ut(e){return this.utcOffset(0,e)}function qt(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(zt(this),"m")),this}function Wt(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Rt(Ar,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function Vt(e){return!!this.isValid()&&(e=e?Et(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function Yt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Gt(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e,t={};return m(t,this),t=kt(t),t._a?(e=t._isUTC?u(t._a):Et(t._a),this._isDSTShifted=this.isValid()&&Nt(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Zt(){return!!this.isValid()&&!this._isUTC}function Qt(){return!!this.isValid()&&this._isUTC}function Kt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Xt(e,t){var n,r,o,s=e,l=null;return It(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:a(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(l=_o.exec(e))?(n="-"===l[1]?-1:1,s={y:0,d:q(l[Rr])*n,h:q(l[Lr])*n,m:q(l[zr])*n,s:q(l[Hr])*n,ms:q(Mt(1e3*l[Br]))*n}):(l=So.exec(e))?(n="-"===l[1]?-1:1,s={y:Jt(l[2],n),M:Jt(l[3],n),w:Jt(l[4],n),d:Jt(l[5],n),h:Jt(l[6],n),m:Jt(l[7],n),s:Jt(l[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(o=tn(Et(s.from),Et(s.to)),s={},s.ms=o.milliseconds,s.M=o.months),r=new Ot(s),It(e)&&i(e,"_locale")&&(r._locale=e._locale),It(e)&&i(e,"_isValid")&&(r._isValid=e._isValid),r}function Jt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function en(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function tn(e,t){var n;return e.isValid()&&t.isValid()?(t=Lt(t,e),e.isBefore(t)?n=en(e,t):(n=en(t,e),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function nn(e,t){return function(n,i){var r,o;return null===i||isNaN(+i)||(w(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=i,i=o),r=Xt(n,i),rn(this,r,e),this}}function rn(t,n,i,r){var o=n._milliseconds,a=Mt(n._days),s=Mt(n._months);t.isValid()&&(r=null==r||r,s&&ce(t,V(t,"Month")+s*i),a&&Y(t,"Date",V(t,"Date")+a*i),o&&t._d.setTime(t._d.valueOf()+o*i),r&&e.updateOffset(t,a||s))}function on(e){return"string"==typeof e||e instanceof String}function an(e){return v(e)||s(e)||on(e)||a(e)||ln(e)||sn(e)||null===e||void 0===e}function sn(e){var t,o,a=n(e)&&!r(e),s=!1,l=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],c=l.length;for(t=0;t<c;t+=1)o=l[t],s=s||i(e,o);return a&&s}function ln(e){var n=t(e),i=!1;return n&&(i=0===e.filter(function(t){return!a(t)&&on(e)}).length),n&&i}function cn(e){var t,o,a=n(e)&&!r(e),s=!1,l=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(t=0;t<l.length;t+=1)o=l[t],s=s||i(e,o);return a&&s}function un(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function dn(t,n){1===arguments.length&&(arguments[0]?an(arguments[0])?(t=arguments[0],n=void 0):cn(arguments[0])&&(n=arguments[0],t=void 0):(t=void 0,n=void 0));var i=t||Et(),r=Lt(i,this).startOf("day"),o=e.calendarFormat(this,r)||"sameElse",a=n&&(x(n[o])?n[o].call(this,i):n[o]);return this.format(a||this.localeData().calendar(o,this,Et(i)))}function hn(){return new g(this)}function fn(e,t){var n=v(e)?e:Et(e);return!(!this.isValid()||!n.isValid())&&(t=R(t)||"millisecond","millisecond"===t?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function pn(e,t){var n=v(e)?e:Et(e);return!(!this.isValid()||!n.isValid())&&(t=R(t)||"millisecond","millisecond"===t?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function mn(e,t,n,i){var r=v(e)?e:Et(e),o=v(t)?t:Et(t);return!!(this.isValid()&&r.isValid()&&o.isValid())&&(i=i||"()",("("===i[0]?this.isAfter(r,n):!this.isBefore(r,n))&&(")"===i[1]?this.isBefore(o,n):!this.isAfter(o,n)))}function gn(e,t){var n,i=v(e)?e:Et(e);return!(!this.isValid()||!i.isValid())&&(t=R(t)||"millisecond","millisecond"===t?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function vn(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function bn(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function yn(e,t,n){var i,r,o;if(!this.isValid())return NaN;if(i=Lt(e,this),!i.isValid())return NaN;switch(r=6e4*(i.utcOffset()-this.utcOffset()),t=R(t)){case"year":o=wn(this,i)/12;break;case"month":o=wn(this,i);break;case"quarter":o=wn(this,i)/3;break;case"second":o=(this-i)/1e3;break;case"minute":o=(this-i)/6e4;break;case"hour":o=(this-i)/36e5;break;case"day":o=(this-i-r)/864e5;break;case"week":o=(this-i-r)/6048e5;break;default:o=this-i}return n?o:U(o)}function wn(e,t){if(e.date()<t.date())return-wn(t,e);var n,i,r=12*(t.year()-e.year())+(t.month()-e.month()),o=e.clone().add(r,"months");return t-o<0?(n=e.clone().add(r-1,"months"),i=(t-o)/(o-n)):(n=e.clone().add(r+1,"months"),i=(t-o)/(n-o)),-(r+i)||0}function xn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Cn(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?A(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):x(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",A(n,"Z")):A(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function kn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,i,r="moment",o="";return this.isLocal()||(r=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),e="["+r+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",i=o+'[")]',this.format(e+t+n+i)}function _n(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=A(this,t);return this.localeData().postformat(n)}function Sn(e,t){return this.isValid()&&(v(e)&&e.isValid()||Et(e).isValid())?Xt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function En(e){return this.from(Et(),e)}function Tn(e,t){return this.isValid()&&(v(e)&&e.isValid()||Et(e).isValid())?Xt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function Dn(e){return this.to(Et(),e)}function $n(e){var t;return void 0===e?this._locale._abbr:(t=it(e),null!=t&&(this._locale=t),this)}function An(){return this._locale}function jn(e,t){return(e%t+t)%t}function Pn(e,t,n){return e<100&&e>=0?new Date(e+400,t,n)-Po:new Date(e,t,n).valueOf()}function On(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-Po:Date.UTC(e,t,n)}function In(t){var n,i;if(void 0===(t=R(t))||"millisecond"===t||!this.isValid())return this;switch(i=this._isUTC?On:Pn,t){case"year":n=i(this.year(),0,1);break;case"quarter":n=i(this.year(),this.month()-this.month()%3,1);break;case"month":n=i(this.year(),this.month(),1);break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":n=i(this.year(),this.month(),this.date());break;case"hour":n=this._d.valueOf(),n-=jn(n+(this._isUTC?0:this.utcOffset()*Ao),jo);break;case"minute":n=this._d.valueOf(),n-=jn(n,Ao);break;case"second":n=this._d.valueOf(),n-=jn(n,$o)}return this._d.setTime(n),e.updateOffset(this,!0),this}function Mn(t){var n,i;if(void 0===(t=R(t))||"millisecond"===t||!this.isValid())return this;switch(i=this._isUTC?On:Pn,t){case"year":n=i(this.year()+1,0,1)-1;break;case"quarter":n=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":n=i(this.year(),this.month()+1,1)-1;break;case"week":n=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":n=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":n=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":n=this._d.valueOf(),n+=jo-jn(n+(this._isUTC?0:this.utcOffset()*Ao),jo)-1;break;case"minute":n=this._d.valueOf(),n+=Ao-jn(n,Ao)-1;break;case"second":n=this._d.valueOf(),n+=$o-jn(n,$o)-1}return this._d.setTime(n),e.updateOffset(this,!0),this}function Nn(){return this._d.valueOf()-6e4*(this._offset||0)}function Fn(){return Math.floor(this.valueOf()/1e3)}function Rn(){return new Date(this.valueOf())}function Ln(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function zn(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Hn(){return this.isValid()?this.toISOString():null}function Bn(){return f(this)}function Un(){return c({},h(this))}function qn(){return h(this).overflow}function Wn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Vn(t,n){var i,r,o,a=this._eras||it("en")._eras;for(i=0,r=a.length;i<r;++i){switch(typeof a[i].since){case"string":o=e(a[i].since).startOf("day"),a[i].since=o.valueOf()}switch(typeof a[i].until){case"undefined":a[i].until=1/0;break;case"string":o=e(a[i].until).startOf("day").valueOf(),a[i].until=o.valueOf()}}return a}function Yn(e,t,n){var i,r,o,a,s,l=this.eras();for(e=e.toUpperCase(),i=0,r=l.length;i<r;++i)if(o=l[i].name.toUpperCase(),a=l[i].abbr.toUpperCase(),s=l[i].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return l[i];break;case"NNNN":if(o===e)return l[i];break;case"NNNNN":if(s===e)return l[i]}else if([o,a,s].indexOf(e)>=0)return l[i]}function Gn(t,n){var i=t.since<=t.until?1:-1;return void 0===n?e(t.since).year():e(t.since).year()+(n-t.offset)*i}function Zn(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].name;if(i[e].until<=n&&n<=i[e].since)return i[e].name}return""}function Qn(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].narrow;if(i[e].until<=n&&n<=i[e].since)return i[e].narrow}return""}function Kn(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;e<t;++e){if(n=this.clone().startOf("day").valueOf(),i[e].since<=n&&n<=i[e].until)return i[e].abbr;if(i[e].until<=n&&n<=i[e].since)return i[e].abbr}return""}function Xn(){var t,n,i,r,o=this.localeData().eras();for(t=0,n=o.length;t<n;++t)if(i=o[t].since<=o[t].until?1:-1,r=this.clone().startOf("day").valueOf(),o[t].since<=r&&r<=o[t].until||o[t].until<=r&&r<=o[t].since)return(this.year()-e(o[t].since).year())*i+o[t].offset;return this.year()}function Jn(e){return i(this,"_erasNameRegex")||ai.call(this),e?this._erasNameRegex:this._erasRegex}function ei(e){return i(this,"_erasAbbrRegex")||ai.call(this),e?this._erasAbbrRegex:this._erasRegex}function ti(e){return i(this,"_erasNarrowRegex")||ai.call(this),e?this._erasNarrowRegex:this._erasRegex}function ni(e,t){return t.erasAbbrRegex(e)}function ii(e,t){return t.erasNameRegex(e)}function ri(e,t){return t.erasNarrowRegex(e)}function oi(e,t){return t._eraYearOrdinalRegex||Dr}function ai(){var e,t,n=[],i=[],r=[],o=[],a=this.eras();for(e=0,t=a.length;e<t;++e)i.push(J(a[e].name)),n.push(J(a[e].abbr)),r.push(J(a[e].narrow)),o.push(J(a[e].name)),o.push(J(a[e].abbr)),o.push(J(a[e].narrow));this._erasRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}function si(e,t){T(0,[e,e.length],0,t)}function li(e){return pi.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function ci(e){return pi.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function ui(){return Ce(this.year(),1,4)}function di(){return Ce(this.isoWeekYear(),1,4)}function hi(){var e=this.localeData()._week;return Ce(this.year(),e.dow,e.doy)}function fi(){var e=this.localeData()._week;return Ce(this.weekYear(),e.dow,e.doy)}function pi(e,t,n,i,r){var o;return null==e?xe(this,i,r).year:(o=Ce(e,i,r),t>o&&(t=o),mi.call(this,e,t,n,i,r))}function mi(e,t,n,i,r){var o=we(e,t,n,i,r),a=be(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function gi(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function vi(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function bi(e,t){t[Br]=q(1e3*("0."+e))}function yi(){return this._isUTC?"UTC":""}function wi(){return this._isUTC?"Coordinated Universal Time":""}function xi(e){return Et(1e3*e)}function Ci(){return Et.apply(null,arguments).parseZone()}function ki(e){return e}function _i(e,t,n,i){var r=it(),o=u().set(i,t);return r[n](o,e)}function Si(e,t,n){if(a(e)&&(t=e,e=void 0),e=e||"",null!=t)return _i(e,t,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=_i(e,i,n,"month");return r}function Ei(e,t,n,i){"boolean"==typeof e?(a(t)&&(n=t,t=void 0),t=t||""):(t=e,n=t,e=!1,a(t)&&(n=t,t=void 0),t=t||"");var r,o=it(),s=e?o._week.dow:0,l=[];if(null!=n)return _i(t,(n+s)%7,i,"day");for(r=0;r<7;r++)l[r]=_i(t,(r+s)%7,i,"day");return l}function Ti(e,t){return Si(e,t,"months")}function Di(e,t){return Si(e,t,"monthsShort")}function $i(e,t,n){return Ei(e,t,n,"weekdays")}function Ai(e,t,n){return Ei(e,t,n,"weekdaysShort")}function ji(e,t,n){return Ei(e,t,n,"weekdaysMin")}function Pi(){var e=this._data;return this._milliseconds=zo(this._milliseconds),this._days=zo(this._days),this._months=zo(this._months),e.milliseconds=zo(e.milliseconds),e.seconds=zo(e.seconds),e.minutes=zo(e.minutes),e.hours=zo(e.hours),e.months=zo(e.months),e.years=zo(e.years),this}function Oi(e,t,n,i){var r=Xt(t,n)
;return e._milliseconds+=i*r._milliseconds,e._days+=i*r._days,e._months+=i*r._months,e._bubble()}function Ii(e,t){return Oi(this,e,t,1)}function Mi(e,t){return Oi(this,e,t,-1)}function Ni(e){return e<0?Math.floor(e):Math.ceil(e)}function Fi(){var e,t,n,i,r,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*Ni(Li(s)+a),a=0,s=0),l.milliseconds=o%1e3,e=U(o/1e3),l.seconds=e%60,t=U(e/60),l.minutes=t%60,n=U(t/60),l.hours=n%24,a+=U(n/24),r=U(Ri(a)),s+=r,a-=Ni(Li(r)),i=U(s/12),s%=12,l.days=a,l.months=s,l.years=i,this}function Ri(e){return 4800*e/146097}function Li(e){return 146097*e/4800}function zi(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if("month"===(e=R(e))||"quarter"===e||"year"===e)switch(t=this._days+i/864e5,n=this._months+Ri(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Li(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}}function Hi(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12):NaN}function Bi(e){return function(){return this.as(e)}}function Ui(){return Xt(this)}function qi(e){return e=R(e),this.isValid()?this[e+"s"]():NaN}function Wi(e){return function(){return this.isValid()?this._data[e]:NaN}}function Vi(){return U(this.days()/7)}function Yi(e,t,n,i,r){return r.relativeTime(t||1,!!n,e,i)}function Gi(e,t,n,i){var r=Xt(e).abs(),o=ia(r.as("s")),a=ia(r.as("m")),s=ia(r.as("h")),l=ia(r.as("d")),c=ia(r.as("M")),u=ia(r.as("w")),d=ia(r.as("y")),h=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||a<=1&&["m"]||a<n.m&&["mm",a]||s<=1&&["h"]||s<n.h&&["hh",s]||l<=1&&["d"]||l<n.d&&["dd",l];return null!=n.w&&(h=h||u<=1&&["w"]||u<n.w&&["ww",u]),h=h||c<=1&&["M"]||c<n.M&&["MM",c]||d<=1&&["y"]||["yy",d],h[2]=t,h[3]=+e>0,h[4]=i,Yi.apply(null,h)}function Zi(e){return void 0===e?ia:"function"==typeof e&&(ia=e,!0)}function Qi(e,t){return void 0!==ra[e]&&(void 0===t?ra[e]:(ra[e]=t,"s"===e&&(ra.ss=t-1),!0))}function Ki(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,i,r=!1,o=ra;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(o=Object.assign({},ra,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),n=this.localeData(),i=Gi(this,!r,o,n),r&&(i=n.pastFuture(+this,i)),n.postformat(i)}function Xi(e){return(e>0)-(e<0)||+e}function Ji(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,i,r,o,a,s,l=oa(this._milliseconds)/1e3,c=oa(this._days),u=oa(this._months),d=this.asSeconds();return d?(e=U(l/60),t=U(e/60),l%=60,e%=60,n=U(u/12),u%=12,i=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=d<0?"-":"",o=Xi(this._months)!==Xi(d)?"-":"",a=Xi(this._days)!==Xi(d)?"-":"",s=Xi(this._milliseconds)!==Xi(d)?"-":"",r+"P"+(n?o+n+"Y":"")+(u?o+u+"M":"")+(c?a+c+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+i+"S":"")):"P0D"}var er,tr;tr=Array.prototype.some?Array.prototype.some:function(e){var t,n=Object(this),i=n.length>>>0;for(t=0;t<i;t++)if(t in n&&e.call(this,n[t],t,n))return!0;return!1};var nr=e.momentProperties=[],ir=!1,rr={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;var or;or=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)i(e,t)&&n.push(t);return n};var ar,sr={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},lr=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,cr=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ur={},dr={},hr={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"},fr=/\d{1,2}/,pr={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},mr={},gr={},vr=/\d/,br=/\d\d/,yr=/\d{3}/,wr=/\d{4}/,xr=/[+-]?\d{6}/,Cr=/\d\d?/,kr=/\d\d\d\d?/,_r=/\d\d\d\d\d\d?/,Sr=/\d{1,3}/,Er=/\d{1,4}/,Tr=/[+-]?\d{1,6}/,Dr=/\d+/,$r=/[+-]?\d+/,Ar=/Z|[+-]\d\d:?\d\d/gi,jr=/Z|[+-]\d\d(?::?\d\d)?/gi,Pr=/[+-]?\d+(\.\d{1,3})?/,Or=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;ar={};var Ir,Mr={},Nr=0,Fr=1,Rr=2,Lr=3,zr=4,Hr=5,Br=6,Ur=7,qr=8;Ir=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},T("M",["MM",2],"Mo",function(){return this.month()+1}),T("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),T("MMMM",0,0,function(e){return this.localeData().months(this,e)}),F("month","M"),z("month",8),Q("M",Cr),Q("MM",Cr,br),Q("MMM",function(e,t){return t.monthsShortRegex(e)}),Q("MMMM",function(e,t){return t.monthsRegex(e)}),ee(["M","MM"],function(e,t){t[Fr]=q(e)-1}),ee(["MMM","MMMM"],function(e,t,n,i){var r=n._locale.monthsParse(e,i,n._strict);null!=r?t[Fr]=r:h(n).invalidMonth=e});var Wr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Vr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yr=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Gr=Or,Zr=Or;T("Y",0,0,function(){var e=this.year();return e<=9999?E(e,4):"+"+e}),T(0,["YY",2],0,function(){return this.year()%100}),T(0,["YYYY",4],0,"year"),T(0,["YYYYY",5],0,"year"),T(0,["YYYYYY",6,!0],0,"year"),F("year","y"),z("year",1),Q("Y",$r),Q("YY",Cr,br),Q("YYYY",Er,wr),Q("YYYYY",Tr,xr),Q("YYYYYY",Tr,xr),ee(["YYYYY","YYYYYY"],Nr),ee("YYYY",function(t,n){n[Nr]=2===t.length?e.parseTwoDigitYear(t):q(t)}),ee("YY",function(t,n){n[Nr]=e.parseTwoDigitYear(t)}),ee("Y",function(e,t){t[Nr]=parseInt(e,10)}),e.parseTwoDigitYear=function(e){return q(e)+(q(e)>68?1900:2e3)};var Qr=W("FullYear",!0);T("w",["ww",2],"wo","week"),T("W",["WW",2],"Wo","isoWeek"),F("week","w"),F("isoWeek","W"),z("week",5),z("isoWeek",5),Q("w",Cr),Q("ww",Cr,br),Q("W",Cr),Q("WW",Cr,br),te(["w","ww","W","WW"],function(e,t,n,i){t[i.substr(0,1)]=q(e)});var Kr={dow:0,doy:6};T("d",0,"do","day"),T("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),T("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),T("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),T("e",0,0,"weekday"),T("E",0,0,"isoWeekday"),F("day","d"),F("weekday","e"),F("isoWeekday","E"),z("day",11),z("weekday",11),z("isoWeekday",11),Q("d",Cr),Q("e",Cr),Q("E",Cr),Q("dd",function(e,t){return t.weekdaysMinRegex(e)}),Q("ddd",function(e,t){return t.weekdaysShortRegex(e)}),Q("dddd",function(e,t){return t.weekdaysRegex(e)}),te(["dd","ddd","dddd"],function(e,t,n,i){var r=n._locale.weekdaysParse(e,i,n._strict);null!=r?t.d=r:h(n).invalidWeekday=e}),te(["d","e","E"],function(e,t,n,i){t[i]=q(e)});var Xr="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Jr="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),eo="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),to=Or,no=Or,io=Or;T("H",["HH",2],0,"hour"),T("h",["hh",2],0,Ue),T("k",["kk",2],0,qe),T("hmm",0,0,function(){return""+Ue.apply(this)+E(this.minutes(),2)}),T("hmmss",0,0,function(){return""+Ue.apply(this)+E(this.minutes(),2)+E(this.seconds(),2)}),T("Hmm",0,0,function(){return""+this.hours()+E(this.minutes(),2)}),T("Hmmss",0,0,function(){return""+this.hours()+E(this.minutes(),2)+E(this.seconds(),2)}),We("a",!0),We("A",!1),F("hour","h"),z("hour",13),Q("a",Ve),Q("A",Ve),Q("H",Cr),Q("h",Cr),Q("k",Cr),Q("HH",Cr,br),Q("hh",Cr,br),Q("kk",Cr,br),Q("hmm",kr),Q("hmmss",_r),Q("Hmm",kr),Q("Hmmss",_r),ee(["H","HH"],Lr),ee(["k","kk"],function(e,t,n){var i=q(e);t[Lr]=24===i?0:i}),ee(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),ee(["h","hh"],function(e,t,n){t[Lr]=q(e),h(n).bigHour=!0}),ee("hmm",function(e,t,n){var i=e.length-2;t[Lr]=q(e.substr(0,i)),t[zr]=q(e.substr(i)),h(n).bigHour=!0}),ee("hmmss",function(e,t,n){var i=e.length-4,r=e.length-2;t[Lr]=q(e.substr(0,i)),t[zr]=q(e.substr(i,2)),t[Hr]=q(e.substr(r)),h(n).bigHour=!0}),ee("Hmm",function(e,t,n){var i=e.length-2;t[Lr]=q(e.substr(0,i)),t[zr]=q(e.substr(i))}),ee("Hmmss",function(e,t,n){var i=e.length-4,r=e.length-2;t[Lr]=q(e.substr(0,i)),t[zr]=q(e.substr(i,2)),t[Hr]=q(e.substr(r))});var ro,oo=/[ap]\.?m?\.?/i,ao=W("Hours",!0),so={calendar:sr,longDateFormat:hr,invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:fr,relativeTime:pr,months:Wr,monthsShort:Vr,week:Kr,weekdays:Xr,weekdaysMin:eo,weekdaysShort:Jr,meridiemParse:oo},lo={},co={},uo=/^\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)?)?$/,ho=/^\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)?)?$/,fo=/Z|[+-]\d\d(?::?\d\d)?/,po=[["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}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],mo=[["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/]],go=/^\/?Date\((-?\d+)/i,vo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,bo={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};e.createFromInputFallback=y("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),e.ISO_8601=function(){},e.RFC_2822=function(){};var yo=y("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Et.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:p()}),wo=y("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=Et.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:p()}),xo=function(){return Date.now?Date.now():+new Date},Co=["year","quarter","month","week","day","hour","minute","second","millisecond"];Ft("Z",":"),Ft("ZZ",""),Q("Z",jr),Q("ZZ",jr),ee(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Rt(jr,e)});var ko=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var _o=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,So=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Xt.fn=Ot.prototype,Xt.invalid=Pt;var Eo=nn(1,"add"),To=nn(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var Do=y("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)}),$o=1e3,Ao=60*$o,jo=60*Ao,Po=3506328*jo;T("N",0,0,"eraAbbr"),T("NN",0,0,"eraAbbr"),T("NNN",0,0,"eraAbbr"),T("NNNN",0,0,"eraName"),T("NNNNN",0,0,"eraNarrow"),T("y",["y",1],"yo","eraYear"),T("y",["yy",2],0,"eraYear"),T("y",["yyy",3],0,"eraYear"),T("y",["yyyy",4],0,"eraYear"),Q("N",ni),Q("NN",ni),Q("NNN",ni),Q("NNNN",ii),Q("NNNNN",ri),ee(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,i){var r=n._locale.erasParse(e,i,n._strict);r?h(n).era=r:h(n).invalidEra=e}),Q("y",Dr),Q("yy",Dr),Q("yyy",Dr),Q("yyyy",Dr),Q("yo",oi),ee(["y","yy","yyy","yyyy"],Nr),ee(["yo"],function(e,t,n,i){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[Nr]=n._locale.eraYearOrdinalParse(e,r):t[Nr]=parseInt(e,10)}),T(0,["gg",2],0,function(){return this.weekYear()%100}),T(0,["GG",2],0,function(){return this.isoWeekYear()%100}),si("gggg","weekYear"),si("ggggg","weekYear"),si("GGGG","isoWeekYear"),si("GGGGG","isoWeekYear"),F("weekYear","gg"),F("isoWeekYear","GG"),z("weekYear",1),z("isoWeekYear",1),Q("G",$r),Q("g",$r),Q("GG",Cr,br),Q("gg",Cr,br),Q("GGGG",Er,wr),Q("gggg",Er,wr),Q("GGGGG",Tr,xr),Q("ggggg",Tr,xr),te(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,i){t[i.substr(0,2)]=q(e)}),te(["gg","GG"],function(t,n,i,r){n[r]=e.parseTwoDigitYear(t)}),T("Q",0,"Qo","quarter"),F("quarter","Q"),z("quarter",7),Q("Q",vr),ee("Q",function(e,t){t[Fr]=3*(q(e)-1)}),T("D",["DD",2],"Do","date"),F("date","D"),z("date",9),Q("D",Cr),Q("DD",Cr,br),Q("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),ee(["D","DD"],Rr),ee("Do",function(e,t){t[Rr]=q(e.match(Cr)[0])});var Oo=W("Date",!0);T("DDD",["DDDD",3],"DDDo","dayOfYear"),F("dayOfYear","DDD"),z("dayOfYear",4),Q("DDD",Sr),Q("DDDD",yr),ee(["DDD","DDDD"],function(e,t,n){n._dayOfYear=q(e)}),T("m",["mm",2],0,"minute"),F("minute","m"),z("minute",14),Q("m",Cr),Q("mm",Cr,br),ee(["m","mm"],zr);var Io=W("Minutes",!1);T("s",["ss",2],0,"second"),F("second","s"),z("second",15),Q("s",Cr),Q("ss",Cr,br),ee(["s","ss"],Hr);var Mo=W("Seconds",!1);T("S",0,0,function(){return~~(this.millisecond()/100)}),T(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),T(0,["SSS",3],0,"millisecond"),T(0,["SSSS",4],0,function(){return 10*this.millisecond()}),T(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),T(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),T(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),T(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),T(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),F("millisecond","ms"),z("millisecond",16),Q("S",Sr,vr),Q("SS",Sr,br),Q("SSS",Sr,yr);var No,Fo;for(No="SSSS";No.length<=9;No+="S")Q(No,Dr);for(No="S";No.length<=9;No+="S")ee(No,bi);Fo=W("Milliseconds",!1),T("z",0,0,"zoneAbbr"),T("zz",0,0,"zoneName");var Ro=g.prototype;Ro.add=Eo,Ro.calendar=dn,Ro.clone=hn,Ro.diff=yn,Ro.endOf=Mn,Ro.format=_n,Ro.from=Sn,Ro.fromNow=En,Ro.to=Tn,Ro.toNow=Dn,Ro.get=G,Ro.invalidAt=qn,Ro.isAfter=fn,Ro.isBefore=pn,Ro.isBetween=mn,Ro.isSame=gn,Ro.isSameOrAfter=vn,Ro.isSameOrBefore=bn,Ro.isValid=Bn,Ro.lang=Do,Ro.locale=$n,Ro.localeData=An,Ro.max=wo,Ro.min=yo,Ro.parsingFlags=Un,Ro.set=Z,Ro.startOf=In,Ro.subtract=To,Ro.toArray=Ln,Ro.toObject=zn,Ro.toDate=Rn,Ro.toISOString=Cn,Ro.inspect=kn,"undefined"!=typeof Symbol&&null!=Symbol.for&&(Ro[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ro.toJSON=Hn,Ro.toString=xn,Ro.unix=Fn,Ro.valueOf=Nn,Ro.creationData=Wn,Ro.eraName=Zn,Ro.eraNarrow=Qn,Ro.eraAbbr=Kn,Ro.eraYear=Xn,Ro.year=Qr,Ro.isLeapYear=ge,Ro.weekYear=li,Ro.isoWeekYear=ci,Ro.quarter=Ro.quarters=gi,Ro.month=ue,Ro.daysInMonth=de,Ro.week=Ro.weeks=Ee,Ro.isoWeek=Ro.isoWeeks=Te,Ro.weeksInYear=hi,Ro.weeksInWeekYear=fi,Ro.isoWeeksInYear=ui,Ro.isoWeeksInISOWeekYear=di,Ro.date=Oo,Ro.day=Ro.days=Ne,Ro.weekday=Fe,Ro.isoWeekday=Re,Ro.dayOfYear=vi,Ro.hour=Ro.hours=ao,Ro.minute=Ro.minutes=Io,Ro.second=Ro.seconds=Mo,Ro.millisecond=Ro.milliseconds=Fo,Ro.utcOffset=Ht,Ro.utc=Ut,Ro.local=qt,Ro.parseZone=Wt,Ro.hasAlignedHourOffset=Vt,Ro.isDST=Yt,Ro.isLocal=Zt,Ro.isUtcOffset=Qt,Ro.isUtc=Kt,Ro.isUTC=Kt,Ro.zoneAbbr=yi,Ro.zoneName=wi,Ro.dates=y("dates accessor is deprecated. Use date instead.",Oo),Ro.months=y("months accessor is deprecated. Use month instead",ue),Ro.years=y("years accessor is deprecated. Use year instead",Qr),Ro.zone=y("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Bt),Ro.isDSTShifted=y("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Gt);var Lo=_.prototype;Lo.calendar=S,Lo.longDateFormat=P,Lo.invalidDate=O,Lo.ordinal=I,Lo.preparse=ki,Lo.postformat=ki,Lo.relativeTime=M,Lo.pastFuture=N,Lo.set=C,Lo.eras=Vn,Lo.erasParse=Yn,Lo.erasConvertYear=Gn,Lo.erasAbbrRegex=ei,Lo.erasNameRegex=Jn,Lo.erasNarrowRegex=ti,Lo.months=oe,Lo.monthsShort=ae,Lo.monthsParse=le,Lo.monthsRegex=fe,Lo.monthsShortRegex=he,Lo.week=ke,Lo.firstDayOfYear=Se,Lo.firstDayOfWeek=_e,Lo.weekdays=je,Lo.weekdaysMin=Oe,Lo.weekdaysShort=Pe,Lo.weekdaysParse=Me,Lo.weekdaysRegex=Le,Lo.weekdaysShortRegex=ze,Lo.weekdaysMinRegex=He,Lo.isPM=Ye,Lo.meridiem=Ge,et("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===q(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),e.lang=y("moment.lang is deprecated. Use moment.locale instead.",et),e.langData=y("moment.langData is deprecated. Use moment.localeData instead.",it);var zo=Math.abs,Ho=Bi("ms"),Bo=Bi("s"),Uo=Bi("m"),qo=Bi("h"),Wo=Bi("d"),Vo=Bi("w"),Yo=Bi("M"),Go=Bi("Q"),Zo=Bi("y"),Qo=Wi("milliseconds"),Ko=Wi("seconds"),Xo=Wi("minutes"),Jo=Wi("hours"),ea=Wi("days"),ta=Wi("months"),na=Wi("years"),ia=Math.round,ra={ss:44,s:45,m:45,h:22,d:26,w:null,M:11},oa=Math.abs,aa=Ot.prototype;return aa.isValid=jt,aa.abs=Pi,aa.add=Ii,aa.subtract=Mi,aa.as=zi,aa.asMilliseconds=Ho,aa.asSeconds=Bo,aa.asMinutes=Uo,aa.asHours=qo,aa.asDays=Wo,aa.asWeeks=Vo,aa.asMonths=Yo,aa.asQuarters=Go,aa.asYears=Zo,aa.valueOf=Hi,aa._bubble=Fi,aa.clone=Ui,aa.get=qi,aa.milliseconds=Qo,aa.seconds=Ko,aa.minutes=Xo,aa.hours=Jo,aa.days=ea,aa.weeks=Vi,aa.months=ta,aa.years=na,aa.humanize=Ki,aa.toISOString=Ji,aa.toString=Ji,aa.toJSON=Ji,aa.locale=$n,aa.localeData=An,aa.toIsoString=y("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ji),aa.lang=Do,T("X",0,0,"unix"),T("x",0,0,"valueOf"),Q("x",$r),Q("X",Pr),ee("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),ee("x",function(e,t,n){n._d=new Date(q(e))}),e.version="2.29.4",function(e){er=e}(Et),e.fn=Ro,e.min=Dt,e.max=$t,e.now=xo,e.utc=u,e.unix=xi,e.months=Ti,e.isDate=s,e.locale=et,e.invalid=p,e.duration=Xt,e.isMoment=v,e.weekdays=$i,e.parseZone=Ci,e.localeData=it,e.isDuration=It,e.monthsShort=Di,e.weekdaysMin=ji,e.defineLocale=tt,e.updateLocale=nt,e.locales=rt,e.weekdaysShort=Ai,e.normalizeUnits=R,e.relativeTimeRounding=Zi,e.relativeTimeThreshold=Qi,e.calendarFormat=un,e.prototype=Ro,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e}),function(e){"use strict";if("function"==typeof define&&define.amd)define("datepicker",["jquery","moment"],e);else if("object"==typeof exports)module.exports=e(require("jquery"),require("moment"));else{if("undefined"==typeof jQuery)throw"bootstrap-datetimepicker requires jQuery to be loaded first";if("undefined"==typeof moment)throw"bootstrap-datetimepicker requires Moment.js to be loaded first";e(jQuery,moment)}}(function(e,t){"use strict";function n(n,i){function r(){return void 0!==t.tz&&void 0!==i.timeZone&&null!==i.timeZone&&""!==i.timeZone}function o(e){var n;return n=null==e?t():t.isDate(e)||t.isMoment(e)?t(e):r()?t.tz(e,F,i.useStrict,i.timeZone):t(e,F,i.useStrict),r()&&n.tz(i.timeZone),n}function a(e){if("string"!=typeof e||1<e.length)throw new TypeError("isEnabled expects a single character string parameter");switch(e){case"y":return-1!==N.indexOf("Y");case"M":return-1!==N.indexOf("M");case"d":return-1!==N.toLowerCase().indexOf("d");case"h":case"H":return-1!==N.toLowerCase().indexOf("h");case"m":return-1!==N.indexOf("m");case"s":return-1!==N.indexOf("s");default:return!1}}function s(){return a("h")||a("m")||a("s")}function l(){return a("y")||a("M")||a("d")}function c(){var t,n,r,o=e("<div>").addClass("timepicker-hours").append(e("<table>").addClass("table-condensed")),s=e("<div>").addClass("timepicker-minutes").append(e("<table>").addClass("table-condensed")),l=e("<div>").addClass("timepicker-seconds").append(e("<table>").addClass("table-condensed")),c=[(t=e("<tr>"),n=e("<tr>"),r=e("<tr>"),a("h")&&(t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.incrementHour}).addClass("btn").attr("data-action","incrementHours").append(e("<span>").addClass(i.icons.up)))),n.append(e("<td>").append(e("<span>").addClass("timepicker-hour").attr({"data-time-component":"hours",title:i.tooltips.pickHour}).attr("data-action","showHours"))),r.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.decrementHour}).addClass("btn").attr("data-action","decrementHours").append(e("<span>").addClass(i.icons.down))))),a("m")&&(a("h")&&(t.append(e("<td>").addClass("separator")),n.append(e("<td>").addClass("separator").html(":")),r.append(e("<td>").addClass("separator"))),t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.incrementMinute}).addClass("btn").attr("data-action","incrementMinutes").append(e("<span>").addClass(i.icons.up)))),n.append(e("<td>").append(e("<span>").addClass("timepicker-minute").attr({"data-time-component":"minutes",title:i.tooltips.pickMinute}).attr("data-action","showMinutes"))),r.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.decrementMinute}).addClass("btn").attr("data-action","decrementMinutes").append(e("<span>").addClass(i.icons.down))))),a("s")&&(a("m")&&(t.append(e("<td>").addClass("separator")),n.append(e("<td>").addClass("separator").html(":")),r.append(e("<td>").addClass("separator"))),t.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.incrementSecond}).addClass("btn").attr("data-action","incrementSeconds").append(e("<span>").addClass(i.icons.up)))),n.append(e("<td>").append(e("<span>").addClass("timepicker-second").attr({"data-time-component":"seconds",title:i.tooltips.pickSecond}).attr("data-action","showSeconds"))),r.append(e("<td>").append(e("<a>").attr({href:"#",tabindex:"-1",title:i.tooltips.decrementSecond}).addClass("btn").attr("data-action","decrementSeconds").append(e("<span>").addClass(i.icons.down))))),M||(t.append(e("<td>").addClass("separator")),n.append(e("<td>").append(e("<button>").addClass("btn btn-primary").attr({"data-action":"togglePeriod",tabindex:"-1",title:i.tooltips.togglePeriod}))),r.append(e("<td>").addClass("separator"))),e("<div>").addClass("timepicker-picker").append(e("<table>").addClass("table-condensed").append([t,n,r])))];return a("h")&&c.push(o),a("m")&&c.push(s),a("s")&&c.push(l),c}function u(){var t,n,r,o=e("<div>").addClass("bootstrap-datetimepicker-widget dropdown-menu"),u=e("<div>").addClass("datepicker").append((n=e("<thead>").append(e("<tr>").append(e("<th>").addClass("prev").attr("data-action","previous").append(e("<span>").addClass(i.icons.previous))).append(e("<th>").addClass("picker-switch").attr("data-action","pickerSwitch").attr("colspan",i.calendarWeeks?"6":"5")).append(e("<th>").addClass("next").attr("data-action","next").append(e("<span>").addClass(i.icons.next)))),r=e("<tbody>").append(e("<tr>").append(e("<td>").attr("colspan",i.calendarWeeks?"8":"7"))),[e("<div>").addClass("datepicker-days").append(e("<table>").addClass("table-condensed").append(n).append(e("<tbody>"))),e("<div>").addClass("datepicker-months").append(e("<table>").addClass("table-condensed").append(n.clone()).append(r.clone())),e("<div>").addClass("datepicker-years").append(e("<table>").addClass("table-condensed").append(n.clone()).append(r.clone())),e("<div>").addClass("datepicker-decades").append(e("<table>").addClass("table-condensed").append(n.clone()).append(r.clone()))])),d=e("<div>").addClass("timepicker").append(c()),h=e("<ul>").addClass("list-unstyled"),f=e("<li>").addClass("picker-switch"+(i.collapse?" accordion-toggle":"")).append((t=[],i.showTodayButton&&t.push(e("<td>").append(e("<a>").attr({"data-action":"today",title:i.tooltips.today}).append(e("<span>").addClass(i.icons.today)))),!i.sideBySide&&l()&&s()&&t.push(e("<td>").append(e("<a>").attr({"data-action":"togglePicker",title:i.tooltips.selectTime}).append(e("<span>").addClass(i.icons.time)))),i.showClear&&t.push(e("<td>").append(e("<a>").attr({"data-action":"clear",title:i.tooltips.clear}).append(e("<span>").addClass(i.icons.clear)))),i.showClose&&t.push(e("<td>").append(e("<a>").attr({"data-action":"close",title:i.tooltips.close}).append(e("<span>").addClass(i.icons.close)))),e("<table>").addClass("table-condensed").append(e("<tbody>").append(e("<tr>").append(t)))));return i.inline&&o.removeClass("dropdown-menu"),M&&o.addClass("usetwentyfour"),a("s")&&!M&&o.addClass("wider"),i.sideBySide&&l()&&s()?(o.addClass("timepicker-sbs"),"top"===i.toolbarPlacement&&o.append(f),o.append(e("<div>").addClass("row").append(u.addClass("col-md-6")).append(d.addClass("col-md-6"))),"bottom"===i.toolbarPlacement&&o.append(f),o):("top"===i.toolbarPlacement&&h.append(f),l()&&h.append(e("<li>").addClass(i.collapse&&s()?"collapse in":"").append(u)),"default"===i.toolbarPlacement&&h.append(f),s()&&h.append(e("<li>").addClass(i.collapse&&l()?"collapse":"").append(d)),"bottom"===i.toolbarPlacement&&h.append(f),o.append(h))}function d(){var t,r=(U||n).position(),o=(U||n).offset(),a=i.widgetPositioning.vertical,s=i.widgetPositioning.horizontal;if(i.widgetParent)t=i.widgetParent.append(q);else if(n.is("input"))t=n.after(q).parent();else{if(i.inline)return void(t=n.append(q));(t=n).children().first().after(q)}if("auto"===a&&(a=o.top+1.5*q.height()>=e(window).height()+e(window).scrollTop()&&q.height()+n.outerHeight()<o.top?"top":"bottom"),"auto"===s&&(s=t.width()<o.left+q.outerWidth()/2&&o.left+q.outerWidth()>e(window).width()?"right":"left"),"top"===a?q.addClass("top").removeClass("bottom"):q.addClass("bottom").removeClass("top"),"right"===s?q.addClass("pull-right"):q.removeClass("pull-right"),"static"===t.css("position")&&(t=t.parents().filter(function(){return"static"!==e(this).css("position")}).first()),0===t.length)throw new Error("datetimepicker component should be placed within a non-static positioned container");q.css({top:"top"===a?"auto":r.top+n.outerHeight(),bottom:"top"===a?t.outerHeight()-(t===n?0:r.top):"auto",left:"left"===s?t===n?0:r.left:"auto",right:"left"===s?"auto":t.outerWidth()-n.outerWidth()-(t===n?0:r.left)})}function h(e){"dp.change"===e.type&&(e.date&&e.date.isSame(e.oldDate)||!e.date&&!e.oldDate)||n.trigger(e)}function f(e){"y"===e&&(e="YYYY"),h({type:"dp.update",change:e,viewDate:O.clone()})}function p(e){q&&(e&&(R=Math.max(W,Math.min(3,R+e))),q.find(".datepicker > div").hide().filter(".datepicker-"+V[R].clsName).show())}function m(t,n){var r,o,a,s;if(t.isValid()&&!(i.disabledDates&&"d"===n&&(r=t,!0===i.disabledDates[r.format("YYYY-MM-DD")])||i.enabledDates&&"d"===n&&(o=t,!0!==i.enabledDates[o.format("YYYY-MM-DD")])||i.minDate&&t.isBefore(i.minDate,n)||i.maxDate&&t.isAfter(i.maxDate,n)||i.daysOfWeekDisabled&&"d"===n&&-1!==i.daysOfWeekDisabled.indexOf(t.day())||i.disabledHours&&("h"===n||"m"===n||"s"===n)&&(a=t,!0===i.disabledHours[a.format("H")])||i.enabledHours&&("h"===n||"m"===n||"s"===n)&&(s=t,!0!==i.enabledHours[s.format("H")]))){if(i.disabledTimeIntervals&&("h"===n||"m"===n||"s"===n)){var l=!1;if(e.each(i.disabledTimeIntervals,function(){if(t.isBetween(this[0],this[1]))return!(l=!0)}),l)return}return 1}}function g(){var n,r,a,s=q.find(".datepicker-days"),c=s.find("th"),u=[],d=[];if(l()){for(c.eq(0).find("span").attr("title",i.tooltips.prevMonth),c.eq(1).attr("title",i.tooltips.selectMonth),c.eq(2).find("span").attr("title",i.tooltips.nextMonth),s.find(".disabled").removeClass("disabled"),c.eq(1).text(O.format(i.dayViewHeaderFormat)),m(O.clone().subtract(1,"M"),"M")||c.eq(0).addClass("disabled"),m(O.clone().add(1,"M"),"M")||c.eq(2).addClass("disabled"),n=O.clone().startOf("M").startOf("w").startOf("d"),a=0;a<42;a++)0===n.weekday()&&(r=e("<tr>"),i.calendarWeeks&&r.append('<td class="cw">'+n.week()+"</td>"),u.push(r)),d=["day"],n.isBefore(O,"M")&&d.push("old"),n.isAfter(O,"M")&&d.push("new"),n.isSame(P,"d")&&!B&&d.push("active"),m(n,"d")||d.push("disabled"),n.isSame(o(),"d")&&d.push("today"),0!==n.day()&&6!==n.day()||d.push("weekend"),h({type:"dp.classify",date:n,classNames:d}),r.append('<td data-action="selectDay" data-day="'+n.format("L")+'" class="'+d.join(" ")+'">'+n.date()+"</td>"),n.add(1,"d");var f,p,g;s.find("tbody").empty().append(u),f=q.find(".datepicker-months"),p=f.find("th"),g=f.find("tbody").find("span"),p.eq(0).find("span").attr("title",i.tooltips.prevYear),p.eq(1).attr("title",i.tooltips.selectYear),p.eq(2).find("span").attr("title",i.tooltips.nextYear),f.find(".disabled").removeClass("disabled"),m(O.clone().subtract(1,"y"),"y")||p.eq(0).addClass("disabled"),p.eq(1).text(O.year()),m(O.clone().add(1,"y"),"y")||p.eq(2).addClass("disabled"),g.removeClass("active"),P.isSame(O,"y")&&!B&&g.eq(P.month()).addClass("active"),g.each(function(t){m(O.clone().month(t),"M")||e(this).addClass("disabled")}),function(){var e=q.find(".datepicker-years"),t=e.find("th"),n=O.clone().subtract(5,"y"),r=O.clone().add(6,"y"),o="";for(t.eq(0).find("span").attr("title",i.tooltips.prevDecade),t.eq(1).attr("title",i.tooltips.selectDecade),t.eq(2).find("span").attr("title",i.tooltips.nextDecade),e.find(".disabled").removeClass("disabled"),i.minDate&&i.minDate.isAfter(n,"y")&&t.eq(0).addClass("disabled"),t.eq(1).text(n.year()+"-"+r.year()),i.maxDate&&i.maxDate.isBefore(r,"y")&&t.eq(2).addClass("disabled");!n.isAfter(r,"y");)o+='<span data-action="selectYear" class="year'+(n.isSame(P,"y")&&!B?" active":"")+(m(n,"y")?"":" disabled")+'">'+n.year()+"</span>",n.add(1,"y");e.find("td").html(o)}(),function(){var e,n=q.find(".datepicker-decades"),r=n.find("th"),o=t({y:O.year()-O.year()%100-1}),a=o.clone().add(100,"y"),s=o.clone(),l=!1,c=!1,u="";for(r.eq(0).find("span").attr("title",i.tooltips.prevCentury),r.eq(2).find("span").attr("title",i.tooltips.nextCentury),n.find(".disabled").removeClass("disabled"),(o.isSame(t({y:1900}))||i.minDate&&i.minDate.isAfter(o,"y"))&&r.eq(0).addClass("disabled"),r.eq(1).text(o.year()+"-"+a.year()),(o.isSame(t({y:2e3}))||i.maxDate&&i.maxDate.isBefore(a,"y"))&&r.eq(2).addClass("disabled");!o.isAfter(a,"y");)e=o.year()+12,l=i.minDate&&i.minDate.isAfter(o,"y")&&i.minDate.year()<=e,c=i.maxDate&&i.maxDate.isAfter(o,"y")&&i.maxDate.year()<=e,u+='<span data-action="selectDecade" class="decade'+(P.isAfter(o)&&P.year()<=e?" active":"")+(m(o,"y")||l||c?"":" disabled")+'" data-selection="'+(o.year()+6)+'">'+(o.year()+1)+" - "+(o.year()+12)+"</span>",o.add(12,"y");u+="<span></span><span></span><span></span>",n.find("td").html(u),r.eq(1).text(s.year()+1+"-"+o.year())}()}}function v(){var t,n,r=q.find(".timepicker span[data-time-component]");M||(t=q.find(".timepicker [data-action=togglePeriod]"),n=P.clone().add(12<=P.hours()?-12:12,"h"),t.text(P.format("A")),m(n,"h")?t.removeClass("disabled"):t.addClass("disabled")),r.filter("[data-time-component=hours]").text(P.format(M?"HH":"hh")),r.filter("[data-time-component=minutes]").text(P.format("mm")),r.filter("[data-time-component=seconds]").text(P.format("ss")),function(){var t=q.find(".timepicker-hours table"),n=O.clone().startOf("d"),i=[],r=e("<tr>");for(11<O.hour()&&!M&&n.hour(12);n.isSame(O,"d")&&(M||O.hour()<12&&n.hour()<12||11<O.hour());)n.hour()%4==0&&(r=e("<tr>"),i.push(r)),
r.append('<td data-action="selectHour" class="hour'+(m(n,"h")?"":" disabled")+'">'+n.format(M?"HH":"hh")+"</td>"),n.add(1,"h");t.empty().append(i)}(),function(){for(var t=q.find(".timepicker-minutes table"),n=O.clone().startOf("h"),r=[],o=e("<tr>"),a=1===i.stepping?5:i.stepping;O.isSame(n,"h");)n.minute()%(4*a)==0&&(o=e("<tr>"),r.push(o)),o.append('<td data-action="selectMinute" class="minute'+(m(n,"m")?"":" disabled")+'">'+n.format("mm")+"</td>"),n.add(a,"m");t.empty().append(r)}(),function(){for(var t=q.find(".timepicker-seconds table"),n=O.clone().startOf("m"),i=[],r=e("<tr>");O.isSame(n,"m");)n.second()%20==0&&(r=e("<tr>"),i.push(r)),r.append('<td data-action="selectSecond" class="second'+(m(n,"s")?"":" disabled")+'">'+n.format("ss")+"</td>"),n.add(5,"s");t.empty().append(i)}()}function b(){q&&(g(),v())}function y(e){var t=B?null:P;if(!e)return B=!0,I.val(""),n.data("date",""),h({type:"dp.change",date:!1,oldDate:t}),void b();if(e=e.clone().locale(i.locale),r()&&e.tz(i.timeZone),1!==i.stepping)for(e.minutes(Math.round(e.minutes()/i.stepping)*i.stepping).seconds(0);i.minDate&&e.isBefore(i.minDate);)e.add(i.stepping,"minutes");m(e)?(O=(P=e).clone(),I.val(P.format(N)),n.data("date",P.format(N)),B=!1,b(),h({type:"dp.change",date:P.clone(),oldDate:t})):(i.keepInvalid?h({type:"dp.change",date:e,oldDate:t}):I.val(B?"":P.format(N)),h({type:"dp.error",date:e,oldDate:t}))}function w(){var t=!1;return q?(q.find(".collapse").each(function(){var n=e(this).data("collapse");return!n||!n.transitioning||!(t=!0)}),t||(U&&U.hasClass("btn")&&U.toggleClass("active"),q.hide(),e(window).off("resize",d),q.off("click","[data-action]"),q.off("mousedown",!1),q.remove(),q=!1,h({type:"dp.hide",date:P.clone()}),I.blur(),O=P.clone()),H):H}function x(){y(null)}function C(e){return void 0===i.parseInputDate?(!t.isMoment(e)||e instanceof Date)&&(e=o(e)):e=i.parseInputDate(e),e}function k(t){return e(t.currentTarget).is(".disabled")||J[e(t.currentTarget).data("action")].apply(H,arguments),!1}function _(){var t;return I.prop("disabled")||!i.ignoreReadonly&&I.prop("readonly")||q||(void 0!==I.val()&&0!==I.val().trim().length?y(C(I.val().trim())):B&&i.useCurrent&&(i.inline||I.is("input")&&0===I.val().trim().length)&&(t=o(),"string"==typeof i.useCurrent&&(t={year:function(e){return e.month(0).date(1).hours(0).seconds(0).minutes(0)},month:function(e){return e.date(1).hours(0).seconds(0).minutes(0)},day:function(e){return e.hours(0).seconds(0).minutes(0)},hour:function(e){return e.seconds(0).minutes(0)},minute:function(e){return e.seconds(0)}}[i.useCurrent](t)),y(t)),q=u(),function(){var t=e("<tr>"),n=O.clone().startOf("w").startOf("d");for(!0===i.calendarWeeks&&t.append(e("<th>").addClass("cw").text("#"));n.isBefore(O.clone().endOf("w"));)t.append(e("<th>").addClass("dow").text(n.format("dd"))),n.add(1,"d");q.find(".datepicker-days thead").append(t)}(),function(){for(var t=[],n=O.clone().startOf("y").startOf("d");n.isSame(O,"y");)t.push(e("<span>").attr("data-action","selectMonth").addClass("month").text(n.format("MMM"))),n.add(1,"M");q.find(".datepicker-months td").empty().append(t)}(),q.find(".timepicker-hours").hide(),q.find(".timepicker-minutes").hide(),q.find(".timepicker-seconds").hide(),b(),p(),e(window).on("resize",d),q.on("click","[data-action]",k),q.on("mousedown",!1),U&&U.hasClass("btn")&&U.toggleClass("active"),d(),q.show(),i.focusOnShow&&!I.is(":focus")&&I.focus(),h({type:"dp.show"})),H}function S(){return(q?w:_)()}function E(e){var t,n,r,o,a=null,s=[],l={},c=e.which;for(t in X[c]="p",X)X.hasOwnProperty(t)&&"p"===X[t]&&(s.push(t),parseInt(t,10)!==c&&(l[t]=!0));for(t in i.keyBinds)if(i.keyBinds.hasOwnProperty(t)&&"function"==typeof i.keyBinds[t]&&(r=t.split(" ")).length===s.length&&K[c]===r[r.length-1]){for(o=!0,n=r.length-2;0<=n;n--)if(!(K[r[n]]in l)){o=!1;break}if(o){a=i.keyBinds[t];break}}a&&(a.call(H,q),e.stopPropagation(),e.preventDefault())}function T(e){X[e.which]="r",e.stopPropagation(),e.preventDefault()}function D(t){var n=e(t.target).val().trim();return y(n?C(n):null),t.stopImmediatePropagation(),!1}function $(t){var n={};return e.each(t,function(){var e=C(this);e.isValid()&&(n[e.format("YYYY-MM-DD")]=!0)}),!!Object.keys(n).length&&n}function A(t){var n={};return e.each(t,function(){n[this]=!0}),!!Object.keys(n).length&&n}function j(){var e=i.format||"L LT";N=e.replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return(P.localeData().longDateFormat(e)||e).replace(/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,function(e){return P.localeData().longDateFormat(e)||e})}),(F=i.extraFormats?i.extraFormats.slice():[]).indexOf(e)<0&&F.indexOf(N)<0&&F.push(N),M=N.toLowerCase().indexOf("a")<1&&N.replace(/\[.*?\]/g,"").indexOf("h")<1,a("y")&&(W=2),a("M")&&(W=1),a("d")&&(W=0),R=Math.max(W,R),B||y(P)}var P,O,I,M,N,F,R,L,z,H={},B=!0,U=!1,q=!1,W=0,V=[{clsName:"days",navFnc:"M",navStep:1},{clsName:"months",navFnc:"y",navStep:1},{clsName:"years",navFnc:"y",navStep:10},{clsName:"decades",navFnc:"y",navStep:100}],Y=["days","months","years","decades"],G=["top","bottom","auto"],Z=["left","right","auto"],Q=["default","top","bottom"],K={up:38,38:"up",down:40,40:"down",left:37,37:"left",right:39,39:"right",tab:9,9:"tab",escape:27,27:"escape",enter:13,13:"enter",pageUp:33,33:"pageUp",pageDown:34,34:"pageDown",shift:16,16:"shift",control:17,17:"control",space:32,32:"space",t:84,84:"t",delete:46,46:"delete"},X={},J={next:function(){var e=V[R].navFnc;O.add(V[R].navStep,e),g(),f(e)},previous:function(){var e=V[R].navFnc;O.subtract(V[R].navStep,e),g(),f(e)},pickerSwitch:function(){p(1)},selectMonth:function(t){var n=e(t.target).closest("tbody").find("span").index(e(t.target));O.month(n),R===W?(y(P.clone().year(O.year()).month(O.month())),i.inline||w()):(p(-1),g()),f("M")},selectYear:function(t){var n=parseInt(e(t.target).text(),10)||0;O.year(n),R===W?(y(P.clone().year(O.year())),i.inline||w()):(p(-1),g()),f("YYYY")},selectDecade:function(t){var n=parseInt(e(t.target).data("selection"),10)||0;O.year(n),R===W?(y(P.clone().year(O.year())),i.inline||w()):(p(-1),g()),f("YYYY")},selectDay:function(t){var n=O.clone();e(t.target).is(".old")&&n.subtract(1,"M"),e(t.target).is(".new")&&n.add(1,"M"),y(n.date(parseInt(e(t.target).text(),10))),s()||i.keepOpen||i.inline||w()},incrementHours:function(){var e=P.clone().add(1,"h");m(e,"h")&&y(e)},incrementMinutes:function(){var e=P.clone().add(i.stepping,"m");m(e,"m")&&y(e)},incrementSeconds:function(){var e=P.clone().add(1,"s");m(e,"s")&&y(e)},decrementHours:function(){var e=P.clone().subtract(1,"h");m(e,"h")&&y(e)},decrementMinutes:function(){var e=P.clone().subtract(i.stepping,"m");m(e,"m")&&y(e)},decrementSeconds:function(){var e=P.clone().subtract(1,"s");m(e,"s")&&y(e)},togglePeriod:function(){y(P.clone().add(12<=P.hours()?-12:12,"h"))},togglePicker:function(t){var n,r=e(t.target),o=r.closest("ul"),a=o.find(".in"),s=o.find(".collapse:not(.in)");if(a&&a.length){if((n=a.data("collapse"))&&n.transitioning)return;a.collapse?(a.collapse("hide"),s.collapse("show")):(a.removeClass("in"),s.addClass("in")),r.is("span")?r.toggleClass(i.icons.time+" "+i.icons.date):r.find("span").toggleClass(i.icons.time+" "+i.icons.date)}},showPicker:function(){q.find(".timepicker > div:not(.timepicker-picker)").hide(),q.find(".timepicker .timepicker-picker").show()},showHours:function(){q.find(".timepicker .timepicker-picker").hide(),q.find(".timepicker .timepicker-hours").show()},showMinutes:function(){q.find(".timepicker .timepicker-picker").hide(),q.find(".timepicker .timepicker-minutes").show()},showSeconds:function(){q.find(".timepicker .timepicker-picker").hide(),q.find(".timepicker .timepicker-seconds").show()},selectHour:function(t){var n=parseInt(e(t.target).text(),10);M||(12<=P.hours()?12!==n&&(n+=12):12===n&&(n=0)),y(P.clone().hours(n)),J.showPicker.call(H)},selectMinute:function(t){y(P.clone().minutes(parseInt(e(t.target).text(),10))),J.showPicker.call(H)},selectSecond:function(t){y(P.clone().seconds(parseInt(e(t.target).text(),10))),J.showPicker.call(H)},clear:x,today:function(){var e=o();m(e,"d")&&y(e)},close:w};if(H.destroy=function(){w(),I.off({change:D,blur:blur,keydown:E,keyup:T,focus:i.allowInputToggle?w:""}),n.is("input")?I.off({focus:_}):U&&(U.off("click",S),U.off("mousedown",!1)),n.removeData("DateTimePicker"),n.removeData("date")},H.toggle=S,H.show=_,H.hide=w,H.disable=function(){return w(),U&&U.hasClass("btn")&&U.addClass("disabled"),I.prop("disabled",!0),H},H.enable=function(){return U&&U.hasClass("btn")&&U.removeClass("disabled"),I.prop("disabled",!1),H},H.ignoreReadonly=function(e){if(0===arguments.length)return i.ignoreReadonly;if("boolean"!=typeof e)throw new TypeError("ignoreReadonly () expects a boolean parameter");return i.ignoreReadonly=e,H},H.options=function(t){if(0===arguments.length)return e.extend(!0,{},i);if(!(t instanceof Object))throw new TypeError("options() options parameter should be an object");return e.extend(!0,i,t),e.each(i,function(e,t){if(void 0===H[e])throw new TypeError("option "+e+" is not recognized!");H[e](t)}),H},H.date=function(e){if(0===arguments.length)return B?null:P.clone();if(!(null===e||"string"==typeof e||t.isMoment(e)||e instanceof Date))throw new TypeError("date() parameter must be one of [null, string, moment or Date]");return y(null===e?null:C(e)),H},H.format=function(e){if(0===arguments.length)return i.format;if("string"!=typeof e&&("boolean"!=typeof e||!1!==e))throw new TypeError("format() expects a string or boolean:false parameter "+e);return i.format=e,N&&j(),H},H.timeZone=function(e){if(0===arguments.length)return i.timeZone;if("string"!=typeof e)throw new TypeError("newZone() expects a string parameter");return i.timeZone=e,H},H.dayViewHeaderFormat=function(e){if(0===arguments.length)return i.dayViewHeaderFormat;if("string"!=typeof e)throw new TypeError("dayViewHeaderFormat() expects a string parameter");return i.dayViewHeaderFormat=e,H},H.extraFormats=function(e){if(0===arguments.length)return i.extraFormats;if(!1!==e&&!(e instanceof Array))throw new TypeError("extraFormats() expects an array or false parameter");return i.extraFormats=e,F&&j(),H},H.disabledDates=function(t){if(0===arguments.length)return i.disabledDates?e.extend({},i.disabledDates):i.disabledDates;if(!t)return i.disabledDates=!1,b(),H;if(!(t instanceof Array))throw new TypeError("disabledDates() expects an array parameter");return i.disabledDates=$(t),i.enabledDates=!1,b(),H},H.enabledDates=function(t){if(0===arguments.length)return i.enabledDates?e.extend({},i.enabledDates):i.enabledDates;if(!t)return i.enabledDates=!1,b(),H;if(!(t instanceof Array))throw new TypeError("enabledDates() expects an array parameter");return i.enabledDates=$(t),i.disabledDates=!1,b(),H},H.daysOfWeekDisabled=function(e){if(0===arguments.length)return i.daysOfWeekDisabled.splice(0);if("boolean"==typeof e&&!e)return i.daysOfWeekDisabled=!1,b(),H;if(!(e instanceof Array))throw new TypeError("daysOfWeekDisabled() expects an array parameter");if(i.daysOfWeekDisabled=e.reduce(function(e,t){return 6<(t=parseInt(t,10))||t<0||isNaN(t)||-1===e.indexOf(t)&&e.push(t),e},[]).sort(),i.useCurrent&&!i.keepInvalid){for(var t=0;!m(P,"d");){if(P.add(1,"d"),31===t)throw"Tried 31 times to find a valid date";t++}y(P)}return b(),H},H.maxDate=function(e){if(0===arguments.length)return i.maxDate?i.maxDate.clone():i.maxDate;if("boolean"==typeof e&&!1===e)return i.maxDate=!1,b(),H;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=o()));var t=C(e);if(!t.isValid())throw new TypeError("maxDate() Could not parse date parameter: "+e);if(i.minDate&&t.isBefore(i.minDate))throw new TypeError("maxDate() date parameter is before options.minDate: "+t.format(N));return i.maxDate=t,i.useCurrent&&!i.keepInvalid&&P.isAfter(e)&&y(i.maxDate),O.isAfter(t)&&(O=t.clone().subtract(i.stepping,"m")),b(),H},H.minDate=function(e){if(0===arguments.length)return i.minDate?i.minDate.clone():i.minDate;if("boolean"==typeof e&&!1===e)return i.minDate=!1,b(),H;"string"==typeof e&&("now"!==e&&"moment"!==e||(e=o()));var t=C(e);if(!t.isValid())throw new TypeError("minDate() Could not parse date parameter: "+e);if(i.maxDate&&t.isAfter(i.maxDate))throw new TypeError("minDate() date parameter is after options.maxDate: "+t.format(N));return i.minDate=t,i.useCurrent&&!i.keepInvalid&&P.isBefore(e)&&y(i.minDate),O.isBefore(t)&&(O=t.clone().add(i.stepping,"m")),b(),H},H.defaultDate=function(e){if(0===arguments.length)return i.defaultDate?i.defaultDate.clone():i.defaultDate;if(!e)return i.defaultDate=!1,H;"string"==typeof e&&(e="now"===e||"moment"===e?o():o(e));var t=C(e);if(!t.isValid())throw new TypeError("defaultDate() Could not parse date parameter: "+e);if(!m(t))throw new TypeError("defaultDate() date passed is invalid according to component setup validations");return i.defaultDate=t,(i.defaultDate&&i.inline||""===I.val().trim())&&y(i.defaultDate),H},H.locale=function(e){if(0===arguments.length)return i.locale;if(!t.localeData(e))throw new TypeError("locale() locale "+e+" is not loaded from moment locales!");return i.locale=e,P.locale(i.locale),O.locale(i.locale),N&&j(),q&&(w(),_()),H},H.stepping=function(e){return 0===arguments.length?i.stepping:(e=parseInt(e,10),(isNaN(e)||e<1)&&(e=1),i.stepping=e,H)},H.useCurrent=function(e){var t=["year","month","day","hour","minute"];if(0===arguments.length)return i.useCurrent;if("boolean"!=typeof e&&"string"!=typeof e)throw new TypeError("useCurrent() expects a boolean or string parameter");if("string"==typeof e&&-1===t.indexOf(e.toLowerCase()))throw new TypeError("useCurrent() expects a string parameter of "+t.join(", "));return i.useCurrent=e,H},H.collapse=function(e){if(0===arguments.length)return i.collapse;if("boolean"!=typeof e)throw new TypeError("collapse() expects a boolean parameter");return i.collapse===e||(i.collapse=e,q&&(w(),_())),H},H.icons=function(t){if(0===arguments.length)return e.extend({},i.icons);if(!(t instanceof Object))throw new TypeError("icons() expects parameter to be an Object");return e.extend(i.icons,t),q&&(w(),_()),H},H.tooltips=function(t){if(0===arguments.length)return e.extend({},i.tooltips);if(!(t instanceof Object))throw new TypeError("tooltips() expects parameter to be an Object");return e.extend(i.tooltips,t),q&&(w(),_()),H},H.useStrict=function(e){if(0===arguments.length)return i.useStrict;if("boolean"!=typeof e)throw new TypeError("useStrict() expects a boolean parameter");return i.useStrict=e,H},H.sideBySide=function(e){if(0===arguments.length)return i.sideBySide;if("boolean"!=typeof e)throw new TypeError("sideBySide() expects a boolean parameter");return i.sideBySide=e,q&&(w(),_()),H},H.viewMode=function(e){if(0===arguments.length)return i.viewMode;if("string"!=typeof e)throw new TypeError("viewMode() expects a string parameter");if(-1===Y.indexOf(e))throw new TypeError("viewMode() parameter must be one of ("+Y.join(", ")+") value");return i.viewMode=e,R=Math.max(Y.indexOf(e),W),p(),H},H.toolbarPlacement=function(e){if(0===arguments.length)return i.toolbarPlacement;if("string"!=typeof e)throw new TypeError("toolbarPlacement() expects a string parameter");if(-1===Q.indexOf(e))throw new TypeError("toolbarPlacement() parameter must be one of ("+Q.join(", ")+") value");return i.toolbarPlacement=e,q&&(w(),_()),H},H.widgetPositioning=function(t){if(0===arguments.length)return e.extend({},i.widgetPositioning);if("[object Object]"!=={}.toString.call(t))throw new TypeError("widgetPositioning() expects an object variable");if(t.horizontal){if("string"!=typeof t.horizontal)throw new TypeError("widgetPositioning() horizontal variable must be a string");if(t.horizontal=t.horizontal.toLowerCase(),-1===Z.indexOf(t.horizontal))throw new TypeError("widgetPositioning() expects horizontal parameter to be one of ("+Z.join(", ")+")");i.widgetPositioning.horizontal=t.horizontal}if(t.vertical){if("string"!=typeof t.vertical)throw new TypeError("widgetPositioning() vertical variable must be a string");if(t.vertical=t.vertical.toLowerCase(),-1===G.indexOf(t.vertical))throw new TypeError("widgetPositioning() expects vertical parameter to be one of ("+G.join(", ")+")");i.widgetPositioning.vertical=t.vertical}return b(),H},H.calendarWeeks=function(e){if(0===arguments.length)return i.calendarWeeks;if("boolean"!=typeof e)throw new TypeError("calendarWeeks() expects parameter to be a boolean value");return i.calendarWeeks=e,b(),H},H.showTodayButton=function(e){if(0===arguments.length)return i.showTodayButton;if("boolean"!=typeof e)throw new TypeError("showTodayButton() expects a boolean parameter");return i.showTodayButton=e,q&&(w(),_()),H},H.showClear=function(e){if(0===arguments.length)return i.showClear;if("boolean"!=typeof e)throw new TypeError("showClear() expects a boolean parameter");return i.showClear=e,q&&(w(),_()),H},H.widgetParent=function(t){if(0===arguments.length)return i.widgetParent;if("string"==typeof t&&(t=e(t)),null!==t&&"string"!=typeof t&&!(t instanceof e))throw new TypeError("widgetParent() expects a string or a jQuery object parameter");return i.widgetParent=t,q&&(w(),_()),H},H.keepOpen=function(e){if(0===arguments.length)return i.keepOpen;if("boolean"!=typeof e)throw new TypeError("keepOpen() expects a boolean parameter");return i.keepOpen=e,H},H.focusOnShow=function(e){if(0===arguments.length)return i.focusOnShow;if("boolean"!=typeof e)throw new TypeError("focusOnShow() expects a boolean parameter");return i.focusOnShow=e,H},H.inline=function(e){if(0===arguments.length)return i.inline;if("boolean"!=typeof e)throw new TypeError("inline() expects a boolean parameter");return i.inline=e,H},H.clear=function(){return x(),H},H.keyBinds=function(e){return 0===arguments.length?i.keyBinds:(i.keyBinds=e,H)},H.getMoment=function(e){return o(e)},H.debug=function(e){if("boolean"!=typeof e)throw new TypeError("debug() expects a boolean parameter");return i.debug=e,H},H.allowInputToggle=function(e){if(0===arguments.length)return i.allowInputToggle;if("boolean"!=typeof e)throw new TypeError("allowInputToggle() expects a boolean parameter");return i.allowInputToggle=e,H},H.showClose=function(e){if(0===arguments.length)return i.showClose;if("boolean"!=typeof e)throw new TypeError("showClose() expects a boolean parameter");return i.showClose=e,H},H.keepInvalid=function(e){if(0===arguments.length)return i.keepInvalid;if("boolean"!=typeof e)throw new TypeError("keepInvalid() expects a boolean parameter");return i.keepInvalid=e,H},H.datepickerInput=function(e){if(0===arguments.length)return i.datepickerInput;if("string"!=typeof e)throw new TypeError("datepickerInput() expects a string parameter");return i.datepickerInput=e,H},H.parseInputDate=function(e){if(0===arguments.length)return i.parseInputDate;if("function"!=typeof e)throw new TypeError("parseInputDate() sholud be as function");return i.parseInputDate=e,H},H.disabledTimeIntervals=function(t){if(0===arguments.length)return i.disabledTimeIntervals?e.extend({},i.disabledTimeIntervals):i.disabledTimeIntervals;if(!t)return i.disabledTimeIntervals=!1,b(),H;if(!(t instanceof Array))throw new TypeError("disabledTimeIntervals() expects an array parameter");return i.disabledTimeIntervals=t,b(),H},H.disabledHours=function(t){if(0===arguments.length)return i.disabledHours?e.extend({},i.disabledHours):i.disabledHours;if(!t)return i.disabledHours=!1,b(),H;if(!(t instanceof Array))throw new TypeError("disabledHours() expects an array parameter");if(i.disabledHours=A(t),i.enabledHours=!1,i.useCurrent&&!i.keepInvalid){for(var n=0;!m(P,"h");){if(P.add(1,"h"),24===n)throw"Tried 24 times to find a valid date";n++}y(P)}return b(),H},H.enabledHours=function(t){if(0===arguments.length)return i.enabledHours?e.extend({},i.enabledHours):i.enabledHours;if(!t)return i.enabledHours=!1,b(),H;if(!(t instanceof Array))throw new TypeError("enabledHours() expects an array parameter");if(i.enabledHours=A(t),i.disabledHours=!1,i.useCurrent&&!i.keepInvalid){for(var n=0;!m(P,"h");){if(P.add(1,"h"),24===n)throw"Tried 24 times to find a valid date";n++}y(P)}return b(),H},H.viewDate=function(e){if(0===arguments.length)return O.clone();if(!e)return O=P.clone(),H;if(!("string"==typeof e||t.isMoment(e)||e instanceof Date))throw new TypeError("viewDate() parameter must be one of [string, moment or Date]");return O=C(e),f(),H},n.is("input"))I=n;else if(0===(I=n.find(i.datepickerInput)).length)I=n.find("input");else if(!I.is("input"))throw new Error('CSS class "'+i.datepickerInput+'" cannot be applied to non input element');if(n.hasClass("input-group")&&(U=0===n.find(".datepickerbutton").length?n.find(".input-group-addon"):n.find(".datepickerbutton")),!i.inline&&!I.is("input"))throw new Error("Could not initialize DateTimePicker without an input element");return P=o(),O=P.clone(),e.extend(!0,i,(z={},(L=n.is("input")||i.inline?n.data():n.find("input").data()).dateOptions&&L.dateOptions instanceof Object&&(z=e.extend(!0,z,L.dateOptions)),e.each(i,function(e){var t="date"+e.charAt(0).toUpperCase()+e.slice(1);void 0!==L[t]&&(z[e]=L[t])}),z)),H.options(i),j(),I.on({change:D,blur:i.debug?"":w,keydown:E,keyup:T,focus:i.allowInputToggle?_:""}),n.is("input")?I.on({focus:_}):U&&(U.on("click",S),U.on("mousedown",!1)),I.prop("disabled")&&H.disable(),I.is("input")&&0!==I.val().trim().length?y(C(I.val().trim())):i.defaultDate&&void 0===I.attr("placeholder")&&y(i.defaultDate),i.inline&&_(),H}if(!t)throw new Error("bootstrap-datetimepicker requires Moment.js to be loaded first");return e.fn.datetimepicker=function(t){t=t||{};var i,r=Array.prototype.slice.call(arguments,1),o=!0;if("object"==typeof t)return this.each(function(){var i,r=e(this);r.data("DateTimePicker")||(i=e.extend(!0,{},e.fn.datetimepicker.defaults,t),r.data("DateTimePicker",n(r,i)))});if("string"==typeof t)return this.each(function(){var n=e(this).data("DateTimePicker");if(!n)throw new Error('bootstrap-datetimepicker("'+t+'") method was called on an element that is not using DateTimePicker');i=n[t].apply(n,r),o=i===n}),o||-1<e.inArray(t,["destroy","hide","show","toggle"])?this:i;throw new TypeError("Invalid arguments for DateTimePicker: "+t)},e.fn.datetimepicker.defaults={timeZone:"",format:!1,dayViewHeaderFormat:"MMMM YYYY",extraFormats:!1,stepping:1,minDate:!1,maxDate:!1,useCurrent:!0,collapse:!0,locale:t.locale(),defaultDate:!1,disabledDates:!1,enabledDates:!1,icons:{time:"glyphicon glyphicon-time",date:"glyphicon glyphicon-calendar",up:"glyphicon glyphicon-chevron-up",down:"glyphicon glyphicon-chevron-down",previous:"glyphicon glyphicon-chevron-left",next:"glyphicon glyphicon-chevron-right",today:"glyphicon glyphicon-screenshot",clear:"glyphicon glyphicon-trash",close:"glyphicon glyphicon-remove"},tooltips:{today:"Go to today",clear:"Clear selection",close:"Close the picker",selectMonth:"Select Month",prevMonth:"Previous Month",nextMonth:"Next Month",selectYear:"Select Year",prevYear:"Previous Year",nextYear:"Next Year",selectDecade:"Select Decade",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevCentury:"Previous Century",nextCentury:"Next Century",pickHour:"Pick Hour",incrementHour:"Increment Hour",decrementHour:"Decrement Hour",pickMinute:"Pick Minute",incrementMinute:"Increment Minute",decrementMinute:"Decrement Minute",pickSecond:"Pick Second",incrementSecond:"Increment Second",decrementSecond:"Decrement Second",togglePeriod:"Toggle Period",selectTime:"Select Time"},useStrict:!1,sideBySide:!1,daysOfWeekDisabled:!1,calendarWeeks:!1,viewMode:"days",toolbarPlacement:"default",showTodayButton:!1,showClear:!1,showClose:!1,widgetPositioning:{horizontal:"auto",vertical:"auto"},widgetParent:null,ignoreReadonly:!1,keepOpen:!1,focusOnShow:!0,inline:!1,keepInvalid:!1,datepickerInput:".datepickerinput",keyBinds:{up:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().subtract(7,"d")):this.date(t.clone().add(this.stepping(),"m"))}},down:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().add(7,"d")):this.date(t.clone().subtract(this.stepping(),"m"))}else this.show()},"control up":function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().subtract(1,"y")):this.date(t.clone().add(1,"h"))}},"control down":function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")?this.date(t.clone().add(1,"y")):this.date(t.clone().subtract(1,"h"))}},left:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"d"))}},right:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"d"))}},pageUp:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().subtract(1,"M"))}},pageDown:function(e){if(e){var t=this.date()||this.getMoment();e.find(".datepicker").is(":visible")&&this.date(t.clone().add(1,"M"))}},enter:function(){this.hide()},escape:function(){this.hide()},"control space":function(e){e&&e.find(".timepicker").is(":visible")&&e.find('.btn[data-action="togglePeriod"]').click()},t:function(){this.date(this.getMoment())},delete:function(){this.clear()}},debug:!1,allowInputToggle:!1,disabledTimeIntervals:!1,disabledHours:!1,enabledHours:!1,viewDate:!1},e.fn.datetimepicker}),define("locales/datetimepicker_locale",["pgui.localizer","moment"],function(e,t){e.load().done(function(){var n={months:e.getString("CalendarMonths").split("_"),monthsShort:e.getString("CalendarMonthsShort").split("_"),weekdays:e.getString("CalendarWeekdays").split("_"),weekdaysShort:e.getString("CalendarWeekdaysShort").split("_"),weekdaysMin:e.getString("CalendarWeekdaysMin").split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},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"},ordinalParse:/\d{1,2}(st|nd|rd|th)/,ordinal:function(e){var t=e%10;return e+(1==~~(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")},week:{dow:e.getFirstDayOfWeek(),doy:4}};t.locale("php_gen",n)})}),define("pgui.editors/datetime",["pgui.editors/plain","datepicker","locales/datetimepicker_locale","moment"],function(e,t,n,i){function r(e){var t=e.data("picker-format"),n=e.data("vertical")||"auto",i=e.closest(".js-datetime-editor-wrap");return 0==i.length&&(i=e),i.datetimepicker({format:t,useCurrent:!1,showClear:!0,showClose:!0,showTodayButton:!0,widgetPositioning:{vertical:n},allowInputToggle:!1,locale:"php_gen",icons:{time:"icon-time",date:"icon-calendar",up:"icon-chevron-up",down:"icon-chevron-down",previous:"icon-chevron-left",next:"icon-chevron-right",today:"icon-today",clear:"icon-remove",close:"icon-ok"}}),i}return e.extend({init:function(e,t){this._super(e,t),r(e).on("dp.change",_.bind(this.doChanged,this)).on("dp.hide",function(){e.trigger("keyup")})},_enableCalendarButton:function(e){var t=this._getCalendarButton();0!==t.length&&(e?t.removeAttr("disabled"):t.attr("disabled",!0))},_getCalendarButton:function(){return this.rootElement.find(".js-datetime-editor-button")},setEnabled:function(e){return this._super(e),this._enableCalendarButton(e),this},setReadonly:function(e){return this._super(e),this._enableCalendarButton(!e),this},getValueEx:function(){var e=this.rootElement.data("picker-format");return i(this._super(),e).format("YYYY-MM-DD HH:mm:ss")},setValueEx:function(e){var t=this.rootElement.data("picker-format");this._super(i(e,"YYYY-MM-DD HH:mm:ss").format(t))}})}),jQuery.trumbowyg={langs:{en:{viewHTML:"View HTML",undo:"Undo",redo:"Redo",formatting:"Formatting",p:"Paragraph",blockquote:"Quote",code:"Code",header:"Header",bold:"Bold",italic:"Italic",strikethrough:"Strikethrough",underline:"Underline",strong:"Strong",em:"Emphasis",del:"Deleted",superscript:"Superscript",subscript:"Subscript",unorderedList:"Unordered list",orderedList:"Ordered list",insertImage:"Insert Image",link:"Link",createLink:"Insert link",unlink:"Remove link",justifyLeft:"Align Left",justifyCenter:"Align Center",justifyRight:"Align Right",justifyFull:"Align Justify",horizontalRule:"Insert horizontal rule",removeformat:"Remove format",fullscreen:"Fullscreen",close:"Close",submit:"Confirm",reset:"Cancel",required:"Required",description:"Description",title:"Title",text:"Text",target:"Target",width:"Width"}},plugins:{},svgPath:null,hideButtonTexts:null},Object.defineProperty(jQuery.trumbowyg,"defaultOptions",{value:{lang:"en",fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,autogrowOnEnter:!1,imageWidthModalEdit:!1,prefix:"trumbowyg-",semantic:!0,semanticKeepAttributes:!1,resetCss:!1,removeformatPasted:!1,tabToIndent:!1,tagsToRemove:[],tagsToKeep:["hr","img","embed","iframe","input"],btns:[["viewHTML"],["undo","redo"],["formatting"],["strong","em","del"],["superscript","subscript"],["link"],["insertImage"],["justifyLeft","justifyCenter","justifyRight","justifyFull"],["unorderedList","orderedList"],["horizontalRule"],["removeformat"],["fullscreen"]],btnsDef:{},changeActiveDropdownIcon:!1,inlineElementsSelector:"a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u",pasteHandlers:[],plugins:{},urlProtocol:!1,minimalLinks:!1},writable:!1,enumerable:!0,configurable:!1}),function(e,t,n,i){"use strict";i.fn.trumbowyg=function(e,t){if(e===Object(e)||!e)return this.each(function(){i(this).data("trumbowyg")||i(this).data("trumbowyg",new r(this,e))});if(1===this.length)try{var n=i(this).data("trumbowyg");switch(e){case"execCmd":return n.execCmd(t.cmd,t.param,t.forceCss);case"openModal":return n.openModal(t.title,t.content);case"closeModal":return n.closeModal();case"openModalInsert":return n.openModalInsert(t.title,t.fields,t.callback);case"saveRange":return n.saveRange();case"getRange":return n.range;case"getRangeText":return n.getRangeText();case"restoreRange":return n.restoreRange();case"enable":return n.setDisabled(!1);case"disable":return n.setDisabled(!0);case"toggle":return n.toggle();case"destroy":return n.destroy();case"empty":return n.empty();case"html":return n.html(t)}}catch(e){}return!1};var r=function(r,o){var a=this,s=i.trumbowyg;a.doc=r.ownerDocument||n,a.$ta=i(r),a.$c=i(r),o=o||{},null!=o.lang||null!=s.langs[o.lang]?a.lang=i.extend(!0,{},s.langs.en,s.langs[o.lang]):a.lang=s.langs.en,a.hideButtonTexts=null!=s.hideButtonTexts?s.hideButtonTexts:o.hideButtonTexts;var l=null!=s.svgPath?s.svgPath:o.svgPath;if(a.hasSvg=!1!==l,a.svgPath=a.doc.querySelector("base")?t.location.href.split("#")[0]:"",0===i("#trumbowyg-icons",a.doc).length&&!1!==l){if(null==l){for(var c=n.getElementsByTagName("script"),u=0;u<c.length;u+=1){var d=c[u].src,h=d.match("trumbowyg(.min)?.js");null!=h&&(l=d.substring(0,d.indexOf(h[0]))+"ui/icons.svg")}null==l&&console.warn("You must define svgPath: https://goo.gl/CfTY9U")}var f=a.doc.createElement("div");f.id="trumbowyg-icons",a.doc.body.insertBefore(f,a.doc.body.childNodes[0]),i.ajax({async:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",dataType:"xml",crossDomain:!0,url:l,data:null,beforeSend:null,complete:null,success:function(e){f.innerHTML=(new XMLSerializer).serializeToString(e.documentElement)}})}var p=a.lang.header,m=function(){return(t.chrome||t.Intl&&Intl.v8BreakIterator)&&"CSS"in t};a.btnsDef={viewHTML:{fn:"toggle",class:"trumbowyg-not-disable"},undo:{isSupported:m,key:"Z"},redo:{isSupported:m,key:"Y"},p:{fn:"formatBlock"},blockquote:{fn:"formatBlock"},h1:{fn:"formatBlock",title:p+" 1"},h2:{fn:"formatBlock",title:p+" 2"},h3:{fn:"formatBlock",title:p+" 3"},h4:{fn:"formatBlock",title:p+" 4"},h5:{fn:"formatBlock",title:p+" 5"},h6:{fn:"formatBlock",title:p+" 6"},subscript:{tag:"sub"},superscript:{tag:"sup"},bold:{key:"B",tag:"b"},italic:{key:"I",tag:"i"},
underline:{tag:"u"},strikethrough:{tag:"strike"},strong:{fn:"bold",key:"B"},em:{fn:"italic",key:"I"},del:{fn:"strikethrough"},createLink:{key:"K",tag:"a"},unlink:{},insertImage:{},justifyLeft:{tag:"left",forceCss:!0},justifyCenter:{tag:"center",forceCss:!0},justifyRight:{tag:"right",forceCss:!0},justifyFull:{tag:"justify",forceCss:!0},unorderedList:{fn:"insertUnorderedList",tag:"ul"},orderedList:{fn:"insertOrderedList",tag:"ol"},horizontalRule:{fn:"insertHorizontalRule"},removeformat:{},fullscreen:{class:"trumbowyg-not-disable"},close:{fn:"destroy",class:"trumbowyg-not-disable"},formatting:{dropdown:["p","blockquote","h1","h2","h3","h4"],ico:"p"},link:{dropdown:["createLink","unlink"]}},a.o=i.extend(!0,{},s.defaultOptions,o),a.o.hasOwnProperty("imgDblClickHandler")||(a.o.imgDblClickHandler=a.getDefaultImgDblClickHandler()),a.urlPrefix=a.setupUrlPrefix(),a.disabled=a.o.disabled||"TEXTAREA"===r.nodeName&&(r.disabled||r.readOnly),o.btns?a.o.btns=o.btns:a.o.semantic||(a.o.btns[3]=["bold","italic","underline","strikethrough"]),i.each(a.o.btnsDef,function(e,t){a.addBtnDef(e,t)}),a.eventNamespace="trumbowyg-event",a.keys=[],a.tagToButton={},a.tagHandlers=[],a.pasteHandlers=[].concat(a.o.pasteHandlers),a.isIE=-1!==e.userAgent.indexOf("MSIE")||-1!==e.appVersion.indexOf("Trident/"),a.isMac=-1!==e.platform.toUpperCase().indexOf("MAC"),a.init()};r.prototype={DEFAULT_SEMANTIC_MAP:{b:"strong",i:"em",s:"del",strike:"del",div:"p"},init:function(){var e=this;e.height=e.$ta.height(),e.initPlugins();try{e.doc.execCommand("enableObjectResizing",!1,!1),e.doc.execCommand("defaultParagraphSeparator",!1,"p")}catch(e){}e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),e.buildOverlay(),setTimeout(function(){e.disabled&&e.setDisabled(!0),e.$c.trigger("tbwinit")})},addBtnDef:function(e,t){this.btnsDef[e]=i.extend(t,this.btnsDef[e]||{})},setupUrlPrefix:function(){var e=this.o.urlProtocol;if(e)return"string"!=typeof e?"https://":e.replace("://","")+"://"},buildEditor:function(){var e=this,n=e.o.prefix,r="";e.$box=i("<div/>",{class:n+"box "+n+"editor-visible "+n+e.o.lang+" trumbowyg"}),e.isTextarea=e.$ta.is("textarea"),e.isTextarea?(r=e.$ta.val(),e.$ed=i("<div/>"),e.$box.insertAfter(e.$ta).append(e.$ed,e.$ta)):(e.$ed=e.$ta,r=e.$ed.html(),e.$ta=i("<textarea/>",{name:e.$ta.attr("id"),height:e.height}).val(r),e.$box.insertAfter(e.$ed).append(e.$ta,e.$ed),e.syncCode()),e.$ta.addClass(n+"textarea").attr("tabindex",-1),e.$ed.addClass(n+"editor").attr({contenteditable:!0,dir:e.lang._dir||"ltr"}).html(r),e.o.tabindex&&e.$ed.attr("tabindex",e.o.tabindex),e.$c.is("[placeholder]")&&e.$ed.attr("placeholder",e.$c.attr("placeholder")),e.$c.is("[spellcheck]")&&e.$ed.attr("spellcheck",e.$c.attr("spellcheck")),e.o.resetCss&&e.$ed.addClass(n+"reset-css"),e.o.autogrow||e.$ta.add(e.$ed).css({height:e.height}),e.semanticCode(),e.o.autogrowOnEnter&&e.$ed.addClass(n+"autogrow-on-enter");var o,a=!1,s=!1;e.$ed.on("dblclick","img",e.o.imgDblClickHandler).on("keydown",function(t){if(!t.ctrlKey&&!t.metaKey||t.altKey){if(e.o.tabToIndent&&"Tab"===t.key)try{return t.shiftKey?e.execCmd("outdent",!0,null):e.execCmd("indent",!0,null),!1}catch(e){}}else{a=!0;var n=e.keys[String.fromCharCode(t.which).toUpperCase()];try{return e.execCmd(n.fn,n.param),!1}catch(e){}}}).on("compositionstart compositionupdate",function(){s=!0}).on("keyup compositionend",function(t){if("compositionend"===t.type)s=!1;else if(s)return;var n=t.which;if(!(n>=37&&n<=40)){if(!t.ctrlKey&&!t.metaKey||89!==n&&90!==n)if(a||17===n)void 0===t.which&&e.semanticCode(!1,!1,!0);else{var i=!e.isIE||"compositionend"===t.type;e.semanticCode(!1,i&&13===n),e.$c.trigger("tbwchange")}else e.semanticCode(!1,!0),e.$c.trigger("tbwchange");setTimeout(function(){a=!1},50)}}).on("mouseup keydown keyup",function(t){(!t.ctrlKey&&!t.metaKey||t.altKey)&&setTimeout(function(){a=!1},50),clearTimeout(o),o=setTimeout(function(){e.updateButtonPaneStatus()},50)}).on("focus blur",function(t){if(e.$c.trigger("tbw"+t.type),"blur"===t.type&&e.clearButtonPaneStatus(),e.o.autogrowOnEnter){if(e.autogrowOnEnterDontClose)return;"focus"===t.type?(e.autogrowOnEnterWasFocused=!0,e.autogrowEditorOnEnter()):e.o.autogrow||(e.$ed.css({height:e.$ed.css("min-height")}),e.$c.trigger("tbwresize"))}}).on("cut drop",function(){setTimeout(function(){e.semanticCode(!1,!0),e.$c.trigger("tbwchange")},0)}).on("paste",function(n){if(e.o.removeformatPasted){n.preventDefault(),t.getSelection&&t.getSelection().deleteFromDocument&&t.getSelection().deleteFromDocument();try{var r=t.clipboardData.getData("Text");try{e.doc.selection.createRange().pasteHTML(r)}catch(t){e.doc.getSelection().getRangeAt(0).insertNode(e.doc.createTextNode(r))}e.$c.trigger("tbwchange",n)}catch(t){e.execCmd("insertText",(n.originalEvent||n).clipboardData.getData("text/plain"))}}i.each(e.pasteHandlers,function(e,t){t(n)}),setTimeout(function(){e.semanticCode(!1,!0),e.$c.trigger("tbwpaste",n),e.$c.trigger("tbwchange")},0)}),e.$ta.on("keyup",function(){e.$c.trigger("tbwchange")}).on("paste",function(){setTimeout(function(){e.$c.trigger("tbwchange")},0)}),e.$box.on("keydown",function(t){if(27===t.which&&1===i("."+n+"modal-box",e.$box).length)return e.closeModal(),!1})},autogrowEditorOnEnter:function(){var e=this;e.$ed.removeClass("autogrow-on-enter");var t=e.$ed[0].clientHeight;e.$ed.height("auto");var n=e.$ed[0].scrollHeight;e.$ed.addClass("autogrow-on-enter"),t!==n&&(e.$ed.height(t),setTimeout(function(){e.$ed.css({height:n}),e.$c.trigger("tbwresize")},0))},buildBtnPane:function(){var e=this,t=e.o.prefix,n=e.$btnPane=i("<div/>",{class:t+"button-pane"});i.each(e.o.btns,function(r,o){i.isArray(o)||(o=[o]);var a=i("<div/>",{class:t+"button-group "+(o.indexOf("fullscreen")>=0?t+"right":"")});i.each(o,function(t,n){try{e.isSupportedBtn(n)&&a.append(e.buildBtn(n))}catch(e){}}),a.html().trim().length>0&&n.append(a)}),e.$box.prepend(n)},buildBtn:function(e){var t=this,n=t.o.prefix,r=t.btnsDef[e],o=r.dropdown,a=null==r.hasIcon||r.hasIcon,s=t.lang[e]||e,l=i("<button/>",{type:"button",class:n+e+"-button "+(r.class||"")+(a?"":" "+n+"textual-button"),html:t.hasSvg&&a?'<svg><use xlink:href="'+t.svgPath+"#"+n+(r.ico||e).replace(/([A-Z]+)/g,"-$1").toLowerCase()+'"/></svg>':t.hideButtonTexts?"":r.text||r.title||t.lang[e]||e,title:(r.title||r.text||s)+(r.key?" ("+(t.isMac?"Cmd":"Ctrl")+" + "+r.key+")":""),tabindex:-1,mousedown:function(){return o&&!i("."+e+"-"+n+"dropdown",t.$box).is(":hidden")||i("body",t.doc).trigger("mousedown"),!((t.$btnPane.hasClass(n+"disable")||t.$box.hasClass(n+"disabled"))&&!i(this).hasClass(n+"active")&&!i(this).hasClass(n+"not-disable"))&&(t.execCmd(!!o&&"dropdown"||r.fn||e,r.param||e,r.forceCss),!1)}});if(o){l.addClass(n+"open-dropdown");var c=n+"dropdown",u={class:c+"-"+e+" "+c+" "+n+"fixed-top "+(r.dropdownClass||"")};u["data-"+c]=e;var d=i("<div/>",u);i.each(o,function(e,n){t.btnsDef[n]&&t.isSupportedBtn(n)&&d.append(t.buildSubBtn(n))}),t.$box.append(d.hide())}else r.key&&(t.keys[r.key]={fn:r.fn||e,param:r.param||e});return o||(t.tagToButton[(r.tag||e).toLowerCase()]=e),l},buildSubBtn:function(e){var t=this,n=t.o.prefix,r=t.btnsDef[e],o=null==r.hasIcon||r.hasIcon;return r.key&&(t.keys[r.key]={fn:r.fn||e,param:r.param||e}),t.tagToButton[(r.tag||e).toLowerCase()]=e,i("<button/>",{type:"button",class:n+e+"-dropdown-button "+(r.class||"")+(r.ico?" "+n+r.ico+"-button":""),html:t.hasSvg&&o?'<svg><use xlink:href="'+t.svgPath+"#"+n+(r.ico||e).replace(/([A-Z]+)/g,"-$1").toLowerCase()+'"/></svg>'+(r.text||r.title||t.lang[e]||e):r.text||r.title||t.lang[e]||e,title:r.key?"("+(t.isMac?"Cmd":"Ctrl")+" + "+r.key+")":null,style:r.style||null,mousedown:function(){return i("body",t.doc).trigger("mousedown"),t.execCmd(r.fn||e,r.param||e,r.forceCss),!1}})},isSupportedBtn:function(e){try{return this.btnsDef[e].isSupported()}catch(e){}return!0},buildOverlay:function(){var e=this;return e.$overlay=i("<div/>",{class:e.o.prefix+"overlay"}).appendTo(e.$box),e.$overlay},showOverlay:function(){var e=this;i(t).trigger("scroll"),e.$overlay.fadeIn(200),e.$box.addClass(e.o.prefix+"box-blur")},hideOverlay:function(){var e=this;e.$overlay.fadeOut(50),e.$box.removeClass(e.o.prefix+"box-blur")},fixedBtnPaneEvents:function(){var e=this,n=e.o.fixedFullWidth,r=e.$box;e.o.fixedBtnPane&&(e.isFixed=!1,i(t).on("scroll."+e.eventNamespace+" resize."+e.eventNamespace,function(){if(r){e.syncCode();var o=i(t).scrollTop(),a=r.offset().top+1,s=e.$btnPane,l=s.outerHeight()-2;o-a>0&&o-a-e.height<0?(e.isFixed||(e.isFixed=!0,s.css({position:"fixed",top:0,left:n?0:"auto",zIndex:7}),e.$box.css({paddingTop:s.height()})),s.css({width:n?"100%":r.width()-1}),i("."+e.o.prefix+"fixed-top",r).css({position:n?"fixed":"absolute",top:n?l:l+(o-a),zIndex:15})):e.isFixed&&(e.isFixed=!1,s.removeAttr("style"),e.$box.css({paddingTop:0}),i("."+e.o.prefix+"fixed-top",r).css({position:"absolute",top:l}))}}))},setDisabled:function(e){var t=this,n=t.o.prefix;t.disabled=e,e?t.$ta.attr("disabled",!0):t.$ta.removeAttr("disabled"),t.$box.toggleClass(n+"disabled",e),t.$ed.attr("contenteditable",!e)},destroy:function(){var e=this,n=e.o.prefix;e.isTextarea?e.$box.after(e.$ta.css({height:""}).val(e.html()).removeClass(n+"textarea").show()):e.$box.after(e.$ed.css({height:""}).removeClass(n+"editor").removeAttr("contenteditable").removeAttr("dir").html(e.html()).show()),e.$ed.off("dblclick","img"),e.destroyPlugins(),e.$box.remove(),e.$c.removeData("trumbowyg"),i("body").removeClass(n+"body-fullscreen"),e.$c.trigger("tbwclose"),i(t).off("scroll."+e.eventNamespace+" resize."+e.eventNamespace)},empty:function(){this.$ta.val(""),this.syncCode(!0)},toggle:function(){var e=this,t=e.o.prefix;e.o.autogrowOnEnter&&(e.autogrowOnEnterDontClose=!e.$box.hasClass(t+"editor-hidden")),e.semanticCode(!1,!0),setTimeout(function(){e.doc.activeElement.blur(),e.$box.toggleClass(t+"editor-hidden "+t+"editor-visible"),e.$btnPane.toggleClass(t+"disable"),i("."+t+"viewHTML-button",e.$btnPane).toggleClass(t+"active"),e.$box.hasClass(t+"editor-visible")?e.$ta.attr("tabindex",-1):e.$ta.removeAttr("tabindex"),e.o.autogrowOnEnter&&!e.autogrowOnEnterDontClose&&e.autogrowEditorOnEnter()},0)},dropdown:function(e){var n=this,r=i("body",n.doc),o=n.o.prefix,a=i("[data-"+o+"dropdown="+e+"]",n.$box),s=i("."+o+e+"-button",n.$btnPane),l=a.is(":hidden");if(r.trigger("mousedown"),l){var c=s.offset().left;s.addClass(o+"active"),a.css({position:"absolute",top:s.offset().top-n.$btnPane.offset().top+s.outerHeight(),left:n.o.fixedFullWidth&&n.isFixed?c:c-n.$btnPane.offset().left}).show(),i(t).trigger("scroll"),r.on("mousedown."+n.eventNamespace,function(e){a.is(e.target)||(i("."+o+"dropdown",n.$box).hide(),i("."+o+"active",n.$btnPane).removeClass(o+"active"),r.off("mousedown."+n.eventNamespace))})}},html:function(e){var t=this;return null!=e?(t.$ta.val(e),t.syncCode(!0),t.$c.trigger("tbwchange"),t):t.$ta.val()},syncTextarea:function(){var e=this;e.$ta.val(e.$ed.text().trim().length>0||e.$ed.find(e.o.tagsToKeep.join(",")).length>0?e.$ed.html():"")},syncCode:function(e){var t=this;if(!e&&t.$ed.is(":visible"))t.syncTextarea();else{var n=i("<div>").html(t.$ta.val()),r=i("<div>").append(n);i(t.o.tagsToRemove.join(","),r).remove(),t.$ed.html(r.contents().html())}if(t.o.autogrow&&(t.height=t.$ed.height(),t.height!==t.$ta.css("height")&&(t.$ta.css({height:t.height}),t.$c.trigger("tbwresize"))),t.o.autogrowOnEnter){t.$ed.height("auto");var o=t.autogrowOnEnterWasFocused?t.$ed[0].scrollHeight:t.$ed.css("min-height");o!==t.$ta.css("height")&&(t.$ed.css({height:o}),t.$c.trigger("tbwresize"))}},semanticCode:function(e,t,n){var r=this;if(r.saveRange(),r.syncCode(e),r.o.semantic){if(r.semanticTag("b",r.o.semanticKeepAttributes),r.semanticTag("i",r.o.semanticKeepAttributes),r.semanticTag("s",r.o.semanticKeepAttributes),r.semanticTag("strike",r.o.semanticKeepAttributes),t){var o=r.o.inlineElementsSelector,a=":not("+o+")";r.$ed.contents().filter(function(){return 3===this.nodeType&&this.nodeValue.trim().length>0}).wrap("<span data-tbw/>");var s=function(e){if(0!==e.length){var t=e.nextUntil(a).addBack().wrapAll("<p/>").parent(),n=t.nextAll(o).first();t.next("br").remove(),s(n)}};s(r.$ed.children(o).first()),r.semanticTag("div",!0),r.$ed.find("p").filter(function(){return(!r.range||this!==r.range.startContainer)&&(0===i(this).text().trim().length&&0===i(this).children().not("br,span").length)}).contents().unwrap(),i("[data-tbw]",r.$ed).contents().unwrap(),r.$ed.find("p:empty").remove()}n||r.restoreRange(),r.syncTextarea()}},semanticTag:function(e,t){var n;if(null!=this.o.semantic&&"object"==typeof this.o.semantic&&this.o.semantic.hasOwnProperty(e))n=this.o.semantic[e];else{if(!0!==this.o.semantic||!this.DEFAULT_SEMANTIC_MAP.hasOwnProperty(e))return;n=this.DEFAULT_SEMANTIC_MAP[e]}i(e,this.$ed).each(function(){var e=i(this);if(0===e.contents().length)return!1;e.wrap("<"+n+"/>"),t&&i.each(e.prop("attributes"),function(){e.parent().attr(this.name,this.value)}),e.contents().unwrap()})},createLink:function(){for(var e,t,n,r=this,o=r.doc.getSelection(),a=o.focusNode,s=(new XMLSerializer).serializeToString(o.getRangeAt(0).cloneContents());["A","DIV"].indexOf(a.nodeName)<0;)a=a.parentNode;if(a&&"A"===a.nodeName){var l=i(a);s=l.text(),e=l.attr("href"),r.o.minimalLinks||(t=l.attr("title"),n=l.attr("target"));var c=r.doc.createRange();c.selectNode(a),o.removeAllRanges(),o.addRange(c)}r.saveRange();var u={url:{label:"URL",required:!0,value:e},text:{label:r.lang.text,value:s}};r.o.minimalLinks||Object.assign(u,{title:{label:r.lang.title,value:t},target:{label:r.lang.target,value:n}}),r.openModalInsert(r.lang.createLink,u,function(e){var t=r.prependUrlPrefix(e.url);if(!t.length)return!1;var n=i(['<a href="',t,'">',e.text||e.url,"</a>"].join(""));return r.o.minimalLinks||(e.title.length>0&&n.attr("title",e.title),e.target.length>0&&n.attr("target",e.target)),r.range.deleteContents(),r.range.insertNode(n[0]),r.syncCode(),r.$c.trigger("tbwchange"),!0})},prependUrlPrefix:function(e){var t=this;return t.urlPrefix?/^([a-z][-+.a-z0-9]*:|\/|#)/i.test(e)?e:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?"mailto:"+e:t.urlPrefix+e:e},unlink:function(){var e=this,t=e.doc.getSelection(),n=t.focusNode;if(t.isCollapsed){for(;["A","DIV"].indexOf(n.nodeName)<0;)n=n.parentNode;if(n&&"A"===n.nodeName){var i=e.doc.createRange();i.selectNode(n),t.removeAllRanges(),t.addRange(i)}}e.execCmd("unlink",void 0,void 0,!0)},insertImage:function(){var e=this;e.saveRange();var t={url:{label:"URL",required:!0},alt:{label:e.lang.description,value:e.getRangeText()}};e.o.imageWidthModalEdit&&(t.width={}),e.openModalInsert(e.lang.insertImage,t,function(t){e.execCmd("insertImage",t.url,!1,!0);var n=i('img[src="'+t.url+'"]:not([alt])',e.$box);return n.attr("alt",t.alt),e.o.imageWidthModalEdit&&n.attr({width:t.width}),e.syncCode(),e.$c.trigger("tbwchange"),!0})},fullscreen:function(){var e,n=this,r=n.o.prefix,o=r+"fullscreen",a=o+"-placeholder",s=n.$box.outerHeight();n.$box.toggleClass(o),e=n.$box.hasClass(o),e?n.$box.before(i("<div/>",{class:a}).css({height:s})):i("."+a).remove(),i("body").toggleClass(r+"body-fullscreen",e),i(t).trigger("scroll"),n.$c.trigger("tbw"+(e?"open":"close")+"fullscreen")},execCmd:function(e,t,n,i){var r=this;i=!!i||"","dropdown"!==e&&r.$ed.focus();try{r.doc.execCommand("styleWithCSS",!1,n||!1)}catch(e){}try{r[e+i](t)}catch(n){try{e(t)}catch(n){"insertHorizontalRule"===e?t=void 0:"formatBlock"===e&&r.isIE&&(t="<"+t+">"),r.doc.execCommand(e,!1,t),r.syncCode(),r.semanticCode(!1,!0)}"dropdown"!==e&&(r.updateButtonPaneStatus(),r.$c.trigger("tbwchange"))}},openModal:function(e,n){var r=this,o=r.o.prefix;if(i("."+o+"modal-box",r.$box).length>0)return!1;r.o.autogrowOnEnter&&(r.autogrowOnEnterDontClose=!0),r.saveRange(),r.showOverlay(),r.$btnPane.addClass(o+"disable");var a=i(r.doc).find(".modal:visible").last(),s=a.length>0?a:i(r.doc.body),l=i("<div/>",{class:o+"modal "+o+"fixed-top"}).css({top:r.$box.offset().top+r.$btnPane.height(),zIndex:99999}).appendTo(s);r.$overlay.one("click",function(){return l.trigger("tbwcancel"),!1});var c=i("<form/>",{action:"",html:n}).on("submit",function(){return l.trigger("tbwconfirm"),!1}).on("reset",function(){return l.trigger("tbwcancel"),!1}).on("submit reset",function(){r.o.autogrowOnEnter&&(r.autogrowOnEnterDontClose=!1)}),u=i("<div/>",{class:o+"modal-box",html:c}).css({top:"-"+r.$btnPane.outerHeight(),opacity:0}).appendTo(l).animate({top:0,opacity:1},100);return i("<span/>",{text:e,class:o+"modal-title"}).prependTo(u),l.height(u.outerHeight()+10),i("input:first",u).focus(),r.buildModalBtn("submit",u),r.buildModalBtn("reset",u),i(t).trigger("scroll"),l},buildModalBtn:function(e,t){var n=this,r=n.o.prefix;return i("<button/>",{class:r+"modal-button "+r+"modal-"+e,type:e,text:n.lang[e]||e}).appendTo(i("form",t))},closeModal:function(){var e=this,t=e.o.prefix;e.$btnPane.removeClass(t+"disable"),e.$overlay.off();var n=i("."+t+"modal-box",i(e.doc.body));n.animate({top:"-"+n.height()},100,function(){n.parent().remove(),e.hideOverlay()}),e.restoreRange()},openModalInsert:function(e,t,n){var r=this,o=r.o.prefix,a=r.lang,s="";return i.each(t,function(e,t){var n=t.label||e,i=t.name||e,r=t.attributes||{},l=Object.keys(r).map(function(e){return e+'="'+r[e]+'"'}).join(" ");s+='<label><input type="'+(t.type||"text")+'" name="'+i+'"'+("checkbox"===t.type&&t.value?' checked="checked"':' value="'+(t.value||"").replace(/"/g,"&quot;"))+'"'+l+'><span class="'+o+'input-infos"><span>'+(a[n]?a[n]:n)+"</span></span></label>"}),r.openModal(e,s).on("tbwconfirm",function(){var e=i("form",i(this)),o=!0,a={};i.each(t,function(t,n){var s=n.name||t,l=i('input[name="'+s+'"]',e);switch(l.attr("type").toLowerCase()){case"checkbox":a[s]=l.is(":checked");break;case"radio":a[s]=l.filter(":checked").val();break;default:a[s]=i.trim(l.val())}n.required&&""===a[s]?(o=!1,r.addErrorOnModalField(l,r.lang.required)):n.pattern&&!n.pattern.test(a[s])&&(o=!1,r.addErrorOnModalField(l,n.patternError))}),o&&(r.restoreRange(),n(a,t)&&(r.syncCode(),r.$c.trigger("tbwchange"),r.closeModal(),i(this).off("tbwconfirm")))}).one("tbwcancel",function(){i(this).off("tbwconfirm"),r.closeModal()})},addErrorOnModalField:function(e,t){var n=this.o.prefix,r=n+"msg-error",o=e.parent();e.on("change keyup",function(){o.removeClass(n+"input-error"),setTimeout(function(){o.find("."+r).remove()},150)}),o.addClass(n+"input-error").find("input+span").append(i("<span/>",{class:r,text:t}))},getDefaultImgDblClickHandler:function(){var e=this;return function(){var t=i(this),n=t.attr("src");0===n.indexOf("data:image")&&(n="(Base64)");var r={url:{label:"URL",value:n,required:!0},alt:{label:e.lang.description,value:t.attr("alt")}};return e.o.imageWidthModalEdit&&(r.width={value:t.attr("width")?t.attr("width"):""}),e.openModalInsert(e.lang.insertImage,r,function(n){return"(Base64)"!==n.url&&t.attr({src:n.url}),t.attr({alt:n.alt}),e.o.imageWidthModalEdit&&(parseInt(n.width)>0?t.attr({width:n.width}):t.removeAttr("width")),!0}),!1}},saveRange:function(){var e=this,t=e.doc.getSelection();if(e.range=null,t&&t.rangeCount){var n,i=e.range=t.getRangeAt(0),r=e.doc.createRange();r.selectNodeContents(e.$ed[0]),r.setEnd(i.startContainer,i.startOffset),n=(r+"").length,e.metaRange={start:n,end:n+(i+"").length}}},restoreRange:function(){var e,t=this,n=t.metaRange,i=t.range,r=t.doc.getSelection();if(i){if(n&&n.start!==n.end){var o,a=0,s=[t.$ed[0]],l=!1,c=!1;for(e=t.doc.createRange();!c&&(o=s.pop());)if(3===o.nodeType){var u=a+o.length;!l&&n.start>=a&&n.start<=u&&(e.setStart(o,n.start-a),l=!0),l&&n.end>=a&&n.end<=u&&(e.setEnd(o,n.end-a),c=!0),a=u}else for(var d=o.childNodes,h=d.length;h>0;)h-=1,s.push(d[h])}try{r.removeAllRanges()}catch(e){}r.addRange(e||i)}},getRangeText:function(){return this.range+""},clearButtonPaneStatus:function(){var e=this,t=e.o.prefix,n=t+"active-button "+t+"active",r=t+"original-icon";i("."+t+"active-button",e.$btnPane).removeClass(n),i("."+r,e.$btnPane).each(function(){i(this).find("svg use").attr("xlink:href",i(this).data(r))})},updateButtonPaneStatus:function(){var e=this,t=e.o.prefix,n=t+"active-button "+t+"active",r=t+"original-icon",o=e.getTagsRecursive(e.doc.getSelection().focusNode);e.clearButtonPaneStatus(),i.each(o,function(o,a){var s=e.tagToButton[a.toLowerCase()],l=i("."+t+s+"-button",e.$btnPane);if(l.length>0)l.addClass(n);else try{l=i("."+t+"dropdown ."+t+s+"-dropdown-button",e.$box);var c=l.find("svg use"),u=l.parent().data(t+"dropdown"),d=i("."+t+u+"-button",e.$box),h=d.find("svg use");d.addClass(n),e.o.changeActiveDropdownIcon&&c.length>0&&(d.addClass(r).data(r,h.attr("xlink:href")),h.attr("xlink:href",c.attr("xlink:href")))}catch(e){}})},getTagsRecursive:function(e,t){var n=this;if(t=t||(e&&e.tagName?[e.tagName]:[]),!e||!e.parentNode)return t;e=e.parentNode;var r=e.tagName;return"DIV"===r?t:("P"===r&&""!==e.style.textAlign&&t.push(e.style.textAlign),i.each(n.tagHandlers,function(i,r){t=t.concat(r(e,n))}),t.push(r),n.getTagsRecursive(e,t).filter(function(e){return null!=e}))},initPlugins:function(){var e=this;e.loadedPlugins=[],i.each(i.trumbowyg.plugins,function(t,n){n.shouldInit&&!n.shouldInit(e)||(n.init(e),n.tagHandler&&e.tagHandlers.push(n.tagHandler),e.loadedPlugins.push(n))})},destroyPlugins:function(){var e=this;i.each(this.loadedPlugins,function(t,n){n.destroy&&n.destroy(e)})}}}(navigator,window,document,jQuery),define("trumbowyg",function(){}),function(e){"use strict";function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}function n(e){return-1===e.search("rgb")?e.replace("#",""):"rgba(0, 0, 0, 0)"===e?"transparent":(e=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+))?\)$/),t(e[1])+t(e[2])+t(e[3]))}function i(e,t){var i=[];if(!e.style)return i;if(""!==e.style.backgroundColor){var r=n(e.style.backgroundColor);t.o.plugins.colors.colorList.indexOf(r)>=0?i.push("backColor"+r):i.push("backColorFree")}var o;return""!==e.style.color?o=n(e.style.color):e.hasAttribute("color")&&(o=n(e.getAttribute("color"))),o&&(t.o.plugins.colors.colorList.indexOf(o)>=0?i.push("foreColor"+o):i.push("foreColorFree")),i}function r(t,n){var i=[],r=n.o.plugins.colors,o=r[t+"List"]||r.colorList;e.each(o,function(e,o){var a=t+o,s={fn:t,forceCss:!0,hasIcon:!1,text:n.lang["#"+o]||"#"+o,param:"#"+o,style:"background-color: #"+o+";"};r.displayAsList&&"foreColor"===t&&(s.style="color: #"+o+" !important;"),n.addBtnDef(a,s),i.push(a)});var a=t+"Remove",s={fn:"removeFormat",hasIcon:!1,param:t,style:"background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAG0lEQVQIW2NkQAAfEJMRmwBYhoGBYQtMBYoAADziAp0jtJTgAAAAAElFTkSuQmCC);"};if(r.displayAsList&&(s.style=""),n.addBtnDef(a,s),i.push(a),r["allowCustom"+t.charAt(0).toUpperCase()+t.substr(1)]){var l=t+"Free",c={fn:function(){n.openModalInsert(n.lang[t],{color:{label:t,forceCss:!0,type:"color",value:"#FFFFFF"}},function(e){return n.execCmd(t,e.color),!0})},hasIcon:!1,text:"#",style:"text-indent: 0; line-height: 20px; padding: 0 5px;"};n.addBtnDef(l,c),i.push(l)}return i}e.extend(!0,e.trumbowyg,{langs:{cs:{foreColor:"Barva textu",backColor:"Barva pozadí"},en:{foreColor:"Text color",backColor:"Background color",foreColorRemove:"Remove text color",backColorRemove:"Remove background color"},da:{foreColor:"Tekstfarve",backColor:"Baggrundsfarve"},fr:{foreColor:"Couleur du texte",backColor:"Couleur de fond",foreColorRemove:"Supprimer la couleur du texte",backColorRemove:"Supprimer la couleur de fond"},de:{foreColor:"Textfarbe",backColor:"Hintergrundfarbe"},nl:{foreColor:"Tekstkleur",backColor:"Achtergrondkleur"},sk:{foreColor:"Farba textu",backColor:"Farba pozadia"},zh_cn:{foreColor:"文字颜色",backColor:"背景颜色"},zh_tw:{foreColor:"文字顏色",backColor:"背景顏色"},ru:{foreColor:"Цвет текста",backColor:"Цвет выделения текста"},ja:{foreColor:"文字色",backColor:"背景色"},tr:{foreColor:"Yazı rengi",backColor:"Arkaplan rengi"},pt_br:{foreColor:"Cor de fonte",backColor:"Cor de fundo"},ko:{foreColor:"글자색",backColor:"배경색",foreColorRemove:"글자색 지우기",backColorRemove:"배경색 지우기"}}});var o={colorList:["ffffff","000000","eeece1","1f497d","4f81bd","c0504d","9bbb59","8064a2","4bacc6","f79646","ffff00","f2f2f2","7f7f7f","ddd9c3","c6d9f0","dbe5f1","f2dcdb","ebf1dd","e5e0ec","dbeef3","fdeada","fff2ca","d8d8d8","595959","c4bd97","8db3e2","b8cce4","e5b9b7","d7e3bc","ccc1d9","b7dde8","fbd5b5","ffe694","bfbfbf","3f3f3f","938953","548dd4","95b3d7","d99694","c3d69b","b2a2c7","b7dde8","fac08f","f2c314","a5a5a5","262626","494429","17365d","366092","953734","76923c","5f497a","92cddc","e36c09","c09100","7f7f7f","0c0c0c","1d1b10","0f243e","244061","632423","4f6128","3f3151","31859b","974806","7f6000"],foreColorList:null,backColorList:null,allowCustomForeColor:!0,allowCustomBackColor:!0,displayAsList:!1};e.extend(!0,e.trumbowyg,{plugins:{color:{init:function(e){e.o.plugins.colors=e.o.plugins.colors||o;var t=e.o.plugins.colors.displayAsList?e.o.prefix+"dropdown--color-list":"",n={dropdown:r("foreColor",e),dropdownClass:t},i={dropdown:r("backColor",e),dropdownClass:t};e.addBtnDef("foreColor",n),e.addBtnDef("backColor",i)},tagHandler:i}}})}(jQuery),define("trumbowyg.colors",["trumbowyg"],function(){}),function(e){"use strict";function t(t){var n=[];return e.each(t.o.plugins.specialchars.symbolList,function(e,i){i=null===i?"&nbsp":"&#x"+i;var r=i.replace(/:/g,""),o="symbol-"+r,a={text:i,hasIcon:!1,fn:function(){var e=String.fromCodePoint(parseInt(i.replace("&#","0")));return t.execCmd("insertText",e),!0}};t.addBtnDef(o,a),n.push(o)}),n}var n={symbolList:["0024","20AC","00A3","00A2","00A5","00A4","2030",null,"00A9","00AE","2122",null,"00A7","00B6","00C6","00E6","0152","0153",null,"2022","25CF","2023","25B6","2B29","25C6",null,"00B1","00D7","00F7","21D2","21D4","220F","2211","2243","2264","2265"]};e.extend(!0,e.trumbowyg,{langs:{en:{specialChars:"Special characters"},fr:{specialChars:"Caractères spéciaux"},ko:{specialChars:"특수문자"}},plugins:{specialchars:{init:function(e){e.o.plugins.specialchars=e.o.plugins.specialchars||n;var i={dropdown:t(e)};e.addBtnDef("specialChars",i)}}}})}(jQuery),define("trumbowyg.specialchars",["trumbowyg"],function(){}),function(e){"use strict";var t=function(){return"undefined"!=typeof FileReader},n=function(e){return/^data:image\/[a-z]?/i.test(e)};e.extend(!0,e.trumbowyg,{langs:{en:{base64:"Image as base64",file:"File",errFileReaderNotSupported:"FileReader is not supported by your browser.",errInvalidImage:"Invalid image file."},da:{base64:"Billede som base64",file:"Fil",errFileReaderNotSupported:"FileReader er ikke understøttet af din browser.",errInvalidImage:"Ugyldig billedfil."},fr:{base64:"Image en base64",file:"Fichier"},cs:{base64:"Vložit obrázek",file:"Soubor"},zh_cn:{base64:"图片（Base64编码）",file:"文件"},nl:{base64:"Afbeelding inline",file:"Bestand",errFileReaderNotSupported:"Uw browser ondersteunt deze functionaliteit niet.",errInvalidImage:"De gekozen afbeelding is ongeldig."},ru:{base64:"Изображение как код в base64",file:"Файл",errFileReaderNotSupported:"FileReader не поддерживается вашим браузером.",errInvalidImage:"Недопустимый файл изображения."},ja:{base64:"画像 (Base64形式)",file:"ファイル",errFileReaderNotSupported:"あなたのブラウザーはFileReaderをサポートしていません",errInvalidImage:"画像形式が正しくありません"},tr:{base64:"Base64 olarak resim",file:"Dosya",errFileReaderNotSupported:"FileReader tarayıcınız tarafından desteklenmiyor.",errInvalidImage:"Geçersiz resim dosyası."},zh_tw:{base64:"圖片(base64編碼)",file:"檔案",errFileReaderNotSupported:"你的瀏覽器不支援FileReader",errInvalidImage:"不正確的檔案格式"},pt_br:{base64:"Imagem em base64",file:"Arquivo",errFileReaderNotSupported:"FileReader não é suportado pelo seu navegador.",errInvalidImage:"Arquivo de imagem inválido."},ko:{base64:"그림 넣기(base64)",file:"파일",errFileReaderNotSupported:"FileReader가 현재 브라우저를 지원하지 않습니다.",errInvalidImage:"유효하지 않은 파일"}},plugins:{base64:{shouldInit:t,init:function(i){var r={isSupported:t,fn:function(){i.saveRange();var t,r=i.openModalInsert(i.lang.base64,{file:{type:"file",required:!0,attributes:{accept:"image/*"}},alt:{label:"description",value:i.getRangeText()}},function(o){var a=new FileReader;a.onloadend=function(t){n(t.target.result)?(i.execCmd("insertImage",a.result,!1,!0),e(['img[src="',a.result,'"]:not([alt])'].join(""),i.$box).attr("alt",o.alt),i.closeModal()):i.addErrorOnModalField(e("input[type=file]",r),i.lang.errInvalidImage)},a.readAsDataURL(t)});e("input[type=file]").on("change",function(e){t=e.target.files[0]})}};i.addBtnDef("base64",r)}}}})}(jQuery),define("trumbowyg.base64",["trumbowyg"],function(){}),function(e){"use strict";function t(t){var n=[];return e.each(t.o.plugins.fontfamily.fontList,function(e,i){t.addBtnDef("fontfamily_"+e,{title:'<span style="font-family: '+i.family+';">'+i.name+"</span>",hasIcon:!1,fn:function(){t.execCmd("fontName",i.family,!0)}}),n.push("fontfamily_"+e)}),n}e.extend(!0,e.trumbowyg,{langs:{en:{fontFamily:"Font"},es:{fontFamily:"Fuente"},da:{fontFamily:"Skrifttype"},fr:{fontFamily:"Police"},de:{fontFamily:"Schriftart"},nl:{fontFamily:"Lettertype"},tr:{fontFamily:"Yazı Tipi"},zh_tw:{fontFamily:"字體"},pt_br:{fontFamily:"Fonte"},ko:{fontFamily:"글꼴"}}});var n={fontList:[{name:"Arial",family:"Arial, Helvetica, sans-serif"},{name:"Arial Black",family:"'Arial Black', Gadget, sans-serif"},{name:"Comic Sans",family:"'Comic Sans MS', Textile, cursive, sans-serif"},{name:"Courier New",family:"'Courier New', Courier, monospace"},{name:"Georgia",family:"Georgia, serif"},{name:"Impact",family:"Impact, Charcoal, sans-serif"},{name:"Lucida Console",family:"'Lucida Console', Monaco, monospace"},{name:"Lucida Sans",family:"'Lucida Sans Uncide', 'Lucida Grande', sans-serif"},{name:"Palatino",family:"'Palatino Linotype', 'Book Antiqua', Palatino, serif"},{name:"Tahoma",family:"Tahoma, Geneva, sans-serif"},{name:"Times New Roman",family:"'Times New Roman', Times, serif"},{name:"Trebuchet",family:"'Trebuchet MS', Helvetica, sans-serif"},{name:"Verdana",family:"Verdana, Geneva, sans-serif"}]};e.extend(!0,e.trumbowyg,{plugins:{fontfamily:{init:function(i){i.o.plugins.fontfamily=e.extend({},n,i.o.plugins.fontfamily||{}),i.addBtnDef("fontfamily",{dropdown:t(i),hasIcon:!1,text:i.lang.fontFamily})}}}})}(jQuery),define("trumbowyg.fontfamily",["trumbowyg"],function(){}),function(e){"use strict";function t(t){var n=[];if(e.each(t.o.plugins.fontsize.sizeList,function(e,i){t.addBtnDef("fontsize_"+i,{text:'<span style="font-size: '+i+';">'+(t.lang.fontsizes[i]||i)+"</span>",hasIcon:!1,fn:function(){t.execCmd("fontSize",e+1,!0)}}),n.push("fontsize_"+i)}),t.o.plugins.fontsize.allowCustomSize){var i="fontsize_custom",r={fn:function(){t.openModalInsert(t.lang.fontCustomSize.title,{size:{label:t.lang.fontCustomSize.label,value:t.lang.fontCustomSize.value}},function(n){var i=t.range.startContainer.parentElement,r=t.getRangeText();if(e(i).html()===r)e(i).css("font-size",n.size);else{t.range.deleteContents();var o='<span style="font-size: '+n.size+';">'+r+"</span>",a=e(o)[0];t.range.insertNode(a)}return t.saveRange(),!0})},text:'<span style="font-size: medium;">'+t.lang.fontsizes.custom+"</span>",hasIcon:!1};t.addBtnDef(i,r),n.push(i)}return n}e.extend(!0,e.trumbowyg,{langs:{en:{fontsize:"Font size",fontsizes:{"x-small":"Extra small",small:"Small",medium:"Regular",large:"Large","x-large":"Extra large",custom:"Custom"},fontCustomSize:{title:"Custom Font Size",label:"Font Size",value:"48px"}},es:{fontsize:"Tamaño de Fuente",fontsizes:{"x-small":"Extra pequeña",small:"Pegueña",medium:"Regular",large:"Grande","x-large":"Extra Grande",custom:"Customizada"},fontCustomSize:{title:"Tamaño de Fuente Customizada",label:"Tamaño de Fuente",value:"48px"}},da:{fontsize:"Skriftstørrelse",fontsizes:{"x-small":"Ekstra lille",small:"Lille",medium:"Normal",large:"Stor","x-large":"Ekstra stor",custom:"Brugerdefineret"}},fr:{fontsize:"Taille de la police",fontsizes:{"x-small":"Très petit",small:"Petit",medium:"Normal",large:"Grand","x-large":"Très grand",custom:"Taille personnalisée"},fontCustomSize:{title:"Taille de police personnalisée",label:"Taille de la police",value:"48px"}},de:{fontsize:"Font size",fontsizes:{"x-small":"Sehr klein",small:"Klein",medium:"Normal",large:"Groß","x-large":"Sehr groß",
custom:"Benutzerdefiniert"},fontCustomSize:{title:"Benutzerdefinierte Schriftgröße",label:"Schriftgröße",value:"48px"}},nl:{fontsize:"Lettergrootte",fontsizes:{"x-small":"Extra klein",small:"Klein",medium:"Normaal",large:"Groot","x-large":"Extra groot",custom:"Tilpasset"}},tr:{fontsize:"Yazı Boyutu",fontsizes:{"x-small":"Çok Küçük",small:"Küçük",medium:"Normal",large:"Büyük","x-large":"Çok Büyük",custom:"Görenek"}},zh_tw:{fontsize:"字體大小",fontsizes:{"x-small":"最小",small:"小",medium:"中",large:"大","x-large":"最大",custom:"自訂大小"},fontCustomSize:{title:"自訂義字體大小",label:"字體大小",value:"48px"}},pt_br:{fontsize:"Tamanho da fonte",fontsizes:{"x-small":"Extra pequeno",small:"Pequeno",regular:"Médio",large:"Grande","x-large":"Extra grande",custom:"Personalizado"},fontCustomSize:{title:"Tamanho de Fonte Personalizado",label:"Tamanho de Fonte",value:"48px"}},it:{fontsize:"Dimensioni del testo",fontsizes:{"x-small":"Molto piccolo",small:"piccolo",regular:"normale",large:"grande","x-large":"Molto grande",custom:"Personalizzato"},fontCustomSize:{title:"Dimensioni del testo personalizzato",label:"Dimensioni del testo",value:"48px"}},ko:{fontsize:"글꼴 크기",fontsizes:{"x-small":"아주 작게",small:"작게",medium:"보통",large:"크게","x-large":"아주 크게",custom:"사용자 지정"},fontCustomSize:{title:"사용자 지정 글꼴 크기",label:"글꼴 크기",value:"48px"}}}});var n={sizeList:["x-small","small","medium","large","x-large"],allowCustomSize:!0};e.extend(!0,e.trumbowyg,{plugins:{fontsize:{init:function(i){i.o.plugins.fontsize=e.extend({},n,i.o.plugins.fontsize||{}),i.addBtnDef("fontsize",{dropdown:t(i)})}}}})}(jQuery),define("trumbowyg.fontsize",["trumbowyg"],function(){}),function(e){"use strict";var t={rows:8,columns:8,styler:"table"};e.extend(!0,e.trumbowyg,{langs:{en:{table:"Insert table",tableAddRow:"Add row",tableAddColumn:"Add column",tableDeleteRow:"Delete row",tableDeleteColumn:"Delete column",tableDestroy:"Delete table",error:"Error"},da:{table:"Indsæt tabel",tableAddRow:"Tilføj række",tableAddColumn:"Tilføj kolonne",tableDeleteRow:"Slet række",tableDeleteColumn:"Slet kolonne",tableDestroy:"Slet tabel",error:"Fejl"},de:{table:"Tabelle einfügen",tableAddRow:"Zeile hinzufügen",tableAddColumn:"Spalte hinzufügen",tableDeleteRow:"Zeile löschen",tableDeleteColumn:"Spalte löschen",tableDestroy:"Tabelle löschen",error:"Error"},sk:{table:"Vytvoriť tabuľky",tableAddRow:"Pridať riadok",tableAddColumn:"Pridať stĺpec",error:"Chyba"},fr:{table:"Insérer un tableau",tableAddRow:"Ajouter des lignes",tableAddColumn:"Ajouter des colonnes",tableDeleteRow:"Effacer la ligne",tableDeleteColumn:"Effacer la colonne",tableDestroy:"Effacer le tableau",error:"Erreur"},cs:{table:"Vytvořit příkaz Table",tableAddRow:"Přidat řádek",tableAddColumn:"Přidat sloupec",error:"Chyba"},ru:{table:"Вставить таблицу",tableAddRow:"Добавить строку",tableAddColumn:"Добавить столбец",tableDeleteRow:"Удалить строку",tableDeleteColumn:"Удалить столбец",tableDestroy:"Удалить таблицу",error:"Ошибка"},ja:{table:"表の挿入",tableAddRow:"行の追加",tableAddColumn:"列の追加",error:"エラー"},tr:{table:"Tablo ekle",tableAddRow:"Satır ekle",tableAddColumn:"Kolon ekle",error:"Hata"},zh_tw:{table:"插入表格",tableAddRow:"加入行",tableAddColumn:"加入列",tableDeleteRow:"刪除行",tableDeleteColumn:"刪除列",tableDestroy:"刪除表格",error:"錯誤"},id:{table:"Sisipkan tabel",tableAddRow:"Sisipkan baris",tableAddColumn:"Sisipkan kolom",tableDeleteRow:"Hapus baris",tableDeleteColumn:"Hapus kolom",tableDestroy:"Hapus tabel",error:"Galat"},pt_br:{table:"Inserir tabela",tableAddRow:"Adicionar linha",tableAddColumn:"Adicionar coluna",tableDeleteRow:"Deletar linha",tableDeleteColumn:"Deletar coluna",tableDestroy:"Deletar tabela",error:"Erro"},ko:{table:"표 넣기",tableAddRow:"줄 추가",tableAddColumn:"칸 추가",tableDeleteRow:"줄 삭제",tableDeleteColumn:"칸 삭제",tableDestroy:"표 지우기",error:"에러"}},plugins:{table:{init:function(n){n.o.plugins.table=e.extend(!0,{},t,n.o.plugins.table||{});var i={fn:function(){n.saveRange();var t="table",i=n.o.prefix+"dropdown",a={class:i+"-"+t+" "+i+" "+n.o.prefix+"fixed-top"};a["data-"+i]=t;var s=e("<div/>",a);if(0===n.$box.find("."+i+"-"+t).length?n.$box.append(s.hide()):s=n.$box.find("."+i+"-"+t),s.html(""),n.$box.find("."+n.o.prefix+"table-button").hasClass(n.o.prefix+"active-button"))s.append(n.buildSubBtn("tableAddRow")),s.append(n.buildSubBtn("tableAddColumn")),s.append(n.buildSubBtn("tableDeleteRow")),s.append(n.buildSubBtn("tableDeleteColumn")),s.append(n.buildSubBtn("tableDestroy"));else{for(var l=e("<table/>"),c=0;c<n.o.plugins.table.rows;c+=1)for(var u=e("<tr/>").appendTo(l),d=0;d<n.o.plugins.table.columns;d+=1)e("<td/>").appendTo(u);l.find("td").on("mouseover",r),l.find("td").on("mousedown",o),s.append(l),s.append(e('<div class="trumbowyg-table-size">1x1</div>'))}n.dropdown(t)}},r=function(t){var n=e(t.target),i=n.closest("table"),r=this.cellIndex,o=this.parentNode.rowIndex;i.find("td").removeClass("active");for(var a=0;a<=o;a+=1)for(var s=0;s<=r;s+=1)i.find("tr:nth-of-type("+(a+1)+")").find("td:nth-of-type("+(s+1)+")").addClass("active");i.next(".trumbowyg-table-size").html(r+1+"x"+(o+1))},o=function(){n.saveRange();var t=e("<table/>");n.o.plugins.table.styler&&t.attr("class",n.o.plugins.table.styler);for(var i=this.cellIndex,r=this.parentNode.rowIndex,o=0;o<=r;o+=1)for(var a=e("<tr></tr>").appendTo(t),s=0;s<=i;s+=1)e("<td/>").appendTo(a);n.range.deleteContents(),n.range.insertNode(t[0]),n.$c.trigger("tbwchange")},a={title:n.lang.tableAddRow,text:n.lang.tableAddRow,ico:"row-below",fn:function(){n.saveRange();var t=n.doc.getSelection().focusNode,i=e(t).closest("table");if(i.length>0){for(var r=e("<tr/>"),o=0;o<i.find("tr")[0].childElementCount;o+=1)e("<td/>").appendTo(r);r.appendTo(i)}n.syncCode()}},s={title:n.lang.tableAddColumn,text:n.lang.tableAddColumn,ico:"col-right",fn:function(){n.saveRange();var t=n.doc.getSelection().focusNode,i=e(t).closest("table");i.length>0&&e(i).find("tr").each(function(){e(this).find("td:last").after("<td></td>")}),n.syncCode()}},l={title:n.lang.tableDestroy,text:n.lang.tableDestroy,ico:"table-delete",fn:function(){n.saveRange();var t=n.doc.getSelection().focusNode;e(t).closest("table").remove(),n.syncCode()}},c={title:n.lang.tableDeleteRow,text:n.lang.tableDeleteRow,ico:"row-delete",fn:function(){n.saveRange();var t=n.doc.getSelection().focusNode;e(t).closest("tr").remove(),n.syncCode()}},u={title:n.lang.tableDeleteColumn,text:n.lang.tableDeleteColumn,ico:"col-delete",fn:function(){n.saveRange();var t=n.doc.getSelection().focusNode,i=e(t).closest("table"),r=e(t).closest("td"),o=r.index();e(i).find("tr").each(function(){e(this).find("td:eq("+o+")").remove()}),n.syncCode()}};n.addBtnDef("table",i),n.addBtnDef("tableAddRow",a),n.addBtnDef("tableAddColumn",s),n.addBtnDef("tableDeleteRow",c),n.addBtnDef("tableDeleteColumn",u),n.addBtnDef("tableDestroy",l)}}}})}(jQuery),define("trumbowyg.table",["trumbowyg"],function(){}),function(e){"use strict";function t(){var e,t=null;return window.getSelection?(e=window.getSelection(),e.rangeCount&&(t=e.getRangeAt(0).commonAncestorContainer,1!==t.nodeType&&(t=t.parentNode))):(e=document.selection)&&"Control"!==e.type&&(t=e.createRange().parentElement()),t}function n(e){var t=document.createElement("DIV");return t.innerHTML=e,t.textContent||t.innerText||""}function i(){var t=null;if(document.selection)t=document.selection.createRange().parentElement();else{var n=window.getSelection();n.rangeCount>0&&(t=n.getRangeAt(0).startContainer.parentNode)}var i=e(t).contents().closest("pre").length,r=e(t).contents().closest("code").length;i&&r?e(t).contents().unwrap("code").unwrap("pre"):i?e(t).contents().unwrap("pre"):r&&e(t).contents().unwrap("code")}e.extend(!0,e.trumbowyg,{langs:{en:{preformatted:"Code sample <pre>"},da:{preformatted:"Præformateret <pre>"},fr:{preformatted:"Exemple de code <pre>"},it:{preformatted:"Codice <pre>"},zh_cn:{preformatted:"代码示例 <pre>"},ru:{preformatted:"Пример кода <pre>"},ja:{preformatted:"コードサンプル <pre>"},tr:{preformatted:"Kod örneği <pre>"},zh_tw:{preformatted:"代碼範例 <pre>"},pt_br:{preformatted:"Exemple de código <pre>"},ko:{preformatted:"코드 예제 <pre>"}},plugins:{preformatted:{init:function(e){var r={fn:function(){e.saveRange();var r=e.getRangeText();if(""!==r.replace(/\s/g,""))try{var o=t().tagName.toLowerCase();if("code"===o||"pre"===o)return i();e.execCmd("insertHTML","<pre><code>"+n(r)+"</code></pre>")}catch(e){}},tag:"pre"};e.addBtnDef("preformatted",r)}}}})}(jQuery),define("trumbowyg.preformatted",["trumbowyg"],function(){}),function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{de:{history:{redo:"Wiederholen",undo:"Rückgängig"}},en:{history:{redo:"Redo",undo:"Undo"}},da:{history:{redo:"Annuller fortryd",undo:"Fortryd"}},fr:{history:{redo:"Annuler",undo:"Rétablir"}},zh_tw:{history:{redo:"重做",undo:"復原"}},pt_br:{history:{redo:"Refazer",undo:"Desfazer"}},ko:{history:{redo:"다시 실행",undo:"되돌리기"}}},plugins:{history:{init:function(t){t.o.plugins.history=e.extend(!0,{_stack:[],_index:-1,_focusEl:void 0},t.o.plugins.history||{});var n={title:t.lang.history.redo,ico:"redo",key:"Y",fn:function(){if(t.o.plugins.history._index<t.o.plugins.history._stack.length-1){t.o.plugins.history._index+=1;var e=t.o.plugins.history._index,n=t.o.plugins.history._stack[e];t.execCmd("html",n),t.o.plugins.history._stack[e]=t.$ed.html(),l(),o()}}},i={title:t.lang.history.undo,ico:"undo",key:"Z",fn:function(){if(t.o.plugins.history._index>0){t.o.plugins.history._index-=1;var e=t.o.plugins.history._index,n=t.o.plugins.history._stack[e];t.execCmd("html",n),t.o.plugins.history._stack[e]=t.$ed.html(),l(),o()}}},r=function(){var n,i,r=t.o.plugins.history._index,a=t.o.plugins.history._stack,l=a.slice(-1)[0]||"<p></p>",c=a[r],u=t.$ed.html(),d=t.doc.getSelection().focusNode,h="",f=t.o.plugins.history._focusEl;n=e("<div>"+l+"</div>").find("*").map(function(){return this.localName}),i=e("<div>"+u+"</div>").find("*").map(function(){return this.localName}),d&&(t.o.plugins.history._focusEl=d,h=d.outerHTML||d.textContent),u!==c&&(h.slice(-1).match(/\s/)||!s(n,i)||t.o.plugins.history._index<=0||d!==f?(t.o.plugins.history._index+=1,t.o.plugins.history._stack=a.slice(0,t.o.plugins.history._index),t.o.plugins.history._stack.push(u)):t.o.plugins.history._stack[r]=u,o())},o=function(){var e=t.o.plugins.history._index,n=t.o.plugins.history._stack.length,i=e>0,r=0!==n&&e!==n-1;a("historyUndo",i),a("historyRedo",r)},a=function(e,n){var i=t.$box.find(".trumbowyg-"+e+"-button");n?i.removeClass("trumbowyg-disable"):i.hasClass("trumbowyg-disable")||i.addClass("trumbowyg-disable")},s=function(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0},l=function(){var e=t.doc.getSelection().focusNode,n=t.doc.createRange();e.childNodes.length>0&&(n.setStartAfter(e.childNodes[e.childNodes.length-1]),n.setEndAfter(e.childNodes[e.childNodes.length-1]),t.doc.getSelection().removeAllRanges(),t.doc.getSelection().addRange(n))};t.$c.on("tbwinit tbwchange",r),t.addBtnDef("historyRedo",n),t.addBtnDef("historyUndo",i)}}}})}(jQuery),define("trumbowyg.history",["trumbowyg"],function(){}),function(e){"use strict";function t(t){var n=t.o.plugins.templates,i=[];return e.each(n,function(e,n){t.addBtnDef("template_"+e,{fn:function(){t.execCmd("insertHTML",n.html)},hasIcon:!1,title:n.name}),i.push("template_"+e)}),i}e.extend(!0,e.trumbowyg,{langs:{en:{template:"Template"},da:{template:"Skabelon"},fr:{template:"Patron"},nl:{template:"Sjabloon"},ru:{template:"Шаблон"},ja:{template:"テンプレート"},tr:{template:"Şablon"},zh_tw:{template:"模板"},pt_br:{template:"Modelo"},ko:{template:"서식"}}}),e.extend(!0,e.trumbowyg,{plugins:{template:{shouldInit:function(e){return e.o.plugins.hasOwnProperty("templates")},init:function(e){e.addBtnDef("template",{dropdown:t(e),hasIcon:!1,text:e.lang.template})}}}})}(jQuery),define("trumbowyg.template",["trumbowyg"],function(){}),define("pgui.editors/html",["pgui.editors/plain","underscore","trumbowyg","trumbowyg.colors","trumbowyg.specialchars","trumbowyg.base64","trumbowyg.fontfamily","trumbowyg.fontsize","trumbowyg.table","trumbowyg.preformatted","trumbowyg.history","trumbowyg.template"],function(e){return $.trumbowyg.svgPath="components/assets/img/vendor/trumbowyg/trumbowyg-icons.svg",e.extend({init:function(e,t){this._super(e,t);var n=this,i=[];e.closest(".form-group").find(".html-templates").children().each(function(e,t){var n=$(t);i.push({name:n.data("template-name"),html:n.html()})}),e.trumbowyg({resetCss:!0,btnsDef:{image:{dropdown:["insertImage","base64"],ico:"insertImage"}},btns:[["viewHTML"],["historyUndo","historyRedo"],["formatting"],["strong","em","underline","del"],["superscript","subscript"],["fontfamily","fontsize"],["justifyLeft","justifyCenter","justifyRight","justifyFull"],["unorderedList","orderedList"],["link"],["table","image","specialChars"],["template"],["foreColor","backColor"],"btnGrp-justify","btnGrp-lists",["preformatted"],["horizontalRule"],["removeformat"],["fullscreen"]],plugins:{templates:i}}),this.rootElement.on("tbwchange",function(){n.doChanged()})},getValue:function(e){return this.rootElement.trumbowyg("html")},setValue:function(e){return this.rootElement.trumbowyg("html",e),this},setEnabled:function(e){return this._super(e),this.rootElement.trumbowyg(e?"enable":"disable"),this},setReadonly:function(e){return this._super(e),this.setEnabled(!e),this},destroy:function(){this.rootElement.trumbowyg("destroy")}})}),define("pgui.editors/image_uploader",["pgui.editors/plain"],function(e){return e.extend({init:function(e,t){this._super(e,t);var n=e.closest(".form-group"),i=n.find(".btn-group[data-toggle-name]"),r=n.find("[name="+i.data("toggle-name")+"]");this.$replaceButton=i.find(".js-replace").first(),this.$image=n.find("img").first(),this.isImageBased=1==this.$image.length,this.oldImageSource=this.$image.attr("src"),this.newImageSource=this.oldImageSource;var o=this;i.on("click","button",function(){i.find("button").removeClass("active");var e=$(this).addClass("active");r.val(e.val()),o.isImageBased&&o._setImageProperties(e.val())}),i.find("button[value="+r.val()+"]").addClass("active")},doChanged:function(){this.isImageBased?this._processNewImage():(this.$replaceButton.prop("disabled",!1),this.$replaceButton.click()),this._super()},_setImageProperties:function(e){this.$image.toggle("Remove"!=e),"Keep"==e?this.$image.attr("src",this.oldImageSource):"Replace"==e&&this.$image.attr("src",this.newImageSource)},_processNewImage:function(){var e=this,t=new FileReader;t.addEventListener("load",function(){e.newImageSource=t.result,e.$replaceButton.prop("disabled",!1),e.$replaceButton.click()},!1);var n=this.rootElement.get(0).files[0];n&&t.readAsDataURL(n)}})}),define("pgui.editors/multivalue_select",["underscore","pgui.editors/custom","libs/select2","locales/select2_locale"],function(e,t){return t.extend({init:function(t,n){this._super(t,n);var i=this,r=$(t),o=r.attr("data-max-selection-size"),a=r.attr("data-placeholder");r.select2({width:"100%",maximumSelectionSize:o,placeholder:a}),r.attr("readonly")&&this.setReadonly(!0),$("label[for="+r.attr("id")+"]").on("click",function(){r.select2("focus")}),r.on("change",function(){if("function"==typeof r.valid){var t=$(this.form);t.length&&e.keys(t.data("validator").submitted).length&&r.valid()}i.doChanged()})},getValue:function(){return this.rootElement.select2("val")},getDisplayValue:function(){return e.map(this.rootElement.select2("data"),function(e){return e.text})},setValue:function(t){return t.split?this.rootElement.select2("val",t.split(",")):e.isArray(t)?this.rootElement.select2("val",t):console.error("'value' must be string or array, '"+typeof t+"' given"),this},getEnabled:function(){return!this.rootElement.prop("disabled")},setEnabled:function(e){return this.rootElement.prop("disabled",!e),this.rootElement.select2("enable",!!e),this},getReadonly:function(){return!!this.rootElement.data("readonly")},setReadonly:function(e){return this.rootElement.select2("readonly",!!e),this.rootElement.data("readonly",!!e),this},addItem:function(e,t){return this.rootElement.append($("<option value='"+e+"'>"+t+"</option>")),this},removeItem:function(e){return this.rootElement.find("option[value="+e+"]").remove(),this},getItems:function(){return this.rootElement.find("option").map(function(e,t){var n=$(t);return{value:n.val(),caption:n.text()}})},getItemCount:function(){return this.rootElement.find("option").length},clear:function(){return this.rootElement.find("option").remove(),this},isMultivalue:function(){return!0}})}),define("pgui.editors/remote_multivalue_select",["underscore","pgui.editors/custom","libs/select2","locales/select2_locale"],function(e,t){return t.extend({init:function(t,n){this.queryFunction=function(e){return{term:e}},this._super(t,n);var i=$(t),r=i.attr("data-max-selection-size"),o=this;this.bind("submit.pgui.nested-insert",function(e,t,n){var i=this.getValue(),r=n[e.data("stored-field-name")];i.push(r.toString()),this.setValue(i)}.bind(this)),i.on("change",this.doChanged.bind(this)),i.select2({multiple:!0,maximumSelectionSize:r,ajax:{url:i.attr("data-url"),dataType:"json",results:function(e){return{results:$.map(e,function(e){return{id:e.id,text:e.value,fields:e.fields}})}},data:function(e){return o.queryFunction(e)}},initSelection:function(t,n){if(0===t.val().length)return void n([]);var r=t.val().split(","),a=[];e.each(r,function(e,t){a.push({id:e})});var s=0;e.each(r,function(e,t){$.ajax({url:i.data("url"),data:{id:e},dataType:"json"}).done(function(i){$.each(i,function(i,l){if(l.id==e)return s++,a[t].text=l.value,a[t].fields=l.fields,s===r.length&&(n(a),o.rootElement.trigger("select2-init")),!1})})})},width:"100%"})},getValue:function(){return this.rootElement.select2("val")},getDisplayValue:function(){return e.map(this.rootElement.select2("data"),function(e){return e.text})},setValue:function(t){return t.split?this.rootElement.select2("val",t.split(",")):e.isArray(t)?this.rootElement.select2("val",t):console.error("'value' must be string or array, '"+typeof t+"' given"),this},getEnabled:function(){return!this.rootElement.prop("disabled")},setEnabled:function(e){return this.rootElement.prop("disabled",!e),this.rootElement.select2("enable",!!e),this},getReadonly:function(){return!!this.rootElement.data("readonly")},setReadonly:function(e){return this.rootElement.select2("readonly",!!e),this.rootElement.data("readonly",!!e),this},isMultivalue:function(){return!0},setQueryFunction:function(e){return this.queryFunction=e,this}})}),define("pgui.editors/radio",["pgui.editors/custom","underscore"],function(e,t){var n='<input type="radio" name="<%=editorName%>" value="<%=value%>"><%=caption%>',i=t.template('<div class="radio js-value"><label>'+n+"</label></div>"),r=t.template('<label class="radio-inline js-value">'+n+"</label>");return e.extend({init:function(e,n){this._super(e,n),this.rootElement.find("input").change(t.bind(function(){this.doChanged()},this)),this.bind("submit.pgui.nested-insert",function(e,t,n){this.addItem(t,n[e.data("display-field-name")]),this.setValue(t)}.bind(this))},getValue:function(){return this.rootElement.find("input:checked").val()},setValue:function(e){return this.rootElement.find("input").each(function(t,n){$(n).attr("value")==e&&$(n).prop("checked",!0)}),this},getEnabled:function(){return this.rootElement.find("input:enabled").length>0},setEnabled:function(e){return this.rootElement.find("input").each(function(t,n){e?$(n).removeAttr("disabled"):$(n).attr("disabled",!0)}),this},getReadonly:function(){return 1===this.rootElement.find("input:enabled").length},setReadonly:function(e){return this.rootElement.find("input").each(function(t,n){e?$(n).attr("checked")||$(n).attr("disabled",!0):$(n).removeAttr("disabled")}),this},clear:function(){return this.rootElement.find(".radio, .radio-inline").remove(),this},addItem:function(e,t){var n=this.rootElement,o=n.data("inline"),a={editorName:n.attr("data-editor-name"),value:e,caption:t},s=$(o?r(a):i(a));return this.getItemCount()>0?n.find(".js-value").last().after(s):n.prepend(s),this},removeItem:function(e){return this.rootElement.find("input[value='"+e+"']").parent().remove(),this},getItems:function(){return this.rootElement.find("input").map(function(e,t){return{value:$(t).attr("value"),caption:$(t).closest("label").text()}})},getItemCount:function(){return this.rootElement.find("input").length},getCaption:function(){return this.rootElement.find("input:checked").parent().text()},_getSetRequiredTarget:function(){return this.rootElement.find("input[type=radio]")}})}),define("pgui.editors/text",["pgui.editors/plain"],function(e){return e.extend({getPlaceholder:function(){return this._getAttribute("placeholder")},setPlaceholder:function(e){return this._setAttribute("placeholder",e),this}})}),function(e){"function"==typeof define&&define.amd?define("jquery.maskedinput",["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){var t,n=navigator.userAgent,i=/iphone/i.test(n),r=/chrome/i.test(n),o=/android/i.test(n);e.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"},e.fn.extend({caret:function(e,t){var n;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof e?(t="number"==typeof t?t:e,this.each(function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&(n=this.createTextRange(),n.collapse(!0),n.moveEnd("character",t),n.moveStart("character",e),n.select())})):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),e=0-n.duplicate().moveStart("character",-1e5),t=e+n.text.length),{begin:e,end:t})},unmask:function(){return this.trigger("unmask")},mask:function(n,a){var s,l,c,u,d,h,f,p;if(!n&&this.length>0){s=e(this[0]);var m=s.data(e.mask.dataName);return m?m():void 0}return a=e.extend({autoclear:e.mask.autoclear,placeholder:e.mask.placeholder,completed:null},a),l=e.mask.definitions,c=[],u=f=n.length,d=null,e.each(n.split(""),function(e,t){"?"==t?(f--,u=e):l[t]?(c.push(new RegExp(l[t])),null===d&&(d=c.length-1),u>e&&(h=c.length-1)):c.push(null)}),this.trigger("unmask").each(function(){function s(){if(a.completed){for(var e=d;h>=e;e++)if(c[e]&&D[e]===m(e))return;a.completed.call(T)}}function m(e){return a.placeholder.charAt(e<a.placeholder.length?e:0)}function g(e){for(;++e<f&&!c[e];);return e}function v(e){for(;--e>=0&&!c[e];);return e}function b(e,t){var n,i;if(!(0>e)){for(n=e,i=g(t);f>n;n++)if(c[n]){if(!(f>i&&c[n].test(D[i])))break;D[n]=D[i],D[i]=m(i),i=g(i)}S(),T.caret(Math.max(d,e))}}function y(e){var t,n,i,r;for(t=e,n=m(e);f>t;t++)if(c[t]){if(i=g(t),r=D[t],D[t]=n,!(f>i&&c[i].test(r)))break;n=r}}function w(){var e=T.val(),t=T.caret();if(p&&p.length&&p.length>e.length){for(E(!0);t.begin>0&&!c[t.begin-1];)t.begin--;if(0===t.begin)for(;t.begin<d&&!c[t.begin];)t.begin++;T.caret(t.begin,t.begin)}else{for(E(!0);t.begin<f&&!c[t.begin];)t.begin++;T.caret(t.begin,t.begin)}s()}function x(){E(),T.val()!=A&&T.change()}function C(e){if(!T.prop("readonly")){var t,n,r,o=e.which||e.keyCode;p=T.val(),8===o||46===o||i&&127===o?(t=T.caret(),n=t.begin,r=t.end,r-n==0&&(n=46!==o?v(n):r=g(n-1),r=46===o?g(r):r),_(n,r),b(n,r-1),e.preventDefault()):13===o?x.call(this,e):27===o&&(T.val(A),T.caret(0,E()),e.preventDefault())}}function k(t){if(!T.prop("readonly")){var n,i,r,a=t.which||t.keyCode,l=T.caret();if(!(t.ctrlKey||t.altKey||t.metaKey||32>a)&&a&&13!==a){if(l.end-l.begin!=0&&(_(l.begin,l.end),b(l.begin,l.end-1)),n=g(l.begin-1),f>n&&(i=String.fromCharCode(a),c[n].test(i))){if(y(n),D[n]=i,S(),r=g(n),o){var u=function(){e.proxy(e.fn.caret,T,r)()};setTimeout(u,0)}else T.caret(r);l.begin<=h&&s()}t.preventDefault()}}}function _(e,t){var n;for(n=e;t>n&&f>n;n++)c[n]&&(D[n]=m(n))}function S(){T.val(D.join(""))}function E(e){var t,n,i,r=T.val(),o=-1;for(t=0,i=0;f>t;t++)if(c[t]){for(D[t]=m(t);i++<r.length;)if(n=r.charAt(i-1),c[t].test(n)){D[t]=n,o=t;break}if(i>r.length){_(t+1,f);break}}else D[t]===r.charAt(i)&&i++,u>t&&(o=t);return e?S():u>o+1?a.autoclear||D.join("")===$?(T.val()&&T.val(""),_(0,f)):S():(S(),T.val(T.val().substring(0,o+1))),u?t:d}var T=e(this),D=e.map(n.split(""),function(e,t){return"?"!=e?l[e]?m(t):e:void 0}),$=D.join(""),A=T.val();T.data(e.mask.dataName,function(){return e.map(D,function(e,t){return c[t]&&e!=m(t)?e:null}).join("")}),T.one("unmask",function(){T.off(".mask").removeData(e.mask.dataName)}).on("focus.mask",function(){if(!T.prop("readonly")){clearTimeout(t);var e;A=T.val(),e=E(),t=setTimeout(function(){T.get(0)===document.activeElement&&(S(),e==n.replace("?","").length?T.caret(0,e):T.caret(e))},10)}}).on("blur.mask",x).on("keydown.mask",C).on("keypress.mask",k).on("input.mask paste.mask",function(){T.prop("readonly")||setTimeout(function(){var e=E(!0);T.caret(e),s()},0)}),r&&o&&T.off("input.mask").on("input.mask",w),E()})}})}),define("pgui.editors/mask",["pgui.editors/plain","jquery.maskedinput"],function(e){return e.extend({init:function(e,t){this._super(e,t),""!=e.attr("mask")&&e.mask(e.attr("mask"))}})}),define("pgui.editors/cascading_combobox",["pgui.editors/custom","pgui.editors/combobox","jquery.query"],function(e,t){return e.extend({init:function(e,t){this.levels=[],this._processElement(e),this._super(e,t),this.setReadonly(this.getReadonly()),this.bind("submit.pgui.nested-insert",function(e,t,n){for(var i=e.closest(".input-group").find("select"),r=0;r<this.levels.length;r++)this.levels[r].rootElement.attr("data-id")==i.attr("data-id")&&(this._addLevelValue(this.levels[r],e,t,n[e.data("display-field-name")]),r==this.levels.length-1&&this.doChanged())}.bind(this))},_processElement:function(e){var n=$(e),i=this,r=n.find("select");r.each(function(e,n){var r=$(n);i.levels.push(new t(r))});for(var o=0;o<i.levels.length;o++)!function(){var e=i.levels[o],t=o-1<0?null:i.levels[o-1];if(t){var n=e.rootElement.closest("td").find(".js-nested-insert");i.updateNestedInsertLink(t,e,n),e.setEnabled(t.getValue()&&t.getEnabled()),n.prop("disabled",!e.getEnabled()),t.onChange(function(){var r=this.getValue()&&this.getEnabled();e.setEnabled(!1),n.prop("disabled",!0),e.clear(),e.doChanged(),r&&$.ajax({url:e.rootElement.data("url"),data:{term2:t.getValue()},dataType:"json"}).done(function(r){$.each(r,function(t,n){e.addItem(n.id,n.value)}),e.setEnabled(!0),n.prop("disabled",!1),i.updateNestedInsertLink(t,e,n)})})}}();r.eq(r.length-1).on("change",function(){i.doChanged()})},_addLevelValue:function(e,t,n,i){e.addItem(n,i),e.setValue(n),e.doChanged()},updateNestedInsertLink:function(e,t,n){if(e.getValue()&&n.length>0){var i=jQuery.query.load(n.data("content-link")).set("parent-field-name",t.rootElement.data("parent-link-field-name")).set("parent-field-value",e.getValue()).toString();n.data("content-link",i)}},_getMainControl:function(){return this.rootElement.find("[data-editor-main]")},getValue:function(){return this._getMainControl().val()},setReadonly:function(e){e?(this.rootElement.attr("readonly","readonly"),this.rootElement.find(".js-nested-insert").attr("disabled","disabled")):(this.rootElement.removeAttr("readonly"),this.rootElement.find(".js-nested-insert").removeAttr("disabled"));for(var t=0;t<this.levels.length;t++){this.levels[t].setReadonly(e)}return this},getReadonly:function(){return Boolean(this.rootElement.attr("readonly"))}})}),define("pgui.editors/dynamic_cascading_combobox",["underscore","pgui.editors/custom","pgui.editors/select2_format","locales/select2_locale","libs/select2"],function(e,t,n){return t.extend({init:function(e,t){this._super(e,t),this.formatFunctions=new n,this._processElement(e),this.bind("submit.pgui.nested-insert",function(e,t,n){var i=e.closest(".input-group").find("input[name]");i.length>0&&this.setLevelValue(i,t,n[e.data("display-field-name")])}.bind(this))},_processElement:function(e){var t=$(e),n=this,i=t.find("input");i.each(function(e,i){var r=$(i),o=r.data("parent-level"),a=t.find("[data-id="+o+"]"),s=r.closest(".input-group").find(".js-nested-insert"),l=function(){var e=!a.val()||a.prop("readonly");r.prop("readonly",e),r.select2("readonly",e),s.prop("disabled",e),a.length>0&&n.updateNestedInsertLink(a,r,s)},c=function(){r.trigger("change",!r.val()),r.select2("val",null)};o&&a&&(a.on("change select2-data-change",function(){l(),c()}),l()),n.formatFunctions.setFormatCallbacksFromElement(r,e),r.select2({ajax:{url:r.attr("data-url"),data:function(e){var t={term:e};return o&&(t.term2=a.val()),t},dataType:"json",method:"GET",results:function(e){return{results:$.map(e,function(e){return{id:e.id,text:e.value}})}}},initSelection:function(e,t){t({id:e.val(),text:e.data("init-text")})},width:"resolve",allowClear:r.data("allowclear"),minimumInputLength:r.data("minimal-input-length"),formatSelection:n.formatFunctions.getFormatClojure("selection",e),formatResult:n.formatFunctions.getFormatClojure("result",e)})}),i.eq(i.length-1).on("change",function(e,t){n.setState("normal"),t||n.doChanged()})},_getMainControl:function(){return this.rootElement.find("[data-multileveledit-main]")},getValue:function(){return this._getMainControl().val()},getData:function(){return this.rootElement.find("input[type=hidden]").map(function(e,t){return $(t).select2("data")})},setData:function(e){return this.rootElement.find("input[type=hidden]").each(function(t,n){e[t]&&$(n).select2("data",e[t]).trigger("select2-data-change")}.bind(this)),this},getEnabled:function(){return!this.rootElement.find("input[name]").first().prop("disabled")},setEnabled:function(e){var t=this.rootElement.find("input[name]");return t.prop("disabled",!e),t.select2("enable",!!e),this},getReadonly:function(){return!!this.rootElement.find("input[name]").first().prop("readonly")},setReadonly:function(e){var t=this.rootElement.find("input[name]");return t.prop("readonly",!!e),t.select2("readonly",!!e),this},setFormatSelection:function(e,t){return this.formatFunctions.setCallback("selection",t,e),this._triggerChangeLevel(e),this},setFormatResult:function(e,t){return this.formatFunctions.setCallback("result",t,e),this._triggerChangeLevel(e),this},_getSetRequiredTarget:function(){return this.rootElement.find("input[data-id]").last()},_triggerChangeLevel:function(e){var t=$(this.rootElement).find("input[type=hidden]").eq(e);if(!t)return void console.error("invalid level "+e);t.select2&&t.select2("data",t.select2("data"))},setLevelValue:function(e,t,n){e.val(t),e.data("init-text",n),e.select2&&(e.select2("val",e.val()),e.trigger("change"))},updateNestedInsertLink:function(e,t,n){if(e.val()&&n.length>0){var i=jQuery.query.load(n.data("content-link")).set("parent-field-name",t.data("parent-link-field-name")).set("parent-field-value",e.val()).toString();n.data("content-link",i)}}})}),define("pgui.editors/static_editor",["pgui.editors/custom"],function(e){return e.extend({getValue:function(){return this.rootElement.html()},setValue:function(e){return this.rootElement.html(e),this}})}),function(e){"use strict";"function"==typeof define&&define.amd?define("bootstrap-file-input",["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(window.jQuery)}(function(e){"use strict";e.fn.fileinputLocales={},e.fn.fileinputThemes={},String.prototype.setTokens=function(e){var t,n,i=this.toString();for(t in e)e.hasOwnProperty(t)&&(n=new RegExp("{"+t+"}","g"),i=i.replace(n,e[t]));return i};var t,n;t={FRAMES:".kv-preview-thumb",SORT_CSS:"file-sortable",OBJECT_PARAMS:'<param name="controller" value="true" />\n<param name="allowFullScreen" value="true" />\n<param name="allowScriptAccess" value="always" />\n<param name="autoPlay" value="false" />\n<param name="autoStart" value="false" />\n<param name="quality" value="high" />\n',DEFAULT_PREVIEW:'<div class="file-preview-other">\n<span class="{previewFileIconClass}">{previewFileIcon}</span>\n</div>',MODAL_ID:"kvFileinputModal",MODAL_EVENTS:["show","shown","hide","hidden","loaded"],objUrl:window.URL||window.webkitURL,compare:function(e,t,n){return void 0!==e&&(n?e===t:e.match(t))},isIE:function(e){
if("Microsoft Internet Explorer"!==navigator.appName)return!1;if(10===e)return new RegExp("msie\\s"+e,"i").test(navigator.userAgent);var t,n=document.createElement("div");return n.innerHTML="\x3c!--[if IE "+e+"]> <i></i> <![endif]--\x3e",t=n.getElementsByTagName("i").length,document.body.appendChild(n),n.parentNode.removeChild(n),t},initModal:function(t){var n=e("body");n.length&&t.appendTo(n)},isEmpty:function(t,n){return void 0===t||null===t||0===t.length||n&&""===e.trim(t)},isArray:function(e){return Array.isArray(e)||"[object Array]"===Object.prototype.toString.call(e)},ifSet:function(e,t,n){return n=n||"",t&&"object"==typeof t&&e in t?t[e]:n},cleanArray:function(e){return e instanceof Array||(e=[]),e.filter(function(e){return void 0!==e&&null!==e})},spliceArray:function(e,t){var n,i=0,r=[];if(!(e instanceof Array))return[];for(n=0;n<e.length;n++)n!==t&&(r[i]=e[n],i++);return r},getNum:function(e,t){return t=t||0,"number"==typeof e?e:("string"==typeof e&&(e=parseFloat(e)),isNaN(e)?t:e)},hasFileAPISupport:function(){return!(!window.File||!window.FileReader)},hasDragDropSupport:function(){var e=document.createElement("div");return!t.isIE(9)&&(void 0!==e.draggable||void 0!==e.ondragstart&&void 0!==e.ondrop)},hasFileUploadSupport:function(){return t.hasFileAPISupport()&&window.FormData},hasBlobSupport:function(){try{return!!window.Blob&&Boolean(new Blob)}catch(e){return!1}},hasArrayBufferViewSupport:function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(e){return!1}},dataURI2Blob:function(e){var n,i,r,o,a,s,l=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,c=t.hasBlobSupport();if(!((c||l)&&window.atob&&window.ArrayBuffer&&window.Uint8Array))return null;for(n=e.split(",")[0].indexOf("base64")>=0?atob(e.split(",")[1]):decodeURIComponent(e.split(",")[1]),i=new ArrayBuffer(n.length),r=new Uint8Array(i),o=0;o<n.length;o+=1)r[o]=n.charCodeAt(o);return a=e.split(",")[0].split(":")[1].split(";")[0],c?new Blob([t.hasArrayBufferViewSupport()?r:i],{type:a}):(s=new l,s.append(i),s.getBlob(a))},arrayBuffer2String:function(e){if(window.TextDecoder)return new TextDecoder("utf-8").decode(e);var t,n,i,r,o=Array.prototype.slice.apply(new Uint8Array(e)),a="",s=0;for(t=o.length;s<t;)switch((n=o[s++])>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:a+=String.fromCharCode(n);break;case 12:case 13:i=o[s++],a+=String.fromCharCode((31&n)<<6|63&i);break;case 14:i=o[s++],r=o[s++],a+=String.fromCharCode((15&n)<<12|(63&i)<<6|(63&r)<<0)}return a},isHtml:function(e){var t=document.createElement("div");t.innerHTML=e;for(var n=t.childNodes,i=n.length;i--;)if(1===n[i].nodeType)return!0;return!1},isSvg:function(e){return e.match(/^\s*<\?xml/i)&&(e.match(/<!DOCTYPE svg/i)||e.match(/<svg/i))},getMimeType:function(e,t,n){switch(e){case"ffd8ffe0":case"ffd8ffe1":case"ffd8ffe2":return"image/jpeg";case"89504E47":return"image/png";case"47494638":return"image/gif";case"49492a00":return"image/tiff";case"52494646":return"image/webp";case"66747970":return"video/3gp";case"4f676753":return"video/ogg";case"1a45dfa3":return"video/mkv";case"000001ba":case"000001b3":return"video/mpeg";case"3026b275":return"video/wmv";case"25504446":return"application/pdf";case"25215053":return"application/ps";case"504b0304":case"504b0506":case"504b0508":return"application/zip";case"377abcaf":return"application/7z";case"75737461":return"application/tar";case"7801730d":return"application/dmg";default:switch(e.substring(0,6)){case"435753":return"application/x-shockwave-flash";case"494433":return"audio/mp3";case"425a68":return"application/bzip";default:switch(e.substring(0,4)){case"424d":return"image/bmp";case"fffb":return"audio/mp3";case"4d5a":return"application/exe";case"1f9d":case"1fa0":return"application/zip";case"1f8b":return"application/gzip";default:return t&&!t.match(/[^\u0000-\u007f]/)?"application/text-plain":n}}}},addCss:function(e,t){e.removeClass(t).addClass(t)},getElement:function(n,i,r){return t.isEmpty(n)||t.isEmpty(n[i])?r:e(n[i])},uniqId:function(){return Math.round((new Date).getTime())+"_"+Math.round(100*Math.random())},htmlEncode:function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")},replaceTags:function(t,n){var i=t;return n?(e.each(n,function(e,t){"function"==typeof t&&(t=t()),i=i.split(e).join(t)}),i):i},cleanMemory:function(e){var n=e.is("img")?e.attr("src"):e.find("source").attr("src");t.objUrl.revokeObjectURL(n)},findFileName:function(e){var t=e.lastIndexOf("/");return-1===t&&(t=e.lastIndexOf("\\")),e.split(e.substring(t,t+1)).pop()},checkFullScreen:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},toggleFullScreen:function(e){var n=document,i=n.documentElement;i&&e&&!t.checkFullScreen()?i.requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullscreen&&i.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):n.exitFullscreen?n.exitFullscreen():n.msExitFullscreen?n.msExitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.webkitExitFullscreen&&n.webkitExitFullscreen()},moveArray:function(e,t,n){if(n>=e.length)for(var i=n-e.length;1+i--;)e.push(void 0);return e.splice(n,0,e.splice(t,1)[0]),e},cleanZoomCache:function(e){var t=e.closest(".kv-zoom-cache-theme");t.length||(t=e.closest(".kv-zoom-cache")),t.remove()},setOrientation:function(e,t){var n,i,r,o=new DataView(e),a=0,s=1;if(65496!==o.getUint16(a)||e.length<2)return void(t&&t());for(a+=2,n=o.byteLength;a<n-2;)switch(i=o.getUint16(a),a+=2,i){case 65505:r=o.getUint16(a),n=r-a,a+=2;break;case 274:s=o.getUint16(a+6,!1),n=0}t&&t(s)},validateOrientation:function(e,n){if(window.FileReader&&window.DataView){var i,r=new FileReader;r.onloadend=function(){i=r.result,t.setOrientation(i,n)},r.readAsArrayBuffer(e)}},adjustOrientedImage:function(e,t){var n,i,r;if(e.hasClass("is-portrait-gt4")){if(t)return void e.css({width:e.parent().height()});e.css({height:"auto",width:e.height()}),n=e.parent().offset().top,i=e.offset().top,r=n-i,e.css("margin-top",r)}},closeButton:function(e){return'<button type="button" class="'+(e=e?"close "+e:"close")+'" aria-label="Close">\n  <span aria-hidden="true">&times;</span>\n</button>'}},n=function(n,i){var r=this;r.$element=e(n),r.$parent=r.$element.parent(),r._validate()&&(r.isPreviewable=t.hasFileAPISupport(),r.isIE9=t.isIE(9),r.isIE10=t.isIE(10),(r.isPreviewable||r.isIE9)&&(r._init(i),r._listen()),r.$element.removeClass("file-loading"))},n.prototype={constructor:n,_cleanup:function(){var e=this;e.reader=null,e.formdata={},e.uploadCount=0,e.uploadStatus={},e.uploadLog=[],e.uploadAsyncCount=0,e.loadedImages=[],e.totalImagesCount=0,e.ajaxRequests=[],e.clearStack(),e.fileInputCleared=!1,e.fileBatchCompleted=!0,e.isPreviewable||(e.showPreview=!1),e.isError=!1,e.ajaxAborted=!1,e.cancelling=!1},_init:function(n,i){var r,o,a,s,l=this,c=l.$element;l.options=n,e.each(n,function(e,n){switch(e){case"minFileCount":case"maxFileCount":case"minFileSize":case"maxFileSize":case"maxFilePreviewSize":case"resizeImageQuality":case"resizeIfSizeMoreThan":case"progressUploadThreshold":case"initialPreviewCount":case"zoomModalHeight":case"minImageHeight":case"maxImageHeight":case"minImageWidth":case"maxImageWidth":l[e]=t.getNum(n);break;default:l[e]=n}}),l.rtl&&(s=l.previewZoomButtonIcons.prev,l.previewZoomButtonIcons.prev=l.previewZoomButtonIcons.next,l.previewZoomButtonIcons.next=s),i||l._cleanup(),l.$form=c.closest("form"),l._initTemplateDefaults(),l.uploadFileAttr=t.isEmpty(c.attr("name"))?"file_data":c.attr("name"),a=l._getLayoutTemplate("progress"),l.progressTemplate=a.replace("{class}",l.progressClass),l.progressCompleteTemplate=a.replace("{class}",l.progressCompleteClass),l.progressErrorTemplate=a.replace("{class}",l.progressErrorClass),l.dropZoneEnabled=t.hasDragDropSupport()&&l.dropZoneEnabled,l.isDisabled=c.attr("disabled")||c.attr("readonly"),l.isDisabled&&c.attr("disabled",!0),l.isAjaxUpload=t.hasFileUploadSupport()&&!t.isEmpty(l.uploadUrl),l.isClickable=l.browseOnZoneClick&&l.showPreview&&(l.isAjaxUpload&&l.dropZoneEnabled||!t.isEmpty(l.defaultPreviewContent)),l.slug="function"==typeof n.slugCallback?n.slugCallback:l._slugDefault,l.mainTemplate=l.showCaption?l._getLayoutTemplate("main1"):l._getLayoutTemplate("main2"),l.captionTemplate=l._getLayoutTemplate("caption"),l.previewGenericTemplate=l._getPreviewTemplate("generic"),!l.imageCanvas&&l.resizeImage&&(l.maxImageWidth||l.maxImageHeight)&&(l.imageCanvas=document.createElement("canvas"),l.imageCanvasContext=l.imageCanvas.getContext("2d")),t.isEmpty(c.attr("id"))&&c.attr("id",t.uniqId()),l.namespace=".fileinput_"+c.attr("id").replace(/-/g,"_"),void 0===l.$container?l.$container=l._createContainer():l._refreshContainer(),o=l.$container,l.$dropZone=o.find(".file-drop-zone"),l.$progress=o.find(".kv-upload-progress"),l.$btnUpload=e(".fileinput-upload"),l.$captionContainer=t.getElement(n,"elCaptionContainer",o.find(".file-caption")),l.$caption=t.getElement(n,"elCaptionText",o.find(".file-caption-name")),t.isEmpty(l.msgPlaceholder)||(r=c.attr("multiple")?l.filePlural:l.fileSingle,l.$caption.attr("placeholder",l.msgPlaceholder.replace("{files}",r))),l.$captionIcon=l.$captionContainer.find(".file-caption-icon"),l.mainClass.indexOf("input-group-lg")>-1?t.addCss(l.$captionIcon,"icon-lg"):l.$captionIcon.removeClass("icon-lg"),l.$previewContainer=t.getElement(n,"elPreviewContainer",o.find(".file-preview")),l.$preview=t.getElement(n,"elPreviewImage",o.find(".file-preview-thumbnails")),l.$previewStatus=t.getElement(n,"elPreviewStatus",o.find(".file-preview-status")),l.$errorContainer=t.getElement(n,"elErrorContainer",l.$previewContainer.find(".kv-fileinput-error")),l._validateDisabled(),t.isEmpty(l.msgErrorClass)||t.addCss(l.$errorContainer,l.msgErrorClass),i||(l.$errorContainer.hide(),l.previewInitId="preview-"+t.uniqId(),l._initPreviewCache(),l._initPreview(!0),l._initPreviewActions(),l._setFileDropZoneTitle(),l.$parent.hasClass("file-loading")&&(l.$container.insertBefore(l.$parent),l.$parent.remove())),c.attr("disabled")&&l.disable(),l._initZoom(),l.hideThumbnailContent&&t.addCss(l.$preview,"hide-content")},_initTemplateDefaults:function(){var n,i,r,o,a,s,l,c,u,d,h,f,p,m,g,v,b,y,w,x,C,k,_,S,E,T,D,$,A,j,P,O,I,M,N,F,R,L,z=this;n='{preview}\n<div class="kv-upload-progress kv-hidden"></div><div class="clearfix"></div>\n<div class="input-group {class}">\n  {caption}\n<div class="input-group-btn">\n      {remove}\n      {cancel}\n      {upload}\n      {browse}\n    </div>\n</div>',i='{preview}\n<div class="kv-upload-progress kv-hidden"></div>\n<div class="clearfix"></div>\n{remove}\n{cancel}\n{upload}\n{browse}\n',r='<div class="file-preview {class}">\n    {close}    <div class="{dropClass}">\n    <div class="file-preview-thumbnails">\n    </div>\n    <div class="clearfix"></div>    <div class="file-preview-status text-center text-success"></div>\n    <div class="kv-fileinput-error"></div>\n    </div>\n</div>',a=t.closeButton("fileinput-remove"),o='<i class="icon-file"></i>',s='<div class="file-caption form-control {class}" tabindex="500">\n  <span class="file-caption-icon"></span>\n  <input class="file-caption-name" onkeydown="return false;" onpaste="return false;">\n</div>',l='<button type="{type}" tabindex="500" title="{title}" class="{css}" {status}>{icon} {label}</button>',c='<a href="{href}" tabindex="500" title="{title}" class="{css}" {status}>{icon} {label}</a>',u='<div tabindex="500" class="{css}" {status}>{icon} {label}</div>',d='<div id="'+t.MODAL_ID+'" class="file-zoom-dialog modal fade" tabindex="-1" aria-labelledby="'+t.MODAL_ID+'Label"></div>',h='<div class="modal-dialog modal-lg{rtl}" role="document">\n  <div class="modal-content">\n    <div class="modal-header">\n      <h5 class="modal-title">{heading}</h5>\n      <span class="kv-zoom-title"></span>\n      <div class="kv-zoom-actions">{toggleheader}{fullscreen}{borderless}{close}</div>\n    </div>\n    <div class="modal-body">\n      <div class="floating-buttons"></div>\n      <div class="kv-zoom-body file-zoom-content {zoomFrameClass}"></div>\n{prev} {next}\n    </div>\n  </div>\n</div>\n',f='<div class="progress">\n    <div class="{class}" role="progressbar" aria-valuenow="{percent}" aria-valuemin="0" aria-valuemax="100" style="width:{percent}%;">\n        {status}\n     </div>\n</div>',p=" <samp>({sizeText})</samp>",m='<div class="file-thumbnail-footer">\n    <div class="file-footer-caption" title="{caption}">\n        <div class="file-caption-info">{caption}</div>\n        <div class="file-size-info">{size}</div>\n    </div>\n    {progress}\n{indicator}\n{actions}\n</div>',g='<div class="file-actions">\n    <div class="file-footer-buttons">\n        {download} {upload} {delete} {zoom} {other}    </div>\n</div>\n{drag}\n<div class="clearfix"></div>',v='<button type="button" class="kv-file-remove {removeClass}" title="{removeTitle}" {dataUrl}{dataKey}>{removeIcon}</button>\n',b='<button type="button" class="kv-file-upload {uploadClass}" title="{uploadTitle}">{uploadIcon}</button>',y='<a class="kv-file-download {downloadClass}" title="{downloadTitle}" href="{downloadUrl}" download="{caption}" target="_blank">{downloadIcon}</a>',w='<button type="button" class="kv-file-zoom {zoomClass}" title="{zoomTitle}">{zoomIcon}</button>',x='<span class="file-drag-handle {dragClass}" title="{dragTitle}">{dragIcon}</span>',C='<div class="file-upload-indicator" title="{indicatorTitle}">{indicator}</div>',C="",k='<div class="file-preview-frame {frameClass}" id="{previewId}" data-fileindex="{fileindex}" data-template="{template}"',_=k+'><div class="kv-file-content">\n',S=k+' title="{caption}"><div class="kv-file-content">\n',E="</div>{footer}\n</div>\n",T="{content}\n",D='<div class="kv-preview-data file-preview-html" title="{caption}" {style}>{data}</div>\n',$='<img src="{data}" class="file-preview-image kv-preview-data" title="{caption}" alt="{caption}" {style}>\n',A='<textarea class="kv-preview-data file-preview-text" title="{caption}" readonly {style}>{data}</textarea>\n',j='<iframe class="kv-preview-data file-preview-office" src="https://docs.google.com/gview?url={data}&embedded=true" {style}></iframe>',P='<video class="kv-preview-data file-preview-video" controls {style}>\n<source src="{data}" type="{type}">\n'+t.DEFAULT_PREVIEW+"\n</video>\n",O='<audio class="kv-preview-data file-preview-audio" controls {style}>\n<source src="{data}" type="{type}">\n'+t.DEFAULT_PREVIEW+"\n</audio>\n",I='<embed class="kv-preview-data file-preview-flash" src="{data}" type="application/x-shockwave-flash" {style}>\n',N='<embed class="kv-preview-data file-preview-pdf" src="{data}" type="application/pdf" {style}>\n',M='<object class="kv-preview-data file-preview-object file-object {typeCss}" data="{data}" type="{type}" {style}>\n<param name="movie" value="{caption}" />\n'+t.OBJECT_PARAMS+" "+t.DEFAULT_PREVIEW+"\n</object>\n",F='<div class="kv-preview-data file-preview-other-frame" {style}>\n'+t.DEFAULT_PREVIEW+"\n</div>\n",R='<div class="kv-zoom-cache" style="display:none">{zoomContent}</div>',L={width:"100%",height:"100%","min-height":"480px"},z.defaults={layoutTemplates:{main1:n,main2:i,preview:r,close:a,fileIcon:o,caption:s,modalMain:d,modal:h,progress:f,size:p,footer:m,indicator:C,actions:g,actionDelete:v,actionUpload:b,actionDownload:y,actionZoom:w,actionDrag:x,btnDefault:l,btnLink:c,btnBrowse:u,zoomCache:R},previewMarkupTags:{tagBefore1:_,tagBefore2:S,tagAfter:E},previewContentTemplates:{generic:T,html:D,image:$,text:A,office:j,video:P,audio:O,flash:I,object:M,pdf:N,other:F},allowedPreviewTypes:["image","html","text","video","audio","flash","pdf","object"],previewTemplates:{},previewSettings:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"213px",height:"160px"},text:{width:"213px",height:"160px"},office:{width:"213px",height:"160px"},video:{width:"213px",height:"160px"},audio:{width:"100%",height:"30px"},flash:{width:"213px",height:"160px"},object:{width:"213px",height:"160px"},pdf:{width:"213px",height:"160px"},other:{width:"213px",height:"160px"}},previewSettingsSmall:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:{width:"100%",height:"160px"},text:{width:"100%",height:"160px"},office:{width:"100%",height:"160px"},video:{width:"100%",height:"auto"},audio:{width:"100%",height:"30px"},flash:{width:"100%",height:"auto"},object:{width:"100%",height:"auto"},pdf:{width:"100%",height:"160px"},other:{width:"100%",height:"160px"}},previewZoomSettings:{image:{width:"auto",height:"auto","max-width":"100%","max-height":"100%"},html:L,text:L,office:{width:"100%",height:"100%","max-width":"100%","min-height":"480px"},video:{width:"auto",height:"100%","max-width":"100%"},audio:{width:"100%",height:"30px"},flash:{width:"auto",height:"480px"},object:{width:"auto",height:"100%","max-width":"100%","min-height":"480px"},pdf:L,other:{width:"auto",height:"100%","min-height":"480px"}},fileTypeSettings:{image:function(e,n){return t.compare(e,"image.*")&&!t.compare(e,/(tiff?|wmf)$/i)||t.compare(n,/\.(gif|png|jpe?g)$/i)},html:function(e,n){return t.compare(e,"text/html")||t.compare(n,/\.(htm|html)$/i)},office:function(e,n){return t.compare(e,/(word|excel|powerpoint|office|iwork-pages|tiff?)$/i)||t.compare(n,/\.(rtf|docx?|xlsx?|pptx?|pps|potx?|ods|odt|pages|ai|dxf|ttf|tiff?|wmf|e?ps)$/i)},text:function(e,n){return t.compare(e,"text.*")||t.compare(n,/\.(xml|javascript)$/i)||t.compare(n,/\.(txt|md|csv|nfo|ini|json|php|js|css)$/i)},video:function(e,n){return t.compare(e,"video.*")&&(t.compare(e,/(ogg|mp4|mp?g|mov|webm|3gp)$/i)||t.compare(n,/\.(og?|mp4|webm|mp?g|mov|3gp)$/i))},audio:function(e,n){return t.compare(e,"audio.*")&&(t.compare(n,/(ogg|mp3|mp?g|wav)$/i)||t.compare(n,/\.(og?|mp3|mp?g|wav)$/i))},flash:function(e,n){return t.compare(e,"application/x-shockwave-flash",!0)||t.compare(n,/\.(swf)$/i)},pdf:function(e,n){return t.compare(e,"application/pdf",!0)||t.compare(n,/\.(pdf)$/i)},object:function(){return!0},other:function(){return!0}},fileActionSettings:{showRemove:!0,showUpload:!0,showDownload:!0,showZoom:!0,showDrag:!0,removeIcon:'<i class="glyphicon glyphicon-trash"></i>',removeClass:"btn btn-kv btn-default btn-outline-secondary",removeErrorClass:"btn btn-kv btn-danger",removeTitle:"Remove file",uploadIcon:'<i class="glyphicon glyphicon-upload"></i>',uploadClass:"btn btn-kv btn-default btn-outline-secondary",uploadTitle:"Upload file",uploadRetryIcon:'<i class="glyphicon glyphicon-repeat"></i>',uploadRetryTitle:"Retry upload",downloadIcon:'<i class="glyphicon glyphicon-download"></i>',downloadClass:"btn btn-kv btn-default btn-outline-secondary",downloadTitle:"Download file",zoomIcon:'<i class="glyphicon glyphicon-zoom-in"></i>',zoomClass:"btn btn-kv btn-default btn-outline-secondary",zoomTitle:"View Details",dragIcon:'<i class="glyphicon glyphicon-move"></i>',dragClass:"text-info",dragTitle:"Move / Rearrange",dragSettings:{},indicatorNew:'<i class="glyphicon glyphicon-plus-sign text-warning"></i>',indicatorSuccess:'<i class="glyphicon glyphicon-ok-sign text-success"></i>',indicatorError:'<i class="glyphicon glyphicon-exclamation-sign text-danger"></i>',indicatorLoading:'<i class="glyphicon glyphicon-hourglass text-muted"></i>',indicatorNewTitle:"Not uploaded yet",indicatorSuccessTitle:"Uploaded",indicatorErrorTitle:"Upload Error",indicatorLoadingTitle:"Uploading ..."}},e.each(z.defaults,function(t,n){if("allowedPreviewTypes"===t)return void(void 0===z.allowedPreviewTypes&&(z.allowedPreviewTypes=n));z[t]=e.extend(!0,{},n,z[t])}),z._initPreviewTemplates()},_initPreviewTemplates:function(){var n,i=this,r=i.defaults,o=i.previewMarkupTags,a=o.tagAfter;e.each(r.previewContentTemplates,function(e,r){t.isEmpty(i.previewTemplates[e])&&(n=o.tagBefore2,"generic"!==e&&"image"!==e&&"html"!==e&&"text"!==e||(n=o.tagBefore1),i.previewTemplates[e]=n+r+a)})},_initPreviewCache:function(){var n=this;n.previewCache={data:{},init:function(){var e=n.initialPreview;e.length>0&&!t.isArray(e)&&(e=e.split(n.initialPreviewDelimiter)),n.previewCache.data={content:e,config:n.initialPreviewConfig,tags:n.initialPreviewThumbTags}},count:function(){return n.previewCache.data&&n.previewCache.data.content?n.previewCache.data.content.length:0},get:function(i,r){var o,a,s,l,c,u,d,h="init_"+i,f=n.previewCache.data,p=f.config[i],m=f.content[i],g=n.previewInitId+"-"+h,v=t.ifSet("previewAsData",p,n.initialPreviewAsData),b=function(e,i,r,o,a,s,l,c,u){return c=" file-preview-initial "+t.SORT_CSS+(c?" "+c:""),n._generatePreviewTemplate(e,i,r,o,a,!1,null,c,s,l,u)};return m?(r=void 0===r||r,s=t.ifSet("type",p,n.initialPreviewFileType||"generic"),c=t.ifSet("filename",p,t.ifSet("caption",p)),u=t.ifSet("filetype",p,s),l=n.previewCache.footer(i,r,p&&p.size||null),d=t.ifSet("frameClass",p),o=v?b(s,m,c,u,g,l,h,d):b("generic",m,c,u,g,l,h,d,s).setTokens({content:f.content[i]}),f.tags.length&&f.tags[i]&&(o=t.replaceTags(o,f.tags[i])),t.isEmpty(p)||t.isEmpty(p.frameAttr)||(a=e(document.createElement("div")).html(o),a.find(".file-preview-initial").attr(p.frameAttr),o=a.html(),a.remove()),o):""},add:function(e,i,r,o){var a,s=n.previewCache.data;return t.isArray(e)||(e=e.split(n.initialPreviewDelimiter)),o?(a=s.content.push(e)-1,s.config[a]=i,s.tags[a]=r):(a=e.length-1,s.content=e,s.config=i,s.tags=r),n.previewCache.data=s,a},set:function(e,i,r,o){var a,s,l=n.previewCache.data;if(e&&e.length&&(t.isArray(e)||(e=e.split(n.initialPreviewDelimiter)),s=e.filter(function(e){return null!==e}),s.length)){if(void 0===l.content&&(l.content=[]),void 0===l.config&&(l.config=[]),void 0===l.tags&&(l.tags=[]),o){for(a=0;a<e.length;a++)e[a]&&l.content.push(e[a]);for(a=0;a<i.length;a++)i[a]&&l.config.push(i[a]);for(a=0;a<r.length;a++)r[a]&&l.tags.push(r[a])}else l.content=e,l.config=i,l.tags=r;n.previewCache.data=l}},unset:function(e){var t=n.previewCache.count();if(t){if(1===t)return n.previewCache.data.content=[],n.previewCache.data.config=[],n.previewCache.data.tags=[],n.initialPreview=[],n.initialPreviewConfig=[],void(n.initialPreviewThumbTags=[]);n.previewCache.data.content.splice(e,1),n.previewCache.data.config.splice(e,1),n.previewCache.data.tags.splice(e,1)}},out:function(){var e,t,i="",r=n.previewCache.count();if(0===r)return{content:"",caption:""};for(t=0;t<r;t++)i+=n.previewCache.get(t);return e=n._getMsgSelected(r),{content:i,caption:e}},footer:function(e,i,r){var o=n.previewCache.data||{};if(t.isEmpty(o.content))return"";(t.isEmpty(o.config)||t.isEmpty(o.config[e]))&&(o.config[e]={}),i=void 0===i||i;var a,s=o.config[e],l=t.ifSet("caption",s),c=t.ifSet("width",s,"auto"),u=t.ifSet("url",s,!1),d=t.ifSet("key",s,null),h=n.fileActionSettings,f=n.initialPreviewShowDelete||!1,p=s.downloadUrl||n.initialPreviewDownloadUrl||"",m=s.filename||s.caption||"",g=!!p,v=t.ifSet("showDelete",s,t.ifSet("showDelete",h,f)),b=t.ifSet("showDownload",s,t.ifSet("showDownload",h,g)),y=t.ifSet("showZoom",s,t.ifSet("showZoom",h,!0)),w=t.ifSet("showDrag",s,t.ifSet("showDrag",h,!0)),x=!1===u&&i;return b=b&&!1!==s.downloadUrl&&!!p,a=n._renderFileActions(!1,b,v,y,w,x,u,d,!0,p,m),n._getLayoutTemplate("footer").setTokens({progress:n._renderThumbProgress(),actions:a,caption:l,size:n._getSize(r),width:c,indicator:""})}},n.previewCache.init()},_handler:function(e,t,n){var i=this,r=i.namespace,o=t.split(" ").join(r+" ")+r;e&&e.length&&e.off(o).on(o,n)},_log:function(e){var t=this,n=t.$element.attr("id");n&&(e='"'+n+'": '+e),void 0!==window.console.log?window.console.log(e):window.alert(e)},_validate:function(){var e=this,t="file"===e.$element.attr("type");return t||e._log('The input "type" must be set to "file" for initializing the "bootstrap-fileinput" plugin.'),t},_errorsExist:function(){var t,n=this;return!!n.$errorContainer.find("li").length||(t=e(document.createElement("div")).html(n.$errorContainer.html()),t.find(".kv-error-close").remove(),t.find("ul").remove(),!!e.trim(t.text()).length)},_errorHandler:function(e,t){var n=this,i=e.target.error,r=function(e){n._showError(e.replace("{name}",t))};r(i.code===i.NOT_FOUND_ERR?n.msgFileNotFound:i.code===i.SECURITY_ERR?n.msgFileSecured:i.code===i.NOT_READABLE_ERR?n.msgFileNotReadable:i.code===i.ABORT_ERR?n.msgFilePreviewAborted:n.msgFilePreviewError)},_addError:function(e){var t=this,n=t.$errorContainer;e&&n.length&&(n.html(t.errorCloseButton+e),t._handler(n.find(".kv-error-close"),"click",function(){setTimeout(function(){t.showPreview&&!t.getFrames().length&&t.clear(),n.fadeOut("slow")},10)}))},_setValidationError:function(e){var n=this;e=(e?e+" ":"")+"has-error",n.$container.removeClass(e).addClass("has-error"),t.addCss(n.$captionContainer,"is-invalid")},_resetErrors:function(e){var t=this,n=t.$errorContainer;t.isError=!1,t.$container.removeClass("has-error"),t.$captionContainer.removeClass("is-invalid"),n.html(""),e?n.fadeOut("slow"):n.hide()},_showFolderError:function(e){var t,n=this,i=n.$errorContainer;e&&(t=n.msgFoldersNotAllowed.replace("{n}",e),n._addError(t),n._setValidationError(),i.fadeIn(800),n._raise("filefoldererror",[e,t]))},_showUploadError:function(e,t,n){var i=this,r=i.$errorContainer,o=n||"fileuploaderror",a=t&&t.id?'<li data-file-id="'+t.id+'">'+e+"</li>":"<li>"+e+"</li>";return 0===r.find("ul").length?i._addError("<ul>"+a+"</ul>"):r.find("ul").append(a),r.fadeIn(800),i._raise(o,[t,e]),i._setValidationError("file-input-new"),!0},_showError:function(e,t,n){var i=this,r=i.$errorContainer,o=n||"fileerror";return t=t||{},t.reader=i.reader,i._addError(e),r.fadeIn(800),i._raise(o,[t,e]),i.isAjaxUpload||i._clearFileInput(),i._setValidationError("file-input-new"),i.$btnUpload.attr("disabled",!0),!0},_noFilesError:function(e){var t=this,n=t.minFileCount>1?t.filePlural:t.fileSingle,i=t.msgFilesTooLess.replace("{n}",t.minFileCount).replace("{files}",n),r=t.$errorContainer;t._addError(i),t.isError=!0,t._updateFileDetails(0),r.fadeIn(800),t._raise("fileerror",[e,i]),t._clearFileInput(),t._setValidationError()},_parseError:function(t,n,i,r){var o,a=this,s=e.trim(i+""),l=void 0!==n.responseJSON&&void 0!==n.responseJSON.error?n.responseJSON.error:n.responseText;return a.cancelling&&a.msgUploadAborted&&(s=a.msgUploadAborted),a.showAjaxErrorDetails&&l&&(l=e.trim(l.replace(/\n\s*\n/g,"\n")),o=l.length?"<pre>"+l+"</pre>":"",s+=s?o:l),s||(s=a.msgAjaxError.replace("{operation}",t)),a.cancelling=!1,r?"<b>"+r+": </b>"+s:s},_parseFileType:function(e,n){var i,r,o,a,s=this,l=s.allowedPreviewTypes||[];if("application/text-plain"===e)return"text";for(a=0;a<l.length;a++)if(o=l[a],i=s.fileTypeSettings[o],r=i(e,n)?o:"",!t.isEmpty(r))return r;return"other"},_getPreviewIcon:function(t){var n,i=this,r=null;return t&&t.indexOf(".")>-1&&(n=t.split(".").pop(),i.previewFileIconSettings&&(r=i.previewFileIconSettings[n]||i.previewFileIconSettings[n.toLowerCase()]||null),i.previewFileExtSettings&&e.each(i.previewFileExtSettings,function(e,t){if(i.previewFileIconSettings[e]&&t(n))return void(r=i.previewFileIconSettings[e])})),r},_parseFilePreviewIcon:function(e,t){var n=this,i=n._getPreviewIcon(t)||n.previewFileIcon,r=e;return r.indexOf("{previewFileIcon}")>-1&&(r=r.setTokens({previewFileIconClass:n.previewFileIconClass,previewFileIcon:i})),r},_raise:function(t,n){var i=this,r=e.Event(t);if(void 0!==n?i.$element.trigger(r,n):i.$element.trigger(r),r.isDefaultPrevented()||!1===r.result)return!1;switch(t){case"filebatchuploadcomplete":case"filebatchuploadsuccess":case"fileuploaded":case"fileclear":case"filecleared":case"filereset":case"fileerror":case"filefoldererror":case"fileuploaderror":case"filebatchuploaderror":case"filedeleteerror":case"filecustomerror":case"filesuccessremove":break;default:i.ajaxAborted||(i.ajaxAborted=r.result)}return!0},_listenFullScreen:function(e){var t,n,i=this,r=i.$modal;r&&r.length&&(t=r&&r.find(".btn-fullscreen"),n=r&&r.find(".btn-borderless"),t.length&&n.length&&(t.removeClass("active").attr("aria-pressed","false"),n.removeClass("active").attr("aria-pressed","false"),e?t.addClass("active").attr("aria-pressed","true"):n.addClass("active").attr("aria-pressed","true"),r.hasClass("file-zoom-fullscreen")?i._maximizeZoomDialog():e?i._maximizeZoomDialog():n.removeClass("active").attr("aria-pressed","false")))},_listen:function(){var n,i=this,r=i.$element,o=i.$form,a=i.$container;i._handler(r,"change",e.proxy(i._change,i)),i.showBrowse&&i._handler(i.$btnFile,"click",e.proxy(i._browse,i)),i._handler(a.find(".fileinput-remove:not([disabled])"),"click",e.proxy(i.clear,i)),i._handler(a.find(".fileinput-cancel"),"click",e.proxy(i.cancel,i)),i._initDragDrop(),i._handler(o,"reset",e.proxy(i.clear,i)),i.isAjaxUpload||i._handler(o,"submit",e.proxy(i._submitForm,i)),i._handler(e(".fileinput-upload"),"click",e.proxy(i._uploadClick,i)),i._handler(e(window),"resize",function(){i._listenFullScreen(screen.width===window.innerWidth&&screen.height===window.innerHeight)}),n="webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",i._handler(e(document),n,function(){i._listenFullScreen(t.checkFullScreen())}),i._autoFitContent(),i._initClickable()},_autoFitContent:function(){var t,n=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,i=this,r=n<400?i.previewSettingsSmall||i.defaults.previewSettingsSmall:i.previewSettings||i.defaults.previewSettings;e.each(r,function(e,n){t=".file-preview-frame .file-preview-"+e,i.$preview.find(t+".kv-preview-data,"+t+" .kv-preview-data").css(n)})},_initClickable:function(){var n,i=this;i.isClickable&&(n=i.isAjaxUpload?i.$dropZone:i.$preview.find(".file-default-preview"),t.addCss(n,"clickable"),n.attr("tabindex",-1),i._handler(n,"click",function(t){var r=e(t.target);n.find(".kv-fileinput-error:visible").length||r.parents(".file-preview-thumbnails").length&&!r.parents(".file-default-preview").length||(i.$element.trigger("click"),n.blur())}))},_initDragDrop:function(){var t=this,n=t.$dropZone;t.isAjaxUpload&&t.dropZoneEnabled&&t.showPreview&&(t._handler(n,"dragenter dragover",e.proxy(t._zoneDragEnter,t)),t._handler(n,"dragleave",e.proxy(t._zoneDragLeave,t)),t._handler(n,"drop",e.proxy(t._zoneDrop,t)),t._handler(e(document),"dragenter dragover drop",t._zoneDragDropInit))},_zoneDragDropInit:function(e){e.stopPropagation(),e.preventDefault()},_zoneDragEnter:function(n){var i=this,r=e.inArray("Files",n.originalEvent.dataTransfer.types)>-1;if(i._zoneDragDropInit(n),i.isDisabled||!r)return n.originalEvent.dataTransfer.effectAllowed="none",void(n.originalEvent.dataTransfer.dropEffect="none");t.addCss(i.$dropZone,"file-highlighted")},_zoneDragLeave:function(e){var t=this;t._zoneDragDropInit(e),t.isDisabled||t.$dropZone.removeClass("file-highlighted")},_zoneDrop:function(e){var n=this;e.preventDefault(),n.isDisabled||t.isEmpty(e.originalEvent.dataTransfer.files)||(n._change(e,"dragdrop"),n.$dropZone.removeClass("file-highlighted"))},_uploadClick:function(e){var n,i=this,r=i.$container.find(".fileinput-upload"),o=!r.hasClass("disabled")&&t.isEmpty(r.attr("disabled"));if(!e||!e.isDefaultPrevented()){if(!i.isAjaxUpload)return void(o&&"submit"!==r.attr("type")&&(n=r.closest("form"),n.length&&n.trigger("submit"),e.preventDefault()));e.preventDefault(),o&&i.upload()}},_submitForm:function(){var e=this;return e._isFileSelectionValid()&&!e._abort({})},_clearPreview:function(){var n=this,i=n.$preview;(n.showUploadedThumbs?n.getFrames(":not(.file-preview-success)"):n.getFrames()).each(function(){var n=e(this);n.remove(),t.cleanZoomCache(i.find("#zoom-"+n.attr("id")))}),n.getFrames().length&&n.showPreview||n._resetUpload(),n._validateDefaultPreview()},_initSortable:function(){var n,i=this,r=i.$preview,o="."+t.SORT_CSS;window.KvSortable&&0!==r.find(o).length&&(n={handle:".drag-handle-init",dataIdAttr:"data-preview-id",scroll:!1,draggable:o,onSort:function(n){var r,o,a=n.oldIndex,s=n.newIndex;i.initialPreview=t.moveArray(i.initialPreview,a,s),i.initialPreviewConfig=t.moveArray(i.initialPreviewConfig,a,s),
i.previewCache.init();for(var l=0;l<i.initialPreviewConfig.length;l++)null!==i.initialPreviewConfig[l]&&(o=e(n.item),r=o.closest(t.FRAMES),r.attr("data-fileindex","init_"+l).attr("data-fileindex","init_"+l));i._raise("filesorted",{previewId:e(n.item).attr("id"),oldIndex:a,newIndex:s,stack:i.initialPreviewConfig})}},r.data("kvsortable")&&r.kvsortable("destroy"),e.extend(!0,n,i.fileActionSettings.dragSettings),r.kvsortable(n))},_setPreviewContent:function(e){var t=this;t.$preview.html(e),t._autoFitContent()},_initPreview:function(e){var n,i=this,r=i.initialCaption||"";if(!i.previewCache.count())return i._clearPreview(),void(e?i._setCaption(r):i._initCaption());n=i.previewCache.out(),r=e&&i.initialCaption?i.initialCaption:n.caption,i._setPreviewContent(n.content),i._setInitThumbAttr(),i._setCaption(r),i._initSortable(),t.isEmpty(n.content)||i.$container.removeClass("file-input-new")},_getZoomButton:function(e){var t=this,n=t.previewZoomButtonIcons[e],i=t.previewZoomButtonClasses[e],r=' title="'+(t.previewZoomButtonTitles[e]||"")+'" ',o=r+("close"===e?' data-dismiss="modal" aria-hidden="true"':"");return"fullscreen"!==e&&"borderless"!==e&&"toggleheader"!==e||(o+=' data-toggle="button" aria-pressed="false" autocomplete="off"'),'<button type="button" class="'+i+" btn-"+e+'"'+o+">"+n+"</button>"},_getModalContent:function(){var e=this;return e._getLayoutTemplate("modal").setTokens({rtl:e.rtl?" kv-rtl":"",zoomFrameClass:e.frameClass,heading:e.msgZoomModalHeading,prev:e._getZoomButton("prev"),next:e._getZoomButton("next"),toggleheader:e._getZoomButton("toggleheader"),fullscreen:e._getZoomButton("fullscreen"),borderless:e._getZoomButton("borderless"),close:e._getZoomButton("close")})},_listenModalEvent:function(e){var n=this,i=n.$modal,r=function(e){return{sourceEvent:e,previewId:i.data("previewId"),modal:i}};i.on(e+".bs.modal",function(o){var a=i.find(".btn-fullscreen"),s=i.find(".btn-borderless");n._raise("filezoom"+e,r(o)),"shown"===e&&(s.removeClass("active").attr("aria-pressed","false"),a.removeClass("active").attr("aria-pressed","false"),i.hasClass("file-zoom-fullscreen")&&(n._maximizeZoomDialog(),t.checkFullScreen()?a.addClass("active").attr("aria-pressed","true"):s.addClass("active").attr("aria-pressed","true")))})},_initZoom:function(){var n,i=this,r=i._getLayoutTemplate("modalMain"),o="#"+t.MODAL_ID;i.showPreview&&(i.$modal=e(o),i.$modal&&i.$modal.length||(n=e(document.createElement("div")).html(r).insertAfter(i.$container),i.$modal=e(o).insertBefore(n),n.remove()),t.initModal(i.$modal),i.$modal.html(i._getModalContent()),e.each(t.MODAL_EVENTS,function(e,t){i._listenModalEvent(t)}))},_initZoomButtons:function(){var t,n,i=this,r=i.$modal.data("previewId")||"",o=i.getFrames().toArray(),a=o.length,s=i.$modal.find(".btn-prev"),l=i.$modal.find(".btn-next");if(o.length<2)return s.hide(),void l.hide();s.show(),l.show(),a&&(t=e(o[0]),n=e(o[a-1]),s.removeAttr("disabled"),l.removeAttr("disabled"),t.length&&t.attr("id")===r&&s.attr("disabled",!0),n.length&&n.attr("id")===r&&l.attr("disabled",!0))},_maximizeZoomDialog:function(){var t=this,n=t.$modal,i=n.find(".modal-header:visible"),r=n.find(".modal-footer:visible"),o=n.find(".modal-body"),a=e(window).height(),s=0;n.addClass("file-zoom-fullscreen"),i&&i.length&&(a-=i.outerHeight(!0)),r&&r.length&&(a-=r.outerHeight(!0)),o&&o.length&&(s=o.outerHeight(!0)-o.height(),a-=s),n.find(".kv-zoom-body").height(a)},_resizeZoomDialog:function(e){var n=this,i=n.$modal,r=i.find(".btn-fullscreen"),o=i.find(".btn-borderless");if(i.hasClass("file-zoom-fullscreen"))t.toggleFullScreen(!1),e?r.hasClass("active")||(i.removeClass("file-zoom-fullscreen"),n._resizeZoomDialog(!0),o.hasClass("active")&&o.removeClass("active").attr("aria-pressed","false")):r.hasClass("active")?r.removeClass("active").attr("aria-pressed","false"):(i.removeClass("file-zoom-fullscreen"),n.$modal.find(".kv-zoom-body").css("height",n.zoomModalHeight));else{if(!e)return void n._maximizeZoomDialog();t.toggleFullScreen(!0)}i.focus()},_setZoomContent:function(n,i){var r,o,a,s,l,c,u,d,h,f,p=this,m=n.attr("id"),g=p.$modal,v=g.find(".btn-prev"),b=g.find(".btn-next"),y=g.find(".btn-fullscreen"),w=g.find(".btn-borderless"),x=g.find(".btn-toggleheader"),C=p.$preview.find("#zoom-"+m);o=C.attr("data-template")||"generic",r=C.find(".kv-file-content"),a=r.length?r.html():"",h=n.data("caption")||"",f=n.data("size")||"",s=h+" "+f,g.find(".kv-zoom-title").attr("title",e("<div/>").html(s).text()).html(s),l=g.find(".kv-zoom-body"),g.removeClass("kv-single-content"),i?(d=l.addClass("file-thumb-loading").clone().insertAfter(l),l.html(a).hide(),d.fadeOut("fast",function(){l.fadeIn("fast",function(){l.removeClass("file-thumb-loading")}),d.remove()})):l.html(a),u=p.previewZoomSettings[o],u&&(c=l.find(".kv-preview-data"),t.addCss(c,"file-zoom-detail"),e.each(u,function(e,t){c.css(e,t),(c.attr("width")&&"width"===e||c.attr("height")&&"height"===e)&&c.removeAttr(e)})),g.data("previewId",m);var k=l.find("img");k.length&&t.adjustOrientedImage(k,!0),p._handler(v,"click",function(){p._zoomSlideShow("prev",m)}),p._handler(b,"click",function(){p._zoomSlideShow("next",m)}),p._handler(y,"click",function(){p._resizeZoomDialog(!0)}),p._handler(w,"click",function(){p._resizeZoomDialog(!1)}),p._handler(x,"click",function(){var e,t=g.find(".modal-header"),n=g.find(".modal-body .floating-buttons"),i=t.find(".kv-zoom-actions"),r=function(e){var n=p.$modal.find(".kv-zoom-body"),i=p.zoomModalHeight;g.hasClass("file-zoom-fullscreen")&&(i=n.outerHeight(!0),e||(i-=t.outerHeight(!0))),n.css("height",e?i+e:i)};t.is(":visible")?(e=t.outerHeight(!0),t.slideUp("slow",function(){i.find(".btn").appendTo(n),r(e)})):(n.find(".btn").appendTo(i),t.slideDown("slow",function(){r()})),g.focus()}),p._handler(g,"keydown",function(e){var t=e.which||e.keyCode;37!==t||v.attr("disabled")||p._zoomSlideShow("prev",m),39!==t||b.attr("disabled")||p._zoomSlideShow("next",m)})},_zoomPreview:function(e){var n,i=this,r=i.$modal;if(!e.length)throw"Cannot zoom to detailed preview!";t.initModal(r),r.html(i._getModalContent()),n=e.closest(t.FRAMES),i._setZoomContent(n),r.modal("show"),i._initZoomButtons()},_zoomSlideShow:function(t,n){var i,r,o,a=this,s=a.$modal.find(".kv-zoom-actions .btn-"+t),l=a.getFrames().toArray(),c=l.length;if(!s.attr("disabled")){for(r=0;r<c;r++)if(e(l[r]).attr("id")===n){o="prev"===t?r-1:r+1;break}o<0||o>=c||!l[o]||(i=e(l[o]),i.length&&a._setZoomContent(i,!0),a._initZoomButtons(),a._raise("filezoom"+t,{previewId:n,modal:a.$modal}))}},_initZoomButton:function(){var t=this;t.$preview.find(".kv-file-zoom").each(function(){var n=e(this);t._handler(n,"click",function(){t._zoomPreview(n)})})},_clearObjects:function(t){t.find("video audio").each(function(){this.pause(),e(this).remove()}),t.find("img object div").each(function(){e(this).remove()})},_clearFileInput:function(){var n,i,r,o=this,a=o.$element;o.fileInputCleared=!0,t.isEmpty(a.val())||(o.isIE9||o.isIE10?(n=a.closest("form"),i=e(document.createElement("form")),r=e(document.createElement("div")),a.before(r),n.length?n.after(i):r.after(i),i.append(a).trigger("reset"),r.before(a).remove(),i.remove()):a.val(""))},_resetUpload:function(){var e=this;e.uploadCache={content:[],config:[],tags:[],append:!0},e.uploadCount=0,e.uploadStatus={},e.uploadLog=[],e.uploadAsyncCount=0,e.loadedImages=[],e.totalImagesCount=0,e.$btnUpload.removeAttr("disabled"),e._setProgress(0),e.$progress.hide(),e._resetErrors(!1),e.ajaxAborted=!1,e.ajaxRequests=[],e._resetCanvas(),e.cacheInitialPreview={},e.overwriteInitial&&(e.initialPreview=[],e.initialPreviewConfig=[],e.initialPreviewThumbTags=[],e.previewCache.data={content:[],config:[],tags:[]})},_resetCanvas:function(){var e=this;e.canvas&&e.imageCanvasContext&&e.imageCanvasContext.clearRect(0,0,e.canvas.width,e.canvas.height)},_hasInitialPreview:function(){var e=this;return!e.overwriteInitial&&e.previewCache.count()},_resetPreview:function(){var e,t,n=this;n.previewCache.count()?(e=n.previewCache.out(),n._setPreviewContent(e.content),n._setInitThumbAttr(),t=n.initialCaption?n.initialCaption:e.caption,n._setCaption(t)):(n._clearPreview(),n._initCaption()),n.showPreview&&(n._initZoom(),n._initSortable())},_clearDefaultPreview:function(){this.$preview.find(".file-default-preview").remove()},_validateDefaultPreview:function(){var e=this;e.showPreview&&!t.isEmpty(e.defaultPreviewContent)&&(e._setPreviewContent('<div class="file-default-preview">'+e.defaultPreviewContent+"</div>"),e.$container.removeClass("file-input-new"),e._initClickable())},_resetPreviewThumbs:function(e){var t,n=this;if(e)return n._clearPreview(),void n.clearStack();n._hasInitialPreview()?(t=n.previewCache.out(),n._setPreviewContent(t.content),n._setInitThumbAttr(),n._setCaption(t.caption),n._initPreviewActions()):n._clearPreview()},_getLayoutTemplate:function(e){var n=this,i=n.layoutTemplates[e];return t.isEmpty(n.customLayoutTags)?i:t.replaceTags(i,n.customLayoutTags)},_getPreviewTemplate:function(e){var n=this,i=n.previewTemplates[e];return t.isEmpty(n.customPreviewTags)?i:t.replaceTags(i,n.customPreviewTags)},_getOutData:function(e,t,n){var i=this;return e=e||{},t=t||{},n=n||i.filestack.slice(0)||{},{form:i.formdata,files:n,filenames:i.filenames,filescount:i.getFilesCount(),extra:i._getExtraData(),response:t,reader:i.reader,jqXHR:e}},_getMsgSelected:function(e){var t=this,n=1===e?t.fileSingle:t.filePlural;return e>0?t.msgSelected.replace("{n}",e).replace("{files}",n):t.msgNoFilesSelected},_getFrame:function(t){var n=this,i=e("#"+t);return i.length?i:(n._log('Invalid thumb frame with id: "'+t+'".'),null)},_getThumbs:function(e){return e=e||"",this.getFrames(":not(.file-preview-initial)"+e)},_getExtraData:function(e,t){var n=this,i=n.uploadExtraData;return"function"==typeof n.uploadExtraData&&(i=n.uploadExtraData(e,t)),i},_initXhr:function(e,t,n){var i=this;return e.upload&&e.upload.addEventListener("progress",function(e){var r=0,o=e.total,a=e.loaded||e.position;e.lengthComputable&&(r=Math.floor(a/o*100)),t?i._setAsyncUploadStatus(t,r,n):i._setProgress(r)},!1),e},_mergeAjaxCallback:function(e,t,n){var i,r=this,o=r.ajaxSettings,a=r.mergeAjaxCallbacks;"delete"===n&&(o=r.ajaxDeleteSettings,a=r.mergeAjaxDeleteCallbacks),i=o[e],o[e]=a&&"function"==typeof i?"before"===a?function(){i.apply(this,arguments),t.apply(this,arguments)}:function(){t.apply(this,arguments),i.apply(this,arguments)}:t,"delete"===n?r.ajaxDeleteSettings=o:r.ajaxSettings=o},_ajaxSubmit:function(t,n,i,r,o,a){var s,l=this;l._raise("filepreajax",[o,a])&&(l._uploadExtra(o,a),l._mergeAjaxCallback("beforeSend",t),l._mergeAjaxCallback("success",n),l._mergeAjaxCallback("complete",i),l._mergeAjaxCallback("error",r),s=e.extend(!0,{},{xhr:function(){var t=e.ajaxSettings.xhr();return l._initXhr(t,o,l.getFileStack().length)},url:a&&l.uploadUrlThumb?l.uploadUrlThumb:l.uploadUrl,type:"POST",dataType:"json",data:l.formdata,cache:!1,processData:!1,contentType:!1},l.ajaxSettings),l.ajaxRequests.push(e.ajax(s)))},_mergeArray:function(e,n){var i=this,r=t.cleanArray(i[e]),o=t.cleanArray(n);i[e]=r.concat(o)},_initUploadSuccess:function(n,i,r){var o,a,s,l,c,u,d,h,f,p=this;p.showPreview&&"object"==typeof n&&!e.isEmptyObject(n)&&void 0!==n.initialPreview&&n.initialPreview.length>0&&(p.hasInitData=!0,u=n.initialPreview||[],d=n.initialPreviewConfig||[],h=n.initialPreviewThumbTags||[],o=void 0===n.append||n.append,u.length>0&&!t.isArray(u)&&(u=u.split(p.initialPreviewDelimiter)),p._mergeArray("initialPreview",u),p._mergeArray("initialPreviewConfig",d),p._mergeArray("initialPreviewThumbTags",h),void 0!==i?r?(f=i.attr("data-fileindex"),p.uploadCache.content[f]=u[0],p.uploadCache.config[f]=d[0]||[],p.uploadCache.tags[f]=h[0]||[],p.uploadCache.append=o):(s=p.previewCache.add(u,d[0],h[0],o),a=p.previewCache.get(s,!1),l=e(document.createElement("div")).html(a).hide().insertAfter(i),c=l.find(".kv-zoom-cache"),c&&c.length&&c.insertAfter(i),i.fadeOut("slow",function(){var e=l.find(".file-preview-frame");e&&e.length&&e.insertBefore(i).fadeIn("slow").css("display:inline-block"),p._initPreviewActions(),p._clearFileInput(),t.cleanZoomCache(p.$preview.find("#zoom-"+i.attr("id"))),i.remove(),l.remove(),p._initSortable()})):(p.previewCache.set(u,d,h,o),p._initPreview(),p._initPreviewActions()))},_initSuccessThumbs:function(){var n=this;n.showPreview&&n._getThumbs(t.FRAMES+".file-preview-success").each(function(){var i=e(this),r=n.$preview,o=i.find(".kv-file-remove");o.removeAttr("disabled"),n._handler(o,"click",function(){var e=i.attr("id"),o=n._raise("filesuccessremove",[e,i.attr("data-fileindex")]);t.cleanMemory(i),!1!==o&&i.fadeOut("slow",function(){t.cleanZoomCache(r.find("#zoom-"+e)),i.remove(),n.getFrames().length||n.reset()})})})},_checkAsyncComplete:function(){var t,n,i=this;for(n=0;n<i.filestack.length;n++)if(i.filestack[n]&&(t=i.previewInitId+"-"+n,-1===e.inArray(t,i.uploadLog)))return!1;return i.uploadAsyncCount===i.uploadLog.length},_uploadExtra:function(t,n){var i=this,r=i._getExtraData(t,n);0!==r.length&&e.each(r,function(e,t){i.formdata.append(e,t)})},_uploadSingle:function(n,i){var r,o,a,s,l,c,u,d,h,f,p,m=this,g=m.getFileStack().length,v=new FormData,b=m.previewInitId+"-"+n,y=m.filestack.length>0||!e.isEmptyObject(m.uploadExtraData),w=e("#"+b).find(".file-thumb-progress"),x={id:b,index:n};m.formdata=v,m.showPreview&&(o=e("#"+b+":not(.file-preview-initial)"),s=o.find(".kv-file-upload"),l=o.find(".kv-file-remove"),w.show()),0===g||!y||s&&s.hasClass("disabled")||m._abort(x)||(p=function(e,t){c||m.updateStack(e,void 0),m.uploadLog.push(t),m._checkAsyncComplete()&&(m.fileBatchCompleted=!0)},a=function(){var e,n,i,r=m.uploadCache,o=0,a=m.cacheInitialPreview;m.fileBatchCompleted&&(a&&a.content&&(o=a.content.length),setTimeout(function(){var s=0===m.getFileStack(!0).length;if(m.showPreview){if(m.previewCache.set(r.content,r.config,r.tags,r.append),o){for(n=0;n<r.content.length;n++)i=n+o,a.content[i]=r.content[n],a.config.length&&(a.config[i]=r.config[n]),a.tags.length&&(a.tags[i]=r.tags[n]);m.initialPreview=t.cleanArray(a.content),m.initialPreviewConfig=t.cleanArray(a.config),m.initialPreviewThumbTags=t.cleanArray(a.tags)}else m.initialPreview=r.content,m.initialPreviewConfig=r.config,m.initialPreviewThumbTags=r.tags;m.cacheInitialPreview={},m.hasInitData&&(m._initPreview(),m._initPreviewActions())}m.unlock(s),s&&m._clearFileInput(),e=m.$preview.find(".file-preview-initial"),m.uploadAsync&&e.length&&(t.addCss(e,t.SORT_CSS),m._initSortable()),m._raise("filebatchuploadcomplete",[m.filestack,m._getExtraData()]),m.uploadCount=0,m.uploadStatus={},m.uploadLog=[],m._setProgress(101),m.ajaxAborted=!1},100))},u=function(a){r=m._getOutData(a),m.fileBatchCompleted=!1,i||(m.ajaxAborted=!1),m.showPreview&&(o.hasClass("file-preview-success")||(m._setThumbStatus(o,"Loading"),t.addCss(o,"file-uploading")),s.attr("disabled",!0),l.attr("disabled",!0)),i||m.lock(),m._raise("filepreupload",[r,b,n]),e.extend(!0,x,r),m._abort(x)&&(a.abort(),i||(m._setThumbStatus(o,"New"),o.removeClass("file-uploading"),s.removeAttr("disabled"),l.removeAttr("disabled"),m.unlock()),m._setProgressCancelled())},d=function(a,l,u){var d=m.showPreview&&o.attr("id")?o.attr("id"):b;r=m._getOutData(u,a),e.extend(!0,x,r),setTimeout(function(){t.isEmpty(a)||t.isEmpty(a.error)?(m.showPreview&&(m._setThumbStatus(o,"Success"),s.hide(),m._initUploadSuccess(a,o,i),m._setProgress(101,w)),m._raise("fileuploaded",[r,d,n]),i?p(n,d):m.updateStack(n,void 0)):(c=!0,m._showUploadError(a.error,x),m._setPreviewError(o,n,m.filestack[n],m.retryErrorUploads),m.retryErrorUploads||s.hide(),i&&p(n,d),m._setProgress(101,e("#"+d).find(".file-thumb-progress"),m.msgUploadError))},100)},h=function(){setTimeout(function(){m.showPreview&&(s.removeAttr("disabled"),l.removeAttr("disabled"),o.removeClass("file-uploading")),i?a():(m.unlock(!1),m._clearFileInput()),m._initSuccessThumbs()},100)},f=function(t,r,a){var l=m.ajaxOperations.uploadThumb,u=m._parseError(l,t,a,i&&m.filestack[n].name?m.filestack[n].name:null);c=!0,setTimeout(function(){i&&p(n,b),m.uploadStatus[b]=100,m._setPreviewError(o,n,m.filestack[n],m.retryErrorUploads),m.retryErrorUploads||s.hide(),e.extend(!0,x,m._getOutData(t)),m._setProgress(101,w,m.msgAjaxProgressError.replace("{operation}",l)),m._setProgress(101,e("#"+b).find(".file-thumb-progress"),m.msgUploadError),m._showUploadError(u,x)},100)},v.append(m.uploadFileAttr,m.filestack[n],m.filenames[n]),v.append("file_id",n),m._ajaxSubmit(u,d,h,f,b,n))},_uploadBatch:function(){var n,i,r,o,a,s=this,l=s.filestack,c=l.length,u={},d=s.filestack.length>0||!e.isEmptyObject(s.uploadExtraData);s.formdata=new FormData,0!==c&&d&&!s._abort(u)&&(a=function(){e.each(l,function(e){s.updateStack(e,void 0)}),s._clearFileInput()},n=function(n){s.lock();var i=s._getOutData(n);s.ajaxAborted=!1,s.showPreview&&s._getThumbs().each(function(){var n=e(this),i=n.find(".kv-file-upload"),r=n.find(".kv-file-remove");n.hasClass("file-preview-success")||(s._setThumbStatus(n,"Loading"),t.addCss(n,"file-uploading")),i.attr("disabled",!0),r.attr("disabled",!0)}),s._raise("filebatchpreupload",[i]),s._abort(i)&&(n.abort(),s._getThumbs().each(function(){var t=e(this),n=t.find(".kv-file-upload"),i=t.find(".kv-file-remove");t.hasClass("file-preview-loading")&&(s._setThumbStatus(t,"New"),t.removeClass("file-uploading")),n.removeAttr("disabled"),i.removeAttr("disabled")}),s._setProgressCancelled())},i=function(n,i,r){var o=s._getOutData(r,n),l=0,c=s._getThumbs(":not(.file-preview-success)"),u=t.isEmpty(n)||t.isEmpty(n.errorkeys)?[]:n.errorkeys;t.isEmpty(n)||t.isEmpty(n.error)?(s._raise("filebatchuploadsuccess",[o]),a(),s.showPreview?(c.each(function(){var t=e(this);s._setThumbStatus(t,"Success"),t.removeClass("file-uploading"),t.find(".kv-file-upload").hide().removeAttr("disabled")}),s._initUploadSuccess(n)):s.reset(),s._setProgress(101)):(s.showPreview&&(c.each(function(){var t=e(this),n=t.attr("data-fileindex");t.removeClass("file-uploading"),t.find(".kv-file-upload").removeAttr("disabled"),t.find(".kv-file-remove").removeAttr("disabled"),0===u.length||-1!==e.inArray(l,u)?(s._setPreviewError(t,n,s.filestack[n],s.retryErrorUploads),s.retryErrorUploads||(t.find(".kv-file-upload").hide(),s.updateStack(n,void 0))):(t.find(".kv-file-upload").hide(),s._setThumbStatus(t,"Success"),s.updateStack(n,void 0)),t.hasClass("file-preview-error")&&!s.retryErrorUploads||l++}),s._initUploadSuccess(n)),s._showUploadError(n.error,o,"filebatchuploaderror"),s._setProgress(101,s.$progress,s.msgUploadError))},o=function(){s.unlock(),s._initSuccessThumbs(),s._clearFileInput(),s._raise("filebatchuploadcomplete",[s.filestack,s._getExtraData()])},r=function(t,n,i){var r=s._getOutData(t),o=s.ajaxOperations.uploadBatch,a=s._parseError(o,t,i);s._showUploadError(a,r,"filebatchuploaderror"),s.uploadFileCount=c-1,s.showPreview&&(s._getThumbs().each(function(){var t=e(this),n=t.attr("data-fileindex");t.removeClass("file-uploading"),void 0!==s.filestack[n]&&s._setPreviewError(t)}),s._getThumbs().removeClass("file-uploading"),s._getThumbs(" .kv-file-upload").removeAttr("disabled"),s._getThumbs(" .kv-file-delete").removeAttr("disabled"),s._setProgress(101,s.$progress,s.msgAjaxProgressError.replace("{operation}",o)))},e.each(l,function(e,n){t.isEmpty(l[e])||s.formdata.append(s.uploadFileAttr,n,s.filenames[e])}),s._ajaxSubmit(n,i,o,r))},_uploadExtraOnly:function(){var e,n,i,r,o=this,a={};o.formdata=new FormData,o._abort(a)||(e=function(e){o.lock();var t=o._getOutData(e);o._raise("filebatchpreupload",[t]),o._setProgress(50),a.data=t,a.xhr=e,o._abort(a)&&(e.abort(),o._setProgressCancelled())},n=function(e,n,i){var r=o._getOutData(i,e);t.isEmpty(e)||t.isEmpty(e.error)?(o._raise("filebatchuploadsuccess",[r]),o._clearFileInput(),o._initUploadSuccess(e),o._setProgress(101)):o._showUploadError(e.error,r,"filebatchuploaderror")},i=function(){o.unlock(),o._clearFileInput(),o._raise("filebatchuploadcomplete",[o.filestack,o._getExtraData()])},r=function(e,t,n){var i=o._getOutData(e),r=o.ajaxOperations.uploadExtra,s=o._parseError(r,e,n);a.data=i,o._showUploadError(s,i,"filebatchuploaderror"),o._setProgress(101,o.$progress,o.msgAjaxProgressError.replace("{operation}",r))},o._ajaxSubmit(e,n,i,r))},_deleteFileIndex:function(n){var i=this,r=n.attr("data-fileindex");"init_"===r.substring(0,5)&&(r=parseInt(r.replace("init_","")),i.initialPreview=t.spliceArray(i.initialPreview,r),i.initialPreviewConfig=t.spliceArray(i.initialPreviewConfig,r),i.initialPreviewThumbTags=t.spliceArray(i.initialPreviewThumbTags,r),i.getFrames().each(function(){var t=e(this),n=t.attr("data-fileindex");"init_"===n.substring(0,5)&&(n=parseInt(n.replace("init_","")))>r&&(n--,t.attr("data-fileindex","init_"+n))}),i.uploadAsync&&(i.cacheInitialPreview=i.getPreview()))},_initFileActions:function(){var n=this,i=n.$preview;n.showPreview&&(n._initZoomButton(),n.getFrames(" .kv-file-remove").each(function(){var r,o,a,s,l=e(this),c=l.closest(t.FRAMES),u=c.attr("id"),d=c.attr("data-fileindex");n._handler(l,"click",function(){if(!1===(s=n._raise("filepreremove",[u,d]))||!n._validateMinCount())return!1;r=c.hasClass("file-preview-error"),t.cleanMemory(c),c.fadeOut("slow",function(){t.cleanZoomCache(i.find("#zoom-"+u)),n.updateStack(d,void 0),n._clearObjects(c),c.remove(),u&&r&&n.$errorContainer.find('li[data-file-id="'+u+'"]').fadeOut("fast",function(){e(this).remove(),n._errorsExist()||n._resetErrors()}),n._clearFileInput();var s=n.getFileStack(!0),l=n.previewCache.count(),h=s.length,f=n.showPreview&&n.getFrames().length;0!==h||0!==l||f?(o=l+h,a=o>1?n._getMsgSelected(o):s[0]?n._getFileNames()[0]:"",n._setCaption(a)):n.reset(),n._raise("fileremoved",[u,d])})})}),n.getFrames(" .kv-file-upload").each(function(){var i=e(this);n._handler(i,"click",function(){var e=i.closest(t.FRAMES),r=e.attr("data-fileindex");n.$progress.hide(),e.hasClass("file-preview-error")&&!n.retryErrorUploads||n._uploadSingle(r,!1)})}))},_initPreviewActions:function(){var n=this,i=n.$preview,r=n.deleteExtraData||{},o=t.FRAMES+" .kv-file-remove",a=n.fileActionSettings,s=a.removeClass,l=a.removeErrorClass,c=function(){var e=n.isAjaxUpload?n.previewCache.count():n.$element.get(0).files.length;i.find(t.FRAMES).length||e||(n._setCaption(""),n.reset(),n.initialCaption="")};n._initZoomButton(),i.find(o).each(function(){var o,a,u,d=e(this),h=d.data("url")||n.deleteUrl,f=d.data("key");if(!t.isEmpty(h)&&void 0!==f){var p,m,g,v,b=d.closest(t.FRAMES),y=n.previewCache.data,w=b.attr("data-fileindex");w=parseInt(w.replace("init_","")),g=t.isEmpty(y.config)&&t.isEmpty(y.config[w])?null:y.config[w],v=t.isEmpty(g)||t.isEmpty(g.extra)?r:g.extra,"function"==typeof v&&(v=v()),m={id:d.attr("id"),key:f,extra:v},o=function(e){n.ajaxAborted=!1,n._raise("filepredelete",[f,e,v]),n._abort()?e.abort():(d.removeClass(l),t.addCss(b,"file-uploading"),t.addCss(d,"disabled "+s))},a=function(e,r,o){var a,u;if(!t.isEmpty(e)&&!t.isEmpty(e.error))return m.jqXHR=o,m.response=e,n._showError(e.error,m,"filedeleteerror"),b.removeClass("file-uploading"),d.removeClass("disabled "+s).addClass(l),void c();b.removeClass("file-uploading").addClass("file-deleted"),b.fadeOut("slow",function(){w=parseInt(b.attr("data-fileindex").replace("init_","")),n.previewCache.unset(w),a=n.previewCache.count(),u=a>0?n._getMsgSelected(a):"",n._deleteFileIndex(b),n._setCaption(u),n._raise("filedeleted",[f,o,v]),t.cleanZoomCache(i.find("#zoom-"+b.attr("id"))),n._clearObjects(b),b.remove(),c()})},u=function(e,t,i){var r=n.ajaxOperations.deleteThumb,o=n._parseError(r,e,i);m.jqXHR=e,m.response={},n._showError(o,m,"filedeleteerror"),b.removeClass("file-uploading"),d.removeClass("disabled "+s).addClass(l),c()},n._mergeAjaxCallback("beforeSend",o,"delete"),n._mergeAjaxCallback("success",a,"delete"),n._mergeAjaxCallback("error",u,"delete"),p=e.extend(!0,{},{url:h,type:"POST",dataType:"json",data:e.extend(!0,{},{key:f},v)},n.ajaxDeleteSettings),n._handler(d,"click",function(){if(!n._validateMinCount())return!1;n.ajaxAborted=!1,n._raise("filebeforedelete",[f,v]),n.ajaxAborted instanceof Promise?n.ajaxAborted.then(function(t){t||e.ajax(p)}):n.ajaxAborted||e.ajax(p)})}})},_hideFileIcon:function(){var e=this;e.overwriteInitial&&e.$captionContainer.removeClass("icon-visible")},_showFileIcon:function(){var e=this;t.addCss(e.$captionContainer,"icon-visible")},_getSize:function(t){var n,i,r,o=this,a=parseFloat(t),s=o.fileSizeGetter;return e.isNumeric(t)&&e.isNumeric(a)?("function"==typeof s?r=s(a):0===a?r="0.00 B":(n=Math.floor(Math.log(a)/Math.log(1024)),i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=1*(a/Math.pow(1024,n)).toFixed(2)+" "+i[n]),o._getLayoutTemplate("size").replace("{sizeText}",r)):""},_generatePreviewTemplate:function(n,i,r,o,a,s,l,c,u,d,h){var f,p=this,m=p.slug(r),g="",v="",b=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,y=b<400?p.previewSettingsSmall[n]||p.defaults.previewSettingsSmall[n]:p.previewSettings[n]||p.defaults.previewSettings[n],w=u||p._renderFileFooter(m,l,"auto",s),x=p._getPreviewIcon(r),C="type-default",k=x&&p.preferIconicPreview,_=x&&p.preferIconicZoomPreview;return y&&e.each(y,function(e,t){v+=e+":"+t+";"}),f=function(i,s,l,u){var f=l?"zoom-"+a:a,g=p._getPreviewTemplate(i),b=(c||"")+" "+u;return p.frameClass&&(b=p.frameClass+" "+b),l&&(b=b.replace(" "+t.SORT_CSS,"")),g=p._parseFilePreviewIcon(g,r),"text"===i&&(s=t.htmlEncode(s)),"object"!==n||o||e.each(p.defaults.fileTypeSettings,function(e,t){"object"!==e&&"other"!==e&&t(r,o)&&(C="type-"+e)}),g.setTokens({previewId:f,caption:m,frameClass:b,type:o,fileindex:d,typeCss:C,footer:w,data:s,template:h||n,style:v?'style="'+v+'"':""})},d=d||a.slice(a.lastIndexOf("-")+1),p.fileActionSettings.showZoom&&(g=f(_?"other":n,i,!0,"kv-zoom-thumb")),g="\n"+p._getLayoutTemplate("zoomCache").replace("{zoomContent}",g),f(k?"other":n,i,!1,"kv-preview-thumb")+g},_previewDefault:function(n,i,r){var o=this,a=o.$preview;if(o.showPreview){var s,l=n?n.name:"",c=n?n.type:"",u=n.size||0,d=o.slug(l),h=!0===r&&!o.isAjaxUpload,f=t.objUrl.createObjectURL(n);o._clearDefaultPreview(),s=o._generatePreviewTemplate("other",f,l,c,i,h,u),a.append("\n"+s),o._setThumbAttr(i,d,u),!0===r&&o.isAjaxUpload&&o._setThumbStatus(e("#"+i),"Error")}},_previewFile:function(e,n,i,r,o,a){if(this.showPreview){var s,l=this,c=n?n.name:"",u=a.type,d=a.name,h=l._parseFileType(u,c),f=l.allowedPreviewTypes,p=l.allowedPreviewMimeTypes,m=l.$preview,g=n.size||0,v=f&&f.indexOf(h)>=0,b=p&&-1!==p.indexOf(u),y="text"===h||"html"===h||"image"===h?i.target.result:o;if("html"===h&&l.purifyHtml&&window.DOMPurify&&(y=window.DOMPurify.sanitize(y)),v||b){s=l._generatePreviewTemplate(h,y,c,u,r,!1,g),l._clearDefaultPreview(),m.append("\n"+s);var w=m.find("#"+r+" img");w.length&&l.autoOrientImage?t.validateOrientation(n,function(e){if(!e)return void l._validateImage(r,d,u,g,y);var i=m.find("#zoom-"+r+" img"),o="rotate-"+e;e>4&&(o+=w.width()>w.height()?" is-portrait-gt4":" is-landscape-gt4"),t.addCss(w,o),t.addCss(i,o),l._raise("fileimageoriented",{$img:w,file:n}),l._validateImage(r,d,u,g,y),t.adjustOrientedImage(w)}):l._validateImage(r,d,u,g,y)}else l._previewDefault(n,r);l._setThumbAttr(r,d,g),l._initSortable()}},_setThumbAttr:function(t,n,i){var r=this,o=e("#"+t);o.length&&(i=i&&i>0?r._getSize(i):"",o.data({caption:n,size:i}))},_setInitThumbAttr:function(){var e,n,i,r,o=this,a=o.previewCache.data,s=o.previewCache.count();if(0!==s)for(var l=0;l<s;l++)e=a.config[l],r=o.previewInitId+"-init_"+l,n=t.ifSet("caption",e,t.ifSet("filename",e)),i=t.ifSet("size",e),o._setThumbAttr(r,n,i)},_slugDefault:function(e){return t.isEmpty(e)?"":String(e).replace(/[\[\]\/\{}:;#%=\(\)\*\+\?\\\^\$\|<>&"']/g,"_")},_updateFileDetails:function(e){var n=this,i=n.$element,r=n.getFileStack(),o=t.isIE(9)&&t.findFileName(i.val())||i[0].files[0]&&i[0].files[0].name||r.length&&r[0].name||"",a=n.slug(o),s=n.isAjaxUpload?r.length:e,l=n.previewCache.count()+s,c=1===s?a:n._getMsgSelected(l);n.isError?(n.$previewContainer.removeClass("file-thumb-loading"),n.$previewStatus.html(""),n.$captionContainer.removeClass("icon-visible")):n._showFileIcon(),n._setCaption(c,n.isError),n.$container.removeClass("file-input-new file-input-ajax-new"),1===arguments.length&&n._raise("fileselect",[e,a]),n.previewCache.count()&&n._initPreviewActions()},_setThumbStatus:function(e,t){var n=this;if(n.showPreview){var i="indicator"+t,r=i+"Title",o="file-preview-"+t.toLowerCase(),a=e.find(".file-upload-indicator"),s=n.fileActionSettings;e.removeClass("file-preview-success file-preview-error file-preview-loading"),"Success"===t&&e.find(".file-drag-handle").remove(),a.html(s[i]),a.attr("title",s[r]),e.addClass(o),"Error"!==t||n.retryErrorUploads||e.find(".kv-file-upload").attr("disabled",!0)}},_setProgressCancelled:function(){var e=this;e._setProgress(101,e.$progress,e.msgCancelled)},_setProgress:function(e,n,i){var r,o=this,a=Math.min(e,100),s=o.progressUploadThreshold,l=e<=100?o.progressTemplate:o.progressCompleteTemplate,c=a<100?o.progressTemplate:i?o.progressErrorTemplate:l;n=n||o.$progress,t.isEmpty(c)||(r=s&&a>s&&e<=100?c.setTokens({percent:s,status:o.msgUploadThreshold}):c.setTokens({percent:a,status:e>100?o.msgUploadEnd:a+"%"}),n.html(r),i&&n.find('[role="progressbar"]').html(i))},_setFileDropZoneTitle:function(){var e,n=this,i=n.$container.find(".file-drop-zone"),r=n.dropZoneTitle;n.isClickable&&(e=t.isEmpty(n.$element.attr("multiple"))?n.fileSingle:n.filePlural,r+=n.dropZoneClickTitle.replace("{files}",e)),i.find("."+n.dropZoneTitleClass).remove(),n.isAjaxUpload&&n.showPreview&&0!==i.length&&!(n.getFileStack().length>0)&&n.dropZoneEnabled&&(0===i.find(t.FRAMES).length&&t.isEmpty(n.defaultPreviewContent)&&i.prepend('<div class="'+n.dropZoneTitleClass+'">'+r+"</div>"),n.$container.removeClass("file-input-new"),t.addCss(n.$container,"file-input-ajax-new"))},_setAsyncUploadStatus:function(t,n,i){var r=this,o=0;r._setProgress(n,e("#"+t).find(".file-thumb-progress")),r.uploadStatus[t]=n,e.each(r.uploadStatus,function(e,t){o+=t}),r._setProgress(Math.floor(o/i))},_validateMinCount:function(){var e=this,t=e.isAjaxUpload?e.getFileStack().length:e.$element.get(0).files.length;return!(e.validateInitialCount&&e.minFileCount>0&&e._getFileCount(t-1)<e.minFileCount)||(e._noFilesError({}),!1)},_getFileCount:function(e){var t=this,n=0;return t.validateInitialCount&&!t.overwriteInitial&&(n=t.previewCache.count(),e+=n),e},_getFileId:function(e){var t,n=this,i=n.generateFileId;return"function"==typeof i?i(e,event):e?(t=String(e.webkitRelativePath||e.fileName||e.name||null),t?e.size+"-"+t.replace(/[^0-9a-zA-Z_-]/gim,""):null):null},_getFileName:function(e){return e&&e.name?this.slug(e.name):void 0},_getFileIds:function(e){return this.fileids.filter(function(t){return e?void 0!==t:void 0!==t&&null!==t})},_getFileNames:function(e){return this.filenames.filter(function(t){return e?void 0!==t:void 0!==t&&null!==t})},_setPreviewError:function(e,t,n,i){var r=this;if(void 0!==t&&r.updateStack(t,n),r.showPreview){if(r.removeFromPreviewOnError&&!i)return void e.remove();r._setThumbStatus(e,"Error"),r._refreshUploadButton(e,i)}},_refreshUploadButton:function(e,t){var n=this,i=e.find(".kv-file-upload"),r=n.fileActionSettings,o=r.uploadIcon,a=r.uploadTitle;i.length&&(t&&(o=r.uploadRetryIcon,a=r.uploadRetryTitle),i.attr("title",a).html(o))},_checkDimensions:function(e,n,i,r,o,a,s){var l,c,u,d=this,h="Small"===n?"min":"max",f=d[h+"Image"+a];!t.isEmpty(f)&&i.length&&(u=i[0],c="Width"===a?u.naturalWidth||u.width:u.naturalHeight||u.height,("Small"===n?c>=f:c<=f)||(l=d["msgImage"+a+n].setTokens({name:o,size:f}),d._showUploadError(l,s),d._setPreviewError(r,e,null)))},_validateImage:function(t,n,i,r,o){var a,s,l,c,u=this,d=u.$preview,h=d.find("#"+t),f=h.attr("data-fileindex"),p=h.find("img");n=n||"Untitled",p.one("load",function(){s=h.width(),l=d.width(),s>l&&p.css("width","100%"),a={ind:f,id:t},u._checkDimensions(f,"Small",p,h,n,"Width",a),u._checkDimensions(f,"Small",p,h,n,"Height",a),u.resizeImage||(u._checkDimensions(f,"Large",p,h,n,"Width",a),u._checkDimensions(f,"Large",p,h,n,"Height",a)),u._raise("fileimageloaded",[t])
;try{c=window.piexif?window.piexif.load(o):null}catch(e){c=null}u.loadedImages.push({ind:f,img:p,thumb:h,pid:t,typ:i,siz:r,validated:!1,imgData:o,exifObj:c}),h.data("exif",c),u._validateAllImages()}).one("error",function(){u._raise("fileimageloaderror",[t])}).each(function(){this.complete?e(this).trigger("load"):this.error&&e(this).trigger("error")})},_validateAllImages:function(){var e,t,n,i=this,r={val:0},o=i.loadedImages.length,a=i.resizeIfSizeMoreThan;if(o===i.totalImagesCount&&(i._raise("fileimagesloaded"),i.resizeImage))for(e=0;e<i.loadedImages.length;e++)t=i.loadedImages[e],t.validated||(n=t.siz,n&&n>1e3*a&&i._getResizedImage(t,r,o),i.loadedImages[e].validated=!0)},_getResizedImage:function(n,i,r){var o,a,s,l,c,u,d,h=this,f=e(n.img)[0],p=f.naturalWidth,m=f.naturalHeight,g=1,v=h.maxImageWidth||p,b=h.maxImageHeight||m,y=!(!p||!m),w=h.imageCanvas,x=h.imageCanvasContext,C=n.typ,k=n.pid,_=n.ind,S=n.thumb,E=n.exifObj;if(c=function(e,t,n){h.isAjaxUpload?h._showUploadError(e,t,n):h._showError(e,t,n),h._setPreviewError(S,_)},(!h.filestack[_]||!y||p<=v&&m<=b)&&(y&&h.filestack[_]&&h._raise("fileimageresized",[k,_]),i.val++,i.val===r&&h._raise("fileimagesresized"),!y))return void c(h.msgImageResizeError,{id:k,index:_},"fileimageresizeerror");C=C||h.resizeDefaultImageType,a=p>v,s=m>b,g="width"===h.resizePreference?a?v/p:s?b/m:1:s?b/m:a?v/p:1,h._resetCanvas(),p*=g,m*=g,w.width=p,w.height=m;try{x.drawImage(f,0,0,p,m),l=w.toDataURL(C,h.resizeQuality),E&&(d=window.piexif.dump(E),l=window.piexif.insert(d,l)),o=t.dataURI2Blob(l),h.filestack[_]=o,h._raise("fileimageresized",[k,_]),i.val++,i.val===r&&h._raise("fileimagesresized",[void 0,void 0]),o instanceof Blob||c(h.msgImageResizeError,{id:k,index:_},"fileimageresizeerror")}catch(e){i.val++,i.val===r&&h._raise("fileimagesresized",[void 0,void 0]),u=h.msgImageResizeException.replace("{errors}",e.message),c(u,{id:k,index:_},"fileimageresizeexception")}},_initBrowse:function(e){var t=this;t.showBrowse?(t.$btnFile=e.find(".btn-file"),t.$btnFile.append(t.$element)):t.$element.hide()},_initCaption:function(){var e=this,n=e.initialCaption||"";return e.overwriteInitial||t.isEmpty(n)?(e.$caption.val(""),!1):(e._setCaption(n),!0)},_setCaption:function(n,i){var r,o,a,s,l,c=this,u=c.getFileStack();if(c.$caption.length){if(c.$captionContainer.removeClass("icon-visible"),i)r=e("<div>"+c.msgValidationError+"</div>").text(),s=u.length,l=s?1===s&&u[0]?c._getFileNames()[0]:c._getMsgSelected(s):c._getMsgSelected(c.msgNo),o=t.isEmpty(n)?l:n,a='<span class="'+c.msgValidationErrorClass+'">'+c.msgValidationErrorIcon+"</span>";else{if(t.isEmpty(n))return;r=e("<div>"+n+"</div>").text(),o=r,a=c._getLayoutTemplate("fileIcon")}c.$captionContainer.addClass("icon-visible"),c.$caption.attr("title",r).val(o),c.$captionIcon.html(a)}},_createContainer:function(){var t=this,n={class:"file-input file-input-new"+(t.rtl?" kv-rtl":"")},i=e(document.createElement("div")).attr(n).html(t._renderMain());return t.$element.before(i),t._initBrowse(i),t.theme&&i.addClass("theme-"+t.theme),i},_refreshContainer:function(){var e=this,t=e.$container;t.before(e.$element),t.html(e._renderMain()),e._initBrowse(t),e._validateDisabled()},_validateDisabled:function(){var e=this;e.$caption.attr({readonly:e.isDisabled})},_renderMain:function(){var e=this,t=e.isAjaxUpload&&e.dropZoneEnabled?" file-drop-zone":"file-drop-disabled",n=e.showClose?e._getLayoutTemplate("close"):"",i=e.showPreview?e._getLayoutTemplate("preview").setTokens({class:e.previewClass,dropClass:t}):"",r=e.isDisabled?e.captionClass+" file-caption-disabled":e.captionClass,o=e.captionTemplate.setTokens({class:r+" kv-fileinput-caption"});return e.mainTemplate.setTokens({class:e.mainClass+(!e.showBrowse&&e.showCaption?" no-browse":""),preview:i,close:n,caption:o,upload:e._renderButton("upload"),remove:e._renderButton("remove"),cancel:e._renderButton("cancel"),browse:e._renderButton("browse")})},_renderButton:function(e){var n=this,i=n._getLayoutTemplate("btnDefault"),r=n[e+"Class"],o=n[e+"Title"],a=n[e+"Icon"],s=n[e+"Label"],l=n.isDisabled?" disabled":"",c="button";switch(e){case"remove":if(!n.showRemove)return"";break;case"cancel":if(!n.showCancel)return"";r+=" kv-hidden";break;case"upload":if(!n.showUpload)return"";n.isAjaxUpload&&!n.isDisabled?i=n._getLayoutTemplate("btnLink").replace("{href}",n.uploadUrl):c="submit";break;case"browse":if(!n.showBrowse)return"";i=n._getLayoutTemplate("btnBrowse");break;default:return""}return r+="browse"===e?" btn-file":" fileinput-"+e+" fileinput-"+e+"-button",t.isEmpty(s)||(s=' <span class="'+n.buttonLabelClass+'">'+s+"</span>"),i.setTokens({type:c,css:r,title:o,status:l,icon:a,label:s})},_renderThumbProgress:function(){var e=this;return'<div class="file-thumb-progress kv-hidden">'+e.progressTemplate.setTokens({percent:"0",status:e.msgUploadBegin})+"</div>"},_renderFileFooter:function(e,n,i,r){var o,a=this,s=a.fileActionSettings,l=s.showRemove,c=s.showDrag,u=s.showUpload,d=s.showZoom,h=a._getLayoutTemplate("footer"),f=a._getLayoutTemplate("indicator"),p=r?s.indicatorError:s.indicatorNew,m=r?s.indicatorErrorTitle:s.indicatorNewTitle,g=f.setTokens({indicator:p,indicatorTitle:m});return n=a._getSize(n),o=a.isAjaxUpload?h.setTokens({actions:a._renderFileActions(u,!1,l,d,c,!1,!1,!1),caption:e,size:n,width:i,progress:a._renderThumbProgress(),indicator:g}):h.setTokens({actions:a._renderFileActions(!1,!1,!1,d,c,!1,!1,!1),caption:e,size:n,width:i,progress:"",indicator:g}),o=t.replaceTags(o,a.previewThumbTags)},_renderFileActions:function(e,t,n,i,r,o,a,s,l,c,u){if(!(e||t||n||i||r))return"";var d,h=this,f=!1===a?"":' data-url="'+a+'"',p=!1===s?"":' data-key="'+s+'"',m="",g="",v="",b="",y="",w=h._getLayoutTemplate("actions"),x=h.fileActionSettings,C=h.otherActionButtons.setTokens({dataKey:p,key:s}),k=o?x.removeClass+" disabled":x.removeClass;return n&&(m=h._getLayoutTemplate("actionDelete").setTokens({removeClass:k,removeIcon:x.removeIcon,removeTitle:x.removeTitle,dataUrl:f,dataKey:p,key:s})),e&&(g=h._getLayoutTemplate("actionUpload").setTokens({uploadClass:x.uploadClass,uploadIcon:x.uploadIcon,uploadTitle:x.uploadTitle})),t&&(v=h._getLayoutTemplate("actionDownload").setTokens({downloadClass:x.downloadClass,downloadIcon:x.downloadIcon,downloadTitle:x.downloadTitle,downloadUrl:c||h.initialPreviewDownloadUrl}),v=v.setTokens({filename:u,key:s})),i&&(b=h._getLayoutTemplate("actionZoom").setTokens({zoomClass:x.zoomClass,zoomIcon:x.zoomIcon,zoomTitle:x.zoomTitle})),r&&l&&(d="drag-handle-init "+x.dragClass,y=h._getLayoutTemplate("actionDrag").setTokens({dragClass:d,dragTitle:x.dragTitle,dragIcon:x.dragIcon})),w.setTokens({delete:m,upload:g,download:v,zoom:b,drag:y,other:C})},_browse:function(e){var t=this;t._raise("filebrowse"),e&&e.isDefaultPrevented()||(t.isError&&!t.isAjaxUpload&&t.clear(),t.$captionContainer.focus())},_filterDuplicate:function(e,t,n){var i=this,r=i._getFileId(e);r&&n&&n.indexOf(r)>-1||(n||(n=[]),t.push(e),n.push(r))},_change:function(n){var i=this,r=i.$element;if(!i.isAjaxUpload&&t.isEmpty(r.val())&&i.fileInputCleared)return void(i.fileInputCleared=!1);i.fileInputCleared=!1;var o,a,s,l,c=[],u=arguments.length>1,d=i.isAjaxUpload,h=u?n.originalEvent.dataTransfer.files:r.get(0).files,f=i.filestack.length,p=t.isEmpty(r.attr("multiple")),m=p&&f>0,g=0,v=i._getFileIds();if(i.reader=null,i._resetUpload(),i._hideFileIcon(),i.isAjaxUpload&&i.$container.find(".file-drop-zone ."+i.dropZoneTitleClass).remove(),u?e.each(h,function(e,t){t&&!t.type&&void 0!==t.size&&t.size%4096==0?g++:i._filterDuplicate(t,c,v)}):(h=n.target&&void 0===n.target.files?n.target.value?[{name:n.target.value.replace(/^.+\\/,"")}]:[]:n.target.files||{},d?e.each(h,function(e,t){i._filterDuplicate(t,c,v)}):c=h),t.isEmpty(c)||0===c.length)return d||i.clear(),i._showFolderError(g),void i._raise("fileselectnone");if(i._resetErrors(),l=c.length,a=i._getFileCount(i.isAjaxUpload?i.getFileStack().length+l:l),i.maxFileCount>0&&a>i.maxFileCount){if(!i.autoReplace||l>i.maxFileCount)return s=i.autoReplace&&l>i.maxFileCount?l:a,o=i.msgFilesTooMany.replace("{m}",i.maxFileCount).replace("{n}",s),i.isError=function(t,n,r,o){var a=e.extend(!0,{},i._getOutData({},{},h),{id:r,index:o}),s={id:r,index:o,file:n,files:h};return i.isAjaxUpload?i._showUploadError(t,a):i._showError(t,s)}(o,null,null,null),i.$captionContainer.removeClass("icon-visible"),i._setCaption("",!0),void i.$container.removeClass("file-input-new file-input-ajax-new");a>i.maxFileCount&&i._resetPreviewThumbs(d)}else!d||m?(i._resetPreviewThumbs(!1),m&&i.clearStack()):!d||0!==f||i.previewCache.count()&&!i.overwriteInitial||i._resetPreviewThumbs(!0);i.isPreviewable?i.readFiles(c):i._updateFileDetails(1),i._showFolderError(g)},_abort:function(t){var n,i=this;return i.ajaxAborted&&"object"==typeof i.ajaxAborted&&void 0!==i.ajaxAborted.message?(n=e.extend(!0,{},i._getOutData(),t),n.abortData=i.ajaxAborted.data||{},n.abortMessage=i.ajaxAborted.message,i._setProgress(101,i.$progress,i.msgCancelled),i._showUploadError(i.ajaxAborted.message,n,"filecustomerror"),i.cancel(),!0):!!i.ajaxAborted},_resetFileStack:function(){var n=this,i=0,r=[],o=[],a=[];n._getThumbs().each(function(){var s,l=e(this),c=l.attr("data-fileindex"),u=n.filestack[c],d=l.attr("id");"-1"!==c&&-1!==c&&(void 0!==u?(r[i]=u,o[i]=n._getFileName(u),a[i]=n._getFileId(u),l.attr({id:n.previewInitId+"-"+i,"data-fileindex":i}),i++):(s="uploaded-"+t.uniqId(),l.attr({id:s,"data-fileindex":"-1"}),n.$preview.find("#zoom-"+d).attr("id","zoom-"+s)))}),n.filestack=r,n.filenames=o,n.fileids=a},_isFileSelectionValid:function(e){var t=this;return e=e||0,t.required&&!t.getFilesCount()?(t.$errorContainer.html(""),t._showUploadError(t.msgFileRequired),!1):!(t.minFileCount>0&&t._getFileCount(e)<t.minFileCount)||(t._noFilesError({}),!1)},clearStack:function(){var e=this;return e.filestack=[],e.filenames=[],e.fileids=[],e.$element},updateStack:function(e,t){var n=this;return n.filestack[e]=t,n.filenames[e]=n._getFileName(t),n.fileids[e]=t&&n._getFileId(t)||null,n.$element},addToStack:function(e){var t=this;return t.filestack.push(e),t.filenames.push(t._getFileName(e)),t.fileids.push(t._getFileId(e)),t.$element},getFileStack:function(e){return this.filestack.filter(function(t){return e?void 0!==t:void 0!==t&&null!==t})},getFilesCount:function(){var e=this,t=e.isAjaxUpload?e.getFileStack().length:e.$element.get(0).files.length;return e._getFileCount(t)},readFiles:function(n){this.reader=new FileReader;var i,r=this,o=r.$element,a=r.$preview,s=r.reader,l=r.$previewContainer,c=r.$previewStatus,u=r.msgLoading,d=r.msgProgress,h=r.previewInitId,f=n.length,p=r.fileTypeSettings,m=r.filestack.length,g=r.allowedFileTypes,v=g?g.length:0,b=r.allowedFileExtensions,y=t.isEmpty(b)?"":b.join(", "),w=r.maxFilePreviewSize&&parseFloat(r.maxFilePreviewSize),x=a.length&&(!w||isNaN(w)),C=function(t,o,a,s){var l,c=e.extend(!0,{},r._getOutData({},{},n),{id:a,index:s}),u={id:a,index:s,file:o,files:n};r._previewDefault(o,a,!0),r.isAjaxUpload?(r.addToStack(void 0),setTimeout(function(){i(s+1)},100)):f=0,r._initFileActions(),l=e("#"+a),l.find(".kv-file-upload").hide(),r.removeFromPreviewOnError&&l.remove(),r.isError=r.isAjaxUpload?r._showUploadError(t,c):r._showError(t,u),r._updateFileDetails(f)};r.loadedImages=[],r.totalImagesCount=0,e.each(n,function(e,t){var n=r.fileTypeSettings.image;n&&n(t.type)&&r.totalImagesCount++}),i=function(k){if(t.isEmpty(o.attr("multiple"))&&(f=1),k>=f)return r.isAjaxUpload&&r.filestack.length>0?r._raise("filebatchselected",[r.getFileStack()]):r._raise("filebatchselected",[n]),l.removeClass("file-thumb-loading"),void c.html("");var _,S,E,T,D,$,A,j,P,O,I,M,N=m+k,F=h+"-"+N,R=n[k],L=p.text,z=p.image,H=p.html,B=R.name?r.slug(R.name):"",U=(R.size||0)/1024,q="",W=t.objUrl.createObjectURL(R),V=0,Y="",G=0,Z=function(){var e=d.setTokens({index:k+1,files:f,percent:50,name:B});setTimeout(function(){c.html(e),r._updateFileDetails(f),i(k+1)},100),r._raise("fileloaded",[R,F,k,s])};if(v>0)for(S=0;S<v;S++)$=g[S],A=r.msgFileTypes[$]||$,Y+=0===S?A:", "+A;if(!1===B)return void i(k+1);if(0===B.length)return E=r.msgInvalidFileName.replace("{name}",t.htmlEncode(R.name)),void C(E,R,F,k);if(t.isEmpty(b)||(q=new RegExp("\\.("+b.join("|")+")$","i")),_=U.toFixed(2),r.maxFileSize>0&&U>r.maxFileSize)return E=r.msgSizeTooLarge.setTokens({name:B,size:_,maxSize:r.maxFileSize}),void C(E,R,F,k);if(null!==r.minFileSize&&U<=t.getNum(r.minFileSize))return E=r.msgSizeTooSmall.setTokens({name:B,size:_,minSize:r.minFileSize}),void C(E,R,F,k);if(!t.isEmpty(g)&&t.isArray(g)){for(S=0;S<g.length;S+=1)T=g[S],j=p[T],V+=j&&"function"==typeof j&&j(R.type,R.name)?1:0;if(0===V)return E=r.msgInvalidFileType.setTokens({name:B,types:Y}),void C(E,R,F,k)}return 0!==V||t.isEmpty(b)||!t.isArray(b)||t.isEmpty(q)||(D=t.compare(B,q),0!==(V+=t.isEmpty(D)?0:D.length))?r.showPreview?!x&&U>w?(r.addToStack(R),l.addClass("file-thumb-loading"),r._previewDefault(R,F),r._initFileActions(),r._updateFileDetails(f),void i(k+1)):(a.length&&void 0!==FileReader?(P=L(R.type,B),O=H(R.type,B),I=z(R.type,B),c.html(u.replace("{index}",k+1).replace("{files}",f)),l.addClass("file-thumb-loading"),s.onerror=function(e){r._errorHandler(e,B)},s.onload=function(n){var i,o,a,l,c,u,d=[];if(o={name:B,type:R.type},e.each(p,function(e,t){"object"!==e&&"other"!==e&&t(R.type,B)&&G++}),0===G){for(a=new Uint8Array(n.target.result),S=0;S<a.length;S++)l=a[S].toString(16),d.push(l);if(i=d.join("").toLowerCase().substring(0,8),u=t.getMimeType(i,"",""),t.isEmpty(u)&&(c=t.arrayBuffer2String(s.result),u=t.isSvg(c)?"image/svg+xml":t.getMimeType(i,c,R.type)),o={name:B,type:u},P=L(u,""),O=H(u,""),I=z(u,""),(M=P||O)||I)return void function(e){var t=new FileReader;t.onerror=function(e){r._errorHandler(e,B)},t.onload=function(e){r._previewFile(k,R,e,F,W,o),r._initFileActions(),Z()},e?t.readAsText(R,r.textEncoding):t.readAsDataURL(R)}(M)}r._previewFile(k,R,n,F,W,o),r._initFileActions(),Z()},s.onprogress=function(e){if(e.lengthComputable){var t=e.loaded/e.total*100,n=Math.ceil(t);E=d.setTokens({index:k+1,files:f,percent:n,name:B}),setTimeout(function(){c.html(E)},100)}},P||O?s.readAsText(R,r.textEncoding):I?s.readAsDataURL(R):s.readAsArrayBuffer(R)):(r._previewDefault(R,F),setTimeout(function(){i(k+1),r._updateFileDetails(f)},100),r._raise("fileloaded",[R,F,k,s])),void r.addToStack(R)):(r.isAjaxUpload&&r.addToStack(R),setTimeout(function(){i(k+1),r._updateFileDetails(f)},100),void r._raise("fileloaded",[R,F,k,s])):(E=r.msgInvalidFileExtension.setTokens({name:B,extensions:y}),void C(E,R,F,k))},i(0),r._updateFileDetails(f,!1)},lock:function(){var e=this;return e._resetErrors(),e.disable(),e.showRemove&&e.$container.find(".fileinput-remove").hide(),e.showCancel&&e.$container.find(".fileinput-cancel").show(),e._raise("filelock",[e.filestack,e._getExtraData()]),e.$element},unlock:function(e){var t=this;return void 0===e&&(e=!0),t.enable(),t.showCancel&&t.$container.find(".fileinput-cancel").hide(),t.showRemove&&t.$container.find(".fileinput-remove").show(),e&&t._resetFileStack(),t._raise("fileunlock",[t.filestack,t._getExtraData()]),t.$element},cancel:function(){var t,n=this,i=n.ajaxRequests,r=i.length;if(r>0)for(t=0;t<r;t+=1)n.cancelling=!0,i[t].abort();return n._setProgressCancelled(),n._getThumbs().each(function(){var t=e(this),i=t.attr("data-fileindex");t.removeClass("file-uploading"),void 0!==n.filestack[i]&&(t.find(".kv-file-upload").removeClass("disabled").removeAttr("disabled"),t.find(".kv-file-remove").removeClass("disabled").removeAttr("disabled")),n.unlock()}),n.$element},clear:function(){var n,i=this;if(i._raise("fileclear"))return i.$btnUpload.removeAttr("disabled"),i._getThumbs().find("video,audio,img").each(function(){t.cleanMemory(e(this))}),i._resetUpload(),i.clearStack(),i._clearFileInput(),i._resetErrors(!0),i._hasInitialPreview()?(i._showFileIcon(),i._resetPreview(),i._initPreviewActions(),i.$container.removeClass("file-input-new")):(i._getThumbs().each(function(){i._clearObjects(e(this))}),i.isAjaxUpload&&(i.previewCache.data={}),i.$preview.html(""),n=!i.overwriteInitial&&i.initialCaption.length>0?i.initialCaption:"",i.$caption.attr("title","").val(n),t.addCss(i.$container,"file-input-new"),i._validateDefaultPreview()),0===i.$container.find(t.FRAMES).length&&(i._initCaption()||i.$captionContainer.removeClass("icon-visible")),i._hideFileIcon(),i._raise("filecleared"),i.$captionContainer.focus(),i._setFileDropZoneTitle(),i.$element},reset:function(){var e=this;if(e._raise("filereset"))return e._resetPreview(),e.$container.find(".fileinput-filename").text(""),t.addCss(e.$container,"file-input-new"),(e.getFrames().length||e.isAjaxUpload&&e.dropZoneEnabled)&&e.$container.removeClass("file-input-new"),e.clearStack(),e.formdata={},e._setFileDropZoneTitle(),e.$element},disable:function(){var e=this;return e.isDisabled=!0,e._raise("filedisabled"),e.$element.attr("disabled","disabled"),e.$container.find(".kv-fileinput-caption").addClass("file-caption-disabled"),e.$container.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").attr("disabled",!0),t.addCss(e.$container.find(".btn-file"),"disabled"),e._initDragDrop(),e.$element},enable:function(){var e=this;return e.isDisabled=!1,e._raise("fileenabled"),e.$element.removeAttr("disabled"),e.$container.find(".kv-fileinput-caption").removeClass("file-caption-disabled"),e.$container.find(".fileinput-remove, .fileinput-upload, .file-preview-frame button").removeAttr("disabled"),e.$container.find(".btn-file").removeClass("disabled"),e._initDragDrop(),e.$element},upload:function(){var n,i,r,o=this,a=o.getFileStack().length,s=!e.isEmptyObject(o._getExtraData());if(o.isAjaxUpload&&!o.isDisabled&&o._isFileSelectionValid(a)){if(o._resetUpload(),0===a&&!s)return void o._showUploadError(o.msgUploadEmpty);if(o.$progress.show(),o.uploadCount=0,o.uploadStatus={},o.uploadLog=[],o.lock(),o._setProgress(2),0===a&&s)return void o._uploadExtraOnly();if(r=o.filestack.length,o.hasInitData=!1,!o.uploadAsync)return o._uploadBatch(),o.$element;for(i=o._getOutData(),o._raise("filebatchpreupload",[i]),o.fileBatchCompleted=!1,o.uploadCache={content:[],config:[],tags:[],append:!0},o.uploadAsyncCount=o.getFileStack().length,n=0;n<r;n++)o.uploadCache.content[n]=null,o.uploadCache.config[n]=null,o.uploadCache.tags[n]=null;for(o.$preview.find(".file-preview-initial").removeClass(t.SORT_CSS),o._initSortable(),o.cacheInitialPreview=o.getPreview(),n=0;n<r;n++)o.filestack[n]&&o._uploadSingle(n,!0)}},destroy:function(){var t=this,n=t.$form,i=t.$container,r=t.$element,o=t.namespace;return e(document).off(o),e(window).off(o),n&&n.length&&n.off(o),t.isAjaxUpload&&t._clearFileInput(),t._cleanup(),t._initPreviewCache(),r.insertBefore(i).off(o).removeData(),i.off().remove(),r},refresh:function(n,i){var r=this,o=r.$element;return n="object"!=typeof n||t.isEmpty(n)?r.options:e.extend(!0,{},r.options,n),r._init(n,!0),r._listen(),i&&o.trigger("change"+r.namespace),o},zoom:function(e){var n=this,i=n._getFrame(e),r=n.$modal;i&&(t.initModal(r),r.html(n._getModalContent()),n._setZoomContent(i),r.modal("show"),n._initZoomButtons())},getExif:function(e){var t=this,n=t._getFrame(e);return n&&n.data("exif")||null},getFrames:function(e){var n=this;return e=e||"",n.$preview.find(t.FRAMES+e)},getPreview:function(){var e=this;return{content:e.initialPreview,config:e.initialPreviewConfig,tags:e.initialPreviewThumbTags}}},e.fn.fileinput=function(i){if(t.hasFileAPISupport()||t.isIE(9)){var r=Array.apply(null,arguments),o=[];switch(r.shift(),this.each(function(){var a,s=e(this),l=s.data("fileinput"),c="object"==typeof i&&i,u=c.theme||s.data("theme"),d={},h={},f=c.language||s.data("language")||e.fn.fileinput.defaults.language||"en";l||(u&&(h=e.fn.fileinputThemes[u]||{}),"en"===f||t.isEmpty(e.fn.fileinputLocales[f])||(d=e.fn.fileinputLocales[f]||{}),a=e.extend(!0,{},e.fn.fileinput.defaults,h,e.fn.fileinputLocales.en,d,c,s.data()),l=new n(this,a),s.data("fileinput",l)),"string"==typeof i&&o.push(l[i].apply(l,r))}),o.length){case 0:return this;case 1:return o[0];default:return o}}},e.fn.fileinput.defaults={language:"en",showCaption:!0,showBrowse:!0,showPreview:!0,showRemove:!0,showUpload:!0,showCancel:!0,showClose:!0,showUploadedThumbs:!0,browseOnZoneClick:!1,autoReplace:!1,autoOrientImage:!0,required:!1,rtl:!1,hideThumbnailContent:!1,generateFileId:null,previewClass:"",captionClass:"",frameClass:"krajee-default",mainClass:"file-caption-main",mainTemplate:null,purifyHtml:!0,fileSizeGetter:null,initialCaption:"",initialPreview:[],initialPreviewDelimiter:"*$$*",initialPreviewAsData:!1,initialPreviewFileType:"image",initialPreviewConfig:[],initialPreviewThumbTags:[],previewThumbTags:{},initialPreviewShowDelete:!0,initialPreviewDownloadUrl:"",removeFromPreviewOnError:!1,deleteUrl:"",deleteExtraData:{},overwriteInitial:!0,previewZoomButtonIcons:{prev:'<i class="glyphicon glyphicon-triangle-left"></i>',next:'<i class="glyphicon glyphicon-triangle-right"></i>',toggleheader:'<i class="glyphicon glyphicon-resize-vertical"></i>',fullscreen:'<i class="glyphicon glyphicon-fullscreen"></i>',borderless:'<i class="glyphicon glyphicon-resize-full"></i>',close:'<i class="glyphicon glyphicon-remove"></i>'},previewZoomButtonClasses:{prev:"btn btn-navigate",next:"btn btn-navigate",toggleheader:"btn btn-kv btn-default btn-outline-secondary",fullscreen:"btn btn-kv btn-default btn-outline-secondary",borderless:"btn btn-kv btn-default btn-outline-secondary",close:"btn btn-kv btn-default btn-outline-secondary"},preferIconicPreview:!1,preferIconicZoomPreview:!1,allowedPreviewTypes:void 0,allowedPreviewMimeTypes:null,allowedFileTypes:null,allowedFileExtensions:null,defaultPreviewContent:null,customLayoutTags:{},customPreviewTags:{},previewFileIcon:'<i class="glyphicon glyphicon-file"></i>',previewFileIconClass:"file-other-icon",previewFileIconSettings:{},previewFileExtSettings:{},buttonLabelClass:"hidden-xs",browseIcon:'<i class="glyphicon glyphicon-folder-open"></i>&nbsp;',browseClass:"btn btn-primary",removeIcon:'<i class="glyphicon glyphicon-trash"></i>',removeClass:"btn btn-default btn-secondary",cancelIcon:'<i class="glyphicon glyphicon-ban-circle"></i>',cancelClass:"btn btn-default btn-secondary",uploadIcon:'<i class="glyphicon glyphicon-upload"></i>',uploadClass:"btn btn-default btn-secondary",uploadUrl:null,uploadUrlThumb:null,uploadAsync:!0,uploadExtraData:{},zoomModalHeight:480,minImageWidth:null,minImageHeight:null,maxImageWidth:null,maxImageHeight:null,resizeImage:!1,resizePreference:"width",resizeQuality:.92,resizeDefaultImageType:"image/jpeg",resizeIfSizeMoreThan:0,minFileSize:0,maxFileSize:0,maxFilePreviewSize:25600,minFileCount:0,maxFileCount:0,validateInitialCount:!1,msgValidationErrorClass:"text-danger",msgValidationErrorIcon:'<i class="glyphicon glyphicon-exclamation-sign"></i> ',msgErrorClass:"file-error-message",progressThumbClass:"progress-bar bg-success progress-bar-success progress-bar-striped active",progressClass:"progress-bar bg-success progress-bar-success progress-bar-striped active",progressCompleteClass:"progress-bar bg-success progress-bar-success",progressErrorClass:"progress-bar bg-danger progress-bar-danger",progressUploadThreshold:99,previewFileType:"image",elCaptionContainer:null,elCaptionText:null,elPreviewContainer:null,elPreviewImage:null,elPreviewStatus:null,elErrorContainer:null,errorCloseButton:t.closeButton("kv-error-close"),slugCallback:null,dropZoneEnabled:!0,dropZoneTitleClass:"file-drop-zone-title",fileActionSettings:{},otherActionButtons:"",textEncoding:"UTF-8",ajaxSettings:{},ajaxDeleteSettings:{},showAjaxErrorDetails:!0,mergeAjaxCallbacks:!1,mergeAjaxDeleteCallbacks:!1,retryErrorUploads:!0},e.fn.fileinputLocales.en={fileSingle:"file",filePlural:"files",browseLabel:"Browse &hellip;",removeLabel:"Remove",removeTitle:"Clear selected files",cancelLabel:"Cancel",cancelTitle:"Abort ongoing upload",uploadLabel:"Upload",uploadTitle:"Upload selected files",msgNo:"No",msgNoFilesSelected:"No files selected",msgCancelled:"Cancelled",msgPlaceholder:"Select {files}...",msgZoomModalHeading:"Detailed Preview",msgFileRequired:"You must select a file to upload.",msgSizeTooSmall:'File "{name}" (<b>{size} KB</b>) is too small and must be larger than <b>{minSize} KB</b>.',msgSizeTooLarge:'File "{name}" (<b>{size} KB</b>) exceeds maximum allowed upload size of <b>{maxSize} KB</b>.',msgFilesTooLess:"You must select at least <b>{n}</b> {files} to upload.",msgFilesTooMany:"Number of files selected for upload <b>({n})</b> exceeds maximum allowed limit of <b>{m}</b>.",msgFileNotFound:'File "{name}" not found!',msgFileSecured:'Security restrictions prevent reading the file "{name}".',msgFileNotReadable:'File "{name}" is not readable.',msgFilePreviewAborted:'File preview aborted for "{name}".',msgFilePreviewError:'An error occurred while reading the file "{name}".',msgInvalidFileName:'Invalid or unsupported characters in file name "{name}".',msgInvalidFileType:'Invalid type for file "{name}". Only "{types}" files are supported.',msgInvalidFileExtension:'Invalid extension for file "{name}". Only "{extensions}" files are supported.',msgFileTypes:{image:"image",html:"HTML",text:"text",video:"video",audio:"audio",flash:"flash",pdf:"PDF",object:"object"},msgUploadAborted:"The file upload was aborted",msgUploadThreshold:"Processing...",msgUploadBegin:"Initializing...",msgUploadEnd:"Done",msgUploadEmpty:"No valid data available for upload.",msgUploadError:"Error",msgValidationError:"Validation Error",msgLoading:"Loading file {index} of {files} &hellip;",msgProgress:"Loading file {index} of {files} - {name} - {percent}% completed.",msgSelected:"{n} {files} selected",msgFoldersNotAllowed:"Drag & drop files only! {n} folder(s) dropped were skipped.",msgImageWidthSmall:'Width of image file "{name}" must be at least {size} px.',msgImageHeightSmall:'Height of image file "{name}" must be at least {size} px.',msgImageWidthLarge:'Width of image file "{name}" cannot exceed {size} px.',msgImageHeightLarge:'Height of image file "{name}" cannot exceed {size} px.',msgImageResizeError:"Could not get the image dimensions to resize.",msgImageResizeException:"Error while resizing the image.<pre>{errors}</pre>",msgAjaxError:"Something went wrong with the {operation} operation. Please try again later!",msgAjaxProgressError:"{operation} failed",ajaxOperations:{deleteThumb:"file delete",uploadThumb:"file upload",uploadBatch:"batch file upload",uploadExtra:"form data upload"},dropZoneTitle:"Drag & drop files here &hellip;",dropZoneClickTitle:"<br>(or click to select {files})",previewZoomButtonTitles:{prev:"View previous file",next:"View next file",toggleheader:"Toggle header",fullscreen:"Toggle full screen",borderless:"Toggle borderless mode",close:"Close detailed preview"}},e.fn.fileinput.Constructor=n,e(document).ready(function(){var t=e("input.file[type=file]");t.length&&t.fileinput()})}),define("pgui.editors/multi_uploader",["pgui.editors/plain","pgui.localizer","bootstrap-file-input"],function(e,t){return e.extend({setLoading:function(e){var t=$(".fileinput-upload").prop("disabled",e);e?t.addClass("btn-loading"):t.removeClass("btn-loading")},init:function(e,n){this._super(e,n);var i=this,r=e.closest("form").attr("action");e.fileinput({theme:"explorer-fa",uploadUrl:r,initialPreviewAsData:!0,showUpload:!1,showCancel:!1,uploadAsync:!0,fileActionSettings:{showUpload:!1,showDownload:!1,showZoom:!1,removeIcon:'<i class="icon-remove"></i>'},browseIcon:'<i class="icon-folder-open"></i>&nbsp;',browseClass:"btn btn-default",removeIcon:'<i class="icon-remove"></i>',removeLabel:t.getString("RemoveAll"),msgValidationErrorIcon:'<i class="icon-exclamation"></i>'}),e.on("filebatchuploadcomplete",function(e,t,n){window.location.href=$(".js-close-form").first().attr("href")}),e.on("filepreajax",function(e,t,n){i.setLoading(!0)}),e.on("fileuploaderror",function(e,t,n){i.setLoading(!1)})}})}),function(e){"use strict";"function"==typeof define&&define.amd?define("jquery.autocomplete",["jquery"],e):e("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function(e){"use strict";function t(n,i){var r=this;r.element=n,r.el=e(n),r.suggestions=[],r.badQueries=[],r.selectedIndex=-1,r.currentValue=r.element.value,r.timeoutId=null,r.cachedResponse={},r.onChangeTimeout=null,r.onChange=null,r.isLocal=!1,r.suggestionsContainer=null,r.noSuggestionsContainer=null,r.options=e.extend({},t.defaults,i),r.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},r.hint=null,r.hintValue="",r.selection=null,r.initialize(),r.setOptions(i)}function n(e,t,n){return-1!==e.value.toLowerCase().indexOf(n)}function i(t){return"string"==typeof t?e.parseJSON(t):t}function r(e,t){if(!t)return e.value;var n="("+a.escapeRegExChars(t)+")";return e.value.replace(new RegExp(n,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")}function o(e,t){return'<div class="autocomplete-group">'+t+"</div>"}var a=function(){return{escapeRegExChars:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(e){var t=document.createElement("div");return t.className=e,t.style.position="absolute",t.style.display="none",t}}}(),s={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40},l=e.noop;t.utils=a,e.Autocomplete=t,t.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:r,formatGroup:o,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:l,onSearchComplete:l,onSearchError:l,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:n,paramName:"query",transformResult:i,showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1},t.prototype={initialize:function(){var n,i=this,r="."+i.classes.suggestion,o=i.classes.selected,a=i.options;i.element.setAttribute("autocomplete","off"),i.noSuggestionsContainer=e('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),i.suggestionsContainer=t.utils.createNode(a.containerClass),n=e(i.suggestionsContainer),n.appendTo(a.appendTo||"body"),"auto"!==a.width&&n.css("width",a.width),n.on("mouseover.autocomplete",r,function(){i.activate(e(this).data("index"))}),n.on("mouseout.autocomplete",function(){i.selectedIndex=-1,n.children("."+o).removeClass(o)}),n.on("click.autocomplete",r,function(){i.select(e(this).data("index"))}),n.on("click.autocomplete",function(){clearTimeout(i.blurTimeoutId)}),i.fixPositionCapture=function(){i.visible&&i.fixPosition()},e(window).on("resize.autocomplete",i.fixPositionCapture),i.el.on("keydown.autocomplete",function(e){i.onKeyPress(e)}),i.el.on("keyup.autocomplete",function(e){i.onKeyUp(e)}),i.el.on("blur.autocomplete",function(){i.onBlur()}),i.el.on("focus.autocomplete",function(){i.onFocus()}),i.el.on("change.autocomplete",function(e){i.onKeyUp(e)}),i.el.on("input.autocomplete",function(e){i.onKeyUp(e)})},onFocus:function(){var e=this;e.fixPosition(),e.el.val().length>=e.options.minChars&&e.onValueChange()},onBlur:function(){var e=this;e.blurTimeoutId=setTimeout(function(){e.hide()},200)},abortAjax:function(){var e=this;e.currentRequest&&(e.currentRequest.abort(),e.currentRequest=null)},setOptions:function(t){var n=this,i=e.extend({},n.options,t);n.isLocal=Array.isArray(i.lookup),n.isLocal&&(i.lookup=n.verifySuggestionsFormat(i.lookup)),i.orientation=n.validateOrientation(i.orientation,"bottom"),e(n.suggestionsContainer).css({"max-height":i.maxHeight+"px",width:i.width+"px","z-index":i.zIndex}),this.options=i},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var e=this;e.disabled=!0,clearTimeout(e.onChangeTimeout),e.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){
var t=this,n=e(t.suggestionsContainer),i=n.parent().get(0);if(i===document.body||t.options.forceFixPosition){var r=t.options.orientation,o=n.outerHeight(),a=t.el.outerHeight(),s=t.el.offset(),l={top:s.top,left:s.left};if("auto"===r){var c=e(window).height(),u=e(window).scrollTop(),d=-u+s.top-o,h=u+c-(s.top+a+o);r=Math.max(d,h)===d?"top":"bottom"}if(l.top+="top"===r?-o:a,i!==document.body){var f,p=n.css("opacity");t.visible||n.css("opacity",0).show(),f=n.offsetParent().offset(),l.top-=f.top,l.top+=i.scrollTop,l.left-=f.left,t.visible||n.css("opacity",p).hide()}"auto"===t.options.width&&(l.width=t.el.outerWidth()+"px"),n.css(l)}},isCursorAtEnd:function(){var e,t=this,n=t.el.val().length,i=t.element.selectionStart;return"number"==typeof i?i===n:!document.selection||(e=document.selection.createRange(),e.moveStart("character",-n),n===e.text.length)},onKeyPress:function(e){var t=this;if(!t.disabled&&!t.visible&&e.which===s.DOWN&&t.currentValue)return void t.suggest();if(!t.disabled&&t.visible){switch(e.which){case s.ESC:t.el.val(t.currentValue),t.hide();break;case s.RIGHT:if(t.hint&&t.options.onHint&&t.isCursorAtEnd()){t.selectHint();break}return;case s.TAB:if(t.hint&&t.options.onHint)return void t.selectHint();if(-1===t.selectedIndex)return void t.hide();if(t.select(t.selectedIndex),!1===t.options.tabDisabled)return;break;case s.RETURN:if(-1===t.selectedIndex)return void t.hide();t.select(t.selectedIndex);break;case s.UP:t.moveUp();break;case s.DOWN:t.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()}},onKeyUp:function(e){var t=this;if(!t.disabled){switch(e.which){case s.UP:case s.DOWN:return}clearTimeout(t.onChangeTimeout),t.currentValue!==t.el.val()&&(t.findBestHint(),t.options.deferRequestBy>0?t.onChangeTimeout=setTimeout(function(){t.onValueChange()},t.options.deferRequestBy):t.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)return void(this.ignoreValueChange=!1);var t=this,n=t.options,i=t.el.val(),r=t.getQuery(i);if(t.selection&&t.currentValue!==r&&(t.selection=null,(n.onInvalidateSelection||e.noop).call(t.element)),clearTimeout(t.onChangeTimeout),t.currentValue=i,t.selectedIndex=-1,n.triggerSelectOnValidInput&&t.isExactMatch(r))return void t.select(0);r.length<n.minChars?t.hide():t.getSuggestions(r)},isExactMatch:function(e){var t=this.suggestions;return 1===t.length&&t[0].value.toLowerCase()===e.toLowerCase()},getQuery:function(t){var n,i=this.options.delimiter;return i?(n=t.split(i),e.trim(n[n.length-1])):t},getSuggestionsLocal:function(t){var n,i=this,r=i.options,o=t.toLowerCase(),a=r.lookupFilter,s=parseInt(r.lookupLimit,10);return n={suggestions:e.grep(r.lookup,function(e){return a(e,t,o)})},s&&n.suggestions.length>s&&(n.suggestions=n.suggestions.slice(0,s)),n},getSuggestions:function(t){var n,i,r,o,a=this,s=a.options,l=s.serviceUrl;if(s.params[s.paramName]=t,!1!==s.onSearchStart.call(a.element,s.params)){if(i=s.ignoreParams?null:s.params,e.isFunction(s.lookup))return void s.lookup(t,function(e){a.suggestions=e.suggestions,a.suggest(),s.onSearchComplete.call(a.element,t,e.suggestions)});a.isLocal?n=a.getSuggestionsLocal(t):(e.isFunction(l)&&(l=l.call(a.element,t)),r=l+"?"+e.param(i||{}),n=a.cachedResponse[r]),n&&Array.isArray(n.suggestions)?(a.suggestions=n.suggestions,a.suggest(),s.onSearchComplete.call(a.element,t,n.suggestions)):a.isBadQuery(t)?s.onSearchComplete.call(a.element,t,[]):(a.abortAjax(),o={url:l,data:i,type:s.type,dataType:s.dataType},e.extend(o,s.ajaxSettings),a.currentRequest=e.ajax(o).done(function(e){var n;a.currentRequest=null,n=s.transformResult(e,t),a.processResponse(n,t,r),s.onSearchComplete.call(a.element,t,n.suggestions)}).fail(function(e,n,i){s.onSearchError.call(a.element,t,e,n,i)}))}},isBadQuery:function(e){if(!this.options.preventBadQueries)return!1;for(var t=this.badQueries,n=t.length;n--;)if(0===e.indexOf(t[n]))return!0;return!1},hide:function(){var t=this,n=e(t.suggestionsContainer);e.isFunction(t.options.onHide)&&t.visible&&t.options.onHide.call(t.element,n),t.visible=!1,t.selectedIndex=-1,clearTimeout(t.onChangeTimeout),e(t.suggestionsContainer).hide(),t.signalHint(null)},suggest:function(){if(!this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var t,n=this,i=n.options,r=i.groupBy,o=i.formatResult,a=n.getQuery(n.currentValue),s=n.classes.suggestion,l=n.classes.selected,c=e(n.suggestionsContainer),u=e(n.noSuggestionsContainer),d=i.beforeRender,h="",f=function(e,n){var o=e.data[r];return t===o?"":(t=o,i.formatGroup(e,t))};if(i.triggerSelectOnValidInput&&n.isExactMatch(a))return void n.select(0);e.each(n.suggestions,function(e,t){r&&(h+=f(t,0)),h+='<div class="'+s+'" data-index="'+e+'">'+o(t,a,e)+"</div>"}),this.adjustContainerWidth(),u.detach(),c.html(h),e.isFunction(d)&&d.call(n.element,c,n.suggestions),n.fixPosition(),c.show(),i.autoSelectFirst&&(n.selectedIndex=0,c.scrollTop(0),c.children("."+s).first().addClass(l)),n.visible=!0,n.findBestHint()},noSuggestions:function(){var t=this,n=t.options.beforeRender,i=e(t.suggestionsContainer),r=e(t.noSuggestionsContainer);this.adjustContainerWidth(),r.detach(),i.empty(),i.append(r),e.isFunction(n)&&n.call(t.element,i,t.suggestions),t.fixPosition(),i.show(),t.visible=!0},adjustContainerWidth:function(){var t,n=this,i=n.options,r=e(n.suggestionsContainer);"auto"===i.width?(t=n.el.outerWidth(),r.css("width",t>0?t:300)):"flex"===i.width&&r.css("width","")},findBestHint:function(){var t=this,n=t.el.val().toLowerCase(),i=null;n&&(e.each(t.suggestions,function(e,t){var r=0===t.value.toLowerCase().indexOf(n);return r&&(i=t),!r}),t.signalHint(i))},signalHint:function(t){var n="",i=this;t&&(n=i.currentValue+t.value.substr(i.currentValue.length)),i.hintValue!==n&&(i.hintValue=n,i.hint=t,(this.options.onHint||e.noop)(n))},verifySuggestionsFormat:function(t){return t.length&&"string"==typeof t[0]?e.map(t,function(e){return{value:e,data:null}}):t},validateOrientation:function(t,n){return t=e.trim(t||"").toLowerCase(),-1===e.inArray(t,["auto","bottom","top"])&&(t=n),t},processResponse:function(e,t,n){var i=this,r=i.options;e.suggestions=i.verifySuggestionsFormat(e.suggestions),r.noCache||(i.cachedResponse[n]=e,r.preventBadQueries&&!e.suggestions.length&&i.badQueries.push(t)),t===i.getQuery(i.currentValue)&&(i.suggestions=e.suggestions,i.suggest())},activate:function(t){var n,i=this,r=i.classes.selected,o=e(i.suggestionsContainer),a=o.find("."+i.classes.suggestion);return o.find("."+r).removeClass(r),i.selectedIndex=t,-1!==i.selectedIndex&&a.length>i.selectedIndex?(n=a.get(i.selectedIndex),e(n).addClass(r),n):null},selectHint:function(){var t=this,n=e.inArray(t.hint,t.suggestions);t.select(n)},select:function(e){var t=this;t.hide(),t.onSelect(e)},moveUp:function(){var t=this;if(-1!==t.selectedIndex)return 0===t.selectedIndex?(e(t.suggestionsContainer).children("."+t.classes.suggestion).first().removeClass(t.classes.selected),t.selectedIndex=-1,t.ignoreValueChange=!1,t.el.val(t.currentValue),void t.findBestHint()):void t.adjustScroll(t.selectedIndex-1)},moveDown:function(){var e=this;e.selectedIndex!==e.suggestions.length-1&&e.adjustScroll(e.selectedIndex+1)},adjustScroll:function(t){var n=this,i=n.activate(t);if(i){var r,o,a,s=e(i).outerHeight();r=i.offsetTop,o=e(n.suggestionsContainer).scrollTop(),a=o+n.options.maxHeight-s,r<o?e(n.suggestionsContainer).scrollTop(r):r>a&&e(n.suggestionsContainer).scrollTop(r-n.options.maxHeight+s),n.options.preserveInput||(n.ignoreValueChange=!0,n.el.val(n.getValue(n.suggestions[t].value))),n.signalHint(null)}},onSelect:function(t){var n=this,i=n.options.onSelect,r=n.suggestions[t];n.currentValue=n.getValue(r.value),n.currentValue===n.el.val()||n.options.preserveInput||n.el.val(n.currentValue),n.signalHint(null),n.suggestions=[],n.selection=r,e.isFunction(i)&&i.call(n.element,r)},getValue:function(e){var t,n,i=this,r=i.options.delimiter;return r?(t=i.currentValue,n=t.split(r),1===n.length?e:t.substr(0,t.length-n[n.length-1].length)+e):e},dispose:function(){var t=this;t.el.off(".autocomplete").removeData("autocomplete"),e(window).off("resize.autocomplete",t.fixPositionCapture),e(t.suggestionsContainer).remove()}},e.fn.devbridgeAutocomplete=function(n,i){return arguments.length?this.each(function(){var r=e(this),o=r.data("autocomplete");"string"==typeof n?o&&"function"==typeof o[n]&&o[n](i):(o&&o.dispose&&o.dispose(),o=new t(this,n),r.data("autocomplete",o))}):this.first().data("autocomplete")},e.fn.autocomplete||(e.fn.autocomplete=e.fn.devbridgeAutocomplete)}),define("pgui.editors/autocomplete",["pgui.editors/plain","jquery.autocomplete"],function(e){return e.extend({init:function(e,t){this._super(e,t);var n=this;e.autocomplete({serviceUrl:e.data("url"),minChars:e.data("minimum-input-length"),onSelect:function(e){n.doChanged()}})}})}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("signature_pad",t):e.SignaturePad=t()}(this,function(){"use strict";function e(e,t){void 0===t&&(t=250);var n,i,r,o=0,a=null,s=function(){o=Date.now(),a=null,n=e.apply(i,r),a||(i=null,r=[])};return function(){for(var l=[],c=0;c<arguments.length;c++)l[c]=arguments[c];var u=Date.now(),d=t-(u-o);return i=this,r=l,d<=0||d>t?(a&&(clearTimeout(a),a=null),o=u,n=e.apply(i,r),a||(i=null,r=[])):a||(a=window.setTimeout(s,d)),n}}var t=function(){function e(e,t,n){this.x=e,this.y=t,this.time=n||Date.now()}return e.prototype.distanceTo=function(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))},e.prototype.equals=function(e){return this.x===e.x&&this.y===e.y&&this.time===e.time},e.prototype.velocityFrom=function(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0},e}(),n=function(){function e(e,t,n,i,r,o){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=i,this.startWidth=r,this.endWidth=o}return e.fromPoints=function(t,n){var i=this.calculateControlPoints(t[0],t[1],t[2]).c2,r=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new e(t[1],i,r,t[2],n.start,n.end)},e.calculateControlPoints=function(e,n,i){var r=e.x-n.x,o=e.y-n.y,a=n.x-i.x,s=n.y-i.y,l={x:(e.x+n.x)/2,y:(e.y+n.y)/2},c={x:(n.x+i.x)/2,y:(n.y+i.y)/2},u=Math.sqrt(r*r+o*o),d=Math.sqrt(a*a+s*s),h=l.x-c.x,f=l.y-c.y,p=d/(u+d),m={x:c.x+h*p,y:c.y+f*p},g=n.x-m.x,v=n.y-m.y;return{c1:new t(l.x+g,l.y+v),c2:new t(c.x+g,c.y+v)}},e.prototype.length=function(){for(var e,t,n=0,i=0;i<=10;i+=1){var r=i/10,o=this.point(r,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this.point(r,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(i>0){var s=o-e,l=a-t;n+=Math.sqrt(s*s+l*l)}e=o,t=a}return n},e.prototype.point=function(e,t,n,i,r){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*i*(1-e)*e*e+r*e*e*e},e}();return function(){function i(t,n){void 0===n&&(n={});var r=this;this.canvas=t,this.options=n,this._handleMouseDown=function(e){1===e.which&&(r._mouseButtonDown=!0,r._strokeBegin(e))},this._handleMouseMove=function(e){r._mouseButtonDown&&r._strokeMoveUpdate(e)},this._handleMouseUp=function(e){1===e.which&&r._mouseButtonDown&&(r._mouseButtonDown=!1,r._strokeEnd(e))},this._handleTouchStart=function(e){if(e.preventDefault(),1===e.targetTouches.length){var t=e.changedTouches[0];r._strokeBegin(t)}},this._handleTouchMove=function(e){e.preventDefault();var t=e.targetTouches[0];r._strokeMoveUpdate(t)},this._handleTouchEnd=function(e){if(e.target===r.canvas){e.preventDefault();var t=e.changedTouches[0];r._strokeEnd(t)}},this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle="throttle"in n?n.throttle:16,this.minDistance="minDistance"in n?n.minDistance:5,this.throttle?this._strokeMoveUpdate=e(i.prototype._strokeUpdate,this.throttle):this._strokeMoveUpdate=i.prototype._strokeUpdate,this.dotSize=n.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.onBegin=n.onBegin,this.onEnd=n.onEnd,this._ctx=t.getContext("2d"),this.clear(),this.on()}return i.prototype.clear=function(){var e=this._ctx,t=this.canvas;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(),this._isEmpty=!0},i.prototype.fromDataURL=function(e,t,n){var i=this;void 0===t&&(t={});var r=new Image,o=(t.ratio||window.devicePixelRatio,this.canvas.width),a=this.canvas.height;this._reset(),r.onload=function(){i._ctx.drawImage(r,0,0,o,a),n&&n()},r.onerror=function(e){n&&n(e)},r.src=e,this._isEmpty=!1},i.prototype.toDataURL=function(e,t){switch(void 0===e&&(e="image/png"),e){case"image/svg+xml":return this._toSVG();default:return this.canvas.toDataURL(e,t)}},i.prototype.on=function(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",window.PointerEvent?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())},i.prototype.off=function(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.removeEventListener("pointerdown",this._handleMouseDown),this.canvas.removeEventListener("pointermove",this._handleMouseMove),document.removeEventListener("pointerup",this._handleMouseUp),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("mousemove",this._handleMouseMove),document.removeEventListener("mouseup",this._handleMouseUp),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this.canvas.removeEventListener("touchmove",this._handleTouchMove),this.canvas.removeEventListener("touchend",this._handleTouchEnd)},i.prototype.isEmpty=function(){return this._isEmpty},i.prototype.fromData=function(e){var t=this;this.clear(),this._fromData(e,function(e){var n=e.color,i=e.curve;return t._drawCurve({color:n,curve:i})},function(e){var n=e.color,i=e.point;return t._drawDot({color:n,point:i})}),this._data=e},i.prototype.toData=function(){return this._data},i.prototype._strokeBegin=function(e){var t={color:this.penColor,points:[]};"function"==typeof this.onBegin&&this.onBegin(e),this._data.push(t),this._reset(),this._strokeUpdate(e)},i.prototype._strokeUpdate=function(e){var t=e.clientX,n=e.clientY,i=this._createPoint(t,n),r=this._data[this._data.length-1],o=r.points,a=o.length>0&&o[o.length-1],s=!!a&&i.distanceTo(a)<=this.minDistance,l=r.color;if(!a||!a||!s){var c=this._addPoint(i);a?c&&this._drawCurve({color:l,curve:c}):this._drawDot({color:l,point:i}),o.push({time:i.time,x:i.x,y:i.y})}},i.prototype._strokeEnd=function(e){this._strokeUpdate(e),"function"==typeof this.onEnd&&this.onEnd(e)},i.prototype._handlePointerEvents=function(){this._mouseButtonDown=!1,this.canvas.addEventListener("pointerdown",this._handleMouseDown),this.canvas.addEventListener("pointermove",this._handleMouseMove),document.addEventListener("pointerup",this._handleMouseUp)},i.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown),this.canvas.addEventListener("mousemove",this._handleMouseMove),document.addEventListener("mouseup",this._handleMouseUp)},i.prototype._handleTouchEvents=function(){this.canvas.addEventListener("touchstart",this._handleTouchStart),this.canvas.addEventListener("touchmove",this._handleTouchMove),this.canvas.addEventListener("touchend",this._handleTouchEnd)},i.prototype._reset=function(){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._ctx.fillStyle=this.penColor},i.prototype._createPoint=function(e,n){var i=this.canvas.getBoundingClientRect();return new t(e-i.left,n-i.top,(new Date).getTime())},i.prototype._addPoint=function(e){var t=this._lastPoints;if(t.push(e),t.length>2){3===t.length&&t.unshift(t[0]);var i=this._calculateCurveWidths(t[1],t[2]),r=n.fromPoints(t,i);return t.shift(),r}return null},i.prototype._calculateCurveWidths=function(e,t){var n=this.velocityFilterWeight*t.velocityFrom(e)+(1-this.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(n),r={end:i,start:this._lastWidth};return this._lastVelocity=n,this._lastWidth=i,r},i.prototype._strokeWidth=function(e){return Math.max(this.maxWidth/(e+1),this.minWidth)},i.prototype._drawCurveSegment=function(e,t,n){var i=this._ctx;i.moveTo(e,t),i.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1},i.prototype._drawCurve=function(e){var t=e.color,n=e.curve,i=this._ctx,r=n.endWidth-n.startWidth,o=2*Math.floor(n.length());i.beginPath(),i.fillStyle=t;for(var a=0;a<o;a+=1){var s=a/o,l=s*s,c=l*s,u=1-s,d=u*u,h=d*u,f=h*n.startPoint.x;f+=3*d*s*n.control1.x,f+=3*u*l*n.control2.x,f+=c*n.endPoint.x;var p=h*n.startPoint.y;p+=3*d*s*n.control1.y,p+=3*u*l*n.control2.y,p+=c*n.endPoint.y;var m=n.startWidth+c*r;this._drawCurveSegment(f,p,m)}i.closePath(),i.fill()},i.prototype._drawDot=function(e){var t=e.color,n=e.point,i=this._ctx,r="function"==typeof this.dotSize?this.dotSize():this.dotSize;i.beginPath(),this._drawCurveSegment(n.x,n.y,r),i.closePath(),i.fillStyle=t,i.fill()},i.prototype._fromData=function(e,n,i){for(var r=0,o=e;r<o.length;r++){var a=o[r],s=a.color,l=a.points;if(l.length>1)for(var c=0;c<l.length;c+=1){var u=l[c],d=new t(u.x,u.y,u.time);this.penColor=s,0===c&&this._reset();var h=this._addPoint(d);h&&n({color:s,curve:h})}else this._reset(),i({color:s,point:l[0]})}},i.prototype._toSVG=function(){var e=this,t=this._data,n=Math.max(window.devicePixelRatio||1,1),i=this.canvas.width/n,r=this.canvas.height/n,o=document.createElementNS("http://www.w3.org/2000/svg","svg");if(o.setAttribute("width",this.canvas.width.toString()),o.setAttribute("height",this.canvas.height.toString()),"transparent"!=this.backgroundColor){var a=document.createElement("rect");a.setAttribute("width","100%"),a.setAttribute("height","100%"),a.setAttribute("fill",this.backgroundColor),o.appendChild(a)}this._fromData(t,function(e){var t=e.color,n=e.curve,i=document.createElement("path");if(!(isNaN(n.control1.x)||isNaN(n.control1.y)||isNaN(n.control2.x)||isNaN(n.control2.y))){var r="M "+n.startPoint.x.toFixed(3)+","+n.startPoint.y.toFixed(3)+" C "+n.control1.x.toFixed(3)+","+n.control1.y.toFixed(3)+" "+n.control2.x.toFixed(3)+","+n.control2.y.toFixed(3)+" "+n.endPoint.x.toFixed(3)+","+n.endPoint.y.toFixed(3);i.setAttribute("d",r),i.setAttribute("stroke-width",(2.25*n.endWidth).toFixed(3)),i.setAttribute("stroke",t),i.setAttribute("fill","none"),i.setAttribute("stroke-linecap","round"),o.appendChild(i)}},function(t){var n=t.color,i=t.point,r=document.createElement("circle"),a="function"==typeof e.dotSize?e.dotSize():e.dotSize;r.setAttribute("r",a.toString()),r.setAttribute("cx",i.x.toString()),r.setAttribute("cy",i.y.toString()),r.setAttribute("fill",n),o.appendChild(r)});var s='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 '+i+" "+r+'" width="'+i+'" height="'+r+'">',l=o.innerHTML;if(void 0===l){var c=document.createElement("dummy"),u=o.childNodes;c.innerHTML="";for(var d=0;d<u.length;d+=1)c.appendChild(u[d].cloneNode(!0));l=c.innerHTML}var h=s+l+"</svg>";return"data:image/svg+xml;base64,"+btoa(h)},i}()}),define("pgui.editors/signature",["pgui.editors/plain","signature_pad"],function(e,t){return e.extend({init:function(e,n){this._super(e,n);var i=this;this._history=[];var r="",o=e.closest("div"),a=o.find("canvas").first().get(0);this.formatForSaving=e.data("format-for-saving"),this.$clearBtn=o.find("[data-action=clear]"),this.$undoBtn=o.find("[data-action=undo]");var s=e.data("pen-color")?e.data("pen-color"):"black",l=e.data("background-color")?e.data("background-color"):"transparent";this.signaturePad=new t(a,{penColor:s,backgroundColor:l,onEnd:function(){i.rootElement.val(i.toDataURL()),i._history.push(i.getValue()),i.$undoBtn.prop("disabled",!1)}}),this.getValue()&&(this.signaturePad.fromDataURL(this.getValue()),r=this.getValue()),this._enableControls(this.getEnabled()&&!this.getReadonly()),this.$clearBtn.click(function(){return i.signaturePad.clear(),i.rootElement.val(""),i._history=[],r="",i.$undoBtn.prop("disabled",!0),!1}),this.$undoBtn.click(function(){return i._history.pop(),0==i._history.length?(i.setValue(r),$(this).prop("disabled",!0)):i.setValue(i._history[i._history.length-1]),!1})},setValue:function(e){return this.rootElement.val(e),this.signaturePad.clear(),this.signaturePad.fromDataURL(e),this},toDataURL:function(){return"svg"==this.formatForSaving?this.signaturePad.toDataURL("image/svg+xml"):"jpg"==this.formatForSaving?this.signaturePad.toDataURL("image/jpeg"):this.signaturePad.toDataURL()},setEnabled:function(e){return this._super(e),this._enableControls(e&&!this.getReadonly()),this},setReadonly:function(e){return this._super(e),this._enableControls(!e&&this.getEnabled()),this},_enableControls:function(e){e?(this.signaturePad.on(),this.$clearBtn.prop("disabled",!1),this._history.length>0&&this.$undoBtn.prop("disabled",!1)):(this.signaturePad.off(),this.$clearBtn.prop("disabled",!0),this.$undoBtn.prop("disabled",!0))}})}),define("pgui.editors",["class","microevent","underscore","pgui.editors/dynamic_combobox","pgui.editors/checkbox","pgui.editors/checkboxgroup","pgui.editors/combobox","pgui.editors/custom","pgui.editors/datetime","pgui.editors/html","pgui.editors/image_uploader","pgui.editors/multivalue_select","pgui.editors/remote_multivalue_select","pgui.editors/plain","pgui.editors/radio","pgui.editors/text","pgui.editors/mask","pgui.editors/cascading_combobox","pgui.editors/dynamic_cascading_combobox","pgui.editors/static_editor","pgui.editors/multi_uploader","pgui.editors/autocomplete","pgui.editors/signature"],function(e,t,n,i,r,o,a,s,l,c,u,d,h,f,p,m,g,v,b,y,w,x,C){var k={dynamic_combobox:i,checkbox:r,checkboxgroup:o,color:f,combobox:a,datetime:l,html_wysiwyg:c,imageuploader:u,masked:g,multivalue_select:d,remote_multivalue_select:h,radio:p,range:f,spin:f,text:m,textarea:m,time:l,cascading_combobox:v,dynamic_cascading_combobox:b,static_editor:y,multiuploader:w,autocomplete:x,signature:C,toggle:r},_=t.mixin(e.extend({init:function(e){this.context=e,this.editors={},this.calculateControlValuesIntervalId=-1},captureEditors:function(e){var t=this.context.find("[data-editor]"),i=t.length;t.each(n.bind(function(t,r){var o=$(r),a=o.data("editor");new k[a](o,n.bind(function(t){i--,this.editors[t.getFieldName()]=t,o.data("editor",t),i<=0&&(this.trigger("oninitdEvent",this.editors),this.trigger("onCalculateControlValuesEvent",this.editors),n.isFunction(e)&&e(this))},this)).onChange(n.bind(function(e){this.trigger("onEditorValueChangeEvent",e,this.editors)},this))},this))},oninitd:function(e){this.bind("oninitdEvent",e)},onEditorValueChange:function(e){this.bind("onEditorValueChangeEvent",e)},onCalculateControlValues:function(e){this.bind("onCalculateControlValuesEvent",e)},destroy:function(){clearInterval(this.calculateControlValuesIntervalId),n.each(this.editors,function(e){e.destroy()})}}));return{init:function(e,t){var i=e.is("form")?e.attr("id"):e.find("form").first().attr("id"),r=window[i+"_EditorValuesChanged"],o=window[i+"_initd"],a=window[i+"_CalculateControlValues"],s=new _(e);return s.oninitd(function(e){if(n.isFunction(o))try{o(e)}catch(e){console.error(e)}}),s.onEditorValueChange(function(e,t){if(n.isFunction(r))try{r(e,t)}catch(e){console.error(e)}}),s.onCalculateControlValues(function(e){if(n.isFunction(a))try{a(e),s.calculateControlValuesIntervalId=setInterval(function(){a(e)},1e3)}catch(e){console.error(e)}}),s.captureEditors(t),s},getEditorByName:function(e){return k[e]}}}),define("pgui.filter_builder",["class","underscore","pgui.filter_common","pgui.events","pgui.editors","pgui.localizer","pgui.shortcuts"],function(e,t,n,i,r,o,a){function s(e,t,n){if(e.isMultivalue()){var i=t.getValues();i?e.setValueEx(i):l(e,t,n)}else{var r=t.getValueAt(n);null!==r?e.setValueEx(r):l(e,t,n)}}function l(e,t,n){e.isMultivalue()?t.setValues(e.getValueEx()).setDisplayValues(e.getDisplayValue()):t.setValueAt(n,e.getValueEx()).setDisplayValueAt(n,e.getDisplayValue())}function c(e,t){return $($("#filter_builder_editor_"+e+"_"+t.getName().replace(/ /g,"_")).html())}function u(e){if(b[e])return b[e];var n=t.template($(v[e]).html());return b[e]=n,n}function d(e){return $(e).closest(".js-component")}function h(e,t){switch(t){case n.ConditionOperator.IS_BETWEEN:case n.ConditionOperator.IS_NOT_BETWEEN:return 2;case n.ConditionOperator.IS_BLANK:case n.ConditionOperator.IS_NOT_BLANK:case n.ConditionOperator.TODAY:return 0;default:return 1}}function f(e,t){switch(t){case n.ConditionOperator.IN:case n.ConditionOperator.NOT_IN:return 1/0;default:return h(e,t)}}var p=e.extend({init:function(e){this.$modal=e,this.$container=e.find(".js-filter-builder-container"),this.$disableFilterCheckbox=e.find(".js-filter-builder-disable").first(),this.columns=[],this.filterComponent=new m;var t=this;this.$modal.on("shown.bs.modal",function(){a.push(["filter_builder"])}).on("click",".js-filter-builder-commit",function(e){e.preventDefault(),t.filterComponent=t.currentFilterComponent,t.submit()}).on("hidden.bs.modal",function(e){t.hide(),a.pop()}),this.$modal.on("submit",function(e){e.preventDefault()}).on("click",".js-group-add-component",function(e){var n=$(e.currentTarget).data("type"),i=d(e.currentTarget),r=new g(t._getDefaultColumn()),o="condition"===n?r:new m(null,[r]);return i.data("component").addChild(o),t._addComponentToDOM(i.find(".js-group-content").first(),o,!0),!1}).on("click",".js-component-remove",function(e){var n=d(e.currentTarget),i=n.data("component");if(t.currentFilterComponent===i){t.currentFilterComponent=new m,t.$disableFilterCheckbox.prop("checked",!1);var r=t.currentFilterComponent.getDOM();n.replaceWith(r,t.columns),r.find("td").first().removeAttr("colspan")}else t.currentFilterComponent.removeChild(i),n.remove();return!1}).on("click",".js-group-operator-select",function(e){var t=$(e.currentTarget),n=d(e.currentTarget),i=t.data();return n.find(".js-group-operator-text").first().text(i.translate),n.data("component").setOperator(i.operator),t.blur().closest(".dropdown").find(".dropdown-toggle").dropdown("toggle"),!1}).on("change",".js-condition-field-select",function(e){var n=$(e.currentTarget),i=d(e.currentTarget),r=i.data("component");r.setColumn(t._getColumnByName(n.val())),i.replaceWith(r.getDOM(t.columns))}).on("change",".js-condition-operator-select",function(e){var t=$(e.currentTarget),n=d(e.currentTarget),i=n.data("component");i.setOperator(t.val()),i.createEditorsDOM(n.find(".js-value").first())}).on("click",".js-component-toggle",function(e){var n=$(e.currentTarget),i=n.find("span"),r=d(n),a=r.data("component"),s=!a.isEnabled();a.setEnabled(s),s?(n.attr("title",o.getString("DisableFilter")),i.addClass("icon-disable").removeClass("icon-enable"),a.isCondition()?r.find("select,input").prop("disabled",!1):r.removeClass("filter-builder-group-disabled")):(n.attr("title",o.getString("EnableFilter")),i.addClass("icon-enable").removeClass("icon-disable"),a.isCondition()?r.find("select,input").prop("disabled",!0):r.addClass("filter-builder-group-disabled")),t.currentFilterComponent===a&&t.$disableFilterCheckbox.prop("checked",!a.isEnabled()),e.preventDefault()}).on("change",".js-filter-builder-disable",function(t){e.find(".js-component .js-component-toggle").first().click()}.bind(this))},show:function(){return this.$modal.modal("show"),this.currentFilterComponent=new m,this.currentFilterComponent.deserialize(this.columns,this.filterComponent.serialize()),this.currentFilterComponent.isEmpty()&&this.currentFilterComponent.addChild(new g(this._getDefaultColumn())),this.$container.html(""),this.$disableFilterCheckbox.prop("checked",!this.currentFilterComponent.isEnabled()),this._addComponentToDOM(this.$container,this.currentFilterComponent),this},hide:function(){return this.$modal.modal("hide"),this},addColumn:function(e){return this.columns.push(e),this},getColumns:function(){return this.columns},setFilterComponent:function(e){return this.filterComponent=e,this},setEnabled:function(e){return this.filterComponent.setEnabled(e),this},reset:function(){return this.filterComponent=new m,this},submit:function(){this.$modal.find("[data-editor]").trigger("change");var e=JSON.stringify(this.filterComponent.serialize());return $("<form>").attr("method","POST").append($('<input type="hidden" name="filter_builder">').val(e)).hide().appendTo($("body")).submit(),this},_addComponentToDOM:function(e,t,n){var i=t.getDOM(this.columns);return e.append(i),n&&i.find(".js-condition-field-select").first().focus(),t===this.currentFilterComponent&&i.find("td").first().removeAttr("colspan"),i},_getDefaultColumn:function(){return t.first(this.columns)},_getColumnByName:function(e){return t.find(this.columns,function(t){return t.getName()===e})}}),m=n.Group.extend({createCondition:function(){return new g},getDOM:function(e){var n=$(u("group")({isEnabled:this.enabled,operator:o.getString("Operator"+this.operator[0]+this.operator.toLowerCase().slice(1))})).data("component",this),i=n.find(".js-group-content").first();return t.each(this.children,function(t){i.append(t.getDOM(e))}),n}}),g=n.Condition.extend({setOperator:function(e){var t=f(this.column,e);return this.editors&&this.editors[0]&&!this.editors[0].isMultivalue()&&this.setValues(this.values.slice(0,t)).setDisplayValues(this.displayValues.slice(0,t)),this._super(e)},getDOM:function(e){var n=$(u("condition")({isEnabled:this.enabled,columnName:this.column.getName(),operator:this.operator,columns:e,operators:t.reduce(this.column.getOperators(),function(e,t){return e[t]=o.getString("FilterOperator"+t),e},{})})).data("component",this);return this.createEditorsDOM(n.find(".js-value").first()),n},createEditorsDOM:function(e){e.html("");var n=h(this.column,this.operator);n>1?e.addClass("filter-builder-condition-value-multiple"):e.removeClass("filter-builder-condition-value-multiple"),this.editors=[];for(var i=0;i<n;i++){var a=c(this.operator,this.column);if(0!==a.length){var u=$("<div>").append(a);e.append(u);var d=i,f=u.find("[data-editor]").first(),p=r.getEditorByName(f.data("editor")),m=new p(f);this.editors[i]=m,m.setEnabled(this.isEnabled()),s(m,this,d),m.onChange(t.partial(l,m,this,d)),n>1&&i!==n-1&&e.append($("<div>").addClass("filter-builder-condition-value-divider").text(o.getString("And")))}}return this}}),v={condition:"#filterBuilderConditionTemplate",group:"#filterBuilderGroupTemplate"},b={};return{Group:m,Condition:g,create:function(e,t){return new p(e,t)}}}),jQuery.fn.highlight=function(e,t,n){function i(e,t,n,r){var o=0;if(3==e.nodeType){var a=-1;a="END"==n?e.data.toLowerCase().lastIndexOf(t):e.data.toLowerCase().indexOf(t);var s=e.data.toLowerCase().length;if(a>=0&&"ALL"==n||0==a&&"START"==n||a>=0&&a>=s-t.length&&"END"==n){var l=document.createElement("span");l.title=r.hint,l.className="highlight";var c=e.splitText(a),u=(c.splitText(t.length),c.cloneNode(!0));l.appendChild(u),c.parentNode.replaceChild(l,c),o=1}}else if(1==e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName))for(var d=0;d<e.childNodes.length;++d)d+=i(e.childNodes[d],t,n,r);return o}var r={hint:""},n=$.extend(r,n);return this.each(function(){""!=e&&i(this,e.toLowerCase(),t,n)})},jQuery.fn.removeHighlight=function(){return this.find("span.highlight").each(function(){with(this.parentNode.firstChild.nodeName,this.parentNode)replaceChild(this.firstChild,this),normalize()}).end()},define("jquery.highlight",function(){}),function(e,t,n){"use strict";!function(t){"function"==typeof define&&define.amd?define("jquery.popover",["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(e.jQuery)}(function(e){function n(t,n){this.$element=e(t),n&&("string"!==e.type(n.delay)&&"number"!==e.type(n.delay)||(n.delay={show:n.delay,hide:n.delay})),this.options=e.extend({},a,n),this._defaults=a,this._name=i,this._targetclick=!1,this.init(),s.push(this.$element)}var i="webuiPopover",r="webui-popover",o="webui.popover",a={placement:"auto",container:null,width:"auto",height:"auto",trigger:"click",
style:"",delay:{show:null,hide:null},async:{type:"GET",before:null,success:null,error:null},cache:!0,multi:!1,arrow:!0,title:"",content:"",closeable:!1,padding:!0,url:"",type:"html",animation:null,template:'<div class="webui-popover"><div class="webui-arrow"></div><div class="webui-popover-inner"><a href="#" class="close"></a><h3 class="webui-popover-title"></h3><div class="webui-popover-content"><i class="icon-refresh"></i> <p>&nbsp;</p></div></div></div>',backdrop:!1,dismissible:!0,onShow:null,onHide:null,abortXHR:!0,autoHide:!1,offsetTop:0,offsetLeft:0,iframeOptions:{frameborder:"0",allowtransparency:"true",id:"",name:"",scrolling:"",onload:"",height:"",width:""}},s=[],l=e('<div class="webui-popover-backdrop"></div>'),c=0,u=!1,d=e(t),h=function(e,t){return isNaN(e)?t||0:Number(e)},f=function(e){return e.data("plugin_"+i)},p=function(){for(var e=null,t=0;t<s.length;t++)(e=f(s[t]))&&e.hide(!0);d.trigger("hiddenAll."+o)},m=function(e){var t={x:0,y:0};if("touchstart"===e.type||"touchmove"===e.type||"touchend"===e.type||"touchcancel"===e.type){var n=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];t.x=n.pageX,t.y=n.pageY}else"mousedown"!==e.type&&"mouseup"!==e.type&&"click"!==e.type||(t.x=e.pageX,t.y=e.pageY);return t};n.prototype={init:function(){"click"===this.getTrigger()?this.$element.off("click touchend").on("click touchend",e.proxy(this.toggle,this)):"hover"===this.getTrigger()&&this.$element.off("mouseenter mouseleave click").on("mouseenter",e.proxy(this.mouseenterHandler,this)).on("mouseleave",e.proxy(this.mouseleaveHandler,this)),this._poped=!1,this._inited=!0,this._opened=!1,this._idSeed=c,this.options.container=e(this.options.container||t.body).first(),this.options.backdrop&&l.appendTo(this.options.container).hide(),c++,"sticky"===this.getTrigger()&&this.show()},destroy:function(){for(var e=-1,t=0;t<s.length;t++)if(s[t]===this.$element){e=t;break}s.splice(e,1),this.hide(),this.$element.data("plugin_"+i,null),"click"===this.getTrigger()?this.$element.off("click"):"hover"===this.getTrigger()&&this.$element.off("mouseenter mouseleave"),this.$target&&this.$target.remove()},hide:function(t,n){if((t||"sticky"!==this.getTrigger())&&this._opened){n&&(n.preventDefault(),n.stopPropagation()),this.xhr&&!0===this.options.abortXHR&&(this.xhr.abort(),this.xhr=null);var i=e.Event("hide."+o);if(this.$element.trigger(i,[this.$target]),this.$target){this.$target.removeClass("in").addClass(this.getHideAnimation());var r=this;setTimeout(function(){r.$target.hide()},300)}this.options.backdrop&&l.hide(),this._opened=!1,this.$element.trigger("hidden."+o,[this.$target]),this.options.onHide&&this.options.onHide(this.$target)}},resetAutoHide:function(){var e=this,t=e.getAutoHide();t&&(e.autoHideHandler&&clearTimeout(e.autoHideHandler),e.autoHideHandler=setTimeout(function(){e.hide()},t))},toggle:function(e){e&&(e.preventDefault(),e.stopPropagation()),this[this.getTarget().hasClass("in")?"hide":"show"]()},hideAll:function(){p()},show:function(){var e=this.getTarget().removeClass().addClass(r).addClass(this._customTargetClass);this.options.multi||this.hideAll(),this._opened||(this.getCache()&&this._poped&&""!==this.content||(this.content="",this.setTitle(this.getTitle()),this.options.closeable||e.find(".close").off("click").remove(),this.isAsync()?this.setContentASync(this.options.content):this.setContent(this.getContent()),e.show()),this.displayContent(),this.options.onShow&&this.options.onShow(e),this.bindBodyEvents(),this.options.backdrop&&l.show(),this._opened=!0,this.resetAutoHide())},displayContent:function(){var t=this.getElementPosition(),n=this.getTarget().removeClass().addClass(r).addClass(this._customTargetClass),i=this.getContentElement(),a=n[0].offsetWidth,s=n[0].offsetHeight,l="bottom",c=e.Event("show."+o);this.$element.trigger(c,[n]);var u=this.$element.data("width")||this.options.width;""===u&&(u=this._defaults.width),"auto"!==u&&n.width(u);var d=this.$element.data("height")||this.options.height;""===d&&(d=this._defaults.height),"auto"!==d&&i.height(d),this.options.style&&this.$target.addClass(r+"-"+this.options.style),this.options.arrow||n.find(".webui-arrow").remove(),n.detach().css({top:-2e3,left:-2e3,display:"block"}),this.getAnimation()&&n.addClass(this.getAnimation()),n.appendTo(this.options.container),l=this.getPlacement(t),this.$element.trigger("added."+o),this.initTargetEvents(),this.options.padding||("auto"!==this.options.height&&i.css("height",i.outerHeight()),this.$target.addClass("webui-no-padding")),a=n[0].offsetWidth,s=n[0].offsetHeight;var h=this.getTargetPositin(t,l,a,s);if(this.$target.css(h.position).addClass(l).addClass("in"),"iframe"===this.options.type){var f=n.find("iframe"),p=n.width(),m=f.parent().height();""!==this.options.iframeOptions.width&&"auto"!==this.options.iframeOptions.width&&(p=this.options.iframeOptions.width),""!==this.options.iframeOptions.height&&"auto"!==this.options.iframeOptions.height&&(m=this.options.iframeOptions.height),f.width(p).height(m)}if(this.options.arrow||this.$target.css({margin:0}),this.options.arrow){var g=this.$target.find(".webui-arrow");g.removeAttr("style"),"left"===l||"right"===l?g.css({top:this.$target.height()/2}):"top"!==l&&"bottom"!==l||g.css({left:this.$target.width()/2}),h.arrowOffset&&(-1===h.arrowOffset.left||-1===h.arrowOffset.top?g.hide():g.css(h.arrowOffset))}this._poped=!0,this.$element.trigger("shown."+o,[this.$target])},isTargetLoaded:function(){return 0===this.getTarget().find("i.glyphicon-refresh").length},getTriggerElement:function(){return this.$element},getTarget:function(){if(!this.$target){var t=i+this._idSeed;this.$target=e(this.options.template).attr("id",t).data("trigger-element",this.getTriggerElement()),this._customTargetClass=this.$target.attr("class")!==r?this.$target.attr("class"):null,this.getTriggerElement().attr("data-target",t)}return this.$target},getTitleElement:function(){return this.getTarget().find(".webui-popover-title")},getContentElement:function(){return this.$contentElement||(this.$contentElement=this.getTarget().find(".webui-popover-content")),this.$contentElement},getTitle:function(){return this.$element.attr("data-title")||this.options.title},getUrl:function(){return this.$element.attr("data-url")||this.options.url},getAutoHide:function(){return this.$element.attr("data-auto-hide")||this.options.autoHide},getOffsetTop:function(){return h(this.$element.attr("data-offset-top"))||this.options.offsetTop},getOffsetLeft:function(){return h(this.$element.attr("data-offset-left"))||this.options.offsetLeft},getCache:function(){var e=this.$element.attr("data-cache");if(void 0!==e)switch(e.toLowerCase()){case"true":case"yes":case"1":return!0;case"false":case"no":case"0":return!1}return this.options.cache},getTrigger:function(){return this.$element.attr("data-trigger")||this.options.trigger},getDelayShow:function(){var e=this.$element.attr("data-delay-show");return void 0!==e?e:0===this.options.delay.show?0:this.options.delay.show||100},getHideDelay:function(){var e=this.$element.attr("data-delay-hide");return void 0!==e?e:0===this.options.delay.hide?0:this.options.delay.hide||100},getAnimation:function(){return this.$element.attr("data-animation")||this.options.animation},getHideAnimation:function(){var e=this.getAnimation();return e?e+"-out":"out"},setTitle:function(e){var t=this.getTitleElement();e?t.html(e):t.remove()},hasContent:function(){return this.getContent()},getIframe:function(){var t=e("<iframe></iframe>").attr("src",this.getUrl()),n=this;return e.each(this._defaults.iframeOptions,function(e){void 0!==n.options.iframeOptions[e]&&t.attr(e,n.options.iframeOptions[e])}),t},getContent:function(){if(this.getUrl())switch(this.options.type){case"iframe":this.content=this.getIframe();break;case"html":try{this.content=e(this.getUrl()),this.content.is(":visible")||this.content.show()}catch(e){throw new Error("Unable to get popover content. Invalid selector specified.")}}else if(!this.content){var t="";if(t=e.isFunction(this.options.content)?this.options.content.apply(this.$element[0],[this]):this.options.content,this.content=this.$element.attr("data-content")||t,!this.content){var n=this.$element.next();n&&n.hasClass(r+"-content")&&(this.content=n)}}return this.content},setContent:function(e){var t=this.getTarget(),n=this.getContentElement();"string"==typeof e?n.html(e):e instanceof jQuery&&(n.html(""),this.options.cache?e.removeClass(r+"-content").appendTo(n):e.clone(!0,!0).removeClass(r+"-content").appendTo(n)),this.$target=t},isAsync:function(){return"async"===this.options.type},setContentASync:function(t){var n=this;this.xhr||(this.xhr=e.ajax({url:this.getUrl(),type:this.options.async.type,cache:this.getCache(),beforeSend:function(e){n.options.async.before&&n.options.async.before(n,e)},success:function(i){n.bindBodyEvents(),t&&e.isFunction(t)?n.content=t.apply(n.$element[0],[i]):n.content=i,n.setContent(n.content),n.getContentElement().removeAttr("style"),n.displayContent(),n.options.async.success&&n.options.async.success(n,i)},complete:function(){n.xhr=null},error:function(e,t){n.options.async.error&&n.options.async.error(n,e,t)}}))},bindBodyEvents:function(){u||(this.options.dismissible&&"click"===this.getTrigger()?(d.off("keyup.webui-popover").on("keyup.webui-popover",e.proxy(this.escapeHandler,this)),d.off("click.webui-popover touchend.webui-popover").on("click.webui-popover touchend.webui-popover",e.proxy(this.bodyClickHandler,this))):"hover"===this.getTrigger()&&d.off("touchend.webui-popover").on("touchend.webui-popover",e.proxy(this.bodyClickHandler,this)))},mouseenterHandler:function(){var e=this;e._timeout&&clearTimeout(e._timeout),e._enterTimeout=setTimeout(function(){e.getTarget().is(":visible")||e.show()},this.getDelayShow())},mouseleaveHandler:function(){var e=this;clearTimeout(e._enterTimeout),e._timeout=setTimeout(function(){e.hide()},this.getHideDelay())},escapeHandler:function(e){27===e.keyCode&&this.hideAll()},bodyClickHandler:function(e){u=!0;for(var t=!0,n=0;n<s.length;n++){var i=f(s[n]);if(i&&i._opened){var r=i.getTarget().offset().left,o=i.getTarget().offset().top,a=i.getTarget().offset().left+i.getTarget().width(),l=i.getTarget().offset().top+i.getTarget().height(),c=m(e);if(c.x>=r&&c.x<=a&&c.y>=o&&c.y<=l){t=!1;break}}}t&&p()},initTargetEvents:function(){"hover"===this.getTrigger()&&this.$target.off("mouseenter mouseleave").on("mouseenter",e.proxy(this.mouseenterHandler,this)).on("mouseleave",e.proxy(this.mouseleaveHandler,this)),this.$target.find(".close").off("click").on("click",e.proxy(this.hide,this,!0))},getPlacement:function(e){var t,n=this.options.container,i=n.innerWidth(),r=n.innerHeight(),o=n.scrollTop(),a=n.scrollLeft(),s=Math.max(0,e.left-a),l=Math.max(0,e.top-o);t="function"==typeof this.options.placement?this.options.placement.call(this,this.getTarget()[0],this.$element[0]):this.$element.data("placement")||this.options.placement;var c="horizontal"===t,u="vertical"===t;return"auto"===t||c||u?t=s<i/3?l<r/3?c?"right-bottom":"bottom-right":l<2*r/3?u?l<=r/2?"bottom-right":"top-right":"right":c?"right-top":"top-right":s<2*i/3?l<r/3?c?s<=i/2?"right-bottom":"left-bottom":"bottom":l<2*r/3?c?s<=i/2?"right":"left":l<=r/2?"bottom":"top":c?s<=i/2?"right-top":"left-top":"top":l<r/3?c?"left-bottom":"bottom-left":l<2*r/3?u?l<=r/2?"bottom-left":"top-left":"left":c?"left-top":"top-left":"auto-top"===t?t=s<i/3?"top-right":s<2*i/3?"top":"top-left":"auto-bottom"===t?t=s<i/3?"bottom-right":s<2*i/3?"bottom":"bottom-left":"auto-left"===t?t=l<r/3?"left-top":l<2*r/3?"left":"left-bottom":"auto-right"===t&&(t=l<r/3?"right-top":l<2*r/3?"right":"right-bottom"),t},getElementPosition:function(){return e.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTargetPositin:function(e,t,n,i){var r=e,o=this.options.container,a=o.innerWidth(),s=o.innerHeight(),l=this.$element.outerWidth(),c=this.$element.outerHeight(),u=o.scrollTop(),d=o.scrollLeft(),h={},f=null,p=this.options.arrow?20:0,m=l<p+10?p:0,g=c<p+10?p:0,v=0,b=s+u,y=a+d,w=r.left+r.width/2-m>0,x=r.left+r.width/2+m<y,C=r.top+r.height/2-g>0,k=r.top+r.height/2+g<b;switch(t){case"bottom":h={top:r.top+r.height,left:r.left+r.width/2-n/2};break;case"top":h={top:r.top-i,left:r.left+r.width/2-n/2};break;case"left":h={top:r.top+r.height/2-i/2,left:r.left-n};break;case"right":h={top:r.top+r.height/2-i/2,left:r.left+r.width};break;case"top-right":h={top:r.top-i,left:w?r.left-m:10},f={left:w?Math.min(l,n)/2+m:-2e3};break;case"top-left":v=x?m:-10,h={top:r.top-i,left:r.left-n+r.width+v},f={left:x?n-Math.min(l,n)/2-m:-2e3};break;case"bottom-right":h={top:r.top+r.height,left:w?r.left-m:10},f={left:w?Math.min(l,n)/2+m:-2e3};break;case"bottom-left":v=x?m:-10,h={top:r.top+r.height,left:r.left-n+r.width+v},f={left:x?n-Math.min(l,n)/2-m:-2e3};break;case"right-top":v=k?g:-10,h={top:r.top-i+r.height+v,left:r.left+r.width},f={top:k?i-Math.min(c,i)/2-g:-2e3};break;case"right-bottom":h={top:C?r.top-g:10,left:r.left+r.width},f={top:C?Math.min(c,i)/2+g:-2e3};break;case"left-top":v=k?g:-10,h={top:r.top-i+r.height+v,left:r.left-n},f={top:k?i-Math.min(c,i)/2-g:-2e3};break;case"left-bottom":h={top:C?r.top-g:10,left:r.left-n},f={top:C?Math.min(c,i)/2+g:-2e3}}return h.top+=this.getOffsetTop(),h.left+=this.getOffsetLeft(),{position:h,arrowOffset:f}}},e.fn[i]=function(t,r){var o=[],a=this.each(function(){var a=e.data(this,"plugin_"+i);a?"destroy"===t?a.destroy():"string"==typeof t&&o.push(a[t]()):(t?"string"==typeof t?"destroy"!==t&&(r||(a=new n(this,null),o.push(a[t]()))):"object"==typeof t&&(a=new n(this,t)):a=new n(this,null),e.data(this,"plugin_"+i,a))});return o.length?o:a}})}(window,document),define("pgui.column_filter",["class","underscore","pgui.filter_common","jquery.highlight","jquery.popover"],function(e,t,n){function i(e){if(h[e])return h[e];var n=t.template($(d[e]).html());return h[e]=n,n}function r(e){return $(e).closest(".js-component")}function o(e,n){return t.isObject(e[n])&&0===t.keys(e[n]).length}function a(e){var t=e.find(".js-toggle-component:visible:not(.js-ignore-select-all)").length===e.find(".js-toggle-component:visible:checked:not(.js-ignore-select-all)").length;e.find(".js-select-all").prop("checked",t)}var s=e.extend({init:function(e){this.$container=e,this.columns=[],this.filterComponent=new l,this.excludedComponents=[],this.defaultsEnabled=[],this.selectedDateTimeValues=[]},addColumn:function(e){return this.columns.push(e),this},getColumns:function(){return this.columns},setFilterComponent:function(e){return this.filterComponent=e,this},attach:function(){t.each(this.filterComponent.getChildren(),t.bind(function(e,t){this._attachPopover(t,this.$container.find('[data-name="'+t+'"] .js-filter-trigger').first(),e,this.excludedComponents[t]||[])},this))},_getChildByColumnName:function(e){return t.find(this.filterComponent.getChildren(),function(t,n){return n==e})},_attachPopover:function(e,n,r,o){var s=this,c=new l;r.setEnabled(!0);var u=$(i("content")()),d=n.webuiPopover({content:u,backdrop:!0,placement:"auto-bottom",trigger:"manual"}).data("plugin_webuiPopover");return u.on("click",".js-apply",t.bind(function(t){s._typeIsDateTime(e)&&s._isDefaultsEnabledFor(e)&&(r=c,s.filterComponent.addChild(r,e)),s._createConditions(e,r,d.$contentElement),this.submit()},this)).on("change",".js-toggle-component",function(e){a(u)}).on("change",".js-select-all",t.bind(function(e){var t=$(e.currentTarget).prop("checked");u.find("input:not(.js-select-all):not(.js-ignore-select-all)").filter(":visible").prop("checked",t).trigger("change")},this)).on("click",".js-reset",t.bind(function(e){e.preventDefault(),r.setChildren({}),this.submit()},this)).on("click",".close",function(){d.hide()}),n.on("click",function(e){e.preventDefault(),e.stopPropagation(),d.show(),$(".webui-popover-backdrop").one("click",function(){d.hide()})}).one("click",function(e){setTimeout(function(){u.css("width",u.width())},0)}).on("show.webui.popover",function(){s._typeIsDateTime(e)&&s._isDefaultsEnabledFor(e)?(u.find(".js-search").hide(),u.find(".js-content").hide(),u.find(".js-search-empty").hide(),u.find(".js-searching .js-searching-title").hide(),u.find(".js-searching").show(),$.ajax({url:window.location.href,dataType:"json",data:{column_filter_hname:e},success:function(e){u.find(".js-searching").hide(),u.find(".js-content").show(),c.deserialize(s.getColumns(),e),c.setEnabled(!0),d.$contentElement.find(".js-content").first().html("").append(s._getColumnGroupDOM(c,o)),a(d.$contentElement)}})):(d.$contentElement.find(".js-content").first().html("").append(s._getColumnGroupDOM(r,o)),s._handleSearch(e,r,d.$contentElement))}).on("shown.webui.popover",function(){a(d.$contentElement)}),u},_typeIsDateTime:function(e){return t.find(this.columns,function(t){return t.name==e&&1==t.typeIsDateTime})},_createConditions:function(e,n,i){var r=this.columns,o=t.find(r,function(t){return t.getName()===e});if(i.find(".js-content .js-dynamic input:checked").each(function(){var e=n.createCondition();e.setColumn(o),e.setEnabled(!0).setOperator("Equals").setValues([$(this).closest("div").data("condition-value")]).setDisplayValues([$(this).closest("div").data("condition-display-value")]),n.addChild(e," "+$(this).closest("div").data("condition-display-value"))}),this._typeIsDateTime(e)){var a=[],s=[],l=[];if(i.find(".js-content > .js-date-tree").each(function(){var e=$(this).find("input:checkbox").first(),t=e.closest("label").attr("title");e.prop("checked")?a.push(t):e.prop("indeterminate")&&$(this).find(".js-children > .js-group").each(function(){var e=$(this).find("input:checkbox").first(),n=e.closest("label").attr("title");e.prop("checked")?s.push({year:t,month:n}):$(this).find(".js-children > .js-component").each(function(){var e=$(this).find("input:checkbox").first(),i=e.closest("label").attr("title");e.prop("checked")&&l.push({year:t,month:n,day:i})})})}),a.length>0||s.length>0||l.length>0){var c=[];c.fullYears=a,c.fullMonths=s,c.days=l,this.selectedDateTimeValues[e]=c}}},setDefaultsEnabled:function(e){return this.defaultsEnabled=e,this},_isDefaultsEnabledFor:function(e){return-1!==this.defaultsEnabled.indexOf(e)},_handleSearch:function(e,n,r){function o(n){function o(e){return t.map(e,function(e){return a(e.id,e.value)})}function a(e,t){return $(i("condition")({ignoreSelectAll:!1,hasDivider:!1,label:$("<div/>").html(t).text(),checked:!1})).addClass("js-dynamic").data("condition-value",e).data("condition-display-value",t)}function c(){r.find(".js-content .js-dynamic").highlight(h,"ALL")}var h=d.val(),f=d.data("last-term");!0!==n&&h===f||(u.show(),l.hide(),function(){r.find(".js-content .js-dynamic").remove()}(),$.ajax({url:window.location.href,dataType:"json",data:{column_filter_hname:e,term:h,excludedValues:function(){var e=[];return r.find(".js-content input:checked").each(function(){e.push($(this).closest("label").attr("title"))}),e}()},success:function(e){u.hide(),t.isEmpty(e)?l.show():r.find(".js-content").first().append(o(e)),d.data("last-term",h),c(),s()}}))}function s(){c.toggle(d.val().length>0),a(r)}r.find(".js-searching .js-data-loading-title").hide();var l=r.find(".js-search-empty").hide(),c=r.find(".js-search-clear").hide(),u=r.find(".js-searching").hide();if(this._typeIsDateTime(e)||!this._isDefaultsEnabledFor(e))return void r.find(".js-search").hide();var d=r.find(".js-search-input");n.getTitles();c.on("click",function(){return d.val("").trigger("change"),!1}),r.find(".js-component:not(.js-dynamic)").length>0&&r.find(".js-content").first().append($('<hr class="column-filter-separator">')),d.off("keyup change").on("keyup change",t.debounce(function(){o(!1)},500)),o(!0)},_getColumnGroupDOM:function(e,n){return t.toArray(t.mapObject(e.getChildren(),function(e,t){if(!o(n,t))return e.getDOM(t,n)}))},submit:function(){var e=JSON.stringify(this.filterComponent.serializeEnabledRootComponents(this.selectedDateTimeValues));return $("<form>").attr("method","POST").append($('<input type="hidden" name="column_filter">').val(e)).hide().appendTo($("body")).submit(),this},setEnabled:function(e){return this.filterComponent.setEnabled(e),this},reset:function(){return this.filterComponent=new l,this}}),l=n.Group.extend({init:function(e,t){this._super(e,t),this.isDateTreePart=!1},getDOM:function(e,n){var a=n[e]||[],s=$(i("group")({label:$("<div/>").html(e).text(),checked:this.isEnabled(),isDateTreePart:this.isDateTreePart})),l=s.find(".js-toggle-component").first(),c=s.find(".js-children").first(),u=t.filter(t.toArray(t.mapObject(this.getChildren(),function(e,t){if(!o(a,t))return e.getDOM(t,a)})),function(e){return Boolean(e)});if(0!==u.length)return c.append(u),this._updateEnabledOnDOM(l,c),s.data("component",this).on("click",".js-caret:first",function(e){$(e.currentTarget).toggleClass("collapsed"),c.toggle(),e.preventDefault()}).on("change",".js-toggle-component",t.bind(function(e){if(r($(e.currentTarget)).data("component")===this){l.prop("indeterminate",!1);var t=$(e.currentTarget).prop("checked");this.setEnabled(t),c.find(".js-toggle-component").prop("checked",t),c.find(".js-component").each(function(e,n){$(n).data("component").setEnabled(t)})}else this._updateEnabledOnDOM(l,c)},this))},_updateEnabledOnDOM:function(e,t,n){var i=t.find(".js-toggle-component:checked").length,r=i===t.find(".js-toggle-component").length;e.prop("indeterminate",i>0&&!r),e.prop("checked",r),this.setEnabled(i>0)},createCondition:function(){return new c},serializeEnabledRootComponents:function(e){var n=this;return{type:"group",isEnabled:this.isEnabled(),operator:this.getOperator(),children:t.mapObject(this.children,function(t,i){if(t.isEnabled()){var r=t.serializeEnabledComponents();return void 0!==e[i]&&(r.selectedDateTimeValues=n.serializeSelectedDateTimeValues(e[i])),r}})}},serializeSelectedDateTimeValues:function(e){return{fullYears:e.fullYears,fullMonths:e.fullMonths,days:e.days}},serializeEnabledComponents:function(){return{type:"group",isEnabled:this.isEnabled(),operator:this.getOperator(),children:t.mapObject(this.children,function(e){if(e.isEnabled()&&!e.isDateTreePart)return e.serializeEnabledComponents()})}},setEnabledDeep:function(e){return this.setEnabled(e),t.each(this.children,function(t){t.setEnabledDeep(e)}),this},getTitles:function(){return t.reduce(this.children,function(e,n,i){return e.push({title:$("<div/>").html(i).text(),component:n}),e.push(n.getTitles()),t.flatten(e)},[])},serialize:function(){var e=this._super();return e.isDateTreePart=this.isDateTreePart,e},deserialize:function(e,t){return this.isDateTreePart=t.isDateTreePart||!1,this._super(e,t)}}),c=n.Condition.extend({init:function(e,t,n){this._super(e,t,n),this.hasDivider=!1,this.ignoreSelectAll=null,this.isDateTreePart=!1},getDOM:function(e){return $(i("condition")({ignoreSelectAll:this.ignoreSelectAll,hasDivider:this.hasDivider,label:$("<div/>").html(e).text(),checked:this.isEnabled()})).data("component",this).on("change",".js-toggle-component",t.bind(function(e){this.setEnabled($(e.currentTarget).prop("checked"))},this))},serializeEnabledComponents:function(){return{type:"condition",isEnabled:this.isEnabled(),column:this.column.getName(),operator:this.getOperator(),values:this.getValues(),displayValues:this.getDisplayValues()}},setEnabledDeep:function(e){return this.setEnabled(e),this},getTitles:function(){return[]},serialize:function(){var e=this._super();return e.hasDivider=this.hasDivider,e.ignoreSelectAll=this.ignoreSelectAll,e},deserialize:function(e,t){return this.hasDivider=t.hasDivider||!1,this.ignoreSelectAll=t.ignoreSelectAll||!1,this._super(e,t)}}),u=n.Column.extend({init:function(e,t,n,i){this._super(e,t,i),this.typeIsDateTime=n},setTypeIsDateTime:function(e){return this.typeIsDateTime=e,this},getTypeIsDateTime:function(){return this.typeIsDateTime}}),d={content:"#columnFilterContentTemplate",group:"#columnFilterGroupTemplate",condition:"#columnFilterConditionTemplate"},h={};return{Column:u,Group:l,Condition:c,create:function(e){return new s(e)}}}),define("pgui.text_highlight",["jquery.highlight"],function(){return{HighlightTextInGrid:function(e,t,n,i,r){$(e+" [data-column-name='"+t+"']").highlight(n,i,{hint:r||""})},HighlightTextInAllGrid:function(e,t,n){e.highlight(""+t,n)}}}),define("pgui.quick_filter",["class","pgui.text_highlight","pgui.editors/multivalue_select"],function(e,t,n){return e.extend({init:function(e){this.container=e,this._initializeEditors(),this._initializeEvents()},_initializeEditors:function(){this.$input=this.container.find(".js-input"),this.$filterConditionEditor=this.container.find("#quick-filter-operator");var e=this.container.find("#quick-filter-fields");this.$selectedColumnsEditor=new n(e),e.off("change")},_initializeEvents:function(){var e=this;this.container.on("click",".js-submit",function(){e._submit()}).on("click",".js-reset",function(){e._reset()._submit()}).on("keyup",".js-input",function(t){13===t.keyCode&&e._submit()}).on("click",".js-cancel",function(t){var n=e.container.find(".dropdown-toggle");n.length&&n.trigger("click")})},setColumnNames:function(e){return this.columnNames=e,this},highlight:function(e){return t.HighlightTextInAllGrid(e.find($.map(this._getColumnsToHighlight(),function(e){return'td[data-column-name="'+e+'"]'}).join(",")),this._getValue(),"ALL"),this},_getColumnsToHighlight:function(){var e=[],t=this.$selectedColumnsEditor.getValue();if(_.isArray(t))for(var n=0;n<this.columnNames.length;n++)t.indexOf(this.columnNames[n])>-1&&e.push(this.columnNames[n]);return e.length>0?e:this.columnNames},_getValue:function(){return this.$input.val()},_getFilterCondition:function(){return this.$filterConditionEditor.val()},_getSelectedColumns:function(){return this.$selectedColumnsEditor.getValue()},_reset:function(){return this.$input.val(""),this},_submit:function(){var e=jQuery.query;e=e.set("quick_filter",this._getValue()),e=e.set("quick_filter_operator",this._getFilterCondition()),e=e.set("quick_filter_fields",this._getSelectedColumns()),window.location=e}})}),function(e,t){"use strict";function n(n,i,r){var o=this,a=n.get(0);o.duration=i.duration,o.opacity=i.opacity,o.isShown=!1,o.jqTargetOrg=n,e.isWindow(a)||9===a.nodeType?o.jqTarget=e("body"):"iframe"===a.nodeName.toLowerCase()||"frame"===a.nodeName.toLowerCase()?(o.jqWin=e(a.contentWindow),o.elmDoc=a.contentWindow.document,o.jqTarget=e("body",o.elmDoc),o.isFrame=!0):o.jqTarget=n,o.jqWin=o.jqWin||e(window),o.elmDoc=o.elmDoc||document,o.isBody="body"===o.jqTarget.get(0).nodeName.toLowerCase(),r&&(r.jqProgress&&(r.timer&&clearTimeout(r.timer),r.jqProgress.remove(),delete r.jqProgress),r.reset(!0),r.jqOverlay.stop()),o.jqOverlay=(r&&r.jqOverlay||e('<div class="'+l+'" />').css({position:o.isBody?"fixed":"absolute",left:0,top:0,display:"none",cursor:"wait"}).appendTo(o.jqTarget).on("touchmove",function(){return!1})).css({backgroundColor:i.fillColor,zIndex:i.zIndex}),(o.jqProgress=!1===i.progress?t:"function"==typeof i.progress?i.progress.call(o.jqTarget,i):d(o))&&o.jqProgress.css({position:o.isBody?"fixed":"absolute",display:"none",zIndex:i.zIndex+1,cursor:"wait"}).appendTo(o.jqTarget).on("touchmove",function(){return!1}),o.callAdjust=function(e){return e.adjustProgress?function(){e.adjustProgress(),e.adjust()}:function(){e.adjust()}}(o),o.avoidFocus=function(t){return function(n){return e(t.elmDoc.activeElement).blur(),n.preventDefault(),!1}}(o),o.avoidScroll=function(e){return function(t){return function(t){t.scrollLeft(e.scrLeft).scrollTop(e.scrTop)}(e.isBody?e.jqWin:e.jqTarget),t.preventDefault(),!1}}(o),r&&(r.timer&&clearTimeout(r.timer),r=t)}function i(t,i){var r=e.extend({duration:200,opacity:.6,zIndex:9e3},i);return r.fillColor=r.fillColor||r.color||"#888",t.each(function(){var t=e(this);t.data(s,new n(t,r,t.data(s))),"function"==typeof r.show&&t.off(c,r.show).on(c,r.show),"function"==typeof r.hide&&t.off(u,r.hide).on(u,r.hide)})}function r(t,n){return t.each(function(){var t,r=e(this);(n||!(t=r.data(s)))&&(t=i(r,n).data(s)),t.show()})}function o(t){return t.each(function(){var t=e(this).data(s);t&&t.hide()})}function a(e,n,r){var o,a=e.length?e.eq(0):t;if(a&&(o=a.data(s)||i(a).data(s),o.hasOwnProperty(n)))return null!=r&&(o[n]=r),o[n]}var s="plainOverlay",l=s.toLowerCase(),c=l+"show",u=l+"hide",d=function(){function n(n,i,r,o){return o=o===t?";":o,e.map(n,function(t){return e.map(i,function(e){return(r||"")+e+t}).join(o)}).join(o)}var i,r="jQuery-"+s,o=["-webkit-","-moz-","-ms-","-o-",""],a=r+"-progress",l="."+a+"{"+n(["box-sizing:border-box"],["-webkit-","-moz-",""])+";width:100%;height:100%;border-top:3px solid #17f29b;"+n(["border-radius:50%"],o)+";-webkit-tap-highlight-color:rgba(0,0,0,0);transform:translateZ(0);box-shadow:0 0 1px rgba(0,0,0,0);"+n(["animation-name:"+r+"-spin","animation-duration:1s","animation-timing-function:linear","animation-iteration-count:infinite"],o)+"}"+n(["keyframes "+r+"-spin{from{"+n(["transform:rotate(0deg)"],o)+"}to{"+n(["transform:rotate(360deg)"],o)+"}}"],o,"@","")+"."+a+"-legacy{width:100%;height:50%;padding-top:25%;text-align:center;white-space:nowrap;*zoom:1}."+a+"-legacy:after,."+a+'-legacy:before{content:" ";display:table}.'+a+"-legacy:after{clear:both}."+a+"-legacy div{width:18%;height:100%;margin:0 1%;background-color:#17f29b;float:left;visibility:hidden}."+a+"-1 div."+a+"-1,."+a+"-2 div."+a+"-1,."+a+"-2 div."+a+"-2,."+a+"-3 div."+a+"-1,."+a+"-3 div."+a+"-2,."+a+"-3 div."+a+"-3{visibility:visible}",c=function(){var e=Math.min(300,.9*(this.isBody?Math.min(this.jqWin.width(),this.jqWin.height()):Math.min(this.jqTarget.innerWidth(),this.jqTarget.innerHeight())));this.jqProgress.width(e).height(e),this.showProgress||this.jqProgress.children("."+a).css("borderTopWidth",Math.max(3,e/30))},u=function(e){var t=this;t.timer&&clearTimeout(t.timer),t.progressCnt&&t.jqProgress.removeClass(a+"-"+t.progressCnt),t.isShown&&(t.progressCnt=!e&&t.progressCnt<3?t.progressCnt+1:0,t.progressCnt&&t.jqProgress.addClass(a+"-"+t.progressCnt),t.timer=setTimeout(function(){t.showProgress()},500))};return function(n){var o,s;return"boolean"!=typeof i&&(i=function(){function e(e,t){return!!~(""+e).indexOf(t)}function n(n){var i;for(i in n)if(!e(n[i],"-")&&s[n[i]]!==t)return!0;return!1}function i(e){var t=e.charAt(0).toUpperCase()+e.slice(1);return n((e+" "+c.join(t+" ")+t).split(" "))}var r,o,a=document.createElement("modernizr"),s=a.style,l="Webkit Moz O ms",c=l.split(" "),u={},d={}.hasOwnProperty,h=d!==t&&d.call!==t?function(e,t){return d.call(e,t)}:function(e,n){return n in e&&e.constructor.prototype[n]===t};u.borderradius=function(){return i("borderRadius")},u.cssanimations=function(){return i("animationName")},u.csstransforms=function(){return!!i("transform")},r=!1;for(o in u)if(h(u,o)&&!u[o]()){r=!0;break}return s.cssText="",a=null,r}()),n.elmDoc.getElementById(r)||(n.elmDoc.createStyleSheet?(s=n.elmDoc.createStyleSheet(),s.owningElement.id=r,s.cssText=l):(s=(n.elmDoc.getElementsByTagName("head")[0]||n.elmDoc.documentElement).appendChild(n.elmDoc.createElement("style")),s.type="text/css",s.id=r,s.textContent=l)),i?(o=e('<div><div class="'+a+'-legacy"><div class="'+a+'-3" /><div class="'+a+'-2" /><div class="'+a+'-1" /><div class="'+a+'-2" /><div class="'+a+'-3" /></div></div>'),n.showProgress=u):o=e('<div><div class="'+a+'" /></div>'),n.adjustProgress=c,o}}();n.prototype.show=function(){var n,i,r,o,a,s=this;s.reset(!0),n=s.jqTarget.get(0).style,s.orgPosition=n.position,i=s.jqTarget.css("position"),"relative"!==i&&"absolute"!==i&&"fixed"!==i&&s.jqTarget.css("position","relative"),s.orgOverflow=n.overflow,r=s.jqTarget.prop("clientWidth"),o=s.jqTarget.prop("clientHeight"),s.jqTarget.css("overflow","hidden"),r-=s.jqTarget.prop("clientWidth"),o-=s.jqTarget.prop("clientHeight"),s.addMarginR=s.addMarginB=0,0>r&&(s.addMarginR=-r),0>o&&(s.addMarginB=-o),s.isBody?(s.addMarginR&&(s.orgMarginR=n.marginRight,s.jqTarget.css("marginRight","+="+s.addMarginR)),s.addMarginB&&(s.orgMarginB=n.marginBottom,s.jqTarget.css("marginBottom","+="+s.addMarginB))):(s.addMarginR&&(s.orgMarginR=n.paddingRight,s.orgWidth=n.width),
s.addMarginB&&(s.orgMarginB=n.paddingBottom,s.orgHeight=n.height)),s.jqActive=t,a=e(s.elmDoc.activeElement),s.isBody&&!s.isFrame?s.jqActive=a.blur():s.jqTarget.has(a.get(0)).length&&a.blur(),s.jqTarget.focusin(s.avoidFocus),function(e){s.scrLeft=e.scrollLeft(),s.scrTop=e.scrollTop(),e.scroll(s.avoidScroll)}(s.isBody?s.jqWin:s.jqTarget),s.jqWin.resize(s.callAdjust),s.callAdjust(),s.isShown=!0,s.jqOverlay.stop().fadeTo(s.duration,s.opacity,function(){s.jqTargetOrg.trigger(c)}),s.jqProgress&&(s.showProgress&&s.showProgress(!0),s.jqProgress.fadeIn(s.duration))},n.prototype.hide=function(){var e=this;e.isShown&&(e.jqOverlay.stop().fadeOut(e.duration,function(){e.reset(),e.jqTargetOrg.trigger(u)}),e.jqProgress&&e.jqProgress.fadeOut(e.duration))},n.prototype.adjust=function(){var e,t;this.isBody?(e=this.jqWin.width(),t=this.jqWin.height(),this.jqOverlay.width(e).height(t),this.jqProgress&&this.jqProgress.css({left:(e-this.jqProgress.outerWidth())/2,top:(t-this.jqProgress.outerHeight())/2})):(this.addMarginR&&(e=this.jqTarget.css({paddingRight:this.orgMarginR,width:this.orgWidth}).width(),this.jqTarget.css("paddingRight","+="+this.addMarginR).width(e-this.addMarginR)),this.addMarginB&&(t=this.jqTarget.css({paddingBottom:this.orgMarginB,height:this.orgHeight}).height(),this.jqTarget.css("paddingBottom","+="+this.addMarginB).height(t-this.addMarginB)),e=Math.max(this.jqTarget.prop("scrollWidth"),this.jqTarget.innerWidth()),t=Math.max(this.jqTarget.prop("scrollHeight"),this.jqTarget.innerHeight()),this.jqOverlay.width(e).height(t),this.jqProgress&&(e=this.jqTarget.innerWidth(),t=this.jqTarget.innerHeight(),this.jqProgress.css({left:(e-this.jqProgress.outerWidth())/2+this.scrLeft,top:(t-this.jqProgress.outerHeight())/2+this.scrTop})))},n.prototype.reset=function(e){var t=this;e&&(t.jqOverlay.css("display","none"),t.jqProgress&&t.jqProgress.css("display","none")),t.isShown&&(t.jqTarget.css({position:t.orgPosition,overflow:t.orgOverflow}),t.isBody?(t.addMarginR&&t.jqTarget.css("marginRight",t.orgMarginR),t.addMarginB&&t.jqTarget.css("marginBottom",t.orgMarginB)):(t.addMarginR&&t.jqTarget.css({paddingRight:t.orgMarginR,width:t.orgWidth}),t.addMarginB&&t.jqTarget.css({paddingBottom:t.orgMarginB,height:t.orgHeight})),t.jqTarget.off("focusin",t.avoidFocus),t.jqActive&&t.jqActive.length&&t.jqActive.focus(),function(e){e.off("scroll",t.avoidScroll).scrollLeft(t.scrLeft).scrollTop(t.scrTop)}(t.isBody?t.jqWin:t.jqTarget),t.jqWin.off("resize",t.callAdjust),t.isShown=!1)},e.fn[s]=function(e,t,n){return"show"===e?r(this,t):"hide"===e?o(this):"option"===e?a(this,t,n):i(this,e)}}(jQuery),define("jquery.plainoverlay",function(){}),define("pgui.overlay",["jquery.plainoverlay"],function(){return window.overlay={showOverlay:function(e,t){$("body").plainOverlay("show",{progress:function(){return $('<div class="pgui-overlay"><div class="comment">'+t+"</div></div>")}})},hideOverlay:function(){$("body").plainOverlay("hide")}},window.overlay}),define("multiple_sorting",["class","pgui.localizer"],function(e,t){return e.extend({init:function(e,t){var n=this;this.sorter=e,this.$sortDialog=t,this.$table=t.find(".multiple-sorting-table"),this.$addLevelButton=t.find(".add-sorting-level"),this.$deleteLevelButton=t.find(".delete-sorting-level"),this.$initialLevels=this.$table.find("tr.sorting-level").clone(),this.$sortDialog.on("click",".sort-button",function(e){e.preventDefault();var t=n.$table.find("tr.sorting-level");n.sorter.clear(),t.each(function(){var e=$(this).find(".multi-sort-name").val();n.sorter.deleteColumn(e),n.sorter.addColumn(e,$(this).find(".multi-sort-order").val())}),n.sorter.applySort()}),this.$sortDialog.on("hidden.bs.modal",function(){n.$table.find("tr.sorting-level").remove(),n.$table.find("tbody").append(n.$initialLevels),n._updateButtons()}),this.$addLevelButton.on("click",function(){n._addLevel()}),this.$deleteLevelButton.on("click",function(){n._deleteLevel()}),this._updateButtons()},_addLevel:function(){var e=t.getString("SortBy");this.$table.find("tr.sorting-level").length>0&&(e=t.getString("ThenBy"));var n=$("<select>").addClass("multi-sort-name form-control");$.each(this.sorter.getSortableColumns(),function(e,t){n.append($("<option>").val(t.name).text(t.caption))});var i=$("<select>").addClass("multi-sort-order form-control").append($("<option>").val("a").text(t.getString("Ascending"))).append($("<option>").val("d").text(t.getString("Descending")));$("<tr>").addClass("sorting-level").append($("<td>").text(e)).append($("<td>").append(n)).append($("<td>").append(i)).appendTo(this.$table.find("tbody")),this._updateButtons()},_deleteLevel:function(){var e=this.$table.find("tr.sorting-level");e.length>0&&e.last().remove(),this._updateButtons()},_updateButtons:function(){var e=this.$table.find("tr.sorting-level").length,t=this.sorter.getSortableColumns().length;this.$addLevelButton.prop("disabled",t==e),this.$deleteLevelButton.prop("disabled",0==e)}})}),define("sorter",["class"],function(e){return e.extend({init:function(e){var t=this;this.sortingColumns=[],this.sortableColumns=[],$.each(e,function(e,n){var i=$('.sortable[data-field-name="'+n.name+'"]');t.sortableColumns.push(n),i.on("click",function(e){e.preventDefault();var n=$(this).data("field-name");t._onClickSortableCellHandler(n,e)});var r=i.data("sort-index")||n.index;void 0!=r&&(t.sortingColumns[r]=("desc"==i.data("sort-order")?"d":"a")+i.data("field-name"))})},_onClickSortableCellHandler:function(e,t){t.shiftKey?this.addColumn(e):t.ctrlKey||t.metaKey?this.deleteColumn(e):this.sortByColumn(e),this.applySort()},getSortableColumns:function(){return this.sortableColumns},applySort:function(){var e=this;require(["jquery.query"],function(){e.sortingColumns.length>0?window.location=jQuery.query.set("order",e.sortingColumns):window.location=jQuery.query.remove("order").set("operation","resetorder")})},_getColumnIndexByName:function(e){for(var t=0;t<this.sortingColumns.length;t++)if(this.sortingColumns[t]&&this.sortingColumns[t].slice(1)==e)return t},addColumn:function(e,t){var n=this._getColumnIndexByName(e);if(void 0==n)return void this.sortingColumns.push((t||"a")+e);"a"==this.sortingColumns[n].charAt(0)?this.sortingColumns[n]="d"+e:this.sortingColumns[n]="a"+e},deleteColumn:function(e){var t=this._getColumnIndexByName(e);void 0!==t&&this.sortingColumns.splice(t,1)},sortByColumn:function(e){var t=this._getColumnIndexByName(e),n="d";void 0!=t&&"d"!=this.sortingColumns[t].charAt(0)||(n="a"),this.sortingColumns=[n+e]},clear:function(){this.sortingColumns=[]}})}),define("pgui.autohide-message",[],function(){return function(e,t,n){n=n||1e3,(t=parseInt(t||e.data("display-time")||0))>0&&setTimeout(function(){e.slideUp(n)},1e3*parseInt(t))}}),function(e,t){"use strict";e.bootbox=t(e.jQuery),"function"==typeof define&&define.amd?define("libs/bootbox.min",["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):e.bootbox=t(e.jQuery)}(this,function e(t,n){"use strict";function i(e,n,i){return t.extend(!0,{},e,function(e,t){var n=e.length,i={};if(n<1||2<n)throw new Error("Invalid argument length");return 2===n||"string"==typeof e[0]?(i[t[0]]=e[0],i[t[1]]=e[1]):i=e[0],i}(n,i))}function r(e,t,r,o){var s;o&&o[0]&&(s=o[0].locale||w.locale,(o[0].swapButtonOrder||w.swapButtonOrder)&&(t=t.reverse()));var l,c,u,d={className:"bootbox-"+e,buttons:function(e,t){for(var n={},i=0,r=e.length;i<r;i++){var o=e[i],a=o.toLowerCase(),s=o.toUpperCase();n[a]={label:(l=s,c=t,u=b[c],u?u[l]:b.en[l])}}var l,c,u;return n}(t,s)};return l=i(d,o,r),u={},a(c=t,function(e,t){u[t]=!0}),a(l.buttons,function(e){if(u[e]===n)throw new Error('button key "'+e+'" is not allowed (options are '+c.join(" ")+")")}),l}function o(e){return Object.keys(e).length}function a(e,n){var i=0;t.each(e,function(e,t){n(e,t,i++)})}function s(e){e.data.dialog.find(".bootbox-accept").first().trigger("focus")}function l(e){e.target===e.data.dialog[0]&&e.data.dialog.remove()}function c(e){e.target===e.data.dialog[0]&&(e.data.dialog.off("escape.close.bb"),e.data.dialog.off("click"))}function u(e,n,i){e.stopPropagation(),e.preventDefault(),t.isFunction(i)&&!1===i.call(n,e)||n.modal("hide")}function d(e){return/([01][0-9]|2[0-3]):[0-5][0-9]?:[0-5][0-9]/.test(e)}function h(e){return/(\d{4})-(\d{2})-(\d{2})/.test(e)}var f,p,m,g;Object.keys||(Object.keys=(f=Object.prototype.hasOwnProperty,p=!{toString:null}.propertyIsEnumerable("toString"),g=(m=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(e){if("function"!=typeof e&&("object"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var t,n,i=[];for(t in e)f.call(e,t)&&i.push(t);if(p)for(n=0;n<g;n++)f.call(e,m[n])&&i.push(m[n]);return i}));var v={};v.VERSION="5.5.2";var b={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"}},y={dialog:'<div class="bootbox modal" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-body"><div class="bootbox-body"></div></div></div></div></div>',header:'<div class="modal-header"><h5 class="modal-title"></h5></div>',footer:'<div class="modal-footer"></div>',closeButton:'<button type="button" class="bootbox-close-button close" aria-hidden="true">&times;</button>',form:'<form class="bootbox-form"></form>',button:'<button type="button" class="btn"></button>',option:"<option></option>",promptMessage:'<div class="bootbox-prompt-message"></div>',inputs:{text:'<input class="bootbox-input bootbox-input-text form-control" autocomplete="off" type="text" />',textarea:'<textarea class="bootbox-input bootbox-input-textarea form-control"></textarea>',email:'<input class="bootbox-input bootbox-input-email form-control" autocomplete="off" type="email" />',select:'<select class="bootbox-input bootbox-input-select form-control"></select>',checkbox:'<div class="form-check checkbox"><label class="form-check-label"><input class="form-check-input bootbox-input bootbox-input-checkbox" type="checkbox" /></label></div>',radio:'<div class="form-check radio"><label class="form-check-label"><input class="form-check-input bootbox-input bootbox-input-radio" type="radio" name="bootbox-radio" /></label></div>',date:'<input class="bootbox-input bootbox-input-date form-control" autocomplete="off" type="date" />',time:'<input class="bootbox-input bootbox-input-time form-control" autocomplete="off" type="time" />',number:'<input class="bootbox-input bootbox-input-number form-control" autocomplete="off" type="number" />',password:'<input class="bootbox-input bootbox-input-password form-control" autocomplete="off" type="password" />',range:'<input class="bootbox-input bootbox-input-range form-control-range" autocomplete="off" type="range" />'}},w={locale:"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body",value:"",inputType:"text",swapButtonOrder:!1,centerVertical:!1,multiple:!1,scrollable:!1,reusable:!1};return v.locales=function(e){return e?b[e]:b},v.addLocale=function(e,n){return t.each(["OK","CANCEL","CONFIRM"],function(e,t){if(!n[t])throw new Error('Please supply a translation for "'+t+'"')}),b[e]={OK:n.OK,CANCEL:n.CANCEL,CONFIRM:n.CONFIRM},v},v.removeLocale=function(e){if("en"===e)throw new Error('"en" is used as the default and fallback locale and cannot be removed.');return delete b[e],v},v.setLocale=function(e){return v.setDefaults("locale",e)},v.setDefaults=function(){var e={};return 2===arguments.length?e[arguments[0]]=arguments[1]:e=arguments[0],t.extend(w,e),v},v.hideAll=function(){return t(".bootbox").modal("hide"),v},v.init=function(n){return e(n||t)},v.dialog=function(e){if(t.fn.modal===n)throw new Error('"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/4.4/getting-started/javascript/ for more details.');if(e=function(e){var n,i;if("object"!=typeof e)throw new Error("Please supply an object of options");if(!e.message)throw new Error('"message" option must not be null or an empty string.');return(e=t.extend({},w,e)).backdrop?e.backdrop="string"!=typeof e.backdrop||"static"!==e.backdrop.toLowerCase()||"static":e.backdrop=!1!==e.backdrop&&0!==e.backdrop&&"static",e.buttons||(e.buttons={}),n=e.buttons,i=o(n),a(n,function(r,o,a){if(t.isFunction(o)&&(o=n[r]={callback:o}),"object"!==t.type(o))throw new Error('button with key "'+r+'" must be an object');if(o.label||(o.label=r),!o.className){var s=!1;s=e.swapButtonOrder?0===a:a===i-1,o.className=i<=2&&s?"btn-primary":"btn-secondary btn-default"}}),e}(e),t.fn.modal.Constructor.VERSION){e.fullBootstrapVersion=t.fn.modal.Constructor.VERSION;var i=e.fullBootstrapVersion.indexOf(".");e.bootstrap=e.fullBootstrapVersion.substring(0,i)}else e.bootstrap="2",e.fullBootstrapVersion="2.3.2",console.warn("Bootbox will *mostly* work with Bootstrap 2, but we do not officially support it. Please upgrade, if possible.");var r=t(y.dialog),d=r.find(".modal-dialog"),h=r.find(".modal-body"),f=t(y.header),p=t(y.footer),m=e.buttons,g={onEscape:e.onEscape};if(h.find(".bootbox-body").html(e.message),0<o(e.buttons)&&(a(m,function(e,n){var i=t(y.button);switch(i.data("bb-handler",e),i.addClass(n.className),e){case"ok":case"confirm":i.addClass("bootbox-accept");break;case"cancel":i.addClass("bootbox-cancel")}i.html(n.label),p.append(i),g[e]=n.callback}),h.after(p)),!0===e.animate&&r.addClass("fade"),e.className&&r.addClass(e.className),e.size)switch(e.fullBootstrapVersion.substring(0,3)<"3.1"&&console.warn('"size" requires Bootstrap 3.1.0 or higher. You appear to be using '+e.fullBootstrapVersion+". Please upgrade to use this option."),e.size){case"small":case"sm":d.addClass("modal-sm");break;case"large":case"lg":d.addClass("modal-lg");break;case"extra-large":case"xl":d.addClass("modal-xl"),e.fullBootstrapVersion.substring(0,3)<"4.2"&&console.warn('Using size "xl"/"extra-large" requires Bootstrap 4.2.0 or higher. You appear to be using '+e.fullBootstrapVersion+". Please upgrade to use this option.")}if(e.scrollable&&(d.addClass("modal-dialog-scrollable"),e.fullBootstrapVersion.substring(0,3)<"4.3"&&console.warn('Using "scrollable" requires Bootstrap 4.3.0 or higher. You appear to be using '+e.fullBootstrapVersion+". Please upgrade to use this option.")),e.title&&(h.before(f),r.find(".modal-title").html(e.title)),e.closeButton){var v=t(y.closeButton);e.title?3<e.bootstrap?r.find(".modal-header").append(v):r.find(".modal-header").prepend(v):v.prependTo(h)}if(e.centerVertical&&(d.addClass("modal-dialog-centered"),e.fullBootstrapVersion<"4.0.0"&&console.warn('"centerVertical" requires Bootstrap 4.0.0-beta.3 or higher. You appear to be using '+e.fullBootstrapVersion+". Please upgrade to use this option.")),e.reusable||r.one("hide.bs.modal",{dialog:r},c),e.onHide){if(!t.isFunction(e.onHide))throw new Error('Argument supplied to "onHide" must be a function');r.on("hide.bs.modal",e.onHide)}if(e.reusable||r.one("hidden.bs.modal",{dialog:r},l),e.onHidden){if(!t.isFunction(e.onHidden))throw new Error('Argument supplied to "onHidden" must be a function');r.on("hidden.bs.modal",e.onHidden)}if(e.onShow){if(!t.isFunction(e.onShow))throw new Error('Argument supplied to "onShow" must be a function');r.on("show.bs.modal",e.onShow)}if(r.one("shown.bs.modal",{dialog:r},s),e.onShown){if(!t.isFunction(e.onShown))throw new Error('Argument supplied to "onShown" must be a function');r.on("shown.bs.modal",e.onShown)}return!0===e.backdrop&&r.on("click.dismiss.bs.modal",function(e){r.children(".modal-backdrop").length&&(e.currentTarget=r.children(".modal-backdrop").get(0)),e.target===e.currentTarget&&r.trigger("escape.close.bb")}),r.on("escape.close.bb",function(e){g.onEscape&&u(e,r,g.onEscape)}),r.on("click",".modal-footer button:not(.disabled)",function(e){var i=t(this).data("bb-handler");i!==n&&u(e,r,g[i])}),r.on("click",".bootbox-close-button",function(e){u(e,r,g.onEscape)}),r.on("keyup",function(e){27===e.which&&r.trigger("escape.close.bb")}),t(e.container).append(r),r.modal({backdrop:e.backdrop,keyboard:!1,show:!1}),e.show&&r.modal("show"),r},v.alert=function(){var e;if((e=r("alert",["ok"],["message","callback"],arguments)).callback&&!t.isFunction(e.callback))throw new Error('alert requires the "callback" property to be a function when provided');return e.buttons.ok.callback=e.onEscape=function(){return!t.isFunction(e.callback)||e.callback.call(this)},v.dialog(e)},v.confirm=function(){var e;if(e=r("confirm",["cancel","confirm"],["message","callback"],arguments),!t.isFunction(e.callback))throw new Error("confirm requires a callback");return e.buttons.cancel.callback=e.onEscape=function(){return e.callback.call(this,!1)},e.buttons.confirm.callback=function(){return e.callback.call(this,!0)},v.dialog(e)},v.prompt=function(){var e,i,o,l,c,u;if(o=t(y.form),(e=r("prompt",["cancel","confirm"],["title","callback"],arguments)).value||(e.value=w.value),e.inputType||(e.inputType=w.inputType),c=e.show===n?w.show:e.show,e.show=!1,e.buttons.cancel.callback=e.onEscape=function(){return e.callback.call(this,null)},e.buttons.confirm.callback=function(){var n;if("checkbox"===e.inputType)n=l.find("input:checked").map(function(){return t(this).val()}).get();else if("radio"===e.inputType)n=l.find("input:checked").val();else{if(l[0].checkValidity&&!l[0].checkValidity())return!1;n="select"===e.inputType&&!0===e.multiple?l.find("option:selected").map(function(){return t(this).val()}).get():l.val()}return e.callback.call(this,n)},!e.title)throw new Error("prompt requires a title");if(!t.isFunction(e.callback))throw new Error("prompt requires a callback");if(!y.inputs[e.inputType])throw new Error("Invalid prompt type");switch(l=t(y.inputs[e.inputType]),e.inputType){case"text":case"textarea":case"email":case"password":l.val(e.value),e.placeholder&&l.attr("placeholder",e.placeholder),e.pattern&&l.attr("pattern",e.pattern),e.maxlength&&l.attr("maxlength",e.maxlength),e.required&&l.prop({required:!0}),e.rows&&!isNaN(parseInt(e.rows))&&"textarea"===e.inputType&&l.attr({rows:e.rows});break;case"date":case"time":case"number":case"range":if(l.val(e.value),e.placeholder&&l.attr("placeholder",e.placeholder),e.pattern&&l.attr("pattern",e.pattern),e.required&&l.prop({required:!0}),"date"!==e.inputType&&e.step){if(!("any"===e.step||!isNaN(e.step)&&0<parseFloat(e.step)))throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');l.attr("step",e.step)}!function(e,t,i){var r=!1,o=!0,a=!0;if("date"===e)t===n||(o=h(t))?i===n||(a=h(i))||console.warn('Browsers which natively support the "date" input type expect date values to be of the form "YYYY-MM-DD" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your max value may not be enforced by this browser.'):console.warn('Browsers which natively support the "date" input type expect date values to be of the form "YYYY-MM-DD" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your min value may not be enforced by this browser.');else if("time"===e){if(t!==n&&!(o=d(t)))throw new Error('"min" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');if(i!==n&&!(a=d(i)))throw new Error('"max" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.')}else{if(t!==n&&isNaN(t))throw o=!1,new Error('"min" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.');if(i!==n&&isNaN(i))throw a=!1,new Error('"max" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.')}if(o&&a){if(i<=t)throw new Error('"max" must be greater than "min". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');r=!0}return r}(e.inputType,e.min,e.max)||(e.min!==n&&l.attr("min",e.min),e.max!==n&&l.attr("max",e.max));break;case"select":var f={};if(u=e.inputOptions||[],!t.isArray(u))throw new Error("Please pass an array of input options");if(!u.length)throw new Error('prompt with "inputType" set to "select" requires at least one option');e.placeholder&&l.attr("placeholder",e.placeholder),e.required&&l.prop({required:!0}),e.multiple&&l.prop({multiple:!0}),a(u,function(e,i){var r=l;if(i.value===n||i.text===n)throw new Error('each option needs a "value" property and a "text" property');i.group&&(f[i.group]||(f[i.group]=t("<optgroup />").attr("label",i.group)),r=f[i.group]);var o=t(y.option);o.attr("value",i.value).text(i.text),r.append(o)}),a(f,function(e,t){l.append(t)}),l.val(e.value);break;case"checkbox":var p=t.isArray(e.value)?e.value:[e.value];if(!(u=e.inputOptions||[]).length)throw new Error('prompt with "inputType" set to "checkbox" requires at least one option');l=t('<div class="bootbox-checkbox-list"></div>'),a(u,function(i,r){if(r.value===n||r.text===n)throw new Error('each option needs a "value" property and a "text" property');var o=t(y.inputs[e.inputType]);o.find("input").attr("value",r.value),o.find("label").append("\n"+r.text),a(p,function(e,t){t===r.value&&o.find("input").prop("checked",!0)}),l.append(o)});break;case"radio":if(e.value!==n&&t.isArray(e.value))throw new Error('prompt with "inputType" set to "radio" requires a single, non-array value for "value"');if(!(u=e.inputOptions||[]).length)throw new Error('prompt with "inputType" set to "radio" requires at least one option');l=t('<div class="bootbox-radiobutton-list"></div>');var m=!0;a(u,function(i,r){if(r.value===n||r.text===n)throw new Error('each option needs a "value" property and a "text" property');var o=t(y.inputs[e.inputType]);o.find("input").attr("value",r.value),o.find("label").append("\n"+r.text),e.value!==n&&r.value===e.value&&(o.find("input").prop("checked",!0),m=!1),l.append(o)}),m&&l.find('input[type="radio"]').first().prop("checked",!0)}if(o.append(l),o.on("submit",function(e){e.preventDefault(),e.stopPropagation(),i.find(".bootbox-accept").trigger("click")}),""!==t.trim(e.message)){var g=t(y.promptMessage).html(e.message);o.prepend(g),e.message=o}else e.message=o;return(i=v.dialog(e)).off("shown.bs.modal",s),i.on("shown.bs.modal",function(){l.focus()}),!0===c&&i.modal("show"),i},v}),require(["pgui.localizer","libs/bootbox.min","jquery"],function(e){e.load().done(function(){bootbox.addLocale("php_gen",{OK:e.getString("Ok"),CANCEL:e.getString("Cancel"),CONFIRM:e.getString("Ok")}),bootbox.setLocale("php_gen")})}),define("bootbox",function(){}),define("pgui.utils",["pgui.autohide-message","bootbox"],function(e){function t(e,t){return $("<div>").addClass("alert").addClass("alert-"+t).css("margin-bottom",0).html("<p>"+e+"</p>")}function n(e){bootbox.alert({closeButton:!1,message:e})}return{showInfoMessage:function(e){n(t(e,"info"))},showSuccessMessage:function(e){n(t(e,"success"))},showWarningMessage:function(e){n(t(e,"warning"))},showErrorMessage:function(e){n(t(e,"danger"))},showMessage:function(e){n(e)},updatePopupHints:function(e){e.find(".js-more-hint").each(function(){var e=$(this),t=e.closest("td[data-column-name]").find(".js-more-box").html();e.off("click").on("click",function(){return $(this).popover("hide"),n(t),!1});var i=e.data("bs.popover");i?i.options.content=t:e.popover({title:"",placement:function(){return e.offset().top-$(window).scrollTop()<$(window).height()/2?"bottom":"top"},html:!0,trigger:"hover",content:t})})},buildDismissableMessage:function(t,n,i){if(!n)return null;var r=$('<div class="alert alert-'+t+' alert-dismissable"><button type="button" class="close" data-dismiss="alert" aria-label="Close">&times;</button>'+n+"</div>");return e(r,i),r},createLoadingModalDialog:function(e){var t=void 0!==e?"&nbsp&nbsp<span>"+e+"</span>":"",n='<div class="modal-dialog modal-sm"><div class="modal-content"><div class="modal-body" style="text-align: center"><img src="components/assets/img/loading.gif" />'+t+"</div></div>";return $("<div/>",{class:"modal fade",tabIndex:"-1","data-backdrop":"static"}).append(n).appendTo($("body"))},replaceRow:function(e,t){var n=e.find(".details").first(),i=t.find(".details").first();n.length>0&&i.length>0&&i.replaceWith(n),e.replaceWith(t)}}}),define("pgui.field-embedded-video",["underscore","pgui.localizer","bootbox","jquery.query"],function(e,t){function n(){return!0}function i(e){e=e.split("?");var t=(e[1]||"").split("&");return t.push("autoplay=1"),e[0]+"?"+t.join("&")}function r(e,t){var n=$(e.html);return n.removeClass().addClass("pgui-field-embedded-video-iframe").removeAttr("width").removeAttr("height"),t&&n.attr("src",i(n.attr("src"))),n}function o(e){if(e.data("api")){var i=e.data("api");bootbox.dialog({message:r(i,e.data("autoplay")),title:i.title||null,closeButton:!0,backdrop:!0,onEscape:n,buttons:{cancel:{label:t.getString("Close"),callback:n}}})}else e.append(l),a(e,function(){e.find(".pgui-field-embedded-video-preloader").remove(),o(e)})}function a(e,t){var n=e.data("url");$.getJSON("https://noembed.com/embed",{url:n}).done(function(i){if(e.data("api",i),"video"!==i.type)return e.html(n),void e.find(".pgui-field-embedded-video-preloader").remove();t(i)}).fail(function(){e.html(n),e.find(".pgui-field-embedded-video-preloader").remove()})}var s=e.template('<img class="pgui-field-embedded-video-thumb pgui-field-embedded-video-fade" src="<%=thumbnail_url %>" /><span class="pgui-field-embedded-video-icon pgui-field-embedded-video-fade icon-play"></span>'),l='<img class="pgui-field-embedded-video-preloader" src="components/assets/img/loading.gif">';return function(e,t,n){t=t||!0,e.find(".pgui-field-embedded-video").each(function(e,i){var l=$(i);if(l.data("url")){l.data("autoplay",t);var c=l.closest(".pgui-embedded-video-wrapper");n||c.data("without-modal")?a(l,function(e){l.html(r(e)),l.find(".pgui-field-embedded-video-preloader").remove()}):(l.on("click",function(){return o(l),!1}),l.find(".pgui-field-embedded-video-thumb").length||a(l,function(e){(void 0===l.data("thumb")||l.data("thumb"))&&l.prepend($(s(e))),setTimeout(function(){l.find(".pgui-field-embedded-video-fade").removeClass("pgui-field-embedded-video-fade"),l.find(".pgui-field-embedded-video-preloader").addClass("pgui-field-embedded-video-fade")},10)}))}})}}),function(e,t){"function"==typeof define&&define.amd?define("libs/store",[],t):"object"==typeof exports?module.exports=t():e.store=t()}(this,function(){var e,t={},n="undefined"!=typeof window?window:global,i=n.document,r="localStorage";if(t.disabled=!1,t.version="1.3.20",t.set=function(e,t){},t.get=function(e,t){},t.has=function(e){return void 0!==t.get(e)},t.remove=function(e){},t.clear=function(){},t.transact=function(e,n,i){null==i&&(i=n,n=null),null==n&&(n={});var r=t.get(e,n);i(r),t.set(e,r)},t.getAll=function(){},t.forEach=function(){},t.serialize=function(e){return JSON.stringify(e)},t.deserialize=function(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e||void 0}},function(){try{return r in n&&n[r]}catch(e){return!1}}())e=n[r],t.set=function(n,i){return void 0===i?t.remove(n):(e.setItem(n,t.serialize(i)),i)},t.get=function(n,i){var r=t.deserialize(e.getItem(n));return void 0===r?i:r},t.remove=function(t){e.removeItem(t)},t.clear=function(){e.clear()},t.getAll=function(){var e={};return t.forEach(function(t,n){e[t]=n}),e},t.forEach=function(n){for(var i=0;i<e.length;i++){var r=e.key(i);n(r,t.get(r))}};else if(i&&i.documentElement.addBehavior){var o,a;try{a=new ActiveXObject("htmlfile"),a.open(),a.write('<script>document.w=window<\/script><iframe src="/favicon.ico"></iframe>'),a.close(),o=a.w.frames[0].document,e=o.createElement("div")}catch(t){e=i.createElement("div"),o=i.body}var s=function(n){return function(){var i=Array.prototype.slice.call(arguments,0);i.unshift(e),o.appendChild(e),e.addBehavior("#default#userData"),e.load(r);var a=n.apply(t,i);return o.removeChild(e),a}},l=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g"),c=function(e){return e.replace(/^d/,"___$&").replace(l,"___")};t.set=s(function(e,n,i){return n=c(n),void 0===i?t.remove(n):(e.setAttribute(n,t.serialize(i)),e.save(r),i)}),t.get=s(function(e,n,i){n=c(n);var r=t.deserialize(e.getAttribute(n));return void 0===r?i:r}),t.remove=s(function(e,t){t=c(t),e.removeAttribute(t),e.save(r)}),t.clear=s(function(e){var t=e.XMLDocument.documentElement.attributes;e.load(r);for(var n=t.length-1;n>=0;n--)e.removeAttribute(t[n].name);e.save(r)}),t.getAll=function(e){var n={};return t.forEach(function(e,t){n[e]=t}),n},t.forEach=s(function(e,n){for(var i,r=e.XMLDocument.documentElement.attributes,o=0;i=r[o];++o)n(i.name,t.deserialize(e.getAttribute(i.name)))})}try{var u="__storejs__";t.set(u,u),t.get(u)!=u&&(t.disabled=!0),t.remove(u)}catch(e){t.disabled=!0}return t.enabled=!t.disabled,t}),define("pgui.selection",["class","libs/store","microevent"],function(e,t,n){function i(e,t){return _.filter(e,function(e){return e.join("_")!==t.join("_")})}return n.mixin(e.extend({init:function(e){this.prefix=e+"_selection"},getData:function(){return t.get(this.prefix)||[]},add:function(e){var n=i(this.getData(),e);return n.push(e),t.set(this.prefix,n),this.trigger("change",n),this},remove:function(e){var n=this.getData(),r=i(n,e);return t.set(this.prefix,r),this.trigger("change",r),this},toggle:function(e,t){return t?this.add(e):this.remove(e),this},clear:function(){t.remove(this.prefix),this.trigger("change",[])}}))}),function(e){"function"==typeof define&&define.amd?define("jquery.validate",["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){e.extend(e.fn,{validate:function(t){if(!this.length)return void(t&&t.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var n=e.data(this[0],"validator");return n||(this.attr("novalidate","novalidate"),n=new e.validator(t,this[0]),e.data(this[0],"validator",n),n.settings.onsubmit&&(this.on("click.validate",":submit",function(t){n.submitButton=t.currentTarget,e(this).hasClass("cancel")&&(n.cancelSubmit=!0),void 0!==e(this).attr("formnovalidate")&&(n.cancelSubmit=!0)}),this.on("submit.validate",function(t){function i(){var i,r;return n.submitButton&&(n.settings.submitHandler||n.formSubmitted)&&(i=e("<input type='hidden'/>").attr("name",n.submitButton.name).val(e(n.submitButton).val()).appendTo(n.currentForm)),!(n.settings.submitHandler&&!n.settings.debug)||(r=n.settings.submitHandler.call(n,n.currentForm,t),i&&i.remove(),void 0!==r&&r)}return n.settings.debug&&t.preventDefault(),n.cancelSubmit?(n.cancelSubmit=!1,i()):n.form()?n.pendingRequest?(n.formSubmitted=!0,!1):i():(n.focusInvalid(),!1)})),n)},valid:function(){var t,n,i;return e(this[0]).is("form")?t=this.validate().form():(i=[],t=!0,n=e(this[0].form).validate(),this.each(function(){(t=n.element(this)&&t)||(i=i.concat(n.errorList))}),n.errorList=i),t},rules:function(t,n){var i,r,o,a,s,l,c=this[0],u=void 0!==this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=c&&(!c.form&&u&&(c.form=this.closest("form")[0],c.name=this.attr("name")),null!=c.form)){if(t)switch(i=e.data(c.form,"validator").settings,r=i.rules,o=e.validator.staticRules(c),t){case"add":e.extend(o,e.validator.normalizeRule(n)),delete o.messages,r[c.name]=o,n.messages&&(i.messages[c.name]=e.extend(i.messages[c.name],n.messages));break;case"remove":return n?(l={},e.each(n.split(/\s/),function(e,t){l[t]=o[t],delete o[t]}),l):(delete r[c.name],o)}return a=e.validator.normalizeRules(e.extend({},e.validator.classRules(c),e.validator.attributeRules(c),e.validator.dataRules(c),e.validator.staticRules(c)),c),a.required&&(s=a.required,delete a.required,a=e.extend({required:s},a)),a.remote&&(s=a.remote,delete a.remote,a=e.extend(a,{remote:s})),a}}});var t=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};e.extend(e.expr.pseudos||e.expr[":"],{
blank:function(n){return!t(""+e(n).val())},filled:function(n){var i=e(n).val();return null!==i&&!!t(""+i)},unchecked:function(t){return!e(t).prop("checked")}}),e.validator=function(t,n){this.settings=e.extend(!0,{},e.validator.defaults,t),this.currentForm=n,this.init()},e.validator.format=function(t,n){return 1===arguments.length?function(){var n=e.makeArray(arguments);return n.unshift(t),e.validator.format.apply(this,n)}:void 0===n?t:(arguments.length>2&&n.constructor!==Array&&(n=e.makeArray(arguments).slice(1)),n.constructor!==Array&&(n=[n]),e.each(n,function(e,n){t=t.replace(new RegExp("\\{"+e+"\\}","g"),function(){return n})}),t)},e.extend(e.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:e([]),errorLabelContainer:e([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(e){this.lastActive=e,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,e,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(e)))},onfocusout:function(e){this.checkable(e)||!(e.name in this.submitted)&&this.optional(e)||this.element(e)},onkeyup:function(t,n){var i=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===n.which&&""===this.elementValue(t)||-1!==e.inArray(n.keyCode,i)||(t.name in this.submitted||t.name in this.invalid)&&this.element(t)},onclick:function(e){e.name in this.submitted?this.element(e):e.parentNode.name in this.submitted&&this.element(e.parentNode)},highlight:function(t,n,i){"radio"===t.type?this.findByName(t.name).addClass(n).removeClass(i):e(t).addClass(n).removeClass(i)},unhighlight:function(t,n,i){"radio"===t.type?this.findByName(t.name).removeClass(n).addClass(i):e(t).removeClass(n).addClass(i)}},setDefaults:function(t){e.extend(e.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:e.validator.format("Please enter no more than {0} characters."),minlength:e.validator.format("Please enter at least {0} characters."),rangelength:e.validator.format("Please enter a value between {0} and {1} characters long."),range:e.validator.format("Please enter a value between {0} and {1}."),max:e.validator.format("Please enter a value less than or equal to {0}."),min:e.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function t(t){var n=void 0!==e(this).attr("contenteditable")&&"false"!==e(this).attr("contenteditable");if(!this.form&&n&&(this.form=e(this).closest("form")[0],this.name=e(this).attr("name")),i===this.form){var r=e.data(this.form,"validator"),o="on"+t.type.replace(/^validate/,""),a=r.settings;a[o]&&!e(this).is(a.ignore)&&a[o].call(r,this,t)}}this.labelContainer=e(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||e(this.currentForm),this.containers=e(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var n,i=this.currentForm,r=this.groups={};e.each(this.settings.groups,function(t,n){"string"==typeof n&&(n=n.split(/\s/)),e.each(n,function(e,n){r[n]=t})}),n=this.settings.rules,e.each(n,function(t,i){n[t]=e.validator.normalizeRule(i)}),e(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",t).on("click.validate","select, option, [type='radio'], [type='checkbox']",t),this.settings.invalidHandler&&e(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),e.extend(this.submitted,this.errorMap),this.invalid=e.extend({},this.errorMap),this.valid()||e(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var e=0,t=this.currentElements=this.elements();t[e];e++)this.check(t[e]);return this.valid()},element:function(t){var n,i,r=this.clean(t),o=this.validationTargetFor(r),a=this,s=!0;return void 0===o?delete this.invalid[r.name]:(this.prepareElement(o),this.currentElements=e(o),i=this.groups[o.name],i&&e.each(this.groups,function(e,t){t===i&&e!==o.name&&(r=a.validationTargetFor(a.clean(a.findByName(e))))&&r.name in a.invalid&&(a.currentElements.push(r),s=a.check(r)&&s)}),n=!1!==this.check(o),s=s&&n,this.invalid[o.name]=!n,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e(t).attr("aria-invalid",!n)),s},showErrors:function(t){if(t){var n=this;e.extend(this.errorMap,t),this.errorList=e.map(this.errorMap,function(e,t){return{message:e,element:n.findByName(t)[0]}}),this.successList=e.grep(this.successList,function(e){return!(e.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){e.fn.resetForm&&e(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var t=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(t)},resetElements:function(e){var t;if(this.settings.unhighlight)for(t=0;e[t];t++)this.settings.unhighlight.call(this,e[t],this.settings.errorClass,""),this.findByName(e[t].name).removeClass(this.settings.validClass);else e.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(e){var t,n=0;for(t in e)void 0!==e[t]&&null!==e[t]&&!1!==e[t]&&n++;return n},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(e){e.not(this.containers).text(""),this.addWrapper(e).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{e(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin")}catch(e){}},findLastActive:function(){var t=this.lastActive;return t&&1===e.grep(this.errorList,function(e){return e.element.name===t.name}).length&&t},elements:function(){var t=this,n={};return e(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var i=this.name||e(this).attr("name"),r=void 0!==e(this).attr("contenteditable")&&"false"!==e(this).attr("contenteditable");return!i&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),r&&(this.form=e(this).closest("form")[0],this.name=i),this.form===t.currentForm&&(!(i in n||!t.objectLength(e(this).rules()))&&(n[i]=!0,!0))})},clean:function(t){return e(t)[0]},errors:function(){var t=this.settings.errorClass.split(" ").join(".");return e(this.settings.errorElement+"."+t,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=e([]),this.toHide=e([])},reset:function(){this.resetInternals(),this.currentElements=e([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(e){this.reset(),this.toHide=this.errorsFor(e)},elementValue:function(t){var n,i,r=e(t),o=t.type,a=void 0!==r.attr("contenteditable")&&"false"!==r.attr("contenteditable");return"radio"===o||"checkbox"===o?this.findByName(t.name).filter(":checked").val():"number"===o&&void 0!==t.validity?t.validity.badInput?"NaN":r.val():(n=a?r.text():r.val(),"file"===o?"C:\\fakepath\\"===n.substr(0,12)?n.substr(12):(i=n.lastIndexOf("/"))>=0?n.substr(i+1):(i=n.lastIndexOf("\\"),i>=0?n.substr(i+1):n):"string"==typeof n?n.replace(/\r/g,""):n)},check:function(t){t=this.validationTargetFor(this.clean(t));var n,i,r,o,a=e(t).rules(),s=e.map(a,function(e,t){return t}).length,l=!1,c=this.elementValue(t);"function"==typeof a.normalizer?o=a.normalizer:"function"==typeof this.settings.normalizer&&(o=this.settings.normalizer),o&&(c=o.call(t,c),delete a.normalizer);for(i in a){r={method:i,parameters:a[i]};try{if("dependency-mismatch"===(n=e.validator.methods[i].call(this,c,t,r.parameters))&&1===s){l=!0;continue}if(l=!1,"pending"===n)return void(this.toHide=this.toHide.not(this.errorsFor(t)));if(!n)return this.formatAndAdd(t,r),!1}catch(e){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+t.id+", check the '"+r.method+"' method.",e),e instanceof TypeError&&(e.message+=".  Exception occurred when checking element "+t.id+", check the '"+r.method+"' method."),e}}if(!l)return this.objectLength(a)&&this.successList.push(t),!0},customDataMessage:function(t,n){return e(t).data("msg"+n.charAt(0).toUpperCase()+n.substring(1).toLowerCase())||e(t).data("msg")},customMessage:function(e,t){var n=this.settings.messages[e];return n&&(n.constructor===String?n:n[t])},findDefined:function(){for(var e=0;e<arguments.length;e++)if(void 0!==arguments[e])return arguments[e]},defaultMessage:function(t,n){"string"==typeof n&&(n={method:n});var i=this.findDefined(this.customMessage(t.name,n.method),this.customDataMessage(t,n.method),!this.settings.ignoreTitle&&t.title||void 0,e.validator.messages[n.method],"<strong>Warning: No message defined for "+t.name+"</strong>"),r=/\$?\{(\d+)\}/g;return"function"==typeof i?i=i.call(this,n.parameters,t):r.test(i)&&(i=e.validator.format(i.replace(r,"{$1}"),n.parameters)),i},formatAndAdd:function(e,t){var n=this.defaultMessage(e,t);this.errorList.push({message:n,element:e,method:t.method}),this.errorMap[e.name]=n,this.submitted[e.name]=n},addWrapper:function(e){return this.settings.wrapper&&(e=e.add(e.parent(this.settings.wrapper))),e},defaultShowErrors:function(){var e,t,n;for(e=0;this.errorList[e];e++)n=this.errorList[e],this.settings.highlight&&this.settings.highlight.call(this,n.element,this.settings.errorClass,this.settings.validClass),this.showLabel(n.element,n.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(e=0;this.successList[e];e++)this.showLabel(this.successList[e]);if(this.settings.unhighlight)for(e=0,t=this.validElements();t[e];e++)this.settings.unhighlight.call(this,t[e],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return e(this.errorList).map(function(){return this.element})},showLabel:function(t,n){var i,r,o,a,s=this.errorsFor(t),l=this.idOrName(t),c=e(t).attr("aria-describedby");s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(n)):(s=e("<"+this.settings.errorElement+">").attr("id",l+"-error").addClass(this.settings.errorClass).html(n||""),i=s,this.settings.wrapper&&(i=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(i):this.settings.errorPlacement?this.settings.errorPlacement.call(this,i,e(t)):i.insertAfter(t),s.is("label")?s.attr("for",l):0===s.parents("label[for='"+this.escapeCssMeta(l)+"']").length&&(o=s.attr("id"),c?c.match(new RegExp("\\b"+this.escapeCssMeta(o)+"\\b"))||(c+=" "+o):c=o,e(t).attr("aria-describedby",c),(r=this.groups[t.name])&&(a=this,e.each(a.groups,function(t,n){n===r&&e("[name='"+a.escapeCssMeta(t)+"']",a.currentForm).attr("aria-describedby",s.attr("id"))})))),!n&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,t)),this.toShow=this.toShow.add(s)},errorsFor:function(t){var n=this.escapeCssMeta(this.idOrName(t)),i=e(t).attr("aria-describedby"),r="label[for='"+n+"'], label[for='"+n+"'] *";return i&&(r=r+", #"+this.escapeCssMeta(i).replace(/\s+/g,", #")),this.errors().filter(r)},escapeCssMeta:function(e){return void 0===e?"":e.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(e){return this.groups[e.name]||(this.checkable(e)?e.name:e.id||e.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name)),e(t).not(this.settings.ignore)[0]},checkable:function(e){return/radio|checkbox/i.test(e.type)},findByName:function(t){return e(this.currentForm).find("[name='"+this.escapeCssMeta(t)+"']")},getLength:function(t,n){switch(n.nodeName.toLowerCase()){case"select":return e("option:selected",n).length;case"input":if(this.checkable(n))return this.findByName(n.name).filter(":checked").length}return t.length},depend:function(e,t){return!this.dependTypes[typeof e]||this.dependTypes[typeof e](e,t)},dependTypes:{boolean:function(e){return e},string:function(t,n){return!!e(t,n.form).length},function:function(e,t){return e(t)}},optional:function(t){var n=this.elementValue(t);return!e.validator.methods.required.call(this,n,t)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,e(t).addClass(this.settings.pendingClass),this.pending[t.name]=!0)},stopRequest:function(t,n){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[t.name],e(t).removeClass(this.settings.pendingClass),n&&0===this.pendingRequest&&this.formSubmitted&&this.form()&&0===this.pendingRequest?(e(this.currentForm).trigger("submit"),this.submitButton&&e("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!n&&0===this.pendingRequest&&this.formSubmitted&&(e(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t,n){return n="string"==typeof n&&n||"remote",e.data(t,"previousValue")||e.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,{method:n})})},destroy:function(){this.resetForm(),e(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,n){t.constructor===String?this.classRuleSettings[t]=n:e.extend(this.classRuleSettings,t)},classRules:function(t){var n={},i=e(t).attr("class");return i&&e.each(i.split(" "),function(){this in e.validator.classRuleSettings&&e.extend(n,e.validator.classRuleSettings[this])}),n},normalizeAttributeRule:function(e,t,n,i){/min|max|step/.test(n)&&(null===t||/number|range|text/.test(t))&&(i=Number(i),isNaN(i)&&(i=void 0)),i||0===i?e[n]=i:t===n&&"range"!==t&&(e["date"===t?"dateISO":n]=!0)},attributeRules:function(t){var n,i,r={},o=e(t),a=t.getAttribute("type");for(n in e.validator.methods)"required"===n?(i=t.getAttribute(n),""===i&&(i=!0),i=!!i):i=o.attr(n),this.normalizeAttributeRule(r,a,n,i);return r.maxlength&&/-1|2147483647|524288/.test(r.maxlength)&&delete r.maxlength,r},dataRules:function(t){var n,i,r={},o=e(t),a=t.getAttribute("type");for(n in e.validator.methods)i=o.data("rule"+n.charAt(0).toUpperCase()+n.substring(1).toLowerCase()),""===i&&(i=!0),this.normalizeAttributeRule(r,a,n,i);return r},staticRules:function(t){var n={},i=e.data(t.form,"validator");return i.settings.rules&&(n=e.validator.normalizeRule(i.settings.rules[t.name])||{}),n},normalizeRules:function(t,n){return e.each(t,function(i,r){if(!1===r)return void delete t[i];if(r.param||r.depends){var o=!0;switch(typeof r.depends){case"string":o=!!e(r.depends,n.form).length;break;case"function":o=r.depends.call(n,n)}o?t[i]=void 0===r.param||r.param:(e.data(n.form,"validator").resetElements(e(n)),delete t[i])}}),e.each(t,function(e,i){t[e]="function"==typeof i&&"normalizer"!==e?i(n):i}),e.each(["minlength","maxlength"],function(){t[this]&&(t[this]=Number(t[this]))}),e.each(["rangelength","range"],function(){var e;t[this]&&(Array.isArray(t[this])?t[this]=[Number(t[this][0]),Number(t[this][1])]:"string"==typeof t[this]&&(e=t[this].replace(/[\[\]]/g,"").split(/[\s,]+/),t[this]=[Number(e[0]),Number(e[1])]))}),e.validator.autoCreateRanges&&(null!=t.min&&null!=t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),null!=t.minlength&&null!=t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t},normalizeRule:function(t){if("string"==typeof t){var n={};e.each(t.split(/\s/),function(){n[this]=!0}),t=n}return t},addMethod:function(t,n,i){e.validator.methods[t]=n,e.validator.messages[t]=void 0!==i?i:e.validator.messages[t],n.length<3&&e.validator.addClassRules(t,e.validator.normalizeRule(t))},methods:{required:function(t,n,i){if(!this.depend(i,n))return"dependency-mismatch";if("select"===n.nodeName.toLowerCase()){var r=e(n).val();return r&&r.length>0}return this.checkable(n)?this.getLength(t,n)>0:void 0!==t&&null!==t&&t.length>0},email:function(e,t){return this.optional(t)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e)},url:function(e,t){return this.optional(t)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(e)},date:function(){var e=!1;return function(t,n){return e||(e=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(n)||!/Invalid|NaN/.test(new Date(t).toString())}}(),dateISO:function(e,t){return this.optional(t)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(e)},number:function(e,t){return this.optional(t)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(e)},digits:function(e,t){return this.optional(t)||/^\d+$/.test(e)},creditcard:function(e,t){if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(e))return!1;var n=0,i=0,r=!1;e=e.replace(/\D/g,"");for(var o=e.length-1;o>=0;o--){var a=e.charAt(o);i=parseInt(a,10),r&&(i*=2)>9&&(i-=9),n+=i,r=!r}return n%10==0},minlength:function(e,t,n){var i=Array.isArray(e)?e.length:this.getLength(e,t);return this.optional(t)||i>=n},maxlength:function(e,t,n){var i=Array.isArray(e)?e.length:this.getLength(e,t);return this.optional(t)||i<=n},rangelength:function(e,t,n){var i=Array.isArray(e)?e.length:this.getLength(e,t);return this.optional(t)||i>=n[0]&&i<=n[1]},min:function(e,t,n){return this.optional(t)||e>=n},max:function(e,t,n){return this.optional(t)||e<=n},range:function(e,t,n){return this.optional(t)||e>=n[0]&&e<=n[1]},equalTo:function(t,n,i){var r=e(i);return this.settings.onfocusout&&r.not(".validate-equalTo-blur").length&&r.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){e(n).valid()}),t===r.val()},remote:function(t,n,i,r){if(this.optional(n))return"dependency-mismatch";r="string"==typeof r&&r||"remote";var o,a,s,l=this.previousValue(n,r);return this.settings.messages[n.name]||(this.settings.messages[n.name]={}),l.originalMessage=l.originalMessage||this.settings.messages[n.name][r],this.settings.messages[n.name][r]=l.message,i="string"==typeof i&&{url:i}||i,s=e.param(e.extend({data:t},i.data)),l.old===s?l.valid:(l.old=s,o=this,this.startRequest(n),a={},a[n.name]=t,e.ajax(e.extend(!0,{mode:"abort",port:"validate"+n.name,dataType:"json",data:a,context:o.currentForm,success:function(e){var i,a,s,c=!0===e||"true"===e;o.settings.messages[n.name][r]=l.originalMessage,c?(s=o.formSubmitted,o.resetInternals(),o.toHide=o.errorsFor(n),o.formSubmitted=s,o.successList.push(n),o.invalid[n.name]=!1,o.showErrors()):(i={},a=e||o.defaultMessage(n,{method:r,parameters:t}),i[n.name]=l.message=a,o.invalid[n.name]=!0,o.showErrors(i)),l.valid=c,o.stopRequest(n,c)}},i)),"pending")}}});var n,i={};return e.ajaxPrefilter?e.ajaxPrefilter(function(e,t,n){var r=e.port;"abort"===e.mode&&(i[r]&&i[r].abort(),i[r]=n)}):(n=e.ajax,e.ajax=function(t){var r=("mode"in t?t:e.ajaxSettings).mode,o=("port"in t?t:e.ajaxSettings).port;return"abort"===r?(i[o]&&i[o].abort(),i[o]=n.apply(this,arguments),i[o]):n.apply(this,arguments)}),e}),define("pgui.validation",["underscore","jquery.validate"],function(e){function t(e){var t=$(e).closest("form").find(".form-tabs-container");if(t.length>0){t.find("a span.required").remove();var n=$(e).closest(".tab-content");n.length>0&&n.find(".tab-pane:has(.form-group.has-error)").each(function(){var e=$(this).attr("id");t.find('a[href^="#'+e+'"]').append(' <span class="required">***</span>')})}}function n(e){var t=e;this.GetMessage=function(){return t},this.SetMessage=function(e){t=e}}var i={init:function(e){var n={validate_errorClass:"help-block",validate_errorPlacement:function(e,t){var n=t.closest(".col-input,.form-group");0===n.length&&(n=t.parent()),e.appendTo(n)},validate_success:function(e){$(e).closest(".form-group").removeClass("has-error").prev(".form-group-label").removeClass("has-error"),t(e),$(e).remove()},highlight:function(e){$(e).closest(".form-group").addClass("has-error").prev(".form-group-label").addClass("has-error"),t(e)},unhighlight:void 0};e&&$.extend(n,e),this&&this.length>0&&($.validator.addMethod("regexp",function(e,t,n){var i=new RegExp(n);return e.match(i)},"Default regexp message"),$.validator.addMethod("required_custom",function(e,t,n){return"file"===$(t).attr("type")&&$(t).data("has-file")||e},"Default required message"),this.each(function(e,t){var i={},r={};$(t).find('input,select,textarea,div[data-editor="radio"]').each(function(e,t){function n(e,n){n=n||e;var i=$(t).data();i[n+"ErrorMessage"]&&(s[e]=i[n+"ErrorMessage"])}if(void 0!=$(t).attr("data-validation")){for(var o=$(t).attr("data-validation").split(" "),a={},s={},l=0;l<o.length;l++)"email"==o[l]?(a.email=!0,n(o[l])):"url"==o[l]?(a.url=!0,n(o[l])):"required"==o[l]?(a.required_custom=!0,n("required_custom","required")):"range"==o[l]?(a.range=[$(t).attr("range-min-value"),$(t).attr("range-max-value")],n(o[l])):"max-value"==o[l]?(a.max=Number($(t).attr("max-value")),n("max","maxValue")):"min-value"==o[l]?(a.min=Number($(t).attr("min-value")),n("min","minValue")):"max-length"==o[l]?(a.maxlength=$(t).attr("max-length"),n("maxlength","maxLength")):"min-length"==o[l]?(a.minlength=$(t).attr("min-length"),n("minlength","minLength")):"rangelength"==o[l]?(a.rangelength=[$(t).attr("range-min-length"),$(t).attr("range-max-length")],n(o[l])):"number"==o[l]?(a.number=!0,n(o[l])):"digits"==o[l]?(a.digits=!0,n(o[l])):"creditcard"==o[l]?(a.creditcard=!0,n(o[l])):"regexp"==o[l]&&(a.regexp=$(t).attr("regexp"),n(o[l]));var c="radio"===$(t).data("editor")?$(t).data("editor-name"):$(t).attr("name");r[c]=s,i[c]=a}}),$(t).validate({errorClass:n.validate_errorClass,errorPlacement:n.validate_errorPlacement,errorElement:"span",ignore:"",success:n.validate_success,rules:i,messages:r,highlight:n.highlight,unhighlight:n.unhighlight})}))}};return $.fn.pgui_validate_form=function(e){return i[e]?i[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void $.error("Method "+e+" does not exist on jQuery.pgui_effects"):i.init.apply(this,arguments)},{validateForm:function(t){if(!t.valid())return{success:!1,message:null};var i={},r=new n;t.find("*[data-pgui-legacy-validate]").each(function(e,t){var n=$(t);n.data("editor")&&n.data("editor").getValue&&(i[n.data("legacy-field-name")]=n.data("editor").getValue())});var o=window[t.attr("id")+"Validation"];return{success:!e.isFunction(o)||o(i,r),message:r.GetMessage()}}}}),define("pgui.modal_operation_link",["pgui.shortcuts","pgui.utils"],function(e,t){function n(n,i,r){var o=i.data("content-link"),a=t.createLoadingModalDialog().modal();$.get(o,{is_modal:!0},function(t){a.html(t);var i=new n(a,a.find(".js-form-collection"),o,{done:function(e,t,n){return r(a,e,t,n)}});e.push("form"),a.one("hidden.bs.modal",function(){i.destroy(),a.remove(),e.pop()})})}function i(e,t,i,r){t.click(function(i){i.preventDefault(),n(e,t,r)})}function r(e,t,n,i,r,o,a){if("function"==typeof a&&a(t,n,i),$.each(n,function(e,t){t.success&&o&&o.showMessage(t.message,t.messageDisplayTime)}),t)return!0;if(e.modal("hide"),1===n.length&&1===r.length)switch(i.action){case"edit":r[0].find("[data-column-name=edit]").find("a").get(0).click();break;case"details":location.href=n[0].details[i.index]}return"insert"===i.action&&o&&o.container.find(".pgui-add:first").get(0).click(),void 0===i.action&&o&&o.getReloadPageAfterAjaxOperation()&&location.reload(),!1}return{processQuery:function(e,t,i){return n(e,t,i)},createInsertLink:function(e,t,n,o){return i(e,t,n,function(e,t,i,a){return $rows=$.map(i.filter(function(e){return e.success}),function(e){return!n||n.insertRowAtBegin($(e.row))}),r(e,t,i,a,$rows,n,o)})},createEditLink:function(e,n,o,a){return i(e,n,o,function(e,i,s,l){var c=$();return i||(c=$(s[0].row),t.replaceRow(n.closest(".pg-row"),c),o&&(o.integrateRows(c),o.updateEmptyGridMessage())),r(e,i,s,l,[c],o,a)})}}}),function(e){"use strict";"function"==typeof define&&define.amd?define("jquery.form",["jquery"],e):e("undefined"!=typeof jQuery?jQuery:window.Zepto)}(function(e){function t(t){var n=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(n))}function n(t){var n=t.target,i=e(n);if(!i.is("[type=submit],[type=image]")){var r=i.closest("[type=submit]");if(0===r.length)return;n=r[0]}var o=this;if(o.clk=n,"image"==n.type)if(void 0!==t.offsetX)o.clk_x=t.offsetX,o.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var a=i.offset();o.clk_x=t.pageX-a.left,o.clk_y=t.pageY-a.top}else o.clk_x=t.pageX-n.offsetLeft,o.clk_y=t.pageY-n.offsetTop;setTimeout(function(){o.clk=o.clk_x=o.clk_y=null},100)}function i(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var r={};r.fileapi=void 0!==e("<input type='file'/>").get(0).files,r.formdata=void 0!==window.FormData;var o=!!e.fn.prop;e.fn.attr2=function(){if(!o)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function n(n){var i,r,o=e.param(n,t.traditional).split("&"),a=o.length,s=[];for(i=0;i<a;i++)o[i]=o[i].replace(/\+/g," "),r=o[i].split("="),s.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return s}function a(n){function r(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(e){i("cannot get iframe.contentWindow document: "+e)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(n){i("cannot get iframe.contentDocument: "+n),t=e.document}return t}function a(){function t(){try{var e=r(v).readyState;i("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(e){i("Server abort: ",e," (",e.name,")"),l(E),C&&clearTimeout(C),C=void 0}}var n=u.attr2("target"),o=u.attr2("action"),a=u.attr("enctype")||u.attr("encoding")||"multipart/form-data";k.setAttribute("target",m),s&&!/post/i.test(s)||k.setAttribute("method","POST"),o!=h.url&&k.setAttribute("action",h.url),h.skipEncodingOverride||s&&!/post/i.test(s)||u.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),h.timeout&&(C=setTimeout(function(){x=!0,l(S)},h.timeout));var c=[];try{if(h.extraData)for(var d in h.extraData)h.extraData.hasOwnProperty(d)&&(e.isPlainObject(h.extraData[d])&&h.extraData[d].hasOwnProperty("name")&&h.extraData[d].hasOwnProperty("value")?c.push(e('<input type="hidden" name="'+h.extraData[d].name+'">').val(h.extraData[d].value).appendTo(k)[0]):c.push(e('<input type="hidden" name="'+d+'">').val(h.extraData[d]).appendTo(k)[0]));h.iframeTarget||g.appendTo("body"),v.attachEvent?v.attachEvent("onload",l):v.addEventListener("load",l,!1),setTimeout(t,15);try{k.submit()}catch(e){var f=document.createElement("form").submit;f.apply(k)}}finally{k.setAttribute("action",o),k.setAttribute("enctype",a),n?k.setAttribute("target",n):u.removeAttr("target"),e(c).remove()}}function l(t){if(!b.aborted&&!j){if(A=r(v),A||(i("cannot access response document"),t=E),t===S&&b)return b.abort("timeout"),void _.reject(b,"timeout");if(t==E&&b)return b.abort("server abort"),void _.reject(b,"error","server abort");if(A&&A.location.href!=h.iframeSrc||x){v.detachEvent?v.detachEvent("onload",l):v.removeEventListener("load",l,!1);var n,o="success";try{if(x)throw"timeout";var a="xml"==h.dataType||A.XMLDocument||e.isXMLDoc(A);if(i("isXml="+a),!a&&window.opera&&(null===A.body||!A.body.innerHTML)&&--P)return i("requeing onLoad callback, DOM not available"),void setTimeout(l,250);var s=A.body?A.body:A.documentElement;b.responseText=s?s.innerHTML:null,b.responseXML=A.XMLDocument?A.XMLDocument:A,a&&(h.dataType="xml"),b.getResponseHeader=function(e){return{"content-type":h.dataType}[e.toLowerCase()]},s&&(b.status=Number(s.getAttribute("status"))||b.status,b.statusText=s.getAttribute("statusText")||b.statusText);var c=(h.dataType||"").toLowerCase(),u=/(json|script|text)/.test(c);if(u||h.textarea){var d=A.getElementsByTagName("textarea")[0];if(d)b.responseText=d.value,b.status=Number(d.getAttribute("status"))||b.status,b.statusText=d.getAttribute("statusText")||b.statusText;else if(u){var p=A.getElementsByTagName("pre")[0],m=A.getElementsByTagName("body")[0];p?b.responseText=p.textContent?p.textContent:p.innerText:m&&(b.responseText=m.textContent?m.textContent:m.innerText)}}else"xml"==c&&!b.responseXML&&b.responseText&&(b.responseXML=O(b.responseText));try{$=M(b,c,h)}catch(e){o="parsererror",b.error=n=e||o}}catch(e){i("error caught: ",e),o="error",b.error=n=e||o}b.aborted&&(i("upload aborted"),o=null),b.status&&(o=b.status>=200&&b.status<300||304===b.status?"success":"error"),"success"===o?(h.success&&h.success.call(h.context,$,"success",b),_.resolve(b.responseText,"success",b),f&&e.event.trigger("ajaxSuccess",[b,h])):o&&(void 0===n&&(n=b.statusText),h.error&&h.error.call(h.context,b,o,n),_.reject(b,"error",n),f&&e.event.trigger("ajaxError",[b,h,n])),f&&e.event.trigger("ajaxComplete",[b,h]),f&&!--e.active&&e.event.trigger("ajaxStop"),h.complete&&h.complete.call(h.context,b,o),j=!0,h.timeout&&clearTimeout(C),setTimeout(function(){h.iframeTarget?g.attr("src",h.iframeSrc):g.remove(),b.responseXML=null},100)}}}var c,d,h,f,m,g,v,b,y,w,x,C,k=u[0],_=e.Deferred();if(_.abort=function(e){b.abort(e)},
n)for(d=0;d<p.length;d++)c=e(p[d]),o?c.prop("disabled",!1):c.removeAttr("disabled");if(h=e.extend(!0,{},e.ajaxSettings,t),h.context=h.context||h,m="jqFormIO"+(new Date).getTime(),h.iframeTarget?(g=e(h.iframeTarget),w=g.attr2("name"),w?m=w:g.attr2("name",m)):(g=e('<iframe name="'+m+'" src="'+h.iframeSrc+'" />'),g.css({position:"absolute",top:"-1000px",left:"-1000px"})),v=g[0],b={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var n="timeout"===t?"timeout":"aborted";i("aborting upload... "+n),this.aborted=1;try{v.contentWindow.document.execCommand&&v.contentWindow.document.execCommand("Stop")}catch(e){}g.attr("src",h.iframeSrc),b.error=n,h.error&&h.error.call(h.context,b,n,t),f&&e.event.trigger("ajaxError",[b,h,n]),h.complete&&h.complete.call(h.context,b,n)}},f=h.global,f&&0==e.active++&&e.event.trigger("ajaxStart"),f&&e.event.trigger("ajaxSend",[b,h]),h.beforeSend&&!1===h.beforeSend.call(h.context,b,h))return h.global&&e.active--,_.reject(),_;if(b.aborted)return _.reject(),_;(y=k.clk)&&(w=y.name)&&!y.disabled&&(h.extraData=h.extraData||{},h.extraData[w]=y.value,"image"==y.type&&(h.extraData[w+".x"]=k.clk_x,h.extraData[w+".y"]=k.clk_y));var S=1,E=2,T=e("meta[name=csrf-token]").attr("content"),D=e("meta[name=csrf-param]").attr("content");D&&T&&(h.extraData=h.extraData||{},h.extraData[D]=T),h.forceSync?a():setTimeout(a,10);var $,A,j,P=50,O=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},I=e.parseJSON||function(e){return window.eval("("+e+")")},M=function(t,n,i){var r=t.getResponseHeader("content-type")||"",o="xml"===n||!n&&r.indexOf("xml")>=0,a=o?t.responseXML:t.responseText;return o&&"parsererror"===a.documentElement.nodeName&&e.error&&e.error("parsererror"),i&&i.dataFilter&&(a=i.dataFilter(a,n)),"string"==typeof a&&("json"===n||!n&&r.indexOf("json")>=0?a=I(a):("script"===n||!n&&r.indexOf("javascript")>=0)&&e.globalEval(a)),a};return _}if(!this.length)return i("ajaxSubmit: skipping submit process - no element selected"),this;var s,l,c,u=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),s=t.type||this.attr2("method"),l=t.url||this.attr2("action"),c="string"==typeof l?e.trim(l):"",c=c||window.location.href||"",c&&(c=(c.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:c,success:e.ajaxSettings.success,type:s||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var d={};if(this.trigger("form-pre-serialize",[this,t,d]),d.veto)return i("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&!1===t.beforeSerialize(this,t))return i("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var h=t.traditional;void 0===h&&(h=e.ajaxSettings.traditional);var f,p=[],m=this.formToArray(t.semantic,p);if(t.data&&(t.extraData=t.data,f=e.param(t.data,h)),t.beforeSubmit&&!1===t.beforeSubmit(m,this,t))return i("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[m,this,t,d]),d.veto)return i("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(m,h);f&&(g=g?g+"&"+f:f),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var v=[];if(t.resetForm&&v.push(function(){u.resetForm()}),t.clearForm&&v.push(function(){u.clearForm(t.includeHidden)}),!t.dataType&&t.target){var b=t.success||function(){};v.push(function(n){var i=t.replaceTarget?"replaceWith":"html";e(t.target)[i](n).each(b,arguments)})}else t.success&&v.push(t.success);if(t.success=function(e,n,i){for(var r=t.context||this,o=0,a=v.length;o<a;o++)v[o].apply(r,[e,n,i||u,u])},t.error){var y=t.error;t.error=function(e,n,i){var r=t.context||this;y.apply(r,[e,n,i,u])}}if(t.complete){var w=t.complete;t.complete=function(e,n){var i=t.context||this;w.apply(i,[e,n,u])}}var x=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),C=x.length>0,k="multipart/form-data",_=u.attr("enctype")==k||u.attr("encoding")==k,S=r.fileapi&&r.formdata;i("fileAPI :"+S);var E,T=(C||_)&&!S;!1!==t.iframe&&(t.iframe||T)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){E=a(m)}):E=a(m):E=(C||_)&&S?function(i){for(var r=new FormData,o=0;o<i.length;o++)r.append(i[o].name,i[o].value);if(t.extraData){var a=n(t.extraData);for(o=0;o<a.length;o++)a[o]&&r.append(a[o][0],a[o][1])}t.data=null;var l=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:s||"POST"});t.uploadProgress&&(l.xhr=function(){var n=e.ajaxSettings.xhr();return n.upload&&n.upload.addEventListener("progress",function(e){var n=0,i=e.loaded||e.position,r=e.total;e.lengthComputable&&(n=Math.ceil(i/r*100)),t.uploadProgress(e,i,r,n)},!1),n}),l.data=null;var c=l.beforeSend;return l.beforeSend=function(e,n){t.formData?n.data=t.formData:n.data=r,c&&c.call(this,e,n)},e.ajax(l)}(m):e.ajax(t),u.removeData("jqxhr").data("jqxhr",E);for(var D=0;D<p.length;D++)p[D]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(r){if(r=r||{},r.delegation=r.delegation&&e.isFunction(e.fn.on),!r.delegation&&0===this.length){var o={s:this.selector,c:this.context};return!e.isReady&&o.s?(i("DOM not ready, queuing ajaxForm"),e(function(){e(o.s,o.c).ajaxForm(r)}),this):(i("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return r.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,n).on("submit.form-plugin",this.selector,r,t).on("click.form-plugin",this.selector,r,n),this):this.ajaxFormUnbind().bind("submit.form-plugin",r,t).bind("click.form-plugin",r,n)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,n){var i=[];if(0===this.length)return i;var o,a=this[0],s=this.attr("id"),l=t?a.getElementsByTagName("*"):a.elements;if(l&&!/MSIE [678]/.test(navigator.userAgent)&&(l=e(l).get()),s&&(o=e(':input[form="'+s+'"]').get(),o.length&&(l=(l||[]).concat(o))),!l||!l.length)return i;var c,u,d,h,f,p,m;for(c=0,p=l.length;c<p;c++)if(f=l[c],(d=f.name)&&!f.disabled)if(t&&a.clk&&"image"==f.type)a.clk==f&&(i.push({name:d,value:e(f).val(),type:f.type}),i.push({name:d+".x",value:a.clk_x},{name:d+".y",value:a.clk_y}));else if((h=e.fieldValue(f,!0))&&h.constructor==Array)for(n&&n.push(f),u=0,m=h.length;u<m;u++)i.push({name:d,value:h[u]});else if(r.fileapi&&"file"==f.type){n&&n.push(f);var g=f.files;if(g.length)for(u=0;u<g.length;u++)i.push({name:d,value:g[u],type:f.type});else i.push({name:d,value:"",type:f.type})}else null!==h&&void 0!==h&&(n&&n.push(f),i.push({name:d,value:h,type:f.type,required:f.required}));if(!t&&a.clk){var v=e(a.clk),b=v[0];d=b.name,d&&!b.disabled&&"image"==b.type&&(i.push({name:d,value:v.val()}),i.push({name:d+".x",value:a.clk_x},{name:d+".y",value:a.clk_y}))}return i},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var n=[];return this.each(function(){var i=this.name;if(i){var r=e.fieldValue(this,t);if(r&&r.constructor==Array)for(var o=0,a=r.length;o<a;o++)n.push({name:i,value:r[o]});else null!==r&&void 0!==r&&n.push({name:this.name,value:r})}}),e.param(n)},e.fn.fieldValue=function(t){for(var n=[],i=0,r=this.length;i<r;i++){var o=this[i],a=e.fieldValue(o,t);null===a||void 0===a||a.constructor==Array&&!a.length||(a.constructor==Array?e.merge(n,a):n.push(a))}return n},e.fieldValue=function(t,n){var i=t.name,r=t.type,o=t.tagName.toLowerCase();if(void 0===n&&(n=!0),n&&(!i||t.disabled||"reset"==r||"button"==r||("checkbox"==r||"radio"==r)&&!t.checked||("submit"==r||"image"==r)&&t.form&&t.form.clk!=t||"select"==o&&-1==t.selectedIndex))return null;if("select"==o){var a=t.selectedIndex;if(a<0)return null;for(var s=[],l=t.options,c="select-one"==r,u=c?a+1:l.length,d=c?a:0;d<u;d++){var h=l[d];if(h.selected){var f=h.value;if(f||(f=h.attributes&&h.attributes.value&&!h.attributes.value.specified?h.text:h.value),c)return f;s.push(f)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var n=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var i=this.type,r=this.tagName.toLowerCase();n.test(i)||"textarea"==r?this.value="":"checkbox"==i||"radio"==i?this.checked=!1:"select"==r?this.selectedIndex=-1:"file"==i?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(!0===t&&/hidden/.test(i)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var n=this.type;if("checkbox"==n||"radio"==n)this.checked=t;else if("option"==this.tagName.toLowerCase()){var i=e(this).parent("select");t&&i[0]&&"select-one"==i[0].type&&i.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1}),define("pgui.form_collection",["class","pgui.editors","pgui.validation","pgui.modal_operation_link","pgui.autohide-message","jquery.form"],function(e,t,n,i,r){function o(e){var t=e.find(".form-error-container").html(""),i=$.Deferred();return e.ajaxSubmit({dataType:"JSON",beforeSubmit:function(){var r=n.validateForm(e,t,!1);return r.success||(a(t,r.message),i.reject($.extend({$form:e},r))),r.success},success:function(n){if(!n.success)return a(t,n.message),void i.reject($.extend({$form:e},n));i.resolve($.extend({$form:e},n))},error:function(n){a(t,n.responseText),i.reject({$form:e})}}),i.promise()}function a(e,t){t&&$('<div class="alert alert-danger"><button data-dismiss="alert" class="close" type="button">&times;</button>'+t+"</div>").appendTo(e)}function s(e){var t,n=e.rootElement.attr("data-editor");t=n.indexOf("cascading")>-1?e.rootElement.find(".js-nested-insert"):e.rootElement.closest(".input-group").find(".js-nested-insert").first(),t.each(function(t,n){var r=$(this);if(!r.data("insert-link")){var o=i.createInsertLink(l,r,null,function(t,n){t||e.trigger("submit.pgui.nested-insert",r,n[0].primaryKeys[0],n[0].record)});r.data("insert-link",o)}})}var l=e.extend({init:function(e,t,n,i){var r=this;this.forms=[],this.editorControllers=[],this.$formsContainer=e,this.$collectionContainer=t,this.callbacks=$.extend({init:function(){},done:function(){},copy:function(e,t){r.copy(e,$(t))}},i),$.each(e.find("form").toArray().reverse(),function(e,t){this.add($(t))}.bind(this)),this.$formsContainer.on("click",".js-save",this.submit.bind(this));var o=this;this.$formsContainer.on("click",".js-form-add",function(e){e.preventDefault(),$.get(n,function(e){o.add($(e))})}).on("click",".js-form-copy",function(e){var t=$(e.target).closest("form");$.get(n,function(e){r.callbacks.copy(t,e)}.bind(this))})},submit:function(e){e.preventDefault();var t=$(e.target).data();this.setLoading(!0);var n=$.map(this.forms,function(e){return o($(e))});$.when.apply($,$.map(n,function(e){return e.then(null,function(){return $.Deferred().resolveWith(this,arguments)})})).done(function(e){var e=Array.prototype.slice.call(arguments),n=e.reduce(function(e,t){return!t.success||e},!1);$.each(e,function(e,t){n&&t.success&&this.remove(t.$form)}.bind(this)),n&&this.$formsContainer.find(".has-error").find("input,textarea,select").first().focus(),this.callbacks.done(n,e,t)&&this.setLoading(!1)}.bind(this))},add:function(e,n){var i=this;0===this.$collectionContainer.has(e).length&&this.$collectionContainer.append("<hr/>").append(e),e.pgui_validate_form(),e.on("submit",function(e){e.preventDefault()}),this.forms.push(e);var o=t.init(e,function(e){i.callbacks.init(i),_.each(e.editors,function(e){s(e)}),"function"==typeof n&&n()});return this.editorControllers.push(o),this.forms.length>1&&(this.$formsContainer.find(".js-multiple-insert-hide").hide(),this.$formsContainer.find(".js-form-remove").show()),e.on("click",".js-form-remove",function(){this.remove(e)}.bind(this)),e.find("input,select,textarea").filter(function(e,t){return $(t).is(":visible")&&0===$(t).closest("#form-group-fields-to-be-updated").length}).first().focus(),e.on("change","#fields-to-be-updated",function(e){var t=$(e.target).val();_.each(o.editors,function(e,n){"undefined"!==n&&e.setEnabled(null!==t&&t.indexOf(n)>-1)})}).on("click","#clear-fields-to-be-updated",function(e){$("#fields-to-be-updated").select2("val",[]).trigger("change")}),$.each(e.find(".alert"),function(e,t){r($(t))}),e.find(".js-hint").each(function(){$(this).popover({placement:"top",trigger:"hover",container:"body",html:!0,content:$(this).attr("data-hint")})}),e},copy:function(e,t){return this.add(t,_.bind(function(){this.copyEditorsValues(e,t)},this))},copyEditorsValues:function(e,t){e.find("[data-editor]").each(function(e,n){var i=$(n),r=t.find('[data-field-name="'+i.data("field-name")+'"]').data("editor");r&&i.data("editor")&&r.setData(i.data("editor").getData())})},remove:function(e){var t=$.map(this.forms,function(e){return e.attr("id")}).indexOf(e.attr("id"));return this.forms.splice(t,1),this.editorControllers[t].destroy(),this.editorControllers.splice(t,1),e.prev("hr").remove(),e.remove(),this.$collectionContainer.find("hr:first-child").remove(),1===this.forms.length&&(this.$formsContainer.find(".js-form-remove").hide(),this.$formsContainer.find(".js-multiple-insert-hide").show()),this.forms},get:function(e){return this.forms[e]},setLoading:function(e){var t=this.$formsContainer.find(".btn-toolbar button.btn-primary,.js-save,.js-cancel,.js-recaptcha").prop("disabled",e);e?t.addClass("btn-loading"):t.removeClass("btn-loading")},focus:function(){this.forms[0].find("input,select,textarea").first().focus()},destroy:function(){_.each(this.editorControllers,function(e){e.destroy()}),this.forms=[],this.editorControllers=[]}});return l}),define("pgui.selection-handler",["class","pgui.localizer","pgui.utils","libs/sprintf","pgui.form_collection","pgui.modal_operation_link","underscore","jquery.query","bootbox","jquery.popover"],function(e,t,n,i,r,o){function a(e,t){var n=$("<form>").hide().attr("method","POST").attr("action",e);return _.each(t,function(e,t){n.append($('<input name="'+t+'" value="'+e+'">'))}),n.appendTo($("body"))}return e.extend({init:function(e,t,n,i,r,o){if(this.hideContainer=r,this.$container=t||$(".js-selection-actions-container").first(),this.$actions=t.find(".js-action"),this.$count=t.find(".js-count"),this.selection=e,this.grid=o,void 0!==n)var a=n.find("input[type=checkbox]");this.setCheckboxes(a||$(),i||$()),this.$actions.on("click",this._handleAction.bind(this)),this.selection.bind("change",this._handleChange.bind(this)),this._handleChange(this.selection.getData()),this._initSelectionFilters(n)},setCheckboxes:function(e,t){this.$allCheckbox=e||$(),this.$checkboxes=t||$(),this.checkboxesData=_.map(this.$checkboxes,function(e,t){return $(e).data("value")}),this.$checkboxes.off("change").on("change",this._checkboxChangeHandler.bind(this)),this.$allCheckbox.off("change").on("change",this._allCheckboxChangeHandler.bind(this))},_checkboxChangeHandler:function(e){var t=$(e.currentTarget);this.selection.toggle(t.data("value"),t.prop("checked"))},_allCheckboxChangeHandler:function(e){var t=$(e.currentTarget).prop("checked");this.$checkboxes.prop("checked",t),_.each(this.checkboxesData,function(e){t?this.selection.add(e):this.selection.remove(e)}.bind(this))},_handleChange:function(e){var t=e.length;this.hideContainer&&(this.$container.toggle(t>0),_.defer(this.$container.toggleClass.bind(this.$container),"in",t>0)),this.$count.text(t),this.$checkboxes.prop("checked",!1),_.each(e,function(e){this.$checkboxes.filter("[data-value='"+JSON.stringify(e)+"']").prop("checked",!0)}.bind(this));var n=this.$checkboxes.filter(":checked").length;this.$allCheckbox.prop("checked",n===this.$checkboxes.length&&this.$checkboxes.length>0).prop("indeterminate",n>0&&n<this.$checkboxes.length)},_handleAction:function(e){var t=$(e.currentTarget),n=t.data("type"),i="_blank"==t.attr("target");switch(e.preventDefault(),n){case"compare":return this._compare(t.data("url"));case"compare-remove":return this._compareRemove(t.attr("href"),t.data("value"));case"print":return this._print(t.data("url"),i);case"export":return this._export(t.data("url"),t.data("export-type"),i);case"update":return this._update(t);case"delete":return this._delete(t.data("url"));case"clear":return this.selection.clear();case"select":return this._processSelection(t)}},_delete:function(e){var i=this;bootbox.confirm(t.getString("DeleteSelectedRecordsQuestion"),function(r){if(r){n.createLoadingModalDialog(t.getString("Deleting")).modal();var o=i.selection.getData(),s={operation:"delsel",recordCount:o.length};_.each(o,function(e,t){s["rec"+t]=null,_.each(e,function(e,n){s["rec"+t+"_pk"+n]=e}),i.selection.remove(e)}),a(e,s).submit()}})},_compare:function(e){this._processSelectedRecords(e,"compare")},_compareRemove:function(e,t){this.selection.remove(t),location.href=e},_print:function(e,t){this._processSelectedRecords(e,"print_selected",t)},_export:function(e,t,n){this._processSelectedRecords(e,i.sprintf("e%s_selected",t),n)},_update:function(e){var t=this;if("multiple-edit"===e.data("modal-operation")){var n=e.data("multiple-edit-handler-name"),i=jQuery.query.load(e.data("url")).set("hname",n).set("keys",this.selection.getData()).toString();e.data("content-link",i),o.processQuery(r,e,function(n,i,r,o){var a=e.closest(".js-grid"),s=$();return i||($.each(r[0].row,function(e,n){s=$(n),a.find(".row-selection input").each(function(){if($(this).attr("data-value")===r[0].primaryKeys[e])return $(this).closest(".pg-row").replaceWith(s),t.grid.integrateRows(s),!1})}),n.modal("hide"),t.selection.clear(),t.grid.getReloadPageAfterAjaxOperation()&&location.reload()),i})}else this._processSelectedRecords(e.data("url"),"multi_edit")},_processSelection:function(e){var t=e.data("condition");location.href="all"==t?jQuery.query.load(e.data("url")).remove("keys").set("selection_filter","").toString():jQuery.query.load(e.data("url")).set("selection_filter",t).set("keys",this.selection.getData()).toString()},_initSelectionFilters:function(e){if(void 0!==e){var t=this,n=$("#selection-filters-content").html(),i=e.find("a.selection-filters");if(0!=i.length){var r=i.webuiPopover({trigger:"manual",backdrop:!0,placement:"auto-bottom",padding:!1,content:$(n)}).data("plugin_webuiPopover");i.on("click",function(e){e.preventDefault(),r.show(),$(".webui-popover-backdrop").one("click",function(){r.hide()})}),i.on("show.webui.popover",function(){r.$contentElement.find("ul.dropdown-menu").show(),r.$contentElement.find(".js-action").one("click",function(){t._selectRecords($(this)),r.hide()})})}}},_selectRecords:function(e){var t=this,n=jQuery.query.load(e.data("url")).set("hname",e.data("handler-name")).set("filterName",e.data("filter-name")).toString();$.getJSON(n,function(e){t.selection.clear();for(var n=0;n<e.length;n++)t.selection.add(e[n])})},_processSelectedRecords:function(e,t,n){var i=jQuery.query.load(e).set("operation",t).set("keys",this.selection.getData()).toString();n?window.open(i,"_blank"):location.href=i}})}),define("pgui.cell-edit",["pgui.form_collection","pgui.shortcuts","jquery.popover"],function(e,t){function n(e){var t=e.data("plugin_webuiPopover"),n=t.getElementPosition(),i=t.getTargetPositin(n,t.getPlacement(n),t.$target[0].offsetWidth,t.$target[0].offsetHeight);t.$target.css(i.position),i.arrowOffset||(i.arrowOffset={left:"50%"}),t.$target.find(".webui-arrow").css(i.arrowOffset)}function i(e){return e.data("plugin_webuiPopover")}function r(e,t,n){e.hide(!0),e.destroy(),t.webuiPopover(n)}return function(o,a){var s=o.data("edit-url");if(s){var l={cache:!1,type:"async",url:s,placement:"vertical",style:"cell-edit",backdrop:!0,trigger:"manual"},c=$('<span class="icon-edit pgui-cell-edit-button"></span>'),u=function(e){27===e.keyCode&&r(i(o),o,l)};c.on("click",function(){i(o).show()}),o.webuiPopover(l),o.on("shown.webui.popover",function(){var s=i(o),c=s.$target.find(".webui-popover-content");if(0!==c.find("form").length){new e(c,c,null,{init:function(){n(o)},done:function(e,t){return e||(r(s,o,l),"function"==typeof a&&a(t[0])),!0}});c.data("forms-ready",!0),$([$(".webui-popover-backdrop").get(0),c.find(".js-cancel").get(0)]).one("click",function(){r(s,o,l)}),$(document).on("keyup",u),s.$target.find("input,select,textarea").on("keyup",u),t.push(["quick_edit"])}}).on("hidden.webui.popover",function(){var e=i(o);e&&e.hide&&r(e,o,l),$(document).off("keyup",u),t.pop()}).on("mouseenter",function(){o.append(c)}).on("mouseleave",function(){c.detach()})}}}),define("pgui.modal_delete_link",["pgui.localizer","pgui.utils","bootbox"],function(e,t){return function(n,i){n.off("click","a[data-modal-operation=delete]").on("click","a[data-modal-operation=delete]",function(n){n.preventDefault();var r=$(this);bootbox.confirm(e.getString("DeleteRecordQuestion"),function(n){if(n){var o=t.createLoadingModalDialog(e.getString("Deleting")).modal();o.one("hidden.bs.modal",function(){o.remove()});var a=r.data("content-link");$.ajax({url:a,dataType:"json",success:function(e){if(!e.success)return void t.showErrorMessage(e.message);i.removeRow(r.closest(".pg-row")),i.showMessage(e.message,e.messageDisplayTime),i.getReloadPageAfterAjaxOperation()&&location.reload()},complete:function(){o.modal("hide")}})}})})}}),function(e){var t,n,i,r,o,a,s,l=function(){},c=!!window.jQuery,u=e(window),d=function(e,n){t.ev.on("mfp"+e+".mfp",n)},h=function(t,n,i,r){var o=document.createElement("div");return o.className="mfp-"+t,i&&(o.innerHTML=i),r?n&&n.appendChild(o):(o=e(o),n&&o.appendTo(n)),o},f=function(n,i){t.ev.triggerHandler("mfp"+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},p=function(n){return n===s&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),s=n),t.currTemplate.closeBtn},m=function(){e.magnificPopup.instance||(t=new l,t.init(),e.magnificPopup.instance=t)},g=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};l.prototype={constructor:l,init:function(){var n=navigator.appVersion;t.isIE7=-1!==n.indexOf("MSIE 7."),t.isIE8=-1!==n.indexOf("MSIE 8."),t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=g(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),i=e(document.body),r=e(document),t.popupsCache={}},open:function(n){var i;if(!1===n.isObj){t.items=n.items.toArray(),t.index=0;var o,s=n.items;for(i=0;i<s.length;i++)if(o=s[i],o.parsed&&(o=o.el[0]),o===n.el[0]){t.index=i;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;if(t.isOpen)return void t.updateItemHTML();t.types=[],a="",n.mainEl&&n.mainEl.length?t.ev=n.mainEl.eq(0):t.ev=r,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=h("bg").on("click.mfp",function(){t.close()}),t.wrap=h("wrap").attr("tabindex",-1).on("click.mfp",function(e){t._checkIfClose(e.target)&&t.close()}),t.container=h("container",t.wrap)),t.contentContainer=h("content"),t.st.preloader&&(t.preloader=h("preloader",t.container,t.st.tLoading));var l=e.magnificPopup.modules;for(i=0;i<l.length;i++){var c=l[i];c=c.charAt(0).toUpperCase()+c.slice(1),t["init"+c].call(t)}f("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(d("MarkupParse",function(e,t,n,i){n.close_replaceWith=p(i.type)}),a+=" mfp-close-btn-in"):t.wrap.append(p())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:u.scrollTop(),position:"absolute"}),(!1===t.st.fixedBgPos||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:r.height(),position:"absolute"}),t.st.enableEscapeKey&&r.on("keyup.mfp",function(e){27===e.keyCode&&t.close()}),u.on("resize.mfp",function(){t.updateSize()}),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var m=t.wH=u.height(),g={};if(t.fixedContentPos&&t._hasScrollBar(m)){var v=t._getScrollbarSize();v&&(g.marginRight=v)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):g.overflow="hidden");var b=t.st.mainClass;return t.isIE7&&(b+=" mfp-ie7"),b&&t._addClassToMFP(b),t.updateItemHTML(),f("BuildControls"),e("html").css(g),t.bgOverlay.add(t.wrap).prependTo(document.body),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP("mfp-ready"),t._setFocus()):t.bgOverlay.addClass("mfp-ready"),r.on("focusin.mfp",t._onFocusIn)},16),t.isOpen=!0,t.updateSize(m),f("Open"),n},close:function(){t.isOpen&&(f("BeforeClose"),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP("mfp-removing"),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){f("Close");var n="mfp-removing mfp-ready ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var i={marginRight:""};t.isIE7?e("body, html").css("overflow",""):i.overflow="",e("html").css(i)}r.off("keyup.mfp focusin.mfp"),t.ev.off(".mfp"),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&!0!==t.currTemplate[t.currItem.type]||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,f("AfterClose")},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||u.height();t.fixedContentPos||t.wrap.css("height",t.wH),f("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(f("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var r=!!t.st[i]&&t.st[i].markup;f("FirstMarkupParse",r),t.currTemplate[i]=!r||e(r)}o&&o!==n.type&&t.container.removeClass("mfp-"+o+"-holder");var a=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(a,i),n.preloaded=!0,f("Change",n),o=n.type,t.container.prepend(t.contentContainer),f("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&!0===t.currTemplate[n]?t.content.find(".mfp-close").length||t.content.append(p()):t.content=e:t.content="",f("BeforeAppend"),t.container.addClass("mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i=t.items[n],r=i.type;if(i=i.tagName?{el:e(i)}:{data:i,src:i.src},i.el){for(var o=t.types,a=0;a<o.length;a++)if(i.el.hasClass("mfp-"+o[a])){r=o[a];break}i.src=i.el.attr("data-mfp-src"),i.src||(i.src=i.el.attr("href"))}return i.type=r||t.st.type||"inline",i.index=n,i.parsed=!0,t.items[n]=i,f("ElementParse",i),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var r="click.magnificPopup";n.mainEl=e,n.items?(n.isObj=!0,e.off(r).on(r,i)):(n.isObj=!1,n.delegate?e.off(r).on(r,n.delegate,i):(n.items=e,e.off(r).on(r,i)))},_openClick:function(n,i,r){if((void 0!==r.midClick?r.midClick:e.magnificPopup.defaults.midClick)||2!==n.which&&!n.ctrlKey&&!n.metaKey){var o=void 0!==r.disableOn?r.disableOn:e.magnificPopup.defaults.disableOn;if(o)if(e.isFunction(o)){if(!o.call(t))return!0}else if(u.width()<o)return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),r.el=e(n.mfpEl),r.delegate&&(r.items=i.find(r.delegate)),t.open(r)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var r={status:e,text:i};f("UpdateStatus",r),e=r.status,i=r.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass("mfp-prevent-close")){var i=t.st.closeOnContentClick,r=t.st.closeOnBgClick;if(i&&r)return!0;if(!t.content||e(n).hasClass("mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(r&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?r.height():document.body.scrollHeight)>(e||u.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){if(n.target!==t.wrap[0]&&!e.contains(t.wrap[0],n.target))return t._setFocus(),!1},_parseMarkup:function(t,n,i){var r;i.data&&(n=e.extend(i.data,n)),f("MarkupParse",[t,n,i]),e.each(n,function(e,n){if(void 0===n||!1===n)return!0;if(r=e.split("_"),r.length>1){var i=t.find(".mfp-"+r[0]);if(i.length>0){var o=r[1];"replaceWith"===o?i[0]!==n[0]&&i.replaceWith(n):"img"===o?i.is("img")?i.attr("src",n):i.replaceWith('<img src="'+n+'" class="'+i.attr("class")+'" />'):i.attr(r[1],n)}}else t.find(".mfp-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:l.prototype,modules:[],open:function(t,n){return m(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&times;</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(n){m();var i=e(this);if("string"==typeof n)if("open"===n){var r,o=c?i.data("magnificPopup"):i[0].magnificPopup,a=parseInt(arguments[1],10)||0;o.items?r=o.items[a]:(r=i,o.delegate&&(r=r.find(o.delegate)),r=r.eq(a)),t._openClick({mfpEl:r},i,o)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),c?i.data("magnificPopup",n):i[0].magnificPopup=n,t.addGroup(i,n);return i};var v,b,y,w=function(){y&&(b.after(y.addClass(v)).detach(),y=null)};e.magnificPopup.registerModule("inline",{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push("inline"),d("Close.inline",function(){w()})},getInline:function(n,i){if(w(),n.src){var r=t.st.inline,o=e(n.src)
;if(o.length){var a=o[0].parentNode;a&&a.tagName&&(b||(v=r.hiddenClass,b=h(v),v="mfp-"+v),y=o.after(b).detach().removeClass(v)),t.updateStatus("ready")}else t.updateStatus("error",r.tNotFound),o=e("<div>");return n.inlineElement=o,o}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var x,C=function(){x&&i.removeClass(x)},k=function(){C(),t.req&&t.req.abort()};e.magnificPopup.registerModule("ajax",{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push("ajax"),x=t.st.ajax.cursor,d("Close.ajax",k),d("BeforeChange.ajax",k)},getAjax:function(n){x&&i.addClass(x),t.updateStatus("loading");var r=e.extend({url:n.src,success:function(i,r,o){var a={data:i,xhr:o};f("ParseAjax",a),t.appendContent(e(a.data),"ajax"),n.finished=!0,C(),t._setFocus(),setTimeout(function(){t.wrap.addClass("mfp-ready")},16),t.updateStatus("ready"),f("AjaxContentAdded")},error:function(){C(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(r),""}}});var _,S=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=t.st.image,n=".image";t.types.push("image"),d("Open"+n,function(){"image"===t.currItem.type&&e.cursor&&i.addClass(e.cursor)}),d("Close"+n,function(){e.cursor&&i.removeClass(e.cursor),u.off("resize.mfp")}),d("Resize"+n,t.resizeImage),t.isLowIE&&d("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,_&&clearInterval(_),e.isCheckingImgSize=!1,f("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],r=function(o){_&&clearInterval(_),_=setInterval(function(){if(i.naturalWidth>0)return void t._onImageHasSize(e);n>200&&clearInterval(_),n++,3===n?r(10):40===n?r(50):100===n&&r(500)},o)};r(1)},getImage:function(n,i){var r=0,o=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,f("ImageLoadComplete")):(r++,r<200?setTimeout(o,100):a()))},a=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",s.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},s=t.st.image,l=i.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",n.img=e(c).on("load.mfploader",o).on("error.mfploader",a),c.src=n.src,l.is("img")&&(n.img=n.img.clone()),n.img[0].naturalWidth>0&&(n.hasSize=!0)}return t._parseMarkup(i,{title:S(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(_&&clearInterval(_),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var E,T=function(){return void 0===E&&(E=void 0!==document.createElement("p").style.MozTransform),E};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var r,o,a=n.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,r={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},o="transition";return r["-webkit-"+o]=r["-moz-"+o]=r["-o-"+o]=r[o]=i,t.css(r),t},l=function(){t.content.css("visibility","visible")};d("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(r),t.content.css("visibility","hidden"),!(e=t._getItemToZoom()))return void l();o=s(e),o.css(t._getOffset()),t.wrap.append(o),r=setTimeout(function(){o.css(t._getOffset(!0)),r=setTimeout(function(){l(),setTimeout(function(){o.remove(),e=o=null,f("ZoomAnimationEnded")},16)},a)},16)}}),d("BeforeClose"+i,function(){if(t._allowZoom()){if(clearTimeout(r),t.st.removalDelay=a,!e){if(!(e=t._getItemToZoom()))return;o=s(e)}o.css(t._getOffset(!0)),t.wrap.append(o),t.content.css("visibility","hidden"),setTimeout(function(){o.css(t._getOffset())},16)}}),d("Close"+i,function(){t._allowZoom()&&(l(),o&&o.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return!!t.currItem.hasSize&&t.currItem.img},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var r=i.offset(),o=parseInt(i.css("padding-top"),10),a=parseInt(i.css("padding-bottom"),10);r.top-=e(window).scrollTop()-o;var s={width:i.width(),height:(c?i.innerHeight():i[0].offsetHeight)-a-o};return T()?s["-moz-transform"]=s.transform="translate("+r.left+"px,"+r.top+"px)":(s.left=r.left,s.top=r.top),s}}});var D=function(e){if(t.currTemplate.iframe){var n=t.currTemplate.iframe.find("iframe");n.length&&(e||(n[0].src="//about:blank"),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule("iframe",{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push("iframe"),d("BeforeChange",function(e,t,n){t!==n&&("iframe"===t?D():"iframe"===n&&D(!0))}),d("Close.iframe",function(){D()})},getIframe:function(n,i){var r=n.src,o=t.st.iframe;e.each(o.patterns,function(){if(r.indexOf(this.index)>-1)return this.id&&(r="string"==typeof this.id?r.substr(r.lastIndexOf(this.id)+this.id.length,r.length):this.id.call(this,r)),r=this.src.replace("%id%",r),!1});var a={};return o.srcAction&&(a[o.srcAction]=r),t._parseMarkup(i,a,n),t.updateStatus("ready"),i}}});var $=function(e){var n=t.items.length;return e>n-1?e-n:e<0?n+e:e},A=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,i=".mfp-gallery",o=Boolean(e.fn.mfpFastClick);if(t.direction=!0,!n||!n.enabled)return!1;a+=" mfp-gallery",d("Open"+i,function(){n.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){if(t.items.length>1)return t.next(),!1}),r.on("keydown"+i,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),d("UpdateStatus"+i,function(e,n){n.text&&(n.text=A(n.text,t.currItem.index,t.items.length))}),d("MarkupParse"+i,function(e,i,r,o){var a=t.items.length;r.counter=a>1?A(n.tCounter,o.index,a):""}),d("BuildControls"+i,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,r=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass("mfp-prevent-close"),a=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass("mfp-prevent-close"),s=o?"mfpFastClick":"click";r[s](function(){t.prev()}),a[s](function(){t.next()}),t.isIE7&&(h("b",r[0],!1,!0),h("a",r[0],!1,!0),h("b",a[0],!1,!0),h("a",a[0],!1,!0)),t.container.append(r.add(a))}}),d("Change"+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),d("Close"+i,function(){r.off(i),t.wrap.off("click"+i),t.arrowLeft&&o&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null})},next:function(){t.direction=!0,t.index=$(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=$(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),r=Math.min(n[1],t.items.length);for(e=1;e<=(t.direction?r:i);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?i:r);e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=$(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),f("LazyLoad",i),"image"===i.type&&(i.img=e('<img class="mfp-img" />').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,f("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});e.magnificPopup.registerModule("retina",{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(d("ImageHasSize.retina",function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),d("ElementParse.retina",function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),function(){var t="ontouchstart"in window,n=function(){u.off("touchmove"+i+" touchend"+i)},i=".mfpFastClick";e.fn.mfpFastClick=function(r){return e(this).each(function(){var o,a=e(this);if(t){var s,l,c,d,h,f;a.on("touchstart"+i,function(e){d=!1,f=1,h=e.originalEvent?e.originalEvent.touches[0]:e.touches[0],l=h.clientX,c=h.clientY,u.on("touchmove"+i,function(e){h=e.originalEvent?e.originalEvent.touches:e.touches,f=h.length,h=h[0],(Math.abs(h.clientX-l)>10||Math.abs(h.clientY-c)>10)&&(d=!0,n())}).on("touchend"+i,function(e){n(),d||f>1||(o=!0,e.preventDefault(),clearTimeout(s),s=setTimeout(function(){o=!1},1e3),r())})})}a.on("click"+i,function(){o||r()})})},e.fn.destroyMfpFastClick=function(){e(this).off("touchstart"+i+" click"+i),t&&u.off("touchmove"+i+" touchend"+i)}}(),m()}(window.jQuery||window.Zepto),define("jquery.magnific-popup",function(){}),define("pgui.image_popup",["underscore","jquery.magnific-popup"],function(e){function t(e){e.find(".linked-images-retriever").on("click",function(e){e.preventDefault();var t=$(this),n=t.parent();if(t.hasClass("retrieved"))n.find("a.gallery-item").first().click();else{var i=t.data("url");$.get(i,function(e){n.append(e),n.find("a.gallery-item").magnificPopup({type:"image",gallery:{enabled:!0,preload:[0,1]},image:{titleSrc:function(e){return e.el.attr("title")}}}),t.addClass("retrieved"),n.find("a.gallery-item").first().click()})}})}return function(n){e.chain(n.find("a.gallery-item")).reduce(function(e,t){var n=$(t).data("name");return-1===e.indexOf(n)&&e.push(n),e},[]).each(function(e){n.find('a.gallery-item[data-name="'+e+'"]').magnificPopup({type:"image",gallery:{enabled:!0,preload:[0,1]},image:{titleSrc:function(e){return e.el.attr("title")}}})}),t(n)}}),define("pgui.toggle",["pgui.utils","bootstrap.toggle"],function(e){return function(t,n){t.find(".pgui-toggle-checkbox").each(function(t,i){var r=$(i),o={on:r.data("toggle-on-caption"),off:r.data("toggle-off-caption"),size:r.data("toggle-size"),onstyle:r.data("toggle-on-style"),offstyle:r.data("toggle-off-style")};r.data("toggle-width")&&(o.width=r.data("toggle-width")),r.data("toggle-height")&&(o.height=r.data("toggle-height")),r.bootstrapToggle(o),r.data("toggle-disabled")&&r.bootstrapToggle("disable");var a=!1;r.change(function(){if(a)return void(a=!1);var t=$(this),i=t.data("pk-values")?t.data("pk-values"):{};i.column=t.closest("td").data("column-name");var o=t.data("editor-name");t.is(":checked")&&(i[o]=1),$.ajax({method:"POST",url:t.data("editing-link"),data:i,dataType:"json",success:function(i){if(!i.success)return a=!0,r.bootstrapToggle("toggle"),void e.showErrorMessage(i.message);if(void 0!==n){n.showMessage(i.message,i.messageDisplayTime);var o=$(i.row);e.replaceRow(t.closest(".pg-row"),o),n.integrateRows(o),n.getReloadPageAfterAjaxOperation()&&location.reload()}}})})})}}),define("pgui.modal_view",["pgui.field-embedded-video","pgui.cell-edit","pgui.utils","pgui.image_popup","pgui.toggle"],function(e,t,n,i,r){var o=$("body");return function a(s){if(!s.data("modal-view")){var l=$('<div class="modal fade"></div>'),c=s.data("content-link");s.click(function(s){s.preventDefault(),$.get(c,function(s){o.append(l),l.html(s).one("hidden.bs.modal",function(){this.remove()}).modal(),e(l,!1,!1),i(l),r(l),l.find("[data-edit-url]").each(function(e,i){var r=$(i),o=r.data("column-name");t(r,function(e){r.html(e.columns[o]),l.find(".js-message-container").append(n.buildDismissableMessage("success",e.message,e.messageDisplayTime))})}),l.find("[data-modal-operation=view]").each(function(e,t){a($(t))})})}),s.data("modal-view",!0)}}}),define("pgui.inline-edit",["pgui.form_collection","pgui.utils","pgui.field-embedded-video","pgui.image_popup","pgui.toggle","jquery.query"],function(e,t,n,i,r){function o(e,t){return e.getRowTemplate().on("click",".js-cancel",function(e){"function"==typeof t&&t(),$(e.delegateTarget).remove()})}function a(e){return $.query.load(e.data("content-link")).set("is_inline","true").toString()}function s(e,t){e.find(".js-inline-edit-container").first().removeClass("pg-inline-edit-container-loading").html(t)}function l(e,t){t[0].success&&e&&e.showMessage(t[0].message,t[0].messageDisplayTime)}function c(t,n,i,r,a){return s(t,i),new e(t,t,r,$.extend({done:function(e,i,r){if(l(n,i),!e){var o=$(i[0].row);t.after(o),n.integrateRows(o),t.remove(),n.updateEmptyGridMessage(),r&&"edit"==r.action&&o.find("[data-inline-operation=edit]").first().click(),void 0===r.action&&n.getReloadPageAfterAjaxOperation()&&location.reload()}return!0},copy:function(e,i){$copiedContainer=o(n),t.after($copiedContainer),c($copiedContainer,n,i,r,{init:function(t){t.copyEditorsValues(e,t.get(0))}})}},a))}return{createInsertLink:function(e,t,n){n=n||1;var i=a(e);e.on("click",function(e){e.preventDefault();for(var r=[],a=0;a<n;a++){var s=o(t);t.container.find(".pg-row-list:first").prepend(s),r.push(s)}$.get(i,function(e){$.each(r,function(n,r){c(r,t,e,i,{})})})})},createEditLink:function(n,i){var r=n.closest(".pg-row");n.data("form-container",null),n.on("click",function(c){c.preventDefault();var u=r.find("[data-inline-operation=view]");if(u.length&&u.data("form-container")&&(u.data("form-container").remove(),u.data("form-container",null)),n.data("form-container"))return n.data("form-container").remove(),void n.data("form-container",null);var d=o(i,function(){n.data("form-container",null),r.show()});n.data("form-container",d),i.isCard()&&r.hide(),r.after(d),$.get(a(n),function(o){s(d,o),new e(d,d,null,{done:function(e,o,a){if(l(i,o),!e){var s=$(o[0].row);t.replaceRow(r,s),r.show(),i.integrateRows(s),n.data("form-container",null),d.remove(),i.updateEmptyGridMessage(),a&&"edit"==a.action&&s.find("[data-column-name=edit] > a").first().click(),void 0===a.action&&i.getReloadPageAfterAjaxOperation()&&location.reload()}return!0}})})})},createViewLink:function(e,t){var l=a(e),c=e.closest(".pg-row");e.data("form-container",null),e.on("click",function(a){a.preventDefault();var u=c.find("[data-inline-operation=edit]");if(u.length&&u.data("form-container")&&(u.data("form-container").remove(),u.data("form-container",null)),e.data("form-container"))return e.data("form-container").remove(),void e.data("form-container",null);var d=o(t,function(){e.data("form-container",null),c.show()});e.data("form-container",d),t.isCard()&&c.hide(),c.after(d),$.get(l,function(e){s(d,e),n(d,!1,!1),i(d),r(d)})})}}}),define("pgui.column_group",["libs/match-media"],function(){function e(e){return window.matchMedia("(max-width: "+e+"px)").matches}return function(t){function n(){var t=(window.outerWidth,4);e(767)?t=1:e(991)?t=2:e(1200)&&(t=3),i.each(function(e,n){var i=$(n);i.attr("colspan",i.data("visibility")[t])})}var i=t.find(".js-column-group");$(window).on("resize",n),n()}}),define("pgui.charts",["moment"],function(e){function t(t){var r=new google.visualization.DataTable;return $.each(t.data.columns,function(e,t){if("data"!==t.role)return void r.addColumn({role:t.role,type:"string",p:{html:!0}});r.addColumn({type:i(t.type),label:t.label})}),$.each(t.data.rows,function(n,i){var o=[];$.each(t.data.columns,function(t,n){var r=i[t];"date"!==n.type&&"datetime"!==n.type||null===r||(r=e(r).toDate()),o.push(r)}),r.addRow(o)}),n(t.data.columns,r),r}function n(e,t){var n={number:google.visualization.NumberFormat,date:google.visualization.DateFormat,datetime:google.visualization.DateFormat};$.each(e,function(e,r){var o=n[i(r.type)];r.format&&o&&new o({pattern:r.format}).format(t,e)})}function i(e){switch(e=e||"string",e.toLowerCase()){case"string":return"string";case"date":return"date";case"datetime":return"datetime";default:return"number"}}function r(e,t,n){var i=e.css("color"),r=e.css("border-color"),o=$.extend(!0,{backgroundColor:"none",titleTextStyle:{color:i},vAxis:{gridlines:{color:r}},hAxis:{gridlines:{color:r}}},n);if("Geo"!=t&&(o=$.extend(!0,{legend:{textStyle:{color:i}}},o)),"Pie"==t)return o;var a={titleTextStyle:{color:i},textStyle:{color:i}};return $.extend(!0,{},{hAxis:a,vAxis:a},o)}function o(){return"undefined"!=typeof google&&google}function a(){o()&&$.each(l,function(e,n){n.table=n.table||t(n);var i=$("[data-id="+n.id+"]");n.options=r(i,n.type,n.options),"TreeMap"==n.type&&"generateTooltip"in n&&(window["chartData_"+n.id].dataTable=n.table,n.options.generateTooltip=n.generateTooltip);var o=n.type;["Histogram","Gantt","Timeline","TreeMap"].includes(o)||(o+="Chart"),new google.visualization[o](i.get(0)).draw(n.table,n.options)})}function s(e){l.push(e)}var l=[];return{init:function(e){e.find(".pgui-chart").each(function(e,t){var n=$(t);n.data("ready")||(s(window["chartData_"+n.data("id")]),n.data("ready",!0))}),o()&&google.charts.setOnLoadCallback(a),$(window).off("resize",a).on("resize",a)},draw:a}}),define("pgui.grid-details",["class","pgui.charts","underscore"],function(e,t,n){function i(){return Math.ceil(1e8*Math.random())}function r(e,t){var n=$('<tr class="grid-details grid-details-table detail"><td class="js-content" colspan="'+e.getColumnCount()+'"></td></tr>');return t.after(n),n}function o(e,t){function n(){var n=e.container.find(".pg-row-list").width(),o=t.width(),a=Math.floor(n/o),s=r.index(t),l=Math.min(r.length-1,s+a-s%a-1);i.detach(),$(r.get(l)).after(i)}var i=$('<div class="grid-card-item col-xs-12"><div class="well grid-details grid-details-card js-content"></div></div>'),r=e.getRows();return $(window).on("resize",n),n(),i}function a(){return $('<div class="grid-details-loading js-loading"><img src="components/assets/img/loading.gif"></div>')}function s(){return $('<button class="close js-close" type="button">&times;</button>')}function l(e){var r=$('<ul class="nav nav-tabs grid-details-tabs">'),o=$('<div class="tab-content">');return n.each(e,function(e,t){var n=e.id+i();r.append($("<li>").toggleClass("active",0===t).append($('<a href="#'+n+'" data-toggle="tab">'+e.caption+"</a>"))),o.append($('<div class="tab-pane" id="'+n+'">').toggleClass("active",0===t).append(e.$el))}),r.find('[data-toggle="tab"]').on("shown.bs.tab",function(){t.draw()}),$("<div>").append(r).append(o)}var c=e.extend({init:function(e,t,n,i,l){this.$row=t,this.$button=n,this.$expandAll=i,this.grid=e,this.details=l,this.$container=e.isCard()?o(e,t):r(e,t),this.$container.find(".js-content").append(s()).append(a()),this.isLoaded=!1,this.isLoading=!1},open:function(){this._load(),this.$container.show(),this.$container.find(".js-close").first().on("click",n.bind(this.close,this)),window.scroll(window.scrollX,this.$container.offset().top-$("#navbar").height()-32),t.draw(),this.toggleButtons(!0)},close:function(){this.$container.hide(),this.toggleButtons(!1)},toggle:function(e){e?this.open():this.close()},toggleButtons:function(e){var t=this.grid.getRows();this.grid.isCard()&&(e&&t.find(".js-expand-details.expanded").click(),this.$row.toggleClass("grid-card-item-details-expanded",e)),this.$button.toggleClass("collapsed",!e).toggleClass("expanded",e);var n=t.length===t.find(".js-expand-details.expanded").length;this.$expandAll.toggleClass("collapsed",!n).toggleClass("expanded",n)},_load:function(){this.isLoaded||this.isLoading||(this.isLoading=!0,$.when.apply($,n.map(this.details,function(e){return $.get(e.gridLink,{inline:!0}).then(function(t){return{caption:e.caption,id:e.detailId,$el:$(t)}})})).done(n.bind(function(){this.isLoaded=!0,this.isLoading=!1,this.$container.find(".js-loading").hide(),this.$container.find(".js-content").append(l([].slice.call(arguments))),this._initGrids()},this)))},_initGrids:function(){this.$container.find(".js-grid").each(n.bind(function(e,t){new this.grid.constructor($(t))},this)),t.init(this.$container)},remove:function(){this.$container.remove()}});return function(e,t,n){t.off("click").on("click",function(e){var i=t.hasClass("expanded");n.find(".js-expand-details").filter(i?".expanded":".collapsed").click(),t.toggleClass("collapsed",i).toggleClass("expanded",!i),e.preventDefault()}),n.each(function(n,i){var r=$(i),o=r.find(".js-expand-details").first();o.data("details")||o.off("click").on("click",function(n){var i=o.hasClass("expanded"),a=!i,s=o.data("details");s||(s=new c(e,r,o,t,o.data("info")),o.data("details",s),r.data("details",s)),s.toggle(a),n.preventDefault()})})}}),define("pgui.grid",["class","pgui.filter_builder","pgui.column_filter","pgui.quick_filter","pgui.localizer","microevent","pgui.overlay","underscore","multiple_sorting","sorter","pgui.shortcuts","pgui.utils","pgui.field-embedded-video","pgui.autohide-message","pgui.selection","pgui.selection-handler","pgui.cell-edit","pgui.modal_operation_link","pgui.modal_delete_link","pgui.modal_view","pgui.inline-edit","pgui.column_group","pgui.grid-details","pgui.form_collection","pgui.image_popup","pgui.toggle"],function(e,t,n,i,r,o,a,s,l,c,u,d,h,f,p,m,g,v,b,y,w,x,C,k,_,S){function E(e,t){for(var n=""+e;n.length<t;)n="0"+n;return n}return e.extend({init:function(e,t){var n=this;if(this.container=e,this.container.data("grid-class",this),this.filters={},this.options=t||{},this.reloadPageAfterAjaxOperation=this.container.data("reload-page-after-ajax-operation"),this.$header=this.container.find("thead").first(),this.selectionActions=new m(new p(this.getSelectionId()),this.container.find(".js-selection-actions-container"),this.$header.find("th.row-selection"),this.container.find(".pg-row .row-selection input[type=checkbox]"),!0,n),this._initActions(),this.integrateRows(this.container.find(".pg-row")),this._recalculateRowNumbers(),this._createFilters(),this._bindHandlers(),this._processHiddenValues(),this.$header.length&&this.$header.data("has-groups")&&x(this.$header),!this.container.data("is-master")){var i=this.container.data("sortable-columns"),r=new c(i),o=$("#multiple-sorting-"+this.getId());new l(r,o)}$.each(this.container.find(".alert"),function(e,t){f($(t))})},getId:function(){return this.container.attr("id")},isCard:function(){return this.container.hasClass("grid-card")},getSelectionId:function(){return this.container.data("selection-id")},getRowTemplate:function(){var e=$(s.template($("#"+this.getId()+"_row_template").html())(this));return e.find("td.pg-inline-edit-container").attr("colspan",this.getColumnCount()),e},getColumnCount:function(){return this.container.data("column-count")},getQuickFilter:function(){return this.filters.quickFilter},getFilterBuilder:function(){return this.filters.filterBuilder},getColumnFilter:function(){return this.filters.columnFilter},getReloadPageAfterAjaxOperation:function(){return this.reloadPageAfterAjaxOperation},getRows:function(){return this.container.find(".pg-row-list:first > .pg-row")},removeRow:function(e){e.data("details")&&e.data("details").remove();var t=e.find(".row-selection input[type=checkbox]").first();t.length&&t.prop("checked")&&t.click();var n=e.find("[data-inline-operation=edit]");n.length&&n.data("form-container")&&n.data("form-container").remove(),e.remove(),this.updateEmptyGridMessage()},updateEmptyGridMessage:function(){this.container.find(".pg-row-list:first .empty-grid").toggle(0==this.container.find(".pg-row").length)},insertRowAtBegin:function(e){var t=this.container.find(".pg-row-list:first > .pg-row").first(),n=this.container.find(".pg-row-list:first .empty-grid").closest("tr");return 0==t.length&&(t=n),t.before(e),this.integrateRows(e),this.updateEmptyGridMessage(),e},addHiddenValue:function(e,t){this.hiddenValues[e]=t},showMessage:function(e,t,n){if(e){this.container.find(".js-grid-message-container").first().append(d.buildDismissableMessage(n?"danger":"success",e,t))}},integrateRows:function(e){var t=this;this.selectionActions.setCheckboxes(this.$header.find(".row-selection input[type=checkbox]"),this.container.find(".pg-row .row-selection input[type=checkbox]")),h(e),_(e),S(e,t),e.find("[data-edit-url]").each(function(e,n){var i=$(n);g($(n),function(e){t.showMessage(e.message,e.messageDisplayTime,!e.success);var n=$(e.row);d.replaceRow(i.closest(".pg-row"),n),t.integrateRows(n),t.getReloadPageAfterAjaxOperation()&&location.reload()})}),e.find("[data-modal-operation=edit]").each(function(e,n){var i=$(n);i.data("modal-edit")||i.data("modal-edit",v.createEditLink(k,i,t))}),e.find("[data-modal-operation=copy]").each(function(e,n){var i=$(n);i.data("modal-copy")||i.data("modal-copy",v.createInsertLink(k,i,t))}),e.find("[data-modal-operation=view]").each(function(e,t){y($(t))}),e.find("[data-modal-operation=delete]").length>0&&b(e,t),e.find("[data-inline-operation=edit]").each(function(e,n){var i=$(n);i.data("inline-edit")||i.data("inline-edit",w.createEditLink(i,t))}),e.find("[data-inline-operation=copy]").each(function(e,n){var i=$(n);i.data("inline-copy")||i.data("inline-copy",w.createInsertLink(i,t))}),e.find("[data-inline-operation=view]").each(function(e,n){var i=$(n);i.data("inline-view")||i.data("inline-view",w.createViewLink(i,t))}),C(this,this.container.find(".js-expand-all-details").first(),this.getRows()),d.updatePopupHints(e)},_createFilters:function(){this.filters={filterBuilder:t.create(this.container.find(".js-filter-builder-modal")),columnFilter:n.create(this.container.find(".js-column-filter-container").first()),quickFilter:new i(this.container.find(".js-quick-filter").first())},this.container.find(".js-filter-builder-open").on("click",s.bind(function(e){this.filters.filterBuilder.show(),e.preventDefault()},this))},_bindFilterStatusHandlers:function(e){function t(e){return n.filters[$(e.currentTarget).data("id")]}var n=this;e.on("click",".js-edit-filter",function(e){t(e).show(),e.preventDefault()}).on("click",".js-toggle-filter",function(e){t(e).setEnabled($(e.currentTarget).data("value")).submit(),e.preventDefault()}).on("click",".js-reset-filter",function(e){t(e).reset().submit(),e.preventDefault()}).on("click",".js-reset-selection-filter",function(e){location.href=$.query.remove("keys").set("selection_filter",""),e.preventDefault()})},_processHiddenValues:function(){var e=this;this.hiddenValues={},s.each(this.container.data("grid-hidden-values"),function(t,n){e.addHiddenValue(n,t)})},_recalculateRowNumbers:function(){var e=parseInt(this.container.data("start-line-number")),t=0,n=this.container.find("tbody > tr > td.line-number"),i=e+n.length;t=i.toString().length,n.each(function(n){$(this).html(E(n+e,t))})},_initActions:function(){var e=this,t=this.container.find(".js-actions").first();t.find("[data-modal-insert=true]").each(function(t,n){var i=$(n);i.data("modal-insert-object")||i.data("modal-insert-object",v.createInsertLink(k,i,e))}),t.find("[data-inline-insert=true]").each(function(t,n){var i=$(n);i.data("inline-insert-object")||i.data("inline-insert-object",w.createInsertLink(i,e,i.data("count")||1))})},_bindHandlers:function(){this.$header.find("th[data-comment]").each(function(){$(this).popover({placement:"top",container:"body",trigger:"hover",html:!0,title:$(this).attr("data-field-caption"),content:$(this).attr("data-comment")})}),this._bindFilterStatusHandlers(this.container.find(".js-filter-status").first())}})}),function(e,t,n){"use strict";function i(n,i){var s=this;s.$el=e(n),s.el=n,s.id=o++,s.$window=e(t),s.$document=e(document),s.$el.bind("destroyed",e.proxy(s.teardown,s)),s.$clonedHeader=null,s.$originalHeader=null,s.isSticky=!1,s.hasBeenSticky=!1,s.leftOffset=null,s.topOffset=null,s.init=function(){s.setOptions(i),s.$el.each(function(){var t=e(this);t.css("padding",0),s.$originalHeader=e(s.options.selector,this),s.$clonedHeader=s.$originalHeader.clone(),t.trigger("clonedHeader."+r,[s.$clonedHeader]),s.$clonedHeader.addClass("tableFloatingHeader"),s.$clonedHeader.css("display","none"),s.$originalHeader.addClass("tableFloatingHeaderOriginal"),s.$originalHeader.after(s.$clonedHeader),s.$printStyle=e('<style type="text/css" media="print">.tableFloatingHeader{display:none !important;}.tableFloatingHeaderOriginal{position:static !important;}</style>'),e("head").append(s.$printStyle)}),s.updateWidth(),s.toggleHeaders(),s.bind()},s.destroy=function(){s.$el.unbind("destroyed",s.teardown),s.teardown()},s.teardown=function(){s.isSticky&&s.$originalHeader.css("position","static"),e.removeData(s.el,"plugin_"+r),s.unbind(),s.$clonedHeader.remove(),s.$originalHeader.removeClass("tableFloatingHeaderOriginal"),s.$originalHeader.css("visibility","visible"),s.$printStyle.remove(),s.el=null,s.$el=null},s.bind=function(){s.$scrollableArea.on("scroll."+r,s.toggleHeaders),s.isWindowScrolling||(s.$window.on("scroll."+r+s.id,s.setPositionValues),s.$window.on("resize."+r+s.id,s.toggleHeaders)),s.$scrollableArea.on("resize."+r,s.toggleHeaders),s.$scrollableArea.on("resize."+r,s.updateWidth)},s.unbind=function(){s.$scrollableArea.off("."+r,s.toggleHeaders),s.isWindowScrolling||(s.$window.off("."+r+s.id,s.setPositionValues),s.$window.off("."+r+s.id,s.toggleHeaders)),s.$scrollableArea.off("."+r,s.updateWidth)},s.toggleHeaders=function(){s.$el&&s.$el.each(function(){var t,n=e(this),i=s.isWindowScrolling?isNaN(s.options.fixedOffset)?s.options.fixedOffset.outerHeight():s.options.fixedOffset:s.$scrollableArea.offset().top+(isNaN(s.options.fixedOffset)?0:s.options.fixedOffset),r=n.offset(),o=s.$scrollableArea.scrollTop()+i,a=s.$scrollableArea.scrollLeft(),l=s.isWindowScrolling?o>r.top:i>r.top,c=(s.isWindowScrolling?o:0)<r.top+n.height()-s.$clonedHeader.height()-(s.isWindowScrolling?0:i);l&&c?(t=r.left-a+s.options.leftOffset,s.$originalHeader.css({position:"fixed","margin-top":s.options.marginTop,left:t,"z-index":3}),s.leftOffset=t,s.topOffset=i,s.$clonedHeader.css("display",""),s.isSticky||(s.isSticky=!0,s.updateWidth()),s.setPositionValues()):s.isSticky&&(s.$originalHeader.css("position","static"),s.$clonedHeader.css("display","none"),s.isSticky=!1,s.resetWidth(e("td,th",s.$clonedHeader),e("td,th",s.$originalHeader)))})},s.setPositionValues=function(){var e=s.$window.scrollTop(),t=s.$window.scrollLeft();!s.isSticky||e<0||e+s.$window.height()>s.$document.height()||t<0||t+s.$window.width()>s.$document.width()||s.$originalHeader.css({top:s.topOffset-(s.isWindowScrolling?0:e),left:s.leftOffset-(s.isWindowScrolling?0:t)})},s.updateWidth=function(){if(s.isSticky){s.$originalHeaderCells||(s.$originalHeaderCells=e("th,td",s.$originalHeader)),s.$clonedHeaderCells||(s.$clonedHeaderCells=e("th,td",s.$clonedHeader))
;var t=s.getWidth(s.$clonedHeaderCells);s.setWidth(t,s.$clonedHeaderCells,s.$originalHeaderCells),s.$originalHeader.css("width",s.$clonedHeader.width())}},s.getWidth=function(n){var i=[];return n.each(function(n){var r,o=e(this);if("border-box"===o.css("box-sizing"))r=o[0].getBoundingClientRect().width;else{if("collapse"===e("th",s.$originalHeader).css("border-collapse"))if(t.getComputedStyle)r=parseFloat(t.getComputedStyle(this,null).width);else{var a=parseFloat(o.css("padding-left")),l=parseFloat(o.css("padding-right")),c=parseFloat(o.css("border-width"));r=o.outerWidth()-a-l-c}else r=o.width()}i[n]=r}),i},s.setWidth=function(e,t,n){t.each(function(t){var i=e[t];n.eq(t).css({"min-width":i,"max-width":i})})},s.resetWidth=function(t,n){t.each(function(t){var i=e(this);n.eq(t).css({"min-width":i.css("min-width"),"max-width":i.css("max-width")})})},s.setOptions=function(n){s.options=e.extend({},a,n),s.$scrollableArea=e(s.options.scrollableArea),s.isWindowScrolling=s.$scrollableArea[0]===t},s.updateOptions=function(e){s.setOptions(e),s.unbind(),s.bind(),s.updateWidth(),s.toggleHeaders()},s.init()}var r="stickyTableHeaders",o=0,a={fixedOffset:0,leftOffset:0,marginTop:0,scrollableArea:t,selector:"thead:first"};e.fn[r]=function(t){return this.each(function(){var n=e.data(this,"plugin_"+r);n?"string"==typeof t?n[t].apply(n):n.updateOptions(t):"destroy"!==t&&e.data(this,"plugin_"+r,new i(this,t))})}}(jQuery,window),define("jquery.stickytableheaders",["jquery"],function(){}),define("pgui.list-page-main",["underscore","pgui.page_settings","pgui.shortcuts","pgui.grid","pgui.filter_common","pgui.filter_builder","pgui.column_filter","pgui.charts","pgui.utils","jquery.stickytableheaders"],function(e,t,n,i,r,o,a,s,l){function c(t){t.each(function(t,n){var s=$(n),c=new i(s),u=c.getId(),d=window["gridData_"+u],h=c.getFilterBuilder();e.each(d.filterBuilder.columns,function(e){h.addColumn(new r.Column(e.fieldName,e.caption,e.operators))});var f=new o.Group;f.deserialize(h.getColumns(),d.filterBuilder.data),h.setFilterComponent(f);var p=c.getColumnFilter();e.each(d.columnFilter.columns,function(e){p.addColumn(new a.Column(e.fieldName,e.caption,e.typeIsDateTime))});var m=new a.Group;m.deserialize(p.getColumns(),d.columnFilter.data),p.setFilterComponent(m),p.setDefaultsEnabled(d.columnFilter.isDefaultsEnabled),p.attach();var g=c.getQuickFilter();g.setColumnNames(d.quickFilter.columns),g.highlight(s),l.updatePopupHints(s.find(".pg-row"))})}return function(){var e=$("body");t(e);var i=$("table.table.fixed-header");if(i.length>0){var r=$(".navbar"),o=0;r.hasClass("navbar-fixed-top")&&(o+=r.outerHeight()),i.stickyTableHeaders({selector:"thead:first",marginTop:o})}n.push(["grid"]),c(e.find(".js-grid")),s.init(e)}}),define("pgui.view-page-main",["pgui.utils","pgui.field-embedded-video","pgui.cell-edit","pgui.selection","pgui.selection-handler","pgui.image_popup","pgui.modal_view","pgui.toggle"],function(e,t,n,i,r,o,a,s){return function(){var l=$("body");e.updatePopupHints(l),t(l),o(l),s(l),l.find("[data-edit-url]").each(function(t,i){var r=$(i),o=r.data("column-name");n(r,function(t){r.html(t.columns[o]),l.find(".js-message-container").append(e.buildDismissableMessage("success",t.message,t.messageDisplayTime))})}),l.find("[data-modal-operation=view]").each(function(e,t){a($(t))});var c=l.find(".js-selection-actions-container");if(c.length){new r(new i(c.data("selection-id")),c)}}}),define("pgui.compare-page-main",["pgui.view-page-main"],function(e){return function(){function t(){var e=$(this);e.prop("checked")&&$("[data-diff=false]").toggle("all"===e.data("mode"))}e(),$(".js-compare-mode").on("change",t).each(t)}}),define("pgui.form-page-main",["pgui.form_collection","pgui.shortcuts"],function(e,t){return function(){var n=$(".js-form-container").first();new e(n,$(".js-form-collection"),n.data("form-url"),{done:function(e,t,n){if(e)return!0;switch(n.action){case"open":location.href=n.url;break;case"edit":location.href=t[0].editUrl;break;case"details":location.href=t[0].details[n.index]}return!1}});t.push(["form"])}}),define("pgui.user_management_api",[],function(){return{_invokeApiFunction:function(e,t){var n=new $.Deferred;return $.get("user_management_api.php",$.extend({},{hname:e},t)).done(function(e){"error"==e.status?n.reject(e.result):e.result?n.resolve(e.result):n.resolve()}).fail(function(e,t,i){n.reject(t+": "+i)}),n.promise()},addUser:function(e,t){return this._invokeApiFunction("au",{username:e,password:t})},addUserEx:function(e,t,n){return this._invokeApiFunction("aue",{username:e,password:t,email:n})},updateUser:function(e,t,n,i){return this._invokeApiFunction("uu",{user_id:e,username:t,email:n,status:i})},removeUser:function(e){return this._invokeApiFunction("ru",{user_id:e})},changeUserName:function(e,t){return this._invokeApiFunction("cun",{user_id:e,username:t})},changeUserPassword:function(e,t){return this._invokeApiFunction("cup",{user_id:e,password:t})},getUserGrants:function(e){return this._invokeApiFunction("gug",{user_id:e})},addUserGrant:function(e,t,n){return this._invokeApiFunction("aug",{user_id:e,page_name:t,grant:n})},removeUserGrant:function(e,t,n){return this._invokeApiFunction("rug",{user_id:e,page_name:t,grant:n})},selfChangePassword:function(e,t){return this._invokeApiFunction("self_change_password",{current_password:e,new_password:t})}}}),function(){!function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,r=t.jQuery,o=t.JSON;r||"undefined"==typeof jQuery||(r=jQuery),function(e){"function"==typeof define&&define.amd?define("knockout",["exports","require"],e):e("object"==typeof exports&&"object"==typeof module?module.exports||exports:t.ko={})}(function(a,s){function l(e,t){return(null===e||typeof e in m)&&e===t}function c(t,n){var i;return function(){i||(i=p.a.setTimeout(function(){i=e,t()},n))}}function u(e,t){var n;return function(){clearTimeout(n),n=p.a.setTimeout(e,t)}}function d(e,t){t&&"change"!==t?"beforeChange"===t?this.pc(e):this.gb(e,t):this.qc(e)}function h(e,t){null!==t&&t.s&&t.s()}function f(e,t){var n=this.qd,i=n[w];i.ra||(this.Qb&&this.mb[t]?(n.uc(t,e,this.mb[t]),this.mb[t]=null,--this.Qb):i.I[t]||n.uc(t,e,i.J?{da:e}:n.$c(e)),e.Ja&&e.gd())}var p=void 0!==a?a:{};p.b=function(e,t){for(var n=e.split("."),i=p,r=0;r<n.length-1;r++)i=i[n[r]];i[n[n.length-1]]=t},p.L=function(e,t,n){e[t]=n},p.version="3.5.1",p.b("version",p.version),p.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},p.a=function(){function a(e,t){for(var n in e)u.call(e,n)&&t(n,e[n])}function s(e,t){if(t)for(var n in t)u.call(t,n)&&(e[n]=t[n]);return e}function l(e,t){return e.__proto__=t,e}function c(e,t,n,i){var r=e[t].match(y)||[];p.a.D(n.match(y),function(e){p.a.Na(r,e,i)}),e[t]=r.join(" ")}var u=Object.prototype.hasOwnProperty,d={__proto__:[]}instanceof Array,h="function"==typeof Symbol,f={},m={};f[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],f.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),a(f,function(e,t){if(t.length)for(var n=0,i=t.length;n<i;n++)m[t[n]]=e});var g,v={propertychange:!0},b=n&&function(){for(var t=3,i=n.createElement("div"),r=i.getElementsByTagName("i");i.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e",r[0];);return 4<t?t:e}(),y=/\S+/g;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(e,t,n){for(var i=0,r=e.length;i<r;i++)t.call(n,e[i],i,e)},A:"function"==typeof Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t)}:function(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1},Lb:function(t,n,i){for(var r=0,o=t.length;r<o;r++)if(n.call(i,t[r],r,t))return t[r];return e},Pa:function(e,t){var n=p.a.A(e,t);0<n?e.splice(n,1):0===n&&e.shift()},wc:function(e){var t=[];return e&&p.a.D(e,function(e){0>p.a.A(t,e)&&t.push(e)}),t},Mb:function(e,t,n){var i=[];if(e)for(var r=0,o=e.length;r<o;r++)i.push(t.call(n,e[r],r));return i},jb:function(e,t,n){var i=[];if(e)for(var r=0,o=e.length;r<o;r++)t.call(n,e[r],r)&&i.push(e[r]);return i},Nb:function(e,t){if(t instanceof Array)e.push.apply(e,t);else for(var n=0,i=t.length;n<i;n++)e.push(t[n]);return e},Na:function(e,t,n){var i=p.a.A(p.a.bc(e),t);0>i?n&&e.push(t):n||e.splice(i,1)},Ba:d,extend:s,setPrototypeOf:l,Ab:d?l:s,P:a,Ga:function(e,t,n){if(!e)return e;var i,r={};for(i in e)u.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r},Tb:function(e){for(;e.firstChild;)p.removeNode(e.firstChild)},Yb:function(e){e=p.a.la(e);for(var t=(e[0]&&e[0].ownerDocument||n).createElement("div"),i=0,r=e.length;i<r;i++)t.appendChild(p.oa(e[i]));return t},Ca:function(e,t){for(var n=0,i=e.length,r=[];n<i;n++){var o=e[n].cloneNode(!0);r.push(t?p.oa(o):o)}return r},va:function(e,t){if(p.a.Tb(e),t)for(var n=0,i=t.length;n<i;n++)e.appendChild(t[n])},Xc:function(e,t){var n=e.nodeType?[e]:e;if(0<n.length){for(var i=n[0],r=i.parentNode,o=0,a=t.length;o<a;o++)r.insertBefore(t[o],i);for(o=0,a=n.length;o<a;o++)p.removeNode(n[o])}},Ua:function(e,t){if(e.length){for(t=8===t.nodeType&&t.parentNode||t;e.length&&e[0].parentNode!==t;)e.splice(0,1);for(;1<e.length&&e[e.length-1].parentNode!==t;)e.length--;if(1<e.length){var n=e[0],i=e[e.length-1];for(e.length=0;n!==i;)e.push(n),n=n.nextSibling;e.push(i)}}return e},Zc:function(e,t){7>b?e.setAttribute("selected",t):e.selected=t},Db:function(t){return null===t||t===e?"":t.trim?t.trim():t.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(e,t){return e=e||"",!(t.length>e.length)&&e.substring(0,t.length)===t},vd:function(e,t){if(e===t)return!0;if(11===e.nodeType)return!1;if(t.contains)return t.contains(1!==e.nodeType?e.parentNode:e);if(t.compareDocumentPosition)return 16==(16&t.compareDocumentPosition(e));for(;e&&e!=t;)e=e.parentNode;return!!e},Sb:function(e){return p.a.vd(e,e.ownerDocument.documentElement)},kd:function(e){return!!p.a.Lb(e,p.a.Sb)},R:function(e){return e&&e.tagName&&e.tagName.toLowerCase()},Ac:function(e){return p.onError?function(){try{return e.apply(this,arguments)}catch(e){throw p.onError&&p.onError(e),e}}:e},setTimeout:function(e,t){return setTimeout(p.a.Ac(e),t)},Gc:function(e){setTimeout(function(){throw p.onError&&p.onError(e),e},0)},B:function(e,t,n){var i=p.a.Ac(n);if(n=v[t],p.options.useOnlyNativeEvents||n||!r)if(n||"function"!=typeof e.addEventListener){if(void 0===e.attachEvent)throw Error("Browser doesn't support addEventListener or attachEvent");var o=function(t){i.call(e,t)},a="on"+t;e.attachEvent(a,o),p.a.K.za(e,function(){e.detachEvent(a,o)})}else e.addEventListener(t,i,!1);else g||(g="function"==typeof r(e).on?"on":"bind"),r(e)[g](t,i)},Fb:function(e,i){if(!e||!e.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var o;if("input"===p.a.R(e)&&e.type&&"click"==i.toLowerCase()?(o=e.type,o="checkbox"==o||"radio"==o):o=!1,p.options.useOnlyNativeEvents||!r||o)if("function"==typeof n.createEvent){if("function"!=typeof e.dispatchEvent)throw Error("The supplied element doesn't support dispatchEvent");o=n.createEvent(m[i]||"HTMLEvents"),o.initEvent(i,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,e),e.dispatchEvent(o)}else if(o&&e.click)e.click();else{if(void 0===e.fireEvent)throw Error("Browser doesn't support triggering events");e.fireEvent("on"+i)}else r(e).trigger(i)},f:function(e){return p.O(e)?e():e},bc:function(e){return p.O(e)?e.v():e},Eb:function(e,t,n){var i;t&&("object"==typeof e.classList?(i=e.classList[n?"add":"remove"],p.a.D(t.match(y),function(t){i.call(e.classList,t)})):"string"==typeof e.className.baseVal?c(e.className,"baseVal",t,n):c(e,"className",t,n))},Bb:function(t,n){var i=p.a.f(n);null!==i&&i!==e||(i="");var r=p.h.firstChild(t);!r||3!=r.nodeType||p.h.nextSibling(r)?p.h.va(t,[t.ownerDocument.createTextNode(i)]):r.data=i,p.a.Ad(t)},Yc:function(e,t){if(e.name=t,7>=b)try{var i=e.name.replace(/[&<>'"]/g,function(e){return"&#"+e.charCodeAt(0)+";"});e.mergeAttributes(n.createElement("<input name='"+i+"'/>"),!1)}catch(e){}},Ad:function(e){9<=b&&(e=1==e.nodeType?e:e.parentNode,e.style&&(e.style.zoom=e.style.zoom))},wd:function(e){if(b){var t=e.style.width;e.style.width=0,e.style.width=t}},Pd:function(e,t){e=p.a.f(e),t=p.a.f(t);for(var n=[],i=e;i<=t;i++)n.push(i);return n},la:function(e){for(var t=[],n=0,i=e.length;n<i;n++)t.push(e[n]);return t},Da:function(e){return h?Symbol(e):e},Zd:6===b,$d:7===b,W:b,Lc:function(e,t){for(var n=p.a.la(e.getElementsByTagName("input")).concat(p.a.la(e.getElementsByTagName("textarea"))),i="string"==typeof t?function(e){return e.name===t}:function(e){return t.test(e.name)},r=[],o=n.length-1;0<=o;o--)i(n[o])&&r.push(n[o]);return r},Nd:function(e){return"string"==typeof e&&(e=p.a.Db(e))?o&&o.parse?o.parse(e):new Function("return "+e)():null},hc:function(e,t,n){if(!o||!o.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return o.stringify(p.a.f(e),t,n)},Od:function(e,t,i){i=i||{};var r=i.params||{},o=i.includeFields||this.Jc,s=e;if("object"==typeof e&&"form"===p.a.R(e))for(var s=e.action,l=o.length-1;0<=l;l--)for(var c=p.a.Lc(e,o[l]),u=c.length-1;0<=u;u--)r[c[u].name]=c[u].value;t=p.a.f(t);var d=n.createElement("form");d.style.display="none",d.action=s,d.method="post";for(var h in t)e=n.createElement("input"),e.type="hidden",e.name=h,e.value=p.a.hc(p.a.f(t[h])),d.appendChild(e);a(r,function(e,t){var i=n.createElement("input");i.type="hidden",i.name=e,i.value=t,d.appendChild(i)}),n.body.appendChild(d),i.submitter?i.submitter(d):d.submit(),setTimeout(function(){d.parentNode.removeChild(d)},0)}}}(),p.b("utils",p.a),p.b("utils.arrayForEach",p.a.D),p.b("utils.arrayFirst",p.a.Lb),p.b("utils.arrayFilter",p.a.jb),p.b("utils.arrayGetDistinctValues",p.a.wc),p.b("utils.arrayIndexOf",p.a.A),p.b("utils.arrayMap",p.a.Mb),p.b("utils.arrayPushAll",p.a.Nb),p.b("utils.arrayRemoveItem",p.a.Pa),p.b("utils.cloneNodes",p.a.Ca),p.b("utils.createSymbolOrString",p.a.Da),p.b("utils.extend",p.a.extend),p.b("utils.fieldsIncludedWithJsonPost",p.a.Jc),p.b("utils.getFormFields",p.a.Lc),p.b("utils.objectMap",p.a.Ga),p.b("utils.peekObservable",p.a.bc),p.b("utils.postJson",p.a.Od),p.b("utils.parseJson",p.a.Nd),p.b("utils.registerEventHandler",p.a.B),p.b("utils.stringifyJson",p.a.hc),p.b("utils.range",p.a.Pd),p.b("utils.toggleDomNodeCssClass",p.a.Eb),p.b("utils.triggerEvent",p.a.Fb),p.b("utils.unwrapObservable",p.a.f),p.b("utils.objectForEach",p.a.P),p.b("utils.addOrRemoveItem",p.a.Na),p.b("utils.setTextContent",p.a.Bb),p.b("unwrap",p.a.f),Function.prototype.bind||(Function.prototype.bind=function(e){var t=this;if(1===arguments.length)return function(){return t.apply(e,arguments)};var n=Array.prototype.slice.call(arguments,1);return function(){var i=n.slice(0);return i.push.apply(i,arguments),t.apply(e,i)}}),p.a.g=new function(){var t,n,i=0,r="__ko__"+(new Date).getTime(),o={};return p.a.W?(t=function(t,n){var a=t[r];if(!a||"null"===a||!o[a]){if(!n)return e;a=t[r]="ko"+i++,o[a]={}}return o[a]},n=function(e){var t=e[r];return!!t&&(delete o[t],e[r]=null,!0)}):(t=function(e,t){var n=e[r];return!n&&t&&(n=e[r]={}),n},n=function(e){return!!e[r]&&(delete e[r],!0)}),{get:function(e,n){var i=t(e,!1);return i&&i[n]},set:function(n,i,r){(n=t(n,r!==e))&&(n[i]=r)},Ub:function(e,n,i){return e=t(e,!0),e[n]||(e[n]=i)},clear:n,Z:function(){return i+++r}}},p.b("utils.domData",p.a.g),p.b("utils.domData.clear",p.a.g.clear),p.a.K=new function(){function t(t,n){var i=p.a.g.get(t,o);return i===e&&n&&(i=[],p.a.g.set(t,o,i)),i}function n(e){var n=t(e,!1);if(n)for(var n=n.slice(0),r=0;r<n.length;r++)n[r](e);p.a.g.clear(e),p.a.K.cleanExternalData(e),s[e.nodeType]&&i(e.childNodes,!0)}function i(e,t){for(var i,r=[],o=0;o<e.length;o++)if((!t||8===e[o].nodeType)&&(n(r[r.length]=i=e[o]),e[o]!==i))for(;o--&&-1==p.a.A(r,e[o]););}var o=p.a.g.Z(),a={1:!0,8:!0,9:!0},s={1:!0,9:!0};return{za:function(e,n){if("function"!=typeof n)throw Error("Callback must be a function");t(e,!0).push(n)},yb:function(n,i){var r=t(n,!1);r&&(p.a.Pa(r,i),0==r.length&&p.a.g.set(n,o,e))},oa:function(e){return p.u.G(function(){a[e.nodeType]&&(n(e),s[e.nodeType]&&i(e.getElementsByTagName("*")))}),e},removeNode:function(e){p.oa(e),e.parentNode&&e.parentNode.removeChild(e)},cleanExternalData:function(e){r&&"function"==typeof r.cleanData&&r.cleanData([e])}}},p.oa=p.a.K.oa,p.removeNode=p.a.K.removeNode,p.b("cleanNode",p.oa),p.b("removeNode",p.removeNode),p.b("utils.domNodeDisposal",p.a.K),p.b("utils.domNodeDisposal.addDisposeCallback",p.a.K.za),p.b("utils.domNodeDisposal.removeDisposeCallback",p.a.K.yb),function(){var i=[0,"",""],o=[1,"<table>","</table>"],a=[3,"<table><tbody><tr>","</tr></tbody></table>"],s=[1,"<select multiple='multiple'>","</select>"],l={thead:o,tbody:o,tfoot:o,tr:[2,"<table><tbody>","</tbody></table>"],td:a,th:a,option:s,optgroup:s},c=8>=p.a.W;p.a.ua=function(e,o){var a;if(r){if(r.parseHTML)a=r.parseHTML(e,o)||[];else if((a=r.clean([e],o))&&a[0]){for(var s=a[0];s.parentNode&&11!==s.parentNode.nodeType;)s=s.parentNode;s.parentNode&&s.parentNode.removeChild(s)}}else{(a=o)||(a=n);var u,s=a.parentWindow||a.defaultView||t,d=p.a.Db(e).toLowerCase(),h=a.createElement("div");for(u=(d=d.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&l[d[1]]||i,d=u[0],u="ignored<div>"+u[1]+e+u[2]+"</div>","function"==typeof s.innerShiv?h.appendChild(s.innerShiv(u)):(c&&a.body.appendChild(h),h.innerHTML=u,c&&h.parentNode.removeChild(h));d--;)h=h.lastChild;a=p.a.la(h.lastChild.childNodes)}return a},p.a.Md=function(e,t){var n=p.a.ua(e,t);return n.length&&n[0].parentElement||p.a.Yb(n)},p.a.fc=function(t,n){if(p.a.Tb(t),null!==(n=p.a.f(n))&&n!==e)if("string"!=typeof n&&(n=n.toString()),r)r(t).html(n);else for(var i=p.a.ua(n,t.ownerDocument),o=0;o<i.length;o++)t.appendChild(i[o])}}(),p.b("utils.parseHtmlFragment",p.a.ua),p.b("utils.setHtml",p.a.fc),p.aa=function(){function t(e,n){if(e)if(8==e.nodeType){var i=p.aa.Uc(e.nodeValue);null!=i&&n.push({ud:e,Kd:i})}else if(1==e.nodeType)for(var i=0,r=e.childNodes,o=r.length;i<o;i++)t(r[i],n)}var n={};return{Xb:function(e){if("function"!=typeof e)throw Error("You can only pass a function to ko.memoization.memoize()");var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return n[t]=e,"\x3c!--[ko_memo:"+t+"]--\x3e"},bd:function(t,i){var r=n[t];if(r===e)throw Error("Couldn't find any memo with ID "+t+". Perhaps it's already been unmemoized.");try{return r.apply(null,i||[]),!0}finally{delete n[t]}},cd:function(e,n){var i=[];t(e,i);for(var r=0,o=i.length;r<o;r++){var a=i[r].ud,s=[a];n&&p.a.Nb(s,n),p.aa.bd(i[r].Kd,s),a.nodeValue="",a.parentNode&&a.parentNode.removeChild(a)}},Uc:function(e){return(e=e.match(/^\[ko_memo\:(.*?)\]$/))?e[1]:null}}}(),p.b("memoization",p.aa),p.b("memoization.memoize",p.aa.Xb),p.b("memoization.unmemoize",p.aa.bd),p.b("memoization.parseMemoText",p.aa.Uc),p.b("memoization.unmemoizeDomNodeAndDescendants",p.aa.cd),p.na=function(){function e(){if(a)for(var e,t=a,n=0;l<a;)if(e=o[l++]){if(l>t){if(5e3<=++n){l=a,p.a.Gc(Error("'Too much recursion' after processing "+n+" task groups."));break}t=a}try{e()}catch(e){p.a.Gc(e)}}}function i(){e(),l=a=o.length=0}var r,o=[],a=0,s=1,l=0;return r=t.MutationObserver?function(e){var t=n.createElement("div");return new MutationObserver(e).observe(t,{attributes:!0}),function(){t.classList.toggle("foo")}}(i):n&&"onreadystatechange"in n.createElement("script")?function(e){var t=n.createElement("script");t.onreadystatechange=function(){t.onreadystatechange=null,n.documentElement.removeChild(t),t=null,e()},n.documentElement.appendChild(t)}:function(e){setTimeout(e,0)},{scheduler:r,zb:function(e){return a||p.na.scheduler(i),o[a++]=e,s++},cancel:function(e){(e-=s-a)>=l&&e<a&&(o[e]=null)},resetForTesting:function(){var e=a-l;return l=a=o.length=0,e},Sd:e}}(),p.b("tasks",p.na),p.b("tasks.schedule",p.na.zb),p.b("tasks.runEarly",p.na.Sd),p.Ta={throttle:function(e,t){e.throttleEvaluation=t;var n=null;return p.$({read:e,write:function(i){clearTimeout(n),n=p.a.setTimeout(function(){e(i)},t)}})},rateLimit:function(e,t){var n,i,r;"number"==typeof t?n=t:(n=t.timeout,i=t.method),e.Hb=!1,r="function"==typeof i?i:"notifyWhenChangesStop"==i?u:c,e.ub(function(e){return r(e,n,t)})},deferred:function(t,n){if(!0!==n)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");t.Hb||(t.Hb=!0,t.ub(function(n){var i,r=!1;return function(){if(!r){p.na.cancel(i),i=p.na.zb(n);try{r=!0,t.notifySubscribers(e,"dirty")}finally{r=!1}}}}))},notify:function(e,t){e.equalityComparer="always"==t?null:l}};var m={undefined:1,boolean:1,number:1,string:1};p.b("extenders",p.Ta),p.ic=function(e,t,n){this.da=e,this.lc=t,this.mc=n,this.Ib=!1,this.fb=this.Jb=null,p.L(this,"dispose",this.s),p.L(this,"disposeWhenNodeIsRemoved",this.l)},p.ic.prototype.s=function(){this.Ib||(this.fb&&p.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},p.ic.prototype.l=function(e){this.Jb=e,p.a.K.za(e,this.fb=this.s.bind(this))},p.T=function(){p.a.Ab(this,g),g.qb(this)};var g={qb:function(e){e.U={change:[]},e.sc=1},subscribe:function(e,t,n){var i=this;n=n||"change";var r=new p.ic(i,t?e.bind(t):e,function(){p.a.Pa(i.U[n],r),i.hb&&i.hb(n)});return i.Qa&&i.Qa(n),i.U[n]||(i.U[n]=[]),i.U[n].push(r),r},notifySubscribers:function(e,t){if(t=t||"change","change"===t&&this.Gb(),this.Wa(t)){var n="change"===t&&this.ed||this.U[t].slice(0);try{p.u.xc();for(var i,r=0;i=n[r];++r)i.Ib||i.lc(e)}finally{p.u.end()}}},ob:function(){return this.sc},Dd:function(e){return this.ob()!==e},Gb:function(){++this.sc},ub:function(e){var t,n,i,r,o,a=this,s=p.O(a);a.gb||(a.gb=a.notifySubscribers,a.notifySubscribers=d);var l=e(function(){a.Ja=!1,s&&r===a&&(r=a.nc?a.nc():a());var e=n||o&&a.sb(i,r);o=n=t=!1,e&&a.gb(i=r)});a.qc=function(e,n){n&&a.Ja||(o=!n),a.ed=a.U.change.slice(0),a.Ja=t=!0,r=e,l()},a.pc=function(e){t||(i=e,a.gb(e,"beforeChange"))},a.rc=function(){o=!0},a.gd=function(){a.sb(i,a.v(!0))&&(n=!0)}},Wa:function(e){return this.U[e]&&this.U[e].length},Bd:function(e){if(e)return this.U[e]&&this.U[e].length||0;var t=0;return p.a.P(this.U,function(e,n){"dirty"!==e&&(t+=n.length)}),t},sb:function(e,t){return!this.equalityComparer||!this.equalityComparer(e,t)},toString:function(){return"[object Object]"},extend:function(e){var t=this;return e&&p.a.P(e,function(e,n){var i=p.Ta[e];"function"==typeof i&&(t=i(t,n)||t)}),t}};p.L(g,"init",g.qb),p.L(g,"subscribe",g.subscribe),p.L(g,"extend",g.extend),p.L(g,"getSubscriptionsCount",g.Bd),p.a.Ba&&p.a.setPrototypeOf(g,Function.prototype),p.T.fn=g,p.Qc=function(e){return null!=e&&"function"==typeof e.subscribe&&"function"==typeof e.notifySubscribers},p.b("subscribable",p.T),p.b("isSubscribable",p.Qc),p.S=p.u=function(){function e(e){i.push(n),n=e}function t(){n=i.pop()}var n,i=[],r=0;return{xc:e,end:t,cc:function(e){if(n){if(!p.Qc(e))throw Error("Only subscribable things can act as dependencies");n.od.call(n.pd,e,e.fd||(e.fd=++r))}},G:function(n,i,r){try{return e(),n.apply(i,r||[])}finally{t()}},qa:function(){if(n)return n.o.qa()},Va:function(){if(n)return n.o.Va()},Ya:function(){if(n)return n.Ya},o:function(){if(n)return n.o}}}(),p.b("computedContext",p.S),p.b("computedContext.getDependenciesCount",p.S.qa),p.b("computedContext.getDependencies",p.S.Va),p.b("computedContext.isInitial",p.S.Ya),p.b("computedContext.registerDependency",p.S.cc),p.b("ignoreDependencies",p.Yd=p.u.G);var v=p.a.Da("_latestValue");p.ta=function(e){function t(){return 0<arguments.length?(t.sb(t[v],arguments[0])&&(t.ya(),t[v]=arguments[0],t.xa()),this):(p.u.cc(t),t[v])}return t[v]=e,p.a.Ba||p.a.extend(t,p.T.fn),p.T.fn.qb(t),p.a.Ab(t,b),p.options.deferUpdates&&p.Ta.deferred(t,!0),t};var b={equalityComparer:l,v:function(){return this[v]},xa:function(){this.notifySubscribers(this[v],"spectate"),this.notifySubscribers(this[v])},ya:function(){this.notifySubscribers(this[v],"beforeChange")}};p.a.Ba&&p.a.setPrototypeOf(b,p.T.fn);var y=p.ta.Ma="__ko_proto__";b[y]=p.ta,p.O=function(e){if((e="function"==typeof e&&e[y])&&e!==b[y]&&e!==p.o.fn[y])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!e},p.Za=function(e){return"function"==typeof e&&(e[y]===b[y]||e[y]===p.o.fn[y]&&e.Nc)},p.b("observable",p.ta),p.b("isObservable",p.O),p.b("isWriteableObservable",p.Za),p.b("isWritableObservable",p.Za),p.b("observable.fn",b),p.L(b,"peek",b.v),p.L(b,"valueHasMutated",b.xa),p.L(b,"valueWillMutate",b.ya),p.Ha=function(e){if("object"!=typeof(e=e||[])||!("length"in e))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return e=p.ta(e),p.a.Ab(e,p.Ha.fn),e.extend({trackArrayChanges:!0})},p.Ha.fn={remove:function(e){for(var t=this.v(),n=[],i="function"!=typeof e||p.O(e)?function(t){return t===e}:e,r=0;r<t.length;r++){var o=t[r];if(i(o)){if(0===n.length&&this.ya(),t[r]!==o)throw Error("Array modified during remove; cannot remove item");n.push(o),t.splice(r,1),r--}}return n.length&&this.xa(),n},removeAll:function(t){if(t===e){var n=this.v(),i=n.slice(0);return this.ya(),n.splice(0,n.length),this.xa(),i}return t?this.remove(function(e){return 0<=p.a.A(t,e)}):[]},destroy:function(e){var t=this.v(),n="function"!=typeof e||p.O(e)?function(t){return t===e}:e;this.ya();for(var i=t.length-1;0<=i;i--){var r=t[i];n(r)&&(r._destroy=!0)}this.xa()},destroyAll:function(t){return t===e?this.destroy(function(){return!0}):t?this.destroy(function(e){return 0<=p.a.A(t,e)}):[]},indexOf:function(e){var t=this();return p.a.A(t,e)},replace:function(e,t){var n=this.indexOf(e);0<=n&&(this.ya(),this.v()[n]=t,this.xa())},sorted:function(e){var t=this().slice(0);return e?t.sort(e):t.sort()},reversed:function(){return this().slice(0).reverse()}},p.a.Ba&&p.a.setPrototypeOf(p.Ha.fn,p.ta.fn),p.a.D("pop push reverse shift sort splice unshift".split(" "),function(e){p.Ha.fn[e]=function(){var t=this.v();this.ya(),this.zc(t,e,arguments);var n=t[e].apply(t,arguments);return this.xa(),n===t?this:n}}),p.a.D(["slice"],function(e){p.Ha.fn[e]=function(){var t=this();return t[e].apply(t,arguments)}}),p.Pc=function(e){return p.O(e)&&"function"==typeof e.remove&&"function"==typeof e.push},p.b("observableArray",p.Ha),p.b("isObservableArray",p.Pc),p.Ta.trackArrayChanges=function(t,n){function i(){function e(){if(c){var e,n=[].concat(t.v()||[]);t.Wa("arrayChange")&&((!l||1<c)&&(l=p.a.Pb(a,n,t.Ob)),e=l),a=n,l=null,c=0,e&&e.length&&t.notifySubscribers(e,"arrayChange")}}s?e():(s=!0,o=t.subscribe(function(){++c},null,"spectate"),a=[].concat(t.v()||[]),l=null,r=t.subscribe(e))}if(t.Ob={},n&&"object"==typeof n&&p.a.extend(t.Ob,n),t.Ob.sparse=!0,!t.zc){var r,o,a,s=!1,l=null,c=0,u=t.Qa,d=t.hb;t.Qa=function(e){u&&u.call(t,e),"arrayChange"===e&&i()},t.hb=function(n){d&&d.call(t,n),"arrayChange"!==n||t.Wa("arrayChange")||(r&&r.s(),o&&o.s(),o=r=null,s=!1,a=e)},t.zc=function(e,t,n){function i(e,t,n){return r[r.length]={status:e,value:t,index:n}}if(s&&!c){var r=[],o=e.length,a=n.length,u=0;switch(t){case"push":u=o;case"unshift":for(t=0;t<a;t++)i("added",n[t],u+t);break;case"pop":u=o-1;case"shift":o&&i("deleted",e[u],u);break;case"splice":t=Math.min(Math.max(0,0>n[0]?o+n[0]:n[0]),o);for(var o=1===a?o:Math.min(t+(n[1]||0),o),a=t+a-2,u=Math.max(o,a),d=[],h=[],f=2;t<u;++t,++f)t<o&&h.push(i("deleted",e[t],t)),t<a&&d.push(i("added",n[f],t));p.a.Kc(h,d);break;default:return}l=r}}}};var w=p.a.Da("_state");p.o=p.$=function(t,n,i){function r(){if(0<arguments.length){if("function"!=typeof o)throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return o.apply(a.nb,arguments),this}return a.ra||p.u.cc(r),(a.ka||a.J&&r.Xa())&&r.ha(),a.X}if("object"==typeof t?i=t:(i=i||{},t&&(i.read=t)),"function"!=typeof i.read)throw Error("Pass a function that returns the value of the ko.computed");var o=i.write,a={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:i.read,nb:n||i.owner,l:i.disposeWhenNodeIsRemoved||i.l||null,Sa:i.disposeWhen||i.Sa,Rb:null,I:{},V:0,Ic:null};return r[w]=a,r.Nc="function"==typeof o,p.a.Ba||p.a.extend(r,p.T.fn),p.T.fn.qb(r),p.a.Ab(r,x),i.pure?(a.wb=!0,a.J=!0,p.a.extend(r,C)):i.deferEvaluation&&p.a.extend(r,k),p.options.deferUpdates&&p.Ta.deferred(r,!0),a.l&&(a.jc=!0,a.l.nodeType||(a.l=null)),a.J||i.deferEvaluation||r.ha(),a.l&&r.ja()&&p.a.K.za(a.l,a.Rb=function(){r.s()}),r};var x={equalityComparer:l,qa:function(){return this[w].V},Va:function(){var e=[];return p.a.P(this[w].I,function(t,n){e[n.Ka]=n.da}),e},Vb:function(e){if(!this[w].V)return!1;var t=this.Va();return-1!==p.a.A(t,e)||!!p.a.Lb(t,function(t){return t.Vb&&t.Vb(e)})},uc:function(e,t,n){if(this[w].wb&&t===this)throw Error("A 'pure' computed must not be called recursively");this[w].I[e]=n,n.Ka=this[w].V++,n.La=t.ob()},Xa:function(){var e,t,n=this[w].I;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&(t=n[e],this.Ia&&t.da.Ja||t.da.Dd(t.La)))return!0},Jd:function(){this.Ia&&!this[w].rb&&this.Ia(!1)},ja:function(){var e=this[w];return e.ka||0<e.V},Rd:function(){this.Ja?this[w].ka&&(this[w].sa=!0):this.Hc()},$c:function(e){if(e.Hb){var t=e.subscribe(this.Jd,this,"dirty"),n=e.subscribe(this.Rd,this);return{da:e,s:function(){t.s(),n.s()}}}return e.subscribe(this.Hc,this)},Hc:function(){var e=this,t=e.throttleEvaluation;t&&0<=t?(clearTimeout(this[w].Ic),this[w].Ic=p.a.setTimeout(function(){e.ha(!0)},t)):e.Ia?e.Ia(!0):e.ha(!0)},ha:function(e){var t=this[w],n=t.Sa,i=!1;if(!t.rb&&!t.ra){if(t.l&&!p.a.Sb(t.l)||n&&n()){if(!t.jc)return void this.s()}else t.jc=!1;t.rb=!0;try{i=this.zd(e)}finally{t.rb=!1}return i}},zd:function(t){var n=this[w],i=!1,r=n.wb?e:!n.V,i={qd:this,mb:n.I,Qb:n.V};p.u.xc({pd:i,od:f,o:this,Ya:r}),n.I={},n.V=0;var o=this.yd(n,i);return n.V?i=this.sb(n.X,o):(this.s(),i=!0),i&&(n.J?this.Gb():this.notifySubscribers(n.X,"beforeChange"),n.X=o,this.notifySubscribers(n.X,"spectate"),!n.J&&t&&this.notifySubscribers(n.X),this.rc&&this.rc()),r&&this.notifySubscribers(n.X,"awake"),i},yd:function(e,t){try{var n=e.Wc;return e.nb?n.call(e.nb):n()}finally{p.u.end(),t.Qb&&!e.J&&p.a.P(t.mb,h),e.sa=e.ka=!1}},v:function(e){var t=this[w];return(t.ka&&(e||!t.V)||t.J&&this.Xa())&&this.ha(),t.X},ub:function(e){p.T.fn.ub.call(this,e),this.nc=function(){return this[w].J||(this[w].sa?this.ha():this[w].ka=!1),this[w].X},this.Ia=function(e){this.pc(this[w].X),this[w].ka=!0,e&&(this[w].sa=!0),this.qc(this,!e)}},s:function(){var t=this[w];!t.J&&t.I&&p.a.P(t.I,function(e,t){t.s&&t.s()}),t.l&&t.Rb&&p.a.K.yb(t.l,t.Rb),t.I=e,t.V=0,t.ra=!0,t.sa=!1,t.ka=!1,t.J=!1,t.l=e,t.Sa=e,t.Wc=e,this.Nc||(t.nb=e)}},C={Qa:function(e){var t=this,n=t[w];if(!n.ra&&n.J&&"change"==e){if(n.J=!1,n.sa||t.Xa())n.I=null,n.V=0,t.ha()&&t.Gb();else{var i=[];p.a.P(n.I,function(e,t){i[t.Ka]=e}),p.a.D(i,function(e,i){var r=n.I[e],o=t.$c(r.da);o.Ka=i,o.La=r.La,n.I[e]=o}),t.Xa()&&t.ha()&&t.Gb()}n.ra||t.notifySubscribers(n.X,"awake")}},hb:function(t){var n=this[w];n.ra||"change"!=t||this.Wa("change")||(p.a.P(n.I,function(e,t){t.s&&(n.I[e]={da:t.da,Ka:t.Ka,La:t.La},t.s())}),n.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var e=this[w];return e.J&&(e.sa||this.Xa())&&this.ha(),p.T.fn.ob.call(this)}},k={Qa:function(e){"change"!=e&&"beforeChange"!=e||this.v()}};p.a.Ba&&p.a.setPrototypeOf(x,p.T.fn);var _=p.ta.Ma;x[_]=p.o,p.Oc=function(e){return"function"==typeof e&&e[_]===x[_]},p.Fd=function(e){return p.Oc(e)&&e[w]&&e[w].wb},p.b("computed",p.o),p.b("dependentObservable",p.o),p.b("isComputed",p.Oc),p.b("isPureComputed",p.Fd),p.b("computed.fn",x),p.L(x,"peek",x.v),p.L(x,"dispose",x.s),p.L(x,"isActive",x.ja),p.L(x,"getDependenciesCount",x.qa),p.L(x,"getDependencies",x.Va),p.xb=function(e,t){return"function"==typeof e?p.o(e,t,{pure:!0}):(e=p.a.extend({},e),e.pure=!0,p.o(e,t))},p.b("pureComputed",p.xb),function(){function t(r,o,a){if(a=a||new i,
"object"!=typeof(r=o(r))||null===r||r===e||r instanceof RegExp||r instanceof Date||r instanceof String||r instanceof Number||r instanceof Boolean)return r;var s=r instanceof Array?[]:{};return a.save(r,s),n(r,function(n){var i=o(r[n]);switch(typeof i){case"boolean":case"number":case"string":case"function":s[n]=i;break;case"object":case"undefined":var l=a.get(i);s[n]=l!==e?l:t(i,o,a)}}),s}function n(e,t){if(e instanceof Array){for(var n=0;n<e.length;n++)t(n);"function"==typeof e.toJSON&&t("toJSON")}else for(n in e)t(n)}function i(){this.keys=[],this.values=[]}p.ad=function(e){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return t(e,function(e){for(var t=0;p.O(e)&&10>t;t++)e=e();return e})},p.toJSON=function(e,t,n){return e=p.ad(e),p.a.hc(e,t,n)},i.prototype={constructor:i,save:function(e,t){var n=p.a.A(this.keys,e);0<=n?this.values[n]=t:(this.keys.push(e),this.values.push(t))},get:function(t){return t=p.a.A(this.keys,t),0<=t?this.values[t]:e}}}(),p.b("toJS",p.ad),p.b("toJSON",p.toJSON),p.Wd=function(e,t,n){function i(t){var i=p.xb(e,n).extend({ma:"always"}),r=i.subscribe(function(e){e&&(r.s(),t(e))});return i.notifySubscribers(i.v()),r}return"function"!=typeof Promise||t?i(t.bind(n)):new Promise(i)},p.b("when",p.Wd),function(){p.w={M:function(t){switch(p.a.R(t)){case"option":return!0===t.__ko__hasDomDataOptionValue__?p.a.g.get(t,p.c.options.$b):7>=p.a.W?t.getAttributeNode("value")&&t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?p.w.M(t.options[t.selectedIndex]):e;default:return t.value}},cb:function(t,n,i){switch(p.a.R(t)){case"option":"string"==typeof n?(p.a.g.set(t,p.c.options.$b,e),"__ko__hasDomDataOptionValue__"in t&&delete t.__ko__hasDomDataOptionValue__,t.value=n):(p.a.g.set(t,p.c.options.$b,n),t.__ko__hasDomDataOptionValue__=!0,t.value="number"==typeof n?n:"");break;case"select":""!==n&&null!==n||(n=e);for(var r,o=-1,a=0,s=t.options.length;a<s;++a)if((r=p.w.M(t.options[a]))==n||""===r&&n===e){o=a;break}(i||0<=o||n===e&&1<t.size)&&(t.selectedIndex=o,6===p.a.W&&p.a.setTimeout(function(){t.selectedIndex=o},0));break;default:null!==n&&n!==e||(n=""),t.value=n}}}}(),p.b("selectExtensions",p.w),p.b("selectExtensions.readValue",p.w.M),p.b("selectExtensions.writeValue",p.w.cb),p.m=function(){function e(e){e=p.a.Db(e),123===e.charCodeAt(0)&&(e=e.slice(1,-1)),e+="\n,";var t,n=[],a=e.match(i),s=[],l=0;if(1<a.length){for(var c,u=0;c=a[u];++u){var d=c.charCodeAt(0);if(44===d){if(0>=l){n.push(t&&s.length?{key:t,value:s.join("")}:{unknown:t||s.join("")}),t=l=0,s=[];continue}}else if(58===d){if(!l&&!t&&1===s.length){t=s.pop();continue}}else{if(47===d&&1<c.length&&(47===c.charCodeAt(1)||42===c.charCodeAt(1)))continue;47===d&&u&&1<c.length?(d=a[u-1].match(r))&&!o[d[0]]&&(e=e.substr(e.indexOf(c)+1),a=e.match(i),u=-1,c="/"):40===d||123===d||91===d?++l:41===d||125===d||93===d?--l:t||s.length||34!==d&&39!==d||(c=c.slice(1,-1))}s.push(c)}if(0<l)throw Error("Unbalanced parentheses, braces, or brackets")}return n}var t=["true","false","null","undefined"],n=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,i=RegExp("\"(?:\\\\.|[^\"])*\"|'(?:\\\\.|[^'])*'|`(?:\\\\.|[^`])*`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*\n|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,\"'`{}()/:[\\]]*[^\\s,\"'`{}()/:[\\]]|[^\\s]","g"),r=/[\])"'A-Za-z0-9_$]+$/,o={in:1,return:1,typeof:1},a={};return{Ra:[],wa:a,ac:e,vb:function(i,r){function o(e,i){var r;if(!u){var d=p.getBindingHandler(e);if(d&&d.preprocess&&!(i=d.preprocess(i,e,o)))return;(d=a[e])&&(r=i,0<=p.a.A(t,r)?r=!1:(d=r.match(n),r=null!==d&&(d[1]?"Object("+d[1]+")"+d[2]:r)),d=r),d&&l.push("'"+("string"==typeof a[e]?a[e]:e)+"':function(_z){"+r+"=_z}")}c&&(i="function(){return "+i+" }"),s.push("'"+e+"':"+i)}r=r||{};var s=[],l=[],c=r.valueAccessors,u=r.bindingParams,d="string"==typeof i?e(i):i;return p.a.D(d,function(e){o(e.key||e.unknown,e.value)}),l.length&&o("_ko_property_writers","{"+l.join(",")+" }"),s.join(",")},Id:function(e,t){for(var n=0;n<e.length;n++)if(e[n].key==t)return!0;return!1},eb:function(e,t,n,i,r){e&&p.O(e)?!p.Za(e)||r&&e.v()===i||e(i):(e=t.get("_ko_property_writers"))&&e[n]&&e[n](i)}}}(),p.b("expressionRewriting",p.m),p.b("expressionRewriting.bindingRewriteValidators",p.m.Ra),p.b("expressionRewriting.parseObjectLiteral",p.m.ac),p.b("expressionRewriting.preProcessBindings",p.m.vb),p.b("expressionRewriting._twoWayBindings",p.m.wa),p.b("jsonExpressionRewriting",p.m),p.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",p.m.vb),function(){function e(e){return 8==e.nodeType&&a.test(o?e.text:e.nodeValue)}function t(e){return 8==e.nodeType&&s.test(o?e.text:e.nodeValue)}function i(n,i){for(var r=n,o=1,a=[];r=r.nextSibling;){if(t(r)&&(p.a.g.set(r,c,!0),0===--o))return a;a.push(r),e(r)&&o++}if(!i)throw Error("Cannot find closing comment tag to match: "+n.nodeValue);return null}function r(e,t){var n=i(e,t);return n?0<n.length?n[n.length-1].nextSibling:e.nextSibling:null}var o=n&&"\x3c!--test--\x3e"===n.createComment("test").text,a=o?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,s=o?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,l={ul:!0,ol:!0},c="__ko_matchedEndComment__";p.h={ea:{},childNodes:function(t){return e(t)?i(t):t.childNodes},Ea:function(t){if(e(t)){t=p.h.childNodes(t);for(var n=0,i=t.length;n<i;n++)p.removeNode(t[n])}else p.a.Tb(t)},va:function(t,n){if(e(t)){p.h.Ea(t);for(var i=t.nextSibling,r=0,o=n.length;r<o;r++)i.parentNode.insertBefore(n[r],i)}else p.a.va(t,n)},Vc:function(t,n){var i;e(t)?(i=t.nextSibling,t=t.parentNode):i=t.firstChild,i?n!==i&&t.insertBefore(n,i):t.appendChild(n)},Wb:function(t,n,i){i?(i=i.nextSibling,e(t)&&(t=t.parentNode),i?n!==i&&t.insertBefore(n,i):t.appendChild(n)):p.h.Vc(t,n)},firstChild:function(n){if(e(n))return!n.nextSibling||t(n.nextSibling)?null:n.nextSibling;if(n.firstChild&&t(n.firstChild))throw Error("Found invalid end comment, as the first child of "+n);return n.firstChild},nextSibling:function(n){if(e(n)&&(n=r(n)),n.nextSibling&&t(n.nextSibling)){var i=n.nextSibling;if(t(i)&&!p.a.g.get(i,c))throw Error("Found end comment without a matching opening comment, as child of "+n);return null}return n.nextSibling},Cd:e,Vd:function(e){return(e=(o?e.text:e.nodeValue).match(a))?e[1]:null},Sc:function(n){if(l[p.a.R(n)]){var i=n.firstChild;if(i)do{if(1===i.nodeType){var o;o=i.firstChild;var a=null;if(o)do{if(a)a.push(o);else if(e(o)){var s=r(o,!0);s?o=s:a=[o]}else t(o)&&(a=[o])}while(o=o.nextSibling);if(o=a)for(a=i.nextSibling,s=0;s<o.length;s++)a?n.insertBefore(o[s],a):n.appendChild(o[s])}}while(i=i.nextSibling)}}}}(),p.b("virtualElements",p.h),p.b("virtualElements.allowedBindings",p.h.ea),p.b("virtualElements.emptyNode",p.h.Ea),p.b("virtualElements.insertAfter",p.h.Wb),p.b("virtualElements.prepend",p.h.Vc),p.b("virtualElements.setDomNodeChildren",p.h.va),function(){p.ga=function(){this.nd={}},p.a.extend(p.ga.prototype,{nodeHasBindings:function(e){switch(e.nodeType){case 1:return null!=e.getAttribute("data-bind")||p.j.getComponentNameForNode(e);case 8:return p.h.Cd(e);default:return!1}},getBindings:function(e,t){var n=this.getBindingsString(e,t),n=n?this.parseBindingsString(n,t,e):null;return p.j.tc(n,e,t,!1)},getBindingAccessors:function(e,t){var n=this.getBindingsString(e,t),n=n?this.parseBindingsString(n,t,e,{valueAccessors:!0}):null;return p.j.tc(n,e,t,!0)},getBindingsString:function(e){switch(e.nodeType){case 1:return e.getAttribute("data-bind");case 8:return p.h.Vd(e);default:return null}},parseBindingsString:function(e,t,n,i){try{var r,o=this.nd,a=e+(i&&i.valueAccessors||"");if(!(r=o[a])){var s,l="with($context){with($data||{}){return{"+p.m.vb(e,i)+"}}}";s=new Function("$context","$element",l),r=o[a]=s}return r(t,n)}catch(t){throw t.message="Unable to parse bindings.\nBindings value: "+e+"\nMessage: "+t.message,t}}}),p.ga.instance=new p.ga}(),p.b("bindingProvider",p.ga),function(){function i(e){var t=(e=p.a.g.get(e,C))&&e.N;t&&(e.N=null,t.Tc())}function o(e,t,n){this.node=e,this.yc=t,this.kb=[],this.H=!1,t.N||p.a.K.za(e,i),n&&n.N&&(n.N.kb.push(e),this.Kb=n)}function a(e){return function(){return e}}function s(e){return e()}function l(e){return p.a.Ga(p.u.G(e),function(t,n){return function(){return e()[n]}})}function c(e,t,n){return"function"==typeof e?l(e.bind(null,t,n)):p.a.Ga(e,a)}function u(e,t){return l(this.getBindings.bind(this,e,t))}function d(e,t){var n=p.h.firstChild(t);if(n){var i,r=p.ga.instance,o=r.preprocessNode;if(o){for(;i=n;)n=p.h.nextSibling(i),o.call(r,i);n=p.h.firstChild(t)}for(;i=n;)n=p.h.nextSibling(i),h(e,i)}p.i.ma(t,p.i.H)}function h(e,t){var n=e,i=1===t.nodeType;i&&p.h.Sc(t),(i||p.ga.instance.nodeHasBindings(t))&&(n=m(t,null,e).bindingContextForDescendants),n&&!w[p.a.R(t)]&&d(n,t)}function f(e){var t=[],n={},i=[];return p.a.P(e,function r(o){if(!n[o]){var a=p.getBindingHandler(o);a&&(a.after&&(i.push(o),p.a.D(a.after,function(t){if(e[t]){if(-1!==p.a.A(i,t))throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+i.join(", "));r(t)}}),i.length--),t.push({key:o,Mc:a})),n[o]=!0}}),t}function m(t,n,i){var r=p.a.g.Ub(t,C,{}),o=r.hd;if(!n){if(o)throw Error("You cannot apply bindings multiple times to the same element.");r.hd=!0}o||(r.context=i),r.Zb||(r.Zb={});var a;if(n&&"function"!=typeof n)a=n;else{var l=p.ga.instance,c=l.getBindingAccessors||u,d=p.$(function(){return(a=n?n(i,t):c.call(l,t,i))&&(i[v]&&i[v](),i[y]&&i[y]()),a},null,{l:t});a&&d.ja()||(d=null)}var h,m=i;if(a){var g=function(){return p.a.Ga(d?d():a,s)},b=d?function(e){return function(){return s(d()[e])}}:function(e){return a[e]};g.get=function(e){return a[e]&&s(b(e))},g.has=function(e){return e in a},p.i.H in a&&p.i.subscribe(t,p.i.H,function(){var e=(0,a[p.i.H])();if(e){var n=p.h.childNodes(t);n.length&&e(n,p.Ec(n[0]))}}),p.i.pa in a&&(m=p.i.Cb(t,i),p.i.subscribe(t,p.i.pa,function(){var e=(0,a[p.i.pa])();e&&p.h.firstChild(t)&&e(t)})),r=f(a),p.a.D(r,function(n){var i=n.Mc.init,r=n.Mc.update,o=n.key;if(8===t.nodeType&&!p.h.ea[o])throw Error("The binding '"+o+"' cannot be used with virtual elements");try{"function"==typeof i&&p.u.G(function(){var n=i(t,b(o),g,m.$data,m);if(n&&n.controlsDescendantBindings){if(h!==e)throw Error("Multiple bindings ("+h+" and "+o+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");h=o}}),"function"==typeof r&&p.$(function(){r(t,b(o),g,m.$data,m)},null,{l:t})}catch(e){throw e.message='Unable to process binding "'+o+": "+a[o]+'"\nMessage: '+e.message,e}})}return r=h===e,{shouldBindDescendants:r,bindingContextForDescendants:r&&m}}function g(t,n){return t&&t instanceof p.fa?t:new p.fa(t,e,e,n)}var v=p.a.Da("_subscribable"),b=p.a.Da("_ancestorBindingInfo"),y=p.a.Da("_dataDependency");p.c={};var w={script:!0,textarea:!0,template:!0};p.getBindingHandler=function(e){return p.c[e]};var x={};p.fa=function(t,n,i,r,o){function a(){var e=d?u():u,t=p.a.f(e);return n?(p.a.extend(l,n),b in n&&(l[b]=n[b])):(l.$parents=[],l.$root=t,l.ko=p),l[v]=s,c?t=l.$data:(l.$rawData=e,l.$data=t),i&&(l[i]=t),r&&r(l,n,t),n&&n[v]&&!p.S.o().Vb(n[v])&&n[v](),h&&(l[y]=h),l.$data}var s,l=this,c=t===x,u=c?e:t,d="function"==typeof u&&!p.O(u),h=o&&o.dataDependency;o&&o.exportDependencies?a():(s=p.xb(a),s.v(),s.ja()?s.equalityComparer=null:l[v]=e)},p.fa.prototype.createChildContext=function(e,t,n,i){if(!i&&t&&"object"==typeof t&&(i=t,t=i.as,n=i.extend),t&&i&&i.noChildContext){var r="function"==typeof e&&!p.O(e);return new p.fa(x,this,null,function(i){n&&n(i),i[t]=r?e():e},i)}return new p.fa(e,this,t,function(e,t){e.$parentContext=t,e.$parent=t.$data,e.$parents=(t.$parents||[]).slice(0),e.$parents.unshift(e.$parent),n&&n(e)},i)},p.fa.prototype.extend=function(e,t){return new p.fa(x,this,null,function(t){p.a.extend(t,"function"==typeof e?e(t):e)},t)};var C=p.a.g.Z();o.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},o.prototype.sd=function(e){p.a.Pa(this.kb,e),!this.kb.length&&this.H&&this.Cc()},o.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,p.a.K.yb(this.node,i),p.i.ma(this.node,p.i.pa),this.Tc())},p.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(e,t,n,i,r){var o=p.a.g.Ub(e,C,{});return o.Fa||(o.Fa=new p.T),r&&r.notifyImmediately&&o.Zb[t]&&p.u.G(n,i,[e]),o.Fa.subscribe(n,i,t)},ma:function(t,n){var i=p.a.g.get(t,C);if(i&&(i.Zb[n]=!0,i.Fa&&i.Fa.notifySubscribers(t,n),n==p.i.H))if(i.N)i.N.Cc();else if(i.N===e&&i.Fa&&i.Fa.Wa(p.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")},Cb:function(e,t){var n=p.a.g.Ub(e,C,{});return n.N||(n.N=new o(e,n,t[b])),t[b]==n?t:t.extend(function(e){e[b]=n})}},p.Td=function(e){return(e=p.a.g.get(e,C))&&e.context},p.ib=function(e,t,n){return 1===e.nodeType&&p.h.Sc(e),m(e,t,g(n))},p.ld=function(e,t,n){return n=g(n),p.ib(e,c(t,n,e),n)},p.Oa=function(e,t){1!==t.nodeType&&8!==t.nodeType||d(g(e),t)},p.vc=function(e,i,o){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(!(i=n.body))throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!i||1!==i.nodeType&&8!==i.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");h(g(e,o),i)},p.Dc=function(t){return!t||1!==t.nodeType&&8!==t.nodeType?e:p.Td(t)},p.Ec=function(t){return(t=p.Dc(t))?t.$data:e},p.b("bindingHandlers",p.c),p.b("bindingEvent",p.i),p.b("bindingEvent.subscribe",p.i.subscribe),p.b("bindingEvent.startPossiblyAsyncContentBinding",p.i.Cb),p.b("applyBindings",p.vc),p.b("applyBindingsToDescendants",p.Oa),p.b("applyBindingAccessorsToNode",p.ib),p.b("applyBindingsToNode",p.ld),p.b("contextFor",p.Dc),p.b("dataFor",p.Ec)}(),function(e){function t(t,i){var a,s=Object.prototype.hasOwnProperty.call(r,t)?r[t]:e;s?s.subscribe(i):(s=r[t]=new p.T,s.subscribe(i),n(t,function(e,n){var i=!(!n||!n.synchronous);o[t]={definition:e,Gd:i},delete r[t],a||i?s.notifySubscribers(e):p.na.zb(function(){s.notifySubscribers(e)})}),a=!0)}function n(e,t){i("getConfig",[e],function(n){n?i("loadComponent",[e,n],function(e){t(e,n)}):t(null,null)})}function i(t,n,r,o){o||(o=p.j.loaders.slice(0));var a=o.shift();if(a){var s=a[t];if(s){var l=!1;if(s.apply(a,n.concat(function(e){l?r(null):null!==e?r(e):i(t,n,r,o)}))!==e&&(l=!0,!a.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else i(t,n,r,o)}else r(null)}var r={},o={};p.j={get:function(n,i){var r=Object.prototype.hasOwnProperty.call(o,n)?o[n]:e;r?r.Gd?p.u.G(function(){i(r.definition)}):p.na.zb(function(){i(r.definition)}):t(n,i)},Bc:function(e){delete o[e]},oc:i},p.j.loaders=[],p.b("components",p.j),p.b("components.get",p.j.get),p.b("components.clearCachedDefinition",p.j.Bc)}(),function(){function e(e,t,n,i){function r(){0==--s&&i(o)}var o={},s=2,l=n.template;n=n.viewModel,l?a(t,l,function(t){p.j.oc("loadTemplate",[e,t],function(e){o.template=e,r()})}):r(),n?a(t,n,function(t){p.j.oc("loadViewModel",[e,t],function(e){o[u]=e,r()})}):r()}function i(e,t,n){if("function"==typeof t)n(function(e){return new t(e)});else if("function"==typeof t[u])n(t[u]);else if("instance"in t){var r=t.instance;n(function(){return r})}else"viewModel"in t?i(e,t.viewModel,n):e("Unknown viewModel value: "+t)}function r(e){switch(p.a.R(e)){case"script":return p.a.ua(e.text);case"textarea":return p.a.ua(e.value);case"template":if(o(e.content))return p.a.Ca(e.content.childNodes)}return p.a.Ca(e.childNodes)}function o(e){return t.DocumentFragment?e instanceof DocumentFragment:e&&11===e.nodeType}function a(e,n,i){"string"==typeof n.require?s||t.require?(s||t.require)([n.require],function(e){e&&"object"==typeof e&&e.Xd&&e.default&&(e=e.default),i(e)}):e("Uses require, but no AMD loader is present"):i(n)}function l(e){return function(t){throw Error("Component '"+e+"': "+t)}}var c={};p.j.register=function(e,t){if(!t)throw Error("Invalid configuration for "+e);if(p.j.tb(e))throw Error("Component "+e+" is already registered");c[e]=t},p.j.tb=function(e){return Object.prototype.hasOwnProperty.call(c,e)},p.j.unregister=function(e){delete c[e],p.j.Bc(e)},p.j.Fc={getConfig:function(e,t){t(p.j.tb(e)?c[e]:null)},loadComponent:function(t,n,i){var r=l(t);a(r,n,function(n){e(t,r,n,i)})},loadTemplate:function(e,i,a){if(e=l(e),"string"==typeof i)a(p.a.ua(i));else if(i instanceof Array)a(i);else if(o(i))a(p.a.la(i.childNodes));else if(i.element)if(i=i.element,t.HTMLElement?i instanceof HTMLElement:i&&i.tagName&&1===i.nodeType)a(r(i));else if("string"==typeof i){var s=n.getElementById(i);s?a(r(s)):e("Cannot find element with ID "+i)}else e("Unknown element type: "+i);else e("Unknown template value: "+i)},loadViewModel:function(e,t,n){i(l(e),t,n)}};var u="createViewModel";p.b("components.register",p.j.register),p.b("components.isRegistered",p.j.tb),p.b("components.unregister",p.j.unregister),p.b("components.defaultLoader",p.j.Fc),p.j.loaders.push(p.j.Fc),p.j.dd=c}(),function(){function e(e,n){var i=e.getAttribute("params");if(i){var i=t.parseBindingsString(i,n,e,{valueAccessors:!0,bindingParams:!0}),i=p.a.Ga(i,function(t){return p.o(t,null,{l:e})}),r=p.a.Ga(i,function(t){var n=t.v();return t.ja()?p.o({read:function(){return p.a.f(t())},write:p.Za(n)&&function(e){t()(e)},l:e}):n});return Object.prototype.hasOwnProperty.call(r,"$raw")||(r.$raw=i),r}return{$raw:{}}}p.j.getComponentNameForNode=function(e){var t=p.a.R(e);if(p.j.tb(t)&&(-1!=t.indexOf("-")||"[object HTMLUnknownElement]"==""+e||8>=p.a.W&&e.tagName===t))return t},p.j.tc=function(t,n,i,r){if(1===n.nodeType){var o=p.j.getComponentNameForNode(n);if(o){if(t=t||{},t.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var a={name:o,params:e(n,i)};t.component=r?function(){return a}:a}}return t};var t=new p.ga;9>p.a.W&&(p.j.register=function(e){return function(t){return e.apply(this,arguments)}}(p.j.register),n.createDocumentFragment=function(e){return function(){var t,n=e(),i=p.j.dd;for(t in i);return n}}(n.createDocumentFragment))}(),function(){function e(e,t,n){if(!(t=t.template))throw Error("Component '"+e+"' has no template");e=p.a.Ca(t),p.h.va(n,e)}function t(e,t,n){var i=e.createViewModel;return i?i.call(e,t,n):t}var n=0;p.c.component={init:function(i,r,o,a,s){function l(){var e=c&&c.dispose;"function"==typeof e&&e.call(c),d&&d.s(),u=c=d=null}var c,u,d,h=p.a.la(p.h.childNodes(i));return p.h.Ea(i),p.a.K.za(i,l),p.o(function(){var o,a,f=p.a.f(r());if("string"==typeof f?o=f:(o=p.a.f(f.name),a=p.a.f(f.params)),!o)throw Error("No component name specified");var m=p.i.Cb(i,s),g=u=++n;p.j.get(o,function(n){if(u===g){if(l(),!n)throw Error("Unknown component '"+o+"'");e(o,n,i);var r=t(n,a,{element:i,templateNodes:h});n=m.createChildContext(r,{extend:function(e){e.$component=r,e.$componentTemplateNodes=h}}),r&&r.koDescendantsComplete&&(d=p.i.subscribe(i,p.i.pa,r.koDescendantsComplete,r)),c=r,p.Oa(n,i)}})},null,{l:i}),{controlsDescendantBindings:!0}}},p.h.ea.component=!0}();var S={class:"className",for:"htmlFor"};p.c.attr={update:function(t,n){var i=p.a.f(n())||{};p.a.P(i,function(n,i){i=p.a.f(i);var r=n.indexOf(":"),r="lookupNamespaceURI"in t&&0<r&&t.lookupNamespaceURI(n.substr(0,r)),o=!1===i||null===i||i===e;o?r?t.removeAttributeNS(r,n):t.removeAttribute(n):i=i.toString(),8>=p.a.W&&n in S?(n=S[n],o?t.removeAttribute(n):t[n]=i):o||(r?t.setAttributeNS(r,n,i):t.setAttribute(n,i)),"name"===n&&p.a.Yc(t,o?"":i)})}},function(){p.c.checked={after:["value","attr"],init:function(t,n,i){function r(){var r=t.checked,o=a();if(!p.S.Ya()&&(r||!l&&!p.S.qa())){var c=p.u.G(n);if(u){var h=d?c.v():c,m=f;f=o,m!==o?r&&(p.a.Na(h,o,!0),p.a.Na(h,m,!1)):p.a.Na(h,o,r),d&&p.Za(c)&&c(h)}else s&&(o===e?o=r:r||(o=e)),p.m.eb(c,i,"checked",o,!0)}}function o(){var i=p.a.f(n()),r=a();u?(t.checked=0<=p.a.A(i,r),f=r):t.checked=s&&r===e?!!i:a()===i}var a=p.xb(function(){return i.has("checkedValue")?p.a.f(i.get("checkedValue")):h?i.has("value")?p.a.f(i.get("value")):t.value:void 0}),s="checkbox"==t.type,l="radio"==t.type;if(s||l){var c=n(),u=s&&p.a.f(c)instanceof Array,d=!(u&&c.push&&c.splice),h=l||u,f=u?a():e;l&&!t.name&&p.c.uniqueName.init(t,function(){return!0}),p.o(r,null,{l:t}),p.a.B(t,"click",r),p.o(o,null,{l:t}),c=e}}},p.m.wa.checked=!0,p.c.checkedValue={update:function(e,t){e.value=p.a.f(t())}}}(),p.c.class={update:function(e,t){var n=p.a.Db(p.a.f(t()));p.a.Eb(e,e.__ko__cssValue,!1),e.__ko__cssValue=n,p.a.Eb(e,n,!0)}},p.c.css={update:function(e,t){var n=p.a.f(t());null!==n&&"object"==typeof n?p.a.P(n,function(t,n){n=p.a.f(n),p.a.Eb(e,t,n)}):p.c.class.update(e,t)}},p.c.enable={update:function(e,t){var n=p.a.f(t());n&&e.disabled?e.removeAttribute("disabled"):n||e.disabled||(e.disabled=!0)}},p.c.disable={update:function(e,t){p.c.enable.update(e,function(){return!p.a.f(t())})}},p.c.event={init:function(e,t,n,i,r){var o=t()||{};p.a.P(o,function(o){"string"==typeof o&&p.a.B(e,o,function(e){var a,s=t()[o];if(s){try{var l=p.a.la(arguments);i=r.$data,l.unshift(i),a=s.apply(i,l)}finally{!0!==a&&(e.preventDefault?e.preventDefault():e.returnValue=!1)}!1===n.get(o+"Bubble")&&(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation())}})})}},p.c.foreach={Rc:function(e){return function(){var t=e(),n=p.a.bc(t);return n&&"number"!=typeof n.length?(p.a.f(t),{foreach:n.data,as:n.as,noChildContext:n.noChildContext,includeDestroyed:n.includeDestroyed,afterAdd:n.afterAdd,beforeRemove:n.beforeRemove,afterRender:n.afterRender,beforeMove:n.beforeMove,afterMove:n.afterMove,templateEngine:p.ba.Ma}):{foreach:t,templateEngine:p.ba.Ma}}},init:function(e,t){return p.c.template.init(e,p.c.foreach.Rc(t))},update:function(e,t,n,i,r){return p.c.template.update(e,p.c.foreach.Rc(t),n,i,r)}},p.m.Ra.foreach=!1,p.h.ea.foreach=!0,p.c.hasfocus={init:function(e,t,n){function i(i){e.__ko_hasfocusUpdating=!0;var r=e.ownerDocument;if("activeElement"in r){var o;try{o=r.activeElement}catch(e){o=r.body}i=o===e}r=t(),p.m.eb(r,n,"hasfocus",i,!0),e.__ko_hasfocusLastValue=i,e.__ko_hasfocusUpdating=!1}var r=i.bind(null,!0),o=i.bind(null,!1);p.a.B(e,"focus",r),p.a.B(e,"focusin",r),p.a.B(e,"blur",o),p.a.B(e,"focusout",o),e.__ko_hasfocusLastValue=!1},update:function(e,t){var n=!!p.a.f(t());e.__ko_hasfocusUpdating||e.__ko_hasfocusLastValue===n||(n?e.focus():e.blur(),!n&&e.__ko_hasfocusLastValue&&e.ownerDocument.body.focus(),p.u.G(p.a.Fb,null,[e,n?"focusin":"focusout"]))}},p.m.wa.hasfocus=!0,p.c.hasFocus=p.c.hasfocus,p.m.wa.hasFocus="hasfocus",p.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){p.a.fc(e,t())}},function(){function e(e,t,n){p.c[e]={init:function(e,i,r,o,a){var s,l,c,u,d,h={};if(t){o=r.get("as");var f=r.get("noChildContext");d=!(o&&f),h={as:o,noChildContext:f,exportDependencies:d}}return u=(c="render"==r.get("completeOn"))||r.has(p.i.pa),p.o(function(){var r,o=p.a.f(i()),f=!n!=!o,m=!l;(d||f!==s)&&(u&&(a=p.i.Cb(e,a)),f&&(t&&!d||(h.dataDependency=p.S.o()),r=t?a.createChildContext("function"==typeof o?o:i,h):p.S.qa()?a.extend(null,h):a),m&&p.S.qa()&&(l=p.a.Ca(p.h.childNodes(e),!0)),f?(m||p.h.va(e,p.a.Ca(l)),p.Oa(r,e)):(p.h.Ea(e),c||p.i.ma(e,p.i.H)),s=f)},null,{l:e}),{controlsDescendantBindings:!0}}},p.m.Ra[e]=!1,p.h.ea[e]=!0}e("if"),e("ifnot",!1,!0),e("with",!0)}(),p.c.let={init:function(e,t,n,i,r){return t=r.extend(t),p.Oa(t,e),{controlsDescendantBindings:!0}}},p.h.ea.let=!0;var E={};p.c.options={init:function(e){if("select"!==p.a.R(e))throw Error("options binding applies only to SELECT elements");for(;0<e.length;)e.remove(0);return{controlsDescendantBindings:!0}},update:function(t,n,i){function r(){return p.a.jb(t.options,function(e){return e.selected})}function o(e,t,n){var i=typeof t;return"function"==i?t(e):"string"==i?e[t]:n}function a(e,n){if(m&&u)p.i.ma(t,p.i.H);else if(f.length){var i=0<=p.a.A(f,p.w.M(n[0]));p.a.Zc(n[0],i),m&&!i&&p.u.G(p.a.Fb,null,[t,"change"])}}var s=t.multiple,l=0!=t.length&&s?t.scrollTop:null,c=p.a.f(n()),u=i.get("valueAllowUnset")&&i.has("value"),d=i.get("optionsIncludeDestroyed");n={};var h,f=[];u||(s?f=p.a.Mb(r(),p.w.M):0<=t.selectedIndex&&f.push(p.w.M(t.options[t.selectedIndex]))),c&&(void 0===c.length&&(c=[c]),h=p.a.jb(c,function(t){return d||t===e||null===t||!p.a.f(t._destroy)}),i.has("optionsCaption")&&null!==(c=p.a.f(i.get("optionsCaption")))&&c!==e&&h.unshift(E));var m=!1;if(n.beforeRemove=function(e){t.removeChild(e)},c=a,i.has("optionsAfterRender")&&"function"==typeof i.get("optionsAfterRender")&&(c=function(t,n){a(0,n),p.u.G(i.get("optionsAfterRender"),null,[n[0],t!==E?t:e])}),p.a.ec(t,h,function(n,r,a){return a.length&&(f=!u&&a[0].selected?[p.w.M(a[0])]:[],m=!0),r=t.ownerDocument.createElement("option"),n===E?(p.a.Bb(r,i.get("optionsCaption")),p.w.cb(r,e)):(a=o(n,i.get("optionsValue"),n),p.w.cb(r,p.a.f(a)),n=o(n,i.get("optionsText"),a),p.a.Bb(r,n)),[r]},n,c),!u){var g;g=s?f.length&&r().length<f.length:f.length&&0<=t.selectedIndex?p.w.M(t.options[t.selectedIndex])!==f[0]:f.length||0<=t.selectedIndex,g&&p.u.G(p.a.Fb,null,[t,"change"])}(u||p.S.Ya())&&p.i.ma(t,p.i.H),p.a.wd(t),l&&20<Math.abs(l-t.scrollTop)&&(t.scrollTop=l)}},p.c.options.$b=p.a.g.Z(),p.c.selectedOptions={init:function(e,t,n){function i(){var i=t(),r=[];p.a.D(e.getElementsByTagName("option"),function(e){e.selected&&r.push(p.w.M(e))}),p.m.eb(i,n,"selectedOptions",r)}function r(){var n=p.a.f(t()),i=e.scrollTop;n&&"number"==typeof n.length&&p.a.D(e.getElementsByTagName("option"),function(e){var t=0<=p.a.A(n,p.w.M(e));e.selected!=t&&p.a.Zc(e,t)}),e.scrollTop=i}if("select"!=p.a.R(e))throw Error("selectedOptions binding applies only to SELECT elements");var o;p.i.subscribe(e,p.i.H,function(){o?i():(p.a.B(e,"change",i),o=p.o(r,null,{l:e}))},null,{notifyImmediately:!0})},update:function(){}},p.m.wa.selectedOptions=!0,p.c.style={update:function(t,n){var i=p.a.f(n()||{});p.a.P(i,function(n,i){if(i=p.a.f(i),null!==i&&i!==e&&!1!==i||(i=""),r)r(t).css(n,i);else if(/^--/.test(n))t.style.setProperty(n,i);else{n=n.replace(/-(\w)/g,function(e,t){return t.toUpperCase()});var o=t.style[n];t.style[n]=i,i===o||t.style[n]!=o||isNaN(i)||(t.style[n]=i+"px")}})}},p.c.submit={init:function(e,t,n,i,r){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");p.a.B(e,"submit",function(n){var i,o=t();try{i=o.call(r.$data,e)}finally{!0!==i&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}})}},p.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(e,t){p.a.Bb(e,t())}},p.h.ea.text=!0,function(){if(t&&t.navigator){var n,i,r,o,a,s=function(e){if(e)return parseFloat(e[1])},l=t.navigator.userAgent;(n=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(a=s(l.match(/Edge\/([^ ]+)$/)))||s(l.match(/Chrome\/([^ ]+)/))||(i=s(l.match(/Version\/([^ ]+) Safari/)))||(r=s(l.match(/Firefox\/([^ ]+)/)))||(o=p.a.W||s(l.match(/MSIE ([^ ]+)/)))||(o=s(l.match(/rv:([^ )]+)/)))}if(8<=o&&10>o)var c=p.a.g.Z(),u=p.a.g.Z(),d=function(e){var t=this.activeElement;(t=t&&p.a.g.get(t,u))&&t(e)},h=function(e,t){var n=e.ownerDocument;p.a.g.get(n,c)||(p.a.g.set(n,c,!0),p.a.B(n,"selectionchange",d)),p.a.g.set(e,u,t)};p.c.textInput={init:function(t,s,l){function c(e,n){p.a.B(t,e,n)}function u(){var n=p.a.f(s());null!==n&&n!==e||(n=""),g!==e&&n===g?p.a.setTimeout(u,4):t.value!==n&&(y=!0,t.value=n,y=!1,v=t.value)}function d(){m||(g=t.value,m=p.a.setTimeout(f,4))}function f(){clearTimeout(m),g=m=e;var n=t.value;v!==n&&(v=n,p.m.eb(s(),l,"textInput",n))}var m,g,v=t.value,b=9==p.a.W?d:f,y=!1;o&&c("keypress",f),11>o&&c("propertychange",function(e){y||"value"!==e.propertyName||b(e)}),8==o&&(c("keyup",f),c("keydown",f)),h&&(h(t,b),c("dragend",d)),(!o||9<=o)&&c("input",b),5>i&&"textarea"===p.a.R(t)?(c("keydown",d),c("paste",d),c("cut",d)):11>n?c("keydown",d):4>r?(c("DOMAutoComplete",f),c("dragdrop",f),c("drop",f)):a&&"number"===t.type&&c("keydown",d),c("change",f),c("blur",f),p.o(u,null,{l:t})}},p.m.wa.textInput=!0,p.c.textinput={preprocess:function(e,t,n){n("textInput",e)}}}(),p.c.uniqueName={init:function(e,t){if(t()){var n="ko_unique_"+ ++p.c.uniqueName.rd;p.a.Yc(e,n)}}},p.c.uniqueName.rd=0,p.c.using={init:function(e,t,n,i,r){var o;return n.has("as")&&(o={as:n.get("as"),noChildContext:n.get("noChildContext")}),t=r.createChildContext(t,o),p.Oa(t,e),{controlsDescendantBindings:!0}}},p.h.ea.using=!0,p.c.value={init:function(t,n,i){var r=p.a.R(t),o="input"==r;if(!o||"checkbox"!=t.type&&"radio"!=t.type){var a=[],s=i.get("valueUpdate"),l=!1,c=null;s&&(a="string"==typeof s?[s]:p.a.wc(s),p.a.Pa(a,"change"));var u=function(){c=null,l=!1;var e=n(),r=p.w.M(t);p.m.eb(e,i,"value",r)};!p.a.W||!o||"text"!=t.type||"off"==t.autocomplete||t.form&&"off"==t.form.autocomplete||-1!=p.a.A(a,"propertychange")||(p.a.B(t,"propertychange",function(){l=!0}),p.a.B(t,"focus",function(){l=!1}),p.a.B(t,"blur",function(){l&&u()})),p.a.D(a,function(e){var n=u;p.a.Ud(e,"after")&&(n=function(){c=p.w.M(t),p.a.setTimeout(u,0)},e=e.substring(5)),p.a.B(t,e,n)});var d;if(d=o&&"file"==t.type?function(){var i=p.a.f(n());null===i||i===e||""===i?t.value="":p.u.G(u)}:function(){var o=p.a.f(n()),a=p.w.M(t);null!==c&&o===c?p.a.setTimeout(d,0):o===a&&a!==e||("select"===r?(a=i.get("valueAllowUnset"),p.w.cb(t,o,a),a||o===p.w.M(t)||p.u.G(u)):p.w.cb(t,o))},"select"===r){var h;p.i.subscribe(t,p.i.H,function(){h?i.get("valueAllowUnset")?d():u():(p.a.B(t,"change",u),h=p.o(d,null,{l:t}))},null,{notifyImmediately:!0})}else p.a.B(t,"change",u),p.o(d,null,{l:t})}else p.ib(t,{checkedValue:n})},update:function(){}},p.m.wa.value=!0,p.c.visible={update:function(e,t){var n=p.a.f(t()),i="none"!=e.style.display;n&&!i?e.style.display="":!n&&i&&(e.style.display="none")}},p.c.hidden={update:function(e,t){p.c.visible.update(e,function(){return!p.a.f(t())})}},function(e){p.c[e]={init:function(t,n,i,r,o){return p.c.event.init.call(this,t,function(){var t={};return t[e]=n(),t},i,r,o)}}}("click"),p.ca=function(){},p.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},p.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},p.ca.prototype.makeTemplateSource=function(e,t){if("string"==typeof e){t=t||n;var i=t.getElementById(e);if(!i)throw Error("Cannot find template with ID "+e);return new p.C.F(i)}if(1==e.nodeType||8==e.nodeType)return new p.C.ia(e);throw Error("Unknown template type: "+e)},p.ca.prototype.renderTemplate=function(e,t,n,i){return e=this.makeTemplateSource(e,i),this.renderTemplateSource(e,t,n,i)},p.ca.prototype.isTemplateRewritten=function(e,t){return!1===this.allowTemplateRewriting||this.makeTemplateSource(e,t).data("isRewritten")},p.ca.prototype.rewriteTemplate=function(e,t,n){e=this.makeTemplateSource(e,n),t=t(e.text()),e.text(t),e.data("isRewritten",!0)},p.b("templateEngine",p.ca),p.kc=function(){function e(e,t,n,i){e=p.m.ac(e);for(var r=p.m.Ra,o=0;o<e.length;o++){var a=e[o].key;if(Object.prototype.hasOwnProperty.call(r,a)){var s=r[a];if("function"==typeof s){if(a=s(e[o].value))throw Error(a)}else if(!s)throw Error("This template engine does not support the '"+a+"' binding within its templates")}}return n="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+p.m.vb(e,{valueAccessors:!0})+" } })()},'"+n.toLowerCase()+"')",i.createJavaScriptEvaluatorBlock(n)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,n=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(e,t,n){t.isTemplateRewritten(e,n)||t.rewriteTemplate(e,function(e){return p.kc.Ld(e,t)},n)},Ld:function(i,r){return i.replace(t,function(t,n,i,o,a){return e(a,n,i,r)}).replace(n,function(t,n){return e(n,"\x3c!-- ko --\x3e","#comment",r)})},md:function(e,t){return p.aa.Xb(function(n,i){var r=n.nextSibling;r&&r.nodeName.toLowerCase()===t&&p.ib(r,e,i)})}}}(),p.b("__tr_ambtns",p.kc.md),function(){p.C={},p.C.F=function(e){if(this.F=e){var t=p.a.R(e)
;this.ab="script"===t?1:"textarea"===t?2:"template"==t&&e.content&&11===e.content.nodeType?3:4}},p.C.F.prototype.text=function(){var e=1===this.ab?"text":2===this.ab?"value":"innerHTML";if(0==arguments.length)return this.F[e];var t=arguments[0];"innerHTML"===e?p.a.fc(this.F,t):this.F[e]=t};var t=p.a.g.Z()+"_";p.C.F.prototype.data=function(e){if(1===arguments.length)return p.a.g.get(this.F,t+e);p.a.g.set(this.F,t+e,arguments[1])};var n=p.a.g.Z();p.C.F.prototype.nodes=function(){var t=this.F;if(0==arguments.length){var i=p.a.g.get(t,n)||{},r=i.lb||(3===this.ab?t.content:4===this.ab?t:e);if(!r||i.jd){var o=this.text();o&&o!==i.bb&&(r=p.a.Md(o,t.ownerDocument),p.a.g.set(t,n,{lb:r,bb:o,jd:!0}))}return r}i=arguments[0],this.ab!==e&&this.text(""),p.a.g.set(t,n,{lb:i})},p.C.ia=function(e){this.F=e},p.C.ia.prototype=new p.C.F,p.C.ia.prototype.constructor=p.C.ia,p.C.ia.prototype.text=function(){if(0==arguments.length){var t=p.a.g.get(this.F,n)||{};return t.bb===e&&t.lb&&(t.bb=t.lb.innerHTML),t.bb}p.a.g.set(this.F,n,{bb:arguments[0]})},p.b("templateSources",p.C),p.b("templateSources.domElement",p.C.F),p.b("templateSources.anonymousTemplate",p.C.ia)}(),function(){function t(e,t,n){var i;for(t=p.h.nextSibling(t);e&&(i=e)!==t;)e=p.h.nextSibling(i),n(i,e)}function n(e,n){if(e.length){var i=e[0],r=e[e.length-1],o=i.parentNode,a=p.ga.instance,s=a.preprocessNode;if(s){if(t(i,r,function(e,t){var n=e.previousSibling,o=s.call(a,e);o&&(e===i&&(i=o[0]||t),e===r&&(r=o[o.length-1]||n))}),e.length=0,!i)return;i===r?e.push(i):(e.push(i,r),p.a.Ua(e,o))}t(i,r,function(e){1!==e.nodeType&&8!==e.nodeType||p.vc(n,e)}),t(i,r,function(e){1!==e.nodeType&&8!==e.nodeType||p.aa.cd(e,[n])}),p.a.Ua(e,o)}}function i(e){return e.nodeType?e:0<e.length?e[0]:null}function r(e,t,r,o,s){s=s||{};var l=(e&&i(e)||r||{}).ownerDocument,c=s.templateEngine||a;if(p.kc.xd(r,c,l),r=c.renderTemplate(r,o,s,l),"number"!=typeof r.length||0<r.length&&"number"!=typeof r[0].nodeType)throw Error("Template engine must return an array of DOM nodes");switch(l=!1,t){case"replaceChildren":p.h.va(e,r),l=!0;break;case"replaceNode":p.a.Xc(e,r),l=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+t)}return l&&(n(r,o),s.afterRender&&p.u.G(s.afterRender,null,[r,o[s.as||"$data"]]),"replaceChildren"==t&&p.i.ma(e,p.i.H)),r}function o(e,t,n){return p.O(e)?e():"function"==typeof e?e(t,n):e}var a;p.gc=function(t){if(t!=e&&!(t instanceof p.ca))throw Error("templateEngine must inherit from ko.templateEngine");a=t},p.dc=function(t,n,s,l,c){if(s=s||{},(s.templateEngine||a)==e)throw Error("Set a template engine before calling renderTemplate");if(c=c||"replaceChildren",l){var u=i(l);return p.$(function(){var e=n&&n instanceof p.fa?n:new p.fa(n,null,null,null,{exportDependencies:!0}),a=o(t,e.$data,e),e=r(l,c,a,e,s);"replaceNode"==c&&(l=e,u=i(l))},null,{Sa:function(){return!u||!p.a.Sb(u)},l:u&&"replaceNode"==c?u.parentNode:u})}return p.aa.Xb(function(e){p.dc(t,n,s,e,"replaceNode")})},p.Qd=function(t,i,a,s,l){function c(e,t){p.u.G(p.a.ec,null,[s,e,d,a,u,t]),p.i.ma(s,p.i.H)}function u(e,t){n(t,h),a.afterRender&&a.afterRender(t,e),h=null}function d(e,n){h=l.createChildContext(e,{as:f,noChildContext:a.noChildContext,extend:function(e){e.$index=n,f&&(e[f+"Index"]=n)}});var i=o(t,e,h);return r(s,"ignoreTargetNode",i,h,a)}var h,f=a.as,m=!1===a.includeDestroyed||p.options.foreachHidesDestroyed&&!a.includeDestroyed;if(m||a.beforeRemove||!p.Pc(i))return p.$(function(){var t=p.a.f(i)||[];void 0===t.length&&(t=[t]),m&&(t=p.a.jb(t,function(t){return t===e||null===t||!p.a.f(t._destroy)})),c(t)},null,{l:s});c(i.v());var g=i.subscribe(function(e){c(i(),e)},null,"arrayChange");return g.l(s),g};var s=p.a.g.Z(),l=p.a.g.Z();p.c.template={init:function(e,t){var n=p.a.f(t());if("string"==typeof n||"name"in n)p.h.Ea(e);else if("nodes"in n){if(n=n.nodes||[],p.O(n))throw Error('The "nodes" option must be a plain, non-observable array.');var i=n[0]&&n[0].parentNode;i&&p.a.g.get(i,l)||(i=p.a.Yb(n),p.a.g.set(i,l,!0)),new p.C.ia(e).nodes(i)}else{if(n=p.h.childNodes(e),!(0<n.length))throw Error("Anonymous template defined, but no template content was provided");i=p.a.Yb(n),new p.C.ia(e).nodes(i)}return{controlsDescendantBindings:!0}},update:function(t,n,i,r,o){var a=n();n=p.a.f(a),i=!0,r=null,"string"==typeof n?n={}:(a="name"in n?n.name:t,"if"in n&&(i=p.a.f(n.if)),i&&"ifnot"in n&&(i=!p.a.f(n.ifnot)),i&&!a&&(i=!1)),"foreach"in n?r=p.Qd(a,i&&n.foreach||[],n,t,o):i?(i=o,"data"in n&&(i=o.createChildContext(n.data,{as:n.as,noChildContext:n.noChildContext,exportDependencies:!0})),r=p.dc(a,i,n,t)):p.h.Ea(t),o=r,(n=p.a.g.get(t,s))&&"function"==typeof n.s&&n.s(),p.a.g.set(t,s,!o||o.ja&&!o.ja()?e:o)}},p.m.Ra.template=function(e){return e=p.m.ac(e),1==e.length&&e[0].unknown||p.m.Id(e,"name")?null:"This template engine does not support anonymous templates nested within its templates"},p.h.ea.template=!0}(),p.b("setTemplateEngine",p.gc),p.b("renderTemplate",p.dc),p.a.Kc=function(e,t,n){if(e.length&&t.length){var i,r,o,a,s;for(i=r=0;(!n||i<n)&&(a=e[r]);++r){for(o=0;s=t[o];++o)if(a.value===s.value){a.moved=s.index,s.moved=a.index,t.splice(o,1),i=o=0;break}i+=o}}},p.a.Pb=function(){function e(e,t,n,i,r){var o,a,s,l,c,u=Math.min,d=Math.max,h=[],f=e.length,m=t.length,g=m-f||1,v=f+m+1;for(o=0;o<=f;o++)for(l=s,h.push(s=[]),c=u(m,o+g),a=d(0,o-1);a<=c;a++)s[a]=a?o?e[o-1]===t[a-1]?l[a-1]:u(l[a]||v,s[a-1]||v)+1:a+1:o+1;for(u=[],d=[],g=[],o=f,a=m;o||a;)m=h[o][a]-1,a&&m===h[o][a-1]?d.push(u[u.length]={status:n,value:t[--a],index:a}):o&&m===h[o-1][a]?g.push(u[u.length]={status:i,value:e[--o],index:o}):(--a,--o,r.sparse||u.push({status:"retained",value:t[a]}));return p.a.Kc(g,d,!r.dontLimitMoves&&10*f),u.reverse()}return function(t,n,i){return i="boolean"==typeof i?{dontLimitMoves:i}:i||{},t=t||[],n=n||[],t.length<n.length?e(t,n,"added","deleted",i):e(n,t,"deleted","added",i)}}(),p.b("utils.compareArrays",p.a.Pb),function(){function t(t,n,i,r,o){var a=[],s=p.$(function(){var e=n(i,o,p.a.Ua(a,t))||[];0<a.length&&(p.a.Xc(a,e),r&&p.u.G(r,null,[i,e,o])),a.length=0,p.a.Nb(a,e)},null,{l:t,Sa:function(){return!p.a.kd(a)}});return{Y:a,$:s.ja()?s:e}}var n=p.a.g.Z(),i=p.a.g.Z();p.a.ec=function(r,o,a,s,l,c){function u(e){f={Aa:e,pb:p.ta(y++)},v.push(f),g||_.push(f)}function d(e){f=m[e],y!==f.pb.v()&&k.push(f),f.pb(y++),p.a.Ua(f.Y,r),v.push(f)}function h(e,t){if(e)for(var n=0,i=t.length;n<i;n++)p.a.D(t[n].Y,function(i){e(i,n,t[n].Aa)})}o=o||[],void 0===o.length&&(o=[o]),s=s||{};var f,m=p.a.g.get(r,n),g=!m,v=[],b=0,y=0,w=[],x=[],C=[],k=[],_=[],S=0;if(g)p.a.D(o,u);else{if(!c||m&&m._countWaitingForRemove){var E=p.a.Mb(m,function(e){return e.Aa});c=p.a.Pb(E,o,{dontLimitMoves:s.dontLimitMoves,sparse:!0})}for(var T,D,$,E=0;T=c[E];E++)switch(D=T.moved,$=T.index,T.status){case"deleted":for(;b<$;)d(b++);D===e&&(f=m[b],f.$&&(f.$.s(),f.$=e),p.a.Ua(f.Y,r).length&&(s.beforeRemove&&(v.push(f),S++,f.Aa===i?f=null:C.push(f)),f&&w.push.apply(w,f.Y))),b++;break;case"added":for(;y<$;)d(b++);D!==e?(x.push(v.length),d(D)):u(T.value)}for(;y<o.length;)d(b++);v._countWaitingForRemove=S}p.a.g.set(r,n,v),h(s.beforeMove,k),p.a.D(w,s.beforeRemove?p.oa:p.removeNode);var A,j,P;try{P=r.ownerDocument.activeElement}catch(e){}if(x.length)for(;(E=x.shift())!=e;){for(f=v[E],A=e;E;)if((j=v[--E].Y)&&j.length){A=j[j.length-1];break}for(o=0;b=f.Y[o];A=b,o++)p.h.Wb(r,b,A)}for(E=0;f=v[E];E++){for(f.Y||p.a.extend(f,t(r,a,f.Aa,l,f.pb)),o=0;b=f.Y[o];A=b,o++)p.h.Wb(r,b,A);!f.Ed&&l&&(l(f.Aa,f.Y,f.pb),f.Ed=!0,A=f.Y[f.Y.length-1])}for(P&&r.ownerDocument.activeElement!=P&&P.focus(),h(s.beforeRemove,C),E=0;E<C.length;++E)C[E].Aa=i;h(s.afterMove,k),h(s.afterAdd,_)}}(),p.b("utils.setDomNodeChildrenFromArrayMapping",p.a.ec),p.ba=function(){this.allowTemplateRewriting=!1},p.ba.prototype=new p.ca,p.ba.prototype.constructor=p.ba,p.ba.prototype.renderTemplateSource=function(e,t,n,i){return(t=(9>p.a.W?0:e.nodes)?e.nodes():null)?p.a.la(t.cloneNode(!0).childNodes):(e=e.text(),p.a.ua(e,i))},p.ba.Ma=new p.ba,p.gc(p.ba.Ma),p.b("nativeTemplateEngine",p.ba),function(){p.$a=function(){var e=this.Hd=function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(e){}return 1}();this.renderTemplateSource=function(t,i,o,a){if(a=a||n,o=o||{},2>e)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var s=t.data("precompiled");return s||(s=t.text()||"",s=r.template(null,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),t.data("precompiled",s)),t=[i.$data],i=r.extend({koBindingContext:i},o.templateOptions),i=r.tmpl(s,t,i),i.appendTo(a.createElement("div")),r.fragments={},i},this.createJavaScriptEvaluatorBlock=function(e){return"{{ko_code ((function() { return "+e+" })()) }}"},this.addTemplate=function(e,t){n.write("<script type='text/html' id='"+e+"'>"+t+"<\/script>")},0<e&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},p.$a.prototype=new p.ca,p.$a.prototype.constructor=p.$a;var e=new p.$a;0<e.Hd&&p.gc(e),p.b("jqueryTmplTemplateEngine",p.$a)}()})}()}(),define("pgui.change_password_dialog",["pgui.utils","pgui.localizer","bootstrap"],function(e,t){window.PhpGenChangePasswordDialogAdminStrategy=function(e){this.onChangePasswordCallback=e,this.initializeDialog=function(){$("#pg-change-password-dialog-header-admin").show(),$("#pg-change-password-dialog-header-user").hide(),$("#pg-change-password-dialog-current-password-form-group").hide()},this.callChangePasswordCallback=function(e,t){return this.onChangePasswordCallback(t)}},window.PhpGenChangePasswordDialogUserStrategy=function(e){this.onChangePasswordCallback=e,this.initializeDialog=function(){$("#pg-change-password-dialog-header-admin").hide(),$("#pg-change-password-dialog-header-user").show(),$("#pg-change-password-dialog-current-password-form-group").show()},this.callChangePasswordCallback=function(e,t){return this.onChangePasswordCallback(e,t)}},window.PhpGenChangePasswordDialog={initialize:function(e){this.dialog=$("#pg-change-password-dialog"),this.userStrategy=e,this.currentPassword=$("#pg-change-password-dialog-current-password"),this.newPassword=$("#pg-change-password-dialog-new-password"),this.confirmedPassword=$("#pg-change-password-dialog-confirmed-password"),this.confirmedPasswordErrorControl=$("#pg-change-password-dialog-confirmed-password-error"),this.dialog.modal("hide"),this.userStrategy.initializeDialog(),$("#pg-change-password-dialog-ok-button").off("click").on("click",function(e){this.onChangePasswordClick(e)}.bind(this))},open:function(){this.clearPasswordElements(),this.confirmedPasswordErrorControl.hide(),this.dialog.modal("show"),this.dialog.find("input:visible:first").focus()},clearPasswordElements:function(){this.currentPassword.val(""),this.newPassword.val(""),this.confirmedPassword.val("")},onChangePasswordClick:function(n){n.preventDefault(),PhpGenPasswordDialogUtils.validateConfirmedPassword(this.newPassword.val(),this.confirmedPassword.val(),this.confirmedPasswordErrorControl)&&this.userStrategy.callChangePasswordCallback(this.currentPassword.val(),this.newPassword.val()).fail(function(t){e.showErrorMessage(t)}).done(function(){this.dialog.modal("hide"),e.showSuccessMessage(t.getString("PasswordChanged"))}.bind(this))}}}),!function(){function e(e,t,r){if(i)for(var o=i.length;o--;){var a=i[o];n.call(e,a)&&t.call(r,a,e[a])}}this.MooTools={version:"1.6.0",build:"529422872adfff401b901b8b6c7ca5114ee95e2b"};var t=this.typeOf=function(e){if(null==e)return"null";if(null!=e.$family)return e.$family();if(e.nodeName){if(1==e.nodeType)return"element";if(3==e.nodeType)return/\S/.test(e.nodeValue)?"textnode":"whitespace"}else if("number"==typeof e.length){if("callee"in e)return"arguments";if("item"in e)return"collection"}return typeof e},n=(this.instanceOf=function(e,t){if(null==e)return!1;for(var n=e.$constructor||e.constructor;n;){if(n===t)return!0;n=n.parent}return!!e.hasOwnProperty&&e instanceof t},Object.prototype.hasOwnProperty),i=!0;for(var r in{toString:1})i=null;i&&(i=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"]);var o=this.Function;o.prototype.overloadSetter=function(t){var n=this;return function(i,r){if(null==i)return this;if(t||"string"!=typeof i){for(var o in i)n.call(this,o,i[o]);e(i,n,this)}else n.call(this,i,r);return this}},o.prototype.overloadGetter=function(e){var t=this;return function(n){var i,r;if("string"!=typeof n?i=n:arguments.length>1?i=arguments:e&&(i=[n]),i){r={};for(var o=0;o<i.length;o++)r[i[o]]=t.call(this,i[o])}else r=t.call(this,n);return r}},o.prototype.extend=function(e,t){this[e]=t}.overloadSetter(),o.prototype.implement=function(e,t){this.prototype[e]=t}.overloadSetter();var a=Array.prototype.slice;Array.convert=function(e){return null==e?[]:s.isEnumerable(e)&&"string"!=typeof e?"array"==t(e)?e:a.call(e):[e]},o.convert=function(e){return"function"==t(e)?e:function(){return e}},Number.convert=function(e){var t=parseFloat(e);return isFinite(t)?t:null},String.convert=function(e){return e+""},o.from=o.convert,Number.from=Number.convert,String.from=String.convert,o.implement({hide:function(){return this.$hidden=!0,this},protect:function(){return this.$protected=!0,this}});var s=this.Type=function(e,n){if(e){var i=e.toLowerCase(),r=function(e){return t(e)==i};s["is"+e]=r,null!=n&&(n.prototype.$family=function(){return i}.hide())}return null==n?null:(n.extend(this),n.$constructor=s,n.prototype.$constructor=n,n)},l=Object.prototype.toString;s.isEnumerable=function(e){return null!=e&&"number"==typeof e.length&&"[object Function]"!=l.call(e)};var c={},u=function(e){var n=t(e.prototype);return c[n]||(c[n]=[])},d=function(e,n){if(!n||!n.$hidden){for(var i=u(this),r=0;r<i.length;r++){var o=i[r];"type"==t(o)?d.call(o,e,n):o.call(this,e,n)}var s=this.prototype[e];null!=s&&s.$protected||(this.prototype[e]=n),null==this[e]&&"function"==t(n)&&h.call(this,e,function(e){return n.apply(e,a.call(arguments,1))})}},h=function(e,t){if(!t||!t.$hidden){var n=this[e];null!=n&&n.$protected||(this[e]=t)}};s.implement({implement:d.overloadSetter(),extend:h.overloadSetter(),alias:function(e,t){d.call(this,e,this.prototype[t])}.overloadSetter(),mirror:function(e){return u(this).push(e),this}}),new s("Type",s);var f=function(e,t,n){var i=t!=Object,r=t.prototype;i&&(t=new s(e,t));for(var o=0,a=n.length;a>o;o++){var l=n[o],c=t[l],u=r[l];c&&c.protect(),i&&u&&t.implement(l,u.protect())}if(i){var d=r.propertyIsEnumerable(n[0]);t.forEachMethod=function(e){if(!d)for(var t=0,i=n.length;i>t;t++)e.call(r,r[n[t]],n[t]);for(var o in r)e.call(r,r[o],o)}}return f};f("String",String,["charAt","charCodeAt","concat","contains","indexOf","lastIndexOf","match","quote","replace","search","slice","split","substr","substring","trim","toLowerCase","toUpperCase"])("Array",Array,["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice","indexOf","lastIndexOf","filter","forEach","every","map","some","reduce","reduceRight","contains"])("Number",Number,["toExponential","toFixed","toLocaleString","toPrecision"])("Function",o,["apply","call","bind"])("RegExp",RegExp,["exec","test"])("Object",Object,["create","defineProperty","defineProperties","keys","getPrototypeOf","getOwnPropertyDescriptor","getOwnPropertyNames","preventExtensions","isExtensible","seal","isSealed","freeze","isFrozen"])("Date",Date,["now"]),Object.extend=h.overloadSetter(),Date.extend("now",function(){return+new Date}),new s("Boolean",Boolean),Number.prototype.$family=function(){return isFinite(this)?"number":"null"}.hide(),Number.extend("random",function(e,t){return Math.floor(Math.random()*(t-e+1)+e)}),Array.implement({forEach:function(e,t){for(var n=0,i=this.length;i>n;n++)n in this&&e.call(t,this[n],n,this)},each:function(e,t){return Array.forEach(this,e,t),this}}),Object.extend({keys:function(t){var i=[];for(var r in t)n.call(t,r)&&i.push(r);return e(t,function(e){i.push(e)}),i},forEach:function(e,t,n){Object.keys(e).forEach(function(i){t.call(n,e[i],i,e)})}}),Object.each=Object.forEach;var p=function(e){switch(t(e)){case"array":return e.clone();case"object":return Object.clone(e);default:return e}};Array.implement("clone",function(){for(var e=this.length,t=new Array(e);e--;)t[e]=p(this[e]);return t});var m=function(e,n,i){switch(t(i)){case"object":"object"==t(e[n])?Object.merge(e[n],i):e[n]=Object.clone(i);break;case"array":e[n]=i.clone();break;default:e[n]=i}return e};Object.extend({merge:function(e,n,i){if("string"==t(n))return m(e,n,i);for(var r=1,o=arguments.length;o>r;r++){var a=arguments[r];for(var s in a)m(e,s,a[s])}return e},clone:function(e){var t={};for(var n in e)t[n]=p(e[n]);return t},append:function(e){for(var t=1,n=arguments.length;n>t;t++){var i=arguments[t]||{};for(var r in i)e[r]=i[r]}return e}}),["Object","WhiteSpace","TextNode","Collection","Arguments"].each(function(e){new s(e)});var g=Date.now();String.extend("uniqueID",function(){return(g++).toString(36)})}(),Array.implement({every:function(e,t){for(var n=0,i=this.length>>>0;i>n;n++)if(n in this&&!e.call(t,this[n],n,this))return!1;return!0},filter:function(e,t){for(var n,i=[],r=0,o=this.length>>>0;o>r;r++)r in this&&(n=this[r],e.call(t,n,r,this)&&i.push(n));return i},indexOf:function(e,t){for(var n=this.length>>>0,i=0>t?Math.max(0,n+t):t||0;n>i;i++)if(this[i]===e)return i;return-1},map:function(e,t){for(var n=this.length>>>0,i=Array(n),r=0;n>r;r++)r in this&&(i[r]=e.call(t,this[r],r,this));return i},some:function(e,t){for(var n=0,i=this.length>>>0;i>n;n++)if(n in this&&e.call(t,this[n],n,this))return!0;return!1},clean:function(){return this.filter(function(e){return null!=e})},invoke:function(e){var t=Array.slice(arguments,1);return this.map(function(n){return n[e].apply(n,t)})},associate:function(e){for(var t={},n=Math.min(this.length,e.length),i=0;n>i;i++)t[e[i]]=this[i];return t},link:function(e){for(var t={},n=0,i=this.length;i>n;n++)for(var r in e)if(e[r](this[n])){t[r]=this[n],delete e[r];break}return t},contains:function(e,t){return-1!=this.indexOf(e,t)},append:function(e){return this.push.apply(this,e),this},getLast:function(){return this.length?this[this.length-1]:null},getRandom:function(){return this.length?this[Number.random(0,this.length-1)]:null},include:function(e){return this.contains(e)||this.push(e),this},combine:function(e){for(var t=0,n=e.length;n>t;t++)this.include(e[t]);return this},erase:function(e){for(var t=this.length;t--;)this[t]===e&&this.splice(t,1);return this},empty:function(){return this.length=0,this},flatten:function(){for(var e=[],t=0,n=this.length;n>t;t++){var i=typeOf(this[t]);"null"!=i&&(e=e.concat("array"==i||"collection"==i||"arguments"==i||instanceOf(this[t],Array)?Array.flatten(this[t]):this[t]))}return e},pick:function(){for(var e=0,t=this.length;t>e;e++)if(null!=this[e])return this[e];return null},hexToRgb:function(e){if(3!=this.length)return null;var t=this.map(function(e){return 1==e.length&&(e+=e),parseInt(e,16)});return e?t:"rgb("+t+")"},rgbToHex:function(e){if(this.length<3)return null;if(4==this.length&&0==this[3]&&!e)return"transparent";for(var t=[],n=0;3>n;n++){var i=(this[n]-0).toString(16);t.push(1==i.length?"0"+i:i)}return e?t:"#"+t.join("")}}),String.implement({contains:function(e,t){return(t?String(this).slice(t):String(this)).indexOf(e)>-1},test:function(e,t){return("regexp"==typeOf(e)?e:new RegExp(""+e,t)).test(this)},trim:function(){return String(this).replace(/^\s+|\s+$/g,"")},clean:function(){return String(this).replace(/\s+/g," ").trim()},camelCase:function(){return String(this).replace(/-\D/g,function(e){return e.charAt(1).toUpperCase()})},hyphenate:function(){return String(this).replace(/[A-Z]/g,function(e){return"-"+e.charAt(0).toLowerCase()})},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(e){return e.toUpperCase()})},escapeRegExp:function(){return String(this).replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(e){return parseInt(this,e||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(e){var t=String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return t?t.slice(1).hexToRgb(e):null},rgbToHex:function(e){var t=String(this).match(/\d{1,3}/g);return t?t.rgbToHex(e):null},substitute:function(e,t){return String(this).replace(t||/\\?\{([^{}]+)\}/g,function(t,n){return"\\"==t.charAt(0)?t.slice(1):null!=e[n]?e[n]:""})}}),Number.implement({limit:function(e,t){return Math.min(t,Math.max(e,this))},round:function(e){return e=Math.pow(10,e||0).toFixed(0>e?-e:0),Math.round(this*e)/e},times:function(e,t){for(var n=0;this>n;n++)e.call(t,n,this)},toFloat:function(){return parseFloat(this)},toInt:function(e){return parseInt(this,e||10)}}),Number.alias("each","times"),function(e){var t={};e.each(function(e){Number[e]||(t[e]=function(){return Math[e].apply(null,[this].concat(Array.convert(arguments)))})}),Number.implement(t)}(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]),Function.extend({attempt:function(){for(var e=0,t=arguments.length;t>e;e++)try{return arguments[e]()}catch(e){}return null}}),Function.implement({attempt:function(e,t){try{return this.apply(t,Array.convert(e))}catch(e){}return null},bind:function(e){var t=this,n=arguments.length>1?Array.slice(arguments,1):null,i=function(){},r=function(){var o=e,a=arguments.length;this instanceof r&&(i.prototype=t.prototype,o=new i);var s=n||a?t.apply(o,n&&a?n.concat(Array.slice(arguments)):n||arguments):t.call(o);return o==e?s:o};return r},pass:function(e,t){var n=this;return null!=e&&(e=Array.convert(e)),function(){return n.apply(t,e||arguments)}},delay:function(e,t,n){return setTimeout(this.pass(null==n?[]:n,t),e)},periodical:function(e,t,n){return setInterval(this.pass(null==n?[]:n,t),e)}}),function(){Object.extend({subset:function(e,t){for(var n={},i=0,r=t.length;r>i;i++){var o=t[i];o in e&&(n[o]=e[o])}return n},map:function(e,t,n){for(var i={},r=Object.keys(e),o=0;o<r.length;o++){var a=r[o];i[a]=t.call(n,e[a],a,e)}return i},filter:function(e,t,n){for(var i={},r=Object.keys(e),o=0;o<r.length;o++){var a=r[o],s=e[a];t.call(n,s,a,e)&&(i[a]=s)}return i},every:function(e,t,n){for(var i=Object.keys(e),r=0;r<i.length;r++){var o=i[r];if(!t.call(n,e[o],o))return!1}return!0},some:function(e,t,n){for(var i=Object.keys(e),r=0;r<i.length;r++){var o=i[r];if(t.call(n,e[o],o))return!0}return!1},values:function(e){for(var t=[],n=Object.keys(e),i=0;i<n.length;i++){var r=n[i];t.push(e[r])}return t},getLength:function(e){return Object.keys(e).length},keyOf:function(e,t){for(var n=Object.keys(e),i=0;i<n.length;i++){var r=n[i];if(e[r]===t)return r}return null},contains:function(e,t){return null!=Object.keyOf(e,t)},toQueryString:function(e,t){var n=[];return Object.each(e,function(e,i){t&&(i=t+"["+i+"]");var r;switch(typeOf(e)){case"object":r=Object.toQueryString(e,i);break;case"array":var o={};e.each(function(e,t){o[t]=e}),r=Object.toQueryString(o,i);break;default:r=i+"="+encodeURIComponent(e)}null!=e&&n.push(r)}),n.join("&")}})}(),function(){var e=this.document,t=e.window=this,n=function(e,t){e=e.toLowerCase(),t=t?t.toLowerCase():"";var n=e.match(/(edge)[\s\/:]([\w\d\.]+)/);return n||(n=e.match(/(opera|ie|firefox|chrome|trident|crios|version)[\s\/:]([\w\d\.]+)?.*?(safari|(?:rv[\s\/:]|version[\s\/:])([\w\d\.]+)|$)/)||[null,"unknown",0]),"trident"==n[1]?(n[1]="ie",n[4]&&(n[2]=n[4])):"crios"==n[1]&&(n[1]="chrome"),t=e.match(/ip(?:ad|od|hone)/)?"ios":(e.match(/(?:webos|android)/)||e.match(/mac|win|linux/)||["other"])[0],"win"==t&&(t="windows"),{extend:Function.prototype.extend,name:"version"==n[1]?n[3]:n[1],version:parseFloat("opera"==n[1]&&n[4]?n[4]:n[2]),platform:t}},i=this.Browser=n(navigator.userAgent,navigator.platform);if("ie"==i.name&&e.documentMode&&(i.version=e.documentMode),i.extend({Features:{xpath:!!e.evaluate,air:!!t.runtime,query:!!e.querySelector,json:!!t.JSON},parseUA:n}),i.Request=function(){var e=function(){return new XMLHttpRequest},t=function(){return new ActiveXObject("MSXML2.XMLHTTP")},n=function(){return new ActiveXObject("Microsoft.XMLHTTP")};return Function.attempt(function(){return e(),e},function(){return t(),t},function(){return n(),n})}(),i.Features.xhr=!!i.Request,i.exec=function(n){if(!n)return n;if(t.execScript)t.execScript(n);else{var i=e.createElement("script");i.setAttribute("type","text/javascript"),i.text=n,e.head.appendChild(i),e.head.removeChild(i)}return n},String.implement("stripScripts",function(e){var t="",n=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(e,n){return t+=n+"\n",""});return!0===e?i.exec(t):"function"==typeOf(e)&&e(t,n),n}),i.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event}),this.Window=this.$constructor=new Type("Window",function(){}),this.$family=Function.convert("window").hide(),Window.mirror(function(e,n){t[e]=n}),this.Document=e.$constructor=new Type("Document",function(){}),e.$family=Function.convert("document").hide(),Document.mirror(function(t,n){e[t]=n}),e.html=e.documentElement,e.head||(e.head=e.getElementsByTagName("head")[0]),e.execCommand)try{e.execCommand("BackgroundImageCache",!1,!0)}catch(e){}if(this.attachEvent&&!this.addEventListener){var r=function(){this.detachEvent("onunload",r),e.head=e.html=e.window=null,t=this.Window=e=null};this.attachEvent("onunload",r)}var o=Array.convert;try{o(e.html.childNodes)}catch(e){Array.convert=function(e){if("string"!=typeof e&&Type.isEnumerable(e)&&"array"!=typeOf(e)){for(var t=e.length,n=new Array(t);t--;)n[t]=e[t];return n}return o(e)};var a=Array.prototype,s=a.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(e){var t=a[e];Array[e]=function(e){return t.apply(Array.convert(e),s.call(arguments,1))}})}}(),function(){var e={},t=function(e){var t;if(e.wheelDelta)t=e.wheelDelta%120==0?e.wheelDelta/120:e.wheelDelta/12;else{var n=e.deltaY||e.detail||0;t=-(n%3==0?n/3:10*n)}return t},n=this.DOMEvent=new Type("DOMEvent",function(n,i){if(i||(i=window),n=n||i.event,n.$extended)return n;this.event=n,this.$extended=!0,this.shift=n.shiftKey,this.control=n.ctrlKey,this.alt=n.altKey,this.meta=n.metaKey;for(var r=this.type=n.type,o=n.target||n.srcElement;o&&3==o.nodeType;)o=o.parentNode;if(this.target=document.id(o),0==r.indexOf("key")){var a=this.code=n.which||n.keyCode;this.shift&&"keypress"==r||(this.key=e[a]),("keydown"==r||"keyup"==r)&&(a>111&&124>a?this.key="f"+(a-111):a>95&&106>a&&(this.key=a-96)),null==this.key&&(this.key=String.fromCharCode(a).toLowerCase())}else if("click"==r||"dblclick"==r||"contextmenu"==r||"wheel"==r||"DOMMouseScroll"==r||0==r.indexOf("mouse")){var s=i.document;if(s=s.compatMode&&"CSS1Compat"!=s.compatMode?s.body:s.html,this.page={x:null!=n.pageX?n.pageX:n.clientX+s.scrollLeft,y:null!=n.pageY?n.pageY:n.clientY+s.scrollTop},this.client={x:null!=n.pageX?n.pageX-i.pageXOffset:n.clientX,y:null!=n.pageY?n.pageY-i.pageYOffset:n.clientY},("DOMMouseScroll"==r||"wheel"==r||"mousewheel"==r)&&(this.wheel=t(n)),this.rightClick=3==n.which||2==n.button,"mouseover"==r||"mouseout"==r||"mouseenter"==r||"mouseleave"==r){for(var l="mouseover"==r||"mouseenter"==r,c=n.relatedTarget||n[(l?"from":"to")+"Element"];c&&3==c.nodeType;)c=c.parentNode;this.relatedTarget=document.id(c)}}else if(0==r.indexOf("touch")||0==r.indexOf("gesture")){this.rotation=n.rotation,this.scale=n.scale,this.targetTouches=n.targetTouches,this.changedTouches=n.changedTouches;var u=this.touches=n.touches;if(u&&u[0]){var d=u[0];this.page={x:d.pageX,y:d.pageY},this.client={x:d.clientX,y:d.clientY}}}this.client||(this.client={}),this.page||(this.page={})});n.implement({stop:function(){return this.preventDefault().stopPropagation()},stopPropagation:function(){return this.event.stopPropagation?this.event.stopPropagation():this.event.cancelBubble=!0,this},preventDefault:function(){return this.event.preventDefault?this.event.preventDefault():this.event.returnValue=!1,this}}),n.defineKey=function(t,n){return e[t]=n,this},n.defineKeys=n.defineKey.overloadSetter(!0),n.defineKeys({38:"up",40:"down",37:"left",39:"right",27:"esc",32:"space",8:"backspace",9:"tab",46:"delete",13:"enter"})}(),function(){var e=this.Class=new Type("Class",function(i){instanceOf(i,Function)&&(i={initialize:i});var r=function(){if(n(this),r.$prototyping)return this;this.$caller=null,this.$family=null;var e=this.initialize?this.initialize.apply(this,arguments):this;return this.$caller=this.caller=null,e}.extend(this).implement(i);return r.$constructor=e,r.prototype.$constructor=r,r.prototype.parent=t,r}),t=function(){if(!this.$caller)throw new Error('The method "parent" cannot be called.');var e=this.$caller.$name,t=this.$caller.$owner.parent,n=t?t.prototype[e]:null;if(!n)throw new Error('The method "'+e+'" has no parent.');return n.apply(this,arguments)},n=function(e){for(var t in e){var i=e[t];switch(typeOf(i)){case"object":var r=function(){};r.prototype=i,e[t]=n(new r);break;case"array":e[t]=i.clone()}}return e},i=function(e,t,n){n.$origin&&(n=n.$origin);var i=function(){if(n.$protected&&null==this.$caller)throw new Error('The method "'+t+'" cannot be called.');var e=this.caller,r=this.$caller;this.caller=r,this.$caller=i;var o=n.apply(this,arguments);return this.$caller=r,this.caller=e,o}.extend({$owner:e,$origin:n,$name:t});return i},r=function(t,n,r){if(e.Mutators.hasOwnProperty(t)&&null==(n=e.Mutators[t].call(this,n)))return this;if("function"==typeOf(n)){if(n.$hidden)return this;this.prototype[t]=r?n:i(this,t,n)}else Object.merge(this.prototype,t,n);return this},o=function(e){e.$prototyping=!0;var t=new e;return delete e.$prototyping,t};e.implement("implement",r.overloadSetter()),e.Mutators={Extends:function(e){this.parent=e,this.prototype=o(e)},Implements:function(e){Array.convert(e).each(function(e){var t=new e;for(var n in t)r.call(this,n,t[n],!0)},this)}}}(),function(){this.Chain=new Class({$chain:[],chain:function(){return this.$chain.append(Array.flatten(arguments)),this},callChain:function(){return!!this.$chain.length&&this.$chain.shift().apply(this,arguments)},clearChain:function(){return this.$chain.empty(),this}});var e=function(e){return e.replace(/^on([A-Z])/,function(e,t){return t.toLowerCase()})};this.Events=new Class({$events:{},addEvent:function(t,n,i){return t=e(t),this.$events[t]=(this.$events[t]||[]).include(n),i&&(n.internal=!0),this},addEvents:function(e){for(var t in e)this.addEvent(t,e[t]);return this},fireEvent:function(t,n,i){t=e(t);var r=this.$events[t];return r?(n=Array.convert(n),r.each(function(e){i?e.delay(i,this,n):e.apply(this,n)},this),this):this},removeEvent:function(t,n){t=e(t);var i=this.$events[t];if(i&&!n.internal){var r=i.indexOf(n);-1!=r&&delete i[r]}return this},removeEvents:function(t){var n;if("object"==typeOf(t)){for(n in t)this.removeEvent(n,t[n]);return this}t&&(t=e(t));for(n in this.$events)if(!t||t==n)for(var i=this.$events[n],r=i.length;r--;)r in i&&this.removeEvent(n,i[r]);return this}}),this.Options=new Class({setOptions:function(){var e=this.options=Object.merge.apply(null,[{},this.options].append(arguments));if(this.addEvent)for(var t in e)"function"==typeOf(e[t])&&/^on[A-Z]/.test(t)&&(this.addEvent(t,e[t]),delete e[t]);return this}})}(),function(){function e(i,r){if(i.$thenableState===a)if(i===r)n(i,new TypeError("Tried to resolve a thenable with itself."));else if(!r||"object"!=typeof r&&"function"!=typeof r)t(i,r);else{var o;try{o=r.then}catch(e){n(i,e)}if("function"==typeof o){var s=!1;u(function(){try{o.call(r,function(t){s||(s=!0,e(i,t))},function(e){s||(s=!0,n(i,e))})}catch(e){s||(s=!0,n(i,e))}})}else t(i,r)}}function t(e,t){e.$thenableState===a&&(e.$thenableResult=t,e.$thenableState=s,r(e))}function n(e,t){e.$thenableState===a&&(e.$thenableResult=t,e.$thenableState=l,r(e))}function i(e){e.$thenableState!==a&&(e.$thenableResult=null,e.$thenableState=a)}function r(e){var t,n=e.$thenableState,i=e.$thenableResult,r=e.$thenableReactions;n===s?(e.$thenableReactions=[],t="fulfillHandler"):n==l&&(e.$thenableReactions=[],t="rejectHandler"),t&&u(o.pass([i,r,t]))}
function o(t,i,r){for(var o=0,a=i.length;a>o;++o){var s=i[o],l=s[r];if("Identity"===l)e(s.thenable,t);else if("Thrower"===l)n(s.thenable,t);else try{e(s.thenable,l(t))}catch(e){n(s.thenable,e)}}}var a=0,s=1,l=2,c=Class.Thenable=new Class({$thenableState:a,$thenableResult:null,$thenableReactions:[],resolve:function(t){return e(this,t),this},reject:function(e){return n(this,e),this},getThenableState:function(){switch(this.$thenableState){case a:return"pending";case s:return"fulfilled";case l:return"rejected"}},resetThenable:function(e){return n(this,e),i(this),this},then:function(e,t){"function"!=typeof e&&(e="Identity"),"function"!=typeof t&&(t="Thrower");var n=new c;return this.$thenableReactions.push({thenable:n,fulfillHandler:e,rejectHandler:t}),this.$thenableState!==a&&r(this),n},catch:function(e){return this.then(null,e)}});c.extend({resolve:function(t){var n;return t instanceof c?n=t:(n=new c,e(n,t)),n},reject:function(e){var t=new c;return n(t,e),t}});var u;u="undefined"!=typeof process&&"function"==typeof process.nextTick?process.nextTick:"undefined"!=typeof setImmediate?setImmediate:function(e){setTimeout(e,0)}}(),function(){function e(e,o,a,l,u,h,f,p,m,g,v,b,y,w,x,C){if((o||-1===n)&&(t.expressions[++n]=[],i=-1,o))return"";if(a||l||-1===i){a=a||" ";var k=t.expressions[n];r&&k[i]&&(k[i].reverseCombinator=c(a)),k[++i]={combinator:a,tag:"*"}}var _=t.expressions[n][i];if(u)_.tag=u.replace(s,"");else if(h)_.id=h.replace(s,"");else if(f)f=f.replace(s,""),_.classList||(_.classList=[]),_.classes||(_.classes=[]),_.classList.push(f),_.classes.push({value:f,regexp:new RegExp("(^|\\s)"+d(f)+"(\\s|$)")});else if(y)C=C||x,C=C?C.replace(s,""):null,_.pseudos||(_.pseudos=[]),_.pseudos.push({key:y.replace(s,""),value:C,type:1==b.length?"class":"element"});else if(p){p=p.replace(s,""),v=(v||"").replace(s,"");var S,E;switch(m){case"^=":E=new RegExp("^"+d(v));break;case"$=":E=new RegExp(d(v)+"$");break;case"~=":E=new RegExp("(^|\\s)"+d(v)+"(\\s|$)");break;case"|=":E=new RegExp("^"+d(v)+"(-|$)");break;case"=":S=function(e){return v==e};break;case"*=":S=function(e){return e&&e.indexOf(v)>-1};break;case"!=":S=function(e){return v!=e};break;default:S=function(e){return!!e}}""==v&&/^[*$^]=$/.test(m)&&(S=function(){return!1}),S||(S=function(e){return e&&E.test(e)}),_.attributes||(_.attributes=[]),_.attributes.push({key:p,operator:m,value:v,test:S})}return""}var t,n,i,r,o={},a={},s=/\\/g,l=function(i,s){if(null==i)return null;if(!0===i.Slick)return i;i=(""+i).replace(/^\s+|\s+$/g,""),r=!!s;var c=r?a:o;if(c[i])return c[i];for(t={Slick:!0,expressions:[],raw:i,reverse:function(){return l(this.raw,!0)}},n=-1;i!=(i=i.replace(h,e)););return t.length=t.expressions.length,c[t.raw]=r?u(t):t},c=function(e){return"!"===e?" ":" "===e?"!":/^!/.test(e)?e.replace(/^!/,""):"!"+e},u=function(e){for(var t=e.expressions,n=0;n<t.length;n++){for(var i=t[n],r={parts:[],tag:"*",combinator:c(i[0].combinator)},o=0;o<i.length;o++){var a=i[o];a.reverseCombinator||(a.reverseCombinator=" "),a.combinator=a.reverseCombinator,delete a.reverseCombinator}i.reverse().push(r)}return e},d=function(e){return e.replace(/[-[\]{}()*+?.\\^$|,#\s]/g,function(e){return"\\"+e})},h=new RegExp("^(?:\\s*(,)\\s*|\\s*(<combinator>+)\\s*|(\\s+)|(<unicode>+|\\*)|\\#(<unicode>+)|\\.(<unicode>+)|\\[\\s*(<unicode1>+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(<unicode>+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(/<combinator>/,"["+d(">+~`!@$%^&={}\\;</")+"]").replace(/<unicode>/g,"(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(/<unicode1>/g,"(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")),f=this.Slick||{};f.parse=function(e){return l(e)},f.escapeRegExp=d,this.Slick||(this.Slick=f)}.apply("undefined"!=typeof exports?exports:this),function(){var e={},t={},n=Object.prototype.toString;e.isNativeCode=function(e){return/\{\s*\[native code\]\s*\}/.test(""+e)},e.isXML=function(e){return!!e.xmlVersion||!!e.xml||"[object XMLDocument]"==n.call(e)||9==e.nodeType&&"HTML"!=e.documentElement.nodeName},e.setDocument=function(e){var n=e.nodeType;if(9==n);else if(n)e=e.ownerDocument;else{if(!e.navigator)return;e=e.document}if(this.document!==e){this.document=e;var i,r=e.documentElement,o=this.getUIDXML(r),a=t[o];if(a)for(i in a)this[i]=a[i];else{a=t[o]={},a.root=r,a.isXMLDocument=this.isXML(e),a.brokenStarGEBTN=a.starSelectsClosedQSA=a.idGetsName=a.brokenMixedCaseQSA=a.brokenGEBCN=a.brokenCheckedQSA=a.brokenEmptyAttributeQSA=a.isHTMLDocument=a.nativeMatchesSelector=!1;var s,l,c,u,d,h,f="slick_uniqueid",p=e.createElement("div"),m=e.body||e.getElementsByTagName("body")[0]||r;m.appendChild(p);try{p.innerHTML='<a id="'+f+'"></a>',a.isHTMLDocument=!!e.getElementById(f)}catch(e){}if(a.isHTMLDocument){p.style.display="none",p.appendChild(e.createComment("")),l=p.getElementsByTagName("*").length>1;try{p.innerHTML="foo</foo>",h=p.getElementsByTagName("*"),s=h&&!!h.length&&"/"==h[0].nodeName.charAt(0)}catch(e){}a.brokenStarGEBTN=l||s;try{p.innerHTML='<a name="'+f+'"></a><b id="'+f+'"></b>',a.idGetsName=e.getElementById(f)===p.firstChild}catch(e){}if(p.getElementsByClassName){try{p.innerHTML='<a class="f"></a><a class="b"></a>',p.getElementsByClassName("b").length,p.firstChild.className="b",u=2!=p.getElementsByClassName("b").length}catch(e){}try{p.innerHTML='<a class="a"></a><a class="f b a"></a>',c=2!=p.getElementsByClassName("a").length}catch(e){}a.brokenGEBCN=u||c}if(p.querySelectorAll){try{p.innerHTML="foo</foo>",h=p.querySelectorAll("*"),a.starSelectsClosedQSA=h&&!!h.length&&"/"==h[0].nodeName.charAt(0)}catch(e){}try{p.innerHTML='<a class="MiX"></a>',a.brokenMixedCaseQSA=!p.querySelectorAll(".MiX").length}catch(e){}try{p.innerHTML='<select><option selected="selected">a</option></select>',a.brokenCheckedQSA=0==p.querySelectorAll(":checked").length}catch(e){}try{p.innerHTML='<a class=""></a>',a.brokenEmptyAttributeQSA=0!=p.querySelectorAll('[class*=""]').length}catch(e){}}try{p.innerHTML='<form action="s"><input id="action"/></form>',d="s"!=p.firstChild.getAttribute("action")}catch(e){}if(a.nativeMatchesSelector=r.matches||r.mozMatchesSelector||r.webkitMatchesSelector,a.nativeMatchesSelector)try{a.nativeMatchesSelector.call(r,":slick"),a.nativeMatchesSelector=null}catch(e){}}try{r.slick_expando=1,delete r.slick_expando,a.getUID=this.getUIDHTML}catch(e){a.getUID=this.getUIDXML}m.removeChild(p),p=h=m=null,a.getAttribute=a.isHTMLDocument&&d?function(e,t){var n=this.attributeGetters[t];if(n)return n.call(e);var i=e.getAttributeNode(t);return i?i.nodeValue:null}:function(e,t){var n=this.attributeGetters[t];return n?n.call(e):e.getAttribute(t)},a.hasAttribute=r&&this.isNativeCode(r.hasAttribute)?function(e,t){return e.hasAttribute(t)}:function(e,t){return!(!(e=e.getAttributeNode(t))||!e.specified&&!e.nodeValue)};var g=r&&this.isNativeCode(r.contains),v=e&&this.isNativeCode(e.contains);a.contains=g&&v?function(e,t){return e.contains(t)}:g&&!v?function(t,n){return t===n||(t===e?e.documentElement:t).contains(n)}:r&&r.compareDocumentPosition?function(e,t){return e===t||!!(16&e.compareDocumentPosition(t))}:function(e,t){if(t)do{if(t===e)return!0}while(t=t.parentNode);return!1},a.documentSorter=r.compareDocumentPosition?function(e,t){return e.compareDocumentPosition&&t.compareDocumentPosition?4&e.compareDocumentPosition(t)?-1:e===t?0:1:0}:"sourceIndex"in r?function(e,t){return e.sourceIndex&&t.sourceIndex?e.sourceIndex-t.sourceIndex:0}:e.createRange?function(e,t){if(!e.ownerDocument||!t.ownerDocument)return 0;var n=e.ownerDocument.createRange(),i=t.ownerDocument.createRange();return n.setStart(e,0),n.setEnd(e,0),i.setStart(t,0),i.setEnd(t,0),n.compareBoundaryPoints(Range.START_TO_END,i)}:null,r=null;for(i in a)this[i]=a[i]}}};var i=/^([#.]?)((?:[\w-]+|\*))$/,r=/\[.+[*$^]=(?:""|'')?\]/,o={};e.search=function(e,t,n,a){var s=this.found=a?null:n||[];if(!e)return s;if(e.navigator)e=e.document;else if(!e.nodeType)return s;var l,c,u,h,f=this.uniques={},p=!(!n||!n.length),m=9==e.nodeType;if(this.document!==(m?e:e.ownerDocument)&&this.setDocument(e),p)for(c=s.length;c--;)f[this.getUID(s[c])]=!0;if("string"==typeof t){var g=t.match(i);e:if(g){var v=g[1],b=g[2];if(v){if("#"==v){if(!this.isHTMLDocument||!m)break e;if(!(u=e.getElementById(b)))return s;if(this.idGetsName&&u.getAttributeNode("id").nodeValue!=b)break e;if(a)return u||null;p&&f[this.getUID(u)]||s.push(u)}else if("."==v){if(!this.isHTMLDocument||(!e.getElementsByClassName||this.brokenGEBCN)&&e.querySelectorAll)break e;if(e.getElementsByClassName&&!this.brokenGEBCN){if(h=e.getElementsByClassName(b),a)return h[0]||null;for(c=0;u=h[c++];)p&&f[this.getUID(u)]||s.push(u)}else{var y=new RegExp("(^|\\s)"+d.escapeRegExp(b)+"(\\s|$)");for(h=e.getElementsByTagName("*"),c=0;u=h[c++];)if(className=u.className,className&&y.test(className)){if(a)return u;p&&f[this.getUID(u)]||s.push(u)}}}}else{if("*"==b&&this.brokenStarGEBTN)break e;if(h=e.getElementsByTagName(b),a)return h[0]||null;for(c=0;u=h[c++];)p&&f[this.getUID(u)]||s.push(u)}return p&&this.sort(s),a?null:s}e:if(e.querySelectorAll){if(!this.isHTMLDocument||o[t]||this.brokenMixedCaseQSA||this.brokenCheckedQSA&&t.indexOf(":checked")>-1||this.brokenEmptyAttributeQSA&&r.test(t)||!m&&t.indexOf(",")>-1||d.disableQSA)break e;var w,x=t,C=e;m||(w=C.getAttribute("id"),slickid="slickid__",C.setAttribute("id",slickid),x="#"+slickid+" "+x,e=C.parentNode);try{if(a)return e.querySelector(x)||null;h=e.querySelectorAll(x)}catch(e){o[t]=1;break e}finally{m||(w?C.setAttribute("id",w):C.removeAttribute("id"),e=C)}if(this.starSelectsClosedQSA)for(c=0;u=h[c++];)!(u.nodeName>"@")||p&&f[this.getUID(u)]||s.push(u);else for(c=0;u=h[c++];)p&&f[this.getUID(u)]||s.push(u);return p&&this.sort(s),s}if(l=this.Slick.parse(t),!l.length)return s}else{if(null==t)return s;if(!t.Slick)return this.contains(e.documentElement||e,t)?(s?s.push(t):s=t,s):s;l=t}this.posNTH={},this.posNTHLast={},this.posNTHType={},this.posNTHTypeLast={},this.push=!p&&(a||1==l.length&&1==l.expressions[0].length)?this.pushArray:this.pushUID,null==s&&(s=[]);var k,_,S,E,T,D,$,A,j,P,O,I,M,N,F=l.expressions;e:for(c=0;I=F[c];c++)for(k=0;M=I[k];k++){if(E="combinator:"+M.combinator,!this[E])continue e;if(T=this.isXMLDocument?M.tag:M.tag.toUpperCase(),D=M.id,$=M.classList,A=M.classes,j=M.attributes,P=M.pseudos,N=k===I.length-1,this.bitUniques={},N?(this.uniques=f,this.found=s):(this.uniques={},this.found=[]),0===k){if(this[E](e,T,D,A,j,P,$),a&&N&&s.length)break e}else if(a&&N){for(_=0,S=O.length;S>_;_++)if(this[E](O[_],T,D,A,j,P,$),s.length)break e}else for(_=0,S=O.length;S>_;_++)this[E](O[_],T,D,A,j,P,$);O=this.found}return(p||l.expressions.length>1)&&this.sort(s),a?s[0]||null:s},e.uidx=1,e.uidk="slick-uniqueid",e.getUIDXML=function(e){var t=e.getAttribute(this.uidk);return t||(t=this.uidx++,e.setAttribute(this.uidk,t)),t},e.getUIDHTML=function(e){return e.uniqueNumber||(e.uniqueNumber=this.uidx++)},e.sort=function(e){return this.documentSorter?(e.sort(this.documentSorter),e):e},e.cacheNTH={},e.matchNTH=/^([+-]?\d*)?([a-z]+)?([+-]\d+)?$/,e.parseNTHArgument=function(e){var t=e.match(this.matchNTH);if(!t)return!1;var n=t[2]||!1,i=t[1]||1;"-"==i&&(i=-1);var r=+t[3]||0;return t="n"==n?{a:i,b:r}:"odd"==n?{a:2,b:1}:"even"==n?{a:2,b:0}:{a:0,b:i},this.cacheNTH[e]=t},e.createNTHPseudo=function(e,t,n,i){return function(r,o){var a=this.getUID(r);if(!this[n][a]){var s=r.parentNode;if(!s)return!1;var l=s[e],c=1;if(i){var u=r.nodeName;do{l.nodeName==u&&(this[n][this.getUID(l)]=c++)}while(l=l[t])}else do{1==l.nodeType&&(this[n][this.getUID(l)]=c++)}while(l=l[t])}o=o||"n";var d=this.cacheNTH[o]||this.parseNTHArgument(o);if(!d)return!1;var h=d.a,f=d.b,p=this[n][a];if(0==h)return f==p;if(h>0){if(f>p)return!1}else if(p>f)return!1;return(p-f)%h==0}},e.pushArray=function(e,t,n,i,r,o){this.matchSelector(e,t,n,i,r,o)&&this.found.push(e)},e.pushUID=function(e,t,n,i,r,o){var a=this.getUID(e);!this.uniques[a]&&this.matchSelector(e,t,n,i,r,o)&&(this.uniques[a]=!0,this.found.push(e))},e.matchNode=function(e,t){if(this.isHTMLDocument&&this.nativeMatchesSelector)try{return this.nativeMatchesSelector.call(e,t.replace(/\[([^=]+)=\s*([^'"\]]+?)\s*\]/g,'[$1="$2"]'))}catch(e){}var n=this.Slick.parse(t);if(!n)return!0;var i,r,o=n.expressions,a=0;for(i=0;r=o[i];i++)if(1==r.length){var s=r[0];if(this.matchSelector(e,this.isXMLDocument?s.tag:s.tag.toUpperCase(),s.id,s.classes,s.attributes,s.pseudos))return!0;a++}if(a==n.length)return!1;var l,c=this.search(this.document,n);for(i=0;l=c[i++];)if(l===e)return!0;return!1},e.matchPseudo=function(e,t,n){var i="pseudo:"+t;if(this[i])return this[i](e,n);var r=this.getAttribute(e,t);return n?n==r:!!r},e.matchSelector=function(e,t,n,i,r,o){if(t){var a=this.isXMLDocument?e.nodeName:e.nodeName.toUpperCase();if("*"==t){if("@">a)return!1}else if(a!=t)return!1}if(n&&e.getAttribute("id")!=n)return!1;var s,l,c;if(i)for(s=i.length;s--;)if(!(c=this.getAttribute(e,"class"))||!i[s].regexp.test(c))return!1;if(r)for(s=r.length;s--;)if(l=r[s],l.operator?!l.test(this.getAttribute(e,l.key)):!this.hasAttribute(e,l.key))return!1;if(o)for(s=o.length;s--;)if(l=o[s],!this.matchPseudo(e,l.key,l.value))return!1;return!0};var a={" ":function(e,t,n,i,r,o,a){var s,l,c;if(this.isHTMLDocument){e:if(n){if(!(l=this.document.getElementById(n))&&e.all||this.idGetsName&&l&&l.getAttributeNode("id").nodeValue!=n){if(!(c=e.all[n]))return;for(c[0]||(c=[c]),s=0;l=c[s++];){var u=l.getAttributeNode("id");if(u&&u.nodeValue==n){this.push(l,t,null,i,r,o);break}}return}if(!l){if(this.contains(this.root,e))return;break e}if(this.document!==e&&!this.contains(e,l))return;return void this.push(l,t,null,i,r,o)}e:if(i&&e.getElementsByClassName&&!this.brokenGEBCN){if(!(c=e.getElementsByClassName(a.join(" ")))||!c.length)break e;for(s=0;l=c[s++];)this.push(l,t,n,null,r,o);return}}if((c=e.getElementsByTagName(t))&&c.length)for(this.brokenStarGEBTN||(t=null),s=0;l=c[s++];)this.push(l,t,n,i,r,o)},">":function(e,t,n,i,r,o){if(e=e.firstChild)do{1==e.nodeType&&this.push(e,t,n,i,r,o)}while(e=e.nextSibling)},"+":function(e,t,n,i,r,o){for(;e=e.nextSibling;)if(1==e.nodeType){this.push(e,t,n,i,r,o);break}},"^":function(e,t,n,i,r,o){(e=e.firstChild)&&(1==e.nodeType?this.push(e,t,n,i,r,o):this["combinator:+"](e,t,n,i,r,o))},"~":function(e,t,n,i,r,o){for(;e=e.nextSibling;)if(1==e.nodeType){var a=this.getUID(e);if(this.bitUniques[a])break;this.bitUniques[a]=!0,this.push(e,t,n,i,r,o)}},"++":function(e,t,n,i,r,o){this["combinator:+"](e,t,n,i,r,o),this["combinator:!+"](e,t,n,i,r,o)},"~~":function(e,t,n,i,r,o){this["combinator:~"](e,t,n,i,r,o),this["combinator:!~"](e,t,n,i,r,o)},"!":function(e,t,n,i,r,o){for(;e=e.parentNode;)e!==this.document&&this.push(e,t,n,i,r,o)},"!>":function(e,t,n,i,r,o){(e=e.parentNode)!==this.document&&this.push(e,t,n,i,r,o)},"!+":function(e,t,n,i,r,o){for(;e=e.previousSibling;)if(1==e.nodeType){this.push(e,t,n,i,r,o);break}},"!^":function(e,t,n,i,r,o){(e=e.lastChild)&&(1==e.nodeType?this.push(e,t,n,i,r,o):this["combinator:!+"](e,t,n,i,r,o))},"!~":function(e,t,n,i,r,o){for(;e=e.previousSibling;)if(1==e.nodeType){var a=this.getUID(e);if(this.bitUniques[a])break;this.bitUniques[a]=!0,this.push(e,t,n,i,r,o)}}};for(var s in a)e["combinator:"+s]=a[s];var l={empty:function(e){var t=e.firstChild;return!(t&&1==t.nodeType||(e.innerText||e.textContent||"").length)},not:function(e,t){return!this.matchNode(e,t)},contains:function(e,t){return(e.innerText||e.textContent||"").indexOf(t)>-1},"first-child":function(e){for(;e=e.previousSibling;)if(1==e.nodeType)return!1;return!0},"last-child":function(e){for(;e=e.nextSibling;)if(1==e.nodeType)return!1;return!0},"only-child":function(e){for(var t=e;t=t.previousSibling;)if(1==t.nodeType)return!1;for(var n=e;n=n.nextSibling;)if(1==n.nodeType)return!1;return!0},"nth-child":e.createNTHPseudo("firstChild","nextSibling","posNTH"),"nth-last-child":e.createNTHPseudo("lastChild","previousSibling","posNTHLast"),"nth-of-type":e.createNTHPseudo("firstChild","nextSibling","posNTHType",!0),"nth-last-of-type":e.createNTHPseudo("lastChild","previousSibling","posNTHTypeLast",!0),index:function(e,t){return this["pseudo:nth-child"](e,""+(t+1))},even:function(e){return this["pseudo:nth-child"](e,"2n")},odd:function(e){return this["pseudo:nth-child"](e,"2n+1")},"first-of-type":function(e){for(var t=e.nodeName;e=e.previousSibling;)if(e.nodeName==t)return!1;return!0},"last-of-type":function(e){for(var t=e.nodeName;e=e.nextSibling;)if(e.nodeName==t)return!1;return!0},"only-of-type":function(e){for(var t=e,n=e.nodeName;t=t.previousSibling;)if(t.nodeName==n)return!1;for(var i=e;i=i.nextSibling;)if(i.nodeName==n)return!1;return!0},enabled:function(e){return!e.disabled},disabled:function(e){return e.disabled},checked:function(e){return e.checked||e.selected},focus:function(e){return this.isHTMLDocument&&this.document.activeElement===e&&(e.href||e.type||this.hasAttribute(e,"tabindex"))},root:function(e){return e===this.root},selected:function(e){return e.selected}};for(var c in l)e["pseudo:"+c]=l[c];var u=e.attributeGetters={for:function(){return"htmlFor"in this?this.htmlFor:this.getAttribute("for")},href:function(){return"href"in this?this.getAttribute("href",2):this.getAttribute("href")},style:function(){return this.style?this.style.cssText:this.getAttribute("style")},tabindex:function(){var e=this.getAttributeNode("tabindex");return e&&e.specified?e.nodeValue:null},type:function(){return this.getAttribute("type")},maxlength:function(){var e=this.getAttributeNode("maxLength");return e&&e.specified?e.nodeValue:null}};u.MAXLENGTH=u.maxLength=u.maxlength;var d=e.Slick=this.Slick||{};d.version="1.1.7",d.search=function(t,n,i){return e.search(t,n,i)},d.find=function(t,n){return e.search(t,n,null,!0)},d.contains=function(t,n){return e.setDocument(t),e.contains(t,n)},d.getAttribute=function(t,n){return e.setDocument(t),e.getAttribute(t,n)},d.hasAttribute=function(t,n){return e.setDocument(t),e.hasAttribute(t,n)},d.match=function(t,n){return!(!t||!n)&&(!n||n===t||(e.setDocument(t),e.matchNode(t,n)))},d.defineAttributeGetter=function(t,n){return e.attributeGetters[t]=n,this},d.lookupAttributeGetter=function(t){return e.attributeGetters[t]},d.definePseudo=function(t,n){return e["pseudo:"+t]=function(e,t){return n.call(e,t)},this},d.lookupPseudo=function(t){var n=e["pseudo:"+t];return n?function(e){return n.call(this,e)}:null},d.override=function(t,n){return e.override(t,n),this},d.isXML=e.isXML,d.uidOf=function(t){return e.getUIDHTML(t)},this.Slick||(this.Slick=d)}.apply("undefined"!=typeof exports?exports:this);var Element=this.Element=function(e,t){var n=Element.Constructors[e];if(n)return n(t);if("string"!=typeof e)return document.id(e).set(t);if(t||(t={}),!/^[\w-]+$/.test(e)){var i=Slick.parse(e).expressions[0][0];e="*"==i.tag?"div":i.tag,i.id&&null==t.id&&(t.id=i.id);var r=i.attributes;if(r)for(var o,a=0,s=r.length;s>a;a++)o=r[a],null==t[o.key]&&(null!=o.value&&"="==o.operator?t[o.key]=o.value:o.value||o.operator||(t[o.key]=!0));i.classList&&null==t.class&&(t.class=i.classList.join(" "))}return document.newElement(e,t)};Browser.Element&&(Element.prototype=Browser.Element.prototype,Element.prototype._fireEvent=function(e){return function(t,n){return e.call(this,t,n)}}(Element.prototype.fireEvent)),new Type("Element",Element).mirror(function(e){if(!Array.prototype[e]){var t={};t[e]=function(){for(var t=[],n=arguments,i=!0,r=0,o=this.length;o>r;r++){var a=this[r],s=t[r]=a[e].apply(a,n);i=i&&"element"==typeOf(s)}return i?new Elements(t):t},Elements.implement(t)}}),Browser.Element||(Element.parent=Object,Element.Prototype={$constructor:Element,$family:Function.convert("element").hide()},Element.mirror(function(e,t){Element.Prototype[e]=t})),Element.Constructors={};var IFrame=new Type("IFrame",function(){var e,t=Array.link(arguments,{properties:Type.isObject,iframe:function(e){return null!=e}}),n=t.properties||{};t.iframe&&(e=document.id(t.iframe));var i=n.onload||function(){};delete n.onload,n.id=n.name=[n.id,n.name,e?e.id||e.name:"IFrame_"+String.uniqueID()].pick(),e=new Element(e||"iframe",n);var r=function(){i.call(e.contentWindow)};return window.frames[n.id]?r():e.addListener("load",r),e}),Elements=this.Elements=function(e){if(e&&e.length)for(var t,n={},i=0;t=e[i++];){var r=Slick.uidOf(t);n[r]||(n[r]=!0,this.push(t))}};Elements.prototype={length:0},Elements.parent=Array,new Type("Elements",Elements).implement({filter:function(e,t){return e?new Elements(Array.filter(this,"string"==typeOf(e)?function(t){return t.match(e)}:e,t)):this}.protect(),push:function(){for(var e=this.length,t=0,n=arguments.length;n>t;t++){var i=document.id(arguments[t]);i&&(this[e++]=i)}return this.length=e}.protect(),unshift:function(){for(var e=[],t=0,n=arguments.length;n>t;t++){var i=document.id(arguments[t]);i&&e.push(i)}return Array.prototype.unshift.apply(this,e)}.protect(),concat:function(){for(var e=new Elements(this),t=0,n=arguments.length;n>t;t++){var i=arguments[t];Type.isEnumerable(i)?e.append(i):e.push(i)}return e}.protect(),append:function(e){for(var t=0,n=e.length;n>t;t++)this.push(e[t]);return this}.protect(),empty:function(){for(;this.length;)delete this[--this.length];return this}.protect()}),function(){var e=Array.prototype.splice,t={0:0,1:1,length:2};e.call(t,1,1),1==t[1]&&Elements.implement("splice",function(){for(var t=this.length,n=e.apply(this,arguments);t>=this.length;)delete this[t--];return n}.protect()),Array.forEachMethod(function(e,t){Elements.implement(t,e)}),Array.mirror(Elements);var n;try{n="x"==document.createElement("<input name=x>").name}catch(e){}var i=function(e){return(""+e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")},r=function(){var e=document.createElement("style"),t=!1;try{e.innerHTML="#justTesing{margin: 0px;}",t=!!e.innerHTML}catch(e){}return t}();Document.implement({newElement:function(e,t){if(t){if(null!=t.checked&&(t.defaultChecked=t.checked),"checkbox"!=t.type&&"radio"!=t.type||null!=t.value||(t.value="on"),!r&&"style"==e){var o=document.createElement("style");return o.setAttribute("type","text/css"),t.type&&delete t.type,this.id(o).set(t)}n&&(e="<"+e,t.name&&(e+=' name="'+i(t.name)+'"'),t.type&&(e+=' type="'+i(t.type)+'"'),e+=">",delete t.name,delete t.type)}return this.id(this.createElement(e)).set(t)}})}(),function(){Slick.uidOf(window),Slick.uidOf(document),Document.implement({newTextNode:function(e){return this.createTextNode(e)},getDocument:function(){return this},getWindow:function(){return this.window},id:function(){var e={string:function(t,n,i){return t=Slick.find(i,"#"+t.replace(/(\W)/g,"\\$1")),t?e.element(t,n):null},element:function(e,t){if(Slick.uidOf(e),!t&&!e.$family&&!/^(?:object|embed)$/i.test(e.tagName)){var n=e.fireEvent;e._fireEvent=function(e,t){return n(e,t)},Object.append(e,Element.Prototype)}return e},object:function(t,n,i){return t.toElement?e.element(t.toElement(i),n):null}};return e.textnode=e.whitespace=e.window=e.document=function(e){return e},function(t,n,i){if(t&&t.$family&&t.uniqueNumber)return t;var r=typeOf(t);return e[r]?e[r](t,n,i||document):null}}()}),null==window.$&&Window.implement("$",function(e,t){return document.id(e,t,this.document)}),Window.implement({getDocument:function(){return this.document},getWindow:function(){return this}}),[Document,Element].invoke("implement",{getElements:function(e){return Slick.search(this,e,new Elements)},getElement:function(e){return document.id(Slick.find(this,e))}});var e={contains:function(e){return Slick.contains(this,e)}};document.contains||Document.implement(e),document.createElement("div").contains||Element.implement(e);var t=function(e,t){if(!e)return t;e=Object.clone(Slick.parse(e));for(var n=e.expressions,i=n.length;i--;)n[i][0].combinator=t;return e};Object.forEach({getNext:"~",getPrevious:"!~",getParent:"!"},function(e,n){Element.implement(n,function(n){return this.getElement(t(n,e))})}),Object.forEach({getAllNext:"~",getAllPrevious:"!~",getSiblings:"~~",getChildren:">",getParents:"!"},function(e,n){Element.implement(n,function(n){return this.getElements(t(n,e))})}),Element.implement({getFirst:function(e){return document.id(Slick.search(this,t(e,">"))[0])},getLast:function(e){return document.id(Slick.search(this,t(e,">")).getLast())},getWindow:function(){return this.ownerDocument.window},getDocument:function(){return this.ownerDocument},getElementById:function(e){return document.id(Slick.find(this,"#"+(""+e).replace(/(\W)/g,"\\$1")))},match:function(e){return!e||Slick.match(this,e)}}),null==window.$$&&Window.implement("$$",function(e){if(1==arguments.length){if("string"==typeof e)return Slick.search(this.document,e,new Elements);if(Type.isEnumerable(e))return new Elements(e)}return new Elements(arguments)});var n={before:function(e,t){var n=t.parentNode;n&&n.insertBefore(e,t)},after:function(e,t){var n=t.parentNode;n&&n.insertBefore(e,t.nextSibling)},bottom:function(e,t){t.appendChild(e)},top:function(e,t){t.insertBefore(e,t.firstChild)}};n.inside=n.bottom;var i={},r={},o={};Array.forEach(["type","value","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","rowSpan","tabIndex","useMap"],function(e){o[e.toLowerCase()]=e}),o.html="innerHTML",o.text=null==document.createElement("div").textContent?"innerText":"textContent",Object.forEach(o,function(e,t){r[t]=function(t,n){t[e]=n},i[t]=function(t){return t[e]}}),r.text=function(){return function(e,t){"style"==e.get("tag")?e.set("html",t):e[o.text]=t}}(r.text),i.text=function(e){return function(t){return"style"==t.get("tag")?t.innerHTML:e(t)}}(i.text);var a=["compact","nowrap","ismap","declare","noshade","checked","disabled","readOnly","multiple","selected","noresize","defer","defaultChecked","autofocus","controls","autoplay","loop"],s={};Array.forEach(a,function(e){var t=e.toLowerCase();s[t]=e,r[t]=function(t,n){t[e]=!!n},i[t]=function(t){return!!t[e]}}),Object.append(r,{class:function(e,t){"className"in e?e.className=t||"":e.setAttribute("class",t)},for:function(e,t){"htmlFor"in e?e.htmlFor=t:e.setAttribute("for",t)},style:function(e,t){e.style?e.style.cssText=t:e.setAttribute("style",t)},value:function(e,t){e.value=null!=t?t:""}}),i.class=function(e){return"className"in e?e.className||null:e.getAttribute("class")};var c=document.createElement("button");try{c.type="button"}catch(e){}"button"!=c.type&&(r.type=function(e,t){e.setAttribute("type",t)}),c=null;var u,d,h=function(){var e=document.createElement("style"),t=!1;try{e.innerHTML="#justTesing{margin: 0px;}",t=!!e.innerHTML}catch(e){}return t}(),f=document.createElement("input");f.value="t",f.type="submit",u="t"!=f.value;try{f.value="",f.type="email",d="email"==f.type}catch(e){}f=null,(u||!d)&&(r.type=function(e,t){try{var n=e.value;e.type=t,e.value=n}catch(e){}});var p=function(e){return e.random="attribute","attribute"==e.getAttribute("random")}(document.createElement("div")),m=function(e){return e.innerHTML='<object><param name="should_fix" value="the unknown" /></object>',1!=e.cloneNode(!0).firstChild.childNodes.length}(document.createElement("div")),g=!!document.createElement("div").classList,v=function(e){var t=(e||"").clean().split(" "),n={};return t.filter(function(e){return""===e||n[e]?void 0:n[e]=e})},b=function(e){this.classList.add(e)},y=function(e){this.classList.remove(e)};Element.implement({setProperty:function(e,t){var n=r[e.toLowerCase()];if(n)n(this,t);else{var i;p&&(i=this.retrieve("$attributeWhiteList",{})),null==t?(this.removeAttribute(e),p&&delete i[e]):(this.setAttribute(e,""+t),p&&(i[e]=!0))}return this},setProperties:function(e){for(var t in e)this.setProperty(t,e[t]);return this},getProperty:function(e){var t=i[e.toLowerCase()];if(t)return t(this);if(p){var n=this.getAttributeNode(e),r=this.retrieve("$attributeWhiteList",{});if(!n)return null;if(n.expando&&!r[e]){var o=this.outerHTML;if(o.substr(0,o.search(/\/?['"]?>(?![^<]*<['"])/)).indexOf(e)<0)return null;r[e]=!0}}var a=Slick.getAttribute(this,e);return a||Slick.hasAttribute(this,e)?a:null},getProperties:function(){var e=Array.convert(arguments);return e.map(this.getProperty,this).associate(e)},removeProperty:function(e){return this.setProperty(e,null)},removeProperties:function(){return Array.each(arguments,this.removeProperty,this),this},set:function(e,t){var n=Element.Properties[e];n&&n.set?n.set.call(this,t):this.setProperty(e,t)}.overloadSetter(),get:function(e){var t=Element.Properties[e];return t&&t.get?t.get.apply(this):this.getProperty(e)}.overloadGetter(),erase:function(e){var t=Element.Properties[e];return t&&t.erase?t.erase.apply(this):this.removeProperty(e),this},hasClass:g?function(e){return this.classList.contains(e)}:function(e){return v(this.className).contains(e)},addClass:g?function(e){return v(e).forEach(b,this),this}:function(e){return this.className=v(e+" "+this.className).join(" "),this},removeClass:g?function(e){return v(e).forEach(y,this),this}:function(e){var t=v(this.className);return v(e).forEach(t.erase,t),this.className=t.join(" "),this},toggleClass:function(e,t){return null==t&&(t=!this.hasClass(e)),t?this.addClass(e):this.removeClass(e)},adopt:function(){var e,t=this,n=Array.flatten(arguments),i=n.length;i>1&&(t=e=document.createDocumentFragment());for(var r=0;i>r;r++){var o=document.id(n[r],!0);o&&t.appendChild(o)}return e&&this.appendChild(e),this},appendText:function(e,t){return this.grab(this.getDocument().newTextNode(e),t)},grab:function(e,t){return n[t||"bottom"](document.id(e,!0),this),this},inject:function(e,t){return n[t||"bottom"](this,document.id(e,!0)),this},replaces:function(e){return e=document.id(e,!0),e.parentNode.replaceChild(this,e),this},wraps:function(e,t){return e=document.id(e,!0),this.replaces(e).grab(e,t)},getSelected:function(){return this.selectedIndex,new Elements(Array.convert(this.options).filter(function(e){return e.selected}))},toQueryString:function(){var e=[];return this.getElements("input, select, textarea").each(function(t){var n=t.type;if(t.name&&!t.disabled&&"submit"!=n&&"reset"!=n&&"file"!=n&&"image"!=n){var i="select"==t.get("tag")?t.getSelected().map(function(e){return document.id(e).get("value")}):"radio"!=n&&"checkbox"!=n||t.checked?t.get("value"):null;Array.convert(i).each(function(n){void 0!==n&&e.push(encodeURIComponent(t.name)+"="+encodeURIComponent(n))})}}),e.join("&")}});var w={before:"beforeBegin",after:"afterEnd",bottom:"beforeEnd",top:"afterBegin",inside:"beforeEnd"};Element.implement("appendHTML","insertAdjacentHTML"in document.createElement("div")?function(e,t){return this.insertAdjacentHTML(w[t||"bottom"],e),this}:function(e,t){var i=new Element("div",{html:e}),r=i.childNodes,o=i.firstChild;if(!o)return this;if(r.length>1){o=document.createDocumentFragment();for(var a=0,s=r.length;s>a;a++)o.appendChild(r[a])}return n[t||"bottom"](o,this),this});var x={},C={},k=function(e){return C[e]||(C[e]={})},_=function(e){var t=e.uniqueNumber;return e.removeEvents&&e.removeEvents(),e.clearAttributes&&e.clearAttributes(),null!=t&&(delete x[t],delete C[t]),e},S={input:"checked",option:"selected",textarea:"value"};if(Element.implement({destroy:function(){var e=_(this).getElementsByTagName("*");return Array.each(e,_),Element.dispose(this),null},empty:function(){return Array.convert(this.childNodes).each(Element.dispose),this},dispose:function(){return this.parentNode?this.parentNode.removeChild(this):this},clone:function(e,t){e=!1!==e;var n,i=this.cloneNode(e),r=[i],o=[this];for(e&&(r.append(Array.convert(i.getElementsByTagName("*"))),o.append(Array.convert(this.getElementsByTagName("*")))),n=r.length;n--;){var a=r[n],s=o[n];if(t||a.removeAttribute("id"),a.clearAttributes&&(a.clearAttributes(),a.mergeAttributes(s),a.removeAttribute("uniqueNumber"),a.options))for(var l=a.options,c=s.options,u=l.length;u--;)l[u].selected=c[u].selected;var d=S[s.tagName.toLowerCase()];d&&s[d]&&(a[d]=s[d])}if(m){var h=i.getElementsByTagName("object"),f=this.getElementsByTagName("object");for(n=h.length;n--;)h[n].outerHTML=f[n].outerHTML}return document.id(i)}}),[Element,Window,Document].invoke("implement",{addListener:function(e,t){
return window.attachEvent&&!window.addEventListener&&(x[Slick.uidOf(this)]=this),this.addEventListener?this.addEventListener(e,t,!!arguments[2]):this.attachEvent("on"+e,t),this},removeListener:function(e,t){return this.removeEventListener?this.removeEventListener(e,t,!!arguments[2]):this.detachEvent("on"+e,t),this},retrieve:function(e,t){var n=k(Slick.uidOf(this)),i=n[e];return null!=t&&null==i&&(i=n[e]=t),null!=i?i:null},store:function(e,t){return k(Slick.uidOf(this))[e]=t,this},eliminate:function(e){return delete k(Slick.uidOf(this))[e],this}}),window.attachEvent&&!window.addEventListener){var E=function(){Object.each(x,_),window.CollectGarbage&&CollectGarbage(),window.removeListener("unload",E)};window.addListener("unload",E)}Element.Properties={},Element.Properties.style={set:function(e){this.style.cssText=e},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}},Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}},Element.Properties.html={set:function(e){null==e?e="":"array"==typeOf(e)&&(e=e.join("")),this.styleSheet&&!h?this.styleSheet.cssText=e:this.innerHTML=e},erase:function(){this.set("html","")}};var T,D=!0,$=!0,A=!0,j=document.createElement("div");if(j.innerHTML="<nav></nav>",!(D=1==j.childNodes.length)){var P="abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" ");for(T=document.createDocumentFragment(),l=P.length;l--;)T.createElement(P[l])}j=null,$=Function.attempt(function(){return document.createElement("table").innerHTML="<tr><td></td></tr>",!0});var O=document.createElement("tr");O.innerHTML="<td></td>",A="<td></td>"==O.innerHTML,O=null,$&&A&&D||(Element.Properties.html.set=function(e){var t={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};return t.thead=t.tfoot=t.tbody,function(n){if(this.styleSheet)return e.call(this,n);var i=t[this.get("tag")];if(i||D||(i=[0,"",""]),!i)return e.call(this,n);var r=i[0],o=document.createElement("div"),a=o;for(D||T.appendChild(o),o.innerHTML=[i[1],n,i[2]].flatten().join("");r--;)a=a.firstChild;this.empty().adopt(a.childNodes),D||T.removeChild(o),o=null}}(Element.Properties.html.set));var I=document.createElement("form");I.innerHTML="<select><option>s</option></select>","s"!=I.firstChild.value&&(Element.Properties.value={set:function(e){if("select"!=this.get("tag"))return this.setProperty("value",e);var t=this.getElements("option");e=String(e);for(var n=0;n<t.length;n++){var i=t[n],r=i.getAttributeNode("value");if((r&&r.specified?i.value:i.get("text"))===e)return i.selected=!0}},get:function(){var e=this,t=e.get("tag");if("select"!=t&&"option"!=t)return this.getProperty("value");if("select"==t&&!(e=e.getSelected()[0]))return"";var n=e.getAttributeNode("value");return n&&n.specified?e.value:e.get("text")}}),I=null,document.createElement("div").getAttributeNode("id")&&(Element.Properties.id={set:function(e){this.id=this.getAttributeNode("id").value=e},get:function(){return this.id||null},erase:function(){this.id=this.getAttributeNode("id").value=""}})}(),function(){var e,t=document.html;e=document.createElement("div"),e.style.color="red",e.style.color=null;var n="red"==e.style.color;e.style.border="1px solid #123abc";var i="1px solid #123abc"!=e.style.border;e=null;var r=!!window.getComputedStyle,o=null!=document.createElement("div").style.borderRadius;Element.Properties.styles={set:function(e){this.setStyles(e)}};var a=null!=t.style.opacity,s=null!=t.style.filter,l=/alpha\(opacity=([\d.]+)\)/i,c=function(e,t){e.store("$opacity",t),e.style.visibility=t>0||null==t?"visible":"hidden"},u=function(e,t,n){var i=e.style,r=i.filter||e.getComputedStyle("filter")||"";i.filter=(t.test(r)?r.replace(t,n):r+" "+n).trim(),i.filter||i.removeAttribute("filter")},d=a?function(e,t){e.style.opacity=t}:s?function(e,t){e.currentStyle&&e.currentStyle.hasLayout||(e.style.zoom=1),null==t||1==t?(u(e,l,""),1==t&&1!=h(e)&&u(e,l,"alpha(opacity=100)")):u(e,l,"alpha(opacity="+(100*t).limit(0,100).round()+")")}:c,h=a?function(e){var t=e.style.opacity||e.getComputedStyle("opacity");return""==t?1:t.toFloat()}:s?function(e){var t,n=e.style.filter||e.getComputedStyle("filter");return n&&(t=n.match(l)),null==t||null==n?1:t[1]/100}:function(e){var t=e.retrieve("$opacity");return null==t&&(t="hidden"==e.style.visibility?0:1),t},f=null==t.style.cssFloat?"styleFloat":"cssFloat",p={left:"0%",top:"0%",center:"50%",right:"100%",bottom:"100%"},m=null!=t.style.backgroundPositionX,g=/^-(ms)-/,v=function(e){return e.replace(g,"$1-").camelCase()},b=function(e,t){"backgroundPosition"==t&&(e.removeAttribute(t+"X"),t+="Y"),e.removeAttribute(t)};Element.implement({getComputedStyle:function(e){if(!r&&this.currentStyle)return this.currentStyle[v(e)];var t=Element.getDocument(this).defaultView,n=t?t.getComputedStyle(this,null):null;return n?n.getPropertyValue(e==f?"float":e.hyphenate()):""},setStyle:function(e,t){if("opacity"==e)return null!=t&&(t=parseFloat(t)),d(this,t),this;if(e=v("float"==e?f:e),"string"!=typeOf(t)){var i=(Element.Styles[e]||"@").split(" ");t=Array.convert(t).map(function(e,t){return i[t]?"number"==typeOf(e)?i[t].replace("@",Math.round(e)):e:""}).join(" ")}else t==String(Number(t))&&(t=Math.round(t));return this.style[e]=t,(""==t||null==t)&&n&&this.style.removeAttribute&&b(this.style,e),this},getStyle:function(e){if("opacity"==e)return h(this);if(e=v("float"==e?f:e),o&&-1!=e.indexOf("borderRadius"))return["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"].map(function(e){return this.style[e]||"0px"},this).join(" ");var t=this.style[e];if(!t||"zIndex"==e){if(Element.ShortStyles.hasOwnProperty(e)){t=[];for(var n in Element.ShortStyles[e])t.push(this.getStyle(n));return t.join(" ")}t=this.getComputedStyle(e)}if(m&&/^backgroundPosition[XY]?$/.test(e))return t.replace(/(top|right|bottom|left)/g,function(e){return p[e]})||"0px";if(!t&&"backgroundPosition"==e)return"0px 0px";if(t){t=String(t);var a=t.match(/rgba?\([\d\s,]+\)/);a&&(t=t.replace(a[0],a[0].rgbToHex()))}if(!r&&!this.style[e]){if(/^(height|width)$/.test(e)&&!/px$/.test(t)){var s="width"==e?["left","right"]:["top","bottom"],l=0;return s.each(function(e){l+=this.getStyle("border-"+e+"-width").toInt()+this.getStyle("padding-"+e).toInt()},this),this["offset"+e.capitalize()]-l+"px"}if(/^border(.+)Width|margin|padding/.test(e)&&isNaN(parseFloat(t)))return"0px"}return i&&/^border(Top|Right|Bottom|Left)?$/.test(e)&&/^#/.test(t)?t.replace(/^(.+)\s(.+)\s(.+)$/,"$2 $3 $1"):t},setStyles:function(e){for(var t in e)this.setStyle(t,e[t]);return this},getStyles:function(){var e={};return Array.flatten(arguments).each(function(t){e[t]=this.getStyle(t)},this),e}}),Element.Styles={left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundSize:"@px",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@",borderRadius:"@px @px @px @px"},Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}},["Top","Right","Bottom","Left"].each(function(e){var t=Element.ShortStyles,n=Element.Styles;["margin","padding"].each(function(i){var r=i+e;t[i][r]=n[r]="@px"});var i="border"+e;t.border[i]=n[i]="@px @ rgb(@, @, @)";var r=i+"Width",o=i+"Style",a=i+"Color";t[i]={},t.borderWidth[r]=t[i][r]=n[r]="@px",t.borderStyle[o]=t[i][o]=n[o]="@",t.borderColor[a]=t[i][a]=n[a]="rgb(@, @, @)"}),m&&(Element.ShortStyles.backgroundPosition={backgroundPositionX:"@",backgroundPositionY:"@"})}(),function(){Element.Properties.events={set:function(e){this.addEvents(e)}},[Element,Window,Document].invoke("implement",{addEvent:function(e,t){var n=this.retrieve("events",{});if(n[e]||(n[e]={keys:[],values:[]}),n[e].keys.contains(t))return this;n[e].keys.push(t);var i=e,r=Element.Events[e],o=t,a=this;r&&(r.onAdd&&r.onAdd.call(this,t,e),r.condition&&(o=function(n){return!r.condition.call(this,n,e)||t.call(this,n)}),r.base&&(i=Function.convert(r.base).call(this,e)));var s=function(){return t.call(a)},l=Element.NativeEvents[i];return l&&(2==l&&(s=function(e){e=new DOMEvent(e,a.getWindow()),!1===o.call(a,e)&&e.stop()}),this.addListener(i,s,arguments[2])),n[e].values.push(s),this},removeEvent:function(e,t){var n=this.retrieve("events");if(!n||!n[e])return this;var i=n[e],r=i.keys.indexOf(t);if(-1==r)return this;var o=i.values[r];delete i.keys[r],delete i.values[r];var a=Element.Events[e];return a&&(a.onRemove&&a.onRemove.call(this,t,e),a.base&&(e=Function.convert(a.base).call(this,e))),Element.NativeEvents[e]?this.removeListener(e,o,arguments[2]):this},addEvents:function(e){for(var t in e)this.addEvent(t,e[t]);return this},removeEvents:function(e){var t;if("object"==typeOf(e)){for(t in e)this.removeEvent(t,e[t]);return this}var n=this.retrieve("events");if(!n)return this;if(e)n[e]&&(n[e].keys.each(function(t){this.removeEvent(e,t)},this),delete n[e]);else{for(t in n)this.removeEvents(t);this.eliminate("events")}return this},fireEvent:function(e,t,n){var i=this.retrieve("events");return i&&i[e]?(t=Array.convert(t),i[e].keys.each(function(e){n?e.delay(n,this,t):e.apply(this,t)},this),this):this},cloneEvents:function(e,t){e=document.id(e);var n=e.retrieve("events");if(!n)return this;if(t)n[t]&&n[t].keys.each(function(e){this.addEvent(t,e)},this);else for(var i in n)this.cloneEvents(e,i);return this}}),Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,wheel:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,orientationchange:2,touchstart:2,touchmove:2,touchend:2,touchcancel:2,gesturestart:2,gesturechange:2,gestureend:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,paste:2,input:2,load:2,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,hashchange:1,popstate:2,pageshow:2,pagehide:2,error:1,abort:1,scroll:1,message:2},Element.Events={mousewheel:{base:"onwheel"in document?"wheel":"onmousewheel"in document?"mousewheel":"DOMMouseScroll"}};var e=function(e){var t=e.relatedTarget;return null==t||!!t&&(t!=this&&"xul"!=t.prefix&&"document"!=typeOf(this)&&!this.contains(t))};"onmouseenter"in document.documentElement?(Element.NativeEvents.mouseenter=Element.NativeEvents.mouseleave=2,Element.MouseenterCheck=e):(Element.Events.mouseenter={base:"mouseover",condition:e},Element.Events.mouseleave={base:"mouseout",condition:e}),window.addEventListener||(Element.NativeEvents.propertychange=2,Element.Events.change={base:function(){var e=this.type;return"input"!=this.get("tag")||"radio"!=e&&"checkbox"!=e?"change":"propertychange"},condition:function(e){return"propertychange"!=e.type||"checked"==e.event.propertyName}})}(),function(){var e=!!window.addEventListener;Element.NativeEvents.focusin=Element.NativeEvents.focusout=2;var t=function(e,t,n,i,r){for(;r&&r!=e;){if(t(r,i))return n.call(r,i,r);r=document.id(r.parentNode)}},n={mouseenter:{base:"mouseover",condition:Element.MouseenterCheck},mouseleave:{base:"mouseout",condition:Element.MouseenterCheck},focus:{base:"focus"+(e?"":"in"),capture:!0},blur:{base:e?"blur":"focusout",capture:!0}},i="$delegation:",r=function(e){return{base:"focusin",remove:function(t,n){var r=t.retrieve(i+e+"listeners",{})[n];if(r&&r.forms)for(var o=r.forms.length;o--;)r.forms[o].removeEvent&&r.forms[o].removeEvent(e,r.fns[o])},listen:function(n,r,o,a,s,l){var c="form"==s.get("tag")?s:a.target.getParent("form");if(c){var u=n.retrieve(i+e+"listeners",{}),d=u[l]||{forms:[],fns:[]},h=d.forms,f=d.fns;if(-1==h.indexOf(c)){h.push(c);var p=function(e){t(n,r,o,e,s)};c.addEvent(e,p),f.push(p),u[l]=d,n.store(i+e+"listeners",u)}}}}},o=function(e){return{base:"focusin",listen:function(n,i,r,o,a){var s={blur:function(){this.removeEvents(s)}};s[e]=function(e){t(n,i,r,e,a)},o.target.addEvents(s)}}};e||Object.append(n,{submit:r("submit"),reset:r("reset"),change:o("change"),select:o("select")});var a=Element.prototype,s=a.addEvent,l=a.removeEvent,c=function(e,t){return function(n,i,r){if(-1==n.indexOf(":relay"))return e.call(this,n,i,r);var o=Slick.parse(n).expressions[0][0];if("relay"!=o.pseudos[0].key)return e.call(this,n,i,r);var a=o.tag;return o.pseudos.slice(1).each(function(e){a+=":"+e.key+(e.value?"("+e.value+")":"")}),e.call(this,n,i),t.call(this,a,o.pseudos[0].value,i)}},u={addEvent:function(e,i,r){var o=this.retrieve("$delegates",{}),a=o[e];if(a)for(var l in a)if(a[l].fn==r&&a[l].match==i)return this;var c=e,u=i,d=r,h=n[e]||{};e=h.base||c,i=function(e){return Slick.match(e,u)};var f=Element.Events[c];if(h.condition||f&&f.condition){var p=i,m=h.condition||f.condition;i=function(t,n){return p(t,n)&&m.call(t,n,e)}}var g=this,v=String.uniqueID(),b=h.listen?function(e,t){!t&&e&&e.target&&(t=e.target),t&&h.listen(g,i,r,e,t,v)}:function(e,n){!n&&e&&e.target&&(n=e.target),n&&t(g,i,r,e,n)};return a||(a={}),a[v]={match:u,fn:d,delegator:b},o[c]=a,s.call(this,e,b,h.capture)},removeEvent:function(e,t,i,r){var o=this.retrieve("$delegates",{}),a=o[e];if(!a)return this;if(r){var s=e,c=a[r].delegator,d=n[e]||{};return e=d.base||s,d.remove&&d.remove(this,r),delete a[r],o[s]=a,l.call(this,e,c,d.capture)}var h,f;if(i){for(h in a)if(f=a[h],f.match==t&&f.fn==i)return u.removeEvent.call(this,e,t,i,h)}else for(h in a)f=a[h],f.match==t&&u.removeEvent.call(this,e,t,f.fn,h);return this}};[Element,Window,Document].invoke("implement",{addEvent:c(s,u.addEvent),removeEvent:c(l,u.removeEvent)})}(),function(){function e(e,t){return f(e,t).toInt()||0}function t(t){return e(t,"border-top-width")}function n(t){return e(t,"border-left-width")}function i(e){return/^(?:body|html)$/i.test(e.tagName)}function r(e){var t=e.getDocument();return t.compatMode&&"CSS1Compat"!=t.compatMode?t.body:t.html}var o=document.createElement("div"),a=document.createElement("div");o.style.height="0",o.appendChild(a);var s=a.offsetParent===o;o=a=null;var l=["height","paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"],c=["width","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],u=function(e){var t=window.getComputedStyle(e),n={x:0,y:0};return l.each(function(e){n.y+=parseFloat(t[e])}),c.each(function(e){n.x+=parseFloat(t[e])}),n},d=function(e){return"static"!=f(e,"position")||i(e)},h=function(e){return d(e)||/^(?:table|td|th)$/i.test(e.tagName)};Element.implement({scrollTo:function(e,t){return i(this)?this.getWindow().scrollTo(e,t):(this.scrollLeft=e,this.scrollTop=t),this},getSize:function(){if(i(this))return this.getWindow().getSize();if(!window.getComputedStyle)return{x:this.offsetWidth,y:this.offsetHeight};if("svg"==this.get("tag"))return u(this);try{var e=this.getBoundingClientRect();return{x:e.width,y:e.height}}catch(e){return{x:0,y:0}}},getScrollSize:function(){return i(this)?this.getWindow().getScrollSize():{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){return i(this)?this.getWindow().getScroll():{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){for(var e=this.parentNode,t={x:0,y:0};e&&!i(e);)t.x+=e.scrollLeft,t.y+=e.scrollTop,e=e.parentNode;return t},getOffsetParent:s?function(){var e=this;if(i(e)||"fixed"==f(e,"position"))return null;for(var t="static"==f(e,"position")?h:d;e=e.parentNode;)if(t(e))return e;return null}:function(){var e=this;if(i(e)||"fixed"==f(e,"position"))return null;try{return e.offsetParent}catch(e){}return null},getOffsets:function(){if(this.getBoundingClientRect){var e=this.getBoundingClientRect(),t=document.id(this.getDocument().documentElement),n=t.getScroll(),r=this.getScrolls(),o="fixed"==f(this,"position");return{x:e.left.toFloat()+r.x+(o?0:n.x)-t.clientLeft,y:e.top.toFloat()+r.y+(o?0:n.y)-t.clientTop}}var a=this,s={x:0,y:0};if(i(this))return s;for(;a&&!i(a);)s.x+=a.offsetLeft,s.y+=a.offsetTop,a=a.offsetParent;return s},getPosition:function(e){var i=this.getOffsets(),r=this.getScrolls(),o={x:i.x-r.x,y:i.y-r.y};if(e&&(e=document.id(e))){var a=e.getPosition();return{x:o.x-a.x-n(e),y:o.y-a.y-t(e)}}return o},getCoordinates:function(e){if(i(this))return this.getWindow().getCoordinates();var t=this.getPosition(e),n=this.getSize(),r={left:t.x,top:t.y,width:n.x,height:n.y};return r.right=r.left+r.width,r.bottom=r.top+r.height,r},computePosition:function(t){return{left:t.x-e(this,"margin-left"),top:t.y-e(this,"margin-top")}},setPosition:function(e){return this.setStyles(this.computePosition(e))}}),[Document,Window].invoke("implement",{getSize:function(){var e=r(this);return{x:e.clientWidth,y:e.clientHeight}},getScroll:function(){var e=this.getWindow(),t=r(this);return{x:e.pageXOffset||t.scrollLeft,y:e.pageYOffset||t.scrollTop}},getScrollSize:function(){var e=r(this),t=this.getSize(),n=this.getDocument().body;return{x:Math.max(e.scrollWidth,n.scrollWidth,t.x),y:Math.max(e.scrollHeight,n.scrollHeight,t.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var e=this.getSize();return{top:0,left:0,bottom:e.y,right:e.x,height:e.y,width:e.x}}});var f=Element.getComputedStyle}(),Element.alias({position:"setPosition"}),[Window,Document,Element].invoke("implement",{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}}),function(){var e=this.Fx=new Class({Implements:[Chain,Events,Options,Class.Thenable],options:{fps:60,unit:!1,duration:500,frames:null,frameSkip:!0,link:"ignore"},initialize:function(e){this.subject=this.subject||this,this.setOptions(e)},getTransition:function(){return function(e){return-(Math.cos(Math.PI*e)-1)/2}},step:function(e){if(this.options.frameSkip){var t=null!=this.time?e-this.time:0,n=t/this.frameInterval;this.time=e,this.frame+=n}else this.frame++;if(this.frame<this.frames){var i=this.transition(this.frame/this.frames);this.set(this.compute(this.from,this.to,i))}else this.frame=this.frames,this.set(this.compute(this.from,this.to,1)),this.stop()},set:function(e){return e},compute:function(t,n,i){return e.compute(t,n,i)},check:function(){if(!this.isRunning())return!0;switch(this.options.link){case"cancel":return this.cancel(),!0;case"chain":return this.chain(this.caller.pass(arguments,this)),!1}return!1},start:function(t,n){if(!this.check(t,n))return this;this.from=t,this.to=n,this.frame=this.options.frameSkip?0:-1,this.time=null,this.transition=this.getTransition();var i=this.options.frames,o=this.options.fps,a=this.options.duration;return this.duration=e.Durations[a]||a.toInt(),this.frameInterval=1e3/o,this.frames=i||Math.round(this.duration/this.frameInterval),"pending"!==this.getThenableState()&&this.resetThenable(this.subject),this.fireEvent("start",this.subject),r.call(this,o),this},stop:function(){return this.isRunning()&&(this.time=null,o.call(this,this.options.fps),this.frames==this.frame?(this.fireEvent("complete",this.subject),this.callChain()||this.fireEvent("chainComplete",this.subject)):this.fireEvent("stop",this.subject),this.resolve(this.subject===this?null:this.subject)),this},cancel:function(){return this.isRunning()&&(this.time=null,o.call(this,this.options.fps),this.frame=this.frames,this.fireEvent("cancel",this.subject).clearChain(),this.reject(this.subject)),this},pause:function(){return this.isRunning()&&(this.time=null,o.call(this,this.options.fps)),this},resume:function(){return this.isPaused()&&r.call(this,this.options.fps),this},isRunning:function(){var e=t[this.options.fps];return e&&e.contains(this)},isPaused:function(){return this.frame<this.frames&&!this.isRunning()}});e.compute=function(e,t,n){return(t-e)*n+e},e.Durations={short:250,normal:500,long:1e3};var t={},n={},i=function(){for(var e=Date.now(),t=this.length;t--;){var n=this[t];n&&n.step(e)}},r=function(e){var r=t[e]||(t[e]=[]);r.push(this),n[e]||(n[e]=i.periodical(Math.round(1e3/e),r))},o=function(e){var i=t[e];i&&(i.erase(this),!i.length&&n[e]&&(delete t[e],n[e]=clearInterval(n[e])))}}(),Fx.CSS=new Class({Extends:Fx,prepare:function(e,t,n){n=Array.convert(n);var i=n[0],r=n[1];if(null==r){r=i,i=e.getStyle(t);var o=this.options.unit;if(o&&i&&"string"==typeof i&&i.slice(-o.length)!=o&&0!=parseFloat(i)){e.setStyle(t,r+o);var a=e.getComputedStyle(t);if(!/px$/.test(a)&&null==(a=e.style[("pixel-"+t).camelCase()])){var s=e.style.left;e.style.left=r+o,a=e.style.pixelLeft,e.style.left=s}i=(r||1)/(parseFloat(a)||1)*(parseFloat(i)||0),e.setStyle(t,i+o)}}return{from:this.parse(i),to:this.parse(r)}},parse:function(e){return e=Function.convert(e)(),e="string"==typeof e?e.split(" "):Array.convert(e),e.map(function(e){e=String(e);var t=!1;return Object.each(Fx.CSS.Parsers,function(n){if(!t){var i=n.parse(e);(i||0===i)&&(t={value:i,parser:n})}}),t=t||{value:e,parser:Fx.CSS.Parsers.String}})},compute:function(e,t,n){var i=[];return Math.min(e.length,t.length).times(function(r){i.push({value:e[r].parser.compute(e[r].value,t[r].value,n),parser:e[r].parser})}),i.$family=Function.convert("fx:css:value"),i},serve:function(e,t){"fx:css:value"!=typeOf(e)&&(e=this.parse(e));var n=[];return e.each(function(e){n=n.concat(e.parser.serve(e.value,t))}),n},render:function(e,t,n,i){e.setStyle(t,this.serve(n,i))},search:function(e){if(Fx.CSS.Cache[e])return Fx.CSS.Cache[e];var t={},n=new RegExp("^"+e.escapeRegExp()+"$"),i=function(e){Array.each(e,function(e){if(e.media)return void i(e.rules||e.cssRules);if(e.style){var r=e.selectorText?e.selectorText.replace(/^\w+/,function(e){return e.toLowerCase()}):null;r&&n.test(r)&&Object.each(Element.Styles,function(n,i){e.style[i]&&!Element.ShortStyles[i]&&(n=String(e.style[i]),t[i]=/^rgb/.test(n)?n.rgbToHex():n)})}})};return Array.each(document.styleSheets,function(e){var t=e.href;if(!(t&&t.indexOf("://")>-1&&-1==t.indexOf(document.domain))){var n=e.rules||e.cssRules;i(n)}}),Fx.CSS.Cache[e]=t}}),Fx.CSS.Cache={},Fx.CSS.Parsers={Color:{parse:function(e){return e.match(/^#[0-9a-f]{3,6}$/i)?e.hexToRgb(!0):!!(e=e.match(/(\d+),\s*(\d+),\s*(\d+)/))&&[e[1],e[2],e[3]]},compute:function(e,t,n){return e.map(function(i,r){return Math.round(Fx.compute(e[r],t[r],n))})},serve:function(e){return e.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(e,t){return t?e+t:e}},String:{parse:Function.convert(!1),compute:function(e,t){return t},serve:function(e){return e}}},Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(e,t){this.element=this.subject=document.id(e),this.parent(t)},set:function(e,t){return 1==arguments.length&&(t=e,e=this.property||this.options.property),this.render(this.element,e,t,this.options.unit),this},start:function(e,t,n){if(!this.check(e,t,n))return this;var i=Array.flatten(arguments);this.property=this.options.property||i.shift();var r=this.prepare(this.element,this.property,i);return this.parent(r.from,r.to)}}),Element.Properties.tween={set:function(e){return this.get("tween").cancel().setOptions(e),this},get:function(){var e=this.retrieve("tween");return e||(e=new Fx.Tween(this,{link:"cancel"}),this.store("tween",e)),e}},Element.implement({tween:function(e,t,n){return this.get("tween").start(e,t,n),this},fade:function(){var e,t,n=this.get("tween"),i=["opacity"].append(arguments);switch(null==i[1]&&(i[1]="toggle"),i[1]){case"in":e="start",i[1]=1;break;case"out":e="start",i[1]=0;break;case"show":e="set",i[1]=1;break;case"hide":e="set",i[1]=0;break;case"toggle":var r=this.retrieve("fade:flag",1==this.getStyle("opacity"));e="start",i[1]=r?0:1,this.store("fade:flag",!r),t=!0;break;default:e="start"}t||this.eliminate("fade:flag"),n[e].apply(n,i);var o=i[i.length-1];return"set"==e?this.setStyle("visibility",0==o?"hidden":"visible"):0!=o?n.$chain.length?n.chain(function(){this.element.setStyle("visibility","visible"),this.callChain()}):this.setStyle("visibility","visible"):n.chain(function(){this.element.getStyle("opacity")||(this.element.setStyle("visibility","hidden"),this.callChain())}),this},highlight:function(e,t){t||(t=this.retrieve("highlight:original",this.getStyle("background-color")),t="transparent"==t?"#fff":t);var n=this.get("tween");return n.start("background-color",e||"#ffff88",t).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")),n.callChain()}.bind(this)),this}}),Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(e,t){this.element=this.subject=document.id(e),this.parent(t)},set:function(e){"string"==typeof e&&(e=this.search(e));for(var t in e)this.render(this.element,t,e[t],this.options.unit);return this},compute:function(e,t,n){var i={};for(var r in e)i[r]=this.parent(e[r],t[r],n);return i},start:function(e){if(!this.check(e))return this;"string"==typeof e&&(e=this.search(e));var t={},n={};for(var i in e){var r=this.prepare(this.element,i,e[i]);t[i]=r.from,n[i]=r.to}return this.parent(t,n)}}),Element.Properties.morph={set:function(e){return this.get("morph").cancel().setOptions(e),this},get:function(){var e=this.retrieve("morph");return e||(e=new Fx.Morph(this,{link:"cancel"}),this.store("morph",e)),e}},Element.implement({morph:function(e){return this.get("morph").start(e),this}}),Fx.implement({getTransition:function(){var e=this.options.transition||Fx.Transitions.Sine.easeInOut;if("string"==typeof e){var t=e.split(":");e=Fx.Transitions,e=e[t[0]]||e[t[0].capitalize()],t[1]&&(e=e["ease"+t[1].capitalize()+(t[2]?t[2].capitalize():"")])}return e}}),Fx.Transition=function(e,t){t=Array.convert(t);var n=function(n){return e(n,t)};return Object.append(n,{easeIn:n,easeOut:function(n){return 1-e(1-n,t)},easeInOut:function(n){return(.5>=n?e(2*n,t):2-e(2*(1-n),t))/2}})},Fx.Transitions={linear:function(e){return e}},Fx.Transitions.extend=function(e){for(var t in e)Fx.Transitions[t]=new Fx.Transition(e[t])},Fx.Transitions.extend({Pow:function(e,t){return Math.pow(e,t&&t[0]||6)},Expo:function(e){return Math.pow(2,8*(e-1))},Circ:function(e){return 1-Math.sin(Math.acos(e))},Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Back:function(e,t){return t=t&&t[0]||1.618,Math.pow(e,2)*((t+1)*e-t)},Bounce:function(e){for(var t,n=0,i=1;1;n+=i,i/=2)if(e>=(7-4*n)/11){t=i*i-Math.pow((11-6*n-11*e)/4,2);break}return t},Elastic:function(e,t){return Math.pow(2,10*--e)*Math.cos(20*e*Math.PI*(t&&t[0]||1)/3)}}),["Quad","Cubic","Quart","Quint"].each(function(e,t){Fx.Transitions[e]=new Fx.Transition(function(e){return Math.pow(e,t+2)})}),function(){var e=function(){},t="onprogress"in new Browser.Request,n=this.Request=new Class({Implements:[Chain,Events,Options,Class.Thenable],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:!0,format:!1,method:"post",link:"ignore",isSuccess:null,emulation:!0,urlEncoded:!0,encoding:"utf-8",evalScripts:!1,evalResponse:!1,timeout:0,noCache:!1},initialize:function(e){this.xhr=new Browser.Request,this.setOptions(e),this.headers=this.options.headers},onStateChange:function(){var n=this.xhr;4==n.readyState&&this.running&&(this.running=!1,this.status=0,Function.attempt(function(){var e=n.status;this.status=1223==e?204:e}.bind(this)),n.onreadystatechange=e,t&&(n.onprogress=n.onloadstart=e),this.timer&&(clearTimeout(this.timer),delete this.timer),this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML},this.options.isSuccess.call(this,this.status)?this.success(this.response.text,this.response.xml):this.failure())},isSuccess:function(){var e=this.status;return e>=200&&300>e},isRunning:function(){return!!this.running},processScripts:function(e){return this.options.evalResponse||/(ecma|java)script/.test(this.getHeader("Content-type"))?Browser.exec(e):e.stripScripts(this.options.evalScripts)},success:function(e,t){this.onSuccess(this.processScripts(e),t),this.resolve({text:e,xml:t})},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure(),this.reject({reason:"failure",xhr:this.xhr})},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr])},progress:function(e){this.fireEvent("progress",[e,this.xhr])},timeout:function(){this.fireEvent("timeout",this.xhr),this.reject({reason:"timeout",xhr:this.xhr})},setHeader:function(e,t){return this.headers[e]=t,this},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e)}.bind(this))},check:function(){if(!this.running)return!0;switch(this.options.link){case"cancel":return this.cancel(),!0;case"chain":return this.chain(this.caller.pass(arguments,this)),!1}return!1},send:function(e){if(!this.check(e))return this;this.options.isSuccess=this.options.isSuccess||this.isSuccess,this.running=!0;var n=typeOf(e);("string"==n||"element"==n)&&(e={data:e});var i=this.options;e=Object.append({data:i.data,url:i.url,method:i.method},e);var r=e.data,o=String(e.url),a=e.method.toLowerCase();switch(typeOf(r)){case"element":r=document.id(r).toQueryString();break;case"object":case"hash":r=Object.toQueryString(r)}if(this.options.format){var s="format="+this.options.format;r=r?s+"&"+r:s}if(this.options.emulation&&!["get","post"].contains(a)){var l="_method="+a;r=r?l+"&"+r:l,a="post"}if(this.options.urlEncoded&&["post","put"].contains(a)){var c=this.options.encoding?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+c}o||(o=document.location.pathname);var u=o.lastIndexOf("/");u>-1&&(u=o.indexOf("#"))>-1&&(o=o.substr(0,u)),this.options.noCache&&(o+=(o.indexOf("?")>-1?"&":"?")+String.uniqueID()),!r||"get"!=a&&"delete"!=a||(o+=(o.indexOf("?")>-1?"&":"?")+r,r=null);var d=this.xhr;return t&&(d.onloadstart=this.loadstart.bind(this),d.onprogress=this.progress.bind(this)),d.open(a.toUpperCase(),o,this.options.async,this.options.user,this.options.password),this.options.withCredentials&&"withCredentials"in d&&(d.withCredentials=!0),d.onreadystatechange=this.onStateChange.bind(this),Object.each(this.headers,function(e,t){try{d.setRequestHeader(t,e)}catch(n){this.fireEvent("exception",[t,e]),this.reject({reason:"exception",xhr:d,exception:n})}},this),"pending"!==this.getThenableState()&&this.resetThenable({reason:"send"}),this.fireEvent("request"),d.send(r),this.options.async?this.options.timeout&&(this.timer=this.timeout.delay(this.options.timeout,this)):this.onStateChange(),this},cancel:function(){if(!this.running)return this;this.running=!1;var n=this.xhr;return n.abort(),this.timer&&(clearTimeout(this.timer),delete this.timer),n.onreadystatechange=e,t&&(n.onprogress=n.onloadstart=e),this.xhr=new Browser.Request,this.fireEvent("cancel"),this.reject({reason:"cancel",xhr:n}),this}}),i={};["get","post","put","delete","patch","head","GET","POST","PUT","DELETE","PATCH","HEAD"].each(function(e){i[e]=function(t){var n={method:e};return null!=t&&(n.data=t),this.send(n)}}),n.implement(i),Element.Properties.send={set:function(e){return this.get("send").cancel().setOptions(e),this},get:function(){var e=this.retrieve("send");return e||(e=new n({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")}),this.store("send",e)),e}},Element.implement({send:function(e){var t=this.get("send");return t.send({data:this,url:e||t.options.url}),this}})}(),Request.HTML=new Class({Extends:Request,options:{update:!1,append:!1,evalScripts:!0,filter:!1,headers:{
Accept:"text/html, application/xml, text/xml, */*"}},success:function(e){var t=this.options,n=this.response;n.html=e.stripScripts(function(e){n.javascript=e});var i=n.html.match(/<body[^>]*>([\s\S]*?)<\/body>/i);i&&(n.html=i[1]);var r=new Element("div").set("html",n.html);if(n.tree=r.childNodes,n.elements=r.getElements(t.filter||"*"),t.filter&&(n.tree=n.elements),t.update){var o=document.id(t.update).empty();t.filter?o.adopt(n.elements):o.set("html",n.html)}else if(t.append){var a=document.id(t.append);t.filter?n.elements.reverse().inject(a):a.adopt(r.getChildren())}t.evalScripts&&Browser.exec(n.javascript),this.onSuccess(n.tree,n.elements,n.html,n.javascript),this.resolve({tree:n.tree,elements:n.elements,html:n.html,javascript:n.javascript})}}),Element.Properties.load={set:function(e){return this.get("load").cancel().setOptions(e),this},get:function(){var e=this.retrieve("load");return e||(e=new Request.HTML({data:this,link:"cancel",update:this,method:"get"}),this.store("load",e)),e}},Element.implement({load:function(){return this.get("load").send(Array.link(arguments,{data:Type.isObject,url:Type.isString})),this}}),"undefined"==typeof JSON&&(this.JSON={}),function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},escape=function(e){return special[e]||"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)};JSON.validate=function(e){return e=e.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""),/^[\],:{}\s]*$/.test(e)},JSON.encode=JSON.stringify?function(e){return JSON.stringify(e)}:function(e){switch(e&&e.toJSON&&(e=e.toJSON()),typeOf(e)){case"string":return'"'+e.replace(/[\x00-\x1f\\"]/g,escape)+'"';case"array":return"["+e.map(JSON.encode).clean()+"]";case"object":case"hash":var t=[];return Object.each(e,function(e,n){var i=JSON.encode(e);i&&t.push(JSON.encode(n)+":"+i)}),"{"+t+"}";case"number":case"boolean":return""+e;case"null":return"null"}return null},JSON.secure=!0,JSON.decode=function(string,secure){if(!string||"string"!=typeOf(string))return null;if(null==secure&&(secure=JSON.secure),secure){if(JSON.parse)return JSON.parse(string);if(!JSON.validate(string))throw new Error("JSON could not decode the input; security is enabled and the value is not secure.")}return eval("("+string+")")}}(),Request.JSON=new Class({Extends:Request,options:{secure:!0},initialize:function(e){this.parent(e),Object.append(this.headers,{Accept:"application/json","X-Request":"JSON"})},success:function(e){var t;try{t=this.response.json=JSON.decode(e,this.options.secure)}catch(t){return void this.fireEvent("error",[e,t])}null==t?this.failure():(this.onSuccess(t,e),this.resolve({json:t,text:e}))}});var Cookie=new Class({Implements:Options,options:{path:"/",domain:!1,duration:!1,secure:!1,document:document,encode:!0,httpOnly:!1},initialize:function(e,t){this.key=e,this.setOptions(t)},write:function(e){if(this.options.encode&&(e=encodeURIComponent(e)),this.options.domain&&(e+="; domain="+this.options.domain),this.options.path&&(e+="; path="+this.options.path),this.options.duration){var t=new Date;t.setTime(t.getTime()+24*this.options.duration*60*60*1e3),e+="; expires="+t.toGMTString()}return this.options.secure&&(e+="; secure"),this.options.httpOnly&&(e+="; HttpOnly"),this.options.document.cookie=this.key+"="+e,this},read:function(){var e=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return e?decodeURIComponent(e[1]):null},dispose:function(){return new Cookie(this.key,Object.merge({},this.options,{duration:-1})).write(""),this}});Cookie.write=function(e,t,n){return new Cookie(e,n).write(t)},Cookie.read=function(e){return new Cookie(e).read()},Cookie.dispose=function(e,t){return new Cookie(e,t).dispose()},function(e,t){var n,i,r,o,a=[],s=t.createElement("div"),l=function(){clearTimeout(o),n||(Browser.loaded=n=!0,t.removeListener("DOMContentLoaded",l).removeListener("readystatechange",c),t.fireEvent("domready"),e.fireEvent("domready")),t=e=s=null},c=function(){for(var e=a.length;e--;)if(a[e]())return l(),!0;return!1},u=function(){clearTimeout(o),c()||(o=setTimeout(u,10))};t.addListener("DOMContentLoaded",l);var d=function(){try{return s.doScroll(),!0}catch(e){}return!1};s.doScroll&&!d()&&(a.push(d),r=!0),t.readyState&&a.push(function(){var e=t.readyState;return"loaded"==e||"complete"==e}),"onreadystatechange"in t?t.addListener("readystatechange",c):r=!0,r&&u(),Element.Events.domready={onAdd:function(e){n&&e.call(this)}},Element.Events.load={base:"load",onAdd:function(t){i&&this==e&&t.call(this)},condition:function(){return this==e&&(l(),delete Element.Events.load),!0}},e.addEvent("load",function(){i=!0})}(window,document),define("mootools-core",function(){}),define("pgui.admin-page-main",["pgui.user_management_api","pgui.localizer","libs/sprintf","pgui.utils","knockout","pgui.change_password_dialog","bootbox","mootools-core"],function(e,t,n,i,r){return function(){window.PhpGenAdmin.Utils={showProgressCursor:function(){$("body").addClass("cursor-progress")},hideProgressCursor:function(){$("body").removeClass("cursor-progress")}},window.PhpGenAdmin.UserViewModel=new Class({initialize:function(e,t,n,i,o,a,s){this.api=e,this.id=t,this.name=r.observable(n),this.password=i,this.email=r.observable(o),this.status=r.observable(a),this.editable=r.observable(s),this.grantsLoaded=r.observable(!1),this.grantsExpanded=r.observable(!1),this.grants=r.observableArray([])},_loadGrants:function(){this.api.getUserGrants(this.id).done(function(e){for(var t=0;t<e.length;t++)this.grants.push(new PhpGenAdmin.UserPageGrantsViewModel(this.api,this.id,e[t].name,e[t].caption,e[t].selectGrant,e[t].updateGrant,e[t].insertGrant,e[t].deleteGrant,e[t].adminGrant));this.grantsLoaded(!0)}.bind(this))},collapseGrants:function(){this.grantsExpanded(!1)},expandGrants:function(){this.grantsExpanded()||(this.grantsExpanded(!0),this.grantsLoaded()||this._loadGrants())},toggleGrantsExpanded:function(){this.grantsExpanded()?this.grantsExpanded(!1):(this.grantsExpanded(!0),this.grantsLoaded()||this._loadGrants())}}),window.PhpGenAdmin.UserPageGrantsViewModel=new Class({initialize:function(e,t,n,i,o,a,s,l,c){this.api=e,this.userId=t,this.pageName=r.observable(n),this.caption=r.observable(i),this.selectGrant=r.observable(o),this.updateGrant=r.observable(a),this.insertGrant=r.observable(s),this.deleteGrant=r.observable(l),this.adminGrant=r.observable(c),this.selectGrant.subscribe(function(e){this._updateUserGrant("SELECT",e)}.bind(this)),this.updateGrant.subscribe(function(e){this._updateUserGrant("UPDATE",e)}.bind(this)),this.insertGrant.subscribe(function(e){this._updateUserGrant("INSERT",e)}.bind(this)),this.deleteGrant.subscribe(function(e){this._updateUserGrant("DELETE",e)}.bind(this)),this.adminGrant.subscribe(function(e){this._updateUserGrant("ADMIN",e)}.bind(this))},isApplication:function(){return 0===this.pageName().length},_updateUserGrant:function(e,t){PhpGenAdmin.Utils.showProgressCursor(),function(){return t?this.api.addUserGrant(this.userId,this.pageName(),e):this.api.removeUserGrant(this.userId,this.pageName(),e)}.bind(this)().always(function(){PhpGenAdmin.Utils.hideProgressCursor()}).fail(function(e){i.showErrorMessage(e)})}}),window.PhpGenAdmin.AdminPanelViewModel=function(e){this.api=e,this.newUser={id:r.observable(""),name:r.observable("New user"),password:r.observable(""),confirmedPassword:r.observable(""),email:r.observable("")},this.changePasswordUser={id:r.observable(""),name:r.observable("")},this.editUser={id:r.observable(""),name:r.observable("Edit user"),password:r.observable(""),email:r.observable(""),status:r.observable("")},this.currentUserRoles=r.observableArray([]),this.invokeRemoveUserDialog=function(e){var r=this;bootbox.confirm(n.sprintf(t.getString("DeleteUserConfirmation"),e.name()),function(t){t&&(PhpGenAdmin.Utils.showProgressCursor(),r.api.removeUser(e.id).done(function(t){r.users.remove(e)}.bind(this)).always(function(){PhpGenAdmin.Utils.hideProgressCursor()}).fail(function(e){i.showErrorMessage(e)}))})},this.invokeChangeUserPasswordDialog=function(e){var t=this;t.changePasswordUser.id(e.id),t.changePasswordUser.name(e.name()),PhpGenChangePasswordDialog.open()},this.invokeEditUserDialog=function(e){var t=this,n=$("#pg-admin-edit-user-dialog");t.editUser.id(e.id),t.editUser.name(e.name()),t.editUser.password(e.password),t.editUser.email(e.email()),t.editUser.status(e.status()),$("#save-edit-user-dialog").bind("click",function(r){r.preventDefault(),t.emailBasedFeaturesEnabled?t.api.updateUser(t.editUser.id(),t.editUser.name(),t.editUser.email(),t.editUser.status()).fail(function(e){i.showErrorMessage(e)}).done(function(t){n.modal("hide"),e.name(t.name),e.email(t.email),e.status(t.status)}):t.api.changeUserName(t.editUser.id(),t.editUser.name()).fail(function(e){i.showErrorMessage(e)}).done(function(t){n.modal("hide"),e.name(t.username)})}),n.modal("show"),$("#user-username").focus(),n.bind("hidden.bs.modal",function(){$("#save-edit-user-dialog").unbind("click"),n.unbind("hidden.bs.modal")})},this.expandAllGrants=function(){for(var e=0;e<this.users().length;e++)this.users()[e].expandGrants()},this.collapseAllGrants=function(){for(var e=0;e<this.users().length;e++)this.users()[e].collapseGrants()},this.invokeAddUserDialog=function(){var e=this,t=$("#pg-admin-create-user-dialog"),n=$("#newuser-confirmed-password-error");e.newUser.id(""),e.newUser.name("New user"),e.newUser.password(""),e.newUser.confirmedPassword(""),n.hide(),e.newUser.email(""),$("#save-create-user-dialog").bind("click",function(r){r.preventDefault(),PhpGenPasswordDialogUtils.validateConfirmedPassword(e.newUser.password(),e.newUser.confirmedPassword(),n)&&(e.emailBasedFeaturesEnabled?e.api.addUserEx(e.newUser.name(),e.newUser.password(),e.newUser.email()).fail(function(e){i.showErrorMessage(e)}).done(function(n){t.modal("hide"),e.users.push(new PhpGenAdmin.UserViewModel(e.api,n.id,n.name,n.password,n.email,0,!0))}):e.api.addUser(e.newUser.name(),e.newUser.password()).fail(function(e){i.showErrorMessage(e)}).done(function(n){t.modal("hide"),e.users.push(new PhpGenAdmin.UserViewModel(e.api,n.id,n.name,n.password,"",0,!0))}))}),t.modal("show"),$("#newuser-id").focus(),t.bind("hidden.bs.modal",function(){$("#save-create-user-dialog").unbind("click"),t.unbind("hidden.bs.modal")})},this.users=r.observableArray([]),this.usersOnCurrentPage=r.dependentObservable(function(){return this.users.slice(0,this.users().length).sort(function(e,t){return-1===e.id||0===e.id?0===t.id?1:-1:e.name()<t.name()?-1:e.name()>t.name()?1:0})},this)};var o=e;window.PhpGenAdmin.adminPanelViewModel=new PhpGenAdmin.AdminPanelViewModel(o),PhpGenAdmin.adminPanelViewModel.emailBasedFeaturesEnabled=PhpGenAdmin.EmailBasedFeaturesEnabled;var a;for(a=0;a<PhpGenAdmin.CurrentUsers.length;a++)PhpGenAdmin.adminPanelViewModel.users.push(new PhpGenAdmin.UserViewModel(o,PhpGenAdmin.CurrentUsers[a].id,PhpGenAdmin.CurrentUsers[a].name,PhpGenAdmin.CurrentUsers[a].password,PhpGenAdmin.CurrentUsers[a].email,PhpGenAdmin.CurrentUsers[a].status,PhpGenAdmin.CurrentUsers[a].editable));r.applyBindings(PhpGenAdmin.adminPanelViewModel),PhpGenChangePasswordDialog.initialize(new PhpGenChangePasswordDialogAdminStrategy(function(e){return o.changeUserPassword(PhpGenAdmin.adminPanelViewModel.changePasswordUser.id,e)})),$("#pg-admin-create-user-dialog").modal({show:!1}),$("#pg-admin-edit-user-dialog").modal({show:!1})}}),define("pgui.validation-utils",["pgui.localizer"],function(e){return{validatePasswordBasedForm:function(t,n){return t.password===t.confirmedpassword||(n.SetMessage(e.getString("PasswordAndConfirmationPasswordMustMatch")),!1)}}}),define("pgui.registration-page",["pgui.form-page-main","pgui.validation-utils"],function(e,t){return function(){e(),window.registrationFormValidation=t.validatePasswordBasedForm}}),define("pgui.reset-password-page",["pgui.form-page-main","pgui.validation-utils"],function(e,t){return function(){e(),window.resetPasswordFormValidation=t.validatePasswordBasedForm}}),define("pgui.self_change_password",["pgui.user_management_api","pgui.change_password_dialog"],function(e){return function(){PhpGenChangePasswordDialog.initialize(new PhpGenChangePasswordDialogUserStrategy(function(t,n){return e.selfChangePassword(t,n)})),$("#self-change-password").click(function(){PhpGenChangePasswordDialog.open()})}});var PhpGenPasswordDialogUtils={validateConfirmedPassword:function(e,t,n){return e!==t?(n.show(),!1):(n.hide(),!0)}};define("pgui.password_dialog_utils",function(){}),define("modal_customize",["bootstrap"],function(){var e=function(e){document.activeElement===document.body&&27==e.which&&$(".modal").modal("hide")},t=$(document),n=$.fn.modal.Constructor.prototype.show;$.fn.modal.Constructor.prototype.show=function(){n.apply(this,arguments);var i=this;this.$element.one("shown.bs.modal",function(){var n=i.$element.find(".form-control").get(0);n&&n.focus(),t.on("keydown",e)}),this.$element.one("hidden.bs.modal",function(){t.off("keydown",e)})};$.fn.modal.Constructor.prototype.hideModal;$.fn.modal.Constructor.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){0===e.$body.find(".modal:visible").length&&e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},t.on("show.bs.modal",".modal",function(e){var n=t.find(".modal:visible").last();if(n.length){var i=n.find(".modal-dialog").width(),r=$(this).find(".modal-dialog");i===r.width()&&r.css("width",i-40)}var o=1040+10*$(".modal:visible").length;$(this).css("z-index",o),setTimeout(function(){$(".modal-backdrop").not(".modal-stack").css("z-index",o-1).addClass("modal-stack")},0)})}),define("main",["pgui.localizer","pgui.sidebar","pgui.list-page-main","pgui.view-page-main","pgui.compare-page-main","pgui.form-page-main","pgui.admin-page-main","pgui.registration-page","pgui.reset-password-page","pgui.self_change_password","pgui.utils","pgui.user_management_api","pgui.change_password_dialog","pgui.password_dialog_utils","jquery","bootstrap","modal_customize"],function(e,t,n,i,r,o,a,s,l,c,u){require(["user"],function(){"function"==typeof window.beforePageLoad&&window.beforePageLoad(),$(function(){var d=$("body"),h=d.data("page-entry"),f=d.data("inactivity-timeout");""!=h&&f>0&&require(["inactivity_timeout"],function(){initInactivityTimeout(f)}),t(d),c(),e.load().done(function(){switch(h){case"list":n();break;case"view":i();break;case"compare":r();break;case"form":o();break;case"admin":a();break;case"register":s();break;case"reset-password":l()}d.data("inactivity-timeout-expired")&&u.showMessage(e.getString("InactivityTimeoutExpired"))}),"function"==typeof window.afterPageLoad&&window.afterPageLoad()})})}),require(["main"]);