/**
 * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
 * Released under MIT license, http://github.com/requirejs/almond/LICENSE
 */

/* @preserve
 * The MIT License (MIT)
 * 
 * Copyright (c) 2013-2015 Petka Antonov
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 * 
 */

/**
 * Copyright © 2015,2016 STRG.AT GmbH, Vienna, Austria
 *
 * This file is part of the The SCORE Framework.
 *
 * The SCORE Framework and all its parts are free software: you can redistribute
 * them and/or modify them under the terms of the GNU Lesser General Public
 * License version 3 as published by the Free Software Foundation which is in the
 * file named COPYING.LESSER.txt.
 *
 * The SCORE Framework and all its parts are distributed without any WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE. For more details see the GNU Lesser General Public
 * License.
 *
 * If you have not received a copy of the GNU Lesser General Public License see
 * http://www.gnu.org/licenses/.
 *
 * The License-Agreement realised between you as Licensee and STRG.AT GmbH as
 * Licenser including the issue of its valid conclusion and its pre- and
 * post-contractual effects is governed by the laws of Austria. Any disputes
 * concerning this License-Agreement including the issue of its valid conclusion
 * and its pre- and post-contractual effects are exclusively decided by the
 * competent court, in whose district STRG.AT GmbH has its registered seat, at
 * the discretion of STRG.AT GmbH also the competent court, in whose district the
 * Licensee has his registered seat, an establishment or assets.
 */

/*
 * $Id: base64.js,v 2.15 2014/04/05 12:58:57 dankogai Exp dankogai $
 *
 *  Licensed under the BSD 3-Clause License.
 *    http://opensource.org/licenses/BSD-3-Clause
 *
 *  References:
 *    http://en.wikipedia.org/wiki/Base64
 */

/*!
 * mustache.js - Logic-less {{mustache}} templates with JavaScript
 * http://github.com/janl/mustache.js
 */

/**
 * Copyright © 2015 STRG.AT GmbH, Vienna, Austria
 *
 * This file is part of the The SCORE Framework.
 *
 * The SCORE Framework and all its parts are free software: you can redistribute
 * them and/or modify them under the terms of the GNU Lesser General Public
 * License version 3 as published by the Free Software Foundation which is in the
 * file named COPYING.LESSER.txt.
 *
 * The SCORE Framework and all its parts are distributed without any WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE. For more details see the GNU Lesser General Public
 * License.
 *
 * If you have not received a copy of the GNU Lesser General Public License see
 * http://www.gnu.org/licenses/.
 *
 * The License-Agreement realised between you as Licensee and STRG.AT GmbH as
 * Licenser including the issue of its valid conclusion and its pre- and
 * post-contractual effects is governed by the laws of Austria. Any disputes
 * concerning this License-Agreement including the issue of its valid conclusion
 * and its pre- and post-contractual effects are exclusively decided by the
 * competent court, in whose district STRG.AT GmbH has its registered seat, at
 * the discretion of STRG.AT GmbH also the competent court, in whose district the
 * Licensee has his registered seat, an establishment or assets.
 */

!function(e,t){"function"==typeof define&&define.amd?define([],t):window.cms=t()}(0,function(){var requirejs,require,define;return function(e){function t(e,t){return g.call(e,t)}function n(e,t){var n,r,o,i,s,a,l,c,u,f,d,h,_=t&&t.split("/"),p=m.map,v=p&&p["*"]||{};if(e){for(e=e.split("/"),s=e.length-1,m.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),"."===e[0].charAt(0)&&_&&(h=_.slice(0,_.length-1),e=h.concat(e)),u=0;u<e.length;u++)if("."===(d=e[u]))e.splice(u,1),u-=1;else if(".."===d){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;u>0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((_||v)&&p){for(n=e.split("/"),u=n.length;u>0;u-=1){if(r=n.slice(0,u).join("/"),_)for(f=_.length;f>0;f-=1)if((o=p[_.slice(0,f).join("/")])&&(o=o[r])){i=o,a=u;break}if(i)break;!l&&v&&v[r]&&(l=v[r],c=u)}!i&&l&&(i=l,a=c),i&&(n.splice(0,a,i),e=n.join("/"))}return e}function r(t,n){return function(){var r=y.call(arguments,0);return"string"!=typeof r[0]&&1===r.length&&r.push(null),f.apply(e,r.concat([t,n]))}}function o(e){return function(t){return n(t,e)}}function i(e){return function(t){_[e]=t}}function s(n){if(t(p,n)){var r=p[n];delete p[n],v[n]=!0,u.apply(e,r)}if(!t(_,n)&&!t(v,n))throw new Error("No "+n);return _[n]}function a(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function l(e){return e?a(e):[]}function c(e){return function(){return m&&m.config&&m.config[e]||{}}}var u,f,d,h,_={},p={},m={},v={},g=Object.prototype.hasOwnProperty,y=[].slice,b=/\.js$/;d=function(e,t){var r,i=a(e),l=i[0],c=t[1];return e=i[1],l&&(l=n(l,c),r=s(l)),l?e=r&&r.normalize?r.normalize(e,o(c)):n(e,c):(e=n(e,c),i=a(e),l=i[0],e=i[1],l&&(r=s(l))),{f:l?l+"!"+e:e,n:e,pr:l,p:r}},h={require:function(e){return r(e)},exports:function(e){var t=_[e];return void 0!==t?t:_[e]={}},module:function(e){return{id:e,uri:"",exports:_[e],config:c(e)}}},u=function(n,o,a,c){var u,f,m,g,y,b,w,C=[],E=typeof a;if(c=c||n,b=l(c),"undefined"===E||"function"===E){for(o=!o.length&&a.length?["require","exports","module"]:o,y=0;y<o.length;y+=1)if(g=d(o[y],b),"require"===(f=g.f))C[y]=h.require(n);else if("exports"===f)C[y]=h.exports(n),w=!0;else if("module"===f)u=C[y]=h.module(n);else if(t(_,f)||t(p,f)||t(v,f))C[y]=s(f);else{if(!g.p)throw new Error(n+" missing "+f);g.p.load(g.n,r(c,!0),i(f),{}),C[y]=_[f]}m=a?a.apply(_[n],C):void 0,n&&(u&&u.exports!==e&&u.exports!==_[n]?_[n]=u.exports:m===e&&w||(_[n]=m))}else n&&(_[n]=a)},requirejs=require=f=function(t,n,r,o,i){if("string"==typeof t)return h[t]?h[t](n):s(d(t,l(n)).f);if(!t.splice){if(m=t,m.deps&&f(m.deps,m.callback),!n)return;n.splice?(t=n,n=r,r=null):t=e}return n=n||function(){},"function"==typeof r&&(r=o,o=i),o?u(e,t,n,r):setTimeout(function(){u(e,t,n,r)},4),f},f.config=function(e){return f(e)},requirejs._defined=_,define=function(e,n,r){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");n.splice||(r=n,n=[]),t(_,e)||t(p,e)||(p[e]=[e,n,r])},define.amd={jQuery:!0}}(),define("../../../node_modules/almond/almond",function(){}),require.config({baseUrl:".",map:{"_lib/score/dom":{"score.init":"_lib/score/init"},"_lib/score/ajax":{"score.init":"_lib/score/init"},"_lib/score/oop":{"score.init":"_lib/score/init"}},name:"../../../node_modules/almond/almond",include:["config","main"],wrap:{startFile:"../../almond/start.frag",endFile:"../../almond/end.frag"},findNestedDependencies:!0}),define("config",function(){}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("_lib/bluebird",[],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.Promise=e()}}(function(){var e,t,n;return function e(t,n,r){function o(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof _dereq_&&_dereq_;if(!a&&l)return l(s,!0);if(i)return i(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return o(n||e)},u,u.exports,e,t,n,r)}return n[s].exports}for(var i="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(e,t,n){"use strict";t.exports=function(e){function t(e){var t=new n(e),r=t.promise();return t.setHowMany(1),t.setUnwrap(),t.init(),r}var n=e._SomePromiseArray;e.any=function(e){return t(e)},e.prototype.any=function(){return t(this)}}},{}],2:[function(e,t,n){"use strict";function r(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new c(16),this._normalQueue=new c(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0;var e=this;this.drainQueues=function(){e._drainQueues()},this._schedule=l}function o(e,t,n){this._lateQueue.push(e,t,n),this._queueTick()}function i(e,t,n){this._normalQueue.push(e,t,n),this._queueTick()}function s(e){this._normalQueue._pushOne(e),this._queueTick()}var a;try{throw new Error}catch(e){a=e}var l=e("./schedule"),c=e("./queue"),u=e("./util");r.prototype.setScheduler=function(e){var t=this._schedule;return this._schedule=e,this._customScheduler=!0,t},r.prototype.hasCustomScheduler=function(){return this._customScheduler},r.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},r.prototype.disableTrampolineIfNecessary=function(){u.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},r.prototype.fatalError=function(e,t){t?(process.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),process.exit(2)):this.throwLater(e)},r.prototype.throwLater=function(e,t){if(1===arguments.length&&(t=e,e=function(){throw t}),"undefined"!=typeof setTimeout)setTimeout(function(){e(t)},0);else try{this._schedule(function(){e(t)})}catch(e){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n")}},u.hasDevTools?(r.prototype.invokeLater=function(e,t,n){this._trampolineEnabled?o.call(this,e,t,n):this._schedule(function(){setTimeout(function(){e.call(t,n)},100)})},r.prototype.invoke=function(e,t,n){this._trampolineEnabled?i.call(this,e,t,n):this._schedule(function(){e.call(t,n)})},r.prototype.settlePromises=function(e){this._trampolineEnabled?s.call(this,e):this._schedule(function(){e._settlePromises()})}):(r.prototype.invokeLater=o,r.prototype.invoke=i,r.prototype.settlePromises=s),r.prototype.invokeFirst=function(e,t,n){this._normalQueue.unshift(e,t,n),this._queueTick()},r.prototype._drainQueue=function(e){for(;e.length()>0;){var t=e.shift();if("function"==typeof t){var n=e.shift(),r=e.shift();t.call(n,r)}else t._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},t.exports=r,t.exports.firstLineError=a},{"./queue":26,"./schedule":29,"./util":36}],3:[function(e,t,n){"use strict";t.exports=function(e,t,n,r){var o=!1,i=function(e,t){this._reject(t)},s=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(i,i,null,this,e)},a=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},l=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(i){o||(o=!0,e.prototype._propagateFrom=r.propagateFromFunction(),e.prototype._boundValue=r.boundValueFunction());var c=n(i),u=new e(t);u._propagateFrom(this,1);var f=this._target();if(u._setBoundTo(c),c instanceof e){var d={promiseRejectionQueued:!1,promise:u,target:f,bindingPromise:c};f._then(t,s,void 0,u,d),c._then(a,l,void 0,u,d),u._setOnCancel(c)}else u._resolveCallback(f);return u},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,n){return e.resolve(n).bind(t)}}},{}],4:[function(e,t,n){"use strict";function r(){try{Promise===i&&(Promise=o)}catch(e){}return i}var o;"undefined"!=typeof Promise&&(o=Promise);var i=e("./promise")();i.noConflict=r,t.exports=i},{"./promise":22}],5:[function(e,t,n){"use strict";var r=Object.create;if(r){var o=r(null),i=r(null);o[" size"]=i[" size"]=0}t.exports=function(t){function n(e,n){var r;if(null!=e&&(r=e[n]),"function"!=typeof r){var o="Object "+a.classString(e)+" has no method '"+a.toString(n)+"'";throw new t.TypeError(o)}return r}function r(e){return n(e,this.pop()).apply(e,this)}function o(e){return e[this]}function i(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}var s,a=e("./util"),l=a.canEvaluate;a.isIdentifier;t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(r,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t,n="number"==typeof e;if(n)t=i;else if(l){var r=s(e);t=null!==r?r:o}else t=o;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,n){"use strict";t.exports=function(t,n,r,o){var i=e("./util"),s=i.tryCatch,a=i.errorObj,l=t._async;t.prototype.break=t.prototype.cancel=function(){if(!o.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var n=e._cancellationParent;if(null==n||!n._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=n}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),l.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(i.isArray(e))for(var n=0;n<e.length;++n)this._doInvokeOnCancel(e[n],t);else if(void 0!==e)if("function"==typeof e){if(!t){var r=s(e).call(this._boundValue());r===a&&(this._attachExtraTrace(r.e),l.throwLater(r.e))}}else e._resultCancelled(this)},t.prototype._invokeOnCancel=function(){var e=this._onCancel();this._unsetOnCancel(),l.invoke(this._doInvokeOnCancel,this,e)},t.prototype._invokeInternalOnCancel=function(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())},t.prototype._resultCancelled=function(){this.cancel()}}},{"./util":36}],7:[function(e,t,n){"use strict";t.exports=function(t){function n(e,n,a){return function(l){var c=a._boundValue();e:for(var u=0;u<e.length;++u){var f=e[u];if(f===Error||null!=f&&f.prototype instanceof Error){if(l instanceof f)return i(n).call(c,l)}else if("function"==typeof f){var d=i(f).call(c,l);if(d===s)return d;if(d)return i(n).call(c,l)}else if(r.isObject(l)){for(var h=o(f),_=0;_<h.length;++_){var p=h[_];if(f[p]!=l[p])continue e}return i(n).call(c,l)}}return t}}var r=e("./util"),o=e("./es5").keys,i=r.tryCatch,s=r.errorObj;return n}},{"./es5":13,"./util":36}],8:[function(e,t,n){"use strict";t.exports=function(e){function t(){this._trace=new t.CapturedTrace(r())}function n(){if(o)return new t}function r(){var e=i.length-1;if(e>=0)return i[e]}var o=!1,i=[];return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},t.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,i.push(this._trace))},t.prototype._popContext=function(){if(void 0!==this._trace){var e=i.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},t.CapturedTrace=null,t.create=n,t.deactivateLongStackTraces=function(){},t.activateLongStackTraces=function(){var n=e.prototype._pushContext,i=e.prototype._popContext,s=e._peekContext,a=e.prototype._peekContext,l=e.prototype._promiseCreated;t.deactivateLongStackTraces=function(){e.prototype._pushContext=n,e.prototype._popContext=i,e._peekContext=s,e.prototype._peekContext=a,e.prototype._promiseCreated=l,o=!1},o=!0,e.prototype._pushContext=t.prototype._pushContext,e.prototype._popContext=t.prototype._popContext,e._peekContext=e.prototype._peekContext=r,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},t}},{}],9:[function(e,t,n){"use strict";t.exports=function(t,n){function r(e,t){return{promise:t}}function o(){return!1}function i(e,t,n){var r=this;try{e(t,n,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+I.toString(e));r._attachCancellationCallback(e)})}catch(e){return e}}function s(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?I.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function a(){return this._onCancelField}function l(e){this._onCancelField=e}function c(){this._cancellationParent=void 0,this._onCancelField=void 0}function u(e,t){if(0!=(1&t)){this._cancellationParent=e;var n=e._branchesRemainingToCancel;void 0===n&&(n=0),e._branchesRemainingToCancel=n+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function f(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}function d(){var e=this._boundTo;return void 0!==e&&e instanceof t?e.isFulfilled()?e.value():void 0:e}function h(){this._trace=new T(this._peekContext())}function _(e,t){if(H(e)){var n=this._trace;if(void 0!==n&&t&&(n=n._parent),void 0!==n)n.attachExtraTrace(e);else if(!e.__stackCleaned__){var r=E(e);I.notEnumerableProp(e,"stack",r.message+"\n"+r.stack.join("\n")),I.notEnumerableProp(e,"__stackCleaned__",!0)}}}function p(e,t,n,r,o){if(void 0===e&&null!==t&&X){if(void 0!==o&&o._returnedNonUndefined())return;if(0==(65535&r._bitField))return;n&&(n+=" ");var i="",s="";if(t._trace){for(var a=t._trace.stack.split("\n"),l=w(a),c=l.length-1;c>=0;--c){var u=l[c];if(!q.test(u)){var f=u.match(B);f&&(i="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(l.length>0)for(var d=l[0],c=0;c<a.length;++c)if(a[c]===d){c>0&&(s="\n"+a[c-1]);break}}var h="a promise was created in a "+n+"handler "+i+"but was not returned from it, see http://goo.gl/rRqMUw"+s;r._warn(h,!0,t)}}function m(e,t){var n=e+" is deprecated and will be removed in a future version.";return t&&(n+=" Use "+t+" instead."),v(n)}function v(e,n,r){if(ie.warnings){var o,i=new L(e);if(n)r._attachExtraTrace(i);else if(ie.longStackTraces&&(o=t._peekContext()))o.attachExtraTrace(i);else{var s=E(i);i.stack=s.message+"\n"+s.stack.join("\n")}ee("warning",i)||N(i,"",!0)}}function g(e,t){for(var n=0;n<t.length-1;++n)t[n].push("From previous event:"),t[n]=t[n].join("\n");return n<t.length&&(t[n]=t[n].join("\n")),e+"\n"+t.join("\n")}function y(e){for(var t=0;t<e.length;++t)(0===e[t].length||t+1<e.length&&e[t][0]===e[t+1][0])&&(e.splice(t,1),t--)}function b(e){for(var t=e[0],n=1;n<e.length;++n){for(var r=e[n],o=t.length-1,i=t[o],s=-1,a=r.length-1;a>=0;--a)if(r[a]===i){s=a;break}for(var a=s;a>=0;--a){var l=r[a];if(t[o]!==l)break;t.pop(),o--}t=r}}function w(e){for(var t=[],n=0;n<e.length;++n){var r=e[n],o="    (No stack trace)"===r||V.test(r),i=o&&ne(r);o&&!i&&($&&" "!==r.charAt(0)&&(r="    "+r),t.push(r))}return t}function C(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),n=0;n<t.length;++n){var r=t[n];if("    (No stack trace)"===r||V.test(r))break}return n>0&&(t=t.slice(n)),t}function E(e){var t=e.stack,n=e.toString();return t="string"==typeof t&&t.length>0?C(e):["    (No stack trace)"],{message:n,stack:w(t)}}function N(e,t,n){if("undefined"!=typeof console){var r;if(I.isObject(e)){var o=e.stack;r=t+z(o,e)}else r=t+String(e);"function"==typeof P?P(r,n):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(r)}}function x(e,t,n,r){var o=!1;try{"function"==typeof t&&(o=!0,"rejectionHandled"===e?t(r):t(n,r))}catch(e){D.throwLater(e)}"unhandledRejection"===e?ee(e,n,r)||o||N(n,"Unhandled rejection "):ee(e,r)}function j(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{t=e&&"function"==typeof e.toString?e.toString():I.toString(e);if(/\[object [a-zA-Z0-9$_]+\]/.test(t))try{t=JSON.stringify(e)}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+k(t)+">, no stack trace)"}function k(e){return e.length<41?e:e.substr(0,38)+"..."}function F(){return"function"==typeof oe}function S(e){var t=e.match(re);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function O(e,t){if(F()){for(var n,r,o=e.stack.split("\n"),i=t.stack.split("\n"),s=-1,a=-1,l=0;l<o.length;++l){var c=S(o[l]);if(c){n=c.fileName,s=c.line;break}}for(var l=0;l<i.length;++l){var c=S(i[l]);if(c){r=c.fileName,a=c.line;break}}s<0||a<0||!n||!r||n!==r||s>=a||(ne=function(e){if(U.test(e))return!0;var t=S(e);return!!(t&&t.fileName===n&&s<=t.line&&t.line<=a)})}}function T(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);oe(this,T),t>32&&this.uncycle()}var A,R,P,M=t._getDomain,D=t._async,L=e("./errors").Warning,I=e("./util"),H=I.canAttachTrace,U=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,q=/\((?:timers\.js):\d+:\d+\)/,B=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,V=null,z=null,$=!1,Q=!(0==I.env("BLUEBIRD_DEBUG")),W=!(0==I.env("BLUEBIRD_WARNINGS")||!Q&&!I.env("BLUEBIRD_WARNINGS")),G=!(0==I.env("BLUEBIRD_LONG_STACK_TRACES")||!Q&&!I.env("BLUEBIRD_LONG_STACK_TRACES")),X=0!=I.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(W||!!I.env("BLUEBIRD_W_FORGOTTEN_RETURN"));t.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},t.prototype._ensurePossibleRejectionHandled=function(){0==(524288&this._bitField)&&(this._setRejectionIsUnhandled(),D.invokeLater(this._notifyUnhandledRejection,this,void 0))},t.prototype._notifyUnhandledRejectionIsHandled=function(){x("rejectionHandled",A,void 0,this)},t.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},t.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},t.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),x("unhandledRejection",R,e,this)}},t.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},t.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},t.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},t.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},t.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},t.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},t.prototype._warn=function(e,t,n){return v(e,t,n||this)},t.onPossiblyUnhandledRejection=function(e){var t=M();R="function"==typeof e?null===t?e:I.domainBind(t,e):void 0},t.onUnhandledRejectionHandled=function(e){var t=M();A="function"==typeof e?null===t?e:I.domainBind(t,e):void 0};var J=function(){};t.longStackTraces=function(){if(D.haveItemsQueued()&&!ie.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");if(!ie.longStackTraces&&F()){var e=t.prototype._captureStackTrace,r=t.prototype._attachExtraTrace;ie.longStackTraces=!0,J=function(){if(D.haveItemsQueued()&&!ie.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n    See http://goo.gl/MqrFmX\n");t.prototype._captureStackTrace=e,t.prototype._attachExtraTrace=r,n.deactivateLongStackTraces(),D.enableTrampoline(),ie.longStackTraces=!1},t.prototype._captureStackTrace=h,t.prototype._attachExtraTrace=_,n.activateLongStackTraces(),D.disableTrampolineIfNecessary()}},t.hasLongStackTraces=function(){return ie.longStackTraces&&F()};var K=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return I.global.dispatchEvent(e),function(e,t){var n=new CustomEvent(e.toLowerCase(),{detail:t,cancelable:!0});return!I.global.dispatchEvent(n)}}if("function"==typeof Event){var e=new Event("CustomEvent");return I.global.dispatchEvent(e),function(e,t){var n=new Event(e.toLowerCase(),{cancelable:!0});return n.detail=t,!I.global.dispatchEvent(n)}}var e=document.createEvent("CustomEvent");return e.initCustomEvent("testingtheevent",!1,!0,{}),I.global.dispatchEvent(e),function(e,t){var n=document.createEvent("CustomEvent");return n.initCustomEvent(e.toLowerCase(),!1,!0,t),!I.global.dispatchEvent(n)}}catch(e){}return function(){return!1}}(),Y=function(){return I.isNode?function(){return process.emit.apply(process,arguments)}:I.global?function(e){var t="on"+e.toLowerCase(),n=I.global[t];return!!n&&(n.apply(I.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),Z={promiseCreated:r,promiseFulfilled:r,promiseRejected:r,promiseResolved:r,promiseCancelled:r,promiseChained:function(e,t,n){return{promise:t,child:n}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,n){return{reason:t,promise:n}},rejectionHandled:r},ee=function(e){var t=!1;try{t=Y.apply(null,arguments)}catch(e){D.throwLater(e),t=!0}var n=!1;try{n=K(e,Z[e].apply(null,arguments))}catch(e){D.throwLater(e),n=!0}return n||t};t.config=function(e){if(e=Object(e),"longStackTraces"in e&&(e.longStackTraces?t.longStackTraces():!e.longStackTraces&&t.hasLongStackTraces()&&J()),"warnings"in e){var n=e.warnings;ie.warnings=!!n,X=ie.warnings,I.isObject(n)&&"wForgottenReturn"in n&&(X=!!n.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!ie.cancellation){if(D.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");t.prototype._clearCancellationData=c,t.prototype._propagateFrom=u,t.prototype._onCancel=a,t.prototype._setOnCancel=l,t.prototype._attachCancellationCallback=s,t.prototype._execute=i,te=u,ie.cancellation=!0}"monitoring"in e&&(e.monitoring&&!ie.monitoring?(ie.monitoring=!0,t.prototype._fireEvent=ee):!e.monitoring&&ie.monitoring&&(ie.monitoring=!1,t.prototype._fireEvent=o))},t.prototype._fireEvent=o,t.prototype._execute=function(e,t,n){try{e(t,n)}catch(e){return e}},t.prototype._onCancel=function(){},t.prototype._setOnCancel=function(e){},t.prototype._attachCancellationCallback=function(e){},t.prototype._captureStackTrace=function(){},t.prototype._attachExtraTrace=function(){},t.prototype._clearCancellationData=function(){},t.prototype._propagateFrom=function(e,t){};var te=f,ne=function(){return!1},re=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;I.inherits(T,Error),n.CapturedTrace=T,T.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],n={},r=0,o=this;void 0!==o;++r)t.push(o),o=o._parent;e=this._length=r;for(var r=e-1;r>=0;--r){var i=t[r].stack;void 0===n[i]&&(n[i]=r)}for(var r=0;r<e;++r){var s=t[r].stack,a=n[s];if(void 0!==a&&a!==r){a>0&&(t[a-1]._parent=void 0,t[a-1]._length=1),t[r]._parent=void 0,t[r]._length=1;var l=r>0?t[r-1]:this;a<e-1?(l._parent=t[a+1],l._parent.uncycle(),l._length=l._parent._length+1):(l._parent=void 0,l._length=1);for(var c=l._length+1,u=r-2;u>=0;--u)t[u]._length=c,c++;return}}}},T.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=E(e),n=t.message,r=[t.stack],o=this;void 0!==o;)r.push(w(o.stack.split("\n"))),o=o._parent;b(r),y(r),I.notEnumerableProp(e,"stack",g(n,r)),I.notEnumerableProp(e,"__stackCleaned__",!0)}};var oe=function(){var e=/^\s*at\s*/,t=function(e,t){return"string"==typeof e?e:void 0!==t.name&&void 0!==t.message?t.toString():j(t)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,V=e,z=t;var n=Error.captureStackTrace;return ne=function(e){return U.test(e)},function(e,t){Error.stackTraceLimit+=6,n(e,t),Error.stackTraceLimit-=6}}var r=new Error;if("string"==typeof r.stack&&r.stack.split("\n")[0].indexOf("stackDetection@")>=0)return V=/@/,z=t,$=!0,function(e){e.stack=(new Error).stack};var o;try{throw new Error}catch(e){o="stack"in e}return"stack"in r||!o||"number"!=typeof Error.stackTraceLimit?(z=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?j(t):t.toString()},null):(V=e,z=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(P=function(e){console.warn(e)},I.isNode&&process.stderr.isTTY?P=function(e,t){var n=t?"[33m":"[31m";console.warn(n+e+"[0m\n")}:I.isNode||"string"!=typeof(new Error).stack||(P=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var ie={warnings:W,longStackTraces:!1,cancellation:!1,monitoring:!1};return G&&t.longStackTraces(),{longStackTraces:function(){return ie.longStackTraces},warnings:function(){return ie.warnings},cancellation:function(){return ie.cancellation},monitoring:function(){return ie.monitoring},propagateFromFunction:function(){return te},boundValueFunction:function(){return d},checkForgottenReturns:p,setBounds:O,warn:v,deprecated:m,CapturedTrace:T,fireDomEvent:K,fireGlobalEvent:Y}}},{"./errors":12,"./util":36}],10:[function(e,t,n){"use strict";t.exports=function(e){function t(){return this.value}function n(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(n){return n instanceof e&&n.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:n},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(n,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,n,void 0,{reason:e},void 0);var t=arguments[1],r=function(){throw t};return this.caught(e,r)},e.prototype.catchReturn=function(n){if(arguments.length<=1)return n instanceof e&&n.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:n},void 0);var r=arguments[1];r instanceof e&&r.suppressUnhandledRejections();var o=function(){return r};return this.caught(n,o)}}},{}],11:[function(e,t,n){"use strict";t.exports=function(e,t){function n(){return i(this)}function r(e,n){return o(e,n,t,t)}var o=e.reduce,i=e.all;e.prototype.each=function(e){return o(this,e,t,0)._then(n,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return o(this,e,t,t)},e.each=function(e,r){return o(e,r,t,0)._then(n,void 0,void 0,e,void 0)},e.mapSeries=r}},{}],12:[function(e,t,n){"use strict";function r(e,t){function n(r){if(!(this instanceof n))return new n(r);f(this,"message","string"==typeof r?r:t),f(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return u(n,Error),n}function o(e){if(!(this instanceof o))return new o(e);f(this,"name","OperationalError"),f(this,"message",e),this.cause=e,this.isOperational=!0,e instanceof Error?(f(this,"message",e.message),f(this,"stack",e.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}var i,s,a=e("./es5"),l=a.freeze,c=e("./util"),u=c.inherits,f=c.notEnumerableProp,d=r("Warning","warning"),h=r("CancellationError","cancellation error"),_=r("TimeoutError","timeout error"),p=r("AggregateError","aggregate error");try{i=TypeError,s=RangeError}catch(e){i=r("TypeError","type error"),s=r("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v<m.length;++v)"function"==typeof Array.prototype[m[v]]&&(p.prototype[m[v]]=Array.prototype[m[v]]);a.defineProperty(p.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),p.prototype.isOperational=!0;var g=0;p.prototype.toString=function(){var e=Array(4*g+1).join(" "),t="\n"+e+"AggregateError of:\n";g++,e=Array(4*g+1).join(" ");for(var n=0;n<this.length;++n){for(var r=this[n]===this?"[Circular AggregateError]":this[n]+"",o=r.split("\n"),i=0;i<o.length;++i)o[i]=e+o[i];r=o.join("\n"),t+=r+"\n"}return g--,t},u(o,Error);var y=Error.__BluebirdErrorTypes__;y||(y=l({CancellationError:h,TimeoutError:_,OperationalError:o,RejectionError:o,AggregateError:p}),a.defineProperty(Error,"__BluebirdErrorTypes__",{value:y,writable:!1,enumerable:!1,configurable:!1})),t.exports={Error:Error,TypeError:i,RangeError:s,CancellationError:y.CancellationError,OperationalError:y.OperationalError,TimeoutError:y.TimeoutError,AggregateError:y.AggregateError,Warning:d}},{"./es5":13,"./util":36}],13:[function(e,t,n){var r=function(){"use strict";return void 0===this}();if(r)t.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!(n&&!n.writable&&!n.set)}};else{var o={}.hasOwnProperty,i={}.toString,s={}.constructor.prototype,a=function(e){var t=[];for(var n in e)o.call(e,n)&&t.push(n);return t},l=function(e,t){return{value:e[t]}},c=function(e,t,n){return e[t]=n.value,e},u=function(e){return e},f=function(e){try{return Object(e).constructor.prototype}catch(e){return s}},d=function(e){try{return"[object Array]"===i.call(e)}catch(e){return!1}};t.exports={isArray:d,keys:a,names:a,defineProperty:c,getDescriptor:l,freeze:u,getPrototypeOf:f,isES5:r,propertyIsWritable:function(){return!0}}}},{}],14:[function(e,t,n){"use strict";t.exports=function(e,t){var n=e.map;e.prototype.filter=function(e,r){return n(this,e,r,t)},e.filter=function(e,r,o){return n(e,r,o,t)}}},{}],15:[function(e,t,n){"use strict";t.exports=function(t,n){function r(e,t,n){this.promise=e,this.type=t,this.handler=n,this.called=!1,this.cancelPromise=null}function o(e){this.finallyHandler=e}function i(e,t){return null!=e.cancelPromise&&(arguments.length>1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function s(){return l.call(this,this.promise._target()._settledValue())}function a(e){if(!i(this,e))return f.e=e,f}function l(e){var r=this.promise,l=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?l.call(r._boundValue()):l.call(r._boundValue(),e);if(void 0!==c){r._setReturnedNonUndefined();var d=n(c,r);if(d instanceof t){if(null!=this.cancelPromise){if(d._isCancelled()){var h=new u("late cancellation observer");return r._attachExtraTrace(h),f.e=h,f}d.isPending()&&d._attachCancellationCallback(new o(this))}return d._then(s,a,void 0,this,void 0)}}}return r.isRejected()?(i(this),f.e=e,f):(i(this),e)}var c=e("./util"),u=t.CancellationError,f=c.errorObj;return r.prototype.isFinallyHandler=function(){return 0===this.type},o.prototype._resultCancelled=function(){i(this.finallyHandler)},t.prototype._passThrough=function(e,t,n,o){return"function"!=typeof e?this.then():this._then(n,o,void 0,new r(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,l,l)},t.prototype.tap=function(e){return this._passThrough(e,1,l)},r}},{"./util":36}],16:[function(e,t,n){"use strict";t.exports=function(t,n,r,o,i,s){function a(e,n,r){for(var i=0;i<n.length;++i){r._pushContext();var s=h(n[i])(e);if(r._popContext(),s===d){r._pushContext();var a=t.reject(d.e);return r._popContext(),a}
var l=o(s,r);if(l instanceof t)return l}return null}function l(e,n,o,i){if(s.cancellation()){var a=new t(r),l=this._finallyPromise=new t(r);this._promise=a.lastly(function(){return l}),a._captureStackTrace(),a._setOnCancel(this)}else{(this._promise=new t(r))._captureStackTrace()}this._stack=i,this._generatorFunction=e,this._receiver=n,this._generator=void 0,this._yieldHandlers="function"==typeof o?[o].concat(_):_,this._yieldedPromise=null,this._cancellationPhase=!1}var c=e("./errors"),u=c.TypeError,f=e("./util"),d=f.errorObj,h=f.tryCatch,_=[];f.inherits(l,i),l.prototype._isResolved=function(){return null===this._promise},l.prototype._cleanup=function(){this._promise=this._generator=null,s.cancellation()&&null!==this._finallyPromise&&(this._finallyPromise._fulfill(),this._finallyPromise=null)},l.prototype._promiseCancelled=function(){if(!this._isResolved()){var e,n=void 0!==this._generator.return;if(n)this._promise._pushContext(),e=h(this._generator.return).call(this._generator,void 0),this._promise._popContext();else{var r=new t.CancellationError("generator .return() sentinel");t.coroutine.returnSentinel=r,this._promise._attachExtraTrace(r),this._promise._pushContext(),e=h(this._generator.throw).call(this._generator,r),this._promise._popContext()}this._cancellationPhase=!0,this._yieldedPromise=null,this._continue(e)}},l.prototype._promiseFulfilled=function(e){this._yieldedPromise=null,this._promise._pushContext();var t=h(this._generator.next).call(this._generator,e);this._promise._popContext(),this._continue(t)},l.prototype._promiseRejected=function(e){this._yieldedPromise=null,this._promise._attachExtraTrace(e),this._promise._pushContext();var t=h(this._generator.throw).call(this._generator,e);this._promise._popContext(),this._continue(t)},l.prototype._resultCancelled=function(){if(this._yieldedPromise instanceof t){var e=this._yieldedPromise;this._yieldedPromise=null,e.cancel()}},l.prototype.promise=function(){return this._promise},l.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._promiseFulfilled(void 0)},l.prototype._continue=function(e){var n=this._promise;if(e===d)return this._cleanup(),this._cancellationPhase?n.cancel():n._rejectCallback(e.e,!1);var r=e.value;if(!0===e.done)return this._cleanup(),this._cancellationPhase?n.cancel():n._resolveCallback(r);var i=o(r,this._promise);if(!(i instanceof t)&&null===(i=a(i,this._yieldHandlers,this._promise)))return void this._promiseRejected(new u("A value %s was yielded that could not be treated as a promise\n\n    See http://goo.gl/MqrFmX\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));i=i._target();var s=i._bitField;0==(50397184&s)?(this._yieldedPromise=i,i._proxy(this,null)):0!=(33554432&s)?t._async.invoke(this._promiseFulfilled,this,i._value()):0!=(16777216&s)?t._async.invoke(this._promiseRejected,this,i._reason()):this._promiseCancelled()},t.coroutine=function(e,t){if("function"!=typeof e)throw new u("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");var n=Object(t).yieldHandler,r=l,o=(new Error).stack;return function(){var t=e.apply(this,arguments),i=new r(void 0,void 0,n,o),s=i.promise();return i._generator=t,i._promiseFulfilled(void 0),s}},t.coroutine.addYieldHandler=function(e){if("function"!=typeof e)throw new u("expecting a function but got "+f.classString(e));_.push(e)},t.spawn=function(e){if(s.deprecated("Promise.spawn()","Promise.coroutine()"),"function"!=typeof e)return n("generatorFunction must be a function\n\n    See http://goo.gl/MqrFmX\n");var r=new l(e,this),o=r.promise();return r._run(t.spawn),o}}},{"./errors":12,"./util":36}],17:[function(e,t,n){"use strict";t.exports=function(t,n,r,o,i,s){var a=e("./util");a.canEvaluate,a.tryCatch,a.errorObj;t.join=function(){var e,t=arguments.length-1;if(t>0&&"function"==typeof arguments[t]){e=arguments[t];var r}var o=[].slice.call(arguments);e&&o.pop();var r=new n(o).promise();return void 0!==e?r.spread(e):r}}},{"./util":36}],18:[function(e,t,n){"use strict";t.exports=function(t,n,r,o,i,s){function a(e,t,n,r){this.constructor$(e),this._promise._captureStackTrace();var o=c();this._callback=null===o?t:u.domainBind(o,t),this._preservedValues=r===i?new Array(this.length()):null,this._limit=n,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function l(e,n,o,i){if("function"!=typeof n)return r("expecting a function but got "+u.classString(n));var s=0;if(void 0!==o){if("object"!=typeof o||null===o)return t.reject(new TypeError("options argument must be an object but it is "+u.classString(o)));if("number"!=typeof o.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(o.concurrency)));s=o.concurrency}return s="number"==typeof s&&isFinite(s)&&s>=1?s:0,new a(e,n,s,i).promise()}var c=t._getDomain,u=e("./util"),f=u.tryCatch,d=u.errorObj,h=t._async;u.inherits(a,n),a.prototype._asyncInit=function(){this._init$(void 0,-2)},a.prototype._init=function(){},a.prototype._promiseFulfilled=function(e,n){var r=this._values,i=this.length(),a=this._preservedValues,l=this._limit;if(n<0){if(n=-1*n-1,r[n]=e,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return r[n]=e,this._queue.push(n),!1;null!==a&&(a[n]=e);var c=this._promise,u=this._callback,h=c._boundValue();c._pushContext();var _=f(u).call(h,e,n,i),p=c._popContext();if(s.checkForgottenReturns(_,p,null!==a?"Promise.filter":"Promise.map",c),_===d)return this._reject(_.e),!0;var m=o(_,this._promise);if(m instanceof t){m=m._target();var v=m._bitField;if(0==(50397184&v))return l>=1&&this._inFlight++,r[n]=m,m._proxy(this,-1*(n+1)),!1;if(0==(33554432&v))return 0!=(16777216&v)?(this._reject(m._reason()),!0):(this._cancel(),!0);_=m._value()}r[n]=_}return++this._totalResolved>=i&&(null!==a?this._filter(r,a):this._resolve(r),!0)},a.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,n=this._values;e.length>0&&this._inFlight<t;){if(this._isResolved())return;var r=e.pop();this._promiseFulfilled(n[r],r)}},a.prototype._filter=function(e,t){for(var n=t.length,r=new Array(n),o=0,i=0;i<n;++i)e[i]&&(r[o++]=t[i]);r.length=o,this._resolve(r)},a.prototype.preservedValues=function(){return this._preservedValues},t.prototype.map=function(e,t){return l(this,e,t,null)},t.map=function(e,t,n,r){return l(e,t,n,r)}}},{"./util":36}],19:[function(e,t,n){"use strict";t.exports=function(t,n,r,o,i){var s=e("./util"),a=s.tryCatch;t.method=function(e){if("function"!=typeof e)throw new t.TypeError("expecting a function but got "+s.classString(e));return function(){var r=new t(n);r._captureStackTrace(),r._pushContext();var o=a(e).apply(this,arguments),s=r._popContext();return i.checkForgottenReturns(o,s,"Promise.method",r),r._resolveFromSyncValue(o),r}},t.attempt=t.try=function(e){if("function"!=typeof e)return o("expecting a function but got "+s.classString(e));var r=new t(n);r._captureStackTrace(),r._pushContext();var l;if(arguments.length>1){i.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],u=arguments[2];l=s.isArray(c)?a(e).apply(u,c):a(e).call(u,c)}else l=a(e)();var f=r._popContext();return i.checkForgottenReturns(l,f,"Promise.try",r),r._resolveFromSyncValue(l),r},t.prototype._resolveFromSyncValue=function(e){e===s.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,n){"use strict";function r(e){return e instanceof Error&&u.getPrototypeOf(e)===Error.prototype}function o(e){var t;if(r(e)){t=new c(e),t.name=e.name,t.message=e.message,t.stack=e.stack;for(var n=u.keys(e),o=0;o<n.length;++o){var i=n[o];f.test(i)||(t[i]=e[i])}return t}return s.markAsOriginatingFromRejection(e),e}function i(e,t){return function(n,r){if(null!==e){if(n){var i=o(a(n));e._attachExtraTrace(i),e._reject(i)}else if(t){var s=[].slice.call(arguments,1);e._fulfill(s)}else e._fulfill(r);e=null}}}var s=e("./util"),a=s.maybeWrapAsError,l=e("./errors"),c=l.OperationalError,u=e("./es5"),f=/^(?:name|message|stack|cause)$/;t.exports=i},{"./errors":12,"./es5":13,"./util":36}],21:[function(e,t,n){"use strict";t.exports=function(t){function n(e,t){var n=this;if(!i.isArray(e))return r.call(n,e,t);var o=a(t).apply(n._boundValue(),[null].concat(e));o===l&&s.throwLater(o.e)}function r(e,t){var n=this,r=n._boundValue(),o=void 0===e?a(t).call(r,null):a(t).call(r,null,e);o===l&&s.throwLater(o.e)}function o(e,t){var n=this;if(!e){var r=new Error(e+"");r.cause=e,e=r}var o=a(t).call(n._boundValue(),e);o===l&&s.throwLater(o.e)}var i=e("./util"),s=t._async,a=i.tryCatch,l=i.errorObj;t.prototype.asCallback=t.prototype.nodeify=function(e,t){if("function"==typeof e){var i=r;void 0!==t&&Object(t).spread&&(i=n),this._then(i,o,void 0,this,e)}return this}}},{"./util":36}],22:[function(e,t,n){"use strict";t.exports=function(){function n(){}function r(e,t){if("function"!=typeof t)throw new g("expecting a function but got "+h.classString(t));if(e.constructor!==o)throw new g("the promise constructor cannot be invoked directly\n\n    See http://goo.gl/MqrFmX\n")}function o(e){this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,e!==b&&(r(this,e),this._resolveFromExecutor(e)),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function i(e){this.promise._resolveCallback(e)}function s(e){this.promise._rejectCallback(e,!1)}function a(e){var t=new o(b);t._fulfillmentHandler0=e,t._rejectionHandler0=e,t._promise0=e,t._receiver0=e}var l,c=function(){return new g("circular promise resolution chain\n\n    See http://goo.gl/MqrFmX\n")},u=function(){return new o.PromiseInspection(this._target())},f=function(e){return o.reject(new g(e))},d={},h=e("./util");l=h.isNode?function(){var e=process.domain;return void 0===e&&(e=null),e}:function(){return null},h.notEnumerableProp(o,"_getDomain",l);var _=e("./es5"),p=e("./async"),m=new p;_.defineProperty(o,"_async",{value:m});var v=e("./errors"),g=o.TypeError=v.TypeError;o.RangeError=v.RangeError;var y=o.CancellationError=v.CancellationError;o.TimeoutError=v.TimeoutError,o.OperationalError=v.OperationalError,o.RejectionError=v.OperationalError,o.AggregateError=v.AggregateError;var b=function(){},w={},C={},E=e("./thenables")(o,b),N=e("./promise_array")(o,b,E,f,n),x=e("./context")(o),j=x.create,k=e("./debuggability")(o,x),F=(k.CapturedTrace,e("./finally")(o,E)),S=e("./catch_filter")(C),O=e("./nodeback"),T=h.errorObj,A=h.tryCatch;return o.prototype.toString=function(){return"[object Promise]"},o.prototype.caught=o.prototype.catch=function(e){var t=arguments.length;if(t>1){var n,r=new Array(t-1),o=0;for(n=0;n<t-1;++n){var i=arguments[n];if(!h.isObject(i))return f("expecting an object but got A catch statement predicate "+h.classString(i));r[o++]=i}return r.length=o,e=arguments[n],this.then(void 0,S(r,e,this))}return this.then(void 0,e)},o.prototype.reflect=function(){return this._then(u,u,void 0,this,void 0)},o.prototype.then=function(e,t){if(k.warnings()&&arguments.length>0&&"function"!=typeof e&&"function"!=typeof t){var n=".then() only accepts functions but was passed: "+h.classString(e);arguments.length>1&&(n+=", "+h.classString(t)),this._warn(n)}return this._then(e,t,void 0,void 0,void 0)},o.prototype.done=function(e,t){this._then(e,t,void 0,void 0,void 0)._setIsFinal()},o.prototype.spread=function(e){return"function"!=typeof e?f("expecting a function but got "+h.classString(e)):this.all()._then(e,void 0,void 0,w,void 0)},o.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},o.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new N(this).promise()},o.prototype.error=function(e){return this.caught(h.originatesFromRejection,e)},o.getNewLibraryCopy=t.exports,o.is=function(e){return e instanceof o},o.fromNode=o.fromCallback=function(e){var t=new o(b);t._captureStackTrace();var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=A(e)(O(t,n));return r===T&&t._rejectCallback(r.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},o.all=function(e){return new N(e).promise()},o.cast=function(e){var t=E(e);return t instanceof o||(t=new o(b),t._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},o.resolve=o.fulfilled=o.cast,o.reject=o.rejected=function(e){var t=new o(b);return t._captureStackTrace(),t._rejectCallback(e,!0),t},o.setScheduler=function(e){if("function"!=typeof e)throw new g("expecting a function but got "+h.classString(e));return m.setScheduler(e)},o.prototype._then=function(e,t,n,r,i){var s=void 0!==i,a=s?i:new o(b),c=this._target(),u=c._bitField;s||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===r&&0!=(2097152&this._bitField)&&(r=0!=(50397184&u)?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var f=l();if(0!=(50397184&u)){var d,_,p=c._settlePromiseCtx;0!=(33554432&u)?(_=c._rejectionHandler0,d=e):0!=(16777216&u)?(_=c._fulfillmentHandler0,d=t,c._unsetRejectionIsUnhandled()):(p=c._settlePromiseLateCancellationObserver,_=new y("late cancellation observer"),c._attachExtraTrace(_),d=t),m.invoke(p,c,{handler:null===f?d:"function"==typeof d&&h.domainBind(f,d),promise:a,receiver:r,value:_})}else c._addCallbacks(e,t,a,r,f);return a},o.prototype._length=function(){return 65535&this._bitField},o.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},o.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},o.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},o.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},o.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},o.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},o.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},o.prototype._isFinal=function(){return(4194304&this._bitField)>0},o.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},o.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},o.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},o.prototype._setAsyncGuaranteed=function(){m.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},o.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==d)return void 0===t&&this._isBound()?this._boundValue():t},o.prototype._promiseAt=function(e){return this[4*e-4+2]},o.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},o.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},o.prototype._boundValue=function(){},o.prototype._migrateCallback0=function(e){var t=(e._bitField,e._fulfillmentHandler0),n=e._rejectionHandler0,r=e._promise0,o=e._receiverAt(0);void 0===o&&(o=d),this._addCallbacks(t,n,r,o,null)},o.prototype._migrateCallbackAt=function(e,t){var n=e._fulfillmentHandlerAt(t),r=e._rejectionHandlerAt(t),o=e._promiseAt(t),i=e._receiverAt(t);void 0===i&&(i=d),this._addCallbacks(n,r,o,i,null)},o.prototype._addCallbacks=function(e,t,n,r,o){var i=this._length();if(i>=65531&&(i=0,this._setLength(0)),0===i)this._promise0=n,this._receiver0=r,"function"==typeof e&&(this._fulfillmentHandler0=null===o?e:h.domainBind(o,e)),"function"==typeof t&&(this._rejectionHandler0=null===o?t:h.domainBind(o,t));else{var s=4*i-4;this[s+2]=n,this[s+3]=r,"function"==typeof e&&(this[s+0]=null===o?e:h.domainBind(o,e)),"function"==typeof t&&(this[s+1]=null===o?t:h.domainBind(o,t))}return this._setLength(i+1),i},o.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},o.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(c(),!1);var n=E(e,this);if(!(n instanceof o))return this._fulfill(e);t&&this._propagateFrom(n,2);var r=n._target();if(r===this)return void this._reject(c());var i=r._bitField;if(0==(50397184&i)){var s=this._length();s>0&&r._migrateCallback0(this);for(var a=1;a<s;++a)r._migrateCallbackAt(this,a);this._setFollowing(),this._setLength(0),this._setFollowee(r)}else if(0!=(33554432&i))this._fulfill(r._value());else if(0!=(16777216&i))this._reject(r._reason());else{var l=new y("late cancellation observer");r._attachExtraTrace(l),this._reject(l)}}},o.prototype._rejectCallback=function(e,t,n){var r=h.ensureErrorObject(e),o=r===e;if(!o&&!n&&k.warnings()){var i="a promise was rejected with a non-error: "+h.classString(e);this._warn(i,!0)}this._attachExtraTrace(r,!!t&&o),this._reject(e)},o.prototype._resolveFromExecutor=function(e){var t=this;this._captureStackTrace(),this._pushContext();var n=!0,r=this._execute(e,function(e){t._resolveCallback(e)},function(e){t._rejectCallback(e,n)});n=!1,this._popContext(),void 0!==r&&t._rejectCallback(r,!0)},o.prototype._settlePromiseFromHandler=function(e,t,n,r){var o=r._bitField;if(0==(65536&o)){r._pushContext();var i;t===w?n&&"number"==typeof n.length?i=A(e).apply(this._boundValue(),n):(i=T,i.e=new g("cannot .spread() a non-array: "+h.classString(n))):i=A(e).call(t,n);var s=r._popContext();o=r._bitField,0==(65536&o)&&(i===C?r._reject(n):i===T?r._rejectCallback(i.e,!1):(k.checkForgottenReturns(i,s,"",r,this),r._resolveCallback(i)))}},o.prototype._target=function(){for(var e=this;e._isFollowing();)e=e._followee();return e},o.prototype._followee=function(){return this._rejectionHandler0},o.prototype._setFollowee=function(e){this._rejectionHandler0=e},o.prototype._settlePromise=function(e,t,r,i){var s=e instanceof o,a=this._bitField,l=0!=(134217728&a);0!=(65536&a)?(s&&e._invokeInternalOnCancel(),r instanceof F&&r.isFinallyHandler()?(r.cancelPromise=e,A(t).call(r,i)===T&&e._reject(T.e)):t===u?e._fulfill(u.call(r)):r instanceof n?r._promiseCancelled(e):s||e instanceof N?e._cancel():r.cancel()):"function"==typeof t?s?(l&&e._setAsyncGuaranteed(),this._settlePromiseFromHandler(t,r,i,e)):t.call(r,i,e):r instanceof n?r._isResolved()||(0!=(33554432&a)?r._promiseFulfilled(i,e):r._promiseRejected(i,e)):s&&(l&&e._setAsyncGuaranteed(),0!=(33554432&a)?e._fulfill(i):e._reject(i))},o.prototype._settlePromiseLateCancellationObserver=function(e){var t=e.handler,n=e.promise,r=e.receiver,i=e.value;"function"==typeof t?n instanceof o?this._settlePromiseFromHandler(t,r,i,n):t.call(r,i,n):n instanceof o&&n._reject(i)},o.prototype._settlePromiseCtx=function(e){this._settlePromise(e.promise,e.handler,e.receiver,e.value)},o.prototype._settlePromise0=function(e,t,n){var r=this._promise0,o=this._receiverAt(0);this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,e,o,t)},o.prototype._clearCallbackDataAtIndex=function(e){var t=4*e-4;this[t+2]=this[t+3]=this[t+0]=this[t+1]=void 0},o.prototype._fulfill=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(e===this){var n=c();return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():m.settlePromises(this))}},o.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return m.fatalError(e,h.isNode);(65535&t)>0?m.settlePromises(this):this._ensurePossibleRejectionHandled()}},o.prototype._fulfillPromises=function(e,t){for(var n=1;n<e;n++){var r=this._fulfillmentHandlerAt(n),o=this._promiseAt(n),i=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(o,r,i,t)}},o.prototype._rejectPromises=function(e,t){for(var n=1;n<e;n++){var r=this._rejectionHandlerAt(n),o=this._promiseAt(n),i=this._receiverAt(n);this._clearCallbackDataAtIndex(n),this._settlePromise(o,r,i,t)}},o.prototype._settlePromises=function(){var e=this._bitField,t=65535&e;if(t>0){if(0!=(16842752&e)){var n=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,n,e),this._rejectPromises(t,n)}else{var r=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,r,e),this._fulfillPromises(t,r)}this._setLength(0)}this._clearCancellationData()},o.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},o.defer=o.pending=function(){return k.deprecated("Promise.defer","new Promise"),{promise:new o(b),resolve:i,reject:s}},h.notEnumerableProp(o,"_makeSelfResolutionError",c),e("./method")(o,b,E,f,k),e("./bind")(o,b,E,k),e("./cancel")(o,N,f,k),e("./direct_resolve")(o),e("./synchronous_inspection")(o),e("./join")(o,N,E,b,m,l),o.Promise=o,o.version="3.4.6",e("./map.js")(o,N,f,E,b,k),e("./call_get.js")(o),e("./using.js")(o,f,E,j,b,k),e("./timers.js")(o,b,k),e("./generators.js")(o,f,b,E,n,k),e("./nodeify.js")(o),e("./promisify.js")(o,b),e("./props.js")(o,N,E,f),e("./race.js")(o,b,E,f),e("./reduce.js")(o,N,f,E,b,k),e("./settle.js")(o,N,k),e("./some.js")(o,N,f),e("./filter.js")(o,b),e("./each.js")(o,b),e("./any.js")(o),h.toFastProperties(o),h.toFastProperties(o.prototype),a({a:1}),a({b:2}),a({c:3}),a(1),a(function(){}),a(void 0),a(!1),a(new o(b)),k.setBounds(p.firstLineError,h.lastLineError),o}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(e,t,n){"use strict";t.exports=function(t,n,r,o,i){function s(e){switch(e){case-2:return[];case-3:return{}}}function a(e){var r=this._promise=new t(n);e instanceof t&&r._propagateFrom(e,3),r._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var l=e("./util");l.isArray;return l.inherits(a,i),a.prototype.length=function(){return this._length},a.prototype.promise=function(){return this._promise},a.prototype._init=function e(n,i){var a=r(this._values,this._promise);if(a instanceof t){a=a._target();var c=a._bitField;if(this._values=a,0==(50397184&c))return this._promise._setAsyncGuaranteed(),a._then(e,this._reject,void 0,this,i);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(a._reason()):this._cancel();a=a._value()}if(null===(a=l.asArray(a))){var u=o("expecting an array or an iterable object but got "+l.classString(a)).reason();return void this._promise._rejectCallback(u,!1)}if(0===a.length)return void(-5===i?this._resolveEmptyArray():this._resolve(s(i)));this._iterate(a)},a.prototype._iterate=function(e){var n=this.getActualLength(e.length);this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values;for(var o=this._promise,i=!1,s=null,a=0;a<n;++a){var l=r(e[a],o);l instanceof t?(l=l._target(),s=l._bitField):s=null,i?null!==s&&l.suppressUnhandledRejections():null!==s?0==(50397184&s)?(l._proxy(this,a),this._values[a]=l):i=0!=(33554432&s)?this._promiseFulfilled(l._value(),a):0!=(16777216&s)?this._promiseRejected(l._reason(),a):this._promiseCancelled(a):i=this._promiseFulfilled(l,a)}i||o._setAsyncGuaranteed()},a.prototype._isResolved=function(){return null===this._values},a.prototype._resolve=function(e){this._values=null,this._promise._fulfill(e)},a.prototype._cancel=function(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())},a.prototype._reject=function(e){this._values=null,this._promise._rejectCallback(e,!1)},a.prototype._promiseFulfilled=function(e,t){return this._values[t]=e,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseCancelled=function(){return this._cancel(),!0},a.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},a.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var n=0;n<e.length;++n)e[n]instanceof t&&e[n].cancel()}},a.prototype.shouldCopyValues=function(){return!0},a.prototype.getActualLength=function(e){return e},a}},{"./util":36}],24:[function(e,t,n){"use strict";t.exports=function(t,n){function r(e){return!w.test(e)}function o(e){try{return!0===e.__isPromisified__}catch(e){return!1}}function i(e,t,n){var r=h.getDataPropertyOrDefault(e,t+n,y);return!!r&&o(r)}function s(e,t,n){for(var r=0;r<e.length;r+=2){var o=e[r];if(n.test(o))for(var i=o.replace(n,""),s=0;s<e.length;s+=2)if(e[s]===i)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n    See http://goo.gl/MqrFmX\n".replace("%s",t))}}function a(e,t,n,r){for(var a=h.inheritedDataKeys(e),l=[],c=0;c<a.length;++c){var u=a[c],f=e[u],d=r===C||C(u,f,e);"function"!=typeof f||o(f)||i(e,u,t)||!r(u,f,e,d)||l.push(u,f)}return s(l,t,n),l}function l(e,r,o,i,s,a){function l(){var o=r;r===d&&(o=this);var i=new t(n);i._captureStackTrace();var s="string"==typeof u&&this!==c?this[u]:e,l=_(i,a);try{s.apply(o,p(arguments,l))}catch(e){i._rejectCallback(m(e),!0,!0)}return i._isFateSealed()||i._setAsyncGuaranteed(),i}var c=function(){return this}(),u=e;return"string"==typeof u&&(e=i),h.notEnumerableProp(l,"__isPromisified__",!0),l}function c(e,t,n,r,o){for(var i=new RegExp(E(t)+"$"),s=a(e,t,i,n),l=0,c=s.length;l<c;l+=2){var u=s[l],f=s[l+1],_=u+t;if(r===N)e[_]=N(u,d,u,f,t,o);else{var p=r(f,function(){return N(u,d,u,f,t,o)});h.notEnumerableProp(p,"__isPromisified__",!0),e[_]=p}}return h.toFastProperties(e),e}function u(e,t,n){return N(e,t,void 0,e,null,n)}var f,d={},h=e("./util"),_=e("./nodeback"),p=h.withAppended,m=h.maybeWrapAsError,v=h.canEvaluate,g=e("./errors").TypeError,y={__isPromisified__:!0},b=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],w=new RegExp("^(?:"+b.join("|")+")$"),C=function(e){return h.isIdentifier(e)&&"_"!==e.charAt(0)&&"constructor"!==e},E=function(e){return e.replace(/([$])/,"\\$")},N=v?f:l;t.promisify=function(e,t){if("function"!=typeof e)throw new g("expecting a function but got "+h.classString(e));if(o(e))return e;t=Object(t);var n=void 0===t.context?d:t.context,i=!!t.multiArgs,s=u(e,n,i);return h.copyDescriptors(e,s,r),s},t.promisifyAll=function(e,t){if("function"!=typeof e&&"object"!=typeof e)throw new g("the target of promisifyAll must be an object or a function\n\n    See http://goo.gl/MqrFmX\n");t=Object(t);var n=!!t.multiArgs,r=t.suffix;"string"!=typeof r&&(r="Async");var o=t.filter;"function"!=typeof o&&(o=C);var i=t.promisifier;if("function"!=typeof i&&(i=N),!h.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n    See http://goo.gl/MqrFmX\n");for(var s=h.inheritedDataKeys(e),a=0;a<s.length;++a){var l=e[s[a]];"constructor"!==s[a]&&h.isClass(l)&&(c(l.prototype,r,o,i,n),c(l,r,o,i,n))}return c(e,r,o,i,n)}}},{"./errors":12,"./nodeback":20,"./util":36}],25:[function(e,t,n){"use strict";t.exports=function(t,n,r,o){function i(e){var t,n=!1;if(void 0!==a&&e instanceof a)t=f(e),n=!0;else{var r=u.keys(e),o=r.length;t=new Array(2*o);for(var i=0;i<o;++i){var s=r[i];t[i]=e[s],t[i+o]=s}}this.constructor$(t),this._isMap=n,this._init$(void 0,-3)}function s(e){var n,s=r(e);return c(s)?(n=s instanceof t?s._then(t.props,void 0,void 0,void 0,void 0):new i(s).promise(),s instanceof t&&n._propagateFrom(s,2),n):o("cannot await properties of a non-object\n\n    See http://goo.gl/MqrFmX\n")}var a,l=e("./util"),c=l.isObject,u=e("./es5");"function"==typeof Map&&(a=Map);var f=function(){function e(e,r){this[t]=e,this[t+n]=r,t++}var t=0,n=0;return function(r){n=r.size,t=0;var o=new Array(2*r.size);return r.forEach(e,o),o}}(),d=function(e){for(var t=new a,n=e.length/2|0,r=0;r<n;++r){var o=e[n+r],i=e[r];t.set(o,i)}return t};l.inherits(i,n),i.prototype._init=function(){},i.prototype._promiseFulfilled=function(e,t){if(this._values[t]=e,++this._totalResolved>=this._length){var n;if(this._isMap)n=d(this._values);else{n={};for(var r=this.length(),o=0,i=this.length();o<i;++o)n[this._values[o+r]]=this._values[o]}return this._resolve(n),!0}return!1},i.prototype.shouldCopyValues=function(){return!1},i.prototype.getActualLength=function(e){return e>>1},t.prototype.props=function(){return s(this)},t.props=function(e){return s(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,n){"use strict";function r(e,t,n,r,o){for(var i=0;i<o;++i)n[i+r]=e[i+t],e[i+t]=void 0}function o(e){this._capacity=e,this._length=0,this._front=0}o.prototype._willBeOverCapacity=function(e){return this._capacity<e},o.prototype._pushOne=function(e){var t=this.length();this._checkCapacity(t+1),this[this._front+t&this._capacity-1]=e,this._length=t+1},o.prototype._unshiftOne=function(e){var t=this._capacity;this._checkCapacity(this.length()+1);var n=this._front,r=(n-1&t-1^t)-t;this[r]=e,this._front=r,this._length=this.length()+1},o.prototype.unshift=function(e,t,n){this._unshiftOne(n),this._unshiftOne(t),this._unshiftOne(e)},o.prototype.push=function(e,t,n){var r=this.length()+3;if(this._willBeOverCapacity(r))return this._pushOne(e),this._pushOne(t),void this._pushOne(n);var o=this._front+r-3;this._checkCapacity(r);var i=this._capacity-1;this[o+0&i]=e,this[o+1&i]=t,this[o+2&i]=n,this._length=r},o.prototype.shift=function(){var e=this._front,t=this[e];return this[e]=void 0,this._front=e+1&this._capacity-1,this._length--,t},o.prototype.length=function(){return this._length},o.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(this._capacity<<1)},o.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e,r(this,0,this,t,this._front+this._length&t-1)},t.exports=o},{}],27:[function(e,t,n){"use strict";t.exports=function(t,n,r,o){function i(e,i){var l=r(e);if(l instanceof t)return a(l);if(null===(e=s.asArray(e)))return o("expecting an array or an iterable object but got "+s.classString(e));var c=new t(n);void 0!==i&&c._propagateFrom(i,3);for(var u=c._fulfill,f=c._reject,d=0,h=e.length;d<h;++d){var _=e[d];(void 0!==_||d in e)&&t.cast(_)._then(u,f,void 0,c,null)}return c}var s=e("./util"),a=function(e){return e.then(function(t){return i(t,e)})};t.race=function(e){return i(e,void 0)},t.prototype.race=function(){return i(this,void 0)}}},{"./util":36}],28:[function(e,t,n){"use strict";t.exports=function(t,n,r,o,i,s){function a(e,n,r,o){this.constructor$(e);var s=d();this._fn=null===s?n:h.domainBind(s,n),void 0!==r&&(r=t.resolve(r),r._attachCancellationCallback(this)),this._initialValue=r,this._currentCancellable=null,this._eachValues=o===i?Array(this._length):0===o?null:void 0,this._promise._captureStackTrace(),this._init$(void 0,-5)}function l(e,t){this.isFulfilled()?t._resolve(e):t._reject(e)}function c(e,t,n,o){return"function"!=typeof t?r("expecting a function but got "+h.classString(t)):new a(e,t,n,o).promise()}function u(e){this.accum=e,this.array._gotAccum(e);var n=o(this.value,this.array._promise);return n instanceof t?(this.array._currentCancellable=n,n._then(f,void 0,void 0,this,void 0)):f.call(this,n)}function f(e){var n=this.array,r=n._promise,o=_(n._fn);r._pushContext();var i;(i=void 0!==n._eachValues?o.call(r._boundValue(),e,this.index,this.length):o.call(r._boundValue(),this.accum,e,this.index,this.length))instanceof t&&(n._currentCancellable=i);var a=r._popContext();return s.checkForgottenReturns(i,a,void 0!==n._eachValues?"Promise.each":"Promise.reduce",r),i}var d=t._getDomain,h=e("./util"),_=h.tryCatch;h.inherits(a,n),a.prototype._gotAccum=function(e){void 0!==this._eachValues&&null!==this._eachValues&&e!==i&&this._eachValues.push(e)},a.prototype._eachComplete=function(e){
return null!==this._eachValues&&this._eachValues.push(e),this._eachValues},a.prototype._init=function(){},a.prototype._resolveEmptyArray=function(){this._resolve(void 0!==this._eachValues?this._eachValues:this._initialValue)},a.prototype.shouldCopyValues=function(){return!1},a.prototype._resolve=function(e){this._promise._resolveCallback(e),this._values=null},a.prototype._resultCancelled=function(e){if(e===this._initialValue)return this._cancel();this._isResolved()||(this._resultCancelled$(),this._currentCancellable instanceof t&&this._currentCancellable.cancel(),this._initialValue instanceof t&&this._initialValue.cancel())},a.prototype._iterate=function(e){this._values=e;var n,r,o=e.length;if(void 0!==this._initialValue?(n=this._initialValue,r=0):(n=t.resolve(e[0]),r=1),this._currentCancellable=n,!n.isRejected())for(;r<o;++r){var i={accum:null,value:e[r],index:r,length:o,array:this};n=n._then(u,void 0,void 0,i,void 0)}void 0!==this._eachValues&&(n=n._then(this._eachComplete,void 0,void 0,this,void 0)),n._then(l,l,void 0,n,this)},t.prototype.reduce=function(e,t){return c(this,e,t,null)},t.reduce=function(e,t,n,r){return c(e,t,n,r)}}},{"./util":36}],29:[function(e,t,n){"use strict";var r,o=e("./util"),i=function(){throw new Error("No async scheduler available\n\n    See http://goo.gl/MqrFmX\n")},s=o.getNativePromise();if(o.isNode&&"undefined"==typeof MutationObserver){var a=global.setImmediate,l=process.nextTick;r=o.isRecentNode?function(e){a.call(global,e)}:function(e){l.call(process,e)}}else if("function"==typeof s&&"function"==typeof s.resolve){var c=s.resolve();r=function(e){c.then(e)}}else r="undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&(window.navigator.standalone||window.cordova)?"undefined"!=typeof setImmediate?function(e){setImmediate(e)}:"undefined"!=typeof setTimeout?function(e){setTimeout(e,0)}:i:function(){var e=document.createElement("div"),t={attributes:!0},n=!1,r=document.createElement("div");new MutationObserver(function(){e.classList.toggle("foo"),n=!1}).observe(r,t);var o=function(){n||(n=!0,r.classList.toggle("foo"))};return function(n){var r=new MutationObserver(function(){r.disconnect(),n()});r.observe(e,t),o()}}();t.exports=r},{"./util":36}],30:[function(e,t,n){"use strict";t.exports=function(t,n,r){function o(e){this.constructor$(e)}var i=t.PromiseInspection;e("./util").inherits(o,n),o.prototype._promiseResolved=function(e,t){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(e,t){var n=new i;return n._bitField=33554432,n._settledValueField=e,this._promiseResolved(t,n)},o.prototype._promiseRejected=function(e,t){var n=new i;return n._bitField=16777216,n._settledValueField=e,this._promiseResolved(t,n)},t.settle=function(e){return r.deprecated(".settle()",".reflect()"),new o(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,n){"use strict";t.exports=function(t,n,r){function o(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function i(e,t){if((0|t)!==t||t<0)return r("expecting a positive integer\n\n    See http://goo.gl/MqrFmX\n");var n=new o(e),i=n.promise();return n.setHowMany(t),n.init(),i}var s=e("./util"),a=e("./errors").RangeError,l=e("./errors").AggregateError,c=s.isArray,u={};s.inherits(o,n),o.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var e=c(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},o.prototype.init=function(){this._initialized=!0,this._init()},o.prototype.setUnwrap=function(){this._unwrap=!0},o.prototype.howMany=function(){return this._howMany},o.prototype.setHowMany=function(e){this._howMany=e},o.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},o.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},o.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},o.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new l,t=this.length();t<this._values.length;++t)this._values[t]!==u&&e.push(this._values[t]);return e.length>0?this._reject(e):this._cancel(),!0}return!1},o.prototype._fulfilled=function(){return this._totalResolved},o.prototype._rejected=function(){return this._values.length-this.length()},o.prototype._addRejected=function(e){this._values.push(e)},o.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},o.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},o.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new a(t)},o.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return i(e,t)},t.prototype.some=function(e){return i(this,e)},t._SomePromiseArray=o}},{"./errors":12,"./util":36}],32:[function(e,t,n){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var n=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n    See http://goo.gl/MqrFmX\n");return this._settledValue()},r=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n    See http://goo.gl/MqrFmX\n");return this._settledValue()},o=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},i=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},s=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},a=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return s.call(this._target())},e.prototype.isRejected=function(){return i.call(this._target())},e.prototype.isFulfilled=function(){return o.call(this._target())},e.prototype.isResolved=function(){return a.call(this._target())},e.prototype.value=function(){return n.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),r.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,n){"use strict";t.exports=function(t,n){function r(e,r){if(u(e)){if(e instanceof t)return e;var o=i(e);if(o===c){r&&r._pushContext();var l=t.reject(o.e);return r&&r._popContext(),l}if("function"==typeof o){if(s(e)){var l=new t(n);return e._then(l._fulfill,l._reject,void 0,l,null),l}return a(e,o,r)}}return e}function o(e){return e.then}function i(e){try{return o(e)}catch(e){return c.e=e,c}}function s(e){try{return f.call(e,"_promise0")}catch(e){return!1}}function a(e,r,o){function i(e){a&&(a._resolveCallback(e),a=null)}function s(e){a&&(a._rejectCallback(e,f,!0),a=null)}var a=new t(n),u=a;o&&o._pushContext(),a._captureStackTrace(),o&&o._popContext();var f=!0,d=l.tryCatch(r).call(e,i,s);return f=!1,a&&d===c&&(a._rejectCallback(d.e,!0,!0),a=null),u}var l=e("./util"),c=l.errorObj,u=l.isObject,f={}.hasOwnProperty;return r}},{"./util":36}],34:[function(e,t,n){"use strict";t.exports=function(t,n,r){function o(e){this.handle=e}function i(e){return clearTimeout(this.handle),e}function s(e){throw clearTimeout(this.handle),e}var a=e("./util"),l=t.TimeoutError;o.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(e){return u(+this).thenReturn(e)},u=t.delay=function(e,i){var s,a;return void 0!==i?(s=t.resolve(i)._then(c,null,null,e,void 0),r.cancellation()&&i instanceof t&&s._setOnCancel(i)):(s=new t(n),a=setTimeout(function(){s._fulfill()},+e),r.cancellation()&&s._setOnCancel(new o(a)),s._captureStackTrace()),s._setAsyncGuaranteed(),s};t.prototype.delay=function(e){return u(e,this)};var f=function(e,t,n){var r;r="string"!=typeof t?t instanceof Error?t:new l("operation timed out"):new l(t),a.markAsOriginatingFromRejection(r),e._attachExtraTrace(r),e._reject(r),null!=n&&n.cancel()};t.prototype.timeout=function(e,t){e=+e;var n,a,l=new o(setTimeout(function(){n.isPending()&&f(n,t,a)},e));return r.cancellation()?(a=this.then(),n=a._then(i,s,void 0,l,void 0),n._setOnCancel(l)):n=this._then(i,s,void 0,l,void 0),n}}},{"./util":36}],35:[function(e,t,n){"use strict";t.exports=function(t,n,r,o,i,s){function a(e){setTimeout(function(){throw e},0)}function l(e){var t=r(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}function c(e,n){function o(){if(s>=c)return u._fulfill();var i=l(e[s++]);if(i instanceof t&&i._isDisposable()){try{i=r(i._getDisposer().tryDispose(n),e.promise)}catch(e){return a(e)}if(i instanceof t)return i._then(o,a,null,null,null)}o()}var s=0,c=e.length,u=new t(i);return o(),u}function u(e,t,n){this._data=e,this._promise=t,this._context=n}function f(e,t,n){this.constructor$(e,t,n)}function d(e){return u.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function h(e){this.length=e,this.promise=null,this[e-1]=null}var _=e("./util"),p=e("./errors").TypeError,m=e("./util").inherits,v=_.errorObj,g=_.tryCatch,y={};u.prototype.data=function(){return this._data},u.prototype.promise=function(){return this._promise},u.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():y},u.prototype.tryDispose=function(e){var t=this.resource(),n=this._context;void 0!==n&&n._pushContext();var r=t!==y?this.doDispose(t,e):null;return void 0!==n&&n._popContext(),this._promise._unsetDisposable(),this._data=null,r},u.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},m(f,u),f.prototype.doDispose=function(e,t){return this.data().call(e,e,t)},h.prototype._resultCancelled=function(){for(var e=this.length,n=0;n<e;++n){var r=this[n];r instanceof t&&r.cancel()}},t.using=function(){var e=arguments.length;if(e<2)return n("you must pass at least 2 arguments to Promise.using");var o=arguments[e-1];if("function"!=typeof o)return n("expecting a function but got "+_.classString(o));var i,a=!0;2===e&&Array.isArray(arguments[0])?(i=arguments[0],e=i.length,a=!1):(i=arguments,e--);for(var l=new h(e),f=0;f<e;++f){var p=i[f];if(u.isDisposer(p)){var m=p;p=p.promise(),p._setDisposable(m)}else{var y=r(p);y instanceof t&&(p=y._then(d,null,null,{resources:l,index:f},void 0))}l[f]=p}for(var b=new Array(l.length),f=0;f<b.length;++f)b[f]=t.resolve(l[f]).reflect();var w=t.all(b).then(function(e){for(var t=0;t<e.length;++t){var n=e[t];if(n.isRejected())return v.e=n.error(),v;if(!n.isFulfilled())return void w.cancel();e[t]=n.value()}C._pushContext(),o=g(o);var r=a?o.apply(void 0,e):o(e),i=C._popContext();return s.checkForgottenReturns(r,i,"Promise.using",C),r}),C=w.lastly(function(){var e=new t.PromiseInspection(w);return c(l,e)});return l.promise=C,C._setOnCancel(l),C},t.prototype._setDisposable=function(e){this._bitField=131072|this._bitField,this._disposer=e},t.prototype._isDisposable=function(){return(131072&this._bitField)>0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new f(e,this,o());throw new p}}},{"./errors":12,"./util":36}],36:[function(e,t,n){"use strict";function r(){try{var e=S;return S=null,e.apply(this,arguments)}catch(e){return F.e=e,F}}function o(e){return S=e,r}function i(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function s(e){return"function"==typeof e||"object"==typeof e&&null!==e}function a(e){return i(e)?new Error(m(e)):e}function l(e,t){var n,r=e.length,o=new Array(r+1);for(n=0;n<r;++n)o[n]=e[n];return o[n]=t,o}function c(e,t,n){if(!j.isES5)return{}.hasOwnProperty.call(e,t)?e[t]:void 0;var r=Object.getOwnPropertyDescriptor(e,t);return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function u(e,t,n){if(i(e))return e;var r={value:n,configurable:!0,enumerable:!1,writable:!0};return j.defineProperty(e,t,r),e}function f(e){throw e}function d(e){try{if("function"==typeof e){var t=j.names(e.prototype),n=j.isES5&&t.length>1,r=t.length>0&&!(1===t.length&&"constructor"===t[0]),o=R.test(e+"")&&j.names(e).length>0;if(n||r||o)return!0}return!1}catch(e){return!1}}function h(e){function t(){}t.prototype=e;for(var n=8;n--;)new t;return e}function _(e){return P.test(e)}function p(e,t,n){for(var r=new Array(e),o=0;o<e;++o)r[o]=t+o+n;return r}function m(e){try{return e+""}catch(e){return"[no string representation]"}}function v(e){return null!==e&&"object"==typeof e&&"string"==typeof e.message&&"string"==typeof e.name}function g(e){try{u(e,"isOperational",!0)}catch(e){}}function y(e){return null!=e&&(e instanceof Error.__BluebirdErrorTypes__.OperationalError||!0===e.isOperational)}function b(e){return v(e)&&j.propertyIsWritable(e,"stack")}function w(e){return{}.toString.call(e)}function C(e,t,n){for(var r=j.names(e),o=0;o<r.length;++o){var i=r[o];if(n(i))try{j.defineProperty(t,i,j.getDescriptor(e,i))}catch(e){}}}function E(e,t){return I?process.env[e]:t}function N(){if("function"==typeof Promise)try{var e=new Promise(function(){});if("[object Promise]"==={}.toString.call(e))return Promise}catch(e){}}function x(e,t){return e.bind(t)}var j=e("./es5"),k="undefined"==typeof navigator,F={e:{}},S,O="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null,T=function(e,t){function n(){this.constructor=e,this.constructor$=t;for(var n in t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}var r={}.hasOwnProperty;return n.prototype=t.prototype,e.prototype=new n,e.prototype},A=function(){var e=[Array.prototype,Object.prototype,Function.prototype],t=function(t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1};if(j.isES5){var n=Object.getOwnPropertyNames;return function(e){for(var r=[],o=Object.create(null);null!=e&&!t(e);){var i;try{i=n(e)}catch(e){return r}for(var s=0;s<i.length;++s){var a=i[s];if(!o[a]){o[a]=!0;var l=Object.getOwnPropertyDescriptor(e,a);null!=l&&null==l.get&&null==l.set&&r.push(a)}}e=j.getPrototypeOf(e)}return r}}var r={}.hasOwnProperty;return function(n){if(t(n))return[];var o=[];e:for(var i in n)if(r.call(n,i))o.push(i);else{for(var s=0;s<e.length;++s)if(r.call(e[s],i))continue e;o.push(i)}return o}}(),R=/this\s*\.\s*\S+\s*=/,P=/^[a-z$_][a-z$_0-9]*$/i,M=function(){return"stack"in new Error?function(e){return b(e)?e:new Error(m(e))}:function(e){if(b(e))return e;try{throw new Error(m(e))}catch(e){return e}}}(),D=function(e){return j.isArray(e)?e:null};if("undefined"!=typeof Symbol&&Symbol.iterator){var L="function"==typeof Array.from?function(e){return Array.from(e)}:function(e){for(var t,n=[],r=e[Symbol.iterator]();!(t=r.next()).done;)n.push(t.value);return n};D=function(e){return j.isArray(e)?e:null!=e&&"function"==typeof e[Symbol.iterator]?L(e):null}}var I="undefined"!=typeof process&&"[object process]"===w(process).toLowerCase(),H={isClass:d,isIdentifier:_,inheritedDataKeys:A,getDataPropertyOrDefault:c,thrower:f,isArray:j.isArray,asArray:D,notEnumerableProp:u,isPrimitive:i,isObject:s,isError:v,canEvaluate:k,errorObj:F,tryCatch:o,inherits:T,withAppended:l,maybeWrapAsError:a,toFastProperties:h,filledRange:p,toString:m,canAttachTrace:b,ensureErrorObject:M,originatesFromRejection:y,markAsOriginatingFromRejection:g,classString:w,copyDescriptors:C,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:I,env:E,global:O,getNativePromise:N,domainBind:x};H.isRecentNode=H.isNode&&function(){var e=process.versions.node.split(".").map(Number);return 0===e[0]&&e[1]>10||e[0]>0}(),H.isNode&&H.toFastProperties(process);try{throw new Error}catch(e){H.lastLineError=e}t.exports=H},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise),function(e,t){if("function"==typeof define&&define.amd)define("_lib/score/init",t);else if("object"==typeof module&&module.exports)module.exports=t();else{var n=e.score,r=t();r.noConflict=function(){return e.score=n,n=r,r.noConflict=function(){return r},r},e.score=r}}(this,function(){var e=[],t={__version__:"0.0.3",extend:function(n,r,o){var i,s,a,l,c,u,f,d=[];for(i=0;i<r.length;i++)for(c=r[i].split("."),u=t,s=0;s<c.length;s++){try{f=u[c[s]]}catch(e){d.push(c.slice(0,s+1).join("."));break}if(!f){d.push(c.slice(0,s+1).join("."));break}u=f}for(u=t,c=n.split("."),s=0;s<c.length-1;s++){try{f=u[c[s]]}catch(e){d.push(c.slice(0,s+1).join("."));break}if(!f){d.push(c.slice(0,s+1).join("."));break}u=f}if(l=c[s],d.length)e.push([n,r,o]),Object.defineProperties&&(a={},a[l]={configurable:!0,get:function(){throw new Error("Missing "+n+" dependencies: ["+d.join(", ")+"]")},set:function(e){a[l]={value:e,enumerable:!0},Object.defineProperties(u,a)}},Object.defineProperties(u,a));else for(u[l]=o.call(t,t),a=e,e=[],i=0;i<a.length;i++)t.extend.apply(this,a[i])}};return t}),function(e,t){"function"==typeof define&&define.amd?define("_lib/score/dom",["score.init"],t):t("object"==typeof module&&module.exports?require("score.init"):e.score)}(this,function(e){e.extend("dom",[],function(){var t,n,r,o,i,s,a,l=["matches","webkitMatchesSelector","msMatchesSelector"].filter(function(e){return e in document.documentElement})[0],c=function(e){if(r=Object.create(c.proto),e)if("object"==typeof e&&Object.getPrototypeOf(e)==c.proto)r=e;else if(Array.isArray(e))r.concat(e);else if(/\[object (HTMLCollection|NodeList)\]/.test(Object.prototype.toString.call(e)))for(t=0;t<e.length;t++)r.push(e[t]);else if("object"==typeof e)r.push(e);else for(o=c.queryGlobal(e),t=o.length;t--;r.unshift(o[t]));return r};return c.proto=Object.create(Array.prototype,{first:{get:function(){if(!this.length)throw new Error("Empty list");return e.dom(this[0])}},DOMNode:{get:function(){if(!this.length)throw new Error("Empty list");if(this.length>1)throw new Error("Attempting Single-Node-Operation on multiple nodes");return this[0]}},last:{get:function(){if(!this.length)throw new Error("Empty list");return e.dom(this[this.length-1])}},eq:{value:function(t){if(t<0||t>=this.length)throw new Error("Invalid index");return e.dom(this[t])}},uniq:{value:function(e){for(r=Object.create(c.proto),t=0;t<this.length;t++)r.indexOf(this[t])<0&&r.push(this[t]);return r}},clone:{value:function(e){for(void 0===e&&(e=!0),r=Object.create(c.proto),t=0;t<this.length;t++)r.push(this[t].cloneNode(e));return r}},matches:{value:function(e){if(!this.length)throw new Error("Empty list");for(t=0;t<this.length;t++)if(!c.testMatch(this[t],e))return!1;return!0}},empty:{value:function(){return!this.length}},forEach:{value:function(t,n){for(var r=0;r<this.length;r++)t.call(n,e.dom(this[r]),r,this);return this}},children:{value:function(e){for(r=Object.create(c.proto),t=0;t<this.length;t++)for(o=this[t].children,n=0;n<o.length;n++)e&&!c.testMatch(o[n],e)||r.push(o[n]);return r}},parent:{value:function(e){for(r=Object.create(c.proto),t=0;t<this.length;t++)o=this[t].parentNode,e&&!c.testMatch(o,e)||r.push(o);return r}},find:{value:function(e){for(r=Object.create(c.proto),t=0;t<this.length;t++)for(o=c.queryLocal(this[t],e),n=0;n<o.length;n++)r.push(o[n]);return r}},closest:{value:function(e){for(r=Object.create(c.proto),t=0;t<this.length;t++)for(o=this[t].parentNode;o&&o!==document;){if(c.testMatch(o,e)){r.push(o);break}o=o.parentNode}return r}},text:{value:function(e){if(void 0===e){if(!this.length)throw new Error("Empty list");if(this.length>1)throw new Error("Attempting Single-Node-Operation on multiple nodes");return this[0].textContent}for(t=0;t<this.length;t++)this[t].textContent=e;return this}},attr:{value:function(e,n){if(void 0===n){if(!this.length)throw new Error("Empty list");if(this.length>1)throw new Error("Attempting Single-Node-Operation on multiple nodes");return this[0].getAttribute(e)}if(null===n)for(t=0;t<this.length;t++)this[t].removeAttribute(e);else for(t=0;t<this.length;t++)this[t].setAttribute(e,n);return this}},detach:{value:function(){for(t=0;t<this.length;t++)this[t].parentNode.removeChild(this[t]);return this}},append:{value:function(n,r){if(!this.length)throw new Error("Empty list");if(this.length>1)throw new Error("Attempting Single-Node-Operation on multiple nodes");if(i=e.dom(n),r){if(r=e.dom(r),!r.length)throw new Error("Empty pivot");if(r.length>1)throw new Error("Received multiple pivot nodes");if(r[0].parentNode!==this[0])throw new Error("Pivot node is not a direct child of `this`");if(r[0].nextSibling)for(r=r[0].nextSibling,t=0;t<i.length;t++)this[0].insertBefore(i[t],r);else for(t=0;t<i.length;t++)this[0].appendChild(i[t])}else for(t=0;t<i.length;t++)this[0].appendChild(i[t]);return this}},prepend:{value:function(n,r){if(!this.length)throw new Error("Empty list");if(this.length>1)throw new Error("Attempting Single-Node-Operation on multiple nodes");if(i=e.dom(n),r){if(r=e.dom(r),!r.length)throw new Error("Empty pivot");if(r.length>1)throw new Error("Received multiple pivot nodes");if(r[0].parentNode!==this[0])throw new Error("Pivot node is not a direct child of `this`");for(o=r[0],t=0;t<i.length;t++)this[0].insertBefore(i[t],o)}else{if(!this[0].children.length)return this.append(n);for(o=this[0].children[0],t=0;t<i.length;t++)this[0].insertBefore(i[t],o)}return this}},hasClass:{value:function(e){if(!this.length)return!1;for(s=new RegExp("(^|\\s+)("+e+")(\\s+|$)"),t=0;t<this.length;t++)if(!this[t].className.match(s))return!1;return!0}},addClass:{value:function(e){for(s=new RegExp("(^|\\s+)("+e+")(\\s+|$)"),t=0;t<this.length;t++)a=this[t].className,a?a.match(s)||(this[t].className=a+" "+e):this[t].className=e;return this}},toggleClass:{value:function(e){for(s=new RegExp("(^|\\s+)("+e+")(\\s+|$)"),t=0;t<this.length;t++)a=this[t].className,a?a.match(s)?this[t].className=a.replace(s,"$3"):this[t].className=a+" "+e:this[t].className=e;return this}},removeClass:{value:function(e){for(s=new RegExp("(^|\\s+)("+e+")(\\s+|$)"),t=0;t<this.length;t++)(a=this[t].className)&&(this[t].className=a.replace(s,"$3"));return this}},on:{value:function(e,n){for(t=0;t<this.length;t++)this[t].addEventListener(e,n);return this}},off:{value:function(e,n){for(t=0;t<this.length;t++)this[t].removeEventListener(e,n);return this}}}),c.create=function(e){return r=Object.create(c.proto),r.push(document.createElement(e)),r},c.fromString=function(t){return o=document.createElement("div"),o.insertAdjacentHTML("afterbegin",t),e.dom(o.children).detach()},c.queryGlobal=document.querySelectorAll.bind(document),c.queryLocal=function(e,t){return e.querySelectorAll(t)},c.testMatch=function(e,t){return e[l](t)},c.__version__="0.0.14",c})}),function(e,t){"function"==typeof define&&define.amd?define("_lib/score/ajax",["score.init"],t):t("object"==typeof module&&module.exports?require("score.init"):e.score)}(this,function(e){e.extend("ajax",[],function(){var e=function(t,n){return new BPromise(function(r,o){return e.callback(t,n,r,o)})};return e.callback=function(e,t,n,r){"function"==typeof t?(r=n,n=t,t={}):t||(t={});var o=new XMLHttpRequest;if(o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){var e;o.responseType&&void 0!==o.response?e=o.response:(e=o.responseText,null!==o.getResponseHeader("Content-Type")&&"application/json"==o.getResponseHeader("Content-Type").trim().substr(0,16)&&(e=JSON.parse(e))),200==o.status?n(e):r&&r({status:o.status,statusText:o.statusText,response:e})}},o.open(t.method||"GET",e,!0),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.headers)for(var i in t.headers)o.setRequestHeader(i,t.headers[i]);o.send(t.data||"")},e.__version__="0.0.6",e})}),function(e,t){"function"==typeof define&&define.amd?define("_lib/score/oop",["score.init"],t):"object"==typeof module&&module.exports?module.exports=t(require("score.init")):t(e.score)}(this,function(score){score.extend("oop",[],function(){var oop={__version__:"0.4.3"},superRe=/\b__super__\b/,argumentsRe=/\barguments\b/,extractParameterNames=function(e){var t=0,n=extractParameterNames.toString.call(e),r=function(e){for(;n[t]!==e;)if(t++,"/"===n[t])if(t++,"/"===n[t])for(t++;"\n"!==n[t];)t++;else if("*"===n[t])for(t++;"*"!==n[t]&&"/"!==n[t+1];)t++;return t},o=r("(")+1,i=r(")");return n.substring(o,i).replace(/\/\*.*?\*\//,"").replace(/\/\/.*?\n/,"").trim().split(/\s*,\s*/)},createSubFunc=function(__super__,function_,name){if(!(argumentsRe.test(function_)||0!==function_.length||__super__&&superRe.test(function_)))return function_;var args=extractParameterNames(function_).slice(1),declaration="function "+name+"("+args.join(", ")+") {\n",body;return body=argumentsRe.test(function_)?"    var __args__ = new Array(arguments.length + 1);\n    __args__[0] = this;\n    for (var i = 0; i < arguments.length; i++) {\n        __args__[i + 1] = arguments[i];\n    }\n    var __result__ = function_.apply(this, __args__);\n":function_.length>1?"    var __result__ = function_.call(this, this, "+args.join(", ")+");\n":1==function_.length?"    var __result__ = function_.call(this, this);\n":"    var __result__ = function_.call(this);\n",body=__super__&&superRe.test(function_)?"    var __previous_super__ = this.__super__;\n    this.__super__ = __super__.bind(this);\n"+body+"    this.__super__ = __previous_super__;\n":"    var __previous_super__ = this.__super__;\n    delete this.__super__;\n"+body+"    this.__super__ = __previous_super__;\n",body+="    return __result__;\n}",eval("["+declaration+body+"]")[0]},createConstructor=function(name,conf,parents,members,methods){var __init__,__parent_init__;conf.__init__&&(__init__=conf.__init__);for(var i=parents.length-1;i>=0;i--)if(parents[i].__conf__.__init__){if(__init__){__parent_init__=parents[i].__conf__.__wrapped_init__;break}__init__=parents[i].__conf__.__init__}var args;args=__init__?extractParameterNames(__init__).slice(1):[];var declaration="function "+name+"("+args.join(", ")+") {\n",call,body;call=__init__&&argumentsRe.test(__init__)?'        var args = [];\n        for (var i = 0; i < arguments.length; i++) {\n            args.push("arguments[" + i + "]");\n        }\n        return eval("new '+name+'(" + args.join(", ") + ")")\n':"        return new "+name+"("+args.join(", ")+");\n",body="    if (!(this instanceof "+name+")) {\n"+call+"    }\n",parents[parents.length-1].prototype.__events__&&(body+="        this.__events__ = {\n            validNames: "+name+".prototype.__events__.validNames,\n            listeners: {}\n        };\n");for(var attr in members)if(members[attr]instanceof Array){body+="    this."+attr+" = [\n";for(var lines=[],i=0;i<members[attr].length;i++)lines.push("        members."+attr+"["+i+"]");body+=lines.join(",\n")+"\n",body+="    ];\n"}else if(members[attr]instanceof Object){body+="    this."+attr+" = {\n";var lines=[];for(var key in members[attr])lines.push('        "'+key+'": members.'+attr+'["'+key+'"]');body+=lines.join(",\n")+"\n",body+="    };\n"}else body+="    this."+attr+" = members."+attr+";\n";for(attr in methods)body+="    this."+attr+" = methods."+attr+".bind(this);\n";if(__init__){conf.__wrapped_init__=createSubFunc(__parent_init__,__init__,name+"__init__");var initCall;initCall=argumentsRe.test(__init__)?"    var args = new Array(arguments.length + 1);\n    args[0] = this;\n    for (var i = 0; i < arguments.length; i++) {\n        args[i + 1] = arguments[i];\n    }\n    __init__.apply(this, args);\n":__init__.length>1?"    __init__.call(this, this, "+args.join(", ")+");\n":1==__init__.length?"    __init__.call(this, this);\n":"    __init__.call(this);\n",__parent_init__&&(initCall="    var __previous_super__ = this.__super__;\n    this.__super__ = __parent_init__.bind(this);\n"+initCall+"    this.__super__ = __previous_super__;\n"),body+=initCall}return body+="}",eval("["+declaration+body+"]")[0]},checkConf=function(e){if("object"!=typeof e)throw new Error("Class configuration not an object");if(!e.__name__)throw new Error("No class __name__ defined");if(/^_*[A-Z]/.test(e.__name__)||console.warn("Class names should start with a capital letter",e.__name__),!/^_*[a-zA-Z][a-zA-Z0-9_]*$/.test(e.__name__))throw new Error('Invalid class name "'+e.__name__+'"');if(void 0!==e.__init__&&"function"!=typeof e.__init__)throw new Error(e.__name__+".__init__ must be a function");if(e.__parent__&&(!e.__parent__.__conf__||!e.__parent__.__conf__.__name__))throw new Error(e.__name__+".__parent__ is not an oop.Class type")},gatherParents=function(e){if(!e.__parent__)return[oop.Class];for(var t=[],n=e.__parent__;n;n=n.__conf__.__parent__)t.push(n);return t[t.length-1]!==oop.Exception&&t.push(oop.Class),t=t.reverse()};oop.Class=function(e){checkConf(e);var t=e.__name__,n=gatherParents(e),r={},o={},i={},s={},a={};n.forEach(function(e){if(e.__conf__.__static__)for(var t in e.__conf__.__static__)if("_"!==t[0]||"_"!==t[1]){var n=e.__conf__.__static__[t];"function"==typeof n?o[t]=e.__conf__.__static__.__unbound__[t]:r[t]=n,a[t]=e}for(var t in e.__conf__)if("_"!==t[0]||"_"!==t[1]){var n=e.__conf__[t];"function"==typeof n?s[t]=e.prototype[t]:i[t]=n}});var l=Object.create(e.__parent__?e.__parent__.prototype:oop.Class.prototype);if(e.__static__){e.__static__.__unbound__={};for(var c in e.__static__){var u=e.__static__[c];if("function"==typeof u){if(void 0!==r[c])throw new Error("Static member "+t+"."+c+" was not a function in a parent class");e.__static__.__unbound__[c]=l[c]=o[c]=createSubFunc(o[c],u,t+"__"+c)}else{if("function"==typeof o[c])throw new Error("Static member "+t+"."+c+" was a function in a parent class");l[c]=r[c]=u}}}for(var c in e)if("_"!==c[0]||"_"!==c[1]){var u=e[c];if("function"==typeof u){if("toString"!==c&&void 0!==i[c])throw new Error("Member "+t+"."+c+" was not a function in a parent class");l[c]=s[c]=createSubFunc(s[c],u,t+"__"+c)}else{if(void 0!==s[c])throw new Error("Member "+t+"."+c+" was a function in a parent class");l[c]=i[c]=u}}var f=createConstructor(t,e,n,i,s);for(var c in r)f[c]=r[c];for(var c in o)f[c]=o[c].bind(f);return f.__conf__=e,f.__name__=e.__name__,f.prototype=l,f.prototype.__class__=f,f.prototype.constructor=f,f.toString=function(){return"<"+f.__name__+" class>"},setEventNames(f,e,!0),e.__events__&&setEventNames(f,e,!1),f};var setEventNames=function(e,t,n){var r,o={};if(!n&&t.__parent__)if("__all__"===(r=t.__parent__.prototype.__events__.validNames))o="__all__";else for(var i in r)o[i]=r[i];var s=t.__events__;if(n&&(s=[],t.__static__&&t.__static__.__events__&&(s=t.__static__.__events__)),s instanceof Array)for(var a=0;a<s.length;a++)o[s[a]]=e;else s&&(o="__all__");n?e.__events__={validNames:o,listeners:{}}:e.prototype.__events__={validNames:o,listeners:{}}},eventFunctions={on:function(e,t,n){for(var r=t.trim().split(/\s+/),o=0;o<r.length;o++){var i=r[o];if("__all__"!==e.__events__.validNames&&!e.__events__.validNames[i])throw new Error('Invalid event "'+i+'"');void 0===e.__events__.listeners[i]&&(e.__events__.listeners[i]=[]),
e.__events__.listeners[i].push(n)}return e},off:function(e,t,n){for(var r=t.trim().split(/\s+/),o=0;o<r.length;o++){var i=r[o];if("__all__"!==e.__events__.validNames&&!e.__events__.validNames[i])throw new Error('Invalid event "'+i+'"');if(void 0!==e.__events__.listeners[i])if(void 0===n)delete e.__events__.listeners[i];else{var s=e.__events__.listeners[i].indexOf(n);if(s<0)continue;1==e.__events__.listeners[i].length?delete e.__events__.listeners[i]:e.__events__.listeners[i].splice(s,1)}}return e},trigger:function(e,t){if("__all__"!==e.__events__.validNames&&!e.__events__.validNames[t])throw new Error('Invalid event "'+t+'"');if(void 0===e.__events__.listeners[t])return!0;for(var n=[],r=2;r<arguments.length;r++)n.push(arguments[r]);for(var o=e.__events__.listeners[t].slice(0),i=!0,r=0;r<o.length;r++){var s=o[r].apply(e,n);void 0===s||s||(i=!1)}return i}};return oop.Class.__conf__={__name__:"Class",__static__:{__events__:[],on:eventFunctions.on,off:eventFunctions.off,trigger:eventFunctions.trigger,__unbound__:{on:function(e,t){return oop.Class.on.call(this,this,e,t)},off:function(e,t){return oop.Class.off.call(this,this,e,t)},trigger:function(e){var t=new Array(arguments.length+1);t[0]=this;for(var n=0;n<arguments.length;n++)t[n+1]=arguments[n];return oop.Class.trigger.apply(this,t)}}},__events__:[],on:eventFunctions.on,off:eventFunctions.off,trigger:eventFunctions.trigger,toString:function(e){return"<"+e.__class__.__name__+" object>"}},oop.Class.__name__="Class",oop.Class.__events__={validNames:{},listeners:{}},oop.Class.on=oop.Class.__conf__.__static__.on.bind(oop.Class),oop.Class.off=oop.Class.__conf__.__static__.off.bind(oop.Class),oop.Class.trigger=oop.Class.__conf__.__static__.trigger.bind(oop.Class),oop.Class.prototype.__events__={validNames:{},listeners:{}},oop.Class.prototype.on=function(e,t){return eventFunctions.on.call(this,this,e,t)},oop.Class.prototype.off=function(e,t){return eventFunctions.off.call(this,this,e,t)},oop.Class.prototype.trigger=function(e){var t=new Array(arguments.length+1);t[0]=this;for(var n=0;n<arguments.length;n++)t[n+1]=arguments[n];return eventFunctions.trigger.apply(this,t)},oop.Class.prototype.toString=function(){return oop.Class.__conf__.toString.call(this,this)},oop.Class.prototype.__str__=oop.Class.prototype.toString,oop.Exception=function(e){return oop.Exception.__conf__.__init__.call(this,this,e)},oop.Exception.__conf__={__name__:"Exception",__init__:function(e,t){Error.call(this),this.name=this.__class__.__name__,this.message=t||"",this.stack=(new Error).stack}},oop.Exception.__name__=oop.Exception.__conf__.__name__,oop.Exception.__init__=oop.Exception.__conf__.__init__,oop.Exception.prototype=Object.create(Error.prototype),oop.Exception.prototype.toString=function(){return oop.Class.__conf__.toString.call(this,this)},oop.Exception.prototype.__class__=oop.Exception,oop.Exception.prototype.__str__=oop.Exception.prototype.toString,oop})}),define("_lib/form-serialize",[],function(){"use strict";var e=function(e){if(e&&"FORM"===e.nodeName){var t,n,r,o={};for(t=e.elements.length-1;t>=0;t-=1)if(""!==e.elements[t].name)switch(e.elements[t].nodeName){case"INPUT":switch(e.elements[t].type){case"text":case"hidden":case"password":case"button":case"reset":case"submit":o[e.elements[t].name]=e.elements[t].value;break;case"checkbox":e.elements[t].checked&&(o[e.elements[t].name]&&"[object Array]"!==Object.prototype.toString.call(o[e.elements[t].name])&&(o[e.elements[t].name]=[o[e.elements[t].name]]),o[e.elements[t].name]&&"[object Array]"===Object.prototype.toString.call(o[e.elements[t].name])?o[e.elements[t].name].push(e.elements[t].value):o[e.elements[t].name]=e.elements[t].value);break;case"radio":e.elements[t].checked&&(o[e.elements[t].name]=e.elements[t].value)}break;case"TEXTAREA":o[e.elements[t].name]=e.elements[t].value;break;case"SELECT":switch(e.elements[t].type){case"select-one":o[e.elements[t].name]=e.elements[t].value;break;case"select-multiple":for(r=[],n=e.elements[t].options.length-1;n>=0;n-=1)e.elements[t].options[n].selected&&r.push(e.elements[t].options[n].value);o[e.elements[t].name]=r}break;case"BUTTON":switch(e.elements[t].type){case"reset":case"submit":case"button":o[e.elements[t].name]=e.elements[t].value}}return o}};return{serialize:e,toJSON:function(t){return JSON.stringify(e(t))}}}),function(e,t){"function"==typeof define&&define.amd?define("ajax",["_lib/form-serialize","_lib/score/init","_lib/score/ajax"],t):"object"==typeof module&&module.exports?t(require("bluebird"),require("score.init"),require("score.ajax")):t(Promise,e.score)}(this,function(e,t){t.ajax.addGetParameters=function(e,t){if(void 0===t)return e;var n=[];for(var r in t)n.push(encodeURI(r)+"="+encodeURI(t[r]));var o="?";return e.indexOf("?")>=0&&(o="&"),e+o+n.join("&")},t.ajax.get=function(e,n){return n=n||{},n.method="get",e=t.ajax.addGetParameters(e,n.data),t.ajax(e,n)},t.ajax.post=function(e,n){n=n||{},n.method="POST";var r=[];if(void 0!==n.data){for(var o in n.data)r.push(encodeURIComponent(o)+"="+encodeURIComponent(n.data[o]));n.data=r.join("&")}return n.headers=n.headers||{},void 0===n.headers["Content-Type"]&&(n.headers["Content-Type"]="application/x-www-form-urlencoded"),t.ajax(e,n)},t.ajax.getForm=function(n,r){return r=r||{},r.data=e.serialize(n),t.ajax.get(n.action,r)},t.ajax.postForm=function(n,r){return r=r||{},r.data=e.serialize(n),t.ajax.post(n.action,r)}}),define("_lib/score",["_lib/bluebird","_lib/score/init","_lib/score/dom","_lib/score/ajax","_lib/score/oop","ajax"],function(e,t){return window.BPromise=e,t}),function(e){"use strict";var t,n=e.Base64;if("undefined"!=typeof module&&module.exports)try{t=require("buffer").Buffer}catch(e){}var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=function(e){for(var t={},n=0,r=e.length;n<r;n++)t[e.charAt(n)]=n;return t}(r),i=String.fromCharCode,s=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?i(192|t>>>6)+i(128|63&t):i(224|t>>>12&15)+i(128|t>>>6&63)+i(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return i(240|t>>>18&7)+i(128|t>>>12&63)+i(128|t>>>6&63)+i(128|63&t)},a=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,l=function(e){return e.replace(a,s)},c=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[r.charAt(n>>>18),r.charAt(n>>>12&63),t>=2?"=":r.charAt(n>>>6&63),t>=1?"=":r.charAt(63&n)].join("")},u=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,c)},f=t?function(e){return(e.constructor===t.constructor?e:new t(e)).toString("base64")}:function(e){return u(l(e))},d=function(e,t){return t?f(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):f(String(e))},h=function(e){return d(e,!0)},_=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),p=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return i(55296+(n>>>10))+i(56320+(1023&n));case 3:return i((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return i((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},m=function(e){return e.replace(_,p)},v=function(e){var t=e.length,n=t%4,r=(t>0?o[e.charAt(0)]<<18:0)|(t>1?o[e.charAt(1)]<<12:0)|(t>2?o[e.charAt(2)]<<6:0)|(t>3?o[e.charAt(3)]:0),s=[i(r>>>16),i(r>>>8&255),i(255&r)];return s.length-=[0,0,2,1][n],s.join("")},g=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,v)},y=t?function(e){return(e.constructor===t.constructor?e:new t(e,"base64")).toString()}:function(e){return m(g(e))},b=function(e){return y(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))},w=function(){var t=e.Base64;return e.Base64=n,t};if(e.Base64={VERSION:"2.1.9",atob:g,btoa:u,fromBase64:b,toBase64:d,utob:l,encode:d,encodeURI:h,btou:m,decode:b,noConflict:w},"function"==typeof Object.defineProperty){var C=function(e){return{value:e,enumerable:!1,writable:!0,configurable:!0}};e.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",C(function(){return b(this)})),Object.defineProperty(String.prototype,"toBase64",C(function(e){return d(this,e)})),Object.defineProperty(String.prototype,"toBase64URI",C(function(){return d(this,!0)}))}}e.Meteor&&(Base64=e.Base64),"undefined"!=typeof module&&module.exports&&(module.exports.Base64=e.Base64),"function"==typeof define&&define.amd&&define("_lib/base64",[],function(){return e.Base64})}("undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this),define("identity",["_lib/score","_lib/base64"],function(e,t){return new(e.oop.Class({__name__:"IdentityController",__events__:["logged-in","logged-out","session-loaded","user-image-loaded","login-error","load-user-image-error"],__init__:function(e){var t=window.location.host;e.extUserUrl="https://"+t+"/selfservice/ext/v3/user",e.extLoginUrl="https://"+t+"/selfservice/ext/v2/login",e.extLogoutUrl="https://"+t+"/selfservice/ext/logout",e.extUserImageUrl="https://"+t+"/api/spunq-proxy/1.0/my-profile/account/image",e.sessionData=void 0,e.sessionLoaded=!1,e.loggedin=!1,e.userImage=void 0},onSessionLoaded:function(e,t){e.sessionLoaded&&t(e.sessionData),e.on("session-loaded",t)},checkLogin:function(t){t.sessionData=void 0,t.sessionLoaded=!1,e.ajax.get(t.extUserUrl).then(function(e){t.sessionLoaded=!0,t.sessionData=e,t.trigger("session-loaded",t.sessionData),(e.email||e.firstname||e.lastname)&&(t.loggedin=!0,t.loadUserImage())})},login:function(n,r,o,i){var s=n.extLoginUrl,a={rememberMe:"false"};i&&(a.rememberMe="true"),s=e.ajax.addGetParameters(s,a);var l="Basic "+t.toBase64(r+":"+o);e.ajax.post(s,{headers:{Authorization:l}}).then(function(e){n.sessionData=e,n.trigger("logged-in",e),n.loggedin=!0,n.loadUserImage()}).catch(function(e){if(e.response.oeamtcTenantCreationPossible){var t="/mein-oeamtc/daten-transfer?email="+encodeURIComponent(r);return void window.open(t,"_blank")}n.trigger("login-error",{})})},logout:function(t){var n=t.extLogoutUrl;e.ajax.get(n).then(function(n){t.sessionData={},t.userImage=void 0,t.trigger("logged-out",{}),t.loggedin=!1,e.dom("#login-form__login-email")[0]&&(e.dom("#login-form__login-email").DOMNode.value=""),e.dom("#login-form__login-password")[0]&&(e.dom("#login-form__login-password").DOMNode.value=""),e.dom("#login-form__login-email-small")[0]&&(e.dom("#login-form__login-email-small").DOMNode.value=""),e.dom("#login-form__login-password-small")[0]&&(e.dom("#login-form__login-password-small").DOMNode.value="")}).catch(function(n){t.trigger("logged-out",{}),e.dom("#login-form__login-email")[0]&&(e.dom("#login-form__login-email").DOMNode.value=""),e.dom("#login-form__login-password")[0]&&(e.dom("#login-form__login-password").DOMNode.value=""),e.dom("#login-form__login-email-small")[0]&&(e.dom("#login-form__login-email-small").DOMNode.value=""),e.dom("#login-form__login-password-small")[0]&&(e.dom("#login-form__login-password-small").DOMNode.value="")})},loadUserImage:function(t){e.ajax.get(t.extUserImageUrl).then(function(e){t.userImage=e,t.trigger("user-image-loaded",e)}).catch(function(e){})},loggedIn:function(e){return e.loggedin},isMember:function(e){return e.loggedIn()&&e.sessionData.isMember},getUniqueId:function(e){return e._uniqueId?e._uniqueId:(e._uniqueId=window.localStorage.getItem("user.uniqueId"),e._uniqueId?e._uniqueId:(e._uniqueId=Math.floor(Math.random()*Math.pow(36,5)).toString(36)+Math.floor(Math.random()*Math.pow(36,5)).toString(36)+Math.floor(Math.random()*Math.pow(36,5)).toString(36)+Math.floor(Math.random()*Math.pow(36,5)).toString(36),window.localStorage.setItem("user.uniqueId",e._uniqueId),e._uniqueId))}}))}),define("header",["_lib/score","identity"],function(e,t){return new(e.oop.Class({__name__:"HeaderController",__init__:function(t){t.bodyNode=e.dom("body"),t.mainNode=e.dom("#page-content"),t.footerNode=e.dom("#oeamtc-page-footer"),t.footerNode=e.dom("#oeamtc-page-footer"),t.baseFooterNode=e.dom("#oeamtcbase-footerelement"),t.headerNode=e.dom("#oeamtc-page-header"),t.loginNode=t.headerNode.find(".myoeamtc-nav__listitem--login"),t.loginForm=t.headerNode.find(".login-form"),t.searchNode=t.headerNode.find(".search"),t.searchResult=t.headerNode.find(".search-result"),t.resultNode=t.headerNode.find(".result"),t.searchInputNode=t.headerNode.find(".search__input"),t.smallHeaderNode=e.dom("#oeamtc-page-header--small"),t.smallNavNode=e.dom("#style-elements-small-header"),t.smallNavNodeAccount=e.dom("#style-elements-small-header-account"),t.smallMenuNode=t.smallHeaderNode.find(".small-header-menu"),t.smallMenuNodeAccount=t.smallHeaderNode.find(".small-header-userstate"),t.smallSearchNode=t.smallHeaderNode.find(".search-small"),t.scrollable=t.smallHeaderNode.find(".style-elements-small-header"),t.smallSearchInput=t.smallHeaderNode.find("#search-input-small"),t.smallSearch=t.smallNavNode.find(".search__input"),t.smallHeaderUserIconTrigger=e.dom("#small-header-userstate"),t.largeHeaderActive=!1,t.searchInputNode.length?(t.largeHeaderActive=!0,e.dom(window).on("scroll",t.windowScrollHandler)):t.smallHeaderNode.addClass("active"),t.isIOSDevice=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,t.scrollingDisabled=!1,t.bodyNode.ontouchmove=function(e){t.scrollingDisabled&&e.preventDefault()},navigator.userAgent.match(/iPad/i)&&(document.ontouchmove=function(e){t.scrollingDisabled&&e.preventDefault()}),t.scrollable.ontouchmove=function(e){e.stopPropagation()},t.isIOSDevice&&t.smallSearchInput.on("touchstart",function(){t.disableScrolling(),t.absolute(),t.smallSearchInput.DOMNode.onblur=function(){t.blured()}}),t.smallMenuNode.on("click",t.smallMenuClickHandler),t.smallHeaderUserIconTrigger.on("click",t.smallMenuAccountClickHandler),t.smallSearch.on("keyup",function(e){13===e.keyCode&&(window.location="https://"+window.location.host+"/suche?q="+t.smallSearch.DOMNode.value)}),e.dom("#small-search-submit").on("click",function(){window.location="https://"+window.location.host+"/suche?q="+t.smallSearch.DOMNode.value})},isLargeHeaderActive:function(e){return"1"!==window.getComputedStyle(e.smallHeaderNode.DOMNode).opacity},absolute:function(e){navigator.userAgent.match(/iPhone/i)?(e.mainNode.addClass("main-hidden"),e.footerNode.addClass("main-hidden"),e.baseFooterNode.addClass("main-hidden")):(e.smallHeaderNode.DOMNode.style.position="absolute",e.smallHeaderNode.DOMNode.style.top=window.scrollY+"px")},fixed:function(e){navigator.userAgent.match(/iPhone/i)?(e.mainNode.removeClass("main-hidden"),e.footerNode.removeClass("main-hidden"),e.baseFooterNode.removeClass("main-hidden")):(e.smallHeaderNode.DOMNode.style.position="fixed",e.smallHeaderNode.DOMNode.style.top="0")},blured:function(e){e.fixed(),e.smallSearchInput.DOMNode.blur()},smallMenuClickHandler:function(e,t){e.smallMenuNodeAccount.removeClass("active"),e.smallNavNodeAccount.removeClass("active"),e.smallMenuNode.toggleClass("active"),e.smallNavNode.toggleClass("active"),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<767&&e.smallMenuNode.hasClass("active")?e.bodyNode.DOMNode.style.overflow="hidden":e.bodyNode.DOMNode.style.overflow="visible",e.isIOSDevice&&(e.smallMenuNode.hasClass("active")?(e.absolute(),e.disableScrolling()):(e.fixed(),e.enableScrolling()));var n=function(t){var r=e.smallNavNode.DOMNode.contains(t.target),o=e.smallMenuNode.DOMNode.contains(t.target),i=e.smallHeaderUserIconTrigger.DOMNode.contains(t.target);r||o||i||(e.bodyNode.DOMNode.style.overflow="visible",e.smallMenuNode.removeClass("active"),e.smallNavNode.removeClass("active"),e.enableScrolling(),e.fixed(),document.activeElement.blur(),document.removeEventListener("click",n))};document.addEventListener("click",n)},smallMenuAccountClickHandler:function(e,t){t.preventDefault(),e.smallMenuNode.removeClass("active"),e.smallNavNode.removeClass("active"),e.smallMenuNodeAccount.toggleClass("active"),e.smallNavNodeAccount.toggleClass("active"),(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<767&&e.smallMenuNodeAccount.hasClass("active")?e.bodyNode.DOMNode.style.overflow="hidden":e.bodyNode.DOMNode.style.overflow="visible",e.isIOSDevice&&(e.smallMenuNodeAccount.hasClass("active")?(e.absolute(),e.disableScrolling()):(e.fixed(),e.enableScrolling()));var n=function(t){var r=e.smallNavNodeAccount.DOMNode.contains(t.target),o=e.smallMenuNodeAccount.DOMNode.contains(t.target),i=e.smallHeaderUserIconTrigger.DOMNode.contains(t.target)||e.smallHeaderRedirectTrigger.DOMNode.contains(t.target);r||o||i||(e.bodyNode.DOMNode.style.overflow="visible",e.smallMenuNodeAccount.removeClass("active"),e.smallNavNodeAccount.removeClass("active"),e.enableScrolling(),e.fixed(),document.activeElement.blur(),document.removeEventListener("click",n))};document.addEventListener("click",n)},windowScrollHandler:function(e,t){return e.largeHeaderActive&&window.pageYOffset>184?(e.smallHeaderNode.addClass("active"),e.loginNode.removeClass("active"),e.loginForm.removeClass("active"),e.searchNode.removeClass("page-header--active"),e.searchResult.removeClass("active"),e.resultNode.removeClass("active"),e.searchInputNode.DOMNode.value=null,void(e.largeHeaderActive=!1)):!e.largeHeaderActive&&window.pageYOffset<=184?(e.smallHeaderNode.removeClass("active"),e.smallNavNode.removeClass("active"),e.smallMenuNode.removeClass("active"),e.smallSearchNode.removeClass("active"),void(e.largeHeaderActive=!0)):void 0},disableScrolling:function(e){e.scrollingDisabled=!0},enableScrolling:function(e){e.scrollingDisabled=!1}}))}),define("dispatcher",["_lib/score/init","_lib/score/oop"],function(e){"use strict";return new(e.oop.Class({__name__:"Dispatcher",__events__:!0}))}),function(e,t){"object"==typeof exports&&exports&&"string"!=typeof exports.nodeName?t(exports):"function"==typeof define&&define.amd?define("_lib/mustache",["exports"],t):(e.Mustache={},t(e.Mustache))}(this,function(e){function t(e){return"function"==typeof e}function n(e){return p(e)?"array":typeof e}function r(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function i(e,t){return m.call(e,t)}function s(e){return!i(v,e)}function a(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return g[e]})}function l(t,n){function o(e){if("string"==typeof e&&(e=e.split(b,2)),!p(e)||2!==e.length)throw new Error("Invalid tags: "+e);i=new RegExp(r(e[0])+"\\s*"),a=new RegExp("\\s*"+r(e[1])),l=new RegExp("\\s*"+r("}"+e[1]))}if(!t)return[];var i,a,l,d=[],h=[],_=[],m=!1,v=!1;o(n||e.tags);for(var g,N,x,j,k,F,S=new f(t);!S.eos();){if(g=S.pos,x=S.scanUntil(i))for(var O=0,T=x.length;O<T;++O)j=x.charAt(O),s(j)?_.push(h.length):v=!0,h.push(["text",j,g,g+1]),g+=1,"\n"===j&&function(){if(m&&!v)for(;_.length;)delete h[_.pop()];else _=[];m=!1,v=!1}();if(!S.scan(i))break;if(m=!0,N=S.scan(E)||"name",S.scan(y),"="===N?(x=S.scanUntil(w),S.scan(w),S.scanUntil(a)):"{"===N?(x=S.scanUntil(l),S.scan(C),S.scanUntil(a),N="&"):x=S.scanUntil(a),!S.scan(a))throw new Error("Unclosed tag at "+S.pos);if(k=[N,x,g,S.pos],h.push(k),"#"===N||"^"===N)d.push(k);else if("/"===N){if(!(F=d.pop()))throw new Error('Unopened section "'+x+'" at '+g);if(F[1]!==x)throw new Error('Unclosed section "'+F[1]+'" at '+g)}else"name"===N||"{"===N||"&"===N?v=!0:"="===N&&o(x)}if(F=d.pop())throw new Error('Unclosed section "'+F[1]+'" at '+S.pos);return u(c(h))}function c(e){for(var t,n,r=[],o=0,i=e.length;o<i;++o)(t=e[o])&&("text"===t[0]&&n&&"text"===n[0]?(n[1]+=t[1],n[3]=t[3]):(r.push(t),n=t));return r}function u(e){for(var t,n,r=[],o=r,i=[],s=0,a=e.length;s<a;++s)switch(t=e[s],t[0]){case"#":case"^":o.push(t),i.push(t),o=t[4]=[];break;case"/":n=i.pop(),n[5]=t[2],o=i.length>0?i[i.length-1][4]:r;break;default:o.push(t)}return r}function f(e){this.string=e,this.tail=e,this.pos=0}function d(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function h(){this.cache={}}var _=Object.prototype.toString,p=Array.isArray||function(e){return"[object Array]"===_.call(e)},m=RegExp.prototype.test,v=/\S/,g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"},y=/\s*/,b=/\s+/,w=/\s*=/,C=/\s*\}/,E=/#|\^|\/|>|\{|&|=|!/;f.prototype.eos=function(){return""===this.tail},f.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var n=t[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},f.prototype.scanUntil=function(e){var t,n=this.tail.search(e);switch(n){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=t.length,t},d.prototype.push=function(e){return new d(e,this)},d.prototype.lookup=function(e){var n,r=this.cache;if(r.hasOwnProperty(e))n=r[e];else{for(var i,s,a=this,l=!1;a;){if(e.indexOf(".")>0)for(n=a.view,i=e.split("."),s=0;null!=n&&s<i.length;)s===i.length-1&&(l=o(n,i[s])),n=n[i[s++]];else n=a.view[e],l=o(a.view,e);if(l)break;a=a.parent}r[e]=n}return t(n)&&(n=n.call(this.view)),n},h.prototype.clearCache=function(){this.cache={}},h.prototype.parse=function(e,t){var n=this.cache,r=n[e];return null==r&&(r=n[e]=l(e,t)),r},h.prototype.render=function(e,t,n){var r=this.parse(e),o=t instanceof d?t:new d(t);return this.renderTokens(r,o,n,e)},h.prototype.renderTokens=function(e,t,n,r){for(var o,i,s,a="",l=0,c=e.length;l<c;++l)s=void 0,o=e[l],i=o[0],"#"===i?s=this.renderSection(o,t,n,r):"^"===i?s=this.renderInverted(o,t,n,r):">"===i?s=this.renderPartial(o,t,n,r):"&"===i?s=this.unescapedValue(o,t):"name"===i?s=this.escapedValue(o,t):"text"===i&&(s=this.rawValue(o)),void 0!==s&&(a+=s);return a},h.prototype.renderSection=function(e,n,r,o){function i(e){return s.render(e,n,r)}var s=this,a="",l=n.lookup(e[1]);if(l){if(p(l))for(var c=0,u=l.length;c<u;++c)a+=this.renderTokens(e[4],n.push(l[c]),r,o);else if("object"==typeof l||"string"==typeof l||"number"==typeof l)a+=this.renderTokens(e[4],n.push(l),r,o);else if(t(l)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");l=l.call(n.view,o.slice(e[3],e[5]),i),null!=l&&(a+=l)}else a+=this.renderTokens(e[4],n,r,o);return a}},h.prototype.renderInverted=function(e,t,n,r){var o=t.lookup(e[1]);if(!o||p(o)&&0===o.length)return this.renderTokens(e[4],t,n,r)},h.prototype.renderPartial=function(e,n,r){if(r){var o=t(r)?r(e[1]):r[e[1]];return null!=o?this.renderTokens(this.parse(o),n,r,o):void 0}},h.prototype.unescapedValue=function(e,t){var n=t.lookup(e[1]);if(null!=n)return n},h.prototype.escapedValue=function(t,n){var r=n.lookup(t[1]);if(null!=r)return e.escape(r)},h.prototype.rawValue=function(e){return e[1]},e.name="mustache.js",e.version="2.2.1",e.tags=["{{","}}"];var N=new h;e.clearCache=function(){return N.clearCache()},e.parse=function(e,t){return N.parse(e,t)},e.render=function(e,t,r){if("string"!=typeof e)throw new TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return N.render(e,t,r)},e.to_html=function(n,r,o,i){var s=e.render(n,r,o);if(!t(i))return s;i(s)},e.escape=a,e.Scanner=f,e.Context=d,e.Writer=h}),define("outerclick",["_lib/score/init","_lib/score/dom"],function(e){e.dom.proto.onOuterClick=function(t,n){if(!this.length)throw new Error("Empty list");if(this.length>1)throw new Error("Attempting Single-Node-Operation on multiple nodes");var r=this[0],o=function(i){i.target&&i.target!==r&&!r.contains(i.target)&&(n&&e.dom(document).off("click",o),t(i))};window.setTimeout(function(){e.dom(document).on("click",o)},0)},e.dom.proto.onOuterClickOnce=function(e){this.onOuterClick(e,!0)}}),define("../header/default/login-form",["_lib/score","dispatcher","identity","header","_lib/mustache","outerclick"],function(e,t,n,r,o){return new(e.oop.Class({__name__:"LoginFormController",__init__:function(n,r,o){n.node=e.dom("#oeamtc-page-header"),n.loginNode=e.dom("#login-form"),n.smallHeaderNode=e.dom("#oeamtc-page-header--small"),n.smallLoginNode=e.dom("#login-form-small"),n.header=o,n.identity=r,n.defaultLoginFormLoggedOutTemplate="",e.dom("#hf-assets-default-login-form-logged-out").length&&(n.defaultLoginFormLoggedOutTemplate=e.dom("#hf-assets-default-login-form-logged-out").text()),n.defaultUserNavigation="",e.dom("#hf-assets-default-user-navigation").length&&(n.defaultUserNavigation=e.dom("#hf-assets-default-user-navigation").text()),n.smallLoginFormLoggedOutTemplate=e.dom("#hf-assets-small-login-form-logged-out").text(),t.on("exclusive-ui-opened",function(e){var t=n.node.find(".user-login");e&&e.DOMNode!==t.DOMNode&&(n.hideLogin(),n.hideUserNavigation())}),n.loginNode.on("keypress",function(e){var t=n.node.find(".login-button");"13"==e.keyCode&&t.DOMNode.click()}),n.smallLoginNode.on("keypress",function(e){var t=n.smallLoginNode.find(".login-form-trigger");"13"==e.keyCode&&t.DOMNode.click()}),window.setTimeout(function(){n.hideLoggedinState(),n.identity.onSessionLoaded(function(e){(e&&e.email||e.firstname||e.lastname)&&n.showLoggedinState(e)}),n.identity.on("logged-in",function(e){n.showLoggedinState(e)}),n.identity.on("user-image-loaded",function(e){n.showUserImage(e)}),n.identity.on("logged-out",function(e){n.hideLoggedinState(),n.removeUserImage(e)}),n.identity.on("login-error",function(e){n.loginNode.addClass("login-form--error"),n.smallLoginNode.addClass("login-form--error")})},500);var i=n.node.find(".myoeamtc-usernavigation-trigger"),s=n.node.find(".usernavigation");n.node.find(".login-form-trigger").on("click",function(e){e.preventDefault(),n.loginNode.hasClass("active")?n.hideLogin():(n.showLogin(),n.loginNode.onOuterClickOnce(function(e){n.hideLogin()}))}),n.node.find(".login-redirect-trigger").on("click",function(e){e.preventDefault();var t=window.location,n=e.target.href;window.location=n+"?redirect="+encodeURI(t)}),i.on("click",function(e){e.preventDefault(),s.hasClass("active")?n.hideUserNavigation():(n.showUserNavigation(),n.loginNode.onOuterClickOnce(function(e){n.hideUserNavigation()}))})},logoutEventListener:function(e){e.identity.logout()},logoutRedirectEventListener:function(e,t){t.preventDefault();var n=e.smallHeaderNode.find(".usernavigation__logout-redirect"),r=window.location,o=n.DOMNode.href;window.location=o+"?redirect="+encodeURI(r)},initializeHandlers:function(e){var t=e.node.find(".login-button"),n=e.smallLoginNode.find(".login-form-trigger"),r=e.node.find(".usernavigation__logout"),o=e.smallHeaderNode.find(".usernavigation__logout"),i=e.smallHeaderNode.find(".usernavigation__logout-redirect"),s=e.node.find(".usernavigation__logout-redirect"),a=e.smallHeaderNode.find("#redirect-login-button");t.off("click",e.submitLoginForm),n.off("click",e.submitLoginForm),o.off("click",e.logoutEventListener),r.off("click",e.logoutEventListener),i.off("click",e.logoutRedirectEventListener),s.off("click",e.logoutRedirectEventListener),a.off("click",e.redirectLogin),t.on("click",e.submitLoginForm),n.on("click",e.submitLoginForm),o.on("click",e.logoutEventListener),r.on("click",e.logoutEventListener),i.on("click",e.logoutRedirectEventListener),s.on("click",e.logoutRedirectEventListener),a.on("click",e.redirectLogin)},submitLoginForm:function(e){var t=e.node.find(".user-login");e.loginNode.removeClass("login-form--error"),e.smallLoginNode.removeClass("login-form--error");var n="",r=t;e.header.isLargeHeaderActive()||(n="-small",r=e.smallLoginNode);var o=r.find("#login-form__login-email"+n).DOMNode.value,i=r.find("#login-form__login-password"+n).DOMNode.value;if(!1===/^[0-9]+$/.test(o)&&!1===/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i.test(o))return e.loginNode.addClass("login-form--error"),void e.smallLoginNode.addClass("login-form--error");e.identity.login(o,i,!0)},redirectLogin:function(e,t){if(!e.identity.loggedIn()){t.preventDefault();var n=window.location,r=e.smallHeaderNode.find("#redirect-login-button").DOMNode.href;window.location=r+"?redirect="+encodeURI(n)}},showLogin:function(e){var n=e.node.find(".user-login");o.parse(e.defaultLoginFormLoggedOutTemplate);var r=o.render(e.defaultLoginFormLoggedOutTemplate,{});e.loginNode.DOMNode.innerHTML=r,e.initializeHandlers(),t.trigger("exclusive-ui-opened",n),e.node.find(".myoeamtc-nav__listitem--login").toggleClass("active"),e.loginNode.toggleClass("active")},hideLogin:function(e){e.node.find(".myoeamtc-nav__listitem--login").removeClass("active"),e.loginNode.length&&(e.loginNode.removeClass("active"),e.loginNode.DOMNode.innerHTML="")},showLoggedinState:function(t,n){var r=t.node.find(".myoeamtc-usernavigation-trigger"),i=t.node.find(".login-form-trigger"),s=t.node.find(".login-redirect-trigger"),a=t.node.find(".myoeamtc-nav__listitem--loggedin"),l=t.smallHeaderNode.find(".myoeamtc-nav"),c=e.dom("#small-header-userstate");r.length&&(r.DOMNode.innerHTML=o.render(t.defaultUserNavigation,n)),t.initializeHandlers(),t.hideLogin(),i.addClass("hide"),s.addClass("hide"),a.addClass("logged-in"),l.addClass("logged-in"),c.find(".small-header-userstate-flyout__text-username").text(n.firstname+" "+n.lastname),c.addClass("small-header-userstate--logged-in")},hideLoggedinState:function(t){var n=t.node.find(".login-form-trigger"),r=t.node.find(".login-redirect-trigger"),i=t.node.find(".myoeamtc-nav__listitem--loggedin"),s=t.smallHeaderNode.find(".myoeamtc-nav"),a=e.dom("#small-header-userstate");t.smallLoginNode.DOMNode.innerHTML=o.render(t.smallLoginFormLoggedOutTemplate,{}),t.initializeHandlers(),t.hideLogin(),t.hideUserNavigation(),n.removeClass("hide"),r.removeClass("hide"),i.removeClass("logged-in"),s.removeClass("logged-in"),a.find(".small-header-userstate-flyout__text-username").text(""),a.removeClass("small-header-userstate--logged-in")},showUserImage:function(t,n){var r=e.dom("#small-header-userstate");if(0===r.find(".small-header-userstate-flyout__text-userimage img").length){var o=e.dom.create("img");o.DOMNode.src="data:image/png;base64, "+n.profileImage,r.find(".small-header-userstate-flyout__text-userimage").addClass("small-header-userstate-flyout__text-userimage--hide-default-image"),r.find(".small-header-userstate-flyout__text-userimage").append(o.clone()),r.find("i.small-header-userstate__icon").addClass("small-header-userstate__icon--hide-default-image"),r.prepend(o)}},removeUserImage:function(t){var n=e.dom("#small-header-userstate");n.find(".small-header-userstate-flyout__text-userimage img").detach(),n.find(".small-header-userstate-flyout__text-userimage").removeClass("small-header-userstate-flyout__text-userimage--hide-default-image"),n.find("img").detach(),n.find("i.small-header-userstate__icon").removeClass("small-header-userstate__icon--hide-default-image")},showUserNavigation:function(e){var n=e.node.find(".myoeamtc-usernavigation-trigger"),r=e.node.find(".usernavigation");t.trigger("exclusive-ui-opened",e.userLoginNode),n.addClass("active"),r.addClass("active")},hideUserNavigation:function(e){var t=e.node.find(".myoeamtc-usernavigation-trigger"),n=e.node.find(".usernavigation");t.removeClass("active"),n.removeClass("active")},showUserNavigationSmall:function(e){var n=e.smallHeaderNode.find("#usernavigation-small");t.trigger("exclusive-ui-opened",e.navNodeSmall),n.addClass("active")},hideUserNavigationSmall:function(e){e.smallHeaderNode.find("#usernavigation-small").removeClass("active"),e.smallLoginNode.DOMNode.innerHTML=""}}))(n,r)}),define("../header/default/main-nav",["_lib/score"],function(e){return new(e.oop.Class({__name__:"MainNavAnimationController",__init__:function(e,t){e.node=t,e.mainNavNode=t.find(".main-nav"),
e.navItems=e.mainNavNode.find(".main-nav__listitem"),e.flyouts=e.mainNavNode.find(".flyout"),"ontouchstart"in document.documentElement?(e.flyouts.addClass("flyout--hard"),e.navItems.addClass("touch-device"),e.navItems.forEach(function(e){e.on("click",function(t){e.hasClass("menu-item-active")||t.preventDefault()})})):(e.navItems.forEach(function(t){t.on("mouseenter",function(t){setTimeout(function(){e.flyouts.addClass("flyout--hard")},150)})}),e.mainNavNode.on("mouseleave",function(t){e.flyouts.removeClass("flyout--hard")}))}}))(e.dom("#oeamtc-page-header"))}),define("menu",["_lib/score"],function(e){return e.oop.Class({__name__:"Menu",__events__:["open","close"],__init__:function(e,t){e.ul=t,e.hoverItem=null,e.hoverTimeout=null;for(var n=function(){null===e.hoverItem?e.close():e.open(e.hoverItem),e.hoverTimeout=null},r=function(){null!==e.hoverTimeout&&(window.clearTimeout(e.hoverTimeout),e.hoverTimeout=null),e.hoverTimeout=window.setTimeout(n,100)},o=function(t){e.hoverItem=null,r()},i=function(t){e.hoverItem=this,e.activeItem(),r()},s=0;s<t.children.length;s++){var a=t.children.item(s);"ontouchstart"in document.documentElement?a.addEventListener("click",i):(a.addEventListener("mouseleave",o),a.addEventListener("mouseenter",i),a.addEventListener("click",i))}"ontouchstart"in document.documentElement&&document.addEventListener("touchmove",function(t){e.close()})},close:function(e){var t=e.activeItem();return!t||!!e.trigger("close",t)&&(t.className=t.className.replace(/\bmenu-item-active\b/,""),t.querySelector(".flyout").setAttribute("aria-hidden",!0),e.hoverItem=null,!0)},activeItem:function(e){return e.ul.querySelector("div.menu-item-active")},open:function(e,t){if("number"==typeof t)t=e.ul.children.item(t);else if("object"!=typeof t)throw"Argument must be numeric or a DOM node";t!=e.activeItem()&&e.close()&&(t.className=t.className+" menu-item-active",t.querySelector(".flyout").setAttribute("aria-hidden",!1),e.hoverItem=t,e.trigger("open",t))}})}),define("../header/default/search",["_lib/score","dispatcher","_lib/mustache","outerclick"],function(e,t,n){return new(e.oop.Class({__name__:"SearchController",__init__:function(r){r.node=e.dom("#oeamtc-page-header"),r.searchNode=r.node.find(".search"),r.searchInputNode=r.node.find(".search__input"),r.closeNode=r.node.find(".close-search"),r.resultNode=r.node.find(".result"),r.template=e.dom("#hf-assets-search-result").DOMNode.innerHTML,r.resultPage="https://"+window.location.host+"/suche",n.parse(r.template),r.searchTimeout=null,r.searchInputNode.on("keyup",function(e){if(38!==e.keyCode&&40!==e.keyCode){var t=r.searchInputNode.DOMNode.value;r.searchTimeout&&window.clearTimeout(r.searchTimeout),t.length>2&&(r.searchTimeout=window.setTimeout(function(){r.submitSearch(t)},500))}}),t.on("exclusive-ui-opened",function(e){e!==r.searchNode.DOMNode&&r.hideSearch()}),r.closeNode.on("click",function(){r.searchInputNode.DOMNode.value=null,r.hideSearch()}),r.navigateSearch()},submitSearch:function(t,r){var o=(new Date).getTime();t.searchNode.addClass("loading"),e.ajax.get("https://"+window.location.host+"/spunq-assets/ajax/search/livesearch",{data:{q:r}}).then(function(e){var r=(new Date).getTime()-o;e.requestTime=Math.round(r/1e3*100)/100,e.resultPage=t.resultPage+"?q="+encodeURIComponent(e.query);var i=n.render(t.template,e);t.resultNode.DOMNode.innerHTML=i,t.showSearch(),t.searchNode.removeClass("loading"),t.searchInputNode.DOMNode.focus()}).catch(function(e){console.error(e),t.searchNode.removeClass("loading")})},showSearch:function(e){t.trigger("exclusive-ui-opened",e.searchNode.DOMNode),e.resultNode.addClass("active"),e.searchNode.addClass("page-header--active"),e.searchNode.removeClass("loading")},hideSearch:function(e){e.resultNode.removeClass("active"),e.searchNode.removeClass("page-header--active"),e.searchNode.removeClass("loading")},navigateSearch:function(t){t.searchNode.on("keydown",function(n){switch(n.keyCode){case 38:n.preventDefault(),document.activeElement.previousElementSibling?document.activeElement.previousElementSibling.focus():t.searchInputNode.DOMNode.focus();break;case 40:n.preventDefault(),document.activeElement===t.searchInputNode.DOMNode?t.resultNode.find(".result__body").find(".teaser").length>0&&e.dom(t.resultNode.find(".result__body").find(".teaser")[0]).DOMNode.focus():document.activeElement.nextElementSibling&&document.activeElement.nextElementSibling.focus();break;case 37:case 39:t.searchInputNode.DOMNode.focus();break;case 13:if(document.activeElement){if(e.dom(document.activeElement).find(".teaser__link").length>0){var r=e.dom(document.activeElement).find(".teaser__link").attr("href");window.location.href=r}break}}})}}))}),define("../header/small/main-nav-small",["_lib/score"],function(e){return new(e.oop.Class({__name__:"MainNavAnimationControllerSmall",__init__:function(t,n){t.node=n,t.mainNavNode=n.find(".inline-main-nav__list"),t.navItems=t.mainNavNode.find(".main-nav__listitem"),t.flyouts=t.mainNavNode.find(".flyout"),t.smallNavNode=t.node.find(".style-elements-small-header"),t.smallMenuNode=t.node.find(".small-header-menu"),t.smallHeaderUserIcon=e.dom("#small-header-userstate"),"ontouchstart"in document.documentElement?(t.flyouts.addClass("flyout--hard"),t.navItems.addClass("touch-device"),t.navItems.forEach(function(e){e.on("click",function(n){e.hasClass("menu-item-active")||n.preventDefault(),t.smallNavNode.removeClass("active"),t.smallMenuNode.removeClass("active"),t.smallHeaderUserIcon.removeClass("active")})})):(t.navItems.forEach(function(e){e.on("mouseenter",function(e){t.smallNavNode.removeClass("active"),t.smallMenuNode.removeClass("active"),t.smallHeaderUserIcon.removeClass("active"),setTimeout(function(){t.flyouts.addClass("flyout--hard")},150)})}),t.mainNavNode.on("mouseleave",function(e){t.flyouts.removeClass("flyout--hard")}))}}))(e.dom("#oeamtc-page-header--small"))}),define("cms",["_lib/score","identity"],function(e,t){var n=e.oop.Class({__name__:"CmsController",__events__:["header-ready","footer-ready"],__init__:function(e){}}),r=new n,o={headerReady:function(){r.trigger("header-ready")},footerReady:function(){r.trigger("footer-ready")},registerHeaderReadyHandler:function(e){r.on("header-ready",e)},registerFooterReadyHandler:function(e){r.on("footer-ready",e)},displayFooter:function(){e.dom("#oeamtc-page-footer").removeClass("oeamtc-page-footer--inactive")},identity:{registerLoggedInCallback:function(e){t.on("logged-in",e)},registerLoggedOutCallback:function(e){t.on("logged-out",e)},registerSessionLoadedCallback:function(e){t.onSessionLoaded(e)},revalidateSession:function(){t.checkLogin()}}};return r.on("header-ready",function(){require(["header"]),require(["../header/default/login-form"]),t.checkLogin(),e.dom("#oeamtc-page-header")[0]&&(require(["../header/default/main-nav"]),require(["menu","_lib/score"],function(e,t){var n=new e(t.dom("#oeamtc-page-header").find(".main-nav__list").DOMNode);n.on("open",function(e){t.dom(e).addClass("visible")}),n.on("close",function(e){t.dom(e).removeClass("visible")})}),require(["../header/default/search"])),e.dom("#oeamtc-page-header--small")[0]&&(require(["../header/small/main-nav-small"]),require(["menu","_lib/score"],function(e,t){var n=new e(t.dom("#oeamtc-page-header--small").find(".inline-main-nav__list").DOMNode);n.on("open",function(e){t.dom(e).addClass("visible")}),n.on("close",function(e){t.dom(e).removeClass("visible")})}))}),r.on("footer-ready",function(){}),o}),define("main",["cms","identity"],function(e,t){return e}),require("main")});