diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bdb0cab --- /dev/null +++ b/.gitattributes @@ -0,0 +1,17 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/CHANGELOG.md b/CHANGELOG.md index 3190af9..62fdf4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# v0.2.1 +* Fix messages if browser has no sessionStorage + # v0.2.0 * Add history polyfill * Fix files for matching jscs rules diff --git a/README.md b/README.md index 4a4eea4..81c5a67 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,12 @@ Easy interaction with R7 box for external webapps Include the `dist/r7extlib.js` file in your webapp to use it. No build process is required. +## Versions + +STABLE : 0.2.8 + +DEV(ES6 compatible) : es6-webpack branch + ## Build In order to build this application on your own: diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..c419263 --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-cayman \ No newline at end of file diff --git a/am.pak b/am.pak new file mode 100644 index 0000000..2977524 Binary files /dev/null and b/am.pak differ diff --git a/bower.json b/bower.json index 5831ca3..f75ad49 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "r7extlib", - "version": "0.1.8", + "version": "0.2.8", "homepage": "https://github.com/canalplus/r7extlib", "description": "Easy interaction with Canal+ R7 box for external webapps", "main": "dist/r7extlib.js", diff --git a/dist/r7extlib.js b/dist/r7extlib.js index 4abcc49..4466e72 100644 --- a/dist/r7extlib.js +++ b/dist/r7extlib.js @@ -1,2 +1,2 @@ -!function n(t,e,r){function o(u,a){if(!e[u]){if(!t[u]){var c="function"==typeof require&&require;if(!a&&c)return c(u,!0);if(i)return i(u,!0);throw new Error("Cannot find module '"+u+"'")}var f=e[u]={exports:{}};t[u][0].call(f.exports,function(n){var e=t[u][1][n];return o(e?e:n)},f,f.exports,n,t,e,r)}return e[u].exports}for(var i="function"==typeof require&&require,u=0;u-1?0:-1:n?0:-1}function i(n){var t=this.cache,e=typeof n;if("boolean"==e||null==n)t[n]=!0;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,o=t[e]||(t[e]={});"object"==e?(o[r]||(o[r]=[])).push(n):o[r]=!0}}function u(n){return n.charCodeAt(0)}function a(n,t){for(var e=n.criteria,r=t.criteria,o=-1,i=e.length;++oa||"undefined"==typeof u)return 1;if(a>u||"undefined"==typeof a)return-1}}return n.index-t.index}function c(n){var t=-1,e=n.length,r=n[0],o=n[e/2|0],u=n[e-1];if(r&&"object"==typeof r&&o&&"object"==typeof o&&u&&"object"==typeof u)return!1;var a=l();a["false"]=a["null"]=a["true"]=a.undefined=!1;var c=l();for(c.array=n,c.cache=a,c.push=i;++to?0:o);++r=_&&i===r,f=[];if(a){var s=c(t);s?(i=o,t=s):a=!1}for(;++e-1:void 0});return o.pop(),i.pop(),g&&(p(o),p(i)),u}function tn(n,t,e,r,o){(Ze(t)?Xn:cr)(t,function(t,i){var u,a,c=t,f=n[i];if(t&&((a=Ze(t))||fr(t))){for(var s=r.length;s--;)if(u=r[s]==t){f=o[s];break}if(!u){var l;e&&(c=e(f,t),(l="undefined"!=typeof c)&&(f=c)),l||(f=a?Ze(f)?f:[]:fr(f)?f:{}),r.push(t),o.push(f),l||tn(f,t,e,r,o)}}else e&&(c=e(f,t),"undefined"==typeof c&&(c=t)),"undefined"!=typeof c&&(f=c);n[i]=f})}function rn(n,t){return n+Ne(We()*(t-n+1))}function on(n,t,e){var i=-1,u=fn(),a=n?n.length:0,f=[],l=!t&&a>=_&&u===r,h=e||l?s():f;if(l){var v=c(h);u=o,h=v}for(;++i3&&"function"==typeof t[e-2])var r=k(t[--e-1],t[e--],2);else e>2&&"function"==typeof t[e-1]&&(r=t[--e]);for(var o=h(arguments,1,e),i=-1,u=s(),a=s();++ie?Qe(0,i+e):e)||0,Ze(n)?u=o(n,t,e)>-1:"number"==typeof i?u=(Kn(n)?n.indexOf(t,e):o(n,t,e))>-1:cr(n,function(n){return++r>=e?!(u=n===t):void 0}),u}function Vn(n,e,r){var o=!0;e=t.createCallback(e,r,3);var i=-1,u=n?n.length:0;if("number"==typeof u)for(;++ii&&(i=f)}else e=null==e&&Kn(n)?u:t.createCallback(e,r,3),Xn(n,function(n,t,r){var u=e(n,t,r);u>o&&(o=u,i=n)});return i}function et(n,e,r){var o=1/0,i=o;if("function"!=typeof e&&r&&r[e]===n&&(e=null),null==e&&Ze(n))for(var a=-1,c=n.length;++af&&(i=f)}else e=null==e&&Kn(n)?u:t.createCallback(e,r,3),Xn(n,function(n,t,r){var u=e(n,t,r);o>u&&(o=u,i=n)});return i}function rt(n,e,r,o){if(!n)return r;var i=arguments.length<3;e=t.createCallback(e,o,4);var u=-1,a=n.length;if("number"==typeof a)for(i&&(r=n[++u]);++ue?Qe(0,o+e):e||0}else if(e){var i=St(n,t);return n[i]===t?i:-1}return r(n,t,e)}function wt(n,e,r){var o=0,i=n?n.length:0;if("number"!=typeof e&&null!=e){var u=i;for(e=t.createCallback(e,r,3);u--&&e(n[u],u,n);)o++}else o=null==e||r?1:e||o;return h(n,0,ze(Qe(0,i-o),i))}function bt(){for(var n=[],t=-1,e=arguments.length,i=s(),u=fn(),a=u===r,f=s();++t=_&&c(t?n[t]:f)))}var h=n[0],v=-1,y=h?h.length:0,m=[];n:for(;++ve?Qe(0,r+e):ze(e,r-1))+1);r--;)if(n[r]===t)return r;return-1}function jt(n){for(var t=arguments,e=0,r=t.length,o=n?n.length:0;++ei;){var a=i+u>>>1;r(n[a])1?arguments:arguments[0],t=-1,e=n?tt(dr(n,"length")):0,r=he(0>e?0:e);++t2?an(n,17,h(arguments,2),null,t):an(n,1,null,null,t)}function Kt(n){for(var t=arguments.length>1?Y(arguments,!0,!1,1):_n(n),e=-1,r=t.length;++e2?an(t,19,h(arguments,2),null,n):an(t,3,null,null,n)}function Pt(){for(var n=arguments,t=n.length;t--;)if(!On(n[t]))throw new je;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}}function qt(n,t){return t="number"==typeof t?t:+t||n.length,an(n,4,null,null,null,t)}function Ft(n,t,e){var r,o,i,u,a,c,f,s=0,l=!1,p=!0;if(!On(n))throw new je;if(t=Qe(0,t)||0,e===!0){var d=!0;p=!1}else Nn(e)&&(d=e.leading,l="maxWait"in e&&(Qe(t,e.maxWait)||0),p="trailing"in e?e.trailing:p);var h=function(){var e=t-(vr()-u);if(0>=e){o&&Oe(o);var l=f;o=c=f=y,l&&(s=vr(),i=n.apply(a,r),c||o||(r=a=null))}else c=Ke(h,e)},v=function(){c&&Oe(c),o=c=f=y,(p||l!==t)&&(s=vr(),i=n.apply(a,r),c||o||(r=a=null))};return function(){if(r=arguments,u=vr(),a=this,f=p&&(c||!d),l===!1)var e=d&&!c;else{o||d||(s=u);var y=l-(u-s),m=0>=y;m?(o&&(o=Oe(o)),s=u,i=n.apply(a,r)):o||(o=Ke(v,y))}return m&&c?c=Oe(c):c||t===l||(c=Ke(h,t)),e&&(m=!0,i=n.apply(a,r)),!m||c||o||(r=a=null),i}}function Mt(n){if(!On(n))throw new je;var t=h(arguments,1);return Ke(function(){n.apply(y,t)},1)}function $t(n,t){if(!On(n))throw new je;var e=h(arguments,2);return Ke(function(){n.apply(y,e)},t)}function Ht(n,t){if(!On(n))throw new je;var e=function(){var r=e.cache,o=t?t.apply(this,arguments):b+arguments[0];return Be.call(r,o)?r[o]:r[o]=n.apply(this,arguments)};return e.cache={},e}function Ut(n){var t,e;if(!On(n))throw new je;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}}function Qt(n){return an(n,16,h(arguments,1))}function zt(n){return an(n,32,null,h(arguments,1))}function Vt(n,t,e){var r=!0,o=!0;if(!On(n))throw new je;return e===!1?r=!1:Nn(e)&&(r="leading"in e?e.leading:r,o="trailing"in e?e.trailing:o),V.leading=r,V.maxWait=t,V.trailing=o,Ft(n,t,V)}function Wt(n,t){return an(t,16,[n])}function Jt(n){return function(){return n}}function Gt(n,t,e){var r=typeof n;if(null==n||"function"==r)return k(n,t,e);if("object"!=r)return ee(n);var o=nr(n),i=o[0],u=n[i];return 1!=o.length||u!==u||Nn(u)?function(t){for(var e=o.length,r=!1;e--&&(r=nn(t[o[e]],n[o[e]],null,!0)););return r}:function(n){var t=n[i];return u===t&&(0!==u||1/u==1/t)}}function Xt(n){return null==n?"":ke(n).replace(or,cn)}function Zt(n){return n}function Yt(n,r,o){var i=!0,u=r&&_n(r);r&&(o||u.length)||(null==o&&(o=r),a=e,r=n,n=t,u=_n(r)),o===!1?i=!1:Nn(o)&&"chain"in o&&(i=o.chain);var a=n,c=On(a);Xn(u,function(t){var e=n[t]=r[t];c&&(a.prototype[t]=function(){var t=this.__chain__,r=this.__wrapped__,o=[r];Le.apply(o,arguments);var u=e.apply(n,o);if(i||t){if(r===u&&Nn(u))return this;u=new a(u),u.__chain__=t}return u})})}function ne(){return n._=Re,this}function te(){}function ee(n){return function(t){return t[n]}}function re(n,t,e){var r=null==n,o=null==t;if(null==e&&("boolean"==typeof n&&o?(e=n,n=1):o||"boolean"!=typeof t||(e=t,o=!0)),r&&o&&(t=1),n=+n||0,o?(t=n,n=0):t=+t||0,e||n%1||t%1){var i=We();return ze(n+i*(t-n+parseFloat("1e-"+((i+"").length-1))),t)}return rn(n,t)}function oe(n,t){if(n){var e=n[t];return On(e)?n[t]():e}}function ie(n,e,r){var o=t.templateSettings;n=ke(n||""),r=ur({},r,o);var i,u=ur({},r.imports,o.imports),a=nr(u),c=Un(u),s=0,l=r.interpolate||I,p="__p += '",d=_e((r.escape||I).source+"|"+l.source+"|"+(l===O?S:I).source+"|"+(r.evaluate||I).source+"|$","g");n.replace(d,function(t,e,r,o,u,a){return r||(r=o),p+=n.slice(s,a).replace(B,f),e&&(p+="' +\n__e("+e+") +\n'"),u&&(i=!0,p+="';\n"+u+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),s=a+t.length,t}),p+="';\n";var h=r.variable,v=h;v||(h="obj",p="with ("+h+") {\n"+p+"\n}\n"),p=(i?p.replace(x,""):p).replace(E,"$1").replace(R,"$1;"),p="function("+h+") {\n"+(v?"":h+" || ("+h+" = {});\n")+"var __t, __p = '', __e = _.escape"+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var m="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+K++ +"]")+"\n*/";try{var g=me(a,"return "+p+m).apply(y,c)}catch(w){throw w.source=p,w}return e?g(e):(g.source=p,g)}function ue(n,t,e){n=(n=+n)>-1?n:0;var r=-1,o=he(n);for(t=k(t,e,1);++r/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:O,variable:"",imports:{_:t}},Fe||(g=function(){function t(){}return function(e){if(Nn(e)){t.prototype=e;var r=new t;t.prototype=null}return r||n.Object()}}());var Xe=qe?function(n,t){W.value=t,qe(n,"__bindData__",W),W.value=null}:te,Ze=Me||function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Se.call(n)==P||!1},Ye=function(n){var t,e=n,r=[];if(!e)return r;if(!J[typeof n])return r;for(t in e)Be.call(e,t)&&r.push(t);return r},nr=Ue?function(n){return Nn(n)?Ue(n):[]}:Ye,tr={"&":"&","<":"<",">":">",'"':""","'":"'"},er=jn(tr),rr=_e("("+nr(er).join("|")+")","g"),or=_e("["+nr(tr).join("")+"]","g"),ir=function(n,t,e){var r,o=n,i=o;if(!o)return i;var u=arguments,a=0,c="number"==typeof e?2:u.length;if(c>3&&"function"==typeof u[c-2])var f=k(u[--c-1],u[c--],2);else c>2&&"function"==typeof u[c-1]&&(f=u[--c]);for(;++a/g,N=RegExp("^["+j+"]*0+(?=.$)"),I=/($^)/,A=/\bthis\b/,B=/['\n\r\t\u2028\u2029\\]/g,L=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],K=0,D="[object Arguments]",P="[object Array]",q="[object Boolean]",F="[object Date]",M="[object Function]",$="[object Number]",H="[object Object]",U="[object RegExp]",Q="[object String]",z={};z[M]=!1,z[D]=z[P]=z[q]=z[F]=z[$]=z[H]=z[U]=z[Q]=!0;var V={leading:!1,maxWait:0,trailing:!1},W={configurable:!1,enumerable:!1,value:null,writable:!1},J={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},G={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},X=J[typeof window]&&window||this,Z=J[typeof e]&&e&&!e.nodeType&&e,Y=J[typeof t]&&t&&!t.nodeType&&t,nn=Y&&Y.exports===Z&&Z,tn=J[typeof n]&&n;!tn||tn.global!==tn&&tn.window!==tn||(X=tn);var en=v();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(X._=en,define(function(){return en})):Z&&Y?nn?(Y.exports=en)._=en:Z._=en:X._=en}).call(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(n,t,e){function r(){}var o=t.exports={};o.nextTick=function(){var n="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(n)return function(n){return window.setImmediate(n)};if(t){var e=[];return window.addEventListener("message",function(n){var t=n.source;if((t===window||null===t)&&"process-tick"===n.data&&(n.stopPropagation(),e.length>0)){var r=e.shift();r()}},!0),function(n){e.push(n),window.postMessage("process-tick","*")}}return function(n){setTimeout(n,0)}}(),o.title="browser",o.browser=!0,o.env={},o.argv=[],o.on=r,o.addListener=r,o.once=r,o.off=r,o.removeListener=r,o.removeAllListeners=r,o.emit=r,o.binding=function(n){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(n){throw new Error("process.chdir is not supported")}},{}],3:[function(n,t,e){(function(n){!function(n){"use strict";if("function"==typeof bootstrap)bootstrap("promise",n);else if("object"==typeof e&&"object"==typeof t)t.exports=n();else if("function"==typeof define&&define.amd)define(n);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=n}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var r="undefined"!=typeof window?window:self,o=r.Q;r.Q=n(),r.Q.noConflict=function(){return r.Q=o,this}}}(function(){"use strict";function t(n){return function(){return J.apply(n,arguments)}}function e(n){return n===Object(n)}function r(n){return"[object StopIteration]"===rn(n)||n instanceof Q}function o(n,t){if($&&t.stack&&"object"==typeof n&&null!==n&&n.stack&&-1===n.stack.indexOf(on)){for(var e=[],r=t;r;r=r.source)r.stack&&e.unshift(r.stack);e.unshift(n.stack);var o=e.join("\n"+on+"\n");n.stack=i(o)}}function i(n){for(var t=n.split("\n"),e=[],r=0;r=z&&sn>=r}function f(){if($)try{throw new Error}catch(n){var t=n.stack.split("\n"),e=t[0].indexOf("@")>0?t[1]:t[2],r=a(e);if(!r)return;return U=r[0],r[1]}}function s(n,t,e){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+e+" instead.",new Error("").stack),n.apply(n,arguments)}}function l(n){return n instanceof v?n:w(n)?T(n):S(n)}function p(){function n(n){t=n,i.source=n,X(e,function(t,e){l.nextTick(function(){n.promiseDispatch.apply(n,e)})},void 0),e=void 0,r=void 0}var t,e=[],r=[],o=nn(p.prototype),i=nn(v.prototype);if(i.promiseDispatch=function(n,o,i){ -var u=G(arguments);e?(e.push(u),"when"===o&&i[1]&&r.push(i[1])):l.nextTick(function(){t.promiseDispatch.apply(t,u)})},i.valueOf=function(){if(e)return i;var n=m(t);return g(n)&&(t=n),n},i.inspect=function(){return t?t.inspect():{state:"pending"}},l.longStackSupport&&$)try{throw new Error}catch(u){i.stack=u.stack.substring(u.stack.indexOf("\n")+1)}return o.promise=i,o.resolve=function(e){t||n(l(e))},o.fulfill=function(e){t||n(S(e))},o.reject=function(e){t||n(R(e))},o.notify=function(n){t||X(r,function(t,e){l.nextTick(function(){e(n)})},void 0)},o}function d(n){if("function"!=typeof n)throw new TypeError("resolver must be a function.");var t=p();try{n(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}return t.promise}function h(n){return d(function(t,e){for(var r=0,o=n.length;o>r;r++)l(n[r]).then(t,e)})}function v(n,t,e){void 0===t&&(t=function(n){return R(new Error("Promise does not support operation: "+n))}),void 0===e&&(e=function(){return{state:"unknown"}});var r=nn(v.prototype);if(r.promiseDispatch=function(e,o,i){var u;try{u=n[o]?n[o].apply(r,i):t.call(r,o,i)}catch(a){u=R(a)}e&&e(u)},r.inspect=e,e){var o=e();"rejected"===o.state&&(r.exception=o.reason),r.valueOf=function(){var n=e();return"pending"===n.state||"rejected"===n.state?r:n.value}}return r}function y(n,t,e,r){return l(n).then(t,e,r)}function m(n){if(g(n)){var t=n.inspect();if("fulfilled"===t.state)return t.value}return n}function g(n){return n instanceof v}function w(n){return e(n)&&"function"==typeof n.then}function b(n){return g(n)&&"pending"===n.inspect().state}function _(n){return!g(n)||"fulfilled"===n.inspect().state}function k(n){return g(n)&&"rejected"===n.inspect().state}function j(){un.length=0,an.length=0,fn||(fn=!0)}function x(t,e){fn&&("object"==typeof n&&"function"==typeof n.emit&&l.nextTick.runAfter(function(){-1!==Z(an,t)&&(n.emit("unhandledRejection",e,t),cn.push(t))}),an.push(t),e&&"undefined"!=typeof e.stack?un.push(e.stack):un.push("(no stack) "+e))}function E(t){if(fn){var e=Z(an,t);-1!==e&&("object"==typeof n&&"function"==typeof n.emit&&l.nextTick.runAfter(function(){var r=Z(cn,t);-1!==r&&(n.emit("rejectionHandled",un[e],t),cn.splice(r,1))}),an.splice(e,1),un.splice(e,1))}}function R(n){var t=v({when:function(t){return t&&E(this),t?t(n):this}},function(){return this},function(){return{state:"rejected",reason:n}});return x(t,n),t}function S(n){return v({when:function(){return n},get:function(t){return n[t]},set:function(t,e){n[t]=e},"delete":function(t){delete n[t]},post:function(t,e){return null===t||void 0===t?n.apply(void 0,e):n[t].apply(n,e)},apply:function(t,e){return n.apply(t,e)},keys:function(){return en(n)}},void 0,function(){return{state:"fulfilled",value:n}})}function T(n){var t=p();return l.nextTick(function(){try{n.then(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}}),t.promise}function C(n){return v({isDef:function(){}},function(t,e){return L(n,t,e)},function(){return l(n).inspect()})}function O(n,t,e){return l(n).spread(t,e)}function N(n){return function(){function t(n,t){var u;if("undefined"==typeof StopIteration){try{u=e[n](t)}catch(a){return R(a)}return u.done?l(u.value):y(u.value,o,i)}try{u=e[n](t)}catch(a){return r(a)?l(a.value):R(a)}return y(u,o,i)}var e=n.apply(this,arguments),o=t.bind(t,"next"),i=t.bind(t,"throw");return o()}}function I(n){l.done(l.async(n)())}function A(n){throw new Q(n)}function B(n){return function(){return O([this,K(arguments)],function(t,e){return n.apply(t,e)})}}function L(n,t,e){return l(n).dispatch(t,e)}function K(n){return y(n,function(n){var t=0,e=p();return X(n,function(r,o,i){var u;g(o)&&"fulfilled"===(u=o.inspect()).state?n[i]=u.value:(++t,y(o,function(r){n[i]=r,0===--t&&e.resolve(n)},e.reject,function(n){e.notify({index:i,value:n})}))},void 0),0===t&&e.resolve(n),e.promise})}function D(n){if(0===n.length)return l.resolve();var t=l.defer(),e=0;return X(n,function(r,o,i){function u(n){t.resolve(n)}function a(){e--,0===e&&t.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function c(n){t.notify({index:i,value:n})}var f=n[i];e++,y(f,u,a,c)},void 0),t.promise}function P(n){return y(n,function(n){return n=Y(n,l),y(K(Y(n,function(n){return y(n,V,V)})),function(){return n})})}function q(n){return l(n).allSettled()}function F(n,t){return l(n).then(void 0,void 0,t)}function M(n,t){return l(n).nodeify(t)}var $=!1;try{throw new Error}catch(H){$=!!H.stack}var U,Q,z=f(),V=function(){},W=function(){function t(){for(var n,t;r.next;)r=r.next,n=r.task,r.task=void 0,t=r.domain,t&&(r.domain=void 0,t.enter()),e(n,t);for(;c.length;)n=c.pop(),e(n);i=!1}function e(n,e){try{n()}catch(r){if(a)throw e&&e.exit(),setTimeout(t,0),e&&e.enter(),r;setTimeout(function(){throw r},0)}e&&e.exit()}var r={task:void 0,next:null},o=r,i=!1,u=void 0,a=!1,c=[];if(W=function(t){o=o.next={task:t,domain:a&&n.domain,next:null},i||(i=!0,u())},"object"==typeof n&&"[object process]"===n.toString()&&n.nextTick)a=!0,u=function(){n.nextTick(t)};else if("function"==typeof setImmediate)u="undefined"!=typeof window?setImmediate.bind(window,t):function(){setImmediate(t)};else if("undefined"!=typeof MessageChannel){var f=new MessageChannel;f.port1.onmessage=function(){u=s,f.port1.onmessage=t,t()};var s=function(){f.port2.postMessage(0)};u=function(){setTimeout(t,0),s()}}else u=function(){setTimeout(t,0)};return W.runAfter=function(n){c.push(n),i||(i=!0,u())},W}(),J=Function.call,G=t(Array.prototype.slice),X=t(Array.prototype.reduce||function(n,t){var e=0,r=this.length;if(1===arguments.length)for(;;){if(e in this){t=this[e++];break}if(++e>=r)throw new TypeError}for(;r>e;e++)e in this&&(t=n(t,this[e],e));return t}),Z=t(Array.prototype.indexOf||function(n){for(var t=0;t2?n.resolve(G(arguments,1)):n.resolve(e)}},l.Promise=d,l.promise=d,d.race=h,d.all=K,d.reject=R,d.resolve=l,l.passByCopy=function(n){return n},v.prototype.passByCopy=function(){return this},l.join=function(n,t){return l(n).join(t)},v.prototype.join=function(n){return l([this,n]).spread(function(n,t){if(n===t)return n;throw new Error("Can't join: not the same: "+n+" "+t)})},l.race=h,v.prototype.race=function(){return this.then(l.race)},l.makePromise=v,v.prototype.toString=function(){return"[object Promise]"},v.prototype.then=function(n,t,e){function r(t){try{return"function"==typeof n?n(t):t}catch(e){return R(e)}}function i(n){if("function"==typeof t){o(n,a);try{return t(n)}catch(e){return R(e)}}return R(n)}function u(n){return"function"==typeof e?e(n):n}var a=this,c=p(),f=!1;return l.nextTick(function(){a.promiseDispatch(function(n){f||(f=!0,c.resolve(r(n)))},"when",[function(n){f||(f=!0,c.resolve(i(n)))}])}),a.promiseDispatch(void 0,"when",[void 0,function(n){var t,e=!1;try{t=u(n)}catch(r){if(e=!0,!l.onerror)throw r;l.onerror(r)}e||c.notify(t)}]),c.promise},l.tap=function(n,t){return l(n).tap(t)},v.prototype.tap=function(n){return n=l(n),this.then(function(t){return n.fcall(t).thenResolve(t)})},l.when=y,v.prototype.thenResolve=function(n){return this.then(function(){return n})},l.thenResolve=function(n,t){return l(n).thenResolve(t)},v.prototype.thenReject=function(n){return this.then(function(){throw n})},l.thenReject=function(n,t){return l(n).thenReject(t)},l.nearer=m,l.isPromise=g,l.isPromiseAlike=w,l.isPending=b,v.prototype.isPending=function(){return"pending"===this.inspect().state},l.isFulfilled=_,v.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},l.isRejected=k,v.prototype.isRejected=function(){return"rejected"===this.inspect().state};var un=[],an=[],cn=[],fn=!0;l.resetUnhandledRejections=j,l.getUnhandledReasons=function(){return un.slice()},l.stopUnhandledRejectionTracking=function(){j(),fn=!1},j(),l.reject=R,l.fulfill=S,l.master=C,l.spread=O,v.prototype.spread=function(n,t){return this.all().then(function(t){return n.apply(void 0,t)},t)},l.async=N,l.spawn=I,l["return"]=A,l.promised=B,l.dispatch=L,v.prototype.dispatch=function(n,t){var e=this,r=p();return l.nextTick(function(){e.promiseDispatch(r.resolve,n,t)}),r.promise},l.get=function(n,t){return l(n).dispatch("get",[t])},v.prototype.get=function(n){return this.dispatch("get",[n])},l.set=function(n,t,e){return l(n).dispatch("set",[t,e])},v.prototype.set=function(n,t){return this.dispatch("set",[n,t])},l.del=l["delete"]=function(n,t){return l(n).dispatch("delete",[t])},v.prototype.del=v.prototype["delete"]=function(n){return this.dispatch("delete",[n])},l.mapply=l.post=function(n,t,e){return l(n).dispatch("post",[t,e])},v.prototype.mapply=v.prototype.post=function(n,t){return this.dispatch("post",[n,t])},l.send=l.mcall=l.invoke=function(n,t){return l(n).dispatch("post",[t,G(arguments,2)])},v.prototype.send=v.prototype.mcall=v.prototype.invoke=function(n){return this.dispatch("post",[n,G(arguments,1)])},l.fapply=function(n,t){return l(n).dispatch("apply",[void 0,t])},v.prototype.fapply=function(n){return this.dispatch("apply",[void 0,n])},l["try"]=l.fcall=function(n){return l(n).dispatch("apply",[void 0,G(arguments,1)])},v.prototype.fcall=function(){return this.dispatch("apply",[void 0,G(arguments)])},l.fbind=function(n){var t=l(n),e=G(arguments,1);return function(){return t.dispatch("apply",[this,e.concat(G(arguments))])}},v.prototype.fbind=function(){var n=this,t=G(arguments);return function(){return n.dispatch("apply",[this,t.concat(G(arguments))])}},l.keys=function(n){return l(n).dispatch("keys",[])},v.prototype.keys=function(){return this.dispatch("keys",[])},l.all=K,v.prototype.all=function(){return K(this)},l.any=D,v.prototype.any=function(){return D(this)},l.allResolved=s(P,"allResolved","allSettled"),v.prototype.allResolved=function(){return P(this)},l.allSettled=q,v.prototype.allSettled=function(){return this.then(function(n){return K(Y(n,function(n){function t(){return n.inspect()}return n=l(n),n.then(t,t)}))})},l.fail=l["catch"]=function(n,t){return l(n).then(void 0,t)},v.prototype.fail=v.prototype["catch"]=function(n){return this.then(void 0,n)},l.progress=F,v.prototype.progress=function(n){return this.then(void 0,void 0,n)},l.fin=l["finally"]=function(n,t){return l(n)["finally"](t)},v.prototype.fin=v.prototype["finally"]=function(n){return n=l(n),this.then(function(t){return n.fcall().then(function(){return t})},function(t){return n.fcall().then(function(){throw t})})},l.done=function(n,t,e,r){return l(n).done(t,e,r)},v.prototype.done=function(t,e,r){var i=function(n){l.nextTick(function(){if(o(n,u),!l.onerror)throw n;l.onerror(n)})},u=t||e||r?this.then(t,e,r):this;"object"==typeof n&&n&&n.domain&&(i=n.domain.bind(i)),u.then(void 0,i)},l.timeout=function(n,t,e){return l(n).timeout(t,e)},v.prototype.timeout=function(n,t){var e=p(),r=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+n+" ms"),t.code="ETIMEDOUT"),e.reject(t)},n);return this.then(function(n){clearTimeout(r),e.resolve(n)},function(n){clearTimeout(r),e.reject(n)},e.notify),e.promise},l.delay=function(n,t){return void 0===t&&(t=n,n=void 0),l(n).delay(t)},v.prototype.delay=function(n){return this.then(function(t){var e=p();return setTimeout(function(){e.resolve(t)},n),e.promise})},l.nfapply=function(n,t){return l(n).nfapply(t)},v.prototype.nfapply=function(n){var t=p(),e=G(n);return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},l.nfcall=function(n){var t=G(arguments,1);return l(n).nfapply(t)},v.prototype.nfcall=function(){var n=G(arguments),t=p();return n.push(t.makeNodeResolver()),this.fapply(n).fail(t.reject),t.promise},l.nfbind=l.denodeify=function(n){var t=G(arguments,1);return function(){var e=t.concat(G(arguments)),r=p();return e.push(r.makeNodeResolver()),l(n).fapply(e).fail(r.reject),r.promise}},v.prototype.nfbind=v.prototype.denodeify=function(){var n=G(arguments);return n.unshift(this),l.denodeify.apply(void 0,n)},l.nbind=function(n,t){var e=G(arguments,2);return function(){function r(){return n.apply(t,arguments)}var o=e.concat(G(arguments)),i=p();return o.push(i.makeNodeResolver()),l(r).fapply(o).fail(i.reject),i.promise}},v.prototype.nbind=function(){var n=G(arguments,0);return n.unshift(this),l.nbind.apply(void 0,n)},l.nmapply=l.npost=function(n,t,e){return l(n).npost(t,e)},v.prototype.nmapply=v.prototype.npost=function(n,t){var e=G(t||[]),r=p();return e.push(r.makeNodeResolver()),this.dispatch("post",[n,e]).fail(r.reject),r.promise},l.nsend=l.nmcall=l.ninvoke=function(n,t){var e=G(arguments,2),r=p();return e.push(r.makeNodeResolver()),l(n).dispatch("post",[t,e]).fail(r.reject),r.promise},v.prototype.nsend=v.prototype.nmcall=v.prototype.ninvoke=function(n){var t=G(arguments,1),e=p();return t.push(e.makeNodeResolver()),this.dispatch("post",[n,t]).fail(e.reject),e.promise},l.nodeify=M,v.prototype.nodeify=function(n){return n?void this.then(function(t){l.nextTick(function(){n(null,t)})},function(t){l.nextTick(function(){n(t)})}):this},l.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var sn=f();return l})}).call(this,n("pBGvAp"))},{pBGvAp:2}],4:[function(n,t,e){!function(t){"use strict";function e(n,t){function e(n){return n?o.isFunction(n.toJSON)?n.toJSON():n:null}function r(n,t,e){try{m({id:n,result:t,response:t},e)}catch(r){f(n,a,r,e)}}function c(n){return n instanceof Error?n.message:n instanceof XMLHttpRequest?"Request error: "+[n.status,n.method,n.url].join(" "):o.isString(n)?n:"unknown error"}function f(n,t,e,r){var o=c(e);return m({id:n,error:{code:t,message:o}},r),i.fcall(function(){throw new Error(o)})}function s(n,t){var r={},i=e(t);r[n]=o.isUndefined(i)?!0:i,m(r,null)}function l(n){return{handler:function(t){return i.Promise(function(e,r){R7(n,t,function(n,t){n&&r(n),e(t)})})}}}function p(n){var t=n.source+":"+n.event,e="stream:"+t;R7.addStreamListener(t,o.bind(s,null,e))}function d(n){var t=n.control,e=n.context;return i.Promise(function(n,r){R7.navigate(t,e,function(t,e){t&&r(t),n(e)})})}function h(n){if(n){Array.isArray(n)&&(n=o.hashMap(n,!1));for(var t in n){var e=o.bind(s,null,"key",t);"Back"===t||"Exit"===t?g["onKey"+t]=e:R7.grabKey(t,e)}}}function v(n){if(n){Array.isArray(n)||(n=Object.keys(n));for(var t=0;t-1?0:-1:n?0:-1}function i(n){var t=this.cache,e=typeof n;if("boolean"==e||null==n)t[n]=!0;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,o=t[e]||(t[e]={});"object"==e?(o[r]||(o[r]=[])).push(n):o[r]=!0}}function u(n){return n.charCodeAt(0)}function a(n,t){for(var e=n.criteria,r=t.criteria,o=-1,i=e.length;++oa||"undefined"==typeof u)return 1;if(u=_&&i===r,f=[];if(a){var l=c(t);l?(i=o,t=l):a=!1}for(;++e-1});return o.pop(),i.pop(),g&&(p(o),p(i)),u}function tn(n,t,e,r,o){(Ze(t)?Xn:cr)(t,function(t,i){var u,a,c=t,f=n[i];if(t&&((a=Ze(t))||fr(t))){for(var l=r.length;l--;)if(u=r[l]==t){f=o[l];break}if(!u){var s;e&&(c=e(f,t),(s="undefined"!=typeof c)&&(f=c)),s||(f=a?Ze(f)?f:[]:fr(f)?f:{}),r.push(t),o.push(f),s||tn(f,t,e,r,o)}}else e&&(c=e(f,t),"undefined"==typeof c&&(c=t)),"undefined"!=typeof c&&(f=c);n[i]=f})}function rn(n,t){return n+Ne(We()*(t-n+1))}function on(n,t,e){var i=-1,u=fn(),a=n?n.length:0,f=[],s=!t&&a>=_&&u===r,d=e||s?l():f;if(s){var v=c(d);u=o,d=v}for(;++i3&&"function"==typeof t[e-2])var r=k(t[--e-1],t[e--],2);else e>2&&"function"==typeof t[e-1]&&(r=t[--e]);for(var o=d(arguments,1,e),i=-1,u=l(),a=l();++i-1:"number"==typeof i?u=(Kn(n)?n.indexOf(t,e):o(n,t,e))>-1:cr(n,function(n){if(++r>=e)return!(u=n===t)}),u}function Vn(n,e,r){var o=!0;e=t.createCallback(e,r,3);var i=-1,u=n?n.length:0;if("number"==typeof u)for(;++ii&&(i=f)}else e=null==e&&Kn(n)?u:t.createCallback(e,r,3),Xn(n,function(n,t,r){var u=e(n,t,r);u>o&&(o=u,i=n)});return i}function et(n,e,r){var o=1/0,i=o;if("function"!=typeof e&&r&&r[e]===n&&(e=null),null==e&&Ze(n))for(var a=-1,c=n.length;++a=_&&c(t?n[t]:f)))}var d=n[0],v=-1,y=d?d.length:0,m=[];n:for(;++v>>1;r(n[a])1?arguments:arguments[0],t=-1,e=n?tt(hr(n,"length")):0,r=de(e<0?0:e);++t2?an(n,17,d(arguments,2),null,t):an(n,1,null,null,t)}function Kt(n){for(var t=arguments.length>1?Y(arguments,!0,!1,1):_n(n),e=-1,r=t.length;++e2?an(t,19,d(arguments,2),null,n):an(t,3,null,null,n)}function Pt(){for(var n=arguments,t=n.length;t--;)if(!On(n[t]))throw new je;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}}function qt(n,t){return t="number"==typeof t?t:+t||n.length,an(n,4,null,null,null,t)}function Ft(n,t,e){var r,o,i,u,a,c,f,l=0,s=!1,p=!0;if(!On(n))throw new je;if(t=Ue(0,t)||0,e===!0){var h=!0;p=!1}else Nn(e)&&(h=e.leading,s="maxWait"in e&&(Ue(t,e.maxWait)||0),p="trailing"in e?e.trailing:p);var d=function(){var e=t-(vr()-u);if(e<=0){o&&Oe(o);var s=f;o=c=f=y,s&&(l=vr(),i=n.apply(a,r),c||o||(r=a=null))}else c=Ke(d,e)},v=function(){c&&Oe(c),o=c=f=y,(p||s!==t)&&(l=vr(),i=n.apply(a,r),c||o||(r=a=null))};return function(){if(r=arguments,u=vr(),a=this,f=p&&(c||!h),s===!1)var e=h&&!c;else{o||h||(l=u);var y=s-(u-l),m=y<=0;m?(o&&(o=Oe(o)),l=u,i=n.apply(a,r)):o||(o=Ke(v,y))}return m&&c?c=Oe(c):c||t===s||(c=Ke(d,t)),e&&(m=!0,i=n.apply(a,r)),!m||c||o||(r=a=null),i}}function Mt(n){if(!On(n))throw new je;var t=d(arguments,1);return Ke(function(){n.apply(y,t)},1)}function $t(n,t){if(!On(n))throw new je;var e=d(arguments,2);return Ke(function(){n.apply(y,e)},t)}function Ht(n,t){if(!On(n))throw new je;var e=function(){var r=e.cache,o=t?t.apply(this,arguments):b+arguments[0];return Le.call(r,o)?r[o]:r[o]=n.apply(this,arguments)};return e.cache={},e}function Qt(n){var t,e;if(!On(n))throw new je;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}}function Ut(n){return an(n,16,d(arguments,1))}function zt(n){return an(n,32,null,d(arguments,1))}function Vt(n,t,e){var r=!0,o=!0;if(!On(n))throw new je;return e===!1?r=!1:Nn(e)&&(r="leading"in e?e.leading:r,o="trailing"in e?e.trailing:o),V.leading=r,V.maxWait=t,V.trailing=o,Ft(n,t,V)}function Wt(n,t){return an(t,16,[n])}function Jt(n){return function(){return n}}function Gt(n,t,e){var r=typeof n;if(null==n||"function"==r)return k(n,t,e);if("object"!=r)return ee(n);var o=nr(n),i=o[0],u=n[i];return 1!=o.length||u!==u||Nn(u)?function(t){for(var e=o.length,r=!1;e--&&(r=nn(t[o[e]],n[o[e]],null,!0)););return r}:function(n){var t=n[i];return u===t&&(0!==u||1/u==1/t)}}function Xt(n){return null==n?"":ke(n).replace(or,cn)}function Zt(n){return n}function Yt(n,r,o){var i=!0,u=r&&_n(r);r&&(o||u.length)||(null==o&&(o=r),a=e,r=n,n=t,u=_n(r)),o===!1?i=!1:Nn(o)&&"chain"in o&&(i=o.chain);var a=n,c=On(a);Xn(u,function(t){var e=n[t]=r[t];c&&(a.prototype[t]=function(){var t=this.__chain__,r=this.__wrapped__,o=[r];Ae.apply(o,arguments);var u=e.apply(n,o);if(i||t){if(r===u&&Nn(u))return this;u=new a(u),u.__chain__=t}return u})})}function ne(){return n._=Re,this}function te(){}function ee(n){return function(t){return t[n]}}function re(n,t,e){var r=null==n,o=null==t;if(null==e&&("boolean"==typeof n&&o?(e=n,n=1):o||"boolean"!=typeof t||(e=t,o=!0)),r&&o&&(t=1),n=+n||0,o?(t=n,n=0):t=+t||0,e||n%1||t%1){var i=We();return ze(n+i*(t-n+parseFloat("1e-"+((i+"").length-1))),t)}return rn(n,t)}function oe(n,t){if(n){var e=n[t];return On(e)?n[t]():e}}function ie(n,e,r){var o=t.templateSettings;n=ke(n||""),r=ur({},r,o);var i,u=ur({},r.imports,o.imports),a=nr(u),c=Qn(u),l=0,s=r.interpolate||I,p="__p += '",h=_e((r.escape||I).source+"|"+s.source+"|"+(s===O?S:I).source+"|"+(r.evaluate||I).source+"|$","g");n.replace(h,function(t,e,r,o,u,a){return r||(r=o),p+=n.slice(l,a).replace(L,f),e&&(p+="' +\n__e("+e+") +\n'"),u&&(i=!0,p+="';\n"+u+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=a+t.length,t}),p+="';\n";var d=r.variable,v=d;v||(d="obj",p="with ("+d+") {\n"+p+"\n}\n"),p=(i?p.replace(x,""):p).replace(E,"$1").replace(R,"$1;"),p="function("+d+") {\n"+(v?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var m="\n/*\n//# sourceURL="+(r.sourceURL||"/lodash/template/source["+K++ +"]")+"\n*/";try{var g=me(a,"return "+p+m).apply(y,c)}catch(w){throw w.source=p,w}return e?g(e):(g.source=p,g)}function ue(n,t,e){n=(n=+n)>-1?n:0;var r=-1,o=de(n);for(t=k(t,e,1);++r/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:O,variable:"",imports:{_:t}},Fe||(g=function(){function t(){}return function(e){if(Nn(e)){t.prototype=e;var r=new t;t.prototype=null}return r||n.Object()}}());var Xe=qe?function(n,t){W.value=t,qe(n,"__bindData__",W),W.value=null}:te,Ze=Me||function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Se.call(n)==P||!1},Ye=function(n){var t,e=n,r=[];if(!e)return r;if(!J[typeof n])return r;for(t in e)Le.call(e,t)&&r.push(t);return r},nr=Qe?function(n){return Nn(n)?Qe(n):[]}:Ye,tr={"&":"&","<":"<",">":">",'"':""","'":"'"},er=jn(tr),rr=_e("("+nr(er).join("|")+")","g"),or=_e("["+nr(tr).join("")+"]","g"),ir=function(n,t,e){var r,o=n,i=o;if(!o)return i;var u=arguments,a=0,c="number"==typeof e?2:u.length;if(c>3&&"function"==typeof u[c-2])var f=k(u[--c-1],u[c--],2);else c>2&&"function"==typeof u[c-1]&&(f=u[--c]);for(;++a/g,N=RegExp("^["+j+"]*0+(?=.$)"),I=/($^)/,B=/\bthis\b/,L=/['\n\r\t\u2028\u2029\\]/g,A=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],K=0,D="[object Arguments]",P="[object Array]",q="[object Boolean]",F="[object Date]",M="[object Function]",$="[object Number]",H="[object Object]",Q="[object RegExp]",U="[object String]",z={};z[M]=!1,z[D]=z[P]=z[q]=z[F]=z[$]=z[H]=z[Q]=z[U]=!0;var V={leading:!1,maxWait:0,trailing:!1},W={configurable:!1,enumerable:!1,value:null,writable:!1},J={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},G={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},X=J[typeof window]&&window||this,Z=J[typeof e]&&e&&!e.nodeType&&e,Y=J[typeof t]&&t&&!t.nodeType&&t,nn=Y&&Y.exports===Z&&Z,tn=J[typeof n]&&n;!tn||tn.global!==tn&&tn.window!==tn||(X=tn);var en=v();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(X._=en,define(function(){return en})):Z&&Y?nn?(Y.exports=en)._=en:Z._=en:X._=en}).call(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(n,t,e){function r(){}var o=t.exports={};o.nextTick=function(){var n="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(n)return function(n){return window.setImmediate(n)};if(t){var e=[];return window.addEventListener("message",function(n){var t=n.source;if((t===window||null===t)&&"process-tick"===n.data&&(n.stopPropagation(),e.length>0)){var r=e.shift();r()}},!0),function(n){e.push(n),window.postMessage("process-tick","*")}}return function(n){setTimeout(n,0)}}(),o.title="browser",o.browser=!0,o.env={},o.argv=[],o.on=r,o.addListener=r,o.once=r,o.off=r,o.removeListener=r,o.removeAllListeners=r,o.emit=r,o.binding=function(n){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(n){throw new Error("process.chdir is not supported")}},{}],3:[function(n,t,e){(function(n){!function(n){"use strict";if("function"==typeof bootstrap)bootstrap("promise",n);else if("object"==typeof e&&"object"==typeof t)t.exports=n();else if("function"==typeof define&&define.amd)define(n);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=n}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var r="undefined"!=typeof window?window:self,o=r.Q;r.Q=n(),r.Q.noConflict=function(){return r.Q=o,this}}}(function(){"use strict";function t(n){return function(){return J.apply(n,arguments)}}function e(n){return n===Object(n)}function r(n){return"[object StopIteration]"===on(n)||n instanceof U}function o(n,t){if($&&t.stack&&"object"==typeof n&&null!==n&&n.stack){for(var e=[],r=t;r;r=r.source)r.stack&&(!n.__minimumStackCounter__||n.__minimumStackCounter__>r.stackCounter)&&(tn(n,"__minimumStackCounter__",{value:r.stackCounter,configurable:!0}),e.unshift(r.stack));e.unshift(n.stack);var o=e.join("\n"+un+"\n"),u=i(o);tn(n,"stack",{value:u,configurable:!0})}}function i(n){for(var t=n.split("\n"),e=[],r=0;r=z&&r<=pn}function f(){if($)try{throw new Error}catch(n){var t=n.stack.split("\n"),e=t[0].indexOf("@")>0?t[1]:t[2],r=a(e);if(!r)return;return Q=r[0],r[1]}}function l(n,t,e){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(t+" is deprecated, use "+e+" instead.",new Error("").stack),n.apply(n,arguments)}}function s(n){return n instanceof v?n:w(n)?C(n):S(n)}function p(){function n(n){t=n,s.longStackSupport&&$&&(i.source=n),X(e,function(t,e){s.nextTick(function(){ +n.promiseDispatch.apply(n,e)})},void 0),e=void 0,r=void 0}var t,e=[],r=[],o=nn(p.prototype),i=nn(v.prototype);if(i.promiseDispatch=function(n,o,i){var u=G(arguments);e?(e.push(u),"when"===o&&i[1]&&r.push(i[1])):s.nextTick(function(){t.promiseDispatch.apply(t,u)})},i.valueOf=function(){if(e)return i;var n=m(t);return g(n)&&(t=n),n},i.inspect=function(){return t?t.inspect():{state:"pending"}},s.longStackSupport&&$)try{throw new Error}catch(u){i.stack=u.stack.substring(u.stack.indexOf("\n")+1),i.stackCounter=an++}return o.promise=i,o.resolve=function(e){t||n(s(e))},o.fulfill=function(e){t||n(S(e))},o.reject=function(e){t||n(R(e))},o.notify=function(n){t||X(r,function(t,e){s.nextTick(function(){e(n)})},void 0)},o}function h(n){if("function"!=typeof n)throw new TypeError("resolver must be a function.");var t=p();try{n(t.resolve,t.reject,t.notify)}catch(e){t.reject(e)}return t.promise}function d(n){return h(function(t,e){for(var r=0,o=n.length;r=r)throw new TypeError}for(;e2?n.resolve(G(arguments,1)):n.resolve(e)}},s.Promise=h,s.promise=h,h.race=d,h.all=K,h.reject=R,h.resolve=s,s.passByCopy=function(n){return n},v.prototype.passByCopy=function(){return this},s.join=function(n,t){return s(n).join(t)},v.prototype.join=function(n){return s([this,n]).spread(function(n,t){if(n===t)return n;throw new Error("Q can't join: not the same: "+n+" "+t)})},s.race=d,v.prototype.race=function(){return this.then(s.race)},s.makePromise=v,v.prototype.toString=function(){return"[object Promise]"},v.prototype.then=function(n,t,e){function r(t){try{return"function"==typeof n?n(t):t}catch(e){return R(e)}}function i(n){if("function"==typeof t){o(n,a);try{return t(n)}catch(e){return R(e)}}return R(n)}function u(n){return"function"==typeof e?e(n):n}var a=this,c=p(),f=!1;return s.nextTick(function(){a.promiseDispatch(function(n){f||(f=!0,c.resolve(r(n)))},"when",[function(n){f||(f=!0,c.resolve(i(n)))}])}),a.promiseDispatch(void 0,"when",[void 0,function(n){var t,e=!1;try{t=u(n)}catch(r){if(e=!0,!s.onerror)throw r;s.onerror(r)}e||c.notify(t)}]),c.promise},s.tap=function(n,t){return s(n).tap(t)},v.prototype.tap=function(n){return n=s(n),this.then(function(t){return n.fcall(t).thenResolve(t)})},s.when=y,v.prototype.thenResolve=function(n){return this.then(function(){return n})},s.thenResolve=function(n,t){return s(n).thenResolve(t)},v.prototype.thenReject=function(n){return this.then(function(){throw n})},s.thenReject=function(n,t){return s(n).thenReject(t)},s.nearer=m,s.isPromise=g,s.isPromiseAlike=w,s.isPending=b,v.prototype.isPending=function(){return"pending"===this.inspect().state},s.isFulfilled=_,v.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},s.isRejected=k,v.prototype.isRejected=function(){return"rejected"===this.inspect().state};var cn=[],fn=[],ln=[],sn=!0;s.resetUnhandledRejections=j,s.getUnhandledReasons=function(){return cn.slice()},s.stopUnhandledRejectionTracking=function(){j(),sn=!1},j(),s.reject=R,s.fulfill=S,s.master=T,s.spread=O,v.prototype.spread=function(n,t){return this.all().then(function(t){return n.apply(void 0,t)},t)},s.async=N,s.spawn=I,s["return"]=B,s.promised=L,s.dispatch=A,v.prototype.dispatch=function(n,t){var e=this,r=p();return s.nextTick(function(){e.promiseDispatch(r.resolve,n,t)}),r.promise},s.get=function(n,t){return s(n).dispatch("get",[t])},v.prototype.get=function(n){return this.dispatch("get",[n])},s.set=function(n,t,e){return s(n).dispatch("set",[t,e])},v.prototype.set=function(n,t){return this.dispatch("set",[n,t])},s.del=s["delete"]=function(n,t){return s(n).dispatch("delete",[t])},v.prototype.del=v.prototype["delete"]=function(n){return this.dispatch("delete",[n])},s.mapply=s.post=function(n,t,e){return s(n).dispatch("post",[t,e])},v.prototype.mapply=v.prototype.post=function(n,t){return this.dispatch("post",[n,t])},s.send=s.mcall=s.invoke=function(n,t){return s(n).dispatch("post",[t,G(arguments,2)])},v.prototype.send=v.prototype.mcall=v.prototype.invoke=function(n){return this.dispatch("post",[n,G(arguments,1)])},s.fapply=function(n,t){return s(n).dispatch("apply",[void 0,t])},v.prototype.fapply=function(n){return this.dispatch("apply",[void 0,n])},s["try"]=s.fcall=function(n){return s(n).dispatch("apply",[void 0,G(arguments,1)])},v.prototype.fcall=function(){return this.dispatch("apply",[void 0,G(arguments)])},s.fbind=function(n){var t=s(n),e=G(arguments,1);return function(){return t.dispatch("apply",[this,e.concat(G(arguments))])}},v.prototype.fbind=function(){var n=this,t=G(arguments);return function(){return n.dispatch("apply",[this,t.concat(G(arguments))])}},s.keys=function(n){return s(n).dispatch("keys",[])},v.prototype.keys=function(){return this.dispatch("keys",[])},s.all=K,v.prototype.all=function(){return K(this)},s.any=D,v.prototype.any=function(){return D(this)},s.allResolved=l(P,"allResolved","allSettled"),v.prototype.allResolved=function(){return P(this)},s.allSettled=q,v.prototype.allSettled=function(){return this.then(function(n){return K(Y(n,function(n){function t(){return n.inspect()}return n=s(n),n.then(t,t)}))})},s.fail=s["catch"]=function(n,t){return s(n).then(void 0,t)},v.prototype.fail=v.prototype["catch"]=function(n){return this.then(void 0,n)},s.progress=F,v.prototype.progress=function(n){return this.then(void 0,void 0,n)},s.fin=s["finally"]=function(n,t){return s(n)["finally"](t)},v.prototype.fin=v.prototype["finally"]=function(n){if(!n||"function"!=typeof n.apply)throw new Error("Q can't apply finally callback");return n=s(n),this.then(function(t){return n.fcall().then(function(){return t})},function(t){return n.fcall().then(function(){throw t})})},s.done=function(n,t,e,r){return s(n).done(t,e,r)},v.prototype.done=function(t,e,r){var i=function(n){s.nextTick(function(){if(o(n,u),!s.onerror)throw n;s.onerror(n)})},u=t||e||r?this.then(t,e,r):this;"object"==typeof n&&n&&n.domain&&(i=n.domain.bind(i)),u.then(void 0,i)},s.timeout=function(n,t,e){return s(n).timeout(t,e)},v.prototype.timeout=function(n,t){var e=p(),r=setTimeout(function(){t&&"string"!=typeof t||(t=new Error(t||"Timed out after "+n+" ms"),t.code="ETIMEDOUT"),e.reject(t)},n);return this.then(function(n){clearTimeout(r),e.resolve(n)},function(n){clearTimeout(r),e.reject(n)},e.notify),e.promise},s.delay=function(n,t){return void 0===t&&(t=n,n=void 0),s(n).delay(t)},v.prototype.delay=function(n){return this.then(function(t){var e=p();return setTimeout(function(){e.resolve(t)},n),e.promise})},s.nfapply=function(n,t){return s(n).nfapply(t)},v.prototype.nfapply=function(n){var t=p(),e=G(n);return e.push(t.makeNodeResolver()),this.fapply(e).fail(t.reject),t.promise},s.nfcall=function(n){var t=G(arguments,1);return s(n).nfapply(t)},v.prototype.nfcall=function(){var n=G(arguments),t=p();return n.push(t.makeNodeResolver()),this.fapply(n).fail(t.reject),t.promise},s.nfbind=s.denodeify=function(n){if(void 0===n)throw new Error("Q can't wrap an undefined function");var t=G(arguments,1);return function(){var e=t.concat(G(arguments)),r=p();return e.push(r.makeNodeResolver()),s(n).fapply(e).fail(r.reject),r.promise}},v.prototype.nfbind=v.prototype.denodeify=function(){var n=G(arguments);return n.unshift(this),s.denodeify.apply(void 0,n)},s.nbind=function(n,t){var e=G(arguments,2);return function(){function r(){return n.apply(t,arguments)}var o=e.concat(G(arguments)),i=p();return o.push(i.makeNodeResolver()),s(r).fapply(o).fail(i.reject),i.promise}},v.prototype.nbind=function(){var n=G(arguments,0);return n.unshift(this),s.nbind.apply(void 0,n)},s.nmapply=s.npost=function(n,t,e){return s(n).npost(t,e)},v.prototype.nmapply=v.prototype.npost=function(n,t){var e=G(t||[]),r=p();return e.push(r.makeNodeResolver()),this.dispatch("post",[n,e]).fail(r.reject),r.promise},s.nsend=s.nmcall=s.ninvoke=function(n,t){var e=G(arguments,2),r=p();return e.push(r.makeNodeResolver()),s(n).dispatch("post",[t,e]).fail(r.reject),r.promise},v.prototype.nsend=v.prototype.nmcall=v.prototype.ninvoke=function(n){var t=G(arguments,1),e=p();return t.push(e.makeNodeResolver()),this.dispatch("post",[n,t]).fail(e.reject),e.promise},s.nodeify=M,v.prototype.nodeify=function(n){return n?void this.then(function(t){s.nextTick(function(){n(null,t)})},function(t){s.nextTick(function(){n(t)})}):this},s.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var pn=f();return s})}).call(this,n("pBGvAp"))},{pBGvAp:2}],4:[function(n,t,e){!function(t){"use strict";function e(n,t){function e(n){return n?o.isFunction(n.toJSON)?n.toJSON():n:null}function r(n,t,e){try{m({id:n,result:t,response:t},e)}catch(r){f(n,a,r,e)}}function c(n){return console.log("r7extlib err",n),n instanceof Error?n.message:n instanceof XMLHttpRequest?"Request error: "+[n.status,n.method,n.url].join(" "):o.isString(n)?n:"unknown error"}function f(n,t,e,r){var o=c(e);return m({id:n,error:{code:t,message:o}},r),i.fcall(function(){throw new Error(o)})}function l(n,t){var r={},i=e(t);r[n]=!!o.isUndefined(i)||i,m(r,null)}function s(n){return{handler:function(t){return i.Promise(function(e,r){R7(n,t,function(n,t){n&&r(n),e(t)})})}}}function p(n){var t=n.source+":"+n.event,e="stream:"+t;R7.addStreamListener(t,o.bind(l,null,e))}function h(n){var t=n.control,e=n.context;return i.Promise(function(n,r){R7.navigate(t,e,function(t,e){t&&r(t),n(e)})})}function d(n){if(n){Array.isArray(n)&&(n=o.hashMap(n,!1));for(var t in n){var e=o.bind(l,null,"key",t);"Back"===t||"Exit"===t?g["onKey"+t]=e:R7.grabKey(t,e)}}}function v(n){if(n){Array.isArray(n)||(n=Object.keys(n));for(var t=0;t