mirror of
https://github.com/This-weiyuqing/ECGTest.git
synced 2026-10-20 03:57:07 +08:00
92 lines
2.8 MiB
Plaintext
92 lines
2.8 MiB
Plaintext
!function(e,t){function i(e){var t=e.length,i=ae.type(e);return!ae.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===i||"function"!==i&&(0===t||"number"==typeof t&&t>0&&t-1 in e)))}function n(e){var t=fe[e]={};return ae.each(e.match(se)||[],function(e,i){t[i]=!0}),t}function r(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=ae.expando+Math.random()}function a(e,i,n){var r;if(n===t&&1===e.nodeType)if(r="data-"+i.replace(ye,"-$1").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:ve.test(n)?JSON.parse(n):n)}catch(e){}me.set(e,i,n)}else n=t;return n}function o(){return!0}function s(){return!1}function l(){try{return W.activeElement}catch(e){}}function c(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function u(e,t,i){if(ae.isFunction(t))return ae.grep(e,function(e,n){return!!t.call(e,n,e)!==i});if(t.nodeType)return ae.grep(e,function(e){return e===t!==i});if("string"==typeof t){if(Ee.test(t))return ae.filter(t,e,i);t=ae.filter(t,e)}return ae.grep(e,function(e){return te.call(t,e)>=0!==i})}function d(e,t){return ae.nodeName(e,"table")&&ae.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function h(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function p(e){var t=ze.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function f(e,t){for(var i=e.length,n=0;i>n;n++)ge.set(e[n],"globalEval",!t||ge.get(t[n],"globalEval"))}function m(e,t){var i,n,r,a,o,s,l,c;if(1===t.nodeType){if(ge.hasData(e)&&(a=ge.access(e),o=ge.set(t,a),c=a.events)){delete o.handle,o.events={};for(r in c)for(i=0,n=c[r].length;n>i;i++)ae.event.add(t,r,c[r][i])}me.hasData(e)&&(s=me.access(e),l=ae.extend({},s),me.set(t,l))}}function g(e,i){var n=e.getElementsByTagName?e.getElementsByTagName(i||"*"):e.querySelectorAll?e.querySelectorAll(i||"*"):[];return i===t||i&&ae.nodeName(e,i)?ae.merge([e],n):n}function v(e,t){var i=t.nodeName.toLowerCase();"input"===i&&Pe.test(e.type)?t.checked=e.checked:("input"===i||"textarea"===i)&&(t.defaultValue=e.defaultValue)}function y(e,t){if(t in e)return t;for(var i=t.charAt(0).toUpperCase()+t.slice(1),n=t,r=Ze.length;r--;)if((t=Ze[r]+i)in e)return t;return n}function _(e,t){return e=t||e,"none"===ae.css(e,"display")||!ae.contains(e.ownerDocument,e)}function b(t){return e.getComputedStyle(t,null)}function w(e,t){for(var i,n,r,a=[],o=0,s=e.length;s>o;o++)n=e[o],n.style&&(a[o]=ge.get(n,"olddisplay"),i=n.style.display,t?(a[o]||"none"!==i||(n.style.display=""),""===n.style.display&&_(n)&&(a[o]=ge.access(n,"olddisplay",T(n.nodeName)))):a[o]||(r=_(n),(i&&"none"!==i||!r)&&ge.set(n,"olddisplay",r?i:ae.css(n,"display"))));for(o=0;s>o;o++)n=e[o],n.style&&(t&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=t?a[o]||"":"none"));return e}function x(e,t,i){var n=We.exec(t);return n?Math.max(0,n[1]-(i||0))+(n[2]||"px"):t}function k(e,t,i,n,r){for(var a=i===(n?"border":"content")?4:"width"===t?1:0,o=0;4>a;a+=2)"margin"===i&&(o+=ae.css(e,i+Qe[a],!0,r)),n?("content"===i&&(o-=ae.css(e,"padding"+Qe[a],!0,r)),"margin"!==i&&(o-=ae.css(e,"border"+Qe[a]+"Width",!0,r))):(o+=ae.css(e,"padding"+Qe[a],!0,r),"padding"!==i&&(o+=ae.css(e,"border"+Qe[a]+"Width",!0,r)));return o}function C(e,t,i){var n=!0,r="width"===t?e.offsetWidth:e.offsetHeight,a=b(e),o=ae.support.boxSizing&&"border-box"===ae.css(e,"boxSizing",!1,a);if(0>=r||null==r){if(r=Ue(e,t,a),(0>r||null==r)&&(r=e.style[t]),Ve.test(r))return r;n=o&&(ae.support.boxSizingReliable||r===e.style[t]),r=parseFloat(r)||0}return r+k(e,t,i||(o?"border":"content"),n,a)+"px"}function T(e){var t=W,i=Ye[e];return i||(i=S(e,t),"none"!==i&&i||($e=($e||ae("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=($e[0].contentWindow||$e[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),i=S(e,t),$e.detach()),Ye[e]=i),i}function S(e,t){var i=ae(t.createElement(e)).appendTo(t.body),n=ae.css(i[0],"display");return i.remove(),n}function E(e,t,i,n){var r;if(ae.isArray(t))ae.each(t,function(t,r){i||et.test(e)?n(e,r):E(e+"["+("object"==typeof r?t:"")+"]",r,i,n)});else if(i||"object"!==ae.type(t))n(e,t);else for(r in t)E(e+"["+r+"]",t[r],i,n)}function A(e){return function(t,i){"string"!=typeof t&&(i=t,t="*");var n,r=0,a=t.toLowerCase().match(se)||[];if(ae.isFunction(i))for(;n=a[r++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(i)):(e[n]=e[n]||[]).push(i)}}function I(e,i,n,r){function a(l){var c;return o[l]=!0,ae.each(e[l]||[],function(e,l){var u=l(i,n,r);return"string"!=typeof u||s||o[u]?s?!(c=u):t:(i.dataTypes.unshift(u),a(u),!1)}),c}var o={},s=e===vt;return a(i.dataTypes[0])||!o["*"]&&a("*")}function D(e,i){var n,r,a=ae.ajaxSettings.flatOptions||{};for(n in i)i[n]!==t&&((a[n]?e:r||(r={}))[n]=i[n]);return r&&ae.extend(!0,e,r),e}function M(e,i,n){for(var r,a,o,s,l=e.contents,c=e.dataTypes;"*"===c[0];)c.shift(),r===t&&(r=e.mimeType||i.getResponseHeader("Content-Type"));if(r)for(a in l)if(l[a]&&l[a].test(r)){c.unshift(a);break}if(c[0]in n)o=c[0];else{for(a in n){if(!c[0]||e.converters[a+" "+c[0]]){o=a;break}s||(s=a)}o=o||s}return o?(o!==c[0]&&c.unshift(o),n[o]):t}function L(e,t,i,n){var r,a,o,s,l,c={},u=e.dataTypes.slice();if(u[1])for(o in e.converters)c[o.toLowerCase()]=e.converters[o];for(a=u.shift();a;)if(e.responseFields[a]&&(i[e.responseFields[a]]=t),!l&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=a,a=u.shift())if("*"===a)a=l;else if("*"!==l&&l!==a){if(!(o=c[l+" "+a]||c["* "+a]))for(r in c)if(s=r.split(" "),s[1]===a&&(o=c[l+" "+s[0]]||c["* "+s[0]])){!0===o?o=c[r]:!0!==c[r]&&(a=s[0],u.unshift(s[1]));break}if(!0!==o)if(o&&e.throws)t=o(t);else try{t=o(t)}catch(e){return{state:"parsererror",error:o?e:"No conversion from "+l+" to "+a}}}return{state:"success",data:t}}function O(){return setTimeout(function(){Tt=t}),Tt=ae.now()}function N(e,t,i){for(var n,r=(Mt[t]||[]).concat(Mt["*"]),a=0,o=r.length;o>a;a++)if(n=r[a].call(i,t,e))return n}function P(e,t,i){var n,r,a=0,o=Dt.length,s=ae.Deferred().always(function(){delete l.elem}),l=function(){if(r)return!1;for(var t=Tt||O(),i=Math.max(0,c.startTime+c.duration-t),n=i/c.duration||0,a=1-n,o=0,l=c.tweens.length;l>o;o++)c.tweens[o].run(a);return s.notifyWith(e,[c,a,i]),1>a&&l?i:(s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:ae.extend({},t),opts:ae.extend(!0,{specialEasing:{}},i),originalProperties:t,originalOptions:i,startTime:Tt||O(),duration:i.duration,tweens:[],createTween:function(t,i){var n=ae.Tween(e,c.opts,t,i,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(n),n},stop:function(t){var i=0,n=t?c.tweens.length:0;if(r)return this;for(r=!0;n>i;i++)c.tweens[i].run(1);return t?s.resolveWith(e,[c,t]):s.rejectWith(e,[c,t]),this}}),u=c.props;for(R(u,c.opts.specialEasing);o>a;a++)if(n=Dt[a].call(c,e,u,c.opts))return n;return ae.map(u,N,c),ae.isFunction(c.opts.start)&&c.opts.start.call(e,c),ae.fx.timer(ae.extend(l,{elem:e,anim:c,queue:c.opts.queue})),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always)}function R(e,t){var i,n,r,a,o;for(i in e)if(n=ae.camelCase(i),r=t[n],a=e[i],ae.isArray(a)&&(r=a[1],a=e[i]=a[0]),i!==n&&(e[n]=a,delete e[i]),(o=ae.cssHooks[n])&&"expand"in o){a=o.expand(a),delete e[n];for(i in a)i in e||(e[i]=a[i],t[i]=r)}else t[n]=r}function j(e,i,n){var r,a,o,s,l,c,u=this,d={},h=e.style,p=e.nodeType&&_(e),f=ge.get(e,"fxshow");n.queue||(l=ae._queueHooks(e,"fx"),null==l.unqueued&&(l.unqueued=0,c=l.empty.fire,l.empty.fire=function(){l.unqueued||c()}),l.unqueued++,u.always(function(){u.always(function(){l.unqueued--,ae.queue(e,"fx").length||l.empty.fire()})})),1===e.nodeType&&("height"in i||"width"in i)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===ae.css(e,"display")&&"none"===ae.css(e,"float")&&(h.display="inline-block")),n.overflow&&(h.overflow="hidden",u.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]}));for(r in i)if(a=i[r],Et.exec(a)){if(delete i[r],o=o||"toggle"===a,a===(p?"hide":"show")){if("show"!==a||!f||f[r]===t)continue;p=!0}d[r]=f&&f[r]||ae.style(e,r)}if(!ae.isEmptyObject(d)){f?"hidden"in f&&(p=f.hidden):f=ge.access(e,"fxshow",{}),o&&(f.hidden=!p),p?ae(e).show():u.done(function(){ae(e).hide()}),u.done(function(){var t;ge.remove(e,"fxshow");for(t in d)ae.style(e,t,d[t])});for(r in d)s=N(p?f[r]:0,r,u),r in f||(f[r]=s.start,p&&(s.end=s.start,s.start="width"===r||"height"===r?1:0))}}function z(e,t,i,n,r){return new z.prototype.init(e,t,i,n,r)}function F(e,t){var i,n={height:e},r=0;for(t=t?1:0;4>r;r+=2-t)i=Qe[r],n["margin"+i]=n["padding"+i]=e;return t&&(n.opacity=n.width=e),n}function B(e){return ae.isWindow(e)?e:9===e.nodeType&&e.defaultView}var U,$,q=typeof t,H=e.location,W=e.document,V=W.documentElement,G=e.jQuery,Y=e.$,K={},X=[],Q="2.0.3",Z=X.concat,J=X.push,ee=X.slice,te=X.indexOf,ie=K.toString,ne=K.hasOwnProperty,re=Q.trim,ae=function(e,t){return new ae.fn.init(e,t,U)},oe=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,se=/\S+/g,le=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ce=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ue=/^-ms-/,de=/-([\da-z])/gi,he=function(e,t){return t.toUpperCase()},pe=function(){W.removeEventListener("DOMContentLoaded",pe,!1),e.removeEventListener("load",pe,!1),ae.ready()};ae.fn=ae.prototype={jquery:Q,constructor:ae,init:function(e,i,n){var r,a;if(!e)return this;if("string"==typeof e){if(!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:le.exec(e))||!r[1]&&i)return!i||i.jquery?(i||n).find(e):this.constructor(i).find(e);if(r[1]){if(i=i instanceof ae?i[0]:i,ae.merge(this,ae.parseHTML(r[1],i&&i.nodeType?i.ownerDocument||i:W,!0)),ce.test(r[1])&&ae.isPlainObject(i))for(r in i)ae.isFunction(this[r])?this[r](i[r]):this.attr(r,i[r]);return this}return a=W.getElementById(r[2]),a&&a.parentNode&&(this.length=1,this[0]=a),this.context=W,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):ae.isFunction(e)?n.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),ae.makeArray(e,this))},selector:"",length:0,toArray:function(){return ee.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=ae.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return ae.each(this,e,t)},ready:function(e){return ae.ready.promise().done(e),this},slice:function(){return this.pushStack(ee.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,i=+e+(0>e?t:0);return this.pushStack(i>=0&&t>i?[this[i]]:[])},map:function(e){return this.pushStack(ae.map(this,function(t,i){return e.call(t,i,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:J,sort:[].sort,splice:[].splice},ae.fn.init.prototype=ae.fn,ae.extend=ae.fn.extend=function(){var e,i,n,r,a,o,s=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},l=2),"object"==typeof s||ae.isFunction(s)||(s={}),c===l&&(s=this,--l);c>l;l++)if(null!=(e=arguments[l]))for(i in e)n=s[i],r=e[i],s!==r&&(u&&r&&(ae.isPlainObject(r)||(a=ae.isArray(r)))?(a?(a=!1,o=n&&ae.isArray(n)?n:[]):o=n&&ae.isPlainObject(n)?n:{},s[i]=ae.extend(u,o,r)):r!==t&&(s[i]=r));return s},ae.extend({expando:"jQuery"+(Q+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===ae&&(e.$=Y),t&&e.jQuery===ae&&(e.jQuery=G),ae},isReady:!1,readyWait:1,holdReady:function(e){e?ae.readyWait++:ae.ready(!0)},ready:function(e){(!0===e?--ae.readyWait:ae.isReady)||(ae.isReady=!0,!0!==e&&--ae.readyWait>0||($.resolveWith(W,[ae]),ae.fn.trigger&&ae(W).trigger("ready").off("ready")))},isFunction:function(e){return"function"===ae.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?K[ie.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==ae.type(e)||e.nodeType||ae.isWindow(e))return!1;try{if(e.constructor&&!ne.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,i){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(i=t,t=!1),t=t||W;var n=ce.exec(e),r=!i&&[];return n?[t.createElement(n[1])]:(n=ae.buildFragment([e],t,r),r&&ae(r).remove(),ae.merge([],n.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var i,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,i=n.parseFromString(e,"text/xml")}catch(e){i=t}return(!i||i.getElementsByTagName("parsererror").length)&&ae.error("Invalid XML: "+e),i},noop:function(){},globalEval:function(e){var t,i=eval;(e=ae.trim(e))&&(1===e.indexOf("use strict")?(t=W.createElement("script"),t.text=e,W.head.appendChild(t).parentNode.removeChild(t)):i(e))},camelCase:function(e){return e.replace(ue,"ms-").replace(de,he)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r=0,a=e.length,o=i(e);if(n){if(o)for(;a>r&&!1!==t.apply(e[r],n);r++);else for(r in e)if(!1===t.apply(e[r],n))break}else if(o)for(;a>r&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":re.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(i(Object(e))?ae.merge(n,"string"==typeof e?[e]:e):J.call(n,e)),n},inArray:function(e,t,i){return null==t?-1:te.call(t,e,i)},merge:function(e,i){var n=i.length,r=e.length,a=0;if("number"==typeof n)for(;n>a;a++)e[r++]=i[a];else for(;i[a]!==t;)e[r++]=i[a++];return e.length=r,e},grep:function(e,t,i){var n,r=[],a=0,o=e.length;for(i=!!i;o>a;a++)n=!!t(e[a],a),i!==n&&r.push(e[a]);return r},map:function(e,t,n){var r,a=0,o=e.length,s=i(e),l=[];if(s)for(;o>a;a++)null!=(r=t(e[a],a,n))&&(l[l.length]=r);else for(a in e)null!=(r=t(e[a],a,n))&&(l[l.length]=r);return Z.apply([],l)},guid:1,proxy:function(e,i){var n,r,a;return"string"==typeof i&&(n=e[i],i=e,e=n),ae.isFunction(e)?(r=ee.call(arguments,2),a=function(){return e.apply(i||this,r.concat(ee.call(arguments)))},a.guid=e.guid=e.guid||ae.guid++,a):t},access:function(e,i,n,r,a,o,s){var l=0,c=e.length,u=null==n;if("object"===ae.type(n)){a=!0;for(l in n)ae.access(e,i,l,n[l],!0,o,s)}else if(r!==t&&(a=!0,ae.isFunction(r)||(s=!0),u&&(s?(i.call(e,r),i=null):(u=i,i=function(e,t,i){return u.call(ae(e),i)})),i))for(;c>l;l++)i(e[l],n,s?r:r.call(e[l],l,i(e[l],n)));return a?e:u?i.call(e):c?i(e[0],n):o},now:Date.now,swap:function(e,t,i,n){var r,a,o={};for(a in t)o[a]=e.style[a],e.style[a]=t[a];r=i.apply(e,n||[]);for(a in t)e.style[a]=o[a];return r}}),ae.ready.promise=function(t){return $||($=ae.Deferred(),"complete"===W.readyState?setTimeout(ae.ready):(W.addEventListener("DOMContentLoaded",pe,!1),e.addEventListener("load",pe,!1))),$.promise(t)},ae.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){K["[object "+t+"]"]=t.toLowerCase()}),U=ae(W),function(e,t){function i(e,t,i,n){var r,a,o,s,l,c,h,p,f,m;if((t?t.ownerDocument||t:z)!==D&&I(t),t=t||D,i=i||[],!e||"string"!=typeof e)return i;if(1!==(s=t.nodeType)&&9!==s)return[];if(L&&!n){if(r=ve.exec(e))if(o=r[1]){if(9===s){if(!(a=t.getElementById(o))||!a.parentNode)return i;if(a.id===o)return i.push(a),i}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(o))&&R(t,a)&&a.id===o)return i.push(a),i}else{if(r[2])return Z.apply(i,t.getElementsByTagName(e)),i;if((o=r[3])&&w.getElementsByClassName&&t.getElementsByClassName)return Z.apply(i,t.getElementsByClassName(o)),i}if(w.qsa&&(!O||!O.test(e))){if(p=h=j,f=t,m=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=u(e),(h=t.getAttribute("id"))?p=h.replace(be,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+d(c[l]);f=de.test(e)&&t.parentNode||t,m=c.join(",")}if(m)try{return Z.apply(i,f.querySelectorAll(m)),i}catch(e){}finally{h||t.removeAttribute("id")}}}return _(e.replace(le,"$1"),t,i,n)}function n(){function e(i,n){return t.push(i+=" ")>k.cacheLength&&delete e[t.shift()],e[i]=n}var t=[];return e}function r(e){return e[j]=!0,e}function a(e){var t=D.createElement("div");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var i=e.split("|"),n=e.length;n--;)k.attrHandle[i[n]]=t}function s(e,t){var i=t&&e,n=i&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||G)-(~e.sourceIndex||G);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===t)return-1;return e?1:-1}function l(e){return r(function(t){return t=+t,r(function(i,n){for(var r,a=e([],i.length,t),o=a.length;o--;)i[r=a[o]]&&(i[r]=!(n[r]=i[r]))})})}function c(){}function u(e,t){var n,r,a,o,s,l,c,u=$[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=k.preFilter;s;){(!n||(r=ce.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(a=[])),n=!1,(r=ue.exec(s))&&(n=r.shift(),a.push({value:n,type:r[0].replace(le," ")}),s=s.slice(n.length));for(o in k.filter)!(r=me[o].exec(s))||c[o]&&!(r=c[o](r))||(n=r.shift(),a.push({value:n,type:o,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?i.error(e):$(e,l).slice(0)}function d(e){for(var t=0,i=e.length,n="";i>t;t++)n+=e[t].value;return n}function h(e,t,i){var n=t.dir,r=i&&"parentNode"===n,a=B++;return t.first?function(t,i,a){for(;t=t[n];)if(1===t.nodeType||r)return e(t,i,a)}:function(t,i,o){var s,l,c,u=F+" "+a;if(o){for(;t=t[n];)if((1===t.nodeType||r)&&e(t,i,o))return!0}else for(;t=t[n];)if(1===t.nodeType||r)if(c=t[j]||(t[j]={}),(l=c[n])&&l[0]===u){if(!0===(s=l[1])||s===x)return!0===s}else if(l=c[n]=[u],l[1]=e(t,i,o)||x,!0===l[1])return!0}}function p(e){return e.length>1?function(t,i,n){for(var r=e.length;r--;)if(!e[r](t,i,n))return!1;return!0}:e[0]}function f(e,t,i,n,r){for(var a,o=[],s=0,l=e.length,c=null!=t;l>s;s++)(a=e[s])&&(!i||i(a,n,r))&&(o.push(a),c&&t.push(s));return o}function m(e,t,i,n,a,o){return n&&!n[j]&&(n=m(n)),a&&!a[j]&&(a=m(a,o)),r(function(r,o,s,l){var c,u,d,h=[],p=[],m=o.length,g=r||y(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?g:f(g,h,e,s,l),_=i?a||(r?e:m||n)?[]:o:v;if(i&&i(v,_,s,l),n)for(c=f(_,p),n(c,[],s,l),u=c.length;u--;)(d=c[u])&&(_[p[u]]=!(v[p[u]]=d));if(r){if(a||e){if(a){for(c=[],u=_.length;u--;)(d=_[u])&&c.push(v[u]=d);a(null,_=[],c,l)}for(u=_.length;u--;)(d=_[u])&&(c=a?ee.call(r,d):h[u])>-1&&(r[c]=!(o[c]=d))}}else _=f(_===o?_.splice(m,_.length):_),a?a(null,o,_,l):Z.apply(o,_)})}function g(e){for(var t,i,n,r=e.length,a=k.relative[e[0].type],o=a||k.relative[" "],s=a?1:0,l=h(function(e){return e===t},o,!0),c=h(function(e){return ee.call(t,e)>-1},o,!0),u=[function(e,i,n){return!a&&(n||i!==E)||((t=i).nodeType?l(e,i,n):c(e,i,n))}];r>s;s++)if(i=k.relative[e[s].type])u=[h(p(u),i)];else{if(i=k.filter[e[s].type].apply(null,e[s].matches),i[j]){for(n=++s;r>n&&!k.relative[e[n].type];n++);return m(s>1&&p(u),s>1&&d(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(le,"$1"),i,n>s&&g(e.slice(s,n)),r>n&&g(e=e.slice(n)),r>n&&d(e))}u.push(i)}return p(u)}function v(e,t){var n=0,a=t.length>0,o=e.length>0,s=function(r,s,l,c,u){var d,h,p,m=[],g=0,v="0",y=r&&[],_=null!=u,b=E,w=r||o&&k.find.TAG("*",u&&s.parentNode||s),C=F+=null==b?1:Math.random()||.1;for(_&&(E=s!==D&&s,x=n);null!=(d=w[v]);v++){if(o&&d){for(h=0;p=e[h++];)if(p(d,s,l)){c.push(d);break}_&&(F=C,x=++n)}a&&((d=!p&&d)&&g--,r&&y.push(d))}if(g+=v,a&&v!==g){for(h=0;p=t[h++];)p(y,m,s,l);if(r){if(g>0)for(;v--;)y[v]||m[v]||(m[v]=X.call(c));m=f(m)}Z.apply(c,m),_&&!r&&m.length>0&&g+t.length>1&&i.uniqueSort(c)}return _&&(F=C,E=b),y};return a?r(s):s}function y(e,t,n){for(var r=0,a=t.length;a>r;r++)i(e,t[r],n);return n}function _(e,t,i,n){var r,a,o,s,l,c=u(e);if(!n&&1===c.length){if(a=c[0]=c[0].slice(0),a.length>2&&"ID"===(o=a[0]).type&&w.getById&&9===t.nodeType&&L&&k.relative[a[1].type]){if(!(t=(k.find.ID(o.matches[0].replace(we,xe),t)||[])[0]))return i;e=e.slice(a.shift().value.length)}for(r=me.needsContext.test(e)?0:a.length;r--&&(o=a[r],!k.relative[s=o.type]);)if((l=k.find[s])&&(n=l(o.matches[0].replace(we,xe),de.test(a[0].type)&&t.parentNode||t))){if(a.splice(r,1),!(e=n.length&&d(a)))return Z.apply(i,n),i;break}}return S(e,c)(n,t,!L,i,de.test(e)),i}var b,w,x,k,C,T,S,E,A,I,D,M,L,O,N,P,R,j="sizzle"+-new Date,z=e.document,F=0,B=0,U=n(),$=n(),q=n(),H=!1,W=function(e,t){return e===t?(H=!0,0):0},V="undefined",G=1<<31,Y={}.hasOwnProperty,K=[],X=K.pop,Q=K.push,Z=K.push,J=K.slice,ee=K.indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(this[t]===e)return t;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ie="[\\x20\\t\\r\\n\\f]",ne="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",re=ne.replace("w","w#"),oe="\\["+ie+"*("+ne+")"+ie+"*(?:([*^$|!~]?=)"+ie+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+re+")|)|)"+ie+"*\\]",se=":("+ne+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+oe.replace(3,8)+")*)|.*)\\)|)",le=RegExp("^"+ie+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ie+"+$","g"),ce=RegExp("^"+ie+"*,"+ie+"*"),ue=RegExp("^"+ie+"*([>+~]|"+ie+")"+ie+"*"),de=RegExp(ie+"*[+~]"),he=RegExp("="+ie+"*([^\\]'\"]*)"+ie+"*\\]","g"),pe=RegExp(se),fe=RegExp("^"+re+"$"),me={ID:RegExp("^#("+ne+")"),CLASS:RegExp("^\\.("+ne+")"),TAG:RegExp("^("+ne.replace("w","w*")+")"),ATTR:RegExp("^"+oe),PSEUDO:RegExp("^"+se),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ie+"*(even|odd|(([+-]|)(\\d*)n|)"+ie+"*(?:([+-]|)"+ie+"*(\\d+)|))"+ie+"*\\)|)","i"),bool:RegExp("^(?:"+te+")$","i"),needsContext:RegExp("^"+ie+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ie+"*((?:-\\d)?\\d*)"+ie+"*\\)|)(?=[^-]|$)","i")},ge=/^[^{]+\{\s*\[native \w/,ve=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/^(?:input|select|textarea|button)$/i,_e=/^h\d$/i,be=/'|\\/g,we=RegExp("\\\\([\\da-f]{1,6}"+ie+"?|("+ie+")|.)","ig"),xe=function(e,t,i){var n="0x"+t-65536;return n!==n||i?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{Z.apply(K=J.call(z.childNodes),z.childNodes),K[z.childNodes.length].nodeType}catch(e){Z={apply:K.length?function(e,t){Q.apply(e,J.call(t))}:function(e,t){for(var i=e.length,n=0;e[i++]=t[n++];);e.length=i-1}}}T=i.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},w=i.support={},I=i.setDocument=function(e){var t=e?e.ownerDocument||e:z,i=t.defaultView;return t!==D&&9===t.nodeType&&t.documentElement?(D=t,M=t.documentElement,L=!T(t),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){I()}),w.attributes=a(function(e){return e.className="i",!e.getAttribute("className")}),w.getElementsByTagName=a(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),w.getElementsByClassName=a(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),w.getById=a(function(e){return M.appendChild(e).id=j,!t.getElementsByName||!t.getElementsByName(j).length}),w.getById?(k.find.ID=function(e,t){if(typeof t.getElementById!==V&&L){var i=t.getElementById(e);return i&&i.parentNode?[i]:[]}},k.filter.ID=function(e){var t=e.replace(we,xe);return function(e){return e.getAttribute("id")===t}}):(delete k.find.ID,k.filter.ID=function(e){var t=e.replace(we,xe);return function(e){var i=typeof e.getAttributeNode!==V&&e.getAttributeNode("id");return i&&i.value===t}}),k.find.TAG=w.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==V?t.getElementsByTagName(e):void 0}:function(e,t){var i,n=[],r=0,a=t.getElementsByTagName(e);if("*"===e){for(;i=a[r++];)1===i.nodeType&&n.push(i);return n}return a},k.find.CLASS=w.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==V&&L?t.getElementsByClassName(e):void 0},N=[],O=[],(w.qsa=ge.test(t.querySelectorAll))&&(a(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||O.push("\\["+ie+"*(?:value|"+te+")"),e.querySelectorAll(":checked").length||O.push(":checked")}),a(function(e){var i=t.createElement("input");i.setAttribute("type","hidden"),e.appendChild(i).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&O.push("[*^$]="+ie+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||O.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),O.push(",.*:")})),(w.matchesSelector=ge.test(P=M.webkitMatchesSelector||M.mozMatchesSelector||M.oMatchesSelector||M.msMatchesSelector))&&a(function(e){w.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),N.push("!=",se)}),O=O.length&&RegExp(O.join("|")),N=N.length&&RegExp(N.join("|")),R=ge.test(M.contains)||M.compareDocumentPosition?function(e,t){var i=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},W=M.compareDocumentPosition?function(e,i){if(e===i)return H=!0,0;var n=i.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(i);return n?1&n||!w.sortDetached&&i.compareDocumentPosition(e)===n?e===t||R(z,e)?-1:i===t||R(z,i)?1:A?ee.call(A,e)-ee.call(A,i):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,i){var n,r=0,a=e.parentNode,o=i.parentNode,l=[e],c=[i];if(e===i)return H=!0,0;if(!a||!o)return e===t?-1:i===t?1:a?-1:o?1:A?ee.call(A,e)-ee.call(A,i):0;if(a===o)return s(e,i);for(n=e;n=n.parentNode;)l.unshift(n);for(n=i;n=n.parentNode;)c.unshift(n);for(;l[r]===c[r];)r++;return r?s(l[r],c[r]):l[r]===z?-1:c[r]===z?1:0},t):D},i.matches=function(e,t){return i(e,null,null,t)},i.matchesSelector=function(e,t){if((e.ownerDocument||e)!==D&&I(e),t=t.replace(he,"='$1']"),!(!w.matchesSelector||!L||N&&N.test(t)||O&&O.test(t)))try{var n=P.call(e,t);if(n||w.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return i(t,D,null,[e]).length>0},i.contains=function(e,t){return(e.ownerDocument||e)!==D&&I(e),R(e,t)},i.attr=function(e,t){(e.ownerDocument||e)!==D&&I(e);var i=k.attrHandle[t.toLowerCase()],n=i&&Y.call(k.attrHandle,t.toLowerCase())?i(e,t,!L):void 0;return void 0===n?w.attributes||!L?e.getAttribute(t):(n=e.getAttributeNode(t))&&n.specified?n.value:null:n},i.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},i.uniqueSort=function(e){var t,i=[],n=0,r=0;if(H=!w.detectDuplicates,A=!w.sortStable&&e.slice(0),e.sort(W),H){for(;t=e[r++];)t===e[r]&&(n=i.push(r));for(;n--;)e.splice(i[n],1)}return e},C=i.getText=function(e){var t,i="",n=0,r=e.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=C(e)}else if(3===r||4===r)return e.nodeValue}else for(;t=e[n];n++)i+=C(t);return i},k=i.selectors={cacheLength:50,createPseudo:r,match:me,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(we,xe),e[3]=(e[4]||e[5]||"").replace(we,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||i.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&i.error(e[0]),e},PSEUDO:function(e){var t,i=!e[5]&&e[2];return me.CHILD.test(e[0])?null:(e[3]&&void 0!==e[4]?e[2]=e[4]:i&&pe.test(i)&&(t=u(i,!0))&&(t=i.indexOf(")",i.length-t)-i.length)&&(e[0]=e[0].slice(0,t),e[2]=i.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(we,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=U[e+" "];return t||(t=RegExp("(^|"+ie+")"+e+"("+ie+"|$)"))&&U(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==V&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var a=i.attr(r,e);return null==a?"!="===t:!t||(a+="","="===t?a===n:"!="===t?a!==n:"^="===t?n&&0===a.indexOf(n):"*="===t?n&&a.indexOf(n)>-1:"$="===t?n&&a.slice(-n.length)===n:"~="===t?(" "+a+" ").indexOf(n)>-1:"|="===t&&(a===n||a.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,i,n,r){var a="nth"!==e.slice(0,3),o="last"!==e.slice(-4),s="of-type"===t;return 1===n&&0===r?function(e){return!!e.parentNode}:function(t,i,l){var c,u,d,h,p,f,m=a!==o?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(a){for(;m;){for(d=t;d=d[m];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[o?g.firstChild:g.lastChild],o&&y){for(u=g[j]||(g[j]={}),c=u[e]||[],p=c[0]===F&&c[1],h=c[0]===F&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[m]||(h=p=0)||f.pop();)if(1===d.nodeType&&++h&&d===t){u[e]=[F,p,h];break}}else if(y&&(c=(t[j]||(t[j]={}))[e])&&c[0]===F)h=c[1];else for(;(d=++p&&d&&d[m]||(h=p=0)||f.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++h||(y&&((d[j]||(d[j]={}))[e]=[F,h]),d!==t)););return(h-=r)===n||0==h%n&&h/n>=0}}},PSEUDO:function(e,t){var n,a=k.pseudos[e]||k.setFilters[e.toLowerCase()]||i.error("unsupported pseudo: "+e);return a[j]?a(t):a.length>1?(n=[e,e,"",t],k.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,i){for(var n,r=a(e,t),o=r.length;o--;)n=ee.call(e,r[o]),e[n]=!(i[n]=r[o])}):function(e){return a(e,0,n)}):a}},pseudos:{not:r(function(e){var t=[],i=[],n=S(e.replace(le,"$1"));return n[j]?r(function(e,t,i,r){for(var a,o=n(e,null,r,[]),s=e.length;s--;)(a=o[s])&&(e[s]=!(t[s]=a))}):function(e,r,a){return t[0]=e,n(t,null,a,i),!i.pop()}}),has:r(function(e){return function(t){return i(e,t).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return fe.test(e||"")||i.error("unsupported lang: "+e),e=e.replace(we,xe).toLowerCase(),function(t){var i;do{if(i=L?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(i=i.toLowerCase())===e||0===i.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=e.location&&e.location.hash;return i&&i.slice(1)===t.id},root:function(e){return e===M},focus:function(e){return e===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!k.pseudos.empty(e)},header:function(e){return _e.test(e.nodeName)},input:function(e){return ye.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,i){return[0>i?i+t:i]}),even:l(function(e,t){for(var i=0;t>i;i+=2)e.push(i);return e}),odd:l(function(e,t){for(var i=1;t>i;i+=2)e.push(i);return e}),lt:l(function(e,t,i){for(var n=0>i?i+t:i;--n>=0;)e.push(n);return e}),gt:l(function(e,t,i){for(var n=0>i?i+t:i;t>++n;)e.push(n);return e})}},k.pseudos.nth=k.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})k.pseudos[b]=function(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}(b);for(b in{submit:!0,reset:!0})k.pseudos[b]=function(e){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===e}}(b)
|
||
;c.prototype=k.filters=k.pseudos,k.setFilters=new c,S=i.compile=function(e,t){var i,n=[],r=[],a=q[e+" "];if(!a){for(t||(t=u(e)),i=t.length;i--;)a=g(t[i]),a[j]?n.push(a):r.push(a);a=q(e,v(r,n))}return a},w.sortStable=j.split("").sort(W).join("")===j,w.detectDuplicates=H,I(),w.sortDetached=a(function(e){return 1&e.compareDocumentPosition(D.createElement("div"))}),a(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,i){return i?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),w.attributes&&a(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,i){return i||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),a(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,i){var n;return i?void 0:(n=e.getAttributeNode(t))&&n.specified?n.value:!0===e[t]?t.toLowerCase():null}),ae.find=i,ae.expr=i.selectors,ae.expr[":"]=ae.expr.pseudos,ae.unique=i.uniqueSort,ae.text=i.getText,ae.isXMLDoc=i.isXML,ae.contains=i.contains}(e);var fe={};ae.Callbacks=function(e){e="string"==typeof e?fe[e]||n(e):ae.extend({},e);var i,r,a,o,s,l,c=[],u=!e.once&&[],d=function(t){for(i=e.memory&&t,r=!0,l=o||0,o=0,s=c.length,a=!0;c&&s>l;l++)if(!1===c[l].apply(t[0],t[1])&&e.stopOnFalse){i=!1;break}a=!1,c&&(u?u.length&&d(u.shift()):i?c=[]:h.disable())},h={add:function(){if(c){var t=c.length;(function t(i){ae.each(i,function(i,n){var r=ae.type(n);"function"===r?e.unique&&h.has(n)||c.push(n):n&&n.length&&"string"!==r&&t(n)})})(arguments),a?s=c.length:i&&(o=t,d(i))}return this},remove:function(){return c&&ae.each(arguments,function(e,t){for(var i;(i=ae.inArray(t,c,i))>-1;)c.splice(i,1),a&&(s>=i&&s--,l>=i&&l--)}),this},has:function(e){return e?ae.inArray(e,c)>-1:!(!c||!c.length)},empty:function(){return c=[],s=0,this},disable:function(){return c=u=i=t,this},disabled:function(){return!c},lock:function(){return u=t,i||h.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!c||r&&!u||(t=t||[],t=[e,t.slice?t.slice():t],a?u.push(t):d(t)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!r}};return h},ae.extend({Deferred:function(e){var t=[["resolve","done",ae.Callbacks("once memory"),"resolved"],["reject","fail",ae.Callbacks("once memory"),"rejected"],["notify","progress",ae.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var e=arguments;return ae.Deferred(function(i){ae.each(t,function(t,a){var o=a[0],s=ae.isFunction(e[t])&&e[t];r[a[1]](function(){var e=s&&s.apply(this,arguments);e&&ae.isFunction(e.promise)?e.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[o+"With"](this===n?i.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?ae.extend(e,n):n}},r={};return n.pipe=n.then,ae.each(t,function(e,a){var o=a[2],s=a[3];n[a[1]]=o.add,s&&o.add(function(){i=s},t[1^e][2].disable,t[2][2].lock),r[a[0]]=function(){return r[a[0]+"With"](this===r?n:this,arguments),this},r[a[0]+"With"]=o.fireWith}),n.promise(r),e&&e.call(r,r),r},when:function(e){var t,i,n,r=0,a=ee.call(arguments),o=a.length,s=1!==o||e&&ae.isFunction(e.promise)?o:0,l=1===s?e:ae.Deferred(),c=function(e,i,n){return function(r){i[e]=this,n[e]=arguments.length>1?ee.call(arguments):r,n===t?l.notifyWith(i,n):--s||l.resolveWith(i,n)}};if(o>1)for(t=Array(o),i=Array(o),n=Array(o);o>r;r++)a[r]&&ae.isFunction(a[r].promise)?a[r].promise().done(c(r,n,a)).fail(l.reject).progress(c(r,i,t)):--s;return s||l.resolveWith(n,a),l.promise()}}),ae.support=function(t){var i=W.createElement("input"),n=W.createDocumentFragment(),r=W.createElement("div"),a=W.createElement("select"),o=a.appendChild(W.createElement("option"));return i.type?(i.type="checkbox",t.checkOn=""!==i.value,t.optSelected=o.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,i.checked=!0,t.noCloneChecked=i.cloneNode(!0).checked,a.disabled=!0,t.optDisabled=!o.disabled,i=W.createElement("input"),i.value="t",i.type="radio",t.radioValue="t"===i.value,i.setAttribute("checked","t"),i.setAttribute("name","t"),n.appendChild(i),t.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,r.style.backgroundClip="content-box",r.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===r.style.backgroundClip,ae(function(){var i,n,a=W.getElementsByTagName("body")[0];a&&(i=W.createElement("div"),i.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(i).appendChild(r),r.innerHTML="",r.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",ae.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===r.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(r,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(r,null)||{width:"4px"}).width,n=r.appendChild(W.createElement("div")),n.style.cssText=r.style.cssText="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",n.style.marginRight=n.style.width="0",r.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(n,null)||{}).marginRight)),a.removeChild(i))}),t):t}({});var me,ge,ve=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,ye=/([A-Z])/g;r.uid=1,r.accepts=function(e){return!e.nodeType||(1===e.nodeType||9===e.nodeType)},r.prototype={key:function(e){if(!r.accepts(e))return 0;var t={},i=e[this.expando];if(!i){i=r.uid++;try{t[this.expando]={value:i},Object.defineProperties(e,t)}catch(n){t[this.expando]=i,ae.extend(e,t)}}return this.cache[i]||(this.cache[i]={}),i},set:function(e,t,i){var n,r=this.key(e),a=this.cache[r];if("string"==typeof t)a[t]=i;else if(ae.isEmptyObject(a))ae.extend(this.cache[r],t);else for(n in t)a[n]=t[n];return a},get:function(e,i){var n=this.cache[this.key(e)];return i===t?n:n[i]},access:function(e,i,n){var r;return i===t||i&&"string"==typeof i&&n===t?(r=this.get(e,i),r!==t?r:this.get(e,ae.camelCase(i))):(this.set(e,i,n),n!==t?n:i)},remove:function(e,i){var n,r,a,o=this.key(e),s=this.cache[o];if(i===t)this.cache[o]={};else{ae.isArray(i)?r=i.concat(i.map(ae.camelCase)):(a=ae.camelCase(i),i in s?r=[i,a]:(r=a,r=r in s?[r]:r.match(se)||[])),n=r.length;for(;n--;)delete s[r[n]]}},hasData:function(e){return!ae.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}},me=new r,ge=new r,ae.extend({acceptData:r.accepts,hasData:function(e){return me.hasData(e)||ge.hasData(e)},data:function(e,t,i){return me.access(e,t,i)},removeData:function(e,t){me.remove(e,t)},_data:function(e,t,i){return ge.access(e,t,i)},_removeData:function(e,t){ge.remove(e,t)}}),ae.fn.extend({data:function(e,i){var n,r,o=this[0],s=0,l=null;if(e===t){if(this.length&&(l=me.get(o),1===o.nodeType&&!ge.get(o,"hasDataAttrs"))){for(n=o.attributes;n.length>s;s++)r=n[s].name,0===r.indexOf("data-")&&(r=ae.camelCase(r.slice(5)),a(o,r,l[r]));ge.set(o,"hasDataAttrs",!0)}return l}return"object"==typeof e?this.each(function(){me.set(this,e)}):ae.access(this,function(i){var n,r=ae.camelCase(e);if(o&&i===t){if((n=me.get(o,e))!==t)return n;if((n=me.get(o,r))!==t)return n;if((n=a(o,r,t))!==t)return n}else this.each(function(){var n=me.get(this,r);me.set(this,r,i),-1!==e.indexOf("-")&&n!==t&&me.set(this,e,i)})},null,i,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){me.remove(this,e)})}}),ae.extend({queue:function(e,i,n){var r;return e?(i=(i||"fx")+"queue",r=ge.get(e,i),n&&(!r||ae.isArray(n)?r=ge.access(e,i,ae.makeArray(n)):r.push(n)),r||[]):t},dequeue:function(e,t){t=t||"fx";var i=ae.queue(e,t),n=i.length,r=i.shift(),a=ae._queueHooks(e,t),o=function(){ae.dequeue(e,t)};"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===t&&i.unshift("inprogress"),delete a.stop,r.call(e,o,a)),!n&&a&&a.empty.fire()},_queueHooks:function(e,t){var i=t+"queueHooks";return ge.get(e,i)||ge.access(e,i,{empty:ae.Callbacks("once memory").add(function(){ge.remove(e,[t+"queue",i])})})}}),ae.fn.extend({queue:function(e,i){var n=2;return"string"!=typeof e&&(i=e,e="fx",n--),n>arguments.length?ae.queue(this[0],e):i===t?this:this.each(function(){var t=ae.queue(this,e,i);ae._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&ae.dequeue(this,e)})},dequeue:function(e){return this.each(function(){ae.dequeue(this,e)})},delay:function(e,t){return e=ae.fx?ae.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,i){var n=setTimeout(t,e);i.stop=function(){clearTimeout(n)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,i){var n,r=1,a=ae.Deferred(),o=this,s=this.length,l=function(){--r||a.resolveWith(o,[o])};for("string"!=typeof e&&(i=e,e=t),e=e||"fx";s--;)(n=ge.get(o[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(l));return l(),a.promise(i)}});var _e,be=/[\t\r\n\f]/g,we=/\r/g,xe=/^(?:input|select|textarea|button)$/i;ae.fn.extend({attr:function(e,t){return ae.access(this,ae.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){ae.removeAttr(this,e)})},prop:function(e,t){return ae.access(this,ae.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[ae.propFix[e]||e]})},addClass:function(e){var t,i,n,r,a,o=0,s=this.length,l="string"==typeof e&&e;if(ae.isFunction(e))return this.each(function(t){ae(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(se)||[];s>o;o++)if(i=this[o],n=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(be," "):" ")){for(a=0;r=t[a++];)0>n.indexOf(" "+r+" ")&&(n+=r+" ");i.className=ae.trim(n)}return this},removeClass:function(e){var t,i,n,r,a,o=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(ae.isFunction(e))return this.each(function(t){ae(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(se)||[];s>o;o++)if(i=this[o],n=1===i.nodeType&&(i.className?(" "+i.className+" ").replace(be," "):"")){for(a=0;r=t[a++];)for(;n.indexOf(" "+r+" ")>=0;)n=n.replace(" "+r+" "," ");i.className=e?ae.trim(n):""}return this},toggleClass:function(e,t){var i=typeof e;return"boolean"==typeof t&&"string"===i?t?this.addClass(e):this.removeClass(e):ae.isFunction(e)?this.each(function(i){ae(this).toggleClass(e.call(this,i,this.className,t),t)}):this.each(function(){if("string"===i)for(var t,n=0,r=ae(this),a=e.match(se)||[];t=a[n++];)r.hasClass(t)?r.removeClass(t):r.addClass(t);else(i===q||"boolean"===i)&&(this.className&&ge.set(this,"__className__",this.className),this.className=this.className||!1===e?"":ge.get(this,"__className__")||"")})},hasClass:function(e){for(var t=" "+e+" ",i=0,n=this.length;n>i;i++)if(1===this[i].nodeType&&(" "+this[i].className+" ").replace(be," ").indexOf(t)>=0)return!0;return!1},val:function(e){var i,n,r,a=this[0];return arguments.length?(r=ae.isFunction(e),this.each(function(n){var a;1===this.nodeType&&(a=r?e.call(this,n,ae(this).val()):e,null==a?a="":"number"==typeof a?a+="":ae.isArray(a)&&(a=ae.map(a,function(e){return null==e?"":e+""})),(i=ae.valHooks[this.type]||ae.valHooks[this.nodeName.toLowerCase()])&&"set"in i&&i.set(this,a,"value")!==t||(this.value=a))})):a?(i=ae.valHooks[a.type]||ae.valHooks[a.nodeName.toLowerCase()],i&&"get"in i&&(n=i.get(a,"value"))!==t?n:(n=a.value,"string"==typeof n?n.replace(we,""):null==n?"":n)):void 0}}),ae.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,i,n=e.options,r=e.selectedIndex,a="select-one"===e.type||0>r,o=a?null:[],s=a?r+1:n.length,l=0>r?s:a?r:0;s>l;l++)if(i=n[l],!(!i.selected&&l!==r||(ae.support.optDisabled?i.disabled:null!==i.getAttribute("disabled"))||i.parentNode.disabled&&ae.nodeName(i.parentNode,"optgroup"))){if(t=ae(i).val(),a)return t;o.push(t)}return o},set:function(e,t){for(var i,n,r=e.options,a=ae.makeArray(t),o=r.length;o--;)n=r[o],(n.selected=ae.inArray(ae(n).val(),a)>=0)&&(i=!0);return i||(e.selectedIndex=-1),a}}},attr:function(e,i,n){var r,a,o=e.nodeType;if(e&&3!==o&&8!==o&&2!==o)return typeof e.getAttribute===q?ae.prop(e,i,n):(1===o&&ae.isXMLDoc(e)||(i=i.toLowerCase(),r=ae.attrHooks[i]||(ae.expr.match.bool.test(i)?_e:void 0)),n===t?r&&"get"in r&&null!==(a=r.get(e,i))?a:(a=ae.find.attr(e,i),null==a?t:a):null!==n?r&&"set"in r&&(a=r.set(e,n,i))!==t?a:(e.setAttribute(i,n+""),n):(ae.removeAttr(e,i),t))},removeAttr:function(e,t){var i,n,r=0,a=t&&t.match(se);if(a&&1===e.nodeType)for(;i=a[r++];)n=ae.propFix[i]||i,ae.expr.match.bool.test(i)&&(e[n]=!1),e.removeAttribute(i)},attrHooks:{type:{set:function(e,t){if(!ae.support.radioValue&&"radio"===t&&ae.nodeName(e,"input")){var i=e.value;return e.setAttribute("type",t),i&&(e.value=i),t}}}},propFix:{for:"htmlFor",class:"className"},prop:function(e,i,n){var r,a,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!ae.isXMLDoc(e),o&&(i=ae.propFix[i]||i,a=ae.propHooks[i]),n!==t?a&&"set"in a&&(r=a.set(e,n,i))!==t?r:e[i]=n:a&&"get"in a&&null!==(r=a.get(e,i))?r:e[i]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||xe.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),_e={set:function(e,t,i){return!1===t?ae.removeAttr(e,i):e.setAttribute(i,i),i}},ae.each(ae.expr.match.bool.source.match(/\w+/g),function(e,i){var n=ae.expr.attrHandle[i]||ae.find.attr;ae.expr.attrHandle[i]=function(e,i,r){var a=ae.expr.attrHandle[i],o=r?t:(ae.expr.attrHandle[i]=t)!=n(e,i,r)?i.toLowerCase():null;return ae.expr.attrHandle[i]=a,o}}),ae.support.optSelected||(ae.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),ae.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ae.propFix[this.toLowerCase()]=this}),ae.each(["radio","checkbox"],function(){ae.valHooks[this]={set:function(e,i){return ae.isArray(i)?e.checked=ae.inArray(ae(e).val(),i)>=0:t}},ae.support.checkOn||(ae.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var ke=/^key/,Ce=/^(?:mouse|contextmenu)|click/,Te=/^(?:focusinfocus|focusoutblur)$/,Se=/^([^.]*)(?:\.(.+)|)$/;ae.event={global:{},add:function(e,i,n,r,a){var o,s,l,c,u,d,h,p,f,m,g,v=ge.get(e);if(v){for(n.handler&&(o=n,n=o.handler,a=o.selector),n.guid||(n.guid=ae.guid++),(c=v.events)||(c=v.events={}),(s=v.handle)||(s=v.handle=function(e){return typeof ae===q||e&&ae.event.triggered===e.type?t:ae.event.dispatch.apply(s.elem,arguments)},s.elem=e),i=(i||"").match(se)||[""],u=i.length;u--;)l=Se.exec(i[u])||[],f=g=l[1],m=(l[2]||"").split(".").sort(),f&&(h=ae.event.special[f]||{},f=(a?h.delegateType:h.bindType)||f,h=ae.event.special[f]||{},d=ae.extend({type:f,origType:g,data:r,handler:n,guid:n.guid,selector:a,needsContext:a&&ae.expr.match.needsContext.test(a),namespace:m.join(".")},o),(p=c[f])||(p=c[f]=[],p.delegateCount=0,h.setup&&!1!==h.setup.call(e,r,m,s)||e.addEventListener&&e.addEventListener(f,s,!1)),h.add&&(h.add.call(e,d),d.handler.guid||(d.handler.guid=n.guid)),a?p.splice(p.delegateCount++,0,d):p.push(d),ae.event.global[f]=!0);e=null}},remove:function(e,t,i,n,r){var a,o,s,l,c,u,d,h,p,f,m,g=ge.hasData(e)&&ge.get(e);if(g&&(l=g.events)){for(t=(t||"").match(se)||[""],c=t.length;c--;)if(s=Se.exec(t[c])||[],p=m=s[1],f=(s[2]||"").split(".").sort(),p){for(d=ae.event.special[p]||{},p=(n?d.delegateType:d.bindType)||p,h=l[p]||[],s=s[2]&&RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=a=h.length;a--;)u=h[a],!r&&m!==u.origType||i&&i.guid!==u.guid||s&&!s.test(u.namespace)||n&&n!==u.selector&&("**"!==n||!u.selector)||(h.splice(a,1),u.selector&&h.delegateCount--,d.remove&&d.remove.call(e,u));o&&!h.length&&(d.teardown&&!1!==d.teardown.call(e,f,g.handle)||ae.removeEvent(e,p,g.handle),delete l[p])}else for(p in l)ae.event.remove(e,p+t[c],i,n,!0);ae.isEmptyObject(l)&&(delete g.handle,ge.remove(e,"events"))}},trigger:function(i,n,r,a){var o,s,l,c,u,d,h,p=[r||W],f=ne.call(i,"type")?i.type:i,m=ne.call(i,"namespace")?i.namespace.split("."):[];if(s=l=r=r||W,3!==r.nodeType&&8!==r.nodeType&&!Te.test(f+ae.event.triggered)&&(f.indexOf(".")>=0&&(m=f.split("."),f=m.shift(),m.sort()),u=0>f.indexOf(":")&&"on"+f,i=i[ae.expando]?i:new ae.Event(f,"object"==typeof i&&i),i.isTrigger=a?2:3,i.namespace=m.join("."),i.namespace_re=i.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,i.result=t,i.target||(i.target=r),n=null==n?[i]:ae.makeArray(n,[i]),h=ae.event.special[f]||{},a||!h.trigger||!1!==h.trigger.apply(r,n))){if(!a&&!h.noBubble&&!ae.isWindow(r)){for(c=h.delegateType||f,Te.test(c+f)||(s=s.parentNode);s;s=s.parentNode)p.push(s),l=s;l===(r.ownerDocument||W)&&p.push(l.defaultView||l.parentWindow||e)}for(o=0;(s=p[o++])&&!i.isPropagationStopped();)i.type=o>1?c:h.bindType||f,d=(ge.get(s,"events")||{})[i.type]&&ge.get(s,"handle"),d&&d.apply(s,n),(d=u&&s[u])&&ae.acceptData(s)&&d.apply&&!1===d.apply(s,n)&&i.preventDefault();return i.type=f,a||i.isDefaultPrevented()||h._default&&!1!==h._default.apply(p.pop(),n)||!ae.acceptData(r)||u&&ae.isFunction(r[f])&&!ae.isWindow(r)&&(l=r[u],l&&(r[u]=null),ae.event.triggered=f,r[f](),ae.event.triggered=t,l&&(r[u]=l)),i.result}},dispatch:function(e){e=ae.event.fix(e);var i,n,r,a,o,s=[],l=ee.call(arguments),c=(ge.get(this,"events")||{})[e.type]||[],u=ae.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,e)){for(s=ae.event.handlers.call(this,e,c),i=0;(a=s[i++])&&!e.isPropagationStopped();)for(e.currentTarget=a.elem,n=0;(o=a.handlers[n++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,(r=((ae.event.special[o.origType]||{}).handle||o.handler).apply(a.elem,l))!==t&&!1===(e.result=r)&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,i){var n,r,a,o,s=[],l=i.delegateCount,c=e.target;if(l&&c.nodeType&&(!e.button||"click"!==e.type))for(;c!==this;c=c.parentNode||this)if(!0!==c.disabled||"click"!==e.type){for(r=[],n=0;l>n;n++)o=i[n],a=o.selector+" ",r[a]===t&&(r[a]=o.needsContext?ae(a,this).index(c)>=0:ae.find(a,this,null,[c]).length),r[a]&&r.push(o);r.length&&s.push({elem:c,handlers:r})}return i.length>l&&s.push({elem:this,handlers:i.slice(l)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,i){var n,r,a,o=i.button;return null==e.pageX&&null!=i.clientX&&(n=e.target.ownerDocument||W,r=n.documentElement,a=n.body,e.pageX=i.clientX+(r&&r.scrollLeft||a&&a.scrollLeft||0)-(r&&r.clientLeft||a&&a.clientLeft||0),e.pageY=i.clientY+(r&&r.scrollTop||a&&a.scrollTop||0)-(r&&r.clientTop||a&&a.clientTop||0)),e.which||o===t||(e.which=1&o?1:2&o?3:4&o?2:0),e}},fix:function(e){if(e[ae.expando])return e;var t,i,n,r=e.type,a=e,o=this.fixHooks[r];for(o||(this.fixHooks[r]=o=Ce.test(r)?this.mouseHooks:ke.test(r)?this.keyHooks:{}),n=o.props?this.props.concat(o.props):this.props,e=new ae.Event(a),t=n.length;t--;)i=n[t],e[i]=a[i];return e.target||(e.target=W),3===e.target.nodeType&&(e.target=e.target.parentNode),o.filter?o.filter(e,a):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==l()&&this.focus?(this.focus(),!1):t},delegateType:"focusin"},blur:{trigger:function(){return this===l()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&ae.nodeName(this,"input")?(this.click(),!1):t},_default:function(e){return ae.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,i,n){var r=ae.extend(new ae.Event,i,{type:e,isSimulated:!0,originalEvent:{}});n?ae.event.trigger(r,null,t):ae.event.dispatch.call(t,r),r.isDefaultPrevented()&&i.preventDefault()}},ae.removeEvent=function(e,t,i){e.removeEventListener&&e.removeEventListener(t,i,!1)},ae.Event=function(e,i){return this instanceof ae.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?o:s):this.type=e,i&&ae.extend(this,i),this.timeStamp=e&&e.timeStamp||ae.now(),this[ae.expando]=!0,t):new ae.Event(e,i)},ae.Event.prototype={isDefaultPrevented:s,isPropagationStopped:s,isImmediatePropagationStopped:s,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=o,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=o,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=o,this.stopPropagation()}},ae.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){ae.event.special[e]={delegateType:t,bindType:t,handle:function(e){var i,n=this,r=e.relatedTarget,a=e.handleObj;return(!r||r!==n&&!ae.contains(n,r))&&(e.type=a.origType,i=a.handler.apply(this,arguments),e.type=t),i}}}),ae.support.focusinBubbles||ae.each({focus:"focusin",blur:"focusout"},function(e,t){var i=0,n=function(e){ae.event.simulate(t,e.target,ae.event.fix(e),!0)};ae.event.special[t]={setup:function(){0==i++&&W.addEventListener(e,n,!0)},teardown:function(){0==--i&&W.removeEventListener(e,n,!0)}}}),ae.fn.extend({on:function(e,i,n,r,a){var o,l;if("object"==typeof e){"string"!=typeof i&&(n=n||i,i=t);for(l in e)this.on(l,i,n,e[l],a);return this}if(null==n&&null==r?(r=i,n=i=t):null==r&&("string"==typeof i?(r=n,n=t):(r=n,n=i,i=t)),!1===r)r=s;else if(!r)return this;return 1===a&&(o=r,r=function(e){return ae().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=ae.guid++)),this.each(function(){ae.event.add(this,e,r,n,i)})},one:function(e,t,i,n){return this.on(e,t,i,n,1)},off:function(e,i,n){var r,a;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ae(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(a in e)this.off(a,i,e[a]);return this}return(!1===i||"function"==typeof i)&&(n=i,i=t),!1===n&&(n=s),this.each(function(){ae.event.remove(this,e,n,i)})},trigger:function(e,t){return this.each(function(){ae.event.trigger(e,t,this)})},triggerHandler:function(e,i){var n=this[0];return n?ae.event.trigger(e,i,n,!0):t}});var Ee=/^.[^:#\[\.,]*$/,Ae=/^(?:parents|prev(?:Until|All))/,Ie=ae.expr.match.needsContext,De={children:!0,contents:!0,next:!0,prev:!0};ae.fn.extend({find:function(e){var t,i=[],n=this,r=n.length;if("string"!=typeof e)return this.pushStack(ae(e).filter(function(){for(t=0;r>t;t++)if(ae.contains(n[t],this))return!0}));for(t=0;r>t;t++)ae.find(e,n[t],i);return i=this.pushStack(r>1?ae.unique(i):i),i.selector=this.selector?this.selector+" "+e:e,i},has:function(e){var t=ae(e,this),i=t.length;return this.filter(function(){for(var e=0;i>e;e++)if(ae.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(u(this,e||[],!0))},filter:function(e){return this.pushStack(u(this,e||[],!1))},is:function(e){return!!u(this,"string"==typeof e&&Ie.test(e)?ae(e):e||[],!1).length},closest:function(e,t){for(var i,n=0,r=this.length,a=[],o=Ie.test(e)||"string"!=typeof e?ae(e,t||this.context):0;r>n;n++)for(i=this[n];i&&i!==t;i=i.parentNode)if(11>i.nodeType&&(o?o.index(i)>-1:1===i.nodeType&&ae.find.matchesSelector(i,e))){i=a.push(i);break}return this.pushStack(a.length>1?ae.unique(a):a)},index:function(e){return e?"string"==typeof e?te.call(ae(e),this[0]):te.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var i="string"==typeof e?ae(e,t):ae.makeArray(e&&e.nodeType?[e]:e),n=ae.merge(this.get(),i);return this.pushStack(ae.unique(n))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ae.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return ae.dir(e,"parentNode")},parentsUntil:function(e,t,i){return ae.dir(e,"parentNode",i)},next:function(e){return c(e,"nextSibling")},prev:function(e){return c(e,"previousSibling")},nextAll:function(e){return ae.dir(e,"nextSibling")},prevAll:function(e){return ae.dir(e,"previousSibling")},nextUntil:function(e,t,i){return ae.dir(e,"nextSibling",i)},prevUntil:function(e,t,i){return ae.dir(e,"previousSibling",i)},siblings:function(e){return ae.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return ae.sibling(e.firstChild)},contents:function(e){return e.contentDocument||ae.merge([],e.childNodes)}},function(e,t){ae.fn[e]=function(i,n){var r=ae.map(this,t,i);return"Until"!==e.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=ae.filter(n,r)),this.length>1&&(De[e]||ae.unique(r),Ae.test(e)&&r.reverse()),this.pushStack(r)}}),ae.extend({filter:function(e,t,i){var n=t[0];return i&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?ae.find.matchesSelector(n,e)?[n]:[]:ae.find.matches(e,ae.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,i,n){for(var r=[],a=n!==t;(e=e[i])&&9!==e.nodeType;)if(1===e.nodeType){if(a&&ae(e).is(n))break;r.push(e)}return r},sibling:function(e,t){for(var i=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i}});var Me=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Le=/<([\w:]+)/,Oe=/<|&#?\w+;/,Ne=/<(?:script|style|link)/i,Pe=/^(?:checkbox|radio)$/i,Re=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^$|\/(?:java|ecma)script/i,ze=/^true\/(.*)/,Fe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Be={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Be.optgroup=Be.option,Be.tbody=Be.tfoot=Be.colgroup=Be.caption=Be.thead,Be.th=Be.td,ae.fn.extend({text:function(e){return ae.access(this,function(e){return e===t?ae.text(this):this.empty().append((this[0]&&this[0].ownerDocument||W).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){d(this,e).appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=d(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){for(var i,n=e?ae.filter(e,this):this,r=0;null!=(i=n[r]);r++)t||1!==i.nodeType||ae.cleanData(g(i)),i.parentNode&&(t&&ae.contains(i.ownerDocument,i)&&f(g(i,"script")),i.parentNode.removeChild(i));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ae.cleanData(g(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ae.clone(this,e,t)})},html:function(e){return ae.access(this,function(e){var i=this[0]||{},n=0,r=this.length;if(e===t&&1===i.nodeType)return i.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!Be[(Le.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(Me,"<$1></$2>");try{for(;r>n;n++)i=this[n]||{},1===i.nodeType&&(ae.cleanData(g(i,!1)),i.innerHTML=e);i=0}catch(e){}}i&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=ae.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(i){var n=e[t++],r=e[t++];r&&(n&&n.parentNode!==r&&(n=this.nextSibling),ae(this).remove(),r.insertBefore(i,n))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,i){e=Z.apply([],e);var n,r,a,o,s,l,c=0,u=this.length,d=this,f=u-1,m=e[0],v=ae.isFunction(m);if(v||!(1>=u||"string"!=typeof m||ae.support.checkClone)&&Re.test(m))return this.each(function(n){var r=d.eq(n);v&&(e[0]=m.call(this,n,r.html())),r.domManip(e,t,i)});if(u&&(n=ae.buildFragment(e,this[0].ownerDocument,!1,!i&&this),r=n.firstChild,1===n.childNodes.length&&(n=r),r)){for(a=ae.map(g(n,"script"),h),o=a.length;u>c;c++)s=n,c!==f&&(s=ae.clone(s,!0,!0),o&&ae.merge(a,g(s,"script"))),t.call(this[c],s,c);if(o)for(l=a[a.length-1].ownerDocument,ae.map(a,p),c=0;o>c;c++)s=a[c],je.test(s.type||"")&&!ge.access(s,"globalEval")&&ae.contains(l,s)&&(s.src?ae._evalUrl(s.src):ae.globalEval(s.textContent.replace(Fe,"")))}return this}}),ae.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){ae.fn[e]=function(e){for(var i,n=[],r=ae(e),a=r.length-1,o=0;a>=o;o++)i=o===a?this:this.clone(!0),ae(r[o])[t](i),J.apply(n,i.get());return this.pushStack(n)}}),ae.extend({clone:function(e,t,i){var n,r,a,o,s=e.cloneNode(!0),l=ae.contains(e.ownerDocument,e);if(!(ae.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ae.isXMLDoc(e)))for(o=g(s),a=g(e),n=0,r=a.length;r>n;n++)v(a[n],o[n]);if(t)if(i)for(a=a||g(e),o=o||g(s),n=0,r=a.length;r>n;n++)m(a[n],o[n]);else m(e,s);return o=g(s,"script"),o.length>0&&f(o,!l&&g(e,"script")),s},buildFragment:function(e,t,i,n){for(var r,a,o,s,l,c,u=0,d=e.length,h=t.createDocumentFragment(),p=[];d>u;u++)if((r=e[u])||0===r)if("object"===ae.type(r))ae.merge(p,r.nodeType?[r]:r);else if(Oe.test(r)){for(a=a||h.appendChild(t.createElement("div")),o=(Le.exec(r)||["",""])[1].toLowerCase(),s=Be[o]||Be._default,a.innerHTML=s[1]+r.replace(Me,"<$1></$2>")+s[2],c=s[0];c--;)a=a.lastChild;ae.merge(p,a.childNodes),a=h.firstChild,a.textContent=""}else p.push(t.createTextNode(r));for(h.textContent="",u=0;r=p[u++];)if((!n||-1===ae.inArray(r,n))&&(l=ae.contains(r.ownerDocument,r),a=g(h.appendChild(r),"script"),l&&f(a),i))for(c=0;r=a[c++];)je.test(r.type||"")&&i.push(r);return h},cleanData:function(e){for(var i,n,a,o,s,l,c=ae.event.special,u=0;(n=e[u])!==t;u++){if(r.accepts(n)&&(s=n[ge.expando])&&(i=ge.cache[s])){if(a=Object.keys(i.events||{}),a.length)for(l=0;(o=a[l])!==t;l++)c[o]?ae.event.remove(n,o):ae.removeEvent(n,o,i.handle);ge.cache[s]&&delete ge.cache[s]}delete me.cache[n[me.expando]]}},_evalUrl:function(e){return ae.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})}}),ae.fn.extend({wrapAll:function(e){var t;return ae.isFunction(e)?this.each(function(t){ae(this).wrapAll(e.call(this,t))}):(this[0]&&(t=ae(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return ae.isFunction(e)?this.each(function(t){ae(this).wrapInner(e.call(this,t))}):this.each(function(){var t=ae(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){var t=ae.isFunction(e);return this.each(function(i){ae(this).wrapAll(t?e.call(this,i):e)})},unwrap:function(){return this.parent().each(function(){ae.nodeName(this,"body")||ae(this).replaceWith(this.childNodes)}).end()}});var Ue,$e,qe=/^(none|table(?!-c[ea]).+)/,He=/^margin/,We=RegExp("^("+oe+")(.*)$","i"),Ve=RegExp("^("+oe+")(?!px)[a-z%]+$","i"),Ge=RegExp("^([+-])=("+oe+")","i"),Ye={BODY:"block"},Ke={position:"absolute",visibility:"hidden",display:"block"},Xe={letterSpacing:0,fontWeight:400},Qe=["Top","Right","Bottom","Left"],Ze=["Webkit","O","Moz","ms"];ae.fn.extend({css:function(e,i){return ae.access(this,function(e,i,n){var r,a,o={},s=0;if(ae.isArray(i)){for(r=b(e),a=i.length;a>s;s++)o[i[s]]=ae.css(e,i[s],!1,r);return o}
|
||
return n!==t?ae.style(e,i,n):ae.css(e,i)},e,i,arguments.length>1)},show:function(){return w(this,!0)},hide:function(){return w(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){_(this)?ae(this).show():ae(this).hide()})}}),ae.extend({cssHooks:{opacity:{get:function(e,t){if(t){var i=Ue(e,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(e,i,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var a,o,s,l=ae.camelCase(i),c=e.style;return i=ae.cssProps[l]||(ae.cssProps[l]=y(c,l)),s=ae.cssHooks[i]||ae.cssHooks[l],n===t?s&&"get"in s&&(a=s.get(e,!1,r))!==t?a:c[i]:(o=typeof n,"string"===o&&(a=Ge.exec(n))&&(n=(a[1]+1)*a[2]+parseFloat(ae.css(e,i)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||ae.cssNumber[l]||(n+="px"),ae.support.clearCloneStyle||""!==n||0!==i.indexOf("background")||(c[i]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===t||(c[i]=n)),t)}},css:function(e,i,n,r){var a,o,s,l=ae.camelCase(i);return i=ae.cssProps[l]||(ae.cssProps[l]=y(e.style,l)),s=ae.cssHooks[i]||ae.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,n)),a===t&&(a=Ue(e,i,r)),"normal"===a&&i in Xe&&(a=Xe[i]),""===n||n?(o=parseFloat(a),!0===n||ae.isNumeric(o)?o||0:a):a}}),Ue=function(e,i,n){var r,a,o,s=n||b(e),l=s?s.getPropertyValue(i)||s[i]:t,c=e.style;return s&&(""!==l||ae.contains(e.ownerDocument,e)||(l=ae.style(e,i)),Ve.test(l)&&He.test(i)&&(r=c.width,a=c.minWidth,o=c.maxWidth,c.minWidth=c.maxWidth=c.width=l,l=s.width,c.width=r,c.minWidth=a,c.maxWidth=o)),l},ae.each(["height","width"],function(e,i){ae.cssHooks[i]={get:function(e,n,r){return n?0===e.offsetWidth&&qe.test(ae.css(e,"display"))?ae.swap(e,Ke,function(){return C(e,i,r)}):C(e,i,r):t},set:function(e,t,n){var r=n&&b(e);return x(e,t,n?k(e,i,n,ae.support.boxSizing&&"border-box"===ae.css(e,"boxSizing",!1,r),r):0)}}}),ae(function(){ae.support.reliableMarginRight||(ae.cssHooks.marginRight={get:function(e,i){return i?ae.swap(e,{display:"inline-block"},Ue,[e,"marginRight"]):t}}),!ae.support.pixelPosition&&ae.fn.position&&ae.each(["top","left"],function(e,i){ae.cssHooks[i]={get:function(e,n){return n?(n=Ue(e,i),Ve.test(n)?ae(e).position()[i]+"px":n):t}}})}),ae.expr&&ae.expr.filters&&(ae.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight},ae.expr.filters.visible=function(e){return!ae.expr.filters.hidden(e)}),ae.each({margin:"",padding:"",border:"Width"},function(e,t){ae.cssHooks[e+t]={expand:function(i){for(var n=0,r={},a="string"==typeof i?i.split(" "):[i];4>n;n++)r[e+Qe[n]+t]=a[n]||a[n-2]||a[0];return r}},He.test(e)||(ae.cssHooks[e+t].set=x)});var Je=/%20/g,et=/\[\]$/,tt=/\r?\n/g,it=/^(?:submit|button|image|reset|file)$/i,nt=/^(?:input|select|textarea|keygen)/i;ae.fn.extend({serialize:function(){return ae.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ae.prop(this,"elements");return e?ae.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ae(this).is(":disabled")&&nt.test(this.nodeName)&&!it.test(e)&&(this.checked||!Pe.test(e))}).map(function(e,t){var i=ae(this).val();return null==i?null:ae.isArray(i)?ae.map(i,function(e){return{name:t.name,value:e.replace(tt,"\r\n")}}):{name:t.name,value:i.replace(tt,"\r\n")}}).get()}}),ae.param=function(e,i){var n,r=[],a=function(e,t){t=ae.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(i===t&&(i=ae.ajaxSettings&&ae.ajaxSettings.traditional),ae.isArray(e)||e.jquery&&!ae.isPlainObject(e))ae.each(e,function(){a(this.name,this.value)});else for(n in e)E(n,e[n],i,a);return r.join("&").replace(Je,"+")},ae.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){ae.fn[t]=function(e,i){return arguments.length>0?this.on(t,null,e,i):this.trigger(t)}}),ae.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,i){return this.on(e,null,t,i)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,i,n){return this.on(t,e,i,n)},undelegate:function(e,t,i){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",i)}});var rt,at,ot=ae.now(),st=/\?/,lt=/#.*$/,ct=/([?&])_=[^&]*/,ut=/^(.*?):[ \t]*([^\r\n]*)$/gm,dt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ht=/^(?:GET|HEAD)$/,pt=/^\/\//,ft=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,mt=ae.fn.load,gt={},vt={},yt="*/".concat("*");try{at=H.href}catch(e){at=W.createElement("a"),at.href="",at=at.href}rt=ft.exec(at.toLowerCase())||[],ae.fn.load=function(e,i,n){if("string"!=typeof e&&mt)return mt.apply(this,arguments);var r,a,o,s=this,l=e.indexOf(" ");return l>=0&&(r=e.slice(l),e=e.slice(0,l)),ae.isFunction(i)?(n=i,i=t):i&&"object"==typeof i&&(a="POST"),s.length>0&&ae.ajax({url:e,type:a,dataType:"html",data:i}).done(function(e){o=arguments,s.html(r?ae("<div>").append(ae.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},ae.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ae.fn[t]=function(e){return this.on(t,e)}}),ae.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:at,type:"GET",isLocal:dt.test(rt[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":yt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":ae.parseJSON,"text xml":ae.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?D(D(e,ae.ajaxSettings),t):D(ae.ajaxSettings,e)},ajaxPrefilter:A(gt),ajaxTransport:A(vt),ajax:function(e,i){function n(e,i,n,s){var c,d,y,_,w,k=i;2!==b&&(b=2,l&&clearTimeout(l),r=t,o=s||"",x.readyState=e>0?4:0,c=e>=200&&300>e||304===e,n&&(_=M(h,x,n)),_=L(h,_,x,c),c?(h.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(ae.lastModified[a]=w),(w=x.getResponseHeader("etag"))&&(ae.etag[a]=w)),204===e||"HEAD"===h.type?k="nocontent":304===e?k="notmodified":(k=_.state,d=_.data,y=_.error,c=!y)):(y=k,(e||!k)&&(k="error",0>e&&(e=0))),x.status=e,x.statusText=(i||k)+"",c?m.resolveWith(p,[d,k,x]):m.rejectWith(p,[x,k,y]),x.statusCode(v),v=t,u&&f.trigger(c?"ajaxSuccess":"ajaxError",[x,h,c?d:y]),g.fireWith(p,[x,k]),u&&(f.trigger("ajaxComplete",[x,h]),--ae.active||ae.event.trigger("ajaxStop")))}"object"==typeof e&&(i=e,e=t),i=i||{};var r,a,o,s,l,c,u,d,h=ae.ajaxSetup({},i),p=h.context||h,f=h.context&&(p.nodeType||p.jquery)?ae(p):ae.event,m=ae.Deferred(),g=ae.Callbacks("once memory"),v=h.statusCode||{},y={},_={},b=0,w="canceled",x={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!s)for(s={};t=ut.exec(o);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?o:null},setRequestHeader:function(e,t){var i=e.toLowerCase();return b||(e=_[i]=_[i]||e,y[e]=t),this},overrideMimeType:function(e){return b||(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)v[t]=[v[t],e[t]];else x.always(e[x.status]);return this},abort:function(e){var t=e||w;return r&&r.abort(t),n(0,t),this}};if(m.promise(x).complete=g.add,x.success=x.done,x.error=x.fail,h.url=((e||h.url||at)+"").replace(lt,"").replace(pt,rt[1]+"//"),h.type=i.method||i.type||h.method||h.type,h.dataTypes=ae.trim(h.dataType||"*").toLowerCase().match(se)||[""],null==h.crossDomain&&(c=ft.exec(h.url.toLowerCase()),h.crossDomain=!(!c||c[1]===rt[1]&&c[2]===rt[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(rt[3]||("http:"===rt[1]?"80":"443")))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=ae.param(h.data,h.traditional)),I(gt,h,i,x),2===b)return x;u=h.global,u&&0==ae.active++&&ae.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!ht.test(h.type),a=h.url,h.hasContent||(h.data&&(a=h.url+=(st.test(a)?"&":"?")+h.data,delete h.data),!1===h.cache&&(h.url=ct.test(a)?a.replace(ct,"$1_="+ot++):a+(st.test(a)?"&":"?")+"_="+ot++)),h.ifModified&&(ae.lastModified[a]&&x.setRequestHeader("If-Modified-Since",ae.lastModified[a]),ae.etag[a]&&x.setRequestHeader("If-None-Match",ae.etag[a])),(h.data&&h.hasContent&&!1!==h.contentType||i.contentType)&&x.setRequestHeader("Content-Type",h.contentType),x.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+yt+"; q=0.01":""):h.accepts["*"]);for(d in h.headers)x.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(p,x,h)||2===b))return x.abort();w="abort";for(d in{success:1,error:1,complete:1})x[d](h[d]);if(r=I(vt,h,i,x)){x.readyState=1,u&&f.trigger("ajaxSend",[x,h]),h.async&&h.timeout>0&&(l=setTimeout(function(){x.abort("timeout")},h.timeout));try{b=1,r.send(y,n)}catch(e){if(!(2>b))throw e;n(-1,e)}}else n(-1,"No Transport");return x},getJSON:function(e,t,i){return ae.get(e,t,i,"json")},getScript:function(e,i){return ae.get(e,t,i,"script")}}),ae.each(["get","post"],function(e,i){ae[i]=function(e,n,r,a){return ae.isFunction(n)&&(a=a||r,r=n,n=t),ae.ajax({url:e,type:i,dataType:a,data:n,success:r})}}),ae.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return ae.globalEval(e),e}}}),ae.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ae.ajaxTransport("script",function(e){if(e.crossDomain){var t,i;return{send:function(n,r){t=ae("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",i=function(e){t.remove(),i=null,e&&r("error"===e.type?404:200,e.type)}),W.head.appendChild(t[0])},abort:function(){i&&i()}}}});var _t=[],bt=/(=)\?(?=&|$)|\?\?/;ae.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=_t.pop()||ae.expando+"_"+ot++;return this[e]=!0,e}}),ae.ajaxPrefilter("json jsonp",function(i,n,r){var a,o,s,l=!1!==i.jsonp&&(bt.test(i.url)?"url":"string"==typeof i.data&&!(i.contentType||"").indexOf("application/x-www-form-urlencoded")&&bt.test(i.data)&&"data");return l||"jsonp"===i.dataTypes[0]?(a=i.jsonpCallback=ae.isFunction(i.jsonpCallback)?i.jsonpCallback():i.jsonpCallback,l?i[l]=i[l].replace(bt,"$1"+a):!1!==i.jsonp&&(i.url+=(st.test(i.url)?"&":"?")+i.jsonp+"="+a),i.converters["script json"]=function(){return s||ae.error(a+" was not called"),s[0]},i.dataTypes[0]="json",o=e[a],e[a]=function(){s=arguments},r.always(function(){e[a]=o,i[a]&&(i.jsonpCallback=n.jsonpCallback,_t.push(a)),s&&ae.isFunction(o)&&o(s[0]),s=o=t}),"script"):t}),ae.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var wt=ae.ajaxSettings.xhr(),xt={0:200,1223:204},kt=0,Ct={};e.ActiveXObject&&ae(e).on("unload",function(){for(var e in Ct)Ct[e]();Ct=t}),ae.support.cors=!!wt&&"withCredentials"in wt,ae.support.ajax=wt=!!wt,ae.ajaxTransport(function(e){var i;return ae.support.cors||wt&&!e.crossDomain?{send:function(n,r){var a,o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(a in n)s.setRequestHeader(a,n[a]);i=function(e){return function(){i&&(delete Ct[o],i=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status||404,s.statusText):r(xt[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:t,s.getAllResponseHeaders()))}},s.onload=i(),s.onerror=i("error"),i=Ct[o=kt++]=i("abort"),s.send(e.hasContent&&e.data||null)},abort:function(){i&&i()}}:t});var Tt,St,Et=/^(?:toggle|show|hide)$/,At=RegExp("^(?:([+-])=|)("+oe+")([a-z%]*)$","i"),It=/queueHooks$/,Dt=[j],Mt={"*":[function(e,t){var i=this.createTween(e,t),n=i.cur(),r=At.exec(t),a=r&&r[3]||(ae.cssNumber[e]?"":"px"),o=(ae.cssNumber[e]||"px"!==a&&+n)&&At.exec(ae.css(i.elem,e)),s=1,l=20;if(o&&o[3]!==a){a=a||o[3],r=r||[],o=+n||1;do{s=s||".5",o/=s,ae.style(i.elem,e,o+a)}while(s!==(s=i.cur()/n)&&1!==s&&--l)}return r&&(o=i.start=+o||+n||0,i.unit=a,i.end=r[1]?o+(r[1]+1)*r[2]:+r[2]),i}]};ae.Animation=ae.extend(P,{tweener:function(e,t){ae.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var i,n=0,r=e.length;r>n;n++)i=e[n],Mt[i]=Mt[i]||[],Mt[i].unshift(t)},prefilter:function(e,t){t?Dt.unshift(e):Dt.push(e)}}),ae.Tween=z,z.prototype={constructor:z,init:function(e,t,i,n,r,a){this.elem=e,this.prop=i,this.easing=r||"swing",this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=a||(ae.cssNumber[i]?"":"px")},cur:function(){var e=z.propHooks[this.prop];return e&&e.get?e.get(this):z.propHooks._default.get(this)},run:function(e){var t,i=z.propHooks[this.prop];return this.pos=t=this.options.duration?ae.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):z.propHooks._default.set(this),this}},z.prototype.init.prototype=z.prototype,z.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=ae.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){ae.fx.step[e.prop]?ae.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[ae.cssProps[e.prop]]||ae.cssHooks[e.prop])?ae.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},z.propHooks.scrollTop=z.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ae.each(["toggle","show","hide"],function(e,t){var i=ae.fn[t];ae.fn[t]=function(e,n,r){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(F(t,!0),e,n,r)}}),ae.fn.extend({fadeTo:function(e,t,i,n){return this.filter(_).css("opacity",0).show().end().animate({opacity:t},e,i,n)},animate:function(e,t,i,n){var r=ae.isEmptyObject(e),a=ae.speed(t,i,n),o=function(){var t=P(this,ae.extend({},e),a);(r||ge.get(this,"finish"))&&t.stop(!0)};return o.finish=o,r||!1===a.queue?this.each(o):this.queue(a.queue,o)},stop:function(e,i,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=i,i=e,e=t),i&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",a=ae.timers,o=ge.get(this);if(i)o[i]&&o[i].stop&&r(o[i]);else for(i in o)o[i]&&o[i].stop&&It.test(i)&&r(o[i]);for(i=a.length;i--;)a[i].elem!==this||null!=e&&a[i].queue!==e||(a[i].anim.stop(n),t=!1,a.splice(i,1));(t||!n)&&ae.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,i=ge.get(this),n=i[e+"queue"],r=i[e+"queueHooks"],a=ae.timers,o=n?n.length:0;for(i.finish=!0,ae.queue(this,e,[]),r&&r.stop&&r.stop.call(this,!0),t=a.length;t--;)a[t].elem===this&&a[t].queue===e&&(a[t].anim.stop(!0),a.splice(t,1));for(t=0;o>t;t++)n[t]&&n[t].finish&&n[t].finish.call(this);delete i.finish})}}),ae.each({slideDown:F("show"),slideUp:F("hide"),slideToggle:F("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){ae.fn[e]=function(e,i,n){return this.animate(t,e,i,n)}}),ae.speed=function(e,t,i){var n=e&&"object"==typeof e?ae.extend({},e):{complete:i||!i&&t||ae.isFunction(e)&&e,duration:e,easing:i&&t||t&&!ae.isFunction(t)&&t};return n.duration=ae.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in ae.fx.speeds?ae.fx.speeds[n.duration]:ae.fx.speeds._default,(null==n.queue||!0===n.queue)&&(n.queue="fx"),n.old=n.complete,n.complete=function(){ae.isFunction(n.old)&&n.old.call(this),n.queue&&ae.dequeue(this,n.queue)},n},ae.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},ae.timers=[],ae.fx=z.prototype.init,ae.fx.tick=function(){var e,i=ae.timers,n=0;for(Tt=ae.now();i.length>n;n++)(e=i[n])()||i[n]!==e||i.splice(n--,1);i.length||ae.fx.stop(),Tt=t},ae.fx.timer=function(e){e()&&ae.timers.push(e)&&ae.fx.start()},ae.fx.interval=13,ae.fx.start=function(){St||(St=setInterval(ae.fx.tick,ae.fx.interval))},ae.fx.stop=function(){clearInterval(St),St=null},ae.fx.speeds={slow:600,fast:200,_default:400},ae.fx.step={},ae.expr&&ae.expr.filters&&(ae.expr.filters.animated=function(e){return ae.grep(ae.timers,function(t){return e===t.elem}).length}),ae.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){ae.offset.setOffset(this,e,t)});var i,n,r=this[0],a={top:0,left:0},o=r&&r.ownerDocument;return o?(i=o.documentElement,ae.contains(i,r)?(typeof r.getBoundingClientRect!==q&&(a=r.getBoundingClientRect()),n=B(o),{top:a.top+n.pageYOffset-i.clientTop,left:a.left+n.pageXOffset-i.clientLeft}):a):void 0},ae.offset={setOffset:function(e,t,i){var n,r,a,o,s,l,c,u=ae.css(e,"position"),d=ae(e),h={};"static"===u&&(e.style.position="relative"),s=d.offset(),a=ae.css(e,"top"),l=ae.css(e,"left"),c=("absolute"===u||"fixed"===u)&&(a+l).indexOf("auto")>-1,c?(n=d.position(),o=n.top,r=n.left):(o=parseFloat(a)||0,r=parseFloat(l)||0),ae.isFunction(t)&&(t=t.call(e,i,s)),null!=t.top&&(h.top=t.top-s.top+o),null!=t.left&&(h.left=t.left-s.left+r),"using"in t?t.using.call(e,h):d.css(h)}},ae.fn.extend({position:function(){if(this[0]){var e,t,i=this[0],n={top:0,left:0};return"fixed"===ae.css(i,"position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),ae.nodeName(e[0],"html")||(n=e.offset()),n.top+=ae.css(e[0],"borderTopWidth",!0),n.left+=ae.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-ae.css(i,"marginTop",!0),left:t.left-n.left-ae.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||V;e&&!ae.nodeName(e,"html")&&"static"===ae.css(e,"position");)e=e.offsetParent;return e||V})}}),ae.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(i,n){var r="pageYOffset"===n;ae.fn[i]=function(a){return ae.access(this,function(i,a,o){var s=B(i);return o===t?s?s[n]:i[a]:(s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):i[a]=o,t)},i,a,arguments.length,null)}}),ae.each({Height:"height",Width:"width"},function(e,i){ae.each({padding:"inner"+e,content:i,"":"outer"+e},function(n,r){ae.fn[r]=function(r,a){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(!0===r||!0===a?"margin":"border");return ae.access(this,function(i,n,r){var a;return ae.isWindow(i)?i.document.documentElement["client"+e]:9===i.nodeType?(a=i.documentElement,Math.max(i.body["scroll"+e],a["scroll"+e],i.body["offset"+e],a["offset"+e],a["client"+e])):r===t?ae.css(i,n,s):ae.style(i,n,r,s)},i,o?r:t,o,null)}})}),ae.fn.size=function(){return this.length},ae.fn.andSelf=ae.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=ae:"function"==typeof define&&define.amd&&define("jquery",[],function(){return ae}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=ae)}(window),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("moment",t):e.moment=t()}(this,function(){"use strict";function e(){return Li.apply(null,arguments)}function t(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function n(e,t){var i,n=[];for(i=0;i<e.length;++i)n.push(t(e[i],i));return n}function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(e,t){for(var i in t)r(t,i)&&(e[i]=t[i]);return r(t,"toString")&&(e.toString=t.toString),r(t,"valueOf")&&(e.valueOf=t.valueOf),e}function o(e,t,i,n){return Ee(e,t,i,n,!0).utc()}function s(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function l(e){return null==e._pf&&(e._pf=s()),e._pf}function c(e){if(null==e._isValid){var t=l(e);e._isValid=!(isNaN(e._d.getTime())||!(t.overflow<0)||t.empty||t.invalidMonth||t.invalidWeekday||t.nullInput||t.invalidFormat||t.userInvalidated),e._strict&&(e._isValid=e._isValid&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour)}return e._isValid}function u(e){var t=o(NaN);return null!=e?a(l(t),e):l(t).userInvalidated=!0,t}function d(e,t){var i,n,r;if(void 0!==t._isAMomentObject&&(e._isAMomentObject=t._isAMomentObject),void 0!==t._i&&(e._i=t._i),void 0!==t._f&&(e._f=t._f),void 0!==t._l&&(e._l=t._l),void 0!==t._strict&&(e._strict=t._strict),void 0!==t._tzm&&(e._tzm=t._tzm),void 0!==t._isUTC&&(e._isUTC=t._isUTC),void 0!==t._offset&&(e._offset=t._offset),void 0!==t._pf&&(e._pf=l(t)),void 0!==t._locale&&(e._locale=t._locale),Ni.length>0)for(i in Ni)n=Ni[i],void 0!==(r=t[n])&&(e[n]=r);return e}function h(t){d(this,t),this._d=new Date(t._d.getTime()),!1===Pi&&(Pi=!0,e.updateOffset(this),Pi=!1)}function p(e){return e instanceof h||null!=e&&null!=e._isAMomentObject}function f(e){return e<0?Math.ceil(e):Math.floor(e)}function m(e){var t=+e,i=0;return 0!==t&&isFinite(t)&&(i=f(t)),i}function g(e,t,i){var n,r=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),o=0;for(n=0;n<r;n++)(i&&e[n]!==t[n]||!i&&m(e[n])!==m(t[n]))&&o++;return o+a}function v(){}function y(e){return e?e.toLowerCase().replace("_","-"):e}function _(e){for(var t,i,n,r,a=0;a<e.length;){for(r=y(e[a]).split("-"),t=r.length,i=y(e[a+1]),i=i?i.split("-"):null;t>0;){if(n=b(r.slice(0,t).join("-")))return n;if(i&&i.length>=t&&g(r,i,!0)>=t-1)break;t--}a++}return null}function b(e){var t=null;if(!Ri[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=Oi._abbr,require("./locale/"+e),w(t)}catch(e){}return Ri[e]}function w(e,t){var i;return e&&(i=void 0===t?k(e):x(e,t))&&(Oi=i),Oi._abbr}function x(e,t){return null!==t?(t.abbr=e,Ri[e]=Ri[e]||new v,Ri[e].set(t),w(e),Ri[e]):(delete Ri[e],null)}function k(e){var i;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Oi;if(!t(e)){if(i=b(e))return i;e=[e]}return _(e)}function C(e,t){var i=e.toLowerCase();ji[i]=ji[i+"s"]=ji[t]=e}function T(e){return"string"==typeof e?ji[e]||ji[e.toLowerCase()]:void 0}function S(e){var t,i,n={};for(i in e)r(e,i)&&(t=T(i))&&(n[t]=e[i]);return n}function E(t,i){return function(n){return null!=n?(I(this,t,n),e.updateOffset(this,i),this):A(this,t)}}function A(e,t){return e._d["get"+(e._isUTC?"UTC":"")+t]()}function I(e,t,i){return e._d["set"+(e._isUTC?"UTC":"")+t](i)}function D(e,t){var i;if("object"==typeof e)for(i in e)this.set(i,e[i]);else if(e=T(e),"function"==typeof this[e])return this[e](t);return this}function M(e,t,i){var n=""+Math.abs(e),r=t-n.length;return(e>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+n}function L(e,t,i,n){var r=n;"string"==typeof n&&(r=function(){return this[n]()}),e&&(Ui[e]=r),t&&(Ui[t[0]]=function(){return M(r.apply(this,arguments),t[1],t[2])}),i&&(Ui[i]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function O(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function N(e){var t,i,n=e.match(zi);for(t=0,i=n.length;t<i;t++)Ui[n[t]]?n[t]=Ui[n[t]]:n[t]=O(n[t]);return function(r){var a="";for(t=0;t<i;t++)a+=n[t]instanceof Function?n[t].call(r,e):n[t];return a}}function P(e,t){return e.isValid()?(t=R(t,e.localeData()),Bi[t]=Bi[t]||N(t),Bi[t](e)):e.localeData().invalidDate()}function R(e,t){function i(e){return t.longDateFormat(e)||e}var n=5;for(Fi.lastIndex=0;n>=0&&Fi.test(e);)e=e.replace(Fi,i),Fi.lastIndex=0,n-=1;return e}function j(e){return"function"==typeof e&&"[object Function]"===Object.prototype.toString.call(e)}function z(e,t,i){nn[e]=j(t)?t:function(e){return e&&i?i:t}}function F(e,t){return r(nn,e)?nn[e](t._strict,t._locale):new RegExp(B(e))}function B(e){return e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,i,n,r){return t||i||n||r}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function U(e,t){var i,n=t;for("string"==typeof e&&(e=[e]),"number"==typeof t&&(n=function(e,i){i[t]=m(e)}),i=0;i<e.length;i++)rn[e[i]]=n}function $(e,t){U(e,function(e,i,n,r){n._w=n._w||{},t(e,n._w,n,r)})}function q(e,t,i){null!=t&&r(rn,e)&&rn[e](t,i._a,i,e)}function H(e,t){return new Date(Date.UTC(e,t+1,0)).getUTCDate()}function W(e){return this._months[e.month()]}function V(e){return this._monthsShort[e.month()]}function G(e,t,i){var n,r,a;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(r=o([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(a="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[n]=new RegExp(a.replace(".",""),"i")),i&&"MMMM"===t&&this._longMonthsParse[n].test(e))return n;if(i&&"MMM"===t&&this._shortMonthsParse[n].test(e))return n;if(!i&&this._monthsParse[n].test(e))return n}}function Y(e,t){var i;return"string"==typeof t&&"number"!=typeof(t=e.localeData().monthsParse(t))?e:(i=Math.min(e.date(),H(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,i),e)}function K(t){return null!=t?(Y(this,t),e.updateOffset(this,!0),this):A(this,"Month")}function X(){return H(this.year(),this.month())}function Q(e){var t,i=e._a;return i&&-2===l(e).overflow&&(t=i[on]<0||i[on]>11?on:i[sn]<1||i[sn]>H(i[an],i[on])?sn:i[ln]<0||i[ln]>24||24===i[ln]&&(0!==i[cn]||0!==i[un]||0!==i[dn])?ln:i[cn]<0||i[cn]>59?cn:i[un]<0||i[un]>59?un:i[dn]<0||i[dn]>999?dn:-1,l(e)._overflowDayOfYear&&(t<an||t>sn)&&(t=sn),l(e).overflow=t),e}function Z(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function J(e,t){var i=!0;return a(function(){return i&&(Z(e+"\n"+(new Error).stack),i=!1),t.apply(this,arguments)},t)}function ee(e,t){fn[e]||(Z(t),fn[e]=!0)}function te(e){var t,i,n=e._i,r=mn.exec(n);if(r){for(l(e).iso=!0,t=0,i=gn.length;t<i;t++)if(gn[t][1].exec(n)){e._f=gn[t][0];break}for(t=0,i=vn.length;t<i;t++)if(vn[t][1].exec(n)){e._f+=(r[6]||" ")+vn[t][0];break}n.match(Ji)&&(e._f+="Z"),be(e)}else e._isValid=!1}function ie(t){var i=yn.exec(t._i);if(null!==i)return void(t._d=new Date(+i[1]));te(t),!1===t._isValid&&(delete t._isValid,e.createFromInputFallback(t))}function ne(e,t,i,n,r,a,o){var s=new Date(e,t,i,n,r,a,o);return e<1970&&s.setFullYear(e),s}function re(e){var t=new Date(Date.UTC.apply(null,arguments));return e<1970&&t.setUTCFullYear(e),t}function ae(e){return oe(e)?366:365}function oe(e){return e%4==0&&e%100!=0||e%400==0}function se(){return oe(this.year())}function le(e,t,i){var n,r=i-t,a=i-e.day();return a>r&&(a-=7),a<r-7&&(a+=7),n=Ae(e).add(a,"d"),{week:Math.ceil(n.dayOfYear()/7),year:n.year()}}function ce(e){return le(e,this._week.dow,this._week.doy).week}function ue(){return this._week.dow}function de(){return this._week.doy}function he(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function pe(e){var t=le(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function fe(e,t,i,n,r){var a,o=6+r-n,s=re(e,0,1+o),l=s.getUTCDay();return l<r&&(l+=7),i=null!=i?1*i:r,a=1+o+7*(t-1)-l+i,{year:a>0?e:e-1,dayOfYear:a>0?a:ae(e-1)+a}}function me(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")}function ge(e,t,i){return null!=e?e:null!=t?t:i}function ve(e){var t=new Date;return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function ye(e){var t,i,n,r,a=[];if(!e._d){for(n=ve(e),e._w&&null==e._a[sn]&&null==e._a[on]&&_e(e),e._dayOfYear&&(r=ge(e._a[an],n[an]),e._dayOfYear>ae(r)&&(l(e)._overflowDayOfYear=!0),i=re(r,0,e._dayOfYear),e._a[on]=i.getUTCMonth(),e._a[sn]=i.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=a[t]=n[t];for(;t<7;t++)e._a[t]=a[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[ln]&&0===e._a[cn]&&0===e._a[un]&&0===e._a[dn]&&(e._nextDay=!0,e._a[ln]=0),e._d=(e._useUTC?re:ne).apply(null,a),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[ln]=24)}}function _e(e){var t,i,n,r,a,o,s;t=e._w,null!=t.GG||null!=t.W||null!=t.E?(a=1,o=4,i=ge(t.GG,e._a[an],le(Ae(),1,4).year),n=ge(t.W,1),r=ge(t.E,1)):(a=e._locale._week.dow,o=e._locale._week.doy,i=ge(t.gg,e._a[an],le(Ae(),a,o).year),n=ge(t.w,1),null!=t.d?(r=t.d)<a&&++n:r=null!=t.e?t.e+a:a),s=fe(i,n,r,o,a),e._a[an]=s.year,e._dayOfYear=s.dayOfYear}function be(t){if(t._f===e.ISO_8601)return void te(t);t._a=[],l(t).empty=!0;var i,n,r,a,o,s=""+t._i,c=s.length,u=0;for(r=R(t._f,t._locale).match(zi)||[],i=0;i<r.length;i++)a=r[i],n=(s.match(F(a,t))||[])[0],n&&(o=s.substr(0,s.indexOf(n)),o.length>0&&l(t).unusedInput.push(o),s=s.slice(s.indexOf(n)+n.length),u+=n.length),Ui[a]?(n?l(t).empty=!1:l(t).unusedTokens.push(a),q(a,n,t)):t._strict&&!n&&l(t).unusedTokens.push(a);l(t).charsLeftOver=c-u,s.length>0&&l(t).unusedInput.push(s),!0===l(t).bigHour&&t._a[ln]<=12&&t._a[ln]>0&&(l(t).bigHour=void 0),t._a[ln]=we(t._locale,t._a[ln],t._meridiem),ye(t),Q(t)}function we(e,t,i){var n;return null==i?t:null!=e.meridiemHour?e.meridiemHour(t,i):null!=e.isPM?(n=e.isPM(i),n&&t<12&&(t+=12),n||12!==t||(t=0),t):t}function xe(e){var t,i,n,r,o;if(0===e._f.length)return l(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<e._f.length;r++)o=0,t=d({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],be(t),c(t)&&(o+=l(t).charsLeftOver,o+=10*l(t).unusedTokens.length,l(t).score=o,(null==n||o<n)&&(n=o,i=t));a(e,i||t)}function ke(e){if(!e._d){var t=S(e._i);e._a=[t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],ye(e)}}function Ce(e){var t=new h(Q(Te(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function Te(e){var n=e._i,r=e._f;return e._locale=e._locale||k(e._l),null===n||void 0===r&&""===n?u({nullInput:!0}):("string"==typeof n&&(e._i=n=e._locale.preparse(n)),p(n)?new h(Q(n)):(t(r)?xe(e):r?be(e):i(n)?e._d=n:Se(e),e))}function Se(r){var a=r._i;void 0===a?r._d=new Date:i(a)?r._d=new Date(+a):"string"==typeof a?ie(r):t(a)?(r._a=n(a.slice(0),function(e){return parseInt(e,10)}),ye(r)):"object"==typeof a?ke(r):"number"==typeof a?r._d=new Date(a):e.createFromInputFallback(r)}function Ee(e,t,i,n,r){var a={};return"boolean"==typeof i&&(n=i,i=void 0),a._isAMomentObject=!0,a._useUTC=a._isUTC=r,a._l=i,a._i=e,a._f=t,a._strict=n,Ce(a)}function Ae(e,t,i,n){return Ee(e,t,i,n,!1)}function Ie(e,i){var n,r;if(1===i.length&&t(i[0])&&(i=i[0]),!i.length)return Ae();for(n=i[0],r=1;r<i.length;++r)i[r].isValid()&&!i[r][e](n)||(n=i[r]);return n}function De(){return Ie("isBefore",[].slice.call(arguments,0))}function Me(){return Ie("isAfter",[].slice.call(arguments,0))}function Le(e){var t=S(e),i=t.year||0,n=t.quarter||0,r=t.month||0,a=t.week||0,o=t.day||0,s=t.hour||0,l=t.minute||0,c=t.second||0,u=t.millisecond||0;this._milliseconds=+u+1e3*c+6e4*l+36e5*s,this._days=+o+7*a,this._months=+r+3*n+12*i,this._data={},this._locale=k(),this._bubble()}function Oe(e){return e instanceof Le}function Ne(e,t){L(e,0,0,function(){var e=this.utcOffset(),i="+";return e<0&&(e=-e,i="-"),i+M(~~(e/60),2)+t+M(~~e%60,2)})}function Pe(e){var t=(e||"").match(Ji)||[],i=t[t.length-1]||[],n=(i+"").match(kn)||["-",0,0],r=60*n[1]+m(n[2]);return"+"===n[0]?r:-r}function Re(t,n){var r,a;return n._isUTC?(r=n.clone(),a=(p(t)||i(t)?+t:+Ae(t))-+r,r._d.setTime(+r._d+a),e.updateOffset(r,!1),r):Ae(t).local()}function je(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function ze(t,i){var n,r=this._offset||0;return null!=t?("string"==typeof t&&(t=Pe(t)),Math.abs(t)<16&&(t*=60),!this._isUTC&&i&&(n=je(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),r!==t&&(!i||this._changeInProgress?et(this,Ke(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),
|
||
this._changeInProgress=null)),this):this._isUTC?r:je(this)}function Fe(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Be(e){return this.utcOffset(0,e)}function Ue(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(je(this),"m")),this}function $e(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Pe(this._i)),this}function qe(e){return e=e?Ae(e).utcOffset():0,(this.utcOffset()-e)%60==0}function He(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function We(){if(void 0!==this._isDSTShifted)return this._isDSTShifted;var e={};if(d(e,this),e=Te(e),e._a){var t=e._isUTC?o(e._a):Ae(e._a);this._isDSTShifted=this.isValid()&&g(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Ve(){return!this._isUTC}function Ge(){return this._isUTC}function Ye(){return this._isUTC&&0===this._offset}function Ke(e,t){var i,n,a,o=e,s=null;return Oe(e)?o={ms:e._milliseconds,d:e._days,M:e._months}:"number"==typeof e?(o={},t?o[t]=e:o.milliseconds=e):(s=Cn.exec(e))?(i="-"===s[1]?-1:1,o={y:0,d:m(s[sn])*i,h:m(s[ln])*i,m:m(s[cn])*i,s:m(s[un])*i,ms:m(s[dn])*i}):(s=Tn.exec(e))?(i="-"===s[1]?-1:1,o={y:Xe(s[2],i),M:Xe(s[3],i),d:Xe(s[4],i),h:Xe(s[5],i),m:Xe(s[6],i),s:Xe(s[7],i),w:Xe(s[8],i)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(a=Ze(Ae(o.from),Ae(o.to)),o={},o.ms=a.milliseconds,o.M=a.months),n=new Le(o),Oe(e)&&r(e,"_locale")&&(n._locale=e._locale),n}function Xe(e,t){var i=e&&parseFloat(e.replace(",","."));return(isNaN(i)?0:i)*t}function Qe(e,t){var i={milliseconds:0,months:0};return i.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(i.months,"M").isAfter(t)&&--i.months,i.milliseconds=+t-+e.clone().add(i.months,"M"),i}function Ze(e,t){var i;return t=Re(t,e),e.isBefore(t)?i=Qe(e,t):(i=Qe(t,e),i.milliseconds=-i.milliseconds,i.months=-i.months),i}function Je(e,t){return function(i,n){var r,a;return null===n||isNaN(+n)||(ee(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period)."),a=i,i=n,n=a),i="string"==typeof i?+i:i,r=Ke(i,n),et(this,r,e),this}}function et(t,i,n,r){var a=i._milliseconds,o=i._days,s=i._months;r=null==r||r,a&&t._d.setTime(+t._d+a*n),o&&I(t,"Date",A(t,"Date")+o*n),s&&Y(t,A(t,"Month")+s*n),r&&e.updateOffset(t,o||s)}function tt(e,t){var i=e||Ae(),n=Re(i,this).startOf("day"),r=this.diff(n,"days",!0),a=r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse";return this.format(t&&t[a]||this.localeData().calendar(a,this,Ae(i)))}function it(){return new h(this)}function nt(e,t){return t=T(void 0!==t?t:"millisecond"),"millisecond"===t?(e=p(e)?e:Ae(e),+this>+e):(p(e)?+e:+Ae(e))<+this.clone().startOf(t)}function rt(e,t){var i;return t=T(void 0!==t?t:"millisecond"),"millisecond"===t?(e=p(e)?e:Ae(e),+this<+e):(i=p(e)?+e:+Ae(e),+this.clone().endOf(t)<i)}function at(e,t,i){return this.isAfter(e,i)&&this.isBefore(t,i)}function ot(e,t){var i;return t=T(t||"millisecond"),"millisecond"===t?(e=p(e)?e:Ae(e),+this==+e):(i=+Ae(e),+this.clone().startOf(t)<=i&&i<=+this.clone().endOf(t))}function st(e,t,i){var n,r,a=Re(e,this),o=6e4*(a.utcOffset()-this.utcOffset());return t=T(t),"year"===t||"month"===t||"quarter"===t?(r=lt(this,a),"quarter"===t?r/=3:"year"===t&&(r/=12)):(n=this-a,r="second"===t?n/1e3:"minute"===t?n/6e4:"hour"===t?n/36e5:"day"===t?(n-o)/864e5:"week"===t?(n-o)/6048e5:n),i?r:f(r)}function lt(e,t){var i,n,r=12*(t.year()-e.year())+(t.month()-e.month()),a=e.clone().add(r,"months");return t-a<0?(i=e.clone().add(r-1,"months"),n=(t-a)/(a-i)):(i=e.clone().add(r+1,"months"),n=(t-a)/(i-a)),-(r+n)}function ct(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ut(){var e=this.clone().utc();return 0<e.year()&&e.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():P(e,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):P(e,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function dt(t){var i=P(this,t||e.defaultFormat);return this.localeData().postformat(i)}function ht(e,t){return this.isValid()?Ke({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function pt(e){return this.from(Ae(),e)}function ft(e,t){return this.isValid()?Ke({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function mt(e){return this.to(Ae(),e)}function gt(e){var t;return void 0===e?this._locale._abbr:(t=k(e),null!=t&&(this._locale=t),this)}function vt(){return this._locale}function yt(e){switch(e=T(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===e&&this.weekday(0),"isoWeek"===e&&this.isoWeekday(1),"quarter"===e&&this.month(3*Math.floor(this.month()/3)),this}function _t(e){return e=T(e),void 0===e||"millisecond"===e?this:this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms")}function bt(){return+this._d-6e4*(this._offset||0)}function wt(){return Math.floor(+this/1e3)}function xt(){return this._offset?new Date(+this):this._d}function kt(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Ct(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function Tt(){return c(this)}function St(){return a({},l(this))}function Et(){return l(this).overflow}function At(e,t){L(0,[e,e.length],0,t)}function It(e,t,i){return le(Ae([e,11,31+t-i]),t,i).week}function Dt(e){var t=le(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==e?t:this.add(e-t,"y")}function Mt(e){var t=le(this,1,4).year;return null==e?t:this.add(e-t,"y")}function Lt(){return It(this.year(),1,4)}function Ot(){var e=this.localeData()._week;return It(this.year(),e.dow,e.doy)}function Nt(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function Pt(e,t){return"string"!=typeof e?e:isNaN(e)?(e=t.weekdaysParse(e),"number"==typeof e?e:null):parseInt(e,10)}function Rt(e){return this._weekdays[e.day()]}function jt(e){return this._weekdaysShort[e.day()]}function zt(e){return this._weekdaysMin[e.day()]}function Ft(e){var t,i,n;for(this._weekdaysParse=this._weekdaysParse||[],t=0;t<7;t++)if(this._weekdaysParse[t]||(i=Ae([2e3,1]).day(t),n="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[t]=new RegExp(n.replace(".",""),"i")),this._weekdaysParse[t].test(e))return t}function Bt(e){var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=Pt(e,this.localeData()),this.add(e-t,"d")):t}function Ut(e){var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function $t(e){return null==e?this.day()||7:this.day(this.day()%7?e:e-7)}function qt(e,t){L(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function Ht(e,t){return t._meridiemParse}function Wt(e){return"p"===(e+"").toLowerCase().charAt(0)}function Vt(e,t,i){return e>11?i?"pm":"PM":i?"am":"AM"}function Gt(e,t){t[dn]=m(1e3*("0."+e))}function Yt(){return this._isUTC?"UTC":""}function Kt(){return this._isUTC?"Coordinated Universal Time":""}function Xt(e){return Ae(1e3*e)}function Qt(){return Ae.apply(null,arguments).parseZone()}function Zt(e,t,i){var n=this._calendar[e];return"function"==typeof n?n.call(t,i):n}function Jt(e){var t=this._longDateFormat[e],i=this._longDateFormat[e.toUpperCase()];return t||!i?t:(this._longDateFormat[e]=i.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])}function ei(){return this._invalidDate}function ti(e){return this._ordinal.replace("%d",e)}function ii(e){return e}function ni(e,t,i,n){var r=this._relativeTime[i];return"function"==typeof r?r(e,t,i,n):r.replace(/%d/i,e)}function ri(e,t){var i=this._relativeTime[e>0?"future":"past"];return"function"==typeof i?i(t):i.replace(/%s/i,t)}function ai(e){var t,i;for(i in e)t=e[i],"function"==typeof t?this[i]=t:this["_"+i]=t;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function oi(e,t,i,n){var r=k(),a=o().set(n,t);return r[i](a,e)}function si(e,t,i,n,r){if("number"==typeof e&&(t=e,e=void 0),e=e||"",null!=t)return oi(e,t,i,r);var a,o=[];for(a=0;a<n;a++)o[a]=oi(e,a,i,r);return o}function li(e,t){return si(e,t,"months",12,"month")}function ci(e,t){return si(e,t,"monthsShort",12,"month")}function ui(e,t){return si(e,t,"weekdays",7,"day")}function di(e,t){return si(e,t,"weekdaysShort",7,"day")}function hi(e,t){return si(e,t,"weekdaysMin",7,"day")}function pi(){var e=this._data;return this._milliseconds=Vn(this._milliseconds),this._days=Vn(this._days),this._months=Vn(this._months),e.milliseconds=Vn(e.milliseconds),e.seconds=Vn(e.seconds),e.minutes=Vn(e.minutes),e.hours=Vn(e.hours),e.months=Vn(e.months),e.years=Vn(e.years),this}function fi(e,t,i,n){var r=Ke(t,i);return e._milliseconds+=n*r._milliseconds,e._days+=n*r._days,e._months+=n*r._months,e._bubble()}function mi(e,t){return fi(this,e,t,1)}function gi(e,t){return fi(this,e,t,-1)}function vi(e){return e<0?Math.floor(e):Math.ceil(e)}function yi(){var e,t,i,n,r,a=this._milliseconds,o=this._days,s=this._months,l=this._data;return a>=0&&o>=0&&s>=0||a<=0&&o<=0&&s<=0||(a+=864e5*vi(bi(s)+o),o=0,s=0),l.milliseconds=a%1e3,e=f(a/1e3),l.seconds=e%60,t=f(e/60),l.minutes=t%60,i=f(t/60),l.hours=i%24,o+=f(i/24),r=f(_i(o)),s+=r,o-=vi(bi(r)),n=f(s/12),s%=12,l.days=o,l.months=s,l.years=n,this}function _i(e){return 4800*e/146097}function bi(e){return 146097*e/4800}function wi(e){var t,i,n=this._milliseconds;if("month"===(e=T(e))||"year"===e)return t=this._days+n/864e5,i=this._months+_i(t),"month"===e?i:i/12;switch(t=this._days+Math.round(bi(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return 24*t+n/36e5;case"minute":return 1440*t+n/6e4;case"second":return 86400*t+n/1e3;case"millisecond":return Math.floor(864e5*t)+n;default:throw new Error("Unknown unit "+e)}}function xi(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*m(this._months/12)}function ki(e){return function(){return this.as(e)}}function Ci(e){return e=T(e),this[e+"s"]()}function Ti(e){return function(){return this._data[e]}}function Si(){return f(this.days()/7)}function Ei(e,t,i,n,r){return r.relativeTime(t||1,!!i,e,n)}function Ai(e,t,i){var n=Ke(e).abs(),r=lr(n.as("s")),a=lr(n.as("m")),o=lr(n.as("h")),s=lr(n.as("d")),l=lr(n.as("M")),c=lr(n.as("y")),u=r<cr.s&&["s",r]||1===a&&["m"]||a<cr.m&&["mm",a]||1===o&&["h"]||o<cr.h&&["hh",o]||1===s&&["d"]||s<cr.d&&["dd",s]||1===l&&["M"]||l<cr.M&&["MM",l]||1===c&&["y"]||["yy",c];return u[2]=t,u[3]=+e>0,u[4]=i,Ei.apply(null,u)}function Ii(e,t){return void 0!==cr[e]&&(void 0===t?cr[e]:(cr[e]=t,!0))}function Di(e){var t=this.localeData(),i=Ai(this,!e,t);return e&&(i=t.pastFuture(+this,i)),t.postformat(i)}function Mi(){var e,t,i,n=ur(this._milliseconds)/1e3,r=ur(this._days),a=ur(this._months);e=f(n/60),t=f(e/60),n%=60,e%=60,i=f(a/12),a%=12;var o=i,s=a,l=r,c=t,u=e,d=n,h=this.asSeconds();return h?(h<0?"-":"")+"P"+(o?o+"Y":"")+(s?s+"M":"")+(l?l+"D":"")+(c||u||d?"T":"")+(c?c+"H":"")+(u?u+"M":"")+(d?d+"S":""):"P0D"}var Li,Oi,Ni=e.momentProperties=[],Pi=!1,Ri={},ji={},zi=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Fi=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Bi={},Ui={},$i=/\d/,qi=/\d\d/,Hi=/\d{3}/,Wi=/\d{4}/,Vi=/[+-]?\d{6}/,Gi=/\d\d?/,Yi=/\d{1,3}/,Ki=/\d{1,4}/,Xi=/[+-]?\d{1,6}/,Qi=/\d+/,Zi=/[+-]?\d+/,Ji=/Z|[+-]\d\d:?\d\d/gi,en=/[+-]?\d+(\.\d{1,3})?/,tn=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,nn={},rn={},an=0,on=1,sn=2,ln=3,cn=4,un=5,dn=6;L("M",["MM",2],"Mo",function(){return this.month()+1}),L("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),L("MMMM",0,0,function(e){return this.localeData().months(this,e)}),C("month","M"),z("M",Gi),z("MM",Gi,qi),z("MMM",tn),z("MMMM",tn),U(["M","MM"],function(e,t){t[on]=m(e)-1}),U(["MMM","MMMM"],function(e,t,i,n){var r=i._locale.monthsParse(e,n,i._strict);null!=r?t[on]=r:l(i).invalidMonth=e});var hn="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),pn="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),fn={};e.suppressDeprecationWarnings=!1;var mn=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],vn=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],yn=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=J("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),L(0,["YY",2],0,function(){return this.year()%100}),L(0,["YYYY",4],0,"year"),L(0,["YYYYY",5],0,"year"),L(0,["YYYYYY",6,!0],0,"year"),C("year","y"),z("Y",Zi),z("YY",Gi,qi),z("YYYY",Ki,Wi),z("YYYYY",Xi,Vi),z("YYYYYY",Xi,Vi),U(["YYYYY","YYYYYY"],an),U("YYYY",function(t,i){i[an]=2===t.length?e.parseTwoDigitYear(t):m(t)}),U("YY",function(t,i){i[an]=e.parseTwoDigitYear(t)}),e.parseTwoDigitYear=function(e){return m(e)+(m(e)>68?1900:2e3)};var _n=E("FullYear",!1);L("w",["ww",2],"wo","week"),L("W",["WW",2],"Wo","isoWeek"),C("week","w"),C("isoWeek","W"),z("w",Gi),z("ww",Gi,qi),z("W",Gi),z("WW",Gi,qi),$(["w","ww","W","WW"],function(e,t,i,n){t[n.substr(0,1)]=m(e)});var bn={dow:0,doy:6};L("DDD",["DDDD",3],"DDDo","dayOfYear"),C("dayOfYear","DDD"),z("DDD",Yi),z("DDDD",Hi),U(["DDD","DDDD"],function(e,t,i){i._dayOfYear=m(e)}),e.ISO_8601=function(){};var wn=J("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var e=Ae.apply(null,arguments);return e<this?this:e}),xn=J("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var e=Ae.apply(null,arguments);return e>this?this:e});Ne("Z",":"),Ne("ZZ",""),z("Z",Ji),z("ZZ",Ji),U(["Z","ZZ"],function(e,t,i){i._useUTC=!0,i._tzm=Pe(e)});var kn=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Cn=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Tn=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Ke.fn=Le.prototype;var Sn=Je(1,"add"),En=Je(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var An=J("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});L(0,["gg",2],0,function(){return this.weekYear()%100}),L(0,["GG",2],0,function(){return this.isoWeekYear()%100}),At("gggg","weekYear"),At("ggggg","weekYear"),At("GGGG","isoWeekYear"),At("GGGGG","isoWeekYear"),C("weekYear","gg"),C("isoWeekYear","GG"),z("G",Zi),z("g",Zi),z("GG",Gi,qi),z("gg",Gi,qi),z("GGGG",Ki,Wi),z("gggg",Ki,Wi),z("GGGGG",Xi,Vi),z("ggggg",Xi,Vi),$(["gggg","ggggg","GGGG","GGGGG"],function(e,t,i,n){t[n.substr(0,2)]=m(e)}),$(["gg","GG"],function(t,i,n,r){i[r]=e.parseTwoDigitYear(t)}),L("Q",0,0,"quarter"),C("quarter","Q"),z("Q",$i),U("Q",function(e,t){t[on]=3*(m(e)-1)}),L("D",["DD",2],"Do","date"),C("date","D"),z("D",Gi),z("DD",Gi,qi),z("Do",function(e,t){return e?t._ordinalParse:t._ordinalParseLenient}),U(["D","DD"],sn),U("Do",function(e,t){t[sn]=m(e.match(Gi)[0],10)});var In=E("Date",!0);L("d",0,"do","day"),L("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),L("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),L("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),L("e",0,0,"weekday"),L("E",0,0,"isoWeekday"),C("day","d"),C("weekday","e"),C("isoWeekday","E"),z("d",Gi),z("e",Gi),z("E",Gi),z("dd",tn),z("ddd",tn),z("dddd",tn),$(["dd","ddd","dddd"],function(e,t,i){var n=i._locale.weekdaysParse(e);null!=n?t.d=n:l(i).invalidWeekday=e}),$(["d","e","E"],function(e,t,i,n){t[n]=m(e)});var Dn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Mn="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ln="Su_Mo_Tu_We_Th_Fr_Sa".split("_");L("H",["HH",2],0,"hour"),L("h",["hh",2],0,function(){return this.hours()%12||12}),qt("a",!0),qt("A",!1),C("hour","h"),z("a",Ht),z("A",Ht),z("H",Gi),z("h",Gi),z("HH",Gi,qi),z("hh",Gi,qi),U(["H","HH"],ln),U(["a","A"],function(e,t,i){i._isPm=i._locale.isPM(e),i._meridiem=e}),U(["h","hh"],function(e,t,i){t[ln]=m(e),l(i).bigHour=!0});var On=/[ap]\.?m?\.?/i,Nn=E("Hours",!0);L("m",["mm",2],0,"minute"),C("minute","m"),z("m",Gi),z("mm",Gi,qi),U(["m","mm"],cn);var Pn=E("Minutes",!1);L("s",["ss",2],0,"second"),C("second","s"),z("s",Gi),z("ss",Gi,qi),U(["s","ss"],un);var Rn=E("Seconds",!1);L("S",0,0,function(){return~~(this.millisecond()/100)}),L(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),L(0,["SSS",3],0,"millisecond"),L(0,["SSSS",4],0,function(){return 10*this.millisecond()}),L(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),L(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),L(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),L(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),L(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),C("millisecond","ms"),z("S",Yi,$i),z("SS",Yi,qi),z("SSS",Yi,Hi);var jn;for(jn="SSSS";jn.length<=9;jn+="S")z(jn,Qi);for(jn="S";jn.length<=9;jn+="S")U(jn,Gt);var zn=E("Milliseconds",!1);L("z",0,0,"zoneAbbr"),L("zz",0,0,"zoneName");var Fn=h.prototype;Fn.add=Sn,Fn.calendar=tt,Fn.clone=it,Fn.diff=st,Fn.endOf=_t,Fn.format=dt,Fn.from=ht,Fn.fromNow=pt,Fn.to=ft,Fn.toNow=mt,Fn.get=D,Fn.invalidAt=Et,Fn.isAfter=nt,Fn.isBefore=rt,Fn.isBetween=at,Fn.isSame=ot,Fn.isValid=Tt,Fn.lang=An,Fn.locale=gt,Fn.localeData=vt,Fn.max=xn,Fn.min=wn,Fn.parsingFlags=St,Fn.set=D,Fn.startOf=yt,Fn.subtract=En,Fn.toArray=kt,Fn.toObject=Ct,Fn.toDate=xt,Fn.toISOString=ut,Fn.toJSON=ut,Fn.toString=ct,Fn.unix=wt,Fn.valueOf=bt,Fn.year=_n,Fn.isLeapYear=se,Fn.weekYear=Dt,Fn.isoWeekYear=Mt,Fn.quarter=Fn.quarters=Nt,Fn.month=K,Fn.daysInMonth=X,Fn.week=Fn.weeks=he,Fn.isoWeek=Fn.isoWeeks=pe,Fn.weeksInYear=Ot,Fn.isoWeeksInYear=Lt,Fn.date=In,Fn.day=Fn.days=Bt,Fn.weekday=Ut,Fn.isoWeekday=$t,Fn.dayOfYear=me,Fn.hour=Fn.hours=Nn,Fn.minute=Fn.minutes=Pn,Fn.second=Fn.seconds=Rn,Fn.millisecond=Fn.milliseconds=zn,Fn.utcOffset=ze,Fn.utc=Be,Fn.local=Ue,Fn.parseZone=$e,Fn.hasAlignedHourOffset=qe,Fn.isDST=He,Fn.isDSTShifted=We,Fn.isLocal=Ve,Fn.isUtcOffset=Ge,Fn.isUtc=Ye,Fn.isUTC=Ye,Fn.zoneAbbr=Yt,Fn.zoneName=Kt,Fn.dates=J("dates accessor is deprecated. Use date instead.",In),Fn.months=J("months accessor is deprecated. Use month instead",K),Fn.years=J("years accessor is deprecated. Use year instead",_n),Fn.zone=J("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Fe);var Bn=Fn,Un={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},$n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},qn=/\d{1,2}/,Hn={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Wn=v.prototype;Wn._calendar=Un,Wn.calendar=Zt,Wn._longDateFormat=$n,Wn.longDateFormat=Jt,Wn._invalidDate="Invalid date",Wn.invalidDate=ei,Wn._ordinal="%d",Wn.ordinal=ti,Wn._ordinalParse=qn,Wn.preparse=ii,Wn.postformat=ii,Wn._relativeTime=Hn,Wn.relativeTime=ni,Wn.pastFuture=ri,Wn.set=ai,Wn.months=W,Wn._months=hn,Wn.monthsShort=V,Wn._monthsShort=pn,Wn.monthsParse=G,Wn.week=ce,Wn._week=bn,Wn.firstDayOfYear=de,Wn.firstDayOfWeek=ue,Wn.weekdays=Rt,Wn._weekdays=Dn,Wn.weekdaysMin=zt,Wn._weekdaysMin=Ln,Wn.weekdaysShort=jt,Wn._weekdaysShort=Mn,Wn.weekdaysParse=Ft,Wn.isPM=Wt,Wn._meridiemParse=On,Wn.meridiem=Vt,w("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===m(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),e.lang=J("moment.lang is deprecated. Use moment.locale instead.",w),e.langData=J("moment.langData is deprecated. Use moment.localeData instead.",k);var Vn=Math.abs,Gn=ki("ms"),Yn=ki("s"),Kn=ki("m"),Xn=ki("h"),Qn=ki("d"),Zn=ki("w"),Jn=ki("M"),er=ki("y"),tr=Ti("milliseconds"),ir=Ti("seconds"),nr=Ti("minutes"),rr=Ti("hours"),ar=Ti("days"),or=Ti("months"),sr=Ti("years"),lr=Math.round,cr={s:45,m:45,h:22,d:26,M:11},ur=Math.abs,dr=Le.prototype;dr.abs=pi,dr.add=mi,dr.subtract=gi,dr.as=wi,dr.asMilliseconds=Gn,dr.asSeconds=Yn,dr.asMinutes=Kn,dr.asHours=Xn,dr.asDays=Qn,dr.asWeeks=Zn,dr.asMonths=Jn,dr.asYears=er,dr.valueOf=xi,dr._bubble=yi,dr.get=Ci,dr.milliseconds=tr,dr.seconds=ir,dr.minutes=nr,dr.hours=rr,dr.days=ar,dr.weeks=Si,dr.months=or,dr.years=sr,dr.humanize=Di,dr.toISOString=Mi,dr.toString=Mi,dr.toJSON=Mi,dr.locale=gt,dr.localeData=vt,dr.toIsoString=J("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Mi),dr.lang=An,L("X",0,0,"unix"),L("x",0,0,"valueOf"),z("x",Zi),z("X",en),U("X",function(e,t,i){i._d=new Date(1e3*parseFloat(e,10))}),U("x",function(e,t,i){i._d=new Date(m(e))}),e.version="2.10.3",function(e){Li=e}(Ae),e.fn=Bn,e.min=De,e.max=Me,e.utc=o,e.unix=Xt,e.months=li,e.isDate=i,e.locale=w,e.invalid=u,e.duration=Ke,e.isMoment=p,e.weekdays=ui,e.parseZone=Qt,e.localeData=k,e.isDuration=Oe,e.monthsShort=ci,e.weekdaysMin=hi,e.defineLocale=x,e.weekdaysShort=di,e.normalizeUnits=T,e.relativeTimeThreshold=Ii;var hr=e,pr=(hr.defineLocale("zh-cn",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),longDateFormat:{LT:"Ah点mm分",LTS:"Ah点m分s秒",L:"YYYY-MM-DD",LL:"YYYY年MMMD日",LLL:"YYYY年MMMD日Ah点mm分",LLLL:"YYYY年MMMD日ddddAh点mm分",l:"YYYY-MM-DD",ll:"YYYY年MMMD日",lll:"YYYY年MMMD日Ah点mm分",llll:"YYYY年MMMD日ddddAh点mm分"},meridiemParse:/凌晨|早上|上午|中午|下午|晚上/,meridiemHour:function(e,t){return 12===e&&(e=0),"凌晨"===t||"早上"===t||"上午"===t?e:"下午"===t||"晚上"===t?e+12:e>=11?e:e+12},meridiem:function(e,t,i){var n=100*e+t;return n<600?"凌晨":n<900?"早上":n<1130?"上午":n<1230?"中午":n<1800?"下午":"晚上"},calendar:{sameDay:function(){return 0===this.minutes()?"[今天]Ah[点整]":"[今天]LT"},nextDay:function(){return 0===this.minutes()?"[明天]Ah[点整]":"[明天]LT"},lastDay:function(){return 0===this.minutes()?"[昨天]Ah[点整]":"[昨天]LT"},nextWeek:function(){var e,t;return e=hr().startOf("week"),t=this.unix()-e.unix()>=604800?"[下]":"[本]",0===this.minutes()?t+"dddAh点整":t+"dddAh点mm"},lastWeek:function(){var e,t;return e=hr().startOf("week"),t=this.unix()<e.unix()?"[上]":"[本]",0===this.minutes()?t+"dddAh点整":t+"dddAh点mm"},sameElse:"LL"},ordinalParse:/\d{1,2}(日|月|周)/,ordinal:function(e,t){switch(t){case"d":case"D":case"DDD":return e+"日";case"M":return e+"月";case"w":case"W":return e+"周";default:return e}},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},week:{dow:1,doy:4}}),hr);return pr.locale("en"),pr}),define("toastr",["jquery"],function(e){return function(){function t(e,t,i){return f({type:w.error,iconClass:m().iconClasses.error,message:e,optionsOverride:i,title:t})}function i(t,i){return t||(t=m()),v=e("#"+t.containerId),v.length?v:(i&&(v=d(t)),v)}function n(e,t,i){return f({type:w.info,iconClass:m().iconClasses.info,message:e,optionsOverride:i,title:t})}function r(e){y=e}function a(e,t,i){return f({type:w.success,iconClass:m().iconClasses.success,message:e,optionsOverride:i,title:t})}function o(e,t,i){return f({type:w.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:i,title:t})}function s(e,t){var n=m();v||i(n),u(e,n,t)||c(n)}function l(t){var n=m();if(v||i(n),t&&0===e(":focus",t).length)return void g(t);v.children().length&&v.remove()}function c(t){for(var i=v.children(),n=i.length-1;n>=0;n--)u(e(i[n]),t)}function u(t,i,n){var r=!(!n||!n.force)&&n.force;return!(!t||!r&&0!==e(":focus",t).length)&&(t[i.hideMethod]({duration:i.hideDuration,easing:i.hideEasing,complete:function(){g(t)}}),!0)}function d(t){return v=e("<div/>").attr("id",t.containerId).addClass(t.positionClass),v.appendTo(e(t.target)),v}function h(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,closeOnHover:!0,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">×</button>',closeClass:"toast-close-button",newestOnTop:!0,preventDuplicates:!1,progressBar:!1,progressClass:"toast-progress",rtl:!1}}function p(e){y&&y(e)}function f(t){function n(e){return null==e&&(e=""),e.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function r(){var e="";switch(t.iconClass){case"toast-success":case"toast-info":e="polite";break;default:e="assertive"}T.attr("aria-live",e)}function a(){t.iconClass&&T.addClass(x.toastClass).addClass(k)}function o(){x.newestOnTop?v.prepend(T):v.append(T)}function s(){if(t.title){var e=t.title;x.escapeHtml&&(e=n(t.title)),S.append(e).addClass(x.titleClass),T.append(S)}}function l(){if(t.message){var e=t.message;x.escapeHtml&&(e=n(t.message)),E.append(e).addClass(x.messageClass),T.append(E)}}function c(){x.closeButton&&(I.addClass(x.closeClass).attr("role","button"),T.prepend(I))}function u(){x.progressBar&&(A.addClass(x.progressClass),T.prepend(A))}function d(){x.rtl&&T.addClass("rtl")}function h(t){var i=t&&!1!==x.closeMethod?x.closeMethod:x.hideMethod,n=t&&!1!==x.closeDuration?x.closeDuration:x.hideDuration,r=t&&!1!==x.closeEasing?x.closeEasing:x.hideEasing;if(!e(":focus",T).length||t)return clearTimeout(D.intervalId),T[i]({duration:n,easing:r,complete:function(){g(T),clearTimeout(C),x.onHidden&&"hidden"!==M.state&&x.onHidden(),M.state="hidden",M.endTime=new Date,p(M)}})}function f(){(x.timeOut>0||x.extendedTimeOut>0)&&(C=setTimeout(h,x.extendedTimeOut),D.maxHideTime=parseFloat(x.extendedTimeOut),D.hideEta=(new Date).getTime()+D.maxHideTime)}function y(){clearTimeout(C),D.hideEta=0,T.stop(!0,!0)[x.showMethod]({duration:x.showDuration,easing:x.showEasing})}function w(){var e=(D.hideEta-(new Date).getTime())/D.maxHideTime*100;A.width(e+"%")}var x=m(),k=t.iconClass||x.iconClass;if(void 0!==t.optionsOverride&&(x=e.extend(x,t.optionsOverride),k=t.optionsOverride.iconClass||k),!function(e,t){if(e.preventDuplicates){if(t.message===_)return!0;_=t.message}return!1}(x,t)){b++,v=i(x,!0);var C=null,T=e("<div/>"),S=e("<div/>"),E=e("<div/>"),A=e("<div/>"),I=e(x.closeHtml),D={intervalId:null,hideEta:null,maxHideTime:null},M={toastId:b,state:"visible",startTime:new Date,options:x,map:t};return function(){a(),s(),l(),c(),u(),d(),o(),r()}(),function(){T.hide(),T[x.showMethod]({duration:x.showDuration,easing:x.showEasing,complete:x.onShown}),x.timeOut>0&&(C=setTimeout(h,x.timeOut),D.maxHideTime=parseFloat(x.timeOut),D.hideEta=(new Date).getTime()+D.maxHideTime,x.progressBar&&(D.intervalId=setInterval(w,10)))}(),function(){x.closeOnHover&&T.hover(y,f),!x.onclick&&x.tapToDismiss&&T.click(h),x.closeButton&&I&&I.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&!0!==e.cancelBubble&&(e.cancelBubble=!0),x.onCloseClick&&x.onCloseClick(e),h(!0)}),x.onclick&&T.click(function(e){x.onclick(e),h()})}(),p(M),x.debug&&console&&console.log(M),T}}function m(){return e.extend({},h(),x.options)}function g(e){v||(v=i()),e.is(":visible")||(e.remove(),e=null,0===v.children().length&&(v.remove(),_=void 0))}var v,y,_,b=0,w={error:"error",info:"info",success:"success",warning:"warning"},x={clear:s,remove:l,error:t,getContainer:i,info:n,options:{},subscribe:r,success:a,version:"2.1.4",warning:o};return x}()}),define("text",["module"],function(e){"use strict";var t,i,n=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],r=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,a=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,o="undefined"!=typeof location&&location.href,s=o&&location.protocol&&location.protocol.replace(/\:/,""),l=o&&location.hostname,c=o&&(location.port||void 0),u=[],d=e.config&&e.config()||{};return t={version:"2.0.3",strip:function(e){if(e){e=e.replace(r,"");var t=e.match(a);t&&(e=t[1])}else e="";return e},jsEscape:function(e){return e.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:d.createXhr||function(){var e,t,i;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;t<3;t+=1){i=n[t];try{e=new ActiveXObject(i)}catch(e){}if(e){n=[i];break}}return e},parseName:function(e){var t=!1,i=e.indexOf("."),n=e.substring(0,i),r=e.substring(i+1,e.length);return i=r.indexOf("!"),-1!==i&&(t=r.substring(i+1,r.length),t="strip"===t,r=r.substring(0,i)),{moduleName:n,ext:r,strip:t}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,i,n,r){var a,o,s,l=t.xdRegExp.exec(e);return!l||(a=l[2],o=l[3],o=o.split(":"),s=o[1],o=o[0],!(a&&a!==i||o&&o.toLowerCase()!==n.toLowerCase()||(s||o)&&s!==r))},finishLoad:function(e,i,n,r){n=i?t.strip(n):n,d.isBuild&&(u[e]=n),r(n)},load:function(e,i,n,r){if(r.isBuild&&!r.inlineText)return void n();d.isBuild=r.isBuild;var a=t.parseName(e),u=a.moduleName+"."+a.ext,h=i.toUrl(u),p=d.useXhr||t.useXhr;!o||p(h,s,l,c)?t.get(h,function(i){t.finishLoad(e,a.strip,i,n)},function(e){n.error&&n.error(e)}):i([u],function(e){t.finishLoad(a.moduleName+"."+a.ext,a.strip,e,n)})},write:function(e,i,n,r){if(u.hasOwnProperty(i)){var a=t.jsEscape(u[i]);n.asModule(e+"!"+i,"define(function () { return '"+a+"';});\n")}},writeFile:function(e,i,n,r,a){var o=t.parseName(i),s=o.moduleName+"."+o.ext,l=n.toUrl(o.moduleName+"."+o.ext)+".js";t.load(s,n,function(i){var n=function(e){return r(l,e)};n.asModule=function(e,t){return r.asModule(e,l,t)},t.write(e,s,n,a)},a)}},"node"===d.env||!d.env&&"undefined"!=typeof process&&process.versions&&process.versions.node?(i=require.nodeRequire("fs"),t.get=function(e,t){var n=i.readFileSync(e,"utf8");0===n.indexOf("\ufeff")&&(n=n.substring(1)),t(n)}):"xhr"===d.env||!d.env&&t.createXhr()?t.get=function(e,i,n){var r=t.createXhr();r.open("GET",e,!0),d.onXhr&&d.onXhr(r,e),r.onreadystatechange=function(t){var a,o;4===r.readyState&&(a=r.status,a>399&&a<600?(o=new Error(e+" HTTP status: "+a),o.xhr=r,n(o)):i(r.responseText))},r.send(null)}:("rhino"===d.env||!d.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java)&&(t.get=function(e,t){var i,n,r=new java.io.File(e),a=java.lang.System.getProperty("line.separator"),o=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(r),"utf-8")),s="";try{for(i=new java.lang.StringBuffer,n=o.readLine(),n&&n.length()&&65279===n.charAt(0)&&(n=n.substring(1)),i.append(n);null!==(n=o.readLine());)i.append(a),
|
||
i.append(n);s=String(i.toString())}finally{o.close()}t(s)}),t}),define("text!public/js/utils/msg.json",[],function(){return'{\r\n "language": {\r\n "zh-hans": {\r\n "op_success": "操作已完成",\r\n "common_tip": "请求数据报错。"\r\n },\r\n "en": {\r\n \r\n "operateError": "Operate Error:Reason:{0}"\r\n }\r\n }\r\n}'}),define("app-utils",["jquery","moment","toastr","text!public/js/utils/msg.json"],function(e,t,i,n){var r={init_toastr:function(){e.fn.extend({fadeInRight:function(){e(this).show().css({left:e(this).width()}),e(this).animate({left:"0px"},180,"linear")},fadeOutRight:function(t){e(this).animate({left:e(this).width()},180,"linear",function(){e(this).hide().css({left:"0"}),t.complete()})}}),i.options={closeButton:!1,debug:!1,positionClass:"toast-bottom-right",showDuration:"300",hideDuration:"1000",timeOut:"5000",extendedTimeOut:"1000",showEasing:"swing",hideEasing:"linear",showMethod:"fadeInRight",hideMethod:"fadeOutRight",closeOnHover:!1,preventDuplicates:!0}},i18n:JSON.parse(n).language[SDC.t.LANG],showMsgSuccess:function(){this.msg_success(this.i18n.op_success,{offset:"rt",icon:"6",closeBtn:2,time:3e3})},showPrompt:function(t,i,n,r){var a=e(".qc-modal");a.length<1&&(a=e('<div class="qc-modal"></div>'),e("body").append(a)),a.css("display","block"),e("#header").length<1&&a.addClass("fullScreen");var o=a.find(".promptDialog");o.length<1?(o=e('<div class="promptDialog"><div class="header">'+t+'<a href="javascript:;" class="closeModal"></a></div><div class="msg">'+i+'</div><div class="buttonArea">'+n+"</div></div>"),a.append(o)):(o.find(".header").html(t),o.find(".msg").html(i),o.find(".buttonArea").html(n)),o.addClass("scaleOut"),setTimeout(function(){o.removeClass("scaleOut").addClass("scaleIn")},10);var s=e(">div",a),l=0;return s.each(function(){e(this).is(".promptDialog")||(r?e(this).remove():(++l,e(this).is(":visible")?(e(this).attr("lastVisible","true"),e(this).removeClass("scaleIn").addClass("scaleOut")):e(this).attr("lastVisible","false")))}),0===l&&(a.removeClass("fadeOut").addClass("fadeIn").show(),o.removeClass("scaleIn").addClass("scaleOut"),setTimeout(function(){o.removeClass("scaleOut").addClass("scaleIn")},10)),o.find(".closeModal").on("click",function(){var t=e(".qc-modal"),i=e(this).parents(".promptDialog").eq(0);i.removeClass("scaleIn").addClass("scaleOut");var n=t.find('[lastVisible="true"]');n.length>0?(n.each(function(){e(this).attr("lastVisible","false"),e(this).removeClass("scaleOut").addClass("scaleIn")}),i.one("webkitAnimationEnd animationend",function(){i.remove(),t.attr("style","")})):(t.removeClass("fadeIn").addClass("fadeOut"),t.one("webkitAnimationEnd animationend",function(){i.remove(),t.hasClass("fadeIn")||t.attr("style","")}))}),o},pushNotification:function(e,t,i,n){},displayConfirmDialog:function(t,i,n,r){var a=this;this.showPrompt(t,i,'<a href="javascript:;" class="buttonOk">'+n+"</a>").find(".buttonOk").one("click",function(){var t=e(".qc-modal"),i=e(this).parents(".promptDialog").eq(0);i.removeClass("scaleIn").addClass("scaleOut");var n=t.find('[lastVisible="true"]');n.length>0?(n.each(function(){e(this).attr("lastVisible","false"),e(this).removeClass("scaleOut").addClass("scaleIn")}),a.bindAnimationEndEvent(i,function(){i.remove(),t.attr("style","")})):(t.removeClass("fadeIn").addClass("fadeOut"),a.bindAnimationEndEvent(t,function(){i.remove(),t.attr("style","")})),r&&r()})},displayError:function(t,i,n){var r=this;if(401==t)return void layer.open({type:1,title:"登录信息失效,请重新登录",area:["295px;","260px"],moveType:1,content:'<form id="login_form" method="post" action="'+SDC.cas_server_url+"login?service="+window.location.href+'" novalidate="novalidate" class="layui-form" style="margin:20px 0 0 50px ;"><div class="layui-form-item"><label for=""></label><div class="layui-input-inline"><input class= "layui-input" type="text" name="username" placeholder="输入手机号、邮箱或用户名" autocomplete="off" lay-verify="title"> </div ></div><div class="layui-form-item"><label for=""></label><div class="layui-input-inline"><input class="layui-input" type="password" autocomplete="off" name="password" placeholder="6-16位密码,区分大小写" data-bv-field="password"></div></div> <div class="layui-form-item"> <div class= "layui-input-inline" ><button class="layui-btn" type="submit">登录</button></div ></div ></form>',success:function(){e("#login_form").bootstrapValidator({message:"This value is not valid",feedbackIcons:{valid:"glyphicon glyphicon-ok",invalid:"glyphicon glyphicon-remove",validating:"glyphicon glyphicon-refresh"},fields:{username:{message:"请输入手机号,邮箱或用户名",validators:{notEmpty:{message:"请输入手机号,邮箱或用户名"}}},password:{message:"密码无效",validators:{notEmpty:{message:"密码不能为空"},stringLength:{min:6,max:16,message:"密码长度必须在6到16之间"}}}}})}});this.msg_error(n||r.i18n[n]||r.i18n.common_tip)},showMsgError:function(e,t){try{var i=JSON.parse(e.responseText),n=SDC.t.LANG,r=i.msg[n];r||(r=i.msg.en);var a=i.detail?i.detail[n]:"";a||(a=i.detail?i.detail.en:""),this.displayError(e.status,r,a)}catch(n){try{var i=JSON.parse(e.responseText);for(var o in i){var s=i[o];if("string"==typeof s)return void this.displayError(e.status,e.statusText,s);if(s.message){var l=s.type||e.statusText;return void this.displayError(e.status,l,s.message)}}return}catch(e){}var r="Error to fetch url:"+t;this.displayError(e.status,e.statusText,r)}},convertSize:function(e){if(0===e)return"0 B";var t=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],i=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,i)).toPrecision(3)+" "+t[i]},splitFileName:function(e){var t=/\.{1}[a-z]{1,}$/;return null!==t.exec(e)?e.slice(0,t.exec(e).index):e},unescapeHTML:function(e){return e=""+e,e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")},timeDivision:function(e){var t="",i=Math.floor(e/86400),n=Math.floor((e-86400*i)/3600),r=Math.floor((e-86400*i-3600*n)/60),a=Math.floor((e-86400*i-3600*n)%60);return i>0&&(t+=i+" 天 "),n>0&&(t+=n+" 小时 "),r>0&&(t+=r+" 分钟 "),a&&(t+=a+" 秒 "),t},showAlert:function(t,i,n,r,a){var o=this,s='<a href="javascript:;" class="buttonYes">'+n+"</a>";a&&(s=s+'<a href="javascript:;" class="buttonNo">'+a+"</a>");var l=this.showPrompt(t,i,s);return l.find(".buttonYes").one("click",function(){var t=e(".qc-modal"),i=e(this).parents(".promptDialog").eq(0);i.removeClass("scaleIn").addClass("scaleOut");var n=t.find('[lastVisible="true"]');n.length>0?(n.each(function(){e(this).attr("lastVisible","false"),e(this).removeClass("scaleOut").addClass("scaleIn")}),o.bindAnimationEndEvent(i,function(){i.remove(),t.attr("style","")})):(t.removeClass("fadeIn").addClass("fadeOut"),o.bindAnimationEndEvent(t,function(){i.remove(),t.hasClass("fadeIn")||t.attr("style","")})),r&&r()}),l.find(".buttonNo").one("click",function(){var t=e(".qc-modal"),i=e(this).parents(".promptDialog").eq(0);i.removeClass("scaleIn").addClass("scaleOut");var n=t.find('[lastVisible="true"]');n.length>0?(n.each(function(){e(this).attr("lastVisible","false"),e(this).removeClass("scaleOut").addClass("scaleIn")}),o.bindAnimationEndEvent(i,function(){i.remove(),t.attr("style","")})):(t.removeClass("fadeIn").addClass("fadeOut"),o.bindAnimationEndEvent(t,function(){i.remove(),t.hasClass("fadeIn")||t.attr("style","")}))}),l},showConfirm:function(t,i,n,r,a,o){var s=this,l=this.showPrompt(t,i,'<a href="javascript:;" class="buttonYes">'+n+'</a><a href="javascript:;" class="buttonNo">'+r+"</a>",!0);return l.find(".buttonYes").one("click",function(t){var i=e(".qc-modal");e(t.target).hasClass("disabled")||a&&(e(t.target).addClass("disabled"),a(function(t){var n=e(t.target).parents(".promptDialog").eq(0);n.removeClass("scaleIn").addClass("scaleOut");var r=i.find('[lastVisible="true"]');r.length>0?(r.each(function(t){e(t.target).attr("lastVisible","false"),e(t.target).removeClass("scaleOut").addClass("scaleIn")}),s.bindAnimationEndEvent(n,function(){n.remove(),i.attr("style","")})):(i.removeClass("fadeIn").addClass("fadeOut"),s.bindAnimationEndEvent(i,function(){n.remove(),i.hasClass("fadeIn")||i.attr("style","")}))}))}),l.find(".buttonNo").one("click",function(){var t=e(".qc-modal"),i=e(this).parents(".promptDialog").eq(0);i.removeClass("scaleIn").addClass("scaleOut");var n=t.find('[lastVisible="true"]');n.length>0?(n.each(function(){e(this).attr("lastVisible","false"),e(this).removeClass("scaleOut").addClass("scaleIn")}),s.bindAnimationEndEvent(i,function(){i.remove(),t.attr("style","")})):(t.removeClass("fadeIn").addClass("fadeOut"),s.bindAnimationEndEvent(t,function(){i.remove(),t.attr("style","")})),o&&o()}),l},formatTime:function(e){var i=SDC.t.LANG;if(t.locale(i.toLowerCase()),!/^(\d)+$/.test(e))return t(new Date(Date.parse(e.replace("Z","")+"+00:00"))).fromNow();var n=new Date((new Date).getTime()-1e3*e);return t(n).fromNow()},formatTimeStandard:function(e,i){"string"==typeof e&&(e=Date.parse(e)),i||(i="YYYY-MM-DD HH:mm:ss");var n=new Date(e);return t(n).format(i)},getJson:function(t,i,n,r,a,o,s){if(o){if(e(o).hasClass("ajax-disabled"))return;e(o).addClass("ajax-disabled")}var l=SDC.proxyBase,c=this.getRootUrl(t,l),u=this,d=e.getJSON(c+i,n,function(e){r&&r(e)});return a?d.fail(function(e,t){a(e,t)}):d.fail(function(e){u.showMsgError(e,c+i,n)}),o&&d.always(function(){e(o).removeClass("ajax-disabled")}),d},DeleteData:function(t,i,n,r,a,o,s){if(o){if(e(o).hasClass("ajax-disabled"))return;e(o).addClass("ajax-disabled")}var l="";l=s?"application/json; charset=UTF-8":"application/x-www-form-urlencoded; charset=UTF-8";var c=SDC.proxyBase,u=this.getRootUrl(t,c),d=this,h=e.ajax({url:u+i,type:"DELETE",data:n,contentType:l,success:function(e){r&&r(e)}});return a?h.fail(function(){a()}):h.fail(function(e){d.showMsgError(e,u+i,n)}),o&&h.always(function(){e(o).removeClass("ajax-disabled")}),h},putData:function(t,i,n,r,a,o,s){if(o){if(e(o).hasClass("ajax-disabled"))return;e(o).addClass("ajax-disabled")}var l=SDC.proxyBase,c=this.getRootUrl(t,l);n||(n={});var u=this,d=e.ajax({url:c+i,type:"PUT",data:JSON.stringify(n),contentType:"application/json; charset=UTF-8",success:function(e){r&&r(e)}});return a?d.fail(function(){a()}):d.fail(function(e){u.showMsgError(e,c+i,n)}),o&&d.always(function(){e(o).removeClass("ajax-disabled")}),d},deleteData:function(t,i,n,r,a,o){if(o){if(e(o).hasClass("ajax-disabled"))return;e(o).addClass("ajax-disabled")}var s=SDC.proxyBase,l=this.getRootUrl(t,s),c=this,u=e.ajax({url:l+i+"/"+n,type:"DELETE",contentType:"application/json; charset=UTF-8",success:function(e){r&&r(e)}});return a?u.fail(function(){a()}):u.fail(function(e){c.showMsgError(e,l+i+"/"+n)}),o&&u.always(function(){e(o).removeClass("ajax-disabled")}),u},postData:function(t,i,n,r,a,o,s){if(o){if(e(o).hasClass("ajax-disabled"))return;e(o).addClass("ajax-disabled")}var l=SDC.proxyBase,c=this.getRootUrl(t,l),u=this,d=e.ajax({url:c+i,type:"POST",data:JSON.stringify(n),contentType:"application/json; charset=UTF-8",success:function(e){r&&r(e)}});return a?d.fail(function(){a()}):d.fail(function(e,t){"abort"!=t&&u.showMsgError(e,c+i,n)}),o&&d.always(function(){e(o).removeClass("ajax-disabled")}),d},getRootUrl:function(e,t){return t||(t=SDC.proxyBase),t&&t.length>0?[t,"/",e].join(""):""},restorePop:function(t,i){var n=e(".qc-modal");if(!(i.length*n.length<1)){n.css("display","block");var r=n.find('[wp-model-id="'+t+'"]');r.length>0&&(r.css("display","block"),r.siblings().css("display","none"))}},showPop:function(t,i,n,r,a){var o=e(".qc-modal");o.length<1?(o=e('<div class="qc-modal"></div>'),e("body").append(o)):n&&o.children().removeClass("scaleIn").addClass("scaleOut"),i.attr("wp-model-id",t);var s=o.find('[wp-model-id="'+t+'"]');s.length>0&&s.remove(),o.append(i);var l=i.find(".closeModal");l.length<1&&(l=e('<a href="javascript:;" class="closeModal"></a>'),i.append(l),l.click(function(){a?(i.removeClass("scaleIn").addClass("scaleOut"),setTimeout(function(){i.css("display","none")},300),o.children().not(i).removeClass("scaleOut").addClass("scaleIn")):(o.removeClass("fadeIn").addClass("fadeOut"),i.removeClass("scaleIn").addClass("scaleOut"),o.attr("style",""),r()),i.find(".tipsLink").each(function(){e(this).trigger("mouseout")})})),i.removeClass("scaleIn").addClass("scaleOut"),o.removeClass("fadeOut").addClass("fadeIn").show(),setTimeout(function(){i[0].offsetHeight;i.removeClass("scaleOut").addClass("scaleIn")},0),window.setTimeout(function(){var e=i.find("input:text:not(:disabled), select:not(:disabled), input:password:not(:disabled)").eq(0);e.length>0&&!e.hasClass("not-focus")&&e.trigger("focus")},300)},styleSelect:function(t,i){t.find("select").each(function(){if(!e(this).hasClass("styleDone")){var t=e('<span class="selectWrapper"><span class="selectLabel">'+(i?e.trim(e(this).find(":selected").text()):"")+"</span></span>");e(this).replaceWith(t),t.append(e(this)),i&&t.delegate("select","change",function(){e(this).siblings(".selectLabel").text(e.trim(e(this).find(":selected").text()))}),e(this).addClass("styleDone"),e(this).css("opacity","0")}})},escape:function(e){if("string"==typeof e)return e.replace(/</g,"<").replace(/>/g,">");if("object"==typeof e){for(var t in e){var i=e[t];e[t]=this.escape(i)}return e}return e},toCapitalCase:function(e){return e?e.charAt(0).toUpperCase()+e.substring(1).toLowerCase():""},handleStatistics:function(t,i,n){return e.inArray(i,n)>=0&&t.forEach(function(e,t,i){i[t].avg*=8,i[t].min*=8,i[t].max*=8,i[t].sum*=8,i[t].unit="b/s"}),t},get_order_id:function(e){return Date.prototype.Format=function(e){var t={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var i in t)new RegExp("("+i+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[i]:("00"+t[i]).substr((""+t[i]).length)));return e},e+(new Date).Format("yyyyMdhmsS")},VPN_Status:{unaudit:"0",audited:"1",refuse:"2"},Alarm_Action:{email:"http://10.10.10.100/api/alarm/action/email/",sms:"http://10.10.10.100/api/alarm/action/sms/"},Alert_Type:{success:"success",error:"error",warning:"warning",info:"info",null:null},isInRange:function(e,t){var i=e.split("."),n=i[0]<<24|i[1]<<16|i[2]<<8|i[3],r=t.split("/"),a=r[1],o=4294967295<<32-a,s=r[0],l=s.split(".");return(n&o)==((l[0]<<24|l[1]<<16|l[2]<<8|l[3])&o)},getcidrResult:function(e,t){if(""==t||void 0==typeof t||null==t)return!1;var i,n=t.split(";"),r=!1;for(i=0;i<n.length;i++)r=r||this.isInRange(e,n[i]);return r},bindAnimationEndEvent:function(e,t){var i=null===window.onwebkitanimationend?"webkitAnimationEnd":"animationend";e.one(i,t)},TechDomain:[{id:"ns",title:"云计算"},{id:"jn",title:"大数据"},{id:"base",title:"计算机基础"}],Course_Type:{pub_course:"pub_course",v_course:"v_course",s_course:"s_course"},Group_Type:{class:"class",vclass:"vclass",pub_class:"pub_class"},getMousePos:function(e){var t=e||window.event||arguments.callee.caller.arguments[0],i=document.documentElement.scrollLeft||document.body.scrollLeft,n=document.documentElement.scrollTop||document.body.scrollTop;return{x:t.pageX||t.clientX+i,y:t.pageY||t.clientY+n}},sleep:function(e){var t=(new Date).getTime();do{}while((new Date).getTime()-t<e)},selectText:function(){return window.getSelection?userSelection=window.getSelection():document.selection&&(userSelection=document.selection.createRange()),userSelection.toString()},shuidi_loading:function(e,t,i){var n=e.getContext("2d"),r=0,a=0,o=e.width=180,s=e.height=180,l=s/2,c=l-8,u=o,d=0;n.lineWidth=2;var h=function(){n.beginPath(),n.strokeStyle="#04885b",n.arc(l,l,c+5,0,2*Math.PI),n.stroke(),n.beginPath(),n.arc(l,l,c,0,2*Math.PI),n.clip()},p=function(e){n.save();var t=[];n.beginPath();for(var i=0;i<0+u;i+=20/u){var r=-Math.sin(.035*(0+i)+e),o=s*(1-a/100);t.push([i,o+4*r]),n.lineTo(i,o+4*r)}n.lineTo(u,s),n.lineTo(0,s),n.lineTo(t[0][0],t[0][1]),n.fillStyle="#04885b",n.fill(),n.restore()},f=function(){n.save();var e=.4*c;n.font=e+"px Microsoft Yahei",n.textAlign="center",n.fillStyle="rgba(255, 255, 255, 0.8)",n.fillText(~~a+"%",l,l+e/2),n.restore()},m=function(){if(n.clearRect(0,0,o,s),r=t(),h(),a<=r){var e=1;a+=e}if(a>r){var e=1;a-=e}p(d),f(),d+=.04,globalAnimate=requestAnimationFrame(m),i(globalAnimate)};m()},fullScreen:function(){var e=document.documentElement;if(e.mozRequestFullScreen)e.mozRequestFullScreen();else if(e.webkitRequestFullScreen)e.webkitRequestFullScreen();else if(e.msRequestFullscreen)e.msRequestFullscreen();else{if(!e.requestFullscreen)return this.msg_warning("浏览器不支持全屏API或已被禁用"),!1;e.requestFullscreen()}return!0},exitFullScreen:function(){if(document.mozCancelFullScreen)document.mozCancelFullScreen();else if(document.webkitCancelFullScreen)document.webkitCancelFullScreen();else if(document.msExitFullscreen)document.msExitFullscreen();else{if(!document.exitFullscreen)return this.msg_warning("浏览器不支持全屏API或已被禁用"),!1;document.exitFullscreen()}return!0},checkFull:function(){return window.navigator.userAgent.toLowerCase().indexOf("chrome")>0?document.body.scrollHeight===window.screen.height&&document.body.scrollWidth===window.screen.width:window.outerHeight===window.screen.height&&window.outerWidth===window.screen.width},setCookie:function(e,t,i){var n=(new Date).getTime();n+=1e3*i*60;var r=e+"="+escape(t)+";expires="+new Date(n).toGMTString();document.cookie=r},getCookie:function(e){var t=document.cookie.split(";");if(t.length>0){var i=t[0].split("=");if(i[0]==e)return unescape(i[1])}},removeCookie:function(e){var t=e+"="+escape("null")+";expires="+(new Date).toGMTString();document.cookie=t},setLocalStorage:function(e){var t={name:"",value:"",expires:"",startTime:(new Date).getTime()},i={};if(Object.assign(i,t,e),i.expires)localStorage.setItem(i.name,JSON.stringify(i));else{Object.prototype.toString.call(i.value);"[object Object]"==Object.prototype.toString.call(i.value)&&(i.value=JSON.stringify(i.value)),"[object Array]"==Object.prototype.toString.call(i.value)&&(i.value=JSON.stringify(i.value)),localStorage.setItem(i.name,i.value)}},getLocalStorage:function(e){var t=localStorage.getItem(e);if(!t)return!1;try{t=JSON.parse(t)}catch(e){t=t}if(t.startTime){return(new Date).getTime()-t.startTime>t.expires?(localStorage.removeItem(e),!1):t.value}return t},removeLocalStorage:function(e){localStorage.removeItem(e)},Assist_type:{assist:"assist",assisted:"assisted"},vm_status:{creating:"lab_create",running:"lab_complete",closing:"lab_delete",closed:"lab_ready",error:"error",time_end:"time_end"},vm_op_status:{operating:"operating",op_failed:"op_failed"},course_img_url:function(e){"pub_course"==e.c_type?e.topic_url=SDC.domain.pcourse_domain+e.topic_url:"v_course"==e.c_type?e.topic_url=SDC.domain.vcourse_domain+e.topic_url:"s_course"==e.c_type&&(e.topic_url=SDC.domain.icourse_domain+e.topic_url)},course_video_url:function(e){if(!e.video_url)return"";"pub_course"==e.c_type?e.video_url=SDC.domain.pcourse_domain+e.video_url:"v_course"==e.c_type?e.video_url=SDC.domain.vcourse_domain+e.video_url:"s_course"==e.c_type?e.video_url=SDC.domain.icourse_domain+e.video_url:"p_course"==e.c_type&&(e.video_url=SDC.domain.pcourse_domain+e.video_url)},getDomain:function(e){switch(e){case"user":return SDC.domain.user_domain;case"pub_course":return SDC.domain.pcourse_domain;case"v_course":return SDC.domain.vcourse_domain;case"s_course":return SDC.domain.icourse_domain;case"report":return SDC.domain.report_domain;case"step":return SDC.domain.step_domain;case"step_att":return SDC.domain.step_att_domain;case"idauth_att":return SDC.domain.idauth_att_domain;case"invite":return SDC.domain.invite_domain;default:return null}},domain_type:{user:"user",pub_course:"pub_course",v_course:"v_course",s_course:"s_course",report:"report",step:"step",step_att:"step_att",idauth_att:"idauth_att",invite:"invite"},paging:function(e,t,i,n){n||(n=6),layui.use("laypage",function(){layui.laypage.render({elem:t,count:e.length,limit:n,jump:function(t){tempdata=e.concat().splice(t.curr*t.limit-t.limit,t.limit),i(tempdata)}})})},layerPage:function(e,t,i,n,r){layui.use("laypage",function(){layui.laypage.render({limit:e,count:t,elem:i,jump:function(e,t){t||r[n](e.curr)}})})},msg_success:function(e,t,n){i.success(e,t,n)},msg_error:function(e){i.error(e)},msg_info:function(e,t,n){i.info(e,t,n)},msg_warning:function(e,t,n){i.warning(e,t,n)},vm_protocol:{SSH:"SSH",RDP:"RDP"},op_system_type:{instance:"instance",gpu:"instance_gpu",interact:"instance_interact"},file_var:{base_url_ready:"/ecos/qcec/file/initiate_mulit_upload",base_url_upload:"/ecos/qcec/file/upload_multipart",base_url_end:"/ecos/qcec/file/complete_multipart_upload",chunk_size:52428800},changeFile:function(e,t,i,n,r,a,o,s){this.uploadChunkWait(e,t,i,n,r,a,o,s)},uploadChunk:function(t,i,n,r,a,o,s,l){var c=this,u=!0,d=[];e("."+o).removeClass("hide").addClass("show"),e("."+s).removeClass("hide").addClass("show"),a.progress(o,"0%");for(var h=Math.ceil(i/this.file_var.chunk_size),p=0,f=(new Date).getTime(),m=0;m<h;m++)this.upload(t,m,i,n,r,d,function(t,i){if(t){p++;var n=parseInt(p/h*100);a.progress(o,n+"%");var r=(new Date).getTime(),d=(r-f)/1e3,m=p*c.file_var.chunk_size/d,g="b/s";m/1024>1&&(g="KB/s",m/=1024),m/1024>1&&(g="MB/s",m/=1024),e("."+s).text(m.toFixed(2)+g),p==h&&(l&&l(!0),e("."+o).removeClass("show").addClass("hide"),e("."+s).removeClass("show").addClass("hide"))}else u&&(u=!1,i.forEach(function(e){e.abort&&e.abort()}),e("."+o).removeClass("show").addClass("hide"),e("."+s).removeClass("show").addClass("hide"),l&&l(!1))})},uploadChunkWait:function(t,i,n,r,a,o,s,l){var c=this;e("."+o).removeClass("hide").addClass("show"),e("."+s).removeClass("hide").addClass("show"),a.progress(o,"0%");var u=Math.ceil(i/this.file_var.chunk_size),d=0,h=(new Date).getTime();this.upload(t,d,i,n,r,function(p){p?(d++,c.callbackupload(t,d,i,n,r,u,a,h,o,s,l)):(e("."+o).removeClass("show").addClass("hide"),e("."+s).removeClass("show").addClass("hide"),l&&l(!1))})},callbackupload:function(t,i,n,r,a,o,s,l,c,u,d){var h=this,p=parseInt(i/o*100);s.progress(c,p+"%");var f=(new Date).getTime(),m=(f-l)/1e3,g=i*h.file_var.chunk_size/m,v="b/s";g/1024>1&&(v="KB/s",g/=1024),g/1024>1&&(v="MB/s",g/=1024),e("."+u).text(g.toFixed(2)+v),i==o?(d&&d(!0),e("."+c).removeClass("show").addClass("hide"),e("."+u).removeClass("show").addClass("hide")):this.upload(t,i,n,r,a,function(p){p?(i++,h.callbackupload(t,i,n,r,a,o,s,l,c,u,d)):(e("."+c).removeClass("show").addClass("hide"),e("."+u).removeClass("show").addClass("hide"),d&&d(!1))})},upload:function(t,i,n,r,a,o){var s=this.file_var.chunk_size,l=this.file_var.base_url_upload,c=(i+1)*s>=n?n:(i+1)*s,u=new FormData,d=File.prototype.slice||File.prototype.mozSlice||File.prototype.webkitSlice;u.append("file",d.call(t,i*s,c)),u.append("key",a),u.append("upload_id",r),u.append("part_number",i);e.ajax({url:l,type:"POST",data:u,async:!0,processData:!1,contentType:!1,success:function(e){o&&o(!0)},error:function(e){500!=e.status&&502!=e.status&&503!=e.status||o&&o(!1)}})},randomStr:function(e){for(var t="0123456789qwertyuiopasdfghjklzxcvbnm",i=t.length,n="",r=(new Date).getTime(),a=0;a<e;a++)n+=t.charAt(Math.ceil(1e8*Math.random())%i);return r+n},formatSeconds:function(e){var t=parseInt(e),i=0,n=0;t>=60&&(i=parseInt(t/60),t=parseInt(t%60),i>=60&&(n=parseInt(i/60),i=parseInt(i%60)));var r=""+(parseInt(t)<10?"0"+parseInt(t):parseInt(t));return r=(parseInt(i)<10?"0"+parseInt(i):parseInt(i))+":"+r,r=(parseInt(n)<10?"0"+parseInt(n):parseInt(n))+":"+r}};return Object.defineProperty(r,"relativePath",{value:"/portal/index"}),r.init_toastr(),r}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define("sockjs",[],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.SockJS=e()}}(function(){var e;return function(){function e(t,i,n){function r(o,s){if(!i[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[o]={exports:{}};t[o][0].call(u.exports,function(e){return r(t[o][1][e]||e)},u,u.exports,e,t,i,n)}return i[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}return e}()({1:[function(e,t,i){(function(i){var n=e("./transport-list");t.exports=e("./main")(n),"_sockjs_onload"in i&&setTimeout(i._sockjs_onload,1)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./main":14,"./transport-list":16}],2:[function(e,t,i){function n(){a.call(this),this.initEvent("close",!1,!1),this.wasClean=!1,this.code=0,this.reason=""}var r=e("inherits"),a=e("./event");r(n,a),t.exports=n},{"./event":4,inherits:57}],3:[function(e,t,i){function n(){a.call(this)}var r=e("inherits"),a=e("./eventtarget");r(n,a),n.prototype.removeAllListeners=function(e){e?delete this._listeners[e]:this._listeners={}},n.prototype.once=function(e,t){function i(){n.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}var n=this,r=!1;this.on(e,i)},n.prototype.emit=function(){var e=arguments[0],t=this._listeners[e];if(t){for(var i=arguments.length,n=new Array(i-1),r=1;r<i;r++)n[r-1]=arguments[r];for(var a=0;a<t.length;a++)t[a].apply(this,n)}},n.prototype.on=n.prototype.addListener=a.prototype.addEventListener,n.prototype.removeListener=a.prototype.removeEventListener,t.exports.EventEmitter=n},{"./eventtarget":5,inherits:57}],4:[function(e,t,i){function n(e){this.type=e}n.prototype.initEvent=function(e,t,i){return this.type=e,this.bubbles=t,this.cancelable=i,this.timeStamp=+new Date,this},n.prototype.stopPropagation=function(){},n.prototype.preventDefault=function(){},n.CAPTURING_PHASE=1,n.AT_TARGET=2,n.BUBBLING_PHASE=3,t.exports=n},{}],5:[function(e,t,i){function n(){this._listeners={}}n.prototype.addEventListener=function(e,t){e in this._listeners||(this._listeners[e]=[]);var i=this._listeners[e];-1===i.indexOf(t)&&(i=i.concat([t])),this._listeners[e]=i},n.prototype.removeEventListener=function(e,t){var i=this._listeners[e];if(i){var n=i.indexOf(t);return-1!==n?void(i.length>1?this._listeners[e]=i.slice(0,n).concat(i.slice(n+1)):delete this._listeners[e]):void 0}},n.prototype.dispatchEvent=function(){var e=arguments[0],t=e.type,i=1===arguments.length?[e]:Array.apply(null,arguments);if(this["on"+t]&&this["on"+t].apply(this,i),t in this._listeners)for(var n=this._listeners[t],r=0;r<n.length;r++)n[r].apply(this,i)},t.exports=n},{}],6:[function(e,t,i){function n(e){a.call(this),this.initEvent("message",!1,!1),this.data=e}var r=e("inherits"),a=e("./event");r(n,a),t.exports=n},{"./event":4,inherits:57}],7:[function(e,t,i){function n(e){this._transport=e,e.on("message",this._transportMessage.bind(this)),e.on("close",this._transportClose.bind(this))}var r=e("json3"),a=e("./utils/iframe");n.prototype._transportClose=function(e,t){a.postMessage("c",r.stringify([e,t]))},n.prototype._transportMessage=function(e){a.postMessage("t",e)},n.prototype._send=function(e){this._transport.send(e)},n.prototype._close=function(){this._transport.close(),this._transport.removeAllListeners()},t.exports=n},{"./utils/iframe":47,json3:58}],8:[function(e,t,i){(function(i){var n=e("./utils/url"),r=e("./utils/event"),a=e("json3"),o=e("./facade"),s=e("./info-iframe-receiver"),l=e("./utils/iframe"),c=e("./location"),u=function(){};"production"!==i.env.NODE_ENV&&(u=e("debug")("sockjs-client:iframe-bootstrap")),t.exports=function(e,t){var i={};t.forEach(function(e){e.facadeTransport&&(i[e.facadeTransport.transportName]=e.facadeTransport)}),i[s.transportName]=s;var d;e.bootstrap_iframe=function(){var t;l.currentWindowId=c.hash.slice(1);var s=function(r){if(r.source===parent&&(void 0===d&&(d=r.origin),r.origin===d)){var s;try{s=a.parse(r.data)}catch(e){return void u("bad json",r.data)}if(s.windowId===l.currentWindowId)switch(s.type){case"s":var h;try{h=a.parse(s.data)}catch(e){u("bad json",s.data);break}var p=h[0],f=h[1],m=h[2],g=h[3];if(u(p,f,m,g),p!==e.version)throw new Error('Incompatible SockJS! Main site uses: "'+p+'", the iframe: "'+e.version+'".');if(!n.isOriginEqual(m,c.href)||!n.isOriginEqual(g,c.href))throw new Error("Can't connect to different domain from within an iframe. ("+c.href+", "+m+", "+g+")");t=new o(new i[f](m,g));break;case"m":t._send(s.data);break;case"c":t&&t._close(),t=null}}};r.attachEvent("message",s),l.postMessage("s")}}}).call(this,{env:{}})},{"./facade":7,"./info-iframe-receiver":10,"./location":13,"./utils/event":46,"./utils/iframe":47,"./utils/url":52,debug:55,json3:58}],9:[function(e,t,i){(function(i){function n(e,t){r.call(this);var i=this,n=+new Date;this.xo=new t("GET",e),this.xo.once("finish",function(e,t){var r,a;if(200===e){if(a=+new Date-n,t)try{r=o.parse(t)}catch(e){l("bad json",t)}s.isObject(r)||(r={})}i.emit("finish",r,a),i.removeAllListeners()})}var r=e("events").EventEmitter,a=e("inherits"),o=e("json3"),s=e("./utils/object"),l=function(){};"production"!==i.env.NODE_ENV&&(l=e("debug")("sockjs-client:info-ajax")),a(n,r),n.prototype.close=function(){this.removeAllListeners(),this.xo.close()},t.exports=n}).call(this,{env:{}})},{"./utils/object":49,debug:55,events:3,inherits:57,json3:58}],10:[function(e,t,i){function n(e){var t=this;a.call(this),this.ir=new l(e,s),this.ir.once("finish",function(e,i){t.ir=null,t.emit("message",o.stringify([e,i]))})}var r=e("inherits"),a=e("events").EventEmitter,o=e("json3"),s=e("./transport/sender/xhr-local"),l=e("./info-ajax");r(n,a),n.transportName="iframe-info-receiver",n.prototype.close=function(){this.ir&&(this.ir.close(),this.ir=null),this.removeAllListeners()},t.exports=n},{"./info-ajax":9,"./transport/sender/xhr-local":37,events:3,inherits:57,json3:58}],11:[function(e,t,i){(function(i,n){function r(e,t){var i=this;a.call(this);var r=function(){var n=i.ifr=new c(u.transportName,t,e);n.once("message",function(e){if(e){var t;try{t=s.parse(e)}catch(t){return d("bad json",e),i.emit("finish"),void i.close()}var n=t[0],r=t[1];i.emit("finish",n,r)}i.close()}),n.once("close",function(){i.emit("finish"),i.close()})};n.document.body?r():l.attachEvent("load",r)}var a=e("events").EventEmitter,o=e("inherits"),s=e("json3"),l=e("./utils/event"),c=e("./transport/iframe"),u=e("./info-iframe-receiver"),d=function(){};"production"!==i.env.NODE_ENV&&(d=e("debug")("sockjs-client:info-iframe")),o(r,a),r.enabled=function(){return c.enabled()},r.prototype.close=function(){this.ifr&&this.ifr.close(),this.removeAllListeners(),this.ifr=null},t.exports=r}).call(this,{env:{}},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./info-iframe-receiver":10,"./transport/iframe":22,"./utils/event":46,debug:55,events:3,inherits:57,json3:58}],12:[function(e,t,i){(function(i){function n(e,t){p(e);var i=this;r.call(this),setTimeout(function(){i.doXhr(e,t)},0)}var r=e("events").EventEmitter,a=e("inherits"),o=e("./utils/url"),s=e("./transport/sender/xdr"),l=e("./transport/sender/xhr-cors"),c=e("./transport/sender/xhr-local"),u=e("./transport/sender/xhr-fake"),d=e("./info-iframe"),h=e("./info-ajax"),p=function(){};"production"!==i.env.NODE_ENV&&(p=e("debug")("sockjs-client:info-receiver")),a(n,r),n._getReceiver=function(e,t,i){return i.sameOrigin?new h(t,c):l.enabled?new h(t,l):s.enabled&&i.sameScheme?new h(t,s):d.enabled()?new d(e,t):new h(t,u)},n.prototype.doXhr=function(e,t){var i=this,r=o.addPath(e,"/info");p("doXhr",r),this.xo=n._getReceiver(e,r,t),this.timeoutRef=setTimeout(function(){p("timeout"),i._cleanup(!1),i.emit("finish")},n.timeout),this.xo.once("finish",function(e,t){p("finish",e,t),i._cleanup(!0),i.emit("finish",e,t)})},n.prototype._cleanup=function(e){p("_cleanup"),clearTimeout(this.timeoutRef),this.timeoutRef=null,!e&&this.xo&&this.xo.close(),this.xo=null},n.prototype.close=function(){p("close"),this.removeAllListeners(),this._cleanup(!1)},n.timeout=8e3,t.exports=n}).call(this,{env:{}})},{"./info-ajax":9,"./info-iframe":11,"./transport/sender/xdr":34,"./transport/sender/xhr-cors":35,
|
||
"./transport/sender/xhr-fake":36,"./transport/sender/xhr-local":37,"./utils/url":52,debug:55,events:3,inherits:57}],13:[function(e,t,i){(function(e){t.exports=e.location||{origin:"http://localhost:80",protocol:"http:",host:"localhost",port:80,href:"http://localhost/",hash:""}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(e,t,i){(function(i,n){function r(e,t,i){if(!(this instanceof r))return new r(e,t,i);if(arguments.length<1)throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");y.call(this),this.readyState=r.CONNECTING,this.extensions="",this.protocol="",i=i||{},i.protocols_whitelist&&g.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."),this._transportsWhitelist=i.transports,this._transportOptions=i.transportOptions||{};var n=i.sessionId||8;if("function"==typeof n)this._generateSessionId=n;else{if("number"!=typeof n)throw new TypeError("If sessionId is used in the options, it needs to be a number or a function.");this._generateSessionId=function(){return c.string(n)}}this._server=i.server||c.numberString(1e3);var a=new o(e);if(!a.host||!a.protocol)throw new SyntaxError("The URL '"+e+"' is invalid");if(a.hash)throw new SyntaxError("The URL must not contain a fragment");if("http:"!==a.protocol&&"https:"!==a.protocol)throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '"+a.protocol+"' is not allowed.");var s="https:"===a.protocol;if("https:"===_.protocol&&!s)throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS");t?Array.isArray(t)||(t=[t]):t=[];var l=t.sort();l.forEach(function(e,t){if(!e)throw new SyntaxError("The protocols entry '"+e+"' is invalid.");if(t<l.length-1&&e===l[t+1])throw new SyntaxError("The protocols entry '"+e+"' is duplicated.")});var u=d.getOrigin(_.href);this._origin=u?u.toLowerCase():null,a.set("pathname",a.pathname.replace(/\/+$/,"")),this.url=a.href,k("using url",this.url),this._urlInfo={nullOrigin:!m.hasDomain(),sameOrigin:d.isOriginEqual(this.url,_.href),sameScheme:d.isSchemeEqual(this.url,_.href)},this._ir=new x(this.url,this._urlInfo),this._ir.once("finish",this._receiveInfo.bind(this))}function a(e){return 1e3===e||e>=3e3&&e<=4999}e("./shims");var o=e("url-parse"),s=e("inherits"),l=e("json3"),c=e("./utils/random"),u=e("./utils/escape"),d=e("./utils/url"),h=e("./utils/event"),p=e("./utils/transport"),f=e("./utils/object"),m=e("./utils/browser"),g=e("./utils/log"),v=e("./event/event"),y=e("./event/eventtarget"),_=e("./location"),b=e("./event/close"),w=e("./event/trans-message"),x=e("./info-receiver"),k=function(){};"production"!==i.env.NODE_ENV&&(k=e("debug")("sockjs-client:main"));var C;s(r,y),r.prototype.close=function(e,t){if(e&&!a(e))throw new Error("InvalidAccessError: Invalid code");if(t&&t.length>123)throw new SyntaxError("reason argument has an invalid length");if(this.readyState!==r.CLOSING&&this.readyState!==r.CLOSED){this._close(e||1e3,t||"Normal closure",!0)}},r.prototype.send=function(e){if("string"!=typeof e&&(e=""+e),this.readyState===r.CONNECTING)throw new Error("InvalidStateError: The connection has not been established yet");this.readyState===r.OPEN&&this._transport.send(u.quote(e))},r.version=e("./version"),r.CONNECTING=0,r.OPEN=1,r.CLOSING=2,r.CLOSED=3,r.prototype._receiveInfo=function(e,t){if(k("_receiveInfo",t),this._ir=null,!e)return void this._close(1002,"Cannot connect to server");this._rto=this.countRTO(t),this._transUrl=e.base_url?e.base_url:this.url,e=f.extend(e,this._urlInfo),k("info",e);var i=C.filterToEnabled(this._transportsWhitelist,e);this._transports=i.main,k(this._transports.length+" enabled transports"),this._connect()},r.prototype._connect=function(){for(var e=this._transports.shift();e;e=this._transports.shift()){if(k("attempt",e.transportName),e.needBody&&(!n.document.body||void 0!==n.document.readyState&&"complete"!==n.document.readyState&&"interactive"!==n.document.readyState))return k("waiting for body"),this._transports.unshift(e),void h.attachEvent("load",this._connect.bind(this));var t=this._rto*e.roundTrips||5e3;this._transportTimeoutId=setTimeout(this._transportTimeout.bind(this),t),k("using timeout",t);var i=d.addPath(this._transUrl,"/"+this._server+"/"+this._generateSessionId()),r=this._transportOptions[e.transportName];k("transport url",i);var a=new e(i,this._transUrl,r);return a.on("message",this._transportMessage.bind(this)),a.once("close",this._transportClose.bind(this)),a.transportName=e.transportName,void(this._transport=a)}this._close(2e3,"All transports failed",!1)},r.prototype._transportTimeout=function(){k("_transportTimeout"),this.readyState===r.CONNECTING&&(this._transport&&this._transport.close(),this._transportClose(2007,"Transport timed out"))},r.prototype._transportMessage=function(e){k("_transportMessage",e);var t,i=this,n=e.slice(0,1),r=e.slice(1);switch(n){case"o":return void this._open();case"h":return this.dispatchEvent(new v("heartbeat")),void k("heartbeat",this.transport)}if(r)try{t=l.parse(r)}catch(e){k("bad json",r)}if(void 0===t)return void k("empty payload",r);switch(n){case"a":Array.isArray(t)&&t.forEach(function(e){k("message",i.transport,e),i.dispatchEvent(new w(e))});break;case"m":k("message",this.transport,t),this.dispatchEvent(new w(t));break;case"c":Array.isArray(t)&&2===t.length&&this._close(t[0],t[1],!0)}},r.prototype._transportClose=function(e,t){if(k("_transportClose",this.transport,e,t),this._transport&&(this._transport.removeAllListeners(),this._transport=null,this.transport=null),!a(e)&&2e3!==e&&this.readyState===r.CONNECTING)return void this._connect();this._close(e,t)},r.prototype._open=function(){k("_open",this._transport.transportName,this.readyState),this.readyState===r.CONNECTING?(this._transportTimeoutId&&(clearTimeout(this._transportTimeoutId),this._transportTimeoutId=null),this.readyState=r.OPEN,this.transport=this._transport.transportName,this.dispatchEvent(new v("open")),k("connected",this.transport)):this._close(1006,"Server lost session")},r.prototype._close=function(e,t,i){k("_close",this.transport,e,t,i,this.readyState);var n=!1;if(this._ir&&(n=!0,this._ir.close(),this._ir=null),this._transport&&(this._transport.close(),this._transport=null,this.transport=null),this.readyState===r.CLOSED)throw new Error("InvalidStateError: SockJS has already been closed");this.readyState=r.CLOSING,setTimeout(function(){this.readyState=r.CLOSED,n&&this.dispatchEvent(new v("error"));var a=new b("close");a.wasClean=i||!1,a.code=e||1e3,a.reason=t,this.dispatchEvent(a),this.onmessage=this.onclose=this.onerror=null,k("disconnected")}.bind(this),0)},r.prototype.countRTO=function(e){return e>100?4*e:300+e},t.exports=function(t){return C=p(t),e("./iframe-bootstrap")(r,t),r}}).call(this,{env:{}},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./event/close":2,"./event/event":4,"./event/eventtarget":5,"./event/trans-message":6,"./iframe-bootstrap":8,"./info-receiver":12,"./location":13,"./shims":15,"./utils/browser":44,"./utils/escape":45,"./utils/event":46,"./utils/log":48,"./utils/object":49,"./utils/random":50,"./utils/transport":51,"./utils/url":52,"./version":53,debug:55,inherits:57,json3:58,"url-parse":61}],15:[function(e,t,i){function n(e){var t=+e;return t!==t?t=0:0!==t&&t!==1/0&&t!==-1/0&&(t=(t>0||-1)*Math.floor(Math.abs(t))),t}function r(e){return e>>>0}function a(){}var o,s=Array.prototype,l=Object.prototype,c=Function.prototype,u=String.prototype,d=s.slice,h=l.toString,p=function(e){return"[object Function]"===l.toString.call(e)},f=function(e){return"[object Array]"===h.call(e)},m=function(e){return"[object String]"===h.call(e)},g=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{}),!0}catch(e){return!1}}();o=g?function(e,t,i,n){!n&&t in e||Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:i})}:function(e,t,i,n){!n&&t in e||(e[t]=i)};var v=function(e,t,i){for(var n in t)l.hasOwnProperty.call(t,n)&&o(e,n,t[n],i)},y=function(e){if(null==e)throw new TypeError("can't convert "+e+" to object");return Object(e)};v(c,{bind:function(e){var t=this;if(!p(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var i=d.call(arguments,1),n=function(){if(this instanceof l){var n=t.apply(this,i.concat(d.call(arguments)));return Object(n)===n?n:this}return t.apply(e,i.concat(d.call(arguments)))},r=Math.max(0,t.length-i.length),o=[],s=0;s<r;s++)o.push("$"+s);var l=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this, arguments); }")(n);return t.prototype&&(a.prototype=t.prototype,l.prototype=new a,a.prototype=null),l}}),v(Array,{isArray:f});var _=Object("a"),b="a"!==_[0]||!(0 in _);v(s,{forEach:function(e){var t=y(this),i=b&&m(this)?this.split(""):t,n=arguments[1],r=-1,a=i.length>>>0;if(!p(e))throw new TypeError;for(;++r<a;)r in i&&e.call(n,i[r],r,t)}},!function(e){var t=!0,i=!0;return e&&(e.call("foo",function(e,i,n){"object"!=typeof n&&(t=!1)}),e.call([1],function(){"use strict";i="string"==typeof this},"x")),!!e&&t&&i}(s.forEach));var w=Array.prototype.indexOf&&-1!==[0,1].indexOf(1,2);v(s,{indexOf:function(e){var t=b&&m(this)?this.split(""):y(this),i=t.length>>>0;if(!i)return-1;var r=0;for(arguments.length>1&&(r=n(arguments[1])),r=r>=0?r:Math.max(0,i+r);r<i;r++)if(r in t&&t[r]===e)return r;return-1}},w);var x=u.split;2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||"t"==="tesst".split(/(s)*/)[1]||4!=="test".split(/(?:)/,-1).length||"".split(/.?/).length||".".split(/()()/).length>1?function(){var e=void 0===/()??/.exec("")[1];u.split=function(t,i){var n=this;if(void 0===t&&0===i)return[];if("[object RegExp]"!==h.call(t))return x.call(this,t,i);var a,o,l,c,u=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.extended?"x":"")+(t.sticky?"y":""),p=0;for(t=new RegExp(t.source,d+"g"),n+="",e||(a=new RegExp("^"+t.source+"$(?!\\s)",d)),i=void 0===i?-1>>>0:r(i);(o=t.exec(n))&&!((l=o.index+o[0].length)>p&&(u.push(n.slice(p,o.index)),!e&&o.length>1&&o[0].replace(a,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(o[e]=void 0)}),o.length>1&&o.index<n.length&&s.push.apply(u,o.slice(1)),c=o[0].length,p=l,u.length>=i));)t.lastIndex===o.index&&t.lastIndex++;return p===n.length?!c&&t.test("")||u.push(""):u.push(n.slice(p)),u.length>i?u.slice(0,i):u}}():"0".split(void 0,0).length&&(u.split=function(e,t){return void 0===e&&0===t?[]:x.call(this,e,t)});var k=u.substr,C="".substr&&"b"!=="0b".substr(-1);v(u,{substr:function(e,t){return k.call(this,e<0&&(e=this.length+e)<0?0:e,t)}},C)},{}],16:[function(e,t,i){t.exports=[e("./transport/websocket"),e("./transport/xhr-streaming"),e("./transport/xdr-streaming"),e("./transport/eventsource"),e("./transport/lib/iframe-wrap")(e("./transport/eventsource")),e("./transport/htmlfile"),e("./transport/lib/iframe-wrap")(e("./transport/htmlfile")),e("./transport/xhr-polling"),e("./transport/xdr-polling"),e("./transport/lib/iframe-wrap")(e("./transport/xhr-polling")),e("./transport/jsonp-polling")]},{"./transport/eventsource":20,"./transport/htmlfile":21,"./transport/jsonp-polling":23,"./transport/lib/iframe-wrap":26,"./transport/websocket":38,"./transport/xdr-polling":39,"./transport/xdr-streaming":40,"./transport/xhr-polling":41,"./transport/xhr-streaming":42}],17:[function(e,t,i){(function(i,n){function r(e,t,i,n){u(e,t);var r=this;a.call(this),setTimeout(function(){r._start(e,t,i,n)},0)}var a=e("events").EventEmitter,o=e("inherits"),s=e("../../utils/event"),l=e("../../utils/url"),c=n.XMLHttpRequest,u=function(){};"production"!==i.env.NODE_ENV&&(u=e("debug")("sockjs-client:browser:xhr")),o(r,a),r.prototype._start=function(e,t,i,n){var a=this;try{this.xhr=new c}catch(e){}if(!this.xhr)return u("no xhr"),this.emit("finish",0,"no xhr support"),void this._cleanup();t=l.addQuery(t,"t="+ +new Date),this.unloadRef=s.unloadAdd(function(){u("unload cleanup"),a._cleanup(!0)});try{this.xhr.open(e,t,!0),this.timeout&&"timeout"in this.xhr&&(this.xhr.timeout=this.timeout,this.xhr.ontimeout=function(){u("xhr timeout"),a.emit("finish",0,""),a._cleanup(!1)})}catch(e){return u("exception",e),this.emit("finish",0,""),void this._cleanup(!1)}if(n&&n.noCredentials||!r.supportsCORS||(u("withCredentials"),this.xhr.withCredentials=!0),n&&n.headers)for(var o in n.headers)this.xhr.setRequestHeader(o,n.headers[o]);this.xhr.onreadystatechange=function(){if(a.xhr){var e,t,i=a.xhr;switch(u("readyState",i.readyState),i.readyState){case 3:try{t=i.status,e=i.responseText}catch(e){}u("status",t),1223===t&&(t=204),200===t&&e&&e.length>0&&(u("chunk"),a.emit("chunk",t,e));break;case 4:t=i.status,u("status",t),1223===t&&(t=204),12005!==t&&12029!==t||(t=0),u("finish",t,i.responseText),a.emit("finish",t,i.responseText),a._cleanup(!1)}}};try{a.xhr.send(i)}catch(e){a.emit("finish",0,""),a._cleanup(!1)}},r.prototype._cleanup=function(e){if(u("cleanup"),this.xhr){if(this.removeAllListeners(),s.unloadDel(this.unloadRef),this.xhr.onreadystatechange=function(){},this.xhr.ontimeout&&(this.xhr.ontimeout=null),e)try{this.xhr.abort()}catch(e){}this.unloadRef=this.xhr=null}},r.prototype.close=function(){u("close"),this._cleanup(!0)},r.enabled=!!c;var d=["Active"].concat("Object").join("X");!r.enabled&&d in n&&(u("overriding xmlhttprequest"),c=function(){try{return new n[d]("Microsoft.XMLHTTP")}catch(e){return null}},r.enabled=!!new c);var h=!1;try{h="withCredentials"in new c}catch(e){}r.supportsCORS=h,t.exports=r}).call(this,{env:{}},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/event":46,"../../utils/url":52,debug:55,events:3,inherits:57}],18:[function(e,t,i){(function(e){t.exports=e.EventSource}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(e,t,i){(function(e){var i=e.WebSocket||e.MozWebSocket;t.exports=i?function(e){return new i(e)}:void 0}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(e,t,i){function n(e){if(!n.enabled())throw new Error("Transport created when disabled");a.call(this,e,"/eventsource",o,s)}var r=e("inherits"),a=e("./lib/ajax-based"),o=e("./receiver/eventsource"),s=e("./sender/xhr-cors"),l=e("eventsource");r(n,a),n.enabled=function(){return!!l},n.transportName="eventsource",n.roundTrips=2,t.exports=n},{"./lib/ajax-based":24,"./receiver/eventsource":29,"./sender/xhr-cors":35,eventsource:18,inherits:57}],21:[function(e,t,i){function n(e){if(!a.enabled)throw new Error("Transport created when disabled");s.call(this,e,"/htmlfile",a,o)}var r=e("inherits"),a=e("./receiver/htmlfile"),o=e("./sender/xhr-local"),s=e("./lib/ajax-based");r(n,s),n.enabled=function(e){return a.enabled&&e.sameOrigin},n.transportName="htmlfile",n.roundTrips=2,t.exports=n},{"./lib/ajax-based":24,"./receiver/htmlfile":30,"./sender/xhr-local":37,inherits:57}],22:[function(e,t,i){(function(i){function n(e,t,i){if(!n.enabled())throw new Error("Transport created when disabled");o.call(this);var r=this;this.origin=l.getOrigin(i),this.baseUrl=i,this.transUrl=t,this.transport=e,this.windowId=d.string(8);var a=l.addPath(i,"/iframe.html")+"#"+this.windowId;h(e,t,a),this.iframeObj=c.createIframe(a,function(e){h("err callback"),r.emit("close",1006,"Unable to load an iframe ("+e+")"),r.close()}),this.onmessageCallback=this._message.bind(this),u.attachEvent("message",this.onmessageCallback)}var r=e("inherits"),a=e("json3"),o=e("events").EventEmitter,s=e("../version"),l=e("../utils/url"),c=e("../utils/iframe"),u=e("../utils/event"),d=e("../utils/random"),h=function(){};"production"!==i.env.NODE_ENV&&(h=e("debug")("sockjs-client:transport:iframe")),r(n,o),n.prototype.close=function(){if(h("close"),this.removeAllListeners(),this.iframeObj){u.detachEvent("message",this.onmessageCallback);try{this.postMessage("c")}catch(e){}this.iframeObj.cleanup(),this.iframeObj=null,this.onmessageCallback=this.iframeObj=null}},n.prototype._message=function(e){if(h("message",e.data),!l.isOriginEqual(e.origin,this.origin))return void h("not same origin",e.origin,this.origin);var t;try{t=a.parse(e.data)}catch(t){return void h("bad json",e.data)}if(t.windowId!==this.windowId)return void h("mismatched window id",t.windowId,this.windowId);switch(t.type){case"s":this.iframeObj.loaded(),this.postMessage("s",a.stringify([s,this.transport,this.transUrl,this.baseUrl]));break;case"t":this.emit("message",t.data);break;case"c":var i;try{i=a.parse(t.data)}catch(e){return void h("bad json",t.data)}this.emit("close",i[0],i[1]),this.close()}},n.prototype.postMessage=function(e,t){h("postMessage",e,t),this.iframeObj.post(a.stringify({windowId:this.windowId,type:e,data:t||""}),this.origin)},n.prototype.send=function(e){h("send",e),this.postMessage("m",e)},n.enabled=function(){return c.iframeEnabled},n.transportName="iframe",n.roundTrips=2,t.exports=n}).call(this,{env:{}})},{"../utils/event":46,"../utils/iframe":47,"../utils/random":50,"../utils/url":52,"../version":53,debug:55,events:3,inherits:57,json3:58}],23:[function(e,t,i){(function(i){function n(e){if(!n.enabled())throw new Error("Transport created when disabled");a.call(this,e,"/jsonp",s,o)}var r=e("inherits"),a=e("./lib/sender-receiver"),o=e("./receiver/jsonp"),s=e("./sender/jsonp");r(n,a),n.enabled=function(){return!!i.document},n.transportName="jsonp-polling",n.roundTrips=1,n.needBody=!0,t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/sender-receiver":28,"./receiver/jsonp":31,"./sender/jsonp":33,inherits:57}],24:[function(e,t,i){(function(i){function n(e){return function(t,i,n){l("create ajax sender",t,i);var r={};"string"==typeof i&&(r.headers={"Content-type":"text/plain"});var a=o.addPath(t,"/xhr_send"),s=new e("POST",a,i,r);return s.once("finish",function(e){if(l("finish",e),s=null,200!==e&&204!==e)return n(new Error("http status "+e));n()}),function(){l("abort"),s.close(),s=null;var e=new Error("Aborted");e.code=1e3,n(e)}}}function r(e,t,i,r){s.call(this,e,t,n(r),i,r)}var a=e("inherits"),o=e("../../utils/url"),s=e("./sender-receiver"),l=function(){};"production"!==i.env.NODE_ENV&&(l=e("debug")("sockjs-client:ajax-based")),a(r,s),t.exports=r}).call(this,{env:{}})},{"../../utils/url":52,"./sender-receiver":28,debug:55,inherits:57}],25:[function(e,t,i){(function(i){function n(e,t){o(e),a.call(this),this.sendBuffer=[],this.sender=t,this.url=e}var r=e("inherits"),a=e("events").EventEmitter,o=function(){};"production"!==i.env.NODE_ENV&&(o=e("debug")("sockjs-client:buffered-sender")),r(n,a),n.prototype.send=function(e){o("send",e),this.sendBuffer.push(e),this.sendStop||this.sendSchedule()},n.prototype.sendScheduleWait=function(){o("sendScheduleWait");var e,t=this;this.sendStop=function(){o("sendStop"),t.sendStop=null,clearTimeout(e)},e=setTimeout(function(){o("timeout"),t.sendStop=null,t.sendSchedule()},25)},n.prototype.sendSchedule=function(){o("sendSchedule",this.sendBuffer.length);var e=this;if(this.sendBuffer.length>0){var t="["+this.sendBuffer.join(",")+"]";this.sendStop=this.sender(this.url,t,function(t){e.sendStop=null,t?(o("error",t),e.emit("close",t.code||1006,"Sending error: "+t),e.close()):e.sendScheduleWait()}),this.sendBuffer=[]}},n.prototype._cleanup=function(){o("_cleanup"),this.removeAllListeners()},n.prototype.close=function(){o("close"),this._cleanup(),this.sendStop&&(this.sendStop(),this.sendStop=null)},t.exports=n}).call(this,{env:{}})},{debug:55,events:3,inherits:57}],26:[function(e,t,i){(function(i){var n=e("inherits"),r=e("../iframe"),a=e("../../utils/object");t.exports=function(e){function t(t,i){r.call(this,e.transportName,t,i)}return n(t,r),t.enabled=function(t,n){if(!i.document)return!1;var o=a.extend({},n);return o.sameOrigin=!0,e.enabled(o)&&r.enabled()},t.transportName="iframe-"+e.transportName,t.needBody=!0,t.roundTrips=r.roundTrips+e.roundTrips-1,t.facadeTransport=e,t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/object":49,"../iframe":22,inherits:57}],27:[function(e,t,i){(function(i){function n(e,t,i){o(t),a.call(this),this.Receiver=e,this.receiveUrl=t,this.AjaxObject=i,this._scheduleReceiver()}var r=e("inherits"),a=e("events").EventEmitter,o=function(){};"production"!==i.env.NODE_ENV&&(o=e("debug")("sockjs-client:polling")),r(n,a),n.prototype._scheduleReceiver=function(){o("_scheduleReceiver");var e=this,t=this.poll=new this.Receiver(this.receiveUrl,this.AjaxObject);t.on("message",function(t){o("message",t),e.emit("message",t)}),t.once("close",function(i,n){o("close",i,n,e.pollIsClosing),e.poll=t=null,e.pollIsClosing||("network"===n?e._scheduleReceiver():(e.emit("close",i||1006,n),e.removeAllListeners()))})},n.prototype.abort=function(){o("abort"),this.removeAllListeners(),this.pollIsClosing=!0,this.poll&&this.poll.abort()},t.exports=n}).call(this,{env:{}})},{debug:55,events:3,inherits:57}],28:[function(e,t,i){(function(i){function n(e,t,i,n,r){var c=a.addPath(e,t);l(c);var u=this;o.call(this,e,i),this.poll=new s(n,c,r),this.poll.on("message",function(e){l("poll message",e),u.emit("message",e)}),this.poll.once("close",function(e,t){l("poll close",e,t),u.poll=null,u.emit("close",e,t),u.close()})}var r=e("inherits"),a=e("../../utils/url"),o=e("./buffered-sender"),s=e("./polling"),l=function(){};"production"!==i.env.NODE_ENV&&(l=e("debug")("sockjs-client:sender-receiver")),r(n,o),n.prototype.close=function(){o.prototype.close.call(this),l("close"),this.removeAllListeners(),this.poll&&(this.poll.abort(),this.poll=null)},t.exports=n}).call(this,{env:{}})},{"../../utils/url":52,"./buffered-sender":25,"./polling":27,debug:55,inherits:57}],29:[function(e,t,i){(function(i){function n(e){s(e),a.call(this);var t=this,i=this.es=new o(e);i.onmessage=function(e){s("message",e.data),t.emit("message",decodeURI(e.data))},i.onerror=function(e){s("error",i.readyState,e);var n=2!==i.readyState?"network":"permanent";t._cleanup(),t._close(n)}}var r=e("inherits"),a=e("events").EventEmitter,o=e("eventsource"),s=function(){};"production"!==i.env.NODE_ENV&&(s=e("debug")("sockjs-client:receiver:eventsource")),r(n,a),n.prototype.abort=function(){s("abort"),this._cleanup(),this._close("user")},n.prototype._cleanup=function(){s("cleanup");var e=this.es;e&&(e.onmessage=e.onerror=null,e.close(),this.es=null)},n.prototype._close=function(e){s("close",e);var t=this;setTimeout(function(){t.emit("close",null,e),t.removeAllListeners()},200)},t.exports=n}).call(this,{env:{}})},{debug:55,events:3,eventsource:18,inherits:57}],30:[function(e,t,i){(function(i,n){function r(e){u(e),l.call(this);var t=this;o.polluteGlobalNamespace(),this.id="a"+c.string(6),e=s.addQuery(e,"c="+decodeURIComponent(o.WPrefix+"."+this.id)),u("using htmlfile",r.htmlfileEnabled);var i=r.htmlfileEnabled?o.createHtmlfile:o.createIframe;n[o.WPrefix][this.id]={start:function(){u("start"),t.iframeObj.loaded()},message:function(e){u("message",e),t.emit("message",e)},stop:function(){u("stop"),t._cleanup(),t._close("network")}},this.iframeObj=i(e,function(){u("callback"),t._cleanup(),t._close("permanent")})}var a=e("inherits"),o=e("../../utils/iframe"),s=e("../../utils/url"),l=e("events").EventEmitter,c=e("../../utils/random"),u=function(){};"production"!==i.env.NODE_ENV&&(u=e("debug")("sockjs-client:receiver:htmlfile")),a(r,l),r.prototype.abort=function(){u("abort"),this._cleanup(),this._close("user")},r.prototype._cleanup=function(){u("_cleanup"),this.iframeObj&&(this.iframeObj.cleanup(),this.iframeObj=null),delete n[o.WPrefix][this.id]},r.prototype._close=function(e){u("_close",e),this.emit("close",null,e),this.removeAllListeners()},r.htmlfileEnabled=!1;var d=["Active"].concat("Object").join("X");if(d in n)try{r.htmlfileEnabled=!!new n[d]("htmlfile")}catch(e){}r.enabled=r.htmlfileEnabled||o.iframeEnabled,t.exports=r}).call(this,{env:{}},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,debug:55,events:3,inherits:57}],31:[function(e,t,i){(function(i,n){function r(e){d(e);var t=this;u.call(this),a.polluteGlobalNamespace(),this.id="a"+o.string(6);var i=l.addQuery(e,"c="+encodeURIComponent(a.WPrefix+"."+this.id));n[a.WPrefix][this.id]=this._callback.bind(this),this._createScript(i),this.timeoutId=setTimeout(function(){d("timeout"),t._abort(new Error("JSONP script loaded abnormally (timeout)"))},r.timeout)}var a=e("../../utils/iframe"),o=e("../../utils/random"),s=e("../../utils/browser"),l=e("../../utils/url"),c=e("inherits"),u=e("events").EventEmitter,d=function(){};"production"!==i.env.NODE_ENV&&(d=e("debug")("sockjs-client:receiver:jsonp")),c(r,u),r.prototype.abort=function(){if(d("abort"),n[a.WPrefix][this.id]){var e=new Error("JSONP user aborted read");e.code=1e3,this._abort(e)}},r.timeout=35e3,r.scriptErrorTimeout=1e3,r.prototype._callback=function(e){d("_callback",e),this._cleanup(),this.aborting||(e&&(d("message",e),this.emit("message",e)),this.emit("close",null,"network"),this.removeAllListeners())},r.prototype._abort=function(e){d("_abort",e),this._cleanup(),this.aborting=!0,this.emit("close",e.code,e.message),this.removeAllListeners()},r.prototype._cleanup=function(){if(d("_cleanup"),clearTimeout(this.timeoutId),this.script2&&(this.script2.parentNode.removeChild(this.script2),this.script2=null),this.script){var e=this.script;e.parentNode.removeChild(e),e.onreadystatechange=e.onerror=e.onload=e.onclick=null,this.script=null}delete n[a.WPrefix][this.id]},r.prototype._scriptError=function(){d("_scriptError");var e=this;this.errorTimer||(this.errorTimer=setTimeout(function(){e.loadedOkay||e._abort(new Error("JSONP script loaded abnormally (onerror)"))},r.scriptErrorTimeout))},r.prototype._createScript=function(e){d("_createScript",e);var t,i=this,r=this.script=n.document.createElement("script");if(r.id="a"+o.string(8),r.src=e,r.type="text/javascript",r.charset="UTF-8",r.onerror=this._scriptError.bind(this),r.onload=function(){d("onload"),i._abort(new Error("JSONP script loaded abnormally (onload)"))},r.onreadystatechange=function(){if(d("onreadystatechange",r.readyState),/loaded|closed/.test(r.readyState)){if(r&&r.htmlFor&&r.onclick){i.loadedOkay=!0;try{r.onclick()}catch(e){}}r&&i._abort(new Error("JSONP script loaded abnormally (onreadystatechange)"))}},void 0===r.async&&n.document.attachEvent)if(s.isOpera())t=this.script2=n.document.createElement("script"),t.text="try{var a = document.getElementById('"+r.id+"'); if(a)a.onerror();}catch(x){};",r.async=t.async=!1;else{try{r.htmlFor=r.id,r.event="onclick"}catch(e){}r.async=!0}void 0!==r.async&&(r.async=!0);var a=n.document.getElementsByTagName("head")[0];a.insertBefore(r,a.firstChild),t&&a.insertBefore(t,a.firstChild)},t.exports=r}).call(this,{env:{}},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/iframe":47,"../../utils/random":50,"../../utils/url":52,debug:55,events:3,inherits:57}],32:[function(e,t,i){(function(i){function n(e,t){o(e),a.call(this);var i=this;this.bufferPosition=0,this.xo=new t("POST",e,null),this.xo.on("chunk",this._chunkHandler.bind(this)),this.xo.once("finish",function(e,t){o("finish",e,t),i._chunkHandler(e,t),i.xo=null;var n=200===e?"network":"permanent";o("close",n),i.emit("close",null,n),i._cleanup()})}var r=e("inherits"),a=e("events").EventEmitter,o=function(){};"production"!==i.env.NODE_ENV&&(o=e("debug")("sockjs-client:receiver:xhr")),r(n,a),n.prototype._chunkHandler=function(e,t){if(o("_chunkHandler",e),200===e&&t)for(var i=-1;;this.bufferPosition+=i+1){var n=t.slice(this.bufferPosition);if(-1===(i=n.indexOf("\n")))break;var r=n.slice(0,i);r&&(o("message",r),this.emit("message",r))}},n.prototype._cleanup=function(){o("_cleanup"),this.removeAllListeners()},n.prototype.abort=function(){o("abort"),this.xo&&(this.xo.close(),o("close"),this.emit("close",null,"user"),this.xo=null),this._cleanup()},t.exports=n}).call(this,{env:{}})},{debug:55,events:3,inherits:57}],33:[function(e,t,i){(function(i,n){function r(e){l("createIframe",e);try{return n.document.createElement('<iframe name="'+e+'">')}catch(i){var t=n.document.createElement("iframe");return t.name=e,t}}function a(){l("createForm"),c=n.document.createElement("form"),c.style.display="none",c.style.position="absolute",c.method="POST",c.enctype="application/x-www-form-urlencoded",c.acceptCharset="UTF-8",u=n.document.createElement("textarea"),u.name="d",c.appendChild(u),n.document.body.appendChild(c)}var o=e("../../utils/random"),s=e("../../utils/url"),l=function(){};"production"!==i.env.NODE_ENV&&(l=e("debug")("sockjs-client:sender:jsonp"));var c,u;t.exports=function(e,t,i){l(e,t),c||a();var n="a"+o.string(8);c.target=n,c.action=s.addQuery(s.addPath(e,"/jsonp_send"),"i="+n);var d=r(n);d.id=n,d.style.display="none",c.appendChild(d);try{u.value=t}catch(e){}c.submit();var h=function(e){l("completed",n,e),d.onerror&&(d.onreadystatechange=d.onerror=d.onload=null,setTimeout(function(){l("cleaning up",n),d.parentNode.removeChild(d),d=null},500),u.value="",i(e))};return d.onerror=function(){l("onerror",n),h()},d.onload=function(){l("onload",n),h()},d.onreadystatechange=function(e){l("onreadystatechange",n,d.readyState,e),"complete"===d.readyState&&h()},function(){l("aborted",n),h(new Error("Aborted"))}}}).call(this,{env:{}},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/random":50,"../../utils/url":52,debug:55}],34:[function(e,t,i){(function(i,n){function r(e,t,i){u(e,t);var n=this;a.call(this),setTimeout(function(){n._start(e,t,i)},0)}var a=e("events").EventEmitter,o=e("inherits"),s=e("../../utils/event"),l=e("../../utils/browser"),c=e("../../utils/url"),u=function(){};"production"!==i.env.NODE_ENV&&(u=e("debug")("sockjs-client:sender:xdr")),o(r,a),r.prototype._start=function(e,t,i){u("_start");var r=this,a=new n.XDomainRequest;t=c.addQuery(t,"t="+ +new Date),a.onerror=function(){u("onerror"),r._error()},a.ontimeout=function(){u("ontimeout"),r._error()},a.onprogress=function(){u("progress",a.responseText),r.emit("chunk",200,a.responseText)},a.onload=function(){u("load"),r.emit("finish",200,a.responseText),r._cleanup(!1)},this.xdr=a,this.unloadRef=s.unloadAdd(function(){r._cleanup(!0)});try{this.xdr.open(e,t),this.timeout&&(this.xdr.timeout=this.timeout),this.xdr.send(i)}catch(e){this._error()}},r.prototype._error=function(){this.emit("finish",0,""),this._cleanup(!1)},r.prototype._cleanup=function(e){if(u("cleanup",e),this.xdr){if(this.removeAllListeners(),s.unloadDel(this.unloadRef),this.xdr.ontimeout=this.xdr.onerror=this.xdr.onprogress=this.xdr.onload=null,e)try{this.xdr.abort()}catch(e){}this.unloadRef=this.xdr=null}},r.prototype.close=function(){u("close"),this._cleanup(!0)},r.enabled=!(!n.XDomainRequest||!l.hasDomain()),t.exports=r}).call(this,{env:{}},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../utils/browser":44,"../../utils/event":46,"../../utils/url":52,debug:55,events:3,inherits:57}],35:[function(e,t,i){function n(e,t,i,n){a.call(this,e,t,i,n)}var r=e("inherits"),a=e("../driver/xhr");r(n,a),n.enabled=a.enabled&&a.supportsCORS,t.exports=n},{"../driver/xhr":17,inherits:57}],36:[function(e,t,i){function n(){var e=this;r.call(this),this.to=setTimeout(function(){e.emit("finish",200,"{}")},n.timeout)}var r=e("events").EventEmitter;e("inherits")(n,r),n.prototype.close=function(){clearTimeout(this.to)},n.timeout=2e3,t.exports=n},{events:3,inherits:57}],37:[function(e,t,i){function n(e,t,i){a.call(this,e,t,i,{noCredentials:!0})}var r=e("inherits"),a=e("../driver/xhr");r(n,a),n.enabled=a.enabled,t.exports=n},{"../driver/xhr":17,inherits:57}],38:[function(e,t,i){(function(i){
|
||
function n(e,t,i){if(!n.enabled())throw new Error("Transport created when disabled");s.call(this),c("constructor",e);var o=this,u=a.addPath(e,"/websocket");u="https"===u.slice(0,5)?"wss"+u.slice(5):"ws"+u.slice(4),this.url=u,this.ws=new l(this.url,[],i),this.ws.onmessage=function(e){c("message event",e.data),o.emit("message",e.data)},this.unloadRef=r.unloadAdd(function(){c("unload"),o.ws.close()}),this.ws.onclose=function(e){c("close event",e.code,e.reason),o.emit("close",e.code,e.reason),o._cleanup()},this.ws.onerror=function(e){c("error event",e),o.emit("close",1006,"WebSocket connection broken"),o._cleanup()}}var r=e("../utils/event"),a=e("../utils/url"),o=e("inherits"),s=e("events").EventEmitter,l=e("./driver/websocket"),c=function(){};"production"!==i.env.NODE_ENV&&(c=e("debug")("sockjs-client:websocket")),o(n,s),n.prototype.send=function(e){var t="["+e+"]";c("send",t),this.ws.send(t)},n.prototype.close=function(){c("close");var e=this.ws;this._cleanup(),e&&e.close()},n.prototype._cleanup=function(){c("_cleanup");var e=this.ws;e&&(e.onmessage=e.onclose=e.onerror=null),r.unloadDel(this.unloadRef),this.unloadRef=this.ws=null,this.removeAllListeners()},n.enabled=function(){return c("enabled"),!!l},n.transportName="websocket",n.roundTrips=2,t.exports=n}).call(this,{env:{}})},{"../utils/event":46,"../utils/url":52,"./driver/websocket":19,debug:55,events:3,inherits:57}],39:[function(e,t,i){function n(e){if(!l.enabled)throw new Error("Transport created when disabled");a.call(this,e,"/xhr",s,l)}var r=e("inherits"),a=e("./lib/ajax-based"),o=e("./xdr-streaming"),s=e("./receiver/xhr"),l=e("./sender/xdr");r(n,a),n.enabled=o.enabled,n.transportName="xdr-polling",n.roundTrips=2,t.exports=n},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,"./xdr-streaming":40,inherits:57}],40:[function(e,t,i){function n(e){if(!s.enabled)throw new Error("Transport created when disabled");a.call(this,e,"/xhr_streaming",o,s)}var r=e("inherits"),a=e("./lib/ajax-based"),o=e("./receiver/xhr"),s=e("./sender/xdr");r(n,a),n.enabled=function(e){return!e.cookie_needed&&!e.nullOrigin&&(s.enabled&&e.sameScheme)},n.transportName="xdr-streaming",n.roundTrips=2,t.exports=n},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xdr":34,inherits:57}],41:[function(e,t,i){function n(e){if(!l.enabled&&!s.enabled)throw new Error("Transport created when disabled");a.call(this,e,"/xhr",o,s)}var r=e("inherits"),a=e("./lib/ajax-based"),o=e("./receiver/xhr"),s=e("./sender/xhr-cors"),l=e("./sender/xhr-local");r(n,a),n.enabled=function(e){return!e.nullOrigin&&(!(!l.enabled||!e.sameOrigin)||s.enabled)},n.transportName="xhr-polling",n.roundTrips=2,t.exports=n},{"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,inherits:57}],42:[function(e,t,i){(function(i){function n(e){if(!l.enabled&&!s.enabled)throw new Error("Transport created when disabled");a.call(this,e,"/xhr_streaming",o,s)}var r=e("inherits"),a=e("./lib/ajax-based"),o=e("./receiver/xhr"),s=e("./sender/xhr-cors"),l=e("./sender/xhr-local"),c=e("../utils/browser");r(n,a),n.enabled=function(e){return!e.nullOrigin&&(!c.isOpera()&&s.enabled)},n.transportName="xhr-streaming",n.roundTrips=2,n.needBody=!!i.document,t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../utils/browser":44,"./lib/ajax-based":24,"./receiver/xhr":32,"./sender/xhr-cors":35,"./sender/xhr-local":37,inherits:57}],43:[function(e,t,i){(function(e){e.crypto&&e.crypto.getRandomValues?t.exports.randomBytes=function(t){var i=new Uint8Array(t);return e.crypto.getRandomValues(i),i}:t.exports.randomBytes=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=Math.floor(256*Math.random());return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],44:[function(e,t,i){(function(e){t.exports={isOpera:function(){return e.navigator&&/opera/i.test(e.navigator.userAgent)},isKonqueror:function(){return e.navigator&&/konqueror/i.test(e.navigator.userAgent)},hasDomain:function(){if(!e.document)return!0;try{return!!e.document.domain}catch(e){return!1}}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(e,t,i){var n,r=e("json3"),a=/[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g,o=function(e){var t,i={},n=[];for(t=0;t<65536;t++)n.push(String.fromCharCode(t));return e.lastIndex=0,n.join("").replace(e,function(e){return i[e]="\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4),""}),e.lastIndex=0,i};t.exports={quote:function(e){var t=r.stringify(e);return a.lastIndex=0,a.test(t)?(n||(n=o(a)),t.replace(a,function(e){return n[e]})):t}}},{json3:58}],46:[function(e,t,i){(function(i){var n=e("./random"),r={},a=!1,o=i.chrome&&i.chrome.app&&i.chrome.app.runtime;t.exports={attachEvent:function(e,t){void 0!==i.addEventListener?i.addEventListener(e,t,!1):i.document&&i.attachEvent&&(i.document.attachEvent("on"+e,t),i.attachEvent("on"+e,t))},detachEvent:function(e,t){void 0!==i.addEventListener?i.removeEventListener(e,t,!1):i.document&&i.detachEvent&&(i.document.detachEvent("on"+e,t),i.detachEvent("on"+e,t))},unloadAdd:function(e){if(o)return null;var t=n.string(8);return r[t]=e,a&&setTimeout(this.triggerUnloadCallbacks,0),t},unloadDel:function(e){e in r&&delete r[e]},triggerUnloadCallbacks:function(){for(var e in r)r[e](),delete r[e]}};var s=function(){a||(a=!0,t.exports.triggerUnloadCallbacks())};o||t.exports.attachEvent("unload",s)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./random":50}],47:[function(e,t,i){(function(i,n){var r=e("./event"),a=e("json3"),o=e("./browser"),s=function(){};"production"!==i.env.NODE_ENV&&(s=e("debug")("sockjs-client:utils:iframe")),t.exports={WPrefix:"_jp",currentWindowId:null,polluteGlobalNamespace:function(){t.exports.WPrefix in n||(n[t.exports.WPrefix]={})},postMessage:function(e,i){n.parent!==n?n.parent.postMessage(a.stringify({windowId:t.exports.currentWindowId,type:e,data:i||""}),"*"):s("Cannot postMessage, no parent window.",e,i)},createIframe:function(e,t){var i,a,o=n.document.createElement("iframe"),l=function(){s("unattach"),clearTimeout(i);try{o.onload=null}catch(e){}o.onerror=null},c=function(){s("cleanup"),o&&(l(),setTimeout(function(){o&&o.parentNode.removeChild(o),o=null},0),r.unloadDel(a))},u=function(e){s("onerror",e),o&&(c(),t(e))},d=function(e,t){s("post",e,t),setTimeout(function(){try{o&&o.contentWindow&&o.contentWindow.postMessage(e,t)}catch(e){}},0)};return o.src=e,o.style.display="none",o.style.position="absolute",o.onerror=function(){u("onerror")},o.onload=function(){s("onload"),clearTimeout(i),i=setTimeout(function(){u("onload timeout")},2e3)},n.document.body.appendChild(o),i=setTimeout(function(){u("timeout")},15e3),a=r.unloadAdd(c),{post:d,cleanup:c,loaded:l}},createHtmlfile:function(e,i){var a,o,l,c=["Active"].concat("Object").join("X"),u=new n[c]("htmlfile"),d=function(){clearTimeout(a),l.onerror=null},h=function(){u&&(d(),r.unloadDel(o),l.parentNode.removeChild(l),l=u=null,CollectGarbage())},p=function(e){s("onerror",e),u&&(h(),i(e))},f=function(e,t){try{setTimeout(function(){l&&l.contentWindow&&l.contentWindow.postMessage(e,t)},0)}catch(e){}};u.open(),u.write('<html><script>document.domain="'+n.document.domain+'";<\/script></html>'),u.close(),u.parentWindow[t.exports.WPrefix]=n[t.exports.WPrefix];var m=u.createElement("div");return u.body.appendChild(m),l=u.createElement("iframe"),m.appendChild(l),l.src=e,l.onerror=function(){p("onerror")},a=setTimeout(function(){p("timeout")},15e3),o=r.unloadAdd(h),{post:f,cleanup:h,loaded:d}}},t.exports.iframeEnabled=!1,n.document&&(t.exports.iframeEnabled=("function"==typeof n.postMessage||"object"==typeof n.postMessage)&&!o.isKonqueror())}).call(this,{env:{}},"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./browser":44,"./event":46,debug:55,json3:58}],48:[function(e,t,i){(function(e){var i={};["log","debug","warn"].forEach(function(t){var n;try{n=e.console&&e.console[t]&&e.console[t].apply}catch(e){}i[t]=n?function(){return e.console[t].apply(e.console,arguments)}:"log"===t?function(){}:i.log}),t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],49:[function(e,t,i){t.exports={isObject:function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},extend:function(e){if(!this.isObject(e))return e;for(var t,i,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}}},{}],50:[function(e,t,i){var n=e("crypto"),r="abcdefghijklmnopqrstuvwxyz012345";t.exports={string:function(e){for(var t=r.length,i=n.randomBytes(e),a=[],o=0;o<e;o++)a.push(r.substr(i[o]%t,1));return a.join("")},number:function(e){return Math.floor(Math.random()*e)},numberString:function(e){var t=(""+(e-1)).length;return(new Array(t+1).join("0")+this.number(e)).slice(-t)}}},{crypto:43}],51:[function(e,t,i){(function(i){var n=function(){};"production"!==i.env.NODE_ENV&&(n=e("debug")("sockjs-client:utils:transport")),t.exports=function(e){return{filterToEnabled:function(t,i){var r={main:[],facade:[]};return t?"string"==typeof t&&(t=[t]):t=[],e.forEach(function(e){if(e)return"websocket"===e.transportName&&!1===i.websocket?void n("disabled from server","websocket"):t.length&&-1===t.indexOf(e.transportName)?void n("not in whitelist",e.transportName):void(e.enabled(i)?(n("enabled",e.transportName),r.main.push(e),e.facadeTransport&&r.facade.push(e.facadeTransport)):n("disabled",e.transportName))}),r}}}}).call(this,{env:{}})},{debug:55}],52:[function(e,t,i){(function(i){var n=e("url-parse"),r=function(){};"production"!==i.env.NODE_ENV&&(r=e("debug")("sockjs-client:utils:url")),t.exports={getOrigin:function(e){if(!e)return null;var t=new n(e);if("file:"===t.protocol)return null;var i=t.port;return i||(i="https:"===t.protocol?"443":"80"),t.protocol+"//"+t.hostname+":"+i},isOriginEqual:function(e,t){var i=this.getOrigin(e)===this.getOrigin(t);return r("same",e,t,i),i},isSchemeEqual:function(e,t){return e.split(":")[0]===t.split(":")[0]},addPath:function(e,t){var i=e.split("?");return i[0]+t+(i[1]?"?"+i[1]:"")},addQuery:function(e,t){return e+(-1===e.indexOf("?")?"?"+t:"&"+t)}}}).call(this,{env:{}})},{debug:55,"url-parse":61}],53:[function(e,t,i){t.exports="1.3.0"},{}],54:[function(e,t,i){function n(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\-?\d?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var i=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*h;case"weeks":case"week":case"w":return i*d;case"days":case"day":case"d":return i*u;case"hours":case"hour":case"hrs":case"hr":case"h":return i*c;case"minutes":case"minute":case"mins":case"min":case"m":return i*l;case"seconds":case"second":case"secs":case"sec":case"s":return i*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}}}function r(e){var t=Math.abs(e);return t>=u?Math.round(e/u)+"d":t>=c?Math.round(e/c)+"h":t>=l?Math.round(e/l)+"m":t>=s?Math.round(e/s)+"s":e+"ms"}function a(e){var t=Math.abs(e);return t>=u?o(e,t,u,"day"):t>=c?o(e,t,c,"hour"):t>=l?o(e,t,l,"minute"):t>=s?o(e,t,s,"second"):e+" ms"}function o(e,t,i,n){var r=t>=1.5*i;return Math.round(e/i)+" "+n+(r?"s":"")}var s=1e3,l=60*s,c=60*l,u=24*c,d=7*u,h=365.25*u;t.exports=function(e,t){t=t||{};var i=typeof e;if("string"===i&&e.length>0)return n(e);if("number"===i&&!1===isNaN(e))return t.long?a(e):r(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],55:[function(e,t,i){(function(n){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),this.useColors){var i="color: "+this.color;e.splice(1,0,i,"color: inherit");var n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(n++,"%c"===e&&(r=n))}),e.splice(r,0,i)}}function s(){var e;return"object"===("undefined"==typeof console?"undefined":r(console))&&console.log&&(e=console).log.apply(e,arguments)}function l(e){try{e?i.storage.setItem("debug",e):i.storage.removeItem("debug")}catch(e){}}function c(){var e;try{e=i.storage.getItem("debug")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e}i.log=s,i.formatArgs=o,i.save=l,i.load=c,i.useColors=a,i.storage=function(){try{return localStorage}catch(e){}}(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=e("./common")(i),t.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,{env:{}})},{"./common":56}],56:[function(e,t,i){function n(t){function i(e){for(var t=0,i=0;i<e.length;i++)t=(t<<5)-t+e.charCodeAt(i),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){function t(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];if(t.enabled){var a=t,s=Number(new Date),l=s-(o||s);a.diff=l,a.prev=o,a.curr=s,o=s,i[0]=n.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var c=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(e,t){if("%%"===e)return e;c++;var r=n.formatters[t];if("function"==typeof r){var o=i[c];e=r.call(a,o),i.splice(c,1),c--}return e}),n.formatArgs.call(a,i);(a.log||n.log).apply(a,i)}}var o;return t.namespace=e,t.enabled=n.enabled(e),t.useColors=n.useColors(),t.color=i(e),t.destroy=r,t.extend=a,"function"==typeof n.init&&n.init(t),n.instances.push(t),t}function r(){var e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function a(e,t){return n(this.namespace+(void 0===t?":":t)+e)}function o(e){n.save(e),n.names=[],n.skips=[];var t,i=("string"==typeof e?e:"").split(/[\s,]+/),r=i.length;for(t=0;t<r;t++)i[t]&&(e=i[t].replace(/\*/g,".*?"),"-"===e[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){var a=n.instances[t];a.enabled=n.enabled(a.namespace)}}function s(){n.enable("")}function l(e){if("*"===e[e.length-1])return!0;var t,i;for(t=0,i=n.skips.length;t<i;t++)if(n.skips[t].test(e))return!1;for(t=0,i=n.names.length;t<i;t++)if(n.names[t].test(e))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}return n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=o,n.enabled=l,n.humanize=e("ms"),Object.keys(t).forEach(function(e){n[e]=t[e]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=i,n.enable(n.load()),n}t.exports=n},{ms:54}],57:[function(e,t,i){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}},{}],58:[function(t,i,n){(function(t){(function(){function r(e,t){function i(e){if(i[e]!==g)return i[e];var r;if("bug-string-char-index"==e)r="a"!="a"[0];else if("json"==e)r=i("json-stringify")&&i("json-parse");else{var o,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var l=t.stringify,u="function"==typeof l&&_;if(u){(o=function(){return 1}).toJSON=o;try{u="0"===l(0)&&"0"===l(new n)&&'""'==l(new a)&&l(y)===g&&l(g)===g&&l()===g&&"1"===l(o)&&"[1]"==l([o])&&"[null]"==l([g])&&"null"==l(null)&&"[null,null,null]"==l([g,y,null])&&l({a:[o,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===l(null,o)&&"[\n 1,\n 2\n]"==l([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==l(new c(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==l(new c(864e13))&&'"-000001-01-01T00:00:00.000Z"'==l(new c(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==l(new c(-1))}catch(e){u=!1}}r=u}if("json-parse"==e){var d=t.parse;if("function"==typeof d)try{if(0===d("0")&&!d(!1)){o=d(s);var h=5==o.a.length&&1===o.a[0];if(h){try{h=!d('"\t"')}catch(e){}if(h)try{h=1!==d("01")}catch(e){}if(h)try{h=1!==d("1.")}catch(e){}}}}catch(e){h=!1}r=h}}return i[e]=!!r}e||(e=l.Object()),t||(t=l.Object());var n=e.Number||l.Number,a=e.String||l.String,s=e.Object||l.Object,c=e.Date||l.Date,u=e.SyntaxError||l.SyntaxError,d=e.TypeError||l.TypeError,h=e.Math||l.Math,p=e.JSON||l.JSON;"object"==typeof p&&p&&(t.stringify=p.stringify,t.parse=p.parse);var f,m,g,v=s.prototype,y=v.toString,_=new c(-0xc782b5b800cec);try{_=-109252==_.getUTCFullYear()&&0===_.getUTCMonth()&&1===_.getUTCDate()&&10==_.getUTCHours()&&37==_.getUTCMinutes()&&6==_.getUTCSeconds()&&708==_.getUTCMilliseconds()}catch(e){}if(!i("json")){var b=i("bug-string-char-index");if(!_)var w=h.floor,x=[0,31,59,90,120,151,181,212,243,273,304,334],k=function(e,t){return x[t]+365*(e-1970)+w((e-1969+(t=+(t>1)))/4)-w((e-1901+t)/100)+w((e-1601+t)/400)};if((f=v.hasOwnProperty)||(f=function(e){var t,i={};return(i.__proto__=null,i.__proto__={toString:1},i).toString!=y?f=function(e){var t=this.__proto__,i=e in(this.__proto__=null,this);return this.__proto__=t,i}:(t=i.constructor,f=function(e){var i=(this.constructor||t).prototype;return e in this&&!(e in i&&this[e]===i[e])}),i=null,f.call(this,e)}),m=function(e,t){var i,n,r,a=0;(i=function(){this.valueOf=0}).prototype.valueOf=0,n=new i;for(r in n)f.call(n,r)&&a++;return i=n=null,a?m=2==a?function(e,t){var i,n={},r="[object Function]"==y.call(e);for(i in e)r&&"prototype"==i||f.call(n,i)||!(n[i]=1)||!f.call(e,i)||t(i)}:function(e,t){var i,n,r="[object Function]"==y.call(e);for(i in e)r&&"prototype"==i||!f.call(e,i)||(n="constructor"===i)||t(i);(n||f.call(e,i="constructor"))&&t(i)}:(n=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],m=function(e,t){var i,r,a="[object Function]"==y.call(e),s=!a&&"function"!=typeof e.constructor&&o[typeof e.hasOwnProperty]&&e.hasOwnProperty||f;for(i in e)a&&"prototype"==i||!s.call(e,i)||t(i);for(r=n.length;i=n[--r];s.call(e,i)&&t(i));}),m(e,t)},!i("json-stringify")){var C={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T=function(e,t){return("000000"+(t||0)).slice(-e)},S=function(e){for(var t='"',i=0,n=e.length,r=!b||n>10,a=r&&(b?e.split(""):e);i<n;i++){var o=e.charCodeAt(i);switch(o){case 8:case 9:case 10:case 12:case 13:case 34:case 92:t+=C[o];break;default:if(o<32){t+="\\u00"+T(2,o.toString(16));break}t+=r?a[i]:e.charAt(i)}}return t+'"'},E=function(e,t,i,n,r,a,o){var s,l,c,u,h,p,v,_,b,x,C,A,I,D,M,L;try{s=t[e]}catch(e){}if("object"==typeof s&&s)if("[object Date]"!=(l=y.call(s))||f.call(s,"toJSON"))"function"==typeof s.toJSON&&("[object Number]"!=l&&"[object String]"!=l&&"[object Array]"!=l||f.call(s,"toJSON"))&&(s=s.toJSON(e));else if(s>-1/0&&s<1/0){if(k){for(h=w(s/864e5),c=w(h/365.2425)+1970-1;k(c+1,0)<=h;c++);for(u=w((h-k(c,0))/30.42);k(c,u+1)<=h;u++);h=1+h-k(c,u),p=(s%864e5+864e5)%864e5,v=w(p/36e5)%24,_=w(p/6e4)%60,b=w(p/1e3)%60,x=p%1e3}else c=s.getUTCFullYear(),u=s.getUTCMonth(),h=s.getUTCDate(),v=s.getUTCHours(),_=s.getUTCMinutes(),b=s.getUTCSeconds(),x=s.getUTCMilliseconds();s=(c<=0||c>=1e4?(c<0?"-":"+")+T(6,c<0?-c:c):T(4,c))+"-"+T(2,u+1)+"-"+T(2,h)+"T"+T(2,v)+":"+T(2,_)+":"+T(2,b)+"."+T(3,x)+"Z"}else s=null;if(i&&(s=i.call(t,e,s)),null===s)return"null";if("[object Boolean]"==(l=y.call(s)))return""+s;if("[object Number]"==l)return s>-1/0&&s<1/0?""+s:"null";if("[object String]"==l)return S(""+s);if("object"==typeof s){for(D=o.length;D--;)if(o[D]===s)throw d();if(o.push(s),C=[],M=a,a+=r,"[object Array]"==l){for(I=0,D=s.length;I<D;I++)A=E(I,s,i,n,r,a,o),C.push(A===g?"null":A);L=C.length?r?"[\n"+a+C.join(",\n"+a)+"\n"+M+"]":"["+C.join(",")+"]":"[]"}else m(n||s,function(e){var t=E(e,s,i,n,r,a,o);t!==g&&C.push(S(e)+":"+(r?" ":"")+t)}),L=C.length?r?"{\n"+a+C.join(",\n"+a)+"\n"+M+"}":"{"+C.join(",")+"}":"{}";return o.pop(),L}};t.stringify=function(e,t,i){var n,r,a,s;if(o[typeof t]&&t)if("[object Function]"==(s=y.call(t)))r=t;else if("[object Array]"==s){a={};for(var l,c=0,u=t.length;c<u;l=t[c++],("[object String]"==(s=y.call(l))||"[object Number]"==s)&&(a[l]=1));}if(i)if("[object Number]"==(s=y.call(i))){if((i-=i%1)>0)for(n="",i>10&&(i=10);n.length<i;n+=" ");}else"[object String]"==s&&(n=i.length<=10?i:i.slice(0,10));return E("",(l={},l[""]=e,l),r,a,n,"",[])}}if(!i("json-parse")){var A,I,D=a.fromCharCode,M={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},L=function(){throw A=I=null,u()},O=function(){for(var e,t,i,n,r,a=I,o=a.length;A<o;)switch(r=a.charCodeAt(A)){case 9:case 10:case 13:case 32:A++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=b?a.charAt(A):a[A],A++,e;case 34:for(e="@",A++;A<o;)if((r=a.charCodeAt(A))<32)L();else if(92==r)switch(r=a.charCodeAt(++A)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=M[r],A++;break;case 117:for(t=++A,i=A+4;A<i;A++)(r=a.charCodeAt(A))>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70||L();e+=D("0x"+a.slice(t,A));break;default:L()}else{if(34==r)break;for(r=a.charCodeAt(A),t=A;r>=32&&92!=r&&34!=r;)r=a.charCodeAt(++A);e+=a.slice(t,A)}if(34==a.charCodeAt(A))return A++,e;L();default:if(t=A,45==r&&(n=!0,r=a.charCodeAt(++A)),r>=48&&r<=57){for(48==r&&(r=a.charCodeAt(A+1))>=48&&r<=57&&L(),n=!1;A<o&&(r=a.charCodeAt(A))>=48&&r<=57;A++);if(46==a.charCodeAt(A)){for(i=++A;i<o&&(r=a.charCodeAt(i))>=48&&r<=57;i++);i==A&&L(),A=i}if(101==(r=a.charCodeAt(A))||69==r){for(r=a.charCodeAt(++A),43!=r&&45!=r||A++,i=A;i<o&&(r=a.charCodeAt(i))>=48&&r<=57;i++);i==A&&L(),A=i}return+a.slice(t,A)}if(n&&L(),"true"==a.slice(A,A+4))return A+=4,!0;if("false"==a.slice(A,A+5))return A+=5,!1;if("null"==a.slice(A,A+4))return A+=4,null;L()}return"$"},N=function(e){var t,i;if("$"==e&&L(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=O());i||(i=!0))i&&(","==e?"]"==(e=O())&&L():L()),","==e&&L(),t.push(N(e));return t}if("{"==e){for(t={};"}"!=(e=O());i||(i=!0))i&&(","==e?"}"==(e=O())&&L():L()),","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==O()||L(),t[e.slice(1)]=N(O());return t}L()}return e},P=function(e,t,i){var n=R(e,t,i);n===g?delete e[t]:e[t]=n},R=function(e,t,i){var n,r=e[t];if("object"==typeof r&&r)if("[object Array]"==y.call(r))for(n=r.length;n--;)P(r,n,i);else m(r,function(e){P(r,e,i)});return i.call(e,t,r)};t.parse=function(e,t){var i,n;return A=0,I=""+e,i=N(O()),"$"!=O()&&L(),A=I=null,t&&"[object Function]"==y.call(t)?R((n={},n[""]=i,n),"",t):i}}}return t.runInContext=r,t}var a="function"==typeof e&&e.amd,o={function:!0,object:!0},s=o[typeof n]&&n&&!n.nodeType&&n,l=o[typeof window]&&window||this,c=s&&o[typeof i]&&i&&!i.nodeType&&"object"==typeof t&&t;if(!c||c.global!==c&&c.window!==c&&c.self!==c||(l=c),s&&!a)r(l,s);else{var u=l.JSON,d=l.JSON3,h=!1,p=r(l,l.JSON3={noConflict:function(){return h||(h=!0,l.JSON=u,l.JSON3=d,u=d=null),p}});l.JSON={parse:p.parse,stringify:p.stringify}}a&&e(function(){return p})}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],59:[function(e,t,i){function n(e){return decodeURIComponent(e.replace(/\+/g," "))}function r(e){for(var t,i=/([^=?&]+)=?([^&]*)/g,r={};t=i.exec(e);){var a=n(t[1]),o=n(t[2]);a in r||(r[a]=o)}return r}function a(e,t){t=t||"";var i=[];"string"!=typeof t&&(t="?");for(var n in e)o.call(e,n)&&i.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return i.length?t+i.join("&"):""}var o=Object.prototype.hasOwnProperty;i.stringify=a,i.parse=r},{}],60:[function(e,t,i){t.exports=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e}},{}],61:[function(e,t,i){(function(i){function n(e){var t=i&&i.location||{};e=e||t;var n,r={},a=typeof e;if("blob:"===e.protocol)r=new o(unescape(e.pathname),{});else if("string"===a){r=new o(e,{});for(n in f)delete r[n]}else if("object"===a){for(n in e)n in f||(r[n]=e[n]);void 0===r.slashes&&(r.slashes=h.test(e.href))}return r}function r(e){var t=d.exec(e);return{protocol:t[1]?t[1].toLowerCase():"",slashes:!!t[2],rest:t[3]}}function a(e,t){for(var i=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=i.length,r=i[n-1],a=!1,o=0;n--;)"."===i[n]?i.splice(n,1):".."===i[n]?(i.splice(n,1),o++):o&&(0===n&&(a=!0),i.splice(n,1),o--);return a&&i.unshift(""),"."!==r&&".."!==r||i.push(""),i.join("/")}function o(e,t,i){if(!(this instanceof o))return new o(e,t,i);var s,l,d,h,f,m,g=p.slice(),v=typeof t,y=this,_=0;for("object"!==v&&"string"!==v&&(i=t,t=null),i&&"function"!=typeof i&&(i=u.parse),t=n(t),l=r(e||""),s=!l.protocol&&!l.slashes,y.slashes=l.slashes||s&&t.slashes,y.protocol=l.protocol||t.protocol||"",e=l.rest,l.slashes||(g[3]=[/(.*)/,"pathname"]);_<g.length;_++)h=g[_],"function"!=typeof h?(d=h[0],m=h[1],d!==d?y[m]=e:"string"==typeof d?~(f=e.indexOf(d))&&("number"==typeof h[2]?(y[m]=e.slice(0,f),e=e.slice(f+h[2])):(y[m]=e.slice(f),e=e.slice(0,f))):(f=d.exec(e))&&(y[m]=f[1],e=e.slice(0,f.index)),y[m]=y[m]||(s&&h[3]?t[m]||"":""),h[4]&&(y[m]=y[m].toLowerCase())):e=h(e);i&&(y.query=i(y.query)),s&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=a(y.pathname,t.pathname)),c(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(h=y.auth.split(":"),y.username=h[0]||"",y.password=h[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}function s(e,t,i){var n=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(i||u.parse)(t)),n[e]=t;break;case"port":n[e]=t,c(t,n.protocol)?t&&(n.host=n.hostname+":"+t):(n.host=n.hostname,n[e]="");break;case"hostname":n[e]=t,n.port&&(t+=":"+n.port),n.host=t;break;case"host":n[e]=t,/:\d+$/.test(t)?(t=t.split(":"),n.port=t.pop(),n.hostname=t.join(":")):(n.hostname=t,n.port="");break;case"protocol":n.protocol=t.toLowerCase(),n.slashes=!i;break;case"pathname":case"hash":if(t){var r="pathname"===e?"/":"#";n[e]=t.charAt(0)!==r?r+t:t}else n[e]=t;break;default:n[e]=t}for(var a=0;a<p.length;a++){var o=p[a];o[4]&&(n[o[1]]=n[o[1]].toLowerCase())}return n.origin=n.protocol&&n.host&&"file:"!==n.protocol?n.protocol+"//"+n.host:"null",n.href=n.toString(),n}function l(e){e&&"function"==typeof e||(e=u.stringify);var t,i=this,n=i.protocol;n&&":"!==n.charAt(n.length-1)&&(n+=":");var r=n+(i.slashes?"//":"");return i.username&&(r+=i.username,i.password&&(r+=":"+i.password),r+="@"),r+=i.host+i.pathname,t="object"==typeof i.query?e(i.query):i.query,t&&(r+="?"!==t.charAt(0)?"?"+t:t),i.hash&&(r+=i.hash),r}var c=e("requires-port"),u=e("querystringify"),d=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,h=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,p=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],f={hash:1,query:1};o.prototype={set:s,toString:l},o.extractProtocol=r,o.location=n,o.qs=u,t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{querystringify:59,"requires-port":60}]},{},[1])(1)}),define("message",["jquery","app-utils","sockjs"],function(e,t,i){var n=function(e){this.appManager=e,this.appKey="6b696b697773",this.options={wsUrl:t.getRootUrl(this.appKey),wsHeaders:{Authorization:SDC.user.auth_token}}};return n.prototype={initialize:function(){var e=this;SDC.websockets&&SDC.websockets.length>0&&SDC.websockets.forEach(function(t){SDC.user.user_id&&e.wsConnect(t)})},wsConnect:function(e){var t=this;SDC[e]||("RegionOne"==e&&(SDC[e]=new WebSocket(SDC.sock_type+"://"+SDC.SOCKJS_URL+"/"+SDC.user.auth_token)),"RegionTwo"==e&&(SDC[e]=new WebSocket("wss://console.shanhe.com:8000/socket.io/1/websocket/17fd3a6842180b850092b24585dc8420?uid=usr-9WC3zjpI&sid=R6jNjDHWDEbiAJwSPFx27wjd2dKN5Pi9&zid=jn1"))),SDC[e].onopen||(SDC[e].onopen=function(){}),SDC[e].onmessage=function(i){if("RegionOne"==e){var n=JSON.parse(i.data);if(t.appManager&&t.appManager.appList&&n&&n.app_ids)for(var r=n.app_ids,a=0;a<r.length;a++){var o=r[a],s=t.appManager.appList[o];s&&s.onMessage&&s.onMessage(n)}}if("RegionTwo"==e){var n=i.data;switch(n[0]){case"5":if(n.app_ids=["aaf1","aaf2","aaf3","aaf4","aaf5","aaf6"],t.appManager&&t.appManager.appList&&n&&n.app_ids)for(var r=n.app_ids,a=0;a<r.length;a++){var o=r[a],s=t.appManager.appList[o];if(s&&s.onMessage){var l=JSON.parse(n.slice(9));s.onMessage(l)}}}}},SDC[e].onclose=function(i){setTimeout(function(){SDC[e]=null,t.wsConnect(e)},2e4)}}},n}),define("obj-openstack",[],function(){return{isPortInSubnet:function(e,t){var i=e.device_owner;if(("network:router_interface"==i||"compute:None"==i||""==i)&&e.fixed_ips&&e.fixed_ips.length>0){return e.fixed_ips[0].subnet_id==t}return!1},findPortSubnetId:function(e){var t=e.device_owner;if(("network:router_interface"==t||"compute:None"==t||""==t)&&e.fixed_ips&&e.fixed_ips.length>0){return e.fixed_ips[0].subnet_id}return null},getPortIP:function(e){var t=e.device_owner;if(("network:router_interface"==t||"compute:None"==t||""==t)&&e.fixed_ips&&e.fixed_ips.length>0){return e.fixed_ips[0].ip_address}return""},fetchObjectName:function(e,t){if(!e)return"";var i=null;switch(t){case"volume":
|
||
i=e.displayName||e.name;break;case"floatingip":i=e.floating_ip_address;break;default:i=e.name||e.id}return i?"object"==typeof i?i.name:i:""}}}),define("text!modules/slab/message/lang.json",[],function(){return'{\r\n "language": {\r\n "zh-hans": {\r\n "volume": "数据盘",\r\n "instance": "云主机",\r\n "security_group": "安全组",\r\n "floatingip": "公网IP",\r\n "floating_ipset": "多线公网IP",\r\n "port_forwarding": "端口转发规则",\r\n "port": "虚拟网卡",\r\n "keypair": "密钥",\r\n "router": "路由器",\r\n "volume_snapshot": "数据盘快照",\r\n "image": "主机快照",\r\n "pptpconnection": "VPN",\r\n "security_group_rule": "安全组规则",\r\n "network": "网络",\r\n "subnet": "子网",\r\n "localresize": "更改配置",\r\n "prep_resize": "更改配置",\r\n "confirm_resize": "更改配置",\r\n "resize": "更改配置",\r\n "finish_resize": "更改配置",\r\n "prepresize": "更改配置",\r\n "confirmresize": "更改配置",\r\n "livemigration": "迁移",\r\n "member": "成员",\r\n "user": "用户",\r\n "invitation": "协作用户",\r\n "project": "项目",\r\n "loadbalancer": "负载均衡器",\r\n "pool": "资源池",\r\n "ikepolicy": "IKE策略",\r\n "ipsecpolicy": "IPsec策略",\r\n "database_instance": "数据库",\r\n "database_config": "数据库配置组",\r\n "database_instance_user": "数据库用户",\r\n "payment": "支付",\r\n "delete": "删除",\r\n "attach": "挂载",\r\n "create": "创建",\r\n "detach": "解除",\r\n "update": "更新",\r\n "poweron": "开启",\r\n "shutdown": "关闭",\r\n "shutdown2": "关闭",\r\n "poweroff": "关闭",\r\n "reboot": "重启",\r\n "restart": "重启",\r\n "modifyvolume": "扩容",\r\n "modifyflavor": "更新配置",\r\n "unassignconf": "解绑配置组",\r\n "assignconf": "关联配置组",\r\n "detachinterface": "离开网络",\r\n "attachinterface": "加入网络",\r\n "instance_snapshot": "正在为云主机 \\"{1}\\" 创建主机快照...",\r\n "instance_snapshot_done": "云主机 \\"{1}\\" 创建主机快照完成。",\r\n "instance_keypair_done": "云主机 \\"{1}\\" 的密钥已修改。",\r\n "floatingip_updateratelimit": "正在更新公网IP \\"{1}\\" 带宽...",\r\n "floatingip_updateratelimit_done": "公网IP \\"{1}\\" 带宽更新成功。",\r\n "floatingip_attachrouter_done": "绑定公网IP \\"{1}\\" 到路由器成功。",\r\n "floatingip_attachinstance_done": "绑定公网IP \\"{1}\\" 到云主机成功。",\r\n "floatingip_attachlbs_done": "绑定公网IP \\"{1}\\" 到负载均衡成功。",\r\n "floating_ipset_updateratelimit": "正在更新多线公网IP \\"{1}\\" 带宽...",\r\n "floating_ipset_updateratelimit_done": "多线公网IP \\"{1}\\" 带宽更新成功。",\r\n "floating_ipset_attachrouter_done": "绑定多线公网IP \\"{1}\\" 到路由器成功。",\r\n "floating_ipset_attachinstance_done": "绑定多线公网IP \\"{1}\\" 到云主机成功。",\r\n "router.interface_delete_done": "路由器 \\"{1}\\" 已经解除关联子网。",\r\n "router.interface_create_done": "路由器 \\"{1}\\" 已经关联子网。",\r\n "port_updatesecuritygroup": "正在更新虚拟网卡 \\"{1}\\" 的安全组...",\r\n "floatingip_updateregisterno_done": "公网IP \\"{1}\\" 备案更新成功。",\r\n "floating_ipset_updateregisterno_done": "多线公网IP \\"{1}\\" 备案更新成功。",\r\n "port_updatesecuritygroup_done": "虚拟网卡 \\"{1}\\" 的安全组已更新。",\r\n "host": "物理机",\r\n "online": "上线",\r\n "offline": "下线",\r\n "createtag": "打标签",\r\n "removetag": "移除标签",\r\n "createitem": "创建监控",\r\n "deleteitem": "删除监控",\r\n "updateitem": "修改监控项",\r\n "monitor": "监控项",\r\n "alarm": "告警",\r\n "listener": "监听器",\r\n "bindip": "绑定公网IP",\r\n "unbindip": "解绑公网IP",\r\n "role": "用户组",\r\n "unbindvolume": "卸载数据盘",\r\n "hostgroup": "主机组",\r\n "removetemplate": "移除模板",\r\n "attachtemplate": "添加模板",\r\n "attachhost": "添加主机",\r\n "removehost": "移除主机",\r\n "hosttemplate": "主机模板",\r\n "actionrule": "主机自发现",\r\n "activate": "启用",\r\n "forbidden": "禁用",\r\n "flavor": "云主机类型",\r\n "snapshot": "数据盘快照",\r\n "healthmonitor": "健康检查",\r\n "configuration_email": "邮箱设置",\r\n "configuration_sms": "短信设置",\r\n "notification": "通知",\r\n "license": "证书",\r\n "vpn": "VPN",\r\n "order": "订购单",\r\n "orders": "订单",\r\n "addcart": "加入购物车",\r\n "quota": "配额",\r\n "confirmButtonText": "确定",\r\n "cancelButtonText": "取消",\r\n "docancel": "取消订单",\r\n "invoice": "开发票",\r\n "submit": "提交",\r\n "cart": "购物车",\r\n "message": "消息",\r\n "order_submit": "订单",\r\n "order_confirm": "确认订单",\r\n "file_transfer_station": "文件中转站",\r\n "been_read": "标记已读",\r\n "audit": "提交审核",\r\n "created": "创建",\r\n "upload": "上传",\r\n "confirm": "确认",\r\n "confirmmsg": "确定{0}?",\r\n "read": "观看",\r\n "write": "控制"\r\n },\r\n "en": {\r\n "volume": "volume",\r\n "instance": "instance",\r\n "security_group": "security group",\r\n "floatingip": "floating IP",\r\n "floating_ipset": "multiline floating IP",\r\n "port_forwarding": "port forwarding rule",\r\n "port": "Virtual interface",\r\n "keypair": "keypair",\r\n "router": "router",\r\n "volume_snapshot": "volume snapshot",\r\n "image": "instance snapshot",\r\n "pptpconnection": "VPN",\r\n "security_group_rule": "security group rule",\r\n "network": "network",\r\n "subnet": "subnet",\r\n "localresize": "resize",\r\n "user": "user",\r\n "invitation": "collaboration user",\r\n "project": "project",\r\n "loadbalancer": "loadbalancer",\r\n "pool": "pool",\r\n "ikepolicy": "IKE policy",\r\n "ipsecpolicy": "IPsec policy",\r\n "database_instance": "Database",\r\n "database_config": "Database Configuration",\r\n "database_instance_user": "Database User",\r\n "delete": "delete",\r\n "attach": "attach",\r\n "create": "create",\r\n "detach": "detach",\r\n "update": "update",\r\n "poweron": "power on",\r\n "shutdown": "shutdown",\r\n "shutdown2": "shutdown",\r\n "poweroff": "power off",\r\n "reboot": "reboot",\r\n "restart": "restart",\r\n "modifyvolume": "Resize",\r\n "modifyflavor": "change flavor",\r\n "unassignconf": "detach configuration",\r\n "assignconf": "attach configuration",\r\n "detachinterface": "leave network",\r\n "attachinterface": "join network",\r\n "instance_snapshot": "Taking snapshot for instance \\"{1}\\" ...",\r\n "instance_snapshot_done": "Taking snapshot for instance \\"{1}\\" done.",\r\n "instance_keypair_done": "Instance \\"{1}\\"\'s keypair is updated.",\r\n "floatingip_updateratelimit": "Updating the floating IP \\"{1}\\"\'s rate limit...",\r\n "floatingip_updateratelimit_done": "Floating IP\'s rate limit \\"{1}\\" is updated.",\r\n "floatingip_attachrouter_done": "Associate the floating IP \\"{1}\\"to the router.",\r\n "floatingip_attachinstance_done": "Associate Floating IP \\"{1}\\" to the instance.",\r\n "floatingip_updateregisterno_done": "Floating IP \\"{1}\\"\'s register number is updated.",\r\n "floating_ipset_updateratelimit": "Updating the multiline floating IP \\"{1}\\"\'s rate limit...",\r\n "floating_ipset_updateratelimit_done": "Multiline floating IP\'s rate limit \\"{1}\\" is updated.",\r\n "floating_ipset_attachrouter_done": "Associate the multiline floating IP \\"{1}\\"to the router.",\r\n "floating_ipset_attachinstance_done": "Associate multiline floating IP \\"{1}\\" to the instance.",\r\n "floating_ipset_updateregisterno_done": "Multiline floating IP \\"{1}\\"\'s register number is updated.",\r\n "router.interface_delete_done": "Router \\"{1}\\" is disconnected from subnet.",\r\n "router.interface_create_done": "Router \\"{1}\\" is connected to subnet.",\r\n "port_updatesecuritygroup": "Updating the virtual interface \\"{1}\\"\'s security group...",\r\n "port_updatesecuritygroup_done": "Virtual interface \\"{1}\\"\'s security group is updated."\r\n }\r\n }\r\n}'}),define("modules/slab/message/controller",["app-utils","obj-openstack","jquery","text!modules/slab/message/lang.json"],function(e,t,i,n){function r(e,t,i){if(this.language=e,this.lang=n,this.appOptions=t,n){var r=JSON.parse(this.lang);this.i18n=r.language[this.language]}this.dataControl=i,this.notify=null}var a={filterMsg:function(e){if(e.disable_msg)return!1;switch(e.resource_type){case"step":return"create"==e.action||"study"==e.action||"delete"==e.action||"confirm"==e.action;case"assist":return"request"==e.action||"connect"==e.action||"delete"==e.action||"confirm"==e.action}},onError:function(t,n){if(t.resource_uuid){var r=t.resource_type+"_"+t.action.replace(/\_/g,"")+"_error",a=this.getTypeFile(t.resource_type),o=n[a];o||(o={id:t.resource_uuid});var s='<i class="done"></i>'+this.generateLabel(r,o,t.resource_type,"error"),l=i('.qc-msgPanel li[data-id="'+t.resource_uuid+'"]:visible:not(.closing)');l.length>0?(l.find("span").html(s),l.removeClass("loading").removeClass("info").addClass("error"),window.setTimeout(function(){l.hasClass("loading")||l.find("a").trigger("click")},3e3)):(l=e.pushNotification(s,"error",!1,function(){}),l.attr("data-id",t.resource_uuid))}},onMessage:function(e,t){this.filterMsg(e)&&("start"==e.stage?this.startLoading(e,t):"end"==e.stage||"error"==e.stage&&this.onError(e,t))},getTypeFile:function(e){switch(e){case"instance":return"server";case"volume_snapshot":return"snapshot";case"router.interface":return"router";default:return e}},generateLabel:function(i,n,r,a){if(this.i18n[i])return this.i18n[i].replace(/\{\d\}/g,t.fetchObjectName(n,r));"done"==a?i=i.replace(/\_done$/,""):"error"==a&&(i=i.replace(/\_error$/,""));for(var o=i.split("_"),s=[],l="",c=0;c<o.length;c++)c<o.length-1?s.push(o[c]):l=o[c];"interface"==(r=s.join("_"))&&(r="port");var u=t.fetchObjectName(n,r);if(u=u&&u.length>0?[' "',u,'" '].join(""):"","zh-hans"==this.language){if(!a)return[this.i18n[r],u," 正在",this.i18n[l],"..."].join("");if("done"==a)return[this.i18n[r],u,this.i18n[l],"完成。"].join("");if("error"==a)return[this.i18n[r],u,this.i18n[l],"错误。"].join("")}else{if(!a)return[e.toCapitalCase(this.i18n[l]).replace(/e$/,"ing")," ",this.i18n[r],u," ..."].join("");if("done"==a)return[e.toCapitalCase(this.i18n[l]).replace(/e$/,"ing")," ",this.i18n[r],u," is done."].join("");if("error"==a)return[e.toCapitalCase(this.i18n[l]).replace(/e$/,"ing")," ",this.i18n[r],u," error."].join("")}},startLoading:function(t,n){if(t.resource_uuid){var r=t.resource_type+"_"+t.action.replace(/\_/g,""),a=this.getTypeFile(t.resource_type),o=n[a];o||(o={id:t.resource_uuid});var s='<i class="loading"></i>'+this.generateLabel(r,o,t.resource_type),l=i('.qc-msgPanel li[data-id="'+t.resource_uuid+'"]:visible:not(.closing)');l.length>0?(l.find("span").html(s),l.removeClass("info").removeClass("error").addClass("loading")):(l=e.pushNotification(s,"loading",!0,function(){}),l.attr("data-id",t.resource_uuid)),window.setTimeout(function(){l.find("a").trigger("click")},6e3)}},confirm:function(e,t,i){return layer.confirm(this.i18n.confirmmsg.replace(/\{\d\}/g,e+t),{title:e},i,function(e){layer.close(e)})},msg:function(e,t,i){return layer.msg(e,t,i)},alert:function(e,t,i){return layer.alert(e,t,i)},load:function(e,t){return layer.load(e,t)},tips:function(e,t,i){return layer.tips(e,t,i)},open:function(e){return layer.open(e)}};return i.extend(r.prototype,a),r}),define("network-utils",["jquery","app-utils"],function(e,t){return{action:function(i,n,r,a,o,s){var l="application/json; charset=UTF-8";"PATCH"==i&&(l="application/openstack-images-v2.1-json-patch");var c=e.Deferred(),u={url:n,type:i,contentType:l,success:function(e){var t={};try{s?t[s]=e:t=e}catch(e){t=""}a&&a(t),c.resolve(t)},error:function(e){202!=e.status&&204!=e.status&&""!=e.responseText||c.resolve(e)}};r&&(u.data=JSON.stringify(r));var d=e.ajax(u);return d.fail(function(e,i,a){c.reject(e,i,a),"abort"!=i&&!0!==o&&(o?e.fail(function(e,t,i){o(e,t,i)}):e.fail(function(e,i,a){404!=e.status&&t.showMsgError(e,n,r)}))}),c.xhr=d,c},doGetNoJson:function(i,n,r,a,o){var s=e.Deferred(),l={},c=e.get(i,n,function(e){try{o?l[o]=JSON.parse(t.escape(JSON.stringify(e))):l=JSON.parse(t.escape(JSON.stringify(e)))}catch(e){l=""}r&&(l.data=n,r(l)),s.resolve(l)});return c.fail(function(e,r,o){s.reject(e,r,o),"abort"!=r&&!0!==a&&(a?e.fail(function(e,t,i){a(e,t,i)}):e.fail(function(e,r,a){404!=e.status&&t.showMsgError(e,i,n)}))}),s.xhr=c,s},doGet:function(i,n,r,a,o){var s=e.Deferred(),l={},c=e.getJSON(i,n,function(e){try{o?l[o]=JSON.parse(t.escape(JSON.stringify(e))):l=JSON.parse(t.escape(JSON.stringify(e)))}catch(e){l=""}r&&(l.data=n,r(l)),s.resolve(l)});return c.fail(function(e,r,o){s.reject(e,r,o),"abort"!=r&&!0!==a&&(a?e.fail(function(e,t,i){a(e,t,i)}):e.fail(function(e,r,a){404!=e.status&&t.showMsgError(e,i,n)}))}),s.xhr=c,s},doUnescapeGet:function(i,n,r,a,o){var s=this,l=e.Deferred(),c={},u=e.getJSON(i,n,function(e){try{o?c[o]=e:c=e}catch(e){c=""}r&&(c.data=n,r(c)),l.resolve(c)});return u.fail(function(e,r,o){l.reject(e,r,o),"abort"!=r&&!0!==a&&(a?e.fail(function(e,t,i){a(e,t,i)}):e.fail(function(e,r,a){if(403==e.status)return void s.handle403Error(e);t.showMsgError(e,i,n)}))}),l.xhr=u,l},doPostForm:function(i,n,r,a,o){var s=e.Deferred(),l={url:i,type:"POST",contentType:"application/x-www-form-urlencoded; charset=UTF-8",success:function(e){var t={};try{o?t[o]=e:t=e}catch(e){t=""}r&&r(t),s.resolve(t)},error:function(e){202!=e.status&&204!=e.status&&""!=e.responseText||s.resolve(e)}};l.data=n;var c=e.ajax(l);return c.fail(function(e,r,o){s.reject(e,r,o),"abort"!=r&&!0!==a&&(a?e.fail(function(e,t,i){a(e,t,i)}):e.fail(function(e,r,a){404!=e.status&&t.showMsgError(e,i,n)}))}),s.xhr=c,s},doPost:function(e,t,i,n,r){return this.action("POST",e,t,i,n,r)},doPut:function(e,t,i,n,r){return this.action("PUT",e,t,i,n,r)},doPatch:function(e,t,i,n,r){return this.action("PATCH",e,t,i,n,r)},doDelete:function(e,t,i,n,r,a){return t?this.action("DELETE",e+"/"+t,r,i,n,a):this.action("DELETE",e,r,i,n,a)},handle403Error:function(i){function n(){var e,i=SDC.t.LANG;"en"==i?(e=SDC.user.is_project_observer?t.showAlert("Error","You are the project observer. You can not do this operation.","OK"):t.showAlert("Error","You can not do this operation.","OK",null,"NO"),e.addClass("info")):SDC.user.is_project_observer&&(e=t.showAlert("提示","您的帐号是该项目的观察者,没有操作此功能的权限。","OK"))}var r=e(".qc-modal .vmModal");r.length>0?(r.find(".closeModal").trigger("click"),window.setTimeout(n,500)):window.setTimeout(n,500)}}}),define("text!modules/utils/api.json",[],function(){return'{\r\n "api": {\r\n "develop": {\r\n\r\n "createCourse": "/ecos/qcec/v1/course_info",\r\n "getLab_Templates": "/ecos/qcec/v1/lab_template",\r\n "createvclass": "http://172.16.102.129:9999/mock-api/client/5ae00d58e1f51a012a9832b9",\r\n "getvclass": "http://172.16.102.129:9999/mock-api/client/5ae01d2e404d530129181289",\r\n "add_group": "http://172.16.102.129:9999/mock-api/client/5ae2b7fa0023b90124e862c2/{0}/add_vclass_member",\r\n "get_groups": "http://172.16.102.129:9999/mock-api/client/5ae2be2abc0c5c0130c165e1",\r\n\r\n "get_group_detail": "http://172.16.102.129:9999/mock-api/client/5ae2e9340023b90124e86323/",\r\n "get_group_step": "http://172.16.102.129:9999/mock-api/client/5ae2ef9abc0c5c0130c1663b",\r\n "get_collect_course": "http://172.16.102.129:9999/mock-api/client/5ae3cffd404d53012918142e",\r\n\r\n "get_user": "http://172.16.102.129:9999/mock-api/client/5ae12f82bc0c5c0130c16518/",\r\n "change_user": "http://172.16.102.129:9999/mock-api/client/5ae1373c404d5301291812b9/",\r\n "change_password": "http://172.16.102.129:9999/mock-api/client/5ae12c2d404d5301291812b8",\r\n "change_mobile": "http://172.16.102.129:9999/mock-api/client/5ae1b272e1f51a012a9833ce",\r\n "group_step": "http://172.16.102.129:9999/mock-api/client/5ae5af9c0023b90124e86488/",\r\n "getpclasslist": "http://172.16.102.129:9999/mock-api/client/5ae064aabc0c5c0130c16500",\r\n\r\n "getnoauth_detail": "http://172.16.102.129:9999/mock-api/client/5ae06401bc0c5c0130c164fe/",\r\n "getnoauth_step": "http://172.16.102.129:9999/mock-api/client/5ae5b166e1f51a012a9835f3/",\r\n "collection": "http://172.16.102.129:9999/mock-api/client/5ae4146a0023b90124e8636f",\r\n "delcollection": "http://172.16.102.129:9999/mock-api/client/5ae41502e1f51a012a9834e2/",\r\n\r\n "join_pclass": "http://172.16.102.129:9999/mock-api/client/5ae9364c0023b90124e8651d/",\r\n "send_assist": "http://172.16.102.129:9999/mock-api/client/5b611bf3e1f51a012a98387d",\r\n "get_assist_user": "http://172.16.102.129:9999/mock-api/client/5aed3ab7bc0c5c0130c16861/",\r\n "create_vm": "http://172.16.102.129:9999/mock-api/client/5aed6de6bc0c5c0130c16871",\r\n "delete_vm": "http://172.16.102.129:9999/mock-api/client/5af00fdb0023b90124e86581/",\r\n "cancel_assist": "http://172.16.102.129:9999/mock-api/client/5aed17030023b90124e8655e/",\r\n "check_courseStep": "http://172.16.102.129:9999/mock-api/client/5af1916d0023b90124e8658a/{0}",\r\n "getsclass": "http://172.16.102.129:9999/mock-api/client/5b0f4bd9404d5301291816af/",\r\n "get_college": "http://172.16.102.129:9999/mock-api/client/5ae05baf404d53012918129c",\r\n "role_apply": "http://172.16.102.129:9999/mock-api/client/5b15e71be1f51a012a9837c5/",\r\n "get_assist_list": "http://172.16.102.129:9999/mock-api/client/5b611bf3e1f51a012a98387d",\r\n "reject_assist": "http://172.16.102.129:9999/mock-api/client/5b611dc5e1f51a012a983885",\r\n "accept_assist": "http://172.16.102.129:9999/mock-api/client/5b611daae1f51a012a983883",\r\n "get_assist_user_list": "http://172.16.102.129:9999/mock-api/client/5b641651e1f51a012a983890",\r\n "complete_assist": "http://172.16.102.129:9999/mock-api/client/5b611d7ae1f51a012a983881",\r\n "check_assist": "http://172.16.102.129:9999/mock-api/client/5b6d08ddbc4b050278b81e52"\r\n\r\n },\r\n "online": {\r\n "createCourse": "/ecos/qcec/v1/course_info",\r\n "getLab_Templates": "/ecos/qcec/v1/lab_template",\r\n "createvclass": "/ecos/qcec/v1/vclass",\r\n "getvclass": "/ecos/qcec/v1/vclass",\r\n "add_group": "/ecos/qcec/v1/group/{0}/add_vclass_member",\r\n "get_groups": "/ecos/qcec/v1/group_course/page_get_all",\r\n "get_group_detail": "/ecos/qcec/v1/group_course/",\r\n "get_group_step": "/ecos/qcec/v1/group_step",\r\n "get_collect_course": "/ecos/qcec/v1/group_course/page_collect_course",\r\n\r\n\r\n "get_user": "/ecos/qcec/v1/user/",\r\n "change_user": "/ecos/qcec/v1/user/",\r\n "change_password": "/ecos/qcec/v1/user/change_password",\r\n "change_mobile": "/ecos/qcec/v1/user/change_mobile",\r\n "group_step": "/ecos/qcec/v1/group_step/",\r\n\r\n "getpclasslist": "/ecos/qcec_noauth/noauth/group_course/",\r\n "getnoauth_detail": "/ecos/qcec_noauth/noauth/group_course/",\r\n "getnoauth_step": "/ecos/qcec_noauth/noauth/group_step",\r\n "collection": "/ecos/qcec/v1/collect",\r\n "delcollection": "/ecos/qcec/v1/collect/",\r\n\r\n "join_pclass": "/ecos/qcec/v1/group/",\r\n "send_assist": "/ecos/qcec_console_nsq/v1/lab_assist",\r\n "get_assist_user": "/ecos/qcec/v1/assist_user/",\r\n\r\n "create_vm": "/ecos/qcec_console_nsq/v1/course_step/",\r\n "close_vm": "/ecos/qcec_console_nsq/v1/course_step/",\r\n "cancel_assist": "/ecos/qcec_console_nsq/v1/lab_assist/lab_assist_cancel/",\r\n "check_courseStep": "/ecos/qcec_console_nsq/v1/course_step/",\r\n "getsclass": "/ecos/qcec/v1/sclasslist/",\r\n "get_college": "/ecos/qcec/v1/college",\r\n "role_apply": "/ecos/qcec/v1/role_apply/",\r\n "get_assist_list": "/ecos/qcec_console_nsq/v1/lab_assist",\r\n "reject_assist": "/ecos/qcec_console_nsq/v1/lab_assist/lab_assist_reject",\r\n "accept_assist": "/ecos/qcec_console_nsq/v1/lab_assist/lab_assist_accept",\r\n "get_assist_user_list": "/ecos/qcec/v1/teacher_student/get_assist_all",\r\n "complete_assist": "/ecos/qcec_console_nsq/v1/lab_assist/lab_assist_complete",\r\n "check_assist": "/ecos/qcec_console_nsq/v1/lab_assist/get_assistant"\r\n\r\n }\r\n }\r\n}\r\n'}),define("modules/utils/baseservice",["network-utils","jquery","text!modules/utils/api.json"],function(e,t,i){var n=function(){};return n.prototype={api:JSON.parse(i).api.online,getverify_code:function(t){return e.doPost("/ecos/qcec_noauth/noauth/vcode/reg_vcode",t)},create_score:function(t){return e.doPost("/ecos/qcec/v1/mark",t)},getCollects:function(t){return e.doGet("/ecos/qcec/v1/collect")},getCourses:function(t){return e.doGet("/ecos/qcec/v1/course",t)},getCourseById:function(t){return e.doGet("/ecos/qcec/v1/course/"+t)},getCourseStep:function(t){return e.doGet(this.api.get_group_step,t)},getUserById:function(t){return e.doGet("ecos/qcec/v1/user/"+t)},getScores:function(t){return e.doGet("/ecos/qcec/v1/mark",t)},create_comment:function(t){return e.doPost("/qcos/ecec/v1/comment",t)},getComments:function(t){return e.doGet("/qcos/ecec/v1/comment",t)},getGroup_courses:function(t){return e.doGet(this.api.get_groups,t)},getGroup_courseById:function(t,i){return e.doGet(this.api.get_group_detail+t+"/"+i)},getGroup_courseStep:function(t){return e.doUnescapeGet(this.api.group_step+t)},add_Group:function(t){return e.doPost("/ecos/qcec/v1/collect")},send_assist:function(t){return e.doPost(this.api.send_assist,t)},get_assist_user:function(t){return e.doGet(this.api.get_assist_user,t)},create_vm:function(t){return e.doPost(this.api.create_vm,t)},close_vm:function(t){return e.doPost(this.api.close_vm+"close/",{step_id:t})},check_courseStep:function(t){return e.doGet(this.api.check_courseStep+t)},cancel_assist:function(t){return e.doPost(this.api.cancel_assist,t)},complete_assist:function(t){return e.doPost(this.api.complete_assist,t)},get_assist_list:function(t){return e.doGet(this.api.get_assist_list,t)},reject_assist:function(t){return e.doPost(this.api.reject_assist,t)},accept_assist:function(t){return e.doPost(this.api.accept_assist,t)},get_assist_user_list:function(){return e.doGet(this.api.get_assist_user_list)},check_assist:function(t){return e.doGet(this.api.check_assist,t)},upload_file:function(t){return e.doGet("/ecos/qcec/v1/upload_file",t)},getvmexceptions:function(t){return e.doGet("/ecos/qcec_console_nsq/v1/exception_order/pages",t)},getvmexception_type:function(){return e.doGet("/ecos/qcec_console_nsq/v1/exception_order/get_exception_type")},submit_vmexception:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/exception_order",t)}},n}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("avalon",t):e.avalon=t()}(this,function(){"use strict";function e(e){this.size=0,this.limit=e,this.head=this.tail=void 0,this._keymap={}}function t(e,t){return tn[e]&&n.warn(e,"directive have defined! "),tn[e]=t,t.update||(t.update=function(){}),t.delay&&(en[e]=1),t}function i(e){for(var t in en)if("ms-"+t in e)return!0}function n(e){return new n.init(e)}function r(e,t){for(var i in t)e[i]=t[i];return e}function a(e,t){"string"==typeof e&&(e=e.match(rn)||[]);for(var i={},n=void 0!==t?t:1,r=0,a=e.length;r<a;r++)i[e[r]]=n;return i}function o(e){return n._quote(e)}function s(){dn&&n.config.debug&&Function.apply.call(console.log,console,arguments)}function l(){if(dn&&n.config.debug){var e=console.warn||console.log;Function.apply.call(e,console,arguments)}}function c(e,t){throw(t||Error)(e)}function u(){}function d(e){return null!==e&&"object"==typeof e}function h(e,t,i){i||(i=1),null==t&&(t=e||0,e=0);for(var n=-1,r=Math.max(0,Math.ceil((t-e)/i)),a=new Array(r);++n<r;)a[n]=e,e+=i;return a}function p(e){return e.replace(hn,"$1-$2").toLowerCase()}function f(e){return!e||e.indexOf("-")<0&&e.indexOf("_")<0?e:e.replace(pn,function(e){return e.charAt(1).toUpperCase()})}function m(e,t,i){return fn.call(e,t,i)}function g(e){return e=e||"avalon",String(Math.random()+Math.random()).replace(mn,e)}function v(e){return e.uuid||(e.uuid=g("e"))}function y(e){return e.uuid||(e.uuid="_"+ ++gn)}function _(e){return(e+"").replace(vn,"\\$&")}function b(){return Ki.createDocumentFragment()}function w(e){for(var t in e){var i=e[t];"function"==typeof w.plugins[t]?w.plugins[t](i):w[t]=i}return this}function x(e){return Ki.createComment(e)}function k(e){return/\[native code\]/.test(e)}function C(e,t,i){var n="for(var "+e+"i=0,n = this.length; i < n; i++){"+t.replace("_","((i in this) && fn.call(scope,this[i],i,this))")+"}"+i;return Function("fn,scope",n)}function T(e){return!!e&&(e==e.document&&e.document!=e)}function S(e){return On.test(ln.call(e))}function E(e,t){if(!e||"object"!==n.type(e)||e.nodeType||n.isWindow(e))return!1;try{if(e.constructor&&!cn.call(e,"constructor")&&!cn.call(e.constructor.prototype,"isPrototypeOf"))return!1;e.$vbthis}catch(e){return!1}if(Pn)for(t in e)return cn.call(e,t);for(t in e);return t===jn||cn.call(e,t)}function A(e){return"[object Object]"===ln.call(e)&&Object.getPrototypeOf(e)===Object.prototype}function I(e,t){for(var i,r,a,o=t[0],s=1,l=t.length;s<l;s++){var c=t[s],u=Array.isArray(c);for(a in c)if(!u||c.hasOwnProperty(a)){try{var d=o[a],h=c[a]}catch(e){continue}o!==h&&(e&&h&&(n.isPlainObject(h)||(i=Array.isArray(h)))?(i?(i=!1,r=d&&Array.isArray(d)?d:[]):r=d&&n.isPlainObject(d)?d:{},o[a]=I(e,[r,h])):h!==jn&&(o[a]=h))}}return o}function D(e){if(!e)return!1;var t=e.length;if(t===t>>>0){var i=ln.call(e);if(zn.test(i))return!0;if("[object Object]"!==i)return!1;try{return!1!=={}.propertyIsEnumerable.call(e,"length")||Ln.test(e.item||e.callee)}catch(t){return!e.window}}return!1}function M(e,t){var i=Math.pow(10,t);return""+(Math.round(e*i)/i).toFixed(t)}function L(e,t,i,n){e=(e+"").replace(/[^0-9+\-Ee.]/g,"");var r=isFinite(+e)?+e:0,a=isFinite(+t)?Math.abs(t):3,o="string"==typeof n?n:",",s=i||".",l="";return l=(a?M(r,a):""+Math.round(r)).split("."),l[0].length>3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,o)),l.join(s)}function O(e){return e.replace(Fn,"").replace(Un,function(e,t){var i=e.toLowerCase().match(/<(\w+)\s/);if(i){var n=$n[i[1]];n&&(e=e.replace(n,function(e,t,i){var n=i.charAt(0);return t+"="+n+"javascript:void(0)"+n}))}return e.replace(Bn," ").replace(/\s+/g," ")})}function N(e){return parseInt(e,10)||0}function P(e,t,i){var n="";for(e<0&&(n="-",e=-e),e=""+e;e.length<t;)e="0"+e;return i&&(e=e.substr(e.length-t)),n+e}function R(e,t,i,n){return function(r){var a=r["get"+e]();return(i>0||a>-i)&&(a+=i),0===a&&-12===i&&(a=12),P(a,t,n)}}function j(e,t){return function(i,n){var r=i["get"+e]();return n[(t?"SHORT"+e:e).toUpperCase()][r]}}function z(e){var t=-1*e.getTimezoneOffset(),i=t>=0?"+":"";return i+=P(Math[t>0?"floor":"ceil"](t/60),2)+P(Math.abs(t%60),2)}function F(e,t){return e.getHours()<12?t.AMPMS[0]:t.AMPMS[1]}function B(e,t){var i,n,r=B.locate,a="",o=[];if(t=t||"mediumDate",t=r[t]||t,"string"==typeof e)if(/^\d+$/.test(e))e=N(e);else if(Wn.test(e))e=+RegExp.$1;else{var s=e.trim(),l=[0,0,0,0,0,0,0],c=new Date(0);s=s.replace(/^(\d+)\D(\d+)\D(\d+)/,function(e,t,i,n){var r=4===n.length?[n,t,i]:[t,i,n];return l[0]=N(r[0]),l[1]=N(r[1])-1,l[2]=N(r[2]),""});var u=c.setFullYear,d=c.setHours;s=s.replace(/[T\s](\d+):(\d+):?(\d+)?\.?(\d)?/,function(e,t,i,n,r){return l[3]=N(t),l[4]=N(i),l[5]=N(n),r&&(l[6]=Math.round(1e3*parseFloat("0."+r))),""});var h=0,p=0;s=s.replace(/Z|([+-])(\d\d):?(\d\d)/,function(e,t,i,n){return u=c.setUTCFullYear,d=c.setUTCHours,t&&(h=N(t+i),p=N(t+n)),""}),l[3]-=h,l[4]-=p,u.apply(c,l.slice(0,3)),d.apply(c,l.slice(3)),e=c}for("number"==typeof e&&(e=new Date(e));t;)n=Hn.exec(t),n?(o=o.concat(n.slice(1)),t=o.pop()):(o.push(t),t=null);return o.forEach(function(t){i=qn[t],a+=i?i(e,r):t.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),a}function U(e,t,i){var r=n.type(e);if("array"!==r&&"object"!==r)throw"orderBy只能处理对象或数组";var a="string"==typeof t?function(e){return e&&e[t]}:"function"==typeof t?t:function(e){return e},o={},s=[];$(e,Array.isArray(e),function(t){var i=e[t],n=a(i,t);n in o?o[n].push(t):o[n]=[t],s.push(n)}),s.sort(),i<0&&s.reverse();var l="array"===r,c=l?[]:{};return V(c,s,function(t){var i=o[t].shift();l?c.push(e[i]):c[i]=e[i]})}function $(e,t,i){if(t)e.forEach(function(e,t){i(t)});else if("string"==typeof e.$track)e.$track.replace(/[^☥]+/g,function(e){i(e)});else for(var n in e)e.hasOwnProperty(n)&&i(n)}function q(e,t){var i=n.type(e);if("array"!==i&&"object"!==i)throw"filterBy只能处理对象或数组";var r=n.slice(arguments,2),a=n.type(t);if("function"===a)var o=t._orig||t;else{if("string"!==a&&"number"!==a)return e;if(""===t)return e;var s=new RegExp(n.escapeRegExp(t),"i");o=function(e){return s.test(e)}}var l="array"===i,c=l?[]:{};return $(e,l,function(t){var i=e[t];o.apply({key:t},[i,t].concat(r))&&(l?c.push(i):c[t]=i)}),c}function H(e,t,i){if(n.isObject(e)&&!Array.isArray(e)){var r=[];return V(r,t,function(t){r.push(e.hasOwnProperty(t)?e[t]:i?i[t]:"")})}return e}function W(e,t,i){var r=n.type(e);if("array"!==r&&"object"!==r)throw"limitBy只能处理对象或数组";if("number"!=typeof t)return e;if(t!==t)return e;"object"===r&&(e=G(e,!1));var a=e.length;t=Math.floor(Math.min(a,t)),(i="number"==typeof i?i:0)<0&&(i=Math.max(0,a+i));for(var o=[],s=i;s<a&&o.length!==t;s++)o.push(e[s]);if("array"===r)return o;var l={};return V(l,o,function(e){l[e.key]=e.value})}function V(e,t,i){for(var n=0,r=t.length;n<r;n++)i(t[n]);return e}function G(e,t){var i=[],n=0;return $(e,t,function(t){i[n]={oldIndex:n,value:e[t],key:t},n++}),i}function Y(e){return null==e?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function K(e,t){if(1===e.nodeType){var i=e.nodeName.toLowerCase();if("script"===i)e.text!==t.text&&(e.type="noexec",e.text=t.text,e.type=t.type||"");else if("object"===i){var r=t.childNodes;if(e.childNodes.length!==r.length){n.clearHTML(e);for(var a,o=0;a=r[o++];)e.appendChild(a.cloneNode(!0))}}else"input"===i&&Zn.test(t.nodeName)?(e.defaultChecked=e.checked=t.checked,e.value!==t.value&&(e.value=t.value)):"option"===i?e.defaultSelected=e.selected=t.defaultSelected:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}}function X(e){return void 0!==e.getElementsByTagName?e.getElementsByTagName("*"):void 0!==e.querySelectorAll?e.querySelectorAll("*"):[]}function Q(e){for(var t=e.cloneNode(!0),i=X(t),n=X(e),r=0;r<n.length;r++)K(i[r],n[r]);return t}function Z(e,t){try{for(;t=t.parentNode;)if(t===e)return!0}catch(e){}return!1}function J(e){this.node=e}function ee(e){return"classList"in e||(e.classList=new J(e)),e.classList}function te(e){var t=e.nodeName;return t.toLowerCase()===t&&!!e.scopeName&&""===e.outerText}function ie(e){if("string"==typeof e){if((e=e.trim())&&er.test(e.replace(ir,"@").replace(nr,"]").replace(tr,"")))return new Function("return "+e)();throw TypeError("Invalid JSON: ["+e+"]")}return e}function ne(e,t){for(var i in t)try{var r=t[i];if(0===i.indexOf("data-")||rr.test(e))e.setAttribute(i,r);else{var a=Jn[i]||i;if("boolean"==typeof e[a]&&("checked"===a&&(e.defaultChecked=!!r),e[a]=!!r),!1===r){e.removeAttribute(a);continue}if(n.msie<8&&/[A-Z]/.test(a)){e[a]=r+"";continue}!(n.modern||!te(e))||re(e.nodeName,i)?("href"!==i&&"src"!==i||n.msie<8&&(r=String(r).replace(ar,"&")),e[a]=r+""):e.setAttribute(i,r)}}catch(e){n.log(String(e.message).trim(),i,r)}}function re(e,t){var i=e+":"+t;return i in or?or[i]:or[i]=t in Ki.createElement(e)}function ae(e,t){if(e.offsetWidth<=0){if(ur.test(wn["@:get"](e,"display"))){var i={node:e};for(var n in cr)i[n]=e.style[n],e.style[n]=cr[n];t.push(i)}var r=e.parentNode;r&&1===r.nodeType&&ae(r,t)}}function oe(e){return e.window||e.defaultView||e.parentWindow||!1}function se(e){var t=e.tagName.toLowerCase();return"input"===t?Zn.test(e.type)?"checked":e.type:t}function le(e){if(e.hasAttribute&&e.hasAttribute("value"))return e.getAttribute("value");var t=e.getAttributeNode("value");return t&&t.specified?t.value:e.innerHTML.trim()}function ce(e){return a(e+",template,#document-fragment,#comment")}function ue(e){
|
||
return de(e)}function de(e){var t=e,i=Tr.get(t);if(i)return n.mix(!0,[],i);var r=he(e,!1);return Tr.put(t,n.mix(!0,[],r)),r}function he(e,t){t=void 0===t||!0===t;var i=pe(e,t);return t?"string"==typeof i[0]?i[1]:i[0]:i}function pe(e,t){function i(e){var t=r.last();t&&t.children?t.children.push(e):l.push(e)}var n=9990,r=[],a=e,o=e.length;r.last=function(){return r[r.length-1]};var s,l=[];do{if(0==--n)break;var c=ve(e);if(c){e=e.replace(c[0],"");var u=r.pop();if(!u)throw"是不是有属性值没有用引号括起";if("option"===u.nodeName?u.children=[{nodeName:"#text",nodeValue:_e(u)}]:"table"===u.nodeName&&ge(u.children),s=null,t&&1===l.length&&!r.length)return[a.slice(0,o-e.length),l[0]]}else{var c=ye(e);if(c){e=e.replace(c[0],"");var d=c[1];i(d);var h=!(!d.isVoidTag&&!wr[d.nodeName]);if(h||r.push(d),t&&h&&!r.length)return[a.slice(0,o-e.length),d];s=d}else{var p="";do{if(0!==e.indexOf("<"))break;p+=e.slice(0,1),e=e.slice(1)}while(e.length);var f=e.indexOf("<");if(-1===f)p=e,e="";else{var m=e.indexOf(w.openTag);if(-1!==m&&m<f){0!==m&&(p+=e.slice(0,m));var g=e.slice(m),v=me(g);p+=v,e=g.slice(v.length)}else p+=e.slice(0,f),e=e.slice(f)}var y=fe(s,p,i);y&&(s=y)}}}while(e.length);return l}function fe(e,t,i){if(kr.test(t))return e&&"#text"===e.nodeName?(e.nodeValue+=t,e):(e={nodeName:"#text",nodeValue:t},i(e),e)}function me(e){for(var t,i,n=w.closeTag,r=w.openTag,a=n.charAt(0),o=n.length,s="code",l=r.length,c=e.length;l<c;l++){var u=e.charAt(l);switch(s){case"code":if('"'===u||"'"===u)s="string",t=u;else if(u===a&&e.substr(l,o)===n)return e.slice(0,l+o);break;case"string":"\\"===u&&/"'/.test(e.charAt(l+1))&&(i=!i),u!==t||i||(s="code")}}throw"找不到界定符"+n}function ge(e){for(var t=!1,i=0,n=e.length;i<n;i++){var r=e[i];Sr.test(r.nodeName)?t=!1:"tr"===r.nodeName?t?(e.splice(i,1),t.children.push(r),n--,i--):(t={nodeName:"tbody",props:{},children:[r]},e.splice(i,1,t)):t&&(e.splice(i,1),t.children.push(r),n--,i--)}}function ve(e){if(0===e.indexOf("</")){var t=e.match(/\<\/(\w+[^\s\/\>]*)>/);if(t){var i=t[1];return e=e.slice(3+i.length),[t[0],{nodeName:i}]}}return null}function ye(e){if(0===e.indexOf("<")){if(0===e.indexOf("\x3c!--")){var t=e.indexOf("--\x3e");-1===t&&thow("注释节点没有闭合 "+e.slice(0,100));var i={nodeName:"#comment",nodeValue:e.slice(4,t)};return[e.slice(0,t+3),i]}var n=e.match(Er);if(n){var r=n[0],a=n[1],i={nodeName:a,props:{},children:[]};e=e.replace(r,"");try{var o=be(e)}catch(e){}if(o&&(i.props=o[1],e=e.replace(o[0],""),r+=o[0]),">"===e.charAt(0)?(r+=">",e=e.slice(1),yr[i.nodeName]&&(i.isVoidTag=!0)):"/>"===e.slice(0,2)&&(r+="/>",e=e.slice(2),i.isVoidTag=!0),!i.isVoidTag&&wr[a]){var s="</"+a+">",l=e.indexOf(s),c=e.slice(0,l);r+=c+s,i.children.push({nodeName:"#text",nodeValue:c}),"textarea"===a&&(i.props.type=a,i.props.value=c)}return[r,i]}}}function _e(e){var t="";return e.children.forEach(function(e){"#text"===e.nodeName?t+=e.nodeValue:e.children&&!xr[e.nodeName]&&(t+=_e(e))}),t}function be(e){for(var t,i,n="AttrName",r="",a="",o={},s=0,l=e.length;s<l;s++){var c=e.charAt(s);switch(n){case"AttrName":if("/"===c&&">"===e.charAt(s+1)||">"===c)return r&&(o[r]=r),[e.slice(0,s),o];if(Cr.test(c))r&&(n="AttrEqual");else if("="===c){if(!r)throw"必须指定属性名";n="AttrQuote"}else r+=c;break;case"AttrEqual":"="===c?n="AttrQuote":kr.test(c)&&(o[r]=r,r=c,n="AttrName");break;case"AttrQuote":'"'!==c&&"'"!==c||(t=c,n="AttrValue",i=!1);break;case"AttrValue":if("\\"===c&&/"'/.test(e.charAt(s+1))&&(i=!i),"\n"===c)break;c!==t?a+=c:c!==t||i||(o[r]=a,r=a="",n="AttrName")}}throw"必须关闭标签"}function we(e,t){e.setAttribute("avalon-events",t)}function xe(e,t,i){var r=e.getAttribute("avalon-events");if(r&&(!0!==e.disabled||"click"!==t)){var a=[],o=Or[t]||(Or[t]=new RegExp("\\b"+t+"\\:([^,\\s]+)","g"));r.replace(o,function(e,t){return a.push(t),e}),a.length&&i.push({elem:e,uuids:a})}e=e.parentNode;var s=n.gestureEvents||{};e&&e.getAttribute&&(Mr[t]||s[t])&&xe(e,t,i)}function ke(e){e=new Te(e);var t=e.type,i=e.target,r=[];xe(i,t,r);for(var a,o,s,l=0;(s=r[l++])&&!e.cancelBubble;){e.currentTarget=s.elem;for(a=0;(o=s.uuids[a++])&&!e.stopImmediate;){var c=n.eventListeners[o];if(c){var u=Nr.test(o)?s.elem._ms_context_:0;if(u&&!1===u.$hashcode)return n.unbind(i,t,c);!1===c.call(u||i,e)&&(e.preventDefault(),e.stopPropagation())}}}}function Ce(e){var t=Xi.getAttribute("delegate-events")||"";if(-1===t.indexOf(e)){var i=t.match(n.rword)||[];i.push(e),Xi.setAttribute("delegate-events",i.join(",")),n._nativeBind(Xi,e,ke,!!Pr[e])}}function Te(e){if(e.originalEvent)return e;for(var t in e)Rr[t]||(this[t]=e[t]);this.target||(this.target=e.srcElement);this.target;this.fixEvent(),this.timeStamp=new Date-0,this.originalEvent=e}function Se(e){for(n.isReady=!0;e=Br.shift();)e(n)}function Ee(e,t,i){switch(t){case"style":case"script":case"noscript":case"template":case"xmp":e.children=[{nodeName:"#text",nodeValue:i}];break;case"textarea":var n=e.props;n.type=t,n.value=i,e.children=[{nodeName:"#text",nodeValue:i}];break;case"option":e.children=[{nodeName:"#text",nodeValue:Ae(i)}]}}function Ae(e){return String(e).replace($r,"").trim()}function Ie(e){return[De(e)]}function De(e){var t=e.nodeName.toLowerCase();switch(t){case"#text":case"#comment":return{nodeName:t,dom:e,nodeValue:e.nodeValue};default:var i=Me(e,e.attributes||[]),n={nodeName:t,dom:e,isVoidTag:!!yr[t],props:i};if("option"===t&&(i.selected=e.selected),Ur[t]||"option"===t)Ee(n,t,e.text||e.innerHTML),1===e.childNodes.length&&(n.children[0].dom=e.firstChild);else if(!n.isVoidTag){n.children=[];for(var r,a=0;r=e.childNodes[a++];){var o=De(r);/\S/.test(o.nodeValue)&&n.children.push(o)}}return n}}function Me(e,t){for(var i={},n=0,r=t.length;n<r;n++){var a=t[n];a.specified&&(i[a.name.toLowerCase()]=a.value)}if(qr.test(e.nodeName)){i.type=e.type;var o=e.getAttributeNode("value");o&&/\S/.test(o.value)&&(i.value=o.value)}var s=e.style.cssText;return s&&(i.style=s),"select-one"===i.type&&(i.selectedIndex=e.selectedIndex),i}function Le(e){this.nodeName="#text",this.nodeValue=e}function Oe(e){this.nodeName="#comment",this.nodeValue=e}function Ne(e,t,i,n){this.nodeName=e,this.props=t,this.children=i,this.isVoidTag=n}function Pe(e,t,i){switch(t){case"style":e.setAttribute("type","text/css"),e.styleSheet.cssText=i;break;case"xmp":case"noscript":e.textContent=i}}function Re(e){return!1!==e&&Object(e)!==e}function je(e){return Ki.createElementNS("http://www.w3.org/2000/svg",e)}function ze(e){Ki.styleSheets.length<31?Ki.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):Ki.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");var t=e.split(":");1===t.length&&t.unshift("v");var i=t[1],n=t[0];return Ki.namespaces[n]||Ki.namespaces.add(n,"urn:schemas-microsoft-com:vml"),Ki.createElement("<"+n+":"+i+' class="rvml">')}function Fe(e,t,i,n){this.nodeName="#document-fragment",this.children=e,this.key=t,this.val=i,this.index=n,this.props={}}function Be(){if(!(!0===n.isRunningActions||n.inTransaction>0)){n.isRunningActions=!0;for(var e,t=n.pendingActions.splice(0,n.pendingActions.length),i=0;e=t[i++];)e.update(),delete n.uniqActions[e.uuid];n.isRunningActions=!1}}function Ue(e){for(var t,i=e.observers,n=0;t=i[n++];)t.schedule()}function $e(e){var t=n.trackingAction||null;null!==t&&(n.track("征收到",e.expr),t.mapIDs[e.uuid]=e)}function qe(e,t){if(e.observers){var i=n.trackingAction;i&&Kr.push(i),n.trackingAction=e,n.track("【action】",e.type,e.expr,"开始征收依赖项"),e.mapIDs={};var r,a=!0;try{r=t.call(e),a=!1}finally{if(a)n.warn("collectDeps fail",t+""),e.mapIDs={},n.trackingAction=i;else{n.trackingAction=Kr.pop();try{He(e)}catch(e){n.warn(e)}}return r}}}function He(e){var t=e.observers,i=[],r={},a=[];for(var o in e.mapIDs){var s=e.mapIDs[o];if(!s.isAction){if(!s.observers){delete e.mapIDs[o];continue}if(a.push(s.uuid),i.push(s),r[s.uuid]=1,s.lastAccessedBy===e.uuid)continue;s.lastAccessedBy=e.uuid,n.Array.ensure(s.observers,e)}}var a=a.sort().join(",");if(a!==e.ids){if(e.ids=a,e.isComputed){e.depsCount=i.length,e.deps=n.mix({},e.mapIDs),e.depsVersion={};for(var l in e.mapIDs){var c=e.mapIDs[l];e.depsVersion[c.uuid]=c.version}}else e.observers=i;for(var u,d=0;u=t[d++];)r[u.uuid]||n.Array.remove(u.observers,e)}}function We(e,t,i){i=i||[];var n="transaction "+(e.name||e.displayName||"noop");Ve(n);var r=e.apply(t,i);return Ge(n),r}function Ve(e){n.inTransaction+=1}function Ge(e){0==--n.inTransaction&&(n.isRunningActions=!1,Be())}function Ye(e){var t="??"+Xr++;return Qr.map[t]=e,t+" "}function Ke(e){return Qr.map[e]}function Xe(e){for(var t=Qe(e),i=0,n=t.length;i<n;i++)e=e.replace(t[i],Ye);return e}function Qe(e,t,i){var n=!1,r=0,t=t||0;i=i||[];for(var a=e.length;t<a;t++){var o=e.charAt(t);n?o===n&&(i.push(e.slice(r,t+1)),n=!1):"'"===o?(n="'",r=t):'"'===o&&(n='"',r=t)}return!1!==n?Qe(e,r+1,i):i}function Ze(e){return e.replace(sa,Ye).replace(ua,function(e){return ea[e]?e:"__vmodel__."+e})}function Je(e,t){var i=e+":"+t,r=da.get(i);if(r)return r.slice(0);Qr.map={};var a=e.replace(oa,function(e,t){return t+Ye(e.slice(t.length))});a=Xe(a),a=a.replace(na,Ye).replace(ia,"$1").replace(la,function(e,t,i){return t+Ye(i)+":"}).replace(ta,"$1__vmodel__.").replace(ca,function(e,t){return"|"+Ye(t)}),a=Ze(a);var o=a.split(aa),s=o.shift().replace(Zr,Ke).trim();return/\?\?\d/.test(s)&&(s=s.replace(Zr,Ke)),o.length?(o=o.map(function(e){var t="";return e=e.replace(ra,function(e,i){return/\S/.test(i)&&(t+=","+i),""}),"["+n.quote(e.trim())+t+"]"}),o="avalon.composeFilters("+o+")(__value__)",o=o.replace(Zr,Ke)):o="",da.put(i,[s,o])}function et(e){return ha.test(e)&&(e+="($event)"),Zi<9&&(e=e.replace(pa,function(e,t,i){return"__vmodel__."+t+".call(__vmodel__"+(/\S/.test(i)?","+i:"")+")"})),e}function tt(e,t){var i,r=Je(e,t);i=r[1]?r[1].replace(/__value__\)$/,r[0]+")"):r[0];try{return new Function("__vmodel__","return "+i+";")}catch(t){return n.log("parse getter: [",e,i,"]error"),n.noop}}function it(e,t){var i=Je(e,t),r="try{ "+i[0]+' = __value__}catch(e){avalon.log(e, "in on dir")}';try{return new Function("__vmodel__","__value__",r+";")}catch(t){return n.log("parse setter: ",e," error"),n.noop}}function nt(e,t,i){for(var n in t)1!==ma[n]&&(this[n]=t[n]);this.vm=e,this.observers=[],this.callback=i,this.uuid=++fa,this.ids="",this.mapIDs={},this.isAction=!0;var r=this.expr;"function"!=typeof this.getter&&(this.getter=tt(r,this.type)),"duplex"===this.type&&(this.setter=it(r,this.type)),this.value=NaN,this.node||(this.value=this.get())}function rt(e){if(e&&"object"==typeof e){if(e&&e.$events)return e.$model;if(Array.isArray(e)){for(var t=[],i=0,n=e.length;i<n;i++)t.push(rt(e[i]));return t}var r={};for(var a in e)r[a]=rt(e[a]);return r}return e}function at(e,t,i){if(this.expr=e,t){var n=on.createProxy(t,this);n&&(t=n)}this.value=t,this.vm=i;try{i.$mutations[e]=this}catch(e){}this.uuid=++ga,this.updateVersion(),this.mapIDs={},this.observers=[]}function ot(e){var t=e.toString();return t.substring(t.indexOf("{}")+1,t.lastIndexOf("}"))}function st(e){var t=function(){};return t.prototype=e,new t}function lt(e,t){if("function"==typeof t){(e.prototype=st(t.prototype)).constructor=e}}function ct(e,t){n.mix(this,e),n.mix(this,Gn),this.$hashcode=n.makeHashCode("$"),this.$id=this.$id||this.$hashcode,this.$events={__dep__:t||new at(this.$id)},n.config.inProxyMode?(delete this.$mutations,this.$accessors={},this.$computed={},this.$track=""):this.$accessors={$model:ba},void 0===t?(this.$watch=on.watchFactory(this.$events),this.$fire=on.fireFactory(this.$events)):(delete this.$watch,delete this.$fire)}function ut(e,t,i){return!(e in Gn)&&("$"===e.charAt(0)?!!i&&(_a[e]||(_a[e]=1,n.warn("ms-for中的变量"+e+"不再建议以$为前缀")),!0):null==t?(n.warn("定义vmodel时"+e+"的属性值不能为null undefine"),!0):!/error|date|function|regexp/.test(n.type(t))&&!(t&&t.nodeName&&t.nodeType))}function dt(e,t){if(e&&e.$events)return e;var i;return Array.isArray(e)?i=on.listFactory(e,!1,t):d(e)&&(i=on.modelFactory(e,t)),i}function ht(e,t,i){var n=null,r=i?ya:at;return{get:function(){return n||(n=new r(e,t,this)),n.get()},set:function(i){n||(n=new r(e,t,this)),n.set(i)},enumerable:!0,configurable:!0}}function pt(e){var t=n.type(e);if("array"===t){for(var i=[],r=0;r<e.length;r++)i[r]=pt(e[r]);return i}if("object"===t&&"string"==typeof e.$track){var a={};return(e.$track.match(/[^☥]+/g)||[]).forEach(function(t){var i=e[t];a[t]=i&&i.$events?pt(i):i}),a}return e}function ft(e){for(var t in xa)on.hideProperty(e,t,xa[t])}function mt(e,t,i){t||(ft(e),Ji&&Object.defineProperty(e,"$model",on.modelAccessor),on.hideProperty(e,"$hashcode",n.makeHashCode("$")),on.hideProperty(e,"$events",{__dep__:i||new at}));for(var r=e.$events&&e.$events.__dep__,a=0,o=e.length;a<o;a++){var s=e[a];d(s)&&(e[a]=on.createProxy(s,r))}return e}function gt(e,t,i){ka?Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!1,configurable:!0}):Ca[t]||(e[t]=i)}function vt(e){return function(t,i,r){var a=new nt(e.__proxy__,{deep:r,type:"user",expr:t},i);return e[t]?e[t].push(a):e[t]=[a],function(){a.dispose(),n.Array.remove(e[t],a),0===e[t].length&&delete e[t]}}}function yt(e){return function(t,i){var n=e[t];if(Array.isArray(n))for(var r,a=0;r=n[a++];)r.callback.call(r.vm,i,r.value,r.expr)}}function _t(e){return"☥"+e+"☥"}function bt(e,t,i,r){function a(t){return _t(e.$track).indexOf(_t(t))>-1}var o=e.$accessors;for(var s in Gn)n.msie<9&&void 0===t[s]||gt(e,s,t[s]);for(var l=0;l<i.length;l++){var c=i[l];if(!(c in o)){var u=t[c];if(r&&"function"==typeof u){e[c]=u.bind(e),e[c]._orig=u;continue}e[c]=u}}e.$track=i.join("☥"),n.msie<9&&(e.hasOwnProperty=a),e.$events.__proxy__=e}function wt(e){var t=[];for(var i in e)t.push(i);return t}function xt(e,t,i){if(0===i)return e===t;if(null===e&&null===t)return!0;if(void 0===e&&void 0===t)return!0;var n=Array.isArray(e);return n===Array.isArray(t)&&(n?kt(e,t,i):"object"==typeof e&&"object"==typeof t?Ct(e,t,i):e===t)}function kt(e,t,i){if(e.length!==t.length)return!1;for(var n=e.length-1;n>=0;n--)try{if(!xt(e[n],t[n],i-1))return!1}catch(e){return!1}return!0}function Ct(e,t,i){if(null===e||null===t)return!1;if(wt(e).length!==wt(t).length)return!1;for(var n in e){if(!(n in t))return!1;try{if(!xt(e[n],t[n],i-1))return!1}catch(e){return!1}}return!0}function Tt(){var e=Ha[0];e&&e()}function St(e,t,i){e[t]||(e[t]=i)}function Et(e,t,i){for(var n,r=[].concat(e[t]),a=0;n=r[a++];)"function"==typeof n&&n(i)}function At(e){var t=e.toLowerCase();return function(i){var r=this.dom,a=n(r),o=isFinite(i.stagger)?1e3*i.stagger:0;if(o&&i.staggerKey){var s=Va.get(i.staggerKey)||Va.put(i.staggerKey,{count:0,items:0});s.count++,s.items++}var l,c=s&&s.count||0,u=function(t){var a=!1!==t;0==--r.__ms_effect_&&(n.unbind(r,Ua),n.unbind(r,Ba)),clearTimeout(l),Et(i,"on"+e+(a?"Done":"Abort"),r),s&&0==--s.items&&(s.count=0),i.queue&&(Ha.shift(),Tt())};Et(i,"onBefore"+e,r),i[t]?i[t](r,function(e){u(!1!==e)}):Ra&&(a.addClass(i[t+"Class"]),a.removeClass(Dt(i,t)),r.__ms_effect_?r.__ms_effect_++:(a.bind(Ua,u),a.bind(Ba,u),r.__ms_effect_=1),setTimeout(function(){var e=NaN===n.root.offsetWidth;a.addClass(i[t+"ActiveClass"]),e=Lt(r),0===!e?u(!1):o||(l=setTimeout(function(){u(!1)},e+32))},17+o*c))}}function It(e){if(!e.action)return e.action=e.hook.replace(/^on/,"").replace(/Done$/,"").toLowerCase()}function Dt(e,t){var t="leave"===t?"enter":"leave";return Array(t+"Class",t+"ActiveClass").map(function(t){return e[t]}).join(" ")}function Mt(e){var t=Ka.test(e)?1e3:1;return parseFloat(e)*t}function Lt(e){var t=nn.getComputedStyle(e,null),i=t[Ga],n=t[Ya];return Mt(i)||Mt(n)}function Ot(e,t){var i=e.ownerDocument,r=e.nodeName,a="_"+r;if(!Ot[a]){var o=i.body.appendChild(i.createElement(r));t=n.css(o,"display"),i.body.removeChild(o),t===Xa&&(t="block"),Ot[a]=t}return Ot[a]}function Nt(e,t){var i=e.innerRender=n.scan(e.fragment,e.vm);n.shadowCopy(t,i.root),delete t.nodeValue}function Pt(e,t){e.children&&e.children.forEach(function(e){"option"===e.nodeName?Rt(e,t):Pt(e,t)})}function Rt(e,t){var i=e.props;if(!("disabled"in i)){var n=jt(e,i);if(n=String(n||"").trim(),i.selected="string"==typeof t?n===t:-1!==t.indexOf(n),e.dom){e.dom.selected=i.selected;e.dom.selected}}}function jt(e,t){if(t&&"value"in t)return t.value+"";var i=[];return e.children.forEach(function(e){"#text"===e.nodeName?i.push(e.nodeValue):"#document-fragment"===e.nodeName&&i.push(jt(e))}),i.join("")}function zt(e,t){return e.children.forEach(function(e){"option"===e.nodeName?!0===e.props.selected&&t.push(jt(e,e.props)):e.children&&zt(e,t)}),t}function Ft(e){e.userCb&&e.userCb.call(e.vm,{type:"changed",target:e.dom})}function Bt(e){var t=this,i=t._ms_duplex_;if(!t.composing&&t.value!==i.value){if(t.caret)try{var n=i.getCaret(t);i.pos=n}catch(e){}if(i.debounceTime>4){var r=new Date,a=r-i.time||0;i.time=r,a>=i.debounceTime?Qa[i.dtype].call(i):(clearTimeout(i.debounceID),i.debounceID=setTimeout(function(){Qa[i.dtype].call(i)},a))}else i.isChanged?setTimeout(function(){Qa[i.dtype].call(i)},4):Qa[i.dtype].call(i)}}function Ut(){var e=this.expr;Za.test(e)&&(this.isChanged=!0,e=e.replace(Za,""));var t=e.match(Ja);t&&(e=e.replace(Ja,""),this.isChanged||(this.debounceTime=parseInt(t[1],10)||300)),this.expr=e}function $t(){var e=(this.expr,this.node),t=e.props.type;this.parseValue=Wt;var i,n=this.param,r=!1;n=n?n.split("-").map(function(e){return"checked"===e&&(r=!0),e}):[],e.duplex=this,Zn.test(t)&&r&&(n=[],i="radio",this.isChecked=r),this.parsers=n,/input|textarea|select/.test(e.nodeName)?i||(i="select"===e.nodeName?"select":"checkbox"===t?"checkbox":"radio"===t?"radio":"input"):"contenteditable"in e.props&&(i="contenteditable"),this.dtype=i,"input"!==i&&"contenteditable"!==i?(delete this.isChanged,delete this.debounceTime):this.isChecked||(this.isString=!0);var a=e.props["data-duplex-changed"];if(a){var o=Je(a,"xx"),s=et(o[0]);this.userCb=new Function("$event","var __vmodel__ = this\nreturn "+s)}}function qt(e,t){if(Array.isArray(e)){if(e+""!==this.compareVal)return this.compareVal=e+"",!0}else if(e=this.parseValue(e),this.isChecked||(this.value=e+=""),e!==this.compareVal)return this.compareVal=e,!0}function Ht(e,t){var i=e.dom;this.dom=i,this.vdom=e,this.duplexCb=Bt,i._ms_duplex_=this,t(i,this)}function Wt(e){for(var t,i=0;t=this.parsers[i++];){var r=n.parsers[t];r&&(e=r.call(this,e))}return e}function Vt(e){var t=typeof e;return e&&"object"===t?e.$hashcode:t+":"+e}function Gt(e,t){if(d(t)){var i=Array.isArray(t),r=[],a=[],o=0;return e.isArray=i,e.fragments?(e.preFragments=e.fragments,n.each(t,function(e,t){var n=i?Vt(t):e;a.push({key:n,val:t,index:o++}),r.push(n)}),e.fragments=a):(n.each(t,function(e,t){if(!(e in Gn)){var n=i?Vt(t):e;a.push(new Fe([],n,t,o++)),r.push(n)}}),e.fragments=a),r.join(";;")}return NaN}function Yt(e){var t=e.fragments.map(function(t,i){return Zt(t,e,i),ei(e.cache,t),t}),i=e.parentChildren,n=i.indexOf(e.begin);i.splice.apply(i,[n+1,0].concat(t))}function Kt(e){var t=e.cache,i={},n=[],r=e.preFragments;r.forEach(function(e){e._dispose=!0}),e.fragments.forEach(function(r,a){var o=Jt(t,r.key);o?(delete o._dispose,o.oldIndex=o.index,o.index=a,Xt(o.vm,e.keyName),o.vm[e.valName]=r.val,o.vm[e.keyName]=e.isArray?a:o.key,ei(i,o)):n.push(r)}),n.forEach(function(n){var a=ti(t,n.key);if(a){a.oldIndex=a.index,a.key=n.key;var o=a.val=n.val,s=a.index=n.index;a.vm[e.valName]=o,a.vm[e.keyName]=e.isArray?s:a.key,delete a._dispose}else n=new Fe([],n.key,n.val,n.index),a=Zt(n,e,n.index),r.push(a);ei(i,a)}),e.fragments=r,r.sort(function(e,t){return e.index-t.index}),e.cache=i}function Xt(e,t,i){n.config.inProxyMode?e.$accessors[t].value=NaN:e.$accessors[t].set(NaN)}function Qt(e){for(var t,i=e.begin.dom,n=i.parentNode,r=e.fragments,a=e.end.dom,o=0;t=r[o];o++)if(t._dispose)r.splice(o,1),o--,t.dispose();else{if(t.oldIndex!==t.index){var s=t.toFragment(),l=null===i.nextSibling;n.insertBefore(s,i.nextSibling),l&&!n.contains(a)&&n.insertBefore(a,i.nextSibling)}i=t.split}var c=e.parentChildren,u=c.indexOf(e.begin),d=c.indexOf(e.end);r.splice.apply(c,[u+1,d-u].concat(r)),"SELECT"===n.nodeName&&n._ms_duplex_&&oo.select.call(n._ms_duplex_)}function Zt(e,t,i){var r={};r[t.keyName]=t.isArray?i:e.key,r[t.valName]=e.val,t.asName&&(r[t.asName]=t.value);var a=e.vm=on.itemFactory(t.vm,{data:r});return t.isArray?a.$watch(t.valName,function(e){t.value&&t.value.set&&t.value.set(a[t.keyName],e)}):a.$watch(t.valName,function(i){t.value[e.key]=i}),e.index=i,e.innerRender=n.scan(t.fragment,a,function(){var t=this.root;un.push.apply(e.children,t.children),this.root=e}),e}function Jt(e,t){var i=e[t];if(i){var n=i.arr;if(n){var r=n.pop();return n.length||(i.arr=0),r}return delete e[t],i}}function ei(e,t){var i=t.key;if(e[i]){var n=e[i];(n.arr||(n.arr=[])).push(t)}else e[i]=t}function ti(e){var t;for(var i in e){var t=i;break}if(t)return Jt(e,t)}function ii(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t],n=typeof i;if("string"===n||"number"===n||!0===i)e.push(i);else if(Array.isArray(i))e.push(ii.apply(null,i));else if("object"===n)for(var r in i)i.hasOwnProperty(r)&&i[r]&&e.push(r)}return e.join(" ")}function ni(e){var t=e.target;n(t).addClass(t.getAttribute(ho[e.type])||"")}function ri(e){var t=e.target,i=ho[e.type];n(t).removeClass(t.getAttribute(i)||""),"change-active"!==i&&n(t).removeClass(t.getAttribute("change-active")||"")}function ai(e,t){var i=e.getAttribute("change-class");i!==t&&(n(e).removeClass(i).addClass(t),e.setAttribute("change-class",t))}function oi(e,t){var i={};switch(t.dtype){case"radio":case"checkbox":i.click=Bt;break;case"select":i.change=Bt;break;case"contenteditable":t.isChanged?i.blur=Bt:n.modern?(nn.webkitURL?i.webkitEditableContentChanged=Bt:nn.MutationEvent&&(i.DOMCharacterDataModified=Bt),i.input=Bt):(i.keydown=pi,i.paste=li,i.cut=li,i.focus=hi,i.blur=di);break;case"input":t.isChanged?i.change=Bt:Zi<10?(i.propertychange=si,i.paste=li,i.cut=li,i.keyup=pi):(i.input=Bt,i.compositionstart=di,i.compositionend=hi,/\[native code\]/.test(nn.Int8Array)||(i.keydown=pi,i.paste=li,i.cut=li,nn.netscape&&(i.DOMAutoComplete=Bt)))}/password|text/.test(e.type)&&(i.focus=ci,i.blur=ui,t.getCaret=mi,t.setCaret=fi);for(var r in i)n.bind(e,r,i[r])}function si(e){"value"===e.propertyName&&Bt.call(this,e)}function li(e){var t=this;setTimeout(function(){Bt.call(t,e)},0)}function ci(){this.caret=!0}function ui(){this.caret=!1}function di(){this.composing=!0}function hi(e){this.composing=!1,li.call(this,e)}function pi(e){var t=e.keyCode;91===t||15<t&&t<19||37<=t&&t<=40||Bt.call(this,e)}function fi(e,t){var i;e.createTextRange?po(function(){e.focus(),i=e.createTextRange(),i.collapse(!0),i.moveEnd("character",t),i.moveStart("character",t),i.select()}):(e.focus(),void 0!==e.selectionStart&&e.setSelectionRange(t,t))}function mi(e){var t,i,n,r,a,o=0;return e.selectionStart+e.selectionEnd>-1?o=e.selectionStart:(i=Ki.selection.createRange())&&i.parentElement()===e&&(r=e.value.length,t=e.value.replace(/\r\n/g,"\n"),n=e.createTextRange(),n.moveToBookmark(i.getBookmark()),a=e.createTextRange(),a.collapse(!1),n.compareEndPoints("StartToEnd",a)>-1?o=r:(o=-n.moveStart("character",-r),o+=t.slice(0,o).split("\n").length-1)),o}function gi(e,t){var i=this.dom;if(this.isString&&t&&!e&&!i.valueHijack){i.valueHijack=Bt;var r=setInterval(function(){n.contains(n.root,i)?i.valueHijack({type:"poll"}):clearInterval(r)},30);return r}}function vi(e){return"regexp"===n.type(e)}function yi(e){if("string"==typeof e&&e){var t=e.split("-");if(3===t.length&&4===t[0].length){var i=~~t[0],n=~~t[1]-1,r=~~t[2],a=new Date(i,n,r);return a.getFullYear()===i&&a.getMonth()===n&&a.getDate()===r}}return!1}function _i(e){for(;"FORM"!==e.tagName;)e=e.parentNode;return e._ms_validate_}function bi(e){e.preventDefault();var t=_i(e.target);t&&t.onManual&&t.onManual()}function wi(e,t,i){for(var n,r=0;n=e[r++];){var a=n.rules&&n.duplex;a?(t.push(a),Ci(a,i)):n.children?wi(n.children,t,i):Array.isArray(n)&&wi(n,t,i)}}function xi(e){var t=e.target,i=t._ms_duplex_,r=(i||{}).vdom;if(i&&r.rules&&!i.validator){var a=_i(t);a&&n.Array.ensure(a.fields,i)&&Ci(i,a)}}function ki(e){var t=e.target,i=t._ms_duplex_,n=_i(e.target);n&&n.validate(i,0,e)}function Ci(e,t){var i=e.dom;e.validator||(e.validator=t,!t.validateInKeyup||e.isChanged||e.debounceTime||n.bind(i,"keyup",ki),t.validateInBlur&&n.bind(i,"blur",ki),t.resetInFocus&&n.bind(i,"focus",function(e){var t=e.target,i=t._ms_duplex_,n=_i(e.target);n&&n.onReset.call(t,e,i)}))}function Ti(){var e=this.data||{};return this.message.replace(yo,function(t,i){return null==e[i]?"":e[i]})}function Si(e,t,i,r){var a=t.type,o=n.directives[a];if(Yi){var s=n.vdom(i,"toDOM");1===s.nodeType&&s.removeAttribute(t.attrName),i.dom=s}var l=o.update?function(e){!r.mount&&/css|visible|duplex/.test(a)?r.callbacks.push(function(){o.update.call(u,u.node,e)}):o.update.call(u,u.node,e)}:n.noop;for(var c in o)t[c]=o[c];t.node=i;var u=new nt(e,t,l);return u.init&&u.init(),u.update(),u}function Ei(e,t){var i=t[0],r={},a=[],o=!1;for(var s in e){var l=e[s],c=s.split("-");if(s in i.props)var u=s;else u=":"+s.slice(3);_o[c[1]]&&c.splice(1,0,"on"),"on"===c[1]&&(c[3]=parseFloat(c[3])||0);var d=c[1];if("controller"!==d&&"important"!==d&&tn[d]){var h={type:d,param:c[2],attrName:u,name:c.join("-"),expr:l,priority:tn[d].priority||100*d.charCodeAt(0)};if("if"===d&&(o=!0),"on"===d&&(h.priority+=c[3]),!r[h.name]&&(r[h.name]=l,a.push(h),"for"===d))return[n.mix(h,t[3])]}}if(a.sort(Ai),o)for(var p,f=[],m=0;p=a[m++];)if(f.push(p),"if"===p.type)return f;return a}function Ai(e,t){return e.priority-t.priority}function Ii(e){var t=/\n\r?/g,i=e.nodeValue.trim().replace(t,""),r=[];do{var a=i.indexOf(w.openTag);a=-1===a?i.length:a;var o=i.slice(0,a);if(/\S/.test(o)&&r.push(n.quote(n._decode(o))),i=i.slice(a+w.openTag.length)){a=i.indexOf(w.closeTag);var o=i.slice(0,a),s=n.unescapeHTML(o);if(/\|\s*\w/.test(s)){var l=Je(s,"expr");l[1]&&(s=l[1].replace(wo,l[0]+")"))}bo&&(s="("+s+")"),r.push(s),i=i.slice(a+w.closeTag.length)}}while(i.length);return[{expr:r.join("+"),name:"expr",type:"expr"}]}function Di(e){for(var t,i=0,n=0;t=e[n++];)"#document-fragment"===t.nodeName?i+=Di(t.children):i+=1;return i}function Mi(e,t){t&&t.forEach(function(t){if(t){var i=t.children&&Di(t.children);if("#document-fragment"===t.nodeName)var r=b();else{r=n.vdom(t,"toDOM");var a=r.childNodes&&r.childNodes.length;a&&i&&a>i&&(xo[r.nodeName]||n.clearHTML(r))}if(i&&(Mi(r,t.children),"select"===t.nodeName)){var o=[];zt(t,o),Pt(t,o)}try{xo[e.nodeName]||e.appendChild(r)}catch(e){}}})}function Li(e){if(e)for(var t;t=e.firstChild;)1===t.nodeType&&Li(t),e.removeChild(t)}function Oi(e,t){var i,n=e.indexOf(t)+1,r=1,a=[];for(a.start=n;t=e[n++];)if(a.push(t),"#comment"===t.nodeName)if(Ni(t.nodeValue,"ms-for:"))r++;else if("ms-for-end:"===t.nodeValue&&0===--r){i=t,a.pop();break}return a.end=i,a}function Ni(e,t){return 0===e.indexOf(t)}function Pi(e,t,i){this.root=e,this.vm=t,this.beforeReady=i,this.bindings=[],this.callbacks=[],this.directives=[],this.init()}function Ri(){var e=this.beforeUpdate(),t=this.value=this.get();if(this.callback&&this.diff(t,e)){this.callback(this.node,this.value);var i=this.vm,r=i.$render,a=i.$events.onViewChange;a&&r&&r.root&&!n.viewChanging&&(ko&&(clearTimeout(ko),ko=null),ko=setTimeout(function(){a.forEach(function(e){e.callback.call(i,{type:"viewchange",target:r.root,vmodel:i})})}))}this._isScheduled=!1}function ji(e){var e=on.toJson(e);if(Array.isArray(e)){var t={};return e.forEach(function(e){e&&n.shadowCopy(t,e)}),t}return e}function zi(e,t){e.innerRender=t;var i=t.root,n=e.node,r=n.props.slot;for(var a in i)n[a]=i[a];n.props&&r&&(n.props.slot=r),t.root=n,t.vnodes[0]=n}function Fi(e,t,i){var n=e.$events["on"+i];n&&n.forEach(function(n){setTimeout(function(){n.callback.call(e,{type:i.toLowerCase(),target:t.dom,vmodel:e})},0)})}function Bi(e,t,i){var r=[],a=e.defaults;Ui(a,r),Ui(t,r);var o={};for(var s in a){var l=t[s];o[s]=null==l?a[s]:l}o.$id=t.id||t.$id||n.makeHashCode(i),delete o.id;var c=n.mix(!0,{},o),u=n.define(c);return r.forEach(function(e){u.$watch(e.type,e.cb)}),u}function Ui(e,t){for(var i in e)Co[i]&&"function"==typeof e[i]&&0===i.indexOf("on")&&t.unshift({type:i,cb:e[i]})}function $i(e,t){var i=t&&t[0]&&t[0].forDir;i&&(i.parentChildren=e)}function qi(e,t){for(var i,n=0;i=e[n];n++){if("slot"===i.nodeName){$i(e,t),e.splice.apply(e,[n,1].concat(t));break}i.children&&qi(i.children,t)}}function Hi(e,t){for(var i,n=0;i=e[n];n++)if("slot"!==i.nodeName)i.children&&Hi(i.children,t);else{var r=i.props.name;$i(e,t[r]),e.splice.apply(e,[n,1].concat(t[r]))}}function Wi(e,t){n.components[e]=t;for(var i,r=0;i=To[r];r++)i.is===e&&(To.splice(r,1),i.reInit=!0,delete i.value,i.update(),r--);return t}function Vi(e){var t=e.displayName;delete e.displayName;var i={defaults:n.mix(!0,{},this.defaults,e.defaults)};return e.soleSlot&&(i.soleSlot=e.soleSlot),i.template=e.template||this.template,n.component(t,i)}var Gi="object"==typeof window?window:"object"==typeof global?global:{},Yi=!!Gi.location&&Gi.navigator,Ki=Yi?Gi.document:{createElement:Object,createElementNS:Object,documentElement:"xx",contains:Boolean},Xi=Yi?Ki.documentElement:{outerHTML:"x"},Qi={objectobject:7,objectundefined:6,undefinedfunction:NaN,undefinedobject:NaN},Zi=Ki.documentMode||Qi[typeof Ki.all+typeof XMLHttpRequest],Ji=/NaN|undefined/.test(Zi)||Zi>8;e.prototype={put:function(e,t){var i={key:e,value:t};return this._keymap[e]=i,this.tail?(this.tail.newer=i,i.older=this.tail):this.head=i,this.tail=i,this.size===this.limit?this.shift():this.size++,t},shift:function(){var e=this.head;e&&(this.head=this.head.newer,this.head.older=e.newer=e.older=this._keymap[e.key]=void 0,delete this._keymap[e.key],this.size--)},get:function(e){var t=this._keymap[e];if(void 0!==t)return t===this.tail?t.value:(t.newer&&(t===this.head&&(this.head=t.newer),t.newer.older=t.older),t.older&&(t.older.newer=t.newer),t.newer=void 0,t.older=this.tail,this.tail&&(this.tail.newer=t),this.tail=t,t.value)}};var en={},tn={},nn=Gi;n.init=function(e){this[0]=this.element=e},n.fn=n.prototype=n.init.prototype;var rn=/[^, ]+/g,an=/\S+/g,on={},sn=Object.prototype,ln=sn.toString,cn=sn.hasOwnProperty,un=Array.prototype,dn="object"==typeof console;n.config={debug:!1};var hn=/([a-z\d])([A-Z]+)/g,pn=/[-_][^-_]/g,fn=un.slice,mn=/\d\.\d{4}/,gn=1,vn=/[-.*+?^${}()|[\]\/\\]/g,yn={},_n={},bn={},wn={};nn.avalon=n;var xn=/&[a-z0-9#]{2,10};/,kn=Ki.createElement("div");r(n,{Array:{merge:function(e,t){e.push.apply(e,t)},ensure:function(e,t){if(-1===e.indexOf(t))return e.push(t)},removeAt:function(e,t){return!!e.splice(t,1).length},remove:function(e,t){var i=e.indexOf(t);return!!~i&&n.Array.removeAt(e,i)}},evaluatorPool:new e(888),parsers:{number:function(e){return""===e?"":parseFloat(e)||0},string:function(e){return null===e||void 0===e?"":e+""},boolean:function(e){return""===e?e:"true"===e||"1"===e}},_decode:function(e){return xn.test(e)?(kn.innerHTML=e,kn.innerText||kn.textContent):e}});var Cn={interpolate:function(e){var t=e[0],i=e[1];if(t===i)throw new SyntaxError("interpolate openTag cannot equal to closeTag");if(/[<>]/.test(t+"test"+i))throw new SyntaxError('interpolate cannot contains "<" or ">"');w.openTag=t,w.closeTag=i;var n=_(t),r=_(i);w.rtext=new RegExp(n+"(.+?)"+r,"g"),w.rexpr=new RegExp(n+"([\\s\\S]*)"+r)}};if(w.plugins=Cn,w({interpolate:["{{","}}"],debug:!1}),r(n,{shadowCopy:r,oneObject:a,inspect:ln,ohasOwn:cn,rword:rn,version:"2.2.10",vmodels:{},directives:tn,directive:t,eventHooks:yn,eventListeners:_n,validators:bn,cssHooks:wn,log:s,noop:u,warn:l,error:c,config:w,modern:Ji,msie:Zi,root:Xi,document:Ki,window:nn,inBrowser:Yi,isObject:d,range:h,slice:m,hyphen:p,camelize:f,escapeRegExp:_,quote:o,makeHashCode:g}),!k("司徒正美".trim)){var Tn=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;String.prototype.trim=function(){return this.replace(Tn,"")}}Object.create||(Object.create=function(){function e(){}return function(t){if(1!=arguments.length)throw new Error("Object.create implementation only accepts one parameter.");return e.prototype=t,new e}}());var Sn=!{toString:null}.propertyIsEnumerable("toString"),En=function(){}.propertyIsEnumerable("prototype"),An=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],In=An.length
|
||
;k(Object.keys)||(Object.keys=function(e){var t=[],i=En&&"function"==typeof e;if("string"==typeof e||e&&e.callee)for(var n=0;n<e.length;++n)t.push(String(n));else for(var r in e)i&&"prototype"===r||!cn.call(e,r)||t.push(String(r));if(Sn)for(var a=e.constructor,o=a&&a.prototype===e,s=0;s<In;s++){var l=An[s];o&&"constructor"===l||!cn.call(e,l)||t.push(l)}return t}),k(Array.isArray)||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),k(k.bind)||(Function.prototype.bind=function(e){if(arguments.length<2&&void 0===e)return this;var t=this,i=arguments;return function(){var n,r=[];for(n=1;n<i.length;n++)r.push(i[n]);for(n=0;n<arguments.length;n++)r.push(arguments[n]);return t.apply(e,r)}});try{fn.call(n.document.documentElement)}catch(e){un.slice=function(e,t){if(t=void 0!==t?t:this.length,Array.isArray(this))return fn.call(this,e,t);var i,n,r=[],a=this.length,o=e||0;o=o>=0?o:a+o;var s=t||a;if(t<0&&(s=a+t),(n=s-o)>0)if(r=new Array(n),this.charAt)for(i=0;i<n;i++)r[i]=this.charAt(o+i);else for(i=0;i<n;i++)r[i]=this[o+i];return r}}k(un.map)||n.shadowCopy(un,{indexOf:function(e,t){var i=this.length,n=~~t;for(n<0&&(n+=i);n<i;n++)if(this[n]===e)return n;return-1},lastIndexOf:function(e,t){var i=this.length,n=null==t?i-1:t;for(n<0&&(n=Math.max(0,i+n));n>=0;n--)if(this[n]===e)return n;return-1},forEach:C("","_",""),filter:C("r=[],j=0,","if(_)r[j++]=this[i]","return r"),map:C("r=[],","r[i]=_","return r"),some:C("","if(_)return true","return false"),every:C("","if(!_)return false","return true")});var Dn=function(){var e={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},t=function(e,t){return("000000"+(t||0)).slice(-e)},i=function(i){var n=i.charCodeAt(0),r=e[n];return r||"\\u00"+t(2,n.toString(16))},n=/[\x00-\x1f\x22\x5c]/g;return function(e){return n.lastIndex=0,'"'+(n.test(e)?String(e).replace(n,i):e)+'"'}}();try{n._quote=msie<=8?Dn:JSON.stringify}catch(e){n._quote=Dn}var Mn={};"Boolean Number String Function Array Date RegExp Object Error".replace(n.rword,function(e){Mn["[object "+e+"]"]=e.toLowerCase()}),n.type=function(e){return null==e?String(e):"object"==typeof e||"function"==typeof e?Mn[ln.call(e)]||"object":typeof e};var Ln=/^\s*\bfunction\b/;n.isFunction="object"==typeof alert?function(e){try{return Ln.test(e+"")}catch(e){return!1}}:function(e){return"[object Function]"===ln.call(e)};var On=/^\[object (?:Window|DOMWindow|global)\]$/;n.isWindow=S(n.window)?S:T;var Nn,Pn;for(Nn in n({}))break;Pn="0"!==Nn,n.isPlainObject=/\[native code\]/.test(Object.getPrototypeOf)?A:E;var Rn=/object|function/;n.mix=n.fn.mix=function(){var e=arguments.length,t=!1,i=0,n=[];for(!0===arguments[0]&&(t=!0,i=1);i<e;i++){var r=arguments[i];r=r&&Rn.test(typeof r)?r:{},n.push(r)}return 1===n.length&&n.unshift(this),I(t,n)};var jn,zn=/(Array|List|Collection|Map|Arguments)\]$/;n.each=function(e,t){if(e){var i=0;if(D(e))for(var n=e.length;i<n&&!1!==t(i,e[i]);i++);else for(i in e)if(e.hasOwnProperty(i)&&!1===t(i,e[i]))break}},function(){var e=["%cavalon.js %c"+n.version+" %cin debug mode, %cmore...","color: rgb(114, 157, 52); font-weight: normal;","color: rgb(85, 85, 85); font-weight: normal;","color: rgb(85, 85, 85); font-weight: normal;","color: rgb(82, 140, 224); font-weight: normal; text-decoration: underline;"];if("object"==typeof console){var t=console,i=t.groupCollapsed||t.log;Function.apply.call(i,t,e),t.log("You're running avalon in debug mode - messages will be printed to the console to help you fix problems and optimise your application.\n\nTo disable debug mode, add this line at the start of your app:\n\n avalon.config({debug: false});\n\nDebug mode also automatically shut down amicably when your app is minified.\n\nGet help and support:\n https://segmentfault.com/t/avalon\n http://avalonjs.coding.me/\n http://www.baidu-x.com/?q=avalonjs\n http://www.avalon.org.cn/\n\nFound a bug? Raise an issue:\n https://github.com/RubyLouvre/avalon/issues\n\n"),i!==console.log&&t.groupEnd(e)}}();var Fn=/<script[^>]*>([\S\s]*?)<\/script\s*>/gim,Bn=/\s+(on[^=\s]+)(?:=("[^"]*"|'[^']*'|[^\s>]+))?/g,Un=/<\w+\b(?:(["'])[^"]*?(\1)|[^>])*>/gi,$n={a:/\b(href)\=("javascript[^"]*"|'javascript[^']*')/gi,img:/\b(src)\=("javascript[^"]*"|'javascript[^']*')/gi,form:/\b(action)\=("javascript[^"]*"|'javascript[^']*')/gi},qn={yyyy:R("FullYear",4),yy:R("FullYear",2,0,!0),y:R("FullYear",1),MMMM:j("Month"),MMM:j("Month",!0),MM:R("Month",2,1),M:R("Month",1,1),dd:R("Date",2),d:R("Date",1),HH:R("Hours",2),H:R("Hours",1),hh:R("Hours",2,-12),h:R("Hours",1,-12),mm:R("Minutes",2),m:R("Minutes",1),ss:R("Seconds",2),s:R("Seconds",1),sss:R("Milliseconds",3),EEEE:j("Day"),EEE:j("Day",!0),a:F,Z:z},Hn=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,Wn=/^\/Date\((\d+)\)\/$/,Vn={AMPMS:{0:"上午",1:"下午"},DAY:{0:"星期日",1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六"},MONTH:{0:"1月",1:"2月",2:"3月",3:"4月",4:"5月",5:"6月",6:"7月",7:"8月",8:"9月",9:"10月",10:"11月",11:"12月"},SHORTDAY:{0:"周日",1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六"},fullDate:"y年M月d日EEEE",longDate:"y年M月d日",medium:"yyyy-M-d H:mm:ss",mediumDate:"yyyy-M-d",mediumTime:"H:mm:ss",short:"yy-M-d ah:mm",shortDate:"yy-M-d",shortTime:"ah:mm"};Vn.SHORTMONTH=Vn.MONTH,B.locate=Vn;var Gn={$id:void 0,$render:void 0,$track:void 0,$element:void 0,$computed:void 0,$watch:void 0,$fire:void 0,$events:void 0,$accessors:void 0,$hashcode:void 0,$mutations:void 0,$vbthis:void 0,$vbsetter:void 0},Yn={stop:function(e){return e.stopPropagation(),e},prevent:function(e){return e.preventDefault(),e}},Kn={esc:27,tab:9,enter:13,space:32,del:46,up:38,left:37,right:39,down:40};for(var Xn in Kn)!function(e,t){Yn[e]=function(e){return e.which!==t&&(e.$return=!0),e}}(Xn,Kn[Xn]);var Qn=n.filters={};n.composeFilters=function(){var e=arguments;return function(t){for(var i,r=0;i=e[r++];){var a=i[0],o=n.filters[a];if("function"==typeof o){i[0]=t;try{t=o.apply(0,i)}catch(e){}}}return t}},n.escapeHtml=Y,n.mix(Qn,{uppercase:function(e){return String(e).toUpperCase()},lowercase:function(e){return String(e).toLowerCase()},truncate:function(e,t,i){return e?(e=String(e),isNaN(t)&&(t=30),i="string"==typeof i?i:"...",e.length>t?e.slice(0,t-i.length)+i:e):""},camelize:n.camelize,date:B,escape:Y,sanitize:O,number:L,currency:function(e,t,i){return(t||"¥")+L(e,isFinite(i)?i:2)}},{filterBy:q,orderBy:U,selectBy:H,limitBy:W},Yn);var Zn=/^(?:checkbox|radio)$/;n.contains=Z,n.cloneNode=function(e){return e.cloneNode(!0)},Yi&&function(){function e(e,t){e in Xi||!HTMLElement.prototype.__defineGetter__||HTMLElement.prototype.__defineGetter__(e,t)}Zi<10&&(n.cloneNode=Q),Ki.contains||(Ki.contains=function(e){return Z(Ki,e)}),n.modern&&(Ki.createTextNode("x").contains||(Node.prototype.contains=function(e){return Z(this,e)})),e("outerHTML",function(){var e=Ki.createElement("div");return e.appendChild(this),e.innerHTML}),e("children",function(){for(var e,t=[],i=0;e=this.childNodes[i++];)1===e.nodeType&&t.push(e);return t}),e("innerText",function(){return this.textContent})}(),J.prototype={toString:function(){var e=this.node,t=e.className,i="string"==typeof t?t:t.baseVal,n=i.match(an);return n?n.join(" "):""},contains:function(e){return(" "+this+" ").indexOf(" "+e+" ")>-1},add:function(e){this.contains(e)||this.set(this+" "+e)},remove:function(e){this.set((" "+this+" ").replace(" "+e+" "," "))},set:function(e){e=e.trim();var t=this.node;"object"==typeof t.className?t.setAttribute("class",e):t.className=e,e||t.removeAttribute("class")}},"add,remove".replace(rn,function(e){n.fn[e+"Class"]=function(t){var i=this[0]||{};return t&&"string"==typeof t&&1===i.nodeType&&t.replace(an,function(t){ee(i)[e](t)}),this}}),n.shadowCopy(n.fn,{hasClass:function(e){var t=this[0]||{};return 1===t.nodeType&&ee(t).contains(e)},toggleClass:function(e,t){var i="boolean"==typeof t,n=this;return String(e).replace(an,function(e){var r=i?t:!n.hasClass(e);n[r?"addClass":"removeClass"](e)}),this}});var Jn={};"accept-charset,acceptCharset|char,ch|charoff,chOff|class,className|for,htmlFor|http-equiv,httpEquiv".replace(/[^\|]+/g,function(e){var t=e.split(",");Jn[t[0]]=t[1]}),["autofocus,autoplay,async,allowTransparency,checked,controls","declare,disabled,defer,defaultChecked,defaultSelected,","isMap,loop,multiple,noHref,noResize,noShade","open,readOnly,selected"].join(",").replace(/\w+/g,function(e){Jn[e.toLowerCase()]=e}),["accessKey,bgColor,cellPadding,cellSpacing,codeBase,codeType,colSpan","dateTime,defaultValue,contentEditable,frameBorder,longDesc,maxLength,marginWidth,marginHeight,rowSpan,tabIndex,useMap,vSpace,valueType,vAlign"].join(",").replace(/\w+/g,function(e){Jn[e.toLowerCase()]=e});var er=/^[\],:{}\s]*$/,tr=/(?:^|:|,)(?:\s*\[)+/g,ir=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,nr=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,rr=/^\[object SVG\w*Element\]$/,ar=/&/g,or={};try{n.parseJSON=JSON.parse}catch(e){n.parseJSON=ie}n.fn.attr=function(e,t){return 2===arguments.length?(this[0].setAttribute(e,t),this):this[0].getAttribute(e)};var sr=a("float","cssFloat");n.cssNumber=a("animationIterationCount,columnCount,order,flex,flexGrow,flexShrink,fillOpacity,fontWeight,lineHeight,opacity,orphans,widows,zIndex,zoom");var lr=["","-webkit-","-o-","-moz-","-ms-"];n.cssName=function(e,t,i){if(sr[e])return sr[e];t=t||n.root.style||{};for(var r=0,a=lr.length;r<a;r++)if((i=n.camelize(lr[r]+e))in t)return sr[e]=i;return null},n.css=function(e,t,i,r){if(e instanceof n&&(e=e[0]),1===e.nodeType){var a=n.camelize(t);if(t=n.cssName(a)||a,void 0===i||"boolean"==typeof i){r=wn[a+":get"]||wn["@:get"],"background"===t&&(t="backgroundColor");var o=r(e,t);return!0===i?parseFloat(o)||0:o}if(""===i)e.style[t]="";else{if(null==i||i!==i)return;isFinite(i)&&!n.cssNumber[a]&&(i+="px"),r=wn[a+":set"]||wn["@:set"],r(e,t,i)}}},n.fn.css=function(e,t){if(n.isPlainObject(e))for(var i in e)n.css(this,i,e[i]);else var r=n.css(this,e,t);return void 0!==r?r:this},n.fn.position=function(){var e,t,i=this[0],r={top:0,left:0};return i?("fixed"===this.css("position")?t=i.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),"HTML"!==e[0].tagName&&(r=e.offset()),r.top+=n.css(e[0],"borderTopWidth",!0),r.left+=n.css(e[0],"borderLeftWidth",!0),r.top-=e.scrollTop(),r.left-=e.scrollLeft()),{top:t.top-r.top-n.css(i,"marginTop",!0),left:t.left-r.left-n.css(i,"marginLeft",!0)}):r},n.fn.offsetParent=function(){for(var e=this[0].offsetParent;e&&"static"===n.css(e,"position");)e=e.offsetParent;return n(e||n.root)},wn["@:set"]=function(e,t,i){try{e.style[t]=i}catch(e){}},wn["@:get"]=function(e,t){if(!e||!e.style)throw new Error("getComputedStyle要求传入一个节点 "+e);var i,n=nn.getComputedStyle(e,null);return n&&""===(i="filter"===t?n.getPropertyValue(t):n[t])&&(i=e.style[t]),i},wn["opacity:get"]=function(e){var t=wn["@:get"](e,"opacity");return""===t?"1":t},"top,left".replace(n.rword,function(e){wn[e+":get"]=function(t){var i=wn["@:get"](t,e);return/px$/.test(i)?i:n(t).position()[e]+"px"}});var cr={position:"absolute",visibility:"hidden",display:"block"},ur=/^(none|table(?!-c[ea]).+)/;if(n.each({Width:"width",Height:"height"},function(e,t){var i="client"+e,r="scroll"+e,a="offset"+e;wn[t+":get"]=function(t,i,r){var o=-4;"number"==typeof r&&(o=r),i="Width"===e?["Left","Right"]:["Top","Bottom"];var s=t[a];return 2===o?s+n.css(t,"margin"+i[0],!0)+n.css(t,"margin"+i[1],!0):(o<0&&(s=s-n.css(t,"border"+i[0]+"Width",!0)-n.css(t,"border"+i[1]+"Width",!0)),-4===o&&(s=s-n.css(t,"padding"+i[0],!0)-n.css(t,"padding"+i[1],!0)),s)},wn[t+"&get"]=function(e){var i=[];ae(e,i);for(var n,r=wn[t+":get"](e),a=0;n=i[a++];){e=n.node;for(var o in n)"string"==typeof n[o]&&(e.style[o]=n[o])}return r},n.fn[t]=function(n){var o=this[0];if(0===arguments.length){if(o.setTimeout)return o["inner"+e]||o.document.documentElement[i]||o.document.body[i];if(9===o.nodeType){var s=o.documentElement;return Math.max(o.body[r],s[r],o.body[a],s[a],s[i])}return wn[t+"&get"](o)}return this.css(t,n)},n.fn["inner"+e]=function(){return wn[t+":get"](this[0],void 0,-2)},n.fn["outer"+e]=function(e){return wn[t+":get"](this[0],void 0,!0===e?2:0)}}),Zi<9){n.shadowCopy(sr,a("float","styleFloat"));var dr=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,hr=/^(top|right|bottom|left)$/,pr=/alpha\([^)]+\)/i,fr=/(opacity|\d(\d|\.)*)/g,mr=8===Zi,gr={thin:mr?"1px":"2px",medium:mr?"3px":"4px",thick:mr?"5px":"6px"};wn["@:get"]=function(e,t){var i=e.currentStyle,n=i[t];if(dr.test(n)&&!hr.test(n)){var r=e.style,a=r.left,o=e.runtimeStyle.left;e.runtimeStyle.left=i.left,r.left="fontSize"===t?"1em":n||0,n=r.pixelLeft+"px",r.left=a,e.runtimeStyle.left=o}return"medium"===n&&(t=t.replace("Width","Style"),"none"===i[t]&&(n="0px")),""===n?"auto":gr[n]||n},wn["opacity:set"]=function(e,t,i){var n=e.style,r=Number(i)<=1?"alpha(opacity="+100*i+")":"",a=n.filter||"";n.zoom=1,n.filter=(pr.test(a)?a.replace(pr,r):a+" "+r).trim(),n.filter||n.removeAttribute("filter")},wn["opacity:get"]=function(e){for(var t,i=e.style.filter.match(fr)||[],n=!1,r=0;t=i[r++];)if("opacity"===t)n=!0;else if(n)return t/100+"";return"1"}}n.fn.offset=function(){var e=this[0],t={left:0,top:0};if(!e||!e.tagName||!e.ownerDocument)return t;var i=e.ownerDocument,r=i.body,a=i.documentElement,o=i.defaultView||i.parentWindow;if(!n.contains(a,e))return t;e.getBoundingClientRect&&(t=e.getBoundingClientRect());var s=a.clientTop||r.clientTop,l=a.clientLeft||r.clientLeft,c=Math.max(o.pageYOffset||0,a.scrollTop,r.scrollTop),u=Math.max(o.pageXOffset||0,a.scrollLeft,r.scrollLeft);return{top:t.top+c-s,left:t.left+u-l}},n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){n.fn[e]=function(i){var r=this[0]||{},a=oe(r),o=n.root,s="scrollTop"===e;if(!arguments.length)return a?t in a?a[t]:o[e]:r[e];a?a.scrollTo(s?n(a).scrollLeft():i,s?i:n(a).scrollTop()):r[e]=i}});var vr={"option:get":Zi?le:function(e){return e.value},"select:get":function(e,t){for(var i,n=e.options,r=e.selectedIndex,a=vr["option:get"],o="select-one"===e.type||r<0,s=o?null:[],l=o?r+1:n.length,c=r<0?l:o?r:0;c<l;c++)if(i=n[c],(i.selected||c===r)&&!i.disabled&&(!i.parentNode.disabled||"OPTGROUP"!==i.parentNode.tagName)){if(t=a(i),o)return t;s.push(t)}return s},"select:set":function(e,t,i){t=[].concat(t);for(var n,r=vr["option:get"],a=0;n=e.options[a++];)(n.selected=t.indexOf(r(n))>-1)&&(i=!0);i||(e.selectedIndex=-1)}};n.fn.val=function(e){var t=this[0];if(t&&1===t.nodeType){var i=0===arguments.length,n=i?":get":":set",r=vr[se(t)+n];if(r)var a=r(t,e);else{if(i)return(t.value||"").replace(/\r/g,"");t.value=e}}return i?a:this};var yr={area:1,base:1,basefont:1,bgsound:1,br:1,col:1,command:1,embed:1,frame:1,hr:1,img:1,input:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1},_r=a("div,ul,ol,dl,table,h1,h2,h3,h4,h5,h6,form,fieldset"),br=ce("tr,style,script"),wr=(ce("option,optgroup,#text"),ce("option,#text"),ce("#text"),ce("th,td,style,script"),ce("col"),ce("base,basefont,bgsound,link,style,script,meta,title,noscript,noframes"),a("head,body"),{xmp:1,style:1,script:1,noscript:1,textarea:1,"#comment":1,template:1}),xr={style:1,script:1,noscript:1,template:1},kr=/\S/,Cr=/\s/;n.lexer=ue;var Tr=new e(100),Sr=/^(tbody|thead|tfoot)$/,Er=/\<(\w[^\s\/\>]*)/,Ar=/<|&#?\w+;/,Ir=new e(128),Dr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;n.parseHTML=function(e){var t=b();if("string"!=typeof e)return t;if(!Ar.test(e))return Ki.createTextNode(e);e=e.replace(Dr,"<$1></$2>").trim();var i=Ir.get(e);if(i)return n.cloneNode(i);for(var r,a=ue(e),o=0;r=a[o++];){var s=n.vdom(r,"toDOM");t.appendChild(s)}return e.length<1024&&Ir.put(e,t),t},n.innerHTML=function(e,t){var i=n.parseHTML(t);this.clearHTML(e),e.appendChild(i)},n.unescapeHTML=function(e){return String(e).replace(/"/g,'"').replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")},n.clearHTML=function(e){for(;e.lastChild;)e.removeChild(e.lastChild);return e};var Mr={click:!0,dblclick:!0,keydown:!0,keypress:!0,keyup:!0,mousedown:!0,mousemove:!0,mouseup:!0,mouseover:!0,mouseout:!0,wheel:!0,mousewheel:!0,input:!0,change:!0,beforeinput:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,select:!0,cut:!0,copy:!0,paste:!0,beforecut:!0,beforecopy:!0,beforepaste:!0,focusin:!0,focusout:!0,DOMFocusIn:!0,DOMFocusOut:!0,DOMActivate:!0,dragend:!0,datasetchanged:!0},Lr=n.modern&&Ki.ontouchstart;n.fn.bind=function(e,t,i){if(this[0])return n.bind(this[0],e,t,i)},n.fn.unbind=function(e,t,i){if(this[0]){var r=fn.call(arguments);r.unshift(this[0]),n.unbind.apply(0,r)}return this},n.bind=function(e,t,i){if(1===e.nodeType){var r=e.getAttribute("avalon-events")||"",a=y(i),o=yn[t];"click"===t&&Lr&&e.addEventListener("click",n.noop),o&&(t=o.type||t,o.fix&&(i=o.fix(e,i),i.uuid=a));var s=t+":"+a;n.eventListeners[i.uuid]=i,-1===r.indexOf(t+":")&&(Mr[t]||n.modern&&Pr[t]?Ce(t):n._nativeBind(e,t,ke));var l=r.split(",");return""===l[0]&&l.shift(),-1===l.indexOf(s)&&(l.push(s),we(e,l.join(","))),i}var c=function(t){i.call(e,new Te(t))};return n._nativeBind(e,t,c),c},n.unbind=function(e,t,i){if(1===e.nodeType){var r=e.getAttribute("avalon-events")||"";switch(arguments.length){case 1:n._nativeUnBind(e,t,ke),e.removeAttribute("avalon-events");break;case 2:r=r.split(",").filter(function(e){return-1===e.indexOf(t+":")}).join(","),we(e,r);break;default:var a=t+":"+i.uuid;r=r.split(",").filter(function(e){return e!==a}).join(","),we(e,r),delete n.eventListeners[i.uuid]}}else n._nativeUnBind(e,t,i)};var Or={},Nr=/^e/,Pr={focus:!0,blur:!0},Rr={webkitMovementY:1,webkitMovementX:1,keyLocation:1,fixEvent:function(){},preventDefault:function(){var e=this.originalEvent||{};e.returnValue=this.returnValue=!1,Ji&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent||{};e.cancelBubble=this.cancelBubble=!0,Ji&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.stopPropagation(),this.stopImmediate=!0},toString:function(){return"[object Event]"}};if(Te.prototype=Rr,"onmouseenter"in Xi||n.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){yn[e]={type:t,fix:function(t,i){return function(n){var r=n.relatedTarget;if(!r||r!==t&&!(16&t.compareDocumentPosition(r)))return delete n.type,n.type=e,i.apply(this,arguments)}}}}),n.each({AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"},function(e,t){nn[e]&&!yn.animationend&&(yn.animationend={type:t})}),!("onmousewheel"in Ki)){var jr=void 0!==Ki.onwheel?"wheel":"DOMMouseScroll",zr="wheel"===jr?"deltaY":"detail";yn.mousewheel={type:jr,fix:function(e,t){return function(i){var n=i[zr]>0?-120:120;return i.wheelDelta=~~e._ms_wheel_+n,e._ms_wheel_=i.wheelDeltaY=i.wheelDelta,i.wheelDeltaX=0,Object.defineProperty&&Object.defineProperty(i,"type",{value:"mousewheel"}),t.apply(this,arguments)}}}}Ji||(delete Mr.change,delete Mr.select),n._nativeBind=Ji?function(e,t,i,n){e.addEventListener(t,i,!!n)}:function(e,t,i){e.attachEvent("on"+t,i)},n._nativeUnBind=Ji?function(e,t,i,n){e.removeEventListener(t,i,!!n)}:function(e,t,i){e.detachEvent("on"+t,i)},n.fireDom=function(e,t,i){if(Ki.createEvent){var r=Ki.createEvent("Events");r.initEvent(t,!0,!0,i),n.shadowCopy(r,i),e.dispatchEvent(r)}else if(Xi.contains(e)){r=Ki.createEventObject(),i&&n.shadowCopy(r,i);try{e.fireEvent("on"+t,r)}catch(e){n.log("fireDom",t,"args error")}}};var Fr=/^(?:mouse|contextmenu|drag)|click/;Te.prototype.fixEvent=function(){var e=this;if(null==e.which&&0===e.type.indexOf("key")&&(e.which=null!=e.charCode?e.charCode:e.keyCode),Fr.test(e.type)&&!("pageX"in e)){var t=e.target.ownerDocument||Ki,i="BackCompat"===t.compatMode?t.body:t.documentElement;e.pageX=e.clientX+(i.scrollLeft>>0)-(i.clientLeft>>0),e.pageY=e.clientY+(i.scrollTop>>0)-(i.clientTop>>0),e.wheelDeltaY=~~e.wheelDelta,e.wheelDeltaX=0}},"oninput"in Ki.createElement("input")||(yn.input={type:"propertychange",fix:function(e,t){return function(e){if("value"===e.propertyName)return e.type="input",t.apply(this,arguments)}}});var Br=[];n.ready=function(e){Br.push(e),n.isReady&&Se()},n.ready(function(){n.scan&&n.scan(Ki.body)}),Yi&&function(){function e(){try{Xi.doScroll("left"),Se()}catch(t){setTimeout(e)}}if("complete"===Ki.readyState)setTimeout(Se);else if(Ki.addEventListener)Ki.addEventListener("DOMContentLoaded",Se,!1);else if(Ki.attachEvent){Ki.attachEvent("onreadystatechange",function(){"complete"===Ki.readyState&&Se()});try{var t=null===nn.frameElement}catch(e){}Xi.doScroll&&t&&nn.external&&e()}n.bind(nn,"load",Se)}();var Ur={script:1,style:1,textarea:1,xmp:1,noscript:1,template:1},$r=/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,qr=/input|textarea|select/i;Le.prototype={constructor:Le,toDOM:function(){if(this.dom)return this.dom;var e=n._decode(this.nodeValue);return this.dom=Ki.createTextNode(e)},toHTML:function(){return this.nodeValue}},Oe.prototype={constructor:Oe,toDOM:function(){return this.dom?this.dom:this.dom=Ki.createComment(this.nodeValue)},toHTML:function(){return"\x3c!--"+this.nodeValue+"--\x3e"}},Ne.prototype={constructor:Ne,toDOM:function(){if(this.dom)return this.dom;var e,t=this.nodeName;e=n.modern&&Wr[t]?je(t):n.modern||!Gr[t]&&!Vr.test(t)?Ki.createElement(t):ze(t);var i=this.props||{};for(var r in i){var a=i[r];Re(a)&&(Hr[r]&&n.msie<8?Hr[r](e,a):e.setAttribute(r,a+""))}var o=this.children||[],s=o[0]?o[0].nodeValue:"";switch(this.nodeName){case"script":e.type="noexec",e.text=s;try{e.innerHTML=s}catch(e){}e.type=i.type||"";break;case"noscript":e.textContent=s;case"style":case"xmp":case"template":try{e.innerHTML=s}catch(t){Pe(e,this.nodeName,s)}break;case"option":Zi<9&&(e.text=s);default:!this.isVoidTag&&this.children&&this.children.forEach(function(t){return o&&e.appendChild(n.vdom(o,"toDOM"))})}return this.dom=e},toHTML:function(){var e=[],t=this.props||{};for(var i in t){Re(t[i])&&e.push(i+"="+n.quote(t[i]+""))}e=e.length?" "+e.join(" "):"";var r="<"+this.nodeName+e;return this.isVoidTag?r+"/>":(r+=">",this.children&&(r+=this.children.map(function(e){return e?n.vdom(e,"toHTML"):""}).join("")),r+"</"+this.nodeName+">")}};var Hr={class:function(e,t){e.className=t},style:function(e,t){e.style.cssText=t},type:function(e,t){try{e.type=t}catch(e){}},for:function(e,t){e.setAttribute("for",t),e.htmlFor=t}},Wr=n.oneObject("circle,defs,ellipse,image,line,path,polygon,polyline,rect,symbol,text,use,g,svg"),Vr=/^\w+\:\w+/,Gr=n.oneObject("shape,line,polyline,rect,roundrect,oval,arc,curve,background,image,shapetype,group,fill,stroke,shadow, extrusion, textbox, imagedata, textpath");Fe.prototype={constructor:Fe,toDOM:function(){if(this.dom)return this.dom;var e=this.toFragment();return this.split=e.lastChild,this.dom=e},dispose:function(){this.toFragment(),this.innerRender&&this.innerRender.dispose();for(var e in this)this[e]=null},toFragment:function(){var e=b();return this.children.forEach(function(t){return e.appendChild(n.vdom(t,"toDOM"))}),e},toHTML:function(){return this.children.map(function(e){return n.vdom(e,"toHTML")}).join("")}},n.mix(n,{VText:Le,VComment:Oe,VElement:Ne,VFragment:Fe});var Yr={"#text":"VText","#document-fragment":"VFragment","#comment":"VComment"};n.vdomAdaptor=n.vdom=function(e,t){if(!e)return"toHTML"===t?"":b();var i=e.nodeName;return i?n[Yr[i]||"VElement"].prototype[t].call(e):new n.VFragment(e)[t]()};n.domize=function(e){return n.vdom(e,"toDOM")},n.pendingActions=[],n.uniqActions={},n.inTransaction=0,w.trackDeps=!1,n.track=function(){w.trackDeps&&n.log.apply(n,arguments)};var Kr=[];n.transaction=We;var Xr=0,Qr={map:{}},Zr=/\?\?\d+/g,Jr=n.oneObject("break,case,catch,continue,debugger,default,delete,do,else,false,finally,for,function,if,in,instanceof,new,null,return,switch,this,throw,true,try,typeof,var,void,while,with,abstract,boolean,byte,char,class,const,double,enum,export,extends,final,float,goto,implements,import,int,interface,long,native,package,private,protected,public,short,static,super,synchronized,throws,transient,volatile,arguments"),ea=n.mix({Math:1,Date:1,$event:1,window:1,__vmodel__:1,avalon:1},Jr),ta=/(^|[^\w\u00c0-\uFFFF_])(@|##)(?=[$\w])/g,ia=/\s*(\.|\|)\s*/g,na=/\|\|/g,ra=/\(([^)]*)\)/,aa=/\|(?=\?\?)/,oa=/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/g,sa=/\.[\w\.\$]+/g,la=/(\{|\,)\s*([\$\w]+)\s*:/g,ca=/\|(\w+)/g,ua=/[$a-zA-Z_][$a-zA-Z0-9_]*/g,da=new e(300),ha=/^__vmodel__\.[$\w\.]+$/,pa=/__vmodel__\.([^(]+)\(([^)]*)\)/,fa=1;nt.prototype={getValue:function(){var e=this.vm;try{return this.getter.call(e,e)}catch(e){n.log(this.getter+" exec error")}},setValue:function(e){var t=this.vm;this.setter&&this.setter.call(t,t,e)},get:function(e){this.type;this.deep&&(n.deepCollect=!0);var t=qe(this,this.getValue);return this.deep&&n.deepCollect&&(n.deepCollect=!1),t},beforeUpdate:function(){return this.oldValue=rt(this.value)},update:function(e,t){var i=this.beforeUpdate(),n=this.value=this.get(),r=this.callback;r&&this.diff(n,i,e)&&r.call(this.vm,this.value,i,this.expr),this._isScheduled=!1},schedule:function(){this._isScheduled||(this._isScheduled=!0,n.uniqActions[this.uuid]||(n.uniqActions[this.uuid]=1,n.pendingActions.push(this)),Be())},removeDepends:function(){var e=this;this.observers.forEach(function(t){n.Array.remove(t.observers,e)})},diff:function(e,t){return e!==t},dispose:function(){this.value=null,this.removeDepends(),this.beforeDispose&&this.beforeDispose();for(var e in this)delete this[e]}};var ma={vm:1,callback:1,observers:1,oldValue:1,value:1,getValue:1,setValue:1,get:1,removeDepends:1,beforeUpdate:1,update:1,dispose:1},ga=1;at.prototype={get:function(){if(n.trackingAction){this.collect();var e=this.value;if(e&&e.$events)if(Array.isArray(e))e.forEach(function(e){e&&e.$events&&e.$events.__dep__.collect()});else if(n.deepCollect)for(var t in e)if(e.hasOwnProperty(t)){e[t]}}return this.value},collect:function(){n.track(name,"被收集"),$e(this)},updateVersion:function(){this.version=Math.random()+Math.random()},notify:function(){Ve(),Ue(this),Ge()},set:function(e){var t=this.value;if(e!==t){if(n.isObject(e)){var i=t&&t.$hashcode,r=on.createProxy(e,this);r&&(i&&(r.$hashcode=i),e=r)}this.value=e,this.updateVersion(),this.notify()}}};var va=/(\?|if\b|\(.+\))/,ya=function(e){function t(t,i,r){e.call(this,t,void 0,r),delete i.get,delete i.set,n.mix(this,i),this.deps={},this.type="computed",this.depsVersion={},this.isComputed=!0,this.trackAndCompute(),"isStable"in this||(this.isStable=!va.test(ot(this.getter)))}lt(t,e);var i=t.prototype;return i.trackAndCompute=function(){this.isStable&&this.depsCount>0?this.getValue():qe(this,this.getValue.bind(this))},i.getValue=function(){return this.value=this.getter.call(this.vm)},i.schedule=function(){for(var e=this.observers,t=e.length;t--;){var i=e[t];i.schedule&&i.schedule()}},i.shouldCompute=function(){if(this.isStable){var e=!1;for(var t in this.deps)this.deps[t].version!==this.depsVersion[t]&&(e=!0,this.depsVersion[t]=this.deps[t].version);return e}return!0},i.set=function(){this.setter&&n.transaction(this.setter,this.vm,arguments)},i.get=function(){return this.collect(),this.shouldCompute()&&(this.trackAndCompute(),this.updateVersion()),this.value},t}(at);n.define=function(e){var t=e.$id;t||n.error("vm.$id must be specified"),n.vmodels[t]&&n.warn("error:["+t+"] had defined!");var i=on.modelFactory(e);return n.vmodels[t]=i},on.modelFactory=function(e,t){var i=e.$computed||{};delete e.$computed;var r=new ct(e,t),a=r.$accessors,o=[];on.hideProperty(r,"$mutations",{});for(var s in e)if(!(s in Gn)){var l=e[s];o.push(s),ut(s,l)&&(a[s]=ht(s,l))}for(var c in i)if(!(c in Gn)){var l=i[c];"function"==typeof l&&(l={get:l}),l&&l.get&&(l.getter=l.get,l.setter=l.set,n.Array.ensure(o,c),a[c]=ht(c,l,!0))}var u=on.createViewModel(r,a,r);return on.afterCreate(u,r,o,!t),u};var _a={};on.createProxy=dt,on.itemFactory=function(e,t){var i=e.$model,r=new ct(i),a=n.shadowCopy(r.$accessors,e.$accessors),o=t.data;for(var s in o){var l=i[s]=r[s]=o[s];a[s]=ht(s,l)}var c=Object.keys(i),u=on.createViewModel(r,a,r);return on.afterCreate(u,r,c),u},on.fuseFactory=function(e,t){var i=n.mix(e.$model,t.$model),r=new ct(n.mix(i,{$id:e.$id+t.$id})),a=n.mix(r.$accessors,e.$accessors,t.$accessors),o=Object.keys(i),s=on.createViewModel(r,a,r);return on.afterCreate(s,r,o,!1),s};var ba={get:function(){return pt(this)},set:n.noop,enumerable:!1,configurable:!0};on.toJson=pt,on.modelAccessor=ba;var wa=un.splice,xa={set:function(e,t){if(e>>>0===e&&this[e]!==t){if(e>this.length)throw Error(e+"set方法的第一个参数不能大于原数组长度");this.splice(e,1,t)}},toJSON:function(){return this.$model=on.toJson(this)},contains:function(e){return-1!==this.indexOf(e)},ensure:function(e){return!this.contains(e)&&(this.push(e),!0)},pushArray:function(e){return this.push.apply(this,e)},remove:function(e){return this.removeAt(this.indexOf(e))},removeAt:function(e){return e>>>0===e?this.splice(e,1):[]},clear:function(){return this.removeAll(),this},removeAll:function(e){var t=(this.length,Array.isArray(e)?function(t){return-1!==e.indexOf(t)}:"function"==typeof e&&e);if(t)for(var i=this.length-1;i>=0;i--)t(this[i],i)&&wa.call(this,i,1);else wa.call(this,0,this.length);this.toJSON(),this.$events.__dep__.notify()}};["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=un[e];xa[e]=function(){var i=this.$events,n=on.listFactory(arguments,!0,i.__dep__),r=t.apply(this,n);return this.toJSON(),i.__dep__.notify(e),r}}),on.listFactory=mt;var ka=!0;try{Object.defineProperty({},"_",{value:"x"}),delete Gn.$vbsetter,delete Gn.$vbthis}catch(e){ka=!1}var Ca={$vbthis:1,$vbsetter:1};on.hideProperty=gt,on.fireFactory=yt,on.watchFactory=vt,on.afterCreate=bt;var Ta,Sa=Object.defineProperties,Ea=new Date-0;if(!ka&&("__defineGetter__"in n&&(Ta=function(e,t,i){return"value"in i&&(e[t]=i.value),"get"in i&&e.__defineGetter__(t,i.get),"set"in i&&e.__defineSetter__(t,i.set),e},Sa=function(e,t){for(var i in t)t.hasOwnProperty(i)&&Ta(e,i,t[i]);return e}),Zi<9)){var Aa={};window.execScript(["Function parseVB(code)","\tExecuteGlobal(code)","End Function"].join("\n"),"VBScript");var Ia=function(e,t,i,n){var r=t[i];if(4!==arguments.length)return r.get.call(e);r.set.call(e,n)};Sa=function(e,t,i){var r=[];r.push("\tPrivate [$vbsetter]","\tPublic [$accessors]","\tPublic Default Function [$vbthis](ac"+Ea+", s"+Ea+")","\t\tSet [$accessors] = ac"+Ea+": set [$vbsetter] = s"+Ea,"\t\tSet [$vbthis] = Me","\tEnd Function");var a={$vbthis:!0,$vbsetter:!0,$accessors:!0};for(e in Gn)a[e]||(r.push("\tPublic ["+e+"]"),a[e]=!0);for(e in t)a[e]||(a[e]=!0,r.push("\tPublic Property Let ["+e+"](val"+Ea+")",'\t\tCall [$vbsetter](Me, [$accessors], "'+e+'", val'+Ea+")","\tEnd Property","\tPublic Property Set ["+e+"](val"+Ea+")",'\t\tCall [$vbsetter](Me, [$accessors], "'+e+'", val'+Ea+")","\tEnd Property","\tPublic Property Get ["+e+"]","\tOn Error Resume Next","\t\tSet["+e+'] = [$vbsetter](Me, [$accessors],"'+e+'")',"\tIf Err.Number <> 0 Then","\t\t["+e+'] = [$vbsetter](Me, [$accessors],"'+e+'")',"\tEnd If","\tOn Error Goto 0","\tEnd Property"));for(e in i)a[e]||(a[e]=!0,r.push("\tPublic ["+e+"]"));r.push("\tPublic [hasOwnProperty]"),r.push("End Class");var o=r.join("\r\n"),s=Aa[o];return s||(s=n.makeHashCode("VBClass"),window.parseVB("Class "+s+o),window.parseVB(["Function "+s+"Factory(acc, vbm)","\tDim o","\tSet o = (New "+s+")(acc, vbm)","\tSet "+s+"Factory = o","End Function"].join("\r\n")),Aa[o]=s),window[s+"Factory"](t,Ia)}}on.createViewModel=Sa;var Da=n.directive("important",{priority:1,getScope:function(e,t){var i=n.vmodels[e];if(i)return i;throw"error! no vmodel called "+e},update:function(e,t,i){if(n.inBrowser){var r=n.vdom(e,"toDOM");1===r.nodeType&&(r.removeAttribute(t),n(r).removeClass("ms-controller"));var a=n.vmodels[i];a&&(a.$element=r,a.$render=this,a.$fire("onReady"),delete a.$events.onReady)}}}),Ma=Da.update;n.directive("controller",{priority:2,getScope:function(e,t){var i=n.vmodels[e];return i?(i.$render=this,t&&t!==i?on.fuseFactory(t,i):i):t},update:Ma}),n.directive("skip",{delay:!0});var La={},Oa=n.directive("css",{diff:function(e,t){if(Object(e)===e){if(e=on.toJson(e),Array.isArray(e)){var i={};e.forEach(function(e){e&&n.shadowCopy(i,e)}),e=i,
|
||
La[this.type]||(n.warn("ms-"+this.type+"指令的值不建议使用数组形式了!"),La[this.type]=1)}var r=!1,a={};if(t){if(this.deep){"number"==typeof this.deep&&this.deep;for(var o in e){if(!xt(e[o],t[o],4))return this.value=e,!0;a[o]=e[o]}}else for(var s in e)e[s]!==t[s]&&(r=!0),a[s]=e[s];for(var l in t)l in a||(r=!0,a[l]="")}else a=e,r=!0;if(r)return this.value=a,!0}return!1},update:function(e,t){var i=e.dom;if(i&&1===i.nodeType){var r=n(i);for(var a in t)r.css(a,t[a])}}}),Na=Oa.diff,Pa={TransitionEvent:"transitionend",WebKitTransitionEvent:"webkitTransitionEnd",OTransitionEvent:"oTransitionEnd",otransitionEvent:"otransitionEnd"},Ra=void 0,ja=void 0,za=void 0,Fa=void 0,Ba=void 0,Ua=void 0;for(Fa in Pa){if(nn[Fa]){ja=Pa[Fa];break}try{document.createEvent(Fa);ja=Pa[Fa];break}catch(e){}}"string"==typeof ja&&(Ra=!0,Ua=ja),Pa={AnimationEvent:"animationend",WebKitAnimationEvent:"webkitAnimationEnd"};for(Fa in Pa)if(nn[Fa]){za=Pa[Fa];break}"string"==typeof za&&(Ra=!0,Ba=za);var $a=n.directive("effect",{priority:5,diff:function(e){var t=this.node;"string"==typeof e&&(this.value=e={is:e},n.warn("ms-effect的指令值不再支持字符串,必须是一个对象")),this.value=t.effect=e;var i=this;return!!Na.call(this,e,this.oldValue)&&(setTimeout(function(){t.animating=!0,$a.update.call(i,t,t.effect)}),t.animating=!1,!0)},update:function(e,t,i){var r=e.dom;if(r&&1===r.nodeType){var a=t||i,o=a.is,s=n.effects[o];if(!s)return void n.warn(o+" effect is undefined");var l={},c=qa[a.action];if("function"!=typeof Wa.prototype[c])return void n.warn("action is undefined");var u=new n.Effect(r);return n.mix(l,s,a,{action:c}),l.queue?(Ha.push(function(){u[c](l)}),Tt()):u[c](l),!0}}}),qa={true:"enter",false:"leave",enter:"enter",leave:"leave",move:"move",undefined:"enter"},Ha=[];n.effects={},n.effect=function(e,t){var i=n.effects[e]=t||{};return Ra&&!1!==i.css&&(St(i,"enterClass",e+"-enter"),St(i,"enterActiveClass",i.enterClass+"-active"),St(i,"leaveClass",e+"-leave"),St(i,"leaveActiveClass",i.leaveClass+"-active")),i};var Wa=function(e){this.dom=e};n.Effect=Wa,Wa.prototype={enter:At("Enter"),leave:At("Leave"),move:At("Move")};var Va=new e(128);n.applyEffect=function(e,t,i){var r=i.cb,a=t.effect;if(a&&e&&1===e.nodeType){var o=i.hook,s=a[o];r&&(Array.isArray(s)?s.push(r):a[o]=s?[s,r]:[r]),It(i),n.directives.effect.update(t,a,n.shadowCopy({},i))}else r&&r(e)};var Ga=n.cssName("transition-duration"),Ya=n.cssName("animation-duration"),Ka=/\d+s$/,Xa="none";n.parseDisplay=Ot,n.directive("visible",{diff:function(e,t){var i=!!e;if(void 0===t||i!==t)return this.value=i,!0},ready:!0,update:function(e,t){var i=e.dom;if(i&&1===i.nodeType){var r,a=i.style.display;t?(a===Xa&&((r=e.displayValue)||(i.style.display="",""===i.style.cssText&&i.removeAttribute("style"))),""===i.style.display&&n(i).css("display")===Xa&&n.contains(i.ownerDocument,i)&&(r=Ot(i))):a!==Xa&&(r=Xa,e.displayValue=a);var o=function(){void 0!==r&&(i.style.display=r)};n.applyEffect(i,e,{hook:t?"onEnterDone":"onLeaveDone",cb:o})}}}),n.directive("text",{delay:!0,init:function(){var e=this.node;e.isVoidTag&&n.error("自闭合元素不能使用ms-text");var t={nodeName:"#text",nodeValue:this.getValue()};e.children.splice(0,e.children.length,t),Yi&&(n.clearHTML(e.dom),e.dom.appendChild(n.vdom(t,"toDOM"))),this.node=t;this.type=this.name="expr";var i=n.directives.expr,r=this;this.callback=function(e){i.update.call(r,r.node,e)}}}),n.directive("expr",{update:function(e,t){t=null==t||""===t?"":t,e.nodeValue=t,e.dom&&(e.dom.data=t)}}),n.directive("attr",{diff:Na,update:function(e,t){var i=e.props;for(var n in t)!1==!!t[n]?delete i[n]:i[n]=t[n];var r=e.dom;r&&1===r.nodeType&&ne(r,t)}}),n.directive("html",{update:function(e,t){this.beforeDispose(),this.innerRender=n.scan('<div class="ms-html-container">'+t+"</div>",this.vm,function(){var t=this.root;e.children&&(e.children.length=0),e.children=t.children,this.root=e,e.dom&&n.clearHTML(e.dom)})},beforeDispose:function(){this.innerRender&&this.innerRender.dispose()},delay:!0}),n.directive("if",{delay:!0,priority:5,init:function(){this.placeholder=x("if");var e=this.node.props;delete e["ms-if"],delete e[":if"],this.fragment=n.vdom(this.node,"toHTML")},diff:function(e,t){var i=!!e;if(void 0===t||i!==t)return this.value=i,!0},update:function(e,t){if(void 0===this.isShow&&t)return void Nt(this,e);this.isShow=t;var i=this.placeholder;if(t){var n=i.parentNode;Nt(this,e),n&&n.replaceChild(e.dom,i)}else{this.beforeDispose(),e.nodeValue="if",e.nodeName="#comment",delete e.children;var r=e.dom,n=r&&r.parentNode;e.dom=i,n&&n.replaceChild(i,r)}},beforeDispose:function(){this.innerRender&&this.innerRender.dispose()}}),n.directive("on",{beforeInit:function(){this.getter=n.noop},init:function(){var e=this.node,t=this.name.replace("ms-on-","e").replace("-","_"),i=t+"_"+this.expr.replace(/\s/g,"").replace(/[^$a-z]/gi,function(e){return e.charCodeAt(0)}),r=n.eventListeners[i];if(!r){var a=Je(this.expr),o=a[0],s=a[1];o=et(o),s&&(s=s.replace(/__value__/g,"$event"),s+="\nif($event.$return){\n\treturn;\n}");var l=["try{","\tvar __vmodel__ = this;","\t"+s,"\treturn "+o,'}catch(e){avalon.log(e, "in on dir")}'].filter(function(e){return/\S/.test(e)});r=new Function("$event",l.join("\n")),r.uuid=i,n.eventListeners[i]=r}var c=n.vdom(e,"toDOM");c._ms_context_=this.vm,this.eventType=this.param.replace(/\-(\d)$/,""),delete this.param,n(c).bind(this.eventType,r)},beforeDispose:function(){n(this.node.dom).unbind(this.eventType)}});var Qa={input:function(e){var t=this;e=e||"value";var i=t.dom,n=i[e],r=t.parseValue(n);t.value=n,t.setValue(r),Ft(t);var a=t.pos;i.caret&&t.setCaret(i,a)},radio:function(){var e=this;if(e.isChecked){var t=!e.value;e.setValue(t),Ft(e)}else Qa.input.call(e),e.value=NaN},checkbox:function(){var e=this,t=e.value;Array.isArray(t)||(n.warn("ms-duplex应用于checkbox上要对应一个数组"),t=[t]);var i=e.dom.checked?"ensure":"remove";if(t[i]){var r=e.parseValue(e.dom.value);t[i](r),Ft(e)}this.__test__=t},select:function(){var e=this,t=n(e.dom).val();t+""!=this.value+""&&(t=Array.isArray(t)?t.map(function(t){return e.parseValue(t)}):e.parseValue(t),e.setValue(t),Ft(e))},contenteditable:function(){Qa.input.call(this,"innerHTML")}},Za=/\|\s*change\b/,Ja=/\|\s*debounce(?:\(([^)]+)\))?/,eo=!0;try{var to={},io=HTMLInputElement.prototype,no=HTMLTextAreaElement.prototype,ro=function(e){to[this.tagName].call(this,e);var t=this._ms_duplex_;!this.caret&&t&&t.isString&&t.duplexCb.call(this,{type:"setter"})},ao=HTMLInputElement.prototype;Object.getOwnPropertyNames(ao),to.INPUT=Object.getOwnPropertyDescriptor(io,"value").set,Object.defineProperty(io,"value",{set:ro}),to.TEXTAREA=Object.getOwnPropertyDescriptor(no,"value").set,Object.defineProperty(no,"value",{set:ro}),eo=!1}catch(e){}var oo={input:function(){var e=this.node,t=this.value+"";e.dom.value=e.props.value=t},updateChecked:function(e,t){e.dom&&(e.dom.defaultChecked=e.dom.checked=t)},radio:function(){var e,t=this.node,i=t.props.value;e=this.isChecked?!!this.value:this.value+""===i,t.props.checked=e,oo.updateChecked(t,e)},checkbox:function(){var e=this.node,t=e.props,i=t.value+"",n=[].concat(this.value),r=n.some(function(e){return e+""===i});t.defaultChecked=t.checked=r,oo.updateChecked(e,r)},select:function(){var e=Array.isArray(this.value)?this.value.map(String):this.value+"";Pt(this.node,e)},contenteditable:function(){for(var e,t=ue(this.value),i=b(),r=0;e=t[r++];){var a=n.vdom(e,"toDOM");i.appendChild(a)}n.clearHTML(this.dom).appendChild(i);var o=this.node.children;o.length=0,Array.prototype.push.apply(o,t),this.duplexCb.call(this.dom)}},so=/\s+as\s+([$\w]+)/,lo=/^[$a-zA-Z_][$a-zA-Z0-9_]*$/,co=/^(null|undefined|NaN|window|this|\$index|\$id)$/,uo=/[$\w_]+/g;n.directive("for",{delay:!0,priority:3,beforeInit:function(){var e,t=this.expr;t=t.replace(so,function(t,i){return!lo.test(i)||co.test(i)?n.error("alias "+i+" is invalid --- must be a valid JS identifier which is not a reserved name."):e=i,""});var i=t.split(" in "),r=i[0].match(uo);1===r.length&&r.unshift("$key"),this.expr=i[1],this.keyName=r[0],this.valName=r[1],this.signature=n.makeHashCode("for"),e&&(this.asName=e),delete this.param},init:function(){var e=this.userCb;if("string"==typeof e&&e){var t=Je(e,"for"),i=et(t[0]);this.userCb=new Function("$event","var __vmodel__ = this\nreturn "+i)}this.node.forDir=this,this.fragment=["<div>",this.fragment,"\x3c!--",this.signature,"--\x3e</div>"].join(""),this.cache={}},diff:function(e,t){if(!this.updating){this.updating=!0;var i=Gt(this,e);return void 0===this.oldTrackIds||(this.oldTrackIds!==i?(this.oldTrackIds=i,!0):void 0)}},update:function(){if(this.preFragments?(Kt(this),Qt(this)):(this.fragments=this.fragments||[],Yt(this)),this.userCb){var e=this;setTimeout(function(){e.userCb.call(e.vm,{type:"rendered",target:e.begin.dom,signature:e.signature})},0)}delete this.updating},beforeDispose:function(){this.fragments.forEach(function(e){e.dispose()})}}),n.directive("class",{diff:function(e,t){var i=this.type,n=this.node,r=n.classEvent||{};"hover"===i?(r.mouseenter=ni,r.mouseleave=ri):"active"===i&&(r.tabIndex=n.props.tabindex||-1,r.mousedown=ni,r.mouseup=ri,r.mouseleave=ri),n.classEvent=r;var a=ii(e);if(void 0===typeof t||t!==a)return this.value=a,n["change-"+i]=a,!0},update:function(e,t){var i=e.dom;if(i&&1==i.nodeType){var r=this.type,a="change-"+r,o=e.classEvent;if(o){for(var s in o)"tabIndex"===s?i[s]=o[s]:n.bind(i,s,o[s]);e.classEvent={}}["class","hover","active"].forEach(function(e){if(r===e)if("class"===e)i&&ai(i,t);else{var o=i.getAttribute(a);o&&n(i).removeClass(o);var s="change-"+e;i.setAttribute(s,t)}})}}}),tn.active=tn.hover=tn.class;var ho={mouseenter:"change-hover",mouseleave:"change-hover",mousedown:"change-active",mouseup:"change-active"};v(ni),v(ri),y(ci),y(ui),y(di),y(hi),y(Bt),y(si),y(li),y(pi);var po=function(e){setTimeout(e,0)};if(n.directive("duplex",{priority:9999999,beforeInit:Ut,init:$t,diff:qt,update:function(e,t){this.dom||Ht.call(this,e,oi),gi.call(this,n.msie,eo),oo[this.dtype].call(this)}}),n.__pollValue=gi,n.msie<8){var fo=oo.updateChecked;oo.updateChecked=function(e,t){var i=e.dom;i&&setTimeout(function(){fo(e,t),i.firstCheckedIt=1},i.firstCheckedIt?31:16)}}n.directive("rules",{diff:function(e){if(d(e)){return this.node.rules=on.toJson(e),!0}}});var mo=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/i,go=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;n.shadowCopy(n.validators,{pattern:{message:"必须匹配{{pattern}}这样的格式",get:function(e,t,i){var n=t.dom,r=t.data;if(!vi(r.pattern)){var a=n.getAttribute("pattern");r.pattern=new RegExp("^(?:"+a+")$")}return i(r.pattern.test(e)),e}},digits:{message:"必须整数",get:function(e,t,i){return i(/^\-?\d+$/.test(e)),e}},number:{message:"必须数字",get:function(e,t,i){return i(!!e&&isFinite(e)),e}},norequired:{message:"",get:function(e,t,i){return i(!0),e}},required:{message:"必须填写",get:function(e,t,i){return i(""!==e),e}},equalto:{message:"密码输入不一致",get:function(e,t,i){var r=String(t.data.equalto);return i(e===(n(document.getElementById(r)).val()||"")),e}},date:{message:"日期格式不正确",get:function(e,t,i){var n=t.data;return i(vi(n.date)?n.date.test(e):yi(e)),e}},url:{message:"URL格式不正确",get:function(e,t,i){return i(go.test(e)),e}},email:{message:"email格式不正确",get:function(e,t,i){return i(mo.test(e)),e}},minlength:{message:"最少输入{{minlength}}个字",get:function(e,t,i){var n=parseInt(t.data.minlength,10);return i(e.length>=n),e}},maxlength:{message:"最多输入{{maxlength}}个字",get:function(e,t,i){var n=parseInt(t.data.maxlength,10);return i(e.length<=n),e}},min:{message:"输入值不能小于{{min}}",get:function(e,t,i){var n=parseInt(t.data.min,10);return i(parseFloat(e)>=n),e}},max:{message:"输入值不能大于{{max}}",get:function(e,t,i){var n=parseInt(t.data.max,10);return i(parseFloat(e)<=n),e}},chs:{message:"必须是中文字符",get:function(e,t,i){return i(/^[\u4e00-\u9fa5]+$/.test(e)),e}}});var vo=n.directive("validate",{diff:function(e){var t=this.node;if(!t.validator&&d(e)){t.validator=e,e=on.toJson(e),e.vdom=t,e.dom=t.dom;for(var i in vo.defaults)e.hasOwnProperty(i)||(e[i]=vo.defaults[i]);return e.fields=e.fields||[],t.vmValidator=e,!0}},update:function(e){function t(){var e=this;e&&vo.validateAll.call(e,e.onValidateAll)}var i=e.vmValidator,r=e.validator,a=e.dom;a._ms_validate_=i,wi(e.children,i.fields,i);var o=window.netscape?"keypress":"focusin";n.bind(document,o,xi);try{var s=i.onManual=t.bind(i);r.onManual=s}catch(e){n.warn("要想使用onManual方法,必须在validate对象预定义一个空的onManual函数")}delete e.vmValidator,a.setAttribute("novalidate","novalidate"),i.validateAllInSubmit&&n.bind(a,"submit",bi)},validateAll:function(e){var t=this,i=this.vdom,n=t.fields=[];wi(i.children,n,t);var r="function"==typeof e?e:t.onValidateAll,a=t.fields.filter(function(e){var i=e.dom;return i&&!i.disabled&&t.dom.contains(i)}).map(function(e){return vo.validate(e,!0)}),o={};return Promise.all(a).then(function(e){var n=e.concat.apply([],e);t.deduplicateInValidateAll&&(n=n.filter(function(e){var t=e.element,i=t.uniqueID||(t.uniqueID=setTimeout("1"));return!o[i]&&(o[i]=!0)})),r.call(i.dom,n)})},validate:function(e,t,i){var r=[],a=e.value,o=e.dom;if("function"!=typeof Promise&&n.warn("浏览器不支持原生Promise,请下载并<script src=url>引入\nhttps://github.com/RubyLouvre/avalon/blob/master/test/promise.js"),!o.disabled){var s=e.vdom.rules,l=[],c=!0;if(!s.norequired||""!==a)for(var u in s){var d=s[u];if(!1!==d){var h,p=n.validators[u];r.push(new Promise(function(e,t){h=e}));var f=function(t){var i={element:o,data:e.data,message:o.getAttribute("data-"+u+"-message")||o.getAttribute("data-message")||p.message,validateRule:u,getMessage:Ti};t?h(!0):(c=!1,l.push(i),h(!1))};e.data={},e.data[u]=d,p.get(a,e,f)}}return Promise.all(r).then(function(n){if(!t){var r=e.validator;c?r.onSuccess.call(o,[{data:e.data,element:o}],i):r.onError.call(o,l,i),r.onComplete.call(o,l,i)}return l})}}}),yo=/\\?{{([^{}]+)\}}/gm;vo.defaults={validate:vo.validate,onError:n.noop,onSuccess:n.noop,onComplete:n.noop,onManual:n.noop,onReset:n.noop,onValidateAll:n.noop,validateInBlur:!0,validateInKeyup:!0,validateAllInSubmit:!0,resetInFocus:!0,deduplicateInValidateAll:!1};var _o=n.oneObject("animationend,blur,change,input,click,dblclick,focus,keydown,keypress,keyup,mousedown,mouseenter,mouseleave,mousemove,mouseout,mouseover,mouseup,scan,scroll,submit","on"),bo=/[+-\?]/,wo=/__value__\)$/,xo={"#text":1,"#comment":1,script:1,style:1,noscript:1};n.scan=function(e,t,i){return new Pi(e,t,i||n.noop)},Pi.prototype={init:function(){var e;if(this.root&&this.root.nodeType>0)e=Ie(this.root),Li(this.root);else{if("string"!=typeof this.root)return n.warn("avalon.scan first argument must element or HTML string");e=ue(this.root)}this.root=e[0],this.vnodes=e,this.scanChildren(e,this.vm,!0)},scanChildren:function(e,t,i){for(var n=0;n<e.length;n++){var r=e[n];switch(r.nodeName){case"#text":t&&this.scanText(r,t);break;case"#comment":t&&this.scanComment(r,t,e);break;case"#document-fragment":this.scanChildren(r.children,t,!1);break;default:this.scanTag(r,t,e,!1)}}i&&this.complete()},scanText:function(e,t){w.rexpr.test(e.nodeValue)&&this.bindings.push([e,t,{nodeValue:e.nodeValue}])},scanComment:function(e,t,i){Ni(e.nodeValue,"ms-for:")&&this.getForBinding(e,t,i)},scanTag:function(e,t,r,a){var o,s,l={},c=e.props;for(var u in c){var d=c[u],h=u;if(":"===u.charAt(0)&&(u="ms-"+u.slice(1)),Ni(u,"ms-")){l[u]=d;var p=u.match(/\w+/g)[1];p=_o[p]||p,tn[p]||n.warn(u+" has not registered!"),o=!0}"ms-for"===u&&(s=d,delete c[h])}var f=l["ms-important"]||l["ms-controller"];if(f){var m=n.serverTemplates,g=m&&m[f];if(g){n.log("前端再次渲染后端传过来的模板");var v=ue(g)[0];for(var y in v)e[y]=v[y];return delete m[f],void this.scanTag(e,t,r,a)}var p=l["ms-important"]===f?"important":"controller",_="ms-"+p in c?"ms-"+p:":"+p;Yi&&delete c[_];var b=tn[p];if(!(t=b.getScope.call(this,f,t)))return;var w=c.class;w&&(c.class=(" "+w+" ").replace(" ms-controller ","").trim());var x=this;t.$render=x,this.callbacks.push(function(){b.update.call(x,e,_,f)})}if(s)return e.dom&&e.dom.removeAttribute(h),this.getForBindingByElement(e,t,r,s);/^ms\-/.test(e.nodeName)&&(c.is=e.nodeName),c.is&&(l["ms-widget"]||(l["ms-widget"]="{}"),o=!0),o&&this.bindings.push([e,t,l]);var k=e.children;!Ur[e.nodeName]&&k&&k.length&&!i(l)&&this.scanChildren(k,t,!1)},complete:function(){if(this.yieldDirectives(),this.beforeReady(),Yi){var e=this.root;if(Yi){Mi(n.vdom(e,"toDOM"),e.children)}}this.mount=!0;for(var t;t=this.callbacks.pop();)t();this.optimizeDirectives()},yieldDirectives:function(){for(var e;e=this.bindings.shift();){var t=e[0],i=e[1],n=e[2],r=[];"nodeValue"in n?r=Ii(n):"ms-skip"in n||(r=Ei(n,e));for(var a,o=0;a=r[o++];){var s=tn[a.type];if(Yi||!/on|duplex|active|hover/.test(a.type)){s.beforeInit&&s.beforeInit.call(a);var l=new Si(i,a,t,this);this.directives.push(l)}}}},optimizeDirectives:function(){for(var e,t=0;e=this.directives[t++];)e.callback=tn[e.type].update,e.update=Ri,e._isScheduled=!1},update:function(){for(var e,t=0;e=this.directives[t++];)e.update()},dispose:function(){for(var e,t=this.directives||[],i=0;e=t[i++];)e.dispose();for(var n in this)"dispose"!==n&&delete this[n]},getForBinding:function(e,t,i,r){var a=e.nodeValue.replace("ms-for:","").trim();e.nodeValue="ms-for:"+a;var o=Oi(i,e),s=o.end,l=n.vdom(o,"toHTML");i.splice(o.start,o.length),e.props={},this.bindings.push([e,t,{"ms-for":a},{begin:e,end:s,expr:a,userCb:r,fragment:l,parentChildren:i}])},getForBindingByElement:function(e,t,i,n){var r=i.indexOf(e),a=e.props,o={nodeName:"#comment",nodeValue:"ms-for:"+n};a.slot&&(o.slot=a.slot,delete a.slot);var s={nodeName:"#comment",nodeValue:"ms-for-end:"};i.splice(r,1,o,e,s),this.getForBinding(o,t,i,a["data-for-rendered"])}};var ko,Co=n.oneObject("onInit,onReady,onViewChange,onDispose,onEnter,onLeave"),To=[];return n.directive("widget",{delay:!0,priority:4,deep:!0,init:function(){var e=this.node;if(this.cacheVm=!!e.props.cached,e.dom&&"#comment"===e.nodeName)var t=e.dom;var i=this.getValue(),r=ji(i),a=e.props.is||r.is;this.is=a;var o=n.components[a];if(!("fragment"in this))if(e.isVoidTag)this.fragment=!1;else{var s=e.children[0];s&&s.nodeValue?this.fragment=s.nodeValue:this.fragment=n.vdom(e.children,"toHTML")}if(!o)return this.readyState=0,e.nodeName="#comment",e.nodeValue="unresolved component placeholder",delete e.dom,void n.Array.ensure(To,this);var l=r.id||r.$id,c=n.vmodels[l],u=!1;if(c)d=c,this.comVm=d,zi(this,d.$render),u=!0;else{"function"==typeof o&&(o=new o(r));var d=Bi(o,r,a);this.readyState=1,Fi(d,e,"Init"),this.comVm=d;var h=n.scan(o.template,d);d.$render=h,zi(this,h);var p=[],f=[];if(this.fragment||o.soleSlot){var m=this.fragment?this.vm:d,g=this.fragment||"{{##"+o.soleSlot+"}}",v=n.scan("<div>"+g+"</div>",m,function(){p=this.root.children});f=v.directives,this.childBoss=v;for(var y in v)delete v[y]}Array.prototype.push.apply(h.directives,f);var _=[],b={};o.soleSlot?_=p:p.forEach(function(e,t){if(e.slot){var i=Oi(p,e);i.push(i.end),i.unshift(e),b[e.slot]=i}else if(e.props){var n=e.props.slot;n&&(delete e.props.slot,Array.isArray(b[n])?b[n].push(e):b[n]=[e])}}),o.soleSlot?qi(h.vnodes,_):Hi(h.vnodes,b)}if(t){var w=n.vdom(e,"toDOM");t.parentNode.replaceChild(w,t),d.$element=h.root.dom=w,delete this.reInit}Li(e.dom),d.$element=e.dom,Mi(e.dom,e.children),u?Fi(d,e,"Enter"):Fi(d,e,"Ready")},diff:function(e,t){if(Na.call(this,e,t))return!0},update:function(e,t){switch(this.readyState){case 0:this.reInit&&(this.init(),this.readyState++);break;case 1:this.readyState++;break;default:this.readyState++;var i=this.comVm;n.viewChanging=!0,n.transaction(function(){for(var e in t)i.hasOwnProperty(e)&&(Array.isArray(t[e])?i[e]=t[e].concat():i[e]=t[e])}),Fi(i,e,"ViewChange"),delete n.viewChanging}this.value=n.mix(!0,{},t)},beforeDispose:function(){var e=this.comVm;this.cacheVm?Fi(e,this.node,"Leave"):(Fi(e,this.node,"Dispose"),e.$hashcode=!1,delete n.vmodels[e.$id],this.innerRender&&this.innerRender.dispose())}}),n.components={},n.component=function(e,t){return t.extend=Vi,Wi(e,t)},n}),define("text!public/js/controllers/base_lang.json",[],function(){return'{\r\n "language": {\r\n "zh-hans": {\r\n\r\n "submit": "确定",\r\n "cancel": "取消",\r\n "true": "是",\r\n "false": "否",\r\n "update": "修改",\r\n "nonSelectedText": "--请选择--",\r\n "allSelectedText": "全部选中",\r\n "selectedAllText": "全部",\r\n "course": "我的课程",\r\n "report": "我的报告",\r\n "note": "我的笔记",\r\n "comment": "我的评论",\r\n "vclass": "虚拟课堂",\r\n "pclass": "公开课",\r\n "iclass": "校内课",\r\n "introduction": "入门",\r\n "primary": "初级",\r\n "intermediate": "中级",\r\n "advanced": "高级",\r\n "specialist": "专家",\r\n "noCourse": "暂无课程",\r\n "clouddist": "我的网盘",\r\n "learncenter_url": "/static/public/img/center/learncenter.jpg",\r\n "settingcenter_url": "/static/public/img/center/personalsetting.jpg",\r\n "goback": "返回",\r\n "op_success": "操作已完成",\r\n "footprintsreport": "学习足迹",\r\n "studyreport": "学习报告",\r\n "assist": "协助",\r\n "idauth": "身份认证",\r\n "inited": "初始化",\r\n "accepted": "接受",\r\n "rejected": "拒绝",\r\n "timeout": "超时",\r\n "cancelled": "取消",\r\n "completed": "已完成",\r\n "established": "协助中",\r\n "error": "失败",\r\n "sites_title": "水滴实验营"\r\n ,"footprintscontest":"参赛记录"\r\n ,"contest_course":"我的比赛",\r\n "exptemplate": "实验模板",\r\n "coursedesign": "课程设计",\r\n "pcourseapply": "公开课申请",\r\n "teststore": "试题库",\r\n "labsetting": "实验环境",\r\n "tlabvclass": "虚拟课堂",\r\n "tlabsclass": "校内课堂",\r\n "tfootprintsreport": "教学足迹",\r\n "mystudent": "我的学员",\r\n "loadingdata": "正在加载数据……",\r\n "ladingdataerror": "加载数据失败",\r\n "designcenter_url": "/static/public/img/center/designcenter.png",\r\n "userinfo_url": "/static/public/img/center/userinfo.png",\r\n "teacher": "teacher",\r\n "student": "student",\r\n "admin": "admin",\r\n "college_admin": "college_admin",\r\n "school_admin": "school_admin",\r\n "approved": "审核通过",\r\n "unaudited": "待审核",\r\n "v_course": "虚拟课程",\r\n "approving": "审核中",\r\n "s_course": "校内课程",\r\n "pub_course": "公开课",\r\n "p_course": "私有课程",\r\n "selected": "已选择",\r\n "studentreport": "学生报告",\r\n "studentcomment": "学生评论",\r\n "designer": "designer",\r\n "sharecode": "邀请用户",\r\n "datasets": "数据集",\r\n "broadcast": "广播站",\r\n "filter": "过滤",\r\n "doSearch": "查询",\r\n "Reset": "重置",\r\n "tips": "提示",\r\n "lock": "锁定",\r\n "no_content": "无",\r\n "ALL": "全部",\r\n "operateError": "操作失败:原因:{0}",\r\n "user_name": "用户",\r\n "result": "结果",\r\n "operation": "操作",\r\n "created_at": "时间",\r\n "success": "成功",\r\n "failure": "失败",\r\n "create": "创建",\r\n "delete": "删除",\r\n "pleaseselect": "--请选择--",\r\n "China Unicom": "中国联通",\r\n "ram": "内存",\r\n "disk": "系统盘",\r\n\r\n "manage_url": "/static/public/img/center/manager.png"\r\n },\r\n "en": {\r\n "totals": "Totals",\r\n "pages": "Pages",\r\n "tenantname": "Object",\r\n "operation_log": "System Log",\r\n "update": "Update",\r\n "visible_public": "public",\r\n "visible_private": "private",\r\n "visible_shared": "shared",\r\n "arrears": "Tip: Your account has been delinquent! Please <a ms-attr-href=\\"{{SDC.env.rechargeUrl}}\\">recharge</a>.",\r\n "arrears2": "Tip: Your project resourceing owner has been delinquent! Please contact \\"{0}\\" to recharge.",\r\n "arrears3": "Tip: Your project resourceing owner has been delinquent! Please contact \\"{{SDC.current_project.resourceing_owner.name}}\\" to recharge.",\r\n "quota": "Tip: Your quota is exceeded! Please <a class=\\"exceeded_quota\\" href=\\"javascript:;\\" >apply for quota</a>.",\r\n "confirm_delete_router": "Do you want to delete router {0}? This action can not be restored.",\r\n "confirm_delete_router2": "The action will need the following action first:?",\r\n "label_delete_router": "Also remove the related resource.",\r\n "delete_router": "Delete Router",\r\n "delete_pptpconnection": "Delete VPN",\r\n "delete_openvpnconnection": "Delete OpenVPN",\r\n "delete_tunnel": "Delete Tunnel",\r\n "detach_floatingip": "Detach Floating IP",\r\n "detach_subnet": "Detach Subnet",\r\n "clear_gateway_action_label": "Clear",\r\n "dissociate_public_ip": "Dissociate Floating IP",\r\n "dissociate_public_ip_desc": "Do you want to dissociate the Floating IP?",\r\n "dissociate_public_ip_action_label": "Dissociate",\r\n "floating_ip": "Floating IP",\r\n "instance": "Instance",\r\n "associate_network": "Associate Network",\r\n "router": "Router",\r\n "join_network_exceed_desc": "<strong>NOTE: </strong>An instance can only join 3 networks or subnets.",\r\n "join_networks": "Join Networks",\r\n "join_networks_exceed": "Can not join a new network. An instance can not join more than 3 networks or subnets.",\r\n "ssd": "Performance",\r\n "sata": "Capacity",\r\n "readonly": "Readonly",\r\n "shareable": "Shareable",\r\n "shareable_volume": "Shareable",\r\n "confirm_delete_volume": "The action can not be cancel. Do you want to delete volume {0}?",\r\n "confirm_delete_volume2": "The volume has the following related snapshot:",\r\n "label_delete_volume": "Remove the volume and its related snapshot.",\r\n "delete_volume": "Remove Volume",\r\n "join_network_limit_desc": "<strong>NOTE: </strong>Connecting network or subnet for the Cloud VM is up to a maximum of 3. Adding more than one network may lead to routing problems which will cause poor external networks connetions, please proceed with caution.",\r\n "join_network_limit_alt_desc": "<strong>NOTE: </strong>Connecting network or subnet for the Cloud VM is up to a maximum of 3. Adding more than one network may lead to routing problems which will cause poor external networks connetions, please proceed with caution. ",\r\n "is_enabled": "Confirmed",\r\n "not_enabled": "Not Confirmed",\r\n "is_reject": "Rejected",\r\n "project_admin": "Project Admin",\r\n "project_owner": "Project Owner",\r\n "project_observer": "Project Observer",\r\n "resourceing_owner": "resourceing Owner",\r\n "project_owner_desc": "Administrative privileges of all projects.",\r\n "project_admin_desc": "Administrative privileges of the project.",\r\n "project_observer_desc": "Observer privileges of the project.",\r\n "resourceing_owner_desc": "Charge for the projects.",\r\n "volume_type": "Type",\r\n "volume_readonly_type": "Attribute",\r\n "volume_size": "Capacity",\r\n "volume_share": "Shared",\r\n "volume_readonly": "Read-Only",\r\n "volume_readwrite": "Read-Write",\r\n "tips": "Tips",\r\n "status_active": "Active",\r\n "status_alarm": "Alarm",\r\n "status_attaching": "Attaching",\r\n "status_available": "Available",\r\n "status_building": "Building",\r\n "status_build": "Building",\r\n "status_creating": "Creating",\r\n "status_deleting": "Deleting",\r\n "status_detaching": "Detaching",\r\n "status_deprecated": "Deprecated",\r\n "status_down": "Down",\r\n "status_error": "Error",\r\n "status_inactive": "Inactive",\r\n "status_insufficient_data": "Insufficient Data",\r\n "status_in_use": "In use",\r\n "status_OK": "OK",\r\n "status_powering_on": "Powering on",\r\n "status_shutoff": "Shutoff",\r\n "status_shutdown": "Shutting Down",\r\n "status_shutting_down": "Shutting Down",\r\n "status_updating": "Updating",\r\n "status_submitted": "Submitted",\r\n "status_accepted": "Accepted",\r\n "status_closed": "Closed",\r\n "status_scheduling": "Scheduling",\r\n "status_reboot": "Rebooting",\r\n "status_resize": "Resizing",\r\n "status_restart_required": "Restart Requried",\r\n "status_backup": "Back up",\r\n "status_blocked": "Blocked",\r\n "centos_warning": "Instance \\"test\\" has joined the network. But it is not assigned an IP becuse the image CentOS 5.8 and 5.11 64bit is not supported the auto assign IP. Please assign the IP manually and restart the instance. ",\r\n "no_content": " None",\r\n "filter": "Filter",\r\n "doSearch": "Search",\r\n "Reset": "Reset",\r\n "pleaseselect": "--Please Select--",\r\n "China Unicom": "China Unicom",\r\n "ALL": "All",\r\n "operateError": "Operate Error:Reason:{0}"\r\n }\r\n }\r\n}\r\n'}),define("text!public/js/controllers/base_config_lang.json",[],function(){
|
||
return'{\r\n "config": {\r\n "menus": [{\r\n "icon": "",\r\n "field": "course",\r\n "tip": "",\r\n "href": "javascript:void(0);",\r\n "hide": false,\r\n\r\n "iconurl": "/static/public/img/seat.png",\r\n "spread": true,\r\n "value": "",\r\n "menus": [{\r\n "href": "/slab/footprintsreport",\r\n "icon": "",\r\n "field": "footprintsreport",\r\n "tip": "",\r\n "hide": true,\r\n "roles": ["user", "student", "teacher", "college_admin", "school_admin", "designer"],\r\n "value": "icon-zuji"\r\n\r\n },\r\n {\r\n "href": "/slab/pclass",\r\n "icon": "",\r\n "field": "pclass",\r\n "tip": "",\r\n "hide": false,\r\n "value": "icon-gongkaike",\r\n "roles": ["user", "student", "teacher", "college_admin", "school_admin", "designer"]\r\n },\r\n {\r\n "href": "/slab/iclass",\r\n "icon": "",\r\n "field": "iclass",\r\n "tip": "",\r\n "hide": true,\r\n "value": "icon-ketangpeixun",\r\n "roles": ["student"]\r\n },\r\n {\r\n "href": "/slab/vclass",\r\n "icon": "",\r\n "field": "vclass",\r\n "hide": true,\r\n "tip": "",\r\n "value": "icon-ketang",\r\n "roles": ["user", "student", "teacher", "college_admin", "school_admin", "designer"]\r\n },\r\n {\r\n\r\n "href": "/slab/studyreport",\r\n "icon": "",\r\n "field": "studyreport",\r\n "hide": true,\r\n "tip": "",\r\n "value": "icon-baogao",\r\n "roles": ["user", "student", "teacher", "college_admin", "school_admin", "designer"]\r\n },\r\n {\r\n "href": "/slab/comment",\r\n "icon": "",\r\n "field": "comment",\r\n "hide": true,\r\n "tip": "",\r\n "value": "icon-chat",\r\n "roles": ["user", "student", "teacher", "college_admin", "school_admin", "designer"]\r\n }\r\n\r\n ]\r\n }],\r\n "contestmenus": [{\r\n "href": "/slab/footprintscontest",\r\n "icon": "",\r\n "field": "footprintscontest",\r\n "tip": "",\r\n "value": "icon-zuji",\r\n "hide": true\r\n },\r\n {\r\n "href": "/slab/contest_course",\r\n "icon": "",\r\n "field": "contest_course",\r\n "tip": "",\r\n "value": "icon-gongkaike",\r\n "hide": true\r\n }\r\n ],\r\n "settingmenus": [{\r\n "href": "/slab/personalinfo",\r\n "icon": "",\r\n "field": "personalinfo",\r\n "tip": "",\r\n "value": "",\r\n "hide": true\r\n },\r\n {\r\n "href": "/slab/idauth",\r\n "icon": "",\r\n "field": "idauth",\r\n "tip": "",\r\n "value": "",\r\n "hide": true\r\n }\r\n ],\r\n "tlabmenus": [\r\n {\r\n "href": "/tlab/sharecode",\r\n "tip": "",\r\n "field": "sharecode",\r\n "type": "sharecode",\r\n "icon": "icon-yaoqingma",\r\n "roles": [ "teacher" ],\r\n "hide": true\r\n },\r\n {\r\n "href": "/tlab/tfootprintsreport",\r\n "tip": "",\r\n "field": "tfootprintsreport",\r\n "type": "learncenter",\r\n "icon": "icon-zuji",\r\n "hide": true,\r\n "roles": [ "teacher" ]\r\n },\r\n {\r\n "href": "/tlab/exptemplate/",\r\n\r\n "field": "exptemplate",\r\n "tip": "",\r\n\r\n "icon": "icon-muban",\r\n "type": "designCenter",\r\n "hide": true,\r\n "roles": [ "teacher", "designer" ]\r\n\r\n },\r\n {\r\n "href": "/tlab/labsetting/",\r\n\r\n "field": "labsetting",\r\n "tip": "",\r\n "type": "designCenter",\r\n\r\n "icon": "icon-huanjing",\r\n "hide": true,\r\n "roles": [ "teacher", "designer" ]\r\n\r\n },\r\n {\r\n "href": "/tlab/coursedesign",\r\n\r\n "field": "coursedesign",\r\n "tip": "",\r\n "type": "designCenter",\r\n "hide": true,\r\n\r\n "icon": "icon-design",\r\n "roles": [ "teacher", "designer" ]\r\n },\r\n {\r\n "href": "/tlab/pcourseapply",\r\n "field": "pcourseapply",\r\n "tip": "",\r\n "type": "designCenter",\r\n "hide": true,\r\n "icon": "icon-shenqingshouquan",\r\n "roles": [ "teacher", "designer" ]\r\n },\r\n {\r\n "href": "/tlab/teststore",\r\n "field": "teststore",\r\n "tip": "",\r\n "type": "designCenter",\r\n "hide": true,\r\n "icon": "icon-baogao",\r\n "roles": [ "teacher", "designer" ]\r\n },\r\n {\r\n "href": "/tlab/tlabvclass",\r\n "tip": "",\r\n "field": "tlabvclass",\r\n "hide": true,\r\n "type": "learncenter",\r\n "icon": "icon-ketang",\r\n "roles": [ "teacher" ]\r\n },\r\n {\r\n "href": "/tlab/tlabsclass",\r\n "tip": "",\r\n "field": "tlabsclass",\r\n "type": "learncenter",\r\n "hide": true,\r\n "icon": "icon-ketangpeixun",\r\n "roles": [ "teacher" ]\r\n\r\n },\r\n {\r\n "href": "/tlab/mystudent",\r\n "tip": "",\r\n "field": "mystudent",\r\n "type": "learncenter",\r\n "hide": true,\r\n "icon": "icon-wodexuesheng",\r\n "roles": [ "teacher" ]\r\n\r\n\r\n },\r\n {\r\n "href": "/tlab/studentreport",\r\n "tip": "",\r\n "field": "studentreport",\r\n "type": "learncenter",\r\n "hide": true,\r\n "icon": "icon-baogao",\r\n "roles": [ "teacher" ]\r\n\r\n\r\n },\r\n {\r\n "href": "/tlab/studentcomment",\r\n "tip": "",\r\n "field": "studentcomment",\r\n "type": "learncenter",\r\n "hide": true,\r\n "icon": "icon-chat",\r\n "roles": [ "teacher" ]\r\n\r\n\r\n },\r\n {\r\n "href": "/tlab/broadcast",\r\n "tip": "",\r\n "field": "broadcast",\r\n "type": "learncenter",\r\n "hide": true,\r\n "icon": "icon-broadcast",\r\n "roles": [ "teacher" ]\r\n\r\n\r\n }\r\n ],\r\n "mlabmenus": [\r\n {\r\n "href": "/mlab/schoolmanage/",\r\n "icon": "",\r\n "field": "schoolmanage",\r\n "tip": "",\r\n "enabled": true,\r\n "value":"",\r\n\r\n "roles": [ "college_admin", "school_admin" ]\r\n\r\n },\r\n {\r\n "href": "/mlab/depmanage/",\r\n "icon": "",\r\n "field": "collagemanage",\r\n "tip": "",\r\n "enabled": false,\r\n "value":"",\r\n "roles": [ "college_admin" ]\r\n }\r\n ],\r\n "cloud": [{\r\n "href": "/slab/clouddist",\r\n "icon": "",\r\n "field": "clouddist",\r\n "hide": true,\r\n "tip": "",\r\n "value": "icon-wangpan",\r\n "roles": ["user", "student", "teacher", "college_admin", "school_admin", "designer"]\r\n }]\r\n\r\n}\r\n\r\n}\r\n'}),define("obj-utils",["app-utils"],function(e){return{getItemDisplayLabel:function(e,t){return t||(t="name"),e[t]?e[t]+"("+e.id.substring(0,8)+")":"("+e.id.substring(0,8)+")"},convertSharedNetworkName:function(e,t){return"zh-hans"==t?"基础网络":"Shared Network"},generateLink:function(e,t,i,n,r,a,o){if(!e)return"";o||(o="account"==t?"domain":"RS");var s=null;s=n?e[n]:e.id;var l=i||"name",c=e[l];return c||(c=s?"("+s.substring(0,8)+")":""),/^shared\_subnet(\_*)(\d*)$/.test(c)||e["SDC-EXT-IPS:subnet_shared"]&&"SDC-EXT-IPS:subnet_name"==i?r?'<a class="icon disabledLink" href="javascript:;" target="_blank"><i class="icon-'+t+'"></i>'+this.convertSharedNetworkName(c,a)+"</a>":'<a class="icon disabledLink" href="javascript:;" target="_blank">'+this.convertSharedNetworkName(c,a)+"</a>":r?'<a class="icon" href="/'+o+"/"+t+"/"+s+'" target="_blank"><i class="icon-'+t+'"></i>'+c+"</a>":'<a class="icon'+t+'" href="/'+o+"/"+t+"/"+s+'" target="_blank" >'+c+"</a>"},printImageLink:function(t){function i(t,i){var n=t.id,r=t.name;return/\<i(.+)\>\<\/i\>/i.test(r)||(r=t.image_label?'<i class="image-icon-default '+t.image_label.toLowerCase()+'"></i>'+t.name:'<i class="image-icon-default"></i>'+t.name),"deleted"==t.status?r:'<a class="icon'+i+'" href="'+e.relativePath+"/"+i+"/"+n+'" >'+r+"</a>"}return"deprecated"==t.status?i(t,"deprecated"):"snapshot"==t.image_location?i(t,"image"):void 0!==t.image_label?"application"==t.image_type?i(t,"app-image"):i(t,"image"):/\<i(.+)\>\<\/i\>/i.test(t.name)?t.name||t.id.substring(0,8):'<i class="image-icon-default"></i>'+(t.name||t.id.substring(0,8))}}}),define("basecontroller_v2",["app-utils","avalon","jquery","text!public/js/controllers/base_lang.json","text!public/js/controllers/base_config_lang.json","obj-utils","obj-openstack"],function(e,t,i,n,r,a,o){function s(){}return s.prototype={preInitialize:function(){this.pagelimit=5},initAvalon:function(){},getModelLabel:function(){return""},mergeLanguage:function(e){if("string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e){if(e.field&&!e.title&&"string"==typeof e.field){var t=this.i18n[e.field];e.title=t||""}for(t in e)"field"!=t&&"title"!=t&&this.mergeLanguage(e[t])}},updateLanguageObj:function(e){return e},_filterLang:function(e){var t=function(e,t){return SDC.env.showSdcLink?t:""};for(var i in e)"String"===Object.prototype.toString.call(e[i]).slice(8,-1)&&(e[i]=e[i].replace(/<##([\s\S]*)##>/g,t));return e},initialize:function(e){this.openstackUtils=o,this.lang||(this.lang=JSON.stringify(this.generateEmptyLang())),this.languageObj=JSON.parse(this.lang);var a=JSON.parse(n),s=JSON.parse(r);i.extend(!0,a,this.languageObj),this.languageObj=this.updateLanguageObj(a),i.extend(!0,this.languageObj,s),this.config=JSON.parse(JSON.stringify(this.languageObj.config)),this.i18n=this._filterLang(this.languageObj.language[this.language]),this.mergeLanguage(this.config);try{this.isPopup||(document.title=this.config.header.title+"-"+this.i18n.sites_title)}catch(e){}if(this.isPage)if(this.config.tabs)for(var l in this.config.tabs){var c=this.config.tabs[l];c.selected=!1}else this.config.tabs=[];var u=this.getModelLabel();this.template&&(this.template=this.template.replace(/ms\-controller\=\"(.*)\"/,'ms-controller="'+u+'"')),!0!==this.isPopup&&(this.template||(this.template=template.replace(/\[\[modelName\]\]/g,u)),this.wrapper=i(this.template),this.container.append(this.wrapper),this.isPage),this.initialized=!0,this.limit=10;var d=this,h={$id:d.getModelLabel(),$operations:{},cas_url:SDC.cas_url,SDC:SDC,i18n:d.i18n,selectDate:function(){},roles:SDC.user.roles,events:{goback:function(){history.go(-1)},query:function(e){var t=i(i(".query:visible").find("input")),n=i(i(".query:visible").find("select")),r=[];if(e){for(var a=e.length,o=0;o<a;o++){var s=e[o],l=!1,c=!1;0==t.length&&(l=!0),0==n.length&&(c=!0);for(var u=0;u<t.length;u++){var d=new RegExp(t[u].value,"i");if(t[u].value){var h=s[t[u].name];if(!h){l=!1;break}var p=d.test(h);if(!p){l=!1;break}l=!0}else l=!0}for(var f=0;f<n.length;f++){var d=new RegExp(n[f].value,"i");if("-1"!=n[f].value){var h=s[i(n[f]).attr("field")],p=d.test(h);if(!p){c=!1;break}c=!0}else c=!0}l&c&&(r.push(s),match=!1)}i(".tb_search").bootstrapTable("load",r)}},menuspread:function(e){SDC.menuspread=!SDC.menuspread,e.spread=SDC.menuspread}},setmult:function(e){!e.isbuild&&e.data.length>0&&d.container.find(".multiselect").multiselect("destroy").multiselect({includeSelectAllOption:!0,nonSelectedText:d.i18n.nonSelectedText,allSelectedText:d.i18n.allSelectedText,selectAllText:d.i18n.selectedAllText})},selectedmenu:function(e){e.active=!0}};if(d.config){var p=JSON.parse(JSON.stringify(d.config));if(d.isPopup&&p.fields)for(var f=0;f<p.fields.length;f++){var m=p.fields[f];"select"!=m.type||m.data||(m.data=[]),m.hide||(m.hide=!1)}p.menus&&(p.menus[0].spread=SDC.menuspread,this.setmenuroles(p.menus)),p.tlabmenus&&(p.tlabmenus[0].spread=SDC.menuspread,this.setmenuroles(p.tlabmenus)),p.mlabmenus&&(p.mlabmenus[0].spread=SDC.menuspread,this.setmenuroles(p.mlabmenus)),h=i.extend(h,p)}this.data=t.define(h),d.initAvalon.apply(d,[this.data]),t.scan(this.container.get(0)),this.onInitialize(e)},setmenuroles:function(e){var t=this;e.length>0&&e.forEach(function(e){e.roles&&e.roles.forEach(function(t){SDC.user.roles.forEach(function(i){t==i&&(e.hide=!1)})}),e.menus&&t.setmenuroles(e.menus),e.tlabmenus&&t.setmenuroles(e.tlabmenus),e.mlabmenus&&t.setmenuroles(e.mlabmenus)})},generateData:function(){for(var e={},t=this.container.find("input:visible:not(:disabled), select:visible, textarea:visible"),n=0;n<t.length;n++){var r=t.eq(n);if("button"!=r.attr("type")){var a=r.attr("required"),o=null;if(a="true"==a||"required"==a,r.is("select"))o="-1"==i(r).val()||""==i(r).val()?"":i(r).val();else if(r.is(":checkbox"))o=r.get(0).checked;else if(r.is(":radio")){if(!r.is(":checked"))continue;o=i.trim(r.val())}else o=i.trim(r.val());if(o.length<1&&a)r.addClass("error");else{var s=r.attr("name");if(r.is(":checked")&&r.is(":checkbox")&&r.attr("field")&&(s=r.attr("field")),e[s]=o,r.removeClass("error"),r.siblings(".tips").hasClass("error")){this.getFieldsByName(s).tips.type="info"}}}}return this.container.find(".error").length>0?(this.container.find(".submit").removeClass("disabled"),null):(this.container.find(".submit").addClass("disabled"),e)},getFieldsByName:function(e,t){var i=null;i=void 0!==t?t.fields:this.data.fields;for(var n=0;n<i.length;n++){var r=i[n];if(r.field==e)return r}return null},refreshData:function(){},onShow:function(){},show:function(e){this.data&&this.data.menus&&(this.data.menus[0].spread=SDC.menuspread),this.container&&(this.initialized?this.refreshData(e):(this.container.empty(),this.initialize(e)),this.onShow())},confirm:function(t,i,n,r){i=this.i18n[i],r&&r.forEach(function(e,t){i=i.replace("{"+t+"}",e)}),e.showConfirm(this.i18n[t],i,"zh-hans"==this.language?"是":"Yes","zh-hans"==this.language?"否":"No",n).addClass("info")},alert:function(t,i,n,r,a){i=this.i18n[i],r&&r.forEach(function(e,t){i=i.replace("{"+t+"}",e)});var o;a&&(o="zh-hans"==this.language?"取消":"NO");var s=e.showAlert(this.i18n[t],i,"zh-hans"==this.language?"确定":"OK",n,o);return s.addClass("info"),s},generateEmptyLang:function(){return{config:{},language:{"zh-hans":{},en:{}}}},generateRoleLabel:function(e){return this.i18n[e]+'<a href="javascript:;" class="tipsLink"><label>?</label><span class="tipsHover">'+this.i18n[e+"_desc"]+"</span></a>"},getStatusType:function(t){var i="status_"+t.replace(/[- ]/g,"_").toLowerCase();return i=this.i18n[i],i=i||e.toCapitalCase(t)},getBoolean:function(e){return this.i18n[e]},getVisibility:function(t){var i="visible_"+t.replace(/[- ]/g,"_").toLowerCase();return i=this.i18n[i],i=i||e.toCapitalCase(i)},setPage:function(e,t,n){var r=this;n(t.slice(0,this.pagelimit));var a=Math.ceil(t.length/this.pagelimit);if(a){var o={currentPage:1,bootstrapMajorVersion:3,totalPages:a,itemTexts:function(e,t,i){switch(e){case"first":return"首页";case"prev":return"上一页";case"next":return"下一页";case"last":return"末页";case"page":return t}},tooltipTitles:function(e,t,i){switch(e){case"first":return"转到第一页";case"prev":return"转到上一页";case"next":return"转到下一页";case"last":return"转到最后一页";case"page":return t===i?"当前页是第 "+t:"转到第 "+t+"页"}},onPageClicked:function(e,i,a,o){o-=1,n(t.slice(o*r.pagelimit,(o+1)*r.pagelimit))}};i("#"+e).bootstrapPaginator(o)}else i("#"+e).bootstrapPaginator("destroy")},destorymultselect:function(){var e=this;i(".multiselect").multiselect("destroy").multiselect({includeSelectAllOption:!0,nonSelectedText:e.i18n.nonSelectedText,allSelectedText:e.i18n.allSelectedText,selectAllText:e.i18n.selectedAllText})},paging:function(e,t,i,n){n||(n=6),layui.use("laypage",function(){layui.laypage.render({elem:t,count:e.length,limit:n,groups:2,jump:function(t){tempdata=e.concat().splice(t.curr*t.limit-t.limit,t.limit),i(tempdata)}})})},transformpeople:function(e,t,i){var n=e.toString().length;return n<=4?e:4<n?Math.floor(e/1e3)+"k":void 0},pushError:function(e){return},has_perm:function(e){return!0}},s}),define("popcontrollerbase_v2",["app-utils","avalon","basecontroller_v2","jquery"],function(e,t,i,n){function r(e,t,i){}var a={initAvalon:function(e){e.info||(e.info=""),e.infoType||(e.infoType="info");var t=this;e.onSlideChange=function(e,i){var r=e,a=n.trim(n(i.target).val()),o=parseInt(n.trim(n(i.target).val()),10);isNaN(o)&&(o=0),a!=o&&n(i.target).val(o),o!=t.value&&t.onSlideChange(r,o||0)},e.onChecked=function(e){},e.onSelected=function(){},e.toggleCidrView=function(e){e.is_collapse=!e.is_collapse};var i=null;if(e.fields)for(var r in e.fields)i=e.fields[r],"custom"==i.type&&!0===i.loading?i.ltext=this.i18n.loading:"checkbox"!=i.type||i.selected||(i.selected=!1);if(e.buttons)for(var a=0;a<e.buttons.length;a++)i=e.buttons[a],!0!==i.disabled&&(i.disabled=!1)},formatInitSlideValue:function(e){return"string"==typeof e?(e=e.replace("+",""),e=parseInt(e,10)):e},getId:function(){return this.getModelLabel()||""},onClose:function(){this.container.remove()},onSlideChange:function(e,t){},show:function(t,i){this.container||(this.template=this.template.replace(/ms\-controller\=\"(.*)\"/,'ms-controller="'+this.getModelLabel()+'"'),this.container=n(this.template)),this.isPopup=!0;var r=this;this.initialized||(e.showPop(this.getId(),this.container,!i,function(){r.onClose()},t),this.initialize()),this.onShow(),this.isCreate&&this.container.addClass("isCreate")},initialize:function(){i.prototype.initialize.apply(this,[]);var e=this;this.container.delegate('button[name="cancel"]',"click",function(){e.container.find(".closeModal").trigger("click")})},getDefaultTab:function(){return""},pushView:function(){return this.container||(this.container=n(this.template)),this.initialized||(this.isPopup=!0,this.initialize()),this.onShow(),this.container},fetchPrice:function(e){for(var t in SDC.resourcePrice){var i=SDC.resourcePrice[t];if(i.name==e)return parseFloat(i.unit_price)}return 0},updatePrice:function(e){if(this.data.fields)for(var t in this.data.fields){var i=this.data.fields[t];if("charge"==i.type)return void("zh-hans"==this.language?(i.value=e.toFixed(4)+"元",i.monthValue=Math.round(30*e*24)+"元"):(i.value="CNY "+e.toFixed(4),i.monthValue="CNY "+Math.round(30*e*24)))}},overQuota:function(){var e=this.i18n.quota,t=this.getFieldsByName("errorTip");t.hide=!1,t.label=e,this.container.find(".submit").addClass("disabled")},hideOverQuota:function(){this.getFieldsByName("errorTip").hide=!0},checkPayment:function(e){function t(e){var t=null;if(413==e.code)return"OverQuota";if(e.type)t=e.type;else{var i=/^(\w+)(\:|\,)/.exec(e.message.replace(/\ /g,""));i&&i.length>1&&(t=i[1])}return"VolumeLimitExceeded"==t||"SnapshotLimitExceeded"==t||"OverQuota"==t||"Quotaexceeded"==t?t:null}if(!e||402==e.status){var i=null;if(SDC.user.is_resourceing_owner)i=this.i18n.arrears;else try{i=this.i18n.arrears2,i=i.replace("{0}",SDC.current_project.resourceing_owner.name)}catch(e){i=i.replace('"{0}"',"")}var n=this.getFieldsByName("errorTip");return n.hide=!1,n.label=i,e?e.responseText:"Payment Required"}if(e&&e.responseJSON){var r=e.responseJSON.overLimit||e.responseJSON.error,a=null;if(r?a=t(r):(r=e.responseJSON.NeutronError)&&(a=t(r)),a)return this.overQuota(),a}return null},disableButton:function(e,t){var i=this;i.setButtonStatus(!0,!0),t.fail(function(){i.setButtonStatus(!1,!1)})},setButtonStatus:function(e,t){if(!this.locked||void 0!==t){for(var i=this.data.buttons,n=0;n<i.length;n++){i[n].disabled=e}this.locked=t}},displayLabel:function(e,t,i){i||(i="name");var n=this.getFieldsByName(i),r=e[t];n.text="string"==typeof r?r:r.name},showHideFieldsByName:function(e,t){var i=this.getFieldsByName(e);i&&(i.hide=!t)},refreshFieldTips:function(e,t,i){i||(i="info");var n=this.getFieldsByName(e);n.tips.label=this.i18n[t],n.tips.type=i},pushError:function(e){var t=e.responseText,i=JSON.parse(t),n=i.NeutronError;if(n){var r=null;if(r="string"==typeof n?n:n.message)throw this.data.info=r,this.data.infoType="error",r}else if(i.message)throw this.data.info=i.message,this.data.infoType="error",i.message}};return n.extend(r.prototype,i.prototype),n.extend(r.prototype,a),r}),define("text!modules/utils/assist/pop/detail/index.html",[],function(){return'<div ms-controller="">\r\n \r\n\r\n\r\n\r\n <div class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <table class="layui-hide" id="tb_assist_list" lay-filter="tb_assist_list" lay-data="{id: \'tb_assist_list\'}"></table>\r\n \r\n<div id="optools" type="text/html" class="hide">\r\n\r\n \r\n <a class="layui-btn layui-btn-xs" lay-event="accepted" ms-html="i18n.accepted"></a>\r\n <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="rejected" ms-html="i18n.rejected"></a>\r\n <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="cancel" ms-html="i18n.cancel"></a>\r\n\r\n</div>\r\n \r\n \r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n'}),define("text!modules/utils/assist/pop/detail/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n\r\n "fields": [\r\n\r\n {\r\n "field": "owner_real_name",\r\n "align": "center",\r\n\r\n "minWidth": 150\r\n },\r\n {\r\n "field": "op_user_real_name",\r\n "align": "center",\r\n\r\n "minWidth": 150\r\n },\r\n {\r\n "field": "op_type_title",\r\n "align": "center",\r\n\r\n "width": 120\r\n },\r\n { "field": "course_name" },\r\n { "field": "step_name" },\r\n\r\n {\r\n "field": "status_title",\r\n "align": "center",\r\n\r\n "minWidth": 160\r\n },\r\n {\r\n "field": "operation",\r\n\r\n "align": "center",\r\n "minWidth": 160\r\n }\r\n\r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "协助详情",\r\n "op_type_title": "协助模式",\r\n\r\n "read": "观看",\r\n "write": "控制",\r\n "send": "发送",\r\n "op_user_real_name": "接受协助者",\r\n "owner_real_name": "发起协助者",\r\n "status_title": "状态",\r\n "operation": "操作",\r\n "accepted": "接受",\r\n "rejected": "拒绝",\r\n "cancel": "取消",\r\n "mobile_regexp": "请输入正确的手机号码",\r\n "assist_msg_length": "协助信息在255字符以内。",\r\n "inited": "初始化",\r\n\r\n "timeout": "超时",\r\n "cancelled": "取消",\r\n "completed": "已完成",\r\n "established": "协助中",\r\n "error": "失败",\r\n "course_name": "课程",\r\n "step_name": "实验",\r\n "assist": "协助"\r\n },\r\n "en": {\r\n "index": "首页",\r\n "designCenter": "设计中心"\r\n }\r\n }\r\n}'}),define("modules/utils/assist/pop/detail/controller",["popcontrollerbase_v2","jquery","text!modules/utils/assist/pop/detail/index.html","text!modules/utils/assist/pop/detail/lang.json"],function(e,t,i,n){function r(e,t,r){this.language=SDC.t.LANG,this.lang=n,this.list=t,this.template=i,this.onCreated=r,this.service=e}var a={initAvalon:function(e){},onInitialize:function(e){var t=this;t.data;t.list_formt(),t.getFieldsByName("operation").templet=function(e){switch(e.status){case"established":case"eccepted":return e.owner==SDC.user.user_id?' <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="cancel" >'+t.i18n.cancel+"</a>":'<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="established" >'+t.i18n.assist+'</a> <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="complete" >'+t.i18n.cancel+"</a>";case"inited":return e.owner==SDC.user.user_id?' <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="cancel" >'+t.i18n.cancel+"</a>":'<a class="layui-btn layui-btn-xs" lay-event="accepted" >'+t.i18n.accepted+'</a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="rejected" >'+t.i18n.rejected+"</a>"}},layui.use("table",function(){var e=layui.table;e.render({elem:"#tb_assist_list",cols:[t.data.fields],data:t.list,even:!0,page:!0}),e.on("tool(tb_assist_list)",function(i){var n=i.data;"accepted"===i.event||"established"===i.event?(localStorage.setItem(n.owner+"_"+n.step_id,JSON.stringify(n)),t.list[0].status=n.status="established",t.onCreated&&t.onCreated(),t.list_formt(),e.reload("tb_assist_list",{data:t.list}),window.open("/console/assist/"+n.owner+"_"+n.step_id)):"rejected"===i.event?t.service.reject_assist({token:n.process_token}).done(function(){i.del(),t.onCreated&&t.onCreated()}):"cancel"===i.event?t.service.cancel_assist({token:n.process_token}).done(function(){i.del(),t.onCreated&&t.onCreated()}):"complete"===i.event&&t.service.complete_assist({token:n.process_token}).done(function(){i.del(),t.onCreated&&t.onCreated()})})}),t.container.delegate('button[name="send"]:not(.disabled)',"click",function(){t.container.find("#data_form").bootstrapValidator("validate");var e=t.container.find("#data_form").data("bootstrapValidator").isValid(),i=t.generateData();e&&i&&(t.container.find('button[name="send"]').addClass("disabled"),t.service.get_assist_user({step_id:t.step_id,mobile:i.op_user}).done(function(e){i.op_user=e.user_id,i.step_id=t.step_id,t.service.send_assist(i).done(function(e){t.onCreated&&(t.onCreated(i),t.container.find(".closeModal").trigger("click"))}).fail(function(e){t.container.find('button[name="send"]').removeClass("disabled")})}))})},list_formt:function(){var e=this;e.list.forEach(function(t){t.op_type_title=e.i18n[t.op_type]||t.op_type,t.status_title=e.i18n[t.status]||t.status})},getModelLabel:function(){return"pop_heplvm_view"}};return t.extend(r.prototype,e.prototype),t.extend(r.prototype,a),r}),define("modules/utils/assist/controller",["app-utils","jquery","modules/utils/assist/pop/detail/controller","modules/utils/baseservice","text!modules/slab/message/lang.json"],function(e,t,i,n,r){var a=new n;return{i18n:JSON.parse(r).language[SDC.t.LANG],callback:function(t,i,n){var r=this;switch(t){case"request":var o={resource_type:"assist",user_id:n.message.user,op_mode:"assist",step_id:n.message.step_id,step_name:n.message.step_name,course_id:n.message.course_id,course_name:n.message.course_name,op_user:n.message.op_user,op_type:n.message.op_type,op_mode:n.message.op_mode,assist_desc:n.message.assist_desc,process_token:n.message.process_token,owner_real_name:n.message.owner_real_name,action:"response"};layer.open({type:1,title:!1,closeBtn:!1,area:"300px;",shade:0,id:n.message.process_token,btn:["火速支援","残忍拒绝"],btnAlign:"c",offset:"rb",moveType:1,content:'<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">您的同窗'+n.message.owner_real_name+"在学习"+n.message.course_name+"-"+n.message.step_name+'时遇到困难请求您协助一下<br><span style="color:red;">'+n.message.assist_desc+"。<br>协助方式:"+r.message.i18n[n.message.op_type]+"</span><br>这个困难好像也只有您能解决</div>",yes:function(e){if(layer.close(e),SDC.msgsocket)try{localStorage.setItem(n.message.user+"_"+i,JSON.stringify(o)),window.open("/console/assist/"+n.message.user+"_"+i)}catch(e){}},btn2:function(e){layer.close(e);try{a.reject_assist({token:o.process_token})}catch(e){}}});break;case"cancel":e.msg_warning("对方取消了协助"),layer.close(n.message.process_token);break;case"link":case"rejected":layer.close(n.message.process_token)}},loadassist_list:function(){var e=this;a.get_assist_list().done(function(n){layui.use(["util"],function(){layui.util.fixbar({bar1:!!n.assist_list.length&&'<span class="layui-badge" id="assist_fixbar_bar1" >'+n.assist_list.length+"</span>",title1:"实验协助",css:{right:0,bottom:0},bgcolor:"#393D49",click:function(t){"bar1"===t&&new i(a,n.assist_list,function(){e.loadassist_list()}).show()}}),n.assist_list.length&&t("#assist_fixbar_bar1").html(n.assist_list.length)})})}}}),define("modules/utils/data_controller",["modules/slab/message/controller","modules/utils/baseservice","modules/utils/assist/controller"],function(e,t,i){function n(n,r){this.service=new t,this.dict=null,this.full={},this.controller=[],this.deferred=$.Deferred(),this.lisenters={},this.lisenters.assist=[{callback:i.callback,target:this}],this.requestMatrix={},this.message=new e(n,r,this),window.dataControl=this}return n.prototype={getRemoteData:function(e,t){var i=$.Deferred(),n=this,r=[];return e.forEach(function(e){if(!n.checkFullData(e))switch(e){case"mark_list":r.push(n.service.getScores(t));break;case"comment_list":r.push(n.service.getComments(t));break;case"course_list":r.push(n.service.getGroup_courses(t));break;case"collect_list":r.push(n.service.getCollects(t))}}),r.length>0?$.when.apply($,r).done(function(){var t=0,r=null;if(arguments)for(t=0;t<arguments.length;t++){var a=arguments[t];!function(e){for(r in e)if(e[r]&&e[r].constructor==Array){for(var t={},i=0;i<e[r].length;i++){var a=e[r][i];a.id?t[a.id]=a:t[i]=a}n.full[r]=t}}(a)}i.resolve(n.readData(e))}):i.resolve(n.readData(e)),i.xhr=r,i},addController:function(e){this.controller.push(e)},cacheRequest:function(e,t,i){this.requestMatrix||(this.requestMatrix={}),this.requestMatrix[i]||(this.requestMatrix[i]={});var n=t.resource_uuid||t.data.resource_uuid;if(this.requestMatrix[i][n])this.requestMatrix[i][n].xhr=e,this.requestMatrix[i][n].msgs.push(t);else{var r={xhr:e,msgs:[t]};this.requestMatrix[i][n]=r}},releaseRequest:function(e,t,i,n){if(this.requestMatrix&&this.requestMatrix[e]&&this.requestMatrix[e][t]){var r=this.requestMatrix[e][t],a=r.msgs,o=i;for(o||(o=n);a.length>0;){var s=a.shift();this.onObjectUpdate(e,s,i,n)}}},onMessage:function(e){var t=this;if(this.filterMessage(e)){var i=e.resource_type||e.data.resource_type,n=e.resource_uuid||e.data.resource_uuid;switch(i){case"step":case"user":case"assist":case"template":case"monitor":case"preview":this.cacheRequest(null,e,i),t.releaseRequest(i,n,e)}}},filterMessage:function(e){switch(e.resource_type||e.data.resource_type){case"step":case"user":case"assist":case"template":case"monitor":case"preview":return!0}return!1},onObjectUpdate:function(e,t,i,n){this.dispatchChanges(e,t.action,t.resource_uuid||t.data.resource_uuid,t)},addLisenter:function(e,t,i){this.lisenters||(this.lisenters={}),this.lisenters[e]?this.lisenters[e].push({callback:i,target:t}):this.lisenters[e]=[{callback:i,target:t}]},removeLisenter:function(e,t){if(!this.lisenters)return void(this.lisenters={});if(!this.lisenters[e])return void(this.lisenters[e]=[]);for(var i=[],n=0,r=0;r<this.lisenters[e].length;r++){var a=this.lisenters[e][r];a.target!=t&&(i[n++]=a)}this.lisenters[e]=i},dispatchChanges:function(e,t,i,n){if(this.lisenters&&this.lisenters[e])for(var r in this.lisenters[e]){var a=this.lisenters[e][r];if(a.callback&&a.target){var o=[],s=arguments.length;s>5&&(s=5);for(var l=1;l<s;l++)o[l-1]=arguments[l];o.push(e),a.callback.apply(a.target,o)}}this.dispatchChange()},directDispatch:function(e){var t=e.resource_type;if(this.lisenters&&this.lisenters[t])for(var i in this.lisenters[t]){var n=this.lisenters[t][i];n.callback&&n.target.initialized&&n.callback.apply(n.target,[e])}},dispatchChange:function(){for(var e=0;e<this.controller.length;e++)this.controller[e].refreshData(!0,!1)},generateFullDict:function(){return JSON.parse(JSON.stringify(this.dict))},generateFullData:function(){var e={},t=this.generateFullDict();e.servers=[];for(var i in t.servers){var n=[],r=[],a=t.servers[i];for(i in a.ports){var o=a.ports[i],s=t.ports[o];if(r.push(s),s.fixed_ips&&1==s.fixed_ips.length){var l=s.fixed_ips[0];if(l.subnet_id){var c=t.subnets[l.subnet_id];c&&(s.subnet=c,n.push(c))}}}a.ports=r,a.subnets=n;var u;if(!a.image.created_at&&a.image&&a.image.id&&(u=a.image.id,t.images[u])){var d=t.images[u];a.image=d}
|
||
for(var h in a.addresses){var p=[],f=a.addresses[h];for(var m in f){var g=f[m];p.push(g)}a.addresses[h]=p}e.servers.push(a)}e.routers=[];for(i in t.routers){n=[],a=t.routers[i],r=[];for(i in a.ports)o=a.ports[i],s=t.ports[o],r.push(s),s.fixed_ips&&1==s.fixed_ips.length&&(l=s.fixed_ips[0],l.subnet_id&&(c=t.subnets[l.subnet_id])&&(s.subnet=c,n.push(c)));a.floatingips&&(a.floatingips=t.floatingips[a.floatingips]),a.ports=r,a.subnets=n,e.routers.push(a)}e.loadbalancers=[];for(i in t.loadbalancers){a=t.loadbalancers[i];var v=[],y=[];n=[],r=[];for(i in t.floatingips){var _=t.floatingips[i];_.port_id==a.vip_port_id&&v.push(_)}if(a.vip_subnet_id)c=t.subnets[a.vip_subnet_id],n.push(c),(s=t.ports[a.vip_port_id])&&(s.subnet=c,r.push(s));else for(i in t.subnets)c=t.subnets[i],c.ports&&c.ports.forEach(function(e){e==a.vip_port_id&&(s=t.ports[a.vip_port_id])&&(s.subnet=c,r.push(s))});for(i in a.listeners){var b=a.listeners[i].id;if(t.listeners[b]){var w=t.listeners[b];w.default_pool_id&&t.pools[w.default_pool_id]&&(w.pool=t.pools[w.default_pool_id]),y.push(w)}}a.floatingips=v,a.listeners=y,a.subnets=n,a.ports=r,e.loadbalancers.push(a)}e.networks=[],e.subnets=[];for(i in t.networks){n=[],a=t.networks[i];for(var x in a.subnets)c=a.subnets[x],(c=t.subnets[c])&&(n.push(c),e.subnets.push(c));a.subnets=n,e.networks.push(a)}return e.ports=t.ports,e},getData:function(e,t){var i=this.dict[e];return t?JSON.parse(JSON.stringify(i[t])):JSON.parse(JSON.stringify(i))},checkFullData:function(e){return this.full||(this.full={}),this.full[e]},readData:function(e){if(!this.full)return{};for(var t={},i=0;i<e.length;i++){var n=e[i];if(this.full[n]){for(var r=Object.keys(this.full[n]),a=[],o=0,s=0;s<r.length;s++){var l=this.full[n][r[s]];!l||l.status&&"deleted"==l.status||(a[o++]=l)}a.sort(function(e,t){switch(n){case"servers":return-Date.parse(e.created)+Date.parse(t.created);case"volume":return-Date.parse(e.createdAt)+Date.parse(t.createdAt);case"flavors":case"keypairs":return 0;default:return t.id-e.id}}),t[n]=JSON.parse(JSON.stringify(a))}}return t},readSingleData:function(e,t){if(!this.full||!this.full[e])return null;var i=this.full[e][t];return i?JSON.parse(JSON.stringify(i)):null},getSingleData:function(e,t,i,n,r){function a(t){var i={};return i[e.substring(0,e.length-1)]=t,i}var o=$.Deferred(),s=this;if(n=n||!this.checkFullData(e)){var l=null;switch(e){case"servers":l=this.service.getServer(t,i);break;case"volumes":l=this.service.getVolume(t,i);break;case"snapshots":l=this.service.getSnapshot(t,i);break;case"routers":l=this.service.getRouter(t,i);break;case"networks":l=this.service.getNetwork(t,i);break;case"ports":l=this.service.getPort(t,i);break;case"floatingips":l=this.service.getFloating_Ip(t,i);break;case"images":l=this.service.getImage(t,i);break;case"alarms":l=this.service.getAlarm(t,i);break;case"combo-alarms":l=this.service.getComboAlarm(t,i);break;case"notifications":l=this.service.getNotification(t,i);break;case"listeners":l=s.service.getListener(t,i);break;case"users":l=this.service.getUser(t,i);break;case"pools":l=this.service.getPool(t,i);break;case"loadbalancers":l=this.service.getLoadBalancer(t,i);break;case"healthmonitors":l=this.service.getHealth_Monitor(t,i);break;case"members":l=this.service.getMember(t,i);break;case"l7policys":l=this.service.getL7policy(t,i);break;case"ikepolicys":l=this.service.getIKEPolicy(t,i);break;case"ipsecpolicys":l=this.service.getIPsecPolicy(t,i);break;case"ipsec_site_connections":l=this.service.getIPsecSiteConnection(t,i);break;case"vpnservices":l=this.service.getVpnService(t,i);break;case"database_instances":l=this.service.getDBInstance(t,i);break;case"subnets":l=this.service.getSubnet(t,i);break;case"security_groups":l=this.service.getSecurity_Group(t,i);break;case"security_group_rules":l=this.service.getSecurity_GroupRule(t,i);break;default:l=this.service.getObject(e,t,i)}l?(l.done(function(i){var n=Object.keys(i);if(n&&1==n.length){var l=n[0],c=i[l];s.full[e]||(s.full[e]={});var u=s.full[e][t];return("server"!=l||"DELETED"!=c.status&&"deleting"!=c["OS-EXT-STS:task_state"]||u)&&(s.full[e][t]=c),void(u&&!r?o.resolve(a(c),a(u)):o.resolve(a(c)))}o.reject("Not Found")}),l.fail(function(){if(s.full[e]&&s.full[e][t]){var i=s.full[e][t];delete s.full[e][t],o.reject("Not Found",i)}else o.reject("Not Found")})):o.reject("Not Found")}else{var c=this.readSingleData(e,t);c?o.resolve(a(c)):o.reject("Not Found")}return o}},n}),define("modules/console/basecontroller",["avalon","jquery","text!public/js/controllers/base_lang.json"],function(e,t,i){function n(){}return n.prototype={preInitialize:function(){},initAvalon:function(){},getModelLabel:function(){return""},mergeLanguage:function(e){if("string"!=typeof e&&"number"!=typeof e&&"boolean"!=typeof e){if(e.field&&!e.title&&"string"==typeof e.field){var t=this.i18n[e.field];e.title=t||""}for(t in e)"field"!=t&&"title"!=t&&this.mergeLanguage(e[t])}},updateLanguageObj:function(e){return e},_filterLang:function(e){var t=function(e,t){return SDC.env.showSdcLink?t:""};for(var i in e)"String"===Object.prototype.toString.call(e[i]).slice(8,-1)&&(e[i]=e[i].replace(/<##([\s\S]*)##>/g,t));return e},initialize:function(n){this.lang||(this.lang=JSON.stringify(this.generateEmptyLang())),this.languageObj=JSON.parse(this.lang);var r=JSON.parse(i);t.extend(!0,this.languageObj,r),this.config=JSON.parse(JSON.stringify(this.languageObj.config)),this.i18n=this._filterLang(this.languageObj.language[this.language]),this.mergeLanguage(this.config),this.initialized=!0,this.limit=7;var a=this,o={$id:a.getModelLabel(),events:{},i18n:a.i18n,language:a.language,appOptions:a.appOptions};if(a.config){var s=JSON.parse(JSON.stringify(a.config));if(a.isPopup&&s.fields)for(var l=0;l<s.fields.length;l++){var c=s.fields[l];"select"!=c.type||c.data||(c.data=[]),c.hide||(c.hide=!1)}o=t.extend(o,s)}this.data=e.define(o),a.initAvalon.apply(a,[this.data]),e.scan(this.container.get(0)),this.onInitialize(n)},onShow:function(){},show:function(e){this.container&&(this.initialized||this.initialize(e),this.onShow())},getFieldsByName:function(e,t){var i=null;i=void 0!==t?t.fields:this.data.fields;for(var n=0;n<i.length;n++){var r=i[n];if(r.field==e)return r}return null},getDefaultTab:function(){return"description"},generateEmptyLang:function(){return{config:{},language:{"zh-hans":{},en:{}}}}},n});var Guacamole=Guacamole||{};Guacamole.ArrayBufferReader=function(e){var t=this;e.onblob=function(e){for(var i=window.atob(e),n=new ArrayBuffer(i.length),r=new Uint8Array(n),a=0;a<i.length;a++)r[a]=i.charCodeAt(a);t.ondata&&t.ondata(n)},e.onend=function(){t.onend&&t.onend()},this.ondata=null,this.onend=null};var Guacamole=Guacamole||{};Guacamole.ArrayBufferWriter=function(e){function t(t){for(var i="",n=0;n<t.byteLength;n++)i+=String.fromCharCode(t[n]);e.sendBlob(window.btoa(i))}var i=this;e.onack=function(e){i.onack&&i.onack(e)},this.blobLength=Guacamole.ArrayBufferWriter.DEFAULT_BLOB_LENGTH,this.sendData=function(e){var n=new Uint8Array(e);if(n.length<=i.blobLength)t(n);else for(var r=0;r<n.length;r+=i.blobLength)t(n.subarray(r,r+i.blobLength))},this.sendEnd=function(){e.sendEnd()},this.onack=null},Guacamole.ArrayBufferWriter.DEFAULT_BLOB_LENGTH=6048;var Guacamole=Guacamole||{};Guacamole.AudioContextFactory={singleton:null,getAudioContext:function(){var e=window.AudioContext||window.webkitAudioContext;if(e)try{return Guacamole.AudioContextFactory.singleton||(Guacamole.AudioContextFactory.singleton=new e),Guacamole.AudioContextFactory.singleton}catch(e){}return null}};var Guacamole=Guacamole||{};Guacamole.AudioPlayer=function(){this.sync=function(){}},Guacamole.AudioPlayer.isSupportedType=function(e){return Guacamole.RawAudioPlayer.isSupportedType(e)},Guacamole.AudioPlayer.getSupportedTypes=function(){return Guacamole.RawAudioPlayer.getSupportedTypes()},Guacamole.AudioPlayer.getInstance=function(e,t){return Guacamole.RawAudioPlayer.isSupportedType(t)?new Guacamole.RawAudioPlayer(e,t):null},Guacamole.RawAudioPlayer=function(e,t){var i=Guacamole.RawAudioFormat.parse(t),n=Guacamole.AudioContextFactory.getAudioContext(),r=n.currentTime,a=new Guacamole.ArrayBufferReader(e),o=1===i.bytesPerSample?window.Int8Array:window.Int16Array,s=1===i.bytesPerSample?128:32768,l=[],c=function(e){if(e.length<=1)return e[0];var t=0;e.forEach(function(e){t+=e.length});var i=0,n=new o(t);return e.forEach(function(e){n.set(e,i),i+=e.length}),n},u=function(e){for(var t=Number.MAX_VALUE,n=e.length,r=Math.floor(e.length/i.channels),a=Math.floor(.02*i.rate),s=Math.max(i.channels*a,i.channels*(r-a)),l=s;l<e.length;l+=i.channels){for(var c=0,u=0;u<i.channels;u++)c+=Math.abs(e[l+u]);c<=t&&(n=l+i.channels,t=c)}return n===e.length?[e]:[new o(e.buffer.slice(0,n*i.bytesPerSample)),new o(e.buffer.slice(n*i.bytesPerSample))]},d=function(e){l.push(new o(e))},h=function(){var e=c(l);return e?(l=u(e),e=l.shift()):null},p=function(e){var t=e.length/i.channels,a=n.currentTime;r<a&&(r=a);for(var o=n.createBuffer(i.channels,t,i.rate),l=0;l<i.channels;l++)for(var c=o.getChannelData(l),u=l,d=0;d<t;d++)c[d]=e[u]/s,u+=i.channels;return o};a.ondata=function(e){d(new o(e));var t=h();if(t){var a=n.currentTime;r<a&&(r=a);var s=n.createBufferSource();s.connect(n.destination),s.start||(s.start=s.noteOn),s.buffer=p(t),s.start(r),r+=t.length/i.channels/i.rate}},this.sync=function(){var e=n.currentTime;r=Math.min(r,e+.3)}},Guacamole.RawAudioPlayer.prototype=new Guacamole.AudioPlayer,Guacamole.RawAudioPlayer.isSupportedType=function(e){return!!Guacamole.AudioContextFactory.getAudioContext()&&null!==Guacamole.RawAudioFormat.parse(e)},Guacamole.RawAudioPlayer.getSupportedTypes=function(){return Guacamole.AudioContextFactory.getAudioContext()?["audio/L8","audio/L16"]:[]};var Guacamole=Guacamole||{};Guacamole.AudioRecorder=function(){this.onclose=null,this.onerror=null},Guacamole.AudioRecorder.isSupportedType=function(e){return Guacamole.RawAudioRecorder.isSupportedType(e)},Guacamole.AudioRecorder.getSupportedTypes=function(){return Guacamole.RawAudioRecorder.getSupportedTypes()},Guacamole.AudioRecorder.getInstance=function(e,t){return Guacamole.RawAudioRecorder.isSupportedType(t)?new Guacamole.RawAudioRecorder(e,t):null},Guacamole.RawAudioRecorder=function(e,t){var i=this,n=Guacamole.RawAudioFormat.parse(t),r=Guacamole.AudioContextFactory.getAudioContext();navigator.mediaDevices||(navigator.mediaDevices={}),navigator.mediaDevices.getUserMedia||(navigator.mediaDevices.getUserMedia=(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia).bind(navigator));var a=new Guacamole.ArrayBufferWriter(e),o=1===n.bytesPerSample?window.Int8Array:window.Int16Array,s=1===n.bytesPerSample?128:32768,l=0,c=0,u=null,d=null,h=null,p=function(e){if(0===e)return 1;var t=Math.PI*e;return Math.sin(t)/t},f=function(e,t){return-t<e&&e<t?p(e)*p(e/t):0},m=function(e,t){for(var i=(e.length-1)*t,n=Math.floor(i)-3+1,r=Math.floor(i)+3,a=0,o=n;o<=r;o++)a+=(e[o]||0)*f(i-o,3);return a},g=function(e){var t=e.length;l+=t;var i=Math.round(l*n.rate/e.sampleRate),r=i-c;c+=r;for(var a=new o(r*n.channels),u=0;u<n.channels;u++)for(var d=e.getChannelData(u),h=u,p=0;p<r;p++)a[h]=m(d,p/(r-1))*s,h+=n.channels;return a},v=function(e){h=r.createScriptProcessor(2048,n.channels,n.channels),h.connect(r.destination),h.onaudioprocess=function(e){a.sendData(g(e.inputBuffer).buffer)},d=r.createMediaStreamSource(e),d.connect(h),"suspended"===r.state&&r.resume(),u=e},y=function(){a.sendEnd(),i.onerror&&i.onerror()},_=function(){var e=navigator.mediaDevices.getUserMedia({audio:!0},v,y);e&&e.then&&e.then(v,y)},b=function(){if(d&&d.disconnect(),h&&h.disconnect(),u)for(var e=u.getTracks(),t=0;t<e.length;t++)e[t].stop();h=null,d=null,u=null,a.sendEnd()};a.onack=function(e){e.code!==Guacamole.Status.Code.SUCCESS||u?(b(),a.onack=null,e.code===Guacamole.Status.Code.RESOURCE_CLOSED?i.onclose&&i.onclose():i.onerror&&i.onerror()):_()}},Guacamole.RawAudioRecorder.prototype=new Guacamole.AudioRecorder,Guacamole.RawAudioRecorder.isSupportedType=function(e){return!!Guacamole.AudioContextFactory.getAudioContext()&&null!==Guacamole.RawAudioFormat.parse(e)},Guacamole.RawAudioRecorder.getSupportedTypes=function(){return Guacamole.AudioContextFactory.getAudioContext()?["audio/L8","audio/L16"]:[]};var Guacamole=Guacamole||{};Guacamole.BlobReader=function(e,t){var i,n=this,r=0;i=window.BlobBuilder?new BlobBuilder:window.WebKitBlobBuilder?new WebKitBlobBuilder:window.MozBlobBuilder?new MozBlobBuilder:new function(){var e=[];this.append=function(i){e.push(new Blob([i],{type:t}))},this.getBlob=function(){return new Blob(e,{type:t})}},e.onblob=function(t){for(var a=window.atob(t),o=new ArrayBuffer(a.length),s=new Uint8Array(o),l=0;l<a.length;l++)s[l]=a.charCodeAt(l);i.append(o),r+=o.byteLength,n.onprogress&&n.onprogress(o.byteLength),e.sendAck("OK",0)},e.onend=function(){n.onend&&n.onend()},this.getLength=function(){return r},this.getBlob=function(){return i.getBlob()},this.onprogress=null,this.onend=null};var Guacamole=Guacamole||{};Guacamole.BlobWriter=function(e){var t=this,i=new Guacamole.ArrayBufferWriter(e);i.onack=function(e){t.onack&&t.onack(e)};var n=function(e,t,i){var n=(e.slice||e.webkitSlice||e.mozSlice).bind(e),r=i-t;if(r!==i){var a=n(t,r);if(a.size===r)return a}return n(t,i)};this.sendBlob=function(e){var r=0,a=new FileReader,o=function(){if(r>=e.size)return void(t.oncomplete&&t.oncomplete(e));var o=n(e,r,r+i.blobLength);r+=i.blobLength,a.readAsArrayBuffer(o)};a.onload=function(){i.sendData(a.result),i.onack=function(n){t.onack&&t.onack(n),n.isError()||(t.onprogress&&t.onprogress(e,r-i.blobLength),o())}},a.onerror=function(){t.onerror&&t.onerror(e,r,a.error)},o()},this.sendEnd=function(){i.sendEnd()},this.onack=null,this.onerror=null,this.onprogress=null,this.oncomplete=null};var Guacamole=Guacamole||{};Guacamole.Client=function(e){function t(e){e!=s&&(s=e,r.onstatechange&&r.onstatechange(s))}function i(){return s==o||s==a}function n(t){var i=g[t];return null==i&&(i=g[t]=new Guacamole.Parser,i.oninstruction=e.oninstruction),i}var r=this,a=2,o=3,s=0,l=0,c=null,u={0:"butt",1:"round",2:"square"},d={0:"bevel",1:"miter",2:"round"},h=new Guacamole.Display,p={},f={},m={},g=[],v=[],y=[],_=new Guacamole.IntegerPool,b=[];this.exportState=function(e){var t={currentState:s,currentTimestamp:l,layers:{}},i={};for(var n in p)i[n]=p[n];h.flush(function(){for(var n in i){var r=parseInt(n),a=i[n],o=a.toCanvas(),s={width:a.width,height:a.height};a.width&&a.height&&(s.url=o.toDataURL("image/png")),r>0&&(s.x=a.x,s.y=a.y,s.z=a.z,s.alpha=a.alpha,s.matrix=a.matrix,s.parent=x(a.parent)),t.layers[n]=s}e(t)})},this.importState=function(e,t){var i,n;s=e.currentState,l=e.currentTimestamp;for(i in p)(n=parseInt(i))>0&&h.dispose(p[i]);p={};for(i in e.layers){n=parseInt(i);var r=e.layers[i],a=w(n);if(h.resize(a,r.width,r.height),r.url&&(h.setChannelMask(a,Guacamole.Layer.SRC),h.draw(a,0,0,r.url)),n>0&&r.parent>=0){var o=w(r.parent);h.move(a,o,r.x,r.y,r.z),h.shade(a,r.alpha);var c=r.matrix;h.distort(a,c[0],c[1],c[2],c[3],c[4],c[5])}}h.flush(t)},this.getDisplay=function(){return h},this.sendSize=function(t,n){i()&&e.sendMessage("size",t,n)},this.sendKeyEvent=function(t,n){i()&&e.sendMessage("key",n,t)},this.sendMouseState=function(t){if(i()){h.moveCursor(Math.floor(t.x),Math.floor(t.y));var n=0;t.left&&(n|=1),t.middle&&(n|=2),t.right&&(n|=4),t.up&&(n|=8),t.down&&(n|=16),e.sendMessage("mouse",Math.floor(t.x),Math.floor(t.y),n)}},this.setClipboard=function(e){if(i()){for(var t=r.createClipboardStream("text/plain"),n=new Guacamole.StringWriter(t),a=0;a<e.length;a+=4096)n.sendText(e.substring(a,a+4096));n.sendEnd()}},this.createOutputStream=function(){var e=_.next();return b[e]=new Guacamole.OutputStream(r,e)},this.createAudioStream=function(t){var i=r.createOutputStream();return e.sendMessage("audio",i.index,t),i},this.createFileStream=function(t,i){var n=r.createOutputStream();return e.sendMessage("file",n.index,t,i),n},this.createPipeStream=function(t,i){var n=r.createOutputStream();return e.sendMessage("pipe",n.index,t,i),n},this.createClipboardStream=function(t){var i=r.createOutputStream();return e.sendMessage("clipboard",i.index,t),i},this.createArgumentValueStream=function(t,i){var n=r.createOutputStream();return e.sendMessage("argv",n.index,t,i),n},this.createObjectOutputStream=function(t,i,n){var a=r.createOutputStream();return e.sendMessage("put",t,a.index,i,n),a},this.requestObjectInputStream=function(t,n){i()&&e.sendMessage("get",t,n)},this.sendAck=function(t,n,r){i()&&e.sendMessage("ack",t,n,r)},this.sendBlob=function(t,n){i()&&e.sendMessage("blob",t,n)},this.endStream=function(t){i()&&(e.sendMessage("end",t),b[t]&&(_.free(t),delete b[t]))},this.onstatechange=null,this.onname=null,this.onerror=null,this.onaudio=null,this.onvideo=null,this.onargv=null,this.onclipboard=null,this.onfile=null,this.onfilesystem=null,this.onpipe=null,this.onrequired=null,this.onsync=null;var w=function(e){var t=p[e];return t||(t=0===e?h.getDefaultLayer():e>0?h.createLayer():h.createBuffer(),p[e]=t),t},x=function(e){if(!e)return null;for(var t in p)if(e===p[t])return parseInt(t);return null},k={"miter-limit":function(e,t){h.setMiterLimit(e,parseFloat(t))}},C={ack:function(e){var t=parseInt(e[0]),i=e[1],n=parseInt(e[2]),r=b[t];r&&(r.onack&&r.onack(new Guacamole.Status(n,i)),n>=256&&b[t]===r&&(_.free(t),delete b[t]))},arc:function(e){var t=w(parseInt(e[0])),i=parseInt(e[1]),n=parseInt(e[2]),r=parseInt(e[3]),a=parseFloat(e[4]),o=parseFloat(e[5]),s=parseInt(e[6]);h.arc(t,i,n,r,a,o,0!=s)},argv:function(e){var t=parseInt(e[0]),i=e[1],n=e[2];if(r.onargv){var a=v[t]=new Guacamole.InputStream(r,t);r.onargv(a,i,n)}else r.sendAck(t,"Receiving argument values unsupported",256)},audio:function(e){var t=parseInt(e[0]),i=e[1],n=v[t]=new Guacamole.InputStream(r,t),a=null;r.onaudio&&(a=r.onaudio(n,i)),a||(a=Guacamole.AudioPlayer.getInstance(n,i)),a?(f[t]=a,r.sendAck(t,"OK",0)):r.sendAck(t,"BAD TYPE",783)},blob:function(e){var t=parseInt(e[0]),i=e[1],n=v[t];n&&n.onblob&&n.onblob(i)},body:function(e){var t=parseInt(e[0]),i=y[t],n=parseInt(e[1]),a=e[2],o=e[3];if(i&&i.onbody){var s=v[n]=new Guacamole.InputStream(r,n);i.onbody(s,a,o)}else r.sendAck(n,"Receipt of body unsupported",256)},cfill:function(e){var t=parseInt(e[0]),i=w(parseInt(e[1])),n=parseInt(e[2]),r=parseInt(e[3]),a=parseInt(e[4]),o=parseInt(e[5]);h.setChannelMask(i,t),h.fillColor(i,n,r,a,o)},clip:function(e){var t=w(parseInt(e[0]));h.clip(t)},clipboard:function(e){var t=parseInt(e[0]),i=e[1];if(r.onclipboard){var n=v[t]=new Guacamole.InputStream(r,t);r.onclipboard(n,i)}else r.sendAck(t,"Clipboard unsupported",256)},close:function(e){var t=w(parseInt(e[0]));h.close(t)},copy:function(e){var t=w(parseInt(e[0])),i=parseInt(e[1]),n=parseInt(e[2]),r=parseInt(e[3]),a=parseInt(e[4]),o=parseInt(e[5]),s=w(parseInt(e[6])),l=parseInt(e[7]),c=parseInt(e[8]);h.setChannelMask(s,o),h.copy(t,i,n,r,a,s,l,c)},cstroke:function(e){var t=parseInt(e[0]),i=w(parseInt(e[1])),n=u[parseInt(e[2])],r=d[parseInt(e[3])],a=parseInt(e[4]),o=parseInt(e[5]),s=parseInt(e[6]),l=parseInt(e[7]),c=parseInt(e[8]);h.setChannelMask(i,t),h.strokeColor(i,n,r,a,o,s,l,c)},cursor:function(e){var t=parseInt(e[0]),i=parseInt(e[1]),n=w(parseInt(e[2])),r=parseInt(e[3]),a=parseInt(e[4]),o=parseInt(e[5]),s=parseInt(e[6]);h.setCursor(t,i,n,r,a,o,s)},curve:function(e){var t=w(parseInt(e[0])),i=parseInt(e[1]),n=parseInt(e[2]),r=parseInt(e[3]),a=parseInt(e[4]),o=parseInt(e[5]),s=parseInt(e[6]);h.curveTo(t,i,n,r,a,o,s)},disconnect:function(e){r.disconnect()},dispose:function(e){var t=parseInt(e[0]);if(t>0){var i=w(t);h.dispose(i),delete p[t]}else t<0&&delete p[t]},distort:function(e){var t=parseInt(e[0]),i=parseFloat(e[1]),n=parseFloat(e[2]),r=parseFloat(e[3]),a=parseFloat(e[4]),o=parseFloat(e[5]),s=parseFloat(e[6]);if(t>=0){var l=w(t);h.distort(l,i,n,r,a,o,s)}},error:function(e){var t=e[0],i=parseInt(e[1]);r.onerror&&r.onerror(new Guacamole.Status(i,t)),r.disconnect()},end:function(e){var t=parseInt(e[0]),i=v[t];i&&(i.onend&&i.onend(),delete v[t])},file:function(e){var t=parseInt(e[0]),i=e[1],n=e[2];if(r.onfile){var a=v[t]=new Guacamole.InputStream(r,t);r.onfile(a,i,n)}else r.sendAck(t,"File transfer unsupported",256)},filesystem:function(e){var t=parseInt(e[0]),i=e[1];if(r.onfilesystem){var n=y[t]=new Guacamole.Object(r,t);r.onfilesystem(n,i)}},identity:function(e){var t=w(parseInt(e[0]));h.setTransform(t,1,0,0,1,0,0)},img:function(e){var t=parseInt(e[0]),i=parseInt(e[1]),n=w(parseInt(e[2])),a=e[3],o=parseInt(e[4]),s=parseInt(e[5]),l=v[t]=new Guacamole.InputStream(r,t);h.setChannelMask(n,i),h.drawStream(n,o,s,l,a)},jpeg:function(e){var t=parseInt(e[0]),i=w(parseInt(e[1])),n=parseInt(e[2]),r=parseInt(e[3]),a=e[4];h.setChannelMask(i,t),h.draw(i,n,r,"data:image/jpeg;base64,"+a)},lfill:function(e){var t=parseInt(e[0]),i=w(parseInt(e[1])),n=w(parseInt(e[2]));h.setChannelMask(i,t),h.fillLayer(i,n)},line:function(e){var t=w(parseInt(e[0])),i=parseInt(e[1]),n=parseInt(e[2]);h.lineTo(t,i,n)},lstroke:function(e){var t=parseInt(e[0]),i=w(parseInt(e[1])),n=w(parseInt(e[2]));h.setChannelMask(i,t),h.strokeLayer(i,n)},mouse:function(e){var t=parseInt(e[0]),i=parseInt(e[1]);h.showCursor(!0),h.moveCursor(t,i)},move:function(e){var t=parseInt(e[0]),i=parseInt(e[1]),n=parseInt(e[2]),r=parseInt(e[3]),a=parseInt(e[4]);if(t>0&&i>=0){var o=w(t),s=w(i);h.move(o,s,n,r,a)}},name:function(e){r.onname&&r.onname(e[0])},nest:function(e){n(parseInt(e[0])).receive(e[1])},pipe:function(e){var t=parseInt(e[0]),i=e[1],n=e[2];if(r.onpipe){var a=v[t]=new Guacamole.InputStream(r,t);r.onpipe(a,i,n)}else r.sendAck(t,"Named pipes unsupported",256)},png:function(e){var t=parseInt(e[0]),i=w(parseInt(e[1])),n=parseInt(e[2]),r=parseInt(e[3]),a=e[4];h.setChannelMask(i,t),h.draw(i,n,r,"data:image/png;base64,"+a)},pop:function(e){var t=w(parseInt(e[0]));h.pop(t)},push:function(e){var t=w(parseInt(e[0]));h.push(t)},rect:function(e){var t=w(parseInt(e[0])),i=parseInt(e[1]),n=parseInt(e[2]),r=parseInt(e[3]),a=parseInt(e[4]);h.rect(t,i,n,r,a)},required:function(e){r.onrequired&&r.onrequired(e)},reset:function(e){var t=w(parseInt(e[0]));h.reset(t)},set:function(e){var t=w(parseInt(e[0])),i=e[1],n=e[2],r=k[i];r&&r(t,n)},shade:function(e){var t=parseInt(e[0]),i=parseInt(e[1]);if(t>=0){var n=w(t);h.shade(n,i)}},size:function(e){var t=parseInt(e[0]),i=w(t),n=parseInt(e[1]),r=parseInt(e[2]);h.resize(i,n,r)},start:function(e){var t=w(parseInt(e[0])),i=parseInt(e[1]),n=parseInt(e[2]);h.moveTo(t,i,n)},sync:function(i){var n=parseInt(i[0]);h.flush(function(){for(var t in f){var i=f[t];i&&i.sync()}n!==l&&(e.sendMessage("sync",n),l=n)}),s===a&&t(o),r.onsync&&r.onsync(n)},transfer:function(e){var t=w(parseInt(e[0])),i=parseInt(e[1]),n=parseInt(e[2]),r=parseInt(e[3]),a=parseInt(e[4]),o=parseInt(e[5]),s=w(parseInt(e[6])),l=parseInt(e[7]),c=parseInt(e[8]);3===o?h.put(t,i,n,r,a,s,l,c):5!==o&&h.transfer(t,i,n,r,a,s,l,c,Guacamole.Client.DefaultTransferFunction[o])},transform:function(e){var t=w(parseInt(e[0])),i=parseFloat(e[1]),n=parseFloat(e[2]),r=parseFloat(e[3]),a=parseFloat(e[4]),o=parseFloat(e[5]),s=parseFloat(e[6]);h.transform(t,i,n,r,a,o,s)},undefine:function(e){var t=parseInt(e[0]),i=y[t];i&&i.onundefine&&i.onundefine()},video:function(e){var t=parseInt(e[0]),i=w(parseInt(e[1])),n=e[2],a=v[t]=new Guacamole.InputStream(r,t),o=null;r.onvideo&&(o=r.onvideo(a,i,n)),o||(o=Guacamole.VideoPlayer.getInstance(a,i,n)),o?(m[t]=o,r.sendAck(t,"OK",0)):r.sendAck(t,"BAD TYPE",783)}};e.oninstruction=function(e,t){var i=C[e];i&&i(t)},this.disconnect=function(){5!=s&&4!=s&&(t(4),c&&window.clearInterval(c),e.sendMessage("disconnect"),e.disconnect(),t(5))},this.connect=function(i){t(1);try{e.connect(i)}catch(e){throw t(0),e}c=window.setInterval(function(){e.sendMessage("nop")},5e3),t(a)}},Guacamole.Client.DefaultTransferFunction={0:function(e,t){t.red=t.green=t.blue=0},15:function(e,t){t.red=t.green=t.blue=255},3:function(e,t){t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha},5:function(e,t){},12:function(e,t){t.red=255&~e.red,t.green=255&~e.green,t.blue=255&~e.blue,t.alpha=e.alpha},10:function(e,t){t.red=255&~t.red,t.green=255&~t.green,t.blue=255&~t.blue},1:function(e,t){t.red=e.red&t.red,t.green=e.green&t.green,t.blue=e.blue&t.blue},14:function(e,t){t.red=255&~(e.red&t.red),t.green=255&~(e.green&t.green),t.blue=255&~(e.blue&t.blue)},7:function(e,t){t.red=e.red|t.red,t.green=e.green|t.green,t.blue=e.blue|t.blue},8:function(e,t){t.red=255&~(e.red|t.red),t.green=255&~(e.green|t.green),t.blue=255&~(e.blue|t.blue)},6:function(e,t){t.red=e.red^t.red,t.green=e.green^t.green,t.blue=e.blue^t.blue},9:function(e,t){t.red=255&~(e.red^t.red),t.green=255&~(e.green^t.green),t.blue=255&~(e.blue^t.blue)},4:function(e,t){t.red=~e.red&t.red&255,t.green=~e.green&t.green&255,t.blue=~e.blue&t.blue&255},13:function(e,t){t.red=255&(~e.red|t.red),t.green=255&(~e.green|t.green),t.blue=255&(~e.blue|t.blue)},2:function(e,t){t.red=e.red&~t.red&255,t.green=e.green&~t.green&255,t.blue=e.blue&~t.blue&255},11:function(e,t){t.red=255&(e.red|~t.red),t.green=255&(e.green|~t.green),t.blue=255&(e.blue|~t.blue)}};var Guacamole=Guacamole||{};Guacamole.DataURIReader=function(e,t){var i=this,n="data:"+t+";base64,";e.onblob=function(e){n+=e},e.onend=function(){i.onend&&i.onend()},this.getURI=function(){return n},this.onend=null};var Guacamole=Guacamole||{};Guacamole.Display=function(){function e(){for(var e=0;e<m.length;){var t=m[e];if(!t.isReady())break;t.flush(),e++}m.splice(0,e)}function t(e,t){this.isReady=function(){for(var e=0;e<t.length;e++)if(t[e].blocked)return!1;return!0},this.flush=function(){for(var i=0;i<t.length;i++)t[i].execute();e&&e()}}function i(t,i){var n=this;this.blocked=i,this.unblock=function(){n.blocked&&(n.blocked=!1,e())},this.execute=function(){t&&t()}}function n(e,t){var n=new i(e,t);return f.push(n),n}var r=this,a=0,o=0,s=1,l=1,c=1,u=document.createElement("div");u.style.position="relative",u.style.width=a+"px",u.style.height=o+"px",u.style.transformOrigin=u.style.webkitTransformOrigin=u.style.MozTransformOrigin=u.style.OTransformOrigin=u.style.msTransformOrigin="0 0";var d=new Guacamole.Display.VisibleLayer(a,o),h=new Guacamole.Display.VisibleLayer(0,0);h.setChannelMask(Guacamole.Layer.SRC),u.appendChild(d.getElement()),u.appendChild(h.getElement());var p=document.createElement("div");p.style.position="relative",p.style.width=a*s+"px",p.style.height=o*s+"px",p.appendChild(u),this.cursorHotspotX=0,this.cursorHotspotY=0,this.cursorX=0,this.cursorY=0,this.onresize=null,this.oncursor=null;var f=[],m=[];this.getElement=function(){return p},this.getWidth=function(){return a},this.getHeight=function(){return o},this.getDefaultLayer=function(){return d},this.getCursorLayer=function(){return h},this.createLayer=function(){var e=new Guacamole.Display.VisibleLayer(a,o);return e.move(d,0,0,0),e},this.createBuffer=function(){var e=new Guacamole.Layer(0,0);return e.autosize=1,e},this.flush=function(i){m.push(new t(i,f)),f=[],e()},this.setCursor=function(e,t,i,a,o,s,l){n(function(){r.cursorHotspotX=e,r.cursorHotspotY=t,h.resize(s,l),h.copy(i,a,o,s,l,0,0),r.moveCursor(r.cursorX,r.cursorY),r.oncursor&&r.oncursor(h.toCanvas(),e,t)})},this.showCursor=function(e){var t=h.getElement(),i=t.parentNode;!1===e?i&&i.removeChild(t):i!==u&&u.appendChild(t)},this.moveCursor=function(e,t){h.translate(e-r.cursorHotspotX,t-r.cursorHotspotY),r.cursorX=e,r.cursorY=t},this.resize=function(e,t,i){n(function(){e.resize(t,i),e===d&&(a=t,o=i,u.style.width=a+"px",u.style.height=o+"px",p.style.width=a*s+"px",p.style.height=o*s+"px",r.onresize&&r.onresize(t,i))})},this.drawImage=function(e,t,i,r){n(function(){e.drawImage(t,i,r)})},this.drawBlob=function(e,t,i,r){var a;if(window.createImageBitmap){var o;a=n(function(){e.drawImage(t,i,o)},!0),window.createImageBitmap(r).then(function(e){o=e,a.unblock()})}else{var s=URL.createObjectURL(r);a=n(function(){l.width&&l.height&&e.drawImage(t,i,l),URL.revokeObjectURL(s)},!0);var l=new Image;l.onload=a.unblock,l.onerror=a.unblock,l.src=s}},this.drawStream=function(e,t,i,n,a){if(window.createImageBitmap){var o=new Guacamole.BlobReader(n,a);o.onend=function(){r.drawBlob(e,t,i,o.getBlob())}}else{var o=new Guacamole.DataURIReader(n,a);o.onend=function(){r.draw(e,t,i,o.getURI())}}},this.draw=function(e,t,i,r){var a=n(function(){o.width&&o.height&&e.drawImage(t,i,o)},!0),o=new Image;o.onload=a.unblock,o.onerror=a.unblock,o.src=r},this.play=function(e,t,i,r){var a=document.createElement("video");a.type=t,a.src=r,a.addEventListener("play",function(){function t(){e.drawImage(0,0,a),a.ended||window.setTimeout(t,20)}t()},!1),n(a.play)},this.transfer=function(e,t,i,r,a,o,s,l,c){n(function(){o.transfer(e,t,i,r,a,s,l,c)})},this.put=function(e,t,i,r,a,o,s,l){n(function(){o.put(e,t,i,r,a,s,l)})},this.copy=function(e,t,i,r,a,o,s,l){n(function(){o.copy(e,t,i,r,a,s,l)})},this.moveTo=function(e,t,i){n(function(){e.moveTo(t,i)})},this.lineTo=function(e,t,i){n(function(){e.lineTo(t,i)})},this.arc=function(e,t,i,r,a,o,s){n(function(){e.arc(t,i,r,a,o,s)})},this.curveTo=function(e,t,i,r,a,o,s){n(function(){e.curveTo(t,i,r,a,o,s)})},this.close=function(e){n(function(){e.close()})},this.rect=function(e,t,i,r,a){n(function(){e.rect(t,i,r,a)})},this.clip=function(e){n(function(){e.clip()})},this.strokeColor=function(e,t,i,r,a,o,s,l){n(function(){e.strokeColor(t,i,r,a,o,s,l)})},this.fillColor=function(e,t,i,r,a){n(function(){e.fillColor(t,i,r,a)})},this.strokeLayer=function(e,t,i,r,a){n(function(){e.strokeLayer(t,i,r,a)})},this.fillLayer=function(e,t){n(function(){e.fillLayer(t)})},this.push=function(e){n(function(){e.push()})},this.pop=function(e){n(function(){e.pop()})},this.reset=function(e){n(function(){e.reset()})},this.setTransform=function(e,t,i,r,a,o,s){n(function(){e.setTransform(t,i,r,a,o,s)})},this.transform=function(e,t,i,r,a,o,s){n(function(){e.transform(t,i,r,a,o,s)})},this.setChannelMask=function(e,t){n(function(){e.setChannelMask(t)})},this.setMiterLimit=function(e,t){n(function(){e.setMiterLimit(t)})},this.dispose=function(e){n(function(){e.dispose()})},this.distort=function(e,t,i,r,a,o,s){n(function(){e.distort(t,i,r,a,o,s)})},this.move=function(e,t,i,r,a){n(function(){e.move(t,i,r,a)})},this.shade=function(e,t){n(function(){e.shade(t)})},this.scale=function(e){u.style.transform=u.style.WebkitTransform=u.style.MozTransform=u.style.OTransform=u.style.msTransform="scale("+e+","+e+")",s=e,p.style.width=a*s+"px",p.style.height=o*s+"px"},this.scaleXY=function(e,t){u.style.transform=u.style.WebkitTransform=u.style.MozTransform=u.style.OTransform=u.style.msTransform="scale("+e+","+t+")",b=e,l=e,c=t,p.style.width=a*l+"px",p.style.height=o*c+"px"},this.getScale=function(){return s},this.getScaleX=function(){return l},this.getScaleY=function(){return c},this.flatten=function(){function e(e){var t=[];for(var i in e.children)t.push(e.children[i]);return t.sort(function(e,t){var i=e.z-t.z;if(0!==i)return i;var n=e.getElement(),r=t.getElement(),a=r.compareDocumentPosition(n);return a&Node.DOCUMENT_POSITION_PRECEDING?-1:a&Node.DOCUMENT_POSITION_FOLLOWING?1:0}),t}function t(i,r,a){if(i.width>0&&i.height>0){var o=n.globalAlpha;n.globalAlpha*=i.alpha/255,n.drawImage(i.getCanvas(),r,a);for(var s=e(i),l=0;l<s.length;l++){var c=s[l];t(c,r+c.x,a+c.y)}n.globalAlpha=o}}var i=document.createElement("canvas");i.width=d.width,i.height=d.height;var n=i.getContext("2d");return t(d,0,0),i}},Guacamole.Display.VisibleLayer=function(e,t){Guacamole.Layer.apply(this,[e,t]);var i=this;this.__unique_id=Guacamole.Display.VisibleLayer.__next_id++,this.alpha=255,this.x=0,this.y=0,this.z=0,this.matrix=[1,0,0,1,0,0],this.parent=null,this.children={};var n=i.getCanvas();n.style.position="absolute",n.style.left="0px",n.style.top="0px";var r=document.createElement("div");r.appendChild(n),r.style.width=e+"px",r.style.height=t+"px",r.style.position="absolute",r.style.left="0px",r.style.top="0px",r.style.overflow="hidden";var a=this.resize;this.resize=function(e,t){r.style.width=e+"px",r.style.height=t+"px",a(e,t)},this.getElement=function(){return r}
|
||
;var o="translate(0px, 0px)",s="matrix(1, 0, 0, 1, 0, 0)";this.translate=function(e,t){i.x=e,i.y=t,o="translate("+e+"px,"+t+"px)",r.style.transform=r.style.WebkitTransform=r.style.MozTransform=r.style.OTransform=r.style.msTransform=o+" "+s},this.move=function(e,t,n,a){if(i.parent!==e){i.parent&&delete i.parent.children[i.__unique_id],i.parent=e,e.children[i.__unique_id]=i;e.getElement().appendChild(r)}i.translate(t,n),i.z=a,r.style.zIndex=a},this.shade=function(e){i.alpha=e,r.style.opacity=e/255},this.dispose=function(){i.parent&&(delete i.parent.children[i.__unique_id],i.parent=null),r.parentNode&&r.parentNode.removeChild(r)},this.distort=function(e,t,n,a,l,c){i.matrix=[e,t,n,a,l,c],s="matrix("+e+","+t+","+n+","+a+","+l+","+c+")",r.style.transform=r.style.WebkitTransform=r.style.MozTransform=r.style.OTransform=r.style.msTransform=o+" "+s}},Guacamole.Display.VisibleLayer.__next_id=0;var Guacamole=Guacamole||{};Guacamole.InputSink=function(){var e=this,t=document.createElement("textarea");t.style.position="fixed",t.style.outline="none",t.style.border="none",t.style.margin="0",t.style.padding="0",t.style.height="0",t.style.width="0",t.style.left="0",t.style.bottom="0",t.style.resize="none",t.style.background="transparent",t.style.color="transparent",t.addEventListener("keypress",function(e){t.value=""},!1),t.addEventListener("compositionend",function(e){e.data&&(t.value="")},!1),t.addEventListener("input",function(e){e.data&&!e.isComposing&&(t.value="")},!1),t.addEventListener("focus",function(){window.setTimeout(function(){t.click(),t.select()},0)},!0),this.focus=function(){window.setTimeout(function(){t.focus()},0)},this.getElement=function(){return t},document.addEventListener("keydown",function(t){var i=document.activeElement;if(i&&i!==document.body){var n=i.getBoundingClientRect();if(n.left+n.width>0&&n.top+n.height>0)return}e.focus()},!0)};var Guacamole=Guacamole||{};Guacamole.InputStream=function(e,t){var i=this;this.index=t,this.onblob=null,this.onend=null,this.sendAck=function(t,n){e.sendAck(i.index,t,n)}};var Guacamole=Guacamole||{};Guacamole.IntegerPool=function(){var e=this,t=[];this.next_int=0,this.next=function(){return t.length>0?t.shift():e.next_int++},this.free=function(e){t.push(e)}};var Guacamole=Guacamole||{};Guacamole.JSONReader=function(e){var t=this,i=new Guacamole.StringReader(e),n="";this.getLength=function(){return n.length},this.getJSON=function(){return JSON.parse(n)},i.ontext=function(e){n+=e,t.onprogress&&t.onprogress(e.length)},i.onend=function(){t.onend&&t.onend()},this.onprogress=null,this.onend=null};var Guacamole=Guacamole||{};Guacamole.Keyboard=function(e){function t(e,t,i){if(!e)return null;var r,a=e.indexOf("U+");if(a>=0){var o=e.substring(a+2);r=String.fromCharCode(parseInt(o,16))}else{if(1!==e.length||3===t)return k(g[e],t);r=e}return!0===i?r=r.toUpperCase():!1===i&&(r=r.toLowerCase()),n(r.charCodeAt(0))}function i(e){return e<=31||e>=127&&e<=159}function n(e){return i(e)?65280|e:e>=0&&e<=255?e:e>=256&&e<=1114111?16777216|e:null}function r(e,t){return k(m[e],t)}function a(){var e=D();if(!e)return!1;var t;do{t=e,e=D()}while(null!==e);return A()&&o.reset(),t.defaultPrevented}var o=this,s=Guacamole.Keyboard._nextID++,l="_GUAC_KEYBOARD_HANDLED_BY_"+s;this.onkeydown=null,this.onkeyup=null;var c={keyupUnreliable:!1,altIsTypableOnly:!1,capsLockKeyupUnreliable:!1};navigator&&navigator.platform&&(navigator.platform.match(/ipad|iphone|ipod/i)?c.keyupUnreliable=!0:navigator.platform.match(/^mac/i)&&(c.altIsTypableOnly=!0,c.capsLockKeyupUnreliable=!0));var u=function(){var e=this;this.timestamp=(new Date).getTime(),this.defaultPrevented=!1,this.keysym=null,this.reliable=!1,this.getAge=function(){return(new Date).getTime()-e.timestamp}},d=function(e,i,n,a){u.apply(this),this.keyCode=e,this.keyIdentifier=i,this.key=n,this.location=a,this.keysym=t(n,a)||r(e,a),this.keyupReliable=!c.keyupUnreliable,this.keysym&&!C(this.keysym)&&(this.reliable=!0),!this.keysym&&T(e,i)&&(this.keysym=t(i,a,o.modifiers.shift)),o.modifiers.meta&&65511!==this.keysym&&65512!==this.keysym?this.keyupReliable=!1:65509===this.keysym&&c.capsLockKeyupUnreliable&&(this.keyupReliable=!1);var s=!o.modifiers.ctrl&&!c.altIsTypableOnly;(!o.modifiers.alt&&o.modifiers.ctrl||s&&o.modifiers.alt||o.modifiers.meta||o.modifiers.hyper)&&(this.reliable=!0),b[e]=this.keysym};d.prototype=new u;var h=function(e){u.apply(this),this.charCode=e,this.keysym=n(e),this.reliable=!0};h.prototype=new u;var p=function(e,i,n,a){u.apply(this),this.keyCode=e,this.keyIdentifier=i,this.key=n,this.location=a,this.keysym=r(e,a)||t(n,a),o.pressed[this.keysym]||(this.keysym=b[e]||this.keysym),this.reliable=!0};p.prototype=new u;var f=[],m={8:[65288],9:[65289],12:[65291,65291,65291,65461],13:[65293],16:[65505,65505,65506],17:[65507,65507,65508],18:[65513,65513,65027],19:[65299],20:[65509],27:[65307],32:[32],33:[65365,65365,65365,65465],34:[65366,65366,65366,65459],35:[65367,65367,65367,65457],36:[65360,65360,65360,65463],37:[65361,65361,65361,65460],38:[65362,65362,65362,65464],39:[65363,65363,65363,65462],40:[65364,65364,65364,65458],45:[65379,65379,65379,65456],46:[65535,65535,65535,65454],91:[65515],92:[65383],93:null,96:[65456],97:[65457],98:[65458],99:[65459],100:[65460],101:[65461],102:[65462],103:[65463],104:[65464],105:[65465],106:[65450],107:[65451],109:[65453],110:[65454],111:[65455],112:[65470],113:[65471],114:[65472],115:[65473],116:[65474],117:[65475],118:[65476],119:[65477],120:[65478],121:[65479],122:[65480],123:[65481],144:[65407],145:[65300],225:[65027]},g={Again:[65382],AllCandidates:[65341],Alphanumeric:[65328],Alt:[65513,65513,65027],Attn:[64782],AltGraph:[65027],ArrowDown:[65364],ArrowLeft:[65361],ArrowRight:[65363],ArrowUp:[65362],Backspace:[65288],CapsLock:[65509],Cancel:[65385],Clear:[65291],Convert:[65313],Copy:[64789],Crsel:[64796],CrSel:[64796],CodeInput:[65335],Compose:[65312],Control:[65507,65507,65508],ContextMenu:[65383],Delete:[65535],Down:[65364],End:[65367],Enter:[65293],EraseEof:[64774],Escape:[65307],Execute:[65378],Exsel:[64797],ExSel:[64797],F1:[65470],F2:[65471],F3:[65472],F4:[65473],F5:[65474],F6:[65475],F7:[65476],F8:[65477],F9:[65478],F10:[65479],F11:[65480],F12:[65481],F13:[65482],F14:[65483],F15:[65484],F16:[65485],F17:[65486],F18:[65487],F19:[65488],F20:[65489],F21:[65490],F22:[65491],F23:[65492],F24:[65493],Find:[65384],GroupFirst:[65036],GroupLast:[65038],GroupNext:[65032],GroupPrevious:[65034],FullWidth:null,HalfWidth:null,HangulMode:[65329],Hankaku:[65321],HanjaMode:[65332],Help:[65386],Hiragana:[65317],HiraganaKatakana:[65319],Home:[65360],Hyper:[65517,65517,65518],Insert:[65379],JapaneseHiragana:[65317],JapaneseKatakana:[65318],JapaneseRomaji:[65316],JunjaMode:[65336],KanaMode:[65325],KanjiMode:[65313],Katakana:[65318],Left:[65361],Meta:[65511,65511,65512],ModeChange:[65406],NumLock:[65407],PageDown:[65366],PageUp:[65365],Pause:[65299],Play:[64790],PreviousCandidate:[65342],PrintScreen:[65377],Redo:[65382],Right:[65363],RomanCharacters:null,Scroll:[65300],Select:[65376],Separator:[65452],Shift:[65505,65505,65506],SingleCandidate:[65340],Super:[65515,65515,65516],Tab:[65289],UIKeyInputDownArrow:[65364],UIKeyInputEscape:[65307],UIKeyInputLeftArrow:[65361],UIKeyInputRightArrow:[65363],UIKeyInputUpArrow:[65362],Up:[65362],Undo:[65381],Win:[65515],Zenkaku:[65320],ZenkakuHankaku:[65322]},v={65027:!0,65505:!0,65506:!0,65507:!0,65508:!0,65509:!0,65511:!0,65512:!0,65513:!0,65514:!0,65515:!0,65516:!0};this.modifiers=new Guacamole.Keyboard.ModifierState,this.pressed={};var y={},_={},b={},w=null,x=null,k=function(e,t){return e?e[t]||e[0]:null},C=function(e){return e>=0&&e<=255||16777216==(4294901760&e)},T=function(e,t){if(!t)return!1;var i=t.indexOf("U+");return-1===i||(e!==parseInt(t.substring(i+2),16)||e>=65&&e<=90||e>=48&&e<=57)};this.press=function(e){if(null!==e){if(!o.pressed[e]&&(o.pressed[e]=!0,o.onkeydown)){var t=o.onkeydown(e);return _[e]=t,window.clearTimeout(w),window.clearInterval(x),v[e]||(w=window.setTimeout(function(){x=window.setInterval(function(){o.onkeyup(e),o.onkeydown(e)},50)},500)),t}return _[e]||!1}},this.release=function(e){o.pressed[e]&&(delete o.pressed[e],delete y[e],window.clearTimeout(w),window.clearInterval(x),null!==e&&o.onkeyup&&o.onkeyup(e))},this.type=function(e){for(var t=0;t<e.length;t++){var i=e.codePointAt?e.codePointAt(t):e.charCodeAt(t),r=n(i);o.press(r),o.release(r)}},this.reset=function(){for(var e in o.pressed)o.release(parseInt(e));f=[]};var S=function(e,t,i,n){var r;if(-1===i.indexOf(n.keysym))if(e&&!1===t)for(r=0;r<i.length;r++)o.release(i[r]);else if(!e&&t){for(r=0;r<i.length;r++)if(o.pressed[i[r]])return;var a=i[0];n.keysym&&(y[a]=!0),o.press(a)}},E=function(e,t){var i=Guacamole.Keyboard.ModifierState.fromKeyboardEvent(e);S(o.modifiers.alt,i.alt,[65513,65514,65027],t),S(o.modifiers.shift,i.shift,[65505,65506],t),S(o.modifiers.ctrl,i.ctrl,[65507,65508],t),S(o.modifiers.meta,i.meta,[65511,65512],t),S(o.modifiers.hyper,i.hyper,[65515,65516],t),o.modifiers=i},A=function(){for(var e in o.pressed)if(!y[e])return!1;return!0},I=function(e){o.modifiers.ctrl&&o.modifiers.alt&&(e>=65&&e<=90||e>=97&&e<=122||(e<=255||16777216==(4278190080&e))&&(o.release(65507),o.release(65508),o.release(65513),o.release(65514)))},D=function(){var e=f[0];if(!e)return null;if(!(e instanceof d)){if(e instanceof p&&!c.keyupUnreliable){var t=e.keysym;return t?(o.release(t),delete b[e.keyCode],e.defaultPrevented=!0,f.shift()):(o.reset(),e)}return f.shift()}var t=null,i=[];if(e.reliable?(t=e.keysym,i=f.splice(0,1)):f[1]instanceof h?(t=f[1].keysym,i=f.splice(0,2)):f[1]&&(t=e.keysym,i=f.splice(0,1)),i.length>0){if(t){I(t);var n=!o.press(t);b[e.keyCode]=t,e.keyupReliable||o.release(t);for(var r=0;r<i.length;r++)i[r].defaultPrevented=n}return e}return null},M=function(e){return"location"in e?e.location:"keyLocation"in e?e.keyLocation:0},L=function(e){return!e[l]&&(e[l]=!0,!0)};this.listenTo=function(e){e.addEventListener("keydown",function(e){if(o.onkeydown&&L(e)){var t;window.event?t=window.event.keyCode:e.which&&(t=e.which);var i=new d(t,e.keyIdentifier,e.key,M(e));E(e,i),229!==t&&(f.push(i),a()&&e.preventDefault())}},!0),e.addEventListener("keypress",function(e){if((o.onkeydown||o.onkeyup)&&L(e)){var t;window.event?t=window.event.keyCode:e.which&&(t=e.which);var i=new h(t);E(e,i),f.push(i),a()&&e.preventDefault()}},!0),e.addEventListener("keyup",function(e){if(o.onkeyup&&L(e)){e.preventDefault();var t;window.event?t=window.event.keyCode:e.which&&(t=e.which);var i=new p(t,e.keyIdentifier,e.key,M(e));E(e,i),f.push(i),a()}},!0);var t=function(t){(o.onkeydown||o.onkeyup)&&L(t)&&t.data&&!t.isComposing&&(e.removeEventListener("compositionend",i,!1),o.type(t.data))},i=function(i){(o.onkeydown||o.onkeyup)&&L(i)&&i.data&&(e.removeEventListener("input",t,!1),o.type(i.data))};e.addEventListener("input",t,!1),e.addEventListener("compositionend",i,!1)},e&&o.listenTo(e)},Guacamole.Keyboard._nextID=0,Guacamole.Keyboard.ModifierState=function(){this.shift=!1,this.ctrl=!1,this.alt=!1,this.meta=!1,this.hyper=!1},Guacamole.Keyboard.ModifierState.fromKeyboardEvent=function(e){var t=new Guacamole.Keyboard.ModifierState;return t.shift=e.shiftKey,t.ctrl=e.ctrlKey,t.alt=e.altKey,t.meta=e.metaKey,e.getModifierState&&(t.hyper=e.getModifierState("OS")||e.getModifierState("Super")||e.getModifierState("Hyper")||e.getModifierState("Win")),t};var Guacamole=Guacamole||{};Guacamole.Layer=function(e,t){function i(e,t,i,r){var a,o=i+e,s=r+t;a=o>n.width?o:n.width;var l;l=s>n.height?s:n.height,n.resize(a,l)}var n=this,r=document.createElement("canvas"),a=r.getContext("2d");a.save();var o=!0,s=!0,l=0,c={1:"destination-in",2:"destination-out",4:"source-in",6:"source-atop",8:"source-out",9:"destination-atop",10:"xor",11:"destination-over",12:"copy",14:"source-over",15:"lighter"},u=function(e,t){e=e||0,t=t||0;var i=64*Math.ceil(e/64),s=64*Math.ceil(t/64);if(r.width!==i||r.height!==s){var c=null;if(!o&&0!==r.width&&0!==r.height){c=document.createElement("canvas"),c.width=Math.min(n.width,e),c.height=Math.min(n.height,t);c.getContext("2d").drawImage(r,0,0,c.width,c.height,0,0,c.width,c.height)}var u=a.globalCompositeOperation;r.width=i,r.height=s,c&&a.drawImage(c,0,0,c.width,c.height,0,0,c.width,c.height),a.globalCompositeOperation=u,l=0,a.save()}else n.reset();n.width=e,n.height=t};this.autosize=!1,this.width=e,this.height=t,this.getCanvas=function(){return r},this.toCanvas=function(){var e=document.createElement("canvas");return e.width=n.width,e.height=n.height,e.getContext("2d").drawImage(n.getCanvas(),0,0),e},this.resize=function(e,t){e===n.width&&t===n.height||u(e,t)},this.drawImage=function(e,t,r){n.autosize&&i(e,t,r.width,r.height),a.drawImage(r,e,t),o=!1},this.transfer=function(e,t,r,s,l,c,u,d){var h=e.getCanvas();if(!(t>=h.width||r>=h.height)&&(t+s>h.width&&(s=h.width-t),r+l>h.height&&(l=h.height-r),0!==s&&0!==l)){n.autosize&&i(c,u,s,l);for(var p=e.getCanvas().getContext("2d").getImageData(t,r,s,l),f=a.getImageData(c,u,s,l),m=0;m<s*l*4;m+=4){var g=new Guacamole.Layer.Pixel(p.data[m],p.data[m+1],p.data[m+2],p.data[m+3]),v=new Guacamole.Layer.Pixel(f.data[m],f.data[m+1],f.data[m+2],f.data[m+3]);d(g,v),f.data[m]=v.red,f.data[m+1]=v.green,f.data[m+2]=v.blue,f.data[m+3]=v.alpha}a.putImageData(f,c,u),o=!1}},this.put=function(e,t,r,s,l,c,u){var d=e.getCanvas();if(!(t>=d.width||r>=d.height)&&(t+s>d.width&&(s=d.width-t),r+l>d.height&&(l=d.height-r),0!==s&&0!==l)){n.autosize&&i(c,u,s,l);var h=e.getCanvas().getContext("2d").getImageData(t,r,s,l);a.putImageData(h,c,u),o=!1}},this.copy=function(e,t,r,s,l,c,u){var d=e.getCanvas();t>=d.width||r>=d.height||(t+s>d.width&&(s=d.width-t),r+l>d.height&&(l=d.height-r),0!==s&&0!==l&&(n.autosize&&i(c,u,s,l),a.drawImage(d,t,r,s,l,c,u,s,l),o=!1))},this.moveTo=function(e,t){s&&(a.beginPath(),s=!1),n.autosize&&i(e,t,0,0),a.moveTo(e,t)},this.lineTo=function(e,t){s&&(a.beginPath(),s=!1),n.autosize&&i(e,t,0,0),a.lineTo(e,t)},this.arc=function(e,t,r,o,l,c){s&&(a.beginPath(),s=!1),n.autosize&&i(e,t,0,0),a.arc(e,t,r,o,l,c)},this.curveTo=function(e,t,r,o,l,c){s&&(a.beginPath(),s=!1),n.autosize&&i(l,c,0,0),a.bezierCurveTo(e,t,r,o,l,c)},this.close=function(){a.closePath(),s=!0},this.rect=function(e,t,r,o){s&&(a.beginPath(),s=!1),n.autosize&&i(e,t,r,o),a.rect(e,t,r,o)},this.clip=function(){a.clip(),s=!0},this.strokeColor=function(e,t,i,n,r,l,c){a.lineCap=e,a.lineJoin=t,a.lineWidth=i,a.strokeStyle="rgba("+n+","+r+","+l+","+c/255+")",a.stroke(),o=!1,s=!0},this.fillColor=function(e,t,i,n){a.fillStyle="rgba("+e+","+t+","+i+","+n/255+")",a.fill(),o=!1,s=!0},this.strokeLayer=function(e,t,i,n){a.lineCap=e,a.lineJoin=t,a.lineWidth=i,a.strokeStyle=a.createPattern(n.getCanvas(),"repeat"),a.stroke(),o=!1,s=!0},this.fillLayer=function(e){a.fillStyle=a.createPattern(e.getCanvas(),"repeat"),a.fill(),o=!1,s=!0},this.push=function(){a.save(),l++},this.pop=function(){l>0&&(a.restore(),l--)},this.reset=function(){for(;l>0;)a.restore(),l--;a.restore(),a.save(),a.beginPath(),s=!1},this.setTransform=function(e,t,i,n,r,o){a.setTransform(e,t,i,n,r,o)},this.transform=function(e,t,i,n,r,o){a.transform(e,t,i,n,r,o)},this.setChannelMask=function(e){a.globalCompositeOperation=c[e]},this.setMiterLimit=function(e){a.miterLimit=e},u(e,t),r.style.zIndex=-1},Guacamole.Layer.ROUT=2,Guacamole.Layer.ATOP=6,Guacamole.Layer.XOR=10,Guacamole.Layer.ROVER=11,Guacamole.Layer.OVER=14,Guacamole.Layer.PLUS=15,Guacamole.Layer.RIN=1,Guacamole.Layer.IN=4,Guacamole.Layer.OUT=8,Guacamole.Layer.RATOP=9,Guacamole.Layer.SRC=12,Guacamole.Layer.Pixel=function(e,t,i,n){this.red=e,this.green=t,this.blue=i,this.alpha=n};var Guacamole=Guacamole||{};Guacamole.Mouse=function(e){function t(e){e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.returnValue=!1}function i(){a=r.touchMouseThreshold}function n(e){var i=e.deltaY||-e.wheelDeltaY||-e.wheelDelta;if(i?1===e.deltaMode?i=e.deltaY*r.PIXELS_PER_LINE:2===e.deltaMode&&(i=e.deltaY*r.PIXELS_PER_PAGE):i=e.detail*r.PIXELS_PER_LINE,(o+=i)<=-r.scrollThreshold){do{r.onmousedown&&(r.currentState.up=!0,r.onmousedown(r.currentState)),r.onmouseup&&(r.currentState.up=!1,r.onmouseup(r.currentState)),o+=r.scrollThreshold}while(o<=-r.scrollThreshold);o=0}if(o>=r.scrollThreshold){do{r.onmousedown&&(r.currentState.down=!0,r.onmousedown(r.currentState)),r.onmouseup&&(r.currentState.down=!1,r.onmouseup(r.currentState)),o-=r.scrollThreshold}while(o>=r.scrollThreshold);o=0}t(e)}var r=this;this.touchMouseThreshold=3,this.scrollThreshold=53,this.PIXELS_PER_LINE=18,this.PIXELS_PER_PAGE=16*this.PIXELS_PER_LINE,this.currentState=new Guacamole.Mouse.State(0,0,!1,!1,!1,!1,!1),this.onmousedown=null,this.onmouseup=null,this.onmousemove=null,this.onmouseout=null;var a=0,o=0;e.addEventListener("contextmenu",function(e){t(e)},!1),e.addEventListener("mousemove",function(i){if(t(i),a)return void a--;r.currentState.fromClientPosition(e,i.clientX,i.clientY),r.onmousemove&&r.onmousemove(r.currentState)},!1),e.addEventListener("mousedown",function(e){if(t(e),!a){switch(e.button){case 0:r.currentState.left=!0;break;case 1:r.currentState.middle=!0;break;case 2:r.currentState.right=!0}r.onmousedown&&r.onmousedown(r.currentState)}},!1),e.addEventListener("mouseup",function(e){if(t(e),!a){switch(e.button){case 0:r.currentState.left=!1;break;case 1:r.currentState.middle=!1;break;case 2:r.currentState.right=!1}r.onmouseup&&r.onmouseup(r.currentState)}},!1),e.addEventListener("mouseout",function(i){i||(i=window.event);for(var n=i.relatedTarget||i.toElement;n;){if(n===e)return;n=n.parentNode}t(i),(r.currentState.left||r.currentState.middle||r.currentState.right)&&(r.currentState.left=!1,r.currentState.middle=!1,r.currentState.right=!1,r.onmouseup&&r.onmouseup(r.currentState)),r.onmouseout&&r.onmouseout()},!1),e.addEventListener("selectstart",function(e){t(e)},!1),e.addEventListener("touchmove",i,!1),e.addEventListener("touchstart",i,!1),e.addEventListener("touchend",i,!1),e.addEventListener("DOMMouseScroll",n,!1),e.addEventListener("mousewheel",n,!1),e.addEventListener("wheel",n,!1);var s=function(){var e=document.createElement("div");if(!("cursor"in e.style))return!1;try{e.style.cursor="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX///+nxBvIAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==) 0 0, auto"}catch(e){return!1}return/\burl\([^()]*\)\s+0\s+0\b/.test(e.style.cursor||"")}();this.setCursor=function(t,i,n){if(s){var r=t.toDataURL("image/png");return e.style.cursor="url("+r+") "+i+" "+n+", auto",!0}return!1}},Guacamole.Mouse.State=function(e,t,i,n,r,a,o){var s=this;this.x=e,this.y=t,this.left=i,this.middle=n,this.right=r,this.up=a,this.down=o,this.fromClientPosition=function(e,t,i){s.x=t-e.offsetLeft,s.y=i-e.offsetTop;for(var n=e.offsetParent;n&&n!==document.body;)s.x-=n.offsetLeft-n.scrollLeft,s.y-=n.offsetTop-n.scrollTop,n=n.offsetParent;if(n){var r=document.body.scrollLeft||document.documentElement.scrollLeft,a=document.body.scrollTop||document.documentElement.scrollTop;s.x-=n.offsetLeft-r,s.y-=n.offsetTop-a}}},Guacamole.Mouse.Touchpad=function(e){var t=this;this.scrollThreshold=20*(window.devicePixelRatio||1),this.clickTimingThreshold=250,this.clickMoveThreshold=10*(window.devicePixelRatio||1),this.currentState=new Guacamole.Mouse.State(0,0,!1,!1,!1,!1,!1),this.onmousedown=null,this.onmouseup=null,this.onmousemove=null;var i=0,n=0,r=0,a=0,o=0,s={1:"left",2:"right",3:"middle"},l=!1,c=null;e.addEventListener("touchend",function(e){if(e.preventDefault(),l&&0===e.touches.length){var n=(new Date).getTime(),r=s[i];t.currentState[r]&&(t.currentState[r]=!1,t.onmouseup&&t.onmouseup(t.currentState),c&&(window.clearTimeout(c),c=null)),n-a<=t.clickTimingThreshold&&o<t.clickMoveThreshold&&(t.currentState[r]=!0,t.onmousedown&&t.onmousedown(t.currentState),c=window.setTimeout(function(){t.currentState[r]=!1,t.onmouseup&&t.onmouseup(t.currentState),l=!1},t.clickTimingThreshold)),c||(l=!1)}},!1),e.addEventListener("touchstart",function(e){if(e.preventDefault(),i=Math.min(e.touches.length,3),c&&(window.clearTimeout(c),c=null),!l){l=!0;var t=e.touches[0];n=t.clientX,r=t.clientY,a=(new Date).getTime(),o=0}},!1),e.addEventListener("touchmove",function(s){s.preventDefault();var l=s.touches[0],c=l.clientX-n,u=l.clientY-r;if(o+=Math.abs(c)+Math.abs(u),1===i){var d=o/((new Date).getTime()-a),h=1+d;t.currentState.x+=c*h,t.currentState.y+=u*h,t.currentState.x<0?t.currentState.x=0:t.currentState.x>=e.offsetWidth&&(t.currentState.x=e.offsetWidth-1),t.currentState.y<0?t.currentState.y=0:t.currentState.y>=e.offsetHeight&&(t.currentState.y=e.offsetHeight-1),t.onmousemove&&t.onmousemove(t.currentState),n=l.clientX,r=l.clientY}else if(2===i&&Math.abs(u)>=t.scrollThreshold){var p;p=u>0?"down":"up",t.currentState[p]=!0,t.onmousedown&&t.onmousedown(t.currentState),t.currentState[p]=!1,t.onmouseup&&t.onmouseup(t.currentState),n=l.clientX,r=l.clientY}},!1)},Guacamole.Mouse.Touchscreen=function(e){function t(e){l.currentState[e]||(l.currentState[e]=!0,l.onmousedown&&l.onmousedown(l.currentState))}function i(e){l.currentState[e]&&(l.currentState[e]=!1,l.onmouseup&&l.onmouseup(l.currentState))}function n(e){t(e),i(e)}function r(t,i){l.currentState.fromClientPosition(e,t,i),l.onmousemove&&l.onmousemove(l.currentState)}function a(e){var t=e.touches[0]||e.changedTouches[0],i=t.clientX-u,n=t.clientY-d;return Math.sqrt(i*i+n*n)>=l.clickMoveThreshold}function o(e){var t=e.touches[0];c=!0,u=t.clientX,d=t.clientY}function s(){window.clearTimeout(h),window.clearTimeout(p),c=!1}var l=this,c=!1,u=null,d=null,h=null,p=null;this.scrollThreshold=20*(window.devicePixelRatio||1),this.clickTimingThreshold=250,this.clickMoveThreshold=16*(window.devicePixelRatio||1),this.longPressThreshold=500,this.currentState=new Guacamole.Mouse.State(0,0,!1,!1,!1,!1,!1),this.onmousedown=null,this.onmouseup=null,this.onmousemove=null,e.addEventListener("touchend",function(e){if(c){if(0!==e.touches.length||1!==e.changedTouches.length)return void s();if(window.clearTimeout(p),i("left"),!a(e)&&(e.preventDefault(),!l.currentState.left)){var n=e.changedTouches[0];r(n.clientX,n.clientY),t("left"),h=window.setTimeout(function(){i("left"),s()},l.clickTimingThreshold)}}},!1),e.addEventListener("touchstart",function(e){if(1!==e.touches.length)return void s();e.preventDefault(),o(e),window.clearTimeout(h),p=window.setTimeout(function(){var t=e.touches[0];r(t.clientX,t.clientY),n("right"),s()},l.longPressThreshold)},!1),e.addEventListener("touchmove",function(e){if(c){if(a(e)&&window.clearTimeout(p),1!==e.touches.length)return void s();if(l.currentState.left){e.preventDefault();var t=e.touches[0];r(t.clientX,t.clientY)}}},!1)};var Guacamole=Guacamole||{},Guacamole=Guacamole||{};Guacamole.Object=function(e,t){var i=this,n={},r=function(e){var t=n[e];if(!t)return null;var i=t.shift();return 0===t.length&&delete n[e],i},a=function(e,t){var i=n[e];i||(i=[],n[e]=i),i.push(t)};this.index=t,this.onbody=function(e,t,i){var n=r(i);n&&n(e,t)},this.onundefine=null,this.requestInputStream=function(t,n){n&&a(t,n),e.requestObjectInputStream(i.index,t)},this.createOutputStream=function(t,n){return e.createObjectOutputStream(i.index,t,n)}},Guacamole.Object.ROOT_STREAM="/",Guacamole.Object.STREAM_INDEX_MIMETYPE="application/vnd.glyptodon.guacamole.stream-index+json";var Guacamole=Guacamole||{};Guacamole.OnScreenKeyboard=function(e){var t=this,i={},n={},r=[],a=function(e,t){e.classList?e.classList.add(t):e.className+=" "+t},o=function(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(/([^ ]+)[ ]*/g,function(e,i){return i===t?"":e})},s=0,l=function(e,t,i,n){this.width=t,this.height=i,this.scale=function(r){e.style.width=t*r+"px",e.style.height=i*r+"px",n&&(e.style.lineHeight=i*r+"px",e.style.fontSize=r+"px")}},c=function(e){for(var t=0;t<e.length;t++){if(!(e[t]in i))return!1}return!0},u=function(e){var i=t.keys[e];if(!i)return null;for(var n=i.length-1;n>=0;n--){var r=i[n];if(c(r.requires))return r}return null},d=function(e,r){if(!n[e]){a(r,"guac-keyboard-pressed");var s=u(e);if(s.modifier){var l="guac-keyboard-modifier-"+m(s.modifier),c=i[s.modifier];c?(o(p,l),delete i[s.modifier],t.onkeyup&&t.onkeyup(c)):(a(p,l),i[s.modifier]=s.keysym,t.onkeydown&&t.onkeydown(s.keysym))}else t.onkeydown&&t.onkeydown(s.keysym);n[e]=!0}},h=function(e,i){if(n[e]){o(i,"guac-keyboard-pressed");var r=u(e);!r.modifier&&t.onkeyup&&t.onkeyup(r.keysym),n[e]=!1}},p=document.createElement("div");p.className="guac-keyboard",p.onselectstart=p.onmousemove=p.onmouseup=p.onmousedown=function(e){return s&&s--,e.stopPropagation(),!1},this.touchMouseThreshold=3,this.onkeydown=null,this.onkeyup=null,this.layout=new Guacamole.OnScreenKeyboard.Layout(e),this.getElement=function(){return p},this.resize=function(e){for(var i=Math.floor(10*e/t.layout.width)/10,n=0;n<r.length;n++){r[n].scale(i)}};var f=function(e,t){if(t instanceof Array){for(var i=[],n=0;n<t.length;n++)i.push(new Guacamole.OnScreenKeyboard.Key(t[n],e));return i}return"number"==typeof t?[new Guacamole.OnScreenKeyboard.Key({name:e,keysym:t})]:"string"==typeof t?[new Guacamole.OnScreenKeyboard.Key({name:e,title:t})]:[new Guacamole.OnScreenKeyboard.Key(t,e)]};this.keys=function(t){var i={};for(var n in e.keys)i[n]=f(n,t[n]);return i}(e.keys);var m=function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[^A-Za-z0-9]+/g,"-").toLowerCase()};!function e(i,n,o){var c,u=document.createElement("div");if(o&&a(u,"guac-keyboard-"+m(o)),n instanceof Array)for(a(u,"guac-keyboard-group"),c=0;c<n.length;c++)e(u,n[c]);else if(n instanceof Object){a(u,"guac-keyboard-group");var p=Object.keys(n).sort();for(c=0;c<p.length;c++){var o=p[c];e(u,n[o],o)}}else if("number"==typeof n)a(u,"guac-keyboard-gap"),r.push(new l(u,n,n));else if("string"==typeof n){var f=n;1===f.length&&(f="0x"+f.charCodeAt(0).toString(16)),a(u,"guac-keyboard-key-container");var g=document.createElement("div");g.className="guac-keyboard-key guac-keyboard-key-"+m(f);var v=t.keys[n];if(v)for(c=0;c<v.length;c++){var y=v[c],_=document.createElement("div");_.className="guac-keyboard-cap",_.textContent=y.title;for(var b=0;b<y.requires.length;b++){var w=y.requires[b];a(_,"guac-keyboard-requires-"+m(w)),a(g,"guac-keyboard-uses-"+m(w))}g.appendChild(_)}u.appendChild(g),r.push(new l(u,t.layout.keyWidths[n]||1,1,!0));var x=function(e){e.preventDefault(),s=t.touchMouseThreshold,d(n,g)},k=function(e){e.preventDefault(),s=t.touchMouseThreshold,h(n,g)},C=function(e){e.preventDefault(),0===s&&d(n,g)},T=function(e){e.preventDefault(),0===s&&h(n,g)};g.addEventListener("touchstart",x,!0),g.addEventListener("touchend",k,!0),g.addEventListener("mousedown",C,!0),g.addEventListener("mouseup",T,!0),g.addEventListener("mouseout",T,!0)}i.appendChild(u)}(p,e.layout)},Guacamole.OnScreenKeyboard.Layout=function(e){this.language=e.language,this.type=e.type,this.keys=e.keys,this.layout=e.layout,this.width=e.width,this.keyWidths=e.keyWidths||{}},Guacamole.OnScreenKeyboard.Key=function(e,t){this.name=t||e.name,this.title=e.title||this.name,this.keysym=e.keysym||function(e){if(!e||1!==e.length)return null;var t=e.charCodeAt(0);return t>=0&&t<=255?t:t>=256&&t<=1114111?16777216|t:null}(this.title),this.modifier=e.modifier,this.requires=e.requires||[]};var Guacamole=Guacamole||{};Guacamole.OutputStream=function(e,t){var i=this;this.index=t,this.onack=null,this.sendBlob=function(t){e.sendBlob(i.index,t)},this.sendEnd=function(){e.endStream(i.index)}};var Guacamole=Guacamole||{};Guacamole.Parser=function(){var e=this,t="",i=[],n=-1,r=0;this.receive=function(a){for(r>4096&&n>=r&&(t=t.substring(r),n-=r,r=0),t+=a;n<t.length;){if(n>=r){var o=t.substring(r,n),s=t.substring(n,n+1);if(i.push(o),";"==s){var l=i.shift();null!=e.oninstruction&&e.oninstruction(l,i),i.length=0}else if(","!=s)throw new Error("Illegal terminator.");r=n+1}var c=t.indexOf(".",r);if(-1==c){r=t.length;break}var u=parseInt(t.substring(n+1,c));if(isNaN(u))throw new Error("Non-numeric character in element length.");r=c+1,n=r+u}},this.oninstruction=null};var Guacamole=Guacamole||{};Guacamole.RawAudioFormat=function(e){this.bytesPerSample=e.bytesPerSample,this.channels=e.channels,this.rate=e.rate},Guacamole.RawAudioFormat.parse=function(e){var t,i=null,n=1;if("audio/L8;"===e.substring(0,9))e=e.substring(9),t=1;else{if("audio/L16;"!==e.substring(0,10))return null;e=e.substring(10),t=2}for(var r=e.split(","),a=0;a<r.length;a++){var o=r[a],s=o.indexOf("=");if(-1===s)return null;var l=o.substring(0,s),c=o.substring(s+1);switch(l){case"channels":n=parseInt(c);break;case"rate":i=parseInt(c);break;default:return null}}return null===i?null:new Guacamole.RawAudioFormat({bytesPerSample:t,channels:n,rate:i})};var Guacamole=Guacamole||{};Guacamole.SessionRecording=function(e){var t=this,i=[],n=[],r=0,a=0,o=new Guacamole.SessionRecording._PlaybackTunnel,s=new Guacamole.Client(o),l=-1,c=null,u=null,d=null;s.connect(),s.getDisplay().showCursor(!1),e.oninstruction=function(e,o){var s=new Guacamole.SessionRecording._Frame.Instruction(e,o.slice());if(n.push(s),r+=s.getSize(),"sync"===e){var l=parseInt(o[0]),c=new Guacamole.SessionRecording._Frame(l,n);i.push(c),(1===i.length||r>=16384&&l-a>=5e3)&&(c.keyframe=!0,a=l,r=0),n=[],t.onprogress&&t.onprogress(t.getDuration())}};var h=function(e){return 0===i.length?0:e-i[0].timestamp},p=function e(t,n,r){if(t===n)return t;var a=Math.floor((t+n)/2),o=h(i[a].timestamp);return r<o&&a>t?e(t,a-1,r):r>o&&a<n?e(a+1,n,r):a},f=function(e){for(var t=i[e],n=0;n<t.instructions.length;n++){var r=t.instructions[n];o.receiveInstruction(r.opcode,r.args)}t.keyframe&&!t.clientState&&s.exportState(function(e){t.clientState=e})},m=function e(n,r,a){g(),d=window.setTimeout(function(){var o;for(o=n;o>=0;o--){var c=i[o];if(o===l)break;if(c.clientState){s.importState(c.clientState);break}}o++;for(var u=(new Date).getTime();o<=n;o++){if((new Date).getTime()-u>=5)break;f(o)}l=o-1,t.onseek&&t.onseek(t.getPosition()),l!==n?e(n,r,Math.max(a-((new Date).getTime()-u),0)):r()},a||0)},g=function(){window.clearTimeout(d)},v=function e(){if(l+1<i.length){var n=i[l+1],r=n.timestamp-c+u,a=Math.max(r-(new Date).getTime(),0);m(l+1,function(){e()},a)}else t.pause()};this.onprogress=null,this.onplay=null,this.onpause=null,this.onseek=null,this.connect=function(t){e.connect(t)},this.disconnect=function(){e.disconnect()},this.getDisplay=function(){return s.getDisplay()},this.isPlaying=function(){return!!c},this.getPosition=function(){return-1===l?0:h(i[l].timestamp)},this.getDuration=function(){return 0===i.length?0:h(i[i.length-1].timestamp)},this.play=function(){if(!t.isPlaying()&&l+1<i.length){t.onplay&&t.onplay();var e=i[l+1];c=e.timestamp,u=(new Date).getTime(),v()}},this.seek=function(e,n){if(0!==i.length){var r=t.isPlaying();t.pause(),m(p(0,i.length-1,e),function(){r&&t.play(),n&&n()})}},this.pause=function(){g(),t.isPlaying()&&(t.onpause&&t.onpause(),c=null,u=null)}},Guacamole.SessionRecording._Frame=function(e,t){this.keyframe=!1,this.timestamp=e,this.instructions=t,this.clientState=null},Guacamole.SessionRecording._Frame.Instruction=function(e,t){var i=this;this.opcode=e,this.args=t,this.getSize=function(){for(var e=i.opcode.length,t=0;t<i.args.length;t++)e+=i.args[t].length;return e}},Guacamole.SessionRecording._PlaybackTunnel=function(){var e=this;this.connect=function(e){},this.sendMessage=function(e){},this.disconnect=function(){},this.receiveInstruction=function(t,i){e.oninstruction&&e.oninstruction(t,i)}};var Guacamole=Guacamole||{};Guacamole.Status=function(e,t){var i=this;this.code=e,this.message=t,this.isError=function(){return i.code<0||i.code>255}},Guacamole.Status.Code={SUCCESS:0,UNSUPPORTED:256,SERVER_ERROR:512,SERVER_BUSY:513,UPSTREAM_TIMEOUT:514,UPSTREAM_ERROR:515,RESOURCE_NOT_FOUND:516,RESOURCE_CONFLICT:517,RESOURCE_CLOSED:518,UPSTREAM_NOT_FOUND:519,UPSTREAM_UNAVAILABLE:520,SESSION_CONFLICT:521,SESSION_TIMEOUT:522,SESSION_CLOSED:523,CLIENT_BAD_REQUEST:768,CLIENT_UNAUTHORIZED:769,CLIENT_FORBIDDEN:771,CLIENT_TIMEOUT:776,CLIENT_OVERRUN:781,CLIENT_BAD_TYPE:783,CLIENT_TOO_MANY:797},Guacamole.Status.Code.fromHTTPCode=function(e){switch(e){case 400:
|
||
return Guacamole.Status.Code.CLIENT_BAD_REQUEST;case 403:return Guacamole.Status.Code.CLIENT_FORBIDDEN;case 404:return Guacamole.Status.Code.RESOURCE_NOT_FOUND;case 429:return Guacamole.Status.Code.CLIENT_TOO_MANY;case 503:return Guacamole.Status.Code.SERVER_BUSY}return Guacamole.Status.Code.SERVER_ERROR},Guacamole.Status.Code.fromWebSocketCode=function(e){switch(e){case 1e3:return Guacamole.Status.Code.SUCCESS;case 1006:case 1015:return Guacamole.Status.Code.UPSTREAM_NOT_FOUND;case 1001:case 1012:case 1013:case 1014:return Guacamole.Status.Code.UPSTREAM_UNAVAILABLE}return Guacamole.Status.Code.SERVER_ERROR};var Guacamole=Guacamole||{};Guacamole.StringReader=function(e){function t(e){for(var t="",i=new Uint8Array(e),n=0;n<i.length;n++){var o=i[n];0===r?127==(127|o)?t+=String.fromCharCode(o):223==(31|o)?(a=31&o,r=1):239==(15|o)?(a=15&o,r=2):247==(7|o)?(a=7&o,r=3):t+="�":191==(63|o)?(a=a<<6|63&o,0===--r&&(t+=String.fromCharCode(a))):(r=0,t+="�")}return t}var i=this,n=new Guacamole.ArrayBufferReader(e),r=0,a=0;n.ondata=function(e){var n=t(e);i.ontext&&i.ontext(n)},n.onend=function(){i.onend&&i.onend()},this.ontext=null,this.onend=null};var Guacamole=Guacamole||{};Guacamole.StringWriter=function(e){function t(e){if(s+e>=o.length){var t=new Uint8Array(2*(s+e));t.set(o),o=t}s+=e}function i(e){var n,r;if(e<=127)n=0,r=1;else if(e<=2047)n=192,r=2;else if(e<=65535)n=224,r=3;else{if(!(e<=2097151))return void i(65533);n=240,r=4}t(r);for(var a=s-1,l=1;l<r;l++)o[a--]=128|63&e,e>>=6;o[a]=n|e}function n(e){for(var t=0;t<e.length;t++){i(e.charCodeAt(t))}if(s>0){var n=o.subarray(0,s);return s=0,n}}var r=this,a=new Guacamole.ArrayBufferWriter(e),o=new Uint8Array(8192),s=0;a.onack=function(e){r.onack&&r.onack(e)},this.sendText=function(e){e.length&&a.sendData(n(e))},this.sendEnd=function(){a.sendEnd()},this.onack=null};var Guacamole=Guacamole||{};Guacamole.Tunnel=function(){this.connect=function(e){},this.disconnect=function(){},this.sendMessage=function(e){},this.setState=function(e){e!==this.state&&(this.state=e,this.onstatechange&&this.onstatechange(e))},this.setUUID=function(e){this.uuid=e,this.onuuid&&this.onuuid(e)},this.isConnected=function(){return this.state===Guacamole.Tunnel.State.OPEN||this.state===Guacamole.Tunnel.State.UNSTABLE},this.state=Guacamole.Tunnel.State.CONNECTING,this.receiveTimeout=15e3,this.unstableThreshold=1500,this.uuid=null,this.onuuid=null,this.onerror=null,this.onstatechange=null,this.oninstruction=null},Guacamole.Tunnel.INTERNAL_DATA_OPCODE="",Guacamole.Tunnel.State={CONNECTING:0,OPEN:1,CLOSED:2,UNSTABLE:3},Guacamole.HTTPTunnel=function(e,t,i){function n(e,t){for(var i in t)e.setRequestHeader(i,t[i])}function r(){window.clearTimeout(b),window.clearTimeout(w),u.state===Guacamole.Tunnel.State.UNSTABLE&&u.setState(Guacamole.Tunnel.State.OPEN),b=window.setTimeout(function(){a(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_TIMEOUT,"Server timeout."))},u.receiveTimeout),w=window.setTimeout(function(){u.setState(Guacamole.Tunnel.State.UNSTABLE)},u.unstableThreshold)}function a(e){window.clearTimeout(b),window.clearTimeout(w),window.clearInterval(x),u.state!==Guacamole.Tunnel.State.CLOSED&&(e.code!==Guacamole.Status.Code.SUCCESS&&u.onerror&&(u.state!==Guacamole.Tunnel.State.CONNECTING&&e.code===Guacamole.Status.Code.RESOURCE_NOT_FOUND||u.onerror(e)),v=!1,u.setState(Guacamole.Tunnel.State.CLOSED))}function o(){if(u.isConnected())if(y.length>0){v=!0;var e=new XMLHttpRequest;e.open("POST",p+u.uuid),e.withCredentials=_,n(e,k),e.setRequestHeader("Content-type","application/octet-stream"),e.onreadystatechange=function(){4===e.readyState&&(r(),200!==e.status?s(e):o())},e.send(y),y=""}else v=!1}function s(e){var t=parseInt(e.getResponseHeader("Guacamole-Status-Code"));if(t){var i=e.getResponseHeader("Guacamole-Error-Message");a(new Guacamole.Status(t,i))}else a(e.status?new Guacamole.Status(Guacamole.Status.Code.fromHTTPCode(e.status),e.statusText):new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_NOT_FOUND))}function l(e){function t(){if(!u.isConnected())return void(null!==i&&clearInterval(i));if(!(e.readyState<2)){var a;try{a=e.status}catch(e){a=200}if(n||200!==a||(n=c()),3===e.readyState||4===e.readyState){if(r(),g===f&&(3!==e.readyState||i?4===e.readyState&&i&&clearInterval(i):i=setInterval(t,30)),0===e.status)return void u.disconnect();if(200!==e.status)return void s(e);var p;try{p=e.responseText}catch(e){return}for(;o<p.length;){if(o>=d){var m=p.substring(d,o),v=p.substring(o,o+1);if(h.push(m),";"===v){var y=h.shift();u.oninstruction&&u.oninstruction(y,h),h.length=0}d=o+1}var _=p.indexOf(".",d);if(-1===_){d=p.length;break}var b=parseInt(p.substring(o+1,_));if(0===b){i&&clearInterval(i),e.onreadystatechange=null,e.abort(),n&&l(n);break}d=_+1,o=d+b}}}}var i=null,n=null,a=0,o=-1,d=0,h=new Array;e.onreadystatechange=g===f?function(){3===e.readyState&&++a>=2&&(g=m,e.onreadystatechange=t),t()}:t,t()}function c(){var e=new XMLHttpRequest;return e.open("GET",h+u.uuid+":"+C++),e.withCredentials=_,n(e,k),e.send(null),e}var u=this,d=e+"?connect",h=e+"?read:",p=e+"?write:",f=1,m=0,g=f,v=!1,y="",_=!!t,b=null,w=null,x=null,k=i||{};this.sendMessage=function(){function e(e){var t=new String(e);return t.length+"."+t}if(u.isConnected()&&0!==arguments.length){for(var t=e(arguments[0]),i=1;i<arguments.length;i++)t+=","+e(arguments[i]);t+=";",y+=t,v||o()}};var C=0;this.connect=function(e){r(),u.setState(Guacamole.Tunnel.State.CONNECTING);var t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===t.readyState){if(200!==t.status)return void s(t);r(),u.setUUID(t.responseText),u.setState(Guacamole.Tunnel.State.OPEN),x=setInterval(function(){u.sendMessage("nop")},500),l(c())}},t.open("POST",d,!0),t.withCredentials=_,n(t,k),t.setRequestHeader("Content-type","application/x-www-form-urlencoded; charset=UTF-8"),t.send(e)},this.disconnect=function(){a(new Guacamole.Status(Guacamole.Status.Code.SUCCESS,"Manually closed."))}},Guacamole.HTTPTunnel.prototype=new Guacamole.Tunnel,Guacamole.WebSocketTunnel=function(e){function t(){window.clearTimeout(a),window.clearTimeout(o),n.state===Guacamole.Tunnel.State.UNSTABLE&&n.setState(Guacamole.Tunnel.State.OPEN),a=window.setTimeout(function(){i(new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_TIMEOUT,"Server timeout."))},n.receiveTimeout),o=window.setTimeout(function(){n.setState(Guacamole.Tunnel.State.UNSTABLE)},n.unstableThreshold)}function i(e){window.clearTimeout(a),window.clearTimeout(o),window.clearInterval(s),n.state!==Guacamole.Tunnel.State.CLOSED&&(e.code!==Guacamole.Status.Code.SUCCESS&&n.onerror&&n.onerror(e),n.setState(Guacamole.Tunnel.State.CLOSED),r.close())}var n=this,r=null,a=null,o=null,s=null,l={"http:":"ws:","https:":"wss:"};if("ws:"!==e.substring(0,3)&&"wss:"!==e.substring(0,4)){var c=l[window.location.protocol];if("/"===e.substring(0,1))e=c+"//"+window.location.host+e;else{var u=window.location.pathname.lastIndexOf("/"),d=window.location.pathname.substring(0,u+1);e=c+"//"+window.location.host+d+e}}this.sendMessage=function(e){function t(e){var t=new String(e);return t.length+"."+t}if(n.isConnected()&&0!==arguments.length){for(var i=t(arguments[0]),a=1;a<arguments.length;a++)i+=","+t(arguments[a]);i+=";",r.send(i)}},this.connect=function(a){t(),n.setState(Guacamole.Tunnel.State.CONNECTING),r=new WebSocket(e+"?"+a,"guacamole"),r.onopen=function(e){t(),s=setInterval(function(){n.sendMessage(Guacamole.Tunnel.INTERNAL_DATA_OPCODE,"ping",(new Date).getTime())},500)},r.onclose=function(e){i(e.reason?new Guacamole.Status(parseInt(e.reason),e.reason):e.code?new Guacamole.Status(Guacamole.Status.Code.fromWebSocketCode(e.code)):new Guacamole.Status(Guacamole.Status.Code.UPSTREAM_NOT_FOUND))},r.onmessage=function(e){t();var r,a=e.data,o=0,s=[];do{var l=a.indexOf(".",o);if(-1!==l){var c=parseInt(a.substring(r+1,l));o=l+1,r=o+c}else i(new Guacamole.Status(Guacamole.Status.Code.SERVER_ERROR,"Incomplete instruction."));var u=a.substring(o,r),d=a.substring(r,r+1);if(s.push(u),";"===d){var h=s.shift();null===n.uuid&&(h===Guacamole.Tunnel.INTERNAL_DATA_OPCODE&&n.setUUID(s[0]),n.setState(Guacamole.Tunnel.State.OPEN)),h!==Guacamole.Tunnel.INTERNAL_DATA_OPCODE&&n.oninstruction&&n.oninstruction(h,s),s.length=0}o=r+1}while(o<a.length)}},this.disconnect=function(){i(new Guacamole.Status(Guacamole.Status.Code.SUCCESS,"Manually closed."))}},Guacamole.WebSocketTunnel.prototype=new Guacamole.Tunnel,Guacamole.ChainedTunnel=function(e){function t(e){function o(){e.onstatechange=n.onstatechange,e.oninstruction=n.oninstruction,e.onerror=n.onerror,e.onuuid=n.onuuid,e.uuid&&n.setUUID(e.uuid),a=e}n.disconnect=e.disconnect,n.sendMessage=e.sendMessage;var s=function(i){if(i&&i.code===Guacamole.Status.Code.UPSTREAM_TIMEOUT)return r=[],null;var n=r.shift();return n&&(e.onerror=null,e.oninstruction=null,e.onstatechange=null,t(n)),n};e.onstatechange=function(e){switch(e){case Guacamole.Tunnel.State.OPEN:o(),n.onstatechange&&n.onstatechange(e);break;case Guacamole.Tunnel.State.CLOSED:!s()&&n.onstatechange&&n.onstatechange(e)}},e.oninstruction=function(e,t){o(),n.oninstruction&&n.oninstruction(e,t)},e.onerror=function(e){!s(e)&&n.onerror&&n.onerror(e)},e.connect(i)}for(var i,n=this,r=[],a=null,o=0;o<arguments.length;o++)r.push(arguments[o]);this.connect=function(e){i=e;var o=a||r.shift();o?t(o):n.onerror&&n.onerror(Guacamole.Status.Code.SERVER_ERROR,"No tunnels to try.")}},Guacamole.ChainedTunnel.prototype=new Guacamole.Tunnel,Guacamole.StaticHTTPTunnel=function(e,t,i){function n(e,t){for(var i in t)e.setRequestHeader(i,t[i])}var r=this,a=null,o=i||{};this.sendMessage=function(e){},this.connect=function(i){r.disconnect(),r.setState(Guacamole.Tunnel.State.CONNECTING),a=new XMLHttpRequest,a.open("GET",e),a.withCredentials=!!t,n(a,o),a.responseType="text",a.send(null);var s=0,l=new Guacamole.Parser;l.oninstruction=function(e,t){r.oninstruction&&r.oninstruction(e,t)},a.onreadystatechange=function(){if(3===a.readyState||4===a.readyState){r.setState(Guacamole.Tunnel.State.OPEN);var e=a.responseText,t=e.length;s<t&&(l.receive(e.substring(s)),s=t)}4===a.readyState&&r.disconnect()},a.onerror=function(){r.onerror&&r.onerror(new Guacamole.Status(Guacamole.Status.Code.fromHTTPCode(a.status),a.statusText)),r.disconnect()}},this.disconnect=function(){a&&(a.abort(),a=null),r.setState(Guacamole.Tunnel.State.CLOSED)}},Guacamole.StaticHTTPTunnel.prototype=new Guacamole.Tunnel;var Guacamole=Guacamole||{};Guacamole.API_VERSION="1.3.0";var Guacamole=Guacamole||{};Guacamole.VideoPlayer=function(){this.sync=function(){}},Guacamole.VideoPlayer.isSupportedType=function(e){return!1},Guacamole.VideoPlayer.getSupportedTypes=function(){return[]},Guacamole.VideoPlayer.getInstance=function(e,t,i){return null},define("guacamole",function(){}),define("modules/console/expdesktop/service",["network-utils","jquery","modules/utils/baseservice"],function(e,t,i){var n=function(e){this.dataControl=e};return n.prototype={video_test:function(t){return e.doGet("/ecos/qcec/v1/video_test/",t)},video_study_record:function(t){return e.doGet("/ecos/qcec/v1/video_study_record/",t)},step_video:function(t){return e.doGet("/ecos/qcec/v1/video/",t)},step_test:function(t){return e.doGet("/ecos/qcec_console_nsq/v1/step_test/"+t)},submit_step_test:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/step_test/",t)},reportAttachment:function(t){return e.doGet("/ecos/qcec/v1/report_attach",t)},deleteattachment:function(t){return e.doDelete("/ecos/qcec/v1/report_attach",t)},report_attach:function(t){return e.doPost("/ecos/qcec/v1/report_attach",t)},overtime_server:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/course_step/delay_time",t)},lab_save_list:function(t){return e.doGet("/ecos/qcec_console_nsq/v1/lab_save",t)},recover_lab:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/recover_lab",t)},delete_lab:function(t){return e.doDelete("/ecos/qcec_console_nsq/v1/lab_save",t)},post_lab_save:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/lab_save",t)},createreport:function(t){return e.doPost("/ecos/qcec/v1/report",t)},expReportList:function(t){return e.doGet("/ecos/qcec/v1/report",t)},changeEreport:function(t,i){return e.doPut("/ecos/qcec/v1/report/"+t,i)},getCommentList:function(t){return e.doGet("/ecos/qcec_noauth/noauth/comment",t)},createComment:function(t){return e.doPost("/ecos/qcec/v1/comment",t)},getcourse:function(t,i){return e.doGet("/ecos/qcec/v1/course/"+t,i)},getTeacherInfo:function(t){return e.doGet("/ecos/qcec_noauth/noauth/user/get_provider/",{course_id:t})},createScore:function(t){return e.doPost("/ecos/qcec/v1/mark",t)},isCreateScore:function(t){return e.doGet("/ecos/qcec/v1/mark",t)},updateScore:function(t,i){return e.doPut("/ecos/qcec/v1/mark/"+t,i)},step_attachment:function(t){return e.doGet("/ecos/qcec/v1/step_attachment/",t)},step_code_server:function(t){return e.doGet("/ecos/qcec/v1/upload_file/get_files",t)},upload_file:function(t){return e.doGet("/ecos/qcec/v1/upload_file",t)},step_code_upload:function(t){return e.doPost("/step_code_upload/",t)},exchange_vpn:function(t){return e.doPost("/ecos/qcec_console_vpn/v1/vpn",t)},get_vpn:function(t){return e.doGet("/ecos/qcec_console_vpn/v1/vpn",t)},change_vpnpwd:function(t){return e.doPut("/ecos/qcec_console_vpn/v1/vpn/",t)},download_vpnconfig:function(t){return e.doUnescapeGet("/ecos/qcec_console_vpn/v1/vpn/download",t)},self_clean_resource:function(t){return e.doDelete("/ecos/qcec_console_nsq/v1/course_step/self_clean_resource",null,null,null,t)},get_shanhe_ws_region:function(){var t={uid:"usr-JmBnpZBb",sid:"FZlvYkQk5NeaACYhRrsKIDE6tNh3X0Z5",zid:"jn1",t:"1625797491725"};return e.doGetNoJson("/shanhe_ws/socket.io/1/",t)},create_shanhe_vm:function(){var t={params:'{"instances":["i-vsvif3cp"],"owner":"usr-9WC3zjpI","zone":"jn1","action":"StartInstances"}'};(new FormData).append("params",'{"instances":["i-vsvif3cp"],"owner":"usr-9WC3zjpI","zone":"jn1","action":"StartInstances"}');JSON.stringify(t);return e.doPostForm("/shanhe_api/api/?action=StartInstances",'params={"instances":["i-vsvif3cp"],"owner":"usr-9WC3zjpI","zone":"jn1","action":"StartInstances"}')}},t.extend(n.prototype,i.prototype),n}),"function"!=typeof Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),function(e,t,i,n){var r={init:function(t,i){var n=this;n.elem=i,n.$elem=e(i),n.options=e.extend({},e.fn.toolbar.options,t),n.metadata=n.$elem.data(),n.overrideOptions(),n.toolbar=e('<div class="tool-container" />').addClass("tool-"+n.options.position).addClass("toolbar-"+n.options.style).append('<div class="tool-items" />').append('<div class="arrow" />').appendTo("body").css("opacity",0).hide(),n.toolbar_arrow=n.toolbar.find(".arrow"),n.initializeToolbar()},overrideOptions:function(){var t=this;e.each(t.options,function(e){void 0!==t.$elem.data("toolbar-"+e)&&(t.options[e]=t.$elem.data("toolbar-"+e))})},initializeToolbar:function(){var e=this;e.populateContent(),e.setTrigger(),e.toolbarWidth=e.toolbar.width()},setTrigger:function(){function i(){n.$elem.hasClass("pressed")?r=setTimeout(function(){n.hide()},150):clearTimeout(r)}function i(){n.$elem.hasClass("pressed")?r=setTimeout(function(){n.hide()},150):clearTimeout(r)}var n=this;if("click"!=n.options.event){var r;n.$elem.on({mouseenter:function(e){n.$elem.hasClass("pressed")?clearTimeout(r):n.show()}}),n.$elem.parent().on({mouseleave:function(e){i()},mousedown:function(e){n.$elem.trigger("toolbarItemClick",[this,n])}}),e(".tool-container").on({mouseenter:function(e){clearTimeout(r)}})}if("click"==n.options.event&&(n.$elem.on("click",function(e){e.preventDefault(),n.$elem.hasClass("pressed")?n.hide():n.show()}),n.options.hideOnClick&&e("html").on("click.toolbar",function(e){e.target!=n.elem&&0===n.$elem.has(e.target).length&&0===n.toolbar.has(e.target).length&&n.toolbar.is(":visible")&&n.hide()})),n.options.hover){var r;n.$elem.on({mouseenter:function(e){n.$elem.hasClass("pressed")?clearTimeout(r):n.show()}}),n.$elem.parent().on({mouseleave:function(e){i()}}),e(".tool-container").on({mouseenter:function(e){clearTimeout(r)},mouseleave:function(e){i()}})}e(t).resize(function(e){e.stopPropagation(),n.toolbar.is(":visible")&&(n.toolbarCss=n.getCoordinates(n.options.position,20),n.collisionDetection(),n.toolbar.css(n.toolbarCss),n.toolbar_arrow.css(n.arrowCss))})},populateContent:function(){var t=this,i=t.toolbar.find(".tool-items"),n=e(t.options.content).clone(!0).find("a").addClass("tool-item");i.html(n),i.find(".tool-item").on("click",function(e){e.preventDefault(),t.$elem.trigger("toolbarItemClick",[this,t])})},calculatePosition:function(){var e=this;e.arrowCss={},e.toolbarCss=e.getCoordinates(e.options.position,e.options.adjustment),e.toolbarCss.position="absolute",e.toolbarCss.zIndex=e.options.zIndex,e.collisionDetection(),e.toolbar.css(e.toolbarCss),e.toolbar_arrow.css(e.arrowCss)},getCoordinates:function(e,t){var i=this;switch(i.coordinates=i.$elem.offset(),i.options.adjustment&&i.options.adjustment[i.options.position]&&(t=i.options.adjustment[i.options.position]+t),i.options.position){case"top":return{left:i.coordinates.left-i.toolbar.width()/2+i.$elem.outerWidth()/2,top:i.coordinates.top-i.$elem.outerHeight()-t,right:"auto"};case"left":return{left:i.coordinates.left-i.toolbar.width()/2-i.$elem.outerWidth()/2-t,top:i.coordinates.top-i.toolbar.height()/2+i.$elem.outerHeight()/2,right:"auto"};case"right":return{left:i.coordinates.left+i.toolbar.width()/2+i.$elem.outerWidth()/2+t,top:i.coordinates.top-i.toolbar.height()/2+i.$elem.outerHeight()/2,right:"auto"};case"bottom":return{left:i.coordinates.left-i.toolbar.width()/2+i.$elem.outerWidth()/2,top:i.coordinates.top+i.$elem.outerHeight()+t,right:"auto"}}},collisionDetection:function(){var i=this;"top"!=i.options.position&&"bottom"!=i.options.position||(i.arrowCss={left:"50%",right:"50%"},i.toolbarCss.left<20?(i.toolbarCss.left=20,i.arrowCss.left=i.$elem.offset().left+i.$elem.width()/2-20):e(t).width()-(i.toolbarCss.left+i.toolbarWidth)<20&&(i.toolbarCss.right=20,i.toolbarCss.left="auto",i.arrowCss.left="auto",i.arrowCss.right=e(t).width()-i.$elem.offset().left-i.$elem.width()/2-20-5))},show:function(){var e=this;e.$elem.addClass("pressed"),e.calculatePosition(),e.toolbar.show().css({opacity:1}).addClass("animate-"+e.options.animation),e.$elem.trigger("toolbarShown")},hide:function(){var e=this,t={opacity:0};switch(e.$elem.removeClass("pressed"),e.options.position){case"top":t.top="+=20";break;case"left":t.left="+=20";break;case"right":t.left="-=20";break;case"bottom":t.top="-=20"}e.toolbar.animate(t,200,function(){e.toolbar.hide()}),e.$elem.trigger("toolbarHidden")},getToolbarElement:function(){return this.toolbar.find(".tool-items")}};e.fn.toolbar=function(t){if(e.isPlainObject(t))return this.each(function(){var i=Object.create(r);i.init(t,this),e(this).data("toolbarObj",i)});if("string"==typeof t&&0!==t.indexOf("_")){var i=e(this).data("toolbarObj");return i[t].apply(i,e.makeArray(arguments).slice(1))}},e.fn.toolbar.options={content:"#myContent",position:"top",hideOnClick:!1,zIndex:20000324,hover:!1,style:"default",animation:"standard",adjustment:10}}(jQuery,window,document),define("toolbar",function(){}),function(e,t){function i(t,i){var r,a,o,s=t.nodeName.toLowerCase();return"area"===s?(r=t.parentNode,a=r.name,!(!t.href||!a||"map"!==r.nodeName.toLowerCase())&&(!!(o=e("img[usemap=#"+a+"]")[0])&&n(o))):(/input|select|textarea|button|object/.test(s)?!t.disabled:"a"===s?t.href||i:i)&&n(t)}function n(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var r=0,a=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,n){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),n&&n.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(t){if(void 0!==t)return this.css("zIndex",t);if(this.length)for(var i,n,r=e(this[0]);r.length&&r[0]!==document;){if(("absolute"===(i=r.css("position"))||"relative"===i||"fixed"===i)&&(n=parseInt(r.css("zIndex"),10),!isNaN(n)&&0!==n))return n;r=r.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++r)})},removeUniqueId:function(){return this.each(function(){a.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,n){return!!e.data(t,n[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(t,i){function n(t,i,n,a){return e.each(r,function(){i-=parseFloat(e.css(t,"padding"+this))||0,n&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var r="Width"===i?["Left","Right"]:["Top","Bottom"],a=i.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+i]=function(t){return void 0===t?o["inner"+i].call(this):this.each(function(){e(this).css(a,n(this,t)+"px")})},e.fn["outer"+i]=function(t,r){return"number"!=typeof t?o["outer"+i].call(this,t):this.each(function(){e(this).css(a,n(this,t,!0,r)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,n){var r,a=e.ui[t].prototype;for(r in n)a.plugins[r]=a.plugins[r]||[],a.plugins[r].push([i,n[r]])},call:function(e,t,i){var n,r=e.plugins[t];if(r&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(n=0;n<r.length;n++)e.options[r[n][0]]&&r[n][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",r=!1;return t[n]>0||(t[n]=1,r=t[n]>0,t[n]=0,r)}})}(jQuery),function(e,t){var i=0,n=Array.prototype.slice,r=e.cleanData;e.cleanData=function(t){for(var i,n=0;null!=(i=t[n]);n++)try{e(i).triggerHandler("remove")}catch(e){}r(t)},e.widget=function(t,i,n){var r,a,o,s,l={},c=t.split(".")[0];t=t.split(".")[1],r=c+"-"+t,n||(n=i,i=e.Widget),e.expr[":"][r.toLowerCase()]=function(t){return!!e.data(t,r)},e[c]=e[c]||{},a=e[c][t],o=e[c][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,a,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),s=new i,s.options=e.widget.extend({},s.options),e.each(n,function(t,n){if(!e.isFunction(n))return void(l[t]=n);l[t]=function(){var e=function(){return i.prototype[t].apply(this,arguments)},r=function(e){return i.prototype[t].apply(this,e)};return function(){var t,i=this._super,a=this._superApply;return this._super=e,this._superApply=r,t=n.apply(this,arguments),this._super=i,this._superApply=a,t}}()}),o.prototype=e.widget.extend(s,{widgetEventPrefix:a?s.widgetEventPrefix:t},l,{constructor:o,namespace:c,widgetName:t,widgetFullName:r}),a?(e.each(a._childConstructors,function(t,i){var n=i.prototype;e.widget(n.namespace+"."+n.widgetName,o,i._proto)}),delete a._childConstructors):i._childConstructors.push(o),e.widget.bridge(t,o)},e.widget.extend=function(t){for(var i,r,a=n.call(arguments,1),o=0,s=a.length;o<s;o++)for(i in a[o])r=a[o][i],a[o].hasOwnProperty(i)&&void 0!==r&&(e.isPlainObject(r)?t[i]=e.isPlainObject(t[i])?e.widget.extend({},t[i],r):e.widget.extend({},r):t[i]=r);return t},e.widget.bridge=function(t,i){var r=i.prototype.widgetFullName||t;e.fn[t]=function(a){var o="string"==typeof a,s=n.call(arguments,1),l=this;return a=!o&&s.length?e.widget.extend.apply(null,[a].concat(s)):a,o?this.each(function(){var i,n=e.data(this,r);return n?e.isFunction(n[a])&&"_"!==a.charAt(0)?(i=n[a].apply(n,s),i!==n&&void 0!==i?(l=i&&i.jquery?l.pushStack(i.get()):i,!1):void 0):e.error("no such method '"+a+"' for "+t+" widget instance"):e.error("cannot call methods on "+t+" prior to initialization; attempted to call method '"+a+"'")}):this.each(function(){var t=e.data(this,r);t?t.option(a||{})._init():e.data(this,r,new i(a,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,n){n=e(n||this.defaultElement||this)[0],this.element=e(n),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),n!==this&&(e.data(n,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===n&&this.destroy()}}),this.document=e(n.style?n.ownerDocument:n.document||n),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(t,i){var n,r,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},n=t.split("."),t=n.shift(),n.length){for(r=o[t]=e.widget.extend({},this.options[t]),a=0;a<n.length-1;a++)r[n[a]]=r[n[a]]||{},r=r[n[a]];if(t=n.pop(),void 0===i)return void 0===r[t]?null:r[t];r[t]=i}else{if(void 0===i)return void 0===this.options[t]?null:this.options[t];o[t]=i}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(t,i,n){var r,a=this;"boolean"!=typeof t&&(n=i,i=t,t=!1),n?(i=r=e(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,r=this.widget()),e.each(n,function(n,o){function s(){if(t||!0!==a.options.disabled&&!e(this).hasClass("ui-state-disabled"))return("string"==typeof o?a[o]:o).apply(a,arguments)}"string"!=typeof o&&(s.guid=o.guid=o.guid||s.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?r.delegate(u,c,s):i.bind(c,s)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?n[e]:e).apply(n,arguments)}var n=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,n){var r,a,o=this.options[t];if(n=n||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(r in a)r in i||(i[r]=a[r]);return this.element.trigger(i,n),!(e.isFunction(o)&&!1===o.apply(this.element[0],[i].concat(n))||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(n,r,a){"string"==typeof r&&(r={effect:r});var o,s=r?!0===r||"number"==typeof r?i:r.effect||i:t;r=r||{},"number"==typeof r&&(r={duration:r}),o=!e.isEmptyObject(r),r.complete=a,r.delay&&n.delay(r.delay),o&&e.effects&&e.effects.effect[s]?n[t](r):s!==t&&n[s]?n[s](r.duration,r.easing,a):n.queue(function(i){e(this)[t](),a&&a.call(n[0]),i()})}})}(jQuery),function(e,t){var i=!1;e(document).mouseup(function(){i=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){if(!0===e.data(i.target,t.widgetName+".preventClickEvent"))return e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!i){this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var n=this,r=1===t.which,a=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&e(t.target).closest(this.options.cancel).length;return!(r&&!a&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){n.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return n._mouseMove(e)},this._mouseUpDelegate=function(e){return n._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),i=!0,!0))}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,
|
||
t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}(jQuery),function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(t){var i=this.options;return!(this.helper||i.disabled||e(t.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(t),!!this.handle&&(e(!0===i.iframeFix?"iframe":i.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0))},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var n=this._uiHash();if(!1===this._trigger("drag",t,n))return this._mouseUp({}),!1;this.position=n.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,n=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(n=e.ui.ddmanager.drop(this,t)),this.dropped&&(n=this.dropped,this.dropped=!1),!("original"===this.options.helper&&!e.contains(this.element[0].ownerDocument,this.element[0]))&&("invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||!0===this.options.revert||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",t)&&i._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1)},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!e(t.target).closest(this.element.find(this.options.handle)).length},_createHelper:function(t){var i=this.options,n=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,n,r=this.options;return r.containment?"window"===r.containment?void(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===r.containment?void(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):r.containment.constructor===Array?void(this.containment=r.containment):("parent"===r.containment&&(r.containment=this.helper[0].parentNode),i=e(r.containment),void((n=i[0])&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i))):void(this.containment=null)},_convertPositionTo:function(t,i){i||(i=this.position);var n="absolute"===t?1:-1,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*n}},_generatePosition:function(t){var i,n,r,a,o=this.options,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=t.pageX,c=t.pageY;return this.offset.scroll||(this.offset.scroll={top:s.scrollTop(),left:s.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(n=this.relative_container.offset(),i=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(c=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(c=i[3]+this.offset.click.top)),o.grid&&(r=o.grid[1]?this.originalPageY+Math.round((c-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,c=i?r-this.offset.click.top>=i[1]||r-this.offset.click.top>i[3]?r:r-this.offset.click.top>=i[1]?r-o.grid[1]:r+o.grid[1]:r,a=o.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,l=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,n){return n=n||this._uiHash(),e.ui.plugin.call(this,t,[i,n]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var n=e(this).data("ui-draggable"),r=n.options,a=e.extend({},i,{item:n.element});n.sortables=[],e(r.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(n.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var n=e(this).data("ui-draggable"),r=e.extend({},i,{item:n.element});e.each(n.sortables,function(){this.instance.isOver?(this.instance.isOver=0,n.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===n.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,r))})},drag:function(t,i){var n=e(this).data("ui-draggable"),r=this;e.each(n.sortables,function(){var a=!1,o=this;this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(n.sortables,function(){return this.instance.positionAbs=n.positionAbs,this.instance.helperProportions=n.helperProportions,this.instance.offset.click=n.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(r).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=n.offset.click.top,this.instance.offset.click.left=n.offset.click.left,this.instance.offset.parent.left-=n.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=n.offset.parent.top-this.instance.offset.parent.top,n._trigger("toSortable",t),n.dropped=this.instance.element,n.currentItem=n.element,this.instance.fromOutside=n),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),n._trigger("fromSortable",t),n.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var n=e(i.helper),r=e(this).data("ui-draggable").options;n.css("opacity")&&(r._opacity=n.css("opacity")),n.css("opacity",r.opacity)},stop:function(t,i){var n=e(this).data("ui-draggable").options;n._opacity&&e(i.helper).css("opacity",n._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),n=i.options,r=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(n.axis&&"x"===n.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY<n.scrollSensitivity?i.scrollParent[0].scrollTop=r=i.scrollParent[0].scrollTop+n.scrollSpeed:t.pageY-i.overflowOffset.top<n.scrollSensitivity&&(i.scrollParent[0].scrollTop=r=i.scrollParent[0].scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(i.overflowOffset.left+i.scrollParent[0].offsetWidth-t.pageX<n.scrollSensitivity?i.scrollParent[0].scrollLeft=r=i.scrollParent[0].scrollLeft+n.scrollSpeed:t.pageX-i.overflowOffset.left<n.scrollSensitivity&&(i.scrollParent[0].scrollLeft=r=i.scrollParent[0].scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(t.pageY-e(document).scrollTop()<n.scrollSensitivity?r=e(document).scrollTop(e(document).scrollTop()-n.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<n.scrollSensitivity&&(r=e(document).scrollTop(e(document).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(t.pageX-e(document).scrollLeft()<n.scrollSensitivity?r=e(document).scrollLeft(e(document).scrollLeft()-n.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<n.scrollSensitivity&&(r=e(document).scrollLeft(e(document).scrollLeft()+n.scrollSpeed)))),!1!==r&&e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(i,t)}}),e.ui.plugin.add("draggable","snap",{start:function(){var t=e(this).data("ui-draggable"),i=t.options;t.snapElements=[],e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var i=e(this),n=i.offset();this!==t.element[0]&&t.snapElements.push({item:this,width:i.outerWidth(),height:i.outerHeight(),top:n.top,left:n.left})})},drag:function(t,i){var n,r,a,o,s,l,c,u,d,h,p=e(this).data("ui-draggable"),f=p.options,m=f.snapTolerance,g=i.offset.left,v=g+p.helperProportions.width,y=i.offset.top,_=y+p.helperProportions.height;for(d=p.snapElements.length-1;d>=0;d--)s=p.snapElements[d].left,l=s+p.snapElements[d].width,c=p.snapElements[d].top,u=c+p.snapElements[d].height,v<s-m||g>l+m||_<c-m||y>u+m||!e.contains(p.snapElements[d].item.ownerDocument,p.snapElements[d].item)?(p.snapElements[d].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=Math.abs(c-_)<=m,r=Math.abs(u-y)<=m,a=Math.abs(s-v)<=m,o=Math.abs(l-g)<=m,n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),r&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:s-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),h=n||r||a||o,"outer"!==f.snapMode&&(n=Math.abs(c-y)<=m,r=Math.abs(u-_)<=m,a=Math.abs(s-g)<=m,o=Math.abs(l-v)<=m,n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),r&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:s}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[d].snapping&&(n||r||a||o||h)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[d].item})),p.snapElements[d].snapping=n||r||a||o||h)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,n=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});n.length&&(t=parseInt(e(n[0]).css("zIndex"),10)||0,e(n).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+n.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var n=e(i.helper),r=e(this).data("ui-draggable").options;n.css("zIndex")&&(r._zIndex=n.css("zIndex")),n.css("zIndex",r.zIndex)},stop:function(t,i){var n=e(this).data("ui-draggable").options;n._zIndex&&e(i.helper).css("zIndex",n._zIndex)}})}(jQuery),function(e,t){function i(e,t,i){return e>t&&e<t+i}e.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];t<i.length;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var n=i||e.ui.ddmanager.current,r=!1;return!(!n||(n.currentItem||n.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");if(t.options.greedy&&!t.options.disabled&&t.options.scope===n.options.scope&&t.accept.call(t.element[0],n.currentItem||n.element)&&e.ui.intersect(n,e.extend(t,{offset:t.element.offset()}),t.options.tolerance))return r=!0,!1}),!r&&(!!this.accept.call(this.element[0],n.currentItem||n.element)&&(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(n)),this.element)))},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,t,n){if(!t.offset)return!1;var r,a,o=(e.positionAbs||e.position.absolute).left,s=o+e.helperProportions.width,l=(e.positionAbs||e.position.absolute).top,c=l+e.helperProportions.height,u=t.offset.left,d=u+t.proportions.width,h=t.offset.top,p=h+t.proportions.height;switch(n){case"fit":return u<=o&&s<=d&&h<=l&&c<=p;case"intersect":return u<o+e.helperProportions.width/2&&s-e.helperProportions.width/2<d&&h<l+e.helperProportions.height/2&&c-e.helperProportions.height/2<p;case"pointer":return r=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,a=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,i(a,h,t.proportions.height)&&i(r,u,t.proportions.width);case"touch":return(l>=h&&l<=p||c>=h&&c<=p||l<h&&c>p)&&(o>=u&&o<=d||s>=u&&s<=d||o<u&&s>d);default:return!1}},e.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(t,i){var n,r,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,s=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(n=0;n<a.length;n++)if(!(a[n].options.disabled||t&&!a[n].accept.call(a[n].element[0],t.currentItem||t.element))){for(r=0;r<s.length;r++)if(s[r]===a[n].element[0]){a[n].proportions.height=0;continue e}a[n].visible="none"!==a[n].element.css("display"),a[n].visible&&("mousedown"===o&&a[n]._activate.call(a[n],i),a[n].offset=a[n].element.offset(),a[n].proportions={width:a[n].element[0].offsetWidth,height:a[n].element[0].offsetHeight})}},drop:function(t,i){var n=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(n=this._drop.call(this,i)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),n},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,r,a,o=e.ui.intersect(t,this,this.options.tolerance),s=!o&&this.isover?"isout":o&&!this.isover?"isover":null;s&&(this.options.greedy&&(r=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===r}),a.length&&(n=e.data(a[0],"ui-droppable"),n.greedyChild="isover"===s)),n&&"isover"===s&&(n.isover=!1,n.isout=!0,n._out.call(n,i)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,i),n&&"isout"===s&&(n.isout=!1,n.isover=!0,n._over.call(n,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}}(jQuery),function(e,t){function i(e){return parseInt(e,10)||0}function n(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,n,r,a,o=this,s=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!s.aspectRatio,aspectRatio:s.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:s.helper||s.ghost||s.animate?s.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=s.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;i<t.length;i++)n=e.trim(t[i]),a="ui-resizable-"+n,r=e("<div class='ui-resizable-handle "+a+"'></div>"),r.css({zIndex:s.zIndex}),"se"===n&&r.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[n]=".ui-resizable-"+n,this.element.append(r);this._renderAxis=function(t){var i,n,r,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(n=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth(),r=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(r,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(r=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=r&&r[1]?r[1]:"se")}),s.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){s.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){s.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,n,r=!1;for(i in this.handles)((n=e(this.handles[i])[0])===t.target||e.contains(n,t.target))&&(r=!0);return!this.options.disabled&&r},_mouseStart:function(t){var n,r,a,o=this.options,s=this.element.position(),l=this.element;return this.resizing=!0,/absolute/.test(l.css("position"))?l.css({position:"absolute",top:l.css("top"),left:l.css("left")}):l.is(".ui-draggable")&&l.css({position:"absolute",top:s.top,left:s.left}),this._renderProxy(),n=i(this.helper.css("left")),r=i(this.helper.css("top")),o.containment&&(n+=e(o.containment).scrollLeft()||0,r+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:n,top:r},this.size=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalSize=this._helper?{width:l.outerWidth(),height:l.outerHeight()}:{width:l.width(),height:l.height()},this.originalPosition={left:n,top:r},this.sizeDiff={width:l.outerWidth()-l.width(),height:l.outerHeight()-l.height()},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===a?this.axis+"-resize":a),l.addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i,n=this.helper,r={},a=this.originalMousePosition,o=this.axis,s=this.position.top,l=this.position.left,c=this.size.width,u=this.size.height,d=t.pageX-a.left||0,h=t.pageY-a.top||0,p=this._change[o];return!!p&&(i=p.apply(this,[t,d,h]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==s&&(r.top=this.position.top+"px"),this.position.left!==l&&(r.left=this.position.left+"px"),this.size.width!==c&&(r.width=this.size.width+"px"),this.size.height!==u&&(r.height=this.size.height+"px"),n.css(r),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(r)||this._trigger("resize",t,this.ui()),!1)},_mouseStop:function(t){this.resizing=!1;var i,n,r,a,o,s,l,c=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,n=i.length&&/textarea/i.test(i[0].nodeName),r=n&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,a=n?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-r},s=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,l=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,c.animate||this.element.css(e.extend(o,{top:l,left:s})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!c.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,i,r,a,o,s=this.options;o={minWidth:n(s.minWidth)?s.minWidth:0,maxWidth:n(s.maxWidth)?s.maxWidth:1/0,minHeight:n(s.minHeight)?s.minHeight:0,maxHeight:n(s.maxHeight)?s.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,
|
||
r=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),r>o.minHeight&&(o.minHeight=r),i<o.maxWidth&&(o.maxWidth=i),a<o.maxHeight&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),n(e.left)&&(this.position.left=e.left),n(e.top)&&(this.position.top=e.top),n(e.height)&&(this.size.height=e.height),n(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,i=this.size,r=this.axis;return n(e.height)?e.width=e.height*this.aspectRatio:n(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===r&&(e.left=t.left+(i.width-e.width),e.top=null),"nw"===r&&(e.top=t.top+(i.height-e.height),e.left=t.left+(i.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,i=this.axis,r=n(e.width)&&t.maxWidth&&t.maxWidth<e.width,a=n(e.height)&&t.maxHeight&&t.maxHeight<e.height,o=n(e.width)&&t.minWidth&&t.minWidth>e.width,s=n(e.height)&&t.minHeight&&t.minHeight>e.height,l=this.originalPosition.left+this.originalSize.width,c=this.position.top+this.size.height,u=/sw|nw|w/.test(i),d=/nw|ne|n/.test(i);return o&&(e.width=t.minWidth),s&&(e.height=t.minHeight),r&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),o&&u&&(e.left=l-t.minWidth),r&&u&&(e.left=l-t.maxWidth),s&&d&&(e.top=c-t.minHeight),a&&d&&(e.top=c-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,n,r,a=this.helper||this.element;for(e=0;e<this._proportionallyResizeElements.length;e++){if(r=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[r.css("borderTopWidth"),r.css("borderRightWidth"),r.css("borderBottomWidth"),r.css("borderLeftWidth")],n=[r.css("paddingTop"),r.css("paddingRight"),r.css("paddingBottom"),r.css("paddingLeft")],t=0;t<i.length;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(n[t],10)||0);r.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("<div style='overflow:hidden;'></div>"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize;return{left:this.originalPosition.left+t,width:i.width-t}},n:function(e,t,i){var n=this.originalSize;return{top:this.originalPosition.top+i,height:n.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},sw:function(t,i,n){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,n]))},ne:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,n]))},nw:function(t,i,n){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,n]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),n=i.options,r=i._proportionallyResizeElements,a=r.length&&/textarea/i.test(r[0].nodeName),o=a&&e.ui.hasScroll(r[0],"left")?0:i.sizeDiff.height,s=a?0:i.sizeDiff.width,l={width:i.size.width-s,height:i.size.height-o},c=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(l,u&&c?{top:u,left:c}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};r&&r.length&&e(r[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var t,n,r,a,o,s,l,c=e(this).data("ui-resizable"),u=c.options,d=c.element,h=u.containment,p=h instanceof e?h.get(0):/parent/.test(h)?d.parent().get(0):h;p&&(c.containerElement=e(p),/document/.test(h)||h===document?(c.containerOffset={left:0,top:0},c.containerPosition={left:0,top:0},c.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(t=e(p),n=[],e(["Top","Right","Left","Bottom"]).each(function(e,r){n[e]=i(t.css("padding"+r))}),c.containerOffset=t.offset(),c.containerPosition=t.position(),c.containerSize={height:t.innerHeight()-n[3],width:t.innerWidth()-n[1]},r=c.containerOffset,a=c.containerSize.height,o=c.containerSize.width,s=e.ui.hasScroll(p,"left")?p.scrollWidth:o,l=e.ui.hasScroll(p)?p.scrollHeight:a,c.parentData={element:p,left:r.left,top:r.top,width:s,height:l}))},resize:function(t){var i,n,r,a,o=e(this).data("ui-resizable"),s=o.options,l=o.containerOffset,c=o.position,u=o._aspectRatio||t.shiftKey,d={top:0,left:0},h=o.containerElement;h[0]!==document&&/static/.test(h.css("position"))&&(d=l),c.left<(o._helper?l.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-l.left:o.position.left-d.left),u&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=s.helper?l.left:0),c.top<(o._helper?l.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-l.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?l.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper,o.offset.left-d.left+o.sizeDiff.width)),n=Math.abs((o._helper?o.offset.top-d.top:o.offset.top-l.top)+o.sizeDiff.height),r=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),r&&a&&(i-=o.parentData.left),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio)),n+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-n,u&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,n=t.containerOffset,r=t.containerPosition,a=t.containerElement,o=e(t.helper),s=o.offset(),l=o.outerWidth()-t.sizeDiff.width,c=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:s.left-r.left-n.left,width:l,height:c}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:s.left-r.left-n.left,width:l,height:c})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,n=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?n(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],n(i.alsoResize)):e.each(i.alsoResize,function(e){n(e)})},resize:function(t,i){var n=e(this).data("ui-resizable"),r=n.options,a=n.originalSize,o=n.originalPosition,s={height:n.size.height-a.height||0,width:n.size.width-a.width||0,top:n.position.top-o.top||0,left:n.position.left-o.left||0},l=function(t,n){e(t).each(function(){var t=e(this),r=e(this).data("ui-resizable-alsoresize"),a={},o=n&&n.length?n:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(r[t]||0)+(s[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof r.alsoResize||r.alsoResize.nodeType?l(r.alsoResize):e.each(r.alsoResize,function(e,t){l(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,n=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:n.height,width:n.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,n=t.size,r=t.originalSize,a=t.originalPosition,o=t.axis,s="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=s[0]||1,c=s[1]||1,u=Math.round((n.width-r.width)/l)*l,d=Math.round((n.height-r.height)/c)*c,h=r.width+u,p=r.height+d,f=i.maxWidth&&i.maxWidth<h,m=i.maxHeight&&i.maxHeight<p,g=i.minWidth&&i.minWidth>h,v=i.minHeight&&i.minHeight>p;i.grid=s,g&&(h+=l),v&&(p+=c),f&&(h-=l),m&&(p-=c),/^(se|s|e)$/.test(o)?(t.size.width=h,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=h,t.size.height=p,t.position.top=a.top-d):/^(sw)$/.test(o)?(t.size.width=h,t.size.height=p,t.position.left=a.left-u):(t.size.width=h,t.size.height=p,t.position.top=a.top-d,t.position.left=a.left-u)}})}(jQuery),function(e,t){e.widget("ui.selectable",e.ui.mouse,{version:"1.10.3",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var t,i=this;this.element.addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){t=e(i.options.filter,i.element[0]),t.addClass("ui-selectee"),t.each(function(){var t=e(this),i=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=t.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,n=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(n.filter,this.element[0]),this._trigger("start",t),e(n.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),n.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var n=e.data(this,"selectable-item");n.startselected=!0,t.metaKey||t.ctrlKey||(n.$element.removeClass("ui-selected"),n.selected=!1,n.$element.addClass("ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",t,{unselecting:n.element}))}),e(t.target).parents().addBack().each(function(){var n,r=e.data(this,"selectable-item");if(r)return n=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected"),r.$element.removeClass(n?"ui-unselecting":"ui-selected").addClass(n?"ui-selecting":"ui-unselecting"),r.unselecting=!n,r.selecting=n,r.selected=n,n?i._trigger("selecting",t,{selecting:r.element}):i._trigger("unselecting",t,{unselecting:r.element}),!1}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,n=this,r=this.options,a=this.opos[0],o=this.opos[1],s=t.pageX,l=t.pageY;return a>s&&(i=s,s=a,a=i),o>l&&(i=l,l=o,o=i),this.helper.css({left:a,top:o,width:s-a,height:l-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),c=!1;i&&i.element!==n.element[0]&&("touch"===r.tolerance?c=!(i.left>s||i.right<a||i.top>l||i.bottom<o):"fit"===r.tolerance&&(c=i.left>a&&i.right<s&&i.top>o&&i.bottom<l),c?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,n._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),n._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var n=e.data(this,"selectable-item");n.$element.removeClass("ui-unselecting"),n.unselecting=!1,n.startselected=!1,i._trigger("unselected",t,{unselected:n.element})}),e(".ui-selecting",this.element[0]).each(function(){var n=e.data(this,"selectable-item");n.$element.removeClass("ui-selecting").addClass("ui-selected"),n.selecting=!1,n.selected=!0,n.startselected=!0,i._trigger("selected",t,{selected:n.element})}),this._trigger("stop",t),this.helper.remove(),!1}})}(jQuery),function(e,t){function i(e,t,i){return e>t&&e<t+i}function n(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))}e.widget("ui.sortable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var e=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=!!this.items.length&&("x"===e.axis||n(this.items[0].item)),this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_setOption:function(t,i){"disabled"===t?(this.options[t]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):e.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(t,i){var n=null,r=!1,a=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),e(t.target).parents().each(function(){if(e.data(this,a.widgetName+"-item")===a)return n=e(this),!1}),e.data(t.target,a.widgetName+"-item")===a&&(n=e(t.target)),!!n&&(!(this.options.handle&&!i&&(e(this.options.handle,n).find("*").addBack().each(function(){this===t.target&&(r=!0)}),!r))&&(this.currentItem=n,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,i,n){var r,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(r=this.containers.length-1;r>=0;r--)this.containers[r]._trigger("activate",t,this._uiHash(this));return e.ui.ddmanager&&(e.ui.ddmanager.current=this),e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var i,n,r,a,o=this.options,s=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=s=this.scrollParent[0].scrollTop-o.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=s=this.scrollParent[0].scrollLeft-o.scrollSpeed)):(t.pageY-e(document).scrollTop()<o.scrollSensitivity?s=e(document).scrollTop(e(document).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<o.scrollSensitivity&&(s=e(document).scrollTop(e(document).scrollTop()+o.scrollSpeed)),t.pageX-e(document).scrollLeft()<o.scrollSensitivity?s=e(document).scrollLeft(e(document).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<o.scrollSensitivity&&(s=e(document).scrollLeft(e(document).scrollLeft()+o.scrollSpeed))),!1!==s&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(n=this.items[i],r=n.item[0],(a=this._intersectsWithPointer(n))&&n.instance===this.currentContainer&&!(r===this.currentItem[0]||this.placeholder[1===a?"next":"prev"]()[0]===r||e.contains(this.placeholder[0],r)||"semi-dynamic"===this.options.type&&e.contains(this.element[0],r))){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(t,n),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,i){if(t){if(e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t),this.options.revert){var n=this,r=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=r.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=r.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){n._clear(t)})}else this._clear(t,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},e(i).each(function(){var i=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);i&&n.push((t.key||i[1]+"[]")+"="+(t.key&&t.expression?i[1]:i[2]))}),!n.length&&t.key&&n.push(t.key+"="),n.join("&")},toArray:function(t){var i=this._getItemsAsjQuery(t&&t.connected),n=[];return t=t||{},i.each(function(){n.push(e(t.item||this).attr(t.attribute||"id")||"")}),n},_intersectsWith:function(e){var t=this.positionAbs.left,i=t+this.helperProportions.width,n=this.positionAbs.top,r=n+this.helperProportions.height,a=e.left,o=a+e.width,s=e.top,l=s+e.height,c=this.offset.click.top,u=this.offset.click.left,d="x"===this.options.axis||n+c>s&&n+c<l,h="y"===this.options.axis||t+u>a&&t+u<o,p=d&&h;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:a<t+this.helperProportions.width/2&&i-this.helperProportions.width/2<o&&s<n+this.helperProportions.height/2&&r-this.helperProportions.height/2<l},_intersectsWithPointer:function(e){var t="x"===this.options.axis||i(this.positionAbs.top+this.offset.click.top,e.top,e.height),n="y"===this.options.axis||i(this.positionAbs.left+this.offset.click.left,e.left,e.width),r=t&&n,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return!!r&&(this.floating?o&&"right"===o||"down"===a?2:1:a&&("down"===a?2:1))},_intersectsWithSides:function(e){var t=i(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),n=i(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),r=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&n||"left"===a&&!n:r&&("down"===r&&t||"up"===r&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return 0!==e&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return 0!==e&&(e>0?"right":"left")},refresh:function(e){return this._refreshItems(e),this.refreshPositions(),this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){var i,n,r,a,o=[],s=[],l=this._connectWith();if(l&&t)for(i=l.length-1;i>=0;i--)for(r=e(l[i]),n=r.length-1;n>=0;n--)(a=e.data(r[n],this.widgetFullName))&&a!==this&&!a.options.disabled&&s.push([e.isFunction(a.options.items)?a.options.items.call(a.element):e(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(s.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=s.length-1;i>=0;i--)s[i][0].each(function(){o.push(this)});return e(o)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var i=0;i<t.length;i++)if(t[i]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var i,n,r,a,o,s,l,c,u=this.items,d=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(i=h.length-1;i>=0;i--)for(r=e(h[i]),n=r.length-1;n>=0;n--)(a=e.data(r[n],this.widgetFullName))&&a!==this&&!a.options.disabled&&(d.push([e.isFunction(a.options.items)?a.options.items.call(a.element[0],t,{item:this.currentItem}):e(a.options.items,a.element),a]),this.containers.push(a));for(i=d.length-1;i>=0;i--)for(o=d[i][1],s=d[i][0],n=0,c=s.length;n<c;n++)l=e(s[n]),l.data(this.widgetName+"-item",o),u.push({item:l,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,n,r,a;for(i=this.items.length-1;i>=0;i--)n=this.items[i],n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(r=this.options.toleranceElement?e(this.options.toleranceElement,n.item):n.item,t||(n.width=r.outerWidth(),n.height=r.outerHeight()),a=r.offset(),n.left=a.left,n.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(t){t=t||this;var i,n=t.options;n.placeholder&&n.placeholder.constructor!==String||(i=n.placeholder,n.placeholder={element:function(){var n=t.currentItem[0].nodeName.toLowerCase(),r=e("<"+n+">",t.document[0]).addClass(i||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===n?t.currentItem.children().each(function(){e("<td> </td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(r)}):"img"===n&&r.attr("src",t.currentItem.attr("src")),i||r.css("visibility","hidden"),r},update:function(e,r){i&&!n.forcePlaceholderSize||(r.height()||r.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10)),r.width()||r.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10)))}}),t.placeholder=e(n.placeholder.element.call(t.element,t.currentItem)),t.currentItem.after(t.placeholder),n.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var r,a,o,s,l,c,u,d,h,p,f=null,m=null;for(r=this.containers.length-1;r>=0;r--)if(!e.contains(this.currentItem[0],this.containers[r].element[0]))if(this._intersectsWith(this.containers[r].containerCache)){if(f&&e.contains(this.containers[r].element[0],f.element[0]))continue;f=this.containers[r],m=r}else this.containers[r].containerCache.over&&(this.containers[r]._trigger("out",t,this._uiHash(this)),this.containers[r].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",t,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,s=null,p=f.floating||n(this.currentItem),l=p?"left":"top",c=p?"width":"height",u=this.positionAbs[l]+this.offset.click[l],a=this.items.length-1;a>=0;a--)e.contains(this.containers[m].element[0],this.items[a].item[0])&&this.items[a].item[0]!==this.currentItem[0]&&(p&&!i(this.positionAbs.top+this.offset.click.top,this.items[a].top,this.items[a].height)||(d=this.items[a].item.offset()[l],h=!1,Math.abs(d-u)>Math.abs(d+this.items[a][c]-u)&&(h=!0,d+=this.items[a][c]),Math.abs(d-u)<o&&(o=Math.abs(d-u),s=this.items[a],this.direction=h?"up":"down")));if(!s&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[m].element,!0),this._trigger("change",t,this._uiHash()),this.containers[m]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",t,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(t){var i=this.options,n=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||e("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),n[0].style.width&&!i.forceHelperSize||n.width(this.currentItem.width()),n[0].style.height&&!i.forceHelperSize||n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,n,r=this.options;"parent"===r.containment&&(r.containment=this.helper[0].parentNode),"document"!==r.containment&&"window"!==r.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e("document"===r.containment?document:window).width()-this.helperProportions.width-this.margins.left,(e("document"===r.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(r.containment)||(t=e(r.containment)[0],i=e(r.containment).offset(),n="hidden"!==e(t).css("overflow"),
|
||
this.containment=[i.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(n?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(n?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,i){i||(i=this.position);var n="absolute"===t?1:-1,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(r[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:r.scrollTop())*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:r.scrollLeft())*n}},_generatePosition:function(t){var i,n,r=this.options,a=t.pageX,o=t.pageY,s="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(s[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(a=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(a=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),r.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/r.grid[1])*r.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-r.grid[1]:i+r.grid[1]:i,n=this.originalPageX+Math.round((a-this.originalPageX)/r.grid[0])*r.grid[0],a=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-r.grid[0]:n+r.grid[0]:n)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:s.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:s.scrollLeft())}},_rearrange:function(e,t,i,n){i?i[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?t.item[0]:t.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var r=this.counter;this._delay(function(){r===this.counter&&this.refreshPositions(!n)})},_clear:function(e,t){this.reverting=!1;var i,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!t&&n.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||t||n.push(function(e){this._trigger("update",e,this._uiHash())}),this!==this.currentContainer&&(t||(n.push(function(e){this._trigger("remove",e,this._uiHash())}),n.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)t||n.push(function(e){return function(t){e._trigger("deactivate",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(n.push(function(e){return function(t){e._trigger("out",t,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!t){for(this._trigger("beforeStop",e,this._uiHash()),i=0;i<n.length;i++)n[i].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!1}if(t||this._trigger("beforeStop",e,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!t){for(i=0;i<n.length;i++)n[i].call(this,e);this._trigger("stop",e,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){!1===e.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var i=t||this;return{helper:i.helper,placeholder:i.placeholder||e([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:t?t.element:null}}})}(jQuery),function(e,t){e.effects={effect:{}},function(e,t){function i(e,t,i){var n=u[t.type]||{};return null==e?i||!t.def?null:t.def:(e=n.floor?~~e:parseFloat(e),isNaN(e)?t.def:n.mod?(e+n.mod)%n.mod:0>e?0:n.max<e?n.max:e)}function n(t){var i=l(),n=i._rgba=[];return t=t.toLowerCase(),p(s,function(e,r){var a,o=r.re.exec(t),s=o&&r.parse(o),l=r.space||"rgba";if(s)return a=i[l](s),i[c[l].cache]=a[c[l].cache],n=i._rgba=a._rgba,!1}),n.length?("0,0,0,0"===n.join()&&e.extend(n,a.transparent),i):a[t]}function r(e,t,i){return i=(i+1)%1,6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}var a,o=/^([\-+])=\s*(\d+\.?\d*)/,s=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[e[1],e[2],e[3],e[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(e){return[2.55*e[1],2.55*e[2],2.55*e[3],e[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(e){return[e[1],e[2]/100,e[3]/100,e[4]]}}],l=e.Color=function(t,i,n,r){return new e.Color.fn.parse(t,i,n,r)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},h=e("<p>")[0],p=e.each;h.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=h.style.backgroundColor.indexOf("rgba")>-1,p(c,function(e,t){t.cache="_"+e,t.props.alpha={idx:3,type:"percent",def:1}}),l.fn=e.extend(l.prototype,{parse:function(t,r,o,s){if(void 0===t)return this._rgba=[null,null,null,null],this;(t.jquery||t.nodeType)&&(t=e(t).css(r),r=void 0);var u=this,d=e.type(t),h=this._rgba=[];return void 0!==r&&(t=[t,r,o,s],d="array"),"string"===d?this.parse(n(t)||a._default):"array"===d?(p(c.rgba.props,function(e,n){h[n.idx]=i(t[n.idx],n)}),this):"object"===d?(t instanceof l?p(c,function(e,i){t[i.cache]&&(u[i.cache]=t[i.cache].slice())}):p(c,function(n,r){var a=r.cache;p(r.props,function(e,n){if(!u[a]&&r.to){if("alpha"===e||null==t[e])return;u[a]=r.to(u._rgba)}u[a][n.idx]=i(t[e],n,!0)}),u[a]&&e.inArray(null,u[a].slice(0,3))<0&&(u[a][3]=1,r.from&&(u._rgba=r.from(u[a])))}),this):void 0},is:function(e){var t=l(e),i=!0,n=this;return p(c,function(e,r){var a,o=t[r.cache];return o&&(a=n[r.cache]||r.to&&r.to(n._rgba)||[],p(r.props,function(e,t){if(null!=o[t.idx])return i=o[t.idx]===a[t.idx]})),i}),i},_space:function(){var e=[],t=this;return p(c,function(i,n){t[n.cache]&&e.push(i)}),e.pop()},transition:function(e,t){var n=l(e),r=n._space(),a=c[r],o=0===this.alpha()?l("transparent"):this,s=o[a.cache]||a.to(o._rgba),d=s.slice();return n=n[a.cache],p(a.props,function(e,r){var a=r.idx,o=s[a],l=n[a],c=u[r.type]||{};null!==l&&(null===o?d[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),d[a]=i((l-o)*t+o,r)))}),this[r](d)},blend:function(t){if(1===this._rgba[3])return this;var i=this._rgba.slice(),n=i.pop(),r=l(t)._rgba;return l(e.map(i,function(e,t){return(1-n)*r[t]+n*e}))},toRgbaString:function(){var t="rgba(",i=e.map(this._rgba,function(e,t){return null==e?t>2?1:0:e});return 1===i[3]&&(i.pop(),t="rgb("),t+i.join()+")"},toHslaString:function(){var t="hsla(",i=e.map(this.hsla(),function(e,t){return null==e&&(e=t>2?1:0),t&&t<3&&(e=Math.round(100*e)+"%"),e});return 1===i[3]&&(i.pop(),t="hsl("),t+i.join()+")"},toHexString:function(t){var i=this._rgba.slice(),n=i.pop();return t&&i.push(~~(255*n)),"#"+e.map(i,function(e){return e=(e||0).toString(16),1===e.length?"0"+e:e}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t,i,n=e[0]/255,r=e[1]/255,a=e[2]/255,o=e[3],s=Math.max(n,r,a),l=Math.min(n,r,a),c=s-l,u=s+l,d=.5*u;return t=l===s?0:n===s?60*(r-a)/c+360:r===s?60*(a-n)/c+120:60*(n-r)/c+240,i=0===c?0:d<=.5?c/u:c/(2-u),[Math.round(t)%360,i,d,null==o?1:o]},c.hsla.from=function(e){if(null==e[0]||null==e[1]||null==e[2])return[null,null,null,e[3]];var t=e[0]/360,i=e[1],n=e[2],a=e[3],o=n<=.5?n*(1+i):n+i-n*i,s=2*n-o;return[Math.round(255*r(s,o,t+1/3)),Math.round(255*r(s,o,t)),Math.round(255*r(s,o,t-1/3)),a]},p(c,function(t,n){var r=n.props,a=n.cache,s=n.to,c=n.from;l.fn[t]=function(t){if(s&&!this[a]&&(this[a]=s(this._rgba)),void 0===t)return this[a].slice();var n,o=e.type(t),u="array"===o||"object"===o?t:arguments,d=this[a].slice();return p(r,function(e,t){var n=u["object"===o?e:t.idx];null==n&&(n=d[t.idx]),d[t.idx]=i(n,t)}),c?(n=l(c(d)),n[a]=d,n):l(d)},p(r,function(i,n){l.fn[i]||(l.fn[i]=function(r){var a,s=e.type(r),l="alpha"===i?this._hsla?"hsla":"rgba":t,c=this[l](),u=c[n.idx];return"undefined"===s?u:("function"===s&&(r=r.call(this,u),s=e.type(r)),null==r&&n.empty?this:("string"===s&&(a=o.exec(r))&&(r=u+parseFloat(a[2])*("+"===a[1]?1:-1)),c[n.idx]=r,this[l](c)))})})}),l.hook=function(t){var i=t.split(" ");p(i,function(t,i){e.cssHooks[i]={set:function(t,r){var a,o,s="";if("transparent"!==r&&("string"!==e.type(r)||(a=n(r)))){if(r=l(a||r),!d.rgba&&1!==r._rgba[3]){for(o="backgroundColor"===i?t.parentNode:t;(""===s||"transparent"===s)&&o&&o.style;)try{s=e.css(o,"backgroundColor"),o=o.parentNode}catch(e){}r=r.blend(s&&"transparent"!==s?s:"_default")}r=r.toRgbaString()}try{t.style[i]=r}catch(e){}}},e.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),e.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})},l.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),e.cssHooks.borderColor={expand:function(e){var t={};return p(["Top","Right","Bottom","Left"],function(i,n){t["border"+n+"Color"]=e}),t}},a=e.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function t(t){var i,n,r=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,a={};if(r&&r.length&&r[0]&&r[r[0]])for(n=r.length;n--;)i=r[n],"string"==typeof r[i]&&(a[e.camelCase(i)]=r[i]);else for(i in r)"string"==typeof r[i]&&(a[i]=r[i]);return a}function i(t,i){var n,a,o={};for(n in i)a=i[n],t[n]!==a&&(r[n]||!e.fx.step[n]&&isNaN(parseFloat(a))||(o[n]=a));return o}var n=["add","remove","toggle"],r={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};e.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,i){e.fx.step[i]=function(e){("none"!==e.end&&!e.setAttr||1===e.pos&&!e.setAttr)&&(jQuery.style(e.elem,i,e.end),e.setAttr=!0)}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e.effects.animateClass=function(r,a,o,s){var l=e.speed(a,o,s);return this.queue(function(){var a,o=e(this),s=o.attr("class")||"",c=l.children?o.find("*").addBack():o;c=c.map(function(){return{el:e(this),start:t(this)}}),a=function(){e.each(n,function(e,t){r[t]&&o[t+"Class"](r[t])})},a(),c=c.map(function(){return this.end=t(this.el[0]),this.diff=i(this.start,this.end),this}),o.attr("class",s),c=c.map(function(){var t=this,i=e.Deferred(),n=e.extend({},l,{queue:!1,complete:function(){i.resolve(t)}});return this.el.animate(this.diff,n),i.promise()}),e.when.apply(e,c.get()).done(function(){a(),e.each(arguments,function(){var t=this.el;e.each(this.diff,function(e){t.css(e,"")})}),l.complete.call(o[0])})})},e.fn.extend({addClass:function(t){return function(i,n,r,a){return n?e.effects.animateClass.call(this,{add:i},n,r,a):t.apply(this,arguments)}}(e.fn.addClass),removeClass:function(t){return function(i,n,r,a){return arguments.length>1?e.effects.animateClass.call(this,{remove:i},n,r,a):t.apply(this,arguments)}}(e.fn.removeClass),toggleClass:function(t){return function(i,n,r,a,o){return"boolean"==typeof n||void 0===n?r?e.effects.animateClass.call(this,n?{add:i}:{remove:i},r,a,o):t.apply(this,arguments):e.effects.animateClass.call(this,{toggle:i},n,r,a)}}(e.fn.toggleClass),switchClass:function(t,i,n,r,a){return e.effects.animateClass.call(this,{add:i,remove:t},n,r,a)}})}(),function(){function t(t,i,n,r){return e.isPlainObject(t)&&(i=t,t=t.effect),t={effect:t},null==i&&(i={}),e.isFunction(i)&&(r=i,n=null,i={}),("number"==typeof i||e.fx.speeds[i])&&(r=n,n=i,i={}),e.isFunction(n)&&(r=n,n=null),i&&e.extend(t,i),n=n||i.duration,t.duration=e.fx.off?0:"number"==typeof n?n:n in e.fx.speeds?e.fx.speeds[n]:e.fx.speeds._default,t.complete=r||i.complete,t}function i(t){return!(t&&"number"!=typeof t&&!e.fx.speeds[t])||("string"==typeof t&&!e.effects.effect[t]||(!!e.isFunction(t)||"object"==typeof t&&!t.effect))}e.extend(e.effects,{version:"1.10.3",save:function(e,t){for(var i=0;i<t.length;i++)null!==t[i]&&e.data("ui-effects-"+t[i],e[0].style[t[i]])},restore:function(e,t){var i,n;for(n=0;n<t.length;n++)null!==t[n]&&(i=e.data("ui-effects-"+t[n]),void 0===i&&(i=""),e.css(t[n],i))},setMode:function(e,t){return"toggle"===t&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var i,n;switch(e[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=e[0]/t.height}switch(e[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=e[1]/t.width}return{x:n,y:i}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var i={width:t.outerWidth(!0),height:t.outerHeight(!0),float:t.css("float")},n=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),r={width:t.width(),height:t.height()},a=document.activeElement;try{a.id}catch(e){a=document.body}return t.wrap(n),(t[0]===a||e.contains(t[0],a))&&e(a).focus(),n=t.parent(),"static"===t.css("position")?(n.css({position:"relative"}),t.css({position:"relative"})):(e.extend(i,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,n){i[n]=t.css(n),isNaN(parseInt(i[n],10))&&(i[n]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),t.css(r),n.css(i).show()},removeWrapper:function(t){var i=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===i||e.contains(t[0],i))&&e(i).focus()),t},setTransition:function(t,i,n,r){return r=r||{},e.each(i,function(e,i){var a=t.cssUnit(i);a[0]>0&&(r[i]=a[0]*n+a[1])}),r}}),e.fn.extend({effect:function(){function i(t){function i(){e.isFunction(a)&&a.call(r[0]),e.isFunction(t)&&t()}var r=e(this),a=n.complete,s=n.mode;(r.is(":hidden")?"hide"===s:"show"===s)?(r[s](),i()):o.call(r[0],n,i)}var n=t.apply(this,arguments),r=n.mode,a=n.queue,o=e.effects.effect[n.effect];return e.fx.off||!o?r?this[r](n.duration,n.complete):this.each(function(){n.complete&&n.complete.call(this)}):!1===a?this.each(i):this.queue(a||"fx",i)},show:function(e){return function(n){if(i(n))return e.apply(this,arguments);var r=t.apply(this,arguments);return r.mode="show",this.effect.call(this,r)}}(e.fn.show),hide:function(e){return function(n){if(i(n))return e.apply(this,arguments);var r=t.apply(this,arguments);return r.mode="hide",this.effect.call(this,r)}}(e.fn.hide),toggle:function(e){return function(n){if(i(n)||"boolean"==typeof n)return e.apply(this,arguments);var r=t.apply(this,arguments);return r.mode="toggle",this.effect.call(this,r)}}(e.fn.toggle),cssUnit:function(t){var i=this.css(t),n=[];return e.each(["em","px","%","pt"],function(e,t){i.indexOf(t)>0&&(n=[parseFloat(i),t])}),n}})}(),function(){var t={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,i){t[i]=function(t){return Math.pow(t,e+2)}}),e.extend(t,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return 0===e||1===e?e:-Math.pow(2,8*(e-1))*Math.sin((80*(e-1)-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){for(var t,i=4;e<((t=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*t-2)/22-e,2)}}),e.each(t,function(t,i){e.easing["easeIn"+t]=i,e.easing["easeOut"+t]=function(e){return 1-i(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?i(2*e)/2:1-i(-2*e+2)/2}})}()}(jQuery),function(e,t){var i=0,n={},r={};n.height=n.paddingTop=n.paddingBottom=n.borderTopWidth=n.borderBottomWidth="hide",r.height=r.paddingTop=r.paddingBottom=r.borderTopWidth=r.borderBottomWidth="show",e.widget("ui.accordion",{version:"1.10.3",options:{active:0,animate:{},collapsible:!1,event:"click",header:"> li > :first-child,> :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},_create:function(){var t=this.options;this.prevShow=this.prevHide=e(),this.element.addClass("ui-accordion ui-widget ui-helper-reset").attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():e(),content:this.active.length?this.active.next():e()}},_createIcons:function(){var t=this.options.icons;t&&(e("<span>").addClass("ui-accordion-header-icon ui-icon "+t.header).prependTo(this.headers),this.active.children(".ui-accordion-header-icon").removeClass(t.header).addClass(t.activeHeader),this.headers.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.removeClass("ui-accordion-icons").children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-selected").removeAttr("aria-controls").removeAttr("tabIndex").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled").each(function(){/^ui-accordion/.test(this.id)&&this.removeAttribute("id")}),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){if("active"===e)return void this._activate(t);"event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||!1!==this.options.active||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()),"disabled"===e&&this.headers.add(this.headers.next()).toggleClass("ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var i=e.ui.keyCode,n=this.headers.length,r=this.headers.index(t.target),a=!1;switch(t.keyCode){case i.RIGHT:case i.DOWN:a=this.headers[(r+1)%n];break;case i.LEFT:case i.UP:a=this.headers[(r-1+n)%n];break;case i.SPACE:case i.ENTER:this._eventHandler(t);break;case i.HOME:a=this.headers[0];break;case i.END:a=this.headers[n-1]}a&&(e(t.target).attr("tabIndex",-1),e(a).attr("tabIndex",0),a.focus(),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===e.ui.keyCode.UP&&t.ctrlKey&&e(t.currentTarget).prev().focus()},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=e()):!1===t.active?this._activate(0):this.active.length&&!e.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=e()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){this.headers=this.element.find(this.options.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"),this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom").filter(":not(.ui-accordion-content-active)").hide()},_refresh:function(){var t,n=this.options,r=n.heightStyle,a=this.element.parent(),o=this.accordionId="ui-accordion-"+(this.element.attr("id")||++i);this.active=this._findActive(n.active).addClass("ui-accordion-header-active ui-state-active ui-corner-top").removeClass("ui-corner-all"),this.active.next().addClass("ui-accordion-content-active").show(),this.headers.attr("role","tab").each(function(t){var i=e(this),n=i.attr("id"),r=i.next(),a=r.attr("id");n||(n=o+"-header-"+t,i.attr("id",n)),a||(a=o+"-panel-"+t,r.attr("id",a)),i.attr("aria-controls",a),r.attr("aria-labelledby",n)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false",tabIndex:-1}).next().attr({"aria-expanded":"false","aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true",tabIndex:0}).next().attr({"aria-expanded":"true","aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(n.event),"fill"===r?(t=a.height(),this.element.siblings(":visible").each(function(){var i=e(this),n=i.css("position");"absolute"!==n&&"fixed"!==n&&(t-=i.outerHeight(!0))}),this.headers.each(function(){t-=e(this).outerHeight(!0)}),this.headers.next().each(function(){e(this).height(Math.max(0,t-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===r&&(t=0,this.headers.next().each(function(){t=Math.max(t,e(this).css("height","").height())}).height(t))},_activate:function(t){var i=this._findActive(t)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):e()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var i=this.options,n=this.active,r=e(t.currentTarget),a=r[0]===n[0],o=a&&i.collapsible,s=o?e():r.next(),l=n.next(),c={oldHeader:n,oldPanel:l,newHeader:o?e():r,newPanel:s};t.preventDefault(),a&&!i.collapsible||!1===this._trigger("beforeActivate",t,c)||(i.active=!o&&this.headers.index(r),this.active=a?e():r,this._toggle(c),n.removeClass("ui-accordion-header-active ui-state-active"),i.icons&&n.children(".ui-accordion-header-icon").removeClass(i.icons.activeHeader).addClass(i.icons.header),a||(r.removeClass("ui-corner-all").addClass("ui-accordion-header-active ui-state-active ui-corner-top"),i.icons&&r.children(".ui-accordion-header-icon").removeClass(i.icons.header).addClass(i.icons.activeHeader),r.next().addClass("ui-accordion-content-active")))},_toggle:function(t){var i=t.newPanel,n=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=n,this.options.animate?this._animate(i,n,t):(n.hide(),i.show(),this._toggleComplete(t)),n.attr({"aria-expanded":"false","aria-hidden":"true"}),n.prev().attr("aria-selected","false"),i.length&&n.length?n.prev().attr("tabIndex",-1):i.length&&this.headers.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),i.attr({"aria-expanded":"true","aria-hidden":"false"}).prev().attr({"aria-selected":"true",tabIndex:0})},_animate:function(e,t,i){var a,o,s,l=this,c=0,u=e.length&&(!t.length||e.index()<t.index()),d=this.options.animate||{},h=u&&d.down||d,p=function(){l._toggleComplete(i)};return"number"==typeof h&&(s=h),"string"==typeof h&&(o=h),o=o||h.easing||d.easing,s=s||h.duration||d.duration,t.length?e.length?(a=e.show().outerHeight(),t.animate(n,{duration:s,easing:o,step:function(e,t){t.now=Math.round(e)}}),void e.hide().animate(r,{duration:s,easing:o,complete:p,step:function(e,i){i.now=Math.round(e),"height"!==i.prop?c+=i.now:"content"!==l.options.heightStyle&&(i.now=Math.round(a-t.outerHeight()-c),c=0)}})):t.animate(n,s,o,p):e.animate(r,s,o,p)},_toggleComplete:function(e){var t=e.oldPanel;t.removeClass("ui-accordion-content-active").prev().removeClass("ui-corner-top").addClass("ui-corner-all"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})}(jQuery),function(e,t){var i=0;e.widget("ui.autocomplete",{version:"1.10.3",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var t,i,n,r=this.element[0].nodeName.toLowerCase(),a="textarea"===r,o="input"===r;this.isMultiLine=!!a||!o&&this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(r){if(this.element.prop("readOnly"))return t=!0,n=!0,void(i=!0);t=!1,n=!1,i=!1;var a=e.ui.keyCode;switch(r.keyCode){case a.PAGE_UP:t=!0,this._move("previousPage",r);break;case a.PAGE_DOWN:t=!0,this._move("nextPage",r);break;case a.UP:t=!0,this._keyEvent("previous",r);break;case a.DOWN:t=!0,this._keyEvent("next",r);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(t=!0,r.preventDefault(),this.menu.select(r));break;case a.TAB:this.menu.active&&this.menu.select(r);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(r),r.preventDefault());break;default:i=!0,this._searchTimeout(r)}},keypress:function(n){if(t)return t=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||n.preventDefault());if(!i){var r=e.ui.keyCode;switch(n.keyCode){case r.PAGE_UP:this._move("previousPage",n);break;case r.PAGE_DOWN:this._move("nextPage",n);break;case r.UP:this._keyEvent("previous",n);break;case r.DOWN:this._keyEvent("next",n)}}},input:function(e){if(n)return n=!1,void e.preventDefault();this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){if(this.cancelBlur)return void delete this.cancelBlur;clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=e("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];e(t.target).closest(".ui-menu-item").length||this._delay(function(){var t=this;this.document.one("mousedown",function(n){n.target===t.element[0]||n.target===i||e.contains(i,n.target)||t.close()})})},menufocus:function(t,i){if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){e(t.target).trigger(t.originalEvent)});var n=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",t,{item:n})?t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(n.value):this.liveRegion.text(n.value)},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?e(t):this.document.find(t).eq(0)),t||(t=this.element.closest(".ui-front")),t.length||(t=this.document[0].body),t},_initSource:function(){var t,i,n=this;e.isArray(this.options.source)?(t=this.options.source,this.source=function(i,n){n(e.ui.autocomplete.filter(t,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(t,r){n.xhr&&n.xhr.abort(),n.xhr=e.ajax({url:i,data:t,dataType:"json",success:function(e){r(e)},error:function(){r([])}})}):this.source=this.options.source},_searchTimeout:function(e){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,e))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):!1!==this._trigger("search",t)?this._search(e):void 0},_search:function(e){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var e=this,t=++i;return function(n){t===i&&e.__response(n),--e.pending||e.element.removeClass("ui-autocomplete-loading")}},__response:function(e){e&&(e=this._normalize(e)),this._trigger("response",null,{content:e}),
|
||
!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:e.map(t,function(t){return"string"==typeof t?{label:t,value:t}:e.extend({label:t.label||t.value,value:t.value||t.label},t)})},_suggest:function(t){var i=this.menu.element.empty();this._renderMenu(i,t),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(e.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(t,i){var n=this;e.each(i,function(e,i){n._renderItemData(t,i)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(t,i){return e("<li>").append(e("<a>").text(i.label)).appendTo(t)},_move:function(e,t){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this._value(this.term),void this.menu.blur()):void this.menu[e](t):void this.search(null,t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(e,t),t.preventDefault())}}),e.extend(e.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,i){var n=new RegExp(e.ui.autocomplete.escapeRegex(i),"i");return e.grep(t,function(e){return n.test(e.label||e.value||e)})}}),e.widget("ui.autocomplete",e.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(e>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.text(t))}})}(jQuery),function(e,t){var i,n,r,a,o="ui-button ui-widget ui-state-default ui-corner-all",s="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",l=function(){var t=e(this);setTimeout(function(){t.find(":ui-button").button("refresh")},1)},c=function(t){var i=t.name,n=t.form,r=e([]);return i&&(i=i.replace(/'/g,"\\'"),r=n?e(n).find("[name='"+i+"']"):e("[name='"+i+"']",t.ownerDocument).filter(function(){return!this.form})),r};e.widget("ui.button",{version:"1.10.3",defaultElement:"<button>",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,l),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,s=this.options,u="checkbox"===this.type||"radio"===this.type,d=u?"":"ui-state-active";null===s.label&&(s.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){s.disabled||this===i&&e(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){s.disabled||e(this).removeClass(d)}).bind("click"+this.eventNamespace,function(e){s.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus"+this.eventNamespace,function(){t.buttonElement.addClass("ui-state-focus")}).bind("blur"+this.eventNamespace,function(){t.buttonElement.removeClass("ui-state-focus")}),u&&(this.element.bind("change"+this.eventNamespace,function(){a||t.refresh()}),this.buttonElement.bind("mousedown"+this.eventNamespace,function(e){s.disabled||(a=!1,n=e.pageX,r=e.pageY)}).bind("mouseup"+this.eventNamespace,function(e){s.disabled||n===e.pageX&&r===e.pageY||(a=!0)})),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(s.disabled||a)return!1}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(s.disabled||a)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var i=t.element[0];c(i).not(i).map(function(){return e(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){if(s.disabled)return!1;e(this).addClass("ui-state-active"),i=this,t.document.one("mouseup",function(){i=null})}).bind("mouseup"+this.eventNamespace,function(){if(s.disabled)return!1;e(this).removeClass("ui-state-active")}).bind("keydown"+this.eventNamespace,function(t){if(s.disabled)return!1;t.keyCode!==e.ui.keyCode.SPACE&&t.keyCode!==e.ui.keyCode.ENTER||e(this).addClass("ui-state-active")}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){e(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(t){t.keyCode===e.ui.keyCode.SPACE&&e(this).click()})),this._setOption("disabled",s.disabled),this._resetButton()},_determineButtonType:function(){var e,t,i;this.element.is("[type=checkbox]")?this.type="checkbox":this.element.is("[type=radio]")?this.type="radio":this.element.is("input")?this.type="input":this.type="button","checkbox"===this.type||"radio"===this.type?(e=this.element.parents().last(),t="label[for='"+this.element.attr("id")+"']",this.buttonElement=e.find(t),this.buttonElement.length||(e=e.length?e.siblings():this.element.siblings(),this.buttonElement=e.filter(t),this.buttonElement.length||(this.buttonElement=e.find(t))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(o+" ui-state-hover ui-state-active "+s).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(e,t){if(this._super(e,t),"disabled"===e)return void(t?this.element.prop("disabled",!0):this.element.prop("disabled",!1));this._resetButton()},refresh:function(){var t=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOption("disabled",t),"radio"===this.type?c(this.element[0]).each(function(){e(this).is(":checked")?e(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):e(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return void(this.options.label&&this.element.val(this.options.label));var t=this.buttonElement.removeClass(s),i=e("<span></span>",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(t.empty()).text(),n=this.options.icons,r=n.primary&&n.secondary,a=[];n.primary||n.secondary?(this.options.text&&a.push("ui-button-text-icon"+(r?"s":n.primary?"-primary":"-secondary")),n.primary&&t.prepend("<span class='ui-button-icon-primary ui-icon "+n.primary+"'></span>"),n.secondary&&t.append("<span class='ui-button-icon-secondary ui-icon "+n.secondary+"'></span>"),this.options.text||(a.push(r?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||t.attr("title",e.trim(i)))):a.push("ui-button-text-only"),t.addClass(a.join(" "))}}),e.widget("ui.buttonset",{version:"1.10.3",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,t){"disabled"===e&&this.buttons.button("option",e,t),this._super(e,t)},refresh:function(){var t="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(t?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(t?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return e(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})}(jQuery),function(e,t){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},e.extend(this._defaults,this.regional[""]),this.dpDiv=n(e("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(t){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return t.delegate(i,"mouseout",function(){e(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){e.datepicker._isDisabledDatepicker(a.inline?t.parent()[0]:a.input[0])||(e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),e(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&e(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&e(this).addClass("ui-datepicker-next-hover"))})}function r(t,i){e.extend(t,i);for(var n in i)null==i[n]&&(t[n]=i[n]);return t}e.extend(e.ui,{datepicker:{version:"1.10.3"}});var a,o="datepicker";e.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return r(this._defaults,e||{}),this},_attachDatepicker:function(t,i){var n,r,a;n=t.nodeName.toLowerCase(),r="div"===n||"span"===n,t.id||(this.uuid+=1,t.id="dp"+this.uuid),a=this._newInst(e(t),r),a.settings=e.extend({},i||{}),"input"===n?this._connectDatepicker(t,a):r&&this._inlineDatepicker(t,a)},_newInst:function(t,i){return{id:t[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:t,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(e("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(t,i){var n=e(t);i.append=e([]),i.trigger=e([]),n.hasClass(this.markerClassName)||(this._attachments(n,i),n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),e.data(t,o,i),i.settings.disabled&&this._disableDatepicker(t))},_attachments:function(t,i){var n,r,a,o=this._get(i,"appendText"),s=this._get(i,"isRTL");i.append&&i.append.remove(),o&&(i.append=e("<span class='"+this._appendClass+"'>"+o+"</span>"),t[s?"before":"after"](i.append)),t.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),n=this._get(i,"showOn"),"focus"!==n&&"both"!==n||t.focus(this._showDatepicker),"button"!==n&&"both"!==n||(r=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=e(this._get(i,"buttonImageOnly")?e("<img/>").addClass(this._triggerClass).attr({src:a,alt:r,title:r}):e("<button type='button'></button>").addClass(this._triggerClass).html(a?e("<img/>").attr({src:a,alt:r,title:r}):r)),t[s?"before":"after"](i.trigger),i.trigger.click(function(){return e.datepicker._datepickerShowing&&e.datepicker._lastInput===t[0]?e.datepicker._hideDatepicker():e.datepicker._datepickerShowing&&e.datepicker._lastInput!==t[0]?(e.datepicker._hideDatepicker(),e.datepicker._showDatepicker(t[0])):e.datepicker._showDatepicker(t[0]),!1}))},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var t,i,n,r,a=new Date(2009,11,20),o=this._get(e,"dateFormat");o.match(/[DM]/)&&(t=function(e){for(i=0,n=0,r=0;r<e.length;r++)e[r].length>i&&(i=e[r].length,n=r);return n},a.setMonth(t(this._get(e,o.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(t(this._get(e,o.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),e.input.attr("size",this._formatDate(e,a).length)}},_inlineDatepicker:function(t,i){var n=e(t);n.hasClass(this.markerClassName)||(n.addClass(this.markerClassName).append(i.dpDiv),e.data(t,o,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(t),i.dpDiv.css("display","block"))},_dialogDatepicker:function(t,i,n,a,s){var l,c,u,d,h,p=this._dialogInst;return p||(this.uuid+=1,l="dp"+this.uuid,this._dialogInput=e("<input type='text' id='"+l+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.keydown(this._doKeyDown),e("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},e.data(this._dialogInput[0],o,p)),r(p.settings,a||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(c=document.documentElement.clientWidth,u=document.documentElement.clientHeight,d=document.documentElement.scrollLeft||document.body.scrollLeft,h=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[c/2-100+d,u/2-150+h]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),e.blockUI&&e.blockUI(this.dpDiv),e.data(this._dialogInput[0],o,p),this},_destroyDatepicker:function(t){var i,n=e(t),r=e.data(t,o);n.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),e.removeData(t,o),"input"===i?(r.append.remove(),r.trigger.remove(),n.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):"div"!==i&&"span"!==i||n.removeClass(this.markerClassName).empty())},_enableDatepicker:function(t){var i,n,r=e(t),a=e.data(t,o);r.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==i&&"span"!==i||(n=r.children("."+this._inlineClass),n.children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var i,n,r=e(t),a=e.data(t,o);r.hasClass(this.markerClassName)&&(i=t.nodeName.toLowerCase(),"input"===i?(t.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==i&&"span"!==i||(n=r.children("."+this._inlineClass),n.children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=e.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(t){try{return e.data(t,o)}catch(e){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(t,i,n){var a,o,s,l,c=this._getInst(t);if(2===arguments.length&&"string"==typeof i)return"defaults"===i?e.extend({},e.datepicker._defaults):c?"all"===i?e.extend({},c.settings):this._get(c,i):null;a=i||{},"string"==typeof i&&(a={},a[i]=n),c&&(this._curInst===c&&this._hideDatepicker(),o=this._getDateDatepicker(t,!0),s=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),r(c.settings,a),null!==s&&void 0!==a.dateFormat&&void 0===a.minDate&&(c.settings.minDate=this._formatDate(c,s)),null!==l&&void 0!==a.dateFormat&&void 0===a.maxDate&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in a&&(a.disabled?this._disableDatepicker(t):this._enableDatepicker(t)),this._attachments(e(t),c),this._autoSize(c),this._setDate(c,o),this._updateAlternate(c),this._updateDatepicker(c))},_changeDatepicker:function(e,t,i){this._optionDatepicker(e,t,i)},_refreshDatepicker:function(e){var t=this._getInst(e);t&&this._updateDatepicker(t)},_setDateDatepicker:function(e,t){var i=this._getInst(e);i&&(this._setDate(i,t),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(e,t){var i=this._getInst(e);return i&&!i.inline&&this._setDateFromField(i,t),i?this._getDate(i):null},_doKeyDown:function(t){var i,n,r,a=e.datepicker._getInst(t.target),o=!0,s=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,e.datepicker._datepickerShowing)switch(t.keyCode){case 9:e.datepicker._hideDatepicker(),o=!1;break;case 13:return r=e("td."+e.datepicker._dayOverClass+":not(."+e.datepicker._currentClass+")",a.dpDiv),r[0]&&e.datepicker._selectDay(t.target,a.selectedMonth,a.selectedYear,r[0]),i=e.datepicker._get(a,"onSelect"),i?(n=e.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[n,a])):e.datepicker._hideDatepicker(),!1;case 27:e.datepicker._hideDatepicker();break;case 33:e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 34:e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 35:(t.ctrlKey||t.metaKey)&&e.datepicker._clearDate(t.target),o=t.ctrlKey||t.metaKey;break;case 36:(t.ctrlKey||t.metaKey)&&e.datepicker._gotoToday(t.target),o=t.ctrlKey||t.metaKey;break;case 37:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,s?1:-1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?-e.datepicker._get(a,"stepBigMonths"):-e.datepicker._get(a,"stepMonths"),"M");break;case 38:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,-7,"D"),o=t.ctrlKey||t.metaKey;break;case 39:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,s?-1:1,"D"),o=t.ctrlKey||t.metaKey,t.originalEvent.altKey&&e.datepicker._adjustDate(t.target,t.ctrlKey?+e.datepicker._get(a,"stepBigMonths"):+e.datepicker._get(a,"stepMonths"),"M");break;case 40:(t.ctrlKey||t.metaKey)&&e.datepicker._adjustDate(t.target,7,"D"),o=t.ctrlKey||t.metaKey;break;default:o=!1}else 36===t.keyCode&&t.ctrlKey?e.datepicker._showDatepicker(this):o=!1;o&&(t.preventDefault(),t.stopPropagation())},_doKeyPress:function(t){var i,n,r=e.datepicker._getInst(t.target);if(e.datepicker._get(r,"constrainInput"))return i=e.datepicker._possibleChars(e.datepicker._get(r,"dateFormat")),n=String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),t.ctrlKey||t.metaKey||n<" "||!i||i.indexOf(n)>-1},_doKeyUp:function(t){var i,n=e.datepicker._getInst(t.target);if(n.input.val()!==n.lastVal)try{i=e.datepicker.parseDate(e.datepicker._get(n,"dateFormat"),n.input?n.input.val():null,e.datepicker._getFormatConfig(n)),i&&(e.datepicker._setDateFromField(n),e.datepicker._updateAlternate(n),e.datepicker._updateDatepicker(n))}catch(e){}return!0},_showDatepicker:function(t){if(t=t.target||t,"input"!==t.nodeName.toLowerCase()&&(t=e("input",t.parentNode)[0]),!e.datepicker._isDisabledDatepicker(t)&&e.datepicker._lastInput!==t){var i,n,a,o,s,l,c;i=e.datepicker._getInst(t),e.datepicker._curInst&&e.datepicker._curInst!==i&&(e.datepicker._curInst.dpDiv.stop(!0,!0),i&&e.datepicker._datepickerShowing&&e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])),n=e.datepicker._get(i,"beforeShow"),a=n?n.apply(t,[t,i]):{},!1!==a&&(r(i.settings,a),i.lastVal=null,e.datepicker._lastInput=t,e.datepicker._setDateFromField(i),e.datepicker._inDialog&&(t.value=""),e.datepicker._pos||(e.datepicker._pos=e.datepicker._findPos(t),e.datepicker._pos[1]+=t.offsetHeight),o=!1,e(t).parents().each(function(){return!(o|="fixed"===e(this).css("position"))}),s={left:e.datepicker._pos[0],top:e.datepicker._pos[1]},e.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),e.datepicker._updateDatepicker(i),s=e.datepicker._checkOffset(i,s,o),i.dpDiv.css({position:e.datepicker._inDialog&&e.blockUI?"static":o?"fixed":"absolute",display:"none",left:s.left+"px",top:s.top+"px"}),i.inline||(l=e.datepicker._get(i,"showAnim"),c=e.datepicker._get(i,"duration"),i.dpDiv.zIndex(e(t).zIndex()+1),e.datepicker._datepickerShowing=!0,e.effects&&e.effects.effect[l]?i.dpDiv.show(l,e.datepicker._get(i,"showOptions"),c):i.dpDiv[l||"show"](l?c:null),e.datepicker._shouldFocusInput(i)&&i.input.focus(),e.datepicker._curInst=i))}},_updateDatepicker:function(t){this.maxRows=4,a=t,t.dpDiv.empty().append(this._generateHTML(t)),this._attachHandlers(t),t.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,n=this._getNumberOfMonths(t),r=n[1];t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),r>1&&t.dpDiv.addClass("ui-datepicker-multi-"+r).css("width",17*r+"em"),t.dpDiv[(1!==n[0]||1!==n[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),t.dpDiv[(this._get(t,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),t===e.datepicker._curInst&&e.datepicker._datepickerShowing&&e.datepicker._shouldFocusInput(t)&&t.input.focus(),t.yearshtml&&(i=t.yearshtml,setTimeout(function(){i===t.yearshtml&&t.yearshtml&&t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml),i=t.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(t,i,n){var r=t.dpDiv.outerWidth(),a=t.dpDiv.outerHeight(),o=t.input?t.input.outerWidth():0,s=t.input?t.input.outerHeight():0,l=document.documentElement.clientWidth+(n?0:e(document).scrollLeft()),c=document.documentElement.clientHeight+(n?0:e(document).scrollTop());return i.left-=this._get(t,"isRTL")?r-o:0,i.left-=n&&i.left===t.input.offset().left?e(document).scrollLeft():0,i.top-=n&&i.top===t.input.offset().top+s?e(document).scrollTop():0,i.left-=Math.min(i.left,i.left+r>l&&l>r?Math.abs(i.left+r-l):0),i.top-=Math.min(i.top,i.top+a>c&&c>a?Math.abs(a+s):0),i},_findPos:function(t){for(var i,n=this._getInst(t),r=this._get(n,"isRTL");t&&("hidden"===t.type||1!==t.nodeType||e.expr.filters.hidden(t));)t=t[r?"previousSibling":"nextSibling"];return i=e(t).offset(),[i.left,i.top]},_hideDatepicker:function(t){var i,n,r,a,s=this._curInst;!s||t&&s!==e.data(t,o)||this._datepickerShowing&&(i=this._get(s,"showAnim"),n=this._get(s,"duration"),r=function(){e.datepicker._tidyDialog(s)},e.effects&&(e.effects.effect[i]||e.effects[i])?s.dpDiv.hide(i,e.datepicker._get(s,"showOptions"),n,r):s.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?n:null,r),i||r(),this._datepickerShowing=!1,a=this._get(s,"onClose"),a&&a.apply(s.input?s.input[0]:null,[s.input?s.input.val():"",s]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),e.blockUI&&(e.unblockUI(),e("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(t){if(e.datepicker._curInst){var i=e(t.target),n=e.datepicker._getInst(i[0]);(i[0].id===e.datepicker._mainDivId||0!==i.parents("#"+e.datepicker._mainDivId).length||i.hasClass(e.datepicker.markerClassName)||i.closest("."+e.datepicker._triggerClass).length||!e.datepicker._datepickerShowing||e.datepicker._inDialog&&e.blockUI)&&(!i.hasClass(e.datepicker.markerClassName)||e.datepicker._curInst===n)||e.datepicker._hideDatepicker()}},_adjustDate:function(t,i,n){var r=e(t),a=this._getInst(r[0]);this._isDisabledDatepicker(r[0])||(this._adjustInstDate(a,i+("M"===n?this._get(a,"showCurrentAtPos"):0),n),this._updateDatepicker(a))},_gotoToday:function(t){var i,n=e(t),r=this._getInst(n[0]);this._get(r,"gotoCurrent")&&r.currentDay?(r.selectedDay=r.currentDay,r.drawMonth=r.selectedMonth=r.currentMonth,r.drawYear=r.selectedYear=r.currentYear):(i=new Date,r.selectedDay=i.getDate(),r.drawMonth=r.selectedMonth=i.getMonth(),r.drawYear=r.selectedYear=i.getFullYear()),this._notifyChange(r),this._adjustDate(n)},_selectMonthYear:function(t,i,n){var r=e(t),a=this._getInst(r[0]);a["selected"+("M"===n?"Month":"Year")]=a["draw"+("M"===n?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(r)},_selectDay:function(t,i,n,r){var a,o=e(t);e(r).hasClass(this._unselectableClass)||this._isDisabledDatepicker(o[0])||(a=this._getInst(o[0]),a.selectedDay=a.currentDay=e("a",r).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=n,this._selectDate(t,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(t){var i=e(t);this._selectDate(i,"")},_selectDate:function(t,i){var n,r=e(t),a=this._getInst(r[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),n=this._get(a,"onSelect"),n?n.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(t){var i,n,r,a=this._get(t,"altField");a&&(i=this._get(t,"altFormat")||this._get(t,"dateFormat"),n=this._getDate(t),r=this.formatDate(i,n,this._getFormatConfig(t)),e(a).each(function(){e(this).val(r)}))},noWeekends:function(e){var t=e.getDay();return[t>0&&t<6,""]},iso8601Week:function(e){var t,i=new Date(e.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),t=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((t-i)/864e5)/7)+1},parseDate:function(t,i,n){if(null==t||null==i)throw"Invalid arguments";if(""===(i="object"==typeof i?i.toString():i+""))return null;var r,a,o,s,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,h=(n?n.dayNames:null)||this._defaults.dayNames,p=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,f=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,g=-1,v=-1,y=-1,_=!1,b=function(e){var i=r+1<t.length&&t.charAt(r+1)===e;return i&&r++,i},w=function(e){var t=b(e),n="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,r=new RegExp("^\\d{1,"+n+"}"),a=i.substring(l).match(r);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},x=function(t,n,r){var a=-1,o=e.map(b(t)?r:n,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(e.each(o,function(e,t){var n=t[1];if(i.substr(l,n.length).toLowerCase()===n.toLowerCase())return a=t[0],l+=n.length,!1}),-1!==a)return a+1;throw"Unknown name at position "+l},k=function(){if(i.charAt(l)!==t.charAt(r))throw"Unexpected literal at position "+l;l++};for(r=0;r<t.length;r++)if(_)"'"!==t.charAt(r)||b("'")?k():_=!1;else switch(t.charAt(r)){case"d":v=w("d");break;case"D":x("D",d,h);break;case"o":y=w("o");break;case"m":g=w("m");break;case"M":g=x("M",p,f);break;case"y":m=w("y");break;case"@":s=new Date(w("@")),m=s.getFullYear(),g=s.getMonth()+1,v=s.getDate();break;case"!":s=new Date((w("!")-this._ticksTo1970)/1e4),m=s.getFullYear(),g=s.getMonth()+1,v=s.getDate();break;case"'":b("'")?k():_=!0;break;default:k()}if(l<i.length&&(o=i.substr(l),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===m?m=(new Date).getFullYear():m<100&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(m<=u?0:-100)),y>-1)for(g=1,v=y;;){if(a=this._getDaysInMonth(m,g-1),v<=a)break;g++,v-=a}if(s=this._daylightSavingAdjust(new Date(m,g-1,v)),s.getFullYear()!==m||s.getMonth()+1!==g||s.getDate()!==v)throw"Invalid date";return s},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(e,t,i){if(!t)return"";var n,r=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,o=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,s=(i?i.monthNames:null)||this._defaults.monthNames,l=function(t){var i=n+1<e.length&&e.charAt(n+1)===t;return i&&n++,i},c=function(e,t,i){var n=""+t;if(l(e))for(;n.length<i;)n="0"+n;return n},u=function(e,t,i,n){return l(e)?n[t]:i[t]},d="",h=!1;if(t)for(n=0;n<e.length;n++)if(h)"'"!==e.charAt(n)||l("'")?d+=e.charAt(n):h=!1;else switch(e.charAt(n)){case"d":d+=c("d",t.getDate(),2);break;case"D":d+=u("D",t.getDay(),r,a);break;case"o":d+=c("o",Math.round((new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()-new Date(t.getFullYear(),0,0).getTime())/864e5),3);break;case"m":d+=c("m",t.getMonth()+1,2);break;case"M":d+=u("M",t.getMonth(),o,s);break;case"y":d+=l("y")?t.getFullYear():(t.getYear()%100<10?"0":"")+t.getYear()%100;break;case"@":d+=t.getTime();break;case"!":d+=1e4*t.getTime()+this._ticksTo1970;break;case"'":l("'")?d+="'":h=!0;break;default:d+=e.charAt(n)}return d},_possibleChars:function(e){var t,i="",n=!1,r=function(i){var n=t+1<e.length&&e.charAt(t+1)===i;return n&&t++,n};for(t=0;t<e.length;t++)if(n)"'"!==e.charAt(t)||r("'")?i+=e.charAt(t):n=!1;else switch(e.charAt(t)){case"d":case"m":
|
||
case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":r("'")?i+="'":n=!0;break;default:i+=e.charAt(t)}return i},_get:function(e,t){return void 0!==e.settings[t]?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var i=this._get(e,"dateFormat"),n=e.lastVal=e.input?e.input.val():null,r=this._getDefaultDate(e),a=r,o=this._getFormatConfig(e);try{a=this.parseDate(i,n,o)||r}catch(e){n=t?"":n}e.selectedDay=a.getDate(),e.drawMonth=e.selectedMonth=a.getMonth(),e.drawYear=e.selectedYear=a.getFullYear(),e.currentDay=n?a.getDate():0,e.currentMonth=n?a.getMonth():0,e.currentYear=n?a.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(t,i,n){var r=null==i||""===i?n:"string"==typeof i?function(i){try{return e.datepicker.parseDate(e.datepicker._get(t,"dateFormat"),i,e.datepicker._getFormatConfig(t))}catch(e){}for(var n=(i.toLowerCase().match(/^c/)?e.datepicker._getDate(t):null)||new Date,r=n.getFullYear(),a=n.getMonth(),o=n.getDate(),s=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=s.exec(i);l;){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(r,a));break;case"y":case"Y":r+=parseInt(l[1],10),o=Math.min(o,e.datepicker._getDaysInMonth(r,a))}l=s.exec(i)}return new Date(r,a,o)}(i):"number"==typeof i?isNaN(i)?n:function(e){var t=new Date;return t.setDate(t.getDate()+e),t}(i):new Date(i.getTime());return r=r&&"Invalid Date"===r.toString()?n:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,i){var n=!t,r=e.selectedMonth,a=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),r===e.selectedMonth&&a===e.selectedYear||i||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(n?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_attachHandlers:function(t){var i=this._get(t,"stepMonths"),n="#"+t.id.replace(/\\\\/g,"\\");t.dpDiv.find("[data-handler]").map(function(){var t={prev:function(){e.datepicker._adjustDate(n,-i,"M")},next:function(){e.datepicker._adjustDate(n,+i,"M")},hide:function(){e.datepicker._hideDatepicker()},today:function(){e.datepicker._gotoToday(n)},selectDay:function(){return e.datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return e.datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return e.datepicker._selectMonthYear(n,this,"Y"),!1}};e(this).bind(this.getAttribute("data-event"),t[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,i,n,r,a,o,s,l,c,u,d,h,p,f,m,g,v,y,_,b,w,x,k,C,T,S,E,A,I,D,M,L,O,N,P,R,j,z,F,B=new Date,U=this._daylightSavingAdjust(new Date(B.getFullYear(),B.getMonth(),B.getDate())),$=this._get(e,"isRTL"),q=this._get(e,"showButtonPanel"),H=this._get(e,"hideIfNoPrevNext"),W=this._get(e,"navigationAsDateFormat"),V=this._getNumberOfMonths(e),G=this._get(e,"showCurrentAtPos"),Y=this._get(e,"stepMonths"),K=1!==V[0]||1!==V[1],X=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(e,"min"),Z=this._getMinMaxDate(e,"max"),J=e.drawMonth-G,ee=e.drawYear;if(J<0&&(J+=12,ee--),Z)for(t=this._daylightSavingAdjust(new Date(Z.getFullYear(),Z.getMonth()-V[0]*V[1]+1,Z.getDate())),t=Q&&t<Q?Q:t;this._daylightSavingAdjust(new Date(ee,J,1))>t;)--J<0&&(J=11,ee--);for(e.drawMonth=J,e.drawYear=ee,i=this._get(e,"prevText"),i=W?this.formatDate(i,this._daylightSavingAdjust(new Date(ee,J-Y,1)),this._getFormatConfig(e)):i,n=this._canAdjustMonth(e,-1,ee,J)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+($?"e":"w")+"'>"+i+"</span></a>":H?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+($?"e":"w")+"'>"+i+"</span></a>",r=this._get(e,"nextText"),r=W?this.formatDate(r,this._daylightSavingAdjust(new Date(ee,J+Y,1)),this._getFormatConfig(e)):r,a=this._canAdjustMonth(e,1,ee,J)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+r+"'><span class='ui-icon ui-icon-circle-triangle-"+($?"w":"e")+"'>"+r+"</span></a>":H?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+r+"'><span class='ui-icon ui-icon-circle-triangle-"+($?"w":"e")+"'>"+r+"</span></a>",o=this._get(e,"currentText"),s=this._get(e,"gotoCurrent")&&e.currentDay?X:U,o=W?this.formatDate(o,s,this._getFormatConfig(e)):o,l=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",c=q?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+($?l:"")+(this._isInRange(e,s)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+o+"</button>":"")+($?"":l)+"</div>":"",u=parseInt(this._get(e,"firstDay"),10),u=isNaN(u)?0:u,d=this._get(e,"showWeek"),h=this._get(e,"dayNames"),p=this._get(e,"dayNamesMin"),f=this._get(e,"monthNames"),m=this._get(e,"monthNamesShort"),g=this._get(e,"beforeShowDay"),v=this._get(e,"showOtherMonths"),y=this._get(e,"selectOtherMonths"),_=this._getDefaultDate(e),b="",x=0;x<V[0];x++){for(k="",this.maxRows=4,C=0;C<V[1];C++){if(T=this._daylightSavingAdjust(new Date(ee,J,e.selectedDay)),S=" ui-corner-all",E="",K){if(E+="<div class='ui-datepicker-group",V[1]>1)switch(C){case 0:E+=" ui-datepicker-group-first",S=" ui-corner-"+($?"right":"left");break;case V[1]-1:E+=" ui-datepicker-group-last",S=" ui-corner-"+($?"left":"right");break;default:E+=" ui-datepicker-group-middle",S=""}E+="'>"}for(E+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+S+"'>"+(/all|left/.test(S)&&0===x?$?a:n:"")+(/all|right/.test(S)&&0===x?$?n:a:"")+this._generateMonthYearHeader(e,J,ee,Q,Z,x>0||C>0,f,m)+"</div><table class='ui-datepicker-calendar'><thead><tr>",A=d?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",w=0;w<7;w++)I=(w+u)%7,A+="<th"+((w+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+h[I]+"'>"+p[I]+"</span></th>";for(E+=A+"</tr></thead><tbody>",D=this._getDaysInMonth(ee,J),ee===e.selectedYear&&J===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,D)),M=(this._getFirstDayOfMonth(ee,J)-u+7)%7,L=Math.ceil((M+D)/7),O=K&&this.maxRows>L?this.maxRows:L,this.maxRows=O,N=this._daylightSavingAdjust(new Date(ee,J,1-M)),P=0;P<O;P++){for(E+="<tr>",R=d?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(N)+"</td>":"",w=0;w<7;w++)j=g?g.apply(e.input?e.input[0]:null,[N]):[!0,""],z=N.getMonth()!==J,F=z&&!y||!j[0]||Q&&N<Q||Z&&N>Z,R+="<td class='"+((w+u+6)%7>=5?" ui-datepicker-week-end":"")+(z?" ui-datepicker-other-month":"")+(N.getTime()===T.getTime()&&J===e.selectedMonth&&e._keyEvent||_.getTime()===N.getTime()&&_.getTime()===T.getTime()?" "+this._dayOverClass:"")+(F?" "+this._unselectableClass+" ui-state-disabled":"")+(z&&!v?"":" "+j[1]+(N.getTime()===X.getTime()?" "+this._currentClass:"")+(N.getTime()===U.getTime()?" ui-datepicker-today":""))+"'"+(z&&!v||!j[2]?"":" title='"+j[2].replace(/'/g,"'")+"'")+(F?"":" data-handler='selectDay' data-event='click' data-month='"+N.getMonth()+"' data-year='"+N.getFullYear()+"'")+">"+(z&&!v?" ":F?"<span class='ui-state-default'>"+N.getDate()+"</span>":"<a class='ui-state-default"+(N.getTime()===U.getTime()?" ui-state-highlight":"")+(N.getTime()===X.getTime()?" ui-state-active":"")+(z?" ui-priority-secondary":"")+"' href='#'>"+N.getDate()+"</a>")+"</td>",N.setDate(N.getDate()+1),N=this._daylightSavingAdjust(N);E+=R+"</tr>"}J++,J>11&&(J=0,ee++),E+="</tbody></table>"+(K?"</div>"+(V[0]>0&&C===V[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=E}b+=k}return b+=c,e._keyEvent=!1,b},_generateMonthYearHeader:function(e,t,i,n,r,a,o,s){var l,c,u,d,h,p,f,m,g=this._get(e,"changeMonth"),v=this._get(e,"changeYear"),y=this._get(e,"showMonthAfterYear"),_="<div class='ui-datepicker-title'>",b="";if(a||!g)b+="<span class='ui-datepicker-month'>"+o[t]+"</span>";else{for(l=n&&n.getFullYear()===i,c=r&&r.getFullYear()===i,b+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;u<12;u++)(!l||u>=n.getMonth())&&(!c||u<=r.getMonth())&&(b+="<option value='"+u+"'"+(u===t?" selected='selected'":"")+">"+s[u]+"</option>");b+="</select>"}if(y||(_+=b+(!a&&g&&v?"":" ")),!e.yearshtml)if(e.yearshtml="",a||!v)_+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(d=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),p=function(e){var t=e.match(/c[+\-].*/)?i+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);return isNaN(t)?h:t},f=p(d[0]),m=Math.max(f,p(d[1]||"")),f=n?Math.max(f,n.getFullYear()):f,m=r?Math.min(m,r.getFullYear()):m,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";f<=m;f++)e.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";e.yearshtml+="</select>",_+=e.yearshtml,e.yearshtml=null}return _+=this._get(e,"yearSuffix"),y&&(_+=(!a&&g&&v?"":" ")+b),_+="</div>"},_adjustInstDate:function(e,t,i){var n=e.drawYear+("Y"===i?t:0),r=e.drawMonth+("M"===i?t:0),a=Math.min(e.selectedDay,this._getDaysInMonth(n,r))+("D"===i?t:0),o=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(n,r,a)));e.selectedDay=o.getDate(),e.drawMonth=e.selectedMonth=o.getMonth(),e.drawYear=e.selectedYear=o.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(e)},_restrictMinMax:function(e,t){var i=this._getMinMaxDate(e,"min"),n=this._getMinMaxDate(e,"max"),r=i&&t<i?i:t;return n&&r>n?n:r},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){var t=this._get(e,"numberOfMonths");return null==t?[1,1]:"number"==typeof t?[1,t]:t},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,i,n){var r=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(i,n+(t<0?t:r[0]*r[1]),1));return t<0&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var i,n,r=this._getMinMaxDate(e,"min"),a=this._getMinMaxDate(e,"max"),o=null,s=null,l=this._get(e,"yearRange");return l&&(i=l.split(":"),n=(new Date).getFullYear(),o=parseInt(i[0],10),s=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(o+=n),i[1].match(/[+\-].*/)&&(s+=n)),(!r||t.getTime()>=r.getTime())&&(!a||t.getTime()<=a.getTime())&&(!o||t.getFullYear()>=o)&&(!s||t.getFullYear()<=s)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),{shortYearCutoff:t,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,i,n){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);var r=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(n,i,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),r,this._getFormatConfig(e))}}),e.fn.datepicker=function(t){if(!this.length)return this;e.datepicker.initialized||(e(document).mousedown(e.datepicker._checkExternalClick),e.datepicker.initialized=!0),0===e("#"+e.datepicker._mainDivId).length&&e("body").append(e.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof t?e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this].concat(i)):e.datepicker._attachDatepicker(this,t)}):e.datepicker["_"+t+"Datepicker"].apply(e.datepicker,[this[0]].concat(i))},e.datepicker=new i,e.datepicker.initialized=!1,e.datepicker.uuid=(new Date).getTime(),e.datepicker.version="1.10.3"}(jQuery),function(e,t){var i={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},n={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};e.widget("ui.dialog",{version:"1.10.3",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var i=e(this).css(t).offset().top;i<0&&e(this).css("top",t.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&e.fn.draggable&&this._makeDraggable(),this.options.resizable&&e.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?e(t):this.document.find(t||"body").eq(0)},_destroy:function(){var e,t=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),e=t.parent.children().eq(t.index),e.length&&e[0]!==this.element[0]?e.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:e.noop,enable:e.noop,close:function(t){var i=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||e(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,t){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!t&&this._trigger("focus",e),i},open:function(){var t=this;if(this._isOpen)return void(this._moveToTop()&&this._focusTabbable());this._isOpen=!0,this.opener=e(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._trigger("open")},_focusTabbable:function(){var e=this.element.find("[autofocus]");e.length||(e=this.element.find(":tabbable")),e.length||(e=this.uiDialogButtonPane.find(":tabbable")),e.length||(e=this.uiDialogTitlebarClose.filter(":tabbable")),e.length||(e=this.uiDialog),e.eq(0).focus()},_keepFocus:function(t){function i(){var t=this.document[0].activeElement;this.uiDialog[0]===t||e.contains(this.uiDialog[0],t)||this._focusTabbable()}t.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=e("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===e.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);if(t.keyCode===e.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),n=i.filter(":first"),r=i.filter(":last");t.target!==r[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==n[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(r.focus(1),t.preventDefault()):(n.focus(1),t.preventDefault())}},mousedown:function(e){this._moveToTop(e)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=e("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(t){e(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=e("<button></button>").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(e){e.preventDefault(),this.close(e)}}),t=e("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(t),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(e){this.options.title||e.html(" "),e.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=e("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=e("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var t=this,i=this.options.buttons;if(this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),e.isEmptyObject(i)||e.isArray(i)&&!i.length)return void this.uiDialog.removeClass("ui-dialog-buttons");e.each(i,function(i,n){var r,a;n=e.isFunction(n)?{click:n,text:i}:n,n=e.extend({type:"button"},n),r=n.click,n.click=function(){r.apply(t.element[0],arguments)},a={icons:n.icons,text:n.showText},delete n.icons,delete n.showText,e("<button></button>",n).button(a).appendTo(t.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){function t(e){return{position:e.position,offset:e.offset}}var i=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,r){e(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",n,t(r))},drag:function(e,n){i._trigger("drag",e,t(n))},stop:function(r,a){n.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],e(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",r,t(a))}})},_makeResizable:function(){function t(e){return{originalPosition:e.originalPosition,originalSize:e.originalSize,position:e.position,size:e.size}}var i=this,n=this.options,r=n.resizable,a=this.uiDialog.css("position"),o="string"==typeof r?r:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:o,start:function(n,r){e(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",n,t(r))},resize:function(e,n){i._trigger("resize",e,t(n))},stop:function(r,a){n.height=e(this).height(),n.width=e(this).width(),e(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",r,t(a))}}).css("position",a)},_minHeight:function(){var e=this.options;return"auto"===e.height?e.minHeight:Math.min(e.minHeight,e.height)},_position:function(){var e=this.uiDialog.is(":visible");e||this.uiDialog.show(),this.uiDialog.position(this.options.position),e||this.uiDialog.hide()},_setOptions:function(t){var r=this,a=!1,o={};e.each(t,function(e,t){r._setOption(e,t),e in i&&(a=!0),e in n&&(o[e]=t)}),a&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(e,t){var i,n,r=this.uiDialog;"dialogClass"===e&&r.removeClass(this.options.dialogClass).addClass(t),"disabled"!==e&&(this._super(e,t),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:""+t}),"draggable"===e&&(i=r.is(":data(ui-draggable)"),i&&!t&&r.draggable("destroy"),!i&&t&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(n=r.is(":data(ui-resizable)"),n&&!t&&r.resizable("destroy"),n&&"string"==typeof t&&r.resizable("option","handles",t),n||!1===t||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var e,t,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),e=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),t=Math.max(0,n.minHeight-e),i="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-e):"none","auto"===n.height?this.element.css({minHeight:t,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,n.height-e)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=e(this);return e("<div>").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!e(t.target).closest(".ui-dialog").length||!!e(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var t=this,i=this.widgetFullName;e.ui.dialog.overlayInstances||this._delay(function(){e.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(n){t._allowInteraction(n)||(n.preventDefault(),e(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=e("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),e.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(e.ui.dialog.overlayInstances--,e.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),e.ui.dialog.overlayInstances=0,!1!==e.uiBackCompat&&e.widget("ui.dialog",e.ui.dialog,{_position:function(){var t,i=this.options.position,n=[],r=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(n=i.split?i.split(" "):[i[0],i[1]],1===n.length&&(n[1]=n[0]),e.each(["left","top"],function(e,t){+n[e]===n[e]&&(r[e]=n[e],n[e]=t)}),i={my:n[0]+(r[0]<0?r[0]:"+"+r[0])+" "+n[1]+(r[1]<0?r[1]:"+"+r[1]),at:n.join(" ")}),i=e.extend({},e.ui.dialog.prototype.options.position,i)):i=e.ui.dialog.prototype.options.position,t=this.uiDialog.is(":visible"),t||this.uiDialog.show(),this.uiDialog.position(i),t||this.uiDialog.hide()}})}(jQuery),function(e,t){var i=/up|down|vertical/,n=/up|left|vertical|horizontal/;e.effects.effect.blind=function(t,r){var a,o,s,l=e(this),c=["position","top","bottom","left","right","height","width"],u=e.effects.setMode(l,t.mode||"hide"),d=t.direction||"up",h=i.test(d),p=h?"height":"width",f=h?"top":"left",m=n.test(d),g={},v="show"===u;l.parent().is(".ui-effects-wrapper")?e.effects.save(l.parent(),c):e.effects.save(l,c),l.show(),a=e.effects.createWrapper(l).css({overflow:"hidden"}),o=a[p](),s=parseFloat(a.css(f))||0,g[p]=v?o:0,m||(l.css(h?"bottom":"right",0).css(h?"top":"left","auto").css({position:"absolute"}),g[f]=v?s:o+s),v&&(a.css(p,0),m||a.css(f,s+o)),a.animate(g,{duration:t.duration,easing:t.easing,queue:!1,complete:function(){"hide"===u&&l.hide(),e.effects.restore(l,c),e.effects.removeWrapper(l),r()}})}}(jQuery),function(e,t){e.effects.effect.bounce=function(t,i){var n,r,a,o=e(this),s=["position","top","bottom","left","right","height","width"],l=e.effects.setMode(o,t.mode||"effect"),c="hide"===l,u="show"===l,d=t.direction||"up",h=t.distance,p=t.times||5,f=2*p+(u||c?1:0),m=t.duration/f,g=t.easing,v="up"===d||"down"===d?"top":"left",y="up"===d||"left"===d,_=o.queue(),b=_.length;for((u||c)&&s.push("opacity"),e.effects.save(o,s),o.show(),e.effects.createWrapper(o),h||(h=o["top"===v?"outerHeight":"outerWidth"]()/3),u&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,y?2*-h:2*h).animate(a,m,g)),c&&(h/=Math.pow(2,p-1)),a={},a[v]=0,n=0;n<p;n++)r={},r[v]=(y?"-=":"+=")+h,o.animate(r,m,g).animate(a,m,g),h=c?2*h:h/2;c&&(r={opacity:0},r[v]=(y?"-=":"+=")+h,o.animate(r,m,g)),o.queue(function(){c&&o.hide(),e.effects.restore(o,s),e.effects.removeWrapper(o),i()}),b>1&&_.splice.apply(_,[1,0].concat(_.splice(b,f+1))),o.dequeue()}}(jQuery),function(e,t){e.effects.effect.clip=function(t,i){var n,r,a,o=e(this),s=["position","top","bottom","left","right","height","width"],l=e.effects.setMode(o,t.mode||"hide"),c="show"===l,u=t.direction||"vertical",d="vertical"===u,h=d?"height":"width",p=d?"top":"left",f={};e.effects.save(o,s),o.show(),n=e.effects.createWrapper(o).css({overflow:"hidden"}),r="IMG"===o[0].tagName?n:o,a=r[h](),c&&(r.css(h,0),r.css(p,a/2)),f[h]=c?a:0,f[p]=c?0:a/2,r.animate(f,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){c||o.hide(),e.effects.restore(o,s),e.effects.removeWrapper(o),i()}})}}(jQuery),function(e,t){e.effects.effect.drop=function(t,i){var n,r=e(this),a=["position","top","bottom","left","right","opacity","height","width"],o=e.effects.setMode(r,t.mode||"hide"),s="show"===o,l=t.direction||"left",c="up"===l||"down"===l?"top":"left",u="up"===l||"left"===l?"pos":"neg",d={opacity:s?1:0};e.effects.save(r,a),r.show(),e.effects.createWrapper(r),n=t.distance||r["top"===c?"outerHeight":"outerWidth"](!0)/2,s&&r.css("opacity",0).css(c,"pos"===u?-n:n),d[c]=(s?"pos"===u?"+=":"-=":"pos"===u?"-=":"+=")+n,r.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&r.hide(),e.effects.restore(r,a),e.effects.removeWrapper(r),i()}})}}(jQuery),function(e,t){e.effects.effect.explode=function(t,i){function n(){_.push(this),_.length===d*h&&r()}function r(){p.css({visibility:"visible"}),e(_).remove(),m||p.hide(),i()}var a,o,s,l,c,u,d=t.pieces?Math.round(Math.sqrt(t.pieces)):3,h=d,p=e(this),f=e.effects.setMode(p,t.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/h),y=Math.ceil(p.outerHeight()/d),_=[];for(a=0;a<d;a++)for(l=g.top+a*y,u=a-(d-1)/2,o=0;o<h;o++)s=g.left+o*v,c=o-(h-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*y}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:y,left:s+(m?c*v:0),top:l+(m?u*y:0),opacity:m?0:1}).animate({left:s+(m?0:c*v),top:l+(m?0:u*y),opacity:m?1:0},t.duration||500,t.easing,n)}}(jQuery),function(e,t){e.effects.effect.fade=function(t,i){var n=e(this),r=e.effects.setMode(n,t.mode||"toggle");n.animate({opacity:r},{queue:!1,duration:t.duration,easing:t.easing,complete:i})}}(jQuery),function(e,t){e.effects.effect.fold=function(t,i){var n,r,a=e(this),o=["position","top","bottom","left","right","height","width"],s=e.effects.setMode(a,t.mode||"hide"),l="show"===s,c="hide"===s,u=t.size||15,d=/([0-9]+)%/.exec(u),h=!!t.horizFirst,p=l!==h,f=p?["width","height"]:["height","width"],m=t.duration/2,g={},v={};e.effects.save(a,o),a.show(),n=e.effects.createWrapper(a).css({overflow:"hidden"}),r=p?[n.width(),n.height()]:[n.height(),n.width()],d&&(u=parseInt(d[1],10)/100*r[c?0:1]),l&&n.css(h?{height:0,width:u}:{height:u,width:0}),g[f[0]]=l?r[0]:u,v[f[1]]=l?r[1]:0,n.animate(g,m,t.easing).animate(v,m,t.easing,function(){c&&a.hide(),e.effects.restore(a,o),e.effects.removeWrapper(a),i()})}}(jQuery),function(e,t){e.effects.effect.highlight=function(t,i){var n=e(this),r=["backgroundImage","backgroundColor","opacity"],a=e.effects.setMode(n,t.mode||"show"),o={backgroundColor:n.css("backgroundColor")};"hide"===a&&(o.opacity=0),e.effects.save(n,r),n.show().css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(o,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===a&&n.hide(),e.effects.restore(n,r),i()}})}}(jQuery),function(e,t){e.effects.effect.pulsate=function(t,i){var n,r=e(this),a=e.effects.setMode(r,t.mode||"show"),o="show"===a,s="hide"===a,l=o||"hide"===a,c=2*(t.times||5)+(l?1:0),u=t.duration/c,d=0,h=r.queue(),p=h.length;for(!o&&r.is(":visible")||(r.css("opacity",0).show(),d=1),n=1;n<c;n++)r.animate({opacity:d},u,t.easing),d=1-d;r.animate({opacity:d},u,t.easing),r.queue(function(){s&&r.hide(),i()}),p>1&&h.splice.apply(h,[1,0].concat(h.splice(p,c+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.puff=function(t,i){var n=e(this),r=e.effects.setMode(n,t.mode||"hide"),a="hide"===r,o=parseInt(t.percent,10)||150,s=o/100,l={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()};e.extend(t,{effect:"scale",queue:!1,fade:!0,mode:r,complete:i,percent:a?o:100,from:a?l:{height:l.height*s,width:l.width*s,outerHeight:l.outerHeight*s,outerWidth:l.outerWidth*s}}),n.effect(t)},e.effects.effect.scale=function(t,i){var n=e(this),r=e.extend(!0,{},t),a=e.effects.setMode(n,t.mode||"effect"),o=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"hide"===a?0:100),s=t.direction||"both",l=t.origin,c={height:n.height(),width:n.width(),outerHeight:n.outerHeight(),outerWidth:n.outerWidth()},u={y:"horizontal"!==s?o/100:1,x:"vertical"!==s?o/100:1};r.effect="size",r.queue=!1,r.complete=i,"effect"!==a&&(r.origin=l||["middle","center"],r.restore=!0),r.from=t.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:c),r.to={height:c.height*u.y,width:c.width*u.x,outerHeight:c.outerHeight*u.y,outerWidth:c.outerWidth*u.x},r.fade&&("show"===a&&(r.from.opacity=0,r.to.opacity=1),"hide"===a&&(r.from.opacity=1,r.to.opacity=0)),n.effect(r)},e.effects.effect.size=function(t,i){var n,r,a,o=e(this),s=["position","top","bottom","left","right","width","height","overflow","opacity"],l=["position","top","bottom","left","right","overflow","opacity"],c=["width","height","overflow"],u=["fontSize"],d=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=e.effects.setMode(o,t.mode||"effect"),f=t.restore||"effect"!==p,m=t.scale||"both",g=t.origin||["middle","center"],v=o.css("position"),y=f?s:l,_={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),n={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===t.mode&&"show"===p?(o.from=t.to||_,o.to=t.from||n):(o.from=t.from||("show"===p?_:n),o.to=t.to||("hide"===p?_:n)),a={from:{y:o.from.height/n.height,x:o.from.width/n.width},to:{y:o.to.height/n.height,x:o.to.width/n.width}},"box"!==m&&"both"!==m||(a.from.y!==a.to.y&&(y=y.concat(d),o.from=e.effects.setTransition(o,d,a.from.y,o.from),
|
||
o.to=e.effects.setTransition(o,d,a.to.y,o.to)),a.from.x!==a.to.x&&(y=y.concat(h),o.from=e.effects.setTransition(o,h,a.from.x,o.from),o.to=e.effects.setTransition(o,h,a.to.x,o.to))),"content"!==m&&"both"!==m||a.from.y!==a.to.y&&(y=y.concat(u).concat(c),o.from=e.effects.setTransition(o,u,a.from.y,o.from),o.to=e.effects.setTransition(o,u,a.to.y,o.to)),e.effects.save(o,y),o.show(),e.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(r=e.effects.getBaseline(g,n),o.from.top=(n.outerHeight-o.outerHeight())*r.y,o.from.left=(n.outerWidth-o.outerWidth())*r.x,o.to.top=(n.outerHeight-o.to.outerHeight)*r.y,o.to.left=(n.outerWidth-o.to.outerWidth)*r.x),o.css(o.from),"content"!==m&&"both"!==m||(d=d.concat(["marginTop","marginBottom"]).concat(u),h=h.concat(["marginLeft","marginRight"]),c=s.concat(d).concat(h),o.find("*[width]").each(function(){var i=e(this),n={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&e.effects.save(i,c),i.from={height:n.height*a.from.y,width:n.width*a.from.x,outerHeight:n.outerHeight*a.from.y,outerWidth:n.outerWidth*a.from.x},i.to={height:n.height*a.to.y,width:n.width*a.to.x,outerHeight:n.height*a.to.y,outerWidth:n.width*a.to.x},a.from.y!==a.to.y&&(i.from=e.effects.setTransition(i,d,a.from.y,i.from),i.to=e.effects.setTransition(i,d,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=e.effects.setTransition(i,h,a.from.x,i.from),i.to=e.effects.setTransition(i,h,a.to.x,i.to)),i.css(i.from),i.animate(i.to,t.duration,t.easing,function(){f&&e.effects.restore(i,c)})})),o.animate(o.to,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),e.effects.restore(o,y),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):e.each(["top","left"],function(e,t){o.css(t,function(t,i){var n=parseInt(i,10),r=e?o.to.left:o.to.top;return"auto"===i?r+"px":n+r+"px"})})),e.effects.removeWrapper(o),i()}})}}(jQuery),function(e,t){e.effects.effect.shake=function(t,i){var n,r=e(this),a=["position","top","bottom","left","right","height","width"],o=e.effects.setMode(r,t.mode||"effect"),s=t.direction||"left",l=t.distance||20,c=t.times||3,u=2*c+1,d=Math.round(t.duration/u),h="up"===s||"down"===s?"top":"left",p="up"===s||"left"===s,f={},m={},g={},v=r.queue(),y=v.length;for(e.effects.save(r,a),r.show(),e.effects.createWrapper(r),f[h]=(p?"-=":"+=")+l,m[h]=(p?"+=":"-=")+2*l,g[h]=(p?"-=":"+=")+2*l,r.animate(f,d,t.easing),n=1;n<c;n++)r.animate(m,d,t.easing).animate(g,d,t.easing);r.animate(m,d,t.easing).animate(f,d/2,t.easing).queue(function(){"hide"===o&&r.hide(),e.effects.restore(r,a),e.effects.removeWrapper(r),i()}),y>1&&v.splice.apply(v,[1,0].concat(v.splice(y,u+1))),r.dequeue()}}(jQuery),function(e,t){e.effects.effect.slide=function(t,i){var n,r=e(this),a=["position","top","bottom","left","right","width","height"],o=e.effects.setMode(r,t.mode||"show"),s="show"===o,l=t.direction||"left",c="up"===l||"down"===l?"top":"left",u="up"===l||"left"===l,d={};e.effects.save(r,a),r.show(),n=t.distance||r["top"===c?"outerHeight":"outerWidth"](!0),e.effects.createWrapper(r).css({overflow:"hidden"}),s&&r.css(c,u?isNaN(n)?"-"+n:-n:n),d[c]=(s?u?"+=":"-=":u?"-=":"+=")+n,r.animate(d,{queue:!1,duration:t.duration,easing:t.easing,complete:function(){"hide"===o&&r.hide(),e.effects.restore(r,a),e.effects.removeWrapper(r),i()}})}}(jQuery),function(e,t){e.effects.effect.transfer=function(t,i){var n=e(this),r=e(t.to),a="fixed"===r.css("position"),o=e("body"),s=a?o.scrollTop():0,l=a?o.scrollLeft():0,c=r.offset(),u={top:c.top-s,left:c.left-l,height:r.innerHeight(),width:r.innerWidth()},d=n.offset(),h=e("<div class='ui-effects-transfer'></div>").appendTo(document.body).addClass(t.className).css({top:d.top-s,left:d.left-l,height:n.innerHeight(),width:n.innerWidth(),position:a?"fixed":"absolute"}).animate(u,t.duration,t.easing,function(){h.remove(),i()})}}(jQuery),function(e,t){e.widget("ui.menu",{version:"1.10.3",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,e.proxy(function(e){this.options.disabled&&e.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(e){e.preventDefault()},"click .ui-state-disabled > a":function(e){e.preventDefault()},"click .ui-menu-item:has(a)":function(t){var i=e(t.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(t),i.has(".ui-menu").length?this.expand(t):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var i=e(t.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(t,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this.element.children(".ui-menu-item").eq(0);t||this.focus(e,i)},blur:function(t){this._delay(function(){e.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){e(t.target).closest(".ui-menu").length||this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var t=e(this);t.data("ui-menu-submenu-carat")&&t.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(t){function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var n,r,a,o,s,l=!0;switch(t.keyCode){case e.ui.keyCode.PAGE_UP:this.previousPage(t);break;case e.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case e.ui.keyCode.HOME:this._move("first","first",t);break;case e.ui.keyCode.END:this._move("last","last",t);break;case e.ui.keyCode.UP:this.previous(t);break;case e.ui.keyCode.DOWN:this.next(t);break;case e.ui.keyCode.LEFT:this.collapse(t);break;case e.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case e.ui.keyCode.ENTER:case e.ui.keyCode.SPACE:this._activate(t);break;case e.ui.keyCode.ESCAPE:this.collapse(t);break;default:l=!1,r=this.previousFilter||"",a=String.fromCharCode(t.keyCode),o=!1,clearTimeout(this.filterTimer),a===r?o=!0:a=r+a,s=new RegExp("^"+i(a),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return s.test(e(this).children("a").text())}),n=o&&-1!==n.index(this.active.next())?this.active.nextAll(".ui-menu-item"):n,n.length||(a=String.fromCharCode(t.keyCode),s=new RegExp("^"+i(a),"i"),n=this.activeMenu.children(".ui-menu-item").filter(function(){return s.test(e(this).children("a").text())})),n.length?(this.focus(t,n),n.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}l&&t.preventDefault()},_activate:function(e){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var t,i=this.options.icons.submenu,n=this.element.find(this.options.menus);n.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=e(this),n=t.prev("a"),r=e("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);n.attr("aria-haspopup","true").prepend(r),t.attr("aria-labelledby",n.attr("id"))}),t=n.add(this.element),t.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),t.children(":not(.ui-menu-item)").each(function(){var t=e(this);/[^\-\u2014\u2013\s]/.test(t.text())||t.addClass("ui-widget-content ui-menu-divider")}),t.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!e.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){"icons"===e&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(t.submenu),this._super(e,t)},focus:function(e,t){var i,n;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),n=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",n.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=t.children(".ui-menu"),i.length&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(t){var i,n,r,a,o,s;this._hasScroll()&&(i=parseFloat(e.css(this.activeMenu[0],"borderTopWidth"))||0,n=parseFloat(e.css(this.activeMenu[0],"paddingTop"))||0,r=t.offset().top-this.activeMenu.offset().top-i-n,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),s=t.height(),r<0?this.activeMenu.scrollTop(a+r):r+s>o&&this.activeMenu.scrollTop(a+r-o+s))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",e,{item:this.active}))},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(t){var i=e.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var n=i?this.element:e(t&&t.target).closest(this.element.find(".ui-menu"));n.length||(n=this.element),this._close(n),this.blur(t),this.activeMenu=n},this.delay)},_close:function(e){e||(e=this.active?this.active.parent():this.element),e.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(e,t,i){var n;this.active&&(n="first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[e+"All"](".ui-menu-item").eq(0)),n&&n.length&&this.active||(n=this.activeMenu.children(".ui-menu-item")[t]()),this.focus(i,n)},nextPage:function(t){var i,n,r;if(!this.active)return void this.next(t);this.isLastItem()||(this._hasScroll()?(n=this.active.offset().top,r=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-n-r<0}),this.focus(t,i)):this.focus(t,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]()))},previousPage:function(t){var i,n,r;if(!this.active)return void this.next(t);this.isFirstItem()||(this._hasScroll()?(n=this.active.offset().top,r=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=e(this),i.offset().top-n+r>0}),this.focus(t,i)):this.focus(t,this.activeMenu.children(".ui-menu-item").first()))},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||e(t.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,i)}})}(jQuery),function(e,t){function i(e,t,i){return[parseFloat(e[0])*(p.test(e[0])?t/100:1),parseFloat(e[1])*(p.test(e[1])?i/100:1)]}function n(t,i){return parseInt(e.css(t,i),10)||0}function r(t){var i=t[0];return 9===i.nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(i)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var a,o=Math.max,s=Math.abs,l=Math.round,c=/left|center|right/,u=/top|center|bottom/,d=/[\+\-]\d+(\.[\d]+)?%?/,h=/^\w+/,p=/%$/,f=e.fn.position;e.position={scrollbarWidth:function(){if(void 0!==a)return a;var t,i,n=e("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),r=n.children()[0];return e("body").append(n),t=r.offsetWidth,n.css("overflow","scroll"),i=r.offsetWidth,t===i&&(i=n[0].clientWidth),n.remove(),a=t-i},getScrollInfo:function(t){var i=t.isWindow?"":t.element.css("overflow-x"),n=t.isWindow?"":t.element.css("overflow-y"),r="scroll"===i||"auto"===i&&t.width<t.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&t.height<t.element[0].scrollHeight?e.position.scrollbarWidth():0,height:r?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var i=e(t||window),n=e.isWindow(i[0]);return{element:i,isWindow:n,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:n?i.width():i.outerWidth(),height:n?i.height():i.outerHeight()}}},e.fn.position=function(t){if(!t||!t.of)return f.apply(this,arguments);t=e.extend({},t);var a,p,m,g,v,y,_=e(t.of),b=e.position.getWithinInfo(t.within),w=e.position.getScrollInfo(b),x=(t.collision||"flip").split(" "),k={};return y=r(_),_[0].preventDefault&&(t.at="left top"),p=y.width,m=y.height,g=y.offset,v=e.extend({},g),e.each(["my","at"],function(){var e,i,n=(t[this]||"").split(" ");1===n.length&&(n=c.test(n[0])?n.concat(["center"]):u.test(n[0])?["center"].concat(n):["center","center"]),n[0]=c.test(n[0])?n[0]:"center",n[1]=u.test(n[1])?n[1]:"center",e=d.exec(n[0]),i=d.exec(n[1]),k[this]=[e?e[0]:0,i?i[0]:0],t[this]=[h.exec(n[0])[0],h.exec(n[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===t.at[0]?v.left+=p:"center"===t.at[0]&&(v.left+=p/2),"bottom"===t.at[1]?v.top+=m:"center"===t.at[1]&&(v.top+=m/2),a=i(k.at,p,m),v.left+=a[0],v.top+=a[1],this.each(function(){var r,c,u=e(this),d=u.outerWidth(),h=u.outerHeight(),f=n(this,"marginLeft"),y=n(this,"marginTop"),C=d+f+n(this,"marginRight")+w.width,T=h+y+n(this,"marginBottom")+w.height,S=e.extend({},v),E=i(k.my,u.outerWidth(),u.outerHeight());"right"===t.my[0]?S.left-=d:"center"===t.my[0]&&(S.left-=d/2),"bottom"===t.my[1]?S.top-=h:"center"===t.my[1]&&(S.top-=h/2),S.left+=E[0],S.top+=E[1],e.support.offsetFractions||(S.left=l(S.left),S.top=l(S.top)),r={marginLeft:f,marginTop:y},e.each(["left","top"],function(i,n){e.ui.position[x[i]]&&e.ui.position[x[i]][n](S,{targetWidth:p,targetHeight:m,elemWidth:d,elemHeight:h,collisionPosition:r,collisionWidth:C,collisionHeight:T,offset:[a[0]+E[0],a[1]+E[1]],my:t.my,at:t.at,within:b,elem:u})}),t.using&&(c=function(e){var i=g.left-S.left,n=i+p-d,r=g.top-S.top,a=r+m-h,l={target:{element:_,left:g.left,top:g.top,width:p,height:m},element:{element:u,left:S.left,top:S.top,width:d,height:h},horizontal:n<0?"left":i>0?"right":"center",vertical:a<0?"top":r>0?"bottom":"middle"};p<d&&s(i+n)<p&&(l.horizontal="center"),m<h&&s(r+a)<m&&(l.vertical="middle"),o(s(i),s(n))>o(s(r),s(a))?l.important="horizontal":l.important="vertical",t.using.call(this,e,l)}),u.offset(e.extend(S,{using:c}))})},e.ui.position={fit:{left:function(e,t){var i,n=t.within,r=n.isWindow?n.scrollLeft:n.offset.left,a=n.width,s=e.left-t.collisionPosition.marginLeft,l=r-s,c=s+t.collisionWidth-a-r;t.collisionWidth>a?l>0&&c<=0?(i=e.left+l+t.collisionWidth-a-r,e.left+=l-i):e.left=c>0&&l<=0?r:l>c?r+a-t.collisionWidth:r:l>0?e.left+=l:c>0?e.left-=c:e.left=o(e.left-s,e.left)},top:function(e,t){var i,n=t.within,r=n.isWindow?n.scrollTop:n.offset.top,a=t.within.height,s=e.top-t.collisionPosition.marginTop,l=r-s,c=s+t.collisionHeight-a-r;t.collisionHeight>a?l>0&&c<=0?(i=e.top+l+t.collisionHeight-a-r,e.top+=l-i):e.top=c>0&&l<=0?r:l>c?r+a-t.collisionHeight:r:l>0?e.top+=l:c>0?e.top-=c:e.top=o(e.top-s,e.top)}},flip:{left:function(e,t){var i,n,r=t.within,a=r.offset.left+r.scrollLeft,o=r.width,l=r.isWindow?r.scrollLeft:r.offset.left,c=e.left-t.collisionPosition.marginLeft,u=c-l,d=c+t.collisionWidth-o-l,h="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,p="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,f=-2*t.offset[0];u<0?((i=e.left+h+p+f+t.collisionWidth-o-a)<0||i<s(u))&&(e.left+=h+p+f):d>0&&((n=e.left-t.collisionPosition.marginLeft+h+p+f-l)>0||s(n)<d)&&(e.left+=h+p+f)},top:function(e,t){var i,n,r=t.within,a=r.offset.top+r.scrollTop,o=r.height,l=r.isWindow?r.scrollTop:r.offset.top,c=e.top-t.collisionPosition.marginTop,u=c-l,d=c+t.collisionHeight-o-l,h="top"===t.my[1],p=h?-t.elemHeight:"bottom"===t.my[1]?t.elemHeight:0,f="top"===t.at[1]?t.targetHeight:"bottom"===t.at[1]?-t.targetHeight:0,m=-2*t.offset[1];u<0?(n=e.top+p+f+m+t.collisionHeight-o-a,e.top+p+f+m>u&&(n<0||n<s(u))&&(e.top+=p+f+m)):d>0&&(i=e.top-t.collisionPosition.marginTop+p+f+m-l,e.top+p+f+m>d&&(i>0||s(i)<d)&&(e.top+=p+f+m))}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments),e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments),e.ui.position.fit.top.apply(this,arguments)}}},function(){var t,i,n,r,a,o=document.getElementsByTagName("body")[0],s=document.createElement("div");t=document.createElement(o?"div":"body"),n={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&e.extend(n,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in n)t.style[a]=n[a];t.appendChild(s),i=o||document.documentElement,i.insertBefore(t,i.firstChild),s.style.cssText="position: absolute; left: 10.7432222px;",r=e(s).offset().left,e.support.offsetFractions=r>10&&r<11,t.innerHTML="",i.removeChild(t)}()}(jQuery),function(e,t){e.widget("ui.progressbar",{version:"1.10.3",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=e("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(e){if(void 0===e)return this.options.value;this.options.value=this._constrainedValue(e),this._refreshValue()},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=!1===e,"number"!=typeof e&&(e=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var t=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(t),this._refreshValue()},_setOption:function(e,t){"max"===e&&(t=Math.max(this.min,t)),this._super(e,t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).toggleClass("ui-corner-right",t===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=e("<div class='ui-progressbar-overlay'></div>").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}})}(jQuery),function(e,t){e.widget("ui.slider",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,i,n=this.options,r=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a=[];for(i=n.values&&n.values.length||1,r.length>i&&(r.slice(i).remove(),r=r.slice(0,i)),t=r.length;t<i;t++)a.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");this.handles=r.add(e(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(t){e(this).data("ui-slider-handle-index",t)})},_createRange:function(){var t=this.options,i="";t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:e.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=e("<div></div>").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===t.range||"max"===t.range?" ui-slider-range-"+t.range:""))):this.range=e([])},_setupEvents:function(){var e=this.handles.add(this.range).filter("a");this._off(e),this._on(e,this._handleEvents),this._hoverable(e),this._focusable(e)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(t){var i,n,r,a,o,s,l,c=this,u=this.options;return!u.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:t.pageX,y:t.pageY},n=this._normValueFromMouse(i),r=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var i=Math.abs(n-c.values(t));(r>i||r===i&&(t===c._lastChangedValue||c.values(t)===u.min))&&(r=i,a=e(this),o=t)}),!1!==this._start(t,o)&&(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),s=a.offset(),l=!e(t.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:t.pageX-s.left-a.width()/2,top:t.pageY-s.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,o,n),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,i),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,i,n,r,a;return"horizontal"===this.orientation?(t=this.elementSize.width,i=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,i=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),n=i/t,n>1&&(n=1),n<0&&(n=0),"vertical"===this.orientation&&(n=1-n),r=this._valueMax()-this._valueMin(),a=this._valueMin()+n*r,this._trimAlignValue(a)},_start:function(e,t){var i={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("start",e,i)},_slide:function(e,t,i){var n,r,a;this.options.values&&this.options.values.length?(n=this.values(t?0:1),2===this.options.values.length&&!0===this.options.range&&(0===t&&i>n||1===t&&i<n)&&(i=n),i!==this.values(t)&&(r=this.values(),r[t]=i,a=this._trigger("slide",e,{handle:this.handles[t],value:i,values:r}),n=this.values(t?0:1),!1!==a&&this.values(t,i,!0))):i!==this.value()&&!1!==(a=this._trigger("slide",e,{handle:this.handles[t],value:i}))&&this.value(i)},_stop:function(e,t){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._trigger("stop",e,i)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(t),i.values=this.values()),this._lastChangedValue=t,this._trigger("change",e,i)}},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),void this._change(null,0)):this._value()},values:function(t,i){var n,r,a;if(arguments.length>1)return this.options.values[t]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,t);if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();for(n=this.options.values,r=arguments[0],a=0;a<n.length;a+=1)n[a]=this._trimAlignValue(r[a]),this._change(null,a);this._refreshValue()},_setOption:function(t,i){var n,r=0;switch("range"===t&&!0===this.options.range&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),e.isArray(this.options.values)&&(r=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments),t){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),n=0;n<r;n+=1)this._change(null,n);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var e=this.options.value;return e=this._trimAlignValue(e)},_values:function(e){var t,i,n;if(arguments.length)return t=this.options.values[e],t=this._trimAlignValue(t);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(i[n]);return i}return[]},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=this.options.step>0?this.options.step:1,i=(e-this._valueMin())%t,n=e-i;return 2*Math.abs(i)>=t&&(n+=i>0?t:-t),parseFloat(n.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var t,i,n,r,a,o=this.options.range,s=this.options,l=this,c=!this._animateOff&&s.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(n){i=(l.values(n)-l._valueMin())/(l._valueMax()-l._valueMin())*100,u["horizontal"===l.orientation?"left":"bottom"]=i+"%",e(this).stop(1,1)[c?"animate":"css"](u,s.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===n&&l.range.stop(1,1)[c?"animate":"css"]({left:i+"%"},s.animate),1===n&&l.range[c?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:s.animate})):(0===n&&l.range.stop(1,1)[c?"animate":"css"]({bottom:i+"%"},s.animate),1===n&&l.range[c?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:s.animate}))),t=i}):(n=this.value(),r=this._valueMin(),a=this._valueMax(),i=a!==r?(n-r)/(a-r)*100:0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[c?"animate":"css"](u,s.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({width:i+"%"},s.animate),"max"===o&&"horizontal"===this.orientation&&this.range[c?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:s.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({height:i+"%"},s.animate),"max"===o&&"vertical"===this.orientation&&this.range[c?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:s.animate}))},_handleEvents:{keydown:function(t){var i,n,r,a=e(t.target).data("ui-slider-handle-index");switch(t.keyCode){case e.ui.keyCode.HOME:case e.ui.keyCode.END:case e.ui.keyCode.PAGE_UP:case e.ui.keyCode.PAGE_DOWN:case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,e(t.target).addClass("ui-state-active"),!1===this._start(t,a)))return}switch(r=this.options.step,i=n=this.options.values&&this.options.values.length?this.values(a):this.value(),t.keyCode){case e.ui.keyCode.HOME:n=this._valueMin();break;case e.ui.keyCode.END:n=this._valueMax();break;case e.ui.keyCode.PAGE_UP:n=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/5);break;case e.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/5);break;case e.ui.keyCode.UP:case e.ui.keyCode.RIGHT:if(i===this._valueMax())return;n=this._trimAlignValue(i+r);break;case e.ui.keyCode.DOWN:case e.ui.keyCode.LEFT:if(i===this._valueMin())return;n=this._trimAlignValue(i-r)}this._slide(t,a,n)},click:function(e){e.preventDefault()},keyup:function(t){var i=e(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,i),this._change(t,i),e(t.target).removeClass("ui-state-active"))}}})}(jQuery),function(e){function t(e){return function(){var t=this.element.val();e.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}e.widget("ui.spinner",{version:"1.10.3",defaultElement:"<input>",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),
|
||
this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var t={},i=this.element;return e.each(["min","max","step"],function(e,n){var r=i.attr(n);void 0!==r&&r.length&&(t[n]=r)}),t},_events:{keydown:function(e){this._start(e)&&this._keydown(e)&&e.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(e){if(this.cancelBlur)return void delete this.cancelBlur;this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",e)},mousewheel:function(e,t){if(t){if(!this.spinning&&!this._start(e))return!1;this._spin((t>0?1:-1)*this.options.step,e),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(e)},100),e.preventDefault()}},"mousedown .ui-spinner-button":function(t){function i(){this.element[0]===this.document[0].activeElement||(this.element.focus(),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),t.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(t)&&this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(e(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,e(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var e=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=e.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*e.height())&&e.height()>0&&e.height(e.height()),this.options.disabled&&this.disable()},_keydown:function(t){var i=this.options,n=e.ui.keyCode;switch(t.keyCode){case n.UP:return this._repeat(null,1,t),!0;case n.DOWN:return this._repeat(null,-1,t),!0;case n.PAGE_UP:return this._repeat(null,i.page,t),!0;case n.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_uiSpinnerHtml:function(){return"<span class='ui-spinner ui-widget ui-widget-content ui-corner-all'></span>"},_buttonHtml:function(){return"<a class='ui-spinner-button ui-spinner-up ui-corner-tr'><span class='ui-icon "+this.options.icons.up+"'>▲</span></a><a class='ui-spinner-button ui-spinner-down ui-corner-br'><span class='ui-icon "+this.options.icons.down+"'>▼</span></a>"},_start:function(e){return!(!this.spinning&&!1===this._trigger("start",e))&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(e,t,i){e=e||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,t,i)},e),this._spin(t*this.options.step,i)},_spin:function(e,t){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+e*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",t,{value:i})||(this._value(i),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?e.isFunction(i)?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var e=this._precisionOf(this.options.step);return null!==this.options.min&&(e=Math.max(e,this._precisionOf(this.options.min))),e},_precisionOf:function(e){var t=e.toString(),i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(e){var t,i,n=this.options;return t=null!==n.min?n.min:0,i=e-t,i=Math.round(i/n.step)*n.step,e=t+i,e=parseFloat(e.toFixed(this._precision())),null!==n.max&&e>n.max?n.max:null!==n.min&&e<n.min?n.min:e},_stop:function(e){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",e))},_setOption:function(e,t){if("culture"===e||"numberFormat"===e){var i=this._parse(this.element.val());return this.options[e]=t,void this.element.val(this._format(i))}"max"!==e&&"min"!==e&&"step"!==e||"string"==typeof t&&(t=this._parse(t)),"icons"===e&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(t.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(t.down)),this._super(e,t),"disabled"===e&&(t?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:t(function(e){this._super(e),this._value(this.element.val())}),_parse:function(e){return"string"==typeof e&&""!==e&&(e=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(e,10,this.options.culture):+e),""===e||isNaN(e)?null:e},_format:function(e){return""===e?"":window.Globalize&&this.options.numberFormat?Globalize.format(e,this.options.numberFormat,this.options.culture):e},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(e,t){var i;""!==e&&null!==(i=this._parse(e))&&(t||(i=this._adjustValue(i)),e=this._format(i)),this.element.val(e),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:t(function(e){this._stepUp(e)}),_stepUp:function(e){this._start()&&(this._spin((e||1)*this.options.step),this._stop())},stepDown:t(function(e){this._stepDown(e)}),_stepDown:function(e){this._start()&&(this._spin((e||1)*-this.options.step),this._stop())},pageUp:t(function(e){this._stepUp((e||1)*this.options.page)}),pageDown:t(function(e){this._stepDown((e||1)*this.options.page)}),value:function(e){if(!arguments.length)return this._parse(this.element.val());t(this._value).call(this,e)},widget:function(){return this.uiSpinner}})}(jQuery),function(e,t){function i(){return++r}function n(e){return e.hash.length>1&&decodeURIComponent(e.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var r=0,a=/#.*$/;e.widget("ui.tabs",{version:"1.10.3",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var t=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(t){e(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){e(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),e.isArray(i.disabled)&&(i.disabled=e.unique(i.disabled.concat(e.map(this.tabs.filter(".ui-state-disabled"),function(e){return t.tabs.index(e)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(i.active):this.active=e(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var t=this.options.active,i=this.options.collapsible,n=location.hash.substring(1);return null===t&&(n&&this.tabs.each(function(i,r){if(e(r).attr("aria-controls")===n)return t=i,!1}),null===t&&(t=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==t&&-1!==t||(t=!!this.tabs.length&&0)),!1!==t&&-1===(t=this.tabs.index(this.tabs.eq(t)))&&(t=!i&&0),!i&&!1===t&&this.anchors.length&&(t=0),t},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):e()}},_tabKeydown:function(t){var i=e(this.document[0].activeElement).closest("li"),n=this.tabs.index(i),r=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case e.ui.keyCode.RIGHT:case e.ui.keyCode.DOWN:n++;break;case e.ui.keyCode.UP:case e.ui.keyCode.LEFT:r=!1,n--;break;case e.ui.keyCode.END:n=this.anchors.length-1;break;case e.ui.keyCode.HOME:n=0;break;case e.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(n);case e.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(n!==this.options.active&&n);default:return}t.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,r),t.ctrlKey||(i.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===e.ui.keyCode.UP&&(t.preventDefault(),this.active.focus())},_handlePageNav:function(t){return t.altKey&&t.keyCode===e.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===e.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,i){for(var n=this.tabs.length-1;-1!==e.inArray(function(){return t>n&&(t=0),t<0&&(t=n),t}(),this.options.disabled);)t=i?t+1:t-1;return t},_focusNextTab:function(e,t){return e=this._findNextTab(e,t),this.tabs.eq(e).focus(),e},_setOption:function(e,t){return"active"===e?void this._activate(t):"disabled"===e?void this._setupDisabled(t):(this._super(e,t),"collapsible"===e&&(this.element.toggleClass("ui-tabs-collapsible",t),t||!1!==this.options.active||this._activate(0)),"event"===e&&this._setupEvents(t),void("heightStyle"===e&&this._setupHeightStyle(t)))},_tabId:function(e){return e.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(e){return e?e.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,i=this.tablist.children(":has(a[href])");t.disabled=e.map(i.filter(".ui-state-disabled"),function(e){return i.index(e)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!e.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=e()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=e()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var t=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return e("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=e(),this.anchors.each(function(i,r){var a,o,s,l=e(r).uniqueId().attr("id"),c=e(r).closest("li"),u=c.attr("aria-controls");n(r)?(a=r.hash,o=t.element.find(t._sanitizeSelector(a))):(s=t._tabId(c),a="#"+s,o=t.element.find(a),o.length||(o=t._createPanel(s),o.insertAfter(t.panels[i-1]||t.tablist)),o.attr("aria-live","polite")),o.length&&(t.panels=t.panels.add(o)),u&&c.data("ui-tabs-aria-controls",u),c.attr({"aria-controls":a.substring(1),"aria-labelledby":l}),o.attr("aria-labelledby",l)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(t){return e("<div>").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){e.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var i,n=0;i=this.tabs[n];n++)!0===t||-1!==e.inArray(n,t)?e(i).addClass("ui-state-disabled").attr("aria-disabled","true"):e(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={click:function(e){e.preventDefault()}};t&&e.each(t.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,n=this.element.parent();"fill"===t?(i=n.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=e(this),n=t.css("position");"absolute"!==n&&"fixed"!==n&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=e(this).outerHeight(!0)}),this.panels.each(function(){e(this).height(Math.max(0,i-e(this).innerHeight()+e(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,e(this).height("").height())}).height(i))},_eventHandler:function(t){var i=this.options,n=this.active,r=e(t.currentTarget),a=r.closest("li"),o=a[0]===n[0],s=o&&i.collapsible,l=s?e():this._getPanelForTab(a),c=n.length?this._getPanelForTab(n):e(),u={oldTab:n,oldPanel:c,newTab:s?e():a,newPanel:l};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||!1===this._trigger("beforeActivate",t,u)||(i.active=!s&&this.tabs.index(a),this.active=o?e():a,this.xhr&&this.xhr.abort(),c.length||l.length||e.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(a),t),this._toggle(t,u))},_toggle:function(t,i){function n(){a.running=!1,a._trigger("activate",t,i)}function r(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,n):(o.show(),n())}var a=this,o=i.newPanel,s=i.oldPanel;this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),r()),s.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&s.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===e(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(t){var i,n=this._findActive(t);n[0]!==this.active[0]&&(n.length||(n=this.active),i=n.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:e.noop}))},_findActive:function(t){return!1===t?e():this.tabs.eq(t)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+e+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){e.data(this,"ui-tabs-destroy")?e(this).remove():e(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=e(this),i=t.data("ui-tabs-aria-controls");i?t.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(t){var i=this.options.disabled;!1!==i&&(void 0===t?i=!1:(t=this._getIndex(t),i=e.isArray(i)?e.map(i,function(e){return e!==t?e:null}):e.map(this.tabs,function(e,i){return i!==t?i:null})),this._setupDisabled(i))},disable:function(t){var i=this.options.disabled;if(!0!==i){if(void 0===t)i=!0;else{if(t=this._getIndex(t),-1!==e.inArray(t,i))return;i=e.isArray(i)?e.merge([t],i).sort():[t]}this._setupDisabled(i)}},load:function(t,i){t=this._getIndex(t);var r=this,a=this.tabs.eq(t),o=a.find(".ui-tabs-anchor"),s=this._getPanelForTab(a),l={tab:a,panel:s};n(o[0])||(this.xhr=e.ajax(this._ajaxSettings(o,i,l)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),s.attr("aria-busy","true"),this.xhr.success(function(e){setTimeout(function(){s.html(e),r._trigger("load",i,l)},1)}).complete(function(e,t){setTimeout(function(){"abort"===t&&r.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),s.removeAttr("aria-busy"),e===r.xhr&&delete r.xhr},1)})))},_ajaxSettings:function(t,i,n){var r=this;return{url:t.attr("href"),beforeSend:function(t,a){return r._trigger("beforeLoad",i,e.extend({jqXHR:t,ajaxSettings:a},n))}}},_getPanelForTab:function(t){var i=e(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})}(jQuery),function(e){function t(t,i){var n=(t.attr("aria-describedby")||"").split(/\s+/);n.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",e.trim(n.join(" ")))}function i(t){var i=t.data("ui-tooltip-id"),n=(t.attr("aria-describedby")||"").split(/\s+/),r=e.inArray(i,n);-1!==r&&n.splice(r,1),t.removeData("ui-tooltip-id"),n=e.trim(n.join(" ")),n?t.attr("aria-describedby",n):t.removeAttr("aria-describedby")}var n=0;e.widget("ui.tooltip",{version:"1.10.3",options:{content:function(){var t=e(this).attr("title")||"";return e("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(t,i){var n=this;if("disabled"===t)return this[i?"_disable":"_enable"](),void(this.options[t]=i);this._super(t,i),"content"===t&&e.each(this.tooltips,function(e,t){n._updateContent(t)})},_disable:function(){var t=this;e.each(this.tooltips,function(i,n){var r=e.Event("blur");r.target=r.currentTarget=n[0],t.close(r,!0)}),this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.is("[title]")&&t.data("ui-tooltip-title",t.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var t=e(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))})},open:function(t){var i=this,n=e(t?t.target:this.element).closest(this.options.items);n.length&&!n.data("ui-tooltip-id")&&(n.attr("title")&&n.data("ui-tooltip-title",n.attr("title")),n.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&n.parents().each(function(){var t,n=e(this);n.data("ui-tooltip-open")&&(t=e.Event("blur"),t.target=t.currentTarget=this,i.close(t,!0)),n.attr("title")&&(n.uniqueId(),i.parents[this.id]={element:this,title:n.attr("title")},n.attr("title",""))}),this._updateContent(n,t))},_updateContent:function(e,t){var i,n=this.options.content,r=this,a=t?t.type:null;if("string"==typeof n)return this._open(t,e,n);(i=n.call(e[0],function(i){e.data("ui-tooltip-open")&&r._delay(function(){t&&(t.type=a),this._open(t,e,i)})}))&&this._open(t,e,i)},_open:function(i,n,r){function a(e){c.of=e,o.is(":hidden")||o.position(c)}var o,s,l,c=e.extend({},this.options.position);if(r){if(o=this._find(n),o.length)return void o.find(".ui-tooltip-content").html(r);n.is("[title]")&&(i&&"mouseover"===i.type?n.attr("title",""):n.removeAttr("title")),o=this._tooltip(n),t(n,o.attr("id")),o.find(".ui-tooltip-content").html(r),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:a}),a(i)):o.position(e.extend({of:n},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(l=this.delayedShow=setInterval(function(){o.is(":visible")&&(a(c.of),clearInterval(l))},e.fx.interval)),this._trigger("open",i,{tooltip:o}),s={keyup:function(t){if(t.keyCode===e.ui.keyCode.ESCAPE){var i=e.Event(t);i.currentTarget=n[0],this.close(i,!0)}},remove:function(){this._removeTooltip(o)}},i&&"mouseover"!==i.type||(s.mouseleave="close"),i&&"focusin"!==i.type||(s.focusout="close"),this._on(!0,n,s)}},close:function(t){var n=this,r=e(t?t.currentTarget:this.element),a=this._find(r);this.closing||(clearInterval(this.delayedShow),r.data("ui-tooltip-title")&&r.attr("title",r.data("ui-tooltip-title")),i(r),a.stop(!0),this._hide(a,this.options.hide,function(){n._removeTooltip(e(this))}),r.removeData("ui-tooltip-open"),this._off(r,"mouseleave focusout keyup"),r[0]!==this.element[0]&&this._off(r,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&e.each(this.parents,function(t,i){e(i.element).attr("title",i.title),delete n.parents[t]}),this.closing=!0,this._trigger("close",t,{tooltip:a}),this.closing=!1)},_tooltip:function(t){var i="ui-tooltip-"+n++,r=e("<div>").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return e("<div>").addClass("ui-tooltip-content").appendTo(r),r.appendTo(this.document[0].body),this.tooltips[i]=t,r},_find:function(t){var i=t.data("ui-tooltip-id");return i?e("#"+i):e()},_removeTooltip:function(e){e.remove(),delete this.tooltips[e.attr("id")]},_destroy:function(){var t=this;e.each(this.tooltips,function(i,n){var r=e.Event("blur");r.target=r.currentTarget=n[0],t.close(r,!0),e("#"+i).remove(),n.data("ui-tooltip-title")&&(n.attr("title",n.data("ui-tooltip-title")),n.removeData("ui-tooltip-title"))})}})}(jQuery),define("jqueryui",function(){}),function($){var min=Math.min,max=Math.max,round=Math.floor,isStr=function(e){return"string"===$.type(e)},runPluginCallbacks=function(Instance,a_fn){function g(e){return e}if($.isArray(a_fn))for(var i=0,c=a_fn.length;i<c;i++){var fn=a_fn[i];try{isStr(fn)&&(fn=eval(fn)),$.isFunction(fn)&&g(fn)(Instance)}catch(e){}}};$.layout={version:"1.4.4",revision:1.0404,browser:{},effects:{slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},scale:{all:{duration:"fast"}},blind:{},clip:{},explode:{},fade:{},fold:{},puff:{},size:{all:{easing:"swing"}}},config:{optionRootKeys:"effects,panes,north,south,west,east,center".split(","),allPanes:"north,south,west,east,center".split(","),borderPanes:"north,south,west,east".split(","),oppositeEdge:{north:"south",south:"north",east:"west",west:"east"},offscreenCSS:{left:"-99999px",right:"auto"},offscreenReset:"offscreenReset",hidden:{visibility:"hidden"},visible:{visibility:"visible"},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden"},cssDemo:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDemo:{background:"#AAA"}},content:{cssReq:{position:"relative"},cssDemo:{overflow:"auto",padding:"10px"},cssDemoPane:{overflow:"hidden",padding:0}},panes:{cssReq:{position:"absolute",margin:0},cssDemo:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{side:"top",sizeType:"Height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{side:"bottom",sizeType:"Height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{side:"right",sizeType:"Width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{side:"left",sizeType:"Width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}},callbacks:{},getParentPaneElem:function(e){var t=$(e),i=t.data("layout")||t.data("parentLayout");if(i){var n=i.container;if(n.data("layoutPane"))return n;var r=n.closest("."+$.layout.defaults.panes.paneClass);if(r.data("layoutPane"))return r}return null},getParentPaneInstance:function(e){var t=$.layout.getParentPaneElem(e);return t?t.data("layoutPane"):null},getParentLayoutInstance:function(e){var t=$.layout.getParentPaneElem(e);return t?t.data("parentLayout"):null},getEventObject:function(e){return"object"==typeof e&&e.stopPropagation?e:null},parsePaneName:function(e){var t=$.layout.getEventObject(e),i=e;return t&&(t.stopPropagation(),i=$(this).data("layoutEdge")),i&&!/^(west|east|north|south|center)$/.test(i)&&($.layout.msg('LAYOUT ERROR - Invalid pane-name: "'+i+'"'),i="error"),i},plugins:{draggable:!!$.fn.draggable,effects:{core:!!$.effects,slide:$.effects&&($.effects.slide||$.effects.effect&&$.effects.effect.slide)}},onCreate:[],onLoad:[],onReady:[],onDestroy:[],onUnload:[],afterOpen:[],afterClose:[],scrollbarWidth:function(){return window.scrollbarWidth||$.layout.getScrollbarSize("width")},scrollbarHeight:function(){return window.scrollbarHeight||$.layout.getScrollbarSize("height")},getScrollbarSize:function(e){var t=$('<div style="position: absolute; top: -10000px; left: -10000px; width: 100px; height: 100px; border: 0; overflow: scroll;"></div>').appendTo("body"),i={width:t.outerWidth-t[0].clientWidth,height:100-t[0].clientHeight};return t.remove(),window.scrollbarWidth=i.width,window.scrollbarHeight=i.height,e.match(/^(width|height)$/)?i[e]:i},disableTextSelection:function(){var e=$(document),t="textSelectionDisabled",i="textSelectionInitialized";$.fn.disableSelection&&(e.data(i)||e.on("mouseup",$.layout.enableTextSelection).data(i,!0),e.data(t)||e.disableSelection().data(t,!0))},enableTextSelection:function(){var e=$(document),t="textSelectionDisabled";$.fn.enableSelection&&e.data(t)&&e.enableSelection().data(t,!1)},showInvisibly:function(e,t){if(e&&e.length&&(t||"none"===e.css("display"))){var i=e[0].style,n={display:i.display||"",visibility:i.visibility||""};return e.css({display:"block",visibility:"hidden"}),n}return{}},getElementDimensions:function(e,t){var i,n,r,a={css:{},inset:{}},o=a.css,s={bottom:0},l=$.layout.cssNum,c=Math.round,u=e.offset();return a.offsetLeft=u.left,a.offsetTop=u.top,t||(t={}),$.each("Left,Right,Top,Bottom".split(","),function(l,c){i=o["border"+c]=$.layout.borderWidth(e,c),n=o["padding"+c]=$.layout.cssNum(e,"padding"+c),r=c.toLowerCase(),a.inset[r]=t[r]>=0?t[r]:n,s[r]=a.inset[r]+i}),o.width=c(e.width()),o.height=c(e.height()),o.top=l(e,"top",!0),o.bottom=l(e,"bottom",!0),o.left=l(e,"left",!0),o.right=l(e,"right",!0),a.outerWidth=c(e.outerWidth()),a.outerHeight=c(e.outerHeight()),a.innerWidth=max(0,a.outerWidth-s.left-s.right),a.innerHeight=max(0,a.outerHeight-s.top-s.bottom),a.layoutWidth=c(e.innerWidth()),a.layoutHeight=c(e.innerHeight()),a},getElementStyles:function(e,t){var i,n,r,a,o,s,l={},c=e[0].style,u=t.split(","),d="Top,Bottom,Left,Right".split(","),h="Color,Style,Width".split(",");for(a=0;a<u.length;a++)if(i=u[a],i.match(/(border|padding|margin)$/))for(o=0;o<4;o++)if(n=d[o],"border"===i)for(s=0;s<3;s++)r=h[s],l[i+n+r]=c[i+n+r];else l[i+n]=c[i+n];else l[i]=c[i];return l},cssWidth:function(e,t){if(t<=0)return 0;var i=$.layout.browser,n=i.boxModel?i.boxSizing?e.css("boxSizing"):"content-box":"border-box",r=$.layout.borderWidth,a=$.layout.cssNum,o=t;return"border-box"!==n&&(o-=r(e,"Left")+r(e,"Right")),"content-box"===n&&(o-=a(e,"paddingLeft")+a(e,"paddingRight")),max(0,o)},cssHeight:function(e,t){if(t<=0)return 0;var i=$.layout.browser,n=i.boxModel?i.boxSizing?e.css("boxSizing"):"content-box":"border-box",r=$.layout.borderWidth,a=$.layout.cssNum,o=t;return"border-box"!==n&&(o-=r(e,"Top")+r(e,"Bottom")),"content-box"===n&&(o-=a(e,"paddingTop")+a(e,"paddingBottom")),max(0,o)},cssNum:function(e,t,i){e.jquery||(e=$(e));var n=$.layout.showInvisibly(e),r=$.css(e[0],t,!0),a=i&&"auto"==r?r:Math.round(parseFloat(r)||0);return e.css(n),a},borderWidth:function(e,t){e.jquery&&(e=e[0]);var i="border"+t.substr(0,1).toUpperCase()+t.substr(1);return"none"===$.css(e,i+"Style",!0)?0:Math.round(parseFloat($.css(e,i+"Width",!0))||0)},isMouseOverElem:function(e,t){var i=$(t||this),n=i.offset(),r=n.top,a=n.left,o=a+i.outerWidth(),s=r+i.outerHeight(),l=e.pageX,c=e.pageY;return $.layout.browser.msie&&l<0&&c<0||l>=a&&l<=o&&c>=r&&c<=s},msg:function(e,t,i,n){if($.isPlainObject(e)&&window.debugData){"string"==typeof t?(n=i,i=t):"object"==typeof i&&(n=i,i=null);var r=i||"log( <object> )",a=$.extend({sort:!1,returnHTML:!1,display:!1},n);!0===t||a.display?debugData(e,r,a):window.console&&console.log(debugData(e,r,a))}else if(t)alert(e);else if(window.console)console.log(e);else{var o=$("#layoutLogger");o.length||(o=function(){var e=$.support.fixedPosition?"fixed":"absolute",t=$('<div id="layoutLogger" style="position: '+e+'; top: 5px; z-index: 999999; max-width: 25%; overflow: hidden; border: 1px solid #000; border-radius: 5px; background: #FBFBFB; box-shadow: 0 2px 10px rgba(0,0,0,0.3);"><div style="font-size: 13px; font-weight: bold; padding: 5px 10px; background: #F6F6F6; border-radius: 5px 5px 0 0; cursor: move;"><span style="float: right; padding-left: 7px; cursor: pointer;" title="Remove Console" onclick="$(this).closest(\'#layoutLogger\').remove()">X</span>Layout console.log</div><ul style="font-size: 13px; font-weight: none; list-style: none; margin: 0; padding: 0 0 2px;"></ul></div>').appendTo("body");return t.css("left",$(window).width()-t.outerWidth()-5),$.ui.draggable&&t.draggable({handle:":first-child"}),t}()),o.children("ul").append('<li style="padding: 4px 10px; margin: 0; border-top: 1px solid #CCC;">'+e.replace(/\</g,"<").replace(/\>/g,">")+"</li>")}}},function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[],i=t[1]||"",n=t[2]||0,r="msie"===i,a=document.compatMode,o=$.support,s=void 0!==o.boxSizing?o.boxSizing:o.boxSizingReliable,l=!r||!a||"CSS1Compat"===a||o.boxModel||!1,c=$.layout.browser={version:n,safari:"webkit"===i,webkit:"chrome"===i,msie:r,isIE6:r&&6==n,boxModel:l,boxSizing:!!("function"==typeof s?s():s)};i&&(c[i]=!0),l||a||$(function(){c.boxModel=o.boxModel})}(),$.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:!0,resizeWithWindow:!0,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:!1,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,initPanes:!0,showErrorMessages:!0,showDebugMessages:!1,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1e3,resizer_drag:1e4},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{
|
||
applyDemoStyles:!1,closable:!0,resizable:!0,slidable:!0,initClosed:!1,initHidden:!1,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:!1,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:!0,autoResize:!0,autoReopen:!0,resizerDragOpacity:1,maskContents:!1,maskObjects:!1,maskZindex:null,resizingGrid:!1,livePaneResizing:!1,liveContentResizing:!1,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:!1,preventQuickSlideClose:$.layout.browser.webkit,preventPrematureSlideClose:!1,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:!1,enableCursorHotkey:!0,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:!0,animatePaneSizing:!1,children:null,containerSelector:"",initChildren:!0,destroyChildren:!0,resizeChildren:!0,triggerEventsOnLoad:!1,triggerEventsDuringLiveResize:!0,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:null,onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}},$.layout.optionsMap={layout:"name,instanceKey,stateManagement,effects,inset,zIndexes,errors,zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end".split(","),center:"paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,containerSelector,children,initChildren,resizeChildren,destroyChildren,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end".split(","),noDefault:"paneSelector,resizerCursor,customHotkey".split(",")},$.layout.transformData=function(e,t){var i,n,r,a,o,s,l,c=t?{panes:{},center:{}}:{};if("object"!=typeof e)return c;for(n in e)for(i=c,o=e[n],r=n.split("__"),l=r.length-1,s=0;s<=l;s++)a=r[s],s===l?$.isPlainObject(o)?i[a]=$.layout.transformData(o):i[a]=o:(i[a]||(i[a]={}),i=i[a]);return c},$.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(e){function t(t,i){for(var n,r=t.split("."),a=r.length-1,o={branch:e,key:r[a]},s=0;s<a;s++)n=r[s],void 0==o.branch[n]?o.branch=i?o.branch[n]={}:{}:o.branch=o.branch[n];return o}var i,n,r,a=$.layout.backwardCompatibility.map;for(var o in a)i=t(o),void 0!==(r=i.branch[i.key])&&(n=t(a[o],!0),n.branch[n.key]=r,delete i.branch[i.key])},renameAllOptions:function(e){var t=$.layout.backwardCompatibility.renameOptions;return t(e),e.defaults&&("object"!=typeof e.panes&&(e.panes={}),$.extend(!0,e.panes,e.defaults),delete e.defaults),e.panes&&t(e.panes),$.each($.layout.config.allPanes,function(i,n){e[n]&&t(e[n])}),e}},$.fn.layout=function(opts){function keyDown(e){if(!e)return!0;var t=e.keyCode;if(t<33)return!0;var i,n,r,a,o={38:"north",40:"south",37:"west",39:"east"},s=(e.altKey,e.shiftKey),l=e.ctrlKey,c=l&&t>=37&&t<=40;return c&&options[o[t]].enableCursorHotkey?a=o[t]:(l||s)&&$.each(_c.borderPanes,function(e,o){if(i=options[o],n=i.customHotkey,r=i.customHotkeyModifier,(s&&"SHIFT"==r||l&&"CTRL"==r||l&&s)&&n&&t===(isNaN(n)||n<=9?n.toUpperCase().charCodeAt(0):n))return a=o,!1}),!(a&&$Ps[a]&&options[a].closable&&!state[a].isHidden)||(toggle(a),e.stopPropagation(),e.returnValue=!1,!1)}function allowOverflow(e){if(isInitialized()){this&&this.tagName&&(e=this);var t;if(isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1}),t&&t.length){var i=t.data("layoutEdge"),n=state[i];if(n.cssSaved&&resetOverflow(i),n.isSliding||n.isResizing||n.isClosed)return void(n.cssSaved=!1);var r={zIndex:options.zIndexes.resizer_normal+1},a={},o=t.css("overflow"),s=t.css("overflowX"),l=t.css("overflowY");"visible"!=o&&(a.overflow=o,r.overflow="visible"),s&&!s.match(/(visible|auto)/)&&(a.overflowX=s,r.overflowX="visible"),l&&!l.match(/(visible|auto)/)&&(a.overflowY=s,r.overflowY="visible"),n.cssSaved=a,t.css(r),$.each(_c.allPanes,function(e,t){t!=i&&resetOverflow(t)})}}}function resetOverflow(e){if(isInitialized()){this&&this.tagName&&(e=this);var t;if(isStr(e)?t=$Ps[e]:$(e).data("layoutRole")?t=$(e):$(e).parents().each(function(){if($(this).data("layoutRole"))return t=$(this),!1}),t&&t.length){var i=t.data("layoutEdge"),n=state[i],r=n.cssSaved||{};n.isSliding||n.isResizing||t.css("zIndex",options.zIndexes.pane_normal),t.css(r),n.cssSaved=!1}}}var browser=$.layout.browser,_c=$.layout.config,cssW=$.layout.cssWidth,cssH=$.layout.cssHeight,elDims=$.layout.getElementDimensions,styles=$.layout.getElementStyles,evtObj=$.layout.getEventObject,evtPane=$.layout.parsePaneName,options=$.extend(!0,{},$.layout.defaults),effects=options.effects=$.extend(!0,{},$.layout.effects),state={id:"layout"+$.now(),initialized:!1,paneResizing:!1,panesSliding:{},container:{innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0,layoutWidth:0,layoutHeight:0},north:{childIdx:0},south:{childIdx:0},east:{childIdx:0},west:{childIdx:0},center:{childIdx:0}},children={north:null,south:null,east:null,west:null,center:null},timer={data:{},set:function(e,t,i){timer.clear(e),timer.data[e]=setTimeout(t,i)},clear:function(e){var t=timer.data;t[e]&&(clearTimeout(t[e]),delete t[e])}},_log=function(e,t,i){var n=options;return(n.showErrorMessages&&!i||i&&n.showDebugMessages)&&$.layout.msg(n.name+" / "+e,!1!==t),!1},_runCallbacks=function(evtName,pane,skipBoundEvents){function g(e){return e}var hasPane=pane&&isStr(pane),s=hasPane?state[pane]:state,o=hasPane?options[pane]:options,lName=options.name,lng=evtName+(evtName.match(/_/)?"":"_end"),shrt=lng.match(/_end$/)?lng.substr(0,lng.length-4):"",fn=o[lng]||o[shrt],retVal="NC",args=[],$P=hasPane?$Ps[pane]:0;if(hasPane&&!$P)return retVal;if(hasPane||"boolean"!==$.type(pane)||(skipBoundEvents=pane,pane=""),fn)try{isStr(fn)&&(fn.match(/,/)?(args=fn.split(","),fn=eval(args[0])):fn=eval(fn)),$.isFunction(fn)&&(retVal=args.length?g(fn)(args[1]):hasPane?g(fn)(pane,$Ps[pane],s,o,lName):g(fn)(Instance,s,o,lName))}catch(e){_log(options.errors.callbackError.replace(/EVENT/,$.trim((pane||"")+" "+lng)),!1),"string"===$.type(e)&&string.length&&_log("Exception: "+e,!1)}return skipBoundEvents||!1===retVal||(hasPane?(o=options[pane],s=state[pane],$P.triggerHandler("layoutpane"+lng,[pane,$P,s,o,lName]),shrt&&$P.triggerHandler("layoutpane"+shrt,[pane,$P,s,o,lName])):($N.triggerHandler("layout"+lng,[Instance,s,o,lName]),shrt&&$N.triggerHandler("layout"+shrt,[Instance,s,o,lName]))),hasPane&&"onresize_end"===evtName&&resizeChildren(pane+"",!0),retVal},_fixIframe=function(e){if(!browser.mozilla){var t=$Ps[e];"IFRAME"===state[e].tagName?t.css(_c.hidden).css(_c.visible):t.find("IFRAME").css(_c.hidden).css(_c.visible)}},cssSize=function(e,t){return("horz"==_c[e].dir?cssH:cssW)($Ps[e],t)},cssMinDims=function(e){var t=$Ps[e],i=_c[e].dir,n={minWidth:1001-cssW(t,1e3),minHeight:1001-cssH(t,1e3)};return"horz"===i&&(n.minSize=n.minHeight),"vert"===i&&(n.minSize=n.minWidth),n},setOuterWidth=function(e,t,i){var n,r=e;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),n=cssW(r,t),r.css({width:n}),n>0?i&&r.data("autoHidden")&&r.innerHeight()>0&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):i&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},setOuterHeight=function(e,t,i){var n,r=e;isStr(e)?r=$Ps[e]:e.jquery||(r=$(e)),n=cssH(r,t),r.css({height:n,visibility:"visible"}),n>0&&r.innerWidth()>0?i&&r.data("autoHidden")&&(r.show().data("autoHidden",!1),browser.mozilla||r.css(_c.hidden).css(_c.visible)):i&&!r.data("autoHidden")&&r.hide().data("autoHidden",!0)},_parseSize=function(e,t,i){if(i||(i=_c[e].dir),isStr(t)&&t.match(/%/)&&(t="100%"===t?-1:parseInt(t,10)/100),0===t)return 0;if(t>=1)return parseInt(t,10);var n=options,r=0;if("horz"==i?r=sC.innerHeight-($Ps.north?n.north.spacing_open:0)-($Ps.south?n.south.spacing_open:0):"vert"==i&&(r=sC.innerWidth-($Ps.west?n.west.spacing_open:0)-($Ps.east?n.east.spacing_open:0)),-1===t)return r;if(t>0)return round(r*t);if("center"==e)return 0;var a="horz"===i?"height":"width",o=$Ps[e],s="height"===a&&$Cs[e],l=$.layout.showInvisibly(o),c=o.css(a),u=s?s.css(a):0;return o.css(a,"auto"),s&&s.css(a,"auto"),t="height"===a?o.outerHeight():o.outerWidth(),o.css(a,c).css(l),s&&s.css(a,u),t},getPaneSize=function(e,t){var i=$Ps[e],n=options[e],r=state[e],a=t?n.spacing_open:0,o=t?n.spacing_closed:0;return!i||r.isHidden?0:r.isClosed||r.isSliding&&t?o:"horz"===_c[e].dir?i.outerHeight()+a:i.outerWidth()+a},setSizeLimits=function(e,t){if(isInitialized()){var i=options[e],n=state[e],r=_c[e],a=r.dir,o=(r.sizeType.toLowerCase(),void 0!=t?t:n.isSliding),s=($Ps[e],i.spacing_open),l=_c.oppositeEdge[e],c=state[l],u=$Ps[l],d=!u||!1===c.isVisible||c.isSliding?0:"horz"==a?u.outerHeight():u.outerWidth(),h=(!u||c.isHidden?0:options[l][!1!==c.isClosed?"spacing_closed":"spacing_open"])||0,p="horz"==a?sC.innerHeight:sC.innerWidth,f=cssMinDims("center"),m="horz"==a?max(options.center.minHeight,f.minHeight):max(options.center.minWidth,f.minWidth),g=p-s-(o?0:_parseSize("center",m,a)+d+h),v=n.minSize=max(_parseSize(e,i.minSize),cssMinDims(e).minSize),y=n.maxSize=min(i.maxSize?_parseSize(e,i.maxSize):1e5,g),_=n.resizerPosition={},b=sC.inset.top,w=sC.inset.left,x=sC.innerWidth,k=sC.innerHeight,C=i.spacing_open;switch(e){case"north":_.min=b+v,_.max=b+y;break;case"west":_.min=w+v,_.max=w+y;break;case"south":_.min=b+k-y-C,_.max=b+k-v-C;break;case"east":_.min=w+x-y-C,_.max=w+x-v-C}}},calcNewCenterPaneDims=function(){var e={top:getPaneSize("north",!0),bottom:getPaneSize("south",!0),left:getPaneSize("west",!0),right:getPaneSize("east",!0),width:0,height:0};return e.width=sC.innerWidth-e.left-e.right,e.height=sC.innerHeight-e.bottom-e.top,e.top+=sC.inset.top,e.bottom+=sC.inset.bottom,e.left+=sC.inset.left,e.right+=sC.inset.right,e},getHoverClasses=function(e,t){var i=$(e),n=i.data("layoutRole"),r=i.data("layoutEdge"),a=options[r],o=a[n+"Class"],s="-"+r,l="-hover ",c=i.hasClass(o+"-closed")?"-closed":"-open",u="-closed"===c?"-open":"-closed",d=o+l+(o+s+l)+(o+c+l)+(o+s+c+l);return t&&(d+=o+u+l+(o+s+u+l)),"resizer"==n&&i.hasClass(o+"-sliding")&&(d+=o+"-sliding"+l+(o+s)+"-sliding"+l),$.trim(d)},addHover=function(e,t){var i=$(t||this);e&&"toggler"===i.data("layoutRole")&&e.stopPropagation(),i.addClass(getHoverClasses(i))},removeHover=function(e,t){var i=$(t||this);i.removeClass(getHoverClasses(i,!0))},onResizerEnter=function(e){var t=$(this).data("layoutEdge"),i=state[t];$(document);i.isResizing||state.paneResizing||options.maskPanesEarly&&showMasks(t,{resizing:!0})},onResizerLeave=function(e,t){var i=t||this,n=$(i).data("layoutEdge"),r=n+"ResizerLeave";$(document);timer.clear(n+"_openSlider"),timer.clear(r),t?options.maskPanesEarly&&!state.paneResizing&&hideMasks():timer.set(r,function(){onResizerLeave(e,i)},200)},_create=function(){initOptions();var e=options,t=state;return t.creatingLayout=!0,runPluginCallbacks(Instance,$.layout.onCreate),!1===_runCallbacks("onload_start")?"cancel":(_initContainer(),initHotkeys(),$(window).bind("unload."+sID,unload),runPluginCallbacks(Instance,$.layout.onLoad),e.initPanes&&_initLayoutElements(),delete t.creatingLayout,state.initialized)},isInitialized=function(){return!(!state.initialized&&!state.creatingLayout)||_initLayoutElements()},_initLayoutElements=function(e){var t=options;if(!$N.is(":visible"))return!e&&browser.webkit&&"BODY"===$N[0].tagName&&setTimeout(function(){_initLayoutElements(!0)},50),!1;if(!getPane("center").length)return _log(t.errors.centerPaneMissing);if(state.creatingLayout=!0,$.extend(sC,elDims($N,t.inset)),initPanes(),t.scrollToBookmarkOnLoad){var i=self.location;i.hash&&i.replace(i.hash)}return Instance.hasParentLayout?t.resizeWithWindow=!1:t.resizeWithWindow&&$(window).bind("resize."+sID,windowResize),delete state.creatingLayout,state.initialized=!0,runPluginCallbacks(Instance,$.layout.onReady),_runCallbacks("onload_end"),!0},createChildren=function(e,t){var i=evtPane.call(this,e),n=$Ps[i];if(n){var r=$Cs[i],a=state[i],o=options[i],s=options.stateManagement||{},l=t?o.children=t:o.children;if($.isPlainObject(l))l=[l];else if(!l||!$.isArray(l))return;$.each(l,function(e,t){if($.isPlainObject(t)){(t.containerSelector?n.find(t.containerSelector):r||n).each(function(){var e=$(this),n=e.data("layout");if(!n){if(setInstanceKey({container:e,options:t},a),s.includeChildren&&state.stateData[i]){var r=state.stateData[i].children||{},o=r[t.instanceKey],l=t.stateManagement||(t.stateManagement={autoLoad:!0});!0===l.autoLoad&&o&&(l.autoSave=!1,l.includeChildren=!0,l.autoLoad=$.extend(!0,{},o))}n=e.layout(t),n&&refreshChildren(i,n)}})}})}},setInstanceKey=function(e,t){var i=e.container,n=e.options,r=n.stateManagement,a=n.instanceKey||i.data("layoutInstanceKey");return a||(a=(r&&r.cookie?r.cookie.name:"")||n.name),a=a?a.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_"):"layout"+ ++t.childIdx,n.instanceKey=a,i.data("layoutInstanceKey",a),a},refreshChildren=function(e,t){var i,n=$Ps[e],r=children[e],a=state[e];$.isPlainObject(r)&&($.each(r,function(e,t){t.destroyed&&delete r[e]}),$.isEmptyObject(r)&&(r=children[e]=null)),t||r||(t=n.data("layout")),t&&(t.hasParentLayout=!0,i=t.options,setInstanceKey(t,a),r||(r=children[e]={}),r[i.instanceKey]=t.container.data("layout")),Instance[e].children=children[e],t||createChildren(e)},windowResize=function(){var e=options,t=Number(e.resizeWithWindowDelay);t<10&&(t=100),timer.clear("winResize"),timer.set("winResize",function(){timer.clear("winResize"),timer.clear("winResizeRepeater");var t=elDims($N,e.inset);t.innerWidth===sC.innerWidth&&t.innerHeight===sC.innerHeight||resizeAll()},t),timer.data.winResizeRepeater||setWindowResizeRepeater()},setWindowResizeRepeater=function(){var e=Number(options.resizeWithWindowMaxDelay);e>0&&timer.set("winResizeRepeater",function(){setWindowResizeRepeater(),resizeAll()},e)},unload=function(){_runCallbacks("onunload_start"),runPluginCallbacks(Instance,$.layout.onUnload),_runCallbacks("onunload_end")},_initContainer=function(){var e,t,i=$N[0],n=$("html"),r=sC.tagName=i.tagName,a=sC.id=i.id,o=sC.className=i.className,s=options,l=s.name,c="position,margin,padding,border",u="layoutCSS",d={},h="hidden",p=$N.data("parentLayout"),f=$N.data("layoutEdge"),m=p&&f,g=$.layout.cssNum;sC.selector=$N.selector.split(".slice")[0],sC.ref=(s.name?s.name+" layout / ":"")+r+(a?"#"+a:o?".["+o+"]":""),sC.isBody="BODY"===r,m||sC.isBody||(e=$N.closest("."+$.layout.defaults.panes.paneClass),p=e.data("parentLayout"),f=e.data("layoutEdge"),m=p&&f),$N.data({layout:Instance,layoutContainer:sID}).addClass(s.containerClass);var v={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(l in v)$N.bind("layout"+l.toLowerCase()+"."+sID,Instance[v[l]||l]);m&&(Instance.hasParentLayout=!0,p.refreshChildren(f,Instance)),$N.data(u)||(sC.isBody?($N.data(u,$.extend(styles($N,c),{height:$N.css("height"),overflow:$N.css("overflow"),overflowX:$N.css("overflowX"),overflowY:$N.css("overflowY")})),n.data(u,$.extend(styles(n,"padding"),{height:"auto",overflow:n.css("overflow"),overflowX:n.css("overflowX"),overflowY:n.css("overflowY")}))):$N.data(u,styles($N,c+",top,bottom,left,right,width,height,overflow,overflowX,overflowY")));try{if(d={overflow:h,overflowX:h,overflowY:h},$N.css(d),s.inset&&!$.isPlainObject(s.inset)&&(t=parseInt(s.inset,10)||0,s.inset={top:t,bottom:t,left:t,right:t}),sC.isBody)s.outset?$.isPlainObject(s.outset)||(t=parseInt(s.outset,10)||0,s.outset={top:t,bottom:t,left:t,right:t}):s.outset={top:g(n,"paddingTop"),bottom:g(n,"paddingBottom"),left:g(n,"paddingLeft"),right:g(n,"paddingRight")},n.css(d).css({height:"100%",border:"none",padding:0,margin:0}),browser.isIE6?($N.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"}),s.inset||(s.inset=elDims($N).inset)):($N.css({width:"auto",height:"auto",margin:0,position:"absolute"}),$N.css(s.outset)),$.extend(sC,elDims($N,s.inset));else{var y=$N.css("position");y&&y.match(/(fixed|absolute|relative)/)||$N.css("position","relative"),$N.is(":visible")&&($.extend(sC,elDims($N,s.inset)),sC.innerHeight<1&&_log(s.errors.noContainerHeight.replace(/CONTAINER/,sC.ref)))}g($N,"minWidth")&&$N.parent().css("overflowX","auto"),g($N,"minHeight")&&$N.parent().css("overflowY","auto")}catch(e){}},initHotkeys=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var i=options[t];if(i.enableCursorHotkey||i.customHotkey)return $(document).bind("keydown."+sID,keyDown),!1})},initOptions=function(){function e(e){var t=options[e],i=options.panes;t.fxSettings||(t.fxSettings={}),i.fxSettings||(i.fxSettings={}),$.each(["_open","_close","_size"],function(n,r){var a="fxName"+r,o="fxSpeed"+r,s="fxSettings"+r,l=t[a]=t[a]||i[a]||t.fxName||i.fxName||"none",c=$.effects&&($.effects[l]||$.effects.effect&&$.effects.effect[l]);"none"!==l&&options.effects[l]&&c||(l=t[a]="none");var u=options.effects[l]||{},d=u.all||null,h=u[e]||null;t[o]=t[o]||i[o]||t.fxSpeed||i.fxSpeed||null,t[s]=$.extend(!0,{},d,h,i.fxSettings,t.fxSettings,i[s],t[s])}),delete t.fxName,delete t.fxSpeed,delete t.fxSettings}var t,i,n,r,a,o,s;if(opts=$.layout.transformData(opts,!0),opts=$.layout.backwardCompatibility.renameAllOptions(opts),!$.isEmptyObject(opts.panes)){for(t=$.layout.optionsMap.noDefault,a=0,o=t.length;a<o;a++)n=t[a],delete opts.panes[n];for(t=$.layout.optionsMap.layout,a=0,o=t.length;a<o;a++)n=t[a],delete opts.panes[n]}t=$.layout.optionsMap.layout;var l=$.layout.config.optionRootKeys;for(n in opts)r=opts[n],$.inArray(n,l)<0&&$.inArray(n,t)<0&&(opts.panes[n]||(opts.panes[n]=$.isPlainObject(r)?$.extend(!0,{},r):r),delete opts[n]);$.extend(!0,options,opts),$.each(_c.allPanes,function(r,a){if(_c[a]=$.extend(!0,{},_c.panes,_c[a]),i=options.panes,s=options[a],"center"===a)for(t=$.layout.optionsMap.center,r=0,o=t.length;r<o;r++)n=t[r],opts.center[n]||!opts.panes[n]&&s[n]||(s[n]=i[n]);else s=options[a]=$.extend(!0,{},i,s),e(a),s.resizerClass||(s.resizerClass="ui-layout-resizer"),s.togglerClass||(s.togglerClass="ui-layout-toggler");s.paneClass||(s.paneClass="ui-layout-pane")});var c=opts.zIndex,u=options.zIndexes;c>0&&(u.pane_normal=c,u.content_mask=max(c+1,u.content_mask),u.resizer_normal=max(c+2,u.resizer_normal)),delete options.panes},getPane=function(e){var t=options[e].paneSelector;if("#"===t.substr(0,1))return $N.find(t).eq(0);var i=$N.children(t).eq(0);return i.length?i:$N.children("form:first").children(t).eq(0)},initPanes=function(e){evtPane(e),$.each(_c.allPanes,function(e,t){addPane(t,!0)}),initHandles(),$.each(_c.borderPanes,function(e,t){$Ps[t]&&state[t].isVisible&&(setSizeLimits(t),makePaneFit(t))}),sizeMidPanes("center"),$.each(_c.allPanes,function(e,t){afterInitPane(t)})},addPane=function(e,t){if(t||isInitialized()){var i,n,r,a=options[e],o=state[e],s=_c[e],l=s.dir,c=(o.fx,a.spacing_open,"center"===e),u={},d=$Ps[e];if(d?removePane(e,!1,!0,!1):$Cs[e]=!1,d=$Ps[e]=getPane(e),!d.length)return void($Ps[e]=!1);if(!d.data("layoutCSS")){d.data("layoutCSS",styles(d,"position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border"))}Instance[e]={name:e,pane:$Ps[e],content:$Cs[e],options:options[e],state:state[e],children:children[e]},d.data({parentLayout:Instance,layoutPane:Instance[e],layoutEdge:e,layoutRole:"pane"}).css(s.cssReq).css("zIndex",options.zIndexes.pane_normal).css(a.applyDemoStyles?s.cssDemo:{}).addClass(a.paneClass+" "+a.paneClass+"-"+e).bind("mouseenter."+sID,addHover).bind("mouseleave."+sID,removeHover);var h,p={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",resizeAll:"resizeAll",resizeLayout:"resizeAll"};for(h in p)d.bind("layoutpane"+h.toLowerCase()+"."+sID,Instance[p[h]||h]);initContent(e,!1),c||(i=o.size=_parseSize(e,a.size),n=_parseSize(e,a.minSize)||1,r=_parseSize(e,a.maxSize)||1e5,i>0&&(i=max(min(i,r),n)),o.autoResize=a.autoResize,o.isClosed=!1,o.isSliding=!1,o.isResizing=!1,o.isHidden=!1,o.pins||(o.pins=[])),o.tagName=d[0].tagName,o.edge=e,o.noRoom=!1,o.isVisible=!0,setPanePosition(e),"horz"===l?u.height=cssH(d,i):"vert"===l&&(u.width=cssW(d,i)),d.css(u),"horz"!=l&&sizeMidPanes(e,!0),state.initialized&&(initHandles(e),initHotkeys(e)),a.initClosed&&a.closable&&!a.initHidden?close(e,!0,!0):a.initHidden||a.initClosed?hide(e):o.noRoom||d.css("display","block"),d.css("visibility","visible"),a.showOverflowOnHover&&d.hover(allowOverflow,resetOverflow),state.initialized&&afterInitPane(e)}},afterInitPane=function(e){var t=$Ps[e],i=state[e],n=options[e];t&&(t.data("layout")&&refreshChildren(e,t.data("layout")),i.isVisible&&(state.initialized?resizeAll():sizeContent(e),n.triggerEventsOnLoad?_runCallbacks("onresize_end",e):resizeChildren(e,!0)),n.initChildren&&n.children&&createChildren(e))},setPanePosition=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var i=$Ps[t],n=$Rs[t],r=(options[t],state[t]),a=_c[t].side,o={};if(i){switch(t){case"north":o.top=sC.inset.top,o.left=sC.inset.left,o.right=sC.inset.right;break;case"south":o.bottom=sC.inset.bottom,o.left=sC.inset.left,o.right=sC.inset.right;break;case"west":o.left=sC.inset.left;break;case"east":o.right=sC.inset.right}i.css(o),n&&r.isClosed?n.css(a,sC.inset[a]):n&&!r.isHidden&&n.css(a,sC.inset[a]+getPaneSize(t))}})},initHandles=function(e){e=e?e.split(","):_c.borderPanes,$.each(e,function(e,t){var i=$Ps[t];if($Rs[t]=!1,$Ts[t]=!1,i){var n=options[t],r=state[t],a=(_c[t],"#"===n.paneSelector.substr(0,1)?n.paneSelector.substr(1):""),o=n.resizerClass,s=n.togglerClass,l=(r.isVisible?n.spacing_open:n.spacing_closed,"-"+t),c=(r.isVisible,Instance[t]),u=c.resizer=$Rs[t]=$("<div></div>"),d=c.toggler=!!n.closable&&($Ts[t]=$("<div></div>"));!r.isVisible&&n.slidable&&u.attr("title",n.tips.Slide).css("cursor",n.sliderCursor),u.attr("id",a?a+"-resizer":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"resizer"}).css(_c.resizers.cssReq).css("zIndex",options.zIndexes.resizer_normal).css(n.applyDemoStyles?_c.resizers.cssDemo:{}).addClass(o+" "+o+l).hover(addHover,removeHover).hover(onResizerEnter,onResizerLeave).mousedown($.layout.disableTextSelection).mouseup($.layout.enableTextSelection).appendTo($N),$.fn.disableSelection&&u.disableSelection(),n.resizerDblClickToggle&&u.bind("dblclick."+sID,toggle),d&&(d.attr("id",a?a+"-toggler":"").data({parentLayout:Instance,layoutPane:Instance[t],layoutEdge:t,layoutRole:"toggler"}).css(_c.togglers.cssReq).css(n.applyDemoStyles?_c.togglers.cssDemo:{}).addClass(s+" "+s+l).hover(addHover,removeHover).bind("mouseenter",onResizerEnter).appendTo(u),n.togglerContent_open&&$("<span>"+n.togglerContent_open+"</span>").data({layoutEdge:t,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",t).addClass("content content-open").css("display","none").appendTo(d),n.togglerContent_closed&&$("<span>"+n.togglerContent_closed+"</span>").data({layoutEdge:t,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo(d),enableClosable(t)),initResizable(t),r.isVisible?setAsOpen(t):(setAsClosed(t),bindStartSlidingEvents(t,!0))}}),sizeHandles()},initContent=function(e,t){if(isInitialized()){var i,n=options[e],r=n.contentSelector,a=Instance[e],o=$Ps[e];r&&(i=a.content=$Cs[e]=n.findNestedContent?o.find(r).eq(0):o.children(r).eq(0)),i&&i.length?(i.data("layoutRole","content"),i.data("layoutCSS")||i.data("layoutCSS",styles(i,"height")),i.css(_c.content.cssReq),n.applyDemoStyles&&(i.css(_c.content.cssDemo),o.css(_c.content.cssDemoPane)),o.css("overflowX").match(/(scroll|auto)/)&&o.css("overflow","hidden"),state[e].content={},!1!==t&&sizeContent(e)):a.content=$Cs[e]=!1}},initResizable=function(e){var t=$.layout.plugins.draggable;e=e?e.split(","):_c.borderPanes,$.each(e,function(e,n){var r=options[n];if(!t||!$Ps[n]||!r.resizable)return r.resizable=!1,!0;var a,o,s=state[n],l=options.zIndexes,c=_c[n],u="horz"==c.dir?"top":"left",d=($Ps[n],$Rs[n]),h=r.resizerClass,p=0,f=h+"-drag",m=h+"-"+n+"-drag",g=h+"-dragging",v=h+"-"+n+"-dragging",y=h+"-dragging-limit",_=h+"-"+n+"-dragging-limit",b=!1;s.isClosed||d.attr("title",r.tips.Resize).css("cursor",r.resizerCursor),d.draggable({containment:$N[0],axis:"horz"==c.dir?"y":"x",delay:0,distance:1,grid:r.resizingGrid,helper:"clone",opacity:r.resizerDragOpacity,addClasses:!1,zIndex:l.resizer_drag,start:function(e,t){if(r=options[n],s=state[n],o=r.livePaneResizing,!1===_runCallbacks("ondrag_start",n))return!1;s.isResizing=!0,state.paneResizing=n,timer.clear(n+"_closeSlider"),setSizeLimits(n),a=s.resizerPosition,p=t.position[u],d.addClass(f+" "+m),b=!1,showMasks(n,{resizing:!0})},drag:function(e,t){b||(t.helper.addClass(g+" "+v).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden"),b=!0,s.isSliding&&$Ps[n].css("zIndex",l.pane_sliding));var c=0;t.position[u]<a.min?(t.position[u]=a.min,c=-1):t.position[u]>a.max&&(t.position[u]=a.max,c=1),c?(t.helper.addClass(y+" "+_),window.defaultStatus=c>0&&n.match(/(north|west)/)||c<0&&n.match(/(south|east)/)?r.tips.maxSizeWarning:r.tips.minSizeWarning):(t.helper.removeClass(y+" "+_),window.defaultStatus=""),o&&Math.abs(t.position[u]-p)>=r.liveResizingTolerance&&(p=t.position[u],i(e,t,n))},stop:function(e,t){$("body").enableSelection(),window.defaultStatus="",d.removeClass(f+" "+m),s.isResizing=!1,state.paneResizing=!1,i(e,t,n,!0)}})});var i=function(e,t,i,n){var r,a=t.position,o=_c[i],s=options[i],l=state[i];switch(i){case"north":r=a.top;break;case"west":r=a.left;break;case"south":r=sC.layoutHeight-a.top-s.spacing_open;break;case"east":r=sC.layoutWidth-a.left-s.spacing_open}var c=r-sC.inset[o.side];if(n)!1!==_runCallbacks("ondrag_end",i)&&manualSizePane(i,c,!1,!0),hideMasks(!0),l.isSliding&&showMasks(i,{resizing:!0});else{if(Math.abs(c-l.size)<s.liveResizingTolerance)return;manualSizePane(i,c,!1,!0),sizeMasks()}}},sizeMask=function(){var e=$(this),t=e.data("layoutMask"),i=state[t];"IFRAME"==i.tagName&&i.isVisible&&e.css({top:i.offsetTop,left:i.offsetLeft,width:i.outerWidth,height:i.outerHeight})},sizeMasks=function(){$Ms.each(sizeMask)},showMasks=function(e,t){var i,n,r=_c[e],a=["center"],o=options.zIndexes,s=$.extend({objectsOnly:!1,animation:!1,resizing:!0,sliding:state[e].isSliding},t);s.resizing&&a.push(e),s.sliding&&a.push(_c.oppositeEdge[e]),"horz"===r.dir&&(a.push("west"),a.push("east")),$.each(a,function(e,t){n=state[t],i=options[t],n.isVisible&&(i.maskObjects||!s.objectsOnly&&i.maskContents)&&getMasks(t).each(function(){sizeMask.call(this),this.style.zIndex=n.isSliding?o.pane_sliding+1:o.pane_normal+1,this.style.display="block"})})},hideMasks=function(e){if(e||!state.paneResizing)$Ms.hide();else if(!e&&!$.isEmptyObject(state.panesSliding))for(var t,i,n=$Ms.length-1;n>=0;n--)i=$Ms.eq(n),t=i.data("layoutMask"),options[t].maskObjects||i.hide()},getMasks=function(e){for(var t,i=$([]),n=0,r=$Ms.length;n<r;n++)t=$Ms.eq(n),t.data("layoutMask")===e&&(i=i.add(t));return i.length?i:createMasks(e)},createMasks=function(e){var t,i,n,r,a,o=$Ps[e],s=state[e],l=options[e],c=options.zIndexes;if(!l.maskContents&&!l.maskObjects)return $([]);for(a=0;a<(l.maskObjects?2:1);a++)t=l.maskObjects&&0==a,i=document.createElement(t?"iframe":"div"),n=$(i).data("layoutMask",e),i.className="ui-layout-mask ui-layout-mask-"+e,r=i.style,r.background="#FFF",r.position="absolute",r.display="block",t?(i.src="about:blank",i.frameborder=0,r.border=0,r.opacity=0,r.filter="Alpha(Opacity='0')"):(r.opacity=.001,r.filter="Alpha(Opacity='1')"),"IFRAME"==s.tagName?(r.zIndex=c.pane_normal+1,$N.append(i)):(n.addClass("ui-layout-mask-inside-pane"),r.zIndex=l.maskZindex||c.content_mask,r.top=0,r.left=0,r.width="100%",r.height="100%",o.append(i)),$Ms=$Ms.add(i);return $Ms},destroy=function(e,t){$(window).unbind("."+sID),$(document).unbind("."+sID),"object"==typeof e?evtPane(e):t=e,$N.clearQueue().removeData("layout").removeData("layoutContainer").removeClass(options.containerClass).unbind("."+sID),$Ms.remove(),$.each(_c.allPanes,function(e,i){removePane(i,!1,!0,t)});var i="layoutCSS";$N.data(i)&&!$N.data("layoutRole")&&$N.css($N.data(i)).removeData(i),"BODY"===sC.tagName&&($N=$("html")).data(i)&&$N.css($N.data(i)).removeData(i),runPluginCallbacks(Instance,$.layout.onDestroy),unload();for(var n in Instance)n.match(/^(container|options)$/)||delete Instance[n];return Instance.destroyed=!0,Instance},removePane=function(e,t,i,n){if(isInitialized()){var r=evtPane.call(this,e),a=$Ps[r],o=$Cs[r],s=$Rs[r],l=$Ts[r];a&&$.isEmptyObject(a.data())&&(a=!1),o&&$.isEmptyObject(o.data())&&(o=!1),s&&$.isEmptyObject(s.data())&&(s=!1),l&&$.isEmptyObject(l.data())&&(l=!1),a&&a.stop(!0,!0);var c=options[r],u=(state[r],"layoutCSS"),d=children[r],h=$.isPlainObject(d)&&!$.isEmptyObject(d),p=void 0!==n?n:c.destroyChildren;if(h&&p&&($.each(d,function(e,t){t.destroyed||t.destroy(!0),t.destroyed&&delete d[e]}),$.isEmptyObject(d)&&(d=children[r]=null,h=!1)),a&&t&&!h)a.remove();else if(a&&a[0]){var f=c.paneClass,m=f+"-"+r,g=[f,f+"-open",f+"-closed",f+"-sliding",m,m+"-open",m+"-closed",m+"-sliding"];$.merge(g,getHoverClasses(a,!0)),a.removeClass(g.join(" ")).removeData("parentLayout").removeData("layoutPane").removeData("layoutRole").removeData("layoutEdge").removeData("autoHidden").unbind("."+sID),h&&o?(o.width(o.width()),$.each(d,function(e,t){t.resizeAll()})):o&&o.css(o.data(u)).removeData(u).removeData("layoutRole"),a.data("layout")||a.css(a.data(u)).removeData(u)}l&&l.remove(),s&&s.remove(),Instance[r]=$Ps[r]=$Cs[r]=$Rs[r]=$Ts[r]=!1,{removed:!0},i||resizeAll()}},_hidePane=function(e){var t=$Ps[e],i=options[e],n=t[0].style;i.useOffscreenClose?(t.data(_c.offscreenReset)||t.data(_c.offscreenReset,{left:n.left,
|
||
right:n.right}),t.css(_c.offscreenCSS)):t.hide().removeData(_c.offscreenReset)},_showPane=function(e){var t=$Ps[e],i=options[e],n=_c.offscreenCSS,r=t.data(_c.offscreenReset),a=t[0].style;t.show().removeData(_c.offscreenReset),i.useOffscreenClose&&r&&(a.left==n.left&&(a.left=r.left),a.right==n.right&&(a.right=r.right))},hide=function(e,t){if(isInitialized()){var i=evtPane.call(this,e),n=options[i],r=state[i],a=$Ps[i],o=$Rs[i];"center"!==i&&a&&!r.isHidden&&(state.initialized&&!1===_runCallbacks("onhide_start",i)||(r.isSliding=!1,delete state.panesSliding[i],o&&o.hide(),!state.initialized||r.isClosed?(r.isClosed=!0,r.isHidden=!0,r.isVisible=!1,state.initialized||_hidePane(i),sizeMidPanes("horz"===_c[i].dir?"":"center"),(state.initialized||n.triggerEventsOnLoad)&&_runCallbacks("onhide_end",i)):(r.isHiding=!0,close(i,!1,t))))}},show=function(e,t,i,n){if(isInitialized()){var r=evtPane.call(this,e),a=(options[r],state[r]),o=$Ps[r];$Rs[r];"center"!==r&&o&&a.isHidden&&!1!==_runCallbacks("onshow_start",r)&&(a.isShowing=!0,a.isSliding=!1,delete state.panesSliding[r],!1===t?close(r,!0):open(r,!1,i,n))}},toggle=function(e,t){if(isInitialized()){var i=evtObj(e),n=evtPane.call(this,e),r=state[n];i&&i.stopImmediatePropagation(),r.isHidden?show(n):r.isClosed?open(n,!!t):close(n)}},_closePane=function(e,t){var i=($Ps[e],state[e]);_hidePane(e),i.isClosed=!0,i.isVisible=!1,t&&setAsClosed(e)},close=function(e,t,i,n){function r(){h.isMoving=!1,bindStartSlidingEvents(a,!0);var e=_c.oppositeEdge[a];state[e].noRoom&&(setSizeLimits(e),makePaneFit(e)),n||!state.initialized&&!d.triggerEventsOnLoad||(s||_runCallbacks("onclose_end",a),s&&_runCallbacks("onshow_end",a),l&&_runCallbacks("onhide_end",a))}var a=evtPane.call(this,e);if("center"!==a){if(!state.initialized&&$Ps[a])return void _closePane(a,!0);if(isInitialized()){var o,s,l,c,u=$Ps[a],d=($Rs[a],$Ts[a],options[a]),h=state[a];_c[a];$N.queue(function(e){if(!u||!d.closable&&!h.isShowing&&!h.isHiding||!t&&h.isClosed&&!h.isShowing)return e();var n=!h.isShowing&&!1===_runCallbacks("onclose_start",a);if(s=h.isShowing,l=h.isHiding,c=h.isSliding,delete h.isShowing,delete h.isHiding,n)return e();o=!i&&!h.isClosed&&"none"!=d.fxName_close,h.isMoving=!0,h.isClosed=!0,h.isVisible=!1,l?h.isHidden=!0:s&&(h.isHidden=!1),h.isSliding?bindStopSlidingEvents(a,!1):sizeMidPanes("horz"===_c[a].dir?"":"center",!1),setAsClosed(a),o?(lockPaneForFX(a,!0),u.hide(d.fxName_close,d.fxSettings_close,d.fxSpeed_close,function(){lockPaneForFX(a,!1),h.isClosed&&r(),e()})):(_hidePane(a),r(),e())})}}},setAsClosed=function(e){if($Rs[e]){var t=($Ps[e],$Rs[e]),i=$Ts[e],n=options[e],r=state[e],a=_c[e].side,o=n.resizerClass,s=n.togglerClass,l="-"+e;t.css(a,sC.inset[a]).removeClass(o+"-open "+o+l+"-open").removeClass(o+"-sliding "+o+l+"-sliding").addClass(o+"-closed "+o+l+"-closed"),r.isHidden&&t.hide(),n.resizable&&$.layout.plugins.draggable&&t.draggable("disable").removeClass("ui-state-disabled").css("cursor","default").attr("title",""),i&&(i.removeClass(s+"-open "+s+l+"-open").addClass(s+"-closed "+s+l+"-closed").attr("title",n.tips.Open),i.children(".content-open").hide(),i.children(".content-closed").css("display","block")),syncPinBtns(e,!1),state.initialized&&sizeHandles()}},open=function(e,t,i,n){function r(){u.isMoving=!1,_fixIframe(s),u.isSliding||sizeMidPanes("vert"==_c[s].dir?"center":"",!1),setAsOpen(s)}if(isInitialized()){var a,o,s=evtPane.call(this,e),l=$Ps[s],c=($Rs[s],$Ts[s],options[s]),u=state[s];_c[s];"center"!==s&&$N.queue(function(e){if(!l||!c.resizable&&!c.closable&&!u.isShowing||u.isVisible&&!u.isSliding)return e();if(u.isHidden&&!u.isShowing)return e(),void show(s,!0);u.autoResize&&u.size!=c.size?sizePane(s,c.size,!0,!0,!0):setSizeLimits(s,t);var d=_runCallbacks("onopen_start",s);return"abort"===d?e():("NC"!==d&&setSizeLimits(s,t),u.minSize>u.maxSize?(syncPinBtns(s,!1),!n&&c.tips.noRoomToOpen&&alert(c.tips.noRoomToOpen),e()):(t?bindStopSlidingEvents(s,!0):u.isSliding?bindStopSlidingEvents(s,!1):c.slidable&&bindStartSlidingEvents(s,!1),u.noRoom=!1,makePaneFit(s),o=u.isShowing,delete u.isShowing,a=!i&&u.isClosed&&"none"!=c.fxName_open,u.isMoving=!0,u.isVisible=!0,u.isClosed=!1,o&&(u.isHidden=!1),void(a?(lockPaneForFX(s,!0),l.show(c.fxName_open,c.fxSettings_open,c.fxSpeed_open,function(){lockPaneForFX(s,!1),u.isVisible&&r(),e()})):(_showPane(s),r(),e()))))})}},setAsOpen=function(e,t){var i=$Ps[e],n=$Rs[e],r=$Ts[e],a=options[e],o=state[e],s=_c[e].side,l=a.resizerClass,c=a.togglerClass,u="-"+e;n.css(s,sC.inset[s]+getPaneSize(e)).removeClass(l+"-closed "+l+u+"-closed").addClass(l+"-open "+l+u+"-open"),o.isSliding?n.addClass(l+"-sliding "+l+u+"-sliding"):n.removeClass(l+"-sliding "+l+u+"-sliding"),removeHover(0,n),a.resizable&&$.layout.plugins.draggable?n.draggable("enable").css("cursor",a.resizerCursor).attr("title",a.tips.Resize):o.isSliding||n.css("cursor","default"),r&&(r.removeClass(c+"-closed "+c+u+"-closed").addClass(c+"-open "+c+u+"-open").attr("title",a.tips.Close),removeHover(0,r),r.children(".content-closed").hide(),r.children(".content-open").css("display","block")),syncPinBtns(e,!o.isSliding),$.extend(o,elDims(i)),state.initialized&&(sizeHandles(),sizeContent(e,!0)),!t&&(state.initialized||a.triggerEventsOnLoad)&&i.is(":visible")&&(_runCallbacks("onopen_end",e),o.isShowing&&_runCallbacks("onshow_end",e),state.initialized&&_runCallbacks("onresize_end",e))},slideOpen=function(e){function t(){r.isClosed?r.isMoving||open(n,!0):bindStopSlidingEvents(n,!0)}if(isInitialized()){var i=evtObj(e),n=evtPane.call(this,e),r=state[n],a=options[n].slideDelay_open;"center"!==n&&(i&&i.stopImmediatePropagation(),r.isClosed&&i&&"mouseenter"===i.type&&a>0?timer.set(n+"_openSlider",t,a):t())}},slideClose=function(e){function t(){a.isClosed?bindStopSlidingEvents(n,!1):a.isMoving||close(n)}if(isInitialized()){var i=evtObj(e),n=evtPane.call(this,e),r=options[n],a=state[n],o=a.isMoving?1e3:300;if("center"!==n&&!a.isClosed&&!a.isResizing)if("click"===r.slideTrigger_close)t();else{if(r.preventQuickSlideClose&&a.isMoving)return;if(r.preventPrematureSlideClose&&i&&$.layout.isMouseOverElem(i,$Ps[n]))return;i?timer.set(n+"_closeSlider",t,max(r.slideDelay_close,o)):t()}}},slideToggle=function(e){var t=evtPane.call(this,e);toggle(t,!0)},lockPaneForFX=function(e,t){var i=$Ps[e],n=state[e],r=options[e],a=options.zIndexes;t?(showMasks(e,{animation:!0,objectsOnly:!0}),i.css({zIndex:a.pane_animate}),"south"==e?i.css({top:sC.inset.top+sC.innerHeight-i.outerHeight()}):"east"==e&&i.css({left:sC.inset.left+sC.innerWidth-i.outerWidth()})):(hideMasks(),i.css({zIndex:n.isSliding?a.pane_sliding:a.pane_normal}),"south"==e?i.css({top:"auto"}):"east"!=e||i.css("left").match(/\-99999/)||i.css({left:"auto"}),browser.msie&&r.fxOpacityFix&&"slide"!=r.fxName_open&&i.css("filter")&&1==i.css("opacity")&&i[0].style.removeAttribute("filter"))},bindStartSlidingEvents=function(e,t){var i=options[e],n=($Ps[e],$Rs[e]),r=i.slideTrigger_open.toLowerCase();!n||t&&!i.slidable||(r.match(/mouseover/)?r=i.slideTrigger_open="mouseenter":r.match(/(click|dblclick|mouseenter)/)||(r=i.slideTrigger_open="click"),i.resizerDblClickToggle&&r.match(/click/)&&n[t?"unbind":"bind"]("dblclick."+sID,toggle),n[t?"bind":"unbind"](r+"."+sID,slideOpen).css("cursor",t?i.sliderCursor:"default").attr("title",t?i.tips.Slide:""))},bindStopSlidingEvents=function(e,t){function i(t){timer.clear(e+"_closeSlider"),t.stopPropagation()}var n=options[e],r=state[e],a=(_c[e],options.zIndexes),o=n.slideTrigger_close.toLowerCase(),s=t?"bind":"unbind",l=$Ps[e],c=$Rs[e];timer.clear(e+"_closeSlider"),t?(r.isSliding=!0,state.panesSliding[e]=!0,bindStartSlidingEvents(e,!1)):(r.isSliding=!1,delete state.panesSliding[e]),l.css("zIndex",t?a.pane_sliding:a.pane_normal),c.css("zIndex",t?a.pane_sliding+2:a.resizer_normal),o.match(/(click|mouseleave)/)||(o=n.slideTrigger_close="mouseleave"),c[s](o,slideClose),"mouseleave"===o&&(l[s]("mouseleave."+sID,slideClose),c[s]("mouseenter."+sID,i),l[s]("mouseenter."+sID,i)),t?"click"!==o||n.resizable||(c.css("cursor",t?n.sliderCursor:"default"),c.attr("title",t?n.tips.Close:"")):timer.clear(e+"_closeSlider")},makePaneFit=function(e,t,i,n){var r=options[e],a=state[e],o=_c[e],s=$Ps[e],l=$Rs[e],c="vert"===o.dir,u=!1;if(("center"===e||c&&a.noVerticalRoom)&&(u=a.maxHeight>=0,u&&a.noRoom?(_showPane(e),l&&l.show(),a.isVisible=!0,a.noRoom=!1,c&&(a.noVerticalRoom=!1),_fixIframe(e)):u||a.noRoom||(_hidePane(e),l&&l.hide(),a.isVisible=!1,a.noRoom=!0)),"center"===e);else if(a.minSize<=a.maxSize){if(u=!0,a.size>a.maxSize)sizePane(e,a.maxSize,i,!0,n);else if(a.size<a.minSize)sizePane(e,a.minSize,i,!0,n);else if(l&&a.isVisible&&s.is(":visible")){var d=a.size+sC.inset[o.side];$.layout.cssNum(l,o.side)!=d&&l.css(o.side,d)}a.noRoom&&(a.wasOpen&&r.closable?r.autoReopen?open(e,!1,!0,!0):a.noRoom=!1:show(e,a.wasOpen,!0,!0))}else a.noRoom||(a.noRoom=!0,a.wasOpen=!a.isClosed&&!a.isSliding,a.isClosed||(r.closable?close(e,!0,!0):hide(e,!0)))},manualSizePane=function(e,t,i,n,r){if(isInitialized()){var a=evtPane.call(this,e),o=options[a],s=state[a],l=r||o.livePaneResizing&&!s.isResizing;"center"!==a&&(s.autoResize=!1,sizePane(a,t,i,n,l))}},sizePane=function(e,t,i,n,r){function a(){for(var e="width"===f?d.outerWidth():d.outerHeight(),n=[{pane:l,count:1,target:t,actual:e,correct:t===e,attempt:t,cssSize:s}],a=n[0],c={},g="Inaccurate size after resizing the "+l+"-pane.";!(a.correct||(c={pane:l,count:a.count+1,target:t},a.actual>t?c.attempt=max(0,a.attempt-(a.actual-t)):c.attempt=max(0,a.attempt+(t-a.actual)),c.cssSize=cssSize(l,c.attempt),d.css(f,c.cssSize),c.actual="width"==f?d.outerWidth():d.outerHeight(),c.correct=t===c.actual,1===n.length&&(_log(g,!1,!0),_log(a,!1,!0)),_log(c,!1,!0),n.length>3));)n.push(c),a=n[n.length-1];u.size=t,$.extend(u,elDims(d)),u.isVisible&&d.is(":visible")&&(h&&h.css(p,t+sC.inset[p]),sizeContent(l)),!i&&!m&&state.initialized&&u.isVisible&&_runCallbacks("onresize_end",l),i||(u.isSliding||sizeMidPanes("horz"==_c[l].dir?"":"center",m,r),sizeHandles());var v=_c.oppositeEdge[l];t<o&&state[v].noRoom&&(setSizeLimits(v),makePaneFit(v,!1,i)),n.length>1&&_log(g+"\nSee the Error Console for details.",!0,!0)}if(isInitialized()){var o,s,l=evtPane.call(this,e),c=options[l],u=state[l],d=$Ps[l],h=$Rs[l],p=_c[l].side,f=_c[l].sizeType.toLowerCase(),m=u.isResizing&&!c.triggerEventsDuringLiveResize,g=!0!==n&&c.animatePaneSizing;"center"!==l&&$N.queue(function(e){if(setSizeLimits(l),o=u.size,t=_parseSize(l,t),t=max(t,_parseSize(l,c.minSize)),(t=min(t,u.maxSize))<u.minSize)return e(),void makePaneFit(l,!1,i);if(!r&&t===o)return e();if(u.newSize=t,!i&&state.initialized&&u.isVisible&&_runCallbacks("onresize_start",l),s=cssSize(l,t),g&&d.is(":visible")){var n=$.layout.effects.size[l]||$.layout.effects.size.all,h=c.fxSettings_size.easing||n.easing,p=options.zIndexes,m={};m[f]=s+"px",u.isMoving=!0,d.css({zIndex:p.pane_animate}).show().animate(m,c.fxSpeed_size,h,function(){d.css({zIndex:u.isSliding?p.pane_sliding:p.pane_normal}),u.isMoving=!1,delete u.newSize,a(),e()})}else d.css(f,s),delete u.newSize,d.is(":visible")?a():u.size=t,e()})}},sizeMidPanes=function(e,t,i){e=(e||"east,west,center").split(","),$.each(e,function(e,n){if($Ps[n]){var r=options[n],a=state[n],o=$Ps[n],s=($Rs[n],!0),l={},c=$.layout.showInvisibly(o),u=calcNewCenterPaneDims();if($.extend(a,elDims(o)),"center"===n){if(!i&&a.isVisible&&u.width===a.outerWidth&&u.height===a.outerHeight)return o.css(c),!0;if($.extend(a,cssMinDims(n),{maxWidth:u.width,maxHeight:u.height}),l=u,a.newWidth=l.width,a.newHeight=l.height,l.width=cssW(o,l.width),l.height=cssH(o,l.height),s=l.width>=0&&l.height>=0,!state.initialized&&r.minWidth>u.width){var d=r.minWidth-a.outerWidth,h=options.east.minSize||0,p=options.west.minSize||0,f=state.east.size,m=state.west.size,g=f,v=m;if(d>0&&state.east.isVisible&&f>h&&(g=max(f-h,f-d),d-=f-g),d>0&&state.west.isVisible&&m>p&&(v=max(m-p,m-d),d-=m-v),0===d)return f&&f!=h&&sizePane("east",g,!0,!0,i),m&&m!=p&&sizePane("west",v,!0,!0,i),sizeMidPanes("center",t,i),void o.css(c)}}else{if(a.isVisible&&!a.noVerticalRoom&&$.extend(a,elDims(o),cssMinDims(n)),!i&&!a.noVerticalRoom&&u.height===a.outerHeight)return o.css(c),!0;l.top=u.top,l.bottom=u.bottom,a.newSize=u.height,l.height=cssH(o,u.height),a.maxHeight=l.height,s=a.maxHeight>=0,s||(a.noVerticalRoom=!0)}if(s?(!t&&state.initialized&&_runCallbacks("onresize_start",n),o.css(l),"center"!==n&&sizeHandles(n),!a.noRoom||a.isClosed||a.isHidden||makePaneFit(n),a.isVisible&&($.extend(a,elDims(o)),state.initialized&&sizeContent(n))):!a.noRoom&&a.isVisible&&makePaneFit(n),o.css(c),delete a.newSize,delete a.newWidth,delete a.newHeight,!a.isVisible)return!0;if("center"===n){var y=browser.isIE6||!browser.boxModel;$Ps.north&&(y||"IFRAME"==state.north.tagName)&&$Ps.north.css("width",cssW($Ps.north,sC.innerWidth)),$Ps.south&&(y||"IFRAME"==state.south.tagName)&&$Ps.south.css("width",cssW($Ps.south,sC.innerWidth))}!t&&state.initialized&&_runCallbacks("onresize_end",n)}})},resizeAll=function(e){var t=sC.innerWidth,i=sC.innerHeight;if(evtPane(e),$N.is(":visible")){if(!state.initialized)return void _initLayoutElements();if(!0===e&&$.isPlainObject(options.outset)&&$N.css(options.outset),$.extend(sC,elDims($N,options.inset)),sC.outerHeight){if(!0===e&&setPanePosition(),!1===_runCallbacks("onresizeall_start"))return!1;var n,r,a;sC.innerHeight,sC.innerWidth;$.each(["south","north","east","west"],function(e,t){$Ps[t]&&(r=options[t],a=state[t],a.autoResize&&a.size!=r.size?sizePane(t,r.size,!0,!0,!0):(setSizeLimits(t),makePaneFit(t,!1,!0,!0)))}),sizeMidPanes("",!0,!0),sizeHandles(),$.each(_c.allPanes,function(e,t){(n=$Ps[t])&&state[t].isVisible&&_runCallbacks("onresize_end",t)}),_runCallbacks("onresizeall_end")}}},resizeChildren=function(e,t){var i=evtPane.call(this,e);if(options[i].resizeChildren){t||refreshChildren(i);var n=children[i];$.isPlainObject(n)&&$.each(n,function(e,t){t.destroyed||t.resizeAll()})}},sizeContent=function(e,t){if(isInitialized()){var i=evtPane.call(this,e);i=i?i.split(","):_c.allPanes,$.each(i,function(e,i){function n(e){return max(l.css.paddingBottom,parseInt(e.css("marginBottom"),10)||0)}function r(){var e=options[i].contentIgnoreSelector,t=o.nextAll().not(".ui-layout-mask").not(e||":lt(0)"),r=t.filter(":visible"),a=r.filter(":last");c={top:o[0].offsetTop,height:o.outerHeight(),numFooters:t.length,hiddenFooters:t.length-r.length,spaceBelow:0},c.spaceAbove=c.top,c.bottom=c.top+c.height,a.length?c.spaceBelow=a[0].offsetTop+a.outerHeight()-c.bottom+n(a):c.spaceBelow=n(o)}var a=$Ps[i],o=$Cs[i],s=options[i],l=state[i],c=l.content;if(!a||!o||!a.is(":visible"))return!0;if((o.length||(initContent(i,!1),o))&&!1!==_runCallbacks("onsizecontent_start",i)){(!l.isMoving&&!l.isResizing||s.liveContentResizing||t||void 0==c.top)&&(r(),c.hiddenFooters>0&&"hidden"===a.css("overflow")&&(a.css("overflow","visible"),r(),a.css("overflow","hidden")));var u=l.innerHeight-(c.spaceAbove-l.css.paddingTop)-(c.spaceBelow-l.css.paddingBottom);o.is(":visible")&&c.height==u||(setOuterHeight(o,u,!0),c.height=u),state.initialized&&_runCallbacks("onsizecontent_end",i)}})}},sizeHandles=function(e){var t=evtPane.call(this,e);t=t?t.split(","):_c.borderPanes,$.each(t,function(e,t){var i,n=options[t],r=state[t],a=$Ps[t],o=$Rs[t],s=$Ts[t];if(a&&o){var l,c,u,d=_c[t].dir,h=r.isClosed?"_closed":"_open",p=n["spacing"+h],f=n["togglerAlign"+h],m=n["togglerLength"+h];if(0===p)return void o.hide();if(r.noRoom||r.isHidden||o.show(),"horz"===d?(l=sC.innerWidth,r.resizerLength=l,c=$.layout.cssNum(a,"left"),o.css({width:cssW(o,l),height:cssH(o,p),left:c>-9999?c:sC.inset.left})):(l=a.outerHeight(),r.resizerLength=l,o.css({height:cssH(o,l),width:cssW(o,p),top:sC.inset.top+getPaneSize("north",!0)})),removeHover(n,o),s){if(0===m||r.isSliding&&n.hideTogglerOnSlide)return void s.hide();if(s.show(),!(m>0)||"100%"===m||m>l)m=l,u=0;else if(isStr(f))switch(f){case"top":case"left":u=0;break;case"bottom":case"right":u=l-m;break;case"middle":case"center":default:u=round((l-m)/2)}else{var g=parseInt(f,10);u=f>=0?g:l-m+g}if("horz"===d){var v=cssW(s,m);s.css({width:v,height:cssH(s,p),left:u,top:0}),s.children(".content").each(function(){i=$(this),i.css("marginLeft",round((v-i.outerWidth())/2))})}else{var y=cssH(s,m);s.css({height:y,width:cssW(s,p),top:u,left:0}),s.children(".content").each(function(){i=$(this),i.css("marginTop",round((y-i.outerHeight())/2))})}removeHover(0,s)}state.initialized||!n.initHidden&&!r.isHidden||(o.hide(),s&&s.hide())}})},enableClosable=function(e){if(isInitialized()){var t=evtPane.call(this,e),i=$Ts[t],n=options[t];i&&(n.closable=!0,i.bind("click."+sID,function(e){e.stopPropagation(),toggle(t)}).css("visibility","visible").css("cursor","pointer").attr("title",state[t].isClosed?n.tips.Open:n.tips.Close).show())}},disableClosable=function(e,t){if(isInitialized()){var i=evtPane.call(this,e),n=$Ts[i];n&&(options[i].closable=!1,state[i].isClosed&&open(i,!1,!0),n.unbind("."+sID).css("visibility",t?"hidden":"visible").css("cursor","default").attr("title",""))}},enableSlidable=function(e){if(isInitialized()){var t=evtPane.call(this,e),i=$Rs[t];i&&i.data("draggable")&&(options[t].slidable=!0,state[t].isClosed&&bindStartSlidingEvents(t,!0))}},disableSlidable=function(e){if(isInitialized()){var t=evtPane.call(this,e),i=$Rs[t];i&&(options[t].slidable=!1,state[t].isSliding?close(t,!1,!0):(bindStartSlidingEvents(t,!1),i.css("cursor","default").attr("title",""),removeHover(null,i[0])))}},enableResizable=function(e){if(isInitialized()){var t=evtPane.call(this,e),i=$Rs[t],n=options[t];i&&i.data("draggable")&&(n.resizable=!0,i.draggable("enable"),state[t].isClosed||i.css("cursor",n.resizerCursor).attr("title",n.tips.Resize))}},disableResizable=function(e){if(isInitialized()){var t=evtPane.call(this,e),i=$Rs[t];i&&i.data("draggable")&&(options[t].resizable=!1,i.draggable("disable").css("cursor","default").attr("title",""),removeHover(null,i[0]))}},swapPanes=function(e,t){function i(e){var t=$Ps[e],i=$Cs[e];return!!t&&{pane:e,P:!!t&&t[0],C:!!i&&i[0],state:$.extend(!0,{},state[e]),options:$.extend(!0,{},options[e])}}function n(e,t){if(e){var i,n,r=e.P,a=e.C,o=e.pane,l=_c[t],c=$.extend(!0,{},state[t]),u=options[t],d={resizerCursor:u.resizerCursor};$.each("fxName,fxSpeed,fxSettings".split(","),function(e,t){d[t+"_open"]=u[t+"_open"],d[t+"_close"]=u[t+"_close"],d[t+"_size"]=u[t+"_size"]}),$Ps[t]=$(r).data({layoutPane:Instance[t],layoutEdge:t}).css(_c.hidden).css(l.cssReq),$Cs[t]=!!a&&$(a),options[t]=$.extend(!0,{},e.options,d),state[t]=$.extend(!0,{},e.state),i=new RegExp(u.paneClass+"-"+o,"g"),r.className=r.className.replace(i,u.paneClass+"-"+t),initHandles(t),l.dir!=_c[o].dir?(n=s[t]||0,setSizeLimits(t),n=max(n,state[t].minSize),manualSizePane(t,n,!0,!0)):$Rs[t].css(l.side,sC.inset[l.side]+(state[t].isVisible?getPaneSize(t):0)),e.state.isVisible&&!c.isVisible?setAsOpen(t,!0):(setAsClosed(t),bindStartSlidingEvents(t,!0)),e=null}}if(isInitialized()){var r=evtPane.call(this,e);if(state[r].edge=t,state[t].edge=r,!1===_runCallbacks("onswap_start",r)||!1===_runCallbacks("onswap_start",t))return state[r].edge=r,void(state[t].edge=t);var a=i(r),o=i(t),s={};s[r]=a?a.state.size:0,s[t]=o?o.state.size:0,$Ps[r]=!1,$Ps[t]=!1,state[r]={},state[t]={},$Ts[r]&&$Ts[r].remove(),$Ts[t]&&$Ts[t].remove(),$Rs[r]&&$Rs[r].remove(),$Rs[t]&&$Rs[t].remove(),$Rs[r]=$Rs[t]=$Ts[r]=$Ts[t]=!1,n(a,t),n(o,r),a=o=s=null,$Ps[r]&&$Ps[r].css(_c.visible),$Ps[t]&&$Ps[t].css(_c.visible),resizeAll(),_runCallbacks("onswap_end",r),_runCallbacks("onswap_end",t)}},syncPinBtns=function(e,t){$.layout.plugins.buttons&&$.each(state[e].pins,function(i,n){$.layout.buttons.setPinState(Instance,$(n),e,t)})},$N=$(this).eq(0);if(!$N.length)return _log(options.errors.containerMissing);if($N.data("layoutContainer")&&$N.data("layout"))return $N.data("layout");var $Ps={},$Cs={},$Rs={},$Ts={},$Ms=$([]),sC=state.container,sID=state.id,Instance={options:options,state:state,container:$N,panes:$Ps,contents:$Cs,resizers:$Rs,togglers:$Ts,hide:hide,show:show,toggle:toggle,open:open,close:close,slideOpen:slideOpen,slideClose:slideClose,slideToggle:slideToggle,setSizeLimits:setSizeLimits,_sizePane:sizePane,sizePane:manualSizePane,sizeContent:sizeContent,swapPanes:swapPanes,showMasks:showMasks,hideMasks:hideMasks,initContent:initContent,addPane:addPane,removePane:removePane,createChildren:createChildren,refreshChildren:refreshChildren,enableClosable:enableClosable,disableClosable:disableClosable,enableSlidable:enableSlidable,disableSlidable:disableSlidable,enableResizable:enableResizable,disableResizable:disableResizable,allowOverflow:allowOverflow,resetOverflow:resetOverflow,destroy:destroy,initPanes:isInitialized,resizeAll:resizeAll,runCallbacks:_runCallbacks,hasParentLayout:!1,children:children,north:!1,south:!1,west:!1,east:!1,center:!1};return"cancel"===_create()?null:Instance}}(jQuery),function(e){e.layout&&(e.ui||(e.ui={}),e.ui.cookie={acceptsCookies:!!navigator.cookieEnabled,read:function(t){var i,n,r,a=document.cookie,o=a?a.split(";"):[];for(r=0;i=o[r];r++)if(n=e.trim(i).split("="),n[0]==t)return decodeURIComponent(n[1]);return null},write:function(t,i,n){var r="",a="",o=!1,s=n||{},l=s.expires||null,c=e.type(l);"date"===c?a=l:"string"===c&&l>0&&(l=parseInt(l,10),c="number"),"number"===c&&(a=new Date,l>0?a.setDate(a.getDate()+l):(a.setFullYear(1970),o=!0)),a&&(r+=";expires="+a.toUTCString()),s.path&&(r+=";path="+s.path),s.domain&&(r+=";domain="+s.domain),s.secure&&(r+=";secure"),document.cookie=t+"="+(o?"":encodeURIComponent(i))+r},clear:function(t){e.ui.cookie.write(t,"",{expires:-1})}},e.cookie||(e.cookie=function(t,i,n){var r=e.ui.cookie;if(null===i)r.clear(t);else{if(void 0===i)return r.read(t);r.write(t,i,n)}}),e.layout.plugins.stateManagement=!0,e.layout.defaults.stateManagement={enabled:!1,autoSave:!0,autoLoad:!0,animateLoad:!0,includeChildren:!0,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:!1}},e.layout.optionsMap.layout.push("stateManagement"),e.layout.config.optionRootKeys.push("stateManagement"),e.layout.state={saveCookie:function(t,i,n){var r=t.options,a=r.stateManagement,o=e.extend(!0,{},a.cookie,n||null),s=t.state.stateData=t.readState(i||a.stateKeys);return e.ui.cookie.write(o.name||r.name||"Layout",e.layout.state.encodeJSON(s),o),e.extend(!0,{},s)},deleteCookie:function(t){var i=t.options;e.ui.cookie.clear(i.stateManagement.cookie.name||i.name||"Layout")},readCookie:function(t){var i=t.options,n=e.ui.cookie.read(i.stateManagement.cookie.name||i.name||"Layout");return n?e.layout.state.decodeJSON(n):{}},loadCookie:function(t){var i=e.layout.state.readCookie(t);return i&&!e.isEmptyObject(i)&&(t.state.stateData=e.extend(!0,{},i),t.loadState(i)),i},loadState:function(t,i,n){if(e.isPlainObject(i)&&!e.isEmptyObject(i)){i=t.state.stateData=e.layout.transformData(i);var r=t.options.stateManagement;if(n=e.extend({animateLoad:!1,includeChildren:r.includeChildren},n),t.state.initialized){var a,o,l,c,u,d=!n.animateLoad;if(e.each(e.layout.config.borderPanes,function(n,r){a=i[r],e.isPlainObject(a)&&(s=a.size,o=a.initClosed,l=a.initHidden,ar=a.autoResize,c=t.state[r],u=c.isVisible,ar&&(c.autoResize=ar),u||t._sizePane(r,s,!1,!1,!1),!0===l?t.hide(r,d):!0===o?t.close(r,!1,d):!1===o?t.open(r,!1,d):!1===l&&t.show(r,!1,d),u&&t._sizePane(r,s,!1,!1,d))}),n.includeChildren){var h,p;e.each(t.children,function(t,n){(h=i[t]?i[t].children:0)&&n&&e.each(n,function(e,t){p=h[e],t&&p&&t.loadState(p)})})}}else{var a=e.extend(!0,{},i);e.each(e.layout.config.allPanes,function(e,t){a[t]&&delete a[t].children}),e.extend(!0,t.options,a)}}},readState:function(t,i){"string"===e.type(i)&&(i={keys:i}),i||(i={});var n,r,a,o,s,l,c,u=t.options.stateManagement,d=i.includeChildren,h=void 0!==d?d:u.includeChildren,p=i.stateKeys||u.stateKeys,f={isClosed:"initClosed",isHidden:"initHidden"},m=t.state,g=e.layout.config.allPanes,v={};e.isArray(p)&&(p=p.join(",")),p=p.replace(/__/g,".").split(",");for(var y=0,_=p.length;y<_;y++)n=p[y].split("."),r=n[0],a=n[1],e.inArray(r,g)<0||void 0!=(o=m[r][a])&&("isClosed"==a&&m[r].isSliding&&(o=!0),(v[r]||(v[r]={}))[f[a]?f[a]:a]=o);return h&&e.each(g,function(i,n){l=t.children[n],s=m.stateData[n],e.isPlainObject(l)&&!e.isEmptyObject(l)&&(c=v[n]||(v[n]={}),c.children||(c.children={}),e.each(l,function(t,i){i.state.initialized?c.children[t]=e.layout.state.readState(i):s&&s.children&&s.children[t]&&(c.children[t]=e.extend(!0,{},s.children[t]))}))}),v},encodeJSON:function(t){function i(t){var i,n,r,a=[],o=0,s=e.isArray(t);for(i in t)n=t[i],r=typeof n,"string"==r?n='"'+n+'"':"object"==r&&(n=parse(n)),a[o++]=(s?"":'"'+i+'":')+n;return(s?"[":"{")+a.join(",")+(s?"]":"}")}return((window.JSON||{}).stringify||i)(t)},decodeJSON:function(t){try{return e.parseJSON?e.parseJSON(t):window.eval("("+t+")")||{}}catch(e){return{}}},_create:function(t){var i=e.layout.state,n=t.options,r=n.stateManagement;if(e.extend(t,{readCookie:function(){return i.readCookie(t)},deleteCookie:function(){i.deleteCookie(t)},saveCookie:function(e,n){return i.saveCookie(t,e,n)},loadCookie:function(){return i.loadCookie(t)},loadState:function(e,n){i.loadState(t,e,n)},readState:function(e){return i.readState(t,e)},encodeJSON:i.encodeJSON,decodeJSON:i.decodeJSON}),t.state.stateData={},r.autoLoad)if(e.isPlainObject(r.autoLoad))e.isEmptyObject(r.autoLoad)||t.loadState(r.autoLoad);else if(r.enabled)if(e.isFunction(r.autoLoad)){var a={};try{a=r.autoLoad(t,t.state,t.options,t.options.name||"")}catch(e){}a&&e.isPlainObject(a)&&!e.isEmptyObject(a)&&t.loadState(a)}else t.loadCookie()},_unload:function(t){var i=t.options.stateManagement;if(i.enabled&&i.autoSave)if(e.isFunction(i.autoSave))try{i.autoSave(t,t.state,t.options,t.options.name||"")}catch(e){}else t.saveCookie()}},e.layout.onCreate.push(e.layout.state._create),e.layout.onUnload.push(e.layout.state._unload))}(jQuery),function(e){e.layout&&(e.layout.plugins.buttons=!0,e.layout.defaults.autoBindCustomButtons=!1,e.layout.optionsMap.layout.push("autoBindCustomButtons"),e.layout.buttons={config:{borderPanes:"north,south,west,east"},init:function(t){var i,n=t.options.name||"";e.each("toggle,open,close,pin,toggle-slide,open-slide".split(","),function(r,a){e.each(e.layout.buttons.config.borderPanes.split(","),function(r,o){e(".ui-layout-button-"+a+"-"+o).each(function(){void 0!=(i=e(this).data("layoutName")||e(this).attr("layoutName"))&&i!==n||t.bindButton(this,a,o)})})})},get:function(t,i,n,r){var a=e(i),o=t.options;if(a.length&&e.layout.buttons.config.borderPanes.indexOf(n)>=0){var s=o[n].buttonClass+"-"+r;a.addClass(s+" "+s+"-"+n).data("layoutName",o.name)}return a},bind:function(t,i,n,r){var a=e.layout.buttons;switch(n.toLowerCase()){case"toggle":a.addToggle(t,i,r);break;case"open":a.addOpen(t,i,r);break;case"close":a.addClose(t,i,r);break;case"pin":a.addPin(t,i,r);break;case"toggle-slide":a.addToggle(t,i,r,!0);break;case"open-slide":a.addOpen(t,i,r,!0)}return t},addToggle:function(t,i,n,r){return e.layout.buttons.get(t,i,n,"toggle").click(function(e){t.toggle(n,!!r),e.stopPropagation()}),t},addOpen:function(t,i,n,r){return e.layout.buttons.get(t,i,n,"open").attr("title",t.options[n].tips.Open).click(function(e){t.open(n,!!r),e.stopPropagation()}),t},addClose:function(t,i,n){return e.layout.buttons.get(t,i,n,"close").attr("title",t.options[n].tips.Close).click(function(e){t.close(n),e.stopPropagation()}),t},addPin:function(t,i,n){var r=e.layout.buttons.get(t,i,n,"pin");if(r.length){var a=t.state[n];r.click(function(i){e.layout.buttons.setPinState(t,e(this),n,a.isSliding||a.isClosed),a.isSliding||a.isClosed?t.open(n):t.close(n),i.stopPropagation()}),e.layout.buttons.setPinState(t,r,n,!a.isClosed&&!a.isSliding),a.pins.push(i)}return t},setPinState:function(e,t,i,n){var r=t.attr("pin");if(!r||n!==("down"==r)){var a=e.options[i],o=a.tips,s=a.buttonClass+"-pin",l=s+"-"+i,c=s+"-up "+l+"-up",u=s+"-down "+l+"-down";t.attr("pin",n?"down":"up").attr("title",n?o.Unpin:o.Pin).removeClass(n?c:u).addClass(n?u:c)}},syncPinBtns:function(t,i,n){e.each(state[i].pins,function(r,a){e.layout.buttons.setPinState(t,e(a),i,n)})},_load:function(t){e.extend(t,{bindButton:function(i,n,r){return e.layout.buttons.bind(t,i,n,r)},addToggleBtn:function(i,n,r){return e.layout.buttons.addToggle(t,i,n,r)},addOpenBtn:function(i,n,r){return e.layout.buttons.addOpen(t,i,n,r)},addCloseBtn:function(i,n){return e.layout.buttons.addClose(t,i,n)},addPinBtn:function(i,n){return e.layout.buttons.addPin(t,i,n)}});for(var i=0;i<4;i++){var n=e.layout.buttons.config.borderPanes[i];t.state[n].pins=[]}t.options.autoBindCustomButtons&&e.layout.buttons.init(t)},_unload:function(e){}},e.layout.onLoad.push(e.layout.buttons._load))}(jQuery),function(e){e.layout.plugins.browserZoom=!0,e.layout.defaults.browserZoomCheckInterval=1e3,e.layout.optionsMap.layout.push("browserZoomCheckInterval"),e.layout.browserZoom={_init:function(t){!1!==e.layout.browserZoom.ratio()&&e.layout.browserZoom._setTimer(t)},_setTimer:function(t){if(!t.destroyed){var i=t.options,n=t.state,r=t.hasParentLayout?5e3:Math.max(i.browserZoomCheckInterval,100);setTimeout(function(){if(!t.destroyed&&i.resizeWithWindow){var r=e.layout.browserZoom.ratio();r!==n.browserZoom&&(n.browserZoom=r,t.resizeAll()),e.layout.browserZoom._setTimer(t)}},r)}},ratio:function(){function t(e,t){return(parseInt(e,10)/parseInt(t,10)*100).toFixed()}var i,n,r,a=window,o=screen,s=document,l=s.documentElement||s.body,c=e.layout.browser,u=c.version;return!(!c.msie||u>8)&&(o.deviceXDPI&&o.systemXDPI?t(o.deviceXDPI,o.systemXDPI):c.webkit&&(i=s.body.getBoundingClientRect)?t(i.left-i.right,s.body.offsetWidth):c.webkit&&(n=a.outerWidth)?t(n,a.innerWidth):!(!(n=o.width)||!(r=l.clientWidth))&&t(n,r))}},e.layout.onReady.push(e.layout.browserZoom._init)}(jQuery),function(e){e.effects&&(e.layout.defaults.panes.useOffscreenClose=!1,e.layout.plugins&&(e.layout.plugins.effects.slideOffscreen=!0),e.layout.effects.slideOffscreen=e.extend(!0,{},e.layout.effects.slide),e.effects.slideOffscreen=function(t){return this.queue(function(){var i=e.effects,n=t.options,r=e(this),a=r.data("layoutEdge"),o=r.data("parentLayout").state,s=o[a].size,l=this.style,c=i.setMode(r,n.mode||"show"),u="show"==c,d=n.direction||"left",h="up"==d||"down"==d?"top":"left",p="up"==d||"left"==d,f=e.layout.config.offscreenCSS||{},m=e.layout.config.offscreenReset,g="offscreenResetTop",v={};v[h]=(u?p?"+=":"-=":p?"-=":"+=")+s,u?(r.data(g,{top:l.top,bottom:l.bottom}),p?r.css(h,isNaN(s)?"-"+s:-s):"right"===d?r.css({left:o.container.layoutWidth,right:"auto"}):r.css({top:o.container.layoutHeight,bottom:"auto"}),"top"===h&&r.css(r.data(m)||{})):(r.data(g,{top:l.top,bottom:l.bottom}),r.data(m,{left:l.left,right:l.right})),r.show().animate(v,{queue:!1,duration:t.duration,easing:n.easing,complete:function(){r.data(g)&&r.css(r.data(g)).removeData(g),u?r.css(r.data(m)||{}).removeData(m):r.css(f),t.callback&&t.callback.apply(this,arguments),r.dequeue()}})})})}(jQuery),define("layout",["jquery","jqueryui"],function(){}),define("text!modules/console/assist/lang.json",[],function(){
|
||
return'{\r\n "config": {\r\n "vms": {},\r\n \r\n\r\n "iswaiting": true,\r\n \r\n \r\n "vm_param": "",\r\n "vm_param2": "",\r\n "is_split": false,\r\n \r\n "step_msg": "",\r\n "is_assist": false,\r\n "assist_process_token": "",\r\n "assist_conn_token": "",\r\n\r\n\r\n "step": {\r\n "token": "",\r\n "progress": 10,\r\n "res_id": "",\r\n "protocol": "",\r\n "res_id2": "",\r\n "protocol2": "",\r\n "protocol2_data": [],\r\n "ip": "",\r\n "res_list": [\r\n\r\n ],\r\n "vm_models": {},\r\n\r\n "fields": [\r\n {\r\n "field": "vm_name",\r\n "type": "select",\r\n "data": [],\r\n "value": ""\r\n },\r\n {\r\n "field": "protocols",\r\n "type": "select",\r\n "data": [],\r\n "value": ""\r\n },\r\n \r\n \r\n {\r\n "field": "unhelp",\r\n "hide": true,\r\n "type": "button",\r\n "enabled": true\r\n },\r\n\r\n {\r\n "field": "refresh",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true\r\n\r\n },\r\n {\r\n "field": "viewtype",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true\r\n\r\n }\r\n ]\r\n },\r\n "timeout": {\r\n "zero":0,\r\n "hour": "00",\r\n "minute": "00",\r\n "second": "00"\r\n\r\n },\r\n \r\n \r\n \r\n\r\n "isloaded": false,\r\n\r\n\r\n\r\n\r\n "op_type": {"title": ""}\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "all_status": "全部完成",\r\n "section_status": "部分完成",\r\n "undone_status": "未完成",\r\n "title": "实验报告",\r\n "save": "保存",\r\n "purpose": "实验目的",\r\n "savestep": "保存并提交",\r\n "name": "实验名称",\r\n "completion": "完成情况",\r\n "undone": "未完成原因",\r\n "content": "报告内容",\r\n "report": "实验报告",\r\n "remotely": "远程协助",\r\n "monitor": "实验监控",\r\n "scrapbooking": "剪贴板",\r\n "uploadFiles": "上传文件",\r\n "timeCost": "实验用时:",\r\n "docmarkdown": "文档",\r\n "question": "问答",\r\n "notes": "笔记",\r\n "evaluation": "评价",\r\n "fraction": "给实验打分",\r\n "publish": "发表",\r\n "viewtype": "显示方式",\r\n "contitle": "实验桌面标题",\r\n "course_step_evaluate": "实验评价",\r\n\r\n "send_comment": "发表",\r\n "grade": "给实验评分",\r\n "create": "创建",\r\n "clipboard": "剪贴板",\r\n\r\n "close": "关闭",\r\n "help": "请求协助",\r\n "unhelp": "取消协助",\r\n "assist": "协助",\r\n "creatingvm": "正在创建实验环境……",\r\n "ladingvmerror": "加载实验环境失败,请点击刷新按钮或等待10秒重新加载",\r\n "RDP": "桌面版",\r\n "SSH": "命令行版",\r\n "waiting": "实验环境正在准备中...",\r\n "creating": "准备中...",\r\n "refresh": "刷新",\r\n "click": "点击创建加载环境...",\r\n "remain_time": "剩余时间",\r\n "hour": "时",\r\n "minute": "分",\r\n "second": "秒",\r\n "accept_assist": "对方已接受协助请求",\r\n "reject_assist": "对方拒绝了协助请求",\r\n "timeout": "学习时间已结束,实验环境已经删除。如果继续学习,请重新创建",\r\n "Warning": "温馨提示",\r\n "cannot_load": "加载实验环境失败,请重试",\r\n "operation_unsupported": "不支持此操作",\r\n "internal_error": "发生了内部错误,无法执行操作。",\r\n "vm_used_locked": "实验环境已经在使用或锁定,请刷新控制台页面",\r\n "vm_closed": "实验环境已经关闭,请重新创建",\r\n "vm_busy": "实验环境忙,需要首先释放连接,然后重试或尝试刷新操作",\r\n "vm_connect_use": "控制台已经被另一个连接使用,请先关闭该连接,或者刷新控制台页面。",\r\n "vm_authorized_fail": "授权失败,请联系管理员或尝试刷新操作",\r\n "vm_many_resources": "您已经使用了太多的资源,请关闭一些正在使用的实验环境或尝试刷新操作",\r\n "noselectText": "请先选中页面中的文本内容",\r\n "evaluate_tip": "还可以输入<span>{0}</span>字",\r\n "cancel": "取消",\r\n "material": "实验随材",\r\n "op_type": "协助方式",\r\n "read": "观看",\r\n "write": "控制"\r\n },\r\n "en": {\r\n "index": "首页",\r\n "learncenter": "学习中心"\r\n }\r\n }\r\n}'}),define("modules/console/assist/controller",["app-utils","modules/console/basecontroller","jquery","guacamole","modules/console/expdesktop/service","toolbar","layout","text!modules/console/assist/lang.json"],function(e,t,i,n,r,a,o,s){function l(e,t,i){this.container=e,this.language=t,this.appOptions=i,this.lang=s,this.guac=null,this.vstep_id=null,this.step_id=null,this.res_list={},this.timer=null,this.temp_ips=[],this.progresstimer=null,this.n=0,this.reconnect=1,this.vmlayout=null,this.layouttype="east"}var c={initAvalon:function(t){var n=this;t.events.completionFun=function(e){n.data.fields_report[0].value=e},t.$watch("step.res_list",function(e){e&&n.set_vm_ips()}),t.$watch("vm_param",function(e){n.data.iswaiting=!1,e&&n.show_vm()}),t.$watch("vm_param2",function(e){n.data.iswaiting=!1,e&&n.show_vm2()}),t.$watch("is_split",function(e){if(e){n.data.step.protocol2_data=[],n.data.step.res_id2=n.container.find("select[name='vm_ip2']").val();n.getFieldsByName("vm_name",n.data.step).data=[{id:n.data.step.res_id,title:n.res_list[n.data.step.res_id].res_name}];var t=n.data.step.vm_models[n.data.step.res_id2];t&&t.forEach(function(e){n.data.step.protocol2_data.push({id:e,title:n.i18n[e]})}),n.data.step.protocol2=n.container.find("select[name='protocol2']").val()}else n.set_vm_ips()}),t.$watch("step_msg",function(t){t&&e.msg_success(t)}),t.$watch("is_assist",function(e){n.setbtnstatus(),e||n.close_vm()});var r=i("body").width(),a=n.container.find(".expDesktopEvaluation").outerWidth(!0);n.container.find(".expDesktop_con_wrap").width(r+a),n.container.find("#displayvm").width(r),window.onresize=function(){var e=i("body").width();e<=1200&&(e=1200);var t=n.container.find(".expDesktopEvaluation").outerWidth(!0);n.data.isspread?(n.container.find("#displayvm").css({width:e-t+"px"}),n.container.find("#displayvm").width(e-t)):n.container.find("#displayvm").width(e),n.set_vm_scale()},t.events.goback=function(){history.go(-1)}},setDataControl:function(e){this.dataControl=e,this.service=new r(this.dataControl),this.dataControl.addLisenter("assist",this,this.socket)},socket:function(e,t,i){var n=this;n.step_id==t&&"end"==i.stage&&"link"==i.action&&(this.data.iswaiting=!1,this.setTime(i.message.remain_time),this.data.step.token=i.message.conn_token,this.data.step.protocol=i.message.link.protocol,this.data.step.res_id=i.message.link.res_id,this.data.assist_process_token=i.message.process_token,this.data.vm_param={token:i.message.conn_token,protocol:i.message.link.protocol,res_id:i.message.link.res_id},this.data.step.res_list=i.message.res_list,this.data.is_assist=!0),this.step_id!=t||"end"!=i.stage||"cancel"!=i.action&&"completed"!=i.action||n.close_vm()},setvm_param:function(e){this.data.vm_param=e},setvm_param2:function(e){this.data.vm_param2=e},show_vm:function(){var e=this,t=String(e.data.vm_param.token),n=e.data.vm_param.protocol,r=e.data.vm_param.res_id;if(t){var a=e.data.vms;e.data.vms[r]||(a[r]={token:t}),a[r].guac&&(a[r].guac.disconnect(),a[r].guac=null);var o=new Guacamole.WebSocketTunnel(SDC.sock_type+"://"+SDC.guacHost+"/v1/assist");a[r].guac=new Guacamole.Client(o),e.container.find("#display").empty(),e.container.find("#display").html(a[r].guac.getDisplay().getElement()),a[r].guac.onerror=function(t){0==t.code?e.data.iswaiting=!1:e.console_conn_error(t.code)},vm_width=i(e.container.find("#displayvm")).width(),vm_height=i(e.container.find("#displayvm")).height()-10;var s="vm_token="+t+"&vm_protocol="+n+"&vm_resid="+r+"&vm_width="+vm_width+"&vm_height="+vm_height;a[r].guac.connect(s),a[r].display=a[r].guac.getDisplay(),e.set_mouseEvent(r)}},show_vm2:function(){var e=this,t=String(e.data.vm_param2.token),n=e.data.vm_param2.protocol,r=e.data.vm_param2.res_id;if(t){var a=e.data.vms;e.data.vms[r]||(a[r]={token:t}),a[r].guac&&(a[r].guac.disconnect(),a[r].guac=null);var o=new Guacamole.WebSocketTunnel(SDC.sock_type+"://"+SDC.guacHost+"/v1/learn");a[r].guac=new Guacamole.Client(o),e.container.find("#display2").empty(),e.container.find("#display2").html(a[r].guac.getDisplay().getElement()),a[r].guac.onerror=function(t){0==t.code?e.data.iswaiting=!1:e.console_conn_error(t.code,!0)},vm_width=i(e.container.find("#display2")).width(),vm_height=i(e.container.find("#display2")).height();var s="vm_token="+t+"&vm_protocol="+n+"&vm_resid="+r+"&vm_width="+vm_width+"&vm_height="+vm_height;a[r].guac.connect(s),a[r].display=a[r].guac.getDisplay(),e.set_mouseEvent(r)}},set_mouseEvent:function(e){function t(t){var r=new Guacamole.Mouse.State(t.x/a[e].display.getScale(),t.y/a[e].display.getScale(),t.left,t.middle,t.right,t.up,t.down);a[e].guac.sendMouseState(r),a[e].keyboard.onkeydown=i,a[e].keyboard.onkeyup=n}function i(t){a[e].guac.sendKeyEvent(1,t)}function n(t){a[e].guac.sendKeyEvent(0,t)}var r=this,a=r.data.vms;a[e].mouse=new Guacamole.Mouse(a[e].guac.getDisplay().getElement()),a[e].keyboard||(a[e].keyboard=new Guacamole.Keyboard(document)),a[e].mouse.onmousedown=a[e].mouse.onmouseup=a[e].mouse.onmousemove=function(i){r.clearfacus(),a[e].display.showCursor(!1),t(i)},a[e].mouse.onmouseout=function(t){a[e].display.showCursor(!1),a[e].keyboard.onkeydown=null,a[e].keyboard.onkeyup=null}},add_mouseEvent:function(e){var t=this,i=t.data.vms;i[e].mouse&&i[e].mouse.addEventListener()},remove_mouseEvent:function(e){var t=this,i=t.data.vms;i[e].mouse&&i[e].mouse.removeEventListener()},set_vm_scale:function(){var e=this,t=e.data.vms,n=0;for(var r in t){if(!t[r].display)return;r==e.data.vm_param.res_id?(winW=i(e.container.find("#display")).width(),n=e.container.find("#display").height()-10):(winW=i(e.container.find("#display2")).width(),n=e.container.find("#display2").height()-10),t[r].guac.sendSize(winW,n)}return},set_vm_ips:function(){var e=this,t=e.data.step.res_list,i=e.getFieldsByName("vm_name",e.data.step);i.data=[],t.forEach(function(t){i.data.push({id:t.res_id,title:t.res_name}),e.data.step.vm_models[t.res_id]=t.protocol_list,e.res_list[t.res_id]=t}),i.value=e.data.step.res_id,e.set_protocols();var n=e.getFieldsByName("viewtype",e.data.step);i.data.length>1&&(n.hide=!1)},set_protocols:function(){var e=this,t=e.getFieldsByName("protocols",e.data.step);t.data=[];var i=[],n=e.data.step.vm_models[e.data.step.res_id];n&&n.forEach(function(t){i.push({id:t,title:e.i18n[t]})}),t.data=i,t.value=e.data.step.protocol},setTime:function(e){var t=this;this.timer&&clearInterval(this.timer);var i=t.data.timeout,n=Math.floor(e/86400);i.hour=Math.floor((e-24*n*60*60)/3600),2!=i.hour.toString().length&&(i.hour="0"+i.hour),i.minute=Math.floor((e-24*n*60*60-3600*i.hour)/60),2!=i.minute.toString().length&&(i.minute="0"+i.minute),i.second=Math.floor(e-24*n*60*60-3600*i.hour-60*i.minute),2!=i.second.toString().length&&(i.second="0"+i.second);var r=0;this.timer=setInterval(function(){if((r+=1)>e)clearInterval(t.timer),i.hour="00",i.minute="00",i.second="00";else{var n=e-r,a=Math.floor(n/86400);i.hour=Math.floor((n-24*a*60*60)/3600),2!=i.hour.toString().length&&(i.hour="0"+i.hour),i.minute=Math.floor((n-24*a*60*60-3600*i.hour)/60),2!=i.minute.toString().length&&(i.minute="0"+i.minute),i.second=Math.floor(n-24*a*60*60-3600*i.hour-60*i.minute),2!=i.second.toString().length&&(i.second="0"+i.second)}},1e3)},close_vm:function(){var e=this;e.container.find("#display").empty(),e.container.find("#display2").empty();for(var t in e.data.vms){var i=e.data.vms[t];i.guac&&(i.guac.disconnect(),i.guac=null)}e.data.is_split=!1,e.vmlayout&&e.vmlayout.hide(e.layouttype),e.data.step.progress=0,e.data.vm_param="",e.data.step.token="",e.data.step.protocol="",e.data.step.res_id="",e.data.step.res_list=[],e.data.step.vm_models=[],e.data.op_type=null,e.setTime(0),e.data.step.fields.forEach(function(e,t){e.hide=!0})},console_conn_error:function(t,i){var n=this,r=n.i18n.cannot_load;switch(t){case 256:r=n.i18n.operation_unsupported;break;case 512:r=n.i18n.internal_error;break;case 517:r=n.i18n.vm_used_locked;break;case 518:r=n.i18n.vm_closed;break;case 519:case 769:if(i){setTimeout(n.show_vm2(),3e3)}else{setTimeout(function(){n.show_vm()},3e3)}break;case 521:r=n.i18n.vm_connect_use;break;case 797:r=n.i18n.vm_many_resources}521==t?n.modal_alert(r):e.msg_warning(r)},modal_alert:function(e){var t=this;layer.alert(e,{icon:7,title:t.i18n.Warning,closeBtn:1,btn:[t.i18n.refresh],yes:function(){t.show_vm()},shade:.3})},setbtnstatus:function(){var e=this,t=e.getFieldsByName("unhelp",e.data.step);e.getFieldsByName("refresh",e.data.step).hide=!e.data.is_assist,t.hide=!e.data.is_assist},viewType:function(e){var t=this;t.layouttype=e,t.container.find("#east_south").attr("class","ui-layout-"+e),t.vmlayout&&t.vmlayout.destroy(),t.vmlayout=t.container.find("#displayvm").layout({applyDemoStyles:!1,resizable:!0,livePaneResizing:!0,east__size:.5,minSize:.3,maxSize:.7,south__size:.5,ondrag_start:function(){t.data.vm_param.res_id&&t.remove_mouseEvent(t.data.vm_param.res_id),t.data.vm_param2&&t.remove_mouseEvent(t.data.vm_param2.res_id)},ondrag_end:function(){t.data.vm_param&&t.add_mouseEvent(t.data.vm_param.res_id),t.data.vm_param2&&t.add_mouseEvent(t.data.vm_param2.res_id),t.set_vm_scale()},onload_end:function(){t.data.vm_param2={token:t.data.step.token,protocol:t.data.step.protocol2,res_id:t.data.step.res_id2},t.set_vm_scale()}})},clearfacus:function(){this.container.find("input").blur(),this.container.find("select").blur()},onInitialize:function(t){var n=this;this.initialized=!1,n.container.find(".console-ullist").removeClass("hide");var r=i(window).height(),a=n.container.find(".expDesktop_head").height();if(n.container.find(".expDesktop_con").height(r-a-20),n.container.find("#displayvm").height(r-a-20),t&&(prameters=t.split("_"),2==prameters.length)){n.user_id=prameters[0],n.step_id=prameters[1];var o=localStorage.getItem(t);o&&(SDC.msgsocket||(SDC.msgsocket=new WebSocket(SDC.sock_type+"://"+SDC.SOCKJS_URL+"/v1/msg")),o=JSON.parse(o),o.op_type&&(n.data.op_type.title="您正"+(n.i18n[o.op_type]||o.op_type)+o.owner_real_name+"的实验"),SDC.msgsocket.onopen=function(){SDC.msgsocket.send(JSON.stringify({Authorization:SDC.user.auth_token})),n.service.check_assist({step_id:n.step_id,owner:n.user_id}).done(function(e){"{}"==JSON.stringify(e)?n.service.accept_assist({token:o.process_token}):(n.data.iswaiting=!1,n.setTime(e.remain_time),n.data.step.token=e.conn_token,n.data.step.protocol=e.link.protocol,n.data.step.res_id=e.link.res_id,n.data.assist_process_token=e.process_token,n.data.vm_param={token:e.conn_token,protocol:e.link.protocol,res_id:e.link.res_id},n.data.step.res_list=e.res_list,n.data.is_assist=!0)})},n.container.delegate('button[name="unhelp"]:not(.disabled)',"click",function(){n.dataControl.message.confirm(n.i18n.cancel,n.i18n.assist,function(e){n.service.complete_assist({token:String(n.data.assist_process_token)}).done(function(){n.data.is_assist=!1}),layer.close(e)})}),n.container.delegate('a[name="textcopy"]:not(.disabled)',"click",function(){var t=e.selectText();if(!t)return void e.msg_warning(n.i18n.noselectText);var i=n.data.vms;for(var r in i)i[r].guac.setClipboard(t)}),n.container.delegate('button[name="refresh"]:not(.disabled)',"click",function(){n.show_vm(),n.show_vm2()}),n.container.delegate("#southview","click",function(){n.data.is_split=!0,n.viewType("south")}),n.container.delegate("#eastview","click",function(){n.data.is_split=!0,n.viewType("east")}),n.container.delegate("#singleview","click",function(){n.data.is_split=!1,n.vmlayout.hide(n.layouttype),n.set_vm_scale()}),n.container.find('button[name="viewtype"]').toolbar({content:"#toolbar-viewtype",position:"bottom",style:"primary"}),n.container.find('button[name="viewtype"]').on("toolbarItemClick",function(e,t,i){i.hide()}),n.container.delegate('select[name="vm_name"]:not(.disabled)',"change",function(){var e=i(this).val();n.data.step.res_id=e,n.data.step.protocol=n.data.step.vm_models[e][0],n.setvm_param({token:n.data.step.token,protocol:n.data.step.protocol,res_id:e}),n.set_protocols()}),n.container.delegate('select[name="vm_ip2"]:not(.disabled)',"change",function(){var e=i(this).val();n.data.step.res_id2=e,n.data.step.protocol2=n.data.step.vm_models[e][0],n.setvm_param2({token:n.data.step.token,protocol:n.data.step.protocol2,res_id:e})}),n.container.delegate('select[name="protocols"]:not(.disabled)',"change",function(){var e=i(this).val();n.data.step.protocol=e,n.setvm_param({token:n.data.step.token,protocol:e,res_id:n.data.step.res_id})}),n.container.delegate('select[name="protocol2"]:not(.disabled)',"change",function(){var e=i(this).val();n.data.step.protocol2=e,n.setvm_param2({token:n.data.step.token,protocol:e,res_id:n.data.step.res_id2})}),n.container.find("#btntoolbar").toolbar({content:"#toolbar-options",position:"bottom",style:"primary"}),n.container.find("#btntoolbar").on("toolbarItemClick",function(e,t,i){i.hide()}),n.container.find("#btntoolbar").on("toolbarShown",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.find("#btntoolbar").on("toolbarHidden",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.find("#docmarkdown").on("mouseup",function(){if((document.selection?document.selection.createRange().text:window.getSelection()+"")&&n.data.vms){var t=e.getMousePos();i("#btntoolbar").css({left:t.x,top:t.y}),n.container.find("#btntoolbar").trigger("mouseover")}}))}},onClose:function(){this.content&&this.content.destroy(),this.container.remove()},getModelLabel:function(){return"expdesktop_view"}};return i.extend(l.prototype,t.prototype),i.extend(l.prototype,c),l}),function(e,t){"function"==typeof define&&define.amd?define("lsbridge",[],t):"object"==typeof exports?module.exports=t():e.lsbridge=t()}(this,function(){var e={};if(e.isLSAvailable=function(){try{return localStorage.setItem("_","_"),localStorage.removeItem("_"),!0}catch(e){return!1}}(),e.isLSAvailable){var t=localStorage,i={},n=!1,r={},a=function(){for(var e in i){var n=t.getItem(e);if(n&&r[e]&&-1===r[e].indexOf(n)){r[e].push(n);try{var o=JSON.parse(n);o&&(n=o)}catch(e){}for(var s=0;s<i[e].length;s++)i[e][s](n);t.getItem(e+"-removeit")||(t.setItem(e+"-removeit","1"),function(i){setTimeout(function(){t.removeItem(i),t.removeItem(i+"-removeit"),r[e]=[]},200)}(e))}else n||(r[e]=[])}return setTimeout(a,100),!0};e.send=function(e,i){var n="";"function"==typeof i&&(i=i()),n="object"==typeof i?JSON.stringify(i):i,t.setItem(e,n)},e.subscribe=function(e,t){i[e]||(i[e]=[],r[e]=[]),i[e].push(t),n||(n=a())},e.unsubscribe=function(e){i[e]&&(i[e]=[]),r[e]&&(r[e]=[])},e.getBuffer=function(){return r}}else e.send=e.subscribe=function(){throw new Error("localStorage not supported.")};return e}),define("modules/console/expdesktop/model/guacamole/controller",["app-utils","jquery","guacamole"],function(e,t,i){function n(e,t,i,n){this.guac_client="",this.display="",this.token=t.token,this.tunnel_url=t.tunnel_url,this.url=t.url,this.element=e,this.i18n=t.i18n,this.options=t,this.data=i,this.callback=n}var r={init:function(){var e=this,i=new Guacamole.WebSocketTunnel(this.tunnel_url);this.guac_client=new Guacamole.Client(i),this.guac_client.connect(this.url),this.display=this.guac_client.getDisplay(),t(e.element).css({width:"100%"}),e.element.empty(),e.element.html(this.display.getElement()),e.callback&&e.callback(e.guac_client);var n=0;return this.guac_client.onstatechange=function(i){3==i&&(clearTimeout(n),n=setTimeout(function(){e.set_vm_scale(t(window).width()-e.options.box_width)},2e3)),5!==i||e.options.refresh||e.modal_alert("当前连接已断开,请刷新重试!")},this.guac_client.onclipboard=function(t,i){var n;if(/^text\//.exec(i)){n=new Guacamole.StringReader(t);var r="";n.ontext=function(e){r+=e},n.onend=function(){try{e.data.scrapbooking_text=r}catch(e){}}}else n=new Guacamole.BlobReader(t,i),n.onend=function(){e.data.scrapbooking_text=n.getBlob()}},e.set_mouseEvent(),this.guac_client.onerror=function(t){e.console_conn_error(t.code),e.guac_client.disconnect()},e},console_conn_error:function(t){console.log(t);var i=this,n="";switch(i.options.refresh=!0,t){case 256:n=i.i18n.operation_unsupported;break;case 512:n=i.i18n.internal_error;break;case 517:n=i.i18n.vm_used_locked;break;case 518:n=i.i18n.vm_closed;break;case 521:n=i.i18n.vm_connect_use;break;case 797:n=i.i18n.vm_many_resources;break;case 769:case 519:setTimeout(function(){i.init()},5e3);break;default:i.init()}521===t?i.modal_alert(n):n&&e.msg_error(n,"",{timeOut:5e3})},modal_alert:function(e){var t=this;layer.alert(e,{icon:7,title:t.i18n.Warning,closeBtn:1,btn:[t.i18n.refresh],yes:function(e){t.options.refresh=!0,t.init(),t.options.refresh=!1,layer.close(e)},shade:.3})},set_mouseEvent:function(){function e(e){var r=new Guacamole.Mouse.State(e.x/n.display.getScaleX(),e.y/n.display.getScaleY(),e.left,e.middle,e.right,e.up,e.down);n.guac_client.sendMouseState(r),n.keyboard.onkeydown=t,n.keyboard.onkeyup=i}function t(e){n.guac_client&&n.guac_client.sendKeyEvent(1,e)}function i(e){n.guac_client&&n.guac_client.sendKeyEvent(0,e)}var n=this;n.mouse=new Guacamole.Mouse(n.guac_client.getDisplay().getElement()),n.keyboard||(n.keyboard=new Guacamole.Keyboard(document)),n.mouse.onmousedown=function(t){n.clearfacus(),n.display.showCursor(!1),e(t)},n.mouse.onmouseup=n.mouse.onmousemove=function(t){n.clearfacus(),n.display.showCursor(!1),e(t)},n.mouse.onmouseout=function(e){n.display.showCursor(!1),n.keyboard.onkeydown=null,n.keyboard.onkeyup=null}},add_mouseEvent:function(){var e=this;e.mouse&&e.mouse.addEventListener()},remove_mouseEvent:function(){var e=this;e.mouse&&e.mouse.removeEventListener()},set_vm_scale:function(e){var i=this;if(e){var n=t(window).height();if(t(i.element).css({width:"100%"}),i.display&&i.guac_client){var r=i.display.getWidth(),a=i.display.getHeight();"RDP"==i.options.protocol?i.display.scaleXY(e/r,n/a):i.guac_client.sendSize(e,n)}}},clearfacus:function(){window.focus(),t("input").blur(),t("select").blur()},clear:function(){this.guac_client.disconnect(),this.element.empty()}};return t.extend(n.prototype,r),n}),define("modules/console/expdesktop/model/interact/controller",["app-utils","jquery"],function(e,t,i){function n(e,t){this.token=t.token,this.notebook="",this.element=e,this.options=t}var r={init:function(){var e=this,i=t(window).height(),n=t(window).width()-e.options.box_width;t(e.element).css({width:n,height:i});var r=SDC.slab_url+"lab-interact/live/"+e.options.lab_interact_id+"/notebooks/",a={lab_interact_id:e.options.lab_interact_id,lab_interact_code:e.options.lab_interact_code,token:SDC.user.auth_token,base_url:SDC.slab_url};return t("#interact-notebook").show().attr("src",r),t("#interact-notebook").load(function(){try{document.getElementById("interact-notebook").contentWindow.postMessage(JSON.stringify(a),r)}catch(e){}}),e},show:function(){t(this.element).show()},hide:function(){t(this.element).hide()},clear:function(){t(this.element).empty(),t(this.element).html('<iframe class="interact-notebook" id="interact-notebook" ></iframe>')},set_vm_scale:function(e){var i=this;if(e){var n=t(window).height();t(i.element).css({width:e,height:n})}}};return t.extend(n.prototype,r),n}),function(e){var t={init:function(i){return this.each(function(){t.destroy.call(this),this.opt=e.extend(!0,{},e.fn.raty.defaults,i);var n=e(this),r=["number","readOnly","score","scoreName"];t._callback.call(this,r),this.opt.precision&&t._adjustPrecision.call(this),this.opt.number=t._between(this.opt.number,0,this.opt.numberMax),this.opt.path=this.opt.path||"",this.opt.path&&"/"!==this.opt.path.slice(this.opt.path.length-1,this.opt.path.length)&&(this.opt.path+="/"),this.stars=t._createStars.call(this),this.score=t._createScore.call(this),t._apply.call(this,this.opt.score);var a=this.opt.space?4:0,o=this.opt.width||this.opt.number*this.opt.size+this.opt.number*a;this.opt.cancel&&(this.cancel=t._createCancel.call(this),o+=this.opt.size+a),this.opt.readOnly?t._lock.call(this):(n.css("cursor","pointer"),t._binds.call(this)),!1!==this.opt.width&&n.css("width",o),t._target.call(this,this.opt.score),n.data({settings:this.opt,raty:!0})})},_adjustPrecision:function(){this.opt.targetType="score",this.opt.half=!0},_apply:function(e){e&&e>0&&(e=t._between(e,0,this.opt.number),this.score.val(e)),t._fill.call(this,e),e&&t._roundStars.call(this,e)},_between:function(e,t,i){return Math.min(Math.max(parseFloat(e),t),i)},_binds:function(){this.cancel&&t._bindCancel.call(this),t._bindClick.call(this),t._bindOut.call(this),t._bindOver.call(this)},_bindCancel:function(){t._bindClickCancel.call(this),t._bindOutCancel.call(this),t._bindOverCancel.call(this)},_bindClick:function(){var t=this,i=e(t);t.stars.on("click.raty",function(e){t.score.val(t.opt.half||t.opt.precision?i.data("score"):this.alt),t.opt.click&&t.opt.click.call(t,parseFloat(t.score.val()),e)})},_bindClickCancel:function(){var e=this;e.cancel.on("click.raty",function(t){e.score.removeAttr("value"),e.opt.click&&e.opt.click.call(e,null,t)})},_bindOut:function(){var i=this;e(this).on("mouseleave.raty",function(e){var n=parseFloat(i.score.val())||void 0;t._apply.call(i,n),t._target.call(i,n,e),i.opt.mouseout&&i.opt.mouseout.call(i,n,e)})},_bindOutCancel:function(){var t=this;t.cancel.on("mouseleave.raty",function(i){e(this).attr("src",t.opt.path+t.opt.cancelOff),t.opt.mouseout&&t.opt.mouseout.call(t,t.score.val()||null,i)})},_bindOverCancel:function(){var i=this;i.cancel.on("mouseover.raty",function(n){e(this).attr("src",i.opt.path+i.opt.cancelOn),i.stars.attr("src",i.opt.path+i.opt.starOff),t._target.call(i,null,n),i.opt.mouseover&&i.opt.mouseover.call(i,null)})},_bindOver:function(){var i=this,n=e(i),r=i.opt.half?"mousemove.raty":"mouseover.raty";i.stars.on(r,function(r){var a=parseInt(this.alt,10);if(i.opt.half){var o=parseFloat((r.pageX-e(this).offset().left)/i.opt.size),s=o>.5?1:.5;a=a-1+s,t._fill.call(i,a),i.opt.precision&&(a=a-s+o),t._roundStars.call(i,a),n.data("score",a)}else t._fill.call(i,a);t._target.call(i,a,r),i.opt.mouseover&&i.opt.mouseover.call(i,a,r)})},_callback:function(e){for(i in e)"function"==typeof this.opt[e[i]]&&(this.opt[e[i]]=this.opt[e[i]].call(this))},_createCancel:function(){var t=e(this),i=this.opt.path+this.opt.cancelOff,n=e("<img />",{src:i,alt:"x",title:this.opt.cancelHint,class:"raty-cancel"});return"left"==this.opt.cancelPlace?t.prepend(" ").prepend(n):t.append(" ").append(n),n},_createScore:function(){return e("<input />",{type:"hidden",name:this.opt.scoreName}).appendTo(this)},_createStars:function(){for(var i=e(this),n=1;n<=this.opt.number;n++){var r=t._getHint.call(this,n),a=this.opt.score&&this.opt.score>=n?"starOn":"starOff";a=this.opt.path+this.opt[a],e("<img />",{src:a,alt:n,title:r}).appendTo(this),this.opt.space&&i.append(n<this.opt.number?" ":"")}return i.children("img")},_error:function(t){e(this).html(t),e.error(t)},_fill:function(e){for(var t=this,i=0,n=1;n<=t.stars.length;n++){var r=t.stars.eq(n-1),a=t.opt.single?n==e:n<=e;if(t.opt.iconRange&&t.opt.iconRange.length>i){var o=t.opt.iconRange[i],s=o.on||t.opt.starOn,l=o.off||t.opt.starOff,c=a?s:l;n<=o.range&&r.attr("src",t.opt.path+c),n==o.range&&i++}else{var c=a?"starOn":"starOff";r.attr("src",this.opt.path+this.opt[c])}}},_getHint:function(e){var t=this.opt.hints[e-1];return""===t?"":t||e},_lock:function(){var i=parseInt(this.score.val(),10),n=i?t._getHint.call(this,i):this.opt.noRatedMsg;e(this).data("readonly",!0).css("cursor","").attr("title",n),this.score.attr("readonly","readonly"),this.stars.attr("title",n),this.cancel&&this.cancel.hide()},_roundStars:function(e){var t=(e-Math.floor(e)).toFixed(2);if(t>this.opt.round.down){var i="starOn";this.opt.halfShow&&t<this.opt.round.up?i="starHalf":t<this.opt.round.full&&(i="starOff"),this.stars.eq(Math.ceil(e)-1).attr("src",this.opt.path+this.opt[i])}},_target:function(i,n){if(this.opt.target){var r=e(this.opt.target);0===r.length&&t._error.call(this,"Target selector invalid or missing!"),this.opt.targetFormat.indexOf("{score}")<0&&t._error.call(this,'Template "{score}" missing!');var a=n&&"mouseover"==n.type;void 0===i?i=this.opt.targetText:null===i?i=a?this.opt.cancelHint:this.opt.targetText:("hint"==this.opt.targetType?i=t._getHint.call(this,Math.ceil(i)):this.opt.precision&&(i=parseFloat(i).toFixed(1)),a||this.opt.targetKeep||(i=this.opt.targetText)),i&&(i=this.opt.targetFormat.toString().replace("{score}",i)),r.is(":input")?r.val(i):r.html(i)}},_unlock:function(){e(this).data("readonly",!1).css("cursor","pointer").removeAttr("title"),this.score.removeAttr("readonly","readonly");for(var i=0;i<this.opt.number;i++)this.stars.eq(i).attr("title",t._getHint.call(this,i+1));this.cancel&&this.cancel.css("display","")},cancel:function(i){return this.each(function(){!0!==e(this).data("readonly")&&(t[i?"click":"score"].call(this,null),this.score.removeAttr("value"))})},click:function(i){return e(this).each(function(){!0!==e(this).data("readonly")&&(t._apply.call(this,i),this.opt.click||t._error.call(this,'You must add the "click: function(score, evt) { }" callback.'),this.opt.click.call(this,i,{type:"click"}),t._target.call(this,i))})},destroy:function(){return e(this).each(function(){var t=e(this),i=t.data("raw");i?t.off(".raty").empty().css({cursor:i.style.cursor,width:i.style.width}).removeData("readonly"):t.data("raw",t.clone()[0])})},getScore:function(){var t,i=[];return e(this).each(function(){t=this.score.val(),i.push(t?parseFloat(t):void 0)}),i.length>1?i:i[0]},readOnly:function(i){return this.each(function(){var n=e(this);n.data("readonly")!==i&&(i?(n.off(".raty").children("img").off(".raty"),t._lock.call(this)):(t._binds.call(this),t._unlock.call(this)),n.data("readonly",i))})},reload:function(){return t.set.call(this,{})},score:function(){return arguments.length?t.setScore.apply(this,arguments):t.getScore.call(this)},set:function(t){return this.each(function(){var i=e(this),n=i.data("settings"),r=e.extend({},n,t);i.raty(r)})},setScore:function(i){return e(this).each(function(){!0!==e(this).data("readonly")&&(t._apply.call(this,i),t._target.call(this,i))})}};e.fn.raty=function(i){return t[i]?t[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?void e.error("Method "+i+" does not exist!"):t.init.apply(this,arguments)},e.fn.raty.defaults={cancel:!1,cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:void 0,half:!1,halfShow:!0,hints:["bad","poor","regular","good","gorgeous"],iconRange:void 0,mouseout:void 0,mouseover:void 0,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:"",precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:void 0,scoreName:"score",single:!1,size:16,space:!0,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",target:void 0,targetFormat:"{score}",targetKeep:!1,targetText:"",targetType:"hint",width:void 0}}(jQuery),define("jqueryray",["jquery"],function(){}),define("modules/console/expdesktop/model/comment/controller",["jquery","app-utils","jqueryray"],function(e,t,i){function n(e,t,i,n){this.container=t,this.data=i,this.service=n,this.step_id=e,i.$watch("course_evaluate.comment.value",function(e){i.course_evaluate.tip.value=i.course_evaluate.tip.title.replace(/\{\d\}/g,100-e.length)})}var r={init:function(){var e=this;e.get_comment_content(),e.data.course_evaluate.tip.value=e.data.course_evaluate.tip.title.replace(/\{\d\}/g,100),e.data.events.send_comment=function(){e.send_comment()}},getComment:function(e){var i=this,n={item_id:e,type:"step"};i.service.getCommentList(n).done(function(e){for(var n=0;n<e.comment_list.length;n++)e.comment_list[n].pic_path=t.getDomain(t.domain_type.user)+e.comment_list[n].pic_path;i.data.course_evaluate.comment_list=e.comment_list,t.paging(e.comment_list,i.data.page_id,function(e){i.data.course_evaluate.comment_list=e},6)}).fail(function(e){})},get_comment_content:function(){var e=this;e.data.course_evaluate.isCreate=e.data.course_evaluate.score,e.getComment(e.step_id),e.service.isCreateScore({item_id:e.step_id}).done(function(t){0===t.mark_list.length?e.container.find("#exp_course_score").raty({readOnly:e.data.course_evaluate.score,path:"/static/public/img/markstar",score:e.data.course_evaluate.score,hints:[1,2,3,4,5],click:function(t,i){if(e.data.course_evaluate.score=t,
|
||
!SDC.user.mobile)return void layer.tips(e.i18n.no_auth,"#exp_course_score");var n={item_id:e.step_id,type:"step",value:Number(e.data.course_evaluate.score)},r=layer.load(2,{shade:[.1,"#ffffff"]});if(e.data.ismark){n={value:Number(e.data.course_evaluate.score)};var a=e.data.markid;e.service.updateScore(a,n).done(function(t){layer.close(r),e.container.find("#exp_course_score").raty("set",{path:"/static/public/img/markstar",score:e.data.course_evaluate.score})}).fail(function(e){layer.close(r)})}else e.service.createScore(n).done(function(t){layer.close(r),e.data.ismark=!0,e.data.markid=t.id,e.container.find("#exp_course_score").raty("set",{path:"/static/public/img/markstar",score:e.data.course_evaluate.score})}).fail(function(e){layer.close(r)})}}):e.container.find("#exp_course_score").raty({readOnly:e.data.course_evaluate.score,path:"/static/public/img/markstar",score:t.mark_list[0].value,hints:[1,2,3,4,5],click:function(i,n){if(e.data.course_evaluate.score=i,!SDC.user.mobile)return void layer.tips(e.i18n.no_auth,"#exp_course_score");var r={value:Number(e.data.course_evaluate.score)},a=layer.load(2,{shade:[.1,"#ffffff"]}),o=t.mark_list[0].id;e.service.updateScore(o,r).done(function(t){layer.close(a),e.container.find("#exp_course_score").raty("set",{path:"/static/public/img/markstar",score:e.data.course_evaluate.score})}).fail(function(e){layer.close(a)})}})}).fail(function(e){})},send_comment:function(){var t=this;if(!SDC.user.mobile)return void layer.tips(t.i18n.no_auth,"#exp_course_score");var i={item_id:t.step_id,type:"step",content:t.data.course_evaluate.comment.value};if(!e.trim(t.data.course_evaluate.comment.value))return void layer.tips("请输入评论内容","#comment");var n=layer.load(2,{shade:[.1,"#ffffff"]});t.service.createComment(i).done(function(e){t.container.find("#comment").val(""),layer.close(n),t.getComment(t.step_id)}).fail(function(e){layer.close(n)})}};return e.extend(n.prototype,r),n}),function(){function e(e){this.tokens=[],this.tokens.links={},this.options=e||c.defaults,this.rules=u.normal,this.options.gfm&&(this.options.tables?this.rules=u.tables:this.rules=u.gfm)}function t(e,t){if(this.options=t||c.defaults,this.links=e,this.rules=d.normal,this.renderer=this.options.renderer||new i,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=d.breaks:this.rules=d.gfm:this.options.pedantic&&(this.rules=d.pedantic)}function i(e){this.options=e||{}}function n(e){this.tokens=[],this.token=null,this.options=e||c.defaults,this.options.renderer=this.options.renderer||new i,this.renderer=this.options.renderer,this.renderer.options=this.options}function r(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function o(e,t){return e=e.source,t=t||"",function i(n,r){return n?(r=r.source||r,r=r.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(n,r),i):new RegExp(e,t)}}function s(){}function l(e){for(var t,i,n=1;n<arguments.length;n++){t=arguments[n];for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}function c(t,i,a){if(a||"function"==typeof i){a||(a=i,i=null),i=l({},c.defaults,i||{});var o,s,u=i.highlight,d=0;try{o=e.lex(t,i)}catch(e){return a(e)}s=o.length;var h=function(e){if(e)return i.highlight=u,a(e);var t;try{t=n.parse(o,i)}catch(t){e=t}return i.highlight=u,e?a(e):a(null,t)};if(!u||u.length<3)return h();if(delete i.highlight,!s)return h();for(;d<o.length;d++)!function(e){"code"!==e.type?--s||h():u(e.text,e.lang,function(t,i){return t?h(t):null==i||i===e.text?--s||h():(e.text=i,e.escaped=!0,void(--s||h()))})}(o[d])}else try{return i&&(i=l({},c.defaults,i)),n.parse(e.lex(t,i),i)}catch(e){if(e.message+="\nPlease report this to https://github.com/chjj/marked.",(i||c.defaults).silent)return"<p>An error occured:</p><pre>"+r(e.message+"",!0)+"</pre>";throw e}}var u={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:s,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:s,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:s,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};u.bullet=/(?:[*+-]|\d+\.)/,u.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,u.item=o(u.item,"gm")(/bull/g,u.bullet)(),u.list=o(u.list)(/bull/g,u.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+u.def.source+")")(),u.blockquote=o(u.blockquote)("def",u.def)(),u._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",u.html=o(u.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,u._tag)(),u.paragraph=o(u.paragraph)("hr",u.hr)("heading",u.heading)("lheading",u.lheading)("blockquote",u.blockquote)("tag","<"+u._tag)("def",u.def)(),u.normal=l({},u),u.gfm=l({},u.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),u.gfm.paragraph=o(u.paragraph)("(?!","(?!"+u.gfm.fences.source.replace("\\1","\\2")+"|"+u.list.source.replace("\\1","\\3")+"|")(),u.tables=l({},u.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),e.rules=u,e.lex=function(t,i){return new e(i).lex(t)},e.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},e.prototype.token=function(e,t,i){for(var n,r,a,o,s,l,c,d,h,e=e.replace(/^ +$/gm,"");e;)if((a=this.rules.newline.exec(e))&&(e=e.substring(a[0].length),a[0].length>1&&this.tokens.push({type:"space"})),a=this.rules.code.exec(e))e=e.substring(a[0].length),a=a[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?a:a.replace(/\n+$/,"")});else if(a=this.rules.fences.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"code",lang:a[2],text:a[3]});else if(a=this.rules.heading.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"heading",depth:a[1].length,text:a[2]});else if(t&&(a=this.rules.nptable.exec(e))){for(e=e.substring(a[0].length),l={type:"table",header:a[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3].replace(/\n$/,"").split("\n")},d=0;d<l.align.length;d++)/^ *-+: *$/.test(l.align[d])?l.align[d]="right":/^ *:-+: *$/.test(l.align[d])?l.align[d]="center":/^ *:-+ *$/.test(l.align[d])?l.align[d]="left":l.align[d]=null;for(d=0;d<l.cells.length;d++)l.cells[d]=l.cells[d].split(/ *\| */);this.tokens.push(l)}else if(a=this.rules.lheading.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"heading",depth:"="===a[2]?1:2,text:a[1]});else if(a=this.rules.hr.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"hr"});else if(a=this.rules.blockquote.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"blockquote_start"}),a=a[0].replace(/^ *> ?/gm,""),this.token(a,t,!0),this.tokens.push({type:"blockquote_end"});else if(a=this.rules.list.exec(e)){for(e=e.substring(a[0].length),o=a[2],this.tokens.push({type:"list_start",ordered:o.length>1}),a=a[0].match(this.rules.item),n=!1,h=a.length,d=0;d<h;d++)l=a[d],c=l.length,l=l.replace(/^ *([*+-]|\d+\.) +/,""),~l.indexOf("\n ")&&(c-=l.length,l=this.options.pedantic?l.replace(/^ {1,4}/gm,""):l.replace(new RegExp("^ {1,"+c+"}","gm"),"")),this.options.smartLists&&d!==h-1&&(s=u.bullet.exec(a[d+1])[0],o===s||o.length>1&&s.length>1||(e=a.slice(d+1).join("\n")+e,d=h-1)),r=n||/\n\n(?!\s*$)/.test(l),d!==h-1&&(n="\n"===l.charAt(l.length-1),r||(r=n)),this.tokens.push({type:r?"loose_item_start":"list_item_start"}),this.token(l,!1,i),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(a=this.rules.html.exec(e))e=e.substring(a[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===a[1]||"script"===a[1]||"style"===a[1],text:a[0]});else if(!i&&t&&(a=this.rules.def.exec(e)))e=e.substring(a[0].length),this.tokens.links[a[1].toLowerCase()]={href:a[2],title:a[3]};else if(t&&(a=this.rules.table.exec(e))){for(e=e.substring(a[0].length),l={type:"table",header:a[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:a[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:a[3].replace(/(?: *\| *)?\n$/,"").split("\n")},d=0;d<l.align.length;d++)/^ *-+: *$/.test(l.align[d])?l.align[d]="right":/^ *:-+: *$/.test(l.align[d])?l.align[d]="center":/^ *:-+ *$/.test(l.align[d])?l.align[d]="left":l.align[d]=null;for(d=0;d<l.cells.length;d++)l.cells[d]=l.cells[d].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(l)}else if(t&&(a=this.rules.paragraph.exec(e)))e=e.substring(a[0].length),this.tokens.push({type:"paragraph",text:"\n"===a[1].charAt(a[1].length-1)?a[1].slice(0,-1):a[1]});else if(a=this.rules.text.exec(e))e=e.substring(a[0].length),this.tokens.push({type:"text",text:a[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var d={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:s,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:s,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/};d._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,d._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/,d.link=o(d.link)("inside",d._inside)("href",d._href)(),d.reflink=o(d.reflink)("inside",d._inside)(),d.normal=l({},d),d.pedantic=l({},d.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),d.gfm=l({},d.normal,{escape:o(d.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:o(d.text)("]|","~]|")("|","|https?://|")()}),d.breaks=l({},d.gfm,{br:o(d.br)("{2,}","*")(),text:o(d.gfm.text)("{2,}","*")()}),t.rules=d,t.output=function(e,i,n){return new t(i,n).output(e)},t.prototype.output=function(e){for(var t,i,n,a,o="";e;)if(a=this.rules.escape.exec(e))e=e.substring(a[0].length),o+=a[1];else if(a=this.rules.autolink.exec(e))e=e.substring(a[0].length),"@"===a[2]?(i=":"===a[1].charAt(6)?this.mangle(a[1].substring(7)):this.mangle(a[1]),n=this.mangle("mailto:")+i):(i=r(a[1]),n=i),o+=this.renderer.link(n,null,i);else if(this.inLink||!(a=this.rules.url.exec(e))){if(a=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(a[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(a[0])&&(this.inLink=!1),e=e.substring(a[0].length),o+=this.options.sanitize?r(a[0]):a[0];else if(a=this.rules.link.exec(e))e=e.substring(a[0].length),this.inLink=!0,o+=this.outputLink(a,{href:a[2],title:a[3]}),this.inLink=!1;else if((a=this.rules.reflink.exec(e))||(a=this.rules.nolink.exec(e))){if(e=e.substring(a[0].length),t=(a[2]||a[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){o+=a[0].charAt(0),e=a[0].substring(1)+e;continue}this.inLink=!0,o+=this.outputLink(a,t),this.inLink=!1}else if(a=this.rules.strong.exec(e))e=e.substring(a[0].length),o+=this.renderer.strong(this.output(a[2]||a[1]));else if(a=this.rules.em.exec(e))e=e.substring(a[0].length),o+=this.renderer.em(this.output(a[2]||a[1]));else if(a=this.rules.code.exec(e))e=e.substring(a[0].length),o+=this.renderer.codespan(r(a[2],!0));else if(a=this.rules.br.exec(e))e=e.substring(a[0].length),o+=this.renderer.br();else if(a=this.rules.del.exec(e))e=e.substring(a[0].length),o+=this.renderer.del(this.output(a[1]));else if(a=this.rules.text.exec(e))e=e.substring(a[0].length),o+=r(this.smartypants(a[0]));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(a[0].length),i=r(a[1]),n=i,o+=this.renderer.link(n,null,i);return o},t.prototype.outputLink=function(e,t){var i=r(t.href),n=t.title?r(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(i,n,this.output(e[1])):this.renderer.image(i,n,r(e[1]))},t.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},t.prototype.mangle=function(e){for(var t,i="",n=e.length,r=0;r<n;r++)t=e.charCodeAt(r),Math.random()>.5&&(t="x"+t.toString(16)),i+="&#"+t+";";return i},i.prototype.code=function(e,t,i){if(this.options.highlight){var n=this.options.highlight(e,t);null!=n&&n!==e&&(i=!0,e=n)}return t?'<pre><code class="'+this.options.langPrefix+r(t,!0)+'">'+(i?e:r(e,!0))+"\n</code></pre>\n":"<pre><code>"+(i?e:r(e,!0))+"\n</code></pre>"},i.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},i.prototype.html=function(e){return e},i.prototype.heading=function(e,t,i){return"<h"+t+' id="'+this.options.headerPrefix+i.toLowerCase().replace(/[^\w]+/g,"-")+'">'+e+"</h"+t+">\n"},i.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},i.prototype.list=function(e,t){var i=t?"ol":"ul";return"<"+i+">\n"+e+"</"+i+">\n"},i.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},i.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},i.prototype.table=function(e,t){return"<table>\n<thead>\n"+e+"</thead>\n<tbody>\n"+t+"</tbody>\n</table>\n"},i.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},i.prototype.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">")+e+"</"+i+">\n"},i.prototype.strong=function(e){return"<strong>"+e+"</strong>"},i.prototype.em=function(e){return"<em>"+e+"</em>"},i.prototype.codespan=function(e){return"<code>"+e+"</code>"},i.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},i.prototype.del=function(e){return"<del>"+e+"</del>"},i.prototype.link=function(e,t,i){if(this.options.sanitize){try{var n=decodeURIComponent(a(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:"))return""}var r='<a href="'+e+'"';return t&&(r+=' title="'+t+'"'),r+=">"+i+"</a>"},i.prototype.image=function(e,t,i){var n=/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;!new RegExp(n).test(e)&&this.options.image_Remote_URL&&(e=this.options.image_Remote_URL+e);var r='<img src="'+e+'" alt="'+i+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},n.parse=function(e,t,i){return new n(t,i).parse(e)},n.prototype.parse=function(e){this.inline=new t(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var i="";this.next();)i+=this.tok();return i},n.prototype.next=function(){return this.token=this.tokens.pop()},n.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},n.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},n.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,i,n,r="",a="";for(i="",e=0;e<this.token.header.length;e++)({header:!0,align:this.token.align[e]}),i+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(r+=this.renderer.tablerow(i),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],i="",n=0;n<t.length;n++)i+=this.renderer.tablecell(this.inline.output(t[n]),{header:!1,align:this.token.align[n]});a+=this.renderer.tablerow(i)}return this.renderer.table(r,a);case"blockquote_start":for(var a="";"blockquote_end"!==this.next().type;)a+=this.tok();return this.renderer.blockquote(a);case"list_start":for(var a="",o=this.token.ordered;"list_end"!==this.next().type;)a+=this.tok();return this.renderer.list(a,o);case"list_item_start":for(var a="";"list_item_end"!==this.next().type;)a+="text"===this.token.type?this.parseText():this.tok();return this.renderer.listitem(a);case"loose_item_start":for(var a="";"list_item_end"!==this.next().type;)a+=this.tok();return this.renderer.listitem(a);case"html":var s=this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);return this.renderer.html(s);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},s.exec=s,c.options=c.setOptions=function(e){return l(c.defaults,e),c},c.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1,headerPrefix:"",renderer:new i,xhtml:!1},c.Parser=n,c.parser=n.parse,c.Renderer=i,c.Lexer=e,c.lexer=e.lex,c.InlineLexer=t,c.inlineLexer=t.output,c.parse=c,"undefined"!=typeof module&&"object"==typeof exports?module.exports=c:"function"==typeof define&&define.amd?define("marked",[],function(){return c}):this.marked=c}.call(function(){return this||("undefined"!=typeof window?window:global)}());var DecorationsT,JobT,SourceSpansT,IN_GLOBAL_SCOPE=!0,PR,PR_SHOULD_USE_CONTINUATION=!0;"undefined"!=typeof window&&(window.PR_SHOULD_USE_CONTINUATION=PR_SHOULD_USE_CONTINUATION);var prettyPrintOne,prettyPrint;!function(){function e(e){function t(e){var t=e.charCodeAt(0);if(92!==t)return t;var i=e.charAt(1);return(t=u[i])||("0"<=i&&i<="7"?parseInt(e.substring(1),8):"u"===i||"x"===i?parseInt(e.substring(2),16):e.charCodeAt(1))}function i(e){if(e<32)return(e<16?"\\x0":"\\x")+e.toString(16);var t=String.fromCharCode(e);return"\\"===t||"-"===t||"]"===t||"^"===t?"\\"+t:t}function n(e){var n=e.substring(1,e.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),r=[],a="^"===n[0],o=["["];a&&o.push("^");for(var s=a?1:0,l=n.length;s<l;++s){var c=n[s];if(/\\[bdsw]/i.test(c))o.push(c);else{var u,d=t(c);s+2<l&&"-"===n[s+1]?(u=t(n[s+2]),s+=2):u=d,r.push([d,u]),u<65||d>122||(u<65||d>90||r.push([32|Math.max(65,d),32|Math.min(u,90)]),u<97||d>122||r.push([-33&Math.max(97,d),-33&Math.min(u,122)]))}}r.sort(function(e,t){return e[0]-t[0]||t[1]-e[1]});for(var h=[],p=[],s=0;s<r.length;++s){var f=r[s];f[0]<=p[1]+1?p[1]=Math.max(p[1],f[1]):h.push(p=f)}for(var s=0;s<h.length;++s){var f=h[s];o.push(i(f[0])),f[1]>f[0]&&(f[1]+1>f[0]&&o.push("-"),o.push(i(f[1])))}return o.push("]"),o.join("")}for(var r=0,a=!1,o=!1,s=0,l=e.length;s<l;++s){var c=e[s];if(c.ignoreCase)o=!0;else if(/[a-z]/i.test(c.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){a=!0,o=!1;break}}for(var u={b:8,t:9,n:10,v:11,f:12,r:13},d=[],s=0,l=e.length;s<l;++s){var c=e[s];if(c.global||c.multiline)throw new Error(""+c);d.push("(?:"+function(e){for(var t=e.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),o=t.length,s=[],l=0,c=0;l<o;++l){var u=t[l];if("("===u)++c;else if("\\"===u.charAt(0)){var d=+u.substring(1);d&&(d<=c?s[d]=-1:t[l]=i(d))}}for(var l=1;l<s.length;++l)-1===s[l]&&(s[l]=++r);for(var l=0,c=0;l<o;++l){var u=t[l];if("("===u)++c,s[c]||(t[l]="(?:");else if("\\"===u.charAt(0)){var d=+u.substring(1);d&&d<=c&&(t[l]="\\"+s[d])}}for(var l=0;l<o;++l)"^"===t[l]&&"^"!==t[l+1]&&(t[l]="");if(e.ignoreCase&&a)for(var l=0;l<o;++l){var u=t[l],h=u.charAt(0);u.length>=2&&"["===h?t[l]=n(u):"\\"!==h&&(t[l]=u.replace(/[a-zA-Z]/g,function(e){var t=e.charCodeAt(0);return"["+String.fromCharCode(-33&t,32|t)+"]"}))}return t.join("")}(c)+")")}return new RegExp(d.join("|"),o?"gi":"g")}function t(e,t){function i(e){var l=e.nodeType;if(1==l){if(n.test(e.className))return;for(var c=e.firstChild;c;c=c.nextSibling)i(c);var u=e.nodeName.toLowerCase();"br"!==u&&"li"!==u||(r[s]="\n",o[s<<1]=a++,o[s++<<1|1]=e)}else if(3==l||4==l){var d=e.nodeValue;d.length&&(d=t?d.replace(/\r\n?/g,"\n"):d.replace(/[ \t\r\n]+/g," "),r[s]=d,o[s<<1]=a,a+=d.length,o[s++<<1|1]=e)}}var n=/(?:^|\s)nocode(?:\s|$)/,r=[],a=0,o=[],s=0;return i(e),{sourceCode:r.join("").replace(/\n$/,""),spans:o}}function i(e,t,i,n,r){if(i){var a={sourceNode:e,pre:1,langExtension:null,numberLines:null,sourceCode:i,spans:null,basePos:t,decorations:null};n(a),r.push.apply(r,a.decorations)}}function n(e){for(var t=void 0,i=e.firstChild;i;i=i.nextSibling){var n=i.nodeType;t=1===n?t?e:i:3===n&&R.test(i.nodeValue)?e:t}return t===e?void 0:t}function r(t,n){var r,a={};!function(){for(var i=t.concat(n),o=[],s={},l=0,c=i.length;l<c;++l){var u=i[l],d=u[3];if(d)for(var h=d.length;--h>=0;)a[d.charAt(h)]=u;var p=u[1],f=""+p;s.hasOwnProperty(f)||(o.push(p),s[f]=null)}o.push(/[\0-\uffff]/),r=e(o)}();var o=n.length,s=function(e){for(var t=e.sourceCode,l=e.basePos,u=e.sourceNode,d=[l,O],h=0,p=t.match(r)||[],f={},m=0,g=p.length;m<g;++m){var v,y=p[m],_=f[y],b=void 0;if("string"==typeof _)v=!1;else{var w=a[y.charAt(0)];if(w)b=y.match(w[1]),_=w[0];else{for(var x=0;x<o;++x)if(w=n[x],b=y.match(w[1])){_=w[0];break}b||(_=O)}v=_.length>=5&&"lang-"===_.substring(0,5),!v||b&&"string"==typeof b[1]||(v=!1,_=N),v||(f[y]=_)}var k=h;if(h+=y.length,v){var C=b[1],T=y.indexOf(C),S=T+C.length;b[2]&&(S=y.length-b[2].length,T=S-C.length);var E=_.substring(5);i(u,l+k,y.substring(0,T),s,d),i(u,l+k+T,C,c(E,C),d),i(u,l+k+S,y.substring(S),s,d)}else d.push(l+k,_)}e.decorations=d};return s}function a(e){var t=[],i=[];e.tripleQuotedStrings?t.push([E,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):e.multiLineStrings?t.push([E,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):t.push([E,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),e.verbatimStrings&&i.push([E,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var n=e.hashComments;n&&(e.cStyleComments?(n>1?t.push([I,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):t.push([I,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),i.push([E,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):t.push([I,/^#[^\r\n]*/,null,"#"])),e.cStyleComments&&(i.push([I,/^\/\/[^\r\n]*/,null]),i.push([I,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var a=e.regexLiterals;if(a){var o=a>1?"":"\n\r",s=o?".":"[\\S\\s]",l="/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+s+")*(?:\\x5D|$))+/";i.push(["lang-regex",RegExp("^"+P+"("+l+")")])}var c=e.types;c&&i.push([D,c]);var u=(""+e.keywords).replace(/^ | $/g,"");u.length&&i.push([A,new RegExp("^(?:"+u.replace(/[\s,]+/g,"|")+")\\b"),null]),t.push([O,/^\s+/,null," \r\n\t "]);var d="^.[^\\s\\w.$@'\"`/\\\\]*";return e.regexLiterals&&(d+="(?!s*/)"),i.push([M,/^@[a-z_$][a-z_$@0-9]*/i,null],[D,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[O,/^[a-z_$][a-z_$@0-9]*/i,null],[M,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[O,/^\\[\s\S]?/,null],[L,new RegExp(d),null]),r(t,i)}function o(e,t,i){function n(e){var t=e.nodeType;if(1!=t||a.test(e.className)){if((3==t||4==t)&&i){var l=e.nodeValue,c=l.match(o);if(c){var u=l.substring(0,c.index);e.nodeValue=u;var d=l.substring(c.index+c[0].length);if(d){var h=e.parentNode;h.insertBefore(s.createTextNode(d),e.nextSibling)}r(e),u||e.parentNode.removeChild(e)}}}else if("br"===e.nodeName.toLowerCase())r(e),e.parentNode&&e.parentNode.removeChild(e);else for(var p=e.firstChild;p;p=p.nextSibling)n(p)}function r(e){function t(e,i){var n=i?e.cloneNode(!1):e,r=e.parentNode;if(r){var a=t(r,1),o=e.nextSibling;a.appendChild(n);for(var s=o;s;s=o)o=s.nextSibling,a.appendChild(s)}return n}for(;!e.nextSibling;)if(!(e=e.parentNode))return;for(var i,n=t(e.nextSibling,0);(i=n.parentNode)&&1===i.nodeType;)n=i;c.push(n)}for(var a=/(?:^|\s)nocode(?:\s|$)/,o=/\r\n?|\n/,s=e.ownerDocument,l=s.createElement("li");e.firstChild;)l.appendChild(e.firstChild);for(var c=[l],u=0;u<c.length;++u)n(c[u]);t===(0|t)&&c[0].setAttribute("value",t);var d=s.createElement("ol");d.className="linenums";for(var h=Math.max(0,t-1|0)||0,u=0,p=c.length;u<p;++u)l=c[u],l.className="L"+(u+h)%10,l.firstChild||l.appendChild(s.createTextNode(" ")),d.appendChild(l);e.appendChild(d)}function s(e){var t=/\bMSIE\s(\d+)/.exec(navigator.userAgent);t=t&&+t[1]<=8;var i=/\n/g,n=e.sourceCode,r=n.length,a=0,o=e.spans,s=o.length,l=0,c=e.decorations,u=c.length,d=0;c[u]=r;var h,p;for(p=h=0;p<u;)c[p]!==c[p+2]?(c[h++]=c[p++],c[h++]=c[p++]):p+=2;for(u=h,p=h=0;p<u;){for(var f=c[p],m=c[p+1],g=p+2;g+2<=u&&c[g+1]===m;)g+=2;c[h++]=f,c[h++]=m,p=g}u=c.length=h;var v=e.sourceNode,y="";v&&(y=v.style.display,v.style.display="none");try{for(;l<s;){var _,b=(o[l],o[l+2]||r),w=c[d+2]||r,g=Math.min(b,w),x=o[l+1];if(1!==x.nodeType&&(_=n.substring(a,g))){t&&(_=_.replace(i,"\r")),x.nodeValue=_;var k=x.ownerDocument,C=k.createElement("span");C.className=c[d+1];var T=x.parentNode;T.replaceChild(C,x),C.appendChild(x),a<b&&(o[l+1]=x=k.createTextNode(n.substring(g,b)),T.insertBefore(x,C.nextSibling))}a=g,a>=b&&(l+=2),a>=w&&(d+=2)}}finally{v&&(v.style.display=y)}}function l(e,t){for(var i=t.length;--i>=0;){var n=t[i];z.hasOwnProperty(n)?p.console&&console.warn("cannot override language handler %s",n):z[n]=e}}function c(e,t){return e&&z.hasOwnProperty(e)||(e=/^\s*</.test(t)?"default-markup":"default-code"),z[e]}function u(e){var i=e.langExtension;try{var n=t(e.sourceNode,e.pre),r=n.sourceCode;e.sourceCode=r,e.spans=n.spans,e.basePos=0,c(i,r)(e),s(e)}catch(e){p.console&&console.log(e&&e.stack||e)}}function d(e,t,i){var n=i||!1,r=t||null,a=document.createElement("div");return a.innerHTML="<pre>"+e+"</pre>",a=a.firstChild,n&&o(a,n,!0),u({langExtension:r,numberLines:n,sourceNode:a,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),a.innerHTML}function h(e,t){function i(e){return a.getElementsByTagName(e)}function r(){for(var t=p.PR_SHOULD_USE_CONTINUATION?m.now()+250:1/0;g<c.length&&m.now()<t;g++){for(var i=c[g],a=k,l=i;l=l.previousSibling;){var d=l.nodeType,h=(7===d||8===d)&&l.nodeValue;if(h?!/^\??prettify\b/.test(h):3!==d||/\S/.test(l.nodeValue))break;if(h){a={},h.replace(/\b(\w+)=([\w:.%+-]+)/g,function(e,t,i){a[t]=i});break}}var f=i.className;if((a!==k||y.test(f))&&!_.test(f)){for(var C=!1,T=i.parentNode;T;T=T.parentNode){var S=T.tagName;if(x.test(S)&&T.className&&y.test(T.className)){C=!0;break}}if(!C){i.className+=" prettyprinted";var E=a.lang;if(!E){E=f.match(v);var A;!E&&(A=n(i))&&w.test(A.tagName)&&(E=A.className.match(v)),E&&(E=E[1])}var I;if(b.test(i.tagName))I=1;else{var D=i.currentStyle,M=s.defaultView,L=D?D.whiteSpace:M&&M.getComputedStyle?M.getComputedStyle(i,null).getPropertyValue("white-space"):0;I=L&&"pre"===L.substring(0,3)}var O=a.linenums;(O="true"===O||+O)||(O=f.match(/\blinenums\b(?::(\d+))?/),O=!!O&&(!O[1]||!O[1].length||+O[1])),O&&o(i,O,I);u({langExtension:E,sourceNode:i,numberLines:O,pre:I,sourceCode:null,basePos:null,spans:null,decorations:null})}}}g<c.length?p.setTimeout(r,250):"function"==typeof e&&e()}for(var a=t||document.body,s=a.ownerDocument||document,l=[i("pre"),i("code"),i("xmp")],c=[],d=0;d<l.length;++d)for(var h=0,f=l[d].length;h<f;++h)c.push(l[d][h]);l=null;var m=Date;m.now||(m={now:function(){return+new Date}});var g=0,v=/\blang(?:uage)?-([\w.]+)(?!\S)/,y=/\bprettyprint\b/,_=/\bprettyprinted\b/,b=/pre|xmp/i,w=/^code$/i,x=/^(?:pre|code|xmp)$/i,k={};r()}var p="undefined"!=typeof window?window:{},f=["break,continue,do,else,for,if,return,while"],m=[f,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[m,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],y=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],_=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],b=[g,"abstract,async,await,constructor,debugger,enum,eval,export,from,function,get,import,implements,instanceof,interface,let,null,of,set,undefined,var,with,yield,Infinity,NaN"],w="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",x=[f,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],k=[f,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],C=[f,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],T=[v,_,y,b,w,x,k,C],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,E="str",A="kwd",I="com",D="typ",M="lit",L="pun",O="pln",N="src",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*",R=/\S/,j=a({keywords:T,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),z={};l(j,["default-code"]),l(r([],[[O,/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],[I,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),l(r([[O,/^[\s]+/,null," \t\r\n"],["atv",/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),l(r([],[["atv",/^[\s\S]+/]]),["uq.val"]),l(a({keywords:v,hashComments:!0,cStyleComments:!0,types:S}),["c","cc","cpp","cxx","cyc","m"]),l(a({keywords:"null,true,false"}),["json"]),l(a({
|
||
keywords:_,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]),l(a({keywords:y,cStyleComments:!0}),["java"]),l(a({keywords:C,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),l(a({keywords:x,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),l(a({keywords:w,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),l(a({keywords:k,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),l(a({keywords:b,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),l(a({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),l(r([],[[E,/^[\s\S]+/]]),["regex"]);var F=p.PR={createSimpleLexer:r,registerLangHandler:l,sourceDecorator:a,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:I,PR_DECLARATION:"dec",PR_KEYWORD:A,PR_LITERAL:M,PR_NOCODE:"nocode",PR_PLAIN:O,PR_PUNCTUATION:L,PR_SOURCE:N,PR_STRING:E,PR_TAG:"tag",PR_TYPE:D,prettyPrintOne:IN_GLOBAL_SCOPE?p.prettyPrintOne=d:prettyPrintOne=d,prettyPrint:IN_GLOBAL_SCOPE?p.prettyPrint=h:prettyPrint=h},B=p.define;"function"==typeof B&&B.amd&&B("google-code-prettify",[],function(){return F})}(),define("prettify",function(){}),function(e){if("function"==typeof bootstrap)bootstrap("katex",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define("katex",e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeKatex=e}else"undefined"!=typeof window?window.katex=e():global.katex=e()}(function(){return function e(t,i,n){function r(o,s){if(!i[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);throw new Error("Cannot find module '"+o+"'")}var c=i[o]={exports:{}};t[o][0].call(c.exports,function(e){var i=t[o][1][e];return r(i||e)},c,c.exports,e,t,i,n)}return i[o].exports}for(var a="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(e,t,i){var n=e("./src/ParseError"),r=e("./src/buildTree"),a=e("./src/parseTree"),o=e("./src/utils"),s=function(e,t){o.clearNode(t);var i=a(e),n=r(i).toNode();t.appendChild(n)};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),s=function(){throw new n("KaTeX doesn't work in quirks mode.")});var l=function(e){var t=a(e);return r(t).toMarkup()};t.exports={render:s,renderToString:l,ParseError:n}},{"./src/ParseError":4,"./src/buildTree":8,"./src/parseTree":13,"./src/utils":15}],2:[function(e,t,i){function n(e){this._input=e}function r(e,t,i){this.text=e,this.data=t,this.position=i}var a=e("./ParseError"),o=[/^[/|@.""`0-9a-zA-Z]/,/^[*+-]/,/^[=<>:]/,/^[,;]/,/^['\^_{}]/,/^[(\[]/,/^[)\]?!]/,/^~/],s=[/^[a-zA-Z0-9`!@*()-=+\[\]'";:?\/.,]/,/^[{}]/,/^~/],l=/^\s*/,c=/^( +|\\ +)/,u=/^\\(?:[a-zA-Z]+|.)/;n.prototype._innerLex=function(e,t,i){var n,o=this._input.slice(e);if(i)n=o.match(l)[0],e+=n.length,o=o.slice(n.length);else if(null!==(n=o.match(c)))return new r(" ",null,e+n[0].length);if(0===o.length)return new r("EOF",null,e);var s;if(s=o.match(u))return new r(s[0],null,e+s[0].length);for(var d=0;d<t.length;d++){var h=t[d];if(s=o.match(h))return new r(s[0],null,e+s[0].length)}throw new a("Unexpected character: '"+o[0]+"'",this,e)};var d=/^(#[a-z0-9]+|[a-z]+)/i;n.prototype._innerLexColor=function(e){var t=this._input.slice(e),i=t.match(l)[0];e+=i.length,t=t.slice(i.length);var n;if(n=t.match(d))return new r(n[0],null,e+n[0].length);throw new a("Invalid color",this,e)};var h=/^(-?)\s*(\d+(?:\.\d*)?|\.\d+)\s*([a-z]{2})/;n.prototype._innerLexSize=function(e){var t=this._input.slice(e),i=t.match(l)[0];e+=i.length,t=t.slice(i.length);var n;if(n=t.match(h)){var o=n[3];if("em"!==o&&"ex"!==o)throw new a("Invalid unit: '"+o+"'",this,e);return new r(n[0],{number:+(n[1]+n[2]),unit:o},e+n[0].length)}throw new a("Invalid size",this,e)},n.prototype._innerLexWhitespace=function(e){var t=this._input.slice(e),i=t.match(l)[0];return e+=i.length,new r(i,null,e)},n.prototype.lex=function(e,t){return"math"===t?this._innerLex(e,o,!0):"text"===t?this._innerLex(e,s,!1):"color"===t?this._innerLexColor(e):"size"===t?this._innerLexSize(e):"whitespace"===t?this._innerLexWhitespace(e):void 0},t.exports=n},{"./ParseError":4}],3:[function(e,t,i){function n(e,t,i,n,r){this.style=e,this.color=i,this.size=t,void 0===n&&(n=e),this.parentStyle=n,void 0===r&&(r=t),this.parentSize=r}n.prototype.withStyle=function(e){return new n(e,this.size,this.color,this.style,this.size)},n.prototype.withSize=function(e){return new n(this.style,e,this.color,this.style,this.size)},n.prototype.withColor=function(e){return new n(this.style,this.size,e,this.style,this.size)},n.prototype.reset=function(){return new n(this.style,this.size,this.color,this.style,this.size)};var r={"katex-blue":"#6495ed","katex-orange":"#ffa500","katex-pink":"#ff00af","katex-red":"#df0030","katex-green":"#28ae7b","katex-gray":"gray","katex-purple":"#9d38bd"};n.prototype.getColor=function(){return r[this.color]||this.color},t.exports=n},{}],4:[function(e,t,i){function n(e,t,i){var r="KaTeX parse error: "+e;if(void 0!==t&&void 0!==i){r+=" at position "+i+": ";var a=t._input;a=a.slice(0,i)+"̲"+a.slice(i);var o=Math.max(0,i-15),s=i+15;r+=a.slice(o,s)}var l=new Error(r);return l.name="ParseError",l.__proto__=n.prototype,l.position=i,l}n.prototype.__proto__=Error.prototype,t.exports=n},{}],5:[function(e,t,i){function n(e){this.lexer=new l(e)}function r(e,t,i){this.type=e,this.value=t,this.mode=i}function a(e,t){this.result=e,this.position=t}function o(e,t,i,n,r,a){this.result=e,this.isFunction=t,this.allowedInText=i,this.numArgs=n,this.numOptionalArgs=r,this.argTypes=a}var s=e("./functions"),l=e("./Lexer"),c=e("./symbols"),u=e("./utils"),d=e("./ParseError");n.prototype.expect=function(e,t){if(e.text!==t)throw new d("Expected '"+t+"', got '"+e.text+"'",this.lexer,e.position)},n.prototype.parse=function(e){return this.parseInput(0,"math").result},n.prototype.parseInput=function(e,t){var i=this.parseExpression(e,t,!1,null),n=this.lexer.lex(i.position,t);return this.expect(n,"EOF"),i},n.prototype.parseExpression=function(e,t,i,n){for(var r=[];;){var o=this.lexer.lex(e,t);if(null!=n&&o.text===n)break;var s=this.parseAtom(e,t);if(!s)break;if(i&&"infix"===s.result.type)break;r.push(s.result),e=s.position}return new a(this.handleInfixNodes(r,t),e)},n.prototype.handleInfixNodes=function(e,t){for(var i,n,a=-1,o=0;o<e.length;o++){var l=e[o];if("infix"===l.type){if(-1!==a)throw new d("only one infix operator per group",this.lexer,-1);a=o,n=l.value.replaceWith,i=s.funcs[n]}}if(-1!==a){var c,u,h=e.slice(0,a),p=e.slice(a+1);c=1===h.length&&"ordgroup"===h[0].type?h[0]:new r("ordgroup",h,t),u=1===p.length&&"ordgroup"===p[0].type?p[0]:new r("ordgroup",p,t);var f=i.handler(n,c,u);return[new r(f.type,f,t)]}return e};n.prototype.handleSupSubscript=function(e,t,i,n){var r=this.parseGroup(e,t);if(r){if(r.numArgs>0){if(s.getGreediness(r.result.result)>1)return this.parseFunction(e,t);throw new d("Got function '"+r.result.result+"' with no arguments as "+n,this.lexer,e)}return r.result}throw new d("Expected group after '"+i+"'",this.lexer,e)},n.prototype.parseAtom=function(e,t){var i=this.parseImplicitGroup(e,t);if("text"===t)return i;var n;i?n=i.position:(n=e,i=void 0);for(var o,s,l;;){var c=this.lexer.lex(n,t);if("^"===c.text){if(o)throw new d("Double superscript",this.lexer,n);l=this.handleSupSubscript(c.position,t,c.text,"superscript"),n=l.position,o=l.result}else if("_"===c.text){if(s)throw new d("Double subscript",this.lexer,n);l=this.handleSupSubscript(c.position,t,c.text,"subscript"),n=l.position,s=l.result}else{if("'"!==c.text)break;var u=new r("textord","\\prime",t),h=[u];for(n=c.position;"'"===(c=this.lexer.lex(n,t)).text;)h.push(u),n=c.position;o=new r("ordgroup",h,t)}}return o||s?new a(new r("supsub",{base:i&&i.result,sup:o,sub:s},t),n):i};var h=["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],p=["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"];n.prototype.parseImplicitGroup=function(e,t){var i=this.parseSymbol(e,t);if(!i||!i.result)return this.parseFunction(e,t);var n,o=i.result.result;if("\\left"===o){var s=this.parseFunction(e,t);n=this.parseExpression(s.position,t,!1,"}");var l=this.parseSymbol(n.position,t);if(l&&"\\right"===l.result.result){var c=this.parseFunction(n.position,t);return new a(new r("leftright",{body:n.result,left:s.result.value.value,right:c.result.value.value},t),c.position)}throw new d("Missing \\right",this.lexer,n.position)}return"\\right"===o?null:u.contains(h,o)?(n=this.parseExpression(i.result.position,t,!1,"}"),new a(new r("sizing",{size:"size"+(u.indexOf(h,o)+1),value:n.result},t),n.position)):u.contains(p,o)?(n=this.parseExpression(i.result.position,t,!0,"}"),new a(new r("styling",{style:o.slice(1,o.length-5),value:n.result},t),n.position)):this.parseFunction(e,t)},n.prototype.parseFunction=function(e,t){var i=this.parseGroup(e,t);if(i){if(i.isFunction){var n=i.result.result;if("text"===t&&!i.allowedInText)throw new d("Can't use function '"+n+"' in text mode",this.lexer,i.position);var o,l=i.result.position,c=i.numArgs+i.numOptionalArgs;if(c>0){for(var u=s.getGreediness(n),h=[n],p=[l],f=0;f<c;f++){var m,g=i.argTypes&&i.argTypes[f];if(f<i.numOptionalArgs){if(!(m=g?this.parseSpecialGroup(l,g,t,!0):this.parseOptionalGroup(l,t))){h.push(null),p.push(l);continue}}else if(!(m=g?this.parseSpecialGroup(l,g,t):this.parseGroup(l,t)))throw new d("Expected group after '"+i.result.result+"'",this.lexer,l);var v;if(m.numArgs>0){if(!(s.getGreediness(m.result.result)>u))throw new d("Got function '"+m.result.result+"' as argument to function '"+i.result.result+"'",this.lexer,m.result.position-1);v=this.parseFunction(l,t)}else v=m.result;h.push(v.result),p.push(v.position),l=v.position}h.push(p),o=s.funcs[n].handler.apply(this,h)}else o=s.funcs[n].handler.apply(this,[n]);return new a(new r(o.type,o,t),l)}return i.result}return null},n.prototype.parseSpecialGroup=function(e,t,i,n){if("color"===t||"size"===t){var s=this.lexer.lex(e,i);if(n&&"["!==s.text)return null;this.expect(s,n?"[":"{");var l,c=this.lexer.lex(s.position,t);l="color"===t?c.text:c.data;var u=this.lexer.lex(c.position,i);return this.expect(u,n?"]":"}"),new o(new a(new r(t,l,i),u.position),!1)}if("text"===t){e=this.lexer.lex(e,"whitespace").position}return n?this.parseOptionalGroup(e,t):this.parseGroup(e,t)},n.prototype.parseGroup=function(e,t){var i=this.lexer.lex(e,t);if("{"===i.text){var n=this.parseExpression(i.position,t,!1,"}"),s=this.lexer.lex(n.position,t);return this.expect(s,"}"),new o(new a(new r("ordgroup",n.result,t),s.position),!1)}return this.parseSymbol(e,t)},n.prototype.parseOptionalGroup=function(e,t){var i=this.lexer.lex(e,t);if("["===i.text){var n=this.parseExpression(i.position,t,!1,"]"),s=this.lexer.lex(n.position,t);return this.expect(s,"]"),new o(new a(new r("ordgroup",n.result,t),s.position),!1)}return null},n.prototype.parseSymbol=function(e,t){var i=this.lexer.lex(e,t);if(s.funcs[i.text]){var n=s.funcs[i.text],l=n.argTypes;if(l){l=l.slice();for(var u=0;u<l.length;u++)"original"===l[u]&&(l[u]=t)}return new o(new a(i.text,i.position),!0,n.allowedInText,n.numArgs,n.numOptionalArgs,l)}return c[t][i.text]?new o(new a(new r(c[t][i.text].group,i.text,t),i.position),!1):null},t.exports=n},{"./Lexer":2,"./ParseError":4,"./functions":12,"./symbols":14,"./utils":15}],6:[function(e,t,i){function n(e,t,i,n){this.id=e,this.size=t,this.cramped=n,this.sizeMultiplier=i}n.prototype.sup=function(){return o[s[this.id]]},n.prototype.sub=function(){return o[l[this.id]]},n.prototype.fracNum=function(){return o[c[this.id]]},n.prototype.fracDen=function(){return o[u[this.id]]},n.prototype.cramp=function(){return o[d[this.id]]},n.prototype.cls=function(){return r[this.size]+(this.cramped?" cramped":" uncramped")},n.prototype.reset=function(){return a[this.size]};var r=["displaystyle textstyle","textstyle","scriptstyle","scriptscriptstyle"],a=["reset-textstyle","reset-textstyle","reset-scriptstyle","reset-scriptscriptstyle"],o=[new n(0,0,1,!1),new n(1,0,1,!0),new n(2,1,1,!1),new n(3,1,1,!0),new n(4,2,.7,!1),new n(5,2,.7,!0),new n(6,3,.5,!1),new n(7,3,.5,!0)],s=[4,5,4,5,6,7,6,7],l=[5,5,5,5,7,7,7,7],c=[2,3,4,5,6,7,6,7],u=[3,3,5,5,7,7,7,7],d=[1,1,3,3,5,5,7,7];t.exports={DISPLAY:o[0],TEXT:o[2],SCRIPT:o[4],SCRIPTSCRIPT:o[6]}},{}],7:[function(e,t,i){var n=e("./domTree"),r=e("./fontMetrics"),a=e("./symbols"),o=function(e,t,i,o,s){a[i][e]&&a[i][e].replace&&(e=a[i][e].replace);var l,c=r.getCharacterMetrics(e,t);return c?l=new n.symbolNode(e,c.height,c.depth,c.italic,c.skew,s):("undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"'"),l=new n.symbolNode(e,0,0,0,0,s)),o&&(l.style.color=o),l},s=function(e,t,i,n){return o(e,"Math-Italic",t,i,n.concat(["mathit"]))},l=function(e,t,i,n){return"main"===a[t][e].font?o(e,"Main-Regular",t,i,n):o(e,"AMS-Regular",t,i,n.concat(["amsrm"]))},c=function(e){var t=0,i=0,n=0;if(e.children)for(var r=0;r<e.children.length;r++)e.children[r].height>t&&(t=e.children[r].height),e.children[r].depth>i&&(i=e.children[r].depth),e.children[r].maxFontSize>n&&(n=e.children[r].maxFontSize);e.height=t,e.depth=i,e.maxFontSize=n},u=function(e,t,i){var r=new n.span(e,t);return c(r),i&&(r.style.color=i),r},d=function(e){var t=new n.documentFragment(e);return c(t),t},h=function(e,t){var i=u([],[new n.symbolNode("")]);return i.style.fontSize=t/e.style.sizeMultiplier+"em",u(["fontsize-ensurer","reset-"+e.size,"size5"],[i])},p=function(e,t,i,r){var a,o,s;if("individualShift"===t){var l=e;for(e=[l[0]],a=-l[0].shift-l[0].elem.depth,o=a,s=1;s<l.length;s++){var c=-l[s].shift-o-l[s].elem.depth,d=c-(l[s-1].elem.height+l[s-1].elem.depth);o+=c,e.push({type:"kern",size:d}),e.push(l[s])}}else if("top"===t){var p=i;for(s=0;s<e.length;s++)"kern"===e[s].type?p-=e[s].size:p-=e[s].elem.height+e[s].elem.depth;a=p}else a="bottom"===t?-i:"shift"===t?-e[0].elem.depth-i:"firstBaseline"===t?-e[0].elem.depth:0;var f=0;for(s=0;s<e.length;s++)"elem"===e[s].type&&(f=Math.max(f,e[s].elem.maxFontSize));var m=h(r,f),g=[];for(o=a,s=0;s<e.length;s++)if("kern"===e[s].type)o+=e[s].size;else{var v=e[s].elem,y=-v.depth-o;o+=v.height+v.depth;var _=u([],[m,v]);_.height-=y,_.depth+=y,_.style.top=y+"em",g.push(_)}var b=u(["baseline-fix"],[m,new n.symbolNode("")]);g.push(b);var w=u(["vlist"],g);return w.height=Math.max(o,w.height),w.depth=Math.max(-a,w.depth),w};t.exports={makeSymbol:o,mathit:s,mathrm:l,makeSpan:u,makeFragment:d,makeVList:p}},{"./domTree":10,"./fontMetrics":11,"./symbols":14}],8:[function(e,t,i){var n=e("./Options"),r=e("./ParseError"),a=e("./Style"),o=e("./buildCommon"),s=e("./delimiter"),l=e("./domTree"),c=e("./fontMetrics"),u=e("./utils"),d=o.makeSpan,h=function(e,t,i){for(var n=[],r=0;r<e.length;r++){var a=e[r];n.push(b(a,t,i)),i=a}return n},p={mathord:"mord",textord:"mord",bin:"mbin",rel:"mrel",text:"mord",open:"mopen",close:"mclose",inner:"minner",frac:"minner",spacing:"mord",punct:"mpunct",ordgroup:"mord",op:"mop",katex:"mord",overline:"mord",rule:"mord",leftright:"minner",sqrt:"mord",accent:"mord"},f=function(e){return null==e?p.mathord:"supsub"===e.type?f(e.value.base):"llap"===e.type||"rlap"===e.type?f(e.value):"color"===e.type?f(e.value.value):"sizing"===e.type?f(e.value.value):"styling"===e.type?f(e.value.value):"delimsizing"===e.type?p[e.value.delimType]:p[e.type]},m=function(e,t){return!!e&&("op"===e.type?e.value.limits&&t.style.size===a.DISPLAY.size:"accent"===e.type?v(e.value.base):null)},g=function(e){return!!e&&("ordgroup"===e.type?1===e.value.length?g(e.value[0]):e:"color"===e.type&&1===e.value.value.length?g(e.value.value[0]):e)},v=function(e){var t=g(e);return"mathord"===t.type||"textord"===t.type||"bin"===t.type||"rel"===t.type||"inner"===t.type||"open"===t.type||"close"===t.type||"punct"===t.type},y={mathord:function(e,t,i){return o.mathit(e.value,e.mode,t.getColor(),["mord"])},textord:function(e,t,i){return o.mathrm(e.value,e.mode,t.getColor(),["mord"])},bin:function(e,t,i){for(var n="mbin",r=i;r&&"color"==r.type;){var a=r.value.value;r=a[a.length-1]}return i&&!u.contains(["mbin","mopen","mrel","mop","mpunct"],f(r))||(e.type="textord",n="mord"),o.mathrm(e.value,e.mode,t.getColor(),[n])},rel:function(e,t,i){return o.mathrm(e.value,e.mode,t.getColor(),["mrel"])},open:function(e,t,i){return o.mathrm(e.value,e.mode,t.getColor(),["mopen"])},close:function(e,t,i){return o.mathrm(e.value,e.mode,t.getColor(),["mclose"])},inner:function(e,t,i){return o.mathrm(e.value,e.mode,t.getColor(),["minner"])},punct:function(e,t,i){return o.mathrm(e.value,e.mode,t.getColor(),["mpunct"])},ordgroup:function(e,t,i){return d(["mord",t.style.cls()],h(e.value,t.reset()))},text:function(e,t,i){return d(["text","mord",t.style.cls()],h(e.value.body,t.reset()))},color:function(e,t,i){var n=h(e.value.value,t.withColor(e.value.color),i);return new o.makeFragment(n)},supsub:function(e,t,i){if(m(e.value.base,t))return y[e.value.base.type](e,t,i);var n,r,s,u,h=b(e.value.base,t.reset());e.value.sup&&(s=b(e.value.sup,t.withStyle(t.style.sup())),n=d([t.style.reset(),t.style.sup().cls()],[s])),e.value.sub&&(u=b(e.value.sub,t.withStyle(t.style.sub())),r=d([t.style.reset(),t.style.sub().cls()],[u]));var p,g;v(e.value.base)?(p=0,g=0):(p=h.height-c.metrics.supDrop,g=h.depth+c.metrics.subDrop);var _;_=t.style===a.DISPLAY?c.metrics.sup1:t.style.cramped?c.metrics.sup3:c.metrics.sup2;var w,x=a.TEXT.sizeMultiplier*t.style.sizeMultiplier,k=.5/c.metrics.ptPerEm/x+"em";if(e.value.sup)if(e.value.sub){p=Math.max(p,_,s.depth+.25*c.metrics.xHeight),g=Math.max(g,c.metrics.sub2);var C=c.metrics.defaultRuleThickness;if(p-s.depth-(u.height-g)<4*C){g=4*C-(p-s.depth)+u.height;var T=.8*c.metrics.xHeight-(p-s.depth);T>0&&(p+=T,g-=T)}w=o.makeVList([{type:"elem",elem:r,shift:g},{type:"elem",elem:n,shift:-p}],"individualShift",null,t),h instanceof l.symbolNode&&(w.children[0].style.marginLeft=-h.italic+"em"),w.children[0].style.marginRight=k,w.children[1].style.marginRight=k}else p=Math.max(p,_,s.depth+.25*c.metrics.xHeight),w=o.makeVList([{type:"elem",elem:n}],"shift",-p,t),w.children[0].style.marginRight=k;else g=Math.max(g,c.metrics.sub1,u.height-.8*c.metrics.xHeight),w=o.makeVList([{type:"elem",elem:r}],"shift",g,t),w.children[0].style.marginRight=k,h instanceof l.symbolNode&&(w.children[0].style.marginLeft=-h.italic+"em");return d([f(e.value.base)],[h,w])},genfrac:function(e,t,i){var n=t.style;"display"===e.value.size?n=a.DISPLAY:"text"===e.value.size&&(n=a.TEXT);var r,l=n.fracNum(),u=n.fracDen(),h=b(e.value.numer,t.withStyle(l)),p=d([n.reset(),l.cls()],[h]),f=b(e.value.denom,t.withStyle(u)),m=d([n.reset(),u.cls()],[f]);r=e.value.hasBarLine?c.metrics.defaultRuleThickness/t.style.sizeMultiplier:0;var g,v,y;n.size===a.DISPLAY.size?(g=c.metrics.num1,v=r>0?3*r:7*c.metrics.defaultRuleThickness,y=c.metrics.denom1):(r>0?(g=c.metrics.num2,v=r):(g=c.metrics.num3,v=3*c.metrics.defaultRuleThickness),y=c.metrics.denom2);var _;if(0===r){var w=g-h.depth-(f.height-y);w<v&&(g+=.5*(v-w),y+=.5*(v-w)),_=o.makeVList([{type:"elem",elem:m,shift:y},{type:"elem",elem:p,shift:-g}],"individualShift",null,t)}else{var x=c.metrics.axisHeight;g-h.depth-(x+.5*r)<v&&(g+=v-(g-h.depth-(x+.5*r))),x-.5*r-(f.height-y)<v&&(y+=v-(x-.5*r-(f.height-y)));var k=d([t.style.reset(),a.TEXT.cls(),"frac-line"]);k.height=r;var C=-(x-.5*r);_=o.makeVList([{type:"elem",elem:m,shift:y},{type:"elem",elem:k,shift:C},{type:"elem",elem:p,shift:-g}],"individualShift",null,t)}_.height*=n.sizeMultiplier/t.style.sizeMultiplier,_.depth*=n.sizeMultiplier/t.style.sizeMultiplier;var T,S=[d(["mfrac"],[_])];return T=n.size===a.DISPLAY.size?c.metrics.delim1:c.metrics.getDelim2(n),null!=e.value.leftDelim&&S.unshift(s.customSizedDelim(e.value.leftDelim,T,!0,t.withStyle(n),e.mode)),null!=e.value.rightDelim&&S.push(s.customSizedDelim(e.value.rightDelim,T,!0,t.withStyle(n),e.mode)),d(["minner",t.style.reset(),n.cls()],S,t.getColor())},spacing:function(e,t,i){return"\\ "===e.value||"\\space"===e.value||" "===e.value||"~"===e.value?d(["mord","mspace"],[o.mathrm(e.value,e.mode)]):d(["mord","mspace",{"\\qquad":"qquad","\\quad":"quad","\\enspace":"enspace","\\;":"thickspace","\\:":"mediumspace","\\,":"thinspace","\\!":"negativethinspace"}[e.value]])},llap:function(e,t,i){var n=d(["inner"],[b(e.value.body,t.reset())]),r=d(["fix"],[]);return d(["llap",t.style.cls()],[n,r])},rlap:function(e,t,i){var n=d(["inner"],[b(e.value.body,t.reset())]),r=d(["fix"],[]);return d(["rlap",t.style.cls()],[n,r])},op:function(e,t,i){var n,r,s=!1;"supsub"===e.type&&(n=e.value.sup,r=e.value.sub,e=e.value.base,s=!0);var l=["\\smallint"],h=!1;t.style.size===a.DISPLAY.size&&e.value.symbol&&!u.contains(l,e.value.body)&&(h=!0);var p,f=0,m=0;if(e.value.symbol){var g=h?"Size2-Regular":"Size1-Regular";p=o.makeSymbol(e.value.body,g,"math",t.getColor(),["op-symbol",h?"large-op":"small-op","mop"]),f=(p.height-p.depth)/2-c.metrics.axisHeight*t.style.sizeMultiplier,m=p.italic}else{for(var v=[],y=1;y<e.value.body.length;y++)v.push(o.mathrm(e.value.body[y],e.mode));p=d(["mop"],v,t.getColor())}if(s){p=d([],[p]);var _,w,x,k;if(n){var C=b(n,t.withStyle(t.style.sup()));_=d([t.style.reset(),t.style.sup().cls()],[C]),w=Math.max(c.metrics.bigOpSpacing1,c.metrics.bigOpSpacing3-C.depth)}if(r){var T=b(r,t.withStyle(t.style.sub()));x=d([t.style.reset(),t.style.sub().cls()],[T]),k=Math.max(c.metrics.bigOpSpacing2,c.metrics.bigOpSpacing4-T.height)}var S,E,A;if(n)if(r){if(!n&&!r)return p;A=c.metrics.bigOpSpacing5+x.height+x.depth+k+p.depth+f,S=o.makeVList([{type:"kern",size:c.metrics.bigOpSpacing5},{type:"elem",elem:x},{type:"kern",size:k},{type:"elem",elem:p},{type:"kern",size:w},{type:"elem",elem:_},{type:"kern",size:c.metrics.bigOpSpacing5}],"bottom",A,t),S.children[0].style.marginLeft=-m+"em",S.children[2].style.marginLeft=m+"em"}else A=p.depth+f,S=o.makeVList([{type:"elem",elem:p},{type:"kern",size:w},{type:"elem",elem:_},{type:"kern",size:c.metrics.bigOpSpacing5}],"bottom",A,t),S.children[1].style.marginLeft=m+"em";else E=p.height-f,S=o.makeVList([{type:"kern",size:c.metrics.bigOpSpacing5},{type:"elem",elem:x},{type:"kern",size:k},{type:"elem",elem:p}],"top",E,t),S.children[0].style.marginLeft=-m+"em";return d(["mop","op-limits"],[S])}return e.value.symbol&&(p.style.top=f+"em"),p},katex:function(e,t,i){var n=d(["k"],[o.mathrm("K",e.mode)]),r=d(["a"],[o.mathrm("A",e.mode)]);r.height=.75*(r.height+.2),r.depth=.75*(r.height-.2);var a=d(["t"],[o.mathrm("T",e.mode)]),s=d(["e"],[o.mathrm("E",e.mode)]);s.height=s.height-.2155,s.depth=s.depth+.2155;var l=d(["x"],[o.mathrm("X",e.mode)]);return d(["katex-logo"],[n,r,a,s,l],t.getColor())},overline:function(e,t,i){var n=b(e.value.body,t.withStyle(t.style.cramp())),r=c.metrics.defaultRuleThickness/t.style.sizeMultiplier,s=d([t.style.reset(),a.TEXT.cls(),"overline-line"]);s.height=r,s.maxFontSize=1;var l=o.makeVList([{type:"elem",elem:n},{type:"kern",size:3*r},{type:"elem",elem:s},{type:"kern",size:r}],"firstBaseline",null,t);return d(["overline","mord"],[l],t.getColor())},sqrt:function(e,t,i){var n=b(e.value.body,t.withStyle(t.style.cramp())),r=c.metrics.defaultRuleThickness/t.style.sizeMultiplier,l=d([t.style.reset(),a.TEXT.cls(),"sqrt-line"],[],t.getColor());l.height=r,l.maxFontSize=1;var u=r;t.style.id<a.TEXT.id&&(u=c.metrics.xHeight);var h=r+u/4,p=(n.height+n.depth)*t.style.sizeMultiplier,f=p+h+r,m=d(["sqrt-sign"],[s.customSizedDelim("\\surd",f,!1,t,e.mode)],t.getColor()),g=m.height+m.depth-r;g>n.height+n.depth+h&&(h=(h+g-n.height-n.depth)/2);var v=-(n.height+h+r)+m.height;m.style.top=v+"em",m.height-=v,m.depth+=v;var y;return y=0===n.height&&0===n.depth?d():o.makeVList([{type:"elem",elem:n},{type:"kern",size:h},{type:"elem",elem:l},{type:"kern",size:r}],"firstBaseline",null,t),d(["sqrt","mord"],[m,y])},sizing:function(e,t,i){var n=h(e.value.value,t.withSize(e.value.size),i),r=d(["mord"],[d(["sizing","reset-"+t.size,e.value.size,t.style.cls()],n)]),a=_[e.value.size];return r.maxFontSize=a*t.style.sizeMultiplier,r},styling:function(e,t,i){var n={display:a.DISPLAY,text:a.TEXT,script:a.SCRIPT,scriptscript:a.SCRIPTSCRIPT},r=n[e.value.style],o=h(e.value.value,t.withStyle(r),i);return d([t.style.reset(),r.cls()],o)},delimsizing:function(e,t,i){var n=e.value.value;return"."===n?d([p[e.value.delimType]]):d([p[e.value.delimType]],[s.sizedDelim(n,e.value.size,t,e.mode)])},leftright:function(e,t,i){for(var n=h(e.value.body,t.reset()),r=0,a=0,o=0;o<n.length;o++)r=Math.max(n[o].height,r),a=Math.max(n[o].depth,a);r*=t.style.sizeMultiplier,a*=t.style.sizeMultiplier;var l;l="."===e.value.left?d(["nulldelimiter"]):s.leftRightDelim(e.value.left,r,a,t,e.mode),n.unshift(l);var c;return c="."===e.value.right?d(["nulldelimiter"]):s.leftRightDelim(e.value.right,r,a,t,e.mode),n.push(c),d(["minner",t.style.cls()],n,t.getColor())},rule:function(e,t,i){var n=d(["mord","rule"],[],t.getColor()),r=0;e.value.shift&&(r=e.value.shift.number,"ex"===e.value.shift.unit&&(r*=c.metrics.xHeight));var a=e.value.width.number;"ex"===e.value.width.unit&&(a*=c.metrics.xHeight);var o=e.value.height.number;return"ex"===e.value.height.unit&&(o*=c.metrics.xHeight),r/=t.style.sizeMultiplier,a/=t.style.sizeMultiplier,o/=t.style.sizeMultiplier,n.style.borderRightWidth=a+"em",n.style.borderTopWidth=o+"em",n.style.bottom=r+"em",n.width=a,n.height=o+r,n.depth=-r,n},accent:function(e,t,i){var n,r=e.value.base;if("supsub"===e.type){var a=e;e=a.value.base,r=e.value.base,a.value.base=r,n=b(a,t.reset(),i)}var s,l=b(r,t.withStyle(t.style.cramp()));if(v(r)){var u=g(r);s=b(u,t.withStyle(t.style.cramp())).skew}else s=0;var h=Math.min(l.height,c.metrics.xHeight),p=o.makeSymbol(e.value.accent,"Main-Regular","math",t.getColor());p.italic=0;var f="\\vec"===e.value.accent?"accent-vec":null,m=d(["accent-body",f],[d([],[p])]);m=o.makeVList([{type:"elem",elem:l},{type:"kern",size:-h},{type:"elem",elem:m}],"firstBaseline",null,t),m.children[1].style.marginLeft=2*s+"em";var y=d(["mord","accent"],[m]);return n?(n.children[0]=y,n.height=Math.max(y.height,n.height),n.classes[0]="mord",n):y}},_={size1:.5,size2:.7,size3:.8,size4:.9,size5:1,size6:1.2,size7:1.44,size8:1.73,size9:2.07,size10:2.49},b=function(e,t,i){if(!e)return d();if(y[e.type]){var n,a=y[e.type](e,t,i);return t.style!==t.parentStyle&&(n=t.style.sizeMultiplier/t.parentStyle.sizeMultiplier,a.height*=n,a.depth*=n),t.size!==t.parentSize&&(n=_[t.size]/_[t.parentSize],a.height*=n,a.depth*=n),a}throw new r("Got group of unknown type: '"+e.type+"'")},w=function(e){var t=new n(a.TEXT,"size5",""),i=h(e,t),r=d(["base",t.style.cls()],i),o=d(["strut"]),s=d(["strut","bottom"]);return o.style.height=r.height+"em",s.style.height=r.height+r.depth+"em",s.style.verticalAlign=-r.depth+"em",d(["katex"],[d(["katex-inner"],[o,s,r])])};t.exports=w},{"./Options":3,"./ParseError":4,"./Style":6,"./buildCommon":7,"./delimiter":9,"./domTree":10,"./fontMetrics":11,"./utils":15}],9:[function(e,t,i){var n=e("./ParseError"),r=e("./Style"),a=e("./buildCommon"),o=e("./fontMetrics"),s=e("./symbols"),l=e("./utils"),c=a.makeSpan,u=function(e,t){return s.math[e]&&s.math[e].replace?o.getCharacterMetrics(s.math[e].replace,t):o.getCharacterMetrics(e,t)},d=function(e,t,i){return a.makeSymbol(e,"Size"+t+"-Regular",i)},h=function(e,t,i){var n=c(["style-wrap",i.style.reset(),t.cls()],[e]),r=t.sizeMultiplier/i.style.sizeMultiplier;return n.height*=r,n.depth*=r,n.maxFontSize=t.sizeMultiplier,n},p=function(e,t,i,n,r){var s=a.makeSymbol(e,"Main-Regular",r),l=h(s,t,n);if(i){var c=(1-n.style.sizeMultiplier/t.sizeMultiplier)*o.metrics.axisHeight;l.style.top=c+"em",l.height-=c,l.depth+=c}return l},f=function(e,t,i,n,a){var s=d(e,t,a),l=h(c(["delimsizing","size"+t],[s],n.getColor()),r.TEXT,n);if(i){var u=(1-n.style.sizeMultiplier)*o.metrics.axisHeight;l.style.top=u+"em",l.height-=u,l.depth+=u}return l},m=function(e,t,i){var n;return"Size1-Regular"===t?n="delim-size1":"Size4-Regular"===t&&(n="delim-size4"),{type:"elem",elem:c(["delimsizinginner",n],[c([],[a.makeSymbol(e,t,i)])])}},g=function(e,t,i,n,s){var l,d,p,f;l=p=f=e,d=null;var g="Size1-Regular";"\\uparrow"===e?p=f="⏐":"\\Uparrow"===e?p=f="‖":"\\downarrow"===e?l=p="⏐":"\\Downarrow"===e?l=p="‖":"\\updownarrow"===e?(l="\\uparrow",p="⏐",f="\\downarrow"):"\\Updownarrow"===e?(l="\\Uparrow",p="‖",f="\\Downarrow"):"["===e||"\\lbrack"===e?(l="⎡",p="⎢",f="⎣",g="Size4-Regular"):"]"===e||"\\rbrack"===e?(l="⎤",p="⎥",f="⎦",g="Size4-Regular"):"\\lfloor"===e?(p=l="⎢",f="⎣",g="Size4-Regular"):"\\lceil"===e?(l="⎡",p=f="⎢",g="Size4-Regular"):"\\rfloor"===e?(p=l="⎥",f="⎦",g="Size4-Regular"):"\\rceil"===e?(l="⎤",p=f="⎥",g="Size4-Regular"):"("===e?(l="⎛",p="⎜",f="⎝",g="Size4-Regular"):")"===e?(l="⎞",p="⎟",f="⎠",g="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(l="⎧",d="⎨",f="⎩",p="⎪",g="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(l="⎫",d="⎬",f="⎭",p="⎪",g="Size4-Regular"):"\\surd"===e&&(l="",f="⎷",p="",g="Size4-Regular");var v,y,_=u(l,g),b=_.height+_.depth,w=u(p,g),x=w.height+w.depth,k=u(f,g),C=k.height+k.depth;null!==d&&(v=u(d,g),y=v.height+v.depth);var T=b+C;for(null!==d&&(T+=y);T<t;)T+=x,null!==d&&(T+=x);var S=o.metrics.axisHeight;i&&(S*=n.style.sizeMultiplier);var E=T/2-S,A=[];A.push(m(f,g,s));var I;if(null===d){var D=T-b-C,M=Math.ceil(D/x);for(I=0;I<M;I++)A.push(m(p,g,s))}else{var L=T/2-b-y/2,O=Math.ceil(L/x),N=T/2-b-y/2,P=Math.ceil(N/x);for(I=0;I<O;I++)A.push(m(p,g,s));for(A.push(m(d,g,s)),I=0;I<P;I++)A.push(m(p,g,s))}A.push(m(l,g,s));var R=a.makeVList(A,"bottom",E,n);return h(c(["delimsizing","mult"],[R],n.getColor()),r.TEXT,n)},v=["(",")","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","\\surd"],y=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert"],_=["<",">","\\langle","\\rangle","/","\\backslash"],b=[0,1.2,1.8,2.4,3],w=function(e,t,i,r){if("<"===e?e="\\langle":">"===e&&(e="\\rangle"),l.contains(v,e)||l.contains(_,e))return f(e,t,!1,i,r);if(l.contains(y,e))return g(e,b[t],!1,i,r);throw new n("Illegal delimiter: '"+e+"'")},x=[{type:"small",style:r.SCRIPTSCRIPT},{type:"small",style:r.SCRIPT},{type:"small",style:r.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],k=[{type:"small",style:r.SCRIPTSCRIPT},{type:"small",style:r.SCRIPT},{type:"small",style:r.TEXT},{type:"stack"}],C=[{type:"small",style:r.SCRIPTSCRIPT},{type:"small",style:r.SCRIPT},{type:"small",style:r.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],T=function(e){return"small"===e.type?"Main-Regular":"large"===e.type?"Size"+e.size+"-Regular":"stack"===e.type?"Size4-Regular":void 0},S=function(e,t,i,n){for(var r=Math.min(2,3-n.style.size),a=r;a<i.length&&"stack"!==i[a].type;a++){var o=u(e,T(i[a])),s=o.height+o.depth;if("small"===i[a].type&&(s*=i[a].style.sizeMultiplier),s>t)return i[a]}return i[i.length-1]},E=function(e,t,i,n,r){"<"===e?e="\\langle":">"===e&&(e="\\rangle");var a;a=l.contains(_,e)?x:l.contains(v,e)?C:k;var o=S(e,t,a,n);return"small"===o.type?p(e,o.style,i,n,r):"large"===o.type?f(e,o.size,i,n,r):"stack"===o.type?g(e,t,i,n,r):void 0},A=function(e,t,i,n,r){var a=o.metrics.axisHeight*n.style.sizeMultiplier,s=5/o.metrics.ptPerEm,l=Math.max(t-a,i+a),c=Math.max(l/500*901,2*l-s);return E(e,c,!0,n,r)};t.exports={sizedDelim:w,customSizedDelim:E,leftRightDelim:A}},{"./ParseError":4,"./Style":6,"./buildCommon":7,"./fontMetrics":11,"./symbols":14,"./utils":15}],10:[function(e,t,i){function n(e,t,i,n,r,a){this.classes=e||[],this.children=t||[],this.height=i||0,this.depth=n||0,this.maxFontSize=r||0,this.style=a||{}}function r(e,t,i,n){this.children=e||[],this.height=t||0,this.depth=i||0,
|
||
this.maxFontSize=n||0}function a(e,t,i,n,r,a,o){this.value=e||"",this.height=t||0,this.depth=i||0,this.italic=n||0,this.skew=r||0,this.classes=a||[],this.style=o||{},this.maxFontSize=0}var o=e("./utils"),s=function(e){e=e.slice();for(var t=e.length-1;t>=0;t--)e[t]||e.splice(t,1);return e.join(" ")};n.prototype.toNode=function(){var e=document.createElement("span");e.className=s(this.classes);for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);for(var i=0;i<this.children.length;i++)e.appendChild(this.children[i].toNode());return e},n.prototype.toMarkup=function(){var e="<span";this.classes.length&&(e+=' class="',e+=o.escape(s(this.classes)),e+='"');var t="";for(var i in this.style)this.style.hasOwnProperty(i)&&(t+=o.hyphenate(i)+":"+this.style[i]+";");t&&(e+=' style="'+o.escape(t)+'"'),e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</span>"},r.prototype.toNode=function(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e},r.prototype.toMarkup=function(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e},a.prototype.toNode=function(){var e=document.createTextNode(this.value),t=null;this.italic>0&&(t=document.createElement("span"),t.style.marginRight=this.italic+"em"),this.classes.length>0&&(t=t||document.createElement("span"),t.className=s(this.classes));for(var i in this.style)this.style.hasOwnProperty(i)&&(t=t||document.createElement("span"),t.style[i]=this.style[i]);return t?(t.appendChild(e),t):e},a.prototype.toMarkup=function(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=o.escape(s(this.classes)),t+='"');var i="";this.italic>0&&(i+="margin-right:"+this.italic+"em;");for(var n in this.style)this.style.hasOwnProperty(n)&&(i+=o.hyphenate(n)+":"+this.style[n]+";");i&&(e=!0,t+=' style="'+o.escape(i)+'"');var r=o.escape(this.value);return e?(t+=">",t+=r,t+="</span>"):r},t.exports={span:n,documentFragment:r,symbolNode:a}},{"./utils":15}],11:[function(e,t,i){var n=e("./Style"),r={xHeight:.431,quad:1,num1:.677,num2:.394,num3:.444,denom1:.686,denom2:.345,sup1:.413,sup2:.363,sup3:.289,sub1:.15,sub2:.247,supDrop:.386,subDrop:.05,axisHeight:.25,defaultRuleThickness:.04,bigOpSpacing1:.111,bigOpSpacing2:.166,bigOpSpacing3:.2,bigOpSpacing4:.6,bigOpSpacing5:.1,ptPerEm:10,delim1:2.39,getDelim2:function(e){if(e.size===n.TEXT.size)return 1.01;if(e.size===n.SCRIPT.size)return.81;if(e.size===n.SCRIPTSCRIPT.size)return.71;throw new Error("Unexpected style size: "+e.size)}},a={"AMS-Regular":{10003:{depth:0,height:.69224,italic:0,skew:0},10016:{depth:0,height:.69224,italic:0,skew:0},1008:{depth:0,height:.43056,italic:.04028,skew:0},107:{depth:0,height:.68889,italic:0,skew:0},10731:{depth:.11111,height:.69224,italic:0,skew:0},10846:{depth:.19444,height:.75583,italic:0,skew:0},10877:{depth:.13667,height:.63667,italic:0,skew:0},10878:{depth:.13667,height:.63667,italic:0,skew:0},10885:{depth:.25583,height:.75583,italic:0,skew:0},10886:{depth:.25583,height:.75583,italic:0,skew:0},10887:{depth:.13597,height:.63597,italic:0,skew:0},10888:{depth:.13597,height:.63597,italic:0,skew:0},10889:{depth:.26167,height:.75726,italic:0,skew:0},10890:{depth:.26167,height:.75726,italic:0,skew:0},10891:{depth:.48256,height:.98256,italic:0,skew:0},10892:{depth:.48256,height:.98256,italic:0,skew:0},10901:{depth:.13667,height:.63667,italic:0,skew:0},10902:{depth:.13667,height:.63667,italic:0,skew:0},10933:{depth:.25142,height:.75726,italic:0,skew:0},10934:{depth:.25142,height:.75726,italic:0,skew:0},10935:{depth:.26167,height:.75726,italic:0,skew:0},10936:{depth:.26167,height:.75726,italic:0,skew:0},10937:{depth:.26167,height:.75726,italic:0,skew:0},10938:{depth:.26167,height:.75726,italic:0,skew:0},10949:{depth:.25583,height:.75583,italic:0,skew:0},10950:{depth:.25583,height:.75583,italic:0,skew:0},10955:{depth:.28481,height:.79383,italic:0,skew:0},10956:{depth:.28481,height:.79383,italic:0,skew:0},165:{depth:0,height:.675,italic:.025,skew:0},174:{depth:.15559,height:.69224,italic:0,skew:0},240:{depth:0,height:.68889,italic:0,skew:0},295:{depth:0,height:.68889,italic:0,skew:0},57350:{depth:.08167,height:.58167,italic:0,skew:0},57351:{depth:.08167,height:.58167,italic:0,skew:0},57352:{depth:.08167,height:.58167,italic:0,skew:0},57353:{depth:0,height:.43056,italic:.04028,skew:0},57356:{depth:.25142,height:.75726,italic:0,skew:0},57357:{depth:.25142,height:.75726,italic:0,skew:0},57358:{depth:.41951,height:.91951,italic:0,skew:0},57359:{depth:.30274,height:.79383,italic:0,skew:0},57360:{depth:.30274,height:.79383,italic:0,skew:0},57361:{depth:.41951,height:.91951,italic:0,skew:0},57366:{depth:.25142,height:.75726,italic:0,skew:0},57367:{depth:.25142,height:.75726,italic:0,skew:0},57368:{depth:.25142,height:.75726,italic:0,skew:0},57369:{depth:.25142,height:.75726,italic:0,skew:0},57370:{depth:.13597,height:.63597,italic:0,skew:0},57371:{depth:.13597,height:.63597,italic:0,skew:0},65:{depth:0,height:.68889,italic:0,skew:0},66:{depth:0,height:.68889,italic:0,skew:0},67:{depth:0,height:.68889,italic:0,skew:0},68:{depth:0,height:.68889,italic:0,skew:0},69:{depth:0,height:.68889,italic:0,skew:0},70:{depth:0,height:.68889,italic:0,skew:0},71:{depth:0,height:.68889,italic:0,skew:0},710:{depth:0,height:.825,italic:0,skew:0},72:{depth:0,height:.68889,italic:0,skew:0},73:{depth:0,height:.68889,italic:0,skew:0},732:{depth:0,height:.9,italic:0,skew:0},74:{depth:.16667,height:.68889,italic:0,skew:0},75:{depth:0,height:.68889,italic:0,skew:0},76:{depth:0,height:.68889,italic:0,skew:0},77:{depth:0,height:.68889,italic:0,skew:0},770:{depth:0,height:.825,italic:0,skew:0},771:{depth:0,height:.9,italic:0,skew:0},78:{depth:0,height:.68889,italic:0,skew:0},79:{depth:.16667,height:.68889,italic:0,skew:0},80:{depth:0,height:.68889,italic:0,skew:0},81:{depth:.16667,height:.68889,italic:0,skew:0},82:{depth:0,height:.68889,italic:0,skew:0},8245:{depth:0,height:.54986,italic:0,skew:0},83:{depth:0,height:.68889,italic:0,skew:0},84:{depth:0,height:.68889,italic:0,skew:0},8463:{depth:0,height:.68889,italic:0,skew:0},8487:{depth:0,height:.68889,italic:0,skew:0},8498:{depth:0,height:.68889,italic:0,skew:0},85:{depth:0,height:.68889,italic:0,skew:0},8502:{depth:0,height:.68889,italic:0,skew:0},8503:{depth:0,height:.68889,italic:0,skew:0},8504:{depth:0,height:.68889,italic:0,skew:0},8513:{depth:0,height:.68889,italic:0,skew:0},8592:{depth:-.03598,height:.46402,italic:0,skew:0},8594:{depth:-.03598,height:.46402,italic:0,skew:0},86:{depth:0,height:.68889,italic:0,skew:0},8602:{depth:-.13313,height:.36687,italic:0,skew:0},8603:{depth:-.13313,height:.36687,italic:0,skew:0},8606:{depth:.01354,height:.52239,italic:0,skew:0},8608:{depth:.01354,height:.52239,italic:0,skew:0},8610:{depth:.01354,height:.52239,italic:0,skew:0},8611:{depth:.01354,height:.52239,italic:0,skew:0},8619:{depth:0,height:.54986,italic:0,skew:0},8620:{depth:0,height:.54986,italic:0,skew:0},8621:{depth:-.13313,height:.37788,italic:0,skew:0},8622:{depth:-.13313,height:.36687,italic:0,skew:0},8624:{depth:0,height:.69224,italic:0,skew:0},8625:{depth:0,height:.69224,italic:0,skew:0},8630:{depth:0,height:.43056,italic:0,skew:0},8631:{depth:0,height:.43056,italic:0,skew:0},8634:{depth:.08198,height:.58198,italic:0,skew:0},8635:{depth:.08198,height:.58198,italic:0,skew:0},8638:{depth:.19444,height:.69224,italic:0,skew:0},8639:{depth:.19444,height:.69224,italic:0,skew:0},8642:{depth:.19444,height:.69224,italic:0,skew:0},8643:{depth:.19444,height:.69224,italic:0,skew:0},8644:{depth:.1808,height:.675,italic:0,skew:0},8646:{depth:.1808,height:.675,italic:0,skew:0},8647:{depth:.1808,height:.675,italic:0,skew:0},8648:{depth:.19444,height:.69224,italic:0,skew:0},8649:{depth:.1808,height:.675,italic:0,skew:0},8650:{depth:.19444,height:.69224,italic:0,skew:0},8651:{depth:.01354,height:.52239,italic:0,skew:0},8652:{depth:.01354,height:.52239,italic:0,skew:0},8653:{depth:-.13313,height:.36687,italic:0,skew:0},8654:{depth:-.13313,height:.36687,italic:0,skew:0},8655:{depth:-.13313,height:.36687,italic:0,skew:0},8666:{depth:.13667,height:.63667,italic:0,skew:0},8667:{depth:.13667,height:.63667,italic:0,skew:0},8669:{depth:-.13313,height:.37788,italic:0,skew:0},87:{depth:0,height:.68889,italic:0,skew:0},8705:{depth:0,height:.825,italic:0,skew:0},8708:{depth:0,height:.68889,italic:0,skew:0},8709:{depth:.08167,height:.58167,italic:0,skew:0},8717:{depth:0,height:.43056,italic:0,skew:0},8722:{depth:-.03598,height:.46402,italic:0,skew:0},8724:{depth:.08198,height:.69224,italic:0,skew:0},8726:{depth:.08167,height:.58167,italic:0,skew:0},8733:{depth:0,height:.69224,italic:0,skew:0},8736:{depth:0,height:.69224,italic:0,skew:0},8737:{depth:0,height:.69224,italic:0,skew:0},8738:{depth:.03517,height:.52239,italic:0,skew:0},8739:{depth:.08167,height:.58167,italic:0,skew:0},8740:{depth:.25142,height:.74111,italic:0,skew:0},8741:{depth:.08167,height:.58167,italic:0,skew:0},8742:{depth:.25142,height:.74111,italic:0,skew:0},8756:{depth:0,height:.69224,italic:0,skew:0},8757:{depth:0,height:.69224,italic:0,skew:0},8764:{depth:-.13313,height:.36687,italic:0,skew:0},8765:{depth:-.13313,height:.37788,italic:0,skew:0},8769:{depth:-.13313,height:.36687,italic:0,skew:0},8770:{depth:-.03625,height:.46375,italic:0,skew:0},8774:{depth:.30274,height:.79383,italic:0,skew:0},8776:{depth:-.01688,height:.48312,italic:0,skew:0},8778:{depth:.08167,height:.58167,italic:0,skew:0},8782:{depth:.06062,height:.54986,italic:0,skew:0},8783:{depth:.06062,height:.54986,italic:0,skew:0},8785:{depth:.08198,height:.58198,italic:0,skew:0},8786:{depth:.08198,height:.58198,italic:0,skew:0},8787:{depth:.08198,height:.58198,italic:0,skew:0},8790:{depth:0,height:.69224,italic:0,skew:0},8791:{depth:.22958,height:.72958,italic:0,skew:0},8796:{depth:.08198,height:.91667,italic:0,skew:0},88:{depth:0,height:.68889,italic:0,skew:0},8806:{depth:.25583,height:.75583,italic:0,skew:0},8807:{depth:.25583,height:.75583,italic:0,skew:0},8808:{depth:.25142,height:.75726,italic:0,skew:0},8809:{depth:.25142,height:.75726,italic:0,skew:0},8812:{depth:.25583,height:.75583,italic:0,skew:0},8814:{depth:.20576,height:.70576,italic:0,skew:0},8815:{depth:.20576,height:.70576,italic:0,skew:0},8816:{depth:.30274,height:.79383,italic:0,skew:0},8817:{depth:.30274,height:.79383,italic:0,skew:0},8818:{depth:.22958,height:.72958,italic:0,skew:0},8819:{depth:.22958,height:.72958,italic:0,skew:0},8822:{depth:.1808,height:.675,italic:0,skew:0},8823:{depth:.1808,height:.675,italic:0,skew:0},8828:{depth:.13667,height:.63667,italic:0,skew:0},8829:{depth:.13667,height:.63667,italic:0,skew:0},8830:{depth:.22958,height:.72958,italic:0,skew:0},8831:{depth:.22958,height:.72958,italic:0,skew:0},8832:{depth:.20576,height:.70576,italic:0,skew:0},8833:{depth:.20576,height:.70576,italic:0,skew:0},8840:{depth:.30274,height:.79383,italic:0,skew:0},8841:{depth:.30274,height:.79383,italic:0,skew:0},8842:{depth:.13597,height:.63597,italic:0,skew:0},8843:{depth:.13597,height:.63597,italic:0,skew:0},8847:{depth:.03517,height:.54986,italic:0,skew:0},8848:{depth:.03517,height:.54986,italic:0,skew:0},8858:{depth:.08198,height:.58198,italic:0,skew:0},8859:{depth:.08198,height:.58198,italic:0,skew:0},8861:{depth:.08198,height:.58198,italic:0,skew:0},8862:{depth:0,height:.675,italic:0,skew:0},8863:{depth:0,height:.675,italic:0,skew:0},8864:{depth:0,height:.675,italic:0,skew:0},8865:{depth:0,height:.675,italic:0,skew:0},8872:{depth:0,height:.69224,italic:0,skew:0},8873:{depth:0,height:.69224,italic:0,skew:0},8874:{depth:0,height:.69224,italic:0,skew:0},8876:{depth:0,height:.68889,italic:0,skew:0},8877:{depth:0,height:.68889,italic:0,skew:0},8878:{depth:0,height:.68889,italic:0,skew:0},8879:{depth:0,height:.68889,italic:0,skew:0},8882:{depth:.03517,height:.54986,italic:0,skew:0},8883:{depth:.03517,height:.54986,italic:0,skew:0},8884:{depth:.13667,height:.63667,italic:0,skew:0},8885:{depth:.13667,height:.63667,italic:0,skew:0},8888:{depth:0,height:.54986,italic:0,skew:0},8890:{depth:.19444,height:.43056,italic:0,skew:0},8891:{depth:.19444,height:.69224,italic:0,skew:0},8892:{depth:.19444,height:.69224,italic:0,skew:0},89:{depth:0,height:.68889,italic:0,skew:0},8901:{depth:0,height:.54986,italic:0,skew:0},8903:{depth:.08167,height:.58167,italic:0,skew:0},8905:{depth:.08167,height:.58167,italic:0,skew:0},8906:{depth:.08167,height:.58167,italic:0,skew:0},8907:{depth:0,height:.69224,italic:0,skew:0},8908:{depth:0,height:.69224,italic:0,skew:0},8909:{depth:-.03598,height:.46402,italic:0,skew:0},8910:{depth:0,height:.54986,italic:0,skew:0},8911:{depth:0,height:.54986,italic:0,skew:0},8912:{depth:.03517,height:.54986,italic:0,skew:0},8913:{depth:.03517,height:.54986,italic:0,skew:0},8914:{depth:0,height:.54986,italic:0,skew:0},8915:{depth:0,height:.54986,italic:0,skew:0},8916:{depth:0,height:.69224,italic:0,skew:0},8918:{depth:.0391,height:.5391,italic:0,skew:0},8919:{depth:.0391,height:.5391,italic:0,skew:0},8920:{depth:.03517,height:.54986,italic:0,skew:0},8921:{depth:.03517,height:.54986,italic:0,skew:0},8922:{depth:.38569,height:.88569,italic:0,skew:0},8923:{depth:.38569,height:.88569,italic:0,skew:0},8926:{depth:.13667,height:.63667,italic:0,skew:0},8927:{depth:.13667,height:.63667,italic:0,skew:0},8928:{depth:.30274,height:.79383,italic:0,skew:0},8929:{depth:.30274,height:.79383,italic:0,skew:0},8934:{depth:.23222,height:.74111,italic:0,skew:0},8935:{depth:.23222,height:.74111,italic:0,skew:0},8936:{depth:.23222,height:.74111,italic:0,skew:0},8937:{depth:.23222,height:.74111,italic:0,skew:0},8938:{depth:.20576,height:.70576,italic:0,skew:0},8939:{depth:.20576,height:.70576,italic:0,skew:0},8940:{depth:.30274,height:.79383,italic:0,skew:0},8941:{depth:.30274,height:.79383,italic:0,skew:0},8994:{depth:.19444,height:.69224,italic:0,skew:0},8995:{depth:.19444,height:.69224,italic:0,skew:0},90:{depth:0,height:.68889,italic:0,skew:0},9416:{depth:.15559,height:.69224,italic:0,skew:0},9484:{depth:0,height:.69224,italic:0,skew:0},9488:{depth:0,height:.69224,italic:0,skew:0},9492:{depth:0,height:.37788,italic:0,skew:0},9496:{depth:0,height:.37788,italic:0,skew:0},9585:{depth:.19444,height:.68889,italic:0,skew:0},9586:{depth:.19444,height:.74111,italic:0,skew:0},9632:{depth:0,height:.675,italic:0,skew:0},9633:{depth:0,height:.675,italic:0,skew:0},9650:{depth:0,height:.54986,italic:0,skew:0},9651:{depth:0,height:.54986,italic:0,skew:0},9654:{depth:.03517,height:.54986,italic:0,skew:0},9660:{depth:0,height:.54986,italic:0,skew:0},9661:{depth:0,height:.54986,italic:0,skew:0},9664:{depth:.03517,height:.54986,italic:0,skew:0},9674:{depth:.11111,height:.69224,italic:0,skew:0},9733:{depth:.19444,height:.69224,italic:0,skew:0},989:{depth:.08167,height:.58167,italic:0,skew:0}},"Main-Bold":{100:{depth:0,height:.69444,italic:0,skew:0},101:{depth:0,height:.44444,italic:0,skew:0},102:{depth:0,height:.69444,italic:.10903,skew:0},10216:{depth:.25,height:.75,italic:0,skew:0},10217:{depth:.25,height:.75,italic:0,skew:0},103:{depth:.19444,height:.44444,italic:.01597,skew:0},104:{depth:0,height:.69444,italic:0,skew:0},105:{depth:0,height:.69444,italic:0,skew:0},106:{depth:.19444,height:.69444,italic:0,skew:0},107:{depth:0,height:.69444,italic:0,skew:0},108:{depth:0,height:.69444,italic:0,skew:0},10815:{depth:0,height:.68611,italic:0,skew:0},109:{depth:0,height:.44444,italic:0,skew:0},10927:{depth:.19667,height:.69667,italic:0,skew:0},10928:{depth:.19667,height:.69667,italic:0,skew:0},110:{depth:0,height:.44444,italic:0,skew:0},111:{depth:0,height:.44444,italic:0,skew:0},112:{depth:.19444,height:.44444,italic:0,skew:0},113:{depth:.19444,height:.44444,italic:0,skew:0},114:{depth:0,height:.44444,italic:0,skew:0},115:{depth:0,height:.44444,italic:0,skew:0},116:{depth:0,height:.63492,italic:0,skew:0},117:{depth:0,height:.44444,italic:0,skew:0},118:{depth:0,height:.44444,italic:.01597,skew:0},119:{depth:0,height:.44444,italic:.01597,skew:0},120:{depth:0,height:.44444,italic:0,skew:0},121:{depth:.19444,height:.44444,italic:.01597,skew:0},122:{depth:0,height:.44444,italic:0,skew:0},123:{depth:.25,height:.75,italic:0,skew:0},124:{depth:.25,height:.75,italic:0,skew:0},125:{depth:.25,height:.75,italic:0,skew:0},126:{depth:.35,height:.34444,italic:0,skew:0},168:{depth:0,height:.69444,italic:0,skew:0},172:{depth:0,height:.44444,italic:0,skew:0},175:{depth:0,height:.59611,italic:0,skew:0},176:{depth:0,height:.69444,italic:0,skew:0},177:{depth:.13333,height:.63333,italic:0,skew:0},180:{depth:0,height:.69444,italic:0,skew:0},215:{depth:.13333,height:.63333,italic:0,skew:0},247:{depth:.13333,height:.63333,italic:0,skew:0},305:{depth:0,height:.44444,italic:0,skew:0},33:{depth:0,height:.69444,italic:0,skew:0},34:{depth:0,height:.69444,italic:0,skew:0},35:{depth:.19444,height:.69444,italic:0,skew:0},36:{depth:.05556,height:.75,italic:0,skew:0},37:{depth:.05556,height:.75,italic:0,skew:0},38:{depth:0,height:.69444,italic:0,skew:0},39:{depth:0,height:.69444,italic:0,skew:0},40:{depth:.25,height:.75,italic:0,skew:0},41:{depth:.25,height:.75,italic:0,skew:0},42:{depth:0,height:.75,italic:0,skew:0},43:{depth:.13333,height:.63333,italic:0,skew:0},44:{depth:.19444,height:.15556,italic:0,skew:0},45:{depth:0,height:.44444,italic:0,skew:0},46:{depth:0,height:.15556,italic:0,skew:0},47:{depth:.25,height:.75,italic:0,skew:0},48:{depth:0,height:.64444,italic:0,skew:0},49:{depth:0,height:.64444,italic:0,skew:0},50:{depth:0,height:.64444,italic:0,skew:0},51:{depth:0,height:.64444,italic:0,skew:0},52:{depth:0,height:.64444,italic:0,skew:0},53:{depth:0,height:.64444,italic:0,skew:0},54:{depth:0,height:.64444,italic:0,skew:0},55:{depth:0,height:.64444,italic:0,skew:0},56:{depth:0,height:.64444,italic:0,skew:0},567:{depth:.19444,height:.44444,italic:0,skew:0},57:{depth:0,height:.64444,italic:0,skew:0},58:{depth:0,height:.44444,italic:0,skew:0},59:{depth:.19444,height:.44444,italic:0,skew:0},60:{depth:.08556,height:.58556,italic:0,skew:0},61:{depth:-.10889,height:.39111,italic:0,skew:0},62:{depth:.08556,height:.58556,italic:0,skew:0},63:{depth:0,height:.69444,italic:0,skew:0},64:{depth:0,height:.69444,italic:0,skew:0},65:{depth:0,height:.68611,italic:0,skew:0},66:{depth:0,height:.68611,italic:0,skew:0},67:{depth:0,height:.68611,italic:0,skew:0},68:{depth:0,height:.68611,italic:0,skew:0},69:{depth:0,height:.68611,italic:0,skew:0},70:{depth:0,height:.68611,italic:0,skew:0},71:{depth:0,height:.68611,italic:0,skew:0},710:{depth:0,height:.69444,italic:0,skew:0},711:{depth:0,height:.63194,italic:0,skew:0},713:{depth:0,height:.59611,italic:0,skew:0},714:{depth:0,height:.69444,italic:0,skew:0},715:{depth:0,height:.69444,italic:0,skew:0},72:{depth:0,height:.68611,italic:0,skew:0},728:{depth:0,height:.69444,italic:0,skew:0},729:{depth:0,height:.69444,italic:0,skew:0},73:{depth:0,height:.68611,italic:0,skew:0},730:{depth:0,height:.69444,italic:0,skew:0},732:{depth:0,height:.69444,italic:0,skew:0},74:{depth:0,height:.68611,italic:0,skew:0},75:{depth:0,height:.68611,italic:0,skew:0},76:{depth:0,height:.68611,italic:0,skew:0},768:{depth:0,height:.69444,italic:0,skew:0},769:{depth:0,height:.69444,italic:0,skew:0},77:{depth:0,height:.68611,italic:0,skew:0},770:{depth:0,height:.69444,italic:0,skew:0},771:{depth:0,height:.69444,italic:0,skew:0},772:{depth:0,height:.59611,italic:0,skew:0},774:{depth:0,height:.69444,italic:0,skew:0},775:{depth:0,height:.69444,italic:0,skew:0},776:{depth:0,height:.69444,italic:0,skew:0},778:{depth:0,height:.69444,italic:0,skew:0},779:{depth:0,height:.69444,italic:0,skew:0},78:{depth:0,height:.68611,italic:0,skew:0},780:{depth:0,height:.63194,italic:0,skew:0},79:{depth:0,height:.68611,italic:0,skew:0},80:{depth:0,height:.68611,italic:0,skew:0},81:{depth:.19444,height:.68611,italic:0,skew:0},82:{depth:0,height:.68611,italic:0,skew:0},8211:{depth:0,height:.44444,italic:.03194,skew:0},8212:{depth:0,height:.44444,italic:.03194,skew:0},8216:{depth:0,height:.69444,italic:0,skew:0},8217:{depth:0,height:.69444,italic:0,skew:0},8220:{depth:0,height:.69444,italic:0,skew:0},8221:{depth:0,height:.69444,italic:0,skew:0},8224:{depth:.19444,height:.69444,italic:0,skew:0},8225:{depth:.19444,height:.69444,italic:0,skew:0},824:{depth:.19444,height:.69444,italic:0,skew:0},8242:{depth:0,height:.55556,italic:0,skew:0},83:{depth:0,height:.68611,italic:0,skew:0},84:{depth:0,height:.68611,italic:0,skew:0},8407:{depth:0,height:.72444,italic:.15486,skew:0},8463:{depth:0,height:.69444,italic:0,skew:0},8465:{depth:0,height:.69444,italic:0,skew:0},8467:{depth:0,height:.69444,italic:0,skew:0},8472:{depth:.19444,height:.44444,italic:0,skew:0},8476:{depth:0,height:.69444,italic:0,skew:0},85:{depth:0,height:.68611,italic:0,skew:0},8501:{depth:0,height:.69444,italic:0,skew:0},8592:{depth:-.10889,height:.39111,italic:0,skew:0},8593:{depth:.19444,height:.69444,italic:0,skew:0},8594:{depth:-.10889,height:.39111,italic:0,skew:0},8595:{depth:.19444,height:.69444,italic:0,skew:0},8596:{depth:-.10889,height:.39111,italic:0,skew:0},8597:{depth:.25,height:.75,italic:0,skew:0},8598:{depth:.19444,height:.69444,italic:0,skew:0},8599:{depth:.19444,height:.69444,italic:0,skew:0},86:{depth:0,height:.68611,italic:.01597,skew:0},8600:{depth:.19444,height:.69444,italic:0,skew:0},8601:{depth:.19444,height:.69444,italic:0,skew:0},8636:{depth:-.10889,height:.39111,italic:0,skew:0},8637:{depth:-.10889,height:.39111,italic:0,skew:0},8640:{depth:-.10889,height:.39111,italic:0,skew:0},8641:{depth:-.10889,height:.39111,italic:0,skew:0},8656:{depth:-.10889,height:.39111,italic:0,skew:0},8657:{depth:.19444,height:.69444,italic:0,skew:0},8658:{depth:-.10889,height:.39111,italic:0,skew:0},8659:{depth:.19444,height:.69444,italic:0,skew:0},8660:{depth:-.10889,height:.39111,italic:0,skew:0},8661:{depth:.25,height:.75,italic:0,skew:0},87:{depth:0,height:.68611,italic:.01597,skew:0},8704:{depth:0,height:.69444,italic:0,skew:0},8706:{depth:0,height:.69444,italic:.06389,skew:0},8707:{depth:0,height:.69444,italic:0,skew:0},8709:{depth:.05556,height:.75,italic:0,skew:0},8711:{depth:0,height:.68611,italic:0,skew:0},8712:{depth:.08556,height:.58556,italic:0,skew:0},8715:{depth:.08556,height:.58556,italic:0,skew:0},8722:{depth:.13333,height:.63333,italic:0,skew:0},8723:{depth:.13333,height:.63333,italic:0,skew:0},8725:{depth:.25,height:.75,italic:0,skew:0},8726:{depth:.25,height:.75,italic:0,skew:0},8727:{depth:-.02778,height:.47222,italic:0,skew:0},8728:{depth:-.02639,height:.47361,italic:0,skew:0},8729:{depth:-.02639,height:.47361,italic:0,skew:0},8730:{depth:.18,height:.82,italic:0,skew:0},8733:{depth:0,height:.44444,italic:0,skew:0},8734:{depth:0,height:.44444,italic:0,skew:0},8736:{depth:0,height:.69224,italic:0,skew:0},8739:{depth:.25,height:.75,italic:0,skew:0},8741:{depth:.25,height:.75,italic:0,skew:0},8743:{depth:0,height:.55556,italic:0,skew:0},8744:{depth:0,height:.55556,italic:0,skew:0},8745:{depth:0,height:.55556,italic:0,skew:0},8746:{depth:0,height:.55556,italic:0,skew:0},8747:{depth:.19444,height:.69444,italic:.12778,skew:0},8764:{depth:-.10889,height:.39111,italic:0,skew:0},8768:{depth:.19444,height:.69444,italic:0,skew:0},8771:{depth:.00222,height:.50222,italic:0,skew:0},8776:{depth:.02444,height:.52444,italic:0,skew:0},8781:{depth:.00222,height:.50222,italic:0,skew:0},88:{depth:0,height:.68611,italic:0,skew:0},8801:{depth:.00222,height:.50222,italic:0,skew:0},8804:{depth:.19667,height:.69667,italic:0,skew:0},8805:{depth:.19667,height:.69667,italic:0,skew:0},8810:{depth:.08556,height:.58556,italic:0,skew:0},8811:{depth:.08556,height:.58556,italic:0,skew:0},8826:{depth:.08556,height:.58556,italic:0,skew:0},8827:{depth:.08556,height:.58556,italic:0,skew:0},8834:{depth:.08556,height:.58556,italic:0,skew:0},8835:{depth:.08556,height:.58556,italic:0,skew:0},8838:{depth:.19667,height:.69667,italic:0,skew:0},8839:{depth:.19667,height:.69667,italic:0,skew:0},8846:{depth:0,height:.55556,italic:0,skew:0},8849:{depth:.19667,height:.69667,italic:0,skew:0},8850:{depth:.19667,height:.69667,italic:0,skew:0},8851:{depth:0,height:.55556,italic:0,skew:0},8852:{depth:0,height:.55556,italic:0,skew:0},8853:{depth:.13333,height:.63333,italic:0,skew:0},8854:{depth:.13333,height:.63333,italic:0,skew:0},8855:{depth:.13333,height:.63333,italic:0,skew:0},8856:{depth:.13333,height:.63333,italic:0,skew:0},8857:{depth:.13333,height:.63333,italic:0,skew:0},8866:{depth:0,height:.69444,italic:0,skew:0},8867:{depth:0,height:.69444,italic:0,skew:0},8868:{depth:0,height:.69444,italic:0,skew:0},8869:{depth:0,height:.69444,italic:0,skew:0},89:{depth:0,height:.68611,italic:.02875,skew:0},8900:{depth:-.02639,height:.47361,italic:0,skew:0},8901:{depth:-.02639,height:.47361,italic:0,skew:0},8902:{depth:-.02778,height:.47222,italic:0,skew:0},8968:{depth:.25,height:.75,italic:0,skew:0},8969:{depth:.25,height:.75,italic:0,skew:0},8970:{depth:.25,height:.75,italic:0,skew:0},8971:{depth:.25,height:.75,italic:0,skew:0},8994:{depth:-.13889,height:.36111,italic:0,skew:0},8995:{depth:-.13889,height:.36111,italic:0,skew:0},90:{depth:0,height:.68611,italic:0,skew:0},91:{depth:.25,height:.75,italic:0,skew:0},915:{depth:0,height:.68611,italic:0,skew:0},916:{depth:0,height:.68611,italic:0,skew:0},92:{depth:.25,height:.75,italic:0,skew:0},920:{depth:0,height:.68611,italic:0,skew:0},923:{depth:0,height:.68611,italic:0,skew:0},926:{depth:0,height:.68611,italic:0,skew:0},928:{depth:0,height:.68611,italic:0,skew:0},93:{depth:.25,height:.75,italic:0,skew:0},931:{depth:0,height:.68611,italic:0,skew:0},933:{depth:0,height:.68611,italic:0,skew:0},934:{depth:0,height:.68611,italic:0,skew:0},936:{depth:0,height:.68611,italic:0,skew:0},937:{depth:0,height:.68611,italic:0,skew:0},94:{depth:0,height:.69444,italic:0,skew:0},95:{depth:.31,height:.13444,italic:.03194,skew:0},96:{depth:0,height:.69444,italic:0,skew:0},9651:{depth:.19444,height:.69444,italic:0,skew:0},9657:{depth:-.02778,height:.47222,italic:0,skew:0},9661:{depth:.19444,height:.69444,italic:0,skew:0},9667:{depth:-.02778,height:.47222,italic:0,skew:0},97:{depth:0,height:.44444,italic:0,skew:0},9711:{depth:.19444,height:.69444,italic:0,skew:0},98:{depth:0,height:.69444,italic:0,skew:0},9824:{depth:.12963,height:.69444,italic:0,skew:0},9825:{depth:.12963,height:.69444,italic:0,skew:0},9826:{depth:.12963,height:.69444,italic:0,skew:0},9827:{depth:.12963,height:.69444,italic:0,skew:0},9837:{depth:0,height:.75,italic:0,skew:0},9838:{depth:.19444,height:.69444,italic:0,skew:0},9839:{depth:.19444,height:.69444,italic:0,skew:0},99:{depth:0,height:.44444,italic:0,skew:0}},"Main-Italic":{100:{depth:0,height:.69444,italic:.10333,skew:0},101:{depth:0,height:.43056,italic:.07514,skew:0},102:{depth:.19444,height:.69444,italic:.21194,skew:0},103:{depth:.19444,height:.43056,italic:.08847,skew:0},104:{depth:0,height:.69444,italic:.07671,skew:0},105:{depth:0,height:.65536,italic:.1019,skew:0},106:{depth:.19444,height:.65536,italic:.14467,skew:0},107:{depth:0,height:.69444,italic:.10764,skew:0},108:{depth:0,height:.69444,italic:.10333,skew:0},109:{depth:0,height:.43056,italic:.07671,skew:0},110:{depth:0,height:.43056,italic:.07671,skew:0},111:{depth:0,height:.43056,italic:.06312,skew:0},112:{depth:.19444,height:.43056,italic:.06312,skew:0},113:{depth:.19444,height:.43056,italic:.08847,skew:0},114:{depth:0,height:.43056,italic:.10764,skew:0},115:{depth:0,height:.43056,italic:.08208,skew:0},116:{depth:0,height:.61508,italic:.09486,skew:0},117:{depth:0,height:.43056,italic:.07671,skew:0},118:{depth:0,height:.43056,italic:.10764,skew:0},119:{depth:0,height:.43056,italic:.10764,skew:0},120:{depth:0,height:.43056,italic:.12042,skew:0},121:{depth:.19444,height:.43056,italic:.08847,skew:0},122:{depth:0,height:.43056,italic:.12292,skew:0},126:{depth:.35,height:.31786,italic:.11585,skew:0},163:{depth:0,height:.69444,italic:0,skew:0},305:{depth:0,height:.43056,italic:.07671,skew:0},33:{depth:0,height:.69444,italic:.12417,skew:0},34:{depth:0,height:.69444,italic:.06961,skew:0},35:{depth:.19444,height:.69444,italic:.06616,skew:0},37:{depth:.05556,height:.75,italic:.13639,skew:0},38:{depth:0,height:.69444,italic:.09694,skew:0},39:{depth:0,height:.69444,italic:.12417,skew:0},40:{depth:.25,height:.75,italic:.16194,skew:0},41:{depth:.25,height:.75,italic:.03694,skew:0},42:{depth:0,height:.75,italic:.14917,skew:0},43:{depth:.05667,height:.56167,italic:.03694,skew:0},44:{depth:.19444,height:.10556,italic:0,skew:0},45:{depth:0,height:.43056,italic:.02826,skew:0},46:{depth:0,height:.10556,italic:0,skew:0},47:{depth:.25,height:.75,italic:.16194,skew:0},48:{depth:0,height:.64444,italic:.13556,skew:0},49:{depth:0,height:.64444,italic:.13556,skew:0},50:{depth:0,height:.64444,italic:.13556,skew:0},51:{depth:0,height:.64444,italic:.13556,skew:0},52:{depth:.19444,height:.64444,italic:.13556,skew:0},53:{depth:0,height:.64444,italic:.13556,skew:0},54:{depth:0,height:.64444,italic:.13556,skew:0},55:{depth:.19444,height:.64444,italic:.13556,skew:0},56:{depth:0,height:.64444,italic:.13556,skew:0},567:{depth:.19444,height:.43056,italic:.03736,skew:0},57:{depth:0,height:.64444,italic:.13556,skew:0},58:{depth:0,height:.43056,italic:.0582,skew:0},59:{depth:.19444,height:.43056,italic:.0582,skew:0},61:{depth:-.13313,height:.36687,italic:.06616,skew:0},63:{depth:0,height:.69444,italic:.1225,skew:0},64:{depth:0,height:.69444,italic:.09597,skew:0},65:{depth:0,height:.68333,italic:0,skew:0},66:{depth:0,height:.68333,italic:.10257,skew:0},67:{depth:0,height:.68333,italic:.14528,skew:0},68:{depth:0,height:.68333,italic:.09403,skew:0},69:{depth:0,height:.68333,italic:.12028,skew:0},70:{depth:0,height:.68333,italic:.13305,skew:0},71:{depth:0,height:.68333,italic:.08722,skew:0},72:{depth:0,height:.68333,italic:.16389,skew:0},73:{depth:0,height:.68333,italic:.15806,skew:0},74:{depth:0,height:.68333,italic:.14028,skew:0},75:{depth:0,height:.68333,italic:.14528,skew:0},76:{depth:0,height:.68333,italic:0,skew:0},768:{depth:0,height:.69444,italic:0,skew:0},769:{depth:0,height:.69444,italic:.09694,skew:0},77:{depth:0,height:.68333,italic:.16389,skew:0},770:{depth:0,height:.69444,italic:.06646,skew:0},771:{depth:0,height:.66786,italic:.11585,skew:0},772:{depth:0,height:.56167,italic:.10333,skew:0},774:{depth:0,height:.69444,italic:.10806,skew:0},775:{depth:0,height:.66786,italic:.11752,skew:0},776:{depth:0,height:.66786,italic:.10474,skew:0},778:{depth:0,height:.69444,italic:0,skew:0},779:{depth:0,height:.69444,italic:.1225,skew:0},78:{depth:0,height:.68333,italic:.16389,skew:0},780:{depth:0,height:.62847,italic:.08295,skew:0},79:{depth:0,height:.68333,italic:.09403,skew:0},80:{depth:0,height:.68333,italic:.10257,skew:0},81:{depth:.19444,height:.68333,italic:.09403,skew:0},82:{depth:0,height:.68333,italic:.03868,skew:0},8211:{depth:0,height:.43056,italic:.09208,skew:0},8212:{depth:0,height:.43056,italic:.09208,skew:0},8216:{depth:0,height:.69444,italic:.12417,skew:0},8217:{depth:0,height:.69444,italic:.12417,skew:0},8220:{depth:0,height:.69444,italic:.1685,skew:0},8221:{depth:0,height:.69444,italic:.06961,skew:0},83:{depth:0,height:.68333,italic:.11972,skew:0},84:{depth:0,height:.68333,italic:.13305,skew:0},8463:{depth:0,height:.68889,italic:0,skew:0},85:{depth:0,height:.68333,italic:.16389,skew:0},86:{depth:0,height:.68333,italic:.18361,skew:0},87:{depth:0,height:.68333,italic:.18361,skew:0},88:{depth:0,height:.68333,italic:.15806,skew:0},89:{depth:0,height:.68333,italic:.19383,skew:0},90:{depth:0,height:.68333,italic:.14528,skew:0},91:{depth:.25,height:.75,italic:.1875,skew:0},915:{depth:0,height:.68333,italic:.13305,skew:0},916:{depth:0,height:.68333,italic:0,skew:0},920:{depth:0,height:.68333,italic:.09403,skew:0},923:{depth:0,height:.68333,italic:0,skew:0},926:{depth:0,height:.68333,italic:.15294,skew:0},928:{depth:0,height:.68333,italic:.16389,skew:0},93:{depth:.25,height:.75,italic:.10528,skew:0},931:{depth:0,height:.68333,italic:.12028,skew:0},933:{depth:0,height:.68333,italic:.11111,skew:0},934:{depth:0,height:.68333,italic:.05986,skew:0},936:{depth:0,height:.68333,italic:.11111,skew:0},937:{depth:0,height:.68333,
|
||
italic:.10257,skew:0},94:{depth:0,height:.69444,italic:.06646,skew:0},95:{depth:.31,height:.12056,italic:.09208,skew:0},97:{depth:0,height:.43056,italic:.07671,skew:0},98:{depth:0,height:.69444,italic:.06312,skew:0},99:{depth:0,height:.43056,italic:.05653,skew:0}},"Main-Regular":{32:{depth:-0,height:0,italic:0,skew:0},160:{depth:-0,height:0,italic:0,skew:0},8230:{depth:-0,height:.12,italic:0,skew:0},8773:{depth:-.022,height:.589,italic:0,skew:0},8800:{depth:.215,height:.716,italic:0,skew:0},8942:{depth:.03,height:.9,italic:0,skew:0},8943:{depth:-.19,height:.31,italic:0,skew:0},8945:{depth:-.1,height:.82,italic:0,skew:0},100:{depth:0,height:.69444,italic:0,skew:0},101:{depth:0,height:.43056,italic:0,skew:0},102:{depth:0,height:.69444,italic:.07778,skew:0},10216:{depth:.25,height:.75,italic:0,skew:0},10217:{depth:.25,height:.75,italic:0,skew:0},103:{depth:.19444,height:.43056,italic:.01389,skew:0},104:{depth:0,height:.69444,italic:0,skew:0},105:{depth:0,height:.66786,italic:0,skew:0},106:{depth:.19444,height:.66786,italic:0,skew:0},107:{depth:0,height:.69444,italic:0,skew:0},108:{depth:0,height:.69444,italic:0,skew:0},10815:{depth:0,height:.68333,italic:0,skew:0},109:{depth:0,height:.43056,italic:0,skew:0},10927:{depth:.13597,height:.63597,italic:0,skew:0},10928:{depth:.13597,height:.63597,italic:0,skew:0},110:{depth:0,height:.43056,italic:0,skew:0},111:{depth:0,height:.43056,italic:0,skew:0},112:{depth:.19444,height:.43056,italic:0,skew:0},113:{depth:.19444,height:.43056,italic:0,skew:0},114:{depth:0,height:.43056,italic:0,skew:0},115:{depth:0,height:.43056,italic:0,skew:0},116:{depth:0,height:.61508,italic:0,skew:0},117:{depth:0,height:.43056,italic:0,skew:0},118:{depth:0,height:.43056,italic:.01389,skew:0},119:{depth:0,height:.43056,italic:.01389,skew:0},120:{depth:0,height:.43056,italic:0,skew:0},121:{depth:.19444,height:.43056,italic:.01389,skew:0},122:{depth:0,height:.43056,italic:0,skew:0},123:{depth:.25,height:.75,italic:0,skew:0},124:{depth:.25,height:.75,italic:0,skew:0},125:{depth:.25,height:.75,italic:0,skew:0},126:{depth:.35,height:.31786,italic:0,skew:0},168:{depth:0,height:.66786,italic:0,skew:0},172:{depth:0,height:.43056,italic:0,skew:0},175:{depth:0,height:.56778,italic:0,skew:0},176:{depth:0,height:.69444,italic:0,skew:0},177:{depth:.08333,height:.58333,italic:0,skew:0},180:{depth:0,height:.69444,italic:0,skew:0},215:{depth:.08333,height:.58333,italic:0,skew:0},247:{depth:.08333,height:.58333,italic:0,skew:0},305:{depth:0,height:.43056,italic:0,skew:0},33:{depth:0,height:.69444,italic:0,skew:0},34:{depth:0,height:.69444,italic:0,skew:0},35:{depth:.19444,height:.69444,italic:0,skew:0},36:{depth:.05556,height:.75,italic:0,skew:0},37:{depth:.05556,height:.75,italic:0,skew:0},38:{depth:0,height:.69444,italic:0,skew:0},39:{depth:0,height:.69444,italic:0,skew:0},40:{depth:.25,height:.75,italic:0,skew:0},41:{depth:.25,height:.75,italic:0,skew:0},42:{depth:0,height:.75,italic:0,skew:0},43:{depth:.08333,height:.58333,italic:0,skew:0},44:{depth:.19444,height:.10556,italic:0,skew:0},45:{depth:0,height:.43056,italic:0,skew:0},46:{depth:0,height:.10556,italic:0,skew:0},47:{depth:.25,height:.75,italic:0,skew:0},48:{depth:0,height:.64444,italic:0,skew:0},49:{depth:0,height:.64444,italic:0,skew:0},50:{depth:0,height:.64444,italic:0,skew:0},51:{depth:0,height:.64444,italic:0,skew:0},52:{depth:0,height:.64444,italic:0,skew:0},53:{depth:0,height:.64444,italic:0,skew:0},54:{depth:0,height:.64444,italic:0,skew:0},55:{depth:0,height:.64444,italic:0,skew:0},56:{depth:0,height:.64444,italic:0,skew:0},567:{depth:.19444,height:.43056,italic:0,skew:0},57:{depth:0,height:.64444,italic:0,skew:0},58:{depth:0,height:.43056,italic:0,skew:0},59:{depth:.19444,height:.43056,italic:0,skew:0},60:{depth:.0391,height:.5391,italic:0,skew:0},61:{depth:-.13313,height:.36687,italic:0,skew:0},62:{depth:.0391,height:.5391,italic:0,skew:0},63:{depth:0,height:.69444,italic:0,skew:0},64:{depth:0,height:.69444,italic:0,skew:0},65:{depth:0,height:.68333,italic:0,skew:0},66:{depth:0,height:.68333,italic:0,skew:0},67:{depth:0,height:.68333,italic:0,skew:0},68:{depth:0,height:.68333,italic:0,skew:0},69:{depth:0,height:.68333,italic:0,skew:0},70:{depth:0,height:.68333,italic:0,skew:0},71:{depth:0,height:.68333,italic:0,skew:0},710:{depth:0,height:.69444,italic:0,skew:0},711:{depth:0,height:.62847,italic:0,skew:0},713:{depth:0,height:.56778,italic:0,skew:0},714:{depth:0,height:.69444,italic:0,skew:0},715:{depth:0,height:.69444,italic:0,skew:0},72:{depth:0,height:.68333,italic:0,skew:0},728:{depth:0,height:.69444,italic:0,skew:0},729:{depth:0,height:.66786,italic:0,skew:0},73:{depth:0,height:.68333,italic:0,skew:0},730:{depth:0,height:.69444,italic:0,skew:0},732:{depth:0,height:.66786,italic:0,skew:0},74:{depth:0,height:.68333,italic:0,skew:0},75:{depth:0,height:.68333,italic:0,skew:0},76:{depth:0,height:.68333,italic:0,skew:0},768:{depth:0,height:.69444,italic:0,skew:0},769:{depth:0,height:.69444,italic:0,skew:0},77:{depth:0,height:.68333,italic:0,skew:0},770:{depth:0,height:.69444,italic:0,skew:0},771:{depth:0,height:.66786,italic:0,skew:0},772:{depth:0,height:.56778,italic:0,skew:0},774:{depth:0,height:.69444,italic:0,skew:0},775:{depth:0,height:.66786,italic:0,skew:0},776:{depth:0,height:.66786,italic:0,skew:0},778:{depth:0,height:.69444,italic:0,skew:0},779:{depth:0,height:.69444,italic:0,skew:0},78:{depth:0,height:.68333,italic:0,skew:0},780:{depth:0,height:.62847,italic:0,skew:0},79:{depth:0,height:.68333,italic:0,skew:0},80:{depth:0,height:.68333,italic:0,skew:0},81:{depth:.19444,height:.68333,italic:0,skew:0},82:{depth:0,height:.68333,italic:0,skew:0},8211:{depth:0,height:.43056,italic:.02778,skew:0},8212:{depth:0,height:.43056,italic:.02778,skew:0},8216:{depth:0,height:.69444,italic:0,skew:0},8217:{depth:0,height:.69444,italic:0,skew:0},8220:{depth:0,height:.69444,italic:0,skew:0},8221:{depth:0,height:.69444,italic:0,skew:0},8224:{depth:.19444,height:.69444,italic:0,skew:0},8225:{depth:.19444,height:.69444,italic:0,skew:0},824:{depth:.19444,height:.69444,italic:0,skew:0},8242:{depth:0,height:.55556,italic:0,skew:0},83:{depth:0,height:.68333,italic:0,skew:0},84:{depth:0,height:.68333,italic:0,skew:0},8407:{depth:0,height:.71444,italic:.15382,skew:0},8463:{depth:0,height:.68889,italic:0,skew:0},8465:{depth:0,height:.69444,italic:0,skew:0},8467:{depth:0,height:.69444,italic:0,skew:.11111},8472:{depth:.19444,height:.43056,italic:0,skew:.11111},8476:{depth:0,height:.69444,italic:0,skew:0},85:{depth:0,height:.68333,italic:0,skew:0},8501:{depth:0,height:.69444,italic:0,skew:0},8592:{depth:-.13313,height:.36687,italic:0,skew:0},8593:{depth:.19444,height:.69444,italic:0,skew:0},8594:{depth:-.13313,height:.36687,italic:0,skew:0},8595:{depth:.19444,height:.69444,italic:0,skew:0},8596:{depth:-.13313,height:.36687,italic:0,skew:0},8597:{depth:.25,height:.75,italic:0,skew:0},8598:{depth:.19444,height:.69444,italic:0,skew:0},8599:{depth:.19444,height:.69444,italic:0,skew:0},86:{depth:0,height:.68333,italic:.01389,skew:0},8600:{depth:.19444,height:.69444,italic:0,skew:0},8601:{depth:.19444,height:.69444,italic:0,skew:0},8636:{depth:-.13313,height:.36687,italic:0,skew:0},8637:{depth:-.13313,height:.36687,italic:0,skew:0},8640:{depth:-.13313,height:.36687,italic:0,skew:0},8641:{depth:-.13313,height:.36687,italic:0,skew:0},8656:{depth:-.13313,height:.36687,italic:0,skew:0},8657:{depth:.19444,height:.69444,italic:0,skew:0},8658:{depth:-.13313,height:.36687,italic:0,skew:0},8659:{depth:.19444,height:.69444,italic:0,skew:0},8660:{depth:-.13313,height:.36687,italic:0,skew:0},8661:{depth:.25,height:.75,italic:0,skew:0},87:{depth:0,height:.68333,italic:.01389,skew:0},8704:{depth:0,height:.69444,italic:0,skew:0},8706:{depth:0,height:.69444,italic:.05556,skew:.08334},8707:{depth:0,height:.69444,italic:0,skew:0},8709:{depth:.05556,height:.75,italic:0,skew:0},8711:{depth:0,height:.68333,italic:0,skew:0},8712:{depth:.0391,height:.5391,italic:0,skew:0},8715:{depth:.0391,height:.5391,italic:0,skew:0},8722:{depth:.08333,height:.58333,italic:0,skew:0},8723:{depth:.08333,height:.58333,italic:0,skew:0},8725:{depth:.25,height:.75,italic:0,skew:0},8726:{depth:.25,height:.75,italic:0,skew:0},8727:{depth:-.03472,height:.46528,italic:0,skew:0},8728:{depth:-.05555,height:.44445,italic:0,skew:0},8729:{depth:-.05555,height:.44445,italic:0,skew:0},8730:{depth:.2,height:.8,italic:0,skew:0},8733:{depth:0,height:.43056,italic:0,skew:0},8734:{depth:0,height:.43056,italic:0,skew:0},8736:{depth:0,height:.69224,italic:0,skew:0},8739:{depth:.25,height:.75,italic:0,skew:0},8741:{depth:.25,height:.75,italic:0,skew:0},8743:{depth:0,height:.55556,italic:0,skew:0},8744:{depth:0,height:.55556,italic:0,skew:0},8745:{depth:0,height:.55556,italic:0,skew:0},8746:{depth:0,height:.55556,italic:0,skew:0},8747:{depth:.19444,height:.69444,italic:.11111,skew:0},8764:{depth:-.13313,height:.36687,italic:0,skew:0},8768:{depth:.19444,height:.69444,italic:0,skew:0},8771:{depth:-.03625,height:.46375,italic:0,skew:0},8776:{depth:-.01688,height:.48312,italic:0,skew:0},8781:{depth:-.03625,height:.46375,italic:0,skew:0},88:{depth:0,height:.68333,italic:0,skew:0},8801:{depth:-.03625,height:.46375,italic:0,skew:0},8804:{depth:.13597,height:.63597,italic:0,skew:0},8805:{depth:.13597,height:.63597,italic:0,skew:0},8810:{depth:.0391,height:.5391,italic:0,skew:0},8811:{depth:.0391,height:.5391,italic:0,skew:0},8826:{depth:.0391,height:.5391,italic:0,skew:0},8827:{depth:.0391,height:.5391,italic:0,skew:0},8834:{depth:.0391,height:.5391,italic:0,skew:0},8835:{depth:.0391,height:.5391,italic:0,skew:0},8838:{depth:.13597,height:.63597,italic:0,skew:0},8839:{depth:.13597,height:.63597,italic:0,skew:0},8846:{depth:0,height:.55556,italic:0,skew:0},8849:{depth:.13597,height:.63597,italic:0,skew:0},8850:{depth:.13597,height:.63597,italic:0,skew:0},8851:{depth:0,height:.55556,italic:0,skew:0},8852:{depth:0,height:.55556,italic:0,skew:0},8853:{depth:.08333,height:.58333,italic:0,skew:0},8854:{depth:.08333,height:.58333,italic:0,skew:0},8855:{depth:.08333,height:.58333,italic:0,skew:0},8856:{depth:.08333,height:.58333,italic:0,skew:0},8857:{depth:.08333,height:.58333,italic:0,skew:0},8866:{depth:0,height:.69444,italic:0,skew:0},8867:{depth:0,height:.69444,italic:0,skew:0},8868:{depth:0,height:.69444,italic:0,skew:0},8869:{depth:0,height:.69444,italic:0,skew:0},89:{depth:0,height:.68333,italic:.025,skew:0},8900:{depth:-.05555,height:.44445,italic:0,skew:0},8901:{depth:-.05555,height:.44445,italic:0,skew:0},8902:{depth:-.03472,height:.46528,italic:0,skew:0},8968:{depth:.25,height:.75,italic:0,skew:0},8969:{depth:.25,height:.75,italic:0,skew:0},8970:{depth:.25,height:.75,italic:0,skew:0},8971:{depth:.25,height:.75,italic:0,skew:0},8994:{depth:-.14236,height:.35764,italic:0,skew:0},8995:{depth:-.14236,height:.35764,italic:0,skew:0},90:{depth:0,height:.68333,italic:0,skew:0},91:{depth:.25,height:.75,italic:0,skew:0},915:{depth:0,height:.68333,italic:0,skew:0},916:{depth:0,height:.68333,italic:0,skew:0},92:{depth:.25,height:.75,italic:0,skew:0},920:{depth:0,height:.68333,italic:0,skew:0},923:{depth:0,height:.68333,italic:0,skew:0},926:{depth:0,height:.68333,italic:0,skew:0},928:{depth:0,height:.68333,italic:0,skew:0},93:{depth:.25,height:.75,italic:0,skew:0},931:{depth:0,height:.68333,italic:0,skew:0},933:{depth:0,height:.68333,italic:0,skew:0},934:{depth:0,height:.68333,italic:0,skew:0},936:{depth:0,height:.68333,italic:0,skew:0},937:{depth:0,height:.68333,italic:0,skew:0},94:{depth:0,height:.69444,italic:0,skew:0},95:{depth:.31,height:.12056,italic:.02778,skew:0},96:{depth:0,height:.69444,italic:0,skew:0},9651:{depth:.19444,height:.69444,italic:0,skew:0},9657:{depth:-.03472,height:.46528,italic:0,skew:0},9661:{depth:.19444,height:.69444,italic:0,skew:0},9667:{depth:-.03472,height:.46528,italic:0,skew:0},97:{depth:0,height:.43056,italic:0,skew:0},9711:{depth:.19444,height:.69444,italic:0,skew:0},98:{depth:0,height:.69444,italic:0,skew:0},9824:{depth:.12963,height:.69444,italic:0,skew:0},9825:{depth:.12963,height:.69444,italic:0,skew:0},9826:{depth:.12963,height:.69444,italic:0,skew:0},9827:{depth:.12963,height:.69444,italic:0,skew:0},9837:{depth:0,height:.75,italic:0,skew:0},9838:{depth:.19444,height:.69444,italic:0,skew:0},9839:{depth:.19444,height:.69444,italic:0,skew:0},99:{depth:0,height:.43056,italic:0,skew:0}},"Math-BoldItalic":{100:{depth:0,height:.69444,italic:0,skew:0},1009:{depth:.19444,height:.44444,italic:0,skew:0},101:{depth:0,height:.44444,italic:0,skew:0},1013:{depth:0,height:.44444,italic:0,skew:0},102:{depth:.19444,height:.69444,italic:.11042,skew:0},103:{depth:.19444,height:.44444,italic:.03704,skew:0},104:{depth:0,height:.69444,italic:0,skew:0},105:{depth:0,height:.69326,italic:0,skew:0},106:{depth:.19444,height:.69326,italic:.0622,skew:0},107:{depth:0,height:.69444,italic:.01852,skew:0},108:{depth:0,height:.69444,italic:.0088,skew:0},109:{depth:0,height:.44444,italic:0,skew:0},110:{depth:0,height:.44444,italic:0,skew:0},111:{depth:0,height:.44444,italic:0,skew:0},112:{depth:.19444,height:.44444,italic:0,skew:0},113:{depth:.19444,height:.44444,italic:.03704,skew:0},114:{depth:0,height:.44444,italic:.03194,skew:0},115:{depth:0,height:.44444,italic:0,skew:0},116:{depth:0,height:.63492,italic:0,skew:0},117:{depth:0,height:.44444,italic:0,skew:0},118:{depth:0,height:.44444,italic:.03704,skew:0},119:{depth:0,height:.44444,italic:.02778,skew:0},120:{depth:0,height:.44444,italic:0,skew:0},121:{depth:.19444,height:.44444,italic:.03704,skew:0},122:{depth:0,height:.44444,italic:.04213,skew:0},47:{depth:.19444,height:.69444,italic:0,skew:0},65:{depth:0,height:.68611,italic:0,skew:0},66:{depth:0,height:.68611,italic:.04835,skew:0},67:{depth:0,height:.68611,italic:.06979,skew:0},68:{depth:0,height:.68611,italic:.03194,skew:0},69:{depth:0,height:.68611,italic:.05451,skew:0},70:{depth:0,height:.68611,italic:.15972,skew:0},71:{depth:0,height:.68611,italic:0,skew:0},72:{depth:0,height:.68611,italic:.08229,skew:0},73:{depth:0,height:.68611,italic:.07778,skew:0},74:{depth:0,height:.68611,italic:.10069,skew:0},75:{depth:0,height:.68611,italic:.06979,skew:0},76:{depth:0,height:.68611,italic:0,skew:0},77:{depth:0,height:.68611,italic:.11424,skew:0},78:{depth:0,height:.68611,italic:.11424,skew:0},79:{depth:0,height:.68611,italic:.03194,skew:0},80:{depth:0,height:.68611,italic:.15972,skew:0},81:{depth:.19444,height:.68611,italic:0,skew:0},82:{depth:0,height:.68611,italic:.00421,skew:0},83:{depth:0,height:.68611,italic:.05382,skew:0},84:{depth:0,height:.68611,italic:.15972,skew:0},85:{depth:0,height:.68611,italic:.11424,skew:0},86:{depth:0,height:.68611,italic:.25555,skew:0},87:{depth:0,height:.68611,italic:.15972,skew:0},88:{depth:0,height:.68611,italic:.07778,skew:0},89:{depth:0,height:.68611,italic:.25555,skew:0},90:{depth:0,height:.68611,italic:.06979,skew:0},915:{depth:0,height:.68611,italic:.15972,skew:0},916:{depth:0,height:.68611,italic:0,skew:0},920:{depth:0,height:.68611,italic:.03194,skew:0},923:{depth:0,height:.68611,italic:0,skew:0},926:{depth:0,height:.68611,italic:.07458,skew:0},928:{depth:0,height:.68611,italic:.08229,skew:0},931:{depth:0,height:.68611,italic:.05451,skew:0},933:{depth:0,height:.68611,italic:.15972,skew:0},934:{depth:0,height:.68611,italic:0,skew:0},936:{depth:0,height:.68611,italic:.11653,skew:0},937:{depth:0,height:.68611,italic:.04835,skew:0},945:{depth:0,height:.44444,italic:0,skew:0},946:{depth:.19444,height:.69444,italic:.03403,skew:0},947:{depth:.19444,height:.44444,italic:.06389,skew:0},948:{depth:0,height:.69444,italic:.03819,skew:0},949:{depth:0,height:.44444,italic:0,skew:0},950:{depth:.19444,height:.69444,italic:.06215,skew:0},951:{depth:.19444,height:.44444,italic:.03704,skew:0},952:{depth:0,height:.69444,italic:.03194,skew:0},953:{depth:0,height:.44444,italic:0,skew:0},954:{depth:0,height:.44444,italic:0,skew:0},955:{depth:0,height:.69444,italic:0,skew:0},956:{depth:.19444,height:.44444,italic:0,skew:0},957:{depth:0,height:.44444,italic:.06898,skew:0},958:{depth:.19444,height:.69444,italic:.03021,skew:0},959:{depth:0,height:.44444,italic:0,skew:0},960:{depth:0,height:.44444,italic:.03704,skew:0},961:{depth:.19444,height:.44444,italic:0,skew:0},962:{depth:.09722,height:.44444,italic:.07917,skew:0},963:{depth:0,height:.44444,italic:.03704,skew:0},964:{depth:0,height:.44444,italic:.13472,skew:0},965:{depth:0,height:.44444,italic:.03704,skew:0},966:{depth:.19444,height:.44444,italic:0,skew:0},967:{depth:.19444,height:.44444,italic:0,skew:0},968:{depth:.19444,height:.69444,italic:.03704,skew:0},969:{depth:0,height:.44444,italic:.03704,skew:0},97:{depth:0,height:.44444,italic:0,skew:0},977:{depth:0,height:.69444,italic:0,skew:0},98:{depth:0,height:.69444,italic:0,skew:0},981:{depth:.19444,height:.69444,italic:0,skew:0},982:{depth:0,height:.44444,italic:.03194,skew:0},99:{depth:0,height:.44444,italic:0,skew:0}},"Math-Italic":{100:{depth:0,height:.69444,italic:0,skew:.16667},1009:{depth:.19444,height:.43056,italic:0,skew:.08334},101:{depth:0,height:.43056,italic:0,skew:.05556},1013:{depth:0,height:.43056,italic:0,skew:.05556},102:{depth:.19444,height:.69444,italic:.10764,skew:.16667},103:{depth:.19444,height:.43056,italic:.03588,skew:.02778},104:{depth:0,height:.69444,italic:0,skew:0},105:{depth:0,height:.65952,italic:0,skew:0},106:{depth:.19444,height:.65952,italic:.05724,skew:0},107:{depth:0,height:.69444,italic:.03148,skew:0},108:{depth:0,height:.69444,italic:.01968,skew:.08334},109:{depth:0,height:.43056,italic:0,skew:0},110:{depth:0,height:.43056,italic:0,skew:0},111:{depth:0,height:.43056,italic:0,skew:.05556},112:{depth:.19444,height:.43056,italic:0,skew:.08334},113:{depth:.19444,height:.43056,italic:.03588,skew:.08334},114:{depth:0,height:.43056,italic:.02778,skew:.05556},115:{depth:0,height:.43056,italic:0,skew:.05556},116:{depth:0,height:.61508,italic:0,skew:.08334},117:{depth:0,height:.43056,italic:0,skew:.02778},118:{depth:0,height:.43056,italic:.03588,skew:.02778},119:{depth:0,height:.43056,italic:.02691,skew:.08334},120:{depth:0,height:.43056,italic:0,skew:.02778},121:{depth:.19444,height:.43056,italic:.03588,skew:.05556},122:{depth:0,height:.43056,italic:.04398,skew:.05556},47:{depth:.19444,height:.69444,italic:0,skew:0},65:{depth:0,height:.68333,italic:0,skew:.13889},66:{depth:0,height:.68333,italic:.05017,skew:.08334},67:{depth:0,height:.68333,italic:.07153,skew:.08334},68:{depth:0,height:.68333,italic:.02778,skew:.05556},69:{depth:0,height:.68333,italic:.05764,skew:.08334},70:{depth:0,height:.68333,italic:.13889,skew:.08334},71:{depth:0,height:.68333,italic:0,skew:.08334},72:{depth:0,height:.68333,italic:.08125,skew:.05556},73:{depth:0,height:.68333,italic:.07847,skew:.11111},74:{depth:0,height:.68333,italic:.09618,skew:.16667},75:{depth:0,height:.68333,italic:.07153,skew:.05556},76:{depth:0,height:.68333,italic:0,skew:.02778},77:{depth:0,height:.68333,italic:.10903,skew:.08334},78:{depth:0,height:.68333,italic:.10903,skew:.08334},79:{depth:0,height:.68333,italic:.02778,skew:.08334},80:{depth:0,height:.68333,italic:.13889,skew:.08334},81:{depth:.19444,height:.68333,italic:0,skew:.08334},82:{depth:0,height:.68333,italic:.00773,skew:.08334},83:{depth:0,height:.68333,italic:.05764,skew:.08334},84:{depth:0,height:.68333,italic:.13889,skew:.08334},85:{depth:0,height:.68333,italic:.10903,skew:.02778},86:{depth:0,height:.68333,italic:.22222,skew:0},87:{depth:0,height:.68333,italic:.13889,skew:0},88:{depth:0,height:.68333,italic:.07847,skew:.08334},89:{depth:0,height:.68333,italic:.22222,skew:0},90:{depth:0,height:.68333,italic:.07153,skew:.08334},915:{depth:0,height:.68333,italic:.13889,skew:.08334},916:{depth:0,height:.68333,italic:0,skew:.16667},920:{depth:0,height:.68333,italic:.02778,skew:.08334},923:{depth:0,height:.68333,italic:0,skew:.16667},926:{depth:0,height:.68333,italic:.07569,skew:.08334},928:{depth:0,height:.68333,italic:.08125,skew:.05556},931:{depth:0,height:.68333,italic:.05764,skew:.08334},933:{depth:0,height:.68333,italic:.13889,skew:.05556},934:{depth:0,height:.68333,italic:0,skew:.08334},936:{depth:0,height:.68333,italic:.11,skew:.05556},937:{depth:0,height:.68333,italic:.05017,skew:.08334},945:{depth:0,height:.43056,italic:.0037,skew:.02778},946:{depth:.19444,height:.69444,italic:.05278,skew:.08334},947:{depth:.19444,height:.43056,italic:.05556,skew:0},948:{depth:0,height:.69444,italic:.03785,skew:.05556},949:{depth:0,height:.43056,italic:0,skew:.08334},950:{depth:.19444,height:.69444,italic:.07378,skew:.08334},951:{depth:.19444,height:.43056,italic:.03588,skew:.05556},952:{depth:0,height:.69444,italic:.02778,skew:.08334},953:{depth:0,height:.43056,italic:0,skew:.05556},954:{depth:0,height:.43056,italic:0,skew:0},955:{depth:0,height:.69444,italic:0,skew:0},956:{depth:.19444,height:.43056,italic:0,skew:.02778},957:{depth:0,height:.43056,italic:.06366,skew:.02778},958:{depth:.19444,height:.69444,italic:.04601,skew:.11111},959:{depth:0,height:.43056,italic:0,skew:.05556},960:{depth:0,height:.43056,italic:.03588,skew:0},961:{depth:.19444,height:.43056,italic:0,skew:.08334},962:{depth:.09722,height:.43056,italic:.07986,skew:.08334},963:{depth:0,height:.43056,italic:.03588,skew:0},964:{depth:0,height:.43056,italic:.1132,skew:.02778},965:{depth:0,height:.43056,italic:.03588,skew:.02778},966:{depth:.19444,height:.43056,italic:0,skew:.08334},967:{depth:.19444,height:.43056,italic:0,skew:.05556},968:{depth:.19444,height:.69444,italic:.03588,skew:.11111},969:{depth:0,height:.43056,italic:.03588,skew:0},97:{depth:0,height:.43056,italic:0,skew:0},977:{depth:0,height:.69444,italic:0,skew:.08334},98:{depth:0,height:.69444,italic:0,skew:0},981:{depth:.19444,height:.69444,italic:0,skew:.08334},982:{depth:0,height:.43056,italic:.02778,skew:0},99:{depth:0,height:.43056,italic:0,skew:.05556}},"Math-Regular":{100:{depth:0,height:.69444,italic:0,skew:.16667},1009:{depth:.19444,height:.43056,italic:0,skew:.08334},101:{depth:0,height:.43056,italic:0,skew:.05556},1013:{depth:0,height:.43056,italic:0,skew:.05556},102:{depth:.19444,height:.69444,italic:.10764,skew:.16667},103:{depth:.19444,height:.43056,italic:.03588,skew:.02778},104:{depth:0,height:.69444,italic:0,skew:0},105:{depth:0,height:.65952,italic:0,skew:0},106:{depth:.19444,height:.65952,italic:.05724,skew:0},107:{depth:0,height:.69444,italic:.03148,skew:0},108:{depth:0,height:.69444,italic:.01968,skew:.08334},109:{depth:0,height:.43056,italic:0,skew:0},110:{depth:0,height:.43056,italic:0,skew:0},111:{depth:0,height:.43056,italic:0,skew:.05556},112:{depth:.19444,height:.43056,italic:0,skew:.08334},113:{depth:.19444,height:.43056,italic:.03588,skew:.08334},114:{depth:0,height:.43056,italic:.02778,skew:.05556},115:{depth:0,height:.43056,italic:0,skew:.05556},116:{depth:0,height:.61508,italic:0,skew:.08334},117:{depth:0,height:.43056,italic:0,skew:.02778},118:{depth:0,height:.43056,italic:.03588,skew:.02778},119:{depth:0,height:.43056,italic:.02691,skew:.08334},120:{depth:0,height:.43056,italic:0,skew:.02778},121:{depth:.19444,height:.43056,italic:.03588,skew:.05556},122:{depth:0,height:.43056,italic:.04398,skew:.05556},65:{depth:0,height:.68333,italic:0,skew:.13889},66:{depth:0,height:.68333,italic:.05017,skew:.08334},67:{depth:0,height:.68333,italic:.07153,skew:.08334},68:{depth:0,height:.68333,italic:.02778,skew:.05556},69:{depth:0,height:.68333,italic:.05764,skew:.08334},70:{depth:0,height:.68333,italic:.13889,skew:.08334},71:{depth:0,height:.68333,italic:0,skew:.08334},72:{depth:0,height:.68333,italic:.08125,skew:.05556},73:{depth:0,height:.68333,italic:.07847,skew:.11111},74:{depth:0,height:.68333,italic:.09618,skew:.16667},75:{depth:0,height:.68333,italic:.07153,skew:.05556},76:{depth:0,height:.68333,italic:0,skew:.02778},77:{depth:0,height:.68333,italic:.10903,skew:.08334},78:{depth:0,height:.68333,italic:.10903,skew:.08334},79:{depth:0,height:.68333,italic:.02778,skew:.08334},80:{depth:0,height:.68333,italic:.13889,skew:.08334},81:{depth:.19444,height:.68333,italic:0,skew:.08334},82:{depth:0,height:.68333,italic:.00773,skew:.08334},83:{depth:0,height:.68333,italic:.05764,skew:.08334},84:{depth:0,height:.68333,italic:.13889,skew:.08334},85:{depth:0,height:.68333,italic:.10903,skew:.02778},86:{depth:0,height:.68333,italic:.22222,skew:0},87:{depth:0,height:.68333,italic:.13889,skew:0},88:{depth:0,height:.68333,italic:.07847,skew:.08334},89:{depth:0,height:.68333,italic:.22222,skew:0},90:{depth:0,height:.68333,italic:.07153,skew:.08334},915:{depth:0,height:.68333,italic:.13889,skew:.08334},916:{depth:0,height:.68333,italic:0,skew:.16667},920:{depth:0,height:.68333,italic:.02778,skew:.08334},923:{depth:0,height:.68333,italic:0,skew:.16667},926:{depth:0,height:.68333,italic:.07569,skew:.08334},928:{depth:0,height:.68333,italic:.08125,skew:.05556},931:{depth:0,height:.68333,italic:.05764,skew:.08334},933:{depth:0,height:.68333,italic:.13889,skew:.05556},934:{depth:0,height:.68333,italic:0,skew:.08334},936:{depth:0,height:.68333,italic:.11,skew:.05556},937:{depth:0,height:.68333,italic:.05017,skew:.08334},945:{depth:0,height:.43056,italic:.0037,skew:.02778},946:{depth:.19444,height:.69444,italic:.05278,skew:.08334},947:{depth:.19444,height:.43056,italic:.05556,skew:0},948:{depth:0,height:.69444,italic:.03785,skew:.05556},949:{depth:0,height:.43056,italic:0,skew:.08334},950:{depth:.19444,height:.69444,italic:.07378,skew:.08334},951:{depth:.19444,height:.43056,italic:.03588,skew:.05556},952:{depth:0,height:.69444,italic:.02778,skew:.08334},953:{depth:0,height:.43056,italic:0,skew:.05556},954:{depth:0,height:.43056,italic:0,skew:0},955:{depth:0,height:.69444,italic:0,skew:0},956:{depth:.19444,height:.43056,italic:0,skew:.02778},957:{depth:0,height:.43056,italic:.06366,skew:.02778},958:{depth:.19444,height:.69444,italic:.04601,skew:.11111},959:{depth:0,height:.43056,italic:0,skew:.05556},960:{depth:0,height:.43056,italic:.03588,skew:0},961:{depth:.19444,height:.43056,italic:0,skew:.08334},962:{depth:.09722,height:.43056,italic:.07986,skew:.08334},963:{depth:0,height:.43056,italic:.03588,skew:0},964:{depth:0,height:.43056,italic:.1132,skew:.02778},965:{depth:0,height:.43056,italic:.03588,skew:.02778},966:{depth:.19444,height:.43056,italic:0,skew:.08334},967:{depth:.19444,height:.43056,italic:0,skew:.05556},968:{depth:.19444,height:.69444,italic:.03588,skew:.11111},969:{depth:0,height:.43056,italic:.03588,skew:0},97:{depth:0,height:.43056,italic:0,skew:0},977:{depth:0,height:.69444,italic:0,skew:.08334},98:{depth:0,height:.69444,italic:0,skew:0},981:{depth:.19444,height:.69444,italic:0,skew:.08334},982:{depth:0,height:.43056,italic:.02778,skew:0},99:{depth:0,height:.43056,italic:0,skew:.05556}},"Size1-Regular":{8748:{depth:.306,height:.805,italic:.19445,skew:0},8749:{depth:.306,height:.805,italic:.19445,skew:0},10216:{depth:.35001,height:.85,italic:0,skew:0},10217:{depth:.35001,height:.85,italic:0,skew:0},10752:{depth:.25001,height:.75,italic:0,skew:0},10753:{depth:.25001,height:.75,italic:0,skew:0},10754:{depth:.25001,height:.75,italic:0,skew:0},10756:{depth:.25001,height:.75,italic:0,skew:0},10758:{depth:.25001,height:.75,italic:0,skew:0},123:{depth:.35001,height:.85,italic:0,skew:0},125:{depth:.35001,height:.85,italic:0,skew:0},40:{depth:.35001,height:.85,italic:0,skew:0},41:{depth:.35001,height:.85,italic:0,skew:0},47:{depth:.35001,height:.85,italic:0,skew:0},710:{depth:0,height:.72222,italic:0,skew:0},732:{depth:0,height:.72222,italic:0,skew:0},770:{depth:0,height:.72222,italic:0,skew:0},771:{depth:0,height:.72222,italic:0,skew:0},8214:{depth:-99e-5,height:.601,italic:0,skew:0},8593:{depth:1e-5,height:.6,italic:0,skew:0},8595:{depth:1e-5,height:.6,italic:0,skew:0},8657:{depth:1e-5,height:.6,italic:0,skew:0},8659:{depth:1e-5,height:.6,italic:0,skew:0},8719:{depth:.25001,height:.75,italic:0,skew:0},8720:{depth:.25001,height:.75,italic:0,skew:0},8721:{depth:.25001,height:.75,italic:0,skew:0},8730:{depth:.35001,height:.85,italic:0,skew:0},8739:{depth:-.00599,height:.606,italic:0,skew:0},8741:{depth:-.00599,height:.606,italic:0,skew:0},8747:{depth:.30612,height:.805,italic:.19445,skew:0},8750:{depth:.30612,height:.805,italic:.19445,skew:0},8896:{depth:.25001,height:.75,italic:0,skew:0},8897:{depth:.25001,height:.75,italic:0,skew:0},8898:{depth:.25001,height:.75,italic:0,skew:0},8899:{depth:.25001,height:.75,italic:0,skew:0},8968:{depth:.35001,height:.85,italic:0,skew:0},8969:{depth:.35001,height:.85,italic:0,skew:0},8970:{depth:.35001,height:.85,italic:0,skew:0},8971:{depth:.35001,height:.85,italic:0,skew:0},91:{depth:.35001,height:.85,italic:0,skew:0},9168:{depth:-99e-5,height:.601,italic:0,skew:0},92:{depth:.35001,height:.85,italic:0,skew:0},93:{depth:.35001,height:.85,italic:0,skew:0}},"Size2-Regular":{8748:{depth:.862,height:1.36,italic:.44445,skew:0},8749:{depth:.862,height:1.36,italic:.44445,skew:0},10216:{depth:.65002,height:1.15,italic:0,skew:0},10217:{depth:.65002,height:1.15,italic:0,skew:0},10752:{depth:.55001,height:1.05,italic:0,skew:0},10753:{depth:.55001,height:1.05,italic:0,skew:0},10754:{depth:.55001,height:1.05,italic:0,skew:0},10756:{depth:.55001,height:1.05,italic:0,skew:0},10758:{depth:.55001,height:1.05,italic:0,skew:0},123:{depth:.65002,height:1.15,italic:0,skew:0},125:{depth:.65002,height:1.15,italic:0,skew:0},40:{depth:.65002,height:1.15,italic:0,skew:0},41:{depth:.65002,height:1.15,italic:0,skew:0},47:{depth:.65002,height:1.15,italic:0,skew:0},710:{depth:0,height:.75,italic:0,skew:0},732:{depth:0,height:.75,italic:0,skew:0},770:{depth:0,height:.75,italic:0,skew:0},771:{depth:0,height:.75,italic:0,skew:0},8719:{depth:.55001,height:1.05,italic:0,skew:0},8720:{depth:.55001,height:1.05,italic:0,skew:0},8721:{depth:.55001,height:1.05,italic:0,skew:0},8730:{depth:.65002,height:1.15,italic:0,skew:0},8747:{depth:.86225,height:1.36,italic:.44445,skew:0},8750:{depth:.86225,height:1.36,italic:.44445,skew:0},8896:{depth:.55001,height:1.05,italic:0,skew:0},8897:{depth:.55001,height:1.05,italic:0,skew:0},8898:{depth:.55001,height:1.05,italic:0,skew:0},8899:{depth:.55001,height:1.05,italic:0,skew:0},8968:{depth:.65002,height:1.15,italic:0,skew:0},8969:{depth:.65002,height:1.15,italic:0,skew:0},8970:{depth:.65002,height:1.15,italic:0,skew:0},8971:{depth:.65002,height:1.15,italic:0,skew:0},91:{depth:.65002,height:1.15,italic:0,skew:0},92:{depth:.65002,height:1.15,italic:0,skew:0},93:{depth:.65002,height:1.15,italic:0,skew:0}},"Size3-Regular":{10216:{depth:.95003,height:1.45,italic:0,skew:0},10217:{depth:.95003,height:1.45,italic:0,skew:0},123:{depth:.95003,height:1.45,italic:0,skew:0},125:{depth:.95003,height:1.45,italic:0,skew:0},40:{depth:.95003,height:1.45,italic:0,skew:0},41:{depth:.95003,height:1.45,italic:0,skew:0},47:{depth:.95003,height:1.45,italic:0,skew:0},710:{depth:0,height:.75,italic:0,skew:0},732:{depth:0,height:.75,italic:0,skew:0},770:{depth:0,height:.75,italic:0,skew:0},771:{depth:0,height:.75,italic:0,skew:0},8730:{depth:.95003,height:1.45,italic:0,skew:0},8968:{depth:.95003,height:1.45,italic:0,skew:0},8969:{depth:.95003,height:1.45,italic:0,skew:0},8970:{depth:.95003,height:1.45,italic:0,skew:0},8971:{depth:.95003,height:1.45,italic:0,skew:0},91:{depth:.95003,height:1.45,italic:0,skew:0},92:{depth:.95003,height:1.45,italic:0,skew:0},93:{depth:.95003,height:1.45,italic:0,skew:0}},"Size4-Regular":{10216:{depth:1.25003,height:1.75,italic:0,skew:0},10217:{depth:1.25003,height:1.75,italic:0,skew:0},123:{depth:1.25003,height:1.75,italic:0,skew:0},125:{depth:1.25003,height:1.75,italic:0,skew:0},40:{depth:1.25003,height:1.75,italic:0,skew:0},41:{depth:1.25003,height:1.75,italic:0,skew:0},47:{depth:1.25003,height:1.75,italic:0,skew:0},57344:{depth:-.00499,height:.605,italic:0,skew:0},57345:{depth:-.00499,height:.605,italic:0,skew:0},57680:{depth:0,height:.12,italic:0,skew:0},57681:{depth:0,height:.12,italic:0,skew:0},57682:{depth:0,height:.12,italic:0,skew:0},57683:{depth:0,height:.12,italic:0,skew:0},710:{depth:0,height:.825,italic:0,skew:0},732:{depth:0,height:.825,italic:0,skew:0},770:{depth:0,height:.825,italic:0,skew:0},771:{depth:0,height:.825,italic:0,skew:0},8730:{depth:1.25003,
|
||
height:1.75,italic:0,skew:0},8968:{depth:1.25003,height:1.75,italic:0,skew:0},8969:{depth:1.25003,height:1.75,italic:0,skew:0},8970:{depth:1.25003,height:1.75,italic:0,skew:0},8971:{depth:1.25003,height:1.75,italic:0,skew:0},91:{depth:1.25003,height:1.75,italic:0,skew:0},9115:{depth:.64502,height:1.155,italic:0,skew:0},9116:{depth:1e-5,height:.6,italic:0,skew:0},9117:{depth:.64502,height:1.155,italic:0,skew:0},9118:{depth:.64502,height:1.155,italic:0,skew:0},9119:{depth:1e-5,height:.6,italic:0,skew:0},9120:{depth:.64502,height:1.155,italic:0,skew:0},9121:{depth:.64502,height:1.155,italic:0,skew:0},9122:{depth:-99e-5,height:.601,italic:0,skew:0},9123:{depth:.64502,height:1.155,italic:0,skew:0},9124:{depth:.64502,height:1.155,italic:0,skew:0},9125:{depth:-99e-5,height:.601,italic:0,skew:0},9126:{depth:.64502,height:1.155,italic:0,skew:0},9127:{depth:1e-5,height:.9,italic:0,skew:0},9128:{depth:.65002,height:1.15,italic:0,skew:0},9129:{depth:.90001,height:0,italic:0,skew:0},9130:{depth:0,height:.3,italic:0,skew:0},9131:{depth:1e-5,height:.9,italic:0,skew:0},9132:{depth:.65002,height:1.15,italic:0,skew:0},9133:{depth:.90001,height:0,italic:0,skew:0},9143:{depth:.88502,height:.915,italic:0,skew:0},92:{depth:1.25003,height:1.75,italic:0,skew:0},93:{depth:1.25003,height:1.75,italic:0,skew:0}}},o=function(e,t){return a[t][e.charCodeAt(0)]};t.exports={metrics:r,getCharacterMetrics:o}},{"./Style":6}],12:[function(e,t,i){for(var n=e("./utils"),r=e("./ParseError"),a={"\\sqrt":{numArgs:1,numOptionalArgs:1,handler:function(e,t,i,n){if(null!=t)throw new r("Optional arguments to \\sqrt aren't supported yet",this.lexer,n[1]-1);return{type:"sqrt",body:i}}},"\\text":{numArgs:1,argTypes:["text"],greediness:2,handler:function(e,t){var i;return i="ordgroup"===t.type?t.value:[t],{type:"text",body:i}}},"\\color":{numArgs:2,allowedInText:!0,argTypes:["color","original"],handler:function(e,t,i){var n;return n="ordgroup"===i.type?i.value:[i],{type:"color",color:t.value,value:n}}},"\\overline":{numArgs:1,handler:function(e,t){return{type:"overline",body:t}}},"\\rule":{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"],handler:function(e,t,i,n){return{type:"rule",shift:t&&t.value,width:i.value,height:n.value}}},"\\KaTeX":{numArgs:0,handler:function(e){return{type:"katex"}}}},o={"\\bigl":{type:"open",size:1},"\\Bigl":{type:"open",size:2},"\\biggl":{type:"open",size:3},"\\Biggl":{type:"open",size:4},"\\bigr":{type:"close",size:1},"\\Bigr":{type:"close",size:2},"\\biggr":{type:"close",size:3},"\\Biggr":{type:"close",size:4},"\\bigm":{type:"rel",size:1},"\\Bigm":{type:"rel",size:2},"\\biggm":{type:"rel",size:3},"\\Biggm":{type:"rel",size:4},"\\big":{type:"textord",size:1},"\\Big":{type:"textord",size:2},"\\bigg":{type:"textord",size:3},"\\Bigg":{type:"textord",size:4}},s=["(",")","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\\lceil","\\rceil","<",">","\\langle","\\rangle","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."],l=[{funcs:["\\blue","\\orange","\\pink","\\red","\\green","\\gray","\\purple"],data:{numArgs:1,allowedInText:!0,handler:function(e,t){var i;return i="ordgroup"===t.type?t.value:[t],{type:"color",color:"katex-"+e.slice(1),value:i}}}},{funcs:["\\arcsin","\\arccos","\\arctan","\\arg","\\cos","\\cosh","\\cot","\\coth","\\csc","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\tan","\\tanh"],data:{numArgs:0,handler:function(e){return{type:"op",limits:!1,symbol:!1,body:e}}}},{funcs:["\\det","\\gcd","\\inf","\\lim","\\liminf","\\limsup","\\max","\\min","\\Pr","\\sup"],data:{numArgs:0,handler:function(e){return{type:"op",limits:!0,symbol:!1,body:e}}}},{funcs:["\\int","\\iint","\\iiint","\\oint"],data:{numArgs:0,handler:function(e){return{type:"op",limits:!1,symbol:!0,body:e}}}},{funcs:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint"],data:{numArgs:0,handler:function(e){return{type:"op",limits:!0,symbol:!0,body:e}}}},{funcs:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom"],data:{numArgs:2,greediness:2,handler:function(e,t,i){var n,r=null,a=null,o="auto";switch(e){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,r="(",a=")";break;default:throw new Error("Unrecognized genfrac command")}switch(e){case"\\dfrac":case"\\dbinom":o="display";break;case"\\tfrac":case"\\tbinom":o="text"}return{type:"genfrac",numer:t,denom:i,hasBarLine:n,leftDelim:r,rightDelim:a,size:o}}}},{funcs:["\\llap","\\rlap"],data:{numArgs:1,allowedInText:!0,handler:function(e,t){return{type:e.slice(1),body:t}}}},{funcs:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg","\\left","\\right"],data:{numArgs:1,handler:function(e,t,i){if(!n.contains(s,t.value))throw new r("Invalid delimiter: '"+t.value+"' after '"+e+"'",this.lexer,i[1]);return"\\left"===e||"\\right"===e?{type:"leftright",value:t.value}:{type:"delimsizing",size:o[e].size,delimType:o[e].type,value:t.value}}}},{funcs:["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],data:{numArgs:0}},{funcs:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],data:{numArgs:0}},{funcs:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot"],data:{numArgs:1,handler:function(e,t){return{type:"accent",accent:e,base:t}}}},{funcs:["\\over","\\choose"],data:{numArgs:0,handler:function(e){var t;switch(e){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",replaceWith:t}}}}],c=0;c<l.length;c++)!function(e,t){for(var i=0;i<e.length;i++)a[e[i]]=t}(l[c].funcs,l[c].data);var u=function(e){return void 0===a[e].greediness?1:a[e].greediness};for(var d in a)if(a.hasOwnProperty(d)){var h=a[d];a[d]={numArgs:h.numArgs,argTypes:h.argTypes,greediness:void 0===h.greediness?1:h.greediness,allowedInText:!!h.allowedInText&&h.allowedInText,numOptionalArgs:void 0===h.numOptionalArgs?0:h.numOptionalArgs,handler:h.handler}}t.exports={funcs:a,getGreediness:u}},{"./ParseError":4,"./utils":15}],13:[function(e,t,i){var n=e("./Parser"),r=function(e){return new n(e).parse()};t.exports=r},{"./Parser":5}],14:[function(e,t,i){for(var n={math:{"`":{font:"main",group:"textord",replace:"‘"},"\\$":{font:"main",group:"textord",replace:"$"},"\\%":{font:"main",group:"textord",replace:"%"},"\\_":{font:"main",group:"textord",replace:"_"},"\\angle":{font:"main",group:"textord",replace:"∠"},"\\infty":{font:"main",group:"textord",replace:"∞"},"\\prime":{font:"main",group:"textord",replace:"′"},"\\triangle":{font:"main",group:"textord",replace:"△"},"\\Gamma":{font:"main",group:"textord",replace:"Γ"},"\\Delta":{font:"main",group:"textord",replace:"Δ"},"\\Theta":{font:"main",group:"textord",replace:"Θ"},"\\Lambda":{font:"main",group:"textord",replace:"Λ"},"\\Xi":{font:"main",group:"textord",replace:"Ξ"},"\\Pi":{font:"main",group:"textord",replace:"Π"},"\\Sigma":{font:"main",group:"textord",replace:"Σ"},"\\Upsilon":{font:"main",group:"textord",replace:"Υ"},"\\Phi":{font:"main",group:"textord",replace:"Φ"},"\\Psi":{font:"main",group:"textord",replace:"Ψ"},"\\Omega":{font:"main",group:"textord",replace:"Ω"},"\\neg":{font:"main",group:"textord",replace:"¬"},"\\lnot":{font:"main",group:"textord",replace:"¬"},"\\top":{font:"main",group:"textord",replace:"⊤"},"\\bot":{font:"main",group:"textord",replace:"⊥"},"\\emptyset":{font:"main",group:"textord",replace:"∅"},"\\varnothing":{font:"ams",group:"textord",replace:"∅"},"\\alpha":{font:"main",group:"mathord",replace:"α"},"\\beta":{font:"main",group:"mathord",replace:"β"},"\\gamma":{font:"main",group:"mathord",replace:"γ"},"\\delta":{font:"main",group:"mathord",replace:"δ"},"\\epsilon":{font:"main",group:"mathord",replace:"ϵ"},"\\zeta":{font:"main",group:"mathord",replace:"ζ"},"\\eta":{font:"main",group:"mathord",replace:"η"},"\\theta":{font:"main",group:"mathord",replace:"θ"},"\\iota":{font:"main",group:"mathord",replace:"ι"},"\\kappa":{font:"main",group:"mathord",replace:"κ"},"\\lambda":{font:"main",group:"mathord",replace:"λ"},"\\mu":{font:"main",group:"mathord",replace:"μ"},"\\nu":{font:"main",group:"mathord",replace:"ν"},"\\xi":{font:"main",group:"mathord",replace:"ξ"},"\\omicron":{font:"main",group:"mathord",replace:"o"},"\\pi":{font:"main",group:"mathord",replace:"π"},"\\rho":{font:"main",group:"mathord",replace:"ρ"},"\\sigma":{font:"main",group:"mathord",replace:"σ"},"\\tau":{font:"main",group:"mathord",replace:"τ"},"\\upsilon":{font:"main",group:"mathord",replace:"υ"},"\\phi":{font:"main",group:"mathord",replace:"ϕ"},"\\chi":{font:"main",group:"mathord",replace:"χ"},"\\psi":{font:"main",group:"mathord",replace:"ψ"},"\\omega":{font:"main",group:"mathord",replace:"ω"},"\\varepsilon":{font:"main",group:"mathord",replace:"ε"},"\\vartheta":{font:"main",group:"mathord",replace:"ϑ"},"\\varpi":{font:"main",group:"mathord",replace:"ϖ"},"\\varrho":{font:"main",group:"mathord",replace:"ϱ"},"\\varsigma":{font:"main",group:"mathord",replace:"ς"},"\\varphi":{font:"main",group:"mathord",replace:"φ"},"*":{font:"main",group:"bin",replace:"∗"},"+":{font:"main",group:"bin"},"-":{font:"main",group:"bin",replace:"−"},"\\cdot":{font:"main",group:"bin",replace:"⋅"},"\\circ":{font:"main",group:"bin",replace:"∘"},"\\div":{font:"main",group:"bin",replace:"÷"},"\\pm":{font:"main",group:"bin",replace:"±"},"\\times":{font:"main",group:"bin",replace:"×"},"\\cap":{font:"main",group:"bin",replace:"∩"},"\\cup":{font:"main",group:"bin",replace:"∪"},"\\setminus":{font:"main",group:"bin",replace:"∖"},"\\land":{font:"main",group:"bin",replace:"∧"},"\\lor":{font:"main",group:"bin",replace:"∨"},"\\wedge":{font:"main",group:"bin",replace:"∧"},"\\vee":{font:"main",group:"bin",replace:"∨"},"\\surd":{font:"main",group:"textord",replace:"√"},"(":{font:"main",group:"open"},"[":{font:"main",group:"open"},"\\langle":{font:"main",group:"open",replace:"⟨"},"\\lvert":{font:"main",group:"open",replace:"∣"},")":{font:"main",group:"close"},"]":{font:"main",group:"close"},"?":{font:"main",group:"close"},"!":{font:"main",group:"close"},"\\rangle":{font:"main",group:"close",replace:"⟩"},"\\rvert":{font:"main",group:"close",replace:"∣"},"=":{font:"main",group:"rel"},"<":{font:"main",group:"rel"},">":{font:"main",group:"rel"},":":{font:"main",group:"rel"},"\\approx":{font:"main",group:"rel",replace:"≈"},"\\cong":{font:"main",group:"rel",replace:"≅"},"\\ge":{font:"main",group:"rel",replace:"≥"},"\\geq":{font:"main",group:"rel",replace:"≥"},"\\gets":{font:"main",group:"rel",replace:"←"},"\\in":{font:"main",group:"rel",replace:"∈"},"\\notin":{font:"main",group:"rel",replace:"∉"},"\\subset":{font:"main",group:"rel",replace:"⊂"},"\\supset":{font:"main",group:"rel",replace:"⊃"},"\\subseteq":{font:"main",group:"rel",replace:"⊆"},"\\supseteq":{font:"main",group:"rel",replace:"⊇"},"\\nsubseteq":{font:"ams",group:"rel",replace:"⊈"},"\\nsupseteq":{font:"ams",group:"rel",replace:"⊉"},"\\models":{font:"main",group:"rel",replace:"⊨"},"\\leftarrow":{font:"main",group:"rel",replace:"←"},"\\le":{font:"main",group:"rel",replace:"≤"},"\\leq":{font:"main",group:"rel",replace:"≤"},"\\ne":{font:"main",group:"rel",replace:"≠"},"\\neq":{font:"main",group:"rel",replace:"≠"},"\\rightarrow":{font:"main",group:"rel",replace:"→"},"\\to":{font:"main",group:"rel",replace:"→"},"\\ngeq":{font:"ams",group:"rel",replace:"≱"},"\\nleq":{font:"ams",group:"rel",replace:"≰"},"\\!":{font:"main",group:"spacing"},"\\ ":{font:"main",group:"spacing",replace:" "},"~":{font:"main",group:"spacing",replace:" "},"\\,":{font:"main",group:"spacing"},"\\:":{font:"main",group:"spacing"},"\\;":{font:"main",group:"spacing"},"\\enspace":{font:"main",group:"spacing"},"\\qquad":{font:"main",group:"spacing"},"\\quad":{font:"main",group:"spacing"},"\\space":{font:"main",group:"spacing",replace:" "},",":{font:"main",group:"punct"},";":{font:"main",group:"punct"},"\\colon":{font:"main",group:"punct",replace:":"},"\\barwedge":{font:"ams",group:"textord",replace:"⊼"},"\\veebar":{font:"ams",group:"textord",replace:"⊻"},"\\odot":{font:"main",group:"textord",replace:"⊙"},"\\oplus":{font:"main",group:"textord",replace:"⊕"},"\\otimes":{font:"main",group:"textord",replace:"⊗"},"\\partial":{font:"main",group:"textord",replace:"∂"},"\\oslash":{font:"main",group:"textord",replace:"⊘"},"\\circledcirc":{font:"ams",group:"textord",replace:"⊚"},"\\boxdot":{font:"ams",group:"textord",replace:"⊡"},"\\bigtriangleup":{font:"main",group:"textord",replace:"△"},"\\bigtriangledown":{font:"main",group:"textord",replace:"▽"},"\\dagger":{font:"main",group:"textord",replace:"†"},"\\diamond":{font:"main",group:"textord",replace:"⋄"},"\\star":{font:"main",group:"textord",replace:"⋆"},"\\triangleleft":{font:"main",group:"textord",replace:"◃"},"\\triangleright":{font:"main",group:"textord",replace:"▹"},"\\{":{font:"main",group:"open",replace:"{"},"\\}":{font:"main",group:"close",replace:"}"},"\\lbrace":{font:"main",group:"open",replace:"{"},"\\rbrace":{font:"main",group:"close",replace:"}"},"\\lbrack":{font:"main",group:"open",replace:"["},"\\rbrack":{font:"main",group:"close",replace:"]"},"\\lfloor":{font:"main",group:"open",replace:"⌊"},"\\rfloor":{font:"main",group:"close",replace:"⌋"},"\\lceil":{font:"main",group:"open",replace:"⌈"},"\\rceil":{font:"main",group:"close",replace:"⌉"},"\\backslash":{font:"main",group:"textord",replace:"\\"},"|":{font:"main",group:"textord",replace:"∣"},"\\vert":{font:"main",group:"textord",replace:"∣"},"\\|":{font:"main",group:"textord",replace:"∥"},"\\Vert":{font:"main",group:"textord",replace:"∥"},"\\uparrow":{font:"main",group:"textord",replace:"↑"},"\\Uparrow":{font:"main",group:"textord",replace:"⇑"},"\\downarrow":{font:"main",group:"textord",replace:"↓"},"\\Downarrow":{font:"main",group:"textord",replace:"⇓"},"\\updownarrow":{font:"main",group:"textord",replace:"↕"},"\\Updownarrow":{font:"main",group:"textord",replace:"⇕"},"\\coprod":{font:"math",group:"op",replace:"∐"},"\\bigvee":{font:"math",group:"op",replace:"⋁"},"\\bigwedge":{font:"math",group:"op",replace:"⋀"},"\\biguplus":{font:"math",group:"op",replace:"⨄"},"\\bigcap":{font:"math",group:"op",replace:"⋂"},"\\bigcup":{font:"math",group:"op",replace:"⋃"},"\\int":{font:"math",group:"op",replace:"∫"},"\\intop":{font:"math",group:"op",replace:"∫"},"\\iint":{font:"math",group:"op",replace:"∬"},"\\iiint":{font:"math",group:"op",replace:"∭"},"\\prod":{font:"math",group:"op",replace:"∏"},"\\sum":{font:"math",group:"op",replace:"∑"},"\\bigotimes":{font:"math",group:"op",replace:"⨂"},"\\bigoplus":{font:"math",group:"op",replace:"⨁"},"\\bigodot":{font:"math",group:"op",replace:"⨀"},"\\oint":{font:"math",group:"op",replace:"∮"},"\\bigsqcup":{font:"math",group:"op",replace:"⨆"},"\\smallint":{font:"math",group:"op",replace:"∫"},"\\ldots":{font:"main",group:"punct",replace:"…"},"\\cdots":{font:"main",group:"inner",replace:"⋯"},"\\ddots":{font:"main",group:"inner",replace:"⋱"},"\\vdots":{font:"main",group:"textord",replace:"⋮"},"\\acute":{font:"main",group:"accent",replace:"´"},"\\grave":{font:"main",group:"accent",replace:"`"},"\\ddot":{font:"main",group:"accent",replace:"¨"},"\\tilde":{font:"main",group:"accent",replace:"~"},"\\bar":{font:"main",group:"accent",replace:"¯"},"\\breve":{font:"main",group:"accent",replace:"˘"},"\\check":{font:"main",group:"accent",replace:"ˇ"},"\\hat":{font:"main",group:"accent",replace:"^"},"\\vec":{font:"main",group:"accent",replace:"⃗"},"\\dot":{font:"main",group:"accent",replace:"˙"}},text:{"\\ ":{font:"main",group:"spacing",replace:" "}," ":{font:"main",group:"spacing",replace:" "},"~":{font:"main",group:"spacing",replace:" "}}},r='0123456789/@."',a=0;a<r.length;a++){var o=r.charAt(a);n.math[o]={font:"main",group:"textord"}}for(var s="0123456789`!@*()-=+[]'\";:?/.,",a=0;a<s.length;a++){var o=s.charAt(a);n.text[o]={font:"main",group:"textord"}}for(var l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",a=0;a<l.length;a++){var o=l.charAt(a);n.math[o]={font:"main",group:"mathord"},n.text[o]={font:"main",group:"textord"}}t.exports=n},{}],15:[function(e,t,i){function n(e){return h[e]}function r(e){return(""+e).replace(p,n)}function a(e){o(e,"")}var o,s=Array.prototype.indexOf,l=function(e,t){if(null==e)return-1;if(s&&e.indexOf===s)return e.indexOf(t);for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1},c=function(e,t){return-1!==l(e,t)},u=/([A-Z])/g,d=function(e){return e.replace(u,"-$1").toLowerCase()},h={"&":"&",">":">","<":"<",'"':""","'":"'"},p=/[&><"']/g;if("undefined"!=typeof document){var f=document.createElement("span");o="textContent"in f?function(e,t){e.textContent=t}:function(e,t){e.innerText=t}}t.exports={contains:c,escape:r,hyphenate:d,indexOf:l,setTextContent:o,clearNode:a}},{}]},{},[1])(1)}),define("public/lib/editormd/lib/raphael-config",[],function(){return function(e){var t,i,n="0.4.2",r="hasOwnProperty",a=/[\.\/]/,o=function(){},s=function(e,t){return e-t},l={n:{}},c=function(e,n){e=String(e);var r,a=i,o=Array.prototype.slice.call(arguments,2),l=c.listeners(e),u=0,d=[],h={},p=[],f=t;t=e,i=0;for(var m=0,g=l.length;g>m;m++)"zIndex"in l[m]&&(d.push(l[m].zIndex),l[m].zIndex<0&&(h[l[m].zIndex]=l[m]));for(d.sort(s);d[u]<0;)if(r=h[d[u++]],p.push(r.apply(n,o)),i)return i=a,p;for(m=0;g>m;m++)if("zIndex"in(r=l[m]))if(r.zIndex==d[u]){if(p.push(r.apply(n,o)),i)break;do{if(u++,r=h[d[u]],r&&p.push(r.apply(n,o)),i)break}while(r)}else h[r.zIndex]=r;else if(p.push(r.apply(n,o)),i)break;return i=a,t=f,p.length?p:null};return c._events=l,c.listeners=function(e){var t,i,n,r,o,s,c,u,d=e.split(a),h=l,p=[h],f=[];for(r=0,o=d.length;o>r;r++){for(u=[],s=0,c=p.length;c>s;s++)for(h=p[s].n,i=[h[d[r]],h["*"]],n=2;n--;)(t=i[n])&&(u.push(t),f=f.concat(t.f||[]));p=u}return f},c.on=function(e,t){if(e=String(e),"function"!=typeof t)return function(){};for(var i=e.split(a),n=l,r=0,s=i.length;s>r;r++)n=n.n,n=n.hasOwnProperty(i[r])&&n[i[r]]||(n[i[r]]={n:{}});for(n.f=n.f||[],r=0,s=n.f.length;s>r;r++)if(n.f[r]==t)return o;return n.f.push(t),function(e){+e==+e&&(t.zIndex=+e)}},c.f=function(e){var t=[].slice.call(arguments,1);return function(){c.apply(null,[e,null].concat(t).concat([].slice.call(arguments,0)))}},c.stop=function(){i=1},c.nt=function(e){return e?new RegExp("(?:\\.|\\/|^)"+e+"(?:\\.|\\/|$)").test(t):t},c.nts=function(){return t.split(a)},c.off=c.unbind=function(e,t){if(!e)return void(c._events=l={n:{}});var i,n,o,s,u,d,h,p=e.split(a),f=[l];for(s=0,u=p.length;u>s;s++)for(d=0;d<f.length;d+=o.length-2){if(o=[d,1],i=f[d].n,"*"!=p[s])i[p[s]]&&o.push(i[p[s]]);else for(n in i)i[r](n)&&o.push(i[n]);f.splice.apply(f,o)}for(s=0,u=f.length;u>s;s++)for(i=f[s];i.n;){if(t){if(i.f){for(d=0,h=i.f.length;h>d;d++)if(i.f[d]==t){i.f.splice(d,1);break}!i.f.length&&delete i.f}for(n in i.n)if(i.n[r](n)&&i.n[n].f){var m=i.n[n].f;for(d=0,h=m.length;h>d;d++)if(m[d]==t){m.splice(d,1);break}!m.length&&delete i.n[n].f}}else{delete i.f;for(n in i.n)i.n[r](n)&&i.n[n].f&&delete i.n[n].f}i=i.n}},c.once=function(e,t){var i=function(){return c.unbind(e,i),t.apply(this,arguments)};return c.on(e,i)},c.version=n,c.toString=function(){return"You are running Eve "+n},"undefined"!=typeof module&&module.exports?module.exports=c:"undefined"!=typeof define?define("eve",[],function(){return c}):e.eve=c,c}(window||this)}),define("raphael",["public/lib/editormd/lib/raphael-config"],function(e){return function(e,t){function i(e){if(i.is(e,"function"))return b?e():t.on("raphael.DOMload",e);if(i.is(e,G))return i._engine.create[I](i,e.splice(0,3+i.is(e[0],W))).add(e);var n=Array.prototype.slice.call(arguments,0);if(i.is(n[n.length-1],"function")){var r=n.pop();return b?r.call(i._engine.create[I](i,n)):t.on("raphael.DOMload",function(){r.call(i._engine.create[I](i,n))})}return i._engine.create[I](i,arguments)}function n(e){if("function"==typeof e||Object(e)!==e)return e;var t=new e.constructor;for(var i in e)e[T](i)&&(t[i]=n(e[i]));return t}function r(e,t){for(var i=0,n=e.length;n>i;i++)if(e[i]===t)return e.push(e.splice(i,1)[0])}function a(e,t,i){function n(){var a=Array.prototype.slice.call(arguments,0),o=a.join("␀"),s=n.cache=n.cache||{},l=n.count=n.count||[];return s[T](o)?(r(l,o),i?i(s[o]):s[o]):(l.length>=1e3&&delete s[l.shift()],l.push(o),s[o]=e[I](t,a),i?i(s[o]):s[o])}return n}function o(){return this.hex}function s(e,t){for(var i=[],n=0,r=e.length;r-2*!t>n;n+=2){var a=[{x:+e[n-2],y:+e[n-1]},{x:+e[n],y:+e[n+1]},{x:+e[n+2],y:+e[n+3]},{x:+e[n+4],y:+e[n+5]}];t?n?r-4==n?a[3]={x:+e[0],y:+e[1]}:r-2==n&&(a[2]={x:+e[0],y:+e[1]},a[3]={x:+e[2],y:+e[3]}):a[0]={x:+e[r-2],y:+e[r-1]}:r-4==n?a[3]=a[2]:n||(a[0]={x:+e[n],y:+e[n+1]}),i.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return i}function l(e,t,i,n,r){return e*(e*(-3*t+9*i-9*n+3*r)+6*t-12*i+6*n)-3*t+3*i}function c(e,t,i,n,r,a,o,s,c){null==c&&(c=1),c=c>1?1:0>c?0:c;for(var u=c/2,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],h=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0,f=0;12>f;f++){var m=u*d[f]+u,g=l(m,e,i,r,o),v=l(m,t,n,a,s),y=g*g+v*v;p+=h[f]*F.sqrt(y)}return u*p}function u(e,t,i,n,r,a,o,s,l){if(!(0>l||c(e,t,i,n,r,a,o,s)<l)){var u,d=.5,h=1-d;for(u=c(e,t,i,n,r,a,o,s,h);$(u-l)>.01;)d/=2,h+=(l>u?1:-1)*d,u=c(e,t,i,n,r,a,o,s,h);return h}}function d(e,t,i,n,r,a,o,s){if(!(B(e,i)<U(r,o)||U(e,i)>B(r,o)||B(t,n)<U(a,s)||U(t,n)>B(a,s))){var l=(e*n-t*i)*(r-o)-(e-i)*(r*s-a*o),c=(e*n-t*i)*(a-s)-(t-n)*(r*s-a*o),u=(e-i)*(a-s)-(t-n)*(r-o);if(u){var d=l/u,h=c/u,p=+d.toFixed(2),f=+h.toFixed(2);if(!(p<+U(e,i).toFixed(2)||p>+B(e,i).toFixed(2)||p<+U(r,o).toFixed(2)||p>+B(r,o).toFixed(2)||f<+U(t,n).toFixed(2)||f>+B(t,n).toFixed(2)||f<+U(a,s).toFixed(2)||f>+B(a,s).toFixed(2)))return{x:d,y:h}}}}function h(e,t,n){var r=i.bezierBBox(e),a=i.bezierBBox(t);if(!i.isBBoxIntersect(r,a))return n?0:[];for(var o=c.apply(0,e),s=c.apply(0,t),l=B(~~(o/5),1),u=B(~~(s/5),1),h=[],p=[],f={},m=n?0:[],g=0;l+1>g;g++){var v=i.findDotsAtSegment.apply(i,e.concat(g/l));h.push({x:v.x,y:v.y,t:g/l})}for(g=0;u+1>g;g++)v=i.findDotsAtSegment.apply(i,t.concat(g/u)),p.push({x:v.x,y:v.y,t:g/u});for(g=0;l>g;g++)for(var y=0;u>y;y++){var _=h[g],b=h[g+1],w=p[y],x=p[y+1],k=$(b.x-_.x)<.001?"y":"x",C=$(x.x-w.x)<.001?"y":"x",T=d(_.x,_.y,b.x,b.y,w.x,w.y,x.x,x.y);if(T){if(f[T.x.toFixed(4)]==T.y.toFixed(4))continue;f[T.x.toFixed(4)]=T.y.toFixed(4);var S=_.t+$((T[k]-_[k])/(b[k]-_[k]))*(b.t-_.t),E=w.t+$((T[C]-w[C])/(x[C]-w[C]))*(x.t-w.t);S>=0&&1.001>=S&&E>=0&&1.001>=E&&(n?m++:m.push({x:T.x,y:T.y,t1:U(S,1),t2:U(E,1)}))}}return m}function p(e,t,n){e=i._path2curve(e),t=i._path2curve(t);for(var r,a,o,s,l,c,u,d,p,f,m=n?0:[],g=0,v=e.length;v>g;g++){var y=e[g];if("M"==y[0])r=l=y[1],a=c=y[2];else{"C"==y[0]?(p=[r,a].concat(y.slice(1)),r=p[6],a=p[7]):(p=[r,a,r,a,l,c,l,c],r=l,a=c);for(var _=0,b=t.length;b>_;_++){var w=t[_];if("M"==w[0])o=u=w[1],s=d=w[2];else{"C"==w[0]?(f=[o,s].concat(w.slice(1)),o=f[6],s=f[7]):(f=[o,s,o,s,u,d,u,d],o=u,s=d);var x=h(p,f,n);if(n)m+=x;else{for(var k=0,C=x.length;C>k;k++)x[k].segment1=g,x[k].segment2=_,x[k].bez1=p,x[k].bez2=f;m=m.concat(x)}}}}}return m}function f(e,t,i,n,r,a){null!=e?(this.a=+e,this.b=+t,this.c=+i,this.d=+n,this.e=+r,this.f=+a):(this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0)}function m(){return this.x+O+this.y+O+this.width+" × "+this.height}function g(e,t,i,n,r,a){function o(e){return((u*e+c)*e+l)*e}function s(e,t){var i,n,r,a,s,d;for(r=e,d=0;8>d;d++){if(a=o(r)-e,$(a)<t)return r;if(s=(3*u*r+2*c)*r+l,$(s)<1e-6)break;r-=a/s}if(i=0,n=1,r=e,i>r)return i;if(r>n)return n;for(;n>i;){if(a=o(r),$(a-e)<t)return r;e>a?i=r:n=r,r=(n-i)/2+i}return r}var l=3*t,c=3*(n-t)-l,u=1-l-c,d=3*i,h=3*(r-i)-d,p=1-d-h;return function(e,t){var i=s(e,t);return((p*i+h)*i+d)*i}(e,1/(200*a))}function v(e,t){var i=[],n={};if(this.ms=t,this.times=1,e){for(var r in e)e[T](r)&&(n[J(r)]=e[r],i.push(J(r)));i.sort(de)}this.anim=n,this.top=i[i.length-1],this.percents=i}function y(e,n,r,a,o,s){r=J(r);var l,c,u,d,h,p,m=e.ms,v={},y={},_={};if(a)for(w=0,k=lt.length;k>w;w++){var b=lt[w];if(b.el.id==n.id&&b.anim==e){b.percent!=r?(lt.splice(w,1),u=1):c=b,n.attr(b.totalOrigin);break}}else a=+y;for(var w=0,k=e.percents.length;k>w;w++){if(e.percents[w]==r||e.percents[w]>a*e.top){r=e.percents[w],h=e.percents[w-1]||0,m=m/e.top*(r-h),d=e.percents[w+1],l=e.anim[r];break}a&&n.attr(e.anim[e.percents[w]])}if(l){if(c)c.initstatus=a,c.start=new Date-c.ms*a;else{for(var C in l)if(l[T](C)&&(ne[T](C)||n.paper.customAttributes[T](C)))switch(v[C]=n.attr(C),null==v[C]&&(v[C]=ie[C]),y[C]=l[C],ne[C]){case W:_[C]=(y[C]-v[C])/m;break;case"colour":v[C]=i.getRGB(v[C]);var S=i.getRGB(y[C]);_[C]={r:(S.r-v[C].r)/m,g:(S.g-v[C].g)/m,b:(S.b-v[C].b)/m};break;case"path":var E=Re(v[C],y[C]),A=E[1];for(v[C]=E[0],_[C]=[],w=0,k=v[C].length;k>w;w++){_[C][w]=[0];for(var I=1,M=v[C][w].length;M>I;I++)_[C][w][I]=(A[w][I]-v[C][w][I])/m}break;case"transform":var L=n._,O=Ue(L[C],y[C]);if(O)for(v[C]=O.from,y[C]=O.to,_[C]=[],_[C].real=!0,w=0,k=v[C].length;k>w;w++)for(_[C][w]=[v[C][w][0]],I=1,M=v[C][w].length;M>I;I++)_[C][w][I]=(y[C][w][I]-v[C][w][I])/m;else{var R=n.matrix||new f,j={_:{transform:L.transform},getBBox:function(){return n.getBBox(1)}};v[C]=[R.a,R.b,R.c,R.d,R.e,R.f],Fe(j,y[C]),y[C]=j._.transform,_[C]=[(j.matrix.a-R.a)/m,(j.matrix.b-R.b)/m,(j.matrix.c-R.c)/m,(j.matrix.d-R.d)/m,(j.matrix.e-R.e)/m,(j.matrix.f-R.f)/m]}break;case"csv":var z=N(l[C])[P](x),F=N(v[C])[P](x);if("clip-rect"==C)for(v[C]=F,_[C]=[],w=F.length;w--;)_[C][w]=(z[w]-v[C][w])/m;y[C]=z;break;default:for(z=[][D](l[C]),F=[][D](v[C]),_[C]=[],w=n.paper.customAttributes[C].length;w--;)_[C][w]=((z[w]||0)-(F[w]||0))/m}var B=l.easing,U=i.easing_formulas[B];if(!U)if((U=N(B).match(Q))&&5==U.length){var $=U;U=function(e){return g(e,+$[1],+$[2],+$[3],+$[4],m)}}else U=pe;if(p=l.start||e.start||+new Date,b={anim:e,percent:r,timestamp:p,start:p+(e.del||0),status:0,initstatus:a||0,stop:!1,ms:m,easing:U,from:v,diff:_,to:y,el:n,callback:l.callback,prev:h,next:d,repeat:s||e.times,origin:n.attr(),totalOrigin:o},lt.push(b),a&&!c&&!u&&(b.stop=!0,b.start=new Date-m*a,1==lt.length))return ut();u&&(b.start=new Date-b.ms*a),1==lt.length&&ct(ut)}t("raphael.anim.start."+n.id,n,e)}}function _(e){for(var t=0;t<lt.length;t++)lt[t].el.paper==e&<.splice(t--,1)}i.version="2.1.2",i.eve=t;var b,w,x=/[, ]+/,k={circle:1,rect:1,path:1,ellipse:1,text:1,image:1},C=/\{(\d+)\}/g,T="hasOwnProperty",S={doc:document,win:e},E={was:Object.prototype[T].call(S.win,"Raphael"),is:S.win.Raphael},A=function(){this.ca=this.customAttributes={}},I="apply",D="concat",M="ontouchstart"in S.win||S.win.DocumentTouch&&S.doc instanceof DocumentTouch,L="",O=" ",N=String,P="split",R="click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[P](O),j={mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"},z=N.prototype.toLowerCase,F=Math,B=F.max,U=F.min,$=F.abs,q=F.pow,H=F.PI,W="number",V="string",G="array",Y=Object.prototype.toString,K=(i._ISURL=/^url\(['"]?(.+?)['"]?\)$/i,/^\s*((#[a-f\d]{6})|(#[a-f\d]{3})|rgba?\(\s*([\d\.]+%?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+%?(?:\s*,\s*[\d\.]+%?)?)\s*\)|hsba?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\)|hsla?\(\s*([\d\.]+(?:deg|\xb0|%)?\s*,\s*[\d\.]+%?\s*,\s*[\d\.]+(?:%?\s*,\s*[\d\.]+)?)%?\s*\))\s*$/i),X={NaN:1,Infinity:1,"-Infinity":1},Q=/^(?:cubic-)?bezier\(([^,]+),([^,]+),([^,]+),([^\)]+)\)/,Z=F.round,J=parseFloat,ee=parseInt,te=N.prototype.toUpperCase,ie=i._availableAttrs={"arrow-end":"none","arrow-start":"none",blur:0,"clip-rect":"0 0 1e9 1e9",cursor:"default",cx:0,cy:0,fill:"#fff","fill-opacity":1,font:'10px "Arial"',"font-family":'"Arial"',"font-size":"10","font-style":"normal","font-weight":400,gradient:0,height:0,href:"http://raphaeljs.com/","letter-spacing":0,opacity:1,path:"M0,0",r:0,rx:0,ry:0,src:"",stroke:"#000","stroke-dasharray":"","stroke-linecap":"butt","stroke-linejoin":"butt","stroke-miterlimit":0,"stroke-opacity":1,"stroke-width":1,target:"_blank","text-anchor":"middle",title:"Raphael",transform:"",width:0,x:0,y:0},ne=i._availableAnimAttrs={blur:W,"clip-rect":"csv",cx:W,cy:W,fill:"colour","fill-opacity":W,"font-size":W,height:W,opacity:W,path:"path",r:W,rx:W,ry:W,stroke:"colour","stroke-opacity":W,"stroke-width":W,transform:"transform",width:W,x:W,y:W},re=/[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/,ae={hs:1,rg:1},oe=/,?([achlmqrstvxz]),?/gi,se=/([achlmrqstvz])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,le=/([rstm])[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029,]*((-?\d*\.?\d*(?:e[\-+]?\d+)?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*)+)/gi,ce=/(-?\d*\.?\d*(?:e[\-+]?\d+)?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,?[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*/gi,ue=(i._radial_gradient=/^r(?:\(([^,]+?)[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*,[\x09\x0a\x0b\x0c\x0d\x20\xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029]*([^\)]+?)\))?/,{}),de=function(e,t){return J(e)-J(t)},he=function(){},pe=function(e){return e},fe=i._rectPath=function(e,t,i,n,r){return r?[["M",e+r,t],["l",i-2*r,0],["a",r,r,0,0,1,r,r],["l",0,n-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-i,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-n],["a",r,r,0,0,1,r,-r],["z"]]:[["M",e,t],["l",i,0],["l",0,n],["l",-i,0],["z"]]},me=function(e,t,i,n){return null==n&&(n=i),[["M",e,t],["m",0,-n],["a",i,n,0,1,1,0,2*n],["a",i,n,0,1,1,0,-2*n],["z"]]},ge=i._getPath={path:function(e){return e.attr("path")},circle:function(e){var t=e.attrs;return me(t.cx,t.cy,t.r)},ellipse:function(e){var t=e.attrs;return me(t.cx,t.cy,t.rx,t.ry)},rect:function(e){var t=e.attrs;return fe(t.x,t.y,t.width,t.height,t.r)},image:function(e){var t=e.attrs;return fe(t.x,t.y,t.width,t.height)},text:function(e){var t=e._getBBox();return fe(t.x,t.y,t.width,t.height)},set:function(e){var t=e._getBBox();return fe(t.x,t.y,t.width,t.height)}},ve=i.mapPath=function(e,t){if(!t)return e;var i,n,r,a,o,s,l;for(e=Re(e),r=0,o=e.length;o>r;r++)for(l=e[r],a=1,s=l.length;s>a;a+=2)i=t.x(l[a],l[a+1]),n=t.y(l[a],l[a+1]),l[a]=i,l[a+1]=n;return e};if(i._g=S,i.type=S.win.SVGAngle||S.doc.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")?"SVG":"VML","VML"==i.type){var ye,_e=S.doc.createElement("div");if(_e.innerHTML='<v:shape adj="1"/>',ye=_e.firstChild,ye.style.behavior="url(#default#VML)",!ye||"object"!=typeof ye.adj)return i.type=L;_e=null}
|
||
i.svg=!(i.vml="VML"==i.type),i._Paper=A,i.fn=w=A.prototype=i.prototype,i._id=0,i._oid=0,i.is=function(e,t){return t=z.call(t),"finite"==t?!X[T](+e):"array"==t?e instanceof Array:"null"==t&&null===e||t==typeof e&&null!==e||"object"==t&&e===Object(e)||"array"==t&&Array.isArray&&Array.isArray(e)||Y.call(e).slice(8,-1).toLowerCase()==t},i.angle=function(e,t,n,r,a,o){if(null==a){var s=e-n,l=t-r;return s||l?(180+180*F.atan2(-l,-s)/H+360)%360:0}return i.angle(e,t,a,o)-i.angle(n,r,a,o)},i.rad=function(e){return e%360*H/180},i.deg=function(e){return 180*e/H%360},i.snapTo=function(e,t,n){if(n=i.is(n,"finite")?n:10,i.is(e,G)){for(var r=e.length;r--;)if($(e[r]-t)<=n)return e[r]}else{e=+e;var a=t%e;if(n>a)return t-a;if(a>e-n)return t-a+e}return t},i.createUUID=function(e,t){return function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(e,t).toUpperCase()}}(/[xy]/g,function(e){var t=16*F.random()|0;return("x"==e?t:3&t|8).toString(16)}),i.setWindow=function(e){t("raphael.setWindow",i,S.win,e),S.win=e,S.doc=S.win.document,i._engine.initWin&&i._engine.initWin(S.win)};var be=function(e){if(i.vml){var t,n=/^\s+|\s+$/g;try{var r=new ActiveXObject("htmlfile");r.write("<body>"),r.close(),t=r.body}catch(e){t=createPopup().document.body}var o=t.createTextRange();be=a(function(e){try{t.style.color=N(e).replace(n,L);var i=o.queryCommandValue("ForeColor");return i=(255&i)<<16|65280&i|(16711680&i)>>>16,"#"+("000000"+i.toString(16)).slice(-6)}catch(e){return"none"}})}else{var s=S.doc.createElement("i");s.title="Raphaël Colour Picker",s.style.display="none",S.doc.body.appendChild(s),be=a(function(e){return s.style.color=e,S.doc.defaultView.getComputedStyle(s,L).getPropertyValue("color")})}return be(e)},we=function(){return"hsb("+[this.h,this.s,this.b]+")"},xe=function(){return"hsl("+[this.h,this.s,this.l]+")"},ke=function(){return this.hex},Ce=function(e,t,n){if(null==t&&i.is(e,"object")&&"r"in e&&"g"in e&&"b"in e&&(n=e.b,t=e.g,e=e.r),null==t&&i.is(e,V)){var r=i.getRGB(e);e=r.r,t=r.g,n=r.b}return(e>1||t>1||n>1)&&(e/=255,t/=255,n/=255),[e,t,n]},Te=function(e,t,n,r){e*=255,t*=255,n*=255;var a={r:e,g:t,b:n,hex:i.rgb(e,t,n),toString:ke};return i.is(r,"finite")&&(a.opacity=r),a};i.color=function(e){var t;return i.is(e,"object")&&"h"in e&&"s"in e&&"b"in e?(t=i.hsb2rgb(e),e.r=t.r,e.g=t.g,e.b=t.b,e.hex=t.hex):i.is(e,"object")&&"h"in e&&"s"in e&&"l"in e?(t=i.hsl2rgb(e),e.r=t.r,e.g=t.g,e.b=t.b,e.hex=t.hex):(i.is(e,"string")&&(e=i.getRGB(e)),i.is(e,"object")&&"r"in e&&"g"in e&&"b"in e?(t=i.rgb2hsl(e),e.h=t.h,e.s=t.s,e.l=t.l,t=i.rgb2hsb(e),e.v=t.b):(e={hex:"none"},e.r=e.g=e.b=e.h=e.s=e.v=e.l=-1)),e.toString=ke,e},i.hsb2rgb=function(e,t,i,n){this.is(e,"object")&&"h"in e&&"s"in e&&"b"in e&&(i=e.b,t=e.s,n=e.o,e=e.h),e*=360;var r,a,o,s,l;return e=e%360/60,l=i*t,s=l*(1-$(e%2-1)),r=a=o=i-l,e=~~e,r+=[l,s,0,0,s,l][e],a+=[s,l,l,s,0,0][e],o+=[0,0,s,l,l,s][e],Te(r,a,o,n)},i.hsl2rgb=function(e,t,i,n){this.is(e,"object")&&"h"in e&&"s"in e&&"l"in e&&(i=e.l,t=e.s,e=e.h),(e>1||t>1||i>1)&&(e/=360,t/=100,i/=100),e*=360;var r,a,o,s,l;return e=e%360/60,l=2*t*(.5>i?i:1-i),s=l*(1-$(e%2-1)),r=a=o=i-l/2,e=~~e,r+=[l,s,0,0,s,l][e],a+=[s,l,l,s,0,0][e],o+=[0,0,s,l,l,s][e],Te(r,a,o,n)},i.rgb2hsb=function(e,t,i){i=Ce(e,t,i),e=i[0],t=i[1],i=i[2];var n,r,a,o;return a=B(e,t,i),o=a-U(e,t,i),n=0==o?null:a==e?(t-i)/o:a==t?(i-e)/o+2:(e-t)/o+4,n=(n+360)%6*60/360,r=0==o?0:o/a,{h:n,s:r,b:a,toString:we}},i.rgb2hsl=function(e,t,i){i=Ce(e,t,i),e=i[0],t=i[1],i=i[2];var n,r,a,o,s,l;return o=B(e,t,i),s=U(e,t,i),l=o-s,n=0==l?null:o==e?(t-i)/l:o==t?(i-e)/l+2:(e-t)/l+4,n=(n+360)%6*60/360,a=(o+s)/2,r=0==l?0:.5>a?l/(2*a):l/(2-2*a),{h:n,s:r,l:a,toString:xe}},i._path2string=function(){return this.join(",").replace(oe,"$1")},i._preload=function(e,t){var i=S.doc.createElement("img");i.style.cssText="position:absolute;left:-9999em;top:-9999em",i.onload=function(){t.call(this),this.onload=null,S.doc.body.removeChild(this)},i.onerror=function(){S.doc.body.removeChild(this)},S.doc.body.appendChild(i),i.src=e},i.getRGB=a(function(e){if(!e||(e=N(e)).indexOf("-")+1)return{r:-1,g:-1,b:-1,hex:"none",error:1,toString:o};if("none"==e)return{r:-1,g:-1,b:-1,hex:"none",toString:o};!(ae[T](e.toLowerCase().substring(0,2))||"#"==e.charAt())&&(e=be(e));var t,n,r,a,s,l,c=e.match(K);return c?(c[2]&&(r=ee(c[2].substring(5),16),n=ee(c[2].substring(3,5),16),t=ee(c[2].substring(1,3),16)),c[3]&&(r=ee((s=c[3].charAt(3))+s,16),n=ee((s=c[3].charAt(2))+s,16),t=ee((s=c[3].charAt(1))+s,16)),c[4]&&(l=c[4][P](re),t=J(l[0]),"%"==l[0].slice(-1)&&(t*=2.55),n=J(l[1]),"%"==l[1].slice(-1)&&(n*=2.55),r=J(l[2]),"%"==l[2].slice(-1)&&(r*=2.55),"rgba"==c[1].toLowerCase().slice(0,4)&&(a=J(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100)),c[5]?(l=c[5][P](re),t=J(l[0]),"%"==l[0].slice(-1)&&(t*=2.55),n=J(l[1]),"%"==l[1].slice(-1)&&(n*=2.55),r=J(l[2]),"%"==l[2].slice(-1)&&(r*=2.55),("deg"==l[0].slice(-3)||"°"==l[0].slice(-1))&&(t/=360),"hsba"==c[1].toLowerCase().slice(0,4)&&(a=J(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),i.hsb2rgb(t,n,r,a)):c[6]?(l=c[6][P](re),t=J(l[0]),"%"==l[0].slice(-1)&&(t*=2.55),n=J(l[1]),"%"==l[1].slice(-1)&&(n*=2.55),r=J(l[2]),"%"==l[2].slice(-1)&&(r*=2.55),("deg"==l[0].slice(-3)||"°"==l[0].slice(-1))&&(t/=360),"hsla"==c[1].toLowerCase().slice(0,4)&&(a=J(l[3])),l[3]&&"%"==l[3].slice(-1)&&(a/=100),i.hsl2rgb(t,n,r,a)):(c={r:t,g:n,b:r,toString:o},c.hex="#"+(16777216|r|n<<8|t<<16).toString(16).slice(1),i.is(a,"finite")&&(c.opacity=a),c)):{r:-1,g:-1,b:-1,hex:"none",error:1,toString:o}},i),i.hsb=a(function(e,t,n){return i.hsb2rgb(e,t,n).hex}),i.hsl=a(function(e,t,n){return i.hsl2rgb(e,t,n).hex}),i.rgb=a(function(e,t,i){return"#"+(16777216|i|t<<8|e<<16).toString(16).slice(1)}),i.getColor=function(e){var t=this.getColor.start=this.getColor.start||{h:0,s:1,b:e||.75},i=this.hsb2rgb(t.h,t.s,t.b);return t.h+=.075,t.h>1&&(t.h=0,t.s-=.2,t.s<=0&&(this.getColor.start={h:0,s:1,b:t.b})),i.hex},i.getColor.reset=function(){delete this.start},i.parsePathString=function(e){if(!e)return null;var t=Se(e);if(t.arr)return Ae(t.arr);var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},r=[];return i.is(e,G)&&i.is(e[0],G)&&(r=Ae(e)),r.length||N(e).replace(se,function(e,t,i){var a=[],o=t.toLowerCase();if(i.replace(ce,function(e,t){t&&a.push(+t)}),"m"==o&&a.length>2&&(r.push([t][D](a.splice(0,2))),o="l",t="m"==t?"l":"L"),"r"==o)r.push([t][D](a));else for(;a.length>=n[o]&&(r.push([t][D](a.splice(0,n[o]))),n[o]););}),r.toString=i._path2string,t.arr=Ae(r),r},i.parseTransformString=a(function(e){if(!e)return null;var t=[];return i.is(e,G)&&i.is(e[0],G)&&(t=Ae(e)),t.length||N(e).replace(le,function(e,i,n){var r=[];z.call(i),n.replace(ce,function(e,t){t&&r.push(+t)}),t.push([i][D](r))}),t.toString=i._path2string,t});var Se=function(e){var t=Se.ps=Se.ps||{};return t[e]?t[e].sleep=100:t[e]={sleep:100},setTimeout(function(){for(var i in t)t[T](i)&&i!=e&&!--t[i].sleep&&delete t[i]}),t[e]};i.findDotsAtSegment=function(e,t,i,n,r,a,o,s,l){var c=1-l,u=q(c,3),d=q(c,2),h=l*l,p=h*l,f=u*e+3*d*l*i+3*c*l*l*r+p*o,m=u*t+3*d*l*n+3*c*l*l*a+p*s,g=e+2*l*(i-e)+h*(r-2*i+e),v=t+2*l*(n-t)+h*(a-2*n+t),y=i+2*l*(r-i)+h*(o-2*r+i),_=n+2*l*(a-n)+h*(s-2*a+n),b=c*e+l*i,w=c*t+l*n,x=c*r+l*o,k=c*a+l*s,C=90-180*F.atan2(g-y,v-_)/H;return(g>y||_>v)&&(C+=180),{x:f,y:m,m:{x:g,y:v},n:{x:y,y:_},start:{x:b,y:w},end:{x:x,y:k},alpha:C}},i.bezierBBox=function(e,t,n,r,a,o,s,l){i.is(e,"array")||(e=[e,t,n,r,a,o,s,l]);var c=Pe.apply(null,e);return{x:c.min.x,y:c.min.y,x2:c.max.x,y2:c.max.y,width:c.max.x-c.min.x,height:c.max.y-c.min.y}},i.isPointInsideBBox=function(e,t,i){return t>=e.x&&t<=e.x2&&i>=e.y&&i<=e.y2},i.isBBoxIntersect=function(e,t){var n=i.isPointInsideBBox;return n(t,e.x,e.y)||n(t,e.x2,e.y)||n(t,e.x,e.y2)||n(t,e.x2,e.y2)||n(e,t.x,t.y)||n(e,t.x2,t.y)||n(e,t.x,t.y2)||n(e,t.x2,t.y2)||(e.x<t.x2&&e.x>t.x||t.x<e.x2&&t.x>e.x)&&(e.y<t.y2&&e.y>t.y||t.y<e.y2&&t.y>e.y)},i.pathIntersection=function(e,t){return p(e,t)},i.pathIntersectionNumber=function(e,t){return p(e,t,1)},i.isPointInsidePath=function(e,t,n){var r=i.pathBBox(e);return i.isPointInsideBBox(r,t,n)&&p(e,[["M",t,n],["H",r.x2+10]],1)%2==1},i._removedFactory=function(e){return function(){t("raphael.log",null,"Raphaël: you are calling to method “"+e+"” of removed object",e)}};var Ee=i.pathBBox=function(e){var t=Se(e);if(t.bbox)return n(t.bbox);if(!e)return{x:0,y:0,width:0,height:0,x2:0,y2:0};e=Re(e);for(var i,r=0,a=0,o=[],s=[],l=0,c=e.length;c>l;l++)if(i=e[l],"M"==i[0])r=i[1],a=i[2],o.push(r),s.push(a);else{var u=Pe(r,a,i[1],i[2],i[3],i[4],i[5],i[6]);o=o[D](u.min.x,u.max.x),s=s[D](u.min.y,u.max.y),r=i[5],a=i[6]}var d=U[I](0,o),h=U[I](0,s),p=B[I](0,o),f=B[I](0,s),m=p-d,g=f-h,v={x:d,y:h,x2:p,y2:f,width:m,height:g,cx:d+m/2,cy:h+g/2};return t.bbox=n(v),v},Ae=function(e){var t=n(e);return t.toString=i._path2string,t},Ie=i._pathToRelative=function(e){var t=Se(e);if(t.rel)return Ae(t.rel);i.is(e,G)&&i.is(e&&e[0],G)||(e=i.parsePathString(e));var n=[],r=0,a=0,o=0,s=0,l=0;"M"==e[0][0]&&(r=e[0][1],a=e[0][2],o=r,s=a,l++,n.push(["M",r,a]));for(var c=l,u=e.length;u>c;c++){var d=n[c]=[],h=e[c];if(h[0]!=z.call(h[0]))switch(d[0]=z.call(h[0]),d[0]){case"a":d[1]=h[1],d[2]=h[2],d[3]=h[3],d[4]=h[4],d[5]=h[5],d[6]=+(h[6]-r).toFixed(3),d[7]=+(h[7]-a).toFixed(3);break;case"v":d[1]=+(h[1]-a).toFixed(3);break;case"m":o=h[1],s=h[2];default:for(var p=1,f=h.length;f>p;p++)d[p]=+(h[p]-(p%2?r:a)).toFixed(3)}else{d=n[c]=[],"m"==h[0]&&(o=h[1]+r,s=h[2]+a);for(var m=0,g=h.length;g>m;m++)n[c][m]=h[m]}var v=n[c].length;switch(n[c][0]){case"z":r=o,a=s;break;case"h":r+=+n[c][v-1];break;case"v":a+=+n[c][v-1];break;default:r+=+n[c][v-2],a+=+n[c][v-1]}}return n.toString=i._path2string,t.rel=Ae(n),n},De=i._pathToAbsolute=function(e){var t=Se(e);if(t.abs)return Ae(t.abs);if(i.is(e,G)&&i.is(e&&e[0],G)||(e=i.parsePathString(e)),!e||!e.length)return[["M",0,0]];var n=[],r=0,a=0,o=0,l=0,c=0;"M"==e[0][0]&&(r=+e[0][1],a=+e[0][2],o=r,l=a,c++,n[0]=["M",r,a]);for(var u,d,h=3==e.length&&"M"==e[0][0]&&"R"==e[1][0].toUpperCase()&&"Z"==e[2][0].toUpperCase(),p=c,f=e.length;f>p;p++){if(n.push(u=[]),d=e[p],d[0]!=te.call(d[0]))switch(u[0]=te.call(d[0]),u[0]){case"A":u[1]=d[1],u[2]=d[2],u[3]=d[3],u[4]=d[4],u[5]=d[5],u[6]=+(d[6]+r),u[7]=+(d[7]+a);break;case"V":u[1]=+d[1]+a;break;case"H":u[1]=+d[1]+r;break;case"R":for(var m=[r,a][D](d.slice(1)),g=2,v=m.length;v>g;g++)m[g]=+m[g]+r,m[++g]=+m[g]+a;n.pop(),n=n[D](s(m,h));break;case"M":o=+d[1]+r,l=+d[2]+a;default:for(g=1,v=d.length;v>g;g++)u[g]=+d[g]+(g%2?r:a)}else if("R"==d[0])m=[r,a][D](d.slice(1)),n.pop(),n=n[D](s(m,h)),u=["R"][D](d.slice(-2));else for(var y=0,_=d.length;_>y;y++)u[y]=d[y];switch(u[0]){case"Z":r=o,a=l;break;case"H":r=u[1];break;case"V":a=u[1];break;case"M":o=u[u.length-2],l=u[u.length-1];default:r=u[u.length-2],a=u[u.length-1]}}return n.toString=i._path2string,t.abs=Ae(n),n},Me=function(e,t,i,n){return[e,t,i,n,i,n]},Le=function(e,t,i,n,r,a){var o=1/3,s=2/3;return[o*e+s*i,o*t+s*n,o*r+s*i,o*a+s*n,r,a]},Oe=function(e,t,i,n,r,o,s,l,c,u){var d,h=120*H/180,p=H/180*(+r||0),f=[],m=a(function(e,t,i){return{x:e*F.cos(i)-t*F.sin(i),y:e*F.sin(i)+t*F.cos(i)}});if(u)C=u[0],T=u[1],x=u[2],k=u[3];else{d=m(e,t,-p),e=d.x,t=d.y,d=m(l,c,-p),l=d.x,c=d.y;var g=(F.cos(H/180*r),F.sin(H/180*r),(e-l)/2),v=(t-c)/2,y=g*g/(i*i)+v*v/(n*n);y>1&&(y=F.sqrt(y),i*=y,n*=y);var _=i*i,b=n*n,w=(o==s?-1:1)*F.sqrt($((_*b-_*v*v-b*g*g)/(_*v*v+b*g*g))),x=w*i*v/n+(e+l)/2,k=w*-n*g/i+(t+c)/2,C=F.asin(((t-k)/n).toFixed(9)),T=F.asin(((c-k)/n).toFixed(9));C=x>e?H-C:C,T=x>l?H-T:T,0>C&&(C=2*H+C),0>T&&(T=2*H+T),s&&C>T&&(C-=2*H),!s&&T>C&&(T-=2*H)}var S=T-C;if($(S)>h){var E=T,A=l,I=c;T=C+h*(s&&T>C?1:-1),l=x+i*F.cos(T),c=k+n*F.sin(T),f=Oe(l,c,i,n,r,0,s,A,I,[T,E,x,k])}S=T-C;var M=F.cos(C),L=F.sin(C),O=F.cos(T),N=F.sin(T),R=F.tan(S/4),j=4/3*i*R,z=4/3*n*R,B=[e,t],U=[e+j*L,t-z*M],q=[l+j*N,c-z*O],W=[l,c];if(U[0]=2*B[0]-U[0],U[1]=2*B[1]-U[1],u)return[U,q,W][D](f);f=[U,q,W][D](f).join()[P](",");for(var V=[],G=0,Y=f.length;Y>G;G++)V[G]=G%2?m(f[G-1],f[G],p).y:m(f[G],f[G+1],p).x;return V},Ne=function(e,t,i,n,r,a,o,s,l){var c=1-l;return{x:q(c,3)*e+3*q(c,2)*l*i+3*c*l*l*r+q(l,3)*o,y:q(c,3)*t+3*q(c,2)*l*n+3*c*l*l*a+q(l,3)*s}},Pe=a(function(e,t,i,n,r,a,o,s){var l,c=r-2*i+e-(o-2*r+i),u=2*(i-e)-2*(r-i),d=e-i,h=(-u+F.sqrt(u*u-4*c*d))/2/c,p=(-u-F.sqrt(u*u-4*c*d))/2/c,f=[t,s],m=[e,o];return $(h)>"1e12"&&(h=.5),$(p)>"1e12"&&(p=.5),h>0&&1>h&&(l=Ne(e,t,i,n,r,a,o,s,h),m.push(l.x),f.push(l.y)),p>0&&1>p&&(l=Ne(e,t,i,n,r,a,o,s,p),m.push(l.x),f.push(l.y)),c=a-2*n+t-(s-2*a+n),u=2*(n-t)-2*(a-n),d=t-n,h=(-u+F.sqrt(u*u-4*c*d))/2/c,p=(-u-F.sqrt(u*u-4*c*d))/2/c,$(h)>"1e12"&&(h=.5),$(p)>"1e12"&&(p=.5),h>0&&1>h&&(l=Ne(e,t,i,n,r,a,o,s,h),m.push(l.x),f.push(l.y)),p>0&&1>p&&(l=Ne(e,t,i,n,r,a,o,s,p),m.push(l.x),f.push(l.y)),{min:{x:U[I](0,m),y:U[I](0,f)},max:{x:B[I](0,m),y:B[I](0,f)}}}),Re=i._path2curve=a(function(e,t){var i=!t&&Se(e);if(!t&&i.curve)return Ae(i.curve);for(var n=De(e),r=t&&De(t),a={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},o={x:0,y:0,bx:0,by:0,X:0,Y:0,qx:null,qy:null},s=(function(e,t,i){var n,r,a={T:1,Q:1};if(!e)return["C",t.x,t.y,t.x,t.y,t.x,t.y];switch(!(e[0]in a)&&(t.qx=t.qy=null),e[0]){case"M":t.X=e[1],t.Y=e[2];break;case"A":e=["C"][D](Oe[I](0,[t.x,t.y][D](e.slice(1))));break;case"S":"C"==i||"S"==i?(n=2*t.x-t.bx,r=2*t.y-t.by):(n=t.x,r=t.y),e=["C",n,r][D](e.slice(1));break;case"T":"Q"==i||"T"==i?(t.qx=2*t.x-t.qx,t.qy=2*t.y-t.qy):(t.qx=t.x,t.qy=t.y),e=["C"][D](Le(t.x,t.y,t.qx,t.qy,e[1],e[2]));break;case"Q":t.qx=e[1],t.qy=e[2],e=["C"][D](Le(t.x,t.y,e[1],e[2],e[3],e[4]));break;case"L":e=["C"][D](Me(t.x,t.y,e[1],e[2]));break;case"H":e=["C"][D](Me(t.x,t.y,e[1],t.y));break;case"V":e=["C"][D](Me(t.x,t.y,t.x,e[1]));break;case"Z":e=["C"][D](Me(t.x,t.y,t.X,t.Y))}return e}),l=function(e,t){if(e[t].length>7){e[t].shift();for(var i=e[t];i.length;)u[t]="A",r&&(d[t]="A"),e.splice(t++,0,["C"][D](i.splice(0,6)));e.splice(t,1),m=B(n.length,r&&r.length||0)}},c=function(e,t,i,a,o){e&&t&&"M"==e[o][0]&&"M"!=t[o][0]&&(t.splice(o,0,["M",a.x,a.y]),i.bx=0,i.by=0,i.x=e[o][1],i.y=e[o][2],m=B(n.length,r&&r.length||0))},u=[],d=[],h="",p="",f=0,m=B(n.length,r&&r.length||0);m>f;f++){n[f]&&(h=n[f][0]),"C"!=h&&(u[f]=h,f&&(p=u[f-1])),n[f]=s(n[f],a,p),"A"!=u[f]&&"C"==h&&(u[f]="C"),l(n,f),r&&(r[f]&&(h=r[f][0]),"C"!=h&&(d[f]=h,f&&(p=d[f-1])),r[f]=s(r[f],o,p),"A"!=d[f]&&"C"==h&&(d[f]="C"),l(r,f)),c(n,r,a,o,f),c(r,n,o,a,f);var g=n[f],v=r&&r[f],y=g.length,_=r&&v.length;a.x=g[y-2],a.y=g[y-1],a.bx=J(g[y-4])||a.x,a.by=J(g[y-3])||a.y,o.bx=r&&(J(v[_-4])||o.x),o.by=r&&(J(v[_-3])||o.y),o.x=r&&v[_-2],o.y=r&&v[_-1]}return r||(i.curve=Ae(n)),r?[n,r]:n},null,Ae),je=(i._parseDots=a(function(e){for(var t=[],n=0,r=e.length;r>n;n++){var a={},o=e[n].match(/^([^:]*):?([\d\.]*)/);if(a.color=i.getRGB(o[1]),a.color.error)return null;a.color=a.color.hex,o[2]&&(a.offset=o[2]+"%"),t.push(a)}for(n=1,r=t.length-1;r>n;n++)if(!t[n].offset){for(var s=J(t[n-1].offset||0),l=0,c=n+1;r>c;c++)if(t[c].offset){l=t[c].offset;break}l||(l=100,c=r),l=J(l);for(var u=(l-s)/(c-n+1);c>n;n++)s+=u,t[n].offset=s+"%"}return t}),i._tear=function(e,t){e==t.top&&(t.top=e.prev),e==t.bottom&&(t.bottom=e.next),e.next&&(e.next.prev=e.prev),e.prev&&(e.prev.next=e.next)}),ze=(i._tofront=function(e,t){t.top!==e&&(je(e,t),e.next=null,e.prev=t.top,t.top.next=e,t.top=e)},i._toback=function(e,t){t.bottom!==e&&(je(e,t),e.next=t.bottom,e.prev=null,t.bottom.prev=e,t.bottom=e)},i._insertafter=function(e,t,i){je(e,i),t==i.top&&(i.top=e),t.next&&(t.next.prev=e),e.next=t.next,e.prev=t,t.next=e},i._insertbefore=function(e,t,i){je(e,i),t==i.bottom&&(i.bottom=e),t.prev&&(t.prev.next=e),e.prev=t.prev,t.prev=e,e.next=t},i.toMatrix=function(e,t){var i=Ee(e),n={_:{transform:L},getBBox:function(){return i}};return Fe(n,t),n.matrix}),Fe=(i.transformPath=function(e,t){return ve(e,ze(e,t))},i._extractTransform=function(e,t){if(null==t)return e._.transform;t=N(t).replace(/\.{3}|\u2026/g,e._.transform||L);var n=i.parseTransformString(t),r=0,a=0,o=0,s=1,l=1,c=e._,u=new f;if(c.transform=n||[],n)for(var d=0,h=n.length;h>d;d++){var p,m,g,v,y,_=n[d],b=_.length,w=N(_[0]).toLowerCase(),x=_[0]!=w,k=x?u.invert():0;"t"==w&&3==b?x?(p=k.x(0,0),m=k.y(0,0),g=k.x(_[1],_[2]),v=k.y(_[1],_[2]),u.translate(g-p,v-m)):u.translate(_[1],_[2]):"r"==w?2==b?(y=y||e.getBBox(1),u.rotate(_[1],y.x+y.width/2,y.y+y.height/2),r+=_[1]):4==b&&(x?(g=k.x(_[2],_[3]),v=k.y(_[2],_[3]),u.rotate(_[1],g,v)):u.rotate(_[1],_[2],_[3]),r+=_[1]):"s"==w?2==b||3==b?(y=y||e.getBBox(1),u.scale(_[1],_[b-1],y.x+y.width/2,y.y+y.height/2),s*=_[1],l*=_[b-1]):5==b&&(x?(g=k.x(_[3],_[4]),v=k.y(_[3],_[4]),u.scale(_[1],_[2],g,v)):u.scale(_[1],_[2],_[3],_[4]),s*=_[1],l*=_[2]):"m"==w&&7==b&&u.add(_[1],_[2],_[3],_[4],_[5],_[6]),c.dirtyT=1,e.matrix=u}e.matrix=u,c.sx=s,c.sy=l,c.deg=r,c.dx=a=u.e,c.dy=o=u.f,1==s&&1==l&&!r&&c.bbox?(c.bbox.x+=+a,c.bbox.y+=+o):c.dirtyT=1}),Be=function(e){var t=e[0];switch(t.toLowerCase()){case"t":return[t,0,0];case"m":return[t,1,0,0,1,0,0];case"r":return 4==e.length?[t,0,e[2],e[3]]:[t,0];case"s":return 5==e.length?[t,1,1,e[3],e[4]]:3==e.length?[t,1,1]:[t,1]}},Ue=i._equaliseTransform=function(e,t){t=N(t).replace(/\.{3}|\u2026/g,e),e=i.parseTransformString(e)||[],t=i.parseTransformString(t)||[];for(var n,r,a,o,s=B(e.length,t.length),l=[],c=[],u=0;s>u;u++){if(a=e[u]||Be(t[u]),o=t[u]||Be(a),a[0]!=o[0]||"r"==a[0].toLowerCase()&&(a[2]!=o[2]||a[3]!=o[3])||"s"==a[0].toLowerCase()&&(a[3]!=o[3]||a[4]!=o[4]))return;for(l[u]=[],c[u]=[],n=0,r=B(a.length,o.length);r>n;n++)n in a&&(l[u][n]=a[n]),n in o&&(c[u][n]=o[n])}return{from:l,to:c}};i._getContainer=function(e,t,n,r){var a;return a=null!=r||i.is(e,"object")?e:S.doc.getElementById(e),null!=a?a.tagName?null==t?{container:a,width:a.style.pixelWidth||a.offsetWidth,height:a.style.pixelHeight||a.offsetHeight}:{container:a,width:t,height:n}:{container:1,x:e,y:t,width:n,height:r}:void 0},i.pathToRelative=Ie,i._engine={},i.path2curve=Re,i.matrix=function(e,t,i,n,r,a){return new f(e,t,i,n,r,a)},function(e){function t(e){return e[0]*e[0]+e[1]*e[1]}function n(e){var i=F.sqrt(t(e));e[0]&&(e[0]/=i),e[1]&&(e[1]/=i)}e.add=function(e,t,i,n,r,a){var o,s,l,c,u=[[],[],[]],d=[[this.a,this.c,this.e],[this.b,this.d,this.f],[0,0,1]],h=[[e,i,r],[t,n,a],[0,0,1]];for(e&&e instanceof f&&(h=[[e.a,e.c,e.e],[e.b,e.d,e.f],[0,0,1]]),o=0;3>o;o++)for(s=0;3>s;s++){for(c=0,l=0;3>l;l++)c+=d[o][l]*h[l][s];u[o][s]=c}this.a=u[0][0],this.b=u[1][0],this.c=u[0][1],this.d=u[1][1],this.e=u[0][2],this.f=u[1][2]},e.invert=function(){var e=this,t=e.a*e.d-e.b*e.c;return new f(e.d/t,-e.b/t,-e.c/t,e.a/t,(e.c*e.f-e.d*e.e)/t,(e.b*e.e-e.a*e.f)/t)},e.clone=function(){return new f(this.a,this.b,this.c,this.d,this.e,this.f)},e.translate=function(e,t){this.add(1,0,0,1,e,t)},e.scale=function(e,t,i,n){null==t&&(t=e),(i||n)&&this.add(1,0,0,1,i,n),this.add(e,0,0,t,0,0),(i||n)&&this.add(1,0,0,1,-i,-n)},e.rotate=function(e,t,n){e=i.rad(e),t=t||0,n=n||0;var r=+F.cos(e).toFixed(9),a=+F.sin(e).toFixed(9);this.add(r,a,-a,r,t,n),this.add(1,0,0,1,-t,-n)},e.x=function(e,t){return e*this.a+t*this.c+this.e},e.y=function(e,t){return e*this.b+t*this.d+this.f},e.get=function(e){return+this[N.fromCharCode(97+e)].toFixed(4)},e.toString=function(){return i.svg?"matrix("+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)].join()+")":[this.get(0),this.get(2),this.get(1),this.get(3),0,0].join()},e.toFilter=function(){return"progid:DXImageTransform.Microsoft.Matrix(M11="+this.get(0)+", M12="+this.get(2)+", M21="+this.get(1)+", M22="+this.get(3)+", Dx="+this.get(4)+", Dy="+this.get(5)+", sizingmethod='auto expand')"},e.offset=function(){return[this.e.toFixed(4),this.f.toFixed(4)]},e.split=function(){var e={};e.dx=this.e,e.dy=this.f;var r=[[this.a,this.c],[this.b,this.d]];e.scalex=F.sqrt(t(r[0])),n(r[0]),e.shear=r[0][0]*r[1][0]+r[0][1]*r[1][1],r[1]=[r[1][0]-r[0][0]*e.shear,r[1][1]-r[0][1]*e.shear],e.scaley=F.sqrt(t(r[1])),n(r[1]),e.shear/=e.scaley;var a=-r[0][1],o=r[1][1];return 0>o?(e.rotate=i.deg(F.acos(o)),0>a&&(e.rotate=360-e.rotate)):e.rotate=i.deg(F.asin(a)),e.isSimple=!(+e.shear.toFixed(9)||e.scalex.toFixed(9)!=e.scaley.toFixed(9)&&e.rotate),e.isSuperSimple=!+e.shear.toFixed(9)&&e.scalex.toFixed(9)==e.scaley.toFixed(9)&&!e.rotate,e.noRotation=!+e.shear.toFixed(9)&&!e.rotate,e},e.toTransformString=function(e){var t=e||this[P]();return t.isSimple?(t.scalex=+t.scalex.toFixed(4),t.scaley=+t.scaley.toFixed(4),t.rotate=+t.rotate.toFixed(4),(t.dx||t.dy?"t"+[t.dx,t.dy]:L)+(1!=t.scalex||1!=t.scaley?"s"+[t.scalex,t.scaley,0,0]:L)+(t.rotate?"r"+[t.rotate,0,0]:L)):"m"+[this.get(0),this.get(1),this.get(2),this.get(3),this.get(4),this.get(5)]}}(f.prototype);var $e=navigator.userAgent.match(/Version\/(.*?)\s/)||navigator.userAgent.match(/Chrome\/(\d+)/);w.safari="Apple Computer, Inc."==navigator.vendor&&($e&&$e[1]<4||"iP"==navigator.platform.slice(0,2))||"Google Inc."==navigator.vendor&&$e&&$e[1]<8?function(){var e=this.rect(-99,-99,this.width+99,this.height+99).attr({stroke:"none"});setTimeout(function(){e.remove()})}:he;for(var qe=function(){this.returnValue=!1},He=function(){return this.originalEvent.preventDefault()},We=function(){this.cancelBubble=!0},Ve=function(){return this.originalEvent.stopPropagation()},Ge=function(e){var t=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,i=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft;return{x:e.clientX+i,y:e.clientY+t}},Ye=function(){return S.doc.addEventListener?function(e,t,i,n){var r=function(e){var t=Ge(e);return i.call(n,e,t.x,t.y)};if(e.addEventListener(t,r,!1),M&&j[t]){var a=function(t){for(var r=Ge(t),a=t,o=0,s=t.targetTouches&&t.targetTouches.length;s>o;o++)if(t.targetTouches[o].target==e){t=t.targetTouches[o],t.originalEvent=a,t.preventDefault=He,t.stopPropagation=Ve;break}return i.call(n,t,r.x,r.y)};e.addEventListener(j[t],a,!1)}return function(){return e.removeEventListener(t,r,!1),M&&j[t]&&e.removeEventListener(j[t],a,!1),!0}}:S.doc.attachEvent?function(e,t,i,n){var r=function(e){e=e||S.win.event;var t=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,r=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft,a=e.clientX+r,o=e.clientY+t;return e.preventDefault=e.preventDefault||qe,e.stopPropagation=e.stopPropagation||We,i.call(n,e,a,o)};return e.attachEvent("on"+t,r),function(){return e.detachEvent("on"+t,r),!0}}:void 0}(),Ke=[],Xe=function(e){for(var i,n=e.clientX,r=e.clientY,a=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,o=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft,s=Ke.length;s--;){if(i=Ke[s],M&&e.touches){for(var l,c=e.touches.length;c--;)if(l=e.touches[c],l.identifier==i.el._drag.id){n=l.clientX,r=l.clientY,(e.originalEvent?e.originalEvent:e).preventDefault();break}}else e.preventDefault();var u,d=i.el.node,h=d.nextSibling,p=d.parentNode,f=d.style.display;S.win.opera&&p.removeChild(d),d.style.display="none",u=i.el.paper.getElementByPoint(n,r),d.style.display=f,S.win.opera&&(h?p.insertBefore(d,h):p.appendChild(d)),u&&t("raphael.drag.over."+i.el.id,i.el,u),n+=o,r+=a,t("raphael.drag.move."+i.el.id,i.move_scope||i.el,n-i.el._drag.x,r-i.el._drag.y,n,r,e)}},Qe=function(e){i.unmousemove(Xe).unmouseup(Qe);for(var n,r=Ke.length;r--;)n=Ke[r],n.el._drag={},t("raphael.drag.end."+n.el.id,n.end_scope||n.start_scope||n.move_scope||n.el,e);Ke=[]},Ze=i.el={},Je=R.length;Je--;)!function(e){i[e]=Ze[e]=function(t,n){return i.is(t,"function")&&(this.events=this.events||[],this.events.push({name:e,f:t,unbind:Ye(this.shape||this.node||S.doc,e,t,n||this)})),this},i["un"+e]=Ze["un"+e]=function(t){for(var n=this.events||[],r=n.length;r--;)n[r].name!=e||!i.is(t,"undefined")&&n[r].f!=t||(n[r].unbind(),n.splice(r,1),!n.length&&delete this.events);return this}}(R[Je]);Ze.data=function(e,n){var r=ue[this.id]=ue[this.id]||{};if(0==arguments.length)return r;if(1==arguments.length){if(i.is(e,"object")){for(var a in e)e[T](a)&&this.data(a,e[a]);return this}return t("raphael.data.get."+this.id,this,r[e],e),r[e]}return r[e]=n,t("raphael.data.set."+this.id,this,n,e),this},Ze.removeData=function(e){return null==e?ue[this.id]={}:ue[this.id]&&delete ue[this.id][e],this},Ze.getData=function(){return n(ue[this.id]||{})},Ze.hover=function(e,t,i,n){return this.mouseover(e,i).mouseout(t,n||i)},Ze.unhover=function(e,t){return this.unmouseover(e).unmouseout(t)};var et=[];Ze.drag=function(e,n,r,a,o,s){function l(l){(l.originalEvent||l).preventDefault();var c=l.clientX,u=l.clientY,d=S.doc.documentElement.scrollTop||S.doc.body.scrollTop,h=S.doc.documentElement.scrollLeft||S.doc.body.scrollLeft;if(this._drag.id=l.identifier,M&&l.touches)for(var p,f=l.touches.length;f--;)if(p=l.touches[f],this._drag.id=p.identifier,p.identifier==this._drag.id){c=p.clientX,u=p.clientY;break}this._drag.x=c+h,this._drag.y=u+d,!Ke.length&&i.mousemove(Xe).mouseup(Qe),Ke.push({el:this,move_scope:a,start_scope:o,end_scope:s}),n&&t.on("raphael.drag.start."+this.id,n),e&&t.on("raphael.drag.move."+this.id,e),r&&t.on("raphael.drag.end."+this.id,r),t("raphael.drag.start."+this.id,o||a||this,l.clientX+h,l.clientY+d,l)}return this._drag={},et.push({el:this,start:l}),this.mousedown(l),this},Ze.onDragOver=function(e){e?t.on("raphael.drag.over."+this.id,e):t.unbind("raphael.drag.over."+this.id)},Ze.undrag=function(){for(var e=et.length;e--;)et[e].el==this&&(this.unmousedown(et[e].start),et.splice(e,1),t.unbind("raphael.drag.*."+this.id));!et.length&&i.unmousemove(Xe).unmouseup(Qe),Ke=[]},w.circle=function(e,t,n){var r=i._engine.circle(this,e||0,t||0,n||0);return this.__set__&&this.__set__.push(r),r},w.rect=function(e,t,n,r,a){var o=i._engine.rect(this,e||0,t||0,n||0,r||0,a||0);return this.__set__&&this.__set__.push(o),o},w.ellipse=function(e,t,n,r){var a=i._engine.ellipse(this,e||0,t||0,n||0,r||0);return this.__set__&&this.__set__.push(a),a},w.path=function(e){e&&!i.is(e,V)&&!i.is(e[0],G)&&(e+=L);var t=i._engine.path(i.format[I](i,arguments),this);return this.__set__&&this.__set__.push(t),t},w.image=function(e,t,n,r,a){var o=i._engine.image(this,e||"about:blank",t||0,n||0,r||0,a||0);return this.__set__&&this.__set__.push(o),o},w.text=function(e,t,n){var r=i._engine.text(this,e||0,t||0,N(n));return this.__set__&&this.__set__.push(r),r},w.set=function(e){!i.is(e,"array")&&(e=Array.prototype.splice.call(arguments,0,arguments.length));var t=new ht(e);return this.__set__&&this.__set__.push(t),t.paper=this,t.type="set",t},w.setStart=function(e){this.__set__=e||this.set()},w.setFinish=function(){var e=this.__set__;return delete this.__set__,e},w.getSize=function(){var e=this.canvas.parentNode;return{width:e.offsetWidth,height:e.offsetHeight}},w.setSize=function(e,t){return i._engine.setSize.call(this,e,t)},w.setViewBox=function(e,t,n,r,a){return i._engine.setViewBox.call(this,e,t,n,r,a)},w.top=w.bottom=null,w.raphael=i;var tt=function(e){var t=e.getBoundingClientRect(),i=e.ownerDocument,n=i.body,r=i.documentElement,a=r.clientTop||n.clientTop||0,o=r.clientLeft||n.clientLeft||0;return{y:t.top+(S.win.pageYOffset||r.scrollTop||n.scrollTop)-a,x:t.left+(S.win.pageXOffset||r.scrollLeft||n.scrollLeft)-o}};w.getElementByPoint=function(e,t){var i=this,n=i.canvas,r=S.doc.elementFromPoint(e,t);if(S.win.opera&&"svg"==r.tagName){var a=tt(n),o=n.createSVGRect();o.x=e-a.x,o.y=t-a.y,o.width=o.height=1;var s=n.getIntersectionList(o,null);s.length&&(r=s[s.length-1])}if(!r)return null;for(;r.parentNode&&r!=n.parentNode&&!r.raphael;)r=r.parentNode;return r==i.canvas.parentNode&&(r=n),r=r&&r.raphael?i.getById(r.raphaelid):null},w.getElementsByBBox=function(e){var t=this.set();return this.forEach(function(n){i.isBBoxIntersect(n.getBBox(),e)&&t.push(n)}),t},w.getById=function(e){for(var t=this.bottom;t;){if(t.id==e)return t;t=t.next}return null},w.forEach=function(e,t){for(var i=this.bottom;i;){if(!1===e.call(t,i))return this;i=i.next}return this},w.getElementsByPoint=function(e,t){var i=this.set();return this.forEach(function(n){n.isPointInside(e,t)&&i.push(n)}),i},Ze.isPointInside=function(e,t){var n=this.realPath=ge[this.type](this);return this.attr("transform")&&this.attr("transform").length&&(n=i.transformPath(n,this.attr("transform"))),i.isPointInsidePath(n,e,t)},Ze.getBBox=function(e){if(this.removed)return{};var t=this._;return e?((t.dirty||!t.bboxwt)&&(this.realPath=ge[this.type](this),t.bboxwt=Ee(this.realPath),t.bboxwt.toString=m,t.dirty=0),t.bboxwt):((t.dirty||t.dirtyT||!t.bbox)&&((t.dirty||!this.realPath)&&(t.bboxwt=0,this.realPath=ge[this.type](this)),t.bbox=Ee(ve(this.realPath,this.matrix)),t.bbox.toString=m,t.dirty=t.dirtyT=0),t.bbox)},Ze.clone=function(){if(this.removed)return null;var e=this.paper[this.type]().attr(this.attr());return this.__set__&&this.__set__.push(e),e},Ze.glow=function(e){if("text"==this.type)return null;e=e||{};var t={width:(e.width||10)+(+this.attr("stroke-width")||1),fill:e.fill||!1,opacity:e.opacity||.5,offsetx:e.offsetx||0,offsety:e.offsety||0,color:e.color||"#000"},i=t.width/2,n=this.paper,r=n.set(),a=this.realPath||ge[this.type](this);a=this.matrix?ve(a,this.matrix):a;for(var o=1;i+1>o;o++)r.push(n.path(a).attr({stroke:t.color,fill:t.fill?t.color:"none","stroke-linejoin":"round","stroke-linecap":"round","stroke-width":+(t.width/i*o).toFixed(3),opacity:+(t.opacity/i).toFixed(3)}));return r.insertBefore(this).translate(t.offsetx,t.offsety)};var it=function(e,t,n,r,a,o,s,l,d){return null==d?c(e,t,n,r,a,o,s,l):i.findDotsAtSegment(e,t,n,r,a,o,s,l,u(e,t,n,r,a,o,s,l,d))},nt=function(e,t){return function(n,r,a){n=Re(n);for(var o,s,l,c,u,d="",h={},p=0,f=0,m=n.length;m>f;f++){if(l=n[f],"M"==l[0])o=+l[1],s=+l[2];else{if(c=it(o,s,l[1],l[2],l[3],l[4],l[5],l[6]),p+c>r){if(t&&!h.start){if(u=it(o,s,l[1],l[2],l[3],l[4],l[5],l[6],r-p),d+=["C"+u.start.x,u.start.y,u.m.x,u.m.y,u.x,u.y],a)return d;h.start=d,d=["M"+u.x,u.y+"C"+u.n.x,u.n.y,u.end.x,u.end.y,l[5],l[6]].join(),p+=c,o=+l[5],s=+l[6];continue}if(!e&&!t)return u=it(o,s,l[1],l[2],l[3],l[4],l[5],l[6],r-p),{x:u.x,y:u.y,alpha:u.alpha}}p+=c,o=+l[5],s=+l[6]}d+=l.shift()+l}return h.end=d,u=e?p:t?h:i.findDotsAtSegment(o,s,l[0],l[1],l[2],l[3],l[4],l[5],1),u.alpha&&(u={x:u.x,y:u.y,alpha:u.alpha}),u}},rt=nt(1),at=nt(),ot=nt(0,1);i.getTotalLength=rt,i.getPointAtLength=at,i.getSubpath=function(e,t,i){if(this.getTotalLength(e)-i<1e-6)return ot(e,t).end;var n=ot(e,i,1);return t?ot(n,t).end:n},Ze.getTotalLength=function(){var e=this.getPath();if(e)return this.node.getTotalLength?this.node.getTotalLength():rt(e)},Ze.getPointAtLength=function(e){var t=this.getPath();if(t)return at(t,e)},Ze.getPath=function(){var e,t=i._getPath[this.type];if("text"!=this.type&&"set"!=this.type)return t&&(e=t(this)),e},Ze.getSubpath=function(e,t){var n=this.getPath();if(n)return i.getSubpath(n,e,t)};var st=i.easing_formulas={linear:function(e){return e},"<":function(e){return q(e,1.7)},">":function(e){return q(e,.48)},"<>":function(e){var t=.48-e/1.04,i=F.sqrt(.1734+t*t),n=i-t,r=q($(n),1/3)*(0>n?-1:1),a=-i-t,o=q($(a),1/3)*(0>a?-1:1),s=r+o+.5;return 3*(1-s)*s*s+s*s*s},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){e-=1;var t=1.70158;return e*e*((t+1)*e+t)+1},elastic:function(e){return e==!!e?e:q(2,-10*e)*F.sin(2*(e-.075)*H/.3)+1},bounce:function(e){var t,i=7.5625,n=2.75;return 1/n>e?t=i*e*e:2/n>e?(e-=1.5/n,t=i*e*e+.75):2.5/n>e?(e-=2.25/n,t=i*e*e+.9375):(e-=2.625/n,t=i*e*e+.984375),t}};st.easeIn=st["ease-in"]=st["<"],st.easeOut=st["ease-out"]=st[">"],st.easeInOut=st["ease-in-out"]=st["<>"],st["back-in"]=st.backIn,st["back-out"]=st.backOut;var lt=[],ct=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(e){setTimeout(e,16)},ut=function(){for(var e=+new Date,n=0;n<lt.length;n++){var r=lt[n];if(!r.el.removed&&!r.paused){var a,o,s=e-r.start,l=r.ms,c=r.easing,u=r.from,d=r.diff,h=r.to,p=(r.t,r.el),f={},m={};if(r.initstatus?(s=(r.initstatus*r.anim.top-r.prev)/(r.percent-r.prev)*l,r.status=r.initstatus,delete r.initstatus,r.stop&<.splice(n--,1)):r.status=(r.prev+(r.percent-r.prev)*(s/l))/r.anim.top,!(0>s))if(l>s){var g=c(s/l);for(var v in u)if(u[T](v)){switch(ne[v]){case W:a=+u[v]+g*l*d[v];break;case"colour":a="rgb("+[dt(Z(u[v].r+g*l*d[v].r)),dt(Z(u[v].g+g*l*d[v].g)),dt(Z(u[v].b+g*l*d[v].b))].join(",")+")";break;case"path":a=[]
|
||
;for(var _=0,b=u[v].length;b>_;_++){a[_]=[u[v][_][0]];for(var w=1,x=u[v][_].length;x>w;w++)a[_][w]=+u[v][_][w]+g*l*d[v][_][w];a[_]=a[_].join(O)}a=a.join(O);break;case"transform":if(d[v].real)for(a=[],_=0,b=u[v].length;b>_;_++)for(a[_]=[u[v][_][0]],w=1,x=u[v][_].length;x>w;w++)a[_][w]=u[v][_][w]+g*l*d[v][_][w];else{var k=function(e){return+u[v][e]+g*l*d[v][e]};a=[["m",k(0),k(1),k(2),k(3),k(4),k(5)]]}break;case"csv":if("clip-rect"==v)for(a=[],_=4;_--;)a[_]=+u[v][_]+g*l*d[v][_];break;default:var C=[][D](u[v]);for(a=[],_=p.paper.customAttributes[v].length;_--;)a[_]=+C[_]+g*l*d[v][_]}f[v]=a}p.attr(f),function(e,i,n){setTimeout(function(){t("raphael.anim.frame."+e,i,n)})}(p.id,p,r.anim)}else{if(function(e,n,r){setTimeout(function(){t("raphael.anim.frame."+n.id,n,r),t("raphael.anim.finish."+n.id,n,r),i.is(e,"function")&&e.call(n)})}(r.callback,p,r.anim),p.attr(h),lt.splice(n--,1),r.repeat>1&&!r.next){for(o in h)h[T](o)&&(m[o]=r.totalOrigin[o]);r.el.attr(m),y(r.anim,r.el,r.anim.percents[0],null,r.totalOrigin,r.repeat-1)}r.next&&!r.stop&&y(r.anim,r.el,r.next,null,r.totalOrigin,r.repeat)}}}i.svg&&p&&p.paper&&p.paper.safari(),lt.length&&ct(ut)},dt=function(e){return e>255?255:0>e?0:e};Ze.animateWith=function(e,t,n,r,a,o){var s=this;if(s.removed)return o&&o.call(s),s;var l=n instanceof v?n:i.animation(n,r,a,o);y(l,s,l.percents[0],null,s.attr());for(var c=0,u=lt.length;u>c;c++)if(lt[c].anim==t&<[c].el==e){lt[u-1].start=lt[c].start;break}return s},Ze.onAnimation=function(e){return e?t.on("raphael.anim.frame."+this.id,e):t.unbind("raphael.anim.frame."+this.id),this},v.prototype.delay=function(e){var t=new v(this.anim,this.ms);return t.times=this.times,t.del=+e||0,t},v.prototype.repeat=function(e){var t=new v(this.anim,this.ms);return t.del=this.del,t.times=F.floor(B(e,0))||1,t},i.animation=function(e,t,n,r){if(e instanceof v)return e;(i.is(n,"function")||!n)&&(r=r||n||null,n=null),e=Object(e),t=+t||0;var a,o,s={};for(o in e)e[T](o)&&J(o)!=o&&J(o)+"%"!=o&&(a=!0,s[o]=e[o]);if(a)return n&&(s.easing=n),r&&(s.callback=r),new v({100:s},t);if(r){var l=0;for(var c in e){var u=ee(c);e[T](c)&&u>l&&(l=u)}l+="%",!e[l].callback&&(e[l].callback=r)}return new v(e,t)},Ze.animate=function(e,t,n,r){var a=this;if(a.removed)return r&&r.call(a),a;var o=e instanceof v?e:i.animation(e,t,n,r);return y(o,a,o.percents[0],null,a.attr()),a},Ze.setTime=function(e,t){return e&&null!=t&&this.status(e,U(t,e.ms)/e.ms),this},Ze.status=function(e,t){var i,n,r=[],a=0;if(null!=t)return y(e,this,-1,U(t,1)),this;for(i=lt.length;i>a;a++)if(n=lt[a],n.el.id==this.id&&(!e||n.anim==e)){if(e)return n.status;r.push({anim:n.anim,status:n.status})}return e?0:r},Ze.pause=function(e){for(var i=0;i<lt.length;i++)lt[i].el.id!=this.id||e&<[i].anim!=e||!1!==t("raphael.anim.pause."+this.id,this,lt[i].anim)&&(lt[i].paused=!0);return this},Ze.resume=function(e){for(var i=0;i<lt.length;i++)if(lt[i].el.id==this.id&&(!e||lt[i].anim==e)){var n=lt[i];!1!==t("raphael.anim.resume."+this.id,this,n.anim)&&(delete n.paused,this.status(n.anim,n.status))}return this},Ze.stop=function(e){for(var i=0;i<lt.length;i++)lt[i].el.id!=this.id||e&<[i].anim!=e||!1!==t("raphael.anim.stop."+this.id,this,lt[i].anim)&<.splice(i--,1);return this},t.on("raphael.remove",_),t.on("raphael.clear",_),Ze.toString=function(){return"Raphaël’s object"};var ht=function(e){if(this.items=[],this.length=0,this.type="set",e)for(var t=0,i=e.length;i>t;t++)!e[t]||e[t].constructor!=Ze.constructor&&e[t].constructor!=ht||(this[this.items.length]=this.items[this.items.length]=e[t],this.length++)},pt=ht.prototype;pt.push=function(){for(var e,t,i=0,n=arguments.length;n>i;i++)!(e=arguments[i])||e.constructor!=Ze.constructor&&e.constructor!=ht||(t=this.items.length,this[t]=this.items[t]=e,this.length++);return this},pt.pop=function(){return this.length&&delete this[this.length--],this.items.pop()},pt.forEach=function(e,t){for(var i=0,n=this.items.length;n>i;i++)if(!1===e.call(t,this.items[i],i))return this;return this};for(var ft in Ze)Ze[T](ft)&&(pt[ft]=function(e){return function(){var t=arguments;return this.forEach(function(i){i[e][I](i,t)})}}(ft));return pt.attr=function(e,t){if(e&&i.is(e,G)&&i.is(e[0],"object"))for(var n=0,r=e.length;r>n;n++)this.items[n].attr(e[n]);else for(var a=0,o=this.items.length;o>a;a++)this.items[a].attr(e,t);return this},pt.clear=function(){for(;this.length;)this.pop()},pt.splice=function(e,t){e=0>e?B(this.length+e,0):e,t=B(0,U(this.length-e,t));var i,n=[],r=[],a=[];for(i=2;i<arguments.length;i++)a.push(arguments[i]);for(i=0;t>i;i++)r.push(this[e+i]);for(;i<this.length-e;i++)n.push(this[e+i]);var o=a.length;for(i=0;i<o+n.length;i++)this.items[e+i]=this[e+i]=o>i?a[i]:n[i-o];for(i=this.items.length=this.length-=t-o;this[i];)delete this[i++];return new ht(r)},pt.exclude=function(e){for(var t=0,i=this.length;i>t;t++)if(this[t]==e)return this.splice(t,1),!0},pt.animate=function(e,t,n,r){(i.is(n,"function")||!n)&&(r=n||null);var a,o,s=this.items.length,l=s,c=this;if(!s)return this;r&&(o=function(){!--s&&r.call(c)}),n=i.is(n,V)?n:o;var u=i.animation(e,t,n,o);for(a=this.items[--l].animate(u);l--;)this.items[l]&&!this.items[l].removed&&this.items[l].animateWith(a,u,u),this.items[l]&&!this.items[l].removed||s--;return this},pt.insertAfter=function(e){for(var t=this.items.length;t--;)this.items[t].insertAfter(e);return this},pt.getBBox=function(){for(var e=[],t=[],i=[],n=[],r=this.items.length;r--;)if(!this.items[r].removed){var a=this.items[r].getBBox();e.push(a.x),t.push(a.y),i.push(a.x+a.width),n.push(a.y+a.height)}return e=U[I](0,e),t=U[I](0,t),i=B[I](0,i),n=B[I](0,n),{x:e,y:t,x2:i,y2:n,width:i-e,height:n-t}},pt.clone=function(e){e=this.paper.set();for(var t=0,i=this.items.length;i>t;t++)e.push(this.items[t].clone());return e},pt.toString=function(){return"Raphaël‘s set"},pt.glow=function(e){var t=this.paper.set();return this.forEach(function(i){var n=i.glow(e);null!=n&&n.forEach(function(e){t.push(e)})}),t},pt.isPointInside=function(e,t){var i=!1;return this.forEach(function(n){return n.isPointInside(e,t)?(i=!0,!1):void 0}),i},i.registerFont=function(e){if(!e.face)return e;this.fonts=this.fonts||{};var t={w:e.w,face:{},glyphs:{}},i=e.face["font-family"];for(var n in e.face)e.face[T](n)&&(t.face[n]=e.face[n]);if(this.fonts[i]?this.fonts[i].push(t):this.fonts[i]=[t],!e.svg){t.face["units-per-em"]=ee(e.face["units-per-em"],10);for(var r in e.glyphs)if(e.glyphs[T](r)){var a=e.glyphs[r];if(t.glyphs[r]={w:a.w,k:{},d:a.d&&"M"+a.d.replace(/[mlcxtrv]/g,function(e){return{l:"L",c:"C",x:"z",t:"m",r:"l",v:"c"}[e]||"M"})+"z"},a.k)for(var o in a.k)a[T](o)&&(t.glyphs[r].k[o]=a.k[o])}}return e},w.getFont=function(e,t,n,r){if(r=r||"normal",n=n||"normal",t=+t||{normal:400,bold:700,lighter:300,bolder:800}[t]||400,i.fonts){var a=i.fonts[e];if(!a){var o=new RegExp("(^|\\s)"+e.replace(/[^\w\d\s+!~.:_-]/g,L)+"(\\s|$)","i");for(var s in i.fonts)if(i.fonts[T](s)&&o.test(s)){a=i.fonts[s];break}}var l;if(a)for(var c=0,u=a.length;u>c&&(l=a[c],l.face["font-weight"]!=t||l.face["font-style"]!=n&&l.face["font-style"]||l.face["font-stretch"]!=r);c++);return l}},w.print=function(e,t,n,r,a,o,s,l){o=o||"middle",s=B(U(s||0,1),-1),l=B(U(l||1,3),1);var c,u=N(n)[P](L),d=0,h=0,p=L;if(i.is(r,"string")&&(r=this.getFont(r)),r){c=(a||16)/r.face["units-per-em"];for(var f=r.face.bbox[P](x),m=+f[0],g=f[3]-f[1],v=0,y=+f[1]+("baseline"==o?g+ +r.face.descent:g/2),_=0,b=u.length;b>_;_++){if("\n"==u[_])d=0,k=0,h=0,v+=g*l;else{var w=h&&r.glyphs[u[_-1]]||{},k=r.glyphs[u[_]];d+=h?(w.w||r.w)+(w.k&&w.k[u[_]]||0)+r.w*s:0,h=1}k&&k.d&&(p+=i.transformPath(k.d,["t",d*c,v*c,"s",c,c,m,y,"t",(e-m)/c,(t-y)/c]))}}return this.path(p).attr({fill:"#000",stroke:"none"})},w.add=function(e){if(i.is(e,"array"))for(var t,n=this.set(),r=0,a=e.length;a>r;r++)t=e[r]||{},k[T](t.type)&&n.push(this[t.type]().attr(t));return n},i.format=function(e,t){var n=i.is(t,G)?[0][D](t):arguments;return e&&i.is(e,V)&&n.length-1&&(e=e.replace(C,function(e,t){return null==n[++t]?L:n[t]})),e||L},i.fullfill=function(){var e=/\{([^\}]+)\}/g,t=/(?:(?:^|\.)(.+?)(?=\[|\.|$|\()|\[('|")(.+?)\2\])(\(\))?/g,i=function(e,i,n){var r=n;return i.replace(t,function(e,t,i,n,a){t=t||n,r&&(t in r&&(r=r[t]),"function"==typeof r&&a&&(r=r()))}),r=(null==r||r==n?e:r)+""};return function(t,n){return String(t).replace(e,function(e,t){return i(e,t,n)})}}(),i.ninja=function(){return E.was?S.win.Raphael=E.is:delete Raphael,i},i.st=pt,t.on("raphael.DOMload",function(){b=!0}),function(e,t,n){function r(){/in/.test(e.readyState)?setTimeout(r,9):i.eve("raphael.DOMload")}null==e.readyState&&e.addEventListener&&(e.addEventListener(t,n=function(){e.removeEventListener(t,n,!1),e.readyState="complete"},!1),e.readyState="loading"),r()}(document,"DOMContentLoaded"),function(){if(i.svg){var e="hasOwnProperty",t=String,n=parseFloat,r=parseInt,a=Math,o=a.max,s=a.abs,l=a.pow,c=/[, ]+/,u=i.eve,d="",h=" ",p="http://www.w3.org/1999/xlink",f={block:"M5,0 0,2.5 5,5z",classic:"M5,0 0,2.5 5,5 3.5,3 3.5,2z",diamond:"M2.5,0 5,2.5 2.5,5 0,2.5z",open:"M6,1 1,3.5 6,6",oval:"M2.5,0A2.5,2.5,0,0,1,2.5,5 2.5,2.5,0,0,1,2.5,0z"},m={};i.toString=function(){return"Your browser supports SVG.\nYou are running Raphaël "+this.version};var g=function(n,r){if(r){"string"==typeof n&&(n=g(n));for(var a in r)r[e](a)&&("xlink:"==a.substring(0,6)?n.setAttributeNS(p,a.substring(6),t(r[a])):n.setAttribute(a,t(r[a])))}else n=i._g.doc.createElementNS("http://www.w3.org/2000/svg",n),n.style&&(n.style.webkitTapHighlightColor="rgba(0,0,0,0)");return n},v=function(e,r){var c="linear",u=e.id+r,h=.5,p=.5,f=e.node,m=e.paper,v=f.style,y=i._g.doc.getElementById(u);if(!y){if(r=t(r).replace(i._radial_gradient,function(e,t,i){if(c="radial",t&&i){h=n(t),p=n(i);var r=2*(p>.5)-1;l(h-.5,2)+l(p-.5,2)>.25&&(p=a.sqrt(.25-l(h-.5,2))*r+.5)&&.5!=p&&(p=p.toFixed(5)-1e-5*r)}return d}),r=r.split(/\s*\-\s*/),"linear"==c){var _=r.shift();if(_=-n(_),isNaN(_))return null;var b=[0,0,a.cos(i.rad(_)),a.sin(i.rad(_))],w=1/(o(s(b[2]),s(b[3]))||1);b[2]*=w,b[3]*=w,b[2]<0&&(b[0]=-b[2],b[2]=0),b[3]<0&&(b[1]=-b[3],b[3]=0)}var x=i._parseDots(r);if(!x)return null;if(u=u.replace(/[\(\)\s,\xb0#]/g,"_"),e.gradient&&u!=e.gradient.id&&(m.defs.removeChild(e.gradient),delete e.gradient),!e.gradient){y=g(c+"Gradient",{id:u}),e.gradient=y,g(y,"radial"==c?{fx:h,fy:p}:{x1:b[0],y1:b[1],x2:b[2],y2:b[3],gradientTransform:e.matrix.invert()}),m.defs.appendChild(y);for(var k=0,C=x.length;C>k;k++)y.appendChild(g("stop",{offset:x[k].offset?x[k].offset:k?"100%":"0%","stop-color":x[k].color||"#fff"}))}}return g(f,{fill:"url("+document.location+"#"+u+")",opacity:1,"fill-opacity":1}),v.fill=d,v.opacity=1,v.fillOpacity=1,1},y=function(e){var t=e.getBBox(1);g(e.pattern,{patternTransform:e.matrix.invert()+" translate("+t.x+","+t.y+")"})},_=function(n,r,a){if("path"==n.type){for(var o,s,l,c,u,h=t(r).toLowerCase().split("-"),p=n.paper,v=a?"end":"start",y=n.node,_=n.attrs,b=_["stroke-width"],w=h.length,x="classic",k=3,C=3,T=5;w--;)switch(h[w]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":x=h[w];break;case"wide":C=5;break;case"narrow":C=2;break;case"long":k=5;break;case"short":k=2}if("open"==x?(k+=2,C+=2,T+=2,l=1,c=a?4:1,u={fill:"none",stroke:_.stroke}):(c=l=k/2,u={fill:_.stroke,stroke:"none"}),n._.arrows?a?(n._.arrows.endPath&&m[n._.arrows.endPath]--,n._.arrows.endMarker&&m[n._.arrows.endMarker]--):(n._.arrows.startPath&&m[n._.arrows.startPath]--,n._.arrows.startMarker&&m[n._.arrows.startMarker]--):n._.arrows={},"none"!=x){var S="raphael-marker-"+x,E="raphael-marker-"+v+x+k+C+"-obj"+n.id;i._g.doc.getElementById(S)?m[S]++:(p.defs.appendChild(g(g("path"),{"stroke-linecap":"round",d:f[x],id:S})),m[S]=1);var A,I=i._g.doc.getElementById(E);I?(m[E]++,A=I.getElementsByTagName("use")[0]):(I=g(g("marker"),{id:E,markerHeight:C,markerWidth:k,orient:"auto",refX:c,refY:C/2}),A=g(g("use"),{"xlink:href":"#"+S,transform:(a?"rotate(180 "+k/2+" "+C/2+") ":d)+"scale("+k/T+","+C/T+")","stroke-width":(1/((k/T+C/T)/2)).toFixed(4)}),I.appendChild(A),p.defs.appendChild(I),m[E]=1),g(A,u);var D=l*("diamond"!=x&&"oval"!=x);a?(o=n._.arrows.startdx*b||0,s=i.getTotalLength(_.path)-D*b):(o=D*b,s=i.getTotalLength(_.path)-(n._.arrows.enddx*b||0)),u={},u["marker-"+v]="url(#"+E+")",(s||o)&&(u.d=i.getSubpath(_.path,o,s)),g(y,u),n._.arrows[v+"Path"]=S,n._.arrows[v+"Marker"]=E,n._.arrows[v+"dx"]=D,n._.arrows[v+"Type"]=x,n._.arrows[v+"String"]=r}else a?(o=n._.arrows.startdx*b||0,s=i.getTotalLength(_.path)-o):(o=0,s=i.getTotalLength(_.path)-(n._.arrows.enddx*b||0)),n._.arrows[v+"Path"]&&g(y,{d:i.getSubpath(_.path,o,s)}),delete n._.arrows[v+"Path"],delete n._.arrows[v+"Marker"],delete n._.arrows[v+"dx"],delete n._.arrows[v+"Type"],delete n._.arrows[v+"String"];for(u in m)if(m[e](u)&&!m[u]){var M=i._g.doc.getElementById(u);M&&M.parentNode.removeChild(M)}}},b={"":[0],none:[0],"-":[3,1],".":[1,1],"-.":[3,1,1,1],"-..":[3,1,1,1,1,1],". ":[1,3],"- ":[4,3],"--":[8,3],"- .":[4,3,1,3],"--.":[8,3,1,3],"--..":[8,3,1,3,1,3]},w=function(e,i,n){if(i=b[t(i).toLowerCase()]){for(var r=e.attrs["stroke-width"]||"1",a={round:r,square:r,butt:0}[e.attrs["stroke-linecap"]||n["stroke-linecap"]]||0,o=[],s=i.length;s--;)o[s]=i[s]*r+(s%2?1:-1)*a;g(e.node,{"stroke-dasharray":o.join(",")})}},x=function(n,a){var l=n.node,u=n.attrs,h=l.style.visibility;l.style.visibility="hidden";for(var f in a)if(a[e](f)){if(!i._availableAttrs[e](f))continue;var m=a[f];switch(u[f]=m,f){case"blur":n.blur(m);break;case"title":var b=l.getElementsByTagName("title");if(b.length&&(b=b[0]))b.firstChild.nodeValue=m;else{b=g("title");var x=i._g.doc.createTextNode(m);b.appendChild(x),l.appendChild(b)}break;case"href":case"target":var C=l.parentNode;if("a"!=C.tagName.toLowerCase()){var T=g("a");C.insertBefore(T,l),T.appendChild(l),C=T}"target"==f?C.setAttributeNS(p,"show","blank"==m?"new":m):C.setAttributeNS(p,f,m);break;case"cursor":l.style.cursor=m;break;case"transform":n.transform(m);break;case"arrow-start":_(n,m);break;case"arrow-end":_(n,m,1);break;case"clip-rect":var S=t(m).split(c);if(4==S.length){n.clip&&n.clip.parentNode.parentNode.removeChild(n.clip.parentNode);var E=g("clipPath"),A=g("rect");E.id=i.createUUID(),g(A,{x:S[0],y:S[1],width:S[2],height:S[3]}),E.appendChild(A),n.paper.defs.appendChild(E),g(l,{"clip-path":"url(#"+E.id+")"}),n.clip=A}if(!m){var I=l.getAttribute("clip-path");if(I){var D=i._g.doc.getElementById(I.replace(/(^url\(#|\)$)/g,d));D&&D.parentNode.removeChild(D),g(l,{"clip-path":d}),delete n.clip}}break;case"path":"path"==n.type&&(g(l,{d:m?u.path=i._pathToAbsolute(m):"M0,0"}),n._.dirty=1,n._.arrows&&("startString"in n._.arrows&&_(n,n._.arrows.startString),"endString"in n._.arrows&&_(n,n._.arrows.endString,1)));break;case"width":if(l.setAttribute(f,m),n._.dirty=1,!u.fx)break;f="x",m=u.x;case"x":u.fx&&(m=-u.x-(u.width||0));case"rx":if("rx"==f&&"rect"==n.type)break;case"cx":l.setAttribute(f,m),n.pattern&&y(n),n._.dirty=1;break;case"height":if(l.setAttribute(f,m),n._.dirty=1,!u.fy)break;f="y",m=u.y;case"y":u.fy&&(m=-u.y-(u.height||0));case"ry":if("ry"==f&&"rect"==n.type)break;case"cy":l.setAttribute(f,m),n.pattern&&y(n),n._.dirty=1;break;case"r":"rect"==n.type?g(l,{rx:m,ry:m}):l.setAttribute(f,m),n._.dirty=1;break;case"src":"image"==n.type&&l.setAttributeNS(p,"href",m);break;case"stroke-width":(1!=n._.sx||1!=n._.sy)&&(m/=o(s(n._.sx),s(n._.sy))||1),l.setAttribute(f,m),u["stroke-dasharray"]&&w(n,u["stroke-dasharray"],a),n._.arrows&&("startString"in n._.arrows&&_(n,n._.arrows.startString),"endString"in n._.arrows&&_(n,n._.arrows.endString,1));break;case"stroke-dasharray":w(n,m,a);break;case"fill":var M=t(m).match(i._ISURL);if(M){E=g("pattern");var L=g("image");E.id=i.createUUID(),g(E,{x:0,y:0,patternUnits:"userSpaceOnUse",height:1,width:1}),g(L,{x:0,y:0,"xlink:href":M[1]}),E.appendChild(L),function(e){i._preload(M[1],function(){var t=this.offsetWidth,i=this.offsetHeight;g(e,{width:t,height:i}),g(L,{width:t,height:i}),n.paper.safari()})}(E),n.paper.defs.appendChild(E),g(l,{fill:"url(#"+E.id+")"}),n.pattern=E,n.pattern&&y(n);break}var O=i.getRGB(m);if(O.error){if(("circle"==n.type||"ellipse"==n.type||"r"!=t(m).charAt())&&v(n,m)){if("opacity"in u||"fill-opacity"in u){var N=i._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,d));if(N){var P=N.getElementsByTagName("stop");g(P[P.length-1],{"stop-opacity":("opacity"in u?u.opacity:1)*("fill-opacity"in u?u["fill-opacity"]:1)})}}u.gradient=m,u.fill="none";break}}else delete a.gradient,delete u.gradient,!i.is(u.opacity,"undefined")&&i.is(a.opacity,"undefined")&&g(l,{opacity:u.opacity}),!i.is(u["fill-opacity"],"undefined")&&i.is(a["fill-opacity"],"undefined")&&g(l,{"fill-opacity":u["fill-opacity"]});O[e]("opacity")&&g(l,{"fill-opacity":O.opacity>1?O.opacity/100:O.opacity});case"stroke":O=i.getRGB(m),l.setAttribute(f,O.hex),"stroke"==f&&O[e]("opacity")&&g(l,{"stroke-opacity":O.opacity>1?O.opacity/100:O.opacity}),"stroke"==f&&n._.arrows&&("startString"in n._.arrows&&_(n,n._.arrows.startString),"endString"in n._.arrows&&_(n,n._.arrows.endString,1));break;case"gradient":("circle"==n.type||"ellipse"==n.type||"r"!=t(m).charAt())&&v(n,m);break;case"opacity":u.gradient&&!u[e]("stroke-opacity")&&g(l,{"stroke-opacity":m>1?m/100:m});case"fill-opacity":if(u.gradient){(N=i._g.doc.getElementById(l.getAttribute("fill").replace(/^url\(#|\)$/g,d)))&&(P=N.getElementsByTagName("stop"),g(P[P.length-1],{"stop-opacity":m}));break}default:"font-size"==f&&(m=r(m,10)+"px");var R=f.replace(/(\-.)/g,function(e){return e.substring(1).toUpperCase()});l.style[R]=m,n._.dirty=1,l.setAttribute(f,m)}}k(n,a),l.style.visibility=h},k=function(n,a){if("text"==n.type&&(a[e]("text")||a[e]("font")||a[e]("font-size")||a[e]("x")||a[e]("y"))){var o=n.attrs,s=n.node,l=s.firstChild?r(i._g.doc.defaultView.getComputedStyle(s.firstChild,d).getPropertyValue("font-size"),10):10;if(a[e]("text")){for(o.text=a.text;s.firstChild;)s.removeChild(s.firstChild);for(var c,u=t(a.text).split("\n"),h=[],p=0,f=u.length;f>p;p++)c=g("tspan"),p&&g(c,{dy:1.2*l,x:o.x}),c.appendChild(i._g.doc.createTextNode(u[p])),s.appendChild(c),h[p]=c}else for(h=s.getElementsByTagName("tspan"),p=0,f=h.length;f>p;p++)p?g(h[p],{dy:1.2*l,x:o.x}):g(h[0],{dy:0});g(s,{x:o.x,y:o.y}),n._.dirty=1;var m=n._getBBox(),v=o.y-(m.y+m.height/2);v&&i.is(v,"finite")&&g(h[0],{dy:v})}},C=function(e){return e.parentNode&&"a"===e.parentNode.tagName.toLowerCase()?e.parentNode:e};Element=function(e,t){this[0]=this.node=e,e.raphael=!0,this.id=i._oid++,e.raphaelid=this.id,this.matrix=i.matrix(),this.realPath=null,this.paper=t,this.attrs=this.attrs||{},this._={transform:[],sx:1,sy:1,deg:0,dx:0,dy:0,dirty:1},!t.bottom&&(t.bottom=this),this.prev=t.top,t.top&&(t.top.next=this),t.top=this,this.next=null},Ze=i.el,Element.prototype=Ze,Ze.constructor=Element,i._engine.path=function(e,t){var i=g("path");t.canvas&&t.canvas.appendChild(i);var n=new Element(i,t);return n.type="path",x(n,{fill:"none",stroke:"#000",path:e}),n},Ze.rotate=function(e,i,r){if(this.removed)return this;if(e=t(e).split(c),e.length-1&&(i=n(e[1]),r=n(e[2])),e=n(e[0]),null==r&&(i=r),null==i||null==r){var a=this.getBBox(1);i=a.x+a.width/2,r=a.y+a.height/2}return this.transform(this._.transform.concat([["r",e,i,r]])),this},Ze.scale=function(e,i,r,a){if(this.removed)return this;if(e=t(e).split(c),e.length-1&&(i=n(e[1]),r=n(e[2]),a=n(e[3])),e=n(e[0]),null==i&&(i=e),null==a&&(r=a),null==r||null==a)var o=this.getBBox(1);return r=null==r?o.x+o.width/2:r,a=null==a?o.y+o.height/2:a,this.transform(this._.transform.concat([["s",e,i,r,a]])),this},Ze.translate=function(e,i){return this.removed?this:(e=t(e).split(c),e.length-1&&(i=n(e[1])),e=n(e[0])||0,i=+i||0,this.transform(this._.transform.concat([["t",e,i]])),this)},Ze.transform=function(t){var n=this._;if(null==t)return n.transform;if(i._extractTransform(this,t),this.clip&&g(this.clip,{transform:this.matrix.invert()}),this.pattern&&y(this),this.node&&g(this.node,{transform:this.matrix}),1!=n.sx||1!=n.sy){var r=this.attrs[e]("stroke-width")?this.attrs["stroke-width"]:1;this.attr({"stroke-width":r})}return this},Ze.hide=function(){return!this.removed&&this.paper.safari(this.node.style.display="none"),this},Ze.show=function(){return!this.removed&&this.paper.safari(this.node.style.display=""),this},Ze.remove=function(){var e=C(this.node);if(!this.removed&&e.parentNode){var t=this.paper;t.__set__&&t.__set__.exclude(this),u.unbind("raphael.*.*."+this.id),this.gradient&&t.defs.removeChild(this.gradient),i._tear(this,t),e.parentNode.removeChild(e),this.removeData();for(var n in this)this[n]="function"==typeof this[n]?i._removedFactory(n):null;this.removed=!0}},Ze._getBBox=function(){if("none"==this.node.style.display){this.show();var e=!0}var t,i=!1;this.paper.canvas.parentElement?t=this.paper.canvas.parentElement.style:this.paper.canvas.parentNode&&(t=this.paper.canvas.parentNode.style),t&&"none"==t.display&&(i=!0,t.display="");var n={};try{n=this.node.getBBox()}catch(e){n={x:this.node.clientLeft,y:this.node.clientTop,width:this.node.clientWidth,height:this.node.clientHeight}}finally{n=n||{},i&&(t.display="none")}return e&&this.hide(),n},Ze.attr=function(t,n){if(this.removed)return this;if(null==t){var r={};for(var a in this.attrs)this.attrs[e](a)&&(r[a]=this.attrs[a]);return r.gradient&&"none"==r.fill&&(r.fill=r.gradient)&&delete r.gradient,r.transform=this._.transform,r}if(null==n&&i.is(t,"string")){if("fill"==t&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;if("transform"==t)return this._.transform;for(var o=t.split(c),s={},l=0,d=o.length;d>l;l++)t=o[l],s[t]=t in this.attrs?this.attrs[t]:i.is(this.paper.customAttributes[t],"function")?this.paper.customAttributes[t].def:i._availableAttrs[t];return d-1?s:s[o[0]]}if(null==n&&i.is(t,"array")){for(s={},l=0,d=t.length;d>l;l++)s[t[l]]=this.attr(t[l]);return s}if(null!=n){var h={};h[t]=n}else null!=t&&i.is(t,"object")&&(h=t);for(var p in h)u("raphael.attr."+p+"."+this.id,this,h[p]);for(p in this.paper.customAttributes)if(this.paper.customAttributes[e](p)&&h[e](p)&&i.is(this.paper.customAttributes[p],"function")){var f=this.paper.customAttributes[p].apply(this,[].concat(h[p]));this.attrs[p]=h[p];for(var m in f)f[e](m)&&(h[m]=f[m])}return x(this,h),this},Ze.toFront=function(){if(this.removed)return this;var e=C(this.node);e.parentNode.appendChild(e);var t=this.paper;return t.top!=this&&i._tofront(this,t),this},Ze.toBack=function(){if(this.removed)return this;var e=C(this.node),t=e.parentNode;return t.insertBefore(e,t.firstChild),i._toback(this,this.paper),this.paper,this},Ze.insertAfter=function(e){if(this.removed||!e)return this;var t=C(this.node),n=C(e.node||e[e.length-1].node);return n.nextSibling?n.parentNode.insertBefore(t,n.nextSibling):n.parentNode.appendChild(t),i._insertafter(this,e,this.paper),this},Ze.insertBefore=function(e){if(this.removed||!e)return this;var t=C(this.node),n=C(e.node||e[0].node);return n.parentNode.insertBefore(t,n),i._insertbefore(this,e,this.paper),this},Ze.blur=function(e){var t=this;if(0!=+e){var n=g("filter"),r=g("feGaussianBlur");t.attrs.blur=e,n.id=i.createUUID(),g(r,{stdDeviation:+e||1.5}),n.appendChild(r),t.paper.defs.appendChild(n),t._blur=n,g(t.node,{filter:"url(#"+n.id+")"})}else t._blur&&(t._blur.parentNode.removeChild(t._blur),delete t._blur,delete t.attrs.blur),t.node.removeAttribute("filter");return t},i._engine.circle=function(e,t,i,n){var r=g("circle");e.canvas&&e.canvas.appendChild(r);var a=new Element(r,e);return a.attrs={cx:t,cy:i,r:n,fill:"none",stroke:"#000"},a.type="circle",g(r,a.attrs),a},i._engine.rect=function(e,t,i,n,r,a){var o=g("rect");e.canvas&&e.canvas.appendChild(o);var s=new Element(o,e);return s.attrs={x:t,y:i,width:n,height:r,rx:a||0,ry:a||0,fill:"none",stroke:"#000"},s.type="rect",g(o,s.attrs),s},i._engine.ellipse=function(e,t,i,n,r){var a=g("ellipse");e.canvas&&e.canvas.appendChild(a);var o=new Element(a,e);return o.attrs={cx:t,cy:i,rx:n,ry:r,fill:"none",stroke:"#000"},o.type="ellipse",g(a,o.attrs),o},i._engine.image=function(e,t,i,n,r,a){var o=g("image");g(o,{x:i,y:n,width:r,height:a,preserveAspectRatio:"none"}),o.setAttributeNS(p,"href",t),e.canvas&&e.canvas.appendChild(o);var s=new Element(o,e);return s.attrs={x:i,y:n,width:r,height:a,src:t},s.type="image",s},i._engine.text=function(e,t,n,r){var a=g("text");e.canvas&&e.canvas.appendChild(a);var o=new Element(a,e);return o.attrs={x:t,y:n,"text-anchor":"middle",text:r,"font-family":i._availableAttrs["font-family"],"font-size":i._availableAttrs["font-size"],stroke:"none",fill:"#000"},o.type="text",x(o,o.attrs),o},i._engine.setSize=function(e,t){return this.width=e||this.width,this.height=t||this.height,this.canvas.setAttribute("width",this.width),this.canvas.setAttribute("height",this.height),this._viewBox&&this.setViewBox.apply(this,this._viewBox),this},i._engine.create=function(){var e=i._getContainer.apply(0,arguments),t=e&&e.container,n=e.x,r=e.y,a=e.width,o=e.height;if(!t)throw new Error("SVG container not found.");var s,l=g("svg"),c="overflow:hidden;";return n=n||0,r=r||0,a=a||512,o=o||342,g(l,{height:o,version:1.1,width:a,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"}),1==t?(l.style.cssText=c+"position:absolute;left:"+n+"px;top:"+r+"px",i._g.doc.body.appendChild(l),s=1):(l.style.cssText=c+"position:relative",t.firstChild?t.insertBefore(l,t.firstChild):t.appendChild(l)),t=new i._Paper,t.width=a,t.height=o,t.canvas=l,t.clear(),t._left=t._top=0,s&&(t.renderfix=function(){}),t.renderfix(),t},i._engine.setViewBox=function(e,t,i,n,r){u("raphael.setViewBox",this,this._viewBox,[e,t,i,n,r]);var a,s,l=this.getSize(),c=o(i/l.width,n/l.height),d=this.top,p=r?"xMidYMid meet":"xMinYMin";for(null==e?(this._vbSize&&(c=1),delete this._vbSize,a="0 0 "+this.width+h+this.height):(this._vbSize=c,a=e+h+t+h+i+h+n),g(this.canvas,{viewBox:a,preserveAspectRatio:p});c&&d;)s="stroke-width"in d.attrs?d.attrs["stroke-width"]:1,d.attr({"stroke-width":s}),d._.dirty=1,d._.dirtyT=1,d=d.prev;return this._viewBox=[e,t,i,n,!!r],this},i.prototype.renderfix=function(){var e,t=this.canvas,i=t.style;try{e=t.getScreenCTM()||t.createSVGMatrix()}catch(i){e=t.createSVGMatrix()}var n=-e.e%1,r=-e.f%1;(n||r)&&(n&&(this._left=(this._left+n)%1,i.left=this._left+"px"),r&&(this._top=(this._top+r)%1,i.top=this._top+"px"))},i.prototype.clear=function(){i.eve("raphael.clear",this);for(var e=this.canvas;e.firstChild;)e.removeChild(e.firstChild);this.bottom=this.top=null,(this.desc=g("desc")).appendChild(i._g.doc.createTextNode("Created with Raphaël "+i.version)),e.appendChild(this.desc),e.appendChild(this.defs=g("defs"))},i.prototype.remove=function(){u("raphael.remove",this),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?i._removedFactory(e):null};var T=i.st;for(var S in Ze)Ze[e](S)&&!T[e](S)&&(T[S]=function(e){return function(){var t=arguments;return this.forEach(function(i){i[e].apply(i,t)})}}(S))}}(),function(){if(i.vml){var e="hasOwnProperty",t=String,n=parseFloat,r=Math,a=r.round,o=r.max,s=r.min,l=r.abs,c="fill",u=/[, ]+/,d=i.eve,h=" ",p="",f={M:"m",L:"l",C:"c",Z:"x",m:"t",l:"r",c:"v",z:"x"},m=/([clmz]),?([^clmz]*)/gi,g=/ progid:\S+Blur\([^\)]+\)/g,v=/-?[^,\s-]+/g,y="position:absolute;left:0;top:0;width:1px;height:1px;behavior:url(#default#VML)",_=21600,b={path:1,rect:1,image:1},w={circle:1,ellipse:1},x=function(e){var n=/[ahqstv]/gi,r=i._pathToAbsolute;if(t(e).match(n)&&(r=i._path2curve),n=/[clmz]/g,r==i._pathToAbsolute&&!t(e).match(n)){var o=t(e).replace(m,function(e,t,i){var n=[],r="m"==t.toLowerCase(),o=f[t];return i.replace(v,function(e){r&&2==n.length&&(o+=n+f["m"==t?"l":"L"],n=[]),n.push(a(e*_))}),o+n});return o}var s,l,c=r(e);o=[];for(var u=0,d=c.length;d>u;u++){s=c[u],"z"==(l=c[u][0].toLowerCase())&&(l="x");for(var g=1,y=s.length;y>g;g++)l+=a(s[g]*_)+(g!=y-1?",":p);o.push(l)}return o.join(h)},k=function(e,t,n){var r=i.matrix();return r.rotate(-e,.5,.5),{dx:r.x(t,n),dy:r.y(t,n)}},C=function(e,t,i,n,r,a){var o=e._,s=e.matrix,u=o.fillpos,d=e.node,p=d.style,f=1,m="",g=_/t,v=_/i;if(p.visibility="hidden",t&&i){if(d.coordsize=l(g)+h+l(v),p.rotation=a*(0>t*i?-1:1),a){var y=k(a,n,r);n=y.dx,r=y.dy}if(0>t&&(m+="x"),0>i&&(m+=" y")&&(f=-1),p.flip=m,d.coordorigin=n*-g+h+r*-v,u||o.fillsize){var b=d.getElementsByTagName(c);b=b&&b[0],d.removeChild(b),u&&(y=k(a,s.x(u[0],u[1]),s.y(u[0],u[1])),b.position=y.dx*f+h+y.dy*f),o.fillsize&&(b.size=o.fillsize[0]*l(t)+h+o.fillsize[1]*l(i)),d.appendChild(b)}p.visibility="visible"}};i.toString=function(){return"Your browser doesn’t support SVG. Falling down to VML.\nYou are running Raphaël "+this.version};var T=function(e,i,n){for(var r=t(i).toLowerCase().split("-"),a=n?"end":"start",o=r.length,s="classic",l="medium",c="medium";o--;)switch(r[o]){case"block":case"classic":case"oval":case"diamond":case"open":case"none":s=r[o];break;case"wide":case"narrow":c=r[o];break;case"long":case"short":l=r[o]}var u=e.node.getElementsByTagName("stroke")[0];u[a+"arrow"]=s,u[a+"arrowlength"]=l,u[a+"arrowwidth"]=c},S=function(r,l){r.attrs=r.attrs||{};var d=r.node,f=r.attrs,m=d.style,g=b[r.type]&&(l.x!=f.x||l.y!=f.y||l.width!=f.width||l.height!=f.height||l.cx!=f.cx||l.cy!=f.cy||l.rx!=f.rx||l.ry!=f.ry||l.r!=f.r),v=w[r.type]&&(f.cx!=l.cx||f.cy!=l.cy||f.r!=l.r||f.rx!=l.rx||f.ry!=l.ry),y=r;for(var k in l)l[e](k)&&(f[k]=l[k]);if(g&&(f.path=i._getPath[r.type](r),r._.dirty=1),l.href&&(d.href=l.href),l.title&&(d.title=l.title),l.target&&(d.target=l.target),l.cursor&&(m.cursor=l.cursor),"blur"in l&&r.blur(l.blur),(l.path&&"path"==r.type||g)&&(d.path=x(~t(f.path).toLowerCase().indexOf("r")?i._pathToAbsolute(f.path):f.path),r._.dirty=1,"image"==r.type&&(r._.fillpos=[f.x,f.y],r._.fillsize=[f.width,f.height],C(r,1,1,0,0,0))),"transform"in l&&r.transform(l.transform),v){var S=+f.cx,A=+f.cy,I=+f.rx||+f.r||0,M=+f.ry||+f.r||0;d.path=i.format("ar{0},{1},{2},{3},{4},{1},{4},{1}x",a((S-I)*_),a((A-M)*_),a((S+I)*_),a((A+M)*_),a(S*_)),r._.dirty=1}if("clip-rect"in l){var L=t(l["clip-rect"]).split(u);if(4==L.length){L[2]=+L[2]+ +L[0],L[3]=+L[3]+ +L[1];var O=d.clipRect||i._g.doc.createElement("div"),N=O.style;N.clip=i.format("rect({1}px {2}px {3}px {0}px)",L),d.clipRect||(N.position="absolute",N.top=0,N.left=0,N.width=r.paper.width+"px",N.height=r.paper.height+"px",d.parentNode.insertBefore(O,d),O.appendChild(d),d.clipRect=O)}l["clip-rect"]||d.clipRect&&(d.clipRect.style.clip="auto")}if(r.textpath){var P=r.textpath.style;l.font&&(P.font=l.font),l["font-family"]&&(P.fontFamily='"'+l["font-family"].split(",")[0].replace(/^['"]+|['"]+$/g,p)+'"'),l["font-size"]&&(P.fontSize=l["font-size"]),l["font-weight"]&&(P.fontWeight=l["font-weight"]),l["font-style"]&&(P.fontStyle=l["font-style"])}if("arrow-start"in l&&T(y,l["arrow-start"]),"arrow-end"in l&&T(y,l["arrow-end"],1),null!=l.opacity||null!=l["stroke-width"]||null!=l.fill||null!=l.src||null!=l.stroke||null!=l["stroke-width"]||null!=l["stroke-opacity"]||null!=l["fill-opacity"]||null!=l["stroke-dasharray"]||null!=l["stroke-miterlimit"]||null!=l["stroke-linejoin"]||null!=l["stroke-linecap"]){var R=d.getElementsByTagName(c);if(R=R&&R[0],!R&&(R=D(c)),"image"==r.type&&l.src&&(R.src=l.src),l.fill&&(R.on=!0),(null==R.on||"none"==l.fill||null===l.fill)&&(R.on=!1),R.on&&l.fill){var j=t(l.fill).match(i._ISURL);if(j){R.parentNode==d&&d.removeChild(R),R.rotate=!0,R.src=j[1],R.type="tile";var z=r.getBBox(1);R.position=z.x+h+z.y,r._.fillpos=[z.x,z.y],i._preload(j[1],function(){r._.fillsize=[this.offsetWidth,this.offsetHeight]})}else R.color=i.getRGB(l.fill).hex,R.src=p,R.type="solid",i.getRGB(l.fill).error&&(y.type in{circle:1,ellipse:1}||"r"!=t(l.fill).charAt())&&E(y,l.fill,R)&&(f.fill="none",f.gradient=l.fill,R.rotate=!1)}if("fill-opacity"in l||"opacity"in l){var F=((+f["fill-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+i.getRGB(l.fill).o+1||2)-1);F=s(o(F,0),1),R.opacity=F,R.src&&(R.color="none")}d.appendChild(R);var B=d.getElementsByTagName("stroke")&&d.getElementsByTagName("stroke")[0],U=!1;!B&&(U=B=D("stroke")),
|
||
(l.stroke&&"none"!=l.stroke||l["stroke-width"]||null!=l["stroke-opacity"]||l["stroke-dasharray"]||l["stroke-miterlimit"]||l["stroke-linejoin"]||l["stroke-linecap"])&&(B.on=!0),("none"==l.stroke||null===l.stroke||null==B.on||0==l.stroke||0==l["stroke-width"])&&(B.on=!1);var $=i.getRGB(l.stroke);B.on&&l.stroke&&(B.color=$.hex),F=((+f["stroke-opacity"]+1||2)-1)*((+f.opacity+1||2)-1)*((+$.o+1||2)-1);var q=.75*(n(l["stroke-width"])||1);if(F=s(o(F,0),1),null==l["stroke-width"]&&(q=f["stroke-width"]),l["stroke-width"]&&(B.weight=q),q&&1>q&&(F*=q)&&(B.weight=1),B.opacity=F,l["stroke-linejoin"]&&(B.joinstyle=l["stroke-linejoin"]||"miter"),B.miterlimit=l["stroke-miterlimit"]||8,l["stroke-linecap"]&&(B.endcap="butt"==l["stroke-linecap"]?"flat":"square"==l["stroke-linecap"]?"square":"round"),"stroke-dasharray"in l){var H={"-":"shortdash",".":"shortdot","-.":"shortdashdot","-..":"shortdashdotdot",". ":"dot","- ":"dash","--":"longdash","- .":"dashdot","--.":"longdashdot","--..":"longdashdotdot"};B.dashstyle=H[e](l["stroke-dasharray"])?H[l["stroke-dasharray"]]:p}U&&d.appendChild(B)}if("text"==y.type){y.paper.canvas.style.display=p;var W=y.paper.span,V=f.font&&f.font.match(/\d+(?:\.\d*)?(?=px)/);m=W.style,f.font&&(m.font=f.font),f["font-family"]&&(m.fontFamily=f["font-family"]),f["font-weight"]&&(m.fontWeight=f["font-weight"]),f["font-style"]&&(m.fontStyle=f["font-style"]),V=n(f["font-size"]||V&&V[0])||10,m.fontSize=100*V+"px",y.textpath.string&&(W.innerHTML=t(y.textpath.string).replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,"<br>"));var G=W.getBoundingClientRect();y.W=f.w=(G.right-G.left)/100,y.H=f.h=(G.bottom-G.top)/100,y.X=f.x,y.Y=f.y+y.H/2,("x"in l||"y"in l)&&(y.path.v=i.format("m{0},{1}l{2},{1}",a(f.x*_),a(f.y*_),a(f.x*_)+1));for(var Y=["x","y","text","font","font-family","font-weight","font-style","font-size"],K=0,X=Y.length;X>K;K++)if(Y[K]in l){y._.dirty=1;break}switch(f["text-anchor"]){case"start":y.textpath.style["v-text-align"]="left",y.bbx=y.W/2;break;case"end":y.textpath.style["v-text-align"]="right",y.bbx=-y.W/2;break;default:y.textpath.style["v-text-align"]="center",y.bbx=0}y.textpath.style["v-text-kern"]=!0}},E=function(e,a,o){e.attrs=e.attrs||{};var s=(e.attrs,Math.pow),l="linear",c=".5 .5";if(e.attrs.gradient=a,a=t(a).replace(i._radial_gradient,function(e,t,i){return l="radial",t&&i&&(t=n(t),i=n(i),s(t-.5,2)+s(i-.5,2)>.25&&(i=r.sqrt(.25-s(t-.5,2))*(2*(i>.5)-1)+.5),c=t+h+i),p}),a=a.split(/\s*\-\s*/),"linear"==l){var u=a.shift();if(u=-n(u),isNaN(u))return null}var d=i._parseDots(a);if(!d)return null;if(e=e.shape||e.node,d.length){e.removeChild(o),o.on=!0,o.method="none",o.color=d[0].color,o.color2=d[d.length-1].color;for(var f=[],m=0,g=d.length;g>m;m++)d[m].offset&&f.push(d[m].offset+h+d[m].color);o.colors=f.length?f.join():"0% "+o.color,"radial"==l?(o.type="gradientTitle",o.focus="100%",o.focussize="0 0",o.focusposition=c,o.angle=0):(o.type="gradient",o.angle=(270-u)%360),e.appendChild(o)}return 1},A=function(e,t){this[0]=this.node=e,e.raphael=!0,this.id=i._oid++,e.raphaelid=this.id,this.X=0,this.Y=0,this.attrs={},this.paper=t,this.matrix=i.matrix(),this._={transform:[],sx:1,sy:1,dx:0,dy:0,deg:0,dirty:1,dirtyT:1},!t.bottom&&(t.bottom=this),this.prev=t.top,t.top&&(t.top.next=this),t.top=this,this.next=null},I=i.el;A.prototype=I,I.constructor=A,I.transform=function(e){if(null==e)return this._.transform;var n,r=this.paper._viewBoxShift,a=r?"s"+[r.scale,r.scale]+"-1-1t"+[r.dx,r.dy]:p;r&&(n=e=t(e).replace(/\.{3}|\u2026/g,this._.transform||p)),i._extractTransform(this,a+e);var o,s=this.matrix.clone(),l=this.skew,c=this.node,u=~t(this.attrs.fill).indexOf("-"),d=!t(this.attrs.fill).indexOf("url(");if(s.translate(1,1),d||u||"image"==this.type)if(l.matrix="1 0 0 1",l.offset="0 0",o=s.split(),u&&o.noRotation||!o.isSimple){c.style.filter=s.toFilter();var f=this.getBBox(),m=this.getBBox(1),g=f.x-m.x,v=f.y-m.y;c.coordorigin=g*-_+h+v*-_,C(this,1,1,g,v,0)}else c.style.filter=p,C(this,o.scalex,o.scaley,o.dx,o.dy,o.rotate);else c.style.filter=p,l.matrix=t(s),l.offset=s.offset();return null!==n&&(this._.transform=n,i._extractTransform(this,n)),this},I.rotate=function(e,i,r){if(this.removed)return this;if(null!=e){if(e=t(e).split(u),e.length-1&&(i=n(e[1]),r=n(e[2])),e=n(e[0]),null==r&&(i=r),null==i||null==r){var a=this.getBBox(1);i=a.x+a.width/2,r=a.y+a.height/2}return this._.dirtyT=1,this.transform(this._.transform.concat([["r",e,i,r]])),this}},I.translate=function(e,i){return this.removed?this:(e=t(e).split(u),e.length-1&&(i=n(e[1])),e=n(e[0])||0,i=+i||0,this._.bbox&&(this._.bbox.x+=e,this._.bbox.y+=i),this.transform(this._.transform.concat([["t",e,i]])),this)},I.scale=function(e,i,r,a){if(this.removed)return this;if(e=t(e).split(u),e.length-1&&(i=n(e[1]),r=n(e[2]),a=n(e[3]),isNaN(r)&&(r=null),isNaN(a)&&(a=null)),e=n(e[0]),null==i&&(i=e),null==a&&(r=a),null==r||null==a)var o=this.getBBox(1);return r=null==r?o.x+o.width/2:r,a=null==a?o.y+o.height/2:a,this.transform(this._.transform.concat([["s",e,i,r,a]])),this._.dirtyT=1,this},I.hide=function(){return!this.removed&&(this.node.style.display="none"),this},I.show=function(){return!this.removed&&(this.node.style.display=p),this},I.auxGetBBox=i.el.getBBox,I.getBBox=function(){var e=this.auxGetBBox();if(this.paper&&this.paper._viewBoxShift){var t={},i=1/this.paper._viewBoxShift.scale;return t.x=e.x-this.paper._viewBoxShift.dx,t.x*=i,t.y=e.y-this.paper._viewBoxShift.dy,t.y*=i,t.width=e.width*i,t.height=e.height*i,t.x2=t.x+t.width,t.y2=t.y+t.height,t}return e},I._getBBox=function(){return this.removed?{}:{x:this.X+(this.bbx||0)-this.W/2,y:this.Y-this.H,width:this.W,height:this.H}},I.remove=function(){if(!this.removed&&this.node.parentNode){this.paper.__set__&&this.paper.__set__.exclude(this),i.eve.unbind("raphael.*.*."+this.id),i._tear(this,this.paper),this.node.parentNode.removeChild(this.node),this.shape&&this.shape.parentNode.removeChild(this.shape);for(var e in this)this[e]="function"==typeof this[e]?i._removedFactory(e):null;this.removed=!0}},I.attr=function(t,n){if(this.removed)return this;if(null==t){var r={};for(var a in this.attrs)this.attrs[e](a)&&(r[a]=this.attrs[a]);return r.gradient&&"none"==r.fill&&(r.fill=r.gradient)&&delete r.gradient,r.transform=this._.transform,r}if(null==n&&i.is(t,"string")){if(t==c&&"none"==this.attrs.fill&&this.attrs.gradient)return this.attrs.gradient;for(var o=t.split(u),s={},l=0,h=o.length;h>l;l++)t=o[l],s[t]=t in this.attrs?this.attrs[t]:i.is(this.paper.customAttributes[t],"function")?this.paper.customAttributes[t].def:i._availableAttrs[t];return h-1?s:s[o[0]]}if(this.attrs&&null==n&&i.is(t,"array")){for(s={},l=0,h=t.length;h>l;l++)s[t[l]]=this.attr(t[l]);return s}var p;null!=n&&(p={},p[t]=n),null==n&&i.is(t,"object")&&(p=t);for(var f in p)d("raphael.attr."+f+"."+this.id,this,p[f]);if(p){for(f in this.paper.customAttributes)if(this.paper.customAttributes[e](f)&&p[e](f)&&i.is(this.paper.customAttributes[f],"function")){var m=this.paper.customAttributes[f].apply(this,[].concat(p[f]));this.attrs[f]=p[f];for(var g in m)m[e](g)&&(p[g]=m[g])}p.text&&"text"==this.type&&(this.textpath.string=p.text),S(this,p)}return this},I.toFront=function(){return!this.removed&&this.node.parentNode.appendChild(this.node),this.paper&&this.paper.top!=this&&i._tofront(this,this.paper),this},I.toBack=function(){return this.removed?this:(this.node.parentNode.firstChild!=this.node&&(this.node.parentNode.insertBefore(this.node,this.node.parentNode.firstChild),i._toback(this,this.paper)),this)},I.insertAfter=function(e){return this.removed?this:(e.constructor==i.st.constructor&&(e=e[e.length-1]),e.node.nextSibling?e.node.parentNode.insertBefore(this.node,e.node.nextSibling):e.node.parentNode.appendChild(this.node),i._insertafter(this,e,this.paper),this)},I.insertBefore=function(e){return this.removed?this:(e.constructor==i.st.constructor&&(e=e[0]),e.node.parentNode.insertBefore(this.node,e.node),i._insertbefore(this,e,this.paper),this)},I.blur=function(e){var t=this.node.runtimeStyle,n=t.filter;return n=n.replace(g,p),0!=+e?(this.attrs.blur=e,t.filter=n+h+" progid:DXImageTransform.Microsoft.Blur(pixelradius="+(+e||1.5)+")",t.margin=i.format("-{0}px 0 0 -{0}px",a(+e||1.5))):(t.filter=n,t.margin=0,delete this.attrs.blur),this},i._engine.path=function(e,t){var i=D("shape");i.style.cssText=y,i.coordsize=_+h+_,i.coordorigin=t.coordorigin;var n=new A(i,t),r={fill:"none",stroke:"#000"};e&&(r.path=e),n.type="path",n.path=[],n.Path=p,S(n,r),t.canvas.appendChild(i);var a=D("skew");return a.on=!0,i.appendChild(a),n.skew=a,n.transform(p),n},i._engine.rect=function(e,t,n,r,a,o){var s=i._rectPath(t,n,r,a,o),l=e.path(s),c=l.attrs;return l.X=c.x=t,l.Y=c.y=n,l.W=c.width=r,l.H=c.height=a,c.r=o,c.path=s,l.type="rect",l},i._engine.ellipse=function(e,t,i,n,r){var a=e.path();return a.attrs,a.X=t-n,a.Y=i-r,a.W=2*n,a.H=2*r,a.type="ellipse",S(a,{cx:t,cy:i,rx:n,ry:r}),a},i._engine.circle=function(e,t,i,n){var r=e.path();return r.attrs,r.X=t-n,r.Y=i-n,r.W=r.H=2*n,r.type="circle",S(r,{cx:t,cy:i,r:n}),r},i._engine.image=function(e,t,n,r,a,o){var s=i._rectPath(n,r,a,o),l=e.path(s).attr({stroke:"none"}),u=l.attrs,d=l.node,h=d.getElementsByTagName(c)[0];return u.src=t,l.X=u.x=n,l.Y=u.y=r,l.W=u.width=a,l.H=u.height=o,u.path=s,l.type="image",h.parentNode==d&&d.removeChild(h),h.rotate=!0,h.src=t,h.type="tile",l._.fillpos=[n,r],l._.fillsize=[a,o],d.appendChild(h),C(l,1,1,0,0,0),l},i._engine.text=function(e,n,r,o){var s=D("shape"),l=D("path"),c=D("textpath");n=n||0,r=r||0,o=o||"",l.v=i.format("m{0},{1}l{2},{1}",a(n*_),a(r*_),a(n*_)+1),l.textpathok=!0,c.string=t(o),c.on=!0,s.style.cssText=y,s.coordsize=_+h+_,s.coordorigin="0 0";var u=new A(s,e),d={fill:"#000",stroke:"none",font:i._availableAttrs.font,text:o};u.shape=s,u.path=l,u.textpath=c,u.type="text",u.attrs.text=t(o),u.attrs.x=n,u.attrs.y=r,u.attrs.w=1,u.attrs.h=1,S(u,d),s.appendChild(c),s.appendChild(l),e.canvas.appendChild(s);var f=D("skew");return f.on=!0,s.appendChild(f),u.skew=f,u.transform(p),u},i._engine.setSize=function(e,t){var n=this.canvas.style;return this.width=e,this.height=t,e==+e&&(e+="px"),t==+t&&(t+="px"),n.width=e,n.height=t,n.clip="rect(0 "+e+" "+t+" 0)",this._viewBox&&i._engine.setViewBox.apply(this,this._viewBox),this},i._engine.setViewBox=function(e,t,n,r,a){i.eve("raphael.setViewBox",this,this._viewBox,[e,t,n,r,a]);var o,s,l=this.getSize(),c=l.width,u=l.height;return a&&(o=u/r,s=c/n,c>n*o&&(e-=(c-n*o)/2/o),u>r*s&&(t-=(u-r*s)/2/s)),this._viewBox=[e,t,n,r,!!a],this._viewBoxShift={dx:-e,dy:-t,scale:size},this.forEach(function(e){e.transform("...")}),this};var D;i._engine.initWin=function(e){var t=e.document;t.styleSheets.length<31?t.createStyleSheet().addRule(".rvml","behavior:url(#default#VML)"):t.styleSheets[0].addRule(".rvml","behavior:url(#default#VML)");try{!t.namespaces.rvml&&t.namespaces.add("rvml","urn:schemas-microsoft-com:vml"),D=function(e){return t.createElement("<rvml:"+e+' class="rvml">')}}catch(e){D=function(e){return t.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="rvml">')}}},i._engine.initWin(i._g.win),i._engine.create=function(){var e=i._getContainer.apply(0,arguments),t=e.container,n=e.height,r=e.width,a=e.x,o=e.y;if(!t)throw new Error("VML container not found.");var s=new i._Paper,l=s.canvas=i._g.doc.createElement("div"),c=l.style;return a=a||0,o=o||0,r=r||512,n=n||342,s.width=r,s.height=n,r==+r&&(r+="px"),n==+n&&(n+="px"),s.coordsize=216e5+h+216e5,s.coordorigin="0 0",s.span=i._g.doc.createElement("span"),s.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;",l.appendChild(s.span),c.cssText=i.format("top:0;left:0;width:{0};height:{1};display:inline-block;position:relative;clip:rect(0 {0} {1} 0);overflow:hidden",r,n),1==t?(i._g.doc.body.appendChild(l),c.left=a+"px",c.top=o+"px",c.position="absolute"):t.firstChild?t.insertBefore(l,t.firstChild):t.appendChild(l),s.renderfix=function(){},s},i.prototype.clear=function(){i.eve("raphael.clear",this),this.canvas.innerHTML=p,this.span=i._g.doc.createElement("span"),this.span.style.cssText="position:absolute;left:-9999em;top:-9999em;padding:0;margin:0;line-height:1;display:inline;",this.canvas.appendChild(this.span),this.bottom=this.top=null},i.prototype.remove=function(){i.eve("raphael.remove",this),this.canvas.parentNode.removeChild(this.canvas);for(var e in this)this[e]="function"==typeof this[e]?i._removedFactory(e):null;return!0};var M=i.st;for(var L in I)I[e](L)&&!M[e](L)&&(M[L]=function(e){return function(){var t=arguments;return this.forEach(function(i){i[e].apply(i,t)})}}(L))}}(),E.was?S.win.Raphael=i:Raphael=i,"object"==typeof exports&&(module.exports=i),window.Raphael=i,i}(this,e)}),function(){function e(e){function t(t,i,n,r,a,o){for(;a>=0&&o>a;a+=e){var s=r?r[a]:a;n=i(n,t[s],s,t)}return n}return function(i,n,r,a){n=y(n,a,4);var o=!k(i)&&v.keys(i),s=(o||i).length,l=e>0?0:s-1;return arguments.length<3&&(r=i[o?o[l]:l],l+=e),t(i,n,r,o,l,s)}}function t(e){return function(t,i,n){i=_(i,n);for(var r=null!=t&&t.length,a=e>0?0:r-1;a>=0&&r>a;a+=e)if(i(t[a],a,t))return a;return-1}}function i(e,t){var i=A.length,n=e.constructor,r=v.isFunction(n)&&n.prototype||o,a="constructor";for(v.has(e,a)&&!v.contains(t,a)&&t.push(a);i--;)(a=A[i])in e&&e[a]!==r[a]&&!v.contains(t,a)&&t.push(a)}var n=this,r=n._,a=Array.prototype,o=Object.prototype,s=Function.prototype,l=a.push,c=a.slice,u=o.toString,d=o.hasOwnProperty,h=Array.isArray,p=Object.keys,f=s.bind,m=Object.create,g=function(){},v=function(e){return e instanceof v?e:this instanceof v?void(this._wrapped=e):new v(e)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=v),exports._=v):n._=v,v.VERSION="1.8.2";var y=function(e,t,i){if(void 0===t)return e;switch(null==i?3:i){case 1:return function(i){return e.call(t,i)};case 2:return function(i,n){return e.call(t,i,n)};case 3:return function(i,n,r){return e.call(t,i,n,r)};case 4:return function(i,n,r,a){return e.call(t,i,n,r,a)}}return function(){return e.apply(t,arguments)}},_=function(e,t,i){return null==e?v.identity:v.isFunction(e)?y(e,t,i):v.isObject(e)?v.matcher(e):v.property(e)};v.iteratee=function(e,t){return _(e,t,1/0)};var b=function(e,t){return function(i){var n=arguments.length;if(2>n||null==i)return i;for(var r=1;n>r;r++)for(var a=arguments[r],o=e(a),s=o.length,l=0;s>l;l++){var c=o[l];t&&void 0!==i[c]||(i[c]=a[c])}return i}},w=function(e){if(!v.isObject(e))return{};if(m)return m(e);g.prototype=e;var t=new g;return g.prototype=null,t},x=Math.pow(2,53)-1,k=function(e){var t=e&&e.length;return"number"==typeof t&&t>=0&&x>=t};v.each=v.forEach=function(e,t,i){t=y(t,i);var n,r;if(k(e))for(n=0,r=e.length;r>n;n++)t(e[n],n,e);else{var a=v.keys(e);for(n=0,r=a.length;r>n;n++)t(e[a[n]],a[n],e)}return e},v.map=v.collect=function(e,t,i){t=_(t,i);for(var n=!k(e)&&v.keys(e),r=(n||e).length,a=Array(r),o=0;r>o;o++){var s=n?n[o]:o;a[o]=t(e[s],s,e)}return a},v.reduce=v.foldl=v.inject=e(1),v.reduceRight=v.foldr=e(-1),v.find=v.detect=function(e,t,i){var n;return n=k(e)?v.findIndex(e,t,i):v.findKey(e,t,i),void 0!==n&&-1!==n?e[n]:void 0},v.filter=v.select=function(e,t,i){var n=[];return t=_(t,i),v.each(e,function(e,i,r){t(e,i,r)&&n.push(e)}),n},v.reject=function(e,t,i){return v.filter(e,v.negate(_(t)),i)},v.every=v.all=function(e,t,i){t=_(t,i);for(var n=!k(e)&&v.keys(e),r=(n||e).length,a=0;r>a;a++){var o=n?n[a]:a;if(!t(e[o],o,e))return!1}return!0},v.some=v.any=function(e,t,i){t=_(t,i);for(var n=!k(e)&&v.keys(e),r=(n||e).length,a=0;r>a;a++){var o=n?n[a]:a;if(t(e[o],o,e))return!0}return!1},v.contains=v.includes=v.include=function(e,t,i){return k(e)||(e=v.values(e)),v.indexOf(e,t,"number"==typeof i&&i)>=0},v.invoke=function(e,t){var i=c.call(arguments,2),n=v.isFunction(t);return v.map(e,function(e){var r=n?t:e[t];return null==r?r:r.apply(e,i)})},v.pluck=function(e,t){return v.map(e,v.property(t))},v.where=function(e,t){return v.filter(e,v.matcher(t))},v.findWhere=function(e,t){return v.find(e,v.matcher(t))},v.max=function(e,t,i){var n,r,a=-1/0,o=-1/0;if(null==t&&null!=e){e=k(e)?e:v.values(e);for(var s=0,l=e.length;l>s;s++)(n=e[s])>a&&(a=n)}else t=_(t,i),v.each(e,function(e,i,n){((r=t(e,i,n))>o||r===-1/0&&a===-1/0)&&(a=e,o=r)});return a},v.min=function(e,t,i){var n,r,a=1/0,o=1/0;if(null==t&&null!=e){e=k(e)?e:v.values(e);for(var s=0,l=e.length;l>s;s++)n=e[s],a>n&&(a=n)}else t=_(t,i),v.each(e,function(e,i,n){r=t(e,i,n),(o>r||1/0===r&&1/0===a)&&(a=e,o=r)});return a},v.shuffle=function(e){for(var t,i=k(e)?e:v.values(e),n=i.length,r=Array(n),a=0;n>a;a++)t=v.random(0,a),t!==a&&(r[a]=r[t]),r[t]=i[a];return r},v.sample=function(e,t,i){return null==t||i?(k(e)||(e=v.values(e)),e[v.random(e.length-1)]):v.shuffle(e).slice(0,Math.max(0,t))},v.sortBy=function(e,t,i){return t=_(t,i),v.pluck(v.map(e,function(e,i,n){return{value:e,index:i,criteria:t(e,i,n)}}).sort(function(e,t){var i=e.criteria,n=t.criteria;if(i!==n){if(i>n||void 0===i)return 1;if(n>i||void 0===n)return-1}return e.index-t.index}),"value")};var C=function(e){return function(t,i,n){var r={};return i=_(i,n),v.each(t,function(n,a){var o=i(n,a,t);e(r,n,o)}),r}};v.groupBy=C(function(e,t,i){v.has(e,i)?e[i].push(t):e[i]=[t]}),v.indexBy=C(function(e,t,i){e[i]=t}),v.countBy=C(function(e,t,i){v.has(e,i)?e[i]++:e[i]=1}),v.toArray=function(e){return e?v.isArray(e)?c.call(e):k(e)?v.map(e,v.identity):v.values(e):[]},v.size=function(e){return null==e?0:k(e)?e.length:v.keys(e).length},v.partition=function(e,t,i){t=_(t,i);var n=[],r=[];return v.each(e,function(e,i,a){(t(e,i,a)?n:r).push(e)}),[n,r]},v.first=v.head=v.take=function(e,t,i){return null==e?void 0:null==t||i?e[0]:v.initial(e,e.length-t)},v.initial=function(e,t,i){return c.call(e,0,Math.max(0,e.length-(null==t||i?1:t)))},v.last=function(e,t,i){return null==e?void 0:null==t||i?e[e.length-1]:v.rest(e,Math.max(0,e.length-t))},v.rest=v.tail=v.drop=function(e,t,i){return c.call(e,null==t||i?1:t)},v.compact=function(e){return v.filter(e,v.identity)};var T=function(e,t,i,n){for(var r=[],a=0,o=n||0,s=e&&e.length;s>o;o++){var l=e[o];if(k(l)&&(v.isArray(l)||v.isArguments(l))){t||(l=T(l,t,i));var c=0,u=l.length;for(r.length+=u;u>c;)r[a++]=l[c++]}else i||(r[a++]=l)}return r};v.flatten=function(e,t){return T(e,t,!1)},v.without=function(e){return v.difference(e,c.call(arguments,1))},v.uniq=v.unique=function(e,t,i,n){if(null==e)return[];v.isBoolean(t)||(n=i,i=t,t=!1),null!=i&&(i=_(i,n));for(var r=[],a=[],o=0,s=e.length;s>o;o++){var l=e[o],c=i?i(l,o,e):l;t?(o&&a===c||r.push(l),a=c):i?v.contains(a,c)||(a.push(c),r.push(l)):v.contains(r,l)||r.push(l)}return r},v.union=function(){return v.uniq(T(arguments,!0,!0))},v.intersection=function(e){if(null==e)return[];for(var t=[],i=arguments.length,n=0,r=e.length;r>n;n++){var a=e[n];if(!v.contains(t,a)){for(var o=1;i>o&&v.contains(arguments[o],a);o++);o===i&&t.push(a)}}return t},v.difference=function(e){var t=T(arguments,!0,!0,1);return v.filter(e,function(e){return!v.contains(t,e)})},v.zip=function(){return v.unzip(arguments)},v.unzip=function(e){for(var t=e&&v.max(e,"length").length||0,i=Array(t),n=0;t>n;n++)i[n]=v.pluck(e,n);return i},v.object=function(e,t){for(var i={},n=0,r=e&&e.length;r>n;n++)t?i[e[n]]=t[n]:i[e[n][0]]=e[n][1];return i},v.indexOf=function(e,t,i){var n=0,r=e&&e.length;if("number"==typeof i)n=0>i?Math.max(0,r+i):i;else if(i&&r)return n=v.sortedIndex(e,t),e[n]===t?n:-1;if(t!==t)return v.findIndex(c.call(e,n),v.isNaN);for(;r>n;n++)if(e[n]===t)return n;return-1},v.lastIndexOf=function(e,t,i){var n=e?e.length:0;if("number"==typeof i&&(n=0>i?n+i+1:Math.min(n,i+1)),t!==t)return v.findLastIndex(c.call(e,0,n),v.isNaN);for(;--n>=0;)if(e[n]===t)return n;return-1},v.findIndex=t(1),v.findLastIndex=t(-1),v.sortedIndex=function(e,t,i,n){i=_(i,n,1);for(var r=i(t),a=0,o=e.length;o>a;){var s=Math.floor((a+o)/2);i(e[s])<r?a=s+1:o=s}return a},v.range=function(e,t,i){arguments.length<=1&&(t=e||0,e=0),i=i||1;for(var n=Math.max(Math.ceil((t-e)/i),0),r=Array(n),a=0;n>a;a++,e+=i)r[a]=e;return r};var S=function(e,t,i,n,r){if(!(n instanceof t))return e.apply(i,r);var a=w(e.prototype),o=e.apply(a,r);return v.isObject(o)?o:a};v.bind=function(e,t){if(f&&e.bind===f)return f.apply(e,c.call(arguments,1));if(!v.isFunction(e))throw new TypeError("Bind must be called on a function");var i=c.call(arguments,2),n=function(){return S(e,n,t,this,i.concat(c.call(arguments)))};return n},v.partial=function(e){var t=c.call(arguments,1),i=function(){for(var n=0,r=t.length,a=Array(r),o=0;r>o;o++)a[o]=t[o]===v?arguments[n++]:t[o];for(;n<arguments.length;)a.push(arguments[n++]);return S(e,i,this,this,a)};return i},v.bindAll=function(e){var t,i,n=arguments.length;if(1>=n)throw new Error("bindAll must be passed function names");for(t=1;n>t;t++)i=arguments[t],e[i]=v.bind(e[i],e);return e},v.memoize=function(e,t){var i=function(n){var r=i.cache,a=""+(t?t.apply(this,arguments):n);return v.has(r,a)||(r[a]=e.apply(this,arguments)),r[a]};return i.cache={},i},v.delay=function(e,t){var i=c.call(arguments,2);return setTimeout(function(){return e.apply(null,i)},t)},v.defer=v.partial(v.delay,v,1),v.throttle=function(e,t,i){var n,r,a,o=null,s=0;i||(i={});var l=function(){s=!1===i.leading?0:v.now(),o=null,a=e.apply(n,r),o||(n=r=null)};return function(){var c=v.now();s||!1!==i.leading||(s=c);var u=t-(c-s);return n=this,r=arguments,0>=u||u>t?(o&&(clearTimeout(o),o=null),s=c,a=e.apply(n,r),o||(n=r=null)):o||!1===i.trailing||(o=setTimeout(l,u)),a}},v.debounce=function(e,t,i){var n,r,a,o,s,l=function(){var c=v.now()-o;t>c&&c>=0?n=setTimeout(l,t-c):(n=null,i||(s=e.apply(a,r),n||(a=r=null)))};return function(){a=this,r=arguments,o=v.now();var c=i&&!n;return n||(n=setTimeout(l,t)),c&&(s=e.apply(a,r),a=r=null),s}},v.wrap=function(e,t){return v.partial(t,e)},v.negate=function(e){return function(){return!e.apply(this,arguments)}},v.compose=function(){var e=arguments,t=e.length-1;return function(){for(var i=t,n=e[t].apply(this,arguments);i--;)n=e[i].call(this,n);return n}},v.after=function(e,t){return function(){return--e<1?t.apply(this,arguments):void 0}},v.before=function(e,t){var i;return function(){return--e>0&&(i=t.apply(this,arguments)),1>=e&&(t=null),i}},v.once=v.partial(v.before,2);var E=!{toString:null}.propertyIsEnumerable("toString"),A=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];v.keys=function(e){if(!v.isObject(e))return[];if(p)return p(e);var t=[];for(var n in e)v.has(e,n)&&t.push(n);return E&&i(e,t),t},v.allKeys=function(e){if(!v.isObject(e))return[];var t=[];for(var n in e)t.push(n);return E&&i(e,t),t},v.values=function(e){for(var t=v.keys(e),i=t.length,n=Array(i),r=0;i>r;r++)n[r]=e[t[r]];return n},v.mapObject=function(e,t,i){t=_(t,i);for(var n,r=v.keys(e),a=r.length,o={},s=0;a>s;s++)n=r[s],o[n]=t(e[n],n,e);return o},v.pairs=function(e){for(var t=v.keys(e),i=t.length,n=Array(i),r=0;i>r;r++)n[r]=[t[r],e[t[r]]];return n},v.invert=function(e){for(var t={},i=v.keys(e),n=0,r=i.length;r>n;n++)t[e[i[n]]]=i[n];return t},v.functions=v.methods=function(e){var t=[];for(var i in e)v.isFunction(e[i])&&t.push(i);return t.sort()},v.extend=b(v.allKeys),v.extendOwn=v.assign=b(v.keys),v.findKey=function(e,t,i){t=_(t,i);for(var n,r=v.keys(e),a=0,o=r.length;o>a;a++)if(n=r[a],t(e[n],n,e))return n},v.pick=function(e,t,i){var n,r,a={},o=e;if(null==o)return a;v.isFunction(t)?(r=v.allKeys(o),n=y(t,i)):(r=T(arguments,!1,!1,1),n=function(e,t,i){return t in i},o=Object(o));for(var s=0,l=r.length;l>s;s++){var c=r[s],u=o[c];n(u,c,o)&&(a[c]=u)}return a},v.omit=function(e,t,i){if(v.isFunction(t))t=v.negate(t);else{var n=v.map(T(arguments,!1,!1,1),String);t=function(e,t){return!v.contains(n,t)}}return v.pick(e,t,i)},v.defaults=b(v.allKeys,!0),v.clone=function(e){return v.isObject(e)?v.isArray(e)?e.slice():v.extend({},e):e},v.tap=function(e,t){return t(e),e},v.isMatch=function(e,t){var i=v.keys(t),n=i.length;if(null==e)return!n;for(var r=Object(e),a=0;n>a;a++){var o=i[a];if(t[o]!==r[o]||!(o in r))return!1}return!0};var I=function(e,t,i,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;e instanceof v&&(e=e._wrapped),t instanceof v&&(t=t._wrapped);var r=u.call(e);if(r!==u.call(t))return!1;switch(r){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t}var a="[object Array]"===r;if(!a){if("object"!=typeof e||"object"!=typeof t)return!1;var o=e.constructor,s=t.constructor;if(o!==s&&!(v.isFunction(o)&&o instanceof o&&v.isFunction(s)&&s instanceof s)&&"constructor"in e&&"constructor"in t)return!1}i=i||[],n=n||[];for(var l=i.length;l--;)if(i[l]===e)return n[l]===t;if(i.push(e),n.push(t),a){if((l=e.length)!==t.length)return!1;for(;l--;)if(!I(e[l],t[l],i,n))return!1}else{var c,d=v.keys(e);if(l=d.length,v.keys(t).length!==l)return!1;for(;l--;)if(c=d[l],!v.has(t,c)||!I(e[c],t[c],i,n))return!1}return i.pop(),n.pop(),!0};v.isEqual=function(e,t){return I(e,t)},v.isEmpty=function(e){return null==e||(k(e)&&(v.isArray(e)||v.isString(e)||v.isArguments(e))?0===e.length:0===v.keys(e).length)},v.isElement=function(e){return!(!e||1!==e.nodeType)},v.isArray=h||function(e){return"[object Array]"===u.call(e)},v.isObject=function(e){var t=typeof e;return"function"===t||"object"===t&&!!e},v.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(e){v["is"+e]=function(t){return u.call(t)==="[object "+e+"]"}}),v.isArguments(arguments)||(v.isArguments=function(e){return v.has(e,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(v.isFunction=function(e){return"function"==typeof e||!1}),v.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))},v.isNaN=function(e){return v.isNumber(e)&&e!==+e},v.isBoolean=function(e){return!0===e||!1===e||"[object Boolean]"===u.call(e)},v.isNull=function(e){return null===e},v.isUndefined=function(e){return void 0===e},v.has=function(e,t){return null!=e&&d.call(e,t)},v.noConflict=function(){return n._=r,this},v.identity=function(e){return e},v.constant=function(e){return function(){return e}},v.noop=function(){},v.property=function(e){return function(t){return null==t?void 0:t[e]}},v.propertyOf=function(e){return null==e?function(){}:function(t){return e[t]}},v.matcher=v.matches=function(e){return e=v.extendOwn({},e),function(t){return v.isMatch(t,e)}},v.times=function(e,t,i){var n=Array(Math.max(0,e));t=y(t,i,1);for(var r=0;e>r;r++)n[r]=t(r);return n},v.random=function(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))},v.now=Date.now||function(){return(new Date).getTime()};var D={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},M=v.invert(D),L=function(e){var t=function(t){return e[t]},i="(?:"+v.keys(e).join("|")+")",n=RegExp(i),r=RegExp(i,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(r,t):e}};v.escape=L(D),v.unescape=L(M),v.result=function(e,t,i){var n=null==e?void 0:e[t];return void 0===n&&(n=i),v.isFunction(n)?n.call(e):n};var O=0;v.uniqueId=function(e){var t=++O+"";return e?e+t:t},v.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,P={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},R=/\\|'|\r|\n|\u2028|\u2029/g,j=function(e){return"\\"+P[e]};v.template=function(e,t,i){!t&&i&&(t=i),t=v.defaults({},t,v.templateSettings);var n=RegExp([(t.escape||N).source,(t.interpolate||N).source,(t.evaluate||N).source].join("|")+"|$","g"),r=0,a="__p+='";e.replace(n,function(t,i,n,o,s){return a+=e.slice(r,s).replace(R,j),r=s+t.length,i?a+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":o&&(a+="';\n"+o+"\n__p+='"),t}),a+="';\n",t.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{var o=new Function(t.variable||"obj","_",a)}catch(e){throw e.source=a,e}var s=function(e){return o.call(this,e,v)};return s.source="function("+(t.variable||"obj")+"){\n"+a+"}",s},v.chain=function(e){var t=v(e);return t._chain=!0,t};var z=function(e,t){return e._chain?v(t).chain():t};v.mixin=function(e){v.each(v.functions(e),function(t){var i=v[t]=e[t];v.prototype[t]=function(){var e=[this._wrapped];return l.apply(e,arguments),z(this,i.apply(v,e))}})},v.mixin(v),v.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=a[e];v.prototype[e]=function(){var i=this._wrapped;return t.apply(i,arguments),"shift"!==e&&"splice"!==e||0!==i.length||delete i[0],z(this,i)}}),v.each(["concat","join","slice"],function(e){var t=a[e];v.prototype[e]=function(){return z(this,t.apply(this._wrapped,arguments))}}),v.prototype.value=function(){return this._wrapped},v.prototype.valueOf=v.prototype.toJSON=v.prototype.value,v.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return v})}.call(this),function(){function e(t,i){if(!t||"function"==typeof t)return i;var n={};for(var r in i)n[r]=i[r];for(r in t)t[r]&&(n[r]="object"==typeof n[r]?e(n[r],t[r]):t[r]);return n}function t(e,t){if("function"==typeof Object.create)e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});else{e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}function i(e,t,i){var n,r,a="M{0},{1}";for(n=2,r=2*i.length+2;r>n;n+=2)a+=" L{"+n+"},{"+(n+1)+"}";var o=[t.x,t.y];for(n=0,r=i.length;r>n;n++)o.push(i[n].x),o.push(i[n].y);var s=e.paper.path(a,o);s.attr("stroke",e.options["element-color"]),s.attr("stroke-width",e.options["line-width"]);var l=e.options.font,c=e.options["font-family"],u=e.options["font-weight"];return l&&s.attr({font:l}),c&&s.attr({"font-family":c}),u&&s.attr({"font-weight":u}),s}function n(e,t,i,n){var r,a;"[object Array]"!==Object.prototype.toString.call(i)&&(i=[i]);var o="M{0},{1}";for(r=2,a=2*i.length+2;a>r;r+=2)o+=" L{"+r+"},{"+(r+1)+"}";var s=[t.x,t.y];for(r=0,a=i.length;a>r;r++)s.push(i[r].x),s.push(i[r].y);var l=e.paper.path(o,s);l.attr({stroke:e.options["line-color"],"stroke-width":e.options["line-width"],"arrow-end":e.options["arrow-end"]});var c=e.options.font,u=e.options["font-family"],d=e.options["font-weight"];if(c&&l.attr({font:c}),u&&l.attr({"font-family":u}),d&&l.attr({"font-weight":d}),n){var h=e.paper.text(0,0,n),p=!1,f=i[0];t.y===f.y&&(p=!0);var m=0,g=0;m=t.x,g=t.y,p?(m+=e.options["text-margin"]/2,g-=e.options["text-margin"]):(m+=e.options["text-margin"]/2,g+=e.options["text-margin"]),h.attr({"text-anchor":"start","font-size":e.options["font-size"],fill:e.options["font-color"],x:m,y:g}),c&&h.attr({font:c}),u&&h.attr({"font-family":u}),d&&h.attr({"font-weight":d})}return l}function r(e,t,i,n,r,a,o,s){var l,c,u,d,h,p={x:null,y:null,onLine1:!1,onLine2:!1};return l=(s-a)*(i-e)-(o-r)*(n-t),0===l?p:(c=t-a,u=e-r,d=(o-r)*c-(s-a)*u,h=(i-e)*c-(n-t)*u,c=d/l,u=h/l,p.x=e+c*(i-e),p.y=t+c*(n-t),c>0&&1>c&&(p.onLine1=!0),u>0&&1>u&&(p.onLine2=!0),p)}function a(e,t){t=t||{},this.paper=new Raphael(e),this.options=v.defaults(t,g),this.symbols=[],this.lines=[],this.start=null}function o(e,t,i){this.chart=e,this.group=this.chart.paper.set(),this.symbol=i,this.connectedTo=[],this.symbolType=t.symbolType,this.flowstate=t.flowstate||"future",this.next_direction=t.next&&t.direction_next?t.direction_next:void 0,this.text=this.chart.paper.text(0,0,t.text),t.key&&(this.text.node.id=t.key+"t"),this.text.node.setAttribute("class",this.getAttr("class")+"t"),this.text.attr({"text-anchor":"start",x:this.getAttr("text-margin"),fill:this.getAttr("font-color"),"font-size":this.getAttr("font-size")});var n=this.getAttr("font"),r=this.getAttr("font-family"),a=this.getAttr("font-weight");n&&this.text.attr({font:n}),r&&this.text.attr({"font-family":r}),a&&this.text.attr({"font-weight":a}),t.link&&this.text.attr("href",t.link),t.target&&this.text.attr("target",t.target);var o=this.getAttr("maxWidth");if(o){for(var s=t.text.split(" "),l="",c=0,u=s.length;u>c;c++){
|
||
var d=s[c];this.text.attr("text",l+" "+d),l+=this.text.getBBox().width>o?"\n"+d:" "+d}this.text.attr("text",l.substring(1))}if(this.group.push(this.text),i){var h=this.getAttr("text-margin");i.attr({fill:this.getAttr("fill"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*h,height:this.text.getBBox().height+2*h}),i.node.setAttribute("class",this.getAttr("class")),t.link&&i.attr("href",t.link),t.target&&i.attr("target",t.target),t.key&&(i.node.id=t.key),this.group.push(i),i.insertBefore(this.text),this.text.attr({y:i.getBBox().height/2}),this.initialize()}}function s(e,t){var i=e.paper.rect(0,0,0,0,20);t=t||{},t.text=t.text||"Start",o.call(this,e,t,i)}function l(e,t){var i=e.paper.rect(0,0,0,0,20);t=t||{},t.text=t.text||"End",o.call(this,e,t,i)}function c(e,t){var i=e.paper.rect(0,0,0,0);t=t||{},o.call(this,e,t,i)}function u(e,t){var i=e.paper.rect(0,0,0,0);t=t||{},o.call(this,e,t,i),i.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});var n=e.paper.rect(0,0,0,0);n.attr({x:this.getAttr("text-margin"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*this.getAttr("text-margin"),height:this.text.getBBox().height+2*this.getAttr("text-margin"),fill:this.getAttr("fill")}),t.key&&(n.node.id=t.key+"i");var r=this.getAttr("font"),a=this.getAttr("font-family"),s=this.getAttr("font-weight");r&&n.attr({font:r}),a&&n.attr({"font-family":a}),s&&n.attr({"font-weight":s}),t.link&&n.attr("href",t.link),t.target&&n.attr("target",t.target),this.group.push(n),n.insertBefore(this.text),this.initialize()}function d(e,t){t=t||{},o.call(this,e,t),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var n=this.text.getBBox().width+4*this.textMargin,r=this.text.getBBox().height+2*this.textMargin,a=this.textMargin,s=r/2,l={x:a,y:s},c=[{x:a-this.textMargin,y:r},{x:a-this.textMargin+n,y:r},{x:a-this.textMargin+n+2*this.textMargin,y:0},{x:a-this.textMargin+2*this.textMargin,y:0},{x:a,y:s}],u=i(e,l,c);u.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),t.link&&u.attr("href",t.link),t.target&&u.attr("target",t.target),t.key&&(u.node.id=t.key),u.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:u.getBBox().height/2}),this.group.push(u),u.insertBefore(this.text),this.initialize()}function h(e,t){t=t||{},o.call(this,e,t),this.textMargin=this.getAttr("text-margin"),this.yes_direction="bottom",this.no_direction="right",t.yes&&t.direction_yes&&t.no&&!t.direction_no?"right"===t.direction_yes?(this.no_direction="bottom",this.yes_direction="right"):(this.no_direction="right",this.yes_direction="bottom"):t.yes&&!t.direction_yes&&t.no&&t.direction_no?"right"===t.direction_no?(this.yes_direction="bottom",this.no_direction="right"):(this.yes_direction="right",this.no_direction="bottom"):(this.yes_direction="bottom",this.no_direction="right"),this.yes_direction=this.yes_direction||"bottom",this.no_direction=this.no_direction||"right",this.text.attr({x:2*this.textMargin});var n=this.text.getBBox().width+3*this.textMargin;n+=n/2;var r=this.text.getBBox().height+2*this.textMargin;r+=r/2,r=Math.max(.5*n,r);var a=n/4,s=r/4;this.text.attr({x:a+this.textMargin/2});var l={x:a,y:s},c=[{x:a-n/4,y:s+r/4},{x:a-n/4+n/2,y:s+r/4+r/2},{x:a-n/4+n,y:s+r/4},{x:a-n/4+n/2,y:s+r/4-r/2},{x:a-n/4,y:s+r/4}],u=i(e,l,c);u.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),t.link&&u.attr("href",t.link),t.target&&u.attr("target",t.target),t.key&&(u.node.id=t.key),u.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:u.getBBox().height/2}),this.group.push(u),u.insertBefore(this.text),this.initialize()}function p(e){function t(e){var t=e.indexOf("(")+1,n=e.indexOf(")");return t>=0&&n>=0?i.symbols[e.substring(0,t-1)]:i.symbols[e]}e=e||"",e=e.trim();for(var i={symbols:{},start:null,drawSVG:function(e,t){function i(e){if(o[e.key])return o[e.key];switch(e.symbolType){case"start":o[e.key]=new s(r,e);break;case"end":o[e.key]=new l(r,e);break;case"operation":o[e.key]=new c(r,e);break;case"inputoutput":o[e.key]=new d(r,e);break;case"subroutine":o[e.key]=new u(r,e);break;case"condition":o[e.key]=new h(r,e);break;default:return new Error("Wrong symbol type!")}return o[e.key]}var n=this;this.diagram&&this.diagram.clean();var r=new a(e,t);this.diagram=r;var o={};!function e(t,a,o){var s=i(t);return n.start===t?r.startWith(s):a&&o&&!a.pathOk&&(a instanceof h?(o.yes===t&&a.yes(s),o.no===t&&a.no(s)):a.then(s)),s.pathOk?s:(s instanceof h?(t.yes&&e(t.yes,s,t),t.no&&e(t.no,s,t)):t.next&&e(t.next,s,t),s)}(this.start),r.render()},clean:function(){this.diagram.clean()}},n=[],r=0,o=1,p=e.length;p>o;o++)if("\n"===e[o]&&"\\"!==e[o-1]){var f=e.substring(r,o);r=o+1,n.push(f.replace(/\\\n/g,"\n"))}r<e.length&&n.push(e.substr(r));for(var m=1,g=n.length;g>m;){var v=n[m];v.indexOf(": ")<0&&v.indexOf("(")<0&&v.indexOf(")")<0&&v.indexOf("->")<0&&v.indexOf("=>")<0?(n[m-1]+="\n"+v,n.splice(m,1),g--):m++}for(;n.length>0;){var y=n.splice(0,1)[0];if(y.indexOf("=>")>=0){var _,b=y.split("=>"),w={key:b[0],symbolType:b[1],text:null,link:null,target:null,flowstate:null};if(w.symbolType.indexOf(": ")>=0&&(_=w.symbolType.split(": "),w.symbolType=_[0],w.text=_[1]),w.text&&w.text.indexOf(":>")>=0?(_=w.text.split(":>"),w.text=_[0],w.link=_[1]):w.symbolType.indexOf(":>")>=0&&(_=w.symbolType.split(":>"),w.symbolType=_[0],w.link=_[1]),w.symbolType.indexOf("\n")>=0&&(w.symbolType=w.symbolType.split("\n")[0]),w.link){var x=w.link.indexOf("[")+1,k=w.link.indexOf("]");x>=0&&k>=0&&(w.target=w.link.substring(x,k),w.link=w.link.substring(0,x-1))}if(w.text&&w.text.indexOf("|")>=0){var C=w.text.split("|");w.text=C[0],w.flowstate=C[1].trim()}i.symbols[w.key]=w}else if(y.indexOf("->")>=0)for(var T=y.split("->"),S=0,E=T.length;E>S;S++){var A=T[S],I=t(A),D=function(e){var t="next",i=e.indexOf("(")+1,n=e.indexOf(")");return i>=0&&n>=0&&(t=A.substring(i,n),t.indexOf(",")<0&&"yes"!==t&&"no"!==t&&(t="next, "+t)),t}(A),M=null;if(D.indexOf(",")>=0){var L=D.split(",");D=L[0],M=L[1].trim()}if(i.start||(i.start=I),E>S+1){var O=T[S+1];I[D]=t(O),I["direction_"+D]=M,M=null}}}return i}Array.prototype.indexOf||(Array.prototype.indexOf=function(e){"use strict";if(null===this)throw new TypeError;var t=Object(this),i=t.length>>>0;if(0===i)return-1;var n=0;if(arguments.length>0&&(n=Number(arguments[1]),n!=n?n=0:0!==n&&1/0!=n&&n!=-1/0&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=i)return-1;for(var r=n>=0?n:Math.max(i-Math.abs(n),0);i>r;r++)if(r in t&&t[r]===e)return r;return-1}),Array.prototype.lastIndexOf||(Array.prototype.lastIndexOf=function(e){"use strict";if(null===this)throw new TypeError;var t=Object(this),i=t.length>>>0;if(0===i)return-1;var n=i;arguments.length>1&&(n=Number(arguments[1]),n!=n?n=0:0!==n&&n!=1/0&&n!=-1/0&&(n=(n>0||-1)*Math.floor(Math.abs(n))));for(var r=n>=0?Math.min(n,i-1):i-Math.abs(n);r>=0;r--)if(r in t&&t[r]===e)return r;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")});var f=this,m={};"undefined"!=typeof module&&module.exports?module.exports=m:f.flowchart=f.flowchart||m;var g={x:0,y:0,"line-width":3,"line-length":50,"text-margin":10,"font-size":14,"font-color":"black","line-color":"black","element-color":"black",fill:"white","yes-text":"yes","no-text":"no","arrow-end":"block",class:"flowchart",symbols:{start:{},end:{},condition:{},inputoutput:{},operation:{},subroutine:{}}},v={defaults:e,inherits:t};a.prototype.handle=function(e){this.symbols.indexOf(e)<=-1&&this.symbols.push(e);var t=this;return e instanceof h?(e.yes=function(i){return e.yes_symbol=i,e.no_symbol&&(e.pathOk=!0),t.handle(i)},e.no=function(i){return e.no_symbol=i,e.yes_symbol&&(e.pathOk=!0),t.handle(i)}):e.then=function(i){return e.next=i,e.pathOk=!0,t.handle(i)},e},a.prototype.startWith=function(e){return this.start=e,this.handle(e)},a.prototype.render=function(){var e,t=0,i=0,n=0,r=0,a=0,o=0;for(n=0,r=this.symbols.length;r>n;n++)e=this.symbols[n],e.width>t&&(t=e.width),e.height>i&&(i=e.height);for(n=0,r=this.symbols.length;r>n;n++)e=this.symbols[n],e.shiftX(this.options.x+(t-e.width)/2+this.options["line-width"]),e.shiftY(this.options.y+(i-e.height)/2+this.options["line-width"]);for(this.start.render(),n=0,r=this.symbols.length;r>n;n++)e=this.symbols[n],e.renderLines();for(a=this.maxXFromLine,n=0,r=this.symbols.length;r>n;n++){e=this.symbols[n];var s=e.getX()+e.width,l=e.getY()+e.height;s>a&&(a=s),l>o&&(o=l)}this.paper.setSize(a+this.options["line-width"],o+this.options["line-width"])},a.prototype.clean=function(){if(this.paper){var e=this.paper.canvas;e.parentNode.removeChild(e)}},o.prototype.getAttr=function(e){if(this.chart){var t,i=this.chart.options?this.chart.options[e]:void 0,n=this.chart.options.symbols?this.chart.options.symbols[this.symbolType][e]:void 0;return this.chart.options.flowstate&&this.chart.options.flowstate[this.flowstate]&&(t=this.chart.options.flowstate[this.flowstate][e]),t||n||i}},o.prototype.initialize=function(){this.group.transform("t"+this.getAttr("line-width")+","+this.getAttr("line-width")),this.width=this.group.getBBox().width,this.height=this.group.getBBox().height},o.prototype.getCenter=function(){return{x:this.getX()+this.width/2,y:this.getY()+this.height/2}},o.prototype.getX=function(){return this.group.getBBox().x},o.prototype.getY=function(){return this.group.getBBox().y},o.prototype.shiftX=function(e){this.group.transform("t"+(this.getX()+e)+","+this.getY())},o.prototype.setX=function(e){this.group.transform("t"+e+","+this.getY())},o.prototype.shiftY=function(e){this.group.transform("t"+this.getX()+","+(this.getY()+e))},o.prototype.setY=function(e){this.group.transform("t"+this.getX()+","+e)},o.prototype.getTop=function(){var e=this.getY();return{x:this.getX()+this.width/2,y:e}},o.prototype.getBottom=function(){var e=this.getY()+this.height;return{x:this.getX()+this.width/2,y:e}},o.prototype.getLeft=function(){var e=this.getY()+this.group.getBBox().height/2;return{x:this.getX(),y:e}},o.prototype.getRight=function(){var e=this.getY()+this.group.getBBox().height/2;return{x:this.getX()+this.group.getBBox().width,y:e}},o.prototype.render=function(){if(this.next){var e=this.getAttr("line-length");if("right"===this.next_direction){var t=this.getRight();if(this.next.getLeft(),!this.next.isPositioned){this.next.setY(t.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+e);var i=this;!function t(){for(var n,r=!1,a=0,o=i.chart.symbols.length;o>a;a++){n=i.chart.symbols[a];var s=Math.abs(n.getCenter().x-i.next.getCenter().x);if(n.getCenter().y>i.next.getCenter().y&&s<=i.next.width/2){r=!0;break}}r&&(i.next.setX(n.getX()+n.width+e),t())}(),this.next.isPositioned=!0,this.next.render()}}else{var n=this.getBottom();this.next.getTop(),this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+e),this.next.setX(n.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}},o.prototype.renderLines=function(){this.next&&(this.next_direction?this.drawLineTo(this.next,"",this.next_direction):this.drawLineTo(this.next))},o.prototype.drawLineTo=function(e,t,i){this.connectedTo.indexOf(e)<0&&this.connectedTo.push(e);var a,o=this.getCenter().x,s=this.getCenter().y,l=(this.getTop(),this.getRight()),c=this.getBottom(),u=this.getLeft(),d=e.getCenter().x,h=e.getCenter().y,p=e.getTop(),f=e.getRight(),m=(e.getBottom(),e.getLeft()),g=o===d,v=s===h,y=h>s,_=s>h,b=o>d,w=d>o,x=0,k=this.getAttr("line-length"),C=this.getAttr("line-width");if(i&&"bottom"!==i||!g||!y)if(i&&"right"!==i||!v||!w)if(i&&"left"!==i||!v||!b)if(i&&"right"!==i||!g||!_)if(i&&"right"!==i||!g||!y)if(i&&"bottom"!==i||!b)if(i&&"bottom"!==i||!w)if(i&&"right"===i&&b)a=n(this.chart,l,[{x:l.x+k/2,y:l.y},{x:l.x+k/2,y:p.y-k/2},{x:p.x,y:p.y-k/2},{x:p.x,y:p.y}],t),this.rightStart=!0,e.topEnd=!0,x=l.x+k/2;else if(i&&"right"===i&&w)a=n(this.chart,l,[{x:p.x,y:l.y},{x:p.x,y:p.y}],t),this.rightStart=!0,e.topEnd=!0,x=l.x+k/2;else if(i&&"bottom"===i&&g&&_)a=n(this.chart,c,[{x:c.x,y:c.y+k/2},{x:l.x+k/2,y:c.y+k/2},{x:l.x+k/2,y:p.y-k/2},{x:p.x,y:p.y-k/2},{x:p.x,y:p.y}],t),this.bottomStart=!0,e.topEnd=!0,x=c.x+k/2;else if("left"===i&&g&&_){var T=u.x-k/2;m.x<u.x&&(T=m.x-k/2),a=n(this.chart,u,[{x:T,y:u.y},{x:T,y:p.y-k/2},{x:p.x,y:p.y-k/2},{x:p.x,y:p.y}],t),this.leftStart=!0,e.topEnd=!0,x=u.x}else"left"===i&&(a=n(this.chart,u,[{x:p.x+(u.x-p.x)/2,y:u.y},{x:p.x+(u.x-p.x)/2,y:p.y-k/2},{x:p.x,y:p.y-k/2},{x:p.x,y:p.y}],t),this.leftStart=!0,e.topEnd=!0,x=u.x);else a=n(this.chart,c,[{x:c.x,y:c.y+k/2},{x:c.x+(c.x-p.x)/2,y:c.y+k/2},{x:c.x+(c.x-p.x)/2,y:p.y-k/2},{x:p.x,y:p.y-k/2},{x:p.x,y:p.y}],t),this.bottomStart=!0,e.topEnd=!0,x=c.x+(c.x-p.x)/2;else a=this.leftEnd&&_?n(this.chart,c,[{x:c.x,y:c.y+k/2},{x:c.x+(c.x-p.x)/2,y:c.y+k/2},{x:c.x+(c.x-p.x)/2,y:p.y-k/2},{x:p.x,y:p.y-k/2},{x:p.x,y:p.y}],t):n(this.chart,c,[{x:c.x,y:p.y-k/2},{x:p.x,y:p.y-k/2},{x:p.x,y:p.y}],t),this.bottomStart=!0,e.topEnd=!0,x=c.x+(c.x-p.x)/2;else a=n(this.chart,l,[{x:l.x+k/2,y:l.y},{x:l.x+k/2,y:p.y-k/2},{x:p.x,y:p.y-k/2},{x:p.x,y:p.y}],t),this.rightStart=!0,e.topEnd=!0,x=l.x+k/2;else a=n(this.chart,l,[{x:l.x+k/2,y:l.y},{x:l.x+k/2,y:p.y-k/2},{x:p.x,y:p.y-k/2},{x:p.x,y:p.y}],t),this.rightStart=!0,e.topEnd=!0,x=l.x+k/2;else a=n(this.chart,u,f,t),this.leftStart=!0,e.rightEnd=!0,x=f.x;else a=n(this.chart,l,m,t),this.rightStart=!0,e.leftEnd=!0,x=m.x;else a=n(this.chart,c,p,t),this.bottomStart=!0,e.topEnd=!0,x=c.x;if(a){for(var S=0,E=this.chart.lines.length;E>S;S++)for(var A,I=this.chart.lines[S],D=I.attr("path"),M=a.attr("path"),L=0,O=D.length-1;O>L;L++){var N=[];N.push(["M",D[L][1],D[L][2]]),N.push(["L",D[L+1][1],D[L+1][2]]);for(var P=N[0][1],R=N[0][2],j=N[1][1],z=N[1][2],F=0,B=M.length-1;B>F;F++){var U=[];U.push(["M",M[F][1],M[F][2]]),U.push(["L",M[F+1][1],M[F+1][2]]);var $=U[0][1],q=U[0][2],H=U[1][1],W=U[1][2],V=r(P,R,j,z,$,q,H,W);if(V.onLine1&&V.onLine2){var G;q===W?$>H?(G=["L",V.x+2*C,q],M.splice(F+1,0,G),G=["C",V.x+2*C,q,V.x,q-4*C,V.x-2*C,q],M.splice(F+2,0,G),a.attr("path",M)):(G=["L",V.x-2*C,q],M.splice(F+1,0,G),G=["C",V.x-2*C,q,V.x,q-4*C,V.x+2*C,q],M.splice(F+2,0,G),a.attr("path",M)):q>W?(G=["L",$,V.y+2*C],M.splice(F+1,0,G),G=["C",$,V.y+2*C,$+4*C,V.y,$,V.y-2*C],M.splice(F+2,0,G),a.attr("path",M)):(G=["L",$,V.y-2*C],M.splice(F+1,0,G),G=["C",$,V.y-2*C,$+4*C,V.y,$,V.y+2*C],M.splice(F+2,0,G),a.attr("path",M)),F+=2,A+=2}}}this.chart.lines.push(a)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&x>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=x)},v.inherits(s,o),v.inherits(l,o),v.inherits(c,o),v.inherits(u,o),v.inherits(d,o),d.prototype.getLeft=function(){var e=this.getY()+this.group.getBBox().height/2;return{x:this.getX()+this.textMargin,y:e}},d.prototype.getRight=function(){var e=this.getY()+this.group.getBBox().height/2;return{x:this.getX()+this.group.getBBox().width-this.textMargin,y:e}},v.inherits(h,o),h.prototype.render=function(){this.yes_direction&&(this[this.yes_direction+"_symbol"]=this.yes_symbol),this.no_direction&&(this[this.no_direction+"_symbol"]=this.no_symbol);var e=this.getAttr("line-length");if(this.bottom_symbol){var t=this.getBottom();this.bottom_symbol.getTop(),this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+e),this.bottom_symbol.setX(t.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.right_symbol){var i=this.getRight();if(this.right_symbol.getLeft(),!this.right_symbol.isPositioned){this.right_symbol.setY(i.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+e);var n=this;!function t(){for(var i,r=!1,a=0,o=n.chart.symbols.length;o>a;a++){i=n.chart.symbols[a];var s=Math.abs(i.getCenter().x-n.right_symbol.getCenter().x);if(i.getCenter().y>n.right_symbol.getCenter().y&&s<=n.right_symbol.width/2){r=!0;break}}r&&(n.right_symbol.setX(i.getX()+i.width+e),t())}(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}},h.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.getAttr("no-text"),this.no_direction)},m.parse=p}(),define("flowchart",function(){}),function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define("public/lib/editormd/lib/codemirror/lib/codemirror",[],e);this.CodeMirror=e()}}(function(){"use strict";function e(i,n){if(!(this instanceof e))return new e(i,n);this.options=n=n?Dr(n):{},Dr(qa,n,!1),p(n);var r=n.value;"string"==typeof r&&(r=new fo(r,n.mode)),this.doc=r;var a=new e.inputStyles[n.inputStyle](this),o=this.display=new t(i,r,a);o.wrapper.CodeMirror=this,c(this),s(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),n.autofocus&&!_a&&o.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new xr,keySeq:null};var l=this;ca&&ua<11&&setTimeout(function(){l.display.input.reset(!0)},20),Ft(this),$r(),vt(this),this.curOp.forceUpdate=!0,qn(this,r),n.autofocus&&!_a||l.hasFocus()?setTimeout(Mr(ci,this),20):ui(this);for(var u in Ha)Ha.hasOwnProperty(u)&&Ha[u](this,n[u],Wa);x(this),n.finishInit&&n.finishInit(this);for(var d=0;d<Ka.length;++d)Ka[d](this);_t(this),da&&n.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}function t(e,t,i){var n=this;this.input=i,n.scrollbarFiller=Pr("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=Pr("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=Pr("div",null,"CodeMirror-code"),n.selectionDiv=Pr("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=Pr("div",null,"CodeMirror-cursors"),n.measure=Pr("div",null,"CodeMirror-measure"),n.lineMeasure=Pr("div",null,"CodeMirror-measure"),n.lineSpace=Pr("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none"),n.mover=Pr("div",[Pr("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative"),n.sizer=Pr("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=Pr("div",null,null,"position: absolute; height: "+Co+"px; width: 1px;"),n.gutters=Pr("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=Pr("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=Pr("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),ca&&ua<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),da||oa&&_a||(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,i.init(n)}function i(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),n(t)}function n(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,Re(e,100),e.state.modeGen++,e.curOp&&Lt(e)}function r(e){e.options.lineWrapping?(Bo(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Fo(e.display.wrapper,"CodeMirror-wrap"),h(e)),o(e),Lt(e),rt(e),setTimeout(function(){y(e)},100)}function a(e){var t=mt(e.display),i=e.options.lineWrapping,n=i&&Math.max(5,e.display.scroller.clientWidth/gt(e.display)-3);return function(r){if(mn(e.doc,r))return 0;var a=0;if(r.widgets)for(var o=0;o<r.widgets.length;o++)r.widgets[o].height&&(a+=r.widgets[o].height);return i?a+(Math.ceil(r.text.length/n)||1)*t:a+t}}function o(e){var t=e.doc,i=a(e);t.iter(function(e){var t=i(e);t!=e.height&&Gn(e,t)})}function s(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),rt(e)}function l(e){c(e),Lt(e),setTimeout(function(){w(e)},20)}function c(e){var t=e.display.gutters,i=e.options.gutters;Rr(t);for(var n=0;n<i.length;++n){var r=i[n],a=t.appendChild(Pr("div",null,"CodeMirror-gutter "+r));"CodeMirror-linenumbers"==r&&(e.display.lineGutter=a,a.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=n?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function d(e){if(0==e.height)return 0;for(var t,i=e.text.length,n=e;t=ln(n);){var r=t.find(0,!0);n=r.from.line,i+=r.from.ch-r.to.ch}for(n=e;t=cn(n);){var r=t.find(0,!0);i-=n.text.length-r.from.ch,n=r.to.line,i+=n.text.length-r.to.ch}return i}function h(e){var t=e.display,i=e.doc;t.maxLine=Hn(i,i.first),t.maxLineLength=d(t.maxLine),t.maxLineChanged=!0,i.iter(function(e){var i=d(e);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=e)})}function p(e){var t=Sr(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function f(e){var t=e.display,i=t.gutters.offsetWidth,n=Math.round(e.doc.height+Ue(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:n,scrollHeight:n+qe(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}function m(e,t,i){this.cm=i;var n=this.vert=Pr("div",[Pr("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),r=this.horiz=Pr("div",[Pr("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(n),e(r),bo(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),bo(r,"scroll",function(){r.clientWidth&&t(r.scrollLeft,"horizontal")}),this.checkedOverlay=!1,ca&&ua<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Fo(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),bo(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,i){"horizontal"==i?Zt(t,e):Qt(t,e)},t),t.display.scrollbars.addClass&&Bo(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=f(e));var i=e.display.barWidth,n=e.display.barHeight;_(e,t);for(var r=0;r<4&&i!=e.display.barWidth||n!=e.display.barHeight;r++)i!=e.display.barWidth&&e.options.lineWrapping&&M(e),_(e,f(e)),i=e.display.barWidth,n=e.display.barHeight}function _(e,t){var i=e.display,n=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=n.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=n.bottom)+"px",n.right&&n.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=n.bottom+"px",i.scrollbarFiller.style.width=n.right+"px"):i.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=n.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}function b(e,t,i){var n=i&&null!=i.top?Math.max(0,i.top):e.scroller.scrollTop;n=Math.floor(n-Be(e));var r=i&&null!=i.bottom?i.bottom:n+e.wrapper.clientHeight,a=Kn(t,n),o=Kn(t,r);if(i&&i.ensure){var s=i.ensure.from.line,l=i.ensure.to.line;s<a?(a=s,o=Kn(t,Xn(Hn(t,s))+e.wrapper.clientHeight)):Math.min(l,t.lastLine())>=o&&(a=Kn(t,Xn(Hn(t,l))-e.wrapper.clientHeight),o=l)}return{from:a,to:Math.max(o,a+1)}}function w(e){var t=e.display,i=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,a=n+"px",o=0;o<i.length;o++)if(!i[o].hidden){e.options.fixedGutter&&i[o].gutter&&(i[o].gutter.style.left=a);var s=i[o].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=n+r+"px")}}function x(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=k(e.options,t.first+t.size-1),n=e.display;if(i.length!=n.lineNumChars){var r=n.measure.appendChild(Pr("div",[Pr("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=r.firstChild.offsetWidth,o=r.offsetWidth-a;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(a,n.lineGutter.offsetWidth-o),n.lineNumWidth=n.lineNumInnerWidth+o,n.lineNumChars=n.lineNumInnerWidth?i.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",u(e),!0}return!1}function k(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function C(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function T(e,t,i){var n=e.display;this.viewport=t,this.visible=b(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=He(e),this.force=i,this.dims=O(e),this.events=[]}function S(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=qe(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=qe(e)+"px",t.scrollbarsClipped=!0)}function E(e,t){var i=e.display,n=e.doc;if(t.editorIsHidden)return Nt(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&0==zt(e))return!1;x(e)&&(Nt(e),t.dims=O(e));var r=n.first+n.size,a=Math.max(t.visible.from-e.options.viewportMargin,n.first),o=Math.min(r,t.visible.to+e.options.viewportMargin);i.viewFrom<a&&a-i.viewFrom<20&&(a=Math.max(n.first,i.viewFrom)),i.viewTo>o&&i.viewTo-o<20&&(o=Math.min(r,i.viewTo)),Sa&&(a=pn(e.doc,a),o=fn(e.doc,o));var s=a!=i.viewFrom||o!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;jt(e,a,o),i.viewOffset=Xn(Hn(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var l=zt(e);if(!s&&0==l&&!t.force&&i.renderedView==i.view&&(null==i.updateLineNumbers||i.updateLineNumbers>=i.viewTo))return!1;var c=zr();return l>4&&(i.lineDiv.style.display="none"),N(e,i.updateLineNumbers,t.dims),l>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,c&&zr()!=c&&c.offsetHeight&&c.focus(),Rr(i.cursorDiv),Rr(i.selectionDiv),i.gutters.style.height=0,s&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Re(e,400)),i.updateLineNumbers=null,!0}function A(e,t){for(var i=(t.force,t.viewport),n=!0;;n=!1){if(n&&e.options.lineWrapping&&t.oldDisplayWidth!=He(e))!0;else if(!1,i&&null!=i.top&&(i={top:Math.min(e.doc.height+Ue(e.display)-We(e),i.top)}),t.visible=b(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!E(e,t))break;M(e);var r=f(e);Me(e),D(e,r),y(e,r)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function I(e,t){var i=new T(e,t);if(E(e,i)){M(e),A(e,i);var n=f(e);Me(e),D(e,n),y(e,n),i.finish()}}function D(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var i=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=i+"px",e.display.gutters.style.height=Math.max(i+qe(e),t.clientHeight)+"px"}function M(e){for(var t=e.display,i=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var r,a=t.view[n];if(!a.hidden){if(ca&&ua<8){var o=a.node.offsetTop+a.node.offsetHeight;r=o-i,i=o}else{var s=a.node.getBoundingClientRect();r=s.bottom-s.top}var l=a.line.height-r;if(r<2&&(r=mt(t)),(l>.001||l<-.001)&&(Gn(a.line,r),L(a.line),a.rest))for(var c=0;c<a.rest.length;c++)L(a.rest[c])}}}function L(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function O(e){for(var t=e.display,i={},n={},r=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o)i[e.options.gutters[o]]=a.offsetLeft+a.clientLeft+r,n[e.options.gutters[o]]=a.clientWidth;return{fixedPos:C(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function N(e,t,i){function n(t){var i=t.nextSibling;return da&&ba&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),i}for(var r=e.display,a=e.options.lineNumbers,o=r.lineDiv,s=o.firstChild,l=r.view,c=r.viewFrom,u=0;u<l.length;u++){var d=l[u];if(d.hidden);else if(d.node&&d.node.parentNode==o){for(;s!=d.node;)s=n(s);var h=a&&null!=t&&t<=c&&d.lineNumber;d.changes&&(Sr(d.changes,"gutter")>-1&&(h=!1),P(e,d,c,i)),h&&(Rr(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(k(e.options,c)))),s=d.node.nextSibling}else{var p=q(e,d,c,i);o.insertBefore(p,s)}c+=d.size}for(;s;)s=n(s)}function P(e,t,i,n){for(var r=0;r<t.changes.length;r++){var a=t.changes[r];"text"==a?F(e,t):"gutter"==a?U(e,t,i,n):"class"==a?B(t):"widget"==a&&$(e,t,n)}t.changes=null}function R(e){return e.node==e.text&&(e.node=Pr("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),ca&&ua<8&&(e.node.style.zIndex=2)),e.node}function j(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var i=R(e);e.background=i.insertBefore(Pr("div",null,t),i.firstChild)}}function z(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Mn(e,t)}function F(e,t){var i=t.text.className,n=z(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,B(t)):i&&(t.text.className=i)}function B(e){j(e),e.line.wrapClass?R(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function U(e,t,i,n){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var r=t.line.gutterMarkers;if(e.options.lineNumbers||r){var a=R(t),o=t.gutter=Pr("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px");if(e.display.input.setUneditable(o),a.insertBefore(o,t.text),t.line.gutterClass&&(o.className+=" "+t.line.gutterClass),!e.options.lineNumbers||r&&r["CodeMirror-linenumbers"]||(t.lineNumber=o.appendChild(Pr("div",k(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),r)for(var s=0;s<e.options.gutters.length;++s){var l=e.options.gutters[s],c=r.hasOwnProperty(l)&&r[l];c&&o.appendChild(Pr("div",[c],"CodeMirror-gutter-elt","left: "+n.gutterLeft[l]+"px; width: "+n.gutterWidth[l]+"px"))}}}function $(e,t,i){t.alignable&&(t.alignable=null);for(var n,r=t.node.firstChild;r;r=n){var n=r.nextSibling;"CodeMirror-linewidget"==r.className&&t.node.removeChild(r)}H(e,t,i)}function q(e,t,i,n){var r=z(e,t)
|
||
;return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),B(t),U(e,t,i,n),H(e,t,n),t.node}function H(e,t,i){if(W(e,t.line,t,i,!0),t.rest)for(var n=0;n<t.rest.length;n++)W(e,t.rest[n],t,i,!1)}function W(e,t,i,n,r){if(t.widgets)for(var a=R(i),o=0,s=t.widgets;o<s.length;++o){var l=s[o],c=Pr("div",[l.node],"CodeMirror-linewidget");l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),V(l,c,i,n),e.display.input.setUneditable(c),r&&l.above?a.insertBefore(c,i.gutter||i.text):a.appendChild(c),gr(l,"redraw")}}function V(e,t,i,n){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var r=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(r-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function G(e){return Ea(e.line,e.ch)}function Y(e,t){return Aa(e,t)<0?t:e}function K(e,t){return Aa(e,t)<0?e:t}function X(e){e.state.focused||(e.display.input.focus(),ci(e))}function Q(e){return e.options.readOnly||e.doc.cantEdit}function Z(e,t,i,n){var r=e.doc;e.display.shift=!1,n||(n=r.sel);var a=qo(t),o=null;e.state.pasteIncoming&&n.ranges.length>1&&(Ia&&Ia.join("\n")==t?o=n.ranges.length%Ia.length==0&&Er(Ia,qo):a.length==n.ranges.length&&(o=Er(a,function(e){return[e]})));for(var s=n.ranges.length-1;s>=0;s--){var l=n.ranges[s],c=l.from(),u=l.to();l.empty()&&(i&&i>0?c=Ea(c.line,c.ch-i):e.state.overwrite&&!e.state.pasteIncoming&&(u=Ea(u.line,Math.min(Hn(r,u.line).text.length,u.ch+Tr(a).length))));var d=e.curOp.updateInput,h={from:c,to:u,text:o?o[s%o.length]:a,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};if(yi(e.doc,h),gr(e,"inputRead",e,h),t&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&l.head.ch<100&&(!s||n.ranges[s-1].head.line!=l.head.line)){var p=e.getModeAt(l.head),f=$a(h);if(p.electricChars){for(var m=0;m<p.electricChars.length;m++)if(t.indexOf(p.electricChars.charAt(m))>-1){Li(e,f.line,"smart");break}}else p.electricInput&&p.electricInput.test(Hn(r,f.line).text.slice(0,f.ch))&&Li(e,f.line,"smart")}}Di(e),e.curOp.updateInput=d,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e){for(var t=[],i=[],n=0;n<e.doc.sel.ranges.length;n++){var r=e.doc.sel.ranges[n].head.line,a={anchor:Ea(r,0),head:Ea(r+1,0)};i.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:i}}function ee(e){e.setAttribute("autocorrect","off"),e.setAttribute("autocapitalize","off"),e.setAttribute("spellcheck","false")}function te(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new xr,this.inaccurateSelection=!1,this.hasSelection=!1}function ie(){var e=Pr("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none"),t=Pr("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return da?e.style.width="1000px":e.setAttribute("wrap","off"),ya&&(e.style.border="1px solid black"),ee(e),t}function ne(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new xr}function re(e,t){var i=Xe(e,t.line);if(!i||i.hidden)return null;var n=Hn(e.doc,t.line),r=Ge(i,n,t.line),a=Qn(n);if(a){ia(a,t.ch)%2?"right":"left"}var o=Je(r.map,t.ch,"left");return o.offset="right"==o.collapse?o.end:o.start,o}function ae(e,t){return t&&(e.bad=!0),e}function oe(e,t,i){var n;if(t==e.display.lineDiv){if(!(n=e.display.lineDiv.childNodes[i]))return ae(e.clipPos(Ea(e.display.viewTo-1)),!0);t=null,i=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var r=0;r<e.display.view.length;r++){var a=e.display.view[r];if(a.node==n)return se(a,t,i)}}function se(e,t,i){function n(t,i,n){for(var r=-1;r<(u?u.length:0);r++)for(var a=r<0?c.map:u[r],o=0;o<a.length;o+=3){var s=a[o+2];if(s==t||s==i){var l=Yn(r<0?e.line:e.rest[r]),d=a[o]+n;return(n<0||s!=t)&&(d=a[o+(n?1:0)]),Ea(l,d)}}}var r=e.text.firstChild,a=!1;if(!t||!Ro(r,t))return ae(Ea(Yn(e.line),0),!0);if(t==r&&(a=!0,t=r.childNodes[i],i=0,!t)){var o=e.rest?Tr(e.rest):e.line;return ae(Ea(Yn(o),o.text.length),a)}var s=3==t.nodeType?t:null,l=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,i&&(i=s.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var c=e.measure,u=c.maps,d=n(s,l,i);if(d)return ae(d,a);for(var h=l.nextSibling,p=s?s.nodeValue.length-i:0;h;h=h.nextSibling){if(d=n(h,h.firstChild,0))return ae(Ea(d.line,d.ch-p),a);p+=h.textContent.length}for(var f=l.previousSibling,p=i;f;f=f.previousSibling){if(d=n(f,f.firstChild,-1))return ae(Ea(d.line,d.ch+p),a);p+=h.textContent.length}}function le(e,t,i,n,r){function a(e){return function(t){return t.id==e}}function o(t){if(1==t.nodeType){var i=t.getAttribute("cm-text");if(null!=i)return""==i&&(i=t.textContent.replace(/\u200b/g,"")),void(s+=i);var c,u=t.getAttribute("cm-marker");if(u){var d=e.findMarks(Ea(n,0),Ea(r+1,0),a(+u));return void(d.length&&(c=d[0].find())&&(s+=Wn(e.doc,c.from,c.to).join("\n")))}if("false"==t.getAttribute("contenteditable"))return;for(var h=0;h<t.childNodes.length;h++)o(t.childNodes[h]);/^(pre|div|p)$/i.test(t.nodeName)&&(l=!0)}else if(3==t.nodeType){var p=t.nodeValue;if(!p)return;l&&(s+="\n",l=!1),s+=p}}for(var s="",l=!1;o(t),t!=i;)t=t.nextSibling;return s}function ce(e,t){this.ranges=e,this.primIndex=t}function ue(e,t){this.anchor=e,this.head=t}function de(e,t){var i=e[t];e.sort(function(e,t){return Aa(e.from(),t.from())}),t=Sr(e,i);for(var n=1;n<e.length;n++){var r=e[n],a=e[n-1];if(Aa(a.to(),r.from())>=0){var o=K(a.from(),r.from()),s=Y(a.to(),r.to()),l=a.empty()?r.from()==r.head:a.from()==a.head;n<=t&&--t,e.splice(--n,2,new ue(l?s:o,l?o:s))}}return new ce(e,t)}function he(e,t){return new ce([new ue(e,t||e)],0)}function pe(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function fe(e,t){if(t.line<e.first)return Ea(e.first,0);var i=e.first+e.size-1;return t.line>i?Ea(i,Hn(e,i).text.length):me(t,Hn(e,t.line).text.length)}function me(e,t){var i=e.ch;return null==i||i>t?Ea(e.line,t):i<0?Ea(e.line,0):e}function ge(e,t){return t>=e.first&&t<e.first+e.size}function ve(e,t){for(var i=[],n=0;n<t.length;n++)i[n]=fe(e,t[n]);return i}function ye(e,t,i,n){if(e.cm&&e.cm.display.shift||e.extend){var r=t.anchor;if(n){var a=Aa(i,r)<0;a!=Aa(n,r)<0?(r=i,i=n):a!=Aa(i,n)<0&&(i=n)}return new ue(r,i)}return new ue(n||i,i)}function _e(e,t,i,n){Te(e,new ce([ye(e,e.sel.primary(),t,i)],0),n)}function be(e,t,i){for(var n=[],r=0;r<e.sel.ranges.length;r++)n[r]=ye(e,e.sel.ranges[r],t[r],null);Te(e,de(n,e.sel.primIndex),i)}function we(e,t,i,n){var r=e.sel.ranges.slice(0);r[t]=i,Te(e,de(r,e.sel.primIndex),n)}function xe(e,t,i,n){Te(e,he(t,i),n)}function ke(e,t){var i={ranges:t.ranges,update:function(t){this.ranges=[];for(var i=0;i<t.length;i++)this.ranges[i]=new ue(fe(e,t[i].anchor),fe(e,t[i].head))}};return xo(e,"beforeSelectionChange",e,i),e.cm&&xo(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=t.ranges?de(i.ranges,i.ranges.length-1):t}function Ce(e,t,i){var n=e.history.done,r=Tr(n);r&&r.ranges?(n[n.length-1]=t,Se(e,t,i)):Te(e,t,i)}function Te(e,t,i){Se(e,t,i),rr(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Se(e,t,i){(br(e,"beforeSelectionChange")||e.cm&&br(e.cm,"beforeSelectionChange"))&&(t=ke(e,t)),Ee(e,Ie(e,t,i&&i.bias||(Aa(t.primary().head,e.sel.primary().head)<0?-1:1),!0)),i&&!1===i.scroll||!e.cm||Di(e.cm)}function Ee(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,_r(e.cm)),gr(e,"cursorActivity",e))}function Ae(e){Ee(e,Ie(e,e.sel,null,!1),So)}function Ie(e,t,i,n){for(var r,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=De(e,o.anchor,i,n),l=De(e,o.head,i,n);(r||s!=o.anchor||l!=o.head)&&(r||(r=t.ranges.slice(0,a)),r[a]=new ue(s,l))}return r?de(r,t.primIndex):t}function De(e,t,i,n){var r=!1,a=t,o=i||1;e.cantEdit=!1;e:for(;;){var s=Hn(e,a.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var c=s.markedSpans[l],u=c.marker;if((null==c.from||(u.inclusiveLeft?c.from<=a.ch:c.from<a.ch))&&(null==c.to||(u.inclusiveRight?c.to>=a.ch:c.to>a.ch))){if(n&&(xo(u,"beforeCursorEnter"),u.explicitlyCleared)){if(s.markedSpans){--l;continue}break}if(!u.atomic)continue;var d=u.find(o<0?-1:1);if(0==Aa(d,a)&&(d.ch+=o,d.ch<0?d=d.line>e.first?fe(e,Ea(d.line-1)):null:d.ch>s.text.length&&(d=d.line<e.first+e.size-1?Ea(d.line+1,0):null),!d)){if(r)return n?(e.cantEdit=!0,Ea(e.first,0)):De(e,t,i,!0);r=!0,d=t,o=-o}a=d;continue e}}return a}}function Me(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Le(e,t){for(var i=e.doc,n={},r=n.cursors=document.createDocumentFragment(),a=n.selection=document.createDocumentFragment(),o=0;o<i.sel.ranges.length;o++)if(!1!==t||o!=i.sel.primIndex){var s=i.sel.ranges[o],l=s.empty();(l||e.options.showCursorWhenSelecting)&&Oe(e,s,r),l||Ne(e,s,a)}return n}function Oe(e,t,i){var n=ut(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),r=i.appendChild(Pr("div"," ","CodeMirror-cursor"));if(r.style.left=n.left+"px",r.style.top=n.top+"px",r.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var a=i.appendChild(Pr("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=n.other.left+"px",a.style.top=n.other.top+"px",a.style.height=.85*(n.other.bottom-n.other.top)+"px"}}function Ne(e,t,i){function n(e,t,i,n){t<0&&(t=0),t=Math.round(t),n=Math.round(n),s.appendChild(Pr("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==i?u-e:i)+"px; height: "+(n-t)+"px"))}function r(t,i,r){function a(i,n){return ct(e,Ea(t,i),"div",d,n)}var s,l,d=Hn(o,t),h=d.text.length;return Gr(Qn(d),i||0,null==r?h:r,function(e,t,o){var d,p,f,m=a(e,"left");if(e==t)d=m,p=f=m.left;else{if(d=a(t-1,"right"),"rtl"==o){var g=m;m=d,d=g}p=m.left,f=d.right}null==i&&0==e&&(p=c),d.top-m.top>3&&(n(p,m.top,null,m.bottom),p=c,m.bottom<d.top&&n(p,m.bottom,null,d.top)),null==r&&t==h&&(f=u),(!s||m.top<s.top||m.top==s.top&&m.left<s.left)&&(s=m),(!l||d.bottom>l.bottom||d.bottom==l.bottom&&d.right>l.right)&&(l=d),p<c+1&&(p=c),n(p,d.top,f-p,d.bottom)}),{start:s,end:l}}var a=e.display,o=e.doc,s=document.createDocumentFragment(),l=$e(e.display),c=l.left,u=Math.max(a.sizerWidth,He(e)-a.sizer.offsetLeft)-l.right,d=t.from(),h=t.to();if(d.line==h.line)r(d.line,d.ch,h.ch);else{var p=Hn(o,d.line),f=Hn(o,h.line),m=dn(p)==dn(f),g=r(d.line,d.ch,m?p.text.length+1:null).end,v=r(h.line,m?0:null,h.ch).start;m&&(g.top<v.top-2?(n(g.right,g.top,null,g.bottom),n(c,v.top,v.left,v.bottom)):n(g.right,g.top,v.left-g.right,g.bottom)),g.bottom<v.top&&n(c,g.bottom,null,v.top)}i.appendChild(s)}function Pe(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Re(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,Mr(je,e))}function je(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,n=Qa(t.mode,Fe(e,t.frontier)),r=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(t.frontier>=e.display.viewFrom){var o=a.styles,s=En(e,a,n,!0);a.styles=s.styles;var l=a.styleClasses,c=s.classes;c?a.styleClasses=c:l&&(a.styleClasses=null);for(var u=!o||o.length!=a.styles.length||l!=c&&(!l||!c||l.bgClass!=c.bgClass||l.textClass!=c.textClass),d=0;!u&&d<o.length;++d)u=o[d]!=a.styles[d];u&&r.push(t.frontier),a.stateAfter=Qa(t.mode,n)}else In(e,a.text,n),a.stateAfter=t.frontier%5==0?Qa(t.mode,n):null;if(++t.frontier,+new Date>i)return Re(e,e.options.workDelay),!0}),r.length&&St(e,function(){for(var t=0;t<r.length;t++)Ot(e,r[t],"text")})}}function ze(e,t,i){for(var n,r,a=e.doc,o=i?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var l=Hn(a,s-1);if(l.stateAfter&&(!i||s<=a.frontier))return s;var c=Io(l.text,null,e.options.tabSize);(null==r||n>c)&&(r=s-1,n=c)}return r}function Fe(e,t,i){var n=e.doc,r=e.display;if(!n.mode.startState)return!0;var a=ze(e,t,i),o=a>n.first&&Hn(n,a-1).stateAfter;return o=o?Qa(n.mode,o):Za(n.mode),n.iter(a,t,function(i){In(e,i.text,o);var s=a==t-1||a%5==0||a>=r.viewFrom&&a<r.viewTo;i.stateAfter=s?Qa(n.mode,o):null,++a}),i&&(n.frontier=a),o}function Be(e){return e.lineSpace.offsetTop}function Ue(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function $e(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=jr(e.measure,Pr("pre","x")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return isNaN(n.left)||isNaN(n.right)||(e.cachedPaddingH=n),n}function qe(e){return Co-e.display.nativeBarWidth}function He(e){return e.display.scroller.clientWidth-qe(e)-e.display.barWidth}function We(e){return e.display.scroller.clientHeight-qe(e)-e.display.barHeight}function Ve(e,t,i){var n=e.options.lineWrapping,r=n&&He(e);if(!t.measure.heights||n&&t.measure.width!=r){var a=t.measure.heights=[];if(n){t.measure.width=r;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var l=o[s],c=o[s+1];Math.abs(l.bottom-c.bottom)>2&&a.push((l.bottom+c.top)/2-i.top)}}a.push(i.bottom-i.top)}}function Ge(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var n=0;n<e.rest.length;n++)if(Yn(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function Ye(e,t){t=dn(t);var i=Yn(t),n=e.display.externalMeasured=new Dt(e.doc,t,i);n.lineN=i;var r=n.built=Mn(e,n);return n.text=r.pre,jr(e.display.lineMeasure,r.pre),n}function Ke(e,t,i,n){return Ze(e,Qe(e,t),i,n)}function Xe(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Pt(e,t)];var i=e.display.externalMeasured;return i&&t>=i.lineN&&t<i.lineN+i.size?i:void 0}function Qe(e,t){var i=Yn(t),n=Xe(e,i);n&&!n.text?n=null:n&&n.changes&&P(e,n,i,O(e)),n||(n=Ye(e,t));var r=Ge(n,t,i);return{line:t,view:n,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function Ze(e,t,i,n,r){t.before&&(i=-1);var a,o=i+(n||"");return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Ve(e,t.view,t.rect),t.hasHeights=!0),a=et(e,t,i,n),a.bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:r?a.rtop:a.top,bottom:r?a.rbottom:a.bottom}}function Je(e,t,i){for(var n,r,a,o,s=0;s<e.length;s+=3){var l=e[s],c=e[s+1];if(t<l?(r=0,a=1,o="left"):t<c?(r=t-l,a=r+1):(s==e.length-3||t==c&&e[s+3]>t)&&(a=c-l,r=a-1,t>=c&&(o="right")),null!=r){if(n=e[s+2],l==c&&i==(n.insertLeft?"left":"right")&&(o=i),"left"==i&&0==r)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)n=e[2+(s-=3)],o="left";if("right"==i&&r==c-l)for(;s<e.length-3&&e[s+3]==e[s+4]&&!e[s+5].insertLeft;)n=e[(s+=3)+2],o="right";break}}return{node:n,start:r,end:a,collapse:o,coverStart:l,coverEnd:c}}function et(e,t,i,n){var r,a=Je(t.map,i,n),o=a.node,s=a.start,l=a.end,c=a.collapse;if(3==o.nodeType){for(var u=0;u<4;u++){for(;s&&Nr(t.line.text.charAt(a.coverStart+s));)--s;for(;a.coverStart+l<a.coverEnd&&Nr(t.line.text.charAt(a.coverStart+l));)++l;if(ca&&ua<9&&0==s&&l==a.coverEnd-a.coverStart)r=o.parentNode.getBoundingClientRect();else if(ca&&e.options.lineWrapping){var d=Lo(o,s,l).getClientRects();r=d.length?d["right"==n?d.length-1:0]:Oa}else r=Lo(o,s,l).getBoundingClientRect()||Oa;if(r.left||r.right||0==s)break;l=s,s-=1,c="right"}ca&&ua<11&&(r=tt(e.display.measure,r))}else{s>0&&(c=n="right");var d;r=e.options.lineWrapping&&(d=o.getClientRects()).length>1?d["right"==n?d.length-1:0]:o.getBoundingClientRect()}if(ca&&ua<9&&!s&&(!r||!r.left&&!r.right)){var h=o.parentNode.getClientRects()[0];r=h?{left:h.left,right:h.left+gt(e.display),top:h.top,bottom:h.bottom}:Oa}for(var p=r.top-t.rect.top,f=r.bottom-t.rect.top,m=(p+f)/2,g=t.view.measure.heights,u=0;u<g.length-1&&!(m<g[u]);u++);var v=u?g[u-1]:0,y=g[u],_={left:("right"==c?r.right:r.left)-t.rect.left,right:("left"==c?r.left:r.right)-t.rect.left,top:v,bottom:y};return r.left||r.right||(_.bogus=!0),e.options.singleCursorHeightPerLine||(_.rtop=p,_.rbottom=f),_}function tt(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Vr(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*n,bottom:t.bottom*n}}function it(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function nt(e){e.display.externalMeasure=null,Rr(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)it(e.display.view[t])}function rt(e){nt(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function at(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ot(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function st(e,t,i,n){if(t.widgets)for(var r=0;r<t.widgets.length;++r)if(t.widgets[r].above){var a=yn(t.widgets[r]);i.top+=a,i.bottom+=a}if("line"==n)return i;n||(n="local");var o=Xn(t);if("local"==n?o+=Be(e.display):o-=e.display.viewOffset,"page"==n||"window"==n){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+("window"==n?0:ot());var l=s.left+("window"==n?0:at());i.left+=l,i.right+=l}return i.top+=o,i.bottom+=o,i}function lt(e,t,i){if("div"==i)return t;var n=t.left,r=t.top;if("page"==i)n-=at(),r-=ot();else if("local"==i||!i){var a=e.display.sizer.getBoundingClientRect();n+=a.left,r+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:n-o.left,top:r-o.top}}function ct(e,t,i,n,r){return n||(n=Hn(e.doc,t.line)),st(e,n,Ke(e,n,t.ch,r),i)}function ut(e,t,i,n,r,a){function o(t,o){var s=Ze(e,r,t,o?"right":"left",a);return o?s.left=s.right:s.right=s.left,st(e,n,s,i)}function s(e,t){var i=l[t],n=i.level%2;return e==Yr(i)&&t&&i.level<l[t-1].level?(i=l[--t],e=Kr(i)-(i.level%2?0:1),n=!0):e==Kr(i)&&t<l.length-1&&i.level<l[t+1].level&&(i=l[++t],e=Yr(i)-i.level%2,n=!1),n&&e==i.to&&e>i.from?o(e-1):o(e,n)}n=n||Hn(e.doc,t.line),r||(r=Qe(e,n));var l=Qn(n),c=t.ch;if(!l)return o(c);var u=ia(l,c),d=s(c,u);return null!=Yo&&(d.other=s(c,Yo)),d}function dt(e,t){var i=0,t=fe(e.doc,t);e.options.lineWrapping||(i=gt(e.display)*t.ch);var n=Hn(e.doc,t.line),r=Xn(n)+Be(e.display);return{left:i,right:i,top:r,bottom:r+n.height}}function ht(e,t,i,n){var r=Ea(e,t);return r.xRel=n,i&&(r.outside=!0),r}function pt(e,t,i){var n=e.doc;if((i+=e.display.viewOffset)<0)return ht(n.first,0,!0,-1);var r=Kn(n,i),a=n.first+n.size-1;if(r>a)return ht(n.first+n.size-1,Hn(n,a).text.length,!0,1);t<0&&(t=0);for(var o=Hn(n,r);;){var s=ft(e,o,r,t,i),l=cn(o),c=l&&l.find(0,!0);if(!l||!(s.ch>c.from.ch||s.ch==c.from.ch&&s.xRel>0))return s;r=Yn(o=c.to.line)}}function ft(e,t,i,n,r){function a(n){var r=ut(e,Ea(i,n),"line",t,c);return s=!0,o>r.bottom?r.left-l:o<r.top?r.left+l:(s=!1,r.left)}var o=r-Xn(t),s=!1,l=2*e.display.wrapper.clientWidth,c=Qe(e,t),u=Qn(t),d=t.text.length,h=Xr(t),p=Qr(t),f=a(h),m=s,g=a(p),v=s;if(n>g)return ht(i,p,v,1);for(;;){if(u?p==h||p==ra(t,h,1):p-h<=1){for(var y=n<f||n-f<=g-n?h:p,_=n-(y==h?f:g);Nr(t.text.charAt(y));)++y;return ht(i,y,y==h?m:v,_<-1?-1:_>1?1:0)}var b=Math.ceil(d/2),w=h+b;if(u){w=h;for(var x=0;x<b;++x)w=ra(t,w,1)}var k=a(w);k>n?(p=w,g=k,(v=s)&&(g+=1e3),d=b):(h=w,f=k,m=s,d-=b)}}function mt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Da){Da=Pr("pre");for(var t=0;t<49;++t)Da.appendChild(document.createTextNode("x")),Da.appendChild(Pr("br"));Da.appendChild(document.createTextNode("x"))}jr(e.measure,Da);var i=Da.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Rr(e.measure),i||1}function gt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Pr("span","xxxxxxxxxx"),i=Pr("pre",[t]);jr(e.measure,i);var n=t.getBoundingClientRect(),r=(n.right-n.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function vt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,id:++Pa},Na?Na.ops.push(e.curOp):e.curOp.ownsGroup=Na={ops:[e.curOp],delayedCallbacks:[]}}function yt(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i]();for(var n=0;n<e.ops.length;n++){var r=e.ops[n];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++](r.cm)}}while(i<t.length)}function _t(e){var t=e.curOp,i=t.ownsGroup;if(i)try{yt(i)}finally{Na=null;for(var n=0;n<i.ops.length;n++)i.ops[n].cm.curOp=null;bt(i)}}function bt(e){for(var t=e.ops,i=0;i<t.length;i++)wt(t[i]);for(var i=0;i<t.length;i++)xt(t[i]);for(var i=0;i<t.length;i++)kt(t[i]);for(var i=0;i<t.length;i++)Ct(t[i]);for(var i=0;i<t.length;i++)Tt(t[i])}function wt(e){var t=e.cm,i=t.display;S(t),e.updateMaxLine&&h(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new T(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function xt(e){e.updatedDisplay=e.mustUpdate&&E(e.cm,e.update)}function kt(e){var t=e.cm,i=t.display;e.updatedDisplay&&M(t),e.barMeasure=f(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ke(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+qe(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-He(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Ct(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Zt(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.preparedSelection&&t.display.input.showSelection(e.preparedSelection),e.updatedDisplay&&D(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&y(t,e.barMeasure),e.selectionChanged&&Pe(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing)}function Tt(e){var t=e.cm,i=t.display,n=t.doc;if(e.updatedDisplay&&A(t,e.update),null==i.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(i.wheelStartX=i.wheelStartY=null),null==e.scrollTop||i.scroller.scrollTop==e.scrollTop&&!e.forceScroll||(n.scrollTop=Math.max(0,Math.min(i.scroller.scrollHeight-i.scroller.clientHeight,e.scrollTop)),i.scrollbars.setScrollTop(n.scrollTop),i.scroller.scrollTop=n.scrollTop),null==e.scrollLeft||i.scroller.scrollLeft==e.scrollLeft&&!e.forceScroll||(n.scrollLeft=Math.max(0,Math.min(i.scroller.scrollWidth-He(t),e.scrollLeft)),i.scrollbars.setScrollLeft(n.scrollLeft),i.scroller.scrollLeft=n.scrollLeft,w(t)),e.scrollToPos){var r=Si(t,fe(n,e.scrollToPos.from),fe(n,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&Ti(t,r)}var a=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(a)for(var s=0;s<a.length;++s)a[s].lines.length||xo(a[s],"hide");if(o)for(var s=0;s<o.length;++s)o[s].lines.length&&xo(o[s],"unhide");i.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&xo(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function St(e,t){if(e.curOp)return t();vt(e);try{return t()}finally{_t(e)}}function Et(e,t){return function(){if(e.curOp)return t.apply(e,arguments);vt(e);try{return t.apply(e,arguments)}finally{_t(e)}}}function At(e){return function(){if(this.curOp)return e.apply(this,arguments);vt(this);try{return e.apply(this,arguments)}finally{_t(this)}}}function It(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);vt(t);try{return e.apply(this,arguments)}finally{_t(t)}}}function Dt(e,t,i){this.line=t,this.rest=hn(t),this.size=this.rest?Yn(Tr(this.rest))-i+1:1,this.node=this.text=null,this.hidden=mn(e,t)}function Mt(e,t,i){for(var n,r=[],a=t;a<i;a=n){var o=new Dt(e.doc,Hn(e.doc,a),a);n=a+o.size,r.push(o)}return r}function Lt(e,t,i,n){null==t&&(t=e.doc.first),null==i&&(i=e.doc.first+e.doc.size),n||(n=0);var r=e.display;if(n&&i<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)Sa&&pn(e.doc,t)<r.viewTo&&Nt(e);else if(i<=r.viewFrom)Sa&&fn(e.doc,i+n)>r.viewFrom?Nt(e):(r.viewFrom+=n,r.viewTo+=n);else if(t<=r.viewFrom&&i>=r.viewTo)Nt(e);else if(t<=r.viewFrom){var a=Rt(e,i,i+n,1);a?(r.view=r.view.slice(a.index),r.viewFrom=a.lineN,r.viewTo+=n):Nt(e)}else if(i>=r.viewTo){var a=Rt(e,t,t,-1);a?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):Nt(e)}else{var o=Rt(e,t,t,-1),s=Rt(e,i,i+n,1);o&&s?(r.view=r.view.slice(0,o.index).concat(Mt(e,o.lineN,s.lineN)).concat(r.view.slice(s.index)),r.viewTo+=n):Nt(e)}var l=r.externalMeasured;l&&(i<l.lineN?l.lineN+=n:t<l.lineN+l.size&&(r.externalMeasured=null))}function Ot(e,t,i){e.curOp.viewChanged=!0;var n=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var a=n.view[Pt(e,t)];if(null!=a.node){var o=a.changes||(a.changes=[]);-1==Sr(o,i)&&o.push(i)}}}function Nt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Pt(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var i=e.display.view,n=0;n<i.length;n++)if((t-=i[n].size)<0)return n}function Rt(e,t,i,n){var r,a=Pt(e,t),o=e.display.view;if(!Sa||i==e.doc.first+e.doc.size)return{index:a,lineN:i};for(var s=0,l=e.display.viewFrom;s<a;s++)l+=o[s].size;if(l!=t){if(n>0){if(a==o.length-1)return null;r=l+o[a].size-t,a++}else r=l-t;t+=r,i+=r}for(;pn(e.doc,i)!=i;){if(a==(n<0?0:o.length-1))return null;i+=n*o[a-(n<0?1:0)].size,a+=n}return{index:a,lineN:i}}function jt(e,t,i){var n=e.display;0==n.view.length||t>=n.viewTo||i<=n.viewFrom?(n.view=Mt(e,t,i),n.viewFrom=t):(n.viewFrom>t?n.view=Mt(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Pt(e,t))),n.viewFrom=t,n.viewTo<i?n.view=n.view.concat(Mt(e,n.viewTo,i)):n.viewTo>i&&(n.view=n.view.slice(0,Pt(e,i)))),n.viewTo=i}function zt(e){for(var t=e.display.view,i=0,n=0;n<t.length;n++){var r=t[n];r.hidden||r.node&&!r.changes||++i}return i}function Ft(e){function t(){a.activeTouch&&(o=setTimeout(function(){a.activeTouch=null},1e3),s=a.activeTouch,s.end=+new Date)}function i(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function n(e,t){if(null==t.left)return!0;var i=t.left-e.left,n=t.top-e.top;return i*i+n*n>400}function r(t){yr(e,t)||_o(t)}var a=e.display;bo(a.scroller,"mousedown",Et(e,qt)),ca&&ua<11?bo(a.scroller,"dblclick",Et(e,function(t){if(!yr(e,t)){var i=$t(e,t);if(i&&!Yt(e,t)&&!Ut(e.display,t)){vo(t);var n=e.findWordAt(i);_e(e.doc,n.anchor,n.head)}}})):bo(a.scroller,"dblclick",function(t){yr(e,t)||vo(t)}),Ca||bo(a.scroller,"contextmenu",function(t){di(e,t)});var o,s={end:0};bo(a.scroller,"touchstart",function(e){if(!i(e)){clearTimeout(o);var t=+new Date;a.activeTouch={start:t,moved:!1,prev:t-s.end<=300?s:null},1==e.touches.length&&(a.activeTouch.left=e.touches[0].pageX,a.activeTouch.top=e.touches[0].pageY)}}),bo(a.scroller,"touchmove",function(){a.activeTouch&&(a.activeTouch.moved=!0)}),bo(a.scroller,"touchend",function(i){var r=a.activeTouch;if(r&&!Ut(a,i)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,s=e.coordsChar(a.activeTouch,"page");o=!r.prev||n(r,r.prev)?new ue(s,s):!r.prev.prev||n(r,r.prev.prev)?e.findWordAt(s):new ue(Ea(s.line,0),fe(e.doc,Ea(s.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),vo(i)}t()}),bo(a.scroller,"touchcancel",t),bo(a.scroller,"scroll",function(){a.scroller.clientHeight&&(Qt(e,a.scroller.scrollTop),Zt(e,a.scroller.scrollLeft,!0),xo(e,"scroll",e))}),bo(a.scroller,"mousewheel",function(t){Jt(e,t)}),bo(a.scroller,"DOMMouseScroll",function(t){Jt(e,t)}),bo(a.wrapper,"scroll",function(){a.wrapper.scrollTop=a.wrapper.scrollLeft=0}),e.options.dragDrop&&(bo(a.scroller,"dragstart",function(t){Xt(e,t)}),bo(a.scroller,"dragenter",r),bo(a.scroller,"dragover",r),bo(a.scroller,"drop",Et(e,Kt)));var l=a.input.getField();bo(l,"keyup",function(t){si.call(e,t)}),bo(l,"keydown",Et(e,ai)),bo(l,"keypress",Et(e,li)),bo(l,"focus",Mr(ci,e)),bo(l,"blur",Mr(ui,e))}function Bt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Ut(e,t){for(var i=fr(t);i!=e.wrapper;i=i.parentNode)if(!i||1==i.nodeType&&"true"==i.getAttribute("cm-ignore-events")||i.parentNode==e.sizer&&i!=e.mover)return!0}function $t(e,t,i,n){var r=e.display;if(!i&&"true"==fr(t).getAttribute("cm-not-content"))return null;var a,o,s=r.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,o=t.clientY-s.top}catch(t){return null}var l,c=pt(e,a,o);if(n&&1==c.xRel&&(l=Hn(e.doc,c.line).text).length==c.ch){var u=Io(l,l.length,e.options.tabSize)-l.length;c=Ea(c.line,Math.max(0,Math.round((a-$e(e.display).left)/gt(e.display))-u))}return c}function qt(e){var t=this,i=t.display;if(!(i.activeTouch&&i.input.supportsTouch()||yr(t,e))){if(i.shift=e.shiftKey,Ut(i,e))return void(da||(i.scroller.draggable=!1,setTimeout(function(){i.scroller.draggable=!0},100)));if(!Yt(t,e)){var n=$t(t,e);switch(window.focus(),mr(e)){case 1:n?Ht(t,e,n):fr(e)==i.scroller&&vo(e);break;case 2:da&&(t.state.lastMiddleDown=+new Date),n&&_e(t.doc,n),setTimeout(function(){i.input.focus()},20),vo(e);break;case 3:Ca&&di(t,e)}}}}function Ht(e,t,i){ca?setTimeout(Mr(X,e),0):X(e);var n,r=+new Date;La&&La.time>r-400&&0==Aa(La.pos,i)?n="triple":Ma&&Ma.time>r-400&&0==Aa(Ma.pos,i)?(n="double",La={time:r,pos:i}):(n="single",Ma={time:r,pos:i});var a,o=e.doc.sel,s=ba?t.metaKey:t.ctrlKey;e.options.dragDrop&&$o&&!Q(e)&&"single"==n&&(a=o.contains(i))>-1&&!o.ranges[a].empty()?Wt(e,t,i,s):Vt(e,t,i,n,s)}function Wt(e,t,i,n){var r=e.display,a=Et(e,function(o){da&&(r.scroller.draggable=!1),e.state.draggingText=!1,wo(document,"mouseup",a),wo(r.scroller,"drop",a),Math.abs(t.clientX-o.clientX)+Math.abs(t.clientY-o.clientY)<10&&(vo(o),n||_e(e.doc,i),r.input.focus(),ca&&9==ua&&setTimeout(function(){document.body.focus(),r.input.focus()},20))});da&&(r.scroller.draggable=!0),e.state.draggingText=a,r.scroller.dragDrop&&r.scroller.dragDrop(),bo(document,"mouseup",a),bo(r.scroller,"drop",a)}function Vt(e,t,i,n,r){function a(t){if(0!=Aa(g,t))if(g=t,"rect"==n){for(var r=[],a=e.options.tabSize,o=Io(Hn(c,i.line).text,i.ch,a),s=Io(Hn(c,t.line).text,t.ch,a),l=Math.min(o,s),p=Math.max(o,s),f=Math.min(i.line,t.line),m=Math.min(e.lastLine(),Math.max(i.line,t.line));f<=m;f++){var v=Hn(c,f).text,y=kr(v,l,a);l==p?r.push(new ue(Ea(f,y),Ea(f,y))):v.length>y&&r.push(new ue(Ea(f,y),Ea(f,kr(v,p,a))))}r.length||r.push(new ue(i,i)),Te(c,de(h.ranges.slice(0,d).concat(r),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var _=u,b=_.anchor,w=t;if("single"!=n){if("double"==n)var x=e.findWordAt(t);else var x=new ue(Ea(t.line,0),fe(c,Ea(t.line+1,0)));Aa(x.anchor,b)>0?(w=x.head,b=K(_.from(),x.anchor)):(w=x.anchor,b=Y(_.to(),x.head))}var r=h.ranges.slice(0);r[d]=new ue(fe(c,b),w),Te(c,de(r,d),Eo)}}function o(t){var i=++y,r=$t(e,t,!0,"rect"==n);if(r)if(0!=Aa(r,g)){X(e),a(r);var s=b(l,c);(r.line>=s.to||r.line<s.from)&&setTimeout(Et(e,function(){y==i&&o(t)}),150)}else{var u=t.clientY<v.top?-20:t.clientY>v.bottom?20:0;u&&setTimeout(Et(e,function(){
|
||
y==i&&(l.scroller.scrollTop+=u,o(t))}),50)}}function s(e){y=1/0,vo(e),l.input.focus(),wo(document,"mousemove",_),wo(document,"mouseup",w),c.history.lastSelOrigin=null}var l=e.display,c=e.doc;vo(t);var u,d,h=c.sel,p=h.ranges;if(r&&!t.shiftKey?(d=c.sel.contains(i),u=d>-1?p[d]:new ue(i,i)):u=c.sel.primary(),t.altKey)n="rect",r||(u=new ue(i,i)),i=$t(e,t,!0,!0),d=-1;else if("double"==n){var f=e.findWordAt(i);u=e.display.shift||c.extend?ye(c,u,f.anchor,f.head):f}else if("triple"==n){var m=new ue(Ea(i.line,0),fe(c,Ea(i.line+1,0)));u=e.display.shift||c.extend?ye(c,u,m.anchor,m.head):m}else u=ye(c,u,i);r?-1==d?(d=p.length,Te(c,de(p.concat([u]),d),{scroll:!1,origin:"*mouse"})):p.length>1&&p[d].empty()&&"single"==n?(Te(c,de(p.slice(0,d).concat(p.slice(d+1)),0)),h=c.sel):we(c,d,u,Eo):(d=0,Te(c,new ce([u],0),Eo),h=c.sel);var g=i,v=l.wrapper.getBoundingClientRect(),y=0,_=Et(e,function(e){mr(e)?o(e):s(e)}),w=Et(e,s);bo(document,"mousemove",_),bo(document,"mouseup",w)}function Gt(e,t,i,n,r){try{var a=t.clientX,o=t.clientY}catch(t){return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&vo(t);var s=e.display,l=s.lineDiv.getBoundingClientRect();if(o>l.bottom||!br(e,i))return pr(t);o-=l.top-s.viewOffset;for(var c=0;c<e.options.gutters.length;++c){var u=s.gutters.childNodes[c];if(u&&u.getBoundingClientRect().right>=a){return r(e,i,e,Kn(e.doc,o),e.options.gutters[c],t),pr(t)}}}function Yt(e,t){return Gt(e,t,"gutterClick",!0,gr)}function Kt(e){var t=this;if(!yr(t,e)&&!Ut(t.display,e)){vo(e),ca&&(Ra=+new Date);var i=$t(t,e,!0),n=e.dataTransfer.files;if(i&&!Q(t))if(n&&n.length&&window.FileReader&&window.File)for(var r=n.length,a=Array(r),o=0,s=0;s<r;++s)!function(e,n){var s=new FileReader;s.onload=Et(t,function(){if(a[n]=s.result,++o==r){i=fe(t.doc,i);var e={from:i,to:i,text:qo(a.join("\n")),origin:"paste"};yi(t.doc,e),Ce(t.doc,he(i,$a(e)))}}),s.readAsText(e)}(n[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var a=e.dataTransfer.getData("Text");if(a){if(t.state.draggingText&&!(ba?e.metaKey:e.ctrlKey))var l=t.listSelections();if(Se(t.doc,he(i,i)),l)for(var s=0;s<l.length;++s)Ci(t.doc,"",l[s].anchor,l[s].head,"drag");t.replaceSelection(a,"around","paste"),t.display.input.focus()}}catch(e){}}}}function Xt(e,t){if(ca&&(!e.state.draggingText||+new Date-Ra<100))return void _o(t);if(!yr(e,t)&&!Ut(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!ma)){var i=Pr("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",fa&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),fa&&i.parentNode.removeChild(i)}}function Qt(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,oa||I(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),oa&&I(e),Re(e,100))}function Zt(e,t,i){(i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,w(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Jt(e,t){var i=Fa(t),n=i.x,r=i.y,a=e.display,o=a.scroller;if(n&&o.scrollWidth>o.clientWidth||r&&o.scrollHeight>o.clientHeight){if(r&&ba&&da)e:for(var s=t.target,l=a.view;s!=o;s=s.parentNode)for(var c=0;c<l.length;c++)if(l[c].node==s){e.display.currentWheelTarget=s;break e}if(n&&!oa&&!fa&&null!=za)return r&&Qt(e,Math.max(0,Math.min(o.scrollTop+r*za,o.scrollHeight-o.clientHeight))),Zt(e,Math.max(0,Math.min(o.scrollLeft+n*za,o.scrollWidth-o.clientWidth))),vo(t),void(a.wheelStartX=null);if(r&&null!=za){var u=r*za,d=e.doc.scrollTop,h=d+a.wrapper.clientHeight;u<0?d=Math.max(0,d+u-50):h=Math.min(e.doc.height,h+u+50),I(e,{top:d,bottom:h})}ja<20&&(null==a.wheelStartX?(a.wheelStartX=o.scrollLeft,a.wheelStartY=o.scrollTop,a.wheelDX=n,a.wheelDY=r,setTimeout(function(){if(null!=a.wheelStartX){var e=o.scrollLeft-a.wheelStartX,t=o.scrollTop-a.wheelStartY,i=t&&a.wheelDY&&t/a.wheelDY||e&&a.wheelDX&&e/a.wheelDX;a.wheelStartX=a.wheelStartY=null,i&&(za=(za*ja+i)/(ja+1),++ja)}},200)):(a.wheelDX+=n,a.wheelDY+=r))}}function ei(e,t,i){if("string"==typeof t&&!(t=Ja[t]))return!1;e.display.input.ensurePolled();var n=e.display.shift,r=!1;try{Q(e)&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),r=t(e)!=To}finally{e.display.shift=n,e.state.suppressEdits=!1}return r}function ti(e,t,i){for(var n=0;n<e.state.keyMaps.length;n++){var r=to(t,e.state.keyMaps[n],i,e);if(r)return r}return e.options.extraKeys&&to(t,e.options.extraKeys,i,e)||to(t,e.options.keyMap,i,e)}function ii(e,t,i,n){var r=e.state.keySeq;if(r){if(io(t))return"handled";Ba.set(50,function(){e.state.keySeq==r&&(e.state.keySeq=null,e.display.input.reset())}),t=r+" "+t}var a=ti(e,t,n);return"multi"==a&&(e.state.keySeq=t),"handled"==a&&gr(e,"keyHandled",e,t,i),"handled"!=a&&"multi"!=a||(vo(i),Pe(e)),r&&!a&&/\'$/.test(t)?(vo(i),!0):!!a}function ni(e,t){var i=no(t,!0);return!!i&&(t.shiftKey&&!e.state.keySeq?ii(e,"Shift-"+i,t,function(t){return ei(e,t,!0)})||ii(e,i,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return ei(e,t)}):ii(e,i,t,function(t){return ei(e,t)}))}function ri(e,t,i){return ii(e,"'"+i+"'",t,function(t){return ei(e,t,!0)})}function ai(e){var t=this;if(X(t),!yr(t,e)){ca&&ua<11&&27==e.keyCode&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=16==i||e.shiftKey;var n=ni(t,e);fa&&(Ua=n?i:null,!n&&88==i&&!Wo&&(ba?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||oi(t)}}function oi(e){function t(e){18!=e.keyCode&&e.altKey||(Fo(i,"CodeMirror-crosshair"),wo(document,"keyup",t),wo(document,"mouseover",t))}var i=e.display.lineDiv;Bo(i,"CodeMirror-crosshair"),bo(document,"keyup",t),bo(document,"mouseover",t)}function si(e){16==e.keyCode&&(this.doc.sel.shift=!1),yr(this,e)}function li(e){var t=this;if(!(Ut(t.display,e)||yr(t,e)||e.ctrlKey&&!e.altKey||ba&&e.metaKey)){var i=e.keyCode,n=e.charCode;if(fa&&i==Ua)return Ua=null,void vo(e);if(!fa||e.which&&!(e.which<10)||!ni(t,e)){ri(t,e,String.fromCharCode(null==n?i:n))||t.display.input.onKeyPress(e)}}}function ci(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(xo(e,"focus",e),e.state.focused=!0,Bo(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),da&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Pe(e))}function ui(e){e.state.focused&&(xo(e,"blur",e),e.state.focused=!1,Fo(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function di(e,t){Ut(e.display,t)||hi(e,t)||e.display.input.onContextMenu(t)}function hi(e,t){return!!br(e,"gutterContextMenu")&&Gt(e,t,"gutterContextMenu",!1,xo)}function pi(e,t){if(Aa(e,t.from)<0)return e;if(Aa(e,t.to)<=0)return $a(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=$a(t).ch-t.to.ch),Ea(i,n)}function fi(e,t){for(var i=[],n=0;n<e.sel.ranges.length;n++){var r=e.sel.ranges[n];i.push(new ue(pi(r.anchor,t),pi(r.head,t)))}return de(i,e.sel.primIndex)}function mi(e,t,i){return e.line==t.line?Ea(i.line,e.ch-t.ch+i.ch):Ea(i.line+(e.line-t.line),e.ch)}function gi(e,t,i){for(var n=[],r=Ea(e.first,0),a=r,o=0;o<t.length;o++){var s=t[o],l=mi(s.from,r,a),c=mi($a(s),r,a);if(r=s.to,a=c,"around"==i){var u=e.sel.ranges[o],d=Aa(u.head,u.anchor)<0;n[o]=new ue(d?c:l,d?l:c)}else n[o]=new ue(l,l)}return new ce(n,e.sel.primIndex)}function vi(e,t,i){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return i&&(n.update=function(t,i,n,r){t&&(this.from=fe(e,t)),i&&(this.to=fe(e,i)),n&&(this.text=n),void 0!==r&&(this.origin=r)}),xo(e,"beforeChange",e,n),e.cm&&xo(e.cm,"beforeChange",e.cm,n),n.canceled?null:{from:n.from,to:n.to,text:n.text,origin:n.origin}}function yi(e,t,i){if(e.cm){if(!e.cm.curOp)return Et(e.cm,yi)(e,t,i);if(e.cm.state.suppressEdits)return}if(!(br(e,"beforeChange")||e.cm&&br(e.cm,"beforeChange"))||(t=vi(e,t,!0))){var n=Ta&&!i&&en(e,t.from,t.to);if(n)for(var r=n.length-1;r>=0;--r)_i(e,{from:n[r].from,to:n[r].to,text:r?[""]:t.text});else _i(e,t)}}function _i(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Aa(t.from,t.to)){var i=fi(e,t);ir(e,t,i,e.cm?e.cm.curOp.id:NaN),xi(e,t,i,Qi(e,t));var n=[];$n(e,function(e,i){i||-1!=Sr(n,e.history)||(hr(e.history,t),n.push(e.history)),xi(e,t,null,Qi(e,t))})}}function bi(e,t,i){if(!e.cm||!e.cm.state.suppressEdits){for(var n,r=e.history,a=e.sel,o="undo"==t?r.done:r.undone,s="undo"==t?r.undone:r.done,l=0;l<o.length&&(n=o[l],i?!n.ranges||n.equals(e.sel):n.ranges);l++);if(l!=o.length){for(r.lastOrigin=r.lastSelOrigin=null;n=o.pop(),n.ranges;){if(ar(n,s),i&&!n.equals(e.sel))return void Te(e,n,{clearRedo:!1});a=n}var c=[];ar(a,s),s.push({changes:c,generation:r.generation}),r.generation=n.generation||++r.maxGeneration;for(var u=br(e,"beforeChange")||e.cm&&br(e.cm,"beforeChange"),l=n.changes.length-1;l>=0;--l){var d=n.changes[l];if(d.origin=t,u&&!vi(e,d,!1))return void(o.length=0);c.push(Jn(e,d));var h=l?fi(e,d):Tr(o);xi(e,d,h,Ji(e,d)),!l&&e.cm&&e.cm.scrollIntoView({from:d.from,to:$a(d)});var p=[];$n(e,function(e,t){t||-1!=Sr(p,e.history)||(hr(e.history,d),p.push(e.history)),xi(e,d,null,Ji(e,d))})}}}}function wi(e,t){if(0!=t&&(e.first+=t,e.sel=new ce(Er(e.sel.ranges,function(e){return new ue(Ea(e.anchor.line+t,e.anchor.ch),Ea(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Lt(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,n=i.viewFrom;n<i.viewTo;n++)Ot(e.cm,n,"gutter")}}function xi(e,t,i,n){if(e.cm&&!e.cm.curOp)return Et(e.cm,xi)(e,t,i,n);if(t.to.line<e.first)return void wi(e,t.text.length-1-(t.to.line-t.from.line));if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);wi(e,r),t={from:Ea(e.first,0),to:Ea(t.to.line+r,t.to.ch),text:[Tr(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:Ea(a,Hn(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Wn(e,t.from,t.to),i||(i=fi(e,t)),e.cm?ki(e.cm,t,n):Fn(e,t,n),Se(e,i,So)}}function ki(e,t,i){var n=e.doc,r=e.display,o=t.from,s=t.to,l=!1,c=o.line;e.options.lineWrapping||(c=Yn(dn(Hn(n,o.line))),n.iter(c,s.line+1,function(e){if(e==r.maxLine)return l=!0,!0})),n.sel.contains(t.from,t.to)>-1&&_r(e),Fn(n,t,i,a(e)),e.options.lineWrapping||(n.iter(c,o.line+t.text.length,function(e){var t=d(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),Re(e,400);var u=t.text.length-(s.line-o.line)-1;t.full?Lt(e):o.line!=s.line||1!=t.text.length||zn(e.doc,t)?Lt(e,o.line,s.line+1,u):Ot(e,o.line,"text");var h=br(e,"changes"),p=br(e,"change");if(p||h){var f={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};p&&gr(e,"change",e,f),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(f)}e.display.selForContextMenu=null}function Ci(e,t,i,n,r){if(n||(n=i),Aa(n,i)<0){var a=n;n=i,i=a}"string"==typeof t&&(t=qo(t)),yi(e,{from:i,to:n,text:t,origin:r})}function Ti(e,t){if(!yr(e,"scrollCursorIntoView")){var i=e.display,n=i.sizer.getBoundingClientRect(),r=null;if(t.top+n.top<0?r=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!va){var a=Pr("div","",null,"position: absolute; top: "+(t.top-i.viewOffset-Be(e.display))+"px; height: "+(t.bottom-t.top+qe(e)+i.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(r),e.display.lineSpace.removeChild(a)}}}function Si(e,t,i,n){null==n&&(n=0);for(var r=0;r<5;r++){var a=!1,o=ut(e,t),s=i&&i!=t?ut(e,i):o,l=Ai(e,Math.min(o.left,s.left),Math.min(o.top,s.top)-n,Math.max(o.left,s.left),Math.max(o.bottom,s.bottom)+n),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=l.scrollTop&&(Qt(e,l.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(a=!0)),null!=l.scrollLeft&&(Zt(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(a=!0)),!a)break}return o}function Ei(e,t,i,n,r){var a=Ai(e,t,i,n,r);null!=a.scrollTop&&Qt(e,a.scrollTop),null!=a.scrollLeft&&Zt(e,a.scrollLeft)}function Ai(e,t,i,n,r){var a=e.display,o=mt(e.display);i<0&&(i=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:a.scroller.scrollTop,l=We(e),c={};r-i>l&&(r=i+l);var u=e.doc.height+Ue(a),d=i<o,h=r>u-o;if(i<s)c.scrollTop=d?0:i;else if(r>s+l){var p=Math.min(i,(h?u:r)-l);p!=s&&(c.scrollTop=p)}var f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:a.scroller.scrollLeft,m=He(e)-(e.options.fixedGutter?a.gutters.offsetWidth:0),g=n-t>m;return g&&(n=t+m),t<10?c.scrollLeft=0:t<f?c.scrollLeft=Math.max(0,t-(g?0:10)):n>m+f-3&&(c.scrollLeft=n+(g?0:10)-m),c}function Ii(e,t,i){null==t&&null==i||Mi(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=i&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+i)}function Di(e){Mi(e);var t=e.getCursor(),i=t,n=t;e.options.lineWrapping||(i=t.ch?Ea(t.line,t.ch-1):t,n=Ea(t.line,t.ch+1)),e.curOp.scrollToPos={from:i,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Mi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=dt(e,t.from),n=dt(e,t.to),r=Ai(e,Math.min(i.left,n.left),Math.min(i.top,n.top)-t.margin,Math.max(i.right,n.right),Math.max(i.bottom,n.bottom)+t.margin);e.scrollTo(r.scrollLeft,r.scrollTop)}}function Li(e,t,i,n){var r,a=e.doc;null==i&&(i="add"),"smart"==i&&(a.mode.indent?r=Fe(e,t):i="prev");var o=e.options.tabSize,s=Hn(a,t),l=Io(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(n||/\S/.test(s.text)){if("smart"==i&&((c=a.mode.indent(r,s.text.slice(u.length),s.text))==To||c>150)){if(!n)return;i="prev"}}else c=0,i="not";"prev"==i?c=t>a.first?Io(Hn(a,t-1).text,null,o):0:"add"==i?c=l+e.options.indentUnit:"subtract"==i?c=l-e.options.indentUnit:"number"==typeof i&&(c=l+i),c=Math.max(0,c);var d="",h=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/o);p;--p)h+=o,d+="\t";if(h<c&&(d+=Cr(c-h)),d!=u)Ci(a,d,Ea(t,0),Ea(t,u.length),"+input");else for(var p=0;p<a.sel.ranges.length;p++){var f=a.sel.ranges[p];if(f.head.line==t&&f.head.ch<u.length){var h=Ea(t,u.length);we(a,p,new ue(h,h));break}}s.stateAfter=null}function Oi(e,t,i,n){var r=t,a=t;return"number"==typeof t?a=Hn(e,pe(e,t)):r=Yn(t),null==r?null:(n(a,r)&&e.cm&&Ot(e.cm,r,i),a)}function Ni(e,t){for(var i=e.doc.sel.ranges,n=[],r=0;r<i.length;r++){for(var a=t(i[r]);n.length&&Aa(a.from,Tr(n).to)<=0;){var o=n.pop();if(Aa(o.from,a.from)<0){a.from=o.from;break}}n.push(a)}St(e,function(){for(var t=n.length-1;t>=0;t--)Ci(e.doc,"",n[t].from,n[t].to,"+delete");Di(e)})}function Pi(e,t,i,n,r){function a(){var t=s+i;return t<e.first||t>=e.first+e.size?d=!1:(s=t,u=Hn(e,t))}function o(e){var t=(r?ra:aa)(u,l,i,!0);if(null==t){if(e||!a())return d=!1;l=r?(i<0?Qr:Xr)(u):i<0?u.text.length:0}else l=t;return!0}var s=t.line,l=t.ch,c=i,u=Hn(e,s),d=!0;if("char"==n)o();else if("column"==n)o(!0);else if("word"==n||"group"==n)for(var h=null,p="group"==n,f=e.cm&&e.cm.getHelper(t,"wordChars"),m=!0;!(i<0)||o(!m);m=!1){var g=u.text.charAt(l)||"\n",v=Lr(g,f)?"w":p&&"\n"==g?"n":!p||/\s/.test(g)?null:"p";if(!p||m||v||(v="s"),h&&h!=v){i<0&&(i=1,o());break}if(v&&(h=v),i>0&&!o(!m))break}var y=De(e,Ea(s,l),c,!0);return d||(y.hitSide=!0),y}function Ri(e,t,i,n){var r,a=e.doc,o=t.left;if("page"==n){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);r=t.top+i*(s-(i<0?1.5:.5)*mt(e.display))}else"line"==n&&(r=i>0?t.bottom+3:t.top-3);for(;;){var l=pt(e,o,r);if(!l.outside)break;if(i<0?r<=0:r>=a.height){l.hitSide=!0;break}r+=5*i}return l}function ji(t,i,n,r){e.defaults[t]=i,n&&(Ha[t]=r?function(e,t,i){i!=Wa&&n(e,t,i)}:n)}function zi(e){for(var t,i,n,r,a=e.split(/-(?!$)/),e=a[a.length-1],o=0;o<a.length-1;o++){var s=a[o];if(/^(cmd|meta|m)$/i.test(s))r=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))i=!0;else{if(!/^s(hift)$/i.test(s))throw new Error("Unrecognized modifier name: "+s);n=!0}}return t&&(e="Alt-"+e),i&&(e="Ctrl-"+e),r&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function Fi(e){return"string"==typeof e?eo[e]:e}function Bi(e,t,i,n,r){if(n&&n.shared)return Ui(e,t,i,n,r);if(e.cm&&!e.cm.curOp)return Et(e.cm,Bi)(e,t,i,n,r);var a=new oo(e,r),o=Aa(t,i);if(n&&Dr(n,a,!1),o>0||0==o&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=Pr("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(un(e,t.line,t,i,a)||t.line!=i.line&&un(e,i.line,t,i,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");Sa=!0}a.addToHistory&&ir(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,i.line+1,function(e){c&&a.collapsed&&!c.options.lineWrapping&&dn(e)==c.display.maxLine&&(s=!0),a.collapsed&&l!=t.line&&Gn(e,0),Yi(e,new Wi(a,l==t.line?t.ch:null,l==i.line?i.ch:null)),++l}),a.collapsed&&e.iter(t.line,i.line+1,function(t){mn(e,t)&&Gn(t,0)}),a.clearOnEnter&&bo(a,"beforeCursorEnter",function(){a.clear()}),a.readOnly&&(Ta=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++ao,a.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),a.collapsed)Lt(c,t.line,i.line+1);else if(a.className||a.title||a.startStyle||a.endStyle||a.css)for(var u=t.line;u<=i.line;u++)Ot(c,u,"text");a.atomic&&Ae(c.doc),gr(c,"markerAdded",c,a)}return a}function Ui(e,t,i,n,r){n=Dr(n),n.shared=!1;var a=[Bi(e,t,i,n,r)],o=a[0],s=n.widgetNode;return $n(e,function(e){s&&(n.widgetNode=s.cloneNode(!0)),a.push(Bi(e,fe(e,t),fe(e,i),n,r));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;o=Tr(a)}),new so(a,o)}function $i(e){return e.findMarks(Ea(e.first,0),e.clipPos(Ea(e.lastLine())),function(e){return e.parent})}function qi(e,t){for(var i=0;i<t.length;i++){var n=t[i],r=n.find(),a=e.clipPos(r.from),o=e.clipPos(r.to);if(Aa(a,o)){var s=Bi(e,a,o,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function Hi(e){for(var t=0;t<e.length;t++){var i=e[t],n=[i.primary.doc];$n(i.primary.doc,function(e){n.push(e)});for(var r=0;r<i.markers.length;r++){var a=i.markers[r];-1==Sr(n,a.doc)&&(a.parent=null,i.markers.splice(r--,1))}}}function Wi(e,t,i){this.marker=e,this.from=t,this.to=i}function Vi(e,t){if(e)for(var i=0;i<e.length;++i){var n=e[i];if(n.marker==t)return n}}function Gi(e,t){for(var i,n=0;n<e.length;++n)e[n]!=t&&(i||(i=[])).push(e[n]);return i}function Yi(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Ki(e,t,i){if(e)for(var n,r=0;r<e.length;++r){var a=e[r],o=a.marker,s=null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t);if(s||a.from==t&&"bookmark"==o.type&&(!i||!a.marker.insertLeft)){var l=null==a.to||(o.inclusiveRight?a.to>=t:a.to>t);(n||(n=[])).push(new Wi(o,a.from,l?null:a.to))}}return n}function Xi(e,t,i){if(e)for(var n,r=0;r<e.length;++r){var a=e[r],o=a.marker,s=null==a.to||(o.inclusiveRight?a.to>=t:a.to>t);if(s||a.from==t&&"bookmark"==o.type&&(!i||a.marker.insertLeft)){var l=null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t);(n||(n=[])).push(new Wi(o,l?null:a.from-t,null==a.to?null:a.to-t))}}return n}function Qi(e,t){if(t.full)return null;var i=ge(e,t.from.line)&&Hn(e,t.from.line).markedSpans,n=ge(e,t.to.line)&&Hn(e,t.to.line).markedSpans;if(!i&&!n)return null;var r=t.from.ch,a=t.to.ch,o=0==Aa(t.from,t.to),s=Ki(i,r,o),l=Xi(n,a,o),c=1==t.text.length,u=Tr(t.text).length+(c?r:0);if(s)for(var d=0;d<s.length;++d){var h=s[d];if(null==h.to){var p=Vi(l,h.marker);p?c&&(h.to=null==p.to?null:p.to+u):h.to=r}}if(l)for(var d=0;d<l.length;++d){var h=l[d];if(null!=h.to&&(h.to+=u),null==h.from){var p=Vi(s,h.marker);p||(h.from=u,c&&(s||(s=[])).push(h))}else h.from+=u,c&&(s||(s=[])).push(h)}s&&(s=Zi(s)),l&&l!=s&&(l=Zi(l));var f=[s];if(!c){var m,g=t.text.length-2;if(g>0&&s)for(var d=0;d<s.length;++d)null==s[d].to&&(m||(m=[])).push(new Wi(s[d].marker,null,null));for(var d=0;d<g;++d)f.push(m);f.push(l)}return f}function Zi(e){for(var t=0;t<e.length;++t){var i=e[t];null!=i.from&&i.from==i.to&&!1!==i.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Ji(e,t){var i=lr(e,t),n=Qi(e,t);if(!i)return n;if(!n)return i;for(var r=0;r<i.length;++r){var a=i[r],o=n[r];if(a&&o)e:for(var s=0;s<o.length;++s){for(var l=o[s],c=0;c<a.length;++c)if(a[c].marker==l.marker)continue e;a.push(l)}else o&&(i[r]=o)}return i}function en(e,t,i){var n=null;if(e.iter(t.line,i.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var i=e.markedSpans[t].marker;!i.readOnly||n&&-1!=Sr(n,i)||(n||(n=[])).push(i)}}),!n)return null;for(var r=[{from:t,to:i}],a=0;a<n.length;++a)for(var o=n[a],s=o.find(0),l=0;l<r.length;++l){var c=r[l];if(!(Aa(c.to,s.from)<0||Aa(c.from,s.to)>0)){var u=[l,1],d=Aa(c.from,s.from),h=Aa(c.to,s.to);(d<0||!o.inclusiveLeft&&!d)&&u.push({from:c.from,to:s.from}),(h>0||!o.inclusiveRight&&!h)&&u.push({from:s.to,to:c.to}),r.splice.apply(r,u),l+=u.length-1}}return r}function tn(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}}function nn(e,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}}function rn(e){return e.inclusiveLeft?-1:0}function an(e){return e.inclusiveRight?1:0}function on(e,t){var i=e.lines.length-t.lines.length;if(0!=i)return i;var n=e.find(),r=t.find(),a=Aa(n.from,r.from)||rn(e)-rn(t);if(a)return-a;var o=Aa(n.to,r.to)||an(e)-an(t);return o||t.id-e.id}function sn(e,t){var i,n=Sa&&e.markedSpans;if(n)for(var r,a=0;a<n.length;++a)r=n[a],r.marker.collapsed&&null==(t?r.from:r.to)&&(!i||on(i,r.marker)<0)&&(i=r.marker);return i}function ln(e){return sn(e,!0)}function cn(e){return sn(e,!1)}function un(e,t,i,n,r){var a=Hn(e,t),o=Sa&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var l=o[s];if(l.marker.collapsed){var c=l.marker.find(0),u=Aa(c.from,i)||rn(l.marker)-rn(r),d=Aa(c.to,n)||an(l.marker)-an(r);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(Aa(c.to,i)>0||l.marker.inclusiveRight&&r.inclusiveLeft)||u>=0&&(Aa(c.from,n)<0||l.marker.inclusiveLeft&&r.inclusiveRight)))return!0}}}function dn(e){for(var t;t=ln(e);)e=t.find(-1,!0).line;return e}function hn(e){for(var t,i;t=cn(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function pn(e,t){var i=Hn(e,t),n=dn(i);return i==n?t:Yn(n)}function fn(e,t){if(t>e.lastLine())return t;var i,n=Hn(e,t);if(!mn(e,n))return t;for(;i=cn(n);)n=i.find(1,!0).line;return Yn(n)+1}function mn(e,t){var i=Sa&&t.markedSpans;if(i)for(var n,r=0;r<i.length;++r)if(n=i[r],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&gn(e,t,n))return!0}}function gn(e,t,i){if(null==i.to){var n=i.marker.find(1,!0);return gn(e,n.line,Vi(n.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var r,a=0;a<t.markedSpans.length;++a)if(r=t.markedSpans[a],r.marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(null==r.to||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&gn(e,t,r))return!0}function vn(e,t,i){Xn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ii(e,null,i)}function yn(e){if(null!=e.height)return e.height;if(!Ro(document.body,e.node)){var t="position: relative;";e.coverGutter&&(t+="margin-left: -"+e.cm.display.gutters.offsetWidth+"px;"),e.noHScroll&&(t+="width: "+e.cm.display.wrapper.clientWidth+"px;"),jr(e.cm.display.measure,Pr("div",[e.node],null,t))}return e.height=e.node.offsetHeight}function _n(e,t,i,n){var r=new lo(e,i,n);return r.noHScroll&&(e.display.alignWidgets=!0),Oi(e.doc,t,"widget",function(t){var i=t.widgets||(t.widgets=[]);if(null==r.insertAt?i.push(r):i.splice(Math.min(i.length-1,Math.max(0,r.insertAt)),0,r),r.line=t,!mn(e.doc,t)){var n=Xn(t)<e.doc.scrollTop;Gn(t,t.height+yn(r)),n&&Ii(e,null,r.height),e.curOp.forceUpdate=!0}return!0}),r}function bn(e,t,i,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),tn(e),nn(e,i);var r=n?n(e):1;r!=e.height&&Gn(e,r)}function wn(e){e.parent=null,tn(e)}function xn(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var n=i[1]?"bgClass":"textClass";null==t[n]?t[n]=i[2]:new RegExp("(?:^|s)"+i[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+i[2])}return e}function kn(t,i){if(t.blankLine)return t.blankLine(i);if(t.innerMode){var n=e.innerMode(t,i);return n.mode.blankLine?n.mode.blankLine(n.state):void 0}}function Cn(t,i,n,r){for(var a=0;a<10;a++){r&&(r[0]=e.innerMode(t,n).mode);var o=t.token(i,n);if(i.pos>i.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}function Tn(e,t,i,n){function r(e){return{start:d.start,end:d.pos,string:d.current(),type:a||null,state:e?Qa(o.mode,u):u}}var a,o=e.doc,s=o.mode;t=fe(o,t);var l,c=Hn(o,t.line),u=Fe(e,t.line,i),d=new ro(c.text,e.options.tabSize);for(n&&(l=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,a=Cn(s,d,u),n&&l.push(r(!0));return n?l:r()}function Sn(e,t,i,n,r,a,o){var s=i.flattenSpans;null==s&&(s=e.options.flattenSpans);var l,c=0,u=null,d=new ro(t,e.options.tabSize),h=e.options.addModeClass&&[null];for(""==t&&xn(kn(i,n),a);!d.eol();){if(d.pos>e.options.maxHighlightLength?(s=!1,o&&In(e,t,n,d.pos),d.pos=t.length,l=null):l=xn(Cn(i,d,n,h),a),h){var p=h[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;c<d.start;)c=Math.min(d.start,c+5e4),r(c,u);u=l}d.start=d.pos}for(;c<d.pos;){var f=Math.min(d.pos,c+5e4);r(f,u),c=f}}function En(e,t,i,n){var r=[e.state.modeGen],a={};Sn(e,t.text,e.doc.mode,i,function(e,t){r.push(e,t)},a,n);for(var o=0;o<e.state.overlays.length;++o){var s=e.state.overlays[o],l=1,c=0;Sn(e,t.text,s.mode,!0,function(e,t){for(var i=l;c<e;){var n=r[l];n>e&&r.splice(l,1,e,r[l+1],n),l+=2,c=Math.min(e,n)}if(t)if(s.opaque)r.splice(i,l-i,e,"cm-overlay "+t),l=i+2;else for(;i<l;i+=2){var a=r[i+1];r[i+1]=(a?a+" ":"")+"cm-overlay "+t}},a)}return{styles:r,classes:a.bgClass||a.textClass?a:null}}function An(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=En(e,t,t.stateAfter=Fe(e,Yn(t)));t.styles=n.styles,n.classes?t.styleClasses=n.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.frontier&&e.doc.frontier++}return t.styles}function In(e,t,i,n){var r=e.doc.mode,a=new ro(t,e.options.tabSize);for(a.start=a.pos=n||0,""==t&&kn(r,i);!a.eol()&&a.pos<=e.options.maxHighlightLength;)Cn(r,a,i),a.start=a.pos}function Dn(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ho:uo;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Mn(e,t){var i=Pr("span",null,null,da?"padding-right: .1px":null),n={pre:Pr("pre",[i]),content:i,col:0,pos:0,cm:e};t.measure={};for(var r=0;r<=(t.rest?t.rest.length:0);r++){var a,o=r?t.rest[r-1]:t.line;n.pos=0,n.addToken=On,(ca||da)&&e.getOption("lineWrapping")&&(n.addToken=Nn(n.addToken)),Wr(e.display.measure)&&(a=Qn(o))&&(n.addToken=Pn(n.addToken,a)),n.map=[];jn(o,n,An(e,o,t!=e.display.externalMeasured&&Yn(o))),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=Br(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=Br(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(Hr(e.display.measure))),0==r?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return da&&/\bcm-tab\b/.test(n.content.lastChild.className)&&(n.content.className="cm-tab-wrap-hack"),xo(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=Br(n.pre.className,n.textClass||"")),n}function Ln(e){var t=Pr("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function On(e,t,i,n,r,a,o){if(t){var s=e.cm.options.specialChars,l=!1;if(s.test(t))for(var c=document.createDocumentFragment(),u=0;;){s.lastIndex=u;var d=s.exec(t),h=d?d.index-u:t.length-u;if(h){var p=document.createTextNode(t.slice(u,u+h));ca&&ua<9?c.appendChild(Pr("span",[p])):c.appendChild(p),e.map.push(e.pos,e.pos+h,p),e.col+=h,e.pos+=h}if(!d)break;if(u+=h+1,"\t"==d[0]){var f=e.cm.options.tabSize,m=f-e.col%f,p=c.appendChild(Pr("span",Cr(m),"cm-tab"));p.setAttribute("role","presentation"),p.setAttribute("cm-text","\t"),e.col+=m}else{var p=e.cm.options.specialCharPlaceholder(d[0]);p.setAttribute("cm-text",d[0]),ca&&ua<9?c.appendChild(Pr("span",[p])):c.appendChild(p),e.col+=1}e.map.push(e.pos,e.pos+1,p),e.pos++}else{e.col+=t.length;var c=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,c),ca&&ua<9&&(l=!0),e.pos+=t.length}if(i||n||r||l||o){var g=i||"";n&&(g+=n),r&&(g+=r);var v=Pr("span",[c],g,o);return a&&(v.title=a),e.content.appendChild(v)}e.content.appendChild(c)}}function Nn(e){function t(e){for(var t=" ",i=0;i<e.length-2;++i)t+=i%2?" ":" ";return t+=" "}return function(i,n,r,a,o,s){e(i,n.replace(/ {3,}/g,t),r,a,o,s)}}function Pn(e,t){return function(i,n,r,a,o,s){r=r?r+" cm-force-border":"cm-force-border";for(var l=i.pos,c=l+n.length;;){for(var u=0;u<t.length;u++){var d=t[u];if(d.to>l&&d.from<=l)break}if(d.to>=c)return e(i,n,r,a,o,s);e(i,n.slice(0,d.to-l),r,a,null,s),a=null,n=n.slice(d.to-l),l=d.to}}}function Rn(e,t,i,n){var r=!n&&i.widgetNode;r&&e.map.push(e.pos,e.pos+t,r),!n&&e.cm.display.input.needsContentAttribute&&(r||(r=e.content.appendChild(document.createElement("span"))),r.setAttribute("cm-marker",i.id)),r&&(e.cm.display.input.setUneditable(r),e.content.appendChild(r)),e.pos+=t}function jn(e,t,i){var n=e.markedSpans,r=e.text,a=0;if(n)for(var o,s,l,c,u,d,h,p=r.length,f=0,m=1,g="",v=0;;){if(v==f){l=c=u=d=s="",h=null,v=1/0;for(var y=[],_=0;_<n.length;++_){var b=n[_],w=b.marker;b.from<=f&&(null==b.to||b.to>f)?(null!=b.to&&v>b.to&&(v=b.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=w.css),w.startStyle&&b.from==f&&(u+=" "+w.startStyle),w.endStyle&&b.to==v&&(c+=" "+w.endStyle),w.title&&!d&&(d=w.title),w.collapsed&&(!h||on(h.marker,w)<0)&&(h=b)):b.from>f&&v>b.from&&(v=b.from),"bookmark"==w.type&&b.from==f&&w.widgetNode&&y.push(w)}if(h&&(h.from||0)==f&&(Rn(t,(null==h.to?p+1:h.to)-f,h.marker,null==h.from),null==h.to))return;if(!h&&y.length)for(var _=0;_<y.length;++_)Rn(t,0,y[_])}if(f>=p)break;for(var x=Math.min(p,v);;){if(g){var k=f+g.length;if(!h){var C=k>x?g.slice(0,x-f):g;t.addToken(t,C,o?o+l:l,u,f+C.length==v?c:"",d,s)}if(k>=x){g=g.slice(x-f),f=x;break}f=k,u=""}g=r.slice(a,a=i[m++]),o=Dn(i[m++],t.cm.options)}}else for(var m=1;m<i.length;m+=2)t.addToken(t,r.slice(a,a=i[m]),Dn(i[m+1],t.cm.options))}function zn(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Tr(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Fn(e,t,i,n){function r(e){return i?i[e]:null}function a(e,i,r){bn(e,i,r,n),gr(e,"change",e,t)}function o(e,t){for(var i=e,a=[];i<t;++i)a.push(new co(c[i],r(i),n));return a}var s=t.from,l=t.to,c=t.text,u=Hn(e,s.line),d=Hn(e,l.line),h=Tr(c),p=r(c.length-1),f=l.line-s.line;if(t.full)e.insert(0,o(0,c.length)),e.remove(c.length,e.size-c.length);else if(zn(e,t)){var m=o(0,c.length-1);a(d,d.text,p),f&&e.remove(s.line,f),m.length&&e.insert(s.line,m)}else if(u==d)if(1==c.length)a(u,u.text.slice(0,s.ch)+h+u.text.slice(l.ch),p);else{var m=o(1,c.length-1);m.push(new co(h+u.text.slice(l.ch),p,n)),a(u,u.text.slice(0,s.ch)+c[0],r(0)),e.insert(s.line+1,m)}else if(1==c.length)a(u,u.text.slice(0,s.ch)+c[0]+d.text.slice(l.ch),r(0)),e.remove(s.line+1,f);else{a(u,u.text.slice(0,s.ch)+c[0],r(0)),a(d,h+d.text.slice(l.ch),p);var m=o(1,c.length-1);f>1&&e.remove(s.line+1,f-1),e.insert(s.line+1,m)}gr(e,"change",e,t)}function Bn(e){this.lines=e,this.parent=null;for(var t=0,i=0;t<e.length;++t)e[t].parent=this,i+=e[t].height;this.height=i}function Un(e){this.children=e;for(var t=0,i=0,n=0;n<e.length;++n){var r=e[n];t+=r.chunkSize(),i+=r.height,r.parent=this
|
||
}this.size=t,this.height=i,this.parent=null}function $n(e,t,i){function n(e,r,a){if(e.linked)for(var o=0;o<e.linked.length;++o){var s=e.linked[o];if(s.doc!=r){var l=a&&s.sharedHist;i&&!l||(t(s.doc,l),n(s.doc,e,l))}}}n(e,null,!0)}function qn(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,o(e),i(e),e.options.lineWrapping||h(e),e.options.mode=t.modeOption,Lt(e)}function Hn(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var n=0;;++n){var r=i.children[n],a=r.chunkSize();if(t<a){i=r;break}t-=a}return i.lines[t]}function Wn(e,t,i){var n=[],r=t.line;return e.iter(t.line,i.line+1,function(e){var a=e.text;r==i.line&&(a=a.slice(0,i.ch)),r==t.line&&(a=a.slice(t.ch)),n.push(a),++r}),n}function Vn(e,t,i){var n=[];return e.iter(t,i,function(e){n.push(e.text)}),n}function Gn(e,t){var i=t-e.height;if(i)for(var n=e;n;n=n.parent)n.height+=i}function Yn(e){if(null==e.parent)return null;for(var t=e.parent,i=Sr(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var r=0;n.children[r]!=t;++r)i+=n.children[r].chunkSize();return i+t.first}function Kn(e,t){var i=e.first;e:do{for(var n=0;n<e.children.length;++n){var r=e.children[n],a=r.height;if(t<a){e=r;continue e}t-=a,i+=r.chunkSize()}return i}while(!e.lines);for(var n=0;n<e.lines.length;++n){var o=e.lines[n],s=o.height;if(t<s)break;t-=s}return i+n}function Xn(e){e=dn(e);for(var t=0,i=e.parent,n=0;n<i.lines.length;++n){var r=i.lines[n];if(r==e)break;t+=r.height}for(var a=i.parent;a;i=a,a=i.parent)for(var n=0;n<a.children.length;++n){var o=a.children[n];if(o==i)break;t+=o.height}return t}function Qn(e){var t=e.order;return null==t&&(t=e.order=Ko(e.text)),t}function Zn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Jn(e,t){var i={from:G(t.from),to:$a(t),text:Wn(e,t.from,t.to)};return or(e,i,t.from.line,t.to.line+1),$n(e,function(e){or(e,i,t.from.line,t.to.line+1)},!0),i}function er(e){for(;e.length;){if(!Tr(e).ranges)break;e.pop()}}function tr(e,t){return t?(er(e.done),Tr(e.done)):e.done.length&&!Tr(e.done).ranges?Tr(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Tr(e.done)):void 0}function ir(e,t,i,n){var r=e.history;r.undone.length=0;var a,o=+new Date;if((r.lastOp==n||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&r.lastModTime>o-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(a=tr(r,r.lastOp==n))){var s=Tr(a.changes);0==Aa(t.from,t.to)&&0==Aa(t.from,s.to)?s.to=$a(t):a.changes.push(Jn(e,t))}else{var l=Tr(r.done);for(l&&l.ranges||ar(e.sel,r.done),a={changes:[Jn(e,t)],generation:r.generation},r.done.push(a);r.done.length>r.undoDepth;)r.done.shift(),r.done[0].ranges||r.done.shift()}r.done.push(i),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=o,r.lastOp=r.lastSelOp=n,r.lastOrigin=r.lastSelOrigin=t.origin,s||xo(e,"historyAdded")}function nr(e,t,i,n){var r=t.charAt(0);return"*"==r||"+"==r&&i.ranges.length==n.ranges.length&&i.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function rr(e,t,i,n){var r=e.history,a=n&&n.origin;i==r.lastSelOp||a&&r.lastSelOrigin==a&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==a||nr(e,a,Tr(r.done),t))?r.done[r.done.length-1]=t:ar(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=a,r.lastSelOp=i,n&&!1!==n.clearRedo&&er(r.undone)}function ar(e,t){var i=Tr(t);i&&i.ranges&&i.equals(e)||t.push(e)}function or(e,t,i,n){var r=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,n),function(i){i.markedSpans&&((r||(r=t["spans_"+e.id]={}))[a]=i.markedSpans),++a})}function sr(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function lr(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var n=0,r=[];n<t.text.length;++n)r.push(sr(i[n]));return r}function cr(e,t,i){for(var n=0,r=[];n<e.length;++n){var a=e[n];if(a.ranges)r.push(i?ce.prototype.deepCopy.call(a):a);else{var o=a.changes,s=[];r.push({changes:s});for(var l=0;l<o.length;++l){var c,u=o[l];if(s.push({from:u.from,to:u.to,text:u.text}),t)for(var d in u)(c=d.match(/^spans_(\d+)$/))&&Sr(t,Number(c[1]))>-1&&(Tr(s)[d]=u[d],delete u[d])}}}return r}function ur(e,t,i,n){i<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function dr(e,t,i,n){for(var r=0;r<e.length;++r){var a=e[r],o=!0;if(a.ranges){a.copied||(a=e[r]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)ur(a.ranges[s].anchor,t,i,n),ur(a.ranges[s].head,t,i,n)}else{for(var s=0;s<a.changes.length;++s){var l=a.changes[s];if(i<l.from.line)l.from=Ea(l.from.line+n,l.from.ch),l.to=Ea(l.to.line+n,l.to.ch);else if(t<=l.to.line){o=!1;break}}o||(e.splice(0,r+1),r=0)}}}function hr(e,t){var i=t.from.line,n=t.to.line,r=t.text.length-(n-i)-1;dr(e.done,i,n,r),dr(e.undone,i,n,r)}function pr(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function fr(e){return e.target||e.srcElement}function mr(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),ba&&e.ctrlKey&&1==t&&(t=3),t}function gr(e,t){var i=e._handlers&&e._handlers[t];if(i){var n,r=Array.prototype.slice.call(arguments,2);Na?n=Na.delayedCallbacks:ko?n=ko:(n=ko=[],setTimeout(vr,0));for(var a=0;a<i.length;++a)n.push(function(e){return function(){e.apply(null,r)}}(i[a]))}}function vr(){var e=ko;ko=null;for(var t=0;t<e.length;++t)e[t]()}function yr(e,t,i){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),xo(e,i||t.type,e,t),pr(t)||t.codemirrorIgnore}function _r(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)-1==Sr(i,t[n])&&i.push(t[n])}function br(e,t){var i=e._handlers&&e._handlers[t];return i&&i.length>0}function wr(e){e.prototype.on=function(e,t){bo(this,e,t)},e.prototype.off=function(e,t){wo(this,e,t)}}function xr(){this.id=null}function kr(e,t,i){for(var n=0,r=0;;){var a=e.indexOf("\t",n);-1==a&&(a=e.length);var o=a-n;if(a==e.length||r+o>=t)return n+Math.min(o,t-r);if(r+=a-n,r+=i-r%i,n=a+1,r>=t)return n}}function Cr(e){for(;Do.length<=e;)Do.push(Tr(Do)+" ");return Do[e]}function Tr(e){return e[e.length-1]}function Sr(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}function Er(e,t){for(var i=[],n=0;n<e.length;n++)i[n]=t(e[n],n);return i}function Ar(){}function Ir(e,t){var i;return Object.create?i=Object.create(e):(Ar.prototype=e,i=new Ar),t&&Dr(t,i),i}function Dr(e,t,i){t||(t={});for(var n in e)!e.hasOwnProperty(n)||!1===i&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function Mr(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Lr(e,t){return t?!!(t.source.indexOf("\\w")>-1&&No(e))||t.test(e):No(e)}function Or(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Nr(e){return e.charCodeAt(0)>=768&&Po.test(e)}function Pr(e,t,i,n){var r=document.createElement(e);if(i&&(r.className=i),n&&(r.style.cssText=n),"string"==typeof t)r.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)r.appendChild(t[a]);return r}function Rr(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function jr(e,t){return Rr(e).appendChild(t)}function zr(){return document.activeElement}function Fr(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Br(e,t){for(var i=e.split(" "),n=0;n<i.length;n++)i[n]&&!Fr(i[n]).test(t)&&(t+=" "+i[n]);return t}function Ur(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),i=0;i<t.length;i++){var n=t[i].CodeMirror;n&&e(n)}}function $r(){Uo||(qr(),Uo=!0)}function qr(){var e;bo(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Ur(Bt)},100))}),bo(window,"blur",function(){Ur(ui)})}function Hr(e){if(null==jo){var t=Pr("span","");jr(e,Pr("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(jo=t.offsetWidth<=1&&t.offsetHeight>2&&!(ca&&ua<8))}var i=jo?Pr("span",""):Pr("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Wr(e){if(null!=zo)return zo;var t=jr(e,document.createTextNode("AخA")),i=Lo(t,0,1).getBoundingClientRect();if(!i||i.left==i.right)return!1;var n=Lo(t,1,2).getBoundingClientRect();return zo=n.right-i.right<3}function Vr(e){if(null!=Vo)return Vo;var t=jr(e,Pr("span","x")),i=t.getBoundingClientRect(),n=Lo(t,0,1).getBoundingClientRect();return Vo=Math.abs(i.left-n.left)>1}function Gr(e,t,i,n){if(!e)return n(t,i,"ltr");for(var r=!1,a=0;a<e.length;++a){var o=e[a];(o.from<i&&o.to>t||t==i&&o.to==t)&&(n(Math.max(o.from,t),Math.min(o.to,i),1==o.level?"rtl":"ltr"),r=!0)}r||n(t,i,"ltr")}function Yr(e){return e.level%2?e.to:e.from}function Kr(e){return e.level%2?e.from:e.to}function Xr(e){var t=Qn(e);return t?Yr(t[0]):0}function Qr(e){var t=Qn(e);return t?Kr(Tr(t)):e.text.length}function Zr(e,t){var i=Hn(e.doc,t),n=dn(i);n!=i&&(t=Yn(n));var r=Qn(n),a=r?r[0].level%2?Qr(n):Xr(n):0;return Ea(t,a)}function Jr(e,t){for(var i,n=Hn(e.doc,t);i=cn(n);)n=i.find(1,!0).line,t=null;var r=Qn(n),a=r?r[0].level%2?Xr(n):Qr(n):n.text.length;return Ea(null==t?Yn(n):t,a)}function ea(e,t){var i=Zr(e,t.line),n=Hn(e.doc,i.line),r=Qn(n);if(!r||0==r[0].level){var a=Math.max(0,n.text.search(/\S/)),o=t.line==i.line&&t.ch<=a&&t.ch;return Ea(i.line,o?0:a)}return i}function ta(e,t,i){var n=e[0].level;return t==n||i!=n&&t<i}function ia(e,t){Yo=null;for(var i,n=0;n<e.length;++n){var r=e[n];if(r.from<t&&r.to>t)return n;if(r.from==t||r.to==t){if(null!=i)return ta(e,r.level,e[i].level)?(r.from!=r.to&&(Yo=i),n):(r.from!=r.to&&(Yo=n),i);i=n}}return i}function na(e,t,i,n){if(!n)return t+i;do{t+=i}while(t>0&&Nr(e.text.charAt(t)));return t}function ra(e,t,i,n){var r=Qn(e);if(!r)return aa(e,t,i,n);for(var a=ia(r,t),o=r[a],s=na(e,t,o.level%2?-i:i,n);;){if(s>o.from&&s<o.to)return s;if(s==o.from||s==o.to)return ia(r,s)==a?s:(o=r[a+=i],i>0==o.level%2?o.to:o.from);if(!(o=r[a+=i]))return null;s=i>0==o.level%2?na(e,o.to,-1,n):na(e,o.from,1,n)}}function aa(e,t,i,n){var r=t+i;if(n)for(;r>0&&Nr(e.text.charAt(r));)r+=i;return r<0||r>e.text.length?null:r}var oa=/gecko\/\d/i.test(navigator.userAgent),sa=/MSIE \d/.test(navigator.userAgent),la=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),ca=sa||la,ua=ca&&(sa?document.documentMode||6:la[1]),da=/WebKit\//.test(navigator.userAgent),ha=da&&/Qt\/\d+\.\d+/.test(navigator.userAgent),pa=/Chrome\//.test(navigator.userAgent),fa=/Opera\//.test(navigator.userAgent),ma=/Apple Computer/.test(navigator.vendor),ga=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),va=/PhantomJS/.test(navigator.userAgent),ya=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),_a=ya||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ba=ya||/Mac/.test(navigator.platform),wa=/win/i.test(navigator.platform),xa=fa&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);xa&&(xa=Number(xa[1])),xa&&xa>=15&&(fa=!1,da=!0);var ka=ba&&(ha||fa&&(null==xa||xa<12.11)),Ca=oa||ca&&ua>=9,Ta=!1,Sa=!1;m.prototype=Dr({update:function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var r=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+r)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(i?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+a+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedOverlay&&e.clientHeight>0&&(0==n&&this.overlayHack(),this.checkedOverlay=!0),{right:i?n:0,bottom:t?n:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e)},overlayHack:function(){var e=ba&&!ga?"12px":"18px";this.horiz.style.minHeight=this.vert.style.minWidth=e;var t=this,i=function(e){fr(e)!=t.vert&&fr(e)!=t.horiz&&Et(t.cm,qt)(e)};bo(this.vert,"mousedown",i),bo(this.horiz,"mousedown",i)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Dr({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={native:m,null:g},T.prototype.signal=function(e,t){br(e,t)&&this.events.push(arguments)},T.prototype.finish=function(){for(var e=0;e<this.events.length;e++)xo.apply(null,this.events[e])};var Ea=e.Pos=function(e,t){if(!(this instanceof Ea))return new Ea(e,t);this.line=e,this.ch=t},Aa=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch},Ia=null;te.prototype=Dr({init:function(e){function t(e){if(n.somethingSelected())Ia=n.getSelections(),i.inaccurateSelection&&(i.prevInput="",i.inaccurateSelection=!1,a.value=Ia.join("\n"),Mo(a));else{var t=J(n);Ia=t.text,"cut"==e.type?n.setSelections(t.ranges,null,So):(i.prevInput="",a.value=t.text.join("\n"),Mo(a))}"cut"==e.type&&(n.state.cutIncoming=!0)}var i=this,n=this.cm,r=this.wrapper=ie(),a=this.textarea=r.firstChild;e.wrapper.insertBefore(r,e.wrapper.firstChild),ya&&(a.style.width="0px"),bo(a,"input",function(){ca&&ua>=9&&i.hasSelection&&(i.hasSelection=null),i.poll()}),bo(a,"paste",function(){if(da&&!n.state.fakedLastChar&&!(new Date-n.state.lastMiddleDown<200)){var e=a.selectionStart,t=a.selectionEnd;a.value+="$",a.selectionEnd=t,a.selectionStart=e,n.state.fakedLastChar=!0}n.state.pasteIncoming=!0,i.fastPoll()}),bo(a,"cut",t),bo(a,"copy",t),bo(e.scroller,"paste",function(t){Ut(e,t)||(n.state.pasteIncoming=!0,i.focus())}),bo(e.lineSpace,"selectstart",function(t){Ut(e,t)||vo(t)})},prepareSelection:function(){var e=this.cm,t=e.display,i=e.doc,n=Le(e);if(e.options.moveInputWithCursor){var r=ut(e,i.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),o=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+o.top-a.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+o.left-a.left))}return n},showSelection:function(e){var t=this.cm,i=t.display;jr(i.cursorDiv,e.cursors),jr(i.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,i,n=this.cm,r=n.doc;if(n.somethingSelected()){this.prevInput="";var a=r.sel.primary();t=Wo&&(a.to().line-a.from().line>100||(i=n.getSelection()).length>1e3);var o=t?"-":i||n.getSelection();this.textarea.value=o,n.state.focused&&Mo(this.textarea),ca&&ua>=9&&(this.hasSelection=o)}else e||(this.prevInput=this.textarea.value="",ca&&ua>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!_a||zr()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){i.poll()||t?(i.pollingFast=!1,i.slowPoll()):(t=!0,i.polling.set(60,e))}var t=!1,i=this;i.pollingFast=!0,i.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,i=this.prevInput;if(!e.state.focused||Ho(t)&&!i||Q(e)||e.options.disableInput||e.state.keySeq)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var n=t.value;if(n==i&&!e.somethingSelected())return!1;if(ca&&ua>=9&&this.hasSelection===n||ba&&/[\uf700-\uf7ff]/.test(n))return e.display.input.reset(),!1;8203!=n.charCodeAt(0)||e.doc.sel!=e.display.selForContextMenu||i||(i="");for(var r=0,a=Math.min(i.length,n.length);r<a&&i.charCodeAt(r)==n.charCodeAt(r);)++r;var o=this;return St(e,function(){Z(e,n.slice(r),i.length-r),n.length>1e3||n.indexOf("\n")>-1?t.value=o.prevInput="":o.prevInput=n}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){ca&&ua>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=o.selectionStart){var e=r.somethingSelected(),t=o.value=""+(e?o.value:"");n.prevInput=e?"":"",o.selectionStart=1,o.selectionEnd=t.length,a.selForContextMenu=r.doc.sel}}function i(){if(n.contextMenuPending=!1,n.wrapper.style.position="relative",o.style.cssText=c,ca&&ua<9&&a.scrollbars.setScrollTop(a.scroller.scrollTop=l),null!=o.selectionStart){(!ca||ca&&ua<9)&&t();var e=0,i=function(){a.selForContextMenu==r.doc.sel&&0==o.selectionStart?Et(r,Ja.selectAll)(r):e++<10?a.detectingSelectAll=setTimeout(i,500):a.input.reset()};a.detectingSelectAll=setTimeout(i,200)}}var n=this,r=n.cm,a=r.display,o=n.textarea,s=$t(r,e),l=a.scroller.scrollTop;if(s&&!fa){r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(s)&&Et(r,Te)(r.doc,he(s),So);var c=o.style.cssText;if(n.wrapper.style.position="absolute",o.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(ca?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",da)var u=window.scrollY;if(a.input.focus(),da&&window.scrollTo(null,u),a.input.reset(),r.somethingSelected()||(o.value=n.prevInput=" "),n.contextMenuPending=!0,a.selForContextMenu=r.doc.sel,clearTimeout(a.detectingSelectAll),ca&&ua>=9&&t(),Ca){_o(e);var d=function(){wo(window,"mouseup",d),setTimeout(i,20)};bo(window,"mouseup",d)}else setTimeout(i,50)}},setUneditable:Ar,needsContentAttribute:!1},te.prototype),ne.prototype=Dr({init:function(e){function t(e){if(n.somethingSelected())Ia=n.getSelections(),"cut"==e.type&&n.replaceSelection("",null,"cut");else{var t=J(n);Ia=t.text,"cut"==e.type&&n.operation(function(){n.setSelections(t.ranges,0,So),n.replaceSelection("",null,"cut")})}if(e.clipboardData&&!ya)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Ia.join("\n"));else{var i=ie(),r=i.firstChild;n.display.lineSpace.insertBefore(i,n.display.lineSpace.firstChild),r.value=Ia.join("\n");var a=document.activeElement;Mo(r),setTimeout(function(){n.display.lineSpace.removeChild(i),a.focus()},50)}}var i=this,n=i.cm,r=i.div=e.lineDiv;r.contentEditable="true",ee(r),bo(r,"paste",function(e){var t=e.clipboardData&&e.clipboardData.getData("text/plain");t&&(e.preventDefault(),n.replaceSelection(t,null,"paste"))}),bo(r,"compositionstart",function(e){var t=e.data;if(i.composing={sel:n.doc.sel,data:t,startData:t},t){var r=n.doc.sel.primary(),a=n.getLine(r.head.line),o=a.indexOf(t,Math.max(0,r.head.ch-t.length));o>-1&&o<=r.head.ch&&(i.composing.sel=he(Ea(r.head.line,o),Ea(r.head.line,o+t.length)))}}),bo(r,"compositionupdate",function(e){i.composing.data=e.data}),bo(r,"compositionend",function(e){var t=i.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||i.applyComposition(t),i.composing==t&&(i.composing=null)},50))}),bo(r,"touchstart",function(){i.forceCompositionEnd()}),bo(r,"input",function(){i.composing||i.pollContent()||St(i.cm,function(){Lt(n)})}),bo(r,"copy",t),bo(r,"cut",t)},prepareSelection:function(){var e=Le(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),i=oe(this.cm,e.anchorNode,e.anchorOffset),n=oe(this.cm,e.focusNode,e.focusOffset);if(!i||i.bad||!n||n.bad||0!=Aa(K(i,n),t.from())||0!=Aa(Y(i,n),t.to())){var r=re(this.cm,t.from()),a=re(this.cm,t.to());if(r||a){var o=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(r){if(!a){var l=o[o.length-1].measure,c=l.maps?l.maps[l.maps.length-1]:l.map;a={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else r={node:o[0].measure.map[2],offset:0};try{var u=Lo(r.node,r.offset,a.offset,a.node)}catch(e){}u&&(e.removeAllRanges(),e.addRange(u),s&&null==e.anchorNode&&e.addRange(s)),this.rememberSelection()}}},showMultipleSelections:function(e){jr(this.cm.display.cursorDiv,e.cursors),jr(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Ro(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():St(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},pollSelection:function(){if(!this.composing){var e=window.getSelection(),t=this.cm;if(e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset){this.rememberSelection();var i=oe(t,e.anchorNode,e.anchorOffset),n=oe(t,e.focusNode,e.focusOffset);i&&n&&St(t,function(){Te(t.doc,he(i,n),So),(i.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},pollContent:function(){var e=this.cm,t=e.display,i=e.doc.sel.primary(),n=i.from(),r=i.to();if(n.line<t.viewFrom||r.line>t.viewTo-1)return!1;var a;if(n.line==t.viewFrom||0==(a=Pt(e,n.line)))var o=Yn(t.view[0].line),s=t.view[0].node;else var o=Yn(t.view[a].line),s=t.view[a-1].node.nextSibling;var l=Pt(e,r.line);if(l==t.view.length-1)var c=t.viewTo-1,u=t.view[l].node;else var c=Yn(t.view[l+1].line)-1,u=t.view[l+1].node.previousSibling;for(var d=qo(le(e,s,u,o,c)),h=Wn(e.doc,Ea(o,0),Ea(c,Hn(e.doc,c).text.length));d.length>1&&h.length>1;)if(Tr(d)==Tr(h))d.pop(),h.pop(),c--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),o++}for(var p=0,f=0,m=d[0],g=h[0],v=Math.min(m.length,g.length);p<v&&m.charCodeAt(p)==g.charCodeAt(p);)++p;for(var y=Tr(d),_=Tr(h),b=Math.min(y.length-(1==d.length?p:0),_.length-(1==h.length?p:0));f<b&&y.charCodeAt(y.length-f-1)==_.charCodeAt(_.length-f-1);)++f;d[d.length-1]=y.slice(0,y.length-f),d[0]=d[0].slice(p);var w=Ea(o,p),x=Ea(c,h.length?Tr(h).length-f:0);return d.length>1||d[0]||Aa(w,x)?(Ci(e.doc,d,w,x,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){e.data&&e.data!=e.startData&&Et(this.cm,Z)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.setAttribute("contenteditable","false")},onKeyPress:function(e){e.preventDefault(),Et(this.cm,Z)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},onContextMenu:Ar,resetPosition:Ar,needsContentAttribute:!0},ne.prototype),e.inputStyles={textarea:te,contenteditable:ne},ce.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],n=e.ranges[t];if(0!=Aa(i.anchor,n.anchor)||0!=Aa(i.head,n.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new ue(G(this.ranges[t].anchor),G(this.ranges[t].head));return new ce(e,this.primIndex)},somethingSelected:function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},contains:function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var n=this.ranges[i];if(Aa(t,n.from())>=0&&Aa(e,n.to())<=0)return i}return-1}},ue.prototype={from:function(){return K(this.anchor,this.head)},to:function(){return Y(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Da,Ma,La,Oa={left:0,right:0,top:0,bottom:0},Na=null,Pa=0,Ra=0,ja=0,za=null;ca?za=-.53:oa?za=15:pa?za=-.7:ma&&(za=-1/3);var Fa=function(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==i&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:null==i&&(i=e.wheelDelta),{x:t,y:i}};e.wheelEventPixels=function(e){var t=Fa(e);return t.x*=za,t.y*=za,t};var Ba=new xr,Ua=null,$a=e.changeEnd=function(e){return e.text?Ea(e.from.line+e.text.length-1,Tr(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var i=this.options,n=i[e];i[e]==t&&"mode"!=e||(i[e]=t,Ha.hasOwnProperty(e)&&Et(this,Ha[e])(this,t,n))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Fi(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,i=0;i<t.length;++i)if(t[i]==e||t[i].name==e)return t.splice(i,1),!0},addOverlay:At(function(t,i){var n=t.token?t:e.getMode(this.options,t);if(n.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:n,modeSpec:t,opaque:i&&i.opaque}),this.state.modeGen++,Lt(this)}),removeOverlay:At(function(e){for(var t=this.state.overlays,i=0;i<t.length;++i){var n=t[i].modeSpec;if(n==e||"string"==typeof e&&n.name==e)return t.splice(i,1),this.state.modeGen++,void Lt(this)}}),indentLine:At(function(e,t,i){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),ge(this.doc,e)&&Li(this,e,t,i)}),indentSelection:At(function(e){for(var t=this.doc.sel.ranges,i=-1,n=0;n<t.length;n++){var r=t[n];if(r.empty())r.head.line>i&&(Li(this,r.head.line,e,!0),i=r.head.line,n==this.doc.sel.primIndex&&Di(this));else{var a=r.from(),o=r.to(),s=Math.max(i,a.line);i=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var l=s;l<i;++l)Li(this,l,e);var c=this.doc.sel.ranges;0==a.ch&&t.length==c.length&&c[n].from().ch>0&&we(this.doc,n,new ue(a,c[n].to()),So)}}}),getTokenAt:function(e,t){return Tn(this,e,t)},getLineTokens:function(e,t){return Tn(this,Ea(e),t,!0)},getTokenTypeAt:function(e){e=fe(this.doc,e);var t,i=An(this,Hn(this.doc,e.line)),n=0,r=(i.length-1)/2,a=e.ch;if(0==a)t=i[2];else for(;;){var o=n+r>>1;if((o?i[2*o-1]:0)>=a)r=o;else{if(!(i[2*o+1]<a)){t=i[2*o+2];break}n=o+1}}var s=t?t.indexOf("cm-overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(t){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(t).state).mode:i},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var i=[];if(!Xa.hasOwnProperty(t))return Xa;var n=Xa[t],r=this.getModeAt(e);if("string"==typeof r[t])n[r[t]]&&i.push(n[r[t]]);else if(r[t])for(var a=0;a<r[t].length;a++){var o=n[r[t][a]];o&&i.push(o)}else r.helperType&&n[r.helperType]?i.push(n[r.helperType]):n[r.name]&&i.push(n[r.name]);for(var a=0;a<n._global.length;a++){var s=n._global[a];s.pred(r,this)&&-1==Sr(i,s.val)&&i.push(s.val)}return i},getStateAfter:function(e,t){var i=this.doc;return e=pe(i,null==e?i.first+i.size-1:e),Fe(this,e+1,t)},cursorCoords:function(e,t){var i,n=this.doc.sel.primary();return i=null==e?n.head:"object"==typeof e?fe(this.doc,e):e?n.from():n.to(),ut(this,i,t||"page")},charCoords:function(e,t){return ct(this,fe(this.doc,e),t||"page")},coordsChar:function(e,t){return e=lt(this,e,t||"page"),pt(this,e.left,e.top)},lineAtHeight:function(e,t){return e=lt(this,{top:e,left:0},t||"page").top,Kn(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var i=!1,n=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>n&&(e=n,i=!0);var r=Hn(this.doc,e);return st(this,r,{top:0,left:0},t||"page").top+(i?this.doc.height-Xn(r):0)},defaultTextHeight:function(){return mt(this.display)},defaultCharWidth:function(){return gt(this.display)},setGutterMarker:At(function(e,t,i){return Oi(this.doc,e,"gutter",function(e){var n=e.gutterMarkers||(e.gutterMarkers={});return n[t]=i,!i&&Or(n)&&(e.gutterMarkers=null),!0})}),clearGutter:At(function(e){var t=this,i=t.doc,n=i.first;i.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&(i.gutterMarkers[e]=null,Ot(t,n,"gutter"),Or(i.gutterMarkers)&&(i.gutterMarkers=null)),++n})}),addLineWidget:At(function(e,t,i){return _n(this,e,t,i)}),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!ge(this.doc,e))return null;var t=e;if(!(e=Hn(this.doc,e)))return null}else{var t=Yn(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,i,n,r){var a=this.display;e=ut(this,fe(this.doc,e));var o=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),a.sizer.appendChild(t),"over"==n)o=e.top;else if("above"==n||"near"==n){var l=Math.max(a.wrapper.clientHeight,this.doc.height),c=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?o=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(o=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=o+"px",t.style.left=t.style.right="","right"==r?(s=a.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==r?s=0:"middle"==r&&(s=(a.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),i&&Ei(this,s,o,s+t.offsetWidth,o+t.offsetHeight)},triggerOnKeyDown:At(ai),triggerOnKeyPress:At(li),triggerOnKeyUp:si,execCommand:function(e){if(Ja.hasOwnProperty(e))return Ja[e](this)},findPosH:function(e,t,i,n){var r=1;t<0&&(r=-1,t=-t);for(var a=0,o=fe(this.doc,e);a<t&&(o=Pi(this.doc,o,r,i,n),!o.hitSide);++a);return o},moveH:At(function(e,t){var i=this;i.extendSelectionsBy(function(n){return i.display.shift||i.doc.extend||n.empty()?Pi(i.doc,n.head,e,t,i.options.rtlMoveVisually):e<0?n.from():n.to()},Ao)}),deleteH:At(function(e,t){var i=this.doc.sel,n=this.doc;i.somethingSelected()?n.replaceSelection("",null,"+delete"):Ni(this,function(i){var r=Pi(n,i.head,e,t,!1);return e<0?{from:r,to:i.head}:{from:i.head,to:r}})}),findPosV:function(e,t,i,n){var r=1,a=n;t<0&&(r=-1,t=-t);for(var o=0,s=fe(this.doc,e);o<t;++o){var l=ut(this,s,"div");if(null==a?a=l.left:l.left=a,s=Ri(this,l,r,i),s.hitSide)break}return s},moveV:At(function(e,t){var i=this,n=this.doc,r=[],a=!i.display.shift&&!n.extend&&n.sel.somethingSelected();if(n.extendSelectionsBy(function(o){if(a)return e<0?o.from():o.to();var s=ut(i,o.head,"div");null!=o.goalColumn&&(s.left=o.goalColumn),r.push(s.left);var l=Ri(i,s,e,t);return"page"==t&&o==n.sel.primary()&&Ii(i,null,ct(i,l,"div").top-s.top),l},Ao),r.length)for(var o=0;o<n.sel.ranges.length;o++)n.sel.ranges[o].goalColumn=r[o]}),findWordAt:function(e){var t=this.doc,i=Hn(t,e.line).text,n=e.ch,r=e.ch;if(i){var a=this.getHelper(e,"wordChars");(e.xRel<0||r==i.length)&&n?--n:++r;for(var o=i.charAt(n),s=Lr(o,a)?function(e){return Lr(e,a)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!Lr(e)};n>0&&s(i.charAt(n-1));)--n
|
||
;for(;r<i.length&&s(i.charAt(r));)++r}return new ue(Ea(e.line,n),Ea(e.line,r))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Bo(this.display.cursorDiv,"CodeMirror-overwrite"):Fo(this.display.cursorDiv,"CodeMirror-overwrite"),xo(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==zr()},scrollTo:At(function(e,t){null==e&&null==t||Mi(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-qe(this)-this.display.barHeight,width:e.scrollWidth-qe(this)-this.display.barWidth,clientHeight:We(this),clientWidth:He(this)}},scrollIntoView:At(function(e,t){if(null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:Ea(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line)Mi(this),this.curOp.scrollToPos=e;else{var i=Ai(this,Math.min(e.from.left,e.to.left),Math.min(e.from.top,e.to.top)-e.margin,Math.max(e.from.right,e.to.right),Math.max(e.from.bottom,e.to.bottom)+e.margin);this.scrollTo(i.scrollLeft,i.scrollTop)}}),setSize:At(function(e,t){function i(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var n=this;null!=e&&(n.display.wrapper.style.width=i(e)),null!=t&&(n.display.wrapper.style.height=i(t)),n.options.lineWrapping&&nt(this);var r=n.display.viewFrom;n.doc.iter(r,n.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){Ot(n,r,"widget");break}++r}),n.curOp.forceUpdate=!0,xo(n,"refresh",this)}),operation:function(e){return St(this,e)},refresh:At(function(){var e=this.display.cachedTextHeight;Lt(this),this.curOp.forceUpdate=!0,rt(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-mt(this.display))>.5)&&o(this),xo(this,"refresh",this)}),swapDoc:At(function(e){var t=this.doc;return t.cm=null,qn(this,e),rt(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,gr(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},wr(e);var qa=e.defaults={},Ha=e.optionHandlers={},Wa=e.Init={toString:function(){return"CodeMirror.Init"}};ji("value","",function(e,t){e.setValue(t)},!0),ji("mode",null,function(e,t){e.doc.modeOption=t,i(e)},!0),ji("indentUnit",2,i,!0),ji("indentWithTabs",!1),ji("smartIndent",!0),ji("tabSize",4,function(e){n(e),rt(e),Lt(e)},!0),ji("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t){e.options.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),e.refresh()},!0),ji("specialCharPlaceholder",Ln,function(e){e.refresh()},!0),ji("electricChars",!0),ji("inputStyle",_a?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ji("rtlMoveVisually",!wa),ji("wholeLineUpdateBefore",!0),ji("theme","default",function(e){s(e),l(e)},!0),ji("keyMap","default",function(t,i,n){var r=Fi(i),a=n!=e.Init&&Fi(n);a&&a.detach&&a.detach(t,r),r.attach&&r.attach(t,a||null)}),ji("extraKeys",null),ji("lineWrapping",!1,r,!0),ji("gutters",[],function(e){p(e.options),l(e)},!0),ji("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),ji("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),ji("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),ji("lineNumbers",!1,function(e){p(e.options),l(e)},!0),ji("firstLineNumber",1,l,!0),ji("lineNumberFormatter",function(e){return e},l,!0),ji("showCursorWhenSelecting",!1,Me,!0),ji("resetSelectionOnContextMenu",!0),ji("readOnly",!1,function(e,t){"nocursor"==t?(ui(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||e.display.input.reset())}),ji("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),ji("dragDrop",!0),ji("cursorBlinkRate",530),ji("cursorScrollMargin",0),ji("cursorHeight",1,Me,!0),ji("singleCursorHeightPerLine",!0,Me,!0),ji("workTime",100),ji("workDelay",100),ji("flattenSpans",!0,n,!0),ji("addModeClass",!1,n,!0),ji("pollInterval",100),ji("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),ji("historyEventDelay",1250),ji("viewportMargin",10,function(e){e.refresh()},!0),ji("maxHighlightLength",1e4,n,!0),ji("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),ji("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),ji("autofocus",null);var Va=e.modes={},Ga=e.mimeModes={};e.defineMode=function(t,i){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(i.dependencies=Array.prototype.slice.call(arguments,2)),Va[t]=i},e.defineMIME=function(e,t){Ga[e]=t},e.resolveMode=function(t){if("string"==typeof t&&Ga.hasOwnProperty(t))t=Ga[t];else if(t&&"string"==typeof t.name&&Ga.hasOwnProperty(t.name)){var i=Ga[t.name];"string"==typeof i&&(i={name:i}),t=Ir(i,t),t.name=i.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,i){var i=e.resolveMode(i),n=Va[i.name];if(!n)return e.getMode(t,"text/plain");var r=n(t,i);if(Ya.hasOwnProperty(i.name)){var a=Ya[i.name];for(var o in a)a.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=a[o])}if(r.name=i.name,i.helperType&&(r.helperType=i.helperType),i.modeProps)for(var o in i.modeProps)r[o]=i.modeProps[o];return r},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var Ya=e.modeExtensions={};e.extendMode=function(e,t){Dr(t,Ya.hasOwnProperty(e)?Ya[e]:Ya[e]={})},e.defineExtension=function(t,i){e.prototype[t]=i},e.defineDocExtension=function(e,t){fo.prototype[e]=t},e.defineOption=ji;var Ka=[];e.defineInitHook=function(e){Ka.push(e)};var Xa=e.helpers={};e.registerHelper=function(t,i,n){Xa.hasOwnProperty(t)||(Xa[t]=e[t]={_global:[]}),Xa[t][i]=n},e.registerGlobalHelper=function(t,i,n,r){e.registerHelper(t,i,r),Xa[t]._global.push({pred:n,val:r})};var Qa=e.copyState=function(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var i={};for(var n in t){var r=t[n];r instanceof Array&&(r=r.concat([])),i[n]=r}return i},Za=e.startState=function(e,t,i){return!e.startState||e.startState(t,i)};e.innerMode=function(e,t){for(;e.innerMode;){var i=e.innerMode(t);if(!i||i.mode==e)break;t=i.state,e=i.mode}return i||{mode:e,state:t}};var Ja=e.commands={selectAll:function(e){e.setSelection(Ea(e.firstLine(),0),Ea(e.lastLine()),So)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),So)},killLine:function(e){Ni(e,function(t){if(t.empty()){var i=Hn(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:Ea(t.head.line+1,0)}:{from:t.head,to:Ea(t.head.line,i)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){Ni(e,function(t){return{from:Ea(t.from().line,0),to:fe(e.doc,Ea(t.to().line+1,0))}})},delLineLeft:function(e){Ni(e,function(e){return{from:Ea(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){Ni(e,function(t){var i=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:i},"div"),to:t.from()}})},delWrappedLineRight:function(e){Ni(e,function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:n}})},undo:function(e){e.undo()},redo:function(e){e.redo()},undoSelection:function(e){e.undoSelection()},redoSelection:function(e){e.redoSelection()},goDocStart:function(e){e.extendSelection(Ea(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(Ea(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy(function(t){return Zr(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy(function(t){return ea(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy(function(t){return Jr(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy(function(t){var i=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},Ao)},goLineLeft:function(e){e.extendSelectionsBy(function(t){var i=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},Ao)},goLineLeftSmart:function(e){e.extendSelectionsBy(function(t){var i=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:i},"div");return n.ch<e.getLine(n.line).search(/\S/)?ea(e,t.head):n},Ao)},goLineUp:function(e){e.moveV(-1,"line")},goLineDown:function(e){e.moveV(1,"line")},goPageUp:function(e){e.moveV(-1,"page")},goPageDown:function(e){e.moveV(1,"page")},goCharLeft:function(e){e.moveH(-1,"char")},goCharRight:function(e){e.moveH(1,"char")},goColumnLeft:function(e){e.moveH(-1,"column")},goColumnRight:function(e){e.moveH(1,"column")},goWordLeft:function(e){e.moveH(-1,"word")},goGroupRight:function(e){e.moveH(1,"group")},goGroupLeft:function(e){e.moveH(-1,"group")},goWordRight:function(e){e.moveH(1,"word")},delCharBefore:function(e){e.deleteH(-1,"char")},delCharAfter:function(e){e.deleteH(1,"char")},delWordBefore:function(e){e.deleteH(-1,"word")},delWordAfter:function(e){e.deleteH(1,"word")},delGroupBefore:function(e){e.deleteH(-1,"group")},delGroupAfter:function(e){e.deleteH(1,"group")},indentAuto:function(e){e.indentSelection("smart")},indentMore:function(e){e.indentSelection("add")},indentLess:function(e){e.indentSelection("subtract")},insertTab:function(e){e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),n=e.options.tabSize,r=0;r<i.length;r++){var a=i[r].from(),o=Io(e.getLine(a.line),a.ch,n);t.push(new Array(n-o%n+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){St(e,function(){for(var t=e.listSelections(),i=[],n=0;n<t.length;n++){var r=t[n].head,a=Hn(e.doc,r.line).text;if(a)if(r.ch==a.length&&(r=new Ea(r.line,r.ch-1)),r.ch>0)r=new Ea(r.line,r.ch+1),e.replaceRange(a.charAt(r.ch-1)+a.charAt(r.ch-2),Ea(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var o=Hn(e.doc,r.line-1).text;o&&e.replaceRange(a.charAt(0)+"\n"+o.charAt(o.length-1),Ea(r.line-1,o.length-1),Ea(r.line,1),"+transpose")}i.push(new ue(r,r))}e.setSelections(i)})},newlineAndIndent:function(e){St(e,function(){for(var t=e.listSelections().length,i=0;i<t;i++){var n=e.listSelections()[i];e.replaceRange("\n",n.anchor,n.head,"+input"),e.indentLine(n.from().line+1,null,!0),Di(e)}})},toggleOverwrite:function(e){e.toggleOverwrite()}},eo=e.keyMap={};eo.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},eo.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},eo.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},eo.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},eo.default=ba?eo.macDefault:eo.pcDefault,e.normalizeKeyMap=function(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if("..."==n){delete e[i];continue}for(var r=Er(i.split(" "),zi),a=0;a<r.length;a++){var o,s;a==r.length-1?(s=i,o=n):(s=r.slice(0,a+1).join(" "),o="...");var l=t[s];if(l){if(l!=o)throw new Error("Inconsistent bindings for "+s)}else t[s]=o}delete e[i]}for(var c in t)e[c]=t[c];return e};var to=e.lookupKey=function(e,t,i,n){t=Fi(t);var r=t.call?t.call(e,n):t[e];if(!1===r)return"nothing";if("..."===r)return"multi";if(null!=r&&i(r))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return to(e,t.fallthrough,i,n);for(var a=0;a<t.fallthrough.length;a++){var o=to(e,t.fallthrough[a],i,n);if(o)return o}}},io=e.isModifierKey=function(e){var t="string"==typeof e?e:Go[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},no=e.keyName=function(e,t){if(fa&&34==e.keyCode&&e.char)return!1;var i=Go[e.keyCode],n=i;return null!=n&&!e.altGraphKey&&(e.altKey&&"Alt"!=i&&(n="Alt-"+n),(ka?e.metaKey:e.ctrlKey)&&"Ctrl"!=i&&(n="Ctrl-"+n),(ka?e.ctrlKey:e.metaKey)&&"Cmd"!=i&&(n="Cmd-"+n),!t&&e.shiftKey&&"Shift"!=i&&(n="Shift-"+n),n)};e.fromTextArea=function(t,i){function n(){t.value=l.getValue()}if(i=i?Dr(i):{},i.value=t.value,!i.tabindex&&t.tabIndex&&(i.tabindex=t.tabIndex),!i.placeholder&&t.placeholder&&(i.placeholder=t.placeholder),null==i.autofocus){var r=zr();i.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}if(t.form&&(bo(t.form,"submit",n),!i.leaveSubmitMethodAlone)){var a=t.form,o=a.submit;try{var s=a.submit=function(){n(),a.submit=o,a.submit(),a.submit=s}}catch(e){}}i.finishInit=function(e){e.save=n,e.getTextArea=function(){return t},e.toTextArea=function(){e.toTextArea=isNaN,n(),t.parentNode.removeChild(e.getWrapperElement()),t.style.display="",t.form&&(wo(t.form,"submit",n),"function"==typeof t.form.submit&&(t.form.submit=o))}},t.style.display="none";var l=e(function(e){t.parentNode.insertBefore(e,t.nextSibling)},i);return l};var ro=e.StringStream=function(e,t){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0};ro.prototype={eol:function(){return this.pos>=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},eat:function(e){var t=this.string.charAt(this.pos);if("string"==typeof e)var i=t==e;else var i=t&&(e.test?e.test(t):e(t));if(i)return++this.pos,t},eatWhile:function(e){for(var t=this.pos;this.eat(e););return this.pos>t},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Io(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Io(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return Io(this.string,null,this.tabSize)-(this.lineStart?Io(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,i){if("string"!=typeof e){var n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}var r=function(e){return i?e.toLowerCase():e};if(r(this.string.substr(this.pos,e.length))==r(e))return!1!==t&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ao=0,oo=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ao};wr(oo),oo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&vt(e),br(this,"clear")){var i=this.find();i&&gr(this,"clear",i.from,i.to)}for(var n=null,r=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=Vi(o.markedSpans,this);e&&!this.collapsed?Ot(e,Yn(o),"text"):e&&(null!=s.to&&(r=Yn(o)),null!=s.from&&(n=Yn(o))),o.markedSpans=Gi(o.markedSpans,s),null==s.from&&this.collapsed&&!mn(this.doc,o)&&e&&Gn(o,mt(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var a=0;a<this.lines.length;++a){var l=dn(this.lines[a]),c=d(l);c>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=n&&e&&this.collapsed&&Lt(e,n,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ae(e.doc)),e&&gr(e,"markerCleared",e,this),t&&_t(e),this.parent&&this.parent.clear()}},oo.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var i,n,r=0;r<this.lines.length;++r){var a=this.lines[r],o=Vi(a.markedSpans,this);if(null!=o.from&&(i=Ea(t?a:Yn(a),o.from),-1==e))return i;if(null!=o.to&&(n=Ea(t?a:Yn(a),o.to),1==e))return n}return i&&{from:i,to:n}},oo.prototype.changed=function(){var e=this.find(-1,!0),t=this,i=this.doc.cm;e&&i&&St(i,function(){var n=e.line,r=Yn(e.line),a=Xe(i,r);if(a&&(it(a),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!mn(t.doc,n)&&null!=t.height){var o=t.height;t.height=null;var s=yn(t)-o;s&&Gn(n,n.height+s)}})},oo.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=Sr(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},oo.prototype.detachLine=function(e){if(this.lines.splice(Sr(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var ao=0,so=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};wr(so),so.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();gr(this,"clear")}},so.prototype.find=function(e,t){return this.primary.find(e,t)};var lo=e.LineWidget=function(e,t,i){if(i)for(var n in i)i.hasOwnProperty(n)&&(this[n]=i[n]);this.cm=e,this.node=t};wr(lo),lo.prototype.clear=function(){var e=this.cm,t=this.line.widgets,i=this.line,n=Yn(i);if(null!=n&&t){for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);var a=yn(this);St(e,function(){vn(e,i,-a),Ot(e,n,"widget"),Gn(i,Math.max(0,i.height-a))})}},lo.prototype.changed=function(){var e=this.height,t=this.cm,i=this.line;this.height=null;var n=yn(this)-e;n&&St(t,function(){t.curOp.forceUpdate=!0,vn(t,i,n),Gn(i,i.height+n)})};var co=e.Line=function(e,t,i){this.text=e,nn(this,t),this.height=i?i(this):1};wr(co),co.prototype.lineNo=function(){return Yn(this)};var uo={},ho={};Bn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,n=e+t;i<n;++i){var r=this.lines[i];this.height-=r.height,wn(r),gr(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,i){for(var n=e+t;e<n;++e)if(i(this.lines[e]))return!0}},Un.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var n=this.children[i],r=n.chunkSize();if(e<r){var a=Math.min(t,r-e),o=n.height;if(n.removeInner(e,a),this.height-=o-n.height,r==a&&(this.children.splice(i--,1),n.parent=null),0==(t-=a))break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Bn))){var s=[];this.collapse(s),this.children=[new Bn(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var n=0;n<this.children.length;++n){var r=this.children[n],a=r.chunkSize();if(e<=a){if(r.insertInner(e,t,i),r.lines&&r.lines.length>50){for(;r.lines.length>50;){var o=r.lines.splice(r.lines.length-25,25),s=new Bn(o);r.height-=s.height,this.children.splice(n+1,0,s),s.parent=this}this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Un(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=Sr(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new Un(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var n=0;n<this.children.length;++n){var r=this.children[n],a=r.chunkSize();if(e<a){var o=Math.min(t,a-e);if(r.iterN(e,o,i))return!0;if(0==(t-=o))break;e=0}else e-=a}}};var po=0,fo=e.Doc=function(e,t,i){if(!(this instanceof fo))return new fo(e,t,i);null==i&&(i=0),Un.call(this,[new Bn([new co("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=i;var n=Ea(i,0);this.sel=he(n),this.history=new Zn(null),this.id=++po,this.modeOption=t,"string"==typeof e&&(e=qo(e)),Fn(this,{from:n,to:n,text:e}),Te(this,he(n),So)};fo.prototype=Ir(Un.prototype,{constructor:fo,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,n=0;n<t.length;++n)i+=t[n].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Vn(this,this.first,this.first+this.size);return!1===e?t:t.join(e||"\n")},setValue:It(function(e){var t=Ea(this.first,0),i=this.first+this.size-1;yi(this,{from:t,to:Ea(i,Hn(this,i).text.length),text:qo(e),origin:"setValue",full:!0},!0),Te(this,he(t))}),replaceRange:function(e,t,i,n){t=fe(this,t),i=i?fe(this,i):t,Ci(this,e,t,i,n)},getRange:function(e,t,i){var n=Wn(this,fe(this,e),fe(this,t));return!1===i?n:n.join(i||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(ge(this,e))return Hn(this,e)},getLineNumber:function(e){return Yn(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Hn(this,e)),dn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return fe(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:It(function(e,t,i){xe(this,fe(this,"number"==typeof e?Ea(e,t||0):e),null,i)}),setSelection:It(function(e,t,i){xe(this,fe(this,e),fe(this,t||e),i)}),extendSelection:It(function(e,t,i){_e(this,fe(this,e),t&&fe(this,t),i)}),extendSelections:It(function(e,t){be(this,ve(this,e))}),extendSelectionsBy:It(function(e,t){be(this,Er(this.sel.ranges,e),t)}),setSelections:It(function(e,t,i){if(e.length){for(var n=0,r=[];n<e.length;n++)r[n]=new ue(fe(this,e[n].anchor),fe(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Te(this,de(r,t),i)}}),addSelection:It(function(e,t,i){var n=this.sel.ranges.slice(0);n.push(new ue(fe(this,e),fe(this,t||e))),Te(this,de(n,n.length-1),i)}),getSelection:function(e){for(var t,i=this.sel.ranges,n=0;n<i.length;n++){var r=Wn(this,i[n].from(),i[n].to());t=t?t.concat(r):r}return!1===e?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],i=this.sel.ranges,n=0;n<i.length;n++){var r=Wn(this,i[n].from(),i[n].to());!1!==e&&(r=r.join(e||"\n")),t[n]=r}return t},replaceSelection:function(e,t,i){for(var n=[],r=0;r<this.sel.ranges.length;r++)n[r]=e;this.replaceSelections(n,t,i||"+input")},replaceSelections:It(function(e,t,i){for(var n=[],r=this.sel,a=0;a<r.ranges.length;a++){var o=r.ranges[a];n[a]={from:o.from(),to:o.to(),text:qo(e[a]),origin:i}}for(var s=t&&"end"!=t&&gi(this,n,t),a=n.length-1;a>=0;a--)yi(this,n[a]);s?Ce(this,s):this.cm&&Di(this.cm)}),undo:It(function(){bi(this,"undo")}),redo:It(function(){bi(this,"redo")}),undoSelection:It(function(){bi(this,"undo",!0)}),redoSelection:It(function(){bi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){this.history=new Zn(this.history.maxGeneration)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:cr(this.history.done),undone:cr(this.history.undone)}},setHistory:function(e){var t=this.history=new Zn(this.history.maxGeneration);t.done=cr(e.done.slice(0),null,!0),t.undone=cr(e.undone.slice(0),null,!0)},addLineClass:It(function(e,t,i){return Oi(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[n]){if(Fr(i).test(e[n]))return!1;e[n]+=" "+i}else e[n]=i;return!0})}),removeLineClass:It(function(e,t,i){return Oi(this,e,"gutter"==t?"gutter":"class",function(e){var n="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",r=e[n];if(!r)return!1;if(null==i)e[n]=null;else{var a=r.match(Fr(i));if(!a)return!1;var o=a.index+a[0].length;e[n]=r.slice(0,a.index)+(a.index&&o!=r.length?" ":"")+r.slice(o)||null}return!0})}),markText:function(e,t,i){return Bi(this,fe(this,e),fe(this,t),i,"range")},setBookmark:function(e,t){var i={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared};return e=fe(this,e),Bi(this,e,e,i,"bookmark")},findMarksAt:function(e){e=fe(this,e);var t=[],i=Hn(this,e.line).markedSpans;if(i)for(var n=0;n<i.length;++n){var r=i[n];(null==r.from||r.from<=e.ch)&&(null==r.to||r.to>=e.ch)&&t.push(r.marker.parent||r.marker)}return t},findMarks:function(e,t,i){e=fe(this,e),t=fe(this,t);var n=[],r=e.line;return this.iter(e.line,t.line+1,function(a){var o=a.markedSpans;if(o)for(var s=0;s<o.length;s++){var l=o[s];r==e.line&&e.ch>l.to||null==l.from&&r!=e.line||r==t.line&&l.from>t.ch||i&&!i(l.marker)||n.push(l.marker.parent||l.marker)}++r}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var n=0;n<i.length;++n)null!=i[n].from&&e.push(i[n].marker)}),e},posFromIndex:function(e){var t,i=this.first;return this.iter(function(n){var r=n.text.length+1;if(r>e)return t=e,!0;e-=r,++i}),fe(this,Ea(i,t))},indexFromPos:function(e){e=fe(this,e);var t=e.ch;return e.line<this.first||e.ch<0?0:(this.iter(this.first,e.line,function(e){t+=e.text.length+1}),t)},copy:function(e){var t=new fo(Vn(this,this.first,this.first+this.size),this.modeOption,this.first);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<i&&(i=e.to);var n=new fo(Vn(this,t,i),e.mode||this.modeOption,t);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],qi(n,$i(this)),n},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var i=0;i<this.linked.length;++i){var n=this.linked[i];if(n.doc==t){this.linked.splice(i,1),t.unlinkDoc(this),Hi($i(this));break}}if(t.history==this.history){var r=[t.id];$n(t,function(e){r.push(e.id)},!0),t.history=new Zn(null),t.history.done=cr(this.history.done,r),t.history.undone=cr(this.history.undone,r)}},iterLinkedDocs:function(e){$n(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),fo.prototype.eachLine=fo.prototype.iter;var mo="iter insert remove copy getEditor".split(" ");for(var go in fo.prototype)fo.prototype.hasOwnProperty(go)&&Sr(mo,go)<0&&(e.prototype[go]=function(e){return function(){return e.apply(this.doc,arguments)}}(fo.prototype[go]));wr(fo);var vo=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},yo=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},_o=e.e_stop=function(e){vo(e),yo(e)},bo=e.on=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var n=e._handlers||(e._handlers={}),r=n[t]||(n[t]=[]);r.push(i)}},wo=e.off=function(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var n=e._handlers&&e._handlers[t];if(!n)return;for(var r=0;r<n.length;++r)if(n[r]==i){n.splice(r,1);break}}},xo=e.signal=function(e,t){var i=e._handlers&&e._handlers[t];if(i)for(var n=Array.prototype.slice.call(arguments,2),r=0;r<i.length;++r)i[r].apply(null,n)},ko=null,Co=30,To=e.Pass={toString:function(){return"CodeMirror.Pass"}},So={scroll:!1},Eo={origin:"*mouse"},Ao={origin:"+move"};xr.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Io=e.countColumn=function(e,t,i,n,r){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var a=n||0,o=r||0;;){var s=e.indexOf("\t",a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=i-o%i,a=s+1}},Do=[""],Mo=function(e){e.select()};ya?Mo=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:ca&&(Mo=function(e){try{e.select()}catch(e){}});var Lo,Oo=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,No=e.isWordChar=function(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||Oo.test(e))
|
||
},Po=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Lo=document.createRange?function(e,t,i,n){var r=document.createRange();return r.setEnd(n||e,i),r.setStart(e,t),r}:function(e,t,i){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",i),n.moveStart("character",t),n};var Ro=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)};ca&&ua<11&&(zr=function(){try{return document.activeElement}catch(e){return document.body}});var jo,zo,Fo=e.rmClass=function(e,t){var i=e.className,n=Fr(t).exec(i);if(n){var r=i.slice(n.index+n[0].length);e.className=i.slice(0,n.index)+(r?n[1]+r:"")}},Bo=e.addClass=function(e,t){var i=e.className;Fr(t).test(i)||(e.className+=(i?" ":"")+t)},Uo=!1,$o=function(){if(ca&&ua<9)return!1;var e=Pr("div");return"draggable"in e||"dragDrop"in e}(),qo=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,i=[],n=e.length;t<=n;){var r=e.indexOf("\n",t);-1==r&&(r=e.length);var a=e.slice(t,"\r"==e.charAt(r-1)?r-1:r),o=a.indexOf("\r");-1!=o?(i.push(a.slice(0,o)),t+=o+1):(i.push(a),t=r+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Ho=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Wo=function(){var e=Pr("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),Vo=null,Go={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",107:"=",109:"-",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};e.keyNames=Go,function(){for(var e=0;e<10;e++)Go[e+48]=Go[e+96]=String(e);for(var e=65;e<=90;e++)Go[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)Go[e+111]=Go[e+63235]="F"+e}();var Yo,Ko=function(){function e(e){return e<=247?i.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1773?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,i){this.level=e,this.from=t,this.to=i}var i="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,l=/[1n]/;return function(i){if(!r.test(i))return!1;for(var n,c=i.length,u=[],d=0;d<c;++d)u.push(n=e(i.charCodeAt(d)));for(var d=0,h="L";d<c;++d){var n=u[d];"m"==n?u[d]=h:h=n}for(var d=0,p="L";d<c;++d){var n=u[d];"1"==n&&"r"==p?u[d]="n":o.test(n)&&(p=n,"r"==n&&(u[d]="R"))}for(var d=1,h=u[0];d<c-1;++d){var n=u[d];"+"==n&&"1"==h&&"1"==u[d+1]?u[d]="1":","!=n||h!=u[d+1]||"1"!=h&&"n"!=h||(u[d]=h),h=n}for(var d=0;d<c;++d){var n=u[d];if(","==n)u[d]="N";else if("%"==n){for(var f=d+1;f<c&&"%"==u[f];++f);for(var m=d&&"!"==u[d-1]||f<c&&"1"==u[f]?"1":"N",g=d;g<f;++g)u[g]=m;d=f-1}}for(var d=0,p="L";d<c;++d){var n=u[d];"L"==p&&"1"==n?u[d]="L":o.test(n)&&(p=n)}for(var d=0;d<c;++d)if(a.test(u[d])){for(var f=d+1;f<c&&a.test(u[f]);++f);for(var v="L"==(d?u[d-1]:"L"),y="L"==(f<c?u[f]:"L"),m=v||y?"L":"R",g=d;g<f;++g)u[g]=m;d=f-1}for(var _,b=[],d=0;d<c;)if(s.test(u[d])){var w=d;for(++d;d<c&&s.test(u[d]);++d);b.push(new t(0,w,d))}else{var x=d,k=b.length;for(++d;d<c&&"L"!=u[d];++d);for(var g=x;g<d;)if(l.test(u[g])){x<g&&b.splice(k,0,new t(1,x,g));var C=g;for(++g;g<d&&l.test(u[g]);++g);b.splice(k,0,new t(2,C,g)),x=g}else++g;x<d&&b.splice(k,0,new t(1,x,d))}return 1==b[0].level&&(_=i.match(/^\s+/))&&(b[0].from=_[0].length,b.unshift(new t(0,0,_[0].length))),1==Tr(b).level&&(_=i.match(/\s+$/))&&(Tr(b).to-=_[0].length,b.push(new t(0,c-_[0].length,c))),b[0].level!=Tr(b).level&&b.push(new t(b[0].level,c,c)),b}}();return e.version="5.0.0",e}),function(e){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?module.exports=e:"function"==typeof define?e(jQuery,flowchart):e($,flowchart)}(function(e,t){!function(e){e.fn.flowChart=function(i){i=i||{};var n={x:0,y:0,"line-width":2,"line-length":50,"text-margin":10,"font-size":14,"font-color":"black","line-color":"black","element-color":"black",fill:"white","yes-text":"yes","no-text":"no","arrow-end":"block",symbols:{start:{"font-color":"black","element-color":"black",fill:"white"},end:{class:"end-element"}},flowstate:{past:{fill:"#CCCCCC","font-size":12},current:{fill:"black","font-color":"white","font-weight":"bold"},future:{fill:"white"},request:{fill:"blue"},invalid:{fill:"#444444"},approved:{fill:"#58C4A3","font-size":12,"yes-text":"APPROVED","no-text":"n/a"},rejected:{fill:"#C45879","font-size":12,"yes-text":"n/a","no-text":"REJECTED"}}};return this.each(function(){var r=e(this),a=t.parse(r.text()),o=e.extend(!0,n,i);r.html(""),a.drawSVG(this,o)})}}(e)}),define("jqueryflowchart",["jquery"],function(){}),define("sequenceDiagram",["jquery","raphael","underscore"],function(e,t,i){(function(){"use strict";function e(){this.title=void 0,this.actors=[],this.signals=[]}function t(e,t){i.extend(this,t),this.name="ParseError",this.message=e||""}e.prototype.getActor=function(t){var i=/^(.+) as (\S+)$/i.exec(t.trim());i?(name=i[1].trim(),t=i[2].trim()):name=t.trim(),name=name.replace(/\\n/gm,"\n");var n,r=this.actors;for(n in r)if(r[n].alias==t)return r[n];return n=r.push(new e.Actor(t,name,r.length)),r[n-1]},e.prototype.setTitle=function(e){this.title=e},e.prototype.addSignal=function(e){this.signals.push(e)},e.Actor=function(e,t,i){this.alias=e,this.name=t,this.index=i},e.Signal=function(e,t,i,n){this.type="Signal",this.actorA=e,this.actorB=i,this.linetype=3&t,this.arrowtype=3&t>>2,this.message=n},e.Signal.prototype.isSelf=function(){return this.actorA.index==this.actorB.index},e.Note=function(e,t,i){if(this.type="Note",this.actor=e,this.placement=t,this.message=i,this.hasManyActors()&&e[0]==e[1])throw new Error("Note should be over two different actors")},e.Note.prototype.hasManyActors=function(){return i.isArray(this.actor)},e.LINETYPE={SOLID:0,DOTTED:1},e.ARROWTYPE={FILLED:0,OPEN:1},e.PLACEMENT={LEFTOF:0,RIGHTOF:1,OVER:2};var n=function(){function t(){this.yy={}}var i={trace:function(){},yy:{},symbols_:{error:2,start:3,document:4,EOF:5,line:6,statement:7,NL:8,participant:9,actor:10,signal:11,note_statement:12,title:13,message:14,note:15,placement:16,over:17,actor_pair:18,",":19,left_of:20,right_of:21,signaltype:22,ACTOR:23,linetype:24,arrowtype:25,LINE:26,DOTLINE:27,ARROW:28,OPENARROW:29,MESSAGE:30,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",8:"NL",9:"participant",13:"title",15:"note",17:"over",19:",",20:"left_of",21:"right_of",23:"ACTOR",26:"LINE",27:"DOTLINE",28:"ARROW",29:"OPENARROW",30:"MESSAGE"},productions_:[0,[3,2],[4,0],[4,2],[6,1],[6,1],[7,2],[7,1],[7,1],[7,2],[12,4],[12,4],[18,1],[18,3],[16,1],[16,1],[11,4],[10,1],[22,2],[22,1],[24,1],[24,1],[25,1],[25,1],[14,1]],performAction:function(t,i,n,r,a,o){var s=o.length-1;switch(a){case 1:return r;case 4:break;case 6:o[s];break;case 7:case 8:r.addSignal(o[s]);break;case 9:r.setTitle(o[s]);break;case 10:this.$=new e.Note(o[s-1],o[s-2],o[s]);break;case 11:this.$=new e.Note(o[s-1],e.PLACEMENT.OVER,o[s]);break;case 12:this.$=o[s];break;case 13:this.$=[o[s-2],o[s]];break;case 14:this.$=e.PLACEMENT.LEFTOF;break;case 15:this.$=e.PLACEMENT.RIGHTOF;break;case 16:this.$=new e.Signal(o[s-3],o[s-2],o[s-1],o[s]);break;case 17:this.$=r.getActor(o[s]);break;case 18:this.$=o[s-1]|o[s]<<2;break;case 19:this.$=o[s];break;case 20:this.$=e.LINETYPE.SOLID;break;case 21:this.$=e.LINETYPE.DOTTED;break;case 22:this.$=e.ARROWTYPE.FILLED;break;case 23:this.$=e.ARROWTYPE.OPEN;break;case 24:this.$=o[s].substring(1).trim().replace(/\\n/gm,"\n")}},table:[{3:1,4:2,5:[2,2],8:[2,2],9:[2,2],13:[2,2],15:[2,2],23:[2,2]},{1:[3]},{5:[1,3],6:4,7:5,8:[1,6],9:[1,7],10:11,11:8,12:9,13:[1,10],15:[1,12],23:[1,13]},{1:[2,1]},{5:[2,3],8:[2,3],9:[2,3],13:[2,3],15:[2,3],23:[2,3]},{5:[2,4],8:[2,4],9:[2,4],13:[2,4],15:[2,4],23:[2,4]},{5:[2,5],8:[2,5],9:[2,5],13:[2,5],15:[2,5],23:[2,5]},{10:14,23:[1,13]},{5:[2,7],8:[2,7],9:[2,7],13:[2,7],15:[2,7],23:[2,7]},{5:[2,8],8:[2,8],9:[2,8],13:[2,8],15:[2,8],23:[2,8]},{14:15,30:[1,16]},{22:17,24:18,26:[1,19],27:[1,20]},{16:21,17:[1,22],20:[1,23],21:[1,24]},{5:[2,17],8:[2,17],9:[2,17],13:[2,17],15:[2,17],19:[2,17],23:[2,17],26:[2,17],27:[2,17],30:[2,17]},{5:[2,6],8:[2,6],9:[2,6],13:[2,6],15:[2,6],23:[2,6]},{5:[2,9],8:[2,9],9:[2,9],13:[2,9],15:[2,9],23:[2,9]},{5:[2,24],8:[2,24],9:[2,24],13:[2,24],15:[2,24],23:[2,24]},{10:25,23:[1,13]},{23:[2,19],25:26,28:[1,27],29:[1,28]},{23:[2,20],28:[2,20],29:[2,20]},{23:[2,21],28:[2,21],29:[2,21]},{10:29,23:[1,13]},{10:31,18:30,23:[1,13]},{23:[2,14]},{23:[2,15]},{14:32,30:[1,16]},{23:[2,18]},{23:[2,22]},{23:[2,23]},{14:33,30:[1,16]},{14:34,30:[1,16]},{19:[1,35],30:[2,12]},{5:[2,16],8:[2,16],9:[2,16],13:[2,16],15:[2,16],23:[2,16]},{5:[2,10],8:[2,10],9:[2,10],13:[2,10],15:[2,10],23:[2,10]},{5:[2,11],8:[2,11],9:[2,11],13:[2,11],15:[2,11],23:[2,11]},{10:36,23:[1,13]},{30:[2,13]}],defaultActions:{3:[2,1],23:[2,14],24:[2,15],26:[2,18],27:[2,22],28:[2,23],36:[2,13]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){var t=this,i=[0],n=[null],r=[],a=this.table,o="",s=0,l=0,c=0,u=1;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var d=this.lexer.yylloc;r.push(d);var h=this.lexer.options&&this.lexer.options.ranges;this.parseError="function"==typeof this.yy.parseError?this.yy.parseError:Object.getPrototypeOf(this).parseError;for(var p,f,m,g,v,y,_,b,w,x={};;){if(m=i[i.length-1],this.defaultActions[m]?g=this.defaultActions[m]:((null===p||void 0===p)&&(p=function(){var e;return e=t.lexer.lex()||u,"number"!=typeof e&&(e=t.symbols_[e]||e),e}()),g=a[m]&&a[m][p]),void 0===g||!g.length||!g[0]){var k="";w=[];for(y in a[m])this.terminals_[y]&&y>2&&w.push("'"+this.terminals_[y]+"'");k=this.lexer.showPosition?"Parse error on line "+(s+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+(this.terminals_[p]||p)+"'":"Parse error on line "+(s+1)+": Unexpected "+(p==u?"end of input":"'"+(this.terminals_[p]||p)+"'"),this.parseError(k,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:d,expected:w})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+p);switch(g[0]){case 1:i.push(p),n.push(this.lexer.yytext),r.push(this.lexer.yylloc),i.push(g[1]),p=null,f?(p=f,f=null):(l=this.lexer.yyleng,o=this.lexer.yytext,s=this.lexer.yylineno,d=this.lexer.yylloc,c>0&&c--);break;case 2:if(_=this.productions_[g[1]][1],x.$=n[n.length-_],x._$={first_line:r[r.length-(_||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(_||1)].first_column,last_column:r[r.length-1].last_column},h&&(x._$.range=[r[r.length-(_||1)].range[0],r[r.length-1].range[1]]),void 0!==(v=this.performAction.call(x,o,l,s,this.yy,g[1],n,r)))return v;_&&(i=i.slice(0,-2*_),n=n.slice(0,-1*_),r=r.slice(0,-1*_)),i.push(this.productions_[g[1]][0]),n.push(x.$),r.push(x._$),b=a[i[i.length-2]][i[i.length-1]],i.push(b);break;case 3:return!0}}return!0}},n=function(){return{EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,i=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var i,n,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),n=e[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],i=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var a in r)this[a]=r[a];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,i,n;this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),a=0;a<r.length;a++)if((i=this._input.match(this.rules[r[a]]))&&(!t||i[0].length>t[0].length)){if(t=i,n=a,this.options.backtrack_lexer){if(!1!==(e=this.test_match(i,r[a])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,r[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return e=this.conditionStack.length-1-Math.abs(e||0),e>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(e,t,i,n){switch(i){case 0:return 8;case 1:case 2:break;case 3:return 9;case 4:return 20;case 5:return 21;case 6:return 17;case 7:return 15;case 8:return 13;case 9:return 19;case 10:return 23;case 11:return 27;case 12:return 26;case 13:return 29;case 14:return 28;case 15:return 30;case 16:return 5;case 17:return"INVALID"}},rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:participant\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:title\b)/i,/^(?:,)/i,/^(?:[^\->:\n,]+)/i,/^(?:--)/i,/^(?:-)/i,/^(?:>>)/i,/^(?:>)/i,/^(?:[^#\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17],inclusive:!0}}}}();return i.lexer=n,t.prototype=i,i.Parser=t,new t}();"undefined"!=typeof require&&"undefined"!=typeof exports&&(exports.parser=n,exports.Parser=n.Parser,exports.parse=function(){return n.parse.apply(n,arguments)},exports.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),process.exit(1));var t=require("fs").readFileSync(require("path").normalize(e[1]),"utf8");return exports.parser.parse(t)},"undefined"!=typeof module&&require.main===module&&exports.main(process.argv.slice(1))),t.prototype=new Error,e.ParseError=t,n.parseError=function(e,i){throw new t(e,i)},e.parse=function(t){return n.yy=new e,n.parse(t)},this.Diagram=e}).call(this),"undefined"!=typeof jQuery&&function(e){e.fn.sequenceDiagram=function(t){return this.each(function(){var i=e(this),n=Diagram.parse(i.text());i.html(""),n.drawSVG(this,t)})}}(jQuery),t.registerFont({w:209,face:{"font-family":"daniel","font-weight":700,"font-stretch":"normal","units-per-em":"360","panose-1":"2 11 8 0 0 0 0 0 0 0",ascent:"288",descent:"-72","x-height":"7",bbox:"-92.0373 -310.134 632 184.967","underline-thickness":"3.51562","underline-position":"-21.6211","unicode-range":"U+0009-U+F002"},glyphs:{" ":{w:179},"\t":{w:179},"!":{d:"66,-306v9,3,18,11,19,24v-18,73,-20,111,-37,194v0,10,2,34,-12,34v-12,0,-18,-9,-18,-28v0,-85,23,-136,38,-214v1,-7,4,-10,10,-10xm25,-30v15,-1,28,34,5,35v-11,-1,-38,-36,-5,-35",w:115},'"':{d:"91,-214v-32,3,-25,-40,-20,-68v3,-16,7,-25,12,-27v35,13,14,56,8,95xm8,-231v4,-31,1,-40,18,-75v37,7,11,51,11,79v-3,3,-4,8,-5,13v-17,4,-16,-10,-24,-17",w:117},"#":{d:"271,-64v-30,26,-96,-7,-102,51v-6,2,-13,2,-24,-2v-2,-11,10,-21,2,-28v-14,5,-48,0,-48,22v0,23,-11,14,-29,10v-7,-6,6,-19,-1,-24r-32,4v-19,-8,-15,-24,5,-28r33,-6v4,0,24,-23,11,-27v-26,0,-63,14,-74,-10v3,-1,9,-17,16,-10v15,-8,81,4,89,-30v8,-14,16,-34,24,-38v23,9,24,38,5,49v37,24,55,-38,72,-43v19,10,20,23,-1,45v2,8,23,1,29,4v3,3,6,6,10,11v-14,13,-20,12,-45,12v-17,0,-16,17,-19,29v18,-7,49,3,67,-2v4,0,8,4,12,11xm161,-104v-30,-1,-44,10,-44,37v14,1,24,0,40,-5v0,-1,3,-10,8,-26v0,-4,-1,-6,-4,-6",w:285},$:{d:"164,-257v29,4,1,42,-3,50v5,5,38,13,41,24v8,4,6,15,-2,21v-18,3,-36,-17,-49,-17v-17,1,-31,40,-28,48v5,4,8,8,9,10v13,1,35,37,28,44v-10,21,-36,20,-65,28v-10,10,-12,40,-17,51v-9,-3,-28,1,-18,-17v0,-13,5,-24,-1,-35v-18,1,-59,-10,-42,-29v21,0,56,16,55,-16v5,-4,9,-18,9,-26v-14,-15,-55,-41,-53,-65v2,-33,56,-19,98,-26v10,-14,31,-43,38,-45xm93,-152v11,-10,15,-15,14,-29v-17,-3,-37,1,-43,6v10,12,20,19,29,23xm111,-103v-8,1,-11,12,-10,22v10,0,28,2,27,-8v0,-4,-13,-15,-17,-14",w:225},"%":{d:"181,-96v24,-7,67,-13,104,1v14,18,21,19,22,44v-13,43,-99,61,-146,36v-9,-9,-22,-11,-32,-29v0,-27,24,-53,52,-52xm139,-185v-9,68,-138,73,-131,-5v0,-3,3,-9,9,-17v13,1,27,1,17,-16v5,-39,63,0,93,-6v36,1,80,-9,102,11v15,32,12,32,-8,56v-16,21,-103,78,-152,125r-14,28v-23,11,-25,-7,-29,-20v34,-71,133,-98,171,-162v-13,-12,-52,-5,-61,1v0,1,1,3,3,5xm38,-190v0,34,55,29,70,8v0,-14,-20,-11,-32,-14v-14,-3,-24,-9,-40,-10v1,0,5,11,2,16xm172,-53v12,27,90,18,102,-5v-18,-7,-32,-10,-40,-10v-29,3,-57,-4,-62,15",w:308},"&":{d:"145,-82v17,-8,47,-15,71,-26v13,2,25,12,9,23v-23,7,-40,16,-53,27r0,6v13,8,30,21,36,38v0,8,-4,12,-11,12v-19,0,-43,-39,-59,-44v-30,12,-65,29,-97,32v-32,3,-45,-41,-23,-63v21,-20,52,-26,70,-48v-4,-31,-12,-47,9,-73v13,-16,20,-29,23,-39v15,-15,32,-22,51,-22v30,9,62,64,32,96v-2,3,-47,42,-69,48v-15,8,-11,9,0,22v6,7,10,11,11,11xm114,-138v25,-13,62,-38,74,-62v0,-9,-10,-31,-20,-29v-28,7,-60,42,-60,75v0,10,2,15,6,16xm99,-91v-18,10,-54,18,-59,45v26,5,61,-12,77,-22v-1,-5,-13,-23,-18,-23",w:253},"'":{d:"36,-182v-36,7,-34,-61,-17,-80v15,1,21,19,21,20r-1,-1v0,0,-1,12,-5,35v1,5,3,17,2,26",w:63},"(":{d:"130,-306v13,2,23,43,-1,43v-49,43,-77,77,-90,148v5,49,27,67,64,101v4,14,5,6,2,19r-15,0v-35,-17,-79,-58,-79,-120v0,-58,66,-176,119,-191",w:120},")":{d:"108,-138v-2,73,-48,120,-98,153v-17,-5,-16,-20,-6,-31v52,-64,73,-62,74,-135v1,-42,-40,-98,-58,-128v0,-5,-1,-12,-2,-22v18,-18,25,0,42,27v25,39,50,66,48,136",w:120},"*":{d:"121,-271v15,-5,36,-8,40,9v-5,10,-31,19,-47,31v0,11,34,43,14,53v-18,8,-24,-24,-34,-20v-4,10,-4,19,-12,41v-25,7,-15,-30,-17,-47v-13,-1,-17,9,-46,30r-10,0v-20,-32,37,-43,54,-64v-10,-11,-36,-33,-16,-51v3,0,14,8,33,24v8,-10,26,-39,32,-42v14,7,15,23,9,36",w:177},"+":{d:"163,-64v-7,22,-65,2,-77,21v-2,10,-6,21,-11,35v-20,4,-21,-12,-19,-29v3,-23,-44,6,-39,-27v-8,-22,36,-8,49,-18v8,-13,6,-36,24,-40v19,-4,14,32,11,39v18,3,19,2,54,8v2,1,5,5,8,11",w:170},",":{d:"25,63v-26,21,-48,-2,-22,-24v14,-12,35,-40,35,-69v3,-2,3,-11,12,-9v35,17,5,88,-25,102",w:97},"-":{d:"57,-94v19,4,55,-5,54,17v-15,23,-54,20,-91,15v-4,2,-13,-10,-11,-16v-1,-22,28,-15,48,-16",w:124},".":{d:"40,-48v21,20,21,44,-4,44v-33,0,-26,-24,-10,-44r14,0",w:67},"/":{d:"21,20v-22,-45,21,-95,41,-126v38,-57,115,-158,193,-201v2,0,4,3,7,11v11,29,-15,34,-25,55v-81,56,-189,208,-197,261r-19,0",w:275},0:{d:"78,-237v70,-47,269,-41,270,59v0,34,-11,53,-29,76v-13,35,-30,32,-85,64v-6,2,-10,6,-7,8v-73,14,-98,38,-173,1v-7,-13,-52,-48,-46,-88v9,-57,27,-75,70,-120xm123,-38v100,0,202,-46,195,-153v-32,-55,-144,-73,-211,-35v-16,34,-68,54,-53,108v6,25,1,22,-3,39v6,24,41,41,72,41",w:353},1:{d:"39,-208v0,-14,6,-59,29,-39v3,4,6,13,10,24r-22,128r8,87v-4,6,-9,3,-16,2v-44,-38,-9,-137,-9,-202",w:93},2:{d:"88,-35v47,-10,119,-24,168,-9v0,12,-23,13,-35,16v1,1,3,1,5,1v-74,8,-118,23,-194,23v-14,0,-20,-13,-21,-28v55,-40,83,-61,123,-104v26,-13,65,-67,71,-102v-1,-9,-11,-16,-22,-16v-20,-1,-120,29,-156,49v-10,-2,-30,-20,-10,-28v50,-21,111,-51,178,-48v25,10,44,22,36,39v12,30,-19,64,-34,83v-39,48,-37,39,-115,109v0,5,-3,8,-8,11v4,3,8,4,14,4",w:265},3:{d:"188,-282v34,-10,74,25,47,51v-19,32,-55,50,-92,70v28,14,116,25,108,70v8,14,-49,40,-63,48v-29,9,-130,22,-168,42v-6,-5,-19,-7,-12,-22v56,-36,175,-21,210,-76v-9,-20,-88,-42,-97,-33v-20,-1,-41,2,-56,-7r5,-21v56,-25,103,-36,137,-78v1,-1,2,-5,4,-11v-15,-14,-56,7,-79,0v-10,9,-73,22,-92,31v-11,-4,-28,-23,-13,-30v50,-22,96,-26,154,-37v0,-1,8,3,7,3",w:260},4:{d:"79,-249v-7,17,-29,75,-33,96v0,6,3,8,8,8v43,-2,111,6,141,-6v17,-47,20,-100,63,-148v9,4,16,7,21,10v-17,31,-44,95,-51,141v7,4,24,-4,23,10v-1,16,-29,12,-31,23v-10,22,-9,69,-7,103v-3,2,-7,5,-10,9v-47,-11,-23,-74,-16,-114v0,-4,-2,-6,-7,-6v-65,2,-89,13,-162,4v-22,-22,-2,-53,5,-76v16,-15,17,-57,35,-70v6,-1,21,11,21,16",w:267},5:{d:"185,-272v30,7,45,-8,53,18v1,16,-17,18,-34,14v0,0,-95,-11,-129,1v-6,9,-24,33,-29,54v76,10,171,5,214,47v11,11,22,30,5,52v-14,12,-30,14,-34,27v-26,11,-141,63,-157,60v-16,-2,-25,-19,-4,-27v48,-18,128,-39,170,-86v4,-14,-65,-41,-85,-41r-92,0v-10,-4,-66,-1,-57,-23v0,-23,23,-51,35,-83v11,-28,133,-10,144,-13",w:284},6:{d:"70,-64v9,-51,63,-74,123,-71v43,2,109,3,111,41r-25,47v0,1,1,2,2,3v-5,0,-39,10,-41,20v-15,3,-22,4,-22,11v-39,1,-77,20,-119,13v-42,-7,-35,-9,-77,-46v-56,-118,94,-201,176,-229v7,0,21,8,20,15v-2,17,-23,15,-43,24v-69,31,-119,72,-134,145v-5,25,36,68,78,64v59,-6,128,-18,153,-61v-7,-14,-13,-9,-32,-21v-67,-15,-118,-5,-150,43r0,12v-13,4,-17,-3,-20,-10",w:310},7:{d:"37,-228v33,-14,173,-17,181,-19v28,-1,24,31,9,45v-17,15,-45,49,-59,69v-17,26,-55,67,-61,113v-10,13,-9,14,-14,20v-33,-13,-20,-25,-11,-53v16,-48,73,-115,109,-156v2,-7,5,-14,-10,-12v-26,4,-54,6,-76,13v-23,-5,-83,31,-94,-9v2,-8,18,-19,26,-11",w:245},8:{d:"57,-236v40,-50,166,-51,213,-10v22,28,10,63,-22,78r-35,17v8,5,54,24,53,44v-5,14,-4,33,-18,42v-13,13,-35,18,-44,34v-60,27,-190,49,-194,-42v7,-41,17,-54,59,-70r0,-4v-32,-9,-73,-62,-26,-85v4,0,8,-2,14,-4xm142,-160v24,-2,160,-31,99,-72v-28,-18,-108,-33,-146,-5v-16,12,-28,30,-33,59v24,12,37,20,80,18xm41,-62v30,65,189,6,199,-37v3,-14,-60,-30,-74,-30v-70,0,-118,10,-125,67",w:290},9:{d:"11,-192v15,-49,119,-61,161,-23v16,15,27,55,11,79v-20,62,-51,79,-96,118v-10,4,-45,27,-50,6v9,-15,66,-52,98,-99v-7,-7,-8,-3,-25,0v-49,-11,-96,-25,-99,-81xm145,-131v7,-5,13,-34,13,-41v-2,-51,-104,-38,-114,-6v-2,10,37,35,46,35v23,1,43,-1,55,12",w:198},":":{d:"39,-125v15,-8,40,-1,40,15v0,15,-6,22,-19,22v-13,0,-29,-21,-21,-37xm66,-17v-8,27,-51,19,-46,-8v-1,-6,8,-22,14,-20v29,0,30,6,32,28",w:95},";":{d:"56,-93v2,-30,37,-22,40,2v0,2,-1,7,-3,15v-13,8,-15,6,-27,4xm64,-44v11,-11,30,-4,32,14v-21,39,-63,71,-92,85v-5,0,-11,-2,-18,-8v11,-23,36,-36,50,-61v11,-7,19,-20,28,-30",w:107},"<":{d:"166,-202v12,0,29,15,24,29v0,4,-119,64,-120,73v15,21,89,64,91,86v2,29,-18,12,-30,15v-27,-29,-59,-54,-95,-75v-18,-10,-25,-13,-24,-41",w:176},"=":{d:"125,-121v18,7,55,-9,69,14v0,17,-45,26,-135,26v-18,0,-27,-7,-27,-21v-1,-37,60,-5,93,-19xm138,-71v20,0,48,-1,50,16v-13,24,-86,32,-131,29v-29,-2,-43,-10,-43,-24v-7,-23,36,-14,39,-17v27,6,57,-4,85,-4",w:196},">":{d:"4,-14v20,-48,77,-59,118,-94v-16,-19,-58,-52,-81,-75v-11,-7,-15,-38,-1,-40v33,16,83,71,121,105v26,23,-6,35,-41,53v-29,16,-56,28,-73,54v-21,15,-16,20,-34,15v-3,0,-9,-16,-9,-18",w:174},"?":{d:"105,-291v57,-13,107,-4,107,39v0,67,-136,85,-155,137v-1,6,10,23,-4,23v-23,1,-33,-35,-23,-57v31,-41,124,-60,149,-103v-8,-21,-72,-5,-88,-1v-23,6,-59,39,-71,8v0,0,-1,0,1,-17v10,-4,45,-20,84,-29xm80,-25v-6,4,-8,39,-24,22v-24,3,-22,-21,-13,-35v17,-7,29,5,37,13",w:216},"@":{d:"218,-207v23,8,42,14,47,37v44,68,-27,137,-87,85r1,0v0,2,-59,19,-61,17v-35,0,-42,-47,-17,-68r0,-4v-19,-1,-45,37,-49,40v-37,76,58,72,121,62v11,-2,34,-13,36,3v-14,31,-69,31,-114,33v-51,2,-99,-41,-80,-92v2,-30,22,-40,42,-63v35,-20,91,-53,161,-50xm217,-101v23,0,35,-19,35,-41v0,-43,-75,-41,-102,-19v36,3,55,16,62,41v-6,5,-6,19,5,19xm127,-110v8,5,51,-15,28,-16v-4,0,-25,4,-28,16",w:291},A:{d:"97,-81v-23,-10,-39,38,-52,60v-8,6,-8,6,-22,18v-22,-7,-23,-37,-4,-49v7,-8,11,-15,15,-23r-1,1v-14,-26,23,-29,31,-40v1,-1,15,-29,26,-36v17,-31,39,-58,54,-92v16,-20,20,-51,41,-66v29,5,34,62,45,92v9,64,21,103,49,155v-3,25,-44,11,-54,0v-34,-12,-97,-29,-128,-20xm107,-118v20,6,80,10,111,17v6,-7,-4,-15,-7,-24v-11,-28,-9,-92,-30,-117v-9,9,-19,44,-34,55v-9,23,-27,40,-40,69",w:294},B:{d:"256,-179v41,10,115,34,91,91v-6,3,-14,12,-19,20v-37,19,-50,34,-63,25v-9,10,-12,11,-34,13r3,-3v-4,-4,-12,-4,-18,0v0,0,2,2,5,4v-21,14,-26,6,-44,15v-4,0,-7,-2,-8,-5v-6,11,-20,-5,-18,11v-36,4,-91,35,-114,4v-7,-62,-10,-138,4,-199v-1,-19,-37,2,-37,-27v0,-8,2,-13,6,-15v68,-31,231,-92,311,-39v8,12,12,20,12,25v-8,42,-32,49,-77,80xm79,-160v72,-17,135,-39,184,-70v20,-13,31,-23,31,-27v1,-6,-30,-13,-38,-12v-54,0,-116,13,-186,41v11,21,1,48,9,68xm262,-43v0,-4,3,-6,-4,-5v0,1,1,2,4,5xm211,-140v-34,7,-94,24,-139,15v-6,20,-4,56,-4,82v0,29,43,1,56,2v48,-11,108,-25,154,-48v20,-10,32,-17,32,-25v0,-18,-33,-26,-99,-26xm195,-20v6,1,6,-2,5,-7v-3,2,-7,2,-5,7",w:364},C:{d:"51,-114v-12,75,96,76,166,71r145,-10v9,2,9,5,9,18v-37,18,-85,28,-109,22v-18,10,-47,10,-71,10v-29,0,-68,1,-105,-11v-6,-1,-10,-3,-10,-8v-33,-13,-48,-33,-66,-59v-19,-114,146,-150,224,-177v35,0,88,-31,99,7v-1,29,-49,14,-76,28v-55,8,-115,35,-175,71v-13,8,-23,21,-31,38",w:376},D:{d:"312,-78v-2,1,-3,7,-10,5v6,-3,10,-4,10,-5xm4,-252v2,-27,83,-38,106,-39v130,-7,267,1,291,109v0,0,-2,8,-3,25v-5,9,-4,28,-23,34v-4,4,-2,5,-7,0v-3,3,-15,7,-5,10v0,0,-10,14,-13,2v-11,1,-8,5,-20,14v1,2,7,3,9,1v-4,13,-22,13,-11,4v0,-3,1,-6,-3,-5v-40,29,-103,38,-141,65v10,6,22,-7,34,-3v-41,20,-127,44,-171,46v-21,1,-47,-33,-11,-39v15,-2,43,-6,56,-11v-16,-101,-5,-130,9,-207v2,0,4,-1,6,-3v-16,-17,-91,38,-103,-3xm297,-69v-7,3,-17,8,-25,7v1,1,3,2,5,2v-4,2,-11,5,-23,9v4,-11,30,-21,43,-18xm240,-51v10,0,12,2,0,6r0,-6xm220,-36v-1,-3,4,-6,6,-3v0,1,-2,1,-6,3xm125,-48v16,6,137,-46,155,-53v29,-18,101,-44,82,-93v-21,-53,-84,-61,-168,-67v-20,7,-50,3,-77,8v33,54,-12,132,8,205xm159,-22v-4,-1,-15,-5,-15,2v7,-1,12,-2,15,-2",w:381},E:{d:"45,-219v-19,-36,34,-41,63,-36v44,-10,133,-8,194,-15v3,2,38,11,52,15v-73,19,-171,21,-246,38v-9,11,-16,32,-20,61v35,11,133,-6,183,3v1,6,2,7,3,14v-46,24,-118,16,-193,27v-15,13,-22,52,-22,66v60,1,121,-20,188,-20v22,10,53,-7,74,5v16,29,-23,26,-43,32v-73,4,-139,13,-216,27r-52,-10v-4,-22,23,-69,26,-98v-3,0,-10,-15,-12,-24v20,-12,34,-23,35,-67v2,-1,5,-5,5,-7v0,-4,-14,-11,-19,-11",w:353},F:{d:"270,-258v13,2,59,6,48,34v-78,-3,-143,1,-212,22v-10,16,-21,43,-24,69r145,-9v8,3,29,-3,16,21v-14,-1,-59,13,-60,7v-12,13,-67,18,-108,21v-2,1,-4,3,-7,6v-2,23,-8,43,-7,69v1,28,-30,11,-40,5r10,-80r-26,-14v5,-10,10,-33,28,-25v21,-3,15,-46,26,-59v-1,-3,-32,-13,-28,-24v2,-22,45,-16,59,-30v47,4,99,-14,151,-9v5,-3,25,-3,29,-4",w:236},G:{d:"311,-168v53,0,94,57,74,110v-31,37,-71,34,-136,52v-13,-7,-41,10,-57,7v-73,-1,-122,-17,-162,-59v-49,-51,-24,-80,5,-130v35,-61,138,-93,214,-106v16,4,42,-1,40,21v-5,40,-39,2,-73,21v-76,19,-162,65,-177,142v28,103,237,76,312,29v2,-3,3,-7,3,-13v-10,-35,-37,-43,-87,-45v-16,-13,-53,-9,-78,1v-4,-3,-5,-7,-5,-11v17,-29,73,-17,108,-24v12,4,18,5,19,5",w:391},H:{
|
||
d:"300,-268v18,12,19,32,4,51v-35,44,-34,140,-46,217v-1,5,-5,13,-11,12v-6,1,-19,-14,-18,-27r7,-106v-28,7,-76,22,-116,14v-18,2,-36,6,-55,3v-43,-8,-14,53,-33,75v-29,1,-26,-67,-21,-97v5,-31,28,-73,43,-98v2,2,7,3,14,3v13,33,-11,48,-13,78v61,4,118,2,176,2v8,0,13,-6,15,-20v4,-47,21,-87,54,-107",w:288},I:{d:"63,-266v34,10,-4,105,-8,128r-24,126v-2,2,-3,1,-9,6v-12,-10,-12,-15,-12,-47v0,-93,9,-156,28,-188v10,-17,19,-25,25,-25",w:79},J:{d:"235,-291v26,11,31,104,31,142v0,37,-2,95,-32,126v-33,34,-121,26,-167,1v-18,-11,-54,-29,-59,-59v0,-3,5,-15,16,-14v31,36,90,57,162,51v63,-30,56,-148,32,-226v-1,-16,11,-13,17,-21",w:282},K:{d:"212,-219v17,-5,80,-60,80,-19v0,9,-2,14,-5,16r-132,78v-34,23,-54,32,-21,50v39,21,74,23,124,41v5,2,7,5,7,9v-4,24,-55,15,-79,8v-67,-19,-98,-36,-116,-83v9,-24,38,-35,66,-61v7,-4,49,-30,76,-39xm47,-194v11,-20,11,-45,31,-55v2,2,4,3,6,0v29,39,-21,96,-18,128v-17,24,-15,62,-29,113v-4,3,-10,7,-19,11v-12,-13,-10,-28,-8,-53v3,-31,17,-79,37,-144",w:270},L:{d:"84,-43v58,0,179,-27,242,-4v3,17,-29,24,-40,26v-85,-4,-202,46,-268,3v-24,-16,-2,-33,-4,-57v26,-76,38,-108,86,-191v14,-7,26,-50,45,-32v6,22,5,31,-12,46v-20,39,-50,82,-67,142v-7,6,-19,46,-19,54v0,9,12,13,37,13",w:331},M:{d:"174,-236v-1,52,-11,92,-7,143v10,5,15,-12,22,-18v42,-55,90,-130,136,-174r15,-18v42,2,32,53,11,80v-12,58,-54,143,-34,210v0,3,-3,12,-9,10v-31,-5,-32,-57,-27,-92v4,-27,12,-58,25,-93v-5,-10,5,-19,6,-30v-46,44,-66,110,-129,172v-11,10,-18,15,-22,15v-34,6,-28,-103,-28,-152v-28,22,-65,119,-96,170v-9,15,-34,3,-31,-19v30,-64,91,-177,139,-229v12,-1,29,13,29,25",w:343},N:{d:"248,-20v-3,17,-37,18,-43,3v-24,-35,-53,-145,-80,-203v-32,40,-55,120,-92,174v-13,3,-26,-13,-27,-22r87,-171v4,-13,20,-57,42,-32v42,48,46,139,82,198v29,-45,46,-88,65,-153v12,-19,23,-42,38,-60v27,-1,14,18,4,44v-6,46,-32,68,-37,121v-15,29,-33,69,-39,101",w:307},O:{d:"240,-268v85,1,163,29,150,125v13,7,-12,18,-5,26v-23,63,-133,112,-228,124v-80,-16,-171,-56,-148,-153v11,-47,20,-43,53,-83v17,-9,39,-22,73,-29v45,-10,81,-10,105,-10xm363,-156v16,-51,-62,-85,-111,-79v-25,-11,-50,8,-81,0v-15,10,-70,16,-85,31v6,20,-27,24,-39,45v-42,75,40,128,115,128v56,0,209,-71,201,-125",w:383},P:{d:"70,-225v-7,-12,-36,16,-49,19v-4,0,-9,-5,-14,-17v21,-47,114,-55,172,-59v41,-3,132,33,99,87v-21,34,-72,59,-144,80v-2,16,-79,3,-74,46v3,25,-5,47,-10,68v-22,-1,-23,-29,-22,-56v2,-25,-20,-32,-8,-50v21,-5,10,-35,25,-57v6,-28,14,-48,25,-61xm71,-229v47,14,-2,50,-1,99v41,-3,113,-37,173,-76v5,-9,8,-14,8,-15v-28,-47,-125,-29,-180,-8",w:252},Q:{d:"374,-217v20,59,-11,127,-48,156r30,38v-1,6,-8,16,-14,9v-3,0,-19,-9,-47,-26v-72,35,-173,75,-236,12v-70,-40,-67,-213,26,-217r8,5v24,-20,72,-48,112,-38v21,-4,22,-1,50,-2v66,-2,94,20,119,63xm296,-88v13,5,61,-49,63,-84v4,-62,-54,-78,-119,-76v-14,-6,-49,5,-71,3v-42,16,-89,41,-93,94v-9,11,1,25,-7,38v-12,-19,-7,-67,-1,-88v-56,30,-37,137,19,155v27,17,92,19,119,0v12,-2,29,-9,52,-20v2,-2,3,-3,3,-6v-11,-12,-46,-27,-54,-56v0,-13,3,-19,9,-19v18,1,60,52,80,59",w:379},R:{d:"100,-275v96,-23,196,-10,208,78v-3,18,-17,52,-49,62v-14,20,-54,23,-79,40v-2,0,-14,2,-36,6v-40,8,-30,14,-3,33v37,27,52,30,118,55v16,6,31,23,12,27v-58,-2,-104,-29,-143,-61v-14,-3,-16,-15,-39,-27v-23,-19,-28,-12,-15,-38v63,-19,111,-15,163,-53v27,-20,43,-36,43,-49v0,-64,-120,-62,-173,-38v-9,4,-38,9,-40,18v-10,32,-16,70,-13,116v-10,21,-8,47,-6,75v2,31,-9,29,-27,22v-9,-55,5,-140,15,-190v-8,-6,-24,10,-24,-11v0,-34,16,-34,42,-55v2,-1,17,-4,46,-10",w:297},S:{d:"13,-3v-7,-3,-22,-18,-5,-22v68,-15,119,-32,154,-45v51,-19,39,-34,3,-53v-46,-25,-82,-30,-121,-64v-33,-29,-50,-35,-25,-58v37,-20,119,-29,181,-29v29,0,44,6,44,18v-9,26,-62,6,-104,14v-17,2,-72,6,-92,16v37,53,132,58,180,111v8,9,11,20,11,30v-4,17,-23,35,-42,34v-21,16,-17,1,-49,17v-14,7,-41,9,-56,20v-25,-3,-49,10,-79,11",w:234},T:{d:"141,-3v-36,-6,1,-49,-3,-79v10,-19,6,-35,15,-64r26,-85v-51,-9,-100,10,-141,14v-16,2,-30,-26,-11,-32v26,-8,143,-8,179,-19r12,6v67,-2,142,-1,200,-1v8,0,14,3,19,10v-18,16,-74,3,-103,14v-48,-4,-60,4,-113,7v-42,22,-36,130,-58,187v1,12,-9,44,-22,42",w:277},U:{d:"365,-262v13,56,-22,104,-36,141v-19,22,-30,38,-57,56v-4,18,-60,35,-78,50v-53,28,-142,0,-161,-34v-31,-56,-37,-108,-11,-164v17,-33,29,-50,48,-29v-2,2,-3,7,-4,13v-44,36,-38,149,7,174v30,26,55,19,102,4v56,-17,66,-34,120,-76v12,-24,56,-68,46,-122r0,-16v0,1,-1,3,-1,6v4,-13,11,-10,25,-3",w:368},V:{d:"246,-258v21,-22,31,-26,44,-8v1,1,-12,22,-28,35v-15,25,-41,38,-56,69v-13,15,-20,31,-28,57v-15,13,-11,29,-27,72v3,21,-5,24,-27,27v-33,-45,-54,-118,-84,-167v-5,-26,-18,-50,-25,-76v-3,-12,24,-8,29,-5v8,13,18,52,26,70r52,115v9,-2,4,-9,10,-21r25,-47v25,-44,46,-76,89,-121",w:234},W:{d:"31,-213v16,46,17,106,41,151v31,-35,49,-89,76,-127v30,-15,39,27,52,56v10,22,21,48,35,67v2,0,4,-1,5,-3v16,-28,50,-76,79,-121v14,-21,40,-63,64,-83r5,8v-30,58,-76,110,-97,173v-18,28,-25,37,-33,63v-11,1,-16,25,-30,15v-21,-31,-44,-89,-62,-131v0,-2,-1,-3,-5,-5v-17,11,-16,36,-31,50v-20,33,-20,84,-68,94v-24,-19,-23,-81,-39,-111v-1,-15,-29,-94,-10,-108v9,2,12,5,18,12",w:331},X:{d:"143,-183v43,-25,69,-36,126,-62v22,-10,86,-10,56,21v-51,3,-158,61,-154,64v10,15,41,30,50,52v27,17,46,60,70,82v9,14,-6,30,-24,20v-35,-43,-75,-100,-116,-132v-48,13,-100,47,-118,94v-1,49,-26,34,-27,4v-1,-26,13,-27,17,-48v22,-27,68,-55,90,-77v-9,-12,-60,-39,-79,-57v-6,-10,-6,-25,12,-25",w:312},Y:{d:"216,-240v19,-14,42,10,22,26v-54,66,-121,109,-156,197v-8,21,-11,15,-30,4v3,-37,27,-61,33,-76v12,-12,15,-19,32,-42v-8,-6,-40,5,-45,5v-48,-6,-69,-65,-56,-113v14,0,13,-1,24,7v2,33,12,75,42,73v36,-2,102,-57,134,-81",w:189},Z:{d:"60,-255v66,12,200,-34,240,21v-13,42,-63,62,-98,89v-19,15,-47,33,-82,55v-25,16,-47,32,-66,47v58,24,129,-6,208,-6v23,0,36,12,13,19v-33,2,-53,5,-86,10v-32,18,-88,15,-135,15v-9,-1,-55,-1,-48,-29v1,-24,30,-24,40,-41v64,-50,151,-86,208,-147v-38,-17,-155,12,-198,-4v0,0,-11,-33,4,-29",w:310},"[":{d:"72,-258r-15,250v30,4,55,-3,80,-6v7,-1,8,17,9,23v-28,15,-73,23,-121,21v-7,0,-10,-6,-10,-17v0,-60,25,-193,22,-288v0,-16,13,-20,33,-19v9,-3,34,-12,51,-12v16,0,15,16,19,29v-16,7,-48,10,-68,19",w:151},"\\":{d:"21,38v-20,-21,9,-72,13,-90v44,-78,113,-189,200,-253v2,0,5,4,7,12v11,31,-13,36,-24,58v-74,61,-174,219,-180,273r-16,0",w:257},"]":{d:"133,-258v-23,-13,-84,6,-85,-32v0,-10,5,-15,14,-15v0,0,30,2,90,7v10,1,15,13,15,36v2,7,-8,59,-13,112r-11,125v-9,48,9,90,-59,71v-20,-4,-39,-1,-59,-4v-5,-10,-25,-12,-14,-30v8,-3,61,-13,78,-8v14,1,8,-7,10,-17v15,-69,21,-166,34,-245",w:171},"^":{d:"68,-306v20,15,47,36,58,60v-1,4,0,7,-9,7v-26,0,-47,-38,-49,-32v-15,9,-41,50,-54,30v-2,-31,17,-23,33,-51v8,-9,15,-14,21,-14",w:135},_:{d:"11,15v-8,33,18,45,50,34r205,2r197,-5v11,-5,14,-9,7,-28v-95,-21,-258,-10,-376,-10v-25,0,-72,-3,-83,7",w:485},"`":{d:"75,-264v16,8,56,14,39,43v-30,-8,-65,-23,-105,-44v-1,-3,-3,-28,5,-25v16,5,44,17,61,26",w:129},a:{d:"124,-56v10,4,59,41,65,50v1,7,-6,17,-12,17r-60,-30v-22,2,-42,21,-65,19v-33,4,-68,-67,-15,-81v41,-27,96,-39,110,9v0,6,-4,12,-11,16v-33,-25,-67,-5,-88,12v10,16,61,-18,76,-12",w:196},b:{d:"80,-140v69,1,123,0,134,52v5,26,-71,71,-97,70v-11,11,-88,22,-94,22v-11,-3,-26,-18,-6,-24v19,-5,-2,-19,-1,-35v1,-18,11,-36,-5,-47v-6,-17,-6,-21,14,-32v6,-45,18,-89,28,-124v2,-7,8,-12,17,-15v5,3,10,11,16,28v-12,27,-13,63,-23,96v0,6,6,9,17,9xm87,-107v-40,-9,-31,31,-39,54v8,15,0,25,12,22v30,-8,60,-18,88,-32v39,-18,49,-33,-1,-42v-20,-4,-45,-7,-60,-2",w:217},c:{d:"128,-123v29,-7,37,29,12,33v-27,-4,-40,6,-79,25v-8,4,-13,11,-16,22v30,32,91,3,134,11v5,13,-8,26,-22,19v-51,25,-139,28,-150,-30v6,-50,69,-82,121,-80",w:194},d:{d:"224,-201v0,-35,-17,-111,24,-94v7,86,-2,119,0,197v-4,2,-8,21,-18,16v-62,-7,-154,-8,-185,29v6,17,28,26,51,26v16,0,100,-15,132,-18v7,5,-6,20,-10,22v-24,8,-122,42,-163,25v-32,-5,-62,-53,-36,-80v35,-37,118,-46,198,-43v1,-22,7,-49,7,-80",w:265},e:{d:"4,-57v0,-58,51,-71,110,-74v33,-1,45,16,59,35v1,14,2,39,-7,42v-24,-2,-73,13,-99,11v-2,2,-2,3,-2,3v0,3,12,8,37,15v21,0,69,9,31,22v-9,14,-34,6,-56,6v-27,-5,-73,-28,-73,-60xm123,-102v-22,2,-68,5,-65,26v24,-2,66,5,79,-6v-5,-13,-1,-13,-14,-20",w:182},f:{d:"6,-59v6,-29,53,-4,53,-43v0,-64,29,-118,84,-150v45,-25,167,-24,155,51v-1,2,-7,6,0,6r-10,2v-45,-58,-165,-39,-186,39v-7,26,-11,42,-9,62v44,8,95,-21,135,-7v-12,25,-39,21,-76,30v-19,5,-18,7,-54,19v-2,8,15,32,17,35v-6,25,-26,26,-40,-5r-15,-24v-41,10,-44,12,-54,-15",w:234},g:{d:"132,-97v30,27,21,75,30,117v-12,31,-11,66,-36,103v-32,46,-105,83,-167,39v-31,-21,-49,-29,-51,-75v-2,-37,77,-50,121,-57v37,-6,68,-10,95,-11v7,-6,3,-32,4,-46v0,0,-1,1,-1,2v0,-18,-5,-31,-14,-45v-44,5,-79,20,-94,-18v3,-54,73,-54,125,-50v12,7,12,13,4,25v-30,-11,-76,8,-90,20v23,3,50,-16,74,-4xm-34,121v60,53,168,1,159,-86v-47,-7,-93,24,-142,30v-12,7,-45,19,-42,29v0,10,8,19,25,27",w:188},h:{d:"100,-310v11,-2,10,19,11,20v-11,52,-40,133,-53,189v-6,30,-9,37,-9,47v27,0,113,-34,143,-34v42,0,31,47,39,79v0,4,-5,17,-16,16v4,2,11,3,4,6v-24,-1,-28,-34,-25,-64v-1,-1,-2,-3,-5,-5v-51,0,-110,38,-162,51v-9,1,-15,-15,-16,-23v17,-89,39,-141,71,-264v0,-9,6,-19,18,-18",w:251},i:{d:"62,-209v7,18,9,23,-5,38v-23,-6,-21,-18,-11,-36v2,0,8,-1,16,-2xm34,-7v-18,-21,-8,-73,-1,-106v7,-10,20,-8,23,6v-1,36,7,72,-2,104v-8,2,-8,0,-20,-4",w:80},j:{d:"88,-191v5,28,-18,40,-28,21v0,-20,12,-29,28,-21xm82,-99v28,-1,16,35,16,61v0,60,-19,150,-35,202v-12,8,-19,31,-35,16v-32,-7,-43,-19,-56,-44r2,-17v11,4,49,45,61,18v10,-55,27,-107,30,-171v0,-16,0,-59,17,-65",w:120},k:{d:"59,-66v33,26,114,37,155,62v8,-4,22,-2,19,-17v0,-4,-12,-11,-30,-24v-36,-25,-54,-22,-99,-33v14,-21,119,-13,103,-63r-16,-7r-123,47r25,-93v-3,-15,16,-49,18,-81v1,-15,-21,-14,-25,-3v-31,82,-49,168,-75,257v2,2,22,30,27,10v2,-5,4,-9,9,-11v4,-16,4,-15,12,-44",w:236},l:{d:"66,-300v21,-6,37,23,30,55v-10,51,-28,135,-28,208v0,11,6,36,-13,37v-29,-5,-30,-48,-25,-83r28,-177v-6,-17,1,-29,8,-40",w:102},m:{d:"348,-59v-2,21,0,57,3,73v-17,3,-30,-1,-32,-16v-8,-7,-5,-44,-13,-70v-35,3,-82,49,-111,70v-12,8,-40,4,-39,-15r2,-56v-1,-13,4,-28,-8,-29v-35,8,-79,72,-115,87v-6,2,-20,-18,-21,-22v1,-20,14,-105,39,-64r8,15v17,-14,72,-56,93,-54v27,3,49,40,43,80v24,-2,66,-55,124,-53v11,14,28,23,27,54",w:368},n:{d:"121,-136v37,6,62,54,62,111v0,32,-16,25,-31,17v-18,-30,-5,-45,-22,-85v-37,-13,-71,55,-92,65v-20,-3,-39,-39,-21,-62v2,-12,3,-15,11,-30v12,-8,20,11,29,12",w:194},o:{d:"108,-139v52,-24,104,18,104,63v0,59,-66,67,-114,83v-52,-2,-115,-50,-80,-105v23,-18,52,-35,90,-41xm45,-60v16,54,125,16,131,-23v-12,-59,-129,-8,-131,23",w:217},p:{d:"82,14v-10,12,-8,117,-24,142v-15,2,-19,0,-29,-13v0,-76,9,-113,22,-192v14,-27,35,-6,37,13v0,8,-3,21,-7,38v2,2,3,2,4,2v26,-9,116,-33,126,-72v-7,-17,-24,-33,-49,-31v-40,3,-116,13,-116,47v-5,7,-2,17,-16,20v-17,-12,-18,-20,-12,-38v8,-25,74,-61,110,-59v55,-15,113,15,118,70v-15,52,-84,79,-146,83v-5,0,-11,-4,-18,-10",w:251},q:{d:"144,-147v27,-8,89,-3,97,31v-9,29,-42,-4,-73,1v-32,6,-118,20,-111,49v0,7,13,13,21,13v21,0,78,-24,104,-34v2,0,9,8,22,21v1,1,1,2,1,5v-27,90,-22,70,-43,203v11,15,-15,54,-33,33v-6,-8,-10,-20,-3,-28v1,-72,5,-114,15,-172v-35,3,-35,10,-59,8v-41,-4,-98,-41,-56,-85v33,-34,59,-27,118,-45",w:248},r:{d:"242,-117v2,22,5,10,-14,23v-73,-7,-166,-23,-174,56v-8,6,-3,20,-8,36v-29,10,-40,-9,-33,-46v6,-31,7,-69,32,-55v58,-37,66,-42,175,-19v3,5,15,4,22,5",w:229},s:{d:"154,-151v19,1,27,24,13,32v-4,1,-22,4,-53,7v-16,8,-22,-2,-39,9v23,21,89,16,96,62v-13,24,-85,35,-124,42v-9,-3,-18,-3,-27,0v-6,-4,-21,-16,-8,-25v30,-6,83,-13,102,-24v-17,-16,-80,-33,-97,-48v-3,-2,-4,-7,-4,-15v-6,-6,3,-13,15,-18v22,-9,94,-23,126,-22",w:188},t:{d:"85,-150v10,-41,35,-126,65,-134v4,1,24,19,11,36v-17,22,-29,57,-36,104v26,8,50,-7,73,5v14,0,22,3,22,9v-1,19,-44,18,-57,23v-10,1,-46,0,-54,10v-10,24,-4,67,-20,98v-21,-3,-26,1,-26,-20v0,-9,2,-36,8,-81v-15,-13,-81,9,-77,-27v4,-38,71,6,91,-23",w:194},u:{d:"207,-136v-1,-2,11,-14,14,-13v6,0,10,7,10,22v-3,40,-23,56,-40,82v-13,19,-62,43,-93,43v-67,-2,-111,-75,-71,-133v26,-3,21,29,19,49v-1,27,26,44,57,42v41,-2,93,-55,104,-92",w:242},v:{d:"24,-127r52,71v42,-16,70,-54,124,-65v5,4,8,7,8,11v-8,19,-4,8,-33,32v0,1,-1,3,-1,5v-61,45,-93,68,-97,68v-40,-15,-50,-72,-68,-100v6,-14,10,-22,15,-22",w:214},w:{d:"15,-139v38,-2,27,57,45,86v30,2,67,-66,101,-78v26,6,36,69,60,78v47,-35,51,-54,119,-104v3,0,7,-2,15,-4v19,23,-9,28,-21,49v-33,28,-68,90,-107,109v-10,6,-52,-47,-72,-71v-20,17,-85,74,-97,73v-38,7,-41,-98,-52,-122v0,-1,3,-7,9,-16",w:325},x:{d:"95,-124v22,-13,78,-32,99,-31v16,0,23,6,23,18v0,22,-17,11,-49,21v-3,0,-45,20,-42,24v0,1,2,4,8,10v20,24,49,41,44,80v-35,3,-27,-9,-60,-44v-40,-43,-37,-26,-79,9v-1,1,-2,3,-3,8v-12,8,-28,10,-27,-11v-6,-8,45,-65,48,-65v-17,-21,-61,-52,-24,-68v9,0,48,37,62,49",w:223},y:{d:"44,-65v22,33,70,4,99,-8v5,-4,28,-15,41,-31r17,0v25,47,-26,70,-40,114v-5,4,-9,8,-10,21v-16,12,-11,33,-27,51v-5,18,-12,43,-23,71v-1,-1,-2,34,-18,29v-12,1,-22,-12,-22,-23v20,-70,24,-65,68,-177v-47,16,-111,8,-116,-39v-11,-13,-7,-62,8,-62v18,0,22,26,23,54",w:216},z:{d:"189,-43v9,-1,46,-6,41,12v0,7,-5,13,-15,14v-45,6,-148,24,-181,13v0,-3,-5,-8,-14,-15v5,-44,66,-46,90,-85v-15,-18,-84,21,-84,-14v0,-10,5,-17,14,-18v33,-3,79,-13,109,-3v4,-2,14,11,12,15v0,23,-26,51,-78,84v28,10,73,-3,106,-3",w:244},"{":{d:"94,-303v27,-9,90,-14,79,26v-20,17,-55,-5,-87,13v-4,1,-6,4,-6,8v33,42,31,44,7,85v-6,10,-13,16,-13,13v5,6,17,17,15,31r-33,78v7,35,28,49,57,63r49,0v7,42,-51,41,-86,20v-43,-13,-51,-51,-56,-89v-2,-25,25,-54,27,-71v-3,-4,-46,-5,-41,-21v2,-10,-3,-29,11,-25v2,0,51,-17,52,-38v4,-3,-25,-23,-25,-49v0,-41,8,-30,50,-44",w:179},"|":{d:"30,-308v26,5,14,50,15,80v5,78,-8,153,-3,225v-2,15,-1,31,-11,36v-8,-3,-25,-22,-25,-32r9,-183v0,-40,0,-78,1,-112v0,-4,9,-15,14,-14",w:63},"}":{d:"47,-298v34,-17,118,-18,112,36v6,25,-76,98,-69,103v4,16,39,7,44,28v7,34,-34,17,-37,39v8,29,49,83,23,123v-15,23,-43,26,-73,46v-34,8,-43,11,-49,-17v1,-15,30,-15,33,-20v24,-12,70,-27,55,-61v-14,-33,-37,-68,-19,-103v-46,-50,46,-100,60,-141v-10,-16,-68,6,-77,-12",w:143},"~":{d:"7,-254v2,-6,59,-50,67,-46v11,-1,35,19,46,26v5,0,27,-10,66,-31v21,8,-1,25,-7,38v-27,21,-48,31,-65,31v-24,-11,-37,-39,-65,-9v-7,7,-26,36,-42,11v3,-5,-3,-17,0,-20",w:199},"Ä":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm187,-259v0,8,-4,13,-12,13v-18,0,-21,-20,-16,-34v18,-1,28,2,28,21xm90,-284v7,3,28,11,28,18v0,9,-9,18,-18,17v-17,0,-25,-24,-10,-35"},"Å":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm112,-239v-31,-17,-9,-61,29,-56v12,2,22,3,33,12v24,39,-30,62,-62,44xm119,-262v2,14,41,8,41,-4v0,-4,-8,-6,-24,-9v-10,-2,-17,10,-17,13"},"Ç":{d:"48,-108v-12,70,90,71,159,67r138,-9v9,-1,7,9,7,17v-37,16,-80,27,-103,21v-14,9,-40,3,-67,9v-30,0,-64,1,-100,-10v-6,-1,-10,-4,-10,-8v-32,-12,-46,-31,-63,-56v-16,-61,47,-103,83,-121v82,-42,118,-45,200,-60v21,-4,36,34,11,37v-90,11,-148,31,-225,77v-12,8,-23,20,-30,36xm172,18v29,4,47,14,53,35v-2,7,-14,31,-27,31v-28,7,-55,9,-84,14v-18,-5,-13,-32,7,-32v21,0,55,-5,69,-13v-16,-14,-63,10,-50,-35v9,-10,1,-27,23,-29v7,8,11,16,9,29",w:331},"É":{d:"49,-160v1,-4,-10,-9,-15,-8v-15,-35,32,-30,57,-31r142,-8v2,1,30,7,40,10v-52,16,-133,17,-190,30v-7,9,-12,24,-15,47v26,10,102,-6,141,3v1,3,1,6,2,10v-36,18,-92,12,-149,21v-11,9,-16,41,-16,51v55,-1,111,-21,168,-13v15,-8,48,1,31,18v-53,16,-130,13,-198,29r-39,-8v-4,-19,17,-53,20,-76v-1,0,-7,-11,-9,-18v18,-7,22,-28,30,-57xm133,-248v27,-11,48,-32,59,-14v3,11,-79,52,-88,53v-14,1,-16,-11,-12,-21v10,-4,23,-11,41,-18",w:252},"Ñ":{d:"224,-182v1,-17,15,-24,22,-38v20,0,13,10,3,33v-3,36,-25,52,-28,94v-10,24,-30,55,-29,82r-19,7v-32,-8,-36,-70,-58,-111v-2,-23,-7,-27,-19,-54v-28,36,-41,93,-71,133v-9,5,-20,-9,-20,-17r73,-149v9,-24,31,-5,36,7v19,41,31,98,53,139v22,-35,34,-69,50,-118v2,-3,3,-3,7,-8xm203,-257v22,-8,41,-24,65,-26v3,11,-8,9,-7,21v-26,20,-46,31,-59,31v-2,3,-49,-27,-49,-29v-11,0,-32,31,-46,32v-11,-2,-12,-21,-4,-23v4,-6,28,-30,48,-34v17,-4,43,28,52,28",w:219},"Ö":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm197,-229v0,8,-4,13,-12,13v-17,0,-19,-19,-16,-34v18,-1,29,1,28,21xm101,-254v7,3,28,9,27,18v1,8,-8,17,-17,17v-18,0,-26,-24,-10,-35",w:273},"Ü":{d:"281,-202v6,67,-30,121,-71,152v-3,14,-47,26,-60,39v-41,20,-110,1,-125,-26v-24,-44,-28,-84,-8,-127v12,-26,23,-38,37,-22v-2,2,-3,5,-3,10v-34,26,-29,116,5,134v22,32,86,-1,109,-8v38,-28,104,-64,97,-149v2,-10,7,-8,19,-3xm197,-227v0,8,-4,13,-12,13v-18,0,-21,-20,-16,-34v18,-1,28,2,28,21xm101,-252v7,3,27,10,27,18v0,8,-9,18,-18,17v-18,-1,-24,-25,-9,-35",w:262},"á":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm32,-117v24,-3,85,-55,101,-32v3,11,-80,53,-89,53v-13,2,-14,-10,-12,-21",w:173},"à":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm99,-137v7,6,56,14,37,40v-28,-7,-62,-21,-100,-41v-2,-3,-2,-26,5,-23v16,4,42,17,58,24",w:173},"â":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm147,-97v-27,-6,-39,-26,-60,-37v-21,7,-38,46,-65,23v-2,-5,-3,-10,-4,-14v18,-4,43,-31,61,-42v28,5,40,21,62,36v12,8,18,17,18,25v0,6,-4,9,-12,9",w:173},"ä":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-32,5,-66,-64,-15,-77v39,-26,92,-36,104,9v0,6,-3,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm142,-119v0,8,-4,13,-12,13v-18,0,-21,-20,-16,-34v18,-1,28,2,28,21xm46,-144v7,3,28,9,27,18v1,8,-9,18,-18,17v-18,-1,-25,-25,-9,-35",w:173},"ã":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm114,-136v22,-8,41,-24,64,-26v3,11,-7,10,-7,21v-26,20,-45,30,-58,30v-3,3,-49,-26,-49,-28v-10,-1,-32,35,-51,31v-12,-32,8,-29,32,-51v24,-21,54,20,69,23",w:173},"å":{d:"118,-53v10,4,55,41,62,47v0,7,-5,16,-12,16r-57,-28v-20,3,-40,19,-61,18v-10,2,-43,-17,-42,-36v0,-14,7,-40,27,-41v39,-26,92,-36,104,9v0,6,-2,11,-9,15v-32,-24,-64,-6,-84,11v8,15,58,-17,72,-11xm54,-101v-37,-20,-9,-71,34,-65v13,1,25,3,38,13v27,45,-34,73,-72,52xm61,-128v4,20,48,7,49,-5v0,-5,-9,-7,-28,-10v-12,-2,-21,11,-21,15",w:173},"ç":{d:"108,-118v30,-6,56,21,25,33v-24,-6,-39,5,-75,23v-7,4,-12,12,-15,22v31,28,86,3,128,9v3,28,-29,16,-44,28v-53,15,-106,10,-120,-37v0,-48,62,-70,101,-78xm92,18v23,4,45,12,48,32v-2,6,-12,28,-25,28v-24,6,-50,10,-77,13v-16,-4,-11,-28,7,-29v17,-1,51,-4,63,-12v-14,-15,-57,10,-46,-32v9,-8,0,-25,21,-26v6,6,12,14,9,26",w:171},"é":{d:"108,-124v42,-3,70,39,50,73v-22,-1,-70,12,-94,10v-1,1,-2,3,-2,3v0,3,12,7,35,14v18,0,64,7,30,21v-10,14,-31,6,-53,6v-26,-7,-70,-26,-70,-58v0,-54,48,-65,104,-69xm130,-78v-2,-35,-66,-13,-77,3v16,6,62,6,77,-3xm76,-169v26,-11,48,-32,59,-14v3,10,-80,53,-89,53v-14,1,-14,-10,-12,-21v15,-7,16,-7,42,-18",w:161},"è":{d:"108,-124v42,-3,70,39,50,73v-22,-1,-70,12,-94,10v-1,1,-2,3,-2,3v0,3,12,7,35,14v18,0,64,7,30,21v-10,14,-31,6,-53,6v-26,-7,-70,-26,-70,-58v0,-54,48,-65,104,-69xm130,-78v-2,-35,-66,-13,-77,3v16,6,62,6,77,-3xm95,-166v7,6,54,14,37,40v-28,-7,-62,-21,-100,-41v-3,-3,-3,-26,5,-24v16,5,42,18,58,25",w:161},"ê":{d:"108,-124v42,-3,70,39,50,73v-22,-1,-70,12,-94,10v-1,1,-2,3,-2,3v0,3,12,7,35,14v18,0,64,7,30,21v-10,14,-31,6,-53,6v-26,-7,-70,-26,-70,-58v0,-54,48,-65,104,-69xm130,-78v-2,-35,-66,-13,-77,3v16,6,62,6,77,-3xm145,-129v-27,-6,-39,-26,-60,-37v-8,0,-10,4,-14,10v-11,15,-51,34,-56,0v17,-4,44,-32,61,-43v28,5,41,21,63,36v12,8,17,17,17,25v0,6,-3,9,-11,9",w:161},"ë":{d:"108,-124v42,-3,70,39,50,73v-22,-1,-70,12,-94,10r-3,3v0,3,12,7,36,14v18,0,64,7,30,21v-10,14,-31,6,-53,6v-26,-7,-67,-27,-71,-58v7,-52,48,-65,105,-69xm130,-78v-2,-35,-66,-13,-77,3v16,6,62,6,77,-3xm140,-144v0,8,-4,12,-12,12v-18,0,-19,-19,-16,-33v18,-1,29,1,28,21xm44,-169v7,3,28,9,28,17v0,9,-9,18,-18,18v-18,0,-25,-24,-10,-35",w:161},"í":{d:"59,-98v20,4,15,53,10,95v-6,1,-11,2,-19,-4v1,-7,-12,-18,-10,-24v4,-22,-4,-65,19,-67xm50,-139v27,-11,49,-32,59,-14v3,11,-80,53,-89,53v-14,1,-14,-12,-11,-22v15,-7,14,-6,41,-17",w:105},"ì":{d:"57,-98v22,5,13,50,11,95v-7,1,-11,2,-20,-4v1,-7,-12,-18,-10,-24v4,-22,-2,-64,19,-67xm70,-139v14,10,54,14,37,41v-28,-7,-61,-22,-99,-42v-3,-2,-3,-25,5,-23v15,5,41,17,57,24",w:109},"î":{d:"72,-98v20,5,12,51,10,95v-6,2,-13,1,-20,-4v1,-8,-12,-18,-10,-24v4,-22,-3,-65,20,-67xm134,-94v-26,-7,-39,-25,-60,-37v-7,0,-9,4,-13,10v-14,15,-51,34,-56,-1v18,-4,45,-33,61,-43v27,6,40,22,62,37v12,8,18,17,18,25v0,6,-4,9,-12,9",w:143},"ï":{d:"55,-97v19,5,15,53,10,95v-17,5,-26,-14,-30,-28v6,-20,-3,-65,20,-67xm110,-118v0,8,-4,13,-12,13v-17,0,-19,-19,-16,-34v18,-1,29,1,28,21xm14,-143v6,3,28,8,28,17v0,9,-9,18,-18,18v-18,0,-25,-24,-10,-35",w:107},"ñ":{d:"115,-129v34,6,59,50,59,105v0,31,-15,24,-30,17v-15,-29,-5,-42,-20,-81v-35,-13,-68,52,-88,61v-20,-4,-38,-36,-19,-59v0,-12,3,-14,10,-28v11,-8,18,11,27,12xm117,-166v22,-7,41,-23,64,-26v3,11,-7,10,-7,21v-26,20,-45,30,-58,30v-3,3,-49,-26,-49,-28v-10,-1,-32,35,-51,31v-5,-12,-8,-16,0,-23v4,-6,28,-29,48,-33v17,-3,43,28,53,28",w:171},"ó":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm49,-154v24,-3,85,-55,101,-32v3,11,-80,53,-89,53v-14,0,-13,-8,-12,-21",w:191},"ò":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm115,-181v14,10,51,13,37,40v-28,-7,-62,-21,-100,-41v-3,-2,-3,-26,5,-23v16,5,42,17,58,24",w:191},"ô":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm110,-177v-22,6,-38,45,-65,22v-2,-4,-3,-9,-4,-13v18,-4,43,-32,61,-43v27,6,40,21,62,36v12,9,18,17,18,25v1,11,-15,10,-23,7",w:191},"ö":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm161,-160v0,8,-4,13,-12,13v-17,0,-19,-19,-16,-34v18,-1,29,1,28,21xm65,-185v7,3,28,9,28,18v0,7,-9,18,-18,17v-18,1,-25,-24,-10,-35",w:191},"õ":{d:"102,-132v50,-20,99,16,99,60v0,54,-60,64,-108,79v-50,-2,-110,-48,-76,-100v22,-17,49,-33,85,-39xm136,-104v-34,0,-91,27,-94,47v16,51,125,16,125,-22v0,-17,-10,-25,-31,-25xm58,-199v26,-21,54,18,69,22v4,0,15,-5,34,-13v22,-9,21,-16,31,-13v3,11,-9,9,-7,22v-26,20,-46,30,-59,30v-2,4,-49,-28,-49,-29v-11,0,-32,31,-46,32v-12,-3,-13,-21,-4,-23v4,-6,14,-15,31,-28",w:191},"ú":{d:"196,-129v-1,-4,12,-13,15,-13v6,0,8,7,8,21v0,24,-7,25,-13,45v-7,7,-14,21,-24,29v-9,24,-61,45,-89,45v-63,0,-105,-72,-67,-126v24,-3,19,27,18,46v-1,26,23,42,54,40v38,-3,88,-51,98,-87xm106,-174v26,-11,48,-32,59,-14v3,11,-81,53,-89,54v-13,1,-15,-12,-11,-22v15,-7,14,-7,41,-18",w:213},"ù":{d:"196,-129v-1,-4,12,-13,15,-13v6,0,8,7,8,21v0,24,-7,25,-13,45v-7,7,-14,21,-24,29v-9,24,-61,45,-89,45v-63,0,-105,-72,-67,-126v24,-3,19,27,18,46v-1,26,23,42,54,40v38,-3,88,-51,98,-87xm126,-166v7,6,56,14,37,40v-28,-7,-62,-22,-100,-42v-2,-3,-2,-26,5,-23v16,4,42,18,58,25",w:213},"û":{d:"196,-129v-1,-4,12,-13,15,-13v6,0,8,7,8,21v0,24,-7,25,-13,45v-7,7,-14,21,-24,29v-9,24,-61,45,-89,45v-63,0,-105,-72,-67,-126v24,-3,19,27,18,46v-1,26,23,42,54,40v38,-3,88,-51,98,-87xm172,-143v-27,-6,-39,-26,-60,-37v-8,0,-10,4,-14,10v-11,15,-49,35,-56,0v17,-4,44,-32,61,-43v27,6,41,21,63,36v12,9,17,17,17,25v0,6,-3,9,-11,9",w:213},"ü":{d:"196,-129v-1,-4,12,-13,15,-13v6,0,8,7,8,21v0,24,-7,25,-13,45v-7,7,-14,21,-24,29v-9,24,-61,45,-89,45v-63,0,-105,-72,-67,-126v24,-3,19,27,18,46v-1,26,23,42,54,40v38,-3,88,-51,98,-87xm168,-161v0,8,-3,13,-11,13v-17,0,-20,-19,-17,-34v18,-1,29,1,28,21xm72,-186v7,3,29,9,28,18v0,7,-9,18,-18,17v-18,1,-25,-24,-10,-35",w:213},"†":{d:"22,-286v15,6,5,-20,19,-19v9,-3,15,21,17,22v6,1,12,3,20,6v3,10,5,16,-9,16v-34,-10,-6,51,-34,52v-20,-7,11,-47,-15,-49v-14,3,-25,-5,-17,-24v7,-2,14,-4,19,-4",w:77},"°":{d:"106,-268v0,36,-35,38,-51,46v-48,5,-60,-58,-25,-78v33,-11,76,-9,76,32xm38,-257v16,7,39,2,38,-17v-13,-9,-28,-1,-32,11v-5,3,-7,0,-6,6",w:114},"¢":{d:"105,-188v13,-12,14,-18,26,-15v7,23,7,15,-3,49v6,0,18,14,17,20v-3,5,-12,19,-26,13v-14,1,-14,5,-16,21v10,10,46,-13,38,18v-9,17,-23,16,-54,20v-17,16,-4,55,-29,60v-37,-10,19,-64,-24,-71v-20,-10,-37,-47,-6,-62v23,-20,73,-4,77,-53xm65,-101v4,-9,7,-8,3,-13v-14,4,-22,10,-3,13",w:154},"£":{d:"153,-170v3,22,62,0,49,39v-18,6,-31,12,-58,9v-12,-1,-17,30,-23,39v19,26,50,56,91,35v9,-2,27,-13,27,4v0,27,-27,39,-58,42v-32,-5,-59,-19,-78,-39v-6,1,-35,44,-57,39v-25,0,-37,-15,-37,-46v0,-41,43,-53,73,-50v4,1,12,-18,12,-21v-7,-15,-49,0,-44,-30v-2,-31,31,-16,60,-19v16,-30,25,-119,93,-113v16,2,75,16,50,44v-4,5,-7,7,-12,8v-18,-12,-32,-18,-41,-18v-35,-1,-38,52,-47,77xm43,-45v4,5,12,-2,11,-9v-1,2,-12,1,-11,9",w:242},"§":{d:"141,-115v12,10,29,36,28,56v-4,68,-129,69,-152,16v-1,-12,-10,-22,8,-23v17,3,47,21,67,23v16,1,40,-8,38,-21v-8,-49,-119,-30,-117,-85v1,-28,15,-45,-3,-64v-1,-53,55,-61,103,-62v15,-5,6,-5,20,-2v16,17,23,27,23,30v-1,26,-29,7,-45,7v-21,0,-51,2,-62,17v19,14,87,8,97,43v18,14,16,57,-5,65xm64,-147r57,17v10,-28,-22,-43,-47,-44v-25,-1,-35,19,-10,27",w:174},"•":{d:"130,-114v0,47,-124,54,-120,-8r6,-31v44,-28,64,-34,104,0v8,6,10,20,10,39",w:139},"¶":{d:"121,-237v21,-9,44,-13,63,-1v-1,7,5,6,7,11r-4,190v-2,33,4,39,-15,40v-16,1,-10,-20,-10,-33r4,-161v0,-17,-1,-34,-16,-25v2,10,1,23,1,35v-9,46,-6,75,-15,156v-3,4,-7,5,-12,5v-17,-10,-3,-89,-10,-115v-43,14,-98,10,-101,-29v-4,-53,59,-63,104,-75v3,1,4,2,4,2xm95,-204v2,9,-30,50,1,50v35,0,23,-13,29,-43v0,-1,-2,-7,-4,-15v-12,-1,-14,2,-26,8",w:206},"ß":{d:"33,10v-29,4,-28,-32,-16,-70v18,-58,17,-137,56,-176v12,-24,46,-58,82,-43v20,8,47,24,47,54v0,30,-62,59,-67,90v33,23,56,33,63,63v-18,21,-22,36,-48,54v-24,17,-27,41,-53,16v-2,-19,7,-35,24,-42v15,-13,26,-22,34,-40v-13,-17,-78,-29,-56,-70v-3,-27,64,-54,66,-86v-8,-25,-41,-4,-52,8v-29,30,-47,83,-51,141v-17,25,-8,71,-29,101"},"®":{d:"75,-194v78,-29,116,9,130,84v-2,42,-22,47,-57,67v-74,20,-161,-19,-129,-110v6,-18,29,-34,57,-40xm46,-86v51,36,84,21,129,-15v7,-15,0,-39,-10,-49v-13,-37,-49,-26,-86,-18v-28,7,-49,46,-33,82xm72,-123v-5,-43,68,-57,75,-14v-17,26,-18,17,3,32v2,25,-25,18,-45,7r-4,-4v-1,8,-3,20,-12,24v-10,-3,-21,-34,-17,-45xm112,-135v-10,-1,-20,13,-9,14v6,-6,9,-11,9,-14",w:217},"©":{d:"102,-29v-74,5,-124,-84,-70,-140v22,-22,53,-35,97,-38v46,-4,88,49,74,100v0,44,-51,75,-101,78xm96,-66v42,-3,75,-23,75,-69v0,-23,-4,-38,-44,-38v-16,0,-33,6,-49,20v36,-4,55,-12,62,20v-5,16,-49,1,-50,21v10,15,53,-14,54,11v0,18,-14,27,-42,27v-22,1,-46,-11,-46,-31v0,-25,7,-39,20,-44v-1,-1,-2,-2,-3,-2v-51,22,-32,89,23,85",w:217},"™":{d:"213,-307v28,9,11,49,7,75v-1,4,-4,6,-11,6v-7,1,-11,-14,-11,-34v-14,-6,-34,34,-46,28v-2,0,-10,-9,-24,-27v-10,7,-3,36,-27,31v-15,-24,-3,-27,1,-48v-6,-7,-27,-1,-31,3v-3,14,-7,30,-11,51v-5,10,-29,9,-24,-12v-5,-8,1,-18,3,-35v-13,6,-33,2,-29,-18v20,-17,64,-17,100,-19v28,-1,29,30,45,39v11,-6,35,-32,58,-40",w:239},"´":{d:"52,-284v29,-11,50,-34,62,-14v3,12,-86,54,-94,56v-14,0,-16,-12,-12,-23v11,-5,25,-11,44,-19",w:120},"¨":{d:"124,-259v0,9,-4,13,-12,13v-18,0,-22,-21,-17,-35v19,-1,30,1,29,22xm23,-285v7,2,30,9,29,18v1,10,-9,19,-18,19v-19,0,-28,-26,-11,-37",w:136},"≠":{d:"48,-130v29,11,49,-57,60,-50v25,6,7,27,-1,46v22,5,29,7,21,22v-18,2,-48,-1,-50,15v9,8,53,-7,54,10v-4,22,-46,20,-72,24v-7,13,-18,32,-34,57v-8,6,-15,-3,-13,-14v-1,-9,15,-39,14,-45v-30,5,-24,-17,-13,-25v12,-1,36,4,29,-13v-14,0,-47,6,-36,-12v0,-18,27,-13,41,-15",w:140},"Æ":{d:"335,-259v0,30,-102,12,-122,34v10,21,2,79,16,100v24,-6,59,-13,86,-16v23,-2,32,21,13,26r-103,29v-3,22,-4,38,8,43v28,-5,60,-6,86,-14v5,-1,14,7,14,11v6,16,-90,40,-107,40v-29,0,-39,-19,-32,-46v-2,-4,0,-26,-9,-28v-29,2,-58,6,-88,6v-31,0,-40,74,-82,73v-18,-23,4,-37,12,-50v40,-65,112,-126,165,-207v20,-17,69,-11,112,-13v21,0,31,4,31,12xm123,-111v28,1,44,-2,67,-10v-4,-22,5,-49,-7,-65v-3,6,-65,61,-60,75",w:348},"Ø":{d:"76,-211v41,-13,100,-22,140,-3v26,-19,40,-29,44,-29v10,0,15,7,15,20v0,15,-23,23,-30,35v23,39,29,114,-21,139v-36,19,-102,35,-147,18v-14,-5,-29,29,-46,35v-25,-13,-19,-24,3,-56v-9,-17,-28,-27,-28,-60v0,-38,23,-72,70,-99xm107,-66v55,15,125,-12,123,-70v0,-16,-5,-25,-13,-29r-110,95r0,4xm39,-108v-1,3,17,31,22,27v8,-6,109,-90,123,-106v-15,-11,-43,1,-63,2v-33,10,-80,35,-82,77",w:270},"∞":{d:"322,-72v-4,22,-54,41,-76,41v-43,0,-83,-17,-114,-35v-46,19,-125,53,-128,-18v-1,-14,10,-22,13,-35v29,-10,62,-31,97,-4v37,28,47,5,75,-8v40,-19,73,-10,114,1v13,1,18,55,19,58xm228,-69v15,0,62,-12,61,-25v-19,-23,-89,-10,-105,11v0,2,1,4,2,4v28,6,42,10,42,10xm75,-102v-13,2,-41,4,-44,19v0,4,3,7,10,7v21,0,40,-6,54,-17v-9,-6,-16,-9,-20,-9",w:330},"±":{d:"93,-163v-7,46,76,-4,46,47v-14,6,-27,13,-38,8v-24,2,-14,28,-28,44r-14,0v-7,-12,-5,-15,-7,-33v-12,-7,-41,-1,-37,-24v2,-11,23,-17,36,-14r28,-38v4,0,9,4,14,10xm113,-27v-12,18,-58,27,-85,24v-16,2,-22,-23,-13,-36v28,-7,85,-11,98,12",w:151},"≤":{d:"73,-109v10,15,87,16,87,42v0,11,-5,16,-13,16v-36,-11,-69,-24,-109,-31v-18,-8,-18,-13,-9,-36v59,-56,93,-83,101,-83v16,0,18,17,14,28v-27,24,-42,35,-71,64xm10,-29v35,-12,117,-26,148,-3v1,2,-5,19,-8,18r-124,15v-16,2,-26,-18,-16,-30",w:168},"≥":{d:"115,-174v20,7,53,36,20,57v-19,11,-91,68,-82,59v-18,3,-25,-22,-13,-31v15,-10,14,-10,70,-51r-50,-37v-5,-4,-5,-27,4,-28v16,7,40,17,51,31xm14,-32v33,-10,86,-14,127,-10v12,12,5,23,-11,27v-49,9,-82,13,-99,13v-22,0,-24,-16,-17,-30",w:163},"¥":{d:"31,-248v30,-3,64,64,74,59v37,-22,77,-65,107,-82v20,-11,34,18,21,32v-28,19,-52,38,-70,57v-18,8,-40,21,-35,60v2,19,39,7,64,7v25,0,16,21,2,27v-36,16,-46,8,-68,18v6,11,101,-20,66,24v-21,11,-42,12,-75,20v-2,1,-5,6,-10,18v-8,3,-11,10,-24,8v-7,-17,-2,-18,-9,-26v-13,5,-39,3,-53,-2v-10,-17,-7,-27,0,-34v23,-1,45,1,64,-5v-11,-7,-28,-4,-64,-6v-13,-8,-15,-24,-6,-35v33,-2,102,9,76,-37v-14,-14,-33,-38,-60,-66v-10,-10,-8,-28,0,-37",w:219},"µ":{d:"123,-114v41,0,54,-9,127,-17v12,-2,20,-6,25,-12v5,-78,43,-127,119,-138v38,-5,46,23,55,48v-5,5,2,4,2,12v-2,47,-72,81,-129,95v-17,4,-12,32,-2,39v30,-5,24,0,99,4v14,9,14,20,-1,23v-17,3,-71,-1,-85,13v1,19,18,35,-3,47v-1,-6,-10,-7,-16,-5v-3,-3,-20,-37,-29,-41v-15,8,-50,22,-49,-9v1,-19,2,-27,28,-26v24,1,13,-12,8,-30v-22,1,-64,16,-111,23v-50,7,-17,47,-17,57v0,10,-5,15,-13,15v-20,-9,-27,-30,-33,-55v-20,-17,-52,8,-85,-6v-2,-10,-13,-26,4,-29v32,-6,41,-1,65,-7v-17,-74,-4,-173,69,-180v55,-20,130,8,131,65v-11,9,-10,2,-29,-11v-33,-23,-37,-26,-76,-25v-41,13,-69,38,-67,100v0,34,4,50,13,50xm317,-152v29,-6,106,-43,106,-71v0,-23,-24,-25,-42,-17v-31,1,-74,48,-64,88",w:462},"∂":{d:"456,-113v55,-37,119,-8,176,5v-19,37,-104,-5,-144,18v-5,64,-45,87,-130,87v-43,0,-70,-8,-96,-21v-54,15,-146,29,-209,10v-18,-11,-43,-26,-46,-53v-1,-9,28,-48,51,-46v55,-10,55,-8,101,-8v29,0,17,-26,23,-56v4,-19,4,-74,34,-49v4,42,-7,83,-10,124v0,4,-11,10,-34,17v-29,-1,-45,-4,-74,1v-10,2,-57,3,-52,18v30,43,132,30,190,18v2,-10,-7,-19,-5,-28v5,-36,31,-59,74,-56v27,2,71,4,70,35v-1,30,-37,41,-58,57v35,13,131,15,135,-23v2,-19,-5,-36,4,-50xm262,-85v0,3,13,28,19,25v7,0,48,-13,61,-29v-10,-17,-71,-17,-80,4",w:640},"∑":{d:"235,-95v-3,-59,120,-41,160,-28v3,-2,15,-3,14,4v1,3,-16,19,-21,18r-97,4v-25,5,-18,18,-23,56v-16,14,-25,24,-36,18v-83,32,-154,29,-212,-17v-45,-68,41,-114,107,-119v50,-4,59,66,22,85v-16,8,-61,10,-79,15v36,27,185,24,165,-36xm128,-119v-23,-3,-43,4,-53,15v13,5,46,-4,53,-15",w:414},"∏":{d:"243,-190v7,-18,27,-19,38,6v0,2,-5,8,-14,16v-8,-9,-27,-4,-24,-22xm221,-111v55,-7,60,22,45,64v5,23,17,47,-22,47v-35,0,-18,-40,-15,-70v-2,-19,-35,-13,-52,-18v-2,0,-13,1,-34,3v-4,0,-10,11,-13,31v-3,20,1,43,-11,54v-12,-4,-13,-5,-21,-3v-13,-13,-3,-25,-12,-41v7,-6,12,-22,10,-39v-23,-8,-79,15,-87,-21v12,-28,78,-4,101,-20r36,-96v8,-19,17,-28,27,-28v10,0,15,6,15,18v-6,32,-31,62,-38,109v25,10,47,-1,71,10",w:282},"π":{
|
||
d:"247,-240v-3,5,-14,12,-21,6v-41,5,-71,-4,-85,37v-6,7,-21,42,-25,61v28,12,104,-16,129,24v8,11,12,24,12,38v-7,17,-2,99,-40,68v-9,-23,-5,-47,-1,-73v3,-24,-40,-24,-50,-19v-4,0,-18,2,-44,6v-30,-6,-16,49,-33,58v-19,-11,-14,2,-29,-10v8,-71,20,-114,43,-170v-24,-2,-49,4,-73,7v-30,3,-32,-33,-7,-36r184,-22v17,-1,40,13,40,25",w:265},"∫":{d:"62,-151v-7,-70,20,-130,63,-150v28,1,39,10,70,23v20,8,6,33,-6,35v-29,-13,-45,-20,-49,-20v-20,-4,-45,51,-43,70v8,60,5,129,5,189v0,62,-27,93,-79,93v-37,-1,-71,-14,-63,-57v21,0,79,34,91,-2v16,-3,14,-64,21,-85v-2,-31,-1,-74,-10,-96",w:156},"ª":{d:"6,-265v1,-31,58,-53,80,-22v-11,14,25,28,25,36v-2,8,-15,12,-27,10v-22,-29,-68,19,-78,-24xm52,-281v-8,1,-24,10,-9,13v11,1,24,-10,9,-13",w:117},"º":{d:"13,-273v1,-31,56,-41,83,-18v36,8,14,48,-9,52v-35,6,-64,-5,-74,-34xm81,-269v-7,-7,-20,-11,-29,-6v5,13,13,11,29,6",w:128},"Ω":{d:"121,-111v9,16,43,-5,54,5v28,-4,62,8,81,-5v48,-33,166,-28,160,44v15,34,-51,53,-88,53v-34,0,-53,-21,-71,-37v-15,7,-32,-4,-28,-22v-26,-4,-93,-6,-108,8v8,17,5,37,12,54v-1,15,-18,15,-31,10v-9,-15,-20,-39,-19,-63v-20,-9,-73,15,-79,-18v4,-28,50,-11,77,-24v12,-99,36,-168,137,-178v35,5,64,20,67,57v0,13,-14,18,-20,5v-15,-35,-83,-31,-104,4v-26,20,-39,82,-40,107xm334,-45v15,2,51,-14,53,-22v-7,-20,-36,-31,-69,-29v-8,-1,-39,6,-37,14v-3,10,44,38,53,37",w:424},"æ":{d:"145,-44r33,7v2,42,-59,29,-85,16v-6,7,-35,24,-48,15v-19,2,-35,-21,-33,-37v2,-24,5,-19,28,-36v-6,-8,-45,3,-33,-21v21,-22,58,-12,85,-1v6,-5,35,-28,45,-15v20,-4,36,17,36,35v0,23,-4,21,-28,37xm111,-72v12,3,49,-16,19,-17v-5,0,-20,12,-19,17xm74,-50v-14,-4,-48,16,-19,17v4,1,19,-14,19,-17",w:184},"ø":{d:"76,-136v17,7,33,-8,51,0v9,-6,21,-13,36,-21v23,22,-13,31,3,50v11,13,4,21,14,35v-4,5,-1,14,-4,23v-14,23,-45,41,-84,39v-12,2,-29,28,-41,38v-2,-11,-34,-10,-15,-30v3,-7,5,-11,5,-11v-15,-24,-60,-54,-22,-89v23,-21,25,-32,57,-34xm102,-54v18,1,50,-19,30,-32v-12,7,-22,18,-30,32xm85,-92v-14,3,-26,8,-38,17v2,20,17,13,26,0v6,-8,12,-13,12,-17",w:188},"¿":{d:"181,-247v3,1,31,2,29,15v-4,22,-37,27,-41,4v1,-5,7,-20,12,-19xm161,-34v-45,-1,-105,19,-124,51v0,11,18,17,54,17v39,0,82,-13,112,4v-10,35,-58,31,-100,31v-47,0,-80,-10,-99,-31v-10,-56,22,-73,64,-90v8,-3,32,-9,74,-18v21,-15,7,-62,22,-92v-1,-5,-1,-11,4,-12v16,0,24,7,24,22v-8,30,-8,73,-17,111v-3,5,-7,7,-14,7",w:213},"¡":{d:"86,-197v8,16,-7,41,-24,25v-11,-11,-4,-16,-3,-29v13,0,15,-2,27,4xm46,-107v4,-8,11,-16,23,-7v19,26,-5,57,-6,87v-7,0,-5,18,-9,28v0,14,-17,52,-11,70v-2,7,-15,28,-25,12v-4,-6,-15,-7,-6,-16v2,-39,14,-96,34,-174",w:95},"¬":{d:"141,-99v47,7,103,-3,149,6v14,24,18,15,10,39v-10,34,-7,31,-26,76v-4,6,-15,8,-16,21v-4,2,-4,1,-13,5v-22,-33,-4,-33,16,-104v-5,-9,-28,-4,-38,-6r-183,4v-14,0,-41,-29,-17,-36v31,-9,82,5,118,-5",w:315},"√":{d:"364,-218v43,-21,80,-51,104,-32v-3,19,-24,21,-44,40v-41,15,-78,53,-136,78r-137,98v-20,16,-79,66,-91,68v-3,1,-25,-11,-24,-13v-4,-28,-43,-61,-30,-85v26,-15,42,19,58,32r295,-188v0,1,2,2,5,2",w:474},"ƒ":{d:"115,-262v-23,6,-39,63,-38,96v1,3,57,2,54,16v1,22,-45,15,-51,30v3,34,12,68,10,103v14,17,-18,53,-28,63v-48,8,-89,5,-95,-37v20,-5,77,21,83,-18v17,-29,-4,-61,0,-98v0,-5,-3,-10,-7,-17v-33,4,-43,-17,-25,-37v10,-4,27,5,27,-10v0,-43,15,-77,32,-109v12,-7,16,-22,38,-20v11,1,51,35,25,55v-9,1,-16,-17,-25,-17",w:145},"≈":{d:"133,-112v21,15,48,-30,78,-17v3,3,5,7,5,9v-8,30,-47,45,-76,45v-19,0,-64,-48,-90,-21r-29,20v-6,-1,-17,-16,-15,-32v24,-17,70,-42,107,-21v4,4,10,9,20,17xm138,-57v28,2,48,-25,76,-26v13,30,-21,42,-40,53v-41,24,-77,-15,-114,-23v-15,14,-46,32,-49,-1v-3,-9,27,-28,54,-30",w:223},"∆":{d:"18,-1v-24,-30,8,-48,25,-71v14,-19,34,-28,40,-56v20,-35,29,-14,57,4v9,39,43,62,57,102v0,16,-34,17,-50,14v-28,2,-72,4,-129,7xm139,-47r-22,-52v-12,-5,-12,15,-24,27v-7,6,-14,16,-23,28v23,1,36,-1,69,-3",w:199},"«":{d:"191,-64v16,6,87,37,53,63v-39,-9,-71,-28,-107,-40v-14,-13,-13,-34,10,-47v27,-15,48,-55,84,-62v9,-2,21,10,21,18r-13,21v-16,5,-44,22,-51,41v0,4,1,6,3,6xm71,-65v17,6,87,35,55,62v-39,-8,-66,-27,-108,-40v-14,-13,-13,-36,10,-46v23,-18,50,-56,84,-63v9,-2,21,10,21,18r-13,22v-20,6,-32,17,-51,37v0,3,-1,11,2,10",w:265},"»":{d:"120,-129v9,-33,48,-10,64,5v9,20,86,52,50,86v-36,11,-66,31,-107,40v-6,-7,-9,-13,-9,-17v-2,-13,50,-46,63,-46v11,-18,-33,-42,-48,-47xm1,-128v10,-33,46,-8,64,6v8,19,86,50,51,85v-40,13,-69,30,-108,40v-6,-7,-8,-12,-8,-16v-2,-14,50,-46,63,-47v7,-13,-9,-20,-19,-30v-10,-9,-20,-15,-30,-17",w:252},"…":{d:"244,-24v-1,21,-38,32,-41,3v-2,-19,23,-22,34,-17v0,7,0,15,7,14xm113,-24v0,-22,28,-21,38,-8v5,34,-39,40,-38,8xm35,-2v-10,-2,-36,-17,-18,-29v-1,-15,17,-17,31,-6v7,17,6,33,-13,35",w:258}," ":{w:179},"À":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm150,-268v14,10,54,14,37,41v-28,-7,-62,-22,-100,-42v-2,-3,-2,-26,5,-23v16,4,42,17,58,24"},"Ã":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm100,-285v26,-19,54,19,69,22v4,0,15,-5,34,-13v23,-9,22,-17,31,-12v3,11,-9,9,-7,21v-26,20,-46,30,-59,30v-3,3,-50,-26,-49,-29v-12,1,-31,35,-51,32v-3,-8,-5,-14,-5,-18v10,-9,16,-17,37,-33"},"Õ":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm116,-270v26,-19,54,19,69,22v4,0,15,-5,34,-13v23,-10,22,-16,31,-12v3,11,-8,9,-7,21v-45,28,-47,42,-88,16v-29,-19,-12,-20,-43,2v-8,5,-12,18,-23,15v-13,-3,-12,-20,-4,-23v4,-6,14,-15,31,-28",w:273},"Œ":{d:"247,-243v71,4,161,-7,245,-8v17,0,27,6,27,17v-8,27,-70,14,-104,23v-3,1,-52,0,-65,7r0,4v16,16,17,29,17,65v32,10,74,-14,99,16v-14,25,-76,17,-127,24v-17,18,-55,32,-75,51v85,0,128,-3,204,-11v15,-2,21,11,20,29v-78,24,-177,12,-270,24v-24,3,-24,-29,-48,-15v-46,7,-70,4,-105,-4v-19,-18,-42,-22,-52,-55v-10,-34,0,-47,12,-78v-18,-59,48,-78,105,-84v17,-18,103,-13,117,-5xm125,-45v76,-9,186,-43,209,-105v-26,-67,-137,-83,-217,-54v3,34,-45,25,-60,58v-41,48,5,108,68,101",w:492},"œ":{d:"185,-54v25,28,107,-17,104,33v-12,12,-60,14,-87,14v0,0,1,1,2,1v-11,1,-39,-9,-50,-17v-28,17,-75,32,-114,7v-22,-14,-34,-11,-34,-41v0,-36,33,-49,48,-75v29,-16,72,-3,95,11v12,-9,48,-27,59,-26v30,0,64,15,65,40v0,7,-6,20,-20,37v-29,1,-44,11,-68,16xm226,-106v-21,-7,-41,-2,-48,13v14,1,42,-7,48,-13xm132,-87v-21,-35,-94,11,-92,24v-2,14,43,21,61,21v25,0,36,-20,31,-45",w:295},"–":{d:"6,-66v-8,-72,79,-21,146,-39v37,-10,79,7,111,0v9,8,14,13,14,17v2,26,-72,13,-99,21v-83,4,-124,21,-172,1",w:282},"—":{d:"175,-106v86,-9,201,1,286,-1v11,6,13,11,6,30v-118,15,-246,10,-377,10v-25,0,-73,3,-82,-8r-2,-26v11,-13,32,-9,52,-7v38,3,84,-5,117,2",w:485},"“":{d:"66,-261v-21,5,-37,51,-22,77v0,4,-2,6,-7,6v-31,-9,-38,-62,-12,-94v12,-15,21,-28,31,-34v16,-1,19,24,22,34v10,-11,22,-32,43,-23v-2,8,4,16,5,19v-6,11,-51,53,-29,74v-12,21,-30,5,-33,-17v-6,-13,9,-28,2,-42",w:118},"”":{d:"120,-294v12,3,30,26,19,34v2,15,-40,70,-55,66v-40,-10,10,-51,14,-64v3,-3,8,-31,22,-36xm70,-306v14,3,26,34,16,49v-19,30,-31,45,-58,59v-12,-11,-33,-17,-7,-36v13,-19,36,-27,36,-59v0,-5,9,-13,13,-13",w:148},"‘":{d:"73,-262v-10,7,-41,39,-38,69v-15,13,-27,-16,-28,-28v-2,-20,51,-83,66,-83v20,0,25,41,0,42",w:95},"’":{d:"74,-300v13,31,-1,99,-44,101v-13,0,-19,-5,-19,-15v6,-10,31,-34,35,-59v2,-11,1,-32,11,-32v6,0,11,2,17,5",w:90},"÷":{d:"167,-158v-4,3,-7,9,-10,20v-23,4,-34,-8,-29,-31v14,-6,18,1,39,11xm78,-72v-53,11,-53,12,-69,-15v-1,-12,11,-17,22,-14v71,-13,151,-18,230,-24v11,1,21,16,23,28v-28,20,-90,11,-126,16v-36,5,-62,5,-80,9xm123,-40v19,-17,41,-1,41,17v0,13,-6,19,-17,19v-15,0,-29,-14,-24,-36",w:293},"◊":{d:"76,-158v48,-8,64,11,100,36v28,19,-5,39,-22,54v-15,13,-40,32,-48,49v-17,5,-12,0,-27,-16v-6,-6,-86,-31,-68,-53r2,-9v27,-23,48,-44,63,-61xm93,-65v12,-2,35,-31,41,-38v-5,-10,-16,-14,-34,-24v-12,12,-36,29,-40,44v19,11,30,18,33,18",w:199},"ÿ":{d:"118,85v-11,11,-11,38,-22,61v-2,-1,-2,31,-17,27v-11,0,-21,-10,-21,-22v20,-66,23,-61,64,-168v-22,1,-38,16,-58,4v-22,4,-51,-16,-51,-42v-11,-13,-7,-59,7,-58v16,1,21,24,22,51v21,33,66,5,94,-7v4,-3,26,-14,38,-29r17,0v23,44,-23,59,-34,102v-6,9,-13,9,-13,26v-15,6,-12,33,-27,48v0,2,1,4,1,7xm158,-136v0,8,-4,13,-12,13v-18,0,-21,-20,-16,-34v18,-1,29,1,28,21xm62,-161v7,3,28,9,27,18v1,8,-8,17,-17,17v-18,0,-26,-24,-10,-35",w:190},"Ÿ":{d:"176,-189v35,20,-25,54,-39,72v-26,34,-57,57,-74,104v-10,15,-4,14,-23,3r0,-10v19,-44,27,-46,50,-81v-9,-5,-24,4,-34,4v-38,0,-54,-50,-44,-87v21,-5,18,19,22,35v4,18,15,27,29,27v41,0,60,-39,113,-67xm153,-222v0,8,-3,12,-11,12v-18,0,-21,-19,-16,-33v18,-1,28,2,27,21xm57,-247v8,2,29,9,28,17v0,21,-37,24,-36,1v0,-7,2,-13,8,-18",w:135},"⁄":{d:"193,-305v7,6,17,31,3,41v-10,7,-12,13,-21,25v-79,56,-190,209,-197,260r-18,0v-23,-19,9,-70,15,-85v52,-83,121,-179,218,-241",w:120},"¤":{d:"308,-133r-200,16v-2,1,-6,4,-10,10v70,-2,144,-14,211,-8v3,0,8,4,13,8v-1,4,-3,9,-9,17v-57,11,-164,6,-219,25v26,32,112,25,173,25v9,0,35,2,35,19v0,9,-4,13,-12,14v-115,12,-146,23,-211,-19v-12,-4,-22,-9,-25,-27v-6,-29,-61,3,-43,-49v17,-1,36,7,42,-12v-32,7,-36,-39,-11,-40v29,14,63,-25,73,-30v52,-25,72,-44,142,-44v23,0,21,41,-1,39v-35,-3,-61,9,-102,31v2,2,5,4,8,4v18,-6,101,-9,115,-9v7,0,55,13,31,30",w:312},"€":{d:"308,-133r-200,16v-2,1,-6,4,-10,10v70,-2,144,-14,211,-8v3,0,8,4,13,8v-1,4,-3,9,-9,17v-57,11,-164,6,-219,25v26,32,112,25,173,25v9,0,35,2,35,19v0,9,-4,13,-12,14v-115,12,-146,23,-211,-19v-12,-4,-22,-9,-25,-27v-6,-29,-61,3,-43,-49v17,-1,36,7,42,-12v-32,7,-36,-39,-11,-40v29,14,63,-25,73,-30v52,-25,72,-44,142,-44v23,0,21,41,-1,39v-35,-3,-61,9,-102,31v2,2,5,4,8,4v18,-6,101,-9,115,-9v7,0,55,13,31,30",w:312},"‹":{d:"64,-107v9,17,86,17,87,43v0,11,-4,16,-13,16v-36,-11,-70,-22,-109,-31v-19,-4,-18,-14,-9,-36v59,-56,93,-84,101,-84v17,0,19,20,13,29",w:159},"›":{d:"41,-181v26,27,112,44,70,91r-82,60v-20,3,-25,-23,-13,-32r70,-51r-66,-46v-5,-6,-4,-28,5,-29v4,2,9,4,16,7",w:137},"":{d:"74,-74v-6,-24,-70,8,-68,-27v0,-6,6,-20,20,-18v44,6,45,-9,42,-49v7,-40,26,-114,90,-104v48,-2,63,-1,90,30v11,25,4,14,2,44v-7,17,-54,9,-49,-7r8,-21v-5,-13,-22,-9,-43,-11v-56,-6,-63,45,-67,92v-2,21,5,23,22,22v37,-1,80,-9,113,-1v13,31,-9,82,-22,106v-13,10,-26,-6,-22,-25r11,-46v0,-3,-2,-6,-6,-6v-19,0,-47,3,-83,9v-6,1,-9,4,-8,11r12,59v-1,9,-11,30,-23,18v-18,-18,-15,-59,-19,-76",w:272},"":{d:"43,-61v-21,4,-36,2,-39,-15v-4,-35,41,-8,34,-47v4,-59,12,-99,46,-124v11,-42,157,-47,149,13v1,7,-7,15,-13,15v-18,-7,-19,-26,-47,-23v-34,3,-65,6,-79,37v-12,27,-22,52,-21,91v13,9,31,-11,45,-4v32,-15,50,-6,94,-13v12,-30,19,-79,36,-133v1,-5,5,-8,12,-8v44,18,-18,106,-12,144v-9,22,-1,73,-16,104v2,28,-23,28,-37,16v1,-26,9,-48,11,-75v0,-6,-3,-9,-9,-9v-43,0,-83,8,-119,24v8,40,17,33,-7,56v-20,-9,-21,-19,-28,-49",w:283},"‡":{d:"102,-284v16,2,42,-2,33,18v-7,15,-42,1,-38,30v3,3,31,1,30,11v4,15,-29,19,-36,24v-2,18,-4,24,-16,29r-25,-26v-25,7,-53,3,-42,-25v4,-10,70,0,51,-22v-17,4,-41,12,-39,-15v-5,-16,39,-18,44,-20v4,-2,7,-10,10,-24v19,-3,23,6,28,20",w:145},"∙":{d:"57,-77v6,18,-7,21,-19,23v-34,6,-25,-40,-9,-43v18,-3,29,8,28,20",w:67},"‚":{d:"25,63v-26,21,-48,-2,-22,-24v14,-12,35,-40,35,-69v3,-2,3,-11,12,-9v35,17,5,88,-25,102",w:97},"„":{d:"25,63v-26,21,-48,-2,-22,-24v11,-9,36,-41,35,-69v3,-2,4,-12,12,-9v36,14,5,89,-25,102xm84,64v-24,20,-45,-1,-21,-24v21,-20,32,-35,35,-69v3,-2,3,-11,12,-9v36,17,9,86,-26,102",w:135},"‰":{d:"398,-131v58,-1,87,13,72,65v-1,30,-66,63,-99,65v-56,3,-99,-58,-62,-102v2,2,5,2,8,2v20,-16,51,-17,81,-30xm202,-279v33,0,94,-24,95,18v-7,31,-33,27,-54,55v-36,32,-71,74,-112,99v-18,18,-40,34,-51,58v-19,14,-25,37,-56,40v-17,2,-25,-29,-10,-40v15,-11,40,-37,52,-52r87,-72v-51,13,-100,6,-116,-27v1,-5,-6,-30,-9,-36v-3,-5,22,-41,27,-39v29,2,16,34,5,49v0,15,14,23,42,23v42,0,59,-31,28,-38v-17,-4,-53,3,-50,-23v0,-7,1,-12,4,-16v16,-9,36,4,49,5v0,0,23,-4,69,-4xm222,-118v33,-2,55,18,50,57v-29,36,-48,45,-96,50v-27,-5,-56,-17,-58,-51v13,-37,64,-43,104,-56xm335,-61v13,44,101,7,108,-31v-11,-3,-20,-4,-30,-4v-18,-1,-82,18,-78,35xm225,-244v-18,0,-29,-1,-46,3v7,15,6,28,0,43v15,-14,34,-30,46,-46xm164,-53v26,5,59,-10,76,-26v-17,-16,-49,2,-67,14v1,8,-8,6,-9,12",w:485},"Â":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm202,-219v-27,-6,-40,-26,-61,-37v-21,7,-39,46,-65,23v-2,-4,-3,-10,-4,-14v19,-4,43,-32,61,-43v27,6,40,22,62,37v12,8,18,17,18,25v0,6,-3,9,-11,9"},"Ê":{d:"49,-160v1,-4,-10,-9,-15,-8v-15,-35,32,-30,57,-31r142,-8v2,1,30,7,40,10v-52,16,-133,17,-190,30v-7,9,-12,24,-15,47v26,10,102,-6,141,3v1,3,1,6,2,10v-36,18,-92,12,-149,21v-11,9,-16,41,-16,51v55,-1,111,-21,168,-13v15,-8,48,1,31,18v-53,16,-130,13,-198,29r-39,-8v-4,-19,17,-53,20,-76v-1,0,-7,-11,-9,-18v18,-7,22,-28,30,-57xm199,-211v-27,-6,-39,-26,-60,-37v-21,7,-40,47,-65,22v-2,-7,-2,-7,-4,-13v18,-5,44,-31,61,-43v27,6,41,22,62,37v12,9,18,17,18,25v0,6,-4,9,-12,9",w:252},"Á":{d:"161,-217v20,53,23,124,54,170v-2,20,-34,9,-42,0v-27,-12,-78,-18,-101,-18v-26,6,-29,51,-54,63v-18,-4,-19,-30,-3,-38v5,-9,15,-16,8,-29v1,-12,23,-9,26,-19v6,-10,11,-20,20,-27r70,-121v12,-4,16,4,22,19xm82,-91v17,3,62,7,86,13v-13,-33,-13,-80,-29,-109v-15,30,-38,63,-57,96xm84,-250v31,-5,83,-53,100,-31v0,5,-11,15,-35,28v-16,5,-51,28,-53,25v-14,1,-16,-11,-12,-22"},"Ë":{d:"49,-160v1,-4,-10,-9,-15,-8v-15,-35,32,-30,57,-31r142,-8v2,1,30,7,40,10v-52,16,-133,17,-190,30v-7,9,-12,24,-15,47v26,10,102,-6,141,3v1,3,1,6,2,10v-36,18,-92,12,-149,21v-11,9,-17,41,-17,51v55,0,112,-21,169,-13v15,-8,48,1,31,18v-53,16,-130,13,-198,29r-39,-8v-3,-21,17,-53,20,-76v-1,0,-7,-11,-9,-18v18,-7,22,-28,30,-57xm191,-236v0,8,-4,13,-12,13v-17,0,-19,-19,-16,-34v18,-1,29,1,28,21xm95,-261v7,3,29,9,28,18v0,7,-9,17,-18,17v-18,0,-26,-25,-10,-35",w:252},"È":{d:"49,-160v1,-4,-10,-9,-15,-8v-15,-35,32,-30,57,-31r142,-8v2,1,30,7,40,10v-52,16,-133,17,-190,30v-7,9,-12,24,-15,47v26,10,102,-6,141,3v1,3,1,6,2,10v-36,18,-92,12,-149,21v-11,9,-16,41,-16,51v55,-1,111,-21,168,-13v15,-8,48,1,31,18v-53,16,-130,13,-198,29r-39,-8v-4,-19,17,-53,20,-76v-1,0,-7,-11,-9,-18v18,-7,22,-28,30,-57xm184,-236v6,9,5,13,0,23v-28,-7,-62,-21,-100,-41v-3,-2,-3,-27,5,-23v34,11,60,25,95,41",w:252},"Í":{d:"26,-5v-9,-6,-9,-12,-9,-36v0,-71,7,-119,21,-144v8,-13,14,-20,19,-20v28,19,-7,89,-10,120v-2,21,-8,47,-14,76v-2,1,-2,0,-7,4xm6,-233v31,-6,83,-53,101,-31v2,11,-80,53,-89,53v-14,1,-14,-11,-12,-22",w:104},"Î":{d:"53,-9v-15,7,-16,-3,-16,-32v0,-71,7,-119,21,-144v8,-13,14,-20,19,-20v28,19,-7,89,-10,120v-2,21,-8,47,-14,76xm137,-209v-27,-6,-40,-26,-61,-37v-8,0,-9,4,-13,10v-11,13,-50,37,-56,0v18,-5,43,-32,61,-43v28,5,40,21,62,36v12,9,18,17,18,25v0,6,-4,9,-11,9",w:144},"Ï":{d:"33,-5v-9,-6,-9,-12,-9,-36v0,-71,8,-119,22,-144v8,-13,14,-20,19,-20v27,20,-11,87,-10,120r-15,76v-1,1,-4,2,-7,4xm111,-222v0,8,-4,12,-12,12v-18,0,-19,-19,-16,-33v18,-1,29,1,28,21xm15,-247v8,2,29,9,28,17v0,21,-37,24,-36,1v0,-7,2,-13,8,-18",w:110},"Ì":{d:"33,-5v-9,-6,-9,-12,-9,-36v0,-71,8,-119,22,-144v8,-13,14,-20,19,-20v27,20,-11,87,-10,120r-15,76v-1,1,-4,2,-7,4xm72,-247v7,6,55,15,36,40v-28,-7,-61,-21,-99,-41v-3,-2,-3,-27,5,-23v18,3,41,17,58,24",w:111},"Ó":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm142,-250v27,-11,47,-32,59,-14v2,11,-80,53,-89,53v-13,1,-15,-11,-12,-21v10,-5,24,-11,42,-18",w:273},"Ô":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm157,-282v17,18,52,34,54,63v-24,12,-52,-36,-53,-29r-42,34v-23,-4,-6,-31,5,-34v1,1,27,-37,36,-34",w:273},"":{d:"231,-188v31,-74,91,-99,188,-116v28,1,6,39,1,51v-20,52,-100,91,-148,126v2,4,6,7,12,10v42,-42,181,-41,166,46v-1,8,-19,8,-28,5v-43,1,-168,42,-106,86v15,16,33,28,61,39v0,10,0,17,-6,22v-8,8,-35,26,-78,51v-52,7,-128,22,-154,-17v-23,-35,-99,-35,-117,-77v-29,-68,25,-149,75,-175v44,-23,89,5,135,13v14,-26,2,-39,-1,-64",w:461},"Ò":{d:"62,-184v78,-31,249,-50,238,74v-6,65,-102,105,-179,115v-77,-7,-152,-71,-101,-149v2,-5,24,-33,42,-40xm279,-120v14,-38,-47,-64,-85,-61v-20,-9,-41,7,-62,0v-11,7,-54,12,-66,24v0,20,-51,35,-38,66v-1,43,50,67,96,67v44,0,162,-55,155,-96xm161,-262v14,10,52,13,37,41v-28,-7,-62,-21,-100,-41v-3,-3,-3,-26,5,-24v16,5,42,17,58,24",w:273},"Ú":{d:"281,-202v6,67,-30,121,-71,152v-3,14,-47,26,-60,39v-41,20,-110,1,-125,-26v-24,-44,-28,-84,-8,-127v12,-26,23,-38,37,-22v-2,2,-3,5,-3,10v-34,26,-30,116,5,134v22,32,86,-1,109,-8v38,-28,104,-64,97,-149v2,-10,7,-8,19,-3xm194,-265v3,-1,11,4,11,6v3,12,-81,52,-89,54v-14,0,-13,-9,-12,-22",w:262},"Û":{d:"281,-202v6,67,-30,121,-71,152v-3,14,-47,26,-60,39v-41,20,-110,1,-125,-26v-24,-44,-28,-84,-8,-127v12,-26,23,-38,37,-22v-2,2,-3,5,-3,10v-34,26,-30,116,5,134v22,32,86,-1,109,-8v38,-28,104,-64,97,-149v2,-10,7,-8,19,-3xm150,-266v24,11,58,27,73,46v0,5,-3,6,-10,6v-28,2,-61,-30,-63,-25v-10,0,-57,40,-69,23v3,-10,-8,-15,8,-19v17,-1,34,-29,61,-31",w:262},"Ù":{d:"281,-202v6,67,-30,121,-71,152v-3,14,-47,26,-60,39v-41,20,-110,1,-125,-26v-24,-44,-28,-84,-8,-127v12,-26,23,-38,37,-22v-2,2,-3,5,-3,10v-34,26,-30,116,5,134v22,32,86,-1,109,-8v38,-28,104,-64,97,-149v2,-10,7,-8,19,-3xm151,-243v14,10,54,14,37,41v-28,-7,-61,-22,-99,-42v-3,-2,-4,-25,4,-23v16,5,42,17,58,24",w:262},"ı":{d:"43,-103v21,4,16,56,11,100v-7,2,-11,1,-20,-5v0,-7,-13,-18,-11,-25v4,-23,-3,-68,20,-70",w:80},"ˆ":{d:"144,-220v-29,0,-41,-27,-63,-39v-8,0,-11,5,-15,11v-17,12,-32,31,-54,13v-2,-5,-3,-9,-4,-14v20,-5,45,-33,64,-45v28,6,43,23,65,38v12,9,19,19,19,27v0,6,-4,9,-12,9",w:165},"˜":{d:"47,-300v26,-21,57,19,72,23v4,0,16,-5,36,-14v24,-10,22,-16,32,-13v3,12,-7,11,-7,23v-27,21,-48,32,-62,32v-3,2,-52,-27,-51,-31v-12,-2,-34,40,-54,33v-4,-13,-8,-18,1,-24v5,-7,16,-15,33,-29",w:186},"¯":{d:"63,-295v28,-7,73,10,105,7v11,1,6,8,5,19v-37,21,-72,11,-136,11v-23,0,-31,-14,-27,-36v12,-15,40,0,53,-1",w:183},"˘":{d:"65,-269v20,-11,45,-31,74,-36v20,30,-42,40,-59,66v-5,6,-11,8,-18,8v-8,-3,-45,-32,-51,-54v5,-24,14,-13,34,1",w:158},"˙":{d:"23,-302v15,-13,32,1,32,18v1,22,-36,29,-39,4v0,0,3,-7,7,-22",w:70},"˚":{d:"23,-225v-43,-24,-11,-85,41,-78v16,2,31,4,46,17v32,54,-41,86,-87,61xm33,-257v2,20,57,11,57,-6v0,-6,-11,-9,-33,-12v-14,-2,-24,13,-24,18",w:123},"¸":{d:"74,16v32,2,49,14,55,36v-3,7,-14,31,-29,33v-28,4,-57,11,-88,14v-19,-6,-13,-31,8,-33v20,-1,59,-5,73,-14v-17,-14,-68,8,-53,-37v9,-10,2,-28,24,-30v8,8,13,17,10,31",w:129},"˝":{d:"91,-249v15,-11,38,-53,57,-29v0,9,0,14,-3,23v-2,3,-20,22,-54,55v-5,5,-10,8,-16,8v-17,2,-6,-22,-7,-31v-1,0,-2,0,-4,1v-17,21,-29,31,-50,27v-5,-18,-3,-15,3,-27v23,-27,40,-46,48,-59v7,-12,31,3,29,9v-1,14,-3,24,-13,31v4,4,9,-1,10,-8",w:151},"˛":{d:"82,-5v-8,12,-16,55,-21,75v0,4,2,7,7,7v6,0,22,-7,50,-20v8,0,12,7,12,20v-2,22,-6,14,-27,30v-15,12,-26,16,-30,16v-47,-8,-59,-14,-56,-75v8,-27,12,-54,25,-77v19,-21,35,15,40,24",w:138},"ˇ":{d:"39,-286v33,46,63,-4,96,-16v6,0,9,6,9,19v0,24,-49,46,-77,46v-32,0,-52,-28,-59,-48v0,-25,23,-17,31,-1",w:153},"\r":{w:179}}}),function(){"use strict";function e(e){this.message=e}function n(t,i){if(!t)throw new e(i)}function r(e){return e.x+e.width/2}function a(e){return e.y+e.height/2}var o=Diagram.PLACEMENT,s=Diagram.LINETYPE,l=Diagram.ARROWTYPE,c={stroke:"#000","stroke-width":2},u={fill:"#fff"};e.prototype.toString=function(){return"AssertException: "+this.message},String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")}),t.fn.line=function(e,t,r,a){return n(i.all([e,r,t,a],i.isFinite),"x1,x2,y1,y2 must be numeric"),this.path("M{0},{1} L{2},{3}",e,t,r,a)},t.fn.wobble=function(e,t,r,a){n(i.all([e,r,t,a],i.isFinite),"x1,x2,y1,y2 must be numeric");var o=Math.sqrt((r-e)*(r-e)+(a-t)*(a-t))/25,s=Math.random(),l=Math.random(),c=Math.random()>.5?o:-o,u=Math.random()>.5?o:-o,d={x:(r-e)*s+e+c,y:(a-t)*s+t+u},h={x:(r-e)*l+e-c,y:(a-t)*l+t-u};return"C"+d.x+","+d.y+" "+h.x+","+h.y+" "+r+","+a},t.fn.text_bbox=function(e,t){var i;t._obj?i=this.print_center(0,0,e,t._obj,t["font-size"]):(i=this.text(0,0,e),i.attr(t));var n=i.getBBox();return i.remove(),n},t.fn.handRect=function(e,t,r,a){return n(i.all([e,t,r,a],i.isFinite),"x, y, w, h must be numeric"),this.path("M"+e+","+t+this.wobble(e,t,e+r,t)+this.wobble(e+r,t,e+r,t+a)+this.wobble(e+r,t+a,e,t+a)+this.wobble(e,t+a,e,t)).attr(u)},t.fn.handLine=function(e,t,r,a){return n(i.all([e,r,t,a],i.isFinite),"x1,x2,y1,y2 must be numeric"),this.path("M"+e+","+t+this.wobble(e,t,r,a))},t.fn.print_center=function(e,i,n,r,a,o){var s=this.print(e,i,n,r,a,"baseline",o),l=s.getBBox(),c=e-l.x-l.width/2,u=i-l.y-l.height/2,d=new t.matrix;return d.translate(c,u),s.attr("path",t.mapPath(s.attr("path"),d))};var d=function(e){this.init(e)};i.extend(d.prototype,{init:function(e){this.diagram=e,this._paper=void 0,this._font=void 0,this._title=void 0,this._actors_height=0,this._signals_height=0;var t=this.arrow_types={};t[l.FILLED]="block",t[l.OPEN]="open";var i=this.line_types={};i[s.SOLID]="",i[s.DOTTED]="-"},init_paper:function(e){this._paper=new t(e,320,200)},init_font:function(){},draw_line:function(e,t,i,n){return this._paper.line(e,t,i,n)},draw_rect:function(e,t,i,n){return this._paper.rect(e,t,i,n)},draw:function(e){var t=this.diagram;this.init_paper(e),this.init_font(),this.layout();var i=this._title?this._title.height:0;this._paper.setStart(),this._paper.setSize(t.width,t.height);var n=10+i;this.draw_title(),this.draw_actors(n),this.draw_signals(n+this._actors_height),this._paper.setFinish()},layout:function(){function e(e,t,i){n(t>e,"a must be less than or equal to b"),0>e?(t=s[t],t.x=Math.max(i-t.width/2,t.x)):t>=s.length?(e=s[e],e.padding_right=Math.max(i,e.padding_right)):(e=s[e],e.distances[t]=Math.max(i,e.distances[t]?e.distances[t]:0))}var t=this.diagram,r=this._paper,a=this._font,s=t.actors,l=t.signals;if(t.width=0,t.height=0,t.title){var c=this._title={},u=r.text_bbox(t.title,a);c.text_bb=u,c.message=t.title,c.width=u.width+10,c.height=u.height+10,c.x=10,c.y=10,t.width+=c.width,t.height+=c.height}i.each(s,function(e){var t=r.text_bbox(e.name,a);e.text_bb=t,e.x=0,e.y=0,e.width=t.width+40,e.height=t.height+40,e.distances=[],e.padding_right=0,this._actors_height=Math.max(e.height,this._actors_height)},this),i.each(l,function(t){var i,n,s=r.text_bbox(t.message,a);t.text_bb=s,t.width=s.width,t.height=s.height;var l=0;if("Signal"==t.type)t.width+=20,t.height+=20,t.isSelf()?(i=t.actorA.index,n=i+1,t.width+=20):(i=Math.min(t.actorA.index,t.actorB.index),n=Math.max(t.actorA.index,t.actorB.index));else{if("Note"!=t.type)throw new Error("Unhandled signal type:"+t.type);if(t.width+=30,t.height+=30,l=20,t.placement==o.LEFTOF)n=t.actor.index,i=n-1;else if(t.placement==o.RIGHTOF)i=t.actor.index,n=i+1;else if(t.placement==o.OVER&&t.hasManyActors())i=Math.min(t.actor[0].index,t.actor[1].index),n=Math.max(t.actor[0].index,t.actor[1].index),l=-40;else if(t.placement==o.OVER)return i=t.actor.index,e(i-1,i,t.width/2),e(i,i+1,t.width/2),void(this._signals_height+=t.height)}e(i,n,t.width+l),this._signals_height+=t.height},this);var d=0;return i.each(s,function(e){e.x=Math.max(d,e.x),i.each(e.distances,function(t,i){void 0!==t&&(i=s[i],t=Math.max(t,e.width/2,i.width/2),i.x=Math.max(i.x,e.x+e.width/2+t-i.width/2))}),d=e.x+e.width+e.padding_right},this),t.width=Math.max(d,t.width),t.width+=20,t.height+=20+2*this._actors_height+this._signals_height,this},draw_title:function(){var e=this._title;e&&this.draw_text_box(e,e.message,0,5,this._font)},draw_actors:function(e){var t=e;i.each(this.diagram.actors,function(e){this.draw_actor(e,t,this._actors_height),this.draw_actor(e,t+this._actors_height+this._signals_height,this._actors_height);var i=r(e);this.draw_line(i,t+this._actors_height-10,i,t+this._actors_height+10+this._signals_height).attr(c)},this)},draw_actor:function(e,t,i){e.y=t,e.height=i,this.draw_text_box(e,e.name,10,10,this._font)},draw_signals:function(e){var t=e;i.each(this.diagram.signals,function(e){"Signal"==e.type?e.isSelf()?this.draw_self_signal(e,t):this.draw_signal(e,t):"Note"==e.type&&this.draw_note(e,t),t+=e.height},this)},draw_self_signal:function(e,t){n(e.isSelf(),"signal must be a self signal");var a=e.text_bb,o=r(e.actorA),s=o+20+5-a.x,l=t+e.height/2;this.draw_text(s,l,e.message,this._font);var u,d=i.extend({},c,{"stroke-dasharray":this.line_types[e.linetype]}),h=t+5,p=h+e.height-5;u=this.draw_line(o,h,o+20,h),u.attr(d),u=this.draw_line(o+20,h,o+20,p),u.attr(d),u=this.draw_line(o+20,p,o,p),d["arrow-end"]=this.arrow_types[e.arrowtype]+"-wide-long",u.attr(d)},draw_signal:function(e,t){var i=r(e.actorA),n=r(e.actorB),a=(n-i)/2+i,o=t+5+10;this.draw_text(a,o,e.message,this._font),o=t+e.height-5-5;var s=this.draw_line(i,o,n,o);s.attr(c),s.attr({"arrow-end":this.arrow_types[e.arrowtype]+"-wide-long","stroke-dasharray":this.line_types[e.linetype]})},draw_note:function(e,t){e.y=t;var i=e.hasManyActors()?e.actor[0]:e.actor,n=r(i);switch(e.placement){case o.RIGHTOF:e.x=n+10;break;case o.LEFTOF:e.x=n-10-e.width;break;case o.OVER:if(e.hasManyActors()){var a=r(e.actor[1]);e.x=n-20,e.width=a+20-e.x}else e.x=n-e.width/2;break;default:throw new Error("Unhandled note placement:"+e.placement)}this.draw_text_box(e,e.message,10,5,this._font)},draw_text:function(e,t,i,n){var r,a=this._paper,o=n||{};o._obj?r=a.print_center(e,t,i,o._obj,o["font-size"]):(r=a.text(e,t,i),r.attr(o));var s=r.getBBox();a.rect(s.x,s.y,s.width,s.height).attr({fill:"#fff",stroke:"none"}),r.toFront()},draw_text_box:function(e,t,i,n,o){var s=e.x+i,l=e.y+i,u=e.width-2*i,d=e.height-2*i;this.draw_rect(s,l,u,d).attr(c),s=r(e),l=a(e),this.draw_text(s,l,t,o)}});var h=function(e){this.init(e)};i.extend(h.prototype,d.prototype,{init_font:function(){this._font={"font-size":16,"font-family":"Andale Mono, monospace"}}});var p=function(e){this.init(e)};i.extend(p.prototype,d.prototype,{init_font:function(){this._font={"font-size":16,"font-family":"daniel"},this._font._obj=this._paper.getFont("daniel")},draw_line:function(e,t,i,n){return this._paper.handLine(e,t,i,n)},draw_rect:function(e,t,i,n){return this._paper.handRect(e,t,i,n)}});var f={simple:h,hand:p};Diagram.prototype.drawSVG=function(e,t){var n={theme:"hand"};if(t=i.defaults(t||{},n),!(t.theme in f))throw new Error("Unsupported theme: "+t.theme);new f[t.theme](this).draw(e)}}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/css/css",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){for(var t={},i=0;i<e.length;++i)t[e[i]]=!0;return t}function i(e,t){for(var i,n=!1;null!=(i=e.next());){if(n&&"/"==i){t.tokenize=null;break}n="*"==i}return["comment","comment"]}function n(e,t){return e.skipTo("--\x3e")?(e.match("--\x3e"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}e.defineMode("css",function(t,i){function n(e,t){return p=t,e}function r(e,t){var i=e.next();if(g[i]){var r=g[i](e,t);if(!1!==r)return r}return"@"==i?(e.eatWhile(/[\w\\\-]/),n("def",e.current())):"="==i||("~"==i||"|"==i)&&e.eat("=")?n(null,"compare"):'"'==i||"'"==i?(t.tokenize=a(i),t.tokenize(e,t)):"#"==i?(e.eatWhile(/[\w\\\-]/),n("atom","hash")):"!"==i?(e.match(/^\s*\w*/),n("keyword","important")):/\d/.test(i)||"."==i&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),n("number","unit")):"-"!==i?/[,+>*\/]/.test(i)?n(null,"select-op"):"."==i&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?n("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(i)?n(null,i):"u"==i&&e.match(/rl(-prefix)?\(/)||"d"==i&&e.match("omain(")||"r"==i&&e.match("egexp(")?(e.backUp(1),t.tokenize=o,n("property","word")):/[\w\\\-]/.test(i)?(e.eatWhile(/[\w\\\-]/),n("property","word")):n(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),n("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?n("variable-2","variable-definition"):n("variable-2","variable")):e.match(/^\w+-/)?n("meta","meta"):void 0}function a(e){return function(t,i){for(var r,a=!1;null!=(r=t.next());){if(r==e&&!a){")"==e&&t.backUp(1);break}a=!a&&"\\"==r}return(r==e||!a&&")"!=e)&&(i.tokenize=null),n("string","string")}}function o(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=a(")"),n(null,"(")}function s(e,t,i){this.type=e,this.indent=t,this.prev=i}function l(e,t,i){return e.context=new s(i,t.indentation()+m,e.context),i}function c(e){return e.context=e.context.prev,e.context.type}function u(e,t,i){return E[i.context.type](e,t,i)}function d(e,t,i,n){for(var r=n||1;r>0;r--)i.context=i.context.prev;return u(e,t,i)}function h(e){var t=e.current().toLowerCase();f=T.hasOwnProperty(t)?"atom":C.hasOwnProperty(t)?"keyword":"variable"}i.propertyKeywords||(i=e.resolveMode("text/css"));var p,f,m=t.indentUnit,g=i.tokenHooks,v=i.documentTypes||{},y=i.mediaTypes||{},_=i.mediaFeatures||{},b=i.propertyKeywords||{},w=i.nonStandardPropertyKeywords||{},x=i.fontProperties||{},k=i.counterDescriptors||{},C=i.colorKeywords||{},T=i.valueKeywords||{},S=i.allowNested,E={};return E.top=function(e,t,i){if("{"==e)return l(i,t,"block");if("}"==e&&i.context.prev)return c(i);if(/@(media|supports|(-moz-)?document)/.test(e))return l(i,t,"atBlock");if(/@(font-face|counter-style)/.test(e))return i.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(i,t,"at");if("hash"==e)f="builtin";else if("word"==e)f="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(i,t,"interpolation");if(":"==e)return"pseudo";if(S&&"("==e)return l(i,t,"parens")}return i.context.type},E.block=function(e,t,i){if("word"==e){var n=t.current().toLowerCase();return b.hasOwnProperty(n)?(f="property","maybeprop"):w.hasOwnProperty(n)?(f="string-2","maybeprop"):S?(f=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(f+=" error","maybeprop")}return"meta"==e?"block":S||"hash"!=e&&"qualifier"!=e?E.top(e,t,i):(f="error","block")},E.maybeprop=function(e,t,i){return":"==e?l(i,t,"prop"):u(e,t,i)},E.prop=function(e,t,i){if(";"==e)return c(i);if("{"==e&&S)return l(i,t,"propBlock");if("}"==e||"{"==e)return d(e,t,i);if("("==e)return l(i,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)h(t);else if("interpolation"==e)return l(i,t,"interpolation")}else f+=" error";return"prop"},E.propBlock=function(e,t,i){return"}"==e?c(i):"word"==e?(f="property","maybeprop"):i.context.type},E.parens=function(e,t,i){return"{"==e||"}"==e?d(e,t,i):")"==e?c(i):"("==e?l(i,t,"parens"):("word"==e&&h(t),"parens")},E.pseudo=function(e,t,i){return"word"==e?(f="variable-3",i.context.type):u(e,t,i)},E.atBlock=function(e,t,i){if("("==e)return l(i,t,"atBlock_parens");if("}"==e)return d(e,t,i);if("{"==e)return c(i)&&l(i,t,S?"block":"top");if("word"==e){var n=t.current().toLowerCase();f="only"==n||"not"==n||"and"==n||"or"==n?"keyword":v.hasOwnProperty(n)?"tag":y.hasOwnProperty(n)?"attribute":_.hasOwnProperty(n)?"property":b.hasOwnProperty(n)?"property":w.hasOwnProperty(n)?"string-2":T.hasOwnProperty(n)?"atom":"error"}return i.context.type},E.atBlock_parens=function(e,t,i){return")"==e?c(i):"{"==e||"}"==e?d(e,t,i,2):E.atBlock(e,t,i)},E.restricted_atBlock_before=function(e,t,i){return"{"==e?l(i,t,"restricted_atBlock"):"word"==e&&"@counter-style"==i.stateArg?(f="variable","restricted_atBlock_before"):u(e,t,i)},E.restricted_atBlock=function(e,t,i){return"}"==e?(i.stateArg=null,c(i)):"word"==e?(f="@font-face"==i.stateArg&&!x.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==i.stateArg&&!k.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},E.keyframes=function(e,t,i){return"word"==e?(f="variable","keyframes"):"{"==e?l(i,t,"top"):u(e,t,i)},E.at=function(e,t,i){
|
||
return";"==e?c(i):"{"==e||"}"==e?d(e,t,i):("word"==e?f="tag":"hash"==e&&(f="builtin"),"at")},E.interpolation=function(e,t,i){return"}"==e?c(i):"{"==e||";"==e?d(e,t,i):("variable"!=e&&(f="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:"top",stateArg:null,context:new s("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var i=(t.tokenize||r)(e,t);return i&&"object"==typeof i&&(p=i[1],i=i[0]),f=i,t.state=E[t.state](p,e,t),f},indent:function(e,t){var i=e.context,n=t&&t.charAt(0),r=i.indent;return"prop"!=i.type||"}"!=n&&")"!=n||(i=i.prev),!i.prev||("}"!=n||"block"!=i.type&&"top"!=i.type&&"interpolation"!=i.type&&"restricted_atBlock"!=i.type)&&(")"!=n||"parens"!=i.type&&"atBlock_parens"!=i.type)&&("{"!=n||"at"!=i.type&&"atBlock"!=i.type)||(r=i.indent-m,i=i.prev),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var r=["domain","regexp","url","url-prefix"],a=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],s=t(o),l=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],c=t(l),u=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-position","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(u),h=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],p=t(h),f=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],m=t(f),g=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],v=t(g),y=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],_=t(y),b=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scale","scale3d","scaleX","scaleY","scaleZ","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","x-large","x-small","xor","xx-large","xx-small"],w=t(b),x=r.concat(o).concat(l).concat(u).concat(h).concat(y).concat(b);e.registerHelper("hintWords","css",x),e.defineMIME("text/css",{documentTypes:a,mediaTypes:s,mediaFeatures:c,propertyKeywords:d,nonStandardPropertyKeywords:p,fontProperties:m,counterDescriptors:v,colorKeywords:_,valueKeywords:w,tokenHooks:{"<":function(e,t){return!!e.match("!--")&&(t.tokenize=n,n(e,t))},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=i,i(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:s,mediaFeatures:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:_,valueKeywords:w,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=i,i(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:s,mediaFeatures:c,propertyKeywords:d,nonStandardPropertyKeywords:p,colorKeywords:_,valueKeywords:w,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=i,i(e,t)):["operator","operator"]},"@":function(e){return!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/sass/sass",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("sass",function(e){function t(e,t){var i=e.peek();return")"===i?(e.next(),t.tokenizer=s,"operator"):"("===i?(e.next(),e.eatSpace(),"operator"):"'"===i||'"'===i?(t.tokenizer=n(e.next()),"string"):(t.tokenizer=n(")",!1),"string")}function i(e,t){return function(i,n){return i.sol()&&i.indentation()<=e?(n.tokenizer=s,s(i,n)):(t&&i.skipTo("*/")?(i.next(),i.next(),n.tokenizer=s):i.skipToEnd(),"comment")}}function n(e,t){function i(n,a){var o=n.next(),l=n.peek(),c=n.string.charAt(n.pos-2);return"\\"!==o&&l===e||o===e&&"\\"!==c?(o!==e&&t&&n.next(),a.tokenizer=s,"string"):"#"===o&&"{"===l?(a.tokenizer=r(i),n.next(),"operator"):"string"}return null==t&&(t=!0),i}function r(e){return function(t,i){return"}"===t.peek()?(t.next(),i.tokenizer=e,"operator"):s(t,i)}}function a(t){if(0==t.indentCount){t.indentCount++;var i=t.scopes[0].offset,n=i+e.indentUnit;t.scopes.unshift({offset:n})}}function o(e){1!=e.scopes.length&&e.scopes.shift()}function s(e,l){var c=e.peek();if(e.match("/*"))return l.tokenizer=i(e.indentation(),!0),l.tokenizer(e,l);if(e.match("//"))return l.tokenizer=i(e.indentation(),!1),l.tokenizer(e,l);if(e.match("#{"))return l.tokenizer=r(s),"operator";if('"'===c||"'"===c)return e.next(),l.tokenizer=n(c),"string";if(l.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(l.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(l.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(l.cursorHalf=0),"unit";if(e.match(u))return e.peek()||(l.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return l.tokenizer=t,e.peek()||(l.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(l.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(l.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(h))return e.peek()||(l.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(l.cursorHalf=0),"attribute";if(!e.peek())return l.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(l),"atom";if("#"===e.peek())return a(l),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(l),"atom";if("#"===e.peek())return a(l),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(u))return"keyword";if(e.match(/^url/)&&"("===e.peek())return l.tokenizer=t,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(l),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||o(l)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(l),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"propery":e.match(/ *:/,!1)?(a(l),l.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(l),"atom");if(":"===c)return e.match(p)?"keyword":(e.next(),l.cursorHalf=1,"operator")}return e.match(h)?"operator":(e.next(),null)}function l(t,i){t.sol()&&(i.indentCount=0);var n=i.tokenizer(t,i),r=t.current();if("@return"!==r&&"}"!==r||o(i),null!==n){for(var a=t.pos-r.length,s=a+e.indentUnit*i.indentCount,l=[],c=0;c<i.scopes.length;c++){var u=i.scopes[c];u.offset<=s&&l.push(u)}i.scopes=l}return n}var c=["true","false","null","auto"],u=new RegExp("^"+c.join("|")),d=["\\(","\\)","=",">","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],h=function(e){return new RegExp("^"+e.join("|"))}(d),p=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:s,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var i=l(e,t);return t.lastToken={style:i,content:e.current()},i},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/shell/shell",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("shell",function(){function e(e,t){for(var i=t.split(" "),n=0;n<i.length;n++)r[i[n]]=e}function t(e,t){if(e.eatSpace())return null;var o=e.sol(),s=e.next();if("\\"===s)return e.next(),null;if("'"===s||'"'===s||"`"===s)return t.tokens.unshift(i(s)),n(e,t);if("#"===s)return o&&e.eat("!")?(e.skipToEnd(),"meta"):(e.skipToEnd(),"comment");if("$"===s)return t.tokens.unshift(a),n(e,t);if("+"===s||"="===s)return"operator";if("-"===s)return e.eat("-"),e.eatWhile(/\w/),"attribute";if(/\d/.test(s)&&(e.eatWhile(/\d/),e.eol()||!/\w/.test(e.peek())))return"number";e.eatWhile(/[\w-]/);var l=e.current();return"="===e.peek()&&/\w+/.test(l)?"def":r.hasOwnProperty(l)?r[l]:null}function i(e){return function(t,i){for(var n,r=!1,o=!1;null!=(n=t.next());){if(n===e&&!o){r=!0;break}if("$"===n&&!o&&"'"!==e){o=!0,t.backUp(1),i.tokens.unshift(a);break}o=!o&&"\\"===n}return!r&&o||i.tokens.shift(),"`"===e||")"===e?"quote":"string"}}function n(e,i){return(i.tokens[0]||t)(e,i)}var r={};e("atom","true false"),e("keyword","if then do else elif while until for in esac fi fin fil done exit set unset export function"),e("builtin","ab awk bash beep cat cc cd chown chmod chroot clear cp curl cut diff echo find gawk gcc get git grep kill killall ln ls make mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh shopt shred source sort sleep ssh start stop su sudo tee telnet top touch vi vim wall wc wget who write yes zsh");var a=function(e,t){t.tokens.length>1&&e.eat("$");var r=e.next(),a=/\w/;return"{"===r&&(a=/[^}]/),"("===r?(t.tokens[0]=i(")"),n(e,t)):(/\d/.test(r)||(e.eatWhile(a),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return n(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/sql/sql",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("sql",function(t,i){"use strict";function n(e,t){var i=e.next();if(f[i]){var n=f[i](e,t);if(!1!==n)return n}if(1==p.hexNumber&&("0"==i&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==i||"X"==i)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==i||"B"==i)&&e.match(/^'[01]+'/)||"0"==i&&e.match(/^b[01]+/)))return"number";if(i.charCodeAt(0)>47&&i.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==i&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==i||'"'==i&&p.doubleQuote)return t.tokenize=r(i),t.tokenize(e,t);if((1==p.nCharCast&&("n"==i||"N"==i)||1==p.charsetCast&&"_"==i&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(i))return null;if(p.commentSlashSlash&&"/"==i&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==i||"-"==i&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==i&&e.eat("*"))return t.tokenize=a,t.tokenize(e,t);if("."!=i){if(h.test(i))return e.eatWhile(h),null;if("{"==i&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var o=e.current().toLowerCase();return m.hasOwnProperty(o)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(o)?"atom":u.hasOwnProperty(o)?"builtin":d.hasOwnProperty(o)?"keyword":l.hasOwnProperty(o)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function r(e){return function(t,i){for(var r,a=!1;null!=(r=t.next());){if(r==e&&!a){i.tokenize=n;break}a=!a&&"\\"==r}return"string"}}function a(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=n;break}}return"comment"}function o(e,t,i){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:i}}function s(e){e.indent=e.context.indent,e.context=e.context.prev}var l=i.client||{},c=i.atoms||{false:!0,true:!0,null:!0},u=i.builtin||{},d=i.keywords||{},h=i.operatorChars||/^[*+\-%<>!=&|~^]/,p=i.support||{},f=i.hooks||{},m=i.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:n,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var i=t.tokenize(e,t);if("comment"==i)return i;t.context&&null==t.context.align&&(t.context.align=!0);var n=e.current();return"("==n?o(e,t,")"):"["==n?o(e,t,"]"):t.context&&t.context.type==n&&s(t),i},indent:function(i,n){var r=i.context;if(!r)return e.Pass;var a=n.charAt(0)==r.type;return r.align?r.col+(a?0:1):r.indent+(a?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){"use strict";function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function i(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function n(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function r(e){for(var t={},i=e.split(" "),n=0;n<i.length;++n)t[i[n]]=!0;return t}var a="alter and as asc between by count create delete desc distinct drop from having in insert into is join like not on or order select set table union update values where ";e.defineMIME("text/x-sql",{name:"sql",keywords:r(a+"begin"),builtin:r("bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric"),atoms:r("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:r("date time timestamp"),support:r("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:r("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:r(a+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered"),builtin:r("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:r("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:r("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":i}}),e.defineMIME("text/x-mysql",{name:"sql",client:r("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:r(a+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group groupby_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),
|
||
builtin:r("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:r("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:r("date time timestamp"),support:r("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":i,"`":t,"\\":n}}),e.defineMIME("text/x-mariadb",{name:"sql",client:r("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:r(a+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:r("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:r("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:r("date time timestamp"),support:r("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":i,"`":t,"\\":n}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:r("use select from using consistency where limit first reversed first and in insert into values using consistency ttl update set delete truncate begin batch apply create keyspace with columnfamily primary key index on drop alter type add any one quorum all local_quorum each_quorum"),builtin:r("ascii bigint blob boolean counter decimal double float int text timestamp uuid varchar varint"),atoms:r("false true"),operatorChars:/^[<>=]/,dateSQL:{},support:r("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:r("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:r("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:r("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least lenght lenghtb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:r("date time timestamp"),support:r("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:r("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:r("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:r("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:r("date timestamp"),support:r("ODBCdotTable doubleQuote binaryNumber hexNumber")})}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/clike/clike",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){for(var t={},i=e.split(" "),n=0;n<i.length;++n)t[i[n]]=!0;return t}function i(e,t){if(!t.startOfLine)return!1;for(;;){if(!e.skipTo("\\")){e.skipToEnd(),t.tokenize=null;break}if(e.next(),e.eol()){t.tokenize=i;break}}return"meta"}function n(e,t){if(e.backUp(1),e.match(/(R|u8R|uR|UR|LR)/)){var i=e.match(/"([^\s\\()]{0,16})\(/);return!!i&&(t.cpp11RawStringDelim=i[1],t.tokenize=a,a(e,t))}return e.match(/(u8|u|U|L)/)?!!e.match(/["']/,!1)&&"string":(e.next(),!1)}function r(e,t){for(var i;null!=(i=e.next());)if('"'==i&&!e.eat('"')){t.tokenize=null;break}return"string"}function a(e,t){var i=t.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&");return e.match(new RegExp(".*?\\)"+i+'"'))?t.tokenize=null:e.skipToEnd(),"string"}function o(t,i){function n(e){if(e)for(var t in e)e.hasOwnProperty(t)&&r.push(t)}"string"==typeof t&&(t=[t]);var r=[];n(i.keywords),n(i.builtin),n(i.atoms),r.length&&(i.helperType=t[0],e.registerHelper("hintWords",t[0],r));for(var a=0;a<t.length;++a)e.defineMIME(t[a],i)}function s(e,t){for(var i=!1;!e.eol();){if(!i&&e.match('"""')){t.tokenize=null;break}i="\\"==e.next()&&!i}return"string"}e.defineMode("clike",function(t,i){function n(e,t){var i=e.next();if(v[i]){var n=v[i](e,t);if(!1!==n)return n}if('"'==i||"'"==i)return t.tokenize=r(i),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(i))return c=i,null;if(/\d/.test(i))return e.eatWhile(/[\w\.]/),"number";if("/"==i){if(e.eat("*"))return t.tokenize=a,a(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(b.test(i))return e.eatWhile(b),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var o=e.current();return p.propertyIsEnumerable(o)?(m.propertyIsEnumerable(o)&&(c="newstatement"),"keyword"):f.propertyIsEnumerable(o)?(m.propertyIsEnumerable(o)&&(c="newstatement"),"builtin"):g.propertyIsEnumerable(o)?"atom":"variable"}function r(e){return function(t,i){for(var n,r=!1,a=!1;null!=(n=t.next());){if(n==e&&!r){a=!0;break}r=!r&&"\\"==n}return(a||!r&&!y)&&(i.tokenize=null),"string"}}function a(e,t){for(var i,n=!1;i=e.next();){if("/"==i&&n){t.tokenize=null;break}n="*"==i}return"comment"}function o(e,t,i,n,r){this.indented=e,this.column=t,this.type=i,this.align=n,this.prev=r}function s(e,t,i){var n=e.indented;return e.context&&"statement"==e.context.type&&(n=e.context.indented),e.context=new o(n,t,i,null,e.context)}function l(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}var c,u=t.indentUnit,d=i.statementIndentUnit||u,h=i.dontAlignCalls,p=i.keywords||{},f=i.builtin||{},m=i.blockKeywords||{},g=i.atoms||{},v=i.hooks||{},y=i.multiLineStrings,_=!1!==i.indentStatements,b=/[+\-*&%=<>!?|\/]/;return{startState:function(e){return{tokenize:null,context:new o((e||0)-u,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,t){var i=t.context;if(e.sol()&&(null==i.align&&(i.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;c=null;var r=(t.tokenize||n)(e,t);if("comment"==r||"meta"==r)return r;if(null==i.align&&(i.align=!0),";"!=c&&":"!=c&&","!=c||"statement"!=i.type)if("{"==c)s(t,e.column(),"}");else if("["==c)s(t,e.column(),"]");else if("("==c)s(t,e.column(),")");else if("}"==c){for(;"statement"==i.type;)i=l(t);for("}"==i.type&&(i=l(t));"statement"==i.type;)i=l(t)}else c==i.type?l(t):_&&(("}"==i.type||"top"==i.type)&&";"!=c||"statement"==i.type&&"newstatement"==c)&&s(t,e.column(),"statement");else l(t);return t.startOfLine=!1,r},indent:function(t,i){if(t.tokenize!=n&&null!=t.tokenize)return e.Pass;var r=t.context,a=i&&i.charAt(0);"statement"==r.type&&"}"==a&&(r=r.prev);var o=a==r.type;return"statement"==r.type?r.indented+("{"==a?0:d):!r.align||h&&")"==r.type?")"!=r.type||o?r.indented+(o?0:u):r.indented+d:r.column+(o?0:1)},electricChars:"{}",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var l="auto if break int case long char register continue return default short do sizeof double static else struct entry switch extern typedef float union for unsigned goto while enum void const signed volatile";o(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:t(l),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":i},modeProps:{fold:["brace","include"]}}),o(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:t(l+" asm dynamic_cast namespace reinterpret_cast try bool explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected wchar_t alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),blockKeywords:t("catch class do else finally for if struct switch try while"),atoms:t("true false null"),hooks:{"#":i,u:n,U:n,L:n,R:n},modeProps:{fold:["brace","include"]}}),o("text/x-java",{name:"clike",keywords:t("abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while"),blockKeywords:t("catch class do else finally for if switch try while"),atoms:t("true false null"),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),o("text/x-csharp",{name:"clike",keywords:t("abstract as base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),blockKeywords:t("catch class do else finally for foreach if struct switch try while"),builtin:t("Boolean Byte Char DateTime DateTimeOffset Decimal Double Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),atoms:t("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=r,r(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),o("text/x-scala",{name:"clike",keywords:t("abstract case catch class def do else extends false final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try trye type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:t("catch class do else finally for forSome if match switch try while"),atoms:t("true false null"),indentStatements:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=s,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"}}}),o(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:t("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4 sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),blockKeywords:t("for while do if else struct"),builtin:t("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:t("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),hooks:{"#":i},modeProps:{fold:["brace","include"]}}),o("text/x-nesc",{name:"clike",keywords:t(l+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),blockKeywords:t("case do else for if switch while struct"),atoms:t("null"),hooks:{"#":i},modeProps:{fold:["brace","include"]}}),o("text/x-objectivec",{name:"clike",keywords:t(l+"inline restrict _Bool _Complex _Imaginery BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),atoms:t("YES NO NULL NILL ON OFF"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":i},modeProps:{fold:"brace"}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/xml/xml",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("xml",function(t,i){function n(e,t){function i(i){return t.tokenize=i,i(e,t)}var n=e.next();if("<"==n)return e.eat("!")?e.eat("[")?e.match("CDATA[")?i(o("atom","]]>")):null:e.match("--")?i(o("comment","--\x3e")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),i(s(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=o("meta","?>"),"meta"):(k=e.eat("/")?"closeTag":"openTag",t.tokenize=r,"tag bracket");if("&"==n){var a;return a=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),a?"atom":"error"}return e.eatWhile(/[^&<]/),null}function r(e,t){var i=e.next();if(">"==i||"/"==i&&e.eat(">"))return t.tokenize=n,k=">"==i?"endTag":"selfcloseTag","tag bracket";if("="==i)return k="equals",null;if("<"==i){t.tokenize=n,t.state=d,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(i)?(t.tokenize=a(i),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(e){var t=function(t,i){for(;!t.eol();)if(t.next()==e){i.tokenize=r;break}return"string"};return t.isInAttribute=!0,t}function o(e,t){return function(i,r){for(;!i.eol();){if(i.match(t)){r.tokenize=n;break}i.next()}return e}}function s(e){return function(t,i){for(var r;null!=(r=t.next());){if("<"==r)return i.tokenize=s(e+1),i.tokenize(t,i);if(">"==r){if(1==e){i.tokenize=n;break}return i.tokenize=s(e-1),i.tokenize(t,i)}}return"meta"}}function l(e,t,i){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=i,(T.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function c(e){e.context&&(e.context=e.context.prev)}function u(e,t){for(var i;;){if(!e.context)return;if(i=e.context.tagName,!T.contextGrabbers.hasOwnProperty(i)||!T.contextGrabbers[i].hasOwnProperty(t))return;c(e)}}function d(e,t,i){return"openTag"==e?(i.tagStart=t.column(),h):"closeTag"==e?p:d}function h(e,t,i){return"word"==e?(i.tagName=t.current(),C="tag",g):(C="error",h)}function p(e,t,i){if("word"==e){var n=t.current();return i.context&&i.context.tagName!=n&&T.implicitlyClosed.hasOwnProperty(i.context.tagName)&&c(i),i.context&&i.context.tagName==n?(C="tag",f):(C="tag error",m)}return C="error",m}function f(e,t,i){return"endTag"!=e?(C="error",f):(c(i),d)}function m(e,t,i){return C="error",f(e,t,i)}function g(e,t,i){if("word"==e)return C="attribute",v;if("endTag"==e||"selfcloseTag"==e){var n=i.tagName,r=i.tagStart;return i.tagName=i.tagStart=null,"selfcloseTag"==e||T.autoSelfClosers.hasOwnProperty(n)?u(i,n):(u(i,n),i.context=new l(i,n,r==i.indented)),d}return C="error",g}function v(e,t,i){return"equals"==e?y:(T.allowMissing||(C="error"),g(e,t,i))}function y(e,t,i){return"string"==e?_:"word"==e&&T.allowUnquoted?(C="string",g):(C="error",g(e,t,i))}function _(e,t,i){return"string"==e?_:g(e,t,i)}var b=t.indentUnit,w=i.multilineTagIndentFactor||1,x=i.multilineTagIndentPastTag;null==x&&(x=!0);var k,C,T=i.htmlMode?{autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0}:{autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1},S=i.alignCDATA;return{startState:function(){return{tokenize:n,state:d,indented:0,tagName:null,tagStart:null,context:null}},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;k=null;var i=t.tokenize(e,t);return(i||k)&&"comment"!=i&&(C=null,t.state=t.state(k||i,e,t),C&&(i="error"==C?i+" error":C)),i},indent:function(t,i,a){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+b;if(o&&o.noIndent)return e.Pass;if(t.tokenize!=r&&t.tokenize!=n)return a?a.match(/^(\s*)/)[0].length:0;if(t.tagName)return x?t.tagStart+t.tagName.length+2:t.tagStart+b*w;if(S&&/<!\[CDATA\[/.test(i))return 0;var s=i&&/^<(\/)?([\w_:\.-]*)/.exec(i);if(s&&s[1])for(;o;){if(o.tagName==s[2]){o=o.prev;break}if(!T.implicitlyClosed.hasOwnProperty(o.tagName))break;o=o.prev}else if(s)for(;o;){var l=T.contextGrabbers[o.tagName];if(!l||!l.hasOwnProperty(s[2]))break;o=o.prev}for(;o&&!o.startOfLine;)o=o.prev;return o?o.indent+b:0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:i.htmlMode?"html":"xml",helperType:i.htmlMode?"html":"xml"}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/javascript/javascript",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("javascript",function(t,i){function n(e){for(var t,i=!1,n=!1;null!=(t=e.next());){if(!i){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}i=!i&&"\\"==t}}function r(e,t,i){return me=e,ge=i,t}function a(e,t){var i=e.next();if('"'==i||"'"==i)return t.tokenize=o(i),t.tokenize(e,t);if("."==i&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return r("number","number");if("."==i&&e.match(".."))return r("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(i))return r(i);if("="==i&&e.eat(">"))return r("=>","operator");if("0"==i&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),r("number","number");if(/\d/.test(i))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),r("number","number");if("/"==i)return e.eat("*")?(t.tokenize=s,s(e,t)):e.eat("/")?(e.skipToEnd(),r("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(n(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),r("regexp","string-2")):(e.eatWhile(Ce),r("operator","operator",e.current()));if("`"==i)return t.tokenize=l,l(e,t);if("#"==i)return e.skipToEnd(),r("error","error");if(Ce.test(i))return e.eatWhile(Ce),r("operator","operator",e.current());if(xe.test(i)){e.eatWhile(xe);var a=e.current(),c=ke.propertyIsEnumerable(a)&&ke[a];return c&&"."!=t.lastType?r(c.type,c.style,a):r("variable","variable",a)}}function o(e){return function(t,i){var n,o=!1;if(_e&&"@"==t.peek()&&t.match(Te))return i.tokenize=a,r("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||o);)o=!o&&"\\"==n;return o||(i.tokenize=a),r("string","string")}}function s(e,t){for(var i,n=!1;i=e.next();){if("/"==i&&n){t.tokenize=a;break}n="*"==i}return r("comment","comment")}function l(e,t){for(var i,n=!1;null!=(i=e.next());){if(!n&&("`"==i||"$"==i&&e.eat("{"))){t.tokenize=a;break}n=!n&&"\\"==i}return r("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var i=e.string.indexOf("=>",e.start);if(!(i<0)){for(var n=0,r=!1,a=i-1;a>=0;--a){var o=e.string.charAt(a),s=Se.indexOf(o);if(s>=0&&s<3){if(!n){++a;break}if(0==--n)break}else if(s>=3&&s<6)++n;else if(xe.test(o))r=!0;else{if(/["'\/]/.test(o))return;if(r&&!n){++a;break}}}r&&!n&&(t.fatArrowAt=a)}}function u(e,t,i,n,r,a){this.indented=e,this.column=t,this.type=i,this.prev=r,this.info=a,null!=n&&(this.align=n)}function d(e,t){for(var i=e.localVars;i;i=i.next)if(i.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var i=n.vars;i;i=i.next)if(i.name==t)return!0}function h(e,t,i,n,r){var a=e.cc;for(Ae.state=e,Ae.stream=r,Ae.marked=null,Ae.cc=a,Ae.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((a.length?a.pop():be?x:w)(i,n)){for(;a.length&&a[a.length-1].lex;)a.pop()();return Ae.marked?Ae.marked:"variable"==i&&d(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)Ae.cc.push(arguments[e])}function f(){return p.apply(null,arguments),!0}function m(e){function t(t){for(var i=t;i;i=i.next)if(i.name==e)return!0;return!1}var n=Ae.state;if(n.context){if(Ae.marked="def",t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;i.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function g(){Ae.state.context={prev:Ae.state.context,vars:Ae.state.localVars},Ae.state.localVars=Ie}function v(){Ae.state.localVars=Ae.state.context.vars,Ae.state.context=Ae.state.context.prev}function y(e,t){var i=function(){var i=Ae.state,n=i.indented;if("stat"==i.lexical.type)n=i.lexical.indented;else for(var r=i.lexical;r&&")"==r.type&&r.align;r=r.prev)n=r.indented;i.lexical=new u(n,Ae.stream.column(),e,null,i.lexical,t)};return i.lex=!0,i}function _(){var e=Ae.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function b(e){function t(i){return i==e?f():";"==e?p():f(t)}return t}function w(e,t){return"var"==e?f(y("vardef",t.length),q,b(";"),_):"keyword a"==e?f(y("form"),x,w,_):"keyword b"==e?f(y("form"),w,_):"{"==e?f(y("}"),B,_):";"==e?f():"if"==e?("else"==Ae.state.lexical.info&&Ae.state.cc[Ae.state.cc.length-1]==_&&Ae.state.cc.pop()(),f(y("form"),x,w,_,Y)):"function"==e?f(ee):"for"==e?f(y("form"),K,w,_):"variable"==e?f(y("stat"),O):"switch"==e?f(y("form"),x,y("}","switch"),b("{"),B,_,_):"case"==e?f(x,b(":")):"default"==e?f(b(":")):"catch"==e?f(y("form"),g,b("("),te,b(")"),w,_,v):"module"==e?f(y("form"),g,oe,v,_):"class"==e?f(y("form"),ie,_):"export"==e?f(y("form"),se,_):"import"==e?f(y("form"),le,_):p(y("stat"),x,b(";"),_)}function x(e){return C(e,!1)}function k(e){
|
||
return C(e,!0)}function C(e,t){if(Ae.state.fatArrowAt==Ae.stream.start){var i=t?L:M;if("("==e)return f(g,y(")"),z(H,")"),_,b("=>"),i,v);if("variable"==e)return p(g,H,b("=>"),i,v)}var n=t?A:E;return Ee.hasOwnProperty(e)?f(n):"function"==e?f(ee,n):"keyword c"==e?f(t?S:T):"("==e?f(y(")"),T,pe,b(")"),_,n):"operator"==e||"spread"==e?f(t?k:x):"["==e?f(y("]"),de,_,n):"{"==e?F(P,"}",null,n):"quasi"==e?p(I,n):f()}function T(e){return e.match(/[;\}\)\],]/)?p():p(x)}function S(e){return e.match(/[;\}\)\],]/)?p():p(k)}function E(e,t){return","==e?f(x):A(e,t,!1)}function A(e,t,i){var n=0==i?E:A,r=0==i?x:k;return"=>"==e?f(g,i?L:M,v):"operator"==e?/\+\+|--/.test(t)?f(n):"?"==t?f(x,b(":"),r):f(r):"quasi"==e?p(I,n):";"!=e?"("==e?F(k,")","call",n):"."==e?f(N,n):"["==e?f(y("]"),T,b("]"),_,n):void 0:void 0}function I(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?f(I):f(x,D)}function D(e){if("}"==e)return Ae.marked="string-2",Ae.state.tokenize=l,f(I)}function M(e){return c(Ae.stream,Ae.state),p("{"==e?w:x)}function L(e){return c(Ae.stream,Ae.state),p("{"==e?w:k)}function O(e){return":"==e?f(_,w):p(E,b(";"),_)}function N(e){if("variable"==e)return Ae.marked="property",f()}function P(e,t){return"variable"==e||"keyword"==Ae.style?(Ae.marked="property",f("get"==t||"set"==t?R:j)):"number"==e||"string"==e?(Ae.marked=_e?"property":Ae.style+" property",f(j)):"jsonld-keyword"==e?f(j):"["==e?f(x,b("]"),j):void 0}function R(e){return"variable"!=e?p(j):(Ae.marked="property",f(ee))}function j(e){return":"==e?f(k):"("==e?p(ee):void 0}function z(e,t){function i(n){if(","==n){var r=Ae.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),f(e,i)}return n==t?f():f(b(t))}return function(n){return n==t?f():p(e,i)}}function F(e,t,i){for(var n=3;n<arguments.length;n++)Ae.cc.push(arguments[n]);return f(y(t,i),z(e,t),_)}function B(e){return"}"==e?f():p(w,B)}function U(e){if(we&&":"==e)return f($)}function $(e){if("variable"==e)return Ae.marked="variable-3",f()}function q(){return p(H,U,V,G)}function H(e,t){return"variable"==e?(m(t),f()):"["==e?F(H,"]"):"{"==e?F(W,"}"):void 0}function W(e,t){return"variable"!=e||Ae.stream.match(/^\s*:/,!1)?("variable"==e&&(Ae.marked="property"),f(b(":"),H,V)):(m(t),f(V))}function V(e,t){if("="==t)return f(k)}function G(e){if(","==e)return f(q)}function Y(e,t){if("keyword b"==e&&"else"==t)return f(y("form","else"),w,_)}function K(e){if("("==e)return f(y(")"),X,b(")"),_)}function X(e){return"var"==e?f(q,b(";"),Z):";"==e?f(Z):"variable"==e?f(Q):p(x,b(";"),Z)}function Q(e,t){return"in"==t||"of"==t?(Ae.marked="keyword",f(x)):f(E,Z)}function Z(e,t){return";"==e?f(J):"in"==t||"of"==t?(Ae.marked="keyword",f(x)):p(x,b(";"),J)}function J(e){")"!=e&&f(x)}function ee(e,t){return"*"==t?(Ae.marked="keyword",f(ee)):"variable"==e?(m(t),f(ee)):"("==e?f(g,y(")"),z(te,")"),_,w,v):void 0}function te(e){return"spread"==e?f(te):p(H,U)}function ie(e,t){if("variable"==e)return m(t),f(ne)}function ne(e,t){return"extends"==t?f(x,ne):"{"==e?f(y("}"),re,_):void 0}function re(e,t){return"variable"==e||"keyword"==Ae.style?(Ae.marked="property","get"==t||"set"==t?f(ae,ee,re):f(ee,re)):"*"==t?(Ae.marked="keyword",f(re)):";"==e?f(re):"}"==e?f():void 0}function ae(e){return"variable"!=e?p():(Ae.marked="property",f())}function oe(e,t){return"string"==e?f(w):"variable"==e?(m(t),f(ue)):void 0}function se(e,t){return"*"==t?(Ae.marked="keyword",f(ue,b(";"))):"default"==t?(Ae.marked="keyword",f(x,b(";"))):p(w)}function le(e){return"string"==e?f():p(ce,ue)}function ce(e,t){return"{"==e?F(ce,"}"):("variable"==e&&m(t),f())}function ue(e,t){if("from"==t)return Ae.marked="keyword",f(x)}function de(e){return"]"==e?f():p(k,he)}function he(e){return"for"==e?p(pe,b("]")):","==e?f(z(S,"]")):p(z(k,"]"))}function pe(e){return"for"==e?f(K,pe):"if"==e?f(x,pe):void 0}function fe(e,t){return"operator"==e.lastType||","==e.lastType||Ce.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var me,ge,ve=t.indentUnit,ye=i.statementIndent,_e=i.jsonld,be=i.json||_e,we=i.typescript,xe=i.wordCharacters||/[\w$\xa1-\uffff]/,ke=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),i=e("keyword b"),n=e("keyword c"),r=e("operator"),a={type:"atom",style:"atom"},o={if:e("if"),while:t,with:t,else:i,do:i,try:i,finally:i,return:n,break:n,continue:n,new:n,delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:r,typeof:r,instanceof:r,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),module:e("module"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n};if(we){var s={type:"variable",style:"variable-3"},l={interface:e("interface"),extends:e("extends"),constructor:e("constructor"),public:e("public"),private:e("private"),protected:e("protected"),static:e("static"),string:s,number:s,bool:s,any:s};for(var c in l)o[c]=l[c]}return o}(),Ce=/[+\-*&%=<>!?|~^]/,Te=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Se="([{}])",Ee={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ae={state:null,column:null,marked:null,cc:null},Ie={name:"this",next:{name:"arguments"}};return _.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new u((e||0)-ve,0,"block",!1),localVars:i.localVars,context:i.localVars&&{vars:i.localVars},indented:0};return i.globalVars&&"object"==typeof i.globalVars&&(t.globalVars=i.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=s&&e.eatSpace())return null;var i=t.tokenize(e,t);return"comment"==me?i:(t.lastType="operator"!=me||"++"!=ge&&"--"!=ge?me:"incdec",h(t,i,me,ge,e))},indent:function(t,n){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var r=n&&n.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(n))for(var l=t.cc.length-1;l>=0;--l){var c=t.cc[l];if(c==_)o=o.prev;else if(c!=Y)break}"stat"==o.type&&"}"==r&&(o=o.prev),ye&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var u=o.type,d=r==u;return"vardef"==u?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==u&&"{"==r?o.indented:"form"==u?o.indented+ve:"stat"==u?o.indented+(fe(t,n)?ye||ve:0):"switch"!=o.info||d||0==i.doubleIndentSwitch?o.align?o.column+(d?0:1):o.indented+(d?0:ve):o.indented+(/^(?:case|default)\b/.test(n)?ve:2*ve)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:be?null:"/*",blockCommentEnd:be?null:"*/",lineComment:be?null:"//",fold:"brace",helperType:be?"json":"javascript",jsonldMode:_e,jsonMode:be}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/htmlmixed/htmlmixed",["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){e.defineMode("htmlmixed",function(t,i){function n(e,t){var i=t.htmlState.tagName;i&&(i=i.toLowerCase());var n=s.token(e,t.htmlState);if("script"==i&&/\btag\b/.test(n)&&">"==e.current()){var r=e.string.slice(Math.max(0,e.pos-100),e.pos).match(/\btype\s*=\s*("[^"]+"|'[^']+'|\S+)[^<]*$/i);r=r?r[1]:"",r&&/[\"\']/.test(r.charAt(0))&&(r=r.slice(1,r.length-1));for(var u=0;u<c.length;++u){var d=c[u];if("string"==typeof d.matches?r==d.matches:d.matches.test(r)){d.mode&&(t.token=a,t.localMode=d.mode,t.localState=d.mode.startState&&d.mode.startState(s.indent(t.htmlState,"")));break}}}else"style"==i&&/\btag\b/.test(n)&&">"==e.current()&&(t.token=o,t.localMode=l,t.localState=l.startState(s.indent(t.htmlState,"")));return n}function r(e,t,i){var n=e.current(),r=n.search(t);return r>-1?e.backUp(n.length-r):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n)),i}function a(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=n,t.localState=t.localMode=null,null):r(e,/<\/\s*script\s*>/,t.localMode.token(e,t.localState))}function o(e,t){return e.match(/^<\/\s*style\s*>/i,!1)?(t.token=n,t.localState=t.localMode=null,null):r(e,/<\/\s*style\s*>/,l.token(e,t.localState))}var s=e.getMode(t,{name:"xml",htmlMode:!0,multilineTagIndentFactor:i.multilineTagIndentFactor,multilineTagIndentPastTag:i.multilineTagIndentPastTag}),l=e.getMode(t,"css"),c=[],u=i&&i.scriptTypes;if(c.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:e.getMode(t,"javascript")}),u)for(var d=0;d<u.length;++d){var h=u[d];c.push({matches:h.matches,mode:h.mode&&e.getMode(t,h.mode)})}return c.push({matches:/./,mode:e.getMode(t,"text/plain")}),{startState:function(){return{token:n,localMode:null,localState:null,htmlState:s.startState()}},copyState:function(t){if(t.localState)var i=e.copyState(t.localMode,t.localState);return{token:t.token,localMode:t.localMode,localState:i,htmlState:e.copyState(s,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,i){return!t.localMode||/^\s*<\//.test(i)?s.indent(t.htmlState,i):t.localMode.indent?t.localMode.indent(t.localState,i):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||s}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/php/php",["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},i=e.split(" "),n=0;n<i.length;++n)t[i[n]]=!0;return t}function i(e,t){return 0==e.length?n(t):function(r,a){for(var o=e[0],s=0;s<o.length;s++)if(r.match(o[s][0]))return a.tokenize=i(e.slice(1),t),o[s][1];return a.tokenize=n(t),"string"}}function n(e){return function(t,i){return r(t,i,e)}}function r(e,t,n){if(e.match("${",!1)||e.match("{$",!1))return t.tokenize=null,"string";if(e.match(/^\$[a-zA-Z_][a-zA-Z0-9_]*/))return e.match("[",!1)&&(t.tokenize=i([[["[",null]],[[/\d[\w\.]*/,"number"],[/\$[a-zA-Z_][a-zA-Z0-9_]*/,"variable-2"],[/[\w\$]+/,"variable"]],[["]",null]]],n)),e.match(/\-\>\w/,!1)&&(t.tokenize=i([[["->",null]],[[/[\w]+/,"variable"]]],n)),"variable-2";for(var r=!1;!e.eol()&&(r||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!r&&e.match(n)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}r="\\"==e.next()&&!r}return"string"}var a="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",o="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",s="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[a,o,s].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var l={name:"clike",helperType:"php",keywords:t(a),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),atoms:t(o),builtin:t(s),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){if(e.match(/<</)){e.eatWhile(/[\w\.]/);var i=e.current().slice(3);if(i)return(t.tokStack||(t.tokStack=[])).push(i,0),t.tokenize=n(i),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=n('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=n(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,i){function n(e,t){var i=t.curMode==a;if(e.sol()&&t.pending&&'"'!=t.pending&&"'"!=t.pending&&(t.pending=null),i)return i&&null==t.php.tokenize&&e.match("?>")?(t.curMode=r,t.curState=t.html,"meta"):a.token(e,t.curState);if(e.match(/^<\?\w*/))return t.curMode=a,t.curState=t.php,"meta";if('"'==t.pending||"'"==t.pending){for(;!e.eol()&&e.next()!=t.pending;);var n="string"}else if(t.pending&&e.pos<t.pending.end){e.pos=t.pending.end;var n=t.pending.style}else var n=r.token(e,t.curState);t.pending&&(t.pending=null);var o,s=e.current(),l=s.search(/<\?/);return-1!=l&&("string"==n&&(o=s.match(/[\'\"]$/))&&!/\?>/.test(s)?t.pending=o[0]:t.pending={end:e.pos,style:n},e.backUp(s.length-l)),n}var r=e.getMode(t,"text/html"),a=e.getMode(t,l);return{startState:function(){var t=e.startState(r),n=e.startState(a);return{html:t,php:n,curMode:i.startOpen?a:r,curState:i.startOpen?n:t,pending:null}},copyState:function(t){var i,n=t.html,o=e.copyState(r,n),s=t.php,l=e.copyState(a,s);return i=t.curMode==r?o:l,{html:o,php:l,curMode:t.curMode,curState:i,pending:t.pending}},token:n,indent:function(e,t){return e.curMode!=a&&/^\s*<\//.test(t)||e.curMode==a&&/^\?>/.test(t)?r.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",l)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/meta",["../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj"]},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"kotlin",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["py","pyw"]},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"]},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"SmartyMixed",mime:"text/x-smarty",mode:"smartymixed"},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml"],alias:["yml"]
|
||
},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]}];for(var t=0;t<e.modeInfo.length;t++){var i=e.modeInfo[t];i.mimes&&(i.mime=i.mimes[0])}e.findModeByMIME=function(t){t=t.toLowerCase();for(var i=0;i<e.modeInfo.length;i++){var n=e.modeInfo[i];if(n.mime==t)return n;if(n.mimes)for(var r=0;r<n.mimes.length;r++)if(n.mimes[r]==t)return n}},e.findModeByExtension=function(t){for(var i=0;i<e.modeInfo.length;i++){var n=e.modeInfo[i];if(n.ext)for(var r=0;r<n.ext.length;r++)if(n.ext[r]==t)return n}},e.findModeByFileName=function(t){for(var i=0;i<e.modeInfo.length;i++){var n=e.modeInfo[i];if(n.file&&n.file.test(t))return n}var r=t.lastIndexOf("."),a=r>-1&&t.substring(r+1,t.length);if(a)return e.findModeByExtension(a)},e.findModeByName=function(t){t=t.toLowerCase();for(var i=0;i<e.modeInfo.length;i++){var n=e.modeInfo[i];if(n.name.toLowerCase()==t)return n;if(n.alias)for(var r=0;r<n.alias.length;r++)if(n.alias[r].toLowerCase()==t)return n}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/markdown/markdown",["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){e.defineMode("markdown",function(t,i){function n(i){if(e.findModeByName){var n=e.findModeByName(i);n&&(i=n.mime||n.mimes[0])}var r=e.getMode(t,i);return"null"==r.name?null:r}function r(e,t,i){return t.f=t.inline=i,i(e,t)}function a(e,t,i){return t.f=t.block=i,i(e,t)}function o(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,w||e.f!=l||(e.f=p,e.block=s),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.thisLineHasContent=!1,null}function s(e,t){var a=e.sol(),o=!1!==t.list;!1!==t.list&&t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):!1!==t.list&&t.indentation>0?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):!1!==t.list&&(t.list=!1,t.listDepth=0);var s=null;if(t.indentationDiff>=4)return t.indentation-=4,e.skipToEnd(),T;if(e.eatSpace())return null;if(s=e.match(H))return t.header=s[0].length<=6?s[0].length:6,i.highlightFormatting&&(t.formatting="header"),t.f=t.inline,d(t);if(t.prevLineHasContent&&(s=e.match(W)))return t.header="="==s[0].charAt(0)?1:2,i.highlightFormatting&&(t.formatting="header"),t.f=t.inline,d(t);if(e.eat(">"))return t.indentation++,t.quote=a?1:t.quote+1,i.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),d(t);if("["===e.peek())return r(e,t,v);if(e.match(B,!0))return D;if((!t.prevLineHasContent||o)&&(e.match(U,!1)||e.match($,!1))){var l=null;return e.match(U,!0)?l="ul":(e.match($,!0),l="ol"),t.indentation+=4,t.list=!0,t.listDepth++,i.taskLists&&e.match(q,!1)&&(t.taskList=!0),t.f=t.inline,i.highlightFormatting&&(t.formatting=["list","list-"+l]),d(t)}return i.fencedCodeBlocks&&e.match(/^```[ \t]*([\w+#]*)/,!0)?(t.localMode=n(RegExp.$1),t.localMode&&(t.localState=t.localMode.startState()),t.f=t.block=c,i.highlightFormatting&&(t.formatting="code-block"),t.code=!0,d(t)):r(e,t,t.inline)}function l(e,t){var i=x.token(e,t.htmlState);return(w&&null===t.htmlState.tagStart&&!t.htmlState.context||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=p,t.block=s,t.htmlState=null),i}function c(e,t){return e.sol()&&e.match("```",!1)?(t.localMode=t.localState=null,t.f=t.block=u,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),T)}function u(e,t){e.match("```"),t.block=s,t.f=p,i.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var n=d(t);return t.code=!1,n}function d(e){var t=[];if(e.formatting){t.push(L),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var n=0;n<e.formatting.length;n++)t.push(L+"-"+e.formatting[n]),"header"===e.formatting[n]&&t.push(L+"-"+e.formatting[n]+"-"+e.header),"quote"===e.formatting[n]&&(!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=e.quote?t.push(L+"-"+e.formatting[n]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref)return t.push(R),t.length?t.join(" "):null;if(e.strong&&t.push(z),e.em&&t.push(j),e.strikethrough&&t.push(F),e.linkText&&t.push(P),e.code&&t.push(T),e.header&&(t.push(C),t.push(C+"-"+e.header)),e.quote&&(t.push(S),!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=e.quote?t.push(S+"-"+e.quote):t.push(S+"-"+i.maxBlockquoteDepth)),!1!==e.list){var r=(e.listDepth-1)%3;r?1===r?t.push(A):t.push(I):t.push(E)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function h(e,t){if(e.match(V,!0))return d(t)}function p(t,n){var r=n.text(t,n);if(void 0!==r)return r;if(n.list)return n.list=null,d(n);if(n.taskList){return"x"!==t.match(q,!0)[1]?n.taskOpen=!0:n.taskClosed=!0,i.highlightFormatting&&(n.formatting="task"),n.taskList=!1,d(n)}if(n.taskOpen=!1,n.taskClosed=!1,n.header&&t.match(/^#+$/,!0))return i.highlightFormatting&&(n.formatting="header"),d(n);var o=t.sol(),s=t.next();if("\\"===s&&(t.next(),i.highlightFormatting)){var c=d(n);return c?c+" formatting-escape":"formatting-escape"}if(n.linkTitle){n.linkTitle=!1;var u=s;"("===s&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var h="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(h),!0))return R}if("`"===s){var p=n.formatting;i.highlightFormatting&&(n.formatting="code");var g=d(n),v=t.pos;t.eatWhile("`");var y=1+t.pos-v;return n.code?y===k?(n.code=!1,g):(n.formatting=p,d(n)):(k=y,n.code=!0,d(n))}if(n.code)return d(n);if("!"===s&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),n.inline=n.f=m,M;if("["===s&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return n.linkText=!0,i.highlightFormatting&&(n.formatting="link"),d(n);if("]"===s&&n.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){i.highlightFormatting&&(n.formatting="link");var c=d(n);return n.linkText=!1,n.inline=n.f=m,c}if("<"===s&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=f,i.highlightFormatting&&(n.formatting="link");var c=d(n);return c?c+=" ":c="",c+O}if("<"===s&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){n.f=n.inline=f,i.highlightFormatting&&(n.formatting="link");var c=d(n);return c?c+=" ":c="",c+N}if("<"===s&&t.match(/^\w/,!1)){if(-1!=t.string.indexOf(">")){/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(t.string.substring(1,t.string.indexOf(">")))&&(n.md_inside=!0)}return t.backUp(1),n.htmlState=e.startState(x),a(t,n,l)}if("<"===s&&t.match(/^\/\w*?>/))return n.md_inside=!1,"tag";var _=!1;if(!i.underscoresBreakWords&&"_"===s&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var b=t.pos-2;if(b>=0){var w=t.string.charAt(b);"_"!==w&&w.match(/(\w)/,!1)&&(_=!0)}}if("*"===s||"_"===s&&!_)if(o&&" "===t.peek());else{if(n.strong===s&&t.eat(s)){i.highlightFormatting&&(n.formatting="strong");var g=d(n);return n.strong=!1,g}if(!n.strong&&t.eat(s))return n.strong=s,i.highlightFormatting&&(n.formatting="strong"),d(n);if(n.em===s){i.highlightFormatting&&(n.formatting="em");var g=d(n);return n.em=!1,g}if(!n.em)return n.em=s,i.highlightFormatting&&(n.formatting="em"),d(n)}else if(" "===s&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return d(n);t.backUp(1)}if(i.strikethrough)if("~"===s&&t.eatWhile(s)){if(n.strikethrough){i.highlightFormatting&&(n.formatting="strikethrough");var g=d(n);return n.strikethrough=!1,g}if(t.match(/^[^\s]/,!1))return n.strikethrough=!0,i.highlightFormatting&&(n.formatting="strikethrough"),d(n)}else if(" "===s&&t.match(/^~~/,!0)){if(" "===t.peek())return d(n);t.backUp(2)}return" "===s&&(t.match(/ +$/,!1)?n.trailingSpace++:n.trailingSpace&&(n.trailingSpaceNewLine=!0)),d(n)}function f(e,t){if(">"===e.next()){t.f=t.inline=p,i.highlightFormatting&&(t.formatting="link");var n=d(t);return n?n+=" ":n="",n+O}return e.match(/^[^>]+/,!0),O}function m(e,t){if(e.eatSpace())return null;var n=e.next();return"("===n||"["===n?(t.f=t.inline=g("("===n?")":"]"),i.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,d(t)):"error"}function g(e){return function(t,n){if(t.next()===e){n.f=n.inline=p,i.highlightFormatting&&(n.formatting="link-string");var r=d(n);return n.linkHref=!1,r}return t.match(b(e),!0)&&t.backUp(1),n.linkHref=!0,d(n)}}function v(e,t){return e.match(/^[^\]]*\]:/,!1)?(t.f=y,e.next(),i.highlightFormatting&&(t.formatting="link"),t.linkText=!0,d(t)):r(e,t,p)}function y(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=_,i.highlightFormatting&&(t.formatting="link");var n=d(t);return t.linkText=!1,n}return e.match(/^[^\]]+/,!0),P}function _(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=p,R)}function b(e){return G[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),G[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),G[e]}var w=e.modes.hasOwnProperty("xml"),x=e.getMode(t,w?{name:"xml",htmlMode:!0}:"text/plain");void 0===i.highlightFormatting&&(i.highlightFormatting=!1),void 0===i.maxBlockquoteDepth&&(i.maxBlockquoteDepth=0),void 0===i.underscoresBreakWords&&(i.underscoresBreakWords=!0),void 0===i.fencedCodeBlocks&&(i.fencedCodeBlocks=!1),void 0===i.taskLists&&(i.taskLists=!1),void 0===i.strikethrough&&(i.strikethrough=!1);var k=0,C="header",T="comment",S="quote",E="variable-2",A="variable-3",I="keyword",D="hr",M="tag",L="formatting",O="link",N="link",P="link",R="string",j="em",z="strong",F="strikethrough",B=/^([*\-=_])(?:\s*\1){2,}\s*$/,U=/^[*\-+]\s+/,$=/^[0-9]+\.\s+/,q=/^\[(x| )\](?=\s)/,H=/^#+/,W=/^(?:\={1,}|-{1,})$/,V=/^[^#!\[\]*_\\<>` "'(~]+/,G=[],Y={startState:function(){return{f:s,prevLineHasContent:!1,thisLineHasContent:!1,block:s,htmlState:null,indentation:0,inline:p,text:h,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1}},copyState:function(t){return{f:t.f,prevLineHasContent:t.prevLineHasContent,thisLineHasContent:t.thisLineHasContent,block:t.block,htmlState:t.htmlState&&e.copyState(x,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,taskList:t.taskList,list:t.list,listDepth:t.listDepth,quote:t.quote,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside}},token:function(e,t){if(t.formatting=!1,e.sol()){var i=!!t.header;if(t.header=0,e.match(/^\s*$/,!0)||i)return t.prevLineHasContent=!1,o(t),i?this.token(e,t):null;t.prevLineHasContent=t.thisLineHasContent,t.thisLineHasContent=!0,t.taskList=!1,t.code=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var n=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,r=4*Math.floor((n-t.indentation)/4);r>4&&(r=4);var a=t.indentation+r;if(t.indentationDiff=a-t.indentation,t.indentation=a,n>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==l?{state:e.htmlState,mode:x}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:Y}},blankLine:o,getType:d,fold:"markdown"};return Y},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/mode/overlay",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.overlayMode=function(t,i,n){return{startState:function(){return{base:e.startState(t),overlay:e.startState(i),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(n){return{base:e.copyState(t,n.base),overlay:e.copyState(i,n.overlay),basePos:n.basePos,baseCur:null,overlayPos:n.overlayPos,overlayCur:null}},token:function(e,r){return(e!=r.streamSeen||Math.min(r.basePos,r.overlayPos)<e.start)&&(r.streamSeen=e,r.basePos=r.overlayPos=e.start),e.start==r.basePos&&(r.baseCur=t.token(e,r.base),r.basePos=e.pos),e.start==r.overlayPos&&(e.pos=e.start,r.overlayCur=i.token(e,r.overlay),r.overlayPos=e.pos),e.pos=Math.min(r.basePos,r.overlayPos),null==r.overlayCur?r.baseCur:null!=r.baseCur&&r.overlay.combineTokens||n&&null==r.overlay.combineTokens?r.baseCur+" "+r.overlayCur:r.overlayCur},indent:t.indent&&function(e,i){return t.indent(e.base,i)},electricChars:t.electricChars,innerMode:function(e){return{state:e.base,mode:t}},blankLine:function(e){t.blankLine&&t.blankLine(e.base),i.blankLine&&i.blankLine(e.overlay)}}}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/gfm/gfm",["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){e.defineMode("gfm",function(t,i){function n(e){return e.code=!1,null}var r=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,t){if(t.combineTokens=null,t.codeBlock)return e.match(/^```/)?(t.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(t.code=!1),e.sol()&&e.match(/^```/))return e.skipToEnd(),t.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var n=1+e.pos-i;return t.code?n===r&&(t.code=!1):(r=n,t.code=!0),null}if(t.code)return e.next(),null;if(e.eatSpace())return t.ateSpace=!0,null;if(e.sol()||t.ateSpace){if(t.ateSpace=!1,e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return t.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return t.combineTokens=!0,"link"}return e.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i)&&"]("!=e.string.slice(e.start-2,e.start)?(t.combineTokens=!0,"link"):(e.next(),null)},blankLine:n},o={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:!0,strikethrough:!0};for(var s in i)o[s]=i[s];return o.name="markdown",e.defineMIME("gfmBase",o),e.overlayMode(e.getMode(t,"gfmBase"),a)},"markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/http/http",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("http",function(){function e(e,t){return e.skipToEnd(),t.cur=o,"error"}function t(t,n){return t.match(/^HTTP\/\d\.\d/)?(n.cur=i,"keyword"):t.match(/^[A-Z]+/)&&/[ \t]/.test(t.peek())?(n.cur=r,"keyword"):e(t,n)}function i(t,i){var r=t.match(/^\d+/);if(!r)return e(t,i);i.cur=n;var a=Number(r[0]);return a>=100&&a<200?"positive informational":a>=200&&a<300?"positive success":a>=300&&a<400?"positive redirect":a>=400&&a<500?"negative client-error":a>=500&&a<600?"negative server-error":"error"}function n(e,t){return e.skipToEnd(),t.cur=o,null}function r(e,t){return e.eatWhile(/\S/),t.cur=a,"string-2"}function a(t,i){return t.match(/^HTTP\/\d\.\d$/)?(i.cur=o,"keyword"):e(t,i)}function o(e){return e.sol()&&!e.eat(/[ \t]/)?e.match(/^.*?:/)?"atom":(e.skipToEnd(),"error"):(e.skipToEnd(),"string")}function s(e){return e.skipToEnd(),null}return{token:function(e,t){var i=t.cur;return i!=o&&i!=s&&e.eatSpace()?null:i(e,t)},blankLine:function(e){e.cur=s},startState:function(){return{cur:t}}}}),e.defineMIME("message/http","http")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/go/go",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("go",function(e){function t(e,t){var r=e.next();if('"'==r||"'"==r||"`"==r)return t.tokenize=i(r),t.tokenize(e,t);if(/[\d\.]/.test(r))return"."==r?e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/):"0"==r?e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/):e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/),"number";if(/[\[\]{}\(\),;\:\.]/.test(r))return s=r,null;if("/"==r){if(e.eat("*"))return t.tokenize=n,n(e,t);if(e.eat("/"))return e.skipToEnd(),"comment"}if(d.test(r))return e.eatWhile(d),"operator";e.eatWhile(/[\w\$_\xa1-\uffff]/);var a=e.current();return c.propertyIsEnumerable(a)?("case"!=a&&"default"!=a||(s="case"),"keyword"):u.propertyIsEnumerable(a)?"atom":"variable"}function i(e){return function(i,n){for(var r,a=!1,o=!1;null!=(r=i.next());){if(r==e&&!a){o=!0;break}a=!a&&"\\"==r}return(o||!a&&"`"!=e)&&(n.tokenize=t),"string"}}function n(e,i){for(var n,r=!1;n=e.next();){if("/"==n&&r){i.tokenize=t;break}r="*"==n}return"comment"}function r(e,t,i,n,r){this.indented=e,this.column=t,this.type=i,this.align=n,this.prev=r}function a(e,t,i){return e.context=new r(e.indented,t,i,null,e.context)}function o(e){if(e.context.prev){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}}var s,l=e.indentUnit,c={break:!0,case:!0,chan:!0,const:!0,continue:!0,default:!0,defer:!0,else:!0,fallthrough:!0,for:!0,func:!0,go:!0,goto:!0,if:!0,import:!0,interface:!0,map:!0,package:!0,range:!0,return:!0,select:!0,struct:!0,switch:!0,type:!0,var:!0,bool:!0,byte:!0,complex64:!0,complex128:!0,float32:!0,float64:!0,int8:!0,int16:!0,int32:!0,int64:!0,string:!0,uint8:!0,uint16:!0,uint32:!0,uint64:!0,int:!0,uint:!0,uintptr:!0},u={true:!0,false:!0,iota:!0,nil:!0,append:!0,cap:!0,close:!0,complex:!0,copy:!0,imag:!0,len:!0,make:!0,new:!0,panic:!0,print:!0,println:!0,real:!0,recover:!0},d=/[+\-*&^%:=<>!|\/]/;return{startState:function(e){return{tokenize:null,context:new r((e||0)-l,0,"top",!1),indented:0,startOfLine:!0}},token:function(e,i){var n=i.context;if(e.sol()&&(null==n.align&&(n.align=!1),i.indented=e.indentation(),i.startOfLine=!0,"case"==n.type&&(n.type="}")),e.eatSpace())return null;s=null;var r=(i.tokenize||t)(e,i);return"comment"==r?r:(null==n.align&&(n.align=!0),"{"==s?a(i,e.column(),"}"):"["==s?a(i,e.column(),"]"):"("==s?a(i,e.column(),")"):"case"==s?n.type="case":"}"==s&&"}"==n.type?n=o(i):s==n.type&&o(i),i.startOfLine=!1,r)},indent:function(e,i){if(e.tokenize!=t&&null!=e.tokenize)return 0;var n=e.context,r=i&&i.charAt(0);if("case"==n.type&&/^(?:case|default)\b/.test(i))return e.context.type="}",n.indented;var a=r==n.type;return n.align?n.column+(a?0:1):n.indented+(a?0:l)},electricChars:"{}):",fold:"brace",blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//"}}),e.defineMIME("text/x-go","go")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../clike/clike")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/dart/dart",["../../lib/codemirror","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},i=0;i<e.length;++i)t[e[i]]=!0;return t}var i="this super static final const abstract class extends external factory implements get native operator set typedef with enum throw rethrow assert break case continue default in return new deferred async await try catch finally do else for if switch while import library export part of show hide is".split(" "),n="try catch finally do else for if switch while".split(" "),r="true false null".split(" "),a="void bool num int double dynamic var String".split(" ");e.defineMIME("application/dart",{name:"clike",keywords:t(i),multiLineStrings:!0,blockKeywords:t(n),builtin:t(a),atoms:t(r),hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}}}),e.registerHelper("hintWords","application/dart",i.concat(r).concat(a)),e.defineMode("dart",function(t){return e.getMode(t,"application/dart")},"clike")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/coffeescript/coffeescript",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("coffeescript",function(e,t){function i(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function n(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var i=t.scope.offset;if(e.eatSpace()){var n=e.indentation();return n>i&&"coffee"==t.scope.type?"indent":n<i?"dedent":null}i>0&&s(e,t)}if(e.eatSpace())return null;var o=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=a,t.tokenize(e,t);if("#"===o)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var l=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(l=!0),e.match(/^-?\d+\.\d*/)&&(l=!0),e.match(/^-?\.\d+/)&&(l=!0),l)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(y))return t.tokenize=r(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(_)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=r(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(f)?"operator":e.match(d)?"punctuation":e.match(w)?"atom":e.match(v)?"keyword":e.match(h)?"variable":e.match(p)?"property":(e.next(),c)}function r(e,i,r){return function(a,o){for(;!a.eol();)if(a.eatWhile(/[^'"\/\\]/),a.eat("\\")){if(a.next(),i&&a.eol())return r}else{if(a.match(e))return o.tokenize=n,r;a.eat(/['"\/]/)}return i&&(t.singleLineStringErrors?r=c:o.tokenize=n),r}}function a(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=n;break}e.eatWhile("#")}return"comment"}function o(t,i,n){n=n||"coffee";for(var r=0,a=!1,o=null,s=i.scope;s;s=s.prev)if("coffee"===s.type||"}"==s.type){r=s.offset+e.indentUnit;break}"coffee"!==n?(a=null,o=t.column()+t.current().length):i.scope.align&&(i.scope.align=!1),i.scope={offset:r,type:n,prev:i.scope,align:a,alignOffset:o}}function s(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var i=e.indentation(),n=!1,r=t.scope;r;r=r.prev)if(i===r.offset){n=!0;break}if(!n)return!0;for(;t.scope.prev&&t.scope.offset!==i;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function l(e,t){var i=t.tokenize(e,t),n=e.current();if("."===n)return i=t.tokenize(e,t),n=e.current(),/^\.[\w$]+$/.test(n)?"variable":c;"return"===n&&(t.dedent=!0),("->"!==n&&"=>"!==n||t.lambda||e.peek())&&"indent"!==i||o(e,t);var r="[({".indexOf(n);if(-1!==r&&o(e,t,"])}".slice(r,r+1)),m.exec(n)&&o(e,t),"then"==n&&s(e,t),"dedent"===i&&s(e,t))return c;if(-1!==(r="])}".indexOf(n))){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==n&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),i}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,d=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,h=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^(@|this\.)[_A-Za-z$][_A-Za-z$0-9]*/,f=i(["and","or","not","is","isnt","in","instanceof","typeof"]),m=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=i(m.concat(g));m=i(m);var y=/^('{3}|\"{3}|['\"])/,_=/^(\/{3}|\/)/,b=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],w=i(b);return{startState:function(e){return{tokenize:n,scope:{offset:e||0,type:"coffee",prev:null,align:!1},lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var i=null===t.scope.align&&t.scope;i&&e.sol()&&(i.align=!1);var n=l(e,t);return i&&n&&"comment"!=n&&(i.align=!0),t.lastToken={style:n,content:e.current()},e.eol()&&e.lambda&&(t.lambda=!1),n},indent:function(e,t){if(e.tokenize!=n)return 0;var i=e.scope,r=t&&"])}".indexOf(t.charAt(0))>-1;if(r)for(;"coffee"==i.type&&i.prev;)i=i.prev;var a=r&&i.type===t.charAt(0);return i.align?i.alignOffset-(a?1:0):(a?i.prev:i).offset},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-coffeescript","coffeescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/nginx/nginx",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("nginx",function(e){function t(e){for(var t={},i=e.split(" "),n=0;n<i.length;++n)t[i[n]]=!0;return t}function i(e,t){return s=t,e}function n(e,t){e.eatWhile(/[\w\$_]/);var n=e.current();if(l.propertyIsEnumerable(n))return"keyword";if(c.propertyIsEnumerable(n))return"variable-2";if(u.propertyIsEnumerable(n))return"string-2";var s=e.next();return"@"==s?(e.eatWhile(/[\w\\\-]/),i("meta",e.current())):"/"==s&&e.eat("*")?(t.tokenize=r,r(e,t)):"<"==s&&e.eat("!")?(t.tokenize=a,a(e,t)):"="!=s?"~"!=s&&"|"!=s||!e.eat("=")?'"'==s||"'"==s?(t.tokenize=o(s),t.tokenize(e,t)):"#"==s?(e.skipToEnd(),i("comment","comment")):"!"==s?(e.match(/^\s*\w*/),i("keyword","important")):/\d/.test(s)?(e.eatWhile(/[\w.%]/),i("number","unit")):/[,.+>*\/]/.test(s)?i(null,"select-op"):/[;{}:\[\]]/.test(s)?i(null,s):(e.eatWhile(/[\w\\\-]/),i("variable","variable")):i(null,"compare"):void i(null,"compare")}function r(e,t){for(var r,a=!1;null!=(r=e.next());){if(a&&"/"==r){t.tokenize=n;break}a="*"==r}return i("comment","comment")}function a(e,t){for(var r,a=0;null!=(r=e.next());){if(a>=2&&">"==r){t.tokenize=n;break}a="-"==r?a+1:0}return i("comment","comment")}function o(e){return function(t,r){for(var a,o=!1;null!=(a=t.next())&&(a!=e||o);)o=!o&&"\\"==a;return o||(r.tokenize=n),i("string","string")}}var s,l=t("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=t("http mail events server types location upstream charset_map limit_except if geo map"),u=t("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),d=e.indentUnit;return{startState:function(e){return{tokenize:n,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;s=null;var i=t.tokenize(e,t),n=t.stack[t.stack.length-1];return"hash"==s&&"rule"==n?i="atom":"variable"==i&&("rule"==n?i="number":n&&"@media{"!=n||(i="tag")),"rule"==n&&/^[\{\};]$/.test(s)&&t.stack.pop(),"{"==s?"@media"==n?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==s?t.stack.pop():"@media"==s?t.stack.push("@media"):"{"==n&&"comment"!=s&&t.stack.push("rule"),i},indent:function(e,t){var i=e.stack.length;return/^\}/.test(t)&&(i-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+i*d},electricChars:"}"}}),e.defineMIME("text/nginx","text/x-nginx-conf")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/python/python",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){
|
||
return new RegExp("^(("+e.join(")|(")+"))\\b")}function i(e){return e.scopes[e.scopes.length-1]}var n=t(["and","or","not","is"]),r=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],a=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"],o={builtins:["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"],keywords:["exec","print"]},s={builtins:["ascii","bytes","exec","print"],keywords:["nonlocal","False","True","None"]};e.registerHelper("hintWords","python",r.concat(a)),e.defineMode("python",function(l,c){function u(e,t){if(e.sol()&&"py"==i(t).type){var n=i(t).offset;if(e.eatSpace()){var r=e.indentation();return r>n?p(e,t,"py"):r<n&&f(e,t)&&(t.errorToken=!0),null}var a=d(e,t);return n>0&&f(e,t)&&(a+=" "+g),a}return d(e,t)}function d(e,t){if(e.eatSpace())return null;if("#"==e.peek())return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var r=!1;if(e.match(/^0x[0-9a-f]+/i)&&(r=!0),e.match(/^0b[01]+/i)&&(r=!0),e.match(/^0o[0-7]+/i)&&(r=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),r=!0),e.match(/^0(?![\dx])/i)&&(r=!0),r)return e.eat(/L/i),"number"}return e.match(S)?(t.tokenize=h(e.current()),t.tokenize(e,t)):e.match(b)||e.match(_)?null:e.match(y)||e.match(w)||e.match(n)?"operator":e.match(v)?null:e.match(E)?"keyword":e.match(A)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(x)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),g)}function h(e){function t(t,r){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),i&&t.eol())return n}else{if(t.match(e))return r.tokenize=u,n;t.eat(/['"]/)}if(i){if(c.singleLineStringErrors)return g;r.tokenize=u}return n}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var i=1==e.length,n="string";return t.isString=!0,t}function p(e,t,n){var r=0,a=null;if("py"==n)for(;"py"!=i(t).type;)t.scopes.pop();r=i(t).offset+("py"==n?l.indentUnit:k),"py"==n||e.match(/^(\s|#.*)*$/,!1)||(a=e.column()+1),t.scopes.push({offset:r,type:n,align:a})}function f(e,t){for(var n=e.indentation();i(t).offset>n;){if("py"!=i(t).type)return!0;t.scopes.pop()}return i(t).offset!=n}function m(e,t){var n=t.tokenize(e,t),r=e.current();if("."==r)return n=e.match(x,!1)?null:g,null==n&&"meta"==t.lastStyle&&(n="meta"),n;if("@"==r)return c.version&&3==parseInt(c.version,10)?e.match(x,!1)?"meta":"operator":e.match(x,!1)?"meta":g;"variable"!=n&&"builtin"!=n||"meta"!=t.lastStyle||(n="meta"),"pass"!=r&&"return"!=r||(t.dedent+=1),"lambda"==r&&(t.lambda=!0),":"!=r||t.lambda||"py"!=i(t).type||p(e,t,"py");var a=1==r.length?"[({".indexOf(r):-1;if(-1!=a&&p(e,t,"])}".slice(a,a+1)),-1!=(a="])}".indexOf(r))){if(i(t).type!=r)return g;t.scopes.pop()}return t.dedent>0&&e.eol()&&"py"==i(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),n}var g="error",v=c.singleDelimiters||new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),y=c.doubleOperators||new RegExp("^((==)|(!=)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),_=c.doubleDelimiters||new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),b=c.tripleDelimiters||new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))");if(c.version&&3==parseInt(c.version,10))var w=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!@]"),x=c.identifiers||new RegExp("^[_A-Za-z¡-][_A-Za-z0-9¡-]*");else var w=c.singleOperators||new RegExp("^[\\+\\-\\*/%&|\\^~<>!]"),x=c.identifiers||new RegExp("^[_A-Za-z][_A-Za-z0-9]*");var k=c.hangingIndent||l.indentUnit,C=r,T=a;if(void 0!=c.extra_keywords&&(C=C.concat(c.extra_keywords)),void 0!=c.extra_builtins&&(T=T.concat(c.extra_builtins)),c.version&&3==parseInt(c.version,10)){C=C.concat(s.keywords),T=T.concat(s.builtins);var S=new RegExp("^(([rb]|(br))?('{3}|\"{3}|['\"]))","i")}else{C=C.concat(o.keywords),T=T.concat(o.builtins);var S=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var E=t(C),A=t(T);return{startState:function(e){return{tokenize:u,scopes:[{offset:e||0,type:"py",align:null}],lastStyle:null,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var i=t.errorToken;i&&(t.errorToken=!1);var n=m(e,t);t.lastStyle=n;var r=e.current();return r&&n&&(t.lastToken=r),e.eol()&&t.lambda&&(t.lambda=!1),i?n+" "+g:n},indent:function(t,n){if(t.tokenize!=u)return t.tokenize.isString?e.Pass:0;var r=i(t),a=n&&n.charAt(0)==r.type;return null!=r.align?r.align-(a?1:0):a&&t.scopes.length>1?t.scopes[t.scopes.length-2].offset:r.offset},lineComment:"#",fold:"indent"}}),e.defineMIME("text/x-python","python");e.defineMIME("text/x-cython",{name:"python",extra_keywords:function(e){return e.split(" ")}("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/perl/perl",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return e.string.charAt(e.pos+(t||0))}function i(e,t){if(t){var i=e.pos-t;return e.string.substr(i>=0?i:0,t)}return e.string.substr(0,e.pos-1)}function n(e,t){var i=e.string.length,n=i-e.pos+1;return e.string.substr(e.pos,t&&t<i?t:n)}function r(e,t){var i,n=e.pos+t;n<=0?e.pos=0:n>=(i=e.string.length-1)?e.pos=i:e.pos=n}e.defineMode("perl",function(){function e(e,t,i,n,r){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var a,s=!1,l=0;a=e.next();){if(a===i[l]&&!s)return void 0!==i[++l]?(t.chain=i[l],t.style=n,t.tail=r):r&&e.eatWhile(r),t.tokenize=o,n;s=!s&&"\\"==a}return n},t.tokenize(e,t)}function a(e,t,i){return t.tokenize=function(e,t){return e.string==i&&(t.tokenize=o),e.skipToEnd(),"string"},t.tokenize(e,t)}function o(o,u){if(o.eatSpace())return null;if(u.chain)return e(o,u,u.chain,u.style,u.tail);if(o.match(/^\-?[\d\.]/,!1)&&o.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(o.match(/^<<(?=\w)/))return o.eatWhile(/\w/),a(o,u,o.current().substr(2));if(o.sol()&&o.match(/^\=item(?!\w)/))return a(o,u,"=cut");var d=o.next();if('"'==d||"'"==d){if(i(o,3)=="<<"+d){var h=o.pos;o.eatWhile(/\w/);var p=o.current().substr(1);if(p&&o.eat(d))return a(o,u,p);o.pos=h}return e(o,u,[d],"string")}if("q"==d){var f=t(o,-2);if(!f||!/\w/.test(f))if("x"==(f=t(o,0))){if("("==(f=t(o,1)))return r(o,2),e(o,u,[")"],l,c);if("["==f)return r(o,2),e(o,u,["]"],l,c);if("{"==f)return r(o,2),e(o,u,["}"],l,c);if("<"==f)return r(o,2),e(o,u,[">"],l,c);if(/[\^'"!~\/]/.test(f))return r(o,1),e(o,u,[o.eat(f)],l,c)}else if("q"==f){if("("==(f=t(o,1)))return r(o,2),e(o,u,[")"],"string");if("["==f)return r(o,2),e(o,u,["]"],"string");if("{"==f)return r(o,2),e(o,u,["}"],"string");if("<"==f)return r(o,2),e(o,u,[">"],"string");if(/[\^'"!~\/]/.test(f))return r(o,1),e(o,u,[o.eat(f)],"string")}else if("w"==f){if("("==(f=t(o,1)))return r(o,2),e(o,u,[")"],"bracket");if("["==f)return r(o,2),e(o,u,["]"],"bracket");if("{"==f)return r(o,2),e(o,u,["}"],"bracket");if("<"==f)return r(o,2),e(o,u,[">"],"bracket");if(/[\^'"!~\/]/.test(f))return r(o,1),e(o,u,[o.eat(f)],"bracket")}else if("r"==f){if("("==(f=t(o,1)))return r(o,2),e(o,u,[")"],l,c);if("["==f)return r(o,2),e(o,u,["]"],l,c);if("{"==f)return r(o,2),e(o,u,["}"],l,c);if("<"==f)return r(o,2),e(o,u,[">"],l,c);if(/[\^'"!~\/]/.test(f))return r(o,1),e(o,u,[o.eat(f)],l,c)}else if(/[\^'"!~\/(\[{<]/.test(f)){if("("==f)return r(o,1),e(o,u,[")"],"string");if("["==f)return r(o,1),e(o,u,["]"],"string");if("{"==f)return r(o,1),e(o,u,["}"],"string");if("<"==f)return r(o,1),e(o,u,[">"],"string");if(/[\^'"!~\/]/.test(f))return e(o,u,[o.eat(f)],"string")}}if("m"==d){var f=t(o,-2);if((!f||!/\w/.test(f))&&(f=o.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(f))return e(o,u,[f],l,c);if("("==f)return e(o,u,[")"],l,c);if("["==f)return e(o,u,["]"],l,c);if("{"==f)return e(o,u,["}"],l,c);if("<"==f)return e(o,u,[">"],l,c)}}if("s"==d){var f=/[\/>\]})\w]/.test(t(o,-2));if(!f&&(f=o.eat(/[(\[{<\^'"!~\/]/)))return"["==f?e(o,u,["]","]"],l,c):"{"==f?e(o,u,["}","}"],l,c):"<"==f?e(o,u,[">",">"],l,c):"("==f?e(o,u,[")",")"],l,c):e(o,u,[f,f],l,c)}if("y"==d){var f=/[\/>\]})\w]/.test(t(o,-2));if(!f&&(f=o.eat(/[(\[{<\^'"!~\/]/)))return"["==f?e(o,u,["]","]"],l,c):"{"==f?e(o,u,["}","}"],l,c):"<"==f?e(o,u,[">",">"],l,c):"("==f?e(o,u,[")",")"],l,c):e(o,u,[f,f],l,c)}if("t"==d){var f=/[\/>\]})\w]/.test(t(o,-2));if(!f&&(f=o.eat("r"))&&(f=o.eat(/[(\[{<\^'"!~\/]/)))return"["==f?e(o,u,["]","]"],l,c):"{"==f?e(o,u,["}","}"],l,c):"<"==f?e(o,u,[">",">"],l,c):"("==f?e(o,u,[")",")"],l,c):e(o,u,[f,f],l,c)}if("`"==d)return e(o,u,[d],"variable-2");if("/"==d)return/~\s*$/.test(i(o))?e(o,u,[d],l,c):"operator";if("$"==d){var h=o.pos;if(o.eatWhile(/\d/)||o.eat("{")&&o.eatWhile(/\d/)&&o.eat("}"))return"variable-2";o.pos=h}if(/[$@%]/.test(d)){var h=o.pos;if(o.eat("^")&&o.eat(/[A-Z]/)||!/[@$%&]/.test(t(o,-2))&&o.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var f=o.current();if(s[f])return"variable-2"}o.pos=h}if(/[$@%&]/.test(d)&&(o.eatWhile(/[\w$\[\]]/)||o.eat("{")&&o.eatWhile(/[\w$\[\]]/)&&o.eat("}"))){var f=o.current();return s[f]?"variable-2":"variable"}if("#"==d&&"$"!=t(o,-2))return o.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(d)){var h=o.pos;if(o.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),s[o.current()])return"operator";o.pos=h}if("_"==d&&1==o.pos){if("_END__"==n(o,6))return e(o,u,["\0"],"comment");if("_DATA__"==n(o,7))return e(o,u,["\0"],"variable-2");if("_C__"==n(o,7))return e(o,u,["\0"],"string")}if(/\w/.test(d)){var h=o.pos;if("{"==t(o,-2)&&("}"==t(o,0)||o.eatWhile(/\w/)&&"}"==t(o,0)))return"string";o.pos=h}if(/[A-Z]/.test(d)){var m=t(o,-2),h=o.pos;if(o.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(o,0))){var f=s[o.current()];return f?(f[1]&&(f=f[0]),":"!=m?1==f?"keyword":2==f?"def":3==f?"atom":4==f?"operator":5==f?"variable-2":"meta":"meta"):"meta"}o.pos=h}if(/[a-zA-Z_]/.test(d)){var m=t(o,-2);o.eatWhile(/\w/);var f=s[o.current()];return f?(f[1]&&(f=f[0]),":"!=m?1==f?"keyword":2==f?"def":3==f?"atom":4==f?"operator":5==f?"variable-2":"meta":"meta"):"meta"}return null}var s={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,if:[1,1],elsif:[1,1],else:[1,1],while:[1,1],unless:[1,1],for:[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,break:1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,continue:[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,default:1,defined:1,delete:1,die:1,do:1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,goto:1,grep:1,hex:1,import:1,index:1,int:1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,new:1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,package:1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,return:1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},l="string-2",c=/[goseximacplud]/;return{startState:function(){return{tokenize:o,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||o)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/lua/lua",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("lua",function(e,t){function i(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function n(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function r(e,t){var i=e.next();return"-"==i&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=a(n(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==i||"'"==i?(t.cur=o(i))(e,t):"["==i&&/[\[=]/.test(e.peek())?(t.cur=a(n(e),"string"))(e,t):/\d/.test(i)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(i)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function a(e,t){return function(i,n){for(var a,o=null;null!=(a=i.next());)if(null==o)"]"==a&&(o=0);else if("="==a)++o;else{if("]"==a&&o==e){n.cur=r;break}o=null}return t}}function o(e){return function(t,i){for(var n,a=!1;null!=(n=t.next())&&(n!=e||a);)a=!a&&"\\"==n;return a||(i.cur=r),"string"}}var s=e.indentUnit,l=i(t.specials||[]),c=i(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),u=i(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),d=i(["function","if","repeat","do","\\(","{"]),h=i(["end","until","\\)","}"]),p=function(e){return new RegExp("^(?:"+e.join("|")+")","i")}(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:r}},token:function(e,t){if(e.eatSpace())return null;var i=t.cur(e,t),n=e.current();return"variable"==i&&(u.test(n)?i="keyword":c.test(n)?i="builtin":l.test(n)&&(i="variable-2")),"comment"!=i&&"string"!=i&&(d.test(n)?++t.indentDepth:h.test(n)&&--t.indentDepth),i},indent:function(e,t){var i=p.test(t);return e.basecol+s*(e.indentDepth-(i?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/r/r",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),i={},n=0;n<t.length;++n)i[t[n]]=!0;return i}function i(e,t){o=null;var i=e.next();if("#"==i)return e.skipToEnd(),"comment";if("0"==i&&e.eat("x"))return e.eatWhile(/[\da-f]/i),"number";if("."==i&&e.eat(/\d/))return e.match(/\d*(?:e[+\-]?\d+)?/),"number";if(/\d/.test(i))return e.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/),"number";if("'"==i||'"'==i)return t.tokenize=n(i),"string";if("."==i&&e.match(/.[.\d]+/))return"keyword";if(/[\w\.]/.test(i)&&"_"!=i){e.eatWhile(/[\w\.]/);var r=e.current();return s.propertyIsEnumerable(r)?"atom":c.propertyIsEnumerable(r)?(u.propertyIsEnumerable(r)&&!e.match(/\s*if(\s+|$)/,!1)&&(o="block"),"keyword"):l.propertyIsEnumerable(r)?"builtin":"variable"}return"%"==i?(e.skipTo("%")&&e.next(),"variable-2"):"<"==i&&e.eat("-")?"arrow":"="==i&&t.ctx.argList?"arg-is":d.test(i)?"$"==i?"dollar":(e.eatWhile(d),"operator"):/[\(\){}\[\];]/.test(i)?(o=i,";"==i?"semi":null):null}function n(e){return function(t,n){if(t.eat("\\")){var r=t.next();return"x"==r?t.match(/^[a-f0-9]{2}/i):("u"==r||"U"==r)&&t.eat("{")&&t.skipTo("}")?t.next():"u"==r?t.match(/^[a-f0-9]{4}/i):"U"==r?t.match(/^[a-f0-9]{8}/i):/[0-7]/.test(r)&&t.match(/^[0-7]{1,2}/),"string-2"}for(var a;null!=(a=t.next());){if(a==e){n.tokenize=i;break}if("\\"==a){t.backUp(1);break}}return"string"}}function r(e,t,i){e.ctx={type:t,indent:e.indent,align:null,column:i.column(),prev:e.ctx}}function a(e){e.indent=e.ctx.indent,e.ctx=e.ctx.prev}var o,s=t("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_"),l=t("list quote bquote eval return call parse deparse"),c=t("if else repeat while function for in next break"),u=t("if else repeat while function for"),d=/[+\-*\/^<>=!&|~$:]/;return{startState:function(){return{tokenize:i,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var i=t.tokenize(e,t);"comment"!=i&&null==t.ctx.align&&(t.ctx.align=!0);var n=t.ctx.type;return";"!=o&&"{"!=o&&"}"!=o||"block"!=n||a(t),"{"==o?r(t,"}",e):"("==o?(r(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==o?r(t,"]",e):"block"==o?r(t,"block",e):o==n&&a(t),t.afterIdent="variable"==i||"keyword"==i,i},indent:function(t,n){if(t.tokenize!=i)return 0;var r=n&&n.charAt(0),a=t.ctx,o=r==a.type;return"block"==a.type?a.indent+("{"==r?0:e.indentUnit):a.align?a.column+(o?0:1):a.indent+(o?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/ruby/ruby",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("ruby",function(e){function t(e){for(var t={},i=0,n=e.length;i<n;++i)t[e[i]]=!0;return t}function i(e,t,i){return i.tokenize.push(e),e(t,i)}function n(e,t){if(c=null,e.sol()&&e.match("=begin")&&e.eol())return t.tokenize.push(l),"comment";if(e.eatSpace())return null;var n,r=e.next();if("`"==r||"'"==r||'"'==r)return i(o(r,"string",'"'==r||"`"==r),e,t);if("/"==r){var a=e.current().length;if(e.skipTo("/")){var u=e.current().length;e.backUp(e.current().length-a);for(var d=0;e.current().length<u;){var h=e.next();if("("==h?d+=1:")"==h&&(d-=1),d<0)break}if(e.backUp(e.current().length-a),0==d)return i(o(r,"string-2",!0),e,t)}return"operator"}if("%"==r){var f="string",m=!0;e.eat("s")?f="atom":e.eat(/[WQ]/)?f="string":e.eat(/[r]/)?f="string-2":e.eat(/[wxq]/)&&(f="string",m=!1);var g=e.eat(/[^\w\s=]/);return g?(p.propertyIsEnumerable(g)&&(g=p[g]),i(o(g,f,m,!0),e,t)):"operator"}if("#"==r)return e.skipToEnd(),"comment";if("<"==r&&(n=e.match(/^<-?[\`\"\']?([a-zA-Z_?]\w*)[\`\"\']?(?:;|$)/)))return i(s(n[1]),e,t);if("0"==r)return e.eat("x")?e.eatWhile(/[\da-fA-F]/):e.eat("b")?e.eatWhile(/[01]/):e.eatWhile(/[0-7]/),"number";if(/\d/.test(r))return e.match(/^[\d_]*(?:\.[\d_]+)?(?:[eE][+\-]?[\d_]+)?/),"number";if("?"==r){for(;e.match(/^\\[CM]-/););return e.eat("\\")?e.eatWhile(/\w/):e.next(),"string"}if(":"==r)return e.eat("'")?i(o("'","atom",!1),e,t):e.eat('"')?i(o('"',"atom",!0),e,t):e.eat(/[\<\>]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==r&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==r)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(r))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=r||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(r))return c=r,null;if("-"==r&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(r)){var v=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=r||v||(c="."),"operator"}return null}return c="|",null}function r(e){return e||(e=1),function(t,i){if("}"==t.peek()){if(1==e)return i.tokenize.pop(),i.tokenize[i.tokenize.length-1](t,i);i.tokenize[i.tokenize.length-1]=r(e-1)}else"{"==t.peek()&&(i.tokenize[i.tokenize.length-1]=r(e+1));return n(t,i)}}function a(){var e=!1;return function(t,i){return e?(i.tokenize.pop(),i.tokenize[i.tokenize.length-1](t,i)):(e=!0,n(t,i))}}function o(e,t,i,n){return function(o,s){var l,c=!1;for("read-quoted-paused"===s.context.type&&(s.context=s.context.prev,o.eat("}"));null!=(l=o.next());){if(l==e&&(n||!c)){s.tokenize.pop();break}if(i&&"#"==l&&!c){if(o.eat("{")){"}"==e&&(s.context={prev:s.context,type:"read-quoted-paused"}),s.tokenize.push(r());break}if(/[@\$]/.test(o.peek())){s.tokenize.push(a());break}}c=!c&&"\\"==l}return t}}function s(e){return function(t,i){return t.match(e)?i.tokenize.pop():t.skipToEnd(),"string"}}function l(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var c,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),d=t(["def","class","case","for","while","module","then","catch","loop","proc","begin"]),h=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[n],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){e.sol()&&(t.indented=e.indentation());var i,n=t.tokenize[t.tokenize.length-1](e,t),r=c;if("ident"==n){var a=e.current();n="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(a)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==n&&(r=a,d.propertyIsEnumerable(a)?i="indent":h.propertyIsEnumerable(a)?i="dedent":"if"!=a&&"unless"!=a||e.column()!=e.indentation()?"do"==a&&t.context.indented<t.indented&&(i="indent"):i="indent")}return(c||n&&"comment"!=n)&&(t.lastTok=r),"|"==c&&(t.varList=!t.varList),"indent"==i||/[\(\[\{]/.test(c)?t.context={prev:t.context,type:c||n,indented:t.indented}:("dedent"==i||/[\)\]\}]/.test(c))&&t.context.prev&&(t.context=t.context.prev),e.eol()&&(t.continuedLine="\\"==c||"operator"==n),n},indent:function(t,i){if(t.tokenize[t.tokenize.length-1]!=n)return 0;var r=i&&i.charAt(0),a=t.context,o=a.type==p[r]||"keyword"==a.type&&/^(?:end|until|else|elsif|when|rescue)\b/.test(i);return a.indented+(o?0:e.indentUnit)+(t.continuedLine?e.indentUnit:0)},electricChars:"}de",lineComment:"#"}}),e.defineMIME("text/x-ruby","ruby")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/stex/stex",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("stex",function(){function e(e,t){e.cmdState.push(t)}function t(e){return e.cmdState.length>0?e.cmdState[e.cmdState.length-1]:null}function i(e){var t=e.cmdState.pop();t&&t.closeBracket()}function n(e){for(var t=e.cmdState,i=t.length-1;i>=0;i--){var n=t[i];if("DEFAULT"!=n.name)return n}return{styleIdentifier:function(){return null}}}function r(e,t,i){return function(){this.name=e,this.bracketNo=0,this.style=t,this.styles=i,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}function a(e,t){e.f=t}function o(i,r){var o;if(i.match(/^\\[a-zA-Z@]+/)){var u=i.current().slice(1);return o=c[u]||c.DEFAULT,o=new o,e(r,o),a(r,l),o.style}if(i.match(/^\\[$&%#{}_]/))return"tag";if(i.match(/^\\[,;!\/\\]/))return"tag";if(i.match("\\["))return a(r,function(e,t){return s(e,t,"\\]")}),"keyword";if(i.match("$$"))return a(r,function(e,t){return s(e,t,"$$")}),"keyword";if(i.match("$"))return a(r,function(e,t){return s(e,t,"$")}),"keyword";var d=i.next();return"%"==d?(i.skipToEnd(),"comment"):"}"==d||"]"==d?(o=t(r))?(o.closeBracket(d),a(r,l),"bracket"):"error":"{"==d||"["==d?(o=c.DEFAULT,o=new o,e(r,o),"bracket"):/\d/.test(d)?(i.eatWhile(/[\w.%]/),"atom"):(i.eatWhile(/[\w\-_]/),o=n(r),"begin"==o.name&&(o.argument=i.current()),o.styleIdentifier())}function s(e,t,i){if(e.eatSpace())return null;if(e.match(i))return a(t,o),"keyword";if(e.match(/^\\[a-zA-Z@]+/))return"tag";if(e.match(/^[a-zA-Z]+/))return"variable-2";if(e.match(/^\\[$&%#{}_]/))return"tag";if(e.match(/^\\[,;!\/]/))return"tag";if(e.match(/^[\^_&]/))return"tag";if(e.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(e.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var n=e.next();return"{"==n||"}"==n||"["==n||"]"==n||"("==n||")"==n?"bracket":"%"==n?(e.skipToEnd(),"comment"):"error"}function l(e,n){var r,s=e.peek();return"{"==s||"["==s?(r=t(n),r.openBracket(s),e.eat(s),a(n,o),"bracket"):/[ \t\r]/.test(s)?(e.eat(s),null):(a(n,o),i(n),o(e,n))}var c={};return c.importmodule=r("importmodule","tag",["string","builtin"]),c.documentclass=r("documentclass","tag",["","atom"]),c.usepackage=r("usepackage","tag",["atom"]),c.begin=r("begin","tag",["atom"]),c.end=r("end","tag",["atom"]),c.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:o}},copyState:function(e){return{cmdState:e.cmdState.slice(),f:e.f}},token:function(e,t){return t.f(e,t)},blankLine:function(e){e.f=o,e.cmdState.length=0},lineComment:"%"}}),e.defineMIME("text/x-stex","stex"),e.defineMIME("text/x-latex","stex")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../python/python"),require("../stex/stex"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/rst/rst",["../../lib/codemirror","../python/python","../stex/stex","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){e.defineMode("rst",function(t,i){var n=/^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/,r=/^\*[^\*\s](?:[^\*]*[^\*\s])?\*/,a=/^``[^`\s](?:[^`]*[^`\s])``/,o=/^(?:[\d]+(?:[\.,]\d+)*)/,s=/^(?:\s\+[\d]+(?:[\.,]\d+)*)/,l=/^(?:\s\-[\d]+(?:[\.,]\d+)*)/,c=new RegExp("^[Hh][Tt][Tt][Pp][Ss]?://(?:[\\d\\w.-]+)\\.(?:\\w{2,6})(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*"),u={token:function(e){if(e.match(n)&&e.match(/\W+|$/,!1))return"strong";if(e.match(r)&&e.match(/\W+|$/,!1))return"em";if(e.match(a)&&e.match(/\W+|$/,!1))return"string-2";if(e.match(o))return"number";if(e.match(s))return"positive";if(e.match(l))return"negative";if(e.match(c))return"link";for(;!(null==e.next()||e.match(n,!1)||e.match(r,!1)||e.match(a,!1)||e.match(o,!1)||e.match(s,!1)||e.match(l,!1)||e.match(c,!1)););return null}},d=e.getMode(t,i.backdrop||"rst-base");return e.overlayMode(d,u,!0)},"python","stex"),e.defineMode("rst-base",function(t){function i(e){var t=Array.prototype.slice.call(arguments,1);return e.replace(/{(\d+)}/g,function(e,i){return void 0!==t[i]?t[i]:e})}function n(t,i){var a=null;if(t.sol()&&t.match(Y,!1))u(i,l,{mode:p,local:e.startState(p)});else if(t.sol()&&t.match(C))u(i,r),a="meta";else if(t.sol()&&t.match(k))u(i,n),a="header";else if(h(i)==P||t.match(P,!1))switch(d(i)){case 0:u(i,n,c(P,1)),t.match(/^:/),a="meta";break;case 1:u(i,n,c(P,2)),
|
||
t.match(y),a="keyword",t.current().match(/^(?:math|latex)/)&&(i.tmp_stex=!0);break;case 2:u(i,n,c(P,3)),t.match(/^:`/),a="meta";break;case 3:if(i.tmp_stex&&(i.tmp_stex=void 0,i.tmp={mode:f,local:e.startState(f)}),i.tmp){if("`"==t.peek()){u(i,n,c(P,4)),i.tmp=void 0;break}a=i.tmp.mode.token(t,i.tmp.local);break}u(i,n,c(P,4)),t.match(x),a="string";break;case 4:u(i,n,c(P,5)),t.match(/^`/),a="meta";break;case 5:u(i,n,c(P,6)),t.match(g);break;default:u(i,n)}else if(h(i)==R||t.match(R,!1))switch(d(i)){case 0:u(i,n,c(R,1)),t.match(/^`/),a="meta";break;case 1:u(i,n,c(R,2)),t.match(x),a="string";break;case 2:u(i,n,c(R,3)),t.match(/^`:/),a="meta";break;case 3:u(i,n,c(R,4)),t.match(y),a="keyword";break;case 4:u(i,n,c(R,5)),t.match(/^:/),a="meta";break;case 5:u(i,n,c(R,6)),t.match(g);break;default:u(i,n)}else if(h(i)==j||t.match(j,!1))switch(d(i)){case 0:u(i,n,c(j,1)),t.match(/^:/),a="meta";break;case 1:u(i,n,c(j,2)),t.match(y),a="keyword";break;case 2:u(i,n,c(j,3)),t.match(/^:/),a="meta";break;case 3:u(i,n,c(j,4)),t.match(g);break;default:u(i,n)}else if(h(i)==D||t.match(D,!1))switch(d(i)){case 0:u(i,n,c(D,1)),t.match(B),a="variable-2";break;case 1:u(i,n,c(D,2)),t.match(/^_?_?/)&&(a="link");break;default:u(i,n)}else if(t.match(M))u(i,n),a="quote";else if(t.match(L))u(i,n),a="quote";else if(t.match(O))u(i,n),t.peek()&&!t.peek().match(/^\W$/)||(a="link");else if(h(i)==N||t.match(N,!1))switch(d(i)){case 0:!t.peek()||t.peek().match(/^\W$/)?u(i,n,c(N,1)):t.match(N);break;case 1:u(i,n,c(N,2)),t.match(/^`/),a="link";break;case 2:u(i,n,c(N,3)),t.match(x);break;case 3:u(i,n,c(N,4)),t.match(/^`_/),a="link";break;default:u(i,n)}else t.match(G)?u(i,o):t.next()&&u(i,n);return a}function r(t,i){var o=null;if(h(i)==E||t.match(E,!1))switch(d(i)){case 0:u(i,r,c(E,1)),t.match(B),o="variable-2";break;case 1:u(i,r,c(E,2)),t.match(U);break;case 2:u(i,r,c(E,3)),t.match($),o="keyword";break;case 3:u(i,r,c(E,4)),t.match(q),o="meta";break;default:u(i,n)}else if(h(i)==S||t.match(S,!1))switch(d(i)){case 0:u(i,r,c(S,1)),t.match(z),o="keyword",t.current().match(/^(?:math|latex)/)?i.tmp_stex=!0:t.current().match(/^python/)&&(i.tmp_py=!0);break;case 1:u(i,r,c(S,2)),t.match(F),o="meta",(t.match(/^latex\s*$/)||i.tmp_stex)&&(i.tmp_stex=void 0,u(i,l,{mode:f,local:e.startState(f)}));break;case 2:u(i,r,c(S,3)),(t.match(/^python\s*$/)||i.tmp_py)&&(i.tmp_py=void 0,u(i,l,{mode:p,local:e.startState(p)}));break;default:u(i,n)}else if(h(i)==T||t.match(T,!1))switch(d(i)){case 0:u(i,r,c(T,1)),t.match(H),t.match(W),o="link";break;case 1:u(i,r,c(T,2)),t.match(V),o="meta";break;default:u(i,n)}else t.match(A)?(u(i,n),o="quote"):t.match(I)?(u(i,n),o="quote"):(t.eatSpace(),t.eol()?u(i,n):(t.skipToEnd(),u(i,a),o="comment"));return o}function a(e,t){return s(e,t,"comment")}function o(e,t){return s(e,t,"meta")}function s(e,t,i){return e.eol()||e.eatSpace()?(e.skipToEnd(),i):(u(t,n),null)}function l(e,t){return t.ctx.mode&&t.ctx.local?e.sol()?(e.eatSpace()||u(t,n),null):t.ctx.mode.token(e,t.ctx.local):(u(t,n),null)}function c(e,t,i,n){return{phase:e,stage:t,mode:i,local:n}}function u(e,t,i){e.tok=t,e.ctx=i||{}}function d(e){return e.ctx.stage||0}function h(e){return e.ctx.phase}var p=e.getMode(t,"python"),f=e.getMode(t,"stex"),m="(?:\\s*|\\W|$)",g=new RegExp(i("^{0}",m)),v="(?:[^\\W\\d_](?:[\\w!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)",y=new RegExp(i("^{0}",v)),_=i("(?:{0}|`{1}`)",v,"(?:[^\\W\\d_](?:[\\w\\s!\"#$%&'()\\*\\+,\\-\\./:;<=>\\?]*[^\\W_])?)"),b="(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)",w="(?:[^\\`]+)",x=new RegExp(i("^{0}",w)),k=new RegExp("^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$"),C=new RegExp(i("^\\.\\.{0}","\\s+")),T=new RegExp(i("^_{0}:{1}|^__:{1}",_,m)),S=new RegExp(i("^{0}::{1}",_,m)),E=new RegExp(i("^\\|{0}\\|{1}{2}::{3}",b,"\\s+",_,m)),A=new RegExp(i("^\\[(?:\\d+|#{0}?|\\*)]{1}",_,m)),I=new RegExp(i("^\\[{0}\\]{1}",_,m)),D=new RegExp(i("^\\|{0}\\|",b)),M=new RegExp(i("^\\[(?:\\d+|#{0}?|\\*)]_",_)),L=new RegExp(i("^\\[{0}\\]_",_)),O=new RegExp(i("^{0}__?",_)),N=new RegExp(i("^`{0}`_",w)),P=new RegExp(i("^:{0}:`{1}`{2}",v,w,m)),R=new RegExp(i("^`{1}`:{0}:{2}",v,w,m)),j=new RegExp(i("^:{0}:{1}",v,m)),z=new RegExp(i("^{0}",_)),F=new RegExp(i("^::{0}",m)),B=new RegExp(i("^\\|{0}\\|",b)),U=new RegExp(i("^{0}","\\s+")),$=new RegExp(i("^{0}",_)),q=new RegExp(i("^::{0}",m)),H=new RegExp("^_"),W=new RegExp(i("^{0}|_",_)),V=new RegExp(i("^:{0}",m)),G=new RegExp("^::\\s*$"),Y=new RegExp("^\\s+(?:>>>|In \\[\\d+\\]:)\\s");return{startState:function(){return{tok:n,ctx:c(void 0,0)}},copyState:function(t){var i=t.ctx,n=t.tmp;return i.local&&(i={mode:i.mode,local:e.copyState(i.mode,i.local)}),n&&(n={mode:n.mode,local:e.copyState(n.mode,n.local)}),{tok:t.tok,ctx:i,tmp:n}},innerMode:function(e){return e.tmp?{state:e.tmp.local,mode:e.tmp.mode}:e.ctx.mode?{state:e.ctx.local,mode:e.ctx.mode}:null},token:function(e,t){return t.tok(e,t)}}},"python","stex"),e.defineMIME("text/x-rst","rst")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/smarty/smarty",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("smarty",function(e){"use strict";var t={rightDelimiter:"}",leftDelimiter:"{",smartyVersion:2};e.hasOwnProperty("leftDelimiter")&&(t.leftDelimiter=e.leftDelimiter),e.hasOwnProperty("rightDelimiter")&&(t.rightDelimiter=e.rightDelimiter),e.hasOwnProperty("smartyVersion")&&3===e.smartyVersion&&(t.smartyVersion=3);var i,n=["debug","extends","function","include","literal"],r={operatorChars:/[+\-*&%=<>!?]/,validIdentifier:/[a-zA-Z0-9_]/,stringChar:/['"]/},a={cont:function(e,t){return i=t,e},chain:function(e,t,i){return t.tokenize=i,i(e,t)}},o={tokenizer:function(e,n){if(e.match(t.leftDelimiter,!0)){if(e.eat("*"))return a.chain(e,n,o.inBlock("comment","*"+t.rightDelimiter));n.depth++;var r=e.eol(),s=/\s/.test(e.peek());return 3===t.smartyVersion&&"{"===t.leftDelimiter&&(r||s)?(n.depth--,null):(n.tokenize=o.smarty,i="startTag","tag")}return e.next(),null},smarty:function(e,s){if(e.match(t.rightDelimiter,!0))return 3===t.smartyVersion?--s.depth<=0&&(s.tokenize=o.tokenizer):s.tokenize=o.tokenizer,a.cont("tag",null);if(e.match(t.leftDelimiter,!0))return s.depth++,a.cont("tag","startTag");var l=e.next();if("$"==l)return e.eatWhile(r.validIdentifier),a.cont("variable-2","variable");if("|"==l)return a.cont("operator","pipe");if("."==l)return a.cont("operator","property");if(r.stringChar.test(l))return s.tokenize=o.inAttribute(l),a.cont("string","string");if(r.operatorChars.test(l))return e.eatWhile(r.operatorChars),a.cont("operator","operator");if("["==l||"]"==l)return a.cont("bracket","bracket");if("("==l||")"==l)return a.cont("bracket","operator");if(/\d/.test(l))return e.eatWhile(/\d/),a.cont("number","number");if("variable"==s.last){if("@"==l)return e.eatWhile(r.validIdentifier),a.cont("property","property");if("|"==l)return e.eatWhile(r.validIdentifier),a.cont("qualifier","modifier")}else{if("pipe"==s.last)return e.eatWhile(r.validIdentifier),a.cont("qualifier","modifier");if("whitespace"==s.last)return e.eatWhile(r.validIdentifier),a.cont("attribute","modifier")}if("property"==s.last)return e.eatWhile(r.validIdentifier),a.cont("property",null);if(/\s/.test(l))return i="whitespace",null;var c="";"/"!=l&&(c+=l);for(var u=null;u=e.eat(r.validIdentifier);)c+=u;for(var d=0,h=n.length;d<h;d++)if(n[d]==c)return a.cont("keyword","keyword");return/\s/.test(l)?null:a.cont("tag","tag")},inAttribute:function(e){return function(t,i){for(var n=null,r=null;!t.eol();){if(r=t.peek(),t.next()==e&&"\\"!==n){i.tokenize=o.smarty;break}n=r}return"string"}},inBlock:function(e,t){return function(i,n){for(;!i.eol();){if(i.match(t)){n.tokenize=o.tokenizer;break}i.next()}return e}}};return{startState:function(){return{tokenize:o.tokenizer,mode:"smarty",last:null,depth:0}},token:function(e,t){var n=t.tokenize(e,t);return t.last=i,n},electricChars:""}}),e.defineMIME("text/x-smarty","smarty")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../smarty/smarty")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/smartymixed/smartymixed",["../../lib/codemirror","../htmlmixed/htmlmixed","../smarty/smarty"],e):e(CodeMirror)}(function(e){e.defineMode("smartymixed",function(t){function i(e){return e.replace(/[^\s\w]/g,"\\$&")}var n=e.getMode(t,"htmlmixed"),r=e.getMode(t,"smarty"),a={rightDelimiter:"}",leftDelimiter:"{"};t.hasOwnProperty("leftDelimiter")&&(a.leftDelimiter=t.leftDelimiter),t.hasOwnProperty("rightDelimiter")&&(a.rightDelimiter=t.rightDelimiter);var o=i(a.leftDelimiter),s=i(a.rightDelimiter),l={smartyComment:new RegExp("^"+s+"\\*"),literalOpen:new RegExp(o+"literal"+s),literalClose:new RegExp(o+"/literal"+s),hasLeftDelimeter:new RegExp(".*"+o),htmlHasLeftDelimeter:new RegExp("[^<>]*"+o)},c={chain:function(e,t,i){return t.tokenize=i,i(e,t)},cleanChain:function(e,t,i){return t.tokenize=null,t.localState=null,t.localMode=null,"string"==typeof i?i||null:i(e,t)},maybeBackup:function(e,t,i){var n=e.current(),r=n.search(t);return r>-1?e.backUp(n.length-r):n.match(/<\/?$/)&&(e.backUp(n.length),e.match(t,!1)||e.match(n[0])),i}},u={html:function(e,t){var i=t.htmlMixedState.htmlState.context&&t.htmlMixedState.htmlState.context.tagName?t.htmlMixedState.htmlState.context.tagName:null;return!t.inLiteral&&e.match(l.htmlHasLeftDelimeter,!1)&&null===i?(t.tokenize=u.smarty,t.localMode=r,t.localState=r.startState(n.indent(t.htmlMixedState,"")),c.maybeBackup(e,a.leftDelimiter,r.token(e,t.localState))):!t.inLiteral&&e.match(a.leftDelimiter,!1)?(t.tokenize=u.smarty,t.localMode=r,t.localState=r.startState(n.indent(t.htmlMixedState,"")),c.maybeBackup(e,a.leftDelimiter,r.token(e,t.localState))):n.token(e,t.htmlMixedState)},smarty:function(e,t){if(e.match(a.leftDelimiter,!1)){if(e.match(l.smartyComment,!1))return c.chain(e,t,u.inBlock("comment","*"+a.rightDelimiter))}else if(e.match(a.rightDelimiter,!1))return e.eat(a.rightDelimiter),t.tokenize=u.html,t.localMode=n,t.localState=t.htmlMixedState,"tag";return c.maybeBackup(e,a.rightDelimiter,r.token(e,t.localState))},inBlock:function(e,t){return function(i,n){for(;!i.eol();){if(i.match(t)){c.cleanChain(i,n,"");break}i.next()}return e}}};return{startState:function(){var e=n.startState();return{token:u.html,localMode:null,localState:null,htmlMixedState:e,tokenize:null,inLiteral:!1}},copyState:function(t){var i=null,a=t.tokenize||t.token;return t.localState&&(i=e.copyState(a!=u.html?r:n,t.localState)),{token:t.token,tokenize:t.tokenize,localMode:t.localMode,localState:i,htmlMixedState:e.copyState(n,t.htmlMixedState),inLiteral:t.inLiteral}},token:function(e,t){if(e.match(a.leftDelimiter,!1)){if(!t.inLiteral&&e.match(l.literalOpen,!0))return t.inLiteral=!0,"keyword";if(t.inLiteral&&e.match(l.literalClose,!0))return t.inLiteral=!1,"keyword"}return t.inLiteral&&t.localState!=t.htmlMixedState&&(t.tokenize=u.html,t.localMode=n,t.localState=t.htmlMixedState),(t.tokenize||t.token)(e,t)},indent:function(t,i){return t.localMode==r||t.inLiteral&&!t.localMode||l.hasLeftDelimeter.test(i)?e.Pass:n.indent(t.htmlMixedState,i)},innerMode:function(e){return{state:e.localState||e.htmlMixedState,mode:e.localMode||n}}}},"htmlmixed","smarty"),e.defineMIME("text/x-smarty","smartymixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/vb/vb",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("vb",function(e,t){function i(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function n(e,t){t.currentIndent++}function r(e,t){t.currentIndent--}function a(e,t){if(e.eatSpace())return null;if("'"===e.peek())return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.a-f]/i,!1)){var i=!1;if(e.match(/^\d*\.\d+F?/i)?i=!0:e.match(/^\d+\.\d*F?/)?i=!0:e.match(/^\.\d+F?/)&&(i=!0),i)return e.eat(/J/i),"number";var a=!1;if(e.match(/^&H[0-9a-f]+/i)?a=!0:e.match(/^&O[0-7]+/i)?a=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),a=!0):e.match(/^0(?![\dx])/i)&&(a=!0),a)return e.eat(/L/i),"number"}return e.match(k)?(t.tokenize=o(e.current()),t.tokenize(e,t)):e.match(p)||e.match(h)?null:e.match(d)||e.match(c)||e.match(y)?"operator":e.match(u)?null:e.match(A)?(n(e,t),t.doInCurrentLine=!0,"keyword"):e.match(C)?(t.doInCurrentLine?t.doInCurrentLine=!1:n(e,t),"keyword"):e.match(T)?"keyword":e.match(E)?(r(e,t),r(e,t),"keyword"):e.match(S)?(r(e,t),"keyword"):e.match(x)?"keyword":e.match(w)?"keyword":e.match(f)?"variable":(e.next(),l)}function o(e){var i=1==e.length;return function(n,r){for(;!n.eol();){if(n.eatWhile(/[^'"]/),n.match(e))return r.tokenize=a,"string";n.eat(/['"]/)}if(i){if(t.singleLineStringErrors)return l;r.tokenize=a}return"string"}}function s(e,t){var i=t.tokenize(e,t),a=e.current();if("."===a)return i=t.tokenize(e,t),a=e.current(),"variable"===i?"variable":l;var o="[({".indexOf(a);return-1!==o&&n(e,t),"dedent"===I&&r(e,t)?l:(o="])}".indexOf(a),-1!==o&&r(e,t)?l:i)}var l="error",c=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),u=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),d=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),h=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),p=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),f=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),m=["class","module","sub","enum","select","while","if","function","get","set","property","try"],g=["else","elseif","case","catch"],v=["next","loop"],y=i(["and","or","not","xor","in"]),_=["as","dim","break","continue","optional","then","until","goto","byval","byref","new","handles","property","return","const","private","protected","friend","public","shared","static","true","false"],b=["integer","string","double","decimal","boolean","short","char","float","single"],w=i(_),x=i(b),k='"',C=i(m),T=i(g),S=i(v),E=i(["end"]),A=i(["do"]),I=null;return{electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:a,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var i=s(e,t);return t.lastToken={style:i,content:e.current()},i},indent:function(t,i){var n=i.replace(/^\s+|\s+$/g,"");return n.match(S)||n.match(E)||n.match(T)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}}}),e.defineMIME("text/x-vb","vb")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/vbscript/vbscript",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("vbscript",function(e,t){function i(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}function n(e,t){t.currentIndent++}function r(e,t){t.currentIndent--}function a(e,t){if(e.eatSpace())return"space";if("'"===e.peek())return e.skipToEnd(),"comment";if(e.match(U))return e.skipToEnd(),"comment";if(e.match(/^((&H)|(&O))?[0-9\.]/i,!1)&&!e.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i,!1)){var i=!1;if(e.match(/^\d*\.\d+/i)?i=!0:e.match(/^\d+\.\d*/)?i=!0:e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var a=!1;if(e.match(/^&H[0-9a-f]+/i)?a=!0:e.match(/^&O[0-7]+/i)?a=!0:e.match(/^[1-9]\d*F?/)?(e.eat(/J/i),a=!0):e.match(/^0(?![\dx])/i)&&(a=!0),a)return e.eat(/L/i),"number"}return e.match(N)?(t.tokenize=o(e.current()),t.tokenize(e,t)):e.match(u)||e.match(c)||e.match(v)?"operator":e.match(d)?null:e.match(h)?"bracket":e.match(B)?(t.doInCurrentLine=!0,"keyword"):e.match(F)?(n(e,t),t.doInCurrentLine=!0,"keyword"):e.match(P)?(t.doInCurrentLine?t.doInCurrentLine=!1:n(e,t),"keyword"):e.match(R)?"keyword":e.match(z)?(r(e,t),r(e,t),"keyword"):e.match(j)?(t.doInCurrentLine?t.doInCurrentLine=!1:r(e,t),"keyword"):e.match(I)?"keyword":e.match(D)?"atom":e.match(O)?"variable-2":e.match(M)?"builtin":e.match(L)?"variable-2":e.match(p)?"variable":(e.next(),l)}function o(e){var i=1==e.length;return function(n,r){for(;!n.eol();){if(n.eatWhile(/[^'"]/),n.match(e))return r.tokenize=a,"string";n.eat(/['"]/)}if(i){if(t.singleLineStringErrors)return l;r.tokenize=a}return"string"}}function s(e,t){var i=t.tokenize(e,t),n=e.current();return"."===n?(i=t.tokenize(e,t),n=e.current(),!i||"variable"!==i.substr(0,8)&&"builtin"!==i&&"keyword"!==i?l:("builtin"!==i&&"keyword"!==i||(i="variable"),A.indexOf(n.substr(1))>-1&&(i="variable-2"),i)):i}var l="error",c=new RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"),u=new RegExp("^((<>)|(<=)|(>=))"),d=new RegExp("^[\\.,]"),h=new RegExp("^[\\(\\)]"),p=new RegExp("^[A-Za-z][_A-Za-z0-9]*"),f=["class","sub","select","while","if","function","property","with","for"],m=["else","elseif","case"],g=["next","loop","wend"],v=i(["and","or","not","xor","is","mod","eqv","imp"]),y=["dim","redim","then","until","randomize","byval","byref","new","property","exit","in","const","private","public","get","set","let","stop","on error resume next","on error goto 0","option explicit","call","me"],_=["true","false","nothing","empty","null"],b=["abs","array","asc","atn","cbool","cbyte","ccur","cdate","cdbl","chr","cint","clng","cos","csng","cstr","date","dateadd","datediff","datepart","dateserial","datevalue","day","escape","eval","execute","exp","filter","formatcurrency","formatdatetime","formatnumber","formatpercent","getlocale","getobject","getref","hex","hour","inputbox","instr","instrrev","int","fix","isarray","isdate","isempty","isnull","isnumeric","isobject","join","lbound","lcase","left","len","loadpicture","log","ltrim","rtrim","trim","maths","mid","minute","month","monthname","msgbox","now","oct","replace","rgb","right","rnd","round","scriptengine","scriptenginebuildversion","scriptenginemajorversion","scriptengineminorversion","second","setlocale","sgn","sin","space","split","sqr","strcomp","string","strreverse","tan","time","timer","timeserial","timevalue","typename","ubound","ucase","unescape","vartype","weekday","weekdayname","year"],w=["vbBlack","vbRed","vbGreen","vbYellow","vbBlue","vbMagenta","vbCyan","vbWhite","vbBinaryCompare","vbTextCompare","vbSunday","vbMonday","vbTuesday","vbWednesday","vbThursday","vbFriday","vbSaturday","vbUseSystemDayOfWeek","vbFirstJan1","vbFirstFourDays","vbFirstFullWeek","vbGeneralDate","vbLongDate","vbShortDate","vbLongTime","vbShortTime","vbObjectError","vbOKOnly","vbOKCancel","vbAbortRetryIgnore","vbYesNoCancel","vbYesNo","vbRetryCancel","vbCritical","vbQuestion","vbExclamation","vbInformation","vbDefaultButton1","vbDefaultButton2","vbDefaultButton3","vbDefaultButton4","vbApplicationModal","vbSystemModal","vbOK","vbCancel","vbAbort","vbRetry","vbIgnore","vbYes","vbNo","vbCr","VbCrLf","vbFormFeed","vbLf","vbNewLine","vbNullChar","vbNullString","vbTab","vbVerticalTab","vbUseDefault","vbTrue","vbFalse","vbEmpty","vbNull","vbInteger","vbLong","vbSingle","vbDouble","vbCurrency","vbDate","vbString","vbObject","vbError","vbBoolean","vbVariant","vbDataObject","vbDecimal","vbByte","vbArray"],x=["WScript","err","debug","RegExp"],k=["description","firstindex","global","helpcontext","helpfile","ignorecase","length","number","pattern","source","value","count"],C=["clear","execute","raise","replace","test","write","writeline","close","open","state","eof","update","addnew","end","createobject","quit"],T=["server","response","request","session","application"],S=["buffer","cachecontrol","charset","contenttype","expires","expiresabsolute","isclientconnected","pics","status","clientcertificate","cookies","form","querystring","servervariables","totalbytes","contents","staticobjects","codepage","lcid","sessionid","timeout","scripttimeout"],E=["addheader","appendtolog","binarywrite","end","flush","redirect","binaryread","remove","removeall","lock","unlock","abandon","getlasterror","htmlencode","mappath","transfer","urlencode"],A=C.concat(k);x=x.concat(w),e.isASP&&(x=x.concat(T),A=A.concat(E,S));var I=i(y),D=i(_),M=i(b),L=i(x),O=i(A),N='"',P=i(f),R=i(m),j=i(g),z=i(["end"]),F=i(["do"]),B=i(["on error resume next","exit"]),U=i(["rem"]);return{electricChars:"dDpPtTfFeE ",startState:function(){return{tokenize:a,lastToken:null,currentIndent:0,nextLineIndent:0,doInCurrentLine:!1,ignoreKeyword:!1}},token:function(e,t){e.sol()&&(t.currentIndent+=t.nextLineIndent,t.nextLineIndent=0,t.doInCurrentLine=0);var i=s(e,t);return t.lastToken={style:i,content:e.current()},"space"===i&&(i=null),i},indent:function(t,i){var n=i.replace(/^\s+|\s+$/g,"");return n.match(j)||n.match(z)||n.match(R)?e.indentUnit*(t.currentIndent-1):t.currentIndent<0?0:t.currentIndent*e.indentUnit}}}),e.defineMIME("text/vbscript","vbscript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/velocity/velocity",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("velocity",function(){function e(e){for(var t={},i=e.split(" "),n=0;n<i.length;++n)t[i[n]]=!0;return t}function t(e,t,i){return t.tokenize=i,i(e,t)}function i(e,i){var u=i.beforeParams;i.beforeParams=!1;var d=e.next();if("'"==d&&i.inParams)return i.lastTokenWasBuiltin=!1,t(e,i,n(d));if('"'!=d){if(/[\[\]{}\(\),;\.]/.test(d))return"("==d&&u?i.inParams=!0:")"==d&&(i.inParams=!1,i.lastTokenWasBuiltin=!0),null;if(/\d/.test(d))return i.lastTokenWasBuiltin=!1,e.eatWhile(/[\w\.]/),"number";if("#"==d&&e.eat("*"))return i.lastTokenWasBuiltin=!1,t(e,i,r);if("#"==d&&e.match(/ *\[ *\[/))return i.lastTokenWasBuiltin=!1,t(e,i,a);if("#"==d&&e.eat("#"))return i.lastTokenWasBuiltin=!1,e.skipToEnd(),"comment";if("$"==d)return e.eatWhile(/[\w\d\$_\.{}]/),l&&l.propertyIsEnumerable(e.current())?"keyword":(i.lastTokenWasBuiltin=!0,i.beforeParams=!0,"builtin");if(c.test(d))return i.lastTokenWasBuiltin=!1,e.eatWhile(c),"operator";e.eatWhile(/[\w\$_{}@]/);var h=e.current();return o&&o.propertyIsEnumerable(h)?"keyword":s&&s.propertyIsEnumerable(h)||e.current().match(/^#@?[a-z0-9_]+ *$/i)&&"("==e.peek()&&(!s||!s.propertyIsEnumerable(h.toLowerCase()))?(i.beforeParams=!0,i.lastTokenWasBuiltin=!1,"keyword"):i.inString?(i.lastTokenWasBuiltin=!1,"string"):e.pos>h.length&&"."==e.string.charAt(e.pos-h.length-1)&&i.lastTokenWasBuiltin?"builtin":(i.lastTokenWasBuiltin=!1,null)}return i.lastTokenWasBuiltin=!1,i.inString?(i.inString=!1,"string"):i.inParams?t(e,i,n(d)):void 0}function n(e){return function(t,n){for(var r,a=!1,o=!1;null!=(r=t.next());){if(r==e&&!a){o=!0;break}if('"'==e&&"$"==t.peek()&&!a){n.inString=!0,o=!0;break}a=!a&&"\\"==r}return o&&(n.tokenize=i),"string"}}function r(e,t){for(var n,r=!1;n=e.next();){if("#"==n&&r){t.tokenize=i;break}r="*"==n}return"comment"}function a(e,t){for(var n,r=0;n=e.next();){if("#"==n&&2==r){t.tokenize=i;break}"]"==n?r++:" "!=n&&(r=0)}return"meta"}var o=e("#end #else #break #stop #[[ #]] #{end} #{else} #{break} #{stop}"),s=e("#if #elseif #foreach #set #include #parse #macro #define #evaluate #{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}"),l=e("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent.count $foreach.parent.hasNext $foreach.parent.first $foreach.parent.last $foreach.parent $velocityCount $!bodyContent $bodyContent"),c=/[+\-*&%=<>!?:\/|]/;return{startState:function(){return{tokenize:i,beforeParams:!1,inParams:!1,inString:!1,lastTokenWasBuiltin:!1}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"#*",blockCommentEnd:"*#",lineComment:"##",fold:"velocity"}}),e.defineMIME("text/velocity","velocity")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/xquery/xquery",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("xquery",function(){function e(e,t,i){return _=e,b=i,t}function t(e,t,i){return t.tokenize=i,i(e,t)}function i(i,s){var h=i.next(),f=!1,g=m(i);if("<"==h){if(i.match("!--",!0))return t(i,s,l);if(i.match("![CDATA",!1))return s.tokenize=c,e("tag","tag");if(i.match("?",!1))return t(i,s,u);var _=i.eat("/");i.eatSpace();for(var b,x="";b=i.eat(/[^\s\u00a0=<>\"\'\/?]/);)x+=b;return t(i,s,o(x,_))}if("{"==h)return v(s,{type:"codeblock"}),e("",null);if("}"==h)return y(s),e("",null);if(d(s))return">"==h?e("tag","tag"):"/"==h&&i.eat(">")?(y(s),e("tag","tag")):e("word","variable");if(/\d/.test(h))return i.match(/^\d*(?:\.\d*)?(?:E[+\-]?\d+)?/),e("number","atom");if("("===h&&i.eat(":"))return v(s,{type:"comment"}),t(i,s,n);if(g||'"'!==h&&"'"!==h){if("$"===h)return t(i,s,a);if(":"===h&&i.eat("="))return e("operator","keyword");if("("===h)return v(s,{type:"paren"}),e("",null);if(")"===h)return y(s),e("",null);if("["===h)return v(s,{type:"bracket"}),e("",null);if("]"===h)return y(s),e("",null);var k=w.propertyIsEnumerable(h)&&w[h];if(g&&'"'===h)for(;'"'!==i.next(););if(g&&"'"===h)for(;"'"!==i.next(););k||i.eatWhile(/[\w\$_-]/);var C=i.eat(":");!i.eat(":")&&C&&i.eatWhile(/[\w\$_-]/),i.match(/^[ \t]*\(/,!1)&&(f=!0);var T=i.current();return k=w.propertyIsEnumerable(T)&&w[T],f&&!k&&(k={type:"function_call",style:"variable def"}),p(s)?(y(s),e("word","variable",T)):("element"!=T&&"attribute"!=T&&"axis_specifier"!=k.type||v(s,{type:"xmlconstructor"}),k?e(k.type,k.style,T):e("word","variable",T))}return t(i,s,r(h))}function n(t,i){for(var n,r=!1,a=!1,o=0;n=t.next();){if(")"==n&&r){if(!(o>0)){y(i);break}o--}else":"==n&&a&&o++;r=":"==n,a="("==n}return e("comment","comment")}function r(t,n){return function(a,o){var s;if(f(o)&&a.current()==t)return y(o),n&&(o.tokenize=n),e("string","string");if(v(o,{type:"string",name:t,tokenize:r(t,n)}),a.match("{",!1)&&h(o))return o.tokenize=i,e("string","string");for(;s=a.next();){if(s==t){y(o),n&&(o.tokenize=n);break}if(a.match("{",!1)&&h(o))return o.tokenize=i,e("string","string")}return e("string","string")}}function a(t,n){var r=/[\w\$_-]/;if(t.eat('"')){for(;'"'!==t.next(););t.eat(":")}else t.eatWhile(r),t.match(":=",!1)||t.eat(":");return t.eatWhile(r),n.tokenize=i,e("variable","variable")}function o(t,n){return function(r,a){return r.eatSpace(),n&&r.eat(">")?(y(a),a.tokenize=i,e("tag","tag")):(r.eat("/")||v(a,{type:"tag",name:t,tokenize:i}),r.eat(">")?(a.tokenize=i,e("tag","tag")):(a.tokenize=s,e("tag","tag")))}}function s(n,a){var o=n.next();return"/"==o&&n.eat(">")?(h(a)&&y(a),d(a)&&y(a),e("tag","tag")):">"==o?(h(a)&&y(a),e("tag","tag")):"="==o?e("",null):'"'==o||"'"==o?t(n,a,r(o,s)):(h(a)||v(a,{type:"attribute",tokenize:s}),n.eat(/[a-zA-Z_:]/),n.eatWhile(/[-a-zA-Z0-9_:.]/),n.eatSpace(),(n.match(">",!1)||n.match("/",!1))&&(y(a),a.tokenize=i),e("attribute","attribute"))}function l(t,n){for(var r;r=t.next();)if("-"==r&&t.match("->",!0))return n.tokenize=i,e("comment","comment")}function c(t,n){for(var r;r=t.next();)if("]"==r&&t.match("]",!0))return n.tokenize=i,e("comment","comment")}function u(t,n){for(var r;r=t.next();)if("?"==r&&t.match(">",!0))return n.tokenize=i,e("comment","comment meta")}function d(e){return g(e,"tag")}function h(e){return g(e,"attribute")}function p(e){return g(e,"xmlconstructor")}function f(e){return g(e,"string")}function m(e){return'"'===e.current()?e.match(/^[^\"]+\"\:/,!1):"'"===e.current()&&e.match(/^[^\"]+\'\:/,!1)}function g(e,t){return e.stack.length&&e.stack[e.stack.length-1].type==t}function v(e,t){e.stack.push(t)}function y(e){e.stack.pop();var t=e.stack.length&&e.stack[e.stack.length-1].tokenize;e.tokenize=t||i}var _,b,w=function(){function e(e){return{type:e,style:"keyword"}}for(var t=e("keyword a"),i=e("keyword b"),n=e("keyword c"),r=e("operator"),a={type:"atom",style:"atom"},o={type:"punctuation",style:null},s={type:"axis_specifier",style:"qualifier"},l={if:t,switch:t,while:t,for:t,else:i,then:i,try:i,finally:i,catch:i,element:n,attribute:n,let:n,implements:n,import:n,module:n,namespace:n,return:n,super:n,this:n,throws:n,where:n,private:n,",":o,null:a,"fn:false()":a,"fn:true()":a},c=["after","ancestor","ancestor-or-self","and","as","ascending","assert","attribute","before","by","case","cast","child","comment","declare","default","define","descendant","descendant-or-self","descending","document","document-node","element","else","eq","every","except","external","following","following-sibling","follows","for","function","if","import","in","instance","intersect","item","let","module","namespace","node","node","of","only","or","order","parent","precedes","preceding","preceding-sibling","processing-instruction","ref","return","returns","satisfies","schema","schema-element","self","some","sortby","stable","text","then","to","treat","typeswitch","union","variable","version","where","xquery","empty-sequence"],u=0,d=c.length;u<d;u++)l[c[u]]=e(c[u]);for(var h=["xs:string","xs:float","xs:decimal","xs:double","xs:integer","xs:boolean","xs:date","xs:dateTime","xs:time","xs:duration","xs:dayTimeDuration","xs:time","xs:yearMonthDuration","numeric","xs:hexBinary","xs:base64Binary","xs:anyURI","xs:QName","xs:byte","xs:boolean","xs:anyURI","xf:yearMonthDuration"],u=0,d=h.length;u<d;u++)l[h[u]]=a;for(var p=["eq","ne","lt","le","gt","ge",":=","=",">",">=","<","<=",".","|","?","and","or","div","idiv","mod","*","/","+","-"],u=0,d=p.length;u<d;u++)l[p[u]]=r;for(var f=["self::","attribute::","child::","descendant::","descendant-or-self::","parent::","ancestor::","ancestor-or-self::","following::","preceding::","following-sibling::","preceding-sibling::"],u=0,d=f.length;u<d;u++)l[f[u]]=s;return l}();return{startState:function(){return{tokenize:i,cc:[],stack:[]}},token:function(e,t){return e.eatSpace()?null:t.tokenize(e,t)},blockCommentStart:"(:",blockCommentEnd:":)"}}),e.defineMIME("application/xquery","xquery")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/yaml/yaml",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,i){var n=e.peek(),r=i.escaped;if(i.escaped=!1,"#"==n&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(i.literal&&e.indentation()>i.keyCol)return e.skipToEnd(),"string";if(i.literal&&(i.literal=!1),e.sol()){if(i.keyCol=0,i.pair=!1,i.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==n?i.inlinePairs++:"}"==n?i.inlinePairs--:"["==n?i.inlineList++:i.inlineList--,"meta";if(i.inlineList>0&&!r&&","==n)return e.next(),"meta";if(i.inlinePairs>0&&!r&&","==n)return i.keyCol=0,i.pair=!1,i.pairStart=!1,e.next(),"meta";if(i.pairStart){if(e.match(/^\s*(\||\>)\s*/))return i.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==i.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(i.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!i.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(i.pair=!0,i.keyCol=e.indentation(),"atom"):i.pair&&e.match(/^:\s*/)?(i.pairStart=!0,"meta"):(i.pairStart=!1,i.escaped="\\"==n,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/erlang/erlang",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineMIME("text/x-erlang","erlang"),e.defineMode("erlang",function(t){"use strict";function i(e,t){if(t.in_string)return t.in_string=!a(e),u(t,e,"string");if(t.in_atom)return t.in_atom=!o(e),
|
||
u(t,e,"atom");if(e.eatSpace())return u(t,e,"whitespace");if(!f(t)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/))return c(e.current(),S)?u(t,e,"type"):u(t,e,"attribute");var i=e.next();if("%"==i)return e.skipToEnd(),u(t,e,"comment");if(":"==i)return u(t,e,"colon");if("?"==i)return e.eatSpace(),e.eatWhile(F),u(t,e,"macro");if("#"==i)return e.eatSpace(),e.eatWhile(F),u(t,e,"record");if("$"==i)return"\\"!=e.next()||e.match(B)?u(t,e,"number"):u(t,e,"error");if("."==i)return u(t,e,"dot");if("'"==i){if(!(t.in_atom=!o(e))){if(e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),u(t,e,"fun");if(e.match(/\s*\(/,!1)||e.match(/\s*:/,!1))return u(t,e,"function")}return u(t,e,"atom")}if('"'==i)return t.in_string=!a(e),u(t,e,"string");if(/[A-Z_Ø-ÞÀ-Ö]/.test(i))return e.eatWhile(F),u(t,e,"variable");if(/[a-z_ß-öø-ÿ]/.test(i)){if(e.eatWhile(F),e.match(/\s*\/\s*[0-9]/,!1))return e.match(/\s*\/\s*[0-9]/,!0),u(t,e,"fun");var s=e.current();return c(s,E)?u(t,e,"keyword"):c(s,D)?u(t,e,"operator"):e.match(/\s*\(/,!1)?!c(s,z)||":"==f(t).token&&"erlang"!=f(t,2).token?c(s,j)?u(t,e,"guard"):u(t,e,"function"):u(t,e,"builtin"):c(s,D)?u(t,e,"operator"):":"==l(e)?"erlang"==s?u(t,e,"builtin"):u(t,e,"function"):c(s,["true","false"])?u(t,e,"boolean"):c(s,["true","false"])?u(t,e,"boolean"):u(t,e,"atom")}var d=/[0-9]/,h=/[0-9a-zA-Z]/;return d.test(i)?(e.eatWhile(d),e.eat("#")?e.eatWhile(h)||e.backUp(1):e.eat(".")&&(e.eatWhile(d)?e.eat(/[eE]/)&&(e.eat(/[-+]/)?e.eatWhile(d)||e.backUp(2):e.eatWhile(d)||e.backUp(1)):e.backUp(1)),u(t,e,"number")):n(e,O,N)?u(t,e,"open_paren"):n(e,P,R)?u(t,e,"close_paren"):r(e,A,I)?u(t,e,"separator"):r(e,M,L)?u(t,e,"operator"):u(t,e,null)}function n(e,t,i){if(1==e.current().length&&t.test(e.current())){for(e.backUp(1);t.test(e.peek());)if(e.next(),c(e.current(),i))return!0;e.backUp(e.current().length-1)}return!1}function r(e,t,i){if(1==e.current().length&&t.test(e.current())){for(;t.test(e.peek());)e.next();for(;0<e.current().length;){if(c(e.current(),i))return!0;e.backUp(1)}e.next()}return!1}function a(e){return s(e,'"',"\\")}function o(e){return s(e,"'","\\")}function s(e,t,i){for(;!e.eol();){var n=e.next();if(n==t)return!0;n==i&&e.next()}return!1}function l(e){var t=e.match(/([\n\s]+|%[^\n]*\n)*(.)/,!1);return t?t.pop():""}function c(e,t){return-1<t.indexOf(e)}function u(e,t,i){switch(m(e,h(i,t)),i){case"atom":return"atom";case"attribute":return"attribute";case"boolean":return"atom";case"builtin":return"builtin";case"close_paren":case"colon":return null;case"comment":return"comment";case"dot":return null;case"error":return"error";case"fun":return"meta";case"function":return"tag";case"guard":return"property";case"keyword":return"keyword";case"macro":return"variable-2";case"number":return"number";case"open_paren":return null;case"operator":return"operator";case"record":return"bracket";case"separator":return null;case"string":return"string";case"type":return"def";case"variable":return"variable";default:return null}}function d(e,t,i,n){return{token:e,column:t,indent:i,type:n}}function h(e,t){return d(t.current(),t.column(),t.indentation(),e)}function p(e){return d(e,0,0,e)}function f(e,t){var i=e.tokenStack.length,n=t||1;return!(i<n)&&e.tokenStack[i-n]}function m(e,t){"comment"!=t.type&&"whitespace"!=t.type&&(e.tokenStack=g(e.tokenStack,t),e.tokenStack=v(e.tokenStack))}function g(e,t){var i=e.length-1;return 0<i&&"record"===e[i].type&&"dot"===t.type?e.pop():0<i&&"group"===e[i].type?(e.pop(),e.push(t)):e.push(t),e}function v(e){var t=e.length-1;if("dot"===e[t].type)return[];if("fun"===e[t].type&&"fun"===e[t-1].token)return e.slice(0,t-1);switch(e[e.length-1].token){case"}":return y(e,{g:["{"]});case"]":return y(e,{i:["["]});case")":return y(e,{i:["("]});case">>":return y(e,{i:["<<"]});case"end":return y(e,{i:["begin","case","fun","if","receive","try"]});case",":return y(e,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return y(e,{r:["when"],m:["try","if","case","receive"]});case";":return y(e,{E:["case","fun","if","receive","try","when"]});case"catch":return y(e,{e:["try"]});case"of":return y(e,{e:["case"]});case"after":return y(e,{e:["receive","try"]});default:return e}}function y(e,t){for(var i in t)for(var n=e.length-1,r=t[i],a=n-1;-1<a;a--)if(c(e[a].token,r)){var o=e.slice(0,a);switch(i){case"m":return o.concat(e[a]).concat(e[n]);case"r":return o.concat(e[n]);case"i":return o;case"g":return o.concat(p("group"));case"E":case"e":return o.concat(e[a])}}return"E"==i?[]:e}function _(i,n){var r,a=t.indentUnit,o=b(n),s=f(i,1),l=f(i,2);return i.in_string||i.in_atom?e.Pass:l?"when"==s.token?s.column+a:"when"===o&&"function"===l.type?l.indent+a:"("===o&&"fun"===s.token?s.column+3:"catch"===o&&(r=k(i,["try"]))?r.column:c(o,["end","after","of"])?(r=k(i,["begin","case","fun","if","receive","try"]),r?r.column:e.Pass):c(o,R)?(r=k(i,N),r?r.column:e.Pass):c(s.token,[",","|","||"])||c(o,[",","|","||"])?(r=w(i),r?r.column+r.token.length:a):"->"==s.token?c(l.token,["receive","case","if","try"])?l.column+a+a:l.column+a:c(s.token,N)?s.column+s.token.length:(r=x(i),T(r)?r.column+a:0):0}function b(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return T(t)&&0===t.index?t[0]:""}function w(e){var t=e.tokenStack.slice(0,-1),i=C(t,"type",["open_paren"]);return!!T(t[i])&&t[i]}function x(e){var t=e.tokenStack,i=C(t,"type",["open_paren","separator","keyword"]),n=C(t,"type",["operator"]);return T(i)&&T(n)&&i<n?t[i+1]:!!T(i)&&t[i]}function k(e,t){var i=e.tokenStack,n=C(i,"token",t);return!!T(i[n])&&i[n]}function C(e,t,i){for(var n=e.length-1;-1<n;n--)if(c(e[n][t],i))return n;return!1}function T(e){return!1!==e&&null!=e}var S=["-type","-spec","-export_type","-opaque"],E=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"],A=/[\->,;]/,I=["->",";",","],D=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"],M=/[\+\-\*\/<>=\|:!]/,L=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"],O=/[<\(\[\{]/,N=["<<","(","[","{"],P=/[>\)\]\}]/,R=["}","]",")",">>"],j=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"],z=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"],F=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/,B=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;return{startState:function(){return{tokenStack:[],in_string:!1,in_atom:!1}},token:function(e,t){return i(e,t)},indent:function(e,t){return _(e,t)},lineComment:"%"}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/mode/jade/jade",["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){e.defineMode("jade",function(t){function i(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=Q.startState(),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function n(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var i=Q.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),i||!0}}function r(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);return Q.token(e,t.jsState)||!0}}function a(e){if(e.match(/^yield\b/))return"keyword"}function o(e){if(e.match(/^(?:doctype) *([^\n]+)?/))return G}function s(e,t){if(e.match("#{"))return t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"}function l(e,t){if(t.isInterpolating){if("}"===e.peek()){if(--t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"puncutation"}else"{"===e.peek()&&t.interpolationNesting++;return Q.token(e,t.jsState)||!0}}function c(e,t){if(e.match(/^case\b/))return t.javaScriptLine=!0,V}function u(e,t){if(e.match(/^when\b/))return t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,V}function d(e){if(e.match(/^default\b/))return V}function h(e,t){if(e.match(/^extends?\b/))return t.restOfLine="string",V}function p(e,t){if(e.match(/^append\b/))return t.restOfLine="variable",V}function f(e,t){if(e.match(/^prepend\b/))return t.restOfLine="variable",V}function m(e,t){if(e.match(/^block\b *(?:(prepend|append)\b)?/))return t.restOfLine="variable",V}function g(e,t){if(e.match(/^include\b/))return t.restOfLine="string",V}function v(e,t){if(e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include"))return t.isIncludeFiltered=!0,V}function y(e,t){if(t.isIncludeFiltered){var i=E(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",i}}function _(e,t){if(e.match(/^mixin\b/))return t.javaScriptLine=!0,V}function b(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,s(e,t)):void 0}function w(e,t){if(t.mixinCallAfter)return t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0}function x(e,t){if(e.match(/^(if|unless|else if|else)\b/))return t.javaScriptLine=!0,V}function k(e,t){if(e.match(/^(- *)?(each|for)\b/))return t.isEach=!0,V}function C(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,V;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function T(e,t){if(e.match(/^while\b/))return t.javaScriptLine=!0,V}function S(e,t){var i;if(i=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))return t.lastTag=i[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"}function E(i,n){if(i.match(/^:([\w\-]+)/)){var r;return t&&t.innerModes&&(r=t.innerModes(i.current().substring(1))),r||(r=i.current().substring(1)),"string"==typeof r&&(r=e.getMode(t,r)),B(i,n,r),"atom"}}function A(e,t){if(e.match(/^(!?=|-)/))return t.javaScriptLine=!0,"punctuation"}function I(e){if(e.match(/^#([\w-]+)/))return Y}function D(e){if(e.match(/^\.([\w-]+)/))return K}function M(e,t){if("("==e.peek())return e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"}function L(e,t){if(t.isAttrs){if(X[e.peek()]&&t.attrsNest.push(X[e.peek()]),t.attrsNest[t.attrsNest.length-1]===e.peek())t.attrsNest.pop();else if(e.eat(")"))return t.isAttrs=!1,"punctuation";if(t.inAttributeName&&e.match(/^[^=,\)!]+/))return"="!==e.peek()&&"!"!==e.peek()||(t.inAttributeName=!1,t.jsState=Q.startState(),"script"===t.lastTag&&"type"===e.current().trim().toLowerCase()?t.attributeIsType=!0:t.attributeIsType=!1),"attribute";var i=Q.token(e,t.jsState);if(t.attributeIsType&&"string"===i&&(t.scriptType=e.current().toString()),0===t.attrsNest.length&&("string"===i||"variable"===i||"keyword"===i))try{return Function("","var x "+t.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),t.inAttributeName=!0,t.attrValue="",e.backUp(e.current().length),L(e,t)}catch(e){}return t.attrValue+=e.current(),i||!0}}function O(e,t){if(e.match(/^&attributes\b/))return t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"}function N(e){if(e.sol()&&e.eatSpace())return"indent"}function P(e,t){if(e.match(/^ *\/\/(-)?([^\n]*)/))return t.indentOf=e.indentation(),t.indentToken="comment","comment"}function R(e){if(e.match(/^: */))return"colon"}function j(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(B(e,t,"htmlmixed"),t.innerModeForLine=!0,U(e,t,!0)):void 0}function z(e,t){if(e.eat(".")){var i=null;return"script"===t.lastTag&&-1!=t.scriptType.toLowerCase().indexOf("javascript")?i=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(i="css"),B(e,t,i),"dot"}}function F(e){return e.next(),null}function B(i,n,r){r=e.mimeModes[r]||r,r=t.innerModes?t.innerModes(r)||r:r,r=e.mimeModes[r]||r,r=e.getMode(t,r),n.indentOf=i.indentation(),r&&"null"!==r.name?n.innerMode=r:n.indentToken="string"}function U(e,t,i){if(e.indentation()>t.indentOf||t.innerModeForLine&&!e.sol()||i)return t.innerMode?(t.innerState||(t.innerState=t.innerMode.startState?t.innerMode.startState(e.indentation()):{}),e.hideFirstChars(t.indentOf+2,function(){return t.innerMode.token(e,t.innerState)||!0})):(e.skipToEnd(),t.indentToken);e.sol()&&(t.indentOf=1/0,t.indentToken=null,t.innerMode=null,t.innerState=null)}function $(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var i=t.restOfLine;return t.restOfLine="",i}}function q(){return new i}function H(e){return e.copy()}function W(e,t){var i=U(e,t)||$(e,t)||l(e,t)||y(e,t)||C(e,t)||L(e,t)||n(e,t)||r(e,t)||w(e,t)||a(e,t)||o(e,t)||s(e,t)||c(e,t)||u(e,t)||d(e,t)||h(e,t)||p(e,t)||f(e,t)||m(e,t)||g(e,t)||v(e,t)||_(e,t)||b(e,t)||x(e,t)||k(e,t)||T(e,t)||S(e,t)||E(e,t)||A(e,t)||I(e,t)||D(e,t)||M(e,t)||O(e,t)||N(e,t)||j(e,t)||P(e,t)||R(e,t)||z(e,t)||F(e,t);return!0===i?null:i}var V="keyword",G="meta",Y="builtin",K="qualifier",X={"{":"}","(":")","[":"]"},Q=e.getMode(t,"javascript");return i.prototype.copy=function(){var t=new i;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.intpolationNesting,t.jsState=e.copyState(Q,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:q,copyState:H,token:W}}),e.defineMIME("text/x-jade","jade")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/edit/trailingspace",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.defineOption("showTrailingSpace",!1,function(t,i,n){n==e.Init&&(n=!1),n&&!i?t.removeOverlay("trailingspace"):!n&&i&&t.addOverlay({token:function(e){for(var t=e.string.length,i=t;i&&/\s/.test(e.string.charAt(i-1));--i);return i>e.pos?(e.pos=i,null):(e.pos=t,"trailingspace")},name:"trailingspace"})})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/dialog/dialog",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,i){var n,r=e.getWrapperElement();return n=r.appendChild(document.createElement("div")),n.className=i?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?n.innerHTML=t:n.appendChild(t),n}function i(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(n,r,a){function o(e){if("string"==typeof e)d.value=e;else{if(c)return;c=!0,l.parentNode.removeChild(l),u.focus(),a.onClose&&a.onClose(l)}}a||(a={}),i(this,null);var s,l=t(this,n,a.bottom),c=!1,u=this,d=l.getElementsByTagName("input")[0];return d?(a.value&&(d.value=a.value,d.select()),a.onInput&&e.on(d,"input",function(e){a.onInput(e,d.value,o)}),a.onKeyUp&&e.on(d,"keyup",function(e){a.onKeyUp(e,d.value,o)}),e.on(d,"keydown",function(t){a&&a.onKeyDown&&a.onKeyDown(t,d.value,o)||((27==t.keyCode||!1!==a.closeOnEnter&&13==t.keyCode)&&(d.blur(),e.e_stop(t),o()),13==t.keyCode&&r(d.value,t))}),!1!==a.closeOnBlur&&e.on(d,"blur",o),d.focus()):(s=l.getElementsByTagName("button")[0])&&(e.on(s,"click",function(){o(),u.focus()}),!1!==a.closeOnBlur&&e.on(s,"blur",o),s.focus()),o}),e.defineExtension("openConfirm",function(n,r,a){function o(){c||(c=!0,s.parentNode.removeChild(s),u.focus())}i(this,null);var s=t(this,n,a&&a.bottom),l=s.getElementsByTagName("button"),c=!1,u=this,d=1;l[0].focus();for(var h=0;h<l.length;++h){var p=l[h];!function(t){e.on(p,"click",function(i){e.e_preventDefault(i),o(),t&&t(u)})}(r[h]),e.on(p,"blur",function(){--d,setTimeout(function(){d<=0&&o()},200)}),e.on(p,"focus",function(){++d})}}),e.defineExtension("openNotification",function(n,r){function a(){l||(l=!0,clearTimeout(o),s.parentNode.removeChild(s))}i(this,a);var o,s=t(this,n,r&&r.bottom),l=!1,c=r&&void 0!==r.duration?r.duration:5e3;return e.on(s,"click",function(t){e.e_preventDefault(t),a()}),c&&(o=setTimeout(a,c)),a})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/search/searchcursor",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,r,a){if(this.atOccurrence=!1,this.doc=e,null==a&&"string"==typeof t&&(a=!1),r=r?e.clipPos(r):n(0,0),this.pos={from:r,to:r},"string"!=typeof t)t.global||(t=new RegExp(t.source,t.ignoreCase?"ig":"g")),this.matches=function(i,r){if(i){t.lastIndex=0;for(var a,o,s=e.getLine(r.line).slice(0,r.ch),l=0;;){t.lastIndex=l;var c=t.exec(s);if(!c)break;if(a=c,o=a.index,(l=a.index+(a[0].length||1))==s.length)break}var u=a&&a[0].length||0;u||(0==o&&0==s.length?a=void 0:o!=e.getLine(r.line).length&&u++)}else{t.lastIndex=r.ch;var s=e.getLine(r.line),a=t.exec(s),u=a&&a[0].length||0,o=a&&a.index;o+u==s.length||u||(u=1)}if(a&&u)return{from:n(r.line,o),to:n(r.line,o+u),match:a}};else{var o=t;a&&(t=t.toLowerCase());var s=a?function(e){return e.toLowerCase()}:function(e){return e},l=t.split("\n");if(1==l.length)t.length?this.matches=function(r,a){if(r){var l=e.getLine(a.line).slice(0,a.ch),c=s(l),u=c.lastIndexOf(t);if(u>-1)return u=i(l,c,u),{from:n(a.line,u),to:n(a.line,u+o.length)}}else{var l=e.getLine(a.line).slice(a.ch),c=s(l),u=c.indexOf(t);if(u>-1)return u=i(l,c,u)+a.ch,{from:n(a.line,u),to:n(a.line,u+o.length)}}}:this.matches=function(){};else{var c=o.split("\n");this.matches=function(t,i){var r=l.length-1;if(t){if(i.line-(l.length-1)<e.firstLine())return;if(s(e.getLine(i.line).slice(0,c[r].length))!=l[l.length-1])return;for(var a=n(i.line,c[r].length),o=i.line-1,u=r-1;u>=1;--u,--o)if(l[u]!=s(e.getLine(o)))return;var d=e.getLine(o),h=d.length-c[0].length;if(s(d.slice(h))!=l[0])return;return{from:n(o,h),to:a}}if(!(i.line+(l.length-1)>e.lastLine())){var d=e.getLine(i.line),h=d.length-c[0].length;if(s(d.slice(h))==l[0]){for(var p=n(i.line,h),o=i.line+1,u=1;u<r;++u,++o)if(l[u]!=s(e.getLine(o)))return;if(s(e.getLine(o).slice(0,c[r].length))==l[r])return{from:p,to:n(o,c[r].length)}}}}}}}function i(e,t,i){if(e.length==t.length)return i;for(var n=Math.min(i,e.length);;){var r=e.slice(0,n).toLowerCase().length;if(r<i)++n;else{if(!(r>i))return n;--n}}}var n=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=n(e,0);return i.pos={from:t,to:t},i.atOccurrence=!1,!1}for(var i=this,r=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,r))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!r.line)return t(0);r=n(r.line-1,this.doc.getLine(r.line-1).length)}else{var a=this.doc.lineCount();if(r.line==a-1)return t(a);r=n(r.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to),this.pos.to=n(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,i,n){return new t(this.doc,e,i,n)}),e.defineDocExtension("getSearchCursor",function(e,i,n){return new t(this,e,i,n)}),e.defineExtension("selectMatches",function(t,i){for(var n=[],r=this.getSearchCursor(t,this.getCursor("from"),i);r.findNext()&&!(e.cmpPos(r.to(),this.getCursor("to"))>0);)n.push({anchor:r.from(),head:r.to()});n.length&&this.setSelections(n,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/search/search",["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var i=e.exec(t.string);if(i&&i.index==t.pos)return t.pos+=i[0].length,"searching";i?t.pos=i.index:t.skipToEnd()}}}function i(){this.posFrom=this.posTo=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new i)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function a(e,t,i){return e.getSearchCursor(t,i,r(t))}function o(e,t,i,n,r){e.openDialog?e.openDialog(t,r,{value:n}):r(prompt(i,n))}function s(e,t,i,n){e.openConfirm?e.openConfirm(t,n):confirm(i)&&n[0]()}function l(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,i){var a=n(e);if(a.query)return u(e,i);o(e,p,"Search for:",e.getSelection(),function(n){e.operation(function(){n&&!a.query&&(a.query=l(n),e.removeOverlay(a.overlay,r(a.query)),a.overlay=t(a.query,r(a.query)),e.addOverlay(a.overlay),e.showMatchesOnScrollbar&&(a.annotate&&(a.annotate.clear(),a.annotate=null),a.annotate=e.showMatchesOnScrollbar(a.query,r(a.query))),a.posFrom=a.posTo=e.getCursor(),u(e,i))})})}function u(t,i){t.operation(function(){var r=n(t),o=a(t,r.query,i?r.posFrom:r.posTo);(o.find(i)||(o=a(t,r.query,i?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),o.find(i)))&&(t.setSelection(o.from(),o.to()),t.scrollIntoView({from:o.from(),to:o.to()}),r.posFrom=o.from(),r.posTo=o.to())})}function d(e){e.operation(function(){var t=n(e);t.query&&(t.query=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function h(e,t){e.getOption("readOnly")||o(e,f,"Replace:",e.getSelection(),function(i){i&&(i=l(i),o(e,m,"Replace with:","",function(n){if(t)e.operation(function(){for(var t=a(e,i);t.findNext();)if("string"!=typeof i){var r=e.getRange(t.from(),t.to()).match(i);t.replace(n.replace(/\$(\d)/g,function(e,t){return r[t]}))}else t.replace(n)});else{d(e);var r=a(e,i,e.getCursor()),o=function(){var t,n=r.from();!(t=r.findNext())&&(r=a(e,i),!(t=r.findNext())||n&&r.from().line==n.line&&r.from().ch==n.ch)||(e.setSelection(r.from(),r.to()),e.scrollIntoView({from:r.from(),to:r.to()}),s(e,g,"Replace?",[function(){l(t)},o]))},l=function(e){r.replace("string"==typeof i?n:n.replace(/\$(\d)/g,function(t,i){return e[i]})),o()};o()}}))})}var p='Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',f='Replace: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>',m='With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>',g="Replace? <button>Yes</button> <button>No</button> <button>Stop</button>";e.commands.find=function(e){d(e),c(e)},e.commands.findNext=c,e.commands.findPrev=function(e){c(e,!0)},e.commands.clearSearch=d,e.commands.replace=h,e.commands.replaceAll=function(e){h(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/scroll/annotatescrollbar",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){function i(e){clearTimeout(n.doRedraw),n.doRedraw=setTimeout(function(){n.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var n=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(n.doUpdate),n.doUpdate=setTimeout(function(){n.computeScale()&&i(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),!1!==t.listenForChanges&&e.on("change",this.changeHandler=function(){i(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.heightAtLine(e.lastLine()+1,"local");if(t!=this.hScale)return this.hScale=t,!0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){!1!==e&&this.computeScale();var t=this.cm,i=this.hScale,n=document.createDocumentFragment(),r=this.annotations;if(t.display.barWidth)for(var a,o=0;o<r.length;o++){for(var s=r[o],l=a||t.charCoords(s.from,"local").top*i,c=t.charCoords(s.to,"local").bottom*i;o<r.length-1&&!((a=t.charCoords(r[o+1].from,"local").top*i)>c+.9);)s=r[++o],c=t.charCoords(s.to,"local").bottom*i;if(c!=l){var u=Math.max(c-l,3),d=n.appendChild(document.createElement("div"));d.style.cssText="position: absolute; right: 0px; width: "+Math.max(t.display.barWidth-1,2)+"px; top: "+(l+this.buttonHeight)+"px; height: "+u+"px",d.className=this.options.className}}this.div.textContent="",this.div.appendChild(n)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/search/matchesonscrollbar",["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,i,n){this.cm=e;var r={listenForChanges:!1};for(var a in n)r[a]=n[a];r.className||(r.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(r),this.query=t,this.caseFold=i,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var o=this;e.on("change",this.changeHandler=function(e,t){o.onChange(t)})}function i(e,t,i){return e<=t?e:Math.max(t,e+i)}e.defineExtension("showMatchesOnScrollbar",function(e,i,n){return"string"==typeof n&&(n={className:n}),n||(n={}),new t(this,e,i,n)});t.prototype.findMatches=function(){if(this.gap){for(var t=0;t<this.matches.length;t++){var i=this.matches[t];if(i.from.line>=this.gap.to)break;i.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var n=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold);n.findNext();){var i={from:n.from(),to:n.to()};if(i.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,i),this.matches.length>1e3)break}this.gap=null}},t.prototype.onChange=function(t){var n=t.from.line,r=e.changeEnd(t).line,a=r-t.to.line;if(this.gap?(this.gap.from=Math.min(i(this.gap.from,n,a),t.from.line),this.gap.to=Math.max(i(this.gap.to,n,a),t.from.line)):this.gap={from:t.from.line,to:r+1},a)for(var o=0;o<this.matches.length;o++){var s=this.matches[o],l=i(s.from.line,n,a);l!=s.from.line&&(s.from=e.Pos(l,s.from.ch));var c=i(s.to.line,n,a);c!=s.to.line&&(s.to=e.Pos(c,s.to.ch))}clearTimeout(this.update);var u=this;this.update=setTimeout(function(){u.updateAfterChange()},250)},t.prototype.updateAfterChange=function(){this.findMatches(),this.annotation.update(this.matches)},t.prototype.clear=function(){this.cm.off("change",this.changeHandler),this.annotation.clear()}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/display/placeholder",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function i(e){t(e);var i=e.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.className="CodeMirror-placeholder",i.appendChild(document.createTextNode(e.getOption("placeholder"))),e.display.lineSpace.insertBefore(i,e.display.lineSpace.firstChild)}function n(e){a(e)&&i(e)}function r(e){var n=e.getWrapperElement(),r=a(e);n.className=n.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?i(e):t(e)}function a(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(i,a,o){var s=o&&o!=e.Init;if(a&&!s)i.on("blur",n),i.on("change",r),r(i);else if(!a&&s){i.off("blur",n),i.off("change",r),t(i);var l=i.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}a&&!i.hasFocus()&&n(i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/fold/xml-fold",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line-t.line||e.ch-t.ch}
|
||
function i(e,t,i,n){this.line=t,this.ch=i,this.cm=e,this.text=e.getLine(t),this.min=n?n.from:e.firstLine(),this.max=n?n.to-1:e.lastLine()}function n(e,t){var i=e.cm.getTokenTypeAt(h(e.line,t));return i&&/\btag\b/.test(i)}function r(e){if(!(e.line>=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function a(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function o(e){for(;;){var t=e.text.indexOf(">",e.ch);if(-1==t){if(r(e))continue;return}{if(n(e,t+1)){var i=e.text.lastIndexOf("/",t),a=i>-1&&!/\S/.test(e.text.slice(i+1,t));return e.ch=t+1,a?"selfClose":"regular"}e.ch=t+1}}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(n(e,t+1)){f.lastIndex=t,e.ch=t;var i=f.exec(e.text);if(i&&i.index==t)return i}else e.ch=t}}function l(e){for(;;){f.lastIndex=e.ch;var t=f.exec(e.text);if(!t){if(r(e))continue;return}{if(n(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(a(e))continue;return}{if(n(e,t+1)){var i=e.text.lastIndexOf("/",t),r=i>-1&&!/\S/.test(e.text.slice(i+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var i=[];;){var n,r=l(e),a=e.line,s=e.ch-(r?r[0].length:0);if(!r||!(n=o(e)))return;if("selfClose"!=n)if(r[1]){for(var c=i.length-1;c>=0;--c)if(i[c]==r[2]){i.length=c;break}if(c<0&&(!t||t==r[2]))return{tag:r[2],from:h(a,s),to:h(e.line,e.ch)}}else i.push(r[2])}}function d(e,t){for(var i=[];;){var n=c(e);if(!n)return;if("selfClose"!=n){var r=e.line,a=e.ch,o=s(e);if(!o)return;if(o[1])i.push(o[2]);else{for(var l=i.length-1;l>=0;--l)if(i[l]==o[2]){i.length=l;break}if(l<0&&(!t||t==o[2]))return{tag:o[2],from:h(e.line,e.ch),to:h(r,a)}}}else s(e)}}var h=e.Pos,p="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",f=new RegExp("<(/?)(["+p+"][A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*)","g");e.registerHelper("fold","xml",function(e,t){for(var n=new i(e,t.line,0);;){var r,a=l(n);if(!a||n.line!=t.line||!(r=o(n)))return;if(!a[1]&&"selfClose"!=r){var t=h(n.line,n.ch),s=u(n,a[2]);return s&&{from:t,to:s.from}}}}),e.findMatchingTag=function(e,n,r){var a=new i(e,n.line,n.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var l=o(a),c=l&&h(a.line,a.ch),p=l&&s(a);if(l&&p&&!(t(a,n)>0)){var f={from:h(a.line,a.ch),to:c,tag:p[2]};return"selfClose"==l?{open:f,close:null,at:"open"}:p[1]?{open:d(a,p[2]),close:f,at:"close"}:(a=new i(e,c.line,c.ch,r),{open:f,close:u(a,p[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,n){for(var r=new i(e,t.line,t.ch,n);;){var a=d(r);if(!a)break;var o=new i(e,t.line,t.ch,n),s=u(o,a.tag);if(s)return{open:a,close:s}}},e.scanForClosingTag=function(e,t,n,r){return u(new i(e,t.line,t.ch,r?{from:0,to:r}:null),n)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../fold/xml-fold")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/edit/closetag",["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var i=t.listSelections(),n=[],l=0;l<i.length;l++){if(!i[l].empty())return e.Pass;var c=i[l].head,u=t.getTokenAt(c),d=e.innerMode(t.getMode(),u.state),h=d.state;if("xml"!=d.mode.name||!h.tagName)return e.Pass;var p=t.getOption("autoCloseTags"),f="html"==d.mode.configuration,m="object"==typeof p&&p.dontCloseTags||f&&o,g="object"==typeof p&&p.indentTags||f&&s,v=h.tagName;u.end>c.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==h.type||u.string.indexOf("/")==u.string.length-1||m&&r(m,y)>-1||a(t,v,c,h,!0))return e.Pass;var _=g&&r(g,y)>-1;n[l]={indent:_,text:">"+(_?"\n\n":"")+"</"+v+">",newPos:_?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=i.length-1;l>=0;l--){var b=n[l];t.replaceRange(b.text,i[l].head,i[l].anchor,"+insert");var w=t.listSelections().slice(0);w[l]={head:b.newPos,anchor:b.newPos},t.setSelections(w),b.indent&&(t.indentLine(b.newPos.line,null,!0),t.indentLine(b.newPos.line+1,null,!0))}}function i(t,i){for(var n=t.listSelections(),r=[],o=i?"/":"</",s=0;s<n.length;s++){if(!n[s].empty())return e.Pass;var l=n[s].head,c=t.getTokenAt(l),u=e.innerMode(t.getMode(),c.state),d=u.state;if(i&&("string"==c.type||"<"!=c.string.charAt(0)||c.start!=l.ch-1))return e.Pass;if("xml"!=u.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==u.mode.name)r[s]=o+"script>";else{if("htmlmixed"!=t.getMode().name||"css"!=u.mode.name)return e.Pass;r[s]=o+"style>"}else{if(!d.context||!d.context.tagName||a(t,d.context.tagName,l,d))return e.Pass;r[s]=o+d.context.tagName+">"}}t.replaceSelections(r),n=t.listSelections();for(var s=0;s<n.length;s++)(s==n.length-1||n[s].head.line<n[s+1].head.line)&&t.indentLine(n[s].head.line)}function n(t){return t.getOption("disableInput")?e.Pass:i(t,!0)}function r(e,t){if(e.indexOf)return e.indexOf(t);for(var i=0,n=e.length;i<n;++i)if(e[i]==t)return i;return-1}function a(t,i,n,r,a){if(!e.scanForClosingTag)return!1;var o=Math.min(t.lastLine()+1,n.line+500),s=e.scanForClosingTag(t,n,null,o);if(!s||s.tag!=i)return!1;for(var l=r.context,c=a?1:0;l&&l.tagName==i;l=l.prev)++c;n=s.to;for(var u=1;u<c;u++){var d=e.scanForClosingTag(t,n,null,o);if(!d||d.tag!=i)return!1;n=d.to}return!0}e.defineOption("autoCloseTags",!1,function(i,r,a){if(a!=e.Init&&a&&i.removeKeyMap("autoCloseTags"),r){var o={name:"autoCloseTags"};("object"!=typeof r||r.whenClosing)&&(o["'/'"]=function(e){return n(e)}),("object"!=typeof r||r.whenOpening)&&(o["'>'"]=function(e){return t(e)}),i.addKeyMap(o)}});var o=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return i(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/fold/foldcode",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,r,a,o){function s(e){var i=l(t,r);if(!i||i.to.line-i.from.line<c)return null;for(var n=t.findMarksAt(i.from),a=0;a<n.length;++a)if(n[a].__isFold&&"fold"!==o){if(!e)return null;i.cleared=!0,n[a].clear()}return i}if(a&&a.call){var l=a;a=null}else var l=n(t,a,"rangeFinder");"number"==typeof r&&(r=e.Pos(r,0));var c=n(t,a,"minFoldSize"),u=s(!0);if(n(t,a,"scanUp"))for(;!u&&r.line>t.firstLine();)r=e.Pos(r.line-1,0),u=s(!1);if(u&&!u.cleared&&"unfold"!==o){var d=i(t,a);e.on(d,"mousedown",function(t){h.clear(),e.e_preventDefault(t)});var h=t.markText(u.from,u.to,{replacedWith:d,clearOnEnter:!0,__isFold:!0});h.on("clear",function(i,n){e.signal(t,"unfold",t,i,n)}),e.signal(t,"fold",t,u.from,u.to)}}function i(e,t){var i=n(e,t,"widget");if("string"==typeof i){var r=document.createTextNode(i);i=document.createElement("span"),i.appendChild(r),i.className="CodeMirror-foldmarker"}return i}function n(e,t,i){if(t&&void 0!==t[i])return t[i];var n=e.options.foldOptions;return n&&void 0!==n[i]?n[i]:r[i]}e.newFoldFunction=function(e,i){return function(n,r){t(n,r,{rangeFinder:e,widget:i})}},e.defineExtension("foldCode",function(e,i,n){t(this,e,i,n)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),i=0;i<t.length;++i)if(t[i].__isFold)return!0}),e.commands.toggleFold=function(e){e.foldCode(e.getCursor())},e.commands.fold=function(e){e.foldCode(e.getCursor(),null,"fold")},e.commands.unfold=function(e){e.foldCode(e.getCursor(),null,"unfold")},e.commands.foldAll=function(t){t.operation(function(){for(var i=t.firstLine(),n=t.lastLine();i<=n;i++)t.foldCode(e.Pos(i,0),null,"fold")})},e.commands.unfoldAll=function(t){t.operation(function(){for(var i=t.firstLine(),n=t.lastLine();i<=n;i++)t.foldCode(e.Pos(i,0),null,"unfold")})},e.registerHelper("fold","combine",function(){var e=Array.prototype.slice.call(arguments,0);return function(t,i){for(var n=0;n<e.length;++n){var r=e[n](t,i);if(r)return r}}}),e.registerHelper("fold","auto",function(e,t){for(var i=e.getHelpers(t,"fold"),n=0;n<i.length;n++){var r=i[n](e,t);if(r)return r}});var r={rangeFinder:e.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1};e.defineOption("foldOptions",null),e.defineExtension("foldOption",function(e,t){return n(this,e,t)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/fold/foldgutter",["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function i(e){return!0===e&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function n(e,t){for(var i=e.findMarksAt(d(t)),n=0;n<i.length;++n)if(i[n].__isFold&&i[n].find().from.line==t)return!0}function r(e){if("string"==typeof e){var t=document.createElement("div");return t.className=e+" CodeMirror-guttermarker-subtle",t}return e.cloneNode(!0)}function a(e,t,i){var a=e.state.foldGutter.options,o=t,s=e.foldOption(a,"minFoldSize"),l=e.foldOption(a,"rangeFinder");e.eachLine(t,i,function(t){var i=null;if(n(e,o))i=r(a.indicatorFolded);else{var c=d(o,0),u=l&&l(e,c);u&&u.to.line-u.from.line>=s&&(i=r(a.indicatorOpen))}e.setGutterMarker(t,a.gutter,i),++o})}function o(e){var t=e.getViewport(),i=e.state.foldGutter;i&&(e.operation(function(){a(e,t.from,t.to)}),i.from=t.from,i.to=t.to)}function s(e,t,i){var n=e.state.foldGutter;if(n){var r=n.options;i==r.gutter&&e.foldCode(d(t,0),r.rangeFinder)}}function l(e){var t=e.state.foldGutter;if(t){var i=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){o(e)},i.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var i=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var i=e.getViewport();t.from==t.to||i.from-t.to>20||t.from-i.to>20?o(e):e.operation(function(){i.from<t.from&&(a(e,i.from,t.from),t.from=i.from),i.to>t.to&&(a(e,t.to,i.to),t.to=i.to)})},i.updateViewportTimeSpan||400)}}function u(e,t){var i=e.state.foldGutter;if(i){var n=t.line;n>=i.from&&n<i.to&&a(e,n,n+1)}}e.defineOption("foldGutter",!1,function(n,r,a){a&&a!=e.Init&&(n.clearGutter(n.state.foldGutter.options.gutter),n.state.foldGutter=null,n.off("gutterClick",s),n.off("change",l),n.off("viewportChange",c),n.off("fold",u),n.off("unfold",u),n.off("swapDoc",o)),r&&(n.state.foldGutter=new t(i(r)),o(n),n.on("gutterClick",s),n.on("change",l),n.on("viewportChange",c),n.on("fold",u),n.on("unfold",u),n.on("swapDoc",o))});var d=e.Pos}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/fold/indent-fold",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.registerHelper("fold","indent",function(t,i){var n=t.getOption("tabSize"),r=t.getLine(i.line);if(/\S/.test(r)){for(var a=function(t){return e.countColumn(t,null,n)},o=a(r),s=null,l=i.line+1,c=t.lastLine();l<=c;++l){var u=t.getLine(l);if(a(u)>o)s=l;else if(/\S/.test(u))break}return s?{from:e.Pos(i.line,r.length),to:e.Pos(s,t.getLine(s).length)}:void 0}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/fold/brace-fold",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.registerHelper("fold","brace",function(t,i){function n(n){for(var r=i.ch,l=0;;){var c=r<=0?-1:s.lastIndexOf(n,r-1);if(-1!=c){if(1==l&&c<i.ch)break;if(a=t.getTokenTypeAt(e.Pos(o,c+1)),!/^(comment|string)/.test(a))return c+1;r=c-1}else{if(1==l)break;l=1,r=s.length}}}var r,a,o=i.line,s=t.getLine(o),l="{",c="}",r=n("{");if(null==r&&(l="[",c="]",r=n("[")),null!=r){var u,d,h=1,p=t.lastLine();e:for(var f=o;f<=p;++f)for(var m=t.getLine(f),g=f==o?r:0;;){var v=m.indexOf(l,g),y=m.indexOf(c,g);if(v<0&&(v=m.length),y<0&&(y=m.length),(g=Math.min(v,y))==m.length)break;if(t.getTokenTypeAt(e.Pos(f,g+1))==a)if(g==v)++h;else if(!--h){u=f,d=g;break e}++g}if(null!=u&&(o!=u||d!=r))return{from:e.Pos(o,r),to:e.Pos(u,d)}}}),e.registerHelper("fold","import",function(t,i){function n(i){if(i<t.firstLine()||i>t.lastLine())return null;var n=t.getTokenAt(e.Pos(i,1));if(/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(i,n.end+1))),"keyword"!=n.type||"import"!=n.string)return null;for(var r=i,a=Math.min(t.lastLine(),i+10);r<=a;++r){var o=t.getLine(r),s=o.indexOf(";");if(-1!=s)return{startCh:n.end,end:e.Pos(r,s)}}}var r,i=i.line,a=n(i);if(!a||n(i-1)||(r=n(i-2))&&r.end.line==i-1)return null;for(var o=a.end;;){var s=n(o.line+1);if(null==s)break;o=s.end}return{from:t.clipPos(e.Pos(i,a.startCh+1)),to:o}}),e.registerHelper("fold","include",function(t,i){function n(i){if(i<t.firstLine()||i>t.lastLine())return null;var n=t.getTokenAt(e.Pos(i,1));return/\S/.test(n.string)||(n=t.getTokenAt(e.Pos(i,n.end+1))),"meta"==n.type&&"#include"==n.string.slice(0,8)?n.start+8:void 0}var i=i.line,r=n(i);if(null==r||null!=n(i-1))return null;for(var a=i;;){if(null==n(a+1))break;++a}return{from:e.Pos(i,r+1),to:t.clipPos(e.Pos(a))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/fold/markdown-fold",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.registerHelper("fold","markdown",function(t,i){function n(i){var n=t.getTokenTypeAt(e.Pos(i,0));return n&&/\bheader\b/.test(n)}function r(e,t,i){var r=t&&t.match(/^#+/);return r&&n(e)?r[0].length:(r=i&&i.match(/^[=\-]+\s*$/),r&&n(e+1)?"="==i[0]?1:2:a)}var a=100,o=t.getLine(i.line),s=t.getLine(i.line+1),l=r(i.line,o,s);if(l!==a){for(var c=t.lastLine(),u=i.line,d=t.getLine(u+2);u<c&&!(r(u+1,s,d)<=l);)++u,s=d,d=t.getLine(u+2);return{from:e.Pos(i.line,o.length),to:e.Pos(u,t.getLine(u).length)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/fold/comment-fold",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){e.registerGlobalHelper("fold","comment",function(e){return e.blockCommentStart&&e.blockCommentEnd},function(t,i){var n=t.getModeAt(i),r=n.blockCommentStart,a=n.blockCommentEnd;if(r&&a){for(var o,s=i.line,l=t.getLine(s),c=i.ch,u=0;;){var d=c<=0?-1:l.lastIndexOf(r,c-1);if(-1!=d){if(1==u&&d<i.ch)return;if(/comment/.test(t.getTokenTypeAt(e.Pos(s,d+1)))){o=d+r.length;break}c=d-1}else{if(1==u)return;u=1,c=l.length}}var h,p,f=1,m=t.lastLine();e:for(var g=s;g<=m;++g)for(var v=t.getLine(g),y=g==s?o:0;;){var _=v.indexOf(r,y),b=v.indexOf(a,y);if(_<0&&(_=v.length),b<0&&(b=v.length),(y=Math.min(_,b))==v.length)break;if(y==_)++f;else if(!--f){h=g,p=y;break e}++y}if(null!=h&&(s!=h||p!=o))return{from:e.Pos(s,o),to:e.Pos(h,p)}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/selection/active-line",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t=0;t<e.state.activeLines.length;t++)e.removeLineClass(e.state.activeLines[t],"wrap",a),e.removeLineClass(e.state.activeLines[t],"background",o)}function i(e,t){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!=t[i])return!1;return!0}function n(e,n){for(var r=[],s=0;s<n.length;s++){var l=n[s];if(l.empty()){var c=e.getLineHandleVisualStart(l.head.line);r[r.length-1]!=c&&r.push(c)}}i(e.state.activeLines,r)||e.operation(function(){t(e);for(var i=0;i<r.length;i++)e.addLineClass(r[i],"wrap",a),e.addLineClass(r[i],"background",o);e.state.activeLines=r})}function r(e,t){n(e,t.ranges)}var a="CodeMirror-activeline",o="CodeMirror-activeline-background";e.defineOption("styleActiveLine",!1,function(i,a,o){var s=o&&o!=e.Init;a&&!s?(i.state.activeLines=[],n(i,i.listSelections()),i.on("beforeSelectionChange",r)):!a&&s&&(i.off("beforeSelectionChange",r),t(i),delete i.state.activeLines)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/edit/closebrackets",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){var i=e.getRange(o(t.line,t.ch-1),o(t.line,t.ch+1));return 2==i.length?i:null}function i(t,i,n){var r=t.getLine(i.line),a=t.getTokenAt(i);if(/\bstring2?\b/.test(a.type))return!1;var o=new e.StringStream(r.slice(0,i.ch)+n+r.slice(i.ch),4);for(o.pos=o.start=a.start;;){var s=t.getMode().token(o,a.state);if(o.pos>=i.ch+1)return/\bstring2?\b/.test(s);o.start=o.pos}}function n(n,r){for(var s={name:"autoCloseBrackets",Backspace:function(i){if(i.getOption("disableInput"))return e.Pass;for(var r=i.listSelections(),a=0;a<r.length;a++){if(!r[a].empty())return e.Pass;var s=t(i,r[a].head);if(!s||n.indexOf(s)%2!=0)return e.Pass}for(var a=r.length-1;a>=0;a--){var l=r[a].head;i.replaceRange("",o(l.line,l.ch-1),o(l.line,l.ch+1))}}},l="",c=0;c<n.length;c+=2)!function(t,n){l+=n,s["'"+t+"'"]=function(s){if(s.getOption("disableInput"))return e.Pass;for(var c,u,d=s.listSelections(),h=0;h<d.length;h++){var p,f=d[h],m=f.head,u=s.getRange(m,o(m.line,m.ch+1));if(f.empty())if(t==n&&u==n)p=s.getRange(m,o(m.line,m.ch+3))==t+t+t?"skipThree":"skip";else if(t==n&&m.ch>1&&r.indexOf(t)>=0&&s.getRange(o(m.line,m.ch-2),m)==t+t&&(m.ch<=2||s.getRange(o(m.line,m.ch-3),o(m.line,m.ch-2))!=t))p="addFour";else if('"'==t||"'"==t){if(e.isWordChar(u)||!i(s,m,t))return e.Pass;p="both"}else{if(!(s.getLine(m.line).length==m.ch||l.indexOf(u)>=0||a.test(u)))return e.Pass;p="both"}else p="surround";if(c){if(c!=p)return e.Pass}else c=p}s.operation(function(){if("skip"==c)s.execCommand("goCharRight");else if("skipThree"==c)for(var e=0;e<3;e++)s.execCommand("goCharRight");else if("surround"==c){for(var i=s.getSelections(),e=0;e<i.length;e++)i[e]=t+i[e]+n;s.replaceSelections(i,"around")}else"both"==c?(s.replaceSelection(t+n,null),s.execCommand("goCharLeft")):"addFour"==c&&(s.replaceSelection(t+t+t+t,"before"),s.execCommand("goCharRight"))})},t!=n&&(s["'"+n+"'"]=function(t){for(var i=t.listSelections(),r=0;r<i.length;r++){var a=i[r];if(!a.empty()||t.getRange(a.head,o(a.head.line,a.head.ch+1))!=n)return e.Pass}t.execCommand("goCharRight")})}(n.charAt(c),n.charAt(c+1));return s}function r(i){return function(n){if(n.getOption("disableInput"))return e.Pass;for(var r=n.listSelections(),a=0;a<r.length;a++){if(!r[a].empty())return e.Pass;var o=t(n,r[a].head);if(!o||i.indexOf(o)%2!=0)return e.Pass}n.operation(function(){n.replaceSelection("\n\n",null),n.execCommand("goCharLeft"),r=n.listSelections();for(var e=0;e<r.length;e++){var t=r[e].head.line;n.indentLine(t,null,!0),n.indentLine(t+1,null,!0)}})}}var a=/\s/,o=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,i,a){if(a!=e.Init&&a&&t.removeKeyMap("autoCloseBrackets"),i){var o="()[]{}''\"\"",s="'\"",l="[]{}";"string"==typeof i?o=i:"object"==typeof i&&(null!=i.pairs&&(o=i.pairs),null!=i.triples&&(s=i.triples),null!=i.explode&&(l=i.explode));var c=n(o,s);l&&(c.Enter=r(l)),t.addKeyMap(c)}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/display/fullscreen",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function i(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var i=e.state.fullScreenRestore;t.style.width=i.width,t.style.height=i.height,window.scrollTo(i.scrollLeft,i.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(n,r,a){a==e.Init&&(a=!1),!a!=!r&&(r?t(n):i(n))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define("public/lib/editormd/lib/codemirror/addon/search/match-highlighter",["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){"object"==typeof e&&(this.minChars=e.minChars,this.style=e.style,this.showToken=e.showToken,this.delay=e.delay,this.wordsOnly=e.wordsOnly),null==this.style&&(this.style=l),null==this.minChars&&(this.minChars=s),null==this.delay&&(this.delay=c),null==this.wordsOnly&&(this.wordsOnly=u),this.overlay=this.timeout=null}function i(e){var t=e.state.matchHighlighter;clearTimeout(t.timeout),t.timeout=setTimeout(function(){n(e)},t.delay)}function n(e){e.operation(function(){var t=e.state.matchHighlighter;if(t.overlay&&(e.removeOverlay(t.overlay),t.overlay=null),!e.somethingSelected()&&t.showToken){for(var i=!0===t.showToken?/[\w$]/:t.showToken,n=e.getCursor(),a=e.getLine(n.line),s=n.ch,l=s;s&&i.test(a.charAt(s-1));)--s;for(;l<a.length&&i.test(a.charAt(l));)++l;return void(s<l&&e.addOverlay(t.overlay=o(a.slice(s,l),i,t.style)))}var c=e.getCursor("from"),u=e.getCursor("to");if(c.line==u.line&&(!t.wordsOnly||r(e,c,u))){var d=e.getRange(c,u).replace(/^\s+|\s+$/g,"");d.length>=t.minChars&&e.addOverlay(t.overlay=o(d,!1,t.style))}})}function r(e,t,i){if(null!==e.getRange(t,i).match(/^\w+$/)){if(t.ch>0){var n={line:t.line,ch:t.ch-1},r=e.getRange(n,t);if(null===r.match(/\W/))return!1}if(i.ch<e.getLine(t.line).length){var n={line:i.line,ch:i.ch+1},r=e.getRange(i,n);if(null===r.match(/\W/))return!1}return!0}return!1}function a(e,t){return!(e.start&&t.test(e.string.charAt(e.start-1))||e.pos!=e.string.length&&t.test(e.string.charAt(e.pos)))}function o(e,t,i){return{token:function(n){if(n.match(e)&&(!t||a(n,t)))return i;n.next(),n.skipTo(e.charAt(0))||n.skipToEnd()}}}var s=2,l="matchhighlight",c=100,u=!1;e.defineOption("highlightSelectionMatches",!1,function(r,a,o){if(o&&o!=e.Init){var s=r.state.matchHighlighter.overlay;s&&r.removeOverlay(s),clearTimeout(r.state.matchHighlighter.timeout),r.state.matchHighlighter=null,r.off("cursorActivity",i)}a&&(r.state.matchHighlighter=new t(a),n(r),r.on("cursorActivity",i))})}),define("editormd",["jquery","marked","prettify","katex","raphael","underscore","flowchart","public/lib/editormd/lib/codemirror/lib/codemirror","jqueryflowchart","sequenceDiagram","public/lib/editormd/lib/codemirror/mode/css/css","public/lib/editormd/lib/codemirror/mode/sass/sass","public/lib/editormd/lib/codemirror/mode/shell/shell","public/lib/editormd/lib/codemirror/mode/sql/sql","public/lib/editormd/lib/codemirror/mode/clike/clike","public/lib/editormd/lib/codemirror/mode/php/php","public/lib/editormd/lib/codemirror/mode/xml/xml","public/lib/editormd/lib/codemirror/mode/markdown/markdown","public/lib/editormd/lib/codemirror/mode/javascript/javascript","public/lib/editormd/lib/codemirror/mode/htmlmixed/htmlmixed","public/lib/editormd/lib/codemirror/mode/gfm/gfm","public/lib/editormd/lib/codemirror/mode/http/http","public/lib/editormd/lib/codemirror/mode/go/go","public/lib/editormd/lib/codemirror/mode/dart/dart","public/lib/editormd/lib/codemirror/mode/coffeescript/coffeescript","public/lib/editormd/lib/codemirror/mode/nginx/nginx","public/lib/editormd/lib/codemirror/mode/python/python","public/lib/editormd/lib/codemirror/mode/perl/perl","public/lib/editormd/lib/codemirror/mode/lua/lua","public/lib/editormd/lib/codemirror/mode/r/r","public/lib/editormd/lib/codemirror/mode/ruby/ruby","public/lib/editormd/lib/codemirror/mode/rst/rst","public/lib/editormd/lib/codemirror/mode/smartymixed/smartymixed","public/lib/editormd/lib/codemirror/mode/vb/vb","public/lib/editormd/lib/codemirror/mode/vbscript/vbscript","public/lib/editormd/lib/codemirror/mode/velocity/velocity","public/lib/editormd/lib/codemirror/mode/xquery/xquery","public/lib/editormd/lib/codemirror/mode/yaml/yaml","public/lib/editormd/lib/codemirror/mode/erlang/erlang","public/lib/editormd/lib/codemirror/mode/jade/jade","public/lib/editormd/lib/codemirror/addon/edit/trailingspace","public/lib/editormd/lib/codemirror/addon/dialog/dialog","public/lib/editormd/lib/codemirror/addon/search/searchcursor","public/lib/editormd/lib/codemirror/addon/search/search","public/lib/editormd/lib/codemirror/addon/scroll/annotatescrollbar","public/lib/editormd/lib/codemirror/addon/search/matchesonscrollbar","public/lib/editormd/lib/codemirror/addon/display/placeholder","public/lib/editormd/lib/codemirror/addon/edit/closetag","public/lib/editormd/lib/codemirror/addon/fold/foldcode","public/lib/editormd/lib/codemirror/addon/fold/foldgutter","public/lib/editormd/lib/codemirror/addon/fold/indent-fold","public/lib/editormd/lib/codemirror/addon/fold/brace-fold","public/lib/editormd/lib/codemirror/addon/fold/xml-fold","public/lib/editormd/lib/codemirror/addon/fold/markdown-fold","public/lib/editormd/lib/codemirror/addon/fold/comment-fold","public/lib/editormd/lib/codemirror/addon/mode/overlay","public/lib/editormd/lib/codemirror/addon/selection/active-line","public/lib/editormd/lib/codemirror/addon/edit/closebrackets","public/lib/editormd/lib/codemirror/addon/display/fullscreen","public/lib/editormd/lib/codemirror/addon/search/match-highlighter"],function(e,t,i,n,r,a,o,s,l,c,u,d,h,p,f,m,g,v,y,_,b,w,x,k,C,T,S,E,A,I,D,M,L,O,N,P,R,j,z,F,B,U,$,q,H,W,V,G,Y,K,X,Q,Z,J,ee,te,ie,ne,re,ae){return function(){var i=function(e,t){return new i.fn.init(e,t)};i.title=i.$name="Editor.md",i.version="1.5.0",i.homePage="https://pandao.github.io/editor.md/",i.classPrefix="editormd-",i.toolbarModes={full:["undo","redo","|","bold","del","italic","quote","ucwords","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","reference-link","image","code","preformatted-text","code-block","table","datetime","emoji","html-entities","pagebreak","|","goto-line","watch","preview","fullscreen","clear","search","|","help","info"],simple:["undo","redo","|","bold","del","italic","quote","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","watch","preview","fullscreen","|","help","info"],mini:["undo","redo","|","watch","preview","|","help","info"]},i.defaults={mode:"gfm",name:"",value:"",theme:"",editorTheme:"default",previewTheme:"",markdown:"",appendMarkdown:"",width:"100%",height:"100%",path:"/static/public/lib/editormd/lib/",pluginPath:"",delay:300,autoLoadModules:!0,watch:!0,placeholder:"Enjoy Markdown! coding now...",gotoLine:!0,codeFold:!1,autoHeight:!1,autoFocus:!0,autoCloseTags:!0,searchReplace:!0,syncScrolling:!0,readOnly:!1,tabSize:4,indentUnit:4,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,showTrailingSpace:!0,matchBrackets:!0,indentWithTabs:!0,styleSelectedText:!0,matchWordHighlight:!0,styleActiveLine:!0,dialogLockScreen:!0,dialogShowMask:!0,dialogDraggable:!0,dialogMaskBgColor:"#fff",dialogMaskOpacity:.1,fontSize:"13px",saveHTMLToTextarea:!1,disabledKeyMaps:[],onload:function(){},onresize:function(){},onchange:function(){},onwatch:null,onunwatch:null,onpreviewing:function(){},onpreviewed:function(){},onfullscreen:function(){},onfullscreenExit:function(){},onscroll:function(){},onpreviewscroll:function(){},imageUpload:!1,imageFormats:["jpg","jpeg","gif","png","bmp","webp"],imageUploadURL:"",crossDomainUpload:!1,uploadCallbackURL:"",toc:!0,tocm:!1,tocTitle:"",tocDropdown:!1,tocContainer:"",tocStartLevel:1,htmlDecode:!1,pageBreak:!0,atLink:!0,emailLink:!0,taskList:!1,emoji:!1,tex:!1,flowChart:!1,sequenceDiagram:!1,previewCodeHighlight:!0,toolbar:!0,toolbarAutoFixed:!0,toolbarIcons:"full",toolbarTitles:{},toolbarHandlers:{ucwords:function(){return i.toolbarHandlers.ucwords},lowercase:function(){return i.toolbarHandlers.lowercase}},toolbarCustomIcons:{lowercase:'<a href="javascript:;" title="Lowercase" unselectable="on"><i class="fa" name="lowercase" style="font-size:24px;margin-top: -10px;">a</i></a>',ucwords:'<a href="javascript:;" title="ucwords" unselectable="on"><i class="fa" name="ucwords" style="font-size:20px;margin-top: -3px;">Aa</i></a>'},toolbarIconsClass:{undo:"fa-undo",redo:"fa-repeat",bold:"fa-bold",del:"fa-strikethrough",italic:"fa-italic",quote:"fa-quote-left",uppercase:"fa-font",h1:i.classPrefix+"bold",h2:i.classPrefix+"bold",h3:i.classPrefix+"bold",h4:i.classPrefix+"bold",h5:i.classPrefix+"bold",h6:i.classPrefix+"bold","list-ul":"fa-list-ul","list-ol":"fa-list-ol",hr:"fa-minus",link:"fa-link","reference-link":"fa-anchor",image:"fa-picture-o",code:"fa-code","preformatted-text":"fa-file-code-o","code-block":"fa-file-code-o",table:"fa-table",datetime:"fa-clock-o",emoji:"fa-smile-o","html-entities":"fa-copyright",pagebreak:"fa-newspaper-o","goto-line":"fa-terminal",watch:"fa-eye-slash",unwatch:"fa-eye",preview:"fa-desktop",search:"fa-search",fullscreen:"fa-arrows-alt",clear:"fa-eraser",help:"fa-question-circle",info:"fa-info-circle"},toolbarIconTexts:{},lang:{name:"zh-cn",description:"开源在线Markdown编辑器<br/>Open source online Markdown editor.",tocTitle:"目录",toolbar:{undo:"撤销(Ctrl+Z)",redo:"重做(Ctrl+Y)",bold:"粗体",del:"删除线",italic:"斜体",quote:"引用",ucwords:"将每个单词首字母转成大写",uppercase:"将所选转换成大写",lowercase:"将所选转换成小写",h1:"标题1",h2:"标题2",h3:"标题3",h4:"标题4",h5:"标题5",h6:"标题6","list-ul":"无序列表","list-ol":"有序列表",hr:"横线",link:"链接","reference-link":"引用链接",image:"添加图片",code:"行内代码","preformatted-text":"预格式文本 / 代码块(缩进风格)","code-block":"代码块(多语言风格)",table:"添加表格",datetime:"日期时间",emoji:"Emoji表情","html-entities":"HTML实体字符",pagebreak:"插入分页符","goto-line":"跳转到行",watch:"关闭实时预览",unwatch:"开启实时预览",preview:"全窗口预览HTML(按 Shift + ESC还原)",fullscreen:"全屏(按ESC还原)",clear:"清空",search:"搜索",help:"使用帮助",info:"关于"+i.title},buttons:{enter:"确定",cancel:"取消",close:"关闭"},dialog:{link:{title:"添加链接",url:"链接地址",urlTitle:"链接标题",urlEmpty:"错误:请填写链接地址。"},referenceLink:{title:"添加引用链接",name:"引用名称",url:"链接地址",urlId:"链接ID",urlTitle:"链接标题",nameEmpty:"错误:引用链接的名称不能为空。",idEmpty:"错误:请填写引用链接的ID。",urlEmpty:"错误:请填写引用链接的URL地址。"},image:{title:"添加图片",url:"图片地址",link:"图片链接",alt:"图片描述",uploadButton:"本地上传",imageURLEmpty:"错误:图片地址不能为空。",uploadFileEmpty:"错误:上传的图片不能为空。",formatNotAllowed:"错误:只允许上传图片文件,允许上传的图片文件格式有:"},preformattedText:{title:"添加预格式文本或代码块",emptyAlert:"错误:请填写预格式文本或代码的内容。"},codeBlock:{title:"添加代码块",selectLabel:"代码语言:",selectDefaultText:"请选择代码语言",otherLanguage:"其他语言",unselectedLanguageAlert:"错误:请选择代码所属的语言类型。",codeEmptyAlert:"错误:请填写代码内容。"},htmlEntities:{title:"HTML 实体字符"},help:{title:"使用帮助"}}}},i.classNames={tex:i.classPrefix+"tex"},i.dialogZindex=99999,i.$katex=null,i.$marked=null,i.$CodeMirror=null,i.$prettyPrint=null;var r,a;i.prototype=i.fn={state:{watching:!1,loaded:!1,preview:!1,fullscreen:!1},init:function(r,a){a=a||{},"object"==typeof r&&(a=r);var o=this.classPrefix=i.classPrefix,l=this.settings=e.extend(!0,i.defaults,a);r="object"==typeof r?l.id:r;var c=this.editor=e("#"+r);this.id=r,this.lang=l.lang;var u=this.classNames={textarea:{html:o+"html-textarea",markdown:o+"markdown-textarea"}};l.pluginPath=""===l.pluginPath?l.path+"../plugins/":l.pluginPath,this.state.watching=!!l.watch,c.hasClass("editormd")||c.addClass("editormd"),c.css({
|
||
width:"number"==typeof l.width?l.width+"px":l.width,height:"number"==typeof l.height?l.height+"px":l.height}),l.autoHeight&&c.css("height","auto");var d=this.markdownTextarea=c.children("textarea");d.length<1&&(c.append("<textarea></textarea>"),d=this.markdownTextarea=c.children("textarea")),d.addClass(u.textarea.markdown).attr("placeholder",l.placeholder),void 0!==d.attr("name")&&""!==d.attr("name")||d.attr("name",""!==l.name?l.name:r+"-markdown-doc");var h=[l.readOnly?"":'<a href="javascript:;" class="fa fa-close '+o+'preview-close-btn"></a>',l.saveHTMLToTextarea?'<textarea class="'+u.textarea.html+'" name="'+r+'-html-code"></textarea>':"",'<div class="'+o+'preview"><div class="markdown-body '+o+'preview-container"></div></div>','<div class="'+o+'container-mask" style="display:block;"></div>','<div class="'+o+'mask"></div>'].join("\n");return c.append(h).addClass(o+"vertical"),""!==l.theme&&c.addClass(o+"theme-"+l.theme),this.mask=c.children("."+o+"mask"),this.containerMask=c.children("."+o+"container-mask"),""!==l.markdown&&d.val(l.markdown),""!==l.appendMarkdown&&d.val(d.val()+l.appendMarkdown),this.htmlTextarea=c.children("."+u.textarea.html),this.preview=c.children("."+o+"preview"),this.previewContainer=this.preview.children("."+o+"preview-container"),""!==l.previewTheme&&this.preview.addClass(o+"preview-theme-"+l.previewTheme),"function"==typeof define&&define.amd&&(void 0!==n&&(i.$katex=n),l.searchReplace&&!l.readOnly&&(i.loadCSS(l.path+"codemirror/addon/dialog/dialog"),i.loadCSS(l.path+"codemirror/addon/search/matchesonscrollbar"))),"function"==typeof define&&define.amd||!l.autoLoadModules?(void 0!==s&&(i.$CodeMirror=s),void 0!==t&&(i.$marked=t),this.setCodeMirror().setToolbar().loadedDisplay()):this.loadQueues(),this},loadQueues:function(){var e=this,n=this.settings,r=n.path,a=function(){if(i.isIE8)return void e.loadedDisplay();n.flowChart||n.sequenceDiagram?i.loadScript(r+"raphael.min",function(){i.loadScript(r+"underscore.min",function(){!n.flowChart&&n.sequenceDiagram?i.loadScript(r+"sequence-diagram.min",function(){e.loadedDisplay()}):n.flowChart&&!n.sequenceDiagram?i.loadScript(r+"flowchart.min",function(){i.loadScript(r+"jquery.flowchart.min",function(){e.loadedDisplay()})}):n.flowChart&&n.sequenceDiagram&&i.loadScript(r+"flowchart.min",function(){i.loadScript(r+"jquery.flowchart.min",function(){i.loadScript(r+"sequence-diagram.min",function(){e.loadedDisplay()})})})})}):e.loadedDisplay()};return i.loadCSS(r+"codemirror/codemirror.min"),n.searchReplace&&!n.readOnly&&(i.loadCSS(r+"codemirror/addon/dialog/dialog"),i.loadCSS(r+"codemirror/addon/search/matchesonscrollbar")),n.codeFold&&i.loadCSS(r+"codemirror/addon/fold/foldgutter"),i.loadScript(r+"codemirror/codemirror.min",function(){i.$CodeMirror=s,i.loadScript(r+"codemirror/modes.min",function(){i.loadScript(r+"codemirror/addons.min",function(){if(e.setCodeMirror(),"gfm"!==n.mode&&"markdown"!==n.mode)return e.loadedDisplay(),!1;e.setToolbar(),i.loadScript(r+"marked.min",function(){i.$marked=t,n.previewCodeHighlight?i.loadScript(r+"prettify.min",function(){a()}):a()})})})}),this},setTheme:function(e){var t=this.editor,i=this.settings.theme,n=this.classPrefix+"theme-";return t.removeClass(n+i).addClass(n+e),this.settings.theme=e,this},setEditorTheme:function(e){var t=this.settings;return t.editorTheme=e,"default"!==e&&i.loadCSS(t.path+"codemirror/theme/"+t.editorTheme),this.cm.setOption("theme",e),this},setCodeMirrorTheme:function(e){return this.setEditorTheme(e),this},setPreviewTheme:function(e){var t=this.preview,i=this.settings.previewTheme,n=this.classPrefix+"preview-theme-";return t.removeClass(n+i).addClass(n+e),this.settings.previewTheme=e,this},setCodeMirror:function(){var e=this.settings,t=this.editor;"default"!==e.editorTheme&&i.loadCSS(e.path+"codemirror/theme/"+e.editorTheme);var n={mode:e.mode,theme:e.editorTheme,tabSize:e.tabSize,dragDrop:!1,autofocus:e.autoFocus,autoCloseTags:e.autoCloseTags,readOnly:!!e.readOnly&&"nocursor",indentUnit:e.indentUnit,lineNumbers:e.lineNumbers,lineWrapping:e.lineWrapping,extraKeys:{"Ctrl-Q":function(e){e.foldCode(e.getCursor())}},foldGutter:e.codeFold,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:e.matchBrackets,indentWithTabs:e.indentWithTabs,styleActiveLine:e.styleActiveLine,styleSelectedText:e.styleSelectedText,autoCloseBrackets:e.autoCloseBrackets,showTrailingSpace:e.showTrailingSpace,highlightSelectionMatches:!!e.matchWordHighlight&&{showToken:"onselected"!==e.matchWordHighlight&&/\w/}};return this.codeEditor=this.cm=i.$CodeMirror.fromTextArea(this.markdownTextarea[0],n),this.codeMirror=this.cmElement=t.children(".CodeMirror"),""!==e.value&&this.cm.setValue(e.value),this.codeMirror.css({fontSize:e.fontSize,width:e.watch?"50%":"100%"}),e.autoHeight&&(this.codeMirror.css("height","auto"),this.cm.setOption("viewportMargin",1/0)),e.lineNumbers||this.codeMirror.find(".CodeMirror-gutters").css("border-right","none"),this},getCodeMirrorOption:function(e){return this.cm.getOption(e)},setCodeMirrorOption:function(e,t){return this.cm.setOption(e,t),this},addKeyMap:function(e,t){return this.cm.addKeyMap(e,t),this},removeKeyMap:function(e){return this.cm.removeKeyMap(e),this},gotoLine:function(t){var i=this.settings;if(!i.gotoLine)return this;var n=this.cm,r=(this.editor,n.lineCount()),a=this.preview;if("string"==typeof t&&("last"===t&&(t=r),"first"===t&&(t=1)),"number"!=typeof t)return alert("Error: The line number must be an integer."),this;if((t=parseInt(t)-1)>r)return alert("Error: The line number range 1-"+r),this;n.setCursor({line:t,ch:0});var o=n.getScrollInfo(),s=o.clientHeight,l=n.charCoords({line:t,ch:0},"local");if(n.scrollTo(null,(l.top+l.bottom-s)/2),i.watch){var c=this.codeMirror.find(".CodeMirror-scroll")[0],u=e(c).height(),d=c.scrollTop,h=d/c.scrollHeight;0===d?a.scrollTop(0):d+u>=c.scrollHeight-16?a.scrollTop(a[0].scrollHeight):a.scrollTop(a[0].scrollHeight*h)}return n.focus(),this},extend:function(){return void 0!==arguments[1]&&("function"==typeof arguments[1]&&(arguments[1]=e.proxy(arguments[1],this)),this[arguments[0]]=arguments[1]),"object"==typeof arguments[0]&&void 0===arguments[0].length&&e.extend(!0,this,arguments[0]),this},set:function(t,i){return void 0!==i&&"function"==typeof i&&(i=e.proxy(i,this)),this[t]=i,this},config:function(t,i){var n=this.settings;return"object"==typeof t&&(n=e.extend(!0,n,t)),"string"==typeof t&&(n[t]=i),this.settings=n,this.recreate(),this},on:function(t,i){var n=this.settings;return void 0!==n["on"+t]&&(n["on"+t]=e.proxy(i,this)),this},off:function(e){var t=this.settings;return void 0!==t["on"+e]&&(t["on"+e]=function(){}),this},showToolbar:function(t){var i=this.settings;return i.readOnly?this:(i.toolbar&&(this.toolbar.length<1||""===this.toolbar.find("."+this.classPrefix+"menu").html())&&this.setToolbar(),i.toolbar=!0,this.toolbar.show(),this.resize(),e.proxy(t||function(){},this)(),this)},hideToolbar:function(t){return this.settings.toolbar=!1,this.toolbar.hide(),this.resize(),e.proxy(t||function(){},this)(),this},setToolbarAutoFixed:function(t){var i=this.state,n=this.editor,r=this.toolbar,a=this.settings;void 0!==t&&(a.toolbarAutoFixed=t);var o=function(){var t=e(window),i=t.scrollTop();if(!a.toolbarAutoFixed)return!1;i-n.offset().top>10&&i<n.height()?r.css({position:"fixed",width:n.width()+"px",left:(t.width()-n.width())/2+"px"}):r.css({position:"absolute",width:"100%",left:0})};return!i.fullscreen&&!i.preview&&a.toolbar&&a.toolbarAutoFixed&&e(window).bind("scroll",o),this},setToolbar:function(){var e=this.settings;if(e.readOnly)return this;var t=this.editor,n=(this.preview,this.classPrefix),r=this.toolbar=t.children("."+n+"toolbar");if(e.toolbar&&r.length<1){var a='<div class="'+n+'toolbar"><div class="'+n+'toolbar-container"><ul class="'+n+'menu"></ul></div></div>';t.append(a),r=this.toolbar=t.children("."+n+"toolbar")}if(!e.toolbar)return r.hide(),this;r.show();for(var o="function"==typeof e.toolbarIcons?e.toolbarIcons():"string"==typeof e.toolbarIcons?i.toolbarModes[e.toolbarIcons]:e.toolbarIcons,s=r.find("."+this.classPrefix+"menu"),l="",c=!1,u=0,d=o.length;u<d;u++){var h=o[u];if("||"===h)c=!0;else if("|"===h)l+='<li class="divider" unselectable="on">|</li>';else{var p=/h(\d)/.test(h),f=h;"watch"!==h||e.watch||(f="unwatch");var m=e.lang.toolbar[f],g=e.toolbarIconTexts[f],v=e.toolbarIconsClass[f];m=void 0===m?"":m,g=void 0===g?"":g,v=void 0===v?"":v;var y=c?'<li class="pull-right">':"<li>";void 0!==e.toolbarCustomIcons[h]&&"function"!=typeof e.toolbarCustomIcons[h]?y+=e.toolbarCustomIcons[h]:(y+='<a href="javascript:;" title="'+m+'" unselectable="on">',y+='<i class="fa '+v+'" name="'+h+'" unselectable="on">'+(p?h.toUpperCase():""===v?g:"")+"</i>",y+="</a>"),y+="</li>",l=c?y+l:l+y}}return s.html(l),s.find('[title="Lowercase"]').attr("title",e.lang.toolbar.lowercase),s.find('[title="ucwords"]').attr("title",e.lang.toolbar.ucwords),this.setToolbarHandler(),this.setToolbarAutoFixed(),this},dialogLockScreen:function(){return e.proxy(i.dialogLockScreen,this)(),this},dialogShowMask:function(t){return e.proxy(i.dialogShowMask,this)(t),this},getToolbarHandles:function(e){var t=this.toolbarHandlers=i.toolbarHandlers;return e&&void 0!==toolbarIconHandlers[e]?t[e]:t},setToolbarHandler:function(){var t=this,n=this.settings;if(!n.toolbar||n.readOnly)return this;var r=this.toolbar,a=this.cm,o=this.classPrefix,s=this.toolbarIcons=r.find("."+o+"menu > li > a"),l=this.getToolbarHandles();return s.bind(i.mouseOrTouch("click","touchend"),function(i){var r=e(this).children(".fa"),o=r.attr("name"),s=a.getCursor(),c=a.getSelection();if(""!==o)return t.activeIcon=r,void 0!==l[o]?e.proxy(l[o],t)(a):void 0!==n.toolbarHandlers[o]&&e.proxy(n.toolbarHandlers[o],t)(a,r,s,c),"link"!==o&&"reference-link"!==o&&"image"!==o&&"code-block"!==o&&"preformatted-text"!==o&&"watch"!==o&&"preview"!==o&&"search"!==o&&"fullscreen"!==o&&"info"!==o&&a.focus(),!1}),this},createDialog:function(t){return e.proxy(i.createDialog,this)(t)},createInfoDialog:function(){var e=this,t=this.editor,n=this.classPrefix,r=['<div class="'+n+"dialog "+n+'dialog-info" style="">','<div class="'+n+'dialog-container">','<h1><i class="editormd-logo editormd-logo-lg editormd-logo-color"></i> '+i.title+"<small>v"+i.version+"</small></h1>","<p>"+this.lang.description+"</p>",'<p style="margin: 10px 0 20px 0;"><a href="'+i.homePage+'" target="_blank">'+i.homePage+' <i class="fa fa-external-link"></i></a></p>','<p style="font-size: 0.85em;">Copyright © 2015 <a href="https://github.com/pandao" target="_blank" class="hover-link">Pandao</a>, The <a href="https://github.com/pandao/editor.md/blob/master/LICENSE" target="_blank" class="hover-link">MIT</a> License.</p>',"</div>",'<a href="javascript:;" class="fa fa-close '+n+'dialog-close"></a>',"</div>"].join("\n");t.append(r);var a=this.infoDialog=t.children("."+n+"dialog-info");return a.find("."+n+"dialog-close").bind(i.mouseOrTouch("click","touchend"),function(){e.hideInfoDialog()}),a.css("border",i.isIE8?"1px solid #ddd":"").css("z-index",i.dialogZindex).show(),this.infoDialogPosition(),this},infoDialogPosition:function(){var t=this.infoDialog,i=function(){t.css({top:(e(window).height()-t.height())/2+"px",left:(e(window).width()-t.width())/2+"px"})};return i(),e(window).resize(i),this},showInfoDialog:function(){e("html,body").css("overflow-x","hidden");var t=this.editor,n=this.settings,r=this.infoDialog=t.children("."+this.classPrefix+"dialog-info");return r.length<1&&this.createInfoDialog(),this.lockScreen(!0),this.mask.css({opacity:n.dialogMaskOpacity,backgroundColor:n.dialogMaskBgColor}).show(),r.css("z-index",i.dialogZindex).show(),this.infoDialogPosition(),this},hideInfoDialog:function(){return e("html,body").css("overflow-x",""),this.infoDialog.hide(),this.mask.hide(),this.lockScreen(!1),this},lockScreen:function(e){return i.lockScreen(e),this.resize(),this},recreate:function(){var e=this.editor,t=this.settings;return this.codeMirror.remove(),this.setCodeMirror(),t.readOnly||(e.find(".editormd-dialog").length>0&&e.find(".editormd-dialog").remove(),t.toolbar&&(this.getToolbarHandles(),this.setToolbar())),this.loadedDisplay(!0),this},previewCodeHighlight:function(){var e=this.settings,t=this.previewContainer;return e.previewCodeHighlight&&(t.find("pre").addClass("prettyprint linenums"),void 0!==prettyPrint&&prettyPrint()),this},katexRender:function(){return null===r?this:(this.previewContainer.find("."+i.classNames.tex).each(function(){var t=e(this);i.$katex.render(t.text(),t[0]),t.find(".katex").css("font-size","1.6em")}),this)},flowChartAndSequenceDiagramRender:function(){var t=this,n=this.settings,r=this.previewContainer;if(i.isIE8)return this;if(n.flowChart){if(null===a)return this;r.find(".flowchart").flowChart()}n.sequenceDiagram&&r.find(".sequence-diagram").sequenceDiagram({theme:"simple"});var o=t.preview,s=t.codeMirror,l=s.find(".CodeMirror-scroll"),c=l.height(),u=l.scrollTop(),d=u/l[0].scrollHeight,h=0;o.find(".markdown-toc-list").each(function(){h+=e(this).height()});var p=o.find(".editormd-toc-menu").height();return p=p||0,0===u?o.scrollTop(0):u+c>=l[0].scrollHeight-16?o.scrollTop(o[0].scrollHeight):o.scrollTop((o[0].scrollHeight+h+p)*d),this},registerKeyMaps:function(t){var n=this,r=this.cm,a=this.settings,o=i.toolbarHandlers,s=a.disabledKeyMaps;if(t=t||null){for(var l in t)if(e.inArray(l,s)<0){var c={};c[l]=t[l],r.addKeyMap(t)}}else{for(var u in i.keyMaps){var d=i.keyMaps[u],h="string"==typeof d?e.proxy(o[d],n):e.proxy(d,n);if(e.inArray(u,["F9","F10","F11"])<0&&e.inArray(u,s)<0){var p={};p[u]=h,r.addKeyMap(p)}}e(window).keydown(function(t){var i={120:"F9",121:"F10",122:"F11"};if(e.inArray(i[t.keyCode],s)<0)switch(t.keyCode){case 120:return e.proxy(o.watch,n)(),!1;case 121:return e.proxy(o.preview,n)(),!1;case 122:return e.proxy(o.fullscreen,n)(),!1}})}return this},bindScrollEvent:function(){var t=this,n=this.preview,r=this.settings,a=this.codeMirror,o=i.mouseOrTouch;if(!r.syncScrolling)return this;var s=function(){a.find(".CodeMirror-scroll").bind(o("scroll","touchmove"),function(i){var a=e(this).height(),o=e(this).scrollTop(),s=o/e(this)[0].scrollHeight,l=0;n.find(".markdown-toc-list").each(function(){l+=e(this).height()});var c=n.find(".editormd-toc-menu").height();c=c||0,0===o?n.scrollTop(0):o+a>=e(this)[0].scrollHeight-16?n.scrollTop(n[0].scrollHeight):n.scrollTop((n[0].scrollHeight+l+c)*s),e.proxy(r.onscroll,t)(i)})},l=function(){a.find(".CodeMirror-scroll").unbind(o("scroll","touchmove"))},c=function(){n.bind(o("scroll","touchmove"),function(i){var n=e(this).height(),o=e(this).scrollTop(),s=o/e(this)[0].scrollHeight,l=a.find(".CodeMirror-scroll");0===o?l.scrollTop(0):o+n>=e(this)[0].scrollHeight?l.scrollTop(l[0].scrollHeight):l.scrollTop(l[0].scrollHeight*s),e.proxy(r.onpreviewscroll,t)(i)})},u=function(){n.unbind(o("scroll","touchmove"))};return a.bind({mouseover:s,mouseout:l,touchstart:s,touchend:l}),"single"===r.syncScrolling?this:(n.bind({mouseover:c,mouseout:u,touchstart:c,touchend:u}),this)},bindChangeEvent:function(){var e=this,t=this.cm,i=this.settings;return i.syncScrolling?(t.on("change",function(t,n){i.watch&&e.previewContainer.css("padding",i.autoHeight?"20px 20px 50px 40px":"20px"),r=setTimeout(function(){clearTimeout(r),e.save(),r=null},i.delay)}),this):this},loadedDisplay:function(t){t=t||!1;var i=this,n=this.editor,r=this.preview,a=this.settings;return this.containerMask.hide(),this.save(),a.watch&&r.show(),n.data("oldWidth",n.width()).data("oldHeight",n.height()),this.resize(),this.registerKeyMaps(),e(window).resize(function(){i.resize()}),this.bindScrollEvent().bindChangeEvent(),t||e.proxy(a.onload,this)(),this.state.loaded=!0,this},width:function(e){return this.editor.css("width","number"==typeof e?e+"px":e),this.resize(),this},height:function(e){return this.editor.css("height","number"==typeof e?e+"px":e),this.resize(),this},resize:function(t,i){t=t||null,i=i||null;var n=this.state,r=this.editor,a=this.preview,o=this.toolbar,s=this.settings,l=this.codeMirror;if(t&&r.css("width","number"==typeof t?t+"px":t),!s.autoHeight||n.fullscreen||n.preview?(i&&r.css("height","number"==typeof i?i+"px":i),n.fullscreen&&r.height(e(window).height()),s.toolbar&&!s.readOnly?l.css("margin-top",o.height()+1).height(r.height()-o.height()):l.css("margin-top",0).height(r.height())):(r.css("height","auto"),l.css("height","auto")),s.watch)if(l.width(r.width()/2),a.width(n.preview?r.width():r.width()/2),this.previewContainer.css("padding",s.autoHeight?"20px 20px 50px 40px":"20px"),s.toolbar&&!s.readOnly?a.css("top",o.height()+1):a.css("top",0),!s.autoHeight||n.fullscreen||n.preview){var c=s.toolbar&&!s.readOnly?r.height()-o.height():r.height();a.height(c)}else a.height("");else l.width(r.width()),a.hide();return n.loaded&&e.proxy(s.onresize,this)(),this},save:function(){if(null===r)return this;var t=this,o=this.state,s=this.settings,l=this.cm,c=l.getValue(),u=this.previewContainer;if("gfm"!==s.mode&&"markdown"!==s.mode)return this.markdownTextarea.val(c),this;var d=i.$marked,h=this.markdownToC=[],p=this.markedRendererOptions={toc:s.toc,tocm:s.tocm,tocStartLevel:s.tocStartLevel,pageBreak:s.pageBreak,taskList:s.taskList,emoji:s.emoji,tex:s.tex,atLink:s.atLink,emailLink:s.emailLink,flowChart:s.flowChart,sequenceDiagram:s.sequenceDiagram,previewCodeHighlight:s.previewCodeHighlight},f=this.markedOptions={renderer:i.markedRenderer(h,p),gfm:!0,tables:!0,breaks:!0,pedantic:!1,sanitize:!s.htmlDecode,smartLists:!0,smartypants:!0,image_Remote_URL:s.image_Remote_URL};d.setOptions(f);var m=i.$marked(c,f);if(m=i.filterHTMLTags(m,s.htmlDecode),this.markdownTextarea.text(c),l.save(),s.saveHTMLToTextarea&&this.htmlTextarea.text(m),s.watch||!s.watch&&o.preview){if(u.html(m),this.previewCodeHighlight(),s.toc){var g=""===s.tocContainer?u:e(s.tocContainer),v=g.find("."+this.classPrefix+"toc-menu");g.attr("previewContainer",""===s.tocContainer?"true":"false"),""!==s.tocContainer&&v.length>0&&v.remove(),i.markdownToCRenderer(h,g,s.tocDropdown,s.tocStartLevel),(s.tocDropdown||g.find("."+this.classPrefix+"toc-menu").length>0)&&i.tocDropdownMenu(g,""!==s.tocTitle?s.tocTitle:this.lang.tocTitle),""!==s.tocContainer&&u.find(".markdown-toc").css("border","none")}s.tex&&(!i.kaTeXLoaded&&s.autoLoadModules?i.loadKaTeX(function(){i.$katex=n,i.kaTeXLoaded=!0,t.katexRender()}):(i.$katex=n,this.katexRender())),(s.flowChart||s.sequenceDiagram)&&(a=setTimeout(function(){clearTimeout(a),t.flowChartAndSequenceDiagramRender(),a=null},10)),o.loaded&&e.proxy(s.onchange,this)()}return this},focus:function(){return this.cm.focus(),this},setCursor:function(e){return this.cm.setCursor(e),this},getCursor:function(){return this.cm.getCursor()},setSelection:function(e,t){return this.cm.setSelection(e,t),this},getSelection:function(){return this.cm.getSelection()},setSelections:function(e){return this.cm.setSelections(e),this},getSelections:function(){return this.cm.getSelections()},replaceSelection:function(e){return this.cm.replaceSelection(e),this},insertValue:function(e){return this.replaceSelection(e),this},appendMarkdown:function(e){var t=(this.settings,this.cm);return t.setValue(t.getValue()+e),this},setMarkdown:function(e){return this.cm.setValue(e||this.settings.markdown),this},getMarkdown:function(){return this.cm.getValue()},getValue:function(){return this.cm.getValue()},setValue:function(e){return this.cm.setValue(e),this},clear:function(){return this.cm.setValue(""),this},getHTML:function(){return this.settings.saveHTMLToTextarea?this.htmlTextarea.val():(alert("Error: settings.saveHTMLToTextarea == false"),!1)},getTextareaSavedHTML:function(){return this.getHTML()},getPreviewedHTML:function(){return this.settings.watch?this.previewContainer.html():(alert("Error: settings.watch == false"),!1)},watch:function(t){var i=this.settings;if(e.inArray(i.mode,["gfm","markdown"])<0)return this;if(this.state.watching=i.watch=!0,this.preview.show(),this.toolbar){var n=i.toolbarIconsClass.watch,a=i.toolbarIconsClass.unwatch,o=this.toolbar.find(".fa[name=watch]");o.parent().attr("title",i.lang.toolbar.watch),o.removeClass(a).addClass(n)}return this.codeMirror.css("border-right","1px solid #ddd").width(this.editor.width()/2),r=0,this.save().resize(),i.onwatch||(i.onwatch=t||function(){}),e.proxy(i.onwatch,this)(),this},unwatch:function(t){var i=this.settings;if(this.state.watching=i.watch=!1,this.preview.hide(),this.toolbar){var n=i.toolbarIconsClass.watch,r=i.toolbarIconsClass.unwatch,a=this.toolbar.find(".fa[name=watch]");a.parent().attr("title",i.lang.toolbar.unwatch),a.removeClass(n).addClass(r)}return this.codeMirror.css("border-right","none").width(this.editor.width()),this.resize(),i.onunwatch||(i.onunwatch=t||function(){}),e.proxy(i.onunwatch,this)(),this},show:function(t){t=t||function(){};var i=this;return this.editor.show(0,function(){e.proxy(t,i)()}),this},hide:function(t){t=t||function(){};var i=this;return this.editor.hide(0,function(){e.proxy(t,i)()}),this},previewing:function(){var t=this,n=this.editor,r=this.preview,a=this.toolbar,o=this.settings,s=this.codeMirror,l=this.previewContainer;if(e.inArray(o.mode,["gfm","markdown"])<0)return this;o.toolbar&&a&&(a.toggle(),a.find(".fa[name=preview]").toggleClass("active")),s.toggle();var c=function(e){e.shiftKey&&27===e.keyCode&&t.previewed()};"none"===s.css("display")?(this.state.preview=!0,this.state.fullscreen&&r.css("background","#fff"),n.find("."+this.classPrefix+"preview-close-btn").show().bind(i.mouseOrTouch("click","touchend"),function(){t.previewed()}),o.watch?l.css("padding",""):this.save(),l.addClass(this.classPrefix+"preview-active"),r.show().css({position:"",top:0,width:n.width(),height:o.autoHeight&&!this.state.fullscreen?"auto":n.height()}),this.state.loaded&&e.proxy(o.onpreviewing,this)(),e(window).bind("keyup",c)):(e(window).unbind("keyup",c),this.previewed())},previewed:function(){var t=this.editor,n=this.preview,r=this.toolbar,a=this.settings,o=this.previewContainer,s=t.find("."+this.classPrefix+"preview-close-btn");return this.state.preview=!1,this.codeMirror.show(),a.toolbar&&r.show(),n[a.watch?"show":"hide"](),s.hide().unbind(i.mouseOrTouch("click","touchend")),o.removeClass(this.classPrefix+"preview-active"),a.watch&&o.css("padding","20px"),n.css({background:null,position:"absolute",width:t.width()/2,height:a.autoHeight&&!this.state.fullscreen?"auto":t.height()-r.height(),top:a.toolbar?r.height():0}),this.state.loaded&&e.proxy(a.onpreviewed,this)(),this},fullscreen:function(){var t=this,i=this.state,n=this.editor,r=(this.preview,this.toolbar),a=this.settings,o=this.classPrefix+"fullscreen";r&&r.find(".fa[name=fullscreen]").parent().toggleClass("active");var s=function(e){e.shiftKey||27!==e.keyCode||i.fullscreen&&t.fullscreenExit()};return n.hasClass(o)?(e(window).unbind("keyup",s),this.fullscreenExit()):(i.fullscreen=!0,e("html,body").css("overflow","hidden"),n.css({width:e(window).width(),height:e(window).height()}).addClass(o),this.resize(),e.proxy(a.onfullscreen,this)(),e(window).bind("keyup",s)),this},fullscreenExit:function(){var t=this.editor,i=this.settings,n=this.toolbar,r=this.classPrefix+"fullscreen";return this.state.fullscreen=!1,n&&n.find(".fa[name=fullscreen]").parent().removeClass("active"),e("html,body").css("overflow",""),t.css({width:t.data("oldWidth"),height:t.data("oldHeight")}).removeClass(r),this.resize(),e.proxy(i.onfullscreenExit,this)(),this},executePlugin:function(t,n){var r=this,a=this.cm;return n=this.settings.pluginPath+n,"function"==typeof define?void 0===this[t]?(alert("Error: "+t+" plugin is not found, you are not load this plugin."),this):(this[t](a),this):(e.inArray(n,i.loadFiles.plugin)<0?i.loadPlugin(n,function(){i.loadPlugins[t]=r[t],r[t](a)}):e.proxy(i.loadPlugins[t],this)(a),this)},search:function(e){var t=this.settings;return t.searchReplace?(t.readOnly||this.cm.execCommand(e||"find"),this):(alert("Error: settings.searchReplace == false"),this)},searchReplace:function(){return this.search("replace"),this},searchReplaceAll:function(){return this.search("replaceAll"),this}},i.fn.init.prototype=i.fn,i.dialogLockScreen=function(){(this.settings||{dialogLockScreen:!0}).dialogLockScreen&&(e("html,body").css("overflow","hidden"),this.resize())},i.dialogShowMask=function(t){var i=this.editor,n=this.settings||{dialogShowMask:!0};t.css({top:(e(window).height()-t.height())/2+"px",left:(e(window).width()-t.width())/2+"px"}),n.dialogShowMask&&i.children("."+this.classPrefix+"mask").css("z-index",parseInt(t.css("z-index"))-1).show()},i.toolbarHandlers={undo:function(){this.cm.undo()},redo:function(){this.cm.redo()},bold:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("**"+i+"**"),""===i&&e.setCursor(t.line,t.ch+2)},del:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("~~"+i+"~~"),""===i&&e.setCursor(t.line,t.ch+2)},italic:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("*"+i+"*"),""===i&&e.setCursor(t.line,t.ch+1)},quote:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("> "+i),e.setCursor(t.line,t.ch+2)):e.replaceSelection("> "+i)},ucfirst:function(){var e=this.cm,t=e.getSelection(),n=e.listSelections();e.replaceSelection(i.firstUpperCase(t)),e.setSelections(n)},ucwords:function(){var e=this.cm,t=e.getSelection(),n=e.listSelections();e.replaceSelection(i.wordsFirstUpperCase(t)),e.setSelections(n)},uppercase:function(){var e=this.cm,t=e.getSelection(),i=e.listSelections();e.replaceSelection(t.toUpperCase()),e.setSelections(i)},lowercase:function(){var e=this.cm,t=(e.getCursor(),e.getSelection()),i=e.listSelections();e.replaceSelection(t.toLowerCase()),e.setSelections(i)},h1:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("# "+i),e.setCursor(t.line,t.ch+2)):e.replaceSelection("# "+i)},h2:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("## "+i),e.setCursor(t.line,t.ch+3)):e.replaceSelection("## "+i)},h3:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("### "+i),e.setCursor(t.line,t.ch+4)):e.replaceSelection("### "+i)},h4:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("#### "+i),e.setCursor(t.line,t.ch+5)):e.replaceSelection("#### "+i)},h5:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("##### "+i),e.setCursor(t.line,t.ch+6)):e.replaceSelection("##### "+i)},h6:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();0!==t.ch?(e.setCursor(t.line,0),e.replaceSelection("###### "+i),e.setCursor(t.line,t.ch+7)):e.replaceSelection("###### "+i)},"list-ul":function(){var e=this.cm,t=(e.getCursor(),e.getSelection());if(""===t)e.replaceSelection("- "+t);else{for(var i=t.split("\n"),n=0,r=i.length;n<r;n++)i[n]=""===i[n]?"":"- "+i[n];e.replaceSelection(i.join("\n"))}},"list-ol":function(){var e=this.cm,t=(e.getCursor(),e.getSelection());if(""===t)e.replaceSelection("1. "+t);else{for(var i=t.split("\n"),n=0,r=i.length;n<r;n++)i[n]=""===i[n]?"":n+1+". "+i[n];e.replaceSelection(i.join("\n"))}},hr:function(){var e=this.cm,t=e.getCursor();e.getSelection();e.replaceSelection((0!==t.ch?"\n\n":"\n")+"------------\n\n")},tex:function(){if(!this.settings.tex)return alert("settings.tex === false"),this;var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("$$"+i+"$$"),""===i&&e.setCursor(t.line,t.ch+2)},link:function(){this.executePlugin("linkDialog","link-dialog/link-dialog")},"reference-link":function(){this.executePlugin("referenceLinkDialog","reference-link-dialog/reference-link-dialog")},pagebreak:function(){if(!this.settings.pageBreak)return alert("settings.pageBreak === false"),this;var e=this.cm;e.getSelection();e.replaceSelection("\r\n[========]\r\n")},image:function(){this.executePlugin("imageDialog","image-dialog/image-dialog")},code:function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection("`"+i+"`"),""===i&&e.setCursor(t.line,t.ch+1)},"code-block":function(){this.executePlugin("codeBlockDialog","code-block-dialog/code-block-dialog")},"preformatted-text":function(){this.executePlugin("preformattedTextDialog","preformatted-text-dialog/preformatted-text-dialog")},table:function(){this.executePlugin("tableDialog","table-dialog/table-dialog")},datetime:function(){var e=this.cm,t=(e.getSelection(),new Date,this.settings.lang.name),n=i.dateFormat()+" "+i.dateFormat("zh-cn"===t||"zh-tw"===t?"cn-week-day":"week-day");e.replaceSelection(n)},emoji:function(){this.executePlugin("emojiDialog","emoji-dialog/emoji-dialog")},"html-entities":function(){this.executePlugin("htmlEntitiesDialog","html-entities-dialog/html-entities-dialog")},"goto-line":function(){this.executePlugin("gotoLineDialog","goto-line-dialog/goto-line-dialog")},watch:function(){this[this.settings.watch?"unwatch":"watch"]()},preview:function(){this.previewing()},fullscreen:function(){this.fullscreen()},clear:function(){this.clear()},search:function(){this.search()},help:function(){this.executePlugin("helpDialog","help-dialog/help-dialog")},info:function(){this.showInfoDialog()}},i.keyMaps={"Ctrl-1":"h1","Ctrl-2":"h2","Ctrl-3":"h3","Ctrl-4":"h4","Ctrl-5":"h5","Ctrl-6":"h6","Ctrl-B":"bold","Ctrl-D":"datetime","Ctrl-E":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();if(!this.settings.emoji)return void alert("Error: settings.emoji == false");e.replaceSelection(":"+i+":"),""===i&&e.setCursor(t.line,t.ch+1)},"Ctrl-Alt-G":"goto-line","Ctrl-H":"hr","Ctrl-I":"italic","Ctrl-K":"code","Ctrl-L":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection(),n=""===i?"":' "'+i+'"';e.replaceSelection("["+i+"]("+n+")"),""===i&&e.setCursor(t.line,t.ch+1)},"Ctrl-U":"list-ul","Shift-Ctrl-A":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();if(!this.settings.atLink)return void alert("Error: settings.atLink == false");e.replaceSelection("@"+i),""===i&&e.setCursor(t.line,t.ch+1)},"Shift-Ctrl-C":"code","Shift-Ctrl-Q":"quote","Shift-Ctrl-S":"del","Shift-Ctrl-K":"tex","Shift-Alt-C":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection();e.replaceSelection(["```",i,"```"].join("\n")),""===i&&e.setCursor(t.line,t.ch+3)},"Shift-Ctrl-Alt-C":"code-block","Shift-Ctrl-H":"html-entities","Shift-Alt-H":"help","Shift-Ctrl-E":"emoji","Shift-Ctrl-U":"uppercase","Shift-Alt-U":"ucwords","Shift-Ctrl-Alt-U":"ucfirst","Shift-Alt-L":"lowercase","Shift-Ctrl-I":function(){var e=this.cm,t=e.getCursor(),i=e.getSelection(),n=""===i?"":' "'+i+'"';e.replaceSelection(""),""===i&&e.setCursor(t.line,t.ch+4)},"Shift-Ctrl-Alt-I":"image","Shift-Ctrl-L":"link","Shift-Ctrl-O":"list-ol","Shift-Ctrl-P":"preformatted-text","Shift-Ctrl-T":"table","Shift-Alt-P":"pagebreak",F9:"watch",F10:"preview",F11:"fullscreen"};var o=function(e){return String.prototype.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};i.trim=o;var l=function(e){return e.toLowerCase().replace(/\b(\w)|\s(\w)/g,function(e){return e.toUpperCase()})};i.ucwords=i.wordsFirstUpperCase=l;var c=function(e){return e.toLowerCase().replace(/\b(\w)/,function(e){return e.toUpperCase()})};return i.firstUpperCase=i.ucfirst=c,i.urls={atLinkBase:"https://github.com/"},i.regexs={atLink:/@(\w+)/g,email:/(\w+)@(\w+)\.(\w+)\.?(\w+)?/g,emailLink:/(mailto:)?([\w\.\_]+)@(\w+)\.(\w+)\.?(\w+)?/g,emoji:/:([\w\+-]+):/g,emojiDatetime:/(\d{2}:\d{2}:\d{2})/g,twemoji:/:(tw-([\w]+)-?(\w+)?):/g,fontAwesome:/:(fa-([\w]+)(-(\w+)){0,}):/g,editormdLogo:/:(editormd-logo-?(\w+)?):/g,pageBreak:/^\[[=]{8,}\]$/},i.emoji={path:"http://www.emoji-cheat-sheet.com/graphics/emojis/",ext:".png"},i.twemoji={path:"http://twemoji.maxcdn.com/36x36/",ext:".png"},i.markedRenderer=function(t,n){var r={toc:!0,tocm:!1,tocStartLevel:1,pageBreak:!0,atLink:!0,emailLink:!0,taskList:!1,emoji:!1,tex:!1,flowChart:!1,sequenceDiagram:!1},a=e.extend(r,n||{}),s=i.$marked,l=new s.Renderer;t=t||[]
|
||
;var c=i.regexs,u=c.atLink,d=c.emoji,h=c.email,p=c.emailLink,f=c.twemoji,m=c.fontAwesome,g=c.editormdLogo,v=c.pageBreak;return l.emoji=function(e){e=e.replace(i.regexs.emojiDatetime,function(e){return e.replace(/:/g,":")});var t=e.match(d);if(!t||!a.emoji)return e;for(var n=0,r=t.length;n<r;n++)":+1:"===t[n]&&(t[n]=":\\+1:"),e=e.replace(new RegExp(t[n]),function(e,t){var n=e.match(m),r=e.replace(/:/g,"");if(n)for(var a=0,o=n.length;a<o;a++){var s=n[a].replace(/:/g,"");return'<i class="fa '+s+' fa-emoji" title="'+s.replace("fa-","")+'"></i>'}else{var l=e.match(g),c=e.match(f);if(l)for(var u=0,d=l.length;u<d;u++){var h=l[u].replace(/:/g,"");return'<i class="'+h+'" title="Editor.md logo ('+h+')"></i>'}else{if(!c){var p="+1"===r?"plus1":r;return p="black_large_square"===p?"black_square":p,p="moon"===p?"waxing_gibbous_moon":p,'<img src="'+i.emoji.path+p+i.emoji.ext+'" class="emoji" title=":'+r+':" alt=":'+r+':" />'}for(var v=0,y=c.length;v<y;v++){var _=c[v].replace(/:/g,"").replace("tw-","");return'<img src="'+i.twemoji.path+_+i.twemoji.ext+'" title="twemoji-'+_+'" alt="twemoji-'+_+'" class="emoji twemoji" />'}}}});return e},l.atLink=function(t){return u.test(t)?(a.atLink&&(t=t.replace(h,function(e,t,i,n){return e.replace(/@/g,"_#_@_#_")}),t=t.replace(u,function(e,t){return'<a href="'+i.urls.atLinkBase+t+'" title="@'+t+'" class="at-link">'+e+"</a>"}).replace(/_#_@_#_/g,"@")),a.emailLink&&(t=t.replace(p,function(t,i,n,r,a){return!i&&e.inArray(a,"jpg|jpeg|png|gif|webp|ico|icon|pdf".split("|"))<0?'<a href="mailto:'+t+'">'+t+"</a>":t})),t):t},l.link=function(e,t,i){if(this.options.sanitize){try{var n=decodeURIComponent(unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(0===n.indexOf("javascript:"))return""}var r='<a href="'+e+'"';return u.test(t)||u.test(i)?(t&&(r+=' title="'+t.replace(/@/g,"@")),r+'">'+i.replace(/@/g,"@")+"</a>"):(t&&(r+=' title="'+t+'"'),r+=">"+i+"</a>")},l.heading=function(e,i,n){var r=e,a=/\s*\<a\s*href\=\"(.*)\"\s*([^\>]*)\>(.*)\<\/a\>\s*/;if(a.test(e)){var s=[];e=e.split(/\<a\s*([^\>]+)\>([^\>]*)\<\/a\>/);for(var l=0,c=e.length;l<c;l++)s.push(e[l].replace(/\s*href\=\"(.*)\"\s*/g,""));e=s.join(" ")}e=o(e);var u=e.toLowerCase().replace(/[^\w]+/g,"-"),d={text:e,level:i,slug:u},h=/^[\u4e00-\u9fa5]+$/.test(e),p=h?escape(e).replace(/\%/g,""):e.toLowerCase().replace(/[^\w]+/g,"-");t.push(d);var f="<h"+i+' id="h'+i+"-"+this.options.headerPrefix+p+'">';return f+='<a name="'+e+'" class="reference-link"></a>',f+='<span class="header-link octicon octicon-link"></span>',f+=a?this.atLink(this.emoji(r)):this.atLink(this.emoji(e)),f+="</h"+i+">"},l.pageBreak=function(e){return v.test(e)&&a.pageBreak&&(e='<hr style="page-break-after:always;" class="page-break editormd-page-break" />'),e},l.paragraph=function(e){var t=/\$\$(.*)\$\$/g.test(e),n=/^\$\$(.*)\$\$$/.test(e),r=n?' class="'+i.classNames.tex+'"':"",o=a.tocm?/^(\[TOC\]|\[TOCM\])$/.test(e):/^\[TOC\]$/.test(e),s=/^\[TOCM\]$/.test(e);e=!n&&t?e.replace(/(\$\$([^\$]*)\$\$)+/g,function(e,t){return'<span class="'+i.classNames.tex+'">'+t.replace(/\$/g,"")+"</span>"}):n?e.replace(/\$/g,""):e;var l='<div class="markdown-toc editormd-markdown-toc">'+e+"</div>";return o?s?'<div class="editormd-toc-menu">'+l+"</div><br/>":l:v.test(e)?this.pageBreak(e):"<p"+r+">"+this.atLink(this.emoji(e))+"</p>\n"},l.code=function(e,t,n){return"seq"===t||"sequence"===t?'<div class="sequence-diagram">'+e+"</div>":"flow"===t?'<div class="flowchart">'+e+"</div>":"math"===t||"latex"===t||"katex"===t?'<p class="'+i.classNames.tex+'">'+e+"</p>":s.Renderer.prototype.code.apply(this,arguments)},l.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' style="text-align:'+t.align+'">':"<"+i+">")+this.atLink(this.emoji(e))+"</"+i+">\n"},l.listitem=function(e){return a.taskList&&/^\s*\[[x\s]\]\s*/.test(e)?(e=e.replace(/^\s*\[\s\]\s*/,'<input type="checkbox" class="task-list-item-checkbox" /> ').replace(/^\s*\[x\]\s*/,'<input type="checkbox" class="task-list-item-checkbox" checked disabled /> '),'<li style="list-style: none;">'+this.atLink(this.emoji(e))+"</li>"):"<li>"+this.atLink(this.emoji(e))+"</li>"},l},i.markdownToCRenderer=function(e,t,i,n){var r="",a=0,o=this.classPrefix;n=n||1;for(var s=0,l=e.length;s<l;s++){var c=e[s].text,u=e[s].level;u<n||(r+=u>a?"":u<a?new Array(a-u+2).join("</ul></li>"):"</ul></li>",r+='<li><a class="toc-level-'+u+'" href="#'+c+'" level="'+u+'">'+c+"</a><ul>",a=u)}var d=t.find(".markdown-toc");if(d.length<1&&"false"===t.attr("previewContainer")){var h='<div class="markdown-toc '+o+'markdown-toc"></div>';h=i?'<div class="'+o+'toc-menu">'+h+"</div>":h,t.html(h),d=t.find(".markdown-toc")}return i&&d.wrap('<div class="'+o+'toc-menu"></div><br/>'),d.html('<ul class="markdown-toc-list"></ul>').children(".markdown-toc-list").html(r.replace(/\r?\n?\<ul\>\<\/ul\>/g,"")),d},i.tocDropdownMenu=function(t,i){i=i||"Table of Contents";var n=400,r=t.find("."+this.classPrefix+"toc-menu");return r.each(function(){var t=e(this),r=t.children(".markdown-toc"),a='<i class="fa fa-angle-down"></i>',o='<a href="javascript:;" class="toc-menu-btn">'+a+i+"</a>",s=r.children("ul"),l=s.find("li");r.append(o),l.first().before("<li><h1>"+i+" "+a+"</h1></li>"),t.mouseover(function(){s.show(),l.each(function(){var t=e(this),i=t.children("ul");if(""===i.html()&&i.remove(),i.length>0&&""!==i.html()){var r=t.children("a").first();r.children(".fa").length<1&&r.append(e(a).css({float:"right",paddingTop:"4px"}))}t.mouseover(function(){i.css("z-index",n).show(),n+=1}).mouseleave(function(){i.hide()})})}).mouseleave(function(){s.hide()})}),r},i.filterHTMLTags=function(t,i){if("string"!=typeof t&&(t=new String(t)),"string"!=typeof i)return t;for(var n=i.split("|"),r=n[0].split(","),a=n[1],o=0,s=r.length;o<s;o++){var l=r[o];t=t.replace(new RegExp("<s*"+l+"s*([^>]*)>([^>]*)<s*/"+l+"s*>","igm"),"")}if(void 0!==a){var c=/\<(\w+)\s*([^\>]*)\>([^\>]*)\<\/(\w+)\>/gi;t="*"===a?t.replace(c,function(e,t,i,n,r){return"<"+t+">"+n+"</"+r+">"}):"on*"===a?t.replace(c,function(t,i,n,r,a){var o=e("<"+i+">"+r+"</"+a+">"),s=e(t)[0].attributes,l={};e.each(s,function(e,t){'"'!==t.nodeName&&(l[t.nodeName]=t.nodeValue)}),e.each(l,function(e){0===e.indexOf("on")&&delete l[e]}),o.attr(l);var c=void 0!==o[1]?e(o[1]).text():"";return o[0].outerHTML+c}):t.replace(c,function(t,i,n,r){var o=a.split(","),s=e(t);return s.html(r),e.each(o,function(e){s.attr(o[e],null)}),s[0].outerHTML})}return t},i.markdownToHTML=function(r,a){var o={gfm:!0,toc:!0,tocm:!1,tocStartLevel:1,tocTitle:"目录",tocDropdown:!1,tocContainer:"",markdown:"",markdownSourceCode:!1,htmlDecode:!1,autoLoadKaTeX:!0,pageBreak:!0,atLink:!0,emailLink:!0,tex:!1,taskList:!1,emoji:!1,flowChart:!1,sequenceDiagram:!1,previewCodeHighlight:!0};i.$marked=t;var s=e("#"+r),l=s.settings=e.extend(!0,o,a||{}),c=s.find("textarea");c.length<1&&(s.append("<textarea></textarea>"),c=s.find("textarea"));var u=""===l.markdown?c.val():l.markdown,d=[],h={toc:l.toc,tocm:l.tocm,tocStartLevel:l.tocStartLevel,taskList:l.taskList,emoji:l.emoji,tex:l.tex,pageBreak:l.pageBreak,atLink:l.atLink,emailLink:l.emailLink,flowChart:l.flowChart,sequenceDiagram:l.sequenceDiagram,previewCodeHighlight:l.previewCodeHighlight},p={renderer:i.markedRenderer(d,h),gfm:l.gfm,tables:!0,breaks:!0,pedantic:!1,sanitize:!l.htmlDecode,smartLists:!0,smartypants:!0,image_Remote_URL:l.image_Remote_URL};u=new String(u);var f=t(u,p);f=i.filterHTMLTags(f,l.htmlDecode),l.markdownSourceCode?c.text(u):c.remove(),s.addClass("markdown-body "+this.classPrefix+"html-preview").append(f);var m=""!==l.tocContainer?e(l.tocContainer):s;if(""!==l.tocContainer&&m.attr("previewContainer",!1),l.toc&&(s.tocContainer=this.markdownToCRenderer(d,m,l.tocDropdown,l.tocStartLevel),(l.tocDropdown||s.find("."+this.classPrefix+"toc-menu").length>0)&&this.tocDropdownMenu(s,l.tocTitle),""!==l.tocContainer&&s.find(".editormd-toc-menu, .editormd-markdown-toc").remove()),l.previewCodeHighlight&&(s.find("pre").addClass("prettyprint linenums"),prettyPrint()),i.isIE8||(l.flowChart&&s.find(".flowchart").flowChart(),l.sequenceDiagram&&s.find(".sequence-diagram").sequenceDiagram({theme:"simple"})),l.tex){var g=function(){s.find("."+i.classNames.tex).each(function(){var t=e(this);n.render(t.html().replace(/</g,"<").replace(/>/g,">"),t[0]),t.find(".katex").css("font-size","1.6em")})};!l.autoLoadKaTeX||i.$katex||i.kaTeXLoaded?g():this.loadKaTeX(function(){i.$katex=n,i.kaTeXLoaded=!0,g()})}return s.getMarkdown=function(){return c.val()},s},i.themes=["default","dark"],i.previewThemes=["default","dark"],i.editorThemes=["default","3024-day","3024-night","ambiance","ambiance-mobile","base16-dark","base16-light","blackboard","cobalt","eclipse","elegant","erlang-dark","lesser-dark","mbo","mdn-like","midnight","monokai","neat","neo","night","paraiso-dark","paraiso-light","pastel-on-dark","rubyblue","solarized","the-matrix","tomorrow-night-eighties","twilight","vibrant-ink","xq-dark","xq-light"],i.loadPlugins={},i.loadFiles={js:[],css:[],plugin:[]},i.loadPlugin=function(e,t,n){t=t||function(){},this.loadScript(e,function(){i.loadFiles.plugin.push(e),t()},n)},i.loadCSS=function(e,t,n){n=n||"head",t=t||function(){};var r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.onload=r.onreadystatechange=function(){i.loadFiles.css.push(e),t()},r.href=e+".css","head"===n?document.getElementsByTagName("head")[0].appendChild(r):document.body.appendChild(r)},i.isIE="Microsoft Internet Explorer"==navigator.appName,i.isIE8=i.isIE&&"8."==navigator.appVersion.match(/8./i),i.loadScript=function(e,t,n){n=n||"head",t=t||function(){};var r=null;r=document.createElement("script"),r.id=e.replace(/[\./]+/g,"-"),r.type="text/javascript",r.src=e+".js",i.isIE8?r.onreadystatechange=function(){r.readyState&&("loaded"!==r.readyState&&"complete"!==r.readyState||(r.onreadystatechange=null,i.loadFiles.js.push(e),t()))}:r.onload=function(){i.loadFiles.js.push(e),t()}},i.katexURL={css:"//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min",js:"//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.3.0/katex.min"},i.kaTeXLoaded=!1,i.loadKaTeX=function(e){i.loadCSS(i.katexURL.css,function(){i.loadScript(i.katexURL.js,e||function(){})})},i.lockScreen=function(t){e("html,body").css("overflow",t?"hidden":"")},i.createDialog=function(t){var n={name:"",width:420,height:240,title:"",drag:!0,closed:!0,content:"",mask:!0,maskStyle:{backgroundColor:"#fff",opacity:.1},lockScreen:!0,footer:!0,buttons:!1};t=e.extend(!0,n,t);var r=this,a=this.editor,o=i.classPrefix,s=(new Date).getTime(),l=""===t.name?o+"dialog-"+s:t.name,c=i.mouseOrTouch,u='<div class="'+o+"dialog "+l+'">';""!==t.title&&(u+='<div class="'+o+'dialog-header"'+(t.drag?' style="cursor: move;"':"")+">",u+='<strong class="'+o+'dialog-title">'+t.title+"</strong>",u+="</div>"),t.closed&&(u+='<a href="javascript:;" class="fa fa-close '+o+'dialog-close"></a>'),u+='<div class="'+o+'dialog-container">'+t.content,(t.footer||"string"==typeof t.footer)&&(u+='<div class="'+o+'dialog-footer">'+("boolean"==typeof t.footer?"":t.footer)+"</div>"),u+="</div>",u+='<div class="'+o+"dialog-mask "+o+'dialog-mask-bg"></div>',u+='<div class="'+o+"dialog-mask "+o+'dialog-mask-con"></div>',u+="</div>",a.append(u);var d=a.find("."+l);d.lockScreen=function(i){return t.lockScreen&&(e("html,body").css("overflow",i?"hidden":""),r.resize()),d},d.showMask=function(){return t.mask&&a.find("."+o+"mask").css(t.maskStyle).css("z-index",i.dialogZindex-1).show(),d},d.hideMask=function(){return t.mask&&a.find("."+o+"mask").hide(),d},d.loading=function(e){return d.find("."+o+"dialog-mask")[e?"show":"hide"](),d},d.lockScreen(!0).showMask(),d.show().css({zIndex:i.dialogZindex,border:i.isIE8?"1px solid #ddd":"",width:"number"==typeof t.width?t.width+"px":t.width,height:"number"==typeof t.height?t.height+"px":t.height});var h=function(){d.css({top:(e(window).height()-d.height())/2+"px",left:(e(window).width()-d.width())/2+"px"})};if(h(),e(window).resize(h),d.children("."+o+"dialog-close").bind(c("click","touchend"),function(){d.hide().lockScreen(!1).hideMask()}),"object"==typeof t.buttons){var p=d.footer=d.find("."+o+"dialog-footer");for(var f in t.buttons){var m=t.buttons[f],g=o+f+"-btn";p.append('<button class="'+o+"btn "+g+'">'+m[0]+"</button>"),m[1]=e.proxy(m[1],d),p.children("."+g).bind(c("click","touchend"),m[1])}}if(""!==t.title&&t.drag){var v,y,_=d.children("."+o+"dialog-header");t.mask||_.bind(c("click","touchend"),function(){i.dialogZindex+=2,d.css("z-index",i.dialogZindex)}),_.mousedown(function(e){e=e||window.event,v=e.clientX-parseInt(d[0].style.left),y=e.clientY-parseInt(d[0].style.top),document.onmousemove=x});var b=function(e){e.removeClass(o+"user-unselect").off("selectstart")},w=function(e){e.addClass(o+"user-unselect").on("selectstart",function(e){return!1})},x=function(t){t=t||window.event;var i,n,r=parseInt(d[0].style.left),a=parseInt(d[0].style.top);r>=0?r+d.width()<=e(window).width()?i=t.clientX-v:(i=e(window).width()-d.width(),document.onmousemove=null):(i=0,document.onmousemove=null),a>=0?n=t.clientY-y:(n=0,document.onmousemove=null),document.onselectstart=function(){return!1},w(e("body")),w(d),d[0].style.left=i+"px",d[0].style.top=n+"px"};document.onmouseup=function(){b(e("body")),b(d),document.onselectstart=null,document.onmousemove=null},_.touchDraggable=function(){var t=null,i=function(i){var n=i.originalEvent,r=e(this).parent().position();t={x:n.changedTouches[0].pageX-r.left,y:n.changedTouches[0].pageY-r.top}},n=function(i){i.preventDefault();var n=i.originalEvent;e(this).parent().css({top:n.changedTouches[0].pageY-t.y,left:n.changedTouches[0].pageX-t.x})};this.bind("touchstart",i).bind("touchmove",n)},_.touchDraggable()}return i.dialogZindex+=2,d},i.mouseOrTouch=function(e,t){e=e||"click",t=t||"touchend";var i=e;try{document.createEvent("TouchEvent"),i=t}catch(e){}return i},i.dateFormat=function(e){e=e||"";var t=function(e){return e<10?"0"+e:e},i=new Date,n=i.getFullYear(),r=n.toString().slice(2,4),a=t(i.getMonth()+1),o=t(i.getDate()),s=i.getDay(),l=t(i.getHours()),c=t(i.getMinutes()),u=t(i.getSeconds()),d=t(i.getMilliseconds()),h="",p=r+"-"+a+"-"+o,f=n+"-"+a+"-"+o,m=l+":"+c+":"+u;switch(e){case"UNIX Time":h=i.getTime();break;case"UTC":h=i.toUTCString();break;case"yy":h=r;break;case"year":case"yyyy":h=n;break;case"month":case"mm":h=a;break;case"cn-week-day":case"cn-wd":h="星期"+["日","一","二","三","四","五","六"][s];break;case"week-day":case"wd":h=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][s];break;case"day":case"dd":h=o;break;case"hour":case"hh":h=l;break;case"min":case"ii":h=c;break;case"second":case"ss":h=u;break;case"ms":h=d;break;case"yy-mm-dd":h=p;break;case"yyyy-mm-dd":h=f;break;case"yyyy-mm-dd h:i:s ms":case"full + ms":h=f+" "+m+" "+d;break;case"full":case"yyyy-mm-dd h:i:s":default:h=f+" "+m}return h},i}()}),define("modules/console/expdesktop/model/document/controller",["jquery","editormd"],function(e,t){function i(e,t){this.element=e,this.options=t}var n={init:function(){var i={htmlDecode:"style,script,iframe",tocm:!0,emoji:!1,taskList:!0,tex:!0,flowChart:!0,sequenceDiagram:!0,tocStartLevel:1};e.extend(this.options,i),t.markdownToHTML(this.element,this.options);var n=e("#"+this.element).find("pre");n.prepend("<i class='document-copy fa fa-files-o' style='display:none' ></i>"),n.on("mouseover",function(){e(this).find("i").show()}),n.on("mouseout",function(){e(this).find("i").hide()})}};return e.extend(i.prototype,n),i}),function(){window.UMEDITOR_HOME_URL="/static/public/lib/ueditor/";var e=window.UMEDITOR_HOME_URL||function(){function e(){this.documentURL=self.document.URL||self.location.href,this.separator="/",this.separatorPattern=/\\|\//g,this.currentDir="./",this.currentDirPattern=/^[.]\/]/,this.path=this.documentURL,this.stack=[],this.push(this.documentURL)}function t(){var t=e.getProtocol(this.path||"");t?(this.protocol=t,this.localSeparator=/\\|\//.exec(this.path.replace(t,""))[0],this.stack=[]):(t=/\\|\//.exec(this.path))&&(this.localSeparator=t[0])}function i(){var t=this.path.replace(this.currentDirPattern,"");e.hasProtocol(this.path)&&(t=t.replace(this.protocol,"")),t=t.split(this.localSeparator),t.length=t.length-1;for(var i,n=0,r=t.length,a=this.stack;n<r;n++)(i=t[n])&&(e.isParentPath(i)?a.pop():a.push(i))}e.isParentPath=function(e){return".."===e},e.hasProtocol=function(t){return!!e.getProtocol(t)},e.getProtocol=function(e){var t=/^[^:]*:\/*/.exec(e);return t?t[0]:null},e.prototype={push:function(e){return this.path=e,t.call(this),i.call(this),this},getPath:function(){return this+""},toString:function(){return this.protocol+this.stack.concat([""]).join(this.separator)}};var n=document.getElementsByTagName("script");return n=n[n.length-1].src,(new e).push(n)+""}();window.UMEDITOR_CONFIG={UMEDITOR_HOME_URL:e,imageUrl:"/upload_attachment/",imagePath:SDC.domain.report_domain,imageFieldName:"upload",toolbar:["source | undo redo | bold italic underline strikethrough | superscript subscript | forecolor backcolor | removeformat |","insertorderedlist insertunorderedlist","link unlink | emotion image","| horizontal preview ","formula"],initialFrameWidth:630,initialFrameHeight:230,fontsize:[12,14,16,18,20,24,36],paragraph:{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""},filterRules:{},xssFilterRules:!0,inputXssFilter:!0,outputXssFilter:!0,whiteList:{a:["target","href","title","style","class","id"],abbr:["title","style","class","id"],address:["style","class","id"],area:["shape","coords","href","alt","style","class","id"],article:["style","class","id"],aside:["style","class","id"],audio:["autoplay","controls","loop","preload","src","style","class","id"],b:["style","class","id"],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite","style","class","id"],br:[],caption:["style","class","id"],center:[],cite:[],code:["style","class","id"],col:["align","valign","span","width","style","class","id"],colgroup:["align","valign","span","width","style","class","id"],dd:["style","class","id"],del:["datetime","style","class","id"],details:["open","style","class","id"],div:["style","class","id"],dl:["style","class","id"],dt:["style","class","id"],em:["style","class","id"],embed:["style","class","id","_url","type","pluginspage","src","width","height","wmode","play","loop","menu","allowscriptaccess","allowfullscreen"],font:["color","size","face","style","class","id"],footer:["style","class","id"],h1:["style","class","id"],h2:["style","class","id"],h3:["style","class","id"],h4:["style","class","id"],h5:["style","class","id"],h6:["style","class","id"],header:["style","class","id"],hr:["style","class","id"],i:["style","class","id"],iframe:["style","class","id","src","frameborder","data-latex"],img:["src","alt","title","width","height","style","class","id","_url"],ins:["datetime","style","class","id"],li:["style","class","id"],mark:[],nav:[],ol:["style","class","id"],p:["style","class","id"],pre:["style","class","id"],s:[],section:[],small:["style","class","id"],span:["style","class","id"],sub:["style","class","id"],sup:["style","class","id"],strong:["style","class","id"],table:["width","border","align","valign","style","class","id"],tbody:["align","valign","style","class","id"],td:["width","rowspan","colspan","align","valign","style","class","id"],tfoot:["align","valign","style","class","id"],th:["width","rowspan","colspan","align","valign","style","class","id"],thead:["align","valign","style","class","id"],tr:["rowspan","align","valign","style","class","id"],tt:["style","class","id"],u:[],ul:["style","class","id"],svg:["style","class","id","width","height","xmlns","fill","viewBox"],video:["autoplay","controls","loop","preload","src","height","width","style","class","id"]}}}(),define("ueditorconfig",function(){}),function($){function getListener(e,t,i){var n;return t=t.toLowerCase(),(n=e.__allListeners||i&&(e.__allListeners={}))&&(n[t]||i&&(n[t]=[]))}function getDomNode(e,t,i,n,r,a){var o,s=n&&e[t];for(!s&&(s=e[i]);!s&&(o=(o||e).parentNode);){if("BODY"==o.tagName||a&&!a(o))return null;s=o[i]}return s&&r&&!r(s)?getDomNode(s,t,i,!1,r):s}UMEDITOR_CONFIG=window.UMEDITOR_CONFIG||{},window.UM={plugins:{},commands:{},I18N:{},version:"1.2.2"};var dom=UM.dom={},browser=UM.browser=function(){var e=navigator.userAgent.toLowerCase(),t=window.opera,i={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(e),opera:!!t&&t.version,webkit:e.indexOf(" applewebkit/")>-1,mac:e.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};i.gecko="Gecko"==navigator.product&&!i.webkit&&!i.opera&&!i.ie;var n=0;if(i.ie){var r=e.match(/(?:msie\s([\w.]+))/),a=e.match(/(?:trident.*rv:([\w.]+))/);n=r&&a&&r[1]&&a[1]?Math.max(1*r[1],1*a[1]):r&&r[1]?1*r[1]:a&&a[1]?1*a[1]:0,i.ie11Compat=11==document.documentMode,i.ie9Compat=9==document.documentMode,i.ie8=!!document.documentMode,i.ie8Compat=8==document.documentMode,i.ie7Compat=7==n&&!document.documentMode||7==document.documentMode,i.ie6Compat=n<7||i.quirks,i.ie9above=n>8,i.ie9below=n<9}if(i.gecko){var o=e.match(/rv:([\d\.]+)/);o&&(o=o[1].split("."),n=1e4*o[0]+100*(o[1]||0)+1*(o[2]||0))}return/chrome\/(\d+\.\d)/i.test(e)&&(i.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(e)&&!/chrome/i.test(e)&&(i.safari=+(RegExp.$1||RegExp.$2)),i.opera&&(n=parseFloat(t.version())),i.webkit&&(n=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),i.version=n,i.isCompatible=!i.mobile&&(i.ie&&n>=6||i.gecko&&n>=10801||i.opera&&n>=9.5||i.air&&n>=1||i.webkit&&n>=522||!1),i}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,utils=UM.utils={each:function(e,t,i){if(null!=e)if(e.length===+e.length){for(var n=0,r=e.length;n<r;n++)if(!1===t.call(i,e[n],n,e))return!1}else for(var a in e)if(e.hasOwnProperty(a)&&!1===t.call(i,e[a],a,e))return!1},makeInstance:function(e){var t=new Function;return t.prototype=e,e=new t,t.prototype=null,e},extend:function(e,t,i){if(t)for(var n in t)i&&e.hasOwnProperty(n)||(e[n]=t[n]);return e},extend2:function(e){for(var t=arguments,i=1;i<t.length;i++){var n=t[i];for(var r in n)e.hasOwnProperty(r)||(e[r]=n[r])}return e},inherits:function(e,t){var i=e.prototype,n=utils.makeInstance(t.prototype);return utils.extend(n,i,!0),e.prototype=n,n.constructor=e},bind:function(e,t){return function(){return e.apply(t,arguments)}},defer:function(e,t,i){var n;return function(){i&&clearTimeout(n),n=setTimeout(e,t)}},indexOf:function(e,t,i){var n=-1;return i=this.isNumber(i)?i:0,this.each(e,function(e,r){if(r>=i&&e===t)return n=r,!1}),n},removeItem:function(e,t){for(var i=0,n=e.length;i<n;i++)e[i]===t&&(e.splice(i,1),i--)},trim:function(e){return e.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(e){if(!e)return{};e=utils.isArray(e)?e:e.split(",");for(var t,i=0,n={};t=e[i++];)n[t.toUpperCase()]=n[t]=1;return n},unhtml:function(e,t){return e?e.replace(t||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g,function(e,t){return t?e:{"<":"<","&":"&",'"':""",">":">","'":"'"}[e]}):""},html:function(e){return e?e.replace(/&((g|l|quo)t|amp|#39);/g,function(e){return{"<":"<","&":"&",""":'"',">":">","'":"'"}[e]}):""},cssStyleToDomStyle:function(){var e=document.createElement("div").style,t={float:void 0!=e.cssFloat?"cssFloat":void 0!=e.styleFloat?"styleFloat":"float"};return function(e){return t[e]||(t[e]=e.toLowerCase().replace(/-./g,function(e){return e.charAt(1).toUpperCase()}))}}(),loadFile:function(){function e(e,i){try{for(var n,r=0;n=t[r++];)if(n.doc===e&&n.url==(i.src||i.href))return n}catch(e){return null}}var t=[];return function(i,n,r){var a=e(i,n);if(a)return void(a.ready?r&&r():a.funs.push(r));if(t.push({doc:i,url:n.src||n.href,funs:[r]}),!i.body){var o=[];for(var s in n)"tag"!=s&&o.push(s+'="'+n[s]+'"');return void i.write("<"+n.tag+" "+o.join(" ")+" ></"+n.tag+">")}if(!n.id||!i.getElementById(n.id)){var l=i.createElement(n.tag);delete n.tag;for(var s in n)l.setAttribute(s,n[s]);l.onload=l.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(a=e(i,n),a.funs.length>0){a.ready=1;for(var t;t=a.funs.pop();)t()}l.onload=l.onreadystatechange=null}},l.onerror=function(){throw Error("The load "+(n.href||n.src)+" fails,check the url settings of file umeditor.config.js ")},i.getElementsByTagName("head")[0].appendChild(l)}}}(),isEmptyObject:function(e){if(null==e)return!0;if(this.isArray(e)||this.isString(e))return 0===e.length;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},fixColor:function(e,t){if(/color/i.test(e)&&/rgba?/.test(t)){var i=t.split(",");if(i.length>3)return"";t="#";for(var n,r=0;n=i[r++];)n=parseInt(n.replace(/[^\d]/gi,""),10).toString(16),t+=1==n.length?"0"+n:n;t=t.toUpperCase()}return t},clone:function(e,t){var i;t=t||{};for(var n in e)e.hasOwnProperty(n)&&(i=e[n],"object"==typeof i?(t[n]=utils.isArray(i)?[]:{},utils.clone(e[n],t[n])):t[n]=i);return t},transUnitToPx:function(e){if(!/(pt|cm)/.test(e))return e;var t;switch(e.replace(/([\d.]+)(\w+)/,function(i,n,r){e=n,t=r}),t){case"cm":e=25*parseFloat(e);break;case"pt":e=Math.round(96*parseFloat(e)/72)}return e+(e?"px":"")},cssRule:browser.ie&&11!=browser.version?function(e,t,i){var n,r;i=i||document,n=i.indexList?i.indexList:i.indexList={};var a;if(n[e])a=i.styleSheets[n[e]];else{if(void 0===t)return"";a=i.createStyleSheet("",r=i.styleSheets.length),n[e]=r}if(void 0===t)return a.cssText;a.cssText=t||""}:function(e,t,i){i=i||document;var n,r=i.getElementsByTagName("head")[0];if(!(n=i.getElementById(e))){if(void 0===t)return"";n=i.createElement("style"),n.id=e,r.appendChild(n)}if(void 0===t)return n.innerHTML;""!==t?n.innerHTML=t:r.removeChild(n)}};utils.each(["String","Function","Array","Number","RegExp","Object"],function(e){UM.utils["is"+e]=function(t){return Object.prototype.toString.apply(t)=="[object "+e+"]"}});var EventBase=UM.EventBase=function(){};EventBase.prototype={addListener:function(e,t){e=utils.trim(e).split(" ");for(var i,n=0;i=e[n++];)getListener(this,i,!0).push(t)},removeListener:function(e,t){e=utils.trim(e).split(" ");for(var i,n=0;i=e[n++];)utils.removeItem(getListener(this,i)||[],t)},fireEvent:function(){var e=arguments[0];e=utils.trim(e).split(" ");for(var t,i=0;t=e[i++];){var n,r,a,o=getListener(this,t);if(o)for(a=o.length;a--;)if(o[a]){if(!0===(r=o[a].apply(this,arguments)))return r;void 0!==r&&(n=r)}(r=this["on"+t.toLowerCase()])&&(n=r.apply(this,arguments))}return n}};var dtd=dom.dtd=function(){function e(e){for(var t in e)e[t.toUpperCase()]=e[t];return e}var t=utils.extend2,i=e({isindex:1,fieldset:1}),n=e({input:1,button:1,select:1,textarea:1,label:1}),r=t(e({a:1}),n),a=t({iframe:1},r),o=e({hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1}),s=e({ins:1,del:1,script:1,style:1}),l=t(e({b:1,acronym:1,bdo:1,var:1,"#":1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1}),s),c=t(e({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),l),u=t(e({p:1}),c),d=t(e({iframe:1}),c,n),h=e({img:1,embed:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,"#":1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,var:1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1}),p=t(e({a:0}),d),f=e({tr:1}),m=e({"#":1}),g=t(e({param:1}),h),v=t(e({form:1}),i,a,o,u),y=e({li:1,ol:1,ul:1}),_=e({style:1,script:1}),b=e({base:1,link:1,meta:1,title:1}),w=t(b,_),x=e({head:1,body:1}),k=e({html:1}),C=e({address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}),T=e({area:1,base:1,basefont:1,br:1,col:1,command:1,dialog:1,embed:1,hr:1,img:1,input:1,isindex:1,keygen:1,link:1,meta:1,param:1,source:1,track:1,wbr:1});return e({$nonBodyContent:t(k,x,b),$block:C,$inline:p,$inlineWithA:t(e({a:1}),p),$body:t(e({script:1,style:1}),C),$cdata:e({script:1,style:1}),$empty:T,$nonChild:e({iframe:1,textarea:1}),$listItem:e({dd:1,dt:1,li:1}),$list:e({ul:1,ol:1,dl:1}),$isNotEmpty:e({table:1,ul:1,ol:1,dl:1,iframe:1,area:1,base:1,col:1,hr:1,img:1,embed:1,input:1,link:1,meta:1,param:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1}),$removeEmpty:e({a:1,abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,var:1}),$removeEmptyBlock:e({p:1,div:1}),$tableContent:e({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:e({pre:1,script:1,style:1,textarea:1}),html:x,head:w,style:m,script:m,body:v,base:{},link:{},meta:{},title:m,col:{},tr:e({td:1,th:1}),img:{},embed:{},colgroup:e({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:v,td:v,br:{},th:v,center:v,kbd:p,button:t(u,o),basefont:{},h5:p,h4:p,samp:p,h6:p,ol:y,h1:p,h3:p,option:m,h2:p,form:t(i,a,o,u),select:e({optgroup:1,option:1}),font:p,ins:p,menu:y,abbr:p,label:p,table:e({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}),code:p,tfoot:f,cite:p,li:v,input:{},iframe:v,strong:p,textarea:m,noframes:v,big:p,small:p,span:e({"#":1,br:1,b:1,strong:1,u:1,i:1,em:1,sub:1,sup:1,strike:1,span:1}),hr:p,dt:p,sub:p,optgroup:e({option:1}),param:{},bdo:p,var:p,div:v,object:g,sup:p,dd:v,strike:p,area:{},dir:y,map:t(e({area:1,form:1,p:1}),i,s,o),applet:g,dl:e({dt:1,dd:1}),del:p,isindex:{},fieldset:t(e({legend:1}),h),thead:f,ul:y,acronym:p,b:p,a:t(e({a:1}),d),blockquote:t(e({td:1,tr:1,tbody:1,li:1}),v),caption:p,i:p,u:p,tbody:f,s:p,address:t(a,u),tt:p,legend:p,q:p,pre:t(l,r),p:t(e({a:1}),p),em:p,dfn:p})}(),attrFix=ie&&browser.version<9?{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder"}:{tabindex:"tabIndex",readonly:"readOnly"},styleBlock=utils.listToMap(["-webkit-box","-moz-box","block","list-item","table","table-row-group","table-header-group","table-footer-group","table-row","table-column-group","table-column","table-cell","table-caption"]),domUtils=dom.domUtils={NODE_ELEMENT:1,NODE_DOCUMENT:9,NODE_TEXT:3,NODE_COMMENT:8,NODE_DOCUMENT_FRAGMENT:11,POSITION_IDENTICAL:0,POSITION_DISCONNECTED:1,POSITION_FOLLOWING:2,POSITION_PRECEDING:4,POSITION_IS_CONTAINED:8,POSITION_CONTAINS:16,fillChar:ie&&"6"==browser.version?"\ufeff":"",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},breakParent:function(e,t){var i,n,r,a=e,o=e;do{for(a=a.parentNode,n?(i=a.cloneNode(!1),i.appendChild(n),n=i,i=a.cloneNode(!1),i.appendChild(r),r=i):(n=a.cloneNode(!1),r=n.cloneNode(!1));i=o.previousSibling;)n.insertBefore(i,n.firstChild);for(;i=o.nextSibling;)r.appendChild(i);o=a}while(t!==a);return i=t.parentNode,i.insertBefore(n,t),i.insertBefore(r,t),i.insertBefore(e,r),domUtils.remove(t),e},trimWhiteTextNode:function(e){function t(t){for(var i;(i=e[t])&&3==i.nodeType&&domUtils.isWhitespace(i);)e.removeChild(i)}t("firstChild"),t("lastChild")},getPosition:function(e,t){if(e===t)return 0;var i,n=[e],r=[t];for(i=e;i=i.parentNode;){if(i===t)return 10;n.push(i)}for(i=t;i=i.parentNode;){if(i===e)return 20;r.push(i)}if(n.reverse(),r.reverse(),n[0]!==r[0])return 1;for(var a=-1;a++,n[a]===r[a];);for(e=n[a],t=r[a];e=e.nextSibling;)if(e===t)return 4;return 2},getNodeIndex:function(e,t){for(var i=e,n=0;i=i.previousSibling;)t&&3==i.nodeType?i.nodeType!=i.nextSibling.nodeType&&n++:n++;return n},inDoc:function(e,t){return 10==domUtils.getPosition(e,t)},findParent:function(e,t,i){if(e&&!domUtils.isBody(e))for(e=i?e:e.parentNode;e;){if(!t||t(e)||domUtils.isBody(e))return t&&!t(e)&&domUtils.isBody(e)?null:e;e=e.parentNode}return null},findParentByTagName:function(e,t,i,n){return t=utils.listToMap(utils.isArray(t)?t:[t]),domUtils.findParent(e,function(e){
|
||
return t[e.tagName]&&!(n&&n(e))},i)},findParents:function(e,t,i,n){for(var r=t&&(i&&i(e)||!i)?[e]:[];e=domUtils.findParent(e,i);)r.push(e);return n?r:r.reverse()},insertAfter:function(e,t){return e.parentNode.insertBefore(t,e.nextSibling)},remove:function(e,t){var i,n=e.parentNode;if(n){if(t&&e.hasChildNodes())for(;i=e.firstChild;)n.insertBefore(i,e);n.removeChild(e)}return e},getNextDomNode:function(e,t,i,n){return getDomNode(e,"firstChild","nextSibling",t,i,n)},getPreDomNode:function(e,t,i,n){return getDomNode(e,"lastChild","previousSibling",t,i,n)},isBookmarkNode:function(e){return 1==e.nodeType&&e.id&&/^_baidu_bookmark_/i.test(e.id)},getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getCommonAncestor:function(e,t){if(e===t)return e;for(var i=[e],n=[t],r=e,a=-1;r=r.parentNode;){if(r===t)return r;i.push(r)}for(r=t;r=r.parentNode;){if(r===e)return r;n.push(r)}for(i.reverse(),n.reverse();a++,i[a]===n[a];);return 0==a?null:i[a-1]},clearEmptySibling:function(e,t,i){function n(e,t){for(var i;e&&!domUtils.isBookmarkNode(e)&&(domUtils.isEmptyInlineElement(e)||!new RegExp("[^\t\n\r"+domUtils.fillChar+"]").test(e.nodeValue));)i=e[t],domUtils.remove(e),e=i}!t&&n(e.nextSibling,"nextSibling"),!i&&n(e.previousSibling,"previousSibling")},split:function(e,t){var i=e.ownerDocument;if(browser.ie&&t==e.nodeValue.length){var n=i.createTextNode("");return domUtils.insertAfter(e,n)}var r=e.splitText(t);if(browser.ie8){var a=i.createTextNode("");domUtils.insertAfter(r,a),domUtils.remove(a)}return r},isWhitespace:function(e){return!new RegExp("[^ \t\n\r"+domUtils.fillChar+"]").test(e.nodeValue)},getXY:function(e){for(var t=0,i=0;e.offsetParent;)i+=e.offsetTop,t+=e.offsetLeft,e=e.offsetParent;return{x:t,y:i}},isEmptyInlineElement:function(e){if(1!=e.nodeType||!dtd.$removeEmpty[e.tagName])return 0;for(e=e.firstChild;e;){if(domUtils.isBookmarkNode(e))return 0;if(1==e.nodeType&&!domUtils.isEmptyInlineElement(e)||3==e.nodeType&&!domUtils.isWhitespace(e))return 0;e=e.nextSibling}return 1},isBlockElm:function(e){return 1==e.nodeType&&(dtd.$block[e.tagName]||styleBlock[domUtils.getComputedStyle(e,"display")])&&!dtd.$nonChild[e.tagName]},getElementsByTagName:function(e,t,i){if(i&&utils.isString(i)){var n=i;i=function(e){var t=!1;return $.each(utils.trim(n).replace(/[ ]{2,}/g," ").split(" "),function(i,n){if($(e).hasClass(n))return t=!0,!1}),t}}t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var r,a=[],o=0;r=t[o++];)for(var s,l=e.getElementsByTagName(r),c=0;s=l[c++];)i&&!i(s)||a.push(s);return a},unSelectable:ie&&browser.ie9below||browser.opera?function(e){e.onselectstart=function(){return!1},e.onclick=e.onkeyup=e.onkeydown=function(){return!1},e.unselectable="on",e.setAttribute("unselectable","on");for(var t,i=0;t=e.all[i++];)switch(t.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:t.unselectable="on",e.setAttribute("unselectable","on")}}:function(e){e.style.MozUserSelect=e.style.webkitUserSelect=e.style.msUserSelect=e.style.KhtmlUserSelect="none"},removeAttributes:function(e,t){t=utils.isArray(t)?t:utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var i,n=0;i=t[n++];){switch(i=attrFix[i]||i){case"className":e[i]="";break;case"style":e.style.cssText="",!browser.ie&&e.removeAttributeNode(e.getAttributeNode("style"))}e.removeAttribute(i)}},createElement:function(e,t,i){return domUtils.setAttributes(e.createElement(t),i)},setAttributes:function(e,t){for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];switch(i){case"class":e.className=n;break;case"style":e.style.cssText=e.style.cssText+";"+n;break;case"innerHTML":e[i]=n;break;case"value":e.value=n;break;default:e.setAttribute(attrFix[i]||i,n)}}return e},getComputedStyle:function(e,t){return utils.transUnitToPx(utils.fixColor(t,$(e).css(t)))},preventDefault:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},removeStyle:function(e,t){browser.ie?("color"==t&&(t="(^|;)"+t),e.style.cssText=e.style.cssText.replace(new RegExp(t+"[^:]*:[^;]+;?","ig"),"")):e.style.removeProperty?e.style.removeProperty(t):e.style.removeAttribute(utils.cssStyleToDomStyle(t)),e.style.cssText||domUtils.removeAttributes(e,["style"])},getStyle:function(e,t){var i=e.style[utils.cssStyleToDomStyle(t)];return utils.fixColor(t,i)},setStyle:function(e,t,i){e.style[utils.cssStyleToDomStyle(t)]=i,utils.trim(e.style.cssText)||this.removeAttributes(e,"style")},removeDirtyAttr:function(e){for(var t,i=0,n=e.getElementsByTagName("*");t=n[i++];)t.removeAttribute("_moz_dirty");e.removeAttribute("_moz_dirty")},getChildCount:function(e,t){var i=0,n=e.firstChild;for(t=t||function(){return 1};n;)t(n)&&i++,n=n.nextSibling;return i},isEmptyNode:function(e){return!e.firstChild||0==domUtils.getChildCount(e,function(e){return!domUtils.isBr(e)&&!domUtils.isBookmarkNode(e)&&!domUtils.isWhitespace(e)})},isBr:function(e){return 1==e.nodeType&&"BR"==e.tagName},isEmptyBlock:function(e,t){if(1!=e.nodeType)return 0;if(t=t||new RegExp("[ \t\r\n"+domUtils.fillChar+"]","g"),e[browser.ie?"innerText":"textContent"].replace(t,"").length>0)return 0;for(var i in dtd.$isNotEmpty)if(e.getElementsByTagName(i).length)return 0;return 1},isCustomeNode:function(e){return 1==e.nodeType&&e.getAttribute("_ue_custom_node_")},fillNode:function(e,t){var i=browser.ie?e.createTextNode(domUtils.fillChar):e.createElement("br");t.innerHTML="",t.appendChild(i)},isBoundaryNode:function(e,t){for(var i;!domUtils.isBody(e);)if(i=e,e=e.parentNode,i!==e[t])return!1;return!0},isFillChar:function(e,t){return 3==e.nodeType&&!e.nodeValue.replace(new RegExp((t?"^":"")+domUtils.fillChar),"").length},isBody:function(e){return $(e).hasClass("edui-body-container")}},fillCharReg=new RegExp(domUtils.fillChar,"g");!function(){function e(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer===e.endContainer&&e.startOffset==e.endOffset}function t(e){return!e.collapsed&&1==e.startContainer.nodeType&&e.startContainer===e.endContainer&&e.endOffset-e.startOffset==1}function i(t,i,n,r){return 1==i.nodeType&&(dtd.$empty[i.tagName]||dtd.$nonChild[i.tagName])&&(n=domUtils.getNodeIndex(i)+(t?0:1),i=i.parentNode),t?(r.startContainer=i,r.startOffset=n,r.endContainer||r.collapse(!0)):(r.endContainer=i,r.endOffset=n,r.startContainer||r.collapse(!1)),e(r),r}function n(e,t){try{if(o&&domUtils.inDoc(o,e))if(o.nodeValue.replace(fillCharReg,"").length)o.nodeValue=o.nodeValue.replace(fillCharReg,"");else{var i=o.parentNode;for(domUtils.remove(o);i&&domUtils.isEmptyInlineElement(i)&&(browser.safari?!(domUtils.getPosition(i,t)&domUtils.POSITION_CONTAINS):!i.contains(t));)o=i.parentNode,domUtils.remove(i),i=o}}catch(e){}}function r(e,t){var i;for(e=e[t];e&&domUtils.isFillChar(e);)i=e[t],domUtils.remove(e),e=i}function a(e,t){var i,n,r=e.startContainer,a=e.endContainer,o=e.startOffset,s=e.endOffset,l=e.document,c=l.createDocumentFragment();if(1==r.nodeType&&(r=r.childNodes[o]||(i=r.appendChild(l.createTextNode("")))),1==a.nodeType&&(a=a.childNodes[s]||(n=a.appendChild(l.createTextNode("")))),r===a&&3==r.nodeType)return c.appendChild(l.createTextNode(r.substringData(o,s-o))),t&&(r.deleteData(o,s-o),e.collapse(!0)),c;for(var u,d,h=c,p=domUtils.findParents(r,!0),f=domUtils.findParents(a,!0),m=0;p[m]==f[m];)m++;for(var g,v=m;g=p[v];v++){for(u=g.nextSibling,g==r?i||(3==e.startContainer.nodeType?(h.appendChild(l.createTextNode(r.nodeValue.slice(o))),t&&r.deleteData(o,r.nodeValue.length-o)):h.appendChild(t?r:r.cloneNode(!0))):(d=g.cloneNode(!1),h.appendChild(d));u&&u!==a&&u!==f[v];)g=u.nextSibling,h.appendChild(t?u:u.cloneNode(!0)),u=g;h=d}h=c,p[m]||(h.appendChild(p[m-1].cloneNode(!1)),h=h.firstChild);for(var y,v=m;y=f[v];v++){if(u=y.previousSibling,y==a?n||3!=e.endContainer.nodeType||(h.appendChild(l.createTextNode(a.substringData(0,s))),t&&a.deleteData(0,s)):(d=y.cloneNode(!1),h.appendChild(d)),v!=m||!p[m])for(;u&&u!==r;)y=u.previousSibling,h.insertBefore(t?u:u.cloneNode(!0),h.firstChild),u=y;h=d}return t&&e.setStartBefore(f[m]?p[m]?f[m]:p[m-1]:f[m-1]).collapse(!0),i&&domUtils.remove(i),n&&domUtils.remove(n),c}var o,s=0,l=domUtils.fillChar,c=dom.Range=function(e,t){var i=this;i.startContainer=i.startOffset=i.endContainer=i.endOffset=null,i.document=e,i.collapsed=!0,i.body=t};c.prototype={deleteContents:function(){var e;return this.collapsed||a(this,1),browser.webkit&&(e=this.startContainer,3!=e.nodeType||e.nodeValue.length||(this.setStartBefore(e).collapse(!0),domUtils.remove(e))),this},inFillChar:function(){var e=this.startContainer;return!(!this.collapsed||3!=e.nodeType||e.nodeValue.replace(new RegExp("^"+domUtils.fillChar),"").length+1!=e.nodeValue.length)},setStart:function(e,t){return i(!0,e,t,this)},setEnd:function(e,t){return i(!1,e,t,this)},setStartAfter:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e)+1)},setStartBefore:function(e){return this.setStart(e.parentNode,domUtils.getNodeIndex(e))},setEndAfter:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e)+1)},setEndBefore:function(e){return this.setEnd(e.parentNode,domUtils.getNodeIndex(e))},setStartAtFirst:function(e){return this.setStart(e,0)},setStartAtLast:function(e){return this.setStart(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},setEndAtFirst:function(e){return this.setEnd(e,0)},setEndAtLast:function(e){return this.setEnd(e,3==e.nodeType?e.nodeValue.length:e.childNodes.length)},selectNode:function(e){return this.setStartBefore(e).setEndAfter(e)},selectNodeContents:function(e){return this.setStart(e,0).setEndAtLast(e)},cloneRange:function(){var e=this;return new c(e.document).setStart(e.startContainer,e.startOffset).setEnd(e.endContainer,e.endOffset)},collapse:function(e){var t=this;return e?(t.endContainer=t.startContainer,t.endOffset=t.startOffset):(t.startContainer=t.endContainer,t.startOffset=t.endOffset),t.collapsed=!0,t},shrinkBoundary:function(e){function t(e){return 1==e.nodeType&&!domUtils.isBookmarkNode(e)&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]}for(var i,n=this,r=n.collapsed;1==n.startContainer.nodeType&&(i=n.startContainer.childNodes[n.startOffset])&&t(i);)n.setStart(i,0);if(r)return n.collapse(!0);if(!e)for(;1==n.endContainer.nodeType&&n.endOffset>0&&(i=n.endContainer.childNodes[n.endOffset-1])&&t(i);)n.setEnd(i,i.childNodes.length);return n},trimBoundary:function(e){this.txtToElmBoundary();var t=this.startContainer,i=this.startOffset,n=this.collapsed,r=this.endContainer;if(3==t.nodeType){if(0==i)this.setStartBefore(t);else if(i>=t.nodeValue.length)this.setStartAfter(t);else{var a=domUtils.split(t,i);t===r?this.setEnd(a,this.endOffset-i):t.parentNode===r&&(this.endOffset+=1),this.setStartBefore(a)}if(n)return this.collapse(!0)}return e||(i=this.endOffset,r=this.endContainer,3==r.nodeType&&(0==i?this.setEndBefore(r):(i<r.nodeValue.length&&domUtils.split(r,i),this.setEndAfter(r)))),this},txtToElmBoundary:function(e){function t(e,t){var i=e[t+"Container"],n=e[t+"Offset"];3==i.nodeType&&(n?n>=i.nodeValue.length&&e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"After"](i):e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"Before"](i))}return!e&&this.collapsed||(t(this,"start"),t(this,"end")),this},insertNode:function(e){var t=e,i=1;11==e.nodeType&&(t=e.firstChild,i=e.childNodes.length),this.trimBoundary(!0);var n=this.startContainer,r=this.startOffset,a=n.childNodes[r];return a?n.insertBefore(e,a):n.appendChild(e),t.parentNode===this.endContainer&&(this.endOffset=this.endOffset+i),this.setStartBefore(t)},setCursor:function(e,t){return this.collapse(!e).select(t)},createBookmark:function(e,t){var i,n=this.document.createElement("span");return n.style.cssText="display:none;line-height:0px;",n.appendChild(this.document.createTextNode("")),n.id="_baidu_bookmark_start_"+(t?"":s++),this.collapsed||(i=n.cloneNode(!0),i.id="_baidu_bookmark_end_"+(t?"":s++)),this.insertNode(n),i&&this.collapse().insertNode(i).setEndBefore(i),this.setStartAfter(n),{start:e?n.id:n,end:i?e?i.id:i:null,id:e}},moveToBookmark:function(e){var t=e.id?this.document.getElementById(e.start):e.start,i=e.end&&e.id?this.document.getElementById(e.end):e.end;return this.setStartBefore(t),domUtils.remove(t),i?(this.setEndBefore(i),domUtils.remove(i)):this.collapse(!0),this},adjustmentBoundary:function(){if(!this.collapsed){for(;!domUtils.isBody(this.startContainer)&&this.startOffset==this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length&&this.startContainer[3==this.startContainer.nodeType?"nodeValue":"childNodes"].length;)this.setStartAfter(this.startContainer);for(;!domUtils.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},getClosedNode:function(){var e;if(!this.collapsed){var i=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(t(i)){var n=i.startContainer.childNodes[i.startOffset];n&&1==n.nodeType&&(dtd.$empty[n.tagName]||dtd.$nonChild[n.tagName])&&(e=n)}}return e},select:browser.ie?function(e,t){var i;this.collapsed||this.shrinkBoundary();var a=this.getClosedNode();if(a&&!t){try{i=this.document.body.createControlRange(),i.addElement(a),i.select()}catch(e){}return this}var s,c=this.createBookmark(),u=c.start;if(i=this.document.body.createTextRange(),i.moveToElementText(u),i.moveStart("character",1),this.collapsed){if(!e&&3!=this.startContainer.nodeType){var d=this.document.createTextNode(l),h=this.document.createElement("span");h.appendChild(this.document.createTextNode(l)),u.parentNode.insertBefore(h,u),u.parentNode.insertBefore(d,u),n(this.document,d),o=d,r(h,"previousSibling"),r(u,"nextSibling"),i.moveStart("character",-1),i.collapse(!0)}}else{var p=this.document.body.createTextRange();s=c.end,p.moveToElementText(s),i.setEndPoint("EndToEnd",p)}this.moveToBookmark(c),h&&domUtils.remove(h);try{i.select()}catch(e){}return this}:function(e){var t,i=domUtils.getWindow(this.document),a=i.getSelection();if(browser.gecko?this.body.focus():i.focus(),a){if(a.removeAllRanges(),this.collapsed&&!e){var s=this.startContainer,c=s;1==s.nodeType&&(c=s.childNodes[this.startOffset]),3==s.nodeType&&this.startOffset||(c?c.previousSibling&&3==c.previousSibling.nodeType:s.lastChild&&3==s.lastChild.nodeType)||(t=this.document.createTextNode(l),this.insertNode(t),n(this.document,t),r(t,"previousSibling"),r(t,"nextSibling"),o=t,this.setStart(t,browser.webkit?1:0).collapse(!0))}var u=this.document.createRange();if(this.collapsed&&browser.opera&&1==this.startContainer.nodeType){var c=this.startContainer.childNodes[this.startOffset];if(c){for(;c&&domUtils.isBlockElm(c)&&1==c.nodeType&&c.childNodes[0];)c=c.childNodes[0];c&&this.setStartBefore(c).collapse(!0)}else(c=this.startContainer.lastChild)&&domUtils.isBr(c)&&this.setStartBefore(c).collapse(!0)}!function(e){function t(t,i,n){3==t.nodeType&&t.nodeValue.length<i&&(e[n+"Offset"]=t.nodeValue.length)}t(e.startContainer,e.startOffset,"start"),t(e.endContainer,e.endOffset,"end")}(this),u.setStart(this.startContainer,this.startOffset),u.setEnd(this.endContainer,this.endOffset),a.addRange(u)}return this},createAddress:function(e,t){function i(e){for(var i,n=e?r.startContainer:r.endContainer,a=domUtils.findParents(n,!0,function(e){return!domUtils.isBody(e)}),o=[],s=0;i=a[s++];)o.push(domUtils.getNodeIndex(i,t));var l=0;if(t)if(3==n.nodeType){for(var c=n.previousSibling;c&&3==c.nodeType;)l+=c.nodeValue.replace(fillCharReg,"").length,c=c.previousSibling;l+=e?r.startOffset:r.endOffset}else if(n=n.childNodes[e?r.startOffset:r.endOffset])l=domUtils.getNodeIndex(n,t);else{n=e?r.startContainer:r.endContainer;for(var u=n.firstChild;u;)if(domUtils.isFillChar(u))u=u.nextSibling;else if(l++,3==u.nodeType)for(;u&&3==u.nodeType;)u=u.nextSibling;else u=u.nextSibling}else l=e?domUtils.isFillChar(n)?0:r.startOffset:r.endOffset;return l<0&&(l=0),o.push(l),o}var n={},r=this;return n.startAddress=i(!0),e||(n.endAddress=r.collapsed?[].concat(n.startAddress):i()),n},moveToAddress:function(e,t){function i(e,t){for(var i,r,a,o=n.body,s=0,l=e.length;s<l;s++)if(a=e[s],i=o,!(o=o.childNodes[a])){r=a;break}t?o?n.setStartBefore(o):n.setStart(i,r):o?n.setEndBefore(o):n.setEnd(i,r)}var n=this;return i(e.startAddress,!0),!t&&e.endAddress&&i(e.endAddress),n},equals:function(e){for(var t in this)if(this.hasOwnProperty(t)&&this[t]!==e[t])return!1;return!0},scrollIntoView:function(){var e=$('<span style="padding:0;margin:0;display:block;border:0"> </span>');this.cloneRange().insertNode(e.get(0));var t=$(window).scrollTop(),i=$(window).height(),n=e.offset().top;(n<t-i||n>t+i)&&(n>t+i?window.scrollTo(0,n-i+e.height()):window.scrollTo(0,t-n)),e.remove()},getOffset:function(){var e=this.createBookmark(),t=$(e.start).css("display","inline-block").offset();return this.moveToBookmark(e),t}}}(),function(){function e(e,t){var i=domUtils.getNodeIndex;e=e.duplicate(),e.collapse(t);var n=e.parentElement();if(!n.hasChildNodes())return{container:n,offset:0};for(var r,a,o=n.children,s=e.duplicate(),l=0,c=o.length-1,u=-1;l<=c;){u=Math.floor((l+c)/2),r=o[u],s.moveToElementText(r);var d=s.compareEndPoints("StartToStart",e);if(d>0)c=u-1;else{if(!(d<0))return{container:n,offset:i(r)};l=u+1}}if(-1==u){if(s.moveToElementText(n),s.setEndPoint("StartToStart",e),a=s.text.replace(/(\r\n|\r)/g,"\n").length,o=n.childNodes,!a)return r=o[o.length-1],{container:r,offset:r.nodeValue.length};for(var h=o.length;a>0;)a-=o[--h].nodeValue.length;return{container:o[h],offset:-a}}if(s.collapse(d>0),s.setEndPoint(d>0?"StartToStart":"EndToStart",e),!(a=s.text.replace(/(\r\n|\r)/g,"\n").length))return dtd.$empty[r.tagName]||dtd.$nonChild[r.tagName]?{container:n,offset:i(r)+(d>0?0:1)}:{container:r,offset:d>0?0:r.childNodes.length};for(;a>0;)try{var p=r;r=r[d>0?"previousSibling":"nextSibling"],a-=r.nodeValue.length}catch(e){return{container:n,offset:i(p)}}return{container:r,offset:d>0?-a:r.nodeValue.length+a}}function t(t,i){if(t.item)i.selectNode(t.item(0));else{var n=e(t,!0);i.setStart(n.container,n.offset),0!=t.compareEndPoints("StartToEnd",t)&&(n=e(t,!1),i.setEnd(n.container,n.offset))}return i}function i(e,t){var i;try{i=e.getNative(t).createRange()}catch(e){return null}var n=i.item?i.item(0):i.parentElement();return(n.ownerDocument||n)===e.document?i:null}(dom.Selection=function(e,t){var n=this;n.document=e,n.body=t,browser.ie9below&&$(t).on("beforedeactivate",function(){n._bakIERange=n.getIERange()}).on("activate",function(){try{var e=i(n);e&&n.rangeInBody(e)||!n._bakIERange||n._bakIERange.select()}catch(e){}n._bakIERange=null})}).prototype={hasNativeRange:function(){var e;if(!browser.ie||browser.ie9above){var t=this.getNative();if(!t.rangeCount)return!1;e=t.getRangeAt(0)}else e=i(this);return this.rangeInBody(e)},getNative:function(e){var t=this.document;try{return t?browser.ie9below||e?t.selection:domUtils.getWindow(t).getSelection():null}catch(e){return null}},getIERange:function(e){var t=i(this,e);return t&&this.rangeInBody(t,e)||!this._bakIERange?t:this._bakIERange},rangeInBody:function(e,t){var i=browser.ie9below||t?e.item?e.item():e.parentElement():e.startContainer;return i===this.body||domUtils.inDoc(i,this.body)},cache:function(){this.clear(),this._cachedRange=this.getRange(),this._cachedStartElement=this.getStart(),this._cachedStartElementPath=this.getStartElementPath()},getStartElementPath:function(){if(this._cachedStartElementPath)return this._cachedStartElementPath;var e=this.getStart();return e?domUtils.findParents(e,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){return this.hasNativeRange()},getRange:function(){function e(e){for(var t=i.body.firstChild,n=e.collapsed;t&&t.firstChild;)e.setStart(t,0),t=t.firstChild;e.startContainer||e.setStart(i.body,0),n&&e.collapse(!0)}var i=this;if(null!=i._cachedRange)return this._cachedRange;var n=new dom.Range(i.document,i.body);if(browser.ie9below){var r=i.getIERange();if(r&&this.rangeInBody(r))try{t(r,n)}catch(t){e(n)}else e(n)}else{var a=i.getNative();if(a&&a.rangeCount&&i.rangeInBody(a.getRangeAt(0))){var o=a.getRangeAt(0),s=a.getRangeAt(a.rangeCount-1);n.setStart(o.startContainer,o.startOffset).setEnd(s.endContainer,s.endOffset),n.collapsed&&domUtils.isBody(n.startContainer)&&!n.startOffset&&e(n)}else{if(this._bakRange&&(this._bakRange.startContainer===this.body||domUtils.inDoc(this._bakRange.startContainer,this.body)))return this._bakRange;e(n)}}return this._bakRange=n},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var e,t,i,n,r=browser.ie9below?this.getIERange():this.getRange();if(browser.ie9below){if(!r)return this.document.body.firstChild;if(r.item)return r.item(0);for(e=r.duplicate(),e.text.length>0&&e.moveStart("character",1),e.collapse(1),t=e.parentElement(),n=i=r.parentElement();i=i.parentNode;)if(i==t){t=n;break}}else if(t=r.startContainer,1==t.nodeType&&t.hasChildNodes()&&(t=t.childNodes[Math.min(t.childNodes.length-1,r.startOffset)]),3==t.nodeType)return t.parentNode;return t},getText:function(){var e,t;return this.isFocus()&&(e=this.getNative())?(t=browser.ie9below?e.createRange():e.getRangeAt(0),browser.ie9below?t.text:t.toString()):""}}}(),function(){function e(e,t){var i;if(t.textarea)if(utils.isString(t.textarea)){for(var n,r=0,a=domUtils.getElementsByTagName(e,"textarea");n=a[r++];)if(n.id=="umeditor_textarea_"+t.options.textarea){i=n;break}}else i=t.textarea;i||(e.appendChild(i=domUtils.createElement(document,"textarea",{name:t.options.textarea,id:"umeditor_textarea_"+t.options.textarea,style:"display:none"})),t.textarea=i),i.value=t.hasContents()?t.options.allHtmlEnabled?t.getAllHtml():t.getContent(null,null,!0):""}function t(e){for(var t in UM.plugins)-1==e.options.excludePlugins.indexOf(t)&&(UM.plugins[t].call(e),e.plugins[t]=1);e.langIsReady=!0,e.fireEvent("langReady")}function i(e){for(var t in e)return t}var n,r=0,a=UM.Editor=function(e){var n=this;n.uid=r++,EventBase.call(n),n.commands={},n.options=utils.extend(utils.clone(e||{}),UMEDITOR_CONFIG,!0),n.shortcutkeys={},n.inputRules=[],n.outputRules=[],n.setOpt({isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,textarea:"editorValue",focus:!1,focusInEnd:!0,autoClearEmptyNode:!0,fullscreen:!1,readonly:!1,zIndex:999,enterTag:"p",lang:"zh-cn",langPath:n.options.UMEDITOR_HOME_URL+"lang/",theme:"default",themePath:n.options.UMEDITOR_HOME_URL+"themes/",allHtmlEnabled:!1,autoSyncData:!0,autoHeightEnabled:!0,excludePlugins:""}),n.plugins={},utils.isEmptyObject(UM.I18N)?utils.loadFile(document,{src:n.options.langPath+n.options.lang+"/"+n.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){t(n)}):(n.options.lang=i(UM.I18N),t(n))};a.prototype={ready:function(e){var t=this;e&&(t.isReady?e.apply(t):t.addListener("ready",e))},setOpt:function(e,t){var i={};utils.isString(e)?i[e]=t:i=e,utils.extend(this.options,i,!0)},getOpt:function(e){return this.options[e]||""},destroy:function(){var e=this;e.fireEvent("destroy");var t=e.container.parentNode;t===document.body&&(t=e.container);var i=e.textarea;i?i.style.display="":(i=document.createElement("textarea"),t.parentNode.insertBefore(i,t)),i.style.width=e.body.offsetWidth+"px",i.style.height=e.body.offsetHeight+"px",i.value=e.getContent(),i.id=e.key,t.contains(i)&&$(i).insertBefore(t),t.innerHTML="",domUtils.remove(t),UM.clearCache(e.id);for(var n in e)e.hasOwnProperty(n)&&delete this[n]},initialCont:function(e){if(e){if(e.getAttribute("name")&&(this.options.textarea=e.getAttribute("name")),e&&/script|textarea/gi.test(e.tagName)){var t=document.createElement("div");e.parentNode.insertBefore(t,e),this.options.initialContent=UM.htmlparser(e.value||e.innerHTML||this.options.initialContent).toHtml(),e.className&&(t.className=e.className),e.style.cssText&&(t.style.cssText=e.style.cssText),/textarea/i.test(e.tagName)?(this.textarea=e,this.textarea.style.display="none"):(e.parentNode.removeChild(e),e.id&&(t.id=e.id)),e=t,e.innerHTML=""}return e}return null},render:function(e){var t=this,i=t.options,n=function(t){return parseInt($(e).css(t))};if(utils.isString(e)&&(e=document.getElementById(e)),e){this.id=e.getAttribute("id"),UM.setEditor(this),utils.cssRule("edui-style-body",t.options.initialStyle,document),e=this.initialCont(e),e.className+=" edui-body-container",i.initialFrameWidth?i.minFrameWidth=i.initialFrameWidth:i.minFrameWidth=i.initialFrameWidth=$(e).width()||UM.defaultWidth,i.initialFrameHeight?i.minFrameHeight=i.initialFrameHeight:i.initialFrameHeight=i.minFrameHeight=$(e).height()||UM.defaultHeight,e.style.width=/%$/.test(i.initialFrameWidth)?"100%":i.initialFrameWidth-n("padding-left")-n("padding-right")+"px";var r=/%$/.test(i.initialFrameHeight)?"100%":i.initialFrameHeight-n("padding-top")-n("padding-bottom");this.options.autoHeightEnabled?(e.style.minHeight=r+"px",e.style.height="",browser.ie&&browser.version<=6&&(e.style.height=r,e.style.setExpression("height","this.scrollHeight <= "+r+' ? "'+r+'px" : "auto"'))):$(e).height(r),e.style.zIndex=i.zIndex,this._setup(e)}},_setup:function(t){var i=this,n=i.options;t.contentEditable=!0,document.body.spellcheck=!1,i.document=document,i.window=document.defaultView||document.parentWindow,i.body=t,i.$body=$(t),i.selection=new dom.Selection(document,i.body),i._isEnabled=!1;var r;browser.gecko&&(r=this.selection.getNative())&&r.removeAllRanges(),this._initEvents();for(var a=t.parentNode;a&&!domUtils.isBody(a);a=a.parentNode)if("FORM"==a.tagName){i.form=a,i.options.autoSyncData?$(t).on("blur",function(){e(a,i)}):$(a).on("submit",function(){e(this,i)});break}if(n.initialContent)if(n.autoClearinitialContent){var o=i.execCommand;i.execCommand=function(){return i.fireEvent("firstBeforeExecCommand"),o.apply(i,arguments)},this._setDefaultContent(n.initialContent)}else this.setContent(n.initialContent,!1,!0);domUtils.isEmptyNode(i.body)&&(i.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>"),n.focus&&setTimeout(function(){i.focus(i.options.focusInEnd),!i.options.autoClearinitialContent&&i._selectionChange()},0),i.container||(i.container=t.parentNode),i._bindshortcutKeys(),i.isReady=1,i.fireEvent("ready"),n.onready&&n.onready.call(i),browser.ie&&!browser.ie9above||$(i.body).on("blur focus",function(e){var t=i.selection.getNative();if("blur"==e.type)t.rangeCount>0&&(i._bakRange=t.getRangeAt(0));else{try{i._bakRange&&t.addRange(i._bakRange)}catch(e){}i._bakRange=null}}),!n.isShow&&i.setHide(),n.readonly&&i.setDisabled()},sync:function(t){var i=this,n=t?document.getElementById(t):domUtils.findParent(i.body.parentNode,function(e){return"FORM"==e.tagName},!0);n&&e(n,i)},setHeight:function(e,t){!t&&(this.options.initialFrameHeight=e),this.options.autoHeightEnabled?($(this.body).css({"min-height":e+"px"}),browser.ie&&browser.version<=6&&this.container&&(this.container.style.height=e,this.container.style.setExpression("height","this.scrollHeight <= "+e+' ? "'+e+'px" : "auto"'))):$(this.body).height(e),this.fireEvent("resize")},setWidth:function(e){this.$container&&this.$container.width(e),$(this.body).width(e-1*$(this.body).css("padding-left").replace("px","")-1*$(this.body).css("padding-right").replace("px","")),this.fireEvent("resize")},addshortcutkey:function(e,t){var i={};t?i[e]=t:i=e,utils.extend(this.shortcutkeys,i)},_bindshortcutKeys:function(){var e=this,t=this.shortcutkeys;e.addListener("keydown",function(i,n){var r=n.keyCode||n.which;for(var a in t)for(var o,s=t[a].split(","),l=0;o=s[l++];){o=o.split(":");var c=o[0],u=o[1];(/^(ctrl)(\+shift)?\+(\d+)$/.test(c.toLowerCase())||/^(\d+)$/.test(c))&&(("ctrl"==RegExp.$1?n.ctrlKey||n.metaKey:0)&&(""!=RegExp.$2?n[RegExp.$2.slice(1)+"Key"]:1)&&r==RegExp.$3||r==RegExp.$1)&&(-1!=e.queryCommandState(a,u)&&e.execCommand(a,u),domUtils.preventDefault(n))}})},getContent:function(e,t,i,n,r){var a=this;if(e&&utils.isFunction(e)&&(t=e,e=""),t?!t():!this.hasContents())return"";a.fireEvent("beforegetcontent");var o=UM.htmlparser(a.body.innerHTML,n);return a.filterOutputRule(o),a.fireEvent("aftergetcontent",o),o.toHtml(r)},getAllHtml:function(){var e=this,t=[];if(e.fireEvent("getAllHtml",t),browser.ie&&browser.version>8){var i="";utils.each(e.document.styleSheets,function(e){i+=e.href?'<link rel="stylesheet" type="text/css" href="'+e.href+'" />':"<style>"+e.cssText+"</style>"}),utils.each(e.document.getElementsByTagName("script"),function(e){i+=e.outerHTML})}return"<html><head>"+(e.options.charset?'<meta http-equiv="Content-Type" content="text/html; charset='+e.options.charset+'"/>':"")+(i||e.document.getElementsByTagName("head")[0].innerHTML)+t.join("\n")+"</head><body "+(ie&&browser.version<9?'class="view"':"")+">"+e.getContent(null,null,!0)+"</body></html>"},getPlainTxt:function(){var e=new RegExp(domUtils.fillChar,"g"),t=this.body.innerHTML.replace(/[\n\r]/g,"");return t=t.replace(/<(p|div)[^>]*>(<br\/?>| )<\/\1>/gi,"\n").replace(/<br\/?>/gi,"\n").replace(/<[^>/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(e,t,i){return dtd.$block[i]?"\n":t||""}),t.replace(e,"").replace(/\u00a0/g," ").replace(/ /g," ")},getContentTxt:function(){var e=new RegExp(domUtils.fillChar,"g");return this.body[browser.ie?"innerText":"textContent"].replace(e,"").replace(/\u00a0/g," ")},setContent:function(t,i,n){var r=this;r.fireEvent("beforesetcontent",t);var a=UM.htmlparser(t);if(r.filterInputRule(a),t=a.toHtml(),r.body.innerHTML=(i?r.body.innerHTML:"")+t,"p"==r.options.enterTag){var o,s=this.body.firstChild;if(!s||1==s.nodeType&&(dtd.$cdata[s.tagName]||function(e){return"DIV"==e.tagName&&e.getAttribute("cdata_tag")}(s)||domUtils.isCustomeNode(s))&&s===this.body.lastChild)this.body.innerHTML="<p>"+(browser.ie?" ":"<br/>")+"</p>"+this.body.innerHTML;else for(var l=r.document.createElement("p");s;){for(;s&&(3==s.nodeType||1==s.nodeType&&dtd.p[s.tagName]&&!dtd.$cdata[s.tagName]);)o=s.nextSibling,l.appendChild(s),s=o;if(l.firstChild){if(!s){r.body.appendChild(l);break}s.parentNode.insertBefore(l,s),l=r.document.createElement("p")}s=s.nextSibling}}r.fireEvent("aftersetcontent"),r.fireEvent("contentchange"),!n&&r._selectionChange(),r._bakRange=r._bakIERange=r._bakNativeRange=null;var c;browser.gecko&&(c=this.selection.getNative())&&c.removeAllRanges(),r.options.autoSyncData&&r.form&&e(r.form,r)},focus:function(e){try{var t=this,i=t.selection.getRange();e?i.setStartAtLast(t.body.lastChild).setCursor(!1,!0):i.select(!0),this.fireEvent("focus")}catch(e){}},blur:function(){var e=this.selection.getNative();e.empty?e.empty():e.removeAllRanges(),this.fireEvent("blur")},isFocus:function(){return!0===this.fireEvent("isfocus")||this.selection.isFocus()},_initEvents:function(){var e=this,t=e.body,i=function(){e._proxyDomEvent.apply(e,arguments)};$(t).on("click contextmenu mousedown keydown keyup keypress mouseup mouseover mouseout selectstart",i).on("focus blur",i).on("mouseup keydown",function(t){"keydown"==t.type&&(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)||2!=t.button&&e._selectionChange(250,t)})},_proxyDomEvent:function(e){return this.fireEvent(e.type.replace(/^on/,""),e)},_selectionChange:function(e,t){var i,r,a=this,o=!1;if(browser.ie&&browser.version<9&&t&&"mouseup"==t.type){this.selection.getRange().collapsed||(o=!0,i=t.clientX,r=t.clientY)}clearTimeout(n),n=setTimeout(function(){if(a.selection.getNative()){var e;if(o&&"None"==a.selection.getNative().type){e=a.document.body.createTextRange();try{e.moveToPoint(i,r)}catch(t){e=null}}var n;e&&(n=a.selection.getIERange,a.selection.getIERange=function(){return e}),a.selection.cache(),n&&(a.selection.getIERange=n),a.selection._cachedRange&&a.selection._cachedStartElement&&(a.fireEvent("beforeselectionchange"),a.fireEvent("selectionchange",!!t),a.fireEvent("afterselectionchange"),a.selection.clear())}},e||50)},_callCmdFn:function(e,t){t=Array.prototype.slice.call(t,0);var i,n,r=t.shift().toLowerCase();return i=this.commands[r]||UM.commands[r],n=i&&i[e],i&&n||"queryCommandState"!=e?n?n.apply(this,[r].concat(t)):void 0:0},execCommand:function(e){if(!this.isFocus()){var t=this.selection._bakRange;t?t.select():this.focus(!0)}
|
||
e=e.toLowerCase();var i,n=this,r=n.commands[e]||UM.commands[e];return r&&r.execCommand?(r.notNeedUndo||n.__hasEnterExecCommand?(i=this._callCmdFn("execCommand",arguments),!n.__hasEnterExecCommand&&!r.ignoreContentChange&&!n._ignoreContentChange&&n.fireEvent("contentchange")):(n.__hasEnterExecCommand=!0,-1!=n.queryCommandState.apply(n,arguments)&&(n.fireEvent("saveScene"),n.fireEvent("beforeexeccommand",e),i=this._callCmdFn("execCommand",arguments),!r.ignoreContentChange&&!n._ignoreContentChange&&n.fireEvent("contentchange"),n.fireEvent("afterexeccommand",e),n.fireEvent("saveScene")),n.__hasEnterExecCommand=!1),!n.__hasEnterExecCommand&&!r.ignoreContentChange&&!n._ignoreContentChange&&n._selectionChange(),i):null},queryCommandState:function(e){try{return this._callCmdFn("queryCommandState",arguments)}catch(e){return 0}},queryCommandValue:function(e){try{return this._callCmdFn("queryCommandValue",arguments)}catch(e){return null}},hasContents:function(e){if(e)for(var t,i=0;t=e[i++];)if(this.body.getElementsByTagName(t).length>0)return!0;if(!domUtils.isEmptyBlock(this.body))return!0;for(e=["div"],i=0;t=e[i++];)for(var n,r=domUtils.getElementsByTagName(this.body,t),a=0;n=r[a++];)if(domUtils.isCustomeNode(n))return!0;return!1},reset:function(){this.fireEvent("reset")},isEnabled:function(){return 1!=this._isEnabled},setEnabled:function(){var e,t=this;if(t.body.contentEditable=!0,t.lastBk){e=t.selection.getRange();try{e.moveToBookmark(t.lastBk),delete t.lastBk}catch(i){e.setStartAtFirst(t.body).collapse(!0)}e.select(!0)}t.bkqueryCommandState&&(t.queryCommandState=t.bkqueryCommandState,delete t.bkqueryCommandState),t._bkproxyDomEvent&&(t._proxyDomEvent=t._bkproxyDomEvent,delete t._bkproxyDomEvent),t.fireEvent("setEnabled")},enable:function(){return this.setEnabled()},setDisabled:function(e,t){var i=this;i.body.contentEditable=!1,i._except=e?utils.isArray(e)?e:[e]:[],i.lastBk||(i.lastBk=i.selection.getRange().createBookmark(!0)),i.bkqueryCommandState||(i.bkqueryCommandState=i.queryCommandState,i.queryCommandState=function(e){return-1!=utils.indexOf(i._except,e)?i.bkqueryCommandState.apply(i,arguments):-1}),t||i._bkproxyDomEvent||(i._bkproxyDomEvent=i._proxyDomEvent,i._proxyDomEvent=function(){return!1}),i.fireEvent("selectionchange"),i.fireEvent("setDisabled",i._except)},disable:function(e){return this.setDisabled(e)},_setDefaultContent:function(){function e(){var t=this;t.document.getElementById("initContent")&&(t.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>",t.removeListener("firstBeforeExecCommand focus",e),setTimeout(function(){t.focus(),t._selectionChange()},0))}return function(t){var i=this;i.body.innerHTML='<p id="initContent">'+t+"</p>",i.addListener("firstBeforeExecCommand focus",e)}}(),setShow:function(){var e=this,t=e.selection.getRange();if("none"==e.container.style.display){try{t.moveToBookmark(e.lastBk),delete e.lastBk}catch(i){t.setStartAtFirst(e.body).collapse(!0)}setTimeout(function(){t.select(!0)},100),e.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){var e=this;e.lastBk||(e.lastBk=e.selection.getRange().createBookmark(!0)),e.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(e){var t=UM.I18N[this.options.lang];if(!t)throw Error("not import language file");e=(e||"").split(".");for(var i,n=0;(i=e[n++])&&(t=t[i]););return t},getContentLength:function(e,t){var i=this.getContent(!1,!1,!0).length;if(e){t=(t||[]).concat(["hr","img","iframe"]),i=this.getContentTxt().replace(/[\t\r\n]+/g,"").length;for(var n,r=0;n=t[r++];)i+=this.body.getElementsByTagName(n).length}return i},addInputRule:function(e,t){e.ignoreUndo=t,this.inputRules.push(e)},filterInputRule:function(e,t){for(var i,n=0;i=this.inputRules[n++];)t&&i.ignoreUndo||i.call(this,e)},addOutputRule:function(e,t){e.ignoreUndo=t,this.outputRules.push(e)},filterOutputRule:function(e,t){for(var i,n=0;i=this.outputRules[n++];)t&&i.ignoreUndo||i.call(this,e)}},utils.inherits(a,EventBase)}();var filterWord=UM.filterWord=function(){function e(e){return/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<(v|o):|lang=)/gi.test(e)}function t(e){return e=e.replace(/[\d.]+\w+/g,function(e){return utils.transUnitToPx(e)})}function i(e){return e.replace(/[\t\r\n]+/g," ").replace(/<!--[\s\S]*?-->/gi,"").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,function(e){if(browser.opera)return"";try{if(/Bitmap/i.test(e))return"";var i=e.match(/width:([ \d.]*p[tx])/i)[1],n=e.match(/height:([ \d.]*p[tx])/i)[1],r=e.match(/src=\s*"([^"]*)"/i)[1];return'<img width="'+t(i)+'" height="'+t(n)+'" src="'+r+'" />'}catch(e){return""}}).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi,function(e,t,i,n){return"class"==t&&"MsoListParagraph"==n?e:""}).replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi,function(e,t,i){return i.replace(/[\t\r\n ]+/g," ")}).replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(e,i,n,r){for(var a,o=[],s=r.replace(/^\s+|\s+$/,"").replace(/'/g,"'").replace(/"/gi,"'").split(/;\s*/g),l=0;a=s[l];l++){var c,u,d=a.split(":");if(2==d.length){if(c=d[0].toLowerCase(),u=d[1].toLowerCase(),/^(background)\w*/.test(c)&&0==u.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(c)&&/^0\w+$/.test(u))continue;switch(c){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":/<table/.test(i)||(o[l]=c.replace(/^mso-|-alt$/g,"")+":"+t(u));continue;case"horiz-align":o[l]="text-align:"+u;continue;case"vert-align":o[l]="vertical-align:"+u;continue;case"font-color":case"mso-foreground":o[l]="color:"+u;continue;case"mso-background":case"mso-highlight":o[l]="background:"+u;continue;case"mso-default-height":o[l]="min-height:"+t(u);continue;case"mso-default-width":o[l]="min-width:"+t(u);continue;case"mso-padding-between-alt":o[l]="border-collapse:separate;border-spacing:"+t(u);continue;case"text-line-through":"single"!=u&&"double"!=u||(o[l]="text-decoration:line-through");continue;case"mso-zero-height":"yes"==u&&(o[l]="display:none");continue;case"margin":if(!/[1-9]/.test(u))continue}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?:decor|trans)|top-bar|version|vnd|word-break)/.test(c)||/text\-indent|padding|margin/.test(c)&&/\-[\d.]+/.test(u))continue;o[l]=c+":"+d[1]}}return i+(o.length?' style="'+o.join(";").replace(/;{2,}/g,";")+'"':"")}).replace(/[\d.]+(cm|pt)/g,function(e){return utils.transUnitToPx(e)})}return function(t){return e(t)?i(t):t}}();!function(){function e(e,t,i){return e.push(p),t+(i?1:-1)}function t(e,t){for(var i=0;i<t;i++)e.push(h)}function i(o,s,l,c){switch(o.type){case"root":for(var u,d=0;u=o.children[d++];)l&&"element"==u.type&&!dtd.$inlineWithA[u.tagName]&&d>1&&(e(s,c,!0),t(s,c)),i(u,s,l,c);break;case"text":n(o,s);break;case"element":r(o,s,l,c);break;case"comment":a(o,s)}return s}function n(e,t){"pre"==e.parentNode.tagName?t.push(e.data):t.push(d[e.parentNode.tagName]?utils.html(e.data):e.data.replace(/[ ]{2}/g," "))}function r(n,r,a,o){var s="";if(n.attrs){s=[];var l=n.attrs;for(var c in l)s.push(c+(void 0!==l[c]?'="'+(u[c]?utils.html(l[c]).replace(/["]/g,function(e){return"""}):utils.unhtml(l[c]))+'"':""));s=s.join(" ")}if(r.push("<"+n.tagName+(s?" "+s:"")+(dtd.$empty[n.tagName]?"/":"")+">"),a&&!dtd.$inlineWithA[n.tagName]&&"pre"!=n.tagName&&n.children&&n.children.length&&(o=e(r,o,!0),t(r,o)),n.children&&n.children.length)for(var d,h=0;d=n.children[h++];)a&&"element"==d.type&&!dtd.$inlineWithA[d.tagName]&&h>1&&(e(r,o),t(r,o)),i(d,r,a,o);dtd.$empty[n.tagName]||(a&&!dtd.$inlineWithA[n.tagName]&&"pre"!=n.tagName&&n.children&&n.children.length&&(o=e(r,o),t(r,o)),r.push("</"+n.tagName+">"))}function a(e,t){t.push("\x3c!--"+e.data+"--\x3e")}function o(e,t){var i;if("element"==e.type&&e.getAttr("id")==t)return e;if(e.children&&e.children.length)for(var n,r=0;n=e.children[r++];)if(i=o(n,t))return i}function s(e,t,i){if("element"==e.type&&e.tagName==t&&i.push(e),e.children&&e.children.length)for(var n,r=0;n=e.children[r++];)s(n,t,i)}function l(e,t){if(e.children&&e.children.length)for(var i,n=0;i=e.children[n];)l(i,t),i.parentNode&&(i.children&&i.children.length&&t(i),i.parentNode&&n++);else t(e)}var c=UM.uNode=function(e){this.type=e.type,this.data=e.data,this.tagName=e.tagName,this.parentNode=e.parentNode,this.attrs=e.attrs||{},this.children=e.children},u={href:1,src:1,_src:1,_href:1,cdata_data:1},d={style:1,script:1},h=" ",p="\n";c.createElement=function(e){return/[<>]/.test(e)?UM.htmlparser(e).children[0]:new c({type:"element",children:[],tagName:e})},c.createText=function(e,t){return new UM.uNode({type:"text",data:t?e:utils.unhtml(e||"")})},c.prototype={toHtml:function(e){var t=[];return i(this,t,e,0),t.join("")},innerHTML:function(e){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(utils.isString(e)){if(this.children)for(var t,i=0;t=this.children[i++];)t.parentNode=null;this.children=[];for(var t,n=UM.htmlparser(e),i=0;t=n.children[i++];)this.children.push(t),t.parentNode=this;return this}var n=new UM.uNode({type:"root",children:this.children});return n.toHtml()},innerText:function(e,t){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(e){if(this.children)for(var i,n=0;i=this.children[n++];)i.parentNode=null;return this.children=[],this.appendChild(c.createText(e,t)),this}return this.toHtml().replace(/<[^>]+>/g,"")},getData:function(){return"element"==this.type?"":this.data},firstChild:function(){return this.children?this.children[0]:null},lastChild:function(){return this.children?this.children[this.children.length-1]:null},previousSibling:function(){for(var e,t=this.parentNode,i=0;e=t.children[i];i++)if(e===this)return 0==i?null:t.children[i-1]},nextSibling:function(){for(var e,t=this.parentNode,i=0;e=t.children[i++];)if(e===this)return t.children[i]},replaceChild:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var i,n=0;i=this.children[n];n++)if(i===t)return this.children.splice(n,1,e),t.parentNode=null,e.parentNode=this,e}},appendChild:function(e){if("root"==this.type||"element"==this.type&&!dtd.$empty[this.tagName]){this.children||(this.children=[]),e.parentNode&&e.parentNode.removeChild(e);for(var t,i=0;t=this.children[i];i++)if(t===e){this.children.splice(i,1);break}return this.children.push(e),e.parentNode=this,e}},insertBefore:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var i,n=0;i=this.children[n];n++)if(i===t)return this.children.splice(n,0,e),e.parentNode=this,e}},insertAfter:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var i,n=0;i=this.children[n];n++)if(i===t)return this.children.splice(n+1,0,e),e.parentNode=this,e}},removeChild:function(e,t){if(this.children)for(var i,n=0;i=this.children[n];n++)if(i===e){if(this.children.splice(n,1),i.parentNode=null,t&&i.children&&i.children.length)for(var r,a=0;r=i.children[a];a++)this.children.splice(n+a,0,r),r.parentNode=this;return i}},getAttr:function(e){return this.attrs&&this.attrs[e.toLowerCase()]},setAttr:function(e,t){if(!e)return void delete this.attrs;if(this.attrs||(this.attrs={}),utils.isObject(e))for(var i in e)e[i]?this.attrs[i.toLowerCase()]=e[i]:delete this.attrs[i];else t?this.attrs[e.toLowerCase()]=t:delete this.attrs[e]},hasAttr:function(e){var t=this.getAttr(e);return null!==t&&void 0!==t},getIndex:function(){for(var e,t=this.parentNode,i=0;e=t.children[i];i++)if(e===this)return i;return-1},getNodeById:function(e){var t;if(this.children&&this.children.length)for(var i,n=0;i=this.children[n++];)if(t=o(i,e))return t},getNodesByTagName:function(e){e=utils.trim(e).replace(/[ ]{2,}/g," ").split(" ");var t=[],i=this;return utils.each(e,function(e){if(i.children&&i.children.length)for(var n,r=0;n=i.children[r++];)s(n,e,t)}),t},getStyle:function(e){var t=this.getAttr("style");if(!t)return"";var i=new RegExp("(^|;)\\s*"+e+":([^;]+)","i"),n=t.match(i);return n&&n[0]?n[2]:""},setStyle:function(e,t){function i(e,t){var i=new RegExp("(^|;)\\s*"+e+":([^;]+;?)","gi");n=n.replace(i,"$1"),t&&(n=e+":"+utils.unhtml(t)+";"+n)}var n=this.getAttr("style");if(n||(n=""),utils.isObject(e))for(var r in e)i(r,e[r]);else i(e,t);this.setAttr("style",utils.trim(n))},hasClass:function(e){if(this.hasAttr("class")){var t=this.getAttr("class").split(/\s+/),i=!1;return $.each(t,function(t,n){n===e&&(i=!0)}),i}return!1},addClass:function(e){var t=null,i=!1;this.hasAttr("class")?(t=this.getAttr("class"),t=t.split(/\s+/),t.forEach(function(t){if(t===e)return void(i=!0)}),!i&&t.push(e),this.setAttr("class",t.join(" "))):this.setAttr("class",e)},removeClass:function(e){if(this.hasAttr("class")){var t=this.getAttr("class");t=t.replace(new RegExp("\\b"+e+"\\b","g"),""),this.setAttr("class",utils.trim(t).replace(/[ ]{2,}/g," "))}},traversal:function(e){return this.children&&this.children.length&&l(this,e),this}}}();var htmlparser=UM.htmlparser=function(e,t){function i(e,t){if(d[e.tagName]){var i=c.createElement(d[e.tagName]);e.appendChild(i),i.appendChild(c.createText(t)),e=i}else e.appendChild(c.createText(t))}function n(e,t,i){var r;if(r=u[t]){for(var o,s=e;"root"!=s.type;){if(utils.isArray(r)?-1!=utils.indexOf(r,s.tagName):r==s.tagName){e=s,o=!0;break}s=s.parentNode}o||(e=n(e,utils.isArray(r)?r[0]:r))}var d=new c({parentNode:e,type:"element",tagName:t.toLowerCase(),children:dtd.$empty[t]?null:[]});if(i){for(var h,p={};h=a.exec(i);)p[h[1].toLowerCase()]=l[h[1].toLowerCase()]?h[2]||h[3]||h[4]:utils.unhtml(h[2]||h[3]||h[4]);d.attrs=p}return e.children.push(d),dtd.$empty[t]?e:d}var r=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,a=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,o={b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1,sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1};e=e.replace(new RegExp(domUtils.fillChar,"g"),""),t||(e=e.replace(new RegExp("[\\r\\t\\n"+(t?"":" ")+"]*</?(\\w+)\\s*(?:[^>]*)>[\\r\\t\\n"+(t?"":" ")+"]*","g"),function(e,i){return i&&o[i.toLowerCase()]?e.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):e.replace(new RegExp("^[\\r\\n"+(t?"":" ")+"]+"),"").replace(new RegExp("[\\r\\n"+(t?"":" ")+"]+$"),"")}));for(var s,l={href:1,src:1},c=UM.uNode,u={td:"tr",tr:["tbody","thead","tfoot"],tbody:"table",th:"tr",thead:"table",tfoot:"table",caption:"table",li:["ul","ol"],dt:"dl",dd:"dl",option:"select"},d={ol:"li",ul:"li"},h=0,p=0,f=new c({type:"root",children:[]}),m=f;s=r.exec(e);){h=s.index;try{if(h>p&&i(m,e.slice(p,h)),s[3])dtd.$cdata[m.tagName]?i(m,s[0]):m=n(m,s[3].toLowerCase(),s[4]);else if(s[1]){if("root"!=m.type)if(dtd.$cdata[m.tagName]&&!dtd.$cdata[s[1]])i(m,s[0]);else{for(var g=m;"element"==m.type&&m.tagName!=s[1].toLowerCase();)if(m=m.parentNode,"root"==m.type)throw m=g,"break";m=m.parentNode}}else s[2]&&function(e,t){e.children.push(new c({type:"comment",data:t,parentNode:e}))}(m,s[2])}catch(e){}p=r.lastIndex}return p<e.length&&i(m,e.slice(p)),f},filterNode=UM.filterNode=function(){function e(t,i){switch(t.type){case"text":break;case"element":var n;if(n=i[t.tagName])if("-"===n)t.parentNode.removeChild(t);else if(utils.isFunction(n)){var r=t.parentNode,a=t.getIndex();if(n(t),t.parentNode){if(t.children)for(var o,s=0;o=t.children[s];)e(o,i),o.parentNode&&s++}else for(var o,s=a;o=r.children[s];)e(o,i),o.parentNode&&s++}else{var l=n.$;if(l&&t.attrs){var c,u={};for(var d in l){if(c=t.getAttr(d),"style"==d&&utils.isArray(l[d])){var h=[];utils.each(l[d],function(e){var i;(i=t.getStyle(e))&&h.push(e+":"+i)}),c=h.join(";")}c&&(u[d]=c)}t.attrs=u}if(t.children)for(var o,s=0;o=t.children[s];)e(o,i),o.parentNode&&s++}else if(dtd.$cdata[t.tagName])t.parentNode.removeChild(t);else{var r=t.parentNode,a=t.getIndex();t.parentNode.removeChild(t,!0);for(var o,s=a;o=r.children[s];)e(o,i),o.parentNode&&s++}break;case"comment":t.parentNode.removeChild(t)}}return function(t,i){if(utils.isEmptyObject(i))return t;var n;(n=i["-"])&&utils.each(n.split(" "),function(e){i[e]="-"});for(var r,a=0;r=t.children[a];)e(r,i),r.parentNode&&a++;return t}}();UM.commands.inserthtml={execCommand:function(e,t,i){var n,r,a=this;if(t&&!0!==a.fireEvent("beforeinserthtml",t)){if(n=a.selection.getRange(),r=n.document.createElement("div"),r.style.display="inline",!i){var o=UM.htmlparser(t);a.options.filterRules&&UM.filterNode(o,a.options.filterRules),a.filterInputRule(o),t=o.toHtml()}if(r.innerHTML=utils.trim(t),!n.collapsed){var s=n.startContainer;if(domUtils.isFillChar(s)&&n.setStartBefore(s),s=n.endContainer,domUtils.isFillChar(s)&&n.setEndAfter(s),n.txtToElmBoundary(),n.endContainer&&1==n.endContainer.nodeType&&(s=n.endContainer.childNodes[n.endOffset])&&domUtils.isBr(s)&&n.setEndAfter(s),0==n.startOffset&&(s=n.startContainer,domUtils.isBoundaryNode(s,"firstChild")&&(s=n.endContainer,n.endOffset==(3==s.nodeType?s.nodeValue.length:s.childNodes.length)&&domUtils.isBoundaryNode(s,"lastChild")&&(a.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",n.setStart(a.body.firstChild,0).collapse(!0)))),!n.collapsed&&n.deleteContents(),1==n.startContainer.nodeType){var l,c=n.startContainer.childNodes[n.startOffset];if(c&&domUtils.isBlockElm(c)&&(l=c.previousSibling)&&domUtils.isBlockElm(l)){for(n.setEnd(l,l.childNodes.length).collapse();c.firstChild;)l.appendChild(c.firstChild);domUtils.remove(c)}}}var c,u,l,d,h,p=0;for(n.inFillChar()&&(c=n.startContainer,domUtils.isFillChar(c)?(n.setStartBefore(c).collapse(!0),domUtils.remove(c)):domUtils.isFillChar(c,!0)&&(c.nodeValue=c.nodeValue.replace(fillCharReg,""),n.startOffset--,n.collapsed&&n.collapse(!0)));c=r.firstChild;){if(p){for(var f=a.document.createElement("p");c&&(3==c.nodeType||!dtd.$block[c.tagName]);)h=c.nextSibling,f.appendChild(c),c=h;f.firstChild&&(c=f)}if(n.insertNode(c),h=c.nextSibling,!p&&c.nodeType==domUtils.NODE_ELEMENT&&domUtils.isBlockElm(c)&&(u=domUtils.findParent(c,function(e){return domUtils.isBlockElm(e)}))&&"body"!=u.tagName.toLowerCase()&&(!dtd[u.tagName][c.nodeName]||c.parentNode!==u)){if(dtd[u.tagName][c.nodeName])for(d=c.parentNode;d!==u;)l=d,d=d.parentNode;else l=u;domUtils.breakParent(c,l||d);var l=c.previousSibling;domUtils.trimWhiteTextNode(l),l.childNodes.length||domUtils.remove(l),!browser.ie&&(m=c.nextSibling)&&domUtils.isBlockElm(m)&&m.lastChild&&!domUtils.isBr(m.lastChild)&&m.appendChild(a.document.createElement("br")),p=1}var m=c.nextSibling;if(!r.firstChild&&m&&domUtils.isBlockElm(m)){n.setStart(m,0).collapse(!0);break}n.setEndAfter(c).collapse()}if(c=n.startContainer,h&&domUtils.isBr(h)&&domUtils.remove(h),domUtils.isBlockElm(c)&&domUtils.isEmptyNode(c))if(h=c.nextSibling)domUtils.remove(c),1==h.nodeType&&dtd.$block[h.tagName]&&n.setStart(h,0).collapse(!0).shrinkBoundary();else try{c.innerHTML=browser.ie?domUtils.fillChar:"<br/>"}catch(e){n.setStartBefore(c),domUtils.remove(c)}try{if(browser.ie9below&&1==n.startContainer.nodeType&&!n.startContainer.childNodes[n.startOffset]){var g=n.startContainer,l=g.childNodes[n.startOffset-1];if(l&&1==l.nodeType&&dtd.$empty[l.tagName]){var v=this.document.createTextNode(domUtils.fillChar);n.insertNode(v).setStart(v,0).collapse(!0)}}setTimeout(function(){n.select(!0)})}catch(e){}setTimeout(function(){n=a.selection.getRange(),n.scrollIntoView(),a.fireEvent("afterinserthtml")},200)}}},UM.commands.insertimage={execCommand:function(e,t){if(t=utils.isArray(t)?t:[t],t.length){var i,n=this,r=[],a="";if(i=t[0],1==t.length)a='<img src="'+i.src+'" '+(i._src?' _src="'+i._src+'" ':"")+(i.width?'width="'+i.width+'" ':"")+(i.height?' height="'+i.height+'" ':"")+("left"==i.floatStyle||"right"==i.floatStyle?' style="float:'+i.floatStyle+';"':"")+(i.title&&""!=i.title?' title="'+i.title+'"':"")+(i.border&&"0"!=i.border?' border="'+i.border+'"':"")+(i.alt&&""!=i.alt?' alt="'+i.alt+'"':"")+(i.hspace&&"0"!=i.hspace?' hspace = "'+i.hspace+'"':"")+(i.vspace&&"0"!=i.vspace?' vspace = "'+i.vspace+'"':"")+"/>","center"==i.floatStyle&&(a='<p style="text-align: center">'+a+"</p>"),r.push(a);else for(var o=0;i=t[o++];)a="<p "+("center"==i.floatStyle?'style="text-align: center" ':"")+'><img src="'+i.src+'" '+(i.width?'width="'+i.width+'" ':"")+(i._src?' _src="'+i._src+'" ':"")+(i.height?' height="'+i.height+'" ':"")+' style="'+(i.floatStyle&&"center"!=i.floatStyle?"float:"+i.floatStyle+";":"")+(i.border||"")+'" '+(i.title?' title="'+i.title+'"':"")+" /></p>",r.push(a);n.execCommand("insertHtml",r.join(""),!0)}}},UM.plugins.justify=function(){var e=this;$.each("justifyleft justifyright justifycenter justifyfull".split(" "),function(t,i){e.commands[i]={execCommand:function(e){return this.document.execCommand(e)},queryCommandValue:function(e){var t=this.document.queryCommandValue(e);return!0===t||"true"===t?e.replace(/justify/,""):""},queryCommandState:function(e){return this.document.queryCommandState(e)?1:0}}})},UM.plugins.font=function(){var e=this,t={forecolor:"forecolor",backcolor:"backcolor",fontsize:"fontsize",fontfamily:"fontname"},i={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family"},n={forecolor:"color",fontsize:"size",fontfamily:"face"};e.setOpt({fontfamily:[{name:"songti",val:"宋体,SimSun"},{name:"yahei",val:"微软雅黑,Microsoft YaHei"},{name:"kaiti",val:"楷体,楷体_GB2312, SimKai"},{name:"heiti",val:"黑体, SimHei"},{name:"lishu",val:"隶书, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"},{name:"sans-serif",val:"sans-serif"}],fontsize:[10,12,16,18,24,32,48]}),e.addOutputRule(function(e){utils.each(e.getNodesByTagName("font"),function(e){if("font"==e.tagName){var t=[];for(var i in e.attrs)switch(i){case"size":var n=e.attrs[i];$.each({10:"1",12:"2",16:"3",18:"4",24:"5",32:"6",48:"7"},function(e,t){if(t==n)return n=e,!1}),t.push("font-size:"+n+"px");break;case"color":t.push("color:"+e.attrs[i]);break;case"face":t.push("font-family:"+e.attrs[i]);break;case"style":t.push(e.attrs[i])}e.attrs={style:t.join(";")}}e.tagName="span","span"==e.parentNode.tagName&&1==e.parentNode.children.length&&($.each(e.attrs,function(t,i){e.parentNode.attrs[t]="style"==t?e.parentNode.attrs[t]+i:i}),e.parentNode.removeChild(e,!0))})});for(var r in t)!function(r){e.commands[r]={execCommand:function(e,n){if("transparent"!=n){var r=this.selection.getRange();if(!r.collapsed){if("fontsize"==e&&(n={10:"1",12:"2",16:"3",18:"4",24:"5",32:"6",48:"7"}[(n+"").replace(/px/,"")]),this.document.execCommand(t[e],!1,n),browser.gecko&&$.each(this.$body.find("a"),function(e,t){var i=t.parentNode;if(i.lastChild===i.firstChild&&/FONT|SPAN/.test(i.tagName)){var n=i.cloneNode(!1);n.innerHTML=t.innerHTML,$(t).html("").append(n).insertBefore(i),$(i).remove()}}),!browser.ie){var a=this.selection.getNative().getRangeAt(0),o=a.commonAncestorContainer,r=this.selection.getRange(),s=r.createBookmark(!0);$(o).find("a").each(function(e,t){var i=t.parentNode;if("FONT"==i.nodeName){var n=i.cloneNode(!1);n.innerHTML=t.innerHTML,$(t).html("").append(n)}}),r.moveToBookmark(s).select()}return!0}var l=$("<span></span>").css(i[e],n)[0];r.insertNode(l).setStart(l,0).setCursor()}},queryCommandValue:function(t){var r=e.selection.getStart(),a=$(r).css(i[t]);return void 0===a&&(a=$(r).attr(n[t])),a?utils.fixColor(t,a).replace(/px/,""):""},queryCommandState:function(e){return this.queryCommandValue(e)}}}(r)},UM.plugins.link=function(){var e=this;e.setOpt("autourldetectinie",!1),browser.ie&&!1===this.options.autourldetectinie&&this.addListener("keyup",function(e,t){var i=this,n=t.keyCode;if(13==n||32==n){var r=i.selection.getRange(),a=r.startContainer;if(13==n){if("P"==a.nodeName){var o=a.previousSibling;if(o&&1==o.nodeType){var o=o.lastChild;o&&"A"==o.nodeName&&!o.getAttribute("_href")&&domUtils.remove(o,!0)}}}else 32==n&&3==a.nodeType&&/^\s$/.test(a.nodeValue)&&(a=a.previousSibling)&&"A"==a.nodeName&&!a.getAttribute("_href")&&domUtils.remove(a,!0)}}),this.addOutputRule(function(e){$.each(e.getNodesByTagName("a"),function(e,t){var i=t.getAttr("_href");/^(ftp|https?|\/|file)/.test(i)||(i="http://"+i),t.setAttr("href",i),t.setAttr("_href"),""==t.getAttr("title")&&t.setAttr("title")})}),this.addInputRule(function(e){$.each(e.getNodesByTagName("a"),function(e,t){t.setAttr("_href",t.getAttr("href"))})}),e.commands.link={execCommand:function(e,t){var i=this,n=i.selection.getRange();if(t._href&&(t._href=utils.unhtml(t._href,/[<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g)),t.href&&(t.href=utils.unhtml(t.href,/[<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g)),n.collapsed){var r=n.startContainer;(r=domUtils.findParentByTagName(r,"a",!0))?($(r).attr(t),n.selectNode(r).select()):n.insertNode($("<a>"+t.href+"</a>").attr(t)[0]).select()}else i.document.execCommand("createlink",!1,"_umeditor_link"),utils.each(domUtils.getElementsByTagName(i.body,"a",function(e){return"_umeditor_link"==e.getAttribute("href")}),function(e){"_umeditor_link"==$(e).text()&&$(e).text(t.href),domUtils.setAttributes(e,t),n.selectNode(e).select()})},queryCommandState:function(){return this.queryCommandValue("link")?1:0},queryCommandValue:function(){var e,t=this.selection.getStartElementPath();return $.each(t,function(t,i){if("A"==i.nodeName)return e=i,!1}),e}},e.commands.unlink={execCommand:function(){this.document.execCommand("unlink")}}},UM.commands.print={execCommand:function(){var e=this,t="editor_print_"+ +new Date;$('<iframe src="" id="'+t+'" name="'+t+'" frameborder="0"></iframe>').attr("id",t).css({width:"0px",height:"0px",overflow:"hidden",float:"left",position:"absolute",top:"-10000px",left:"-10000px"}).appendTo(e.$container.find(".edui-dialog-container"));var i=window.open("",t,""),n=i.document;n.open(),n.write("<html><head></head><body><div>"+this.getContent(null,null,!0)+"</div><script>setTimeout(function(){window.print();setTimeout(function(){window.parent.$('#"+t+"').remove();},100);},200);<\/script></body></html>"),n.close()},notNeedUndo:1},UM.plugins.paragraph=function(){var e=this;e.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""}),e.commands.paragraph={execCommand:function(e,t){return this.document.execCommand("formatBlock",!1,"<"+t+">")},queryCommandValue:function(){try{var e=this.document.queryCommandValue("formatBlock")}catch(e){}return e}}},UM.plugins.horizontal=function(){var e=this;e.commands.horizontal={execCommand:function(){this.document.execCommand("insertHorizontalRule");var t=e.selection.getRange().txtToElmBoundary(!0),i=t.startContainer;if(domUtils.isBody(t.startContainer)){var n=t.startContainer.childNodes[t.startOffset];n||(n=$("<p></p>").appendTo(t.startContainer).html(browser.ie?" ":"<br/>")[0]),t.setStart(n,0).setCursor()}else{for(;dtd.$inline[i.tagName]&&i.lastChild===i.firstChild;){var r=i.parentNode;r.appendChild(i.firstChild),r.removeChild(i),i=r}for(;dtd.$inline[i.tagName];)i=i.parentNode;if(1==i.childNodes.length&&"HR"==i.lastChild.nodeName){var a=i.lastChild;$(a).insertBefore(i),t.setStart(i,0).setCursor()}else{a=$("hr",i)[0],domUtils.breakParent(a,i);var o=a.previousSibling;o&&domUtils.isEmptyBlock(o)&&$(o).remove(),t.setStart(a.nextSibling,0).setCursor()}}}}},UM.commands.cleardoc={execCommand:function(){var e=this,t=e.selection.getRange();e.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>",t.setStart(e.body.firstChild,0).setCursor(!1,!0),setTimeout(function(){e.fireEvent("clearDoc")},0)}},UM.plugins.undo=function(){function e(e,t){if(e.length!=t.length)return 0;for(var i=0,n=e.length;i<n;i++)if(e[i]!=t[i])return 0;return 1}function t(t,i){return t.collapsed!=i.collapsed?0:e(t.startAddress,i.startAddress)&&e(t.endAddress,i.endAddress)?1:0}function i(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.undo=function(){if(this.hasUndo){if(!this.list[this.index-1]&&1==this.list.length)return void this.reset();for(;this.list[this.index].content==this.list[this.index-1].content;)if(0==--this.index)return this.restore(0);this.restore(--this.index)}},this.redo=function(){if(this.hasRedo){for(;this.list[this.index].content==this.list[this.index+1].content;)if(++this.index==this.list.length-1)return this.restore(this.index);this.restore(++this.index)}},this.restore=function(){var e=this.editor,t=this.list[this.index],i=UM.htmlparser(t.content.replace(l,""));e.options.autoClearEmptyNode=!1,e.filterInputRule(i,!0),e.options.autoClearEmptyNode=u,e.body.innerHTML=i.toHtml(),e.fireEvent("afterscencerestore"),browser.ie&&utils.each(domUtils.getElementsByTagName(e.document,"td th caption p"),function(t){domUtils.isEmptyNode(t)&&domUtils.fillNode(e.document,t)});try{var n=new dom.Range(e.document,e.body).moveToAddress(t.address);if(browser.ie&&n.collapsed&&1==n.startContainer.nodeType){var r=n.startContainer.childNodes[n.startOffset];(!r||1==r.nodeType&&dtd.$empty[r])&&n.insertNode(e.document.createTextNode(" ")).collapse(!0)}n.select(c[n.startContainer.nodeName.toLowerCase()])}catch(e){}this.update(),this.clearKey(),e.fireEvent("reset",!0)},this.getScene=function(){var e=this.editor,t=e.selection.getRange(),i=t.createAddress(!1,!0);e.fireEvent("beforegetscene");var n=UM.htmlparser(e.body.innerHTML,!0);e.options.autoClearEmptyNode=!1,e.filterOutputRule(n,!0),e.options.autoClearEmptyNode=u;var r=n.toHtml();return browser.ie&&(r=r.replace(/> </g,"><").replace(/\s*</g,"<").replace(/>\s*/g,">")),e.fireEvent("aftergetscene"),{address:i,content:r}},this.save=function(e,i){clearTimeout(r);var n=this.getScene(i),a=this.list[this.index];a&&a.content==n.content&&(e?1:t(a.address,n.address))||(this.list=this.list.slice(0,this.index+1),this.list.push(n),this.list.length>o&&this.list.shift(),this.index=this.list.length-1,this.clearKey(),this.update())},this.update=function(){this.hasRedo=!!this.list[this.index+1],this.hasUndo=!!this.list[this.index-1]},this.reset=function(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.clearKey()},this.clearKey=function(){p=0,d=null}}function n(){this.undoManger.save()}var r,a=this,o=a.options.maxUndoCount||20,s=a.options.maxInputCount||20,l=new RegExp(domUtils.fillChar+"|</hr>","gi"),c={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},u=a.options.autoClearEmptyNode;a.undoManger=new i,a.undoManger.editor=a,a.addListener("saveScene",function(){var e=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,e)}),a.addListener("beforeexeccommand",n),a.addListener("afterexeccommand",n),a.addListener("reset",function(e,t){t||this.undoManger.reset()}),a.commands.redo=a.commands.undo={execCommand:function(e){this.undoManger[e]()},queryCommandState:function(e){return this.undoManger["has"+("undo"==e.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var d,h={16:1,17:1,18:1,37:1,38:1,39:1,40:1},p=0,f=!1;a.addListener("ready",function(){$(this.body).on("compositionstart",function(){f=!0}).on("compositionend",function(){f=!1})}),a.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89,shift+ctrl+z"});var m=!0;a.addListener("keydown",function(e,t){function i(e){e.selection.getRange().collapsed&&e.fireEvent("contentchange"),e.undoManger.save(!1,!0),e.fireEvent("selectionchange")}var n=this,a=t.keyCode||t.which;if(!(h[a]||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){if(f)return;if(!n.selection.getRange().collapsed)return n.undoManger.save(!1,!0),void(m=!1);0==n.undoManger.list.length&&n.undoManger.save(!0),clearTimeout(r),r=setTimeout(function(){if(f)var e=setInterval(function(){f||(i(n),clearInterval(e))},300);else i(n)},200),d=a,p++,p>=s&&i(n)}}),a.addListener("keyup",function(e,t){
|
||
var i=t.keyCode||t.which;if(!(h[i]||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){if(f)return;m||(this.undoManger.save(!1,!0),m=!0)}})},UM.plugins.paste=function(){function e(e){var t=this.document;if(!t.getElementById("baidu_pastebin")){var i=this.selection.getRange(),n=i.createBookmark(),r=t.createElement("div");r.id="baidu_pastebin",browser.webkit&&r.appendChild(t.createTextNode(domUtils.fillChar+domUtils.fillChar)),this.body.appendChild(r),n.start.style.display="",r.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+$(n.start).position().top+"px",i.selectNodeContents(r).select(!0),setTimeout(function(){if(browser.webkit)for(var a,o=0,s=t.querySelectorAll("#baidu_pastebin");a=s[o++];){if(!domUtils.isEmptyNode(a)){r=a;break}domUtils.remove(a)}try{r.parentNode.removeChild(r)}catch(e){}i.moveToBookmark(n).select(!0),e(r)},0)}}function t(e){var t;if(e.firstChild){for(var n,r=domUtils.getElementsByTagName(e,"span"),a=0;n=r[a++];)"_baidu_cut_start"!=n.id&&"_baidu_cut_end"!=n.id||domUtils.remove(n);if(browser.webkit){for(var o,s=e.querySelectorAll("div br"),a=0;o=s[a++];){var l=o.parentNode;"DIV"==l.tagName&&1==l.childNodes.length&&(l.innerHTML="<p><br/></p>",domUtils.remove(l))}for(var c,u=e.querySelectorAll("#baidu_pastebin"),a=0;c=u[a++];){var d=i.document.createElement("p");for(c.parentNode.insertBefore(d,c);c.firstChild;)d.appendChild(c.firstChild);domUtils.remove(c)}for(var h,p=e.querySelectorAll("meta"),a=0;h=p[a++];)domUtils.remove(h);var s=e.querySelectorAll("br");for(a=0;h=s[a++];)/^apple-/i.test(h.className)&&domUtils.remove(h)}if(browser.gecko){var f=e.querySelectorAll("[_moz_dirty]");for(a=0;h=f[a++];)h.removeAttribute("_moz_dirty")}if(!browser.ie)for(var h,m=e.querySelectorAll("span.Apple-style-span"),a=0;h=m[a++];)domUtils.remove(h,!0);t=e.innerHTML,t=UM.filterWord(t);var g=UM.htmlparser(t);if(i.options.filterRules&&UM.filterNode(g,i.options.filterRules),i.filterInputRule(g),browser.webkit){var v=g.lastChild();v&&"element"==v.type&&"br"==v.tagName&&g.removeChild(v),utils.each(i.body.querySelectorAll("div"),function(e){domUtils.isEmptyBlock(e)&&domUtils.remove(e)})}if(t={html:g.toHtml()},i.fireEvent("beforepaste",t,g),!t.html)return;i.execCommand("insertHtml",t.html,!0),i.fireEvent("afterpaste",t)}}var i=this;i.addListener("ready",function(){$(i.body).on("cut",function(){!i.selection.getRange().collapsed&&i.undoManger&&i.undoManger.save()}).on(browser.ie||browser.opera?"keydown":"paste",function(n){(!browser.ie&&!browser.opera||(n.ctrlKey||n.metaKey)&&"86"==n.keyCode)&&e.call(i,function(e){t(e)})})})},UM.plugins.list=function(){var e=this;e.setOpt({insertorderedlist:{decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:""}}),this.addInputRule(function(e){utils.each(e.getNodesByTagName("li"),function(e){0==e.children.length&&e.parentNode.removeChild(e)})}),e.commands.insertorderedlist=e.commands.insertunorderedlist={execCommand:function(e){this.document.execCommand(e);var t=this.selection.getRange(),i=t.createBookmark(!0);return this.$body.find("ol,ul").each(function(e,t){var i=t.parentNode;"P"==i.tagName&&i.lastChild===i.firstChild&&($(t).children().each(function(e,t){var n=i.cloneNode(!1);$(n).append(t.innerHTML),$(t).html("").append(n)}),$(t).insertBefore(i),$(i).remove()),dtd.$inline[i.tagName]&&("SPAN"==i.tagName&&$(t).children().each(function(e,t){var n=i.cloneNode(!1);if("P"!=t.firstChild.nodeName){for(;t.firstChild;)n.appendChild(t.firstChild);$("<p></p>").appendTo(t).append(n)}else{for(;t.firstChild;)n.appendChild(t.firstChild);$(t.firstChild).append(n)}}),domUtils.remove(i,!0))}),t.moveToBookmark(i).select(),!0},queryCommandState:function(e){return this.document.queryCommandState(e)}}},function(){var e={textarea:function(e,t){var i=t.ownerDocument.createElement("textarea");return i.style.cssText="resize:none;border:0;padding:0;margin:0;overflow-y:auto;outline:0",browser.ie&&browser.version<8&&(i.style.width=t.offsetWidth+"px",i.style.height=t.offsetHeight+"px",t.onresize=function(){i.style.width=t.offsetWidth+"px",i.style.height=t.offsetHeight+"px"}),t.appendChild(i),{container:i,setContent:function(e){i.value=e},getContent:function(){return i.value},select:function(){var e;browser.ie?(e=i.createTextRange(),e.collapse(!0),e.select()):(i.setSelectionRange(0,0),i.focus())},dispose:function(){t.removeChild(i),t.onresize=null,i=null,t=null}}}};UM.plugins.source=function(){function t(t){return e.textarea(n,t)}var i,n=this,r=this.options,a=!1;r.sourceEditor="textarea",n.setOpt({sourceEditorFirst:!1});var o,s=n.getContent;n.commands.source={execCommand:function(){if(a=!a){o=n.selection.getRange().createAddress(!1,!0),n.undoManger&&n.undoManger.save(!0),browser.gecko&&(n.body.contentEditable=!1),n.body.style.cssText+=";position:absolute;left:-32768px;top:-32768px;",n.fireEvent("beforegetcontent");var e=UM.htmlparser(n.body.innerHTML);n.filterOutputRule(e),e.traversal(function(e){if("element"==e.type)switch(e.tagName){case"td":case"th":case"caption":e.children&&1==e.children.length&&"br"==e.firstChild().tagName&&e.removeChild(e.firstChild());break;case"pre":e.innerText(e.innerText().replace(/ /g," "))}}),n.fireEvent("aftergetcontent");var r=e.toHtml(!0);i=t(n.body.parentNode),i.setContent(r);var l=function(e){return parseInt($(n.body).css(e))};$(i.container).width($(n.body).width()+l("padding-left")+l("padding-right")).height($(n.body).height()),setTimeout(function(){i.select()}),n.getContent=function(){return i.getContent()||"<p>"+(browser.ie?"":"<br/>")+"</p>"}}else{n.$body.css({position:"",left:"",top:""});var c=i.getContent()||"<p>"+(browser.ie?"":"<br/>")+"</p>";c=c.replace(new RegExp("[\\r\\t\\n ]*</?(\\w+)\\s*(?:[^>]*)>","g"),function(e,t){return t&&!dtd.$inlineWithA[t.toLowerCase()]?e.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):e.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")}),n.setContent(c),i.dispose(),i=null,n.getContent=s;n.body.firstChild||(n.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>"),n.undoManger&&n.undoManger.save(!0),browser.gecko&&(n.body.contentEditable=!0);try{n.selection.getRange().moveToAddress(o).select()}catch(e){}}this.fireEvent("sourcemodechanged",a)},queryCommandState:function(){return 0|a},notNeedUndo:1};var l=n.queryCommandState;n.queryCommandState=function(e){return e=e.toLowerCase(),a?e in{source:1,fullscreen:1}?l.apply(this,arguments):-1:l.apply(this,arguments)}}}(),UM.plugins.enterkey=function(){var e,t=this,i=t.options.enterTag;t.addListener("keyup",function(i,n){if(13==(n.keyCode||n.which)){var r,a=t.selection.getRange(),o=a.startContainer;if(browser.ie)t.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(e)){if(browser.gecko)domUtils.findParentByTagName(o,["h1","h2","h3","h4","h5","h6","blockquote","caption","table"],!0)||(t.document.execCommand("formatBlock",!1,"<p>"),r=1);else if(1==o.nodeType){var s,l=t.document.createTextNode("");if(a.insertNode(l),s=domUtils.findParentByTagName(l,"div",!0)){for(var c=t.document.createElement("p");s.firstChild;)c.appendChild(s.firstChild);s.parentNode.insertBefore(c,s),domUtils.remove(s),a.setStartBefore(l).setCursor(),r=1}domUtils.remove(l)}t.undoManger&&r&&t.undoManger.save()}browser.opera&&a.select()}}}),t.addListener("keydown",function(n,r){if(13==(r.keyCode||r.which)){if(t.fireEvent("beforeenterkeydown"))return void domUtils.preventDefault(r);t.fireEvent("saveScene",!0,!0),e="";var a=t.selection.getRange();if(!a.collapsed){var o=a.startContainer,s=a.endContainer,l=domUtils.findParentByTagName(o,"td",!0),c=domUtils.findParentByTagName(s,"td",!0);if(l&&c&&l!==c||!l&&c||l&&!c)return void(r.preventDefault?r.preventDefault():r.returnValue=!1)}"p"==i&&(browser.ie||(o=domUtils.findParentByTagName(a.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote","caption"],!0),o||browser.opera?(e=o.tagName,"p"==o.tagName.toLowerCase()&&browser.gecko&&domUtils.removeDirtyAttr(o)):(t.document.execCommand("formatBlock",!1,"<p>"),browser.gecko&&(a=t.selection.getRange(),(o=domUtils.findParentByTagName(a.startContainer,"p",!0))&&domUtils.removeDirtyAttr(o)))))}}),browser.ie&&t.addListener("setDisabled",function(){$(t.body).find("p").each(function(e,t){domUtils.isEmptyBlock(t)&&(t.innerHTML=" ")})})},UM.commands.preview={execCommand:function(){var e=window.open("","_blank",""),t=e.document,i=this.getContent(null,null,!0),n=this.getOpt("UMEDITOR_HOME_URL"),r=-1!=i.indexOf("mathquill-embedded-latex")?'<link rel="stylesheet" href="'+n+'third-party/mathquill/mathquill.css"/><script src="'+n+'third-party/jquery.min.js"><\/script><script src="'+n+'third-party/mathquill/mathquill.min.js"><\/script>':"";t.open(),t.write("<html><head>"+r+"</head><body><div>"+i+"</div></body></html>"),t.close()},notNeedUndo:1},UM.plugins.basestyle=function(){var e=["bold","underline","superscript","subscript","italic","strikethrough"],t=this;t.addshortcutkey({Bold:"ctrl+66",Italic:"ctrl+73",Underline:"ctrl+shift+85",strikeThrough:"ctrl+shift+83"}),t.addOutputRule(function(e){$.each(e.getNodesByTagName("b i u strike s"),function(e,t){switch(t.tagName){case"b":t.tagName="strong";break;case"i":t.tagName="em";break;case"u":t.tagName="span",t.setStyle("text-decoration","underline");break;case"s":case"strike":t.tagName="span",t.setStyle("text-decoration","line-through")}})}),$.each(e,function(e,i){t.commands[i]={execCommand:function(e){var t=this.selection.getRange();if(t.collapsed&&1!=this.queryCommandState(e)){var i=this.document.createElement({bold:"strong",underline:"u",superscript:"sup",subscript:"sub",italic:"em",strikethrough:"strike"}[e]);return t.insertNode(i).setStart(i,0).setCursor(!1),!0}return this.document.execCommand(e)},queryCommandState:function(e){if(browser.gecko)return this.document.queryCommandState(e);var t=this.selection.getStartElementPath(),i=!1;return $.each(t,function(t,n){switch(e){case"bold":if("STRONG"==n.nodeName||"B"==n.nodeName)return i=1,!1;break;case"underline":if("U"==n.nodeName||"SPAN"==n.nodeName&&"underline"==$(n).css("text-decoration"))return i=1,!1;break;case"superscript":if("SUP"==n.nodeName)return i=1,!1;break;case"subscript":if("SUB"==n.nodeName)return i=1,!1;break;case"italic":if("EM"==n.nodeName||"I"==n.nodeName)return i=1,!1;break;case"strikethrough":if("S"==n.nodeName||"STRIKE"==n.nodeName||"SPAN"==n.nodeName&&"line-through"==$(n).css("text-decoration"))return i=1,!1}}),i}}})},UM.plugins.video=function(){function e(e,t,n,r,a,o){return o?'<embed type="application/x-shockwave-flash" class="edui-faked-video" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+e+'" width="'+t+'" height="'+n+'"'+(a?' style="float:'+a+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >':"<img "+(r?'id="'+r+'"':"")+' width="'+t+'" height="'+n+'" _url="'+e+'" class="edui-faked-video" src="'+i.options.UMEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+i.options.UMEDITOR_HOME_URL+"themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;"+(a?"float:"+a+";":"")+'" />'}function t(t,i){utils.each(t.getNodesByTagName(i?"img":"embed"),function(t){if("edui-faked-video"==t.getAttr("class")){var n=e(i?t.getAttr("_url"):t.getAttr("src"),t.getAttr("width"),t.getAttr("height"),null,t.getStyle("float")||"",i);t.parentNode.replaceChild(UM.uNode.createElement(n),t)}})}var i=this;i.addOutputRule(function(e){t(e,!0)}),i.addInputRule(function(e){t(e)}),i.commands.insertvideo={execCommand:function(t,n){n=utils.isArray(n)?n:[n];for(var r,a=[],o=0,s=n.length;o<s;o++)r=n[o],r.url=utils.unhtml(r.url,/[<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g),a.push(e(r.url,r.width||420,r.height||280,"tmpVedio"+o,r.align,!1));i.execCommand("inserthtml",a.join(""),!0)},queryCommandState:function(){var e=i.selection.getRange().getClosedNode();return e&&"edui-faked-video"==e.className?1:0}}},UM.plugins.selectall=function(){var e=this;e.commands.selectall={execCommand:function(){var e=this,t=e.body,i=e.selection.getRange();i.selectNodeContents(t),domUtils.isEmptyBlock(t)&&(browser.opera&&t.firstChild&&1==t.firstChild.nodeType&&i.setStartAtFirst(t.firstChild),i.collapse(!0)),i.select(!0)},notNeedUndo:1},e.addshortcutkey({selectAll:"ctrl+65"})},UM.plugins.removeformat=function(){var e=this;e.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"}),e.commands.removeformat={execCommand:function(e,t,i,n,r){function a(e){if(3==e.nodeType||"span"!=e.tagName.toLowerCase())return 0;if(browser.ie){var t=e.attributes;if(t.length){for(var i=0,n=t.length;i<n;i++)if(t[i].specified)return 0;return 1}}return!e.attributes.length}var o,s,l=new RegExp("^(?:"+(t||this.options.removeFormatTags).replace(/,/g,"|")+")$","i"),c=i?[]:(n||this.options.removeFormatAttributes).split(","),u=new dom.Range(this.document),d=function(e){return 1==e.nodeType};u=this.selection.getRange(),u.collapsed||(!function(e){var t=e.createBookmark();if(e.collapsed&&e.enlarge(!0),!r){var n=domUtils.findParentByTagName(e.startContainer,"a",!0);n&&e.setStartBefore(n),(n=domUtils.findParentByTagName(e.endContainer,"a",!0))&&e.setEndAfter(n)}for(o=e.createBookmark(),m=o.start;(s=m.parentNode)&&!domUtils.isBlockElm(s);)domUtils.breakParent(m,s),domUtils.clearEmptySibling(m);if(o.end){for(m=o.end;(s=m.parentNode)&&!domUtils.isBlockElm(s);)domUtils.breakParent(m,s),domUtils.clearEmptySibling(m);for(var u,h=domUtils.getNextDomNode(o.start,!1,d);h&&h!=o.end;)u=domUtils.getNextDomNode(h,!0,d),dtd.$empty[h.tagName.toLowerCase()]||domUtils.isBookmarkNode(h)||(l.test(h.tagName)?i?(domUtils.removeStyle(h,i),a(h)&&"text-decoration"!=i&&domUtils.remove(h,!0)):domUtils.remove(h,!0):dtd.$tableContent[h.tagName]||dtd.$list[h.tagName]||(domUtils.removeAttributes(h,c),a(h)&&domUtils.remove(h,!0))),h=u}var p=o.start.parentNode;!domUtils.isBlockElm(p)||dtd.$tableContent[p.tagName]||dtd.$list[p.tagName]||domUtils.removeAttributes(p,c),p=o.end.parentNode,o.end&&domUtils.isBlockElm(p)&&!dtd.$tableContent[p.tagName]&&!dtd.$list[p.tagName]&&domUtils.removeAttributes(p,c),e.moveToBookmark(o).moveToBookmark(t);for(var f,m=e.startContainer,g=e.collapsed;1==m.nodeType&&domUtils.isEmptyNode(m)&&dtd.$removeEmpty[m.tagName];)f=m.parentNode,e.setStartBefore(m),e.startContainer===e.endContainer&&e.endOffset--,domUtils.remove(m),m=f;if(!g)for(m=e.endContainer;1==m.nodeType&&domUtils.isEmptyNode(m)&&dtd.$removeEmpty[m.tagName];)f=m.parentNode,e.setEndBefore(m),domUtils.remove(m),m=f}(u),u.select())}}},UM.plugins.keystrokes=function(){var e=this,t=!0;e.addListener("keydown",function(i,n){var r=n.keyCode||n.which,a=e.selection.getRange();if(!a.collapsed&&!(n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)&&(r>=65&&r<=90||r>=48&&r<=57||r>=96&&r<=111||{13:1,8:1,46:1}[r])){var o=a.startContainer;if(domUtils.isFillChar(o)&&a.setStartBefore(o),o=a.endContainer,domUtils.isFillChar(o)&&a.setEndAfter(o),a.txtToElmBoundary(),a.endContainer&&1==a.endContainer.nodeType&&(o=a.endContainer.childNodes[a.endOffset])&&domUtils.isBr(o)&&a.setEndAfter(o),0==a.startOffset&&(o=a.startContainer,domUtils.isBoundaryNode(o,"firstChild")&&(o=a.endContainer,a.endOffset==(3==o.nodeType?o.nodeValue.length:o.childNodes.length)&&domUtils.isBoundaryNode(o,"lastChild"))))return e.fireEvent("saveScene"),e.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",a.setStart(e.body.firstChild,0).setCursor(!1,!0),void e._selectionChange()}if(8==r){if(a=e.selection.getRange(),t=a.collapsed,e.fireEvent("delkeydown",n))return;var s,l;if(a.collapsed&&a.inFillChar()&&(s=a.startContainer,domUtils.isFillChar(s)?(a.setStartBefore(s).shrinkBoundary(!0).collapse(!0),domUtils.remove(s)):(s.nodeValue=s.nodeValue.replace(new RegExp("^"+domUtils.fillChar),""),a.startOffset--,a.collapse(!0).select(!0))),s=a.getClosedNode())return e.fireEvent("saveScene"),a.setStartBefore(s),domUtils.remove(s),a.setCursor(),e.fireEvent("saveScene"),void domUtils.preventDefault(n);if(!browser.ie&&(s=domUtils.findParentByTagName(a.startContainer,"table",!0),l=domUtils.findParentByTagName(a.endContainer,"table",!0),s&&!l||!s&&l||s!==l))return void n.preventDefault();if(s=a.startContainer,a.collapsed&&1==s.nodeType){var c=s.childNodes[a.startOffset-1];c&&1==c.nodeType&&"BR"==c.tagName&&(e.fireEvent("saveScene"),a.setStartBefore(c).collapse(!0),domUtils.remove(c),a.select(),e.fireEvent("saveScene"))}if(browser.chrome&&a.collapsed){for(;0==a.startOffset&&!domUtils.isEmptyBlock(a.startContainer);)a.setStartBefore(a.startContainer);var u=a.startContainer.childNodes[a.startOffset-1];u&&"BR"==u.nodeName&&(a.setStartBefore(u),e.fireEvent("saveScene"),$(u).remove(),a.setCursor(),e.fireEvent("saveScene"))}}if(browser.gecko&&46==r){var d=e.selection.getRange();if(d.collapsed&&(s=d.startContainer,domUtils.isEmptyBlock(s))){for(var h=s.parentNode;1==domUtils.getChildCount(h)&&!domUtils.isBody(h);)s=h,h=h.parentNode;return void(s===h.lastChild&&n.preventDefault())}}}),e.addListener("keyup",function(e,i){var n,r=i.keyCode||i.which,a=this;if(8==r){if(a.fireEvent("delkeyup"))return;if(n=a.selection.getRange(),n.collapsed){var o,s=["h1","h2","h3","h4","h5","h6"];if((o=domUtils.findParentByTagName(n.startContainer,s,!0))&&domUtils.isEmptyBlock(o)){var l=o.previousSibling;if(l&&"TABLE"!=l.nodeName)return domUtils.remove(o),void n.setStartAtLast(l).setCursor(!1,!0);var c=o.nextSibling;if(c&&"TABLE"!=c.nodeName)return domUtils.remove(o),void n.setStartAtFirst(c).setCursor(!1,!0)}if(domUtils.isBody(n.startContainer)){var o=domUtils.createElement(a.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"<br/>"});n.insertNode(o).setStart(o,0).setCursor(!1,!0)}}if(!t&&(3==n.startContainer.nodeType||1==n.startContainer.nodeType&&domUtils.isEmptyBlock(n.startContainer)))if(browser.ie){var u=n.document.createElement("span");n.insertNode(u).setStartBefore(u).collapse(!0),n.select(),domUtils.remove(u)}else n.select()}})},UM.plugins.autosave=function(){function e(e){var o=null;if(!(new Date-i<n)){if(!e.hasContents())return void(r&&a.removeItem(r));i=new Date,e._saveFlag=null,o=t.body.innerHTML,!1!==e.fireEvent("beforeautosave",{content:o})&&(a.saveLocalData(r,o),e.fireEvent("afterautosave",{content:o}))}}var t=this,i=new Date,n=20,r=null;t.setOpt("saveInterval",500);var a=UM.LocalStorage=function(){var e=window.localStorage||function(){var e=document.createElement("div");return e.style.display="none",e.addBehavior?(e.addBehavior("#default#userdata"),{getItem:function(i){var n=null;try{document.body.appendChild(e),e.load(t),n=e.getAttribute(i),document.body.removeChild(e)}catch(e){}return n},setItem:function(i,n){document.body.appendChild(e),e.setAttribute(i,n),e.save(t),document.body.removeChild(e)},removeItem:function(i){document.body.appendChild(e),e.removeAttribute(i),e.save(t),document.body.removeChild(e)}}):null}()||null,t="localStorage";return{saveLocalData:function(t,i){return!(!e||!i)&&(e.setItem(t,i),!0)},getLocalData:function(t){return e?e.getItem(t):null},removeItem:function(t){e&&e.removeItem(t)}}}();t.addListener("ready",function(){var e=null;e=t.key?t.key+"-drafts-data":(t.container.parentNode.id||"ue-common")+"-drafts-data",r=(location.protocol+location.host+location.pathname).replace(/[.:\/]/g,"_")+e}),t.addListener("contentchange",function(){r&&(t._saveFlag&&window.clearTimeout(t._saveFlag),t.options.saveInterval>0?t._saveFlag=window.setTimeout(function(){e(t)},t.options.saveInterval):e(t))}),t.commands.clearlocaldata={execCommand:function(e,t){r&&a.getLocalData(r)&&a.removeItem(r)},notNeedUndo:!0,ignoreContentChange:!0},t.commands.getlocaldata={execCommand:function(e,t){return r?a.getLocalData(r)||"":""},notNeedUndo:!0,ignoreContentChange:!0},t.commands.drafts={execCommand:function(e,i){r&&(t.body.innerHTML=a.getLocalData(r)||"<p>"+(browser.ie?" ":"<br/>")+"</p>",t.focus(!0))},queryCommandState:function(){return r?null===a.getLocalData(r)?-1:0:-1},notNeedUndo:!0,ignoreContentChange:!0}},UM.plugins.autoupload=function(){function getPasteImage(e){return e.clipboardData&&e.clipboardData.items&&1==e.clipboardData.items.length&&/^image\//.test(e.clipboardData.items[0].type)?e.clipboardData.items:null}function getDropImage(e){return e.dataTransfer&&e.dataTransfer.files?e.dataTransfer.files:null}var me=this;me.setOpt("pasteImageEnabled",!0),me.setOpt("dropFileEnabled",!0);var sendAndInsertImage=function(file,editor){var fd=new FormData;fd.append(editor.options.imageFieldName||"upload",file,file.name||"blob."+file.type.substr("image/".length)),fd.append("type","ajax");var xhr=new XMLHttpRequest;xhr.open("post",me.options.imageUrl,!0),xhr.setRequestHeader("X-Requested-With","XMLHttpRequest"),xhr.addEventListener("load",function(e){try{var json=eval("("+e.target.response+")"),link=json.url,picLink=me.options.imagePath+link;editor.execCommand("insertimage",{src:picLink,_src:picLink})}catch(e){}}),xhr.send(fd)};me.addListener("ready",function(){if(window.FormData&&window.FileReader){var e=function(e){var t,i=!1;if(t="paste"==e.type?getPasteImage(e.originalEvent):getDropImage(e.originalEvent)){for(var n,r=t.length;r--;)n=t[r],n.getAsFile&&(n=n.getAsFile()),n&&n.size>0&&/image\/\w+/i.test(n.type)&&(sendAndInsertImage(n,me),i=!0);if(i)return!1}};me.getOpt("pasteImageEnabled")&&me.$body.on("paste",e),me.getOpt("dropFileEnabled")&&me.$body.on("drop",e),me.$body.on("dragover",function(e){if("Files"==e.originalEvent.dataTransfer.types[0])return!1})}})},UM.plugins.formula=function(){function e(){return i.$body.find("iframe.edui-formula-active")[0]||null}function t(){var t=e();t&&t.contentWindow.formula.blur()}var i=this;i.addInputRule(function(e){$.each(e.getNodesByTagName("span"),function(e,t){if(t.hasClass("mathquill-embedded-latex")){for(var n,r="";n=t.firstChild();)r+=n.data,t.removeChild(n);t.tagName="iframe",t.setAttr({frameborder:"0",src:i.getOpt("UMEDITOR_HOME_URL")+"dialogs/formula/formula.html","data-latex":utils.unhtml(r)})}})}),i.addOutputRule(function(e){$.each(e.getNodesByTagName("iframe"),function(e,t){t.hasClass("mathquill-embedded-latex")&&(t.tagName="span",t.appendChild(UM.uNode.createText(t.getAttr("data-latex"))),t.setAttr({frameborder:"",src:"","data-latex":""}))})}),i.addListener("click",function(){t()}),i.addListener("afterexeccommand",function(e,i){"formula"!=i&&t()}),i.commands.formula={execCommand:function(t,n){var r=e();r?r.contentWindow.formula.insertLatex(n):(i.execCommand("inserthtml",'<span class="mathquill-embedded-latex">'+n+"</span>"),browser.ie&&browser.ie9below&&setTimeout(function(){var e=i.selection.getRange(),t=e.startContainer;1!=t.nodeType||t.childNodes[e.startOffset]||(e.insertNode(i.document.createTextNode(" ")),e.setCursor())},100))},queryCommandState:function(e){return 0},queryCommandValue:function(t){var i=e();return i&&i.contentWindow.formula.getLatex()}}},UM.plugins.xssFilter=function(){function e(e){var t=e.tagName,n=e.attrs;if(!i.hasOwnProperty(t))return e.parentNode.removeChild(e),!1;UM.utils.each(n,function(n,r){-1===i[t].indexOf(r)&&e.setAttr(r)})}var t=UMEDITOR_CONFIG,i=t.whiteList;i&&t.xssFilterRules&&(this.options.filterRules=function(){var t={};return UM.utils.each(i,function(i,n){t[n]=function(t){return e(t)}}),t}());var n=[];UM.utils.each(i,function(e,t){n.push(t)}),i&&t.inputXssFilter&&this.addInputRule(function(t){t.traversal(function(t){if("element"!==t.type)return!1;e(t)})}),i&&t.outputXssFilter&&this.addOutputRule(function(t){t.traversal(function(t){if("element"!==t.type)return!1;e(t)})})},function(e){function t(t,i,n){if(t.prototype=e.extend2(e.extend({},i),(UM.ui[n]||r).prototype,!0),t.prototype.supper=(UM.ui[n]||r).prototype,UM.ui[n]&&UM.ui[n].prototype.defaultOpt){var a=UM.ui[n].prototype.defaultOpt,o=t.prototype.defaultOpt;t.prototype.defaultOpt=e.extend({},a,o||{})}return t}function i(t,i){e[a+i]=t,e.fn[a+i]=function(i){var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(a,o){var s=e(o),l=s.edui();if(l||(t(i&&e.isPlainObject(i)?i:{},s),s.edui(l)),"string"==e.type(i))if("this"==i)n=l;else{if((n=l[i].apply(l,r))!==l&&void 0!==n)return!1;n=null}}),null!==n?n:this}}e.parseTmpl=function(e,t){var i="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/<%=([\s\S]+?)%>/g,function(e,t){return"',obj."+t.replace(/\\'/g,"'")+",'"}).replace(/<%([\s\S]+?)%>/g,function(e,t){return"');"+t.replace(/\\'/g,"'").replace(/[\r\n\t]/g," ")+"__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",n=new Function("obj",i);return t?n(t):n},e.extend2=function(t,i){for(var n=arguments,r="boolean"==e.type(n[n.length-1])&&n[n.length-1],a="boolean"==e.type(n[n.length-1])?n.length-1:n.length,o=1;o<a;o++){var s=n[o];for(var l in s)r&&t.hasOwnProperty(l)||(t[l]=s[l])}return t},e.IE6=!!window.ActiveXObject&&6==parseFloat(navigator.userAgent.match(/msie (\d+)/i)[1]);var n=[],r=function(){},a="edui";r.prototype={on:function(t,i){return this.root().on(t,e.proxy(i,this)),this},off:function(t,i){return this.root().off(t,e.proxy(i,this)),this},trigger:function(e,t){return!1!==this.root().trigger(e,t)&&this},root:function(e){return this._$el||(this._$el=e)},destroy:function(){},data:function(e,t){return void 0!==t?(this.root().data(a+e,t),this):this.root().data(a+e)},register:function(t,i,r){n.push({evtname:t,$els:e.isArray(i)?i:[i],handler:e.proxy(r,i)})}},e.fn.edui=function(e){return e?this.data("eduiwidget",e):this.data("eduiwidget")};var o=1;UM.ui={define:function(n,r,s){var l=UM.ui[n]=t(function(t,i){var r=function(){};e.extend(r.prototype,l.prototype,{guid:n+o++,widgetName:n});var s=new r;if("string"==e.type(t))return s.init&&s.init({}),s.root().edui(s),s.root().find("a").click(function(e){e.preventDefault()}),s.root()[a+n].apply(s.root(),arguments);i&&s.root(i),s.init&&s.init(!t||e.isPlainObject(t)?e.extend2(t||{},s.defaultOpt||{},!0):t);try{s.root().find("a").click(function(e){e.preventDefault()})}catch(e){}return s.root().edui(s)},r,s);i(l,n)}},e(function(){e(document).on("click mouseup mousedown dblclick mouseover",function(t){e.each(n,function(i,n){n.evtname==t.type&&e.each(n.$els,function(i,r){r[0]===t.target||e.contains(r[0],t.target)||n.handler(t)})})})})}(jQuery),UM.ui.define("button",{tpl:'<<%if(!texttype){%>div class="edui-btn edui-btn-<%=icon%> <%if(name){%>edui-btn-name-<%=name%><%}%>" unselectable="on" onmousedown="return false" <%}else{%>a class="edui-text-btn"<%}%><% if(title) {%> data-original-title="<%=title%>" <%};%>> <% if(icon) {%><div unselectable="on" class="edui-icon-<%=icon%> edui-icon"></div><% }; %><%if(text) {%><span unselectable="on" onmousedown="return false" class="edui-button-label"><%=text%></span><%}%><%if(caret && text){%><span class="edui-button-spacing"></span><%}%><% if(caret) {%><span unselectable="on" onmousedown="return false" class="edui-caret"></span><% };%></<%if(!texttype){%>div<%}else{%>a<%}%>>',defaultOpt:{text:"",title:"",icon:"",width:"",caret:!1,texttype:!1,click:function(){}},init:function(e){var t=this;return t.root($($.parseTmpl(t.tpl,e))).click(function(i){t.wrapclick(e.click,i)}),t.root().hover(function(){t.root().hasClass("edui-disabled")||t.root().toggleClass("edui-hover")}),t},wrapclick:function(e,t){return this.disabled()||(this.root().trigger("wrapclick"),$.proxy(e,this,t)()),this},label:function(e){return void 0===e?this.root().find(".edui-button-label").text():(this.root().find(".edui-button-label").text(e),this)},disabled:function(e){return void 0===e?this.root().hasClass("edui-disabled"):(this.root().toggleClass("edui-disabled",e),this.root().hasClass("edui-disabled")&&this.root().removeClass("edui-hover"),this)},active:function(e){return void 0===e?this.root().hasClass("edui-active"):(this.root().toggleClass("edui-active",e),this)},mergeWith:function(e){var t=this;t.data("$mergeObj",e),e.edui().data("$mergeObj",t.root()),$.contains(document.body,e[0])||e.appendTo(t.root()),t.on("click",function(){t.wrapclick(function(){e.edui().show()})}).register("click",t.root(),function(t){e.hide()})}}),function(){UM.ui.define("toolbar",{tpl:'<div class="edui-toolbar" ><div class="edui-btn-toolbar" unselectable="on" onmousedown="return false" ></div></div>',init:function(){var e=this.root($(this.tpl));this.data("$btnToolbar",e.find(".edui-btn-toolbar"))},appendToBtnmenu:function(e){var t=this.data("$btnToolbar");e=$.isArray(e)?e:[e],$.each(e,function(e,i){t.append(i)})}})}(),UM.ui.define("menu",{show:function(e,t,i,n,r){i=i||"position",!1!==this.trigger("beforeshow")&&(this.root().css($.extend({display:"block"},e?{top:e[i]().top+("right"==t?0:e.outerHeight())-(n||0),left:e[i]().left+("right"==t?e.outerWidth():0)-(r||0)}:{})),this.trigger("aftershow"))},hide:function(e){var t;!1!==this.trigger("beforehide")&&((t=this.root().data("parentmenu"))&&(t.data("parentmenu")||e)&&t.edui().hide(),this.root().css("display","none"),this.trigger("afterhide"))},attachTo:function(e){var t=this;e.data("$mergeObj")||(e.data("$mergeObj",t.root()),e.on("wrapclick",function(e){t.show()}),t.register("click",e,function(e){t.hide()}),t.data("$mergeObj",e))}}),UM.ui.define("dropmenu",{tmpl:'<ul class="edui-dropdown-menu" aria-labelledby="dropdownMenu" ><%for(var i=0,ci;ci=data[i++];){%><%if(ci.divider){%><li class="edui-divider"></li><%}else{%><li <%if(ci.active||ci.disabled){%>class="<%= ci.active|| \'\' %> <%=ci.disabled||\'\' %>" <%}%> data-value="<%= ci.value%>"><a href="#" tabindex="-1"><em class="edui-dropmenu-checkbox"><i class="edui-icon-ok"></i></em><%= ci.label%></a></li><%}%><%}%></ul>',defaultOpt:{data:[],click:function(){}},init:function(e){var t=this,i={click:1,mouseover:1,mouseout:1};this.root($($.parseTmpl(this.tmpl,e))).on("click",'li[class!="edui-disabled edui-divider edui-dropdown-submenu"]',function(i){$.proxy(e.click,t,i,$(this).data("value"),$(this))()}).find("li").each(function(n,r){var a=$(this);if(!a.hasClass("edui-disabled edui-divider edui-dropdown-submenu")){var o=e.data[n];$.each(i,function(e){o[e]&&a[e](function(i){$.proxy(o[e],r)(i,o,t.root)})})}})},disabled:function(e){$("li[class!=edui-divider]",this.root()).each(function(){var t=$(this);!0===e?t.addClass("edui-disabled"):$.isFunction(e)?t.toggleClass("edui-disabled",e(li)):t.removeClass("edui-disabled")})},val:function(e){var t;if($('li[class!="edui-divider edui-disabled edui-dropdown-submenu"]',this.root()).each(function(){var i=$(this);if(void 0===e){if(i.find("em.edui-dropmenu-checked").length)return t=i.data("value"),!1}else i.find("em").toggleClass("edui-dropmenu-checked",i.data("value")==e)}),void 0===e)return t},addSubmenu:function(e,t,i){i=i||0;var n=$("li[class!=edui-divider]",this.root()),r=$('<li class="edui-dropdown-submenu"><a tabindex="-1" href="#">'+e+"</a></li>").append(t);i>=0&&i<n.length?r.insertBefore(n[i]):i<0?r.insertBefore(n[0]):i>=n.length&&r.appendTo(n)}},"menu"),UM.ui.define("splitbutton",{tpl:'<div class="edui-splitbutton <%if (name){%>edui-splitbutton-<%= name %><%}%>" unselectable="on" <%if(title){%>data-original-title="<%=title%>"<%}%>><div class="edui-btn" unselectable="on" ><%if(icon){%><div unselectable="on" class="edui-icon-<%=icon%> edui-icon"></div><%}%><%if(text){%><%=text%><%}%></div><div unselectable="on" class="edui-btn edui-dropdown-toggle" ><div unselectable="on" class="edui-caret"></div></div></div>',defaultOpt:{text:"",title:"",click:function(){}},init:function(e){var t=this;return t.root($($.parseTmpl(t.tpl,e))),t.root().find(".edui-btn:first").click(function(i){t.disabled()||$.proxy(e.click,t)()}),t.root().find(".edui-dropdown-toggle").click(function(){t.disabled()||t.trigger("arrowclick")}),t.root().hover(function(){t.root().hasClass("edui-disabled")||t.root().toggleClass("edui-hover")}),t},wrapclick:function(e,t){return this.disabled()||$.proxy(e,this,t)(),this},disabled:function(e){
|
||
return void 0===e?this.root().hasClass("edui-disabled"):(this.root().toggleClass("edui-disabled",e).find(".edui-btn").toggleClass("edui-disabled",e),this)},active:function(e){return void 0===e?this.root().hasClass("edui-active"):(this.root().toggleClass("edui-active",e).find(".edui-btn:first").toggleClass("edui-active",e),this)},mergeWith:function(e){var t=this;t.data("$mergeObj",e),e.edui().data("$mergeObj",t.root()),$.contains(document.body,e[0])||e.appendTo(t.root()),t.root().delegate(".edui-dropdown-toggle","click",function(){t.wrapclick(function(){e.edui().show()})}),t.register("click",t.root().find(".edui-dropdown-toggle"),function(t){e.hide()})}}),UM.ui.define("colorsplitbutton",{tpl:'<div class="edui-splitbutton <%if (name){%>edui-splitbutton-<%= name %><%}%>" unselectable="on" <%if(title){%>data-original-title="<%=title%>"<%}%>><div class="edui-btn" unselectable="on" ><%if(icon){%><div unselectable="on" class="edui-icon-<%=icon%> edui-icon"></div><%}%><div class="edui-splitbutton-color-label" <%if (color) {%>style="background: <%=color%>"<%}%>></div><%if(text){%><%=text%><%}%></div><div unselectable="on" class="edui-btn edui-dropdown-toggle" ><div unselectable="on" class="edui-caret"></div></div></div>',defaultOpt:{color:""},init:function(e){var t=this;t.supper.init.call(t,e)},colorLabel:function(){return this.root().find(".edui-splitbutton-color-label")}},"splitbutton"),UM.ui.define("popup",{tpl:'<div class="edui-dropdown-menu edui-popup"<%if(!<%=stopprop%>){%>onmousedown="return false"<%}%>><div class="edui-popup-body" unselectable="on" onmousedown="return false"><%=subtpl%></div><div class="edui-popup-caret"></div></div>',defaultOpt:{stopprop:!1,subtpl:"",width:"",height:""},init:function(e){return this.root($($.parseTmpl(this.tpl,e))),this},mergeTpl:function(e){return $.parseTmpl(this.tpl,{subtpl:e})},show:function(e,t){t||(t={});var i=t.fnname||"position";!1!==this.trigger("beforeshow")&&(this.root().css($.extend({display:"block"},e?{top:e[i]().top+("right"==t.dir?0:e.outerHeight())-(t.offsetTop||0),left:e[i]().left+("right"==t.dir?e.outerWidth():0)-(t.offsetLeft||0),position:"absolute"}:{})),this.root().find(".edui-popup-caret").css({top:t.caretTop||0,left:t.caretLeft||0,position:"absolute"}).addClass(t.caretDir||"up"),this.trigger("aftershow"))},hide:function(){this.root().css("display","none"),this.trigger("afterhide")},attachTo:function(e,t){var i=this;e.data("$mergeObj")||(e.data("$mergeObj",i.root()),e.on("wrapclick",function(n){i.show(e,t)}),i.register("click",e,function(e){i.hide()}),i.data("$mergeObj",e))},getBodyContainer:function(){return this.root().find(".edui-popup-body")}}),UM.ui.define("scale",{tpl:'<div class="edui-scale" unselectable="on"><span class="edui-scale-hand0"></span><span class="edui-scale-hand1"></span><span class="edui-scale-hand2"></span><span class="edui-scale-hand3"></span><span class="edui-scale-hand4"></span><span class="edui-scale-hand5"></span><span class="edui-scale-hand6"></span><span class="edui-scale-hand7"></span></div>',defaultOpt:{$doc:$(document),$wrap:$(document)},init:function(e){return e.$doc&&(this.defaultOpt.$doc=e.$doc),e.$wrap&&(this.defaultOpt.$wrap=e.$wrap),this.root($($.parseTmpl(this.tpl,e))),this.initStyle(),this.startPos=this.prePos={x:0,y:0},this.dragId=-1,this},initStyle:function(){utils.cssRule("edui-style-scale",".edui-scale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;}.edui-scale span{position:absolute;left:0;top:0;width:7px;height:7px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}.edui-scale .edui-scale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}.edui-scale .edui-scale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}.edui-scale .edui-scale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}.edui-scale .edui-scale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}.edui-scale .edui-scale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}.edui-scale .edui-scale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}.edui-scale .edui-scale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}.edui-scale .edui-scale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}")},_eventHandler:function(e){var t=this,i=t.defaultOpt.$doc;switch(e.type){case"mousedown":var n,n=e.target||e.srcElement;-1!=n.className.indexOf("edui-scale-hand")&&(t.dragId=n.className.slice(-1),t.startPos.x=t.prePos.x=e.clientX,t.startPos.y=t.prePos.y=e.clientY,i.bind("mousemove",$.proxy(t._eventHandler,t)));break;case"mousemove":-1!=t.dragId&&(t.updateContainerStyle(t.dragId,{x:e.clientX-t.prePos.x,y:e.clientY-t.prePos.y}),t.prePos.x=e.clientX,t.prePos.y=e.clientY,t.updateTargetElement());break;case"mouseup":if(-1!=t.dragId){t.dragId=-1,t.updateTargetElement();t.data("$scaleTarget").parent()&&t.attachTo(t.data("$scaleTarget"))}i.unbind("mousemove",$.proxy(t._eventHandler,t))}},updateTargetElement:function(){var e=this,t=e.root(),i=e.data("$scaleTarget");i.css({width:t.width(),height:t.height()}),e.attachTo(i)},updateContainerStyle:function(e,t){var i,n=this,r=n.root(),a=[[0,0,-1,-1],[0,0,0,-1],[0,0,1,-1],[0,0,-1,0],[0,0,1,0],[0,0,-1,1],[0,0,0,1],[0,0,1,1]];0!=a[e][0]&&(i=parseInt(r.offset().left)+t.x,r.css("left",n._validScaledProp("left",i))),0!=a[e][1]&&(i=parseInt(r.offset().top)+t.y,r.css("top",n._validScaledProp("top",i))),0!=a[e][2]&&(i=r.width()+a[e][2]*t.x,r.css("width",n._validScaledProp("width",i))),0!=a[e][3]&&(i=r.height()+a[e][3]*t.y,r.css("height",n._validScaledProp("height",i)))},_validScaledProp:function(e,t){var i=this.root(),n=this.defaultOpt.$doc,r=function(e,i,n){return e+i>n?n-i:t};switch(t=isNaN(t)?0:t,e){case"left":return t<0?0:r(t,i.width(),n.width());case"top":return t<0?0:r(t,i.height(),n.height());case"width":return t<=0?1:r(t,i.offset().left,n.width());case"height":return t<=0?1:r(t,i.offset().top,n.height())}},show:function(e){var t=this;e&&t.attachTo(e),t.root().bind("mousedown",$.proxy(t._eventHandler,t)),t.defaultOpt.$doc.bind("mouseup",$.proxy(t._eventHandler,t)),t.root().show(),t.trigger("aftershow")},hide:function(){var e=this;e.root().unbind("mousedown",$.proxy(e._eventHandler,e)),e.defaultOpt.$doc.unbind("mouseup",$.proxy(e._eventHandler,e)),e.root().hide(),e.trigger("afterhide")},attachTo:function(e){var t=this,i=e.offset(),n=t.root(),r=t.defaultOpt.$wrap,a=r.offset();t.data("$scaleTarget",e),t.root().css({position:"absolute",width:e.width(),height:e.height(),left:i.left-a.left-parseInt(r.css("border-left-width"))-parseInt(n.css("border-left-width")),top:i.top-a.top-parseInt(r.css("border-top-width"))-parseInt(n.css("border-top-width"))})},getScaleTarget:function(){return this.data("$scaleTarget")[0]}}),UM.ui.define("colorpicker",{tpl:function(e){for(var t="ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,".split(","),i='<div unselectable="on" onmousedown="return false" class="edui-colorpicker<%if (name){%> edui-colorpicker-<%=name%><%}%>" ><table unselectable="on" onmousedown="return false"><tr><td colspan="10">'+e.lang_themeColor+'</td> </tr><tr class="edui-colorpicker-firstrow" >',n=0;n<t.length;n++)n&&n%10==0&&(i+="</tr>"+(60==n?'<tr><td colspan="10">'+e.lang_standardColor+"</td></tr>":"")+"<tr"+(60==n?' class="edui-colorpicker-firstrow"':"")+">"),i+=n<70?'<td><a unselectable="on" onmousedown="return false" title="'+t[n]+'" class="edui-colorpicker-colorcell" data-color="#'+t[n]+'" style="background-color:#'+t[n]+";border:solid #ccc;"+(n<10||n>=60?"border-width:1px;":n>=10&&n<20?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'"></a></td>':"";return i+="</tr></table></div>"},init:function(e){var t=this;t.root($($.parseTmpl(t.supper.mergeTpl(t.tpl(e)),e))),t.root().on("click",function(e){t.trigger("pickcolor",$(e.target).data("color"))})}},"popup"),function(){UM.ui.define("combobox",function(){return{tpl:'<ul class="dropdown-menu edui-combobox-menu<%if (comboboxName!==\'\') {%> edui-combobox-<%=comboboxName%><%}%>" unselectable="on" onmousedown="return false" role="menu" aria-labelledby="dropdownMenu"><%if(autoRecord) {%><%for( var i=0, len = recordStack.length; i<len; i++ ) {%><%var index = recordStack[i];%><li class="<%=itemClassName%><%if( selected == index ) {%> edui-combobox-checked<%}%>" data-item-index="<%=index%>" unselectable="on" onmousedown="return false"><span class="edui-combobox-icon" unselectable="on" onmousedown="return false"></span><label class="<%=labelClassName%>" style="<%=itemStyles[ index ]%>" unselectable="on" onmousedown="return false"><%=items[index]%></label></li><%}%><%if( i ) {%><li class="edui-combobox-item-separator"></li><%}%><%}%><%for( var i=0, label; label = items[i]; i++ ) {%><li class="<%=itemClassName%><%if( selected == i ) {%> edui-combobox-checked<%}%> edui-combobox-item-<%=i%>" data-item-index="<%=i%>" unselectable="on" onmousedown="return false"><span class="edui-combobox-icon" unselectable="on" onmousedown="return false"></span><label class="<%=labelClassName%>" style="<%=itemStyles[ i ]%>" unselectable="on" onmousedown="return false"><%=label%></label></li><%}%></ul>',defaultOpt:{recordStack:[],items:[],value:[],comboboxName:"",selected:"",autoRecord:!0,recordCount:5},init:function(e){var t=this;$.extend(t._optionAdaptation(e),t._createItemMapping(e.recordStack,e.items),{itemClassName:"edui-combobox-item",iconClass:"edui-combobox-checked-icon",labelClassName:"edui-combobox-item-label"}),this._transStack(e),t.root($($.parseTmpl(t.tpl,e))),this.data("options",e).initEvent()},initEvent:function(){this.initSelectItem(),this.initItemActive()},initSelectItem:function(){var e=this;e.root().delegate(".edui-combobox-item","click",function(){var t=$(this),i=t.attr("data-item-index");return e.trigger("comboboxselect",{index:i,label:t.find(".edui-combobox-item-label").text(),value:e.data("options").value[i]}).select(i),e.hide(),!1})},initItemActive:function(){var e={mouseenter:"addClass",mouseleave:"removeClass"};$.IE6&&this.root().delegate(".edui-combobox-item","mouseenter mouseleave",function(t){$(this)[e[t.type]]("edui-combobox-item-hover")}).one("afterhide",function(){})},select:function(e){var t=this.data("options").itemCount,i=this.data("options").autowidthitem;return i&&!i.length&&(i=this.data("options").items),0==t?null:(e<0?e=t+e%t:e>=t&&(e=t-1),this.trigger("changebefore",i[e]),this._update(e),this.trigger("changeafter",i[e]),null)},selectItemByLabel:function(e){var t=this.data("options").itemMapping,i=this,n=null;!$.isArray(e)&&(e=[e]),$.each(e,function(e,r){if(void 0!==(n=t[r]))return i.select(n),!1})},_transStack:function(e){var t=[],i=-1,n=-1;$.each(e.recordStack,function(r,a){i=e.itemMapping[a],$.isNumeric(i)&&(t.push(i),a==e.selected&&(n=i))}),e.recordStack=t,e.selected=n,t=null},_optionAdaptation:function(e){if(!("itemStyles"in e)){e.itemStyles=[];for(var t=0,i=e.items.length;t<i;t++)e.itemStyles.push("")}return e.autowidthitem=e.autowidthitem||e.items,e.itemCount=e.items.length,e},_createItemMapping:function(e,t){var i={},n={recordStack:[],mapping:{}};return $.each(t,function(e,t){i[t]=e}),n.itemMapping=i,$.each(e,function(e,t){void 0!==i[t]&&(n.recordStack.push(i[t]),n.mapping[t]=i[t])}),n},_update:function(e){var t=this.data("options"),i=[],n=null;$.each(t.recordStack,function(t,n){n!=e&&i.push(n)}),i.unshift(e),i.length>t.recordCount&&(i.length=t.recordCount),t.recordStack=i,t.selected=e,n=$($.parseTmpl(this.tpl,t)),this.root().html(n.html()),n=null,i=null}}}(),"menu")}(),function(){UM.ui.define("buttoncombobox",function(){return{defaultOpt:{label:"",title:""},init:function(e){var t=this,i=$.eduibutton({caret:!0,name:e.comboboxName,title:e.title,text:e.label,click:function(){t.show(this.root())}});t.supper.init.call(t,e),t.on("changebefore",function(e,t){i.eduibutton("label",t)}),t.data("button",i),t.attachTo(i)},button:function(){return this.data("button")}}}(),"combobox")}(),UM.ui.define("modal",{tpl:'<div class="edui-modal" tabindex="-1" ><div class="edui-modal-header"><div class="edui-close" data-hide="modal"></div><h3 class="edui-title"><%=title%></h3></div><div class="edui-modal-body" style="<%if(width){%>width:<%=width%>px;<%}%><%if(height){%>height:<%=height%>px;<%}%>"> </div><% if(cancellabel || oklabel) {%><div class="edui-modal-footer"><div class="edui-modal-tip"></div><%if(oklabel){%><div class="edui-btn edui-btn-primary" data-ok="modal"><%=oklabel%></div><%}%><%if(cancellabel){%><div class="edui-btn" data-hide="modal"><%=cancellabel%></div><%}%></div><%}%></div>',defaultOpt:{title:"",cancellabel:"",oklabel:"",width:"",height:"300",backdrop:!0,keyboard:!0},init:function(e){var t=this;t.root($($.parseTmpl(t.tpl,e||{}))),t.data("options",e),e.okFn&&t.on("ok",$.proxy(e.okFn,t)),e.cancelFn&&t.on("beforehide",$.proxy(e.cancelFn,t)),t.root().delegate('[data-hide="modal"]',"click",$.proxy(t.hide,t)).delegate('[data-ok="modal"]',"click",$.proxy(t.ok,t)),$('[data-hide="modal"],[data-ok="modal"]',t.root()).hover(function(){$(this).toggleClass("edui-hover")})},toggle:function(){var e=this;return e[e.data("isShown")?"hide":"show"]()},show:function(){var e=this;e.trigger("beforeshow"),e.data("isShown")||(e.data("isShown",!0),e.escape(),e.backdrop(function(){e.autoCenter(),e.root().show().focus().trigger("aftershow")}))},showTip:function(e){$(".edui-modal-tip",this.root()).html(e).fadeIn()},hideTip:function(e){$(".edui-modal-tip",this.root()).fadeOut(function(){$(this).html("")})},autoCenter:function(){!$.IE6&&this.root().css("margin-left",-this.root().width()/2)},hide:function(){var e=this;e.trigger("beforehide"),e.data("isShown")&&(e.data("isShown",!1),e.escape(),e.hideModal())},escape:function(){var e=this;e.data("isShown")&&e.data("options").keyboard?e.root().on("keyup",function(t){27==t.which&&e.hide()}):e.data("isShown")||e.root().off("keyup")},hideModal:function(){var e=this;e.root().hide(),e.backdrop(function(){e.removeBackdrop(),e.trigger("afterhide")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(e){var t=this;t.data("isShown")&&t.data("options").backdrop&&(t.$backdrop=$('<div class="edui-modal-backdrop" />').click("static"==t.data("options").backdrop?$.proxy(t.root()[0].focus,t.root()[0]):$.proxy(t.hide,t))),t.trigger("afterbackdrop"),e&&e()},attachTo:function(e){var t=this;e.data("$mergeObj")||(e.data("$mergeObj",t.root()),e.on("click",function(){t.toggle(e)}),t.data("$mergeObj",e))},ok:function(){var e=this;e.trigger("beforeok"),!1!==e.trigger("ok",e)&&e.hide()},getBodyContainer:function(){return this.root().find(".edui-modal-body")}}),UM.ui.define("tooltip",{tpl:'<div class="edui-tooltip" unselectable="on" onmousedown="return false"><div class="edui-tooltip-arrow" unselectable="on" onmousedown="return false"></div><div class="edui-tooltip-inner" unselectable="on" onmousedown="return false"></div></div>',init:function(e){var t=this;t.root($($.parseTmpl(t.tpl,e||{})))},content:function(e){var t=this,i=$(e.currentTarget).attr("data-original-title");t.root().find(".edui-tooltip-inner").text(i)},position:function(e){var t=this,i=$(e.currentTarget);t.root().css($.extend({display:"block"},i?{top:i.outerHeight(),left:(i.outerWidth()-t.root().outerWidth())/2}:{}))},show:function(e){if(!$(e.currentTarget).hasClass("edui-disabled")){var t=this;t.content(e),t.root().appendTo($(e.currentTarget)),t.position(e),t.root().css("display","block")}},hide:function(){this.root().css("display","none")},attachTo:function(e){function t(e){var t=this;$.contains(document.body,t.root()[0])||t.root().appendTo(e),t.data("tooltip",t.root()),e.each(function(){$(this).attr("data-original-title")&&$(this).on("mouseenter",$.proxy(t.show,t)).on("mouseleave click",$.proxy(t.hide,t))})}var i=this;"undefined"===$.type(e)?$("[data-original-title]").each(function(e,n){t.call(i,$(n))}):e.data("tooltip")||t.call(i,e)}}),UM.ui.define("tab",{init:function(e){var t=this,i=e.selector;$.type(i)&&(t.root($(i,e.context)),t.data("context",e.context),$(i,t.data("context")).on("click",function(e){t.show(e)}))},show:function(e){var t,i,n,e,r=this,a=$(e.target),o=a.closest("ul");t=a.attr("data-context"),t=t&&t.replace(/.*(?=#[^\s]*$)/,"");var s=a.parent("li");s.length&&!s.hasClass("edui-active")&&(i=o.find(".edui-active:last a")[0],e=$.Event("beforeshow",{target:a[0],relatedTarget:i}),r.trigger(e),e.isDefaultPrevented()||(n=$(t,r.data("context")),r.activate(a.parent("li"),o),r.activate(n,n.parent(),function(){r.trigger({type:"aftershow",relatedTarget:i})})))},activate:function(e,t,i){if(void 0===e)return $(".edui-tab-item.edui-active",this.root()).index();t.find("> .edui-active").removeClass("edui-active"),e.addClass("edui-active"),i&&i()}}),UM.ui.define("separator",{tpl:'<div class="edui-separator" unselectable="on" onmousedown="return false" ></div>',init:function(e){var t=this;return t.root($($.parseTmpl(t.tpl,e))),t}}),function(){var e={},t={},i=[],n=null,r={},a={},o={},s=null;utils.extend(UM,{defaultWidth:500,defaultHeight:500,registerUI:function(t,i){utils.each(t.split(/\s+/),function(t){e[t]=i})},setEditor:function(e){!t[e.id]&&(t[e.id]=e)},registerWidget:function(e,t,i){r[e]=$.extend2(t,{$root:"",_preventDefault:!1,root:function(e){return this.$root||(this.$root=e)},preventDefault:function(){this._preventDefault=!0},clear:!1}),i&&(a[e]=i)},getWidgetData:function(e){return r[e]},setWidgetBody:function(e,t,i){i._widgetData||utils.extend(i,{_widgetData:{},getWidgetData:function(e){return this._widgetData[e]},getWidgetCallback:function(e){var i=this;return function(){return a[e].apply(i,[i,t].concat(Array.prototype.slice.call(arguments,0)))}}});var n=r[e];if(!n)return null;n=i._widgetData[e],n||(n=r[e],n=i._widgetData[e]="function"==$.type(n)?n:utils.clone(n)),n.root(t.edui().getBodyContainer()),n.initContent(i,t),n._preventDefault||n.initEvent(i,t),n.width&&t.width(n.width)},setActiveWidget:function(e){n=e},getEditor:function(e,i){var n=t[e]||(t[e]=this.createEditor(e,i));return s=s?Math.max(n.getOpt("zIndex"),s):n.getOpt("zIndex"),n},setTopEditor:function(e){$.each(t,function(t,i){e==i?e.$container&&e.$container.css("zIndex",s+1):i.$container&&i.$container.css("zIndex",i.getOpt("zIndex"))})},clearCache:function(e){t[e]&&delete t[e]},delEditor:function(e){var i;(i=t[e])&&i.destroy()},ready:function(e){i.push(e)},createEditor:function(e,t){function n(){var t=this.createUI("#"+e,r);r.key=e,r.ready(function(){$.each(i,function(e,t){$.proxy(t,r)()})});var n=r.options;n.initialFrameWidth?n.minFrameWidth=n.initialFrameWidth:n.minFrameWidth=n.initialFrameWidth=r.$body.width()||UM.defaultWidth,t.css({width:n.initialFrameWidth,zIndex:r.getOpt("zIndex")}),UM.browser.ie&&6===UM.browser.version&&document.execCommand("BackgroundImageCache",!1,!0),r.render(e),$.eduitooltip&&$.eduitooltip("attachTo",$("[data-original-title]",t)).css("z-index",r.getOpt("zIndex")+1),t.find("a").click(function(e){e.preventDefault()}),r.fireEvent("afteruiready")}var r=new UM.Editor(t),a=this;return r.langIsReady?$.proxy(n,a)():r.addListener("langReady",$.proxy(n,a)),r},createUI:function(t,i){var n=$(t),r=$('<div class="edui-container"><div class="edui-editor-body"></div></div>').insertBefore(n);if(i.$container=r,i.container=r[0],i.$body=n,browser.ie&&browser.ie9above){$('<span style="padding:0;margin:0;height:0;width:0"></span>').insertAfter(r)}return $.each(e,function(e,t){var n=t.call(i,e);n&&(o[e]=n)}),r.find(".edui-editor-body").append(n).before(this.createToolbar(i.options,i)),r.find(".edui-toolbar").append($('<div class="edui-dialog-container"></div>')),r},createToolbar:function(e,t){var i=$.eduitoolbar(),n=i.edui();if(e.toolbar&&e.toolbar.length){var r=[];$.each(e.toolbar,function(e,t){$.each(t.split(/\s+/),function(e,t){if("|"==t)$.eduiseparator&&r.push($.eduiseparator());else{var i=o[t];"fullscreen"==t?i&&r.unshift(i):i&&r.push(i)}}),r.length&&n.appendToBtnmenu(r)})}else i.find(".edui-btn-toolbar").remove();return i}})}(),UM.registerUI("bold italic redo undo underline strikethrough superscript subscript insertorderedlist insertunorderedlist cleardoc selectall link unlink print preview justifyleft justifycenter justifyright justifyfull removeformat horizontal drafts",function(e){var t=this,i=$.eduibutton({icon:e,click:function(){t.execCommand(e)},title:this.getLang("labelMap")[e]||""});return this.addListener("selectionchange",function(){var t=this.queryCommandState(e);i.edui().disabled(-1==t).active(1==t)}),i}),function(){function e(e){var t=this;if(!e)throw new Error("invalid params, notfound editor");t.editor=e,o[e.uid]=this,e.addListener("destroy",function(){delete o[e.uid],t.editor=null})}var t={},i=["width","height","position","top","left","margin","padding","overflowX","overflowY"],n={},r={},a={},o={};UM.registerUI("fullscreen",function(t){var i=this,n=$.eduibutton({icon:"fullscreen",title:i.options.labelMap&&i.options.labelMap[t]||i.getLang("labelMap."+t),click:function(){i.execCommand(t),UM.setTopEditor(i)}});return i.addListener("selectionchange",function(){var e=this.queryCommandState(t);n.edui().disabled(-1==e).active(1==e)}),i.addListener("ready",function(){i.options.fullscreen&&e.getInstance(i).toggle()}),n}),UM.commands.fullscreen={execCommand:function(t){e.getInstance(this).toggle()},queryCommandState:function(e){return this._edui_fullscreen_status},notNeedUndo:1},e.prototype={toggle:function(){var e=this.editor,t=this.isFullState();e.fireEvent("beforefullscreenchange",!t),this.update(!t),t?this.revert():this.enlarge(),e.fireEvent("afterfullscreenchange",!t),"true"===e.body.contentEditable&&e.fireEvent("fullscreenchanged",!t),e.fireEvent("selectionchange")},enlarge:function(){this.saveSataus(),this.setDocumentStatus(),this.resize()},revert:function(){var e=this.editor.options,t=/%$/.test(e.initialFrameHeight)?"100%":e.initialFrameHeight-this.getStyleValue("padding-top")-this.getStyleValue("padding-bottom")-this.getStyleValue("border-width");$.IE6&&this.getEditorHolder().style.setExpression("height","this.scrollHeight <= "+t+' ? "'+t+'px" : "auto"'),this.revertContainerStatus(),this.revertContentAreaStatus(),this.revertDocumentStatus()},update:function(e){this.editor._edui_fullscreen_status=e},resize:function(){var e=null,t=0,i=0,n=0,r=0,a=this.editor,o=null,s=null;this.isFullState()&&(e=$(window),i=e.width(),t=e.height(),s=this.getEditorHolder(),n=parseInt(domUtils.getComputedStyle(s,"border-width"),10)||0,n+=parseInt(domUtils.getComputedStyle(a.container,"border-width"),10)||0,r+=parseInt(domUtils.getComputedStyle(s,"padding-left"),10)+parseInt(domUtils.getComputedStyle(s,"padding-right"),10)||0,$.IE6&&s.style.setExpression("height",null),o=this.getBound(),$(a.container).css({width:i+"px",height:t+"px",position:$.IE6?"absolute":"fixed",top:o.top,left:o.left,margin:0,padding:0,overflowX:"hidden",overflowY:"hidden"}),$(s).css({width:i-2*n-r+"px",height:t-2*n-(a.options.withoutToolbar?0:$(".edui-toolbar",a.container).outerHeight())-$(".edui-bottombar",a.container).outerHeight()+"px",overflowX:"hidden",overflowY:"auto"}))},saveSataus:function(){for(var e=this.editor.container.style,n=null,r={},a=0,o=i.length;a<o;a++)n=i[a],r[n]=e[n];t[this.editor.uid]=r,this.saveContentAreaStatus(),this.saveDocumentStatus()},saveContentAreaStatus:function(){var e=$(this.getEditorHolder());n[this.editor.uid]={width:e.css("width"),overflowX:e.css("overflowX"),overflowY:e.css("overflowY"),height:e.css("height")}},saveDocumentStatus:function(){var e=$(this.getEditorDocumentBody());r[this.editor.uid]={overflowX:e.css("overflowX"),overflowY:e.css("overflowY")},a[this.editor.uid]={overflowX:$(this.getEditorDocumentElement()).css("overflowX"),overflowY:$(this.getEditorDocumentElement()).css("overflowY")}},revertContainerStatus:function(){$(this.editor.container).css(this.getEditorStatus())},revertContentAreaStatus:function(){var e=this.getEditorHolder(),t=this.getContentAreaStatus();this.supportMin()&&(delete t.height,e.style.height=null),$(e).css(t)},revertDocumentStatus:function(){var e=this.getDocumentStatus();$(this.getEditorDocumentBody()).css("overflowX",e.body.overflowX),$(this.getEditorDocumentElement()).css("overflowY",e.html.overflowY)},setDocumentStatus:function(){$(this.getEditorDocumentBody()).css({overflowX:"hidden",overflowY:"hidden"}),$(this.getEditorDocumentElement()).css({overflowX:"hidden",overflowY:"hidden"})},isFullState:function(){return!!this.editor._edui_fullscreen_status},getEditorStatus:function(){return t[this.editor.uid]},getContentAreaStatus:function(){return n[this.editor.uid]},getEditorDocumentElement:function(){return this.editor.container.ownerDocument.documentElement},getEditorDocumentBody:function(){return this.editor.container.ownerDocument.body},getEditorHolder:function(){return this.editor.body},getDocumentStatus:function(){return{body:r[this.editor.uid],html:a[this.editor.uid]}},supportMin:function(){var e=null;return this._support||(e=document.createElement("div"),this._support="minWidth"in e.style,e=null),this._support},getBound:function(){var e={html:!0,body:!0},t={top:0,left:0},i=null;return $.IE6?(i=this.editor.container.offsetParent,i&&!e[i.nodeName.toLowerCase()]&&(e=i.getBoundingClientRect(),t.top=-e.top,t.left=-e.left),t):t},getStyleValue:function(e){return parseInt(domUtils.getComputedStyle(this.getEditorHolder(),e))}},$.extend(e,{listen:function(){var t=null;e._hasFullscreenListener||(e._hasFullscreenListener=!0,$(window).on("resize",function(){null!==t&&(window.clearTimeout(t),t=null),t=window.setTimeout(function(){for(var e in o)o[e].resize();t=null},50)}))},getInstance:function(t){return o[t.uid]||new e(t),o[t.uid]}}),e.listen()}(),UM.registerUI("link image video map formula",function(e){var t,i,n=this,r={title:n.options.labelMap&&n.options.labelMap[e]||n.getLang("labelMap."+e),url:n.options.UMEDITOR_HOME_URL+"dialogs/"+e+"/"+e+".js"},a=$.eduibutton({icon:e,title:this.getLang("labelMap")[e]||""});return utils.loadFile(document,{src:r.url,tag:"script",type:"text/javascript",defer:"defer"},function(){var o=UM.getWidgetData(e);if(o){if(o.buttons){var s=o.buttons.ok;s&&(r.oklabel=s.label||n.getLang("ok"),s.exec&&(r.okFn=function(){return $.proxy(s.exec,null,n,i)()}));var l=o.buttons.cancel;l&&(r.cancellabel=l.label||n.getLang("cancel"),l.exec&&(r.cancelFn=function(){return $.proxy(l.exec,null,n,i)()}))}o.width&&(r.width=o.width),o.height&&(r.height=o.height),i=$.eduimodal(r),i.attr("id","edui-dialog-"+e).addClass("edui-dialog-"+e).find(".edui-modal-body").addClass("edui-dialog-"+e+"-body"),i.edui().on("beforehide",function(){var e=n.selection.getRange();e.equals(t)&&e.select()}).on("beforeshow",function(){var r=this.root(),a=null,o=null;t=n.selection.getRange(),r.parent()[0]||n.$container.find(".edui-dialog-container").append(r),$.IE6&&(a={width:$(window).width(),height:$(window).height()},o=r.parents(".edui-toolbar")[0].getBoundingClientRect(),r.css({position:"absolute",margin:0,left:(a.width-r.width())/2-o.left,top:100-o.top})),UM.setWidgetBody(e,i,n),UM.setTopEditor(n)}).on("afterbackdrop",function(){this.$backdrop.css("zIndex",n.getOpt("zIndex")+1).appendTo(n.$container.find(".edui-dialog-container")),i.css("zIndex",n.getOpt("zIndex")+2)}).on("beforeok",function(){try{t.select()}catch(e){}}).attachTo(a)}}),n.addListener("selectionchange",function(){var t=this.queryCommandState(e);a.edui().disabled(-1==t).active(1==t)}),a}),UM.registerUI("emotion formula",function(e){var t=this,i=t.options.UMEDITOR_HOME_URL+"dialogs/"+e+"/"+e+".js",n=$.eduibutton({icon:e,title:this.getLang("labelMap")[e]||""});return utils.loadFile(document,{src:i,tag:"script",type:"text/javascript",defer:"defer"},function(){var r={url:i},a=UM.getWidgetData(e);a.width&&(r.width=a.width),a.height&&(r.height=a.height),$.eduipopup(r).css("zIndex",t.options.zIndex+1).addClass("edui-popup-"+e).edui().on("beforeshow",function(){var i=this.root();i.parent().length||t.$container.find(".edui-dialog-container").append(i),UM.setWidgetBody(e,i,t),UM.setTopEditor(t)}).attachTo(n,{offsetTop:-5,offsetLeft:10,caretLeft:11,caretTop:-8}),t.addListener("selectionchange",function(){var t=this.queryCommandState(e);n.edui().disabled(-1==t).active(1==t)})}),n}),UM.registerUI("imagescale",function(){var e,t=this;t.setOpt("imageScaleEnabled",!0),browser.webkit&&t.getOpt("imageScaleEnabled")&&(t.addListener("click",function(i,n){var r=t.selection.getRange(),a=r.getClosedNode(),o=n.target;if(a&&"IMG"==a.tagName&&o==a){if(!e){e=$.eduiscale({$wrap:t.$container}).css("zIndex",t.options.zIndex),t.$container.append(e);var s,l=function(){e.edui().hide()},c=function(e){var t=e.target||e.srcElement;t&&-1==t.className.indexOf("edui-scale")&&l()};e.edui().on("aftershow",function(){$(document).bind("keydown",l),$(document).bind("mousedown",c),t.selection.getNative().removeAllRanges()}).on("afterhide",function(){$(document).unbind("keydown",l),$(document).unbind("mousedown",c);var i=e.edui().getScaleTarget();i.parentNode&&t.selection.getRange().selectNode(i).select()}).on("mousedown",function(i){t.selection.getNative().removeAllRanges();var n=i.target||i.srcElement;n&&-1==n.className.indexOf("edui-scale-hand")&&(s=setTimeout(function(){e.edui().hide()},200))}).on("mouseup",function(e){var t=e.target||e.srcElement;t&&-1==t.className.indexOf("edui-scale-hand")&&clearTimeout(s)})}e.edui().show($(a))}else e&&"none"!=e.css("display")&&e.edui().hide()}),t.addListener("click",function(e,i){if("IMG"==i.target.tagName){new dom.Range(t.document,t.body).selectNode(i.target).select()}}))}),UM.registerUI("autofloat",function(){var e=this,t=e.getLang();e.setOpt({autoFloatEnabled:!0,topOffset:0});var i=!1!==e.options.autoFloatEnabled,n=e.options.topOffset;i&&e.ready(function(){function i(){if(!p){var t=domUtils.getXY(s),i=domUtils.getComputedStyle(s,"position"),r=domUtils.getComputedStyle(s,"left");s.style.width=s.offsetWidth+"px",s.style.zIndex=1*e.options.zIndex+1,s.parentNode.insertBefore(d,s),c||u&&browser.ie?("absolute"!=s.style.position&&(s.style.position="absolute"),s.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-l+n+"px"):"fixed"!=s.style.position&&(s.style.position="fixed",s.style.top=n+"px",("absolute"==i||"relative"==i)&&parseFloat(r)&&(s.style.left=t.x+"px"))}}function r(){d.parentNode&&d.parentNode.removeChild(d),s.style.cssText=o}function a(){var t=h(e.container),n=e.options.toolbarTopOffset||0;t.top<0&&t.bottom-s.offsetHeight>n?i():r()}var o,s,l,c=browser.ie&&browser.version<=6,u=browser.quirks,d=document.createElement("div"),h=function(e){var t;try{t=e.getBoundingClientRect()}catch(e){t={left:0,top:0,height:0,width:0}}for(var i,n={left:Math.round(t.left),top:Math.round(t.top),height:Math.round(t.bottom-t.top),width:Math.round(t.right-t.left)};(i=e.ownerDocument)!==document&&(e=domUtils.getWindow(i).frameElement);)t=e.getBoundingClientRect(),n.left+=t.left,n.top+=t.top;return n.bottom=n.top+n.height,n.right=n.left+n.width,n},p=!1,f=utils.defer(function(){a()},browser.ie?200:100,!0);e.addListener("destroy",function(){$(window).off("scroll resize",a),e.removeListener("keydown",f)}),function(){return UM.ui?1:(alert(t.autofloatMsg),0)}()&&(s=$(".edui-toolbar",e.container)[0],e.addListener("afteruiready",function(){setTimeout(function(){l=$(s).offset().top},100)}),o=s.style.cssText,d.style.height=s.offsetHeight+"px",c&&function(){var e=document.body.style;e.backgroundImage='url("about:blank")',e.backgroundAttachment="fixed"}(),$(window).on("scroll resize",a),e.addListener("keydown",f),e.addListener("resize",function(){r(),d.style.height=s.offsetHeight+"px",a()}),
|
||
e.addListener("beforefullscreenchange",function(e,t){t&&(r(),p=t)}),e.addListener("fullscreenchanged",function(e,t){t||a(),p=t}),e.addListener("sourcemodechanged",function(e,t){setTimeout(function(){a()},0)}),e.addListener("clearDoc",function(){setTimeout(function(){a()},0)}))})}),UM.registerUI("source",function(e){var t=this;t.addListener("fullscreenchanged",function(){t.$container.find("textarea").width(t.$body.width()-10).height(t.$body.height())});var i=$.eduibutton({icon:e,click:function(){t.execCommand(e),UM.setTopEditor(t)},title:this.getLang("labelMap")[e]||""});return this.addListener("selectionchange",function(){var t=this.queryCommandState(e);i.edui().disabled(-1==t).active(1==t)}),i}),UM.registerUI("paragraph fontfamily fontsize",function(e){function t(e,i){var n=$("<span>").html(e).css({display:"inline",position:"absolute",top:-1e7,left:-1e5}).appendTo(document.body),r=n.width();return n.remove(),n=null,r<50?e:(e=e.slice(0,i?-4:-1),e.length?t(e+"...",!0):"...")}var i=this,n=i.options.labelMap&&i.options.labelMap[e]||i.getLang("labelMap."+e),r={label:n,title:n,comboboxName:e,items:i.options[e]||[],itemStyles:[],value:[],autowidthitem:[]},a=null,o=null;if(0==r.items.length)return null;switch(e){case"paragraph":r=function(e){var i=[];for(var n in e.items)e.value.push(n),i.push(n),e.autowidthitem.push(t(n));return e.items=i,e.autoRecord=!1,e}(r);break;case"fontfamily":r=function(e){for(var i=null,n=[],r=0,a=e.items.length;r<a;r++)i=e.items[r].val,n.push(i.split(/\s*,\s*/)[0]),e.itemStyles.push("font-family: "+i),e.value.push(i),e.autowidthitem.push(t(n[r]));return e.items=n,e}(r);break;case"fontsize":r=function(e){var t=null,i=[];e.itemStyles=[],e.value=[];for(var n=0,r=e.items.length;n<r;n++)t=e.items[n],i.push(t),e.itemStyles.push("font-size: "+t+"px");return e.value=e.items,e.items=i,e.autoRecord=!1,e}(r)}return a=$.eduibuttoncombobox(r).css("zIndex",i.getOpt("zIndex")+1),o=a.edui(),o.on("comboboxselect",function(t,n){i.execCommand(e,n.value)}).on("beforeshow",function(){0===a.parent().length&&a.appendTo(i.$container.find(".edui-dialog-container")),UM.setTopEditor(i)}),this.addListener("selectionchange",function(t){var i=this.queryCommandState(e),n=this.queryCommandValue(e);o.button().edui().disabled(-1==i).active(1==i),n&&(n=n.replace(/['"]/g,"").toLowerCase().split(/['|"]?\s*,\s*[\1]?/),o.selectItemByLabel(n))}),o.button().addClass("edui-combobox")}),UM.registerUI("forecolor backcolor",function(e){function t(){return domUtils.getComputedStyle(r[0],"background-color")}var i=this,n=null,r=null,a=null;return this.addListener("selectionchange",function(){var t=this.queryCommandState(e);a.edui().disabled(-1==t).active(1==t)}),a=$.eduicolorsplitbutton({icon:e,caret:!0,name:e,title:i.getLang("labelMap")[e],click:function(){i.execCommand(e,t())}}),r=a.edui().colorLabel(),n=$.eduicolorpicker({name:e,lang_clearColor:i.getLang("clearColor")||"",lang_themeColor:i.getLang("themeColor")||"",lang_standardColor:i.getLang("standardColor")||""}).on("pickcolor",function(t,n){window.setTimeout(function(){r.css("backgroundColor",n),i.execCommand(e,n)},0)}).on("show",function(){UM.setActiveWidget(colorPickerWidget.root())}).css("zIndex",i.getOpt("zIndex")+1),a.edui().on("arrowclick",function(){n.parent().length||i.$container.find(".edui-dialog-container").append(n),n.edui().show(a,{caretDir:"down",offsetTop:-5,offsetLeft:8,caretLeft:11,caretTop:-8}),UM.setTopEditor(i)}).register("click",a,function(){n.edui().hide()}),a})}(jQuery),define("baidueditor",["ueditorconfig","jquery"],function(e){return function(){return e.baidueditor}}(this)),UM.I18N["zh-cn"]={labelMap:{anchor:"锚点",undo:"撤销",redo:"重做",bold:"加粗",indent:"首行缩进",snapscreen:"截图",italic:"斜体",underline:"下划线",strikethrough:"删除线",subscript:"下标",fontborder:"字符边框",superscript:"上标",formatmatch:"格式刷",source:"源代码",blockquote:"引用",pasteplain:"纯文本粘贴模式",selectall:"全选",print:"打印",preview:"预览",horizontal:"分隔线",removeformat:"清除格式",time:"时间",date:"日期",unlink:"取消链接",insertrow:"前插入行",insertcol:"前插入列",mergeright:"右合并单元格",mergedown:"下合并单元格",deleterow:"删除行",deletecol:"删除列",splittorows:"拆分成行",splittocols:"拆分成列",splittocells:"完全拆分单元格",mergecells:"合并多个单元格",deletetable:"删除表格",cleardoc:"清空文档",insertparagraphbeforetable:"表格前插入行",insertcode:"代码语言",fontfamily:"字体",fontsize:"字号",paragraph:"段落格式",image:"图片",edittable:"表格属性",edittd:"单元格属性",link:"超链接",emotion:"表情",spechars:"特殊字符",searchreplace:"查询替换",map:"百度地图",gmap:"Google地图",video:"视频",help:"帮助",justifyleft:"居左对齐",justifyright:"居右对齐",justifycenter:"居中对齐",justifyjustify:"两端对齐",forecolor:"字体颜色",backcolor:"背景色",insertorderedlist:"有序列表",insertunorderedlist:"无序列表",fullscreen:"全屏",directionalityltr:"从左向右输入",directionalityrtl:"从右向左输入",rowspacingtop:"段前距",rowspacingbottom:"段后距",highlightcode:"插入代码",pagebreak:"分页",insertframe:"插入Iframe",imagenone:"默认",imageleft:"左浮动",imageright:"右浮动",attachment:"附件",imagecenter:"居中",wordimage:"图片转存",lineheight:"行间距",edittip:"编辑提示",customstyle:"自定义标题",autotypeset:"自动排版",webapp:"百度应用",touppercase:"字母大写",tolowercase:"字母小写",background:"背景",template:"模板",scrawl:"涂鸦",music:"音乐",inserttable:"插入表格",drafts:"草稿箱",formula:"数学公式"},paragraph:{p:"段落",h1:"标题 1",h2:"标题 2",h3:"标题 3",h4:"标题 4",h5:"标题 5",h6:"标题 6"},fontfamily:{songti:"宋体",kaiti:"楷体",heiti:"黑体",lishu:"隶书",yahei:"微软雅黑",andaleMono:"andale mono",arial:"arial",arialBlack:"arial black",comicSansMs:"comic sans ms",impact:"impact",timesNewRoman:"times new roman"},ok:"确认",cancel:"取消",closeDialog:"关闭对话框",tableDrag:"表格拖动必须引入uiUtils.js文件!",autofloatMsg:"工具栏浮动依赖编辑器UI,您首先需要引入UI文件!",anthorMsg:"链接",clearColor:"清空颜色",standardColor:"标准颜色",themeColor:"主题颜色",property:"属性",default:"默认",modify:"修改",justifyleft:"左对齐",justifyright:"右对齐",justifycenter:"居中",justify:"默认",clear:"清除",anchorMsg:"锚点",delete:"删除",clickToUpload:"点击上传",unset:"尚未设置语言文件",t_row:"行",t_col:"列",more:"更多",pasteOpt:"粘贴选项",pasteSourceFormat:"保留源格式",tagFormat:"只保留标签",pasteTextFormat:"只保留文本",image:{static:{lang_tab_local:"本地上传",lang_tab_imgSearch:"网络图片",lang_input_dragTip:"支持图片拖拽上传",lang_btn_add:"添加"},uploadError:"上传出错"},emotion:{static:{lang_input_choice:"精选",lang_input_Tuzki:"兔斯基",lang_input_BOBO:"BOBO",lang_input_lvdouwa:"绿豆蛙",lang_input_babyCat:"baby猫",lang_input_bubble:"泡泡",lang_input_youa:"有啊"}},gmap:{static:{lang_input_address:"地址",lang_input_search:"搜索",address:{value:"北京"}},searchError:"无法定位到该地址!"},link:{static:{lang_input_text:"文本内容:",lang_input_url:"链接地址:",lang_input_title:"标题:",lang_input_target:"是否在新窗口打开:"},validLink:"只支持选中一个链接时生效",httpPrompt:"您输入的超链接中不包含http等协议名称,默认将为您添加http://前缀"},map:{static:{lang_city:"城市",lang_address:"地址",city:{value:"北京"},lang_search:"搜索",lang_dynamicmap:"插入动态地图"},cityMsg:"请选择城市",errorMsg:"抱歉,找不到该位置!"},video:{static:{lang_tab_insertV:"插入视频",lang_video_url:"视频网址",lang_video_size:"视频尺寸",lang_videoW:"宽度",lang_videoH:"高度",lang_alignment:"对齐方式",videoSearchTxt:{value:"请输入搜索关键字!"},videoType:{options:["全部","热门","娱乐","搞笑","体育","科技","综艺"]},videoSearchBtn:{value:"百度一下"},videoSearchReset:{value:"清空结果"}},numError:"请输入正确的数值,如123,400",floatLeft:"左浮动",floatRight:"右浮动",default:"默认",block:"独占一行",urlError:"输入的视频地址有误,请检查后再试!",loading:" 视频加载中,请等待……",clickToSelect:"点击选中",goToSource:"访问源视频",noVideo:" 抱歉,找不到对应的视频,请重试!"},formula:{static:{lang_tab_common:"常用公式",lang_tab_symbol:"符号",lang_tab_letter:"字母"}}},define("bdlanglang",["baidueditor"],function(e){return function(){return e.bdlanglang}}(this)),define("modules/console/expdesktop/model/report/controller",["app-utils","jquery","bdlanglang"],function(e,t,i){function n(e,t,i){this.element=e,this.data=t,this.report_data=this.data.getGroup_res_data,this.service=i}var r={init:function(){var t=this;return t.addreportannex(),t.data.events.downloadattachment=function(t){var i=e.getDomain(e.domain_type.report)+t.path;window.location.href=i},t.data.events.submit_report=function(){t.data.submit_status="submit",t.save_submit("submit",t.data.report_list,t.data.report_data.id)},t.data.events.save_report=function(){t.data.submit_status="save",t.save_submit("save",t.data.report_list,t.data.report_data.id)},t.data.events.deleteattachment=function(i){layer.confirm("确实删除该报告附件吗?",{btn:["确定","取消"],title:"提示"},function(n){layer.close(n),t.service.deleteattachment(i).done(function(i){e.msg_success("删除成功"),t.init()}).fail(function(e){})},function(){})},t.data.events.completionFun=function(e){t.data.fields_report[0].value=e},t.content=UM.getEditor(t.element,{initialFrameWidth:"100%"}),t.reportData=t.report_data,t.service.expReportList({rel_c_s_g_id:t.report_data.rel_c_s_g_id}).done(function(i){if(0===i.report_list.length)return!1;t.data.report_list=1;var n=i.report_list[0];t.data.annex_data=[],n.attach_list.forEach(function(i){var n={title:i.title,file_name:i.file_name,path:i.path,size:i.size};t.data.annex_data.push(n),i.size>0?i.size_name=e.convertSize(i.size):i.size_name=0}),t.data.report_data=n,"submit"===n.submit_status&&t.setDisabled();var r=e.unescapeHTML(n.desc);t.content.setContent(r),"finished"===n.process?t.data.fields_report[0].value=0:"part"===n.process?t.data.fields_report[0].value=1:"unfinished"===n.process&&(t.data.fields_report[0].value=2)}).fail(function(e){}),t},save_submit:function(i,n,r){var a=this;if(!a.content.getContent())return e.msg_warning("请填写实验报告内容"),!1;"submit"===i?layer.confirm("提交后将不允许进行保存或提交操作,是否确认?",{btn:["确定","取消"]},function(e){layer.close(e),a.data.annex_number>0?t("#testListAction").trigger("click"):a.post_report(i,n,r)}):a.data.annex_number>0?t("#testListAction").trigger("click"):a.post_report(i,n,r)},post_report:function(t,i,n){var r=this,a=r.content.getContent(),o=r.data.fields_report[0].value,s="";0===o?s="finished":1===o?s="part":2===o&&(s="unfinished");var l=layer.load(2,{shade:[.1,"#ffffff"]}),c={name:r.reportData.title,desc:a,process:s,submit_status:t};r.data.annex_data.length>0?(c.attach_list=r.data.annex_data,r.data.annex_data=[]):c.attach_list=[],0===i?(c.rel_c_s_g_id=r.reportData.rel_c_s_g_id,r.service.createreport(c).done(function(i){r.init(),layer.close(l),"submit"===t?(e.msg_success("提交成功"),r.setDisabled()):e.msg_success("保存成功")}).fail(function(e){layer.close(l)})):1===i&&r.service.changeEreport(n,c).done(function(i){r.init(),"submit"===t?(e.msg_success("提交成功"),r.setDisabled()):e.msg_success("保存成功"),layer.close(l)}).fail(function(e){layer.close(l)})},addreportannex:function(){var t=this;layui.use("upload",function(){var i=layui.jquery,n=layui.upload,r=i("#demoList"),a=n.render({elem:"#testList",url:"/upload_attachment/",accept:"file",multiple:!0,auto:!1,field:"upload",exts:"doc|docx",size:51200,acceptMime:"application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",bindAction:"#testListAction",before:function(e){},choose:function(n){var o=this.files=n.pushFile();n.preview(function(s,l,c){t.data.annex_number=t.data.annex_number+1;var u=i(['<tr id="upload-'+s+'">',"<td title = "+l.name+">"+l.name+"</td>","<td title = "+e.convertSize(l.size)+">"+e.convertSize(l.size)+"</td>","<td>等待</td>","<td>",'<button class="layui-btn layui-btn-xs demo-reload layui-hide">重传</button>','<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>',"</td>","</tr>"].join(""));u.find(".demo-reload").on("click",function(){n.upload(s,l),t.data.annex_number=t.data.annex_number+1}),u.find(".demo-delete").on("click",function(){t.data.annex_number=t.data.annex_number-1,delete o[s],u.remove(),a.config.elem.next()[0].value=""}),r.append(u)})},done:function(i,n,a){if(1===i[0].success){var o=e.splitFileName(i[0].file_name),s={title:o,file_name:i[0].file_name,size:i[0].file_size,path:i[0].url};t.data.annex_data.push(s),t.data.annex_number=t.data.annex_number-1,delete this.files[n];r.find("tr#upload-"+n).remove()}this.error(n,a)},allDone:function(e){t.post_report(t.data.submit_status,t.data.report_list,t.data.report_data.id),t.data.annex_number=0},error:function(e,t){var i=r.find("tr#upload-"+e),n=i.children();n.eq(2).html('<span style="color: #FF5722;">上传失败</span>'),n.eq(3).find(".demo-reload").removeClass("layui-hide")},msg:function(t){e.msg_error(t)}})})},setDisabled:function(){this.data.reportBtn="disabled",UM.getEditor("content").setDisabled("fullscreen")}};return t.extend(n.prototype,r),n}),function(e,t){if("function"==typeof define&&define.amd)define("filesaver",[],t);else if("undefined"!=typeof exports)t();else{var i={exports:{}};t(),e.FileSaver=i.exports}}(this,function(){"use strict";function e(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}function t(e,t,i){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){o(n.response,t,i)},n.onerror=function(){console.error("could not download file")},n.send()}function i(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return t.status>=200&&t.status<=299}function n(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(i){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var r="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,a=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=r.saveAs||("object"!=typeof window||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(e,a,o){var s=r.URL||r.webkitURL,l=document.createElement("a");a=a||e.name||"download",l.download=a,l.rel="noopener","string"==typeof e?(l.href=e,l.origin!==location.origin?i(l.href)?t(e,a,o):n(l,l.target="_blank"):n(l)):(l.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(l.href)},4e4),setTimeout(function(){n(l)},0))}:"msSaveOrOpenBlob"in navigator?function(r,a,o){if(a=a||r.name||"download","string"==typeof r)if(i(r))t(r,a,o);else{var s=document.createElement("a");s.href=r,s.target="_blank",setTimeout(function(){n(s)})}else navigator.msSaveOrOpenBlob(e(r,o),a)}:function(e,i,n,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,i,n);var s="application/octet-stream"===e.type,l=/constructor/i.test(r.HTMLElement)||r.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||s&&l||a)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},u.readAsDataURL(e)}else{var d=r.URL||r.webkitURL,h=d.createObjectURL(e);o?o.location=h:location.href=h,o=null,setTimeout(function(){d.revokeObjectURL(h)},4e4)}});r.saveAs=o.saveAs=o,"undefined"!=typeof module&&(module.exports=o)}),define("modules/console/expdesktop/model/code/controller",["app-utils","jquery","filesaver"],function(e,t,i){function n(i,n,r){this.data=i,this.service=n,this.client=r,this.fileSystem=null;var a=this;a.data.events.code_refresh=function(){a.init("start");var e=a.data.guac_file_current_path;a.fileSystem.requestInputStream(e)},a.data.events.step_attachment=function(t){window.open(e.getDomain(e.domain_type.step_att)+t.api_url)},a.data.events.code_open_folder=function(e){"/"==a.data.guac_file_current_path?a.data.guac_file_current_path=a.data.guac_file_current_path+e+"/":a.data.guac_file_current_path=a.data.guac_file_current_path+"/"+e+"/",a.fileSystem.requestInputStream(a.data.guac_file_current_path)},a.data.events.code_change_folder=function(e){var i=t.extend(!0,[],a.data.guac_file_full_path);i.splice(e+1,i.length-e-1);var n=i.join("/");1==i.length?n="/":n+="/",a.data.guac_file_current_path=n,a.fileSystem.requestInputStream(a.data.guac_file_current_path)},a.data.events.code_download_file=function(e){var t=a.data.guac_file_current_path+"/"+e;a.fileSystem.requestInputStream(t)},a.data.$watch("guac_file_current_path",function(e){a.data.guac_file_full_path="/"==e?[""]:e.split("/")}),setTimeout(function(){t(".guac_upload_file_btn").off("click").on("click",function(){return t("#guac_upload_file").click()}),t("#guac_upload_file").off("change").on("change",function(){var e=document.getElementById("guac_upload_file"),t=e.files[0];a.uploadFile(a.fileSystem,t)})},2e3)}var r={init:function(e){var t=this;return"start"==e?(t.data.show_vm.show=!1,t.fileSystem||t.guacDownload(t.client),t.data.show_vm.title="","windows"==t.data.show_vm.code_data.os_type.toLowerCase()?t.data.show_vm.prompt="上传/下载目录为C:\\sftp":t.data.show_vm.prompt='上传/下载目录为"/home/code"目录'):"end"==e&&(t.data.show_vm.title="实验环境尚未启动,无法上传/下载文件",t.data.step_code_list="",t.data.show_vm.code_data="",t.data.show_vm.prompt="",t.data.guac_file_current_path="/",t.data.guac_file_lists=[]),t},guacDownload:function(e){var t=this;e.onfilesystem=function(e){t.fileSystem=e;var i=t.data.guac_file_current_path;t.fileSystem.requestInputStream(i),e.onbody=function(e,i,n){e.sendAck("OK",Guacamole.Status.Code.SUCCESS);var r;r=window.BlobBuilder?new BlobBuilder:window.WebKitBlobBuilder?new WebKitBlobBuilder:window.MozBlobBuilder?new MozBlobBuilder:new function(){var e=[];this.append=function(t){e.push(new Blob([t],{type:i}))},this.getBlob=function(){return new Blob(e,{type:i})}},e.onblob=function(t){for(var i=window.atob(t),n=new ArrayBuffer(i.length),a=new Uint8Array(n),o=0;o<i.length;o++)a[o]=i.charCodeAt(o);r.append(n),length+=n.byteLength,e.sendAck("OK",0)},e.onend=function(){var e=r.getBlob();if(-1!=i.indexOf("stream-index+json")){var a=new FileReader;a.addEventListener("loadend",function(){var e=JSON.parse(a.result);t.data.guac_file_lists=[];for(var i in e){var n="";n=-1!=e[i].indexOf("stream-index+json")?"folder":"file";var r=t.data.guac_file_current_path;t.data.guac_file_lists.push({name:i.split(r)[1],type:e[i],typename:n})}}),a.readAsText(e,"UTF-8")}else{var o=n.split("/"),s=o[o.length-1];saveAs(e,s)}}}}},uploadFile:function(e,t){var i=this,n={},r=new FileReader;return r.onloadend=function(){var a=e.createOutputStream(t.type,i.data.guac_file_current_path+t.name),o=new Uint8Array(r.result),s=0;n.name=t.name,n.mimetype=t.type,n.length=o.length,a.onack=function(e){if(e.isError())return console.log(e.message),!1;var t=o.subarray(s,s+4096),n=i.bufferToBase64(t);a.sendBlob(n),(s+=4096)>=o.length&&(a.sendEnd(),i.data.events.code_refresh())}},r.readAsArrayBuffer(t),n},bufferToBase64:function(e){var t=Array.prototype.map.call(e,function(e){return String.fromCharCode(e)}).join("");return btoa(t)}};return t.extend(n.prototype,r),n}),define("text!modules/console/expdesktop/pop/help/index.html",[],function(){return'<div ms-controller="">\r\n \r\n\r\n\r\n\r\n <div class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active" id="course">\r\n <div class="icode-form-group clearfix" ms-for="field in fields">\r\n\r\n <div class="icode-form-l fl">\r\n <label>{{ field.title }}:</label>\r\n </div>\r\n \r\n <div class="icode-form-r fl" ms-if="field.type==\'input\'">\r\n <input ms-attr="{\'placeholder\':field.tip.title,\'name\':field.field}" class="icode-form-long text" type="text" required/>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'textarea\'">\r\n <textarea ms-attr="{\'name\':field.field}" class="icode-form-long" required></textarea>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'radio\'">\r\n <label ms-for = "r in field.data" ms-attr = "{for: r.field}">\r\n \r\n <input type="radio" ms-attr="{id:r.field,name:field.field,value:r.value,field:field.field,checked:r.checked==true }" >\r\n {{r.title}}\r\n </label>\r\n </div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n <div class="icode-footer">\r\n\r\n <button class="btn" ms-for="button in buttons" ms-attr="{name:button.field}" >{{button.title}}</button>\r\n\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n'}),define("text!modules/console/expdesktop/pop/help/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n "fields": [\r\n {\r\n "type": "radio",\r\n "field": "op_type",\r\n "value": "",\r\n "data": [\r\n {\r\n "field": "see",\r\n "value": "read",\r\n "checked": true\r\n },\r\n {\r\n "field": "control",\r\n "value": "write",\r\n "checked": false\r\n }\r\n ]\r\n },\r\n {\r\n "type": "input",\r\n "field": "op_user",\r\n "value": "",\r\n "required": true,\r\n "assist_usernotempty": { "field": "assist_usernotempty" },\r\n "tip": { "field": "assist_user_tip" }\r\n },\r\n {\r\n "type": "textarea",\r\n "field": "assist_msg",\r\n "value": "",\r\n "placer": "",\r\n "assist_msgnotempty": { "field": "assist_msgnotempty" }\r\n\r\n }\r\n ],\r\n "buttons": [\r\n\r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "send",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "请求协助",\r\n "op_type": "协助模式",\r\n\r\n "see": "观看",\r\n "control": "控制",\r\n "send": "发送",\r\n "op_user": "协助者",\r\n "assist_msg": "协助信息",\r\n "cancel": "取消",\r\n "assist_usernotempty": "请输入协助者手机号",\r\n "assist_msgnotempty": "请输入协助信息",\r\n "assist_user_tip": "手机号",\r\n "mobile_length": "请输入11位手机号码",\r\n "mobile_regexp": "请输入正确的手机号码",\r\n "assist_msg_length": "协助信息在255字符以内。"\r\n\r\n }\r\n }\r\n}'}),define("modules/console/expdesktop/pop/help/controller",["popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/help/index.html","text!modules/console/expdesktop/pop/help/lang.json"],function(e,t,i,n){function r(e,t,r,a,o){this.language=e,this.appOptions=t,this.lang=n,this.step_id=a,this.template=i,this.onCreated=o,this.service=r}var a={initAvalon:function(e){},onInitialize:function(e){var t=this,i=(t.data,t.getFieldsByName("op_user")),n=t.getFieldsByName("assist_msg");t.container.find("#data_form").bootstrapValidator({message:"This value is not valid",feedbackIcons:{valid:"glyphicon glyphicon-ok",invalid:"glyphicon glyphicon-remove",validating:"glyphicon glyphicon-refresh"},fields:{op_user:{message:i.assist_usernotempty.title,validators:{notEmpty:{message:i.assist_usernotempty.title},stringLength:{min:11,max:11,message:t.i18n.mobile_length},regexp:{regexp:/^1[3|5|8]{1}[0-9]{9}$/,message:t.i18n.mobile_regexp}}},assist_msg:{message:n.assist_msgnotempty.title,validators:{notEmpty:{message:n.assist_msgnotempty.title},stringLength:{min:1,max:255,message:t.i18n.assist_msg_length}}}}}),t.container.delegate('button[name="send"]:not(.disabled)',"click",function(){t.container.find("#data_form").bootstrapValidator("validate");var e=t.container.find("#data_form").data("bootstrapValidator").isValid(),i=t.generateData();e&&i&&(t.container.find('button[name="send"]').addClass("disabled"),t.service.get_assist_user({step_id:t.step_id,mobile:i.op_user}).done(function(e){i.op_user=e.user_id,i.step_id=t.step_id,t.service.send_assist(i).done(function(e){t.onCreated&&(t.onCreated(i),t.container.find(".closeModal").trigger("click"))}).fail(function(e){t.container.find('button[name="send"]').removeClass("disabled")})}))})},getModelLabel:function(){return"pop_heplvm_view"}};return t.extend(r.prototype,e.prototype),t.extend(r.prototype,a),r}),define("text!modules/console/expdesktop/pop/lookrecover/index.html",[],function(){return'<div ms-controller="">\r\n\r\n\r\n <div ms-attr="{id:pop_id}" class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content" style="min-width:500px">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div class="tab-content-apply" ms-if ="fields.length == 0">\r\n 暂无实验环境\r\n </div>\r\n <div class="tab-content-apply" ms-if ="fields.length != 0">\r\n\r\n <table class="table-style">\r\n <thead>\r\n <th>名称</th>\r\n <th>课程名称</th>\r\n <th>步骤名称</th>\r\n <th>描述</th>\r\n <th>操作</th>\r\n </thead>\r\n <tbody>\r\n <tr ms-for = "val in fields">\r\n <td>{{val.name}}</td>\r\n <td>{{val.course_name}}</td>\r\n <td>{{val.step_name}}</td>\r\n <td>{{val.desc}}</td>\r\n <td style="width:66px">\r\n <span ms-if ="data_recover.course_id ==val.course_id&&data_recover.group_id == val.group_id&&recover_show ==true" style="color:#04875b;cursor:pointer;margin-right:10px" ms-on-click = "events.restore(val)">恢复</span>\r\n <span style="color:#04875b;cursor:pointer" ms-on-click = "events.delete_lab(val)">删除</span>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </div>\r\n <div class="qc-paging" ms-attr="{id:page_id}"></div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n'}),define("text!modules/console/expdesktop/pop/lookrecover/lang.json",[],function(){return'{\r\n "config": {\r\n "page_id": "lookrecover_list_id",\r\n "header": {\r\n "field": "title",\r\n "icon": "fa-money",\r\n "parent": {\r\n "field": "account"\r\n }\r\n },\r\n "recover_show":false,\r\n "role_name":"",\r\n "fields": [\r\n ],\r\n "data_recover":""\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "已保存的实验环境(恢复已保存的实验环境之前,请先将当前实验环境关闭)",\r\n "savestep": "确定",\r\n "delete":"确定要删除保存的实验环境吗?",\r\n "trueBtn":"确定",\r\n "falseBtn":"取消",\r\n "creating":"准备中",\r\n "created":"创建"\r\n },\r\n "en": {\r\n\r\n }\r\n }\r\n}'}),define("modules/console/expdesktop/pop/lookrecover/controller",["popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/lookrecover/index.html","text!modules/console/expdesktop/pop/lookrecover/lang.json"],function(e,t,i,n){function r(e,t,r,a,o,s){this.language=e,this.appOptions=t,this.lang=n,this.template=i,this.onCreated=s,this.service=r,this.data_recover=o,this.recover_show=a}var a={initAvalon:function(e){var t=this;t.data.recover_show=t.recover_show,e.events.restore=function(e){t.container.find(".closeModal").trigger("click"),t.onCreated(e)},e.events.delete_lab=function(e){layer.confirm(t.i18n.delete,{btn:[t.i18n.trueBtn,t.i18n.falseBtn]},function(i){layer.close(i);var n=layer.load(1,{share:!1});t.service.delete_lab(e.id).done(function(e){t.lab_save_list(),layer.close(n),t.onCreated("delete")}).fail(function(e){layer.close(n)})})}},onInitialize:function(){var e=this;this.data;e.data.data_recover=e.data_recover,e.lab_save_list()},lab_save_list:function(){var e=this,t={range_type:"local"},i=layer.load(1,{share:!1});e.service.lab_save_list(t).done(function(t){e.data.fields=t.lab_save_list,layer.close(i)}).fail(function(e){layer.close(i)})},getModelLabel:function(){return"lookrecover"}};return t.extend(r.prototype,e.prototype),t.extend(r.prototype,a),r}),define("text!modules/console/expdesktop/pop/saveexp/index.html",[],function(){return'<div ms-controller="">\r\n\r\n\r\n <div ms-attr="{id:pop_id}" class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active" id="course">\r\n <div class="icode-form-group icode-form-groups clearfix" ms-for="field in fields">\r\n\r\n <div class="icode-form-l fl">\r\n <label>{{ field.title }}:</label>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'input\'">\r\n <input ms-attr="{\'placeholder\':field.placer,\'name\': field.name}" class="icode-form-long-student text" type="text" />\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'radio\'">\r\n <label ms-attr = "{for: \'save_\' + val.id}" ms-for = "val in field.data">\r\n <input ms-attr = "{id: \'save_\' + val.id, value:val.field, checked:val.checked, name:field.name}" type="radio">\r\n {{val.title}}\r\n </label>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'textarea\'">\r\n <textarea ms-attr="{\'placeholder\':field.placer,\'name\': field.name}" class="icode-form-long-student" maxlength ="50"></textarea>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'file\'">\r\n <input class="text" type="file" />\r\n <p>{{field.placer}}</p>\r\n </div>\r\n </div>\r\n <div class="icode-footer">\r\n\r\n <button ms-for="btn in @fieldbuttons" ms-class="[\'btn\',\'btn-\'+btn.style]"\r\n ms-attr="{\'data-dismiss\':btn.dismiss,name:btn.field}">{{ btn.title }}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n'}),define("text!modules/console/expdesktop/pop/saveexp/lang.json",[],function(){
|
||
return'{\r\n "config": {\r\n "pop_id": "pop_save_lab",\r\n "header": {\r\n "field": "title",\r\n "icon": "fa-money",\r\n "parent": {\r\n "field": "account"\r\n }\r\n },\r\n "fields": [\r\n {\r\n "type":"input",\r\n "field":"name",\r\n "placer":"请输入名称",\r\n "name":"name"\r\n },\r\n {\r\n "type":"radio",\r\n "field":"keep_ip",\r\n "name":"keep_ip",\r\n "data":[\r\n {\r\n\r\n "id":"keep_true",\r\n "field":"true",\r\n "checked":false\r\n },\r\n {\r\n "id":"keep_false",\r\n "field":"false",\r\n "checked":true\r\n }\r\n ]\r\n },\r\n {\r\n "type":"textarea",\r\n "field":"desc",\r\n "placer":"请输入描述",\r\n "name":"desc"\r\n }\r\n ],\r\n "fieldbuttons": [\r\n {\r\n "field": "cancelcourse",\r\n "style": "cancel",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "savestep",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ],\r\n "keep_attach_res":{\r\n "type":"radio",\r\n "field":"keep_attach_res",\r\n "name":"keep_attach_res",\r\n "data":[\r\n {\r\n\r\n "id":"attach_true",\r\n "field":"true",\r\n "checked":true\r\n },\r\n {\r\n "id":"attach_false",\r\n "field":"false",\r\n "checked":false\r\n }\r\n ]\r\n }\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "保存实验环境",\r\n "cancelcourse": "取消",\r\n "savestep": "确定",\r\n "name":"名称",\r\n "desc":"描述",\r\n "true":"是",\r\n "false": "否",\r\n "keep_ip":"保存IP地址",\r\n "data_set":"保存数据集",\r\n "keep_attach_res":"保存素材路径"\r\n },\r\n "en": {\r\n\r\n }\r\n }\r\n}'}),define("modules/console/expdesktop/pop/saveexp/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/saveexp/index.html","text!modules/console/expdesktop/pop/saveexp/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=o,this.service=i,this.id=a}var o={onInitialize:function(){var t=this;this.data;this.container.delegate(".btn-cancel","click",function(){t.container.find(".closeModal").trigger("click")}),this.container.delegate(".btn-success","click",function(){t.container.find("#data_form").bootstrapValidator("validate");var i=t.container.find("#data_form").data("bootstrapValidator").isValid(),n=t.generateData();if(!i)return!1;var r={step_id:t.id,name:n.name,desc:n.desc,keep_ip:n.keep_ip,keep_attach_res:"false"},a=layer.load(1,{share:!1});t.service.post_lab_save(r).done(function(i){layer.close(a),t.onCreated(),e.msg_success("保存成功"),t.container.find(".closeModal").trigger("click")}).fail(function(t){layer.close(a),e.msg_error("保存失败")})}),t.container.find("#data_form").bootstrapValidator({fields:{name:{validators:{notEmpty:{message:"名称不能为空"}}}}})},getModelLabel:function(){return"attachpopmodel"}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),function(e){"use strict";var t=document,i={modules:{},status:{},timeout:10,event:{},dir:"/static/public/lib/layui/"},n=function(){this.v="2.5.3"},r=function(){t.currentScript?t.currentScript.src:function(){for(var e,i=t.scripts,n=i.length-1,r=n;r>0;r--)if("interactive"===i[r].readyState){e=i[r].src;break}e||i[n].src}();return"/static/public/lib/layui/"}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},o="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),s={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",transfer:"modules/transfer",tree:"modules/tree",table:"modules/table",element:"modules/element",rate:"modules/rate",colorpicker:"modules/colorpicker",slider:"modules/slider",carousel:"modules/carousel",flow:"modules/flow",util:"modules/util",code:"modules/code",jquery:"modules/jquery",dropdown:"modules/dropdown",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=i,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,i.status[e]=!0};return"function"==typeof t&&t(function(n,r){e(n,r),i.callback[n]=function(){t(e)}}),this};return r&&(t=e,e=[]),!layui["layui.all"]&&layui["layui.mobile"]?a.call(n):(n.use(e,a),n)},n.prototype.use=function(e,n,l){function c(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(i.modules[f]=t,p.removeChild(g),function e(){if(++m>1e3*i.timeout/4)return a(f+" is not a valid module");i.status[f]?u():setTimeout(e,4)}())}function u(){l.push(layui[f]),e.length>1?d.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var d=this,h=i.dir=i.dir?i.dir:r,p=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(d.each(e,function(t,i){"jquery"===i&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],i.host=i.host||(h.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&s[f]||!layui["layui.all"]&&layui["layui.mobile"]&&s[f])return u(),d;if(i.modules[f])!function e(){if(++m>1e3*i.timeout/4)return a(f+" is not a valid module");"string"==typeof i.modules[f]&&i.status[f]?u():setTimeout(e,4)}();else{var g=t.createElement("script"),v=(s[f]?h+"lay/":/^\{\/\}/.test(d.modules[f])?"":i.base||"")+(d.modules[f]||f)+".js";v=v.replace(/^\{\/\}/,""),g.async=!0,g.charset="utf-8",g.src=v+function(){var e=!0===i.version?i.v||(new Date).getTime():i.version||"";return e?"?v="+e:""}(),p.appendChild(g),!g.attachEvent||g.attachEvent.toString&&g.attachEvent.toString().indexOf("[native code")<0||o?g.addEventListener("load",function(e){c(e,v)},!1):g.attachEvent("onreadystatechange",function(e){c(e,v)}),i.modules[f]=v}return d},n.prototype.getStyle=function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},n.prototype.link=function(e,n,r){var o=this,s=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var c=(r||e).replace(/\.|\//g,""),u=s.id="layuicss-"+c,d=0;return s.rel="stylesheet",s.href=e+(i.debug?"?v="+(new Date).getTime():""),s.media="all",t.getElementById(u)||l.appendChild(s),"function"!=typeof n?o:(function r(){if(++d>1e3*i.timeout/100)return a(e+" timeout");1989===parseInt(o.getStyle(t.getElementById(u),"width"))?function(){n()}():setTimeout(r,100)}(),o)},i.callback={},n.prototype.factory=function(e){if(layui[e])return"function"==typeof i.callback[e]?i.callback[e]:null},n.prototype.addcss=function(e,t,n){return layui.link(i.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,i){var n=new Image;if(n.src=e,n.complete)return t(n);n.onload=function(){n.onload=null,"function"==typeof t&&t(n)},n.onerror=function(e){n.onerror=null,"function"==typeof i&&i(e)}},n.prototype.config=function(e){e=e||{};for(var t in e)i[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in s)e[t]=s[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var i in e)t[i]||t.modules[i]?a("模块名 "+i+" 已被占用"):t.modules[i]=e[i];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,i={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,""),i.href="/"+e,e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),i.search[t[0]]=t[1]}():i.path.push(t)}),i):i},n.prototype.data=function(t,i,n){if(t=t||"layui",n=n||localStorage,e.JSON&&e.JSON.parse){if(null===i)return delete n[t];i="object"==typeof i?i:{key:i};try{var r=JSON.parse(n[t])}catch(e){var r={}}return"value"in i&&(r[i.key]=i.value),i.remove&&delete r[i.key],n[t]=JSON.stringify(r),i.key?r[i.key]:r}},n.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},n.prototype.device=function(t){var i=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return(e=(i.match(t)||[])[1])||!1},r={os:function(){return/windows/.test(i)?"windows":/linux/.test(i)?"linux":/iphone|ipod|ipad|ios/.test(i)?"ios":/mac/.test(i)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((i.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(i),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:a}},n.prototype.each=function(e,t){var i,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(i in e)if(t.call(e[i],i,e[i]))break}else for(i=0;i<e.length&&!t.call(e[i],i,e[i]);i++);return n},n.prototype.sort=function(e,t,i){var n=JSON.parse(JSON.stringify(e||[]));return t?(n.sort(function(e,i){var n=/^-?\d+$/,r=e[t],a=i[t];return n.test(r)&&(r=parseFloat(r)),n.test(a)&&(a=parseFloat(a)),r&&!a?1:!r&&a?-1:r>a?1:r<a?-1:0}),i&&n.reverse(),n):n},n.prototype.stope=function(t){t=t||e.event;try{t.stopPropagation()}catch(e){t.cancelBubble=!0}},n.prototype.onevent=function(e,t,i){return"string"!=typeof e||"function"!=typeof i?this:n.event(e,t,null,i)},n.prototype.event=n.event=function(e,t,n,r){var a=this,o=null,s=t.match(/\((.*)\)$/)||[],l=(e+"."+t).replace(s[0],""),c=s[1]||"",u=function(e,t){!1===(t&&t.call(a,n))&&null===o&&(o=!1)};return r?(i.event[l]=i.event[l]||{},i.event[l][c]=[r],this):(layui.each(i.event[l],function(e,t){if("{*}"===c)return void layui.each(t,u);""===e&&layui.each(t,u),c&&e===c&&layui.each(t,u)}),o)},e.layui=new n}(window),define("layui",function(){}),define("text!modules/console/expdesktop/pop/dataset/index.html",[],function(){return'<div ms-controller="">\r\n\r\n <style>\r\n .layui-table-view{\r\n margin-top: 0px;\r\n }\r\n .layui-table-tips-c{\r\n font-size: 14px!important;\r\n }\r\n </style>\r\n\r\n\r\n <div class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="" class="tab-content form-horizontal">\r\n <table class="layui-hide" id="sd_dataset_list"></table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n'}),define("text!modules/console/expdesktop/pop/dataset/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n "placer":{\r\n "field": "placer"\r\n },\r\n "buttons": [\r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "className":"cancel"\r\n },\r\n {\r\n "field": "send",\r\n "style": "success",\r\n "className":"send"\r\n }\r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "placer":"请上传所需要的代码文件",\r\n "title": "数据集",\r\n "send": "上传",\r\n "cancel": "取消"\r\n\r\n }\r\n }\r\n}'}),define("modules/console/expdesktop/pop/dataset/controller",["popcontrollerbase_v2","jquery","layui","text!modules/console/expdesktop/pop/dataset/index.html","text!modules/console/expdesktop/pop/dataset/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=o,this.service=i,this.dataset_list=a}var o={initAvalon:function(e){},onInitialize:function(e){var t=this;t.data;t.dataset_list.forEach(function(e){"success"==e.mount_status?e.mount_status_desc="成功":e.mount_status_desc="失败"}),layui.use("table",function(){layui.table.render({elem:"#sd_dataset_list",cols:[[{field:"name",width:100,title:"名称"},{field:"size",width:100,title:"大小(GB)"},{field:"desc",width:120,title:"描述"},{field:"cifs_path",width:180,title:"cifs_path"},{field:"nfs_path",width:180,title:"nfs_path"},{field:"mount_path",width:180,title:"挂载路径"},{field:"mount_status_desc",width:100,title:"挂载状态"}]],data:t.dataset_list})})},getModelLabel:function(){return"pop_upload_vm_view"}};return t.extend(a.prototype,e.prototype),t.extend(a.prototype,o),a}),define("text!modules/console/expdesktop/pop/exception/index.html",[],function(){return'<div ms-controller="">\r\n <div class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div class="layui-tab" lay-filter="extab">\r\n <ul class="layui-tab-title">\r\n <li class="layui-this" lay-id="exadd">异常提交</li>\r\n <li lay-id="exlist">异常记录</li>\r\n </ul>\r\n\r\n <div class="layui-tab-content" style="padding:0;min-height:210px">\r\n <div class="layui-tab-item layui-show">\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active" id="course">\r\n <div\r\n class="icode-form-group clearfix"\r\n ms-for="field in fields"\r\n >\r\n <div class="icode-form-l fl">\r\n <label>{{ field.title }}:</label>\r\n </div>\r\n\r\n <div class="icode-form-r fl" ms-if="field.type==\'select\'">\r\n <select ms-attr="{\'name\':field.field}">\r\n <option\r\n ms-attr="{value:d.id,title:d.desc}"\r\n ms-for="d in field.data"\r\n ms-html="d.name"\r\n >\r\n </option>\r\n </select>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'textarea\'">\r\n <textarea\r\n ms-attr="{\'name\':field.field,\'placeholder\':field.placer,}"\r\n class="icode-form-long layui-textarea"\r\n rows="10"\r\n ></textarea>\r\n </div>\r\n </div>\r\n <div class="icode-footer">\r\n <button\r\n class="btn"\r\n ms-for="button in buttons"\r\n ms-attr="{name:button.field}"\r\n >\r\n {{ button.title }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="layui-tab-item" >\r\n <script type="text/html" id="rowbar">\r\n <a class="layui-btn layui-btn-xs" lay-event="detail">查看详细</a>\r\n <\/script>\r\n <table id="tb_exceptions" lay-filter="exceptions"></table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n'}),define("text!modules/console/expdesktop/pop/exception/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n "fields": [\r\n {\r\n "type": "select",\r\n "field": "ex_type",\r\n "value": "",\r\n "data": [\r\n\r\n ]\r\n },\r\n\r\n {\r\n "type": "textarea",\r\n "field": "ex_msg",\r\n "value": "",\r\n "placer": "",\r\n "ex_msgnotempty": { "field": "ex_msgnotempty" }\r\n\r\n }\r\n ],\r\n "buttons": [\r\n\r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "send",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ],\r\n "exceptions": [],\r\n "rep_page_id": "exception_page_id"\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "报告异常",\r\n "ex_type": "类型",\r\n "send": "提交",\r\n "ex_msg": "描述",\r\n "cancel": "取消",\r\n "ex_msg_length": "描述信息在255字符以内。",\r\n "ex_msgnotempty": "请填写描述信息。",\r\n "unsolved": "未处理",\r\n "solving": "处理中",\r\n "solved": "已处理"\r\n }\r\n }\r\n}'}),define("modules/console/expdesktop/pop/exception/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/exception/index.html","text!modules/console/expdesktop/pop/exception/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o){this.language=e,this.appOptions=t,this.lang=r,this.step_id=a,this.template=n,this.onCreated=o,this.service=i}var o={initAvalon:function(e){},onInitialize:function(t){var i=this,n=(i.data,i.getFieldsByName("ex_type")),r=i.getFieldsByName("ex_msg");layui.use("element",function(){layui.element.on("tab(extab)",function(e){1===e.index&&i.grid&&i.grid.resize("tb_exceptions")})}),layui.use("table",function(){i.grid=layui.table,i.grid.render({elem:"#tb_exceptions",limit:5,limits:[5,10,15,20,30,50,100],page:!0,text:{none:"暂无异常记录"},url:"/ecos/qcec_console_nsq/v1/exception_order/pages",request:{pageName:"page_index",limitName:"page_size"},where:{rel_c_s_g_id:i.step_id},cols:[[{field:"exception_type_name",title:"异常类型"},{field:"status_name",title:"状态"},{field:"result",title:"处理结果",toolbar:"#rowbar"},{field:"created_at",title:"提交时间"},{field:"updated_at",title:"处理时间"}]],parseData:function(t){return t.exception_order_list.forEach(function(t){t.status_name=i.i18n[t.status]||t.status,t.created_at=e.formatTimeStandard(t.created_at,"YYYY-MM-DD"),t.updated_at?t.updated_at=e.formatTimeStandard(t.updated_at,"YYYY-MM-DD"):t.updated_at="未处理"}),{code:0,count:t.counts,data:t.exception_order_list}}}),i.grid.on("tool(exceptions)",function(e){var t=e.data;"detail"==e.event&&layer.open({title:"处理结果",content:t.answer||"暂未处理"})})}),i.service.getvmexception_type().done(function(e){n.data=e.exception_order_list}),i.container.find("#data_form").bootstrapValidator({message:"This value is not valid",feedbackIcons:{valid:"glyphicon glyphicon-ok",invalid:"glyphicon glyphicon-remove",validating:"glyphicon glyphicon-refresh"},fields:{ex_msg:{message:r.ex_msgnotempty.title,validators:{notEmpty:{message:r.ex_msgnotempty.title},stringLength:{min:1,max:255,message:i.i18n.ex_msg_length}}}}}),i.container.delegate('button[name="send"]:not(.disabled)',"click",function(){i.container.find("#data_form").bootstrapValidator("validate");var t=i.container.find("#data_form").data("bootstrapValidator").isValid(),n=i.generateData();t&&n&&(i.container.find('button[name="send"]').addClass("disabled"),i.service.submit_vmexception({mode:"study",rel_c_s_g_id:i.step_id,content:n.ex_msg,exception_type_id:n.ex_type}).done(function(t){i.container.find(".closeModal").trigger("click"),e.msg_success("异常工单提交成功,工作人员正在处理,请等待几分钟后刷新页面,查看处理结果")}))})},getModelLabel:function(){return"pop_exceptionvm_view"}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),function(e,t,i,n){function r(t,i){this.$element=e(t),this.options=e.extend({},o,i),this._defaults=o,this._name=a,this.init()}var a="webuiPopover",o={placement:"auto",width:"auto",height:"auto",trigger:"click",style:"",delay:300,cache:!0,multi:!1,arrow:!0,title:"",content:"",closeable:!1,padding:!0,url:"",type:"html",template:'<div class="webui-popover"><div class="arrow"></div><div class="webui-popover-inner"><a href="#" class="close">x</a><h3 class="webui-popover-title"></h3><div class="webui-popover-content"><i class="glyphicon glyphicon-refresh"></i> <p></p></div></div></div>'};r.prototype={init:function(){"click"===this.options.trigger?this.$element.off("click").on("click",e.proxy(this.toggle,this)):this.$element.off("mouseenter mouseleave").on("mouseenter",e.proxy(this.mouseenterHandler,this)).on("mouseleave",e.proxy(this.mouseleaveHandler,this)),this._poped=!1,this._inited=!0},destroy:function(){this.hide(),this.$element.data("plugin_"+a,null),this.$element.off(),this.$target&&this.$target.remove()},hide:function(t){t&&t.preventDefault();var i=e.Event("hide.webui.popover");this.$element.trigger(i),this.$target&&this.$target.removeClass("in").hide(),this.$element.trigger("hidden.webui.popover")},toggle:function(e){e&&e.preventDefault(),this[this.getTarget().hasClass("in")?"hide":"show"]()},hideAll:function(){e("div.webui-popover").removeClass("in").hide()},show:function(){var t=this.getElementPosition(),n=this.getTarget().removeClass().addClass("webui-popover"),r=this.getContentElement(),a=n[0].offsetWidth,o=n[0].offsetHeight,s="bottom",l=e.Event("show.webui.popover");this.options.multi||this.hideAll(),this.$element.trigger(l),this.options.cache&&this._poped||(this.isAsync()?this.setContentASync(this.options.content):this.setContent(this.getContent()),this.setTitle(this.getTitle()),this.options.closeable||n.find(".close").off("click").remove(),n.show()),"auto"!==this.options.width&&n.width(this.options.width),"auto"!==this.options.height&&r.height(this.options.height),this.options.arrow||n.find(".arrow").remove(),n.remove().css({top:-1e3,left:-1e3,display:"block"}).appendTo(i.body),a=n[0].offsetWidth,o=n[0].offsetHeight,s=this.getPlacement(t,o),this.initTargetEvents();var c=this.getTargetPositin(t,s,a,o);if(this.$target.css(c.position).addClass(s).addClass("in"),"iframe"===this.options.type){var u=n.find("iframe");u.width(n.width()).height(u.parent().height())}this.options.style&&this.$target.addClass("webui-popover-"+this.options.style),this.options.padding||(r.css("height",r.outerHeight()),this.$target.addClass("webui-no-padding")),this.options.arrow||this.$target.css({margin:0}),this.options.arrow&&c.arrowOffset&&this.$target.find(".arrow").css(c.arrowOffset),this._poped=!0,this.$element.trigger("shown.webui.popover")},getTarget:function(){return this.$target||(this.$target=e(this.options.template)),this.$target},getTitleElement:function(){return this.getTarget().find(".webui-popover-title")},getContentElement:function(){return this.getTarget().find(".webui-popover-content")},getTitle:function(){return this.options.title||this.$element.attr("data-title")||this.$element.attr("title")},setTitle:function(e){var t=this.getTitleElement();e?t.html(e):t.remove()},hasContent:function(){return this.getContent()},getContent:function(){if(this.options.url)"iframe"===this.options.type&&(this.content=e('<iframe frameborder="0"></iframe>').attr("src",this.options.url));else if(!this.content){var t="";t=e.isFunction(this.options.content)?this.options.content.apply(this.$element[0],arguments):this.options.content,this.content=this.$element.attr("data-content")||t}return this.content},setContent:function(e){var t=this.getTarget();this.getContentElement().html(e),this.$target=t},isAsync:function(){return"async"===this.options.type},setContentASync:function(t){var i=this;e.ajax({url:this.options.url,type:"GET",cache:this.options.cache,success:function(n){t&&e.isFunction(t)?i.content=t.apply(i.$element[0],[n]):i.content=n,i.setContent(i.content)}})},mouseenterHandler:function(){var e=this;e._timeout&&clearTimeout(e._timeout),e.getTarget().is(":visible")||e.show()},mouseleaveHandler:function(){var e=this;e._timeout=setTimeout(function(){e.hide()},e.options.delay)},initTargetEvents:function(){"click"!==this.options.trigger&&this.$target.off("mouseenter mouseleave").on("mouseenter",e.proxy(this.mouseenterHandler,this)).on("mouseleave",e.proxy(this.mouseleaveHandler,this)),this.$target.find(".close").off("click").on("click",e.proxy(this.hide,this))},getPlacement:function(e,t){var n,r=i.documentElement,a=i.body,o=r.clientWidth,s=Math.max(a.scrollTop,r.scrollTop),l=Math.max(a.scrollLeft,r.scrollLeft),c=Math.max(0,e.left-l),u=Math.max(0,e.top-s);return n="function"==typeof this.options.placement?this.options.placement.call(this,this.getTarget()[0],this.$element[0]):this.$element.data("placement")||this.options.placement,"auto"===n&&(n=c<o/3?u>t+20?"top-right":"bottom-right":c<2*o/3?u>t+20?"top":"bottom":u>t+20?"top-left":"bottom-left"),n},getElementPosition:function(){return e.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTargetPositin:function(e,t,i,n){var r=e,a=this.$element.outerWidth(),o={},s={},l=(this.options.arrow,0);switch(t){case"bottom":o={top:r.top+r.height,left:r.left+r.width/2-i/2};break;case"top":o={top:r.top-n-l,left:r.left+r.width/2-i/2};break;case"left":o={top:r.top+r.height/2-n/2,left:r.left-i-l};break;case"right":o={top:r.top+r.height/2-n/2,left:r.left+r.width};break;case"top-right":o={top:r.top-n-l,left:r.left},s={left:a/2};break;case"top-left":o={top:r.top-n-l,left:r.left-i+r.width},s={left:i-a/2};break;case"bottom-right":o={top:r.top+r.height,left:r.left},s={left:a/2};break;case"bottom-left":o={top:r.top+r.height,left:r.left-i+r.width},s={left:i-a/2}}return{position:o,arrowOffset:s}}},e.fn[a]=function(t){return this.each(function(){var i=e.data(this,"plugin_"+a);i?"destroy"===t?i.destroy():"string"==typeof t&&i[t]():(t?"string"==typeof t?"destroy"!==t&&(i=new r(this,null),i[t]()):"object"==typeof t&&(i=new r(this,t)):i=new r(this,null),e.data(this,"plugin_"+a,i))})}}(jQuery,window,document),define("webpopover",function(){}),define("modules/console/expdesktop/pop/msg/controller",["app-utils","jquery","moment","webpopover"],function(e,t,i,n){function r(){}var a={settings:{trigger:"click",title:"消息",width:300,height:480,multi:!0,closeable:!0,style:"",padding:!0},init:function(e){var i=this;i.savemsg(e);var n=i.getmsgs();return i.settings.content=n,t("#realtime_msg").webuiPopover("destroy").webuiPopover(i.settings),t("#realtime_msg").click(function(e){i.events()}),i},savemsg:function(e){if(e){msgs=sessionStorage.getItem("realtime_msgs",[]),json_msgs=JSON.parse(msgs),json_msgs||(json_msgs=[]),json_msgs.push(e);for(var t=json_msgs.length,i=0;i<t&&json_msgs.length>SDC.realtime_num;i++)json_msgs.shift();sessionStorage.setItem("realtime_msgs",JSON.stringify(json_msgs))}},getmsgs:function(){msgs=JSON.parse(sessionStorage.getItem("realtime_msgs"));var e=[],i=t("<ul></ul>");if(msgs){for(var n=0;n<msgs.length;n++){var r=msgs[n],a=this.setli(r);e.push(a)}i.append(e)}return t("#msg_num").text(e.length),i.prop("outerHTML")},setContent:function(i){var n=this;i.nickname=i.teacher_nickname||i.answer_real_name,i.content=i.content||i.answer,i.id=e.get_order_id("msg_"),e.msg_success("一条来自"+i.nickname+"老师的消息",null,{positionClass:"toast-bottom-right"}),n.savemsg(i);for(var r=t(".webui-popover-content ul"),a=t(".webui-popover-content ul li"),o=a.length,s=0;s<o&&a.length>=SDC.realtime_num;s++)r.children().first().remove();var l=n.setli(i);r.length?(r.append(l),n.events()):(n.settings.content="<ul>"+l+"</ul>",t("#realtime_msg").webuiPopover("destroy").webuiPopover(n.settings),t("#realtime_msg").click(function(e){n.events()})),t("#msg_num").text(a.length+1)},delmsg:function(e){msgs=sessionStorage.getItem("realtime_msgs",[]),json_msgs=JSON.parse(msgs);for(var t=0;t<json_msgs.length;t++){json_msgs[t].id==e&&json_msgs.splice(t,1)}sessionStorage.setItem("realtime_msgs",JSON.stringify(json_msgs))},events:function(){var e=this;t(".webui-popover-content li content").click(function(e){t(this).toggleClass("p_elipsis")}),t(".webui-popover-content li img").click(function(e){var i="<img src='"+t(this).attr("src")+"' style='max-width:1024px;max-height:768px'/>";layer.open({type:1,title:"图片预览",closeBtn:1,area:["1024px","768px"],skin:"layui-layer-nobg",shadeClose:!0,content:i})}),t(".del-msg").click(function(i){id=t(this).attr("id"),t(this).parent().remove();var n=t(".webui-popover-content ul li");t("#msg_num").text(n.length),e.delmsg(id)})},setli:function(e){return"<li class='textLeft'><em>"+e.nickname+"</em><em>"+i(e.created_at).format("YYYY-MM-DD hh:mm:ss")+'</em><a href="javascript:void(0)" id="'+e.id+'"class="del-msg" ><i class="layui-icon layui-icon-delete"></i> </a><content class=\''+e.action+"'>"+e.content+"</content></li>"}};return t.extend(r.prototype,a),r}),define("text!modules/console/expdesktop/pop/vpn/index.html",[],function(){
|
||
return'<div ms-controller="">\r\n <div class="icode fade" tabindex="-1" role="dialog" style="width:480px;height:420px;background: #ffffff;">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div class="layui-tab layui-tab-brief sd-custom-vpn-tab" lay-filter="vpn">\r\n <ul class="layui-tab-title">\r\n <li class="layui-this" lay-id="vpnbase">vpn基本信息</li>\r\n <li lay-id="vpnclient">客户端下载</li>\r\n <li lay-id="vpnpwd">修改密码</li>\r\n </ul>\r\n\r\n <div class="layui-tab-content" style="padding:0;min-height:210px">\r\n <div class="layui-tab-item layui-show">\r\n <div class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active" id="course">\r\n <div\r\n class="icode-form-group clearfix"\r\n ms-for="field in fields"\r\n >\r\n <div class="icode-form-l fl">\r\n <label>{{ field.title }}:</label>\r\n </div>\r\n\r\n <div class="icode-form-r fl" ms-if="field.type==\'text\'">\r\n <label>{{ field.value }}</label>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'link\'">\r\n <label><a class="sd-custom-vpn-href" href="javascript:void(0);" ms-on-click="events.download()">下载</a></label>\r\n </div>\r\n </div>\r\n <div\r\n class="icode-form-group clearfix"> \r\n <div class="icode-form-l fl">\r\n \r\n </div>\r\n <div class="icode-form-r fl">\r\n <label> <a class="sd-custom-vpn-href" href="/portal/help/180" target="_blank">vpn连接方法</a></label>\r\n </div>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div class="layui-tab-item" >\r\n <div class="sd-custom-vpn-table">\r\n <table id="tb_vpnclient" ></table>\r\n </div>\r\n\r\n </div>\r\n <div class="layui-tab-item" >\r\n <form class="layui-form" action="" id="data_form" style="margin:20px 10px 10px 10px;padding-bottom: 0px;">\r\n <div class="layui-form-item">\r\n <label class="layui-form-label">旧密码:</label>\r\n <div class="layui-input-block">\r\n <input name="old_password" class="layui-input sd-custom-layui-input" type="password" placeholder="请输入旧密码" autocomplete="off" lay-verify="title">\r\n </div>\r\n </div>\r\n <div class="layui-form-item">\r\n <label class="layui-form-label">新密码:</label>\r\n <div class="layui-input-block">\r\n <input name="new_password" class="layui-input sd-custom-layui-input" type="password" placeholder="请输入新密码" autocomplete="off">\r\n </div>\r\n </div>\r\n <div class="layui-form-item">\r\n <div class="layui-input-block">\r\n <button class="layui-btn" name="change_pwd">修改</button>\r\n </div>\r\n </div>\r\n</form>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n <div class="icode-footer">\r\n <button\r\n class="btn"\r\n ms-for="button in buttons"\r\n ms-attr="{name:button.field}"\r\n >\r\n {{ button.title }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n'}),define("text!modules/console/expdesktop/pop/vpn/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n "fields": [\r\n {\r\n "type": "text",\r\n "field": "username",\r\n "value": ""\r\n },\r\n\r\n {\r\n "type": "text",\r\n "field": "password",\r\n "value": "",\r\n "placer": ""\r\n\r\n },\r\n {\r\n "type": "link",\r\n "field": "download_vpnconfig",\r\n "value": "",\r\n "name": ""\r\n \r\n\r\n }\r\n ],\r\n "buttons": [\r\n\r\n {\r\n "field": "cancel",\r\n "style": "success"\r\n\r\n }\r\n ],\r\n "vpnclients": [\r\n {\r\n "name": "openvpn-2.4.7-Linux.tar.gz",\r\n "system": "Linux",\r\n "link": "https://download.shuidilab.cn/labtools/openvpn-2.4.7-Linux.tar.gz"\r\n },\r\n {\r\n "name": "openvpn-install-2.3.18-I001-x86_64.exe",\r\n "system": "Windows XP",\r\n "link": "https://download.shuidilab.cn/labtools/openvpn-install-2.3.18-I001-x86_64.exe"\r\n },\r\n {\r\n "name": "openvpn-install-2.4.7-I606-Win7.exe",\r\n "system": "Windows 7",\r\n "link": " https://download.shuidilab.cn/labtools/openvpn-install-2.4.7-I606-Win7.exe"\r\n },\r\n {\r\n "name": "openvpn-install-2.4.7-I606-Win10.exe",\r\n "system": "Windows8/Windows10",\r\n "link": "https://download.shuidilab.cn/labtools/openvpn-install-2.4.7-I606-Win10.exe"\r\n },\r\n {\r\n "name": "openvpn-2.4.7-Mac.zip",\r\n "system": "MacOS",\r\n "link": "https://download.shuidilab.cn/labtools/openvpn-2.4.7-Mac.zip"\r\n }\r\n ],\r\n "rep_page_id": "exception_page_id"\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "vpn连接",\r\n "username": "用户名",\r\n "password": "密码",\r\n "download_vpnclient": "客户端",\r\n "download_vpnconfig": "配置文件",\r\n "cancel": "关闭",\r\n "old_passwordnotempty": "请输入旧密码",\r\n "new_passwordnotempty": "请输入新密码",\r\n "unsolved": "未处理",\r\n "solving": "处理中",\r\n "solved": "已处理"\r\n\r\n }\r\n }\r\n}'}),define("modules/console/expdesktop/pop/vpn/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/vpn/index.html","text!modules/console/expdesktop/pop/vpn/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o){this.language=e,this.appOptions=t,this.lang=r,this.obj=a,this.template=n,this.onCreated=o,this.service=i}var o={initAvalon:function(e){var t=this;e.events.download=function(){t.service.download_vpnconfig({lab_id:t.obj.lab_id}).done(function(e){t.savetofile(e.config_name,e.config_content)})}},onInitialize:function(t){var i=this,n=(i.data,i.getFieldsByName("username")),r=i.getFieldsByName("password"),a=layer.load(3);i.service.get_vpn({lab_id:i.obj.lab_id,mode:i.obj.mode}).done(function(e){n.value=e.user_name,r.value=e.user_passwd_plaintext}).always(function(){layer.close(a)}),layui.use("element",function(){layui.element.on("tab(extab)",function(e){1===e.index&&i.grid&&i.grid.resize("tb_exceptions")})}),layui.use("table",function(){i.grid=layui.table,i.grid.render({elem:"#tb_vpnclient",limit:5,limits:[5,10,15,20,30,50,100],page:!0,text:{none:"暂无客户端软件"},data:i.data.vpnclients,request:{pageName:"page_index",limitName:"page_size"},cols:[[{field:"name",title:"名称",templet:function(e){return"<a href='"+e.link+"' target='_blank'>"+e.name+"</a>"}},{field:"system",title:"操作系统"}]]})}),i.container.find("#data_form").bootstrapValidator({message:"This value is not valid",feedbackIcons:{valid:"glyphicon glyphicon-ok",invalid:"glyphicon glyphicon-remove",validating:"glyphicon glyphicon-refresh"},fields:{old_password:{message:i.i18n.old_passwordnotempty,validators:{notEmpty:{message:i.i18n.old_passwordnotempty},callback:{message:"旧密码不正确",callback:function(e){return e===r.value}}}},new_password:{message:i.i18n.new_passwordnotempty,validators:{notEmpty:{message:i.i18n.new_passwordnotempty},stringLength:{min:8,max:16,message:"请输入8到16位密码"},regexp:{regexp:/^(?=.*[a-zA-Z]+)(?=.*[0-9]+)[a-zA-Z0-9]+$/,message:"必须是数字和字母组合"}}}}}),i.container.delegate('button[name="change_pwd"]:not(.disabled)',"click",function(){i.container.find("#data_form").bootstrapValidator("validate");var t=i.container.find("#data_form").data("bootstrapValidator").isValid(),n=i.generateData();t&&n&&(i.container.find('button[name="change_pwd"]').addClass("disabled"),i.service.change_vpnpwd({user_passwd_plaintext:n.new_password}).done(function(t){r.value=t.user_passwd_plaintext,i.container.find(".closeModal").trigger("click"),e.msg_success("密码修改成功")}).fail(function(){}).always(function(){i.container.find('button[name="change_pwd"]').removeClass("disabled")}))})},savetofile:function(e,t){var i=new Blob([t],{type:"application/octet-stream"});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(i,e);else{var n=window.document.createElement("a");n.href=window.URL.createObjectURL(i),n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}},getModelLabel:function(){return"pop_exceptionvm_view"}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),define("text!modules/console/expdesktop/pop/questions/index.html",[],function(){return'<div ms-controller="">\r\n <div ms-attr="{id:pop_id}" class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active" id="course">\r\n <div style="margin-left: 20px;line-height: 24px;" class="icode-form-group icode-form-groups clearfix" ms-for="field in fields">\r\n <div>\r\n <span>{{ field.title }}</span>\r\n <span style="margin-left:10px;color:red">{{field.error}}</span>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'input\'">\r\n <input ms-attr="{\'placeholder\':field.placer,\'name\': field.name}" class="icode-form-long-student text" type="text" />\r\n </div>\r\n <div ms-if="field.type==\'radio\'">\r\n <label ms-for = "val in field.data" style="display: block;">\r\n <input style="margin:0 2px" ms-attr="{ value:val.value, name:field.name}" type="radio">\r\n {{val.title}}\r\n </label>\r\n </div>\r\n <div ms-if="field.type === \'checkbox\'">\r\n <label ms-for = "val in field.data" style="display: block;">\r\n <input ms-duplex="field.value" style="margin:0 2px" ms-attr = "{value:val.value, name:field.name}" type="checkbox">\r\n {{val.title}}\r\n </label>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'textarea\'">\r\n <textarea ms-attr="{\'placeholder\':field.placer,\'name\': field.name}" class="icode-form-long-student" maxlength ="50"></textarea>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'file\'">\r\n <input class="text" type="file" />\r\n <p>{{field.placer}}</p>\r\n </div>\r\n </div>\r\n <div class="icode-footer">\r\n\r\n <li ms-for="button in fieldbuttons">\r\n <button ms-attr="{name:button.field}" class="btn" ms-class="{hide:button.hide==true}">{{button.title}}</button>\r\n </li>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n'}),define("text!modules/console/expdesktop/pop/questions/lang.json",[],function(){return'{\r\n "config": {\r\n "pop_id": "pop_save_lab",\r\n "header": {\r\n "field": "title",\r\n "icon": "fa-money",\r\n "parent": {\r\n "field": "account"\r\n }\r\n },\r\n "submit":false,\r\n "answer":[],\r\n "fields": [\r\n \r\n ],\r\n "fieldbuttons": [\r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "hide":true,\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "submit",\r\n "style": "success",\r\n "hide":false,\r\n "dismiss": ""\r\n }\r\n ],\r\n "keep_attach_res":{\r\n "type":"radio",\r\n "field":"keep_attach_res",\r\n "name":"keep_attach_res",\r\n "data":[\r\n {\r\n\r\n "id":"attach_true",\r\n "field":"true",\r\n "checked":true\r\n },\r\n {\r\n "id":"attach_false",\r\n "field":"false",\r\n "checked":false\r\n }\r\n ]\r\n }\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "课后习题",\r\n "cancel": "返回",\r\n "submit": "提交",\r\n "name":"名称",\r\n "desc":"描述",\r\n "true":"是",\r\n "false": "否",\r\n "keep_ip":"保存IP地址",\r\n "data_set":"保存数据集",\r\n "keep_attach_res":"保存素材路径"\r\n },\r\n "en": {\r\n\r\n }\r\n }\r\n}'}),define("modules/console/expdesktop/pop/questions/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/questions/index.html","text!modules/console/expdesktop/pop/questions/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o,s,l){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=l,this.service=s,this.step_id=i,this.rel_c_s_g_id=a,this.question=o}var o={initAvalon:function(e){},onInitialize:function(){var e=this;this.data;i(".qc-modal").addClass("modal-index"),e.container.find(".closeModal").css("display","none");var t=[],n=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];e.question.test.forEach(function(e,i){var r=i+1,a={type:e.type,title:r+". "+e.question,name:"question"+i,data:[],value:[],error:""};e.choice.forEach(function(e,t){a.data[t]={title:n[t].toUpperCase()+". "+e,value:n[t].toUpperCase()}}),t.push(a)}),e.data.fields=t,e.data.answer=e.question.answer,this.container.delegate('button[name="submit"]',"click",function(){e.container.find("#data_form").bootstrapValidator("validate");var t=e.container.find("#data_form").data("bootstrapValidator").isValid(),i=e.generateData();if(!t)return!1;for(var n={answer:[]},r=e.data.fields,a=0;a<r.length;a++)if("radio"===r[a].type&&i[r[a].name])n.answer.push(i[r[a].name]);else{if(!("checkbox"===r[a].type&&r[a].value.length>0))return void layer.msg("请先填写答案再提交",{zIndex:200000001,icon:5});n.answer.push(r[a].value.join(""))}if(e.data.submit)return void layer.msg("您已经提交,请勿重新提交",{zIndex:200000001,icon:5});e.data.submit=!0;var o={test_true:0,test_count:r.length};if(n.answer.forEach(function(t,i){t!=e.data.answer[i]?e.data.fields[i].error=e.data.answer[i].toUpperCase():(e.data.fields[i].error="",o.test_true+=1)}),e.onCreated(e.question,o),o.test_count==o.test_true)layer.alert("您的正确率为: 100%",{zIndex:200000001});else{var s=(100/o.test_count).toFixed(2);layer.alert("您的正确率为:"+s*o.test_true+"%",{zIndex:200000001})}e.container.find('button[name="submit"]').addClass("hide"),e.container.find('button[name="cancel"]').removeClass("hide")}),this.container.delegate('button[name="cancel"]',"click",function(){i(".qc-modal").removeClass("modal-index"),e.container.find(".closeModal").trigger("click")})},getModelLabel:function(){return"attachpopmodel"}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),function(e,t){"function"==typeof define&&define.amd?define("overlayscrollbars",[],function(){return t(e,e.document,void 0)}):"object"==typeof exports?module.exports=t(e,e.document,void 0):t(e,e.document,void 0)}("undefined"!=typeof window?window:this,function(e,t,i){"use-strict";var n="OverlayScrollbars",r={o:"object",f:"function",a:"array",s:"string",n:"number",u:"undefined"},a={c:"class",s:"style",i:"id",oH:"offsetHeight",cH:"clientHeight",sH:"scrollHeight",oW:"offsetWidth",cW:"clientWidth",sW:"scrollWidth"},o={wW:function(){return e.innerWidth||t.documentElement[a.cW]||t.body[a.cW]},wH:function(){return e.innerHeight||t.documentElement[a.cH]||t.body[a.cH]},mO:function(){return e.MutationObserver||e.WebKitMutationObserver||e.WebkitMutationObserver||e.MozMutationObserver||i},rO:function(){return e.ResizeObserver||e.WebKitResizeObserver||e.WebkitResizeObserver||e.MozResizeObserver||i},rAF:function(){return e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.oRequestAnimationFrame||e.msRequestAnimationFrame||function(t){return e.setTimeout(t,1e3/60)}},cAF:function(){return e.cancelAnimationFrame||e.webkitCancelAnimationFrame||e.mozCancelAnimationFrame||e.oCancelAnimationFrame||e.msCancelAnimationFrame||function(t){return e.clearTimeout(t)}},now:function(){return Date.now()||(new Date).getTime()},stpP:function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},prvD:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},page:function(e){var n="page",r="client",a="X",o=((e=e.originalEvent||e).target||e.srcElement||t).ownerDocument||t,s=o.documentElement,l=o.body;if(e.touches!==i){var c=e.touches[0];return{x:c[n+a],y:c[n+"Y"]}}return!e[n+a]&&e[r+a]&&null!=e[r+a]?{x:e[r+a]+(s&&s.scrollLeft||l&&l.scrollLeft||0)-(s&&s.clientLeft||l&&l.clientLeft||0),y:e[r+"Y"]+(s&&s.scrollTop||l&&l.scrollTop||0)-(s&&s.clientTop||l&&l.clientTop||0)}:{x:e[n+a],y:e[n+"Y"]}},mBtn:function(e){return e.which||e.button===i?e.which:1&e.button?1:2&e.button?3:4&e.button?2:0},bind:function(e,t){if(typeof e!==r.f)throw"Can't bind function!";var i=Array.prototype.slice.call(arguments,2),n=function(){},a=function(){return e.apply(this instanceof n?this:t,i.concat(Array.prototype.slice.call(arguments)))};return e.prototype&&(n.prototype=e.prototype),a.prototype=new n,a}},s=function(n){function a(e){var t=!!e&&"length"in e&&e.length,i=C(e);return!T(i)&&(i===r.a||0===t||typeof t===r.n&&t>0&&t-1 in e)}function o(e){return(e.match(g)||[]).join(y)}function s(e,i){for(var n=(e.parentNode||t).querySelectorAll(i)||[],r=n.length;r--;)if(n[r]==e)return!0;return!1}function l(e,t,i){k.type(i)===r.s?e.insertAdjacentHTML(t,i):i.nodeType?e.insertAdjacentElement(t,i):e.insertAdjacentElement(t,i[0])}function c(e,t,n){try{e.style[t]!==i&&(e.style[t]=u(t,n))}catch(e){}}function u(e,t){return w[e.toLowerCase()]||k.type(t)!==r.n||(t=t+="px"),t}function d(e,t){var i,n;!1!==t&&e.q.splice(0,1),e.q.length>0?(n=e.q[0],p(e.el,n.props,n.duration,n.easing,n.complete,!0)):(i=k.inArray(e,b))>-1&&b.splice(i,1)}function h(e,t,i){"scrollLeft"===t?e[t]=i:"scrollTop"===t?e[t]=i:c(e,t,i)}function p(e,t,i,r,a,o){var s,l,c,u,p,f,g={},v={},y=0,_=k.isPlainObject(i);for(_?(r=i.easing,i.start,c=i.progress,u=i.step,p=i.specialEasing,a=i.complete,f=i.duration):f=i,p=p||{},f=f||400,r=r||"swing",o=o||!1;y<b.length;y++)if(b[y].el===e){l=b[y];break}for(s in l||(l={el:e,q:[]},b.push(l)),t)g[s]="scrollLeft"===s||"scrollTop"===s?e[s]:new m(e).css(s);for(s in g)g[s]!==t[s]&&(v[s]=t[s]);if(k.isEmptyObject(v))o&&d(l);else{var w,C,S,E,A,I,D,M,L,O=o?0:k.inArray(N,l.q),N={props:v,duration:_?i:f,easing:r,complete:a};if(-1===O&&(O=l.q.length,l.q.push(N)),0===O)if(f>0)D=n.now(),M=function(){for(s in w=n.now(),L=w-D,C=N.stop||L>=f,S=1-(Math.max(0,D+f-w)/f||0),v)E=g[s],A=v[s],I=(A-E)*x[p[s]||r](S,S*f,0,1,f)+E,h(e,s,I),T(u)&&u(I,{elem:e,prop:s,start:E,now:I,end:A,pos:S,options:{easing:r,speacialEasing:p,duration:f,complete:a,step:u},startTime:D});T(c)&&c({},S,Math.max(0,f-L)),C?(d(l),T(a)&&a()):N.frame=n.rAF()(M)},N.frame=n.rAF()(M);else{for(s in v)h(e,s,v[s]);d(l)}}}function f(e,t,i){for(var r,a,o,s=0;s<b.length;s++)if((r=b[s]).el===e){if(r.q.length>0){if((a=r.q[0]).stop=!0,n.cAF()(a.frame),r.q.splice(0,1),i)for(o in a.props)h(e,o,a.props[o]);t?r.q=[]:d(r,!1)}break}}function m(e){var t=this;k.type(e)===r.s||e.length||(e=[e]);for(var i=0;i<e.length;i++)t[i]=e[i];return t.length=e.length,t}var g=/[^\x20\t\r\n\f]+/g,v=Object.prototype.toString,y=" ",_="",b=[],w={animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},x={swing:function(e,t,i,n,r){return.5-Math.cos(e*Math.PI)/2},linear:function(e,t,i,n,r){return e},easeInQuad:function(e,t,i,n,r){return n*(t/=r)*t+i},easeOutQuad:function(e,t,i,n,r){return-n*(t/=r)*(t-2)+i},easeInOutQuad:function(e,t,i,n,r){return(t/=r/2)<1?n/2*t*t+i:-n/2*(--t*(t-2)-1)+i},easeInCubic:function(e,t,i,n,r){return n*(t/=r)*t*t+i},easeOutCubic:function(e,t,i,n,r){return n*((t=t/r-1)*t*t+1)+i},easeInOutCubic:function(e,t,i,n,r){return(t/=r/2)<1?n/2*t*t*t+i:n/2*((t-=2)*t*t+2)+i},easeInQuart:function(e,t,i,n,r){return n*(t/=r)*t*t*t+i},easeOutQuart:function(e,t,i,n,r){return-n*((t=t/r-1)*t*t*t-1)+i},easeInOutQuart:function(e,t,i,n,r){return(t/=r/2)<1?n/2*t*t*t*t+i:-n/2*((t-=2)*t*t*t-2)+i},easeInQuint:function(e,t,i,n,r){return n*(t/=r)*t*t*t*t+i},easeOutQuint:function(e,t,i,n,r){return n*((t=t/r-1)*t*t*t*t+1)+i},easeInOutQuint:function(e,t,i,n,r){return(t/=r/2)<1?n/2*t*t*t*t*t+i:n/2*((t-=2)*t*t*t*t+2)+i},easeInSine:function(e,t,i,n,r){return-n*Math.cos(t/r*(Math.PI/2))+n+i},easeOutSine:function(e,t,i,n,r){return n*Math.sin(t/r*(Math.PI/2))+i},easeInOutSine:function(e,t,i,n,r){return-n/2*(Math.cos(Math.PI*t/r)-1)+i},easeInExpo:function(e,t,i,n,r){return 0==t?i:n*Math.pow(2,10*(t/r-1))+i},easeOutExpo:function(e,t,i,n,r){return t==r?i+n:n*(1-Math.pow(2,-10*t/r))+i},easeInOutExpo:function(e,t,i,n,r){return 0==t?i:t==r?i+n:(t/=r/2)<1?n/2*Math.pow(2,10*(t-1))+i:n/2*(2-Math.pow(2,-10*--t))+i},easeInCirc:function(e,t,i,n,r){return-n*(Math.sqrt(1-(t/=r)*t)-1)+i},easeOutCirc:function(e,t,i,n,r){return n*Math.sqrt(1-(t=t/r-1)*t)+i},easeInOutCirc:function(e,t,i,n,r){return(t/=r/2)<1?-n/2*(Math.sqrt(1-t*t)-1)+i:n/2*(Math.sqrt(1-(t-=2)*t)+1)+i},easeInElastic:function(e,t,i,n,r){var a=1.70158,o=0,s=n;return 0==t?i:1==(t/=r)?i+n:(o||(o=.3*r),s<Math.abs(n)?(s=n,a=o/4):a=o/(2*Math.PI)*Math.asin(n/s),-s*Math.pow(2,10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)+i)},easeOutElastic:function(e,t,i,n,r){var a=1.70158,o=0,s=n;return 0==t?i:1==(t/=r)?i+n:(o||(o=.3*r),s<Math.abs(n)?(s=n,a=o/4):a=o/(2*Math.PI)*Math.asin(n/s),s*Math.pow(2,-10*t)*Math.sin((t*r-a)*(2*Math.PI)/o)+n+i)},easeInOutElastic:function(e,t,i,n,r){var a=1.70158,o=0,s=n;return 0==t?i:2==(t/=r/2)?i+n:(o||(o=r*(.3*1.5)),s<Math.abs(n)?(s=n,a=o/4):a=o/(2*Math.PI)*Math.asin(n/s),t<1?s*Math.pow(2,10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)*-.5+i:s*Math.pow(2,-10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)*.5+n+i)},easeInBack:function(e,t,n,r,a,o){return o==i&&(o=1.70158),r*(t/=a)*t*((o+1)*t-o)+n},easeOutBack:function(e,t,n,r,a,o){return o==i&&(o=1.70158),r*((t=t/a-1)*t*((o+1)*t+o)+1)+n},easeInOutBack:function(e,t,n,r,a,o){return o==i&&(o=1.70158),(t/=a/2)<1?r/2*(t*t*((1+(o*=1.525))*t-o))+n:r/2*((t-=2)*t*((1+(o*=1.525))*t+o)+2)+n},easeInBounce:function(e,t,i,n,r){return n-this.easeOutBounce(e,r-t,0,n,r)+i},easeOutBounce:function(e,t,i,n,r){return(t/=r)<1/2.75?n*(7.5625*t*t)+i:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+i:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+i:n*(7.5625*(t-=2.625/2.75)*t+.984375)+i},easeInOutBounce:function(e,t,i,n,r){return t<r/2?.5*this.easeInBounce(e,2*t,0,n,r)+i:.5*this.easeOutBounce(e,2*t-r,0,n,r)+.5*n+i}},k=function(e){var i,n,a,o=0;if(k.type(e)===r.s){for(i=[],"<"===e.charAt(0)?((a=t.createElement("div")).innerHTML=e,n=a.children):n=t.querySelectorAll(e);o<n.length;o++)i.push(n[o]);return new m(i)}return new m(e)},C=(k.extend=function(){var e,t,n,a,o,s,l=arguments[0]||{},c=1,u=arguments.length,d=!1;for("boolean"==typeof l&&(d=l,l=arguments[1]||{},c=2),typeof l!==r.o&&!k.type(l)===r.f&&(l={}),u===c&&(l=k,--c);c<u;c++)if(null!=(o=arguments[c]))for(a in o)e=l[a],l!==(n=o[a])&&(d&&n&&(k.isPlainObject(n)||(t=k.isArray(n)))?(t?(t=!1,s=e&&k.isArray(e)?e:[]):s=e&&k.isPlainObject(e)?e:{},l[a]=k.extend(d,s,n)):n!==i&&(l[a]=n));return l},k.type=function(e){return e===i?e+_:null===e?e+_:v.call(e).replace(/^\[object (.+)\]$/,"$1").toLowerCase()}),T=k.isFunction=function(e){return C(e)===r.f},S=(k.isArray=function(e){return C(e)===r.a},k.isEmptyObject=function(e){for(var t in e)return!1;return!0},k.isPlainObject=function(e){if(!e||C(e)!==r.o)return!1;var t,i=Object.prototype.hasOwnProperty,n=i.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&i.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!a)return!1;for(t in e);return typeof t===r.u||i.call(e,t)},k.inArray=function(e,t){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},k.each=function(e,t){var i=0;if(a(e))for(;i<e.length&&!1!==t.call(e[i],i,e[i]);i++);else for(i in e)if(!1===t.call(e[i],i,e[i]))break;return e});return m.prototype={each:function(e){return S(this,e)},append:function(e){return this.each(function(){l(this,"beforeend",e)})},prepend:function(e){return this.each(function(){l(this,"afterbegin",e)})},before:function(e){return this.each(function(){l(this,"beforebegin",e)})},after:function(e){return this.each(function(){l(this,"afterend",e)})},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},first:function(){return new m(this[0])},last:function(){return new m(this[this.length-1])},find:function(e){var t,i=[];return this.each(function(){var n=this.querySelectorAll(e);for(t=0;t<n.length;t++)i.push(n[t])}),new m(i)},hide:function(){return this.each(function(){this.style.display="none"})},show:function(){return this.each(function(){this.style.display="block"})},attr:function(e,t){for(var n=0;n<this.length;n++){var r=this[n];if(t===i)return r.getAttribute(e);r.setAttribute(e,t)}return this},removeAttr:function(e){return this.each(function(){this.removeAttribute(e)})},prop:function(e,t){for(var n=0;n<this.length;n++){var r=this[n];if(t===i)return r[e];r[e]=t}return this},val:function(e){var t=this[0];return e?(t.value=e,this):t.value},scrollLeft:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(e===i)return n.scrollLeft;n.scrollLeft=e}return this},scrollTop:function(e){for(var t=0;t<this.length;t++){var n=this[t];if(e===i)return n.scrollTop;n.scrollTop=e}return this},children:function(e){var t,i,n=[];return this.each(function(){for(t=(r=this).children,i=0;i<t.length;i++){var r=t[i];e?(r.matches&&r.matches(e)||s(r,e))&&n.push(r):n.push(r)}}),new m(n)},on:function(e,t){var i,n;return e=(e||_).match(g)||[_],this.each(function(){if((n=this).addEventListener)for(i=0;i<e.length;i++)n.addEventListener(e[i],t);else for(i=0;i<e.length;i++)n.attachEvent("on"+e[i],t)})},off:function(e,t){var i;return e=(e||_).match(g)||[_],this.each(function(){var n=this;if(n.removeEventListener)for(i=0;i<e.length;i++)n.removeEventListener(e[i],t);else for(i=0;i<e.length;i++)n.detachEvent("on"+e[i],t)})},trigger:function(e){var i,n;return this.each(function(){i=this,t.createEvent?((n=t.createEvent("HTMLEvents")).initEvent(e,!0,!1),i.dispatchEvent(n)):i.fireEvent("on"+e)})},hasClass:function(e){for(var t,i=0,n=y+e+y;t=this[i++];)if(t.classList){if(t.classList.contains(e))return!0}else if(1===t.nodeType&&(y+o(t.className)+y).indexOf(n)>-1)return!0;return!1},addClass:function(e){var t,n,r,a,s,l,c=null,u=0,d=0;if(e)for(t=e.match(g)||[];n=this[u++];)if(c===i&&(c=n.classList!==i),c)for(;s=t[d++];)n.classList.add(s);else if(a=n.className,r=1===n.nodeType&&y+o(a)+y){for(;s=t[d++];)r.indexOf(y+s+y)<0&&(r+=s+y);a!==(l=o(r))&&(n.className=l)}return this},removeClass:function(e){var t,n,r,a,s,l,c=null,u=0,d=0;if(e)for(t=e.match(g)||[];n=this[u++];)if(c===i&&(c=n.classList!==i),c)for(;s=t[d++];)n.classList.remove(s);else if(a=n.className,r=1===n.nodeType&&y+o(a)+y){for(;s=t[d++];)for(;r.indexOf(y+s+y)>-1;)r=r.replace(y+s+y,y);a!==(l=o(r))&&(n.className=l)}return this},remove:function(){return this.each(function(){var e=this;null!=e.parentNode&&e.parentNode.removeChild(e)})},offset:function(){var i=this[0].getBoundingClientRect(),n=e.pageXOffset||t.documentElement.scrollLeft,r=e.pageYOffset||t.documentElement.scrollTop;return{top:i.top+r,left:i.left+n}},css:function(t,n){var a,o;return k.type(t)===r.s?n===i?(a=this[0],e.getComputedStyle?e.getComputedStyle(a,null).getPropertyValue(t):a.currentStyle[t]):this.each(function(){c(this,t,n)}):this.each(function(){for(o in t)c(this,o,t[o])})},unwrap:function(){var e,t,i,n=[];for(this.each(function(){i=this.parentNode,-1===k.inArray(i,n)&&n.push(i)}),e=0;e<n.length;e++){for(t=n[e],i=t.parentNode;t.firstChild;)i.insertBefore(t.firstChild,t);i.removeChild(t)}return this},wrapAll:function(e){for(var t,i=this,n=new k(e)[0],r=n,a=i[0].parentNode,o=i[0].previousSibling;r.childNodes.length>0;)r=r.childNodes[0];for(t=0;i.length-t;r.firstChild===i[0]&&t++)r.appendChild(i[t]);var s=o?o.nextSibling:a.firstChild;return a.insertBefore(n,s),this},wrapInner:function(e){return this.each(function(){var t=new m(this),i=t.contents();i.length?i.wrapAll(e):t.append(e)})},wrap:function(e){return this.each(function(){new k(this).wrapAll(e)})},contents:function(){var e,t,i=[];return this.each(function(){for(e=this.childNodes,t=0;t<e.length;t++)i.push(e[t])}),new m(i)},parent:function(){var e=[];return this.each(function(){e.push(this.parentNode)}),new m(e)},is:function(e){var t,i;for(i=0;i<this.length;i++){if(t=this[i],":visible"===e)return"none"!==t.style.display;if(":hidden"===e)return"none"===t.style.display;if(t.matches&&t.matches(e)||s(t,e))return!0}return!1},animate:function(e,t,i,n){return this.each(function(){p(this,e,t,i,n)})},stop:function(e,t){return this.each(function(){f(this,e,t)})}},k}(o),l=function(e){function t(e,t){e[s]=t,o.push(e)}function n(t){var i=e.inArray(t,o);i>-1&&(delete t[s],o.splice(i,1))}function r(e){return a(e)!==i}function a(e){for(var t=0;t<o.length;t++)if(e===o[t])return e[s]}var o=[],s="__overlayScrollbars__";return{all:function(){return o},add:t,rem:n,has:r,get:a}}(s),c=function(e){function t(n,a,o,s,l){var c=!1;if(o=o===i?"":o,typeof a!==r.s)return c;if(0===a.length)return c;if(""===o){for(var u=a.split("."),d=n,h="",p=!1,f=0;f<u.length;f++){var m=u[f];if(d=d[m],h+=m+".",e.type(d)!==r.o&&f+1!==u.length){p=!0;break}}if(p)return h.slice(0,-1)}for(var g in n)if(n.hasOwnProperty(g)){var v=o+g===a;if(e.type(n[g])!==r.o||v){if(v){typeof s===r.f&&s(n,g),c=!0;break}}else if(c=t(n[g],a,o+g+".",s,l),typeof l===r.f&&l(n,g),c)break}return c}return{has:function(e,i){return t(e,i)},get:function(e,i){var n;return t(e,i,"",function(e,t){n=e[t]}),n},set:function(i,n,r,a){var o=!1;if(t(i,n,"",function(e,t){e[t]=r,o=!0}),!o&&a){for(var s=n.split("."),l={},c=l,u=0;u<s.length;u++){var d=u===s.length-1?r:{};c=c[s[u]]=d}e.extend(!0,i,l),o=!0}return o},del:function(i,n,r){var a=!1;return t(i,n,"",function(e,t){delete e[t],a=!0},function(t,i){r&&e.isEmptyObject(t[i])&&delete t[i]}),a}}}(s),u=(function(s,l,c,u){function d(){m===i&&(m=new h(v)),g===i&&(g=new p(m))}function h(n){function r(e){var n=!1,r="Webkit Moz ms O".split(" "),a=t.createElement("div"),o=null;if(e=e.toLowerCase(),a.style[e]!==i&&(n=!0),!1===n){o=e.charAt(0).toUpperCase()+e.substr(1);for(var s=0;s<r.length;s++)if(a.style[r[s]+o]!==i){n=!0;break}}return n}var o=this;o.defaultOptions=n,o.autoUpdateLoop=!1,o.autoUpdateRecommended=s.mO()===i;var u=c("body"),d=c('<div id="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"></div></div>'),h=function(){u.append(d);var e,t="overflow",i="hidden",n=d[0],r=c(d.children("div").first());return 0===n[a.oH]&&d.hide().show(),e={x:n[a.oH]-n[a.cH],
|
||
y:n[a.oW]-n[a.cW]},o.restrictedMeasuring=function(){d.css(t,i);var e={w:n[a.sW],h:n[a.sH]};d.css(t,"visible");var r={w:n[a.sW],h:n[a.sH]};return e.w-r.w!=0||e.h-r.h!=0}(),o.nativeScrollbarStyling=(d.addClass("os-viewport-native-scrollbars-invisible"),d.css(t,i).hide().css(t,"scroll").show(),n[a.oH]-n[a.cH]==0&&n[a.oW]-n[a.cW]==0),o.rtlScrollBehavior=function(){d.css({"overflow-y":i,direction:"rtl"}).scrollLeft(0);var e=d.offset(),t=r.offset();d.scrollLeft(999);var n=r.offset();return{i:e.left===t.left,n:t.left-n.left==0}}(),d.removeAttr(a.s).remove(),e}(),p={x:0===h.x,y:0===h.y};o.nativeScrollbarSize=h,o.nativeScrollbarIsOverlaid=p,o.overlayScrollbarDummySize={x:30,y:30},o.msie=function(){var t=e.navigator.userAgent,i=t.indexOf("MSIE ");if(i>0)return parseInt(t.substring(i+5,t.indexOf(".",i)),10);if(t.indexOf("Trident/")>0){var n=t.indexOf("rv:");return parseInt(t.substring(n+3,t.indexOf(".",n)),10)}var r=t.indexOf("Edge/");return r>0&&parseInt(t.substring(r+5,t.indexOf(".",r)),10)}(),o.cssCalc=function(){for(var e=t.createElement("div"),i=["calc","-webkit-calc","-moz-calc","-o-calc"],n=0;n<i.length;++n){var r=i[n];if(e.style.cssText="width:"+r+"(1px);",e.style.length)return r}return null}(),o.supportTransform=r("transform"),o.supportTransition=r("transition");var f=!1;try{var m=Object.defineProperty({},"passive",{get:function(){f=!0}});e.addEventListener("test",null,m)}catch(e){}o.supportPassiveEvents=f,o.supportResizeObserver=s.rO()!==i,o.supportMutationObserver=s.mO()!==i,function(){function t(e,t){var i=Math.abs(e),n=Math.abs(t);return!(i===n||i+1===n||i-1===n)}function i(){var t=e.screen.deviceXDPI||0,i=e.screen.logicalXDPI||1;return e.devicePixelRatio||t/i}if(!p.x||!p.y){var n=s.wW(),r=s.wH(),h=i();c(e).on("resize",function(){if(l.all().length>0){var e=s.wW(),p=s.wH(),f=e-n,m=p-r;if(0===f&&0===m)return;var g=Math.round(e/(n/100)),v=Math.round(p/(r/100)),y=Math.abs(f),_=Math.abs(m),b=Math.abs(g),w=Math.abs(v),x=i(),k=y>2&&_>2,C=!t(b,w);if(k&&C&&x!==h&&h>0){u.append(d);var T=d[0];o.nativeScrollbarSize={x:T[a.oH]-T[a.cH],y:T[a.oW]-T[a.cW]},d.remove(),c.each(l.all(),function(){l.has(this)&&l.get(this).update("zoom")})}n=e,r=p,h=x}})}}()}function p(e){var t,n=this,r="autoUpdate",a=[],o=[],l=!1,u=33,d=s.now(),h=function(){if(a.length>0&&l){t=s.rAF()(function(){h()});var e=s.now(),n=e-d;if(n>u){d=e-n%u;for(var c=33,p=0;p<a.length;p++){var f=a[p];if(f!==i){var m=f.options(),g=m[r],v=Math.max(1,m.autoUpdateInterval),y=s.now();(!0===g||null===g)&&y-o[p]>v&&(f.update("auto"),o[p]=new Date(y+=v)),c=Math.max(1,Math.min(c,v))}}u=c}}else u=33};n.add=function(t){-1===c.inArray(t,a)&&(a.push(t),o.push(s.now()),a.length>0&&!l&&(l=!0,e.autoUpdateLoop=l,h()))},n.remove=function(n){var r=c.inArray(n,a);r>-1&&(o.splice(r,1),a.splice(r,1),0===a.length&&l&&(l=!1,e.autoUpdateLoop=l,t!==i&&(s.cAF()(t),t=-1)))}}function f(t,d,h,p){function f(){if(!ze){var e=Ze[0],t={w:e[a.sW],h:e[a.sH]};if(wi){var i=x(t,Ht);Ht=t,i&&fe(!0,!1)}else Ht=t}}function m(e,t,i){e=e[0];for(var n=t.split(Ji),r=0;r<n.length;r++)e.addEventListener(n[r],i,{passive:!0})}function g(e,t,i){e=e[0];for(var n=t.split(Ji),r=0;r<n.length;r++)e.removeEventListener(n[r],i,{passive:!0})}function v(e){if(e!==i&&Ae){var t=e.contents()[0];t[pn].unobserve(t)}}function y(e){if(e!==i&&Ae){var t=e.contents()[0];t[pn].observe(t)}}function _(e,t){var i=3333333,n=function(n){e.scrollTop(i),e.scrollLeft(je?ge.n?-i:ge.i?0:i:i),t()};if(Ae){var o=s.rO(),l=e.append(Xi+jn+" observed"+Qi).contents()[0];(l[pn]=new o(n)).observe(l)}else{var u="animationstart mozAnimationStart webkitAnimationStart MSAnimationStart";if(ye>9||!ve){var d='">',p="</div>",f="childNodes",m=Xi+jn+d;m+=Xi+zn+'" dir="ltr'+d,m+=Xi+zn+d,m+=Xi+Fn+Qi,m+=p,m+=Xi+zn+d,m+=Xi+Fn+'" style="width: 200%; height: 200%'+Qi,m+=p,m+=p,m+=p,e.prepend(m);var g,v,y,_,b=(e=e[0])[f][0][f][0],w=c(b[f][1]),x=c(b[f][0]),k=c(x[0][f][0]),C=b[a.oW],T=b[a.oH],S=h.nativeScrollbarSize,E=function(){x[rn](i)[an](i),w[rn](i)[an](i)},A=function(){v=0,g&&(C=y,T=_,n())},I=function(e){return y=b[a.oW],_=b[a.oH],g=y!=C||_!=T,e&&g&&!v?(s.cAF()(v),v=s.rAF()(A)):e||A(),E(),e&&(s.prvD(e),s.stpP(e)),!1},D={};D[Pi]=2*-(S.y+1),D[Ri]=-2*S.x,D[ji]=-2*S.y,D[zi]=2*-(S.x+1),c(b).css(D),x.on(Vi,I),w.on(Vi,I),c(e).on(u,function(){I(!1)});var M={};M[Ui]=i,M[$i]=i,k.css(M),E()}else{var L=Ve[0],O=e;e=e[0];var N=L.attachEvent,P=typeof navigator===r.u||navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/Edge/);if(N)O.prepend(Xi+jn+Qi),O.find(Zi+jn).first()[0].attachEvent("onresize",n);else{var R=L.createElement(r.o);R.setAttribute("tabindex","-1"),R.setAttribute(a.c,jn),R.onload=function(){var e=this.contentDocument.defaultView;e.addEventListener("resize",n),e.document.documentElement.style.display="none"},R.type="text/html",P&&O.prepend(R),R.data="about:blank",P||O.prepend(R),O.on(u,n)}}}if((e=c(e))[0]===Ze[0]){var j=function(){var t=Xe.css("direction");if(t!==Tt){var n={},r=0;return"ltr"===t?(n[zi]=0,n[Ri]=Wi,r=i):(n[zi]=Wi,n[Ri]=0,r=ge.n?-i:ge.i?0:i),Ze.children().first().css(n),e.scrollLeft(r),e.scrollTop(i),Tt=t,!0}return!1};j(),e.on(Vi,function(e){return j()&&fe(),s.prvD(e),s.stpP(e),!1})}}function b(e){if(Ae){var t=e.contents()[0];t[pn].disconnect(),delete t[pn]}else e.children(Zi+jn).first().remove()}function w(e,t,n){return!0===n?n:t===i||e!==t}function x(e,t,n,r,a){if(!0===a)return a;if(r===i&&a===i){if(!0===n)return n;n=i}return n=n===i?"w":n,r=r===i?"h":r,t===i||e[n]!==t[n]||e[r]!==t[r]}function k(e,t){return t===i||e.t!==t.t||e.r!==t.r||e.b!==t.b||e.l!==t.l}function C(e,t){wi&&e.call(bi,t)}function T(e,t,n){n===i&&(n=[Hi,Hi,Hi,Hi]),e[t+Pi]=n[0],e[t+Ri]=n[1],e[t+ji]=n[2],e[t+zi]=n[3]}function S(){ai&&!ri&&(ii.observe(Xe[0],{attributes:!0,attributeOldValue:!0,attributeFilter:[a.i,a.c,a.s]}),ni.observe(ki?Ke[0]:nt[0],{attributes:!0,attributeOldValue:!0,subtree:!ki,childList:!ki,characterData:!ki,attributeFilter:ki?["wrap","cols","rows"]:[a.i,a.c,a.s]}),ri=!0)}function E(){ai&&ri&&(ii.disconnect(),ni.disconnect(),ri=!1)}function A(e){if(!ze){var t=(e.originalEvent||e).touches!==i;(1===s.mBtn(e)||t)&&(ri&&(mi=!0,E()),lr=s.page(e),cr.w=Xe[0][a.oW]-(De?0:Me),cr.h=Xe[0][a.oH]-(De?0:Le),Ve.on(dn,U),Ve.on(ln,I),Ve.on(sn,D),Ye.addClass(tr),at.setCapture&&at.setCapture(),s.prvD(e),s.stpP(e))}}function I(e){e.originalEvent;var t=s.page(e),i={};(yi||vi)&&(i[Ui]=cr.w+t.x-lr.x),(_i||vi)&&(i[$i]=cr.h+t.y-lr.y),Xe.css(i),s.stpP(e)}function D(e){var t=e!==i;Ve.off(dn,U),Ve.off(ln,I),Ve.off(sn,D),Ye.removeClass(tr),at.releaseCapture&&at.releaseCapture(),t&&(mi&&S(),bi.update(Wi)),mi=!1}function M(){if(!ze){var e=!Nt,t=Ii.w-(De||St||!vt?0:Le+Ne),i=Ii.h-(De||St||!yt?0:Le+Ne),n={},r=vt||e,o=Ke[0];n[Fi+Ui]=Hi,n[Fi+$i]=Hi,n[Ui]=Wi,Ke.css(n);var s=o[a.oW],l=r?Math.max(s,o[a.sW]-1):1;l+=vt?Pe+(De?0:e?0:Me+Oe):0,n[Ui]=vt?l:Gi,n[$i]=Wi,Ke.css(n);var c=o[a.oH],u=Math.max(c,o[a.sH]-1);return n[Ui]=l,n[$i]=u,rt.css(n),n[Fi+Ui]=t+(!De&&vt?Me+Oe:0),n[Fi+$i]=i+(!De&&yt?Le+Ne:0),Ke.css(n),{ow:s,oh:c,dw:l,dh:u}}}function L(){var e=Ke.prop("selectionStart");if(e!==i){for(var t=Ke.val(),n=t.length,r=t.split("\n"),a=r.length,o=t.substr(0,e).split("\n"),s=0,l=0,c=o.length,u=o[o.length-1].length,d=0;d<r.length;d++){var h=r[d].length;h>l&&(s=d+1,l=h)}return{cursorRow:c,cursorCol:u,rows:a,cols:l,wRow:s,pos:e,max:n}}}function O(e){for(var t=0;t<or.length;t++)if(e===or[t])return!0;return!1}function N(){M(),bi.update(Wi)}function P(e){var t=e.keyCode;if(!O(t)){if(0===sr.length){var i=function(){M(),bi.update(Wi)};i(),oi=setInterval(i,1e3/60)}-1===c.inArray(t,sr)&&sr.push(t)}}function R(e){var t=e.keyCode;if(!O(t)){var i=c.inArray(t,sr);i>-1&&sr.splice(i,1),0===sr.length&&(M(),bi.update(Wi),clearInterval(oi))}}function j(){setTimeout(function(){M(),bi.update(Wi)},50)}function z(){si=!0}function F(){si=!1,clearInterval(oi),sr=[],M(),bi.update(Wi)}function B(e){return Ke[rn](ge.i&&Xt?9999999:0),Ke[an](0),s.prvD(e),s.stpP(e),!1}function U(e){return s.prvD(e),!1}function $(){return Mt&&ke.x&&ke.y}function q(e,t,i){var n=e?yn:_n,r=e?ot:ct;t?Xe.removeClass(n):Xe.addClass(n),i?r.removeClass(Vn):r.addClass(Vn)}function H(e,t){if(clearTimeout(li),e)ot.removeClass(Gn),ct.removeClass(Gn);else{var i="active",n=function(){if(!fi){var e=lt.hasClass(i)||dt.hasClass(i);e||!di&&!hi||ot.addClass(Gn),e||!di&&!hi||ct.addClass(Gn)}};ci>0&&!0!==t?li=setTimeout(n,ci):n()}}function W(e){var t={},i=X(e),n=Math.min(1,(ht[i._wh]-(St?e?Me:Le:0))/pt[i._wh]);t[i.wh]=Math.floor(100*n*1e5)/1e5+"%",$()||i.h.css(t),i.i.hl=i.h[0]["offset"+i.WH],i.i.hlr=n}function V(e,t){var i=je&&e,n={},r=X(e),a=tt[0][Vi+r.WH]-tt[0]["client"+r.WH];ge.n&&i&&(a*=-1);var o=t/a;o=isNaN(o)?0:Math.min(1,o),r.i.ms=a,r.i.cs=t,r.i.csr=o;var s=r.i.hl,l=r.t[0]["offset"+r.WH],c=(l-s)*o;if(c=isNaN(c)?0:c,i&&(ge.n||!ge.n&&!ge.i)&&(c=l-s-c),c=Math.max(0,c),Se){var u;i&&(c=-(l-s-c));var d="translate(",h="transform";u=e?d+c+"px, 0px)":d+"0px, "+c+"px)",n["-webkit-"+h]=u,n["-moz-"+h]=u,n["-ms-"+h]=u,n["-o-"+h]=u,n[h]=u}else n[r.lt]=c;$()||r.h.css(n),r.i.ho=c,r.i.tl=l}function G(e,t){var i=t?"removeClass":"addClass",n=e?ut:dt,r=e?qn:Wn;(e?st:lt)[i](r),n[i](r)}function Y(){ot=c(Xi+Un+Ji+Jn+Qi),st=c(Xi+$n+Qi),lt=c(Xi+Hn+Qi),ct=c(Xi+Un+Ji+er+Qi),ut=c(Xi+$n+Qi),dt=c(Xi+Hn+Qi),ot.append(st),st.append(lt),ct.append(ut),ut.append(dt),et.after(ct),et.after(ot),Te&&(ot.on(hn,function(e){e.target===ot[0]&&(W(!0),V(!0,tt[rn]()))}),ct.on(hn,function(e){e.target===ct[0]&&(W(!1),V(!1,tt[an]()))})),K(!0),K(!1),at=c(Xi+Ji+Yn+Qi),Xe.append(at)}function K(e){var t,n,r,a=X(e),o=a.xy,l=Vi+a.LT,c="active",u=1,d=function(){u=.5},h=function(){u=1},p=function(i){i.originalEvent;var r=a.i.tl,c=a.i.hl,u=a.i.ms*((c/2+s.page(i)[o]-n-c/2)/(r-c));u=isFinite(u)?u:0,je&&e&&(ge.n||!ge.n&&!ge.i)&&(u*=-1),tt[l](t+u),Ee||s.prvD(i)},f=function(e){e=e||e.originalEvent,Ye.removeClass(tr),a.h.removeClass(c),a.t.removeClass(c),a.s.removeClass(c),Ee?(g(Ve,ln,p),g(Ve,sn,f),g(Ve,cn,v),g(Ve,un,y),g(Ve,dn,U)):(Ve.off(ln,p),Ve.off(sn,f),Ve.off(cn,v),Ve.off(un,y),Ve.off(dn,U)),h(),t=i,n=i,r!==i&&(bi.scrollStop(),clearTimeout(r),r=i);var o=Xe[0].getBoundingClientRect();e.clientX>=o.left&&e.clientX<=o.right&&e.clientY>=o.top&&e.clientY<=o.bottom||Z(),di&&H(!1)},v=function(e){16==e.keyCode&&d()},y=function(e){16==e.keyCode&&h()};a.h.on(on,function(r){if(!ze){var u=(r.originalEvent||r).touches!==i;$()||!Yt||u&&!pi||(1===s.mBtn(r)||u)&&(t=(t=tt[l]())===i?0:t,(je&&e&&!ge.n||!je)&&(t=t<0?0:t),n=s.page(r)[o],Ye.addClass(tr),a.h.addClass(c),a.s.addClass(c),Ee?(m(Ve,dn,U),m(Ve,ln,p),m(Ve,sn,f)):(Ve.on(dn,U),Ve.on(ln,p),Ve.on(sn,f)),s.prvD(r))}}),a.t.on(on,function(t){if(!ze){var l=(t.originalEvent||t).touches!==i;if(!$()&&Gt&&(!l||pi)&&(1===s.mBtn(t)||l)){var h,p=Ii[a._wh],g=a.t.offset()[a.lt],_=!0;t.shiftKey&&d();var b=function(){var t=a.i.ho,o=a.i.hl,s=n-g,l=200*u,c=_?Math.max(333,l):l,d={},f=je&&e&&(!ge.i&&!ge.n||Xt),m=t>s;f&&(m=t<s),m?(h===i&&(h=!0),d[a.xy]="-="+p):(h===i&&(h=!1),d[a.xy]="+="+p),bi.scrollStop(),bi.scroll(d,l,"linear");var v=h?t<=s:t+o>=s;f&&(v=h?t+o>=s:t<=s),v?(clearTimeout(r),bi.scrollStop(),r=i):r=setTimeout(b,c),_=!1};n=s.page(t)[o],Ye.addClass(tr),a.t.addClass(c),a.s.addClass(c),Ee?(m(Ve,dn,U),m(Ve,sn,f),m(Ve,cn,v),m(Ve,un,y)):(Ve.on(dn,U),Ve.on(sn,f),Ve.on(cn,v),Ve.on(un,y)),b(),s.prvD(t)}}}).hover(function(){di&&(fi=!0,H(!0))},function(){di&&(fi=!1,H(!1))}),a.s.on(on,function(e){s.stpP(e)})}function X(e){return{wh:e?Ui:$i,WH:e?"Width":"Height",lt:e?zi:Pi,LT:e?"Left":"Top",xy:e?Yi:Ki,XY:e?"X":"Y",_wh:e?"w":"h",_lt:e?"l":"t",t:e?st:ut,h:e?lt:dt,s:e?ot:ct,i:e?Ei:Ai}}function Q(){hi&&H(!0)}function Z(){hi&&!Ye.hasClass(tr)&&H(!1)}function J(e){if(!ze){var t=$e.callbacks,n=t.onScrollStart,r=t.onScroll,a=t.onScrollStop;Fe!==i?clearTimeout(Fe):(di&&H(!0),$()||Xe.addClass(kn),c.isFunction(n)&&C(n,e)),V(!0,tt[rn]()),V(!1,tt[an]()),c.isFunction(r)&&C(r,e),Fe=setTimeout(function(){ee(),c.isFunction(a)&&C(a,e)},Di)}}function ee(){clearTimeout(Fe),Fe=i,di&&H(!1),$()||Xe.removeClass(kn)}function te(e){return typeof HTMLElement===r.o?e instanceof HTMLElement:e&&typeof e===r.o&&null!==e&&1===e.nodeType&&typeof e.nodeName===r.s}function ie(e,t,n,a){var o,s,l,d,h,p={n:t,s:!1,v:i,p:i},f=r.u,m=u.has(e,t),g=u.get(e,t),v=!1,y=!0!==m,_=!1;for(c.type(n)!==r.a&&(n=[n]),h=n.length,s=0;s<h;s++){var b=n[s];if("*"===b)if(h>1){var w=0;for(d=0;d<h;d++){var x=n[d];if(c.type(x)===r.s&&++w>1)break}1===w&&(_=!0)}else _=!0;b===i&&(v=!0)}if(y&&!1===m&&v&&(y=!1),!y){o=g,f=c.type(o);var k=function(e){var t=c.type(e);return!(t!==f||t===r.s&&!_&&o!==e||(p.s=!0,p.v=o,p.p=o,0))};for(s=0;s<h;s++){var C=n[s];if(c.type(C)===r.s){var T=C.split(":"),S=T[0],E=!1;for(l=0;l<T.length;l++)if(k(T[l])){_||(p.p=S),E=!0;break}if(E)break}else if(k(C))break}}if(!p.s){var A='The option "'+t+"\" wasn't set, because";if(y&&!1!==m){var I=u.has(Be,t);!0===I?console.warn(A+' "'+m+'" is not from type [ OBJECT ].'):(A='The option "'+t+'" is not a default option',!1===I?console.warn(A+Zi):console.warn(A+" and couldn't be resolved, because \""+I+'" is not from type [ OBJECT ].'))}else{var D=[],M=Hi,L=!1,O=Hi;for(s=0;s<h;s++){var N=n[s],P=c.type(N);if(P===r.s){L=!_;var R=N.split(":");for(l=0;l<R.length;l++)O+='"'+R[l]+'", '}-1===c.inArray(P,D)&&(D.push(P),M=M+P.toUpperCase()+", ")}M=M.slice(0,-2),L&&(O=O.slice(0,-2)),console.warn(A+" it doesn't accept the type [ "+f.toUpperCase()+' ] with the value of "'+o+'".\r\nAccepted types are: [ '+M+" ]."+(L?"\r\nValid strings are: [ "+O+" ].":Hi))}}return(a=a===i||a)&&u.del(e,t),p}function ne(){var e={};return Ci&&it&&(e.w=de(it.css(Fi+Ui)),e.h=de(it.css(Fi+$i)),e.c=x(e,ti),e.f=!0),ti=e,e.c}function re(e,t){var i,n,r={};for(i=0;i<e.length;i++){var a=e[i],o=[];if(a.s){var s=a.n.split(".");for(n=0;n<s.length;n++)o[n]={},o[n][s[n]]={};for(n=0;n<o.length;n++){var l=!1,u=o[n];for(var d in n+1===o.length&&(l=!0),u)u.hasOwnProperty(d)&&(u[d]=o[n+1],l&&(u[d]=t?a.p:a.v))}c.extend(!0,r,o[0])}}return r}function ae(e,t){var i,n=[],r=[];for(i=0;i<e.length;i++)n[e[i]]=!0;for(i=0;i<t.length;i++)n[t[i]]?delete n[t[i]]:n[t[i]]=!0;for(var a in n)r.push(a);return r}function oe(e,t){var n=t!==i&&null!==t?t.split(Ji):Hi,r=e!==i&&null!==e?e.split(Ji):Hi;if(n===Hi&&r===Hi)return!1;var a=ae(r,n),o=!1,s=Zt!==i&&null!==Zt?Zt.split(Ji):[Hi],l=Qt!==i&&null!==Qt?Qt.split(Ji):[Hi],u=c.inArray(ir,a);u>-1&&a.splice(u,1);for(var d=0;d<a.length;d++){var h=a[d];if(0!==h.indexOf(gn)){var p,f=!0,m=!0;for(p=0;p<s.length;p++)if(h===s[p]){f=!1;break}for(p=0;p<l.length;p++)if(h===l[p]){m=!1;break}if(f&&m){o=!0;break}}}return o}function se(e){var t=e.attributeName,i=e.target,n=e.type;if(i===nt[0])return null===t;if("attributes"===n&&(t===a.c||t===a.s)&&!ki){if(typeof i.closest!==r.f)return!0;if(null!==i.closest(Zi+jn)||null!==i.closest(Zi+Un)||null!==i.closest(Zi+Yn))return!1}return!0}function le(e){e=c.extend(!0,{},Ue,e);var t=["*",null],i=["v-h:visible-hidden","v-s:visible-scroll","s:scroll","h:hidden"],n=["v:visible","h:hidden","a:auto"],a=["n:never","s:scroll","l:leave"],o=["n:none","b:both","h:horizontal","v:vertical"],s="callbacks.",l=en+"s.",d="textarea.",h="overflowBehavior.",p="nativeScrollbarsOverlaid.",f=!0,m=[f,null],g=[new Function,null],v=[ie(e,p+"showNativeScrollbars",f),ie(e,p+"initialize",f),ie(e,h+Yi,i),ie(e,h+Ki,i),ie(e,l+"visibility",n),ie(e,l+"autoHide",a),ie(e,l+"autoHideDelay",0),ie(e,l+"clickScrolling",f),ie(e,l+"dragScrolling",f),ie(e,l+"touchSupport",f),ie(e,d+"dynWidth",f),ie(e,d+"dynHeight",f),ie(e,"className",t),ie(e,"resize",o),ie(e,"sizeAutoCapable",f),ie(e,"paddingAbsolute",f),ie(e,"clipAlways",f),ie(e,"normalizeRTL",f),ie(e,"autoUpdate",m),ie(e,"autoUpdateInterval",0),ie(e,s+"onInitialized",g),ie(e,s+"onInitializationWithdrawn",g),ie(e,s+"onDestroyed",g),ie(e,s+"onScrollStart",g),ie(e,s+"onScroll",g),ie(e,s+"onScrollStop",g),ie(e,s+"onDirectionChanged",g),ie(e,s+"onContentSizeChanged",g),ie(e,s+"onHostSizeChanged",g),ie(e,s+"onOverflowChanged",g),ie(e,s+"onOverflowAmountChanged",g),ie(e,s+"onUpdated",g)];for(var y in e)e.hasOwnProperty(y)&&u.has(Be,y)&&c.isEmptyObject(e[y])&&delete e[y];if(!c.isEmptyObject(e)){var _=function(e){c.each(e,function(t,i){c.isPlainObject(i)?_(i):c.type(i)===r.f&&(e[t]=c.type(i))})};_(e),console.warn("The following options are discarded due to invalidity:\r\n"+JSON.stringify(e,null,2))}Ue=c.extend(!0,{},Ue,re(v,!1)),$e=c.extend(!0,{},$e,re(v,!0))}function ce(){if(ze)return!1;var e,t=ki&&vt&&!Nt?Ke.val().length:0,i=!ri&&vt&&!ki,n={};i&&(e=nt.css(qi),n[qi]=je?Ri:zi,n[Ui]=Wi,nt.css(n));var r={w:pe()[a.sW]+t,h:pe()[a.sH]+t};i&&(n[qi]=e,n[Ui]=Gi,nt.css(n));var o=ne(),s=x(r,qt)||o;return qt=r,s}function ue(){if(ze||ri)return!1;var e=Xe.attr(a.i)||Hi,t=w(e,Rt),i=Xe.attr(a.c)||Hi,n=w(i,jt),r=Xe.attr(a.s)||Hi,o=w(r,zt),s=Xe.is(":visible")||Hi,l=w(s,Ft),c=ki&&Ke.attr("rows")||Hi,u=w(c,Bt),d=ki&&Ke.attr("cols")||Hi,h=w(d,Ut),p=ki&&Ke.attr("wrap")||Hi,f=w(p,$t);return Rt=e,n&&(n=oe(jt,i)),jt=i,zt=r,Ft=s,Bt=c,Ut=d,$t=p,t||n||o||l||u||h||f}function de(e){var t=parseInt(e);return isNaN(t)?0:t}function he(e){if(!wi)return!0;var t=[Ui,Fi+Ui,Bi+Ui,Li+zi,Li+Ri,zi,Ri,"font-weight","word-spacing"],i=[Oi+zi,Oi+Ri,Ni+zi+Ui,Ni+Ri+Ui],n=[$i,Fi+$i,Bi+$i,Li+Pi,Li+ji,Pi,ji,"line-height"],r=[Oi+Pi,Oi+ji,Ni+Pi+Ui,Ni+ji+Ui],a="s"===It.x||"v-s"===It.x,o=!1,s=function(e,t){for(var i=0;i<e.length;i++)if(e[i]===t)return!0;return!1};return("s"===It.y||"v-s"===It.y)&&((o=s(n,e))||De||(o=s(r,e))),a&&!o&&((o=s(t,e))||De||(o=s(i,e))),o}function pe(){return ki?rt[0]:nt[0]}function fe(e,t,n){var r=s.now(),l=rr>0&&wi&&r-qe<rr&&!yt&&!vt;if(clearTimeout(He),l&&(nr.h=e,nr.c=t,nr.f=n,He=setTimeout(fe,rr)),!(l||ze||wi&&!n&&Xe.is(":hidden")||"inline"===Xe.css("display"))){qe=r,e=e||nr.h,t=t||nr.c,n=n||nr.f,nr={},e=e!==i&&e,t=t!==i&&t,n=n!==i&&n,!_e||ke.x&&ke.y?we=c.extend(!0,{},h.nativeScrollbarSize):(we.x=0,we.y=0),xe={x:3*(we.x+(ke.x?0:3)),y:3*(we.y+(ke.y?0:3))},v(Ze),v(Qe);var u={l:tt[rn](),t:tt[an]()},d=$e.callbacks,f=$e.scrollbars,b=$e.textarea,I=d.onUpdated,D=d.onOverflowChanged,O=d.onOverflowAmountChanged,N=d.onDirectionChanged,P=d.onContentSizeChanged,R=d.onHostSizeChanged,j=f.visibility,z=w(j,Wt,n),F=f.autoHide,B=w(F,Vt,n),U=f.clickScrolling,$=w(U,Gt,n),Y=f.dragScrolling,K=w(Y,Yt,n),X=$e.className,J=w(X,Qt,n),ee=$e.resize,te=w(ee,Kt,n)&&!Ci,ie=!!ki&&"off"!==Ke.attr("wrap"),re=w(ie,Nt,n),ae=$e.paddingAbsolute,oe=w(ae,St,n),se=$e.clipAlways,le=w(se,Et,n),ce=$e.sizeAutoCapable&&!Ci,ue=w(ce,Ot,n),he=$e.nativeScrollbarsOverlaid.showNativeScrollbars,me=w(he,Mt),ye=$e.autoUpdate,Te=w(ye,Lt),Se=$e.overflowBehavior,Ae=x(Se,It,Yi,Ki,n),Fe=b.dynWidth,Be=w(ei,Ue),Ue=b.dynHeight,We=w(Jt,Ue);if(ui="n"===F,di="s"===F,hi="l"===F,ci=f.autoHideDelay,pi=f.touchSupport,Zt=Qt,gi="n"===ee,vi="b"===ee,yi="h"===ee,_i="v"===ee,Xt=$e.normalizeRTL,he=he&&ke.x&&ke.y,Wt=j,Vt=F,Gt=U,Yt=Y,Qt=X,Kt=ee,Nt=ie,St=ae,Et=se,Ot=ce,Mt=he,Lt=ye,It=c.extend(!0,{},Se),ei=Fe,Jt=Ue,J&&(Xe.removeClass(Zt).removeClass(ir),X!==i&&null!==X&&X.length>0?Xe.addClass(X):Xe.addClass(ir)),Te&&(!0===ye?(E(),p.add(bi)):null===ye&&ve?(E(),p.add(bi)):(p.remove(bi),S())),ue)if(ce)if(Je===i&&(Je=c(Xi+Pn+Qi),et.before(Je)),Ti)Qe.show();else{Qe=c(Xi+Rn+Qi),Je.before(Qe);var Ve={w:-1,h:-1};_(Qe,function(){var e={w:Qe[0][a.oW],h:Qe[0][a.oH]};x(e,Ve)&&(wi&&yt&&e.h>0||vt&&e.w>0?fe():(wi&&!yt&&0===e.h||!vt&&0===e.w)&&fe()),Ve=e}),Ti=!0,null!==be&&Qe.css($i,be+"(100% + 1px)")}else Ti&&Qe.hide();n&&(Ze.find("*").trigger(Vi),Ti&&Qe.find("*").trigger(Vi));var Ge,Ye=Xe.css("direction"),ot=w(Ye,Ct,n),st=Xe.css("box-sizing"),lt=w(st,bt,n),ct={c:n,t:de(Xe.css(Oi+Pi)),r:de(Xe.css(Oi+Ri)),b:de(Xe.css(Oi+ji)),l:de(Xe.css(Oi+zi))};try{Ge=Ti?Qe[0].getBoundingClientRect():null}catch(e){return}De="border-box"===st;var ut=(je="rtl"===Ye)?zi:Ri,dt=je?Ri:zi,Tt=Xe[0],Rt=et[0],jt=!1,zt=!(!Ti||"none"===Xe.css(qi))&&0===Math.round(Ge.right-Ge.left)&&(!!ae||Tt[a.cW]-Me>0);if(ce&&!zt){var Ft=Tt[a.oW],Bt=Je.css(Ui);Je.css(Ui,Wi);var Ut=Tt[a.oW];Je.css(Ui,Bt),(jt=Ft!==Ut)||(Je.css(Ui,Ft+1),Ut=Tt[a.oW],Je.css(Ui,Bt),jt=Ft!==Ut)}var $t=(zt||jt)&&ce,qt=w($t,vt,n),Ht=!$t&&vt,ii=!!Ti&&0===Math.round(Ge.bottom-Ge.top),ni=w(ii,yt,n),ai=!ii&&yt,oi="-"+Ui,li=$t&&De||!De,fi=ii&&De||!De,mi={c:n,t:fi?de(Xe.css(Ni+Pi+oi)):0,r:li?de(Xe.css(Ni+Ri+oi)):0,b:fi?de(Xe.css(Ni+ji+oi)):0,l:li?de(Xe.css(Ni+zi+oi)):0},xi={c:n,t:de(Xe.css(Li+Pi)),r:de(Xe.css(Li+Ri)),b:de(Xe.css(Li+ji)),l:de(Xe.css(Li+zi))},Ei={h:String(Xe.css(Bi+$i)),w:String(Xe.css(Bi+Ui))},Ai={},Di={};if(Me=ct.l+ct.r,Le=ct.t+ct.b,ct.c=k(ct,wt),Oe=mi.l+mi.r,Ne=mi.t+mi.b,mi.c=k(mi,xt),Pe=xi.l+xi.r,Re=xi.t+xi.b,xi.c=k(xi,kt),Ei.ih=parseInt(Ei.h),Ei.iw=parseInt(Ei.w),Ei.ch=Ei.h.indexOf("px")>-1,Ei.cw=Ei.w.indexOf("px")>-1,Ei.c=x(Ei,_t,n),Ct=Ye,bt=st,vt=$t,yt=ii,wt=ct,xt=mi,kt=xi,_t=Ei,ot&&Ti&&Qe.css(qi,dt),ct.c||ot||oe||qt||ni||lt||ue){var Mi={},Zi={};T(Di,Li,[-ct.t,-ct.r,-ct.b,-ct.l]),ae?(T(Mi,Hi,[ct.t,ct.r,ct.b,ct.l]),T(ki?Zi:Ai,Oi)):(T(Mi,Hi),T(ki?Zi:Ai,Oi,[ct.t,ct.r,ct.b,ct.l])),et.css(Mi),Ke.css(Zi)}Ii={w:Rt[a.oW],h:Rt[a.oH]};var Ji=!!ki&&M();if(ii&&(ni||oe||lt||Ei.c||ct.c||mi.c)?(Ei.cw&&(Ai[Bi+$i]=Ei.ch?Ei.ih-(ae?Le:0)+(De?-Ne:Le):Hi),Ai[$i]=Wi):(ni||oe)&&(Ai[Bi+$i]=Hi,Ai[$i]=Gi),$t&&(qt||oe||lt||Ei.c||ct.c||mi.c||ot)?(Ei.cw&&(Ai[Bi+Ui]=Ei.cw?Ei.iw-(ae?Me:0)+(De?-Oe:Me)+(ke.y?Ce.y:0):Hi),Ai[Ui]=Wi,Di[Bi+Ui]=Gi):(qt||oe)&&(Ai[Bi+Ui]=Hi,Ai[Ui]=Gi,Ai[qi]=Hi,Di[Bi+Ui]=Hi),$t&&(Ei.cw||(Ai[Bi+Ui]=Hi),Di[Ui]=ki&&Fe?Ji.dw:Wi,Ai[Ui]=Wi,Ai[qi]=dt),ii&&(Ei.ch||(Ai[Bi+$i]=Hi),Di[$i]=ki?Ue?Ji.dh:Wi:nt[0][a.cH]),ce&&Je.css(Di),nt.css(Ai),Ai={},Di={},mt=mt||{x:!1,y:!1},e||t||ot||lt||oe||qt||$t||ni||ii||Ei.c||me||Ae||le||te||z||Be||We||re||oe||Be||We||n){var en="overflow",tn=en+"-x",nn=en+"-y",sn="hidden",ln="visible",cn=!!Ie&&(ke.x||ke.y||Ii.w<xe.y||Ii.h<xe.x),un={},dn=mt.y&>.ys&&!he?ke.y?tt.css(ut):-we.y:0,hn=mt.x&>.xs&&!he?ke.x?tt.css(ji):-we.x:0;T(un,Hi),tt.css(un),cn&&nt.css(en,sn);var pn=pe(),fn=cn?pn:tt[0],mn={w:pn[a.cW],h:pn[a.cH]},gn={w:Math.max(pn[a.sW],fn[a.sW]),h:Math.max(pn[a.sH],fn[a.sH])},vn={w:ki&&Ji&&!Fe?Ji.ow:$t?mn.w:gn.w,h:ki&&Ji&&!Ue?Ji.oh:ii?mn.h:gn.h};un[ji]=ai?Hi:hn,un[ut]=Ht?Hi:dn,tt.css(un);var yn={w:Tt[a.cW],h:Tt[a.cH]},_n={w:Math.max(vn.w+(ae?Me:0),yn.w-Me)-(Fe&&ki&&$t?Pe+(De?0:Me+Oe):0),h:Math.max(vn.h+(ae?Le:0),yn.h-Le)};if(_n.c=x(_n,At,n),At=_n,ce){(_n.c||ii||$t)&&(Di[Ui]=_n.w,Di[$i]=_n.h);var bn=Di[Ui]+(De?Oe:-Me),En=Di[$i]+(De?Ne:-Me),An={};(!$t||!$t&&mi.c)&&(Di[Ui]=yn.w-(De?0:Me+Oe)-1-Pe),(!ii||!ii&&mi.c)&&(Di[$i]=yn.h-(De?0:Le+Ne)-1-Re),Ei.cw&&Ei.iw===bn&&(Di[Ui]=bn+(De?0:Me)+1),Ei.ch&&Ei.ih===En&&(Di[$i]=En+(De?0:Le)+1),$t&&(mn.w<Ii.w||ki&&!ie)&&0===Me&&(ki&&(An[Ui]=de(rt.css(Ui))-1),Di[Ui]-=1),ii&&(mn.h<Ii.h||ki)&&0===Le&&(ki&&(An[$i]=de(rt.css($i))-1),Di[$i]-=1),vn.h>0&&(Di[Ui]=Math.max(1,Di[Ui]),Di[$i]=Math.max(1,Di[$i])),ki&&rt.css(An),Je.css(Di)}$t&&(Ai[Ui]=Gi),!$t||De||ri||(Ai[qi]="none"),nt.css(Ai),Ai={};var In=pn.getBoundingClientRect(),Dn={w:Math.max(pn[a.sW],fn[a.sW]),h:Math.max(pn[a.sH],fn[a.sH])};if(cn&&nt.css(en,Hi),In.width!==i){var Mn=In.width,Ln=In.height;Dn.w+=de(Mn+.001)-Mn,Dn.h+=de(Ln+.001)-Ln}Dn.c=t=x(Dn,pt,n),pt=Dn,e=x(yn={w:Tt[a.cW],h:Tt[a.cH]},ht),ht=yn,Ii={w:Rt[a.oW],h:Rt[a.oH]};var On={x:"v-s"===Se.x,y:"v-s"===Se.y},jn={x:"v-h"===Se.x,y:"v-h"===Se.y},zn={x:"s"===Se.x,y:"s"===Se.y},Fn={x:Math.max(0,Dn.w-yn.w+(ae?Me:0)),y:Math.max(0,Dn.h-yn.h+(ae?Le:0))},Bn=ki&&(0===Ii.w||0===Ii.h);Bn&&(Fn.x=0,Fn.y=0);var Un={x:Fn.x>0,y:Fn.y>0},$n={x:Un.x,y:Un.y};(On.x||jn.x)&&($n.x=Un.y&&!On.y&&!jn.y),(On.y||jn.y)&&($n.y=Un.x&&!On.x&&!jn.x),$n.xs=!!$n.x&&(zn.x||On.x),$n.ys=!!$n.y&&(zn.y||On.y);var qn={x:Un.x&&$n.xs,y:Un.y&&$n.ys},Hn=Dt;if(Fn.c=x(Fn,Dt,Yi,Ki,n),Dt=Fn,Un.c=x(Un,mt,Yi,Ki,n),mt=Un,$n.c=x($n,gt,Yi,Ki,n),gt=$n,ke.x||ke.y){var Wn=n,Vn={};if((Un.x||Un.y)&&(Vn.w=ke.y&&Un.y?Dn.w+Ce.y:Hi,Vn.h=ke.x&&Un.x?Dn.h+Ce.x:Hi,Wn=w(Vn,ft,n),ft=Vn),Un.c||$n.c||Dn.c||ot||qt||ni||$t||ii||me){var Gn="px solid transparent";Ai[Ni+dt]=Hi,Ai[Li+dt]=Hi,ke.x&&Un.x&&$n.xs?(ii&&(Ai[Li+ji]=he?Hi:Ce.x),Ai[Ni+ji]=ii||he?Hi:Ce.x+Gn):(Vn.h=Hi,Wn=!0,Ai[Ni+ji]=Hi,Ai[Li+ji]=Hi),ke.y&&Un.y&&$n.ys?($t&&(Ai[Li+ut]=he?Hi:Ce.y),Ai[Ni+ut]=he?Hi:Ce.y+Gn):(Vn.w=Hi,Wn=!0,Ai[Ni+ut]=Hi,Ai[Li+ut]=Hi)}if(he&&(Vn.w=Hi,Vn.h=Hi,Wn=!0),Wn){var Yn={};Yn[Ui]=$n.y?Vn.w:Hi,Yn[$i]=$n.x?Vn.h:Hi,it===i&&(it=c(Xi+Nn+Qi),tt.prepend(it)),it.css(Yn)}nt.css(Ai)}var Jn={};if(Mi={},e||Un.c||$n.c||Dn.c||Ae||lt||me||ot||le||ni){Jn[dt]=Hi;var er=function(){Jn[ji]=Hi,Si.h=0},tr=function(){Jn[ut]=Hi,Si.w=0};if(Un.x&&$n.xs?(Jn[tn]=Vi,he?er():(Jn[ji]=-(ke.x?Ce.x:we.x),Si.h=ke.x?Ce.y:0)):(Jn[tn]=Hi,er()),Un.y&&$n.ys?(Jn[nn]=Vi,he?tr():(Jn[ut]=-(ke.y?Ce.y:we.y),Si.w=ke.y?Ce.x:0)):(Jn[nn]=Hi,tr()),(Ii.h<xe.x||Ii.w<xe.y)&&(Un.x&&$n.x&&!ke.x||Un.y&&$n.y&&!ke.y)?(Jn[Oi+Pi]=xe.x,Jn[Li+Pi]=-xe.x,Jn[Oi+dt]=xe.y,Jn[Li+dt]=-xe.y):(Jn[Oi+Pi]=Hi,Jn[Li+Pi]=Hi,Jn[Oi+dt]=Hi,Jn[Li+dt]=Hi),Jn[Oi+ut]=Hi,Jn[Li+ut]=Hi,Un.x&&$n.x||Un.y&&$n.y||Bn?ki&&Bn&&(Mi[tn]=sn,Mi[nn]=sn):(!se||jn.x||On.x||jn.y||On.y)&&(ki&&(Mi[tn]=Hi,Mi[nn]=Hi),Jn[tn]=ln,Jn[nn]=ln),et.css(Mi),tt.css(Jn),Jn={},(Un.c||lt||qt||ni)&&(!ke.x||!ke.y)){var ar=nt[0],or=ar.style;or.webkitTransform="scale(1)",or.display="run-in",ar[a.oH],or.display=Hi,or.webkitTransform=Hi}me&&he&&(Xe.hide(),Tt[a.oH],Xe.show())}if(Ai={},ot||qt||ni)if(je&&$t){var sr=nt.css(qi),lr=Math.round(nt.css(qi,Hi).css(zi,Hi).position().left);nt.css(qi,sr),lr!==Math.round(nt.position().left)&&(Ai[zi]=lr)}else Ai[zi]=Hi;nt.css(Ai);var cr="v"===j,ur="h"===j,dr="a"===j,hr=o.bind(q,0,!0,!0,qn.x),pr=o.bind(q,0,!1,!0,qn.y),fr=o.bind(q,0,!0,!1,qn.x),mr=o.bind(q,0,!1,!1,qn.y);if(ot&&(je?Xe.addClass(wn):Xe.removeClass(wn)),Ci&&Xe.addClass(xn),te){var gr=function(){at.off(on,A)};gi?(Xe.addClass(xn),at.removeClass(Kn).removeClass(Xn).removeClass(Qn).removeClass(Zn),gr()):(Xe.removeClass(xn),at.addClass(Kn),vi?at.addClass(Xn):yi?at.addClass(Qn):_i&&at.addClass(Zn),gr(),function(){at.on(on,A)}())}if((z||Ae||$n.c||Un.c||me)&&(he?me&&(Xe.removeClass(kn),he&&(fr(),mr())):dr?(qn.x?hr():fr(),qn.y?pr():mr()):cr?(hr(),pr()):ur&&(fr(),mr())),B||me){var vr="mouseenter",yr="mouseleave",_r=function(){Ee?(g(Xe,vr,Q),g(Xe,yr,Z)):(Xe.off(vr,Q),Xe.off(yr,Z))};hi?(_r(),function(){Ee?(m(Xe,vr,Q),m(Xe,yr,Z)):(Xe.on(vr,Q),Xe.on(yr,Z))}()):_r(),ui?H(!0):H(!1,!0)}if((e||Fn.c||ni||qt||te||lt||oe||me||ot)&&(W(!0),V(!0,u.l),W(!1),V(!1,u.t)),$&&G(!0,U),K&&G(!1,Y),$n.x||$n.y?Xe.addClass(Cn):Xe.removeClass(Cn),$n.x?Xe.addClass(Tn):Xe.removeClass(Tn),$n.y?Xe.addClass(Sn):Xe.removeClass(Sn),ki&&t){var br=L();if(br!==i){var wr=Pt===i||br.rows!==Pt.rows,xr=br.wRow,kr=br.cursorRow,Cr=br.cursorCol,Tr=br.rows,Sr=br.cols,Er=br.pos,Ar=br.max===Er&&si,Ir={x:ie||Cr!==Sr||kr!==xr?-1:Dt.x,y:(ie?Ar||wr&&Hn!==i&&u.t===Hn.y:(Ar||wr)&&kr===Tr)?Dt.y:-1},Dr=Ir.x>-1,Mr=Ir.y>-1;(Dr||Mr)&&(Mr&&tt[an](Ir.y),Dr&&(je&&Xt&&ge.i?tt[rn](0):tt[rn](Ir.x)))}Pt=br}else ki||(je&&ge.i&&ke.y&&Un.x&&Xt&&(u.l+=Si.w),tt[rn](u.l),tt[an](u.t));ot&&c.isFunction(N)&&C(N,{isRTL:je,dir:Ye}),e&&c.isFunction(R)&&C(R,{width:ht.w,height:ht.h}),t&&c.isFunction(P)&&C(P,{width:pt.w,height:pt.h}),(Un.c||$n.c)&&c.isFunction(D)&&C(D,{x:Un.x,y:Un.y,xScrollable:$n.xs,yScrollable:$n.ys,clipped:$n.x||$n.y}),Fn.c&&c.isFunction(O)&&C(O,{x:Fn.x,y:Fn.y})}Ci&&(Un.c||ti.c)&&(ti.f||ne(),ke.y&&Un.x&&nt.css(Fi+Ui,ti.w+Ce.y),ke.x&&Un.y&&nt.css(Fi+$i,ti.h+Ce.x),ti.c=!1),y(Ze),y(Qe),c.isFunction(I)&&C(I,{forced:n})}}if(te(t)){if(l.has(t)){var me=l.get(t);return me.options(d),me}var ge,ve,ye,_e,be,we,xe,ke,Ce,Te,Se,Ee,Ae,Ie,De,Me,Le,Oe,Ne,Pe,Re,je,ze,Fe,Be,Ue,$e,qe,He,We,Ve,Ge,Ye,Ke,Xe,Qe,Ze,Je,et,tt,it,nt,rt,at,ot,st,lt,ct,ut,dt,ht,pt,ft,mt,gt,vt,yt,_t,bt,wt,xt,kt,Ct,Tt,St,Et,At,It,Dt,Mt,Lt,Ot,Nt,Pt,Rt,jt,zt,Ft,Bt,Ut,$t,qt,Ht,Wt,Vt,Gt,Yt,Kt,Xt,Qt,Zt,Jt,ei,ti,ii,ni,ri,ai,oi,si,li,ci,ui,di,hi,pi,fi,mi,gi,vi,yi,_i,bi=new e[n],wi=!1,xi=!1,ki=!1,Ci=!1,Ti=!1,Si={w:0,h:0},Ei={},Ai={},Ii={},Di=175,Mi="-hidden",Li="margin-",Oi="padding-",Ni="border-",Pi="top",Ri="right",ji="bottom",zi="left",Fi="min-",Bi="max-",Ui="width",$i="height",qi="float",Hi="",Wi="auto",Vi="scroll",Gi="100%",Yi="x",Ki="y",Xi='<div class="',Qi='"></div>',Zi=".",Ji=" ",en="scrollbar",tn="-horizontal",nn="-vertical",rn=Vi+"Left",an=Vi+"Top",on="mousedown touchstart",sn="mouseup touchend",ln="mousemove touchmove",cn="keydown",un="keyup",dn="selectstart",hn="transitionend webkitTransitionEnd oTransitionEnd",pn="__overlayScrollbarsRO__",fn="os-",mn="os-html",gn="os-host",vn=gn+"-textarea",yn=gn+"-"+en+tn+Mi,_n=gn+"-"+en+nn+Mi,bn=gn+"-transition",wn=gn+"-rtl",xn=gn+"-resize-disabled",kn=gn+"-scrolling",Cn=gn+"-overflow",Tn=Cn+"-x",Sn=Cn+"-y",En="os-textarea",An=En+"-cover",In="os-padding",Dn="os-viewport",Mn=Dn+"-native-scrollbars-invisible",Ln=Dn+"-native-scrollbars-overlaid",On="os-content",Nn="os-content-arrange",Pn="os-content-glue",Rn="os-size-auto-observer",jn="os-resize-observer",zn="os-resize-observer-item",Fn=zn+"-final",Bn="os-text-inherit",Un=fn+en,$n=Un+"-track",qn=$n+"-off",Hn=Un+"-handle",Wn=Hn+"-off",Vn=Un+"-unusable",Gn=Un+"-"+Wi+Mi,Yn=Un+"-corner",Kn=Yn+"-resize",Xn=Kn+"-both",Qn=Kn+tn,Zn=Kn+nn,Jn=Un+tn,er=Un+nn,tr="os-dragging",ir="os-theme-none",nr={},rr=33,ar=11,or=[112,113,114,115,116,117,118,119,120,121,123,33,34,37,38,39,40,16,17,18,19,20,144],sr=[],lr={x:0,y:0},cr={w:0,h:0};if(bi.sleep=function(){ze=!0},bi.update=function(e){if(e===Wi){var t=ue(),i=ce();(t||i)&&fe(!1,i)}else"zoom"===e?fe(!0,!0):(e=ze||e,ze=!1,fe(!1,!1,e))},bi.options=function(e,t){if(c.isEmptyObject(e)||!c.isPlainObject(e)){if(c.type(e)===r.s){if(arguments.length>=2){var i={};return u.set(i,e,t,!0),le(i),void fe()}return u.get(Ue,e)}return Ue}le(e);var n=ze||!1;ze=!1,fe(),ze=n},bi.destroy=function(){xi=!0,p.remove(bi),E(),b(Ze),Ti&&b(Qe),Ze.remove(),Je!==i&&Je.remove(),it!==i&&it.remove(),Ti&&Qe.remove(),Ee?(g(Xe,"mouseenter",Q),g(Xe,"mouseleave",Z)):(Xe.off("mouseenter",Q),Xe.off("mouseleave",Z)),ot.remove(),ct.remove(),at&&at.remove(),gi||D(),nt.contents().unwrap().unwrap().unwrap(),Ci&&Ge.removeClass(mn),ki?(Ke.off(Vi,B),Ke.off("drop",j),Ke.off("focus",z),Ke.off("focusout",F),ye>9||!ve?Ke.off("input",N):(Ke.off(cn,P),Ke.off(un,R)),rt.remove(),Ke.removeClass(En).removeClass(Bn),Ke.unwrap().removeAttr(a.s),Xe.remove()):(Ke.removeClass(gn),Xe.removeClass(gn).removeClass(xn).removeClass(wn).removeClass(yn).removeClass(_n).removeClass(bn).removeClass(kn).removeClass(Cn).removeClass(Tn).removeClass(Sn).removeClass(ir).removeClass(Qt)),l.rem(t);var e=$e.callbacks.onDestroyed;for(var n in c.isFunction(e)&&C(e),bi)delete bi[n];bi=i},bi.scroll=function(t,n,o,s){if(0===arguments.length||t===i){var l=Ei,u=Ai,d=Xt&&je&&ge.i,h=Xt&&je&&ge.n,p=l.cs,f=l.csr,m=l.ms;return p=d?m-p:p,{x:{position:p*=h?-1:1,ratio:f=d?1-f:f,max:m*=h?-1:1,handleOffset:l.ho,handleLength:l.hl,handleLengthRatio:l.hlr,trackLength:l.tl,isRTL:je,isRTLNormalized:Xt},y:{position:u.cs,ratio:u.csr,max:u.ms,handleOffset:u.ho,handleLength:u.hl,handleLengthRatio:u.hlr,trackLength:u.tl}}}var g,v=[Yi,zi,"l"],y=[Ki,Pi,"t"],_=["+=","-=","*=","/="],b={},w=c.type(n)===r.o,x="end",k="begin",C={axis:"xy",block:[k,k],margin:[0,0,0,0]},T=[Yi,Ki,"xy","yx"],S=[k,x],E=t.hasOwnProperty("el"),A=E?t.el:t,I=A instanceof c,D=!I&&te(A),M=function(e,t){for(g=0;g<t.length;g++)if(e===t[g])return!0;return!1},L=function(e){var t={};if(c.type(e)===r.a&&e.length>0)t.x=e[0],t.y=e[1];else if(c.type(e)===r.s||c.type(e)===r.n)t.x=e,t.y=e;else if(c.type(e)===r.o){for(var i in e=c.extend({},e),g=0,e)e.hasOwnProperty(i)&&(g>2&&delete e[i],g++);var n=function(t){var i=t?v:y;for(g=0;g<i.length;g++)if(i[g]in e)return e[i[g]]};t.x=n(!0),t.y=n(!1)}return t},O=function(t,n){var a,o,s,l=t?Ei:Ai,u=l.cs,d=l.ms,h=" * ",p=je&&t,f=p&&ge.n&&!Xt;if(c.type(n)===r.s){if(n.length>2){var m=n.substr(0,2);for(g=0;g<_.length;g++)if(m===_[g]){a=_[g];break}}n=(n=(n=(n=(n=(n=(n=(n=(n=a!==i?n.substr(2):n).replace(/min/g,0)).replace(/</g,0)).replace(/max/g,(f?"-":Hi)+Gi)).replace(/>/g,(f?"-":Hi)+Gi)).replace(/px/g,Hi)).replace(/%/g,h+d*(p&&ge.n?-1:1)/100)).replace(/vw/g,h+Ii.w)).replace(/vh/g,h+Ii.h),o=e.parseInt(e.parseFloat(e.eval(n)).toFixed())}else c.type(n)===r.n&&(o=n);if(!isNaN(o)&&o!==i&&c.type(o)===r.n){var v=Xt&&p,y=u*(v&&ge.n?-1:1),b=v&&ge.i,w=v&&ge.n;switch(y=b?d-y:y,a){case"+=":s=y+o;break;case"-=":s=y-o;break;case"*=":s=y*o;break
|
||
;case"/=":s=y/o;break;default:s=o}b&&(s=d-s),w&&(s*=-1),p&&ge.n?(s=Math.max(d,s),s=Math.min(0,s)):(s=Math.min(d,s),s=Math.max(0,s)),s===u&&(s=i)}return s};if(I||D){var N=I?A:c(A);if(0===N.length)return;if(E){var P,R,j,z=t.axis,F=t.block,B=c.type(F),U=t.margin,$=c.type(U);if(B===r.s)F=[F,F];else if(B===r.a)if((R=F.length)>2||R<1)F=i;else{for(P=!0,1===R&&(F[1]=k),g=0;g<R;g++){var q=F[g];if(c.type(q)!==r.s||!M(q,S)){P=!1;break}}P||(F=i)}else F=i;if($===r.n)U=[U,U,U,U];else if("boolean"===$)U=U?[de(N.css(Li+Pi)),de(N.css(Li+Ri)),de(N.css(Li+ji)),de(N.css(Li+zi))]:[0,0,0,0];else if($===r.a)if(2!==(j=U.length)&&4!==j)U=i;else{for(P=!0,g=0;g<j;g++)if(c.type(U[g])!==r.n){P=!1;break}P?2===j&&(U=[U[0],U[1],U[0],U[1]]):U=i}else U=i;C.axis=M(z,T)?z:C.axis,C.block=F||C.block,C.margin=U||C.margin}var H=N.offset(),W=et.offset(),V=Ii,G={l:Ei.cs,t:Ai.cs},Y=C.axis,K=C.block,X=C.margin,Q=K[0]===(je?k:x),Z=K[1]===x,J=Q||Z;H.top-=X[0],H.left-=X[3];var ee={x:Math.round(H.left-W.left+G.l),y:Math.round(H.top-W.top+G.t)};if(je&&(ge.n||ge.i||(ee.x=Math.round(W.left-H.left+G.l)),ge.n&&Xt&&(ee.x*=-1),ge.i&&Xt&&(ee.x=Math.round(W.left-H.left+(Ei.ms-G.l)))),J){var ie,ne={},re={w:(ne=Se?{w:(ie=N[0].getBoundingClientRect())[Ui],h:ie[$i]}:{w:N[0][a.oW],h:N[0][a.oH]}).w+X[3]+X[1],h:ne.h+X[0]+X[2]};Q&&(ee.x-=(V.w-re.w)*(je&&Xt?-1:1)),Z&&(ee.y-=V.h-re.h)}Y===Yi&&delete ee.y,Y===Ki&&delete ee.x,t=ee}b.x=O(!0,L(t).x),b.y=O(!1,L(t).y);var ae=b.x!==i,oe=b.y!==i;if(n>0||w){var se={};if(ae&&(se[rn]=b.x),oe&&(se[an]=b.y),w)tt.animate(se,n);else{var le={duration:n,complete:s};if(c.type(o)===r.a){var ce={};ce[rn]=o[0],ce[an]=o[1],le.specialEasing=ce}else le.easing=o;tt.animate(se,le)}}else ae&&tt[rn](b.x),oe&&tt[an](b.y)},bi.scrollStop=function(e,t,i){tt.stop(e,t,i)},bi.getElements=function(){return{target:Ke[0],host:Xe[0],padding:et[0],viewport:tt[0],content:nt[0],scrollbarHorizontal:{scrollbar:ot[0],track:st[0],handle:lt[0]},scrollbarVertical:{scrollbar:ct[0],track:ut[0],handle:dt[0]},scrollbarCorner:at}},bi.getState=function(e){var t=function(e){if(!c.isPlainObject(e))return e;var t=c.extend(!0,{},e);u.del(t,"c");var i=function(e,i){t.hasOwnProperty(e)&&(t[i]=t[e],delete t[e])};return i("w",Ui),i("h",$i),t},i={sleeping:t(ze)||!1,autoUpdate:t(!ri),widthAuto:t(vt),heightAuto:t(yt),padding:t(wt),overflowAmount:t(Dt),hideOverflow:t(gt),hasOverflow:t(mt),contentScrollSize:t(pt),viewportSize:t(Ii),hostSize:t(ht)};return c.type(e)===r.s?u.get(i,e):i},function(e,t){Be=h.defaultOptions,_e=h.nativeScrollbarStyling,we=c.extend(!0,{},h.nativeScrollbarSize),ke=c.extend(!0,{},h.nativeScrollbarIsOverlaid),Ce=c.extend(!0,{},h.overlayScrollbarDummySize),ge=c.extend(!0,{},h.rtlScrollBehavior),le(c.extend(!0,{},Be,t));var i,n=$e.callbacks;if(ke.x&&ke.x&&!$e.nativeScrollbarsOverlaid.initialize){var r=n.onInitializationWithdrawn;return c.isFunction(r)&&C(r),!1}if(be=h.cssCalc,ye=h.msie,ve=h.autoUpdateRecommended,Te=h.supportTransition,Se=h.supportTransform,Ee=h.supportPassiveEvents,Ae=h.supportResizeObserver,ai=h.supportMutationObserver,Ie=h.restrictedMeasuring,Ve=c(e.ownerDocument),We=c(Ve[0].defaultView||Ve[0].parentWindow),Ge=Ve.find("html").first(),Ye=Ge.find("body").first(),Ke=c(e),ki=Ke.is("textarea"),(Ci=Ke.is("body"))&&((i={}).l=Math.max(Ke[rn](),Ge[rn](),We[rn]()),i.t=Math.max(Ke[an](),Ge[an](),We[an]())),ki){Ke.wrap(Xi+vn+Qi),Ke.addClass(En).addClass(Bn),Xe=Ke.parent();var o={};$e.sizeAutoCapable||(o[Ui]=Ke.css(Ui),o[$i]=Ke.css($i)),Xe.css(o),Xe.wrapInner(Xi+On+Ji+Bn+Qi).wrapInner(Xi+Dn+Ji+Bn+Qi).wrapInner(Xi+In+Ji+Bn+Qi),nt=Xe.find(Zi+On).first(),tt=Xe.find(Zi+Dn).first(),et=Xe.find(Zi+In).first(),rt=c(Xi+An+Qi),nt.prepend(rt),Ke.on(Vi,B),Ke.on("drop",j),Ke.on("focus",z),Ke.on("focusout",F),ye>9||!ve?Ke.on("input",N):(Ke.on(cn,P),Ke.on(un,R))}else Ke.addClass(gn),(Xe=Ke).wrapInner(Xi+On+Qi).wrapInner(Xi+Dn+Qi).wrapInner(Xi+In+Qi),nt=Xe.find(Zi+On).first(),tt=Xe.find(Zi+Dn).first(),et=Xe.find(Zi+In).first(),nt.on(hn,function(e){!0!==Lt&&he((e=e.originalEvent||e).propertyName)&&fe(Wi)});if(Y(),Ee?m(tt,Vi,J):tt.on(Vi,J),_e&&(ke.x&&ke.y?tt.addClass(Ln):tt.addClass(Mn)),ai){var l,u=s.mO(),d=s.now();ii=new u(function(e){if(wi&&!ze){var t=!1;c.each(e,function(){var e=this,i=this.target,n=e.attributeName;if(t=n===a.c?oe(e.oldValue,i.className):n!==a.s||e.oldValue!==i.style.cssText)return!1}),t&&bi.update(Wi)}}),ni=new u(function(e){if(wi&&!ze){for(var t=!1,i=0;i<e.length;i++)if(se(e[i])){t=!0;break}if(t){var n=s.now(),r=yt||vt,a=function(){d=n,ki&&M(),r?bi.update():bi.update(Wi)};clearTimeout(l),ar<=0||n-d>ar||!r?a():l=setTimeout(a,ar)}}})}Ci&&(Ge.addClass(mn),tt[rn](i.l),tt[an](i.t)),Ze=c(Xi+"os-resize-observer-host"+Qi),Xe.prepend(Ze),_(Ze,f),f(),bi.update(Wi),setTimeout(function(){Te&&!xi&&Xe.addClass(bn)},333),wi=!0;var p=n.onInitialized;return c.isFunction(p)&&C(p),wi}(t,d))return l.add(t,bi),bi;bi=i}}var m,g,v={className:"os-theme-dark",resize:"none",sizeAutoCapable:!0,clipAlways:!0,normalizeRTL:!0,paddingAbsolute:!1,autoUpdate:null,autoUpdateInterval:33,nativeScrollbarsOverlaid:{showNativeScrollbars:!1,initialize:!0},overflowBehavior:{x:"scroll",y:"scroll"},scrollbars:{visibility:"auto",autoHide:"never",autoHideDelay:800,dragScrolling:!0,clickScrolling:!1,touchSupport:!0},textarea:{dynWidth:!1,dynHeight:!1},callbacks:{onInitialized:null,onInitializationWithdrawn:null,onDestroyed:null,onScrollStart:null,onScroll:null,onScrollStop:null,onOverflowChanged:null,onOverflowAmountChanged:null,onDirectionChanged:null,onContentSizeChanged:null,onHostSizeChanged:null,onUpdated:null}};e[n]=function(e,t){if(0===arguments.length)return this;d();var n,r=[];return c.isPlainObject(t)?e&&e.length?e.length>1?(c.each(e,function(){(n=this)!==i&&r.push(f(n,t,m,g))}),r):f(e[0],t,m,g):f(e,t,m,g):e?e.length&&e.length>0?e.length>1?(c.each(e,function(){n=l.get(this),"!"===t?n!==i&&r.push(n):r.push(n)}),r):l.get(e[0]):l.get(e):void 0},e[n].globals=function(){d();var e=c.extend(!0,{},m);return delete e.msie,e},e[n].defaultOptions=function(e){d();var t=m.defaultOptions;if(e===i)return c.extend(!0,{},t);m.defaultOptions=c.extend(!0,{},t,e)}}(o,l,s,c),e.jQuery);return u&&u.fn&&(u.fn.overlayScrollbars=function(t){var i=this;return u.isPlainObject(t)?(u.each(i,function(){e[n](this,t)}),i):e[n](i,t)}),e[n]}),define("text!modules/console/expdesktop/lang.json",[],function(){return'{\r\n "config": {\r\n "annex_data":[],\r\n "submit_status":"",\r\n "report_list":0,\r\n "annex_number":0,\r\n "report_data":"",\r\n\r\n "allow_delay":false,\r\n "lab_save_count": 0,\r\n "password_view":"false",\r\n "allow_save":false,\r\n "allow_vpn":false,\r\n "vms": {},\r\n "page_id": "expdesltop_view_data_page",\r\n "current_assister": "",\r\n "current_assis_type": "read",\r\n "desktop_title": "",\r\n "current_unfold": "docmarkdown",\r\n "isspread": false,\r\n "vm_param": "",\r\n "is_split": false,\r\n "reportData": "",\r\n "reportBtn": "",\r\n "step_msg": "",\r\n "is_assist": false,\r\n "assist_process_token": "",\r\n "assist_conn_token": "",\r\n "is_fullscreen": false,\r\n "is_onresize": true,\r\n "checkFull": false,\r\n "vm_status": "closed",\r\n "conTitle": {\r\n "field": "contitle"\r\n },\r\n "menu_tools": {\r\n "vm_name": "",\r\n "protocols": ""\r\n },\r\n "editormd": {\r\n "editormd_show": "editormd_show_title"\r\n },\r\n "toggle": {\r\n "tools_show": "hide",\r\n "editormd_show": "hide"\r\n },\r\n "step": {\r\n "allow_vpn": false,\r\n "vpn_info": {},\r\n "ip": "",\r\n "token": "",\r\n "progress": 0,\r\n "instance_id": "",\r\n "protocol": "",\r\n "os_type": "",\r\n "op_system_type": "",\r\n "id": "",\r\n "os_password": "",\r\n "os_username": "",\r\n "dataset_list": [],\r\n "res_list": [\r\n\r\n ],\r\n "vm_models": {},\r\n "menu_view": {\r\n "tool_view": true,\r\n "doc_view": true\r\n },\r\n "fields": [\r\n {\r\n "field": "forced_close",\r\n "enabled": true,\r\n "hide": true,\r\n "type": "button",\r\n "icon": "play-circle"\r\n },\r\n {\r\n "field": "create",\r\n "enabled": true,\r\n "hide": false,\r\n "type": "button",\r\n "icon": "play-circle"\r\n },\r\n {\r\n "field": "delay",\r\n "enabled": true,\r\n "hide": true,\r\n "type": "button",\r\n "icon": "clock-o"\r\n },\r\n {\r\n "field": "saveexp",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "save"\r\n },\r\n {\r\n "field": "lookrecover",\r\n "enabled": true,\r\n "hide": true,\r\n "type": "button",\r\n "icon": "cloud"\r\n },\r\n {\r\n "field": "help",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "share-alt"\r\n },\r\n {\r\n "field": "unhelp",\r\n "hide": true,\r\n "type": "button",\r\n "enabled": true,\r\n "icon": "share-square"\r\n },\r\n {\r\n "field": "viewtype",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "columns"\r\n },\r\n {\r\n "field": "copytext",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "copy"\r\n },\r\n {\r\n "field": "scrapbooking",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "scissors"\r\n },\r\n {\r\n "field": "fullscreen",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "arrows-alt"\r\n },\r\n {\r\n "field": "refresh",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "refresh"\r\n\r\n },\r\n {\r\n "field": "close",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "close"\r\n },\r\n\r\n {\r\n "field": "exception",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": false,\r\n "icon": "bug"\r\n }\r\n ],\r\n "vm_name": {\r\n "field": "vm_name",\r\n "data": []\r\n },\r\n "protocols": {\r\n "data": [],\r\n "value": ""\r\n },\r\n "interacts": {\r\n "field": "interacts",\r\n "data": [],\r\n "value": ""\r\n },\r\n "extension": {\r\n "field": "extension",\r\n "select": "",\r\n "data": [\r\n {\r\n "field": "vpn_exchange",\r\n "hide":true\r\n\r\n }\r\n ]\r\n }\r\n\r\n ,\r\n "vpn_exchange": {\r\n "field": "vpn_exchange",\r\n "data": [\r\n {\r\n "field": "vpn_conn",\r\n "icon": "exchange",\r\n "disabled":false\r\n },\r\n {\r\n "field": "vpn_view",\r\n "icon": "eye",\r\n "disabled": false\r\n\r\n }\r\n ]\r\n }\r\n\r\n },\r\n\r\n "timeout": {\r\n "day":"0",\r\n "hour": "00",\r\n "minute": "00",\r\n "second": "00",\r\n\r\n "zero": 0,\r\n "allSecond": 0\r\n },\r\n "fields_report": [{\r\n "field": "completion",\r\n "type": "radio",\r\n "style": "vclass-name",\r\n "name": "radio",\r\n "value": 0,\r\n "data": [{\r\n "field": "all_status",\r\n "status": true,\r\n "value": 0\r\n },\r\n {\r\n "field": "section_status",\r\n "status": false,\r\n "value": 1\r\n },\r\n {\r\n "field": "undone_status",\r\n "status": false,\r\n "value": 2\r\n }\r\n ]\r\n },\r\n {\r\n "type": "ueditor",\r\n "field": "content",\r\n "value": ""\r\n }\r\n ],\r\n "fieldbuttons": [{\r\n "field": "save",\r\n "style": "save",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "savestep",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ],\r\n "step_video_list":[],\r\n "step_attachment_list": [],\r\n "doctabs": [{\r\n "field": "docmarkdown",\r\n "active": true,\r\n "show": true,\r\n "type": "doc"\r\n },\r\n {\r\n "field": "evaluation",\r\n "active": false,\r\n "show": true,\r\n "type": "evaluation"\r\n },\r\n {\r\n "field": "report",\r\n "active": false,\r\n "show": false,\r\n "type": "report"\r\n },\r\n {\r\n "field": "material",\r\n "active": false,\r\n "show": true,\r\n "type": "material"\r\n },\r\n {\r\n "field": "video",\r\n "active": false,\r\n "show": true,\r\n "type": "video"\r\n },\r\n {\r\n "field": "file",\r\n "active": false,\r\n "show": true,\r\n "type": "code"\r\n }\r\n ],\r\n\r\n "show_vm": {\r\n "field": "close_vm",\r\n "code_data": "",\r\n "prompt": "",\r\n "show": false,\r\n "loading": true,\r\n "os_type": ""\r\n\r\n },\r\n "vstep_id": "",\r\n "step_code_list": [],\r\n "isloaded": false,\r\n "getGroup_res_data": "",\r\n "course_evaluate": {\r\n "field": "course_evaluate",\r\n "score": 0,\r\n "isCreate": true,\r\n "comment": {\r\n "field": "comment",\r\n "value": ""\r\n },\r\n "tip": {\r\n "field": "evaluate_tip",\r\n "value": ""\r\n },\r\n "button": {\r\n "field": "send_comment"\r\n },\r\n "comment_list": [\r\n\r\n ]\r\n },\r\n "comment_list": [\r\n\r\n ],\r\n "ismark": false,\r\n "markid": "",\r\n "op_type": "",\r\n "is_start": false,\r\n "shanhe_ws": "",\r\n "shanhe_instance_info": {\r\n "instances": []\r\n },\r\n "shanhe_instance_close_vm_info": {\r\n "instances": []\r\n },\r\n "shanhe_instance_connect_info": {},\r\n "job_action_start_or_stop": "",\r\n "guac_file_lists": [],\r\n "guac_file_current_path": "/",\r\n "guac_file_full_path": [""],\r\n "scrapbooking_text": ""\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "all_status": "全部完成",\r\n "section_status": "部分完成",\r\n "undone_status": "未完成",\r\n "title": "实验报告",\r\n "save": "保存",\r\n "purpose": "实验目的",\r\n "savestep": "保存并提交",\r\n "name": "实验名称",\r\n "completion": "完成情况",\r\n "undone": "未完成原因",\r\n "content": "报告内容",\r\n "report": "报告",\r\n "remotely": "远程协助",\r\n "monitor": "实验监控",\r\n "scrapbooking": "剪贴板",\r\n "uploadFiles": "上传文件",\r\n "timeCost": "实验用时:",\r\n "docmarkdown": "文档",\r\n "question": "问答",\r\n "notes": "笔记",\r\n "evaluation": "评价",\r\n "fraction": "给实验打分",\r\n "publish": "发表",\r\n "viewtype": "显示方式",\r\n "contitle": "实验桌面标题",\r\n "course_step_evaluate": "实验评价",\r\n "close_vm": "实验环境尚未启动,无法上传/下载文件",\r\n "send_comment": "发表",\r\n "grade": "给实验评分",\r\n "create": "开始",\r\n "saveexp": "保存实验",\r\n "lookrecover": "恢复实验",\r\n "clipboard": "剪贴板",\r\n "editormd_show_title": "显示文档",\r\n "delay": "延时",\r\n "close": "关闭",\r\n "help": "请求协助",\r\n "unhelp": "取消协助",\r\n "assist": "协助",\r\n "creatingvm": "正在创建实验环境",\r\n "ladingvmerror": "加载实验环境失败,请点击刷新按钮或等待10秒重新加载",\r\n "RDP": "桌面版",\r\n "SSH": "命令行版",\r\n "waiting": "实验环境正在准备中",\r\n "creating": "准备中",\r\n "refresh": "刷新",\r\n "click": "点击创建加载环境...",\r\n "remain_time": "剩余时间",\r\n "hour": "时",\r\n "minute": "分",\r\n "second": "秒",\r\n "accept_assist": "对方已接受协助请求",\r\n "reject_assist": "对方拒绝了协助请求",\r\n "study_timeout": "学习时间已结束,实验环境已经删除。如果继续学习,请重新创建",\r\n "Warning": "温馨提示",\r\n "cannot_load": "加载实验环境失败,请重试",\r\n "operation_unsupported": "不支持此操作",\r\n "internal_error": "发生了内部错误,无法执行操作。",\r\n "vm_used_locked": "实验环境已经在使用或锁定,请刷新控制台页面",\r\n "vm_closed": "实验环境已经关闭,请重新创建",\r\n "vm_busy": "实验环境忙,需要首先释放连接,然后重试或尝试刷新操作",\r\n "vm_connect_use": "控制台已经被另一个连接使用,请先关闭该连接,或者刷新控制台页面。",\r\n "vm_authorized_fail": "授权失败,请联系管理员或尝试刷新操作",\r\n "vm_many_resources": "您已经使用了太多的资源,请关闭一些正在使用的实验环境或尝试刷新操作",\r\n "noselectText": "请先选中页面中的文本内容",\r\n "evaluate_tip": "还可以输入<span>{0}</span>字",\r\n "cancel": "取消",\r\n "material": "随材",\r\n "video":"视频",\r\n "op_type": "协助方式",\r\n "read": "观看",\r\n "write": "控制",\r\n "code": "代码",\r\n "file": "文件",\r\n "fullscreen": "全屏",\r\n "exitfullscreen": "退出全屏",\r\n "closing": "关闭中",\r\n "exception": "报告异常",\r\n "vpn_exchange": "vpn连接",\r\n "vm_name": "主机名",\r\n "interacts": "实验",\r\n "extension": "扩展功能",\r\n "vpn_conn": "连接",\r\n "vpn_view": "查看连接",\r\n "forced_close":"强制关机"\r\n }\r\n }\r\n}\r\n'}),define("cookie/cookie",[],function(){return function(e,t,i,n){if("string"==typeof e&&(n=i,i=t,t=e,e=window),void 0===i)return i=e.document.cookie.match(new RegExp("(?:\\s|^)"+t+"\\=([^;]*)")),i?decodeURIComponent(i[1]):null;n=n||{};var r,a="";n.expires&&(n.expires.constructor===Date?r=n.expires:(r=new Date,r.setTime(r.getTime()+24*n.expires*60*60*1e3)),a="; expires="+r.toGMTString());var o=n.path?"; path="+n.path:"",s=n.domain?"; domain="+n.domain:"",l=n.secure?"; secure":"";e.document.cookie=[t,"=",encodeURIComponent(i),a,o,s,l].join("")}}),define("cookie",function(){});var WebUtil={},$D;if(window.$D||(window.$D=function(e){return document.getElementById?document.getElementById(e):document.all?document.all[e]:document.layers?document.layers[e]:void 0}),WebUtil.init_logging=function(e){"use strict";if(void 0!==e)Util._log_level=e;else{var t=document.location.href.match(/logging=([A-Za-z0-9\._\-]*)/);Util._log_level=(t||["",Util._log_level])[1]}Util.init_logging()},WebUtil.dirObj=function(e,t,i){"use strict";t||(t=2),i||(i="");var n="";for(var r in e)if(t>1&&"object"==typeof e[r])n+=WebUtil.dirObj(e[r],t-1,i+"."+r);else{var a="";a=void 0===e[r]?"undefined":e[r].toString().replace("\n"," "),a.length>30&&(a=a.substr(0,30)+"..."),n+=i+"."+r+": "+a+"\n"}return n},WebUtil.getQueryVar=function(e,t){"use strict";var i=new RegExp(".*[?&]"+e+"=([^&#]*)"),n=document.location.href.match(i);return void 0===t&&(t=null),n?decodeURIComponent(n[1]):t},WebUtil.getHashVar=function(e,t){"use strict";var i=new RegExp(".*[&#]"+e+"=([^&]*)"),n=document.location.hash.match(i);return void 0===t&&(t=null),n?decodeURIComponent(n[1]):t},WebUtil.getConfigVar=function(e,t){"use strict";var i=WebUtil.getHashVar(e);return null===i&&(i=WebUtil.getQueryVar(e,t)),i},WebUtil.createCookie=function(e,t,i){"use strict";var n,r;i?(n=new Date,n.setTime(n.getTime()+24*i*60*60*1e3),r="; expires="+n.toGMTString()):r="";var a;a="https:"===document.location.protocol?"; secure":"",document.cookie=e+"="+t+r+"; path=/"+a},WebUtil.readCookie=function(e,t){"use strict";for(var i=e+"=",n=document.cookie.split(";"),r=0;r<n.length;r+=1){for(var a=n[r];" "===a.charAt(0);)a=a.substring(1,a.length);if(0===a.indexOf(i))return a.substring(i.length,a.length)}return void 0!==t?t:null},WebUtil.eraseCookie=function(e){"use strict";WebUtil.createCookie(e,"",-1)},WebUtil.initSettings=function(e){"use strict";var t=Array.prototype.slice.call(arguments,1);window.chrome&&window.chrome.storage?window.chrome.storage.sync.get(function(i){WebUtil.settings=i,console.log(WebUtil.settings),e&&e.apply(this,t)}):e&&e.apply(this,t)},WebUtil.writeSetting=function(e,t){"use strict";window.chrome&&window.chrome.storage?WebUtil.settings[e]!==t&&(WebUtil.settings[e]=t,window.chrome.storage.sync.set(WebUtil.settings)):localStorage.setItem(e,t)},WebUtil.readSetting=function(e,t){"use strict";var i;return i=window.chrome&&window.chrome.storage?WebUtil.settings[e]:localStorage.getItem(e),void 0===i&&(i=null),null===i&&void 0!==typeof t?t:i},WebUtil.eraseSetting=function(e){"use strict";window.chrome&&window.chrome.storage?(window.chrome.storage.sync.remove(e),delete WebUtil.settings[e]):localStorage.removeItem(e)},WebUtil.getStylesheets=function(){"use strict";for(var e=document.getElementsByTagName("link"),t=[],i=0;i<e.length;i+=1)e[i].title&&e[i].rel.toUpperCase().indexOf("STYLESHEET")>-1&&t.push(e[i]);return t},WebUtil.selectStylesheet=function(e){"use strict";void 0===e&&(e="default");for(var t=WebUtil.getStylesheets(),i=0;i<t.length;i+=1){var n=t[i];n.title===e?(Util.Debug("Using stylesheet "+e),n.disabled=!1):n.disabled=!0}return e},WebUtil.injectParamIfMissing=function(e,t,i){e="/"+e;var n=document.createElement("a");n.href=e;var r,a=encodeURIComponent(t)+"=";return r=n.search?n.search.slice(1).split("&"):[],r.some(function(e){return e.startsWith(a)})||(r.push(a+encodeURIComponent(i)),n.search="?"+r.join("&")),"/"==n.pathname.charAt(0)?n.pathname.slice(1)+n.search+n.hash:n.pathname+n.search+n.hash},define("webutil",function(){}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("videojs",t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojs=t()}(this,function(){"use strict";function e(e,t){return e(t={exports:{}},t.exports),t.exports}function t(e,t){Ca(e).forEach(function(i){return t(e[i],i)})}function i(e){for(var i=arguments.length,n=new Array(1<i?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return Object.assign?xa.apply(void 0,[e].concat(n)):(n.forEach(function(i){i&&t(i,function(t,i){e[i]=t})}),e)}function n(e){return!!e&&"object"==typeof e}function r(e){return n(e)&&"[object Object]"===ka.call(e)&&e.constructor===Object}function a(e,t){if(!e||!t)return"";if("function"!=typeof la.getComputedStyle)return"";var i;try{i=la.getComputedStyle(e)}catch(e){return""}return i?i.getPropertyValue(t)||i[t]:""}function o(e){return"string"==typeof e&&Boolean(e.trim())}function s(e){if(0<=e.indexOf(" "))throw new Error("class has illegal whitespace characters")}function l(){return da===la.document}function c(e){return n(e)&&1===e.nodeType}function u(){try{return la.parent!==la.self}catch(e){return!0}}function d(e){return function(t,i){return o(t)?(i=c(i=o(i)?da.querySelector(i):i)?i:da,i[e]&&i[e](t)):da[e](null)}}function h(e,t,i,n){void 0===t&&(t={}),void 0===i&&(i={});var r=da.createElement(e=void 0===e?"div":e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(ba.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?p(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){r.setAttribute(e,i[e])}),n&&L(r,n),r}function p(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function f(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function m(e,t){return s(t),e.classList?e.classList.contains(t):new RegExp("(^|\\s)"+t+"($|\\s)").test(e.className)}function g(e,t){return e.classList?e.classList.add(t):m(e,t)||(e.className=(e.className+" "+t).trim()),e}function v(e,t){return e?(e.classList?e.classList.remove(t):(s(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e):(ba.warn("removeClass was called with an element that doesn't exist"),null)}function y(e,t,i){var n=m(e,t);if((i="boolean"!=typeof(i="function"==typeof i?i(e,t):i)?!n:i)!==n)return(i?g:v)(e,t),e}function _(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var n=t[i];null===n||void 0===n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)})}function b(e){var t={};if(e&&e.attributes&&0<e.attributes.length)for(var i=e.attributes,n=i.length-1;0<=n;n--){var r=i[n].name,a=i[n].value;"boolean"!=typeof e[r]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+",")||(a=null!==a),t[r]=a}return t}function w(e,t){return e.getAttribute(t)}function x(e,t,i){e.setAttribute(t,i)}function k(e,t){e.removeAttribute(t)}function C(){da.body.focus(),da.onselectstart=function(){return!1}}function T(){da.onselectstart=function(){return!0}}function S(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(a(e,"height"))),i.width||(i.width=parseFloat(a(e,"width"))),i}}function E(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;e.offsetParent&&e!==da[ha.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function A(e,t){var i={x:0,y:0};if(qa)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var r,o=a(n,"transform");/^matrix/.test(o)?(r=o.slice(7,-1).split(/,\s/).map(Number),i.x+=r[4],i.y+=r[5]):/^matrix3d/.test(o)&&(o=o.slice(9,-1).split(/,\s/).map(Number),i.x+=o[12],i.y+=o[13]),n=n.parentNode}var s={},l=E(t.target),c=E(e),u=c.width,d=c.height,e=t.offsetY-(c.top-l.top),l=t.offsetX-(c.left-l.left);return t.changedTouches&&(l=t.changedTouches[0].pageX-c.left,e=t.changedTouches[0].pageY+c.top,qa&&(l-=i.x,e-=i.y)),s.y=1-Math.max(0,Math.min(1,e/d)),s.x=Math.max(0,Math.min(1,l/u)),s}function I(e){return n(e)&&3===e.nodeType}function D(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function M(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return c(e="function"==typeof e?e():e)||I(e)?e:"string"==typeof e&&/\S/.test(e)?da.createTextNode(e):void 0}).filter(function(e){return e})}function L(e,t){return M(t).forEach(function(t){return e.appendChild(t)}),e}function O(e,t){return L(D(e),t)}function N(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}function P(e,t){l()&&(t&&(va=t),la.setTimeout(Xa,e))}function R(){Ka=!0,la.removeEventListener("load",R)}function j(e){var t=da.createElement("style");return t.className=e,t}function z(e,t){e.styleSheet?e.styleSheet.cssText=t:e.textContent=t}function F(e,t){var i;eo.has(e)&&(0===(i=eo.get(e)).handlers[t].length&&(delete i.handlers[t],e.removeEventListener?e.removeEventListener(t,i.dispatcher,!1):e.detachEvent&&e.detachEvent("on"+t,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&eo.delete(e))}function B(e,t,i,n){i.forEach(function(i){e(t,i,n)})}function U(e){function t(){return!0}function i(){return!1}if(e.fixed_)return e;if(!e||!e.isPropagationStopped||!e.isImmediatePropagationStopped){var n,r,a,o=e||la.event;for(n in e={},o)"layerX"!==n&&"layerY"!==n&&"keyLocation"!==n&&"webkitMovementX"!==n&&"webkitMovementY"!==n&&("returnValue"===n&&o.preventDefault||(e[n]=o[n]));e.target||(e.target=e.srcElement||da),e.relatedTarget||(e.relatedTarget=e.fromElement===e.target?e.toElement:e.fromElement),e.preventDefault=function(){o.preventDefault&&o.preventDefault(),e.returnValue=!1,o.returnValue=!1,e.defaultPrevented=!0},e.defaultPrevented=!1,e.stopPropagation=function(){o.stopPropagation&&o.stopPropagation(),e.cancelBubble=!0,o.cancelBubble=!0,e.isPropagationStopped=t},e.isPropagationStopped=i,e.stopImmediatePropagation=function(){o.stopImmediatePropagation&&o.stopImmediatePropagation(),e.isImmediatePropagationStopped=t,e.stopPropagation()},e.isImmediatePropagationStopped=i,null!==e.clientX&&void 0!==e.clientX&&(r=da.documentElement,a=da.body,e.pageX=e.clientX+(r&&r.scrollLeft||a&&a.scrollLeft||0)-(r&&r.clientLeft||a&&a.clientLeft||0),e.pageY=e.clientY+(r&&r.scrollTop||a&&a.scrollTop||0)-(r&&r.clientTop||a&&a.clientTop||0)),e.which=e.charCode||e.keyCode,null!==e.button&&void 0!==e.button&&(e.button=1&e.button?0:4&e.button?1:2&e.button?2:0)}return e.fixed_=!0,e}function $(e,t,i){if(Array.isArray(t))return B($,e,t,i);eo.has(e)||eo.set(e,{});var n=eo.get(e);n.handlers||(n.handlers={}),n.handlers[t]||(n.handlers[t]=[]),i.guid||(i.guid=Qa++),n.handlers[t].push(i),n.dispatcher||(n.disabled=!1,n.dispatcher=function(t,i){if(!n.disabled){t=U(t);var r=n.handlers[t.type];if(r)for(var a=r.slice(0),o=0,s=a.length;o<s&&!t.isImmediatePropagationStopped();o++)try{a[o].call(e,t,i)}catch(t){ba.error(t)}}}),1===n.handlers[t].length&&(e.addEventListener?(i=!1,to()&&-1<io.indexOf(t)&&(i={passive:!0}),e.addEventListener(t,n.dispatcher,i)):e.attachEvent&&e.attachEvent("on"+t,n.dispatcher))}function q(e,t,i){if(eo.has(e)){var n=eo.get(e);if(n.handlers){if(Array.isArray(t))return B(q,e,t,i);var r=function(e,t){n.handlers[t]=[],F(e,t)};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var o=0;o<a.length;o++)a[o].guid===i.guid&&a.splice(o--,1);F(e,t)}else r(e,t)}else for(var s in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},s)&&r(e,s)}}}function H(e,t,i){var n=eo.has(e)?eo.get(e):{},r=e.parentNode||e.ownerDocument;return"string"==typeof t?t={type:t,target:e}:t.target||(t.target=e),t=U(t),n.dispatcher&&n.dispatcher.call(e,t,i),r&&!t.isPropagationStopped()&&!0===t.bubbles?H.call(null,r,t,i):!r&&!t.defaultPrevented&&t.target&&t.target[t.type]&&(eo.has(t.target)||eo.set(t.target,{}),r=eo.get(t.target),t.target[t.type]&&(r.disabled=!0,"function"==typeof t.target[t.type]&&t.target[t.type](),r.disabled=!1)),!t.defaultPrevented}function W(e,t,i){function n(){q(e,t,n),i.apply(this,arguments)}if(Array.isArray(t))return B(W,e,t,i);n.guid=i.guid=i.guid||Qa++,$(e,t,n)}function V(e,t,i){function n(){q(e,t,n),i.apply(this,arguments)}n.guid=i.guid=i.guid||Qa++,$(e,t,n)}function G(e,t,i){return t.guid||(t.guid=Qa++),(e=t.bind(e)).guid=i?i+"_"+t.guid:t.guid,e}function Y(e,t){var i=la.performance.now();return function(){var n=la.performance.now();t<=n-i&&(e.apply(void 0,arguments),i=n)}}function K(e,t,i,n){function r(){var r=this,o=arguments,s=function(){s=a=null,i||e.apply(r,o)};!a&&i&&e.apply(r,o),n.clearTimeout(a),a=n.setTimeout(s,t)}var a;return void 0===n&&(n=la),r.cancel=function(){n.clearTimeout(a),a=null},r}function X(){}function Q(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_||(e.constructor&&e.constructor.name?e.constructor.name:typeof e)}function Z(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length}function J(e,t,i){if(!e||!e.nodeName&&!ro(e))throw new Error("Invalid target for "+Q(t)+"#"+i+"; must be a DOM node or evented object.")}function ee(e,t,i){if(!Z(e))throw new Error("Invalid event type for "+Q(t)+"#"+i+"; must be a non-empty string or array.")}function te(e,t,i){if("function"!=typeof e)throw new Error("Invalid listener for "+Q(t)+"#"+i+"; must be a function.")}function ie(e,t,i){var n,r,a=t.length<3||t[0]===e||t[0]===e.eventBusEl_,t=a?(n=e.eventBusEl_,3<=t.length&&t.shift(),r=t[0],t[1]):(n=t[0],r=t[1],t[2]);return J(n,e,i),ee(r,e,i),te(t,e,i),{isTargetingSelf:a,target:n,type:r,listener:t=G(e,t)}}function ne(e,t,i,n){J(e,e,t),e.nodeName?no[t](e,i,n):e[t](i,n)}function re(e,t){if(t=(t=void 0===t?{}:t).eventBusKey){if(!e[t].nodeName)throw new Error('The eventBusKey "'+t+'" does not refer to an element.');e.eventBusEl_=e[t]}else e.eventBusEl_=h("span",{className:"vjs-event-bus"});return i(e,ao),e.eventedCallbacks&&e.eventedCallbacks.forEach(function(e){e()}),
|
||
e.on("dispose",function(){e.off(),la.setTimeout(function(){e.eventBusEl_=null},0)}),e}function ae(e,t){return i(e,oo),e.state=i({},e.state,t),"function"==typeof e.handleStateChanged&&ro(e)&&e.on("statechanged",e.handleStateChanged),e}function oe(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toLowerCase()})}function se(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase()})}function le(){for(var e={},i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];return n.forEach(function(i){i&&t(i,function(t,i){r(t)?(r(e[i])||(e[i]={}),e[i]=le(e[i],t)):e[i]=t})}),e}function ce(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||i<t)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function ue(e){return void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:ce.bind(null,"start",0,e),end:ce.bind(null,"end",1,e)}}function de(e,t){return Array.isArray(e)?ue(e):void 0===e||void 0===t?ue():ue([[e,t]])}function he(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=de(0,0));for(var a=0;a<e.length;a++)i=e.start(a),r+=(n=t<(n=e.end(a))?t:n)-i;return r/t}function pe(e){if(e instanceof pe)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:n(e)&&("number"==typeof e.code&&(this.code=e.code),i(this,e)),this.message||(this.message=pe.defaultMessages[this.code]||"")}function fe(e){return null!=e&&"function"==typeof e.then}function me(e){fe(e)&&e.then(null,function(e){})}function ge(e){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(t,i,n){return e[i]&&(t[i]=e[i]),t},{cues:e.cues&&Array.prototype.map.call(e.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})})}function ve(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].enabled=!1)}function ye(e,t){for(var i=0;i<e.length;i++)Object.keys(e[i]).length&&t.id!==e[i].id&&(e[i].selected=!1)}function _e(e){var t=["protocol","hostname","port","pathname","search","hash","host"],i=da.createElement("a");i.href=e;for(var n={},r=0;r<t.length;r++)n[t[r]]=i[t[r]];return"http:"===n.protocol&&(n.host=n.host.replace(/:80$/,"")),"https:"===n.protocol&&(n.host=n.host.replace(/:443$/,"")),n.protocol||(n.protocol=la.location.protocol),n.host||(n.host=la.location.host),n}function be(e){var t;return e.match(/^https?:\/\//)||((t=da.createElement("a")).href=e,e=t.href),e}function we(e){return"string"==typeof e&&(e=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e))?e.pop().toLowerCase():""}function xe(e,t){return void 0===t&&(t=la.location),(":"===(e=_e(e)).protocol?t:e).protocol+e.host!==t.protocol+t.host}function ke(e,t,i){var n=e;return Io(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=xa({},t,{uri:e}),n.callback=i,n}function Ce(e,t,i){return Te(t=ke(e,t,i))}function Te(e){function t(){var e=void 0,e=c.response||c.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(c);if(m)try{e=JSON.parse(e)}catch(e){}return e}function i(e){return clearTimeout(o),(e=e instanceof Error?e:new Error(""+(e||"Unknown XMLHttpRequest Error"))).statusCode=0,l(e,g)}function n(){if(!a){clearTimeout(o);var i=e.useXDR&&void 0===c.status?200:1223===c.status?204:c.status,n=g,r=null;return 0!==i?(n={body:t(),statusCode:i,method:d,headers:{},url:u,rawRequest:c},c.getAllResponseHeaders&&(n.headers=Mo(c.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),l(r,n,n.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var r,a,o,s=!1,l=function(t,i,n){s||(s=!0,e.callback(t,i,n))},c=e.xhr||null,u=(c=c||new(e.cors||e.useXDR?Ce.XDomainRequest:Ce.XMLHttpRequest)).url=e.uri||e.url,d=c.method=e.method||"GET",h=e.body||e.data,p=c.headers=e.headers||{},f=!!e.sync,m=!1,g={body:void 0,headers:{},statusCode:0,method:d,url:u,rawRequest:c};if("json"in e&&!1!==e.json&&(m=!0,p.accept||p.Accept||(p.Accept="application/json"),"GET"!==d&&"HEAD"!==d&&(p["content-type"]||p["Content-Type"]||(p["Content-Type"]="application/json"),h=JSON.stringify(!0===e.json?h:e.json))),c.onreadystatechange=function(){4===c.readyState&&setTimeout(n,0)},c.onload=n,c.onerror=i,c.onprogress=function(){},c.onabort=function(){a=!0},c.ontimeout=i,c.open(d,u,!f,e.username,e.password),f||(c.withCredentials=!!e.withCredentials),!f&&0<e.timeout&&(o=setTimeout(function(){var e;a||(a=!0,c.abort("timeout"),(e=new Error("XMLHttpRequest timeout")).code="ETIMEDOUT",i(e))},e.timeout)),c.setRequestHeader)for(r in p)p.hasOwnProperty(r)&&c.setRequestHeader(r,p[r]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return;return 1}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(c.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(c),c.send(h||null),c}function Se(e,t){var i=new la.WebVTT.Parser(la,la.vttjs,la.WebVTT.StringDecoder()),n=[];i.oncue=function(e){t.addCue(e)},i.onparsingerror=function(e){n.push(e)},i.onflush=function(){t.trigger({type:"loadeddata",target:t})},i.parse(e),0<n.length&&(la.console&&la.console.groupCollapsed&&la.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(function(e){return ba.error(e)}),la.console&&la.console.groupEnd&&la.console.groupEnd()),i.flush()}function Ee(e,t){var i={uri:e};(e=xe(e))&&(i.cors=e),(e="use-credentials"===t.tech_.crossOrigin())&&(i.withCredentials=e),Lo(i,G(this,function(e,i,n){return e?ba.error(e,i):(t.loaded_=!0,void("function"!=typeof la.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(e){return"vttjserror"!==e.type?Se(n,t):void ba.error("vttjs failed to load, stopping trying to process "+t.src)}):Se(n,t)))}))}function Ae(){}function Ie(e,t){this.name="ParsingError",this.code=e.code,this.message=t||e.message}function De(e){function t(e,t,i,n){return 3600*(0|e)+60*(0|t)+(0|i)+(0|n)/1e3}return e=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/),e?e[3]?t(e[1],e[2],e[3].replace(":",""),e[4]):59<e[1]?t(e[1],e[2],0,e[4]):t(0,e[1],e[2],e[4]):null}function Me(){this.values=Fo(null)}function Le(e,t,i,n){var r,a,o=n?e.split(n):[e];for(r in o)"string"==typeof o[r]&&2===(a=o[r].split(i)).length&&t(a[0],a[1])}function Oe(e,t,i){function n(){var t=De(e);if(null===t)throw new Ie(Ie.Errors.BadTimeStamp,"Malformed timestamp: "+a);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function r(){e=e.replace(/^\s+/,"")}var a=e;if(r(),t.startTime=n(),r(),"--\x3e"!==e.substr(0,3))throw new Ie(Ie.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);e=e.substr(3),r(),t.endTime=n(),r(),function(e,t){var n=new Me;Le(e,function(e,t){switch(e){case"region":for(var r=i.length-1;0<=r;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),o=a[0];n.integer(e,o),n.percent(e,o)&&n.set("snapToLines",!1),n.alt(e,o,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}function Ne(e,t){for(var i,n,r,a,o,s,l,c,u,d,h=e.document.createElement("div"),p=h,f=[];null!==(i=function(){if(!t)return null;var e=t.match(/^([^<]*)(<[^>]*>?)?/);return e=e[1]||e[2],t=t.substr(e.length),e}());)"<"!==i[0]?p.appendChild(e.document.createTextNode((o=i,Bo.innerHTML=o,o=Bo.textContent,Bo.textContent="",o))):"/"!==i[1]?(a=De(i.substr(1,i.length-2)))?(n=e.document.createProcessingInstruction("timestamp",a),p.appendChild(n)):(r=i.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/))&&(c=r[1],u=r[3],d=void 0,d=Uo[c],(n=d?(d=e.document.createElement(d),(c=qo[c])&&u&&(d[c]=u.trim()),d):null)&&(s=p,Ho[(l=n).localName]&&Ho[l.localName]!==s.localName||(r[2]&&((a=r[2].split(".")).forEach(function(e){var t=/^bg_/.test(e),e=t?e.slice(3):e;$o.hasOwnProperty(e)&&(e=$o[e],n.style[t?"background-color":"color"]=e)}),n.className=a.join(" ")),f.push(r[1]),p.appendChild(n),p=n))):f.length&&f[f.length-1]===i.substr(2).replace(">","")&&(f.pop(),p=p.parentNode);return h}function Pe(e){function t(e,t){for(var i=t.childNodes.length-1;0<=i;i--)e.push(t.childNodes[i])}var i=[],n="";if(!e||!e.childNodes)return"ltr";for(t(i,e);n=function e(i){if(!i||!i.length)return null;var n=i.pop(),r=n.textContent||n.innerText;if(r){var a=r.match(/^.*(\n|\r)/);return a?a[i.length=0]:r}return"ruby"===n.tagName?e(i):n.childNodes?(t(i,n),e(i)):void 0}(i);)for(var r=0;r<n.length;r++)if(function(e){for(var t=0;t<Wo.length;t++){var i=Wo[t];if(e>=i[0]&&e<=i[1])return 1}}(n.charCodeAt(r)))return"rtl";return"ltr"}function Re(){}function je(e,t,i){Re.call(this),this.cue=t,this.cueDiv=Ne(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:Pe(this.cueDiv),writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===t.align?"center":t.align,font:i.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(n),this.div.appendChild(this.cueDiv);var r=0;switch(t.positionAlign){case"start":r=t.position;break;case"center":r=t.position-t.size/2;break;case"end":r=t.position-t.size}""===t.vertical?this.applyStyles({left:this.formatStyle(r,"%"),width:this.formatStyle(t.size,"%")}):this.applyStyles({top:this.formatStyle(r,"%"),height:this.formatStyle(t.size,"%")}),this.move=function(e){this.applyStyles({top:this.formatStyle(e.top,"px"),bottom:this.formatStyle(e.bottom,"px"),left:this.formatStyle(e.left,"px"),right:this.formatStyle(e.right,"px"),height:this.formatStyle(e.height,"px"),width:this.formatStyle(e.width,"px")})}}function ze(e){var t,i,n,r;e.div&&(t=e.div.offsetHeight,i=e.div.offsetWidth,n=e.div.offsetTop,r=(r=e.div.childNodes)&&(r=r[0])&&r.getClientRects&&r.getClientRects(),e=e.div.getBoundingClientRect(),r=r?Math.max(r[0]&&r[0].height||0,e.height/r.length):0),this.left=e.left,this.right=e.right,this.top=e.top||n,this.height=e.height||t,this.bottom=e.bottom||n+(e.height||t),this.width=e.width||i,this.lineHeight=void 0!==r?r:e.lineHeight}function Fe(e,t,i,n){var r,a=new ze(t),o=t.cue,s=function(e){if("number"==typeof e.line&&(e.snapToLines||0<=e.line&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;r<i.length&&i[r]!==t;r++)"showing"===i[r].mode&&n++;return-1*++n}(o),l=[];if(o.snapToLines){switch(o.vertical){case"":l=["+y","-y"],r="height";break;case"rl":l=["+x","-x"],r="width";break;case"lr":l=["-x","+x"],r="width"}var c=a.lineHeight,u=c*Math.round(s),d=i[r]+c,h=l[0];Math.abs(u)>d&&(u=u<0?-1:1,u*=Math.ceil(d/c)*c),s<0&&(u+=""===o.vertical?i.height:i.width,l=l.reverse()),a.move(h,u)}else{var p=a.lineHeight/i.height*100;switch(o.lineAlign){case"center":s-=p/2;break;case"end":s-=p}switch(o.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}l=["+y","-x","+x","-y"],a=new ze(t)}a=function(e,t){for(var r,a=new ze(e),o=1,s=0;s<t.length;s++){for(;e.overlapsOppositeAxis(i,t[s])||e.within(i)&&e.overlapsAny(n);)e.move(t[s]);if(e.within(i))return e;var l=e.intersectPercentage(i);l<o&&(r=new ze(e),o=l),e=new ze(a)}return r||a}(a,l),t.move(a.toCSSCompatValues(i))}function Be(){}function Ue(e){return"string"==typeof e&&!!Yo[e.toLowerCase()]&&e.toLowerCase()}function $e(e,t,i){this.hasBeenReset=!1;var n="",r=!1,a=e,o=t,s=i,l=null,c="",u=!0,d="auto",h="start",p="auto",f="auto",m=100,g="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(e){n=""+e}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(e){r=!!e}},startTime:{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");a=e,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");o=e,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return s},set:function(e){s=""+e,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(e){l=e,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return c},set:function(e){if(!1===(e="string"==typeof(e=e)&&!!Go[e.toLowerCase()]&&e.toLowerCase()))throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");c=e,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return u},set:function(e){u=!!e,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return d},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("Line: an invalid number or illegal string was specified.");d=e,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return h},set:function(e){(e=Ue(e))&&(h=e,this.hasBeenReset=!0)}},position:{enumerable:!0,get:function(){return p},set:function(e){if(e<0||100<e)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){(e=Ue(e))&&(f=e,this.hasBeenReset=!0)}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||100<e)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){if(!(e=Ue(e)))throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=e,this.hasBeenReset=!0}}}),this.displayState=void 0}function qe(e){return"number"==typeof e&&0<=e&&e<=100}function He(){var e=100,t=3,i=0,n=100,r=0,a=100,o="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!qe(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!qe(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!qe(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!qe(e))throw new Error("ViewportAnchorY must be between 0 and 100.");a=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!qe(e))throw new Error("ViewportAnchorX must be between 0 and 100.");r=e}},scroll:{enumerable:!0,get:function(){return o},set:function(e){!1===(e="string"==typeof(e=e)&&!!Xo[e.toLowerCase()]&&e.toLowerCase())||(o=e)}}})}function We(e,t,n){e.setTimeout(function(){return function e(t,n,r,a,o,s){void 0===t&&(t={}),void 0===n&&(n=[]),void 0===o&&(o=[]),void 0===s&&(s=!1);var l=n,n=l[0],c=l.slice(1);if("string"==typeof n)e(t,Jo[n],r,a,o,s);else if(n){var u=Ye(a,n);if(!u.setSource)return o.push(u),e(t,c,r,a,o,s);u.setSource(i({},t),function(i,n){return i?e(t,c,r,a,o,s):(o.push(u),void e(n,t.type===n.type?c:Jo[n.type],r,a,o,s))})}else c.length?e(t,c,r,a,o,s):s?r(t,o):e(t,Jo["*"],r,a,o,!0)}(t,Jo[t.type],n,e)},1)}function Ve(e,t,i,n){void 0===n&&(n=null);var r="call"+se(i),r=e.reduce(Ge(r),n),n=r===ts,r=n?null:t[i](r);return function(e,t,i,n){for(var r=e.length-1;0<=r;r--){var a=e[r];a[t]&&a[t](n,i)}}(e,i,r,n),r}function Ge(e){return function(t,i){return t===ts?ts:i[e]?i[e](t):t}}function Ye(e,t){var i=es[e.id()],n=null;if(null==i)return n=t(e),es[e.id()]=[[t,n]],n;for(var r=0;r<i.length;r++){var a=i[r],o=a[0],a=a[1];o===t&&(n=a)}return null===n&&(n=t(e),i.push([t,n])),n}function Ke(e){return e=we(e=void 0===e?"":e),as[e.toLowerCase()]||""}function Xe(e){var t;return e=Array.isArray(e)?(t=[],e.forEach(function(e){e=Xe(e),Array.isArray(e)?t=t.concat(e):n(e)&&t.push(e)}),t):"string"==typeof e&&e.trim()?[Qe({src:e})]:n(e)&&"string"==typeof e.src&&e.src&&e.src.trim()?[Qe(e)]:[]}function Qe(e){var t;return e.type||(t=Ke(e.src))&&(e.type=t),e}function Ze(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function Je(e,t,i){try{e.style[t]=i}catch(e){return}}function et(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),t=Math.floor(t/3600);return(r=0<(r=isNaN(e)||e===1/0?n=i="-":r)||0<t?r+":":"")+(n=((r||10<=a)&&n<10?"0"+n:n)+":")+(i=i<10?"0"+i:i)}function tt(e,t){return us(e,t=void 0===t?e:t)}function it(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))}function nt(e,t){return it(e/t*100,0,100).toFixed(2)+"%"}function rt(e,t){if((e=t?t(e):e)&&"none"!==e)return e}function at(e){if((n=e.el()).hasAttribute("src"))return e.triggerSourceset(n.src),1;var t=e.$$("source"),i=[],n="";if(t.length){for(var r=0;r<t.length;r++){var a=t[r].src;a&&-1===i.indexOf(a)&&i.push(a)}return!!i.length&&(1===i.length&&(n=i[0]),e.triggerSourceset(n),!0)}}function ot(e,t){for(var i={},n=0;n<e.length&&!((i=Object.getOwnPropertyDescriptor(e[n],t))&&i.set&&i.get);n++);return i.enumerable=!0,i.configurable=!0,i}function st(e){var t,i,n,r=e.el();r.resetSourceWatch_||(t={},i=ot([e.el(),la.HTMLMediaElement.prototype,la.Element.prototype,Cs],"innerHTML"),n=function(t){return function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];var o=t.apply(r,n);return at(e),o}},["append","appendChild","insertAdjacentHTML"].forEach(function(e){r[e]&&(t[e]=r[e],r[e]=n(t[e]))}),Object.defineProperty(r,"innerHTML",le(i,{set:n(i.set)})),r.resetSourceWatch_=function(){r.resetSourceWatch_=null,Object.keys(t).forEach(function(e){r[e]=t[e]}),Object.defineProperty(r,"innerHTML",i)},e.one("sourceset",r.resetSourceWatch_))}function lt(e){var t,i,n,r;e.featuresSourceset&&((t=e.el()).resetSourceset_||(i=ot([e.el(),la.HTMLMediaElement.prototype,Ts],"src"),n=t.setAttribute,r=t.load,Object.defineProperty(t,"src",le(i,{set:function(n){return n=i.set.call(t,n),e.triggerSourceset(t.src),n}})),t.setAttribute=function(i,r){return r=n.call(t,i,r),/src/i.test(i)&&e.triggerSourceset(t.src),r},t.load=function(){var i=r.call(t);return at(e)||(e.triggerSourceset(""),st(e)),i},t.currentSrc?e.triggerSourceset(t.currentSrc):at(e)||st(e),t.resetSourceset_=function(){t.resetSourceset_=null,t.load=r,t.setAttribute=n,Object.defineProperty(t,"src",i),t.resetSourceWatch_&&t.resetSourceWatch_()}))}function ct(e,t,i,n){function r(i){return Object.defineProperty(e,t,{value:i,enumerable:!0,writable:!0})}var a={configurable:!0,enumerable:!0,get:function(){var e=i();return r(e),e}};return(n=void 0===n||n)&&(a.set=r),Object.defineProperty(e,t,a)}function ut(e){return zs.hasOwnProperty(e)}function dt(e){return ut(e)?zs[e]:void 0}function ht(e,t,i){i=(i?"before":"")+"pluginsetup",e.trigger(i,t),e.trigger(i+":"+t.name,t)}function pt(e,t){function i(){ht(this,{name:e,plugin:t,instance:null},!0);var i=t.apply(this,arguments);return Fs(this,e),ht(this,{name:e,plugin:t,instance:i}),i}return Object.keys(t).forEach(function(e){i[e]=t[e]}),i}function ft(e,t){return t.prototype.name=e,function(){ht(this,{name:e,plugin:t,instance:null},!0);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];var a=Ps(t,[this].concat(n));return this[e]=function(){return a},ht(this,a.getEventHash()),a}}function mt(e,t,i){if(a=mt.getPlayer(e))return t&&ba.warn('Player "'+e+'" is already initialised. Options will not be applied.'),i&&a.ready(i),a;var r="string"==typeof e?Va("#"+$s(e)):e;if(!c(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");r.ownerDocument.defaultView&&r.ownerDocument.body.contains(r)||ba.warn("The element supplied is not included in the DOM"),t=t||{},mt.hooks("beforesetup").forEach(function(e){e=e(r,le(t)),n(e)&&!Array.isArray(e)?t=le(t,e):ba.error("please return an object in beforesetup hooks")});var a=new(co.getComponent("Player"))(r,t,i);return mt.hooks("setup").forEach(function(e){return e(a)}),a}function gt(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=la.location&&la.location.href||"");var i="function"==typeof la.URL,n=/^\/\//.test(e),r=!la.location&&!/\/\//i.test(e);return i?e=new la.URL(e,la.location||Hs):/\/\//i.test(e)||(e=qs.buildAbsoluteURL(la.location&&la.location.href||"",e)),i?(i=new URL(t,e),r?i.href.slice(Hs.length):n?i.href.slice(i.protocol.length):i.href):qs.buildAbsoluteURL(e,t)}function vt(e){for(var t=Vs(e),i=new Uint8Array(t.length),n=0;n<t.length;n++)i[n]=t.charCodeAt(n);return i}function yt(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),e={};return t[1]&&(e.length=parseInt(t[1],10)),t[2]&&(e.offset=parseInt(t[2],10)),e}function _t(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n}function bt(e){var t={};return Object.keys(e).forEach(function(i){t[i.toLowerCase().replace(/-(\w)/g,function(e){return e[1].toUpperCase()})]=e[i]}),t}function wt(e){var t,i,n,r,a=e.serverControl,o=e.targetDuration,s=e.partTargetDuration;a&&(t="#EXT-X-SERVER-CONTROL",i="holdBack",n="partHoldBack",r=o&&3*o,e=s&&2*s,o&&!a.hasOwnProperty(i)&&(a[i]=r,this.trigger("info",{message:t+" defaulting HOLD-BACK to targetDuration * 3 ("+r+")."})),r&&a[i]<r&&(this.trigger("warn",{message:t+" clamping HOLD-BACK ("+a[i]+") to targetDuration * 3 ("+r+")"}),a[i]=r),s&&!a.hasOwnProperty(n)&&(a[n]=3*s,this.trigger("info",{message:t+" defaulting PART-HOLD-BACK to partTargetDuration * 3 ("+a[n]+")."})),s&&a[n]<e&&(this.trigger("warn",{message:t+" clamping PART-HOLD-BACK ("+a[n]+") to partTargetDuration * 2 ("+e+")."}),a[n]=e))}function xt(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){return"avc1."+("00"+Number(t).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})}function kt(e){var e=(e=void 0===e?"":e).split(","),t=[];return e.forEach(function(e){var i;e=e.trim(),Zs.forEach(function(n){var r,a=Qs[n].exec(e.toLowerCase());!a||a.length<=1||(i=n,r=e.substring(0,a[1].length),a=e.replace(r,""),t.push({type:r,details:a,mediaType:n}))}),i||t.push({type:e,details:"",mediaType:"unknown"})}),t}function Ct(e){return Qs.audio.test((e=void 0===e?"":e).trim().toLowerCase())}function Tt(e){if(e&&"string"==typeof e){var t=e.toLowerCase().split(",").map(function(e){return xt(e.trim())}),i="video";1===t.length&&Ct(t[0])?i="audio":1===t.length&&(n=t[0],Qs.text.test((n=void 0===n?"":n).trim().toLowerCase()))&&(i="application");var n="mp4";return t.every(function(e){return Qs.mp4.test(e)})?n="mp4":t.every(function(e){return Qs.webm.test(e)})?n="webm":t.every(function(e){return Qs.ogg.test(e)})&&(n="ogg"),i+"/"+n+';codecs="'+e+'"'}}function St(e){return void 0===e&&(e=""),la.MediaSource&&la.MediaSource.isTypeSupported&&la.MediaSource.isTypeSupported(Tt(e))||!1}function Et(e){return(e=void 0===e?"":e).toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;t<Js.length;t++)if(Qs["muxer"+Js[t]].test(e))return!0;return!1})}function At(e){return tl.test(e)?"hls":il.test(e)?"dash":"application/vnd.videojs.vhs+json"===e?"vhs-json":null}function It(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,It)}function Dt(){}function Mt(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function Lt(e,t,i){for(var n=e.tagName,r=null,a=e.length;a--;){var o=e[a],s=o.qName,l=o.value,s=0<(u=s.indexOf(":"))?(c=o.prefix=s.slice(0,u),d=s.slice(u+1),"xmlns"===c&&d):(c=null,"xmlns"===(d=s)&&"");o.localName=d,!1!==s&&(null==r&&(r={},Ot(i,i={})),i[s]=r[s]=l,o.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(s,l))}for(var c,a=e.length;a--;)(c=(o=e[a]).prefix)&&("xml"===c&&(o.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==c&&(o.uri=i[c||""]));var u,d=0<(u=n.indexOf(":"))?(c=e.prefix=n.slice(0,u),e.localName=n.slice(u+1)):(c=null,e.localName=n),h=e.uri=i[c||""];if(t.startElement(h,d,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,1;if(t.endElement(h,d,n),r)for(c in r)t.endPrefixMapping(c)}function Ot(e,t){for(var i in e)t[i]=e[i]}function Nt(){this.attributeNames={}}function Pt(e,t){for(var i in e)t[i]=e[i]}function Rt(e,t){var i,n=e.prototype;n instanceof t||((i=function(){}).prototype=t.prototype,Pt(n,i=new i),e.prototype=n=i),n.constructor!=e&&(n.constructor=e)}function jt(e,t){var i;return t instanceof Error?i=t:(i=this,Error.call(this,vl[e]),this.message=vl[e],Error.captureStackTrace&&Error.captureStackTrace(this,jt)),i.code=e,t&&(this.message=this.message+": "+t),i}function zt(){}function Ft(e,t){this._node=e,this._refresh=t,Bt(this)}function Bt(e){var t,i=e._node._inc||e._node.ownerDocument._inc;e._inc!=i&&(t=e._refresh(e._node),gi(e,"length",t.length),Pt(t,e),e._inc=i)}function Ut(){}function $t(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function qt(e,t,i,n){n?t[$t(t,n)]=i:t[t.length++]=i,!e||(t=(i.ownerElement=e).ownerDocument)&&(n&&Xt(t,e,n),e=e,i=i,(t=t)&&t._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&(e._nsMap[i.prefix?i.localName:""]=i.value))}function Ht(e,t,i){var n=$t(t,i);if(!(0<=n))throw jt(8,new Error(e.tagName+"@"+i));for(var r,a=t.length-1;n<a;)t[n]=t[++n];t.length=a,!e||(r=e.ownerDocument)&&(Xt(r,e,i),i.ownerElement=null)}function Wt(e){if(this._features={},e)for(var t in e)this._features=e[t]}function Vt(){}function Gt(e){return("<"==e?"<":">"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function Yt(e,t){if(t(e))return 1;if(e=e.firstChild)do{if(Yt(e,t))return 1}while(e=e.nextSibling)}function Kt(){}function Xt(e,t,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==i.namespaceURI&&delete t._nsMap[i.prefix?i.localName:""]}function Qt(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,a=0;r;)r=(n[a++]=r).nextSibling;n.length=a}}}function Zt(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,Qt(e.ownerDocument,e),t}function Jt(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===gl){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;for(n=i?i.previousSibling:e.lastChild,r.previousSibling=n,a.nextSibling=i,n?n.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;r.parentNode=e,r!==a&&(r=r.nextSibling););return Qt(e.ownerDocument||e,e),t.nodeType==gl&&(t.firstChild=t.lastChild=null),t}function ei(){this._nsMap={}}function ti(){}function ii(){}function ni(){}function ri(){}function ai(){}function oi(){}function si(){}function li(){}function ci(){}function ui(){}function di(){}function hi(){}function pi(e,t){var i,n=[],r=9==this.nodeType&&this.documentElement||this,a=r.prefix,o=r.namespaceURI;return mi(this,n,e,t,i=o&&null==a&&null==(a=r.lookupPrefix(o))?[{namespace:o,prefix:null}]:i),n.join("")}function fi(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if((n||r)&&("xml"!==n||"http://www.w3.org/XML/1998/namespace"!==r)&&"http://www.w3.org/2000/xmlns/"!=r){for(var a=i.length;a--;){var o=i[a];if(o.prefix==n)return o.namespace!=r}return 1}}function mi(e,t,i,n,r){if(n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case sl:r=r||[];var a=e.attributes,o=a.length,s=e.firstChild,l=e.tagName;i=ol===e.namespaceURI||i,t.push("<",l);for(var c=0;c<o;c++)"xmlns"==(u=a.item(c)).prefix?r.push({prefix:u.localName,namespace:u.value}):"xmlns"==u.nodeName&&r.push({prefix:"",namespace:u.value});for(var u,d,h,c=0;c<o;c++)fi(u=a.item(c),0,r)&&(d=u.prefix||"",h=u.namespaceURI,t.push(d?" xmlns:"+d:" xmlns",'="',h,'"'),r.push({prefix:d,namespace:h})),mi(u,t,i,n,r);if(fi(e,0,r)&&(d=e.prefix||"",h=e.namespaceURI,t.push(d?" xmlns:"+d:" xmlns",'="',h,'"'),r.push({prefix:d,namespace:h})),s||i&&!/^(?:meta|link|img|br|hr|input)$/i.test(l)){if(t.push(">"),i&&/^script$/i.test(l))for(;s;)s.data?t.push(s.data):mi(s,t,i,n,r),s=s.nextSibling;else for(;s;)mi(s,t,i,n,r),s=s.nextSibling;t.push("</",l,">")}else t.push("/>");return;case fl:case gl:for(s=e.firstChild;s;)mi(s,t,i,n,r),s=s.nextSibling;return;case ll:return t.push(" ",e.name,'="',e.value.replace(/[&"]/g,Gt),'"');case cl:return t.push(e.data.replace(/[<&]/g,Gt).replace(/]]>/g,"]]>"));case ul:return t.push("<![CDATA[",e.data,"]]>");case pl:return t.push("\x3c!--",e.data,"--\x3e");case ml:var p=e.publicId,l=e.systemId;return t.push("<!DOCTYPE ",e.name),void(p?(t.push(" PUBLIC ",p),l&&"."!=l&&t.push(" ",l),t.push(">")):l&&"."!=l?t.push(" SYSTEM ",l,">"):((l=e.internalSubset)&&t.push(" [",l,"]"),t.push(">")));case hl:return t.push("<?",e.target," ",e.data,"?>");case dl:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function gi(e,t,i){e[t]=i}function vi(e){return!!e&&"object"==typeof e}function yi(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return t.reduce(function(e,t){return"object"!=typeof t||Object.keys(t).forEach(function(i){Array.isArray(e[i])&&Array.isArray(t[i])?e[i]=e[i].concat(t[i]):vi(e[i])&&vi(t[i])?e[i]=yi(e[i],t[i]):e[i]=t[i]}),e},{})}function _i(e){return e.reduce(function(e,t){return e.concat(t)},[])}function bi(e){if(!e.length)return[];for(var t=[],i=0;i<e.length;i++)t.push(e[i]);return t}function wi(e){var t=e.baseUrl,i=void 0===(n=e.source)?"":n,n=void 0===(n=e.range)?"":n,e=void 0===(e=e.indexRange)?"":e,i={uri:i,resolvedUri:gt((void 0===t?"":t)||"",i)};return(n||e)&&(n=(n||e).split("-"),e=parseInt(n[0],10),n=parseInt(n[1],10),i.byterange={length:n-e+1,offset:e}),i}function xi(e){return e&&"number"!=typeof e&&(e=parseInt(e,10)),isNaN(e)?null:e}function ki(e){var t,i=void 0===(o=e.type)?"static":o,n=e.duration,r=e.timescale,a=void 0===r?1:r,o=e.sourceDuration,e=function(e,t){for(var i=[],n=e;n<t;n++)i.push(n);return i}((r=El[i](e)).start,r.end).map((t=e,function(e,i){var n=t.duration,r=t.timescale,a=t.periodIndex,o=t.startNumber;return{number:(void 0===o?1:o)+e,duration:n/(void 0===r?1:r),timeline:a,time:i*n}}));return"static"===i&&(e[i=e.length-1].duration=o-n/a*i),e}function Ci(e){var t=e.baseUrl,i=void 0===(r=e.initialization)?{}:r,n=e.sourceDuration,r=void 0===(a=e.indexRange)?"":a,a=e.duration;if(!t)throw new Error(Cl);return i=wi({baseUrl:t,source:i.sourceURL,range:i.range}),(r=wi({baseUrl:t,source:t,indexRange:r})).map=i,a?(e=ki(e)).length&&(r.duration=e[0].duration,r.timeline=e[0].timeline):n&&(r.duration=n,r.timeline=0),r.number=0,[r]}function Ti(e,t,i){
|
||
for(var n=e.sidx.map||null,r=e.sidx.duration,a=e.timeline||0,o=(o=e.sidx.byterange).offset+o.length,s=t.timescale,l=t.references.filter(function(e){return 1!==e.referenceType}),c=[],u=o+t.firstOffset,d=0;d<l.length;d++){var h=t.references[d],p=h.referencedSize,h=h.subsegmentDuration,h=Ci({baseUrl:i,timescale:s,timeline:a,periodIndex:a,duration:h,sourceDuration:r,indexRange:u+"-"+(u+p-1)})[0];n&&(h.map=n),c.push(h),u+=p}return e.segments=c,e}function Si(e){return e&&e.uri+"-"+(t=e.byterange,e=t.offset+t.length-1,t.offset+"-"+e);var t}function Ei(e){var t;return(t=e.reduce(function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");return e[n]?(t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,t.segments),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):e[n]=t,e},{}),Object.keys(t).map(function(e){return t[e]})).map(function(e){var t,i;return e.discontinuityStarts=(t=e.segments,i="discontinuity",t.reduce(function(e,t,n){return t[i]&&e.push(n),e},[])),e})}function Ai(e,t){var i=Si(e.sidx);return(i=i&&t[i]&&t[i].sidx)&&Ti(e,i,e.sidx.resolvedUri),e}function Ii(e,t,i){var n;return void 0===t&&(t={}),void 0===i&&(i=!1),e=e.reduce(function(e,r){var a=r.attributes.role&&r.attributes.role.value||"",o=r.attributes.lang||"",s=r.attributes.label||"main";e[s=o&&!r.attributes.label?r.attributes.lang+(a?" ("+a+")":""):s]||(e[s]={language:o,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l,c,u,d,d=Ai((c=i,u=(l=r).attributes,d=l.segments,o=l.sidx,d={attributes:((l={NAME:u.id,BANDWIDTH:u.bandwidth,CODECS:u.codecs})["PROGRAM-ID"]=1,l),uri:"",endList:"static"===(u.type||"static"),timeline:u.periodIndex,resolvedUri:"",targetDuration:u.duration,segments:d,mediaSequence:d.length?d[0].number:1},u.contentProtection&&(d.contentProtection=u.contentProtection),o&&(d.sidx=o),c&&(d.attributes.AUDIO="audio",d.attributes.SUBTITLES="subs"),d),t);return e[s].playlists.push(d),void 0===n&&"main"===a&&((n=r).default=!0),e},{}),n||(e[Object.keys(e)[0]].default=!0),e}function Di(e){var t=e.attributes,i=e.segments,n=e.sidx,i={attributes:((e={NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth})["PROGRAM-ID"]=1,e),uri:"",endList:"static"===(t.type||"static"),timeline:t.periodIndex,resolvedUri:"",targetDuration:t.duration,segments:i,mediaSequence:i.length?i[0].number:1};return t.contentProtection&&(i.contentProtection=t.contentProtection),n&&(i.sidx=n),i}function Mi(e){return"video/mp4"===(e=e.attributes).mimeType||"video/webm"===e.mimeType||"video"===e.contentType}function Li(e){return"audio/mp4"===(e=e.attributes).mimeType||"audio/webm"===e.mimeType||"audio"===e.contentType}function Oi(e){return"text/vtt"===(e=e.attributes).mimeType||"text"===e.contentType}function Ni(e,t,i){if(void 0===i&&(i={}),!e.length)return{};var n=(u=e[0].attributes).sourceDuration,r=void 0===(c=u.type)?"static":c,a=u.suggestedPresentationDelay,o=u.minimumUpdatePeriod,s=Ei(e.filter(Mi)).map(Di),l=Ei(e.filter(Li)),c=e.filter(Oi),u=e.map(function(e){return e.attributes.captionServices}).filter(Boolean),s={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:((e={AUDIO:{},VIDEO:{}})["CLOSED-CAPTIONS"]={},e.SUBTITLES={},e),uri:"",duration:n,playlists:function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=Ai(e[i],t);return e}(s,i)};0<=o&&(s.minimumUpdatePeriod=1e3*o),t&&(s.locations=t),"dynamic"===r&&(s.suggestedPresentationDelay=a);var d,a=0===s.playlists.length;return l.length&&(s.mediaGroups.AUDIO.audio=Ii(l,i,a)),c.length&&(s.mediaGroups.SUBTITLES.subs=(void 0===(d=i)&&(d={}),c.reduce(function(e,t){var i=t.attributes.lang||"text";return e[i]||(e[i]={language:i,default:!1,autoselect:!1,playlists:[],uri:""}),e[i].playlists.push(Ai(function(e){var t=e.attributes,i=e.segments;return void 0===i&&(i=[{uri:t.baseUrl,timeline:t.periodIndex,resolvedUri:t.baseUrl||"",duration:t.sourceDuration,number:0}],t.duration=t.sourceDuration),(e={NAME:t.id,BANDWIDTH:t.bandwidth})["PROGRAM-ID"]=1,t.codecs&&(e.CODECS=t.codecs),{attributes:e,uri:"",endList:"static"===(t.type||"static"),timeline:t.periodIndex,resolvedUri:t.baseUrl||"",targetDuration:t.duration,segments:i,mediaSequence:i.length?i[0].number:1}}(t),d)),e},{}))),u.length&&(s.mediaGroups["CLOSED-CAPTIONS"].cc=u.reduce(function(e,t){return t&&t.forEach(function(t){var i=t.channel,n=t.language;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])}),e},{})),s}function Pi(e,t){for(var i,n,r,a,o,s,l=e.type,c=void 0===l?"static":l,u=void 0===(l=e.minimumUpdatePeriod)?0:l,d=void 0===(l=e.media)?"":l,h=e.sourceDuration,p=void 0===(l=e.timescale)?1:l,f=void 0===(l=e.startNumber)?1:l,m=e.periodIndex,g=[],v=-1,y=0;y<t.length;y++){var _=t[y],b=_.d,w=_.r||0,x=_.t||0;v<0&&(v=x),x&&v<x&&(v=x);var k,C=void 0;C=w<0?(k=y+1)===t.length?"dynamic"===c&&0<u&&0<d.indexOf("$Number$")?(i=v,n=b,_=s=o=a=r=void 0,r=(x=e).NOW,a=x.clientOffset,o=x.availabilityStartTime,s=x.timescale,_=x.start,x=x.minimumUpdatePeriod,Math.ceil((((r+a)/1e3+(void 0===x?0:x)-(o+(void 0===_?0:_)))*(void 0===s?1:s)-i)/n)):(h*p-v)/b:(t[k].t-v)/b:w+1;for(var T=f+g.length+C,S=f+g.length;S<T;)g.push({number:S,duration:b/p,time:v,timeline:m}),v+=b,S++}return g}function Ri(e,t){return e.replace(Al,(i=t,function(e,t,n,r){return"$$"===e?"$":void 0===i[t]?e:(e=""+i[t],"RepresentationID"===t||(r=n?parseInt(r,10):1)<=e.length?e:new Array(r-e.length+1).join("0")+e)}));var i}function ji(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=void 0===(n=e.initialization)?{sourceURL:"",range:""}:n,r=wi({baseUrl:e.baseUrl,source:Ri(n.sourceURL,i),range:n.range});return(n=t,(t=e).duration||n?t.duration?ki(t):Pi(t,n):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodIndex}]).map(function(t){i.Number=t.number,i.Time=t.time;var n=Ri(e.media||"",i),t={uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:gt(e.baseUrl||"",n),map:r,number:t.number};return e.presentationTimeOffset&&(t.presentationTimeOffset=e.presentationTimeOffset),t})}function zi(e,t){var i=e.duration,n=void 0===(n=e.segmentUrls)?[]:n;if(!i&&!t||i&&t)throw new Error(Tl);var r,a=n.map(function(t){return n=t,t=(i=e).baseUrl,i=i.initialization,i=wi({baseUrl:t,source:(i=void 0===i?{}:i).sourceURL,range:i.range}),(n=wi({baseUrl:t,source:n.media,range:n.mediaRange})).map=i,n;var i,n});return i&&(r=ki(e)),(r=t?Pi(e,t):r).map(function(e,t){if(a[t])return t=a[t],t.timeline=e.timeline,t.duration=e.duration,t.number=e.number,t}).filter(function(e){return e})}function Fi(e){var t,i=e.attributes,n=e.segmentInfo;n.template?(a=ji,t=yi(i,n.template),n.template.presentationTimeOffset&&(t.presentationTimeOffset=n.template.presentationTimeOffset/n.template.timescale)):n.base?(a=Ci,t=yi(i,n.base)):n.list&&(a=zi,t=yi(i,n.list));var r={attributes:i};if(!a)return r;var a,e=a(t,n.timeline);return t.duration?(i=t.duration,a=t.timescale,t.duration=i/(void 0===a?1:a)):e.length?t.duration=e.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0):t.duration=0,r.attributes=t,r.segments=e,n.base&&t.indexRange&&(r.sidx=e[0],r.segments=[]),r}function Bi(e,t){return bi(e.childNodes).filter(function(e){return e.tagName===t})}function Ui(e){return e.textContent.trim()}function $i(e){if(!(r=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e)))return 0;var t=(a=r.slice(1))[0],i=a[1],n=a[2],e=a[3],r=a[4],a=a[5];return 31536e3*parseFloat(t||0)+2592e3*parseFloat(i||0)+86400*parseFloat(n||0)+3600*parseFloat(e||0)+60*parseFloat(r||0)+parseFloat(a||0)}function qi(e){return e&&e.attributes?bi(e.attributes).reduce(function(e,t){var i=Il[t.name]||Il.DEFAULT;return e[t.name]=i(t.value),e},{}):{}}function Hi(e,t){return t.length?_i(e.map(function(e){return t.map(function(t){return gt(e,Ui(t))})})):e}function Wi(e){var t=Bi(e,"SegmentTemplate")[0],i=Bi(e,"SegmentList")[0],n=i&&Bi(i,"SegmentURL").map(function(e){return yi({tag:"SegmentURL"},qi(e))}),r=Bi(e,"SegmentBase")[0],e=(a=i||t)&&Bi(a,"SegmentTimeline")[0],a=(a=i||r||t)&&Bi(a,"Initialization")[0];(t=t&&qi(t))&&a?t.initialization=a&&qi(a):t&&t.initialization&&(t.initialization={sourceURL:t.initialization});var o={template:t,timeline:e&&Bi(e,"S").map(qi),list:i&&yi(qi(i),{segmentUrls:n,initialization:qi(a)}),base:r&&yi(qi(r),{initialization:qi(a)})};return Object.keys(o).forEach(function(e){o[e]||delete o[e]}),o}function Vi(e,t,i){return function(n){var r=qi(n),a=Hi(t,Bi(n,"BaseURL")),o=Bi(n,"Role")[0],o={role:qi(o)},r=yi(e,r,o),o=Bi(n,"Accessibility")[0],o="urn:scte:dash:cc:cea-608:2015"===(o=qi(o)).schemeIdUri?o.value.split(";").map(function(e){var t,i,n;return/^CC\d=/.test(n=e)?(i=(t=e.split("="))[0],n=t[1]):/^CC\d$/.test(e)&&(i=e),{channel:i,language:n}}):"urn:scte:dash:cc:cea-708:2015"===o.schemeIdUri?o.value.split(";").map(function(e){var t,i,n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};return/=/.test(e)?(t=(i=e.split("="))[0],i=void 0===(i=i[1])?"":i,n.channel=t,n.language=e,i.split(",").forEach(function(e){var t=e.split(":"),e=t[0],t=t[1];"lang"===e?n.language=t:"er"===e?n.easyReader=Number(t):"war"===e?n.aspectRatio=Number(t):"3D"===e&&(n["3D"]=Number(t))})):n.language=e,n.channel&&(n.channel="SERVICE"+n.channel),n}):void 0;o&&(r=yi(r,{captionServices:o})),(o=Bi(n,"Label")[0])&&o.childNodes.length&&(s=o.childNodes[0].nodeValue.trim(),r=yi(r,{label:s}));var s=Bi(n,"ContentProtection").reduce(function(e,t){var i=qi(t),n=Dl[i.schemeIdUri];return n&&(e[n]={attributes:i},(t=Bi(t,"cenc:pssh")[0])&&(t=(t=Ui(t))&&vt(t),e[n].pssh=t)),e},{});Object.keys(s).length&&(r=yi(r,{contentProtection:s}));var l,c,u,s=Wi(n),n=Bi(n,"Representation"),s=yi(i,s);return _i(n.map((l=r,c=a,u=s,function(e){var t=Bi(e,"BaseURL"),t=Hi(c,t),i=yi(l,qi(e)),n=Wi(e);return t.map(function(e){return{segmentInfo:yi(u,n),attributes:yi(i,{baseUrl:e})}})})))}}function Gi(e,t){var i=t=void 0===t?{}:t,n=void 0===(o=i.manifestUri)?"":o,r=i.NOW,a=void 0===r?Date.now():r,o=void 0===(t=i.clientOffset)?0:t;if(!(r=Bi(e,"Period")).length)throw new Error(wl);var s,l,i=Bi(e,"Location"),t=qi(e),e=Hi([n],Bi(e,"BaseURL"));return t.sourceDuration=t.mediaPresentationDuration||0,t.NOW=a,t.clientOffset=o,i.length&&(t.locations=i.map(Ui)),{locations:t.locations,representationInfo:_i(r.map((s=t,l=e,function(e,t){var i=Hi(l,Bi(e,"BaseURL")),n=qi(e),n=parseInt(n.id,10),t=la.isNaN(n)?t:n,n=yi(s,{periodIndex:t}),t=Bi(e,"AdaptationSet"),e=Wi(e);return _i(t.map(Vi(n,i,e)))})))}}function Yi(e){if(""===e)throw new Error(xl);var t,i,n=new bl;try{i=(t=n.parseFromString(e,"application/xml"))&&"MPD"===t.documentElement.tagName?t.documentElement:null}catch(e){}if(!i||i&&0<i.getElementsByTagName("parsererror").length)throw new Error(kl);return i}function Ki(e,t){void 0===t&&(t={});var i=Gi(Yi(e),t),e=i.representationInfo.map(Fi);return Ni(e,i.locations,t.sidxMapping)}function Xi(e){return function(e){if(!(e=Bi(e,"UTCTiming")[0]))return null;var t=qi(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Sl)}return t}(Yi(e))}function Qi(e){return e instanceof Uint8Array?e:(Array.isArray(e)||(t=e,ArrayBuffer.isView(t))||e instanceof ArrayBuffer||(e="number"!=typeof e||"number"==typeof e&&e!=e?0:[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0));var t}function Zi(e,t){var i=void 0!==(t=(void 0===t?{}:t).le)&&t;e=Ol(e="bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e?0:e);for(var n=(t=e,Math.ceil(t.toString(2).length/8)),r=new Uint8Array(new ArrayBuffer(n)),a=0;a<n;a++){var o=i?a:Math.abs(a+1-r.length);r[o]=Number(e/Nl[a]&Ol(255)),e<0&&(r[o]=Math.abs(~r[o]),r[o]-=0===a?1:2)}return r}function Ji(e,t){if("string"!=typeof(e="string"!=typeof e&&e&&"function"==typeof e.toString?e.toString():e))return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var i=new Uint8Array(e.length),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return i}function en(e,t,i){var n=void 0===i?{}:i,r=void 0===(i=n.offset)?0:i,a=void 0===(n=n.mask)?[]:n;return e=Qi(e),n=(t=Qi(t)).every||Array.prototype.every,t.length&&e.length-r>=t.length&&n.call(t,function(t,i){return t===(a[i]?a[i]&e[r+i]:e[r+i])})}function tn(e,t){return void 0===t&&(t=0),(e=Qi(e)).length-t<10||!en(e,Pl,{offset:t})?t:tn(e,t+=function(e,t){void 0===t&&(t=0);var i=(e=Qi(e))[t+5],t=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9];return(16&i)>>4?20+t:10+t}(e,t))}function nn(e){return"string"==typeof e?Ji(e):e}function rn(e,t,i){var n;void 0===i&&(i=!1),n=t,t=Array.isArray(n)?n.map(nn):[nn(n)],e=Qi(e);var r=[];if(!t.length)return r;for(var a=0;a<e.length;){var o=(e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3])>>>0,s=e.subarray(a+4,a+8);if(0==o)break;var l=a+o;if(l>e.length){if(i)break;l=e.length}o=e.subarray(a+8,l),en(s,t[0])&&(1===t.length?r.push(o):r.push.apply(r,rn(o,t.slice(1),i))),a=l}return r}function an(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var r=function(e){for(var t=1,i=0;i<jl.length&&!(e&jl[i]);i++)t++;return t}(e[t]),a=e.subarray(t,t+r);return i&&((a=Array.prototype.slice.call(e,t,t+r))[0]^=jl[r-1]),{length:r,value:function(e,t){var i=void 0===t?{}:t,t=i.signed,t=void 0!==t&&t,i=i.le,n=void 0!==i&&i;return e=Qi(e),i=n?"reduce":"reduceRight",i=(e[i]||Array.prototype[i]).call(e,function(t,i,r){return r=n?r:Math.abs(r+1-e.length),t+Ol(i)*Nl[r]},Ol(0)),!t||(t=Nl[e.length]/Ol(2)-Ol(1))<(i=Ol(i))&&(i-=t,i-=t,i-=Ol(2)),Number(i)}(a,{signed:n}),bytes:a}}function on(e){return"string"==typeof e?e.match(/.{1,2}/g).map(on):"number"==typeof e?Zi(e):e}function sn(e,t,i){if(i>=t.length)return t.length;var n=an(t,i,!1);if(en(e.bytes,n.bytes))return i;var r=an(t,i+n.length);return sn(e,t,i+r.length+r.value+n.length)}function ln(e,t){var i;i=t,t=Array.isArray(i)?i.map(on):[on(i)],e=Qi(e);var n=[];if(!t.length)return n;for(var r=0;r<e.length;){var a=an(e,r,!1),o=an(e,r+a.length),s=r+a.length+o.length;127===o.value&&(o.value=sn(a,e,s),o.value!==e.length&&(o.value-=s));var l=s+o.value>e.length?e.length:s+o.value,l=e.subarray(s,l);en(t[0],a.bytes)&&(1===t.length?n.push(l):n=n.concat(ln(l,t.slice(1)))),r+=a.length+o.length+l.length}return n}function cn(e,t,i,n){void 0===n&&(n=1/0),e=Qi(e),i=[].concat(i);for(var r,a=0,o=0;a<e.length&&(o<n||r);){var s=void 0;if(en(e.subarray(a),zl)?s=4:en(e.subarray(a),Fl)&&(s=3),s){if(o++,r)return function(e){for(var t=[],i=1;i<e.length-2;)en(e.subarray(i,i+3),Bl)&&(t.push(i+2),i++),i++;if(0===t.length)return e;for(var n=e.length-t.length,r=new Uint8Array(n),a=0,i=0;i<n;a++,i++)a===t[0]&&(a++,t.shift()),r[i]=e[a];return r}(e.subarray(r,a));var l=void 0;"h264"===t?l=31&e[a+s]:"h265"===t&&(l=e[a+s]>>1&63),-1!==i.indexOf(l)&&(r=a+s),a+=s+("h264"===t?1:2)}else a++}return e.subarray(0,0)}function un(e){e=Qi(e);for(var t=0;t<ql.length;t++){var i=ql[t];if(Wl[i](e))return i}return""}function dn(e,t,i){return e&&i&&i.responseURL&&t!==i.responseURL?i.responseURL:t}function hn(e){return mt.log.debug?mt.log.debug.bind(mt,"VHS:",e+" >"):function(){}}function pn(e,t){var i,n=[];if(e&&e.length)for(i=0;i<e.length;i++)t(e.start(i),e.end(i))&&n.push([e.start(i),e.end(i)]);return mt.createTimeRanges(n)}function fn(e,t){return pn(e,function(e,i){return e-.1<=t&&t<=i+.1})}function mn(e,t){return pn(e,function(e){return t<=e-Gl})}function gn(e){var t=[];if(!e||!e.length)return"";for(var i=0;i<e.length;i++)t.push(e.start(i)+" => "+e.end(i));return t.join(", ")}function vn(e){for(var t=[],i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}function yn(e){if(e&&e.length&&e.end)return e.end(e.length-1)}function _n(e){return(e.segments||[]).reduce(function(e,t,i){return t.parts?t.parts.forEach(function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e},[])}function bn(e){return(e=e.segments&&e.segments.length&&e.segments[e.segments.length-1])&&e.parts||[]}function wn(e){var t=e.preloadSegment;if(t)return e=t.parts,t=(t.preloadHints||[]).reduce(function(e,t){return e+("PART"===t.type?1:0)},0),t+=e&&e.length?e.length:0}function xn(e,t){return t.endList?0:e&&e.suggestedPresentationDelay?e.suggestedPresentationDelay:(e=0<bn(t).length)&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:e&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0}function kn(e,t,i){if((t=void 0===t?e.mediaSequence+e.segments.length:t)<e.mediaSequence)return 0;var n=function(e,t){var i=0,n=t-e.mediaSequence,r=e.segments[n];if(r){if(void 0!==r.start)return{result:r.start,precise:!0};if(void 0!==r.end)return{result:r.end-r.duration,precise:!0}}for(;n--;){if(void 0!==(r=e.segments[n]).end)return{result:i+r.end,precise:!0};if(i+=r.duration,void 0!==r.start)return{result:i+r.start,precise:!0}}return{result:i,precise:!1}}(e,t);return n.precise?n.result:(t=function(e,t){for(var i,n=0,r=t-e.mediaSequence;r<e.segments.length;r++){if(void 0!==(i=e.segments[r]).start)return{result:i.start-n,precise:!0};if(n+=i.duration,void 0!==i.end)return{result:i.end-n,precise:!0}}return{result:-1,precise:!1}}(e,t)).precise?t.result:n.result+i}function Cn(e,t,i){if(!e)return 0;if(void 0===t){if(e.totalDuration)return e.totalDuration;if(!e.endList)return la.Infinity}return kn(e,t,i="number"!=typeof i?0:i)}function Tn(e){var t=e.defaultDuration,i=e.durationList,n=e.startIndex,r=e.endIndex,a=0;if(r<n&&(n=(e=[r,n])[0],r=e[1]),n<0){for(var o=n;o<Math.min(0,r);o++)a+=t;n=0}for(var s=n;s<r;s++)a+=i[s].duration;return a}function Sn(e,t,i,n){return e&&e.segments?e.endList?Cn(e):null===t?null:(t=kn(e,e.mediaSequence+e.segments.length,t=t||0),i&&(t-=n="number"==typeof n?n:xn(null,e)),Math.max(0,t)):null}function En(e){return e.excludeUntil&&e.excludeUntil>Date.now()}function An(e){return e.excludeUntil&&e.excludeUntil===1/0}function In(e){var t=En(e);return!e.disabled&&!t}function Dn(e,t){return t.attributes&&t.attributes[e]}function Mn(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){return!!In(e)&&(e.attributes.BANDWIDTH||0)<i}).length}function Ln(e,t){return!(!e&&!t||!e&&t||e&&!t||e!==t&&(!e.id||!t.id||e.id!==t.id)&&(!e.resolvedUri||!t.resolvedUri||e.resolvedUri!==t.resolvedUri)&&(!e.uri||!t.uri||e.uri!==t.uri))}function On(e,t){var i,n=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{},r=!1;for(i in n){for(var a in n[i])if(r=t(n[i][a]))break;if(r)break}return!!r}function Nn(e){if(!e||!e.playlists||!e.playlists.length)return On(e,function(e){return e.playlists&&e.playlists.length||e.uri});for(var t=0;t<e.playlists.length;t++){var i=function(t){var i=e.playlists[t],t=i.attributes&&i.attributes.CODECS;return t&&t.split(",").every(Ct)||On(e,function(e){return Ln(i,e)})?"continue":{v:!1}}(t);if("continue"!==i&&"object"==typeof i)return i.v}return!0}function Pn(e,t){return e+"-"+t}function Rn(e,t){e.mediaGroups&&["AUDIO","SUBTITLES"].forEach(function(i){if(e.mediaGroups[i])for(var n in e.mediaGroups[i])for(var r in e.mediaGroups[i][n]){var a=e.mediaGroups[i][n][r];t(a,i,n,r)}})}function jn(e){var t=e.playlist,i=e.uri,e=e.id;t.id=e,t.playlistErrors_=0,i&&(t.uri=i),t.attributes=t.attributes||{}}function zn(e,t){e.uri=t;for(var i,n=0;n<e.playlists.length;n++)e.playlists[n].uri||(e.playlists[n].uri="placeholder-uri-"+n);Rn(e,function(t,i,n,r){var a="placeholder-uri-"+i+"-"+n+"-"+r;t.playlists&&t.playlists.length||(t.playlists=[xa({},t)]),t.playlists.forEach(function(t,i){var n=Pn(i,a);t.uri?t.resolvedUri=t.resolvedUri||Vl(e.uri,t.uri):(t.uri=0===i?a:n,t.resolvedUri=t.uri),t.id=t.id||n,t.attributes=t.attributes||{},e.playlists[t.id]=t,e.playlists[t.uri]=t})}),function(e){for(var t=e.playlists.length;t--;){var i=e.playlists[t];jn({playlist:i,id:Pn(t,i.uri)}),i.resolvedUri=Vl(e.uri,i.uri),e.playlists[i.id]=i,(e.playlists[i.uri]=i).attributes.BANDWIDTH||Xl.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}(e),Rn(i=e,function(e){e.uri&&(e.resolvedUri=Vl(i.uri,e.uri))})}function Fn(e,t,i){var n=e.slice(),r=t.slice();i=i||0;for(var a,o=[],s=0;s<r.length;s++){var l=n[s+i],c=r[s];l?(a=l.map||a,o.push(function(e,t){if(!e)return t;var i=Ql(e,t);if(e.preloadHints&&!t.preloadHints&&delete i.preloadHints,e.parts&&!t.parts)delete i.parts;else if(e.parts&&t.parts)for(var n=0;n<t.parts.length;n++)e.parts&&e.parts[n]&&(i.parts[n]=Ql(e.parts[n],t.parts[n]));return!e.skipped&&t.skipped&&(i.skipped=!1),e.preload&&!t.preload&&(i.preload=!1),i}(l,c))):(a&&!c.map&&(c.map=a),o.push(c))}return o}function Bn(e,t){!e.resolvedUri&&e.uri&&(e.resolvedUri=Vl(t,e.uri)),e.key&&!e.key.resolvedUri&&(e.key.resolvedUri=Vl(t,e.key.uri)),e.map&&!e.map.resolvedUri&&(e.map.resolvedUri=Vl(t,e.map.uri)),e.map&&e.map.key&&!e.map.key.resolvedUri&&(e.map.key.resolvedUri=Vl(t,e.map.key.uri)),e.parts&&e.parts.length&&e.parts.forEach(function(e){e.resolvedUri||(e.resolvedUri=Vl(t,e.uri))}),e.preloadHints&&e.preloadHints.length&&e.preloadHints.forEach(function(e){e.resolvedUri||(e.resolvedUri=Vl(t,e.uri))})}function Un(e){var t=e.segments||[],i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(var n=0;n<i.preloadHints.length;n++)if("MAP"===i.preloadHints[n].type)return t;i.duration=e.targetDuration,i.preload=!0,t.push(i)}return t}function $n(e,t){return e===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence}function qn(e,t,i){void 0===i&&(i=$n);var n=Ql(e,{}),r=n.playlists[t.id];if(!r)return null;if(i(r,t))return null;t.segments=Un(t);var a=Ql(r,t);if(a.preloadSegment&&!t.preloadSegment&&delete a.preloadSegment,r.segments){if(t.skip){t.segments=t.segments||[];for(var o=0;o<t.skip.skippedSegments;o++)t.segments.unshift({skipped:!0})}a.segments=Fn(r.segments,t.segments,t.mediaSequence-r.mediaSequence)}a.segments.forEach(function(e){Bn(e,a.resolvedUri)});for(var s=0;s<n.playlists.length;s++)n.playlists[s].id===t.id&&(n.playlists[s]=a);return n.playlists[t.id]=a,n.playlists[t.uri]=a,Rn(e,function(e,i,n,r){if(e.playlists)for(var a=0;a<e.playlists.length;a++)t.id===e.playlists[a].id&&(e.playlists[a]=t)}),n}function Hn(e,t){var i=(n=e.segments[e.segments.length-1])&&n.parts&&n.parts[n.parts.length-1],n=i&&i.duration||n&&n.duration;return t&&n?1e3*n:500*(e.partTargetDuration||e.targetDuration||10)}function Wn(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),n(t=t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode?t:new Error("XHR Failed with a response of: "+(e&&(r||e.responseText))),e)}function Vn(){function e(t,i){t=ec({timeout:45e3},t);var n=e.beforeRequest||mt.Vhs.xhr.beforeRequest;!n||"function"!=typeof n||(n=n(t))&&(t=n);var r=(!0===mt.Vhs.xhr.original?Jl:mt.Vhs.xhr)(t,function(e,t){return Wn(r,e,t,i)}),a=r.abort;return r.abort=function(){return r.aborted=!0,a.apply(r,arguments)},r.uri=t.uri,r.requestTime=Date.now(),r}return e.original=!0,e}function Gn(e){var t,i={};return e.byterange&&(i.Range=(t=e.byterange,e=t.offset+t.length-1,"bytes="+t.offset+"-"+e)),i}function Yn(e,t){return e=e.toString(16),"00".substring(0,2-e.length)+e+(t%2?" ":"")}function Kn(e){return 32<=e&&e<126?String.fromCharCode(e):"."}function Xn(e){var t={};return Object.keys(e).forEach(function(i){var n=e[i];ArrayBuffer.isView(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n}),t}function Qn(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")}function Zn(e){return e.resolvedUri}function Jn(e){for(var t=Array.prototype.slice.call(e),i="",n=0;n<t.length/16;n++)i+=t.slice(16*n,16*n+16).map(Yn).join("")+" "+t.slice(16*n,16*n+16).map(Kn).join("")+"\n";return i}function er(e){var t=e.playlist,i=e.time,n=void 0===i?void 0:i;if(!(i=e.callback))throw new Error("getProgramTime: callback must be provided");return t&&void 0!==n?(e=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var i,n=0,r=0;r<t.segments.length&&!(e<=(n=(i=t.segments[r]).videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:n+i.duration));r++);var a=t.segments[t.segments.length-1];if(a.videoTimingInfo&&a.videoTimingInfo.transmuxedPresentationEnd<e)return null;if(n<e){if(e>n+.25*a.duration)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}}(n,t))?"estimate"===e.type?i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:e.estimatedStart}):(t={mediaSeconds:n},(e=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,i=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*i)}(n,e.segment))&&(t.programDateTime=e.toISOString()),i(null,t)):i({message:"valid programTime was not found"}):i({message:"getProgramTime: playlist and time must be provided"})}function tr(e){var t=e.programTime,i=e.playlist,n=e.retryCount,r=void 0===n?2:n,a=e.seekTo,o=e.pauseAfterSeek,s=void 0===o||o,l=e.tech,c=e.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");return void 0!==t&&i&&a?i.endList||l.hasStarted_?function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;t<e.segments.length;t++)if(!e.segments[t].dateTimeObject)return!1;return!0}(i)?(n=function(e,t){var i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||0===t.segments.length)return null;if(i<(r=t.segments[0]).dateTimeObject)return null;for(var n=0;n<t.segments.length-1;n++){var r=t.segments[n];if(i<t.segments[n+1].dateTimeObject)break}var a,o=t.segments[t.segments.length-1],e=o.dateTimeObject,a=o.videoTimingInfo?(a=o.videoTimingInfo).transmuxedPresentationEnd-a.transmuxedPresentationStart-a.transmuxerPrependedSeconds:o.duration+.25*o.duration;return new Date(e.getTime()+1e3*a)<i?null:{segment:r=e<i?o:r,estimatedStart:r.videoTimingInfo?r.videoTimingInfo.transmuxedPresentationStart:Kl.duration(t,t.mediaSequence+t.segments.indexOf(r)),type:r.videoTimingInfo?"accurate":"estimate"}}(t,i))?(o=n.segment,e=function(e,t){var i;try{n=new Date(e),i=new Date(t)}catch(e){}var n=n.getTime();return(i.getTime()-n)/1e3}(o.dateTimeObject,t),"estimate"===n.type?0===r?c({message:t+" is not buffered yet. Try again"}):(a(n.estimatedStart+e),void l.one("seeked",function(){tr({programTime:t,playlist:i,retryCount:r-1,seekTo:a,pauseAfterSeek:s,tech:l,callback:c})})):(e=o.start+e,l.one("seeked",function(){return c(null,l.currentTime())}),s&&l.pause(),void a(e))):c({message:t+" was not found in the stream"}):c({message:"programDateTime tags must be provided in the manifest "+i.resolvedUri}):c({message:"player must be playing a live stream to start buffering"}):c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}function ir(e,t){if(4===e.readyState)return t()}function nr(e,t,i){function n(e,t,n,r){return t.abort(),s=!0,i(e,t,n,r)}function r(e,t){if(!s){if(e)return n(e,t,"",o);var i=t.responseText.substring(o&&o.byteLength||0,t.responseText.length);return o=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if((t=t.filter(function(e){return e&&(e.byteLength||e.length)&&"string"!=typeof e})).length<=1)return Qi(t[0]);var n=t.reduce(function(e,t,i){return e+(t.byteLength||t.length)},0),r=new Uint8Array(n),a=0;return t.forEach(function(e){e=Qi(e),r.set(e,a),a+=e.byteLength}),r}(o,Ji(i,!0)),(a=a||tn(o),o.length<10||a&&o.length<a+2)?ir(t,function(){return n(e,t,"",o)}):(i=un(o),"ts"===i&&o.length<188||!i&&o.length<376?ir(t,function(){return n(e,t,"",o)}):n(null,t,i,o))}}var a,o=[],s=!1,l=t({uri:e,beforeSend:function(e){e.overrideMimeType("text/plain; charset=x-user-defined"),e.addEventListener("progress",function(t){return t.total,t.loaded,Wn(e,null,{statusCode:e.status},r)})}},function(e,t){return Wn(l,e,t,r)});return l}function rr(e,t){if(!$n(e,t))return!1;if(e.sidx&&t.sidx&&(e.sidx.offset!==t.sidx.offset||e.sidx.length!==t.sidx.length))return!1;if(!e.sidx&&t.sidx||e.sidx&&!t.sidx)return!1;if(e.segments&&!t.segments||!e.segments&&t.segments)return!1;if(!e.segments&&!t.segments)return!0;for(var i=0;i<e.segments.length;i++){var n=e.segments[i],r=t.segments[i];if(n.uri!==r.uri)return!1;if(n.byterange||r.byterange){if(n=n.byterange,r=r.byterange,n&&!r||!n&&r)return!1;if(n.offset!==r.offset||n.length!==r.length)return!1}}return!0}function ar(e,t){var i,n={};for(i in e){var r=e[i].sidx;if(r){var a=Si(r);if(!t[a])break;var o=t[a].sidxInfo;o=o,r=r,(Boolean(!o.map&&!r.map)||Boolean(o.map&&r.map&&o.map.byterange.offset===r.map.byterange.offset&&o.map.byterange.length===r.map.byterange.length))&&o.uri===r.uri&&o.byterange.offset===r.byterange.offset&&o.byterange.length===r.byterange.length&&(n[a]=t[a])}}return n}function or(e){return e.on=e.addEventListener,e.off=e.removeEventListener,e}function sr(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,o=e.onData,s=e.onTrackInfo,l=e.onAudioTimingInfo,c=e.onVideoTimingInfo,u=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,v=e.isEndOfTimeline,y={buffer:[]},_=v;t.onmessage=function(i){var n;t.currentTransmux===e&&("data"===i.data.action&&function(e,t,i){var n=e.data.segment,r=n.type,a=n.initSegment,o=n.captions,s=n.captionStreams,l=n.metadata,c=n.videoFrameDtsTime,n=n.videoFramePtsTime;t.buffer.push({captions:o,captionStreams:s,metadata:l}),e=e.data.segment.boxes||{data:e.data.segment.data},a={type:r,data:new Uint8Array(e.data,e.data.byteOffset,e.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)},void 0!==c&&(a.videoFrameDtsTime=c),void 0!==n&&(a.videoFramePtsTime=n),i(a)}(i,y,o),"trackinfo"===i.data.action&&s(i.data.trackInfo),"gopInfo"===i.data.action&&(y.gopInfo=i.data.gopInfo),"audioTimingInfo"===i.data.action&&l(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&c(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&u(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&d(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(_=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(_||(t.onmessage=null,i=(n={transmuxedData:y,callback:f}).transmuxedData,n=n.callback,i.buffer=[],n(i),ac(t))))},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),i.byteLength&&(r=i instanceof ArrayBuffer?i:i.buffer,a=i instanceof ArrayBuffer?0:i.byteOffset,t.postMessage({action:"push",data:r,byteOffset:a,byteLength:i.byteLength},[r])),v&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})}function lr(e,t){e.postMessage({action:t}),ac(e)}function cr(e,t){if(!t.currentTransmux)return t.currentTransmux=e,lr(t,e),0
|
||
;t.transmuxQueue.push(lr.bind(null,t,e))}function ur(e){if(!e.transmuxer.currentTransmux)return e.transmuxer.currentTransmux=e,void sr(e);e.transmuxer.transmuxQueue.push(e)}function dr(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=xa({},e,{endAction:null,transmuxer:null,callback:null}),a=function r(a){a.data.action===i&&(t.removeEventListener("message",r),a.data.data&&(a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength),e.data&&(e.data=a.data.data)),n(a.data))};t.addEventListener("message",a),e.data?(a=e.data instanceof ArrayBuffer,r.byteOffset=a?0:e.data.byteOffset,r.byteLength=e.data.byteLength,a=[a?e.data:e.data.buffer],t.postMessage(r,a)):t.postMessage(r)}function hr(e){e.forEach(function(e){e.abort()})}function pr(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:cc,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:uc,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:lc,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:lc,xhr:t}:null}function fr(e,t,i){return function(n,r){var a=r.response,n=pr(n,r);if(n)return i(n,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:lc,xhr:r},e);for(var a=new DataView(a),o=new Uint32Array([a.getUint32(0),a.getUint32(4),a.getUint32(8),a.getUint32(12)]),s=0;s<t.length;s++)t[s].bytes=o;return i(null,e)}}function mr(e,t){var i=un(e.map.bytes);if("mp4"!==i){var n=e.map.resolvedUri||e.map.uri;return t({internal:!0,message:"Found unsupported "+(i||"unknown")+" container for initialization segment at URL: "+n,code:lc})}dr({action:"probeMp4Tracks",data:e.map.bytes,transmuxer:e.transmuxer,callback:function(i){var n=i.tracks,i=i.data;return e.map.bytes=i,n.forEach(function(t){e.map.tracks=e.map.tracks||{},e.map.tracks[t.type]||"number"==typeof(e.map.tracks[t.type]=t).id&&t.timescale&&(e.map.timescales=e.map.timescales||{},e.map.timescales[t.id]=t.timescale)}),t(null)}})}function gr(e){var t=e.segment,i=e.finishProcessingFn,n=e.responseType;return function(e,r){return(e=pr(e,r))?i(e,t):(e="arraybuffer"!==n&&r.responseText?function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i<e.length;i++)t[i]=e.charCodeAt(i);return t.buffer}(r.responseText.substring(t.lastReachedChar||0)):r.response,t.stats={bandwidth:(r=r).bandwidth,bytesReceived:r.bytesReceived||0,roundTripTime:r.roundTripTime||0},t.key?t.encryptedBytes=new Uint8Array(e):t.bytes=new Uint8Array(e),i(null,t))}}function vr(e){var t=e.segment,i=e.bytes,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,s=e.id3Fn,l=e.captionsFn,c=e.isEndOfTimeline,u=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,e=t.map&&t.map.tracks||{},f=Boolean(e.audio&&e.video),m=r.bind(null,t,"audio","start"),g=r.bind(null,t,"audio","end"),v=r.bind(null,t,"video","start"),y=r.bind(null,t,"video","end");dr({action:"probeTs",transmuxer:t.transmuxer,data:i,baseStartTime:t.baseStartTime,callback:function(e){t.bytes=i=e.data,e=e.result,e&&(n(t,{hasAudio:e.hasAudio,hasVideo:e.hasVideo,isMuxed:f}),n=null,e.hasAudio&&!f&&m(e.audioStart),e.hasVideo&&v(e.videoStart),v=m=null),ur({bytes:i,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:f,onData:function(e){e.type="combined"===e.type?"video":e.type,d(t,e)},onTrackInfo:function(e){n&&(f&&(e.isMuxed=!0),n(t,e))},onAudioTimingInfo:function(e){m&&void 0!==e.start&&(m(e.start),m=null),g&&void 0!==e.end&&g(e.end)},onVideoTimingInfo:function(e){v&&void 0!==e.start&&(v(e.start),v=null),y&&void 0!==e.end&&y(e.end)},onVideoSegmentTimingInfo:function(e){a(e)},onAudioSegmentTimingInfo:function(e){o(e)},onId3:function(e,i){s(t,e,i)},onCaptions:function(e){l(t,[e])},isEndOfTimeline:c,onEndedTimeline:function(){u()},onTransmuxerLog:p,onDone:function(e){h&&(e.type="combined"===e.type?"video":e.type,h(null,t,e))}})}})}function yr(e){var t=e.segment,i=e.bytes,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,s=e.id3Fn,l=e.captionsFn,c=e.isEndOfTimeline,u=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=new Uint8Array(i);if(0<rn(f,["moof"]).length){t.isFmp4=!0;var m=t.map.tracks,g={isFmp4:!0,hasVideo:!!m.video,hasAudio:!!m.audio};m.audio&&m.audio.codec&&"enca"!==m.audio.codec&&(g.audioCodec=m.audio.codec),m.video&&m.video.codec&&"encv"!==m.video.codec&&(g.videoCodec=m.video.codec),m.video&&m.audio&&(g.isMuxed=!0),n(t,g);var v=function(e){d(t,{data:f,type:g.hasAudio&&!g.isMuxed?"audio":"video"}),e&&e.length&&l(t,e),h(null,t,{})};dr({action:"probeMp4StartTime",timescales:t.map.timescales,data:f,transmuxer:t.transmuxer,callback:function(e){var n=e.data,e=e.startTime;i=n.buffer,t.bytes=f=n,g.hasAudio&&!g.isMuxed&&r(t,"audio","start",e),g.hasVideo&&r(t,"video","start",e),m.video&&n.byteLength&&t.transmuxer?dr({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:f,timescales:t.map.timescales,trackIds:[m.video.id],callback:function(e){i=e.data.buffer,t.bytes=f=e.data,e.logs.forEach(function(e){p(mt.mergeOptions(e,{stream:"mp4CaptionParser"}))}),v(e.captions)}}):v()}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=un(f)),"ts"!==t.container&&"aac"!==t.container)return n(t,{hasAudio:!1,hasVideo:!1}),h(null,t,{}),0;vr({segment:t,bytes:i,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:s,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:p})}else h(null,t,{})}function _r(e,t){var i=e.id,n=e.key,r=e.encryptedBytes,a=e.decryptionWorker,e=function e(n){n.data.source===i&&(a.removeEventListener("message",e),n=n.data.decrypted,t(new Uint8Array(n.bytes,n.byteOffset,n.byteLength)))};a.addEventListener("message",e),e=n.bytes.slice?n.bytes.slice():new Uint32Array(Array.prototype.slice.call(n.bytes)),a.postMessage(Xn({source:i,encrypted:r,key:e,iv:n.iv}),[r.buffer,e.buffer])}function br(e){var t=e.activeXhrs,i=e.decryptionWorker,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,o=e.audioSegmentTimingInfoFn,s=e.id3Fn,l=e.captionsFn,c=e.isEndOfTimeline,u=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=0,m=!1;return function(e,g){if(!m){if(e)return m=!0,hr(t),h(e,g);if((f+=1)===t.length){var v=function(){if(g.encryptedBytes)return t=(e={decryptionWorker:i,segment:g,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:s,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:p}).decryptionWorker,f=e.segment,m=e.trackInfoFn,v=e.timingInfoFn,y=e.videoSegmentTimingInfoFn,_=e.audioSegmentTimingInfoFn,b=e.id3Fn,w=e.captionsFn,x=e.isEndOfTimeline,k=e.endedTimelineFn,C=e.dataFn,T=e.doneFn,S=e.onTransmuxerLog,void _r({id:f.requestId,key:f.key,encryptedBytes:f.encryptedBytes,decryptionWorker:t},function(e){f.bytes=e,yr({segment:f,bytes:f.bytes,trackInfoFn:m,timingInfoFn:v,videoSegmentTimingInfoFn:y,audioSegmentTimingInfoFn:_,id3Fn:b,captionsFn:w,isEndOfTimeline:x,endedTimelineFn:k,dataFn:C,doneFn:T,onTransmuxerLog:S})});var e,t,f,m,v,y,_,b,w,x,k,C,T,S;yr({segment:g,bytes:g.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:o,id3Fn:s,captionsFn:l,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:p})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return _r({decryptionWorker:i,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},function(e){g.map.bytes=e,mr(g,function(e){return e?(hr(t),h(e,g)):void v()})});v()}}}}function wr(e){var t=e.segment,i=e.progressFn;return e.trackInfoFn,e.timingInfoFn,e.videoSegmentTimingInfoFn,e.audioSegmentTimingInfoFn,e.id3Fn,e.captionsFn,e.isEndOfTimeline,e.endedTimelineFn,e.dataFn,function(e){var n,r=e.target;if(!r.aborted)return t.stats=mt.mergeOptions(t.stats,(r=(n=e).target,(r={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-r.requestTime||0}).bytesReceived=n.loaded,r.bandwidth=Math.floor(r.bytesReceived/r.roundTripTime*8*1e3),r)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),i(e,t)}}function xr(e){var t,i,n,r=e.xhr,a=e.xhrOptions,o=e.decryptionWorker,s=e.segment,l=e.abortFn,c=e.progressFn,u=e.trackInfoFn,d=e.timingInfoFn,h=e.videoSegmentTimingInfoFn,p=e.audioSegmentTimingInfoFn,f=e.id3Fn,m=e.captionsFn,g=e.isEndOfTimeline,v=e.endedTimelineFn,y=e.dataFn,_=e.doneFn,e=e.onTransmuxerLog,b=[],_=br({activeXhrs:b,decryptionWorker:o,trackInfoFn:u,timingInfoFn:d,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:f,captionsFn:m,isEndOfTimeline:g,endedTimelineFn:v,dataFn:y,doneFn:_,onTransmuxerLog:e});s.key&&!s.key.bytes&&(e=[s.key],s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&e.push(s.map.key),e=r(mt.mergeOptions(a,{uri:s.key.resolvedUri,responseType:"arraybuffer"}),fr(s,e,_)),b.push(e)),s.map&&!s.map.bytes&&(!s.map.key||s.key&&s.key.resolvedUri===s.map.key.resolvedUri||(t=r(mt.mergeOptions(a,{uri:s.map.key.resolvedUri,responseType:"arraybuffer"}),fr(s,[s.map.key],_)),b.push(t)),t=r(mt.mergeOptions(a,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Gn(s.map)}),(i=(t={segment:s,finishProcessingFn:_}).segment,n=t.finishProcessingFn,function(e,t){return(e=pr(e,t))?n(e,i):(e=new Uint8Array(t.response),i.map.key?(i.map.encryptedBytes=e,n(null,i)):(i.map.bytes=e,void mr(i,function(e){return e?(e.xhr=t,e.status=t.status,n(e,i)):void n(null,i)})))})),b.push(t)),a=mt.mergeOptions(a,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Gn(s)}),(a=r(a,gr({segment:s,finishProcessingFn:_,responseType:a.responseType}))).addEventListener("progress",wr({segment:s,progressFn:c,trackInfoFn:u,timingInfoFn:d,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:f,captionsFn:m,isEndOfTimeline:g,endedTimelineFn:v,dataFn:y})),b.push(a);var w={};return b.forEach(function(e){var t,i;e.addEventListener("loadend",(t=(e={loadendState:w,abortFn:l}).loadendState,i=e.abortFn,function(e){e.target.aborted&&i&&!t.calledAbortFn&&(i(),t.calledAbortFn=!0)}))}),function(){return hr(b)}}function kr(e,t){return t=t.attributes||{},e&&e.mediaGroups&&e.mediaGroups.AUDIO&&t.AUDIO&&e.mediaGroups.AUDIO[t.AUDIO]}function Cr(e){var t={};return e.forEach(function(e){var i=e.mediaType,n=e.type,e=e.details;t[i]=t[i]||[],t[i].push(xt(""+n+e))}),Object.keys(t).forEach(function(e){return 1<t[e].length?(dc("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null)):void(t[e]=t[e][0])}),t}function Tr(e){var t=0;return e.audio&&t++,e.video&&t++,t}function Sr(e,t){var i,n=t.attributes||{},r=Cr(function(e){if(e=e.attributes||{},e.CODECS)return kt(e.CODECS)}(t)||[]);return kr(e,t)&&!r.audio&&!function(e,t){if(!kr(e,t))return!0;var i,t=t.attributes||{},n=e.mediaGroups.AUDIO[t.AUDIO];for(i in n)if(!n[i].uri&&!n[i].playlists)return!0;return!1}(e,t)&&(i=Cr(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i,n=e.mediaGroups.AUDIO[t];if(!n)return null;for(i in n){var r=n[i];if(r.default&&r.playlists)return kt(r.playlists[0].attributes.CODECS)}return null}(e,n.AUDIO)||[])).audio&&(r.audio=i.audio),r}function Er(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}}function Ar(e,t){return(e=e&&la.getComputedStyle(e))?e[t]:""}function Ir(e,t){var i=e.slice();e.sort(function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r})}function Dr(e,t){var i,n;return(i=(i=e.attributes.BANDWIDTH?e.attributes.BANDWIDTH:i)||la.Number.MAX_VALUE)-(n=(n=t.attributes.BANDWIDTH?t.attributes.BANDWIDTH:n)||la.Number.MAX_VALUE)}function Mr(e,t,i,n,r,a){if(e){var o={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},s=e.playlists;Kl.isAudioOnly(e)&&(s=a.getAudioTrackPlaylists_(),o.audioOnly=!0);var l=s.map(function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||la.Number.MAX_VALUE,width:t,height:i,playlist:e}});Ir(l,function(e,t){return e.bandwidth-t.bandwidth});var e=(l=l.filter(function(e){return!Kl.isIncompatible(e.playlist)})).filter(function(e){return Kl.isEnabled(e.playlist)}),a=(e=e.length?e:l.filter(function(e){return!Kl.isDisabled(e.playlist)})).filter(function(e){return e.bandwidth*nc.BANDWIDTH_VARIANCE<t}),c=a[a.length-1],s=a.filter(function(e){return e.bandwidth===c.bandwidth})[0];if(!1===r){var u=s||e[0]||l[0];return u&&u.playlist?(r=s?"bandwidthBestRep":"sortedPlaylistReps",e[0]&&(r="enabledPlaylistReps"),hc("choosing "+Er(u)+" using "+r+" with options",o),u.playlist):(hc("could not choose a playlist with options",o),null)}u=a.filter(function(e){return e.width&&e.height}),Ir(u,function(e,t){return e.width-t.width});var d,h,a=u.filter(function(e){return e.width===i&&e.height===n}),c=a[a.length-1],a=a.filter(function(e){return e.bandwidth===c.bandwidth})[0];a||(p=(d=u.filter(function(e){return e.width>i||e.height>n})).filter(function(e){return e.width===d[0].width&&e.height===d[0].height}),c=p[p.length-1],h=p.filter(function(e){return e.bandwidth===c.bandwidth})[0]);var p=h||a||s||e[0]||l[0];return p&&p.playlist?(l="sortedPlaylistReps",h?l="resolutionPlusOneRep":a?l="resolutionBestRep":s?l="bandwidthBestRep":e[0]&&(l="enabledPlaylistReps"),hc("choosing "+Er(p)+" using "+l+" with options",o),p.playlist):(hc("could not choose a playlist with options",o),null)}}function Lr(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var a=la.WebKitDataCue||la.VTTCue,o=t.metadataTrack_;if(o&&(i.forEach(function(e){var t=e.cueTime+n;!("number"!=typeof t||la.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach(function(e){var i,n=new a(t,t,e.value||e.url||e.data||"");n.frame=e,n.value=e,i=n,Object.defineProperties(i.frame,{id:{get:function(){return mt.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get:function(){return mt.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get:function(){return mt.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}}),o.addCue(n)})}),o.cues&&o.cues.length)){for(var s=o.cues,l=[],c=0;c<s.length;c++)s[c]&&l.push(s[c]);var u=l.reduce(function(e,t){var i=e[t.startTime]||[];return i.push(t),e[t.startTime]=i,e},{}),d=Object.keys(u).sort(function(e,t){return Number(e)-Number(t)});d.forEach(function(e,t){var e=u[e],i=Number(d[t+1])||r;e.forEach(function(e){e.endTime=i})})}}}function Or(e,t,i){var n,r;if(i&&i.cues)for(n=i.cues.length;n--;)(r=i.cues[n]).startTime>=e&&r.endTime<=t&&i.removeCue(r)}function Nr(e){return"number"==typeof e&&isFinite(e)}function Pr(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,a=e.playlist,o=a.mediaSequence,s=a.id,l=a.segments,c=e.mediaIndex,u=e.partIndex,d=e.timeline,h=(void 0===l?[]:l).length-1,p="mediaIndex/partIndex increment";return e.getMediaInfoForTime?p="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(p="getSyncSegmentCandidate (isSyncRequest)"),a="number"==typeof u,l=e.segment.uri?"segment":"pre-segment",e=a?wn({preloadSegment:n})-1:0,l+" ["+(o+c)+"/"+(o+h)+"]"+(a?" part ["+u+"/"+e+"]":"")+" segment start/end ["+n.start+" => "+n.end+"]"+(a?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+d+"] selected by ["+p+"] playlist ["+s+"]"}function Rr(e){return e+"TimingInfo"}function jr(e){var t=e.timelineChangeController,i=e.currentTimeline,n=e.segmentTimeline,r=e.loaderType,e=e.audioDisabled;if(i!==n){if("audio"===r)return!(i=t.lastTimelineChange({type:"main"}))||i.to!==n;if("main"===r&&e)return!(t=t.pendingTimelineChange({type:"audio"}))||t.to!==n}}function zr(e){var t=e.segmentDuration,e=e.maxDuration;return!!t&&Math.round(t)>e+Gl}function Fr(e,t){if("hls"!==t)return null;var i=function(e,t){return e=e&&"number"==typeof e.start&&"number"==typeof e.end?e.end-e.start:0,t=t&&"number"==typeof t.start&&"number"==typeof t.end?t.end-t.start:0,Math.max(e,t)}(e.audioTimingInfo,e.videoTimingInfo);if(!i)return null;var n=e.playlist.targetDuration,r=zr({segmentDuration:i,maxDuration:2*n}),t=zr({segmentDuration:i,maxDuration:n}),n="Segment with index "+e.mediaIndex+" from playlist "+e.playlist.id+" has a duration of "+i+" when the reported duration is "+e.duration+" and the target duration is "+n+". For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";return r||t?{severity:r?"warn":"info",message:n}:null}function Br(){}function Ur(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase()})}function $r(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]}function qr(e,t){if(0!==t.queue.length){var i=0,n=t.queue[i];if("mediaSource"!==n.type){if("mediaSource"!==e&&t.ready()&&"closed"!==t.mediaSource.readyState&&!$r(e,t)){if(n.type!==e){if(null===(i=function(e,t){for(var i=0;i<t.length;i++){var n=t[i];if("mediaSource"===n.type)return null;if(n.type===e)return i}return null}(e,t.queue)))return;n=t.queue[i]}t.queue.splice(i,1),(t.queuePending[e]=n).action(e,t),n.doneFn||(t.queuePending[e]=null,qr(e,t))}}else t.updating()||"closed"===t.mediaSource.readyState||(t.queue.shift(),n.action(t),n.doneFn&&n.doneFn(),qr("audio",t),qr("video",t))}}function Hr(e,t){var i=t[e+"Buffer"],n=Ur(e);i&&(i.removeEventListener("updateend",t["on"+n+"UpdateEnd_"]),i.removeEventListener("error",t["on"+n+"Error_"]),t.codecs[e]=null,t[e+"Buffer"]=null)}function Wr(e,t){return e&&t&&-1!==Array.prototype.indexOf.call(e.sourceBuffers,t)}function Vr(e){var t=e.type,i=e.sourceUpdater,n=e.action,r=e.doneFn,e=e.name;i.queue.push({type:t,action:n,doneFn:r,name:e}),qr(t,i)}function Gr(e,t){return function(i){var n;t.queuePending[e]&&(n=t.queuePending[e].doneFn,t.queuePending[e]=null,n&&n(t[e+"Error_"])),qr(e,t)}}function Yr(e){return decodeURIComponent(escape(String.fromCharCode.apply(null,e)))}function Kr(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)}function Xr(e,t){(t.activePlaylistLoader=e).load()}function Qr(e,t){for(var i=0;i<e.length;i++){if(Ln(t,e[i]))return!0;if(e[i].playlists&&Qr(e[i].playlists,t))return!0}return!1}function Zr(e){function t(){n.AUDIO.onTrackChanged(),a.trigger({type:"usage",name:"vhs-audio-change"}),a.trigger({type:"usage",name:"hls-audio-change"})}["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(t){Nc[t](t,e)});var i,n=e.mediaTypes,r=e.masterPlaylistLoader,a=e.tech,o=e.vhs,s=e.segmentLoaders,l=s.AUDIO,c=s.main;for(i in["AUDIO","SUBTITLES"].forEach(function(t){var i,r,a,o,s,l,c,u,d,h;n[t].activeGroup=(i=t,r=e,function(e){var t=r.masterPlaylistLoader,n=r.mediaTypes[i].groups,a=t.media();if(!a)return null;var o=null;a.attributes[i]&&(o=n[a.attributes[i]]);var s=Object.keys(n);if(!o)if("AUDIO"===i&&1<s.length&&Nn(r.master))for(var l=0;l<s.length;l++){var c=n[s[l]];if(Qr(c,a)){o=c;break}}else n.main?o=n.main:1===s.length&&(o=n[s[0]]);return void 0===e?o:null!==e&&o&&o.filter(function(t){return t.id===e.id})[0]||null}),n[t].activeTrack=Pc[t](t,e),n[t].onGroupChanged=(a=t,o=e,function(){var e=o.segmentLoaders,t=e[a],i=e.main,n=o.mediaTypes[a],r=n.activeTrack(),s=n.getActiveGroup(),l=n.activePlaylistLoader,e=n.lastGroup_;s&&e&&s.id===e.id||(n.lastGroup_=s,n.lastTrack_=r,Kr(t,n),s&&!s.isMasterPlaylist&&(s.playlistLoader?(t.resyncLoader(),Xr(s.playlistLoader,n)):l&&i.resetEverything()))}),n[t].onGroupChanging=(s=t,l=e,function(){var e=l.segmentLoaders[s];l.mediaTypes[s].lastGroup_=null,e.abort(),e.pause()}),n[t].onTrackChanged=(c=t,u=e,function(){var e=u.masterPlaylistLoader,t=u.segmentLoaders,i=t[c],n=t.main,r=u.mediaTypes[c],a=r.activeTrack(),o=r.getActiveGroup(),s=r.activePlaylistLoader,l=r.lastTrack_;if((!l||!a||l.id!==a.id)&&(r.lastGroup_=o,r.lastTrack_=a,Kr(i,r),o)){if(o.isMasterPlaylist){if(!a||!l||a.id===l.id)return;var d=u.vhs.masterPlaylistController_,t=d.selectPlaylist();return d.media()===t?void 0:(r.logger_("track change. Switching master audio from "+l.id+" to "+a.id),e.pause(),n.resetEverything(),void d.fastQualityChange_(t))}if("AUDIO"===c){if(!o.playlistLoader)return n.setAudio(!0),void n.resetEverything();i.setAudio(!0),n.setAudio(!1)}s!==o.playlistLoader&&(i.track&&i.track(a),i.resetEverything()),Xr(o.playlistLoader,r)}}),n[t].getActiveGroup=(d=t,h=e.mediaTypes,function(){var e=h[d].activeTrack();return e?h[d].activeGroup(e):null})}),(s=n.AUDIO.activeGroup())&&(s=(s.filter(function(e){return e.default})[0]||s[0]).id,n.AUDIO.tracks[s].enabled=!0,n.AUDIO.onGroupChanged(),n.AUDIO.onTrackChanged(),n.AUDIO.getActiveGroup().playlistLoader?(c.setAudio(!1),l.setAudio(!0)):c.setAudio(!0)),r.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(e){return n[e].onGroupChanged()})}),r.on("mediachanging",function(){["AUDIO","SUBTITLES"].forEach(function(e){return n[e].onGroupChanging()})}),a.audioTracks().addEventListener("change",t),a.remoteTextTracks().addEventListener("change",n.SUBTITLES.onTrackChanged),o.on("dispose",function(){a.audioTracks().removeEventListener("change",t),a.remoteTextTracks().removeEventListener("change",n.SUBTITLES.onTrackChanged)}),a.clearTracks("audio"),n.AUDIO.tracks)a.audioTracks().addTrack(n.AUDIO.tracks[i])}function Jr(e,t,i){var n,r,a,o,s=e.masterPlaylistController_,l=s[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(s);t.attributes&&(n=t.attributes.RESOLUTION,this.width=n&&n.width,this.height=n&&n.height,this.bandwidth=t.attributes.BANDWIDTH),this.codecs=Sr(s.master(),t),this.playlist=t,this.id=i,this.enabled=(r=e.playlists,a=t.id,o=l,function(e){var t=r.master.playlists[a],i=An(t),n=In(t);return void 0===e?n:(e?delete t.disabled:t.disabled=!0,e===n||i||(o(),e?r.trigger("renditionenabled"):r.trigger("renditiondisabled")),e)})}function ea(e,t){function i(){s&&e.currentTime(s)}function n(t){null!=t&&(s=e.duration()!==1/0&&e.currentTime()||0,e.one("loadedmetadata",i),e.src(t),e.trigger({type:"usage",name:"vhs-error-reload"}),e.trigger({type:"usage",name:"hls-error-reload"}),e.play())}function r(){return Date.now()-o<1e3*l.errorInterval?(e.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void e.trigger({type:"usage",name:"hls-error-reload-canceled"})):l.getSource&&"function"==typeof l.getSource?(o=Date.now(),l.getSource.call(e,n)):void mt.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}function a(){e.off("loadedmetadata",i),e.off("error",r),e.off("dispose",a)}var o=0,s=0,l=mt.mergeOptions(Bc,t);e.ready(function(){e.trigger({type:"usage",name:"vhs-error-reload-initialized"}),e.trigger({type:"usage",name:"hls-error-reload-initialized"})}),e.on("error",r),e.on("dispose",a),e.reloadSourceOnError=function(t){a(),ea(e,t)}}function ta(e,t){for(var i=t.media(),n=-1,r=0;r<e.length;r++)if(e[r].id===i.id){n=r;break}e.selectedIndex_=n,e.trigger({selectedIndex:n,type:"change"})}function ia(e){var t=e.player,i=e.sourceKeySystems,n=e.audioMedia,e=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var r,e=(e=e=n?e.concat([n]):e,r=Object.keys(i),e.reduce(function(e,t){if(!t.contentProtection)return e;var i=r.reduce(function(e,i){var n=t.contentProtection[i];return n&&n.pssh&&(e[i]={pssh:n.pssh}),e},{});return Object.keys(i).length&&e.push(i),e},[])),a=[],o=[];return e.forEach(function(e){o.push(new Promise(function(e,i){t.tech_.one("keysessioncreated",e)})),a.push(new Promise(function(i,n){t.eme.initializeMediaKeys({keySystems:e},function(e){e?n(e):i()})}))}),Promise.race([Promise.all(a),Promise.race(o)])}function na(e){var t=e.player;return!(!(e=function(e,t,i){if(!e)return e;var n={};t&&t.attributes&&t.attributes.CODECS&&(n=Cr(kt(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);var r,a=Tt(n.video),o=Tt(n.audio),s={};for(r in e)s[r]={},o&&(s[r].audioContentType=o),a&&(s[r].videoContentType=a),t.contentProtection&&t.contentProtection[r]&&t.contentProtection[r].pssh&&(s[r].pssh=t.contentProtection[r].pssh),"string"==typeof e[r]&&(s[r].url=e[r]);return mt.mergeOptions(e,s)}(e.sourceKeySystems,e.media,e.audioMedia))||(t.currentSource().keySystems=e)&&!t.eme&&(mt.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1))}function ra(){if(!la.localStorage)return null;var e=la.localStorage.getItem($c);if(!e)return null;try{return JSON.parse(e)}catch(e){return null}}for(var aa,oa="7.14.3",sa="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},la="undefined"!=typeof window?window:void 0!==sa?sa:"undefined"!=typeof self?self:{},ca=void 0!==sa?sa:"undefined"!=typeof window?window:{},ua="undefined"!=typeof document?document:(ua=ca["__GLOBAL_DOCUMENT_CACHE@4"])||(ca["__GLOBAL_DOCUMENT_CACHE@4"]={}),da=ua,ha={prefixed:!0},pa=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],fa=pa[0],ma=0;ma<pa.length;ma++)if(pa[ma][1]in da){aa=pa[ma];break}if(aa){for(var ga=0;ga<aa.length;ga++)ha[fa[ga]]=aa[ga];ha.prefixed=aa[0]!==fa[0]}var va,ya=[],_a=function(e,t){return function(i,n,r){var a,o=t.levels[n],n=new RegExp("^("+o+")$");"log"!==i&&r.unshift(i.toUpperCase()+":"),r.unshift(e+":"),ya&&(ya.push([].concat(r)),a=ya.length-1e3,ya.splice(0,0<a?a:0)),!la.console||(a=(a=la.console[i])||"debug"!==i?a:la.console.info||la.console.log)&&o&&n.test(i)&&a[Array.isArray(r)?"apply":"call"](la.console,r)}},ba=function e(t){function i(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];r("log",n,t)}var n="info",r=_a(t,i);return i.createLogger=function(i){return e(t+": "+i)},i.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},i.level=function(e){if("string"==typeof e){if(!i.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(i.history=function(){return ya?[].concat(ya):[]}).filter=function(e){return(ya||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0])})},i.history.clear=function(){ya&&(ya.length=0)},i.history.disable=function(){null!==ya&&(ya.length=0,ya=null)},i.history.enable=function(){null===ya&&(ya=[])},i.error=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r("error",n,t)},i.warn=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r("warn",n,t)},i.debug=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r("debug",n,t)},i}("VIDEOJS"),wa=ba.createLogger,xa=e(function(e){function t(){return e.exports=t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i,n=arguments[t];for(i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},t.apply(this,arguments)}e.exports=t}),ka=Object.prototype.toString,Ca=function(e){return n(e)?Object.keys(e):[]},Ta=la.navigator&&la.navigator.userAgent||"",Sa=/AppleWebKit\/([\d.]+)/i.exec(Ta),Ea=Sa?parseFloat(Sa.pop()):null,Aa=/iPod/i.test(Ta),Ia=(Ao=Ta.match(/OS (\d+)_/i))&&Ao[1]?Ao[1]:null,Da=/Android/i.test(Ta),Ma=function(){var e=Ta.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),i=e[2]&&parseFloat(e[2]);return t&&i?parseFloat(e[1]+"."+e[2]):t||null}(),La=Da&&Ma<5&&Ea<537,Oa=/Firefox/i.test(Ta),Na=/Edg/i.test(Ta),Pa=!Na&&(/Chrome/i.test(Ta)||/CriOS/i.test(Ta)),Ra=(No=Ta.match(/(Chrome|CriOS)\/(\d+)/))&&No[2]?parseFloat(No[2]):null,ja=Po=!(Po=(Po=/MSIE\s(\d+)\.\d/.exec(Ta))&&parseFloat(Po[1]))&&/Trident\/7.0/i.test(Ta)&&/rv:11.0/.test(Ta)?11:Po,za=/Safari/i.test(Ta)&&!Pa&&!Da&&!Na,Fa=/Windows/i.test(Ta),Ba=Boolean(l()&&("ontouchstart"in la||la.navigator.maxTouchPoints||la.DocumentTouch&&la.document instanceof la.DocumentTouch)),Ua=/iPad/i.test(Ta)||za&&Ba&&!/iPhone/i.test(Ta),$a=/iPhone/i.test(Ta)&&!Ua,qa=$a||Ua||Aa,Ha=(za||qa)&&!Pa,Wa=Object.freeze({__proto__:null,IS_IPOD:Aa,IOS_VERSION:Ia,IS_ANDROID:Da,ANDROID_VERSION:Ma,IS_NATIVE_ANDROID:La,IS_FIREFOX:Oa,IS_EDGE:Na,IS_CHROME:Pa,CHROME_VERSION:Ra,IE_VERSION:ja,IS_SAFARI:za,IS_WINDOWS:Fa,TOUCH_ENABLED:Ba,IS_IPAD:Ua,IS_IPHONE:$a,IS_IOS:qa,IS_ANY_SAFARI:Ha}),Va=d("querySelector"),Ga=d("querySelectorAll"),Ya=Object.freeze({__proto__:null,isReal:l,isEl:c,isInFrame:u,createEl:h,textContent:p,prependTo:f,hasClass:m,addClass:g,removeClass:v,toggleClass:y,setAttributes:_,getAttributes:b,getAttribute:w,setAttribute:x,removeAttribute:k,blockTextSelection:C,unblockTextSelection:T,getBoundingClientRect:S,findPosition:E,getPointerPosition:A,isTextNode:I,emptyEl:D,normalizeContent:M,appendContent:L,insertContent:O,isSingleLeftClick:N,$:Va,$$:Ga}),Ka=!1,Xa=function(){if(!1!==va.options.autoSetup){var e=Array.prototype.slice.call(da.getElementsByTagName("video")),t=Array.prototype.slice.call(da.getElementsByTagName("audio")),i=Array.prototype.slice.call(da.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&0<n.length)for(var r=0,a=n.length;r<a;r++){var o=n[r];if(!o||!o.getAttribute){P(1);break}void 0===o.player&&null!==o.getAttribute("data-setup")&&va(o)}else Ka||P(1)}};l()&&("complete"===da.readyState?R():la.addEventListener("load",R));var Qa=3;la.WeakMap||(cs=function(){function e(){this.vdata="vdata"+Math.floor(la.performance&&la.performance.now()||Date.now()),this.data={}}var t=e.prototype;return t.set=function(e,t){var i=e[this.vdata]||Qa++;return e[this.vdata]||(e[this.vdata]=i),this.data[i]=t,this},t.get=function(e){var t=e[this.vdata];if(t)return this.data[t];ba("We have no data for this element",e)},t.has=function(e){return e[this.vdata]in this.data},t.delete=function(e){var t=e[this.vdata];t&&(delete this.data[t],delete e[this.vdata])},e}());var Za,Ja,eo=new(la.WeakMap?WeakMap:cs),to=function(){if("boolean"!=typeof Za){Za=!1;try{var e=Object.defineProperty({},"passive",{get:function(){Za=!0}});la.addEventListener("test",null,e),la.removeEventListener("test",null,e)}catch(e){}}return Za},io=["touchstart","touchmove"],no=Object.freeze({__proto__:null,fixEvent:U,on:$,off:q,trigger:H,one:W,any:V});X.prototype.allowedEvents_={},X.prototype.addEventListener=X.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},$(this,e,t),this.addEventListener=i},X.prototype.removeEventListener=X.prototype.off=function(e,t){q(this,e,t)},X.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},W(this,e,t),this.addEventListener=i},X.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},V(this,e,t),this.addEventListener=i},X.prototype.dispatchEvent=X.prototype.trigger=function(e){var t=e.type||e;e=U(e="string"==typeof e?{type:t}:e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),H(this,e)},X.prototype.queueTrigger=function(e){var t=this;Ja=Ja||new Map;var i=e.type||e,n=Ja.get(this);n||(n=new Map,Ja.set(this,n));var r=n.get(i);n.delete(i),la.clearTimeout(r),
|
||
r=la.setTimeout(function(){0===n.size&&(n=null,Ja.delete(t)),t.trigger(e)},0),n.set(i,r)};var ro=function(e){return e instanceof X||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},ao={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r,a=ie(this,i,"on"),o=a.isTargetingSelf,s=a.target,l=a.type,c=a.listener;ne(s,"on",l,c),o||((r=function(){return e.off(s,l,c)}).guid=c.guid,(o=function(){return e.off("dispose",r)}).guid=c.guid,ne(this,"on","dispose",r),ne(s,"on","dispose",o))},one:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ie(this,i,"one"),a=r.isTargetingSelf,o=r.target,s=r.type,l=r.listener;a?ne(o,"one",s,l):((a=function t(){e.off(o,s,t);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];l.apply(null,n)}).guid=l.guid,ne(o,"one",s,a))},any:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];var r=ie(this,i,"any"),a=r.isTargetingSelf,o=r.target,s=r.type,l=r.listener;a?ne(o,"any",s,l):((a=function t(){e.off(o,s,t);for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];l.apply(null,n)}).guid=l.guid,ne(o,"any",s,a))},off:function(e,t,i){!e||Z(e)?q(this.eventBusEl_,e,t):(t=t,J(e=e,this,"off"),ee(t,this,"off"),te(i,this,"off"),i=G(this,i),this.off("dispose",i),e.nodeName?(q(e,t,i),q(e,"dispose",i)):ro(e)&&(e.off(t,i),e.off("dispose",i)))},trigger:function(e,t){J(this.eventBusEl_,this,"trigger");var i=e&&"string"!=typeof e?e.type:e;if(!Z(i)){if(i="Invalid event type for "+Q(this)+"#trigger; must be a non-empty string or object with a type key that has a non-empty value.",!e)throw new Error(i);(this.log||ba).error(i)}return H(this.eventBusEl_,e,t)}},oo={state:{},setState:function(e){var i,n=this;return t(e="function"==typeof e?e():e,function(e,t){n.state[t]!==e&&((i=i||{})[t]={from:n.state[t],to:e}),n.state[t]=e}),i&&ro(this)&&this.trigger({changes:i,type:"statechanged"}),i}},so=la.Map||function(){function e(){this.map_={}}var t=e.prototype;return t.has=function(e){return e in this.map_},t.delete=function(e){var t=this.has(e);return delete this.map_[e],t},t.set=function(e,t){return this.map_[e]=t,this},t.forEach=function(e,t){for(var i in this.map_)e.call(t,this.map_[i],i,this)},e}(),lo=la.Set||function(){function e(){this.set_={}}var t=e.prototype;return t.has=function(e){return e in this.set_},t.delete=function(e){var t=this.has(e);return delete this.set_[e],t},t.add=function(e){return this.set_[e]=1,this},t.forEach=function(e,t){for(var i in this.set_)e.call(t,i,i,this)},e}(),co=function(){function e(e,t,i){!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=le({},this.options_),t=this.options_=le(this.options_,t),this.id_=t.id||t.el&&t.el.id,this.id_||(e=e&&e.id&&e.id()||"no_player",this.id_=e+"_component_"+Qa++),this.name_=t.name||null,t.el?this.el_=t.el:!1!==t.createEl&&(this.el_=this.createEl()),!1!==t.evented&&(re(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),ae(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new lo,this.setIntervalIds_=new lo,this.rafIds_=new lo,this.namedRafs_=new so,(this.clearingTimersOnDispose_=!1)!==t.initChildren&&this.initChildren(),this.ready(i),!1!==t.reportTouchActivity&&this.enableTouchActivity()}var t=e.prototype;return t.dispose=function(){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(var e=this.children_.length-1;0<=e;e--)this.children_[e].dispose&&this.children_[e].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),eo.has(this.el_)&&eo.delete(this.el_),this.el_=null),this.player_=null}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e&&(this.options_=le(this.options_,e)),this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return h(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],n=n&&n.split("-")[0],n=r&&r[n],i=i;return a&&a[e]?i=a[e]:n&&n[e]&&(i=n[e]),i=t?i.replace(/\{(\d+)\}/g,function(e,i){return i=t[i-1],void 0===i?e:i}):i},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];for(var t=t.reduce(function(e,t){return e.concat(t)},[]),n=this,r=0;r<t.length;r++)if(!(n=n.getChild(t[r]))||!n.getChild)return;return n},t.addChild=function(t,i,n){if(void 0===i&&(i={}),void 0===n&&(n=this.children_.length),"string"==typeof t){var r=se(t),a=i.componentClass||r;i.name=r;var o=e.getComponent(a);if(!o)throw new Error("Component "+a+" does not exist");if("function"!=typeof o)return null;o=new o(this.player_||this,i)}else o=t;return o.parentComponent_&&o.parentComponent_.removeChild(o),this.children_.splice(n,0,o),o.parentComponent_=this,"function"==typeof o.id&&(this.childIndex_[o.id()]=o),(r=r||o.name&&se(o.name()))&&(this.childNameIndex_[r]=o,this.childNameIndex_[oe(r)]=o),"function"==typeof o.el&&o.el()&&(r=null,this.children_[n+1]&&(this.children_[n+1].el_?r=this.children_[n+1].el_:c(this.children_[n+1])&&(r=this.children_[n+1])),this.contentEl().insertBefore(o.el(),r)),o},t.removeChild=function(e){if((e="string"==typeof e?this.getChild(e):e)&&this.children_){for(var t,i=!1,n=this.children_.length-1;0<=n;n--)if(this.children_[n]===e){i=!0,this.children_.splice(n,1);break}i&&(e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[se(e.name())]=null,this.childNameIndex_[oe(e.name())]=null,(t=e.el())&&t.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el()))}},t.initChildren=function(){var t,i,n,r=this,a=this.options_.children;a&&(t=this.options_,i=e.getComponent("Tech"),(n=Array.isArray(a)?a:Object.keys(a)).concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var t,e="string"==typeof e?a[t=e]||r.options_[t]||{}:(t=e.name,e);return{name:t,opts:e}}).filter(function(t){return(t=e.getComponent(t.opts.componentClass||se(t.name)))&&!i.isTech(t)}).forEach(function(e){var i=e.name,e=e.opts;!1!==(e=void 0!==t[i]?t[i]:e)&&((e=!0===e?{}:e).playerOptions=r.options_.playerOptions,(e=r.addChild(i,e))&&(r[i]=e))}))},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&0<e.length&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},t.$=function(e,t){return Va(e,t||this.contentEl())},t.$$=function(e,t){return Ga(e,t||this.contentEl())},t.hasClass=function(e){return m(this.el_,e)},t.addClass=function(e){g(this.el_,e)},t.removeClass=function(e){v(this.el_,e)},t.toggleClass=function(e,t){y(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return w(this.el_,e)},t.setAttribute=function(e,t){x(this.el_,e,t)},t.removeAttribute=function(e){k(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){return void 0!==t?(-1!==(""+(t=null===t||t!=t?0:t)).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"))):this.el_?(t=this.el_.style[e],i=t.indexOf("px"),-1!==i?parseInt(t.slice(0,i),10):parseInt(this.el_["offset"+se(e)],10)):0},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");return t=a(this.el_,e),0!==(t=parseFloat(t))&&!isNaN(t)||(e="offset"+se(e),t=this.el_[e]),t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){function e(){t=!1}var t,i=0,n=null;this.on("touchstart",function(e){1===e.touches.length&&(n={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY},i=la.performance.now(),t=!0)}),this.on("touchmove",function(e){var i;1<e.touches.length?t=!1:n&&(i=e.touches[0].pageX-n.pageX,e=e.touches[0].pageY-n.pageY,10<Math.sqrt(i*i+e*e)&&(t=!1))}),this.on("touchleave",e),this.on("touchcancel",e),this.on("touchend",function(e){!(n=null)===t&&la.performance.now()-i<200&&(e.preventDefault(),this.trigger("tap"))})},t.enableTouchActivity=function(){var e,t,i;this.player()&&this.player().reportUserActivity&&(e=G(this.player(),this.player().reportUserActivity),this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)}),i=function(i){e(),this.clearInterval(t)},this.on("touchmove",e),this.on("touchend",i),this.on("touchcancel",i))},t.setTimeout=function(e,t){var i,n=this;return e=G(this,e),this.clearTimersOnDispose_(),i=la.setTimeout(function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),la.clearTimeout(e)),e},t.setInterval=function(e,t){return e=G(this,e),this.clearTimersOnDispose_(),t=la.setInterval(e,t),this.setIntervalIds_.add(t),t},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),la.clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=G(this,e),t=la.requestAnimationFrame(function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()}),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=G(this,t);var n=this.requestAnimationFrame(function(){t(),i.namedRafs_.has(e)&&i.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),la.cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var i=t[0],n=t[1];e[i].forEach(function(t,i){return e[n](i)})}),e.clearingTimersOnDispose_=!1}))},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n=e.getComponent("Tech"),r=n&&n.isTech(i),n=e===i||e.prototype.isPrototypeOf(i.prototype);if(r||!n){var a=r?"techs must be registered using Tech.registerTech()":"must be a Component subclass";throw new Error('Illegal component, "'+t+'"; '+a+".")}if(t=se(t),e.components_||(e.components_={}),a=e.getComponent("Player"),"Player"===t&&a&&a.players){var o=a.players,a=Object.keys(o);if(o&&0<a.length&&a.map(function(e){return o[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[oe(t)]=i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();co.prototype.supportsRaf_="function"==typeof la.requestAnimationFrame&&"function"==typeof la.cancelAnimationFrame,co.registerComponent("Component",co);var uo=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},ho=function(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t};pe.prototype.code=0,pe.prototype.message="",pe.prototype.status=null,pe.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],pe.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var po=0;po<pe.errorTypes.length;po++)pe[pe.errorTypes[po]]=po,pe.prototype[pe.errorTypes[po]]=po;var fo=function(e,t){var i,n=null;try{i=JSON.parse(e,t)}catch(e){n=e}return[n,i]},mo=function(e){var t=e.$$("track"),i=Array.prototype.map.call(t,function(e){return e.track});return Array.prototype.map.call(t,function(e){var t=ge(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===i.indexOf(e)}).map(ge))},go=function(e,t){return e.forEach(function(e){var i=t.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(function(e){return i.addCue(e)})}),t.textTracks()},vo=e(function(e,t){function i(e){if(!e||"object"!=typeof e||(t=e.which||e.keyCode||e.charCode)&&(e=t),"number"==typeof e)return s[e];var t=String(e),e=n[t.toLowerCase()];return e||((e=r[t.toLowerCase()])?e:1===t.length?t.charCodeAt(0):void 0)}i.isEventKey=function(e,t){if(e&&"object"==typeof e){var i=e.which||e.keyCode||e.charCode;if(null==i)return!1;if("string"==typeof t){if(e=n[t.toLowerCase()])return e===i;if(e=r[t.toLowerCase()])return e===i}else if("number"==typeof t)return t===i;return!1}};for(var n=(t=e.exports=i).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91},a=97;a<123;a++)n[String.fromCharCode(a)]=a-32;for(var a=48;a<58;a++)n[a-48]=a;for(a=1;a<13;a++)n["f"+a]=a+111;for(a=0;a<10;a++)n["numpad "+a]=a+96;var o,s=t.names=t.title={};for(a in n)s[n[a]]=a;for(o in r)n[o]=r[o]});vo.code,vo.codes,vo.aliases,vo.names,vo.title;var yo="vjs-modal-dialog",_o=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.close_=function(e){return n.close(e)},n.opened_=n.hasBeenOpened_=n.hasBeenFilled_=!1,n.closeable(!n.options_.uncloseable),n.content(n.options_.content),n.contentEl_=h("div",{className:yo+"-content"},{role:"document"}),n.descEl_=h("p",{className:yo+"-description vjs-control-text",id:n.el().getAttribute("aria-describedby")}),p(n.descEl_,n.description()),n.el_.appendChild(n.descEl_),n.el_.appendChild(n.contentEl_),n}ho(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},i.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return yo+" vjs-hidden "+e.prototype.buildCSSClass.call(this)},i.label=function(){return this.localize(this.options_.label||"Modal Window")},i.description=function(){var e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e},i.open=function(){var e;this.opened_||(e=this.player(),this.trigger("beforemodalopen"),this.opened_=!0,!this.options_.fillAlways&&(this.hasBeenOpened_||this.hasBeenFilled_)||this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0)},i.opened=function(e){return"boolean"==typeof e&&this[e?"open":"close"](),this.opened_},i.close=function(){var e;this.opened_&&(e=this.player(),this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose())},i.closeable=function(e){var t,i;return"boolean"==typeof e&&(t=this.closeable_=!!e,i=this.getChild("closeButton"),t&&!i&&(e=this.contentEl_,this.contentEl_=this.el_,i=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=e,this.on(i,"close",this.close_)),!t&&i&&(this.off(i,"close",this.close_),this.removeChild(i),i.dispose())),this.closeable_},i.fill=function(){this.fillWith(this.content())},i.fillWith=function(e){var t=this.contentEl(),i=t.parentNode,n=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(t),this.empty(),O(t,e),this.trigger("modalfill"),n?i.insertBefore(t,n):i.appendChild(t),(t=this.getChild("closeButton"))&&i.appendChild(t.el_)},i.empty=function(){this.trigger("beforemodalempty"),D(this.contentEl()),this.trigger("modalempty")},i.content=function(e){return void 0!==e&&(this.content_=e),this.content_},i.conditionalFocus_=function(){var e=da.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,!t.contains(e)&&t!==e||(this.previouslyActiveEl_=e,this.focus())},i.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)},i.handleKeyDown=function(e){if(e.stopPropagation(),vo.isEventKey(e,"Escape")&&this.closeable())return e.preventDefault(),void this.close();if(vo.isEventKey(e,"Tab")){for(var t,i=this.focusableEls_(),n=this.el_.querySelector(":focus"),r=0;r<i.length;r++)if(n===i[r]){t=r;break}da.activeElement===this.el_&&(t=0),e.shiftKey&&0===t?(i[i.length-1].focus(),e.preventDefault()):e.shiftKey||t!==i.length-1||(i[0].focus(),e.preventDefault())}},i.focusableEls_=function(){var e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,function(e){return(e instanceof la.HTMLAnchorElement||e instanceof la.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof la.HTMLInputElement||e instanceof la.HTMLSelectElement||e instanceof la.HTMLTextAreaElement||e instanceof la.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof la.HTMLIFrameElement||e instanceof la.HTMLObjectElement||e instanceof la.HTMLEmbedElement||e.hasAttribute("tabindex")&&-1!==e.getAttribute("tabindex")||e.hasAttribute("contenteditable")})},t}(co);_o.prototype.options_={pauseOnOpen:!0,temporary:!0},co.registerComponent("ModalDialog",_o);var bo,wo=function(e){function t(t){var i;void 0===t&&(t=[]),(i=e.call(this)||this).tracks_=[],Object.defineProperty(uo(i),"length",{get:function(){return this.tracks_.length}});for(var n=0;n<t.length;n++)i.addTrack(t[n]);return i}ho(t,e);var i=t.prototype;return i.addTrack=function(e){var t=this,i=this.tracks_.length;""+i in this||Object.defineProperty(this,i,{get:function(){return this.tracks_[i]}}),-1===this.tracks_.indexOf(e)&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=function(){t.trigger({track:e,type:"labelchange",target:t})},ro(e)&&e.addEventListener("labelchange",e.labelchange_)},i.removeTrack=function(e){for(var t,i=0,n=this.length;i<n;i++)if(this[i]===e){(t=this[i]).off&&t.off(),this.tracks_.splice(i,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})},i.getTrackById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},t}(X);for(bo in wo.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"},wo.prototype.allowedEvents_)wo.prototype["on"+bo]=null;var xo=function(e){function t(t){for(var i,n=(t=void 0===t?[]:t).length-1;0<=n;n--)if(t[n].enabled){ve(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}ho(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&ve(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,ve(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(wo),sa=function(e){function t(t){for(var i,n=(t=void 0===t?[]:t).length-1;0<=n;n--)if(t[n].selected){ye(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(uo(i),"selectedIndex",{get:function(){for(var e=0;e<this.length;e++)if(this[e].selected)return e;return-1},set:function(){}}),i}ho(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.selected&&ye(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.selectedChange_=function(){i.changing_||(i.changing_=!0,ye(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)},t}(wo),ca=function(e){function t(){return e.apply(this,arguments)||this}ho(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;e.prototype.addTrack.call(this,t),this.queueChange_||(this.queueChange_=function(){return i.queueTrigger("change")}),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=function(){return i.trigger("selectedlanguagechange")}),t.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",this.triggerSelectedlanguagechange_)},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&(this.queueChange_&&t.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&t.removeEventListener("modechange",this.triggerSelectedlanguagechange_))},t}(wo),ua=function(){function e(e){void 0===e&&(e=[]),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var t=0,i=e.length;t<i;t++)this.addTrackElement_(e[t])}var t=e.prototype;return t.addTrackElement_=function(e){var t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get:function(){return this.trackElements_[t]}}),-1===this.trackElements_.indexOf(e)&&this.trackElements_.push(e)},t.getTrackElementByTrack_=function(e){for(var t,i=0,n=this.trackElements_.length;i<n;i++)if(e===this.trackElements_[i].track){t=this.trackElements_[i];break}return t},t.removeTrackElement_=function(e){for(var t=0,i=this.trackElements_.length;t<i;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&"function"==typeof this.trackElements_[t].track.off&&this.trackElements_[t].track.off(),"function"==typeof this.trackElements_[t].off&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}},e}(),ko=function(){function e(t){e.prototype.setCues_.call(this,t),Object.defineProperty(this,"length",{get:function(){return this.length_}})}var t=e.prototype;return t.setCues_=function(e){function t(e){""+e in this||Object.defineProperty(this,""+e,{get:function(){return this.cues_[e]}})}var i=this.length||0,n=0,r=e.length;if(this.cues_=e,this.length_=e.length,i<r)for(n=i;n<r;n++)t.call(this,n)},t.getCueById=function(e){for(var t=null,i=0,n=this.length;i<n;i++){var r=this[i];if(r.id===e){t=r;break}}return t},e}(),Co={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},To={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},So={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Eo={disabled:"disabled",hidden:"hidden",showing:"showing"},Sa=function(e){function t(t){void 0===t&&(t={});var i,n=e.call(this)||this,r={id:t.id||"vjs_track_"+Qa++,kind:t.kind||"",language:t.language||""},a=t.label||"";for(i in r)!function(e){Object.defineProperty(uo(n),e,{get:function(){return r[e]},set:function(){}})}(i);return Object.defineProperty(uo(n),"label",{get:function(){return a},set:function(e){e!==a&&(a=e,this.trigger("labelchange"))}}),n}return ho(t,e),t}(X),Ao=Object.freeze({__proto__:null,parseUrl:_e,getAbsoluteURL:be,getFileExtension:we,isCrossOrigin:xe}),Io=function(e){if(!e)return!1;var t=Do.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)},Do=Object.prototype.toString,Mo=function(e){var t={};return e&&e.trim().split("\n").forEach(function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),i=e.slice(i+1).trim();void 0===t[n]?t[n]=i:Array.isArray(t[n])?t[n].push(i):t[n]=[t[n],i]}),t},Lo=Ce,Ea=Ce;Ce.XMLHttpRequest=la.XMLHttpRequest||function(){},Ce.XDomainRequest="withCredentials"in new Ce.XMLHttpRequest?Ce.XMLHttpRequest:la.XDomainRequest,function(e,t){for(var i=0;i<e.length;i++)!function(e){Ce["delete"===e?"del":e]=function(t,i,n){return(i=ke(t,i,n)).method=e.toUpperCase(),Te(i)}}(e[i])}(["get","put","post","patch","head","delete"]),Lo.default=Ea;var Oo=function(e){function t(t){var i;if(!(t=void 0===t?{}:t).tech)throw new Error("A tech was not provided.");var t=le(t,{kind:So[t.kind]||"subtitles",language:t.language||t.srclang||""}),n=Eo[t.mode]||"disabled",r=t.default;"metadata"!==t.kind&&"chapters"!==t.kind||(n="hidden"),(i=e.call(this,t)||this).tech_=t.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var a=new ko(i.cues_),o=new ko(i.activeCues_),s=!1,l=G(uo(i),function(){this.tech_.isReady_&&!this.tech_.isDisposed()&&(this.activeCues=this.activeCues,s&&(this.trigger("cuechange"),s=!1))});return i.tech_.one("dispose",function(){i.tech_.off("timeupdate",l)}),"disabled"!==n&&i.tech_.on("timeupdate",l),Object.defineProperties(uo(i),{default:{get:function(){return r},set:function(){}},mode:{get:function(){return n},set:function(e){Eo[e]&&n!==e&&(n=e,this.preload_||"disabled"===n||0!==this.cues.length||Ee(this.src,this),this.tech_.off("timeupdate",l),"disabled"!==n&&this.tech_.on("timeupdate",l),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?a:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i<n;i++){var r=this.cues[i];(r.startTime<=e&&r.endTime>=e||r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e)&&t.push(r)}if(s=!1,t.length!==this.activeCues_.length)s=!0;else for(var a=0;a<t.length;a++)-1===this.activeCues_.indexOf(t[a])&&(s=!0);return this.activeCues_=t,o.setCues_(this.activeCues_),o},set:function(){}}}),t.src?(i.src=t.src,i.preload_||(i.loaded_=!0),(i.preload_||"subtitles"!==t.kind&&"captions"!==t.kind)&&Ee(i.src,uo(i))):i.loaded_=!0,i}ho(t,e);var i=t.prototype;return i.addCue=function(e){var t=e;if(la.vttjs&&!(e instanceof la.vttjs.VTTCue)){for(var i in t=new la.vttjs.VTTCue(e.startTime,e.endTime,e.text),e)i in t||(t[i]=e[i]);t.id=e.id,t.originalCue_=e}for(var n=this.tech_.textTracks(),r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)},i.removeCue=function(e){for(var t=this.cues_.length;t--;){var i=this.cues_[t];if(i===e||i.originalCue_&&i.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}},t}(Sa);Oo.prototype.allowedEvents_={cuechange:"cuechange"};var No=function(e){function t(t){var i=le(t=void 0===t?{}:t,{kind:To[t.kind]||""}),t=e.call(this,i)||this,n=!1;return Object.defineProperty(uo(t),"enabled",{get:function(){return n},set:function(e){"boolean"==typeof e&&e!==n&&(n=e,this.trigger("enabledchange"))}}),i.enabled&&(t.enabled=i.enabled),t.loaded_=!0,t}return ho(t,e),t}(Sa),Po=function(e){function t(t){var i=le(t=void 0===t?{}:t,{kind:Co[t.kind]||""}),t=e.call(this,i)||this,n=!1;return Object.defineProperty(uo(t),"selected",{get:function(){return n},set:function(e){"boolean"==typeof e&&e!==n&&(n=e,this.trigger("selectedchange"))}}),i.selected&&(t.selected=i.selected),t}return ho(t,e),t}(Sa),Aa=function(e){function t(t){var i;void 0===t&&(t={});var n=e.call(this)||this,r=new Oo(t);return n.kind=r.kind,n.src=r.src,n.srclang=r.language,n.label=r.label,n.default=r.default,Object.defineProperties(uo(n),{readyState:{get:function(){return i}},track:{get:function(){return r}}}),i=0,r.addEventListener("loadeddata",function(){i=2,n.trigger({type:"load",target:uo(n)})}),n}return ho(t,e),t}(X);Aa.prototype.allowedEvents_={load:"load"},Aa.NONE=0,Aa.LOADING=1,Aa.LOADED=2,Aa.ERROR=3;var Ro={audio:{ListClass:xo,TrackClass:No,capitalName:"Audio"},video:{ListClass:sa,TrackClass:Po,capitalName:"Video"},text:{ListClass:ca,TrackClass:Oo,capitalName:"Text"}};Object.keys(Ro).forEach(function(e){Ro[e].getterName=e+"Tracks",Ro[e].privateName=e+"Tracks_"});var jo={remoteText:{ListClass:ca,TrackClass:Oo,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:ua,TrackClass:Aa,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},zo=xa({},Ro,jo);jo.names=Object.keys(jo),Ro.names=Object.keys(Ro),zo.names=[].concat(jo.names).concat(Ro.names);var Fo=Object.create||function(e){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return Ae.prototype=e,new Ae};((Ie.prototype=Fo(Error.prototype)).constructor=Ie).Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Me.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n<i.length;++n)if(t===i[n]){this.set(e,t);break}},integer:function(e,t){
|
||
/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))},percent:function(e,t){return!!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&0<=(t=parseFloat(t))&&t<=100)&&(this.set(e,t),!0)}};var Bo=da.createElement&&da.createElement("textarea"),Uo={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},$o={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},qo={v:"title",lang:"lang"},Ho={rt:"ruby"},Wo=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];Re.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},Re.prototype.formatStyle=function(e,t){return 0===e?0:e+t},(je.prototype=Fo(Re.prototype)).constructor=je,ze.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},ze.prototype.overlaps=function(e){return this.left<e.right&&this.right>e.left&&this.top<e.bottom&&this.bottom>e.top},ze.prototype.overlapsAny=function(e){for(var t=0;t<e.length;t++)if(this.overlaps(e[t]))return!0;return!1},ze.prototype.within=function(e){return this.top>=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},ze.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.left<e.left;case"-x":return this.right>e.right;case"+y":return this.top<e.top;case"-y":return this.bottom>e.bottom}},ze.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},ze.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},ze.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},Be.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Be.convertCueToDOMTree=function(e,t){return e&&t?Ne(e,t):null},Be.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t<e.length;t++)if(e[t].hasBeenReset||!e[t].displayState)return 1}(t)){var r=[],a=ze.getSimpleBoxPosition(n),o={font:Math.round(.05*a.height*100)/100+"px sans-serif"};!function(){for(var i,s,l=0;l<t.length;l++)s=t[l],i=new je(e,s,o),n.appendChild(i.div),Fe(0,i,a,r),s.displayState=i.div,r.push(ze.getSimpleBoxPosition(i))}()}else for(var s=0;s<t.length;s++)n.appendChild(t[s].displayState)},(Be.Parser=function(e,t,i){i||(i=t,t={}),t=t||{},this.window=e,this.vttjs=t,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]}).prototype={reportOrThrowError:function(e){if(!(e instanceof Ie))throw e;this.onparsingerror&&this.onparsingerror(e)},parse:function(e){function t(){for(var e=i.buffer,t=0;t<e.length&&"\r"!==e[t]&&"\n"!==e[t];)++t;var n=e.substr(0,t);return"\r"===e[t]&&++t,"\n"===e[t]&&++t,i.buffer=e.substr(t),n}var i=this;e&&(i.buffer+=i.decoder.decode(e,{stream:!0}));try{if("INITIAL"===i.state){if(!/\r\n|\n/.test(i.buffer))return this;var n,r=(n=t()).match(/^WEBVTT([ \t].*)?$/);if(!r||!r[0])throw new Ie(Ie.Errors.BadSignature);i.state="HEADER"}for(var a=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(a?a=!1:n=t(),i.state){case"HEADER":/:/.test(n)?function(e){e.match(/X-TIMESTAMP-MAP/)?Le(e,function(e,t){var n;"X-TIMESTAMP-MAP"===e&&(t=t,n=new Me,Le(t,function(e,t){switch(e){case"MPEGT":n.integer(e+"S",t);break;case"LOCA":n.set(e+"L",De(t))}},/[^\d]:/,/,/),i.ontimestampmap&&i.ontimestampmap({MPEGTS:n.get("MPEGTS"),LOCAL:n.get("LOCAL")}))},/=/):Le(e,function(e,t){var n;"Region"===e&&(t=t,n=new Me,Le(t,function(e,t){switch(e){case"id":n.set(e,t);break;case"width":n.percent(e,t);break;case"lines":n.integer(e,t);break;case"regionanchor":case"viewportanchor":var i=t.split(",");if(2!==i.length)break;var r=new Me;if(r.percent("x",i[0]),r.percent("y",i[1]),!r.has("x")||!r.has("y"))break;n.set(e+"X",r.get("x")),n.set(e+"Y",r.get("y"));break;case"scroll":n.alt(e,t,["up"])}},/=/,/\s/),n.has("id")&&((t=new(i.vttjs.VTTRegion||i.window.VTTRegion)).width=n.get("width",100),t.lines=n.get("lines",3),t.regionAnchorX=n.get("regionanchorX",0),t.regionAnchorY=n.get("regionanchorY",100),t.viewportAnchorX=n.get("viewportanchorX",0),t.viewportAnchorY=n.get("viewportanchorY",100),t.scroll=n.get("scroll",""),i.onregion&&i.onregion(t),i.regionList.push({id:n.get("id"),region:t})))},/:/)}(n):n||(i.state="ID");continue;case"NOTE":n||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(n)){i.state="NOTE";break}if(!n)continue;i.cue=new(i.vttjs.VTTCue||i.window.VTTCue)(0,0,"");try{i.cue.align="center"}catch(e){i.cue.align="middle"}if(i.state="CUE",-1===n.indexOf("--\x3e")){i.cue.id=n;continue}case"CUE":try{Oe(n,i.cue,i.regionList)}catch(e){i.reportOrThrowError(e),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var o=-1!==n.indexOf("--\x3e");if(!n||o&&(a=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+="\n"),i.cue.text+=n.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":n||(i.state="ID");continue}}}catch(e){i.reportOrThrowError(e),"CUETEXT"===i.state&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state="INITIAL"===i.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var e=this;try{if(e.buffer+=e.decoder.decode(),!e.cue&&"HEADER"!==e.state||(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state)throw new Ie(Ie.Errors.BadSignature)}catch(t){e.reportOrThrowError(t)}return e.onflush&&e.onflush(),this}};var Vo=Be,Go={"":1,lr:1,rl:1},Yo={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};$e.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Ko=$e,Xo={"":!0,up:!0},Qo=e(function(e){e=e.exports={WebVTT:Vo,VTTCue:Ko,VTTRegion:He},la.vttjs=e,la.WebVTT=e.WebVTT;var t=e.VTTCue,i=e.VTTRegion,n=la.VTTCue,r=la.VTTRegion;e.shim=function(){la.VTTCue=t,la.VTTRegion=i},e.restore=function(){la.VTTCue=n,la.VTTRegion=r},la.VTTCue||e.shim()});Qo.WebVTT,Qo.VTTCue,Qo.VTTRegion;var Zo=function(e){function t(t,i){var n;return void 0===i&&(i=function(){}),(t=void 0===t?{}:t).reportTouchActivity=!1,(n=e.call(this,null,t,i)||this).onDurationChange_=function(e){return n.onDurationChange(e)},n.trackProgress_=function(e){return n.trackProgress(e)},n.trackCurrentTime_=function(e){return n.trackCurrentTime(e)},n.stopTrackingCurrentTime_=function(e){return n.stopTrackingCurrentTime(e)},n.disposeSourceHandler_=function(e){return n.disposeSourceHandler(e)},n.hasStarted_=!1,n.on("playing",function(){this.hasStarted_=!0}),n.on("loadstart",function(){this.hasStarted_=!1}),zo.names.forEach(function(e){e=zo[e],t&&t[e.getterName]&&(n[e.privateName]=t[e.getterName])}),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(e){!1===t["native"+e+"Tracks"]&&(n["featuresNative"+e+"Tracks"]=!1)}),!1===t.nativeCaptions||!1===t.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.preloadTextTracks=!1!==t.preloadTextTracks,n.autoRemoteTextTracks_=new zo.text.ListClass,n.initTrackListeners(),t.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}ho(t,e);var i=t.prototype;return i.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},i.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},i.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},i.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(G(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),1===(this.bufferedPercent_=e)&&this.stopTrackingProgress()}),500)},i.onDurationChange=function(e){this.duration_=this.duration()},i.buffered=function(){return de(0,0)},i.bufferedPercent=function(){return he(this.buffered(),this.duration_)},i.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},i.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},i.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},i.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},i.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.dispose=function(){this.clearTracks(Ro.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},i.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach(function(e){for(var i=t[e+"Tracks"]()||[],n=i.length;n--;){var r=i[n];"text"===e&&t.removeRemoteTextTrack(r),i.removeTrack(r)}})},i.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},i.reset=function(){},i.crossOrigin=function(){},i.setCrossOrigin=function(){},i.error=function(e){return void 0!==e&&(this.error_=new pe(e),this.trigger("error")),this.error_},i.played=function(){return this.hasStarted_?de(0,0):de()},i.play=function(){},i.setScrubbing=function(){},i.scrubbing=function(){},i.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.initTrackListeners=function(){var e=this;Ro.names.forEach(function(t){function i(){e.trigger(t+"trackchange")}var n=Ro[t],r=e[n.getterName]();r.addEventListener("removetrack",i),r.addEventListener("addtrack",i),e.on("dispose",function(){r.removeEventListener("removetrack",i),r.removeEventListener("addtrack",i)})})},i.addWebVttScript_=function(){var e,t=this;la.WebVTT||(da.body.contains(this.el())?!this.options_["vtt.js"]&&r(Qo)&&0<Object.keys(Qo).length?this.trigger("vttjsloaded"):((e=da.createElement("script")).src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=function(){t.trigger("vttjsloaded")},e.onerror=function(){t.trigger("vttjserror")},this.on("dispose",function(){e.onload=null,e.onerror=null}),la.WebVTT=!0,this.el().parentNode.appendChild(e)):this.ready(this.addWebVttScript_))},i.emulateTextTracks=function(){function e(e){return a.addTrack(e.track)}function t(e){return a.removeTrack(e.track)}function i(){return r.trigger("texttrackchange")}function n(){i();for(var e=0;e<a.length;e++){var t=a[e];t.removeEventListener("cuechange",i),"showing"===t.mode&&t.addEventListener("cuechange",i)}}var r=this,a=this.textTracks(),o=this.remoteTextTracks();o.on("addtrack",e),o.on("removetrack",t),this.addWebVttScript_(),n(),a.addEventListener("change",n),a.addEventListener("addtrack",n),a.addEventListener("removetrack",n),this.on("dispose",function(){o.off("addtrack",e),o.off("removetrack",t),a.removeEventListener("change",n),a.removeEventListener("addtrack",n),a.removeEventListener("removetrack",n);for(var r=0;r<a.length;r++)a[r].removeEventListener("cuechange",i)})},i.addTextTrack=function(e,t,i){if(!e)throw new Error("TextTrack kind is required but was not provided");return function(e,t,i,n,r){void 0===r&&(r={});var a=e.textTracks();return r.kind=t,i&&(r.label=i),n&&(r.language=n),r.tech=e,r=new zo.text.TrackClass(r),a.addTrack(r),r}(this,e,t,i)},i.createRemoteTextTrack=function(e){return e=le(e,{tech:this}),new jo.remoteTextEl.TrackClass(e)},i.addRemoteTextTrack=function(e,t){var i=this,n=this.createRemoteTextTrack(e=void 0===e?{}:e);return!0!==t&&!1!==t&&(ba.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),t=!0),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),!0!==t&&this.ready(function(){return i.autoRemoteTextTracks_.addTrack(n.track)}),n},i.removeRemoteTextTrack=function(e){var t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)},i.getVideoPlaybackQuality=function(){return{}},i.requestPictureInPicture=function(){var e=this.options_.Promise||la.Promise;if(e)return e.reject()},i.disablePictureInPicture=function(){return!0},i.setDisablePictureInPicture=function(){},i.setPoster=function(){},i.playsinline=function(){},i.setPlaysinline=function(){},i.overrideNativeAudioTracks=function(){},i.overrideNativeVideoTracks=function(){},i.canPlayType=function(){return""},t.canPlayType=function(){return""},t.canPlaySource=function(e,i){return t.canPlayType(e.type)},t.isTech=function(e){return e.prototype instanceof t||e instanceof t||e===t},t.registerTech=function(e,i){if(t.techs_||(t.techs_={}),!t.isTech(i))throw new Error("Tech "+e+" must be a Tech");if(!t.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!t.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=se(e),t.techs_[e]=i,t.techs_[oe(e)]=i,"Tech"!==e&&t.defaultTechOrder_.push(e),i},t.getTech=function(e){if(e)return t.techs_&&t.techs_[e]?t.techs_[e]:(e=se(e),la&&la.videojs&&la.videojs[e]?(ba.warn("The "+e+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),la.videojs[e]):void 0)},t}(co);zo.names.forEach(function(e){var t=zo[e];Zo.prototype[t.getterName]=function(){return this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName]}}),Zo.prototype.featuresVolumeControl=!0,Zo.prototype.featuresMuteControl=!0,Zo.prototype.featuresFullscreenResize=!1,Zo.prototype.featuresPlaybackRate=!1,Zo.prototype.featuresProgressEvents=!1,Zo.prototype.featuresSourceset=!1,Zo.prototype.featuresTimeupdateEvents=!1,Zo.prototype.featuresNativeTextTracks=!1,Zo.withSourceHandlers=function(e){e.registerSourceHandler=function(t,i){var n=(n=e.sourceHandlers)||(e.sourceHandlers=[]);void 0===i&&(i=n.length),n.splice(i,0,t)},e.canPlayType=function(t){for(var i,n=e.sourceHandlers||[],r=0;r<n.length;r++)if(i=n[r].canPlayType(t))return i;return""},e.selectSourceHandler=function(t,i){for(var n=e.sourceHandlers||[],r=0;r<n.length;r++)if(n[r].canHandleSource(t,i))return n[r];return null},e.canPlaySource=function(t,i){var n=e.selectSourceHandler(t,i);return n?n.canHandleSource(t,i):""},["seekable","seeking","duration"].forEach(function(e){var t=this[e];"function"==typeof t&&(this[e]=function(){return this.sourceHandler_&&this.sourceHandler_[e]?this.sourceHandler_[e].apply(this.sourceHandler_,arguments):t.apply(this,arguments)})},e.prototype),e.prototype.setSource=function(t){var i=e.selectSourceHandler(t,this.options_);i||(e.nativeSourceHandler?i=e.nativeSourceHandler:ba.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==e.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=i.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},e.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},co.registerComponent("Tech",Zo),Zo.registerTech("Tech",Zo),Zo.defaultTechOrder_=[];var Jo={},es={},ts={},is={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},ns={setCurrentTime:1,setMuted:1,setVolume:1},rs={play:1,pause:1},as={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"};Ia=function(e){function t(t,i,n){var r=le({createEl:!1},i),n=e.call(this,t,r,n)||this;if(i.playerOptions.sources&&0!==i.playerOptions.sources.length)t.src(i.playerOptions.sources);else for(var a=0,o=i.playerOptions.techOrder;a<o.length;a++){var s=se(o[a]),l=Zo.getTech(s);if((l=s?l:co.getComponent(s))&&l.isSupported()){t.loadTech_(s);break}}return n}return ho(t,e),t}(co),co.registerComponent("MediaLoader",Ia),za=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.handleMouseOver_=function(e){return n.handleMouseOver(e)},n.handleMouseOut_=function(e){return n.handleMouseOut(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.emitTapEvents(),n.enable(),n}ho(t,e);var n=t.prototype;return n.createEl=function(t,n,r){return void 0===t&&(t="div"),void 0===n&&(n={}),void 0===r&&(r={}),n=i({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},n),"button"===t&&ba.error("Creating a ClickableComponent with an HTML element of "+t+" is not supported; use a Button instead."),r=i({role:"button"},r),this.tabIndex_=n.tabIndex,r=e.prototype.createEl.call(this,t,n,r),this.createControlTextEl(r),r},n.dispose=function(){this.controlTextEl_=null,e.prototype.dispose.call(this)},n.createControlTextEl=function(e){return this.controlTextEl_=h("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_},n.controlText=function(e,t){if(void 0===t&&(t=this.el()),void 0===e)return this.controlText_||"Need Text";var i=this.localize(e);this.controlText_=e,p(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||t.setAttribute("title",i)},n.buildCSSClass=function(){return"vjs-control vjs-button "+e.prototype.buildCSSClass.call(this)},n.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))},n.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)},n.handleLanguagechange=function(){this.controlText(this.controlText_)},n.handleClick=function(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)},n.handleKeyDown=function(t){vo.isEventKey(t,"Space")||vo.isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(co),co.registerComponent("ClickableComponent",za),co.registerComponent("PosterImage",function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.update(),n.update_=function(e){return n.update(e)},t.on("posterchange",n.update_),n}ho(t,e);var i=t.prototype;return i.dispose=function(){this.player().off("posterchange",this.update_),e.prototype.dispose.call(this)},i.createEl=function(){return h("div",{className:"vjs-poster",tabIndex:-1})},i.update=function(e){var t=this.player().poster();this.setSrc(t),t?this.show():this.hide()},i.setSrc=function(e){this.el_.style.backgroundImage=e?'url("'+e+'")':""},i.handleClick=function(e){var t;this.player_.controls()&&(t=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0<this.player_.eme.sessions.length,!this.player_.tech(!0)||(ja||Na)&&t||this.player_.tech(!0).focus(),this.player_.paused()?me(this.player_.play()):this.player_.pause())},t}(za));var os="#222",ss={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};co.registerComponent("TextTrackDisplay",function(e){function t(t,i,n){function r(e){return a.updateDisplay(e)}var a=e.call(this,t,i,n)||this;return t.on("loadstart",function(e){return a.toggleDisplay(e)}),t.on("texttrackchange",r),t.on("loadedmetadata",function(e){return a.preselectTrack(e)}),t.ready(G(uo(a),function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",r),t.on("playerresize",r),la.addEventListener("orientationchange",r),t.on("dispose",function(){return la.removeEventListener("orientationchange",r)});for(var e=this.options_.playerOptions.tracks||[],i=0;i<e.length;i++)this.player_.addRemoteTextTrack(e[i],!0);this.preselectTrack()}})),a}ho(t,e);var i=t.prototype;return i.preselectTrack=function(){for(var e,t,i,n={captions:1,subtitles:1},r=this.player_.textTracks(),a=this.player_.cache_.selectedLanguage,o=0;o<r.length;o++){var s=r[o];a&&a.enabled&&a.language&&a.language===s.language&&s.kind in n?i=s.kind!==a.kind&&i||s:a&&!a.enabled?t=e=i=null:s.default&&("descriptions"!==s.kind||e?s.kind in n&&!t&&(t=s):e=s)}i?i.mode="showing":t?t.mode="showing":e&&(e.mode="showing")},i.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},i.clearDisplay=function(){"function"==typeof la.WebVTT&&la.WebVTT.processCues(la,[],this.el_)},i.updateDisplay=function(){var e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){for(var i=[],n=0;n<e.length;++n){var r=e[n];"showing"===r.mode&&i.push(r)}this.updateForTrack(i)}else{for(var a=null,o=null,s=e.length;s--;){var l=e[s];"showing"===l.mode&&("descriptions"===l.kind?a=l:o=l)}o?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(o)):a&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(a))}},i.updateDisplayState=function(e){for(var t=this.player_.textTrackSettings.getValues(),i=e.activeCues,n=i.length;n--;){var r,a=i[n];a&&(r=a.displayState,t.color&&(r.firstChild.style.color=t.color),t.textOpacity&&Je(r.firstChild,"color",Ze(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(r.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Je(r.firstChild,"backgroundColor",Ze(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Je(r,"backgroundColor",Ze(t.windowColor,t.windowOpacity)):r.style.backgroundColor=t.windowColor),t.edgeStyle&&("dropshadow"===t.edgeStyle?r.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px "+os:"raised"===t.edgeStyle?r.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px "+os:"depressed"===t.edgeStyle?r.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px "+os:"uniform"===t.edgeStyle&&(r.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px "+os)),t.fontPercent&&1!==t.fontPercent&&(a=la.parseFloat(r.style.fontSize),r.style.fontSize=a*t.fontPercent+"px",r.style.height="auto",r.style.top="auto"),t.fontFamily&&"default"!==t.fontFamily&&("small-caps"===t.fontFamily?r.firstChild.style.fontVariant="small-caps":r.firstChild.style.fontFamily=ss[t.fontFamily]))}},i.updateForTrack=function(e){if(Array.isArray(e)||(e=[e]),"function"==typeof la.WebVTT&&!e.every(function(e){return!e.activeCues})){for(var t=[],i=0;i<e.length;++i)for(var n=e[i],r=0;r<n.activeCues.length;++r)t.push(n.activeCues[r]);la.WebVTT.processCues(la,t,this.el_);for(var a=0;a<e.length;++a){for(var o=e[a],s=0;s<o.activeCues.length;++s){var l=o.activeCues[s].displayState;g(l,"vjs-text-track-cue"),g(l,"vjs-text-track-cue-"+(o.language||a))}this.player_.textTrackSettings&&this.updateDisplayState(o)}}},t}(co)),co.registerComponent("LoadingSpinner",function(e){function t(){return e.apply(this,arguments)||this}return ho(t,e),t.prototype.createEl=function(){var t=this.player_.isAudio(),i=this.localize(t?"Audio Player":"Video Player"),t=h("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[i])}),i=e.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return i.appendChild(t),i},t}(co));var ls=function(e){function t(){return e.apply(this,arguments)||this}ho(t,e);var n=t.prototype;return n.createEl=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),t=i({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},t),n=i({type:"button"},n),n=co.prototype.createEl.call(this,"button",t,n),this.createControlTextEl(n),n},n.addChild=function(e,t){void 0===t&&(t={});var i=this.constructor.name;return ba.warn("Adding an actionable (user controllable) child to a Button ("+i+") is not supported; use a ClickableComponent instead."),co.prototype.addChild.call(this,e,t)},n.enable=function(){e.prototype.enable.call(this),this.el_.removeAttribute("disabled")},n.disable=function(){e.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},n.handleKeyDown=function(t){vo.isEventKey(t,"Space")||vo.isEventKey(t,"Enter")?t.stopPropagation():e.prototype.handleKeyDown.call(this,t)},t}(za);co.registerComponent("Button",ls),Ua=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.mouseused_=!1,n.on("mousedown",function(e){return n.handleMouseDown(e)}),n}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-big-play-button"},i.handleClick=function(e){var t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){var i=this.player_.usingPlugin("eme")&&this.player_.eme.sessions&&0<this.player_.eme.sessions.length;return me(t),void(!this.player_.tech(!0)||(ja||Na)&&i||this.player_.tech(!0).focus())}var i=this.player_.getChild("controlBar"),n=i&&i.getChild("playToggle");n?(i=function(){return n.focus()},fe(t)?t.then(i,function(){}):this.setTimeout(i,1)):this.player_.tech(!0).focus()},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(ls),Ua.prototype.controlText_="Play Video",co.registerComponent("BigPlayButton",Ua),co.registerComponent("CloseButton",function(e){function t(t,i){return t=e.call(this,t,i)||this,t.controlText(i&&i.controlText||t.localize("Close")),t}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},i.handleKeyDown=function(t){vo.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(ls));var cs=function(e){function t(t,i){var n=e.call(this,t,i=void 0===i?{}:i)||this;return i.replay=void 0===i.replay||i.replay,n.on(t,"play",function(e){return n.handlePlay(e)}),n.on(t,"pause",function(e){return n.handlePause(e)}),i.replay&&n.on(t,"ended",function(e){return n.handleEnded(e)}),n}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?me(this.player_.play()):this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(e){return t.handleSeeked(e)})},t}(ls);cs.prototype.controlText_="Play",co.registerComponent("PlayToggle",cs);var us=et;Ea=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.on(t,["timeupdate","ended"],function(e){return n.updateContent(e)}),n.updateTextNode_(),n}ho(t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text" role="presentation">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=h("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(e){var t=this;e=tt(e=void 0===e?0:e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){var e;t.contentEl_&&((e=t.textNode_)&&t.contentEl_.firstChild!==e&&(e=null,
|
||
ba.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=da.createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_)))}))},i.updateContent=function(e){},t}(co),Ea.prototype.labelText_="Time",Ea.prototype.controlText_="Time",co.registerComponent("TimeDisplay",Ea),Sa=function(e){function t(){return e.apply(this,arguments)||this}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateTextNode_(t)},t}(Ea),Sa.prototype.labelText_="Current Time",Sa.prototype.controlText_="Current Time",co.registerComponent("CurrentTimeDisplay",Sa),xo=function(e){function t(t,i){var n=e.call(this,t,i)||this,i=function(e){return n.updateContent(e)};return n.on(t,"durationchange",i),n.on(t,"loadstart",i),n.on(t,"loadedmetadata",i),n}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(Ea),xo.prototype.labelText_="Duration",xo.prototype.controlText_="Duration",co.registerComponent("DurationDisplay",xo),co.registerComponent("TimeDivider",function(e){function t(){return e.apply(this,arguments)||this}return ho(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"},{"aria-hidden":!0})},t}(co)),sa=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.on(t,"durationchange",function(e){return n.updateContent(e)}),n}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.createEl=function(){var t=e.prototype.createEl.call(this);return t.insertBefore(h("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},i.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}(Ea),sa.prototype.labelText_="Remaining Time",sa.prototype.controlText_="Remaining Time",co.registerComponent("RemainingTimeDisplay",sa),co.registerComponent("LiveDisplay",function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.updateShowing(),n.on(n.player(),"durationchange",function(e){return n.updateShowing(e)}),n}ho(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=h("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(co)),ca=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}ho(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=h("span",{className:"vjs-seek-to-live-text",innerHTML:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(ls),ca.prototype.controlText_="Seek to live, currently playing live",co.registerComponent("SeekToLive",ca),ua=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.handleMouseDown_=function(e){return n.handleMouseDown(e)},n.handleMouseUp_=function(e){return n.handleMouseUp(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleMouseMove_=function(e){return n.handleMouseMove(e)},n.update_=function(e){return n.update(e)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}ho(t,e);var n=t.prototype;return n.enabled=function(){return this.enabled_},n.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},n.disable=function(){var e;this.enabled()&&(e=this.bar.el_.ownerDocument,this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1)},n.createEl=function(t,n,r){return void 0===r&&(r={}),(n=void 0===n?{}:n).className=n.className+" vjs-slider",n=i({tabIndex:0},n),r=i({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},r),e.prototype.createEl.call(this,t,n,r)},n.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||Pa||e.preventDefault(),C(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e)},n.handleMouseMove=function(e){},n.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;T(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},n.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_?t:(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%"}),t)}},n.getProgress=function(){return Number(it(this.getPercent(),0,1).toFixed(4))},n.calculateDistance=function(e){return e=A(this.el_,e),this.vertical()?e.y:e.x},n.handleKeyDown=function(t){vo.isEventKey(t,"Left")||vo.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):vo.isEventKey(t,"Right")||vo.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){e.stopPropagation(),e.preventDefault()},n.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(co),co.registerComponent("Slider",ua),co.registerComponent("LoadProgressBar",function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.partEls_=[],n.on(t,"progress",function(e){return n.update(e)}),n}ho(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=h("span",{className:"vjs-control-text"}),n=h("span",{textContent:this.localize("Loaded")}),r=da.createTextNode(": ");return this.percentageEl_=h("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var e=t.player_.liveTracker,i=t.player_.buffered(),e=e&&e.isLive()?e.seekableEnd():t.player_.duration(),n=t.player_.bufferedEnd(),r=t.partEls_,e=nt(n,e);t.percent_!==e&&(t.el_.style.width=e,p(t.percentageEl_,e),t.percent_=e);for(var a=0;a<i.length;a++){var o=i.start(a),s=i.end(a),l=r[a];l||(l=t.el_.appendChild(h()),r[a]=l),l.dataset.start===o&&l.dataset.end===s||(l.dataset.start=o,l.dataset.end=s,l.style.left=nt(o,n),l.style.width=nt(s-o,n))}for(var c=r.length;c>i.length;c--)t.el_.removeChild(r[c-1]);r.length=i.length})},t}(co)),co.registerComponent("TimeTooltip",function(e){function t(t,i){return i=e.call(this,t,i)||this,i.update=Y(G(uo(i),i.update),30),i}ho(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=E(this.el_),r=S(this.player_.el()),a=e.width*t;r&&n&&(t=e.left-r.left+a,r=e.width-a+(r.right-e.right),t<(e=n.width/2)?e+=e-t:r<e&&(e=r),e<0?e=0:e>n.width&&(e=n.width),e=Math.round(e),this.el_.style.right="-"+e+"px",this.write(i))},i.write=function(e){p(this.el_,e)},i.updateTime=function(e,t,i,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var a,o,s=r.player_.duration();s=r.player_.liveTracker&&r.player_.liveTracker.isLive()?((o=(a=r.player_.liveTracker.liveWindow())-t*a)<1?"":"-")+tt(o,a):tt(i,s),r.update(e,t,s),n&&n()})},t}(co)),Aa=function(e){function t(t,i){return i=e.call(this,t,i)||this,i.update=Y(G(uo(i),i.update),30),i}ho(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i,n=this.getChild("timeTooltip");n&&(i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),n.updateTime(e,t,i))},t}(co),Aa.prototype.options_={children:[]},qa||Da||Aa.prototype.options_.children.push("timeTooltip"),co.registerComponent("PlayProgressBar",Aa),Ia=function(e){function t(t,i){return i=e.call(this,t,i)||this,i.update=Y(G(uo(i),i.update),30),i}ho(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){i.el_.style.left=e.width*t+"px"})},t}(co),Ia.prototype.options_={children:["timeTooltip"]},co.registerComponent("MouseTimeDisplay",Ia),Ua=function(e){function t(t,i){return i=e.call(this,t,i)||this,i.setEventHandlers_(),i}ho(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=G(this,this.update),this.update=Y(this.update_,30),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in da&&"visibilityState"in da&&this.on(da,"visibilitychange",this.toggleVisibility_)},i.toggleVisibility_=function(e){"hidden"===da.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update=function(t){var i=this;if("hidden"!==da.visibilityState){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),i.currentTime_===e&&i.duration_===r||(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[tt(e,r),tt(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(S(i.el()),i.getProgress())}),n}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},i.handleMouseDown=function(t){N(t)&&(t.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e){if(N(e)){var t=this.calculateDistance(e),i=this.player_.liveTracker;if(i&&i.isLive()){if(.99<=t)return void i.seekToLiveEdge();var n,r=i.seekableStart(),e=i.liveCurrentTime();if((n=(n=e<=(n=r+t*i.liveWindow())?e:n)<=r?r+.1:n)===1/0)return}else(n=t*this.player_.duration())===this.player_.duration()&&(n-=.1);this.userSeek_(n)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?me(this.player_.play()):this.update_()},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyDown=function(t){var i,n=this.player_.liveTracker;vo.isEventKey(t,"Space")||vo.isEventKey(t,"Enter")?(t.preventDefault(),t.stopPropagation(),this.handleAction(t)):vo.isEventKey(t,"Home")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(0)):vo.isEventKey(t,"End")?(t.preventDefault(),t.stopPropagation(),n&&n.isLive()?this.userSeek_(n.liveCurrentTime()):this.userSeek_(this.player_.duration())):/^[0-9]$/.test(vo(t))?(t.preventDefault(),t.stopPropagation(),i=10*(vo.codes[vo(t)]-vo.codes[0])/100,n&&n.isLive()?this.userSeek_(n.seekableStart()+n.liveWindow()*i):this.userSeek_(this.player_.duration()*i)):vo.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):vo.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},i.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in da&&"visibilityState"in da&&this.off(da,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(ua),Ua.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},qa||Da||Ua.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),co.registerComponent("SeekBar",Ua),cs=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.handleMouseMove=Y(G(uo(n),n.handleMouseMove),30),n.throttledHandleMouseSeek=Y(G(uo(n),n.handleMouseSeek),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e)},n.enable(),n}ho(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t,i,n,r,a=this.getChild("seekBar");a&&(t=a.getChild("playProgressBar"),i=a.getChild("mouseTimeDisplay"),(t||i)&&(r=E(n=a.el()),e=A(n,e).x,e=it(e,0,1),i&&i.update(r,e),t&&t.update(r,a.getProgress())))},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){var e;this.children().forEach(function(e){return e.disable&&e.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing()&&(e=this.getChild("seekBar"),this.player_.scrubbing(!1),e.videoWasPlaying&&me(this.player_.play())))},i.enable=function(){this.children().forEach(function(e){return e.enable&&e.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},i.removeListenersAddedOnMousedownAndTouchstart=function(){var e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(co),cs.prototype.options_={children:["seekBar"]},co.registerComponent("ProgressControl",cs),Sa=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.on(t,["enterpictureinpicture","leavepictureinpicture"],function(e){return n.handlePictureInPictureChange(e)}),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],function(e){return n.handlePictureInPictureEnabledChange(e)}),n.disable(),n}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},i.handlePictureInPictureEnabledChange=function(){da.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(ls),Sa.prototype.controlText_="Picture-in-Picture",co.registerComponent("PictureInPictureToggle",Sa),xo=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.on(t,"fullscreenchange",function(e){return n.handleFullscreenChange(e)}),!1===da[t.fsApi_.fullscreenEnabled]&&n.disable(),n}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(ls),xo.prototype.controlText_="Fullscreen",co.registerComponent("FullscreenToggle",xo),co.registerComponent("VolumeLevel",function(e){function t(){return e.apply(this,arguments)||this}return ho(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},t}(co)),co.registerComponent("VolumeLevelTooltip",function(e){function t(t,i){return i=e.call(this,t,i)||this,i.update=Y(G(uo(i),i.update),30),i}ho(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i,n){if(!i){var r=S(this.el_),a=S(this.player_.el()),i=e.width*t;if(!a||!r)return;t=e.left-a.left+i,a=e.width-i+(a.right-e.right),e=r.width/2,t<e?e+=e-t:a<e&&(e=a),e<0?e=0:e>r.width&&(e=r.width),this.el_.style.right="-"+e+"px"}this.write(n+"%")},i.write=function(e){p(this.el_,e)},i.updateVolume=function(e,t,i,n,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){a.update(e,t,i,n.toFixed(0)),r&&r()})},t}(co)),Ea=function(e){function t(t,i){return i=e.call(this,t,i)||this,i.update=Y(G(uo(i),i.update),30),i}ho(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t,i){var n=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px"})},t}(co),Ea.prototype.options_={children:["volumeLevelTooltip"]},co.registerComponent("MouseVolumeLevelDisplay",Ea),sa=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.on("slideractive",function(e){return n.updateLastVolume_(e)}),n.on(t,"volumechange",function(e){return n.updateARIAAttributes(e)}),t.ready(function(){return n.updateARIAAttributes()}),n}ho(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){N(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){var t,i,n,r=this.getChild("mouseVolumeLevelDisplay");r&&(t=S(n=this.el()),i=this.vertical(),n=A(n,e),n=i?n.y:n.x,n=it(n,0,1),r.update(t,n,i)),N(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},t}(ua),sa.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},qa||Da||sa.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),sa.prototype.playerEvent="volumechange",co.registerComponent("VolumeBar",sa),ca=function(e){function t(t,i){var n,a,o;return(i=void 0===i?{}:i).vertical=i.vertical||!1,void 0!==i.volumeBar&&!r(i.volumeBar)||(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=e.call(this,t,i)||this,a=uo(n),(o=t).tech_&&!o.tech_.featuresVolumeControl&&a.addClass("vjs-hidden"),a.on(o,"loadstart",function(){o.tech_.featuresVolumeControl?a.removeClass("vjs-hidden"):a.addClass("vjs-hidden")}),n.throttledHandleMouseMove=Y(G(uo(n),n.handleMouseMove),30),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.on("mousedown",function(e){return n.handleMouseDown(e)}),n.on("touchstart",function(e){return n.handleMouseDown(e)}),n.on("mousemove",function(e){return n.handleMouseMove(e)}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}ho(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(co),ca.prototype.options_={children:["volumeBar"]},co.registerComponent("VolumeControl",ca),Aa=function(e){function t(t,i){var n,r,a=e.call(this,t,i)||this;return n=uo(a),(r=t).tech_&&!r.tech_.featuresMuteControl&&n.addClass("vjs-hidden"),n.on(r,"loadstart",function(){r.tech_.featuresMuteControl?n.removeClass("vjs-hidden"):n.addClass("vjs-hidden")}),a.on(t,["loadstart","volumechange"],function(e){return a.update(e)}),a}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();0===t?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;qa&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)v(this.el_,"vjs-vol-"+i);g(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(ls),Aa.prototype.controlText_="Mute",co.registerComponent("MuteToggle",Aa),Ia=function(e){function t(t,i){var n;return void 0!==(i=void 0===i?{}:i).inline?i.inline=i.inline:i.inline=!0,void 0!==i.volumeControl&&!r(i.volumeControl)||(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).handleKeyPressHandler_=function(e){return n.handleKeyPress(e)},n.on(t,["loadstart"],function(e){return n.volumePanelState_(e)}),n.on(n.muteToggle,"keyup",function(e){return n.handleKeyPress(e)}),n.on(n.volumeControl,"keyup",function(e){return n.handleVolumeControlKeyUp(e)}),n.on("keydown",function(e){return n.handleKeyPress(e)}),n.on("mouseover",function(e){return n.handleMouseOver(e)}),n.on("mouseout",function(e){return n.handleMouseOut(e)}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}ho(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},i.handleVolumeControlKeyUp=function(e){vo.isEventKey(e,"Esc")&&this.muteToggle.focus()},i.handleMouseOver=function(e){this.addClass("vjs-hover"),$(da,"keyup",this.handleKeyPressHandler_)},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),q(da,"keyup",this.handleKeyPressHandler_)},i.handleKeyPress=function(e){vo.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(co),Ia.prototype.options_={children:["muteToggle","volumeControl"]},co.registerComponent("VolumePanel",Ia);var ds=function(e){function t(t,i){var n=e.call(this,t,i)||this;return i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",function(e){return n.handleKeyDown(e)}),n.boundHandleBlur_=function(e){return n.handleBlur(e)},n.boundHandleTapClick_=function(e){return n.handleTapClick(e)},n}ho(t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof co&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},i.removeEventListenerForItem=function(e){e instanceof co&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},i.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},i.addItem=function(e){(e=this.addChild(e))&&this.addEventListenerForItem(e)},i.createEl=function(){var t=this.options_.contentElType||"ul";return this.contentEl_=h(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu"),t=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"}),t.appendChild(this.contentEl_),$(t,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),t},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||da.activeElement;this.children().some(function(e){return e.el()===t})||(e=this.menuButton_)&&e.buttonPressed_&&t!==e.el().firstChild&&e.unpressButton()},i.handleTapClick=function(e){var t;this.menuButton_&&(this.menuButton_.unpressButton(),t=this.children(),!Array.isArray(t)||(t=t.filter(function(t){return t.el()===e.target})[0])&&"CaptionSettingsMenuItem"!==t.name()&&this.menuButton_.focus())},i.handleKeyDown=function(e){vo.isEventKey(e,"Left")||vo.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(vo.isEventKey(e,"Right")||vo.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),0<t.length&&(e<0?e=0:e>=t.length&&(e=t.length-1),t[this.focusedChild_=e].el_.focus())},t}(co);co.registerComponent("Menu",ds),Ua=function(e){function t(t,i){var n
|
||
;return(n=e.call(this,t,i=void 0===i?{}:i)||this).menuButton_=new ls(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true"),i=ls.prototype.buildCSSClass(),n.menuButton_.el_.className=n.buildCSSClass()+" "+i,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0,i=function(e){return n.handleClick(e)},n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e)},n.on(n.menuButton_,"tap",i),n.on(n.menuButton_,"click",i),n.on(n.menuButton_,"keydown",function(e){return n.handleKeyDown(e)}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),$(da,"keyup",n.handleMenuKeyUp_)}),n.on("mouseleave",function(e){return n.handleMouseLeave(e)}),n.on("keydown",function(e){return n.handleSubmenuKeyDown(e)}),n}ho(t,e);var i=t.prototype;return i.update=function(){var e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},i.createMenu=function(){var e,t=new ds(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title&&(e=h("li",{className:"vjs-menu-title",innerHTML:se(this.options_.title),tabIndex:-1}),e=new co(this.player_,{el:e}),t.addItem(e)),this.items=this.createItems(),this.items)for(var i=0;i<this.items.length;i++)t.addItem(this.items[i]);return t},i.createItems=function(){},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},i.buildWrapperCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+ls.prototype.buildCSSClass()+" "+e.prototype.buildCSSClass.call(this)},i.buildCSSClass=function(){var t="vjs-menu-button";return!0===this.options_.inline?t+="-inline":t+="-popup","vjs-menu-button "+t+" "+e.prototype.buildCSSClass.call(this)},i.controlText=function(e,t){return void 0===t&&(t=this.menuButton_.el()),this.menuButton_.controlText(e,t)},i.dispose=function(){this.handleMouseLeave(),e.prototype.dispose.call(this)},i.handleClick=function(e){this.buttonPressed_?this.unpressButton():this.pressButton()},i.handleMouseLeave=function(e){this.removeClass("vjs-hover"),q(da,"keyup",this.handleMenuKeyUp_)},i.focus=function(){this.menuButton_.focus()},i.blur=function(){this.menuButton_.blur()},i.handleKeyDown=function(e){vo.isEventKey(e,"Esc")||vo.isEventKey(e,"Tab")?(this.buttonPressed_&&this.unpressButton(),vo.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus())):(vo.isEventKey(e,"Up")||vo.isEventKey(e,"Down"))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))},i.handleMenuKeyUp=function(e){(vo.isEventKey(e,"Esc")||vo.isEventKey(e,"Tab"))&&this.removeClass("vjs-hover")},i.handleSubmenuKeyPress=function(e){this.handleSubmenuKeyDown(e)},i.handleSubmenuKeyDown=function(e){(vo.isEventKey(e,"Esc")||vo.isEventKey(e,"Tab"))&&(this.buttonPressed_&&this.unpressButton(),vo.isEventKey(e,"Tab")||(e.preventDefault(),this.menuButton_.focus()))},i.pressButton=function(){this.enabled_&&(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),qa&&u()||this.menu.focus())},i.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},i.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},i.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},t}(co),co.registerComponent("MenuButton",Ua),cs=function(e){function t(t,i){var n=i.tracks,i=e.call(this,t,i)||this;if(i.items.length<=1&&i.hide(),!n)return uo(i);var r=G(uo(i),i.update);return n.addEventListener("removetrack",r),n.addEventListener("addtrack",r),n.addEventListener("labelchange",r),i.player_.on("ready",r),i.player_.on("dispose",function(){n.removeEventListener("removetrack",r),n.removeEventListener("addtrack",r),n.removeEventListener("labelchange",r)}),i}return ho(t,e),t}(Ua),co.registerComponent("TrackButton",cs);var hs=["Tab","Esc","Up","Down","Right","Left"],Sa=function(e){function t(t,i){return t=e.call(this,t,i)||this,t.selectable=i.selectable,t.isSelected_=i.selected||!1,t.multiSelectable=i.multiSelectable,t.selected(t.isSelected_),t.selectable?t.multiSelectable?t.el_.setAttribute("role","menuitemcheckbox"):t.el_.setAttribute("role","menuitemradio"):t.el_.setAttribute("role","menuitem"),t}ho(t,e);var n=t.prototype;return n.createEl=function(t,n,r){return this.nonIconControl=!0,e.prototype.createEl.call(this,"li",i({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},n),r)},n.handleKeyDown=function(t){hs.some(function(e){return vo.isEventKey(t,e)})||e.prototype.handleKeyDown.call(this,t)},n.handleClick=function(e){this.selected(!0)},n.selected=function(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},t}(za);co.registerComponent("MenuItem",Sa);var ps=function(e){function t(t,i){function n(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];a.handleTracksChange.apply(uo(a),t)}function r(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];a.handleSelectedLanguageChange.apply(uo(a),t)}var a,o=i.track,s=t.textTracks();i.label=o.label||o.language||"Unknown",i.selected="showing"===o.mode,(a=e.call(this,t,i)||this).track=o,a.kinds=(i.kinds||[i.kind||a.track.kind]).filter(Boolean);var l;return t.on(["loadstart","texttrackchange"],n),s.addEventListener("change",n),s.addEventListener("selectedlanguagechange",r),a.on("dispose",function(){t.off(["loadstart","texttrackchange"],n),s.removeEventListener("change",n),s.removeEventListener("selectedlanguagechange",r)}),void 0===s.onchange&&a.on(["tap","click"],function(){if("object"!=typeof la.Event)try{l=new la.Event("change")}catch(e){}l||(l=da.createEvent("Event")).initEvent("change",!0,!0),s.dispatchEvent(l)}),a.handleTracksChange(),a}ho(t,e);var i=t.prototype;return i.handleClick=function(t){var i=this.track,n=this.player_.textTracks();if(e.prototype.handleClick.call(this,t),n)for(var r=0;r<n.length;r++){var a=n[r];-1!==this.kinds.indexOf(a.kind)&&(a===i?"showing"!==a.mode&&(a.mode="showing"):"disabled"!==a.mode&&(a.mode="disabled"))}},i.handleTracksChange=function(e){var t="showing"===this.track.mode;t!==this.isSelected_&&this.selected(t)},i.handleSelectedLanguageChange=function(e){var t;"showing"===this.track.mode&&((t=this.player_.cache_.selectedLanguage)&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind||(this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}))},i.dispose=function(){this.track=null,e.prototype.dispose.call(this)},t}(Sa);co.registerComponent("TextTrackMenuItem",ps);var fs=function(e){function t(t,i){return i.track={player:t,kind:i.kind,kinds:i.kinds,default:!1,mode:"disabled"},i.kinds||(i.kinds=[i.kind]),i.label?i.track.label=i.label:i.track.label=i.kinds.join(" and ")+" off",i.selectable=!0,i.multiSelectable=!1,e.call(this,t,i)||this}ho(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(-1<this.options_.kinds.indexOf(a.kind)&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n<r;n++){var a=t[n];if(-1<["captions","descriptions","subtitles"].indexOf(a.kind)&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(ps);co.registerComponent("OffTextTrackMenuItem",fs),xo=function(e){function t(t,i){return(i=void 0===i?{}:i).tracks=t.textTracks(),e.call(this,t,i)||this}return ho(t,e),t.prototype.createItems=function(e,t){var i;void 0===t&&(t=ps),this.label_&&(i=this.label_+" off"),(e=void 0===e?[]:e).push(new fs(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r<n.length;r++){var a,o=n[r];-1<this.kinds_.indexOf(o.kind)&&((a=new t(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1})).addClass("vjs-"+o.kind+"-menu-item"),e.push(a))}return e},t}(cs),co.registerComponent("TextTrackButton",xo);var ms=function(e){function t(t,i){var n=i.track,r=i.cue,a=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=r.text,i.selected=r.startTime<=a&&a<r.endTime,(i=e.call(this,t,i)||this).track=n,i.cue=r,n.addEventListener("cuechange",G(uo(i),i.update)),i}ho(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},i.update=function(e){var t=this.cue,i=this.player_.currentTime();this.selected(t.startTime<=i&&i<t.endTime)},t}(Sa);co.registerComponent("ChaptersTrackMenuItem",ms),Ea=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-chapters-button "+e.prototype.buildWrapperCSSClass.call(this)},i.update=function(t){this.track_&&(!t||"addtrack"!==t.type&&"removetrack"!==t.type)||this.setTrack(this.findChaptersTrack()),e.prototype.update.call(this)},i.setTrack=function(e){var t;this.track_!==e&&(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_&&((t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&t.removeEventListener("load",this.updateHandler_),this.track_=null),this.track_=e,this.track_&&(this.track_.mode="hidden",(e=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&e.addEventListener("load",this.updateHandler_)))},i.findChaptersTrack=function(){for(var e=this.player_.textTracks()||[],t=e.length-1;0<=t;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(se(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i<n;i++){var r=t[i],r=new ms(this.player_,{track:this.track_,cue:r});e.push(r)}return e},t}(xo),Ea.prototype.kind_="chapters",Ea.prototype.controlText_="Chapters",co.registerComponent("ChaptersButton",Ea),ua=function(e){function t(t,i,n){var n=e.call(this,t,i,n)||this,r=t.textTracks(),a=G(uo(n),n.handleTracksChange);return r.addEventListener("change",a),n.on("dispose",function(){r.removeEventListener("change",a)}),n}ho(t,e);var i=t.prototype;return i.handleTracksChange=function(e){for(var t=this.player().textTracks(),i=!1,n=0,r=t.length;n<r;n++){var a=t[n];if(a.kind!==this.kind_&&"showing"===a.mode){i=!0;break}}i?this.disable():this.enable()},i.buildCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(xo),ua.prototype.kind_="descriptions",ua.prototype.controlText_="Descriptions",co.registerComponent("DescriptionsButton",ua),sa=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+e.prototype.buildWrapperCSSClass.call(this)},t}(xo),sa.prototype.kind_="subtitles",sa.prototype.controlText_="Subtitles",co.registerComponent("SubtitlesButton",sa);var gs=function(e){function t(t,i){return i.track={player:t,kind:i.kind,label:i.kind+" settings",selectable:!1,default:!1,mode:"disabled"},i.selectable=!1,i.name="CaptionSettingsMenuItem",(t=e.call(this,t,i)||this).addClass("vjs-texttrack-settings"),t.controlText(", opens "+i.kind+" settings dialog"),t}return ho(t,e),t.prototype.handleClick=function(e){this.player().getChild("textTrackSettings").open()},t}(ps);co.registerComponent("CaptionSettingsMenuItem",gs),ca=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-captions-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-captions-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new gs(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t)},t}(xo),ca.prototype.kind_="captions",ca.prototype.controlText_="Captions",co.registerComponent("CaptionsButton",ca);var vs=function(e){function t(){return e.apply(this,arguments)||this}return ho(t,e),t.prototype.createEl=function(t,n,r){var a='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"captions"===this.options_.track.kind&&(a+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),e.prototype.createEl.call(this,t,i({innerHTML:a+="</span>"},n),r)},t}(ps);co.registerComponent("SubsCapsMenuItem",vs),Aa=function(e){function t(t,i){return(i=e.call(this,t,i=void 0===i?{}:i)||this).label_="subtitles",-1<["en","en-us","en-ca","fr-ca"].indexOf(i.player_.language_)&&(i.label_="captions"),i.menuButton_.controlText(se(i.label_)),i}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new gs(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=e.prototype.createItems.call(this,t,vs)},t}(xo),Aa.prototype.kinds_=["captions","subtitles"],Aa.prototype.controlText_="Subtitles",co.registerComponent("SubsCapsButton",Aa);var ys=function(e){function t(t,i){function n(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];r.handleTracksChange.apply(uo(r),t)}var r,a=i.track,o=t.audioTracks();return i.label=a.label||a.language||"Unknown",i.selected=a.enabled,(r=e.call(this,t,i)||this).track=a,r.addClass("vjs-"+a.kind+"-menu-item"),o.addEventListener("change",n),r.on("dispose",function(){o.removeEventListener("change",n)}),r}ho(t,e);var n=t.prototype;return n.createEl=function(t,n,r){var a='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return"main-desc"===this.options_.track.kind&&(a+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Descriptions")+"</span>\n "),e.prototype.createEl.call(this,t,i({innerHTML:a+="</span>"},n),r)},n.handleClick=function(t){e.prototype.handleClick.call(this,t),this.track.enabled=!0},n.handleTracksChange=function(e){this.selected(this.track.enabled)},t}(Sa);co.registerComponent("AudioTrackMenuItem",ys),Ia=function(e){function t(t,i){return(i=void 0===i?{}:i).tracks=t.audioTracks(),e.call(this,t,i)||this}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-audio-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-audio-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(e){void 0===e&&(e=[]),this.hideThreshold_=1;for(var t=this.player_.audioTracks(),i=0;i<t.length;i++){var n=t[i];e.push(new ys(this.player_,{track:n,selectable:!0,multiSelectable:!1}))}return e},t}(cs),Ia.prototype.controlText_="Audio Track",co.registerComponent("AudioTrackButton",Ia);var _s=function(e){function t(t,i){var n,r=i.rate,a=parseFloat(r,10);return i.label=r,i.selected=a===t.playbackRate(),i.selectable=!0,i.multiSelectable=!1,(n=e.call(this,t,i)||this).label=r,n.rate=a,n.on(t,"ratechange",function(e){return n.update(e)}),n}ho(t,e);var i=t.prototype;return i.handleClick=function(t){e.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},i.update=function(e){this.selected(this.player().playbackRate()===this.rate)},t}(Sa);_s.prototype.contentElType="button",co.registerComponent("PlaybackRateMenuItem",_s),za=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.menuButton_.el_.setAttribute("aria-describedby",n.labelElId_),n.updateVisibility(),n.updateLabel(),n.on(t,"loadstart",function(e){return n.updateVisibility(e)}),n.on(t,"ratechange",function(e){return n.updateLabel(e)}),n.on(t,"playbackrateschange",function(e){return n.handlePlaybackRateschange(e)}),n}ho(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this);return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=h("div",{className:"vjs-playback-rate-value",id:this.labelElId_,innerHTML:"1x"}),t.appendChild(this.labelEl_),t},i.dispose=function(){this.labelEl_=null,e.prototype.dispose.call(this)},i.buildCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-playback-rate "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){for(var e=this.playbackRates(),t=[],i=e.length-1;0<=i;i--)t.push(new _s(this.player(),{rate:e[i]+"x"}));return t},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){for(var t=this.player().playbackRate(),i=this.playbackRates(),n=i[0],r=0;r<i.length;r++)if(i[r]>t){n=i[r];break}this.player().playbackRate(n)},i.handlePlaybackRateschange=function(e){this.update()},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},t}(Ua),za.prototype.controlText_="Playback Rate",co.registerComponent("PlaybackRateMenuButton",za),Ea=function(e){function t(){return e.apply(this,arguments)||this}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},t}(co),co.registerComponent("Spacer",Ea),co.registerComponent("CustomControlSpacer",function(e){function t(){return e.apply(this,arguments)||this}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){var t=e.prototype.createEl.call(this,{className:this.buildCSSClass()});return t.innerHTML=" ",t},t}(Ea)),ua=function(e){function t(){return e.apply(this,arguments)||this}return ho(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(co),ua.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in da&&ua.prototype.options_.children.splice(ua.prototype.options_.children.length-1,0,"pictureInPictureToggle"),co.registerComponent("ControlBar",ua),sa=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n.on(t,"error",function(e){return n.open(e)}),n}ho(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(_o),sa.prototype.options_=xa({},_o.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),co.registerComponent("ErrorDisplay",sa);var bs="vjs-text-track-settings",ca=["#000","Black"],xo=["#00F","Blue"],Aa=["#0FF","Cyan"],cs=["#0F0","Green"],Ia=["#F0F","Magenta"],Sa=["#F00","Red"],Ua=["#FFF","White"],za=["#FF0","Yellow"],Ea=["1","Opaque"],ua=["0.5","Semi-Transparent"],sa=["0","Transparent"],ws={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[ca,Ua,Sa,cs,xo,za,Ia,Aa]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Ea,ua,sa]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ua,ca,Sa,cs,xo,za,Ia,Aa]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Ea,ua]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[sa,ua,Ea]}};ws.windowColor.options=ws.backgroundColor.options,co.registerComponent("TextTrackSettings",function(e){function i(i,n){var r;return n.temporary=!1,(r=e.call(this,i,n)||this).updateDisplay=r.updateDisplay.bind(uo(r)),r.fill(),r.hasBeenOpened_=r.hasBeenFilled_=!0,r.endDialog=h("p",{className:"vjs-control-text",textContent:r.localize("End of dialog window.")}),r.el().appendChild(r.endDialog),r.setDefaults(),void 0===n.persistTextTrackSettings&&(r.options_.persistTextTrackSettings=r.options_.playerOptions.persistTextTrackSettings),r.on(r.$(".vjs-done-button"),"click",function(){r.saveSettings(),r.close()}),r.on(r.$(".vjs-default-button"),"click",function(){r.setDefaults(),r.updateDisplay()}),t(ws,function(e){r.on(r.$(e.selector),"change",r.updateDisplay)}),r.options_.persistTextTrackSettings&&r.restoreSettings(),r}ho(i,e);var n=i.prototype;return n.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},n.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var e=ws[e],r=e.id.replace("%s",this.id_),a=[t,r].join(" ").trim();return["<"+i+' id="'+r+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(e.label),"</"+i+">",'<select aria-labelledby="'+a+'">'].concat(e.options.map(function(e){var t=r+"-"+e[1].replace(/\W+/g,"");return['<option id="'+t+'" value="'+e[0]+'" ','aria-labelledby="'+a+" "+t+'">',n.localize(e[1]),"</option>"].join("")})).concat("</select>").join("")},n.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",e),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",e),"</span>","</fieldset>"].join("")},n.createElBgColor_=function(){var e="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",e),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",e),"</span>","</fieldset>"].join("")},n.createElWinColor_=function(){var e="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+e+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",e),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",e),"</span>","</fieldset>"].join("")},n.createElColors_=function(){return h("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},n.createElFont_=function(){return h("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},n.createElControls_=function(){var e=this.localize("restore all settings to the default values");return h("div",{className:"vjs-track-settings-controls",innerHTML:['<button type="button" class="vjs-default-button" title="'+e+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+e+"</span>","</button>",'<button type="button" class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},n.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},n.label=function(){return this.localize("Caption Settings Dialog")},n.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},n.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},n.getValues=function(){var e,t,i,n=this;return t=function(e,t,i){var r,t=(r=n.$(t.selector),t=t.parser,rt(r.options[r.options.selectedIndex].value,t));return void 0!==t&&(e[i]=t),e},void 0===(i={})&&(i=0),Ca(e=ws).reduce(function(i,n){return t(i,e[n],n)},i)},n.setValues=function(e){var i=this;t(ws,function(t,n){!function(e,t,i){if(t)for(var n=0;n<e.options.length;n++)if(rt(e.options[n].value,i)===t){e.selectedIndex=n;break}}(i.$(t.selector),e[n],t.parser)})},n.setDefaults=function(){var e=this;t(ws,function(t){var i=t.hasOwnProperty("default")?t.default:0;e.$(t.selector).selectedIndex=i})},n.restoreSettings=function(){var e;try{e=JSON.parse(la.localStorage.getItem(bs))}catch(e){ba.warn(e)}e&&this.setValues(e)},n.saveSettings=function(){if(this.options_.persistTextTrackSettings){var e=this.getValues();try{Object.keys(e).length?la.localStorage.setItem(bs,JSON.stringify(e)):la.localStorage.removeItem(bs)}catch(e){ba.warn(e)}}},n.updateDisplay=function(){var e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()},n.conditionalBlur_=function(){this.previouslyActiveEl_=null;var e=this.player_.controlBar,t=e&&e.subsCapsButton,e=e&&e.captionsButton;t?t.focus():e&&e.focus()},i}(_o)),co.registerComponent("ResizeManager",function(e){function t(t,i){var n,r=i.ResizeObserver||la.ResizeObserver,a=le({createEl:!(r=null!==i.ResizeObserver&&r),reportTouchActivity:!1},i);return(n=e.call(this,t,a)||this).ResizeObserver=i.ResizeObserver||la.ResizeObserver,n.loadListener_=null,n.resizeObserver_=null,n.debouncedHandler_=K(function(){n.resizeHandler()},100,!1,uo(n)),r?(n.resizeObserver_=new n.ResizeObserver(n.debouncedHandler_),n.resizeObserver_.observe(t.el())):(n.loadListener_=function(){var e,t;n.el_&&n.el_.contentWindow&&(e=n.debouncedHandler_,t=n.unloadListener_=function(){q(this,"resize",e),q(this,"unload",t),t=null},$(n.el_.contentWindow,"unload",t),$(n.el_.contentWindow,"resize",e))},n.one("load",n.loadListener_)),n}ho(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager",tabIndex:-1},{"aria-hidden":"true"})},i.resizeHandler=function(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")},i.dispose=function(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,e.prototype.dispose.call(this)},t}(co));var xs={trackingThreshold:30,liveTolerance:15};co.registerComponent("LiveTracker",function(e){function t(t,i){var i=le(xs,i,{createEl:!1}),n=e.call(this,t,i)||this;return n.handleVisibilityChange_=function(e){return n.handleVisibilityChange(e)},n.trackLiveHandler_=function(){return n.trackLive_()},n.handlePlay_=function(e){return n.handlePlay(e)},n.handleFirstTimeupdate_=function(e){return n.handleFirstTimeupdate(e)},n.handleSeeked_=function(e){return n.handleSeeked(e)},n.seekToLiveEdge_=function(e){return n.seekToLiveEdge(e)},n.reset_(),n.on(n.player_,"durationchange",function(e){return n.handleDurationchange(e)}),n.one(n.player_,"canplay",function(){return n.toggleTracking()}),ja&&"hidden"in da&&"visibilityState"in da&&n.on(da,"visibilitychange",n.handleVisibilityChange_),n}ho(t,e);var i=t.prototype;return i.handleVisibilityChange=function(){this.player_.duration()===1/0&&(da.hidden?this.stopTracking():this.startTracking())},i.trackLive_=function(){var e,t=this.player_.seekable();t&&t.length&&(e=Number(la.performance.now().toFixed(4)),t=-1===this.lastTime_?0:(e-this.lastTime_)/1e3,this.lastTime_=e,this.pastSeekEnd_=this.pastSeekEnd()+t,e=this.liveCurrentTime(),t=this.player_.currentTime(),t=this.player_.paused()||this.seekedBehindLive_||Math.abs(e-t)>this.options_.liveTolerance,(t=!(!this.timeupdateSeen_||e===1/0)&&t)!==this.behindLiveEdge_&&(this.behindLiveEdge_=t,this.trigger("liveedgechange")))},i.handleDurationchange=function(){this.toggleTracking()},i.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},i.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&2<e,this.nextSeekedFromUser_=!1,this.trackLive_()},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},i.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,
|
||
this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},i.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"==typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},i.dispose=function(){this.off(da,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(co));var ks,Cs=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(e){var t=da.createElement(this.nodeName.toLowerCase());t.innerHTML=e;for(var i=da.createDocumentFragment();t.childNodes.length;)i.appendChild(t.childNodes[0]);return this.innerText="",la.Element.prototype.appendChild.call(this,i),this.innerHTML}}),Ts=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?be(la.Element.prototype.getAttribute.call(this,"src")):""},set:function(e){return la.Element.prototype.setAttribute.call(this,"src",e),e}}),Ss=function(e){function t(t,i){var n=e.call(this,t,i)||this,i=t.source,r=!1;if(i&&(n.el_.currentSrc!==i.src||t.tag&&3===t.tag.initNetworkState_)?n.setSource(i):n.handleLateInit_(n.el_),t.enableSourceset&&n.setupSourcesetHandling_(),n.isScrubbing_=!1,n.el_.hasChildNodes()){for(var a=n.el_.childNodes,o=a.length,s=[];o--;){var l=a[o];"track"===l.nodeName.toLowerCase()&&(n.featuresNativeTextTracks?(n.remoteTextTrackEls().addTrackElement_(l),n.remoteTextTracks().addTrack(l.track),n.textTracks().addTrack(l.track),r||n.el_.hasAttribute("crossorigin")||!xe(l.src)||(r=!0)):s.push(l))}for(var c=0;c<s.length;c++)n.el_.removeChild(s[c])}return n.proxyNativeTracks_(),n.featuresNativeTextTracks&&r&&ba.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),n.restoreMetadataTracksInIOSNativePlayer_(),(Ba||$a||La)&&!0===t.nativeControlsForTouch&&n.setControls(!0),n.proxyWebkitFullscreen_(),n.triggerReady(),n}ho(t,e);var n=t.prototype;return n.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),t.disposeMediaElement(this.el_),this.options_=null,e.prototype.dispose.call(this)},n.setupSourcesetHandling_=function(){lt(this)},n.restoreMetadataTracksInIOSNativePlayer_=function(){function e(){i=[];for(var e=0;e<n.length;e++){var t=n[e];"metadata"===t.kind&&i.push({track:t,storedMode:t.mode})}}function t(){for(var e=0;e<i.length;e++){var r=i[e];"disabled"===r.track.mode&&r.track.mode!==r.storedMode&&(r.track.mode=r.storedMode)}n.removeEventListener("change",t)}var i,n=this.textTracks();e(),n.addEventListener("change",e),this.on("dispose",function(){return n.removeEventListener("change",e)}),this.on("webkitbeginfullscreen",function(){n.removeEventListener("change",e),n.removeEventListener("change",t),n.addEventListener("change",t)}),this.on("webkitendfullscreen",function(){n.removeEventListener("change",e),n.addEventListener("change",e),n.removeEventListener("change",t)})},n.overrideNative_=function(e,t){var i,n=this;t===this["featuresNative"+e+"Tracks"]&&(this[(i=e.toLowerCase())+"TracksListeners_"]&&Object.keys(this[i+"TracksListeners_"]).forEach(function(e){n.el()[i+"Tracks"].removeEventListener(e,n[i+"TracksListeners_"][e])}),this["featuresNative"+e+"Tracks"]=!t,this[i+"TracksListeners_"]=null,this.proxyNativeTracksForType_(i))},n.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},n.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},n.proxyNativeTracksForType_=function(e){var t,i,n=this,r=Ro[e],a=this.el()[r.getterName],o=this[r.getterName]();this["featuresNative"+r.capitalName+"Tracks"]&&a&&a.addEventListener&&(i=function(){for(var e=[],t=0;t<o.length;t++){for(var i=!1,n=0;n<a.length;n++)if(a[n]===o[t]){i=!0;break}i||e.push(o[t])}for(;e.length;)o.removeTrack(e.shift())},this[r.getterName+"Listeners_"]=t={change:function(t){var i={type:"change",target:o,currentTarget:o,srcElement:o};o.trigger(i),"text"===e&&n[jo.remoteText.getterName]().trigger(i)},addtrack:function(e){o.addTrack(e.track)},removetrack:function(e){o.removeTrack(e.track)}},Object.keys(t).forEach(function(e){var i=t[e];a.addEventListener(e,i),n.on("dispose",function(t){return a.removeEventListener(e,i)})}),this.on("loadstart",i),this.on("dispose",function(e){return n.off("loadstart",i)}))},n.proxyNativeTracks_=function(){var e=this;Ro.names.forEach(function(t){e.proxyNativeTracksForType_(t)})},n.createEl=function(){var e,n=this.options_.tag;n&&(this.options_.playerElIngest||this.movingMediaElementInDOM)||(n?(e=n.cloneNode(!0),n.parentNode&&n.parentNode.insertBefore(e,n),t.disposeMediaElement(n),n=e):(n=da.createElement("video"),e=le({},this.options_.tag&&b(this.options_.tag)),Ba&&!0===this.options_.nativeControlsForTouch||delete e.controls,_(n,i(e,{id:this.options_.techId,class:"vjs-tech"}))),n.playerId=this.options_.playerId),void 0!==this.options_.preload&&x(n,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(n.disablePictureInPicture=this.options_.disablePictureInPicture);for(var r=["loop","muted","playsinline","autoplay"],a=0;a<r.length;a++){var o=r[a],s=this.options_[o];void 0!==s&&(s?x(n,o,o):k(n,o),n[o]=s)}return n},n.handleLateInit_=function(e){if(0!==e.networkState&&3!==e.networkState){if(0===e.readyState){var t=!1,i=function(){t=!0};this.on("loadstart",i);var n=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",n),void this.ready(function(){this.off("loadstart",i),this.off("loadedmetadata",n),t||this.trigger("loadstart")})}var r=["loadstart"];r.push("loadedmetadata"),2<=e.readyState&&r.push("loadeddata"),3<=e.readyState&&r.push("canplay"),4<=e.readyState&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e)},this)})}},n.setScrubbing=function(e){this.isScrubbing_=e},n.scrubbing=function(){return this.isScrubbing_},n.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&Ha?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){ba(e,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;return this.el_.duration===1/0&&Da&&Pa&&0===this.el_.currentTime?(this.on("timeupdate",function t(){0<e.el_.currentTime&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))}),NaN):this.el_.duration||NaN},n.width=function(){return this.el_.offsetWidth},n.height=function(){return this.el_.offsetHeight},n.proxyWebkitFullscreen_=function(){var e,t,i=this;"webkitDisplayingFullscreen"in this.el_&&(e=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},t=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))},this.on("webkitbeginfullscreen",t),this.on("dispose",function(){i.off("webkitbeginfullscreen",t),i.off("webkitendfullscreen",e)}))},n.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=la.navigator&&la.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},n.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)me(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},n.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},n.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},n.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},n.reset=function(){t.resetMediaElement(this.el_)},n.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},n.setControls=function(e){this.el_.controls=!!e},n.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},n.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=da.createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t.default&&(i.default=t.default),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},n.addRemoteTextTrack=function(t,i){return i=e.prototype.addRemoteTextTrack.call(this,t,i),this.featuresNativeTextTracks&&this.el().appendChild(i),i},n.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])},n.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),la.performance&&"function"==typeof la.performance.now?e.creationTime=la.performance.now():la.performance&&la.performance.timing&&"number"==typeof la.performance.timing.navigationStart&&(e.creationTime=la.Date.now()-la.performance.timing.navigationStart),e},t}(Zo);ct(Ss,"TEST_VID",function(){if(l()){var e=da.createElement("video"),t=da.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}}),Ss.isSupported=function(){try{Ss.TEST_VID.volume=.5}catch(e){return!1}return!(!Ss.TEST_VID||!Ss.TEST_VID.canPlayType)},Ss.canPlayType=function(e){return Ss.TEST_VID.canPlayType(e)},Ss.canPlaySource=function(e,t){return Ss.canPlayType(e.type)},Ss.canControlVolume=function(){try{var e=Ss.TEST_VID.volume;return Ss.TEST_VID.volume=e/2+.1,e!==Ss.TEST_VID.volume}catch(e){return!1}},Ss.canMuteVolume=function(){try{var e=Ss.TEST_VID.muted;return Ss.TEST_VID.muted=!e,Ss.TEST_VID.muted?x(Ss.TEST_VID,"muted","muted"):k(Ss.TEST_VID,"muted"),e!==Ss.TEST_VID.muted}catch(e){return!1}},Ss.canControlPlaybackRate=function(){if(Da&&Pa&&Ra<58)return!1;try{var e=Ss.TEST_VID.playbackRate;return Ss.TEST_VID.playbackRate=e/2+.1,e!==Ss.TEST_VID.playbackRate}catch(e){return!1}},Ss.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(da.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(da.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(da.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(da.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Ss.supportsNativeTextTracks=function(){return Ha||qa&&Pa},Ss.supportsNativeVideoTracks=function(){return!(!Ss.TEST_VID||!Ss.TEST_VID.videoTracks)},Ss.supportsNativeAudioTracks=function(){return!(!Ss.TEST_VID||!Ss.TEST_VID.audioTracks)},Ss.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresVolumeControl","canControlVolume"],["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var t=e[0],i=e[1];ct(Ss.prototype,t,function(){return Ss[i]()},!0)}),Ss.prototype.movingMediaElementInDOM=!qa,Ss.prototype.featuresFullscreenResize=!0,Ss.prototype.featuresProgressEvents=!0,Ss.prototype.featuresTimeupdateEvents=!0,Ss.patchCanPlayType=function(){4<=Ma&&!Oa&&!Pa&&(ks=Ss.TEST_VID&&Ss.TEST_VID.constructor.prototype.canPlayType,Ss.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":ks.call(this,e)})},Ss.unpatchCanPlayType=function(){var e=Ss.TEST_VID.constructor.prototype.canPlayType;return ks&&(Ss.TEST_VID.constructor.prototype.canPlayType=ks),e},Ss.patchCanPlayType(),Ss.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Ss.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Ss.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Ss.prototype["set"+se(e)]=function(t){(this.el_[e]=t)?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){Ss.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){Ss.prototype["set"+se(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){Ss.prototype[e]=function(){return this.el_[e]()}}),Zo.withSourceHandlers(Ss),Ss.nativeSourceHandler={},Ss.nativeSourceHandler.canPlayType=function(e){try{return Ss.TEST_VID.canPlayType(e)}catch(e){return""}},Ss.nativeSourceHandler.canHandleSource=function(e,t){return e.type?Ss.nativeSourceHandler.canPlayType(e.type):e.src?(e=we(e.src),Ss.nativeSourceHandler.canPlayType("video/"+e)):""},Ss.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},Ss.nativeSourceHandler.dispose=function(){},Ss.registerSourceHandler(Ss.nativeSourceHandler),Zo.registerTech("Html5",Ss);var Es=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],As={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Is=["tiny","xsmall","small","medium","large","xlarge","huge"],Ds={};Is.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Ds[e]="vjs-layout-"+t});var Ms={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},Ls=function(e){function t(n,r,a){var o,s;if(n.id=n.id||r.id||"vjs_video_"+Qa++,(r=i(t.getTagSettings(n),r)).initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if("function"==typeof n.closest){var l=n.closest("[lang]");l&&l.getAttribute&&(r.language=l.getAttribute("lang"))}else for(var c=n;c&&1===c.nodeType;){if(b(c).hasOwnProperty("lang")){r.language=c.getAttribute("lang");break}c=c.parentNode}if((o=e.call(this,null,r,a)||this).boundDocumentFullscreenChange_=function(e){return o.documentFullscreenChange_(e)},o.boundFullWindowOnEscKey_=function(e){return o.fullWindowOnEscKey(e)},o.boundUpdateStyleEl_=function(e){return o.updateStyleEl_(e)},o.boundApplyInitTime_=function(e){return o.applyInitTime_(e)},o.boundUpdateCurrentBreakpoint_=function(e){return o.updateCurrentBreakpoint_(e)},o.boundHandleTechClick_=function(e){return o.handleTechClick_(e)},o.boundHandleTechDoubleClick_=function(e){return o.handleTechDoubleClick_(e)},o.boundHandleTechTouchStart_=function(e){return o.handleTechTouchStart_(e)},o.boundHandleTechTouchMove_=function(e){return o.handleTechTouchMove_(e)},o.boundHandleTechTouchEnd_=function(e){return o.handleTechTouchEnd_(e)},o.boundHandleTechTap_=function(e){return o.handleTechTap_(e)},o.isFullscreen_=!1,o.log=wa(o.id_),o.fsApi_=ha,o.isPosterFromTech_=!1,o.queuedCallbacks_=[],o.isReady_=!1,o.hasStarted_=!1,o.userActive_=!1,o.debugEnabled_=!1,!o.options_||!o.options_.techOrder||!o.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");return o.tag=n,o.tagAttributes=n&&b(n),o.language(o.options_.language),r.languages?(s={},Object.getOwnPropertyNames(r.languages).forEach(function(e){s[e.toLowerCase()]=r.languages[e]}),o.languages_=s):o.languages_=t.prototype.options_.languages,o.resetCache_(),o.poster_=r.poster||"",o.controls_=!!r.controls,n.controls=!1,n.removeAttribute("controls"),o.changingSrc_=!1,o.playCallbacks_=[],o.playTerminatedQueue_=[],n.hasAttribute("autoplay")?o.autoplay(!0):o.autoplay(o.options_.autoplay),r.plugins&&Object.keys(r.plugins).forEach(function(e){if("function"!=typeof o[e])throw new Error('plugin "'+e+'" does not exist')}),o.scrubbing_=!1,o.el_=o.createEl(),re(uo(o),{eventBusKey:"el_"}),o.fsApi_.requestFullscreen&&($(da,o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_),o.on(o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_)),o.fluid_&&o.on(["playerreset","resize"],o.boundUpdateStyleEl_),a=le(o.options_),r.plugins&&Object.keys(r.plugins).forEach(function(e){o[e](r.plugins[e])}),r.debug&&o.debug(!0),o.options_.playerOptions=a,o.middleware_=[],o.playbackRates(r.playbackRates),o.initChildren(),o.isAudio("audio"===n.nodeName.toLowerCase()),o.controls()?o.addClass("vjs-controls-enabled"):o.addClass("vjs-controls-disabled"),o.el_.setAttribute("role","region"),o.isAudio()?o.el_.setAttribute("aria-label",o.localize("Audio Player")):o.el_.setAttribute("aria-label",o.localize("Video Player")),o.isAudio()&&o.addClass("vjs-audio"),o.flexNotSupported_()&&o.addClass("vjs-no-flex"),Ba&&o.addClass("vjs-touch-enabled"),qa||o.addClass("vjs-workinghover"),t.players[o.id_]=uo(o),n=oa.split(".")[0],o.addClass("vjs-v"+n),o.userActive(!0),o.reportUserActivity(),o.one("play",function(e){return o.listenForUserActivity_(e)}),o.on("stageclick",function(e){return o.handleStageClick_(e)}),o.on("keydown",function(e){return o.handleKeyDown(e)}),o.on("languagechange",function(e){return o.handleLanguagechange(e)}),o.breakpoints(o.options_.breakpoints),o.responsive(o.options_.responsive),o}ho(t,e);var n=t.prototype;return n.dispose=function(){var i=this;this.trigger("dispose"),this.off("dispose"),q(da,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),q(da,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),t.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),es[this.id()]=null,zo.names.forEach(function(e){e=zo[e],e=i[e.getterName](),e&&e.off&&e.off()}),e.prototype.dispose.call(this)},n.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a,o,s=b(i);if(r){for(t=this.el_=i,i=this.tag=da.createElement("video");t.children.length;)i.appendChild(t.firstChild);m(t,"video-js")||g(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach(function(e){try{i[e]=t[e]}catch(e){}})}i.setAttribute("tabindex","-1"),s.tabindex="-1",(ja||Pa&&Fa)&&(i.setAttribute("role","application"),s.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(e){r&&"class"===e||t.setAttribute(e,s[e]),r&&i.setAttribute(e,s[e])}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",(i.player=t.player=this).addClass("vjs-paused"),!0!==la.VIDEOJS_NO_DYNAMIC_STYLE&&(this.styleEl_=j("vjs-styles-dimensions"),a=Va(".vjs-styles-defaults"),(o=Va("head")).insertBefore(this.styleEl_,a?a.nextSibling:o.firstChild)),this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var l=i.getElementsByTagName("a"),c=0;c<l.length;c++){var u=l.item(c);g(u,"vjs-hidden"),u.setAttribute("hidden","hidden")}return i.initNetworkState_=i.networkState,i.parentNode&&!n&&i.parentNode.insertBefore(t,i),f(i,t),this.children_.unshift(i),this.el_.setAttribute("lang",this.language_),this.el_=t},n.crossOrigin=function(e){if(!e)return this.techGet_("crossOrigin");"anonymous"===e||"use-credentials"===e?this.techCall_("setCrossOrigin",e):ba.warn('crossOrigin must be "anonymous" or "use-credentials", given "'+e+'"')},n.width=function(e){return this.dimension("width",e)},n.height=function(e){return this.dimension("height",e)},n.dimension=function(e,t){var i=e+"_";if(void 0===t)return this[i]||0;if(""===t||"auto"===t)return this[i]=void 0,void this.updateStyleEl_();var n=parseFloat(t);isNaN(n)?ba.error('Improper value "'+t+'" supplied for for '+e):(this[i]=n,this.updateStyleEl_())},n.fluid=function(e){var t,i=this;if(void 0===e)return!!this.fluid_;this.fluid_=!!e,ro(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),t=function(){i.on(["playerreset","resize"],i.boundUpdateStyleEl_)},ro(e=this)?t():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(t))):this.removeClass("vjs-fluid"),this.updateStyleEl_()},n.fill=function(e){if(void 0===e)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")},n.aspectRatio=function(e){if(void 0===e)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()},n.updateStyleEl_=function(){var e,t,i,n;!0!==la.VIDEOJS_NO_DYNAMIC_STYLE?(n=(i=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:0<this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"))[1]/i[0],e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/n:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*n,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),z(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid {\n padding-top: "+100*n+"%;\n }\n ")):(t="number"==typeof this.width_?this.width_:this.options_.width,i="number"==typeof this.height_?this.height_:this.options_.height,(n=this.tech_&&this.tech_.el())&&(0<=t&&(n.width=t),0<=i&&(n.height=i)))},n.loadTech_=function(e,t){var n=this;this.tech_&&this.unloadTech_();var r=se(e),a=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==r&&this.tag&&(Zo.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=r,this.isReady_=!1;var o=this.autoplay(),s={source:t,autoplay:o=!("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&o,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+a+"_api",playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset,Promise:this.options_.Promise};if(zo.names.forEach(function(e){e=zo[e],s[e.getterName]=n[e.privateName]}),i(s,this.options_[r]),i(s,this.options_[a]),i(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&0<this.cache_.currentTime&&(s.startTime=this.cache_.currentTime),!(e=Zo.getTech(e)))throw new Error("No Tech named '"+r+"' exists! '"+r+"' should be registered using videojs.registerTech()'");this.tech_=new e(s),this.tech_.ready(G(this,this.handleTechReady_),!0),go(this.textTracksJson_||[],this.tech_),Es.forEach(function(e){n.on(n.tech_,e,function(t){return n["handleTech"+se(e)+"_"](t)})}),Object.keys(As).forEach(function(e){n.on(n.tech_,e,function(t){0===n.tech_.playbackRate()&&n.tech_.seeking()?n.queuedCallbacks_.push({callback:n["handleTech"+As[e]+"_"].bind(n),event:t}):n["handleTech"+As[e]+"_"](t)})}),this.on(this.tech_,"loadstart",function(e){return n.handleTechLoadStart_(e)}),this.on(this.tech_,"sourceset",function(e){return n.handleTechSourceset_(e)}),this.on(this.tech_,"waiting",function(e){return n.handleTechWaiting_(e)}),this.on(this.tech_,"ended",function(e){return n.handleTechEnded_(e)}),this.on(this.tech_,"seeking",function(e){return n.handleTechSeeking_(e)}),this.on(this.tech_,"play",function(e){return n.handleTechPlay_(e)}),this.on(this.tech_,"firstplay",function(e){return n.handleTechFirstPlay_(e)}),this.on(this.tech_,"pause",function(e){return n.handleTechPause_(e)}),this.on(this.tech_,"durationchange",function(e){return n.handleTechDurationChange_(e)}),this.on(this.tech_,"fullscreenchange",function(e,t){return n.handleTechFullscreenChange_(e,t)}),this.on(this.tech_,"fullscreenerror",function(e,t){return n.handleTechFullscreenError_(e,t)}),this.on(this.tech_,"enterpictureinpicture",function(e){return n.handleTechEnterPictureInPicture_(e)}),this.on(this.tech_,"leavepictureinpicture",function(e){return n.handleTechLeavePictureInPicture_(e)}),this.on(this.tech_,"error",function(e){return n.handleTechError_(e)}),this.on(this.tech_,"posterchange",function(e){return n.handleTechPosterChange_(e)}),this.on(this.tech_,"textdata",function(e){return n.handleTechTextData_(e)}),this.on(this.tech_,"ratechange",function(e){return n.handleTechRateChange_(e)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===r&&this.tag||f(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e=this;zo.names.forEach(function(t){t=zo[t],e[t.privateName]=e[t.getterName]()}),this.textTracksJson_=mo(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(e){return void 0===e&&ba.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mouseup",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},n.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"mouseup",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},n.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var i,n=function(){function e(){t.muted(i)}var i=t.muted();t.muted(!0),t.playTerminatedQueue_.push(e);var n=t.play();if(fe(n))return n.catch(function(t){throw e(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(t||""))})};if("any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():n():fe(i=this.play())&&(i=i.catch(n)),fe(i))return i.then(function(){t.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){t.trigger({type:"autoplay-failure",autoplay:e})})}},n.updateSourceCaches_=function(e){var t=e=void 0===e?"":e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(function(e){return e.src===t});if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r<n.length;r++){var a=n[r];if(a.type&&a.src&&a.src===t)return a.type}return Ke(t)}(this,t)),this.cache_.source=le({},e,{src:t,type:i});for(var i=this.cache_.sources.filter(function(e){return e.src&&e.src===t}),n=[],r=this.$$("source"),a=[],o=0;o<r.length;o++){var s=b(r[o]);n.push(s),s.src&&s.src===t&&a.push(s.src)}a.length&&!i.length?this.cache_.sources=n:i.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t},n.handleTechSourceset_=function(e){var t,i,n,r=this;this.changingSrc_||(t=function(e){return r.updateSourceCaches_(e)},i=this.currentSource().src,n=e.src,i&&!/^blob:/.test(i)&&/^blob:/.test(n)&&(this.lastSource_&&(this.lastSource_.tech===n||this.lastSource_.player===i)||(t=function(){})),t(n),e.src||this.tech_.any(["sourceset","loadstart"],function(e){"sourceset"!==e.type&&(e=r.techGet("currentSrc"),r.lastSource_.tech=e,r.updateSourceCaches_(e))})),this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},n.hasStarted=function(e){if(void 0===e)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},n.handleTechPlay_=function(){this.removeClass("vjs-ended"),
|
||
this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},n.handleTechRateChange_=function(){0<this.tech_.playbackRate()&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))})},n.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},n.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},n.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},n.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},n.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},n.handleTechFirstPlay_=function(){this.options_.starttime&&(ba.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},n.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},n.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},n.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},n.handleTechClick_=function(e){N(e)&&this.controls_&&(this.paused()?me(this.play()):this.pause())},n.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(t){return t.contains(e.target)})||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},n.handleTechTap_=function(){this.userActive(!this.userActive())},n.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},n.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},n.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},n.handleStageClick_=function(){this.reportUserActivity()},n.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},n.documentFullscreenChange_=function(e){var t=e.target.player;t&&t!==this||(e=this.el(),!(t=da[this.fsApi_.fullscreenElement]===e)&&e.matches?t=e.matches(":"+this.fsApi_.fullscreen):!t&&e.msMatchesSelector&&(t=e.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(t))},n.handleTechFullscreenChange_=function(e,t){t&&(t.nativeIOSFullscreen&&this.toggleClass("vjs-ios-native-fs"),this.isFullscreen(t.isFullscreen))},n.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},n.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},n.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},n.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},n.handleTechError_=function(){var e=this.tech_.error();this.error(e)},n.handleTechTextData_=function(){this.trigger("textdata",1<arguments.length?arguments[1]:null)},n.getCache=function(){return this.cache_},n.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},n.techCall_=function(e,t){this.ready(function(){if(e in ns)return i=this.middleware_,n=this.tech_,r=t,n[n=e](i.reduce(Ge(n),r));if(e in rs)return Ve(this.middleware_,this.tech_,e,t);var i,n,r;try{this.tech_&&this.tech_[e](t)}catch(i){throw ba(i),i}},!0)},n.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in is)return t=this.middleware_,i=this.tech_,n=e,t.reduceRight(Ge(n),i[n]());if(e in rs)return Ve(this.middleware_,this.tech_,e);var t,i,n;try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw ba("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw ba("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw ba(t),t}}},n.play=function(){var e=this,t=this.options_.Promise||la.Promise;return t?new t(function(t){e.play_(t)}):this.play_()},n.play_=function(e){var t=this;if(this.playCallbacks_.push(e=void 0===e?me:e),e=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!e)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(e||!Ha&&!qa||this.load());e=this.techGet_("play"),null===e?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(e)},n.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})},n.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})},n.pause=function(){this.techCall_("pause")},n.paused=function(){return!1!==this.techGet_("paused")},n.played=function(){return this.techGet_("played")||de(0,0)},n.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},n.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},n.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},n.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=(e=parseFloat(e))<0?1/0:e)!==this.cache_.duration&&((this.cache_.duration=e)===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))},n.remainingTime=function(){return this.duration()-this.currentTime()},n.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},n.buffered=function(){var e;return e=(e=this.techGet_("buffered"))&&e.length?e:de(0,0)},n.bufferedPercent=function(){return he(this.buffered(),this.duration())},n.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),e=e.end(e.length-1);return e=t<e?t:e},n.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(0<t&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},n.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},n.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},n.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},n.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},n.isFullscreen=function(e){if(void 0===e)return this.isFullscreen_;var t=this.isFullscreen_;this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_()},n.requestFullscreen=function(e){var t=this.options_.Promise||la.Promise;if(t){var i=this;return new t(function(t,n){function r(){i.off("fullscreenerror",o),i.off("fullscreenchange",a)}function a(){r(),t()}function o(e,t){r(),n(t)}i.one("fullscreenchange",a),i.one("fullscreenerror",o);var s=i.requestFullscreenHelper_(e);s&&(s.then(r,r),s.then(t,n))})}return this.requestFullscreenHelper_()},n.requestFullscreenHelper_=function(e){var t=this;if(this.fsApi_.prefixed||(i=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(i=e)),this.fsApi_.requestFullscreen){var i=this.el_[this.fsApi_.requestFullscreen](i);return i&&i.then(function(){return t.isFullscreen(!0)},function(){return t.isFullscreen(!1)}),i}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},n.exitFullscreen=function(){var e=this.options_.Promise||la.Promise;if(e){var t=this;return new e(function(e,i){function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){n(),e()}function a(e,t){n(),i(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var o=t.exitFullscreenHelper_();o&&(o.then(n,n),o.then(e,i))})}return this.exitFullscreenHelper_()},n.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=da[this.fsApi_.exitFullscreen]();return t&&me(t.then(function(){return e.isFullscreen(!1)})),t}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},n.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=da.documentElement.style.overflow,$(da,"keydown",this.boundFullWindowOnEscKey_),da.documentElement.style.overflow="hidden",g(da.body,"vjs-full-window"),this.trigger("enterFullWindow")},n.fullWindowOnEscKey=function(e){vo.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},n.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,q(da,"keydown",this.boundFullWindowOnEscKey_),da.documentElement.style.overflow=this.docOrigOverflow,v(da.body,"vjs-full-window"),this.trigger("exitFullWindow")},n.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},n.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},n.requestPictureInPicture=function(){if("pictureInPictureEnabled"in da&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},n.exitPictureInPicture=function(){if("pictureInPictureEnabled"in da)return da.exitPictureInPicture()},n.handleKeyDown=function(e){var t=this.options_.userActions;t&&t.hotkeys&&(function(e){var t=e.tagName.toLowerCase();return!!e.isContentEditable||("input"===t?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(e.type):-1!==["textarea"].indexOf(t))}(this.el_.ownerDocument.activeElement)||("function"==typeof t.hotkeys?t.hotkeys.call(this,e):this.handleHotkeys(e)))},n.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=t.muteKey,n=void 0===n?function(e){return vo.isEventKey(e,"m")}:n,t=t.playPauseKey,t=void 0===t?function(e){return vo.isEventKey(e,"k")||vo.isEventKey(e,"Space")}:t;(void 0===i?function(e){return vo.isEventKey(e,"f")}:i).call(this,e)?(e.preventDefault(),e.stopPropagation(),i=co.getComponent("FullscreenToggle"),!1!==da[this.fsApi_.fullscreenEnabled]&&i.prototype.handleClick.call(this,e)):n.call(this,e)?(e.preventDefault(),e.stopPropagation(),co.getComponent("MuteToggle").prototype.handleClick.call(this,e)):t.call(this,e)&&(e.preventDefault(),e.stopPropagation(),co.getComponent("PlayToggle").prototype.handleClick.call(this,e))},n.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i<n.length;i++){var r=n[i],a=Zo.getTech(r);if(a=a||co.getComponent(r)){if(a.isSupported()&&(t=a.canPlayType(e)))return t}else ba.error('The "'+r+'" tech is undefined. Skipped browser support check for that tech.')}return""},n.selectSource=function(e){function t(e,t,i){var n;return e.some(function(e){return t.some(function(t){if(n=i(e,t))return!0})}),n}var i,n=this,r=this.options_.techOrder.map(function(e){return[e,Zo.getTech(e)]}).filter(function(e){var t=e[0],e=e[1];return e?e.isSupported():(ba.error('The "'+t+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),a=function(e,t){var i=e[0];if(e[1].canPlaySource(t,n.options_[i.toLowerCase()]))return{source:t,tech:i}},a=this.options_.sourceOrder?t(e,r,(i=a,function(e,t){return i(t,e)})):t(r,e,a);return a||!1},n.handleSrc_=function(e,t){var i=this;if(void 0===e)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();var n,r,a=Xe(e);a.length?(this.changingSrc_=!0,t||(this.cache_.sources=a),this.updateSourceCaches_(a[0]),We(this,a[0],function(e,n){var r;return i.middleware_=n,t||(i.cache_.sources=a),i.updateSourceCaches_(e),i.src_(e)?1<a.length?i.handleSrc_(a.slice(1)):(i.changingSrc_=!1,i.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void i.triggerReady()):(n=n,r=i.tech_,void n.forEach(function(e){return e.setTech&&e.setTech(r)}))}),this.options_.retryOnError&&1<a.length&&(r=function(){i.off("error",n)},this.one("error",n=function(){i.error(null),i.handleSrc_(a.slice(1),!0)}),this.one("playing",r),this.resetRetryOnError_=function(){i.off("error",n),i.off("playing",r)})):this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},n.src=function(e){return this.handleSrc_(e,!1)},n.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,se(t)!==se(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready(function(){n.changingSrc_=!1})):this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1)},n.load=function(){this.techCall_("load")},n.reset=function(){var e=this,t=this.options_.Promise||la.Promise;this.paused()||!t?this.doReset_():me(this.play().then(function(){return e.doReset_()}))},n.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),ro(this)&&this.trigger("playerreset")},n.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},n.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar,t=e.durationDisplay,e=e.remainingTimeDisplay;t&&t.updateContent(),e&&e.updateContent()},n.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},n.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},n.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},n.currentSource=function(){return this.cache_.source||{}},n.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},n.currentType=function(){return this.currentSource()&&this.currentSource().type||""},n.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},n.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},n.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},n.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},n.poster=function(e){if(void 0===e)return this.poster_;(e=e||"")!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},n.handleTechPosterChange_=function(){var e;this.poster_&&!this.options_.techCanOverridePoster||!this.tech_||!this.tech_.poster||(e=this.tech_.poster()||"")!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))},n.controls=function(e){if(void 0===e)return!!this.controls_;this.controls_!==(e=!!e)&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))},n.usingNativeControls=function(e){if(void 0===e)return!!this.usingNativeControls_;this.usingNativeControls_!==(e=!!e)&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))},n.error=function(e){if(void 0===e)return this.error_||null;if(this.options_.suppressNotSupportedError&&e&&4===e.code){var t=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),void this.one("loadstart",function(){this.off(["click","touchstart"],t)})}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new pe(e),this.addClass("vjs-error"),ba.error("(CODE:"+this.error_.code+" "+pe.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error")},n.reportUserActivity=function(e){this.userActivity_=!0},n.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},n.listenForUserActivity_=function(){var e,t,i,n=G(this,this.reportUserActivity),r=function(t){n(),this.clearInterval(e)};this.on("mousedown",function(){n(),this.clearInterval(e),e=this.setInterval(n,250)}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())}),this.on("mouseup",r),this.on("mouseleave",r);var a,r=this.getChild("controlBar");!r||qa||Da||(r.on("mouseenter",function(e){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout,this.player().options_.inactivityTimeout=0}),r.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",n),this.on("keyup",n),this.setInterval(function(){var e;this.userActivity_&&(this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a),(e=this.options_.inactivityTimeout)<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e)))},250)},n.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},n.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},n.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},n.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},n.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},n.removeRemoteTextTrack=function(e){var t=(t=(e=void 0===e?{}:e).track)||e;if(this.tech_)return this.tech_.removeRemoteTextTrack(t)},n.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},n.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},n.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},n.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),ro(this)&&this.trigger("languagechange"))},n.languages=function(){return le(t.prototype.options_.languages,this.languages_)},n.toJSON=function(){var e=le(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i<t.length;i++){var n=t[i];(n=le(n)).player=void 0,e.tracks[i]=n}return e},n.createModal=function(e,t){var i=this;(t=t||{}).content=e||"";var n=new _o(this,t);return this.addChild(n),n.on("dispose",function(){i.removeChild(n)}),n.open(),n},n.updateCurrentBreakpoint_=function(){if(this.responsive())for(var e=this.currentBreakpoint(),t=this.currentWidth(),i=0;i<Is.length;i++){var n=Is[i];if(t<=this.breakpoints_[n]){if(e===n)return;e&&this.removeClass(Ds[e]),this.addClass(Ds[n]),this.breakpoint_=n;break}}},n.removeCurrentBreakpoint_=function(){var e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)},n.breakpoints=function(e){return void 0===e||(this.breakpoint_="",this.breakpoints_=i({},Ms,e),this.updateCurrentBreakpoint_()),i(this.breakpoints_)},n.responsive=function(e){return void 0===e?this.responsive_:(e=Boolean(e))!==this.responsive_?((this.responsive_=e)?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e):void 0},n.currentBreakpoint=function(){return this.breakpoint_},n.currentBreakpointClass=function(){return Ds[this.breakpoint_]||""},n.loadMedia=function(e,t){var i,n,r,a=this;e&&"object"==typeof e&&(this.reset(),this.cache_.media=le(e),i=(r=this.cache_.media).artwork,n=r.poster,e=r.src,r=r.textTracks,!i&&n&&(this.cache_.media.artwork=[{src:n,type:Ke(n)}]),e&&this.src(e),n&&this.poster(n),Array.isArray(r)&&r.forEach(function(e){return a.addRemoteTextTrack(e,!1)}),this.ready(t))},n.getMedia=function(){if(this.cache_.media)return le(this.cache_.media);var e=this.poster(),t={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),function(e){return{kind:e.kind,label:e.label,language:e.language,src:e.src}})};return e&&(t.poster=e,t.artwork=[{src:t.poster,type:Ke(t.poster)}]),t},t.getTagSettings=function(e){var t,n={sources:[],tracks:[]},r=b(e),a=r["data-setup"];if(m(e,"vjs-fill")&&(r.fill=!0),m(e,"vjs-fluid")&&(r.fluid=!0),null!==a&&(a=(t=fo(a||"{}"))[0],t=t[1],a&&ba.error(a),i(r,t)),i(n,r),e.hasChildNodes())for(var o=e.childNodes,s=0,l=o.length;s<l;s++){var c=o[s],u=c.nodeName.toLowerCase();"source"===u?n.sources.push(b(c)):"track"===u&&n.tracks.push(b(c))}return n},n.flexNotSupported_=function(){var e=da.createElement("i");return!("flexBasis"in e.style||"webkitFlexBasis"in e.style||"mozFlexBasis"in e.style||"msFlexBasis"in e.style||"msFlexOrder"in e.style)},n.debug=function(e){if(void 0===e)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)},n.playbackRates=function(e){if(void 0===e)return this.cache_.playbackRates;Array.isArray(e)&&e.every(function(e){return"number"==typeof e})&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))},t}(co);zo.names.forEach(function(e){var t=zo[e];Ls.prototype[t.getterName]=function(){return this.tech_?this.tech_[t.getterName]():(this[t.privateName]=this[t.privateName]||new t.ListClass,this[t.privateName])}}),Ls.prototype.crossorigin=Ls.prototype.crossOrigin,Ls.players={},Ea=la.navigator,Ls.prototype.options_={techOrder:Zo.defaultTechOrder_,html5:{},inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ea&&(Ea.languages&&Ea.languages[0]||Ea.userLanguage||Ea.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1},["ended","seeking","seekable","networkState","readyState"].forEach(function(e){Ls.prototype[e]=function(){return this.techGet_(e)}}),Es.forEach(function(e){Ls.prototype["handleTech"+se(e)+"_"]=function(){return this.trigger(e)}}),co.registerComponent("Player",Ls);var Os=e(function(e){function t(i,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(i,n)}e.exports=t}),Ns=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}},Ps=e(function(e){function t(i,n,r){return Ns()?e.exports=t=Reflect.construct:e.exports=t=function(e,t,i){var n=[null];return n.push.apply(n,t),n=new(Function.bind.apply(e,n)),i&&Os(n,i.prototype),n},t.apply(null,arguments)}e.exports=t}),Rs="plugin",js="activePlugins_",zs={},Fs=function(e,t){e[js]=e[js]||{},e[js][t]=!0},Bs=function(){function e(t){if(this.constructor===e)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),re(this),delete this.trigger,ae(this,this.constructor.defaultState),Fs(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}var t=e.prototype;return t.version=function(){return this.constructor.VERSION},t.getEventHash=function(e){return(e=void 0===e?{}:e).name=this.name,e.plugin=this.constructor,e.instance=this,e},t.trigger=function(e,t){return H(this.eventBusEl_,e,this.getEventHash(t=void 0===t?{}:t))},t.handleStateChanged=function(e){},t.dispose=function(){var e=this.name,t=this.player;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[js][e]=!1,this.player=this.state=null,t[e]=ft(e,zs[e])},e.isBasic=function(t){return"function"==typeof(t="string"==typeof t?dt(t):t)&&!e.prototype.isPrototypeOf(t.prototype)},e.registerPlugin=function(t,i){if("string"!=typeof t)throw new Error('Illegal plugin name, "'+t+'", must be a string, was '+typeof t+".");if(ut(t))ba.warn('A plugin named "'+t+'" already exists. You may want to avoid re-registering plugins!');else if(Ls.prototype.hasOwnProperty(t))throw new Error('Illegal plugin name, "'+t+'", cannot share a name with an existing player method!');if("function"!=typeof i)throw new Error('Illegal plugin for "'+t+'", must be a function, was '+typeof i+".");return zs[t]=i,t!==Rs&&(e.isBasic(i)?Ls.prototype[t]=pt(t,i):Ls.prototype[t]=ft(t,i)),i},e.deregisterPlugin=function(e){if(e===Rs)throw new Error("Cannot de-register base plugin.");ut(e)&&(delete zs[e],delete Ls.prototype[e])},e.getPlugins=function(e){var t;return(e=void 0===e?Object.keys(zs):e).forEach(function(e){var i=dt(e);i&&((t=t||{})[e]=i)}),t},e.getPluginVersion=function(e){return(e=dt(e))&&e.VERSION||""},e}();Bs.getPlugin=dt,Bs.BASE_PLUGIN_NAME=Rs,Bs.registerPlugin(Rs,Bs),Ls.prototype.usingPlugin=function(e){return!!this[js]&&!0===this[js][e]},Ls.prototype.hasPlugin=function(e){return!!ut(e)};var Us=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Os(e,t)},$s=function(e){return 0===e.indexOf("#")?e.slice(1):e};mt.hooks_={},mt.hooks=function(e,t){return mt.hooks_[e]=mt.hooks_[e]||[],t&&(mt.hooks_[e]=mt.hooks_[e].concat(t)),mt.hooks_[e]},mt.hook=function(e,t){mt.hooks(e,t)},mt.hookOnce=function(e,t){mt.hooks(e,[].concat(t).map(function(t){return function i(){return mt.removeHook(e,i),t.apply(void 0,arguments)}}))},mt.removeHook=function(e,t){return!((t=mt.hooks(e).indexOf(t))<=-1||(mt.hooks_[e]=mt.hooks_[e].slice(),mt.hooks_[e].splice(t,1),0))},!0!==la.VIDEOJS_NO_DYNAMIC_STYLE&&l()&&((Ws=Va(".vjs-styles-defaults"))||(Ws=j("vjs-styles-defaults"),(Ea=Va("head"))&&Ea.insertBefore(Ws,Ea.firstChild),z(Ws,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n "))),P(1,mt),mt.VERSION=oa,mt.options=Ls.prototype.options_,mt.getPlayers=function(){return Ls.players},mt.getPlayer=function(e){var t=Ls.players;if("string"==typeof e){var i=$s(e),n=t[i];if(n)return n;i=Va("#"+i)}else i=e;if(c(i)&&(e=i.player,i=i.playerId,e||t[i]))return e||t[i]},mt.getAllPlayers=function(){return Object.keys(Ls.players).map(function(e){return Ls.players[e]}).filter(Boolean)},mt.players=Ls.players,mt.getComponent=co.getComponent,mt.registerComponent=function(e,t){Zo.isTech(t)&&ba.warn("The "+e+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),co.registerComponent.call(co,e,t)},mt.getTech=Zo.getTech,mt.registerTech=Zo.registerTech,mt.use=function(e,t){Jo[e]=Jo[e]||[],Jo[e].push(t)},Object.defineProperty(mt,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(mt.middleware,"TERMINATOR",{value:ts,writeable:!1,enumerable:!0}),mt.browser=Wa,mt.TOUCH_ENABLED=Ba,mt.extend=function(e,t){var i,n=function(){e.apply(this,arguments)},r={};for(i in"object"==typeof(t=void 0===t?{}:t)?(t.constructor!==Object.prototype.constructor&&(n=t.constructor),r=t):"function"==typeof t&&(n=t),Us(n,e),e&&(n.super_=e),r)r.hasOwnProperty(i)&&(n.prototype[i]=r[i]);return n},mt.mergeOptions=le,mt.bind=G,mt.registerPlugin=Bs.registerPlugin,mt.deregisterPlugin=Bs.deregisterPlugin,mt.plugin=function(e,t){return ba.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Bs.registerPlugin(e,t)},mt.getPlugins=Bs.getPlugins,mt.getPlugin=Bs.getPlugin,mt.getPluginVersion=Bs.getPluginVersion,mt.addLanguage=function(e,t){var i;return e=(""+e).toLowerCase(),mt.options.languages=le(mt.options.languages,((i={})[e]=t,i)),mt.options.languages[e]},mt.log=ba,mt.createLogger=wa,mt.createTimeRange=mt.createTimeRanges=de,mt.formatTime=tt,mt.setFormatTime=function(e){us=e},mt.resetFormatTime=function(){us=et},mt.parseUrl=_e,mt.isCrossOrigin=xe,mt.EventTarget=X,mt.on=$,mt.one=W,mt.off=q,mt.trigger=H,mt.xhr=Lo,mt.TextTrack=Oo,mt.AudioTrack=No,mt.VideoTrack=Po,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(e){mt[e]=function(){return ba.warn("videojs."+e+"() is deprecated; use videojs.dom."+e+"() instead"),Ya[e].apply(null,arguments)}}),mt.computedStyle=a,mt.dom=Ya,mt.url=Ao,mt.defineLazyProperty=ct,mt.addLanguage("en",{"Non-Fullscreen":"Exit Fullscreen"});var qs=e(function(e,t){var i,n,r,a,o;i=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,n=/^([^\/?#]*)([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var r=o.parseURL(e);if(!r)throw new Error("Error trying to parse base URL.");return r.path=o.normalizePath(r.path),o.buildURLFromParts(r)}
|
||
if(!(r=o.parseURL(t)))throw new Error("Error trying to parse relative URL.");if(r.scheme)return i.alwaysNormalize?(r.path=o.normalizePath(r.path),o.buildURLFromParts(r)):t;if(!(t=o.parseURL(e)))throw new Error("Error trying to parse base URL.");!t.netLoc&&t.path&&"/"!==t.path[0]&&(a=n.exec(t.path),t.netLoc=a[1],t.path=a[2]),t.netLoc&&!t.path&&(t.path="/");var a,e={scheme:t.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};return r.netLoc||(e.netLoc=t.netLoc,"/"!==r.path[0]&&(r.path?(a=(a=t.path).substring(0,a.lastIndexOf("/")+1)+r.path,e.path=o.normalizePath(a)):(e.path=t.path,r.params||(e.params=t.params,r.query||(e.query=t.query))))),null===e.path&&(e.path=i.alwaysNormalize?o.normalizePath(r.path):r.path),o.buildURLFromParts(e)},parseURL:function(e){return e=i.exec(e),e?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(r,"");e.length!==(e=e.replace(a,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=o}),Hs="http://example.com",Ws=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){return!!this.listeners[e]&&(t=this.listeners[e].indexOf(t),this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t)},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}(),Vs=function(e){return la.atob?la.atob(e):Buffer.from(e,"base64").toString("binary")},Gs=function(e){function t(){var t=e.call(this)||this;return t.buffer="",t}return ho(t,e),t.prototype.push=function(e){var t;for(this.buffer+=e,t=this.buffer.indexOf("\n");-1<t;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(Ws),Ys=String.fromCharCode(9),Ks=function(e){function t(){var t=e.call(this)||this;return t.customParsers=[],t.tagMappers=[],t}ho(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce(function(t,i){return i=i(e),i===e?t:t.concat([i])},[e]).forEach(function(e){for(var r,a,o=0;o<n.customParsers.length;o++)if(n.customParsers[o].call(n,e))return;if(0===e.indexOf("#EXT"))if(e=e.replace("\r",""),t=/^#EXTM3U/.exec(e))n.trigger("data",{type:"tag",tagType:"m3u"});else{if(t=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))return i={type:"tag",tagType:"inf"},t[1]&&(i.duration=parseFloat(t[1])),t[2]&&(i.title=t[2]),void n.trigger("data",i);if(t=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"targetduration"},t[1]&&(i.duration=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))return i={type:"tag",tagType:"version"},t[1]&&(i.version=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"media-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))return i={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(i.number=parseInt(t[1],10)),void n.trigger("data",i);if(t=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))return i={type:"tag",tagType:"playlist-type"},t[1]&&(i.playlistType=t[1]),void n.trigger("data",i);if(t=/^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))return i=xa(yt(t[1]),{type:"tag",tagType:"byterange"}),void n.trigger("data",i);if(t=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))return i={type:"tag",tagType:"allow-cache"},t[1]&&(i.allowed=!/NO/.test(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-MAP:?(.*)$/.exec(e))return i={type:"tag",tagType:"map"},t[1]&&((r=_t(t[1])).URI&&(i.uri=r.URI),r.BYTERANGE&&(i.byterange=yt(r.BYTERANGE))),void n.trigger("data",i);if(t=/^#EXT-X-STREAM-INF:?(.*)$/.exec(e))return i={type:"tag",tagType:"stream-inf"},t[1]&&(i.attributes=_t(t[1]),i.attributes.RESOLUTION&&(a={},(r=i.attributes.RESOLUTION.split("x"))[0]&&(a.width=parseInt(r[0],10)),r[1]&&(a.height=parseInt(r[1],10)),i.attributes.RESOLUTION=a),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),void n.trigger("data",i);if(t=/^#EXT-X-MEDIA:?(.*)$/.exec(e))return i={type:"tag",tagType:"media"},t[1]&&(i.attributes=_t(t[1])),void n.trigger("data",i);if(t=/^#EXT-X-ENDLIST/.exec(e))n.trigger("data",{type:"tag",tagType:"endlist"});else{if(!(t=/^#EXT-X-DISCONTINUITY/.exec(e)))return(t=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))?(i={type:"tag",tagType:"program-date-time"},t[1]&&(i.dateTimeString=t[1],i.dateTimeObject=new Date(t[1])),void n.trigger("data",i)):(t=/^#EXT-X-KEY:?(.*)$/.exec(e))?(i={type:"tag",tagType:"key"},t[1]&&(i.attributes=_t(t[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(i.attributes.IV=i.attributes.IV.substring(2)),i.attributes.IV=i.attributes.IV.match(/.{8}/g),i.attributes.IV[0]=parseInt(i.attributes.IV[0],16),i.attributes.IV[1]=parseInt(i.attributes.IV[1],16),i.attributes.IV[2]=parseInt(i.attributes.IV[2],16),i.attributes.IV[3]=parseInt(i.attributes.IV[3],16),i.attributes.IV=new Uint32Array(i.attributes.IV))),void n.trigger("data",i)):(t=/^#EXT-X-START:?(.*)$/.exec(e))?(i={type:"tag",tagType:"start"},t[1]&&(i.attributes=_t(t[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void n.trigger("data",i)):(t=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))?(i={type:"tag",tagType:"cue-out-cont"},t[1]?i.data=t[1]:i.data="",void n.trigger("data",i)):(t=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))?(i={type:"tag",tagType:"cue-out"},t[1]?i.data=t[1]:i.data="",void n.trigger("data",i)):(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(e))?(i={type:"tag",tagType:"cue-in"},t[1]?i.data=t[1]:i.data="",void n.trigger("data",i)):(t=/^#EXT-X-SKIP:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"skip"}).attributes=_t(t[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(Ys)),void n.trigger("data",i)):(t=/^#EXT-X-PART:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"part"}).attributes=_t(t[1]),["DURATION"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["INDEPENDENT","GAP"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=yt(i.attributes.BYTERANGE)),void n.trigger("data",i)):(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"server-control"}).attributes=_t(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=/YES/.test(i.attributes[e]))}),void n.trigger("data",i)):(t=/^#EXT-X-PART-INF:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"part-inf"}).attributes=_t(t[1]),["PART-TARGET"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseFloat(i.attributes[e]))}),void n.trigger("data",i)):(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"preload-hint"}).attributes=_t(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(e){var t;i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10),t="BYTERANGE-LENGTH"===e?"length":"offset",i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[t]=i.attributes[e],delete i.attributes[e])}),void n.trigger("data",i)):(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e))&&t[1]?((i={type:"tag",tagType:"rendition-report"}).attributes=_t(t[1]),["LAST-MSN","LAST-PART"].forEach(function(e){i.attributes.hasOwnProperty(e)&&(i.attributes[e]=parseInt(i.attributes[e],10))}),void n.trigger("data",i)):void n.trigger("data",{type:"tag",data:e.slice(4)});n.trigger("data",{type:"tag",tagType:"discontinuity"})}}else n.trigger("data",{type:"comment",text:e.slice(1)})}):this.trigger("data",{type:"uri",uri:e}))},i.addParser=function(e){var t=this,i=e.expression,n=e.customType,r=e.dataParser,a=e.segment;"function"!=typeof r&&(r=function(e){return e}),this.customParsers.push(function(e){if(i.exec(e))return t.trigger("data",{type:"custom",data:r(e),customType:n,segment:a}),!0})},i.addTagMapper=function(e){var t=e.expression,i=e.map;this.tagMappers.push(function(e){return t.test(e)?i(e):e})},t}(Ws),Xs=function(e){function t(){var t=e.call(this)||this;t.lineStream=new Gs,t.parseStream=new Ks,t.lineStream.pipe(t.parseStream);var i,n,r=uo(t),a=[],o={},s=!1,l={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},c=0;t.manifest={allowCache:!0,discontinuityStarts:[],segments:[]};var u=0,d=0;return t.on("end",function(){o.uri||!o.parts&&!o.preloadHints||(!o.map&&i&&(o.map=i),!o.key&&n&&(o.key=n),o.timeline||"number"!=typeof c||(o.timeline=c),t.manifest.preloadSegment=o)}),t.parseStream.on("data",function(e){var t,h;({tag:function(){(({version:function(){e.version&&(this.manifest.version=e.version)},"allow-cache":function(){this.manifest.allowCache=e.allowed,"allowed"in e||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function(){var t={};"length"in e&&((o.byterange=t).length=e.length,"offset"in e||(e.offset=u)),"offset"in e&&((o.byterange=t).offset=e.offset),u=t.offset+t.length},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),0<e.duration&&(o.duration=e.duration),0===e.duration&&(o.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:vt(e.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));e.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:e.attributes.METHOD||"AES-128",uri:e.attributes.URI},void 0!==e.attributes.IV&&(n.iv=e.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){isFinite(e.number)?this.manifest.mediaSequence=e.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+e.number})},"discontinuity-sequence":function(){isFinite(e.number)?(this.manifest.discontinuitySequence=e.number,c=e.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+e.number})},"playlist-type":function(){/VOD|EVENT/.test(e.playlistType)?this.manifest.playlistType=e.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+e.playlist})},map:function(){i={},e.uri&&(i.uri=e.uri),e.byterange&&(i.byterange=e.byterange),n&&(i.key=n)},"stream-inf":function(){this.manifest.playlists=a,this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes?(o.attributes||(o.attributes={}),xa(o.attributes,e.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){var i;this.manifest.mediaGroups=this.manifest.mediaGroups||l,e.attributes&&e.attributes.TYPE&&e.attributes["GROUP-ID"]&&e.attributes.NAME?((i=this.manifest.mediaGroups[e.attributes.TYPE])[e.attributes["GROUP-ID"]]=i[e.attributes["GROUP-ID"]]||{},t=i[e.attributes["GROUP-ID"]],(h={default:/yes/i.test(e.attributes.DEFAULT)}).default?h.autoselect=!0:h.autoselect=/yes/i.test(e.attributes.AUTOSELECT),e.attributes.LANGUAGE&&(h.language=e.attributes.LANGUAGE),e.attributes.URI&&(h.uri=e.attributes.URI),e.attributes["INSTREAM-ID"]&&(h.instreamId=e.attributes["INSTREAM-ID"]),e.attributes.CHARACTERISTICS&&(h.characteristics=e.attributes.CHARACTERISTICS),e.attributes.FORCED&&(h.forced=/yes/i.test(e.attributes.FORCED)),t[e.attributes.NAME]=h):this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity:function(){c+=1,o.discontinuity=!0,this.manifest.discontinuityStarts.push(a.length)},"program-date-time":function(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=e.dateTimeString,this.manifest.dateTimeObject=e.dateTimeObject),o.dateTimeString=e.dateTimeString,o.dateTimeObject=e.dateTimeObject},targetduration:function(){!isFinite(e.duration)||e.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+e.duration}):(this.manifest.targetDuration=e.duration,wt.call(this,this.manifest))},start:function(){e.attributes&&!isNaN(e.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:e.attributes["TIME-OFFSET"],precise:e.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out":function(){o.cueOut=e.data},"cue-out-cont":function(){o.cueOutCont=e.data},"cue-in":function(){o.cueIn=e.data},skip:function(){this.manifest.skip=bt(e.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",e.attributes,["SKIPPED-SEGMENTS"])},part:function(){var t=this;s=!0;var i=this.manifest.segments.length,n=bt(e.attributes);o.parts=o.parts||[],o.parts.push(n),n.byterange&&(n.byterange.hasOwnProperty("offset")||(n.byterange.offset=d),d=n.byterange.offset+n.byterange.length);var r=o.parts.length-1;this.warnOnMissingAttributes_("#EXT-X-PART #"+r+" for segment #"+i,e.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(function(e,i){e.hasOwnProperty("lastPart")||t.trigger("warn",{message:"#EXT-X-RENDITION-REPORT #"+i+" lacks required attribute(s): LAST-PART"})})},"server-control":function(){var t=this.manifest.serverControl=bt(e.attributes);t.hasOwnProperty("canBlockReload")||(t.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),wt.call(this,this.manifest),t.canSkipDateranges&&!t.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint":function(){var t=this.manifest.segments.length,i=bt(e.attributes),n=i.type&&"PART"===i.type;o.preloadHints=o.preloadHints||[],o.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=n?d:0,n&&(d=i.byterange.offset+i.byterange.length)));var r=o.preloadHints.length-1;if(this.warnOnMissingAttributes_("#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t,e.attributes,["TYPE","URI"]),i.type)for(var a=0;a<o.preloadHints.length-1;a++){var s=o.preloadHints[a];s.type&&s.type===i.type&&this.trigger("warn",{message:"#EXT-X-PRELOAD-HINT #"+r+" for segment #"+t+" has the same TYPE "+i.type+" as preload hint #"+a})}},"rendition-report":function(){var t=bt(e.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(t);var i=this.manifest.renditionReports.length-1,t=["LAST-MSN","URI"];s&&t.push("LAST-PART"),this.warnOnMissingAttributes_("#EXT-X-RENDITION-REPORT #"+i,e.attributes,t)},"part-inf":function(){this.manifest.partInf=bt(e.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",e.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),wt.call(this,this.manifest)}})[e.tagType]||function(){}).call(r)},uri:function(){o.uri=e.uri,a.push(o),!this.manifest.targetDuration||"duration"in o||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),o.duration=this.manifest.targetDuration),n&&(o.key=n),o.timeline=c,i&&(o.map=i),d=0,o={}},comment:function(){},custom:function(){e.segment?(o.custom=o.custom||{},o.custom[e.customType]=e.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[e.customType]=e.data)}})[e.type].call(r)}),t}ho(t,e);var i=t.prototype;return i.warnOnMissingAttributes_=function(e,t,i){var n=[];i.forEach(function(e){t.hasOwnProperty(e)||n.push(e)}),n.length&&this.trigger("warn",{message:e+" lacks required attribute(s): "+n.join(", ")})},i.push=function(e){this.lineStream.push(e)},i.end=function(){this.lineStream.push("\n"),this.trigger("end")},i.addParser=function(e){this.parseStream.addParser(e)},i.addTagMapper=function(e){this.parseStream.addTagMapper(e)},t}(Ws),Qs={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},Zs=["video","audio","text"],Js=["Video","Audio","Text"],el="mp4a.40.2",tl=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,il=/^application\/dash\+xml/i,nl={entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}},Wa=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,No=new RegExp("[\\-\\.0-9"+Wa.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),rl=new RegExp("^"+Wa.source+No.source+"*(?::"+Wa.source+No.source+"*)?$");(It.prototype=new Error).name=It.name,Dt.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),Ot(t,t={}),function(e,t,i,n,r){function a(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?65535<(t=parseInt(t.substr(1).replace("x","0x")))?(t-=65536,String.fromCharCode(55296+(t>>10),56320+(1023&t))):String.fromCharCode(t):(r.error("entity not found:"+e),e)}function o(t){var i;f<t&&(i=e.substring(f,t).replace(/&#?\w+;/g,a),d&&s(f),n.characters(i,0,t-f),f=t)}function s(t,i){for(;c<=t&&(i=u.exec(e));)l=i.index,c=l+i[0].length,d.lineNumber++;d.columnNumber=t-l+1}for(var l=0,c=0,u=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,h=[{currentNSMap:t}],p={},f=0;;){try{var m,g,v=e.indexOf("<",f);if(v<0)return e.substr(f).match(/^\s*$/)||(m=n.doc,g=m.createTextNode(e.substr(f)),m.appendChild(g),n.currentElement=g);switch(f<v&&o(v),e.charAt(v+1)){case"/":var y=e.indexOf(">",v+3),_=e.substring(v+2,y),b=h.pop();y<0?(_=e.substring(v+2).replace(/[\s<].*/,""),r.error("end tag name: "+_+" is not complete:"+b.tagName),y=v+1+_.length):_.match(/\s</)&&(_=_.replace(/[\s<].*/,""),r.error("end tag name: "+_+" maybe not complete"),y=v+1+_.length);var w=b.localNSMap,x=b.tagName==_;if(x||b.tagName&&b.tagName.toLowerCase()==_.toLowerCase()){if(n.endElement(b.uri,b.localName,_),w)for(var k in w)n.endPrefixMapping(k);x||r.fatalError("end tag name: "+_+" is not match the current start tagName:"+b.tagName)}else h.push(b);y++;break;case"?":d&&s(v),y=function(e,t,i){var n=e.indexOf("?>",t);return n?(t=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/),t?(t[0].length,i.processingInstruction(t[1],t[2]),n+2):-1):-1}(e,v,n);break;case"!":d&&s(v),y=function(e,t,i,n){if("-"===e.charAt(t+2)){if("-"!==e.charAt(t+3))return-1;var r=e.indexOf("--\x3e",t+4);return t<r?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1)}if("CDATA["==e.substr(t+3,6))return r=e.indexOf("]]>",t+9),i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3;var a=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),n=a.length;return 1<n&&/!doctype/i.test(a[0][0])?(r=a[1][0],e=!1,t=!1,3<n&&(/^public$/i.test(a[2][0])?(e=a[3][0],t=4<n&&a[4][0]):/^system$/i.test(a[2][0])&&(t=a[3][0])),n=a[n-1],i.startDTD(r,e,t),i.endDTD(),n.index+n[0].length):-1}(e,v,n,r);break;default:d&&s(v);var C=new Nt,T=h[h.length-1].currentNSMap,y=function(e,t,i,n,r,a){function o(e,t,n){e in i.attributeNames&&a.fatalError("Attribute "+e+" redefined"),i.addValue(e,t,n)}for(var s,l=++t,c=0;;){var u=e.charAt(l);switch(u){case"=":if(1===c)s=e.slice(t,l),c=3;else{if(2!==c)throw new Error("attribute equal must after attrName");c=3}break;case"'":case'"':if(3===c||1===c){if(1===c&&(a.warning('attribute value must after "="'),s=e.slice(t,l)),t=l+1,!(0<(l=e.indexOf(u,t))))throw new Error("attribute value no end '"+u+"' match");d=e.slice(t,l).replace(/&#?\w+;/g,r),o(s,d,t-1),c=5}else{if(4!=c)throw new Error('attribute value must after "="');d=e.slice(t,l).replace(/&#?\w+;/g,r),o(s,d,t),a.warning('attribute "'+s+'" missed start quot('+u+")!!"),t=l+1,c=5}break;case"/":switch(c){case 0:i.setTagName(e.slice(t,l));case 5:case 6:case 7:c=7,i.closed=!0;case 4:case 1:case 2:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),0==c&&i.setTagName(e.slice(t,l)),l;case">":switch(c){case 0:i.setTagName(e.slice(t,l));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(t,l)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case 2:2===c&&(d=s),4==c?(a.warning('attribute "'+d+'" missed quot(")!'),o(s,d.replace(/&#?\w+;/g,r),t)):("http://www.w3.org/1999/xhtml"===n[""]&&d.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),o(d,d,t));break;case 3:throw new Error("attribute value missed!!")}return l;case"":u=" ";default:if(u<=" ")switch(c){case 0:i.setTagName(e.slice(t,l)),c=6;break;case 1:s=e.slice(t,l),c=2;break;case 4:var d=e.slice(t,l).replace(/&#?\w+;/g,r);a.warning('attribute "'+d+'" missed quot(")!!'),o(s,d,t);case 5:c=6}else switch(c){case 2:i.tagName,"http://www.w3.org/1999/xhtml"===n[""]&&s.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),o(s,s,t),t=l,c=1;break;case 5:a.warning('attribute space is required"'+s+'"!!');case 6:c=1,t=l;break;case 3:c=4,t=l;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}(e,v,C,T,a,r),S=C.length;if(!C.closed&&function(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf("</"+i+">"))<t&&(r=e.lastIndexOf("</"+i)),n[i]=r),r<t}(e,y,C.tagName,p)&&(C.closed=!0,i.nbsp||r.warning("unclosed xml attribute")),d&&S){for(var E=Mt(d,{}),A=0;A<S;A++){var I=C[A];s(I.offset),I.locator=Mt(d,{})}n.locator=E,Lt(C,n,T)&&h.push(C),n.locator=d}else Lt(C,n,T)&&h.push(C);"http://www.w3.org/1999/xhtml"!==C.uri||C.closed?y++:y=function(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var a=e.indexOf("</"+i+">",t),e=e.substring(t+1,a);if(/[&<]/.test(e))return/^script$/i.test(i)||(e=e.replace(/&#?\w+;/g,n)),r.characters(e,0,e.length),a}return t+1}(e,y,C.tagName,a,n)}}catch(t){if(t instanceof It)throw t;r.error("element parse error: "+t),y=-1}f<y?f=y:o(Math.max(v,f)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},Nt.prototype={setTagName:function(e){if(!rl.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!rl.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};var al={XMLReader:Dt,ParseError:It},ol="http://www.w3.org/1999/xhtml",Po={},sl=Po.ELEMENT_NODE=1,ll=Po.ATTRIBUTE_NODE=2,cl=Po.TEXT_NODE=3,ul=Po.CDATA_SECTION_NODE=4,dl=Po.ENTITY_REFERENCE_NODE=5,hl=(Po.ENTITY_NODE=6,Po.PROCESSING_INSTRUCTION_NODE=7),pl=Po.COMMENT_NODE=8,fl=Po.DOCUMENT_NODE=9,ml=Po.DOCUMENT_TYPE_NODE=10,gl=Po.DOCUMENT_FRAGMENT_NODE=11,Ao=(Po.NOTATION_NODE=12,{}),vl={};Ao.INDEX_SIZE_ERR=(vl[1]="Index size error",1),Ao.DOMSTRING_SIZE_ERR=(vl[2]="DOMString size error",2),Ao.HIERARCHY_REQUEST_ERR=(vl[3]="Hierarchy request error",3),Ao.WRONG_DOCUMENT_ERR=(vl[4]="Wrong document",4),Ao.INVALID_CHARACTER_ERR=(vl[5]="Invalid character",5),Ao.NO_DATA_ALLOWED_ERR=(vl[6]="No data allowed",6),Ao.NO_MODIFICATION_ALLOWED_ERR=(vl[7]="No modification allowed",7),Ao.NOT_FOUND_ERR=(vl[8]="Not found",8),Ao.NOT_SUPPORTED_ERR=(vl[9]="Not supported",9);var yl;Ao.INUSE_ATTRIBUTE_ERR=(vl[10]="Attribute in use",10),Ao.INVALID_STATE_ERR=(vl[11]="Invalid state",11),Ao.SYNTAX_ERR=(vl[12]="Syntax error",12),Ao.INVALID_MODIFICATION_ERR=(vl[13]="Invalid modification",13),Ao.NAMESPACE_ERR=(vl[14]="Invalid namespace",14),Ao.INVALID_ACCESS_ERR=(vl[15]="Invalid access",15),jt.prototype=Error.prototype,Pt(Ao,jt),zt.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n<this.length;n++)mi(this[n],i,e,t);return i.join("")}},Ft.prototype.item=function(e){return Bt(this),this[e]},Rt(Ft,zt),Ut.prototype={length:0,item:zt.prototype.item,getNamedItem:function(e){for(var t=this.length;t--;){var i=this[t];if(i.nodeName==e)return i}},setNamedItem:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new jt(10);return t=this.getNamedItem(e.nodeName),qt(this._ownerElement,this,e,t),t},setNamedItemNS:function(e){var t=e.ownerElement;if(t&&t!=this._ownerElement)throw new jt(10);return t=this.getNamedItemNS(e.namespaceURI,e.localName),qt(this._ownerElement,this,e,t),t},removeNamedItem:function(e){return e=this.getNamedItem(e),Ht(this._ownerElement,this,e),e},removeNamedItemNS:function(e,t){return t=this.getNamedItemNS(e,t),Ht(this._ownerElement,this,t),t},getNamedItemNS:function(e,t){for(var i=this.length;i--;){var n=this[i];if(n.localName==t&&n.namespaceURI==e)return n}return null}},Wt.prototype={hasFeature:function(e,t){return!(!(e=this._features[e.toLowerCase()])||t&&!(t in e))},createDocument:function(e,t,i){var n=new Kt;return n.implementation=this,n.childNodes=new zt,(n.doctype=i)&&n.appendChild(i),t&&(t=n.createElementNS(e,t),n.appendChild(t)),n},createDocumentType:function(e,t,i){var n=new oi;return n.name=e,n.nodeName=e,n.publicId=t,n.systemId=i,n}},Vt.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(e,t){return Jt(this,e,t)},replaceChild:function(e,t){this.insertBefore(e,t),t&&this.removeChild(t)},removeChild:function(e){return Zt(this,e)},appendChild:function(e){return this.insertBefore(e,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(e){return function e(t,i,n){var r=new i.constructor;for(var a in i){var o=i[a];"object"!=typeof o&&o!=r[a]&&(r[a]=o)}switch(i.childNodes&&(r.childNodes=new zt),r.ownerDocument=t,r.nodeType){case sl:var s=i.attributes,l=r.attributes=new Ut,c=s.length;l._ownerElement=r;for(var u=0;u<c;u++)r.setAttributeNode(e(t,s.item(u),!0));break;case ll:n=!0}if(n)for(var d=i.firstChild;d;)r.appendChild(e(t,d,n)),d=d.nextSibling;return r}(this.ownerDocument||this,this,e)},normalize:function(){for(var e=this.firstChild;e;){var t=e.nextSibling;t&&t.nodeType==cl&&e.nodeType==cl?(this.removeChild(t),e.appendData(t.data)):(e.normalize(),e=t)}},isSupported:function(e,t){return this.ownerDocument.implementation.hasFeature(e,t)},hasAttributes:function(){return 0<this.attributes.length},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=t.nodeType==ll?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==ll?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},Pt(Po,Vt),Pt(Po,Vt.prototype),Kt.prototype={nodeName:"#document",nodeType:fl,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType!=gl)return null==this.documentElement&&e.nodeType==sl&&(this.documentElement=e),Jt(this,e,t),e.ownerDocument=this,e;for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Zt(this,e)},importNode:function(e,t){return function e(t,i,n){var r
|
||
;switch(i.nodeType){case sl:(r=i.cloneNode(!1)).ownerDocument=t;case gl:break;case ll:n=!0}if(r=r||i.cloneNode(!1),r.ownerDocument=t,r.parentNode=null,n)for(var a=i.firstChild;a;)r.appendChild(e(t,a,n)),a=a.nextSibling;return r}(this,e,t)},getElementById:function(e){var t=null;return Yt(this.documentElement,function(i){if(i.nodeType==sl&&i.getAttribute("id")==e)return t=i,!0}),t},getElementsByClassName:function(e){var t=new RegExp("(^|\\s)"+e+"(\\s|$)");return new Ft(this,function(e){var i=[];return Yt(e.documentElement,function(n){n!==e&&n.nodeType==sl&&t.test(n.getAttribute("class"))&&i.push(n)}),i})},createElement:function(e){var t=new ei;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new zt,(t.attributes=new Ut)._ownerElement=t},createDocumentFragment:function(){var e=new ui;return e.ownerDocument=this,e.childNodes=new zt,e},createTextNode:function(e){var t=new ni;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new ri;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new ai;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new di;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new ti;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new ci;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new ei,n=t.split(":"),r=i.attributes=new Ut;return i.childNodes=new zt,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i},createAttributeNS:function(e,t){var i=new ti,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},Rt(Kt,Vt),Kt.prototype.getElementsByTagName=(ei.prototype={nodeType:sl,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){return(e=this.getAttributeNode(e))&&e.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){e=this.ownerDocument.createAttribute(e),e.value=e.nodeValue=""+t,this.setAttributeNode(e)},removeAttribute:function(e){(e=this.getAttributeNode(e))&&this.removeAttributeNode(e)},appendChild:function(e){return e.nodeType===gl?this.insertBefore(e,null):function(e,t){var i=t.parentNode;i&&(n=e.lastChild,i.removeChild(t),n=e.lastChild);var n=e.lastChild;return t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,Qt(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){(t=this.getAttributeNodeNS(e,t))&&this.removeAttributeNode(t)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){return(t=this.getAttributeNodeNS(e,t))&&t.value||""},setAttributeNS:function(e,t,i){t=this.ownerDocument.createAttributeNS(e,t),t.value=t.nodeValue=""+i,this.setAttributeNode(t)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new Ft(this,function(t){var i=[];return Yt(t,function(n){n===t||n.nodeType!=sl||"*"!==e&&n.tagName!=e||i.push(n)}),i})},getElementsByTagNameNS:function(e,t){return new Ft(this,function(i){var n=[];return Yt(i,function(r){r===i||r.nodeType!==sl||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)}),n})}}).getElementsByTagName,Kt.prototype.getElementsByTagNameNS=ei.prototype.getElementsByTagNameNS,Rt(ei,Vt),ti.prototype.nodeType=ll,Rt(ti,Vt),ii.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(vl[3])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var n=this.data.substring(0,e),t=this.data.substring(e+t);this.nodeValue=this.data=i=n+i+t,this.length=i.length}},Rt(ii,Vt),ni.prototype={nodeName:"#text",nodeType:cl,splitText:function(e){var t=(i=this.data).substring(e),i=i.substring(0,e);return this.data=this.nodeValue=i,this.length=i.length,t=this.ownerDocument.createTextNode(t),this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling),t}},Rt(ni,ii),ri.prototype={nodeName:"#comment",nodeType:pl},Rt(ri,ii),ai.prototype={nodeName:"#cdata-section",nodeType:ul},Rt(ai,ii),oi.prototype.nodeType=ml,Rt(oi,Vt),si.prototype.nodeType=12,Rt(si,Vt),li.prototype.nodeType=6,Rt(li,Vt),ci.prototype.nodeType=dl,Rt(ci,Vt),ui.prototype.nodeName="#document-fragment",ui.prototype.nodeType=gl,Rt(ui,Vt),di.prototype.nodeType=hl,Rt(di,Vt),hi.prototype.serializeToString=function(e,t,i){return pi.call(e,t,i)},Vt.prototype.toString=pi;try{Object.defineProperty&&(yl=function e(t){switch(t.nodeType){case sl:case gl:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}},Object.defineProperty(Ft.prototype,"length",{get:function(){return Bt(this),this.$$length}}),Object.defineProperty(Vt.prototype,"textContent",{get:function(){return yl(this)},set:function(e){switch(this.nodeType){case sl:case gl:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),gi=function(e,t,i){e["$$"+t]=i})}catch(sa){}var _l={Node:Vt,DOMException:jt,DOMImplementation:Wt,XMLSerializer:hi},Ws=e(function(e,t){function i(e){this.options=e||{locator:{}}}function n(){this.cdata=!1}function r(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function a(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function o(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function s(e,t){(e.currentElement||e.doc).appendChild(t)}i.prototype.parseFromString=function(e,t){var i=this.options,r=new l,o=i.domBuilder||new n,s=i.errorHandler,c=i.locator,u=i.xmlns||{},d=/\/x?html?$/.test(t),t=d?nl.entityMap:{lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&o.setDocumentLocator(c),r.errorHandler=function(e,t,i){function r(t){var n=e[t];!n&&s&&(n=2==e.length?function(i){e(t,i)}:e),o[t]=n?function(e){n("[xmldom "+t+"]\t"+e+a(i))}:function(){}}if(!e){if(t instanceof n)return t;e=t}var o={},s=e instanceof Function;return i=i||{},r("warning"),r("error"),r("fatalError"),o}(s,o,c),r.domBuilder=i.domBuilder||o,d&&(u[""]="http://www.w3.org/1999/xhtml"),u.xml=u.xml||"http://www.w3.org/XML/1998/namespace",e&&"string"==typeof e?r.parse(e,u,t):r.errorHandler.error("invalid doc source"),o.doc},n.prototype={startDocument:function(){this.doc=(new u).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var a=this.doc,o=a.createElementNS(e,i||t),l=n.length;s(this,o),this.currentElement=o,this.locator&&r(this.locator,o);for(var c=0;c<l;c++){var e=n.getURI(c),u=n.getValue(c),i=n.getQName(c),d=a.createAttributeNS(e,i);this.locator&&r(n.getLocator(c),d),d.value=d.nodeValue=u,o.setAttributeNode(d)}},endElement:function(e,t,i){var n=this.currentElement;n.tagName,this.currentElement=n.parentNode},startPrefixMapping:function(e,t){},endPrefixMapping:function(e){},processingInstruction:function(e,t){t=this.doc.createProcessingInstruction(e,t),this.locator&&r(this.locator,t),s(this,t)},ignorableWhitespace:function(e,t,i){},characters:function(e,t,i){var n;(e=o.apply(this,arguments))&&(n=this.cdata?this.doc.createCDATASection(e):this.doc.createTextNode(e),this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(e)&&this.doc.appendChild(n),this.locator&&r(this.locator,n))},skippedEntity:function(e){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(e){(this.locator=e)&&(e.lineNumber=0)},comment:function(e,t,i){e=o.apply(this,arguments),e=this.doc.createComment(e),this.locator&&r(this.locator,e),s(this,e)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(e,t,i){var n=this.doc.implementation;n&&n.createDocumentType&&(i=n.createDocumentType(e,t,i),this.locator&&r(this.locator,i),s(this,i))},warning:function(e){},error:function(e){},fatalError:function(e){throw new c(e,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){n.prototype[e]=function(){return null}});var l=al.XMLReader,c=al.ParseError,u=t.DOMImplementation=_l.DOMImplementation;t.XMLSerializer=_l.XMLSerializer,t.DOMParser=i,t.__DOMHandler=n});Ws.DOMImplementation,Ws.XMLSerializer;var bl=Ws.DOMParser;Ws.__DOMHandler;var wl="INVALID_NUMBER_OF_PERIOD",xl="DASH_EMPTY_MANIFEST",kl="DASH_INVALID_XML",Cl="NO_BASE_URL",Tl="SEGMENT_TIME_UNSPECIFIED",Sl="UNSUPPORTED_UTC_TIMING_SCHEME",El={static:function(e){var t=e.duration,i=e.timescale,n=void 0===i?1:i,i=e.sourceDuration,e=xi(e.endNumber);return{start:0,end:"number"==typeof e?e:Math.ceil(i/(t/n))}},dynamic:function(e){var t=e.NOW,i=e.clientOffset,n=e.availabilityStartTime,r=e.timescale,a=void 0===r?1:r,o=e.duration,s=e.start,l=void 0===s?0:s,r=e.minimumUpdatePeriod,s=void 0===r?0:r,r=e.timeShiftBufferDepth,r=void 0===r?1/0:r,e=xi(e.endNumber),i=(t+i)/1e3,l=n+l,s=Math.ceil((i+s-l)*a/o),r=Math.floor((i-l-r)*a/o),o=Math.floor((i-l)*a/o);return{start:Math.max(0,r),end:"number"==typeof e?e:Math.min(s,o)}}},Al=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,Il={mediaPresentationDuration:$i,availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e=e)&&(e+="Z"),Date.parse(e)/1e3},minimumUpdatePeriod:$i,suggestedPresentationDelay:$i,type:function(e){return e},timeShiftBufferDepth:$i,start:$i,width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?$i(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},Dl={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Ml=Math.pow(2,32),Ll=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:t.getUint32(4),timescale:t.getUint32(8)},n=12;0===i.version?(i.earliestPresentationTime=t.getUint32(n),i.firstOffset=t.getUint32(n+4),n+=8):(i.earliestPresentationTime=t.getUint32(n)*Ml+t.getUint32(n+4),i.firstOffset=t.getUint32(n+8)*Ml+t.getUint32(n+12),n+=16);var r=t.getUint16(n+=2);for(n+=2;0<r;n+=12,r--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)});return i},Ol=la.BigInt||Number,Nl=[Ol("0x1"),Ol("0x100"),Ol("0x10000"),Ol("0x1000000"),Ol("0x100000000"),Ol("0x10000000000"),Ol("0x1000000000000"),Ol("0x100000000000000"),Ol("0x10000000000000000")],Pl=Qi([73,68,51]),Rl={EBML:Qi([26,69,223,163]),DocType:Qi([66,130]),Segment:Qi([24,83,128,103]),SegmentInfo:Qi([21,73,169,102]),Tracks:Qi([22,84,174,107]),Track:Qi([174]),TrackNumber:Qi([215]),DefaultDuration:Qi([35,227,131]),TrackEntry:Qi([174]),TrackType:Qi([131]),FlagDefault:Qi([136]),CodecID:Qi([134]),CodecPrivate:Qi([99,162]),VideoTrack:Qi([224]),AudioTrack:Qi([225]),Cluster:Qi([31,67,182,117]),Timestamp:Qi([231]),TimestampScale:Qi([42,215,177]),BlockGroup:Qi([160]),BlockDuration:Qi([155]),Block:Qi([161]),SimpleBlock:Qi([163])},jl=[128,64,32,16,8,4,2,1],zl=Qi([0,0,0,1]),Fl=Qi([0,0,1]),Bl=Qi([0,0,3]),Ul={webm:Qi([119,101,98,109]),matroska:Qi([109,97,116,114,111,115,107,97]),flac:Qi([102,76,97,67]),ogg:Qi([79,103,103,83]),ac3:Qi([11,119]),riff:Qi([82,73,70,70]),avi:Qi([65,86,73]),wav:Qi([87,65,86,69]),"3gp":Qi([102,116,121,112,51,103]),mp4:Qi([102,116,121,112]),fmp4:Qi([115,116,121,112]),mov:Qi([102,116,121,112,113,116])},$l={aac:function(e){return en(e,[255,16],{offset:tn(e),mask:[255,22]})},mp3:function(e){return en(e,[255,2],{offset:tn(e),mask:[255,6]})},webm:function(e){return e=ln(e,[Rl.EBML,Rl.DocType])[0],en(e,Ul.webm)},mkv:function(e){return e=ln(e,[Rl.EBML,Rl.DocType])[0],en(e,Ul.matroska)},mp4:function(e){return!$l["3gp"](e)&&!$l.mov(e)&&(en(e,Ul.mp4,{offset:4})||en(e,Ul.fmp4,{offset:4}))},mov:function(e){return en(e,Ul.mov,{offset:4})},"3gp":function(e){return en(e,Ul["3gp"],{offset:4})},ac3:function(e){var t=tn(e);return en(e,Ul.ac3,{offset:t})},ts:function(e){if(e.length<189&&1<=e.length)return 71===e[0];for(var t=0;t+188<e.length&&t<188;){if(71===e[t]&&71===e[t+188])return!0;t+=1}return!1},flac:function(e){var t=tn(e);return en(e,Ul.flac,{offset:t})},ogg:function(e){return en(e,Ul.ogg)},avi:function(e){return en(e,Ul.riff)&&en(e,Ul.avi,{offset:8})},wav:function(e){return en(e,Ul.riff)&&en(e,Ul.wav,{offset:8})},h264:function(e){return cn(e,"h264",7,3).length},h265:function(e){return cn(e,"h265",[32,33],3).length}},ql=Object.keys($l).filter(function(e){return"ts"!==e&&"h264"!==e&&"h265"!==e}).concat(["ts","h264","h265"]);ql.forEach(function(e){var t=$l[e];$l[e]=function(e){return t(Qi(e))}});var Hl,Wl=$l,Vl=gt,Gl=1/30,Yl=mt.createTimeRange,Kl={liveEdgeDelay:xn,duration:Cn,seekable:function(e,t,i){var n=t||0,i=Sn(e,t,!0,i);return null===i?Yl():Yl(n,i)},getMediaInfoForTime:function(e){for(var t=e.playlist,i=e.currentTime,n=e.startingSegmentIndex,r=e.startingPartIndex,a=e.startTime,o=i-a,s=_n(t),l=0,c=0;c<s.length;c++){var u=s[c];if(n===u.segmentIndex&&("number"!=typeof r||"number"!=typeof u.partIndex||r===u.partIndex)){l=c;break}}if(o<0){if(0<l)for(var d=l-1;0<=d;d--){var h=s[d];if(0<(o+=h.duration)+Gl)return{partIndex:h.partIndex,segmentIndex:h.segmentIndex,startTime:a-Tn({defaultDuration:t.targetDuration,durationList:s,startIndex:l,endIndex:d})}}return{partIndex:s[0]&&s[0].partIndex||null,segmentIndex:s[0]&&s[0].segmentIndex||0,startTime:i}}if(l<0){for(var p=l;p<0;p++)if((o-=t.targetDuration)<0)return{partIndex:s[0]&&s[0].partIndex||null,segmentIndex:s[0]&&s[0].segmentIndex||0,startTime:i};l=0}for(var f=l;f<s.length;f++){var m=s[f];if((o-=m.duration)-Gl<0)return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:a+Tn({defaultDuration:t.targetDuration,durationList:s,startIndex:l,endIndex:f})}}return{segmentIndex:s[s.length-1].segmentIndex,partIndex:s[s.length-1].partIndex,startTime:i}},isEnabled:In,isDisabled:function(e){return e.disabled},isBlacklisted:En,isIncompatible:An,playlistEnd:Sn,isAes:function(e){for(var t=0;t<e.segments.length;t++)if(e.segments[t].key)return!0;return!1},hasAttribute:Dn,estimateSegmentRequestTime:function(e,t,i,n){return Dn("BANDWIDTH",i)?(e*i.attributes.BANDWIDTH-8*(n=void 0===n?0:n))/t:NaN},isLowestEnabledRendition:Mn,isAudioOnly:Nn,playlistMatch:Ln},Xl=mt.log,Ql=mt.mergeOptions,Wa=mt.EventTarget,Zl=function(e){function t(t,i,n){var r;if(void 0===n&&(n={}),r=e.call(this)||this,!t)throw new Error("A non-empty playlist URL or object is required");r.logger_=hn("PlaylistLoader");var a=n.withCredentials,a=void 0!==a&&a,n=n.handleManifestRedirects,n=void 0!==n&&n;return r.src=t,r.vhs_=i,r.withCredentials=a,r.handleManifestRedirects=n,i=i.options_,r.customTagParsers=i&&i.customTagParsers||[],r.customTagMappers=i&&i.customTagMappers||[],r.experimentalLLHLS=i&&i.experimentalLLHLS||!1,r.state="HAVE_NOTHING",r.handleMediaupdatetimeout_=r.handleMediaupdatetimeout_.bind(uo(r)),r.on("mediaupdatetimeout",r.handleMediaupdatetimeout_),r}ho(t,e);var i=t.prototype;return i.handleMediaupdatetimeout_=function(){var e,t,i=this;"HAVE_METADATA"===this.state&&(e=this.media(),t=Vl(this.master.uri,e.uri),this.experimentalLLHLS&&(t=function(e,t){if(t.endList)return e;var i,n,r,a=[];return t.serverControl&&t.serverControl.canBlockReload&&(r=t.preloadSegment,i=t.mediaSequence+t.segments.length,r&&(n=r.parts||[],-1<(r=wn(t)-1)&&r!=n.length-1&&a.push("_HLS_part="+r),(-1<r||n.length)&&i--),a.unshift("_HLS_msn="+i)),t.serverControl&&t.serverControl.canSkipUntil&&a.unshift("_HLS_skip="+(t.serverControl.canSkipDateranges?"v2":"YES")),a.forEach(function(t,i){e+=(0===i?"?":"&")+t}),e}(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},function(e,t){if(i.request)return e?i.playlistRequestError(i.request,i.media(),"HAVE_METADATA"):void i.haveMetadata({playlistString:i.request.responseText,url:i.media().uri,id:i.media().id})}))},i.playlistRequestError=function(e,t,i){var n=t.uri,t=t.id;this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[t],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:500<=e.status?4:2},this.trigger("error")},i.parseManifest_=function(e){var t=this,i=e.url;return function(e){var t=e.onwarn,i=e.oninfo,n=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,r=e.customTagMappers,r=void 0===r?[]:r,e=e.experimentalLLHLS,o=new Xs;t&&o.on("warn",t),i&&o.on("info",i),a.forEach(function(e){return o.addParser(e)}),r.forEach(function(e){return o.addTagMapper(e)}),o.push(n),o.end();var s=o.manifest;e||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){s.hasOwnProperty(e)&&delete s[e]}),s.segments&&s.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),s.targetDuration||(l=10,s.segments&&s.segments.length&&(l=s.segments.reduce(function(e,t){return Math.max(e,t.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+l),s.targetDuration=l);var l=bn(s);return l.length&&!s.partTargetDuration&&(l=l.reduce(function(e,t){return Math.max(e,t.duration)},0),t&&(t("manifest has no partTargetDuration defaulting to "+l),Xl.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),s.partTargetDuration=l),s}({onwarn:function(e){return e=e.message,t.logger_("m3u8-parser warn for "+i+": "+e)},oninfo:function(e){return e=e.message,t.logger_("m3u8-parser info for "+i+": "+e)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},i.haveMetadata=function(e){var t=this,i=e.playlistString,n=e.playlistObject,r=e.url,e=e.id;this.request=null,this.state="HAVE_METADATA",i=n||this.parseManifest_({url:r,manifestString:i}),i.lastRequest=Date.now(),jn({playlist:i,uri:r,id:e}),r=qn(this.master,i),this.targetDuration=i.partTargetDuration||i.targetDuration,r?(this.master=r,this.media_=this.master.playlists[e]):this.trigger("playlistunchanged"),this.media().endList||(la.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=la.setTimeout(function(){t.trigger("mediaupdatetimeout")},Hn(this.media(),!!r))),this.trigger("loadedplaylist")},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),la.clearTimeout(this.mediaUpdateTimeout),la.clearTimeout(this.finalRenditionTimeout),this.off()},i.stopRequest=function(){var e;this.request&&(e=this.request,this.request=null,e.onreadystatechange=null,e.abort())},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(la.clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=la.setTimeout(this.media.bind(this,e,!1),n)}else{var r=this.state,t=!this.media_||e.id!==this.media_.id,n=this.master.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(t&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(t){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials},function(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=dn(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,r);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?i.trigger("loadedmetadata"):i.trigger("mediachange")}})}}},i.pause=function(){this.stopRequest(),la.clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},i.load=function(e){var t=this;la.clearTimeout(this.mediaUpdateTimeout);var i=this.media();e?(e=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3,this.mediaUpdateTimeout=la.setTimeout(function(){return t.load()},e)):this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},i.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=la.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=dn(e.handleManifestRedirects,e.src,i),i=e.parseManifest_({manifestString:i.responseText,url:e.src}),e.setupInitialPlaylist(i)}})},i.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,zn(this.master,this.srcUri()),e.playlists.forEach(function(e){e.segments=Un(e),e.segments.forEach(function(t){Bn(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t,i,n,r=this.srcUri()||la.location.href;this.master=(i=Pn(0,t=r),(n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:la.location.href,resolvedUri:la.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]}).playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n),this.haveMetadata({playlistObject:e,url:r,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Wa),Jl=mt.xhr,ec=mt.mergeOptions,No=Object.freeze({__proto__:null,createTransferableMessage:Xn,initSegmentId:Qn,segmentKeyId:Zn,hexDump:Jn,tagDump:function(e){return e=e.bytes,Jn(e)},textRanges:function(e){for(var t,i,n="",r=0;r<e.length;r++)n+=(i=r,(t=e).start(i)+"-"+t.end(i)+" ");return n}}),Ao=mt.EventTarget,tc=mt.mergeOptions,ic=function(e){function t(t,i,n,r){var a;if(void 0===n&&(n={}),(a=e.call(this)||this).masterPlaylistLoader_=r||uo(a),r||(a.isMaster_=!0),r=n.withCredentials,r=void 0!==r&&r,n=n.handleManifestRedirects,n=void 0!==n&&n,a.vhs_=i,a.withCredentials=r,a.handleManifestRedirects=n,!t)throw new Error("A non-empty playlist URL or object is required");return a.on("minimumUpdatePeriod",function(){a.refreshXml_()}),a.on("mediaupdatetimeout",function(){a.refreshMedia_(a.media().id)}),a.state="HAVE_NOTHING",a.loadedPlaylists_={},a.logger_=hn("DashPlaylistLoader"),a.isMaster_?(a.masterPlaylistLoader_.srcUrl=t,a.masterPlaylistLoader_.sidxMapping_={}):a.childPlaylist_=t,a}ho(t,e);var i=t.prototype;return i.requestErrored_=function(e,t,i){return!this.request||(this.request=null,e?(this.error="object"!=typeof e||e instanceof Error?{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2}:e,i&&(this.state=i),this.trigger("error"),!0):void 0)},i.addSidxSegments_=function(e,t,i){var n,r,a=this,o=e.sidx&&Si(e.sidx);e.sidx&&o&&!this.masterPlaylistLoader_.sidxMapping_[o]?(n=dn(this.handleManifestRedirects,e.sidx.resolvedUri),r=function(n,r){if(!a.requestErrored_(n,r,t)){var s,n=a.masterPlaylistLoader_.sidxMapping_;try{s=Ll(Qi(r.response).subarray(8))}catch(n){return void a.requestErrored_(n,r,t)}return n[o]={sidxInfo:e.sidx,sidx:s},Ti(e,s,e.sidx.resolvedUri),i(!0)}},this.request=nr(n,this.vhs_.xhr,function(t,i,o,s){if(t)return r(t,i);if(!o||"mp4"!==o)return r({status:i.status,message:"Unsupported "+(o||"unknown")+" container type for sidx segment at URL: "+n,response:"",playlist:e,internal:!0,blacklistDuration:1/0,code:2},i);var l=e.sidx.byterange,o=l.offset,l=l.length;if(s.length>=l+o)return r(t,{response:s.subarray(o,o+l),status:i.status,uri:i.uri});a.request=a.vhs_.xhr({uri:n,responseType:"arraybuffer",headers:Gn({byterange:e.sidx.byterange})},r)})):this.mediaRequest_=la.setTimeout(function(){return i(!1)},0)},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},la.clearTimeout(this.minimumUpdatePeriodTimeout_),la.clearTimeout(this.mediaRequest_),la.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},i.hasPendingRequest=function(){return this.request||this.mediaRequest_},i.stopRequest=function(){var e;this.request&&(e=this.request,this.request=null,e.onreadystatechange=null,e.abort())},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,function(n){t.haveMetadata({startingState:i,playlist:e})}))},i.haveMetadata=function(e){var t=e.startingState,e=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[e.id]=e,this.mediaRequest_=null,this.refreshMedia_(e.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),la.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(la.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},i.load=function(e){var t=this;la.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();e?(e=i?i.targetDuration/2*1e3:5e3,this.mediaUpdateTimeout=la.setTimeout(function(){return t.load()},e)):this.started?i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},i.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=la.setTimeout(function(){return e.haveMaster_()},0)},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(i,n){if(!t.requestErrored_(i,n)){var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=dn(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r?(t.handleMaster_(),void t.syncClientServerClock_(function(){return e(n,r)})):e(n,r)}"HAVE_NOTHING"===t.state&&(t.started=!1)})},i.syncClientServerClock_=function(e){var t=this,i=Xi(this.masterPlaylistLoader_.masterXml_);return null===i?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===i.method?(this.masterPlaylistLoader_.clientOffset_=i.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:Vl(this.masterPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials},function(n,r){if(t.request){if(n)return t.masterPlaylistLoader_.clientOffset_=t.masterLoaded_-Date.now(),e();r="HEAD"===i.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):t.masterLoaded_:Date.parse(r.responseText),t.masterPlaylistLoader_.clientOffset_=r-Date.now(),e()}}))},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},i.handleMaster_=function(){this.mediaRequest_=null;var e,t,t=(n={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_},e=n.masterXml,i=n.srcUrl,t=n.clientOffset,n=n.sidxMapping,n=Ki(e,{manifestUri:i,clientOffset:t,sidxMapping:n}),zn(n,i),n),i=this.masterPlaylistLoader_.master;i&&(t=function(e,t,i){for(var n=!0,r=tc(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod}),a=0;a<t.playlists.length;a++){var o,s=t.playlists[a];s.sidx&&(o=Si(s.sidx),i&&i[o]&&i[o].sidx&&Ti(s,i[o].sidx,s.sidx.resolvedUri)),s=qn(r,s,rr),s&&(r=s,n=!1)}return Rn(t,function(e,t,i,a){var o;e.playlists&&e.playlists.length&&(o=e.playlists[0].id,(e=qn(r,e.playlists[0],rr))&&((r=e).mediaGroups[t][i][a].playlists[0]=r.playlists[o],n=!1))}),(n=t.minimumUpdatePeriod===e.minimumUpdatePeriod&&n)?null:r}(i,t,this.masterPlaylistLoader_.sidxMapping_)),this.masterPlaylistLoader_.master=t||i;var n=this.masterPlaylistLoader_.master.locations&&this.masterPlaylistLoader_.master.locations[0];return n&&n!==this.masterPlaylistLoader_.srcUrl&&(this.masterPlaylistLoader_.srcUrl=n),(!i||t&&t.minimumUpdatePeriod!==i.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),Boolean(t)},i.updateMinimumUpdatePeriodTimeout_=function(){var e=this.masterPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(la.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);var t=e.master&&e.master.minimumUpdatePeriod;0===t&&(e.media()?t=1e3*e.media().targetDuration:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),
|
||
"number"!=typeof t||t<=0?t<0&&this.logger_("found invalid minimumUpdatePeriod of "+t+", not setting a timeout"):this.createMUPTimeout_(t)},i.createMUPTimeout_=function(e){var t=this.masterPlaylistLoader_;t.minimumUpdatePeriodTimeout_=la.setTimeout(function(){t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)},i.refreshXml_=function(){var e=this;this.requestMaster_(function(t,i){var n,r;i&&(e.media_&&(e.media_=e.masterPlaylistLoader_.master.playlists[e.media_.id]),e.masterPlaylistLoader_.sidxMapping_=(i=e.masterPlaylistLoader_.master,n=e.masterPlaylistLoader_.sidxMapping_,r=ar(i.playlists,n),Rn(i,function(e,t,i,a){e.playlists&&e.playlists.length&&(e=e.playlists,r=tc(r,ar(e,n)))}),r),e.addSidxSegments_(e.media(),e.state,function(t){e.refreshMedia_(e.media().id)}))})},i.refreshMedia_=function(e){var t=this;if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMaster_&&this.handleMaster_();var i=this.masterPlaylistLoader_.master.playlists,n=!this.media_||this.media_!==i[e];n?this.media_=i[e]:this.trigger("playlistunchanged"),this.mediaUpdateTimeout||function e(){t.media().endList||(t.mediaUpdateTimeout=la.setTimeout(function(){t.trigger("mediaupdatetimeout"),e()},Hn(t.media(),Boolean(n))))}(),this.trigger("loadedplaylist")},t}(Ao),nc={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30},Po=function(e){return function(){var t=function(e){try{return URL.createObjectURL(new Blob([e],{type:"application/javascript"}))}catch(i){var t=new BlobBuilder;return t.append(e),URL.createObjectURL(t.getBlob())}}(e),i=or(new Worker(t));i.objURL=t;var n=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(t),n.call(this)},i}},Ws=function(e){return"var browserWorkerPolyFill = "+or.toString()+";\nbrowserWorkerPolyFill(self);\n"+e},Wa=function(e){return e.toString().replace(/^function.+?{/,"").slice(0,-1)},rc=Po(Ws(Wa(function(){function e(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i}function t(e){for(var t=[];e--;)t.push(0);return t}function i(){var e,i;return he||(e={96e3:[we,[227,64],t(154),[56]],88200:[we,[231],t(170),[56]],64e3:[we,[248,192],t(240),[56]],48e3:[we,[255,192],t(268),[55,148,128],t(54),[112]],44100:[we,[255,192],t(268),[55,163,128],t(84),[112]],32e3:[we,[255,192],t(268),[55,234],t(226),[112]],24e3:[we,[255,192],t(268),[55,255,128],t(268),[111,112],t(126),[224]],16e3:[we,[255,192],t(268),[55,255,128],t(268),[111,255],t(269),[223,108],t(195),[1,192]],12e3:[xe,t(268),[3,127,248],t(268),[6,255,240],t(268),[13,255,224],t(268),[27,253,128],t(259),[56]],11025:[xe,t(268),[3,127,248],t(268),[6,255,240],t(268),[13,255,224],t(268),[27,255,192],t(268),[55,175,128],t(108),[112]],8e3:[xe,t(268),[3,121,16],t(47),[7]]},i=e,he=Object.keys(i).reduce(function(e,t){return e[t]=new Uint8Array(i[t].reduce(function(e,t){return e.concat(t)},[])),e},{})),he}function n(e){return 32<=e&&e<=127||160<=e&&e<=255}function r(e){this.windowNum=e,this.reset()}function a(e){this.serviceNum=e,this.text="",this.currentWindow=new r(-1),this.windows=[]}function o(e){return null===e?"":(e=Ve[e]||e,String.fromCharCode(e))}function s(){for(var e=[],t=15;t--;)e.push("");return e}function l(e,t){var i=1;for(t<e&&(i=-1);4294967296<Math.abs(t-e);)e+=8589934592*i;return e}function c(e,t,i){for(var n="",r=t;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n}function u(e,t,i){return decodeURIComponent(c(e,t,i))}function d(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}function h(e,t){var i=0<=(i=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9])?i:0;return(16&e[t+5])>>4?i+20:i+10}function p(e,t){return e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)?t:p(e,t+=h(e,t))}function f(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]}function m(e,t){var i;if(e.length===t.length){for(i=0;i<e.length;i++)if(e[i]!==t[i])return;return 1}}function g(e,t,i,n,r,a){return{start:{dts:e,pts:e+(i-t)},end:{dts:e+(n-t),pts:e+(r-i)},prependedContentDuration:a,baseMediaDecodeTime:e}}function v(e,t){var i=At(e,["moof","traf"]),e=At(e,["mdat"]),n={},r=[];return e.forEach(function(e,t){t=i[t],r.push({mdat:e,traf:t})}),r.forEach(function(e){var i,r,a,o,s,l=e.mdat,c=e.traf,u=At(c,["tfhd"]),d=Ot(u[0]),e=d.trackId,u=At(c,["tfdt"]),u=0<u.length?Dt(u[0]).baseMediaDecodeTime:0,c=At(c,["trun"]);t===e&&0<c.length&&(c=c,i=u,r=(d=d).defaultSampleDuration||0,a=d.defaultSampleSize||0,o=d.trackId,s=[],c.forEach(function(e){e=Lt(e).samples,e.forEach(function(e){void 0===e.duration&&(e.duration=r),void 0===e.size&&(e.size=a),e.trackId=o,e.dts=i,void 0===e.compositionTimeOffset&&(e.compositionTimeOffset=0),e.pts=i+e.compositionTimeOffset,i+=e.duration}),s=s.concat(e)}),l=function(e,t,i){for(var n,r,a=new DataView(e.buffer,e.byteOffset,e.byteLength),o={logs:[],seiNals:[]},s=0;s+4<e.length;s+=n)if(n=a.getUint32(s),s+=4,!(n<=0))switch(31&e[s]){case 6:var l=e.subarray(s+1,s+1+n),c=function(e,t){for(var i=e,n=0;n<t.length;n++){var r=t[n];if(i<r.size)return r;i-=r.size}return null}(s,t),l={nalUnitType:"sei_rbsp",size:n,data:l,escapedRBSP:Nt(l),trackId:i};if(c)l.pts=c.pts,l.dts=c.dts,r=c;else{if(!r){o.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+s+" for trackId "+i+". See mux.js#223."});break}l.pts=r.pts,l.dts=r.dts}o.seiNals.push(l)}return o}(l,s,e),n[e]||(n[e]={seiNals:[],logs:[]}),n[e].seiNals=n[e].seiNals.concat(l.seiNals),n[e].logs=n[e].logs.concat(l.logs))}),n}function y(e){var t=31&e[1];return t<<=8,t|=e[2]}function _(e){return!!(64&e[1])}function b(e){var t=0;return 1<(48&e[3])>>>4&&(t+=e[4]+1),t}function w(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}}function x(e,t,i){for(var n,r,a,o,s=0,l=188,c=!1;l<=e.byteLength;)if(71!==e[s]||71!==e[l]&&l!==e.byteLength)s++,l++;else{if(n=e.subarray(s,l),"pes"===qt.ts.parseType(n,t.pid)&&(r=qt.ts.parsePesType(n,t.table),a=qt.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(o=qt.ts.parsePesTime(n))&&(o.type="audio",i.audio.push(o),c=!0)),c)break;s+=188,l+=188}for(s=(l=e.byteLength)-188,c=!1;0<=s;)if(71!==e[s]||71!==e[l]&&l!==e.byteLength)s--,l--;else{if(n=e.subarray(s,l),"pes"===qt.ts.parseType(n,t.pid)&&(r=qt.ts.parsePesType(n,t.table),a=qt.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(o=qt.ts.parsePesTime(n))&&(o.type="audio",i.audio.push(o),c=!0)),c)break;s-=188,l-=188}}function k(e){var t,i={pid:null,table:null},n={};for(t in function(e,t){for(var i,n=0,r=188;r<e.byteLength;)if(71!==e[n]||71!==e[r])n++,r++;else{switch(i=e.subarray(n,r),qt.ts.parseType(i,t.pid)){case"pat":t.pid=qt.ts.parsePat(i);break;case"pmt":var a=qt.ts.parsePmt(i);t.table=t.table||{},Object.keys(a).forEach(function(e){t.table[e]=a[e]})}n+=188,r+=188}}(e,i),i.table)if(i.table.hasOwnProperty(t))switch(i.table[t]){case Xe.H264_STREAM_TYPE:n.video=[],function(e,t,i){for(var n,r,a,o,s,l,c,u,d=0,h=188,p=!1,f={data:[],size:0};h<e.byteLength;)if(71!==e[d]||71!==e[h])d++,h++;else{if(n=e.subarray(d,h),"pes"===qt.ts.parseType(n,t.pid)&&(r=qt.ts.parsePesType(n,t.table),a=qt.ts.parsePayloadUnitStartIndicator(n),"video"===r&&(a&&!p&&(o=qt.ts.parsePesTime(n))&&(o.type="video",i.video.push(o),p=!0),!i.firstKeyFrame))){if(a&&0!==f.size){for(s=new Uint8Array(f.size),l=0;f.data.length;)c=f.data.shift(),s.set(c,l),l+=c.byteLength;!qt.ts.videoPacketContainsKeyFrame(s)||(u=qt.ts.parsePesTime(s))&&(i.firstKeyFrame=u,i.firstKeyFrame.type="video"),f.size=0}f.data.push(n),f.size+=n.byteLength}if(p&&i.firstKeyFrame)break;d+=188,h+=188}for(d=(h=e.byteLength)-188,p=!1;0<=d;)if(71!==e[d]||71!==e[h])d--,h--;else{if(n=e.subarray(d,h),"pes"===qt.ts.parseType(n,t.pid)&&(r=qt.ts.parsePesType(n,t.table),a=qt.ts.parsePayloadUnitStartIndicator(n),"video"===r&&a&&(o=qt.ts.parsePesTime(n))&&(o.type="video",i.video.push(o),p=!0)),p)break;d-=188,h-=188}}(e,i,n),0===n.video.length&&delete n.video;break;case Xe.ADTS_STREAM_TYPE:n.audio=[],x(e,i,n),0===n.audio.length&&delete n.audio}return n}var C=function(){this.init=function(){var e={};this.on=function(t,i){e[t]||(e[t]=[]),e[t]=e[t].concat(i)},this.off=function(t,i){return!!e[t]&&(i=e[t].indexOf(i),e[t]=e[t].slice(),e[t].splice(i,1),-1<i)},this.trigger=function(t){var i,n,r,a=e[t];if(a)if(2===arguments.length)for(n=a.length,i=0;i<n;++i)a[i].call(this,arguments[1]);else{for(r=[],i=arguments.length,i=1;i<arguments.length;++i)r.push(arguments[i]);for(n=a.length,i=0;i<n;++i)a[i].apply(this,r)}},this.dispose=function(){e={}}}};C.prototype.pipe=function(e){return this.on("data",function(t){e.push(t)}),this.on("done",function(t){e.flush(t)}),this.on("partialdone",function(t){e.partialFlush(t)}),this.on("endedtimeline",function(t){e.endTimeline(t)}),this.on("reset",function(t){e.reset(t)}),e},C.prototype.push=function(e){this.trigger("data",e)},C.prototype.flush=function(e){this.trigger("done",e)},C.prototype.partialFlush=function(e){this.trigger("partialdone",e)},C.prototype.endTimeline=function(e){this.trigger("endedtimeline",e)},C.prototype.reset=function(e){this.trigger("reset",e)};var T,S,E,A,I,D,M,L,O,N,P,R,j,z,F,B,U,$,q,H,W,V,G,Y,K,X,Q,Z,J,ee,te,ie,ne,re,ae,oe,se,le,ce,ue=C,de=Math.pow(2,32)-1;!function(){if(W={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(var e in W)W.hasOwnProperty(e)&&(W[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);V=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),Y=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),G=new Uint8Array([0,0,0,1]),K=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),X=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),Q={video:K,audio:X},ee=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),J=new Uint8Array([0,0,0,0,0,0,0,0]),te=new Uint8Array([0,0,0,0,0,0,0,0]),ie=te,ne=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),re=te,Z=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),T=function(e){for(var t,i=[],n=0,r=1;r<arguments.length;r++)i.push(arguments[r]);for(r=i.length;r--;)n+=i[r].byteLength;for(t=new Uint8Array(n+8),new DataView(t.buffer,t.byteOffset,t.byteLength).setUint32(0,t.byteLength),t.set(e,4),r=0,n=8;r<i.length;r++)t.set(i[r],n),n+=i[r].byteLength;return t},S=function(){return T(W.dinf,T(W.dref,ee))},E=function(e){return T(W.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,e.audioobjecttype<<3|e.samplingfrequencyindex>>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},z=function(e){return T(W.hdlr,Q[e])},j=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(t[12]=e.samplerate>>>24&255,t[13]=e.samplerate>>>16&255,t[14]=e.samplerate>>>8&255,t[15]=255&e.samplerate),T(W.mdhd,t)},R=function(e){return T(W.mdia,j(e),z(e.type),D(e))},I=function(e){return T(W.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},D=function(e){return T(W.minf,"video"===e.type?T(W.vmhd,Z):T(W.smhd,J),S(),B(e))},Qe=function(e,t){for(var i=[],n=t.length;n--;)i[n]=$(t[n]);return T.apply(null,[W.moof,I(e)].concat(i))},M=function(e){for(var t=e.length,i=[];t--;)i[t]=N(e[t]);return T.apply(null,[W.moov,O(4294967295)].concat(i).concat(L(e)))},L=function(e){for(var t=e.length,i=[];t--;)i[t]=q(e[t]);return T.apply(null,[W.mvex].concat(i))},O=function(e){return e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]),T(W.mvhd,e)},F=function(e){for(var t,i=e.samples||[],n=new Uint8Array(4+i.length),r=0;r<i.length;r++)t=i[r].flags,n[r+4]=t.dependsOn<<4|t.isDependedOn<<2|t.hasRedundancy;return T(W.sdtp,n)},B=function(e){return T(W.stbl,U(e),T(W.stts,re),T(W.stsc,ie),T(W.stsz,ne),T(W.stco,te))},U=function(e){return T(W.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),("video"===e.type?ae:oe)(e))},ae=function(e){for(var t,i,n=e.sps||[],r=e.pps||[],a=[],o=[],s=0;s<n.length;s++)a.push((65280&n[s].byteLength)>>>8),a.push(255&n[s].byteLength),a=a.concat(Array.prototype.slice.call(n[s]));for(s=0;s<r.length;s++)o.push((65280&r[s].byteLength)>>>8),o.push(255&r[s].byteLength),o=o.concat(Array.prototype.slice.call(r[s]));return t=[W.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),T(W.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([n.length],a,[r.length],o))),T(W.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio&&(i=e.sarRatio[0],e=e.sarRatio[1],t.push(T(W.pasp,new Uint8Array([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e])))),T.apply(null,t)},oe=function(e){return T(W.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),E(e))},P=function(e){return e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]),T(W.tkhd,e)},$=function(e){var t,i=T(W.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),n=Math.floor(e.baseMediaDecodeTime/(1+de)),r=Math.floor(e.baseMediaDecodeTime%(1+de)),n=T(W.tfdt,new Uint8Array([1,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,r>>>24&255,r>>>16&255,r>>>8&255,255&r]));return"audio"===e.type?(t=H(e,92),T(W.traf,i,n,t)):(r=F(e),t=H(e,r.length+92),T(W.traf,i,n,t,r))},N=function(e){return e.duration=e.duration||4294967295,T(W.trak,P(e),R(e))},q=function(e){var t=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(t[t.length-1]=0),T(W.trex,t)},se=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},le=function(e,t){var i,n,r,a,o=e.samples||[];for(t+=20+16*o.length,t=se(o,t),(n=new Uint8Array(t.length+16*o.length)).set(t),i=t.length,a=0;a<o.length;a++)r=o[a],n[i++]=(4278190080&r.duration)>>>24,n[i++]=(16711680&r.duration)>>>16,n[i++]=(65280&r.duration)>>>8,n[i++]=255&r.duration,n[i++]=(4278190080&r.size)>>>24,n[i++]=(16711680&r.size)>>>16,n[i++]=(65280&r.size)>>>8,n[i++]=255&r.size,n[i++]=r.flags.isLeading<<2|r.flags.dependsOn,n[i++]=r.flags.isDependedOn<<6|r.flags.hasRedundancy<<4|r.flags.paddingValue<<1|r.flags.isNonSyncSample,n[i++]=61440&r.flags.degradationPriority,n[i++]=15&r.flags.degradationPriority,n[i++]=(4278190080&r.compositionTimeOffset)>>>24,n[i++]=(16711680&r.compositionTimeOffset)>>>16,n[i++]=(65280&r.compositionTimeOffset)>>>8,n[i++]=255&r.compositionTimeOffset;return T(W.trun,n)},ce=function(e,t){var i,n,r,a,o=e.samples||[];for(t+=20+8*o.length,t=se(o,t),(i=new Uint8Array(t.length+8*o.length)).set(t),n=t.length,a=0;a<o.length;a++)r=o[a],i[n++]=(4278190080&r.duration)>>>24,i[n++]=(16711680&r.duration)>>>16,i[n++]=(65280&r.duration)>>>8,i[n++]=255&r.duration,i[n++]=(4278190080&r.size)>>>24,i[n++]=(16711680&r.size)>>>16,i[n++]=(65280&r.size)>>>8,i[n++]=255&r.size;return T(W.trun,i)},H=function(e,t){return("audio"===e.type?ce:le)(e,t)},A=function(){return T(W.ftyp,V,G,V,Y)};var he,pe=function(e){return T(W.mdat,e)},fe=Qe,me=function(e){var t=A(),i=M(e),e=new Uint8Array(t.byteLength+i.byteLength);return e.set(t),e.set(i,t.byteLength),e},ge=function(e){var t,i,n=[],r=[];for(r.byteLength=0,r.nalCount=0,r.duration=0,t=n.byteLength=0;t<e.length;t++)"access_unit_delimiter_rbsp"===(i=e[t]).nalUnitType?(n.length&&(n.duration=i.dts-n.dts,r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n)),(n=[i]).byteLength=i.data.byteLength,n.pts=i.pts,n.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(n.keyFrame=!0),n.duration=i.dts-n.dts,n.byteLength+=i.data.byteLength,n.push(i));return r.length&&(!n.duration||n.duration<=0)&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.length,r.duration+=n.duration,r.push(n),r},ve=function(e){var t,i,n=[],r=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,n.pts=e[0].pts,n.dts=e[0].dts,r.byteLength=0,r.nalCount=0,r.duration=0,r.pts=e[0].pts,r.dts=e[0].dts,t=0;t<e.length;t++)(i=e[t]).keyFrame?(n.length&&(r.push(n),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration),(n=[i]).nalCount=i.length,n.byteLength=i.byteLength,n.pts=i.pts,n.dts=i.dts,n.duration=i.duration):(n.duration+=i.duration,n.nalCount+=i.length,n.byteLength+=i.byteLength,n.push(i));return r.length&&n.duration<=0&&(n.duration=r[r.length-1].duration),r.byteLength+=n.byteLength,r.nalCount+=n.nalCount,r.duration+=n.duration,r.push(n),r},ye=function(e){var t;return!e[0][0].keyFrame&&1<e.length&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e},_e=function(t,i){for(var n,r,a,o=i||0,s=[],l=0;l<t.length;l++)for(r=t[l],n=0;n<r.length;n++)a=r[n],o+=(a=e(a,o)).size,s.push(a);return s},be=function(e){for(var t,i,n,r,a,o=0,s=e.byteLength,l=e.nalCount,c=new Uint8Array(s+4*l),u=new DataView(c.buffer),d=0;d<e.length;d++)for(n=e[d],t=0;t<n.length;t++)for(r=n[t],i=0;i<r.length;i++)a=r[i],u.setUint32(o,a.data.byteLength),c.set(a.data,o+=4),o+=a.data.byteLength;return c},we=[33,16,5,32,164,27],xe=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ke=function(e){return 9e4*e},Ce=function(e,t){return e*t},Te=function(e){return e/9e4},Se=function(e,t){return e/t},Ee=ke,Ae=Te,Ie=function(e,t){return ke(Se(e,t))},De=function(e,t){return Ce(Te(e),t)},Me=function(e,t,i){return Te(i?e:e-t)},Le=function(e,t,n,r){var a,o,s,l,c,u,d=0,h=0;if(t.length&&(a=Ie(e.baseMediaDecodeTime,e.samplerate),o=Math.ceil(9e4/(e.samplerate/1024)),n&&r&&(s=a-Math.max(n,r),h=(d=Math.floor(s/o))*o),!(d<1||45e3<h))){for(l=(l=i()[e.samplerate])||t[0].data,c=0;c<d;c++)u=t[0],t.splice(0,0,{data:l,dts:u.dts-o,pts:u.pts-o});return e.baseMediaDecodeTime-=Math.floor(De(h,e.samplerate)),h}},Oe=function(e,t,i){return t.minSegmentDts>=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))},Ne=function(e){for(var t,i=[],n=0;n<e.length;n++)t=e[n],i.push({size:t.data.byteLength,duration:1024});return i},Pe=function(e){for(var t,i=0,n=new Uint8Array(function(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].data.byteLength;return t}(e)),r=0;r<e.length;r++)t=e[r],n.set(t.data,i),i+=t.data.byteLength;return n},Re=function(e){delete e.minSegmentDts,delete e.maxSegmentDts,delete e.minSegmentPts,delete e.maxSegmentPts},je=function(e,t){var i=e.minSegmentDts;return t||(i-=e.timelineStartInfo.dts),t=e.timelineStartInfo.baseMediaDecodeTime,t+=i,t=Math.max(0,t),"audio"===e.type&&(t*=e.samplerate/9e4,t=Math.floor(t)),t},ze=function(e,t){"number"==typeof t.pts&&(void 0===e.timelineStartInfo.pts&&(e.timelineStartInfo.pts=t.pts),void 0===e.minSegmentPts?e.minSegmentPts=t.pts:e.minSegmentPts=Math.min(e.minSegmentPts,t.pts),void 0===e.maxSegmentPts?e.maxSegmentPts=t.pts:e.maxSegmentPts=Math.max(e.maxSegmentPts,t.pts)),"number"==typeof t.dts&&(void 0===e.timelineStartInfo.dts&&(e.timelineStartInfo.dts=t.dts),void 0===e.minSegmentDts?e.minSegmentDts=t.dts:e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),void 0===e.maxSegmentDts?e.maxSegmentDts=t.dts:e.maxSegmentDts=Math.max(e.maxSegmentDts,t.dts))},Fe=function(e){for(var t=0,i={payloadType:-1,payloadSize:0},n=0,r=0;t<e.byteLength&&128!==e[t];){for(;255===e[t];)n+=255,t++;for(n+=e[t++];255===e[t];)r+=255,t++;if(r+=e[t++],!i.payload&&4===n){if("GA94"===String.fromCharCode(e[t+3],e[t+4],e[t+5],e[t+6])){i.payloadType=n,i.payloadSize=r,i.payload=e.subarray(t,t+r);break}i.payload=void 0}t+=r,r=n=0}return i},Be=function(e){return 181!==e.payload[0]||49!=(e.payload[1]<<8|e.payload[2])||"GA94"!==String.fromCharCode(e.payload[3],e.payload[4],e.payload[5],e.payload[6])||3!==e.payload[7]?null:e.payload.subarray(8,e.payload.length-1)},Ue=function(e,t){var i,n,r,a,o=[];if(!(64&t[0]))return o;for(n=31&t[0],i=0;i<n;i++)a={type:3&t[2+(r=3*i)],pts:e},4&t[2+r]&&(a.ccData=t[3+r]<<8|t[4+r],o.push(a));return o},$e=function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;for(var r=t-i.length,a=new Uint8Array(r),o=0,n=0;n<r;o++,n++)o===i[0]&&(o++,i.shift()),a[n]=e[o];return a},qe=function e(t){t=t||{},e.prototype.init.call(this),this.parse708captions_="boolean"!=typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new Ye(0,0),new Ye(0,1),new Ye(1,0),new Ye(1,1)],this.parse708captions_&&(this.cc708Stream_=new We),this.reset(),this.ccStreams_.forEach(function(e){e.on("data",this.trigger.bind(this,"data")),e.on("partialdone",this.trigger.bind(this,"partialdone")),e.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};(qe.prototype=new ue).push=function(e){var t,i;if("sei_rbsp"===e.nalUnitType&&(t=Fe(e.escapedRBSP)).payload&&4===t.payloadType&&(i=Be(t)))if(e.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(e.dts===this.latestDts_&&this.ignoreNextEqualDts_)return void(--this.numSameDts_||(this.ignoreNextEqualDts_=!1));i=Ue(e.pts,i),this.captionPackets_=this.captionPackets_.concat(i),this.latestDts_!==e.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=e.dts}},qe.prototype.flushCCStreams=function(e){this.ccStreams_.forEach(function(t){return"flush"===e?t.flush():t.partialFlush()},this)},qe.prototype.flushStream=function(e){this.captionPackets_.length&&(this.captionPackets_.forEach(function(e,t){e.presortIndex=t}),this.captionPackets_.sort(function(e,t){return e.pts===t.pts?e.presortIndex-t.presortIndex:e.pts-t.pts}),this.captionPackets_.forEach(function(e){e.type<2?this.dispatchCea608Packet(e):this.dispatchCea708Packet(e)},this),this.captionPackets_.length=0),this.flushCCStreams(e)},qe.prototype.flush=function(){return this.flushStream("flush")},qe.prototype.partialFlush=function(){return this.flushStream("partialFlush")},qe.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(e){e.reset()})},qe.prototype.dispatchCea608Packet=function(e){this.setsTextOrXDSActive(e)?this.activeCea608Channel_[e.type]=null:this.setsChannel1Active(e)?this.activeCea608Channel_[e.type]=0:this.setsChannel2Active(e)&&(this.activeCea608Channel_[e.type]=1),null!==this.activeCea608Channel_[e.type]&&this.ccStreams_[(e.type<<1)+this.activeCea608Channel_[e.type]].push(e)},qe.prototype.setsChannel1Active=function(e){return 4096==(30720&e.ccData)},qe.prototype.setsChannel2Active=function(e){return 6144==(30720&e.ccData)},qe.prototype.setsTextOrXDSActive=function(e){return 256==(28928&e.ccData)||4138==(30974&e.ccData)||6186==(30974&e.ccData)},qe.prototype.dispatchCea708Packet=function(e){this.parse708captions_&&this.cc708Stream_.push(e)};var He={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600};r.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},r.prototype.getText=function(){return this.rows.join("\n")},r.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},r.prototype.newLine=function(e){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),0<this.rows.length&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},r.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},r.prototype.addText=function(e){this.rows[this.rowIdx]+=e},r.prototype.backspace=function(){var e;this.isEmpty()||(e=this.rows[this.rowIdx],this.rows[this.rowIdx]=e.substr(0,e.length-1))},a.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new r(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},a.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]};var We=function e(){e.prototype.init.call(this);var t=this;this.current708Packet=null,this.services={},this.push=function(e){(3===e.type||null===t.current708Packet)&&t.new708Packet(),t.add708Bytes(e)}};We.prototype=new ue,We.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},We.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,t=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(t)},We.prototype.push708Packet=function(){var e,t=this.current708Packet,i=t.data,n=null,r=0,a=i[r++];for(t.seq=a>>6,t.sizeCode=63&a;r<i.length;r++)e=31&(a=i[r++]),7==(n=a>>5)&&0<e&&(n=i[r++]),this.pushServiceBlock(n,r,e),0<e&&(r+=e-1)},We.prototype.pushServiceBlock=function(e,t,i){for(var r,a=t,o=this.current708Packet.data,s=(s=this.services[e])||this.initService(e,a);a<t+i&&a<o.length;a++)r=o[a],n(r)?a=this.handleText(a,s):16===r?a=this.extendedCommands(a,s):128<=r&&r<=135?a=this.setCurrentWindow(a,s):152<=r&&r<=159?a=this.defineWindow(a,s):136===r?a=this.clearWindows(a,s):140===r?a=this.deleteWindows(a,s):137===r?a=this.displayWindows(a,s):138===r?a=this.hideWindows(a,s):139===r?a=this.toggleWindows(a,s):151===r?a=this.setWindowAttributes(a,s):144===r?a=this.setPenAttributes(a,s):145===r?a=this.setPenColor(a,s):146===r?a=this.setPenLocation(a,s):143===r?s=this.reset(a,s):8===r?s.currentWindow.backspace():12===r?s.currentWindow.clearText():13===r?s.currentWindow.pendingNewLine=!0:14===r?s.currentWindow.clearText():141===r&&a++},We.prototype.extendedCommands=function(e,t){var i=this.current708Packet.data[++e];return e=n(i)?this.handleText(e,t,!0):e},We.prototype.getPts=function(e){return this.current708Packet.ptsVals[Math.floor(e/2)]},We.prototype.initService=function(e,t){var i=this;return this.services[e]=new a(e),this.services[e].init(this.getPts(t),function(t){i.flushDisplayed(t,i.services[e])}),this.services[e]},We.prototype.handleText=function(e,t,i){var n=this.current708Packet.data[e],n=(n=He[i=(i?4096:0)|n]||i,4096&i&&i===n?"":String.fromCharCode(n)),t=t.currentWindow;return t.pendingNewLine&&!t.isEmpty()&&t.newLine(this.getPts(e)),t.pendingNewLine=!1,t.addText(n),e},We.prototype.setCurrentWindow=function(e,t){var i=this.current708Packet.data[e];return t.setCurrentWindow(7&i),e},We.prototype.defineWindow=function(e,t){var i=this.current708Packet.data,n=i[e];return t.setCurrentWindow(7&n),t=t.currentWindow,n=i[++e],t.visible=(32&n)>>5,t.rowLock=(16&n)>>4,t.columnLock=(8&n)>>3,t.priority=7&n,n=i[++e],t.relativePositioning=(128&n)>>7,t.anchorVertical=127&n,n=i[++e],t.anchorHorizontal=n,n=i[++e],t.anchorPoint=(240&n)>>4,t.rowCount=15&n,n=i[++e],t.columnCount=63&n,n=i[++e],t.windowStyle=(56&n)>>3,t.penStyle=7&n,t.virtualRowCount=t.rowCount+1,e},We.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],t=t.currentWindow.winAttr,n=i[++e];return t.fillOpacity=(192&n)>>6,t.fillRed=(48&n)>>4,t.fillGreen=(12&n)>>2,t.fillBlue=3&n,n=i[++e],t.borderType=(192&n)>>6,t.borderRed=(48&n)>>4,t.borderGreen=(12&n)>>2,t.borderBlue=3&n,n=i[++e],t.borderType+=(128&n)>>5,t.wordWrap=(64&n)>>6,t.printDirection=(48&n)>>4,t.scrollDirection=(12&n)>>2,t.justify=3&n,n=i[++e],t.effectSpeed=(240&n)>>4,t.effectDirection=(12&n)>>2,t.displayEffect=3&n,e},We.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},We.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},We.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=1);return e},We.prototype.hideWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible=0);return e},We.prototype.toggleWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&(t.windows[r].visible^=1);return e},We.prototype.clearWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].clearText();return e},We.prototype.deleteWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<<r&&t.windows[r].reset();return e},We.prototype.setPenAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],t=t.currentWindow.penAttr,n=i[++e];return t.textTag=(240&n)>>4,t.offset=(12&n)>>2,t.penSize=3&n,n=i[++e],t.italics=(128&n)>>7,t.underline=(64&n)>>6,t.edgeType=(56&n)>>3,t.fontStyle=7&n,e},We.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],t=t.currentWindow.penColor,n=i[++e];return t.fgOpacity=(192&n)>>6,t.fgRed=(48&n)>>4,t.fgGreen=(12&n)>>2,t.fgBlue=3&n,n=i[++e],t.bgOpacity=(192&n)>>6,t.bgRed=(48&n)>>4,t.bgGreen=(12&n)>>2,t.bgBlue=3&n,n=i[++e],t.edgeRed=(48&n)>>4,t.edgeGreen=(12&n)>>2,t.edgeBlue=3&n,e},We.prototype.setPenLocation=function(e,t){
|
||
var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},We.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var Ve={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Ge=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ye=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a=32639&e.ccData;a!==this.lastControlCode_?(4096==(61440&a)?this.lastControlCode_=a:a!==this.PADDING_&&(this.lastControlCode_=null),t=a>>>8,i=255&a,a===this.PADDING_||(a===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":a===this.END_OF_CAPTION_?(this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),r=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=r,this.startPts_=e.pts):a===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(e.pts)):a===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(e.pts)):a===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(e.pts)):a===this.CARRIAGE_RETURN_?(this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts):a===this.BACKSPACE_?"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1):a===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(e.pts),this.displayed_=s()):a===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=s():a===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=s()),this.mode_="paintOn",this.startPts_=e.pts):this.isSpecialCharacter(t,i)?(n=o((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isExtCharacter(t,i)?("popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),n=o((t=(3&t)<<8)|i),this[this.mode_](e.pts,n),this.column_++):this.isMidRowCode(t,i)?(this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&i)&&this.addFormatting(e.pts,["i"]),1==(1&i)&&this.addFormatting(e.pts,["u"])):this.isOffsetControlCode(t,i)?this.column_+=3&i:this.isPAC(t,i)?(r=Ge.indexOf(7968&a),"rollUp"===this.mode_&&(r-this.rollUpRows_+1<0&&(r=this.rollUpRows_-1),this.setRollUp(e.pts,r)),r!==this.row_&&(this.clearFormatting(e.pts),this.row_=r),1&i&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&a)&&(this.column_=4*((14&a)>>1)),this.isColorPAC(i)&&14==(14&i)&&this.addFormatting(e.pts,["i"])):this.isNormalChar(t)&&(0===i&&(i=null),n=o(t),n+=o(i),this[this.mode_](e.pts,n),this.column_+=n.length))):this.lastControlCode_=null}};Ye.prototype=new ue,Ye.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},Ye.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=s(),this.nonDisplayed_=s(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},Ye.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},Ye.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&48<=t&&t<=63},Ye.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&32<=t&&t<=63},Ye.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&32<=t&&t<=47},Ye.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&33<=t&&t<=35},Ye.prototype.isPAC=function(e,t){return e>=this.BASE_&&e<this.BASE_+8&&64<=t&&t<=127},Ye.prototype.isColorPAC=function(e){return 64<=e&&e<=79||96<=e&&e<=127},Ye.prototype.isNormalChar=function(e){return 32<=e&&e<=127},Ye.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=s(),this.displayed_=s()),void 0!==t&&t!==this.row_)for(var i=0;i<this.rollUpRows_;i++)this.displayed_[t-i]=this.displayed_[this.row_-i],this.displayed_[this.row_-i]="";void 0===t&&(t=this.row_),this.topRow_=t-this.rollUpRows_+1},Ye.prototype.addFormatting=function(e,t){this.formatting_=this.formatting_.concat(t),t=t.reduce(function(e,t){return e+"<"+t+">"},""),this[this.mode_](e,t)},Ye.prototype.clearFormatting=function(e){var t;this.formatting_.length&&(t=this.formatting_.reverse().reduce(function(e,t){return e+"</"+t+">"},""),this.formatting_=[],this[this.mode_](e,t))},Ye.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];this.nonDisplayed_[this.row_]=i+=t},Ye.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t},Ye.prototype.shiftRowsUp_=function(){for(var e=0;e<this.topRow_;e++)this.displayed_[e]="";for(e=this.row_+1;e<15;e++)this.displayed_[e]="";for(e=this.topRow_;e<this.row_;e++)this.displayed_[e]=this.displayed_[e+1];this.displayed_[this.row_]=""},Ye.prototype.paintOn=function(e,t){var i=this.displayed_[this.row_];this.displayed_[this.row_]=i+=t};var Ke={CaptionStream:qe,Cea608Stream:Ye,Cea708Stream:We},Xe={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},C=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=l(e.dts,n),e.pts=l(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){i=n=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};C.prototype=new ue;var Qe=C,qe=l,Ze={TXXX:function(e){var t;if(3===e.data[0]){for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=u(e.data,1,t),e.value=u(e.data,t+1,e.data.length).replace(/\0*$/,"");break}e.data=e.value}},WXXX:function(e){var t;if(3===e.data[0])for(t=1;t<e.data.length;t++)if(0===e.data[t]){e.description=u(e.data,1,t),e.url=u(e.data,t+1,e.data.length);break}},PRIV:function(e){for(var t,i=0;i<e.data.length;i++)if(0===e.data[i]){e.owner=(t=e.data,unescape(c(t,0,i)));break}e.privateData=e.data.subarray(i+1),e.data=e.privateData}},Je=function(e){var t,i={descriptor:e&&e.descriptor},n=0,r=[],a=0;if(Je.prototype.init.call(this),this.dispatchType=Xe.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(t=0;t<i.descriptor.length;t++)this.dispatchType+=("00"+i.descriptor[t].toString(16)).slice(-2);this.push=function(e){var t,i,o,s,l,c,u;if("timed-metadata"===e.type)if(e.dataAlignmentIndicator&&(a=0,r.length=0),0===r.length&&(e.data.length<10||e.data[0]!=="I".charCodeAt(0)||e.data[1]!=="D".charCodeAt(0)||e.data[2]!=="3".charCodeAt(0)))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(r.push(e),a+=e.data.byteLength,1===r.length&&(n=d(e.data.subarray(6,10)),n+=10),!(a<n)){for(t={data:new Uint8Array(n),frames:[],pts:r[0].pts,dts:r[0].dts},s=0;s<n;)t.data.set(r[0].data.subarray(0,n-s),s),s+=r[0].data.byteLength,a-=r[0].data.byteLength,r.shift();i=10,64&t.data[5]&&(i+=4,i+=d(t.data.subarray(10,14)),n-=d(t.data.subarray(16,20)));do{if((o=d(t.data.subarray(i+4,i+8)))<1)return void this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping metadata parsing."})}while((u={id:String.fromCharCode(t.data[i],t.data[i+1],t.data[i+2],t.data[i+3]),data:t.data.subarray(i+10,i+o+10)}).key=u.id,Ze[u.id]&&(Ze[u.id](u),"com.apple.streaming.transportStreamTimestamp"===u.owner&&(c=(1&(l=u.data)[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2,c*=4,c+=3&l[7],u.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=u.timeStamp,t.dts=u.timeStamp),this.trigger("timestamp",u))),t.frames.push(u),i+=10,(i+=o)<n);this.trigger("data",t)}}};Je.prototype=new ue;var et,tt,C=Je,Qe=Qe,it=function(){var e=new Uint8Array(188),t=0;it.prototype.init.call(this),this.push=function(i){var n,r=0,a=188;for(t?((n=new Uint8Array(i.byteLength+t)).set(e.subarray(0,t)),n.set(i,t),t=0):n=i;a<n.byteLength;)71!==n[r]||71!==n[a]?(r++,a++):(this.trigger("data",n.subarray(r,a)),r+=188,a+=188);r<n.byteLength&&(e.set(n.subarray(r),0),t=n.byteLength-r)},this.flush=function(){188===t&&71===e[0]&&(this.trigger("data",e),t=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){t=0,this.trigger("reset")}};it.prototype=new ue,(et=function(){var e,t,i,n;et.prototype.init.call(this),(n=this).packetsWaitingForPmt=[],this.programMapTable=void 0,e=function(e,n){var r=0;n.payloadUnitStartIndicator&&(r+=e[r]+1),("pat"===n.type?t:i)(e.subarray(r),n)},t=function(e,t){t.section_number=e[7],t.last_section_number=e[8],n.pmtPid=(31&e[10])<<8|e[11],t.pmtPid=n.pmtPid},i=function(e,t){var i,r;if(1&e[5]){for(n.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&e[1])<<8|e[2])-4,r=12+((15&e[10])<<8|e[11]);r<i;){var a=e[r],o=(31&e[r+1])<<8|e[r+2];a===Xe.H264_STREAM_TYPE&&null===n.programMapTable.video?n.programMapTable.video=o:a===Xe.ADTS_STREAM_TYPE&&null===n.programMapTable.audio?n.programMapTable.audio=o:a===Xe.METADATA_STREAM_TYPE&&(n.programMapTable["timed-metadata"][o]=a),r+=5+((15&e[r+3])<<8|e[r+4])}t.programMapTable=n.programMapTable}},this.push=function(t){var i={},n=4;if(i.payloadUnitStartIndicator=!!(64&t[1]),i.pid=31&t[1],i.pid<<=8,i.pid|=t[2],1<(48&t[3])>>>4&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=Xe.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=Xe.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new ue,et.STREAM_TYPES={h264:27,adts:15},(tt=function(){function e(e,t,n){var r,a,o,s,l=new Uint8Array(e.size),c={type:t},u=0,d=0;if(e.data.length&&!(e.size<9)){for(c.trackId=e.data[0].pid,u=0;u<e.data.length;u++)r=e.data[u],l.set(r.data,d),d+=r.data.byteLength;o=c,s=(a=l)[0]<<16|a[1]<<8|a[2],o.data=new Uint8Array,1==s&&(o.packetLength=6+(a[4]<<8|a[5]),o.dataAlignmentIndicator=0!=(4&a[6]),192&(s=a[7])&&(o.pts=(14&a[9])<<27|(255&a[10])<<20|(254&a[11])<<12|(255&a[12])<<5|(254&a[13])>>>3,o.pts*=4,o.pts+=(6&a[13])>>>1,o.dts=o.pts,64&s&&(o.dts=(14&a[14])<<27|(255&a[15])<<20|(254&a[16])<<12|(255&a[17])<<5|(254&a[18])>>>3,o.dts*=4,o.dts+=(6&a[18])>>>1)),o.data=a.subarray(9+a[8])),t="video"===t||c.packetLength<=e.size,(n||t)&&(e.size=0,e.data.length=0),t&&i.trigger("data",c)}}var t,i=this,n=!1,r={data:[],size:0},a={data:[],size:0},o={data:[],size:0};tt.prototype.init.call(this),this.push=function(s){({pat:function(){},pes:function(){var t,i;switch(s.streamType){case Xe.H264_STREAM_TYPE:t=r,i="video";break;case Xe.ADTS_STREAM_TYPE:t=a,i="audio";break;case Xe.METADATA_STREAM_TYPE:t=o,i="timed-metadata";break;default:return}s.payloadUnitStartIndicator&&e(t,i,!0),t.data.push(s),t.size+=s.data.byteLength},pmt:function(){var e={type:"metadata",tracks:[]};null!==(t=s.programMapTable).video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),n=!0,i.trigger("data",e)}})[s.type]()},this.reset=function(){r.size=0,r.data.length=0,a.size=0,a.data.length=0,this.trigger("reset")},this.flushStreams_=function(){e(r,"video"),e(a,"audio"),e(o,"timed-metadata")},this.flush=function(){var e;!n&&t&&(e={type:"metadata",tracks:[]},null!==t.video&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&e.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),i.trigger("data",e)),n=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new ue;var nt,rt={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:it,TransportParseStream:et,ElementaryStream:tt,TimestampRolloverStream:Qe,CaptionStream:Ke.CaptionStream,Cea608Stream:Ke.Cea608Stream,Cea708Stream:Ke.Cea708Stream,MetadataStream:C};for(nt in Xe)Xe.hasOwnProperty(nt)&&(rt[nt]=Xe[nt]);var at=rt,ot=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],st=function(e){var t,i=0;st.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+i+" outside syncword"})},this.push=function(n){var r,a,o,s,l,c,u=0;if(e||(i=0),"audio"===n.type){for(t&&t.length?(o=t,(t=new Uint8Array(o.byteLength+n.data.byteLength)).set(o),t.set(n.data,o.byteLength)):t=n.data;u+7<t.length;)if(255===t[u]&&240==(246&t[u+1])){if("number"==typeof c&&(this.skipWarn_(c,u),c=null),a=2*(1&~t[u+1]),r=(3&t[u+3])<<11|t[u+4]<<3|(224&t[u+5])>>5,l=9e4*(s=1024*(1+(3&t[u+6])))/ot[(60&t[u+2])>>>2],t.byteLength-u<r)break;this.trigger("data",{pts:n.pts+i*l,dts:n.dts+i*l,sampleCount:s,audioobjecttype:1+(t[u+2]>>>6&3),channelcount:(1&t[u+2])<<2|(192&t[u+3])>>>6,samplerate:ot[(60&t[u+2])>>>2],samplingfrequencyindex:(60&t[u+2])>>>2,samplesize:16,data:t.subarray(u+7+a,u+r)}),i++,u+=r}else"number"!=typeof c&&(c=u),u++;"number"==typeof c&&(this.skipWarn_(c,u),c=null),t=t.subarray(u)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}};st.prototype=new ue;var lt,ct,ut=st,dt=function(e){var t=e.byteLength,i=0,n=0;this.length=function(){return 8*t},this.bitsAvailable=function(){return 8*t+n},this.loadWord=function(){var r=e.byteLength-t,a=new Uint8Array(4),o=Math.min(4,t);if(0===o)throw new Error("no bytes available");a.set(e.subarray(r,r+o)),i=new DataView(a.buffer).getUint32(0),n=8*o,t-=o},this.skipBits=function(e){var r;e<n||(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord()),i<<=e,n-=e},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return 0<(n-=r)?i<<=r:0<t&&this.loadWord(),0<(r=e-r)?a<<r|this.readBits(r):a},this.skipLeadingZeros=function(){for(var e=0;e<n;++e)if(0!=(i&2147483648>>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()},ht=function(){var e,t,i=0;ht.prototype.init.call(this),this.push=function(n){for(var r,a=(t=t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),r):n.data).byteLength;i<a-3;i++)if(1===t[i+2]){e=i+5;break}for(;e<a;)switch(t[e]){case 0:if(0!==t[e-1]){e+=2;break}if(0!==t[e-2]){e++;break}for(i+3!==e-2&&this.trigger("data",t.subarray(i+3,e-2));1!==t[++e]&&e<a;);i=e-2,e+=3;break;case 1:if(0!==t[e-1]||0!==t[e-2]){e+=3;break}this.trigger("data",t.subarray(i+3,e-2)),i=e-2,e+=3;break;default:e+=3}t=t.subarray(i),e-=i,i=0},this.reset=function(){t=null,i=0,this.trigger("reset")},this.flush=function(){t&&3<t.byteLength&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}};ht.prototype=new ue,ct={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(lt=function(){var e,t,i,n,r,a,o,s=new ht;lt.prototype.init.call(this),(e=this).push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,s.push(e))},s.on("data",function(o){var s={trackId:t,pts:i,dts:n,data:o,nalUnitTypeCode:31&o[0]};switch(s.nalUnitTypeCode){case 5:s.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:s.nalUnitType="sei_rbsp",s.escapedRBSP=r(o.subarray(1));break;case 7:s.nalUnitType="seq_parameter_set_rbsp",s.escapedRBSP=r(o.subarray(1)),s.config=a(s.escapedRBSP);break;case 8:s.nalUnitType="pic_parameter_set_rbsp";break;case 9:s.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",s)}),s.on("done",function(){e.trigger("done")}),s.on("partialdone",function(){e.trigger("partialdone")}),s.on("reset",function(){e.trigger("reset")}),s.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){s.flush()},this.partialFlush=function(){s.partialFlush()},this.reset=function(){s.reset()},this.endTimeline=function(){s.endTimeline()},o=function(e,t){for(var i=8,n=8,r=0;r<e;r++)i=0===(n=0!==n?(i+t.readExpGolomb()+256)%256:n)?i:n},r=function(e){for(var t=e.byteLength,i=[],n=1;n<t-2;)0===e[n]&&0===e[n+1]&&3===e[n+2]?(i.push(n+2),n+=2):n++;if(0===i.length)return e;for(var r=t-i.length,a=new Uint8Array(r),o=0,n=0;n<r;o++,n++)o===i[0]&&(o++,i.shift()),a[n]=e[o];return a},a=function(e){var t,i,n,r,a,s=0,l=0,c=0,u=0,d=[1,1],h=new dt(e),p=h.readUnsignedByte(),f=h.readUnsignedByte(),m=h.readUnsignedByte();if(h.skipUnsignedExpGolomb(),ct[p]&&(3===(i=h.readUnsignedExpGolomb())&&h.skipBits(1),h.skipUnsignedExpGolomb(),h.skipUnsignedExpGolomb(),h.skipBits(1),h.readBoolean()))for(r=3!==i?8:12,a=0;a<r;a++)h.readBoolean()&&o(a<6?16:64,h);if(h.skipUnsignedExpGolomb(),0===(n=h.readUnsignedExpGolomb()))h.readUnsignedExpGolomb();else if(1===n)for(h.skipBits(1),h.skipExpGolomb(),h.skipExpGolomb(),t=h.readUnsignedExpGolomb(),a=0;a<t;a++)h.skipExpGolomb();if(h.skipUnsignedExpGolomb(),h.skipBits(1),e=h.readUnsignedExpGolomb(),i=h.readUnsignedExpGolomb(),0===(n=h.readBits(1))&&h.skipBits(1),h.skipBits(1),h.readBoolean()&&(s=h.readUnsignedExpGolomb(),l=h.readUnsignedExpGolomb(),c=h.readUnsignedExpGolomb(),u=h.readUnsignedExpGolomb()),h.readBoolean()&&h.readBoolean()){switch(h.readUnsignedByte()){case 1:d=[1,1];break;case 2:d=[12,11];break;case 3:d=[10,11];break;case 4:d=[16,11];break;case 5:d=[40,33];break;case 6:d=[24,11];break;case 7:d=[20,11];break;case 8:d=[32,11];break;case 9:d=[80,33];break;case 10:d=[18,11];break;case 11:d=[15,11];break;case 12:d=[64,33];break;case 13:d=[160,99];break;case 14:d=[4,3];break;case 15:d=[3,2];break;case 16:d=[2,1];break;case 255:d=[h.readUnsignedByte()<<8|h.readUnsignedByte(),h.readUnsignedByte()<<8|h.readUnsignedByte()]}d&&(d[0],d[1])}return{profileIdc:p,levelIdc:m,profileCompatibility:f,width:16*(e+1)-2*s-2*l,height:(2-n)*(i+1)*16-2*c-2*u,sarRatio:d}}}).prototype=new ue;var Qe={H264Stream:lt,NalByteStream:ht},pt=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],ft={isLikelyAacData:function(e){var t=p(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:h,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5<e.length;){if(255===e[t]&&240==(246&e[t+1]))return pt[(60&e[t+2])>>>2];t++}return null},parseAacTimestamp:function(e){var t,i=10;64&e[5]&&(i+=4,i+=f(e.subarray(10,14)));do{if((t=f(e.subarray(i+4,i+8)))<1)return null;if("PRIV"===String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]))for(var n=e.subarray(i+10,i+t+10),r=0;r<n.byteLength;r++)if(0===n[r]){if("com.apple.streaming.transportStreamTimestamp"!==unescape(function(e,t,i){for(var n="",r=0;r<i;r++)n+="%"+("00"+e[r].toString(16)).slice(-2);return n}(n,0,r)))break;var a=n.subarray(r+1),o=(1&a[3])<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2;return o*=4,o+=3&a[7]}}while(i+=10,(i+=t)<e.byteLength);return null}},mt=function(){var e=new Uint8Array,t=0;mt.prototype.init.call(this),this.setTimestamp=function(e){t=e},this.push=function(i){var n,r,a=0,o=0;for(e.length?(r=e.length,(e=new Uint8Array(i.byteLength+r)).set(e.subarray(0,r)),e.set(i,r)):e=i;3<=e.length-o;)if(e[o]!=="I".charCodeAt(0)||e[o+1]!=="D".charCodeAt(0)||e[o+2]!=="3".charCodeAt(0))if(255!=(255&e[o])||240!=(240&e[o+1]))o++;else{if(e.length-o<7)break;if(o+(a=ft.parseAdtsSize(e,o))>e.length)break;n={type:"audio",data:e.subarray(o,o+a),pts:t,dts:t},this.trigger("data",n),o+=a}else{if(e.length-o<10)break;if(o+(a=ft.parseId3TagSize(e,o))>e.length)break;n={type:"timed-metadata",data:e.subarray(o,o+a)},this.trigger("data",n),o+=a}i=e.length-o,e=0<i?e.subarray(o):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}};mt.prototype=new ue;var gt,vt,yt,_t=mt,bt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],wt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],xt=Qe.H264Stream,kt=ft.isLikelyAacData,Ct=function(e,t){var i=[],n=0,r=0,a=0,o=1/0;t=t||{},Ct.prototype.init.call(this),this.push=function(t){ze(e,t),e&&bt.forEach(function(i){e[i]=t[i]}),i.push(t)},this.setEarliestDts=function(e){r=e},this.setVideoBaseMediaDecodeTime=function(e){o=e},this.setAudioAppendStart=function(e){a=e},this.flush=function(){var s,l,c,u,d;0!==i.length&&(s=Oe(i,e,r),e.baseMediaDecodeTime=je(e,t.keepOriginalTimestamps),d=Le(e,s,a,o),e.samples=Ne(s),l=pe(Pe(s)),i=[],u=fe(n,[e]),c=new Uint8Array(u.byteLength+l.byteLength),n++,c.set(u),c.set(l,u.byteLength),Re(e),u=Math.ceil(9216e4/e.samplerate),s.length&&(u=s.length*u,this.trigger("segmentTimingInfo",g(Ie(e.baseMediaDecodeTime,e.samplerate),s[0].dts,s[0].pts,s[0].dts+u,s[0].pts+u,d||0)),this.trigger("timingInfo",{start:s[0].pts,end:s[0].pts+u})),this.trigger("data",{track:e,boxes:c})),this.trigger("done","AudioSegmentStream")},this.reset=function(){Re(e),i=[],this.trigger("reset")}};Ct.prototype=new ue,(gt=function(e,t){var i,n,r=0,a=[],o=[];t=t||{},gt.prototype.init.call(this),delete e.minPTS,this.gopCache_=[],this.push=function(t){ze(e,t),"seq_parameter_set_rbsp"!==t.nalUnitType||i||(i=t.config,e.sps=[t.data],wt.forEach(function(t){e[t]=i[t]},this)),"pic_parameter_set_rbsp"!==t.nalUnitType||n||(n=t.data,e.pps=[t.data]),a.push(t)},this.flush=function(){for(var i,n,s,l=0;a.length&&"access_unit_delimiter_rbsp"!==a[0].nalUnitType;)a.shift();if(0===a.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(i=ge(a),(n=ve(i))[0][0].keyFrame||((s=this.getGopForFusion_(a[0],e))?(l=s.duration,n.unshift(s),n.byteLength+=s.byteLength,n.nalCount+=s.nalCount,n.pts=s.pts,n.dts=s.dts,n.duration+=s.duration):n=ye(n)),o.length){var c=t.alignGopsAtEnd?this.alignGopsAtEnd_(n):this.alignGopsAtStart_(n);if(!c)return this.gopCache_.unshift({gop:n.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");Re(e),n=c}ze(e,n),e.samples=_e(n),i=pe(be(n)),e.baseMediaDecodeTime=je(e,t.keepOriginalTimestamps),this.trigger("processedGopsInfo",n.map(function(e){return{pts:e.pts,dts:e.dts,byteLength:e.byteLength}})),s=n[0],c=n[n.length-1],this.trigger("segmentTimingInfo",g(e.baseMediaDecodeTime,s.dts,s.pts,c.dts+c.duration,c.pts+c.duration,l)),this.trigger("timingInfo",{start:n[0].pts,end:n[n.length-1].pts+n[n.length-1].duration}),this.gopCache_.unshift({gop:n.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.trigger("baseMediaDecodeTime",e.baseMediaDecodeTime),this.trigger("timelineStartInfo",e.timelineStartInfo),l=fe(r,[e]),n=new Uint8Array(l.byteLength+i.byteLength),r++,n.set(l),n.set(i,l.byteLength),this.trigger("data",{track:e,boxes:n}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),a=[],this.gopCache_.length=0,o.length=0,this.trigger("reset")},this.resetStream_=function(){Re(e),n=i=void 0},this.getGopForFusion_=function(t){for(var i,n,r,a=1/0,o=0;o<this.gopCache_.length;o++)n=(r=this.gopCache_[o]).gop,e.pps&&m(e.pps[0],r.pps[0])&&e.sps&&m(e.sps[0],r.sps[0])&&(n.dts<e.timelineStartInfo.dts||-1e4<=(n=t.dts-n.dts-n.duration)&&n<=45e3&&(!i||n<a)&&(i=r,a=n));return i?i.gop:null},this.alignGopsAtStart_=function(e){for(var t,i,n,r,a=e.byteLength,s=e.nalCount,l=e.duration,c=t=0;c<o.length&&t<e.length&&(i=o[c],n=e[t],i.pts!==n.pts);)n.pts>i.pts?c++:(t++,a-=n.byteLength,s-=n.nalCount,l-=n.duration);return 0===t?e:t===e.length?null:((r=e.slice(t)).byteLength=a,r.duration=l,r.nalCount=s,r.pts=r[0].pts,r.dts=r[0].dts,r)},this.alignGopsAtEnd_=function(e){for(var t,i,n=o.length-1,r=e.length-1,a=null,s=!1;0<=n&&0<=r;){if(t=o[n],i=e[r],t.pts===i.pts){s=!0;break}t.pts>i.pts?n--:(n===o.length-1&&(a=r),r--)}if(!s&&null===a)return null;if(0===(c=s?r:a))return e;var l=e.slice(c),c=l.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){o=e}}).prototype=new ue,(yt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,yt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}}).prototype=new ue,yt.prototype.flush=function(e){var t,i,n,r=0,a={captions:[],captionStreams:{},metadata:[],info:{}},o=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==e&&"AudioSegmentStream"!==e)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return void(++this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(o=this.videoTrack.timelineStartInfo.pts,wt.forEach(function(e){a.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(o=this.audioTrack.timelineStartInfo.pts,bt.forEach(function(e){a.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?a.type=this.pendingTracks[0].type:a.type="combined",this.emittedTracks+=this.pendingTracks.length,e=me(this.pendingTracks),a.initSegment=new Uint8Array(e.byteLength),a.initSegment.set(e),a.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)a.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(t=this.pendingCaptions[n]).startTime=Me(t.startPts,o,this.keepOriginalTimestamps),t.endTime=Me(t.endPts,o,this.keepOriginalTimestamps),a.captionStreams[t.stream]=!0,a.captions.push(t);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=Me(i.pts,o,this.keepOriginalTimestamps),a.metadata.push(i);for(a.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",a),n=0;n<a.captions.length;n++)t=a.captions[n],this.trigger("caption",t);for(n=0;n<a.metadata.length;n++)i=a.metadata[n],this.trigger("id3Frame",i)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},yt.prototype.setRemux=function(e){this.remuxTracks=e},(vt=function(e){var t,i,n=this,r=!0;vt.prototype.init.call(this),this.baseMediaDecodeTime=(e=e||{}).baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};(this.transmuxPipeline_=r).type="aac",r.metadataStream=new at.MetadataStream,r.aacStream=new _t,r.audioTimestampRolloverStream=new at.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new at.TimestampRolloverStream("timed-metadata"),r.adtsStream=new ut,r.coalesceStream=new yt(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(e){r.aacStream.setTimestamp(e.timeStamp)}),r.aacStream.on("data",function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ct(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var r={};(this.transmuxPipeline_=r).type="ts",r.metadataStream=new at.MetadataStream,r.packetStream=new at.TransportPacketStream,r.parseStream=new at.TransportParseStream,r.elementaryStream=new at.ElementaryStream,r.timestampRolloverStream=new at.TimestampRolloverStream,r.adtsStream=new ut,r.h264Stream=new xt,r.captionStream=new at.CaptionStream(e),r.coalesceStream=new yt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(a){var o;if("metadata"===a.type){for(o=a.tracks.length;o--;)t||"video"!==a.tracks[o].type?i||"audio"!==a.tracks[o].type||((i=a.tracks[o]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=a.tracks[o]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime
|
||
;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new gt(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))}),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ct(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e)}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,Re(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,Re(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(r){var t=kt(e);if(t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),this.transmuxPipeline_)for(var i=Object.keys(this.transmuxPipeline_),n=0;n<i.length;n++){var a=i[n];"headOfPipeline"!==a&&this.transmuxPipeline_[a].on&&this.transmuxPipeline_[a].on("log",this.getLogTrigger_(a))}r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new ue;var Tt={Transmuxer:vt,VideoSegmentStream:gt,AudioSegmentStream:Ct,AUDIO_PROPERTIES:bt,VIDEO_PROPERTIES:wt,generateSegmentTimingInfo:g},C=function(e){return e>>>0},St=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),t+=String.fromCharCode(e[2]),t+=String.fromCharCode(e[3])},Et=C,At=function e(t,i){var n,r,a,o=[];if(!i.length)return null;for(n=0;n<t.byteLength;)r=Et(t[n]<<24|t[n+1]<<16|t[n+2]<<8|t[n+3]),a=St(t.subarray(n+4,n+8)),r=1<r?n+r:t.byteLength,a===i[0]&&(1===i.length?o.push(t.subarray(n+8,r)):(a=e(t.subarray(n+8,r),i.slice(1))).length&&(o=o.concat(a))),n=r;return o},It=C,Dt=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),baseMediaDecodeTime:It(e[4]<<24|e[5]<<16|e[6]<<8|e[7])};return 1===t.version&&(t.baseMediaDecodeTime*=Math.pow(2,32),t.baseMediaDecodeTime+=It(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),t},Mt=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},Lt=function(e){var t,i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=1&i.flags[2],a=4&i.flags[2],o=1&i.flags[1],s=2&i.flags[1],l=4&i.flags[1],c=8&i.flags[1],u=n.getUint32(4),d=8;for(r&&(i.dataOffset=n.getInt32(d),d+=4),a&&u&&(t={flags:Mt(e.subarray(d,d+4))},d+=4,o&&(t.duration=n.getUint32(d),d+=4),s&&(t.size=n.getUint32(d),d+=4),c&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t),u--);u--;)t={},o&&(t.duration=n.getUint32(d),d+=4),s&&(t.size=n.getUint32(d),d+=4),l&&(t.flags=Mt(e.subarray(d,d+4)),d+=4),c&&(1===i.version?t.compositionTimeOffset=n.getInt32(d):t.compositionTimeOffset=n.getUint32(d),d+=4),i.samples.push(t);return i},Ot=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},n=1&i.flags[2],r=2&i.flags[2],a=8&i.flags[2],o=16&i.flags[2],s=32&i.flags[2],l=65536&i.flags[0],c=131072&i.flags[0],e=8;return n&&(e+=4,i.baseDataOffset=t.getUint32(12),e+=4),r&&(i.sampleDescriptionIndex=t.getUint32(e),e+=4),a&&(i.defaultSampleDuration=t.getUint32(e),e+=4),o&&(i.defaultSampleSize=t.getUint32(e),e+=4),s&&(i.defaultSampleFlags=t.getUint32(e)),l&&(i.durationIsEmpty=!0),!n&&c&&(i.baseDataOffsetIsMoof=!0),i},Nt=$e,Pt=Ke.CaptionStream,Rt=function(){var e,t,i,n,r,a,o=!1;this.isInitialized=function(){return o},this.init=function(t){e=new Pt,o=!0,a=!!t&&t.isPartial,e.on("data",function(e){e.startTime=e.startPts/n,e.endTime=e.endPts/n,r.captions.push(e),r.captionStreams[e.stream]=!0}),e.on("log",function(e){r.logs.push(e)})},this.isNewInit=function(e,t){return!(e&&0===e.length||t&&"object"==typeof t&&0===Object.keys(t).length||i===e[0]&&n===t[i])},this.parse=function(e,a,o){if(!this.isInitialized())return null;if(!a||!o)return null;if(this.isNewInit(a,o))i=a[0],n=o[i];else if(null===i||!n)return t.push(e),null;for(;0<t.length;){var s=t.shift();this.parse(s,a,o)}return(e=function(e,t,i){return null===t?null:(t=v(e,t)[t]||{},{seiNals:t.seiNals,logs:t.logs,timescale:i})}(e,i,n))&&e.logs&&(r.logs=r.logs.concat(e.logs)),null!==e&&e.seiNals?(this.pushNals(e.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],n=i=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},jt=C,zt=function(e){return("00"+e.toString(16)).slice(-2)},Qe=function(e){return At(e,["moov","trak"]).reduce(function(e,t){var i,n,r=At(t,["tkhd"])[0];return r?(i=r[0],r=jt(r[n=0===i?12:20]<<24|r[1+n]<<16|r[2+n]<<8|r[3+n]),(t=At(t,["mdia","mdhd"])[0])?(i=t[0],e[r]=jt(t[n=0===i?12:20]<<24|t[1+n]<<16|t[2+n]<<8|t[3+n]),e):null):null},{})},ue=function(e,t){var t=At(t,["moof","traf"]),t=[].concat.apply([],t.map(function(t){return At(t,["tfhd"]).map(function(i){var n=jt(i[4]<<24|i[5]<<16|i[6]<<8|i[7]),i=e[n]||9e4,n=At(t,["tfdt"]).map(function(e){var t=e[0],i=jt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]);return 1===t&&(i*=Math.pow(2,32),i+=jt(e[8]<<24|e[9]<<16|e[10]<<8|e[11])),i})[0];return(n="number"!=typeof n||isNaN(n)?1/0:n)/i})})),t=Math.min.apply(null,t);return isFinite(t)?t:0},$e=function(e,t){var i,n,r=At(t,["moof","traf"]),a=0,o=0;return r&&r.length&&(i=At(r[0],["tfhd"])[0],t=At(r[0],["trun"])[0],r=At(r[0],["tfdt"])[0],i&&(n=Ot(i).trackId),r&&(a=Dt(r).baseMediaDecodeTime),!t||(t=Lt(t)).samples&&t.samples.length&&(o=t.samples[0].compositionTimeOffset||0)),(a+o)/(e[n]||9e4)},Ft=function(e){var t=0===e[0]?12:20;return jt(e[t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])},C=function(e){var e=At(e,["moov","trak"]),t=[];return e.forEach(function(e){var i={},n=At(e,["tkhd"])[0];n&&(n=(r=new DataView(n.buffer,n.byteOffset,n.byteLength)).getUint8(0),i.id=0===n?r.getUint32(12):r.getUint32(20));var r=At(e,["mdia","hdlr"])[0];r&&(o=St(r.subarray(8,12)),i.type="vide"===o?"video":"soun"===o?"audio":o);var a,o=At(e,["mdia","minf","stbl","stsd"])[0];o&&(o=o.subarray(8),i.codec=St(o.subarray(4,8)),(o=At(o,[i.codec])[0])&&(/^[a-z]vc[1-9]$/i.test(i.codec)?(a=o.subarray(78),"avcC"===St(a.subarray(4,8))&&11<a.length?(i.codec+=".",i.codec+=zt(a[9]),i.codec+=zt(a[10]),i.codec+=zt(a[11])):i.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(i.codec)?(a=o.subarray(28),"esds"===St(a.subarray(4,8))&&20<a.length&&0!==a[19]?(i.codec+="."+zt(a[19]),i.codec+="."+zt(a[20]>>>2&63).replace(/^0/,"")):i.codec="mp4a.40.2"):i.codec=i.codec.toLowerCase())),e=At(e,["mdia","mdhd"])[0],e&&(i.timescale=Ft(e)),t.push(i)}),t},Bt=ue,Ut=C,$t=qe,qt={};qt.ts={parseType:function(e,t){return e=y(e),0===e?"pat":e===t?"pmt":t?"pes":null},parsePat:function(e){var t=_(e),i=4+b(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=_(e),n=4+b(e);if(i&&(n+=e[n]+1),1&e[n+5]){for(var r=3+((15&e[n+1])<<8|e[n+2])-4,a=12+((15&e[n+10])<<8|e[n+11]);a<r;){var o=n+a;t[(31&e[o+1])<<8|e[o+2]]=e[o],a+=5+((15&e[o+3])<<8|e[o+4])}return t}},parsePayloadUnitStartIndicator:_,parsePesType:function(e,t){switch(t[y(e)]){case Xe.H264_STREAM_TYPE:return"video";case Xe.ADTS_STREAM_TYPE:return"audio";case Xe.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(e){if(!_(e))return null;var t=4+b(e);if(t>=e.byteLength)return null;var i=null,n=e[t+7];return 192&n&&((i={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,i.pts*=4,i.pts+=(6&e[t+13])>>>1,i.dts=i.pts,64&n&&(i.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,i.dts*=4,i.dts+=(6&e[t+18])>>>1)),i},videoPacketContainsKeyFrame:function(e){for(var t=4+b(e),i=e.subarray(t),n=0,r=0,a=!1;r<i.byteLength-3;r++)if(1===i[r+2]){n=r+5;break}for(;n<i.byteLength;)switch(i[n]){case 0:if(0!==i[n-1]){n+=2;break}if(0!==i[n-2]){n++;break}for(r+3!==n-2&&"slice_layer_without_partitioning_rbsp_idr"===w(31&i[r+3])&&(a=!0);1!==i[++n]&&n<i.length;);r=n-2,n+=3;break;case 1:if(0!==i[n-1]||0!==i[n-2]){n+=3;break}"slice_layer_without_partitioning_rbsp_idr"===w(31&i[r+3])&&(a=!0),r=n-2,n+=3;break;default:n+=3}return i=i.subarray(r),n-=r,r=0,a=!!(i&&3<i.byteLength&&"slice_layer_without_partitioning_rbsp_idr"===w(31&i[r+3]))||a}},qt.aac=ft;var Ht=function(e,t){var i,n,r=(qt.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,a=null,o=0,s=0;3<=e.length-s;){switch(qt.aac.parseType(e,s)){case"timed-metadata":if(e.length-s<10){i=!0;break}if((o=qt.aac.parseId3TagSize(e,s))>e.length){i=!0;break}null===a&&(t=e.subarray(s,s+o),a=qt.aac.parseAacTimestamp(t)),s+=o;break;case"audio":if(e.length-s<7){i=!0;break}if((o=qt.aac.parseAdtsSize(e,s))>e.length){i=!0;break}null===r&&(t=e.subarray(s,s+o),r=qt.aac.parseSampleRate(t)),n++,s+=o;break;default:s++}if(i)return null}if(null===r||null===a)return null;var l=9e4/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*l,pts:a+1024*n*l}]}}:k)(e);return r&&(r.audio||r.video)?(e=t,(t=r).audio&&t.audio.length&&(void 0!==(i=e)&&!isNaN(i)||(i=t.audio[0].dts),t.audio.forEach(function(e){e.dts=$t(e.dts,i),e.pts=$t(e.pts,i),e.dtsTime=e.dts/9e4,e.ptsTime=e.pts/9e4})),t.video&&t.video.length&&(void 0!==(n=e)&&!isNaN(n)||(n=t.video[0].dts),t.video.forEach(function(e){e.dts=$t(e.dts,n),e.pts=$t(e.pts,n),e.dtsTime=e.dts/9e4,e.ptsTime=e.pts/9e4}),t.firstKeyFrame&&((t=t.firstKeyFrame).dts=$t(t.dts,n),t.pts=$t(t.pts,n),t.dtsTime=t.dts/9e4,t.ptsTime=t.pts/9e4)),r):null},Wt=function(){function e(e,t){this.options=t||{},this.self=e,this.init()}var t=e.prototype;return t.init=function(){var e,t;this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Tt.Transmuxer(this.options),e=this.self,(t=this.transmuxer).on("data",function(t){var i=t.initSegment;t.initSegment={data:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength},i=t.data,t.data=i.buffer,e.postMessage({action:"data",segment:t,byteOffset:i.byteOffset,byteLength:i.byteLength},[t.data])}),t.on("done",function(t){e.postMessage({action:"done"})}),t.on("gopInfo",function(t){e.postMessage({action:"gopInfo",gopInfo:t})}),t.on("videoSegmentTimingInfo",function(t){var i={start:{decode:Ae(t.start.dts),presentation:Ae(t.start.pts)},end:{decode:Ae(t.end.dts),presentation:Ae(t.end.pts)},baseMediaDecodeTime:Ae(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=Ae(t.prependedContentDuration)),e.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})}),t.on("audioSegmentTimingInfo",function(t){var i={start:{decode:Ae(t.start.dts),presentation:Ae(t.start.pts)},end:{decode:Ae(t.end.dts),presentation:Ae(t.end.pts)},baseMediaDecodeTime:Ae(t.baseMediaDecodeTime)};t.prependedContentDuration&&(i.prependedContentDuration=Ae(t.prependedContentDuration)),e.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:i})}),t.on("id3Frame",function(t){e.postMessage({action:"id3Frame",id3Frame:t})}),t.on("caption",function(t){e.postMessage({action:"caption",caption:t})}),t.on("trackinfo",function(t){e.postMessage({action:"trackinfo",trackInfo:t})}),t.on("audioTimingInfo",function(t){e.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:Ae(t.start),end:Ae(t.end)}})}),t.on("videoTimingInfo",function(t){e.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:Ae(t.start),end:Ae(t.end)}})}),t.on("log",function(t){e.postMessage({action:"log",log:t})})},t.pushMp4Captions=function(e){this.captionParser||(this.captionParser=new Rt,this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),e=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:e&&e.captions||[],logs:e&&e.logs||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t=e.timescales,e=e.data,t=Bt(t,e);this.self.postMessage({action:"probeMp4StartTime",startTime:t,data:e},[e.buffer])},t.probeMp4Tracks=function(e){var t=e.data,e=Ut(t);this.self.postMessage({action:"probeMp4Tracks",tracks:e,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,e="number"!=typeof i||isNaN(i)?void 0:9e4*i,i=Ht(t,e),e=null;i&&((e={hasVideo:i.video&&2===i.video.length||!1,hasAudio:i.audio&&2===i.audio.length||!1}).hasVideo&&(e.videoStart=i.video[0].ptsTime),e.hasAudio&&(e.audioStart=i.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:e,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){e=new Uint8Array(e.data,e.byteOffset,e.byteLength),this.transmuxer.push(e)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){e=e.timestampOffset||0,this.transmuxer.setBaseMediaDecodeTime(Math.round(Ee(e)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(Ee(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Wt(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Wt(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))),ac=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():sr(e.currentTransmux))},oc=function(e){cr("reset",e)},sc=function(e){var t=new rc;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t},lc=2,cc=-101,uc=-102,dc=hn("CodecUtils"),hc=hn("PlaylistSelector"),Ao=function(){var e=this.useDevicePixelRatio&&la.devicePixelRatio||1;return Mr(this.playlists.master,this.systemBandwidth,parseInt(Ar(this.tech_.el(),"width"),10)*e,parseInt(Ar(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},pc=function(e){function t(t,i){var n=e.call(this)||this;if(!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=11<=mt.browser.IE_VERSION,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1)}),n.fetchAtBuffer_=!1,n.logger_=hn("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(uo(n),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n}ho(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return sc({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_})},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&la.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},i.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},i.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,la.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},i.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&oc(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return mt.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo,e=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!e)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Qn(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Zn(e),n=this.keyCache_[i];return this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes}),e={resolvedUri:(n||e).resolvedUri},n&&(e.bytes=n.bytes),e},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},i.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&this.resyncLoader(),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");t=e.mediaSequence-i.mediaSequence,this.logger_("live window shift ["+t+"]"),null!==this.mediaIndex&&(this.mediaIndex-=t,this.mediaIndex<0?(this.mediaIndex=null,this.partIndex=null):(r=this.playlist_.segments[this.mediaIndex],!this.partIndex||r.parts&&r.parts.length&&r.parts[this.partIndex]||(r=this.mediaIndex,this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=r))),n&&(n.mediaIndex-=t,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(0<=n.mediaIndex&&(n.segment=e.segments[n.mediaIndex]),0<=n.partIndex&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}},i.pause=function(){this.checkBufferTimeout_&&(la.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},i.paused=function(){return null===this.checkBufferTimeout_},i.resetEverything=function(e){this.ended_=!1,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"})},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},i.resyncLoader=function(){this.transmuxer_&&oc(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},i.remove=function(e,t,i,n){if(void 0===i&&(i=function(){}),void 0===n&&(n=!1),(t=t===1/0?this.duration_():t)<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var r,a=1,o=function(){0==--a&&i()};for(r in!n&&this.audioDisabled_||(a++,this.sourceUpdater_.removeAudio(e,t,o)),!n&&"main"!==this.loaderType_||(this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil(9e4*(t-n)),a=Math.ceil(9e4*(i-n)),n=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return n;for(var s=o+1;s--&&!(e[s].pts<=r););return s=Math.max(s,0),n.splice(s,o-s+1),n}(this.gopBuffer_,e,t,this.timeMapping_),a++,this.sourceUpdater_.removeVideo(e,t,o)),this.inbandTextTracks_)Or(e,t,this.inbandTextTracks_[r]);Or(e,t,this.segmentMetadataTrack_),o()}else this.logger_("skipping remove because no source updater or starting media info")},i.monitorBuffer_=function(){this.checkBufferTimeout_&&la.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=la.setTimeout(this.monitorBufferTick_.bind(this),1)},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&la.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=la.setTimeout(this.monitorBufferTick_.bind(this),500)},i.fillBuffer_=function(){var e;this.sourceUpdater_.updating()||(e=this.chooseNextRequest_())&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"==typeof e&&t.segments[e],e=e+1===t.segments.length,n=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&e&&n},i.chooseNextRequest_=function(){var e=yn(this.buffered_())||0,t=Math.max(0,e-this.currentTime_()),i=!this.hasPlayed_()&&1<=t,n=t>=this.goalBufferLength_(),r=this.playlist_.segments;if(!r.length||i||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()),t={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)},t.isSyncRequest?t.mediaIndex=function(e,t,i){t=t||[];for(var n=[],r=0,a=0;a<t.length;a++){var o=t[a];if(e===o.timeline&&(n.push(a),i<(r+=o.duration)))return a}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,r,e):null!==this.mediaIndex?(i=r[this.mediaIndex],n="number"==typeof this.partIndex?this.partIndex:-1,t.startOfSegment=i.end||e,i.parts&&i.parts[n+1]?(t.mediaIndex=this.mediaIndex,t.partIndex=n+1):t.mediaIndex=this.mediaIndex+1):(e=(o=Kl.getMediaInfoForTime({playlist:this.playlist_,currentTime:this.fetchAtBuffer_?e:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time})).segmentIndex,a=o.startTime,o=o.partIndex,t.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd":"currentTime",t.mediaIndex=e,t.startOfSegment=a,t.partIndex=o);var a=r[t.mediaIndex],o=a&&"number"==typeof t.partIndex&&a.parts&&a.parts[t.partIndex];return!a||"number"==typeof t.partIndex&&!o?null:("number"!=typeof t.partIndex&&a.parts&&(t.partIndex=0),a=this.mediaSource_&&"ended"===this.mediaSource_.readyState,t.mediaIndex>=r.length-1&&a&&!this.seeking_()?null:this.generateSegmentInfo_(t))},i.generateSegmentInfo_=function(e){var t=e.playlist,i=e.mediaIndex,n=e.startOfSegment,r=e.isSyncRequest,a=e.partIndex,o=e.forceTimestampOffset,s=e.getMediaInfoForTime,l=t.segments[i],e="number"==typeof a&&l.parts[a],s={requestId:"segment-loader-"+Math.random(),uri:e&&e.resolvedUri||l.resolvedUri,mediaIndex:i,partIndex:e?a:null,isSyncRequest:r,startOfSegment:n,playlist:t,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:e&&e.duration||l.duration,segment:l,part:e,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:s},o=void 0!==o?o:this.isPendingTimestampOffset_;return s.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:o}),o=yn(this.sourceUpdater_.audioBuffered()),"number"==typeof o&&(s.audioAppendStart=o-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(s.gopsToAlignWith=function(e,t,i){if(void 0===t||null===t||!e.length)return[];for(var n=Math.ceil(9e4*(t-i+3)),r=0;r<e.length&&!(e[r].pts>n);r++);return e.slice(r)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),s},i.timestampOffsetForSegment_=function(e){return i=(t=e).segmentTimeline,n=t.currentTimeline,r=t.startOfSegment,e=t.buffered,t.overrideCheck||i!==n?i<n||!e.length?r:e.end(e.length-1):null;var t,i,n,r},i.earlyAbortWhenNeeded_=function(e){var t,i,n,r,a,o,s,l,c,u,d,h,p;!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3||(t=this.currentTime_(),r=e.bandwidth,a=this.pendingSegment_.duration,p=Kl.estimateSegmentRequestTime(a,r,this.playlist_,e.bytesReceived),i=this.buffered_(),n=t,void 0===(e=this.vhs_.tech_.playbackRate())&&(e=1),p<=(e=((i.length?i.end(i.length-1):0)-n)/e-1)||(r={master:this.vhs_.playlists.master,currentTime:t,bandwidth:r,duration:this.duration_(),segmentDuration:a,timeUntilRebuffer:e,currentTimeline:this.currentTimeline_,syncController:this.syncController_},a=r.master,o=r.currentTime,s=r.bandwidth,l=r.duration,c=r.segmentDuration,u=r.timeUntilRebuffer,d=r.currentTimeline,h=r.syncController,a=(r=(a=(a=(r=a.playlists.filter(function(e){return!Kl.isIncompatible(e)})).filter(Kl.isEnabled)).length?a:r.filter(function(e){return!Kl.isDisabled(e)})).filter(Kl.hasAttribute.bind(null,"BANDWIDTH")).map(function(e){var t=h.getSyncPoint(e,l,d,o)?1:2;return{playlist:e,rebufferingImpact:Kl.estimateSegmentRequestTime(c,s,e)*t-u}})).filter(function(e){return e.rebufferingImpact<=0}),Ir(a,function(e,t){return Dr(t.playlist,e.playlist)}),(r=a.length?a[0]:(Ir(r,function(e,t){return e.rebufferingImpact-t.rebufferingImpact}),r[0]||null))&&(p=p-e-r.rebufferingImpact,!r.playlist||r.playlist.uri===this.playlist_.uri||p<(e<=Gl?1:.5)||(this.bandwidth=r.playlist.attributes.BANDWIDTH*nc.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))))))},i.handleAbort_=function(e){this.logger_("Aborting "+Pr(e)),this.mediaRequestsAborted+=1},i.handleProgress_=function(e,t){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.trigger("progress")},i.handleTrackInfo_=function(e,t){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.checkForIllegalMediaSwitch(t)||(function(e,t){
|
||
if(!e&&!t||!e&&t||e&&!t)return!1;if(e===t)return!0;var i=Object.keys(e).sort(),n=Object.keys(t).sort();if(i.length!==n.length)return!1;for(var r=0;r<i.length;r++){var a=i[r];if(a!==n[r])return!1;if(e[a]!==t[a])return!1}return!0}(this.currentMediaInfo_,t=t||{})||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),this.checkForAbort_(e.requestId)||(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))},i.handleTimingInfo_=function(e,t,i,n){var r;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||((r=this.pendingSegment_)[e=Rr(t)]=r[e]||{},r[e][i]=n,this.logger_("timinginfo: "+t+" - "+i+" - "+n),this.hasEnoughInfoToAppend_()&&this.processCallQueue_())},i.handleCaptions_=function(e,t){var i,n,r=this;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(0!==t.length?this.pendingSegment_.hasAppendedData_?(i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),n={},t.forEach(function(e){n[e.stream]=n[e.stream]||{startTime:1/0,captions:[],endTime:0};var t=n[e.stream];t.startTime=Math.min(t.startTime,e.startTime+i),t.endTime=Math.max(t.endTime,e.endTime+i),t.captions.push(e)}),Object.keys(n).forEach(function(e){var t,a,o,s,l,c,u,d,h,p,f=n[e],m=f.startTime,g=f.endTime,v=f.captions,y=r.inbandTextTracks_;r.logger_("adding cues from "+m+" -> "+g+" for "+e),t=y,a=r.vhs_.tech_,t[o=e]||(a.trigger({type:"usage",name:"vhs-608"}),a.trigger({type:"usage",name:"hls-608"}),/^cc708_/.test(s=o)&&(s="SERVICE"+o.split("_")[1]),(u=a.textTracks().getTrackById(s))?t[o]=u:(c=l=o,f=!1,(u=(a.options_.vhs&&a.options_.vhs.captionServices||{})[s])&&(l=u.label,c=u.language,f=u.default),t[o]=a.addRemoteTextTrack({kind:"captions",id:s,default:f,label:l,language:c},!1).track)),Or(m,g,y[e]),h=(v={captionArray:v,inbandTextTracks:y,timestampOffset:i}).inbandTextTracks,y=v.captionArray,p=v.timestampOffset,y&&(d=la.WebKitDataCue||la.VTTCue,y.forEach(function(e){var t=e.stream;h[t].addCue(new d(e.startTime+p,e.endTime+p,e.text))}))}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})):this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t)):this.logger_("SegmentLoader received no captions from a caption event"))},i.handleId3_=function(e,t,i){var n,r,a,o;this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||(this.pendingSegment_.hasAppendedData_?(n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),r=this.inbandTextTracks_,a=i,o=this.vhs_.tech_,r.metadataTrack_||(r.metadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,r.metadataTrack_.inBandMetadataTrackDispatchType=a),Lr({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:this.duration_()})):this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i)))},i.processMetadataQueue_=function(){this.metadataQueue_.id3.forEach(function(e){return e()}),this.metadataQueue_.caption.forEach(function(e){return e()}),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]},i.processCallQueue_=function(){var e=this.callQueue_;this.callQueue_=[],e.forEach(function(e){return e()})},i.processLoadQueue_=function(){var e=this.loadQueue_;this.loadQueue_=[],e.forEach(function(e){return e()})},i.hasEnoughInfoToLoad_=function(){if("audio"!==this.loaderType_)return!0;var e=this.pendingSegment_;return!(!e||this.getCurrentMediaInfo_()&&jr({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.getCurrentMediaInfo_=function(e){return(e=void 0===e?this.pendingSegment_:e)&&e.trackInfo||this.currentMediaInfo_},i.getMediaInfo_=function(e){return void 0===e&&(e=this.pendingSegment_),this.getCurrentMediaInfo_(e)||this.startingMediaInfo_},i.hasEnoughInfoToAppend_=function(){if(!this.sourceUpdater_.ready())return!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;var e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;var i=t.hasAudio,n=t.hasVideo,t=t.isMuxed;return!(n&&!e.videoTimingInfo||i&&!this.audioDisabled_&&!t&&!e.audioTimingInfo||jr({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))},i.handleData_=function(e,t){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(!this.callQueue_.length&&this.hasEnoughInfoToAppend_()){var i,n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.segment),"closed"!==this.mediaSource_.readyState){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4?(this.trigger("fmp4"),n.timingInfo.start=n[Rr(t.type)].start):(i=this.getCurrentMediaInfo_(),(i="main"===this.loaderType_&&i&&i.hasVideo)&&(r=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:i,firstVideoFrameTimeForData:r,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})),this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:"main"===this.loaderType_});var r=this.chooseNextRequest_();if(r.mediaIndex!==n.mediaIndex||r.partIndex!==n.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}else this.callQueue_.push(this.handleData_.bind(this,e,t))},i.updateAppendInitSegmentStatus=function(e,t){"main"!==this.loaderType_||"number"!=typeof e.timestampOffset||e.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)},i.getInitSegmentAndUpdateState_=function(e){var t=e.type,i=e.initSegment,n=e.map,r=e.playlist;if(n){if(e=Qn(n),this.activeInitSegmentId_===e)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=e}return i&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=r,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,i):null},i.handleQuotaExceededError_=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes,o=this.sourceUpdater_.audioBuffered(),s=this.sourceUpdater_.videoBuffered();1<o.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+vn(o).join(", ")),1<s.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+vn(s).join(", "));var l=o.length?o.start(0):0,c=o.length?o.end(o.length-1):0,u=s.length?s.start(0):0,e=s.length?s.end(s.length-1):0;if(c-l<=1&&e-u<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+vn(o).join(", ")+", video buffer: "+vn(s).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:a})),a=this.currentTime_()-1,this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+a),this.remove(0,a,function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=la.setTimeout(function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_()},1e3)},!0)},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,e=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+e.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:e}))},i.appendToSourceBuffer_=function(e){var t,i,n=e.segmentInfo,r=e.type,a=e.initSegment,o=e.data,s=e.bytes;s||(e=[o],o=o.byteLength,a&&(e.unshift(a),o+=a.byteLength),i=0,(e={bytes:o,segments:e}).bytes&&(t=new Uint8Array(e.bytes),e.segments.forEach(function(e){t.set(e,i),i+=e.byteLength})),s=t),this.sourceUpdater_.appendBuffer({segmentInfo:n,type:r,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:n,type:r,bytes:s}))},i.handleSegmentTimingInfo_=function(e,t,i){this.pendingSegment_&&t===this.pendingSegment_.requestId&&((t=this.pendingSegment_.segment)[e+="TimingInfo"]||(t[e]={}),t[e].transmuxerPrependedSeconds=i.prependedContentDuration||0,t[e].transmuxedPresentationStart=i.start.presentation,t[e].transmuxedDecodeStart=i.start.decode,t[e].transmuxedPresentationEnd=i.end.presentation,t[e].transmuxedDecodeEnd=i.end.decode,t[e].baseMediaDecodeTime=i.baseMediaDecodeTime)},i.appendData_=function(e,t){var i=t.type,n=t.data;n&&n.byteLength&&("audio"===i&&this.audioDisabled_||(t=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null}),this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:t,data:n})))},i.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var i=xa({},e,{forceTimestampOffset:!0});xa(e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)})},i.updateTransmuxerAndRequestSegment_=function(e){var t=this;this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&0<e.timeline,a=n||r&&a;this.logger_("Requesting "+Pr(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=xr({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(i){var n=i.message,r=i.level,i=i.stream;t.logger_(Pr(e)+" logged from transmuxer stream "+i+" as a "+r+": "+n)}})},i.trimBackBuffer_=function(e){var t,i,n,r,r=(t=this.seekable_(),i=this.currentTime_(),n=this.playlist_.targetDuration||10,r=i-nc.BACK_BUFFER_LENGTH,t.length&&(r=Math.max(r,t.start(0))),Math.min(i-n,r));0<r&&this.remove(0,r)},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={resolvedUri:(i||t).resolvedUri,byterange:(i||t).byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},i=e.playlist.segments[e.mediaIndex-1];return i&&i.timeline===t.timeline&&(i.videoTimingInfo?n.baseStartTime=i.videoTimingInfo.transmuxedDecodeEnd:i.audioTimingInfo&&(n.baseStartTime=i.audioTimingInfo.transmuxedDecodeEnd)),t.key&&(e=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]),n.key=this.segmentKey(t.key),n.key.iv=e),t.map&&(n.map=this.initSegmentForMap(t.map)),n},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},i.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<1/60?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)},i.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},i.segmentRequestFinished_=function(e,t,i){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e)return this.pendingSegment_=null,this.state="READY",e.code===uc?void 0:(this.pause(),e.code===cc?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error")));e=this.pendingSegment_,this.saveBandwidthRelatedStats_(e.duration,t.stats),e.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r<e.length&&!(e[r].pts>=n);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(e)}},i.setTimeMapping_=function(e){null!==(e=this.syncController_.mappingForTimeline(e))&&(this.timeMapping_=e)},i.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},i.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},i.trueSegmentStart_=function(e){var t=e.currentStart,i=e.playlist,n=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,o=e.useVideoTimingInfo,s=e.videoTimingInfo,e=e.audioTimingInfo;return void 0!==t?t:o?(i=i.segments[n-1],0!==n&&i&&void 0!==i.start&&i.end===r+a?s.start:r):e.start},i.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var i=t.hasAudio,n=t.hasVideo,t=t.isMuxed,n="main"===this.loaderType_&&n,t=!this.audioDisabled_&&i&&!t;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);n&&e.waitingOnAppends++,t&&e.waitingOnAppends++,n&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),t&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},i.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||0===--e.waitingOnAppends&&this.handleAppendsDone_()},i.checkForIllegalMediaSwitch=function(e){var t,i,e=(t=this.loaderType_,i=this.getCurrentMediaInfo_(),e=e,"main"===t&&i&&e?e.hasAudio||e.hasVideo?i.hasVideo&&!e.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!i.hasVideo&&e.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null);return!!e&&(this.error({message:e,blacklistDuration:1/0}),this.trigger("error"),!0)},i.updateSourceBufferTimestampOffset_=function(e){var t;null===e.timestampOffset||"number"!=typeof e.timingInfo.start||e.changedTimestampOffset||"main"!==this.loaderType_||(t=!1,e.timestampOffset-=e.timingInfo.start,e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset"))},i.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),t="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;t&&(e.timingInfo.end="number"==typeof t.end?t.end:t.start+e.duration)},i.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=Fr(e,this.sourceType_);t&&("warn"===t.severity?mt.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",!e.isSyncRequest||(this.trigger("syncinfoupdate"),e.hasAppendedData_)?(this.logger_("Appended "+Pr(e)),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate"),(t=e.segment).end&&this.currentTime_()-t.end>3*e.playlist.targetDuration?this.resetEverything():(null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_())):this.logger_("Throwing away un-appended sync request "+Pr(e))},i.recordThroughput_=function(e){var t,i;e.duration<1/60?this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60):(t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,i=Math.floor(e.byteLength/i*8*1e3),this.throughput.rate+=(i-t)/++this.throughput.count)},i.addSegmentMetadataCue_=function(e){var t,i,n,r;this.segmentMetadataTrack_&&(i=(t=e.segment).start,r=t.end,Nr(i)&&Nr(r)&&(Or(i,r,this.segmentMetadataTrack_),n=la.WebKitDataCue||la.VTTCue,e={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:r},(r=new n(i,r,JSON.stringify(e))).value=e,this.segmentMetadataTrack_.addCue(r)))},t}(mt.EventTarget),fc=["video","audio"],mc=function(e,t,i){return function(n,r){var a=r[n+"Buffer"];if(Wr(r.mediaSource,a)){r.logger_("Appending segment "+t.mediaIndex+"'s "+e.length+" bytes to "+n+"Buffer");try{a.appendBuffer(e)}catch(a){r.logger_("Error with code "+a.code+" "+(22===a.code?"(QUOTA_EXCEEDED_ERR) ":"")+"when appending segment "+t.mediaIndex+" to "+n+"Buffer"),r.queuePending[n]=null,i(a)}}}},gc=function(e,t){return function(i,n){var r=n[i+"Buffer"];if(Wr(n.mediaSource,r)){n.logger_("Removing "+e+" to "+t+" from "+i+"Buffer");try{r.remove(e,t)}catch(r){n.logger_("Remove "+e+" to "+t+" from "+i+"Buffer failed")}}}},vc=function(e){return function(t,i){var n=i[t+"Buffer"];Wr(i.mediaSource,n)&&(i.logger_("Setting "+t+"timestampOffset to "+e),n.timestampOffset=e)}},yc=function(e){return function(t,i){e()}},_c=function(e){return function(t){if("open"===t.mediaSource.readyState){t.logger_("Calling mediaSource endOfStream("+(e||"")+")");try{t.mediaSource.endOfStream(e)}catch(t){mt.log.warn("Failed to call media source endOfStream",t)}}}},bc=function(e){return function(t){t.logger_("Setting mediaSource duration to "+e);try{t.mediaSource.duration=e}catch(t){mt.log.warn("Failed to set media source duration",t)}}},wc=function(){return function(e,t){if("open"===t.mediaSource.readyState){var i=t[e+"Buffer"];if(Wr(t.mediaSource,i)){t.logger_("calling abort on "+e+"Buffer");try{i.abort()}catch(t){mt.log.warn("Failed to abort on "+e+"Buffer",t)}}}}},xc=function(e,t){return function(i){var n=Ur(e),r=Tt(t);i.logger_("Adding "+e+"Buffer with codec "+t+" to mediaSource"),r=i.mediaSource.addSourceBuffer(r),r.addEventListener("updateend",i["on"+n+"UpdateEnd_"]),r.addEventListener("error",i["on"+n+"Error_"]),i.codecs[e]=t,i[e+"Buffer"]=r}},kc=function(e){return function(t){var i=t[e+"Buffer"];if(Hr(e,t),Wr(t.mediaSource,i)){t.logger_("Removing "+e+"Buffer with codec "+t.codecs[e]+" from mediaSource");try{t.mediaSource.removeSourceBuffer(i)}catch(t){mt.log.warn("Failed to removeSourceBuffer "+e+"Buffer",t)}}}},Cc=function(e){return function(t,i){var n=i[t+"Buffer"],r=Tt(e);Wr(i.mediaSource,n)&&i.codecs[t]!==e&&(i.logger_("changing "+t+"Buffer codec from "+i.codecs[t]+" to "+e),n.changeType(r),i.codecs[t]=e)}},Tc=function(e){function t(t){var i=e.call(this)||this;return i.mediaSource=t,i.sourceopenListener_=function(){return qr("mediaSource",uo(i))},i.mediaSource.addEventListener("sourceopen",i.sourceopenListener_),i.logger_=hn("SourceUpdater"),i.audioTimestampOffset_=0,i.videoTimestampOffset_=0,i.queue=[],i.queuePending={audio:null,video:null},i.delayedAudioAppendQueue_=[],i.videoAppendQueued_=!1,i.codecs={},i.onVideoUpdateEnd_=Gr("video",uo(i)),i.onAudioUpdateEnd_=Gr("audio",uo(i)),i.onVideoError_=function(e){i.videoError_=e},i.onAudioError_=function(e){i.audioError_=e},i.createdSourceBuffers_=!1,i.initializedEme_=!1,i.triggeredReady_=!1,i}ho(t,e);var i=t.prototype;return i.initializedEme=function(){this.initializedEme_=!0,this.triggerReady()},i.hasCreatedSourceBuffers=function(){return this.createdSourceBuffers_},i.hasInitializedAnyEme=function(){return this.initializedEme_},i.ready=function(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()},i.createSourceBuffers=function(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())},i.triggerReady=function(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))},i.addSourceBuffer=function(e,t){Vr({type:"mediaSource",sourceUpdater:this,action:xc(e,t),name:"addSourceBuffer"})},i.abort=function(e){Vr({type:e,sourceUpdater:this,action:wc(),name:"abort"})},i.removeSourceBuffer=function(e){this.canRemoveSourceBuffer()?Vr({type:"mediaSource",sourceUpdater:this,action:kc(e),name:"removeSourceBuffer"}):mt.log.error("removeSourceBuffer is not supported!")},i.canRemoveSourceBuffer=function(){return!mt.browser.IE_VERSION&&!mt.browser.IS_FIREFOX&&la.MediaSource&&la.MediaSource.prototype&&"function"==typeof la.MediaSource.prototype.removeSourceBuffer},t.canChangeType=function(){return la.SourceBuffer&&la.SourceBuffer.prototype&&"function"==typeof la.SourceBuffer.prototype.changeType},i.canChangeType=function(){return this.constructor.canChangeType()},i.changeType=function(e,t){this.canChangeType()?Vr({type:e,sourceUpdater:this,action:Cc(t),name:"changeType"}):mt.log.error("changeType is not supported!")},i.addOrChangeSourceBuffers=function(e){var t=this;if(!e||"object"!=typeof e||0===Object.keys(e).length)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(function(i){var n=e[i];if(!t.hasCreatedSourceBuffers())return t.addSourceBuffer(i,n);t.canChangeType()&&t.changeType(i,n)})},i.appendBuffer=function(e,t){var i=this,n=e.segmentInfo,r=e.type,a=e.bytes;if(this.processedAppend_=!0,"audio"===r&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([e,t]),void this.logger_("delayed audio append of "+a.length+" until video append");Vr({type:r,sourceUpdater:this,action:mc(a,n||{mediaIndex:-1},t),doneFn:t,name:"appendBuffer"}),"video"===r&&(this.videoAppendQueued_=!0,this.delayedAudioAppendQueue_.length&&(r=this.delayedAudioAppendQueue_.slice(),this.logger_("queuing delayed audio "+r.length+" appendBuffers"),this.delayedAudioAppendQueue_.length=0,r.forEach(function(e){i.appendBuffer.apply(i,e)})))},i.audioBuffered=function(){return Wr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered||mt.createTimeRange()},i.videoBuffered=function(){return Wr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered||mt.createTimeRange()},i.buffered=function(){var e=Wr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=Wr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():function(e,t){var i=null,n=null,r=0,a=[],o=[];if(!(e&&e.length&&t&&t.length))return mt.createTimeRange();for(var s=e.length;s--;)a.push({time:e.start(s),type:"start"}),a.push({time:e.end(s),type:"end"});for(s=t.length;s--;)a.push({time:t.start(s),type:"start"}),a.push({time:t.end(s),type:"end"});for(a.sort(function(e,t){return e.time-t.time}),s=0;s<a.length;s++)"start"===a[s].type?2==++r&&(i=a[s].time):"end"===a[s].type&&1==--r&&(n=a[s].time),null!==i&&null!==n&&(o.push([i,n]),n=i=null);return mt.createTimeRanges(o)}(this.audioBuffered(),this.videoBuffered())},i.setDuration=function(e,t){void 0===t&&(t=Br),Vr({type:"mediaSource",sourceUpdater:this,action:bc(e),name:"duration",doneFn:t})},i.endOfStream=function(e,t){void 0===t&&(t=Br),Vr({type:"mediaSource",sourceUpdater:this,action:_c(e="string"!=typeof(e=void 0===e?null:e)?void 0:e),name:"endOfStream",doneFn:t})},i.removeAudio=function(e,t,i){void 0===i&&(i=Br),this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Vr({type:"audio",sourceUpdater:this,action:gc(e,t),doneFn:i,name:"remove"}):i()},i.removeVideo=function(e,t,i){void 0===i&&(i=Br),this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Vr({type:"video",sourceUpdater:this,action:gc(e,t),doneFn:i,name:"remove"}):i()},i.updating=function(){return!(!$r("audio",this)&&!$r("video",this))},i.audioTimestampOffset=function(e){return void 0!==e&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Vr({type:"audio",sourceUpdater:this,action:vc(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_},i.videoTimestampOffset=function(e){return void 0!==e&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Vr({type:"video",sourceUpdater:this,action:vc(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_},i.audioQueueCallback=function(e){this.audioBuffer&&Vr({type:"audio",sourceUpdater:this,action:yc(e),name:"callback"})},i.videoQueueCallback=function(e){this.videoBuffer&&Vr({type:"video",sourceUpdater:this,action:yc(e),name:"callback"})},i.dispose=function(){var e=this;this.trigger("dispose"),fc.forEach(function(t){e.abort(t),e.canRemoveSourceBuffer()?e.removeSourceBuffer(t):e[t+"QueueCallback"](function(){return Hr(t,e)})}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()},t}(mt.EventTarget),Sc=new Uint8Array("\n\n".split("").map(function(e){return e.charCodeAt(0)})),Ec=function(e){function t(t,i){return(i=e.call(this,t,i=void 0===i?{}:i)||this).mediaSource_=null,i.subtitlesTrack_=null,i.loaderType_="subtitle",i.featuresNativeTextTracks_=t.featuresNativeTextTracks,i.shouldSaveSegmentTimingInfo_=!1,i}ho(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return null},i.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return mt.createTimeRanges();var e=this.subtitlesTrack_.cues,t=e[0].startTime,e=e[e.length-1].startTime;return mt.createTimeRanges([[t,e]])},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Qn(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(t=Sc.byteLength+e.bytes.byteLength,(t=new Uint8Array(t)).set(e.bytes),t.set(Sc,e.bytes.byteLength),this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:t}),n||e},i.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.track=function(e){return void 0===e||(this.subtitlesTrack_=e,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_},i.remove=function(e,t){Or(e,t,this.subtitlesTrack_)},i.fillBuffer_=function(){var e=this,t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline))return this.syncController_.one("timestampoffset",function(){e.state="READY",e.paused()||e.monitorBuffer_()}),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(t)}},i.timestampOffsetForSegment_=function(){return null},i.chooseNextRequest_=function(){return this.skipEmptySegments_(e.prototype.chooseNextRequest_.call(this))},i.skipEmptySegments_=function(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},i.segmentRequestFinished_=function(e,t,i){var n=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return e.code===cc&&this.handleTimeout_(),e.code===uc?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof la.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var o=function(){n.subtitlesTrack_.tech_.off("vttjsloaded",s),n.stopForError({message:"Error loading vtt.js"})},s=function(){n.subtitlesTrack_.tech_.off("vttjserror",o),n.segmentRequestFinished_(e,t,i)};return this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",o)}a.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message})}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new la.VTTCue(e.startTime,e.endTime,e.text):e)}),function(e){var t=e.cues;if(t)for(var i=0;i<t.length;i++){
|
||
for(var n=[],r=0,a=0;a<t.length;a++)t[i].startTime===t[a].startTime&&t[i].endTime===t[a].endTime&&t[i].text===t[a].text&&1<++r&&n.push(t[a]);n.length&&n.forEach(function(t){return e.removeCue(t)})}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t=!1;"function"==typeof la.TextDecoder?i=new la.TextDecoder("utf8"):(i=la.WebVTT.StringDecoder(),t=!0);var i=new la.WebVTT.Parser(la,la.vttjs,i);e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},i.oncue=e.cues.push.bind(e.cues),i.ontimestampmap=function(t){e.timestampmap=t},i.onparsingerror=function(e){mt.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map&&(n=e.segment.map.bytes,t&&(n=Yr(n)),i.parse(n));var n=e.bytes;t&&(n=Yr(n)),i.parse(n),i.flush()},i.updateTimeMapping_=function(e,t,i){var n,r,a=e.segment;t&&(e.cues.length?(r=e.timestampmap,n=r.MPEGTS/9e4-r.LOCAL+t.mapping,e.cues.forEach(function(e){e.startTime+=n,e.endTime+=n}),i.syncInfo||(r=e.cues[0].startTime,t=e.cues[e.cues.length-1].startTime,i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(r,t-a.duration)})):a.empty=!0)},t}(pc),Ac=[{name:"VOD",run:function(e,t,i,n,r){return i===1/0?null:{time:0,segmentIndex:0,partIndex:null}}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,o=null,s=_n(t);r=r||0;for(var l=0;l<s.length;l++){var c=s[t.endList||0===r?l:s.length-(l+1)],u=c.segment,d=e.timelineToDatetimeMappings[u.timeline];if(d&&u.dateTimeObject){var h=u.dateTimeObject.getTime()/1e3+d;if(u.parts&&"number"==typeof c.partIndex)for(var p=0;p<c.partIndex;p++)h+=u.parts[p].duration;if(d=Math.abs(r-h),null!==o&&(0===d||o<d))break;o=d,a={time:h,segmentIndex:c.segmentIndex,partIndex:c.partIndex}}}return a}},{name:"Segment",run:function(e,t,i,n,r){var a=null,o=null;r=r||0;for(var s=_n(t),l=0;l<s.length;l++){var c=s[t.endList||0===r?l:s.length-(l+1)],u=c.segment,d=c.part&&c.part.start||u&&u.start;if(u.timeline===n&&void 0!==d){if(u=Math.abs(r-d),null!==o&&o<u)break;(!a||null===o||u<=o)&&(o=u,a={time:d,segmentIndex:c.segmentIndex,partIndex:c.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var o=null,s=0;s<t.discontinuityStarts.length;s++){var l=t.discontinuityStarts[s],c=t.discontinuitySequence+s+1,u=e.discontinuities[c];if(u){if(c=Math.abs(r-u.time),null!==o&&o<c)break;(!a||null===o||c<=o)&&(o=c,a={time:u.time,segmentIndex:l,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],Ic=function(e){function t(t){var i=e.call(this)||this;return i.timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=hn("SyncController"),i}ho(t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){return i=this.runStrategies_(e,t,i,n),i.length?this.selectSyncPoint_(i,{key:"time",value:n}):null},i.getExpiredTime=function(e,t){return e&&e.segments?(t=this.runStrategies_(e,t,e.discontinuitySequence,0),t.length?(t=this.selectSyncPoint_(t,{key:"segmentIndex",value:0}),0<t.segmentIndex&&(t.time*=-1),Math.abs(t.time+Tn({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.segmentIndex,endIndex:0}))):null):null},i.runStrategies_=function(e,t,i,n){for(var r=[],a=0;a<Ac.length;a++){var o=Ac[a],s=o.run(this,e,t,i,n);s&&(s.strategy=o.name,r.push({strategy:o.name,syncPoint:s}))}return r},i.selectSyncPoint_=function(e,t){for(var i=e[0].syncPoint,n=Math.abs(e[0].syncPoint[t.key]-t.value),r=e[0].strategy,a=1;a<e.length;a++){var o=Math.abs(e[a].syncPoint[t.key]-t.value);o<n&&(n=o,i=e[a].syncPoint,r=e[a].strategy)}return this.logger_("syncPoint for ["+t.key+": "+t.value+"] chosen with strategy ["+r+"]: [time:"+i.time+", segmentIndex:"+i.segmentIndex+("number"==typeof i.partIndex?",partIndex:"+i.partIndex:"")+"]"),i},i.saveExpiredSegmentInfo=function(e,t){for(var i=t.mediaSequence-e.mediaSequence-1;0<=i;i--){var n=e.segments[i];if(n&&void 0!==n.start){t.syncInfo={mediaSequence:e.mediaSequence+i,time:n.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},i.setDateTimeMappingForStart=function(e){var t;this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject&&(e=(t=e.segments[0]).dateTimeObject.getTime()/1e3,this.timelineToDatetimeMappings[t.timeline]=-e)},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),e=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:e.start})),t=e.dateTimeObject,e.discontinuity&&i&&t&&(this.timelineToDatetimeMappings[e.timeline]=-t.getTime()/1e3)},i.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},i.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,a=e.segment,o=e.part,s=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)s={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=s,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+s.time+"] [mapping: "+s.mapping+"]")),n=e.startOfSegment,r=t.end+s.mapping;else{if(!s)return!1;n=t.start+s.mapping,r=t.end+s.mapping}return o&&(o.start=n,o.end=r),(!a.start||n<a.start)&&(a.start=n),a.end=r,!0},i.saveDiscontinuitySyncInfo_=function(e){var t=e.playlist,i=e.segment;if(i.discontinuity)this.discontinuities[i.timeline]={time:i.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(var n=0;n<t.discontinuityStarts.length;n++){var r,a=t.discontinuityStarts[n],o=t.discontinuitySequence+n+1,s=a-e.mediaIndex,l=Math.abs(s);(!this.discontinuities[o]||this.discontinuities[o].accuracy>l)&&(r=void 0,r=s<0?i.start-Tn({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:a}):i.end+Tn({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:a}),this.discontinuities[o]={time:r,accuracy:l})}},i.dispose=function(){this.trigger("dispose"),this.off()},t}(mt.EventTarget),Dc=function(e){function t(){var t=e.call(this)||this;return t.pendingTimelineChanges_={},t.lastTimelineChanges_={},t}ho(t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,e=e.to;return"number"==typeof i&&"number"==typeof e&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:e},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},i.lastTimelineChange=function(e){var t=e.type,i=e.from,e=e.to;return"number"==typeof i&&"number"==typeof e&&(this.lastTimelineChanges_[t]={type:t,from:i,to:e},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(mt.EventTarget),Mc=Po(Ws(Wa(function(){function e(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&i.path)}},i.exports),i.exports}var t=e(function(e){function t(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e},e.exports.default=e.exports,e.exports.__esModule=!0}),i=e(function(e){function t(i,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,t(i,n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0}),n=e(function(e){e.exports=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,i(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0}),r=function(){function e(){this.listeners={}}var t=e.prototype;return t.on=function(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)},t.off=function(e,t){return!!this.listeners[e]&&(t=this.listeners[e].indexOf(t),this.listeners[e]=this.listeners[e].slice(0),this.listeners[e].splice(t,1),-1<t)},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n<i;++n)t[n].call(this,arguments[1]);else for(var r=Array.prototype.slice.call(arguments,1),a=t.length,o=0;o<a;++o)t[o].apply(this,r)},t.dispose=function(){this.listeners={}},t.pipe=function(e){this.on("data",function(t){e.push(t)})},e}(),a=null,o=function(){function e(e){var t,i,n;a=a||function(){for(var e,t,i,n,r,a,o,s=[[[],[],[],[],[]],[[],[],[],[],[]]],l=s[0],c=s[1],u=l[4],d=c[4],h=[],p=[],f=0;f<256;f++)p[(h[f]=f<<1^283*(f>>7))^f]=f;for(e=t=0;!u[e];e^=i||1,t=p[t]||1)for(o=16843009*h[n=h[i=h[d[u[e]=r=(r=t^t<<1^t<<2^t<<3^t<<4)>>8^255&r^99]=e]]]^65537*n^257*i^16843008*e,a=257*h[r]^16843008*r,f=0;f<4;f++)l[f][e]=a=a<<24^a>>>8,c[f][r]=o=o<<24^o>>>8;for(f=0;f<5;f++)l[f]=l[f].slice(0),c[f]=c[f].slice(0);return s}(),this._tables=[[a[0][0].slice(),a[0][1].slice(),a[0][2].slice(),a[0][3].slice(),a[0][4].slice()],[a[1][0].slice(),a[1][1].slice(),a[1][2].slice(),a[1][3].slice(),a[1][4].slice()]];var r=this._tables[0][4],o=this._tables[1],s=e.length,l=1;if(4!==s&&6!==s&&8!==s)throw new Error("Invalid aes key size");var c=e.slice(0),u=[];for(this._key=[c,u],t=s;t<4*s+28;t++)n=c[t-1],(t%s==0||8===s&&t%s==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%s==0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),c[t]=c[t-s]^n;for(i=0;t;i++,t--)n=c[3&i?t:t-4],u[i]=t<=4||i<4?n:o[0][r[n>>>24]]^o[1][r[n>>16&255]]^o[2][r[n>>8&255]]^o[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){for(var o,s,l,c=this._key[1],u=e^c[0],d=n^c[1],h=i^c[2],p=t^c[3],f=c.length/4-2,m=4,t=this._tables[1],g=t[0],v=t[1],y=t[2],_=t[3],b=t[4],w=0;w<f;w++)o=g[u>>>24]^v[d>>16&255]^y[h>>8&255]^_[255&p]^c[m],s=g[d>>>24]^v[h>>16&255]^y[p>>8&255]^_[255&u]^c[m+1],l=g[h>>>24]^v[p>>16&255]^y[u>>8&255]^_[255&d]^c[m+2],p=g[p>>>24]^v[u>>16&255]^y[d>>8&255]^_[255&h]^c[m+3],m+=4,u=o,d=s,h=l;for(w=0;w<4;w++)r[(3&-w)+a]=b[u>>>24]<<24^b[d>>16&255]<<16^b[h>>8&255]<<8^b[255&p]^c[m++],o=u,u=d,d=h,h=p,p=o},e}(),s=function(e){function t(){var t=e.call(this,r)||this;return t.jobs=[],t.delay=1,t.timeout_=null,t}n(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(r),l=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},c=function(){function e(t,i,n,r){var a=e.STEP,o=new Int32Array(t.buffer),c=new Uint8Array(t.byteLength),u=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(o.subarray(u,u+a),i,n,c)),u=a;u<o.length;u+=a)n=new Uint32Array([l(o[u-4]),l(o[u-3]),l(o[u-2]),l(o[u-1])]),this.asyncStream_.push(this.decryptChunk_(o.subarray(u,u+a),i,n,c));this.asyncStream_.push(function(){var e;r(null,(e=c).subarray(0,e.byteLength-e[e.byteLength-1]))})}return e.prototype.decryptChunk_=function(e,t,i,n){return function(){var r=function(e,t,i){for(var n,r,a,s,c=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2),u=new o(Array.prototype.slice.call(t)),e=new Uint8Array(e.byteLength),d=new Int32Array(e.buffer),h=i[0],p=i[1],f=i[2],m=i[3],g=0;g<c.length;g+=4)n=l(c[g]),r=l(c[g+1]),a=l(c[g+2]),s=l(c[g+3]),u.decrypt(n,r,a,s,d,g),d[g]=l(d[g]^h),d[g+1]=l(d[g+1]^p),d[g+2]=l(d[g+2]^f),d[g+3]=l(d[g+3]^m),h=n,p=r,f=a,m=s;return e}(e,t,i);n.set(r,e.byteOffset)}},t(e,null,[{key:"STEP",get:function(){return 32e3}}]),e}();self.onmessage=function(e){var t=e.data,i=new Uint8Array(t.encrypted.bytes,t.encrypted.byteOffset,t.encrypted.byteLength),n=new Uint32Array(t.key.bytes,t.key.byteOffset,t.key.byteLength/4),e=new Uint32Array(t.iv.bytes,t.iv.byteOffset,t.iv.byteLength/4);new c(i,n,e,function(e,i){var n,r;self.postMessage((n={source:t.source,decrypted:i},r={},Object.keys(n).forEach(function(e){var t=n[e];ArrayBuffer.isView(t)?r[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}:r[e]=t}),r),[i.buffer])})}}))),Lc={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;Kr(i,n);var a=n.activeTrack(),i=n.activeGroup(),i=(i.filter(function(e){return e.default})[0]||i[0]).id,o=n.tracks[i];if(a!==o){for(var s in mt.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[s].enabled=n.tracks[s]===o;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];mt.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),Kr(i,n),i=n.activeTrack(),i&&(i.mode="disabled"),n.onTrackChanged()}}},Oc={AUDIO:function(e,t,i){var n,r,a;t&&(n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load()}),t.on("error",Lc[e](e,i)))},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],o=i.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),a.track(o.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load()}),t.on("error",Lc[e](e,i))}},Nc={AUDIO:function(e,t){var i,n,r=t.vhs,a=t.sourceType,o=t.segmentLoaders[e],s=t.requestOptions,l=t.master.mediaGroups,c=t.mediaTypes[e],u=c.groups,d=c.tracks,h=c.logger_,p=t.masterPlaylistLoader,f=Nn(p.master);for(i in l[e]&&0!==Object.keys(l[e]).length||(l[e]={main:{default:{default:!0}}},f&&(l[e].main.default.playlists=p.master.playlists)),l[e])for(var m in u[i]||(u[i]=[]),l[e][i]){var g=l[e][i][m],v=void 0,v=f?(h("AUDIO group '"+i+"' label '"+m+"' is a master playlist"),g.isMasterPlaylist=!0,null):"vhs-json"===a&&g.playlists?new Zl(g.playlists[0],r,s):g.resolvedUri?new Zl(g.resolvedUri,r,s):g.playlists&&"dash"===a?new ic(g.playlists[0],r,s,p):null,g=mt.mergeOptions({id:m,playlistLoader:v},g);Oc[e](e,g.playlistLoader,t),u[i].push(g),void 0===d[m]&&(g=new mt.AudioTrack({id:m,kind:(n=void 0,n=(v=g).default?"main":"alternative",n=v.characteristics&&0<=v.characteristics.indexOf("public.accessibility.describes-video")?"main-desc":n),enabled:!1,language:g.language,default:g.default,label:m}),d[m]=g)}o.on("error",Lc[e](e,t))},SUBTITLES:function(e,t){var i,n=t.tech,r=t.vhs,a=t.sourceType,o=t.segmentLoaders[e],s=t.requestOptions,l=t.master.mediaGroups,c=t.mediaTypes[e],u=c.groups,d=c.tracks,h=t.masterPlaylistLoader;for(i in l[e])for(var p in u[i]||(u[i]=[]),l[e][i])if(!l[e][i][p].forced){var f=l[e][i][p],m=void 0;if("hls"===a)m=new Zl(f.resolvedUri,r,s);else if("dash"===a){if(!f.playlists.filter(function(e){return e.excludeUntil!==1/0}).length)return;m=new ic(f.playlists[0],r,s,h)}else"vhs-json"===a&&(m=new Zl(f.playlists?f.playlists[0]:f.resolvedUri,r,s));f=mt.mergeOptions({id:p,playlistLoader:m},f),Oc[e](e,f.playlistLoader,t),u[i].push(f),void 0===d[p]&&(f=n.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track,d[p]=f)}o.on("error",Lc[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i,n=t.tech,r=t.master.mediaGroups,t=t.mediaTypes[e],a=t.groups,o=t.tracks;for(i in r[e])for(var s in a[i]||(a[i]=[]),r[e][i]){var l,c,u=r[e][i][s];/^(?:CC|SERVICE)/.test(u.instreamId)&&(void 0===(c=(l=n.options_.vhs&&n.options_.vhs.captionServices||{})[(c={label:s,language:u.language,instreamId:u.instreamId,default:u.default&&u.autoselect}).instreamId]?mt.mergeOptions(c,l[c.instreamId]):c).default&&delete c.default,a[i].push(mt.mergeOptions({id:s},u)),void 0===o[s]&&(c=n.addRemoteTextTrack({id:c.instreamId,kind:"captions",default:c.default,language:c.language,label:c.label},!1).track,o[s]=c))}}},Pc={AUDIO:function(e,t){return function(){var i,n=t.mediaTypes[e].tracks;for(i in n)if(n[i].enabled)return n[i];return null}},SUBTITLES:function(e,t){return function(){var i,n=t.mediaTypes[e].tracks;for(i in n)if("showing"===n[i].mode||"hidden"===n[i].mode)return n[i];return null}}},Rc=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],jc=function(e){function t(t){var i=e.call(this)||this,n=t.src,r=t.handleManifestRedirects,a=t.withCredentials,o=t.tech,s=t.bandwidth,l=t.externVhs,c=t.useCueTags,u=t.blacklistDuration,d=t.enableLowInitialPlaylist,h=t.sourceType,p=t.cacheEncryptionKeys,f=t.experimentalBufferBasedABR;if(!n)throw new Error("A non-empty playlist URL or JSON manifest string is required");var m,g=t.maxPlaylistRetries;return null!==g&&void 0!==g||(g=1/0),Hl=l,i.experimentalBufferBasedABR=Boolean(f),i.withCredentials=a,i.tech_=o,i.vhs_=o.vhs,i.sourceType_=h,i.useCueTags_=c,i.blacklistDuration=u,i.maxPlaylistRetries=g,i.enableLowInitialPlaylist=d,i.useCueTags_&&(i.cueTagsTrack_=i.tech_.addTextTrack("metadata","ad-cues"),i.cueTagsTrack_.inBandMetadataTrackDispatchType=""),i.requestOptions_={withCredentials:a,handleManifestRedirects:r,maxPlaylistRetries:g,timeout:null},i.on("error",i.pauseLoading),i.mediaTypes_=(m={},["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(e){m[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Br,activeTrack:Br,getActiveGroup:Br,onGroupChanged:Br,onTrackChanged:Br,lastTrack_:null,logger_:hn("MediaGroups["+e+"]")}}),m),i.mediaSource=new la.MediaSource,i.handleDurationChange_=i.handleDurationChange_.bind(uo(i)),i.handleSourceOpen_=i.handleSourceOpen_.bind(uo(i)),i.handleSourceEnded_=i.handleSourceEnded_.bind(uo(i)),i.mediaSource.addEventListener("durationchange",i.handleDurationChange_),i.mediaSource.addEventListener("sourceopen",i.handleSourceOpen_),i.mediaSource.addEventListener("sourceended",i.handleSourceEnded_),i.seekable_=mt.createTimeRanges(),i.hasPlayed_=!1,i.syncController_=new Ic(t),i.segmentMetadataTrack_=o.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,i.decrypter_=new Mc,i.sourceUpdater_=new Tc(i.mediaSource),i.inbandTextTracks_={},i.timelineChangeController_=new Dc,p={vhs:i.vhs_,parse708captions:t.parse708captions,mediaSource:i.mediaSource,currentTime:i.tech_.currentTime.bind(i.tech_),seekable:function(){return i.seekable()},seeking:function(){return i.tech_.seeking()},duration:function(){return i.duration()},hasPlayed:function(){return i.hasPlayed_},goalBufferLength:function(){return i.goalBufferLength()},bandwidth:s,syncController:i.syncController_,decrypter:i.decrypter_,sourceType:i.sourceType_,inbandTextTracks:i.inbandTextTracks_,cacheEncryptionKeys:p,sourceUpdater:i.sourceUpdater_,timelineChangeController:i.timelineChangeController_},i.masterPlaylistLoader_=new("dash"===i.sourceType_?ic:Zl)(n,i.vhs_,i.requestOptions_),i.setupMasterPlaylistLoaderListeners_(),i.mainSegmentLoader_=new pc(mt.mergeOptions(p,{segmentMetadataTrack:i.segmentMetadataTrack_,loaderType:"main"}),t),i.audioSegmentLoader_=new pc(mt.mergeOptions(p,{loaderType:"audio"}),t),i.subtitleSegmentLoader_=new Ec(mt.mergeOptions(p,{loaderType:"vtt",featuresNativeTextTracks:i.tech_.featuresNativeTextTracks}),t),i.setupSegmentLoaderListeners_(),i.experimentalBufferBasedABR&&(i.masterPlaylistLoader_.one("loadedplaylist",function(){return i.startABRTimer_()}),i.tech_.on("pause",function(){return i.stopABRTimer_()}),i.tech_.on("play",function(){return i.startABRTimer_()})),Rc.forEach(function(e){i[e+"_"]=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]}.bind(uo(i),e)}),i.logger_=hn("MPC"),i.triggeredFmp4Usage=!1,"none"===i.tech_.preload()?(i.loadOnPlay_=function(){i.loadOnPlay_=null,i.masterPlaylistLoader_.load()},i.tech_.one("play",i.loadOnPlay_)):i.masterPlaylistLoader_.load(),i.timeToLoadedData__=-1,i.mainAppendsToLoadedData__=-1,i.audioAppendsToLoadedData__=-1,t="none"===i.tech_.preload()?"play":"loadstart",i.tech_.one(t,function(){var e=Date.now();i.tech_.one("loadeddata",function(){i.timeToLoadedData__=Date.now()-e,i.mainAppendsToLoadedData__=i.mainSegmentLoader_.mediaAppends,i.audioAppendsToLoadedData__=i.audioSegmentLoader_.mediaAppends})}),i}ho(t,e);var i=t.prototype;return i.mainAppendsToLoadedData_=function(){return this.mainAppendsToLoadedData__},i.audioAppendsToLoadedData_=function(){return this.audioAppendsToLoadedData__},i.appendsToLoadedData_=function(){var e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return-1===e||-1===t?-1:e+t},i.timeToLoadedData_=function(){return this.timeToLoadedData__},i.checkABR_=function(){var e=this.selectPlaylist();this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,"abr")},i.switchMedia_=function(e,t,i){var n=this.media(),r=n&&(n.id||n.uri),n=e.id||e.uri;r&&r!==n&&(this.logger_("switch media "+r+" -> "+n+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=la.setInterval(function(){return e.checkABR_()},250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(la.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master();if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return e&&e.playlists||[];var t,i=e.mediaGroups.AUDIO,e=Object.keys(i);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)t=this.mediaTypes_.AUDIO.activeTrack();else{var n,r=i.main||e.length&&i[e[0]];for(n in r)if(r[n].default){t={label:n};break}}if(!t)return[];var a,o,s=[];for(a in i)i[a][t.label]&&((o=i[a][t.label]).playlists?s.push.apply(s,o.playlists):s.push(o));return s},i.setupMasterPlaylistLoaderListeners_=function(){var e=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var t=e.masterPlaylistLoader_.media(),i=1.5*t.targetDuration*1e3;Mn(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,t.endList&&"none"!==e.tech_.preload()&&(e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load()),Zr({sourceType:e.sourceType_,segmentLoaders:{AUDIO:e.audioSegmentLoader_,SUBTITLES:e.subtitleSegmentLoader_,main:e.mainSegmentLoader_},tech:e.tech_,requestOptions:e.requestOptions_,masterPlaylistLoader:e.masterPlaylistLoader_,vhs:e.vhs_,master:e.master(),mediaTypes:e.mediaTypes_,blacklistCurrentPlaylist:e.blacklistCurrentPlaylist.bind(e)}),e.triggerPresenceUsage_(e.master(),t),e.setupFirstPlay(),!e.mediaTypes_.AUDIO.activePlaylistLoader||e.mediaTypes_.AUDIO.activePlaylistLoader.media()?e.trigger("selectedinitialmedia"):e.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",function(){e.trigger("selectedinitialmedia")})}),this.masterPlaylistLoader_.on("loadedplaylist",function(){e.loadOnPlay_&&e.tech_.off("play",e.loadOnPlay_);var t,i=e.masterPlaylistLoader_.media();if(!i){if(e.excludeUnsupportedVariants_(),!(t=(t=e.enableLowInitialPlaylist?e.selectInitialPlaylist():t)||e.selectPlaylist())||!e.shouldSwitchToMedia_(t))return;if(e.initialMedia_=t,e.switchMedia_(e.initialMedia_,"initial"),!("vhs-json"===e.sourceType_&&e.initialMedia_.segments))return;i=e.initialMedia_}e.handleUpdatedMediaPlaylist(i)}),this.masterPlaylistLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){e.mainSegmentLoader_.abort(),e.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var t=e.masterPlaylistLoader_.media(),i=1.5*t.targetDuration*1e3;Mn(e.masterPlaylistLoader_.master,e.masterPlaylistLoader_.media())?e.requestOptions_.timeout=0:e.requestOptions_.timeout=i,e.mainSegmentLoader_.playlist(t,e.requestOptions_),e.mainSegmentLoader_.load(),e.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var t=e.masterPlaylistLoader_.media();"playlist-unchanged"!==t.lastExcludeReason_&&e.stuckAtPlaylistEnd_(t)&&(e.blacklistCurrentPlaylist({message:"Playlist no longer updating.",reason:"playlist-unchanged"}),e.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){e.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"}),e.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},i.handleUpdatedMediaPlaylist=function(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())},i.triggerPresenceUsage_=function(e,t){var i,n=e.mediaGroups||{},r=!0,e=Object.keys(n.AUDIO);for(i in n.AUDIO)for(var a in n.AUDIO[i])n.AUDIO[i][a].uri||(r=!1);r&&(this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),this.tech_.trigger({type:"usage",name:"hls-demuxed"})),Object.keys(n.SUBTITLES).length&&(this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),this.tech_.trigger({type:"usage",name:"hls-webvtt"})),Hl.Playlist.isAes(t)&&(this.tech_.trigger({type:"usage",name:"vhs-aes"}),this.tech_.trigger({type:"usage",name:"hls-aes"})),e.length&&1<Object.keys(n.AUDIO[e[0]]).length&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media(),i=this.tech_.buffered();return function(e){var t=e.currentPlaylist,i=e.nextPlaylist,n=e.forwardBuffer,r=e.bufferLowWaterLine,a=e.bufferHighWaterLine,o=e.duration,s=e.experimentalBufferBasedABR,l=e.log;if(!i)return mt.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+i.id;return t&&t.endList?i.id!==t.id&&(e=s?nc.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:nc.MAX_BUFFER_LOW_WATER_LINE,o<e?(l(c+" as duration < max low water line ("+o+" < "+e+")"),!0):(e=i.attributes.BANDWIDTH,i=t.attributes.BANDWIDTH,e<i&&(!s||n<a)?(t=c+" as next bandwidth < current bandwidth ("+e+" < "+i+")",s&&(t+=" and forwardBuffer < bufferHighWaterLine ("+n+" < "+a+")"),l(t),!0):(!s||i<e)&&r<=n?(r=c+" as forwardBuffer >= bufferLowWaterLine ("+n+" >= "+r+")",s&&(r+=" and next bandwidth > current bandwidth ("+e+" > "+i+")"),l(r),!0):(l("not "+c+" as no switching criteria met"),!1))):(l(c+" as current playlist "+(t?"is live":"is not set")),!0)}({currentPlaylist:t,nextPlaylist:e,forwardBuffer:i.length?i.end(i.length-1)-this.tech_.currentTime():0,bufferLowWaterLine:this.bufferLowWaterLine(),bufferHighWaterLine:this.bufferHighWaterLine(),duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){function e(){if(!t.sourceUpdater_.hasCreatedSourceBuffers())return t.tryToCreateSourceBuffers_();var e=t.getCodecsOrExclude_();e&&t.sourceUpdater_.addOrChangeSourceBuffers(e)}var t=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var e=t.selectPlaylist();t.shouldSwitchToMedia_(e)&&t.switchMedia_(e,"bandwidthupdate"),t.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){t.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){t.blacklistCurrentPlaylist(t.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){t.error=t.mainSegmentLoader_.error_,t.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){t.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),t.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){t.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){t.error=t.audioSegmentLoader_.error_,t.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){t.logger_("main segment loader ended"),t.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(e){t.experimentalBufferBasedABR||(t.delegateLoaders_("all",["abort"]),t.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))}),this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",function(){t.triggeredFmp4Usage||(t.tech_.trigger({type:"usage",name:"vhs-fmp4"}),t.tech_.trigger({type:"usage",name:"hls-fmp4"}),t.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){t.triggeredFmp4Usage||(t.tech_.trigger({type:"usage",name:"vhs-fmp4"}),t.tech_.trigger({type:"usage",name:"hls-fmp4"}),t.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){t.logger_("audioSegmentLoader ended"),t.onEndOfStream()})},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;(e=void 0===e?this.selectPlaylist():e)!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){mt.browser.IE_VERSION||mt.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0)?this.tech_.setCurrentTime(e.end(e.length-1)):void 0}},i.setupFirstPlay=function(){var e=this,t=this.masterPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList){var i=this.seekable();if(!i.length)return!1;if(mt.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",function(){e.trigger("firstplay"),e.tech_.setCurrentTime(i.end(0)),e.hasPlayed_=!0}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(i.end(0))}return this.hasPlayed_=!0,this.load(),!0},i.handleSourceOpen_=function(){var e;this.tryToCreateSourceBuffers_(),!this.tech_.autoplay()||void 0!==(e=this.tech_.play())&&"function"==typeof e.then&&e.then(null,function(e){}),this.trigger("sourceopen")},i.handleSourceEnded_=function(){var e,t;!this.inbandTextTracks_.metadataTrack_||(e=this.inbandTextTracks_.metadataTrack_.cues)&&e.length&&(t=this.duration(),e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t)},i.handleDurationChange_=function(){this.tech_.trigger("durationchange")},i.onEndOfStream=function(){
|
||
var e,t=this.mainSegmentLoader_.ended_;(t=this.mediaTypes_.AUDIO.activePlaylistLoader?((e=this.mainSegmentLoader_.getCurrentMediaInfo_())&&!e.hasVideo||t)&&this.audioSegmentLoader_.ended_:t)&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())},i.stuckAtPlaylistEnd_=function(e){if(!this.seekable().length)return!1;var t=this.syncController_.getExpiredTime(e,this.duration());if(null===t)return!1;var i=Hl.Playlist.playlistEnd(e,t),e=this.tech_.currentTime(),t=this.tech_.buffered();return t.length?(t=t.end(t.length-1))-e<=.1&&i-t<=.1:i-e<=.1},i.blacklistCurrentPlaylist=function(e,t){var i=(e=void 0===e?{}:e).playlist||this.masterPlaylistLoader_.media();if(t=t||e.blacklistDuration||this.blacklistDuration,!i)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));i.playlistErrors_++;var n,r=this.masterPlaylistLoader_.master.playlists,a=r.filter(In),o=1===a.length&&a[0]===i;return 1===r.length&&t!==1/0?(mt.log.warn("Problem encountered with playlist "+i.id+". Trying again since it is the only playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(o)):(o&&(n=!1,r.forEach(function(e){var t;e===i||void 0!==(t=e.excludeUntil)&&t!==1/0&&(n=!0,delete e.excludeUntil)}),n&&(mt.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))),a=i.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=a,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),(r=this.selectPlaylist())?(t=e.internal?this.logger_:mt.log.warn,a=e.message?" "+e.message:"",t((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+a+" Switching to playlist "+r.id+"."),r.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),r.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]),a=r.targetDuration/2*1e3||5e3,a="number"==typeof r.lastRequest&&Date.now()-r.lastRequest<=a,this.switchMedia_(r,"exclude",o||a)):(this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error")))},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;!r&&"main"!==e||n.push(this.masterPlaylistLoader_);var a=[];!r&&"audio"!==e||a.push("AUDIO"),!r&&"subtitle"!==e||(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(function(e){(e=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader)&&n.push(e)}),["main","audio","subtitle"].forEach(function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)}),n.forEach(function(e){return t.forEach(function(t){"function"==typeof e[t]&&e[t]()})})},i.setCurrentTime=function(e){var t=fn(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Hl.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n,r,a=this.masterPlaylistLoader_.master,o=Hl.Playlist.seekable(t,i,Hl.Playlist.liveEdgeDelay(a,t));if(0!==o.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Hl.Playlist.seekable(t,i,Hl.Playlist.liveEdgeDelay(a,t))).length)return}this.seekable_&&this.seekable_.length&&(n=this.seekable_.end(0),r=this.seekable_.start(0)),!e||e.start(0)>o.end(0)||o.start(0)>e.end(0)?this.seekable_=o:this.seekable_=mt.createTimeRanges([[(e.start(0)>o.start(0)?e:o).start(0),(e.end(0)<o.end(0)?e:o).end(0)]]),this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===n&&this.seekable_.start(0)===r||(this.logger_("seekable updated ["+gn(this.seekable_)+"]"),this.tech_.trigger("seekablechanged"))}}}}},i.updateDuration=function(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,e),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(e){var t=this.seekable();return t.length?void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1))):void 0}e=this.tech_.buffered(),t=Hl.Playlist.duration(this.masterPlaylistLoader_.media()),0<e.length&&(t=Math.max(t,e.end(e.length-1))),this.mediaSource.duration!==t&&this.sourceUpdater_.setDuration(t)},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(t){var i,n=e.mediaTypes_[t].groups;for(i in n)n[i].forEach(function(e){e.playlistLoader&&e.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),e=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return t&&e},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Sr(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||el)),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||el,t.audio.isFmp4=(t.main.hasAudio&&!t.main.isMuxed?t.main:t.audio).isFmp4),n.audio||n.video){var a,o,s={};if(["video","audio"].forEach(function(e){var i,r;n.hasOwnProperty(e)&&(i=t[e].isFmp4,r=n[e],!(i?St:Et)(r))&&(r=t[e].isFmp4?"browser":"muxer",s[r]=s[r]||[],s[r].push(n[e]),"audio"===e&&(a=r))}),r&&a&&this.media().attributes.AUDIO&&(o=this.media().attributes.AUDIO,this.master().playlists.forEach(function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)}),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"')),!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var l=[];if(["video","audio"].forEach(function(t){var i=(kt(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(kt(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&l.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')}),l.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+l.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}r=Object.keys(s).reduce(function(e,t){return e&&(e+=", "),e+=t+' does not support codec(s): "'+s[t].join(",")+'"'},"")+".",this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:r,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){var e;"open"!==this.mediaSource.readyState||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_()||(e=this.getCodecsOrExclude_())&&(this.sourceUpdater_.createSourceBuffers(e),e=[e.video,e.audio].filter(Boolean).join(","),this.excludeIncompatibleVariants_(e))},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach(function(n){var r,a=t[n];-1===i.indexOf(a.id)&&(i.push(a.id),r=[],!(n=Sr(e.master,a)).audio||Et(n.audio)||St(n.audio)||r.push("audio codec "+n.audio),!n.video||Et(n.video)||St(n.video)||r.push("video codec "+n.video),n.text&&"stpp.ttml.im1t"===n.text&&r.push("text codec "+n.text),r.length&&(a.excludeUntil=1/0,e.logger_("excluding "+a.id+" for unsupported: "+r.join(", "))))})},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,e=Cr(kt(e)),r=Tr(e),a=e.video&&kt(e.video)[0]||null,o=e.audio&&kt(e.audio)[0]||null;Object.keys(n).forEach(function(e){var s,l,c=n[e];-1===i.indexOf(c.id)&&c.excludeUntil!==1/0&&(i.push(c.id),s=[],l=Sr(t.masterPlaylistLoader_.master,c),e=Tr(l),(l.audio||l.video)&&(e!==r&&s.push('codec count "'+e+'" !== "'+r+'"'),t.sourceUpdater_.canChangeType()||(e=l.video&&kt(l.video)[0]||null,l=l.audio&&kt(l.audio)[0]||null,e&&a&&e.type.toLowerCase()!==a.type.toLowerCase()&&s.push('video codec "'+e.type+'" !== "'+a.type+'"'),l&&o&&l.type.toLowerCase()!==o.type.toLowerCase()&&s.push('audio codec "'+l.type+'" !== "'+o.type+'"')),s.length&&(c.excludeUntil=1/0,t.logger_("blacklisting "+c.id+": "+s.join(" && ")))))})},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n=i,r=0;r<e.segments.length;r++){var a,o,s,l=e.segments[r];if(s=s||function(e,t){for(var i=e.cues,n=0;n<i.length;n++){var r=i[n];if(t>=r.adStartTime&&t<=r.adEndTime)return r}return null}(t,n+l.duration/2)){if("cueIn"in l){s.endTime=n,s.adEndTime=n,n+=l.duration,s=null;continue}if(n<s.endTime){n+=l.duration;continue}s.endTime+=l.duration}else"cueOut"in l&&((s=new la.VTTCue(n,n+l.duration,l.cueOut)).adStartTime=n,s.adEndTime=n+parseFloat(l.cueOut),t.addCue(s)),"cueOutCont"in l&&(a=(o=l.cueOutCont.split("/").map(parseFloat))[0],o=o[1],(s=new la.VTTCue(n,n+l.duration,"")).adStartTime=n-a,s.adEndTime=s.adStartTime+o,t.addCue(s));n+=l.duration}}(e,this.cueTagsTrack_,t)},i.goalBufferLength=function(){var e=this.tech_.currentTime(),t=nc.GOAL_BUFFER_LENGTH,i=nc.GOAL_BUFFER_LENGTH_RATE,n=Math.max(t,nc.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)},i.bufferLowWaterLine=function(){var e=this.tech_.currentTime(),t=nc.BUFFER_LOW_WATER_LINE,i=nc.BUFFER_LOW_WATER_LINE_RATE,n=Math.max(t,nc.MAX_BUFFER_LOW_WATER_LINE),r=Math.max(t,nc.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.experimentalBufferBasedABR?r:n)},i.bufferHighWaterLine=function(){return nc.BUFFER_HIGH_WATER_LINE},t}(mt.EventTarget),zc=["seeking","seeked","pause","playing","error"],Fc=function(){function e(e){function t(){return o.monitorCurrentTime_()}function i(){return o.monitorCurrentTime_()}function n(){return o.techWaiting_()}function r(){return o.cancelTimer_()}function a(){return o.fixesBadSeeks_()}var o=this;this.masterPlaylistController_=e.masterPlaylistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=hn("PlaybackWatcher"),this.logger_("initialize");var s=this.masterPlaylistController_,l=["main","subtitle","audio"],c={};l.forEach(function(e){c[e]={reset:function(){return o.resetSegmentDownloads_(e)},updateend:function(){return o.checkSegmentDownloads_(e)}},s[e+"SegmentLoader_"].on("appendsdone",c[e].updateend),s[e+"SegmentLoader_"].on("playlistupdate",c[e].reset),o.tech_.on(["seeked","seeking"],c[e].reset)}),this.tech_.on("seekablechanged",a),this.tech_.on("waiting",n),this.tech_.on(zc,r),this.tech_.on("canplay",i),this.tech_.one("play",t),this.dispose=function(){o.logger_("dispose"),o.tech_.off("seekablechanged",a),o.tech_.off("waiting",n),o.tech_.off(zc,r),o.tech_.off("canplay",i),o.tech_.off("play",t),l.forEach(function(e){s[e+"SegmentLoader_"].off("appendsdone",c[e].updateend),s[e+"SegmentLoader_"].off("playlistupdate",c[e].reset),o.tech_.off(["seeked","seeking"],c[e].reset)}),o.checkCurrentTimeTimeout_&&la.clearTimeout(o.checkCurrentTimeTimeout_),o.cancelTimer_()}}var t=e.prototype;return t.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&la.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=la.setTimeout(this.monitorCurrentTime_.bind(this),250)},t.resetSegmentDownloads_=function(e){var t=this.masterPlaylistController_[e+"SegmentLoader_"];0<this[e+"StalledDownloads_"]&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i<e.length;i++)if(e.start(i)!==t.start(i)||e.end(i)!==t.end(i))return!0;return!1}(this[e+"Buffered_"],n);this[e+"Buffered_"]=n,r?this.resetSegmentDownloads_(e):(this[e+"StalledDownloads_"]++,this.logger_("found #"+this[e+"StalledDownloads_"]+" "+e+" appends that did not increase buffer (possible stalled download)",{playlistId:i.playlist_&&i.playlist_.id,buffered:vn(n)}),this[e+"StalledDownloads_"]<10||(this.logger_(e+" loader stalled download exclusion"),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:"vhs-"+e+"-download-exclusion"}),"subtitle"!==e&&t.blacklistCurrentPlaylist({message:"Excessive "+e+" segment downloading detected."},1/0)))},t.checkCurrentTime_=function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+.1>=t.end(t.length-1)))return this.techWaiting_();5<=this.consecutiveUpdates&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),void 0!==(e=this.beforeSeekableWindow_(t,i)?(r=t.start(0))+(r===t.end(0)?0:.1):e))return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+gn(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;var n,r,a=this.tech_.buffered();return n={buffered:a,targetDuration:this.media().targetDuration,currentTime:i},r=n.buffered,t=n.targetDuration,n=n.currentTime,!(!r.length||r.end(0)-r.start(0)<2*t||n>r.start(0))&&r.start(0)-n<t&&(e=a.start(0)+.1,this.logger_("Buffered region starts ("+a.start(0)+") just beyond seek point ("+i+"). Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0)},t.waiting_=function(){var e,t;this.techWaiting_()||(e=this.tech_.currentTime(),t=this.tech_.buffered(),(t=fn(t,e)).length&&e+3<=t.end(0)&&(this.cancelTimer_(),this.tech_.setCurrentTime(e),this.logger_("Stopped at "+e+" while inside a buffered region ["+t.start(0)+" -> "+t.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})))},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}return e=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,i=this.tech_.buffered(),this.videoUnderflow_({audioBuffered:e.audioBuffered(),videoBuffered:e.videoBuffered(),currentTime:t})?(this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0):(e=mn(i,t),0<e.length&&(i=e.start(0)-t,this.logger_("Stopped at "+t+", setting timer for "+i+", seeking to "+e.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*i,t),!0))},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return(r=!i.endList&&n?e.end(e.length-1)+3*i.targetDuration:r)<t},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&0<e.start(0)&&t<e.start(0)-this.liveRangeSafeTimeDelta)},t.videoUnderflow_=function(e){var t,i,n=e.videoBuffered,r=e.audioBuffered,a=e.currentTime;if(n)return n.length&&r.length?(i=fn(n,a-3),e=fn(n,a),(r=fn(r,a)).length&&!e.length&&i.length&&(t={start:i.end(0),end:r.end(0)})):mn(n,a).length||(t=this.gapFromVideoUnderflow_(n,a)),!!t&&(this.logger_("Encountered a gap in video from "+t.start+" to "+t.end+". Seeking to current time "+a),!0)},t.skipTheGap_=function(e){var t=this.tech_.buffered(),i=this.tech_.currentTime(),t=mn(t,i);this.cancelTimer_(),0!==t.length&&i===e&&(this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",e,"nextRange start:",t.start(0)),this.tech_.setCurrentTime(t.start(0)+Gl),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},t.gapFromVideoUnderflow_=function(e,t){for(var i=function(e){if(e.length<2)return mt.createTimeRanges();for(var t=[],i=1;i<e.length;i++){var n=e.end(i-1),r=e.start(i);t.push([n,r])}return mt.createTimeRanges(t)}(e),n=0;n<i.length;n++){var r=i.start(n),a=i.end(n);if(t-r<4&&2<t-r)return{start:r,end:a}}return null},e}(),Bc={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Wa=function(e){ea(this,e)},Uc={PlaylistLoader:Zl,Playlist:Kl,utils:No,STANDARD_PLAYLIST_SELECTOR:Ao,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(Kl.isEnabled);return Ir(t,Dr),t.filter(function(t){return!!Sr(e.playlists.master,t).video})[0]||null},lastBandwidthSelector:Ao,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||1<e)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&la.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),0<this.systemBandwidth&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Mr(this.playlists.master,t,parseInt(Ar(this.tech_.el(),"width"),10)*n,parseInt(Ar(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:Dr,comparePlaylistResolution:function(e,t){var i,n;return(i=(i=e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width?e.attributes.RESOLUTION.width:i)||la.Number.MAX_VALUE)===(n=(n=t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width?t.attributes.RESOLUTION.width:n)||la.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Vn()};Object.keys(nc).forEach(function(e){Object.defineProperty(Uc,e,{get:function(){return mt.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),nc[e]},set:function(t){mt.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?mt.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):nc[e]=t}})});var $c="videojs-vhs";Uc.canPlaySource=function(){return mt.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")},Uc.supportsNativeHls=function(){if(!da||!da.createElement)return!1;var e=da.createElement("video");return!!mt.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(e.canPlayType(t))})}(),Uc.supportsNativeDash=!!(da&&da.createElement&&mt.getTech("Html5").isSupported())&&/maybe|probably/i.test(da.createElement("video").canPlayType("application/dash+xml")),Uc.supportsTypeNatively=function(e){return"hls"===e?Uc.supportsNativeHls:"dash"===e&&Uc.supportsNativeDash},Uc.isSupported=function(){return mt.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var qc=function(e){function t(t,i,n){var r=e.call(this,i,mt.mergeOptions(n.hls,n.vhs))||this;if(n.hls&&Object.keys(n.hls).length&&mt.log.warn("Using hls options is deprecated. Use vhs instead."),"number"==typeof n.initialBandwidth&&(r.options_.bandwidth=n.initialBandwidth),r.logger_=hn("VhsHandler"),i.options_&&i.options_.playerId&&((n=mt(i.options_.playerId)).hasOwnProperty("hls")||Object.defineProperty(n,"hls",{get:function(){return mt.log.warn("player.hls is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"hls-player-access"}),uo(r)},configurable:!0}),n.hasOwnProperty("vhs")||Object.defineProperty(n,"vhs",{get:function(){return mt.log.warn("player.vhs is deprecated. Use player.tech().vhs instead."),i.trigger({type:"usage",name:"vhs-player-access"}),uo(r)},configurable:!0}),n.hasOwnProperty("dash")||Object.defineProperty(n,"dash",{get:function(){return mt.log.warn("player.dash is deprecated. Use player.tech().vhs instead."),uo(r)},configurable:!0}),r.player_=n),r.tech_=i,r.source_=t,r.stats={},r.ignoreNextSeekingEvent_=!1,r.setOptions_(),r.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(r.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return r.on(da,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(e){var t=da.fullscreenElement||da.webkitFullscreenElement||da.mozFullScreenElement||da.msFullscreenElement;t&&t.contains(r.tech_.el())?r.masterPlaylistController_.fastQualityChange_():r.masterPlaylistController_.checkABR_()}),r.on(r.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())}),r.on(r.tech_,"error",function(){this.tech_.error()&&this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),r.on(r.tech_,"play",r.play),r}ho(t,e);var i=t.prototype;return i.setOptions_=function(){var e,t=this;this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.handleManifestRedirects=!1!==this.options_.handleManifestRedirects,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.smoothQualityChange=this.options_.smoothQualityChange||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage&&((e=ra())&&e.bandwidth&&(this.options_.bandwidth=e.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-bandwidth-from-local-storage"})),e&&e.throughput&&(this.options_.throughput=e.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}),this.tech_.trigger({type:"usage",name:"hls-throughput-from-local-storage"}))),"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=nc.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===nc.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","smoothQualityChange","customTagParsers","customTagMappers","handleManifestRedirects","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","experimentalBufferBasedABR","liveRangeSafeTimeDelta","experimentalLLHLS"].forEach(function(e){void 0!==t.source_[e]&&(t.options_[e]=t.source_[e])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio},i.src=function(e,t){var i=this;e&&(this.setOptions_(),this.options_.src=0===(e=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(e.substring(e.indexOf(",")+1)):e,this.options_.tech=this.tech_,this.options_.externVhs=Uc,this.options_.sourceType=At(t),this.options_.seekTo=function(e){i.tech_.setCurrentTime(e)},this.options_.smoothQualityChange&&mt.log.warn("smoothQualityChange is deprecated and will be removed in the next major version"),this.masterPlaylistController_=new jc(this.options_),t=mt.mergeOptions({liveRangeSafeTimeDelta:.1},this.options_,{seekable:function(){return i.seekable()},media:function(){return i.masterPlaylistController_.media()},masterPlaylistController:this.masterPlaylistController_}),this.playbackWatcher_=new Fc(t),this.masterPlaylistController_.on("error",function(){var e=mt.players[i.tech_.options_.playerId],t=i.masterPlaylistController_.error;"object"!=typeof t||t.code?"string"==typeof t&&(t={message:t,code:3}):t.code=3,e.error(t)}),t=this.options_.experimentalBufferBasedABR?Uc.movingAverageBandwidthSelector(.55):Uc.STANDARD_PLAYLIST_SELECTOR,this.masterPlaylistController_.selectPlaylist=(this.selectPlaylist||t).bind(this),this.masterPlaylistController_.selectInitialPlaylist=Uc.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(e){this.masterPlaylistController_.selectPlaylist=e.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=e,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e=1/(this.bandwidth||1),t=0<this.throughput?1/this.throughput:0;return Math.floor(1/(e+t))},set:function(){mt.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return vn(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return vn(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(la.localStorage){var t=(t=ra())?mt.mergeOptions(t,e):e;try{la.localStorage.setItem($c,JSON.stringify(t))}catch(e){return}}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),t=Nn(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return t?t.filter(function(e){return!An(e)}).map(function(t,i){return new Jr(e,t,t.id)}):[]}}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){i.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),
|
||
this.tech_.el()&&(this.mediaSourceUrl_=la.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_)))},i.setupEme_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=na({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:t&&t.media()});11!==mt.browser.IE_VERSION&&i?(this.logger_("waiting for EME key session creation"),ia({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})):this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=mt.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach(function(e){t.addQualityLevel(e)}),ta(t,i.playlists)}),this.playlists.on("mediachange",function(){ta(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":"2.9.2","mux.js":"5.12.2","mpd-parser":"0.17.0","m3u8-parser":"4.7.0","aes-decrypter":"3.1.2"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return Tc.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&la.URL.revokeObjectURL&&(la.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return er({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),tr({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(mt.getComponent("Component")),Hc={name:"videojs-http-streaming",VERSION:"2.9.2",canHandleSource:function(e,t){return t=mt.mergeOptions(mt.options,t=void 0===t?{}:t),Hc.canPlayType(e.type,t)},handleSource:function(e,t,i){return i=mt.mergeOptions(mt.options,i=void 0===i?{}:i),t.vhs=new qc(e,t,i),mt.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return mt.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Vn(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){return t=mt.mergeOptions(mt.options,t=void 0===t?{}:t).vhs.overrideNative,t=void 0===t?!mt.browser.IS_ANY_SAFARI:t,e=At(e),!e||Uc.supportsTypeNatively(e)&&!t?"":"maybe"}};return St("avc1.4d400d,mp4a.40.2")&&mt.getTech("Html5").registerSourceHandler(Hc,0),mt.VhsHandler=qc,Object.defineProperty(mt,"HlsHandler",{get:function(){return mt.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),qc},configurable:!0}),mt.VhsSourceHandler=Hc,Object.defineProperty(mt,"HlsSourceHandler",{get:function(){return mt.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),Hc},configurable:!0}),mt.Vhs=Uc,Object.defineProperty(mt,"Hls",{get:function(){return mt.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Uc},configurable:!0}),mt.use||(mt.registerComponent("Hls",Uc),mt.registerComponent("Vhs",Uc)),mt.options.vhs=mt.options.vhs||{},mt.options.hls=mt.options.hls||{},mt.registerPlugin?mt.registerPlugin("reloadSourceOnError",Wa):mt.plugin("reloadSourceOnError",Wa),mt}),function(){!function(e){var t=e&&e.videojs;t&&(t.CDN_VERSION="7.14.3")}(window)}(),define("text!modules/console/expdesktop/template/scrapbooking.html",[],function(){return'<div class="sd-scrapbooking" >\r\n <div class="sd-scrapbooking">\r\n <div class="layui-form-item layui-form-text">\r\n <textarea classs="sd-textarea-scrapbooking" name="sd-textarea-scrapbooking" placeholder="请输入要复制内容" class="layui-textarea"></textarea>\r\n </div>\r\n <p style="font-size: 12px;color: #333">\r\n <span style="font-weight: bolder">复制外部内容到实验环境:</span> 粘贴内容到上面文本框,点击保存,后在实验环境中自行粘贴\r\n <br />\r\n <span style="font-weight: bolder;">获取实验环境内容到外部:</span>请先在实验环境中自行复制内容,后在上面文本框中再次复制。\r\n </p>\r\n </div>\r\n</div>\r\n'}),define("modules/console/expdesktop/controller",["app-utils","modules/console/basecontroller","jquery","lsbridge","modules/console/expdesktop/model/guacamole/controller","modules/console/expdesktop/model/interact/controller","modules/console/expdesktop/model/comment/controller","modules/console/expdesktop/model/document/controller","modules/console/expdesktop/model/report/controller","modules/console/expdesktop/model/code/controller","modules/console/expdesktop/service","modules/console/expdesktop/pop/help/controller","modules/console/expdesktop/pop/lookrecover/controller","modules/console/expdesktop/pop/saveexp/controller","modules/console/expdesktop/pop/dataset/controller","modules/console/expdesktop/pop/exception/controller","modules/console/expdesktop/pop/msg/controller","modules/console/expdesktop/pop/vpn/controller","modules/console/expdesktop/pop/questions/controller","toolbar","toastr","overlayscrollbars","text!modules/console/expdesktop/lang.json","underscore","cookie","bdlanglang","webutil","videojs","text!modules/console/expdesktop/template/scrapbooking.html"],function(e,t,i,n,r,a,o,s,l,c,u,d,h,p,f,m,g,v,y,_,b,w,x,k,C,T,S,E,A){function I(e,t,n){this.container=e,this.language=t,this.appOptions=n,this.lang=x,this.vstep_id=null,this.step_id=null,this.group_id=null,this.course_id=null,this.isloading=!0,this.res_list={},this.timer=null,this.temp_ips=[],this.progresstimer=null,this.n=0,this.reconnect=1,this.vmlayout=null,this.layouttype="east",this.exp_width=360,this.windpi={sm:768,md:992,lg:1200},this.ishind=!1,this.dragDocInit=172,this.dragDoc=182,this.windowWidth=i(window).width(),this.imgClick=!1,this.remain_time=0,this.overtimeLayer="",this.rfb=null,this.shanhe_ws=null}var D={initAvalon:function(t){var r=this;t.events.desktop_tools_hide=r.tools_hide_fun.bind(this),t.events.desktop_tools_show=r.tools_show_fun.bind(this),t.events.desktop_editormd_hide=r.editormd_hide_fun.bind(this),t.events.desktop_editormd_show=r.editormd_show_fun.bind(this),t.events.desktop_editormd_maximize=r.editormd_maximize_fun.bind(this),t.events.view_attachment=function(t){var i=t.api_url.split(".");"pdf"===i[i.length-1]?layer.open({id:t.id,type:2,title:t.file_name,shadeClose:!0,shade:!1,maxmin:!0,area:["1000px","90%"],content:e.getDomain(e.domain_type.step_att)+t.api_url}):window.open(e.getDomain(e.domain_type.step_att)+t.api_url)},t.events.step_video=function(e){r.service.video_study_record({video_id:e.id}).done(function(t){r.video_open(e,t.studyrecord[0])})},t.events.change_vm_name=function(t){var i=t.id;r.data.step.instance_id=i,r.set_protocols();var n=r.res_list[i];r.data.step.ip=n.ip,r.data.step.os_password=n.os_password,r.data.step.os_username=n.os_username,r.data.step.op_system_type=n.type,r.data.step.os_type=n.os_type,n.type===e.op_system_type.interact?r.set_interacts():r.field_interacts.data=[],r.setvm_param(),r.data.guac_file_current_path="/"},t.events.change_interacts=function(e){r.data.step.lab_interact_code=e.lab_interact_code,r.data.step.lab_interact_id=e.lab_interact_id,r.setvm_param()},t.events.change_protocols=function(e){var t=e.id;if(r.data.step.protocol==t)return!1;r.data.step.protocol=t,r.setvm_param()},t.events.extensionop=function(e){r.data.step.extension.select=e.field},t.events.select_vpnoption=function(t){switch(t.field){case"vpn_conn":if("active"!==r.data.step.vpn_info.status){var i=layer.load(3);r.service.exchange_vpn({lab_id:r.vstep_id,mode:"study"}).done(function(t){e.msg_success("vpn连接成功!"),r.data.step.vpn_info.status=t.status,r.data.step.vpn_exchange.data[0].disabled=!0}).fail(function(){e.msg_error("vpn连接失败")}).always(function(){layer.close(i)})}break;case"vpn_view":if("init"!==r.data.step.vpn_info.status){new v(r.language,r.appOptions,r.service,{lab_id:r.vstep_id,mode:"study",vpn_info:r.data.step.vpn_info},function(){}).show()}}},t.$watch("step.allow_vpn",function(e){e&&(r.data.step.extension.select="vpn_exchange"),r.data.step.extension.data[0].hide=!e}),t.$watch("step.vpn_info.status",function(e){e&&(r.data.step.vpn_exchange.data[0].disabled="active"===r.data.step.vpn_info.status,r.data.step.vpn_exchange.data[1].disabled="init"===r.data.step.vpn_info.status)}),t.$watch("step.res_list",function(e){e&&(r.set_vm_ips(),r.set_interacts())}),t.$watch("vm_param",function(e){e&&(r.vm_is_refresh(),r.show_vm())}),t.$watch("step.progress",function(e){r.isloading&&r.loading()}),t.$watch("step_msg",function(t){t&&e.msg_info(t)}),t.$watch("is_fullscreen",function(t){r.data.is_onresize=!1,t?e.fullScreen()&&(r.field_fullscreen.title=r.i18n.exitfullscreen):e.exitFullScreen()&&(r.field_fullscreen.title=r.i18n.fullscreen)}),t.$watch("vm_status",function(t){switch(t==e.vm_status.running?r.field_lookrecover.title="已保存实验":r.field_lookrecover.title="恢复实验",e.vm_status.creating===t||e.vm_status.closing===t?(clearTimeout(r.creatingTimer),r.creatingTimer=setTimeout(function(){r.field_forced_close.hide=!1},18e4)):(r.field_forced_close.hide=!0,clearTimeout(r.creatingTimer)),t){case e.vm_status.creating:r.field_create.title=r.i18n.creating,r.field_create.enabled=!1,r.field_create.hide=!1,r.field_vm_name.data=[],r.field_interacts.data=[],r.field_protocols.data=[],r.field_refresh.hide=!0,r.field_fullscreen.hide=!0,r.field_close.hide=!0,r.field_viewtype.hide=!0,r.data.is_start=!0,r.field_saveexp.hide=!0,r.field_lookrecover.hide=!0,r.field_delay.hide=!0,r.field_scrapbooking.hide=!0,n.send("console-creating",{id:r.vstep_id});break;case e.vm_status.running:r.field_create.hide=!0,r.field_vm_name.hide=!1,r.field_close.hide=!1,r.field_close.title=r.i18n.close,r.field_close.enabled=!0,r.field_refresh.hide=!1,r.field_fullscreen.hide=!1,r.field_scrapbooking.hide=!1,r.data.is_start=!0,"true"==r.data.allow_save?r.field_saveexp.hide=!1:r.field_saveexp.hide=!0,r.field_lookrecover.hide=!1,"false"==r.data.allow_delay?r.field_delay.hide=!0:r.field_delay.hide=!1,n.send("console-running",{id:r.vstep_id,remain_time:r.remain_time});break;case e.vm_status.closing:r.field_close.hide=!1,r.field_close.enabled=!1,r.field_close.title=r.i18n.closing,r.field_create.hide=!0,r.field_refresh.hide=!0,r.field_fullscreen.hide=!0,r.field_viewtype.hide=!0,r.field_scrapbooking.hide=!0,r.field_vm_name.data=[],r.field_interacts.data=[],r.data.step.token="",r.field_protocols.data=[],r.data.is_start=!0,r.field_saveexp.hide=!0,r.field_lookrecover.hide=!0,r.field_delay.hide=!0;break;case e.vm_status.closed:r.field_close.hide=!0,r.field_create.hide=!1,r.field_create.title=r.i18n.create,r.field_create.enabled=!0,r.field_vm_name.data=[],r.field_interacts.data=[],r.data.step.token="",r.field_protocols.data=[],r.field_refresh.hide=!0,r.field_fullscreen.hide=!0,r.field_viewtype.hide=!0,r.field_scrapbooking.hide=!0,r.data.step.progress=0,r.data.is_start=!1,r.field_saveexp.hide=!0,r.field_lookrecover.hide=!1,r.field_delay.hide=!0,n.send("console-closed",{id:r.vstep_id});break;case e.vm_status.error:r.field_close.hide=!0,r.field_create.hide=!1,r.field_create.title=r.i18n.create,r.data.step.token="",r.field_vm_name.data=[],r.field_interacts.data=[],r.field_protocols.data=[],r.field_refresh.hide=!0,r.field_fullscreen.hide=!0,r.field_viewtype.hide=!0,r.data.step.progress=0,r.data.is_start=!1,r.field_create.enabled=!1,r.field_lookrecover.hide=!0,r.field_saveexp.hide=!0,r.field_delay.hide=!0,r.field_scrapbooking.hide=!0}}),window.onresize=function(){e.checkFull()?r.field_fullscreen.title=r.i18n.exitfullscreen:r.field_fullscreen.title=r.i18n.fullscreen;var t=i(window).height();r.container.find("#displayvm").height(t);var n=i(window).width();r.container.find("#displayvm").width(n),r.container.find(".expDesktop_head_wrap").width(.9*n),r.set_vm_scale(),r.msg.init()},t.events.changetabs=function(e,t){for(var i=0;i<r.data.doctabs.length;i++)r.data.doctabs[i].active=!1;if(e.active=!0,"report"==e.field){new l("content",r.data,r.service).init()}else"material"==e.field?r.get_step_attachment():"evaluation"==e.field?r.comment.init():"video"==e.field&&r.get_step_video()},t.events.goback=function(){history.go(-1)}},setDataControl:function(e){this.dataControl=e,this.service=new u(this.dataControl),this.dataControl.addLisenter("step",this,this.socket),this.dataControl.addLisenter("assist",this,this.socket)},socket:function(t,n,r){var a=this;if(n=String(n),this.vstep_id===n&&t==e.vm_op_status.op_failed)return e.msg_error("实验环境创建失败"),a.close_vm(),void(a.data.vm_status=e.vm_status.closed);if(this.vstep_id===n&&(t===e.vm_status.creating||t===e.vm_status.running)&&"study"===r.data.mode){if(a.data.vm_status=e.vm_status.creating,a.data.step.progress=r.data.progress,!r.data.is_complete)return;a.remain_time=r.data.remain_time,a.data.vm_status=e.vm_status.running,a.data.step.progress=0,this.setTime(r.data.remain_time);var o={allow_vpn:r.data.allow_vpn,vpn_info:r.data.vpn_info,protocol:r.data.current_res.res_conn.filter(function(e){return 1==e.default})[0].protocol,instance_id:r.data.current_res.instance_id,token:r.data.current_res.vm_token,ip:r.data.current_res.ip,os_password:r.data.current_res.os_password,os_username:r.data.current_res.os_username,os_type:r.data.current_res.os_type.toLowerCase(),op_system_type:r.data.current_res.type,lab_interact_code:r.data.current_res.lab_interact_code,lab_interact_id:r.data.current_res.lab_interact_id};i.extend(a.data.step,o),this.setvm_param(),this.data.step.res_list=r.data.res_list}if(this.vstep_id===n&&"time_remind"===r.action&&"study"===r.data.mode&&(a.data.timeout.allSecond=r.data.remain_time,a.setTime(r.data.remain_time),a.overtime()),this.vstep_id===n&&"end"===r.data.stage&&(r.action===e.vm_status.time_end||r.action===e.vm_status.closing))if("time_end"===r.action)e.msg_warning(a.i18n.study_timeout,null,{closeButton:!0,onCloseClick:function(){a.close_vm()},onHidden:function(){a.close_vm()}});else if("lab_delete"===r.action){var s=layer.alert("此次实验您学习了大约"+r.eff_time+"分钟,继续努力!",{title:a.data.getGroup_res_data.title,closeBtn:1,icon:6},function(){layer.close(s)});a.close_vm()}else a.close_vm();"realtime"!==r.action&&"exception_order"!==r.action||r.data.course_id!=a.course_id&&r.data.group_id!=a.group_id&&r.data.step_id!=a.vstep_id||(r.data.action=r.action,a.msg.setContent(r.data))},setvm_param:function(){var t=this;t.data.vm_param={token:t.data.step.token,protocol:t.data.step.protocol,instance_id:t.data.step.instance_id,os_type:t.data.step.os_type,op_system_type:t.data.step.op_system_type,lab_interact_code:t.data.step.lab_interact_code,lab_interact_id:t.data.step.lab_interact_id,is_ready:t.data.step.is_ready},t.data.is_fullscreen=e.checkFull()},show_vm:function(){var t=this;if(vm_width=window.screen.width,vm_height=window.screen.height,t.data.vm_param.token){var n=String(t.data.vm_param.token),o=t.data.vm_param.protocol,s=t.data.vm_param.instance_id,l=t.data.vm_param.op_system_type,u=t.data.vms;for(var d in u)u[d].clear&&u[d].clear();if(l!==e.op_system_type.interact){var h="vm_token="+n+"&vm_protocol="+o+"&vm_resid="+s+"&vm_width="+vm_width+"&vm_height="+vm_height+"&mode=study",p={i18n:t.i18n,tunnel_url:SDC.sock_type+"://"+SDC.guacHost,url:h,protocol:o,os_type:t.data.vm_param.os_type,token:n,box_width:i(".expDesktop_editormd_box").width()},f=new r(t.container.find("#display"),p,t.data,function(e){t.data.show_vm.code_data={vm_protocol:o,step_id:t.vstep_id,vm_resid:s,type:"study",os_type:t.data.vm_param.os_type},t.code=new c(t.data,t.service,e),t.code.init("start")});t.guac_init=f.init(),u[s]=f}else{t.data.step.box_width=i(".expDesktop_editormd_box").width();var m=new a(t.container.find("#displaynotebook"),t.data.step);t.interact_init=m.init(),u[s]=m}}},show_vm_bak2:function(){var t=this;if(!t.data.vm_param.is_ready)return!1;vm_width=window.screen.width,vm_height=window.screen.height;var n=(String(t.data.vm_param.token),t.data.vm_param.protocol),r=t.data.vm_param.instance_id,o=t.data.vm_param.op_system_type,s=t.data.vms;for(var l in s)s[l].disconnect&&s[l].disconnect();if(o!==e.op_system_type.interact)t.initNoVnc(s);else{t.data.step.box_width=i(".expDesktop_editormd_box").width();var u=new a(t.container.find("#displaynotebook"),t.data.step);t.interact_init=u.init(),s[r]=u}t.data.show_vm.code_data={vm_protocol:n,step_id:t.vstep_id,vm_resid:r,type:"study",os_type:t.data.vm_param.os_type},t.code=new c(t.data,t.service),t.code.init("start")},set_vm_scale:function(){var e=this,t=e.data.vms,n=i(window).width();e.ishind||(n=i(window).width()-e.exp_width),t[e.data.vm_param.instance_id]&&t[e.data.vm_param.instance_id].set_vm_scale(n)},set_vm_ips:function(){var e=this,t=e.data.step.res_list;e.field_vm_name.data=[],t.forEach(function(t){e.field_vm_name.data.push({id:t.instance_id,title:t.res_name}),e.data.step.vm_models[t.instance_id]=t.res_conn,e.res_list[t.instance_id]=t}),e.field_vm_name.value=e.data.step.instance_id,e.set_protocols()},set_interacts:function(){var t=this,i=t.data.step.res_list;t.field_interacts.data=[],i.forEach(function(i){i.type===e.op_system_type.interact&&i.instance_id===t.data.step.instance_id&&(t.field_interacts.data=i.interact_list)}),t.field_interacts.data.length&&(t.data.step.lab_interact_code=t.field_interacts.data[0].lab_interact_code,t.data.step.lab_interact_id=t.field_interacts.data[0].lab_interact_id),t.field_interacts.value=t.data.step.lab_interact_code},set_protocols:function(){var e=this;e.field_protocols.data=[];var t=[],i=e.data.step.vm_models[e.data.step.instance_id];i&&i.forEach(function(i){t.push({id:i.protocol,guac_id:i.guac_id,title:e.i18n[i.protocol]})}),e.field_protocols.data=t,1!==t.length&&e.data.step.protocol||!t.length||(e.data.step.protocol=t[0].id),e.field_protocols.value=e.data.step.protocol},setTime:function(e){var t=this;this.timer&&clearInterval(this.timer),t.data.timeout.allSecond=e;var i=t.data.timeout,n=Math.floor(e/86400);i.day=n,i.hour=Math.floor(e/3600),i.hour.toString().length<2&&(i.hour="0"+i.hour),i.minute=Math.floor((e-3600*i.hour)/60),i.minute.toString().length<2&&(i.minute="0"+i.minute),i.second=Math.floor(e-3600*i.hour-60*i.minute),i.second.toString().length<2&&(i.second="0"+i.second);var r=0;this.timer=setInterval(function(){if((r+=1)>e)clearInterval(t.timer),i.day="0",i.hour="00",i.minute="00",i.second="00",t.data.timeout.allSecond=0;else{var n=e-r;t.data.timeout.allSecond=n;var a=Math.floor(n/86400);i.day=a,i.hour=Math.floor(n/3600),i.hour.toString().length<2&&(i.hour="0"+i.hour),i.minute=Math.floor((n-3600*i.hour)/60),i.minute.toString().length<2&&(i.minute="0"+i.minute),i.second=Math.floor(n-3600*i.hour-60*i.minute),i.second.toString().length<2&&(i.second="0"+i.second)}},1e3)},close_vm:function(){var t=this;t.code&&t.code.init("end");for(var i in t.data.vms){var n=t.data.vms[i];n.clear&&n.clear(),n=null}t.data.step.progress=0,t.data.vm_param="",t.data.step.token="",t.data.step.protocol="",t.data.step.instance_id="",t.data.step.res_list=[],t.data.step.vm_models=[],t.data.step.ip="",t.data.step.os_password="",t.data.step.os_username="",t.data.step.os_type="",t.data.step_msg="",e.exitFullScreen(t.data),e.checkFull()&&!(document.webkitIsFullScreen||document.msFullscreenElement||document.mozFullScreen||document.fullscreen)&&e.msg_info("请按(F11)退出全屏"),t.data.is_fullscreen=!1,t.setTime(0),layer.close(t.overtimeLayer),t.data.vm_status=e.vm_status.closed},loading:function(){var t=this;t.isloading=!1;var i=document.getElementById("c");e.shuidi_loading(i,function(e){return t.data.step.progress},function(e){t.data.step.progress&&100!==t.data.step.progress||(cancelAnimationFrame(e),t.container.find("#vm_progress").addClass("hide"),t.isloading=!0)})},clearfacus:function(){this.container.find("input").blur(),this.container.find("select").blur()},checkCourseStep:function(t){var n=this;this.service.check_courseStep(t).done(function(t){if(n.data.lab_save_count=t.lab_save_count,0!=n.data.lab_save_count&&n.data.lab_save_count||(n.field_lookrecover.hide=!0),t.status===e.vm_op_status.op_failed)return void(n.data.vm_status=e.vm_status.closed);if(t.action===e.vm_status.closed)return void(n.data.vm_status=e.vm_status.closed);if(t.action===e.vm_status.creating&&(n.data.vm_status=e.vm_status.creating),t.action_info.is_complete){var r={allow_vpn:t.action_info.allow_vpn,vpn_info:t.action_info.vpn_info,protocol:t.action_info.current_res.res_conn.filter(function(e){return 1==e.default})[0].protocol,instance_id:t.action_info.current_res.instance_id,token:t.action_info.current_res.vm_token,ip:t.action_info.current_res.ip,os_password:t.action_info.current_res.os_password,os_username:t.action_info.current_res.os_username,os_type:t.action_info.current_res.os_type.toLowerCase(),op_system_type:t.action_info.current_res.type,is_ready:!0,lab_interact_code:t.action_info.current_res.lab_interact_code,lab_interact_id:t.action_info.current_res.lab_interact_id};i.extend(n.data.step,r),n.setvm_param(),n.data.step.res_list=t.action_info.res_list,n.remain_time=t.action_info.remain_time,n.setTime(t.action_info.remain_time),n.data.vm_status=e.vm_status.running}})},setData:function(t){var n=this;t&&(n.vstep_id=t,n.data.vstep_id=t,layui.use("element",function(){layui.element}),n.tools_show_fun(),n.editormd_show_fun(),this.service.getGroup_courseStep(t).done(function(t){if(n.group_id=t.group_id,n.course_id=t.course_id,n.data.desktop_title=t.title,n.data.getGroup_res_data=t,n.data.allow_save=t.step_manage_spec.allow_save||"false","true"==n.data.allow_save&&n.data.vm_status==e.vm_status.running?n.field_saveexp.hide=!1:n.field_saveexp.hide=!0,n.data.allow_delay=t.step_manage_spec.allow_delay||"false",n.data.password_view=t.step_manage_spec.allow_savepsd||"false",n.data.isloaded=!0,n.step_id=t.id,"pub_course"!==n.data.getGroup_res_data.c_type&&"contest_course"!==n.data.getGroup_res_data.c_type&&(n.data.doctabs[2].show=!0),"contest_course"==n.data.getGroup_res_data.c_type&&(n.data.doctabs[1].show=!1),n.container.find("#docmarkdown").empty(),n.container.find("#docmarkdown").css({height:"100%"}),"markdown"==t.doc_source){n.container.find("#docmarkdown").html('<div style="width: 100%;height: 100%;"><div style="width: 100%;height: 100%;overflow-y: auto"><div id="docmarkdown_doc"><textarea id="step_content" style="width:auto;display:none;"></textarea></div></div></div>');new s("docmarkdown_doc",{markdown:t.step_doc,image_Remote_URL:e.getDomain(e.domain_type.step)}).init()}else if("file"==t.doc_source){var r="/static/public/lib/pdfjs/web/viewer.html?file="+encodeURIComponent("/pdf_download?file_url="+n.fill_address(t)),a=i('<iframe id="docmarkdown_doc" style="width: 100%;height: 100%;padding-top: 40px;box-sizing: border-box;"></iframe>');n.container.find("#docmarkdown").html(a),a.attr("src",r)}n.comment=new o(n.step_id,n.container,n.data,n.service)}).fail(function(){}),n.checkCourseStep(n.data.vstep_id))},get_step_attachment:function(){var e=this,t=e.data.getGroup_res_data;e.service.step_attachment({course_id:t.course_id,step_id:t.id}).done(function(t){t.step_attachment_list.forEach(function(e){e.size=Math.floor(e.size/1024)}),e.data.step_attachment_list=t.step_attachment_list})},get_assist_list:function(t){var i=this;i.data.step_msg="",this.service.get_assist_list({step_id:t,type:e.Assist_type.assisted}).done(function(e){if(e.assist_list&&e.assist_list.length){var t=e.assist_list[e.assist_list.length-1];i.data.assist_process_token=t.process_token,i.get_assist_status(t)}})},get_assist_status:function(e){var t=this;switch(e.status){case"inited":t.data.step_msg="正在向"+e.op_user_real_name+"发起协助请求",t.data.is_assist=!0;break;case"accepted":t.data.step_msg=e.op_user_real_name+t.i18n[e.status]+"了发起的协助请求",t.data.is_assist=!0;break;case"rejected":case"completed":t.data.step_msg=e.op_user_real_name+t.i18n[e.status]+"了发起的协助请求",t.data.is_assist=!1;break;case"established":t.data.step_msg=e.op_user_real_name+"正在协助,请务断开",t.data.is_assist=!0;break;case"error":case"timeout":t.data.step_msg="向"+e.op_user_real_name+"发起协助请求"+t.i18n[e.status],t.data.is_assist=!1}},refreshData:function(e){this.setData(e)},getCookie:function(e){var t=null;if(document.cookie&&""!=document.cookie)for(var i=document.cookie.split(";"),n=0;n<i.length;n++){var r=jQuery.trim(i[n]);if(r.substring(0,e.length+1)==e+"="){t=decodeURIComponent(r.substring(e.length+1));break}}return t},csrfSafeMethod:function(e){return/^(GET|HEAD|OPTIONS|TRACE)$/.test(e)},resizeScreen:function(){var e=this;if(e.data.vms[e.data.vm_param.instance_id]){var t=$D("noVNC_screen");t.style.overflow="hidden";var i=Util.getPosition(t),n=i.width,r=i.height,a=e.data.vms[e.data.vm_param.instance_id].get_display(),o=a.autoscale(n,r,!1);e.data.vms[e.data.vm_param.instance_id].get_mouse().set_scale(o)}},initNoVnc:function(e){var t=this,n=(i("#noVNC_canvas"),i(".alert")),r=i(".btn-primary"),a=i(".copyText"),o=(i(".copyBtn"),i(".window-overlay")),s=t.data.vm_param.instance_id;"linux"===t.data.vm_param.os_type&&(i("#sendCtrlAltDelButton").remove(),i(".fullscreen").remove());var l="https:"===location.protocol;Util.load_scripts(["webutil.js"]),window.onscriptsload=function(){function c(e){o.hide(),n.removeClass("alert-success").addClass("alert-danger"),e?a.css({"border-color":"#d5dee7"}):a.css({"border-color":"#d5dee7"}).val(""),r.removeClass("btn-forbidden").prop("disabled",!1),d.grab()}var u=new RFB({target:$D("noVNC_canvas"),encrypt:l,onFBResize:function(){t.resizeScreen()},onUpdateState:function(e,t,i,n){switch(t){case"disconnected":case"normal":break;default:return}}});e[s]=u;var d=u.get_keyboard();t.container.delegate('button[name="copytext"]:not(.disabled)',"click",function(){d.ungrab(),o.show(),a.focus()}),i(".btn-cancel, .close").on("click",function(e){c()}),i(".copyText").on("keyup",function(e){a.val().match(/^[ #%\x00-\xff]+$/)?(n.removeClass("alert-danger").addClass("alert-success"),a.css({"border-color":"#00aa72"}),r.removeClass("btn-forbidden").prop("disabled",!1)):(n.removeClass("alert-success").addClass("alert-danger"),a.css({"border-color":"#ca2621"}),r.addClass("btn-forbidden").prop("disabled",!0))}),i(".btn-primary").on("click",function(e){e.preventDefault(),c(!0);var t=a.val();u.copyPasteMultiStatement(t),a.val("")}),i("#sendCtrlAltDelButton").on("click",function(e){u.sendCtrlAltDel()}),i("#sendCtrlAltBackspaceButton").on("click",function(e){u.sendCtrlAltBackspace()}),i("#sendMemoryDumpButton").on("click",function(e){u.sendRightCtrlScrollLock()}),i(".sendCtrlAltFunctionButton").on("click",function(e){var t=i(this).attr("data-n");u.sendCtrlAltFunction(t)}),t.resizeScreen(),u.connect("cb0jn1a.shanhe.com","12167","Jznx2Yky8zLMdqavoOjKJ0RPcwW7xxhz","i-vsvif3cp")}},handleWsCenterShanheConnect:function(t){var i=this;switch(t[0]){case"5":var n=JSON.parse(t.slice(9));if("get_event_ack"==n.name){switch(n.args[0].rtype){case"job":var r=n.args[0].resource_set[0].job_id;console.log("job_id="+r),console.log(i.data.shanhe_instance_info.instances.length);for(var a=0;a<i.data.shanhe_instance_info.instances.length;a++)if(r==i.data.shanhe_instance_info.instances[a].job_id){var o=n.args[0].resource_set[0].job_action,s=n.args[0].resource_set[0].status;if("StartInstances"!=o&&"RunInstances"!=o||(console.log("...正在开机..."),i.data.job_action_start_or_stop="start"),"successful"==s){console.log("job成功"),console.log(a),i.data.shanhe_instance_info.instances[a].ready=!0;for(var l=!0,a=0;a<i.data.shanhe_instance_info.instances.length;a++)i.data.shanhe_instance_info.instances[a].ready||(l=!1);l&&"start"==i.data.job_action_start_or_stop&&(i.data.vm_status=e.vm_status.creating,i.data.step.progress=90,setTimeout(function(){i.data.step.progress=100,i.checkCourseStep(i.data.vstep_id)},4e3),console.log("总的开机完成"))}}if(r==i.data.shanhe_instance_close_vm_info.job_id){var o=n.args[0].resource_set[0].job_action,s=n.args[0].resource_set[0].status;"StopInstances"!=o&&"TerminateInstances"!=o||(console.log("...正在关机..."),i.data.job_action_start_or_stop="stop"),"successful"==s&&(console.log("总的关机完成"),i.close_vm())}break;case"instance":for(var c=n.args[0].resource_set[0].instance_id,a=0;a<i.data.shanhe_instance_info.instances.length;a++)if(c==i.data.shanhe_instance_info.instances[a].instance_id){var u=n.args[0].resource_set[0].transition_status;"stopping"!=u&&"terminating"!=u||(console.log("正在关机"),i.data.job_action_start_or_stop="stop"),"stopped"!=u&&"terminated"!=u||(console.log("已关闭"),i.data.job_action_start_or_stop="stop"),"starting"!=u&&"creating"!=u||(console.log("正在开机"),i.data.step.progress+=15,i.data.job_action_start_or_stop="start"),"running"!=u&&"created"!=u||(console.log("已开机"),i.data.job_action_start_or_stop="start")}}}}},wsShanheConnect:function(){var e=this;this.service.get_shanhe_ws_region().done(function(t){if(t.indexOf("websocket")>=0){var i=t.split(":")[0];e.data.shanhe_ws||(e.shanhe_ws=new WebSocket("wss://console.shanhe.com:8000/socket.io/1/websocket/"+i+"?uid=usr-JmBnpZBb&sid=FZlvYkQk5NeaACYhRrsKIDE6tNh3X0Z5&zid=jn1"),e.shanhe_ws.onopen=function(){e.shanhe_ws.send("1::/user"),setInterval(function(){e.shanhe_ws.send("2::")},12e3)},e.shanhe_ws.onmessage=function(t){var i=t.data;"1::/user"==i&&e.shanhe_ws.send('5::/user:{"name":"get_event"}'),e.handleWsCenterShanheConnect(i)},e.shanhe_ws.onclose=function(t){setTimeout(function(){e.shanhe_ws=null,e.wsShanheConnect()},2e4)},e.shanhe_ws.onerror=function(e){console.log(e)})}}).fail(function(e){console.log(e)})},onInitialize:function(t){var n=this,r=this.getCookie("csrftoken");i.ajaxSetup({crossDomain:!1,beforeSend:function(e,t){n.csrfSafeMethod(t.type)||e.setRequestHeader("X-CSRFToken",r)}}),this.initialized=!0,this.DragLeftBar(),this.DragDoc(),this.DragTime();var a=i(window).height();if(n.container.find("#displayvm").height(a),n.container.find(".console-ullist").removeClass("hide"),n.container.find(".expDesktop_head_wrap").width(.9*i(window).width()),n.container.find(".right-toolbar").overlayScrollbars({scrollbars:{autoHide:"l",autoHideDelay:100}}),t){n.vstep_id=t;for(var o=0;o<n.data.step.fields.length;o++){var s=n.data.step.fields[o];n["field_"+s.field]=s}n.field_vm_name=n.data.step.vm_name,n.field_protocols=n.data.step.protocols,n.field_interacts=n.data.step.interacts,localStorage.getItem(SDC.user.user_id+"_"+n.vstep_id)||localStorage.setItem(SDC.user.user_id+"_"+n.vstep_id,10),n.setData(t),msg=new g,n.msg=msg.init(),n.container.delegate('button[name="create"]:not(.disabled)',"click",function(){n.imgClick=!0,n.container.find('button[name="create"]').addClass("disabled"),n.data.step.progress=25,n.data.vm_status=e.vm_status.creating,n.service.create_vm({step_id:t}).done(function(e){e.instances.forEach(function(e){e.ready=!1}),n.data.shanhe_instance_info=e}).fail(function(t){var i=JSON.parse(t.responseText);if(n.container.find('button[name="create"]').removeClass("disabled"),i.code)switch(i.code){case 50003:case 50004:case 50005:break;default:n.data.vm_status=e.vm_status.closed}n.data.vm_status=e.vm_status.closed})}),n.container.delegate(".console_bg_img img","click",function(){var r=this;n.imgClick=!0,n.container.find('button[name="create"]').addClass("disabled"),n.data.step.progress=25,n.data.vm_status=e.vm_status.creating,n.service.create_vm({
|
||
step_id:t}).done(function(t){t.instances.forEach(function(e){e.ready=!1}),n.data.shanhe_instance_info=t,n.data.vm_status=e.vm_status.creating,n.imgClick=!1,i(r).attr({src:"/static/public/img/console_bg_img.png"})}).fail(function(t){var a=JSON.parse(t.responseText);if(n.imgClick=!1,i(r).attr({src:"/static/public/img/console_bg_img.png"}),n.container.find('button[name="create"]').removeClass("disabled"),a.code)switch(a.code){case 50003:case 50004:case 50005:break;default:n.data.vm_status=e.vm_status.closed}n.data.vm_status=e.vm_status.closed})}),n.container.delegate(".console_bg_img","mouseover",function(){n.imgClick||i(this).find("img").attr({src:"/static/public/img/console_bg_img_hover.png"})}),n.container.delegate(".console_bg_img","mouseout",function(){n.imgClick||i(this).find("img").attr({src:"/static/public/img/console_bg_img.png"})}),n.container.delegate('button[name="help"]:not(.disabled)',"click",function(){new d(n.language,n.appOptions,n.service,t,function(e){n.data.current_assister=e.op_user,n.data.current_assis_type=e.op_type,n.get_assist_list(t)}).show()}),n.container.delegate('button[name="unhelp"]:not(.disabled)',"click",function(){n.dataControl.message.confirm(n.i18n.cancel,n.i18n.assist,function(e){n.service.cancel_assist({token:n.data.assist_process_token}).done(function(){n.data.is_assist=!1}),layer.close(e)})}),n.container.delegate('button[name="forced_close"]:not(.disabled)',"click",function(){i(this).blur(),layer.confirm("是否强制关闭实验环境?",{title:n.i18n.close},function(i){n.vm_is_refresh(),layer.close(i),n.service.self_clean_resource({mode:"study",step_id:t}).done(function(){n.data.vm_status=e.vm_status.closing}).fail(function(t){e.msg_error(t.responseJSON.message)})},function(e){layer.close(e)})}),n.container.delegate('button[name="close"]:not(.disabled)',"click",function(){i(this).blur(),layer.confirm("实验环境将被删除,确定关闭?",{title:n.i18n.close},function(i){n.vm_is_refresh(),layer.close(i),n.service.close_vm(t).done(function(t){n.data.vm_status=e.vm_status.closed,n.data.shanhe_instance_close_vm_info=t}).fail(function(e){})},function(e){layer.close(e)})}),n.container.delegate('button[name="lookrecover"]:not(.disabled)',"click",function(){var t=!0;n.data.vm_status==e.vm_status.running&&(t=!1),new h(n.language,n.appOptions,n.service,t,n.data.getGroup_res_data,function(t){if("delete"==t)return n.data.lab_save_count=n.data.lab_save_count-1,0!=n.data.lab_save_count&&n.data.lab_save_count||(n.field_lookrecover.hide=!0),!1;var i={step_id:n.data.getGroup_res_data.rel_c_s_g_id,lab_save_id:t.id};n.container.find('button[name="create"]').addClass("disabled"),n.service.recover_lab(i).done(function(t){204==t.op_code?layer.confirm("ip已经被占用是否切换其他ip?",{btn:["确定","取消"]},function(t){layer.close(t),i.retry_keep_ip=!1,n.service.recover_lab(i).done(function(t){n.data.vm_status=e.vm_status.creating}).fail(function(t){n.data.vm_status=e.vm_status.closed,n.container.find('button[name="create"]').removeClass("disabled")})},function(){n.data.vm_status=e.vm_status.closed,n.container.find('button[name="create"]').removeClass("disabled")}):n.data.vm_status=e.vm_status.creating}).fail(function(t){n.data.vm_status=e.vm_status.closed,n.container.find('button[name="create"]').removeClass("disabled")})}).show()}),n.container.delegate('button[name="saveexp"]:not(.disabled)',"click",function(){new p(n.language,n.appOptions,n.service,n.vstep_id,function(e){n.data.lab_save_count=n.data.lab_save_count+1,n.field_lookrecover.hide=!1}).show()}),n.container.delegate('button[name="delay"]:not(.disabled)',"click",function(){if(n.data.timeout.allSecond>1800)var t=e.timeDivision(1800),i=e.timeDivision(n.data.timeout.allSecond),r="实验剩余时间 "+i+",剩余时间小于 "+t+"才可以延时",a=layer.alert(r,{title:"实验延时",closeBtn:1,icon:6},function(){layer.close(a)});else n.overtime()}),n.container.delegate('a[name="textcopy"]:not(.disabled)',"click",function(){var t=e.selectText();if(!t)return void e.msg_warning(n.i18n.noselectText);var i=n.data.vms;for(var r in i)i[r].guac_client&&i[r].guac_client.setClipboard(t);layer.tips("已复制",this,{tips:1,time:1e3})}),n.container.delegate(".document-copy","click",function(){for(var t=[],r=i(this).parent().find("code"),a=0;a<r.length;a++)code=r[a],t.push(i(code).text());if(!t.length)return void e.msg_warning(n.i18n.noselectText);var o=n.data.vms;for(var s in o)o[s].guac_client&&o[s].guac_client.setClipboard(t.join("\n"));layer.tips("已复制",this,{tips:1,time:1e3})}),n.container.delegate(".document-copy:not(.disabled)","mouseover",function(){n.copy_tip=layer.tips("复制内容",this,{tips:1,time:-1})}),n.container.delegate(".document-copy:not(.disabled)","mouseout",function(){n.copy_tip&&layer.close(n.copy_tip)}),n.container.delegate('button[name="refresh"]:not(.disabled)',"click",function(){i(this).blur(),n.vm_is_refresh(),n.show_vm()}),n.container.find("#btntoolbar").toolbar({content:"#toolbar-options",position:"bottom",style:"primary"}),n.container.find("#btntoolbar").on("toolbarItemClick",function(e,t,i){i.hide()}),n.container.find("#btntoolbar").on("toolbarShown",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.find("#btntoolbar").on("toolbarHidden",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.find("#docmarkdown").on("mouseup",function(){var t;if((t=document.selection?document.selection.createRange().text:window.getSelection()+"")&&n.data.vms){var r=e.getMousePos();if(i("#btntoolbar").css({left:r.x,top:r.y}),window.ActiveXObject||"ActiveXObject"in window){var a=n.data.vms;for(var o in a)a[o].guac_client&&a[o].guac_client.setClipboard(t);layer.tips("已复制","#btntoolbar",{tips:1,time:1e3})}else n.container.find("#btntoolbar").trigger("mouseover")}}),n.container.delegate('button[name="fullscreen"]',"click",function(){e.checkFull()?(e.exitFullScreen(n.data),e.checkFull()&&!(document.webkitIsFullScreen||document.msFullscreenElement||document.mozFullScreen||document.fullscreen)&&e.msg_info("请按(F11)退出全屏")):e.fullScreen(n.data)}),n.container.delegate('button[name="exception"]',"click",function(){new m(n.language,n.appOptions,n.service,t,function(){}).show()}),n.container.delegate('button[name="scrapbooking"]',"click",function(){var t=layer.open({title:"剪切板",shade:.6,resize:!1,area:"612px",btn:["保存","取消"],id:"sd-dialog-scrapbooking",success:function(e,t){e.find("textarea[name='sd-textarea-scrapbooking']").val(n.data.scrapbooking_text||"")},btn1:function(i,r){var a=r.find("textarea[name='sd-textarea-scrapbooking']").val();if(!a)return void e.msg_warning("请输入要复制的内容");var o=n.data.vms;for(var s in o)o[s].guac_client&&o[s].guac_client.setClipboard(a);e.msg_success("复制成功"),layer.close(t)},btn2:function(){layer.close(t)},cancel:function(e,i){layer.close(t)},content:A})}),n.container.delegate('button,input[type="button"]',"click",function(){i(this).blur()}),n.container.delegate("select","change",function(){i(this).blur()})}},overtime:function(){var t=this,n=e.timeDivision(3600),r=e.timeDivision(t.data.timeout.allSecond);t.overtimeLayer=layer.confirm("注意:实验剩余时间 "+r+",时间结束后实验会被删除,如需延长时间请点击“延时”按钮延时"+n+"。",{title:"实验即将结束",btn:["延时","取消"]},function(n){layer.close(n);var r={add_time:60,step_id:t.data.vstep_id};e.msg_info('<span id="confirm">正在延时,请稍后...</span>',null,{timeOut:0,extendedTimeOut:0}),t.service.overtime_server(r).done(function(e){i("#confirm").text("延时成功"),t.setTime(e.remain_time),setTimeout(function(){b.clear()},500)}).fail(function(e){i("#confirm").text("延时失败"),setTimeout(function(){b.clear()},1e3)})})},onClose:function(){this.content&&this.content.destroy(),this.container.remove()},getModelLabel:function(){return"expdesktop_view"},setDisabled:function(){this.data.reportBtn="disabled",UM.getEditor("content").setDisabled("fullscreen")},tools_hide_fun:function(){var e=i(window).width(),t=this;"max"==t.data.toggle.editormd_show&&i(".editormd-toggle").animate({left:e-26+"px"}),i(".hide-tools").css("display","block"),i(".show-tools").css("display","none"),i(".expDesktop_tool").animate({right:"-140px"},function(){t.data.toggle.tools_show="hide"})},tools_show_fun:function(){var e=i(window).width(),t=this;"max"==t.data.toggle.editormd_show&&i(".editormd-toggle").animate({left:e-26-140+"px"}),i(".hide-tools").css("display","none"),i(".show-tools").css("display","block"),i(".expDesktop_tool").animate({right:"0"},function(){t.data.toggle.tools_show="display"})},editormd_hide_fun:function(){var e=this;e.data.toggle.editormd_show="hide",e.ishind=!0,i(".hide-editormd").css("display","block"),i(".show-editormd").css("display","none"),i(".maximize-editormd").css("display","none"),i(".expDesktop_editormd").animate({left:-e.exp_width+"px"},function(){}),i(".editormd-toggle").animate({left:0},function(){}),i(".expDesktop_editormd_box").animate({width:0},function(){e.set_vm_scale()})},editormd_show_fun:function(){var e=this;e.data.toggle.editormd_show="display",e.data.editormd.editormd_show="显示文档";var t=document.getElementsByClassName("editormd-toggle-move")[0],n=document.getElementsByClassName("editormd-toggle")[0];i(t).show(),i(n).css({top:e.dragDoc+"px"}),e.ishind=!1,i(".hide-editormd").css({display:"none"}),i(".show-editormd").css({display:"block"}),i(".maximize-editormd").css("display","block"),i(".editormd-toggle").animate({left:e.exp_width-26+"px"}),i(".expDesktop_editormd").animate({width:e.exp_width+"px",left:0},function(){}),i(".expDesktop_editormd_box").animate({width:e.exp_width+"px"},function(){e.set_vm_scale()})},editormd_maximize_fun:function(){var e=this,t=0;e.data.toggle.editormd_show="max",e.data.editormd.editormd_show="还原文档","display"==e.data.toggle.tools_show&&(t=140);var n=document.getElementsByClassName("editormd-toggle-move")[0];i(n).hide();var r=i(window).width();i(".hide-editormd").css("display","block"),i(".show-editormd").css("display","none"),i(".maximize-editormd").css("display","none"),i(".editormd-toggle").animate({left:r-26-t+"px"}),i(".editormd-toggle").css({top:e.dragDocInit+"px"}),i(".expDesktop_editormd").animate({left:0,width:r+"px"}),i(".expDesktop_editormd_box").animate({width:r+"px"},function(){})},DragLeftBar:function(){var e=this,t=document.getElementsByClassName("shuidi-left-drag")[0],n=document.getElementsByClassName("expDesktop_editormd")[0],r=document.getElementsByClassName("expDesktop_editormd_box")[0],a=document.getElementsByClassName("editormd-toggle")[0];t.onmousedown=function(o){function s(t){t.preventDefault();var r=[0,0];r=c<e.windpi.sm?[100,420]:e.windpi.sm<=c&&c<e.windpi.md?[260,480]:e.windpi.md<=c&&c<e.windpi.lg?[320,600]:[320,800],r[1]>=c&&(r[1]=c);var o=(t||window.event).clientX;o<=r[0]?o=r[0]:o>=r[1]&&(o=r[1]);var s=o-u;i(n).width(d+s+"px"),i(".expDesktop_editormd_box").css({width:d+s+"px"},function(){}),i(a).css({left:d+s-26+"px"}),e.exp_width=d+s,e.set_vm_scale()}function l(){t.releaseCapture?(t.onmousemove=null,t.onmouseup=null,t.releaseCapture()):(document.removeEventListener("mousemove",s,!0),document.removeEventListener("mouseup",l,!0))}var c=i(window).width(),u=(o||window.event).clientX,d=i(r).width();t.setCapture?(t.onmousemove=s,t.onmouseup=l,t.setCapture()):(document.addEventListener("mousemove",s,!0),document.addEventListener("mouseup",l,!0))}},DragDoc:function(){var e=this,t=document.getElementsByClassName("editormd-toggle-move")[0],n=document.getElementsByClassName("editormd-toggle")[0];t.onmousedown=function(r){function a(t){t.preventDefault();var r=(t||window.event).clientY;r<=48?r=48:r>=l-10&&(r=l-10);var a=r-c;i(n).css({top:s+a+"px"}),e.dragDoc=s+a}function o(){t.releaseCapture?(t.onmousemove=null,t.onmouseup=null,t.releaseCapture()):(document.removeEventListener("mousemove",a,!0),document.removeEventListener("mouseup",o,!0))}var s=i(n).position().top,l=i(window).height(),c=(r||window.event).clientY;t.setCapture?(t.onmousemove=a,t.onmouseup=o,t.setCapture()):(document.addEventListener("mousemove",a,!0),document.addEventListener("mouseup",o,!0))}},DragTime:function(){var e=document.getElementsByClassName("console_residue_time")[0];e.onmousedown=function(t){function n(t){t.preventDefault();var n=(t||window.event).clientX;n<=40?n=40:n>=o-60&&(n=o-60);var r=n-s;i(e).css({left:a+r+"px"})}function r(){e.releaseCapture?(e.onmousemove=null,e.onmouseup=null,e.releaseCapture()):(document.removeEventListener("mousemove",n,!0),document.removeEventListener("mouseup",r,!0))}var a=i(e).position().left,o=i(window).width();a<=0&&(a=0,i(e).css({left:"0px"})),a>=o-100&&(a=o-100,i(e).css({left:a+"px"}));var s=(t||window.event).clientX;e.setCapture?(e.onmousemove=n,e.onmouseup=r,e.setCapture()):(document.addEventListener("mousemove",n,!0),document.addEventListener("mouseup",r,!0))}},vm_is_refresh:function(){this.guac_init&&(this.guac_init.options.refresh=!0)},get_step_video:function(){var e=this,t=e.data.getGroup_res_data;e.service.step_video({step_id:t.id}).done(function(t){e.data.step_video_list=t.video})},video_open:function(e,t){var i=this,n=null;layer.open({id:e.id,type:1,title:"视频播放器",shade:!1,maxmin:!0,area:["1000px","90%"],zIndex:100,content:'<video id="myVideo" width="1000px" height="700px" class="video-play-view video-js vjs-big-play-centered"></video>',success:function(r,a){i.get_video_test(e.id,function(r){n=i.video_play(e,t,r)})},cancel:function(e,t){n.dispose()},min:function(e,t){n.pause()}})},video_play:function(t,i,n){var r=this;if(!i){var a={action:"video_study_record",second:0,video_id:t.id,course_id:r.course_id,group_id:r.group_id,rel_c_s_g_id:r.data.getGroup_res_data.rel_c_s_g_id,test_true:0,test_count:0,start:!0};SDC.RegionOne.send(JSON.stringify(a))}var o=i?i.second:0,s=o,l=e.getDomain(e.domain_type.step_att)+t.url,c=o+10;return player=E("#myVideo",{controls:!0,autoplay:!1,language:"zh-CN",inactivityTimeout:!0,seeking:!1,controlBar:{playToggle:!0,currentTimeDisplay:!0,timeDivider:!0,durationDisplay:!0,remainingTimeDisplay:!1,volumePanel:{inline:!0},progressControl:{disabled:!0},children:[]},sources:[{src:l}]},function(){var i=this;Math.floor(t.second)===Math.floor(o)?i.currentTime(0):o>0&&layer.msg("上次观看到 "+e.formatSeconds(o)+" ,是否继续播放?",{time:1e4,zIndex:200000001,offset:"rt",btn:["继续","取消"],yes:function(e){layer.close(e),i.currentTime(s)}}),this.on("timeupdate",function(){if(1!==this.playbackRate()&&(this.playbackRate(1),this.currentTime(o)),this.currentTime()-o>.5&&s<this.currentTime())return void this.currentTime(o);Math.floor(this.currentTime())>Math.floor(s)&&c===Math.floor(this.currentTime())?(c+=10,r.video_study_record(t,this)):Math.floor(this.currentTime())>Math.floor(s)&&Math.floor(t.second)===Math.floor(this.currentTime())&&r.video_study_record(t,this),s<this.currentTime()&&(s=this.currentTime()),o=this.currentTime(),n.forEach(function(e,t){Math.floor(o)!==Math.floor(e.second)||e.status||(e.status=!0,i.pause(),r.Question(e))})}),this.on("ended",function(){})}),player},get_video_test:function(e,t){this.service.video_test({video_id:e}).done(function(e){var i=[],n=e.videotest,r=[];n.forEach(function(e){if(-1===r.indexOf(e.second)){var t={answer:JSON.parse(e.answer),test:JSON.parse(e.test),status:!1,second:e.second,id:e.id,video_id:e.video_id};i.push(t),r.push(e.second)}else i.forEach(function(t){t.second===e.second&&(t.answer=t.answer.concat(JSON.parse(e.answer)),t.test=t.test.concat(JSON.parse(e.test)))})}),t(i)})},Question:function(e){var t=this;new y(t.language,t.appOptions,t.step_id,t.data.getGroup_res_data.rel_c_s_g_id,e,t.service,function(e,i){var e={action:"video_study_record",second:e.second,video_id:e.video_id,course_id:t.course_id,group_id:t.group_id,rel_c_s_g_id:t.data.getGroup_res_data.rel_c_s_g_id,test_true:i.test_true,test_count:i.test_count};SDC.RegionOne.send(JSON.stringify(e))}).show()},video_study_record:function(e,t){var i=this,n={action:"video_study_record",second:Math.floor(t.currentTime()),video_id:e.id,course_id:i.course_id,group_id:i.group_id,rel_c_s_g_id:i.data.getGroup_res_data.rel_c_s_g_id,test_true:0,test_count:0};SDC.RegionOne.send(JSON.stringify(n))},fill_address:function(e){var t="";return"pub_course"==e.c_type?t=SDC.domain.pcourse_domain+e.doc_file:"v_course"==e.c_type?t=SDC.domain.vcourse_domain+e.doc_file:"s_course"==e.c_type&&(t=SDC.domain.icourse_domain+e.doc_file),t}};return i.extend(I.prototype,t.prototype),i.extend(I.prototype,D),I}),define("text!modules/console/docdesktop/lang.json",[],function(){return'{\r\n "config": {\r\n "annex_data":[],\r\n "submit_status":"",\r\n "report_list":0,\r\n "annex_number":0,\r\n "report_data":"",\r\n \r\n "page_id": "expdesltop_view_data_page",\r\n "desktop_title":"",\r\n "current_unfold": "docmarkdown",\r\n "step_msg": "",\r\n "conTitle": {\r\n "field": "contitle"\r\n },\r\n "editormd":{\r\n "editormd_show":"editormd_show_title"\r\n },\r\n "step_video_list":[],\r\n "step_attachment_list": [],\r\n "doctabs": [\r\n {\r\n "field": "docmarkdown",\r\n "active": true,\r\n "show": true,\r\n "type": "doc"\r\n },\r\n {\r\n "field": "evaluation",\r\n "active": false,\r\n "show": true,\r\n "type": "evaluation"\r\n },\r\n {\r\n "field": "report",\r\n "active": false,\r\n "show": false,\r\n "type": "report"\r\n },\r\n {\r\n "field": "material",\r\n "active": false,\r\n "show": true,\r\n "type": "material"\r\n },\r\n {\r\n "field": "video",\r\n "active": false,\r\n "show": true,\r\n "type": "video"\r\n }\r\n ],\r\n "vstep_id": "",\r\n "step_code_list": [],\r\n "isloaded": false,\r\n "getGroup_res_data": "",\r\n "course_evaluate": {\r\n "field": "course_evaluate",\r\n "score": 0,\r\n "isCreate": true,\r\n "comment": {\r\n "field": "comment",\r\n "value": ""\r\n },\r\n "tip": {\r\n "field": "evaluate_tip",\r\n "value": ""\r\n },\r\n "button": { "field": "send_comment" },\r\n "comment_list": [\r\n\r\n ]\r\n },\r\n "is_start":false,\r\n "course_id":0,\r\n "group_id":0,\r\n "reportData": "",\r\n "reportBtn": "",\r\n "comment": {\r\n "field": "comment",\r\n "value": ""\r\n },\r\n "button": {\r\n "field": "send_comment"\r\n },\r\n "comment_list": [\r\n\r\n ],\r\n "fields_report": [\r\n {\r\n "field": "completion",\r\n "type": "radio",\r\n "style": "vclass-name",\r\n "name": "radio",\r\n "value": 0,\r\n "data": [{\r\n "field": "all_status",\r\n "status": true,\r\n "value": 0\r\n },\r\n {\r\n "field": "section_status",\r\n "status": false,\r\n "value": 1\r\n },\r\n {\r\n "field": "undone_status",\r\n "status": false,\r\n "value": 2\r\n }\r\n ]\r\n },\r\n {\r\n "type": "ueditor",\r\n "field": "content",\r\n "value": ""\r\n }\r\n ],\r\n "fieldbuttons": [\r\n {\r\n "field": "save",\r\n "style": "save",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "savestep",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "docmarkdown": "文档",\r\n "video":"视频",\r\n "material": "随材",\r\n "evaluation": "评价",\r\n "send_comment": "发表",\r\n "all_status": "全部完成",\r\n "section_status": "部分完成",\r\n "undone_status": "未完成",\r\n "title": "实验报告",\r\n "save": "保存",\r\n "purpose": "实验目的",\r\n "savestep": "保存并提交",\r\n "name": "实验名称",\r\n "completion": "完成情况",\r\n "undone": "未完成原因",\r\n "content": "报告内容",\r\n "report": "报告",\r\n "grade": "给实验评分",\r\n "evaluate_tip": "还可以输入<span>{0}</span>字"\r\n }\r\n }\r\n}'}),define("modules/console/docdesktop/controller",["app-utils","modules/console/basecontroller","jquery","modules/console/expdesktop/model/document/controller","modules/console/expdesktop/model/comment/controller","modules/console/expdesktop/model/report/controller","modules/console/expdesktop/pop/questions/controller","modules/console/expdesktop/service","text!modules/console/docdesktop/lang.json","bdlanglang","videojs"],function(e,t,i,n,r,a,o,s,l,c,u){function d(e,t,i){this.container=e,this.language=t,this.appOptions=i,this.lang=l,this.vstep_id=null,this.step_id=null}var h={initAvalon:function(t){var i=this;t.events.changetabs=function(e,t){for(var n=0;n<i.data.doctabs.length;n++)i.data.doctabs[n].active=!1;if(e.active=!0,"report"==e.field){new a("content",i.data,i.service).init()}else"material"==e.field?i.get_step_attachment():"evaluation"==e.field?i.comment.init():"video"==e.field&&i.get_step_video()},t.events.view_attachment=function(t){var i=t.api_url.split(".");"pdf"===i[i.length-1]?layer.open({id:t.id,type:2,title:t.file_name,shadeClose:!0,shade:!1,maxmin:!0,area:["1000px","90%"],content:e.getDomain(e.domain_type.step_att)+t.api_url}):window.open(e.getDomain(e.domain_type.step_att)+t.api_url)},t.events.step_video=function(e){i.service.video_study_record({video_id:e.id}).done(function(t){i.video_open(e,t.studyrecord[0])})},t.course_evaluate.tip.value=t.course_evaluate.tip.title.replace(/\{\d\}/g,100),t.$watch("course_evaluate.comment.value",function(e){t.course_evaluate.tip.value=t.course_evaluate.tip.title.replace(/\{\d\}/g,100-e.length)}),t.events.send_comment=function(){i.comment&&i.comment.send_comment()}},setDataControl:function(e){this.dataControl=e,this.service=new s(this.dataControl)},setData:function(t){var i=this;t&&(i.vstep_id=t,layui.use("element",function(){layui.element}),this.service.getGroup_courseStep(t).done(function(t){if(i.data.desktop_title=t.title,i.data.getGroup_res_data=t,i.data.isloaded=!0,i.step_id=t.id,i.data.course_id=t.course_id,i.data.group_id=t.group_id,"pub_course"!==t.c_type&&(i.data.doctabs[2].show=!0),i.container.find("#docmarkdown").empty(),i.container.find("#docmarkdown").css({height:"100%"}),"markdown"==t.doc_source){i.container.find("#docmarkdown").html('<div style="width: 100%;height: 100%;"><div style="width: 100%;height: 100%;overflow-y: auto"><div id="docmarkdown_doc"><textarea id="step_content" style="width:auto;display:none;"></textarea></div></div></div>');new n("docmarkdown_doc",{markdown:t.step_doc,image_Remote_URL:e.getDomain(e.domain_type.step)}).init()}else if("file"==t.doc_source){var a="/static/public/lib/pdfjs/web/viewer.html?file="+encodeURIComponent("/pdf_download?file_url="+i.fill_address(t));i.container.find("#docmarkdown").html('<iframe id="docmarkdown_doc" style="width: 100%;height: 100%;padding-top: 40px;box-sizing: border-box;" src="'+a+'"></iframe>')}i.comment=new r(i.step_id,i.container,i.data,i.service)}).fail(function(){}))},setDisabled:function(){this.data.reportBtn="disabled",UM.getEditor("content").setDisabled("fullscreen")},get_step_attachment:function(){var e=this,t=e.data.getGroup_res_data;e.service.step_attachment({course_id:t.course_id,step_id:t.id}).done(function(t){t.step_attachment_list.forEach(function(e){e.size=Math.floor(e.size/1024)}),e.data.step_attachment_list=t.step_attachment_list})},refreshData:function(e){this.setData(e)},onInitialize:function(e){var t=this;this.initialized=!1,e&&t.setData(e)},onClose:function(){this.content&&this.content.destroy(),this.container.remove()},get_step_video:function(){var e=this,t=e.data.getGroup_res_data;e.service.step_video({step_id:t.id}).done(function(t){e.data.step_video_list=t.video})},video_open:function(e,t){var i=this,n=null;layer.open({id:e.id,type:1,title:"视频播放器",shade:!1,maxmin:!0,area:["1000px","90%"],zIndex:100,content:'<video id="myVideo" width="1000px" height="700px" class="video-play-view video-js vjs-big-play-centered"></video>',success:function(r,a){i.get_video_test(e.id,function(r){n=i.video_play(e,t,r)})},cancel:function(e,t){n.dispose()},min:function(e,t){n.pause()}})},video_play:function(t,i,n){var r=this;if(!i){var a={action:"video_study_record",second:0,video_id:t.id,course_id:r.course_id,group_id:r.group_id,rel_c_s_g_id:r.data.getGroup_res_data.rel_c_s_g_id,test_true:0,test_count:0,start:!0};SDC.RegionOne.send(JSON.stringify(a))}var o=i?i.second:0,s=o,l=e.getDomain(e.domain_type.step_att)+t.url,c=o+10;return player=u("#myVideo",{controls:!0,autoplay:!1,language:"zh-CN",inactivityTimeout:!0,seeking:!1,controlBar:{playToggle:!0,currentTimeDisplay:!0,timeDivider:!0,durationDisplay:!0,remainingTimeDisplay:!1,volumePanel:{inline:!0},progressControl:{disabled:!0},children:[]},sources:[{src:l}]},function(){var i=this;Math.floor(t.second)===Math.floor(o)?i.currentTime(0):o>0&&layer.msg("上次观看到 "+e.formatSeconds(o)+" ,是否继续播放?",{time:1e4,zIndex:200000001,offset:"rt",btn:["继续","取消"],yes:function(e){layer.close(e),i.currentTime(s)}}),this.on("timeupdate",function(){if(1!==this.playbackRate()&&(this.playbackRate(1),this.currentTime(o)),this.currentTime()-o>.5&&s<this.currentTime())return void this.currentTime(o);Math.floor(this.currentTime())>Math.floor(s)&&c===Math.floor(this.currentTime())?(c+=10,r.video_study_record(t,this)):Math.floor(this.currentTime())>Math.floor(s)&&Math.floor(t.second)===Math.floor(this.currentTime())&&r.video_study_record(t,this),s<this.currentTime()&&(s=this.currentTime()),o=this.currentTime(),n.forEach(function(e,t){Math.floor(o)!==Math.floor(e.second)||e.status||(e.status=!0,i.pause(),r.Question(e))})}),this.on("ended",function(){})}),player},get_video_test:function(e,t){this.service.video_test({video_id:e}).done(function(e){var i=[],n=e.videotest,r=[];n.forEach(function(e){if(-1===r.indexOf(e.second)){var t={answer:JSON.parse(e.answer),test:JSON.parse(e.test),status:!1,second:e.second,id:e.id,video_id:e.video_id};i.push(t),r.push(e.second)}else i.forEach(function(t){t.second===e.second&&(t.answer=t.answer.concat(JSON.parse(e.answer)),t.test=t.test.concat(JSON.parse(e.test)))})}),t(i)})},Question:function(e){var t=this;new o(t.language,t.appOptions,t.step_id,t.data.getGroup_res_data.rel_c_s_g_id,e,t.service,function(e,i){var e={action:"video_study_record",second:e.second,video_id:e.video_id,course_id:t.course_id,group_id:t.group_id,rel_c_s_g_id:t.data.getGroup_res_data.rel_c_s_g_id,test_true:i.test_true,test_count:i.test_count};SDC.RegionOne.send(JSON.stringify(e))}).show()},video_study_record:function(e,t){var i=this,n={action:"video_study_record",second:Math.floor(t.currentTime()),video_id:e.id,course_id:i.course_id,group_id:i.group_id,rel_c_s_g_id:i.data.getGroup_res_data.rel_c_s_g_id,test_true:0,test_count:0};SDC.RegionOne.send(JSON.stringify(n))},fill_address:function(e){var t="";return"pub_course"==e.c_type?t=SDC.domain.pcourse_domain+e.doc_file:"v_course"==e.c_type?t=SDC.domain.vcourse_domain+e.doc_file:"s_course"==e.c_type&&(t=SDC.domain.icourse_domain+e.doc_file),t},getModelLabel:function(){return"expdesktop_view_doc"}};return i.extend(d.prototype,t.prototype),i.extend(d.prototype,h),d}),define("modules/console/vrdesktop/model/guacamole/controller",["app-utils","jquery","guacamole"],function(e,t,i){function n(e,t){this.guac_client="",this.display="",this.token=t.token,this.tunnel_url=t.tunnel_url,this.url=t.url,this.element=e,this.i18n=t.i18n,this.options=t}var r={init:function(){var e=this,i=new Guacamole.WebSocketTunnel(this.tunnel_url);this.guac_client=new Guacamole.Client(i),this.guac_client.connect(this.url),this.display=this.guac_client.getDisplay(),t(e.element).css({width:"100%"}),e.element.empty(),e.element.html(this.display.getElement());var n=0;return this.guac_client.onstatechange=function(i){3==i&&(clearTimeout(n),n=setTimeout(function(){e.set_vm_scale(t(window).width()-e.options.box_width)},2e3)),5!==i||e.options.refresh||e.modal_alert("当前连接已断开,请刷新重试!")},e.set_mouseEvent(),this.guac_client.onerror=function(t){e.console_conn_error(t.code),e.guac_client.disconnect()},e},console_conn_error:function(t){var i=this,n="";switch(i.options.refresh=!0,t){case 256:n=i.i18n.operation_unsupported;break;case 512:n=i.i18n.internal_error;break;case 517:n=i.i18n.vm_used_locked;break;case 518:n=i.i18n.vm_closed;break;case 521:n=i.i18n.vm_connect_use;break;case 797:n=i.i18n.vm_many_resources;break;case 519:case 769:default:setTimeout(function(){i.init()},3e3)}521===t?i.modal_alert(n):n&&e.msg_error(n,"",{timeOut:5e3})},modal_alert:function(e){var t=this;layer.alert(e,{icon:7,title:t.i18n.Warning,closeBtn:1,btn:[t.i18n.refresh],yes:function(e){t.options.refresh=!0,t.init(),t.options.refresh=!1,layer.close(e)},shade:.3})},set_mouseEvent:function(){function e(e){var r=new Guacamole.Mouse.State(e.x/n.display.getScaleX(),e.y/n.display.getScaleY(),e.left,e.middle,e.right,e.up,e.down);n.guac_client.sendMouseState(r),n.keyboard.onkeydown=t,n.keyboard.onkeyup=i}function t(e){n.guac_client&&n.guac_client.sendKeyEvent(1,e)}function i(e){n.guac_client&&n.guac_client.sendKeyEvent(0,e)}var n=this;n.mouse=new Guacamole.Mouse(n.guac_client.getDisplay().getElement()),n.keyboard||(n.keyboard=new Guacamole.Keyboard(document)),n.mouse.onmousedown=n.mouse.onmouseup=n.mouse.onmousemove=function(t){n.clearfacus(),n.display.showCursor(!1),e(t)},n.mouse.onmouseout=function(e){n.display.showCursor(!1),n.keyboard.onkeydown=null,n.keyboard.onkeyup=null}},add_mouseEvent:function(){var e=this;e.mouse&&e.mouse.addEventListener()},remove_mouseEvent:function(){var e=this;e.mouse&&e.mouse.removeEventListener()},set_vm_scale:function(e){var i=this;if(e){var n=t(window).height();if(t(i.element).css({width:"100%"}),i.display&&i.guac_client){var r=i.display.getWidth(),a=i.display.getHeight();"RDP"==i.options.protocol?i.display.scaleXY(e/r,n/a):i.guac_client.sendSize(e,n)}}},clearfacus:function(){t("input").blur(),t("select").blur()},clear:function(){this.guac_client.disconnect(),this.element.empty()}};return t.extend(n.prototype,r),n}),define("modules/console/vrdesktop/model/interact/controller",["app-utils","jquery"],function(e,t,i){function n(e,t){this.token=t.token,this.notebook="",this.element=e,this.options=t}var r={init:function(){var e=this,i=t(window).height(),n=t(window).width()-e.options.box_width;t(e.element).css({width:n,height:i});var r=SDC.slab_url+"lab-interact/live/"+e.options.lab_interact_id+"/notebooks/",a={lab_interact_id:e.options.lab_interact_id,lab_interact_code:e.options.lab_interact_code,token:SDC.user.auth_token,base_url:SDC.slab_url};return t("#interact-notebook").show().attr("src",r),t("#interact-notebook").load(function(){try{document.getElementById("interact-notebook").contentWindow.postMessage(JSON.stringify(a),r)}catch(e){}}),e},show:function(){t(this.element).show()},hide:function(){t(this.element).hide()},clear:function(){t(this.element).empty(),t(this.element).html('<iframe class="interact-notebook" id="interact-notebook" ></iframe>')},set_vm_scale:function(e){var i=this;if(e){var n=t(window).height();t(i.element).css({width:e,height:n})}}};return t.extend(n.prototype,r),n}),define("modules/console/vrdesktop/model/comment/controller",["jquery","app-utils","jqueryray"],function(e,t,i){function n(e,t,i,n){this.container=t,this.data=i,this.service=n,this.step_id=e,i.$watch("course_evaluate.comment.value",function(e){i.course_evaluate.tip.value=i.course_evaluate.tip.title.replace(/\{\d\}/g,100-e.length)})}var r={init:function(){var e=this;e.get_comment_content(),e.data.course_evaluate.tip.value=e.data.course_evaluate.tip.title.replace(/\{\d\}/g,100),e.data.events.send_comment=function(){e.send_comment()}},getComment:function(e){var i=this,n={item_id:e,type:"step"};i.service.getCommentList(n).done(function(e){for(var n=0;n<e.comment_list.length;n++)e.comment_list[n].pic_path=t.getDomain(t.domain_type.user)+e.comment_list[n].pic_path;i.data.course_evaluate.comment_list=e.comment_list,t.paging(e.comment_list,i.data.page_id,function(e){i.data.course_evaluate.comment_list=e},6)}).fail(function(e){})},get_comment_content:function(){var e=this;e.data.course_evaluate.isCreate=e.data.course_evaluate.score,
|
||
e.getComment(e.step_id),e.service.isCreateScore({item_id:e.step_id}).done(function(t){0===t.mark_list.length?e.container.find("#exp_course_score").raty({readOnly:e.data.course_evaluate.score,path:"/static/public/img/markstar",score:e.data.course_evaluate.score,hints:[1,2,3,4,5],click:function(t,i){if(e.data.course_evaluate.score=t,!SDC.user.mobile)return void layer.tips(e.i18n.no_auth,"#exp_course_score");var n={item_id:e.step_id,type:"step",value:Number(e.data.course_evaluate.score)},r=layer.load(2,{shade:[.1,"#ffffff"]});if(e.data.ismark){n={value:Number(e.data.course_evaluate.score)};var a=e.data.markid;e.service.updateScore(a,n).done(function(t){layer.close(r),e.container.find("#exp_course_score").raty("set",{path:"/static/public/img/markstar",score:e.data.course_evaluate.score})}).fail(function(e){layer.close(r)})}else e.service.createScore(n).done(function(t){layer.close(r),e.data.ismark=!0,e.data.markid=t.id,e.container.find("#exp_course_score").raty("set",{path:"/static/public/img/markstar",score:e.data.course_evaluate.score})}).fail(function(e){layer.close(r)})}}):e.container.find("#exp_course_score").raty({readOnly:e.data.course_evaluate.score,path:"/static/public/img/markstar",score:t.mark_list[0].value,hints:[1,2,3,4,5],click:function(i,n){if(e.data.course_evaluate.score=i,!SDC.user.mobile)return void layer.tips(e.i18n.no_auth,"#exp_course_score");var r={value:Number(e.data.course_evaluate.score)},a=layer.load(2,{shade:[.1,"#ffffff"]}),o=t.mark_list[0].id;e.service.updateScore(o,r).done(function(t){layer.close(a),e.container.find("#exp_course_score").raty("set",{path:"/static/public/img/markstar",score:e.data.course_evaluate.score})}).fail(function(e){layer.close(a)})}})}).fail(function(e){})},send_comment:function(){var t=this;if(!SDC.user.mobile)return void layer.tips(t.i18n.no_auth,"#exp_course_score");var i={item_id:t.step_id,type:"step",content:t.data.course_evaluate.comment.value};if(!e.trim(t.data.course_evaluate.comment.value))return void layer.tips("请输入评论内容","#comment");var n=layer.load(2,{shade:[.1,"#ffffff"]});t.service.createComment(i).done(function(e){t.container.find("#comment").val(""),layer.close(n),t.getComment(t.step_id)}).fail(function(e){layer.close(n)})}};return e.extend(n.prototype,r),n}),define("modules/console/vrdesktop/model/document/controller",["jquery","editormd"],function(e,t){function i(e,t){this.element=e,this.options=t}var n={init:function(){var i={htmlDecode:"style,script,iframe",tocm:!0,emoji:!1,taskList:!0,tex:!0,flowChart:!0,sequenceDiagram:!0,tocStartLevel:1};e.extend(this.options,i),t.markdownToHTML(this.element,this.options);var n=e("#"+this.element).find("pre");n.prepend("<i class='document-copy fa fa-files-o' style='display:none' ></i>"),n.on("mouseover",function(){e(this).find("i").show()}),n.on("mouseout",function(){e(this).find("i").hide()})}};return e.extend(i.prototype,n),i}),define("modules/console/vrdesktop/model/report/controller",["app-utils","jquery","bdlanglang"],function(e,t,i){function n(e,t,i){this.element=e,this.data=t,this.report_data=this.data.getGroup_res_data,this.service=i}var r={init:function(){var t=this;return t.addreportannex(),t.data.events.downloadattachment=function(t){var i=e.getDomain(e.domain_type.report)+t.path;window.location.href=i},t.data.events.submit_report=function(){t.data.submit_status="submit",t.save_submit("submit",t.data.report_list,t.data.report_data.id)},t.data.events.save_report=function(){t.data.submit_status="save",t.save_submit("save",t.data.report_list,t.data.report_data.id)},t.data.events.deleteattachment=function(i){layer.confirm("确实删除该报告附件吗?",{btn:["确定","取消"],title:"提示"},function(n){layer.close(n),t.service.deleteattachment(i).done(function(i){e.msg_success("删除成功"),t.init()}).fail(function(e){})},function(){})},t.data.events.completionFun=function(e){t.data.fields_report[0].value=e},t.content=UM.getEditor(t.element,{initialFrameWidth:"100%"}),t.reportData=t.report_data,t.service.expReportList({rel_c_s_g_id:t.report_data.rel_c_s_g_id}).done(function(i){if(0===i.report_list.length)return!1;t.data.report_list=1;var n=i.report_list[0];t.data.annex_data=[],n.attach_list.forEach(function(i){var n={title:i.title,file_name:i.file_name,path:i.path,size:i.size};t.data.annex_data.push(n),i.size>0?i.size_name=e.convertSize(i.size):i.size_name=0}),t.data.report_data=n,"submit"===n.submit_status&&t.setDisabled();var r=e.unescapeHTML(n.desc);t.content.setContent(r),"finished"===n.process?t.data.fields_report[0].value=0:"part"===n.process?t.data.fields_report[0].value=1:"unfinished"===n.process&&(t.data.fields_report[0].value=2)}).fail(function(e){}),t},save_submit:function(i,n,r){var a=this;if(!a.content.getContent())return e.msg_warning("请填写实验报告内容"),!1;"submit"===i?layer.confirm("提交后将不允许进行保存或提交操作,是否确认?",{btn:["确定","取消"]},function(e){layer.close(e),a.data.annex_number>0?t("#testListAction").trigger("click"):a.post_report(i,n,r)}):a.data.annex_number>0?t("#testListAction").trigger("click"):a.post_report(i,n,r)},post_report:function(t,i,n){var r=this,a=r.content.getContent(),o=r.data.fields_report[0].value,s="";0===o?s="finished":1===o?s="part":2===o&&(s="unfinished");var l=layer.load(2,{shade:[.1,"#ffffff"]}),c={name:r.reportData.title,desc:a,process:s,submit_status:t};r.data.annex_data.length>0?(c.attach_list=r.data.annex_data,r.data.annex_data=[]):c.attach_list=[],0===i?(c.rel_c_s_g_id=r.reportData.rel_c_s_g_id,r.service.createreport(c).done(function(i){r.init(),layer.close(l),"submit"===t?(e.msg_success("提交成功"),r.setDisabled()):e.msg_success("保存成功")}).fail(function(e){layer.close(l)})):1===i&&r.service.changeEreport(n,c).done(function(i){r.init(),"submit"===t?(e.msg_success("提交成功"),r.setDisabled()):e.msg_success("保存成功"),layer.close(l)}).fail(function(e){layer.close(l)})},addreportannex:function(){var t=this;layui.use("upload",function(){var i=layui.jquery,n=layui.upload,r=i("#demoList"),a=n.render({elem:"#testList",url:"/upload_attachment/",accept:"file",multiple:!0,auto:!1,field:"upload",exts:"doc|docx",size:51200,acceptMime:"application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",bindAction:"#testListAction",before:function(e){},choose:function(n){var o=this.files=n.pushFile();n.preview(function(s,l,c){t.data.annex_number=t.data.annex_number+1;var u=i(['<tr id="upload-'+s+'">',"<td title = "+l.name+">"+l.name+"</td>","<td title = "+e.convertSize(l.size)+">"+e.convertSize(l.size)+"</td>","<td>等待</td>","<td>",'<button class="layui-btn layui-btn-xs demo-reload layui-hide">重传</button>','<button class="layui-btn layui-btn-xs layui-btn-danger demo-delete">删除</button>',"</td>","</tr>"].join(""));u.find(".demo-reload").on("click",function(){n.upload(s,l),t.data.annex_number=t.data.annex_number+1}),u.find(".demo-delete").on("click",function(){t.data.annex_number=t.data.annex_number-1,delete o[s],u.remove(),a.config.elem.next()[0].value=""}),r.append(u)})},done:function(i,n,a){if(1===i[0].success){var o=e.splitFileName(i[0].file_name),s={title:o,file_name:i[0].file_name,size:i[0].file_size,path:i[0].url};t.data.annex_data.push(s),t.data.annex_number=t.data.annex_number-1,delete this.files[n];r.find("tr#upload-"+n).remove()}this.error(n,a)},allDone:function(e){t.post_report(t.data.submit_status,t.data.report_list,t.data.report_data.id),t.data.annex_number=0},error:function(e,t){var i=r.find("tr#upload-"+e),n=i.children();n.eq(2).html('<span style="color: #FF5722;">上传失败</span>'),n.eq(3).find(".demo-reload").removeClass("layui-hide")},msg:function(t){e.msg_error(t)}})})},setDisabled:function(){this.data.reportBtn="disabled",UM.getEditor("content").setDisabled("fullscreen")}};return t.extend(n.prototype,r),n}),define("text!modules/console/expdesktop/pop/upload/index.html",[],function(){return'<div ms-controller="">\r\n \r\n\r\n\r\n\r\n <div class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active">\r\n <button style="margin:10px 10px 0 10px" type="button" class="layui-btn" id="uploadFile_code_list">\r\n <i class="layui-icon"></i>上传文件\r\n </button>\r\n <span >上传文件支持格式:zip,z7,txt</span>\r\n <p style="word-wrap:break-word;word-break:break-all;margin:10px">{{placer.title}}</p>\r\n <div id="upload_uploadFile_code"></div>\r\n <div class="icode-footer">\r\n <button ms-class="[\'btn\',\'btn-\'+button.field]" ms-for="button in buttons" ms-attr="{name:button.field class:button.classname}" >{{button.title}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n'}),define("text!modules/console/expdesktop/pop/upload/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n "placer":{\r\n "field": "placer"\r\n },\r\n "buttons": [\r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "className":"cancel"\r\n },\r\n {\r\n "field": "send",\r\n "style": "success",\r\n "className":"send"\r\n }\r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "placer":"上传所需要的文件(最大支持2M)",\r\n "title": "上传文件",\r\n "send": "上传",\r\n "cancel": "取消"\r\n\r\n }\r\n }\r\n}'}),define("modules/console/expdesktop/pop/upload/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/upload/index.html","text!modules/console/expdesktop/pop/upload/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o,s,l){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=l,this.service=i,this.code_data=o,this.getGroup_res_data=a,this.step_id=s}var o={initAvalon:function(e){},onInitialize:function(t){var i=this;i.data;"contest_course"==i.getGroup_res_data.c_type&&(i.data.placer.title="上传所需要的文件(最大支持100M)"),i.uploadFun("#uploadFile_code_list","#upload_uploadFile_code"),this.container.delegate(".btn-cancel","click",function(){i.container.find(".closeModal").trigger("click")}),this.container.delegate(".btn-send","click",function(){if("请上传所需要的代码文件"==i.data.placer.title)return e.msg_warning("请先上传文件"),!1;i.container.find("#upload_uploadFile_code").trigger("click")})},getModelLabel:function(){return"pop_upload_vm_view"},uploadFun:function(t,i){var n=this,r=2048;"contest_course"==n.getGroup_res_data.c_type&&(r=102400),layui.use("upload",function(){var a=(layui.jquery,layui.upload);a.render({elem:t,url:"/step_code_upload/",field:"upload",accept:"file",exts:"zip|7z|txt",data:{vm_resid:n.code_data.vm_resid,step_id:n.step_id},auto:!1,size:r,bindAction:i,before:function(e){layer.load()},choose:function(e){e.preview(function(e,t,i){n.data.placer.title=t.name})},done:function(t,i,r){502==t[0].success?e.msg_error("确认sftp服务是否正常"):(e.msg_success("导入成功"),n.onCreated(t)),layer.closeAll("loading"),n.container.find(".closeModal").trigger("click")},error:function(e){layer.closeAll("loading")},msg:function(t){e.msg_error(t)}})})}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),define("modules/console/vrdesktop/model/code/controller",["app-utils","jquery","modules/console/expdesktop/pop/upload/controller"],function(e,t,i){function n(t,n){this.data=t,this.service=n;var r=this;r.data.events.code_upload=function(){new i(r.data.language,r.data.appOptions,r.service,r.data.getGroup_res_data,r.data.show_vm.code_data,r.data.show_vm.code_data.step_id,function(){r.init("start")}).show()},r.data.events.code_refresh=function(){r.init("start")},r.data.events.step_attachment=function(t){window.open(e.getDomain(e.domain_type.step_att)+t.api_url)}}var r={init:function(e){var t=this;return"start"==e?(t.data.show_vm.show=!0,t.service.step_code_server(t.data.show_vm.code_data).done(function(e){t.data.show_vm.show=!1;var i=t.data.show_vm.code_data;e&&(e.file_list.forEach(function(e){e.href="/step_code_download?filename="+e.filename+"&vm_protocol="+i.vm_protocol+"&vm_resid="+i.vm_resid+"&step_id="+i.step_id+"&type=study"}),t.data.step_code_list=e.file_list,0==t.data.step_code_list.lenght?t.data.show_vm.title="云主机暂无文件可以导出":t.data.show_vm.title="","windows"==e.os_type.toLowerCase()?t.data.show_vm.prompt="上传/下载目录为C:\\updownload目录'":t.data.show_vm.prompt='上传/下载目录为"/home/code"目录')}).fail(function(e){t.data.show_vm.show=!1,t.data.show_vm.title="云主机暂无文件可以导出"})):"end"==e&&(t.data.show_vm.title="实验环境尚未启动,无法上传/下载文件",t.data.step_code_list="",t.data.show_vm.code_data=""),t}};return t.extend(n.prototype,r),n}),define("modules/console/vrdesktop/service",["network-utils","jquery","modules/utils/baseservice"],function(e,t,i){var n=function(e){this.dataControl=e};return n.prototype={reportAttachment:function(t){return e.doGet("/ecos/qcec/v1/report_attach",t)},deleteattachment:function(t){return e.doDelete("/ecos/qcec/v1/report_attach",t)},report_attach:function(t){return e.doPost("/ecos/qcec/v1/report_attach",t)},overtime_server:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/course_step/delay_time",t)},lab_save_list:function(t){return e.doGet("/ecos/qcec_console_nsq/v1/lab_save",t)},recover_lab:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/recover_lab",t)},delete_lab:function(t){return e.doDelete("/ecos/qcec_console_nsq/v1/lab_save",t)},post_lab_save:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/lab_save",t)},createreport:function(t){return e.doPost("/ecos/qcec/v1/report",t)},expReportList:function(t){return e.doGet("/ecos/qcec/v1/report",t)},changeEreport:function(t,i){return e.doPut("/ecos/qcec/v1/report/"+t,i)},getCommentList:function(t){return e.doGet("/ecos/qcec_noauth/noauth/comment",t)},createComment:function(t){return e.doPost("/ecos/qcec/v1/comment",t)},getcourse:function(t,i){return e.doGet("/ecos/qcec/v1/course/"+t,i)},getTeacherInfo:function(t){return e.doGet("/ecos/qcec_noauth/noauth/user/get_provider/",{course_id:t})},createScore:function(t){return e.doPost("/ecos/qcec/v1/mark",t)},isCreateScore:function(t){return e.doGet("/ecos/qcec/v1/mark",t)},updateScore:function(t,i){return e.doPut("/ecos/qcec/v1/mark/"+t,i)},step_attachment:function(t){return e.doGet("/ecos/qcec/v1/step_attachment/",t)},step_code_server:function(t){return e.doGet("/ecos/qcec/v1/upload_file/get_files",t)},upload_file:function(t){return e.doGet("/ecos/qcec/v1/upload_file",t)},step_code_upload:function(t){return e.doPost("/step_code_upload/",t)},exchange_vpn:function(t){return e.doPost("/ecos/qcec_console_vpn/v1/vpn",t)},get_vpn:function(t){return e.doGet("/ecos/qcec_console_vpn/v1/vpn",t)},change_vpnpwd:function(t){return e.doPut("/ecos/qcec_console_vpn/v1/vpn/",t)},download_vpnconfig:function(t){return e.doUnescapeGet("/ecos/qcec_console_vpn/v1/vpn/download",t)},self_clean_resource:function(t){return e.doDelete("/ecos/qcec_console_nsq/v1/course_step/self_clean_resource",null,null,null,t)},step_test:function(t){return e.doGet("/ecos/qcec_console_nsq/v1/step_test/"+t)},submit_step_test:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/step_test/",t)}},t.extend(n.prototype,i.prototype),n}),define("modules/console/vrdesktop/pop/help/controller",["popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/help/index.html","text!modules/console/expdesktop/pop/help/lang.json"],function(e,t,i,n){function r(e,t,r,a,o){this.language=e,this.appOptions=t,this.lang=n,this.step_id=a,this.template=i,this.onCreated=o,this.service=r}var a={initAvalon:function(e){},onInitialize:function(e){var t=this,i=(t.data,t.getFieldsByName("op_user")),n=t.getFieldsByName("assist_msg");t.container.find("#data_form").bootstrapValidator({message:"This value is not valid",feedbackIcons:{valid:"glyphicon glyphicon-ok",invalid:"glyphicon glyphicon-remove",validating:"glyphicon glyphicon-refresh"},fields:{op_user:{message:i.assist_usernotempty.title,validators:{notEmpty:{message:i.assist_usernotempty.title},stringLength:{min:11,max:11,message:t.i18n.mobile_length},regexp:{regexp:/^1[3|5|8]{1}[0-9]{9}$/,message:t.i18n.mobile_regexp}}},assist_msg:{message:n.assist_msgnotempty.title,validators:{notEmpty:{message:n.assist_msgnotempty.title},stringLength:{min:1,max:255,message:t.i18n.assist_msg_length}}}}}),t.container.delegate('button[name="send"]:not(.disabled)',"click",function(){t.container.find("#data_form").bootstrapValidator("validate");var e=t.container.find("#data_form").data("bootstrapValidator").isValid(),i=t.generateData();e&&i&&(t.container.find('button[name="send"]').addClass("disabled"),t.service.get_assist_user({step_id:t.step_id,mobile:i.op_user}).done(function(e){i.op_user=e.user_id,i.step_id=t.step_id,t.service.send_assist(i).done(function(e){t.onCreated&&(t.onCreated(i),t.container.find(".closeModal").trigger("click"))}).fail(function(e){t.container.find('button[name="send"]').removeClass("disabled")})}))})},getModelLabel:function(){return"pop_heplvm_view"}};return t.extend(r.prototype,e.prototype),t.extend(r.prototype,a),r}),define("modules/console/vrdesktop/pop/lookrecover/controller",["popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/lookrecover/index.html","text!modules/console/expdesktop/pop/lookrecover/lang.json"],function(e,t,i,n){function r(e,t,r,a,o,s){this.language=e,this.appOptions=t,this.lang=n,this.template=i,this.onCreated=s,this.service=r,this.data_recover=o,this.recover_show=a}var a={initAvalon:function(e){var t=this;t.data.recover_show=t.recover_show,e.events.restore=function(e){t.container.find(".closeModal").trigger("click"),t.onCreated(e)},e.events.delete_lab=function(e){layer.confirm(t.i18n.delete,{btn:[t.i18n.trueBtn,t.i18n.falseBtn]},function(i){layer.close(i);var n=layer.load(1,{share:!1});t.service.delete_lab(e.id).done(function(e){t.lab_save_list(),layer.close(n),t.onCreated("delete")}).fail(function(e){layer.close(n)})})}},onInitialize:function(){var e=this;this.data;e.data.data_recover=e.data_recover,e.lab_save_list()},lab_save_list:function(){var e=this,t={range_type:"local"},i=layer.load(1,{share:!1});e.service.lab_save_list(t).done(function(t){e.data.fields=t.lab_save_list,layer.close(i)}).fail(function(e){layer.close(i)})},getModelLabel:function(){return"lookrecover"}};return t.extend(r.prototype,e.prototype),t.extend(r.prototype,a),r}),define("modules/console/vrdesktop/pop/saveexp/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/saveexp/index.html","text!modules/console/expdesktop/pop/saveexp/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=o,this.service=i,this.id=a}var o={onInitialize:function(){var t=this;this.data;this.container.delegate(".btn-cancel","click",function(){t.container.find(".closeModal").trigger("click")}),this.container.delegate(".btn-success","click",function(){t.container.find("#data_form").bootstrapValidator("validate");var i=t.container.find("#data_form").data("bootstrapValidator").isValid(),n=t.generateData();if(!i)return!1;var r={step_id:t.id,name:n.name,desc:n.desc,keep_ip:n.keep_ip,keep_attach_res:"false"},a=layer.load(1,{share:!1});t.service.post_lab_save(r).done(function(i){layer.close(a),t.onCreated(),e.msg_success("保存成功"),t.container.find(".closeModal").trigger("click")}).fail(function(t){layer.close(a),e.msg_error("保存失败")})}),t.container.find("#data_form").bootstrapValidator({fields:{name:{validators:{notEmpty:{message:"名称不能为空"}}}}})},getModelLabel:function(){return"attachpopmodel"}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),define("text!modules/console/vrdesktop/pop/questions/index.html",[],function(){return'<div ms-controller="">\r\n <div ms-attr="{id:pop_id}" class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active" id="course">\r\n <div style="margin-left: 20px;line-height: 24px;" class="icode-form-group icode-form-groups clearfix" ms-for="field in fields">\r\n <div>\r\n <span>{{ field.title }}</span>\r\n <span style="margin-left:10px;color:red">{{field.error}}</span>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'input\'">\r\n <input ms-attr="{\'placeholder\':field.placer,\'name\': field.name}" class="icode-form-long-student text" type="text" />\r\n </div>\r\n <div ms-if="field.type==\'radio\'">\r\n <label ms-for = "val in field.data" style="display: block;">\r\n <input style="margin:0 2px" ms-attr="{ value:val.value, name:field.name}" type="radio">\r\n {{val.title}}\r\n </label>\r\n </div>\r\n <div ms-if="field.type === \'checkbox\'">\r\n <label ms-for = "val in field.data" style="display: block;">\r\n <input ms-duplex="field.value" style="margin:0 2px" ms-attr = "{value:val.value, name:field.name}" type="checkbox">\r\n {{val.title}}\r\n </label>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'textarea\'">\r\n <textarea ms-attr="{\'placeholder\':field.placer,\'name\': field.name}" class="icode-form-long-student" maxlength ="50"></textarea>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'file\'">\r\n <input class="text" type="file" />\r\n <p>{{field.placer}}</p>\r\n </div>\r\n </div>\r\n <div class="icode-footer">\r\n\r\n <button ms-for="btn in @fieldbuttons" ms-class="[\'btn\',\'btn-\'+btn.style]"\r\n ms-attr="{\'data-dismiss\':btn.dismiss,name:btn.field}">{{ btn.title }}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n'}),define("text!modules/console/vrdesktop/pop/questions/lang.json",[],function(){return'{\r\n "config": {\r\n "pop_id": "pop_save_lab",\r\n "header": {\r\n "field": "title",\r\n "icon": "fa-money",\r\n "parent": {\r\n "field": "account"\r\n }\r\n },\r\n "submit":false,\r\n "answer":[],\r\n "fields": [\r\n \r\n ],\r\n "fieldbuttons": [\r\n {\r\n "field": "cancelcourse",\r\n "style": "cancel",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "savestep",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ],\r\n "keep_attach_res":{\r\n "type":"radio",\r\n "field":"keep_attach_res",\r\n "name":"keep_attach_res",\r\n "data":[\r\n {\r\n\r\n "id":"attach_true",\r\n "field":"true",\r\n "checked":true\r\n },\r\n {\r\n "id":"attach_false",\r\n "field":"false",\r\n "checked":false\r\n }\r\n ]\r\n }\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "课后习题",\r\n "cancelcourse": "关闭",\r\n "savestep": "提交",\r\n "name":"名称",\r\n "desc":"描述",\r\n "true":"是",\r\n "false": "否",\r\n "keep_ip":"保存IP地址",\r\n "data_set":"保存数据集",\r\n "keep_attach_res":"保存素材路径"\r\n },\r\n "en": {\r\n\r\n }\r\n }\r\n}'}),define("modules/console/vrdesktop/pop/questions/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/vrdesktop/pop/questions/index.html","text!modules/console/vrdesktop/pop/questions/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o,s,l){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=l,this.service=i,this.rel_c_s_g_id=a,this.step_id=o,this.title=s}var o={initAvalon:function(e){},onInitialize:function(){var t=this;this.data;this.container.delegate(".btn-cancel","click",function(){t.container.find(".closeModal").trigger("click")});var i=layer.load(1,{share:!1});t.service.step_test(t.step_id).done(function(e){layer.close(i);var n=[],r=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];e.test.forEach(function(e,t){var i=t+1,a={type:e.type,title:i+". "+e.question,name:"question"+t,data:[],value:[],error:""};e.choice.forEach(function(e,t){a.data[t]={title:r[t].toUpperCase()+". "+e,value:r[t]}}),n.push(a)}),t.data.fields=n,t.data.answer=e.answer}),this.container.delegate(".btn-success","click",function(){t.container.find("#data_form").bootstrapValidator("validate");var i=t.container.find("#data_form").data("bootstrapValidator").isValid(),n=t.generateData();if(!i)return!1;for(var r={step_id:t.step_id,rel_c_s_g_id:t.rel_c_s_g_id,answer:[]},a=t.data.fields,o=0;o<t.data.fields.length;o++)if("radio"===a[o].type&&n[a[o].name])r.answer.push(n[a[o].name]);else{if(!("checkbox"===a[o].type&&a[o].value.length>0))return void e.msg_error("请先填写答案再提交");r.answer.push(a[o].value.join(""))}if(t.data.submit)return void e.msg_error("您已经提交,请勿重新提交");var s=layer.load(1,{share:!1});t.service.submit_step_test(r).done(function(e){layer.close(s),t.data.submit=!0,e.result.forEach(function(e,i){t.data.fields[i].error=e?"":t.data.answer[i].toUpperCase()}),t.onCreated(),layer.alert("您的成绩为:"+e.score+"分")}).fail(function(t){layer.close(s),e.msg_error("提交失败")})})},getModelLabel:function(){return"attachpopmodel"}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),define("modules/console/vrdesktop/pop/dataset/controller",["popcontrollerbase_v2","jquery","layui","text!modules/console/expdesktop/pop/dataset/index.html","text!modules/console/expdesktop/pop/dataset/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=o,this.service=i,this.dataset_list=a}var o={initAvalon:function(e){},onInitialize:function(e){var t=this;t.data;t.dataset_list.forEach(function(e){"success"==e.mount_status?e.mount_status_desc="成功":e.mount_status_desc="失败"}),layui.use("table",function(){layui.table.render({elem:"#sd_dataset_list",cols:[[{field:"name",width:100,title:"名称"},{field:"size",width:100,title:"大小(GB)"},{field:"desc",width:120,title:"描述"},{field:"cifs_path",width:180,title:"cifs_path"},{field:"nfs_path",width:180,title:"nfs_path"},{field:"mount_path",width:180,title:"挂载路径"},{field:"mount_status_desc",width:100,title:"挂载状态"}]],data:t.dataset_list})})},getModelLabel:function(){return"pop_upload_vm_view"}};return t.extend(a.prototype,e.prototype),t.extend(a.prototype,o),a}),define("modules/console/vrdesktop/pop/exception/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/exception/index.html","text!modules/console/expdesktop/pop/exception/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o){this.language=e,this.appOptions=t,this.lang=r,this.step_id=a,this.template=n,this.onCreated=o,this.service=i}var o={initAvalon:function(e){},onInitialize:function(t){var i=this,n=(i.data,i.getFieldsByName("ex_type")),r=i.getFieldsByName("ex_msg");layui.use("element",function(){layui.element.on("tab(extab)",function(e){1===e.index&&i.grid&&i.grid.resize("tb_exceptions")})}),layui.use("table",function(){i.grid=layui.table,i.grid.render({elem:"#tb_exceptions",limit:5,limits:[5,10,15,20,30,50,100],page:!0,text:{none:"暂无异常记录"},url:"/ecos/qcec_console_nsq/v1/exception_order/pages",request:{pageName:"page_index",limitName:"page_size"},where:{rel_c_s_g_id:i.step_id},cols:[[{field:"exception_type_name",title:"异常类型"},{field:"status_name",title:"状态"},{field:"result",title:"处理结果",toolbar:"#rowbar"},{field:"created_at",title:"提交时间"},{field:"updated_at",title:"处理时间"}]],parseData:function(t){return t.exception_order_list.forEach(function(t){t.status_name=i.i18n[t.status]||t.status,t.created_at=e.formatTimeStandard(t.created_at,"YYYY-MM-DD"),t.updated_at?t.updated_at=e.formatTimeStandard(t.updated_at,"YYYY-MM-DD"):t.updated_at="未处理"}),{code:0,count:t.counts,data:t.exception_order_list}}}),i.grid.on("tool(exceptions)",function(e){var t=e.data;"detail"==e.event&&layer.open({title:"处理结果",content:t.answer||"暂未处理"})})}),i.service.getvmexception_type().done(function(e){n.data=e.exception_order_list}),i.container.find("#data_form").bootstrapValidator({message:"This value is not valid",feedbackIcons:{valid:"glyphicon glyphicon-ok",invalid:"glyphicon glyphicon-remove",validating:"glyphicon glyphicon-refresh"},fields:{ex_msg:{message:r.ex_msgnotempty.title,validators:{notEmpty:{message:r.ex_msgnotempty.title},stringLength:{min:1,max:255,message:i.i18n.ex_msg_length}}}}}),i.container.delegate('button[name="send"]:not(.disabled)',"click",function(){i.container.find("#data_form").bootstrapValidator("validate");var t=i.container.find("#data_form").data("bootstrapValidator").isValid(),n=i.generateData();t&&n&&(i.container.find('button[name="send"]').addClass("disabled"),i.service.submit_vmexception({mode:"study",rel_c_s_g_id:i.step_id,content:n.ex_msg,exception_type_id:n.ex_type}).done(function(t){i.container.find(".closeModal").trigger("click"),e.msg_success("异常工单提交成功,工作人员正在处理,请等待几分钟后刷新页面,查看处理结果")}))})},getModelLabel:function(){return"pop_exceptionvm_view"}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),define("modules/console/vrdesktop/pop/msg/controller",["app-utils","jquery","moment","webpopover"],function(e,t,i,n){function r(){}var a={settings:{trigger:"click",title:"消息",width:300,height:480,multi:!0,closeable:!0,style:"",padding:!0},init:function(e){var i=this;i.savemsg(e);var n=i.getmsgs();return i.settings.content=n,t("#realtime_msg").webuiPopover("destroy").webuiPopover(i.settings),t("#realtime_msg").click(function(e){i.events()}),i},savemsg:function(e){if(e){msgs=sessionStorage.getItem("realtime_msgs",[]),json_msgs=JSON.parse(msgs),json_msgs||(json_msgs=[]),json_msgs.push(e);for(var t=json_msgs.length,i=0;i<t&&json_msgs.length>SDC.realtime_num;i++)json_msgs.shift();sessionStorage.setItem("realtime_msgs",JSON.stringify(json_msgs))}},getmsgs:function(){msgs=JSON.parse(sessionStorage.getItem("realtime_msgs"));var e=[],i=t("<ul></ul>");if(msgs){for(var n=0;n<msgs.length;n++){var r=msgs[n],a=this.setli(r);e.push(a)}i.append(e)}return t("#msg_num").text(e.length),i.prop("outerHTML")},setContent:function(i){var n=this;i.nickname=i.teacher_nickname||i.answer_real_name,i.content=i.content||i.answer,i.id=e.get_order_id("msg_"),e.msg_success("一条来自"+i.nickname+"老师的消息",null,{positionClass:"toast-bottom-right"}),n.savemsg(i);for(var r=t(".webui-popover-content ul"),a=t(".webui-popover-content ul li"),o=a.length,s=0;s<o&&a.length>=SDC.realtime_num;s++)r.children().first().remove();var l=n.setli(i);r.length?(r.append(l),n.events()):(n.settings.content="<ul>"+l+"</ul>",t("#realtime_msg").webuiPopover("destroy").webuiPopover(n.settings),t("#realtime_msg").click(function(e){n.events()})),t("#msg_num").text(a.length+1)},delmsg:function(e){
|
||
msgs=sessionStorage.getItem("realtime_msgs",[]),json_msgs=JSON.parse(msgs);for(var t=0;t<json_msgs.length;t++){json_msgs[t].id==e&&json_msgs.splice(t,1)}sessionStorage.setItem("realtime_msgs",JSON.stringify(json_msgs))},events:function(){var e=this;t(".webui-popover-content li content").click(function(e){t(this).toggleClass("p_elipsis")}),t(".webui-popover-content li img").click(function(e){var i="<img src='"+t(this).attr("src")+"' style='max-width:1024px;max-height:768px'/>";layer.open({type:1,title:"图片预览",closeBtn:1,area:["1024px","768px"],skin:"layui-layer-nobg",shadeClose:!0,content:i})}),t(".del-msg").click(function(i){id=t(this).attr("id"),t(this).parent().remove();var n=t(".webui-popover-content ul li");t("#msg_num").text(n.length),e.delmsg(id)})},setli:function(e){return"<li class='textLeft'><em>"+e.nickname+"</em><em>"+i(e.created_at).format("YYYY-MM-DD hh:mm:ss")+'</em><a href="javascript:void(0)" id="'+e.id+'"class="del-msg" ><i class="layui-icon layui-icon-delete"></i> </a><content class=\''+e.action+"'>"+e.content+"</content></li>"}};return t.extend(r.prototype,a),r}),define("modules/console/vrdesktop/pop/vpn/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/expdesktop/pop/vpn/index.html","text!modules/console/expdesktop/pop/vpn/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o){this.language=e,this.appOptions=t,this.lang=r,this.obj=a,this.template=n,this.onCreated=o,this.service=i}var o={initAvalon:function(e){var t=this;e.events.download=function(){t.service.download_vpnconfig({lab_id:t.obj.lab_id}).done(function(e){t.savetofile(e.config_name,e.config_content)})}},onInitialize:function(t){var i=this,n=(i.data,i.getFieldsByName("username")),r=i.getFieldsByName("password"),a=layer.load(3);i.service.get_vpn({lab_id:i.obj.lab_id,mode:i.obj.mode}).done(function(e){n.value=e.user_name,r.value=e.user_passwd_plaintext}).always(function(){layer.close(a)}),layui.use("element",function(){layui.element.on("tab(extab)",function(e){1===e.index&&i.grid&&i.grid.resize("tb_exceptions")})}),layui.use("table",function(){i.grid=layui.table,i.grid.render({elem:"#tb_vpnclient",limit:5,limits:[5,10,15,20,30,50,100],page:!0,text:{none:"暂无客户端软件"},data:i.data.vpnclients,request:{pageName:"page_index",limitName:"page_size"},cols:[[{field:"name",title:"名称",templet:function(e){return"<a href='"+e.link+"' target='_blank'>"+e.name+"</a>"}},{field:"system",title:"操作系统"}]]})}),i.container.find("#data_form").bootstrapValidator({message:"This value is not valid",feedbackIcons:{valid:"glyphicon glyphicon-ok",invalid:"glyphicon glyphicon-remove",validating:"glyphicon glyphicon-refresh"},fields:{old_password:{message:i.i18n.old_passwordnotempty,validators:{notEmpty:{message:i.i18n.old_passwordnotempty},callback:{message:"旧密码不正确",callback:function(e){return e===r.value}}}},new_password:{message:i.i18n.new_passwordnotempty,validators:{notEmpty:{message:i.i18n.new_passwordnotempty},stringLength:{min:8,max:16,message:"请输入8到16位密码"},regexp:{regexp:/^(?=.*[a-zA-Z]+)(?=.*[0-9]+)[a-zA-Z0-9]+$/,message:"必须是数字和字母组合"}}}}}),i.container.delegate('button[name="change_pwd"]:not(.disabled)',"click",function(){i.container.find("#data_form").bootstrapValidator("validate");var t=i.container.find("#data_form").data("bootstrapValidator").isValid(),n=i.generateData();t&&n&&(i.container.find('button[name="change_pwd"]').addClass("disabled"),i.service.change_vpnpwd({user_passwd_plaintext:n.new_password}).done(function(t){r.value=t.user_passwd_plaintext,i.container.find(".closeModal").trigger("click"),e.msg_success("密码修改成功")}).fail(function(){}).always(function(){i.container.find('button[name="change_pwd"]').removeClass("disabled")}))})},savetofile:function(e,t){var i=new Blob([t],{type:"application/octet-stream"});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(i,e);else{var n=window.document.createElement("a");n.href=window.URL.createObjectURL(i),n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}},getModelLabel:function(){return"pop_exceptionvm_view"}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),define("text!modules/console/vrdesktop/lang.json",[],function(){return'{\r\n "config": {\r\n "annex_data":[],\r\n "submit_status":"",\r\n "report_list":0,\r\n "annex_number":0,\r\n "report_data":"",\r\n \r\n "allow_delay":false,\r\n "lab_save_count": 0,\r\n "password_view":"false",\r\n "allow_save":false,\r\n "allow_vpn":false,\r\n "vms": {},\r\n "page_id": "expdesltop_view_data_page",\r\n "current_assister": "",\r\n "current_assis_type": "read",\r\n "desktop_title": "",\r\n "current_unfold": "docmarkdown",\r\n "isspread": false,\r\n "vm_param": "",\r\n "is_split": false,\r\n "reportData": "",\r\n "reportBtn": "",\r\n "step_msg": "",\r\n "is_assist": false,\r\n "assist_process_token": "",\r\n "assist_conn_token": "",\r\n "is_fullscreen": false,\r\n "is_onresize": true,\r\n "checkFull": false,\r\n "vm_status": "closed",\r\n "conTitle": {\r\n "field": "contitle"\r\n },\r\n "menu_tools": {\r\n "vm_name": "",\r\n "protocols": ""\r\n },\r\n "editormd": {\r\n "editormd_show": "editormd_show_title"\r\n },\r\n "toggle": {\r\n "tools_show": "hide",\r\n "editormd_show": "hide"\r\n },\r\n "step": {\r\n "allow_vpn": false,\r\n "vpn_info": {},\r\n "ip": "",\r\n "token": "",\r\n "progress": 0,\r\n "res_id": "",\r\n "protocol": "",\r\n "os_type": "",\r\n "op_system_type": "",\r\n "id": "",\r\n "os_password": "",\r\n "os_username": "",\r\n "dataset_list": [],\r\n "res_list": [\r\n\r\n ],\r\n "vm_models": {},\r\n "menu_view": {\r\n "tool_view": true,\r\n "doc_view": true\r\n },\r\n "fields": [\r\n {\r\n "field": "forced_close",\r\n "enabled": true,\r\n "hide": true,\r\n "type": "button",\r\n "icon": "play-circle"\r\n },\r\n {\r\n "field": "create",\r\n "enabled": true,\r\n "hide": false,\r\n "type": "button",\r\n "icon": "play-circle"\r\n },\r\n {\r\n "field": "delay",\r\n "enabled": true,\r\n "hide": true,\r\n "type": "button",\r\n "icon": "clock-o"\r\n },\r\n {\r\n "field": "saveexp",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "save"\r\n },\r\n {\r\n "field": "lookrecover",\r\n "enabled": true,\r\n "hide": true,\r\n "type": "button",\r\n "icon": "cloud"\r\n },\r\n {\r\n "field": "help",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "share-alt"\r\n },\r\n {\r\n "field": "unhelp",\r\n "hide": true,\r\n "type": "button",\r\n "enabled": true,\r\n "icon": "share-square"\r\n },\r\n {\r\n "field": "viewtype",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "columns"\r\n },\r\n {\r\n "field": "fullscreen",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "arrows-alt"\r\n },\r\n {\r\n "field": "refresh",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "refresh"\r\n\r\n },\r\n {\r\n "field": "close",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "close"\r\n },\r\n \r\n {\r\n "field": "exception",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": false,\r\n "icon": "bug"\r\n }\r\n ],\r\n "vm_name": {\r\n "field": "vm_name",\r\n "data": []\r\n },\r\n "protocols": {\r\n "data": [],\r\n "value": ""\r\n },\r\n "interacts": {\r\n "field": "interacts",\r\n "data": [],\r\n "value": ""\r\n },\r\n "extension": {\r\n "field": "extension",\r\n "select": "",\r\n "data": [\r\n {\r\n "field": "vpn_exchange",\r\n "hide":true\r\n \r\n }\r\n ]\r\n }\r\n\r\n ,\r\n "vpn_exchange": {\r\n "field": "vpn_exchange",\r\n "data": [\r\n {\r\n "field": "vpn_conn",\r\n "icon": "exchange",\r\n "disabled":false\r\n },\r\n {\r\n "field": "vpn_view",\r\n "icon": "eye",\r\n "disabled": false\r\n\r\n }\r\n ]\r\n }\r\n \r\n },\r\n \r\n "timeout": {\r\n "day":"0",\r\n "hour": "00",\r\n "minute": "00",\r\n "second": "00",\r\n\r\n "zero": 0,\r\n "allSecond": 0\r\n },\r\n "fields_report": [{\r\n "field": "completion",\r\n "type": "radio",\r\n "style": "vclass-name",\r\n "name": "radio",\r\n "value": 0,\r\n "data": [{\r\n "field": "all_status",\r\n "status": true,\r\n "value": 0\r\n },\r\n {\r\n "field": "section_status",\r\n "status": false,\r\n "value": 1\r\n },\r\n {\r\n "field": "undone_status",\r\n "status": false,\r\n "value": 2\r\n }\r\n ]\r\n },\r\n {\r\n "type": "ueditor",\r\n "field": "content",\r\n "value": ""\r\n }\r\n ],\r\n "fieldbuttons": [{\r\n "field": "save",\r\n "style": "save",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "savestep",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ],\r\n "step_attachment_list": [],\r\n "doctabs": [{\r\n "field": "docmarkdown",\r\n "active": true,\r\n "show": true,\r\n "type": "doc"\r\n },\r\n {\r\n "field": "evaluation",\r\n "active": false,\r\n "show": true,\r\n "type": "evaluation"\r\n },\r\n {\r\n "field": "report",\r\n "active": false,\r\n "show": false,\r\n "type": "report"\r\n },\r\n {\r\n "field": "material",\r\n "active": false,\r\n "show": true,\r\n "type": "material"\r\n },\r\n {\r\n "field": "file",\r\n "active": false,\r\n "show": true,\r\n "type": "code"\r\n }\r\n ],\r\n\r\n "show_vm": {\r\n "field": "close_vm",\r\n "code_data": "",\r\n "prompt": "",\r\n "show": false,\r\n "loading": true,\r\n "os_type": ""\r\n\r\n },\r\n "vstep_id": "",\r\n "step_code_list": [],\r\n "isloaded": false,\r\n "getGroup_res_data": "",\r\n "course_evaluate": {\r\n "field": "course_evaluate",\r\n "score": 0,\r\n "isCreate": true,\r\n "comment": {\r\n "field": "comment",\r\n "value": ""\r\n },\r\n "tip": {\r\n "field": "evaluate_tip",\r\n "value": ""\r\n },\r\n "button": {\r\n "field": "send_comment"\r\n },\r\n "comment_list": [\r\n\r\n ]\r\n },\r\n "comment_list": [\r\n\r\n ],\r\n "ismark": false,\r\n "markid": "",\r\n "op_type": "",\r\n "is_start": false\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "all_status": "全部完成",\r\n "section_status": "部分完成",\r\n "undone_status": "未完成",\r\n "title": "实验报告",\r\n "save": "保存",\r\n "purpose": "实验目的",\r\n "savestep": "保存并提交",\r\n "name": "实验名称",\r\n "completion": "完成情况",\r\n "undone": "未完成原因",\r\n "content": "报告内容",\r\n "report": "报告",\r\n "remotely": "远程协助",\r\n "monitor": "实验监控",\r\n "scrapbooking": "剪贴板",\r\n "uploadFiles": "上传文件",\r\n "timeCost": "实验用时:",\r\n "docmarkdown": "文档",\r\n "question": "问答",\r\n "notes": "笔记",\r\n "evaluation": "评价",\r\n "fraction": "给实验打分",\r\n "publish": "发表",\r\n "viewtype": "显示方式",\r\n "contitle": "实验桌面标题",\r\n "course_step_evaluate": "实验评价",\r\n "close_vm": "实验环境尚未启动,无法上传/下载文件",\r\n "send_comment": "发表",\r\n "grade": "给实验评分",\r\n "create": "开始",\r\n "saveexp": "保存实验",\r\n "lookrecover": "恢复实验",\r\n "clipboard": "剪贴板",\r\n "editormd_show_title": "显示文档",\r\n "delay": "延时",\r\n "close": "关闭",\r\n "help": "请求协助",\r\n "unhelp": "取消协助",\r\n "assist": "协助",\r\n "creatingvm": "正在创建实验环境",\r\n "ladingvmerror": "加载实验环境失败,请点击刷新按钮或等待10秒重新加载",\r\n "RDP": "桌面版",\r\n "SSH": "命令行版",\r\n "waiting": "实验环境正在准备中",\r\n "creating": "准备中",\r\n "refresh": "刷新",\r\n "click": "点击创建加载环境...",\r\n "remain_time": "剩余时间",\r\n "hour": "时",\r\n "minute": "分",\r\n "second": "秒",\r\n "accept_assist": "对方已接受协助请求",\r\n "reject_assist": "对方拒绝了协助请求",\r\n "study_timeout": "学习时间已结束,实验环境已经删除。如果继续学习,请重新创建",\r\n "Warning": "温馨提示",\r\n "cannot_load": "加载实验环境失败,请重试",\r\n "operation_unsupported": "不支持此操作",\r\n "internal_error": "发生了内部错误,无法执行操作。",\r\n "vm_used_locked": "实验环境已经在使用或锁定,请刷新控制台页面",\r\n "vm_closed": "实验环境已经关闭,请重新创建",\r\n "vm_busy": "实验环境忙,需要首先释放连接,然后重试或尝试刷新操作",\r\n "vm_connect_use": "控制台已经被另一个连接使用,请先关闭该连接,或者刷新控制台页面。",\r\n "vm_authorized_fail": "授权失败,请联系管理员或尝试刷新操作",\r\n "vm_many_resources": "您已经使用了太多的资源,请关闭一些正在使用的实验环境或尝试刷新操作",\r\n "noselectText": "请先选中页面中的文本内容",\r\n "evaluate_tip": "还可以输入<span>{0}</span>字",\r\n "cancel": "取消",\r\n "material": "随材",\r\n "op_type": "协助方式",\r\n "read": "观看",\r\n "write": "控制",\r\n "code": "代码",\r\n "file": "文件",\r\n "fullscreen": "全屏",\r\n "exitfullscreen": "退出全屏",\r\n "closing": "关闭中",\r\n "exception": "报告异常",\r\n "vpn_exchange": "vpn连接",\r\n "vm_name": "主机名",\r\n "interacts": "实验",\r\n "extension": "扩展功能",\r\n "vpn_conn": "连接",\r\n "vpn_view": "查看连接",\r\n "forced_close":"强制关机"\r\n }\r\n }\r\n}'}),define("modules/console/vrdesktop/controller",["app-utils","modules/console/basecontroller","jquery","lsbridge","modules/console/vrdesktop/model/guacamole/controller","modules/console/vrdesktop/model/interact/controller","modules/console/vrdesktop/model/comment/controller","modules/console/vrdesktop/model/document/controller","modules/console/vrdesktop/model/report/controller","modules/console/vrdesktop/model/code/controller","modules/console/vrdesktop/service","modules/console/vrdesktop/pop/help/controller","modules/console/vrdesktop/pop/lookrecover/controller","modules/console/vrdesktop/pop/saveexp/controller","modules/console/vrdesktop/pop/questions/controller","modules/console/vrdesktop/pop/dataset/controller","modules/console/vrdesktop/pop/exception/controller","modules/console/vrdesktop/pop/msg/controller","modules/console/vrdesktop/pop/vpn/controller","toolbar","toastr","overlayscrollbars","text!modules/console/vrdesktop/lang.json","bdlanglang"],function(e,t,i,n,r,a,o,s,l,c,u,d,h,p,f,m,g,v,y,_,b,w,x,k){function C(e,t,n){this.container=e,this.language=t,this.appOptions=n,this.lang=x,this.vstep_id=null,this.step_id=null,this.group_id=null,this.course_id=null,this.isloading=!0,this.res_list={},this.timer=null,this.temp_ips=[],this.progresstimer=null,this.n=0,this.reconnect=1,this.vmlayout=null,this.layouttype="east",this.exp_width=360,this.windpi={sm:768,md:992,lg:1200},this.ishind=!1,this.dragDocInit=172,this.dragDoc=182,this.windowWidth=i(window).width(),this.imgClick=!1,this.remain_time=0,this.overtimeLayer=""}var T={initAvalon:function(t){var r=this;t.events.desktop_tools_hide=r.tools_hide_fun.bind(this),t.events.desktop_tools_show=r.tools_show_fun.bind(this),t.events.desktop_editormd_hide=r.editormd_hide_fun.bind(this),t.events.desktop_editormd_show=r.editormd_show_fun.bind(this),t.events.desktop_editormd_maximize=r.editormd_maximize_fun.bind(this),t.events.step_attachment=function(t){window.open(e.getDomain(e.domain_type.step_att)+t.api_url)},t.events.change_vm_name=function(t){var i=t.id;r.data.step.res_id=i,r.set_protocols();var n=r.res_list[i];r.data.step.ip=n.ip,r.data.step.os_password=n.os_password,r.data.step.os_username=n.os_username,r.data.step.op_system_type=n.type,n.type===e.op_system_type.interact?r.set_interacts():r.field_interacts.data=[],r.setvm_param()},t.events.change_interacts=function(e){r.data.step.lab_interact_code=e.lab_interact_code,r.data.step.lab_interact_id=e.lab_interact_id,r.setvm_param()},t.events.change_protocols=function(e){var t=e.id;if(r.data.step.protocol==t)return!1;r.data.step.protocol=t,r.setvm_param()},t.events.extensionop=function(e){r.data.step.extension.select=e.field},t.events.select_vpnoption=function(t){switch(t.field){case"vpn_conn":if("active"!==r.data.step.vpn_info.status){var i=layer.load(3);r.service.exchange_vpn({lab_id:r.vstep_id,mode:"study"}).done(function(t){e.msg_success("vpn连接成功!"),r.data.step.vpn_info.status=t.status,r.data.step.vpn_exchange.data[0].disabled=!0}).fail(function(){e.msg_error("vpn连接失败")}).always(function(){layer.close(i)})}break;case"vpn_view":if("init"!==r.data.step.vpn_info.status){new y(r.language,r.appOptions,r.service,{lab_id:r.vstep_id,mode:"study",vpn_info:r.data.step.vpn_info},function(){}).show()}}},t.$watch("step.allow_vpn",function(e){e&&(r.data.step.extension.select="vpn_exchange"),r.data.step.extension.data[0].hide=!e}),t.$watch("step.vpn_info.status",function(e){e&&(r.data.step.vpn_exchange.data[0].disabled="active"===r.data.step.vpn_info.status,r.data.step.vpn_exchange.data[1].disabled="init"===r.data.step.vpn_info.status)}),t.$watch("step.res_list",function(e){e&&(r.set_vm_ips(),r.set_interacts())}),t.$watch("vm_param",function(e){e&&(r.vm_is_refresh(),r.show_vm())}),t.$watch("step.progress",function(e){r.isloading&&r.loading()}),t.$watch("step_msg",function(t){t&&e.msg_info(t)}),t.$watch("is_fullscreen",function(t){r.data.is_onresize=!1,t?e.fullScreen()&&(r.field_fullscreen.title=r.i18n.exitfullscreen):e.exitFullScreen()&&(r.field_fullscreen.title=r.i18n.fullscreen)}),t.$watch("vm_status",function(t){switch(t==e.vm_status.running?r.field_lookrecover.title="已保存实验":r.field_lookrecover.title="恢复实验",e.vm_status.creating===t||e.vm_status.closing===t?(clearTimeout(r.creatingTimer),r.creatingTimer=setTimeout(function(){r.field_forced_close.hide=!1},18e4)):(r.field_forced_close.hide=!0,clearTimeout(r.creatingTimer)),t){case e.vm_status.creating:r.field_create.title=r.i18n.creating,r.field_create.enabled=!1,r.field_create.hide=!1,r.field_vm_name.data=[],r.field_interacts.data=[],r.field_protocols.data=[],r.field_refresh.hide=!0,r.field_fullscreen.hide=!0,r.field_close.hide=!0,r.field_viewtype.hide=!0,r.data.is_start=!0,r.field_saveexp.hide=!0,r.field_lookrecover.hide=!0,r.field_delay.hide=!0,n.send("console-creating",{id:r.vstep_id});break;case e.vm_status.running:r.field_create.hide=!0,r.field_vm_name.hide=!1,r.field_close.hide=!1,r.field_close.title=r.i18n.close,r.field_close.enabled=!0,r.field_refresh.hide=!1,r.field_fullscreen.hide=!1,r.data.is_start=!0,"true"==r.data.allow_save?r.field_saveexp.hide=!1:r.field_saveexp.hide=!0,r.field_lookrecover.hide=!1,"false"==r.data.allow_delay?r.field_delay.hide=!0:r.field_delay.hide=!1,n.send("console-running",{id:r.vstep_id,remain_time:r.remain_time});break;case e.vm_status.closing:r.field_close.hide=!1,r.field_close.enabled=!1,r.field_close.title=r.i18n.closing,r.field_create.hide=!0,r.field_refresh.hide=!0,r.field_fullscreen.hide=!0,r.field_viewtype.hide=!0,r.field_vm_name.data=[],r.field_interacts.data=[],r.data.step.token="",r.field_protocols.data=[],r.data.is_start=!0,r.field_saveexp.hide=!0,r.field_lookrecover.hide=!0,r.field_delay.hide=!0;break;case e.vm_status.closed:r.field_close.hide=!0,r.field_create.hide=!1,r.field_create.title=r.i18n.create,r.field_create.enabled=!0,r.field_vm_name.data=[],r.field_interacts.data=[],r.data.step.token="",r.field_protocols.data=[],r.field_refresh.hide=!0,r.field_fullscreen.hide=!0,r.field_viewtype.hide=!0,r.data.step.progress=0,r.data.is_start=!1,r.field_saveexp.hide=!0,r.field_lookrecover.hide=!1,r.field_delay.hide=!0,n.send("console-closed",{id:r.vstep_id});break;case e.vm_status.error:r.field_close.hide=!0,r.field_create.hide=!1,r.field_create.title=r.i18n.create,r.data.step.token="",r.field_vm_name.data=[],r.field_interacts.data=[],r.field_protocols.data=[],r.field_refresh.hide=!0,r.field_fullscreen.hide=!0,r.field_viewtype.hide=!0,r.data.step.progress=0,r.data.is_start=!1,r.field_create.enabled=!1,r.field_lookrecover.hide=!0,r.field_saveexp.hide=!0,r.field_delay.hide=!0}}),window.onresize=function(){e.checkFull()?r.field_fullscreen.title=r.i18n.exitfullscreen:r.field_fullscreen.title=r.i18n.fullscreen;var t=i(window).height();r.container.find("#displayvm").height(t);var n=i(window).width();r.container.find("#displayvm").width(n),r.container.find(".expDesktop_head_wrap").width(.9*n),r.set_vm_scale(),r.msg.init()},t.events.changetabs=function(e,t){for(var i=0;i<r.data.doctabs.length;i++)r.data.doctabs[i].active=!1;if(e.active=!0,"report"==e.field){new l("content",r.data,r.service).init()}else"material"==e.field?r.get_step_attachment():"evaluation"==e.field&&r.comment.init()},t.events.goback=function(){history.go(-1)}},setDataControl:function(e){this.dataControl=e,this.service=new u(this.dataControl),this.dataControl.addLisenter("step",this,this.socket),this.dataControl.addLisenter("assist",this,this.socket)},socket:function(t,n,r){var a=this;if(n=String(n),this.vstep_id===n&&t==e.vm_op_status.op_failed)return e.msg_error("实验环境创建失败"),a.close_vm(),void(a.data.vm_status=e.vm_status.closed);if(this.vstep_id===n&&(t===e.vm_status.creating||t===e.vm_status.running)&&"study"===r.data.mode){if(a.data.vm_status=e.vm_status.creating,a.data.step.progress=r.data.progress,!r.data.is_complete)return;a.remain_time=r.data.remain_time,a.data.vm_status=e.vm_status.running,a.data.step.progress=0,this.setTime(r.data.remain_time);var o={allow_vpn:r.data.allow_vpn,vpn_info:r.data.vpn_info,protocol:r.data.current_active_rs.protocol,res_id:r.data.current_active_rs.res_id,token:r.data.current_active_rs.token,ip:r.data.current_active_rs.ip,os_password:r.data.current_active_rs.os_password,os_username:r.data.current_active_rs.os_username,os_type:r.data.current_active_rs.os_type.toLowerCase(),op_system_type:r.data.current_active_rs.type,lab_interact_code:r.data.current_active_rs.lab_interact_code,lab_interact_id:r.data.current_active_rs.lab_interact_id};i.extend(a.data.step,o),this.setvm_param(),this.data.step.res_list=r.data.res_list}if(this.vstep_id===n&&"time_remind"===r.action&&"study"===r.data.mode&&(a.data.timeout.allSecond=r.data.remain_time,a.setTime(r.data.remain_time),a.overtime()),this.vstep_id===n&&"end"===r.data.stage&&(r.action===e.vm_status.time_end||r.action===e.vm_status.closing))if("time_end"===r.action)e.msg_warning(a.i18n.study_timeout,null,{closeButton:!0,onCloseClick:function(){a.close_vm()},onHidden:function(){a.close_vm()}});else if("lab_delete"===r.action){var s=layer.alert("此次实验您学习了大约"+r.data.eff_time+"分钟,继续努力!",{title:a.data.getGroup_res_data.title,closeBtn:1,icon:6},function(){layer.close(s)});a.close_vm()}else a.close_vm();"realtime"!==r.action&&"exception_order"!==r.action||r.data.course_id!=a.course_id&&r.data.group_id!=a.group_id&&r.data.step_id!=a.vstep_id||(r.data.action=r.action,a.msg.setContent(r.data))},setvm_param:function(){var t=this;t.data.vm_param={token:t.data.step.token,protocol:t.data.step.protocol,res_id:t.data.step.res_id,os_type:t.data.step.os_type,op_system_type:t.data.step.op_system_type,lab_interact_code:t.data.step.lab_interact_code,lab_interact_id:t.data.step.lab_interact_id},t.data.is_fullscreen=e.checkFull()},show_vm:function(){var t=this;if(vm_width=window.screen.width,vm_height=window.screen.height,t.data.vm_param.token){var n=String(t.data.vm_param.token),o=t.data.vm_param.protocol,s=t.data.vm_param.res_id,l=t.data.vm_param.op_system_type,u=t.data.vms;for(var d in u)u[d].clear&&u[d].clear();if(l!==e.op_system_type.interact){var h="vm_token="+n+"&vm_protocol="+o+"&vm_resid="+s+"&vm_width="+vm_width+"&vm_height="+vm_height,p={i18n:t.i18n,tunnel_url:SDC.sock_type+"://"+SDC.guacHost+"/v1/learn",url:h,protocol:o,os_type:t.data.vm_param.os_type,token:n,box_width:i(".expDesktop_editormd_box").width()},f=new r(t.container.find("#display"),p);t.guac_init=f.init(),u[s]=f}else{t.data.step.box_width=i(".expDesktop_editormd_box").width();var m=new a(t.container.find("#displaynotebook"),t.data.step);t.interact_init=m.init(),u[s]=m}t.data.show_vm.code_data={vm_protocol:o,step_id:t.vstep_id,vm_resid:s,type:"study"},t.code=new c(t.data,t.service),t.code.init("start")}},set_vm_scale:function(){var e=this,t=e.data.vms,n=i(window).width();e.ishind||(n=i(window).width()-e.exp_width),t[e.data.vm_param.res_id]&&t[e.data.vm_param.res_id].set_vm_scale(n)},set_vm_ips:function(){var e=this,t=e.data.step.res_list;e.field_vm_name.data=[],t.forEach(function(t){e.field_vm_name.data.push({id:t.res_id,title:t.res_name}),e.data.step.vm_models[t.res_id]=t.protocol_list,e.res_list[t.res_id]=t}),e.field_vm_name.value=e.data.step.res_id,e.set_protocols()},set_interacts:function(){var t=this,i=t.data.step.res_list;t.field_interacts.data=[],i.forEach(function(i){i.type===e.op_system_type.interact&&i.res_id===t.data.step.res_id&&(t.field_interacts.data=i.interact_list)}),t.field_interacts.data.length&&(t.data.step.lab_interact_code=t.field_interacts.data[0].lab_interact_code,t.data.step.lab_interact_id=t.field_interacts.data[0].lab_interact_id),t.field_interacts.value=t.data.step.lab_interact_code},set_protocols:function(){var e=this;e.field_protocols.data=[];var t=[],i=e.data.step.vm_models[e.data.step.res_id];i&&i.forEach(function(i){t.push({id:i,title:e.i18n[i]})}),e.field_protocols.data=t,1!==t.length&&e.data.step.protocol||!t.length||(e.data.step.protocol=t[0].id),e.field_protocols.value=e.data.step.protocol},setTime:function(e){var t=this;this.timer&&clearInterval(this.timer),t.data.timeout.allSecond=e;var i=t.data.timeout,n=Math.floor(e/86400);i.day=n,i.hour=Math.floor(e/3600),i.hour.toString().length<2&&(i.hour="0"+i.hour),i.minute=Math.floor((e-3600*i.hour)/60),i.minute.toString().length<2&&(i.minute="0"+i.minute),i.second=Math.floor(e-3600*i.hour-60*i.minute),i.second.toString().length<2&&(i.second="0"+i.second);var r=0;this.timer=setInterval(function(){if((r+=1)>e)clearInterval(t.timer),i.day="0",i.hour="00",i.minute="00",i.second="00",t.data.timeout.allSecond=0;else{var n=e-r;t.data.timeout.allSecond=n;var a=Math.floor(n/86400);i.day=a,i.hour=Math.floor(n/3600),i.hour.toString().length<2&&(i.hour="0"+i.hour),i.minute=Math.floor((n-3600*i.hour)/60),i.minute.toString().length<2&&(i.minute="0"+i.minute),i.second=Math.floor(n-3600*i.hour-60*i.minute),i.second.toString().length<2&&(i.second="0"+i.second)}},1e3)},close_vm:function(){var t=this;t.code&&t.code.init("end");for(var i in t.data.vms){var n=t.data.vms[i];n.clear&&n.clear(),n=null}t.data.step.progress=0,t.data.vm_param="",t.data.step.token="",t.data.step.protocol="",t.data.step.res_id="",t.data.step.res_list=[],t.data.step.vm_models=[],t.data.step.ip="",t.data.step.os_password="",t.data.step.os_username="",t.data.step.os_type="",t.data.step_msg="",e.exitFullScreen(t.data),e.checkFull()&&!(document.webkitIsFullScreen||document.msFullscreenElement||document.mozFullScreen||document.fullscreen)&&e.msg_info("请按(F11)退出全屏"),t.data.is_fullscreen=!1,t.setTime(0),layer.close(t.overtimeLayer),t.data.vm_status=e.vm_status.closed},loading:function(){var t=this;t.isloading=!1;var i=document.getElementById("c");e.shuidi_loading(i,function(e){return t.data.step.progress},function(e){t.data.step.progress&&100!==t.data.step.progress||(cancelAnimationFrame(e),t.container.find("#vm_progress").addClass("hide"),t.isloading=!0)})},clearfacus:function(){this.container.find("input").blur(),this.container.find("select").blur()},setData:function(t){var n=this;t&&(n.vstep_id=t,n.data.vstep_id=t,layui.use("element",function(){layui.element}),n.tools_show_fun(),n.editormd_show_fun(),this.service.getGroup_courseStep(t).done(function(t){n.group_id=t.group_id,n.course_id=t.course_id,n.data.desktop_title=t.title,n.data.getGroup_res_data=t,n.data.allow_save=t.step_manage_spec.allow_save||"false","true"==n.data.allow_save&&n.data.vm_status==e.vm_status.running?n.field_saveexp.hide=!1:n.field_saveexp.hide=!0,n.data.allow_delay=t.step_manage_spec.allow_delay||"false",n.data.password_view=t.step_manage_spec.allow_savepsd||"false",n.data.isloaded=!0,n.step_id=t.id,"pub_course"!==n.data.getGroup_res_data.c_type&&"contest_course"!==n.data.getGroup_res_data.c_type&&(n.data.doctabs[2].show=!0),"contest_course"==n.data.getGroup_res_data.c_type&&(n.data.doctabs[1].show=!1),n.container.find("#docmarkdown").empty(),n.container.find("#docmarkdown").css({height:"100%"}),n.container.find("#docmarkdown").html('<div style="width: 100%;height: 100%;"><div style="width: 100%;height: 100%;overflow-y: auto"><div id="docmarkdown_doc"><textarea id="step_content" style="width:auto;display:none;"></textarea></div></div></div>'),new s("docmarkdown_doc",{markdown:t.step_doc,image_Remote_URL:e.getDomain(e.domain_type.step)}).init(),n.comment=new o(n.step_id,n.container,n.data,n.service)}).fail(function(){}),this.service.check_courseStep(t).done(function(t){if(n.data.lab_save_count=t.lab_save_count,0!=n.data.lab_save_count&&n.data.lab_save_count||(n.field_lookrecover.hide=!0),t.status===e.vm_op_status.op_failed)return void(n.data.vm_status=e.vm_status.closed);if(t.action===e.vm_status.closed)return void(n.data.vm_status=e.vm_status.closed);if(t.action===e.vm_status.creating&&(n.data.vm_status=e.vm_status.creating,n.data.step.progress=t.action_info.process),t.action_info.is_complete){var r={allow_vpn:t.action_info.allow_vpn,vpn_info:t.action_info.vpn_info,protocol:t.action_info.current_res.protocol,res_id:t.action_info.current_res.res_id,token:t.action_info.token,ip:t.action_info.current_res.ip,os_password:t.action_info.current_res.os_password,os_username:t.action_info.current_res.os_username,os_type:t.action_info.current_res.os_type.toLowerCase(),op_system_type:t.action_info.current_res.type,lab_interact_code:t.action_info.current_res.lab_interact_code,lab_interact_id:t.action_info.current_res.lab_interact_id};i.extend(n.data.step,r),n.setvm_param(),n.data.step.res_list=t.action_info.res_list,n.remain_time=t.action_info.remain_time,n.setTime(t.action_info.remain_time),n.data.vm_status=e.vm_status.running}}))},get_step_attachment:function(){var e=this,t=e.data.getGroup_res_data;e.service.step_attachment({course_id:t.course_id,step_id:t.id}).done(function(t){t.step_attachment_list.forEach(function(e){e.size=Math.floor(e.size/1024)}),e.data.step_attachment_list=t.step_attachment_list})},get_assist_list:function(t){var i=this;i.data.step_msg="",this.service.get_assist_list({step_id:t,type:e.Assist_type.assisted}).done(function(e){if(e.assist_list&&e.assist_list.length){var t=e.assist_list[e.assist_list.length-1];i.data.assist_process_token=t.process_token,i.get_assist_status(t)}})},get_assist_status:function(e){var t=this;switch(e.status){case"inited":t.data.step_msg="正在向"+e.op_user_real_name+"发起协助请求",t.data.is_assist=!0;break;case"accepted":t.data.step_msg=e.op_user_real_name+t.i18n[e.status]+"了发起的协助请求",t.data.is_assist=!0;break;case"rejected":case"completed":t.data.step_msg=e.op_user_real_name+t.i18n[e.status]+"了发起的协助请求",t.data.is_assist=!1;break;case"established":
|
||
t.data.step_msg=e.op_user_real_name+"正在协助,请务断开",t.data.is_assist=!0;break;case"error":case"timeout":t.data.step_msg="向"+e.op_user_real_name+"发起协助请求"+t.i18n[e.status],t.data.is_assist=!1}},refreshData:function(e){this.setData(e)},onInitialize:function(t){var n=this;this.initialized=!0,this.DragLeftBar(),this.DragDoc(),this.DragTime();var r=i(window).height();if(n.container.find("#displayvm").height(r),n.container.find(".console-ullist").removeClass("hide"),n.container.find(".expDesktop_head_wrap").width(.9*i(window).width()),n.container.find(".right-toolbar").overlayScrollbars({scrollbars:{autoHide:"l",autoHideDelay:100}}),t){n.vstep_id=t;for(var a=0;a<n.data.step.fields.length;a++){var o=n.data.step.fields[a];n["field_"+o.field]=o}n.field_vm_name=n.data.step.vm_name,n.field_protocols=n.data.step.protocols,n.field_interacts=n.data.step.interacts,localStorage.getItem(SDC.user.user_id+"_"+n.vstep_id)||localStorage.setItem(SDC.user.user_id+"_"+n.vstep_id,10),n.setData(t),msg=new v,n.msg=msg.init(),n.container.delegate('button[name="create"]:not(.disabled)',"click",function(){n.container.find('button[name="create"]').addClass("disabled"),n.data.step.progress=1,n.data.vm_status=e.vm_status.creating,n.service.create_vm({step_id:t,vr_token:e.getLocalStorage("vs_username"),vr_un:e.getLocalStorage("vs_access_token")}).done(function(){n.data.vm_status=e.vm_status.creating}).fail(function(t){var i=JSON.parse(t.responseText);if(n.container.find('button[name="create"]').removeClass("disabled"),i.code)switch(i.code){case 50003:case 50004:case 50005:break;default:n.data.vm_status=e.vm_status.closed}n.data.vm_status=e.vm_status.closed})}),n.container.delegate(".console_bg_img img","click",function(){var r=this;n.imgClick=!0,n.container.find('button[name="create"]').addClass("disabled"),n.data.step.progress=1,n.data.vm_status=e.vm_status.creating,n.service.create_vm({step_id:t,vr_un:e.getLocalStorage("vs_username"),vr_token:e.getLocalStorage("vs_access_token")}).done(function(){n.data.vm_status=e.vm_status.creating,n.imgClick=!1,i(r).attr({src:"/static/public/img/console_bg_img.png"})}).fail(function(t){var a=JSON.parse(t.responseText);if(n.imgClick=!1,i(r).attr({src:"/static/public/img/console_bg_img.png"}),n.container.find('button[name="create"]').removeClass("disabled"),a.code)switch(a.code){case 50003:case 50004:case 50005:break;default:n.data.vm_status=e.vm_status.closed}n.data.vm_status=e.vm_status.closed})}),n.container.delegate(".console_bg_img","mouseover",function(){n.imgClick||i(this).find("img").attr({src:"/static/public/img/console_bg_img_hover.png"})}),n.container.delegate(".console_bg_img","mouseout",function(){n.imgClick||i(this).find("img").attr({src:"/static/public/img/console_bg_img.png"})}),n.container.delegate('button[name="help"]:not(.disabled)',"click",function(){new d(n.language,n.appOptions,n.service,t,function(e){n.data.current_assister=e.op_user,n.data.current_assis_type=e.op_type,n.get_assist_list(t)}).show()}),n.container.delegate('button[name="unhelp"]:not(.disabled)',"click",function(){n.dataControl.message.confirm(n.i18n.cancel,n.i18n.assist,function(e){n.service.cancel_assist({token:n.data.assist_process_token}).done(function(){n.data.is_assist=!1}),layer.close(e)})}),n.container.delegate('button[name="forced_close"]:not(.disabled)',"click",function(){i(this).blur(),layer.confirm("是否强制关闭实验环境?",{title:n.i18n.close},function(i){n.vm_is_refresh(),layer.close(i),n.service.self_clean_resource({mode:"study",step_id:t}).done(function(){n.data.vm_status=e.vm_status.closing}).fail(function(t){e.msg_error(t.responseJSON.message)})},function(e){layer.close(e)})}),n.container.delegate('button[name="close"]:not(.disabled)',"click",function(){i(this).blur(),layer.confirm("实验环境将被删除,确定关闭?",{title:n.i18n.close},function(i){layer.close(i),new f(n.language,n.appOptions,n.service,n.vstep_id,n.step_id,n.data.desktop_title,function(){n.vm_is_refresh(),n.service.close_vm(t).done(function(){n.data.vm_status=e.vm_status.closing}).fail(function(e){})}).show()},function(e){layer.close(e)})}),n.container.delegate('button[name="lookrecover"]:not(.disabled)',"click",function(){var t=!0;n.data.vm_status==e.vm_status.running&&(t=!1),new h(n.language,n.appOptions,n.service,t,n.data.getGroup_res_data,function(t){if("delete"==t)return n.data.lab_save_count=n.data.lab_save_count-1,0!=n.data.lab_save_count&&n.data.lab_save_count||(n.field_lookrecover.hide=!0),!1;var i={step_id:n.data.getGroup_res_data.rel_c_s_g_id,lab_save_id:t.id};n.container.find('button[name="create"]').addClass("disabled"),n.service.recover_lab(i).done(function(t){204==t.op_code?layer.confirm("ip已经被占用是否切换其他ip?",{btn:["确定","取消"]},function(t){layer.close(t),i.retry_keep_ip=!1,n.service.recover_lab(i).done(function(t){n.data.vm_status=e.vm_status.creating}).fail(function(t){n.data.vm_status=e.vm_status.closed,n.container.find('button[name="create"]').removeClass("disabled")})},function(){n.data.vm_status=e.vm_status.closed,n.container.find('button[name="create"]').removeClass("disabled")}):n.data.vm_status=e.vm_status.creating}).fail(function(t){n.data.vm_status=e.vm_status.closed,n.container.find('button[name="create"]').removeClass("disabled")})}).show()}),n.container.delegate('button[name="saveexp"]:not(.disabled)',"click",function(){new p(n.language,n.appOptions,n.service,n.vstep_id,function(e){n.data.lab_save_count=n.data.lab_save_count+1,n.field_lookrecover.hide=!1}).show()}),n.container.delegate('button[name="delay"]:not(.disabled)',"click",function(){if(n.data.timeout.allSecond>1800)var t=e.timeDivision(1800),i=e.timeDivision(n.data.timeout.allSecond),r="实验剩余时间 "+i+",剩余时间小于 "+t+"才可以延时",a=layer.alert(r,{title:"实验延时",closeBtn:1,icon:6},function(){layer.close(a)});else n.overtime()}),n.container.delegate('a[name="textcopy"]:not(.disabled)',"click",function(){var t=e.selectText();if(!t)return void e.msg_warning(n.i18n.noselectText);var i=n.data.vms;for(var r in i)i[r].guac_client&&i[r].guac_client.setClipboard(t);layer.tips("已复制",this,{tips:1,time:1e3})}),n.container.delegate(".document-copy","click",function(){for(var t=[],r=i(this).parent().find("code"),a=0;a<r.length;a++)code=r[a],t.push(i(code).text());if(!t.length)return void e.msg_warning(n.i18n.noselectText);var o=n.data.vms;for(var s in o)o[s].guac_client&&o[s].guac_client.setClipboard(t.join("\n"));layer.tips("已复制",this,{tips:1,time:1e3})}),n.container.delegate(".document-copy:not(.disabled)","mouseover",function(){n.copy_tip=layer.tips("复制内容",this,{tips:1,time:-1})}),n.container.delegate(".document-copy:not(.disabled)","mouseout",function(){n.copy_tip&&layer.close(n.copy_tip)}),n.container.delegate('button[name="refresh"]:not(.disabled)',"click",function(){i(this).blur(),n.vm_is_refresh(),n.show_vm()}),n.container.find("#btntoolbar").toolbar({content:"#toolbar-options",position:"bottom",style:"primary"}),n.container.find("#btntoolbar").on("toolbarItemClick",function(e,t,i){i.hide()}),n.container.find("#btntoolbar").on("toolbarShown",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.find("#btntoolbar").on("toolbarHidden",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.find("#docmarkdown").on("mouseup",function(){var t;if((t=document.selection?document.selection.createRange().text:window.getSelection()+"")&&n.data.vms){var r=e.getMousePos();if(i("#btntoolbar").css({left:r.x,top:r.y}),window.ActiveXObject||"ActiveXObject"in window){var a=n.data.vms;for(var o in a)a[o].guac_client&&a[o].guac_client.setClipboard(t);layer.tips("已复制","#btntoolbar",{tips:1,time:1e3})}else n.container.find("#btntoolbar").trigger("mouseover")}}),n.container.delegate('button[name="fullscreen"]',"click",function(){e.checkFull()?(e.exitFullScreen(n.data),e.checkFull()&&!(document.webkitIsFullScreen||document.msFullscreenElement||document.mozFullScreen||document.fullscreen)&&e.msg_info("请按(F11)退出全屏")):e.fullScreen(n.data)}),n.container.delegate('button[name="exception"]',"click",function(){new g(n.language,n.appOptions,n.service,t,function(){}).show()}),n.container.delegate('button,input[type="button"]',"click",function(){i(this).blur()}),n.container.delegate("select","change",function(){i(this).blur()})}},overtime:function(){var t=this,n=e.timeDivision(3600),r=e.timeDivision(t.data.timeout.allSecond);t.overtimeLayer=layer.confirm("注意:实验剩余时间 "+r+",时间结束后实验会被删除,如需延长时间请点击“延时”按钮延时"+n+"。",{title:"实验即将结束",btn:["延时","取消"]},function(n){layer.close(n);var r={add_time:60,step_id:t.data.vstep_id};e.msg_info('<span id="confirm">正在延时,请稍后...</span>',null,{timeOut:0,extendedTimeOut:0}),t.service.overtime_server(r).done(function(e){i("#confirm").text("延时成功"),t.setTime(e.remain_time),setTimeout(function(){b.clear()},500)}).fail(function(e){i("#confirm").text("延时失败"),setTimeout(function(){b.clear()},1e3)})})},onClose:function(){this.content&&this.content.destroy(),this.container.remove()},getModelLabel:function(){return"expdesktop_view"},setDisabled:function(){this.data.reportBtn="disabled",UM.getEditor("content").setDisabled("fullscreen")},tools_hide_fun:function(){var e=i(window).width(),t=this;"max"==t.data.toggle.editormd_show&&i(".editormd-toggle").animate({left:e-26+"px"}),i(".hide-tools").css("display","block"),i(".show-tools").css("display","none"),i(".expDesktop_tool").animate({right:"-140px"},function(){t.data.toggle.tools_show="hide"})},tools_show_fun:function(){var e=i(window).width(),t=this;"max"==t.data.toggle.editormd_show&&i(".editormd-toggle").animate({left:e-26-140+"px"}),i(".hide-tools").css("display","none"),i(".show-tools").css("display","block"),i(".expDesktop_tool").animate({right:"0"},function(){t.data.toggle.tools_show="display"})},editormd_hide_fun:function(){var e=this;e.data.toggle.editormd_show="hide",e.ishind=!0,i(".hide-editormd").css("display","block"),i(".show-editormd").css("display","none"),i(".maximize-editormd").css("display","none"),i(".expDesktop_editormd").animate({left:-e.exp_width+"px"},function(){}),i(".editormd-toggle").animate({left:0},function(){}),i(".expDesktop_editormd_box").animate({width:0},function(){e.set_vm_scale()})},editormd_show_fun:function(){var e=this;e.data.toggle.editormd_show="display",e.data.editormd.editormd_show="显示文档";var t=document.getElementsByClassName("editormd-toggle-move")[0],n=document.getElementsByClassName("editormd-toggle")[0];i(t).show(),i(n).css({top:e.dragDoc+"px"}),e.ishind=!1,i(".hide-editormd").css({display:"none"}),i(".show-editormd").css({display:"block"}),i(".maximize-editormd").css("display","block"),i(".editormd-toggle").animate({left:e.exp_width-26+"px"}),i(".expDesktop_editormd").animate({width:e.exp_width+"px",left:0},function(){}),i(".expDesktop_editormd_box").animate({width:e.exp_width+"px"},function(){e.set_vm_scale()})},editormd_maximize_fun:function(){var e=this,t=0;e.data.toggle.editormd_show="max",e.data.editormd.editormd_show="还原文档","display"==e.data.toggle.tools_show&&(t=140);var n=document.getElementsByClassName("editormd-toggle-move")[0];i(n).hide();var r=i(window).width();i(".hide-editormd").css("display","block"),i(".show-editormd").css("display","none"),i(".maximize-editormd").css("display","none"),i(".editormd-toggle").animate({left:r-26-t+"px"}),i(".editormd-toggle").css({top:e.dragDocInit+"px"}),i(".expDesktop_editormd").animate({left:0,width:r+"px"}),i(".expDesktop_editormd_box").animate({width:r+"px"},function(){})},DragLeftBar:function(){var e=this,t=document.getElementsByClassName("shuidi-left-drag")[0],n=document.getElementsByClassName("expDesktop_editormd")[0],r=document.getElementsByClassName("expDesktop_editormd_box")[0],a=document.getElementsByClassName("editormd-toggle")[0];t.onmousedown=function(o){function s(t){t.preventDefault();var r=[0,0];r=c<e.windpi.sm?[100,420]:e.windpi.sm<=c&&c<e.windpi.md?[260,480]:e.windpi.md<=c&&c<e.windpi.lg?[320,600]:[320,800],r[1]>=c&&(r[1]=c);var o=(t||window.event).clientX;o<=r[0]?o=r[0]:o>=r[1]&&(o=r[1]);var s=o-u;i(n).width(d+s+"px"),i(".expDesktop_editormd_box").css({width:d+s+"px"},function(){}),i(a).css({left:d+s-26+"px"}),e.exp_width=d+s,e.set_vm_scale()}function l(){t.releaseCapture?(t.onmousemove=null,t.onmouseup=null,t.releaseCapture()):(document.removeEventListener("mousemove",s,!0),document.removeEventListener("mouseup",l,!0))}var c=i(window).width(),u=(o||window.event).clientX,d=i(r).width();t.setCapture?(t.onmousemove=s,t.onmouseup=l,t.setCapture()):(document.addEventListener("mousemove",s,!0),document.addEventListener("mouseup",l,!0))}},DragDoc:function(){var e=this,t=document.getElementsByClassName("editormd-toggle-move")[0],n=document.getElementsByClassName("editormd-toggle")[0];t.onmousedown=function(r){function a(t){t.preventDefault();var r=(t||window.event).clientY;r<=48?r=48:r>=l-10&&(r=l-10);var a=r-c;i(n).css({top:s+a+"px"}),e.dragDoc=s+a}function o(){t.releaseCapture?(t.onmousemove=null,t.onmouseup=null,t.releaseCapture()):(document.removeEventListener("mousemove",a,!0),document.removeEventListener("mouseup",o,!0))}var s=i(n).position().top,l=i(window).height(),c=(r||window.event).clientY;t.setCapture?(t.onmousemove=a,t.onmouseup=o,t.setCapture()):(document.addEventListener("mousemove",a,!0),document.addEventListener("mouseup",o,!0))}},DragTime:function(){var e=document.getElementsByClassName("console_residue_time")[0];e.onmousedown=function(t){function n(t){t.preventDefault();var n=(t||window.event).clientX;n<=40?n=40:n>=o-60&&(n=o-60);var r=n-s;i(e).css({left:a+r+"px"})}function r(){e.releaseCapture?(e.onmousemove=null,e.onmouseup=null,e.releaseCapture()):(document.removeEventListener("mousemove",n,!0),document.removeEventListener("mouseup",r,!0))}var a=i(e).position().left,o=i(window).width();a<=0&&(a=0,i(e).css({left:"0px"})),a>=o-100&&(a=o-100,i(e).css({left:a+"px"}));var s=(t||window.event).clientX;e.setCapture?(e.onmousemove=n,e.onmouseup=r,e.setCapture()):(document.addEventListener("mousemove",n,!0),document.addEventListener("mouseup",r,!0))}},vm_is_refresh:function(){this.guac_init&&(this.guac_init.options.refresh=!0)}};return i.extend(C.prototype,t.prototype),i.extend(C.prototype,T),C}),define("text!modules/utils/api_tlab.json",[],function(){return'{\r\n "api": {\r\n "develop": {\r\n\r\n "createCourse": "/qcos/qcec/v1/course_info",\r\n "getLab_Templates": "/ecos/qcec/v1/lab_template",\r\n "createvclass": "http://172.16.102.129:9999/mock-api/client/5ae00d58e1f51a012a9832b9",\r\n "getvclass": "http://172.16.102.129:9999/mock-api/client/5ae01d2e404d530129181289",\r\n\r\n "publishcourse": "http://172.16.102.129:9999/mock-api/client/5ae173f9e1f51a012a98333e/{0}/publish",\r\n "unpublishcourse": "http://172.16.102.129:9999/mock-api/client/5ae1766c0023b90124e8626a/{0}/unpublish",\r\n "deletecourse": "http://172.16.102.129:9999/mock-api/client/5ae17e13404d53012918131a/",\r\n "get_teacher_student": "http://172.16.102.129:9999/mock-api/client/5ae16644e1f51a012a983328",\r\n "out_teacher_student": "http://172.16.102.129:9999/mock-api/client/5ae2d7c4bc0c5c0130c16619/{0}/remove_member",\r\n "get_invite_code": "http://172.16.102.129:9999/mock-api/client/5ae30712bc0c5c0130c1664b",\r\n "getconsoles": "http://172.16.102.129:9999/mock-api/client/5ae561600023b90124e8645c",\r\n "getres_spec": "http://172.16.102.129:9999/mock-api/client/5ae9399d0023b90124e8651e",\r\n "createtemplate_vm": "http://172.16.102.129:9999/mock-api/client/5ae9a0a40023b90124e86526",\r\n "bindvm_template": "http://172.16.102.129:9999/mock-api/client/5ae9a1fe404d530129181635/",\r\n "updatevclass": "http://172.16.102.129:9999/mock-api/client/5ae2bbf2404d53012918139d/",\r\n "deletevclass": "http://172.16.102.129:9999/mock-api/client/5aea6f1bbc0c5c0130c1683f/",\r\n\r\n "shift_step": "http://172.16.102.129:9999/mock-api/client/5aed40b5404d53012918166b/",\r\n\r\n "getpclasslist": "http://172.16.102.129:9999/mock-api/client/5ae064aabc0c5c0130c16500",\r\n\r\n "createsclasscontent": "http://172.16.102.129:9999/mock-api/client/5b0e011fbc0c5c0130c1688e",\r\n "getsclasscourse": "http://172.16.102.129:9999/mock-api/client/5b0dffa9404d530129181693",\r\n "get_sclass": "http://172.16.102.129:9999/mock-api/client/5b0dffa9404d530129181693",\r\n "deletesclass": "http://172.16.102.129:9999/mock-api/client/5b10a40b404d5301291816dd/"\r\n },\r\n "online": {\r\n "createCourse": "/qcos/qcec/v1/course_info",\r\n "getLab_Templates": "/ecos/qcec/v1/lab_template",\r\n "createvclass": "/ecos/qcec/v1/vclass",\r\n "getvclass": "/ecos/qcec/v1/vclass",\r\n "get_teacher_student": "/ecos/qcec/v1/teacher_student",\r\n "out_teacher_student": "/ecos/qcec/v1/group/{0}/remove_member",\r\n "publishcourse": "/ecos/qcec/v1/course/{0}/publish",\r\n "unpublishcourse": "/ecos/qcec/v1/course/{0}/unpublish",\r\n "deletecourse": "/ecos/qcec/v1/course/",\r\n "get_invite_code": "/ecos/qcec/v1/invite_code/get_teacher_vcode",\r\n "getconsoles": "/ecos/qcedu/v1/console_list",\r\n "getres_spec": "/ecos/qcec/v1/res_spec/",\r\n "createtemplate_vm": "/ecos/qcec_console/v1/console/",\r\n "bindvm_template": "/ecos/qcec_console/v1/console/",\r\n "updatecourse": "/ecos/qcec/v1/vclass/",\r\n "deletevclass": "/ecos/qcec/v1/vclass/",\r\n "shift_step": "/ecos/qcec/v1/step/shift_step/",\r\n\r\n "getpclasslist": "/ecos/qcec/v1/group_course/get_all_pub_course",\r\n\r\n "createsclasscontent": "/ecos/qcec/v1/sclass",\r\n "getsclasscourse": "/ecos/qcec/v1/sclass",\r\n "get_sclass": "/ecos/qcec/v1/sclass",\r\n "deletesclass": "/ecos/qcec/v1/sclass/",\r\n "group_step": "/ecos/qcec/v1/step/",\r\n "check_courseStep": "/ecos/qcec_console_nsq/v1/preview/",\r\n "create_vm": "/ecos/qcec_console_nsq/v1/preview/",\r\n "close_vm": "/ecos/qcec_console_nsq/v1/preview/",\r\n "cancel_assist": "/ecos/qcec_console/v1/step_assist/",\r\n "get_assist_list": "/ecos/qcec_console_nsq/v1/lab_assist"\r\n }\r\n }\r\n}'}),define("modules/utils/baseservice_tlab",["network-utils","jquery","text!modules/utils/api_tlab.json"],function(e,t,i){var n=function(){};return n.prototype={api:JSON.parse(i).api.online,createCourse:function(t){return e.doPost("/qcos/qcedu/v1/course_info",t)},courseList:function(t){return e.doGet("/ecos/qcec/v1/course",t)},updateCourse:function(t,i){return e.doPut("/qcos/qcedu/v1/course_info/"+t,i)},update_plan:function(t,i){return e.doPut("/qcos/qcedu/v1/course_plan/"+t,i)},updateProject:function(t,i){return e.doPut("/qcos/qcedu/v1/project_info/"+t,i)},createCourseOrder:function(t){return e.doPost("/qcos/qcedu/v1/course_order",t)},createCoursePlan:function(t){return e.doPost("/qcos/qcedu/v1/course_plan",t)},getSteps:function(t){return e.doGet("/qcos/qcedu/v1/experiment_step?ep_id="+t)},getClass_Team_Students:function(t,i){return e.doGet("/qcos/qcedu/v1/class_team_student?class_id="+t+"&project_id="+i)},delete_plan:function(t){return e.doDelete("/qcos/qcedu/v1/course_plan/"+t)},createProjectTeam:function(t){return e.doPost("/qcos/qcedu/v1/team_info",t)},createTeamStudent:function(t){return e.doPost("/qcos/qcedu/v1/team_student",t)},createProject:function(t){return e.doPost("/qcos/qcedu/v1/project_info",t)},createProjectOrder:function(t){return e.doPost("/qcos/qcedu/v1/project_order",t)},getLab_Templates:function(t){return e.doGet(this.api.getLab_Templates,t)},getSoftwares:function(t){return e.doGet("/ecos/qcec/v1/software",t)},getOs:function(t){return e.doGet("/ecos/qcec/v1/et_opsystem",t)},getFlavors:function(t){return e.doGet("/ecos/compute/v2/"+SDC.user.project_id+"/flavors/detail",t)},getCourseDetail:function(t){return e.doGet("/ecos/qcec/v1/course/"+t)},createStep:function(t){return e.doPost("/ecos/qcec/v1/step",t)},createDocStep:function(t){return e.doPost("/ecos/qcec/v1/step/add_doc_step",t)},getStep:function(t){return e.doGet("/ecos/qcec/v1/step",t)},getStepDetail:function(t){return e.doUnescapeGet("/ecos/qcec/v1/step/"+t)},editStep:function(t,i){return e.doPut("/ecos/qcec/v1/step/"+t,i)},deleteStep:function(t){return e.doDelete("/ecos/qcec/v1/step/"+t)},getConsoles:function(t){return e.doPost(this.api.getconsoles,t)},getRes_spec:function(t){return t||(t={}),e.doGet(this.api.getres_spec,t)},create_lab_template:function(t){return e.doPost("/ecos/qcec/v1/lab_template",t)},getvclass_list:function(t){return e.doGet(this.api.getvclass,t)},getsclass_list:function(t){return e.doGet(this.api.getsclass,t)},getGroup_courseStep:function(t){return e.doUnescapeGet(this.api.group_step+t)},check_courseStep:function(t){return e.doGet(this.api.check_courseStep+t)},create_vm:function(t){return e.doPost(this.api.create_vm,t)},close_vm:function(t){return e.doPost(this.api.close_vm+"close/",{step_id:t})},cancel_assist:function(t){return e.doPost(this.api.cancel_assist,t)},get_assist_list:function(t){return e.doGet(this.api.get_assist_list,t)}},n}),define("modules/console/monitor/service",["network-utils","jquery","modules/utils/baseservice_tlab"],function(e,t,i){var n=function(e){this.dataControl=e};return n.prototype={getvm_screen:function(t,i){return e.doGet("/ecos/qcec/v1/vm/"+t+"/vm/"+i)}},t.extend(n.prototype,i.prototype),n}),define("text!modules/console/monitor/lang.json",[],function(){return'{\r\n "config": {\r\n "monitor_title":{"field": "monitor_title"}\r\n\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "monitor_title": "当前课程:{0},正在监控学生:{1}",\r\n "section_status": "部分完成",\r\n "undone_status": "未完成",\r\n "title": "实验报告",\r\n "save": "保存",\r\n "purpose": "实验目的",\r\n "savestep": "保存并提交",\r\n "name": "实验名称",\r\n "completion": "完成情况",\r\n "undone": "未完成原因",\r\n "content": "报告内容",\r\n "report": "实验报告",\r\n "remotely": "远程协助",\r\n "monitor": "实验监控",\r\n "scrapbooking": "剪贴板",\r\n "uploadFiles": "上传文件",\r\n "timeCost": "实验用时:",\r\n "doc": "文档",\r\n "question": "问答",\r\n "notes": "笔记",\r\n "evaluation": "评价",\r\n "fraction": "给步骤打分",\r\n "publish": "发表",\r\n "viewtype": "显示方式",\r\n "contitle": "实验桌面标题",\r\n "course_step_evaluate": "步骤评价",\r\n\r\n "send_comment": "发表",\r\n "grade": "给步骤评分",\r\n "create": "创建",\r\n "clipboard": "剪贴板",\r\n\r\n "close": "关闭",\r\n "help": "请求协助",\r\n "unhelp": "取消协助",\r\n "assist": "协助",\r\n "creatingvm": "正在创建实验环境……",\r\n "ladingvmerror": "加载实验环境失败,请点击刷新按钮或等待10秒重新加载",\r\n "rdp": "桌面版",\r\n "ssh": "命令行版",\r\n "waiting": "实验环境正在创建中…",\r\n "creating": "创建中…",\r\n "refresh": "刷新",\r\n "click": "点击创建加载环境...",\r\n "remain_time": "剩余时间",\r\n "hour": "时",\r\n "minute": "分",\r\n "second": "秒",\r\n "accept_assist": "对方已接受协助请求",\r\n "reject_assist": "对方拒绝了协助请求",\r\n "timeout": "学习时间已结束,实验环境已经删除。如果继续学习,请重新创建",\r\n "Warning": "温馨提示",\r\n "cannot_load": "加载实验环境失败,请重试",\r\n "operation_unsupported": "不支持此操作",\r\n "internal_error": "发生了内部错误,无法执行操作。",\r\n "vm_used_locked": "实验环境已经在使用或锁定,请刷新控制台页面",\r\n "vm_closed": "实验环境已经关闭,请重新创建",\r\n "vm_busy": "实验环境忙,需要首先释放连接,然后重试或尝试刷新操作",\r\n "vm_connect_use": "控制台已经被另一个连接使用,请先关闭该连接,或者刷新控制台页面。",\r\n "vm_authorized_fail": "授权失败,请联系管理员或尝试刷新操作",\r\n "vm_many_resources": "您已经使用了太多的资源,请关闭一些正在使用的实验环境或尝试刷新操作",\r\n "noselectText": "请先选中页面中的文本内容",\r\n "evaluate_tip": "还可以输入<span>{0}</span>字",\r\n "cancel": "取消"\r\n }\r\n }\r\n}'}),define("modules/console/monitor/controller",["app-utils","modules/console/basecontroller","jquery","guacamole","modules/console/monitor/service","text!modules/console/monitor/lang.json"],function(e,t,i,n,r,a){function o(e,t,i){this.container=e,this.language=t,this.appOptions=i,this.lang=a,this.guac=null,this.display=null}var s={initAvalon:function(e){var t=this;window.onresize=function(){t.set_vm_scale()}},setDataControl:function(e){this.dataControl=e,this.service=new r(this.dataControl)},show_vm:function(e){function t(e){var t=new Guacamole.Mouse.State(e.x/a.display.getScale(),e.y/a.display.getScale(),e.left,e.middle,e.right,e.up,e.down);a.guac.sendMouseState(t)}function n(e){a.guac.sendKeyEvent(1,e)}function r(e){a.guac.sendKeyEvent(0,e)}var a=this;a.guac&&a.guac.disconnect(),a.guac=new Guacamole.Client(new Guacamole.WebSocketTunnel("ws://"+SDC.DISPLAY_SERVER+"/vm_screen/console")),vm_width=i(window).width(),vm_height=i(window).height(),i("#display").children().remove(),i("#display").width(vm_width),i("#display").height(vm_height),i("#display").html(a.guac.getDisplay().getElement()),a.guac.onerror=function(e){console.log(e)},url="uuid="+e+"&width="+vm_width+"&height="+vm_height,a.guac.connect(url),this.display=a.guac.getDisplay(),i(".screen-loading").hide(),set_vm_scale();var o=new Guacamole.Mouse(a.guac.getDisplay().getElement()),s=new Guacamole.Keyboard(document);o.onmousedown=o.onmouseup=o.onmousemove=function(e){a.display.showCursor(!1),t(e)},s.onkeydown=n,s.onkeyup=r},set_vm_scale:function(){var e=this;i(window).width(),i(window).height(),e.display.getWidth(),e.display.getHeight();e.display.scale(1)},setData:function(e){var t=this,i=e.split("_");if(2==i.length){var n=localStorage.getItem(e);n&&(n=JSON.parse(n),t.data.monitor_title.title=t.data.monitor_title.title.replace(/[{](\d+)[}]/gi,function(e,t,i){switch(parseInt(t,10)){case 0:return n.course_name;case 1:return n.student_realname}}),t.service.getvm_screen(i[0],i[1]).done(function(e){t.show_vm(e.vm_id)}))}},refreshData:function(e){this.setData(e)},onInitialize:function(e){var t=this;this.initialized=!1,e&&t.setData(e)},getModelLabel:function(){return"expdesktop_view"}};return i.extend(o.prototype,t.prototype),i.extend(o.prototype,s),o}),define("modules/console/expconsole/model/guacamole/controller",["app-utils","jquery","guacamole"],function(e,t,i){function n(e,t,i,n){this.guac_client="",this.display="",this.token=t.token,this.tunnel_url=t.tunnel_url,this.url=t.url,this.element=e,this.i18n=t.i18n,this.options=t,this.data=i,this.callback=n}var r={init:function(){var e=this,i=new Guacamole.WebSocketTunnel(this.tunnel_url);this.guac_client=new Guacamole.Client(i),t(e.element).css({width:"100%"}),this.guac_client.connect(this.url),this.display=this.guac_client.getDisplay(),e.element.empty(),e.element.html(this.display.getElement()),e.callback&&e.callback(e.guac_client);var n=0;return this.guac_client.onstatechange=function(i){3==i&&(clearTimeout(n),n=setTimeout(function(){e.set_vm_scale(t(window).width()-e.options.box_width)},2e3)),5!==i||e.options.refresh||e.modal_alert("当前连接已断开")},this.guac_client.onclipboard=function(t,i){var n;if(/^text\//.exec(i)){n=new Guacamole.StringReader(t);var r="";n.ontext=function(e){r+=e},n.onend=function(){try{e.data.scrapbooking_text=r}catch(e){}}}else n=new Guacamole.BlobReader(t,i),n.onend=function(){e.data.scrapbooking_text=n.getBlob()}},e.set_mouseEvent(),this.guac_client.onerror=function(t){e.console_conn_error(t.code)},e},console_conn_error:function(t){var i=this,n="";switch(i.options.refresh=!0,t){case 256:n=i.i18n.operation_unsupported;break;case 512:n=i.i18n.internal_error;break;case 517:n=i.i18n.vm_used_locked;break;case 518:n=i.i18n.vm_closed;break;case 521:n=i.i18n.vm_connect_use;break;case 797:n=i.i18n.vm_many_resources;break;case 519:case 769:setTimeout(function(){i.init()},5e3);break;default:i.init()}521===t?i.modal_alert(n):n&&e.msg_error(n)},modal_alert:function(e){var t=this;layer.alert(e,{icon:7,title:t.i18n.Warning,closeBtn:1,btn:[t.i18n.refresh],yes:function(e){t.options.refresh=!0,t.init(),t.options.refresh=!1,layer.close(e)},shade:.3})},set_mouseEvent:function(){function e(e){var r=new Guacamole.Mouse.State(e.x/n.display.getScaleX(),e.y/n.display.getScaleY(),e.left,e.middle,e.right,e.up,e.down);n.guac_client.sendMouseState(r),n.keyboard.onkeydown=t,n.keyboard.onkeyup=i}function t(e){n.guac_client&&n.guac_client.sendKeyEvent(1,e)}function i(e){n.guac_client&&n.guac_client.sendKeyEvent(0,e)}var n=this;n.mouse=new Guacamole.Mouse(n.guac_client.getDisplay().getElement()),n.keyboard||(n.keyboard=new Guacamole.Keyboard(document)),n.mouse.onmousedown=function(t){n.clearfacus(),n.display.showCursor(!1),e(t)},n.mouse.onmouseup=n.mouse.onmousemove=function(t){n.clearfacus(),n.display.showCursor(!1),e(t)},n.mouse.onmouseout=function(e){n.display.showCursor(!1),n.keyboard.onkeydown=null,n.keyboard.onkeyup=null}},add_mouseEvent:function(){var e=this;e.mouse&&e.mouse.addEventListener()},remove_mouseEvent:function(){var e=this;e.mouse&&e.mouse.removeEventListener()},set_vm_scale:function(e){var i=this;if(e){var n=t(window).height();if(t(i.element).css({width:"100%"}),i.display&&i.guac_client){var r=i.display.getWidth(),a=i.display.getHeight();"RDP"==i.options.protocol?i.display.scaleXY(e/r,n/a):i.guac_client.sendSize(e,n)}}},clearfacus:function(){window.focus(),t("input").blur(),t("select").blur()}};return t.extend(n.prototype,r),n}),define("modules/console/previewexp/model/document/controller",["jquery","editormd"],function(e,t){function i(e,t){this.element=e,this.options=t}var n={init:function(){var i={htmlDecode:"style,script,iframe",tocm:!0,emoji:!1,taskList:!0,tex:!0,flowChart:!0,sequenceDiagram:!0,tocStartLevel:1};e.extend(this.options,i),t.markdownToHTML(this.element,this.options);var n=e("#"+this.element).find("pre");n.prepend("<i class='document-copy fa fa-files-o' style='display:none' ></i>"),n.on("mouseover",function(){e(this).find("i").show()}),n.on("mouseout",function(){e(this).find("i").hide()})}};return e.extend(i.prototype,n),i}),define("modules/console/previewexp/service",["network-utils","jquery","modules/utils/baseservice_tlab"],function(e,t,i){var n=function(e){this.dataControl=e};return n.prototype={video_test:function(t){return e.doGet("/ecos/qcec/v1/video_test/",t)},video_study_record:function(t){return e.doGet("/ecos/qcec/v1/video_study_record/",t)},step_video:function(t){return e.doGet("/ecos/qcec/v1/video/",t)},step_test:function(t){return e.doGet("/ecos/qcec_console_nsq/v1/step_test/"+t)},submit_step_test:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/step_test/",t)},overtime_server:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/preview/delay_time",t)},createreport:function(t){return e.doPost("/ecos/qcec/v1/report",t)},expReportList:function(t){return e.doGet("/ecos/qcec/v1/report",t)},changeEreport:function(t,i){return e.doPut("/ecos/qcec/v1/report/"+t,i)},getCommentList:function(t){return e.doGet("/ecos/qcec_noauth/noauth/comment",t)},createComment:function(t){return e.doPost("/ecos/qcec/v1/comment",t)},getcourse:function(t,i){return e.doGet("/ecos/qcec/v1/course/"+t,i)},getTeacherInfo:function(t){return e.doGet("/ecos/qcec_noauth/noauth/user/get_provider/",{course_id:t})},createScore:function(t){return e.doPost("/ecos/qcec/v1/mark",t)},isCreateScore:function(t){return e.doGet("/ecos/qcec/v1/mark",t)},updateScore:function(t,i){return e.doPut("/ecos/qcec/v1/mark/"+t,i)},step_attachment:function(t){return e.doGet("/ecos/qcec/v1/step_attachment/",t)},step_code_server:function(t){return e.doGet("/ecos/qcec/v1/upload_file/get_files",t)},upload_file:function(t){return e.doGet("/ecos/qcec/v1/upload_file",t)},step_code_upload:function(t){return e.doPost("/step_code_upload/",t)}},t.extend(n.prototype,i.prototype),n}),define("text!modules/console/previewexp/pop/help/index.html",[],function(){
|
||
return'<div ms-controller="">\r\n \r\n\r\n\r\n\r\n <div class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active" id="course">\r\n <div class="icode-form-group clearfix" ms-for="field in fields">\r\n\r\n <div class="icode-form-l fl">\r\n <label>{{ field.title }}:</label>\r\n </div>\r\n \r\n <div class="icode-form-r fl" ms-if="field.type==\'input\'">\r\n <input ms-attr="{\'placeholder\':field.tip.title,\'name\':field.field}" class="icode-form-long text" type="text" required/>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'textarea\'">\r\n <textarea ms-attr="{\'name\':field.field}" class="icode-form-long" required></textarea>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'radio\'">\r\n <label ms-for = "r in field.data" ms-attr = "{for: r.field}">\r\n \r\n <input type="radio" ms-attr="{id:r.field,name:field.field,value:r.value,field:field.field,checked:r.checked==true }" >\r\n {{r.title}}\r\n </label>\r\n </div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n <div class="icode-footer">\r\n\r\n <button class="btn" ms-for="button in buttons" ms-attr="{name:button.field}" >{{button.title}}</button>\r\n\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n'}),define("text!modules/console/previewexp/pop/help/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n "fields": [\r\n {\r\n "type": "radio",\r\n "field": "op_type",\r\n "value": "",\r\n "data": [\r\n {\r\n "field": "see",\r\n "value": "read",\r\n "checked": true\r\n },\r\n {\r\n "field": "control",\r\n "value": "write",\r\n "checked": false\r\n }\r\n ]\r\n },\r\n {\r\n "type": "input",\r\n "field": "op_user",\r\n "value": "",\r\n "required": true,\r\n "assist_usernotempty": { "field": "assist_usernotempty" },\r\n "tip": {"field": "assist_user_tip"}\r\n },\r\n {\r\n "type": "textarea",\r\n "field": "assist_msg",\r\n "value": "",\r\n "placer": "",\r\n "assist_msgnotempty": { "field": "assist_msgnotempty" }\r\n\r\n }\r\n ],\r\n "buttons": [\r\n \r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "send",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "请求协助",\r\n "op_type": "协助模式",\r\n\r\n "see": "观看",\r\n "control": "控制",\r\n "send": "发送",\r\n "op_user": "协助者",\r\n "assist_msg": "协助信息",\r\n "cancel": "取消",\r\n "assist_usernotempty": "请输入协助者手机号",\r\n "assist_msgnotempty": "请输入协助信息",\r\n "assist_user_tip": "手机号",\r\n "mobile_length": "请输入11位手机号码",\r\n "mobile_regexp": "请输入正确的手机号码",\r\n "assist_msg_length": "协助信息在255字符以内。"\r\n\r\n }\r\n }\r\n}'}),define("modules/console/previewexp/pop/help/controller",["popcontrollerbase_v2","jquery","text!modules/console/previewexp/pop/help/index.html","text!modules/console/previewexp/pop/help/lang.json"],function(e,t,i,n){function r(e,t,r,a,o){this.language=e,this.appOptions=t,this.lang=n,this.step_id=a,this.template=i,this.onCreated=o,this.service=r}var a={initAvalon:function(e){},onInitialize:function(e){var t=this,i=(t.data,t.getFieldsByName("op_user")),n=t.getFieldsByName("assist_msg");t.container.find("#data_form").bootstrapValidator({message:"This value is not valid",feedbackIcons:{valid:"glyphicon glyphicon-ok",invalid:"glyphicon glyphicon-remove",validating:"glyphicon glyphicon-refresh"},fields:{op_user:{message:i.assist_usernotempty.title,validators:{notEmpty:{message:i.assist_usernotempty.title},stringLength:{min:11,max:11,message:t.i18n.mobile_length},regexp:{regexp:/^1[3|5|8]{1}[0-9]{9}$/,message:t.i18n.mobile_regexp}}},assist_msg:{message:n.assist_msgnotempty.title,validators:{notEmpty:{message:n.assist_msgnotempty.title},stringLength:{min:1,max:255,message:t.i18n.assist_msg_length}}}}}),t.container.delegate('button[name="send"]:not(.disabled)',"click",function(){t.container.find("#data_form").bootstrapValidator("validate");var e=t.container.find("#data_form").data("bootstrapValidator").isValid(),i=t.generateData();e&&i&&(t.container.find('button[name="send"]').addClass("disabled"),t.service.get_assist_user({step_id:t.step_id,mobile:i.op_user}).done(function(e){i.op_user=e.user_id,i.step_id=t.step_id,t.service.send_assist(i).done(function(e){t.onCreated&&(t.onCreated(i),t.container.find(".closeModal").trigger("click"))}).fail(function(e){t.container.find('button[name="send"]').removeClass("disabled")})}))})},getModelLabel:function(){return"pop_heplvm_view"}};return t.extend(r.prototype,e.prototype),t.extend(r.prototype,a),r}),define("text!modules/console/previewexp/pop/questions/index.html",[],function(){return'<div ms-controller="">\r\n <div ms-attr="{id:pop_id}" class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active" id="course">\r\n <div style="margin-left: 20px;line-height: 24px;" class="icode-form-group icode-form-groups clearfix" ms-for="field in fields">\r\n <div>\r\n <span>{{ field.title }}</span>\r\n <span style="margin-left:10px;color:red">{{field.error}}</span>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'input\'">\r\n <input ms-attr="{\'placeholder\':field.placer,\'name\': field.name}" class="icode-form-long-student text" type="text" />\r\n </div>\r\n <div ms-if="field.type==\'radio\'">\r\n <label ms-for = "val in field.data" style="display: block;">\r\n <input style="margin:0 2px" ms-attr="{ value:val.value, name:field.name}" type="radio">\r\n {{val.title}}\r\n </label>\r\n </div>\r\n <div ms-if="field.type === \'checkbox\'">\r\n <label ms-for = "val in field.data" style="display: block;">\r\n <input ms-duplex="field.value" style="margin:0 2px" ms-attr = "{value:val.value, name:field.name}" type="checkbox">\r\n {{val.title}}\r\n </label>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'textarea\'">\r\n <textarea ms-attr="{\'placeholder\':field.placer,\'name\': field.name}" class="icode-form-long-student" maxlength ="50"></textarea>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'file\'">\r\n <input class="text" type="file" />\r\n <p>{{field.placer}}</p>\r\n </div>\r\n </div>\r\n <div class="icode-footer">\r\n\r\n <li ms-for="button in fieldbuttons">\r\n <button ms-attr="{name:button.field}" class="btn" ms-class="{hide:button.hide==true}">{{button.title}}</button>\r\n </li>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n'}),define("text!modules/console/previewexp/pop/questions/lang.json",[],function(){return'{\r\n "config": {\r\n "pop_id": "pop_save_lab",\r\n "header": {\r\n "field": "title",\r\n "icon": "fa-money",\r\n "parent": {\r\n "field": "account"\r\n }\r\n },\r\n "submit":false,\r\n "answer":[],\r\n "fields": [\r\n \r\n ],\r\n "fieldbuttons": [\r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "hide":true,\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "submit",\r\n "style": "success",\r\n "hide":false,\r\n "dismiss": ""\r\n }\r\n ],\r\n "keep_attach_res":{\r\n "type":"radio",\r\n "field":"keep_attach_res",\r\n "name":"keep_attach_res",\r\n "data":[\r\n {\r\n\r\n "id":"attach_true",\r\n "field":"true",\r\n "checked":true\r\n },\r\n {\r\n "id":"attach_false",\r\n "field":"false",\r\n "checked":false\r\n }\r\n ]\r\n }\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "课后习题",\r\n "cancel": "返回",\r\n "submit": "提交",\r\n "name":"名称",\r\n "desc":"描述",\r\n "true":"是",\r\n "false": "否",\r\n "keep_ip":"保存IP地址",\r\n "data_set":"保存数据集",\r\n "keep_attach_res":"保存素材路径"\r\n },\r\n "en": {\r\n\r\n }\r\n }\r\n}'}),define("modules/console/previewexp/pop/questions/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/previewexp/pop/questions/index.html","text!modules/console/previewexp/pop/questions/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o,s,l){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=l,this.service=s,this.step_id=i,this.rel_c_s_g_id=a,this.question=o}var o={initAvalon:function(e){},onInitialize:function(){var e=this;this.data;i(".qc-modal").addClass("modal-index"),e.container.find(".closeModal").css("display","none");var t=[],n=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];e.question.test.forEach(function(e,i){var r=i+1,a={type:e.type,title:r+". "+e.question,name:"question"+i,data:[],value:[],error:""};e.choice.forEach(function(e,t){a.data[t]={title:n[t].toUpperCase()+". "+e,value:n[t].toUpperCase()}}),t.push(a)}),e.data.fields=t,e.data.answer=e.question.answer,this.container.delegate('button[name="submit"]',"click",function(){e.container.find("#data_form").bootstrapValidator("validate");var t=e.container.find("#data_form").data("bootstrapValidator").isValid(),i=e.generateData();if(!t)return!1;for(var n={answer:[]},r=e.data.fields,a=0;a<r.length;a++)if("radio"===r[a].type&&i[r[a].name])n.answer.push(i[r[a].name]);else{if(!("checkbox"===r[a].type&&r[a].value.length>0))return void layer.msg("请先填写答案再提交",{zIndex:200000001,icon:5});n.answer.push(r[a].value.join(""))}if(e.data.submit)return void layer.msg("您已经提交,请勿重新提交",{zIndex:200000001,icon:5});e.data.submit=!0;var o={test_true:0,test_count:r.length};if(n.answer.forEach(function(t,i){t!=e.data.answer[i]?e.data.fields[i].error=e.data.answer[i].toUpperCase():(e.data.fields[i].error="",o.test_true+=1)}),e.onCreated(e.question,o),o.test_count==o.test_true)layer.alert("您的正确率为: 100%",{zIndex:200000001});else{var s=(100/o.test_count).toFixed(2);layer.alert("您的正确率为:"+s*o.test_true+"%",{zIndex:200000001})}e.container.find('button[name="submit"]').addClass("hide"),e.container.find('button[name="cancel"]').removeClass("hide")}),this.container.delegate('button[name="cancel"]',"click",function(){i(".qc-modal").removeClass("modal-index"),e.container.find(".closeModal").trigger("click")})},getModelLabel:function(){return"attachpopmodel"}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),define("text!modules/console/previewexp/pop/upload/index.html",[],function(){return'<div ms-controller="">\r\n \r\n\r\n\r\n\r\n <div class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active">\r\n <button style="margin:10px 10px 0 10px" type="button" class="layui-btn" id="uploadFile_code_list">\r\n <i class="layui-icon"></i>上传文件\r\n </button>\r\n <span >上传文件支持格式:zip,z7,txt</span>\r\n <p style="word-wrap:break-word;word-break:break-all;margin:10px">{{placer.title}}</p>\r\n <div id="upload_uploadFile_code"></div>\r\n <div class="icode-footer">\r\n <button ms-class="[\'btn\',\'btn-\'+button.field]" ms-for="button in buttons" ms-attr="{name:button.field class:button.classname}" >{{button.title}}</button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n'}),define("text!modules/console/previewexp/pop/upload/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n "placer":{\r\n "field": "placer"\r\n },\r\n "buttons": [\r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "className":"cancel"\r\n },\r\n {\r\n "field": "send",\r\n "style": "success",\r\n "className":"send"\r\n }\r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "placer":"请上传所需要的代码文件(最大支持2M)",\r\n "title": "上传代码",\r\n "send": "上传",\r\n "cancel": "取消"\r\n\r\n }\r\n }\r\n}'}),define("modules/console/previewexp/pop/upload/controller",["app-utils","popcontrollerbase_v2","jquery","text!modules/console/previewexp/pop/upload/index.html","text!modules/console/previewexp/pop/upload/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o,s){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=s,this.service=i,this.code_data=a,this.step_id=o}var o={initAvalon:function(e){},onInitialize:function(t){var i=this;i.data;i.uploadFun("#uploadFile_code_list","#upload_uploadFile_code"),this.container.delegate(".btn-cancel","click",function(){i.container.find(".closeModal").trigger("click")}),this.container.delegate(".btn-send","click",function(){if("请上传所需要的代码文件"==i.data.placer.title)return e.msg_warning("请先上传文件"),!1;i.container.find("#upload_uploadFile_code").trigger("click")})},getModelLabel:function(){return"pop_upload_vm_view"},uploadFun:function(t,i){var n=this;layui.use("upload",function(){var r=(layui.jquery,layui.upload);r.render({elem:t,url:"/step_code_upload/",field:"upload",accept:"file",exts:"zip|7z|txt",data:{vm_resid:n.code_data.vm_resid,step_id:n.step_id},auto:!1,size:2048,bindAction:i,before:function(e){layer.load()},choose:function(e){e.preview(function(e,t,i){n.data.placer.title=t.name})},done:function(t,i,r){layer.closeAll("loading"),e.msg_success("导入成功"),n.container.find(".closeModal").trigger("click"),n.onCreated(t)},error:function(e){console.log(e),layer.closeAll("loading")},msg:function(t){e.msg_error(t)}})})}};return i.extend(a.prototype,t.prototype),i.extend(a.prototype,o),a}),define("text!modules/console/previewexp/pop/dataset/index.html",[],function(){return'<div ms-controller="">\r\n\r\n <style>\r\n .layui-table-view{\r\n margin-top: 0px;\r\n }\r\n .layui-table-tips-c{\r\n font-size: 14px!important;\r\n }\r\n .layui-table-grid-down i{\r\n font-size: 14px!important;\r\n }\r\n .qc-modal .closeModal:active{\r\n background-position:1px -40px;\r\n }\r\n </style>\r\n\r\n\r\n <div class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="" class="tab-content form-horizontal">\r\n <table class="layui-hide" id="sd_dataset_list"></table>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n'}),define("text!modules/console/previewexp/pop/dataset/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n "placer":{\r\n "field": "placer"\r\n },\r\n "buttons": [\r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "className":"cancel"\r\n },\r\n {\r\n "field": "send",\r\n "style": "success",\r\n "className":"send"\r\n }\r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "placer":"请上传所需要的代码文件",\r\n "title": "数据集",\r\n "send": "上传",\r\n "cancel": "取消"\r\n\r\n }\r\n }\r\n}'}),define("modules/console/previewexp/pop/dataset/controller",["popcontrollerbase_v2","jquery","layui","text!modules/console/previewexp/pop/dataset/index.html","text!modules/console/previewexp/pop/dataset/lang.json"],function(e,t,i,n,r){function a(e,t,i,a,o){this.language=e,this.appOptions=t,this.lang=r,this.template=n,this.onCreated=o,this.service=i,this.dataset_list=a}var o={initAvalon:function(e){},onInitialize:function(e){var t=this;t.data;t.dataset_list.forEach(function(e){"success"==e.mount_status?e.mount_status_desc="成功":e.mount_status_desc="失败"}),layui.use("table",function(){layui.table.render({elem:"#sd_dataset_list",cols:[[{field:"name",width:100,title:"名称"},{field:"size",width:100,title:"大小(GB)"},{field:"desc",width:120,title:"描述"},{field:"cifs_path",width:180,title:"cifs_path"},{field:"nfs_path",width:180,title:"nfs_path"},{field:"mount_path",width:180,title:"挂载路径"},{field:"mount_status_desc",width:100,title:"挂载状态"}]],data:t.dataset_list})})},getModelLabel:function(){return"pop_upload_vm_view"}};return t.extend(a.prototype,e.prototype),t.extend(a.prototype,o),a}),define("text!modules/console/previewexp/lang.json",[],function(){return'{\r\n "config": {\r\n "password_view":"false",\r\n "vms": {},\r\n "page_id": "expdesltop_view_data_page",\r\n "current_assister": "",\r\n "current_assis_type": "read",\r\n "desktop_title":"",\r\n "current_unfold": "docmarkdown",\r\n "isspread": false,\r\n "vm_param": "",\r\n "vm_param2": "",\r\n "is_split": false,\r\n "reportData": "",\r\n "reportBtn": "",\r\n "step_msg": "",\r\n "is_assist": false,\r\n "assist_process_token": "",\r\n "assist_conn_token": "",\r\n "is_fullscreen": false,\r\n "is_onresize": true,\r\n "checkFull": false,\r\n "vm_status": "closed",\r\n "conTitle": {\r\n "field": "contitle"\r\n },\r\n "menu_tools":{\r\n "vm_name":"",\r\n "protocols":""\r\n },\r\n "editormd":{\r\n "editormd_show":"editormd_show_title"\r\n },\r\n "toggle":{\r\n "tools_show":"hide",\r\n "editormd_show":"hide"\r\n },\r\n "step": {\r\n "ip":"",\r\n "token": "",\r\n "progress": 0,\r\n "instance_id": "",\r\n "protocol": "",\r\n "os_type": "",\r\n "res_id2": "",\r\n "protocol2": "",\r\n "os_type2": "",\r\n "protocol2_data": [],\r\n "id": "",\r\n "os_password":"",\r\n "os_username":"",\r\n "dataset_list": [],\r\n "res_list": [\r\n\r\n ],\r\n "vm_models": {},\r\n "menu_view":{\r\n "tool_view":true,\r\n "doc_view":true\r\n },\r\n "fields": [\r\n {\r\n "field": "vm_name",\r\n "type": "select",\r\n "data": [],\r\n "value": ""\r\n },\r\n {\r\n "field": "protocols",\r\n "type": "select",\r\n "data": [],\r\n "value": ""\r\n },\r\n {\r\n "field": "expdesktop_info",\r\n "type": "expdesktop_info"\r\n },\r\n {\r\n "field": "create",\r\n "enabled": true,\r\n "hide": false,\r\n "type": "button",\r\n "icon":"play-circle"\r\n },\r\n {\r\n "field": "delay",\r\n "enabled": true,\r\n "hide": true,\r\n "type": "button",\r\n "icon": "clock-o"\r\n },\r\n {\r\n "field": "close",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"close"\r\n },\r\n {\r\n "field": "help",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"share-alt"\r\n },\r\n {\r\n "field": "unhelp",\r\n "hide": true,\r\n "type": "button",\r\n "enabled": true,\r\n "icon":"share-square"\r\n },\r\n\r\n {\r\n "field": "refresh",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"refresh"\r\n\r\n },\r\n {\r\n "field": "viewtype",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"columns"\r\n\r\n },\r\n {\r\n "field": "scrapbooking",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "scissors"\r\n },\r\n {\r\n "field": "fullscreen",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"arrows-alt"\r\n }\r\n ]\r\n },\r\n "timeout": {\r\n "zero": 0,\r\n "day":"0",\r\n "hour": "00",\r\n "minute": "00",\r\n "second": "00",\r\n "allSecond":0\r\n },\r\n "fields_report": [\r\n {\r\n "field": "completion",\r\n "type": "radio",\r\n "style": "vclass-name",\r\n "name": "radio",\r\n "value": 0,\r\n "data": [\r\n {\r\n "field": "all_status",\r\n "status": true,\r\n "value": 0\r\n },\r\n {\r\n "field": "section_status",\r\n "status": false,\r\n "value": 1\r\n },\r\n {\r\n "field": "undone_status",\r\n "status": false,\r\n "value": 2\r\n }\r\n ]\r\n },\r\n {\r\n "type": "ueditor",\r\n "field": "content",\r\n "value": ""\r\n }\r\n ],\r\n "fieldbuttons": [\r\n {\r\n "field": "save",\r\n "style": "save",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "savestep",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ],\r\n "step_video_list":[],\r\n "step_attachment_list": [],\r\n "doctabs": [\r\n {\r\n "field": "docmarkdown",\r\n "active": true,\r\n "show": true,\r\n "type": "doc"\r\n },\r\n {\r\n "field": "material",\r\n "active": false,\r\n "show": true,\r\n "type": "material"\r\n },\r\n {\r\n "field": "video",\r\n "active": false,\r\n "show": true,\r\n "type": "video"\r\n }\r\n ],\r\n\r\n "show_vm": {\r\n "field": "close_vm",\r\n "code_data": "",\r\n "prompt": "",\r\n "show": false,\r\n "loading": true,\r\n "os_type": ""\r\n\r\n },\r\n "vstep_id": "",\r\n "step_code_list": [],\r\n "isloaded": false,\r\n "getGroup_res_data": "",\r\n "course_evaluate": {\r\n "field": "course_evaluate",\r\n "score": 0,\r\n "isCreate": true,\r\n "comment": {\r\n "field": "comment",\r\n "value": ""\r\n },\r\n "tip": {\r\n "field": "evaluate_tip",\r\n "value": ""\r\n },\r\n "button": { "field": "send_comment" },\r\n "comment_list": [\r\n\r\n ]\r\n },\r\n "comment_list": [\r\n\r\n ],\r\n "ismark": false,\r\n "markid": "",\r\n "op_type": "",\r\n "is_start":false,\r\n "course_id":0,\r\n "shanhe_ws": "",\r\n "shanhe_instance_info": {\r\n "instances": []\r\n },\r\n "shanhe_instance_close_vm_info": {\r\n "instances": []\r\n },\r\n "shanhe_instance_connect_info": {},\r\n "job_action_start_or_stop": "",\r\n "scrapbooking_text": ""\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "video":"视频",\r\n "delay": "延时",\r\n "all_status": "全部完成",\r\n "section_status": "部分完成",\r\n "undone_status": "未完成",\r\n "title": "实验报告",\r\n "save": "保存",\r\n "purpose": "实验目的",\r\n "savestep": "保存并提交",\r\n "name": "实验名称",\r\n "completion": "完成情况",\r\n "undone": "未完成原因",\r\n "content": "报告内容",\r\n "report": "报告",\r\n "remotely": "远程协助",\r\n "monitor": "实验监控",\r\n "scrapbooking": "剪贴板",\r\n "uploadFiles": "上传文件",\r\n "timeCost": "实验用时:",\r\n "docmarkdown": "文档",\r\n "question": "问答",\r\n "notes": "笔记",\r\n "evaluation": "评价",\r\n "fraction": "给实验打分",\r\n "publish": "发表",\r\n "viewtype": "显示方式",\r\n "contitle": "实验桌面标题",\r\n "course_step_evaluate": "实验评价",\r\n "close_vm": "实验环境尚未启动,无法上传/下载文件",\r\n "send_comment": "发表",\r\n "grade": "给实验评分",\r\n "create": "开始",\r\n "clipboard": "剪贴板",\r\n "editormd_show_title": "显示文档",\r\n "close": "关闭",\r\n "help": "请求协助",\r\n "unhelp": "取消协助",\r\n "assist": "协助",\r\n "creatingvm": "正在创建实验环境",\r\n "ladingvmerror": "加载实验环境失败,请点击刷新按钮或等待10秒重新加载",\r\n "RDP": "桌面版",\r\n "SSH": "命令行版",\r\n "waiting": "实验环境正在准备中",\r\n "creating": "准备中",\r\n "refresh": "刷新",\r\n "click": "点击创建加载环境...",\r\n "remain_time": "剩余时间",\r\n "hour": "时",\r\n "minute": "分",\r\n "second": "秒",\r\n "accept_assist": "对方已接受协助请求",\r\n "reject_assist": "对方拒绝了协助请求",\r\n "study_timeout": "学习时间已结束,实验环境已经删除。如果继续学习,请重新创建",\r\n "Warning": "温馨提示",\r\n "cannot_load": "加载实验环境失败,请重试",\r\n "operation_unsupported": "不支持此操作",\r\n "internal_error": "发生了内部错误,无法执行操作。",\r\n "vm_used_locked": "实验环境已经在使用或锁定,请刷新控制台页面",\r\n "vm_closed": "实验环境已经关闭,请重新创建",\r\n "vm_busy": "实验环境忙,需要首先释放连接,然后重试或尝试刷新操作",\r\n "vm_connect_use": "控制台已经被另一个连接使用,请先关闭该连接,或者刷新控制台页面。",\r\n "vm_authorized_fail": "授权失败,请联系管理员或尝试刷新操作",\r\n "vm_many_resources": "您已经使用了太多的资源,请关闭一些正在使用的实验环境或尝试刷新操作",\r\n "noselectText": "请先选中页面中的文本内容",\r\n "evaluate_tip": "还可以输入<span>{0}</span>字",\r\n "cancel": "取消",\r\n "material": "随材",\r\n "op_type": "协助方式",\r\n "read": "观看",\r\n "write": "控制",\r\n "code": "代码",\r\n "fullscreen": "全屏",\r\n "exitfullscreen": "退出全屏",\r\n "closing": "关闭中"\r\n }\r\n }\r\n}\r\n'}),define("modules/console/previewexp/controller",["app-utils","modules/console/basecontroller","jquery","modules/console/expconsole/model/guacamole/controller","modules/console/previewexp/model/document/controller","modules/console/previewexp/service","modules/console/previewexp/pop/help/controller","modules/console/previewexp/pop/questions/controller","modules/console/previewexp/pop/upload/controller","modules/console/previewexp/pop/dataset/controller","toolbar","layout","videojs","text!modules/console/previewexp/lang.json","text!modules/console/expdesktop/template/scrapbooking.html"],function(e,t,i,n,r,a,o,s,l,c,u,d,h,p,f){function m(e,t,n){this.container=e,this.language=t,this.appOptions=n,this.lang=p,this.vstep_id=null,this.step_id=null,this.isloading=!0,this.res_list={},this.timer=null,this.temp_ips=[],this.progresstimer=null,this.n=0,this.reconnect=1,this.vmlayout=null,this.layouttype="east",this.exp_width=360,this.windpi={sm:768,md:992,lg:1200},this.ishind=!1,this.dragDocInit=172,this.dragDoc=182,this.windowWidth=i(window).width(),this.imgClick=!1}var g={initAvalon:function(t){var n=this;t.events.code_refresh=function(){},t.events.desktop_tools_hide=n.tools_hide_fun.bind(this),t.events.desktop_tools_show=n.tools_show_fun.bind(this),t.events.desktop_editormd_hide=n.editormd_hide_fun.bind(this),t.events.desktop_editormd_show=n.editormd_show_fun.bind(this),t.events.desktop_editormd_maximize=n.editormd_maximize_fun.bind(this),t.events.step_video=function(e){n.video_open(e,0)},t.events.change_vm_name=function(e){var t=e.id;n.data.step.instance_id=t,n.set_protocols(),n.data.step.ip=n.res_list[t].ip,n.data.step.os_password=n.res_list[t].os_password,n.data.step.os_username=n.res_list[t].os_username,n.setvm_param({token:n.data.step.token,protocol:n.data.step.protocol,instance_id:t,os_type:n.data.step.os_type})},t.events.change_protocols=function(e){var t=e.id;n.data.step.protocol=t,n.setvm_param({token:n.data.step.token,protocol:t,instance_id:n.data.step.instance_id,os_type:n.data.step.os_type})},t.events.code_upload=function(){new l(n.language,n.appOptions,n.service,n.data.show_vm.code_data,n.vstep_id,function(){}).show()},t.events.showdataset=function(e){return!1},t.$watch("step.res_list",function(e){e&&n.set_vm_ips()}),t.$watch("vm_param",function(e){e&&(n.vm_is_refresh(),n.show_vm())}),t.$watch("step.progress",function(e){n.isloading&&n.loading()}),t.$watch("is_split",function(e){if(e){n.data.step.protocol2_data=[],n.data.step.res_id2=n.container.find("select[name='vm_ip2']").val(),n.field_vm_name.data=[{id:n.data.step.instance_id,title:n.res_list[n.data.step.instance_id].res_name}];var t=n.data.step.vm_models[n.data.step.res_id2];t&&t.forEach(function(e){n.data.step.protocol2_data.push({id:e,title:n.i18n[e]})}),n.data.step.protocol2=n.container.find("select[name='protocol2']").val()}else n.set_vm_ips()}),t.$watch("step_msg",function(t){t&&e.msg_info(t)}),t.$watch("is_fullscreen",function(t){n.data.is_onresize=!1,t?e.fullScreen()&&(n.field_fullscreen.title=n.i18n.exitfullscreen):e.exitFullScreen()&&(n.field_fullscreen.title=n.i18n.fullscreen)}),t.$watch("vm_status",function(t){switch(t){case e.vm_status.creating:n.field_create.title=n.i18n.creating,n.field_create.enabled=!1,n.field_create.hide=!1,n.field_vm_name.data=[],n.field_protocols.data=[],n.field_refresh.hide=!0,n.field_fullscreen.hide=!0,n.field_close.hide=!0,n.field_viewtype.hide=!0,n.data.is_start=!0,n.field_delay.hide=!0,n.field_scrapbooking.hide=!0;break;case e.vm_status.running:n.field_create.hide=!0,n.field_vm_name.hide=!1,n.field_protocols.hide=!1,n.field_close.hide=!1,n.field_close.title=n.i18n.close,n.field_close.enabled=!0,n.field_refresh.hide=!1,n.field_fullscreen.hide=!1,n.data.is_start=!0,n.field_delay.hide=!1,n.field_scrapbooking.hide=!1;break;case e.vm_status.closing:n.field_close.hide=!1,
|
||
n.field_close.enabled=!1,n.field_close.title=n.i18n.closing,n.field_create.hide=!0,n.field_refresh.hide=!0,n.field_fullscreen.hide=!0,n.field_viewtype.hide=!0,n.field_vm_name.data=[],n.field_protocols.data=[],n.data.is_start=!0,n.field_delay.hide=!0,n.field_scrapbooking.hide=!0;break;case e.vm_status.closed:n.field_close.hide=!0,n.field_create.hide=!1,n.field_create.title=n.i18n.create,n.field_create.enabled=!0,n.field_vm_name.data=[],n.field_protocols.data=[],n.field_refresh.hide=!0,n.field_fullscreen.hide=!0,n.field_viewtype.hide=!0,n.data.step.progress=0,n.data.is_start=!1,n.field_delay.hide=!0,n.field_scrapbooking.hide=!0;break;case e.vm_status.error:n.field_close.hide=!0,n.field_create.hide=!1,n.field_create.title=n.i18n.create,n.field_create.enabled=!1,n.field_vm_name.data=[],n.field_protocols.data=[],n.field_refresh.hide=!0,n.field_fullscreen.hide=!0,n.field_viewtype.hide=!0,n.data.step.progress=0,n.data.is_start=!1,n.field_delay.hide=!0,n.field_scrapbooking.hide=!0}}),window.onresize=function(){e.checkFull()?n.field_fullscreen.title=n.i18n.exitfullscreen:n.field_fullscreen.title=n.i18n.fullscreen;var t=i(window).height();n.container.find("#displayvm").height(t);var r=i(window).width();n.container.find("#displayvm").width(r),n.container.find(".expDesktop_head_wrap").width(.9*r),n.set_vm_scale()},t.$watch("course_evaluate.comment.value",function(e){t.course_evaluate.tip.value=t.course_evaluate.tip.title.replace(/\{\d\}/g,100-e.length)}),t.events.changetabs=function(e,t){for(var i=0;i<n.data.doctabs.length;i++)n.data.doctabs[i].active=!1;e.active=!0,"report"==e.field?n.reportfun():"material"==e.field?n.get_step_attachment():"evaluation"==e.field?n.get_comment_content():"video"==e.field&&n.get_step_video()},t.events.step_attachment=function(t){window.open(e.getDomain(e.domain_type.step_att)+t.api_url)},t.course_evaluate.tip.value=t.course_evaluate.tip.title.replace(/\{\d\}/g,100),t.events.goback=function(){history.go(-1)},t.events.current_vm_desc=function(){n.data.step.ip&&layer.tips("当前机器ip:"+n.data.step.ip,"#current_vm_desc",{tips:1})}},setDataControl:function(e){this.dataControl=e,this.service=new a(this.dataControl),this.dataControl.addLisenter("step",this,this.socket),this.dataControl.addLisenter("assist",this,this.socket)},socket:function(t,i,n){var r=this;if(i=String(i),this.vstep_id===i&&t==e.vm_op_status.op_failed)return e.msg_error("实验环境创建失败"),r.close_vm(),void(r.data.vm_status=e.vm_status.closed);if(this.vstep_id===i&&"time_remind"===n.action&&"preview"===n.data.mode&&(r.data.timeout.allSecond=n.data.remain_time,r.setTime(n.data.remain_time),r.overtime()),this.vstep_id===i&&(t===e.vm_status.creating||t===e.vm_status.running)&&"preview"===n.data.mode){if(r.data.vm_status=e.vm_status.creating,console.log(n.data.progress),r.data.step.progress=n.data.progress,!n.data.is_complete)return;r.data.vm_status=e.vm_status.running,r.data.step.progress=0,this.setTime(n.data.remain_time),this.data.step.token=n.data.current_res.vm_token,this.data.step.protocol=n.data.current_res.res_conn.filter(function(e){return 1==e.default})[0].protocol,this.data.step.instance_id=n.data.current_res.instance_id,this.data.step.ip=n.data.current_res.ip,this.data.step.os_username=n.data.current_res.os_username,this.data.step.os_password=n.data.current_res.os_password,this.data.step.os_type=n.data.current_res.os_type.toLowerCase(),this.data.vm_param={token:n.data.current_res.vm_token,protocol:n.data.current_res.res_conn.filter(function(e){return 1==e.default})[0].protocol,instance_id:n.data.current_res.instance_id,os_type:n.data.current_res.os_type.toLowerCase()},this.data.step.res_list=n.data.res_list}this.vstep_id!==i||"end"!==n.data.stage||n.action!==e.vm_status.time_end&&n.action!==e.vm_status.closing||("time_end"===n.action?e.msg_warning(r.i18n.study_timeout,null,{closeButton:!0,onCloseClick:function(){r.close_vm()},onHidden:function(){r.close_vm()}}):r.close_vm())},setvm_param:function(e){this.data.vm_param=e},show_vm:function(){var e=this;if(vm_width=window.screen.width,vm_height=window.screen.height,e.data.vm_param.token){var t=String(e.data.vm_param.token),r=e.data.vm_param.protocol,a=e.data.vm_param.instance_id,o=e.data.vms;e.data.vms[a]||(o[a]={token:t});for(var s in o)o[s].guac_client&&o[s].guac_client.disconnect();var l="vm_token="+t+"&vm_protocol="+r+"&vm_resid="+a+"&vm_width="+vm_width+"&vm_height="+vm_height+"&mode=preview",c={i18n:e.i18n,tunnel_url:SDC.sock_type+"://"+SDC.guacHost,url:l,protocol:r,os_type:e.data.vm_param.os_type,token:t,box_width:i(".expDesktop_editormd_box").width()},u=new n(e.container.find("#display"),c,e.data);e.guac_init=u.init(),o[a]=u,e.data.show_vm.code_data={vm_protocol:r,step_id:e.vstep_id,vm_resid:a}}},set_vm_scale:function(){var e=this,t=e.data.vms,n=i(window).width();e.ishind||(n=i(window).width()-e.exp_width),t[e.data.vm_param.instance_id]&&t[e.data.vm_param.instance_id].set_vm_scale(n)},set_vm_ips:function(){var e=this,t=e.data.step.res_list;e.field_vm_name.data=[],t.forEach(function(t){e.field_vm_name.data.push({id:t.instance_id,title:t.res_name}),e.data.step.vm_models[t.instance_id]=t.res_conn,e.res_list[t.instance_id]=t}),e.field_vm_name.value=e.data.step.instance_id,e.set_protocols()},set_protocols:function(){var e=this;e.field_protocols.data=[];var t=[],i=e.data.step.vm_models[e.data.step.instance_id];i&&i.forEach(function(i){t.push({id:i.protocol,guac_id:i.guac_id,title:e.i18n[i.protocol]})}),e.field_protocols.data=t,1===t.length&&(e.data.step.protocol=t[0].id),e.field_protocols.value=e.data.step.protocol},setTime:function(e){var t=this;this.timer&&clearInterval(this.timer);var i=t.data.timeout;t.data.timeout.allSecond=e;var n=Math.floor(e/86400);i.day=n,i.hour=Math.floor(e/3600),i.hour.toString().length<2&&(i.hour="0"+i.hour),i.minute=Math.floor((e-3600*i.hour)/60),i.minute.toString().length<2&&(i.minute="0"+i.minute),i.second=Math.floor(e-3600*i.hour-60*i.minute),i.second.toString().length<2&&(i.second="0"+i.second);var r=0;this.timer=setInterval(function(){if((r+=1)>e)clearInterval(t.timer),i.day="0",i.hour="00",i.minute="00",i.second="00",t.data.timeout.allSecond=0;else{var n=e-r;t.data.timeout.allSecond=n;var a=Math.floor(n/86400);i.day=a,i.hour=Math.floor(n/3600),i.hour.toString().length<2&&(i.hour="0"+i.hour),i.minute=Math.floor((n-3600*i.hour)/60),i.minute.toString().length<2&&(i.minute="0"+i.minute),i.second=Math.floor(n-3600*i.hour-60*i.minute),i.second.toString().length<2&&(i.second="0"+i.second)}},1e3)},close_vm:function(){var t=this;t.container.find("#display").empty();for(var i in t.data.vms){var n=t.data.vms[i];n.guac_client&&(n.guac_client.disconnect(),n.guac_client=null),n=null}t.data.is_split=!1,t.vmlayout&&t.vmlayout.hide(t.layouttype),t.data.step.progress=0,t.data.vm_param="",t.data.step.token="",t.data.step.protocol="",t.data.step.instance_id="",t.data.step.res_list=[],t.data.step.vm_models=[],t.data.step.ip="",t.data.step.os_password="",t.data.step.os_username="",t.data.step.os_type="",t.data.step_msg="",e.exitFullScreen(t.data),e.checkFull()&&!(document.webkitIsFullScreen||document.msFullscreenElement||document.mozFullScreen||document.fullscreen)&&e.msg_info("请按(F11)退出全屏"),t.data.is_fullscreen=!1,t.setTime(0),t.data.vm_status=e.vm_status.closed},loading:function(){var t=this;t.isloading=!1;var i=document.getElementById("c");e.shuidi_loading(i,function(e){return t.data.step.progress},function(e){t.data.step.progress&&100!==t.data.step.progress||(cancelAnimationFrame(e),t.container.find("#vm_progress").addClass("hide"),t.isloading=!0)})},clearfacus:function(){this.container.find("input").blur(),this.container.find("select").blur()},checkCourseStep:function(t){var n=this;this.service.check_courseStep(t).done(function(t){if(t.status===e.vm_op_status.op_failed)return void(n.data.vm_status=e.vm_status.closed);if(t.action===e.vm_status.closed)return void(n.data.vm_status=e.vm_status.closed);if(t.action===e.vm_status.creating&&(n.data.vm_status=e.vm_status.creating),t.action_info.is_complete){var r={allow_vpn:t.action_info.allow_vpn,vpn_info:t.action_info.vpn_info,protocol:t.action_info.current_res.res_conn.filter(function(e){return 1==e.default})[0].protocol,instance_id:t.action_info.current_res.instance_id,token:t.action_info.current_res.vm_token,ip:t.action_info.current_res.ip,os_password:t.action_info.current_res.os_password,os_username:t.action_info.current_res.os_username,os_type:t.action_info.current_res.os_type.toLowerCase(),op_system_type:t.action_info.current_res.type,is_ready:!0,lab_interact_code:t.action_info.current_res.lab_interact_code,lab_interact_id:t.action_info.current_res.lab_interact_id};i.extend(n.data.step,r),n.setvm_param(n.data.step),n.data.step.res_list=t.action_info.res_list,n.remain_time=t.action_info.remain_time,n.setTime(t.action_info.remain_time),n.data.vm_status=e.vm_status.running}})},setData:function(t){var n=this;i(window).height();t&&(n.vstep_id=t,n.data.vstep_id=t,layui.use("element",function(){layui.element}),n.tools_show_fun(),n.editormd_show_fun(),this.service.getGroup_courseStep(t).done(function(t){if(n.data.desktop_title=t.title,n.data.getGroup_res_data=t,n.data.isloaded=!0,n.step_id=t.id,n.data.course_id=t.course_id,n.data.password_view=t.manage_spec.allow_savepsd,n.container.find("#docmarkdown").empty(),n.container.find("#docmarkdown").css({height:"100%"}),"markdown"==t.doc_source){n.container.find("#docmarkdown").html('<div style="width: 100%;height: 100%;"><div style="width: 100%;height: 100%;overflow-y: auto"><div id="docmarkdown_doc"><textarea id="step_content" style="width:auto;display:none;"></textarea></div></div></div>');new r("docmarkdown_doc",{markdown:t.step_doc,image_Remote_URL:e.getDomain(e.domain_type.step)}).init()}else if("file"==t.doc_source){var i="/static/public/lib/pdfjs/web/viewer.html?file="+encodeURIComponent("/pdf_download?file_url="+n.fill_address(t));n.container.find("#docmarkdown").html('<iframe id="docmarkdown_doc" style="width: 100%;height: 100%;padding-top: 40px;box-sizing: border-box;" src="'+i+'"></iframe>')}}).fail(function(){}),n.checkCourseStep(n.data.vstep_id))},get_step_attachment:function(){var e=this,t=e.data.getGroup_res_data;e.service.step_attachment({course_id:t.course_id,step_id:t.id}).done(function(t){t.step_attachment_list.forEach(function(e){e.size=Math.floor(e.size/1024)}),e.data.step_attachment_list=t.step_attachment_list})},refreshData:function(e){this.setData(e)},onInitialize:function(t){var n=this;this.initialized=!0,this.DragLeftBar(),this.DragDoc(),this.DragTime();var r=i(window).height();if(n.container.find("#displayvm").height(r),n.container.find(".console-ullist").removeClass("hide"),n.container.find(".expDesktop_head_wrap").width(.9*i(window).width()),t){n.vstep_id=t;for(var a=0;a<n.data.step.fields.length;a++){var o=n.data.step.fields[a];n["field_"+o.field]=o}localStorage.getItem(SDC.user.user_id+"_"+n.vstep_id)||localStorage.setItem(SDC.user.user_id+"_"+n.vstep_id,10),n.setData(t),n.container.delegate('button[name="create"]:not(.disabled)',"click",function(){n.imgClick=!0,n.container.find('button[name="create"]').addClass("disabled"),n.data.step.progress=25,n.data.vm_status=e.vm_status.creating,n.service.create_vm({step_id:t}).done(function(e){e.instances.forEach(function(e){e.ready=!1}),n.data.shanhe_instance_info=e}).fail(function(t){var i=JSON.parse(t.responseText);if(n.container.find('button[name="create"]').removeClass("disabled"),i.code)switch(i.code){case 50003:case 50004:case 50005:break;default:n.data.vm_status=e.vm_status.closed}n.data.vm_status=e.vm_status.closed})}),n.container.delegate(".console_bg_img img","click",function(){var r=this;n.imgClick=!0,n.data.step.progress=25,n.data.vm_status=e.vm_status.creating,n.container.find('button[name="create"]').addClass("disabled"),n.service.create_vm({step_id:t}).done(function(t){t.instances.forEach(function(e){e.ready=!1}),n.data.shanhe_instance_info=t,n.data.vm_status=e.vm_status.creating,n.imgClick=!1,i(r).attr({src:"/static/public/img/console_bg_img.png"})}).fail(function(t){var a=JSON.parse(t.responseText);if(n.container.find('button[name="create"]').removeClass("disabled"),n.imgClick=!1,i(r).attr({src:"/static/public/img/console_bg_img.png"}),a.code)switch(a.code){case 50003:case 50004:case 50005:break;default:n.data.vm_status=e.vm_status.closed}n.data.vm_status=e.vm_status.closed})}),n.container.delegate(".console_bg_img","mouseover",function(){n.imgClick||i(this).find("img").attr({src:"/static/public/img/console_bg_img_hover.png"})}),n.container.delegate(".console_bg_img","mouseout",function(){n.imgClick||i(this).find("img").attr({src:"/static/public/img/console_bg_img.png"})}),n.container.delegate('button[name="close"]:not(.disabled)',"click",function(){i(this).blur(),layer.confirm("实验环境将被删除,确定关闭?",{title:n.i18n.close},function(i){n.vm_is_refresh(),n.service.close_vm(t).done(function(){n.data.vm_status=e.vm_status.closed}),layer.close(i)},function(e){layer.close(e)})}),n.container.delegate('button[name="delay"]:not(.disabled)',"click",function(){if(n.data.timeout.allSecond>1800)var e=n.timeDivision(1800),t=n.timeDivision(n.data.timeout.allSecond),i="实验剩余时间 "+t+",剩余时间小于 "+e+"才可以延时",r=layer.alert(i,{title:"实验延时",closeBtn:1,icon:6},function(){layer.close(r)});else n.overtime()}),n.container.delegate('a[name="textcopy"]:not(.disabled)',"click",function(){var t=e.selectText();if(!t)return void e.msg_warning(n.i18n.noselectText);var i=n.data.vms;for(var r in i)i[r].guac_client&&i[r].guac_client.setClipboard(t);layer.tips("已复制",this,{tips:1,time:1e3})}),n.container.delegate(".document-copy","click",function(){for(var t=[],r=i(this).parent().find("code"),a=0;a<r.length;a++)code=r[a],t.push(i(code).text());if(!t.length)return void e.msg_warning(n.i18n.noselectText);var o=n.data.vms;for(var s in o)o[s].guac_client&&o[s].guac_client.setClipboard(t.join("\n"));layer.tips("已复制",this,{tips:1,time:1e3})}),n.container.delegate(".document-copy:not(.disabled)","mouseover",function(){n.copy_tip=layer.tips("复制内容",this,{tips:1,time:-1})}),n.container.delegate(".document-copy:not(.disabled)","mouseout",function(){n.copy_tip&&layer.close(n.copy_tip)}),n.container.delegate('button[name="refresh"]:not(.disabled)',"click",function(){i(this).blur(),n.vm_is_refresh(),n.show_vm()}),n.container.find('button[name="viewtype"]').toolbar({content:"#toolbar-viewtype",position:"bottom",style:"primary"}),n.container.find('button[name="viewtype"]').on("toolbarItemClick",function(e,t,i){i.hide()}),n.container.find("#btntoolbar").toolbar({content:"#toolbar-options",position:"bottom",style:"primary"}),n.container.find("#btntoolbar").on("toolbarItemClick",function(e,t,i){i.hide()}),n.container.find("#btntoolbar").on("toolbarShown",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.find("#btntoolbar").on("toolbarHidden",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.find("#docmarkdown").on("mouseup",function(){var t;if((t=document.selection?document.selection.createRange().text:window.getSelection()+"")&&n.data.vms){var r=e.getMousePos();if(i("#btntoolbar").css({left:r.x,top:r.y}),window.ActiveXObject||"ActiveXObject"in window){var a=n.data.vms;for(var o in a)a[o].guac_client&&a[o].guac_client.setClipboard(t);layer.tips("已复制","#btntoolbar",{tips:1,time:1e3})}else n.container.find("#btntoolbar").trigger("mouseover")}}),n.container.delegate('button[name="fullscreen"]',"click",function(){e.checkFull()?(e.exitFullScreen(n.data),e.checkFull()&&!(document.webkitIsFullScreen||document.msFullscreenElement||document.mozFullScreen||document.fullscreen)&&e.msg_warning("请按(F11)退出全屏")):e.fullScreen(n.data)}),n.container.delegate('button[name="scrapbooking"]',"click",function(){var t=layer.open({title:"剪切板",shade:.6,resize:!1,area:"612px",btn:["保存","取消"],id:"sd-dialog-scrapbooking",success:function(e,t){e.find("textarea[name='sd-textarea-scrapbooking']").val(n.data.scrapbooking_text||"")},btn1:function(i,r){var a=r.find("textarea[name='sd-textarea-scrapbooking']").val();if(!a)return void e.msg_warning("请输入要复制的内容");var o=n.data.vms;for(var s in o)o[s].guac_client&&o[s].guac_client.setClipboard(a);e.msg_success("复制成功"),layer.close(t)},btn2:function(){layer.close(t)},cancel:function(e,i){layer.close(t)},content:f})}),n.container.delegate('button,input[type="button"]',"click",function(){i(this).blur()}),n.container.delegate("select","change",function(){i(this).blur()})}},step_code:function(e){var t=this;"start"==e?(t.data.show_vm.show=!0,t.service.step_code_server(t.data.show_vm.code_data).done(function(e){t.data.show_vm.show=!1;var i=t.data.show_vm.code_data;e&&(e.file_list.forEach(function(e){e.href="/step_code_download?filename="+e.filename+"&vm_protocol="+i.vm_protocol+"&vm_resid="+i.vm_resid+"&step_id="+t.vstep_id}),t.data.step_code_list=e.file_list,0==t.data.step_code_list.lenght?t.data.show_vm.title="云主机暂无代码可以导出":t.data.show_vm.title="","windows"==e.os_type.toLowerCase()?t.data.show_vm.prompt="windows系统暂不支持导出代码功能":t.data.show_vm.prompt='将需要下载的文件放在"/home/code"目录')}).fail(function(e){t.data.show_vm.show=!1,t.data.show_vm.title="云主机暂无代码可以导出"})):"end"==e&&(t.data.show_vm.title="需要您创建云主机才能导出代码",t.data.step_code_list="",t.data.show_vm.code_data="")},unescapeHTML:function(e){return e=""+e,e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")},onClose:function(){this.content&&this.content.destroy(),this.container.remove()},getModelLabel:function(){return"expdesktop_view"},tools_hide_fun:function(){var e=i(window).width(),t=this;"max"==t.data.toggle.editormd_show&&i(".editormd-toggle").animate({left:e-26+"px"}),i(".hide-tools").css("display","block"),i(".show-tools").css("display","none"),i(".expDesktop_tool").animate({right:"-140px"},function(){t.data.toggle.tools_show="hide"})},tools_show_fun:function(){var e=i(window).width(),t=this;"max"==t.data.toggle.editormd_show&&i(".editormd-toggle").animate({left:e-26-140+"px"}),i(".hide-tools").css("display","none"),i(".show-tools").css("display","block"),i(".expDesktop_tool").animate({right:"0"},function(){t.data.toggle.tools_show="display"})},editormd_hide_fun:function(){var e=this;e.data.toggle.editormd_show="hide",e.ishind=!0,i(".hide-editormd").css("display","block"),i(".show-editormd").css("display","none"),i(".maximize-editormd").css("display","none"),i(".expDesktop_editormd").animate({left:-e.exp_width+"px"},function(){}),i(".editormd-toggle").animate({left:0},function(){}),i(".expDesktop_editormd_box").animate({width:0},function(){e.set_vm_scale()})},editormd_show_fun:function(){var e=this;e.data.toggle.editormd_show="display",e.data.editormd.editormd_show="显示文档";var t=document.getElementsByClassName("editormd-toggle-move")[0],n=document.getElementsByClassName("editormd-toggle")[0];i(t).show(),i(n).css({top:e.dragDoc+"px"}),e.ishind=!1,i(".hide-editormd").css({display:"none"}),i(".show-editormd").css({display:"block"}),i(".maximize-editormd").css("display","block"),i(".editormd-toggle").animate({left:e.exp_width-26+"px"}),i(".expDesktop_editormd").animate({width:e.exp_width+"px",left:0},function(){}),i(".expDesktop_editormd_box").animate({width:e.exp_width+"px"},function(){e.set_vm_scale()})},editormd_maximize_fun:function(){var e=this,t=0;e.data.toggle.editormd_show="max",e.data.editormd.editormd_show="还原文档","display"==e.data.toggle.tools_show&&(t=140);var n=document.getElementsByClassName("editormd-toggle-move")[0];i(n).hide();var r=i(window).width();i(".hide-editormd").css("display","block"),i(".show-editormd").css("display","none"),i(".maximize-editormd").css("display","none"),i(".editormd-toggle").animate({left:r-26-t+"px"}),i(".editormd-toggle").css({top:e.dragDocInit+"px"}),i(".expDesktop_editormd").animate({left:0,width:r+"px"}),i(".expDesktop_editormd_box").animate({width:r+"px"},function(){})},DragLeftBar:function(){var e=this,t=document.getElementsByClassName("shuidi-left-drag")[0],n=document.getElementsByClassName("expDesktop_editormd")[0],r=document.getElementsByClassName("expDesktop_editormd_box")[0],a=document.getElementsByClassName("editormd-toggle")[0];t.onmousedown=function(o){function s(t){t.preventDefault();var r=[0,0];r=c<e.windpi.sm?[100,420]:e.windpi.sm<=c&&c<e.windpi.md?[260,480]:e.windpi.md<=c&&c<e.windpi.lg?[320,600]:[320,800],r[1]>=c&&(r[1]=c);var o=(t||window.event).clientX;o<=r[0]?o=r[0]:o>=r[1]&&(o=r[1]);var s=o-u;i(n).width(d+s+"px"),i(".expDesktop_editormd_box").css({width:d+s+"px"},function(){}),i(a).css({left:d+s-26+"px"}),e.exp_width=d+s,e.set_vm_scale()}function l(){t.releaseCapture?(t.onmousemove=null,t.onmouseup=null,t.releaseCapture()):(document.removeEventListener("mousemove",s,!0),document.removeEventListener("mouseup",l,!0))}var c=i(window).width(),u=(o||window.event).clientX,d=i(r).width();t.setCapture?(t.onmousemove=s,t.onmouseup=l,t.setCapture()):(document.addEventListener("mousemove",s,!0),document.addEventListener("mouseup",l,!0))}},DragDoc:function(){var e=this,t=document.getElementsByClassName("editormd-toggle-move")[0],n=document.getElementsByClassName("editormd-toggle")[0];t.onmousedown=function(r){function a(t){t.preventDefault();var r=(t||window.event).clientY;r<=48?r=48:r>=l-10&&(r=l-10);var a=r-c;i(n).css({top:s+a+"px"}),e.dragDoc=s+a}function o(){t.releaseCapture?(t.onmousemove=null,t.onmouseup=null,t.releaseCapture()):(document.removeEventListener("mousemove",a,!0),document.removeEventListener("mouseup",o,!0))}var s=i(n).position().top,l=i(window).height(),c=(r||window.event).clientY;t.setCapture?(t.onmousemove=a,t.onmouseup=o,t.setCapture()):(document.addEventListener("mousemove",a,!0),document.addEventListener("mouseup",o,!0))}},DragTime:function(){var e=document.getElementsByClassName("console_residue_time")[0];e.onmousedown=function(t){function n(t){t.preventDefault();var n=(t||window.event).clientX;n<=40?n=40:n>=o-60&&(n=o-60);var r=n-s;i(e).css({left:a+r+"px"})}function r(){e.releaseCapture?(e.onmousemove=null,e.onmouseup=null,e.releaseCapture()):(document.removeEventListener("mousemove",n,!0),document.removeEventListener("mouseup",r,!0))}var a=i(e).position().left,o=i(window).width();a<=0&&(a=0,i(e).css({left:"0px"})),a>=o-100&&(a=o-100,i(e).css({left:a+"px"}));var s=(t||window.event).clientX;e.setCapture?(e.onmousemove=n,e.onmouseup=r,e.setCapture()):(document.addEventListener("mousemove",n,!0),document.addEventListener("mouseup",r,!0))}},timeDivision:function(e){var t="",i=Math.floor(e/86400),n=Math.floor((e-86400*i)/3600),r=Math.floor((e-86400*i-3600*n)/60),a=Math.floor((e-86400*i-3600*n)%60);return i>0&&(t+=i+" 天 "),n>0&&(t+=n+" 小时 "),r>0&&(t+=r+" 分钟 "),a&&(t+=a+" 秒 "),t},overtime:function(){var t=this,i=t.timeDivision(3600),n=t.timeDivision(t.data.timeout.allSecond);layer.confirm("注意:实验剩余时间 "+n+",时间结束后实验会被删除,如需延长时间请点击“延时”按钮延时"+i+"。",{title:"实验即将结束",btn:["延时","取消"]},function(i){var n={add_time:60,step_id:t.data.vstep_id};t.service.overtime_server(n).done(function(i){t.setTime(i.remain_time),e.msg_success("延时成功")}).fail(function(e){}),layer.close(i)})},vm_is_refresh:function(){this.guac_init&&(this.guac_init.options.refresh=!0)},fill_address:function(e){var t="";return"pub_course"==e.c_type?t=SDC.domain.pcourse_domain+e.doc_file:"v_course"==e.c_type?t=SDC.domain.vcourse_domain+e.doc_file:"s_course"==e.c_type&&(t=SDC.domain.icourse_domain+e.doc_file),t},get_step_video:function(){var e=this,t=e.data.getGroup_res_data;e.service.step_video({step_id:t.id}).done(function(t){e.data.step_video_list=t.video})},video_open:function(e,t){var i=this,n=null;layer.open({id:e.id,type:1,title:"视频播放器",shade:!1,maxmin:!0,area:["1000px","90%"],zIndex:100,content:'<video id="myVideo" width="1000px" height="700px" class="video-play-view video-js vjs-big-play-centered"></video>',success:function(r,a){i.get_video_test(e.id,function(r){n=i.video_play(e,t,r)})},cancel:function(e,t){n.dispose()},min:function(e,t){n.pause()}})},video_play:function(t,i,n){var r=this,a=i?i.second:0,o=a,s=e.getDomain(e.domain_type.step_att)+t.url;return player=h("#myVideo",{controls:!0,autoplay:!1,language:"zh-CN",inactivityTimeout:!0,seeking:!1,controlBar:{playToggle:!0,currentTimeDisplay:!0,timeDivider:!0,durationDisplay:!0,remainingTimeDisplay:!1,volumePanel:{inline:!0},progressControl:{disabled:!0},children:[]},sources:[{src:s}]},function(){var e=this;Math.floor(t.second)===Math.floor(a)&&e.currentTime(0),this.on("timeupdate",function(){1!==this.playbackRate()&&(this.playbackRate(1),this.currentTime(a)),o<this.currentTime()&&(o=this.currentTime()),a=this.currentTime(),n.forEach(function(t,i){Math.floor(a)!==Math.floor(t.second)||t.status||(t.status=!0,e.pause(),r.Question(t))})}),this.on("ended",function(){})}),player},get_video_test:function(e,t){this.service.video_test({video_id:e}).done(function(e){var i=[],n=e.videotest,r=[];n.forEach(function(e){if(-1===r.indexOf(e.second)){var t={answer:JSON.parse(e.answer),test:JSON.parse(e.test),status:!1,second:e.second,id:e.id,video_id:e.video_id};i.push(t),r.push(e.second)}else i.forEach(function(t){t.second===e.second&&(t.answer=t.answer.concat(JSON.parse(e.answer)),t.test=t.test.concat(JSON.parse(e.test)))})}),t(i)})},Question:function(e){var t=this;new s(t.language,t.appOptions,t.step_id,t.data.getGroup_res_data.rel_c_s_g_id,e,t.service,function(e,t){}).show()},video_study_record:function(e,t){var i=this,n={action:"video_study_record",second:Math.floor(t.currentTime()),video_id:e.id,course_id:i.course_id,group_id:i.group_id,rel_c_s_g_id:i.data.getGroup_res_data.rel_c_s_g_id,test_true:0,test_count:0};SDC.RegionOne.send(JSON.stringify(n))}};return i.extend(m.prototype,t.prototype),i.extend(m.prototype,g),m}),define("modules/console/monitoring/service",["network-utils","jquery","modules/utils/baseservice_tlab"],function(e,t,i){var n=function(e){this.dataControl=e};return n.prototype={getvm_screen:function(){return e.doGet("/ecos/qcec_console_nsq/v1/monitor")},delete_vm_screen:function(t){return e.doDelete("/ecos/qcec_console_nsq/v1/monitor",null,null,null,t)}},t.extend(n.prototype,i.prototype),n}),define("text!modules/console/monitoring/lang.json",[],function(){return'{\r\n "config": {\r\n "monitor_title":{"field": "monitor_title"},\r\n "vm_token": "",\r\n "vms":{},\r\n "monitor_list": [\r\n \r\n ],\r\n "timeout":[\r\n \r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "monitor_title": "监控",\r\n "section_status": "部分完成",\r\n "undone_status": "未完成",\r\n "title": "实验报告",\r\n "save": "保存",\r\n "purpose": "实验目的",\r\n "savestep": "保存并提交",\r\n "name": "实验名称",\r\n "completion": "完成情况",\r\n "undone": "未完成原因",\r\n "content": "报告内容",\r\n "report": "实验报告",\r\n "remotely": "远程协助",\r\n "monitor": "实验监控",\r\n "scrapbooking": "剪贴板",\r\n "uploadFiles": "上传文件",\r\n "timeCost": "实验用时:",\r\n "doc": "文档",\r\n "question": "问答",\r\n "notes": "笔记",\r\n "evaluation": "评价",\r\n "fraction": "给步骤打分",\r\n "publish": "发表",\r\n "viewtype": "显示方式",\r\n "contitle": "实验桌面标题",\r\n "course_step_evaluate": "步骤评价",\r\n\r\n "send_comment": "发表",\r\n "grade": "给步骤评分",\r\n "create": "创建",\r\n "clipboard": "剪贴板",\r\n\r\n "close": "关闭",\r\n "help": "请求协助",\r\n "unhelp": "取消协助",\r\n "assist": "协助",\r\n "creatingvm": "正在创建实验环境……",\r\n "ladingvmerror": "加载实验环境失败,请点击刷新按钮或等待10秒重新加载",\r\n "rdp": "桌面版",\r\n "ssh": "命令行版",\r\n "waiting": "实验环境正在创建中…",\r\n "creating": "创建中…",\r\n "refresh": "刷新",\r\n "click": "点击创建加载环境...",\r\n "remain_time": "剩余时间",\r\n "hour": "时",\r\n "minute": "分",\r\n "second": "秒",\r\n "accept_assist": "对方已接受协助请求",\r\n "reject_assist": "对方拒绝了协助请求",\r\n "timeout": "学习时间已结束,实验环境已经删除。如果继续学习,请重新创建",\r\n "Warning": "温馨提示",\r\n "cannot_load": "加载实验环境失败,请重试",\r\n "operation_unsupported": "不支持此操作",\r\n "internal_error": "发生了内部错误,无法执行操作。",\r\n "vm_used_locked": "实验环境已经在使用或锁定,请刷新控制台页面",\r\n "vm_closed": "实验环境已经关闭,请重新创建",\r\n "vm_busy": "实验环境忙,需要首先释放连接,然后重试或尝试刷新操作",\r\n "vm_connect_use": "控制台已经被另一个连接使用,请先关闭该连接,或者刷新控制台页面。",\r\n "vm_authorized_fail": "授权失败,请联系管理员或尝试刷新操作",\r\n "vm_many_resources": "您已经使用了太多的资源,请关闭一些正在使用的实验环境或尝试刷新操作",\r\n "noselectText": "请先选中页面中的文本内容",\r\n "evaluate_tip": "还可以输入<span>{0}</span>字",\r\n "cancel": "取消"\r\n }\r\n }\r\n}'}),define("modules/console/monitoring/controller",["app-utils","modules/console/basecontroller","jquery","guacamole","modules/console/monitoring/service","text!modules/console/monitoring/lang.json"],function(e,t,i,n,r,a){function o(e,t,i){this.container=e,this.language=t,this.appOptions=i,this.lang=a,this.guac=null,this.display=null}var s={initAvalon:function(e){var t=this;e.events.delete_vm=function(e,n){layer.confirm("确定要关闭对"+e.real_name+"的监控吗?",{btn:["确定","取消"]},function(r){layer.close(r);var a=[{user_id:e.user_id,step_id:e.step_id}];t.service.delete_vm_screen({monitor_list:a}).done(function(r){i(".model:eq("+n+")").css("display","none"),t.close_vm(e)}).fail(function(e){})})},e.events.layer_vm=function(e,n){var r="#display_"+e.step_id+"_"+e.user_id;layer.open({type:1,shade:0,title:e.username,area:["100%","100%"],shadeClose:!1,zIndex:1,resize:!1,content:i(r),end:function(e,t){i(r).find("canvas").css({width:"600px",height:"340px"}),i(r).css({width:"600px",height:"340px"}),i(".layui-body").css({overflow:"auto"})},success:function(n,r){var a="#display_"+e.step_id+"_"+e.user_id,o=i(window).width(),s=i(window).height();i(a).width(o),i(a).height(s),i(a).find("canvas").width(o),i(a).find("canvas").height(s),t.data.vms[a].guac.sendSize(o,s),i(".layui-body").css({overflow:"hidden"})}})}},setDataControl:function(e){this.dataControl=e,this.service=new r(this.dataControl),this.dataControl.addLisenter("monitor",this,this.socket)},socket:function(t,i,n){var r=this;"monitor"==n.resource_type&&("end"==n.stage&&"get"==n.action&&r.show_vm(n.message),"end"!=n.stage||"time_end"!=n.action&&"closed"!=n.action||("time_end"==n.action?e.msg_success("监控结束",null,{closeButton:!0,onCloseClick:function(){r.close_vm(n.message)},onHidden:function(){r.close_vm(n.message)}}):r.close_vm(n.message)))},set_vm_scale:function(){var e=this,t=e.data.vms,n=0;for(var r in t){if(!t[r].display)return;r==e.data.vm_token?(winW=i(e.container.find("#display_"+id)).width(),n=e.container.find("#display"+id).height()-10):(winW=i(e.container.find("#display2_"+id)).width(),n=e.container.find("#display2_"+id).height()-10),t[r].guac.sendSize(winW,n)}return},setTime:function(e,t){var i=this,n=e;if(0==e)return clearInterval(i.data.monitor_list[t].timer),!1;i.data.monitor_list[t].timer&&clearInterval(i.data.monitor_list[t].timer);var r=0;i.data.monitor_list[t].timer=setInterval(function(){if((r+=1)>n)clearInterval(i.data.monitor_list[t].timer),i.data.monitor_list[t].hour=0,i.data.monitor_list[t].minute=0,i.data.monitor_list[t].second=0;else{var e=n-r,a=Math.floor(e/86400);i.data.monitor_list[t].hour=Math.floor((e-24*a*60*60)/3600),i.data.monitor_list[t].minute=Math.floor((e-24*a*60*60-3600*i.data.monitor_list[t].hour)/60),i.data.monitor_list[t].second=Math.floor(e-24*a*60*60-3600*i.data.monitor_list[t].hour-60*i.data.monitor_list[t].minute)}},1e3)},close_vm:function(e){var t=this,i=e.user_id,n=e.step_id,r="#display_"+n+"_"+i;t.container.find(r).empty();var a=t.data.vms[r];a.guac&&(a.guac.disconnect(),a.guac=null),t.data.monitor_list.forEach(function(e,r){e.user_id==i&&e.step_id==n&&t.setTime(0,r)})},show_vm:function(e){var t=this,n=String(e.current_active_rs.token),r=e.user_id,a=e.step_info.id;if(n){var o="#display_"+a+"_"+r;t.container.find(o).empty();t.data.monitor_list.forEach(function(e,i){e.user_id==r&&e.step_id==a&&(t.data.monitor_list[i].show="processing")});var s=t.data.vms;t.data.vms[o]||(s[o]={token:n}),s[o].guac&&(s[o].guac.disconnect(),s[o].guac=null);var l=new Guacamole.WebSocketTunnel(SDC.sock_type+"://"+SDC.guacHost+"/v1/monitor");s[o].guac=new Guacamole.Client(l),
|
||
t.container.find(o).html(s[o].guac.getDisplay().getElement()),s[o].guac.onerror=function(e){0==e.code?t.data.iswaiting=!1:t.console_conn_error(e.code)},vm_width=i(t.container.find(o)).width(),vm_height=i(t.container.find(o)).height()-10;var c="vm_token="+n+"&vm_width="+vm_width+"&vm_height="+vm_height;s[o].guac.connect(c)}},setData:function(){},refreshData:function(e){this.setData(e)},onInitialize:function(e){i("#monitoring_list").css({display:"block"});var t=this;SDC.msgsocket||(SDC.msgsocket=new WebSocket(SDC.sock_type+"://"+SDC.SOCKJS_URL+"/v1/msg"));var n={};n.Authorization=SDC.user.auth_token,SDC.msgsocket.onopen=function(){SDC.msgsocket.send(JSON.stringify(n)),t.get_monitor_service()}},get_monitor_service:function(){var e=this,t=layer.load(2,{shade:[.1,"#ffffff"]});e.service.getvm_screen().done(function(i){if(layer.close(t),0==i.monitor_list.length)return!1;i.monitor_list.forEach(function(e,t){e.show="loading";var i=e.remain_time,n=Math.floor(i/86400),r=Math.floor((i-24*n*60*60)/3600),a=Math.floor((i-24*n*60*60-3600*r)/60),o=Math.floor(i-24*n*60*60-3600*r-60*a);e.hour=r,e.minute=a,e.second=o,e.timer=""}),e.data.monitor_list=i.monitor_list,e.data.monitor_list.forEach(function(t,i){var n=t.remain_time;e.setTime(n,i)})}).fail(function(e){layer.close(t)})},getModelLabel:function(){return"monitoring_view"}};return i.extend(o.prototype,t.prototype),i.extend(o.prototype,s),o}),define("modules/console/expconsole/service",["network-utils","jquery","modules/utils/baseservice"],function(e,t,i){var n=function(e){this.dataControl=e};return n.prototype={overtime_server:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/resource_template/delay_time",t)},createreport:function(t){return e.doPost("/ecos/qcec/v1/report",t)},expReportList:function(t){return e.doGet("/ecos/qcec/v1/report",t)},changeEreport:function(t,i){return e.doPut("/ecos/qcec/v1/report/"+t,i)},getCommentList:function(t){return e.doGet("/ecos/qcec_noauth/noauth/comment",t)},createComment:function(t){return e.doPost("/ecos/qcec/v1/comment",t)},getcourse:function(t,i){return e.doGet("/ecos/qcec/v1/course/"+t,i)},getTeacherInfo:function(t){return e.doGet("/ecos/qcec_noauth/noauth/user/get_provider/",{course_id:t})},createScore:function(t){return e.doPost("/ecos/qcec/v1/mark",t)},isCreateScore:function(t){return e.doGet("/ecos/qcec/v1/mark",t)},updateScore:function(t,i){return e.doPut("/ecos/qcec/v1/mark/"+t,i)},step_attachment:function(t){return e.doGet("/ecos/qcec/v1/step_attachment/",t)},step_code_server:function(t){return e.doGet("/ecos/qcec/v1/upload_file/get_files",t)},upload_file:function(t){return e.doGet("/ecos/qcec/v1/upload_file",t)},step_code_upload:function(t){return e.doPost("/step_code_upload/",t)},save_env:function(t){return e.doPost("/ecos/qcec/v1/lab_template",t)},delete:function(e){},createvm:function(t){return e.doPost(this.api.createtemplate_vm,t)},bindvm_template:function(t){return e.doPut(this.api.bindvm_template,t)},get_detial:function(t){return xhr=e.doGet("/ecos/qcec/v1/lab_template/"+t,{}),xhr},check_courseExp:function(t){return e.doGet("/ecos/qcec_console_nsq/v1/resource_template/"+t)},create_vmExp:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/resource_template/",t)},close_vmExp:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/resource_template/close",{lab_template_id:t})},close_vmSaveExp:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/resource_template/save_close/",t)},save_vmSaveExp:function(t){return e.doPost("/ecos/qcec_console_nsq/v1/resource_template/save/",t)},get_config_detial:function(t){return xhr=e.doGet("/ecos/qcec/v1/template_version/",t),xhr}},t.extend(n.prototype,i.prototype),n}),define("text!modules/console/expconsole/pop/create/index.html",[],function(){return'<div ms-controller="">\r\n \r\n\r\n\r\n\r\n <div class="icode fade" tabindex="-1" role="dialog">\r\n <div class="icode-dialog">\r\n <div class="icode-content">\r\n <div class="icode-header">\r\n <h4 class="icode-title">{{ header.title }}</h4>\r\n </div>\r\n <div id="data_form" class="tab-content form-horizontal">\r\n <div class="tab-pane fade in active" id="course">\r\n <div class="icode-form-group clearfix" ms-for="field in fields">\r\n\r\n <div class="icode-form-l fl">\r\n <label>{{ field.title }}:</label>\r\n </div>\r\n \r\n <div class="icode-form-r fl" ms-if="field.type==\'input\'">\r\n <input ms-attr="{\'placeholder\':field.tip.title,\'name\':field.field}" class="icode-form-long text" type="text" required/>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'textarea\'">\r\n <textarea ms-attr="{\'name\':field.field}" class="icode-form-long" required></textarea>\r\n </div>\r\n <div class="icode-form-r fl" ms-if="field.type==\'radio\'">\r\n <label ms-for = "r in field.data" ms-attr = "{for: r.field}">\r\n \r\n <input type="radio" ms-attr="{id:r.field,name:field.field,value:r.value,field:field.field,checked:r.checked==true }" >\r\n {{r.title}}\r\n </label>\r\n </div>\r\n\r\n\r\n\r\n\r\n\r\n </div>\r\n <div class="icode-footer">\r\n\r\n <button class="btn" ms-for="button in buttons" ms-attr="{name:button.field}" >{{button.title}}</button>\r\n\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n \r\n'}),define("text!modules/console/expconsole/pop/create/lang.json",[],function(){return'{\r\n "config": {\r\n "header": {\r\n "field": "title"\r\n },\r\n "fields": [\r\n {\r\n "type": "textarea",\r\n "field": "assist_msg",\r\n "value": "",\r\n "placer": "",\r\n "assist_msgnotempty": { "field": "assist_msgnotempty" }\r\n\r\n }\r\n ],\r\n "buttons": [\r\n\r\n {\r\n "field": "cancel",\r\n "style": "cancel",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "send",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ]\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "title": "保存模板(注意:保存模板将会关闭实验环境)",\r\n "op_type": "协助模式",\r\n\r\n "see": "观看",\r\n "control": "控制",\r\n "send": "保存并关闭",\r\n "op_user": "协助者",\r\n "assist_msg": "配置说明",\r\n "cancel": "取消",\r\n "assist_usernotempty": "请输入协助者手机号",\r\n "assist_msgnotempty": "请输入协助信息",\r\n "assist_user_tip": "手机号",\r\n "mobile_length": "请输入11位手机号码",\r\n "mobile_regexp": "请输入正确的手机号码",\r\n "assist_msg_length": "协助信息在255字符以内。"\r\n\r\n }\r\n }\r\n}\r\n'}),define("modules/console/expconsole/pop/create/controller",["popcontrollerbase_v2","jquery","text!modules/console/expconsole/pop/create/index.html","text!modules/console/expconsole/pop/create/lang.json"],function(e,t,i,n){function r(e,t,r,a,o){this.language=e,this.appOptions=t,this.lang=n,this.template=i,this.onCreated=o,this.service=r,this.lab=a}var a={initAvalon:function(e){},onInitialize:function(e){var t=this;t.data;this.container.delegate('.btn[name="send"]',"click",function(){if(!t.lab)return void layer.alert("请前往实验模板新建模板");var e=t.generateData();if(!e)return void layer.alert("请填写配置说明");if(e){var i={lab_template_id:t.lab.id,desc:e.assist_msg},n=layer.load(0,{shade:[.1,"#fff"]});t.service.save_vmSaveExp(i).done(function(e){layer.close(n),t.onCreated&&(t.onCreated(e),t.container.find(".closeModal").trigger("click"))}).fail(function(e){layer.close(n),t.container.find(".closeModal").trigger("click"),t.pushError(e)})}}),this.container.delegate('.btn[name="cancel"]',"click",function(){t.container.find(".closeModal").click()})},getModelLabel:function(){return"pop_heplvm_view"}};return t.extend(r.prototype,e.prototype),t.extend(r.prototype,a),r}),define("modules/console/expconsole/model/code/controller",["app-utils","jquery","filesaver"],function(e,t,i){function n(i,n,r){this.data=i,this.service=n,this.client=r,this.fileSystem=null;var a=this;a.data.events.code_refresh=function(){a.init("start");var e=a.data.guac_file_current_path;a.fileSystem.requestInputStream(e)},a.data.events.step_attachment=function(t){window.open(e.getDomain(e.domain_type.step_att)+t.api_url)},a.data.events.code_open_folder=function(e){"/"==a.data.guac_file_current_path?a.data.guac_file_current_path=a.data.guac_file_current_path+e+"/":a.data.guac_file_current_path=a.data.guac_file_current_path+"/"+e+"/",a.fileSystem.requestInputStream(a.data.guac_file_current_path)},a.data.events.code_change_folder=function(e){var i=t.extend(!0,[],a.data.guac_file_full_path);i.splice(e+1,i.length-e-1);var n=i.join("/");1==i.length?n="/":n+="/",a.data.guac_file_current_path=n,a.fileSystem.requestInputStream(a.data.guac_file_current_path)},a.data.events.code_download_file=function(e){var t=a.data.guac_file_current_path+"/"+e;a.fileSystem.requestInputStream(t)},a.data.$watch("guac_file_current_path",function(e){a.data.guac_file_full_path="/"==e?[""]:e.split("/")}),setTimeout(function(){t(".guac_upload_file_btn_custom").off("click").on("click",function(){return t("#guac_upload_file_custom").click()}),t("#guac_upload_file_custom").off("change").on("change",function(){var e=document.getElementById("guac_upload_file_custom"),t=e.files[0];a.uploadFile(a.fileSystem,t)})},2e3)}var r={init:function(e){var t=this;return"start"==e?(t.data.show_vm.show=!1,t.fileSystem||t.guacDownload(t.client),t.data.show_vm.title="","windows"==t.data.show_vm.code_data.os_type.toLowerCase()?t.data.show_vm.prompt="上传/下载目录为C:\\sftp":t.data.show_vm.prompt='上传/下载目录为"/home/code"目录'):"end"==e&&(t.data.show_vm.title="实验环境尚未启动,无法上传/下载文件",t.data.step_code_list="",t.data.show_vm.code_data="",t.data.show_vm.prompt="",t.data.guac_file_current_path="/",t.data.guac_file_lists=[]),t},guacDownload:function(e){var t=this;e.onfilesystem=function(e){t.fileSystem=e;var i=t.data.guac_file_current_path;t.fileSystem.requestInputStream(i),e.onbody=function(e,i,n){e.sendAck("OK",Guacamole.Status.Code.SUCCESS);var r;r=window.BlobBuilder?new BlobBuilder:window.WebKitBlobBuilder?new WebKitBlobBuilder:window.MozBlobBuilder?new MozBlobBuilder:new function(){var e=[];this.append=function(t){e.push(new Blob([t],{type:i}))},this.getBlob=function(){return new Blob(e,{type:i})}},e.onblob=function(t){for(var i=window.atob(t),n=new ArrayBuffer(i.length),a=new Uint8Array(n),o=0;o<i.length;o++)a[o]=i.charCodeAt(o);r.append(n),length+=n.byteLength,e.sendAck("OK",0)},e.onend=function(){var e=r.getBlob();if(-1!=i.indexOf("stream-index+json")){var a=new FileReader;a.addEventListener("loadend",function(){var e=JSON.parse(a.result);t.data.guac_file_lists=[];for(var i in e){var n="";n=-1!=e[i].indexOf("stream-index+json")?"folder":"file";var r=t.data.guac_file_current_path;t.data.guac_file_lists.push({name:i.split(r)[1],type:e[i],typename:n})}}),a.readAsText(e,"UTF-8")}else{var o=n.split("/"),s=o[o.length-1];saveAs(e,s)}}}}},uploadFile:function(e,t){var i=this,n={},r=new FileReader;return r.onloadend=function(){var a=e.createOutputStream(t.type,i.data.guac_file_current_path+t.name),o=new Uint8Array(r.result),s=0;n.name=t.name,n.mimetype=t.type,n.length=o.length,a.onack=function(e){if(e.isError())return console.log(e.message),!1;var t=o.subarray(s,s+4096),n=i.bufferToBase64(t);a.sendBlob(n),(s+=4096)>=o.length&&(a.sendEnd(),i.data.events.code_refresh())}},r.readAsArrayBuffer(t),n},bufferToBase64:function(e){var t=Array.prototype.map.call(e,function(e){return String.fromCharCode(e)}).join("");return btoa(t)}};return t.extend(n.prototype,r),n}),define("text!modules/console/expconsole/lang.json",[],function(){return'{\r\n "config": {\r\n\r\n "vms": {},\r\n "page_id": "expdesltop_view_data_page",\r\n "current_assister": "",\r\n "current_assis_type": "read",\r\n "desktop_title":"",\r\n "current_unfold": "docmarkdown",\r\n "isspread": false,\r\n "vm_param": "",\r\n "vm_param2": "",\r\n "is_split": false,\r\n "reportData": "",\r\n "reportBtn": "",\r\n "step_msg": "",\r\n "is_assist": false,\r\n "assist_process_token": "",\r\n "assist_conn_token": "",\r\n "is_fullscreen": false,\r\n "is_onresize": true,\r\n "checkFull": false,\r\n "vm_status": "closed",\r\n "conTitle": {\r\n "field": "contitle"\r\n },\r\n "menu_tools":{\r\n "vm_name":"",\r\n "protocols":""\r\n },\r\n "editormd":{\r\n "editormd_show":"editormd_show_title"\r\n },\r\n "toggle":{\r\n "tools_show":"hide",\r\n "editormd_show":"hide"\r\n },\r\n "step": {\r\n "ip":"",\r\n "os_username":"",\r\n "os_password":"",\r\n "token": "",\r\n "progress": 0,\r\n "res_id": "",\r\n "instance_id": "",\r\n "protocol": "",\r\n "os_type": "",\r\n "res_id2": "",\r\n "protocol2": "",\r\n "os_type2": "",\r\n "protocol2_data": [],\r\n "id": "",\r\n "res_list": [\r\n\r\n ],\r\n "vm_models": {},\r\n "menu_view":{\r\n "tool_view":true,\r\n "doc_view":true\r\n },\r\n "fields": [\r\n {\r\n "field": "vm_name",\r\n "type": "select",\r\n "data": [],\r\n "value": ""\r\n },\r\n {\r\n "field": "protocols",\r\n "type": "select",\r\n "data": [],\r\n "value": ""\r\n },\r\n {\r\n "field": "expdesktop_info",\r\n "type": "expdesktop_info"\r\n },\r\n {\r\n "field": "create",\r\n "enabled": true,\r\n "hide": false,\r\n "type": "button",\r\n "icon":"play-circle"\r\n },\r\n {\r\n "field": "delay",\r\n "enabled": true,\r\n "hide": true,\r\n "type": "button",\r\n "icon": "clock-o"\r\n },\r\n {\r\n "field": "save",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"save"\r\n },\r\n {\r\n "field": "close",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"close"\r\n },\r\n {\r\n "field": "help",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"share-alt"\r\n },\r\n {\r\n "field": "unhelp",\r\n "hide": true,\r\n "type": "button",\r\n "enabled": true,\r\n "icon":"share-square"\r\n },\r\n\r\n {\r\n "field": "refresh",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"refresh"\r\n\r\n },\r\n {\r\n "field": "viewtype",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"columns"\r\n\r\n },\r\n {\r\n "field": "scrapbooking",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon": "scissors"\r\n },\r\n {\r\n "field": "fullscreen",\r\n "enabled": true,\r\n "type": "button",\r\n "hide": true,\r\n "icon":"arrows-alt"\r\n }\r\n ]\r\n },\r\n "timeout": {\r\n "zero": 0,\r\n "day":"0",\r\n "hour": "00",\r\n "minute": "00",\r\n "second": "00",\r\n "allSecond":0\r\n },\r\n "fields_report": [\r\n {\r\n "field": "completion",\r\n "type": "radio",\r\n "style": "vclass-name",\r\n "name": "radio",\r\n "value": 0,\r\n "data": [\r\n {\r\n "field": "all_status",\r\n "status": true,\r\n "value": 0\r\n },\r\n {\r\n "field": "section_status",\r\n "status": false,\r\n "value": 1\r\n },\r\n {\r\n "field": "undone_status",\r\n "status": false,\r\n "value": 2\r\n }\r\n ]\r\n },\r\n {\r\n "type": "ueditor",\r\n "field": "content",\r\n "value": ""\r\n }\r\n ],\r\n "fieldbuttons": [\r\n {\r\n "field": "save",\r\n "style": "save",\r\n "dismiss": ""\r\n },\r\n {\r\n "field": "savestep",\r\n "style": "success",\r\n "dismiss": ""\r\n }\r\n ],\r\n "step_attachment_list": [],\r\n "doctabs": [\r\n {\r\n "field": "code",\r\n "active": true,\r\n "show": true,\r\n "type": "code"\r\n }\r\n ],\r\n\r\n "show_vm": {\r\n "field": "close_vm",\r\n "code_data": "",\r\n "prompt": "",\r\n "show": false,\r\n "loading": true,\r\n "os_type": ""\r\n\r\n },\r\n "vstep_id": "",\r\n "step_code_list": [],\r\n "isloaded": false,\r\n "getGroup_res_data": "",\r\n "course_evaluate": {\r\n "field": "course_evaluate",\r\n "score": 0,\r\n "isCreate": true,\r\n "comment": {\r\n "field": "comment",\r\n "value": ""\r\n },\r\n "tip": {\r\n "field": "evaluate_tip",\r\n "value": ""\r\n },\r\n "button": { "field": "send_comment" },\r\n "comment_list": [\r\n\r\n ]\r\n },\r\n "comment_list": [\r\n\r\n ],\r\n "ismark": false,\r\n "markid": "",\r\n "op_type": "",\r\n "is_start":false,\r\n "lab_template": {},\r\n "name":"",\r\n "lab_template_version_list":[],\r\n "guac_file_lists": [],\r\n "guac_file_current_path": "/",\r\n "guac_file_full_path": [""],\r\n "scrapbooking_text": ""\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "delay": "延时",\r\n "all_status": "全部完成",\r\n "section_status": "部分完成",\r\n "undone_status": "未完成",\r\n "title": "实验报告",\r\n "save": "保存模板",\r\n "purpose": "实验目的",\r\n "savestep": "保存并提交",\r\n "name": "实验名称",\r\n "completion": "完成情况",\r\n "undone": "未完成原因",\r\n "content": "报告内容",\r\n "report": "报告",\r\n "remotely": "远程协助",\r\n "monitor": "实验监控",\r\n "scrapbooking": "剪贴板",\r\n "uploadFiles": "上传文件",\r\n "timeCost": "实验用时:",\r\n "docmarkdown": "文档",\r\n "question": "问答",\r\n "notes": "笔记",\r\n "evaluation": "评价",\r\n "fraction": "给实验打分",\r\n "publish": "发表",\r\n "viewtype": "显示方式",\r\n "contitle": "实验桌面标题",\r\n "course_step_evaluate": "实验评价",\r\n "close_vm": "实验环境尚未启动,无法上传/下载文件",\r\n "send_comment": "发表",\r\n "grade": "给实验评分",\r\n "create": "开始",\r\n "clipboard": "剪贴板",\r\n "editormd_show_title": "显示文档",\r\n "close": "关闭",\r\n "help": "请求协助",\r\n "unhelp": "取消协助",\r\n "assist": "协助",\r\n "creatingvm": "正在创建实验环境",\r\n "ladingvmerror": "加载实验环境失败,请点击刷新按钮或等待10秒重新加载",\r\n "RDP": "桌面版",\r\n "SSH": "命令行版",\r\n "waiting": "实验环境正在准备中",\r\n "creating": "准备中",\r\n "refresh": "刷新",\r\n "click": "点击创建加载环境...",\r\n "remain_time": "剩余时间",\r\n "hour": "时",\r\n "minute": "分",\r\n "second": "秒",\r\n "accept_assist": "对方已接受协助请求",\r\n "reject_assist": "对方拒绝了协助请求",\r\n "study_timeout": "学习时间已结束,实验环境已经删除。如果继续学习,请重新创建",\r\n "Warning": "温馨提示",\r\n "cannot_load": "加载实验环境失败,请重试",\r\n "operation_unsupported": "不支持此操作",\r\n "internal_error": "发生了内部错误,无法执行操作。",\r\n "vm_used_locked": "实验环境已经在使用或锁定,请刷新控制台页面",\r\n "vm_closed": "实验环境已经关闭,请重新创建",\r\n "vm_busy": "实验环境忙,需要首先释放连接,然后重试或尝试刷新操作",\r\n "vm_connect_use": "控制台已经被另一个连接使用,请先关闭该连接,或者刷新控制台页面。",\r\n "vm_authorized_fail": "授权失败,请联系管理员或尝试刷新操作",\r\n "vm_many_resources": "您已经使用了太多的资源,请关闭一些正在使用的实验环境或尝试刷新操作",\r\n "noselectText": "请先选中页面中的文本内容",\r\n "evaluate_tip": "还可以输入<span>{0}</span>字",\r\n "cancel": "取消",\r\n "material": "随材",\r\n "op_type": "协助方式",\r\n "read": "观看",\r\n "write": "控制",\r\n "code": "实验模板配置信息",\r\n "fullscreen": "全屏",\r\n "exitfullscreen": "退出全屏",\r\n "closing": "关闭中"\r\n }\r\n }\r\n}\r\n'}),define("modules/console/expconsole/controller",["app-utils","modules/console/basecontroller","jquery","modules/console/expconsole/model/guacamole/controller","modules/console/expconsole/service","modules/console/expconsole/pop/create/controller","modules/console/expconsole/model/code/controller","toolbar","layout","text!modules/console/expconsole/lang.json","text!modules/console/expdesktop/template/scrapbooking.html"],function(e,t,i,n,r,a,o,s,l,c,u){function d(e,t,n){this.container=e,this.language=t,this.appOptions=n,this.lang=c,this.vstep_id=null,this.step_id=null,this.isloading=!0,this.res_list={},this.timer=null,this.temp_ips=[],this.progresstimer=null,this.n=0,this.reconnect=1,this.vmlayout=null,this.layouttype="east",this.exp_width=360,this.windpi={sm:768,md:992,lg:1200},this.ishind=!1,this.dragDocInit=172,this.dragDoc=182,this.windowWidth=i(window).width(),this.imgClick=!1,this.code=null}var h={initAvalon:function(t){var n=this;t.events.desktop_tools_hide=n.tools_hide_fun.bind(this),t.events.desktop_tools_show=n.tools_show_fun.bind(this),t.events.desktop_editormd_hide=n.editormd_hide_fun.bind(this),t.events.desktop_editormd_show=n.editormd_show_fun.bind(this),t.events.desktop_editormd_maximize=n.editormd_maximize_fun.bind(this),t.events.change_vm_name=function(e){var t=e.id;n.data.step.instance_id=t,n.set_protocols(),n.setvm_param({token:n.data.step.token,protocol:n.data.step.protocol,instance_id:t,os_type:n.data.step.os_type}),n.data.step.ip=n.res_list[t].ip,n.data.step.os_username=n.res_list[t].os_username,n.data.step.os_password=n.res_list[t].os_password},t.events.change_protocols=function(e){var t=e.id;n.data.step.protocol=t,n.setvm_param({token:n.data.step.token,protocol:t,instance_id:n.data.step.instance_id,os_type:n.data.step.os_type})},t.events.changetabs=function(e,t){for(var i=0;i<n.data.doctabs.length;i++)n.data.doctabs[i].active=!1;e.active=!0,"report"==e.field?n.reportfun():"material"==e.field?n.get_step_attachment():"evaluation"==e.field&&n.get_comment_content()},t.$watch("step.res_list",function(e){e&&n.set_vm_ips()}),t.$watch("vm_param",function(e){e&&(n.vm_is_refresh(),n.show_vm())}),t.$watch("step.progress",function(e){n.isloading&&n.loading()}),t.$watch("is_split",function(e){if(e){n.data.step.protocol2_data=[],n.data.step.instance_id2=n.container.find("select[name='vm_ip2']").val(),n.field_vm_name.data=[{id:n.data.step.instance_id,title:n.res_list[n.data.step.instance_id].res_name}];var t=n.data.step.vm_models[n.data.step.instance_id2];t&&t.forEach(function(e){n.data.step.protocol2_data.push({id:e,title:n.i18n[e]})}),n.data.step.protocol2=n.container.find("select[name='protocol2']").val()}else n.set_vm_ips()}),t.$watch("step_msg",function(t){t&&e.msg_info(t)}),t.$watch("is_fullscreen",function(t){n.data.is_onresize=!1,t?e.fullScreen()&&(n.field_fullscreen.title=n.i18n.exitfullscreen):e.exitFullScreen()&&(n.field_fullscreen.title=n.i18n.fullscreen)}),t.$watch("vm_status",function(t){switch(t){case e.vm_status.creating:n.field_create.title=n.i18n.creating,n.field_create.enabled=!1,n.field_create.hide=!1,n.field_vm_name.data=[],n.field_protocols.data=[],n.field_refresh.hide=!0,n.field_save.hide=!0,n.field_fullscreen.hide=!0,n.field_close.hide=!0,n.field_viewtype.hide=!0,n.data.is_start=!0,n.field_delay.hide=!0,n.field_scrapbooking.hide=!0;break;case e.vm_status.running:n.field_create.hide=!0,n.field_vm_name.hide=!1,n.field_protocols.hide=!1,n.field_close.hide=!1,n.field_close.title=n.i18n.close,n.field_close.enabled=!0,n.field_refresh.hide=!1,n.field_save.hide=!1,n.field_fullscreen.hide=!1,n.data.is_start=!0,n.field_delay.hide=!1,n.field_scrapbooking.hide=!1;break;case e.vm_status.closing:n.field_close.hide=!1,n.field_close.enabled=!1,n.field_close.title=n.i18n.closing,n.field_create.hide=!0,n.field_refresh.hide=!0,n.field_save.hide=!0,n.field_fullscreen.hide=!0,n.field_viewtype.hide=!0,n.field_vm_name.data=[],n.field_protocols.data=[],n.data.is_start=!0,n.field_delay.hide=!0,n.field_scrapbooking.hide=!0;break;case e.vm_status.closed:n.field_close.hide=!0,n.field_create.hide=!1,n.field_create.title=n.i18n.create,n.field_create.enabled=!0,n.field_vm_name.data=[],n.field_protocols.data=[],n.field_refresh.hide=!0,n.field_save.hide=!0,n.field_fullscreen.hide=!0,n.field_viewtype.hide=!0,n.data.step.progress=0,n.data.is_start=!1,n.field_delay.hide=!0,n.field_scrapbooking.hide=!0;break;case e.vm_status.error:n.field_close.hide=!0,n.field_create.hide=!1,n.field_create.title=n.i18n.create,n.field_create.enabled=!1,n.field_vm_name.data=[],n.field_protocols.data=[],n.field_refresh.hide=!0,n.field_save.hide=!0,n.field_fullscreen.hide=!0,n.field_viewtype.hide=!0,n.data.step.progress=0,n.data.is_start=!1,n.field_delay.hide=!0,n.field_scrapbooking.hide=!0}}),window.onresize=function(){e.checkFull()?n.field_fullscreen.title=n.i18n.exitfullscreen:n.field_fullscreen.title=n.i18n.fullscreen;var t=i(window).height();n.container.find("#displayvm").height(t);var r=i(window).width();n.container.find("#displayvm").width(r),n.container.find(".expDesktop_head_wrap").width(.9*r),n.set_vm_scale()},t.$watch("course_evaluate.comment.value",function(e){t.course_evaluate.tip.value=t.course_evaluate.tip.title.replace(/\{\d\}/g,100-e.length)}),t.events.step_attachment=function(t){window.open(e.getDomain(e.domain_type.step_att)+t.api_url)},t.course_evaluate.tip.value=t.course_evaluate.tip.title.replace(/\{\d\}/g,100),t.events.goback=function(){history.go(-1)},t.events.current_vm_desc=function(){n.data.step.ip&&layer.tips("当前机器ip:"+n.data.step.ip,"#current_vm_desc",{tips:1})}},setDataControl:function(e){this.dataControl=e,this.service=new r(this.dataControl),this.dataControl.addLisenter("template",this,this.socket)},socket:function(t,i,n){var r=this;if(i=String(i),this.vstep_id===i&&t==e.vm_op_status.op_failed)return e.msg_error("实验环境创建失败"),r.close_vm(),void(r.data.vm_status=e.vm_status.closed);if(this.vstep_id===i&&"time_remind"===n.action&&"design"===n.data.mode&&(r.data.timeout.allSecond=n.data.remain_time,r.setTime(n.data.remain_time),r.overtime()),this.vstep_id===i&&(t===e.vm_status.creating||t===e.vm_status.running)&&"design"===n.data.mode){if(r.data.vm_status=e.vm_status.creating,r.data.step.progress=n.data.progress,!n.data.is_complete)return;r.data.vm_status=e.vm_status.running,r.data.step.progress=0,this.setTime(n.data.remain_time),this.data.step.token=n.data.current_res.vm_token,this.data.step.protocol=n.data.current_res.res_conn.filter(function(e){return 1==e.default})[0].protocol,this.data.step.instance_id=n.data.current_res.instance_id,this.data.step.ip=n.data.current_res.ip,this.data.step.os_username=n.data.current_res.os_username,this.data.step.os_password=n.data.current_res.os_password,this.data.step.os_type=n.data.current_res.os_type.toLowerCase(),this.data.vm_param={token:n.data.current_res.vm_token,protocol:n.data.current_res.res_conn.filter(function(e){return 1==e.default})[0].protocol,instance_id:n.data.current_res.instance_id,os_type:n.data.current_res.os_type.toLowerCase()},this.data.step.res_list=n.data.res_list}this.vstep_id!==i||"end"!==n.data.stage||n.action!==e.vm_status.time_end&&n.action!==e.vm_status.closing||("time_end"===n.action?e.msg_warning(r.i18n.study_timeout,null,{closeButton:!0,onCloseClick:function(){r.close_vm()},onHidden:function(){r.close_vm()}}):r.close_vm())},setvm_param:function(e){this.data.vm_param=e},show_vm:function(){var e=this;if(vm_width=window.screen.width,vm_height=window.screen.height,e.data.vm_param.token){var t=String(e.data.vm_param.token),r=e.data.vm_param.protocol,a=e.data.vm_param.instance_id,s=e.data.vms;e.data.vms[a]||(s[a]={token:t});for(var l in s)s[l].guac_client&&s[l].guac_client.disconnect();var c="vm_token="+t+"&vm_protocol="+r+"&vm_resid="+a+"&vm_width="+vm_width+"&vm_height="+vm_height+"&mode=design",u={i18n:e.i18n,tunnel_url:SDC.sock_type+"://"+SDC.guacHost,url:c,protocol:r,os_type:e.data.vm_param.os_type,token:t,box_width:i(".expDesktop_editormd_box").width()},d=new n(e.container.find("#display"),u,e.data,function(t){e.data.show_vm.code_data={vm_protocol:r,step_id:e.vstep_id,vm_resid:a,type:"design",os_type:e.data.vm_param.os_type},e.code=new o(e.data,e.service,t),e.code.init("start")});e.guac_init=d.init(),s[a]=d}},set_vm_scale:function(){var e=this,t=e.data.vms,n=i(window).width();e.ishind||(n=i(window).width()-e.exp_width),t[e.data.vm_param.instance_id]&&t[e.data.vm_param.instance_id].set_vm_scale(n)},set_vm_ips:function(){var e=this,t=e.data.step.res_list;e.field_vm_name.data=[],t.forEach(function(t){e.field_vm_name.data.push({id:t.instance_id,title:t.res_name}),e.data.step.vm_models[t.instance_id]=t.res_conn,e.res_list[t.instance_id]=t}),e.field_vm_name.value=e.data.step.instance_id,e.set_protocols()},set_protocols:function(){var e=this;e.field_protocols.data=[];var t=[],i=e.data.step.vm_models[e.data.step.instance_id];i&&i.forEach(function(i){t.push({id:i.protocol,guac_id:i.guac_id,title:e.i18n[i.protocol]})}),e.field_protocols.data=t,1===t.length&&(e.data.step.protocol=t[0].id),e.field_protocols.value=e.data.step.protocol},setTime:function(e){var t=this;this.timer&&clearInterval(this.timer),t.data.timeout.allSecond=e;var i=t.data.timeout,n=Math.floor(e/86400);i.day=n,i.hour=Math.floor(e/3600),i.hour.toString().length<2&&(i.hour="0"+i.hour),i.minute=Math.floor((e-3600*i.hour)/60),i.minute.toString().length<2&&(i.minute="0"+i.minute),i.second=Math.floor(e-3600*i.hour-60*i.minute),i.second.toString().length<2&&(i.second="0"+i.second);var r=0;this.timer=setInterval(function(){if((r+=1)>e)clearInterval(t.timer),i.day="0",i.hour="00",i.minute="00",i.second="00",t.data.timeout.allSecond=0;else{var n=e-r;t.data.timeout.allSecond=n;var a=Math.floor(n/86400);i.day=a,i.hour=Math.floor(n/3600),i.hour.toString().length<2&&(i.hour="0"+i.hour),i.minute=Math.floor((n-3600*i.hour)/60),i.minute.toString().length<2&&(i.minute="0"+i.minute),i.second=Math.floor(n-3600*i.hour-60*i.minute),i.second.toString().length<2&&(i.second="0"+i.second)}},1e3)},close_vm:function(){var t=this;t.container.find("#display").empty(),t.container.find("#display2").empty(),t.code&&t.code.init("end");for(var i in t.data.vms){var n=t.data.vms[i];n.guac_client&&(n.guac_client.disconnect(),n.guac_client=null),n=null}t.data.is_split=!1,t.vmlayout&&t.vmlayout.hide(t.layouttype),t.data.step.progress=0,t.data.vm_param="",t.data.step.token="",t.data.step.protocol="",t.data.step.instance_id="",t.data.step.res_list=[],t.data.step.vm_models=[],t.data.step.ip="",t.data.step.os_username="",t.data.step.os_password="",t.data.step.os_type="",t.data.step_msg="",e.exitFullScreen(t.data),e.checkFull()&&!(document.webkitIsFullScreen||document.msFullscreenElement||document.mozFullScreen||document.fullscreen)&&e.msg_info("请按(F11)退出全屏"),t.data.is_fullscreen=!1,t.setTime(0),t.data.vm_status=e.vm_status.closed},loading:function(){var t=this;t.isloading=!1;var i=document.getElementById("c");e.shuidi_loading(i,function(e){return t.data.step.progress},function(e){t.data.step.progress&&100!==t.data.step.progress||(cancelAnimationFrame(e),t.container.find("#vm_progress").addClass("hide"),t.isloading=!0)})},clearfacus:function(){this.container.find("input").blur(),this.container.find("select").blur()},setData:function(t){var n=this;i(window).height()
|
||
;SDC.user.manage_spec&&null!=SDC.user.manage_spec&&0==SDC.user.manage_spec.allow_custom_template&&(location.href="/tlab/exptemplate"),t&&(n.service.get_config_detial({lab_template_id:t}).done(function(e){n.data.lab_template_version_list=e.lab_template_version_list}),n.vstep_id=t,n.data.vstep_id=t,layui.use("element",function(){layui.element}),n.tools_show_fun(),n.editormd_show_fun(),n.data.isloaded=!0,this.service.check_courseExp(t).done(function(t){return null==t?void(n.data.vm_status=e.vm_status.closed):t.status===e.vm_op_status.op_failed?void(n.data.vm_status=e.vm_status.closed):t.action===e.vm_status.closed?void(n.data.vm_status=e.vm_status.closed):(t.action===e.vm_status.creating&&(n.data.vm_status=e.vm_status.creating,n.data.step.progress=t.action_info.process),void(t.action_info.is_complete&&(n.data.step.protocol=t.action_info.current_res.res_conn.filter(function(e){return 1==e.default})[0].protocol,n.data.step.instance_id=t.action_info.current_res.instance_id,n.data.step.token=t.action_info.current_res.vm_token,n.data.step.ip=t.action_info.current_res.ip,n.data.step.os_username=t.action_info.current_res.os_username,n.data.step.os_password=t.action_info.current_res.os_password,n.data.step.os_type=t.action_info.current_res.os_type.toLowerCase(),n.setvm_param({token:t.action_info.current_res.vm_token,protocol:t.action_info.current_res.res_conn.filter(function(e){return 1==e.default})[0].protocol,instance_id:t.action_info.current_res.instance_id,os_type:t.action_info.current_res.os_type.toLowerCase()}),n.data.step.res_list=t.action_info.res_list,n.setTime(t.action_info.remain_time),n.data.vm_status=e.vm_status.running)))}))},refreshData:function(e){this.setData(e)},expconsoleInit:function(t){var i=this;i.container.find('button[name="create"]').addClass("disabled"),i.service.create_vmExp({lab_template_id:Number(t)}).done(function(){i.data.vm_status=e.vm_status.creating}).fail(function(t){i.container.find('button[name="create"]').removeClass("disabled"),i.data.vm_status=e.vm_status.closed})},onInitialize:function(t){var n=this;this.initialized=!0,n.service.get_detial(t).done(function(e){n.data.lab_template=e,n.data.name=e.name}).fail(function(e){n.pushError(e)}),this.DragLeftBar(),this.DragDoc(),this.DragTime();var r=i(window).height();if(n.container.find("#displayvm").height(r),n.container.find(".console-ullist").removeClass("hide"),n.container.find(".expDesktop_head_wrap").width(.9*i(window).width()),t){n.vstep_id=t;for(var o=0;o<n.data.step.fields.length;o++){var s=n.data.step.fields[o];n["field_"+s.field]=s}localStorage.getItem(SDC.user.user_id+"exp_"+n.vstep_id)||localStorage.setItem(SDC.user.user_id+"exp_"+n.vstep_id,10),n.setData(t),n.container.delegate('button[name="create"]:not(.disabled)',"click",function(){n.imgClick=!0,n.container.find('button[name="create"]').addClass("disabled"),n.data.step.progress=25,n.data.vm_status=e.vm_status.creating,n.service.create_vmExp({lab_template_id:Number(t)}).done(function(){n.data.vm_status=e.vm_status.creating}).fail(function(t){var i=JSON.parse(t.responseText);if(n.container.find('button[name="create"]').removeClass("disabled"),i.code)switch(i.code){case 50003:case 50004:case 50005:break;default:n.data.vm_status=e.vm_status.closed}n.data.vm_status=e.vm_status.closed})}),n.container.delegate(".console_bg_img img","click",function(){var r=this;n.imgClick=!0,n.data.step.progress=25,n.data.vm_status=e.vm_status.creating,n.container.find('button[name="create"]').addClass("disabled"),n.service.create_vmExp({lab_template_id:Number(t)}).done(function(){n.data.vm_status=e.vm_status.creating,n.imgClick=!1,i(r).attr({src:"/static/public/img/console_bg_img.png"})}).fail(function(t){var a=JSON.parse(t.responseText);if(n.container.find('button[name="create"]').removeClass("disabled"),n.imgClick=!1,i(r).attr({src:"/static/public/img/console_bg_img.png"}),a.code)switch(a.code){case 50003:case 50004:case 50005:break;default:n.data.vm_status=e.vm_status.closed}n.data.vm_status=e.vm_status.closed})}),n.container.delegate(".console_bg_img","mouseover",function(){n.imgClick||i(this).find("img").attr({src:"/static/public/img/console_bg_img_hover.png"})}),n.container.delegate(".console_bg_img","mouseout",function(){n.imgClick||i(this).find("img").attr({src:"/static/public/img/console_bg_img.png"})}),n.container.delegate('button[name="close"]:not(.disabled)',"click",function(){i(this).blur(),layer.confirm("直接关闭将不会保存此次配置,建议您“保存并关闭”。",{title:n.i18n.close,btn:["保存并关闭","直接关闭"]},function(t){var r=layer.confirm("<div>配置说明:<textarea style='width: 240px;height: 50px;resize: none;vertical-align: top;' name='desc'></textarea><p class='sd-expconsole-p' style='display: none;color: red;margin-left: 70px;'>配置说明不能为空</p></div>",{title:"保存模板",btn:["确定","取消"]},function(t){n.container.find("textarea[name='desc']").keyup(function(){var e=i(this).val();""==i.trim(e)?n.container.find(".sd-expconsole-p").show():n.container.find(".sd-expconsole-p").hide()});var r=n.container.find("textarea[name='desc']").val();if(""==i.trim(r))n.container.find(".sd-expconsole-p").show();else{var a={lab_template_id:n.data.lab_template.id,desc:r};layer.load(0,{shade:[.1,"#fff"]});n.vm_is_refresh(),n.service.close_vmSaveExp(a).done(function(){n.data.vm_status=e.vm_status.closed,layer.closeAll(),location.href="/tlab/exptemplate"}).fail(function(){layer.closeAll()})}},function(){layer.close(r)})},function(i){n.vm_is_refresh(),n.service.close_vmExp(t).done(function(){n.data.vm_status=e.vm_status.closed,location.href="/tlab/exptemplate"}),layer.close(i)})}),n.container.delegate('button[name="delay"]:not(.disabled)',"click",function(){if(n.data.timeout.allSecond>1800)var e=n.timeDivision(1800),t=n.timeDivision(n.data.timeout.allSecond),i="实验剩余时间 "+t+",剩余时间小于 "+e+"才可以延时",r=layer.alert(i,{title:"实验延时",closeBtn:1,icon:6},function(){layer.close(r)});else n.overtime()}),n.container.delegate('button[name="save"]:not(.disabled)',"click",function(){i(this).blur(),new a(n.language,n.appOptions,n.service,n.data.lab_template,function(e){n.data.instance_id,e.lab_template_id;layer.alert("保存成功"),location.href="/tlab/exptemplate"}).show()}),n.container.delegate('a[name="textcopy"]:not(.disabled)',"click",function(){var t=e.selectText();if(!t)return void e.msg_warning(n.i18n.noselectText);var i=n.data.vms;for(var r in i)i[r].guac_client&&i[r].guac_client.setClipboard(t)}),n.container.delegate(".document-copy","click",function(){var t=i(this).parent().text();if(!t)return void e.msg_warning(n.i18n.noselectText);var r=n.data.vms;for(var a in r)r[a].guac_client&&r[a].guac_client.setClipboard(t);layer.tips("已复制",this,{tips:1,time:1e3})}),n.container.delegate(".document-copy:not(.disabled)","mouseover",function(){n.copy_tip=layer.tips("复制内容",this,{tips:1,time:-1})}),n.container.delegate(".document-copy:not(.disabled)","mouseout",function(){n.copy_tip&&layer.close(n.copy_tip)}),n.container.delegate('button[name="refresh"]:not(.disabled)',"click",function(){i(this).blur(),n.vm_is_refresh(),n.show_vm()}),n.container.find('button[name="viewtype"]').toolbar({content:"#toolbar-viewtype",position:"bottom",style:"primary"}),n.container.find('button[name="viewtype"]').on("toolbarItemClick",function(e,t,i){i.hide()}),n.container.find("#btntoolbar").toolbar({content:"#toolbar-options",position:"bottom",style:"primary"}),n.container.find("#btntoolbar").on("toolbarItemClick",function(e,t,i){i.hide()}),n.container.find("#btntoolbar").on("toolbarShown",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.find("#btntoolbar").on("toolbarHidden",function(){i("#btntoolbar").css({left:-99999,top:0})}),n.container.delegate('button[name="fullscreen"]',"click",function(){n.data.is_fullscreen=!n.data.is_fullscreen}),n.container.delegate('button[name="scrapbooking"]',"click",function(){var t=layer.open({title:"剪切板",shade:.6,resize:!1,area:"612px",btn:["保存","取消"],id:"sd-dialog-scrapbooking",success:function(e,t){e.find("textarea[name='sd-textarea-scrapbooking']").val(n.data.scrapbooking_text||"")},btn1:function(i,r){var a=r.find("textarea[name='sd-textarea-scrapbooking']").val();if(!a)return void e.msg_warning("请输入要复制的内容");var o=n.data.vms;for(var s in o)o[s].guac_client&&o[s].guac_client.setClipboard(a);e.msg_success("复制成功"),layer.close(t)},btn2:function(){layer.close(t)},cancel:function(e,i){layer.close(t)},content:u})}),n.container.delegate('button,input[type="button"]',"click",function(){i(this).blur()}),n.container.delegate("select","change",function(){i(this).blur()})}},timeDivision:function(e){var t="",i=Math.floor(e/86400),n=Math.floor((e-86400*i)/3600),r=Math.floor((e-86400*i-3600*n)/60),a=Math.floor((e-86400*i-3600*n)%60);return i>0&&(t+=i+" 天 "),n>0&&(t+=n+" 小时 "),r>0&&(t+=r+" 分钟 "),a&&(t+=a+" 秒 "),t},overtime:function(){var t=this,i=t.timeDivision(3600),n=t.timeDivision(t.data.timeout.allSecond);layer.confirm("注意:实验剩余时间 "+n+",时间结束后实验会被删除,如需延长时间请点击“延时”按钮延时"+i+"。",{title:"实验即将结束",btn:["延时","取消"]},function(i){var n={add_time:60,step_id:t.data.vstep_id};t.service.overtime_server(n).done(function(i){t.setTime(i.remain_time),e.msg_success("延时成功")}).fail(function(e){}),layer.close(i)})},step_code:function(e){var t=this;"start"==e?(t.data.show_vm.show=!0,t.service.step_code_server(t.data.show_vm.code_data).done(function(e){t.data.show_vm.show=!1;var i=t.data.show_vm.code_data;e&&(e.file_list.forEach(function(e){e.filesize=Number(e.filesize),e.href="/step_code_download?filename="+e.filename+"&vm_protocol="+i.vm_protocol+"&vm_resid="+i.vm_resid+"&step_id="+t.vstep_id+"&type=design"}),t.data.step_code_list=e.file_list,0==t.data.step_code_list.lenght?t.data.show_vm.title="云主机暂无文件可以导出":t.data.show_vm.title="","windows"==e.os_type.toLowerCase()?t.data.show_vm.prompt='将需要下载的文件放在"C:\\updownload"目录':t.data.show_vm.prompt='将需要下载的文件放在"/home/code"目录')}).fail(function(e){t.data.show_vm.show=!1,t.data.show_vm.title="云主机暂无文件可以导出"})):"end"==e&&(t.data.show_vm.title="实验环境尚未启动,无法上传/下载文件",t.data.step_code_list="",t.data.show_vm.code_data="")},unescapeHTML:function(e){return e=""+e,e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")},onClose:function(){this.content&&this.content.destroy(),this.container.remove()},getModelLabel:function(){return"expdesktop_view"},tools_hide_fun:function(){var e=i(window).width(),t=this;"max"==t.data.toggle.editormd_show&&i(".editormd-toggle").animate({left:e-26+"px"}),i(".hide-tools").css("display","block"),i(".show-tools").css("display","none"),i(".expDesktop_tool").animate({right:"-140px"},function(){t.data.toggle.tools_show="hide"})},tools_show_fun:function(){var e=i(window).width(),t=this;"max"==t.data.toggle.editormd_show&&i(".editormd-toggle").animate({left:e-26-140+"px"}),i(".hide-tools").css("display","none"),i(".show-tools").css("display","block"),i(".expDesktop_tool").animate({right:"0"},function(){t.data.toggle.tools_show="display"})},editormd_hide_fun:function(){var e=this;e.data.toggle.editormd_show="hide",e.ishind=!0,i(".hide-editormd").css("display","block"),i(".show-editormd").css("display","none"),i(".maximize-editormd").css("display","none"),i(".expDesktop_editormd").animate({left:-e.exp_width+"px"},function(){}),i(".editormd-toggle").animate({left:0},function(){}),i(".expDesktop_editormd_box").animate({width:0},function(){e.set_vm_scale()})},editormd_show_fun:function(){var e=this;e.data.toggle.editormd_show="display",e.data.editormd.editormd_show="显示文档";var t=document.getElementsByClassName("editormd-toggle-move")[0],n=document.getElementsByClassName("editormd-toggle")[0];i(t).show(),i(n).css({top:e.dragDoc+"px"}),e.ishind=!1,i(".hide-editormd").css({display:"none"}),i(".show-editormd").css({display:"block"}),i(".maximize-editormd").css("display","block"),i(".editormd-toggle").animate({left:e.exp_width-26+"px"}),i(".expDesktop_editormd").animate({width:e.exp_width+"px",left:0},function(){}),i(".expDesktop_editormd_box").animate({width:e.exp_width+"px"},function(){e.set_vm_scale()})},editormd_maximize_fun:function(){var e=this,t=0;e.data.toggle.editormd_show="max",e.data.editormd.editormd_show="还原文档","display"==e.data.toggle.tools_show&&(t=140);var n=document.getElementsByClassName("editormd-toggle-move")[0];i(n).hide();var r=i(window).width();i(".hide-editormd").css("display","block"),i(".show-editormd").css("display","none"),i(".maximize-editormd").css("display","none"),i(".editormd-toggle").animate({left:r-26-t+"px"}),i(".editormd-toggle").css({top:e.dragDocInit+"px"}),i(".expDesktop_editormd").animate({left:0,width:r+"px"}),i(".expDesktop_editormd_box").animate({width:r+"px"},function(){})},DragLeftBar:function(){var e=this,t=document.getElementsByClassName("shuidi-left-drag")[0],n=document.getElementsByClassName("expDesktop_editormd")[0],r=document.getElementsByClassName("expDesktop_editormd_box")[0],a=document.getElementsByClassName("editormd-toggle")[0];t.onmousedown=function(o){function s(t){t.preventDefault();var r=[0,0];r=c<e.windpi.sm?[100,420]:e.windpi.sm<=c&&c<e.windpi.md?[260,480]:e.windpi.md<=c&&c<e.windpi.lg?[320,600]:[320,800],r[1]>=c&&(r[1]=c);var o=(t||window.event).clientX;o<=r[0]?o=r[0]:o>=r[1]&&(o=r[1]);var s=o-u;i(n).width(d+s+"px"),i(".expDesktop_editormd_box").css({width:d+s+"px"},function(){}),i(a).css({left:d+s-26+"px"}),e.exp_width=d+s,e.set_vm_scale()}function l(){t.releaseCapture?(t.onmousemove=null,t.onmouseup=null,t.releaseCapture()):(document.removeEventListener("mousemove",s,!0),document.removeEventListener("mouseup",l,!0))}var c=i(window).width(),u=(o||window.event).clientX,d=i(r).width();t.setCapture?(t.onmousemove=s,t.onmouseup=l,t.setCapture()):(document.addEventListener("mousemove",s,!0),document.addEventListener("mouseup",l,!0))}},DragDoc:function(){var e=this,t=document.getElementsByClassName("editormd-toggle-move")[0],n=document.getElementsByClassName("editormd-toggle")[0];t.onmousedown=function(r){function a(t){t.preventDefault();var r=(t||window.event).clientY;r<=48?r=48:r>=l-10&&(r=l-10);var a=r-c;i(n).css({top:s+a+"px"}),e.dragDoc=s+a}function o(){t.releaseCapture?(t.onmousemove=null,t.onmouseup=null,t.releaseCapture()):(document.removeEventListener("mousemove",a,!0),document.removeEventListener("mouseup",o,!0))}var s=i(n).position().top,l=i(window).height(),c=(r||window.event).clientY;t.setCapture?(t.onmousemove=a,t.onmouseup=o,t.setCapture()):(document.addEventListener("mousemove",a,!0),document.addEventListener("mouseup",o,!0))}},DragTime:function(){var e=document.getElementsByClassName("console_residue_time")[0];e.onmousedown=function(t){function n(t){t.preventDefault();var n=(t||window.event).clientX;n<=40?n=40:n>=o-60&&(n=o-60);var r=n-s;i(e).css({left:a+r+"px"})}function r(){e.releaseCapture?(e.onmousemove=null,e.onmouseup=null,e.releaseCapture()):(document.removeEventListener("mousemove",n,!0),document.removeEventListener("mouseup",r,!0))}var a=i(e).position().left,o=i(window).width();a<=0&&(a=0,i(e).css({left:"0px"})),a>=o-100&&(a=o-100,i(e).css({left:a+"px"}));var s=(t||window.event).clientX;e.setCapture?(e.onmousemove=n,e.onmouseup=r,e.setCapture()):(document.addEventListener("mousemove",n,!0),document.addEventListener("mouseup",r,!0))}},vm_is_refresh:function(){this.guac_init&&(this.guac_init.options.refresh=!0)}};return i.extend(d.prototype,t.prototype),i.extend(d.prototype,h),d}),define("modules/console/previewdoc/service",["network-utils","jquery","modules/utils/baseservice_tlab"],function(e,t,i){var n=function(e){this.dataControl=e};return n.prototype={createreport:function(t){return e.doPost("/ecos/qcec/v1/report",t)},expReportList:function(t){return e.doGet("/ecos/qcec/v1/report",t)},changeEreport:function(t,i){return e.doPut("/ecos/qcec/v1/report/"+t,i)},getCommentList:function(t){return e.doGet("/ecos/qcec_noauth/noauth/comment",t)},createComment:function(t){return e.doPost("/ecos/qcec/v1/comment",t)},getcourse:function(t,i){return e.doGet("/ecos/qcec/v1/course/"+t,i)},getTeacherInfo:function(t){return e.doGet("/ecos/qcec_noauth/noauth/user/get_provider/",{course_id:t})},createScore:function(t){return e.doPost("/ecos/qcec/v1/mark",t)},isCreateScore:function(t){return e.doGet("/ecos/qcec/v1/mark",t)},updateScore:function(t,i){return e.doPut("/ecos/qcec/v1/mark/"+t,i)},step_attachment:function(t){return e.doGet("/ecos/qcec/v1/step_attachment/",t)},step_code_server:function(t){return e.doGet("/ecos/qcec/v1/upload_file/get_files",t)},upload_file:function(t){return e.doGet("/ecos/qcec/v1/upload_file",t)},step_code_upload:function(t){return e.doPost("/step_code_upload/",t)}},t.extend(n.prototype,i.prototype),n}),define("text!modules/console/previewdoc/lang.json",[],function(){return'{\r\n "config": {\r\n "page_id": "expdesltop_view_data_page",\r\n "desktop_title":"",\r\n "current_unfold": "docmarkdown",\r\n "step_msg": "",\r\n "conTitle": {\r\n "field": "contitle"\r\n },\r\n "editormd":{\r\n "editormd_show":"editormd_show_title"\r\n },\r\n "step_attachment_list": [],\r\n "doctabs": [\r\n {\r\n "field": "docmarkdown",\r\n "active": true,\r\n "show": true,\r\n "type": "doc"\r\n },\r\n {\r\n "field": "material",\r\n "active": false,\r\n "show": true,\r\n "type": "material"\r\n }\r\n ],\r\n "vstep_id": "",\r\n "step_code_list": [],\r\n "isloaded": false,\r\n "getGroup_res_data": "",\r\n "course_evaluate": {\r\n "field": "course_evaluate",\r\n "score": 0,\r\n "isCreate": true,\r\n "comment": {\r\n "field": "comment",\r\n "value": ""\r\n },\r\n "tip": {\r\n "field": "evaluate_tip",\r\n "value": ""\r\n },\r\n "button": { "field": "send_comment" },\r\n "comment_list": [\r\n\r\n ]\r\n },\r\n "is_start":false,\r\n "course_id":0\r\n },\r\n "language": {\r\n "zh-hans": {\r\n "docmarkdown": "文档",\r\n "material": "随材",\r\n "video":"视频"\r\n }\r\n }\r\n}'}),define("modules/console/previewdoc/controller",["app-utils","modules/console/basecontroller","jquery","modules/console/previewexp/model/document/controller","modules/console/previewdoc/service","layout","text!modules/console/previewdoc/lang.json"],function(e,t,i,n,r,a,o){function s(e,t,i){this.container=e,this.language=t,this.appOptions=i,this.lang=o,this.vstep_id=null,this.step_id=null}var l={initAvalon:function(t){var i=this;t.events.changetabs=function(e,t){for(var n=0;n<i.data.doctabs.length;n++)i.data.doctabs[n].active=!1;e.active=!0,"report"==e.field||"material"==e.field&&i.get_step_attachment()},t.events.step_attachment=function(t){window.open(e.getDomain(e.domain_type.step_att)+t.api_url)},t.course_evaluate.tip.value=t.course_evaluate.tip.title.replace(/\{\d\}/g,100)},setDataControl:function(e){this.dataControl=e,this.service=new r(this.dataControl)},setData:function(t){var i=this;t&&(i.vstep_id=t,layui.use("element",function(){layui.element}),this.service.getGroup_courseStep(t).done(function(t){if(i.data.desktop_title=t.title,i.data.getGroup_res_data=t,i.data.isloaded=!0,i.step_id=t.id,i.data.course_id=t.course_id,i.container.find("#docmarkdown").empty(),i.container.find("#docmarkdown").css({height:"100%"}),"markdown"==t.doc_source){i.container.find("#docmarkdown").html('<div style="width: 100%;height: 100%;"><div style="width: 100%;height: 100%;overflow-y: auto"><div id="docmarkdown_doc"><textarea id="step_content" style="width:auto;display:none;"></textarea></div></div></div>');new n("docmarkdown_doc",{markdown:t.step_doc,image_Remote_URL:e.getDomain(e.domain_type.step)}).init()}else if("file"==t.doc_source){var r="/static/public/lib/pdfjs/web/viewer.html?file="+encodeURIComponent("/pdf_download?file_url="+i.fill_address(t));i.container.find("#docmarkdown").html('<iframe id="docmarkdown_doc" style="width: 100%;height: 100%;padding-top: 40px;box-sizing: border-box;" src="'+r+'"></iframe>')}}).fail(function(){}))},get_step_attachment:function(){var e=this,t=e.data.getGroup_res_data;e.service.step_attachment({course_id:t.course_id,step_id:t.id}).done(function(t){t.step_attachment_list.forEach(function(e){e.size=Math.floor(e.size/1024)}),e.data.step_attachment_list=t.step_attachment_list})},refreshData:function(e){this.setData(e)},onInitialize:function(e){var t=this;this.initialized=!1,e&&t.setData(e)},unescapeHTML:function(e){return e=""+e,e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,'"').replace(/'/g,"'")},onClose:function(){this.content&&this.content.destroy(),this.container.remove()},getModelLabel:function(){return"expdesktop_view_doc"},fill_address:function(e){var t="";return"pub_course"==e.c_type?t=SDC.domain.pcourse_domain+e.doc_file:"v_course"==e.c_type?t=SDC.domain.vcourse_domain+e.doc_file:"s_course"==e.c_type&&(t=SDC.domain.icourse_domain+e.doc_file),t}};return i.extend(s.prototype,t.prototype),i.extend(s.prototype,l),s}),define("modules/console/console",["jquery","modules/utils/data_controller","modules/console/assist/controller","modules/console/expdesktop/controller","modules/console/docdesktop/controller","modules/console/vrdesktop/controller","modules/console/monitor/controller","modules/console/previewexp/controller","modules/console/monitoring/controller","modules/console/expconsole/controller","modules/console/previewdoc/controller"],function(e,t,i,n,r,a,o,s,l,c,u){function d(){this.__currentKey=null,this.msgList=0,this.timmer=null}return d.prototype={initialize:function(d,h,p){this.appId=p.appId,this.language=p.language,this.dataControl=new t(this.language,p),this.wrapper=e(d);var f={assist:i,expdesktop:n,docdesktop:r,vrdesktop:a,monitor:o,previewexp:s,monitoring:l,expconsole:c,previewdoc:u},m=this;this.wrapper;for(var g in f){var v=f[g];v&&(m[g]=new v(m.wrapper,m.language,p),m[g].urlReference=g)}for(g in f)m[g].setDataControl&&m[g].setDataControl(this.dataControl);var y={};window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,t,i){y[t]=i});y.id==p.appId&&"gotoView"==y.method&&this.setCurrentPage(y.parameter)},setCurrentPage:function(t){this.wrapper.find(".sdcPage#sdccloud"+this.__currentKey).css("display","none"),this.__currentKey=t;var i=t;this.wrapper.find(".sdcPage#sdccloud"+i).css("display","block");var n=e(".lm-center-left");n.find("a.selected");n.find("i[field="+t+"]").parent().hasClass("selected")},gotoView:function(e,t){this.setCurrentPage(e),this[e]&&this[e].show(t)},onMessage:function(e){e&&this.dataControl.onMessage(e)}},d}),define("url-utils",[],function(){function e(e){try{return t.filter(function(t){return t.value.indexOf(e)>-1})[0].index}catch(e){console&&console.log&&console.log("Can not find specific app id!")}}var t=[{index:"aaf2",value:["pclass","vclass","iclass","report","comment","footprintsreport","expdetails","collection","personalinfo","idauth","signin","pclassfinish","userpanel","studyreport","clouddist","footprintscontest","contest_course"]},{index:"aaf3",value:["index","classdetails","forbidden","notfind","servererror","publicclass","aboutme","openclass","helpme","topteacher","scheme","news","newscontent","helplist","help","practical"]},{index:"aaf4",value:["assist","expdesktop","docdesktop","vrdesktop","monitor","previewexp","monitoring","expconsole","previewdoc"]},{index:"aaf5",value:["exptemplate","creattemplate","labsetting","creatsetting","coursedesign","creatcourse","tfootprintsreport","tlabvclass","tlabiclass","mystudent","expmonitor","sharecode","clonecourse","preview","clonepclasscourse","tlabsclass","pcourseapply","studentreport","studentcomment","courseedit","datasets","broadcast","teststore"]},{index:"aaf6",value:["depmanage","schoolmanage"]}];return{getAppName:function(t){function i(e){return e.length>1&&("slab"==e[0]||"tlab"==e[0]||"mlab"==e[0]||"portal"==e[0]||"console"==e[0]||"resource"==e[0])}var n;if(!t)return null;t=t.replace(/\?(.*)/,"").replace(/\#(.*)/,"");var r=t.match(/:\/\/(?:www\.)?(.[^/]+)(.*)/);if(r&&r.length>=3){if(n=r[2].split("/"),n.length>0&&""===n[0]&&n.shift(),i(n))return e(n[1])}return n=t.split("/"),n.length>0&&""===n[0]&&n.shift(),i(n)?e(n[1]):null},getPathList:function(e){e=e.replace(/\?(.*)/,"").replace(/\#(.*)/,"");var t,i=e.match(/:\/\/(?:www\.)?(.[^/]+)(.*)/);if(i&&i.length>=3){return t=i[2].split("/"),t.length>0&&""===t[0]&&t.shift(),t}return t=e.split("/"),t.length>0&&""===t[0]&&t.shift(),t}}}),function(e){"function"==typeof define&&define.amd?define("jquerycookie",["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){function t(e){return s.raw?e:encodeURIComponent(e)}function i(e){return s.raw?e:decodeURIComponent(e)}function n(e){return t(s.json?JSON.stringify(e):String(e))}function r(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(o," ")),s.json?JSON.parse(e):e}catch(e){}}function a(t,i){var n=s.raw?t:r(t);return e.isFunction(i)?i(n):n}var o=/\+/g,s=e.cookie=function(r,o,l){if(void 0!==o&&!e.isFunction(o)){if(l=e.extend({},s.defaults,l),"number"==typeof l.expires){var c=l.expires,u=l.expires=new Date;u.setTime(+u+864e5*c)}return document.cookie=[t(r),"=",n(o),l.expires?"; expires="+l.expires.toUTCString():"",l.path?"; path="+l.path:"",l.domain?"; domain="+l.domain:"",l.secure?"; secure":""].join("")}for(var d=r?void 0:{},h=document.cookie?document.cookie.split("; "):[],p=0,f=h.length;p<f;p++){var m=h[p].split("="),g=i(m.shift()),v=m.join("=");if(r&&r===g){d=a(v,o);break}r||void 0===(v=a(v))||(d[g]=v)}return d};s.defaults={},e.removeCookie=function(t,i){return void 0!==e.cookie(t)&&(e.cookie(t,"",e.extend({},i,{expires:-1})),!e.cookie(t))}}),function(){function e(t,n){function a(e,t){try{e()}catch(e){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var i=n.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==i(new d(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==i(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==i(new d(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==i(new d(-1))})}}else{var r,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var i=n.stringify,u="function"==typeof i;u&&((r=function(){return 1}).toJSON=r,a(function(){u="0"===i(0)&&"0"===i(l())&&'""'==i(c())&&i(y)===g&&i(g)===g&&i()===g&&"1"===i(r)&&"[1]"==i([r])&&"[null]"==i([g])&&"null"==i(null)&&"[null,null,null]"==i([g,y,null])&&i({a:[r,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===i(null,r)&&"[\n 1,\n 2\n]"==i([1,2],null,1)},function(){u=!1})),t=u}if("json-parse"==e){var h,p=n.parse;"function"==typeof p&&a(function(){0!==p("0")||p(!1)||(r=p(s),(h=5==r.a.length&&1===r.a[0])&&(a(function(){h=!p('"\t"')}),h&&a(function(){h=1!==p("01")}),h&&a(function(){h=1!==p("1.")})))},function(){h=!1}),t=h}}return o[e]=!!t}function s(e){return T(this)}t||(t=r.Object()),n||(n=r.Object());var l=t.Number||r.Number,c=t.String||r.String,u=t.Object||r.Object,d=t.Date||r.Date,h=t.SyntaxError||r.SyntaxError,p=t.TypeError||r.TypeError,f=t.Math||r.Math,m=t.JSON||r.JSON;"object"==typeof m&&m&&(n.stringify=m.stringify,n.parse=m.parse);var g,v=u.prototype,y=v.toString,_=v.hasOwnProperty,b=new d(-0xc782b5b800cec);if(a(function(){b=-109252==b.getUTCFullYear()&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w=o("bug-string-char-index"),x=function(e,t){var n,r,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,r=new n;for(a in r)_.call(r,a)&&o++;return n=r=null,o?x=function(e,t){var i,n,r="[object Function]"==y.call(e);for(i in e)r&&"prototype"==i||!_.call(e,i)||(n="constructor"===i)||t(i);(n||_.call(e,i="constructor"))&&t(i)}:(r=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],x=function(e,t){var n,r,a="[object Function]"==y.call(e),o=!a&&"function"!=typeof e.constructor&&i[typeof e.hasOwnProperty]&&e.hasOwnProperty||_;for(n in e)a&&"prototype"==n||!o.call(e,n)||t(n);for(r=dontEnums.length;n=dontEnums[--r];)o.call(e,n)&&t(n)}),x(e,t)};if(!o("json-stringify")&&!o("date-serialization")){var k={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},C=function(e,t){return("000000"+(t||0)).slice(-e)},T=function(e){var t,i,n,r,a,o,s,l,c;if(b)t=function(e){i=e.getUTCFullYear(),n=e.getUTCMonth(),r=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),c=e.getUTCMilliseconds()};else{var u=f.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],h=function(e,t){return d[t]+365*(e-1970)+u((e-1969+(t=+(t>1)))/4)-u((e-1901+t)/100)+u((e-1601+t)/400)};t=function(e){for(r=u(e/864e5),i=u(r/365.2425)+1970-1;h(i+1,0)<=r;i++);for(n=u((r-h(i,0))/30.42);h(i,n+1)<=r;n++);r=1+r-h(i,n),a=(e%864e5+864e5)%864e5,o=u(a/36e5)%24,s=u(a/6e4)%60,l=u(a/1e3)%60,c=a%1e3}}return(T=function(e){return e>-1/0&&e<1/0?(t(e),e=(i<=0||i>=1e4?(i<0?"-":"+")+C(6,i<0?-i:i):C(4,i))+"-"+C(2,n+1)+"-"+C(2,r)+"T"+C(2,o)+":"+C(2,s)+":"+C(2,l)+"."+C(3,c)+"Z",i=n=r=o=s=l=c=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var S=n.stringify;n.stringify=function(e,t,i){var n=d.prototype.toJSON;d.prototype.toJSON=s;var r=S(e,t,i);return d.prototype.toJSON=n,r}}else{var E=function(e){var t=e.charCodeAt(0),i=k[t];return i||"\\u00"+C(2,t.toString(16))},A=/[\x00-\x1f\x22\x5c]/g,I=function(e){return A.lastIndex=0,'"'+(A.test(e)?e.replace(A,E):e)+'"'},D=function(e,t,i,n,r,o,s){var l,c,u,h,f,m,v,_,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&"[object Date]"==y.call(l)&&l.toJSON===d.prototype.toJSON?l=T(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),i&&(l=i.call(t,e,l)),l==g)return l===g?l:"null";switch(c=typeof l,"object"==c&&(u=y.call(l)),u||c){case"boolean":case"[object Boolean]":return""+l;case"number":case"[object Number]":return l>-1/0&&l<1/0?""+l:"null";case"string":case"[object String]":return I(""+l)}if("object"==typeof l){for(v=s.length;v--;)if(s[v]===l)throw p();if(s.push(l),h=[],_=o,o+=r,"[object Array]"==u){for(m=0,v=l.length;m<v;m++)f=D(m,l,i,n,r,o,s),h.push(f===g?"null":f);b=h.length?r?"[\n"+o+h.join(",\n"+o)+"\n"+_+"]":"["+h.join(",")+"]":"[]"}else x(n||l,function(e){var t=D(e,l,i,n,r,o,s);t!==g&&h.push(I(e)+":"+(r?" ":"")+t)}),b=h.length?r?"{\n"+o+h.join(",\n"+o)+"\n"+_+"}":"{"+h.join(",")+"}":"{}";return s.pop(),b}};n.stringify=function(e,t,n){var r,a,o,s;if(i[typeof t]&&t)if("[object Function]"==(s=y.call(t)))a=t;else if("[object Array]"==s){o={};for(var l,c=0,u=t.length;c<u;)l=t[c++],"[object String]"!=(s=y.call(l))&&"[object Number]"!=s||(o[l]=1)}if(n)if("[object Number]"==(s=y.call(n))){if((n-=n%1)>0)for(n>10&&(n=10),r="";r.length<n;)r+=" "}else"[object String]"==s&&(r=n.length<=10?n:n.slice(0,10));return D("",(l={},l[""]=e,l),a,o,r,"",[])}}}if(!o("json-parse")){var M,L,O=c.fromCharCode,N={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},P=function(){throw M=L=null,h()},R=function(){for(var e,t,i,n,r,a=L,o=a.length;M<o;)switch(r=a.charCodeAt(M)){case 9:case 10:case 13:case 32:M++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=w?a.charAt(M):a[M],M++,e;case 34:for(e="@",M++;M<o;)if((r=a.charCodeAt(M))<32)P();else if(92==r)switch(r=a.charCodeAt(++M)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=N[r],M++;break;case 117:for(t=++M,i=M+4;M<i;M++)(r=a.charCodeAt(M))>=48&&r<=57||r>=97&&r<=102||r>=65&&r<=70||P();e+=O("0x"+a.slice(t,M));break;default:P()}else{if(34==r)break;for(r=a.charCodeAt(M),t=M;r>=32&&92!=r&&34!=r;)r=a.charCodeAt(++M);e+=a.slice(t,M)}if(34==a.charCodeAt(M))return M++,e;P();default:if(t=M,45==r&&(n=!0,r=a.charCodeAt(++M)),r>=48&&r<=57){for(48==r&&(r=a.charCodeAt(M+1))>=48&&r<=57&&P(),n=!1;M<o&&(r=a.charCodeAt(M))>=48&&r<=57;M++);if(46==a.charCodeAt(M)){for(i=++M;i<o&&!((r=a.charCodeAt(i))<48||r>57);i++);i==M&&P(),M=i}
|
||
if(101==(r=a.charCodeAt(M))||69==r){for(r=a.charCodeAt(++M),43!=r&&45!=r||M++,i=M;i<o&&!((r=a.charCodeAt(i))<48||r>57);i++);i==M&&P(),M=i}return+a.slice(t,M)}n&&P();var s=a.slice(M,M+4);if("true"==s)return M+=4,!0;if("fals"==s&&101==a.charCodeAt(M+4))return M+=5,!1;if("null"==s)return M+=4,null;P()}return"$"},j=function(e){var t,i;if("$"==e&&P(),"string"==typeof e){if("@"==(w?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=R());)i?","==e?"]"==(e=R())&&P():P():i=!0,","==e&&P(),t.push(j(e));return t}if("{"==e){for(t={};"}"!=(e=R());)i?","==e?"}"==(e=R())&&P():P():i=!0,","!=e&&"string"==typeof e&&"@"==(w?e.charAt(0):e[0])&&":"==R()||P(),t[e.slice(1)]=j(R());return t}P()}return e},z=function(e,t,i){var n=F(e,t,i);n===g?delete e[t]:e[t]=n},F=function(e,t,i){var n,r=e[t];if("object"==typeof r&&r)if("[object Array]"==y.call(r))for(n=r.length;n--;)z(y,x,r);else x(r,function(e){z(r,e,i)});return i.call(e,t,r)};n.parse=function(e,t){var i,n;return M=0,L=""+e,i=j(R()),"$"!=R()&&P(),M=L=null,t&&"[object Function]"==y.call(t)?F((n={},n[""]=i,n),"",t):i}}}return n.runInContext=e,n}var t="function"==typeof define&&define.amd,i={function:!0,object:!0},n=i[typeof exports]&&exports&&!exports.nodeType&&exports,r=i[typeof window]&&window||this,a=n&&i[typeof module]&&module&&!module.nodeType&&"object"==typeof global&&global;if(!a||a.global!==a&&a.window!==a&&a.self!==a||(r=a),n&&!t)e(r,n);else{var o=r.JSON,s=r.JSON3,l=!1,c=e(r,r.JSON3={noConflict:function(){return l||(l=!0,r.JSON=o,r.JSON3=s,o=s=null),c}});r.JSON={parse:c.parse,stringify:c.stringify}}t&&define("json3",[],function(){return c})}.call(this),"undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");if(function(e){"use strict";var t=e.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var i=e(this),r=i.data("bs.alert");r||i.data("bs.alert",r=new n(this)),"string"==typeof t&&r[t].call(i)})}var i='[data-dismiss="alert"]',n=function(t){e(t).on("click",i,this.close)};n.VERSION="3.3.2",n.TRANSITION_DURATION=150,n.prototype.close=function(t){function i(){o.detach().trigger("closed.bs.alert").remove()}var r=e(this),a=r.attr("data-target");a||(a=r.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,""));var o=e(a);t&&t.preventDefault(),o.length||(o=r.closest(".alert")),o.trigger(t=e.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),e.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",i).emulateTransitionEnd(n.TRANSITION_DURATION):i())};var r=e.fn.alert;e.fn.alert=t,e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.bs.alert.data-api",i,n.prototype.close)}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var n=e(this),r=n.data("bs.button"),a="object"==typeof t&&t;r||n.data("bs.button",r=new i(this,a)),"toggle"==t?r.toggle():t&&r.setState(t)})}var i=function(t,n){this.$element=e(t),this.options=e.extend({},i.DEFAULTS,n),this.isLoading=!1};i.VERSION="3.3.2",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(t){var i="disabled",n=this.$element,r=n.is("input")?"val":"html",a=n.data();t+="Text",null==a.resetText&&n.data("resetText",n[r]()),setTimeout(e.proxy(function(){n[r](null==a[t]?this.options[t]:a[t]),"loadingText"==t?(this.isLoading=!0,n.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,n.removeClass(i).removeAttr(i))},this),0)},i.prototype.toggle=function(){var e=!0,t=this.$element.closest('[data-toggle="buttons"]');if(t.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?e=!1:t.find(".active").removeClass("active")),e&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));e&&this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=t,e.fn.button.Constructor=i,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var n=e(i.target);n.hasClass("btn")||(n=n.closest(".btn")),t.call(n,"toggle"),i.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){e(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var n=e(this),r=n.data("bs.carousel"),a=e.extend({},i.DEFAULTS,n.data(),"object"==typeof t&&t),o="string"==typeof t?t:a.slide;r||n.data("bs.carousel",r=new i(this,a)),"number"==typeof t?r.to(t):o?r[o]():a.interval&&r.pause().cycle()})}var i=function(t,i){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",e.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",e.proxy(this.pause,this)).on("mouseleave.bs.carousel",e.proxy(this.cycle,this))};i.VERSION="3.3.2",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(e){if(!/input|textarea/i.test(e.target.tagName)){switch(e.which){case 37:this.prev();break;case 39:this.next();break;default:return}e.preventDefault()}},i.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(e){return this.$items=e.parent().children(".item"),this.$items.index(e||this.$active)},i.prototype.getItemForDirection=function(e,t){var i=this.getItemIndex(t);if(("prev"==e&&0===i||"next"==e&&i==this.$items.length-1)&&!this.options.wrap)return t;var n="prev"==e?-1:1,r=(i+n)%this.$items.length;return this.$items.eq(r)},i.prototype.to=function(e){var t=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){t.to(e)}):i==e?this.pause().cycle():this.slide(e>i?"next":"prev",this.$items.eq(e))},i.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){if(!this.sliding)return this.slide("next")},i.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},i.prototype.slide=function(t,n){var r=this.$element.find(".item.active"),a=n||this.getItemForDirection(t,r),o=this.interval,s="next"==t?"left":"right",l=this;if(a.hasClass("active"))return this.sliding=!1;var c=a[0],u=e.Event("slide.bs.carousel",{relatedTarget:c,direction:s});if(this.$element.trigger(u),!u.isDefaultPrevented()){if(this.sliding=!0,o&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=e(this.$indicators.children()[this.getItemIndex(a)]);d&&d.addClass("active")}var h=e.Event("slid.bs.carousel",{relatedTarget:c,direction:s});return e.support.transition&&this.$element.hasClass("slide")?(a.addClass(t),a[0].offsetWidth,r.addClass(s),a.addClass(s),r.one("bsTransitionEnd",function(){a.removeClass([t,s].join(" ")).addClass("active"),r.removeClass(["active",s].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(h)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(r.removeClass("active"),a.addClass("active"),this.sliding=!1,this.$element.trigger(h)),o&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=t,e.fn.carousel.Constructor=i,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this};var r=function(i){var n,r=e(this),a=e(r.attr("data-target")||(n=r.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""));if(a.hasClass("carousel")){var o=e.extend({},a.data(),r.data()),s=r.attr("data-slide-to");s&&(o.interval=!1),t.call(a,o),s&&a.data("bs.carousel").to(s),i.preventDefault()}};e(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r),e(window).on("load",function(){e('[data-ride="carousel"]').each(function(){var i=e(this);t.call(i,i.data())})})}(jQuery),function(e){"use strict";function t(t){t&&3===t.which||(e(r).remove(),e(a).each(function(){var n=e(this),r=i(n),a={relatedTarget:this};r.hasClass("open")&&(r.trigger(t=e.Event("hide.bs.dropdown",a)),t.isDefaultPrevented()||(n.attr("aria-expanded","false"),r.removeClass("open").trigger("hidden.bs.dropdown",a)))}))}function i(t){var i=t.attr("data-target");i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var n=i&&e(i);return n&&n.length?n:t.parent()}function n(t){return this.each(function(){var i=e(this),n=i.data("bs.dropdown");n||i.data("bs.dropdown",n=new o(this)),"string"==typeof t&&n[t].call(i)})}var r=".dropdown-backdrop",a='[data-toggle="dropdown"]',o=function(t){e(t).on("click.bs.dropdown",this.toggle)};o.VERSION="3.3.2",o.prototype.toggle=function(n){var r=e(this);if(!r.is(".disabled, :disabled")){var a=i(r),o=a.hasClass("open");if(t(),!o){"ontouchstart"in document.documentElement&&!a.closest(".navbar-nav").length&&e('<div class="dropdown-backdrop"/>').insertAfter(e(this)).on("click",t);var s={relatedTarget:this};if(a.trigger(n=e.Event("show.bs.dropdown",s)),n.isDefaultPrevented())return;r.trigger("focus").attr("aria-expanded","true"),a.toggleClass("open").trigger("shown.bs.dropdown",s)}return!1}},o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var n=e(this);if(t.preventDefault(),t.stopPropagation(),!n.is(".disabled, :disabled")){var r=i(n),o=r.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&r.find(a).trigger("focus"),n.trigger("click");var s=" li:not(.divider):visible a",l=r.find('[role="menu"]'+s+', [role="listbox"]'+s);if(l.length){var c=l.index(t.target);38==t.which&&c>0&&c--,40==t.which&&c<l.length-1&&c++,~c||(c=0),l.eq(c).trigger("focus")}}}};var s=e.fn.dropdown;e.fn.dropdown=n,e.fn.dropdown.Constructor=o,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.bs.dropdown.data-api",t).on("click.bs.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.bs.dropdown.data-api",a,o.prototype.toggle).on("keydown.bs.dropdown.data-api",a,o.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="menu"]',o.prototype.keydown).on("keydown.bs.dropdown.data-api",'[role="listbox"]',o.prototype.keydown)}(jQuery),function(e){"use strict";function t(t,n){return this.each(function(){var r=e(this),a=r.data("bs.modal"),o=e.extend({},i.DEFAULTS,r.data(),"object"==typeof t&&t);a||r.data("bs.modal",a=new i(this,o)),"string"==typeof t?a[t](n):o.show&&a.show(n)})}var i=function(t,i){this.options=i,this.$body=e(document.body),this.$element=e(t),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,e.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};i.VERSION="3.3.2",i.TRANSITION_DURATION=300,i.BACKDROP_TRANSITION_DURATION=150,i.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},i.prototype.toggle=function(e){return this.isShown?this.hide():this.show(e)},i.prototype.show=function(t){var n=this,r=e.Event("show.bs.modal",{relatedTarget:t});this.$element.trigger(r),this.isShown||r.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',e.proxy(this.hide,this)),this.backdrop(function(){var r=e.support.transition&&n.$element.hasClass("fade");n.$element.parent().length||n.$element.appendTo(n.$body),n.$element.show().scrollTop(0),n.options.backdrop&&n.adjustBackdrop(),n.adjustDialog(),r&&n.$element[0].offsetWidth,n.$element.addClass("in").attr("aria-hidden",!1),n.enforceFocus();var a=e.Event("shown.bs.modal",{relatedTarget:t});r?n.$element.find(".modal-dialog").one("bsTransitionEnd",function(){n.$element.trigger("focus").trigger(a)}).emulateTransitionEnd(i.TRANSITION_DURATION):n.$element.trigger("focus").trigger(a)}))},i.prototype.hide=function(t){t&&t.preventDefault(),t=e.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),e(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),e.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",e.proxy(this.hideModal,this)).emulateTransitionEnd(i.TRANSITION_DURATION):this.hideModal())},i.prototype.enforceFocus=function(){e(document).off("focusin.bs.modal").on("focusin.bs.modal",e.proxy(function(e){this.$element[0]===e.target||this.$element.has(e.target).length||this.$element.trigger("focus")},this))},i.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",e.proxy(function(e){27==e.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},i.prototype.resize=function(){this.isShown?e(window).on("resize.bs.modal",e.proxy(this.handleUpdate,this)):e(window).off("resize.bs.modal")},i.prototype.hideModal=function(){var e=this;this.$element.hide(),this.backdrop(function(){e.$body.removeClass("modal-open"),e.resetAdjustments(),e.resetScrollbar(),e.$element.trigger("hidden.bs.modal")})},i.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},i.prototype.backdrop=function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var a=e.support.transition&&r;if(this.$backdrop=e('<div class="modal-backdrop '+r+'" />').prependTo(this.$element).on("click.dismiss.bs.modal",e.proxy(function(e){e.target===e.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),a&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;a?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var o=function(){n.removeBackdrop(),t&&t()};e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",o).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):o()}else t&&t()},i.prototype.handleUpdate=function(){this.options.backdrop&&this.adjustBackdrop(),this.adjustDialog()},i.prototype.adjustBackdrop=function(){this.$backdrop.css("height",0).css("height",this.$element[0].scrollHeight)},i.prototype.adjustDialog=function(){var e=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&e?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!e?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){this.bodyIsOverflowing=document.body.scrollHeight>document.documentElement.clientHeight,this.scrollbarWidth=this.measureScrollbar()},i.prototype.setScrollbar=function(){var e=parseInt(this.$body.css("padding-right")||0,10);this.bodyIsOverflowing&&this.$body.css("padding-right",e+this.scrollbarWidth)},i.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},i.prototype.measureScrollbar=function(){var e=document.createElement("div");e.className="modal-scrollbar-measure",this.$body.append(e);var t=e.offsetWidth-e.clientWidth;return this.$body[0].removeChild(e),t};var n=e.fn.modal;e.fn.modal=t,e.fn.modal.Constructor=i,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(i){var n=e(this),r=n.attr("href"),a=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),o=a.data("bs.modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},a.data(),n.data());n.is("a")&&i.preventDefault(),a.one("show.bs.modal",function(e){e.isDefaultPrevented()||a.one("hidden.bs.modal",function(){n.is(":visible")&&n.trigger("focus")})}),t.call(a,o,this)})}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var n=e(this),r=n.data("bs.tooltip"),a="object"==typeof t&&t;(r||"destroy"!=t)&&(r||n.data("bs.tooltip",r=new i(this,a)),"string"==typeof t&&r[t]())})}var i=function(e,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",e,t)};i.VERSION="3.3.2",i.TRANSITION_DURATION=150,i.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(t,i,n){this.enabled=!0,this.type=t,this.$element=e(i),this.options=this.getOptions(n),this.$viewport=this.options.viewport&&e(this.options.viewport.selector||this.options.viewport);for(var r=this.options.trigger.split(" "),a=r.length;a--;){var o=r[a];if("click"==o)this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this));else if("manual"!=o){var s="hover"==o?"mouseenter":"focusin",l="hover"==o?"mouseleave":"focusout";this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,e.proxy(this.leave,this))}}this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(t){return t=e.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t},i.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&e.each(this._options,function(e,n){i[e]!=n&&(t[e]=n)}),t},i.prototype.enter=function(t){var i=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);return i&&i.$tip&&i.$tip.is(":visible")?void(i.hoverState="in"):(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.leave=function(t){var i=t instanceof this.constructor?t:e(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)},i.prototype.show=function(){var t=e.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var n=e.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!n)return;var r=this,a=this.tip(),o=this.getUID(this.type);this.setContent(),a.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&a.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,c=l.test(s);c&&(s=s.replace(l,"")||"top"),a.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?a.appendTo(this.options.container):a.insertAfter(this.$element);var u=this.getPosition(),d=a[0].offsetWidth,h=a[0].offsetHeight;if(c){var p=s,f=this.options.container?e(this.options.container):this.$element.parent(),m=this.getPosition(f);s="bottom"==s&&u.bottom+h>m.bottom?"top":"top"==s&&u.top-h<m.top?"bottom":"right"==s&&u.right+d>m.width?"left":"left"==s&&u.left-d<m.left?"right":s,a.removeClass(p).addClass(s)}var g=this.getCalculatedOffset(s,u,d,h);this.applyPlacement(g,s);var v=function(){var e=r.hoverState;r.$element.trigger("shown.bs."+r.type),r.hoverState=null,"out"==e&&r.leave(r)};e.support.transition&&this.$tip.hasClass("fade")?a.one("bsTransitionEnd",v).emulateTransitionEnd(i.TRANSITION_DURATION):v()}},i.prototype.applyPlacement=function(t,i){var n=this.tip(),r=n[0].offsetWidth,a=n[0].offsetHeight,o=parseInt(n.css("margin-top"),10),s=parseInt(n.css("margin-left"),10);isNaN(o)&&(o=0),isNaN(s)&&(s=0),t.top=t.top+o,t.left=t.left+s,e.offset.setOffset(n[0],e.extend({using:function(e){n.css({top:Math.round(e.top),left:Math.round(e.left)})}},t),0),n.addClass("in");var l=n[0].offsetWidth,c=n[0].offsetHeight;"top"==i&&c!=a&&(t.top=t.top+a-c);var u=this.getViewportAdjustedDelta(i,t,l,c);u.left?t.left+=u.left:t.top+=u.top;var d=/top|bottom/.test(i),h=d?2*u.left-r+l:2*u.top-a+c,p=d?"offsetWidth":"offsetHeight";n.offset(t),this.replaceArrow(h,n[0][p],d)},i.prototype.replaceArrow=function(e,t,i){this.arrow().css(i?"left":"top",50*(1-e/t)+"%").css(i?"top":"left","")},i.prototype.setContent=function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},i.prototype.hide=function(t){function n(){"in"!=r.hoverState&&a.detach(),r.$element.removeAttr("aria-describedby").trigger("hidden.bs."+r.type),t&&t()}var r=this,a=this.tip(),o=e.Event("hide.bs."+this.type);if(this.$element.trigger(o),!o.isDefaultPrevented())return a.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?a.one("bsTransitionEnd",n).emulateTransitionEnd(i.TRANSITION_DURATION):n(),this.hoverState=null,this},i.prototype.fixTitle=function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("data-original-title"))&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},i.prototype.hasContent=function(){return this.getTitle()},i.prototype.getPosition=function(t){t=t||this.$element;var i=t[0],n="BODY"==i.tagName,r=i.getBoundingClientRect();null==r.width&&(r=e.extend({},r,{width:r.right-r.left,height:r.bottom-r.top}));var a=n?{top:0,left:0}:t.offset(),o={scroll:n?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},s=n?{width:e(window).width(),height:e(window).height()}:null;return e.extend({},r,o,s,a)},i.prototype.getCalculatedOffset=function(e,t,i,n){return"bottom"==e?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==e?{top:t.top-n,left:t.left+t.width/2-i/2}:"left"==e?{top:t.top+t.height/2-n/2,left:t.left-i}:{top:t.top+t.height/2-n/2,left:t.left+t.width}},i.prototype.getViewportAdjustedDelta=function(e,t,i,n){var r={top:0,left:0};if(!this.$viewport)return r;var a=this.options.viewport&&this.options.viewport.padding||0,o=this.getPosition(this.$viewport);if(/right|left/.test(e)){var s=t.top-a-o.scroll,l=t.top+a-o.scroll+n;s<o.top?r.top=o.top-s:l>o.top+o.height&&(r.top=o.top+o.height-l)}else{var c=t.left-a,u=t.left+a+i;c<o.left?r.left=o.left-c:u>o.width&&(r.left=o.left+o.width-u)}return r},i.prototype.getTitle=function(){var e=this.$element,t=this.options;return e.attr("data-original-title")||("function"==typeof t.title?t.title.call(e[0]):t.title)},i.prototype.getUID=function(e){do{e+=~~(1e6*Math.random())}while(document.getElementById(e));return e},i.prototype.tip=function(){return this.$tip=this.$tip||e(this.options.template)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(t){var i=this;t&&((i=e(t.currentTarget).data("bs."+this.type))||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),e(t.currentTarget).data("bs."+this.type,i))),i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){var e=this;clearTimeout(this.timeout),this.hide(function(){e.$element.off("."+e.type).removeData("bs."+e.type)})};var n=e.fn.tooltip;e.fn.tooltip=t,e.fn.tooltip.Constructor=i,e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var n=e(this),r=n.data("bs.popover"),a="object"==typeof t&&t;(r||"destroy"!=t)&&(r||n.data("bs.popover",r=new i(this,a)),"string"==typeof t&&r[t]())})}var i=function(e,t){this.init("popover",e,t)};if(!e.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.2",i.DEFAULTS=e.extend({},e.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),i.prototype=e.extend({},e.fn.tooltip.Constructor.prototype),i.prototype.constructor=i,i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var e=this.tip(),t=this.getTitle(),i=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),e.removeClass("fade top bottom left right in"),e.find(".popover-title").html()||e.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var e=this.$element,t=this.options;return e.attr("data-content")||("function"==typeof t.content?t.content.call(e[0]):t.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},i.prototype.tip=function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip};var n=e.fn.popover;e.fn.popover=t,e.fn.popover.Constructor=i,e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var n=e(this),r=n.data("bs.tab");r||n.data("bs.tab",r=new i(this)),"string"==typeof t&&r[t]()})}var i=function(t){this.element=e(t)};i.VERSION="3.3.2",i.TRANSITION_DURATION=150,i.prototype.show=function(){var t=this.element,i=t.closest("ul:not(.dropdown-menu)"),n=t.data("target");if(n||(n=t.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=i.find(".active:last a"),a=e.Event("hide.bs.tab",{relatedTarget:t[0]}),o=e.Event("show.bs.tab",{relatedTarget:r[0]});if(r.trigger(a),t.trigger(o),!o.isDefaultPrevented()&&!a.isDefaultPrevented()){var s=e(n);this.activate(t.closest("li"),i),this.activate(s,s.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})})}}},i.prototype.activate=function(t,n,r){function a(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),r&&r()}var o=n.find("> .active"),s=r&&e.support.transition&&(o.length&&o.hasClass("fade")||!!n.find("> .fade").length);o.length&&s?o.one("bsTransitionEnd",a).emulateTransitionEnd(i.TRANSITION_DURATION):a(),o.removeClass("in")};var n=e.fn.tab;e.fn.tab=t,e.fn.tab.Constructor=i,e.fn.tab.noConflict=function(){return e.fn.tab=n,this};var r=function(i){i.preventDefault(),t.call(e(this),"show")};e(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',r).on("click.bs.tab.data-api",'[data-toggle="pill"]',r)}(jQuery),function(e){"use strict";function t(t){return this.each(function(){var n=e(this),r=n.data("bs.affix"),a="object"==typeof t&&t;r||n.data("bs.affix",r=new i(this,a)),"string"==typeof t&&r[t]()})}var i=function(t,n){this.options=e.extend({},i.DEFAULTS,n),this.$target=e(this.options.target).on("scroll.bs.affix.data-api",e.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",e.proxy(this.checkPositionWithEventLoop,this)),this.$element=e(t),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.2",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window},i.prototype.getState=function(e,t,i,n){var r=this.$target.scrollTop(),a=this.$element.offset(),o=this.$target.height();if(null!=i&&"top"==this.affixed)return r<i&&"top";if("bottom"==this.affixed)return null!=i?!(r+this.unpin<=a.top)&&"bottom":!(r+o<=e-n)&&"bottom";var s=null==this.affixed,l=s?r:a.top,c=s?o:t;return null!=i&&r<=i?"top":null!=n&&l+c>=e-n&&"bottom"},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var e=this.$target.scrollTop(),t=this.$element.offset();return this.pinnedOffset=t.top-e},i.prototype.checkPositionWithEventLoop=function(){setTimeout(e.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),n=this.options.offset,r=n.top,a=n.bottom,o=e("body").height();"object"!=typeof n&&(a=r=n),"function"==typeof r&&(r=n.top(this.$element)),"function"==typeof a&&(a=n.bottom(this.$element));var s=this.getState(o,t,r,a);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var l="affix"+(s?"-"+s:""),c=e.Event(l+".bs.affix");if(this.$element.trigger(c),c.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:o-t-a})}};var n=e.fn.affix;e.fn.affix=t,e.fn.affix.Constructor=i,e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var i=e(this),n=i.data();n.offset=n.offset||{},null!=n.offsetBottom&&(n.offset.bottom=n.offsetBottom),null!=n.offsetTop&&(n.offset.top=n.offsetTop),t.call(i,n)})})}(jQuery),function(e){"use strict";function t(t){var i,n=t.attr("data-target")||(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return e(n)}function i(t){return this.each(function(){var i=e(this),r=i.data("bs.collapse"),a=e.extend({},n.DEFAULTS,i.data(),"object"==typeof t&&t);!r&&a.toggle&&"show"==t&&(a.toggle=!1),r||i.data("bs.collapse",r=new n(this,a)),"string"==typeof t&&r[t]()})}var n=function(t,i){this.$element=e(t),this.options=e.extend({},n.DEFAULTS,i),this.$trigger=e(this.options.trigger).filter('[href="#'+t.id+'"], [data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};n.VERSION="3.3.2",n.TRANSITION_DURATION=350,n.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},n.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(r&&r.length&&(t=r.data("bs.collapse"))&&t.transitioning)){var a=e.Event("show.bs.collapse");if(this.$element.trigger(a),!a.isDefaultPrevented()){r&&r.length&&(i.call(r,"hide"),t||r.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!e.support.transition)return s.call(this)
|
||
;var l=e.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",e.proxy(s,this)).emulateTransitionEnd(n.TRANSITION_DURATION)[o](this.$element[0][l])}}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=e.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var r=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!e.support.transition)return r.call(this);this.$element[i](0).one("bsTransitionEnd",e.proxy(r,this)).emulateTransitionEnd(n.TRANSITION_DURATION)}}},n.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},n.prototype.getParent=function(){return e(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(e.proxy(function(i,n){var r=e(n);this.addAriaAndCollapsedClass(t(r),r)},this)).end()},n.prototype.addAriaAndCollapsedClass=function(e,t){var i=e.hasClass("in");e.attr("aria-expanded",i),t.toggleClass("collapsed",!i).attr("aria-expanded",i)};var r=e.fn.collapse;e.fn.collapse=i,e.fn.collapse.Constructor=n,e.fn.collapse.noConflict=function(){return e.fn.collapse=r,this},e(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(n){var r=e(this);r.attr("data-target")||n.preventDefault();var a=t(r),o=a.data("bs.collapse"),s=o?"toggle":e.extend({},r.data(),{trigger:this});i.call(a,s)})}(jQuery),function(e){"use strict";function t(i,n){var r=e.proxy(this.process,this);this.$body=e("body"),this.$scrollElement=e(e(i).is("body")?window:i),this.options=e.extend({},t.DEFAULTS,n),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",r),this.refresh(),this.process()}function i(i){return this.each(function(){var n=e(this),r=n.data("bs.scrollspy"),a="object"==typeof i&&i;r||n.data("bs.scrollspy",r=new t(this,a)),"string"==typeof i&&r[i]()})}t.VERSION="3.3.2",t.DEFAULTS={offset:10},t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},t.prototype.refresh=function(){var t="offset",i=0;e.isWindow(this.$scrollElement[0])||(t="position",i=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var n=this;this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),a=/^#./.test(r)&&e(r);return a&&a.length&&a.is(":visible")&&[[a[t]().top+i,r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){n.offsets.push(this[0]),n.targets.push(this[1])})},t.prototype.process=function(){var e,t=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),n=this.options.offset+i-this.$scrollElement.height(),r=this.offsets,a=this.targets,o=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),t>=n)return o!=(e=a[a.length-1])&&this.activate(e);if(o&&t<r[0])return this.activeTarget=null,this.clear();for(e=r.length;e--;)o!=a[e]&&t>=r[e]&&(!r[e+1]||t<=r[e+1])&&this.activate(a[e])},t.prototype.activate=function(t){this.activeTarget=t,this.clear();var i=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(i).parents("li").addClass("active");n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate.bs.scrollspy")},t.prototype.clear=function(){e(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var n=e.fn.scrollspy;e.fn.scrollspy=i,e.fn.scrollspy.Constructor=t,e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load.bs.scrollspy.data-api",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);i.call(t,t.data())})})}(jQuery),function(e){"use strict";function t(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in t)if(void 0!==e.style[i])return{end:t[i]};return!1}e.fn.emulateTransitionEnd=function(t){var i=!1,n=this;e(this).one("bsTransitionEnd",function(){i=!0});var r=function(){i||e(n).trigger(e.support.transition.end)};return setTimeout(r,t),this},e(function(){e.support.transition=t(),e.support.transition&&(e.event.special.bsTransitionEnd={bindType:e.support.transition.end,delegateType:e.support.transition.end,handle:function(t){if(e(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),define("bootstrap",["jquery"],function(){}),"undefined"==typeof jQuery)throw new Error("BootstrapValidator requires jQuery");!function(e){var t=e.fn.jquery.split(" ")[0].split(".");if(+t[0]<2&&+t[1]<9||1==+t[0]&&9==+t[1]&&+t[2]<1)throw new Error("BootstrapValidator requires jQuery version 1.9.1 or higher")}(window.jQuery),function(e){var t=function(t,i){this.$form=e(t),this.options=e.extend({},e.fn.bootstrapValidator.DEFAULT_OPTIONS,i),this.$invalidFields=e([]),this.$submitButton=null,this.$hiddenButton=null,this.STATUS_NOT_VALIDATED="NOT_VALIDATED",this.STATUS_VALIDATING="VALIDATING",this.STATUS_INVALID="INVALID",this.STATUS_VALID="VALID";var n=function(){for(var e=3,t=document.createElement("div"),i=t.all||[];t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><br><![endif]--\x3e",i[0];);return e>4?e:!e}(),r=document.createElement("div");this._changeEvent=9!==n&&"oninput"in r?"input":"keyup",this._submitIfValid=null,this._cacheFields={},this._init()};t.prototype={constructor:t,_init:function(){var t=this,i={autoFocus:this.$form.attr("data-bv-autofocus"),container:this.$form.attr("data-bv-container"),events:{formInit:this.$form.attr("data-bv-events-form-init"),formError:this.$form.attr("data-bv-events-form-error"),formSuccess:this.$form.attr("data-bv-events-form-success"),fieldAdded:this.$form.attr("data-bv-events-field-added"),fieldRemoved:this.$form.attr("data-bv-events-field-removed"),fieldInit:this.$form.attr("data-bv-events-field-init"),fieldError:this.$form.attr("data-bv-events-field-error"),fieldSuccess:this.$form.attr("data-bv-events-field-success"),fieldStatus:this.$form.attr("data-bv-events-field-status"),validatorError:this.$form.attr("data-bv-events-validator-error"),validatorSuccess:this.$form.attr("data-bv-events-validator-success")},excluded:this.$form.attr("data-bv-excluded"),feedbackIcons:{valid:this.$form.attr("data-bv-feedbackicons-valid"),invalid:this.$form.attr("data-bv-feedbackicons-invalid"),validating:this.$form.attr("data-bv-feedbackicons-validating")},group:this.$form.attr("data-bv-group"),live:this.$form.attr("data-bv-live"),message:this.$form.attr("data-bv-message"),onError:this.$form.attr("data-bv-onerror"),onSuccess:this.$form.attr("data-bv-onsuccess"),submitButtons:this.$form.attr("data-bv-submitbuttons"),threshold:this.$form.attr("data-bv-threshold"),trigger:this.$form.attr("data-bv-trigger"),verbose:this.$form.attr("data-bv-verbose"),fields:{}};this.$form.attr("novalidate","novalidate").addClass(this.options.elementClass).on("submit.bv",function(e){e.preventDefault(),t.validate()}).on("click.bv",this.options.submitButtons,function(){t.$submitButton=e(this),t._submitIfValid=!0}).find("[name], [data-bv-field]").each(function(){var n=e(this),r=n.attr("name")||n.attr("data-bv-field"),a=t._parseOptions(n);a&&(n.attr("data-bv-field",r),i.fields[r]=e.extend({},a,i.fields[r]))}),this.options=e.extend(!0,this.options,i),this.$hiddenButton=e("<button/>").attr("type","submit").prependTo(this.$form).addClass("bv-hidden-submit").css({display:"none",width:0,height:0}),this.$form.on("click.bv",'[type="submit"]',function(i){if(!i.isDefaultPrevented()){var n=e(i.target),r=n.is('[type="submit"]')?n.eq(0):n.parent('[type="submit"]').eq(0);!t.options.submitButtons||r.is(t.options.submitButtons)||r.is(t.$hiddenButton)||t.$form.off("submit.bv").submit()}});for(var n in this.options.fields)this._initField(n);this.$form.trigger(e.Event(this.options.events.formInit),{bv:this,options:this.options}),this.options.onSuccess&&this.$form.on(this.options.events.formSuccess,function(i){e.fn.bootstrapValidator.helpers.call(t.options.onSuccess,[i])}),this.options.onError&&this.$form.on(this.options.events.formError,function(i){e.fn.bootstrapValidator.helpers.call(t.options.onError,[i])})},_parseOptions:function(t){var i,n,r,a,o,s,l,c,u,d=t.attr("name")||t.attr("data-bv-field"),h={};for(n in e.fn.bootstrapValidator.validators)if(i=e.fn.bootstrapValidator.validators[n],r="data-bv-"+n.toLowerCase(),a=t.attr(r)+"",(u="function"==typeof i.enableByHtml5?i.enableByHtml5(t):null)&&"false"!==a||!0!==u&&(""===a||"true"===a||r===a.toLowerCase())){i.html5Attributes=e.extend({},{message:"message",onerror:"onError",onsuccess:"onSuccess"},i.html5Attributes),h[n]=e.extend({},!0===u?{}:u,h[n]);for(c in i.html5Attributes)o=i.html5Attributes[c],s="data-bv-"+n.toLowerCase()+"-"+c,l=t.attr(s),l&&("true"===l||s===l.toLowerCase()?l=!0:"false"===l&&(l=!1),h[n][o]=l)}var p={autoFocus:t.attr("data-bv-autofocus"),container:t.attr("data-bv-container"),excluded:t.attr("data-bv-excluded"),feedbackIcons:t.attr("data-bv-feedbackicons"),group:t.attr("data-bv-group"),message:t.attr("data-bv-message"),onError:t.attr("data-bv-onerror"),onStatus:t.attr("data-bv-onstatus"),onSuccess:t.attr("data-bv-onsuccess"),selector:t.attr("data-bv-selector"),threshold:t.attr("data-bv-threshold"),trigger:t.attr("data-bv-trigger"),verbose:t.attr("data-bv-verbose"),validators:h},f=e.isEmptyObject(p);return!e.isEmptyObject(h)||!f&&this.options.fields&&this.options.fields[d]?(p.validators=h,p):null},_initField:function(t){var i=e([]);switch(typeof t){case"object":i=t,t=t.attr("data-bv-field");break;case"string":i=this.getFieldElements(t),i.attr("data-bv-field",t)}if(0!==i.length&&null!==this.options.fields[t]&&null!==this.options.fields[t].validators){var n;for(n in this.options.fields[t].validators)e.fn.bootstrapValidator.validators[n]||delete this.options.fields[t].validators[n];null===this.options.fields[t].enabled&&(this.options.fields[t].enabled=!0);for(var r=this,a=i.length,o=i.attr("type"),s=1===a||"radio"===o||"checkbox"===o,l="radio"===o||"checkbox"===o||"file"===o||"SELECT"===i.eq(0).get(0).tagName?"change":this._changeEvent,c=(this.options.fields[t].trigger||this.options.trigger||l).split(" "),u=e.map(c,function(e){return e+".update.bv"}).join(" "),d=0;d<a;d++){var h=i.eq(d),p=this.options.fields[t].group||this.options.group,f=h.parents(p),m="function"==typeof(this.options.fields[t].container||this.options.container)?(this.options.fields[t].container||this.options.container).call(this,h,this):this.options.fields[t].container||this.options.container,g=m&&"tooltip"!==m&&"popover"!==m?e(m):this._getMessageContainer(h,p);m&&"tooltip"!==m&&"popover"!==m&&g.addClass("has-error"),g.find('.help-block[data-bv-validator][data-bv-for="'+t+'"]').remove(),f.find('i[data-bv-icon-for="'+t+'"]').remove(),h.off(u).on(u,function(){r.updateStatus(e(this),r.STATUS_NOT_VALIDATED)}),h.data("bv.messages",g);for(n in this.options.fields[t].validators)h.data("bv.result."+n,this.STATUS_NOT_VALIDATED),s&&d!==a-1||e("<small/>").css("display","none").addClass("help-block").attr("data-bv-validator",n).attr("data-bv-for",t).attr("data-bv-result",this.STATUS_NOT_VALIDATED).html(this._getMessage(t,n)).appendTo(g),"function"==typeof e.fn.bootstrapValidator.validators[n].init&&e.fn.bootstrapValidator.validators[n].init(this,h,this.options.fields[t].validators[n]);if(!1!==this.options.fields[t].feedbackIcons&&"false"!==this.options.fields[t].feedbackIcons&&this.options.feedbackIcons&&this.options.feedbackIcons.validating&&this.options.feedbackIcons.invalid&&this.options.feedbackIcons.valid&&(!s||d===a-1)){f.addClass("has-feedback");var v=e("<i/>").css("display","none").addClass("form-control-feedback").attr("data-bv-icon-for",t).insertAfter(h);if("checkbox"===o||"radio"===o){var y=h.parent();y.hasClass(o)?v.insertAfter(y):y.parent().hasClass(o)&&v.insertAfter(y.parent())}0===f.find("label").length&&v.addClass("bv-no-label"),0!==f.find(".input-group").length&&v.addClass("bv-icon-input-group").insertAfter(f.find(".input-group").eq(0)),s?d===a-1&&i.data("bv.icon",v):h.data("bv.icon",v),m&&h.off("focus.container.bv").on("focus.container.bv",function(){switch(m){case"tooltip":e(this).data("bv.icon").tooltip("show");break;case"popover":e(this).data("bv.icon").popover("show")}}).off("blur.container.bv").on("blur.container.bv",function(){switch(m){case"tooltip":e(this).data("bv.icon").tooltip("hide");break;case"popover":e(this).data("bv.icon").popover("hide")}})}}switch(i.on(this.options.events.fieldSuccess,function(t,i){var n=r.getOptions(i.field,null,"onSuccess");n&&e.fn.bootstrapValidator.helpers.call(n,[t,i])}).on(this.options.events.fieldError,function(t,i){var n=r.getOptions(i.field,null,"onError");n&&e.fn.bootstrapValidator.helpers.call(n,[t,i])}).on(this.options.events.fieldStatus,function(t,i){var n=r.getOptions(i.field,null,"onStatus");n&&e.fn.bootstrapValidator.helpers.call(n,[t,i])}).on(this.options.events.validatorError,function(t,i){var n=r.getOptions(i.field,i.validator,"onError");n&&e.fn.bootstrapValidator.helpers.call(n,[t,i])}).on(this.options.events.validatorSuccess,function(t,i){var n=r.getOptions(i.field,i.validator,"onSuccess");n&&e.fn.bootstrapValidator.helpers.call(n,[t,i])}),u=e.map(c,function(e){return e+".live.bv"}).join(" "),this.options.live){case"submitted":break;case"disabled":i.off(u);break;case"enabled":default:i.off(u).on(u,function(){r._exceedThreshold(e(this))&&r.validateField(e(this))})}i.trigger(e.Event(this.options.events.fieldInit),{bv:this,field:t,element:i})}},_getMessage:function(t,i){if(!(this.options.fields[t]&&e.fn.bootstrapValidator.validators[i]&&this.options.fields[t].validators&&this.options.fields[t].validators[i]))return"";var n=this.options.fields[t].validators[i];switch(!0){case!!n.message:return n.message;case!!this.options.fields[t].message:return this.options.fields[t].message;case!!e.fn.bootstrapValidator.i18n[i]:return e.fn.bootstrapValidator.i18n[i].default;default:return this.options.message}},_getMessageContainer:function(e,t){var i=e.parent();return i},_submit:function(){var t=this.isValid(),i=t?this.options.events.formSuccess:this.options.events.formError,n=e.Event(i);this.$form.trigger(n),this.$submitButton&&(t?this._onSuccess(n):this._onError(n))},_isExcluded:function(t){var i=t.attr("data-bv-excluded"),n=t.attr("data-bv-field")||t.attr("name");switch(!0){case!!n&&this.options.fields&&this.options.fields[n]&&("true"===this.options.fields[n].excluded||!0===this.options.fields[n].excluded):case"true"===i:case""===i:return!0;case!!n&&this.options.fields&&this.options.fields[n]&&("false"===this.options.fields[n].excluded||!1===this.options.fields[n].excluded):case"false"===i:return!1;default:if(this.options.excluded){"string"==typeof this.options.excluded&&(this.options.excluded=e.map(this.options.excluded.split(","),function(t){return e.trim(t)}));for(var r=this.options.excluded.length,a=0;a<r;a++)if("string"==typeof this.options.excluded[a]&&t.is(this.options.excluded[a])||"function"==typeof this.options.excluded[a]&&!0===this.options.excluded[a].call(this,t,this))return!0}return!1}},_exceedThreshold:function(t){var i=t.attr("data-bv-field"),n=this.options.fields[i].threshold||this.options.threshold;return!n||(-1!==e.inArray(t.attr("type"),["button","checkbox","file","hidden","image","radio","reset","submit"])||t.val().length>=n)},_onError:function(t){if(!t.isDefaultPrevented()){if("submitted"===this.options.live){this.options.live="enabled";var i=this;for(var n in this.options.fields)!function(t){var r=i.getFieldElements(t);if(r.length){var a=e(r[0]).attr("type"),o="radio"===a||"checkbox"===a||"file"===a||"SELECT"===e(r[0]).get(0).tagName?"change":i._changeEvent,s=i.options.fields[n].trigger||i.options.trigger||o,l=e.map(s.split(" "),function(e){return e+".live.bv"}).join(" ");r.off(l).on(l,function(){i._exceedThreshold(e(this))&&i.validateField(e(this))})}}(n)}for(var r=0;r<this.$invalidFields.length;r++){var a=this.$invalidFields.eq(r);if(this._isOptionEnabled(a.attr("data-bv-field"),"autoFocus")){var o,s=a.parents(".tab-pane");s&&(o=s.attr("id"))&&e('a[href="#'+o+'"][data-toggle="tab"]').tab("show"),a.focus();break}}}},_onSuccess:function(e){e.isDefaultPrevented()||this.disableSubmitButtons(!0).defaultSubmit()},_onFieldValidated:function(t,i){var n=t.attr("data-bv-field"),r=this.options.fields[n].validators,a={},o=0,s={bv:this,field:n,element:t,validator:i,result:t.data("bv.response."+i)};if(i)switch(t.data("bv.result."+i)){case this.STATUS_INVALID:t.trigger(e.Event(this.options.events.validatorError),s);break;case this.STATUS_VALID:t.trigger(e.Event(this.options.events.validatorSuccess),s)}a[this.STATUS_NOT_VALIDATED]=0,a[this.STATUS_VALIDATING]=0,a[this.STATUS_INVALID]=0,a[this.STATUS_VALID]=0;for(var l in r)if(!1!==r[l].enabled){o++;var c=t.data("bv.result."+l);c&&a[c]++}a[this.STATUS_VALID]===o?(this.$invalidFields=this.$invalidFields.not(t),t.trigger(e.Event(this.options.events.fieldSuccess),s)):(0===a[this.STATUS_NOT_VALIDATED]||!this._isOptionEnabled(n,"verbose"))&&0===a[this.STATUS_VALIDATING]&&a[this.STATUS_INVALID]>0&&(this.$invalidFields=this.$invalidFields.add(t),t.trigger(e.Event(this.options.events.fieldError),s))},_isOptionEnabled:function(e,t){return!(!this.options.fields[e]||"true"!==this.options.fields[e][t]&&!0!==this.options.fields[e][t])||(!this.options.fields[e]||"false"!==this.options.fields[e][t]&&!1!==this.options.fields[e][t])&&("true"===this.options[t]||!0===this.options[t])},getFieldElements:function(t){return this._cacheFields[t]||(this._cacheFields[t]=this.options.fields[t]&&this.options.fields[t].selector?e(this.options.fields[t].selector):this.$form.find('[name="'+t+'"]')),this._cacheFields[t]},getOptions:function(e,t,i){if(!e)return i?this.options[i]:this.options;if("object"==typeof e&&(e=e.attr("data-bv-field")),!this.options.fields[e])return null;var n=this.options.fields[e];return t?n.validators&&n.validators[t]?i?n.validators[t][i]:n.validators[t]:null:i?n[i]:n},disableSubmitButtons:function(e){return e?"disabled"!==this.options.live&&this.$form.find(this.options.submitButtons).attr("disabled","disabled"):this.$form.find(this.options.submitButtons).removeAttr("disabled"),this},validate:function(){if(!this.options.fields)return this;this.disableSubmitButtons(!0),this._submitIfValid=!1;for(var e in this.options.fields)this.validateField(e);return this._submit(),this._submitIfValid=!0,this},validateField:function(t){var i=e([]);switch(typeof t){case"object":i=t,t=t.attr("data-bv-field");break;case"string":i=this.getFieldElements(t)}if(0===i.length||!this.options.fields[t]||!1===this.options.fields[t].enabled)return this;for(var n,r,a=this,o=i.attr("type"),s="radio"===o||"checkbox"===o?1:i.length,l="radio"===o||"checkbox"===o,c=this.options.fields[t].validators,u=this._isOptionEnabled(t,"verbose"),d=0;d<s;d++){var h=i.eq(d);if(!this._isExcluded(h)){var p=!1;for(n in c){if(h.data("bv.dfs."+n)&&h.data("bv.dfs."+n).reject(),p)break;var f=h.data("bv.result."+n);if(f!==this.STATUS_VALID&&f!==this.STATUS_INVALID)if(!1!==c[n].enabled){if(h.data("bv.result."+n,this.STATUS_VALIDATING),"object"==typeof(r=e.fn.bootstrapValidator.validators[n].validate(this,h,c[n]))&&r.resolve)this.updateStatus(l?t:h,this.STATUS_VALIDATING,n),h.data("bv.dfs."+n,r),r.done(function(e,t,i){e.removeData("bv.dfs."+t).data("bv.response."+t,i),i.message&&a.updateMessage(e,t,i.message),a.updateStatus(l?e.attr("data-bv-field"):e,i.valid?a.STATUS_VALID:a.STATUS_INVALID,t),i.valid&&!0===a._submitIfValid?a._submit():i.valid||u||(p=!0)});else if("object"==typeof r&&void 0!==r.valid&&void 0!==r.message){if(h.data("bv.response."+n,r),this.updateMessage(l?t:h,n,r.message),this.updateStatus(l?t:h,r.valid?this.STATUS_VALID:this.STATUS_INVALID,n),!r.valid&&!u)break}else if("boolean"==typeof r&&(h.data("bv.response."+n,r),this.updateStatus(l?t:h,r?this.STATUS_VALID:this.STATUS_INVALID,n),!r&&!u))break}else this.updateStatus(l?t:h,this.STATUS_VALID,n);else this._onFieldValidated(h,n)}}}return this},updateMessage:function(t,i,n){var r=e([]);switch(typeof t){case"object":r=t,t=t.attr("data-bv-field");break;case"string":r=this.getFieldElements(t)}r.each(function(){e(this).data("bv.messages").find('.help-block[data-bv-validator="'+i+'"][data-bv-for="'+t+'"]').html(n)})},updateStatus:function(t,i,n){var r=e([]);switch(typeof t){case"object":r=t,t=t.attr("data-bv-field");break;case"string":r=this.getFieldElements(t)}i===this.STATUS_NOT_VALIDATED&&(this._submitIfValid=!1);for(var a=this,o=r.attr("type"),s=this.options.fields[t].group||this.options.group,l="radio"===o?1:r.length,c=0;c<l;c++){var u=r.eq(c);if(!this._isExcluded(u)){var d=u.parents(s),h=u.data("bv.messages"),p=h.find('.help-block[data-bv-validator][data-bv-for="'+t+'"]'),f=n?p.filter('[data-bv-validator="'+n+'"]'):p,m=u.data("bv.icon"),g="function"==typeof(this.options.fields[t].container||this.options.container)?(this.options.fields[t].container||this.options.container).call(this,u,this):this.options.fields[t].container||this.options.container,v=null;if(n)u.data("bv.result."+n,i);else for(var y in this.options.fields[t].validators)u.data("bv.result."+y,i);f.attr("data-bv-result",i);var _,b,w=u.parents(".tab-pane");switch(w&&(_=w.attr("id"))&&(b=e('a[href="#'+_+'"][data-toggle="tab"]').parent()),i){case this.STATUS_VALIDATING:v=null,this.disableSubmitButtons(!0),d.removeClass("has-success").removeClass("has-error"),m&&m.removeClass(this.options.feedbackIcons.valid).removeClass(this.options.feedbackIcons.invalid).addClass(this.options.feedbackIcons.validating).show(),b&&b.removeClass("bv-tab-success").removeClass("bv-tab-error");break;case this.STATUS_INVALID:v=!1,this.disableSubmitButtons(!0),d.removeClass("has-success").addClass("has-error"),m&&m.removeClass(this.options.feedbackIcons.valid).removeClass(this.options.feedbackIcons.validating).addClass(this.options.feedbackIcons.invalid).show(),b&&b.removeClass("bv-tab-success").addClass("bv-tab-error");break;case this.STATUS_VALID:v=0===p.filter('[data-bv-result="'+this.STATUS_NOT_VALIDATED+'"]').length?p.filter('[data-bv-result="'+this.STATUS_VALID+'"]').length===p.length:null,null!==v&&(this.disableSubmitButtons(this.$submitButton?!this.isValid():!v),m&&m.removeClass(this.options.feedbackIcons.invalid).removeClass(this.options.feedbackIcons.validating).removeClass(this.options.feedbackIcons.valid).addClass(v?this.options.feedbackIcons.valid:this.options.feedbackIcons.invalid).show()),d.removeClass("has-error has-success").addClass(this.isValidContainer(d)?"has-success":"has-error"),b&&b.removeClass("bv-tab-success").removeClass("bv-tab-error").addClass(this.isValidContainer(w)?"bv-tab-success":"bv-tab-error");break;case this.STATUS_NOT_VALIDATED:default:v=null,this.disableSubmitButtons(!1),d.removeClass("has-success").removeClass("has-error"),m&&m.removeClass(this.options.feedbackIcons.valid).removeClass(this.options.feedbackIcons.invalid).removeClass(this.options.feedbackIcons.validating).hide(),b&&b.removeClass("bv-tab-success").removeClass("bv-tab-error")}switch(!0){case m&&"tooltip"===g:!1===v?m.css("cursor","pointer").tooltip("destroy").tooltip({container:"body",html:!0,placement:"auto top",title:p.filter('[data-bv-result="'+a.STATUS_INVALID+'"]').eq(0).html()}):m.css("cursor","").tooltip("destroy");break;case m&&"popover"===g:!1===v?m.css("cursor","pointer").popover("destroy").popover({container:"body",content:p.filter('[data-bv-result="'+a.STATUS_INVALID+'"]').eq(0).html(),html:!0,placement:"auto top",trigger:"hover click"}):m.css("cursor","").popover("destroy");break;default:i===this.STATUS_INVALID?f.show():f.hide()}u.trigger(e.Event(this.options.events.fieldStatus),{bv:this,field:t,element:u,status:i}),this._onFieldValidated(u,n)}}return this},isValid:function(){for(var e in this.options.fields)if(!this.isValidField(e))return!1;return!0},isValidField:function(t){var i=e([]);switch(typeof t){case"object":i=t,t=t.attr("data-bv-field");break;case"string":i=this.getFieldElements(t)}if(0===i.length||!this.options.fields[t]||!1===this.options.fields[t].enabled)return!0;for(var n,r,a=i.attr("type"),o="radio"===a||"checkbox"===a?1:i.length,s=0;s<o;s++)if(n=i.eq(s),!this._isExcluded(n))for(r in this.options.fields[t].validators)if(!1!==this.options.fields[t].validators[r].enabled&&n.data("bv.result."+r)!==this.STATUS_VALID)return!1;return!0},isValidContainer:function(t){var i=this,n={},r="string"==typeof t?e(t):t;if(0===r.length)return!0;r.find("[data-bv-field]").each(function(){var t=e(this),r=t.attr("data-bv-field");i._isExcluded(t)||n[r]||(n[r]=t)});for(var a in n){if(n[a].data("bv.messages").find('.help-block[data-bv-validator][data-bv-for="'+a+'"]').filter('[data-bv-result="'+this.STATUS_INVALID+'"]').length>0)return!1}return!0},defaultSubmit:function(){this.$submitButton&&e("<input/>").attr("type","hidden").attr("data-bv-submit-hidden","").attr("name",this.$submitButton.attr("name")).val(this.$submitButton.val()).appendTo(this.$form),this.$form.off("submit.bv").submit()},getInvalidFields:function(){return this.$invalidFields},getSubmitButton:function(){return this.$submitButton},getMessages:function(t,i){var n=this,r=[],a=e([]);switch(!0){case t&&"object"==typeof t:a=t;break;case t&&"string"==typeof t:var o=this.getFieldElements(t);if(o.length>0){var s=o.attr("type");a="radio"===s||"checkbox"===s?o.eq(0):o}break;default:a=this.$invalidFields}var l=i?'[data-bv-validator="'+i+'"]':"";return a.each(function(){r=r.concat(e(this).data("bv.messages").find('.help-block[data-bv-for="'+e(this).attr("data-bv-field")+'"][data-bv-result="'+n.STATUS_INVALID+'"]'+l).map(function(){var t=e(this).attr("data-bv-validator"),i=e(this).attr("data-bv-for");return!1===n.options.fields[i].validators[t].enabled?"":e(this).html()}).get())}),r},updateOption:function(e,t,i,n){return"object"==typeof e&&(e=e.attr("data-bv-field")),this.options.fields[e]&&this.options.fields[e].validators[t]&&(this.options.fields[e].validators[t][i]=n,this.updateStatus(e,this.STATUS_NOT_VALIDATED,t)),this},addField:function(t,i){var n=e([]);switch(typeof t){case"object":n=t,t=t.attr("data-bv-field")||t.attr("name");break;case"string":delete this._cacheFields[t],n=this.getFieldElements(t)}n.attr("data-bv-field",t);for(var r=n.attr("type"),a="radio"===r||"checkbox"===r?1:n.length,o=0;o<a;o++){var s=n.eq(o),l=this._parseOptions(s);l=null===l?i:e.extend(!0,i,l),this.options.fields[t]=e.extend(!0,this.options.fields[t],l),this._cacheFields[t]=this._cacheFields[t]?this._cacheFields[t].add(s):s,this._initField("checkbox"===r||"radio"===r?t:s)}return this.disableSubmitButtons(!1),this.$form.trigger(e.Event(this.options.events.fieldAdded),{field:t,element:n,options:this.options.fields[t]}),this},removeField:function(t){var i=e([]);switch(typeof t){case"object":i=t,t=t.attr("data-bv-field")||t.attr("name"),i.attr("data-bv-field",t);break;case"string":i=this.getFieldElements(t)}if(0===i.length)return this;for(var n=i.attr("type"),r="radio"===n||"checkbox"===n?1:i.length,a=0;a<r;a++){var o=i.eq(a);this.$invalidFields=this.$invalidFields.not(o),this._cacheFields[t]=this._cacheFields[t].not(o)}return this._cacheFields[t]&&0!==this._cacheFields[t].length||delete this.options.fields[t],"checkbox"!==n&&"radio"!==n||this._initField(t),this.disableSubmitButtons(!1),this.$form.trigger(e.Event(this.options.events.fieldRemoved),{field:t,element:i}),this},resetField:function(t,i){var n=e([]);switch(typeof t){case"object":n=t,t=t.attr("data-bv-field");break;case"string":n=this.getFieldElements(t)}var r=n.length;if(this.options.fields[t])for(var a=0;a<r;a++)for(var o in this.options.fields[t].validators)n.eq(a).removeData("bv.dfs."+o);if(this.updateStatus(t,this.STATUS_NOT_VALIDATED),i){var s=n.attr("type");"radio"===s||"checkbox"===s?n.removeAttr("checked").removeAttr("selected"):n.val("")}return this},resetForm:function(t){for(var i in this.options.fields)this.resetField(i,t);return this.$invalidFields=e([]),this.$submitButton=null,this.disableSubmitButtons(!1),this},revalidateField:function(e){return this.updateStatus(e,this.STATUS_NOT_VALIDATED).validateField(e),this},enableFieldValidators:function(e,t,i){var n=this.options.fields[e].validators;if(i&&n&&n[i]&&n[i].enabled!==t)this.options.fields[e].validators[i].enabled=t,this.updateStatus(e,this.STATUS_NOT_VALIDATED,i);else if(!i&&this.options.fields[e].enabled!==t){this.options.fields[e].enabled=t;for(var r in n)this.enableFieldValidators(e,t,r)}return this},getDynamicOption:function(t,i){var n="string"==typeof t?this.getFieldElements(t):t,r=n.val();if("function"==typeof i)return e.fn.bootstrapValidator.helpers.call(i,[r,this,n]);if("string"==typeof i){var a=this.getFieldElements(i);return a.length?a.val():e.fn.bootstrapValidator.helpers.call(i,[r,this,n])||i}return null},destroy:function(){var t,i,n,r,a,o;for(t in this.options.fields){i=this.getFieldElements(t),o=this.options.fields[t].group||this.options.group;for(var s=0;s<i.length;s++){if(n=i.eq(s),n.data("bv.messages").find('.help-block[data-bv-validator][data-bv-for="'+t+'"]').remove().end().end().removeData("bv.messages").parents(o).removeClass("has-feedback has-error has-success").end().off(".bv").removeAttr("data-bv-field"),a=n.data("bv.icon")){switch("function"==typeof(this.options.fields[t].container||this.options.container)?(this.options.fields[t].container||this.options.container).call(this,n,this):this.options.fields[t].container||this.options.container){case"tooltip":a.tooltip("destroy").remove();break;case"popover":a.popover("destroy").remove();break;default:a.remove()}}n.removeData("bv.icon");for(r in this.options.fields[t].validators)n.data("bv.dfs."+r)&&n.data("bv.dfs."+r).reject(),n.removeData("bv.result."+r).removeData("bv.response."+r).removeData("bv.dfs."+r),"function"==typeof e.fn.bootstrapValidator.validators[r].destroy&&e.fn.bootstrapValidator.validators[r].destroy(this,n,this.options.fields[t].validators[r])}}this.disableSubmitButtons(!1),this.$hiddenButton.remove(),this.$form.removeClass(this.options.elementClass).off(".bv").removeData("bootstrapValidator").find("[data-bv-submit-hidden]").remove().end().find('[type="submit"]').off("click.bv")}},e.fn.bootstrapValidator=function(i){var n=arguments;return this.each(function(){var r=e(this),a=r.data("bootstrapValidator"),o="object"==typeof i&&i;a||(a=new t(this,o),r.data("bootstrapValidator",a)),"string"==typeof i&&a[i].apply(a,Array.prototype.slice.call(n,1))})},e.fn.bootstrapValidator.DEFAULT_OPTIONS={autoFocus:!0,container:null,elementClass:"bv-form",events:{formInit:"init.form.bv",formError:"error.form.bv",formSuccess:"success.form.bv",fieldAdded:"added.field.bv",fieldRemoved:"removed.field.bv",fieldInit:"init.field.bv",fieldError:"error.field.bv",fieldSuccess:"success.field.bv",fieldStatus:"status.field.bv",validatorError:"error.validator.bv",validatorSuccess:"success.validator.bv"},excluded:[":disabled",":hidden",":not(:visible)"],feedbackIcons:{valid:null,invalid:null,validating:null},fields:null,group:".form-group",live:"disabled",message:"This value is not valid",submitButtons:'[type="submit"]',threshold:null,verbose:!0},e.fn.bootstrapValidator.validators={},e.fn.bootstrapValidator.i18n={},e.fn.bootstrapValidator.Constructor=t,e.fn.bootstrapValidator.helpers={call:function(e,t){if("function"==typeof e)return e.apply(this,t);if("string"==typeof e){"()"===e.substring(e.length-2)&&(e=e.substring(0,e.length-2));for(var i=e.split("."),n=i.pop(),r=window,a=0;a<i.length;a++)r=r[i[a]];return void 0===r[n]?null:r[n].apply(this,t)}},format:function(t,i){e.isArray(i)||(i=[i]);for(var n in i)t=t.replace("%s",i[n]);return t},
|
||
date:function(e,t,i,n){if(isNaN(e)||isNaN(t)||isNaN(i))return!1;if(i.length>2||t.length>2||e.length>4)return!1;if(i=parseInt(i,10),t=parseInt(t,10),(e=parseInt(e,10))<1e3||e>9999||t<=0||t>12)return!1;var r=[31,28,31,30,31,30,31,31,30,31,30,31];if((e%400==0||e%100!=0&&e%4==0)&&(r[1]=29),i<=0||i>r[t-1])return!1;if(!0===n){var a=new Date,o=a.getFullYear(),s=a.getMonth(),l=a.getDate();return e<o||e===o&&t-1<s||e===o&&t-1===s&&i<l}return!0},luhn:function(e){for(var t=e.length,i=0,n=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],r=0;t--;)r+=n[i][parseInt(e.charAt(t),10)],i^=1;return r%10==0&&r>0},mod11And10:function(e){for(var t=5,i=e.length,n=0;n<i;n++)t=(2*(t||10)%11+parseInt(e.charAt(n),10))%10;return 1===t},mod37And36:function(e,t){t=t||"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var i=t.length,n=e.length,r=Math.floor(i/2),a=0;a<n;a++)r=(2*(r||i)%(i+1)+t.indexOf(e.charAt(a)))%i;return 1===r}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.base64=e.extend(e.fn.bootstrapValidator.i18n.base64||{},{default:"Please enter a valid base 64 encoded"}),e.fn.bootstrapValidator.validators.base64={validate:function(e,t,i){var n=t.val();return""===n||/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$/.test(n)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.between=e.extend(e.fn.bootstrapValidator.i18n.between||{},{default:"Please enter a value between %s and %s",notInclusive:"Please enter a value between %s and %s strictly"}),e.fn.bootstrapValidator.validators.between={html5Attributes:{message:"message",min:"min",max:"max",inclusive:"inclusive"},enableByHtml5:function(e){return"range"===e.attr("type")&&{min:e.attr("min"),max:e.attr("max")}},validate:function(t,i,n){var r=i.val();if(""===r)return!0;if(r=this._format(r),!e.isNumeric(r))return!1;var a=e.isNumeric(n.min)?n.min:t.getDynamicOption(i,n.min),o=e.isNumeric(n.max)?n.max:t.getDynamicOption(i,n.max),s=this._format(a),l=this._format(o);return r=parseFloat(r),!0===n.inclusive||void 0===n.inclusive?{valid:r>=s&&r<=l,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.between.default,[a,o])}:{valid:r>s&&r<l,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.between.notInclusive,[a,o])}},_format:function(e){return(e+"").replace(",",".")}}}(window.jQuery),function(e){e.fn.bootstrapValidator.validators.blank={validate:function(e,t,i){return!0}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.callback=e.extend(e.fn.bootstrapValidator.i18n.callback||{},{default:"Please enter a valid value"}),e.fn.bootstrapValidator.validators.callback={html5Attributes:{message:"message",callback:"callback"},validate:function(t,i,n){var r=i.val(),a=new e.Deferred,o={valid:!0};if(n.callback){var s=e.fn.bootstrapValidator.helpers.call(n.callback,[r,t,i]);o="boolean"==typeof s?{valid:s}:s}return a.resolve(i,"callback",o),a}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.choice=e.extend(e.fn.bootstrapValidator.i18n.choice||{},{default:"Please enter a valid value",less:"Please choose %s options at minimum",more:"Please choose %s options at maximum",between:"Please choose %s - %s options"}),e.fn.bootstrapValidator.validators.choice={html5Attributes:{message:"message",min:"min",max:"max"},validate:function(t,i,n){var r=i.is("select")?t.getFieldElements(i.attr("data-bv-field")).find("option").filter(":selected").length:t.getFieldElements(i.attr("data-bv-field")).filter(":checked").length,a=n.min?e.isNumeric(n.min)?n.min:t.getDynamicOption(i,n.min):null,o=n.max?e.isNumeric(n.max)?n.max:t.getDynamicOption(i,n.max):null,s=!0,l=n.message||e.fn.bootstrapValidator.i18n.choice.default;switch((a&&r<parseInt(a,10)||o&&r>parseInt(o,10))&&(s=!1),!0){case!!a&&!!o:l=e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.choice.between,[parseInt(a,10),parseInt(o,10)]);break;case!!a:l=e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.choice.less,parseInt(a,10));break;case!!o:l=e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.choice.more,parseInt(o,10))}return{valid:s,message:l}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.color=e.extend(e.fn.bootstrapValidator.i18n.color||{},{default:"Please enter a valid color"}),e.fn.bootstrapValidator.validators.color={SUPPORTED_TYPES:["hex","rgb","rgba","hsl","hsla","keyword"],KEYWORD_COLORS:["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","transparent","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],validate:function(t,i,n){var r=i.val();if(""===r)return!0;var a=n.type||this.SUPPORTED_TYPES;e.isArray(a)||(a=a.replace(/s/g,"").split(","));for(var o,s,l=!1,c=0;c<a.length;c++)if(s=a[c],o="_"+s.toLowerCase(),l=l||this[o](r))return!0;return!1},_hex:function(e){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(e)},_hsl:function(e){return/^hsl\((\s*(-?\d+)\s*,)(\s*(\b(0?\d{1,2}|100)\b%)\s*,)(\s*(\b(0?\d{1,2}|100)\b%)\s*)\)$/.test(e)},_hsla:function(e){return/^hsla\((\s*(-?\d+)\s*,)(\s*(\b(0?\d{1,2}|100)\b%)\s*,){2}(\s*(0?(\.\d+)?|1(\.0+)?)\s*)\)$/.test(e)},_keyword:function(t){return e.inArray(t,this.KEYWORD_COLORS)>=0},_rgb:function(e){var t=/^rgb\((\s*(\b([01]?\d{1,2}|2[0-4]\d|25[0-5])\b)\s*,){2}(\s*(\b([01]?\d{1,2}|2[0-4]\d|25[0-5])\b)\s*)\)$/,i=/^rgb\((\s*(\b(0?\d{1,2}|100)\b%)\s*,){2}(\s*(\b(0?\d{1,2}|100)\b%)\s*)\)$/;return t.test(e)||i.test(e)},_rgba:function(e){var t=/^rgba\((\s*(\b([01]?\d{1,2}|2[0-4]\d|25[0-5])\b)\s*,){3}(\s*(0?(\.\d+)?|1(\.0+)?)\s*)\)$/,i=/^rgba\((\s*(\b(0?\d{1,2}|100)\b%)\s*,){3}(\s*(0?(\.\d+)?|1(\.0+)?)\s*)\)$/;return t.test(e)||i.test(e)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.creditCard=e.extend(e.fn.bootstrapValidator.i18n.creditCard||{},{default:"Please enter a valid credit card number"}),e.fn.bootstrapValidator.validators.creditCard={validate:function(t,i,n){var r=i.val();if(""===r)return!0;if(/[^0-9-\s]+/.test(r))return!1;if(r=r.replace(/\D/g,""),!e.fn.bootstrapValidator.helpers.luhn(r))return!1;var a,o,s={AMERICAN_EXPRESS:{length:[15],prefix:["34","37"]},DINERS_CLUB:{length:[14],prefix:["300","301","302","303","304","305","36"]},DINERS_CLUB_US:{length:[16],prefix:["54","55"]},DISCOVER:{length:[16],prefix:["6011","622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925","644","645","646","647","648","649","65"]},JCB:{length:[16],prefix:["3528","3529","353","354","355","356","357","358"]},LASER:{length:[16,17,18,19],prefix:["6304","6706","6771","6709"]},MAESTRO:{length:[12,13,14,15,16,17,18,19],prefix:["5018","5020","5038","6304","6759","6761","6762","6763","6764","6765","6766"]},MASTERCARD:{length:[16],prefix:["51","52","53","54","55"]},SOLO:{length:[16,18,19],prefix:["6334","6767"]},UNIONPAY:{length:[16,17,18,19],prefix:["622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925"]},VISA:{length:[16],prefix:["4"]}};for(a in s)for(o in s[a].prefix)if(r.substr(0,s[a].prefix[o].length)===s[a].prefix[o]&&-1!==e.inArray(r.length,s[a].length))return!0;return!1}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.cusip=e.extend(e.fn.bootstrapValidator.i18n.cusip||{},{default:"Please enter a valid CUSIP number"}),e.fn.bootstrapValidator.validators.cusip={validate:function(t,i,n){var r=i.val();if(""===r)return!0;if(r=r.toUpperCase(),!/^[0-9A-Z]{9}$/.test(r))return!1;for(var a=e.map(r.split(""),function(e){var t=e.charCodeAt(0);return t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)?t-"A".charCodeAt(0)+10:e}),o=a.length,s=0,l=0;l<o-1;l++){var c=parseInt(a[l],10);l%2!=0&&(c*=2),c>9&&(c-=9),s+=c}return(s=(10-s%10)%10)===a[o-1]}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.cvv=e.extend(e.fn.bootstrapValidator.i18n.cvv||{},{default:"Please enter a valid CVV number"}),e.fn.bootstrapValidator.validators.cvv={html5Attributes:{message:"message",ccfield:"creditCardField"},validate:function(t,i,n){var r=i.val();if(""===r)return!0;if(!/^[0-9]{3,4}$/.test(r))return!1;if(!n.creditCardField)return!0;var a=t.getFieldElements(n.creditCardField).val();if(""===a)return!0;a=a.replace(/\D/g,"");var o,s,l={AMERICAN_EXPRESS:{length:[15],prefix:["34","37"]},DINERS_CLUB:{length:[14],prefix:["300","301","302","303","304","305","36"]},DINERS_CLUB_US:{length:[16],prefix:["54","55"]},DISCOVER:{length:[16],prefix:["6011","622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925","644","645","646","647","648","649","65"]},JCB:{length:[16],prefix:["3528","3529","353","354","355","356","357","358"]},LASER:{length:[16,17,18,19],prefix:["6304","6706","6771","6709"]},MAESTRO:{length:[12,13,14,15,16,17,18,19],prefix:["5018","5020","5038","6304","6759","6761","6762","6763","6764","6765","6766"]},MASTERCARD:{length:[16],prefix:["51","52","53","54","55"]},SOLO:{length:[16,18,19],prefix:["6334","6767"]},UNIONPAY:{length:[16,17,18,19],prefix:["622126","622127","622128","622129","62213","62214","62215","62216","62217","62218","62219","6222","6223","6224","6225","6226","6227","6228","62290","62291","622920","622921","622922","622923","622924","622925"]},VISA:{length:[16],prefix:["4"]}},c=null;for(o in l)for(s in l[o].prefix)if(a.substr(0,l[o].prefix[s].length)===l[o].prefix[s]&&-1!==e.inArray(a.length,l[o].length)){c=o;break}return null!==c&&("AMERICAN_EXPRESS"===c?4===r.length:3===r.length)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.date=e.extend(e.fn.bootstrapValidator.i18n.date||{},{default:"Please enter a valid date",min:"Please enter a date after %s",max:"Please enter a date before %s",range:"Please enter a date in the range %s - %s"}),e.fn.bootstrapValidator.validators.date={html5Attributes:{message:"message",format:"format",min:"min",max:"max",separator:"separator"},validate:function(t,i,n){var r=i.val();if(""===r)return!0;n.format=n.format||"MM/DD/YYYY","date"===i.attr("type")&&(n.format="YYYY-MM-DD");var a=n.format.split(" "),o=a[0],s=a.length>1?a[1]:null,l=a.length>2?a[2]:null,c=r.split(" "),u=c[0],d=c.length>1?c[1]:null;if(a.length!==c.length)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default};var h=n.separator;if(h||(h=-1!==u.indexOf("/")?"/":-1!==u.indexOf("-")?"-":null),null===h||-1===u.indexOf(h))return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default};if(u=u.split(h),o=o.split(h),u.length!==o.length)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default};var p=u[e.inArray("YYYY",o)],f=u[e.inArray("MM",o)],m=u[e.inArray("DD",o)];if(!p||!f||!m||4!==p.length)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default};var g=null,v=null,y=null;if(s){if(s=s.split(":"),d=d.split(":"),s.length!==d.length)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default};if(v=d.length>0?d[0]:null,g=d.length>1?d[1]:null,y=d.length>2?d[2]:null){if(isNaN(y)||y.length>2)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default};if((y=parseInt(y,10))<0||y>60)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default}}if(v){if(isNaN(v)||v.length>2)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default};if((v=parseInt(v,10))<0||v>=24||l&&v>12)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default}}if(g){if(isNaN(g)||g.length>2)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default};if((g=parseInt(g,10))<0||g>59)return{valid:!1,message:n.message||e.fn.bootstrapValidator.i18n.date.default}}}var _=e.fn.bootstrapValidator.helpers.date(p,f,m),b=n.message||e.fn.bootstrapValidator.i18n.date.default,w=null,x=null,k=n.min,C=n.max;switch(k&&(isNaN(Date.parse(k))&&(k=t.getDynamicOption(i,k)),w=this._parseDate(k,o,h)),C&&(isNaN(Date.parse(C))&&(C=t.getDynamicOption(i,C)),x=this._parseDate(C,o,h)),u=new Date(p,f,m,v,g,y),!0){case k&&!C&&_:_=u.getTime()>=w.getTime(),b=n.message||e.fn.bootstrapValidator.helpers.format(e.fn.bootstrapValidator.i18n.date.min,k);break;case C&&!k&&_:_=u.getTime()<=x.getTime(),b=n.message||e.fn.bootstrapValidator.helpers.format(e.fn.bootstrapValidator.i18n.date.max,C);break;case C&&k&&_:_=u.getTime()<=x.getTime()&&u.getTime()>=w.getTime(),b=n.message||e.fn.bootstrapValidator.helpers.format(e.fn.bootstrapValidator.i18n.date.range,[k,C])}return{valid:_,message:b}},_parseDate:function(t,i,n){var r=0,a=0,o=0,s=t.split(" "),l=s[0],c=s.length>1?s[1]:null;l=l.split(n);var u=l[e.inArray("YYYY",i)],d=l[e.inArray("MM",i)],h=l[e.inArray("DD",i)];return c&&(c=c.split(":"),a=c.length>0?c[0]:null,r=c.length>1?c[1]:null,o=c.length>2?c[2]:null),new Date(u,d,h,a,r,o)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.different=e.extend(e.fn.bootstrapValidator.i18n.different||{},{default:"Please enter a different value"}),e.fn.bootstrapValidator.validators.different={html5Attributes:{message:"message",field:"field"},validate:function(e,t,i){var n=t.val();if(""===n)return!0;for(var r=i.field.split(","),a=!0,o=0;o<r.length;o++){var s=e.getFieldElements(r[o]);if(null!=s&&0!==s.length){var l=s.val();n===l?a=!1:""!==l&&e.updateStatus(s,e.STATUS_VALID,"different")}}return a}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.digits=e.extend(e.fn.bootstrapValidator.i18n.digits||{},{default:"Please enter only digits"}),e.fn.bootstrapValidator.validators.digits={validate:function(e,t,i){var n=t.val();return""===n||/^\d+$/.test(n)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.ean=e.extend(e.fn.bootstrapValidator.i18n.ean||{},{default:"Please enter a valid EAN number"}),e.fn.bootstrapValidator.validators.ean={validate:function(e,t,i){var n=t.val();if(""===n)return!0;if(!/^(\d{8}|\d{12}|\d{13})$/.test(n))return!1;for(var r=n.length,a=0,o=8===r?[3,1]:[1,3],s=0;s<r-1;s++)a+=parseInt(n.charAt(s),10)*o[s%2];return(a=(10-a%10)%10)+""===n.charAt(r-1)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.emailAddress=e.extend(e.fn.bootstrapValidator.i18n.emailAddress||{},{default:"Please enter a valid email address"}),e.fn.bootstrapValidator.validators.emailAddress={html5Attributes:{message:"message",multiple:"multiple",separator:"separator"},enableByHtml5:function(e){return"email"===e.attr("type")},validate:function(e,t,i){var n=t.val();if(""===n)return!0;var r=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;if(!0===i.multiple||"true"===i.multiple){for(var a=i.separator||/[,;]/,o=this._splitEmailAddresses(n,a),s=0;s<o.length;s++)if(!r.test(o[s]))return!1;return!0}return r.test(n)},_splitEmailAddresses:function(e,t){for(var i=e.split(/"/),n=i.length,r=[],a="",o=0;o<n;o++)if(o%2==0){var s=i[o].split(t),l=s.length;if(1===l)a+=s[0];else{r.push(a+s[0]);for(var c=1;c<l-1;c++)r.push(s[c]);a=s[l-1]}}else a+='"'+i[o],o<n-1&&(a+='"');return r.push(a),r}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.file=e.extend(e.fn.bootstrapValidator.i18n.file||{},{default:"Please choose a valid file"}),e.fn.bootstrapValidator.validators.file={html5Attributes:{extension:"extension",maxfiles:"maxFiles",minfiles:"minFiles",maxsize:"maxSize",minsize:"minSize",maxtotalsize:"maxTotalSize",mintotalsize:"minTotalSize",message:"message",type:"type"},validate:function(t,i,n){var r=i.val();if(""===r)return!0;var a,o=n.extension?n.extension.toLowerCase().split(","):null,s=n.type?n.type.toLowerCase().split(","):null;if(window.File&&window.FileList&&window.FileReader){var l=i.get(0).files,c=l.length,u=0;if(n.maxFiles&&c>parseInt(n.maxFiles,10)||n.minFiles&&c<parseInt(n.minFiles,10))return!1;for(var d=0;d<c;d++)if(u+=l[d].size,a=l[d].name.substr(l[d].name.lastIndexOf(".")+1),n.minSize&&l[d].size<parseInt(n.minSize,10)||n.maxSize&&l[d].size>parseInt(n.maxSize,10)||o&&-1===e.inArray(a.toLowerCase(),o)||l[d].type&&s&&-1===e.inArray(l[d].type.toLowerCase(),s))return!1;if(n.maxTotalSize&&u>parseInt(n.maxTotalSize,10)||n.minTotalSize&&u<parseInt(n.minTotalSize,10))return!1}else if(a=r.substr(r.lastIndexOf(".")+1),o&&-1===e.inArray(a.toLowerCase(),o))return!1;return!0}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.greaterThan=e.extend(e.fn.bootstrapValidator.i18n.greaterThan||{},{default:"Please enter a value greater than or equal to %s",notInclusive:"Please enter a value greater than %s"}),e.fn.bootstrapValidator.validators.greaterThan={html5Attributes:{message:"message",value:"value",inclusive:"inclusive"},enableByHtml5:function(e){var t=e.attr("type"),i=e.attr("min");return!(!i||"date"===t)&&{value:i}},validate:function(t,i,n){var r=i.val();if(""===r)return!0;if(r=this._format(r),!e.isNumeric(r))return!1;var a=e.isNumeric(n.value)?n.value:t.getDynamicOption(i,n.value),o=this._format(a);return r=parseFloat(r),!0===n.inclusive||void 0===n.inclusive?{valid:r>=o,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.greaterThan.default,a)}:{valid:r>o,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.greaterThan.notInclusive,a)}},_format:function(e){return(e+"").replace(",",".")}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.grid=e.extend(e.fn.bootstrapValidator.i18n.grid||{},{default:"Please enter a valid GRId number"}),e.fn.bootstrapValidator.validators.grid={validate:function(t,i,n){var r=i.val();return""===r||(r=r.toUpperCase(),!!/^[GRID:]*([0-9A-Z]{2})[-\s]*([0-9A-Z]{5})[-\s]*([0-9A-Z]{10})[-\s]*([0-9A-Z]{1})$/g.test(r)&&(r=r.replace(/\s/g,"").replace(/-/g,""),"GRID:"===r.substr(0,5)&&(r=r.substr(5)),e.fn.bootstrapValidator.helpers.mod37And36(r)))}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.hex=e.extend(e.fn.bootstrapValidator.i18n.hex||{},{default:"Please enter a valid hexadecimal number"}),e.fn.bootstrapValidator.validators.hex={validate:function(e,t,i){var n=t.val();return""===n||/^[0-9a-fA-F]+$/.test(n)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.hexColor=e.extend(e.fn.bootstrapValidator.i18n.hexColor||{},{default:"Please enter a valid hex color"}),e.fn.bootstrapValidator.validators.hexColor={enableByHtml5:function(e){return"color"===e.attr("type")},validate:function(e,t,i){var n=t.val();return""===n||("color"===t.attr("type")?/^#[0-9A-F]{6}$/i.test(n):/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(n))}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.iban=e.extend(e.fn.bootstrapValidator.i18n.iban||{},{default:"Please enter a valid IBAN number",countryNotSupported:"The country code %s is not supported",country:"Please enter a valid IBAN number in %s",countries:{AD:"Andorra",AE:"United Arab Emirates",AL:"Albania",AO:"Angola",AT:"Austria",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BR:"Brazil",CH:"Switzerland",CI:"Ivory Coast",CM:"Cameroon",CR:"Costa Rica",CV:"Cape Verde",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",DO:"Dominican Republic",DZ:"Algeria",EE:"Estonia",ES:"Spain",FI:"Finland",FO:"Faroe Islands",FR:"France",GB:"United Kingdom",GE:"Georgia",GI:"Gibraltar",GL:"Greenland",GR:"Greece",GT:"Guatemala",HR:"Croatia",HU:"Hungary",IE:"Ireland",IL:"Israel",IR:"Iran",IS:"Iceland",IT:"Italy",JO:"Jordan",KW:"Kuwait",KZ:"Kazakhstan",LB:"Lebanon",LI:"Liechtenstein",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"Macedonia",ML:"Mali",MR:"Mauritania",MT:"Malta",MU:"Mauritius",MZ:"Mozambique",NL:"Netherlands",NO:"Norway",PK:"Pakistan",PL:"Poland",PS:"Palestine",PT:"Portugal",QA:"Qatar",RO:"Romania",RS:"Serbia",SA:"Saudi Arabia",SE:"Sweden",SI:"Slovenia",SK:"Slovakia",SM:"San Marino",SN:"Senegal",TN:"Tunisia",TR:"Turkey",VG:"Virgin Islands, British"}}),e.fn.bootstrapValidator.validators.iban={html5Attributes:{message:"message",country:"country"},REGEX:{AD:"AD[0-9]{2}[0-9]{4}[0-9]{4}[A-Z0-9]{12}",AE:"AE[0-9]{2}[0-9]{3}[0-9]{16}",AL:"AL[0-9]{2}[0-9]{8}[A-Z0-9]{16}",AO:"AO[0-9]{2}[0-9]{21}",AT:"AT[0-9]{2}[0-9]{5}[0-9]{11}",AZ:"AZ[0-9]{2}[A-Z]{4}[A-Z0-9]{20}",BA:"BA[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{8}[0-9]{2}",BE:"BE[0-9]{2}[0-9]{3}[0-9]{7}[0-9]{2}",BF:"BF[0-9]{2}[0-9]{23}",BG:"BG[0-9]{2}[A-Z]{4}[0-9]{4}[0-9]{2}[A-Z0-9]{8}",BH:"BH[0-9]{2}[A-Z]{4}[A-Z0-9]{14}",BI:"BI[0-9]{2}[0-9]{12}",BJ:"BJ[0-9]{2}[A-Z]{1}[0-9]{23}",BR:"BR[0-9]{2}[0-9]{8}[0-9]{5}[0-9]{10}[A-Z][A-Z0-9]",CH:"CH[0-9]{2}[0-9]{5}[A-Z0-9]{12}",CI:"CI[0-9]{2}[A-Z]{1}[0-9]{23}",CM:"CM[0-9]{2}[0-9]{23}",CR:"CR[0-9]{2}[0-9]{3}[0-9]{14}",CV:"CV[0-9]{2}[0-9]{21}",CY:"CY[0-9]{2}[0-9]{3}[0-9]{5}[A-Z0-9]{16}",CZ:"CZ[0-9]{2}[0-9]{20}",DE:"DE[0-9]{2}[0-9]{8}[0-9]{10}",DK:"DK[0-9]{2}[0-9]{14}",DO:"DO[0-9]{2}[A-Z0-9]{4}[0-9]{20}",DZ:"DZ[0-9]{2}[0-9]{20}",EE:"EE[0-9]{2}[0-9]{2}[0-9]{2}[0-9]{11}[0-9]{1}",ES:"ES[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{1}[0-9]{1}[0-9]{10}",FI:"FI[0-9]{2}[0-9]{6}[0-9]{7}[0-9]{1}",FO:"FO[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}",FR:"FR[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}",GB:"GB[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}",GE:"GE[0-9]{2}[A-Z]{2}[0-9]{16}",GI:"GI[0-9]{2}[A-Z]{4}[A-Z0-9]{15}",GL:"GL[0-9]{2}[0-9]{4}[0-9]{9}[0-9]{1}",GR:"GR[0-9]{2}[0-9]{3}[0-9]{4}[A-Z0-9]{16}",GT:"GT[0-9]{2}[A-Z0-9]{4}[A-Z0-9]{20}",HR:"HR[0-9]{2}[0-9]{7}[0-9]{10}",HU:"HU[0-9]{2}[0-9]{3}[0-9]{4}[0-9]{1}[0-9]{15}[0-9]{1}",IE:"IE[0-9]{2}[A-Z]{4}[0-9]{6}[0-9]{8}",IL:"IL[0-9]{2}[0-9]{3}[0-9]{3}[0-9]{13}",IR:"IR[0-9]{2}[0-9]{22}",IS:"IS[0-9]{2}[0-9]{4}[0-9]{2}[0-9]{6}[0-9]{10}",IT:"IT[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}",JO:"JO[0-9]{2}[A-Z]{4}[0-9]{4}[0]{8}[A-Z0-9]{10}",KW:"KW[0-9]{2}[A-Z]{4}[0-9]{22}",KZ:"KZ[0-9]{2}[0-9]{3}[A-Z0-9]{13}",LB:"LB[0-9]{2}[0-9]{4}[A-Z0-9]{20}",LI:"LI[0-9]{2}[0-9]{5}[A-Z0-9]{12}",LT:"LT[0-9]{2}[0-9]{5}[0-9]{11}",LU:"LU[0-9]{2}[0-9]{3}[A-Z0-9]{13}",LV:"LV[0-9]{2}[A-Z]{4}[A-Z0-9]{13}",MC:"MC[0-9]{2}[0-9]{5}[0-9]{5}[A-Z0-9]{11}[0-9]{2}",MD:"MD[0-9]{2}[A-Z0-9]{20}",ME:"ME[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}",MG:"MG[0-9]{2}[0-9]{23}",MK:"MK[0-9]{2}[0-9]{3}[A-Z0-9]{10}[0-9]{2}",ML:"ML[0-9]{2}[A-Z]{1}[0-9]{23}",MR:"MR13[0-9]{5}[0-9]{5}[0-9]{11}[0-9]{2}",MT:"MT[0-9]{2}[A-Z]{4}[0-9]{5}[A-Z0-9]{18}",MU:"MU[0-9]{2}[A-Z]{4}[0-9]{2}[0-9]{2}[0-9]{12}[0-9]{3}[A-Z]{3}",MZ:"MZ[0-9]{2}[0-9]{21}",NL:"NL[0-9]{2}[A-Z]{4}[0-9]{10}",NO:"NO[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{1}",PK:"PK[0-9]{2}[A-Z]{4}[A-Z0-9]{16}",PL:"PL[0-9]{2}[0-9]{8}[0-9]{16}",PS:"PS[0-9]{2}[A-Z]{4}[A-Z0-9]{21}",PT:"PT[0-9]{2}[0-9]{4}[0-9]{4}[0-9]{11}[0-9]{2}",QA:"QA[0-9]{2}[A-Z]{4}[A-Z0-9]{21}",RO:"RO[0-9]{2}[A-Z]{4}[A-Z0-9]{16}",RS:"RS[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}",SA:"SA[0-9]{2}[0-9]{2}[A-Z0-9]{18}",SE:"SE[0-9]{2}[0-9]{3}[0-9]{16}[0-9]{1}",SI:"SI[0-9]{2}[0-9]{5}[0-9]{8}[0-9]{2}",SK:"SK[0-9]{2}[0-9]{4}[0-9]{6}[0-9]{10}",SM:"SM[0-9]{2}[A-Z]{1}[0-9]{5}[0-9]{5}[A-Z0-9]{12}",SN:"SN[0-9]{2}[A-Z]{1}[0-9]{23}",TN:"TN59[0-9]{2}[0-9]{3}[0-9]{13}[0-9]{2}",TR:"TR[0-9]{2}[0-9]{5}[A-Z0-9]{1}[A-Z0-9]{16}",VG:"VG[0-9]{2}[A-Z]{4}[0-9]{16}"},validate:function(t,i,n){var r=i.val();if(""===r)return!0;r=r.replace(/[^a-zA-Z0-9]/g,"").toUpperCase();var a=n.country;if(a?"string"==typeof a&&this.REGEX[a]||(a=t.getDynamicOption(i,a)):a=r.substr(0,2),!this.REGEX[a])return{valid:!1,message:e.fn.bootstrapValidator.helpers.format(e.fn.bootstrapValidator.i18n.iban.countryNotSupported,a)};if(!new RegExp("^"+this.REGEX[a]+"$").test(r))return{valid:!1,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.iban.country,e.fn.bootstrapValidator.i18n.iban.countries[a])};r=r.substr(4)+r.substr(0,4),r=e.map(r.split(""),function(e){var t=e.charCodeAt(0);return t>="A".charCodeAt(0)&&t<="Z".charCodeAt(0)?t-"A".charCodeAt(0)+10:e}),r=r.join("");for(var o=parseInt(r.substr(0,1),10),s=r.length,l=1;l<s;++l)o=(10*o+parseInt(r.substr(l,1),10))%97;return{valid:1===o,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.iban.country,e.fn.bootstrapValidator.i18n.iban.countries[a])}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.id=e.extend(e.fn.bootstrapValidator.i18n.id||{},{default:"Please enter a valid identification number",countryNotSupported:"The country code %s is not supported",country:"Please enter a valid identification number in %s",countries:{BA:"Bosnia and Herzegovina",BG:"Bulgaria",BR:"Brazil",CH:"Switzerland",CL:"Chile",CN:"China",CZ:"Czech Republic",DK:"Denmark",EE:"Estonia",ES:"Spain",FI:"Finland",HR:"Croatia",IE:"Ireland",IS:"Iceland",LT:"Lithuania",LV:"Latvia",ME:"Montenegro",MK:"Macedonia",NL:"Netherlands",RO:"Romania",RS:"Serbia",SE:"Sweden",SI:"Slovenia",SK:"Slovakia",SM:"San Marino",TH:"Thailand",ZA:"South Africa"}}),e.fn.bootstrapValidator.validators.id={html5Attributes:{message:"message",country:"country"},COUNTRY_CODES:["BA","BG","BR","CH","CL","CN","CZ","DK","EE","ES","FI","HR","IE","IS","LT","LV","ME","MK","NL","RO","RS","SE","SI","SK","SM","TH","ZA"],validate:function(t,i,n){var r=i.val();if(""===r)return!0;var a=n.country;return a?"string"==typeof a&&-1!==e.inArray(a.toUpperCase(),this.COUNTRY_CODES)||(a=t.getDynamicOption(i,a)):a=r.substr(0,2),-1===e.inArray(a,this.COUNTRY_CODES)?{valid:!1,message:e.fn.bootstrapValidator.helpers.format(e.fn.bootstrapValidator.i18n.id.countryNotSupported,a)}:!!this[["_",a.toLowerCase()].join("")](r)||{valid:!1,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.id.country,e.fn.bootstrapValidator.i18n.id.countries[a.toUpperCase()])}},_validateJMBG:function(e,t){if(!/^\d{13}$/.test(e))return!1;var i=parseInt(e.substr(0,2),10),n=parseInt(e.substr(2,2),10),r=(parseInt(e.substr(4,3),10),parseInt(e.substr(7,2),10)),a=parseInt(e.substr(12,1),10);if(i>31||n>12)return!1;for(var o=0,s=0;s<6;s++)o+=(7-s)*(parseInt(e.charAt(s),10)+parseInt(e.charAt(s+6),10));if(o=11-o%11,10!==o&&11!==o||(o=0),o!==a)return!1;switch(t.toUpperCase()){case"BA":return 10<=r&&r<=19;case"MK":return 41<=r&&r<=49;case"ME":return 20<=r&&r<=29;case"RS":return 70<=r&&r<=99;case"SI":return 50<=r&&r<=59;default:return!0}},_ba:function(e){return this._validateJMBG(e,"BA")},_mk:function(e){return this._validateJMBG(e,"MK")},_me:function(e){return this._validateJMBG(e,"ME")},_rs:function(e){return this._validateJMBG(e,"RS")},_si:function(e){return this._validateJMBG(e,"SI")},_bg:function(t){if(!/^\d{10}$/.test(t)&&!/^\d{6}\s\d{3}\s\d{1}$/.test(t))return!1;t=t.replace(/\s/g,"");var i=parseInt(t.substr(0,2),10)+1900,n=parseInt(t.substr(2,2),10),r=parseInt(t.substr(4,2),10);if(n>40?(i+=100,n-=40):n>20&&(i-=100,n-=20),!e.fn.bootstrapValidator.helpers.date(i,n,r))return!1;for(var a=0,o=[2,4,8,5,10,9,7,3,6],s=0;s<9;s++)a+=parseInt(t.charAt(s),10)*o[s];return(a=a%11%10)+""===t.substr(9,1)},_br:function(e){if(/^1{11}|2{11}|3{11}|4{11}|5{11}|6{11}|7{11}|8{11}|9{11}|0{11}$/.test(e))return!1;if(!/^\d{11}$/.test(e)&&!/^\d{3}\.\d{3}\.\d{3}-\d{2}$/.test(e))return!1;e=e.replace(/\./g,"").replace(/-/g,"");for(var t=0,i=0;i<9;i++)t+=(10-i)*parseInt(e.charAt(i),10);if(t=11-t%11,10!==t&&11!==t||(t=0),t+""!==e.charAt(9))return!1;var n=0;for(i=0;i<10;i++)n+=(11-i)*parseInt(e.charAt(i),10);return n=11-n%11,10!==n&&11!==n||(n=0),n+""===e.charAt(10)},_ch:function(e){if(!/^756[\.]{0,1}[0-9]{4}[\.]{0,1}[0-9]{4}[\.]{0,1}[0-9]{2}$/.test(e))return!1;e=e.replace(/\D/g,"").substr(3);for(var t=e.length,i=0,n=8===t?[3,1]:[1,3],r=0;r<t-1;r++)i+=parseInt(e.charAt(r),10)*n[r%2];return(i=10-i%10)+""===e.charAt(t-1)},_cl:function(e){if(!/^\d{7,8}[-]{0,1}[0-9K]$/i.test(e))return!1;for(e=e.replace(/\-/g,"");e.length<9;)e="0"+e;for(var t=0,i=[3,2,7,6,5,4,3,2],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return t=11-t%11,11===t?t=0:10===t&&(t="K"),t+""===e.charAt(8).toUpperCase()},_cn:function(t){if(t=t.trim(),!/^\d{15}$/.test(t)&&!/^\d{17}[\dXx]{1}$/.test(t))return!1;var i={11:{0:[0],1:[[0,9],[11,17]],2:[0,28,29]},12:{0:[0],1:[[0,16]],2:[0,21,23,25]},13:{0:[0],1:[[0,5],7,8,21,[23,33],[81,85]],2:[[0,5],[7,9],[23,25],27,29,30,81,83],3:[[0,4],[21,24]],4:[[0,4],6,21,[23,35],81],5:[[0,3],[21,35],81,82],6:[[0,4],[21,38],[81,84]],7:[[0,3],5,6,[21,33]],8:[[0,4],[21,28]],9:[[0,3],[21,30],[81,84]],10:[[0,3],[22,26],28,81,82],11:[[0,2],[21,28],81,82]},14:{0:[0],1:[0,1,[5,10],[21,23],81],2:[[0,3],11,12,[21,27]],3:[[0,3],11,21,22],4:[[0,2],11,21,[23,31],81],5:[[0,2],21,22,24,25,81],6:[[0,3],[21,24]],7:[[0,2],[21,29],81],8:[[0,2],[21,30],81,82],9:[[0,2],[21,32],81],10:[[0,2],[21,34],81,82],11:[[0,2],[21,30],81,82],23:[[0,3],22,23,[25,30],32,33]},15:{0:[0],1:[[0,5],[21,25]],2:[[0,7],[21,23]],3:[[0,4]],4:[[0,4],[21,26],[28,30]],5:[[0,2],[21,26],81],6:[[0,2],[21,27]],7:[[0,3],[21,27],[81,85]],8:[[0,2],[21,26]],9:[[0,2],[21,29],81],22:[[0,2],[21,24]],25:[[0,2],[22,31]],26:[[0,2],[24,27],[29,32],34],28:[0,1,[22,27]],29:[0,[21,23]]},21:{0:[0],1:[[0,6],[11,14],[22,24],81],2:[[0,4],[11,13],24,[81,83]],3:[[0,4],11,21,23,81],4:[[0,4],11,[21,23]],5:[[0,5],21,22],6:[[0,4],24,81,82],7:[[0,3],11,26,27,81,82],8:[[0,4],11,81,82],9:[[0,5],11,21,22],10:[[0,5],11,21,81],11:[[0,3],21,22],12:[[0,2],4,21,23,24,81,82],13:[[0,3],21,22,24,81,82],14:[[0,4],21,22,81]},22:{0:[0],1:[[0,6],12,22,[81,83]],2:[[0,4],11,21,[81,84]],3:[[0,3],22,23,81,82],4:[[0,3],21,22],5:[[0,3],21,23,24,81,82],6:[[0,2],4,5,[21,23],25,81],7:[[0,2],[21,24],81],8:[[0,2],21,22,81,82],24:[[0,6],24,26]},23:{0:[0],1:[[0,12],21,[23,29],[81,84]],2:[[0,8],21,[23,25],27,[29,31],81],3:[[0,7],21,81,82],4:[[0,7],21,22],5:[[0,3],5,6,[21,24]],6:[[0,6],[21,24]],7:[[0,16],22,81],8:[[0,5],11,22,26,28,33,81,82],9:[[0,4],21],10:[[0,5],24,25,81,[83,85]],11:[[0,2],21,23,24,81,82],12:[[0,2],[21,26],[81,83]],27:[[0,4],[21,23]]},31:{0:[0],1:[0,1,[3,10],[12,20]],2:[0,30]},32:{0:[0],1:[[0,7],11,[13,18],24,25],2:[[0,6],11,81,82],3:[[0,5],11,12,[21,24],81,82],4:[[0,2],4,5,11,12,81,82],5:[[0,9],[81,85]],6:[[0,2],11,12,21,23,[81,84]],7:[0,1,3,5,6,[21,24]],8:[[0,4],11,26,[29,31]],9:[[0,3],[21,25],28,81,82],10:[[0,3],11,12,23,81,84,88],11:[[0,2],11,12,[81,83]],12:[[0,4],[81,84]],13:[[0,2],11,[21,24]]},33:{0:[0],1:[[0,6],[8,10],22,27,82,83,85],2:[0,1,[3,6],11,12,25,26,[81,83]],3:[[0,4],22,24,[26,29],81,82],4:[[0,2],11,21,24,[81,83]],5:[[0,3],[21,23]],6:[[0,2],21,24,[81,83]],7:[[0,3],23,26,27,[81,84]],8:[[0,3],22,24,25,81],
|
||
9:[[0,3],21,22],10:[[0,4],[21,24],81,82],11:[[0,2],[21,27],81]},34:{0:[0],1:[[0,4],11,[21,24],81],2:[[0,4],7,8,[21,23],25],3:[[0,4],11,[21,23]],4:[[0,6],21],5:[[0,4],6,[21,23]],6:[[0,4],21],7:[[0,3],11,21],8:[[0,3],11,[22,28],81],10:[[0,4],[21,24]],11:[[0,3],22,[24,26],81,82],12:[[0,4],21,22,25,26,82],13:[[0,2],[21,24]],14:[[0,2],[21,24]],15:[[0,3],[21,25]],16:[[0,2],[21,23]],17:[[0,2],[21,23]],18:[[0,2],[21,25],81]},35:{0:[0],1:[[0,5],11,[21,25],28,81,82],2:[[0,6],[11,13]],3:[[0,5],22],4:[[0,3],21,[23,30],81],5:[[0,5],21,[24,27],[81,83]],6:[[0,3],[22,29],81],7:[[0,2],[21,25],[81,84]],8:[[0,2],[21,25],81],9:[[0,2],[21,26],81,82]},36:{0:[0],1:[[0,5],11,[21,24]],2:[[0,3],22,81],3:[[0,2],13,[21,23]],4:[[0,3],21,[23,30],81,82],5:[[0,2],21],6:[[0,2],22,81],7:[[0,2],[21,35],81,82],8:[[0,3],[21,30],81],9:[[0,2],[21,26],[81,83]],10:[[0,2],[21,30]],11:[[0,2],[21,30],81]},37:{0:[0],1:[[0,5],12,13,[24,26],81],2:[[0,3],5,[11,14],[81,85]],3:[[0,6],[21,23]],4:[[0,6],81],5:[[0,3],[21,23]],6:[[0,2],[11,13],34,[81,87]],7:[[0,5],24,25,[81,86]],8:[[0,2],11,[26,32],[81,83]],9:[[0,3],11,21,23,82,83],10:[[0,2],[81,83]],11:[[0,3],21,22],12:[[0,3]],13:[[0,2],11,12,[21,29]],14:[[0,2],[21,28],81,82],15:[[0,2],[21,26],81],16:[[0,2],[21,26]],17:[[0,2],[21,28]]},41:{0:[0],1:[[0,6],8,22,[81,85]],2:[[0,5],11,[21,25]],3:[[0,7],11,[22,29],81],4:[[0,4],11,[21,23],25,81,82],5:[[0,3],5,6,22,23,26,27,81],6:[[0,3],11,21,22],7:[[0,4],11,21,[24,28],81,82],8:[[0,4],11,[21,23],25,[81,83]],9:[[0,2],22,23,[26,28]],10:[[0,2],[23,25],81,82],11:[[0,4],[21,23]],12:[[0,2],21,22,24,81,82],13:[[0,3],[21,30],81],14:[[0,3],[21,26],81],15:[[0,3],[21,28]],16:[[0,2],[21,28],81],17:[[0,2],[21,29]],90:[0,1]},42:{0:[0],1:[[0,7],[11,17]],2:[[0,5],22,81],3:[[0,3],[21,25],81],5:[[0,6],[25,29],[81,83]],6:[[0,2],6,7,[24,26],[82,84]],7:[[0,4]],8:[[0,2],4,21,22,81],9:[[0,2],[21,23],81,82,84],10:[[0,3],[22,24],81,83,87],11:[[0,2],[21,27],81,82],12:[[0,2],[21,24],81],13:[[0,3],21,81],28:[[0,2],22,23,[25,28]],90:[0,[4,6],21]},43:{0:[0],1:[[0,5],11,12,21,22,24,81],2:[[0,4],11,21,[23,25],81],3:[[0,2],4,21,81,82],4:[0,1,[5,8],12,[21,24],26,81,82],5:[[0,3],11,[21,25],[27,29],81],6:[[0,3],11,21,23,24,26,81,82],7:[[0,3],[21,26],81],8:[[0,2],11,21,22],9:[[0,3],[21,23],81],10:[[0,3],[21,28],81],11:[[0,3],[21,29]],12:[[0,2],[21,30],81],13:[[0,2],21,22,81,82],31:[0,1,[22,27],30]},44:{0:[0],1:[[0,7],[11,16],83,84],2:[[0,5],21,22,24,29,32,33,81,82],3:[0,1,[3,8]],4:[[0,4]],5:[0,1,[6,15],23,82,83],6:[0,1,[4,8]],7:[0,1,[3,5],81,[83,85]],8:[[0,4],11,23,25,[81,83]],9:[[0,3],23,[81,83]],12:[[0,3],[23,26],83,84],13:[[0,3],[22,24],81],14:[[0,2],[21,24],26,27,81],15:[[0,2],21,23,81],16:[[0,2],[21,25]],17:[[0,2],21,23,81],18:[[0,3],21,23,[25,27],81,82],19:[0],20:[0],51:[[0,3],21,22],52:[[0,3],21,22,24,81],53:[[0,2],[21,23],81]},45:{0:[0],1:[[0,9],[21,27]],2:[[0,5],[21,26]],3:[[0,5],11,12,[21,32]],4:[0,1,[3,6],11,[21,23],81],5:[[0,3],12,21],6:[[0,3],21,81],7:[[0,3],21,22],8:[[0,4],21,81],9:[[0,3],[21,24],81],10:[[0,2],[21,31]],11:[[0,2],[21,23]],12:[[0,2],[21,29],81],13:[[0,2],[21,24],81],14:[[0,2],[21,25],81]},46:{0:[0],1:[0,1,[5,8]],2:[0,1],3:[0,[21,23]],90:[[0,3],[5,7],[21,39]]},50:{0:[0],1:[[0,19]],2:[0,[22,38],[40,43]],3:[0,[81,84]]},51:{0:[0],1:[0,1,[4,8],[12,15],[21,24],29,31,32,[81,84]],3:[[0,4],11,21,22],4:[[0,3],11,21,22],5:[[0,4],21,22,24,25],6:[0,1,3,23,26,[81,83]],7:[0,1,3,4,[22,27],81],8:[[0,2],11,12,[21,24]],9:[[0,4],[21,23]],10:[[0,2],11,24,25,28],11:[[0,2],[11,13],23,24,26,29,32,33,81],13:[[0,4],[21,25],81],14:[[0,2],[21,25]],15:[[0,3],[21,29]],16:[[0,3],[21,23],81],17:[[0,3],[21,25],81],18:[[0,3],[21,27]],19:[[0,3],[21,23]],20:[[0,2],21,22,81],32:[0,[21,33]],33:[0,[21,38]],34:[0,1,[22,37]]},52:{0:[0],1:[[0,3],[11,15],[21,23],81],2:[0,1,3,21,22],3:[[0,3],[21,30],81,82],4:[[0,2],[21,25]],5:[[0,2],[21,27]],6:[[0,3],[21,28]],22:[0,1,[22,30]],23:[0,1,[22,28]],24:[0,1,[22,28]],26:[0,1,[22,36]],27:[[0,2],22,23,[25,32]]},53:{0:[0],1:[[0,3],[11,14],21,22,[24,29],81],3:[[0,2],[21,26],28,81],4:[[0,2],[21,28]],5:[[0,2],[21,24]],6:[[0,2],[21,30]],7:[[0,2],[21,24]],8:[[0,2],[21,29]],9:[[0,2],[21,27]],23:[0,1,[22,29],31],25:[[0,4],[22,32]],26:[0,1,[21,28]],27:[0,1,[22,30]],28:[0,1,22,23],29:[0,1,[22,32]],31:[0,2,3,[22,24]],34:[0,[21,23]],33:[0,21,[23,25]],35:[0,[21,28]]},54:{0:[0],1:[[0,2],[21,27]],21:[0,[21,29],32,33],22:[0,[21,29],[31,33]],23:[0,1,[22,38]],24:[0,[21,31]],25:[0,[21,27]],26:[0,[21,27]]},61:{0:[0],1:[[0,4],[11,16],22,[24,26]],2:[[0,4],22],3:[[0,4],[21,24],[26,31]],4:[[0,4],[22,31],81],5:[[0,2],[21,28],81,82],6:[[0,2],[21,32]],7:[[0,2],[21,30]],8:[[0,2],[21,31]],9:[[0,2],[21,29]],10:[[0,2],[21,26]]},62:{0:[0],1:[[0,5],11,[21,23]],2:[0,1],3:[[0,2],21],4:[[0,3],[21,23]],5:[[0,3],[21,25]],6:[[0,2],[21,23]],7:[[0,2],[21,25]],8:[[0,2],[21,26]],9:[[0,2],[21,24],81,82],10:[[0,2],[21,27]],11:[[0,2],[21,26]],12:[[0,2],[21,28]],24:[0,21,[24,29]],26:[0,21,[23,30]],29:[0,1,[21,27]],30:[0,1,[21,27]]},63:{0:[0],1:[[0,5],[21,23]],2:[0,2,[21,25]],21:[0,[21,23],[26,28]],22:[0,[21,24]],23:[0,[21,24]],25:[0,[21,25]],26:[0,[21,26]],27:[0,1,[21,26]],28:[[0,2],[21,23]]},64:{0:[0],1:[0,1,[4,6],21,22,81],2:[[0,3],5,[21,23]],3:[[0,3],[21,24],81],4:[[0,2],[21,25]],5:[[0,2],21,22]},65:{0:[0],1:[[0,9],21],2:[[0,5]],21:[0,1,22,23],22:[0,1,22,23],23:[[0,3],[23,25],27,28],28:[0,1,[22,29]],29:[0,1,[22,29]],30:[0,1,[22,24]],31:[0,1,[21,31]],32:[0,1,[21,27]],40:[0,2,3,[21,28]],42:[[0,2],21,[23,26]],43:[0,1,[21,26]],90:[[0,4]],27:[[0,2],22,23]},71:{0:[0]},81:{0:[0]},82:{0:[0]}},n=parseInt(t.substr(0,2),10),r=parseInt(t.substr(2,2),10),a=parseInt(t.substr(4,2),10);if(!i[n]||!i[n][r])return!1;for(var o=!1,s=i[n][r],l=0;l<s.length;l++)if(e.isArray(s[l])&&s[l][0]<=a&&a<=s[l][1]||!e.isArray(s[l])&&a===s[l]){o=!0;break}if(!o)return!1;var c;c=18===t.length?t.substr(6,8):"19"+t.substr(6,6);var u=parseInt(c.substr(0,4),10),d=parseInt(c.substr(4,2),10),h=parseInt(c.substr(6,2),10);if(!e.fn.bootstrapValidator.helpers.date(u,d,h))return!1;if(18===t.length){var p=0,f=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2];for(l=0;l<17;l++)p+=parseInt(t.charAt(l),10)*f[l];p=(12-p%11)%11;return("X"!==t.charAt(17).toUpperCase()?parseInt(t.charAt(17),10):10)===p}return!0},_cz:function(t){if(!/^\d{9,10}$/.test(t))return!1;var i=1900+parseInt(t.substr(0,2),10),n=parseInt(t.substr(2,2),10)%50%20,r=parseInt(t.substr(4,2),10);if(9===t.length){if(i>=1980&&(i-=100),i>1953)return!1}else i<1954&&(i+=100);if(!e.fn.bootstrapValidator.helpers.date(i,n,r))return!1;if(10===t.length){var a=parseInt(t.substr(0,9),10)%11;return i<1985&&(a%=10),a+""===t.substr(9,1)}return!0},_dk:function(t){if(!/^[0-9]{6}[-]{0,1}[0-9]{4}$/.test(t))return!1;t=t.replace(/-/g,"");var i=parseInt(t.substr(0,2),10),n=parseInt(t.substr(2,2),10),r=parseInt(t.substr(4,2),10);switch(!0){case-1!=="5678".indexOf(t.charAt(6))&&r>=58:r+=1800;break;case-1!=="0123".indexOf(t.charAt(6)):case-1!=="49".indexOf(t.charAt(6))&&r>=37:r+=1900;break;default:r+=2e3}return e.fn.bootstrapValidator.helpers.date(r,n,i)},_ee:function(e){return this._lt(e)},_es:function(e){if(!/^[0-9A-Z]{8}[-]{0,1}[0-9A-Z]$/.test(e)&&!/^[XYZ][-]{0,1}[0-9]{7}[-]{0,1}[0-9A-Z]$/.test(e))return!1;e=e.replace(/-/g,"");var t="XYZ".indexOf(e.charAt(0));-1!==t&&(e=t+e.substr(1)+"");var i=parseInt(e.substr(0,8),10);return(i="TRWAGMYFPDXBNJZSQVHLCKE"[i%23])===e.substr(8,1)},_fi:function(t){if(!/^[0-9]{6}[-+A][0-9]{3}[0-9ABCDEFHJKLMNPRSTUVWXY]$/.test(t))return!1;var i=parseInt(t.substr(0,2),10),n=parseInt(t.substr(2,2),10),r=parseInt(t.substr(4,2),10);if(r={"+":1800,"-":1900,A:2e3}[t.charAt(6)]+r,!e.fn.bootstrapValidator.helpers.date(r,n,i))return!1;if(parseInt(t.substr(7,3),10)<2)return!1;var a=t.substr(0,6)+t.substr(7,3)+"";return a=parseInt(a,10),"0123456789ABCDEFHJKLMNPRSTUVWXY".charAt(a%31)===t.charAt(10)},_hr:function(t){return!!/^[0-9]{11}$/.test(t)&&e.fn.bootstrapValidator.helpers.mod11And10(t)},_ie:function(e){if(!/^\d{7}[A-W][AHWTX]?$/.test(e))return!1;var t=function(e){for(;e.length<7;)e="0"+e;for(var t="WABCDEFGHIJKLMNOPQRSTUV",i=0,n=0;n<7;n++)i+=parseInt(e.charAt(n),10)*(8-n);return i+=9*t.indexOf(e.substr(7)),t[i%23]};return 9!==e.length||"A"!==e.charAt(8)&&"H"!==e.charAt(8)?e.charAt(7)===t(e.substr(0,7)):e.charAt(7)===t(e.substr(0,7)+e.substr(8)+"")},_is:function(t){if(!/^[0-9]{6}[-]{0,1}[0-9]{4}$/.test(t))return!1;t=t.replace(/-/g,"");var i=parseInt(t.substr(0,2),10),n=parseInt(t.substr(2,2),10),r=parseInt(t.substr(4,2),10),a=parseInt(t.charAt(9),10);if(r=9===a?1900+r:100*(20+a)+r,!e.fn.bootstrapValidator.helpers.date(r,n,i,!0))return!1;for(var o=0,s=[3,2,7,6,5,4,3,2],l=0;l<8;l++)o+=parseInt(t.charAt(l),10)*s[l];return(o=11-o%11)+""===t.charAt(8)},_lt:function(t){if(!/^[0-9]{11}$/.test(t))return!1;var i=parseInt(t.charAt(0),10),n=parseInt(t.substr(1,2),10),r=parseInt(t.substr(3,2),10),a=parseInt(t.substr(5,2),10);if(n=100*(i%2==0?17+i/2:17+(i+1)/2)+n,!e.fn.bootstrapValidator.helpers.date(n,r,a,!0))return!1;for(var o=0,s=[1,2,3,4,5,6,7,8,9,1],l=0;l<10;l++)o+=parseInt(t.charAt(l),10)*s[l];if(10!==(o%=11))return o+""===t.charAt(10);for(o=0,s=[3,4,5,6,7,8,9,1,2,3],l=0;l<10;l++)o+=parseInt(t.charAt(l),10)*s[l];return o%=11,10===o&&(o=0),o+""===t.charAt(10)},_lv:function(t){if(!/^[0-9]{6}[-]{0,1}[0-9]{5}$/.test(t))return!1;t=t.replace(/\D/g,"");var i=parseInt(t.substr(0,2),10),n=parseInt(t.substr(2,2),10),r=parseInt(t.substr(4,2),10);if(r=r+1800+100*parseInt(t.charAt(6),10),!e.fn.bootstrapValidator.helpers.date(r,n,i,!0))return!1;for(var a=0,o=[10,5,8,4,2,1,6,3,7,9],s=0;s<10;s++)a+=parseInt(t.charAt(s),10)*o[s];return(a=(a+1)%11%10)+""===t.charAt(10)},_nl:function(e){for(;e.length<9;)e="0"+e;if(!/^[0-9]{4}[.]{0,1}[0-9]{2}[.]{0,1}[0-9]{3}$/.test(e))return!1;if(e=e.replace(/\./g,""),0===parseInt(e,10))return!1;for(var t=0,i=e.length,n=0;n<i-1;n++)t+=(9-n)*parseInt(e.charAt(n),10);return t%=11,10===t&&(t=0),t+""===e.charAt(i-1)},_ro:function(t){if(!/^[0-9]{13}$/.test(t))return!1;var i=parseInt(t.charAt(0),10);if(0===i||7===i||8===i)return!1;var n=parseInt(t.substr(1,2),10),r=parseInt(t.substr(3,2),10),a=parseInt(t.substr(5,2),10),o={1:1900,2:1900,3:1800,4:1800,5:2e3,6:2e3};if(a>31&&r>12)return!1;if(9!==i&&(n=o[i+""]+n,!e.fn.bootstrapValidator.helpers.date(n,r,a)))return!1;for(var s=0,l=[2,7,9,1,4,6,3,5,8,2,7,9],c=t.length,u=0;u<c-1;u++)s+=parseInt(t.charAt(u),10)*l[u];return s%=11,10===s&&(s=1),s+""===t.charAt(c-1)},_se:function(t){if(!/^[0-9]{10}$/.test(t)&&!/^[0-9]{6}[-|+][0-9]{4}$/.test(t))return!1;t=t.replace(/[^0-9]/g,"");var i=parseInt(t.substr(0,2),10)+1900,n=parseInt(t.substr(2,2),10),r=parseInt(t.substr(4,2),10);return!!e.fn.bootstrapValidator.helpers.date(i,n,r)&&e.fn.bootstrapValidator.helpers.luhn(t)},_sk:function(e){return this._cz(e)},_sm:function(e){return/^\d{5}$/.test(e)},_th:function(e){if(13!==e.length)return!1;for(var t=0,i=0;i<12;i++)t+=parseInt(e.charAt(i),10)*(13-i);return(11-t%11)%10===parseInt(e.charAt(12),10)},_za:function(t){if(!/^[0-9]{10}[0|1][8|9][0-9]$/.test(t))return!1;var i=parseInt(t.substr(0,2),10),n=(new Date).getFullYear()%100,r=parseInt(t.substr(2,2),10),a=parseInt(t.substr(4,2),10);return i=i>=n?i+1900:i+2e3,!!e.fn.bootstrapValidator.helpers.date(i,r,a)&&e.fn.bootstrapValidator.helpers.luhn(t)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.identical=e.extend(e.fn.bootstrapValidator.i18n.identical||{},{default:"Please enter the same value"}),e.fn.bootstrapValidator.validators.identical={html5Attributes:{message:"message",field:"field"},validate:function(e,t,i){var n=t.val();if(""===n)return!0;var r=e.getFieldElements(i.field);return null===r||0===r.length||n===r.val()&&(e.updateStatus(i.field,e.STATUS_VALID,"identical"),!0)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.imei=e.extend(e.fn.bootstrapValidator.i18n.imei||{},{default:"Please enter a valid IMEI number"}),e.fn.bootstrapValidator.validators.imei={validate:function(t,i,n){var r=i.val();if(""===r)return!0;switch(!0){case/^\d{15}$/.test(r):case/^\d{2}-\d{6}-\d{6}-\d{1}$/.test(r):case/^\d{2}\s\d{6}\s\d{6}\s\d{1}$/.test(r):return r=r.replace(/[^0-9]/g,""),e.fn.bootstrapValidator.helpers.luhn(r);case/^\d{14}$/.test(r):case/^\d{16}$/.test(r):case/^\d{2}-\d{6}-\d{6}(|-\d{2})$/.test(r):case/^\d{2}\s\d{6}\s\d{6}(|\s\d{2})$/.test(r):return!0;default:return!1}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.imo=e.extend(e.fn.bootstrapValidator.i18n.imo||{},{default:"Please enter a valid IMO number"}),e.fn.bootstrapValidator.validators.imo={validate:function(e,t,i){var n=t.val();if(""===n)return!0;if(!/^IMO \d{7}$/i.test(n))return!1;for(var r=0,a=n.replace(/^.*(\d{7})$/,"$1"),o=6;o>=1;o--)r+=a.slice(6-o,-o)*(o+1);return r%10===parseInt(a.charAt(6),10)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.integer=e.extend(e.fn.bootstrapValidator.i18n.integer||{},{default:"Please enter a valid number"}),e.fn.bootstrapValidator.validators.integer={enableByHtml5:function(e){return"number"===e.attr("type")&&(void 0===e.attr("step")||e.attr("step")%1==0)},validate:function(e,t,i){if(this.enableByHtml5(t)&&t.get(0).validity&&!0===t.get(0).validity.badInput)return!1;var n=t.val();return""===n||/^(?:-?(?:0|[1-9][0-9]*))$/.test(n)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.ip=e.extend(e.fn.bootstrapValidator.i18n.ip||{},{default:"Please enter a valid IP address",ipv4:"Please enter a valid IPv4 address",ipv6:"Please enter a valid IPv6 address"}),e.fn.bootstrapValidator.validators.ip={html5Attributes:{message:"message",ipv4:"ipv4",ipv6:"ipv6"},validate:function(t,i,n){var r=i.val();if(""===r)return!0;n=e.extend({},{ipv4:!0,ipv6:!0},n);var a,o=/^(?:(?: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]?)$/,s=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,l=!1;switch(!0){case n.ipv4&&!n.ipv6:l=o.test(r),a=n.message||e.fn.bootstrapValidator.i18n.ip.ipv4;break;case!n.ipv4&&n.ipv6:l=s.test(r),a=n.message||e.fn.bootstrapValidator.i18n.ip.ipv6;break;case n.ipv4&&n.ipv6:default:l=o.test(r)||s.test(r),a=n.message||e.fn.bootstrapValidator.i18n.ip.default}return{valid:l,message:a}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.isbn=e.extend(e.fn.bootstrapValidator.i18n.isbn||{},{default:"Please enter a valid ISBN number"}),e.fn.bootstrapValidator.validators.isbn={validate:function(e,t,i){var n=t.val();if(""===n)return!0;var r;switch(!0){case/^\d{9}[\dX]$/.test(n):case 13===n.length&&/^(\d+)-(\d+)-(\d+)-([\dX])$/.test(n):case 13===n.length&&/^(\d+)\s(\d+)\s(\d+)\s([\dX])$/.test(n):r="ISBN10";break;case/^(978|979)\d{9}[\dX]$/.test(n):case 17===n.length&&/^(978|979)-(\d+)-(\d+)-(\d+)-([\dX])$/.test(n):case 17===n.length&&/^(978|979)\s(\d+)\s(\d+)\s(\d+)\s([\dX])$/.test(n):r="ISBN13";break;default:return!1}n=n.replace(/[^0-9X]/gi,"");var a,o,s=n.split(""),l=s.length,c=0;switch(r){case"ISBN10":for(c=0,a=0;a<l-1;a++)c+=parseInt(s[a],10)*(10-a);return o=11-c%11,11===o?o=0:10===o&&(o="X"),o+""===s[l-1];case"ISBN13":for(c=0,a=0;a<l-1;a++)c+=a%2==0?parseInt(s[a],10):3*parseInt(s[a],10);return o=10-c%10,10===o&&(o="0"),o+""===s[l-1];default:return!1}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.isin=e.extend(e.fn.bootstrapValidator.i18n.isin||{},{default:"Please enter a valid ISIN number"}),e.fn.bootstrapValidator.validators.isin={COUNTRY_CODES:"AF|AX|AL|DZ|AS|AD|AO|AI|AQ|AG|AR|AM|AW|AU|AT|AZ|BS|BH|BD|BB|BY|BE|BZ|BJ|BM|BT|BO|BQ|BA|BW|BV|BR|IO|BN|BG|BF|BI|KH|CM|CA|CV|KY|CF|TD|CL|CN|CX|CC|CO|KM|CG|CD|CK|CR|CI|HR|CU|CW|CY|CZ|DK|DJ|DM|DO|EC|EG|SV|GQ|ER|EE|ET|FK|FO|FJ|FI|FR|GF|PF|TF|GA|GM|GE|DE|GH|GI|GR|GL|GD|GP|GU|GT|GG|GN|GW|GY|HT|HM|VA|HN|HK|HU|IS|IN|ID|IR|IQ|IE|IM|IL|IT|JM|JP|JE|JO|KZ|KE|KI|KP|KR|KW|KG|LA|LV|LB|LS|LR|LY|LI|LT|LU|MO|MK|MG|MW|MY|MV|ML|MT|MH|MQ|MR|MU|YT|MX|FM|MD|MC|MN|ME|MS|MA|MZ|MM|NA|NR|NP|NL|NC|NZ|NI|NE|NG|NU|NF|MP|NO|OM|PK|PW|PS|PA|PG|PY|PE|PH|PN|PL|PT|PR|QA|RE|RO|RU|RW|BL|SH|KN|LC|MF|PM|VC|WS|SM|ST|SA|SN|RS|SC|SL|SG|SX|SK|SI|SB|SO|ZA|GS|SS|ES|LK|SD|SR|SJ|SZ|SE|CH|SY|TW|TJ|TZ|TH|TL|TG|TK|TO|TT|TN|TR|TM|TC|TV|UG|UA|AE|GB|US|UM|UY|UZ|VU|VE|VN|VG|VI|WF|EH|YE|ZM|ZW",validate:function(e,t,i){var n=t.val();if(""===n)return!0;if(n=n.toUpperCase(),!new RegExp("^("+this.COUNTRY_CODES+")[0-9A-Z]{10}$").test(n))return!1;for(var r="",a=n.length,o=0;o<a-1;o++){var s=n.charCodeAt(o);r+=s>57?(s-55).toString():n.charAt(o)}var l="",c=r.length,u=c%2!=0?0:1;for(o=0;o<c;o++)l+=parseInt(r[o],10)*(o%2===u?2:1)+"";var d=0;for(o=0;o<l.length;o++)d+=parseInt(l.charAt(o),10);return(d=(10-d%10)%10)+""===n.charAt(a-1)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.ismn=e.extend(e.fn.bootstrapValidator.i18n.ismn||{},{default:"Please enter a valid ISMN number"}),e.fn.bootstrapValidator.validators.ismn={validate:function(e,t,i){var n=t.val();if(""===n)return!0;var r;switch(!0){case/^M\d{9}$/.test(n):case/^M-\d{4}-\d{4}-\d{1}$/.test(n):case/^M\s\d{4}\s\d{4}\s\d{1}$/.test(n):r="ISMN10";break;case/^9790\d{9}$/.test(n):case/^979-0-\d{4}-\d{4}-\d{1}$/.test(n):case/^979\s0\s\d{4}\s\d{4}\s\d{1}$/.test(n):r="ISMN13";break;default:return!1}"ISMN10"===r&&(n="9790"+n.substr(1)),n=n.replace(/[^0-9]/gi,"");for(var a=n.length,o=0,s=[1,3],l=0;l<a-1;l++)o+=parseInt(n.charAt(l),10)*s[l%2];return(o=10-o%10)+""===n.charAt(a-1)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.issn=e.extend(e.fn.bootstrapValidator.i18n.issn||{},{default:"Please enter a valid ISSN number"}),e.fn.bootstrapValidator.validators.issn={validate:function(e,t,i){var n=t.val();if(""===n)return!0;if(!/^\d{4}\-\d{3}[\dX]$/.test(n))return!1;n=n.replace(/[^0-9X]/gi,"");var r=n.split(""),a=r.length,o=0;"X"===r[7]&&(r[7]=10);for(var s=0;s<a;s++)o+=parseInt(r[s],10)*(8-s);return o%11==0}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.lessThan=e.extend(e.fn.bootstrapValidator.i18n.lessThan||{},{default:"Please enter a value less than or equal to %s",notInclusive:"Please enter a value less than %s"}),e.fn.bootstrapValidator.validators.lessThan={html5Attributes:{message:"message",value:"value",inclusive:"inclusive"},enableByHtml5:function(e){var t=e.attr("type"),i=e.attr("max");return!(!i||"date"===t)&&{value:i}},validate:function(t,i,n){var r=i.val();if(""===r)return!0;if(r=this._format(r),!e.isNumeric(r))return!1;var a=e.isNumeric(n.value)?n.value:t.getDynamicOption(i,n.value),o=this._format(a);return r=parseFloat(r),!0===n.inclusive||void 0===n.inclusive?{valid:r<=o,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.lessThan.default,a)}:{valid:r<o,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.lessThan.notInclusive,a)}},_format:function(e){return(e+"").replace(",",".")}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.mac=e.extend(e.fn.bootstrapValidator.i18n.mac||{},{default:"Please enter a valid MAC address"}),e.fn.bootstrapValidator.validators.mac={validate:function(e,t,i){var n=t.val();return""===n||/^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$/.test(n)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.meid=e.extend(e.fn.bootstrapValidator.i18n.meid||{},{default:"Please enter a valid MEID number"}),e.fn.bootstrapValidator.validators.meid={validate:function(t,i,n){var r=i.val();if(""===r)return!0;switch(!0){case/^[0-9A-F]{15}$/i.test(r):case/^[0-9A-F]{2}[- ][0-9A-F]{6}[- ][0-9A-F]{6}[- ][0-9A-F]$/i.test(r):case/^\d{19}$/.test(r):case/^\d{5}[- ]\d{5}[- ]\d{4}[- ]\d{4}[- ]\d$/.test(r):var a=r.charAt(r.length-1);if(r=r.replace(/[- ]/g,""),r.match(/^\d*$/i))return e.fn.bootstrapValidator.helpers.luhn(r);r=r.slice(0,-1);for(var o="",s=1;s<=13;s+=2)o+=(2*parseInt(r.charAt(s),16)).toString(16);var l=0;for(s=0;s<o.length;s++)l+=parseInt(o.charAt(s),16);return l%10==0?"0"===a:a===(2*(10*Math.floor((l+10)/10)-l)).toString(16);case/^[0-9A-F]{14}$/i.test(r):case/^[0-9A-F]{2}[- ][0-9A-F]{6}[- ][0-9A-F]{6}$/i.test(r):case/^\d{18}$/.test(r):case/^\d{5}[- ]\d{5}[- ]\d{4}[- ]\d{4}$/.test(r):return!0;default:return!1}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.notEmpty=e.extend(e.fn.bootstrapValidator.i18n.notEmpty||{},{default:"Please enter a value"}),e.fn.bootstrapValidator.validators.notEmpty={enableByHtml5:function(e){var t=e.attr("required")+"";return"required"===t||"true"===t},validate:function(t,i,n){var r=i.attr("type");return"radio"===r||"checkbox"===r?t.getFieldElements(i.attr("data-bv-field")).filter(":checked").length>0:!("number"!==r||!i.get(0).validity||!0!==i.get(0).validity.badInput)||""!==e.trim(i.val())}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.numeric=e.extend(e.fn.bootstrapValidator.i18n.numeric||{},{default:"Please enter a valid float number"}),e.fn.bootstrapValidator.validators.numeric={html5Attributes:{message:"message",separator:"separator"},enableByHtml5:function(e){return"number"===e.attr("type")&&void 0!==e.attr("step")&&e.attr("step")%1!=0},validate:function(e,t,i){if(this.enableByHtml5(t)&&t.get(0).validity&&!0===t.get(0).validity.badInput)return!1;var n=t.val();if(""===n)return!0;var r=i.separator||".";return"."!==r&&(n=n.replace(r,".")),!isNaN(parseFloat(n))&&isFinite(n)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.phone=e.extend(e.fn.bootstrapValidator.i18n.phone||{},{default:"Please enter a valid phone number",countryNotSupported:"The country code %s is not supported",country:"Please enter a valid phone number in %s",countries:{BR:"Brazil",CN:"China",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",ES:"Spain",FR:"France",GB:"United Kingdom",MA:"Morocco",PK:"Pakistan",RO:"Romania",RU:"Russia",SK:"Slovakia",TH:"Thailand",US:"USA",VE:"Venezuela"}}),e.fn.bootstrapValidator.validators.phone={html5Attributes:{message:"message",country:"country"},COUNTRY_CODES:["BR","CN","CZ","DE","DK","ES","FR","GB","MA","PK","RO","RU","SK","TH","US","VE"],validate:function(t,i,n){var r=i.val();if(""===r)return!0;var a=n.country;if("string"==typeof a&&-1!==e.inArray(a,this.COUNTRY_CODES)||(a=t.getDynamicOption(i,a)),!a||-1===e.inArray(a.toUpperCase(),this.COUNTRY_CODES))return{valid:!1,message:e.fn.bootstrapValidator.helpers.format(e.fn.bootstrapValidator.i18n.phone.countryNotSupported,a)};var o=!0;switch(a.toUpperCase()){case"BR":r=e.trim(r),o=/^(([\d]{4}[-.\s]{1}[\d]{2,3}[-.\s]{1}[\d]{2}[-.\s]{1}[\d]{2})|([\d]{4}[-.\s]{1}[\d]{3}[-.\s]{1}[\d]{4})|((\(?\+?[0-9]{2}\)?\s?)?(\(?\d{2}\)?\s?)?\d{4,5}[-.\s]?\d{4}))$/.test(r);break;case"CN":r=e.trim(r),o=/^((00|\+)?(86(?:-| )))?((\d{11})|(\d{3}[- ]{1}\d{4}[- ]{1}\d{4})|((\d{2,4}[- ]){1}(\d{7,8}|(\d{3,4}[- ]{1}\d{4}))([- ]{1}\d{1,4})?))$/.test(r);break;case"CZ":o=/^(((00)([- ]?)|\+)(420)([- ]?))?((\d{3})([- ]?)){2}(\d{3})$/.test(r);break;case"DE":r=e.trim(r),o=/^(((((((00|\+)49[ \-/]?)|0)[1-9][0-9]{1,4})[ \-/]?)|((((00|\+)49\()|\(0)[1-9][0-9]{1,4}\)[ \-/]?))[0-9]{1,7}([ \-/]?[0-9]{1,5})?)$/.test(r);break;case"DK":r=e.trim(r),o=/^(\+45|0045|\(45\))?\s?[2-9](\s?\d){7}$/.test(r);break;case"ES":r=e.trim(r),o=/^(?:(?:(?:\+|00)34\D?))?(?:9|6)(?:\d\D?){8}$/.test(r);break;case"FR":r=e.trim(r),o=/^(?:(?:(?:\+|00)33[ ]?(?:\(0\)[ ]?)?)|0){1}[1-9]{1}([ .-]?)(?:\d{2}\1?){3}\d{2}$/.test(r);break;case"GB":r=e.trim(r),o=/^\(?(?:(?:0(?:0|11)\)?[\s-]?\(?|\+)44\)?[\s-]?\(?(?:0\)?[\s-]?\(?)?|0)(?:\d{2}\)?[\s-]?\d{4}[\s-]?\d{4}|\d{3}\)?[\s-]?\d{3}[\s-]?\d{3,4}|\d{4}\)?[\s-]?(?:\d{5}|\d{3}[\s-]?\d{3})|\d{5}\)?[\s-]?\d{4,5}|8(?:00[\s-]?11[\s-]?11|45[\s-]?46[\s-]?4\d))(?:(?:[\s-]?(?:x|ext\.?\s?|\#)\d+)?)$/.test(r);break;case"MA":r=e.trim(r),o=/^(?:(?:(?:\+|00)212[\s]?(?:[\s]?\(0\)[\s]?)?)|0){1}(?:5[\s.-]?[2-3]|6[\s.-]?[13-9]){1}[0-9]{1}(?:[\s.-]?\d{2}){3}$/.test(r);break;case"PK":r=e.trim(r),o=/^0?3[0-9]{2}[0-9]{7}$/.test(r);break;case"RO":o=/^(\+4|)?(07[0-8]{1}[0-9]{1}|02[0-9]{2}|03[0-9]{2}){1}?(\s|\.|\-)?([0-9]{3}(\s|\.|\-|)){2}$/g.test(r);break;case"RU":o=/^((8|\+7|007)[\-\.\/ ]?)?([\(\/\.]?\d{3}[\)\/\.]?[\-\.\/ ]?)?[\d\-\.\/ ]{7,10}$/g.test(r);break;case"SK":o=/^(((00)([- ]?)|\+)(420)([- ]?))?((\d{3})([- ]?)){2}(\d{3})$/.test(r);break;case"TH":o=/^0\(?([6|8-9]{2})*-([0-9]{3})*-([0-9]{4})$/.test(r);break;case"VE":r=e.trim(r),o=/^0(?:2(?:12|4[0-9]|5[1-9]|6[0-9]|7[0-8]|8[1-35-8]|9[1-5]|3[45789])|4(?:1[246]|2[46]))\d{7}$/.test(r);break;case"US":default:r=r.replace(/\D/g,""),o=/^(?:(1\-?)|(\+1 ?))?\(?(\d{3})[\)\-\.]?(\d{3})[\-\.]?(\d{4})$/.test(r)&&10===r.length}return{valid:o,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.phone.country,e.fn.bootstrapValidator.i18n.phone.countries[a])}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.regexp=e.extend(e.fn.bootstrapValidator.i18n.regexp||{},{default:"Please enter a value matching the pattern"}),e.fn.bootstrapValidator.validators.regexp={html5Attributes:{message:"message",regexp:"regexp"},enableByHtml5:function(e){var t=e.attr("pattern");return!!t&&{regexp:t}},validate:function(e,t,i){var n=t.val();return""===n||("string"==typeof i.regexp?new RegExp(i.regexp):i.regexp).test(n)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.remote=e.extend(e.fn.bootstrapValidator.i18n.remote||{},{default:"Please enter a valid value"}),e.fn.bootstrapValidator.validators.remote={html5Attributes:{message:"message",name:"name",type:"type",url:"url",data:"data",delay:"delay"},destroy:function(e,t,i){t.data("bv.remote.timer")&&(clearTimeout(t.data("bv.remote.timer")),t.removeData("bv.remote.timer"))},validate:function(t,i,n){function r(){var t=e.ajax({type:u,headers:d,url:c,dataType:"json",data:l});return t.then(function(e){e.valid=!0===e.valid||"true"===e.valid,o.resolve(i,"remote",e)}),o.fail(function(){t.abort()}),o}var a=i.val(),o=new e.Deferred;if(""===a)return o.resolve(i,"remote",{valid:!0}),o;var s=i.attr("data-bv-field"),l=n.data||{},c=n.url,u=n.type||"GET",d=n.headers||{};return"function"==typeof l&&(l=l.call(this,t)),"string"==typeof l&&(l=JSON.parse(l)),"function"==typeof c&&(c=c.call(this,t)),l[n.name||s]=a,n.delay?(i.data("bv.remote.timer")&&clearTimeout(i.data("bv.remote.timer")),i.data("bv.remote.timer",setTimeout(r,n.delay)),o):r()}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.rtn=e.extend(e.fn.bootstrapValidator.i18n.rtn||{},{default:"Please enter a valid RTN number"}),e.fn.bootstrapValidator.validators.rtn={validate:function(e,t,i){var n=t.val();if(""===n)return!0;if(!/^\d{9}$/.test(n))return!1;for(var r=0,a=0;a<n.length;a+=3)r+=3*parseInt(n.charAt(a),10)+7*parseInt(n.charAt(a+1),10)+parseInt(n.charAt(a+2),10);return 0!==r&&r%10==0}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.sedol=e.extend(e.fn.bootstrapValidator.i18n.sedol||{},{default:"Please enter a valid SEDOL number"}),e.fn.bootstrapValidator.validators.sedol={validate:function(e,t,i){var n=t.val();if(""===n)return!0;if(n=n.toUpperCase(),!/^[0-9A-Z]{7}$/.test(n))return!1;for(var r=0,a=[1,3,1,7,3,9,1],o=n.length,s=0;s<o-1;s++)r+=a[s]*parseInt(n.charAt(s),36);return(r=(10-r%10)%10)+""===n.charAt(o-1)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.siren=e.extend(e.fn.bootstrapValidator.i18n.siren||{},{default:"Please enter a valid SIREN number"}),e.fn.bootstrapValidator.validators.siren={validate:function(t,i,n){var r=i.val();return""===r||!!/^\d{9}$/.test(r)&&e.fn.bootstrapValidator.helpers.luhn(r)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.siret=e.extend(e.fn.bootstrapValidator.i18n.siret||{},{default:"Please enter a valid SIRET number"}),e.fn.bootstrapValidator.validators.siret={validate:function(e,t,i){var n=t.val();if(""===n)return!0;for(var r,a=0,o=n.length,s=0;s<o;s++)r=parseInt(n.charAt(s),10),s%2==0&&(r*=2)>9&&(r-=9),a+=r;return a%10==0}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.step=e.extend(e.fn.bootstrapValidator.i18n.step||{},{default:"Please enter a valid step of %s"}),e.fn.bootstrapValidator.validators.step={html5Attributes:{message:"message",base:"baseValue",step:"step"},validate:function(t,i,n){var r=i.val();if(""===r)return!0;if(n=e.extend({},{baseValue:0,step:1},n),r=parseFloat(r),!e.isNumeric(r))return!1;var a=function(e,t){var i=Math.pow(10,t);e*=i;var n=e>0|-(e<0);return e%1==.5*n?(Math.floor(e)+(n>0))/i:Math.round(e)/i},o=function(e,t){if(0===t)return 1;var i=(e+"").split("."),n=(t+"").split("."),r=(1===i.length?0:i[1].length)+(1===n.length?0:n[1].length);return a(e-t*Math.floor(e/t),r)}(r-n.baseValue,n.step);return{valid:0===o||o===n.step,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.step.default,[n.step])}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.stringCase=e.extend(e.fn.bootstrapValidator.i18n.stringCase||{},{default:"Please enter only lowercase characters",upper:"Please enter only uppercase characters"}),e.fn.bootstrapValidator.validators.stringCase={html5Attributes:{message:"message",case:"case"},validate:function(t,i,n){var r=i.val();if(""===r)return!0;var a=(n.case||"lower").toLowerCase();return{valid:"upper"===a?r===r.toUpperCase():r===r.toLowerCase(),message:n.message||("upper"===a?e.fn.bootstrapValidator.i18n.stringCase.upper:e.fn.bootstrapValidator.i18n.stringCase.default)}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.stringLength=e.extend(e.fn.bootstrapValidator.i18n.stringLength||{},{default:"Please enter a value with valid length",less:"Please enter less than %s characters",more:"Please enter more than %s characters",between:"Please enter value between %s and %s characters long"}),e.fn.bootstrapValidator.validators.stringLength={html5Attributes:{message:"message",min:"min",max:"max",trim:"trim",utf8bytes:"utf8Bytes"},enableByHtml5:function(t){var i={},n=t.attr("maxlength"),r=t.attr("minlength");return n&&(i.max=parseInt(n,10)),r&&(i.min=parseInt(r,10)),!e.isEmptyObject(i)&&i},validate:function(t,i,n){var r=i.val();if(!0!==n.trim&&"true"!==n.trim||(r=e.trim(r)),""===r)return!0;var a=e.isNumeric(n.min)?n.min:t.getDynamicOption(i,n.min),o=e.isNumeric(n.max)?n.max:t.getDynamicOption(i,n.max),s=n.utf8Bytes?function(e){for(var t=e.length,i=e.length-1;i>=0;i--){var n=e.charCodeAt(i);n>127&&n<=2047?t++:n>2047&&n<=65535&&(t+=2),n>=56320&&n<=57343&&i--}return t}(r):r.length,l=!0,c=n.message||e.fn.bootstrapValidator.i18n.stringLength.default;switch((a&&s<parseInt(a,10)||o&&s>parseInt(o,10))&&(l=!1),!0){case!!a&&!!o:c=e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.stringLength.between,[parseInt(a,10),parseInt(o,10)]);break;case!!a:c=e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.stringLength.more,parseInt(a,10));break;case!!o:c=e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.stringLength.less,parseInt(o,10))}return{valid:l,message:c}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.uri=e.extend(e.fn.bootstrapValidator.i18n.uri||{},{default:"Please enter a valid URI"}),e.fn.bootstrapValidator.validators.uri={html5Attributes:{message:"message",allowlocal:"allowLocal",protocol:"protocol"},enableByHtml5:function(e){return"url"===e.attr("type")},validate:function(e,t,i){var n=t.val();if(""===n)return!0;var r=!0===i.allowLocal||"true"===i.allowLocal,a=(i.protocol||"http, https, ftp").split(",").join("|").replace(/\s/g,"")
|
||
;return new RegExp("^(?:(?:"+a+")://)(?:\\S+(?::\\S*)?@)?(?:"+(r?"":"(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})")+"(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))"+(r?"?":"")+")(?::\\d{2,5})?(?:/[^\\s]*)?$","i").test(n)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.uuid=e.extend(e.fn.bootstrapValidator.i18n.uuid||{},{default:"Please enter a valid UUID number",version:"Please enter a valid UUID version %s number"}),e.fn.bootstrapValidator.validators.uuid={html5Attributes:{message:"message",version:"version"},validate:function(t,i,n){var r=i.val();if(""===r)return!0;var a={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i},o=n.version?n.version+"":"all";return{valid:null===a[o]||a[o].test(r),message:n.version?e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.uuid.version,n.version):n.message||e.fn.bootstrapValidator.i18n.uuid.default}}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.vat=e.extend(e.fn.bootstrapValidator.i18n.vat||{},{default:"Please enter a valid VAT number",countryNotSupported:"The country code %s is not supported",country:"Please enter a valid VAT number in %s",countries:{AT:"Austria",BE:"Belgium",BG:"Bulgaria",BR:"Brazil",CH:"Switzerland",CY:"Cyprus",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",EE:"Estonia",ES:"Spain",FI:"Finland",FR:"France",GB:"United Kingdom",GR:"Greek",EL:"Greek",HU:"Hungary",HR:"Croatia",IE:"Ireland",IS:"Iceland",IT:"Italy",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MT:"Malta",NL:"Netherlands",NO:"Norway",PL:"Poland",PT:"Portugal",RO:"Romania",RU:"Russia",RS:"Serbia",SE:"Sweden",SI:"Slovenia",SK:"Slovakia",VE:"Venezuela",ZA:"South Africa"}}),e.fn.bootstrapValidator.validators.vat={html5Attributes:{message:"message",country:"country"},COUNTRY_CODES:["AT","BE","BG","BR","CH","CY","CZ","DE","DK","EE","EL","ES","FI","FR","GB","GR","HR","HU","IE","IS","IT","LT","LU","LV","MT","NL","NO","PL","PT","RO","RU","RS","SE","SK","SI","VE","ZA"],validate:function(t,i,n){var r=i.val();if(""===r)return!0;var a=n.country;return a?"string"==typeof a&&-1!==e.inArray(a.toUpperCase(),this.COUNTRY_CODES)||(a=t.getDynamicOption(i,a)):a=r.substr(0,2),-1===e.inArray(a,this.COUNTRY_CODES)?{valid:!1,message:e.fn.bootstrapValidator.helpers.format(e.fn.bootstrapValidator.i18n.vat.countryNotSupported,a)}:!!this[["_",a.toLowerCase()].join("")](r)||{valid:!1,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.vat.country,e.fn.bootstrapValidator.i18n.vat.countries[a.toUpperCase()])}},_at:function(e){if(/^ATU[0-9]{8}$/.test(e)&&(e=e.substr(2)),!/^U[0-9]{8}$/.test(e))return!1;e=e.substr(1);for(var t=0,i=[1,2,1,2,1,2,1],n=0,r=0;r<7;r++)n=parseInt(e.charAt(r),10)*i[r],n>9&&(n=Math.floor(n/10)+n%10),t+=n;return t=10-(t+4)%10,10===t&&(t=0),t+""===e.substr(7,1)},_be:function(e){return/^BE[0]{0,1}[0-9]{9}$/.test(e)&&(e=e.substr(2)),!!/^[0]{0,1}[0-9]{9}$/.test(e)&&(9===e.length&&(e="0"+e),"0"!==e.substr(1,1)&&(parseInt(e.substr(0,8),10)+parseInt(e.substr(8,2),10))%97==0)},_bg:function(t){if(/^BG[0-9]{9,10}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{9,10}$/.test(t))return!1;var i=0,n=0;if(9===t.length){for(n=0;n<8;n++)i+=parseInt(t.charAt(n),10)*(n+1);if(10===(i%=11))for(i=0,n=0;n<8;n++)i+=parseInt(t.charAt(n),10)*(n+3);return(i%=10)+""===t.substr(8)}if(10===t.length){return function(t){var i=parseInt(t.substr(0,2),10)+1900,n=parseInt(t.substr(2,2),10),r=parseInt(t.substr(4,2),10);if(n>40?(i+=100,n-=40):n>20&&(i-=100,n-=20),!e.fn.bootstrapValidator.helpers.date(i,n,r))return!1;for(var a=0,o=[2,4,8,5,10,9,7,3,6],s=0;s<9;s++)a+=parseInt(t.charAt(s),10)*o[s];return(a=a%11%10)+""===t.substr(9,1)}(t)||function(e){for(var t=0,i=[21,19,17,13,11,9,7,3,1],n=0;n<9;n++)t+=parseInt(e.charAt(n),10)*i[n];return(t%=10)+""===e.substr(9,1)}(t)||function(e){for(var t=0,i=[4,3,2,7,6,5,4,3,2],n=0;n<9;n++)t+=parseInt(e.charAt(n),10)*i[n];return 10!=(t=11-t%11)&&(11===t&&(t=0),t+""===e.substr(9,1))}(t)}return!1},_br:function(e){if(""===e)return!0;var t=e.replace(/[^\d]+/g,"");if(""===t||14!==t.length)return!1;if("00000000000000"===t||"11111111111111"===t||"22222222222222"===t||"33333333333333"===t||"44444444444444"===t||"55555555555555"===t||"66666666666666"===t||"77777777777777"===t||"88888888888888"===t||"99999999999999"===t)return!1;for(var i=t.length-2,n=t.substring(0,i),r=t.substring(i),a=0,o=i-7,s=i;s>=1;s--)a+=parseInt(n.charAt(i-s),10)*o--,o<2&&(o=9);var l=a%11<2?0:11-a%11;if(l!==parseInt(r.charAt(0),10))return!1;for(i+=1,n=t.substring(0,i),a=0,o=i-7,s=i;s>=1;s--)a+=parseInt(n.charAt(i-s),10)*o--,o<2&&(o=9);return(l=a%11<2?0:11-a%11)===parseInt(r.charAt(1),10)},_ch:function(e){if(/^CHE[0-9]{9}(MWST)?$/.test(e)&&(e=e.substr(2)),!/^E[0-9]{9}(MWST)?$/.test(e))return!1;e=e.substr(1);for(var t=0,i=[5,4,3,2,7,6,5,4],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return 10!=(t=11-t%11)&&(11===t&&(t=0),t+""===e.substr(8,1))},_cy:function(e){if(/^CY[0-5|9]{1}[0-9]{7}[A-Z]{1}$/.test(e)&&(e=e.substr(2)),!/^[0-5|9]{1}[0-9]{7}[A-Z]{1}$/.test(e))return!1;if("12"===e.substr(0,2))return!1;for(var t=0,i={0:1,1:0,2:5,3:7,4:9,5:13,6:15,7:17,8:19,9:21},n=0;n<8;n++){var r=parseInt(e.charAt(n),10);n%2==0&&(r=i[r+""]),t+=r}return(t="ABCDEFGHIJKLMNOPQRSTUVWXYZ"[t%26])+""===e.substr(8,1)},_cz:function(t){if(/^CZ[0-9]{8,10}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{8,10}$/.test(t))return!1;var i=0,n=0;if(8===t.length){if(t.charAt(0)+""=="9")return!1;for(i=0,n=0;n<7;n++)i+=parseInt(t.charAt(n),10)*(8-n);return i=11-i%11,10===i&&(i=0),11===i&&(i=1),i+""===t.substr(7,1)}if(9===t.length&&t.charAt(0)+""=="6"){for(i=0,n=0;n<7;n++)i+=parseInt(t.charAt(n+1),10)*(8-n);return i=11-i%11,10===i&&(i=0),11===i&&(i=1),(i=[8,7,6,5,4,3,2,1,0,9,10][i-1])+""===t.substr(8,1)}if(9===t.length||10===t.length){var r=1900+parseInt(t.substr(0,2),10),a=parseInt(t.substr(2,2),10)%50%20,o=parseInt(t.substr(4,2),10);if(9===t.length){if(r>=1980&&(r-=100),r>1953)return!1}else r<1954&&(r+=100);if(!e.fn.bootstrapValidator.helpers.date(r,a,o))return!1;if(10===t.length){var s=parseInt(t.substr(0,9),10)%11;return r<1985&&(s%=10),s+""===t.substr(9,1)}return!0}return!1},_de:function(t){return/^DE[0-9]{9}$/.test(t)&&(t=t.substr(2)),!!/^[0-9]{9}$/.test(t)&&e.fn.bootstrapValidator.helpers.mod11And10(t)},_dk:function(e){if(/^DK[0-9]{8}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{8}$/.test(e))return!1;for(var t=0,i=[2,7,6,5,4,3,2,1],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return t%11==0},_ee:function(e){if(/^EE[0-9]{9}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{9}$/.test(e))return!1;for(var t=0,i=[3,7,1,3,7,1,3,7,1],n=0;n<9;n++)t+=parseInt(e.charAt(n),10)*i[n];return t%10==0},_es:function(e){if(/^ES[0-9A-Z][0-9]{7}[0-9A-Z]$/.test(e)&&(e=e.substr(2)),!/^[0-9A-Z][0-9]{7}[0-9A-Z]$/.test(e))return!1;var t=e.charAt(0);return/^[0-9]$/.test(t)?function(e){var t=parseInt(e.substr(0,8),10);return(t="TRWAGMYFPDXBNJZSQVHLCKE"[t%23])+""===e.substr(8,1)}(e):/^[XYZ]$/.test(t)?function(e){var t=["XYZ".indexOf(e.charAt(0)),e.substr(1)].join("");return t=parseInt(t,10),(t="TRWAGMYFPDXBNJZSQVHLCKE"[t%23])+""===e.substr(8,1)}(e):function(e){var t,i=e.charAt(0);if(-1!=="KLM".indexOf(i))return t=parseInt(e.substr(1,8),10),(t="TRWAGMYFPDXBNJZSQVHLCKE"[t%23])+""===e.substr(8,1);if(-1!=="ABCDEFGHJNPQRSUVW".indexOf(i)){for(var n=0,r=[2,1,2,1,2,1,2],a=0,o=0;o<7;o++)a=parseInt(e.charAt(o+1),10)*r[o],a>9&&(a=Math.floor(a/10)+a%10),n+=a;return(n=10-n%10)+""===e.substr(8,1)||"JABCDEFGHI"[n]===e.substr(8,1)}return!1}(e)},_fi:function(e){if(/^FI[0-9]{8}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{8}$/.test(e))return!1;for(var t=0,i=[7,9,10,5,8,4,2,1],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return t%11==0},_fr:function(t){if(/^FR[0-9A-Z]{2}[0-9]{9}$/.test(t)&&(t=t.substr(2)),!/^[0-9A-Z]{2}[0-9]{9}$/.test(t))return!1;if(!e.fn.bootstrapValidator.helpers.luhn(t.substr(2)))return!1;if(/^[0-9]{2}$/.test(t.substr(0,2)))return t.substr(0,2)===parseInt(t.substr(2)+"12",10)%97+"";var i,n="0123456789ABCDEFGHJKLMNPQRSTUVWXYZ";return i=/^[0-9]{1}$/.test(t.charAt(0))?24*n.indexOf(t.charAt(0))+n.indexOf(t.charAt(1))-10:34*n.indexOf(t.charAt(0))+n.indexOf(t.charAt(1))-100,(parseInt(t.substr(2),10)+1+Math.floor(i/11))%11==i%11},_gb:function(e){if((/^GB[0-9]{9}$/.test(e)||/^GB[0-9]{12}$/.test(e)||/^GBGD[0-9]{3}$/.test(e)||/^GBHA[0-9]{3}$/.test(e)||/^GB(GD|HA)8888[0-9]{5}$/.test(e))&&(e=e.substr(2)),!(/^[0-9]{9}$/.test(e)||/^[0-9]{12}$/.test(e)||/^GD[0-9]{3}$/.test(e)||/^HA[0-9]{3}$/.test(e)||/^(GD|HA)8888[0-9]{5}$/.test(e)))return!1;var t=e.length;if(5===t){var i=e.substr(0,2),n=parseInt(e.substr(2),10);return"GD"===i&&n<500||"HA"===i&&n>=500}if(11===t&&("GD8888"===e.substr(0,6)||"HA8888"===e.substr(0,6)))return!("GD"===e.substr(0,2)&&parseInt(e.substr(6,3),10)>=500||"HA"===e.substr(0,2)&&parseInt(e.substr(6,3),10)<500)&&parseInt(e.substr(6,3),10)%97===parseInt(e.substr(9,2),10);if(9===t||12===t){for(var r=0,a=[8,7,6,5,4,3,2,10,1],o=0;o<9;o++)r+=parseInt(e.charAt(o),10)*a[o];return r%=97,parseInt(e.substr(0,3),10)>=100?0===r||42===r||55===r:0===r}return!0},_gr:function(e){if(/^(GR|EL)[0-9]{9}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{9}$/.test(e))return!1;8===e.length&&(e="0"+e);for(var t=0,i=[256,128,64,32,16,8,4,2],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return(t=t%11%10)+""===e.substr(8,1)},_el:function(e){return this._gr(e)},_hu:function(e){if(/^HU[0-9]{8}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{8}$/.test(e))return!1;for(var t=0,i=[9,7,3,1,9,7,3,1],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return t%10==0},_hr:function(t){return/^HR[0-9]{11}$/.test(t)&&(t=t.substr(2)),!!/^[0-9]{11}$/.test(t)&&e.fn.bootstrapValidator.helpers.mod11And10(t)},_ie:function(e){if(/^IE[0-9]{1}[0-9A-Z\*\+]{1}[0-9]{5}[A-Z]{1,2}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{1}[0-9A-Z\*\+]{1}[0-9]{5}[A-Z]{1,2}$/.test(e))return!1;var t=function(e){for(;e.length<7;)e="0"+e;for(var t="WABCDEFGHIJKLMNOPQRSTUV",i=0,n=0;n<7;n++)i+=parseInt(e.charAt(n),10)*(8-n);return i+=9*t.indexOf(e.substr(7)),t[i%23]};return/^[0-9]+$/.test(e.substr(0,7))?e.charAt(7)===t(e.substr(0,7)+e.substr(8)+""):-1==="ABCDEFGHIJKLMNOPQRSTUVWXYZ+*".indexOf(e.charAt(1))||e.charAt(7)===t(e.substr(2,5)+e.substr(0,1)+"")},_is:function(e){return/^IS[0-9]{5,6}$/.test(e)&&(e=e.substr(2)),/^[0-9]{5,6}$/.test(e)},_it:function(t){if(/^IT[0-9]{11}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{11}$/.test(t))return!1;if(0===parseInt(t.substr(0,7),10))return!1;var i=parseInt(t.substr(7,3),10);return!(i<1||i>201&&999!==i&&888!==i)&&e.fn.bootstrapValidator.helpers.luhn(t)},_lt:function(e){if(/^LT([0-9]{7}1[0-9]{1}|[0-9]{10}1[0-9]{1})$/.test(e)&&(e=e.substr(2)),!/^([0-9]{7}1[0-9]{1}|[0-9]{10}1[0-9]{1})$/.test(e))return!1;var t,i=e.length,n=0;for(t=0;t<i-1;t++)n+=parseInt(e.charAt(t),10)*(1+t%9);var r=n%11;if(10===r)for(n=0,t=0;t<i-1;t++)n+=parseInt(e.charAt(t),10)*(1+(t+2)%9);return(r=r%11%10)+""===e.charAt(i-1)},_lu:function(e){return/^LU[0-9]{8}$/.test(e)&&(e=e.substr(2)),!!/^[0-9]{8}$/.test(e)&&parseInt(e.substr(0,6),10)%89+""===e.substr(6,2)},_lv:function(t){if(/^LV[0-9]{11}$/.test(t)&&(t=t.substr(2)),!/^[0-9]{11}$/.test(t))return!1;var i,n=parseInt(t.charAt(0),10),r=0,a=[],o=t.length;if(n>3){for(r=0,a=[9,1,4,8,3,10,2,5,7,6,1],i=0;i<o;i++)r+=parseInt(t.charAt(i),10)*a[i];return 3===(r%=11)}var s=parseInt(t.substr(0,2),10),l=parseInt(t.substr(2,2),10),c=parseInt(t.substr(4,2),10);if(c=c+1800+100*parseInt(t.charAt(6),10),!e.fn.bootstrapValidator.helpers.date(c,l,s))return!1;for(r=0,a=[10,5,8,4,2,1,6,3,7,9],i=0;i<o-1;i++)r+=parseInt(t.charAt(i),10)*a[i];return(r=(r+1)%11%10)+""===t.charAt(o-1)},_mt:function(e){if(/^MT[0-9]{8}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{8}$/.test(e))return!1;for(var t=0,i=[3,4,6,7,8,9,10,1],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return t%37==0},_nl:function(e){if(/^NL[0-9]{9}B[0-9]{2}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{9}B[0-9]{2}$/.test(e))return!1;for(var t=0,i=[9,8,7,6,5,4,3,2],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return t%=11,t>9&&(t=0),t+""===e.substr(8,1)},_no:function(e){if(/^NO[0-9]{9}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{9}$/.test(e))return!1;for(var t=0,i=[3,2,7,6,5,4,3,2],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return t=11-t%11,11===t&&(t=0),t+""===e.substr(8,1)},_pl:function(e){if(/^PL[0-9]{10}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{10}$/.test(e))return!1;for(var t=0,i=[6,5,7,2,3,4,5,6,7,-1],n=0;n<10;n++)t+=parseInt(e.charAt(n),10)*i[n];return t%11==0},_pt:function(e){if(/^PT[0-9]{9}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{9}$/.test(e))return!1;for(var t=0,i=[9,8,7,6,5,4,3,2],n=0;n<8;n++)t+=parseInt(e.charAt(n),10)*i[n];return t=11-t%11,t>9&&(t=0),t+""===e.substr(8,1)},_ro:function(e){if(/^RO[1-9][0-9]{1,9}$/.test(e)&&(e=e.substr(2)),!/^[1-9][0-9]{1,9}$/.test(e))return!1;for(var t=e.length,i=[7,5,3,2,1,7,5,3,2].slice(10-t),n=0,r=0;r<t-1;r++)n+=parseInt(e.charAt(r),10)*i[r];return(n=10*n%11%10)+""===e.substr(t-1,1)},_ru:function(e){if(/^RU([0-9]{10}|[0-9]{12})$/.test(e)&&(e=e.substr(2)),!/^([0-9]{10}|[0-9]{12})$/.test(e))return!1;var t=0;if(10===e.length){var i=0,n=[2,4,10,3,5,9,4,6,8,0];for(t=0;t<10;t++)i+=parseInt(e.charAt(t),10)*n[t];return i%=11,i>9&&(i%=10),i+""===e.substr(9,1)}if(12===e.length){var r=0,a=[7,2,4,10,3,5,9,4,6,8,0],o=0,s=[3,7,2,4,10,3,5,9,4,6,8,0];for(t=0;t<11;t++)r+=parseInt(e.charAt(t),10)*a[t],o+=parseInt(e.charAt(t),10)*s[t];return r%=11,r>9&&(r%=10),o%=11,o>9&&(o%=10),r+""===e.substr(10,1)&&o+""===e.substr(11,1)}return!1},_rs:function(e){if(/^RS[0-9]{9}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{9}$/.test(e))return!1;for(var t=10,i=0,n=0;n<8;n++)i=(parseInt(e.charAt(n),10)+t)%10,0===i&&(i=10),t=2*i%11;return(t+parseInt(e.substr(8,1),10))%10==1},_se:function(t){return/^SE[0-9]{10}01$/.test(t)&&(t=t.substr(2)),!!/^[0-9]{10}01$/.test(t)&&(t=t.substr(0,10),e.fn.bootstrapValidator.helpers.luhn(t))},_si:function(e){if(/^SI[0-9]{8}$/.test(e)&&(e=e.substr(2)),!/^[0-9]{8}$/.test(e))return!1;for(var t=0,i=[8,7,6,5,4,3,2],n=0;n<7;n++)t+=parseInt(e.charAt(n),10)*i[n];return t=11-t%11,10===t&&(t=0),t+""===e.substr(7,1)},_sk:function(e){return/^SK[1-9][0-9][(2-4)|(6-9)][0-9]{7}$/.test(e)&&(e=e.substr(2)),!!/^[1-9][0-9][(2-4)|(6-9)][0-9]{7}$/.test(e)&&parseInt(e,10)%11==0},_ve:function(e){if(/^VE[VEJPG][0-9]{9}$/.test(e)&&(e=e.substr(2)),!/^[VEJPG][0-9]{9}$/.test(e))return!1;for(var t={V:4,E:8,J:12,P:16,G:20},i=t[e.charAt(0)],n=[3,2,7,6,5,4,3,2],r=0;r<8;r++)i+=parseInt(e.charAt(r+1),10)*n[r];return i=11-i%11,11!==i&&10!==i||(i=0),i+""===e.substr(9,1)},_za:function(e){return/^ZA4[0-9]{9}$/.test(e)&&(e=e.substr(2)),/^4[0-9]{9}$/.test(e)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.vin=e.extend(e.fn.bootstrapValidator.i18n.vin||{},{default:"Please enter a valid VIN number"}),e.fn.bootstrapValidator.validators.vin={validate:function(e,t,i){var n=t.val();if(""===n)return!0;if(!/^[a-hj-npr-z0-9]{8}[0-9xX][a-hj-npr-z0-9]{8}$/i.test(n))return!1;n=n.toUpperCase();for(var r={A:1,B:2,C:3,D:4,E:5,F:6,G:7,H:8,J:1,K:2,L:3,M:4,N:5,P:7,R:9,S:2,T:3,U:4,V:5,W:6,X:7,Y:8,Z:9,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,0:0},a=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],o=0,s=n.length,l=0;l<s;l++)o+=r[n.charAt(l)+""]*a[l];var c=o%11;return 10===c&&(c="X"),c+""===n.charAt(8)}}}(window.jQuery),function(e){e.fn.bootstrapValidator.i18n.zipCode=e.extend(e.fn.bootstrapValidator.i18n.zipCode||{},{default:"Please enter a valid postal code",countryNotSupported:"The country code %s is not supported",country:"Please enter a valid postal code in %s",countries:{AT:"Austria",BR:"Brazil",CA:"Canada",CH:"Switzerland",CZ:"Czech Republic",DE:"Germany",DK:"Denmark",FR:"France",GB:"United Kingdom",IE:"Ireland",IT:"Italy",MA:"Morocco",NL:"Netherlands",PT:"Portugal",RO:"Romania",RU:"Russia",SE:"Sweden",SG:"Singapore",SK:"Slovakia",US:"USA"}}),e.fn.bootstrapValidator.validators.zipCode={html5Attributes:{message:"message",country:"country"},COUNTRY_CODES:["AT","BR","CA","CH","CZ","DE","DK","FR","GB","IE","IT","MA","NL","PT","RO","RU","SE","SG","SK","US"],validate:function(t,i,n){var r=i.val();if(""===r||!n.country)return!0;var a=n.country;if("string"==typeof a&&-1!==e.inArray(a,this.COUNTRY_CODES)||(a=t.getDynamicOption(i,a)),!a||-1===e.inArray(a.toUpperCase(),this.COUNTRY_CODES))return{valid:!1,message:e.fn.bootstrapValidator.helpers.format(e.fn.bootstrapValidator.i18n.zipCode.countryNotSupported,a)};var o=!1;switch(a=a.toUpperCase()){case"AT":o=/^([1-9]{1})(\d{3})$/.test(r);break;case"BR":o=/^(\d{2})([\.]?)(\d{3})([\-]?)(\d{3})$/.test(r);break;case"CA":o=/^(?:A|B|C|E|G|H|J|K|L|M|N|P|R|S|T|V|X|Y){1}[0-9]{1}(?:A|B|C|E|G|H|J|K|L|M|N|P|R|S|T|V|W|X|Y|Z){1}\s?[0-9]{1}(?:A|B|C|E|G|H|J|K|L|M|N|P|R|S|T|V|W|X|Y|Z){1}[0-9]{1}$/i.test(r);break;case"CH":o=/^([1-9]{1})(\d{3})$/.test(r);break;case"CZ":o=/^(\d{3})([ ]?)(\d{2})$/.test(r);break;case"DE":o=/^(?!01000|99999)(0[1-9]\d{3}|[1-9]\d{4})$/.test(r);break;case"DK":o=/^(DK(-|\s)?)?\d{4}$/i.test(r);break;case"FR":o=/^[0-9]{5}$/i.test(r);break;case"GB":o=this._gb(r);break;case"IE":o=/^(D6W|[ACDEFHKNPRTVWXY]\d{2})\s[0-9ACDEFHKNPRTVWXY]{4}$/.test(r);break;case"IT":o=/^(I-|IT-)?\d{5}$/i.test(r);break;case"MA":o=/^[1-9][0-9]{4}$/i.test(r);break;case"NL":o=/^[1-9][0-9]{3} ?(?!sa|sd|ss)[a-z]{2}$/i.test(r);break;case"PT":o=/^[1-9]\d{3}-\d{3}$/.test(r);break;case"RO":o=/^(0[1-8]{1}|[1-9]{1}[0-5]{1})?[0-9]{4}$/i.test(r);break;case"RU":o=/^[0-9]{6}$/i.test(r);break;case"SE":o=/^(S-)?\d{3}\s?\d{2}$/i.test(r);break;case"SG":o=/^([0][1-9]|[1-6][0-9]|[7]([0-3]|[5-9])|[8][0-2])(\d{4})$/i.test(r);break;case"SK":o=/^(\d{3})([ ]?)(\d{2})$/.test(r);break;case"US":default:o=/^\d{4,5}([\-]?\d{4})?$/.test(r)}return{valid:o,message:e.fn.bootstrapValidator.helpers.format(n.message||e.fn.bootstrapValidator.i18n.zipCode.country,e.fn.bootstrapValidator.i18n.zipCode.countries[a])}},_gb:function(e){for(var t="[ABCDEFGHIJKLMNOPRSTUWYZ]",i="[ABDEFGHJLNPQRSTUWXYZ]",n=[new RegExp("^("+t+"{1}[ABCDEFGHKLMNOPQRSTUVWXY]?[0-9]{1,2})(\\s*)([0-9]{1}"+i+"{2})$","i"),new RegExp("^("+t+"{1}[0-9]{1}[ABCDEFGHJKPMNRSTUVWXY]{1})(\\s*)([0-9]{1}"+i+"{2})$","i"),new RegExp("^("+t+"{1}[ABCDEFGHKLMNOPQRSTUVWXY]{1}?[0-9]{1}[ABEHMNPRVWXY]{1})(\\s*)([0-9]{1}"+i+"{2})$","i"),new RegExp("^(BF1)(\\s*)([0-6]{1}[ABDEFGHJLNPQRST]{1}[ABDEFGHJLNPQRSTUWZYZ]{1})$","i"),/^(GIR)(\s*)(0AA)$/i,/^(BFPO)(\s*)([0-9]{1,4})$/i,/^(BFPO)(\s*)(c\/o\s*[0-9]{1,3})$/i,/^([A-Z]{4})(\s*)(1ZZ)$/i,/^(AI-2640)$/i],r=0;r<n.length;r++)if(n[r].test(e))return!0;return!1}}}(window.jQuery),define("validator",["jquery","bootstrap"],function(e){return function(){return e.validator}}(this)),function(e){e.fn.bootstrapValidator.i18n=e.extend(!0,e.fn.bootstrapValidator.i18n,{base64:{default:"请输入有效的Base64编码"},between:{default:"请输入在 %s 和 %s 之间的数值",notInclusive:"请输入在 %s 和 %s 之间(不含两端)的数值"},callback:{default:"请输入有效的值"},choice:{default:"请输入有效的值",less:"请至少选中 %s 个选项",more:"最多只能选中 %s 个选项",between:"请选择 %s 至 %s 个选项"},color:{default:"请输入有效的颜色值"},creditCard:{default:"请输入有效的信用卡号码"},cusip:{default:"请输入有效的美国CUSIP代码"},cvv:{default:"请输入有效的CVV代码"},date:{default:"请输入有效的日期",min:"请输入 %s 或之后的日期",max:"请输入 %s 或以前的日期",range:"请输入 %s 和 %s 之间的日期"},different:{default:"请输入不同的值"},digits:{default:"请输入有效的数字"},ean:{default:"请输入有效的EAN商品编码"},emailAddress:{default:"请输入有效的邮件地址"},file:{default:"请选择有效的文件"},greaterThan:{default:"请输入大于等于 %s 的数值",notInclusive:"请输入大于 %s 的数值"},grid:{default:"请输入有效的GRId编码"},hex:{default:"请输入有效的16进制数"},hexColor:{default:"请输入有效的16进制颜色值"},iban:{default:"请输入有效的IBAN(国际银行账户)号码",countryNotSupported:"不支持 %s 国家或地区",country:"请输入有效的 %s 国家或地区的IBAN(国际银行账户)号码",countries:{AD:"安道尔",AE:"阿联酋",AL:"阿尔巴尼亚",AO:"安哥拉",AT:"奥地利",AZ:"阿塞拜疆",BA:"波斯尼亚和黑塞哥维那",BE:"比利时",BF:"布基纳法索",BG:"保加利亚",BH:"巴林",BI:"布隆迪",BJ:"贝宁",BR:"巴西",CH:"瑞士",CI:"科特迪瓦",CM:"喀麦隆",CR:"哥斯达黎加",CV:"佛得角",CY:"塞浦路斯",CZ:"捷克共和国",DE:"德国",DK:"丹麦",DO:"多米尼加共和国",DZ:"阿尔及利亚",EE:"爱沙尼亚",ES:"西班牙",FI:"芬兰",FO:"法罗群岛",FR:"法国",GB:"英国",GE:"格鲁吉亚",GI:"直布罗陀",GL:"格陵兰岛",GR:"希腊",GT:"危地马拉",HR:"克罗地亚",HU:"匈牙利",IE:"爱尔兰",IL:"以色列",IR:"伊朗",IS:"冰岛",IT:"意大利",JO:"约旦",KW:"科威特",KZ:"哈萨克斯坦",LB:"黎巴嫩",LI:"列支敦士登",LT:"立陶宛",LU:"卢森堡",LV:"拉脱维亚",MC:"摩纳哥",MD:"摩尔多瓦",ME:"黑山",MG:"马达加斯加",MK:"马其顿",ML:"马里",MR:"毛里塔尼亚",MT:"马耳他",MU:"毛里求斯",MZ:"莫桑比克",NL:"荷兰",NO:"挪威",PK:"巴基斯坦",PL:"波兰",PS:"巴勒斯坦",PT:"葡萄牙",QA:"卡塔尔",RO:"罗马尼亚",RS:"塞尔维亚",SA:"沙特阿拉伯",SE:"瑞典",SI:"斯洛文尼亚",SK:"斯洛伐克",SM:"圣马力诺",SN:"塞内加尔",TN:"突尼斯",TR:"土耳其",VG:"英属维尔京群岛"}},id:{default:"请输入有效的身份证件号码",countryNotSupported:"不支持 %s 国家或地区",country:"请输入有效的 %s 国家或地区的身份证件号码",countries:{BA:"波黑",BG:"保加利亚",BR:"巴西",CH:"瑞士",CL:"智利",CN:"中国",CZ:"捷克共和国",DK:"丹麦",EE:"爱沙尼亚",ES:"西班牙",FI:"芬兰",HR:"克罗地亚",IE:"爱尔兰",IS:"冰岛",LT:"立陶宛",LV:"拉脱维亚",ME:"黑山",MK:"马其顿",NL:"荷兰",RO:"罗马尼亚",RS:"塞尔维亚",SE:"瑞典",SI:"斯洛文尼亚",SK:"斯洛伐克",SM:"圣马力诺",TH:"泰国",ZA:"南非"}},identical:{default:"请输入相同的值"},imei:{default:"请输入有效的IMEI(手机串号)"},imo:{default:"请输入有效的国际海事组织(IMO)号码"},integer:{default:"请输入有效的整数值"},ip:{default:"请输入有效的IP地址",ipv4:"请输入有效的IPv4地址",ipv6:"请输入有效的IPv6地址"},isbn:{default:"请输入有效的ISBN(国际标准书号)"},isin:{default:"请输入有效的ISIN(国际证券编码)"},ismn:{default:"请输入有效的ISMN(印刷音乐作品编码)"},issn:{default:"请输入有效的ISSN(国际标准杂志书号)"},lessThan:{default:"请输入小于等于 %s 的数值",notInclusive:"请输入小于 %s 的数值"},mac:{default:"请输入有效的MAC物理地址"},meid:{default:"请输入有效的MEID(移动设备识别码)"},notEmpty:{default:"请填写必填项目"},numeric:{default:"请输入有效的数值,允许小数"},phone:{default:"请输入有效的电话号码",countryNotSupported:"不支持 %s 国家或地区",country:"请输入有效的 %s 国家或地区的电话号码",countries:{BR:"巴西",CN:"中国",CZ:"捷克共和国",DE:"德国",DK:"丹麦",ES:"西班牙",FR:"法国",GB:"英国",MA:"摩洛哥",PK:"巴基斯坦",RO:"罗马尼亚",RU:"俄罗斯",SK:"斯洛伐克",TH:"泰国",US:"美国",VE:"委内瑞拉"}},regexp:{default:"请输入符合正则表达式限制的值"},remote:{default:"请输入有效的值"},rtn:{default:"请输入有效的RTN号码"},sedol:{default:"请输入有效的SEDOL代码"},siren:{default:"请输入有效的SIREN号码"},siret:{default:"请输入有效的SIRET号码"},step:{default:"请输入在基础值上,增加 %s 的整数倍的数值"},stringCase:{default:"只能输入小写字母",upper:"只能输入大写字母"},stringLength:{default:"请输入符合长度限制的值",less:"最多只能输入 %s 个字符",more:"需要输入至少 %s 个字符",between:"请输入 %s 至 %s 个字符"},uri:{default:"请输入一个有效的URL地址"},uuid:{default:"请输入有效的UUID",version:"请输入版本 %s 的UUID"},vat:{default:"请输入有效的VAT(税号)",countryNotSupported:"不支持 %s 国家或地区",country:"请输入有效的 %s 国家或地区的VAT(税号)",countries:{AT:"奥地利",BE:"比利时",BG:"保加利亚",BR:"巴西",CH:"瑞士",CY:"塞浦路斯",CZ:"捷克共和国",DE:"德国",DK:"丹麦",EE:"爱沙尼亚",ES:"西班牙",FI:"芬兰",FR:"法语",GB:"英国",GR:"希腊",EL:"希腊",HU:"匈牙利",HR:"克罗地亚",IE:"爱尔兰",IS:"冰岛",IT:"意大利",LT:"立陶宛",LU:"卢森堡",LV:"拉脱维亚",MT:"马耳他",NL:"荷兰",NO:"挪威",PL:"波兰",PT:"葡萄牙",RO:"罗马尼亚",RU:"俄罗斯",RS:"塞尔维亚",SE:"瑞典",SI:"斯洛文尼亚",SK:"斯洛伐克",VE:"委内瑞拉",ZA:"南非"}},vin:{default:"请输入有效的VIN(美国车辆识别号码)"},zipCode:{default:"请输入有效的邮政编码",countryNotSupported:"不支持 %s 国家或地区",country:"请输入有效的 %s 国家或地区的邮政编码",countries:{AT:"奥地利",BR:"巴西",CA:"加拿大",CH:"瑞士",CZ:"捷克共和国",DE:"德国",DK:"丹麦",FR:"法国",GB:"英国",IE:"爱尔兰",IT:"意大利",MA:"摩洛哥",NL:"荷兰",PT:"葡萄牙",RO:"罗马尼亚",RU:"俄罗斯",SE:"瑞典",SG:"新加坡",SK:"斯洛伐克",US:"美国"}}})}(window.jQuery),define("validatorlanguage",["jquery","validator"],function(){}),function(e,t){"use strict";var i,n,r=e.layui&&layui.define,a={getPath:function(){var e=document.currentScript?document.currentScript.src:function(){for(var e,t=document.scripts,i=t.length-1,n=i;n>0;n--)if("interactive"===t[n].readyState){e=t[n].src;break}return e||t[i].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"],getStyle:function(t,i){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](i)},link:function(t,i,n){if(o.path){var r=document.getElementsByTagName("head")[0],s=document.createElement("link");"string"==typeof i&&(n=i);var l=(n||t).replace(/\.|\//g,""),c="layuicss-"+l,u=0;s.rel="stylesheet",s.href=o.path+t,s.id=c,document.getElementById(c)||r.appendChild(s),"function"==typeof i&&function t(){if(++u>80)return e.console&&console.error("layer.css: Invalid");1989===parseInt(a.getStyle(document.getElementById(c),"width"))?i():setTimeout(t,100)}()}}},o={v:"3.1.1",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:a.getPath,config:function(e,t){return e=e||{},o.cache=a.config=i.extend({},a.config,e),o.path=a.config.path||o.path,"string"==typeof e.extend&&(e.extend=[e.extend]),a.config.path&&o.ready(),e.extend?(r?layui.addcss("modules/layer/"+e.extend):a.link("theme/"+e.extend),this):this},ready:function(e){var t=(r?"modules/layer/":"theme/")+"default/layer.css?v="+o.v;return r?layui.addcss(t,e,"layer"):a.link(t,e,"layer"),this},alert:function(e,t,n){var r="function"==typeof t;return r&&(n=t),o.open(i.extend({content:e,yes:n},r?{}:t))},confirm:function(e,t,n,r){var s="function"==typeof t;return s&&(r=n,n=t),o.open(i.extend({content:e,btn:a.btn,yes:n,btn2:r},s?{}:t))},msg:function(e,t,n){var r="function"==typeof t,s=a.config.skin,c=(s?s+" "+s+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return r&&(n=t),o.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:n},r&&!a.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return t=t||{},(-1===t.icon||void 0===t.icon&&!a.config.skin)&&(t.skin=c+" "+(t.skin||"layui-layer-hui")),t}()))},load:function(e,t){return o.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return o.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++o.index,t.config=i.extend({},t.config,a.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim-00","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,r=n.index,o=n.config,s=o.zIndex+r,c="object"==typeof o.title,u=o.maxmin&&(1===o.type||2===o.type),d=o.title?'<div class="layui-layer-title" style="'+(c?o.title[1]:"")+'">'+(c?o.title[0]:o.title)+"</div>":"";return o.zIndex=s,t([o.shade?'<div class="layui-layer-shade" id="layui-layer-shade'+r+'" times="'+r+'" style="z-index:'+(s-1)+'; "></div>':"",'<div class="'+l[0]+" layui-layer-"+a.type[o.type]+(0!=o.type&&2!=o.type||o.shade?"":" layui-layer-border")+" "+(o.skin||"")+'" id="'+l[0]+r+'" type="'+a.type[o.type]+'" times="'+r+'" showtime="'+o.time+'" conType="'+(e?"object":"string")+'" style="z-index: '+s+"; width:"+o.area[0]+";height:"+o.area[1]+(o.fixed?"":";position:absolute;")+'">'+(e&&2!=o.type?"":d)+'<div id="'+(o.id||"")+'" class="layui-layer-content'+(0==o.type&&-1!==o.icon?" layui-layer-padding":"")+(3==o.type?" layui-layer-loading"+o.icon:"")+'">'+(0==o.type&&-1!==o.icon?'<i class="layui-layer-ico layui-layer-ico'+o.icon+'"></i>':"")+(1==o.type&&e?"":o.content||"")+'</div><span class="layui-layer-setwin">'+function(){var e=u?'<a class="layui-layer-min" href="javascript:;"><cite></cite></a><a class="layui-layer-ico layui-layer-max" href="javascript:;"></a>':"";return o.closeBtn&&(e+='<a class="layui-layer-ico '+l[7]+" "+l[7]+(o.title?o.closeBtn:4==o.type?"1":"2")+'" href="javascript:;"></a>'),e}()+"</span>"+(o.btn?function(){var e="";"string"==typeof o.btn&&(o.btn=[o.btn]);for(var t=0,i=o.btn.length;t<i;t++)e+='<a class="'+l[6]+t+'">'+o.btn[t]+"</a>";return'<div class="'+l[6]+" layui-layer-btn-"+(o.btnAlign||"")+'">'+e+"</div>"}():"")+(o.resize?'<span class="layui-layer-resize"></span>':"")+"</div>"],d,i('<div class="layui-layer-move"></div>')),n},s.pt.creat=function(){var e=this,t=e.config,r=e.index,s=t.content,c="object"==typeof s,u=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==o.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:a.btn[0],o.closeAll("dialog");break;case 2:var s=t.content=c?t.content:[t.content||"","auto"];t.content='<iframe scrolling="'+(t.content[1]||"auto")+'" allowtransparency="true" id="'+l[4]+r+'" name="'+l[4]+r+'" onload="this.className=\'\';" class="layui-layer-load" frameborder="0" src="'+t.content[0]+'"></iframe>';break;case 3:delete t.title,delete t.closeBtn,-1===t.icon&&t.icon,o.closeAll("loading");break;case 4:c||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+'<i class="layui-layer-TipsG"></i>',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||o.closeAll("tips")}if(e.vessel(c,function(n,o,d){u.append(n[0]),c?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+r).find("."+l[5]).before(o))}()}():u.append(n[1]),i(".layui-layer-move")[0]||u.append(a.moveElem=d),e.layero=i("#"+l[0]+r),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",r)}).auto(r),i("#layui-layer-shade"+e.index).css({"background-color":t.shade[1]||"#000",opacity:t.shade[0]||t.shade}),2==t.type&&6==o.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(r),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){o.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]){var d="layer-anim "+l.anim[t.anim];e.layero.addClass(d).one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){i(this).removeClass(d)})}t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){var t=this,r=t.config,a=i("#"+l[0]+e);""===r.area[0]&&r.maxWidth>0&&(o.ie&&o.ie<8&&r.btn&&a.width(a.innerWidth()),a.outerWidth()>r.maxWidth&&a.width(r.maxWidth));var s=[a.innerWidth(),a.innerHeight()],c=a.find(l[1]).outerHeight()||0,u=a.find("."+l[6]).outerHeight()||0,d=function(e){e=a.find(e),e.height(s[1]-c-u-2*(0|parseFloat(e.css("padding-top"))))};switch(r.type){case 2:d("iframe");break;default:""===r.area[1]?r.maxHeight>0&&a.outerHeight()>r.maxHeight?(s[1]=r.maxHeight,d("."+l[5])):r.fixed&&s[1]>=n.height()&&(s[1]=n.height(),d("."+l[5])):d("."+l[5])}return t},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,r=[i.outerWidth(),i.outerHeight()],a="object"==typeof t.offset;e.offsetTop=(n.height()-r[1])/2,e.offsetLeft=(n.width()-r[0])/2,a?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-r[0]:"b"===t.offset?e.offsetTop=n.height()-r[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-r[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-r[0]):"rb"===t.offset?(e.offsetTop=n.height()-r[1],e.offsetLeft=n.width()-r[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,r=e.layero,a=[r.outerWidth(),r.outerHeight()],o=i(t.follow);o[0]||(o=i("body"));var s={width:o.outerWidth(),height:o.outerHeight(),top:o.offset().top,left:o.offset().left},c=r.find(".layui-layer-TipsG"),u=t.tips[0];t.tips[1]||c.remove(),s.autoLeft=function(){
|
||
s.left+a[0]-n.width()>0?(s.tipLeft=s.left+s.width-a[0],c.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-a[1]-10,c.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,c.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,c.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-a[0]-10,s.tipTop=s.top,c.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[u-1](),1===u?s.top-(n.scrollTop()+a[1]+16)<0&&s.where[2]():2===u?n.width()-(s.left+s.width+a[0]+16)>0||s.where[3]():3===u?s.top-n.scrollTop()+s.height+a[1]+16-n.height()>0&&s.where[0]():4===u&&a[0]+16-s.left>0&&s.where[1](),r.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),r.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,r=i(document),s=e.layero,l=s.find(t.move),c=s.find(".layui-layer-resize"),u={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(u.moveStart=!0,u.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],a.moveElem.css("cursor","move").show())}),c.on("mousedown",function(e){e.preventDefault(),u.resizeStart=!0,u.offset=[e.clientX,e.clientY],u.area=[s.outerWidth(),s.outerHeight()],a.moveElem.css("cursor","se-resize").show()}),r.on("mousemove",function(i){if(u.moveStart){var r=i.clientX-u.offset[0],a=i.clientY-u.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),u.stX=l?0:n.scrollLeft(),u.stY=l?0:n.scrollTop(),!t.moveOut){var c=n.width()-s.outerWidth()+u.stX,d=n.height()-s.outerHeight()+u.stY;r<u.stX&&(r=u.stX),r>c&&(r=c),a<u.stY&&(a=u.stY),a>d&&(a=d)}s.css({left:r,top:a})}if(t.resize&&u.resizeStart){var r=i.clientX-u.offset[0],a=i.clientY-u.offset[1];i.preventDefault(),o.style(e.index,{width:u.area[0]+r,height:u.area[1]+a}),u.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){u.moveStart&&(delete u.moveStart,a.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),u.resizeStart&&(delete u.resizeStart,a.moveElem.hide())}),e},s.pt.callback=function(){function e(){!1===(r.cancel&&r.cancel(t.index,n))||o.close(t.index)}var t=this,n=t.layero,r=t.config;t.openLayer(),r.success&&(2==r.type?n.find("iframe").on("load",function(){r.success(n,t.index)}):r.success(n,t.index)),6==o.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)r.yes?r.yes(t.index,n):r.btn1?r.btn1(t.index,n):o.close(t.index);else{!1===(r["btn"+(e+1)]&&r["btn"+(e+1)](t.index,n))||o.close(t.index)}}),n.find("."+l[7]).on("click",e),r.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){o.close(t.index)}),n.find(".layui-layer-min").on("click",function(){!1===(r.min&&r.min(n))||o.min(t.index,r)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(o.restore(t.index),r.restore&&r.restore(n)):(o.full(t.index,r),setTimeout(function(){r.full&&r.full(n)},100))}),r.end&&(a.end[t.index]=r.end)},a.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;o.zIndex=e.config.zIndex,o.setTop=function(e){var t=function(){o.zIndex++,e.css("z-index",o.zIndex+1)};return o.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),o.zIndex}},a.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},a.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=o,o.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},o.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},o.iframeAuto=function(e){if(e){var t=o.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),r=n.find(l[1]).outerHeight()||0,a=n.find("."+l[6]).outerHeight()||0;n.css({height:t+r+a}),n.find("iframe").css({height:t})}},o.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},o.style=function(e,t,n){var r=i("#"+l[0]+e),o=r.find(".layui-layer-content"),s=r.attr("type"),c=r.find(l[1]).outerHeight()||0,u=r.find("."+l[6]).outerHeight()||0;r.attr("minLeft");s!==a.type[3]&&s!==a.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-c-u<=64&&(t.height=64+c+u)),r.css(t),u=r.find("."+l[6]).outerHeight(),s===a.type[2]?r.find("iframe").css({height:parseFloat(t.height)-c-u}):o.css({height:parseFloat(t.height)-c-u-parseFloat(o.css("padding-top"))-parseFloat(o.css("padding-bottom"))}))},o.min=function(e,t){var r=i("#"+l[0]+e),s=r.find(l[1]).outerHeight()||0,c=r.attr("minLeft")||181*a.minIndex+"px",u=r.css("position");a.record(r),a.minLeft[0]&&(c=a.minLeft[0],a.minLeft.shift()),r.attr("position",u),o.style(e,{width:180,height:s,left:c,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),r.find(".layui-layer-min").hide(),"page"===r.attr("type")&&r.find(l[4]).hide(),a.rescollbar(e),r.attr("minLeft")||a.minIndex++,r.attr("minLeft",c)},o.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");o.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),a.rescollbar(e)},o.full=function(e){var t,r=i("#"+l[0]+e);a.record(r),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===r.css("position");o.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),r.find(".layui-layer-min").hide()},100)},o.title=function(e,t){i("#"+l[0]+(t||o.index)).find(l[1]).html(e)},o.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type");if(t[0]){var r="layui-layer-wrap",s=function(){if(n===a.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var o=t.find("."+r),s=0;s<2;s++)o.unwrap();o.css("display",o.data("display")).removeClass(r)}else{if(n===a.type[2])try{var c=i("#"+l[4]+e)[0];c.contentWindow.document.write(""),c.contentWindow.close(),t.find("."+l[5])[0].removeChild(c)}catch(e){}t[0].innerHTML="",t.remove()}"function"==typeof a.end[e]&&a.end[e](),delete a.end[e]};t.data("isOutAnim")&&t.addClass("layer-anim layer-anim-close"),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==o.ie&&a.reselect(),a.rescollbar(e),t.attr("minLeft")&&(a.minIndex--,a.minLeft.push(t.attr("minLeft"))),o.ie&&o.ie<10||!t.data("isOutAnim")?s():setTimeout(function(){s()},200)}},o.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&o.close(t.attr("times")),n=null})};var c=o.cache||{},u=function(e){return c.skin?" "+c.skin+" "+c.skin+"-"+e:""};o.prompt=function(e,t){var r="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var a=e.area;r='style="width: '+a[0]+"; height: "+a[1]+';"',delete e.area}var s,l=2==e.formType?'<textarea class="layui-layer-input"'+r+"></textarea>":function(){return'<input type="'+(1==e.formType?"password":"text")+'" class="layui-layer-input">'}(),c=e.success;return delete e.success,o.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+u("prompt"),maxWidth:n.width(),success:function(t){s=t.find(".layui-layer-input"),s.val(e.value||"").focus(),"function"==typeof c&&c(t)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?o.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},o.tab=function(e){e=e||{};var t=e.tab||{},n="layui-this",r=e.success;return delete e.success,o.open(i.extend({type:1,skin:"layui-layer-tab"+u("tab"),resize:!1,title:function(){var e=t.length,i=1,r="";if(e>0)for(r='<span class="'+n+'">'+t[0].title+"</span>";i<e;i++)r+="<span>"+t[i].title+"</span>";return r}(),content:'<ul class="layui-layer-tabmain">'+function(){var e=t.length,i=1,r="";if(e>0)for(r='<li class="layui-layer-tabli '+n+'">'+(t[0].content||"no content")+"</li>";i<e;i++)r+='<li class="layui-layer-tabli">'+(t[i].content||"no content")+"</li>";return r}()+"</ul>",success:function(t){var a=t.find(".layui-layer-title").children(),o=t.find(".layui-layer-tabmain").children();a.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var r=i(this),a=r.index();r.addClass(n).siblings().removeClass(n),o.eq(a).show().siblings().hide(),"function"==typeof e.change&&e.change(a)}),"function"==typeof r&&r(t)}},e))},o.photos=function(t,n,r){var a={};if(t=t||{},t.photos){var s=t.photos.constructor===Object,l=s?t.photos:{},c=l.data||[],d=l.start||0;a.imgIndex=1+(0|d),t.img=t.img||"img";var h=t.success;if(delete t.success,s){if(0===c.length)return o.msg("没有图片")}else{var p=i(t.photos),f=function(){c=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),c.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(f(),0===c.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");o.photos(i.extend(t,{photos:{start:n,data:c,tab:t.tab},full:t.full}),!0),f()}),!n)return}a.imgprev=function(e){a.imgIndex--,a.imgIndex<1&&(a.imgIndex=c.length),a.tabimg(e)},a.imgnext=function(e,t){++a.imgIndex>c.length&&(a.imgIndex=1,t)||a.tabimg(e)},a.keyup=function(e){if(!a.end){var t=e.keyCode;e.preventDefault(),37===t?a.imgprev(!0):39===t?a.imgnext(!0):27===t&&o.close(a.index)}},a.tabimg=function(e){if(!(c.length<=1))return l.start=a.imgIndex-1,o.close(a.index),o.photos(t,!0,e)},a.event=function(){a.bigimg.hover(function(){a.imgsee.show()},function(){a.imgsee.hide()}),a.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),a.imgprev()}),a.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),a.imgnext()}),i(document).on("keyup",a.keyup)},a.loadi=o.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),function(e,t,i){var n=new Image;if(n.src=e,n.complete)return t(n);n.onload=function(){n.onload=null,t(n)},n.onerror=function(e){n.onerror=null,i(e)}}(c[d].src,function(n){o.close(a.loadi),a.index=o.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var r=[n.width,n.height],a=[i(e).width()-100,i(e).height()-100];if(!t.full&&(r[0]>a[0]||r[1]>a[1])){var o=[r[0]/a[0],r[1]/a[1]];o[0]>o[1]?(r[0]=r[0]/o[0],r[1]=r[1]/o[0]):o[0]<o[1]&&(r[0]=r[0]/o[1],r[1]=r[1]/o[1])}return[r[0]+"px",r[1]+"px"]}(),title:!1,shade:.9,shadeClose:!0,closeBtn:!1,move:".layui-layer-phimg img",moveType:1,scrollbar:!1,moveOut:!0,isOutAnim:!1,skin:"layui-layer-photos"+u("photos"),content:'<div class="layui-layer-phimg"><img src="'+c[d].src+'" alt="'+(c[d].alt||"")+'" layer-pid="'+c[d].pid+'"><div class="layui-layer-imgsee">'+(c.length>1?'<span class="layui-layer-imguide"><a href="javascript:;" class="layui-layer-iconext layui-layer-imgprev"></a><a href="javascript:;" class="layui-layer-iconext layui-layer-imgnext"></a></span>':"")+'<div class="layui-layer-imgbar" style="display:'+(r?"block":"")+'"><span class="layui-layer-imgtit"><a href="javascript:;">'+(c[d].alt||"")+"</a><em>"+a.imgIndex+"/"+c.length+"</em></span></div></div></div>",success:function(e,i){a.bigimg=e.find(".layui-layer-phimg"),a.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),a.event(e),t.tab&&t.tab(c[d],e),"function"==typeof h&&h(e)},end:function(){a.end=!0,i(document).off("keyup",a.keyup)}},t))},function(){o.close(a.loadi),o.msg("当前图片地址异常<br>是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){c.length>1&&a.imgnext(!0,!0)}})})}},a.run=function(t){i=t,n=i(e),l.html=i("html"),o.open=function(e){return new s(e).index}},e.layui&&layui.define?(o.ready(),layui.define("jquery",function(t){o.path=layui.cache.dir,a.run(layui.$),e.layer=o,t("layer",o)})):"function"==typeof define&&define.amd?define("layermsg",["jquery"],function(){return a.run(e.jQuery),o}):function(){a.run(e.jQuery),o.ready()}()}(window),define("app-manager",["app-utils","jquery","message","modules/console/console","url-utils","jquerycookie","json3","validator","validatorlanguage","layermsg","layui"],function(e,t,i,n,r,a,o,s,l,c,u){function d(e,t){this.appInstance=e,this.id=t,this.initialized=!1}function h(){this.appList={},this.currentApp=null,this.pageUrl=r.getAppName(window.location.href),this.appArea=t(".appArea")}function p(e,t){var i=r.getAppName(t);i&&e.switchToAppByUrl(i)}layer.config({skin:"layui-demo-class"}),layui.use("layer",function(){window.layer=layui.layer,layer.config({skin:"layui-demo-class"})}),t.ajaxSetup({cache:!1,async:!0,headers:{REGION:SDC.current_region,Authorization:SDC.user.auth_token,timeout:0}});var f=window.location.search.slice(1).split("=");if("action"==f[0]&&"close"==f[1]){var m=window.opener;m&&!m.closed&&window.close()}return window.console&&!window.console.debug&&(window.console.log?window.console.debug=window.console.log:window.console.debug=function(){}),d.prototype={getId:function(){return this.id},getInstance:function(){return this.appInstance},initialize:function(e,t){if(!this.initialized){this.initialized=!0;var i={appId:this.id,language:SDC.t.LANG,rootBase:SDC.proxyBase};return this.appInstance&&this.appInstance.initialize?this.appInstance.initialize(e,t,i):void 0}},getMethod:function(e){return this.appInstance&&"function"==typeof this.appInstance[e]?this.appInstance[e]:null},onMessage:function(e){this.initialized&&this.appInstance&&this.appInstance.onMessage&&this.appInstance.onMessage(e)}},h.prototype={switchToAppByUrl:function(e){if(this.pageUrl=e,e){t("#header .profile > a").removeClass("selected"),this.switchToApp(e);var i=r.getPathList(window.location.href);if(i&&i.length>1){var n=this.currentApp;i.splice(0,1);var a=i;try{if(n){n.getMethod("gotoView").apply(n.getInstance(),a)}}catch(e){console.debug(e)}}}},loadApp:function(e){var t=e.getId();this.appList[t]=e,this.pageUrl===t&&this.switchToAppByUrl(t)},switchToApp:function(e){if(!this.currentApp||this.currentApp.getId()!==e){var i=t("body");this.currentApp&&t("#"+this.currentApp.getId()).addClass("hide"),this.currentApp=this.appList[e],i.removeClass("hide"),this.currentApp.initialized||this.currentApp.initialize(i.get(0),this)}}},t(document).ready(function(){jQuery(document).ajaxSend(function(e,t,i){!function(e){return/^(GET|HEAD|OPTIONS|TRACE)$/.test(e)}(i.type)&&function(e){var t=document.location.host,i=document.location.protocol,n="//"+t,r=i+n;return e==r||e.slice(0,r.length+1)==r+"/"||e==n||e.slice(0,n.length+1)==n+"/"||!/^(\/\/|http:|https:).*/.test(e)}(i.url)&&t.setRequestHeader("X-CSRFToken",function(e){var t=null;if(document.cookie&&""!=document.cookie)for(var i=document.cookie.split(";"),n=0;n<i.length;n++){var r=jQuery.trim(i[n]);if(r.substring(0,e.length+1)==e+"="){t=decodeURIComponent(r.substring(e.length+1));break}}return t}("csrftoken"))});var r=new h,a=new i(r);r.loadApp(new d(new n,"aaf4")),a.initialize(),t(window).bind("popstate",function(e){var t=e.originalEvent,i=t.state;if(i&&i.path){var n=i.path;p(r,n)}}),t(document).delegate('[wp-type="link"]',"click",function(e){if(e.preventDefault(),t(".qc-modal .closeModal:visible").trigger("click"),t(this).is(".gotoSetting"))return r.switchToApp("setting"),!1;t(this).is(".lm-center-left ul li a");var i=t(this).attr("href");return i!=window.location.pathname&&window.history.pushState({path:i},"",i),p(r,i),!1}),t(document).on("mouseover",".tipsLink",function(){var e,i=t(this).find(".tipsHover");e=i.length<1?t('<span class="tipsHover">'+t(this).data("tips")+"</span>"):i.clone(),t("body >.tipsHover").remove(),t("body").append(e);var n=t(this).offset();e.css({left:n.left,top:n.top,zIndex:1e3}),e.addClass("protected")}),t(document).on("mouseout",".tipsLink",function(){t("body >.tipsHover").removeClass("protected"),window.setTimeout(function(){t("body >.tipsHover:not(.protected)").remove()},1e3)});var o,s=t(".projectSelector .own-project-leading"),l=t(".projectSelector .joined-project-leading"),c=t(".projectSelector .empty"),u=t(".projectSelector .own-project"),f=t(".projectSelector .joined-project"),m={},g={},v=0,y=null;for(v=0,o=u.length;v<o;v++)y=t(u[v]),m[y.data("index")]=y;for(v=0,o=f.length;v<o;v++)y=t(f[v]),g[y.data("index")]=y;t(".projectSelector .J_search").on("keyup",function(){var e=t(this).val(),i=null,n=!0,r=!0;for(i in m)i.match(e)?(n=!1,m[i].removeClass("hide")):m[i].addClass("hide");n?s.addClass("hide"):s.removeClass("hide");for(i in g)i.match(e)?(r=!1,g[i].removeClass("hide")):g[i].addClass("hide");r?l.addClass("hide"):l.removeClass("hide"),r&&n?c.removeClass("hide"):c.addClass("hide")}),t(".region .regionSelector >ul li a").on("click",function(){window.location.href=window.location.href+"?region="+t(this).data("id")}),t(".projects .projectSelector >ul li a").on("click",function(){window.location.href="/switch/project/"+t(this).data("id")}),t(".user-info .profile > a").on("touchstart",function(){t(".user-info .account").toggle()}),t(".user-info .profile").on("mouseenter",function(){t(".user-info .account").show()}),t(".user-info .profile").on("mouseleave",function(){t(".user-info .account").hide()}),t("#header .profile a[lang]").on("click",function(){if(!t(this).hasClass("selected")){var e=window.location.href,i={};e.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(e,n,r){i[n]=r,t(this).addClass("seleced")});i.lang=t(this).attr("lang");var n=[];for(var r in i)n.push(r+"="+i[r]);var a=e.replace(/[?](.*)/,"");window.location.href=a+"?"+n.join("&")}});for(var _=0;_<t("#header .profile a[lang]").length;_++){var b=t("#header .profile a[lang]")[_];t(b).attr("lang")==SDC.t.LANG?t(b).addClass("selected"):t(b).removeClass("selected")}if(window.history&&!window.history.state){var w=window.location.pathname;window.history.replaceState({path:w},"",w)}if("/"==window.location.pathname||window.location.pathname==e.relativePath){var x=e.relativePath;window.history.replaceState({path:x},"",x),p(r,x)}t(this).on("urlChange",function(e,i){var n=!1;"string"!=typeof i&&(n=!0===i.jump,i=i.href),i!=window.location.pathname&&window.history.pushState({path:i},"",i),t(document).trigger("hrefChange",i),n&&p(r,i)}),t(this).on("onMessage",function(e,t){if(r&&r.appList&&t&&t.app_ids)for(var i=t.app_ids,n=0,a=i.length;n<a;n++){var o=i[n],s=r.appList[o];s&&s.onMessage&&s.onMessage(t)}}),t(".action-dropdown").each(function(){var e=t("#"+t(this).data("target")),i=this;t(this).on("mouseover",function(){t(document).width(),t(this).offset().left,t(this).outerWidth();t(this).addClass("action-mousehover"),e.removeClass("hide"),e.show()}),t(this).on("mouseleave",function(){e.hide(),e.addClass("hide"),t(this).removeClass("action-mousehover")}),e.on("mouseover",function(){t(document).width(),t(i).offset().left,t(i).outerWidth();t(i).addClass("action-mousehover"),e.removeClass("hide"),t(this).show()}),e.on("mouseleave",function(){t(this).hide(),e.addClass("hide"),t(i).removeClass("action-mousehover")})})}),h}),require.config({baseUrl:"/static/",paths:{text:"public/lib/require/text.min",css:"public/lib/require/css.min",jquery:"public/lib/jquery/jquery2.03",webpopover:"public/lib/jquery/jquery.webui-popover",jquerycookie:"public/lib/jquery/jquery.cookie",intro:"public/lib/jquery/intro",nano:"public/lib/nano/nanoscroller",Highcharts:"public/lib/highcharts/highcharts.src","highcharts-no-data-to-display":"public/lib/highcharts/modules/no-data-to-display",WdatePicker:"public/lib/calendar/WdatePicker",videojs:"public/lib/videojs/video.min",moment:"public/lib/moment/moment-with-locales.custom",avalon:"public/lib/avalon/avalon","app-manager":"public/js/app-manager-console",message:"public/js/message/controller",bootstrapchart:"public/lib/chart/Chart",bootstrap_paginator:"public/lib/bootstrap/bootstrap-paginator",json3:"public/lib/json3/json3",modernizr:"public/lib/modernizr/modernizr",respond:"public/lib/respond/respond.src",sockjs:"public/lib/sockjs-client/sockjs","network-utils":"public/js/utils/network","url-utils":"public/js/utils/url","obj-utils":"public/js/utils/object","obj-openstack":"public/js/utils/openstack","app-utils":"public/js/utils/app-utils",basecontroller_v2:"public/js/controllers/basecontroller_v2",popcontrollerbase_v2:"public/js/controllers/popcontrollerbase_v2",tableviewcontroller_v2:"public/js/controllers/tableviewcontroller_v2",bootstrap:"public/lib/bootstrap/bootstrap",bootstraptable:"public/lib/bootstrap/bootstrap-table.min",tablelanguage:"public/lib/bootstrap/locale/bootstrap-table-zh-CN",notify:"public/lib/bootstrap/bootstrap-notify.min",sweetalert:"public/lib/sweetalert/sweetalert.min",promise:"public/lib/sweetalert/promise-7.0.4.min",validator:"public/lib/bootstrap/bootstrapValidator",validatorlanguage:"public/lib/bootstrap/language/zh_CN",multiselect:"public/lib/bootstrap-multiselect/bootstrap-multiselect",wizard:"public/lib/bootstrap/jquery.bootstrap.wizard",fileinput:"public/lib/bootstrap-fileinput/fileinput",edittable:"public/lib/bootstrap-editable/js/bootstrap-editable.min",jqueryray:"public/lib/jquery/jquery.raty.min",layermsg:"public/lib/layui/lay/modules/layer",layui:"public/lib/layui/layui",marked:"public/lib/editormd/lib/marked.min",prettify:"public/lib/editormd/lib/prettify.min",raphael:"public/lib/editormd/lib/raphael.min",underscore:"public/lib/editormd/lib/underscore.min",flowchart:"public/lib/editormd/lib/flowchart.min",jqueryflowchart:"public/lib/editormd/lib/jquery.flowchart.min",sequenceDiagram:"public/lib/editormd/lib/sequence-diagram.min",katex:"public/lib/editormd/lib/katex.min",editormd:"public/lib/editormd/editormd.amd",guacamole:"public/lib/guacamole/all",tagcanvas:"public/lib/tagcanvas.min",layout:"public/lib/jquery.layout/jquery.layout",jqueryui:"public/lib/jquery/jquery.ui",toolbar:"public/lib/jquery.toolbar/jquery.toolbar",baidueditor:"public/lib/ueditor/umeditor",bdlanglang:"public/lib/ueditor/lang/zh-cn/zh-cn",ueditorconfig:"public/lib/ueditor/umeditor.config",lsbridge:"public/lib/lsbridge/lsbridge",toastr:"public/lib/toastr/toastr.min",overlayscrollbars:"public/lib/overlayscrollbars/overlayscrollbars.min",cookie:"public/lib/cookie/cookie.amd",webutil:"public/lib/terminal/webutil",filesaver:"public/lib/filesaver/FileSaver"},shim:{baidueditor:{deps:["ueditorconfig","jquery"],exports:"baidueditor"},bdlanglang:{deps:["baidueditor"],exports:"bdlanglang"},tagcanvas:{deps:["jquery"]},layout:{deps:["jquery","jqueryui"]},sequenceDiagram:{deps:["jquery"]},jqueryflowchart:{deps:["jquery"]},jqueryray:{deps:["jquery"]},Highcharts:{deps:["jquery"]},bootstrap:{deps:["jquery"]},edittable:{deps:["jquery","bootstrap"]},draw_map:{deps:["map"]},bootstrapchart:{deps:["jquery","bootstrap"],exports:"bootstrapchart"},bootstrap_paginator:{deps:["jquery","bootstrap"],exports:"bootstrap_paginator"},fileinput:{deps:["jquery"]},bootstraptable:{deps:["jquery"]},toastr:{deps:["jquery"],exports:"toastr"},overlayscrollbars:{deps:["jquery"],exports:"overlayscrollbars"},validator:{deps:["jquery","bootstrap"],exports:"validator"},tablelanguage:{deps:["jquery","bootstraptable"]},validatorlanguage:{deps:["jquery","validator"]},fileinputlang:{deps:["jquery","fileinput"]},"highcharts-no-data-to-display":{deps:["Highcharts"]},avalon:{exports:"avalon"},underscore:{exports:"_"},sockjs:{exports:"SockJS"},multiselect:{deps:["jquery","bootstrap"],exports:"multiselect"}}}),window.SDC&&require(["app-manager"],function(e){}),define("public/js/main-console",function(){}); |