FS._jQueryTemp=window.jQuery,window.jQuery=FS.$,function e(t,n,i){function r(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){return r(t[o][1][e]||e)}),c,c.exports,e,t,n,i)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(e,t,n){"use strict";function i(e){for(var t=0,n=[],i=0|e.length/3;0<i--;){var r=(e[t]<<16)+(e[t+1]<<8)+e[t+2];t+=3,n.push(o.charAt(63&r>>18)),n.push(o.charAt(63&r>>12)),n.push(o.charAt(63&r>>6)),n.push(o.charAt(63&r))}return 2==e.length-t?(r=(e[t]<<16)+(e[t+1]<<8),n.push(o.charAt(63&r>>18)),n.push(o.charAt(63&r>>12)),n.push(o.charAt(63&r>>6)),n.push("=")):1==e.length-t&&(r=e[t]<<16,n.push(o.charAt(63&r>>18)),n.push(o.charAt(63&r>>12)),n.push("==")),n.join("")}function r(e){for(var t=0,n=[],i=0|e.length/4;0<i--;){var r=(l[e.charCodeAt(t)]<<18)+(l[e.charCodeAt(t+1)]<<12)+(l[e.charCodeAt(t+2)]<<6)+l[e.charCodeAt(t+3)];n.push(255&r>>16),n.push(255&r>>8),n.push(255&r),t+=4}return n&&("="==e.charAt(t-2)?(n.pop(),n.pop()):"="==e.charAt(t-1)&&n.pop()),n}var o,l,d,c={encode:function(e){for(var t=[],n=0;n<e.length;++n){var i=e.charCodeAt(n);i<128?t.push(i):(i<2048?t.push(192|i>>6):(i<65536?t.push(224|i>>12):(t.push(240|i>>18),t.push(128|63&i>>12)),t.push(128|63&i>>6)),t.push(128|63&i))}return t},decode:function(e){for(var t=[],n=0;n<e.length;){var i=e[n++];i<128||(i<224?i=(31&i)<<6:(i<240?i=(15&i)<<12:(i=(7&i)<<18,i|=(63&e[n++])<<12),i|=(63&e[n++])<<6),i|=63&e[n++]),t.push(String.fromCharCode(i))}return t.join("")}},u={};o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=function(){for(var e=[],t=0;t<o.length;++t)e[o.charCodeAt(t)]=t;return e["=".charCodeAt(0)]=0,e}(),d={encode:function(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n));return t},decode:function(){for(var e=0;e<s.length;++e)a[e]=String.fromCharCode(a[e]);return a.join("")}},u.decodeArray=function(e){var t=r(e);return new Uint8Array(t)},u.encodeASCII=function(e){return i(d.encode(e))},u.decodeASCII=function(e){var t=r(e);return d.decode(t)},u.encode=function(e){return i(c.encode(e))},u.decode=function(e){var t=r(e);return c.decode(t)},void 0!==n&&(n.decode=u.decode,n.decodeArray=u.decodeArray,n.encode=u.encode,n.encodeASCII=u.encodeASCII)},{}],2:[function(e,t,n){"use strict";!function(e){function t(e){var t=e;return d.hasOwnProperty(e)&&(t=d[e]),String.fromCharCode(t)}function n(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n].toString(16));return t}function i(e,t,n,i,r){this.foreground=e||"white",this.underline=t||!1,this.italics=n||!1,this.background=i||"black",this.flash=r||!1}function r(e,t,n,r,a,o){this.uchar=e||" ",this.penState=new i(t,n,r,a,o)}function a(){this.chars=[];for(var e=0;e<32;e++)this.chars.push(new r);this.pos=0,this.currPenState=new i}function o(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new a);this.currRow=14,this.nrRollUpRows=null,this.reset()}function s(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new o,this.nonDisplayedMemory=new o,this.lastOutputScreen=new o,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}function l(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new s(1,t),new s(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}}var d={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},c={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},u={17:2,18:4,21:6,22:8,23:10,19:13,20:15},f={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},h={25:2,26:4,29:6,30:8,31:10,27:13,28:15},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],g={verboseFilter:{DATA:3,DEBUG:3,INFO:2,WARNING:2,TEXT:1,ERROR:0},time:null,verboseLevel:0,setTime:function(e){this.time=e},log:function(e,t){var n=this.verboseFilter[e];this.verboseLevel>=n&&console.log(this.time+" ["+e+"] "+t)}};i.prototype={reset:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},setStyles:function(e){for(var t=["foreground","underline","italics","background","flash"],n=0;n<t.length;n++){var i=t[n];e.hasOwnProperty(i)&&(this[i]=e[i])}},isDefault:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash},equals:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash},copy:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash},toString:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}},r.prototype={reset:function(){this.uchar=" ",this.penState.reset()},setChar:function(e,t){this.uchar=e,this.penState.copy(t)},setPenState:function(e){this.penState.copy(e)},equals:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)},copy:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)},isEmpty:function(){return" "===this.uchar&&this.penState.isDefault()}},a.prototype={equals:function(e){for(var t=!0,n=0;n<32;n++)if(!this.chars[n].equals(e.chars[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<32;t++)this.chars[t].copy(e.chars[t])},isEmpty:function(){for(var e=!0,t=0;t<32;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e},setCursor:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(g.log("ERROR","Negative cursor position "+this.pos),this.pos=0):32<this.pos&&(g.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(1<e)for(var n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)},backSpace:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},insertChar:function(e){144<=e&&this.backSpace();var n=t(e);32<=this.pos?g.log("ERROR","Cannot insert "+e.toString(16)+" ("+n+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(n,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){for(var t=e;t<32;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<32;n++){var i=this.chars[n].uchar;" "!==i&&(t=!1),e.push(i)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}},o.prototype={reset:function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){g.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){g.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.currRow=t;var n,i,r=this.rows[this.currRow];null!==e.indent&&(n=e.indent,i=Math.max(n-1,0),r.setCursor(e.indent),e.color=r.chars[i].penState.foreground);var a={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(a)},setBkgData:function(e){g.log("INFO","bkgData = "+JSON.stringify(e)),this.backSpace(),this.setPen(e),this.insertChar(32)},setRollUpRows:function(e){this.nrRollUpRows=e},rollUp:function(){var e,t;null!==this.nrRollUpRows?(g.log("TEXT",this.getDisplayText()),e=this.currRow+1-this.nrRollUpRows,(t=this.rows.splice(e,1)[0]).clear(),this.rows.splice(this.currRow,0,t),g.log("INFO","Rolling up")):g.log("DEBUG","roll_up but nrRollUpRows not set yet")},getDisplayText:function(e){e=e||!1;for(var t=[],n="",i=-1,r=0;r<15;r++){var a=this.rows[r].getTextString();a&&(i=r+1,e?t.push("Row "+i+': "'+a+'"'):t.push(a.trim()))}return 0<t.length&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}},s.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,g.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t<e.length;t++)this.writeScreen.insertChar(e[t]);var n=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";g.log("INFO",n+": "+this.writeScreen.getDisplayText(!0)),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(g.log("TEXT","DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},cc_RCL:function(){g.log("INFO","RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},cc_BS:function(){g.log("INFO","BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},cc_AOF:function(){},cc_AON:function(){},cc_DER:function(){g.log("INFO","DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},cc_RU:function(e){g.log("INFO","RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)},cc_FON:function(){g.log("INFO","FON - Flash On"),this.writeScreen.setPen({flash:!0})},cc_RDC:function(){g.log("INFO","RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},cc_TR:function(){g.log("INFO","TR"),this.setMode("MODE_TEXT")},cc_RTD:function(){g.log("INFO","RTD"),this.setMode("MODE_TEXT")},cc_EDM:function(){g.log("INFO","EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate()},cc_CR:function(){g.log("CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate()},cc_ENM:function(){g.log("INFO","ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},cc_EOC:function(){var e;g.log("INFO","EOC - End Of Caption"),"MODE_POP-ON"===this.mode&&(e=this.displayedMemory,this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,g.log("TEXT","DISP: "+this.displayedMemory.getDisplayText())),this.outputDataUpdate()},cc_TO:function(e){g.log("INFO","TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)},cc_MIDROW:function(e){var t,n={flash:!1};n.underline=e%2==1,n.italics=46<=e,n.italics?n.foreground="white":(t=Math.floor(e/2)-16,n.foreground=["white","green","blue","cyan","red","yellow","magenta"][t]),g.log("INFO","MIDROW: "+JSON.stringify(n)),this.writeScreen.setPen(n)},outputDataUpdate:function(){var e=g.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}},l.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var i,r=!1;this.lastTime=e,g.setTime(e);for(var a=0;a<t.length;a+=2){var o=127&t[a],s=127&t[a+1];16<=o&&o<=31&&o===this.lastCmdA&&s===this.lastCmdB?(this.lastCmdA=null,this.lastCmdB=null,g.log("DEBUG","Repeated command ("+n([o,s])+") is dropped")):0!=o||0!=s?(g.log("DATA","["+n([t[a],t[a+1]])+"] -> ("+n([o,s])+")"),(i=(i=(i=(i=this.parseCmd(o,s))||this.parseMidrow(o,s))||this.parsePAC(o,s))||this.parseBackgroundAttributes(o,s))||(r=this.parseChars(o,s))&&(this.currChNr&&0<=this.currChNr?this.channels[this.currChNr-1].insertChars(r):g.log("WARNING","No channel found yet. TEXT-MODE?")),i?this.dataCounters.cmd+=2:r?this.dataCounters.char+=2:(this.dataCounters.other+=2,g.log("WARNING","Couldn't parse cleaned data "+n([o,s])+" orig: "+n([t[a],t[a+1]])))):this.dataCounters.padding+=2}},parseCmd:function(e,t){var n=null;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47||(23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var i=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?i.cc_RCL():33===t?i.cc_BS():34===t?i.cc_AOF():35===t?i.cc_AON():36===t?i.cc_DER():37===t?i.cc_RU(2):38===t?i.cc_RU(3):39===t?i.cc_RU(4):40===t?i.cc_FON():41===t?i.cc_RDC():42===t?i.cc_TR():43===t?i.cc_RTD():44===t?i.cc_EDM():45===t?i.cc_CR():46===t?i.cc_ENM():47===t&&i.cc_EOC():i.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var i=null;if((17===e||25===e)&&32<=t&&t<=47){if((i=17===e?1:2)!==this.currChNr)return g.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[i-1];return r.insertChars([32]),r.cc_MIDROW(t),g.log("DEBUG","MIDROW ("+n([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,i=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127||(16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,i=64<=t&&t<=95?1==n?c[e]:f[e]:1==n?u[e]:h[e];var r=this.interpretPAC(i,t);return this.channels[n-1].setPAC(r),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,i={color:null,italics:!1,indent:null,underline:!1,row:e};n=95<t?t-96:t-64;return i.underline=1==(1&n),n<=13?i.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(i.italics=!0,i.color="white"):i.indent=4*Math.floor((n-16)/2),i},parseChars:function(e,i){var r,a,o=null,s=null,l=null;return 17<=(l=25<=e?(o=2,e-8):(o=1,e))&&l<=19?(r=i,r=17===l?i+80:18===l?i+112:i+144,g.log("INFO","Special char '"+t(r)+"' in channel "+o),s=[r],this.lastCmdA=e,this.lastCmdB=i):32<=e&&e<=127&&(s=0===i?[e]:[e,i],this.lastCmdA=null,this.lastCmdB=null),s&&(a=n(s),g.log("DEBUG","Char codes =  "+a.join(","))),s},parseBackgroundAttributes:function(e,t){var n,i,r;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(i=Math.floor((t-32)/2),n.background=p[i],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),r=e<24?1:2,this.channels[r-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e<this.channels.length;e++)this.channels[e]&&this.channels[e].reset();this.lastCmdA=null,this.lastCmdB=null},cueSplitAtTime:function(e){for(var t=0;t<this.channels.length;t++)this.channels[t]&&this.channels[t].cueSplitAtTime(e)}},e.logger=g,e.PenState=i,e.CaptionScreen=o,e.Cea608Parser=l,e.findCea608Nalus=function(e,t,n){for(var i=0,r=t,a=[];r<t+n;){if(i=e.getUint32(r),6==(31&e.getUint8(r+4)))for(var o=r+5,s=-1;o<r+4+i-1;){s=0;for(var l=255;255===l;)s+=l=e.getUint8(o),o++;var d=0;for(l=255;255===l;)d+=l=e.getUint8(o),o++;!function(e,t,n,i){if(4!==e||t<8)return null;var r=n.getUint8(i),a=n.getUint16(i+1),o=n.getUint32(i+3),s=n.getUint8(i+7);return 181==r&&49==a&&1195456820==o&&3==s}(s,d,e,o)||a.push([o,d]),o+=d}r+=i+4}return a},e.extractCea608DataFromRange=function(e,t){var n=t[0],i=[[],[]];n+=8;var r=31&e.getUint8(n);n+=2;for(var a=0;a<r;a++){var o=e.getUint8(n),s=4&o,l=3&o;n++;var d=e.getUint8(n);n++;var c=e.getUint8(n);n++,s&&(127&d)+(127&c)!=0&&(0==l?(i[0].push(d),i[0].push(c)):1==l&&(i[1].push(d),i[1].push(c)))}return i}}(void 0===n?(void 0).cea608parser={}:n)},{}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(e){function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function n(e){return"string"==typeof e?e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;"):e}function i(e,t,n,i){for(var r=0;r<e.length;r++){var a=e[r];if("string"==typeof a){if(a==i)break}else if(a instanceof RegExp){if(a.test(i))break}else if("function"==typeof a&&a(t,n,i))break}return r!=e.length}function r(t,n,r){switch(e.arrayAccessForm){case"property":t[n]instanceof Array?t[n+"_asArray"]=t[n]:t[n+"_asArray"]=[t[n]]}!(t[n]instanceof Array)&&0<e.arrayAccessFormPaths.length&&i(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function a(e){var t,n=e.split(/[-T:+Z]/g),i=new Date(n[0],n[1]-1,n[2]),r=n[5].split(".");return i.setHours(n[3],n[4],r[0]),1<r.length&&i.setMilliseconds(r[1]),n[6]&&n[7]?(t=60*n[6]+Number(n[7]),t=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*t:t),i.setMinutes(i.getMinutes()-t-i.getTimezoneOffset())):-1!==e.indexOf("Z",e.length-1)&&(i=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()))),i}function o(n,s){if(n.nodeType==g.DOCUMENT_NODE){for(var l=new Object,d=n.childNodes,c=0;c<d.length;c++)(f=d[c]).nodeType==g.ELEMENT_NODE&&(e.ignoreRoot?l=o(f):(l={})[v=t(f)]=o(f));return l}if(n.nodeType==g.ELEMENT_NODE){(l=new Object).__cnt=0;var u=[];for(d=n.childNodes,c=0;c<d.length;c++){var f,h,p,m,v=t(f=d[c]);f.nodeType!=g.COMMENT_NODE&&(k=l,I=v,A=h=s+"."+v,f.nodeType==g.ELEMENT_NODE&&0<e.xmlElementsFilter.length&&!i(e.xmlElementsFilter,k,I,A)||(l.__cnt++,null==l[v]?(p=o(f,h),"#text"==v&&!/[^\s]/.test(p)||((m={})[v]=p,u.push(m)),l[v]=p,r(l,v,h)):(null!=l[v]&&(l[v]instanceof Array||(l[v]=[l[v]],r(l,v,h))),p=o(f,h),"#text"==v&&!/[^\s]/.test(p)||((m={})[v]=p,u.push(m)),l[v][l[v].length]=p)))}l.__children=u;for(var y=t(n),_=0;_<n.attributes.length;_++){var b=n.attributes[_];l.__cnt++;for(var E=b.value,w=0,T=e.matchers.length;w<T;w++){var S=e.matchers[w];S.test(b,y)&&(E=S.converter(b.value))}l[e.attributePrefix+b.name]=E}var C=n.prefix;return null!=C&&""!=C&&(l.__cnt++,l.__prefix=C),null!=l["#text"]&&(l.__text=l["#text"],l.__text instanceof Array&&(l.__text=l.__text.join("\n")),e.stripWhitespaces&&(l.__text=l.__text.trim()),delete l["#text"],"property"==e.arrayAccessForm&&delete l["#text_asArray"],l.__text=function(t,n,r){if(0<e.datetimeAccessFormPaths.length){var o=r.split(".#")[0];return i(e.datetimeAccessFormPaths,t,n,o)?a(t):t}return t}(l.__text,v,s+"."+v)),null!=l["#cdata-section"]&&(l.__cdata=l["#cdata-section"],delete l["#cdata-section"],"property"==e.arrayAccessForm&&delete l["#cdata-section_asArray"]),0==l.__cnt&&"text"==e.emptyNodeForm?l="":1==l.__cnt&&null!=l.__text?l=l.__text:1!=l.__cnt||null==l.__cdata||e.keepCData?1<l.__cnt&&null!=l.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==l.__text||""==l.__text.trim())&&delete l.__text:l=l.__cdata,delete l.__cnt,!e.enableToStringFunc||null==l.__text&&null==l.__cdata||(l.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),l}if(n.nodeType==g.TEXT_NODE||n.nodeType==g.CDATA_SECTION_NODE)return n.nodeValue;var k,I,A}function s(t,i,r,a){var o="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+i;if(null!=r)for(var s=0;s<r.length;s++){var l=r[s],d=t[l];e.escapeMode&&(d=n(d)),o+=" "+l.substr(e.attributePrefix.length)+"=",e.useDoubleQuotes?o+='"'+d+'"':o+="'"+d+"'"}return o+(a?"/>":">")}function l(e,t){return"</"+(null!=e.__prefix?e.__prefix+":":"")+t+">"}function d(t,n){return"property"==e.arrayAccessForm&&(r="_asArray",-1!==(i=n.toString()).indexOf(r,i.length-r.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var i,r}function c(e){var t=0;if(e instanceof Object)for(var n in e)d(e,n)||t++;return t}function u(t){var n=[];if(t instanceof Object)for(var i in t)-1==i.toString().indexOf("__")&&0==i.toString().indexOf(e.attributePrefix)&&n.push(i);return n}function f(t){var i,r,a="";return t instanceof Object?a+=(r="",null!=(i=t).__cdata&&(r+="<![CDATA["+i.__cdata+"]]>"),null!=i.__text&&(e.escapeMode?r+=n(i.__text):r+=i.__text),r):null!=t&&(e.escapeMode?a+=n(t):a+=t),a}function h(e,t){return""===e?t:e+"."+t}function p(t,n){var r,a,o,g,m,v="";if(0<c(t))for(var y in t)d(t,y)||""!=n&&(o=t,m=h(n,g=y),0!=e.jsonPropertiesFilter.length&&""!=m&&!i(e.jsonPropertiesFilter,o,g,m))||(a=u(r=t[y]),null==r||null==r?v+=s(r,y,a,!0):r instanceof Object?r instanceof Array?v+=function(e,t,n,i){var r="";if(0==e.length)r+=s(e,t,n,!0);else for(var a=0;a<e.length;a++)r+=s(e[a],t,u(e[a]),!1),r+=p(e[a],h(i,t)),r+=l(e[a],t);return r}(r,y,a,n):r instanceof Date?(v+=s(r,y,a,!1),v+=r.toISOString(),v+=l(r,y)):0<c(r)||null!=r.__text||null!=r.__cdata?(v+=s(r,y,a,!1),v+=p(r,h(n,y)),v+=l(r,y)):v+=s(r,y,a,!0):(v+=s(r,y,a,!1),v+=f(r),v+=l(r,y)));return v+f(t)}void 0===(e=e||{}).escapeMode&&(e.escapeMode=!0),void 0===e.attributePrefix&&(e.attributePrefix="_"),e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1),void 0===e.ignoreRoot&&(e.ignoreRoot=!1);var g={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(e){var t;if(window.ActiveXObject||window,void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{0<(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length&&(t=null)}catch(e){t=null}}else 0==e.indexOf("<?")&&(e=e.substr(e.indexOf("?>")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?a(e):e},this.xml2json=function(e){return o(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return p(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},t.exports=n.default},{}],4:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=e(5),a=i(e(125)),o=i(e(162)),s=i(e(102)),l=i(e(45));dashjs.Protection=o.default,dashjs.MetricsReporting=a.default,dashjs.MediaPlayerFactory=s.default,dashjs.Debug=l.default,n.default=dashjs,n.MediaPlayer=r.MediaPlayer,n.Protection=o.default,n.MetricsReporting=a.default,n.MediaPlayerFactory=s.default,n.Debug=l.default},{102:102,125:125,162:162,45:45,5:5}],5:[function(e,t,n){(function(t){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(n,"__esModule",{value:!0});var r=i(e(100)),a=i(e(47)),o=i(e(45)),s=e(50),l="undefined"!=typeof window&&window||t,d=l.dashjs;(d=d||(l.dashjs={})).MediaPlayer=r.default,d.FactoryMaker=a.default,d.Debug=o.default,d.Version=(0,s.getVersionString)(),n.default=d,n.MediaPlayer=r.default,n.FactoryMaker=a.default,n.Debug=o.default}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{100:100,45:45,47:47,50:50}],6:[function(e,t,n){"use strict";function i(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}n.byteLength=function(e){var t=i(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){for(var t,n=i(e),r=n[0],s=n[1],l=new o(function(e,t){return 3*(e+t)/4-t}(r,s)),d=0,c=0<s?r-4:r,u=0;u<c;u+=4)t=a[e.charCodeAt(u)]<<18|a[e.charCodeAt(u+1)]<<12|a[e.charCodeAt(u+2)]<<6|a[e.charCodeAt(u+3)],l[d++]=t>>16&255,l[d++]=t>>8&255,l[d++]=255&t;return 2===s&&(t=a[e.charCodeAt(u)]<<2|a[e.charCodeAt(u+1)]>>4,l[d++]=255&t),1===s&&(t=a[e.charCodeAt(u)]<<10|a[e.charCodeAt(u+1)]<<4|a[e.charCodeAt(u+2)]>>2,l[d++]=t>>8&255,l[d++]=255&t),l},n.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=0,s=n-i;o<s;o+=16383)a.push(function(e,t,n){for(var i,a=[],o=t;o<n;o+=3)i=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),a.push(function(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}(i));return a.join("")}(e,o,s<o+16383?s:o+16383));return 1==i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2==i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),a.join("")};for(var r=[],a=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,d=s.length;l<d;++l)r[l]=s[l],a[s.charCodeAt(l)]=l;a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],7:[function(){},{}],8:[function(e,t,n){"use strict";function i(e){if(D<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=r.prototype,t}function r(e,t,n){if("number"!=typeof e)return a(e,t,n);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return s(e)}function a(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!r.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|c(e,t),a=i(n),o=a.write(e,t);return o!==n&&(a=a.slice(0,o)),a}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(k(e,ArrayBuffer)||e&&k(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var i;return(i=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n)).__proto__=r.prototype,i}(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var a=e.valueOf&&e.valueOf();if(null!=a&&a!==e)return r.from(a,t,n);var o=function(e){if(r.isBuffer(e)){var t=0|d(e.length),n=i(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||I(e.length)?i(0):l(e):"Buffer"===e.type&&Array.isArray(e.data)?l(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return r.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function s(e){return o(e),i(e<0?0:0|d(e))}function l(e){for(var t=e.length<0?0:0|d(e.length),n=i(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function d(e){if(D<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+D.toString(16)+" bytes");return 0|e}function c(e,t){if(r.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||k(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=2<arguments.length&&!0===arguments[2];if(!i&&0===n)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return T(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return S(e).length;default:if(a)return i?-1:T(e).length;t=(""+t).toLowerCase(),a=!0}}function u(e,t,n){var i,r,a,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||i<n)&&(n=i);for(var r="",a=t;a<n;++a)r+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(e[a]);return r}(this,t,n);case"utf8":case"utf-8":return v(this,t,n);case"ascii":return function(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}(this,t,n);case"latin1":case"binary":return function(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}(this,t,n);case"base64":return i=this,a=n,0===(r=t)&&a===i.length?A.fromByteArray(i):A.fromByteArray(i.slice(r,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,n){for(var i=e.slice(t,n),r="",a=0;a<i.length;a+=2)r+=String.fromCharCode(i[a]+256*i[a+1]);return r}(this,t,n);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function f(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function h(e,t,n,i,a){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),I(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=r.from(t,i)),r.isBuffer(t))return 0===t.length?-1:p(e,t,n,i,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):p(e,[t],n,i,a);throw new TypeError("val must be string, number or Buffer")}function p(e,t,n,i,r){function a(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}var o=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=o=2,l/=2,n/=2}if(r)for(var d=-1,c=n;c<s;c++)if(a(e,c)===a(t,-1===d?0:c-d)){if(-1===d&&(d=c),c-d+1===l)return d*o}else-1!==d&&(c-=c-d),d=-1;else for(s<n+l&&(n=s-l),c=n;0<=c;c--){for(var u=!0,f=0;f<l;f++)if(a(e,c+f)!==a(t,f)){u=!1;break}if(u)return c}return-1}function g(e,t,n,i){return C(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function m(e,t,n,i){return C(function(e,t){for(var n,i,r,a=[],o=0;o<e.length&&!((t-=2)<0);++o)i=(n=e.charCodeAt(o))>>8,r=n%256,a.push(r),a.push(i);return a}(t,e.length-n),e,n,i)}function v(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var a,o,s,l,d=e[r],c=null,u=239<d?4:223<d?3:191<d?2:1;if(r+u<=n)switch(u){case 1:d<128&&(c=d);break;case 2:128==(192&(a=e[r+1]))&&127<(l=(31&d)<<6|63&a)&&(c=l);break;case 3:a=e[r+1],o=e[r+2],128==(192&a)&&128==(192&o)&&2047<(l=(15&d)<<12|(63&a)<<6|63&o)&&(l<55296||57343<l)&&(c=l);break;case 4:a=e[r+1],o=e[r+2],s=e[r+3],
128==(192&a)&&128==(192&o)&&128==(192&s)&&65535<(l=(15&d)<<18|(63&a)<<12|(63&o)<<6|63&s)&&l<1114112&&(c=l)}null===c?(c=65533,u=1):65535<c&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),r+=u}return function(e){var t=e.length;if(t<=R)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=R));return n}(i)}function y(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(n<e+t)throw new RangeError("Trying to access beyond buffer length")}function _(e,t,n,i,a,o){if(!r.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(a<t||t<o)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function b(e,t,n,i){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function E(e,t,n,i,r){return t=+t,n>>>=0,r||b(e,0,n,4),x.write(e,t,n,i,23,4),n+4}function w(e,t,n,i,r){return t=+t,n>>>=0,r||b(e,0,n,8),x.write(e,t,n,i,52,8),n+8}function T(e,t){var n;t=t||1/0;for(var i=e.length,r=null,a=[],o=0;o<i;++o){if(55295<(n=e.charCodeAt(o))&&n<57344){if(!r){if(56319<n){-1<(t-=3)&&a.push(239,191,189);continue}if(o+1===i){-1<(t-=3)&&a.push(239,191,189);continue}r=n;continue}if(n<56320){-1<(t-=3)&&a.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&-1<(t-=3)&&a.push(239,191,189);if(r=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function S(e){return A.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function C(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function k(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function I(e){return e!=e}var A=e(6),x=e(13);n.Buffer=r,n.SlowBuffer=function(e){return+e!=e&&(e=0),r.alloc(+e)},n.INSPECT_MAX_BYTES=50;var D=2147483647;n.kMaxLength=D,(r.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),r.poolSize=8192,r.from=a,r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array,r.alloc=function(e,t,n){return a=t,s=n,o(r=e),r<=0||void 0===a?i(r):"string"==typeof s?i(r).fill(a,s):i(r).fill(a);var r,a,s},r.allocUnsafe=s,r.allocUnsafeSlow=s,r.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==r.prototype},r.compare=function(e,t){if(k(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),k(t,Uint8Array)&&(t=r.from(t,t.offset,t.byteLength)),!r.isBuffer(e)||!r.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},r.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return r.alloc(0);if(void 0===t)for(a=t=0;a<e.length;++a)t+=e[a].length;for(var n=r.allocUnsafe(t),i=0,a=0;a<e.length;++a){var o=e[a];if(k(o,Uint8Array)&&(o=r.from(o)),!r.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},r.byteLength=c,r.prototype._isBuffer=!0,r.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)f(this,t,t+1);return this},r.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)f(this,t,t+3),f(this,t+1,t+2);return this},r.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)f(this,t,t+7),f(this,t+1,t+6),f(this,t+2,t+5),f(this,t+3,t+4);return this},r.prototype.toLocaleString=r.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?v(this,0,e):u.apply(this,arguments)},r.prototype.equals=function(e){if(!r.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===r.compare(this,e)},r.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},r.prototype.compare=function(e,t,n,i,a){if(k(e,Uint8Array)&&(e=r.from(e,e.offset,e.byteLength)),!r.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===a&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(a<=i&&n<=t)return 0;if(a<=i)return-1;if(n<=t)return 1;if(this===e)return 0;for(var o=(a>>>=0)-(i>>>=0),s=(n>>>=0)-(t>>>=0),l=Math.min(o,s),d=this.slice(i,a),c=e.slice(t,n),u=0;u<l;++u)if(d[u]!==c[u]){o=d[u],s=c[u];break}return o<s?-1:s<o?1:0},r.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},r.prototype.indexOf=function(e,t,n){return h(this,e,t,n,!0)},r.prototype.lastIndexOf=function(e,t,n){return h(this,e,t,n,!1)},r.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||r<n)&&(n=r),0<e.length&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i=i||"utf8";for(var a,o,s,l,d,c,u=!1;;)switch(i){case"hex":return function(e,t,n,i){n=Number(n)||0;var r=e.length-n;(!i||r<(i=Number(i)))&&(i=r);var a=t.length;a/2<i&&(i=a/2);for(var o=0;o<i;++o){var s=parseInt(t.substr(2*o,2),16);if(I(s))return o;e[n+o]=s}return o}(this,e,t,n);case"utf8":case"utf-8":return d=t,c=n,C(T(e,(l=this).length-d),l,d,c);case"ascii":return g(this,e,t,n);case"latin1":case"binary":return g(this,e,t,n);case"base64":return a=this,o=t,s=n,C(S(e),a,o,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m(this,e,t,n);default:if(u)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),u=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;r.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),t<e&&(t=e);var i=this.subarray(e,t);return i.__proto__=r.prototype,i},r.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var i=this[e],r=1,a=0;++a<t&&(r*=256);)i+=this[e+a]*r;return i},r.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var i=this[e+--t],r=1;0<t&&(r*=256);)i+=this[e+--t]*r;return i},r.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},r.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},r.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},r.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},r.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},r.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var i=this[e],r=1,a=0;++a<t&&(r*=256);)i+=this[e+a]*r;return(r*=128)<=i&&(i-=Math.pow(2,8*t)),i},r.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||y(e,t,this.length);for(var i=t,r=1,a=this[e+--i];0<i&&(r*=256);)a+=this[e+--i]*r;return(r*=128)<=a&&(a-=Math.pow(2,8*t)),a},r.prototype.readInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},r.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},r.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},r.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),x.read(this,e,!0,23,4)},r.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),x.read(this,e,!1,23,4)},r.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),x.read(this,e,!0,52,8)},r.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),x.read(this,e,!1,52,8)},r.prototype.writeUIntLE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||_(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,a=0;for(this[t]=255&e;++a<n&&(r*=256);)this[t+a]=e/r&255;return t+n},r.prototype.writeUIntBE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||_(this,e,t,n,Math.pow(2,8*n)-1,0);var r=n-1,a=1;for(this[t+r]=255&e;0<=--r&&(a*=256);)this[t+r]=e/a&255;return t+n},r.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,1,255,0),this[t]=255&e,t+1},r.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},r.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},r.prototype.writeIntLE=function(e,t,n,i){var r;e=+e,t>>>=0,i||_(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},r.prototype.writeIntBE=function(e,t,n,i){var r;e=+e,t>>>=0,i||_(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var a=n-1,o=1,s=0;for(this[t+a]=255&e;0<=--a&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},r.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},r.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},r.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},r.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},r.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},r.prototype.writeFloatLE=function(e,t,n){return E(this,e,t,!0,n)},r.prototype.writeFloatBE=function(e,t,n){return E(this,e,t,!1,n)},r.prototype.writeDoubleLE=function(e,t,n){return w(this,e,t,!0,n)},r.prototype.writeDoubleBE=function(e,t,n){return w(this,e,t,!1,n)},r.prototype.copy=function(e,t,n,i){if(!r.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n=n||0,i||0===i||(i=this.length),t>=e.length&&(t=e.length),t=t||0,0<i&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,i);else if(this===e&&n<t&&t<i)for(var o=a-1;0<=o;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),t);return a},r.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!r.isEncoding(i))throw new TypeError("Unknown encoding: "+i);var a;1===e.length&&(a=e.charCodeAt(0),("utf8"===i&&a<128||"latin1"===i)&&(e=a))}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(e=e||0))for(o=t;o<n;++o)this[o]=e;else{var s=r.isBuffer(e)?e:r.from(e,i),l=s.length;if(0===l)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=s[o%l]}return this};var M=/[^+/0-9A-Za-z-_]/g},{13:13,6:6}],9:[function(e,t,n){var i={parseBuffer:function(e){return new r(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(a.prototype._boxProcessors[e]=t)},createFile:function(){return new r},createBox:function(e,t,n){var i=a.create(e);return t&&t.append(i,n),i},createFullBox:function(e,t,n){var r=i.createBox(e,t,n);return r.version=0,r.flags=0,r},Utils:{}};i.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var i=[],r=0;if("utf-8"===n)for(;r<e.byteLength;){var a=e.getUint8(r++);a<128||(a<224?a=(31&a)<<6:(a<240?a=(15&a)<<12:(a=(7&a)<<18,a|=(63&e.getUint8(r++))<<12),a|=(63&e.getUint8(r++))<<6),a|=63&e.getUint8(r++)),i.push(String.fromCharCode(a))}else for(;r<e.byteLength;)i.push(String.fromCharCode(e.getUint8(r++)));return i.join("")},i.Utils.utf8ToByteArray=function(e){var t,n;if("undefined"!=typeof TextEncoder)t=(new TextEncoder).encode(e);else for(t=[],n=0;n<e.length;++n){var i=e.charCodeAt(n);i<128?t.push(i):(i<2048?t.push(192|i>>6):(i<65536?t.push(224|i>>12):(t.push(240|i>>18),t.push(128|63&i>>12)),t.push(128|63&i>>6)),t.push(128|63&i))}return t},i.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var i,r=-1;if("number"==typeof n)r=n;else{if("string"==typeof n)i=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);i=n.type}for(var a=0;a<e.boxes.length;a++)if(i===e.boxes[a].type){r=a+1;break}}e.boxes.splice(r,0,t)}else e.boxes.push(t)},void 0!==n&&(n.parseBuffer=i.parseBuffer,n.addBoxProcessor=i.addBoxProcessor,n.createFile=i.createFile,n.createBox=i.createBox,n.createFullBox=i.createFullBox,n.Utils=i.Utils),i.Cursor=function(e){this.offset=void 0===e?0:e};var r=function(e){this._cursor=new i.Cursor,this.boxes=[],e&&(this._raw=new DataView(e))};r.prototype.fetch=function(e){var t=this.fetchAll(e,!0);return t.length?t[0]:null},r.prototype.fetchAll=function(e,t){var n=[];return r._sweep.call(this,e,n,t),n},r.prototype.parse=function(){for(this._cursor.offset=0,this.boxes=[];this._cursor.offset<this._raw.byteLength;){var e=a.parse(this);if(void 0===e.type)break;this.boxes.push(e)}return this},r._sweep=function(e,t,n){for(var i in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;r._sweep.call(this.boxes[i],e,t,n)}},r.prototype.write=function(){for(var e=0,t=0;t<this.boxes.length;t++)e+=this.boxes[t].getLength(!1);var n=new Uint8Array(e);for(this._rawo=new DataView(n.buffer),this.bytes=n,t=this._cursor.offset=0;t<this.boxes.length;t++)this.boxes[t].write();return n.buffer},r.prototype.append=function(e,t){i.Utils.appendBox(this,e,t)};var a=function(){this._cursor=new i.Cursor};a.parse=function(e){var t=new a;return t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,t._parseBox(),e._cursor.offset=t._raw.byteOffset+t._raw.byteLength,t},a.create=function(e){var t=new a;return t.type=e,t.boxes=[],t},a.prototype._boxContainers=["dinf","edts","mdia","meco","mfra","minf","moof","moov","mvex","stbl","strk","traf","trak","tref","udta","vttc","sinf","schi","encv","enca"],a.prototype._boxProcessors={},a.prototype._procField=function(e,t,n){this._parsing?this[e]=this._readField(t,n):this._writeField(t,n,this[e])},a.prototype._procFieldArray=function(e,t,n,i){var r;if(this._parsing)for(this[e]=[],r=0;r<t;r++)this[e][r]=this._readField(n,i);else for(r=0;r<this[e].length;r++)this._writeField(n,i,this[e][r])},a.prototype._procFullBox=function(){this._procField("version","uint",8),this._procField("flags","uint",24)},a.prototype._procEntries=function(e,t,n){var i;if(this._parsing)for(this[e]=[],i=0;i<t;i++)this[e].push({}),n.call(this,this[e][i]);else for(i=0;i<t;i++)n.call(this,this[e][i])},a.prototype._procSubEntries=function(e,t,n,i){var r;if(this._parsing)for(e[t]=[],r=0;r<n;r++)e[t].push({}),i.call(this,e[t][r]);else for(r=0;r<n;r++)i.call(this,e[t][r])},a.prototype._procEntryField=function(e,t,n,i){this._parsing?e[t]=this._readField(n,i):this._writeField(n,i,e[t])},a.prototype._procSubBoxes=function(e,t){var n;if(this._parsing)for(this[e]=[],n=0;n<t;n++)this[e].push(a.parse(this));else for(n=0;n<t;n++)this._rawo?this[e][n].write():this.size+=this[e][n].getLength()},a.prototype._readField=function(e,t){switch(e){case"uint":return this._readUint(t);case"int":return this._readInt(t);case"template":return this._readTemplate(t);case"string":return-1===t?this._readTerminatedString():this._readString(t);case"data":return this._readData(t);case"utf8":return this._readUTF8String();default:return-1}},a.prototype._readInt=function(e){var t=null,n=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:t=this._raw.getInt8(n);break;case 16:t=this._raw.getInt16(n);break;case 32:t=this._raw.getInt32(n);break;case 64:var i=this._raw.getInt32(n),r=this._raw.getInt32(4+n);t=i*Math.pow(2,32)+r}return this._cursor.offset+=e>>3,t},a.prototype._readUint=function(e){var t,n,i=null,r=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:i=this._raw.getUint8(r);break;case 16:i=this._raw.getUint16(r);break;case 24:i=((t=this._raw.getUint16(r))<<8)+(n=this._raw.getUint8(2+r));break;case 32:i=this._raw.getUint32(r);break;case 64:t=this._raw.getUint32(r),n=this._raw.getUint32(4+r),i=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,i},a.prototype._readString=function(e){for(var t="",n=0;n<e;n++){var i=this._readUint(8);t+=String.fromCharCode(i)}return t},a.prototype._readTemplate=function(e){return this._readUint(e/2)+this._readUint(e/2)/Math.pow(2,e/2)},a.prototype._readTerminatedString=function(){for(var e="";this._cursor.offset-this._offset<this._raw.byteLength;){var t=this._readUint(8);if(0===t)break;e+=String.fromCharCode(t)}return e},a.prototype._readData=function(e){var t=0<e?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(0<t){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},a.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return 0<e&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?i.Utils.dataViewToString(t):t},a.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},a.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},a.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset<this._raw.byteLength;)this.boxes.push(a.parse(this))},a.prototype.append=function(e,t){i.Utils.appendBox(this,e,t)},a.prototype.getLength=function(){if(this._parsing=!1,this._rawo=null,this.size=0,this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.size+=this.boxes[e].getLength();return this._data&&this._writeData(this._data),this.size},a.prototype.write=function(){switch(this._parsing=!1,this._cursor.offset=this._parent._cursor.offset,this.size){case 0:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.parent._rawo.byteLength-this._cursor.offset);break;case 1:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.largesize);break;default:this._rawo=new DataView(this._parent._rawo.buffer,this._cursor.offset,this.size)}if(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type))for(var e=0;e<this.boxes.length;e++)this.boxes[e].write();return this._data&&this._writeData(this._data),this._parent._cursor.offset+=this.size,this.size},a.prototype._writeInt=function(e,t){if(this._rawo){var n=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setInt8(n,t);break;case 16:this._rawo.setInt16(n,t);break;case 32:this._rawo.setInt32(n,t);break;case 64:var i=Math.floor(t/Math.pow(2,32)),r=t-i*Math.pow(2,32);this._rawo.setUint32(n,i),this._rawo.setUint32(4+n,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeUint=function(e,t){if(this._rawo){var n,i,r=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(r,t);break;case 16:this._rawo.setUint16(r,t);break;case 24:n=(16776960&t)>>8,i=255&t,this._rawo.setUint16(r,n),this._rawo.setUint8(2+r,i);break;case 32:this._rawo.setUint32(r,t);break;case 64:i=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(r,n),this._rawo.setUint32(4+r,i)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeString=function(e,t){for(var n=0;n<e;n++)this._writeUint(8,t.charCodeAt(n))},a.prototype._writeTerminatedString=function(e){if(0!==e.length){for(var t=0;t<e.length;t++)this._writeUint(8,e.charCodeAt(t));this._writeUint(8,0)}},a.prototype._writeTemplate=function(e,t){var n=Math.floor(t),i=(t-n)*Math.pow(2,e/2);this._writeUint(e/2,n),this._writeUint(e/2,i)},a.prototype._writeData=function(e){if(e)if(this._rawo){if(e instanceof Array){for(var t=this._cursor.offset-this._rawo.byteOffset,n=0;n<e.length;n++)this._rawo.setInt8(t+n,e[n]);this._cursor.offset+=e.length}e instanceof Uint8Array&&(this._root.bytes.set(e,this._cursor.offset),this._cursor.offset+=e.length)}else this.size+=e.length},a.prototype._writeUTF8String=function(e){var t=i.Utils.utf8ToByteArray(e);if(this._rawo)for(var n=new DataView(this._rawo.buffer,this._cursor.offset,t.length),r=0;r<t.length;r++)n.setUint8(r,t[r]);else this.size+=t.length},a.prototype._writeField=function(e,t,n){switch(e){case"uint":this._writeUint(t,n);break;case"int":this._writeInt(t,n);break;case"template":this._writeTemplate(t,n);break;case"string":-1==t?this._writeTerminatedString(n):this._writeString(t,n);break;case"data":this._writeData(n);break;case"utf8":this._writeUTF8String(n)}},a.prototype._boxProcessors.avc1=a.prototype._boxProcessors.encv=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procField("pre_defined1","uint",16),this._procField("reserved2","uint",16),this._procFieldArray("pre_defined2",3,"uint",32),this._procField("width","uint",16),this._procField("height","uint",16),this._procField("horizresolution","template",32),this._procField("vertresolution","template",32),this._procField("reserved3","uint",32),this._procField("frame_count","uint",16),this._procFieldArray("compressorname",32,"uint",8),this._procField("depth","uint",16),this._procField("pre_defined3","int",16),this._procField("config","data",-1)},a.prototype._boxProcessors.dref=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.elst=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"segment_duration","uint",1===this.version?64:32),this._procEntryField(e,"media_time","int",1===this.version?64:32),this._procEntryField(e,"media_rate_integer","int",16),this._procEntryField(e,"media_rate_fraction","int",16)}))},a.prototype._boxProcessors.emsg=function(){this._procFullBox(),1==this.version?(this._procField("timescale","uint",32),this._procField("presentation_time","uint",64),this._procField("event_duration","uint",32),this._procField("id","uint",32),this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1)):(this._procField("scheme_id_uri","string",-1),this._procField("value","string",-1),this._procField("timescale","uint",32),this._procField("presentation_time_delta","uint",32),this._procField("event_duration","uint",32),this._procField("id","uint",32)),this._procField("message_data","data",-1)},a.prototype._boxProcessors.free=a.prototype._boxProcessors.skip=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.frma=function(){this._procField("data_format","uint",32)},a.prototype._boxProcessors.ftyp=a.prototype._boxProcessors.styp=function(){this._procField("major_brand","string",4),this._procField("minor_version","uint",32);var e=-1;this._parsing&&(e=(this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset))/4),this._procFieldArray("compatible_brands",e,"string",4)},a.prototype._boxProcessors.hdlr=function(){this._procFullBox(),this._procField("pre_defined","uint",32),this._procField("handler_type","string",4),this._procFieldArray("reserved",3,"uint",32),this._procField("name","string",-1)},a.prototype._boxProcessors.mdat=function(){this._procField("data","data",-1)},a.prototype._boxProcessors.mdhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._parsing||"string"!=typeof this.language||(this.language=this.language.charCodeAt(0)-96<<10|this.language.charCodeAt(1)-96<<5|this.language.charCodeAt(2)-96),this._procField("language","uint",16),this._parsing&&(this.language=String.fromCharCode(96+(this.language>>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},a.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},a.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},a.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},a.prototype._boxProcessors.mp4a=a.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},a.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},a.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},a.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},a.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},a.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},a.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},a.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},a.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},a.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},a.prototype._boxProcessors.tenc=function(){
this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},a.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},a.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},a.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},a.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},a.prototype._boxProcessors["url "]=a.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},a.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},a.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},a.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},a.prototype._boxProcessors.vtte=function(){}},{}],10:[function(e,t,n){(function(e){function t(e){return Object.prototype.toString.call(e)}n.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},n.isBoolean=function(e){return"boolean"==typeof e},n.isNull=function(e){return null===e},n.isNullOrUndefined=function(e){return null==e},n.isNumber=function(e){return"number"==typeof e},n.isString=function(e){return"string"==typeof e},n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=function(e){return void 0===e},n.isRegExp=function(e){return"[object RegExp]"===t(e)},n.isObject=function(e){return"object"==typeof e&&null!==e},n.isDate=function(e){return"[object Date]"===t(e)},n.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},n.isFunction=function(e){return"function"==typeof e},n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e.isBuffer}).call(this,{isBuffer:e(22)})},{22:22}],11:[function(e,t){function n(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=c(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}function i(e){return void 0===e._maxListeners?n.defaultMaxListeners:e._maxListeners}function r(e,t,n,r){var a,o,s,l;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');return(a=e._events)?(a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]):(a=e._events=c(null),e._eventsCount=0),o?("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),o.warned||(l=i(e))&&0<l&&o.length>l&&(o.warned=!0,(s=new Error("Possible EventEmitter memory leak detected. "+o.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.')).name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=o.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",s.name,s.message))):(o=a[t]=n,++e._eventsCount),e}function a(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function o(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=f.call(a,i);return r.listener=n,i.wrapFn=r}function s(e,t,n){var i=e._events;if(!i)return[];var r=i[t];return r?"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):d(r,r.length):[]}function l(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function d(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}var c=Object.create||function(e){function t(){}return t.prototype=e,new t},u=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return n},f=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};((t.exports=n).EventEmitter=n).prototype._events=void 0,n.prototype._maxListeners=void 0;var h,p=10;try{var g={};Object.defineProperty&&Object.defineProperty(g,"x",{value:0}),h=0===g.x}catch(e){h=!1}h?Object.defineProperty(n,"defaultMaxListeners",{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');p=e}}):n.defaultMaxListeners=p,n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},n.prototype.getMaxListeners=function(){return i(this)},n.prototype.emit=function(e,t,n,i){var r,a,o,s,l="error"===e,c=this._events;if(c)l=l&&null==c.error;else if(!l)return!1;if(l){if(1<arguments.length&&(r=t),r instanceof Error)throw r;var u=new Error('Unhandled "error" event. ('+r+")");throw u.context=r,u}if(!(a=c[e]))return!1;var f,h="function"==typeof a;switch(f=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var i=e.length,r=d(e,i),a=0;a<i;++a)r[a].call(n)}(a,h,this);break;case 2:!function(e,t,n,i){if(t)e.call(n,i);else for(var r=e.length,a=d(e,r),o=0;o<r;++o)a[o].call(n,i)}(a,h,this,t);break;case 3:!function(e,t,n,i,r){if(t)e.call(n,i,r);else for(var a=e.length,o=d(e,a),s=0;s<a;++s)o[s].call(n,i,r)}(a,h,this,t,n);break;case 4:!function(e,t,n,i,r,a){if(t)e.call(n,i,r,a);else for(var o=e.length,s=d(e,o),l=0;l<o;++l)s[l].call(n,i,r,a)}(a,h,this,t,n,i);break;default:for(o=new Array(f-1),s=1;s<f;s++)o[s-1]=arguments[s];!function(e,t,n,i){if(t)e.apply(n,i);else for(var r=e.length,a=d(e,r),o=0;o<r;++o)a[o].apply(n,i)}(a,h,this,o)}return!0},n.prototype.on=n.prototype.addListener=function(e,t){return r(this,e,t,!1)},n.prototype.prependListener=function(e,t){return r(this,e,t,!0)},n.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,o(this,e,t)),this},n.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,o(this,e,t)),this},n.prototype.removeListener=function(e,t){var n,i,r,a,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(i=this._events))return this;if(!(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=c(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,a=n.length-1;0<=a;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,r=a;break}if(r<0)return this;0===r?n.shift():function(e,t){for(var n=t,i=n+1,r=e.length;i<r;n+=1,i+=1)e[n]=e[i];e.pop()}(n,r),1===n.length&&(i[e]=n[0]),i.removeListener&&this.emit("removeListener",e,o||t)}return this},n.prototype.removeAllListeners=function(e){var t,n=this._events;if(!n)return this;if(!n.removeListener)return 0===arguments.length?(this._events=c(null),this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=c(null):delete n[e]),this;if(0===arguments.length){for(var i,r=u(n),a=0;a<r.length;++a)"removeListener"!==(i=r[a])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=c(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)for(a=t.length-1;0<=a;a--)this.removeListener(e,t[a]);return this},n.prototype.listeners=function(e){return s(this,e,!0)},n.prototype.rawListeners=function(e){return s(this,e,!1)},n.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):l.call(e,t)},n.prototype.listenerCount=l,n.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]}},{}],12:[function(e,t){"use strict";var n=Array.isArray,i=Object.keys,r=Object.prototype.hasOwnProperty;t.exports=function e(t,a){if(t===a)return!0;if(t&&a&&"object"==typeof t&&"object"==typeof a){var o,s,l=n(t),d=n(a);if(l&&d){if((p=t.length)!=a.length)return!1;for(o=p;0!=o--;)if(!e(t[o],a[o]))return!1;return!0}if(l!=d)return!1;var c=t instanceof Date,u=a instanceof Date;if(c!=u)return!1;if(c&&u)return t.getTime()==a.getTime();var f=t instanceof RegExp,h=a instanceof RegExp;if(f!=h)return!1;if(f&&h)return t.toString()==a.toString();var p,g=i(t);if((p=g.length)!==i(a).length)return!1;for(o=p;0!=o--;)if(!r.call(a,g[o]))return!1;for(o=p;0!=o--;)if(!e(t[s=g[o]],a[s]))return!1;return!0}return t!=t&&a!=a}},{}],13:[function(e,t,n){n.read=function(e,t,n,i,r){var a,o,s=8*r-i-1,l=(1<<s)-1,d=l>>1,c=-7,u=n?r-1:0,f=n?-1:1,h=e[t+u];for(u+=f,a=h&(1<<-c)-1,h>>=-c,c+=s;0<c;a=256*a+e[t+u],u+=f,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=i;0<c;o=256*o+e[t+u],u+=f,c-=8);if(0===a)a=1-d;else{if(a===l)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,i),a-=d}return(h?-1:1)*o*Math.pow(2,a-i)},n.write=function(e,t,n,i,r,a){var o,s,l,d=8*a-r-1,c=(1<<d)-1,u=c>>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:a-1,p=i?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),2<=(t+=1<=o+u?f/l:f*Math.pow(2,1-u))*l&&(o++,l/=2),c<=o+u?(s=0,o=c):1<=o+u?(s=(t*l-1)*Math.pow(2,r),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,r),o=0));8<=r;e[n+h]=255&s,h+=p,s/=256,r-=8);for(o=o<<r|s,d+=r;0<d;e[n+h]=255&o,h+=p,o/=256,d-=8);e[n+h-p]|=128*g}},{}],14:[function(e,t,n){function i(e,t,n,r){var a=r&&"seq"===r.timeContainer,o=0;r&&(o=a&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+o:o;var s=t.begin,l=null;for(var d in t.sets)i(e,t.sets[d],l,t),s="seq"===t.timeContainer?t.sets[d].end:Math.max(s,t.sets[d].end),l=t.sets[d];if("contents"in t)for(var c in t.contents)i(e,t.contents[c],l,t),s="seq"===t.timeContainer?t.contents[c].end:Math.max(s,t.contents[c].end),l=t.contents[c];else s=a?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,o+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=o+t.explicit_end:t.end=s,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function r(e){this.node=e}function a(){this.events=[],this.head=null,this.body=null}function o(){this.styling=null,this.layout=null}function s(){this.styles={}}function l(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function d(){this.regions={}}function c(e){this.kind=e}function u(e){this.id=e}function f(e){this.regionID=e}function h(e){this.styleAttrs=e}function p(e){this.sets=e}function g(e){this.contents=e}function m(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function v(){c.call(this,"body")}function y(){c.call(this,"div")}function _(){c.call(this,"p")}function b(){c.call(this,"span")}function E(){c.call(this,"span")}function w(){c.call(this,"br")}function T(){}function S(){}function C(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function k(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function I(e,t){var n={};if(null!==e)for(var i in e.attributes){var r,a=e.attributes[i].uri+" "+e.attributes[i].local,o=B.byQName[a];void 0!==o&&(null!==(r=o.parse(e.attributes[i].value))?(n[a]=r,o===B.byName.zIndex&&M(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):N(t,"Cannot parse styling attribute "+a+" --> "+e.attributes[i].value))}return n}function A(e,t,n){for(var i in e.attributes)if(e.attributes[i].uri===t&&e.attributes[i].local===n)return e.attributes[i].value;return null}function x(e,t,n){var i,r=null;return null!==(i=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(r=parseFloat(i[1])/t):null!==(i=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(r=parseFloat(i[1])/e):null!==(i=/^(\d+(?:\.\d+)?)ms$/.exec(n))?r=parseFloat(i[1])/1e3:null!==(i=/^(\d+(?:\.\d+)?)s$/.exec(n))?r=parseFloat(i[1]):null!==(i=/^(\d+(?:\.\d+)?)h$/.exec(n))?r=3600*parseFloat(i[1]):null!==(i=/^(\d+(?:\.\d+)?)m$/.exec(n))?r=60*parseFloat(i[1]):null!==(i=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?r=3600*parseInt(i[1])+60*parseInt(i[2])+parseFloat(i[3]):null!==(i=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(r=3600*parseInt(i[1])+60*parseInt(i[2])+parseInt(i[3])+(null===i[4]?0:parseInt(i[4])/t)),r}function D(e,t,n,i){for(var r=t.length-1;0<=r;r--){var a=t[r];a in e.styles?R(e.styles[a].styleAttrs,n):N(i,"Non-existant style id referenced")}}function R(e,t){for(var n in e)n in t||(t[n]=e[n])}function M(e,t){if(e&&e.warn&&e.warn(t))throw t}function N(e,t){if(e&&e.error&&e.error(t))throw t}function O(e,t){throw e&&e.fatal&&e.fatal(t),t}function P(e,t){for(var n,i=0,r=e.length-1;i<=r;){var a=e[n=Math.floor((i+r)/2)];if(a<t)i=n+1;else{if(!(t<a))return{found:!0,index:n};r=n-1}}return{found:!1,index:i}}var L,F,j,B,U;L=void 0===n?this.imscDoc={}:n,F="undefined"==typeof sax?e(40):sax,j="undefined"==typeof imscNames?e(18):imscNames,B="undefined"==typeof imscStyles?e(19):imscStyles,U="undefined"==typeof imscUtils?e(20):imscUtils,L.fromXML=function(e,t,n){var c=F.parser(!0,{xmlns:!0}),u=[],f=[],h=[],p=0,g=null;c.onclosetag=function(){if(u[0]instanceof s)for(var e in u[0].styles)!function e(t,n,i){for(;0<n.styleRefs.length;){var r=n.styleRefs.pop();r in t.styles?(e(t,t.styles[r],i),R(t.styles[r].styleAttrs,n.styleAttrs)):N(i,"Non-existant style id referenced")}}(u[0],u[0].styles[e],t);else if(u[0]instanceof _||u[0]instanceof b){if(1<u[0].contents.length){for(var i=[u[0].contents[0]],a=1;a<u[0].contents.length;a++)u[0].contents[a]instanceof E&&i[i.length-1]instanceof E?i[i.length-1].text+=u[0].contents[a].text:i.push(u[0].contents[a]);u[0].contents=i}u[0]instanceof b&&1===u[0].contents.length&&u[0].contents[0]instanceof E&&(u[0].text=u[0].contents[0].text,delete u[0].contents)}else u[0]instanceof r&&(u[0].node.uri===j.ns_tt&&"metadata"===u[0].node.local?p--:0<p&&n&&"onCloseTag"in n&&n.onCloseTag());h.shift(),f.shift(),u.shift()},c.ontext=function(e){var i;void 0===u[0]||(u[0]instanceof b||u[0]instanceof _?((i=new E).initFromText(g,u[0],e,h[0],t),u[0].contents.push(i)):u[0]instanceof r&&0<p&&n&&"onText"in n&&n.onText(e))},c.onopentag=function(e){var i=e.attributes["xml:space"];i?h.unshift(i.value):0===h.length?h.unshift("default"):h.unshift(h[0]);var c,m,E,C,k,I,A,x,D=e.attributes["xml:lang"];if(D?f.unshift(D.value):0===f.length?f.unshift(""):f.unshift(f[0]),e.uri===j.ns_tt?"tt"===e.local?(null!==g&&O(t,"Two <tt> elements at ("+this.line+","+this.column+")"),(g=new a).initFromNode(e,t),u.unshift(g)):"head"===e.local?(u[0]instanceof a||O(t,"Parent of <head> element is not <tt> at ("+this.line+","+this.column+")"),null!==g.head&&O("Second <head> element at ("+this.line+","+this.column+")"),g.head=new o,u.unshift(g.head)):"styling"===e.local?(u[0]instanceof o||O(t,"Parent of <styling> element is not <head> at ("+this.line+","+this.column+")"),null!==g.head.styling&&O("Second <styling> element at ("+this.line+","+this.column+")"),g.head.styling=new s,u.unshift(g.head.styling)):"style"===e.local?u[0]instanceof s?((c=new l).initFromNode(e,t),c.id?g.head.styling.styles[c.id]=c:N(t,"<style> element missing @id attribute"),u.unshift(c)):u[0]instanceof T?((c=new l).initFromNode(e,t),R(c.styleAttrs,u[0].styleAttrs),u.unshift(c)):O(t,"Parent of <style> element is not <styling> or <region> at ("+this.line+","+this.column+")"):"layout"===e.local?(u[0]instanceof o||O(t,"Parent of <layout> element is not <head> at "+this.line+","+this.column+")"),null!==g.head.layout&&O(t,"Second <layout> element at "+this.line+","+this.column+")"),g.head.layout=new d,u.unshift(g.head.layout)):"region"===e.local?(u[0]instanceof d||O(t,"Parent of <region> element is not <layout> at "+this.line+","+this.column+")"),(m=new T).initFromNode(g,e,t),!m.id||m.id in g.head.layout.regions?N(t,"Ignoring <region> with duplicate or missing @id at "+this.line+","+this.column+")"):g.head.layout.regions[m.id]=m,u.unshift(m)):"body"===e.local?(u[0]instanceof a||O(t,"Parent of <body> element is not <tt> at "+this.line+","+this.column+")"),null!==g.body&&O(t,"Second <body> element at "+this.line+","+this.column+")"),(E=new v).initFromNode(g,e,t),g.body=E,u.unshift(E)):"div"===e.local?(u[0]instanceof y||u[0]instanceof v||O(t,"Parent of <div> element is not <body> or <div> at "+this.line+","+this.column+")"),(C=new y).initFromNode(g,u[0],e,t),u[0].contents.push(C),u.unshift(C)):"p"===e.local?(u[0]instanceof y||O(t,"Parent of <p> element is not <div> at "+this.line+","+this.column+")"),(k=new _).initFromNode(g,u[0],e,t),u[0].contents.push(k),u.unshift(k)):"span"===e.local?(u[0]instanceof b||u[0]instanceof _||O(t,"Parent of <span> element is not <span> or <p> at "+this.line+","+this.column+")"),(I=new b).initFromNode(g,u[0],e,h[0],t),u[0].contents.push(I),u.unshift(I)):"br"===e.local?(u[0]instanceof b||u[0]instanceof _||O(t,"Parent of <br> element is not <span> or <p> at "+this.line+","+this.column+")"),(A=new w).initFromNode(g,u[0],e,t),u[0].contents.push(A),u.unshift(A)):"set"===e.local?(u[0]instanceof b||u[0]instanceof _||u[0]instanceof y||u[0]instanceof v||u[0]instanceof T||u[0]instanceof w||O(t,"Parent of <set> element is not a content element or a region at "+this.line+","+this.column+")"),(x=new S).initFromNode(g,u[0],e,t),u[0].sets.push(x),u.unshift(x)):u.unshift(new r(e)):u.unshift(new r(e)),u[0]instanceof r)if(e.uri===j.ns_tt&&"metadata"===e.local)p++;else if(0<p&&n&&"onOpenTag"in n){var M=[];for(var P in e.attributes)M[e.attributes[P].uri+" "+e.attributes[P].local]={uri:e.attributes[P].uri,local:e.attributes[P].local,value:e.attributes[P].value};n.onOpenTag(e.uri,e.local,M)}},c.write(e).close(),null!==g.head?delete g.head.styling:g.head=new o,null===g.head.layout&&(g.head.layout=new d);var m,C=!1;for(var k in g.head.layout.regions){C=!0;break}for(var I in C||(m=T.prototype.createDefaultRegion(),g.head.layout.regions[m.id]=m),g.head.layout.regions)i(g,g.head.layout.regions[I],null,null);return g.body&&i(g,g.body,null,null),g},a.prototype.initFromNode=function(e,t){this.cellResolution=function(e,t){var n,i=A(e,j.ns_ttp,"cellResolution"),r=15,a=32;return null!==i&&(null!==(n=/(\d+) (\d+)/.exec(i))?(a=parseInt(n[1]),r=parseInt(n[2])):M(t,"Malformed cellResolution value (using initial value instead)")),{w:a,h:r}}(e,t);var n=function(e,t){var n,i=A(e,j.ns_ttp,"frameRate"),r=30;null!==i&&(null!==(n=/(\d+)/.exec(i))?r=parseInt(n[1]):M(t,"Malformed frame rate attribute (using initial value instead)"));var a=A(e,j.ns_ttp,"frameRateMultiplier"),o=1;null!==a&&(null!==(n=/(\d+) (\d+)/.exec(a))?o=parseInt(n[1])/parseInt(n[2]):M(t,"Malformed frame rate multiplier attribute (using initial value instead)"));var s=o*r,l=1,d=A(e,j.ns_ttp,"tickRate");return null===d?null!==i&&(l=s):null!==(n=/(\d+)/.exec(d))?l=parseInt(n[1]):M(t,"Malformed tick rate attribute (using initial value instead)"),{effectiveFrameRate:s,tickRate:l}}(e,t);this.effectiveFrameRate=n.effectiveFrameRate,this.tickRate=n.tickRate,this.aspectRatio=function(e,t){var n,i,r,a=A(e,j.ns_ittp,"aspectRatio"),o=null;return null!==a&&(null!==(n=/(\d+) (\d+)/.exec(a))?(i=parseInt(n[1]),r=parseInt(n[2]),0!==i&&0!==r?o=i/r:N(t,"Illegal aspectRatio values (ignoring)")):N(t,"Malformed aspectRatio attribute (ignoring)")),o}(e,t);var i=A(e,j.ns_ttp,"timeBase");null!==i&&"media"!==i&&O(t,"Unsupported time base");var r=function(e,t){var n=A(e,j.ns_tts,"extent");if(null===n)return null;var i=n.split(" ");if(2!==i.length)return M(t,"Malformed extent (ignoring)"),null;var r=U.parseLength(i[0]),a=U.parseLength(i[1]);return a&&r?{h:a,w:r}:(M(t,"Malformed extent values (ignoring)"),null)}(e,t);null===r?this.pxDimensions={h:480,w:640}:("px"===r.h.unit&&"px"===r.w.unit||O(t,"Extent on TT must be in px or absent"),this.pxDimensions={h:r.h.value,w:r.w.value})},a.prototype._registerEvent=function(e){var t,n;e.end<=e.begin||((t=P(this.events,e.begin)).found||this.events.splice(t.index,0,e.begin),e.end!==Number.POSITIVE_INFINITY&&((n=P(this.events,e.end)).found||this.events.splice(n.index,0,e.end)))},a.prototype.getMediaTimeRange=function(){return[this.events[0],this.events[this.events.length-1]]},a.prototype.getMediaTimeEvents=function(){return this.events},l.prototype.initFromNode=function(e,t){this.id=C(e),this.styleAttrs=I(e,t),this.styleRefs=k(e)},u.prototype.initFromNode=function(e,t,n){this.id=C(n)},f.prototype.initFromNode=function(e,t,n){var i;this.regionID=(i=n)&&"region"in i.attributes?i.attributes.region.value:""},h.prototype.initFromNode=function(e,t,n,i){this.styleAttrs=I(n,i),null!==e.head&&null!==e.head.styling&&D(e.head.styling,k(n),this.styleAttrs,i)},p.prototype.initFromNode=function(){this.sets=[]},g.prototype.initFromNode=function(){this.contents=[]},m.prototype.initFromNode=function(e,t,n,i){var r,a,o,s=function(e,t,n){var i=null;t&&"begin"in t.attributes&&null===(i=x(e.tickRate,e.effectiveFrameRate,t.attributes.begin.value))&&M(n,"Malformed begin value "+t.attributes.begin.value+" (using 0)");var r=null;t&&"dur"in t.attributes&&null===(r=x(e.tickRate,e.effectiveFrameRate,t.attributes.dur.value))&&M(n,"Malformed dur value "+t.attributes.dur.value+" (ignoring)");var a=null;return t&&"end"in t.attributes&&null===(a=x(e.tickRate,e.effectiveFrameRate,t.attributes.end.value))&&M(n,"Malformed end value (ignoring)"),{explicit_begin:i,explicit_end:a,explicit_dur:r}}(e,n,i);this.explicit_begin=s.explicit_begin,this.explicit_end=s.explicit_end,this.explicit_dur=s.explicit_dur,this.timeContainer=(a=i,(o=(r=n)&&"timeContainer"in r.attributes?r.attributes.timeContainer.value:null)&&"par"!==o?"seq"===o?"seq":(N(a,"Illegal value of timeContainer (assuming 'par')"),"par"):"par")},v.prototype.initFromNode=function(e,t,n){h.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),p.prototype.initFromNode.call(this,e,null,t,n),f.prototype.initFromNode.call(this,e,null,t,n),g.prototype.initFromNode.call(this,e,null,t,n)},y.prototype.initFromNode=function(e,t,n,i){h.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),p.prototype.initFromNode.call(this,e,t,n,i),f.prototype.initFromNode.call(this,e,t,n,i),g.prototype.initFromNode.call(this,e,t,n,i)},_.prototype.initFromNode=function(e,t,n,i){h.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i),p.prototype.initFromNode.call(this,e,t,n,i),f.prototype.initFromNode.call(this,e,t,n,i),g.prototype.initFromNode.call(this,e,t,n,i)},b.prototype.initFromNode=function(e,t,n,i,r){h.prototype.initFromNode.call(this,e,t,n,r),m.prototype.initFromNode.call(this,e,t,n,r),p.prototype.initFromNode.call(this,e,t,n,r),f.prototype.initFromNode.call(this,e,t,n,r),g.prototype.initFromNode.call(this,e,t,n,r),this.space=i},E.prototype.initFromText=function(e,t,n,i,r){m.prototype.initFromNode.call(this,e,t,null,r),this.text=n,this.space=i},w.prototype.initFromNode=function(e,t,n,i){f.prototype.initFromNode.call(this,e,t,n,i),m.prototype.initFromNode.call(this,e,t,n,i)},T.prototype.createDefaultRegion=function(){var e=new T;return u.call(e,""),h.call(e,{}),p.call(e,[]),m.call(e,0,Number.POSITIVE_INFINITY,null),e},T.prototype.initFromNode=function(e,t,n){u.prototype.initFromNode.call(this,e,null,t,n),h.prototype.initFromNode.call(this,e,null,t,n),m.prototype.initFromNode.call(this,e,null,t,n),p.prototype.initFromNode.call(this,e,null,t,n),null!==e.head&&null!==e.head.styling&&D(e.head.styling,k(t),this.styleAttrs,n)},S.prototype.initFromNode=function(e,t,n,i){m.prototype.initFromNode.call(this,e,t,n,i);var r=I(n,i);for(var a in this.qname=null,this.value=null,r){if(this.qname){N(i,"More than one style specified on set");break}this.qname=a,this.value=r[a]}}},{18:18,19:19,20:20,40:40}],15:[function(e,t,n){!function(e,t){function n(e,t,n){for(var i in e){var r=e[i].elements.length,a=e[i].elements[e[i].start_elem],o=e[i].elements[e[i].end_elem],s=Math.ceil(t)+"px",l="-"+Math.ceil(t)+"px";0!==r&&("lr"===n.ipd?(a.node.style.borderLeftColor=a.bgcolor||"#00000000",a.node.style.borderLeftStyle="solid",a.node.style.borderLeftWidth=s,a.node.style.marginLeft=l):"rl"===n.ipd?(a.node.style.borderRightColor=a.bgcolor||"#00000000",a.node.style.borderRightStyle="solid",a.node.style.borderRightWidth=s,a.node.style.marginRight=l):"tb"===n.ipd&&(a.node.style.borderTopColor=a.bgcolor||"#00000000",a.node.style.borderTopStyle="solid",a.node.style.borderTopWidth=s,a.node.style.marginTop=l),"lr"===n.ipd?(o.node.style.borderRightColor=o.bgcolor||"#00000000",o.node.style.borderRightStyle="solid",o.node.style.borderRightWidth=s,o.node.style.marginRight=l):"rl"===n.ipd?(o.node.style.borderLeftColor=o.bgcolor||"#00000000",o.node.style.borderLeftStyle="solid",o.node.style.borderLeftWidth=s,o.node.style.marginLeft=l):"tb"===n.ipd&&(o.node.style.borderBottomColor=o.bgcolor||"#00000000",o.node.style.borderBottomStyle="solid",o.node.style.borderBottomWidth=s,o.node.style.marginBottom=l))}}function i(e){for(var t=0;t<e.length-1;t++){var n,i,r=e[t].elements.length;0!==r&&!1===e[t].br&&(n=document.createElement("br"),(i=e[t].elements[r-1].node).parentElement.insertBefore(n,i.nextSibling))}}function r(e,t,n,i){for(var r=Math.sign(n-t),a=0;a<=e.length;a++){var o,s,l=0===a?t:a===e.length?n:(e[a].before+e[a-1].after)/2;if(0<a)for(var d=0;d<e[a-1].elements.length;d++)null!==e[a-1].elements[d].bgcolor&&r*((s=e[a-1].elements[d]).after-l)<0&&(o=Math.ceil(Math.abs(l-s.after))+"px",s.node.style.backgroundColor=s.bgcolor,"lr"===i.bpd?s.node.style.paddingRight=o:"rl"===i.bpd?s.node.style.paddingLeft=o:"tb"===i.bpd&&(s.node.style.paddingBottom=o));if(a<e.length)for(var c=0;c<e[a].elements.length;c++)null!==(s=e[a].elements[c]).bgcolor&&0<r*(s.before-l)&&(o=Math.ceil(Math.abs(s.before-l))+"px",s.node.style.backgroundColor=s.bgcolor,"lr"===i.bpd?s.node.style.paddingLeft=o:"rl"===i.bpd?s.node.style.paddingRight=o:"tb"===i.bpd&&(s.node.style.paddingTop=o))}}function a(e,t){this.id=e,this.plist=t}function o(e,t){var n={before:null,after:null,start:null,end:null};return"tb"===t.bpd?(n.before=e.top,n.after=e.bottom,"lr"===t.ipd?(n.start=e.left,n.end=e.right):(n.start=e.right,n.end=e.left)):"lr"===t.bpd?(n.before=e.left,n.after=e.right,n.start=e.top,n.end=e.bottom):"rl"===t.bpd&&(n.before=e.right,n.after=e.left,n.start=e.top,n.end=e.bottom),n}function s(e,t,n,i){var r,a,l,d,c=t.style.backgroundColor||i;if(0===t.childElementCount)if("span"===t.localName){var u=t.getBoundingClientRect();if(0===u.height||0===u.width)return;var f,h,p=o(u,e);0!==n.length&&(r=p.before,a=p.after,l=n[n.length-1].before,a<(d=n[n.length-1].after)&&l<r||d<=a&&r<=l)?(f=Math.sign(p.after-p.before),h=Math.sign(p.end-p.start),f*(p.before-n[n.length-1].before)<0&&(n[n.length-1].before=p.before),0<f*(p.after-n[n.length-1].after)&&(n[n.length-1].after=p.after),h*(p.start-n[n.length-1].start)<0&&(n[n.length-1].start=p.start,n[n.length-1].start_elem=n[n.length-1].elements.length),0<h*(p.end-n[n.length-1].end)&&(n[n.length-1].end=p.end,n[n.length-1].end_elem=n[n.length-1].elements.length)):n.push({before:p.before,after:p.after,start:p.start,end:p.end,start_elem:0,end_elem:0,elements:[],text:"",br:!1}),n[n.length-1].text+=t.textContent,n[n.length-1].elements.push({node:t,bgcolor:c,before:p.before,after:p.after})}else"br"===t.localName&&0!==n.length&&(n[n.length-1].br=!0);else for(var g=t.firstChild;g;)g.nodeType===Node.ELEMENT_NODE&&s(e,g,n,c),g=g.nextSibling}function l(e,t){this.qname=e,this.map=t}function d(e,t){if(e&&e.error&&e.error(t))throw t}e.render=function(e,l,u,f,h,p,g,m,v){var y,_=f||l.clientHeight,b=h||l.clientWidth;null!==e.aspectRatio&&(b<(y=_*e.aspectRatio)?_=Math.round(b/e.aspectRatio):b=y);var E=document.createElement("div");E.style.position="relative",E.style.width=b+"px",E.style.height=_+"px",E.style.margin="auto",E.style.top=0,E.style.bottom=0,E.style.left=0,E.style.right=0,E.style.zIndex=0;var w={h:_,w:b,regionH:null,regionW:null,imgResolver:u,displayForcedOnlyMode:p||!1,isd:e,errorHandler:g,previousISDState:m,enableRollUp:v||!1,currentISDState:{},flg:null,lp:null,mra:null,ipd:null,bpd:null};for(var T in l.appendChild(E),e.contents)!function e(l,u,f){var h;if("region"===f.kind?(h=document.createElement("div")).style.position="absolute":"body"===f.kind||"div"===f.kind?h=document.createElement("div"):"p"===f.kind?h=document.createElement("p"):"span"===f.kind?h=document.createElement("span"):"br"===f.kind&&(h=document.createElement("br")),h){for(var p in h.style.margin="0",c){var g=c[p],m=f.styleAttrs[g.qname];void 0!==m&&null!==g.map&&g.map(l,h,f,m)}var v,y=h;"region"===f.kind&&("lrtb"===(v=f.styleAttrs[t.byName.writingMode.qname])||"lr"===v?(l.ipd="lr",l.bpd="tb"):"rltb"===v||"rl"===v?(l.ipd="rl",l.bpd="tb"):"tblr"===v?(l.ipd="tb",l.bpd="lr"):"tbrl"!==v&&"tb"!==v||(l.ipd="tb",l.bpd="rl"));var _,b=f.styleAttrs[t.byName.linePadding.qname];b&&0<b&&(_=Math.ceil(b*l.h)+"px","tb"===l.bpd?(y.style.paddingLeft=_,y.style.paddingRight=_):(y.style.paddingTop=_,y.style.paddingBottom=_),l.lp=b);var E,w=f.styleAttrs[t.byName.multiRowAlign.qname];if(w&&"auto"!==w&&((E=document.createElement("span")).style.display="inline-block",E.style.textAlign=w,h.appendChild(E),y=E,l.mra=w),f.styleAttrs[t.byName.fillLineGap.qname]&&(l.flg=!0),"span"===f.kind&&f.text)if(l.lp||l.mra||l.flg)for(var T="",S=0;S<f.text.length;S++){T+=f.text.charAt(S);var C,k=f.text.charCodeAt(S);(k<55296||56319<k||S===f.text.length)&&((C=document.createElement("span")).textContent=T,h.appendChild(C),T="")}else h.textContent=f.text;for(var I in u.appendChild(h),f.contents)e(l,y,f.contents[I]);var A,x,D,R,M=[];(l.lp||l.mra||l.flg)&&"p"===f.kind&&(s(l,y,M,null),l.mra&&(i(M),l.mra=null),l.lp&&(n(M,l.lp*l.h,l),l.lp=null),
l.flg&&(r(M,(A=o(y.getBoundingClientRect(),l)).before,A.after,l),l.flg=null)),"region"===f.kind&&(s(l,y,M),"tb"===l.bpd&&l.enableRollUp&&0<f.contents.length&&"after"===f.styleAttrs[t.byName.displayAlign.qname]&&(x=new a(""===f.id?"_":f.id,M),l.currentISDState[x.id]=x,l.previousISDState&&x.id in l.previousISDState&&0<l.previousISDState[x.id].plist.length&&1<x.plist.length&&x.plist[x.plist.length-2].text===l.previousISDState[x.id].plist[l.previousISDState[x.id].plist.length-1].text&&(D=h.firstElementChild,R=x.plist[x.plist.length-1].after-x.plist[x.plist.length-1].before,D.style.bottom="-"+R+"px",D.style.transition="transform 0.4s",D.style.position="relative",D.style.transform="translateY(-"+R+"px)")))}else d(l.errorHandler,"Error processing ISD element kind: "+f.kind)}(w,E,e.contents[T]);return w.currentISDState};var c=[new l("http://www.w3.org/ns/ttml#styling backgroundColor",(function(e,t,n,i){0!==i[3]&&(t.style.backgroundColor="rgba("+i[0].toString()+","+i[1].toString()+","+i[2].toString()+","+(i[3]/255).toString()+")")})),new l("http://www.w3.org/ns/ttml#styling color",(function(e,t,n,i){t.style.color="rgba("+i[0].toString()+","+i[1].toString()+","+i[2].toString()+","+(i[3]/255).toString()+")"})),new l("http://www.w3.org/ns/ttml#styling direction",(function(e,t,n,i){t.style.direction=i})),new l("http://www.w3.org/ns/ttml#styling display",(function(){})),new l("http://www.w3.org/ns/ttml#styling displayAlign",(function(e,t,n,i){t.style.display="flex",t.style.flexDirection="column","before"===i?t.style.justifyContent="flex-start":"center"===i?t.style.justifyContent="center":"after"===i&&(t.style.justifyContent="flex-end")})),new l("http://www.w3.org/ns/ttml#styling extent",(function(e,t,n,i){e.regionH=i.h*e.h,e.regionW=i.w*e.w;var r=0,a=0,o=n.styleAttrs["http://www.w3.org/ns/ttml#styling padding"];o&&(r=(o[0]+o[2])*e.h,a=(o[1]+o[3])*e.w),t.style.height=e.regionH-r+"px",t.style.width=e.regionW-a+"px"})),new l("http://www.w3.org/ns/ttml#styling fontFamily",(function(e,t,n,i){var r=[];for(var a in i)"monospaceSerif"===i[a]?(r.push("Courier New"),r.push('"Liberation Mono"'),r.push("Courier"),r.push("monospace")):"proportionalSansSerif"===i[a]?(r.push("Arial"),r.push("Helvetica"),r.push('"Liberation Sans"'),r.push("sans-serif")):"monospace"===i[a]?r.push("monospace"):"sansSerif"===i[a]?r.push("sans-serif"):"serif"===i[a]?r.push("serif"):"monospaceSansSerif"===i[a]?(r.push("Consolas"),r.push("monospace")):"proportionalSerif"===i[a]?r.push("serif"):r.push(i[a]);t.style.fontFamily=r.join(",")})),new l("http://www.w3.org/ns/ttml#styling fontSize",(function(e,t,n,i){t.style.fontSize=i*e.h+"px"})),new l("http://www.w3.org/ns/ttml#styling fontStyle",(function(e,t,n,i){t.style.fontStyle=i})),new l("http://www.w3.org/ns/ttml#styling fontWeight",(function(e,t,n,i){t.style.fontWeight=i})),new l("http://www.w3.org/ns/ttml#styling lineHeight",(function(e,t,n,i){t.style.lineHeight="normal"===i?"normal":i*e.h+"px"})),new l("http://www.w3.org/ns/ttml#styling opacity",(function(e,t,n,i){t.style.opacity=i})),new l("http://www.w3.org/ns/ttml#styling origin",(function(e,t,n,i){t.style.top=i.h*e.h+"px",t.style.left=i.w*e.w+"px"})),new l("http://www.w3.org/ns/ttml#styling overflow",(function(e,t,n,i){t.style.overflow=i})),new l("http://www.w3.org/ns/ttml#styling padding",(function(e,t,n,i){var r=[];r[0]=i[0]*e.h+"px",r[1]=i[3]*e.w+"px",r[2]=i[2]*e.h+"px",r[3]=i[1]*e.w+"px",t.style.padding=r.join(" ")})),new l("http://www.w3.org/ns/ttml#styling showBackground",null),new l("http://www.w3.org/ns/ttml#styling textAlign",(function(e,n,i,r){var a=i.styleAttrs[t.byName.direction.qname],o="start"===r?"rtl"===a?"right":"left":"end"===r?"rtl"===a?"left":"right":r;n.style.textAlign=o})),new l("http://www.w3.org/ns/ttml#styling textDecoration",(function(e,t,n,i){t.style.textDecoration=i.join(" ").replace("lineThrough","line-through")})),new l("http://www.w3.org/ns/ttml#styling textOutline",(function(e,t,n,i){t.style.textShadow="none"===i?"":"rgba("+i.color[0].toString()+","+i.color[1].toString()+","+i.color[2].toString()+","+(i.color[3]/255).toString()+") 0px 0px "+i.thickness*e.h+"px"})),new l("http://www.w3.org/ns/ttml#styling unicodeBidi",(function(e,t,n,i){var r="bidiOverride"===i?"bidi-override":i;t.style.unicodeBidi=r})),new l("http://www.w3.org/ns/ttml#styling visibility",(function(e,t,n,i){t.style.visibility=i})),new l("http://www.w3.org/ns/ttml#styling wrapOption",(function(e,t,n,i){"wrap"===i?"preserve"===n.space?t.style.whiteSpace="pre-wrap":t.style.whiteSpace="normal":"preserve"===n.space?t.style.whiteSpace="pre":t.style.whiteSpace="noWrap"})),new l("http://www.w3.org/ns/ttml#styling writingMode",(function(e,t,n,i){"lrtb"===i||"lr"===i||"rltb"===i||"rl"===i?t.style.writingMode="horizontal-tb":"tblr"===i?t.style.writingMode="vertical-lr":"tbrl"!==i&&"tb"!==i||(t.style.writingMode="vertical-rl")})),new l("http://www.w3.org/ns/ttml#styling zIndex",(function(e,t,n,i){t.style.zIndex=i})),new l("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt backgroundImage",(function(e,t,n,i){var r,a;null!==e.imgResolver&&null!==i&&(r=document.createElement("img"),(a=e.imgResolver(i,r))&&(r.src=a),r.height=e.regionH,r.width=e.regionW,t.appendChild(r))})),new l("http://www.w3.org/ns/ttml/profile/imsc1#styling forcedDisplay",(function(e,t,n,i){e.displayForcedOnlyMode&&!1===i&&(t.style.visibility="hidden")}))],u={};for(var f in c)u[c[f].qname]=c[f]}(void 0===n?this.imscHTML={}:n,("undefined"==typeof imscNames&&e(18),"undefined"==typeof imscStyles?e(19):imscStyles))},{18:18,19:19}],16:[function(e,t,n){function i(e,t){if("contents"in e)for(var n in e.contents)i(e.contents[n],t);else t.push(e)}function r(e){if("br"!==e.kind){if("text"in e)return 0===e.text.length;if("contents"in e){for(var t=e.contents.length;t--;)r(e.contents[t])&&e.contents.splice(t,1);return 0===e.contents.length}}}function a(e){this.contents=[],this.aspectRatio=e.aspectRatio}function o(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"text"in e?this.text=e.text:"br"!==e.kind&&(this.contents=[]),"space"in e&&(this.space=e.space)}function s(e,t){if(e&&e.error&&e.error(t))throw t}var l,d;l=void 0===n?this.imscISD={}:n,"undefined"==typeof imscNames&&e(18),d="undefined"==typeof imscStyles?e(19):imscStyles,l.generateISD=function(e,t,n){var l=new a(e),c={};for(var u in e.head.layout.regions){var f=function e(t,n,a,l,c,u,f,h,p){if(n<f.begin||n>=f.end)return null;var g="regionID"in f&&""!==f.regionID?f.regionID:u;if(null!==c&&g!==a.id&&(!("contents"in f)||"contents"in f&&0===f.contents.length||""!==g))return null;var m=new o(f);for(var v in f.sets)n<f.sets[v].begin||n>=f.sets[v].end||(m.styleAttrs[f.sets[v].qname]=f.sets[v].value);var y,_,b={};for(var E in m.styleAttrs){var w;b[E]=!0,E!==d.byName.writingMode.qname||d.byName.direction.qname in m.styleAttrs||("lrtb"===(w=m.styleAttrs[E])||"lr"===w?m.styleAttrs[d.byName.direction.qname]="ltr":"rltb"!==w&&"rl"!==w||(m.styleAttrs[d.byName.direction.qname]="rtl"))}if(null!==c)for(var T in d.all){var S,C,k,I=d.all[T];I.qname===d.byName.textDecoration.qname?(S=c.styleAttrs[I.qname],k=[],void 0===(C=m.styleAttrs[I.qname])?k=S:-1===C.indexOf("none")?((-1===C.indexOf("noUnderline")&&-1!==S.indexOf("underline")||-1!==C.indexOf("underline"))&&k.push("underline"),(-1===C.indexOf("noLineThrough")&&-1!==S.indexOf("lineThrough")||-1!==C.indexOf("lineThrough"))&&k.push("lineThrough"),(-1===C.indexOf("noOverline")&&-1!==S.indexOf("overline")||-1!==C.indexOf("overline"))&&k.push("overline")):k.push("none"),m.styleAttrs[I.qname]=k):I.inherit&&I.qname in c.styleAttrs&&!(I.qname in m.styleAttrs)&&(m.styleAttrs[I.qname]=c.styleAttrs[I.qname])}for(var A in d.all){var x=d.all[A];x.qname in m.styleAttrs||("region"===m.kind||!1===x.inherit&&null!==x.initial)&&(m.styleAttrs[x.qname]=x.parse(x.initial),b[x.qname]=!0)}for(var D in d.all){var R,M=d.all[D];M.qname in b&&null!==M.compute&&(null!==(R=M.compute(t,c,m,m.styleAttrs[M.qname],p))?m.styleAttrs[M.qname]=R:s(h,"Style '"+M.qname+"' on element '"+m.kind+"' cannot be computed"))}if("none"===m.styleAttrs[d.byName.display.qname])return null;for(var N in null===c?y=null===l?[]:[l]:"contents"in f&&(y=f.contents),y){var O=e(t,n,a,l,m,g,y[N],h,p);null!==O&&m.contents.push(O.element)}for(var P in m.styleAttrs){-1===d.byQName[P].applies.indexOf(m.kind)&&delete m.styleAttrs[P]}if("span"===m.kind&&m.text&&"default"===m.space&&(_=m.text.replace(/\s+/g," "),m.text=_),"p"===m.kind){var L=[];i(m,L);for(var F=0,j="after_br",B=0;;)if("after_br"===j)F>=L.length||"br"===L[F].kind?(j="before_br",B=F,F--):("preserve"!==L[F].space&&(L[F].text=L[F].text.replace(/^\s+/g,"")),0<L[F].text.length?(j="looking_br",F++):L.splice(F,1));else if("before_br"===j)if(F<0||"br"===L[F].kind){if(j="after_br",(F=B+1)>=L.length)break}else if("preserve"!==L[F].space&&(L[F].text=L[F].text.replace(/\s+$/g,"")),0<L[F].text.length){if(j="after_br",(F=B+1)>=L.length)break}else L.splice(F,1),F--;else F>=L.length||"br"===L[F].kind?(j="before_br",B=F,F--):F++;r(m)}return"div"===m.kind&&d.byName.backgroundImage.qname in m.styleAttrs||"br"===m.kind||"contents"in m&&0<m.contents.length||"span"===m.kind&&null!==m.text||"region"===m.kind&&"always"===m.styleAttrs[d.byName.showBackground.qname]?{region_id:g,element:m}:null}(e,t,e.head.layout.regions[u],e.body,null,"",e.head.layout.regions[u],n,c);null!==f&&l.contents.push(f.element)}return l}},{18:18,19:19}],17:[function(e,t,n){n.generateISD=e(16).generateISD,n.fromXML=e(14).fromXML,n.renderHTML=e(15).render},{14:14,15:15,16:16}],18:[function(e,t,n){var i;(i=void 0===n?this.imscNames={}:n).ns_tt="http://www.w3.org/ns/ttml",i.ns_tts="http://www.w3.org/ns/ttml#styling",i.ns_ttp="http://www.w3.org/ns/ttml#parameter",i.ns_xml="http://www.w3.org/XML/1998/namespace",i.ns_itts="http://www.w3.org/ns/ttml/profile/imsc1#styling",i.ns_ittp="http://www.w3.org/ns/ttml/profile/imsc1#parameter",i.ns_smpte="http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt",i.ns_ebutts="urn:ebu:tt:style"},{}],19:[function(e,t,n){!function(e,t,n){function i(e,t,n,i,r,a,o,s){this.name=t,this.ns=e,this.qname=e+" "+t,this.inherit=r,this.animatable=a,this.initial=n,this.applies=i,this.parse=o,this.compute=s}for(var r in e.all=[new i(t.ns_tts,"backgroundColor","transparent",["body","div","p","region","span"],!1,!0,n.parseColor,null),new i(t.ns_tts,"color","white",["span"],!0,!0,n.parseColor,null),new i(t.ns_tts,"direction","ltr",["p","span"],!0,!0,(function(e){return e}),null),new i(t.ns_tts,"display","auto",["body","div","p","region","span"],!1,!0,(function(e){return e}),null),new i(t.ns_tts,"displayAlign","before",["region"],!1,!0,(function(e){return e}),null),new i(t.ns_tts,"extent","auto",["tt","region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var i=n.parseLength(t[0]),r=n.parseLength(t[1]);return r&&i?{h:r,w:i}:null}),(function(e,t,n,i){var r,a;if("auto"===i)r=1;else if("%"===i.h.unit)r=i.h.value/100;else{if("px"!==i.h.unit)return null;r=i.h.value/e.pxDimensions.h}if("auto"===i)a=1;else if("%"===i.w.unit)a=i.w.value/100;else{if("px"!==i.w.unit)return null;a=i.w.value/e.pxDimensions.w}return{h:r,w:a}})),new i(t.ns_tts,"fontFamily","default",["span"],!0,!0,(function(e){var t=e.split(","),n=[];for(var i in t)"'"!==t[i].charAt(0)&&'"'!==t[i].charAt(0)&&"default"===t[i]?n.push("monospaceSerif"):n.push(t[i]);return n}),null),new i(t.ns_tts,"fontSize","1c",["span"],!0,!0,n.parseLength,(function(t,n,i,r){var a;if("%"===r.unit)a=null!==n?n.styleAttrs[e.byName.fontSize.qname]*r.value/100:r.value/100/t.cellResolution.h;else if("em"===r.unit)a=null!==n?n.styleAttrs[e.byName.fontSize.qname]*r.value:r.value/t.cellResolution.h;else if("c"===r.unit)a=r.value/t.cellResolution.h;else{if("px"!==r.unit)return null;a=r.value/t.pxDimensions.h}return a})),new i(t.ns_tts,"fontStyle","normal",["span"],!0,!0,(function(e){return e}),null),new i(t.ns_tts,"fontWeight","normal",["span"],!0,!0,(function(e){return e}),null),new i(t.ns_tts,"lineHeight","normal",["p"],!0,!0,(function(e){return"normal"===e?e:n.parseLength(e)}),(function(t,n,i,r){var a;if("normal"===r)a=r;else if("%"===r.unit)a=i.styleAttrs[e.byName.fontSize.qname]*r.value/100;else if("em"===r.unit)a=i.styleAttrs[e.byName.fontSize.qname]*r.value;else if("c"===r.unit)a=r.value/t.cellResolution.h;else{if("px"!==r.unit)return null;a=r.value/t.pxDimensions.h}return a})),new i(t.ns_tts,"opacity",1,["region"],!1,!0,parseFloat,null),new i(t.ns_tts,"origin","auto",["region"],!1,!0,(function(e){if("auto"===e)return e;var t=e.split(" ");if(2!==t.length)return null;var i=n.parseLength(t[0]),r=n.parseLength(t[1]);return r&&i?{h:r,w:i}:null}),(function(e,t,n,i){var r,a;if("auto"===i)r=0;else if("%"===i.h.unit)r=i.h.value/100;else{if("px"!==i.h.unit)return null;r=i.h.value/e.pxDimensions.h}if("auto"===i)a=0;else if("%"===i.w.unit)a=i.w.value/100;else{if("px"!==i.w.unit)return null;a=i.w.value/e.pxDimensions.w}return{h:r,w:a}})),new i(t.ns_tts,"overflow","hidden",["region"],!1,!0,(function(e){return e}),null),new i(t.ns_tts,"padding","0px",["region"],!1,!0,(function(e){var t=e.split(" ");if(4<t.length)return null;var i=[];for(var r in t){var a=n.parseLength(t[r]);if(!a)return null;i.push(a)}return i}),(function(t,n,i,r){var a;if(1===r.length)a=[r[0],r[0],r[0],r[0]];else if(2===r.length)a=[r[0],r[1],r[0],r[1]];else if(3===r.length)a=[r[0],r[1],r[2],r[1]];else{if(4!==r.length)return null;a=[r[0],r[1],r[2],r[3]]}var o=i.styleAttrs[e.byName.writingMode.qname];if("lrtb"===o||"lr"===o)a=[a[0],a[3],a[2],a[1]];else if("rltb"===o||"rl"===o)a=[a[0],a[1],a[2],a[3]];else if("tblr"===o)a=[a[3],a[0],a[1],a[2]];else{if("tbrl"!==o&&"tb"!==o)return null;a=[a[3],a[2],a[1],a[0]]}var s=[];for(var l in a)if(0===a[l].value)s[l]=0;else if("%"===a[l].unit)s[l]="0"===l||"2"===l?i.styleAttrs[e.byName.extent.qname].h*a[l].value/100:i.styleAttrs[e.byName.extent.qname].w*a[l].value/100;else if("em"===a[l].unit)s[l]=i.styleAttrs[e.byName.fontSize.qname]*a[l].value;else if("c"===a[l].unit)s[l]=a[l].value/t.cellResolution.h;else{if("px"!==a[l].unit)return null;s[l]="0"===l||"2"===l?a[l].value/t.pxDimensions.h:a[l].value/t.pxDimensions.w}return s})),new i(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new i(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,i){return"left"===i?"start":"right"===i?"end":i})),new i(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new i(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},i=e.split(" ");if(0===i.length||2<i.length)return null;var r=n.parseColor(i[0]);if(null!==(t.color=r)&&i.shift(),1!==i.length)return null;var a=n.parseLength(i[0]);return a?(t.thickness=a,t):null}),(function(t,n,i,r){if("none"===r)return r;var a={};if(null===r.color?a.color=i.styleAttrs[e.byName.color.qname]:a.color=r.color,"%"===r.thickness.unit)a.thickness=i.styleAttrs[e.byName.fontSize.qname]*r.thickness.value/100;else if("em"===r.thickness.unit)a.thickness=i.styleAttrs[e.byName.fontSize.qname]*r.thickness.value;else if("c"===r.thickness.unit)a.thickness=r.thickness.value/t.cellResolution.h;else{if("px"!==r.thickness.unit)return null;a.thickness=r.thickness.value/t.pxDimensions.h}return a})),new i(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new i(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new i(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new i(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new i(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new i(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,n,i){return"c"===i.unit?i.value/e.cellResolution.h:null})),new i(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new i(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new i(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new i(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[r].qname]=e.all[r];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(void 0===n?this.imscStyles={}:n,"undefined"==typeof imscNames?e(18):imscNames,"undefined"==typeof imscUtils?e(20):imscUtils)},{18:18,20:20}],20:[function(e,t,n){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,o=null,s=r[e.toLowerCase()];return void 0!==s?o=s:null!==(a=t.exec(e))?o=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=i.exec(e))&&(o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),o};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n}}(void 0===n?this.imscUtils={}:n)},{}],21:[function(e,t){"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){function n(){}e.super_=t,n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],22:[function(e,t){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(n(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))||!!e._isBuffer);var t}},{}],23:[function(e,t){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],24:[function(e,t){(function(e){"use strict";!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,i,r){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var a,o,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,n)}));case 3:return e.nextTick((function(){t.call(null,n,i)}));case 4:return e.nextTick((function(){t.call(null,n,i,r)}));default:for(a=new Array(s-1),o=0;o<a.length;)a[o++]=arguments[o];return e.nextTick((function(){t.apply(null,a)}))}}}:t.exports=e}).call(this,e(25))},{25:25}],25:[function(e,t){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function r(e){if(d===setTimeout)return setTimeout(e,0);if((d===n||!d)&&setTimeout)return d=setTimeout,setTimeout(e,0);try{return d(e,0)}catch(t){try{return d.call(null,e,0)}catch(t){return d.call(this,e,0)}}}function a(){p&&f&&(p=!1,f.length?h=f.concat(h):g=-1,h.length&&o())}function o(){if(!p){var e=r(a);p=!0;for(var t=h.length;t;){for(f=h,h=[];++g<t;)f&&f[g].run();g=-1,t=h.length}f=null,p=!1,function(e){if(c===clearTimeout)return clearTimeout(e);if((c===i||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}(e)}}function s(e,t){this.fun=e,this.array=t}function l(){}var d,c,u=t.exports={};!function(){try{d="function"==typeof setTimeout?setTimeout:n}catch(e){d=n}try{c="function"==typeof clearTimeout?clearTimeout:i}catch(e){c=i}}();var f,h=[],p=!1,g=-1;u.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new s(e,t)),1!==h.length||p||r(o)},s.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=l,u.addListener=l,u.once=l,u.off=l,u.removeListener=l,u.removeAllListeners=l,u.emit=l,u.prependListener=l,u.prependOnceListener=l,u.listeners=function(){return[]},u.binding=function(){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],26:[function(e,t){t.exports=e(27)},{27:27}],27:[function(e,t){"use strict";function n(e){if(!(this instanceof n))return new n(e);l.call(this,e),d.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||a.nextTick(r,this)}function r(e){e.end()}var a=e(24),o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=n;var s=e(10);s.inherits=e(21);var l=e(29),d=e(31);s.inherits(n,l);for(var c=o(d.prototype),u=0;u<c.length;u++){var f=c[u];n.prototype[f]||(n.prototype[f]=d.prototype[f])}Object.defineProperty(n.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(n.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),n.prototype._destroy=function(e,t){this.push(null),this.end(),a.nextTick(t,e)}},{10:10,21:21,24:24,29:29,31:31}],28:[function(e,t){"use strict";function n(e){if(!(this instanceof n))return new n(e);i.call(this,e)}t.exports=n;var i=e(30),r=e(10);r.inherits=e(21),r.inherits(n,i),n.prototype._transform=function(e,t,n){n(null,e)}},{10:10,21:21,30:30}],29:[function(e,t){(function(n,i){"use strict";function r(e,t){return e.listeners(t).length}function a(t,n){t=t||{};var i=n instanceof(w=w||e(27));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,a=t.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(a||0===a)?a:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new R,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(A=A||e(42).StringDecoder,this.decoder=new A(t.encoding),this.encoding=t.encoding)}function o(t){if(w=w||e(27),!(this instanceof o))return new o(t);this._readableState=new a(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),S.call(this)}function s(e,t,n,i,r){var a,o,s,d=e._readableState;return null===t?(d.reading=!1,function(e,t){var n;t.ended||(!t.decoder||(n=t.decoder.end())&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length),t.ended=!0,c(e))}(e,d)):(r||(a=function(e,t){var n;return function(e){return C.isBuffer(e)||e instanceof k}(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(d,t)),a?e.emit("error",a):d.objectMode||t&&0<t.length?("string"==typeof t||d.objectMode||Object.getPrototypeOf(t)===C.prototype||(o=t,t=C.from(o)),i?d.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):l(e,d,t,!0):d.ended?e.emit("error",new Error("stream.push() after EOF")):(d.reading=!1,d.decoder&&!n?(t=d.decoder.write(t),d.objectMode||0!==t.length?l(e,d,t,!1):f(e,d)):l(e,d,t,!1))):i||(d.reading=!1)),!(s=d).ended&&(s.needReadable||s.length<s.highWaterMark||0===s.length)}function l(e,t,n,i){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&c(e)),f(e,t)}function d(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=(O<=(n=e)?n=O:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var n}function c(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(D("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?E.nextTick(u,e):u(e))}function u(e){D("emit readable"),e.emit("readable"),m(e)}function f(e,t){t.readingMore||(t.readingMore=!0,E.nextTick(h,e,t))}function h(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(D("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function p(e){D("readable nexttick read 0"),e.read(0)}function g(e,t){t.reading||(D("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),m(e),t.flowing&&!t.reading&&e.read(0)}function m(e){var t=e._readableState;for(D("flow",t.flowing);t.flowing&&null!==e.read(););}function v(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var i;return e<t.head.data.length?(i=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):i=e===t.head.data.length?t.shift():(n?function(e,t){var n=t.head,i=1,r=n.data;for(e-=r.length;n=n.next;){var a=n.data,o=e>a.length?a.length:e;if(o===a.length?r+=a:r+=a.slice(0,e),0==(e-=o)){o===a.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n).data=a.slice(o);break}++i}return t.length-=i,r}:function(e,t){var n=C.allocUnsafe(e),i=t.head,r=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var a=i.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0==(e-=o)){o===a.length?(++r,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i).data=a.slice(o);break}++r}return t.length-=r,n})(e,t),i}(e,t.buffer,t.decoder),n);var n}function y(e){var t=e._readableState;if(0<t.length)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,E.nextTick(_,t,e))}function _(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function b(e,t){for(var n=0,i=e.length;n<i;n++)if(e[n]===t)return n;return-1}var E=e(24);t.exports=o;var w,T=e(23);o.ReadableState=a,e(11).EventEmitter;var S=e(34),C=e(39).Buffer,k=i.Uint8Array||function(){},I=e(10);I.inherits=e(21);var A,x=e(7),D=void 0,R=(D=x&&x.debuglog?x.debuglog("stream"):function(){},e(32)),M=e(33);I.inherits(o,S);var N=["error","close","destroy","pause","resume"];Object.defineProperty(o.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),o.prototype.destroy=M.destroy,o.prototype._undestroy=M.undestroy,o.prototype._destroy=function(e,t){this.push(null),t(e)},o.prototype.push=function(e,t){var n,i=this._readableState;return i.objectMode?n=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=C.from(e,t),t=""),n=!0),s(this,e,t,!1,n)},o.prototype.unshift=function(e){return s(this,e,null,!0,!1)},o.prototype.isPaused=function(){return!1===this._readableState.flowing},o.prototype.setEncoding=function(t){return A=A||e(42).StringDecoder,this._readableState.decoder=new A(t),this._readableState.encoding=t,this};var O=8388608;o.prototype.read=function(e){D("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return D("read: emitReadable",t.length,t.ended),(0===t.length&&t.ended?y:c)(this),null;if(0===(e=d(e,t))&&t.ended)return 0===t.length&&y(this),null;var i,r=t.needReadable;return D("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&D("length less than watermark",r=!0),t.ended||t.reading?D("reading or ended",r=!1):r&&(D("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=d(n,t))),null===(i=0<e?v(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&y(this)),null!==i&&this.emit("data",i),i},o.prototype._read=function(){this.emit("error",new Error("_read() is not implemented"))},o.prototype.pipe=function(e,t){function i(t,n){D("onunpipe"),t===u&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,D("cleanup"),e.removeListener("close",l),e.removeListener("finish",d),e.removeListener("drain",g),e.removeListener("error",s),e.removeListener("unpipe",i),u.removeListener("end",a),u.removeListener("end",c),u.removeListener("data",o),v=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||g())}function a(){D("onend"),e.end()}function o(t){D("ondata"),(y=!1)!==e.write(t)||y||((1===f.pipesCount&&f.pipes===e||1<f.pipesCount&&-1!==b(f.pipes,e))&&!v&&(D("false write response, pause",u._readableState.awaitDrain),u._readableState.awaitDrain++,y=!0),u.pause())}function s(t){D("onerror",t),c(),e.removeListener("error",s),0===r(e,"error")&&e.emit("error",t)}function l(){e.removeListener("finish",d),c()}function d(){D("onfinish"),e.removeListener("close",l),c()}function c(){D("unpipe"),u.unpipe(e)}var u=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,D("pipe count=%d opts=%j",f.pipesCount,t);var h=t&&!1===t.end||e===n.stdout||e===n.stderr?c:a;f.endEmitted?E.nextTick(h):u.once("end",h),e.on("unpipe",i);var p,g=(p=u,function(){var e=p._readableState;D("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&r(p,"data")&&(e.flowing=!0,m(p))});e.on("drain",g);var v=!1,y=!1;return u.on("data",o),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?T(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",s),e.once("close",l),e.once("finish",d),e.emit("pipe",u),f.flowing||(D("pipe resume"),u.resume()),e},o.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e=e||t.pipes,t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var i=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<r;a++)i[a].emit("unpipe",this,n);return this}var o=b(t.pipes,e);return-1===o||(t.pipes.splice(o,1),--t.pipesCount,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},o.prototype.addListener=o.prototype.on=function(e,t){var n,i=S.prototype.on.call(this,e,t);return"data"===e?!1!==this._readableState.flowing&&this.resume():"readable"===e&&((n=this._readableState).endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&c(this):E.nextTick(p,this))),i},o.prototype.resume=function(){var e,t,n=this._readableState;return n.flowing||(D("resume"),n.flowing=!0,e=this,(t=n).resumeScheduled||(t.resumeScheduled=!0,E.nextTick(g,e,t))),this},o.prototype.pause=function(){return D("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(D("pause"),this._readableState.flowing=!1,this.emit("pause")),this},o.prototype.wrap=function(e){var t=this,n=this._readableState,i=!1;for(var r in e.on("end",(function(){var e;D("wrapped end"),!n.decoder||n.ended||(e=n.decoder.end())&&e.length&&t.push(e),t.push(null)})),e.on("data",(function(r){D("wrapped data"),n.decoder&&(r=n.decoder.write(r)),n.objectMode&&null==r||(n.objectMode||r&&r.length)&&(t.push(r)||(i=!0,e.pause()))})),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var a=0;a<N.length;a++)e.on(N[a],this.emit.bind(this,N[a]));return this._read=function(t){D("wrapped _read",t),i&&(i=!1,e.resume())},this},Object.defineProperty(o.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),o._fromList=v}).call(this,e(25),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{10:10,11:11,21:21,
23:23,24:24,25:25,27:27,32:32,33:33,34:34,39:39,42:42,7:7}],30:[function(e,t){"use strict";function n(e){if(!(this instanceof n))return new n(e);a.call(this,e),this._transformState={afterTransform:function(e,t){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,(n.writecb=null)!=t&&this.push(t),i(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",i)}function i(){var e=this;"function"==typeof this._flush?this._flush((function(t,n){r(e,t,n)})):r(this,null,null)}function r(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}t.exports=n;var a=e(27),o=e(10);o.inherits=e(21),o.inherits(n,a),n.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},n.prototype._transform=function(){throw new Error("_transform() is not implemented")},n.prototype._write=function(e,t,n){var i,r=this._transformState;r.writecb=n,r.writechunk=e,r.writeencoding=t,r.transforming||(i=this._readableState,(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark))},n.prototype._read=function(){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},n.prototype._destroy=function(e,t){var n=this;a.prototype._destroy.call(this,e,(function(e){t(e),n.emit("close")}))}},{10:10,21:21,27:27}],31:[function(e,t){(function(n,i,r){"use strict";function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var i=e.entry;for(e.entry=null;i;){var r=i.callback;t.pendingcb--,r(n),i=i.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}function o(){}function s(t,n){m=m||e(27),t=t||{};var i=n instanceof m;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,o=t.writableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var l=(this.destroyed=!1)===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n,i=e._writableState,r=i.sync,a=i.writecb;(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0})(i),t?function(e,t,n,i,r){--t.pendingcb,n?(g.nextTick(r,i),g.nextTick(p,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(r(i),e._writableState.errorEmitted=!0,e.emit("error",i),p(e,t))}(e,i,r,t,a):((n=f(i))||i.corked||i.bufferProcessing||!i.bufferedRequest||u(e,i),r?v(c,e,i,n,a):c(e,i,n,a))}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function l(t){if(m=m||e(27),!(_.call(l,this)||this instanceof m))return new l(t);this._writableState=new s(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),E.call(this)}function d(e,t,n,i,r,a,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(r,t.onwrite):e._write(r,a,t.onwrite),t.sync=!1}function c(e,t,n,i){var r,a;n||(r=e,0===(a=t).length&&a.needDrain&&(a.needDrain=!1,r.emit("drain"))),t.pendingcb--,i(),p(e,t)}function u(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,r=new Array(i),o=t.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)(r[s]=n).isBuf||(l=!1),n=n.next,s+=1;r.allBuffers=l,d(e,t,!0,t.length,r,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,f=n.callback;if(d(e,t,!1,t.objectMode?1:c.length,c,u,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function f(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function h(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),p(e,t)}))}function p(e,t){var n,i,r=f(t);return r&&(n=e,(i=t).prefinished||i.finalCalled||("function"==typeof n._final?(i.pendingcb++,i.finalCalled=!0,g.nextTick(h,n,i)):(i.prefinished=!0,n.emit("prefinish"))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}var g=e(24);t.exports=l;var m,v=!n.browser&&-1<["v0.10","v0.9."].indexOf(n.version.slice(0,5))?r:g.nextTick;l.WritableState=s;var y=e(10);y.inherits=e(21);var _,b={deprecate:e(44)},E=e(34),w=e(39).Buffer,T=i.Uint8Array||function(){},S=e(33);y.inherits(l,E),s.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(s.prototype,"buffer",{get:b.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(_=Function.prototype[Symbol.hasInstance],Object.defineProperty(l,Symbol.hasInstance,{value:function(e){return!!_.call(this,e)||this===l&&e&&e._writableState instanceof s}})):_=function(e){return e instanceof this},l.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},l.prototype.write=function(e,t,n){var i,r,a,s,l,c,u,f,h,p,m,v=this._writableState,y=!1,_=!v.objectMode&&(i=e,w.isBuffer(i)||i instanceof T);return _&&!w.isBuffer(e)&&(r=e,e=w.from(r)),"function"==typeof t&&(n=t,t=null),t=_?"buffer":t||v.defaultEncoding,"function"!=typeof n&&(n=o),v.ended?(h=this,p=n,m=new Error("write after end"),h.emit("error",m),g.nextTick(p,m)):(_||(a=this,s=v,c=n,f=!(u=!0),null===(l=e)?f=new TypeError("May not write null values to stream"):"string"==typeof l||void 0===l||s.objectMode||(f=new TypeError("Invalid non-string/buffer chunk")),f&&(a.emit("error",f),g.nextTick(c,f),u=!1),u))&&(v.pendingcb++,y=function(e,t,n,i,r,a){var o;n||i!==(o=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=w.from(t,n)),t}(t,i,r))&&(n=!0,r="buffer",i=o);var s=t.objectMode?1:i.length;t.length+=s;var l,c=t.length<t.highWaterMark;return c||(t.needDrain=!0),t.writing||t.corked?(l=t.lastBufferedRequest,t.lastBufferedRequest={chunk:i,encoding:r,isBuf:n,callback:a,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1):d(e,t,!1,s,i,r,a),c}(this,v,_,e,t,n)),y},l.prototype.cork=function(){this._writableState.corked++},l.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||u(this,e))},l.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),l.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},l.prototype._writev=null,l.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,t=e=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(e,t,n){t.ending=!0,p(e,t),n&&(t.finished?g.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,i,n)},Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),l.prototype.destroy=S.destroy,l.prototype._undestroy=S.undestroy,l.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,e(25),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e(43).setImmediate)},{10:10,21:21,24:24,25:25,27:27,33:33,34:34,39:39,43:43,44:44}],32:[function(e,t){"use strict";function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),this.head=null,this.tail=null,this.length=0}var i=e(39).Buffer,r=e(7);t.exports=(n.prototype.push=function(e){var t={data:e,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length},n.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},n.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},n.prototype.clear=function(){this.head=this.tail=null,this.length=0},n.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},n.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t,n,r=i.allocUnsafe(e>>>0),a=this.head,o=0;a;)t=r,n=o,a.data.copy(t,n),o+=a.data.length,a=a.next;return r},n),r&&r.inspect&&r.inspect.custom&&(t.exports.prototype[r.inspect.custom]=function(){var e=r.inspect({length:this.length});return this.constructor.name+" "+e})},{39:39,7:7}],33:[function(e,t){"use strict";function n(e,t){e.emit("error",t)}var i=e(24);t.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return a||o?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||i.nextTick(n,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(i.nextTick(n,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}))),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{24:24}],34:[function(e,t){t.exports=e(11).EventEmitter},{11:11}],35:[function(e,t){t.exports=e(36).PassThrough},{36:36}],36:[function(e,t,n){(((n=t.exports=e(29)).Stream=n).Readable=n).Writable=e(31),n.Duplex=e(27),n.Transform=e(30),n.PassThrough=e(28)},{27:27,28:28,29:29,30:30,31:31}],37:[function(e,t){t.exports=e(36).Transform},{36:36}],38:[function(e,t){t.exports=e(31)},{31:31}],39:[function(e,t,n){function i(e,t){for(var n in e)t[n]=e[n]}function r(e,t,n){return o(e,t,n)}var a=e(8),o=a.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=a:(i(a,n),n.Buffer=r),i(o,r),r.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,n)},r.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=o(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},r.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},r.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return a.SlowBuffer(e)}},{8:8}],40:[function(e,t,n){(function(t){!function(n){function i(e,t){if(!(this instanceof i))return new i(e,t);var r=this;!function(e){for(var t=0,n=T.length;t<n;t++)e[T[t]]=""}(r),r.q=r.c="",r.bufferCheckPosition=n.MAX_BUFFER_LENGTH,r.opt=t||{},r.opt.lowercase=r.opt.lowercase||r.opt.lowercasetags,r.looseCase=r.opt.lowercase?"toLowerCase":"toUpperCase",r.tags=[],r.closed=r.closedRoot=r.sawRoot=!1,r.tag=r.error=null,r.strict=!!e,r.noscript=!(!e&&!r.opt.noscript),r.state=H.BEGIN,r.strictEntities=r.opt.strictEntities,r.ENTITIES=r.strictEntities?Object.create(n.XML_ENTITIES):Object.create(n.ENTITIES),r.attribList=[],r.opt.xmlns&&(r.ns=Object.create(N)),r.trackPosition=!1!==r.opt.position,r.trackPosition&&(r.position=r.line=r.column=0),l(r,"onready")}function r(e,t){if(!(this instanceof r))return new r(e,t);w.apply(this),this._parser=new i(e,t),this.writable=!0,this.readable=!0;var n=this;this._parser.onend=function(){n.emit("end")},this._parser.onerror=function(e){n.emit("error",e),n._parser.error=null},this._decoder=null,S.forEach((function(e){Object.defineProperty(n,"on"+e,{get:function(){return n._parser["on"+e]},set:function(t){if(!t)return n.removeAllListeners(e),n._parser["on"+e]=t;n.on(e,t)},enumerable:!0,configurable:!1})}))}function a(e){return e.split("").reduce((function(e,t){return e[t]=!0,e}),{})}function o(e,t){return n=e,"[object RegExp]"===Object.prototype.toString.call(n)?t.match(e):e[t];var n}function s(e,t){return!o(e,t)}function l(e,t,n){e[t]&&e[t](n)}function d(e,t,n){e.textNode&&c(e),l(e,t,n)}function c(e){e.textNode=u(e.opt,e.textNode),e.textNode&&l(e,"ontext",e.textNode),e.textNode=""}function u(e,t){return e.trim&&(t=t.trim()),e.normalize&&(t=t.replace(/\s+/g," ")),t}function f(e,t){return c(e),e.trackPosition&&(t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c),t=new Error(t),e.error=t,l(e,"onerror",t),e}function h(e){return e.sawRoot&&!e.closedRoot&&p(e,"Unclosed root tag"),e.state!==H.BEGIN&&e.state!==H.BEGIN_WHITESPACE&&e.state!==H.TEXT&&f(e,"Unexpected end"),c(e),e.c="",e.closed=!0,l(e,"onend"),i.call(e,e.strict,e.opt),e}function p(e,t){if("object"!=typeof e||!(e instanceof i))throw new Error("bad call to strictFail");e.strict&&f(e,t)}function g(e,t){var n=e.indexOf(":")<0?["",e]:e.split(":"),i=n[0],r=n[1];return t&&"xmlns"===e&&(i="xmlns",r=""),{prefix:i,local:r}}function m(e){var t,n,i,r,a;e.strict||(e.attribName=e.attribName[e.looseCase]()),-1!==e.attribList.indexOf(e.attribName)||e.tag.attributes.hasOwnProperty(e.attribName)||(e.opt.xmlns?(n=(t=g(e.attribName,!0)).prefix,i=t.local,"xmlns"===n&&("xml"===i&&e.attribValue!==R?p(e,"xml: prefix must be bound to "+R+"\nActual: "+e.attribValue):"xmlns"===i&&e.attribValue!==M?p(e,"xmlns: prefix must be bound to "+M+"\nActual: "+e.attribValue):(r=e.tag,a=e.tags[e.tags.length-1]||e,r.ns===a.ns&&(r.ns=Object.create(a.ns)),r.ns[i]=e.attribValue)),e.attribList.push([e.attribName,e.attribValue])):(e.tag.attributes[e.attribName]=e.attribValue,d(e,"onattribute",{name:e.attribName,value:e.attribValue}))),e.attribName=e.attribValue=""}function v(e,t){if(e.opt.xmlns){var n=e.tag,i=g(e.tagName);n.prefix=i.prefix,n.local=i.local,n.uri=n.ns[i.prefix]||"",n.prefix&&!n.uri&&(p(e,"Unbound namespace prefix: "+JSON.stringify(e.tagName)),n.uri=i.prefix);var r=e.tags[e.tags.length-1]||e;n.ns&&r.ns!==n.ns&&Object.keys(n.ns).forEach((function(t){d(e,"onopennamespace",{prefix:t,uri:n.ns[t]})}));for(var a=0,o=e.attribList.length;a<o;a++){var s=e.attribList[a],l=s[0],c=s[1],u=g(l,!0),f=u.prefix,h=u.local,m=""!==f&&n.ns[f]||"",v={name:l,value:c,prefix:f,local:h,uri:m};f&&"xmlns"!==f&&!m&&(p(e,"Unbound namespace prefix: "+JSON.stringify(f)),v.uri=f),e.tag.attributes[l]=v,d(e,"onattribute",v)}e.attribList.length=0}e.tag.isSelfClosing=!!t,e.sawRoot=!0,e.tags.push(e.tag),d(e,"onopentag",e.tag),t||(e.noscript||"script"!==e.tagName.toLowerCase()?e.state=H.TEXT:e.state=H.SCRIPT,e.tag=null,e.tagName=""),e.attribName=e.attribValue="",e.attribList.length=0}function y(e){if(!e.tagName)return p(e,"Weird empty close tag."),e.textNode+="</>",void(e.state=H.TEXT);if(e.script){if("script"!==e.tagName)return e.script+="</"+e.tagName+">",e.tagName="",void(e.state=H.SCRIPT);d(e,"onscript",e.script),e.script=""}var t=e.tags.length,n=e.tagName;e.strict||(n=n[e.looseCase]());for(var i=n;t--&&e.tags[t].name!==i;)p(e,"Unexpected close tag");if(t<0)return p(e,"Unmatched closing tag: "+e.tagName),e.textNode+="</"+e.tagName+">",void(e.state=H.TEXT);e.tagName=n;for(var r=e.tags.length;r-- >t;){var a=e.tag=e.tags.pop();e.tagName=e.tag.name,d(e,"onclosetag",e.tagName);var o={};for(var s in a.ns)o[s]=a.ns[s];var l=e.tags[e.tags.length-1]||e;e.opt.xmlns&&a.ns!==l.ns&&Object.keys(a.ns).forEach((function(t){var n=a.ns[t];d(e,"onclosenamespace",{prefix:t,uri:n})}))}0===t&&(e.closedRoot=!0),e.tagName=e.attribValue=e.attribName="",e.attribList.length=0,e.state=H.TEXT}function _(e,t){"<"===t?(e.state=H.OPEN_WAKA,e.startTagPosition=e.position):s(O,t)&&(p(e,"Non-whitespace before first tag."),e.textNode=t,e.state=H.TEXT)}function b(e,t){var n="";return t<e.length&&(n=e.charAt(t)),n}function E(){var e,t,n=[],i=-1,r=arguments.length;if(!r)return"";for(var a="";++i<r;){var o=Number(arguments[i]);if(!isFinite(o)||o<0||1114111<o||U(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?n.push(o):(e=55296+((o-=65536)>>10),t=o%1024+56320,n.push(e,t)),(i+1===r||16384<n.length)&&(a+=B.apply(null,n),n.length=0)}return a}n.parser=function(e,t){return new i(e,t)},n.SAXParser=i,n.SAXStream=r,n.createStream=function(e,t){return new r(e,t)},n.MAX_BUFFER_LENGTH=65536;var w,T=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];n.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(e){function t(){}return t.prototype=e,new t}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t}),i.prototype={end:function(){h(this)},write:function(e){var t=this;if(this.error)throw this.error;if(t.closed)return f(t,"Cannot write after close. Assign an onready handler.");if(null===e)return h(t);"object"==typeof e&&(e=e.toString());for(var i,r,a=0,l="";l=b(e,a++),t.c=l;)switch(t.trackPosition&&(t.position++,"\n"===l?(t.line++,t.column=0):t.column++),t.state){case H.BEGIN:if(t.state=H.BEGIN_WHITESPACE,"\ufeff"===l)continue;_(t,l);continue;case H.BEGIN_WHITESPACE:_(t,l);continue;case H.TEXT:if(t.sawRoot&&!t.closedRoot){for(var g=a-1;l&&"<"!==l&&"&"!==l;)(l=b(e,a++))&&t.trackPosition&&(t.position++,"\n"===l?(t.line++,t.column=0):t.column++);t.textNode+=e.substring(g,a-1)}"<"!==l||t.sawRoot&&t.closedRoot&&!t.strict?(!s(O,l)||t.sawRoot&&!t.closedRoot||p(t,"Text data outside of root node."),"&"===l?t.state=H.TEXT_ENTITY:t.textNode+=l):(t.state=H.OPEN_WAKA,t.startTagPosition=t.position);continue;case H.SCRIPT:"<"===l?t.state=H.SCRIPT_ENDING:t.script+=l;continue;case H.SCRIPT_ENDING:"/"===l?t.state=H.CLOSE_TAG:(t.script+="<"+l,t.state=H.SCRIPT);continue;case H.OPEN_WAKA:var E;"!"===l?(t.state=H.SGML_DECL,t.sgmlDecl=""):o(O,l)||(o(P,l)?(t.state=H.OPEN_TAG,t.tagName=l):"/"===l?(t.state=H.CLOSE_TAG,t.tagName=""):"?"===l?(t.state=H.PROC_INST,t.procInstName=t.procInstBody=""):(p(t,"Unencoded <"),t.startTagPosition+1<t.position&&(E=t.position-t.startTagPosition,l=new Array(E).join(" ")+l),t.textNode+="<"+l,t.state=H.TEXT));continue;case H.SGML_DECL:(t.sgmlDecl+l).toUpperCase()===x?(d(t,"onopencdata"),t.state=H.CDATA,t.sgmlDecl="",t.cdata=""):t.sgmlDecl+l==="--"?(t.state=H.COMMENT,t.comment="",t.sgmlDecl=""):(t.sgmlDecl+l).toUpperCase()===D?(t.state=H.DOCTYPE,(t.doctype||t.sawRoot)&&p(t,"Inappropriately located doctype declaration"),t.doctype="",t.sgmlDecl=""):">"===l?(d(t,"onsgmldeclaration",t.sgmlDecl),t.sgmlDecl="",t.state=H.TEXT):(o(I,l)&&(t.state=H.SGML_DECL_QUOTED),t.sgmlDecl+=l);continue;case H.SGML_DECL_QUOTED:l===t.q&&(t.state=H.SGML_DECL,t.q=""),t.sgmlDecl+=l;continue;case H.DOCTYPE:">"===l?(t.state=H.TEXT,d(t,"ondoctype",t.doctype),t.doctype=!0):(t.doctype+=l,"["===l?t.state=H.DOCTYPE_DTD:o(I,l)&&(t.state=H.DOCTYPE_QUOTED,t.q=l));continue;case H.DOCTYPE_QUOTED:t.doctype+=l,l===t.q&&(t.q="",t.state=H.DOCTYPE);continue;case H.DOCTYPE_DTD:t.doctype+=l,"]"===l?t.state=H.DOCTYPE:o(I,l)&&(t.state=H.DOCTYPE_DTD_QUOTED,t.q=l);continue;case H.DOCTYPE_DTD_QUOTED:t.doctype+=l,l===t.q&&(t.state=H.DOCTYPE_DTD,t.q="");continue;case H.COMMENT:"-"===l?t.state=H.COMMENT_ENDING:t.comment+=l;continue;case H.COMMENT_ENDING:"-"===l?(t.state=H.COMMENT_ENDED,t.comment=u(t.opt,t.comment),t.comment&&d(t,"oncomment",t.comment),t.comment=""):(t.comment+="-"+l,t.state=H.COMMENT);continue;case H.COMMENT_ENDED:">"!==l?(p(t,"Malformed comment"),t.comment+="--"+l,t.state=H.COMMENT):t.state=H.TEXT;continue;case H.CDATA:"]"===l?t.state=H.CDATA_ENDING:t.cdata+=l;continue;case H.CDATA_ENDING:"]"===l?t.state=H.CDATA_ENDING_2:(t.cdata+="]"+l,t.state=H.CDATA);continue;case H.CDATA_ENDING_2:">"===l?(t.cdata&&d(t,"oncdata",t.cdata),d(t,"onclosecdata"),t.cdata="",t.state=H.TEXT):"]"===l?t.cdata+="]":(t.cdata+="]]"+l,t.state=H.CDATA);continue;case H.PROC_INST:"?"===l?t.state=H.PROC_INST_ENDING:o(O,l)?t.state=H.PROC_INST_BODY:t.procInstName+=l;continue;case H.PROC_INST_BODY:if(!t.procInstBody&&o(O,l))continue;"?"===l?t.state=H.PROC_INST_ENDING:t.procInstBody+=l;continue;case H.PROC_INST_ENDING:">"===l?(d(t,"onprocessinginstruction",{name:t.procInstName,body:t.procInstBody}),t.procInstName=t.procInstBody="",t.state=H.TEXT):(t.procInstBody+="?"+l,t.state=H.PROC_INST_BODY);continue;case H.OPEN_TAG:o(L,l)?t.tagName+=l:(function(e){e.strict||(e.tagName=e.tagName[e.looseCase]());var t=e.tags[e.tags.length-1]||e,n=e.tag={name:e.tagName,attributes:{}};e.opt.xmlns&&(n.ns=t.ns),e.attribList.length=0,d(e,"onopentagstart",n)}(t),">"===l?v(t):"/"===l?t.state=H.OPEN_TAG_SLASH:(s(O,l)&&p(t,"Invalid character in tag name"),t.state=H.ATTRIB));continue;case H.OPEN_TAG_SLASH:">"===l?(v(t,!0),y(t)):(p(t,"Forward-slash in opening tag not followed by >"),t.state=H.ATTRIB);continue;case H.ATTRIB:if(o(O,l))continue;">"===l?v(t):"/"===l?t.state=H.OPEN_TAG_SLASH:o(P,l)?(t.attribName=l,t.attribValue="",t.state=H.ATTRIB_NAME):p(t,"Invalid attribute name");continue;case H.ATTRIB_NAME:"="===l?t.state=H.ATTRIB_VALUE:">"===l?(p(t,"Attribute without value"),t.attribValue=t.attribName,m(t),v(t)):o(O,l)?t.state=H.ATTRIB_NAME_SAW_WHITE:o(L,l)?t.attribName+=l:p(t,"Invalid attribute name");continue;case H.ATTRIB_NAME_SAW_WHITE:if("="===l)t.state=H.ATTRIB_VALUE;else{if(o(O,l))continue;p(t,"Attribute without value"),t.tag.attributes[t.attribName]="",t.attribValue="",d(t,"onattribute",{name:t.attribName,value:""}),t.attribName="",">"===l?v(t):o(P,l)?(t.attribName=l,t.state=H.ATTRIB_NAME):(p(t,"Invalid attribute name"),t.state=H.ATTRIB)}continue;case H.ATTRIB_VALUE:if(o(O,l))continue;o(I,l)?(t.q=l,t.state=H.ATTRIB_VALUE_QUOTED):(p(t,"Unquoted attribute value"),t.state=H.ATTRIB_VALUE_UNQUOTED,t.attribValue=l);continue;case H.ATTRIB_VALUE_QUOTED:if(l!==t.q){"&"===l?t.state=H.ATTRIB_VALUE_ENTITY_Q:t.attribValue+=l;continue}m(t),t.q="",t.state=H.ATTRIB_VALUE_CLOSED;continue;case H.ATTRIB_VALUE_CLOSED:o(O,l)?t.state=H.ATTRIB:">"===l?v(t):"/"===l?t.state=H.OPEN_TAG_SLASH:o(P,l)?(p(t,"No whitespace between attributes"),t.attribName=l,t.attribValue="",t.state=H.ATTRIB_NAME):p(t,"Invalid attribute name");continue;case H.ATTRIB_VALUE_UNQUOTED:if(s(A,l)){"&"===l?t.state=H.ATTRIB_VALUE_ENTITY_U:t.attribValue+=l;continue}m(t),">"===l?v(t):t.state=H.ATTRIB;continue;case H.CLOSE_TAG:if(t.tagName)">"===l?y(t):o(L,l)?t.tagName+=l:t.script?(t.script+="</"+t.tagName,t.tagName="",t.state=H.SCRIPT):(s(O,l)&&p(t,"Invalid tagname in closing tag"),t.state=H.CLOSE_TAG_SAW_WHITE);else{if(o(O,l))continue;s(P,l)?t.script?(t.script+="</"+l,t.state=H.SCRIPT):p(t,"Invalid tagname in closing tag."):t.tagName=l}continue;case H.CLOSE_TAG_SAW_WHITE:if(o(O,l))continue;">"===l?y(t):p(t,"Invalid characters in closing tag");continue;case H.TEXT_ENTITY:case H.ATTRIB_VALUE_ENTITY_Q:case H.ATTRIB_VALUE_ENTITY_U:switch(t.state){case H.TEXT_ENTITY:i=H.TEXT,r="textNode";break;case H.ATTRIB_VALUE_ENTITY_Q:i=H.ATTRIB_VALUE_QUOTED,r="attribValue";break;case H.ATTRIB_VALUE_ENTITY_U:i=H.ATTRIB_VALUE_UNQUOTED,r="attribValue"}";"===l?(t[r]+=function(e){var t,n=e.entity,i=n.toLowerCase(),r="";return e.ENTITIES[n]?e.ENTITIES[n]:e.ENTITIES[i]?e.ENTITIES[i]:("#"===(n=i).charAt(0)&&(r="x"===n.charAt(1)?(n=n.slice(2),(t=parseInt(n,16)).toString(16)):(n=n.slice(1),(t=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),r.toLowerCase()===n?String.fromCodePoint(t):(p(e,"Invalid character entity"),"&"+e.entity+";"))}(t),t.entity="",t.state=i):o(t.entity.length?j:F,l)?t.entity+=l:(p(t,"Invalid character in entity name"),t[r]+="&"+t.entity+l,t.entity="",t.state=i);continue;default:throw new Error(t,"Unknown state: "+t.state)}return t.position>=t.bufferCheckPosition&&function(e){for(var t=Math.max(n.MAX_BUFFER_LENGTH,10),i=0,r=0,a=T.length;r<a;r++){var o=e[T[r]].length;if(t<o)switch(T[r]){case"textNode":c(e);break;case"cdata":d(e,"oncdata",e.cdata),e.cdata="";break;case"script":d(e,"onscript",e.script),e.script="";break;default:f(e,"Max buffer length exceeded: "+T[r])}i=Math.max(i,o)}var s=n.MAX_BUFFER_LENGTH-i;e.bufferCheckPosition=s+e.position}(t),t},resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var e;c(e=this),""!==e.cdata&&(d(e,"oncdata",e.cdata),e.cdata=""),""!==e.script&&(d(e,"onscript",e.script),e.script="")}};try{w=e(41).Stream}catch(C){w=function(){}}var S=n.EVENTS.filter((function(e){return"error"!==e&&"end"!==e}));(r.prototype=Object.create(w.prototype,{constructor:{value:r}})).write=function(n){var i;return"function"==typeof t&&"function"==typeof t.isBuffer&&t.isBuffer(n)&&(this._decoder||(i=e(42).StringDecoder,this._decoder=new i("utf8")),n=this._decoder.write(n)),this._parser.write(n.toString()),this.emit("data",n),!0},r.prototype.end=function(e){return e&&e.length&&this.write(e),this._parser.end(),!0},r.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===S.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),w.prototype.on.call(n,e,t)};var C="0124356789",k="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",I="'\"",A=(O="\r\n\t ")+">",x="[CDATA[",D="DOCTYPE",R="http://www.w3.org/XML/1998/namespace",M="http://www.w3.org/2000/xmlns/",N={xml:R,xmlns:M},O=a(O),P=(C=a(C),k=a(k),/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/),L=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/,F=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,j=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040\.\d-]/;I=a(I),A=a(A);var B,U,H=0;for(var $ in n.STATE={BEGIN:H++,BEGIN_WHITESPACE:H++,TEXT:H++,TEXT_ENTITY:H++,OPEN_WAKA:H++,SGML_DECL:H++,SGML_DECL_QUOTED:H++,DOCTYPE:H++,DOCTYPE_QUOTED:H++,DOCTYPE_DTD:H++,DOCTYPE_DTD_QUOTED:H++,COMMENT_STARTING:H++,COMMENT:H++,COMMENT_ENDING:H++,COMMENT_ENDED:H++,CDATA:H++,CDATA_ENDING:H++,CDATA_ENDING_2:H++,PROC_INST:H++,PROC_INST_BODY:H++,PROC_INST_ENDING:H++,OPEN_TAG:H++,OPEN_TAG_SLASH:H++,ATTRIB:H++,ATTRIB_NAME:H++,ATTRIB_NAME_SAW_WHITE:H++,ATTRIB_VALUE:H++,ATTRIB_VALUE_QUOTED:H++,ATTRIB_VALUE_CLOSED:H++,ATTRIB_VALUE_UNQUOTED:H++,ATTRIB_VALUE_ENTITY_Q:H++,ATTRIB_VALUE_ENTITY_U:H++,CLOSE_TAG:H++,CLOSE_TAG_SAW_WHITE:H++,SCRIPT:H++,SCRIPT_ENDING:H++},n.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},n.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(n.ENTITIES).forEach((function(e){var t=n.ENTITIES[e],i="number"==typeof t?String.fromCharCode(t):t;n.ENTITIES[e]=i})),n.STATE)n.STATE[n.STATE[$]]=$;H=n.STATE,String.fromCodePoint||(B=String.fromCharCode,U=Math.floor,Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:E,configurable:!0,writable:!0}):String.fromCodePoint=E)}(void 0===n?this.sax={}:n)}).call(this,e(8).Buffer)},{41:41,42:42,8:8}],41:[function(e,t){function n(){i.call(this)}t.exports=n;var i=e(11).EventEmitter;e(21)(n,i),n.Readable=e(36),n.Writable=e(38),n.Duplex=e(26),n.Transform=e(37),n.PassThrough=e(35),(n.Stream=n).prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&d.pause&&d.pause()}function r(){d.readable&&d.resume&&d.resume()}function a(){c||(c=!0,e.end())}function o(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function s(e){if(l(),0===i.listenerCount(this,"error"))throw e}function l(){d.removeListener("data",n),e.removeListener("drain",r),d.removeListener("end",a),d.removeListener("close",o),d.removeListener("error",s),e.removeListener("error",s),d.removeListener("end",l),d.removeListener("close",l),e.removeListener("close",l)}var d=this;d.on("data",n),e.on("drain",r),e._isStdio||t&&!1===t.end||(d.on("end",a),d.on("close",o));var c=!1;return d.on("error",s),e.on("error",s),d.on("end",l),d.on("close",l),e.on("close",l),e.emit("pipe",d),e}},{11:11,21:21,26:26,35:35,36:36,37:37,38:38}],42:[function(e,t,n){"use strict";function i(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le"
;case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(h.isEncoding===p||!p(e)))throw new Error("Unknown encoding: "+e);return t||e}function r(e){var t;switch(this.encoding=i(e),this.encoding){case"utf16le":this.text=s,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=d,this.end=c,t=3;break;default:return this.write=u,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=h.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(1<e.lastNeed&&1<t.length){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(2<e.lastNeed&&2<t.length&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2!=0)return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1);var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(55296<=i&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function d(e,t){var n=(e.length-t)%3;return 0==n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1==n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}var h=e(39).Buffer,p=h.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};(n.StringDecoder=r).prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},r.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\ufffd":t},r.prototype.text=function(e,t){var n=function(e,t,n){var i=t.length-1;if(i<n)return 0;var r=a(t[i]);return 0<=r?(0<r&&(e.lastNeed=r-1),r):--i<n||-2===r?0:0<=(r=a(t[i]))?(0<r&&(e.lastNeed=r-2),r):--i<n||-2===r?0:0<=(r=a(t[i]))?(0<r&&(2===r?r=0:e.lastNeed=r-3),r):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},r.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{39:39}],43:[function(e,t,n){(function(t,i){function r(e,t){this._id=e,this._clearFn=t}var a=e(25).nextTick,o=Function.prototype.apply,s=Array.prototype.slice,l={},d=0;n.setTimeout=function(){return new r(o.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new r(o.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n.setImmediate="function"==typeof t?t:function(e){var t=d++,i=!(arguments.length<2)&&s.call(arguments,1);return l[t]=!0,a((function(){l[t]&&(i?e.apply(null,i):e.call(null),n.clearImmediate(t))})),t},n.clearImmediate="function"==typeof i?i:function(e){delete l[e]}}).call(this,e(43).setImmediate,e(43).clearImmediate)},{25:25,43:43}],44:[function(e,t){(function(e){function n(t){try{if(!e.localStorage)return}catch(t){return}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],45:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){return e&&e.bind?e.bind(window.console):window.console.log.bind(window.console)}function n(e,t){var n="",i=null;g&&(i=(new Date).getTime(),n+="["+(i-v)+"]"),m&&t&&t.getClassName&&(n+="["+t.getClassName()+"]",t.getType&&(n+="["+t.getType()+"]")),0<n.length&&(n+=" ");for(var r=arguments.length,a=Array(2<r?r-2:0),l=2;l<r;l++)a[l-2]=arguments[l];Array.apply(null,a).forEach((function(e){n+=e+" "})),p[e]&&h.get().debug.logLevel>=e&&p[e](n),s.trigger(o.default.LOG,{message:n,level:e})}e=e||{};var i,r=this.context,s=(0,a.default)(r).getInstance(),h=e.settings,p=[],g=void 0,m=void 0,v=void 0;return i={getLogger:function(e){return{fatal:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];n.apply(void 0,[l,this].concat(t))}.bind(e),error:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];n.apply(void 0,[d,this].concat(t))}.bind(e),warn:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];n.apply(void 0,[c,this].concat(t))}.bind(e),info:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];n.apply(void 0,[u,this].concat(t))}.bind(e),debug:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];n.apply(void 0,[f,this].concat(t))}.bind(e)}},setLogTimestampVisible:function(e){g=e},setCalleeNameVisible:function(e){m=e}},m=g=!0,v=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(p[l]=t(window.console.error),p[d]=t(window.console.error),p[c]=t(window.console.warn),p[u]=t(window.console.info),p[f]=t(window.console.debug)),i}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(46)),o=i(e(54)),s=i(e(47)),l=1,d=2,c=3,u=4,f=5;r.__dashjs_factory_name="Debug";var h=s.default.getSingletonFactory(r);h.LOG_LEVEL_NONE=0,h.LOG_LEVEL_FATAL=l,h.LOG_LEVEL_ERROR=d,h.LOG_LEVEL_WARNING=c,h.LOG_LEVEL_INFO=u,h.LOG_LEVEL_DEBUG=f,s.default.updateSingletonFactory(r.__dashjs_factory_name,h),n.default=h,t.exports=n.default},{46:46,47:47,54:54}],46:[function(e,t,n){"use strict";function i(){function e(e,n,i){var r=-1;return t[e]&&t[e].some((function(e,t){if(e&&e.callback===n&&(!i||i===e.scope))return r=t,!0})),r}var t={};return{on:function(n,i,r){var a,o=arguments.length<=3||void 0===arguments[3]?0:arguments[3];if(!n)throw new Error("event type cannot be null or undefined");if(!i||"function"!=typeof i)throw new Error("listener must be a function: "+i);0<=e(n,i,r)||(t[n]=t[n]||[],a={callback:i,scope:r,priority:o},t[n].some((function(e,i){if(e&&o>e.priority)return t[n].splice(i,0,a),!0}))||t[n].push(a))},off:function(n,i,r){var a;n&&i&&t[n]&&((a=e(n,i,r))<0||(t[n][a]=null))},trigger:function(e,n){if(e&&t[e]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=e,t[e]=t[e].filter((function(e){return e})),t[e].forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){t={}}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="EventBus";var o=a.default.getSingletonFactory(i);o.EVENT_PRIORITY_LOW=0,o.EVENT_PRIORITY_HIGH=5e3,a.default.updateSingletonFactory(i.__dashjs_factory_name,o),n.default=o,t.exports=n.default},{47:47}],47:[function(e,t,n){"use strict";function i(e,t){for(var n in l){var i=l[n];if(i.context===e&&i.name===t)return i.instance}return null}function r(e,t){return t[e]}function a(e,t,n){e in n&&(n[e]=t)}function o(e,t,n){var i=void 0,r=e.__dashjs_factory_name,a=t[r];if(a){var o=a.instance;if(!a.override)return o.apply({context:t,factory:s},n);for(var l in i=e.apply({context:t},n),o=o.apply({context:t,factory:s,parent:i},n))i.hasOwnProperty(l)&&(i[l]=o[l])}else i=e.apply({context:t},n);return i.getClassName=function(){return r},i}Object.defineProperty(n,"__esModule",{value:!0});var s,l,d,c,u=(s=void 0,l=[],d={},c={},s={extend:function(e,t,n,i){!i[e]&&t&&(i[e]={instance:t,override:n})},getSingletonInstance:i,setSingletonInstance:function(e,t,n){for(var i in l){var r=l[i];if(r.context===e&&r.name===t)return void(l[i].instance=n)}l.push({name:t,context:e,instance:n})},getSingletonFactory:function(e){var t=r(e.__dashjs_factory_name,d);return t||(t=function(t){var n=void 0;return void 0===t&&(t={}),{getInstance:function(){return(n=n||i(t,e.__dashjs_factory_name))||(n=o(e,t,arguments),l.push({name:e.__dashjs_factory_name,context:t,instance:n})),n}}},d[e.__dashjs_factory_name]=t),t},getSingletonFactoryByName:function(e){return r(e,d)},updateSingletonFactory:function(e,t){a(e,t,d)},getClassFactory:function(e){var t=r(e.__dashjs_factory_name,c);return t||(t=function(t){return void 0===t&&(t={}),{create:function(){return o(e,t,arguments)}}},c[e.__dashjs_factory_name]=t),t},getClassFactoryByName:function(e){return r(e,c)},updateClassFactory:function(e,t){a(e,t,c)}});n.default=u,t.exports=n.default},{}],48:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){var e,t,n={debug:{logLevel:l.default.LOG_LEVEL_WARNING},streaming:{metricsMaxListDepth:1e3,abandonLoadTimeout:1e4,liveDelayFragmentCount:NaN,liveDelay:null,scheduleWhilePaused:!0,fastSwitchEnabled:!1,flushBufferAtTrackSwitch:!1,calcSegmentAvailabilityRangeFromTimeline:!0,bufferPruningInterval:10,bufferToKeep:20,jumpGaps:!0,jumpLargeGaps:!0,smallGapLimit:1.5,stableBufferTime:12,bufferTimeAtTopQuality:30,bufferTimeAtTopQualityLongForm:60,longFormContentDurationThreshold:600,wallclockTimeUpdateInterval:50,lowLatencyEnabled:!1,keepProtectionMediaKeys:!1,useManifestDateHeaderTimeSource:!0,useSuggestedPresentationDelay:!0,useAppendWindow:!0,manifestUpdateRetryInterval:100,liveCatchUpMinDrift:.02,liveCatchUpMaxDrift:0,liveCatchUpPlaybackRate:.5,liveCatchupLatencyThreshold:NaN,lastBitrateCachingInfo:{enabled:!0,ttl:36e4},lastMediaSettingsCachingInfo:{enabled:!0,ttl:36e4},cacheLoadThresholds:{video:50,audio:5},retryIntervals:(r(e={},c.HTTPRequest.MPD_TYPE,500),r(e,c.HTTPRequest.XLINK_EXPANSION_TYPE,500),r(e,c.HTTPRequest.MEDIA_SEGMENT_TYPE,1e3),r(e,c.HTTPRequest.INIT_SEGMENT_TYPE,1e3),r(e,c.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,1e3),r(e,c.HTTPRequest.INDEX_SEGMENT_TYPE,1e3),r(e,c.HTTPRequest.OTHER_TYPE,1e3),r(e,"lowLatencyReductionFactor",10),e),retryAttempts:(r(t={},c.HTTPRequest.MPD_TYPE,3),r(t,c.HTTPRequest.XLINK_EXPANSION_TYPE,1),r(t,c.HTTPRequest.MEDIA_SEGMENT_TYPE,3),r(t,c.HTTPRequest.INIT_SEGMENT_TYPE,3),r(t,c.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,3),r(t,c.HTTPRequest.INDEX_SEGMENT_TYPE,3),r(t,c.HTTPRequest.OTHER_TYPE,3),r(t,"lowLatencyMultiplyFactor",5),t),abr:{movingAverageMethod:d.default.MOVING_AVERAGE_SLIDING_WINDOW,ABRStrategy:d.default.ABR_STRATEGY_DYNAMIC,bandwidthSafetyFactor:.9,useDefaultABRRules:!0,useBufferOccupancyABR:!1,useDeadTimeLatency:!0,limitBitrateByPortal:!1,usePixelRatioInLimitBitrateByPortal:!1,maxBitrate:{audio:-1,video:-1},minBitrate:{audio:-1,video:-1},maxRepresentationRatio:{audio:1,video:1},initialBitrate:{audio:-1,video:-1},initialRepresentationRatio:{audio:-1,video:-1},autoSwitchBitrate:{audio:!0,video:!0}},cmcd:{enabled:!1,sid:null,cid:null,did:null}}},i=s.default.clone(n);return{get:function(){return i},update:function(e){"object"==typeof e&&function e(t,n,i){for(var r in t)t.hasOwnProperty(r)&&n.hasOwnProperty(r)&&("object"==typeof t[r]&&null!==t[r]?e(t[r],n[r],i.slice()+r+"."):n[r]=s.default.clone(t[r]))}(e,i,"")},reset:function(){i=s.default.clone(n)}}}Object.defineProperty(n,"__esModule",{value:!0});var o=i(e(47)),s=i(e(49)),l=i(e(45)),d=i(e(108)),c=e(242);a.__dashjs_factory_name="Settings";var u=o.default.getSingletonFactory(a);n.default=u,t.exports=n.default},{108:108,242:242,45:45,47:47,49:49}],49:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,null,[{key:"mixin",value:function(e,t,n){var i=void 0,a={};if(e)for(var o in t)t.hasOwnProperty(o)&&(i=t[o],o in e&&(e[o]===i||o in a&&a[o]===i)||("object"==typeof e[o]&&null!==e[o]?e[o]=r.mixin(e[o],i,n):e[o]=n(i)));return e}},{key:"clone",value:function(e){if(!e||"object"!=typeof e)return e;var t=void 0;if(e instanceof Array){t=[];for(var n=0,i=e.length;n<i;++n)n in e&&t.push(r.clone(e[n]))}else t={};return r.mixin(t,e,r.clone)}},{key:"addAditionalQueryParameterToUrl",value:function(e,t){try{var n=function(){if(!t||0===t.length)return{v:e};var n=new URL(e);return t.forEach((function(e){e.key&&e.value&&n.searchParams.set(e.key,e.value)})),{v:n.href}}();if("object"==typeof n)return n.v}catch(t){return e}}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}}]),r);n.default=a,t.exports=n.default},{}],50:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.getVersionString=function(){return i};var i="3.1.3"},{}],51:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).call(this),this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,this.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,this.SEGMENTS_UPDATE_FAILED_ERROR_CODE=13,this.SEGMENTS_UNAVAILABLE_ERROR_CODE=14,this.SEGMENT_BASE_LOADER_ERROR_CODE=15,this.TIME_SYNC_FAILED_ERROR_CODE=16,this.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,this.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,this.APPEND_ERROR_CODE=20,this.REMOVE_ERROR_CODE=21,this.DATA_UPDATE_FAILED_ERROR_CODE=22,this.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,this.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,this.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,this.DOWNLOAD_ERROR_ID_SIDX_CODE=26,this.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,this.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,this.DOWNLOAD_ERROR_ID_XLINK_CODE=29,this.MANIFEST_ERROR_ID_CODEC_CODE=30,this.MANIFEST_ERROR_ID_PARSE_CODE=31,this.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,this.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,this.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,this.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,this.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",this.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",this.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",this.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",this.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",this.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segments",this.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize time",this.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",this.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",this.APPEND_ERROR_MESSAGE="chunk is not defined",this.REMOVE_ERROR_MESSAGE="buffer is not defined",this.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",this.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",this.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",this.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",this.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : "}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=new(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,((r=e(52))&&r.__esModule?r:{default:r}).default),i);n.default=o,t.exports=n.default},{52:52}],52:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,i=!!t&&t.publicOnly;for(var r in e)!e.hasOwnProperty(r)||this[r]&&!n||i&&-1===e[r].indexOf("public_")||(this[r]=e[r])}}}]),r);n.default=a,t.exports=n.default},{}],53:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).call(this),this.BUFFERING_COMPLETED="bufferingCompleted",this.BUFFER_CLEARED="bufferCleared",this.BUFFER_LEVEL_UPDATED="bufferLevelUpdated",this.BYTES_APPENDED="bytesAppended",this.BYTES_APPENDED_END_FRAGMENT="bytesAppendedEndFragment",this.CHECK_FOR_EXISTENCE_COMPLETED="checkForExistenceCompleted",this.CURRENT_TRACK_CHANGED="currentTrackChanged",this.DATA_UPDATE_COMPLETED="dataUpdateCompleted",this.DATA_UPDATE_STARTED="dataUpdateStarted",this.INBAND_EVENTS="inbandEvents",this.INITIALIZATION_LOADED="initializationLoaded",this.INIT_FRAGMENT_LOADED="initFragmentLoaded",this.INIT_FRAGMENT_NEEDED="initFragmentNeeded",this.INTERNAL_MANIFEST_LOADED="internalManifestLoaded",this.ORIGINAL_MANIFEST_LOADED="originalManifestLoaded",this.LIVE_EDGE_SEARCH_COMPLETED="liveEdgeSearchCompleted",this.LOADING_COMPLETED="loadingCompleted",this.LOADING_PROGRESS="loadingProgress",this.LOADING_DATA_PROGRESS="loadingDataProgress",this.LOADING_ABANDONED="loadingAborted",this.MANIFEST_UPDATED="manifestUpdated",this.MEDIA_FRAGMENT_LOADED="mediaFragmentLoaded",this.MEDIA_FRAGMENT_NEEDED="mediaFragmentNeeded",this.QUOTA_EXCEEDED="quotaExceeded",this.REPRESENTATION_UPDATE_STARTED="representationUpdateStarted",this.REPRESENTATION_UPDATE_COMPLETED="representationUpdateCompleted",this.SEGMENTS_LOADED="segmentsLoaded",this.SERVICE_LOCATION_BLACKLIST_ADD="serviceLocationBlacklistAdd",this.SERVICE_LOCATION_BLACKLIST_CHANGED="serviceLocationBlacklistChanged",this.SOURCEBUFFER_REMOVE_COMPLETED="sourceBufferRemoveCompleted",this.STREAMS_COMPOSED="streamsComposed",this.STREAM_BUFFERING_COMPLETED="streamBufferingCompleted",this.STREAM_COMPLETED="streamCompleted",this.TEXT_TRACKS_QUEUE_INITIALIZED="textTracksQueueInitialized",this.TIME_SYNCHRONIZATION_COMPLETED="timeSynchronizationComplete",this.URL_RESOLUTION_FAILED="urlResolutionFailed",this.VIDEO_CHUNK_RECEIVED="videoChunkReceived",this.WALLCLOCK_TIME_UPDATED="wallclockTimeUpdated",this.XLINK_ELEMENT_LOADED="xlinkElementLoaded",this.XLINK_READY="xlinkReady",this.SEGMENTBASE_INIT_REQUEST_NEEDED="segmentBaseInitRequestNeeded",this.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED="segmentBaseSegmentsListRequestNeeded",this.SEEK_TARGET="seekTarget",this.DYNAMIC_STREAM_COMPLETED="dynamicStreamCompleted"}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,((r=e(55))&&r.__esModule?r:{default:r}).default),i);n.default=o,t.exports=n.default},{55:55}],54:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).apply(this,arguments)}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=new(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,((r=e(53))&&r.__esModule?r:{default:r}).default),i);n.default=o,t.exports=n.default},{53:53}],55:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"extend",value:function(e,t){if(e){var n=!!t&&t.override,i=!!t&&t.publicOnly;for(var r in e)!e.hasOwnProperty(r)||this[r]&&!n||i&&-1===e[r].indexOf("public_")||(this[r]=e[r])}}}]),r);n.default=a,t.exports=n.default},{}],56:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e,n,i){var r,o=w.getAdaptationsForType(T[0].mpd.manifest,e,n);if(!o||0===o.length)return null;if(1<o.length&&i){var s=t(i,n);if(C[i.id]&&C[i.id][n])for(var l=0,d=o.length;l<d;l++)if(C[i.id][n].isMediaInfoEqual(s[l]))return o[l];for(l=0,d=o.length;l<d;l++)if(r=o[l],w.getRolesForAdaptation(r).filter((function(e){return e.value===a.default.MAIN}))[0])return o[l]}return o[0]}function t(e,t,i){var r,a=T,o=i,s=[],l=void 0,d=void 0,c=void 0,u=void 0,f=void 0,h=void 0;if(o)y(),a=n(o);else{if(!(0<T.length))return s;o=T[0].mpd.manifest}var v=p(e,a);v&&(h=v.id);var _=w.getAdaptationsForType(o,e?e.index:null,t!==k.EMBEDDED_TEXT?t:k.VIDEO);if(!_||0===_.length)return s;for(S[h]=S[h]||w.getAdaptationsForPeriod(v),u=0,r=_.length;u<r;u++)if(l=_[u],c=w.getIndexForAdaptation(l,o,e.index),d=g(S[h][c]),t===k.EMBEDDED_TEXT){var b=d.accessibility.length;for(f=0;f<b;f++)if(d){var E=d.accessibility[f];if(0===E.indexOf("cea-608:")){var C=E.substring(8).split(";");if("CC"===C[0].substring(0,2))for(f=0;f<C.length;f++)m(d=d||g.call(this,S[h][c]),C[f].substring(0,3),C[f].substring(4)),s.push(d),d=null;else for(f=0;f<C.length;f++)m(d=d||g.call(this,S[h][c]),"CC"+(f+1),C[f]),s.push(d),d=null}else 0===E.indexOf("cea-608")&&(m(d,k.CC1,"eng"),s.push(d),d=null)}}else t===k.IMAGE?(d.type=k.IMAGE,s.push(d),d=null):d&&s.push(d);return s}function n(e){var t=i(e);return w.getRegularPeriods(t)}function i(e){var t=u(e);return w.getMpd(t)}function r(){T=[],S={},C={}}function u(e){return e||(0<T.length?T[0].mpd.manifest:null)}function h(e){return e&&e.streamInfo&&void 0!==e.streamInfo.id&&S[e.streamInfo.id]?S[e.streamInfo.id][e.index]:null}function p(e,t){for(var n=t.length,i=0;i<n;i++){var r=t[i];if(e&&e.id===r.id)return r}return null}function g(e){if(!e)return null;var t,n=new s.default,i=e.period.mpd.manifest.Period_asArray[e.period.index].AdaptationSet_asArray[e.index];return n.id=e.id,n.index=e.index,n.type=e.type,n.streamInfo=v(e.period),n.representationCount=w.getRepresentationCount(i),n.labels=w.getLabelsForAdaptation(i),n.lang=w.getLanguageForAdaptation(i),t=w.getViewpointForAdaptation(i),n.viewpoint=t?t.value:void 0,n.accessibility=w.getAccessibilityForAdaptation(i).map((function(e){var t=e.value,i=t;return e.schemeIdUri&&0<=e.schemeIdUri.search("cea-608")&&void 0!==I&&(i=t?"cea-608:"+t:"cea-608",n.embeddedCaptions=!0),i})),n.audioChannelConfiguration=w.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),0===n.audioChannelConfiguration.length&&Array.isArray(i.Representation_asArray)&&0<i.Representation_asArray.length&&(n.audioChannelConfiguration=w.getAudioChannelConfigurationForRepresentation(i.Representation_asArray[0]).map((function(e){return e.value}))),n.roles=w.getRolesForAdaptation(i).map((function(e){return e.value})),n.codec=w.getCodec(i),n.mimeType=w.getMimeType(i),n.contentProtection=w.getContentProtectionData(i),n.bitrateList=w.getBitrateListForAdaptation(i),n.contentProtection&&n.contentProtection.forEach((function(e){e.KID=w.getKID(e)})),n.isText=w.getIsTextTrack(n.mimeType),n.supplementalProperties=w.getSupplementalPropperties(i),n}function m(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=k.EMBEDDED_TEXT,e.codec="cea-608-in-SEI",e.isText=!0,e.isEmbedded=!0,e.lang=n,e.roles=["caption"]}function v(e){var t,n,i=new l.default;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(t=e.mpd,(n=new d.default).DVRWindowSize=t.timeShiftBufferDepth,n.loadedTime=t.manifest.loadedTime,n.availableFrom=t.availabilityStartTime,n.minBufferTime=t.manifest.minBufferTime,n.maxFragmentDuration=t.maxSegmentDuration,n.duration=w.getDuration(t.manifest),n.isDynamic=w.getIsDynamic(t.manifest),n.serviceDescriptions=w.getServiceDescriptions(t.manifest),n.protocol=t.manifest.protocol,n),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function y(){if(!k)throw new Error("setConfig function has to be called previously")}function _(e){return 0<T.length?T[0].mpd.manifest.Period_asArray[e]:null}function b(e,t,n){var i=void 0,r=void 0,a=void 0,o=void 0,s=void 0;if(e)for(i=e.AdaptationSet_asArray,o=0;o<i.length;o+=1)for(a=i[o].Representation_asArray,s=0;s<a.length;s+=1)if(t===(r=a[s]).id)return n?s:r;return null}var E,w=void 0,T=void 0,S=void 0,C=void 0,k=void 0,I=void 0,A=this.context;return E={getBandwidthForRepresentation:function(e,t){var n;return(n=b(_(t),e))?n.bandwidth:null},getIndexForRepresentation:function(e,t){var n;return null!==(n=b(_(t),e,!0))?n:-1},getMaxIndexForBufferType:function(e,t){return function(e,t){var n,i=void 0,r=void 0,a=void 0;if(!e||!t)return-1;for(n=e.AdaptationSet_asArray,a=0;a<n.length;a+=1)if(r=(i=n[a]).Representation_asArray,w.getIsTypeOf(i,t))return r.length;return-1}(_(t),e)},convertDataToRepresentationInfo:function(e){if(e){var t=new o.default,n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],i=w.getRepresentationFor(e.index,n);return t.id=e.id,t.quality=e.index,t.bandwidth=w.getBandwidth(i),t.DVRWindow=e.segmentAvailabilityRange,t.fragmentDuration=e.segmentDuration||(e.segments&&0<e.segments.length?e.segments[0].duration:NaN),t.MSETimeOffset=e.MSETimeOffset,t.mediaInfo=g(e.adaptation),t}return null},getDataForMedia:h,getStreamsInfo:function(e,t){var i=[],r=T;if(e&&(y(),r=n(e)),0<r.length){(!t||t>r.length)&&(t=r.length);for(var a=0;a<t;a++)i.push(v(r[a]))}return i},getMediaInfoForType:function(t,n){if(0===T.length||!t)return null;var i=p(t,T);if(!i)return null;var r=i.id;S[r]=S[r]||w.getAdaptationsForPeriod(i);var a=e(t.index,n,t);if(!a)return null;var o=w.getIndexForAdaptation(a,T[0].mpd.manifest,t.index);return g(S[r][o])},getAllMediaInfoForType:t,getAdaptationForType:e,getRealAdaptation:function(e,t){var n=void 0,i=p(e,T),r=t?t.id:null;return 0<T.length&&i&&(n=r?w.getAdaptationForId(r,T[0].mpd.manifest,i.index):w.getAdaptationForIndex(t?t.index:null,T[0].mpd.manifest,i.index)),n},getVoRepresentations:function(e){var t=h(e);return w.getRepresentationsForAdaptation(t)},getEventsFor:function(e,t){var n,i=[];return 0<T.length&&(n=T[0].mpd.manifest,e instanceof l.default?i=w.getEventsForPeriod(p(e,T)):e instanceof s.default?i=w.getEventStreamForAdaptationSet(n,h(e)):e instanceof o.default&&(i=w.getEventStreamForRepresentation(n,t))),i},getEvent:function(e,t,n){if(!e||!t)return null;var i=new c.default,r=e.scheme_id_uri,a=e.value,o=e.timescale,s=void 0,l=void 0,d=(l=0===e.version?n*o+(s=e.presentation_time_delta):(s=0,e.presentation_time_delta),e.event_duration),u=e.id,f=e.message_data;return t[r+"/"+a]?(i.eventStream=t[r+"/"+a],i.eventStream.value=a,i.eventStream.timescale=o,i.duration=d,i.id=u,i.calculatedPresentationTime=l,i.messageData=f,i.presentationTimeDelta=s,i):null},getMpd:i,setConfig:function(e){e&&(e.constants&&(k=e.constants),e.cea608parser&&(I=e.cea608parser),e.errHandler&&w.setConfig({errHandler:e.errHandler}),e.BASE64&&w.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;y(),T=n(e),S={}},getIsTextTrack:function(e){return w.getIsTextTrack(e)},getUTCTimingSources:function(){var e=u();return w.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=0<T.length?T[0].mpd:null;return w.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var t=i(e);return w.getAvailabilityStartTime(t)},getIsDynamic:function(e){var t=u(e);return w.getIsDynamic(t)},getDuration:function(e){var t=u(e);return w.getDuration(t)},getRegularPeriods:n,getLocation:function(e){return w.getLocation(e)},getManifestUpdatePeriod:function(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1];return w.getManifestUpdatePeriod(e,t)},getIsDVB:function(e){return w.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getBaseURLsFromElement:function(e){return w.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return w.getRepresentationSortFunction()},getCodec:function(e,t,n){return w.getCodec(e,t,n)},getVoAdaptations:function(){return S},getVoPeriods:function(){return T},getPeriodById:function(e){if(!e||0===T.length)return null;var t=T.filter((function(t){return t.id===e}));return t&&0<t.length?t[0]:null},setCurrentMediaInfo:function(e,t,n){C[e]=C[e]||{},C[e][t]=C[e][t]||{},C[e][t]=n},reset:r},w=(0,f.default)(A).getInstance(),r(),E}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(61)),o=i(e(93)),s=i(e(89)),l=i(e(95)),d=i(e(88)),c=i(e(86)),u=i(e(47)),f=i(e(65));r.__dashjs_factory_name="DashAdapter",n.default=u.default.getSingletonFactory(r),t.exports=n.default},{47:47,61:61,65:65,86:86,88:88,89:89,93:93,95:95}],57:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){return E}function n(){A=-1,x=null}function i(){n(),N=O=D=null}function r(e,t,n){var i=C.resolve(n.path),r=void 0,a=void 0;return i&&t!==i.url&&b.isRelative(t)?(r=i.url,a=i.serviceLocation,t&&(r=b.resolve(t,r))):r=t,!b.isRelative(r)&&(e.url=r,e.serviceLocation=a,1)}function s(e){var t,n,i;e.sender.getType()===E&&(n=(t=e.representation).hasInitialization(),i=t.hasSegments(),n&&i?m.trigger(v.REPRESENTATION_UPDATE_COMPLETED,{sender:k,representation:t}):O.update(t,E,N,n,i))}function c(e,t){if(null==t)return null
;var n=new a.default,i=t.representation,s=i.adaptation.period.mpd.manifest.Period_asArray[i.adaptation.period.index].AdaptationSet_asArray[i.adaptation.index].Representation_asArray[i.index].bandwidth,d=t.media;d=(0,l.replaceTokenForTemplate)(d,"Number",t.replacementNumber);return d=(0,l.replaceTokenForTemplate)(d,"Time",t.replacementTime),d=(0,l.replaceTokenForTemplate)(d,"Bandwidth",s),d=(0,l.replaceIDForTemplate)(d,i.id),d=(0,l.unescapeDollarsInTemplate)(d),n.mediaType=E,n.type=o.HTTPRequest.MEDIA_SEGMENT_TYPE,n.range=t.mediaRange,n.startTime=t.presentationStartTime,n.duration=t.duration,n.timescale=i.timescale,n.availabilityStartTime=t.availabilityStartTime,n.availabilityEndTime=t.availabilityEndTime,n.wallStartTime=t.wallStartTime,n.quality=i.index,n.index=t.availabilityIdx,n.mediaInfo=e,n.adaptationIndex=i.adaptation.index,n.representationId=i.id,r(n,d,i)?n:void 0}function u(e){var t,n,i=!1;return e&&(R?M?i=!0:x&&(t=parseFloat((x.presentationStartTime-e.adaptation.period.start).toFixed(5)),n=0<x.duration?t+1.5*x.duration:t,i=e.adaptation.period.duration<=n):A>=e.availableSegmentsNumber&&(i=!0)),i}function f(e){var t=e.representation;t.segments&&m.trigger(v.REPRESENTATION_UPDATE_COMPLETED,{sender:this,representation:t})}function h(e){if(!e.error&&E===e.mediaType){for(var t,n=e.segments,i=e.representation,r=[],a=0,o=void 0,s=void 0,d=void 0,c=(o=0,n?n.length:0);o<c;o++)s=n[o],(d=(0,l.getTimeBasedSegment)(T,R,i,s.startTime,s.duration,s.timescale,s.media,s.mediaRange,a))&&(r.push(d),d=null,a++);0<r.length&&(i.segmentAvailabilityRange={start:r[0].presentationStartTime,end:r[r.length-1].presentationStartTime},i.availableSegmentsNumber=r.length,i.segments=r,R&&(t=r[r.length-1].presentationStartTime-8,T.setExpectedLiveEdge(t),S.updateManifestUpdateInfo({presentationStartTime:t}))),i.hasInitialization()&&m.trigger(v.REPRESENTATION_UPDATE_COMPLETED,{sender:this,representation:i})}}function p(){I.debug("Dynamic stream complete"),M=!0}e=e||{};var g=this.context,m=e.eventBus,v=e.events,y=e.debug,_=e.dashConstants,b=e.urlUtils,E=e.type,w=e.streamInfo,T=e.timelineConverter,S=e.dashMetrics,C=e.baseURLController,k=void 0,I=void 0,A=void 0,x=void 0,D=void 0,R=void 0,M=void 0,N=void 0,O=void 0;return k={initialize:function(e){R=e,M=!1,O.initialize(e)},getType:t,getStreamInfo:function(){return w},getInitRequest:function(e,t){return t?function(e,t,n){var i=new a.default,s=t.adaptation.period,d=s.start;if(i.mediaType=n,i.type=o.HTTPRequest.INIT_SEGMENT_TYPE,i.range=t.range,i.availabilityStartTime=T.calcAvailabilityStartTimeFromPresentationTime(d,s.mpd,R),i.availabilityEndTime=T.calcAvailabilityEndTimeFromPresentationTime(d+s.duration,s.mpd,R),i.quality=t.index,i.mediaInfo=e,i.representationId=t.id,r(i,t.initialization,t))return i.url=(0,l.replaceTokenForTemplate)(i.url,"Bandwidth",t.bandwidth),i}(e,t,E):null},getRequestForSegment:c,getSegmentRequestForTime:function(e,t,n,i){var r=null;if(!t||!t.segmentInfoType)return r;var o=A,s=!!i&&i.keepIdx,l=!(!i||!i.ignoreIsFinished);D!==n&&(D=n,I.debug("Getting the request for time : "+n));var d=O.getSegmentByTime(t,n);return d?(A=d.availabilityIdx,x=d,I.debug("Index for time "+n+" is "+A),r=c(e,d)):!l&&u(t)&&((r=new a.default).action=a.default.ACTION_COMPLETE,r.index=A-1,r.mediaType=E,r.mediaInfo=e,I.debug("Signal complete in getSegmentRequestForTime")),s&&0<=o&&(A=t.segmentInfoType===_.SEGMENT_TIMELINE&&R?A:o),r},getNextSegmentRequest:function(e,t){var n=null;if(!t||!t.segmentInfoType)return null;D=null;var i=A+1;I.debug("Getting the next request at index: "+i);var r=O.getSegmentByIndex(t,i,x?x.mediaStartTime:-1);return r||isFinite(t.adaptation.period.duration)||M?(A=r?(n=c(e,r),r.availabilityIdx):R?i-1:i,r?x=r:u(t)&&((n=new a.default).action=a.default.ACTION_COMPLETE,n.index=A-1,n.mediaType=E,n.mediaInfo=e,I.debug("Signal complete")),n):(I.debug(E+" No segment found at index: "+i+". Wait for next loop"),null)},setCurrentIndex:function(e){A=e},getCurrentIndex:function(){return A},isMediaFinished:u,reset:function(){i(),m.off(v.INITIALIZATION_LOADED,f,k),m.off(v.SEGMENTS_LOADED,h,k),m.off(v.REPRESENTATION_UPDATE_STARTED,s,k),m.off(v.DYNAMIC_STREAM_COMPLETED,p,k)},resetIndex:n,setMimeType:function(e){N=e}},I=y.getLogger(k),i(),O=(0,d.default)(g).create(e),m.on(v.INITIALIZATION_LOADED,f,k),m.on(v.SEGMENTS_LOADED,h,k),m.on(v.REPRESENTATION_UPDATE_STARTED,s,k),m.on(v.DYNAMIC_STREAM_COMPLETED,p,k),k}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(228)),o=e(242),s=i(e(47)),l=e(80),d=i(e(64));r.__dashjs_factory_name="DashHandler",n.default=s.default.getClassFactory(r),t.exports=n.default},{228:228,242:242,47:47,64:64,80:80}],58:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){var t=m.getMetricsFor(e,!0);if(!t)return null;var n=t.HttpList,i=null,r=void 0;if(!n||n.length<=0)return null;for(r=n.length-1;0<=r;){if(n[r].responsecode){i=n[r];break}r--}return i}function n(e){var t=m.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function i(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}function r(e){var t={};if(!e)return t;for(var n=e.trim().split("\r\n"),i=0,r=n.length;i<r;i++){var a=n[i],o=a.indexOf(": ");0<o&&(t[a.substring(0,o)]=a.substring(o+2))}return t}e=e||{};var s,f=this.context,h=void 0,p=void 0,g=void 0,m=e.metricsModel;return s={getCurrentRepresentationSwitch:function(e){return i(m.getMetricsFor(e,!0),l.default.TRACK_SWITCH)},getCurrentBufferState:function(e){return i(m.getMetricsFor(e,!0),l.default.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=i(m.getMetricsFor(e,!0),l.default.BUFFER_LEVEL);return t?d.default.round10(t.level/1e3,-3):0},getCurrentHttpRequest:t,getHttpRequests:n,getCurrentDroppedFrames:function(){return i(m.getMetricsFor(a.default.VIDEO,!0),l.default.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return i(m.getMetricsFor(e,!0),l.default.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return i(e?m.getMetricsFor(e,!0):m.getMetricsFor(a.default.VIDEO,!0)||m.getMetricsFor(a.default.AUDIO,!0),l.default.DVR_INFO)},getCurrentManifestUpdate:function(){return i(m.getMetricsFor(a.default.STREAM),l.default.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,n){var i={},a=t(e);return a&&(i=r(a._responseHeaders)),void 0===i[n]?null:i[n]},getLatestMPDRequestHeaderValueByID:function(e){var t,i={},s=void 0,l=void 0;for(l=(t=n(a.default.STREAM)).length-1;0<=l;l--)if((s=t[l]).type===o.HTTPRequest.MPD_TYPE){i=r(s._responseHeaders);break}return void 0===i[e]?null:i[e]},addRepresentationSwitch:function(e,t,n,i,r){m.addRepresentationSwitch(e,t,n,i,r)},addDVRInfo:function(e,t,n,i){m.addDVRInfo(e,t,n,i)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();m.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){var t;e&&(t=this.getCurrentManifestUpdate(),m.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration))},addManifestUpdateRepresentationInfo:function(e,t){var n;e&&(n=this.getCurrentManifestUpdate(),m.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType))},addManifestUpdate:function(e){m.addManifestUpdate(a.default.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,i,r){m.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,i,r)},addSchedulingInfo:function(e,t){m.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){m.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){m.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){m.addBufferState(e,t,n)},addDroppedFrames:function(e){m.addDroppedFrames(a.default.VIDEO,e)},addPlayList:function(){g&&(m.addPlayList(g),g=null)},addDVBErrors:function(e){m.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(g=new u.PlayList).start=new Date,g.mstart=e,g.starttype=t},createPlaylistTraceMetrics:function(e,t,n){!0===h&&(h=!1,(p=new u.PlayListTrace).representationid=e,p.start=new Date,p.mstart=t,p.playbackspeed=null!==n?n.toString():null)},updatePlayListTraceMetrics:function(e){if(p)for(var t in p)p[t]=e[t]},pushPlayListTraceMetrics:function(e,t){var n,i;!1===h&&g&&p&&p.start&&(n=p.start,i=e.getTime()-n.getTime(),p.duration=i,p.stopreason=t,g.trace.push(p),h=!0)},clearAllCurrentMetrics:function(){m.clearAllCurrentMetrics()}},m=m||(0,c.default)(f).getInstance({settings:e.settings}),h=!0,g=p=null,s}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=e(242),s=i(e(47)),l=i(e(109)),d=i(e(78)),c=i(e(153)),u=e(244);r.__dashjs_factory_name="DashMetrics",n.default=s.default.getSingletonFactory(r),t.exports=n.default},{108:108,109:109,153:153,242:242,244:244,47:47,78:78}],59:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){if(!T||!T.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function t(e){if(e.url){var t=new l.default;return t.setInfo(e),t}}function n(e,t,n){e?y.trigger(v.SEGMENTS_LOADED,{segments:e,representation:t,mediaType:n}):y.trigger(v.SEGMENTS_LOADED,{segments:null,representation:t,mediaType:n,error:new o.default(_.SEGMENT_BASE_LOADER_ERROR_CODE,_.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}var i=this.context,r=void 0,s=void 0,c=void 0,u=void 0,f=void 0,h=void 0,p=void 0,g=void 0,m=void 0,v=void 0,y=void 0,_=void 0,b=void 0,E=void 0,w=void 0,T=void 0;return r={setConfig:function(e){e.baseURLController&&(T=e.baseURLController),e.dashMetrics&&(h=e.dashMetrics),e.mediaPlayerModel&&(g=e.mediaPlayerModel),e.errHandler&&(c=e.errHandler),e.settings&&(p=e.settings),e.boxParser&&(u=e.boxParser),e.events&&(v=e.events),e.eventBus&&(y=e.eventBus),e.debug&&(s=e.debug.getLogger(r)),e.requestModifier&&(f=e.requestModifier),e.errors&&(_=e.errors),e.urlUtils&&(w=e.urlUtils),e.constants&&(b=e.constants),e.dashConstants&&(E=e.dashConstants)},initialize:function(){m=(0,d.default)(i).create({errHandler:c,dashMetrics:h,mediaPlayerModel:g,requestModifier:f,useFetch:p?p.get().streaming.lowLatencyEnabled:null,boxParser:u,errors:_,urlUtils:w,constants:b,dashConstants:E})},loadInitialization:function n(i,r){e();var a=null,o=i?T.resolve(i.path):null,l=r||{init:!0,url:o?o.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:i&&i.adaptation?i.adaptation.type:null};s.debug("Start searching for initialization.");var d=t(l);m.load({request:d,success:function(e){l.bytesLoaded=l.range.end,(a=u.findInitRange(e))?(i.range=a,y.trigger(v.INITIALIZATION_LOADED,{representation:i})):(l.range.end=l.bytesLoaded+l.bytesToLoad,n(i,l))},error:function(){y.trigger(v.INITIALIZATION_LOADED,{representation:i})}}),s.debug("Perform init search: "+l.url)},loadSegments:function i(r,o,l,d,c){var f;e(),!l||void 0!==l.start&&void 0!==l.end||(l=(f=l?l.toString().split("-"):null)?{start:parseFloat(f[0]),end:parseFloat(f[1])}:null),d=d||n;var h=null,p=null,g=!!l,v=r?T.resolve(r.path):null,y={init:!1,url:v?v.url:void 0,range:g?l:{start:0,end:1500},searching:!g,bytesLoaded:c?c.bytesLoaded:0,bytesToLoad:1500,mediaType:r&&r.adaptation?r.adaptation.type:null},_=t(y);m.load({request:_,success:function(e){var t=y.bytesToLoad,n=e.byteLength;if(y.bytesLoaded=y.range.end-y.range.start,h=u.parse(e),(p=h.getBox("sidx"))&&p.isComplete){var l=p.references,c=void 0,f=void 0;null!=l&&0<l.length&&(c=1===l[0].reference_type),c?function(){s.debug("Initiate multiple SIDX load."),y.range.end=y.range.start+p.size;var e=void 0,t=void 0,n=void 0,a=void 0,c=[],u=0,f=(p.offset||y.range.start)+p.size,h=function(e){e?(c=c.concat(e),t<=++u&&(c.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),d(c,r,o))):d(null,r,o)};for(e=0,t=l.length;e<t;e++)a=(n=f)+l[e].referenced_size-1,f+=l[e].referenced_size,i(r,null,{start:n,end:a},h,y)}():(s.debug("Parsing segments from SIDX. representation "+r.adaptation.type+" - id: "+r.id+" for range : "+y.range.start+" - "+y.range.end),f=function(e,t){for(var n=e.references,i=n.length,r=e.timescale,o=e.earliest_presentation_time,s=t.range.start+e.offset+e.first_offset+e.size,l=[],d=void 0,c=void 0,u=void 0,f=void 0,h=0;h<i;h++)u=n[h].subsegment_duration,f=n[h].referenced_size,(d=new a.default).duration=u,d.startTime=o,d.timescale=r,c=s+f-1,d.mediaRange=s+"-"+c,l.push(d),o+=u,s+=f;return l}(p,y),d(f,r,o))}else{if(p)y.range.start=p.offset||y.range.start,y.range.end=y.range.start+(p.size||t);else{if(n<y.bytesLoaded)return void d(null,r,o);var g=h.getLastBox();g&&g.size?(y.range.start=g.offset+g.size,y.range.end=y.range.start+t):y.range.end+=t}i(r,o,y.range,d,y)}},error:function(){d(null,r,o)}}),s.debug("Perform SIDX load: "+y.url+" with range : "+y.range.start+" - "+y.range.end)},reset:function(){m.abort(),f=u=c=m=null}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(94)),o=i(e(226)),s=i(e(47)),l=i(e(228)),d=i(e(159));r.__dashjs_factory_name="SegmentBaseLoader",n.default=s.default.getSingletonFactory(r),t.exports=n.default},{159:159,226:226,228:228,47:47,94:94}],60:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e,t,n,i){for(var o,s=void 0,d=void 0,c=void 0,u=void 0,p=void 0,g=void 0,m=(d=[],u=0,(o=function(e){var t=[],n=(0,a.default)(r).create({data:e}),i=void 0,o=void 0;for(n.consumeTagAndSize(h.Segment.Cues);n.moreData()&&n.consumeTagAndSize(h.Segment.Cues.CuePoint,!0);){for((i={}).CueTime=n.parseTag(h.Segment.Cues.CuePoint.CueTime),i.CueTracks=[];n.moreData()&&n.consumeTag(h.Segment.Cues.CuePoint.CueTrackPositions,!0);){var s=n.getMatroskaCodedNum(),l=n.getPos();if((o={}).Track=n.parseTag(h.Segment.Cues.CuePoint.CueTrackPositions.CueTrack),0===o.Track)throw new Error("Cue track cannot be 0");o.ClusterPosition=n.parseTag(h.Segment.Cues.CuePoint.CueTrackPositions.CueClusterPosition),i.CueTracks.push(o),n.setPos(l+s)}if(0===i.CueTracks.length)throw new Error("Mandatory cuetrack not found");t.push(i)}if(0===t.length)throw new Error("mandatory cuepoint not found");return t}(e)).length);u<m;u+=1)c=new l.default,s=0,s=u<o.length-1?o[u+1].CueTime-o[u].CueTime:i-o[u].CueTime,c.duration=s,c.startTime=o[u].CueTime,c.timescale=1e3,p=o[u].CueTracks[0].ClusterPosition+t,g=u<o.length-1?o[u+1].CueTracks[0].ClusterPosition+t-1:n-1,c.mediaRange=p+"-"+g,d.push(c);return f.debug("Parsed cues: "+d.length+" cues."),d}function t(){if(!T||!T.hasOwnProperty("resolve"))throw new Error("setConfig function has to be called previously")}function n(e,t,n){e?b.trigger(E.SEGMENTS_LOADED,{segments:e,representation:t,mediaType:n}):b.trigger(E.SEGMENTS_LOADED,{segments:null,representation:t,mediaType:n,error:new u.default(w.SEGMENT_BASE_LOADER_ERROR_CODE,w.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function i(e){var t=new d.default;return t.setInfo(e),t}var r=this.context,s=void 0,f=void 0,h=void 0,p=void 0,g=void 0,m=void 0,v=void 0,y=void 0,_=void 0,b=void 0,E=void 0,w=void 0,T=void 0;return s={setConfig:function(e){if(!(e.baseURLController&&e.dashMetrics&&e.mediaPlayerModel&&e.errHandler))throw new Error(o.default.MISSING_CONFIG_ERROR);T=e.baseURLController,m=e.dashMetrics,v=e.mediaPlayerModel,p=e.errHandler,_=e.settings,E=e.events,b=e.eventBus,w=e.errors,f=e.debug.getLogger(s),g=e.requestModifier},initialize:function(){y=(0,c.default)(r).create({errHandler:p,dashMetrics:m,mediaPlayerModel:v,requestModifier:g,useFetch:_?_.get().streaming.lowLatencyEnabled:null,errors:w})},loadInitialization:function(e,n){t();var r=null,a=e?T.resolve(e.path):null,o=e?e.range.split("-"):null,s=n||{range:{start:o?parseFloat(o[0]):null,end:o?parseFloat(o[1]):null},request:r,url:a?a.url:void 0,init:!0,mediaType:e&&e.adaptation?e.adaptation.type:null};f.info("Start loading initialization."),r=i(s),y.load({request:r,success:function(){b.trigger(E.INITIALIZATION_LOADED,{representation:e})},error:function(){b.trigger(E.INITIALIZATION_LOADED,{representation:e})}}),f.debug("Perform init load: "+s.url)},loadSegments:function(o,s,l,d){t();var c=null,u=o?T.resolve(o.path):null,p=u?u.url:void 0,g={bytesLoaded:0,bytesToLoad:8192,range:{start:0,end:8192},request:c,url:p,init:!1,mediaType:o&&o.adaptation?o.adaptation.type:null};d=d||n,c=i(g),f.debug("Parsing ebml header"),y.load({request:c,success:function(t){!function(t,n,o,s){if(t&&0!==t.byteLength){var l,d,c=(0,a.default)(r).create({data:t}),u=void 0,p=void 0,g=o?o.split("-"):null,m=null,v={url:n,range:{start:g?parseFloat(g[0]):null,end:g?parseFloat(g[1]):null},request:m};for(f.debug("Parse EBML header: "+v.url),c.skipOverElement(h.EBML),c.consumeTag(h.Segment),l=c.getMatroskaCodedNum(),l+=c.getPos(),d=c.getPos();c.moreData()&&!c.consumeTagAndSize(h.Segment.Info,!0);)if(!(c.skipOverElement(h.Segment.SeekHead,!0)||c.skipOverElement(h.Segment.Tracks,!0)||c.skipOverElement(h.Segment.Cues,!0)||c.skipOverElement(h.Void,!0)))throw new Error("no valid top level element found");for(;void 0===u;){var _=c.getMatroskaCodedNum(!0),b=c.getMatroskaCodedNum();switch(_){case h.Segment.Info.Duration.tag:u=c[h.Segment.Info.Duration.parse](b);break;default:c.setPos(c.getPos()+b)}}m=i(v),y.load({request:m,success:function(t){p=e(t,d,l,u),s(p)},error:function(){f.error("Download Error: Cues "+v.url),s(null)}}),f.debug("Perform cues load: "+v.url+" bytes="+v.range.start+"-"+v.range.end)}else s(null)}(t,p,l,(function(e){d(e,o,s)}))},error:function(){d(null,o,s)}})},reset:function(){g=p=null}},h={EBML:{tag:440786851,required:!0},Segment:{tag:408125543,required:!0,SeekHead:{tag:290298740,required:!0},Info:{tag:357149030,required:!0,TimecodeScale:{tag:2807729,required:!0,parse:"getMatroskaUint"},Duration:{tag:17545,required:!0,parse:"getMatroskaFloat"}},Tracks:{tag:374648427,required:!0},Cues:{tag:475249515,required:!0,CuePoint:{tag:187,required:!0,CueTime:{tag:179,required:!0,parse:"getMatroskaUint"},CueTrackPositions:{tag:183,required:!0,CueTrack:{tag:247,required:!0,parse:"getMatroskaUint"},CueClusterPosition:{tag:241,required:!0,parse:"getMatroskaUint"}}}}},Void:{tag:236,required:!0}},s}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(212)),o=i(e(108)),s=i(e(47)),l=i(e(94)),d=i(e(228)),c=i(e(159)),u=i(e(226));r.__dashjs_factory_name="WebmSegmentBaseLoader",n.default=s.default.getSingletonFactory(r),t.exports=n.default},{108:108,159:159,212:212,226:226,228:228,47:47,94:94}],61:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.init()}Object.defineProperty(n,"__esModule",{value:!0});var a=new(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"init",value:function(){this.BASE_URL="BaseURL",this.SEGMENT_BASE="SegmentBase",this.SEGMENT_TEMPLATE="SegmentTemplate",this.SEGMENT_LIST="SegmentList",this.SEGMENT_URL="SegmentURL",this.SEGMENT_TIMELINE="SegmentTimeline",this.SEGMENT_PROFILES="segmentProfiles",this.ADAPTATION_SET="AdaptationSet",this.REPRESENTATION="Representation",this.REPRESENTATION_INDEX="RepresentationIndex",this.SUB_REPRESENTATION="SubRepresentation",this.INITIALIZATION="Initialization",this.INITIALIZATION_MINUS="initialization",this.MPD="MPD",this.PERIOD="Period",this.ASSET_IDENTIFIER="AssetIdentifier",this.EVENT_STREAM="EventStream",this.ID="id",this.PROFILES="profiles",this.SERVICE_LOCATION="serviceLocation",this.RANGE="range",this.INDEX="index",this.MEDIA="media",this.BYTE_RANGE="byteRange",this.INDEX_RANGE="indexRange",this.MEDIA_RANGE="mediaRange",this.VALUE="value",this.CONTENT_TYPE="contentType",this.MIME_TYPE="mimeType",this.BITSTREAM_SWITCHING="BitstreamSwitching",this.BITSTREAM_SWITCHING_MINUS="bitstreamSwitching",this.CODECS="codecs",this.DEPENDENCY_ID="dependencyId",this.MEDIA_STREAM_STRUCTURE_ID="mediaStreamStructureId",this.METRICS="Metrics",this.METRICS_MINUS="metrics",this.REPORTING="Reporting",this.WIDTH="width",this.HEIGHT="height",this.SAR="sar",this.FRAMERATE="frameRate",this.AUDIO_SAMPLING_RATE="audioSamplingRate",this.MAXIMUM_SAP_PERIOD="maximumSAPPeriod",this.START_WITH_SAP="startWithSAP",this.MAX_PLAYOUT_RATE="maxPlayoutRate",this.CODING_DEPENDENCY="codingDependency",this.SCAN_TYPE="scanType",this.FRAME_PACKING="FramePacking",this.AUDIO_CHANNEL_CONFIGURATION="AudioChannelConfiguration",this.CONTENT_PROTECTION="ContentProtection",this.ESSENTIAL_PROPERTY="EssentialProperty",this.SUPPLEMENTAL_PROPERTY="SupplementalProperty",this.INBAND_EVENT_STREAM="InbandEventStream",this.ACCESSIBILITY="Accessibility",this.ROLE="Role",this.RATING="Rating",this.CONTENT_COMPONENT="ContentComponent",this.SUBSET="Subset",this.LANG="lang",this.VIEWPOINT="Viewpoint",this.ROLE_ASARRAY="Role_asArray",this.ACCESSIBILITY_ASARRAY="Accessibility_asArray",this.AUDIOCHANNELCONFIGURATION_ASARRAY="AudioChannelConfiguration_asArray",this.CONTENTPROTECTION_ASARRAY="ContentProtection_asArray",this.MAIN="main",this.DYNAMIC="dynamic",this.STATIC="static",this.MEDIA_PRESENTATION_DURATION="mediaPresentationDuration",this.MINIMUM_UPDATE_PERIOD="minimumUpdatePeriod",this.CODEC_PRIVATE_DATA="codecPrivateData",this.BANDWITH="bandwidth",this.SOURCE_URL="sourceURL",this.TIMESCALE="timescale",this.DURATION="duration",this.START_NUMBER="startNumber",this.PRESENTATION_TIME_OFFSET="presentationTimeOffset",this.AVAILABILITY_START_TIME="availabilityStartTime",this.AVAILABILITY_END_TIME="availabilityEndTime",this.TIMESHIFT_BUFFER_DEPTH="timeShiftBufferDepth",this.MAX_SEGMENT_DURATION="maxSegmentDuration",this.PRESENTATION_TIME="presentationTime",this.MIN_BUFFER_TIME="minBufferTime",this.MAX_SUBSEGMENT_DURATION="maxSubsegmentDuration",this.START="start",this.AVAILABILITY_TIME_OFFSET="availabilityTimeOffset",this.AVAILABILITY_TIME_COMPLETE="availabilityTimeComplete",this.CENC_DEFAULT_KID="cenc:default_KID",this.DVB_PRIORITY="dvb:priority",this.DVB_WEIGHT="dvb:weight",this.SUGGESTED_PRESENTATION_DELAY="suggestedPresentationDelay",this.SERVICE_DESCRIPTION="ServiceDescription",this.SERVICE_DESCRIPTION_SCOPE="Scope",this.SERVICE_DESCRIPTION_LATENCY="Latency",this.SERVICE_DESCRIPTION_PLAYBACK_RATE="PlaybackRate"}}]),r);n.default=a,t.exports=n.default},{}],62:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){if(!(w&&T&&S&&C))throw new Error(a.default.MISSING_CONFIG_ERROR)}function n(){return R}function i(){return N}function r(){R=!(D=null),M=[]}function s(){return k}function l(){t();var e=new Date,n=N,i=1e3*S.getTime();n&&T.addRepresentationSwitch(n.adaptation.type,e,i,n.id)}function d(e){return null==e||e>=M.length?null:M[e]}function c(e,t){var n;e.segmentAvailabilityRange=C.calcSegmentAvailabilityRange(e,t),e.segmentAvailabilityRange.end<e.segmentAvailabilityRange.start?h(new o.default(E.SEGMENTS_UNAVAILABLE_ERROR_CODE,E.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE,{availabilityDelay:e.segmentAvailabilityRange.start-e.segmentAvailabilityRange.end})):t&&(n=e.segmentAvailabilityRange.end,C.setExpectedLiveEdge(n),T.updateManifestUpdateInfo({presentationStartTime:n}))}function u(e,n){t();for(var i=0,r=M.length;i<r;i++)c(M[i],e),n&&_.trigger(b.REPRESENTATION_UPDATE_STARTED,{sender:x,representation:M[i]})}function f(){R=!0,_.trigger(b.DATA_UPDATE_STARTED,{sender:x})}function h(e){R=!1;var t={sender:x,data:D,currentRepresentation:N};e&&(t.error=e),_.trigger(b.DATA_UPDATE_COMPLETED,t)}function p(e){var t=e;_.trigger(b.AST_IN_FUTURE,{delay:t}),setTimeout((function(){R||(f(),M.forEach((function(e){e.segmentAvailabilityRange=null})),u(S.getIsDynamic(),!0))}),t)}function g(e){if(e.sender.getType()===k&&e.sender.getStreamInfo().id===I&&R)if(e.error)h(e.error);else{var t,n=e.sender.getStreamInfo(),i=e.representation,r=T.getCurrentManifestUpdate(),a=!1,s=0,d=void 0;if(i.adaptation.period.mpd.manifest.type===A.DYNAMIC&&!i.adaptation.period.mpd.manifest.ignorePostponeTimePeriod&&S.getStreamController().getStreams().length<=1&&(s=function(e,t){try{var n=S.getStreamController().getActiveStreamInfo(),i=e.segmentAvailabilityRange.start;n&&n.id&&n.id!==t.id&&(i=Math.min(S.getTime(),i));var r=e.segmentAvailabilityRange.end-i;return 1e3*(S.getLiveDelay()-r)}catch(e){return 0}}(i,n)),0<s)return p(s),void h(new o.default(E.SEGMENTS_UPDATE_FAILED_ERROR_CODE,E.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE));if(r){for(var c=0;c<r.representationInfo.length;c++)if((d=r.representationInfo[c]).index===i.index&&d.mediaType===k){a=!0;break}a||T.addManifestUpdateRepresentationInfo(i,k)}!function(){for(var e=0,t=M.length;e<t;e++){var n=M[e].segmentInfoType;if(null===M[e].segmentAvailabilityRange||!M[e].hasInitialization()||(n===A.SEGMENT_BASE||n===A.BASE_URL)&&!M[e].segments)return}return 1}()||(w.setPlaybackQuality(k,n,(t=N,M.indexOf(t))),T.updateManifestUpdateInfo({latency:N.segmentAvailabilityRange.end-S.getTime()}),T.getCurrentRepresentationSwitch(N.adaptation.type)||l(),h())}}function m(e){e.isDynamic&&u(e.isDynamic)}function v(e){e.mediaType===k&&I===e.streamInfo.id&&(N=d(e.newQuality),l())}function y(e){e.newDuration&&N&&N.adaptation.period&&(N.adaptation.period.duration=e.newDuration)}var _=(e=e||{}).eventBus,b=e.events,E=e.errors,w=e.abrController,T=e.dashMetrics,S=e.playbackController,C=e.timelineConverter,k=e.type,I=e.streamId,A=e.dashConstants,x=void 0,D=void 0,R=void 0,M=void 0,N=void 0;return x={getData:function(){return D},isUpdating:n,updateData:function(e,n,i,r){t(),f(),M=n,N=d(r),D=e,i===a.default.VIDEO||i===a.default.AUDIO||i===a.default.FRAGMENTED_TEXT?u(S.getIsDynamic(),!0):h()},updateRepresentation:c,getCurrentRepresentation:i,getRepresentationForQuality:d,getType:s,getStreamId:function(){return I},reset:function(){_.off(b.QUALITY_CHANGE_REQUESTED,v,x),_.off(b.REPRESENTATION_UPDATE_COMPLETED,g,x),_.off(b.WALLCLOCK_TIME_UPDATED,m,x),_.off(b.MANIFEST_VALIDITY_CHANGED,y,x),r()}},r(),_.on(b.QUALITY_CHANGE_REQUESTED,v,x),_.on(b.REPRESENTATION_UPDATE_COMPLETED,g,x),_.on(b.WALLCLOCK_TIME_UPDATED,m,x),_.on(b.MANIFEST_VALIDITY_CHANGED,y,x),x}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(226)),s=i(e(47));r.__dashjs_factory_name="RepresentationController",n.default=s.default.getClassFactory(r),t.exports=n.default},{108:108,226:226,47:47}],63:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){return"webm"===(e?e.split("/")[1]:"").toLowerCase()}function n(e){t(e.mimeType)?_.loadInitialization(e.representation):y.loadInitialization(e.representation)}function i(e){t(e.mimeType)?_.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null,e.callback):y.loadSegments(e.representation,e.mediaType,e.representation?e.representation.indexRange:null,e.callback)}e=e||{};var r=this.context,a=e.eventBus,l=e.events,d=e.dashMetrics,c=e.mediaPlayerModel,u=e.errHandler,f=e.baseURLController,h=e.debug,p=e.boxParser,g=e.requestModifier,m=e.errors,v=void 0,y=void 0,_=void 0;return v={initialize:function(){a.on(l.SEGMENTBASE_INIT_REQUEST_NEEDED,n,v),a.on(l.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,i,v),y.initialize(),_.initialize()},reset:function(){a.off(l.SEGMENTBASE_INIT_REQUEST_NEEDED,n,v),a.off(l.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,i,v)}},y=(0,o.default)(r).getInstance(),_=(0,s.default)(r).getInstance(),y.setConfig({baseURLController:f,dashMetrics:d,mediaPlayerModel:c,errHandler:u,eventBus:a,events:l,errors:m,debug:h,boxParser:p,requestModifier:g}),_.setConfig({baseURLController:f,dashMetrics:d,mediaPlayerModel:c,errHandler:u,eventBus:a,events:l,errors:m,debug:h,requestModifier:g}),v}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(59)),s=i(e(60));r.__dashjs_factory_name="SegmentBaseController";var l=a.default.getSingletonFactory(r);n.default=l,t.exports=n.default},{47:47,59:59,60:60}],64:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){return e?e.segments?u[c.SEGMENT_BASE]:u[e.segmentInfoType]:null}e=e||{};var n,i=this.context,r=e.events,a=e.eventBus,c=e.dashConstants,u=void 0;return n={initialize:function(t){u[c.SEGMENT_TIMELINE]=(0,o.default)(i).create(e,t),u[c.SEGMENT_TEMPLATE]=(0,s.default)(i).create(e,t),u[c.SEGMENT_LIST]=(0,l.default)(i).create(e,t),u[c.SEGMENT_BASE]=(0,d.default)(i).create(e,t)},update:function(e,t,n,i,o){i||a.trigger(r.SEGMENTBASE_INIT_REQUEST_NEEDED,{mimeType:n,representation:e}),o||a.trigger(r.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{mimeType:n,mediaType:t,representation:e})},getSegmentByIndex:function(e,n,i){var r=t(e);return r?r.getSegmentByIndex(e,n,i):null},getSegmentByTime:function(e,n){var i=t(e);return i?i.getSegmentByTime(e,n):null}},u={},n}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(83)),s=i(e(81)),l=i(e(77)),d=i(e(79));r.__dashjs_factory_name="SegmentsController";var c=a.default.getClassFactory(r);n.default=c,t.exports=n.default},{47:47,77:77,79:79,81:81,83:83}],65:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e,t){var n=void 0,i=void 0,r=void 0,s=void 0,l=void 0,d=void 0,c=!1,u=!1;if(!e)throw new Error("adaptation is not defined");if(!t)throw new Error("type is not defined");if(e.hasOwnProperty("ContentComponent_asArray")&&(s=e.ContentComponent_asArray),l=t!==a.default.TEXT?new RegExp(t):new RegExp("(vtt|ttml)"),e.Representation_asArray&&e.Representation_asArray.length&&0<e.Representation_asArray.length){var f=w(e.Representation_asArray[0]);if(f&&0<f.length&&0<=E.THUMBNAILS_SCHEME_ID_URIS.indexOf(f[0].schemeIdUri))return t===a.default.IMAGE;if(e.Representation_asArray[0].hasOwnProperty(o.default.CODECS)&&(0===(d=e.Representation_asArray[0].codecs).search(a.default.STPP)||0===d.search(a.default.WVTT)))return t===a.default.FRAGMENTED_TEXT}if(s){if(1<s.length)return t===a.default.MUXED;s[0]&&s[0].contentType===t&&(u=c=!0)}if(e.hasOwnProperty(o.default.MIME_TYPE)&&(c=l.test(e.mimeType),u=!0),!u)for(n=0,i=e.Representation_asArray&&e.Representation_asArray.length?e.Representation_asArray.length:0;!u&&n<i;)(r=e.Representation_asArray[n]).hasOwnProperty(o.default.MIME_TYPE)&&(c=l.test(r.mimeType),u=!0),n++;return c}function t(e){return"text/vtt"===e||"application/ttml+xml"===e}function n(){return function(e,t){return e.bandwidth-t.bandwidth}}function i(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort(n()),e}function r(e,t){return e&&e.Period_asArray&&R(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function v(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===o.default.DYNAMIC),t}function w(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function T(e,t){var n=[],i=void 0;if(!e)return n;for(i=0;i<e.length;i++){var r=new p.default;if(r.timescale=1,r.representation=t,!e[i].hasOwnProperty(a.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");r.schemeIdUri=e[i].schemeIdUri,e[i].hasOwnProperty(o.default.TIMESCALE)&&(r.timescale=e[i].timescale),e[i].hasOwnProperty(o.default.VALUE)&&(r.value=e[i].value),n.push(r)}return n}function S(e){var t=[],n=e.BaseURL_asArray||[e.baseUri],i=!1;return n.some((function(n){if(n){var r=new h.default,a=n.__text||n;return D.isRelative(a)&&(i=!0,e.baseUri&&(a=D.resolve(a,e.baseUri))),r.url=a,n.hasOwnProperty(o.default.SERVICE_LOCATION)&&n.serviceLocation.length?r.serviceLocation=n.serviceLocation:r.serviceLocation=a,n.hasOwnProperty(o.default.DVB_PRIORITY)&&(r.dvb_priority=n[o.default.DVB_PRIORITY]),n.hasOwnProperty(o.default.DVB_WEIGHT)&&(r.dvb_weight=n[o.default.DVB_WEIGHT]),n.hasOwnProperty(o.default.AVAILABILITY_TIME_OFFSET)&&(r.availabilityTimeOffset=n[o.default.AVAILABILITY_TIME_OFFSET]),n.hasOwnProperty(o.default.AVAILABILITY_TIME_COMPLETE)&&(r.availabilityTimeComplete="false"!==n[o.default.AVAILABILITY_TIME_COMPLETE]),t.push(r),i}})),t}var C=void 0,k=void 0,I=void 0,A=void 0,x=this.context,D=(0,m.default)(x).getInstance(),R=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e};return C={getIsTypeOf:e,getIsTextTrack:t,getLanguageForAdaptation:function(e){var t="";return e&&e.hasOwnProperty(o.default.LANG)&&(t=e.lang.replace(/[^A-Za-z0-9-]/g,"")),t},getViewpointForAdaptation:function(e){return e&&e.hasOwnProperty(o.default.VIEWPOINT)?e.Viewpoint:null},getRolesForAdaptation:function(e){return e&&e.hasOwnProperty(o.default.ROLE_ASARRAY)?e.Role_asArray:[]},getAccessibilityForAdaptation:function(e){return e&&e.hasOwnProperty(o.default.ACCESSIBILITY_ASARRAY)?e.Accessibility_asArray:[]},
getAudioChannelConfigurationForAdaptation:function(e){return e&&e.hasOwnProperty(o.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAudioChannelConfigurationForRepresentation:function(e){return e&&e.hasOwnProperty(o.default.AUDIOCHANNELCONFIGURATION_ASARRAY)?e.AudioChannelConfiguration_asArray:[]},getAdaptationForIndex:function(e,t,n){var i=r(t,n);return 0<i.length&&R(e)?i[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var i=r(t,n),a=0;a<i.length;a++)if((0,g.default)(x).getInstance().areEqual(i[a],e))return a;return-1},getAdaptationForId:function(e,t,n){for(var i=r(t,n),a=void 0,s=(a=0,i.length);a<s;a++)if(i[a].hasOwnProperty(o.default.ID)&&i[a].id===e)return i[a];return null},getAdaptationsForType:function(t,n,a){for(var o=r(t,n),s=void 0,l=[],d=(s=0,o.length);s<d;s++)e(o[s],a)&&l.push(i(o[s]));return l},getCodec:function(e,t,n){var i,r=null;return e&&e.Representation_asArray&&0<e.Representation_asArray.length&&(i=R(t)&&0<=t&&t<e.Representation_asArray.length?e.Representation_asArray[t]:e.Representation_asArray[0])&&(r=i.mimeType+';codecs="'+i.codecs+'"',n&&void 0!==i.width&&(r+=';width="'+i.width+'";height="'+i.height+'"')),r&&r.replace(/\sprofiles=[^;]*/g,"")},getMimeType:function(e){return e&&e.Representation_asArray&&0<e.Representation_asArray.length?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(o.default.CENC_DEFAULT_KID)?e[o.default.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n<e.Label_asArray.length;n++)t.push({lang:e.Label_asArray[n].lang,text:e.Label_asArray[n].__text||e.Label_asArray[n]});return t},getContentProtectionData:function(e){return e&&e.hasOwnProperty(o.default.CONTENTPROTECTION_ASARRAY)&&0!==e.ContentProtection_asArray.length?e.ContentProtection_asArray:null},getIsDynamic:v,hasProfile:function(e,t){var n=!1;return e&&e.profiles&&0<e.profiles.length&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(o.default.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length<=1||void 0===arguments[1]?0:arguments[1],n=NaN;return e&&e.hasOwnProperty(o.default.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=i(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&0<t.Representation_asArray.length&&R(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var n,r,a,l,d,c,u=[],f=function(e){if(e&&e.period&&R(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&R(e.index))return i(t.AdaptationSet_asArray[e.index])}}(e),h=void 0,p=void 0;if(f&&f.Representation_asArray){e&&e.period&&R(e.period.index)&&(n=S(e.period.mpd.manifest))&&(p=n[0]);for(var g=0,m=f.Representation_asArray.length;g<m;++g){var v,y=f.Representation_asArray[g],_=new s.default;_.index=g,_.adaptation=e,y.hasOwnProperty(o.default.ID)&&(_.id=y.id),y.hasOwnProperty(o.default.CODECS)&&(_.codecs=y.codecs),y.hasOwnProperty(o.default.CODEC_PRIVATE_DATA)&&(_.codecPrivateData=y.codecPrivateData),y.hasOwnProperty(o.default.BANDWITH)&&(_.bandwidth=y.bandwidth),y.hasOwnProperty(o.default.WIDTH)&&(_.width=y.width),y.hasOwnProperty(o.default.HEIGHT)&&(_.height=y.height),y.hasOwnProperty(o.default.SCAN_TYPE)&&(_.scanType=y.scanType),y.hasOwnProperty(o.default.MAX_PLAYOUT_RATE)&&(_.maxPlayoutRate=y.maxPlayoutRate),y.hasOwnProperty(o.default.SEGMENT_BASE)?(h=y.SegmentBase,_.segmentInfoType=o.default.SEGMENT_BASE):y.hasOwnProperty(o.default.SEGMENT_LIST)?(h=y.SegmentList).hasOwnProperty(o.default.SEGMENT_TIMELINE)?_.segmentInfoType=o.default.SEGMENT_TIMELINE:_.segmentInfoType=o.default.SEGMENT_LIST:y.hasOwnProperty(o.default.SEGMENT_TEMPLATE)?((h=y.SegmentTemplate).hasOwnProperty(o.default.SEGMENT_TIMELINE)?_.segmentInfoType=o.default.SEGMENT_TIMELINE:_.segmentInfoType=o.default.SEGMENT_TEMPLATE,h.hasOwnProperty(o.default.INITIALIZATION_MINUS)&&(_.initialization=h.initialization.split("$Bandwidth$").join(y.bandwidth).split("$RepresentationID$").join(y.id))):_.segmentInfoType=o.default.BASE_URL,_.essentialProperties=w(y),h&&(h.hasOwnProperty(o.default.INITIALIZATION)?((v=h.Initialization).hasOwnProperty(o.default.SOURCE_URL)&&(_.initialization=v.sourceURL),v.hasOwnProperty(o.default.RANGE)&&(_.range=v.range)):y.hasOwnProperty(o.default.MIME_TYPE)&&t(y.mimeType)&&(_.range=0),h.hasOwnProperty(o.default.TIMESCALE)&&(_.timescale=h.timescale),h.hasOwnProperty(o.default.DURATION)?_.segmentDuration=h.duration/_.timescale:y.hasOwnProperty(o.default.SEGMENT_TEMPLATE)&&(h=y.SegmentTemplate).hasOwnProperty(o.default.SEGMENT_TIMELINE)&&(_.segmentDuration=(d=void 0,d=(l=h.SegmentTimeline).S_asArray[0],c=l.S_asArray[1],(d.hasOwnProperty("d")?d.d:c.t-d.t)/_.timescale)),h.hasOwnProperty(o.default.MEDIA)&&(_.media=h.media),h.hasOwnProperty(o.default.START_NUMBER)&&(_.startNumber=h.startNumber),h.hasOwnProperty(o.default.INDEX_RANGE)&&(_.indexRange=h.indexRange),h.hasOwnProperty(o.default.PRESENTATION_TIME_OFFSET)&&(_.presentationTimeOffset=h.presentationTimeOffset/_.timescale),h.hasOwnProperty(o.default.AVAILABILITY_TIME_OFFSET)?_.availabilityTimeOffset=h.availabilityTimeOffset:p&&void 0!==p.availabilityTimeOffset&&(_.availabilityTimeOffset=p.availabilityTimeOffset),h.hasOwnProperty(o.default.AVAILABILITY_TIME_COMPLETE)?_.availabilityTimeComplete="false"!==h.availabilityTimeComplete:p&&void 0!==p.availabilityTimeComplete&&(_.availabilityTimeComplete=p.availabilityTimeComplete)),_.MSETimeOffset=(a=(r=_).presentationTimeOffset,r.adaptation.period.start-a),_.path=[e.period.index,e.index,g],u.push(_)}}return u},getAdaptationsForPeriod:function(t){var n=t&&R(t.index)?t.mpd.manifest.Period_asArray[t.index]:null,i=[],r=void 0,s=void 0,d=void 0;if(n&&n.AdaptationSet_asArray)for(d=0;d<n.AdaptationSet_asArray.length;d++)s=n.AdaptationSet_asArray[d],r=new l.default,s.hasOwnProperty(o.default.ID)&&(r.id=s.id),r.index=d,r.period=t,e(s,a.default.MUXED)?r.type=a.default.MUXED:e(s,a.default.AUDIO)?r.type=a.default.AUDIO:e(s,a.default.VIDEO)?r.type=a.default.VIDEO:e(s,a.default.FRAGMENTED_TEXT)?r.type=a.default.FRAGMENTED_TEXT:e(s,a.default.IMAGE)?r.type=a.default.IMAGE:r.type=a.default.TEXT,i.push(r);return i},getRegularPeriods:function(e){for(var t=!!e&&v(e.manifest),n=[],i=null,r=null,s=null,l=null,c=void 0,u=(c=0,e&&e.manifest&&e.manifest.Period_asArray?e.manifest.Period_asArray.length:0);c<u;c++)(r=e.manifest.Period_asArray[c]).hasOwnProperty(o.default.START)?(l=new d.default).start=r.start:null!==i&&i.hasOwnProperty(o.default.DURATION)&&null!==s?(l=new d.default).start=parseFloat((s.start+s.duration).toFixed(5)):0!==c||t||((l=new d.default).start=0),null!==s&&isNaN(s.duration)&&(null!==l?s.duration=parseFloat((l.start-s.start).toFixed(5)):k.warn("First period duration could not be calculated because lack of start and duration period properties. This will cause timing issues during playback")),null!==l&&(l.id=function(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=d.default.DEFAULT_ID+"_"+t;return e.hasOwnProperty(o.default.ID)&&0<e.id.length&&"__proto__"!==e.id&&(n=e.id),n}(r,c),l.index=c,l.mpd=e,r.hasOwnProperty(o.default.DURATION)&&(l.duration=r.duration),n.push(l),i=r,s=l),l=r=null;return 0===n.length||null!==s&&isNaN(s.duration)&&(s.duration=parseFloat((function(e){!function(){if(!I||!I.hasOwnProperty("error"))throw new Error(a.default.MISSING_CONFIG_ERROR)}();var t=v(e.mpd.manifest),n=void 0;return e.mpd.manifest.mediaPresentationDuration?n=e.mpd.manifest.mediaPresentationDuration:e.duration?n=e.duration:t?n=Number.POSITIVE_INFINITY:I.error(new _.default(b.default.MANIFEST_ERROR_ID_PARSE_CODE,"Must have @mediaPresentationDuration on MPD or an explicit @duration on the last period.",e)),n}(s)-s.start).toFixed(5))),n},getMpd:function(e){var t=new c.default;return e&&((t.manifest=e).hasOwnProperty(o.default.AVAILABILITY_START_TIME)?t.availabilityStartTime=new Date(e.availabilityStartTime.getTime()):e.loadedTime&&(t.availabilityStartTime=new Date(e.loadedTime.getTime())),e.hasOwnProperty(o.default.AVAILABILITY_END_TIME)&&(t.availabilityEndTime=new Date(e.availabilityEndTime.getTime())),e.hasOwnProperty(o.default.MINIMUM_UPDATE_PERIOD)&&(t.minimumUpdatePeriod=e.minimumUpdatePeriod),e.hasOwnProperty(o.default.MEDIA_PRESENTATION_DURATION)&&(t.mediaPresentationDuration=e.mediaPresentationDuration),e.hasOwnProperty(o.default.SUGGESTED_PRESENTATION_DELAY)&&(t.suggestedPresentationDelay=e.suggestedPresentationDelay),e.hasOwnProperty(o.default.TIMESHIFT_BUFFER_DEPTH)&&(t.timeShiftBufferDepth=e.timeShiftBufferDepth),e.hasOwnProperty(o.default.MAX_SEGMENT_DURATION)&&(t.maxSegmentDuration=e.maxSegmentDuration)),t},getEventsForPeriod:function(e){var t=e&&e.mpd&&e.mpd.manifest?e.mpd.manifest:null,n=t?t.Period_asArray:null,i=n&&e&&R(e.index)?n[e.index].EventStream_asArray:null,r=[],s=void 0,l=void 0;if(i)for(s=0;s<i.length;s++){var d=new p.default;if(d.period=e,d.timescale=1,!i[s].hasOwnProperty(a.default.SCHEME_ID_URI))throw new Error("Invalid EventStream. SchemeIdUri has to be set");for(d.schemeIdUri=i[s].schemeIdUri,i[s].hasOwnProperty(o.default.TIMESCALE)&&(d.timescale=i[s].timescale),i[s].hasOwnProperty(o.default.VALUE)&&(d.value=i[s].value),l=0;i[s].Event_asArray&&l<i[s].Event_asArray.length;l++){var c,u=new f.default;u.presentationTime=0,u.eventStream=d,i[s].Event_asArray[l].hasOwnProperty(o.default.PRESENTATION_TIME)&&(u.presentationTime=i[s].Event_asArray[l].presentationTime,c=d.presentationTimeOffset?d.presentationTimeOffset*d.timescale:0,u.calculatedPresentationTime=u.presentationTime+e.start*d.timescale+c),i[s].Event_asArray[l].hasOwnProperty(o.default.DURATION)&&(u.duration=i[s].Event_asArray[l].duration),i[s].Event_asArray[l].hasOwnProperty(o.default.ID)&&(u.id=i[s].Event_asArray[l].id),i[s].Event_asArray[l].Signal&&i[s].Event_asArray[l].Signal.Binary?u.messageData=A.decodeArray(i[s].Event_asArray[l].Signal.Binary.toString()):u.messageData=i[s].Event_asArray[l].messageData||i[s].Event_asArray[l].__text,r.push(u)}}return r},getEventStreamForAdaptationSet:function(e,t){var n=void 0,i=void 0,r=void 0;return e&&e.Period_asArray&&t&&t.period&&R(t.period.index)&&(i=e.Period_asArray[t.period.index])&&i.AdaptationSet_asArray&&R(t.index)&&(r=i.AdaptationSet_asArray[t.index])&&(n=r.InbandEventStream_asArray),T(n,null)},getEventStreamForRepresentation:function(e,t){var n=void 0,i=void 0,r=void 0,a=void 0;return e&&e.Period_asArray&&t&&t.adaptation&&t.adaptation.period&&R(t.adaptation.period.index)&&(i=e.Period_asArray[t.adaptation.period.index])&&i.AdaptationSet_asArray&&R(t.adaptation.index)&&(r=i.AdaptationSet_asArray[t.adaptation.index])&&r.Representation_asArray&&R(t.index)&&(a=r.Representation_asArray[t.index])&&(n=a.InbandEventStream_asArray),T(n,t)},getUTCTimingSources:function(e){var t=v(e),n=!!e&&e.hasOwnProperty(o.default.AVAILABILITY_START_TIME),i=e?e.UTCTiming_asArray:null,r=[];return(t||n)&&i&&i.forEach((function(e){var t=new u.default;e.hasOwnProperty(a.default.SCHEME_ID_URI)&&(t.schemeIdUri=e.schemeIdUri,e.hasOwnProperty(o.default.VALUE)&&(t.value=e.value.toString(),r.push(t)))})),r},getBaseURLsFromElement:S,getRepresentationSortFunction:n,getLocation:function(e){if(e&&e.hasOwnProperty(a.default.LOCATION))return e.Location=e.Location_asArray[0],e.Location},getSuggestedPresentationDelay:function(e){return e&&e.hasOwnProperty(o.default.SUGGESTED_PRESENTATION_DELAY)?e.suggestedPresentationDelay:null},getAvailabilityStartTime:function(e){return e&&e.hasOwnProperty(o.default.AVAILABILITY_START_TIME)&&null!==e.availabilityStartTime?e.availabilityStartTime.getTime():null},getServiceDescriptions:function(e){var t=[];if(e&&e.hasOwnProperty(o.default.SERVICE_DESCRIPTION)){var n=!0,i=!1,r=void 0;try{for(var s,l=e.ServiceDescription_asArray[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var d=s.value,c=void 0,u=void 0,f=void 0,h=void 0;for(var p in d)d.hasOwnProperty(p)&&(p===o.default.ID?c=d[p]:p===o.default.SERVICE_DESCRIPTION_SCOPE?u=d[p].schemeIdUri:p===o.default.SERVICE_DESCRIPTION_LATENCY?f={target:d[p].target,max:d[p].max,min:d[p].min}:p===o.default.SERVICE_DESCRIPTION_PLAYBACK_RATE&&(h={max:d[p].max,min:d[p].min}));u===a.default.SERVICE_DESCRIPTION_LL_SCHEME&&(f||h)&&t.push({id:c,schemeIdUri:u,latency:f,playbackRate:h})}}catch(e){i=!0,r=e}finally{try{!n&&l.return&&l.return()}finally{if(i)throw r}}}return t},getSupplementalPropperties:function(e){var t={};if(e&&e.hasOwnProperty(o.default.SUPPLEMENTAL_PROPERTY)){var n=!0,i=!1,r=void 0;try{for(var s,l=e.SupplementalProperty_asArray[Symbol.iterator]();!(n=(s=l.next()).done);n=!0){var d=s.value;d.hasOwnProperty(a.default.SCHEME_ID_URI)&&d.hasOwnProperty(o.default.VALUE)&&(t[d[a.default.SCHEME_ID_URI]]=d[o.default.VALUE])}}catch(e){i=!0,r=e}finally{try{!n&&l.return&&l.return()}finally{if(i)throw r}}}return t},setConfig:function(e){e&&(e.errHandler&&(I=e.errHandler),e.BASE64&&(A=e.BASE64))}},k=(0,y.default)(x).getInstance().getLogger(C),C}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(61)),s=i(e(92)),l=i(e(84)),d=i(e(91)),c=i(e(90)),u=i(e(96)),f=i(e(86)),h=i(e(85)),p=i(e(87)),g=i(e(217)),m=i(e(221)),v=i(e(47)),y=i(e(45)),_=i(e(226)),b=i(e(51)),E=e(205);r.__dashjs_factory_name="DashManifestModel",n.default=v.default.getSingletonFactory(r),t.exports=n.default},{108:108,205:205,217:217,221:221,226:226,45:45,47:47,51:51,61:61,84:84,85:85,86:86,87:87,90:90,91:91,92:92,96:96}],66:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){e=e||{};var t=this.context,n=e.debug,i=void 0,r=void 0,a=void 0,p=void 0,g=void 0;return i={parse:function(e){var t=void 0,n=window.performance.now();if(!(t=p.xml_str2json(e)))throw new Error("parsing the manifest failed");var i=window.performance.now();g.run(t);var a=window.performance.now();return r.info("Parsing complete: ( xml2json: "+(i-n).toPrecision(3)+"ms, objectiron: "+(a-i).toPrecision(3)+"ms, total: "+((a-n)/1e3).toPrecision(3)+"s)"),t.protocol="DASH",t},getMatchers:function(){return a},getIron:function(){return g}},r=n.getLogger(i),a=[new d.default,new c.default,new u.default,new l.default],p=new s.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!0,ignoreRoot:!0,matchers:a}),g=(0,o.default)(t).create({adaptationset:new f.default,period:new h.default}),i}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(76)),s=i(e(3)),l=i(e(75)),d=i(e(73)),c=i(e(72)),u=i(e(74)),f=i(e(69)),h=i(e(70));r.__dashjs_factory_name="DashParser",n.default=a.default.getClassFactory(r),t.exports=n.default},{3:3,47:47,69:69,70:70,72:72,73:73,74:74,75:75,76:76}],67:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._name=e,this._merge=(t=e)&&t.length&&t.charAt(0)===t.charAt(0).toUpperCase()}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"name",get:function(){return this._name}},{key:"merge",get:function(){return this._merge}}]),r);n.default=a,t.exports=n.default},{}],68:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._name=e||"",this._properties=[],this._children=n||[],Array.isArray(t)&&t.forEach((function(e){i._properties.push(new s.default(e))}))}Object.defineProperty(n,"__esModule",{value:!0});var a,o=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e},s=(a=e(67))&&a.__esModule?a:{default:a},l=(o(r,[{key:"name",get:function(){return this._name}},{key:"children",get:function(){return this._children}},{key:"properties",get:function(){return this._properties}}]),r);n.default=l,t.exports=n.default},{67:67}],69:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var e=[s.default.PROFILES,s.default.WIDTH,s.default.HEIGHT,s.default.SAR,s.default.FRAMERATE,s.default.AUDIO_SAMPLING_RATE,s.default.MIME_TYPE,s.default.SEGMENT_PROFILES,s.default.CODECS,s.default.MAXIMUM_SAP_PERIOD,s.default.START_WITH_SAP,s.default.MAX_PLAYOUT_RATE,s.default.CODING_DEPENDENCY,s.default.SCAN_TYPE,s.default.FRAME_PACKING,s.default.AUDIO_CHANNEL_CONFIGURATION,s.default.CONTENT_PROTECTION,s.default.ESSENTIAL_PROPERTY,s.default.SUPPLEMENTAL_PROPERTY,s.default.INBAND_EVENT_STREAM];a(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,s.default.ADAPTATION_SET,e,[new o.default(s.default.REPRESENTATION,e,[new o.default(s.default.SUB_REPRESENTATION,e)])])}Object.defineProperty(n,"__esModule",{value:!0});var a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=i(e(68)),s=i(e(61)),l=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,o.default),r);n.default=l,t.exports=n.default},{61:61,68:68}],70:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var e=[s.default.SEGMENT_BASE,s.default.SEGMENT_TEMPLATE,s.default.SEGMENT_LIST];a(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,s.default.PERIOD,e,[new o.default(s.default.ADAPTATION_SET,e,[new o.default(s.default.REPRESENTATION,e)])])}Object.defineProperty(n,"__esModule",{value:!0});var a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=i(e(68)),s=i(e(61)),l=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,o.default),r);n.default=l,t.exports=n.default},{61:61,68:68}],71:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this._test=e,this._converter=t}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"test",get:function(){return this._test}},{key:"converter",get:function(){return this._converter}}]),r);n.default=a,t.exports=n.default},{}],72:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).call(this,(function(e){return c.test(e.value)}),(function(e){var t,n=c.exec(e),i=void 0;i=Date.UTC(parseInt(n[1],10),parseInt(n[2],10)-1,parseInt(n[3],10),parseInt(n[4],10),parseInt(n[5],10),n[6]&&parseInt(n[6],10)||0,n[7]&&parseFloat(n[7])*d||0);return n[9]&&n[10]&&(t=parseInt(n[9],10)*l+parseInt(n[10],10),i+=("+"===n[8]?-1:1)*t*s*d),new Date(i)}))}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=(r=e(71))&&r.__esModule?r:{default:r},s=60,l=60,d=1e3,c=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+-])([0-9]{2})(?::?)([0-9]{2}))?/,u=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,o.default),i);n.default=u,t.exports=n.default},{71:71}],73:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),a(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,(function(e){for(var t=[l.default.MIN_BUFFER_TIME,l.default.MEDIA_PRESENTATION_DURATION,l.default.MINIMUM_UPDATE_PERIOD,l.default.TIMESHIFT_BUFFER_DEPTH,l.default.MAX_SEGMENT_DURATION,l.default.MAX_SUBSEGMENT_DURATION,l.default.SUGGESTED_PRESENTATION_DELAY,l.default.START,s.default.START_TIME,l.default.DURATION],n=t.length,i=0;i<n;i++)if(e.nodeName===t[i])return d.test(e.value);return!1}),(function(e){var t=d.exec(e),n=parseFloat(t[3]||0)*c+parseFloat(t[5]||0)*u+parseFloat(t[7]||0)*f+parseFloat(t[9]||0)*h+parseFloat(t[11]||0)*p+parseFloat(t[13]||0);return void 0!==t[1]&&(n=-n),n}))}Object.defineProperty(n,"__esModule",{value:!0});var a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=i(e(71)),s=i(e(108)),l=i(e(61)),d=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,c=31536e3,u=2592e3,f=86400,h=3600,p=60,g=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,o.default),r);n.default=g,t.exports=n.default},{108:108,61:61,71:71}],74:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).call(this,(function(e){return s.test(e.value)}),(function(e){return parseFloat(e)}))}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=(r=e(71))&&r.__esModule?r:{default:r},s=/^[-+]?[0-9]+[.]?[0-9]*([eE][-+]?[0-9]+)?$/,l=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,o.default),i);n.default=l,t.exports=n.default},{71:71}],75:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),o(Object.getPrototypeOf(a.prototype),"constructor",this).call(this,(function(e,t){var n,i=(r(n={},l.default.MPD,[l.default.ID,l.default.PROFILES]),r(n,l.default.PERIOD,[l.default.ID]),r(n,l.default.BASE_URL,[l.default.SERVICE_LOCATION,l.default.BYTE_RANGE]),r(n,l.default.SEGMENT_BASE,[l.default.INDEX_RANGE]),r(n,l.default.INITIALIZATION,[l.default.RANGE]),r(n,l.default.REPRESENTATION_INDEX,[l.default.RANGE]),r(n,l.default.SEGMENT_LIST,[l.default.INDEX_RANGE]),r(n,l.default.BITSTREAM_SWITCHING,[l.default.RANGE]),r(n,l.default.SEGMENT_URL,[l.default.MEDIA_RANGE,l.default.INDEX_RANGE]),r(n,l.default.SEGMENT_TEMPLATE,[l.default.INDEX_RANGE,l.default.MEDIA,l.default.INDEX,l.default.INITIALIZATION_MINUS,l.default.BITSTREAM_SWITCHING_MINUS]),r(n,l.default.ASSET_IDENTIFIER,[l.default.VALUE,l.default.ID]),r(n,l.default.EVENT_STREAM,[l.default.VALUE]),r(n,l.default.ADAPTATION_SET,[l.default.PROFILES,l.default.MIME_TYPE,l.default.SEGMENT_PROFILES,l.default.CODECS,l.default.CONTENT_TYPE]),r(n,l.default.FRAME_PACKING,[l.default.VALUE,l.default.ID]),r(n,l.default.AUDIO_CHANNEL_CONFIGURATION,[l.default.VALUE,l.default.ID]),r(n,l.default.CONTENT_PROTECTION,[l.default.VALUE,l.default.ID]),r(n,l.default.ESSENTIAL_PROPERTY,[l.default.VALUE,l.default.ID]),r(n,l.default.SUPPLEMENTAL_PROPERTY,[l.default.VALUE,l.default.ID]),r(n,l.default.INBAND_EVENT_STREAM,[l.default.VALUE,l.default.ID]),r(n,l.default.ACCESSIBILITY,[l.default.VALUE,l.default.ID]),r(n,l.default.ROLE,[l.default.VALUE,l.default.ID]),r(n,l.default.RATING,[l.default.VALUE,l.default.ID]),r(n,l.default.VIEWPOINT,[l.default.VALUE,l.default.ID]),r(n,l.default.CONTENT_COMPONENT,[l.default.CONTENT_TYPE]),r(n,l.default.REPRESENTATION,[l.default.ID,l.default.DEPENDENCY_ID,l.default.MEDIA_STREAM_STRUCTURE_ID]),r(n,l.default.SUBSET,[l.default.ID]),r(n,l.default.METRICS,[l.default.METRICS_MINUS]),r(n,l.default.REPORTING,[l.default.VALUE,l.default.ID]),n);if(i.hasOwnProperty(t)){var a=i[t];return void 0!==a&&0<=a.indexOf(e.name)}return!1}),(function(e){return String(e)}))}Object.defineProperty(n,"__esModule",{value:!0});var o=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},s=i(e(71)),l=i(e(61)),d=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(a,s.default),a);n.default=d,t.exports=n.default},{61:61,71:71}],76:[function(e,t,n){"use strict";function i(e){function t(e,t,n){for(var i=0,r=e.length;i<r;++i){var a,o,s=e[i];t[s.name]&&(n[s.name]?s.merge&&(a=t[s.name],o=n[s.name],"object"==typeof a&&"object"==typeof o?function(e,t){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(a,o):n[s.name]=a+o):n[s.name]=t[s.name])}}function n(e,i){for(var r=0,a=e.children.length;r<a;++r){var o=e.children[r],s=i[o.name+"_asArray"];if(s)for(var l=0,d=s.length;l<d;++l){var c=s[l];t(e.properties,i,c),n(o,c)}}}return{run:function(t){if(null===t||"object"!=typeof t)return t;if("period"in e)for(var i=e.period,r=t.Period_asArray,a=0,o=r.length;a<o;++a){var s=r[a];if(n(i,s),"adaptationset"in e){var l=s.AdaptationSet_asArray;if(l)for(var d=e.adaptationset,c=0,u=l.length;c<u;++c)n(d,l[c])}}return t}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="ObjectIron";var o=a.default.getClassFactory(i);n.default=o,t.exports=n.default},{47:47}],77:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){function n(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(o.default.MISSING_CONFIG_ERROR)}function i(e,i){if(n(),!e)return null;var a,o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,l=o.SegmentURL_asArray.length,d=e&&!isNaN(e.startNumber)?e.startNumber:1,c=Math.max(d-1,0),u=e.startNumber,f=null;return i-c<l&&(a=o.SegmentURL_asArray[i-c],(f=(0,s.getIndexBasedSegment)(r,t,e,i))&&(f.replacementTime=(u+i-1)*e.segmentDuration,f.media=a.media?a.media:"",f.mediaRange=a.mediaRange,f.index=i,f.indexRange=a.indexRange)),e.availableSegmentsNumber=l,f}var r=(e=e||{}).timelineConverter;return{getSegmentByIndex:i,getSegmentByTime:function(e,t){if(n(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var o=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return i(e,Math.floor(o/a))}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(108)),s=e(80);r.__dashjs_factory_name="ListSegmentsGetter";var l=a.default.getClassFactory(r);n.default=l,t.exports=n.default},{108:108,47:47,80:80}],78:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,null,[{key:"round10",value:function(e,t){return n="round",i=e,void 0!==(r=t)&&0!=+r?(r=+r,null===(i=+i)||isNaN(i)||"number"!=typeof r||r%1!=0?NaN:(i=i.toString().split("e"),+((i=(i=Math[n](+(i[0]+"e"+(i[1]?i[1]-r:-r)))).toString().split("e"))[0]+"e"+(i[1]?+i[1]+r:r)))):Math[n](i);var n,i,r}}]),r);n.default=a,t.exports=n.default},{}],79:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){if(!i||!i.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(o.default.MISSING_CONFIG_ERROR)}function n(e,n){if(t(),!e)return null;var i=e.segments?e.segments.length:-1,r=void 0;if(n<i&&(r=e.segments[n])&&r.availabilityIdx===n)return r;for(var a=0;a<i;a++)if((r=e.segments[a])&&r.availabilityIdx===n)return r;return null}var i=(e=e||{}).timelineConverter;return{getSegmentByIndex:n,getSegmentByTime:function(e,i){return t(),n(e,function(e,t){if(!e)return-1;var n=e.segments,i=n?n.length:null,r=-1,a=void 0,o=void 0,s=void 0,l=void 0,d=void 0;if(n&&0<i)for(d=0;d<i;d++)if((s=(o=n[d]).presentationStartTime)<=t+(a=(l=o.duration)/2)&&t-a<s+l){r=o.availabilityIdx;break}return r}(e,i))}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(108));r.__dashjs_factory_name="SegmentBaseGetter";var s=a.default.getClassFactory(r);n.default=s,t.exports=n.default},{108:108,47:47}],80:[function(e,t,n){"use strict";function i(e,t){for(;e.length<t;)e="0"+e;return e}function r(e,t,n){var r=void 0,a=void 0,o=void 0,s=void 0,l=void 0,d=void 0,c=t.length,u="%0".length;if(!e)return e;for(;;){if((r=e.indexOf("$"+t))<0)return e;if((a=e.indexOf("$",r+c))<0)return e;if(r<(o=e.indexOf("%0",r+c))&&o<a)switch(s=e.charAt(a-1),l=parseInt(e.substring(o+u,a-1),10),s){case"d":case"i":case"u":d=i(n.toString(),l);break;case"x":d=i(n.toString(16),l);break;case"X":d=i(n.toString(16),l).toUpperCase();break;case"o":d=i(n.toString(8),l);break;default:return e}else d=n;e=e.substring(0,r)+d+e.substring(a+1)}}function a(e,t,n,i,r,a,o,s,d){var c,u=new l.default;return u.representation=e,u.duration=t,u.presentationStartTime=n,u.mediaStartTime=i,u.availabilityStartTime=r,u.availabilityEndTime=a.calcAvailabilityEndTimeFromPresentationTime(o,e.adaptation.period.mpd,s),u.wallStartTime=a.calcWallTimeForSegment(u,s),u.replacementNumber=(c=d,u.representation.startNumber+c),
u.availabilityIdx=d,u}function o(e,t,n,i){var r=e.getPeriodEnd(t,i);if(e.calcPeriodRelativeTimeFromMpdRelativeTime(t,r)<=e.calcPeriodRelativeTimeFromMpdRelativeTime(t,n.presentationStartTime)){if(!i)return;if(t.segmentAvailabilityRange&&n.presentationStartTime>=t.segmentAvailabilityRange.end)return}return 1}Object.defineProperty(n,"__esModule",{value:!0}),n.unescapeDollarsInTemplate=function(e){return e?e.split("$$").join("$"):e},n.replaceIDForTemplate=function(e,t){if(!t||!e||-1===e.indexOf("$RepresentationID$"))return e;var n=t.toString();return e.split("$RepresentationID$").join(n)},n.replaceTokenForTemplate=r,n.getIndexBasedSegment=function(e,t,n,i){var r,s,l=void 0;l=n.segmentDuration,isNaN(l)&&(l=n.adaptation.period.duration),r=parseFloat((n.adaptation.period.start+i*l).toFixed(5)),s=parseFloat((r+l).toFixed(5));var d=a(n,l,r,e.calcMediaTimeFromPresentationTime(r,n),e.calcAvailabilityStartTimeFromPresentationTime(r,n.adaptation.period.mpd,t),e,s,t,i);return o(e,n,d,t)?d:null},n.getTimeBasedSegment=function(e,t,n,i,s,l,d,c,u,f){var h,p,g=i/l,m=Math.min(s/l,n.adaptation.period.mpd.maxSegmentDuration),v=void 0;return p=(h=e.calcPresentationTimeFromMediaTime(g,n))+m,o(e,n,v=a(n,m,h,g,n.adaptation.period.mpd.manifest.loadedTime,e,p,t,u),t)?(v.replacementTime=f||i,d=r(d,"Number",v.replacementNumber),d=r(d,"Time",v.replacementTime),v.media=d,v.mediaRange=c,v):null};var s,l=(s=e(94))&&s.__esModule?s:{default:s}},{94:94}],81:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){function n(){if(!r||!r.hasOwnProperty("calcPeriodRelativeTimeFromMpdRelativeTime"))throw new Error(o.default.MISSING_CONFIG_ERROR)}function i(e,i){if(n(),!e)return null;var a=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate;i=Math.max(i,0);var o,l=(0,s.getIndexBasedSegment)(r,t,e,i);l&&(l.replacementTime=(i-1)*e.segmentDuration,o=a.media,o=(0,s.replaceTokenForTemplate)(o,"Number",l.replacementNumber),o=(0,s.replaceTokenForTemplate)(o,"Time",l.replacementTime),l.media=o);var d=e.segmentDuration,c=e.segmentAvailabilityRange;return isNaN(d)?e.availableSegmentsNumber=1:e.availableSegmentsNumber=Math.ceil((c.end-c.start)/d),l}var r=(e=e||{}).timelineConverter;return{getSegmentByIndex:i,getSegmentByTime:function(e,t){if(n(),!e)return null;var a=e.segmentDuration;if(isNaN(a))return null;var o=r.calcPeriodRelativeTimeFromMpdRelativeTime(e,t);return i(e,Math.floor(o/a))}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(108)),s=e(80);r.__dashjs_factory_name="TemplateSegmentsGetter";var l=a.default.getClassFactory(r);n.default=l,t.exports=n.default},{108:108,47:47,80:80}],82:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){v=e}function t(e,t,n,i){return i?n&&t.timeShiftBufferDepth!=Number.POSITIVE_INFINITY?new Date(t.availabilityStartTime.getTime()+1e3*(e+t.timeShiftBufferDepth)):t.availabilityEndTime:n?new Date(t.availabilityStartTime.getTime()+1e3*(e-v)):t.availabilityStartTime}function n(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*v)/1e3}function i(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function r(t){y||void 0!==t.offset&&(e(t.offset/1e3),y=!0)}function s(){v=0,y=!1,_=NaN}function u(){p.off(o.default.TIME_SYNCHRONIZATION_COMPLETED,r,this),s()}var f,h=this.context,p=(0,a.default)(h).getInstance(),g=(0,c.default)(h).getInstance(),m=void 0,v=void 0,y=void 0,_=void 0;return f={initialize:function(){s(),p.on(o.default.TIME_SYNCHRONIZATION_COMPLETED,r,this)},isTimeSyncCompleted:function(){return y},setTimeSyncCompleted:function(e){y=e},getClientTimeOffset:function(){return v},setClientTimeOffset:e,getExpectedLiveEdge:function(){return _},setExpectedLiveEdge:function(e){_=e},calcAvailabilityStartTimeFromPresentationTime:function(e,n,i){return t.call(this,e,n,i)},calcAvailabilityEndTimeFromPresentationTime:function(e,n,i){return t.call(this,e,n,i,!0)},calcPresentationTimeFromWallTime:n,calcPresentationTimeFromMediaTime:i,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcSegmentAvailabilityRange:function(e,t){var r=e.adaptation.period,a={start:r.start,end:r.start+r.duration};if(!t)return a;if(!y&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var o=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0);if(e.segmentInfoType===l.default.SEGMENT_TIMELINE&&g.get().streaming.calcSegmentAvailabilityRangeFromTimeline)return function(e){var t,n=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],r=m.getRepresentationFor(e.index,n),a=r.SegmentTemplate.SegmentTimeline,o=r.SegmentTemplate.timescale,s=a.S_asArray,l={start:0,end:0},d=0,c=void 0,u=void 0,f=void 0;for(l.start=i(s[0].t/o,e),f=0,t=s.length;f<t;f++)u=0,(c=s[f]).hasOwnProperty("r")&&(u=c.r),d+=c.d/o*(1+u);return l.end=l.start+d,l}(e);var s=n(new Date,r),d=r.start+r.duration;a.start=Math.max(s-r.mpd.timeShiftBufferDepth,r.start);var c=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<o?o-e.availabilityTimeOffset:o;return a.end=d<=s&&s-c<d?d:s-c,a},getPeriodEnd:function(e,t){var i=e.adaptation.period;if(!t)return i.start+i.duration;if(!y&&e.segmentAvailabilityRange)return e.segmentAvailabilityRange;var r=e.segmentDuration||(e.segments&&e.segments.length?e.segments[e.segments.length-1].duration:0),a=n(new Date,i),o=i.start+i.duration,s=void 0!==e.availabilityTimeOffset&&e.availabilityTimeOffset<r?r-e.availabilityTimeOffset:r;return Math.min(a-s,o)},calcWallTimeForSegment:function(e,t){var n=void 0,i=void 0,r=void 0;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,i=e.presentationStartTime+n,r=new Date(e.availabilityStartTime.getTime()+1e3*i)),r},reset:u},m=(0,d.default)(h).getInstance(),u(),f}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(46)),o=i(e(54)),s=i(e(47)),l=i(e(61)),d=i(e(65)),c=i(e(48));r.__dashjs_factory_name="TimelineConverter",n.default=s.default.getSingletonFactory(r),t.exports=n.default},{46:46,47:47,48:48,54:54,61:61,65:65}],83:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){function n(){if(!r||!r.hasOwnProperty("calcMediaTimeFromPresentationTime")||!r.hasOwnProperty("calcSegmentAvailabilityRange"))throw new Error(o.default.MISSING_CONFIG_ERROR)}function i(e,n){for(var i,a=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentTemplate||e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index].Representation_asArray[e.index].SegmentList,o=a.SegmentTimeline,s=a.SegmentURL_asArray,l=0,d=0,c=-1,u=void 0,f=void 0,h=void 0,p=void 0,g=void 0,m=void 0,v=e.timescale,y=!1,_=(f=0,(i=o.S_asArray).length);f<_&&!y;f++){var b;p=0;for((u=i[f]).hasOwnProperty("r")&&(p=u.r),u.hasOwnProperty("t")&&(d=(l=u.t)/v),p<0&&((m=i[f+1])&&m.hasOwnProperty("t")?g=m.t/v:(b=e.segmentAvailabilityRange?e.segmentAvailabilityRange.end:r.calcSegmentAvailabilityRange(e,t).end,g=r.calcMediaTimeFromPresentationTime(b,e),e.segmentDuration=u.d/v),p=Math.ceil((g-d)/(u.d/v))-1),h=0;h<=p&&!y;h++)(y=n(l,d,a,s,u,v,++c,f))&&(e.segmentDuration=u.d/v,(h<p-1||f<_-1)&&c++),d=(l+=u.d)/v}e.availableSegmentsNumber=c}var r=(e=e||{}).timelineConverter;return{getSegmentByIndex:function(e,a,o){if(n(),!e)return null;var l=null,d=!1;return i(e,(function(n,i,a,c,u,f,h,p){if(d||o<0){var g=a.media,m=u.mediaRange;return c&&(g=c[p].media||"",m=c[p].mediaRange),l=(0,s.getTimeBasedSegment)(r,t,e,n,u.d,f,g,m,h,u.tManifest),!0}return i>=o-.5*u.d/f&&(d=!0),!1})),l},getSegmentByTime:function(e,a){if(n(),!e)return null;void 0===a&&(a=null);var o=null,l=r.calcMediaTimeFromPresentationTime(a,e);return i(e,(function(n,i,a,d,c,u,f,h){if(l<i+c.d/u){var p=a.media,g=c.mediaRange;return d&&(p=d[h].media||"",g=d[h].mediaRange),o=(0,s.getTimeBasedSegment)(r,t,e,n,c.d,u,p,g,f,c.tManifest),!0}return!1})),o}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(108)),s=e(80);r.__dashjs_factory_name="TimelineSegmentsGetter";var l=a.default.getClassFactory(r);n.default=l,t.exports=n.default},{108:108,47:47,80:80}],84:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.period=null,this.index=-1,this.type=null},t.exports=n.default},{}],85:[function(e,t,n){"use strict";function i(e,t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.url=e||"",this.serviceLocation=t||e||"",this.dvb_priority=n||1,this.dvb_weight=r||1,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}Object.defineProperty(n,"__esModule",{value:!0}),i.DEFAULT_DVB_PRIORITY=1,i.DEFAULT_DVB_WEIGHT=1,n.default=i,t.exports=n.default},{}],86:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.duration=NaN,this.presentationTime=NaN,this.id=NaN,this.messageData="",this.eventStream=null,this.presentationTimeDelta=NaN},t.exports=n.default},{}],87:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.adaptionSet=null,this.representation=null,this.period=null,this.timescale=1,this.value="",this.schemeIdUri=""},t.exports=n.default},{}],88:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.DVRWindowSize=NaN,this.loadedTime=null,this.availableFrom=null,this.minBufferTime=NaN,this.duration=NaN,this.isDynamic=!1,this.maxFragmentDuration=null},t.exports=n.default},{}],89:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.id=null,this.index=null,this.type=null,this.streamInfo=null,this.representationCount=0,this.lang=null,this.viewpoint=null,this.accessibility=null,this.audioChannelConfiguration=null,this.roles=null,this.codec=null,this.mimeType=null,this.contentProtection=null,this.isText=!1,this.KID=null,this.bitrateList=null}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"isMediaInfoEqual",value:function(e){if(!e)return!1;var t=this.id===e.id,n=this.viewpoint===e.viewpoint,i=this.lang===e.lang,r=this.roles.toString()===e.roles.toString(),a=this.accessibility.toString()===e.accessibility.toString(),o=this.audioChannelConfiguration.toString()===e.audioChannelConfiguration.toString();return t&&n&&i&&r&&a&&o}}]),r);n.default=a,t.exports=n.default},{}],90:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.manifest=null,this.suggestedPresentationDelay=0,this.availabilityStartTime=null,this.availabilityEndTime=Number.POSITIVE_INFINITY,this.timeShiftBufferDepth=Number.POSITIVE_INFINITY,this.maxSegmentDuration=Number.POSITIVE_INFINITY,this.minimumUpdatePeriod=NaN,this.mediaPresentationDuration=NaN},t.exports=n.default},{}],91:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.id=null,this.index=-1,this.duration=NaN,this.start=NaN,this.mpd=null}Object.defineProperty(n,"__esModule",{value:!0}),i.DEFAULT_ID="defaultId",n.default=i,t.exports=n.default},{}],92:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.id=null,this.index=-1,this.adaptation=null,this.segmentInfoType=null,this.initialization=null,this.codecs=null,this.codecPrivateData=null,this.segmentDuration=NaN,this.timescale=1,this.startNumber=1,this.indexRange=null,this.range=null,this.presentationTimeOffset=0,this.MSETimeOffset=NaN,this.segmentAvailabilityRange=null,this.availableSegmentsNumber=0,this.bandwidth=NaN,this.width=NaN,this.height=NaN,this.scanType=null,this.maxPlayoutRate=NaN,this.availabilityTimeOffset=0,this.availabilityTimeComplete=!0}Object.defineProperty(n,"__esModule",{value:!0});var a,o=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e},s=(a=e(61))&&a.__esModule?a:{default:a},l=(o(r,[{key:"hasInitialization",value:function(){return null!==this.initialization||null!==this.range}},{key:"hasSegments",value:function(){return this.segmentInfoType!==s.default.BASE_URL&&this.segmentInfoType!==s.default.SEGMENT_BASE&&!this.indexRange}}]),r);n.default=l,t.exports=n.default},{61:61}],93:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.quality=null,this.DVRWindow=null,this.fragmentDuration=null,this.mediaInfo=null,this.MSETimeOffset=null},t.exports=n.default},{}],94:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.indexRange=null,this.index=null,this.mediaRange=null,this.media=null,this.duration=NaN,this.replacementTime=null,this.replacementNumber=NaN,this.mediaStartTime=NaN,this.presentationStartTime=NaN,this.availabilityStartTime=NaN,this.availabilityEndTime=NaN,this.availabilityIdx=NaN,this.wallStartTime=NaN,this.representation=null},t.exports=n.default},{}],95:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.id=null,this.index=null,this.start=NaN,this.duration=NaN,this.manifestInfo=null,this.isLast=!0},t.exports=n.default},{}],96:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""},t.exports=n.default},{}],97:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){e=e||{};var t=this.context,n=e.eventBus,i=e.events,r=e.urlUtils,d=e.errors,c=void 0,u=void 0;return c={checkForExistence:function(e){function t(t){n.trigger(i.CHECK_FOR_EXISTENCE_COMPLETED,{request:e,exists:t})}var r;e?(r=new s.default(e.url),u.load({request:r,success:function(){t(!0)},error:function(){t(!1)}})):t(!1)},load:function(e){function t(t,r){n.trigger(i.LOADING_COMPLETED,{request:e,response:t||null,error:r||null,sender:c})}e?u.load({request:e,progress:function(t){n.trigger(i.LOADING_PROGRESS,{request:e,stream:t.stream}),t.data&&n.trigger(i.LOADING_DATA_PROGRESS,{request:e,response:t.data||null,error:null,sender:c})},success:function(e){t(e)},error:function(e,n,i){t(void 0,new l.default(d.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE,i,n))},abort:function(e){e&&n.trigger(i.LOADING_ABANDONED,{request:e,mediaType:e.mediaType,sender:c})}}):t(void 0,new l.default(d.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE,d.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE))},abort:function(){u&&u.abort()},reset:function(){u&&(u.abort(),u=null)}},u=(0,o.default)(t).create({errHandler:e.errHandler,errors:d,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:r,constants:a.default,boxParser:e.boxParser,dashConstants:e.dashConstants}),c}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(159)),s=i(e(229)),l=i(e(226)),d=i(e(47));r.__dashjs_factory_name="FragmentLoader",n.default=d.default.getClassFactory(r),t.exports=n.default},{108:108,159:159,226:226,229:229,47:47}],98:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){r.trigger(p.default.INTERNAL_MANIFEST_LOADED,{manifest:e.manifest})}e=e||{};var n=this.context,i=e.debug,r=(0,h.default)(n).getInstance(),m=(0,d.default)(n).getInstance(),y=void 0,_=void 0,b=void 0,E=void 0,w=void 0,T=e.mssHandler,S=e.errHandler;return y={load:function(e){var t=new c.default(e,f.HTTPRequest.MPD_TYPE);b.load({request:t,success:function(t,o,s){if(E){var l,d,c=void 0,f=void 0,h=void 0;if(s&&s!==e?(f=m.parseBaseUrl(s),c=s):(m.isRelative(e)&&(e=m.resolve(e,window.location.href)),f=m.parseBaseUrl(e)),null===w&&(d=null,w=-1<(l=t).indexOf("SmoothStreamingMedia")?(T&&(d=T.createMssParser(),T.registerEvents()),d):-1<l.indexOf("MPD")?(0,v.default)(n).create({debug:i}):d),null!==w){E.setMatchers(w.getMatchers()),E.setIron(w.getIron());try{h=w.parse(t)}catch(t){return void r.trigger(p.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new u.default(g.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,g.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}h?(h.url=c||e,h.originalUrl||(h.originalUrl=h.url),h.hasOwnProperty(a.default.LOCATION)&&(f=m.parseBaseUrl(h.Location_asArray[0]),_.debug("BaseURI set by Location to: "+f)),h.baseUri=f,h.loadedTime=new Date,E.resolveManifestOnLoad(h),r.trigger(p.default.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})):r.trigger(p.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new u.default(g.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,g.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}else r.trigger(p.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new u.default(g.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,g.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+""+e)})}},error:function(t,n,i){r.trigger(p.default.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new u.default(g.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,g.default.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+(e+", ")+i)})}})},reset:function(){r.off(p.default.XLINK_READY,t,y),E&&(E.reset(),E=null),b&&(b.abort(),b=null),T&&T.reset()}},_=i.getLogger(y),r.on(p.default.XLINK_READY,t,y),b=(0,l.default)(n).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings.get().streaming.lowLatencyEnabled,urlUtils:m,constants:a.default,dashConstants:o.default,errors:g.default}),E=(0,s.default)(n).create({errHandler:S,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),w=null,y}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(61)),s=i(e(124)),l=i(e(159)),d=i(e(221)),c=i(e(233)),u=i(e(226)),f=e(242),h=i(e(46)),p=i(e(54)),g=i(e(51)),m=i(e(47)),v=i(e(66));r.__dashjs_factory_name="ManifestLoader";var y=m.default.getClassFactory(r);n.default=y,t.exports=n.default},{108:108,124:124,159:159,221:221,226:226,233:233,242:242,46:46,47:47,51:51,54:54,61:61,66:66}],99:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){_=NaN,E=!(w=!1),t()}function t(){null!==b&&(clearTimeout(b),b=null)}function n(e){t(),isNaN(e)&&!isNaN(_)&&(e=1e3*_),isNaN(e)||(y.debug("Refresh manifest in "+e+" milliseconds."),b=setTimeout(s,e))}function i(){w=!0;var e=S.getValue(),t=e.url,n=C.getLocation(e);n&&(t=n),T.load(t)}function r(e){var t,i;S.getValue()&&S.getValue().type===c.default.DYNAMIC&&e.type===c.default.STATIC?m.trigger(o.default.DYNAMIC_STREAM_COMPLETED):(S.setValue(e),i=((t=new Date).getTime()-e.loadedTime.getTime())/1e3,2147483647<1e3*(_=C.getManifestUpdatePeriod(e,i))&&(_=2147483.647),m.trigger(o.default.MANIFEST_UPDATED,{manifest:e}),y.info("Manifest has been refreshed at "+t+"["+t.getTime()/1e3+"] "),E||n())}function s(){E||(w?n(I.get().streaming.manifestUpdateRetryInterval):i())}function u(e){e.error?e.error.code===d.default.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&k.error(e.error):r(e.manifest)}function f(){E=!1,n()}function h(){(E=!I.get().streaming.scheduleWhilePaused)&&t()}function p(){w=!1}var g=this.context,m=(0,a.default)(g).getInstance(),v=void 0,y=void 0,_=void 0,b=void 0,E=void 0,w=void 0,T=void 0,S=void 0,C=void 0,k=void 0,I=void 0;return v={initialize:function(){e(),m.on(o.default.STREAMS_COMPOSED,p,this),m.on(o.default.PLAYBACK_STARTED,f,this),m.on(o.default.PLAYBACK_PAUSED,h,this),m.on(o.default.INTERNAL_MANIFEST_LOADED,u,this)},setManifest:function(e){r(e)},refreshManifest:i,setConfig:function(e){e&&(e.manifestModel&&(S=e.manifestModel),e.adapter&&(C=e.adapter),e.manifestLoader&&(T=e.manifestLoader),e.errHandler&&(k=e.errHandler),e.settings&&(I=e.settings))},reset:function(){m.off(o.default.PLAYBACK_STARTED,f,this),m.off(o.default.PLAYBACK_PAUSED,h,this),m.off(o.default.STREAMS_COMPOSED,p,this),m.off(o.default.INTERNAL_MANIFEST_LOADED,u,this),e()}},y=(0,l.default)(g).getInstance().getLogger(v),v}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(46)),o=i(e(54)),s=i(e(47)),l=i(e(45)),d=i(e(51)),c=i(e(61));r.__dashjs_factory_name="ManifestUpdater",n.default=s.default.getClassFactory(r),t.exports=n.default},{45:45,46:46,47:47,51:51,54:54,61:61}],100:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){return!!be&&!!Ve.getElement()}function t(){return(0,P.getVersionString)()}function n(){if(!Se)throw ce;return He.isPaused()}function i(e){var t=$e.getCurrentDVRInfo();if(!t)return 0;var n=He.getLiveDelay(),i=t.range.start+e;return i>t.range.end-n&&(i=t.range.end-n),i}function r(e){if(!Se)throw ce;var t,n=J().currentTime;return void 0!==e?n=Be.getTimeRelativeToStreamId(n,e):He.getIsDynamic()&&(n=null===(t=$e.getCurrentDVRInfo())?0:Y()-(t.range.end-t.time)),n}function Y(){if(!Se)throw ce;var e=J().duration;if(He.getIsDynamic()){var t,n=$e.getCurrentDVRInfo();if(!n)return 0;e=(t=n.range.end-n.range.start)<n.manifestInfo.DVRWindowSize?t:n.manifestInfo.DVRWindowSize}return e}function K(e){(0,z.checkParameterType)(e,"boolean"),Ce=e}function X(){Pe.restoreDefaultUTCTimingSources()}function Q(){return $e}function J(){if(!Ve.getElement())throw ue;return Ve.getElement()}function Z(e){if(!we)throw he;Ve.setElement(e),e&&(ae(),function(){if(!Re){var e,t=dashjs.MetricsReporting;"function"==typeof t&&(e=t(pe).create(),Re=e.createMetricsReporting({debug:ve,eventBus:ge,mediaElement:J(),adapter:Oe,dashMetrics:$e,events:R.default,constants:o.default,metricsConstants:l.default}))}}(),function(){if(!Me){var e=dashjs.MssHandler;"function"==typeof e&&(x.default.extend(e.errors),Me=e(pe).create({eventBus:ge,mediaPlayerModel:Pe,dashMetrics:$e,manifestModel:qe,playbackController:He,streamController:Be,protectionController:De,baseURLController:Fe,errHandler:Le,events:R.default,constants:o.default,debug:ve,initSegmentType:U.HTTPRequest.INIT_SEGMENT_TYPE,BASE64:H.default,ISOBoxer:$.default,settings:me}))}}(),Be&&Be.switchToVideoElement()),Se&&ie(),le()}function ee(e){if(!Te)throw de;var t=Be.getActiveStreamInfo();return xe.getTracksFor(e,t)}function te(t){if(!we)throw he;"string"==typeof t&&We.initialize(t),be=t,(Te||Se)&&ie(),e()&&le()}function ne(){if(!Te)throw de;var e=Be.getActiveStreamInfo();return e?Be.getStreamById(e.id):null}function ie(){Te=Se=!1,Oe.reset(),Be.reset(),Ue.reset(),He.reset(),ke.reset(),xe.reset(),Ge.reset(),De&&(me.get().streaming.keepProtectionMediaKeys?De.stop():(De.reset(),De=null,ae())),ze.reset()}function re(){return(0,p.default)(pe).create({debug:ve,errHandler:Le,dashMetrics:$e,mediaPlayerModel:Pe,requestModifier:(0,y.default)(pe).getInstance(),mssHandler:Me,settings:me})}function ae(){if(De)return De;var e=dashjs.Protection;if("function"!=typeof e)return null;var t=e(pe).create();return R.default.extend(e.events),M.default.extend(e.events,{publicOnly:!0}),x.default.extend(e.errors),je=je||(0,m.default)(pe).getInstance(),De=t.createProtectionSystem({debug:ve,errHandler:Le,videoModel:Ve,capabilities:je,eventBus:ge,events:R.default,BASE64:H.default,constants:o.default})}function oe(){if(!we)throw he;if(Ne)return Ne;var e=dashjs.OfflineController;if("function"!=typeof e)return null;R.default.extend(e.events),M.default.extend(e.events,{publicOnly:!0}),x.default.extend(e.errors);var t=re(),n=(0,V.default)(pe).create();return n.setConfig({manifestModel:qe,adapter:Oe,manifestLoader:t,errHandler:Le}),Ne=e(pe).create({debug:ve,manifestUpdater:n,baseURLController:Fe,manifestLoader:t,manifestModel:qe,mediaPlayerModel:Pe,abrController:ke,playbackController:He,adapter:Oe,errHandler:Le,dashMetrics:$e,timelineConverter:Ae,schemeLoaderFactory:Ie,eventBus:ge,events:R.default,errors:x.default,constants:o.default,settings:me,dashConstants:s.default,urlUtils:(0,G.default)(pe).getInstance()})}function se(e){var t=$e.getCurrentDVRInfo();return t?e+(t.manifestInfo.availableFrom.getTime()/1e3+t.range.start):0}function le(){var t;Ne&&Ne.resetRecords(),!Te&&be&&(Te=!0,_e.info("Streaming Initialized"),t=re(),Be=Be||(0,c.default)(pe).getInstance(),xe.setConfig({domStorage:Ye}),Be.setConfig({capabilities:je,manifestLoader:t,manifestModel:qe,mediaPlayerModel:Pe,protectionController:De,adapter:Oe,dashMetrics:$e,errHandler:Le,timelineConverter:Ae,videoModel:Ve,playbackController:He,abrController:ke,mediaController:xe,textController:Ge,settings:me,baseURLController:Fe}),Ue.setConfig({settings:me,playbackController:He,streamController:Be,videoModel:Ve,timelineConverter:Ae,adapter:Oe}),He.setConfig({streamController:Be,dashMetrics:$e,mediaPlayerModel:Pe,adapter:Oe,videoModel:Ve,timelineConverter:Ae,uriFragmentModel:We,settings:me}),ke.setConfig({streamController:Be,domStorage:Ye,mediaPlayerModel:Pe,dashMetrics:$e,adapter:Oe,videoModel:Ve,settings:me}),ke.createAbrRulesCollection(),Ge.setConfig({errHandler:Le,manifestModel:qe,adapter:Oe,mediaController:xe,streamController:Be,videoModel:Ve}),ze.setConfig({abrController:ke,dashMetrics:$e,playbackController:He}),Be.initialize(Ce,Ee),Ue.initialize(),ze.initialize(),"string"==typeof be?Be.load(be):Be.loadWithManifest(be)),!Se&&e()&&(Se=!0,_e.info("Playback Initialized"))}var de="You must first call initialize() and set a source before calling this method",ce="You must first call initialize() and set a valid source and view before calling this method",ue="You must first call attachView() to set the video element before calling this method",fe="You must first call attachSource() with a valid source before calling this method",he="MediaPlayer not initialized!",pe=this.context,ge=(0,D.default)(pe).getInstance(),me=(0,O.default)(pe).getInstance(),ve=(0,A.default)(pe).getInstance({settings:me}),ye=void 0,_e=void 0,be=void 0,Ee=void 0,we=void 0,Te=void 0,Se=void 0,Ce=void 0,ke=void 0,Ie=void 0,Ae=void 0,xe=void 0,De=void 0,Re=void 0,Me=void 0,Ne=void 0,Oe=void 0,Pe=void 0,Le=void 0,Fe=void 0,je=void 0,Be=void 0,Ue=void 0,He=void 0,$e=void 0,qe=void 0,ze=void 0,Ve=void 0,Ge=void 0,We=void 0,Ye=void 0,Ke=void 0;return ye={initialize:function(e,n,i){je=je||(0,m.default)(pe).getInstance(),Le=(0,g.default)(pe).getInstance(),je.supportsMediaSource()?we||(we=!0,Ae=(0,B.default)(pe).getInstance(),ke||(ke=(0,T.default)(pe).getInstance()).setConfig({settings:me}),Ie=Ie||(0,S.default)(pe).getInstance(),He=He||(0,d.default)(pe).getInstance(),xe=xe||(0,f.default)(pe).getInstance(),Be=Be||(0,c.default)(pe).getInstance(),Ue=Ue||(0,u.default)(pe).getInstance(),Oe=(0,F.default)(pe).getInstance(),qe=(0,E.default)(pe).getInstance(),ze=(0,k.default)(pe).getInstance(),$e=(0,j.default)(pe).getInstance({settings:me}),Ge=(0,_.default)(pe).getInstance(),Ye=(0,I.default)(pe).getInstance({settings:me}),Oe.setConfig({constants:o.default,cea608parser:a.default,errHandler:Le,BASE64:H.default}),(Fe=Fe||(0,h.default)(pe).create()).setConfig({adapter:Oe}),(Ke=(0,L.default)(pe).getInstance({dashMetrics:$e,mediaPlayerModel:Pe,errHandler:Le,baseURLController:Fe,events:R.default,eventBus:ge,debug:ve,boxParser:(0,W.default)(pe).getInstance(),requestModifier:(0,y.default)(pe).getInstance(),errors:x.default})).initialize(),X(),K(void 0===i||i),oe(),e&&Z(e),n&&te(n),_e.info("[dash.js "+t()+"] MediaPlayer has been initialized")):Le.error(new q.default(x.default.CAPABILITY_MEDIASOURCE_ERROR_CODE,x.default.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(je=e.capabilities),e.streamController&&(Be=e.streamController),e.gapController&&(Ue=e.gapController),e.playbackController&&(He=e.playbackController),e.mediaPlayerModel&&(Pe=e.mediaPlayerModel),e.abrController&&(ke=e.abrController),e.schemeLoaderFactory&&(Ie=e.schemeLoaderFactory),e.mediaController&&(xe=e.mediaController),e.settings&&(me=e.settings))},on:function(e,t,n){ge.on(e,t,n)},off:function(e,t,n){ge.off(e,t,n)},extend:function(e,t,n){N.default.extend(e,t,n,pe)},attachView:Z,attachSource:te,isReady:e,preload:function(){if(Ve.getElement()||Te)return!1;if(!be)throw fe;le()},play:function(){if(!Se)throw ce;(!Ce||n()&&Se)&&He.play()},isPaused:n,pause:function(){if(!Se)throw ce;He.pause()},isSeeking:function(){if(!Se)throw ce;return He.isSeeking()},isDynamic:function(){if(!Se)throw ce;return He.getIsDynamic()},seek:function(e){if(!Se)throw ce;if((0,z.checkParameterType)(e,"number"),isNaN(e))throw o.default.BAD_ARGUMENT_ERROR;var t=He.getIsDynamic()?i(e):e;He.seek(t)},setPlaybackRate:function(e){J().playbackRate=e},getPlaybackRate:function(){return J().playbackRate},setMute:function(e){(0,z.checkParameterType)(e,"boolean"),J().muted=e},isMuted:function(){return J().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||1<e)throw o.default.BAD_ARGUMENT_ERROR;J().volume=e},getVolume:function(){return J().volume},time:r,duration:Y,timeAsUTC:function(){if(!Se)throw ce;return r()<0?NaN:se(r())},durationAsUTC:function(){if(!Se)throw ce;return se(Y())},getActiveStream:ne,getDVRWindowSize:function(){var e=$e.getCurrentDVRInfo();return e?e.manifestInfo.DVRWindowSize:0},getDVRSeekOffset:i,convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),i=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(i<10?"0"+i.toString():i.toString())},formatUTC:function(e,t,n){var i=!(arguments.length<=3||void 0===arguments[3])&&arguments[3],r=new Date(1e3*e),a=r.toLocaleDateString(t),o=r.toLocaleTimeString(t,{hour12:n});return i?o+" "+a:o},getVersion:t,getDebug:function(){return ve},getBufferLength:function(e){var t,n=[o.default.VIDEO,o.default.AUDIO,o.default.FRAGMENTED_TEXT];return e?-1===n.indexOf(e)?(_e.warn("getBufferLength requested for invalid type"),NaN):(t=$e.getCurrentBufferLevel(e))||NaN:(t=n.map((function(e){return 0<ee(e).length?$e.getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)})))===Number.MAX_VALUE?NaN:t},getTTMLRenderingDiv:function(){return Ve?Ve.getTTMLRenderingDiv():null},getVideoElement:J,getSource:function(){if(!be)throw fe;return be},getCurrentLiveLatency:function(){if(!we)throw he;return Se?He.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!Te)throw de;return ke.getTopBitrateInfoFor(e)},setAutoPlay:K,getAutoPlay:function(){return Ce},getDashMetrics:Q,getQualityFor:function(e){if(!Te)throw de;if(e!==o.default.IMAGE)return ke.getQualityFor(e);var t=ne();if(!t)return-1;var n=t.getThumbnailController();return n?n.getCurrentTrackIndex():-1},setQualityFor:function(e,t){if(!Te)throw de;if(e===o.default.IMAGE){var n=ne();if(!n)return;var i=n.getThumbnailController();i&&i.setTrackByIndex(t)}ke.setPlaybackQuality(e,Be.getActiveStreamInfo(),t)},updatePortalSize:function(){ke.setElementSize(),ke.setWindowResizeEventCalled(!0)},setTextDefaultLanguage:function(e){_e.warn('setTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use setInitialMediaSettingsFor("fragmentedText", { lang: lang }) instead'),void 0===Ge&&(Ge=(0,_.default)(pe).getInstance()),
Ge.setTextDefaultLanguage(e)},getTextDefaultLanguage:function(){return _e.warn('getTextDefaultLanguage is deprecated and will be removed in version 3.2.0. Please use getInitialMediaSettingsFor("fragmentedText").lang instead'),void 0===Ge&&(Ge=(0,_.default)(pe).getInstance()),Ge.getTextDefaultLanguage()},setTextDefaultEnabled:function(e){void 0===Ge&&(Ge=(0,_.default)(pe).getInstance()),Ge.setTextDefaultEnabled(e)},getTextDefaultEnabled:function(){return void 0===Ge&&(Ge=(0,_.default)(pe).getInstance()),Ge.getTextDefaultEnabled()},enableText:function(e){void 0===Ge&&(Ge=(0,_.default)(pe).getInstance()),Ge.enableText(e)},enableForcedTextStreaming:function(e){void 0===Ge&&(Ge=(0,_.default)(pe).getInstance()),Ge.enableForcedTextStreaming(e)},isTextEnabled:function(){return void 0===Ge&&(Ge=(0,_.default)(pe).getInstance()),Ge.isTextEnabled()},setTextTrack:function(e){if(!Se)throw ce;void 0===Ge&&(Ge=(0,_.default)(pe).getInstance()),Ge.setTextTrack(e)},getBitrateInfoListFor:function(e){if(!Te)throw de;var t=ne();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!Te)throw de;return Oe.getStreamsInfo(e)},getTracksFor:ee,getTracksForTypeFromManifest:function(e,t,n){if(!Te)throw de;return(n=n||Oe.getStreamsInfo(t,1)[0])?Oe.getAllMediaInfoForType(n,e,t):[]},getCurrentTrackFor:function(e){if(!Te)throw de;var t=Be.getActiveStreamInfo();return xe.getCurrentTrackFor(e,t)},setInitialMediaSettingsFor:function(e,t){if(!we)throw he;xe.setInitialSettings(e,t),e===o.default.FRAGMENTED_TEXT&&Ge.setInitialSettings(t)},getInitialMediaSettingsFor:function(e){if(!we)throw he;return xe.getInitialSettings(e)},setCurrentTrack:function(e){if(!Te)throw de;xe.setTrack(e)},getTrackSwitchModeFor:function(e){if(!we)throw he;return xe.getSwitchMode(e)},setTrackSwitchModeFor:function(e,t){if(!we)throw he;xe.setSwitchMode(e,t)},setSelectionModeForInitialTrack:function(e){if(!we)throw he;xe.setSelectionModeForInitialTrack(e)},getSelectionModeForInitialTrack:function(){if(!we)throw he;return xe.getSelectionModeForInitialTrack()},addABRCustomRule:function(e,t,n){Pe.addABRCustomRule(e,t,n)},removeABRCustomRule:function(e){Pe.removeABRCustomRule(e)},removeAllABRCustomRule:function(){Pe.removeABRCustomRule()},getAverageThroughput:function(e){var t=ke.getThroughputHistory();return t?t.getAverageThroughput(e):0},retrieveManifest:function(e,t){var n=re(),i=this;ge.on(R.default.INTERNAL_MANIFEST_LOADED,(function e(r){r.error?t(null,r.error):t(r.manifest),ge.off(R.default.INTERNAL_MANIFEST_LOADED,e,i),n.reset()}),i),We.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){Pe.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){Pe.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){Pe.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:X,setXHRWithCredentialsForType:function(e,t){Pe.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return Pe.getXHRWithCredentialsForType(e)},getProtectionController:ae,attachProtectionController:function(e){De=e},setProtectionData:function(e){Ee=e,Be&&Be.setProtectionData(Ee)},displayCaptionsOnTop:function(e){var t=(0,v.default)(pe).getInstance();t.setConfig({videoModel:Ve}),t.initialize(),t.setDisplayCConTop(e)},attachTTMLRenderingDiv:function(e){if(!Ve.getElement())throw ue;Ve.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=NaN;return Ge&&(e=Ge.getCurrentTrackIdx()),e},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=He.getIsDynamic()?i(e):e,r=Be.getStreamForTime(n);if(null!==r){var a=r.getThumbnailController();if(a){var o=Be.getTimeRelativeToStreamId(n,r.getId());return a.provide(o,t)}t(null)}else t(null)}},getDashAdapter:function(){return Oe},getOfflineController:oe,getSettings:function(){return me.get()},updateSettings:function(e){me.update(e)},resetSettings:function(){me.reset()},reset:function(){te(null),Z(null),Ee=null,De&&(De.reset(),De=null),Re&&(Re.reset(),Re=null),Ke.reset(),me.reset(),Ne&&(Ne.reset(),Ne=null)}},_e=ve.getLogger(ye),Ce=!(Te=Se=we=!1),Ke=Oe=Ee=Ne=De=null,R.default.extend(M.default),Pe=(0,w.default)(pe).getInstance(),Ve=(0,C.default)(pe).getInstance(),We=(0,b.default)(pe).getInstance(),ye}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(2)),o=i(e(108)),s=i(e(61)),l=i(e(109)),d=i(e(120)),c=i(e(122)),u=i(e(117)),f=i(e(118)),h=i(e(112)),p=i(e(98)),g=i(e(213)),m=i(e(208)),v=i(e(203)),y=i(e(218)),_=i(e(201)),b=i(e(154)),E=i(e(151)),w=i(e(152)),T=i(e(111)),S=i(e(158)),C=i(e(155)),k=i(e(149)),I=i(e(210)),A=i(e(45)),x=i(e(51)),D=i(e(46)),R=i(e(54)),M=i(e(101)),N=i(e(47)),O=i(e(48)),P=e(50),L=i(e(63)),F=i(e(56)),j=i(e(58)),B=i(e(82)),U=e(242),H=i(e(1)),$=i(e(9)),q=i(e(226)),z=e(219),V=i(e(99)),G=i(e(221)),W=i(e(207));r.__dashjs_factory_name="MediaPlayer";var Y=N.default.getClassFactory(r);Y.events=M.default,Y.errors=x.default,N.default.updateClassFactory(r.__dashjs_factory_name,Y),n.default=Y,t.exports=n.default},{1:1,101:101,108:108,109:109,111:111,112:112,117:117,118:118,120:120,122:122,149:149,151:151,152:152,154:154,155:155,158:158,2:2,201:201,203:203,207:207,208:208,210:210,213:213,218:218,219:219,221:221,226:226,242:242,45:45,46:46,47:47,48:48,50:50,51:51,54:54,56:56,58:58,61:61,63:63,82:82,9:9,98:98,99:99}],101:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).call(this),this.AST_IN_FUTURE="astInFuture",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_LOADED="bufferLoaded",this.BUFFER_LEVEL_STATE_CHANGED="bufferStateChanged",this.ERROR="error",this.FRAGMENT_LOADING_COMPLETED="fragmentLoadingCompleted",this.FRAGMENT_LOADING_PROGRESS="fragmentLoadingProgress",this.FRAGMENT_LOADING_STARTED="fragmentLoadingStarted",this.FRAGMENT_LOADING_ABANDONED="fragmentLoadingAbandoned",this.LOG="log",this.MANIFEST_LOADED="manifestLoaded",this.METRICS_CHANGED="metricsChanged",this.METRIC_CHANGED="metricChanged",this.METRIC_ADDED="metricAdded",this.METRIC_UPDATED="metricUpdated",this.PERIOD_SWITCH_COMPLETED="periodSwitchCompleted",this.PERIOD_SWITCH_STARTED="periodSwitchStarted",this.QUALITY_CHANGE_REQUESTED="qualityChangeRequested",this.QUALITY_CHANGE_RENDERED="qualityChangeRendered",this.TRACK_CHANGE_RENDERED="trackChangeRendered",this.SOURCE_INITIALIZED="sourceInitialized",this.STREAM_INITIALIZING="streamInitializing",this.STREAM_UPDATED="streamUpdated",this.STREAM_INITIALIZED="streamInitialized",this.STREAM_TEARDOWN_COMPLETE="streamTeardownComplete",this.TEXT_TRACKS_ADDED="allTextTracksAdded",this.TEXT_TRACK_ADDED="textTrackAdded",this.TTML_PARSED="ttmlParsed",this.TTML_TO_PARSE="ttmlToParse",this.CAPTION_RENDERED="captionRendered",this.CAPTION_CONTAINER_RESIZE="captionContainerResize",this.CAN_PLAY="canPlay",this.PLAYBACK_ENDED="playbackEnded",this.PLAYBACK_ERROR="playbackError",this.PLAYBACK_NOT_ALLOWED="playbackNotAllowed",this.PLAYBACK_METADATA_LOADED="playbackMetaDataLoaded",this.PLAYBACK_PAUSED="playbackPaused",this.PLAYBACK_PLAYING="playbackPlaying",this.PLAYBACK_PROGRESS="playbackProgress",this.PLAYBACK_RATE_CHANGED="playbackRateChanged",this.PLAYBACK_SEEKED="playbackSeeked",this.PLAYBACK_SEEKING="playbackSeeking",this.PLAYBACK_SEEK_ASKED="playbackSeekAsked",this.PLAYBACK_STALLED="playbackStalled",this.PLAYBACK_STARTED="playbackStarted",this.PLAYBACK_TIME_UPDATED="playbackTimeUpdated",this.PLAYBACK_WAITING="playbackWaiting",this.MANIFEST_VALIDITY_CHANGED="manifestValidityChanged",this.GAP_CAUSED_SEEK_TO_PERIOD_END="gapCausedSeekToPeriodEnd"}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=new(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,((r=e(55))&&r.__esModule?r:{default:r}).default),i);n.default=o,t.exports=n.default},{55:55}],102:[function(e,t,n){"use strict";function i(e,t,n){if(!e||!/^VIDEO$/i.test(e.nodeName))return null;if(e._dashjs_player)return e._dashjs_player;var i=void 0,r=e.id||e.name||"video element";if(!(t=t||[].slice.call(e.querySelectorAll("source")).filter((function(e){return e.type==a}))[0])&&e.src)(t=document.createElement("source")).src=e.src;else if(!t&&!e.src)return null;return n=n||{},(i=(0,s.default)(n).create()).initialize(e,t.src,e.autoplay),(o=o||i.getDebug().getLogger()).debug("Converted "+r+" to dash.js player and added content: "+t.src),e._dashjs_player=i}Object.defineProperty(n,"__esModule",{value:!0});var r,a,o,s=(r=e(100))&&r.__esModule?r:{default:r},l=(a="application/dash+xml",{create:i,createAll:function(e,t){var n=[];e=e||"[data-dashjs-player]";for(var r=(t=t||document).querySelectorAll(e),o=0;o<r.length;o++){var s=i(r[o],null);n.push(s)}var l=t.querySelectorAll('source[type="'+a+'"]');for(o=0;o<l.length;o++)s=i(function(e){for(var t=!0;t;){var n=e;if(t=!1,/^VIDEO$/i.test(n.nodeName))return n;e=n.parentNode,t=!0}}(l[o]),null),n.push(s);return n}}),d=o=void 0;"undefined"!=typeof window&&window&&window.dashjs&&window.dashjs.skipAutoCreate||"undefined"==typeof window||!window||!window.addEventListener||("complete"===window.document.readyState?window.dashjs?l.createAll():d=window.setInterval((function(){window.dashjs&&(window.clearInterval(d),l.createAll())}),500):window.addEventListener("load",(function e(){window.removeEventListener("load",e),l.createAll()}))),n.default=l,t.exports=n.default},{100:100}],103:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e,t){s=s.filter((function(n){return!((isNaN(t)||n.start<t)&&(isNaN(e)||n.end>e))}))}var n=this.context,i=void 0,r=void 0,o=void 0,s=[],l=e;return i={getAllBufferRanges:function(){for(var e=[],t=0;t<s.length;t++){var n=s[t];0===e.length||n.start>e[e.length-1].end?e.push({start:n.start,end:n.end}):e[e.length-1].end=n.end}var i={start:function(t){return e[t].start},end:function(t){return e[t].end}};return Object.defineProperty(i,"length",{get:function(){return e.length}}),i},append:function(e){o="InitializationSegment"!==e.segmentType?(s.push(e),s.sort((function(e,t){return e.start-t.start})),null):e,r.debug("PreBufferSink appended chunk s: "+e.start+"; e: "+e.end),l&&l({chunk:e})},remove:t,abort:function(){},discharge:function(e,n){var i,r,a=(i=e,r=n,s.filter((function(e){return(isNaN(r)||e.start<r)&&(isNaN(i)||e.end>i)})));return o&&(a.push(o),o=null),t(e,n),a},reset:function(){s=[],l=o=null},updateTimestampOffset:function(){},hasDiscontinuitiesAfter:function(){return!1},waitForUpdateEnd:function(e){e()},getBuffer:function(){return this}},r=(0,a.default)(n).getInstance().getLogger(i),i}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(45)),o=i(e(47));r.__dashjs_factory_name="PreBufferSink";var s=o.default.getClassFactory(r);n.default=s,t.exports=n.default},{45:45,47:47}],104:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n,i){function r(){try{return w.buffered}catch(e){return E.error("getAllBufferRanges exception: "+e.message),null}}function d(n){w&&v((function(){try{var i=e.duration,r=0;n&&!isNaN(n.start)&&!isNaN(n.duration)&&isFinite(n.duration)&&(i=n.start+n.duration),n&&!isNaN(n.start)&&(r=n.start),w.appendWindowStart=0,w.appendWindowEnd=i,w.appendWindowStart=r,E.debug("Updated append window for "+t.type+". Set start to "+w.appendWindowStart+" and end to "+w.appendWindowEnd)}catch(i){E.warn("Failed to set append window")}}))}function f(){var e=this,t=this;0<k.length&&function(){function n(){var e,n,o,s,d=r();e=t,o=d,s=i,(n=a)&&0<n.length&&n.length<o.length&&function(e,t){for(var n=0;n<e.length;n++){var i=Math.round(e.start(n)),r=Math.round(e.end(n));if(r===t.start||i===t.end||t.start>=i&&t.end<=r)return!0}return!1}(n,s)&&_.trigger(l.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:e,from:o.end(o.length-2),to:o.start(o.length-1),unintended:!0}),0<k.length?f.call(this):(T=!1,I&&I({chunk:i}))}T=!0;var i=k[0];k.splice(0,1);var a=[];try{0===i.bytes.length?n.call(e):(a=r(),w.appendBuffer?w.appendBuffer(i.bytes):w.append(i.bytes,i),v(n.bind(e)))}catch(n){E.fatal('SourceBuffer append failed "'+n+'"'),0<k.length?f():T=!1,I&&I({chunk:i,error:new o.default(n.code,n.message)})}}()}function h(){var e;0<C.length&&(e=C.shift(),w.updating?v(e):(e(),h()))}function p(){w.updating||h()}function g(){w.updating||h()}function m(){E.error("SourceBufferSink error",t.type)}function v(e){C.push(e),w.updating||h()}var y=this.context,_=(0,s.default)(y).getInstance(),b=void 0,E=void 0,w=void 0,T=void 0,S=void 0,C=[],k=[],I=n;return b={getAllBufferRanges:r,getBuffer:function(){return w},append:function(e){e?(k.push(e),T||v(f.bind(this))):I({chunk:e,error:new o.default(u.default.APPEND_ERROR_CODE,u.default.APPEND_ERROR_MESSAGE)})},remove:function(t,n,i){var r=this;v((function(){try{0<=t&&t<n&&(i||"ended"!==e.readyState)&&w.remove(t,n),v((function(){_.trigger(l.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:r,from:t,to:n,unintended:!1})}))}catch(e){_.trigger(l.default.SOURCEBUFFER_REMOVE_COMPLETED,{buffer:r,from:t,to:n,unintended:!1,error:new o.default(e.code,e.message)})}}))},abort:function(){try{("open"===e.readyState||w.setTextTrack&&"ended"===e.readyState)&&w.abort()}catch(e){E.error('SourceBuffer append abort failed: "'+e+'"')}k=[]},reset:function(t){if(w){if("function"==typeof w.removeEventListener&&(w.removeEventListener("updateend",g,!1),w.removeEventListener("error",m,!1),w.removeEventListener("abort",m,!1)),clearInterval(S),C=[],!t){try{w.getClassName&&"TextSourceBuffer"===w.getClassName()||(E.debug("Removing sourcebuffer from media source"),e.removeSourceBuffer(w))}catch(t){E.error("Failed to remove source buffer from media source.")}w=null}T=!1}k=[],I=null},updateTimestampOffset:function(e){w.timestampOffset===e||isNaN(e)||v((function(){e<0&&(e+=.001),w.timestampOffset=e}))},hasDiscontinuitiesAfter:function(e){try{var t=r();if(t&&1<t.length)for(var n=0,i=t.length;n<i;n++)if(0<n&&e<t.start(n)&&t.start(n)>t.end(n-1)+.1)return!0}catch(e){E.error("hasDiscontinuities exception: "+e.message)}return!1},waitForUpdateEnd:v,updateAppendWindow:d},function(){E=(0,a.default)(y).getInstance().getLogger(b),T=!1;var n=t.codec;try{if(n.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))throw new Error("not really supported");if((w=i||e.addSourceBuffer(n)).changeType&&i&&(E.debug("Doing period transition with changeType"),w.changeType(n)),d(),"function"==typeof w.addEventListener)try{w.addEventListener("updateend",g,!1),w.addEventListener("error",m,!1),w.addEventListener("abort",m,!1)}catch(e){S=setInterval(p,50)}else S=setInterval(p,50)}catch(e){if(!t.isText&&-1===n.indexOf('codecs="stpp')&&-1===n.indexOf('codecs="wvtt'))throw e;var r=(0,c.default)(y).getInstance();w=r.getTextSourceBuffer()}}(),b}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(45)),o=i(e(226)),s=i(e(46)),l=i(e(54)),d=i(e(47)),c=i(e(201)),u=i(e(51));r.__dashjs_factory_name="SourceBufferSink";var f=d.default.getClassFactory(r);n.default=f,t.exports=n.default},{201:201,226:226,45:45,46:46,47:47,51:51,54:54}],105:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){for(var t=oe?oe.length:0,n=0;n<t;n++)oe[n].getFragmentModel().removeExecutedRequestsBeforeTime(p()+r()),oe[n].reset(!1,e);F(de=le=!(oe=[])),U.off(u.default.CURRENT_TRACK_CHANGED,T,ie)}function n(){t(),ae=null,ue=ce=se=!1,Ee=_e=he=!(fe={})}function i(){Q&&Q.pause(),ge&&(ge.reset(),ge=null),n(),U.off(u.default.DATA_UPDATE_COMPLETED,D,ie),U.off(u.default.BUFFERING_COMPLETED,x,ie),U.off(u.default.INBAND_EVENTS,R,ie),pe&&(U.off(u.default.KEY_ERROR,E,ie),U.off(u.default.SERVER_CERTIFICATE_UPDATED,E,ie),U.off(u.default.LICENSE_REQUEST_COMPLETE,E,ie),U.off(u.default.KEY_SYSTEM_SELECTED,E,ie),U.off(u.default.KEY_SESSION_CREATED,E,ie),U.off(u.default.KEY_STATUSES_CHANGED,E,ie)),F(!1)}function r(){return ae?ae.duration:NaN}function p(){return ae?ae.start:NaN}function y(){return ae?ae.id:null}function _(){return ae}function b(){if(!(te&&X&&X.hasOwnProperty("getBitrateList")&&V&&V.hasOwnProperty("getAllMediaInfoForType")&&V.hasOwnProperty("getEventsFor")))throw new Error(a.default.MISSING_CONFIG_ERROR)}function E(e){e.error&&(W.error(e.error),re.fatal(e.error.message),i())}function w(e){var t,n=e?e.type:null,i=void 0;if(n===a.default.MUXED)return i="Multiplexed representations are intentionally not supported, as they are not compliant with the DASH-AVC/264 guidelines",re.fatal(i),void W.error(new g.default(h.default.MANIFEST_ERROR_ID_MULTIPLEXED_CODE,i,$.getValue()));if(n===a.default.TEXT||n===a.default.FRAGMENTED_TEXT||n===a.default.EMBEDDED_TEXT||n===a.default.IMAGE)return 1;if(t=e.codec,re.debug(n+" codec: "+t),e.contentProtection&&!G.supportsEncryptedMedia())W.error(new g.default(h.default.CAPABILITY_MEDIAKEYS_ERROR_CODE,h.default.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE));else if(!G.supportsCodec(t))return i=n+"Codec ("+t+") is not supported.",void re.error(i);return 1}function T(e){var t,n,i,r;ae&&e.newMediaInfo.streamInfo.id===ae.id&&(t=e.newMediaInfo,n=$.getValue(),V.setCurrentMediaInfo(ae.id,t.type,t),(i=M(t))&&(r=Q.getTime(),re.info("Stream -  Process track changed at current time "+r),re.debug("Stream -  Update stream controller"),n.refreshManifestOnSwitchTrack?(re.debug("Stream -  Refreshing manifest for switch track"),we=e,z.refreshManifest()):(i.selectMediaInfo(t),t.type!==a.default.FRAGMENTED_TEXT?(X.updateTopQualityIndex(t),i.switchTrackAsked(),i.getFragmentModel().abortRequests()):(i.getScheduleController().setSeekTarget(r),i.setBufferingTime(r),i.resetIndexHandler()))))}function S(t,n){var i,r=V.getAllMediaInfoForType(ae,t),l=null;if(r&&0!==r.length){t===a.default.VIDEO&&(ce=!0),t===a.default.AUDIO&&(ue=!0);for(var c=0,f=r.length;c<f;c++)if(l=r[c],t===a.default.EMBEDDED_TEXT)ee.addEmbeddedTrack(l);else{if(!w(l))continue;Z.addTrack(l)}t!==a.default.EMBEDDED_TEXT&&0!==Z.getTracksFor(t,ae).length&&(t!==a.default.IMAGE?(Z.checkInitialMediaSettingsForType(t,ae),i=Z.getCurrentTrackFor(t,ae),U.trigger(u.default.STREAM_INITIALIZING,{streamInfo:ae,mediaInfo:l}),function(t,n,i,r){var o=ge.getModel(y(),t?t.type:null),l=(0,s.default)(B).create({streamInfo:ae,type:t?t.type:null,mimeType:t?t.mimeType:null,timelineConverter:Y,adapter:V,manifestModel:$,mediaPlayerModel:q,fragmentModel:o,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,abrController:X,playbackController:Q,mediaController:Z,textController:ee,errHandler:W,settings:ne,boxParser:ye});if(l.initialize(i,ce),X.updateTopQualityIndex(t),r?(l.setBuffer(r.buffer),l.setBufferingTime(r.currentTime),oe[r.replaceIdx]=l):oe.push(l),!r||!r.ignoreMediaInfo)if(!t||t.type!==a.default.TEXT&&t.type!==a.default.FRAGMENTED_TEXT)l.addMediaInfo(t,!0);else{for(var d=void 0,c=0;c<n.length;c++)n[c].index===t.index&&(d=c),l.addMediaInfo(n[c]);l.selectMediaInfo(n[d])}}(i,r,n)):me=(0,d.default)(B).create({streamInfo:ae,adapter:V,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:be,eventBus:U,events:u.default,dashConstants:o.default}))}else re.info("No "+t+" data.")}function C(){var e;J&&(e=V.getEventsFor(ae),J.addInlineEvents(e))}function k(e){var t=V.getAdaptationForType(ae?ae.index:null,e,ae);t&&Array.isArray(t.Representation_asArray)&&(t.Representation_asArray=t.Representation_asArray.filter((function(e,n){if(0===n)return!0;var i=V.getCodec(t,n,!0);return!!G.supportsCodec(i)||(re.error("[Stream] codec not supported: "+i),!1)})))}function I(){for(var e=oe.length,t=fe.audio||fe.video?new g.default(h.default.DATA_UPDATE_FAILED_ERROR_CODE,h.default.DATA_UPDATE_FAILED_ERROR_MESSAGE):null,n=0;n<e;n++)if(oe[n].isUpdating()||he)return;if(de){if(pe)for(n=0;n<e&&oe[n];n++)oe[n].getType()!==a.default.AUDIO&&oe[n].getType()!==a.default.VIDEO&&oe[n].getType()!==a.default.FRAGMENTED_TEXT||pe.initializeForMedia(oe[n].getMediaInfo());for(t?W.error(t):se||(se=!0,Y.setTimeSyncCompleted(!0),U.trigger(u.default.STREAM_INITIALIZED,{streamInfo:ae,liveStartTime:ve?NaN:function(){if(!ae.manifestInfo.isDynamic)return NaN;for(var e=0;e<oe.length;e++)if(oe[e].getType()===a.default.AUDIO||oe[e].getType()===a.default.VIDEO)return oe[e].getLiveStartTime();return NaN}()})),n=0;n<e&&oe[n];n++)oe[n].getScheduleController().start()}}function A(e){for(var t={},n=0,i=oe.length;n<i;n++){var r=oe[n].createBuffer(e);r&&(t[oe[n].getType()]=r.getBuffer())}return t}function x(e){if(e.streamId===ae.id){var t=N(),n=t.length;if(0!==n){for(var i=0;i<n;i++)if(!t[i].isBufferingCompleted()&&(t[i].getType()===a.default.AUDIO||t[i].getType()===a.default.VIDEO))return void re.warn("onBufferingCompleted - One streamProcessor has finished but",t[i].getType(),"one is not buffering completed");re.debug("onBufferingCompleted - trigger STREAM_BUFFERING_COMPLETED"),U.trigger(u.default.STREAM_BUFFERING_COMPLETED,{streamInfo:ae})}else re.warn("onBufferingCompleted - can't trigger STREAM_BUFFERING_COMPLETED because no streamProcessor is defined")}}function D(e){ae&&e.sender.getStreamId()===ae.id&&(fe[e.sender.getType()]=e.error,I())}function R(e){var t;ae&&e.sender.getStreamInfo().id===ae.id&&(t=e.events,J&&J.addInbandEvents(t))}function M(e){return e?N().filter((function(t){return t.getType()===e.type}))[0]:null}function N(){for(var e=[],t=void 0,n=void 0,i=0;i<oe.length;i++)(t=(n=oe[i]).getType())!==a.default.AUDIO&&t!==a.default.VIDEO&&t!==a.default.FRAGMENTED_TEXT&&t!==a.default.TEXT||e.push(n);return e}function O(e,t,n){var i=arguments.length<=2||void 0===n?null:n;if(!e)return!1;var r=e.getStreamInfo(),a=i?i.getStreamInfo():ae;if(!r||!a)return!1;var o=V.getAdaptationForType(r.index,t,r),s=V.getAdaptationForType(a.index,t,a);return o&&s?!(!P(s)&&P(o)):!o&&!s}function P(e){return e&&(e.ContentProtection||e.Representation&&0<e.Representation.length&&e.Representation[0].ContentProtection)}function L(e,t,n){var i=arguments.length<=2||void 0===n?null:n;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),a=i?i.getStreamInfo():ae;if(!r||!a)return!1;var o=V.getAdaptationForType(r.index,t,r),s=V.getAdaptationForType(a.index,t,a);if(!o||!s)return!o&&!s;var l=o&&s&&o.mimeType===s.mimeType,d=s.Representation_asArray.map((function(e){return e.codecs})),c=o.Representation_asArray.map((function(e){return e.codecs})),u=c.some((function(e){return-1<d.indexOf(e)})),f=c.some((function(e){return d.some((function(t){return function(e,t){for(var n=e.split(".")[0],i=0===t.indexOf(n),r=void 0,a=0;a<Te.length;a++)if(Te[a].codec===n){r=Te[a];break}return r?i||r.compatibleCodecs.some((function(e){return 0===t.indexOf(e)})):i}(t,e)}))}));return u||f&&l}function F(e){ve=e}function j(){return ve}e=e||{};var B=this.context,U=(0,c.default)(B).getInstance(),H=(0,v.default)(B).getInstance(),$=e.manifestModel,q=e.mediaPlayerModel,z=e.manifestUpdater,V=e.adapter,G=e.capabilities,W=e.errHandler,Y=e.timelineConverter,K=e.dashMetrics,X=e.abrController,Q=e.playbackController,J=e.eventController,Z=e.mediaController,ee=e.textController,te=e.videoModel,ne=e.settings,ie=void 0,re=void 0,ae=void 0,oe=void 0,se=void 0,le=void 0,de=void 0,ce=void 0,ue=void 0,fe=void 0,he=void 0,pe=void 0,ge=void 0,me=void 0,ve=void 0,ye=void 0,_e=void 0,be=void 0,Ee=void 0,we=void 0,Te=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];return ie={initialize:function(e,t){(ae=e)&&ge.setStreamId(e.id),(pe=t)&&(U.on(u.default.KEY_ERROR,E,ie),U.on(u.default.SERVER_CERTIFICATE_UPDATED,E,ie),U.on(u.default.LICENSE_REQUEST_COMPLETE,E,ie),U.on(u.default.KEY_SYSTEM_SELECTED,E,ie),U.on(u.default.KEY_SESSION_CREATED,E,ie),U.on(u.default.KEY_STATUSES_CHANGED,E,ie)),U.trigger(u.default.STREAM_UPDATED,{streamInfo:ae})},activate:function(e,t){if(le)return t;var n=void 0;return U.on(u.default.CURRENT_TRACK_CHANGED,T,ie),n=ve?(function(){var e;he=!0,b(),k(a.default.VIDEO),k(a.default.AUDIO),he=!(de=!0),0===oe.length?(e="No streams to play.",W.error(new g.default(h.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e,$.getValue())),re.debug(e)):I()}(),t):function(e,t){b();var n=te.getElement();C(),he=!0,k(a.default.VIDEO),k(a.default.AUDIO),(!n||n&&/^VIDEO$/i.test(n.nodeName))&&S(a.default.VIDEO,e),S(a.default.AUDIO,e),S(a.default.TEXT,e),S(a.default.FRAGMENTED_TEXT,e),S(a.default.EMBEDDED_TEXT,e),S(a.default.MUXED,e),S(a.default.IMAGE,e);var i,r=A(t);return he=!(de=!0),0===oe.length?(i="No streams to play.",W.error(new g.default(h.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,i,$.getValue())),re.fatal(i)):I(),r}(e,t),le=!0,n},deactivate:t,isActive:function(){return le},getDuration:r,getStartTime:p,getId:y,getStreamInfo:_,getHasAudioTrack:function(){return ue},getHasVideoTrack:function(){return ce},preload:function(e,t){if(!ve){C(),S(a.default.VIDEO,e),S(a.default.AUDIO,e),S(a.default.TEXT,e),S(a.default.FRAGMENTED_TEXT,e),S(a.default.EMBEDDED_TEXT,e),S(a.default.MUXED,e),S(a.default.IMAGE,e),A(t),U.on(u.default.CURRENT_TRACK_CHANGED,T,ie);for(var n=0;n<oe.length&&oe[n];n++)oe[n].getScheduleController().start();F(!0)}},getThumbnailController:function(){return me},getBitrateListFor:function(e){if(b(),e===a.default.IMAGE)return me?me.getBitrateList():[];var t=function(e){for(var t=null,n=0;n<oe.length;n++)if((t=oe[n]).getType()===e)return t.getMediaInfo();return null}(e);return X.getBitrateList(t)},updateData:function(e){re.info("Manifest updated... updating data system wide."),he=!(le=!1),ae=e,U.trigger(u.default.STREAM_UPDATED,{streamInfo:ae}),J&&C(),k(a.default.VIDEO),k(a.default.AUDIO);for(var t=0,n=oe.length;t<n;t++){var i=oe[t];i.updateStreamInfo(ae);var r=V.getMediaInfoForType(ae,i.getType());X.updateTopQualityIndex(r),i.addMediaInfo(r,!0)}if(we&&(r=we.newMediaInfo).type!==a.default.FRAGMENTED_TEXT){var o=M(we.oldMediaInfo);if(!o)return;o.switchTrackAsked(),we=void 0}he=!1,I()},reset:i,getProcessors:N,setMediaSource:function(e){for(var t=0;t<oe.length;)w(oe[t].getMediaInfo())?(oe[t].setMediaSource(e),t++):(oe[t].reset(),oe.splice(t,1));var n;for(t=0;t<oe.length;t++)oe[t].dischargePreBuffer();0===oe.length&&(n="No streams to play.",W.error(new g.default(h.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,n+"nostreams",$.getValue())),re.fatal(n))},isMediaCodecCompatible:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return L(e,a.default.VIDEO,t)&&L(e,a.default.AUDIO,t)},isProtectionCompatible:function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];return O(e,a.default.VIDEO,t)&&O(e,a.default.AUDIO,t)},getPreloaded:j,getPreloadingScheduled:function(){return _e},setPreloadingScheduled:function(e){_e=e},getIsEndedEventSignaled:function(){return Ee},setIsEndedEventSignaled:function(e){Ee=e}},be=(0,f.default)(B).getInstance(),re=be.getLogger(ie),n(),ye=(0,m.default)(B).getInstance(),ge=(0,l.default)(B).create({mediaPlayerModel:q,dashMetrics:K,errHandler:W,settings:ne,boxParser:ye,dashConstants:o.default,urlUtils:H}),U.on(u.default.BUFFERING_COMPLETED,x,ie),U.on(u.default.DATA_UPDATE_COMPLETED,D,ie),U.on(u.default.INBAND_EVENTS,R,ie),ie}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(61)),s=i(e(106)),l=i(e(116)),d=i(e(204)),c=i(e(46)),u=i(e(54)),f=i(e(45)),h=i(e(51)),p=i(e(47)),g=i(e(226)),m=i(e(207)),v=i(e(221));r.__dashjs_factory_name="Stream",n.default=p.default.getClassFactory(r),t.exports=n.default},{106:106,108:108,116:116,204:204,207:207,221:221,226:226,45:45,46:46,47:47,51:51,54:54,61:61}],106:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){se=[],oe=null,he=0}function n(e){e.sender.getType()===$&&e.sender.getStreamId()===H.id&&(e.error||de.setCurrentRepresentation(G.convertDataToRepresentationInfo(e.currentRepresentation)),e.error&&e.error.code!==_.default.SEGMENTS_UPDATE_FAILED_ERROR_CODE||Q.getStreamController().getActiveStreamInfo().id===H.id&&A())}function i(e){var t;$===e.mediaType&&H.id===e.streamInfo.id&&(t=N(e.newQuality),de.setCurrentRepresentation(t),ee.pushPlayListTraceMetrics(new Date,k.PlayListTrace.REPRESENTATION_SWITCH_STOP_REASON),ee.createPlaylistTraceMetrics(t.id,1e3*Q.getTime(),Q.getPlaybackRate()))}function r(e){var t;e.streamId===H.id&&e.mediaType===$&&(ee.addBufferLevel($,new Date,1e3*e.bufferLevel),t=Q.getStreamController().getActiveStreamInfo().id,W.getValue().doNotUpdateDVRWindowOnBufferUpdated||H.id!==t||A())}function p(e){e.streamId===H.id&&e.mediaType===$&&(ee.addBufferState($,e.state,de.getBufferTarget()),e.state!==s.default.BUFFER_EMPTY||Q.isSeeking()||ee.pushPlayListTraceMetrics(new Date,k.PlayListTrace.REBUFFERING_REASON))}function I(e){e.streamId===H.id&&e.mediaType===$&&(K.syncExecutedRequestsWithBufferedRange(le.getBuffer().getAllBufferRanges(),H.duration),e.from>Q.getTime()&&(he=e.from,pe=!0))}function A(){var e=H.manifestInfo,t=e.isDynamic,n=V.calcSegmentAvailabilityRange(ce.getCurrentRepresentation(),t);ee.addDVRInfo($,Q.getTime(),e,n)}function x(){return $}function D(){return le?le.getBuffer():null}function R(){return se}function M(){return oe}function N(e){var t=void 0;t=void 0!==e?((0,g.checkInteger)(e),ce?ce.getRepresentationForQuality(e):null):ce?ce.getCurrentRepresentation():null;return G.convertDataToRepresentationInfo(t)}function O(e){var t;e.sender&&e.mediaType===$&&e.streamId===H.id&&(G.getIsTextTrack(z)&&!Z.isTextEnabled()||le&&e.representationId&&(le.appendInitSegment(e.representationId)||(t=fe?fe.getInitRequest(oe,ce.getCurrentRepresentation()):null,de.processInitRequest(t))))}function P(e){var t;e.sender&&e.mediaType===$&&e.streamId===H.id&&(t=void 0,le.getIsPruningInProgress()||(t=function(e,t){var n,i,r=N(),o=!isNaN(e),s=Q.getNormalizedTime(),l=o?e:he,d=!1,c=void 0;if(isNaN(l)||$===a.default.FRAGMENTED_TEXT&&!Z.isTextEnabled())return null;if(le&&(n=le.getRangeAt(l),i=le.getRangeAt(s),null===n&&null===i||o||(!n||i&&i.start!=n.start&&i.end!=n.end)&&le.getBuffer().hasDiscontinuitiesAfter(s)&&$!==a.default.FRAGMENTED_TEXT&&(K.removeExecutedRequestsAfterTime(i.end),d=!0)),t)c=j(r,l=t.startTime+t.duration/2,{timeThreshold:0,ignoreIsFinished:!0});else{var u=o||pe||d;for(c=j(r,u?l:void 0,{keepIdx:!u}),pe=!1;c&&c.action!==C.default.ACTION_COMPLETE&&K.isFragmentLoaded(c);)c=j(r)}return c}(e.seekTarget,e.replacement))&&(de.setSeekTarget(NaN),e.replacement||(isNaN(t.startTime+t.duration)||(he=t.startTime+t.duration),t.delayLoadingTime=(new Date).getTime()+de.getTimeToLoadDelay(),de.setTimeToLoadDelay(0))),de.processMediaRequest(t))}function L(e){var t,n,i,r,a,o,s,d=e.chunk;d.streamId===H.id&&d.mediaInfo.type==$&&(t=d.bytes,i=N(n=d.quality),r=ce&&i?ce.getRepresentationForQuality(i.quality):null,a=G.getEventsFor(i.mediaInfo),o=G.getEventsFor(i,r),(a&&0<a.length||o&&0<o.length)&&(s=function(e,t,n,i){for(var r=Math.max(!t||isNaN(t.startTime)?0:t.startTime,0),a=[],o=[],s=n.concat(i),l=0,d=s.length;l<d;l++)a[s[l].schemeIdUri+"/"+s[l].value]=s[l];var c=(0,S.default)(B).getInstance().parse(e).getBoxes("emsg");for(l=0,d=c.length;l<d;l++){var u=G.getEvent(c[l],a,r);u&&o.push(u)}return o}(t,K.getRequests({state:l.default.FRAGMENT_MODEL_EXECUTED,quality:n,index:d.index})[0],a,o),U.trigger(v.default.INBAND_EVENTS,{sender:ie,events:s})))}function F(e){e.mediaType&&e.mediaType!==$||e.streamId!==H.id||(he=e.time,de.setSeekTarget(e.time))}function j(e,t,n){var i,r=null;return fe&&(i=ce&&e?ce.getRepresentationForQuality(e.quality):null,r=void 0!==t&&void 0!==n?fe.getSegmentRequestForTime(oe,i,t,n):fe.getNextSegmentRequest(oe,i)),r}e=e||{};var B=this.context,U=(0,m.default)(B).getInstance(),H=e.streamInfo,$=e.type,q=e.errHandler,z=e.mimeType,V=e.timelineConverter,G=e.adapter,W=e.manifestModel,Y=e.mediaPlayerModel,K=e.fragmentModel,X=e.abrController,Q=e.playbackController,J=e.mediaController,Z=e.textController,ee=e.dashMetrics,te=e.settings,ne=e.boxParser,ie=void 0,re=void 0,ae=void 0,oe=void 0,se=void 0,le=void 0,de=void 0,ce=void 0,ue=void 0,fe=void 0,he=void 0,pe=void 0;return ie={initialize:function(t,n){fe=(0,y.default)(B).create({streamInfo:H,type:$,timelineConverter:V,dashMetrics:ee,mediaPlayerModel:Y,baseURLController:e.baseURLController,errHandler:q,settings:te,boxParser:ne,events:v.default,eventBus:U,errors:_.default,debug:(0,E.default)(B).getInstance(),requestModifier:(0,w.default)(B).getInstance(),dashConstants:o.default,constants:a.default,urlUtils:(0,T.default)(B).getInstance()}),(ae=H.manifestInfo.isDynamic)&&(ue=(0,h.default)(B).create({timelineConverter:V})),
fe.initialize(ae),X.registerStreamType($,ie),ce=(0,f.default)(B).create({streamId:H.id,type:$,abrController:X,dashMetrics:ee,playbackController:Q,timelineConverter:V,dashConstants:o.default,events:v.default,eventBus:U,errors:_.default}),(le=function(e){return e?e===a.default.VIDEO||e===a.default.AUDIO?(0,d.default)(B).create({streamInfo:H,type:e,mediaPlayerModel:Y,manifestModel:W,fragmentModel:K,errHandler:q,mediaController:J,representationController:ce,adapter:G,textController:Z,abrController:X,playbackController:Q,settings:te}):(0,c.default)(B).create({streamInfo:H,type:e,mimeType:z,mediaPlayerModel:Y,manifestModel:W,fragmentModel:K,errHandler:q,mediaController:J,representationController:ce,adapter:G,textController:Z,abrController:X,playbackController:Q,settings:te}):(q.error(new b.default(_.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,_.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+"not properly defined")),null)}($))&&le.initialize(t),(de=(0,u.default)(B).create({streamId:H.id,type:$,mimeType:z,adapter:G,dashMetrics:ee,mediaPlayerModel:Y,fragmentModel:K,abrController:X,playbackController:Q,textController:Z,mediaController:J,bufferController:le,settings:te})).initialize(n),he=0,pe=!1},isUpdating:function(){return!!ce&&ce.isUpdating()},getType:x,getBufferController:function(){return le},getFragmentModel:function(){return K},getScheduleController:function(){return de},getRepresentationController:function(){return ce},getRepresentationInfo:N,getBufferLevel:function(){return le?le.getBufferLevel():0},isBufferingCompleted:function(){return!!le&&le.getIsBufferingCompleted()},createBuffer:function(e){return D()||le?le.createBuffer(se,e):null},updateStreamInfo:function(e){H=e,te.get().streaming.useAppendWindow&&le.updateAppendWindow()},getStreamInfo:function(){return H},selectMediaInfo:function(e){e===oe||e&&oe&&e.type!==oe.type||(oe=e);var t,n,i,r,o,s=G.getRealAdaptation(H,oe),l=G.getVoRepresentations(oe);ce&&(t=ce.getData(),n=X.getTopQualityIndexFor($,H.id),i=X.getMinAllowedIndexFor($),o=void 0,o=(r=null)!==t&&t.id==s.id||$===a.default.FRAGMENTED_TEXT?X.getQualityFor($):(r=X.getThroughputHistory().getAverageThroughput($)||X.getInitialBitrateFor($),X.getQualityForBitrate(oe,r)),void 0!==i&&o<i&&(o=i),n<o&&(o=n),fe.setMimeType(oe?oe.mimeType:null),ce.updateData(s,l,$,o))},addMediaInfo:function(e,t){-1===se.indexOf(e)&&se.push(e),t&&this.selectMediaInfo(e)},getLiveStartTime:function(){if(!ae)return NaN;if(!ue)return NaN;var e=NaN,t=N(),n=ue.getLiveEdge(t);if(isNaN(n))return NaN;var i=function(e,t){try{var n=null,i=Q.getLiveDelay(),r=isNaN(H.manifestInfo.DVRWindowSize)?i:H.manifestInfo.DVRWindowSize,a=.1*r,o=void 0;if(!isFinite(r)||j(t,e-r+a,{ignoreIsFinished:!0}))for(;!n&&i<=r;)(n=j(t,o=e-i,{ignoreIsFinished:!0}))||(i+=1);return n&&Q.setLiveDelay(i,!0),re.debug("live edge: "+e+", live delay: "+i+", live target: "+o),n}catch(e){return null}}(n,t);return i&&(e=!te.get().streaming.lowLatencyEnabled||i.duration<Y.getLiveDelay()?i.startTime:i.startTime+i.duration-Y.getLiveDelay()),e},switchTrackAsked:function(){de.switchTrackAsked()},getMediaInfoArr:R,getMediaInfo:M,getMediaSource:function(){return le.getMediaSource()},setMediaSource:function(e){le.setMediaSource(e,se)},dischargePreBuffer:function(){le.dischargePreBuffer()},getBuffer:D,setBuffer:function(e){le.setBuffer(e)},setBufferingTime:function(e){he=e},resetIndexHandler:function(){fe&&fe.resetIndex()},getInitRequest:function(e){(0,g.checkInteger)(e);var t=ce?ce.getRepresentationForQuality(e):null;return fe?fe.getInitRequest(oe,t):null},getFragmentRequest:j,finalisePlayList:function(e,t){ee.pushPlayListTraceMetrics(e,t)},reset:function(e,a){fe&&fe.reset(),le&&(le.reset(e,a),le=null),de&&(de.reset(),de=null),ce&&(ce.reset(),ce=null),ue&&(ue.reset(),ue=null),X&&X.unRegisterStreamType($),U.off(v.default.DATA_UPDATE_COMPLETED,n,ie),U.off(v.default.QUALITY_CHANGE_REQUESTED,i,ie),U.off(v.default.INIT_FRAGMENT_NEEDED,O,ie),U.off(v.default.MEDIA_FRAGMENT_NEEDED,P,ie),U.off(v.default.MEDIA_FRAGMENT_LOADED,L,ie),U.off(v.default.BUFFER_LEVEL_UPDATED,r,ie),U.off(v.default.BUFFER_LEVEL_STATE_CHANGED,p,ie),U.off(v.default.BUFFER_CLEARED,I,ie),U.off(v.default.SEEK_TARGET,F,ie),t(),H=$=null}},re=(0,E.default)(B).getInstance().getLogger(ie),t(),U.on(v.default.DATA_UPDATE_COMPLETED,n,ie,m.default.EVENT_PRIORITY_HIGH),U.on(v.default.QUALITY_CHANGE_REQUESTED,i,ie),U.on(v.default.INIT_FRAGMENT_NEEDED,O,ie),U.on(v.default.MEDIA_FRAGMENT_NEEDED,P,ie),U.on(v.default.MEDIA_FRAGMENT_LOADED,L,ie),U.on(v.default.BUFFER_LEVEL_UPDATED,r,ie),U.on(v.default.BUFFER_LEVEL_STATE_CHANGED,p,ie),U.on(v.default.BUFFER_CLEARED,I,ie),U.on(v.default.SEEK_TARGET,F,ie),ie}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(61)),s=i(e(109)),l=i(e(150)),d=i(e(114)),c=i(e(200)),u=i(e(121)),f=i(e(62)),h=i(e(216)),p=i(e(47)),g=e(219),m=i(e(46)),v=i(e(54)),y=i(e(57)),_=i(e(51)),b=i(e(226)),E=i(e(45)),w=i(e(218)),T=i(e(221)),S=i(e(207)),C=i(e(228)),k=e(244);r.__dashjs_factory_name="StreamProcessor",n.default=p.default.getClassFactory(r),t.exports=n.default},{108:108,109:109,114:114,121:121,150:150,200:200,207:207,216:216,218:218,219:219,221:221,226:226,228:228,244:244,45:45,46:46,47:47,51:51,54:54,57:57,61:61,62:62}],107:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){e=e||{};var t="urn:mpeg:dash:resolve-to-zero:2013",n=this.context,i=(0,d.default)(n).getInstance(),r=(0,o.default)(n).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.settings?e.settings.get().streaming.lowLatencyEnabled:null,errors:f.default});return{load:function(e,n,o){function d(t,r){n.resolved=!0,n.resolvedContent=t||null,i.trigger(c.default.XLINK_ELEMENT_LOADED,{element:n,resolveObject:o,error:t||r?null:new a.default(f.default.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE,f.default.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE+e)})}var u;e===t?d(null,!0):(u=new l.default(e,s.HTTPRequest.XLINK_EXPANSION_TYPE),r.load({request:u,success:function(e){d(e)},error:function(){d(null)}}))},reset:function(){r&&(r.abort(),r=null)}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(226)),o=i(e(159)),s=e(242),l=i(e(233)),d=i(e(46)),c=i(e(54)),u=i(e(47)),f=i(e(51));r.__dashjs_factory_name="XlinkLoader",n.default=u.default.getClassFactory(r),t.exports=n.default},{159:159,226:226,233:233,242:242,46:46,47:47,51:51,54:54}],108:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.init()}Object.defineProperty(n,"__esModule",{value:!0});var a=new(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"init",value:function(){this.STREAM="stream",this.VIDEO="video",this.AUDIO="audio",this.TEXT="text",this.FRAGMENTED_TEXT="fragmentedText",this.EMBEDDED_TEXT="embeddedText",this.MUXED="muxed",this.IMAGE="image",this.STPP="stpp",this.TTML="ttml",this.VTT="vtt",this.WVTT="wvtt",this.ABR_STRATEGY_DYNAMIC="abrDynamic",this.ABR_STRATEGY_BOLA="abrBola",this.ABR_STRATEGY_THROUGHPUT="abrThroughput",this.MOVING_AVERAGE_SLIDING_WINDOW="slidingWindow",this.MOVING_AVERAGE_EWMA="ewma",this.BAD_ARGUMENT_ERROR="Invalid Arguments",this.MISSING_CONFIG_ERROR="Missing config parameter(s)",this.LOCATION="Location",this.INITIALIZE="initialize",this.TEXT_SHOWING="showing",this.TEXT_HIDDEN="hidden",this.CC1="CC1",this.CC3="CC3",this.UTF8="utf-8",this.SCHEME_ID_URI="schemeIdUri",this.START_TIME="starttime",this.SERVICE_DESCRIPTION_LL_SCHEME="urn:dvb:dash:lowlatency:scope:2019",this.SUPPLEMENTAL_PROPERTY_LL_SCHEME="urn:dvb:dash:lowlatency:critical:2019",this.XML="XML",this.ARRAY_BUFFER="ArrayBuffer"}}]),r);n.default=a,t.exports=n.default},{}],109:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.init()}Object.defineProperty(n,"__esModule",{value:!0});var a=new(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"init",value:function(){this.TCP_CONNECTION="TcpList",this.HTTP_REQUEST="HttpList",this.TRACK_SWITCH="RepSwitchList",this.BUFFER_LEVEL="BufferLevel",this.BUFFER_LOADED="bufferLoaded",this.ABANDON_LOAD="abandonload",this.ALLOW_LOAD="allowload",this.BUFFER_EMPTY="bufferStalled",this.BUFFER_STATE="BufferState",this.DVR_INFO="DVRInfo",this.DROPPED_FRAMES="DroppedFrames",this.SCHEDULING_INFO="SchedulingInfo",this.REQUESTS_QUEUE="RequestsQueue",this.MANIFEST_UPDATE="ManifestUpdate",this.MANIFEST_UPDATE_STREAM_INFO="ManifestUpdatePeriodInfo",this.MANIFEST_UPDATE_TRACK_INFO="ManifestUpdateRepresentationInfo",this.PLAY_LIST="PlayList",this.DVB_ERRORS="DVBErrors"}}]),r);n.default=a,t.exports=n.default},{}],110:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.init()}Object.defineProperty(n,"__esModule",{value:!0});var a=new(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"init",value:function(){this.CLEARKEY_KEYSTEM_STRING="org.w3.clearkey",this.WIDEVINE_KEYSTEM_STRING="com.widevine.alpha",this.PLAYREADY_KEYSTEM_STRING="com.microsoft.playready"}}]),r);n.default=a,t.exports=n.default},{}],111:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){(L=(0,a.default)(R).create({dashMetrics:te,mediaPlayerModel:Y,settings:ne})).initialize()}function t(){j={},B={},H={},U={},Q={},ee={},void 0===q&&(q=!1),Z=J=X=void 0,clearTimeout($),$=null}function n(e){e.mediaType===o.default.VIDEO&&(X=e.oldQuality,J.push(X,W.getPlaybackQuality()))}function i(e){e.metric!==s.default.HTTP_REQUEST||!e.value||e.value.type!==_.HTTPRequest.MEDIA_SEGMENT_TYPE||e.mediaType!==o.default.AUDIO&&e.mediaType!==o.default.VIDEO||Z.push(e.mediaType,e.value,ne.get().streaming.abr.useDeadTimeLatency),e.metric!==s.default.BUFFER_LEVEL||e.mediaType!==o.default.AUDIO&&e.mediaType!==o.default.VIDEO||function(e,t){var n=ne.get().streaming.abr.ABRStrategy;if(n===o.default.ABR_STRATEGY_BOLA)return ee[e]=!0;if(n===o.default.ABR_STRATEGY_THROUGHPUT)return ee[e]=!1;var i=Y.getStableBufferTime(),r=i,a=.5*i,s=ee[e],l=(s?a:r)<t;(ee[e]=l)!==s&&(l?P.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+t.toFixed(3)+")."):P.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+t.toFixed(3)+")."))}(e.mediaType,.001*e.value.level)}function r(e,t){return j[t]=j[t]||{},j[t].hasOwnProperty(e)||(j[t][e]=0),function(e,t){if(t!==o.default.VIDEO||!ne.get().streaming.abr.limitBitrateByPortal||!U[t])return e;q||x();var n=G.getAdaptationForType(0,t).Representation,i=e;if(0<z&&0<V){for(;0<i&&n[i]&&z<n[i].width&&z-n[i-1].width<n[i].width-z;)--i;for(;i<n.length-1&&n[i].width===n[i+1].width;)i+=1}return i}(function(e,t,n){var i=ne.get().streaming.abr.maxRepresentationRatio[t];return isNaN(i)||1<=i||i<0?e:Math.min(e,Math.round(n*i))}(function(e,t){var n=e;if(!U[t])return n;var i=E(t);void 0!==i&&(n=Math.max(e,i));var r=f(t);return void 0!==r&&(n=Math.min(n,r)),n}(j[t][e],e),e,j[t][e]),e)}function f(e){var t,n=(t=e,ne.get().streaming.abr.maxBitrate[t]);return-1<n?C(U[e].getMediaInfo(),n):void 0}function E(e){var t,n=(t=e,ne.get().streaming.abr.minBitrate[t]);if(-1<n){var i=U[e].getMediaInfo(),r=k(i),a=C(i,n);return r[a]&&a<r.length-1&&r[a].bitrate<1e3*n&&a++,a}}function w(e,t,n,i){var a=t.id,o=A(e);(0,b.checkInteger)(n);var s=r(e,a);n!==o&&0<=n&&n<=s&&T(e,o,n,s,i)}function T(e,t,n,i,r){var a,o,s,l,d,c,f;e&&U[e]&&(o=(a=U[e].getStreamInfo())?a.id:null,ne.get().debug.logLevel===y.default.LOG_LEVEL_DEBUG&&(s=te.getCurrentBufferLevel(e),P.info("["+e+"] switch from "+t+" to "+n+"/"+i+" (buffer: "+s+") "+(r?JSON.stringify(r):"."))),d=e,f=n,B[c=o]=B[c]||{},B[c][d]=f,N.trigger(u.default.QUALITY_CHANGE_REQUESTED,{mediaType:e,streamInfo:a,oldQuality:t,newQuality:n,reason:r}),l=Z.getAverageThroughput(e),isNaN(l)||K.setSavedBitrateSettings(e,l))}function S(e,t){H[e].state=t}function C(e,t,n){var i=e&&e.type?U[e.type].getRepresentationInfo():null;if(ne.get().streaming.abr.useDeadTimeLatency&&n&&i&&i.fragmentDuration){n/=1e3;var r=i.fragmentDuration;if(r<n)return 0;t*=1-n/r}for(var a=k(e),o=a.length-1;0<=o;o--)if(1e3*t>=a[o].bitrate)return o;return 0}function k(e){var t=[];if(!e||!e.bitrateList)return t;for(var n=e.bitrateList,i=e.type,r=void 0,a=0,o=n.length;a<o;a++)(r=new l.default).mediaType=i,r.qualityIndex=a,r.bitrate=n[a].bandwidth,r.width=n[a].width,r.height=n[a].height,r.scanType=n[a].scanType,t.push(r);return t}function I(e){return ee[e]}function A(e){if(e&&U[e]){var t=U[e].getStreamInfo(),n=t?t.id:null;if(n)return B[n]=B[n]||{},B[n].hasOwnProperty(e)||(B[n][e]=0),B[n][e]}return 0}function x(){var e;W&&(e=ne.get().streaming.abr.usePixelRatioInLimitBitrateByPortal&&window.hasOwnProperty("devicePixelRatio")?window.devicePixelRatio:1,z=W.getClientWidth()*e,V=W.getClientHeight()*e)}function D(e){var t=e.request.mediaType;if(ne.get().streaming.abr.autoSwitchBitrate[t]){var n=U[t];if(!n)return;var i,r=(0,h.default)(R).create({abrController:O,streamProcessor:n,currentRequest:e.request,useBufferOccupancyABR:I(t)}),a=L.shouldAbandonFragment(r);a.quality>p.default.NO_CHANGE&&(i=n.getFragmentModel()).getRequests({state:d.default.FRAGMENT_MODEL_LOADING,index:e.request.index})[0]&&(i.abortRequests(),S(t,s.default.ABANDON_LOAD),Q[t].reset(),Q[t].push({oldValue:A(t),newValue:a.quality,confidence:1,reason:a.reason}),w(t,F.getActiveStreamInfo(),a.quality,a.reason),clearTimeout($),$=setTimeout((function(){S(t,s.default.ALLOW_LOAD),$=null}),ne.get().streaming.abandonLoadTimeout))}}var R=this.context,M=(0,y.default)(R).getInstance(),N=(0,c.default)(R).getInstance(),O=void 0,P=void 0,L=void 0,F=void 0,j=void 0,B=void 0,U=void 0,H=void 0,$=void 0,q=void 0,z=void 0,V=void 0,G=void 0,W=void 0,Y=void 0,K=void 0,X=void 0,Q=void 0,J=void 0,Z=void 0,ee=void 0,te=void 0,ne=void 0;return O={isPlayingAtTopQuality:function(e){var t=e?e.id:null,n=A(o.default.AUDIO),i=A(o.default.VIDEO);return n===r(o.default.AUDIO,t)&&i===r(o.default.VIDEO,t)},updateTopQualityIndex:function(e){if(e){var t=e.type,n=e.streamInfo.id,i=e.representationCount-1;return r=t,o=i,j[a=n]=j[a]||{},j[a][r]=o,i}var r,a,o},getThroughputHistory:function(){return Z},getBitrateList:k,getQualityForBitrate:C,getTopBitrateInfoFor:function(e){if(e&&U&&U[e]){var t=U[e].getStreamInfo();if(t&&t.id){var n=r(e,t.id),i=k(U[e].getMediaInfo());return i[n]?i[n]:null}}return null},getMaxAllowedIndexFor:f,getMinAllowedIndexFor:E,getInitialBitrateFor:function(e){if(function(){if(!K||!K.hasOwnProperty("getSavedBitrateSettings"))throw new Error(o.default.MISSING_CONFIG_ERROR)}(),e===o.default.TEXT||e===o.default.FRAGMENTED_TEXT)return NaN;var t,n=K.getSavedBitrateSettings(e),i=ne.get().streaming.abr.initialBitrate[e],r=ne.get().streaming.abr.initialRepresentationRatio[e];return-1===i&&(i=-1<r?(t=G.getAdaptationForType(0,e).Representation,Array.isArray(t)?t[Math.max(Math.round(t.length*r)-1,0)].bandwidth:0):isNaN(n)?e===o.default.VIDEO?1e3:100:n),i},getQualityFor:A,getAbandonmentStateFor:function(e){return H[e]?H[e].state:null},setPlaybackQuality:w,checkPlaybackQuality:function(e){var t,n,i,a,o,l,d,c,u,f;e&&U&&U[e]&&(n=(t=U[e].getStreamInfo())?t.id:null,i=A(e),a=(0,h.default)(R).create({abrController:O,streamProcessor:U[e],currentValue:i,switchHistory:Q[e],droppedFramesHistory:J,useBufferOccupancyABR:I(e)}),!J||(o=W.getPlaybackQuality())&&J.push(X,o),ne.get().streaming.abr.autoSwitchBitrate[e]&&(l=E(e),d=r(e,n),u=(c=L.getMaxQuality(a)).quality,void 0!==l&&(u>p.default.NO_CHANGE?u:i)<l&&(u=l),d<u&&(u=d),Q[e].push({oldValue:i,newValue:u}),u>p.default.NO_CHANGE&&u!=i?(H[e].state===s.default.ALLOW_LOAD||i<u)&&T(e,i,u,d,c.reason):ne.get().debug.logLevel===y.default.LOG_LEVEL_DEBUG&&(f=te.getCurrentBufferLevel(e),P.debug("["+e+"] stay on "+i+"/"+d+" (buffer: "+f+")"))))},getTopQualityIndexFor:r,setElementSize:x,setWindowResizeEventCalled:function(e){q=e},createAbrRulesCollection:e,registerStreamType:function(t,r){Q[t]=Q[t]||(0,g.default)(R).create(),U[t]=r,H[t]=H[t]||{},H[t].state=s.default.ALLOW_LOAD,ee[t]=!1,N.on(u.default.LOADING_PROGRESS,D,this),t==o.default.VIDEO&&(N.on(u.default.QUALITY_CHANGE_RENDERED,n,this),J=J||(0,m.default)(R).create(),x()),N.on(u.default.METRIC_ADDED,i,this),N.on(u.default.PERIOD_SWITCH_COMPLETED,e,this),Z=Z||(0,v.default)(R).create({settings:ne})},unRegisterStreamType:function(e){delete U[e]},setConfig:function(e){e&&(e.streamController&&(F=e.streamController),e.domStorage&&(K=e.domStorage),e.mediaPlayerModel&&(Y=e.mediaPlayerModel),e.dashMetrics&&(te=e.dashMetrics),e.adapter&&(G=e.adapter),e.videoModel&&(W=e.videoModel),e.settings&&(ne=e.settings))},reset:function(){t(),N.off(u.default.LOADING_PROGRESS,D,this),N.off(u.default.QUALITY_CHANGE_RENDERED,n,this),N.off(u.default.METRIC_ADDED,i,this),N.off(u.default.PERIOD_SWITCH_COMPLETED,e,this),L&&L.reset()}},P=M.getLogger(O),t(),O}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(190)),o=i(e(108)),s=i(e(109)),l=i(e(225)),d=i(e(150)),c=i(e(46)),u=i(e(54)),f=i(e(47)),h=i(e(186)),p=i(e(187)),g=i(e(188)),m=i(e(185)),v=i(e(189)),y=i(e(45)),_=e(242),b=e(219);r.__dashjs_factory_name="AbrController";var E=f.default.getSingletonFactory(r);E.QUALITY_DEFAULT=0,f.default.updateSingletonFactory(r.__dashjs_factory_name,E),n.default=E,t.exports=n.default},{108:108,109:109,150:150,185:185,186:186,187:187,188:188,189:189,190:190,219:219,225:225,242:242,45:45,46:46,47:47,54:54}],112:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){f.invalidateSelectedIndexes(e.entry)}var t=void 0,n=void 0,i=this.context,r=(0,c.default)(i).getInstance(),d=(0,s.default)(i).getInstance(),f=void 0,h=void 0;return t={reset:function(){f.reset(),h.reset()},initialize:function(e){var t;f.setConfig({adapter:n}),t=e,f.update(t),h.chooseSelector(n.getIsDVB(t))},resolve:function(e){var t=f.getForPath(e).reduce((function(e,t){var n=h.select(t);return n?(d.isRelative(n.url)?e.url=d.resolve(n.url,e.url):(e.url=n.url,e.serviceLocation=n.serviceLocation),e.availabilityTimeOffset=n.availabilityTimeOffset,e.availabilityTimeComplete=n.availabilityTimeComplete,e):new l.default}),new l.default);if(!d.isRelative(t.url))return t},setConfig:function(e){e.baseURLTreeModel&&(f=e.baseURLTreeModel),e.baseURLSelector&&(h=e.baseURLSelector),e.adapter&&(n=e.adapter)}},f=(0,a.default)(i).create(),h=(0,o.default)(i).create(),r.on(u.default.SERVICE_LOCATION_BLACKLIST_CHANGED,e,t),t}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(148)),o=i(e(206)),s=i(e(221)),l=i(e(85)),d=i(e(47)),c=i(e(46)),u=i(e(54));r.__dashjs_factory_name="BaseURLController",n.default=d.default.getClassFactory(r),t.exports=n.default},{148:148,206:206,221:221,46:46,47:47,54:54,85:85}],113:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){-1===i.indexOf(e)&&(i.push(e),r.trigger(a,{entry:e}))}function n(e){t(e.entry)}e=e||{};var i=[],r=(0,o.default)(this.context).getInstance(),a=e.updateEventName,s=e.addBlacklistEventName;return function(){s&&r.on(s,n,this)}(),{add:t,contains:function(e){return!!(i.length&&e&&e.length)&&-1!==i.indexOf(e)},reset:function(){i=[]}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(46));r.__dashjs_factory_name="BlackListController",n.default=a.default.getClassFactory(r),t.exports=n.default},{46:46,47:47}],114:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e,t){if(!Te||!e)return null;var n=e[0];if(he)try{me=t&&t[ae]?(0,l.default)(Y).create(he,n,E.bind(this),t[ae]):(0,l.default)(Y).create(he,n,E.bind(this),null),oe.get().streaming.useAppendWindow&&me.updateAppendWindow(re),"function"==typeof me.getBuffer().initialize&&me.getBuffer().initialize(ae,re,e,Q)}catch(e){le.fatal("Caught error on create SourceBuffer: "+e),X.error(new v.default(y.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,y.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+ae))}else me=(0,d.default)(Y).create(E.bind(this));return F(this.getRepresentationInfo(de)),me}function n(e){e.chunk.streamId===re.id&&e.chunk.mediaInfo.type===ae&&(le.info("Init fragment finished loading saving to",ae+"'s init cache"),Te.save(e.chunk),le.debug("Append Init fragment",ae," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),r(e.chunk))}function i(e){var t,n=e.chunk;n.streamId===re.id&&n.mediaInfo.type===ae&&(Ie?(Ae=n,(t=me&&me.getAllBufferRanges())&&0<t.length&&.5<ie.getTimeToStreamEnd()&&(le.debug("Clearing buffer because track changed - "+(t.end(t.length-1)+.5)),O([{start:0,end:t.end(t.length-1)+.5,force:!0}]))):r(n))}function r(e){me.append(e),e.mediaInfo.type===a.default.VIDEO&&G(h.default.VIDEO_CHUNK_RECEIVED,{chunk:e})}function p(e){if(e&&0<e.length)for(var t=0,n=e.length;t<n;t++)le.debug("Buffered range: "+e.start(t)+" - "+e.end(t)+", currentTime = ",ie.getTime())}function E(e){var t,n,i,r,o;if(e.error)return 22===e.error.code&&(we=!0,fe=.8*z(),le.warn("Quota exceeded, Critical Buffer: "+fe),0<fe&&(t=Math.max(.2*fe,1),n=fe-t,i=Math.min(oe.get().streaming.bufferTimeAtTopQuality,.9*n),r=Math.min(oe.get().streaming.bufferTimeAtTopQualityLongForm,.9*n),o={streaming:{bufferToKeep:parseFloat(t.toFixed(5)),bufferTimeAtTopQuality:parseFloat(i.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(r.toFixed(5))}},oe.update(o))),void(22!==e.error.code&&V()||(le.warn("Clearing playback buffer to overcome quota exceed situation"),G(h.default.QUOTA_EXCEEDED,{criticalBufferLevel:fe}),O(N())));we=!1,(_e=e.chunk)&&!isNaN(_e.index)&&(pe=Math.max(_e.index,pe),D());var s,l=me.getAllBufferRanges();_e.segmentType===_.HTTPRequest.MEDIA_SEGMENT_TYPE?(p(l),C(),function(){if((ae===a.default.AUDIO||ae===a.default.VIDEO)&&!isNaN(Se)){var e=ie.getTime(),t=A(Se,0);if(e!==Se||!t){var n=J.getCurrentRepresentation().segmentDuration;(t=A(Se,n))&&(Math.abs(e-Se)>n?Se<=t.end&&(ie.seek(Math.max(Se,t.start),!1,!0),Se=NaN):e<t.start&&(ie.seek(t.start,!1,!0),Se=NaN))}}}()):Ie&&(s=ie.getTime(),le.debug("AppendToBuffer seek target should be "+s),G(h.default.SEEK_TARGET,{time:s,mediaType:ae,streamId:re.id})),_e&&G(_e.endFragment?h.default.BYTES_APPENDED_END_FRAGMENT:h.default.BYTES_APPENDED,{quality:_e.quality,startTime:_e.start,index:_e.index,bufferedRanges:l,mediaType:ae})}function w(e){e.streamInfo.id===re.id&&e.mediaType===ae&&de!==e.newQuality&&(F(this.getRepresentationInfo(e.newQuality)),de=e.newQuality)}function T(e){Se=e.seekTime,ce&&(ce=!(Ce=!0),ge=Number.POSITIVE_INFINITY),ae!==a.default.FRAGMENTED_TEXT?me.waitForUpdateEnd((function(){var e=function(){var e=[],t=me.getAllBufferRanges();if(!t||0===t.length)return e;var n,i,r,a,o=ie.getTime(),l=t.end(t.length-1)+.5,d=Q.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,time:o,threshold:.01})[0];return d?(n={start:0,end:d.startTime-.5},(i=Q.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,time:d.startTime-d.duration/2,threshold:.01})[0])&&i.startTime!=d.startTime&&(n.end=i.startTime),n.start<n.end&&n.end>t.start(0)&&e.push(n),r={start:d.startTime+d.duration+.5,end:l},(a=Q.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,time:d.startTime+d.duration+.5,threshold:.01})[0])&&a.startTime!==d.startTime&&(r.start=a.startTime+a.duration+.5),r.start<r.end&&r.start<l&&e.push(r)):(le.debug("getAllRangesWithSafetyFactor - No request found in current time position, removing full buffer 0 -",l),e.push({start:0,end:l})),e}();e&&0!==e.length||C(),O(e)})):C()}function S(){Se=NaN}function C(){(!Ie||ae===a.default.FRAGMENTED_TEXT&&te.isTextEnabled())&&x()}function k(){R()}function I(){Se=NaN,R()}function A(e,t){var n=me.getAllBufferRanges(),i=0,r=0,a=null,o=null,s=0,l=void 0,d=void 0,c=isNaN(t)?.15:t;if(null!=n){for(d=0,l=n.length;d<l;d++)if(i=n.start(d),r=n.end(d),null===a)s=Math.abs(i-e),(i<=e&&e<r||s<=c)&&(a=i,o=r);else{if(!((s=i-o)<=c))break;o=r}if(null!==a)return{start:a,end:o}}return null}function x(){var e,t,n;ie&&(e=(isNaN(Se)?ie.getTime():Se)||0,ue=null===(n=A(e,t))?0:n.end-e,G(h.default.BUFFER_LEVEL_UPDATED,{bufferLevel:ue}),R())}function D(){ge-1<=pe&&!ce&&void 0===me.discharge&&(ce=!0,le.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for "+ae),G(h.default.BUFFERING_COMPLETED))}function R(){ae!==a.default.AUDIO&&ae!==a.default.VIDEO||(Ce&&!ce&&0<ue&&ie&&ie.getTimeToStreamEnd()-ue<.5&&(ce=!(Ce=!1),le.debug("checkIfSufficientBuffer trigger BUFFERING_COMPLETED for type "+ae),le.debug("checkIfSufficientBuffer trigger BUFFERING_COMPLETED for type "+ae),G(h.default.BUFFERING_COMPLETED)),(!oe.get().streaming.lowLatencyEnabled&&ue<.5||0===ue)&&!ce?M(o.default.BUFFER_EMPTY):(ce||ue>=re.manifestInfo.minBufferTime)&&M(o.default.BUFFER_LOADED))}function M(e){ye===e||e===o.default.BUFFER_EMPTY&&0===ie.getTime()||ae===a.default.FRAGMENTED_TEXT&&!te.isTextEnabled()||(ye=e,G(h.default.BUFFER_LEVEL_STATE_CHANGED,{state:e}),G(e===o.default.BUFFER_LOADED?h.default.BUFFER_LOADED:h.default.BUFFER_EMPTY),le.debug(e===o.default.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function N(){var e=[],t=me.getAllBufferRanges();if(!t||0===t.length)return e;var n=ie.getTime(),i=Math.max(0,n-oe.get().streaming.bufferToKeep),r=Q.getRequests({state:s.default.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(r)i=Math.min(r.startTime,i);else if(0===n&&ie.getIsDynamic())return[];if(t.start(0)<=i){for(var a={start:0,end:i},o=0;o<t.length&&t.end(o)<=i;o++)a.end=t.end(o);a.start<a.end&&e.push(a)}return e}function O(e){e&&me&&0!==e.length&&(ke.push.apply(ke,e),Ee||P())}function P(){if(0===ke.length||!me)return le.debug("Nothing to prune, halt pruning"),void(Ee=!(ke=[]));var e=me.getBuffer();if(!e||!e.buffered||0===e.buffered.length)return le.debug("SourceBuffer is empty (or does not exist), halt pruning"),void(Ee=!(ke=[]));var t=ke.shift();le.debug("Removing buffer from:",t.start,"to",t.end),Ee=!0,ie.getTime()<t.end&&(ce=!1,pe=0),me.remove(t.start,t.end,t.force)}function L(e){me===e.buffer&&(le.debug("onRemoved buffer from:",e.from,"to",e.to),p(me.getAllBufferRanges()),0===ke.length&&(Ee=!1),e.unintended&&(le.warn("Detected unintended removal from:",e.from,"to",e.to,"setting index handler time to",e.from),G(h.default.SEEK_TARGET,{time:e.from,mediaType:ae,streamId:re.id})),Ee?P():(Ie?(Ie=!1,Ae&&r(Ae)):x(),G(h.default.BUFFER_CLEARED,{from:e.from,to:e.to,unintended:e.unintended,hasEnoughSpaceToAppend:V(),quotaExceeded:we})))}function F(e){e&&void 0!==e.MSETimeOffset&&me&&me.updateTimestampOffset&&me.updateTimestampOffset(e.MSETimeOffset)}function j(e){e.sender.getStreamId()===re.id&&e.sender.getType()===ae&&(e.error||ce||F(e.currentRepresentation))}function B(e){e.request.mediaInfo.streamInfo.id===re.id&&e.request.mediaType===ae&&(ge=e.request.index,D())}function U(e){var t;e.newMediaInfo.streamInfo.id!==re.id||e.newMediaInfo.type!==ae||(t=me&&me.getAllBufferRanges())&&(le.info("Track change asked"),Z.getSwitchMode(ae)===u.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE&&t&&0<t.length&&.5<ie.getTimeToStreamEnd()&&(ce=!1,ge=Number.POSITIVE_INFINITY))}function H(){++be*(oe.get().streaming.wallclockTimeUpdateInterval/1e3)>=oe.get().streaming.bufferPruningInterval&&(be=0,me&&ae!==a.default.FRAGMENTED_TEXT&&(ce||O(N())))}function $(){R()}function q(e,n){he=e,me&&n&&"function"==typeof me.discharge&&(ve=me,t(n))}function z(){var e,t=me.getAllBufferRanges(),n=0,i=void 0;if(!t)return n;for(i=0,e=t.length;i<e;i++)n+=t.end(i)-t.start(i);return n}function V(){return z()<fe}function G(e,t){var n=t||{};n.sender=se,n.mediaType=ae,n.streamId=re.id,K.trigger(e,n)}function W(e,t){fe=Number.POSITIVE_INFINITY,ye=void 0,de=c.default.QUALITY_DEFAULT,ge=Number.POSITIVE_INFINITY,_e=null,Ce=we=Ee=ce=!1,be=ue=pe=0,ke=[],Se=NaN,me&&(e||me.abort(),me.reset(t),me=null),Ie=!1}e=e||{};var Y=this.context,K=(0,f.default)(Y).getInstance(),X=e.errHandler,Q=e.fragmentModel,J=e.representationController,Z=e.mediaController,ee=e.adapter,te=e.textController,ne=e.abrController,ie=e.playbackController,re=e.streamInfo,ae=e.type,oe=e.settings,se=void 0,le=void 0,de=void 0,ce=void 0,ue=void 0,fe=void 0,he=void 0,pe=void 0,ge=void 0,me=void 0,ve=void 0,ye=void 0,_e=void 0,be=void 0,Ee=void 0,we=void 0,Te=void 0,Se=void 0,Ce=void 0,ke=void 0,Ie=void 0,Ae=void 0;return se={getBufferControllerType:function(){return b},getRepresentationInfo:function(e){return ee.convertDataToRepresentationInfo(J.getRepresentationForQuality(e))},initialize:function(e){q(e),de=ne.getQualityFor(ae),K.on(h.default.DATA_UPDATE_COMPLETED,j,this),K.on(h.default.INIT_FRAGMENT_LOADED,n,this),K.on(h.default.MEDIA_FRAGMENT_LOADED,i,this),K.on(h.default.QUALITY_CHANGE_REQUESTED,w,this),K.on(h.default.STREAM_COMPLETED,B,this),K.on(h.default.PLAYBACK_PLAYING,I,this),K.on(h.default.PLAYBACK_PROGRESS,C,this),K.on(h.default.PLAYBACK_TIME_UPDATED,C,this),K.on(h.default.PLAYBACK_RATE_CHANGED,$,this),K.on(h.default.PLAYBACK_SEEKING,T,this),K.on(h.default.PLAYBACK_SEEKED,S,this),K.on(h.default.PLAYBACK_STALLED,k,this),K.on(h.default.WALLCLOCK_TIME_UPDATED,H,this),K.on(h.default.CURRENT_TRACK_CHANGED,U,this,f.default.EVENT_PRIORITY_HIGH),K.on(h.default.SOURCEBUFFER_REMOVE_COMPLETED,L,this)},createBuffer:t,dischargePreBuffer:function(){if(me&&ve&&"function"==typeof ve.discharge){var e=ve.getAllBufferRanges();if(0<e.length){for(var t="Beginning "+ae+"PreBuffer discharge, adding buffer for:",n=0;n<e.length;n++)t+=" start: "+e.start(n)+", end: "+e.end(n)+";";le.debug(t)}else le.debug("PreBuffer discharge requested, but there were no media segments in the PreBuffer.");for(var i=ve.discharge(),r=null,a=0;a<i.length;a++){var o=i[a],s=Te.extract(o.streamId,o.representationId);s&&(r!==s&&(me.append(s),r=s),me.append(o))}ve.reset(),ve=null}},getType:function(){return ae},getBuffer:function(){return me},setBuffer:function(e){me=e},getBufferLevel:function(){return ue},getRangeAt:A,setMediaSource:q,getMediaSource:function(){return he},appendInitSegment:function(e){var t=Te.extract(re.id,e);return!!t&&(le.info("Append Init fragment",ae," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),r(t),!0)},replaceBuffer:function(){Ie=!0},getIsBufferingCompleted:function(){return ce},getIsPruningInProgress:function(){return Ee},reset:function(e,t){K.off(h.default.DATA_UPDATE_COMPLETED,j,this),K.off(h.default.INIT_FRAGMENT_LOADED,n,this),K.off(h.default.MEDIA_FRAGMENT_LOADED,i,this),K.off(h.default.QUALITY_CHANGE_REQUESTED,w,this),K.off(h.default.STREAM_COMPLETED,B,this),K.off(h.default.PLAYBACK_PLAYING,I,this),K.off(h.default.PLAYBACK_PROGRESS,C,this),K.off(h.default.PLAYBACK_TIME_UPDATED,C,this),K.off(h.default.PLAYBACK_RATE_CHANGED,$,this),K.off(h.default.PLAYBACK_SEEKING,T,this),K.off(h.default.PLAYBACK_SEEKED,S,this),K.off(h.default.PLAYBACK_STALLED,k,this),K.off(h.default.WALLCLOCK_TIME_UPDATED,H,this),K.off(h.default.CURRENT_TRACK_CHANGED,U,this),K.off(h.default.SOURCEBUFFER_REMOVE_COMPLETED,L,this),W(e,t)},updateAppendWindow:function(){me&&!ce&&me.updateAppendWindow(re)}},le=(0,g.default)(Y).getInstance().getLogger(se),Te=(0,m.default)(Y).getInstance(),W(),se}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(109)),s=i(e(150)),l=i(e(104)),d=i(e(103)),c=i(e(111)),u=i(e(118)),f=i(e(46)),h=i(e(54)),p=i(e(47)),g=i(e(45)),m=i(e(214)),v=i(e(226)),y=i(e(51)),_=e(242),b="BufferController";r.__dashjs_factory_name=b,n.default=p.default.getClassFactory(r),t.exports=n.default},{103:103,104:104,108:108,109:109,111:111,118:118,150:150,214:214,226:226,242:242,45:45,46:46,47:47,51:51,54:54}],115:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){if(!k||!I)throw new Error("setConfig function has to be called previously")}function t(){x=!1,E={},w={},S=null,A=!(T={}),C=Date.now()/1e3}function n(){try{null!==S&&x&&(clearInterval(S),S=null,x=!1,function(){try{a(w),a(E)}catch(e){}}())}catch(e){throw e}}function i(){try{var e,t;A||(t=(e=I.getTime())-C,t=0<C?Math.max(0,t):0,r(w,t,e),r(E,t,e),function(){try{if(T)for(var e=I.getTime(),t=Object.keys(T),n=0;n<t.length;n++){var i=t[n],r=T[i]
;null!==r&&(r.duration+r.calculatedPresentationTime)/r.eventStream.timescale<e&&(b.debug("Remove Event "+i+" at time "+e),r=null,delete T[i])}}catch(e){}}(),C=e),A=!1}catch(e){A=!1}}function r(e,t,n){try{if(e)for(var i=Object.keys(e),r=0;r<i.length;r++){var a,o=i[r],s=e[o];void 0!==s&&((a=s.calculatedPresentationTime/s.eventStream.timescale)<=n&&n<=a+t?c(o,s,e):(function(e,t,n){try{return n<e-t}catch(e){return!1}}(n,t,a)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime/1e3>t}catch(e){return!1}}(s))&&(b.debug("Deleting event "+o+" as it is expired or invalid"),delete e[o]))}}catch(e){}}function a(e){try{var t=function(){var t=Object.keys(e),n=I.getTime();if(!t||0===t.length)return{v:void 0};var i=e[t[0]].eventStream&&e[t[0]].eventStream.period&&!isNaN(e[t[0]].eventStream.period.duration)?e[t[0]].eventStream.period.duration:NaN,r=e[t[0]].eventStream&&e[t[0]].eventStream.period&&!isNaN(e[t[0]].eventStream.period.start)?e[t[0]].eventStream.period.start:NaN;if(isNaN(i)||isNaN(r))return{v:void 0};t.forEach((function(t){var i=e[t],r=i.calculatedPresentationTime/i.eventStream.timescale;Math.abs(r-n)<m&&c(t,i,e)}))}();if("object"==typeof t)return t.v}catch(t){}}function c(t,n,i){try{var r=I.getTime();0<n.duration&&(T[t]=n),n.eventStream.schemeIdUri===u&&n.eventStream.value==f?0===n.duration&&0===n.presentationTimeDelta||(b.debug("Starting manifest refresh event "+t+" at "+r),function(){try{e(),k.refreshManifest()}catch(e){}}()):n.eventStream.schemeIdUri===h&&n.eventStream.value==p?(b.debug("Starting callback event "+t+" at "+r),function(e){try{(0,d.default)(v).create({}).load({method:"get",url:e,request:{responseType:"arraybuffer"}})}catch(e){throw e}}(n.messageData)):(b.debug("Starting event "+t+" at "+r),y.trigger(n.eventStream.schemeIdUri,{event:n})),delete i[t]}catch(t){}}var u="urn:mpeg:dash:event:2012",f=1,h="urn:mpeg:dash:event:callback:2015",p=1,g=100,m=300,v=this.context,y=(0,s.default)(v).getInstance(),_=void 0,b=void 0,E=void 0,w=void 0,T=void 0,S=void 0,C=void 0,k=void 0,I=void 0,A=void 0,x=void 0;return _={addInlineEvents:function(t){try{if(e(),t)for(var n=0;n<t.length;n++){var i=t[n];E[i.id]=i,b.debug("Add inline event with id "+i.id)}b.debug("Added "+t.length+" inline events")}catch(t){throw t}},addInbandEvents:function(t){try{e();for(var n=0;n<t.length;n++){var r=t[n];r.id in w?b.debug("Repeated event with id "+r.id):(r.eventStream.schemeIdUri===u&&void 0===w[r.id]&&function(e){try{var t,n,i;e.eventStream.value==f&&(t=e.eventStream.timescale||1,n=e.calculatedPresentationTime/t,i=void 0,i=4294967295==e.calculatedPresentationTime?NaN:(e.calculatedPresentationTime+e.duration)/t,b.info("Manifest validity changed: Valid until: "+n+"; remaining duration: "+i),y.trigger(l.default.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:n,newDuration:i,newManifestValidAfter:NaN}))}catch(e){}}(r),w[r.id]=r,b.debug("Add inband event with id "+r.id))}i()}catch(t){throw t}},start:function(){try{e(),b.debug("Start Event Controller"),x||isNaN(g)||(x=!0,S=setInterval(i,g))}catch(e){throw e}},setConfig:function(e){try{if(!e)return;e.manifestUpdater&&(k=e.manifestUpdater),e.playbackController&&(I=e.playbackController)}catch(e){throw e}},reset:function(){n(),t()}},b=(0,o.default)(v).getInstance().getLogger(_),t(),_}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(45)),s=i(e(46)),l=i(e(54)),d=i(e(160));r.__dashjs_factory_name="EventController",n.default=a.default.getSingletonFactory(r),t.exports=n.default},{160:160,45:45,46:46,47:47,54:54}],116:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){for(var e in b)b[e].reset();b={}}function n(e){var t,n,i,s,l,d,c,f,h,p;e.sender&&(t=e.request,n=e.response,i=t.isInitializationRequest(),(s=t.mediaInfo.streamInfo)&&s.id!==E||(e.error&&(e.request.mediaType!==a.default.AUDIO&&e.request.mediaType!==a.default.VIDEO&&e.request.mediaType!==a.default.FRAGMENTED_TEXT||r.trigger(u.default.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation})),n&&s?(d=n,c=t,f=s.id,h=e.type!==u.default.FRAGMENT_LOADING_PROGRESS,(p=new o.default).streamId=f,p.mediaInfo=c.mediaInfo,p.segmentType=c.type,p.start=c.startTime,p.duration=c.duration,p.end=p.start+p.duration,p.bytes=d,p.index=c.index,p.quality=c.quality,p.representationId=c.representationId,p.endFragment=h,l=p,r.trigger(i?u.default.INIT_FRAGMENT_LOADED:u.default.MEDIA_FRAGMENT_LOADED,{chunk:l,request:t})):_.warn("No "+t.mediaType+" bytes to push or stream is inactive.")))}e=e||{};var i=this.context,r=(0,c.default)(i).getInstance(),h=e.errHandler,g=e.mediaPlayerModel,m=e.dashMetrics,v=(0,p.default)(i).getInstance(),y=void 0,_=void 0,b=void 0,E=void 0;return y={getModel:function(t,n){var a=b[n];return a||(a=(0,s.default)(i).create({streamId:t,dashMetrics:m,fragmentLoader:(0,l.default)(i).create({dashMetrics:m,mediaPlayerModel:g,errHandler:h,requestModifier:(0,d.default)(i).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:r,events:u.default,errors:f.default,dashConstants:e.dashConstants,urlUtils:e.urlUtils}),debug:v,eventBus:r,events:u.default}),b[n]=a),a},setStreamId:function(e){E=e},reset:function(){r.off(u.default.FRAGMENT_LOADING_COMPLETED,n,this),r.off(u.default.FRAGMENT_LOADING_PROGRESS,n,this),t()}},_=v.getLogger(y),t(),r.on(u.default.FRAGMENT_LOADING_COMPLETED,n,y),r.on(u.default.FRAGMENT_LOADING_PROGRESS,n,y),y}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(227)),s=i(e(150)),l=i(e(97)),d=i(e(218)),c=i(e(46)),u=i(e(54)),f=i(e(51)),h=i(e(47)),p=i(e(45));r.__dashjs_factory_name="FragmentController",n.default=h.default.getClassFactory(r),t.exports=n.default},{108:108,150:150,218:218,227:227,45:45,46:46,47:47,51:51,54:54,97:97}],117:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){_.debug("Stopping the gap controller"),p&&(clearInterval(p),p=null),function(){d.off(s.default.WALLCLOCK_TIME_UPDATED,i,this),d.off(s.default.BYTES_APPENDED_END_FRAGMENT,t,this)}(),p=null,g=NaN,h=0}function t(){p||function(){try{p||(_.debug("Starting the gap controller"),p=setInterval((function(){n()&&r(m.getTime())}),100))}catch(e){}}()}function n(){return f.get().streaming.jumpGaps&&0<v.getActiveStreamProcessors().length&&(!m.isSeeking()||v.hasStreamFinishedBuffering(v.getActiveStream()))&&!m.isPaused()&&!v.getIsStreamSwitchInProgress()&&!v.getHasMediaOrIntialisationError()}function i(){var e;n()&&10<=++h&&(e=m.getTime(),u===e?r(e,!0):(u=e,g=NaN),h=0)}function r(e,t){var n,i,r=!(arguments.length<=1||void 0===t)&&t,a=f.get().streaming.smallGapLimit,o=f.get().streaming.jumpLargeGaps,l=NaN,c=!1;(i=function(e){try{var t=y.getBufferRange();if(!t||t.length<=1&&0<e)return null;for(var n=null,i=0;!n&&i<t.length;){var r=0<i?t.end(i-1):0;e<t.start(i)&&r-e<.1&&(n=t.start(i)),i+=1}return n}catch(e){return null}}(e))&&0<i&&0<(n=i-e)&&(n<=a||o)&&(l=i);var u=m.getTimeToStreamEnd();isNaN(l)&&r&&isFinite(u)&&!isNaN(u)&&(u<a||v.hasStreamFinishedBuffering(v.getActiveStream()))&&(l=parseFloat(m.getStreamEndTime().toFixed(5)),c=!0),0<l&&g!==l&&(c?(_.warn("Jumping to end of stream because of gap from "+e+" to "+l+". Gap duration: "+(l-e)),d.trigger(s.default.GAP_CAUSED_SEEK_TO_PERIOD_END,{seekTime:l})):(_.warn("Jumping gap from "+e+" to "+l+". Gap duration: "+(l-e)),m.seek(l,!0,!0)),g=l)}var a=this.context,d=(0,l.default)(a).getInstance(),c=void 0,u=void 0,f=void 0,h=void 0,p=void 0,g=void 0,m=void 0,v=void 0,y=void 0,_=void 0;return c={reset:e,setConfig:function(e){e&&(e.settings&&(f=e.settings),e.playbackController&&(m=e.playbackController),e.streamController&&(v=e.streamController),e.videoModel&&(y=e.videoModel),e.timelineConverter&&e.timelineConverter,e.adapter&&e.adapter)},initialize:function(){!function(){d.on(s.default.WALLCLOCK_TIME_UPDATED,i,this),d.on(s.default.BYTES_APPENDED_END_FRAGMENT,t,this)}()}},_=(0,o.default)(a).getInstance().getLogger(c),e(),c}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(45)),s=i(e(54)),l=i(e(46));r.__dashjs_factory_name="GapController",n.default=a.default.getSingletonFactory(r),t.exports=n.default},{45:45,46:46,47:47,54:54}],118:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e,t){if(!e||!t)return[];var n=t.id;return S[n]&&S[n][e]?S[n][e].list:[]}function t(e,t){return!e||!t||t&&!S[t.id]?null:S[t.id][e].current}function n(e,n){if(e&&e.streamInfo){var i,r,s=e.type,l=e.streamInfo,d=l.id,c=t(s,l);if(S[d]&&S[d][s]&&!m(e,c)&&(S[d][s].current=e,!S[d][s].current||n&&s===a.default.FRAGMENTED_TEXT||E.trigger(o.default.CURRENT_TRACK_CHANGED,{oldMediaInfo:c,newMediaInfo:e,switchMode:I[s]}),!n)){var u=(r={lang:(i=e).lang,viewpoint:i.viewpoint,roles:i.roles,accessibility:i.accessibility,audioChannelConfiguration:i.audioChannelConfiguration}).lang||r.viewpoint||r.role&&0<r.role.length||r.accessibility&&0<r.accessibility.length||r.audioChannelConfiguration&&0<r.audioChannelConfiguration.length?r:null;if(!u||!S[d][s].storeLastSettings)return;u.roles&&(u.role=u.roles[0],delete u.roles),u.accessibility&&(u.accessibility=u.accessibility[0]),u.audioChannelConfiguration&&(u.audioChannelConfiguration=u.audioChannelConfiguration[0]),A.setSavedMediaSettings(s,u)}}}function i(e,t){e&&t&&(C[e]=t)}function r(e){return e?C[e]:null}function l(){return k||p}function g(e){return e===a.default.AUDIO||e===a.default.VIDEO||e===a.default.TEXT||e===a.default.FRAGMENTED_TEXT||e===a.default.IMAGE}function m(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,i=e.viewpoint===t.viewpoint,r=e.lang===t.lang,a=e.roles.toString()===t.roles.toString(),o=e.accessibility.toString()===t.accessibility.toString(),s=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&i&&r&&a&&o&&s}function v(){S={},C={audio:null,video:null,fragmentedText:null},I={audio:u,video:c}}function y(e,t){var n=!e.lang||t.lang.match(e.lang),i=!e.viewpoint||e.viewpoint===t.viewpoint,r=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],a=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],o=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return n&&i&&r&&a&&o}function _(e,t){function n(e){var t=0,n=[],i=void 0;return e.forEach((function(e){i=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))),t<i?(t=i,n=[e]):i===t&&n.push(e)})),n}function i(e){var t=0,n=[],i=void 0;return e.forEach((function(e){i=e.representationCount,t<i?(t=i,n=[e]):i===t&&n.push(e)})),n}if(e===a.default.FRAGMENTED_TEXT)return t[0];var r=l(),o=[];switch(r){case f:1<(o=n(t)).length&&(o=i(o));break;case h:1<(o=i(t)).length&&(o=n(t));break;default:T.warn("Track selection mode is not supported: "+r)}return o[0]}var b=this.context,E=(0,s.default)(b).getInstance(),w=void 0,T=void 0,S=void 0,C=void 0,k=void 0,I=void 0,A=void 0,x=[u,c],D=[f,h];return w={checkInitialMediaSettingsForType:function(t,a){var o=r(t),s=e(t,a),l=[];o||i(t,o=A.getSavedMediaSettings(t)),s&&0!==s.length&&(o&&s.forEach((function(e){y(o,e)&&l.push(e)})),0===l.length?n(_(t,s),!0):1<l.length?n(_(t,l)):n(l[0]))},addTrack:function(e){if(e){var i=e.type;if(g(i)){var a=e.streamInfo.id;S[a]||(S[a]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},fragmentedText:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var o=S[a][i].list,s=0,l=o.length;s<l;++s)if(m(o[s],e))return;o.push(e);var d=r(i);d&&y(d,e)&&!t(i,e.streamInfo)&&n(e)}}},getTracksFor:e,getCurrentTrackFor:t,isCurrentTrack:function(e){if(!e)return!1;var t=e.type,n=e.streamInfo.id;return S[n]&&S[n][t]&&m(S[n][t].current,e)},setTrack:n,setInitialSettings:i,getInitialSettings:r,setSwitchMode:function(e,t){-1!==x.indexOf(t)?I[e]=t:T.warn("Track switch mode is not supported: "+t)},getSwitchMode:function(e){return I[e]},setSelectionModeForInitialTrack:function(e){-1!==D.indexOf(e)?k=e:T.warn("Track selection mode is not supported: "+e)},getSelectionModeForInitialTrack:l,isMultiTrackSupportedByType:g,isTracksEqual:m,matchSettings:y,saveTextSettingsDisabled:function(){A.setSavedMediaSettings(a.default.FRAGMENTED_TEXT,null)},setConfig:function(e){e&&e.domStorage&&(A=e.domStorage)},reset:v},T=(0,d.default)(b).getInstance().getLogger(w),v(),w}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(54)),s=i(e(46)),l=i(e(47)),d=i(e(45)),c="neverReplace",u="alwaysReplace",f="highestBitrate",h="widestRange",p=f;r.__dashjs_factory_name="MediaController";var g=l.default.getSingletonFactory(r);g.TRACK_SWITCH_MODE_NEVER_REPLACE=c,g.TRACK_SWITCH_MODE_ALWAYS_REPLACE=u,g.TRACK_SELECTION_MODE_HIGHEST_BITRATE=f,g.TRACK_SELECTION_MODE_WIDEST_RANGE=h,g.DEFAULT_INIT_TRACK_SELECTION_MODE=p,l.default.updateSingletonFactory(r.__dashjs_factory_name,g),n.default=g,t.exports=n.default},{108:108,45:45,46:46,47:47,54:54}],119:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=void 0,t=void 0,n=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?new MediaSource:e?new WebKitMediaSource:null},attachMediaSource:function(e,t){var n=window.URL.createObjectURL(e);return t.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function(e,t){return e.duration!=t&&(e.duration=t),e.duration},setSeekable:function(e,t,n){e&&"function"==typeof e.setLiveSeekableRange&&"function"==typeof e.clearLiveSeekableRange&&"open"===e.readyState&&0<=t&&t<n&&(e.clearLiveSeekableRange(),e.setLiveSeekableRange(t,n))},signalEndOfStream:function(e){if(e&&"open"===e.readyState){for(var n=e.sourceBuffers,i=0;i<n.length;i++){if(n[i].updating)return;if(0===n[i].buffered.length)return}t.info("call to mediaSource endOfStream"),e.endOfStream()}}},t=(0,o.default)(n).getInstance().getLogger(e),e}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(45));r.__dashjs_factory_name="MediaSourceController",n.default=a.default.getSingletonFactory(r),t.exports=n.default},{45:45,47:47}],120:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){var t,n,i,r;ee&&isNaN(te)||(t=te,isNaN(t)&&(ae?(t=e.liveStartTime,(i=(n=X.getCurrentDVRInfo())?n.range:null)&&(r=b(re.start,!0),isNaN(r)||(Y.info("Start time from URI parameters: "+r),t=Math.max(Math.min(t,r),i.start)))):(t=re.start,r=b(re.start,!1),!isNaN(r)&&r<t+re.duration&&(Y.info("Start time from URI parameters: "+r),t=Math.max(t,r)))),isNaN(t)||t===J.getTime()||(G.trigger(l.default.PLAYBACK_SEEKING,{seekTime:t}),f(t,!1,!0)))}function t(){return parseFloat((n()-h()).toFixed(5))}function n(){return re.start+re.duration}function i(){re&&J&&J.getElement()?J.play():se=!0}function r(){return re&&J?J.isPaused():null}function d(){re&&J&&J.pause()}function u(){return re&&J?J.isSeeking():null}function f(e,t,n){re&&J&&e!==(isNaN(ce)?J.getTime():ce)&&(!0===n?(J.removeEventListener("seeking",D),Y.info("Requesting internal seek to time: "+e)):(ce=e,G.trigger(l.default.PLAYBACK_SEEK_ASKED),Y.info("Requesting seek to time: "+e)),J.setCurrentTime(e,t))}function h(){return re&&J?J.getTime():null}function p(){var e,t=h();return!ae||isNaN(de)||(e=de/1e3)<t&&(t-=e),t}function g(){return re&&J?J.getPlaybackRate():null}function m(){return re&&J?J.getEnded():null}function v(){return ae}function y(){if(!ae||isNaN(de))return NaN;var e=p();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*Z.getClientTimeOffset();return Math.max(((t-de-1e3*e)/1e3).toFixed(3),0)}function _(){ee=se=!1,de=ie=0,ce=te=NaN,J&&(G.off(l.default.STREAM_INITIALIZED,e,this),G.off(l.default.DATA_UPDATE_COMPLETED,S,this),G.off(l.default.BUFFER_LEVEL_STATE_CHANGED,$,this),G.off(l.default.LOADING_PROGRESS,H,this),G.off(l.default.PLAYBACK_PROGRESS,B,this),G.off(l.default.PLAYBACK_TIME_UPDATED,B,this),G.off(l.default.PLAYBACK_ENDED,F,this),G.off(l.default.STREAM_INITIALIZING,z,this),w(),J.removeEventListener("canplay",C),J.removeEventListener("play",k),J.removeEventListener("waiting",I),J.removeEventListener("playing",A),J.removeEventListener("pause",x),J.removeEventListener("error",j),J.removeEventListener("seeking",D),J.removeEventListener("seeked",R),J.removeEventListener("timeupdate",M),J.removeEventListener("progress",N),J.removeEventListener("ratechange",O),J.removeEventListener("loadedmetadata",P),J.removeEventListener("stalled",q),J.removeEventListener("ended",L)),ae=re=J=ne=null}function b(e,t){var n=pe.getURIFragmentData();return n&&n.t?(n.t=n.t.split(",")[0],t&&-1!==n.t.indexOf("posix:")?parseInt(n.t.substring(6)):e+parseInt(n.t)):NaN}function E(){null===ne&&(ne=setInterval((function(){G.trigger(l.default.WALLCLOCK_TIME_UPDATED,{isDynamic:ae,time:new Date}),ae&&r()&&function(){var e=Date.now();(!le||le+500<e)&&(le=e,M())}()}),ge.get().streaming.wallclockTimeUpdateInterval))}function w(){clearInterval(ne),ne=null}function T(){var e,t,n,i,a;!r()&&ae&&0!==J.getReadyState()&&(n=e=p(),t=(a=(i=X.getCurrentDVRInfo())?i.range:null)?(Y.debug("Checking DVR window for at "+n+" with DVR window range "+a.start+" - "+a.end),n>a.end?Math.max(a.end-ie,a.start):0<n&&n+.25<a.start&&Math.abs(n-a.start)<31536e4?a.start:n):NaN,isNaN(t)||t===e||(Y.debug("UpdateCurrentTime: Seek to actual time: "+t+" from currentTime: "+e),f(t)))}function S(e){var t,n;e.error||null!==(n=(t=Q.convertDataToRepresentationInfo(e.currentRepresentation))?t.mediaInfo.streamInfo:null)&&re.id===n.id&&(re=n,T())}function C(){G.trigger(l.default.CAN_PLAY)}function k(){Y.info("Native video element event: play"),T(),E(),G.trigger(l.default.PLAYBACK_STARTED,{startTime:h()})}function I(){Y.info("Native video element event: waiting"),G.trigger(l.default.PLAYBACK_WAITING,{playingTime:h()})}function A(){Y.info("Native video element event: playing"),G.trigger(l.default.PLAYBACK_PLAYING,{playingTime:h()})}function x(){Y.info("Native video element event: pause"),G.trigger(l.default.PLAYBACK_PAUSED,{ended:m()})}function D(){var e=h();isNaN(ce)||ce===e||(e=ce),ce=NaN,Y.info("Seeking to: "+e),E(),G.trigger(l.default.PLAYBACK_SEEKING,{seekTime:e})}function R(){Y.info("Native video element event: seeked"),G.trigger(l.default.PLAYBACK_SEEKED),J.addEventListener("seeking",D)}function M(){re&&G.trigger(l.default.PLAYBACK_TIME_UPDATED,{timeToEnd:t(),time:h()})}function N(){G.trigger(l.default.PLAYBACK_PROGRESS)}function O(){var e=g();Y.info("Native video element event: ratechange: ",e),G.trigger(l.default.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function P(){Y.info("Native video element event: loadedmetadata"),G.trigger(l.default.PLAYBACK_METADATA_LOADED),E()}function L(){Y.info("Native video element event: ended"),d(),w(),G.trigger(l.default.PLAYBACK_ENDED,{isLast:K.getActiveStreamInfo().isLast})}function F(e){var t;ne&&e.isLast&&(Y.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended"),t=e.seekTime?e.seekTime:n(),J.setCurrentTime(t),d(),w())}function j(e){var t=e.target||e.srcElement;G.trigger(l.default.PLAYBACK_ERROR,{error:t.error})}function B(){var e,t,n;ae&&ge.get().streaming.lowLatencyEnabled&&0<ge.get().streaming.liveCatchUpPlaybackRate&&!r()&&!u()&&(e=y(),t=Math.abs(e-oe.getLiveDelay()),n=oe.getLiveCatchupLatencyThreshold(),(ge.get().streaming.lowLatencyEnabled&&0<ge.get().streaming.liveCatchUpPlaybackRate&&0<h()&&t>ge.get().streaming.liveCatchUpMinDrift&&(isNaN(n)||e<=n)?function(){var e,t,n,i,r;J&&(e=ge.get().streaming.liveCatchUpPlaybackRate,t=oe.getLiveDelay(),i=5*(n=y()-t),r=1-e+2*e/(1+Math.pow(Math.E,-i)),fe&&(t/2<function(){var e=null;return K.getActiveStreamProcessors().forEach((function(t){var n=t.getBufferLevel();e=null===e?n:Math.min(e,n)})),e}()?fe=!1:0<n&&(r=1)),Math.abs(J.getPlaybackRate()-r)>he&&J.setPlaybackRate(r),0<ge.get().streaming.liveCatchUpMaxDrift&&!ue&&n>ge.get().streaming.liveCatchUpMaxDrift?(Y.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),ue=!0,function(){var e=X.getCurrentDVRInfo();f((e?e.range:null).end-oe.getLiveDelay(),!0,!1)}()):ue=!1)}:U)())}function U(){J&&J.setPlaybackRate(1)}function H(e){var t,n;!1!==e.stream||!ge.get().streaming.lowLatencyEnabled||isNaN(e.request.duration)||(t=1.2*e.request.duration)>oe.getLiveDelay()&&(Y.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",t.toFixed(2)),n={streaming:{liveDelay:t}},ge.update(n))}function $(e){e.streamId===re.id&&(ge.get().streaming.lowLatencyEnabled?e.state!==o.default.BUFFER_EMPTY||u()||fe||(fe=!0,U()):J.setStallState(e.mediaType,e.state===o.default.BUFFER_EMPTY))}function q(e){G.trigger(l.default.PLAYBACK_STALLED,{e:e})}function z(e){!function(e,t){if(e&&e.manifestInfo&&e.manifestInfo.serviceDescriptions){for(var n=void 0,i=0;i<e.manifestInfo.serviceDescriptions.length;i++){var r=e.manifestInfo.serviceDescriptions[i];if(r.schemeIdUri===a.default.SERVICE_DESCRIPTION_LL_SCHEME){n=r;break}}n&&t&&t.supplementalProperties&&"true"===t.supplementalProperties[a.default.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(n.latency&&0<n.latency.target&&(Y.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),ge.update({streaming:{lowLatencyEnabled:!0,liveDelay:n.latency.target/1e3,liveCatchUpMinDrift:n.latency.max>n.latency.target?(n.latency.max-n.latency.target)/1e3:void 0}})),n.playbackRate&&1<n.playbackRate.max&&(Y.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),ge.update({streaming:{lowLatencyEnabled:!0,liveCatchUpPlaybackRate:n.playbackRate.max-1}})))}}(e.streamInfo,e.mediaInfo)}var V=this.context,G=(0,s.default)(V).getInstance(),W=void 0,Y=void 0,K=void 0,X=void 0,Q=void 0,J=void 0,Z=void 0,ee=void 0,te=void 0,ne=void 0,ie=void 0,re=void 0,ae=void 0,oe=void 0,se=void 0,le=void 0,de=void 0,ce=void 0,ue=void 0,fe=void 0,he=void 0,pe=void 0,ge=void 0;return W={initialize:function(t,n,r){re=t,J.addEventListener("canplay",C),J.addEventListener("play",k),J.addEventListener("waiting",I),J.addEventListener("playing",A),J.addEventListener("pause",x),J.addEventListener("error",j),J.addEventListener("seeking",D),J.addEventListener("seeked",R),J.addEventListener("timeupdate",M),J.addEventListener("progress",N),J.addEventListener("ratechange",O),J.addEventListener("loadedmetadata",P),J.addEventListener("stalled",q),J.addEventListener("ended",L),ae=re.manifestInfo.isDynamic,ee=!(fe=ue=!1)===n,te=r;var a="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",o=/safari/.test(a)&&!/chrome/.test(a);he=o?.25:.02,G.on(l.default.STREAM_INITIALIZED,e,this),G.on(l.default.DATA_UPDATE_COMPLETED,S,this),G.on(l.default.LOADING_PROGRESS,H,this),G.on(l.default.BUFFER_LEVEL_STATE_CHANGED,$,this),G.on(l.default.PLAYBACK_PROGRESS,B,this),G.on(l.default.PLAYBACK_TIME_UPDATED,B,this),G.on(l.default.PLAYBACK_ENDED,F,this),G.on(l.default.STREAM_INITIALIZING,z,this),se&&(se=!1,i())},setConfig:function(e){e&&(e.streamController&&(K=e.streamController),e.dashMetrics&&(X=e.dashMetrics),e.mediaPlayerModel&&(oe=e.mediaPlayerModel),e.adapter&&(Q=e.adapter),e.videoModel&&(J=e.videoModel),e.timelineConverter&&(Z=e.timelineConverter),e.uriFragmentModel&&(pe=e.uriFragmentModel),e.settings&&(ge=e.settings))},getStartTimeFromUriParameters:b,getTimeToStreamEnd:t,getTime:h,getNormalizedTime:p,getPlaybackRate:g,getPlayedRanges:function(){return re&&J?J.getPlayedRanges():null},getEnded:m,getIsDynamic:v,getStreamController:function(){return K},computeAndSetLiveDelay:function(e,t,n){var i,r,a=void 0,o=void 0,s=!isNaN(e)&&isFinite(e)?e:NaN,l=Q.getSuggestedPresentationDelay();a=ge.get().streaming.lowLatencyEnabled?0:oe.getLiveDelay()?oe.getLiveDelay():null===ge.get().streaming.liveDelayFragmentCount||isNaN(ge.get().streaming.liveDelayFragmentCount)||isNaN(s)?!0===ge.get().streaming.useSuggestedPresentationDelay&&null!==l&&!isNaN(l)&&0<l?l:isNaN(s)?isNaN(n)?4*re.manifestInfo.minBufferTime:4*n:4*s:s*ge.get().streaming.liveDelayFragmentCount;return null!==(r=Q.getAvailabilityStartTime())&&(de=r),o=0<t?(i=Math.max(t-10,t/2),Math.min(a,i)):a,ie=o},getLiveDelay:function(){return ie},setLiveDelay:function(e){!(arguments.length<=1||void 0===arguments[1])&&arguments[1]&&e<ie||(ie=e)},getCurrentLiveLatency:y,play:i,isPaused:r,pause:d,isSeeking:u,getStreamEndTime:n,seek:f,reset:_},Y=(0,c.default)(V).getInstance().getLogger(W),_(),W}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(109)),s=i(e(46)),l=i(e(54)),d=i(e(47)),c=i(e(45));r.__dashjs_factory_name="PlaybackController",n.default=d.default.getSingletonFactory(r),t.exports=n.default},{108:108,109:109,45:45,46:46,47:47,54:54}],121:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){return!1===Q}function n(){t()||X&&!G.getIsBufferingCompleted()&&(K.debug("Schedule Controller starts"),Q=!1,L.createPlaylistTraceMetrics(X.id,1e3*U.getTime(),U.getPlaybackRate()),u(0))}function i(){Q||(K.debug("Schedule Controller stops"),K.debug(q+" Schedule Controller stops"),Q=!0,clearTimeout(ee))}function r(){var e,t;Q||J||U.isPaused()&&!W.get().streaming.scheduleWhilePaused||(q===a.default.FRAGMENTED_TEXT||q===a.default.TEXT)&&!H.isTextEnabled()||G.getIsBufferingCompleted()?i():(function(){var e,t=U.getTime(),n=1.5;isNaN(X.fragmentDuration)&&(n=(e=L.getCurrentSchedulingInfo(X.mediaInfo.type))?1.5*e.duration:1.5);var i,r,a,s,d,c=j.getRequests({state:l.default.FRAGMENT_MODEL_EXECUTED,time:t+n,threshold:0})[0];c&&-1===se.indexOf(c)&&!P.getIsTextTrack(z)&&(i=W.get().streaming.fastSwitchEnabled,r=G.getBufferLevel(),a=B.getAbandonmentStateFor(q),s=!V.isCurrentTrack(c.mediaInfo)&&V.getSwitchMode(c.mediaInfo.type)===h.default.TRACK_SWITCH_MODE_NEVER_REPLACE,d=c.quality<X.quality,i&&(s||d)&&n<=r&&a!==o.default.ABANDON_LOAD?(g(c),fe=!0,K.debug("Reloading outdated fragment at index: ",c.index)):c.quality>X.quality&&!de&&D(U.getTime()+r))}(),e=0<se.length,de||isNaN(oe)||le||e||function(e,t){ae[t]=ae[t]||{};var n=B.getTopQualityIndexFor(e,t);return ae[t][e]!=n&&(K.info("Top quality "+e+" index has changed from "+ae[t][e]+" to "+n),ae[t][e]=n,1)}(q,$)||ie.execute(q,X,ne)?(p(!0),!e&&ue&&B.checkPlaybackQuality(q),ue=X.quality===oe&&!le||de?(t=se.shift())&&t.isInitializationRequest()?(O.trigger(c.default.INIT_FRAGMENT_NEEDED,{sender:Y,streamId:$,mediaType:q,representationId:t.representationId}),!1):(O.trigger(c.default.MEDIA_FRAGMENT_NEEDED,{sender:Y,streamId:$,mediaType:q,seekTarget:te,replacement:t}),!0):(le?(K.debug("Switch track for "+q+", representation id = "+X.id),(de=V.getSwitchMode(q)===h.default.TRACK_SWITCH_MODE_ALWAYS_REPLACE)&&G.replaceBuffer&&G.replaceBuffer(),le=!1):K.debug("Quality has changed, get init request for representationid = "+X.id),O.trigger(c.default.INIT_FRAGMENT_NEEDED,{sender:Y,streamId:$,mediaType:q,representationId:X.id}),oe=X.quality,!1)):u(500))}function u(e){clearTimeout(ee),ee=setTimeout(r,e)}function p(e){J!==e?J=e:K.debug("isFragmentProcessingInProgress is already equal to",e)}function g(e){se.push(e)}function m(e){var t;U&&j&&(t=j.getRequests({state:l.default.FRAGMENT_MODEL_EXECUTED,time:U.getTime(),threshold:0})[0])&&U.getTime()>=t.startTime&&((!re.mediaInfo||t.mediaInfo.type===re.mediaInfo.type&&t.mediaInfo.id!==re.mediaInfo.id)&&e&&O.trigger(c.default.TRACK_CHANGE_RENDERED,{mediaType:q,oldMediaInfo:re.mediaInfo,newMediaInfo:t.mediaInfo}),t.quality===re.quality&&t.adaptationIndex===re.adaptationIndex||!e||O.trigger(c.default.QUALITY_CHANGE_RENDERED,{mediaType:q,oldQuality:re.quality,newQuality:t.quality}),re={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}function v(e){e.request.mediaInfo.streamInfo.id===$&&e.request.mediaType===q&&(i(),p(!1),K.info("Stream "+$+" is complete"))}function y(e){e.request.mediaInfo.streamInfo.id===$&&e.request.mediaType===q&&(K.info("OnFragmentLoadingCompleted - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),P.getIsTextTrack(z)&&p(!1),e.error&&e.request.serviceLocation&&!Q&&(g(e.request),p(!1),u(0)),de&&(ce=e.request))}function _(){m(!0)}function b(e){var t,n,i;e.streamId===$&&e.mediaType===q&&(de&&!isNaN(e.startTime)&&(de=!1,j.addExecutedRequest(ce)),p(!1),fe&&!isNaN(e.startTime)?(t=U.getTime(),u((n=e.startTime+X.fragmentDuration)<=t+(i=1.5*X.fragmentDuration)?0:1e3*(n-(t+i))),fe=!1):u(0))}function E(e){e.streamId===$&&e.mediaType===q&&(K.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),U.isSeeking()||le||(K.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),g(e.request)),p(!1),u(0))}function w(e){e.sender.getType()===q&&e.sender.getStreamId()}function T(e){q===e.mediaType&&$===e.streamId&&i()}function S(e){e.streamId===$&&e.mediaType===q&&(de&&W.get().streaming.flushBufferAtTrackSwitch&&U.seek(U.getTime()+.001,!1,!0),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&n())}function C(e){e.streamId===$&&e.mediaType===q&&(i(),p(!1))}function k(){j.abortRequests(),i()}function I(){!Q&&W.get().streaming.scheduleWhilePaused||n()}function A(e){D(e.seekTime),R(0),Q&&n();var t=X.DVRWindow&&U?X.DVRWindow.end-U.getTime():NaN;L.updateManifestUpdateInfo({latency:t}),J?j.abortRequests():u(0)}function x(e){L.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function D(e){te=e}function R(e){Z=e}function M(){re={mediaInfo:void(Z=0),quality:oe=te=NaN,adaptationIndex:NaN},ae={},se=[],fe=de=le=!(Q=!(J=!(ue=!(ce=null))))}e=e||{};var N=this.context,O=(0,d.default)(N).getInstance(),P=e.adapter,L=e.dashMetrics,F=e.mediaPlayerModel,j=e.fragmentModel,B=e.abrController,U=e.playbackController,H=e.textController,$=e.streamId,q=e.type,z=e.mimeType,V=e.mediaController,G=e.bufferController,W=e.settings,Y=void 0,K=void 0,X=void 0,Q=void 0,J=void 0,Z=void 0,ee=void 0,te=void 0,ne=void 0,ie=void 0,re=void 0,ae=void 0,oe=void 0,se=void 0,le=void 0,de=void 0,ce=void 0,ue=void 0,fe=void 0;return Y={initialize:function(e){ne=e,ie=(0,s.default)(N).create({abrController:B,dashMetrics:L,mediaPlayerModel:F,textController:H,settings:W}),O.on(c.default.DATA_UPDATE_STARTED,w,this),O.on(c.default.FRAGMENT_LOADING_COMPLETED,y,this),O.on(c.default.STREAM_COMPLETED,v,this),O.on(c.default.BUFFER_CLEARED,S,this),O.on(c.default.BYTES_APPENDED_END_FRAGMENT,b,this),O.on(c.default.QUOTA_EXCEEDED,C,this),O.on(c.default.PLAYBACK_SEEKING,A,this),O.on(c.default.PLAYBACK_STARTED,I,this),O.on(c.default.PLAYBACK_RATE_CHANGED,x,this),O.on(c.default.PLAYBACK_TIME_UPDATED,_,this),O.on(c.default.URL_RESOLUTION_FAILED,k,this),O.on(c.default.FRAGMENT_LOADING_ABANDONED,E,this),O.on(c.default.BUFFERING_COMPLETED,T,this)},getType:function(){return q},getStreamId:function(){return $},setCurrentRepresentation:function(e){X=e},setSeekTarget:D,setTimeToLoadDelay:R,getTimeToLoadDelay:function(){return Z},switchTrackAsked:function(){le=!0},isStarted:t,start:n,stop:i,reset:function(){O.off(c.default.DATA_UPDATE_STARTED,w,this),O.off(c.default.FRAGMENT_LOADING_COMPLETED,y,this),O.off(c.default.STREAM_COMPLETED,v,this),O.off(c.default.BUFFER_CLEARED,S,this),O.off(c.default.BYTES_APPENDED_END_FRAGMENT,b,this),O.off(c.default.QUOTA_EXCEEDED,C,this),O.off(c.default.PLAYBACK_SEEKING,A,this),O.off(c.default.PLAYBACK_STARTED,I,this),O.off(c.default.PLAYBACK_RATE_CHANGED,x,this),O.off(c.default.PLAYBACK_TIME_UPDATED,_,this),O.off(c.default.URL_RESOLUTION_FAILED,k,this),O.off(c.default.FRAGMENT_LOADING_ABANDONED,E,this),O.off(c.default.BUFFERING_COMPLETED,T,this),i(),m(!1),M()},getBufferTarget:function(){return ie.getBufferTarget(q,X)},processInitRequest:function(e){e&&(p(!0),j.executeRequest(e))},processMediaRequest:function(e){e?(K.debug("Next fragment request url is "+e.url),j.executeRequest(e)):(U.getIsDynamic()&&K.debug("Next fragment seems to be at the bleeding live edge and is not available yet. Rescheduling."),p(!1),u(W.get().streaming.lowLatencyEnabled?100:500))}},K=(0,f.default)(N).getInstance().getLogger(Y),M(),Y}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(109)),s=i(e(197)),l=i(e(150)),d=i(e(46)),c=i(e(54)),u=i(e(47)),f=i(e(45)),h=i(e(118));r.__dashjs_factory_name="ScheduleController",n.default=u.default.getClassFactory(r),t.exports=n.default},{108:108,109:109,118:118,150:150,197:197,45:45,46:46,47:47,54:54}],122:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){var e;!F()||(e=Se.getPlaybackQuality())&&ie.addDroppedFrames(e)}function t(e){var t=k(e.seekTime);t===me&&Me&&0<Me.length&&Me.forEach((function(e){e.deactivate(!0)})),
t&&t!==me?(B(f.PlayListTrace.END_OF_PERIOD_STOP_REASON),D(t,me,e.seekTime)):B(f.PlayListTrace.USER_REQUEST_STOP_REASON),U(f.PlayList.SEEK_START_REASON)}function n(e){var t=x();B(f.PlayListTrace.END_OF_PERIOD_STOP_REASON),D(t,me,e.seekTime),U(f.PlayList.SEEK_START_REASON)}function i(){Q.debug("[onPlaybackStarted]"),Ae?(Ae=!1,U(f.PlayList.INITIAL_PLAYOUT_START_REASON)):Ie&&(Ie=!1,U(f.PlayList.RESUME_FROM_PAUSE_START_REASON))}function r(e){Q.debug("[onPlaybackPaused]"),e.ended||(Ie=!0,B(f.PlayListTrace.USER_REQUEST_STOP_REASON))}function u(){xe&&(clearInterval(xe),xe=null)}function w(){De=De||setInterval((function(){!function(){function e(){var e,i,r=t[n],o=0===n?me:t[n-1];!r.getPreloadingScheduled()&&T(o)&&Te&&(e=[a.default.VIDEO,a.default.AUDIO],i=!0,e.forEach((function(e){var t=ne.getMediaInfoForType(r.getStreamInfo(),e);ne.getVoRepresentations(t).forEach((function(e){var t=pe.calcSegmentAvailabilityRange(e,!0);t.end<t.start&&(i=!1)}))})),i&&function(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];Te&&!e.getPreloaded()&&C(e,t)&&(e.setPreloadingScheduled(!0),Q.info("[onStreamCanLoadNext] Preloading next stream with id "+e.getId()),e.preload(Te,Re),Me.push(e),e.getProcessors().forEach((function(t){t.setBufferingTime(e.getStartTime())})))}(r,o)),n+=1}if(me&&T(me))for(var t=function(e){try{var t=e||me||null;if(t){var n=function(){var e=t.getStreamInfo().start;return{v:ge.filter((function(t){return t.getStreamInfo().start>e}))}}();if("object"==typeof n)return n.v}}catch(e){return[]}}(me),n=0;n<t.length;)e()}()}),500)}function T(e){try{if(!e)return!1;var t=e.getProcessors().filter((function(e){return e.getType()===a.default.AUDIO||e.getType()===a.default.VIDEO}));if(!t||0===t.length)return!1;var n=t.filter((function(e){return!e.isBufferingCompleted()}));return n&&0===n.length}catch(e){return!1}}function S(){var e=$().isLast;Te&&e&&(Q.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),re.signalEndOfStream(Te))}function C(e,t){try{return t.isProtectionCompatible(e,t)&&(Ne||t.isMediaCodecCompatible(e,t))&&!function(e){try{var t=e.getStreamInfo(),n=ne.getAdaptationForType(t.index,a.default.FRAGMENTED_TEXT,t);return!!n&&(-1!==n.codecs.indexOf("stpp")||-1!==n.codecs.indexOf("wvtt"))}catch(e){return!1}}(e)}catch(e){return!1}}function k(e){if(isNaN(e))return null;var t=0,n=null,i=ge.length;0<i&&(t+=ge[0].getStartTime());for(var r=0;r<i;r++)if(n=ge[r],e<(t=parseFloat((t+n.getDuration()).toFixed(5))))return n;return null}function I(){return me?me.getProcessors():[]}function A(e){var t;me.getIsEndedEventSignaled()||(me.setIsEndedEventSignaled(!0),(t=x())?(Q.debug("StreamController onEnded, found next stream with id "+t.getStreamInfo().id),D(t,me,NaN)):(Q.debug("StreamController no next stream found"),me.setIsEndedEventSignaled(!1)),B(t?f.PlayListTrace.END_OF_PERIOD_STOP_REASON:f.PlayListTrace.END_OF_CONTENT_STOP_REASON)),e&&e.isLast&&u()}function x(e){var t=(arguments.length<=0||void 0===e?null:e)||me||null;if(t){for(var n=t.getStreamInfo().start,i=t.getStreamInfo().duration,r=parseFloat((n+i).toFixed(5)),a=0,o=-1,s=NaN;a<ge.length;){var l=ge[a].getStreamInfo().start-r;0<=l&&(isNaN(s)||l<s)&&(s=l,o=a),a+=1}return 0<=o?ge[o]:null}return null}function D(e,t,n){var i;be||!e||t===e&&e.isActive()||(be=!0,K.trigger(c.default.PERIOD_SWITCH_STARTED,{fromStreamInfo:t?t.getStreamInfo():null,toStreamInfo:e.getStreamInfo()}),i=!1,t&&(i=C(e,t),t.deactivate(i)),n=isNaN(n)?!i&&t?e.getStreamInfo().start:NaN:n,Q.info("Switch to stream "+e.getId()+". Seektime is "+n+", current playback time is "+Ce.getTime()),Q.info("Seamless period switch is set to "+i),me=e,Me=Me.filter((function(e){return e.getId()!==me.getId()})),Ce.initialize($(),!!t,n),Se.getElement()?R(n,null===t,!1,i):M(n,i))}function R(e,t,n,i){function r(){Te&&"open"===Te.readyState&&(Q.debug("MediaSource is open!"),window.URL.revokeObjectURL(a),Te.removeEventListener("sourceopen",r),Te.removeEventListener("webkitsourceopen",r),N(),t||K.trigger(c.default.SOURCE_INITIALIZED),n?me.setMediaSource(Te):M(e,i))}var a=void 0;Te?i?(M(e,i),t||K.trigger(c.default.SOURCE_INITIALIZED)):(re.detachMediaSource(Se),Te.addEventListener("sourceopen",r,!1),Te.addEventListener("webkitsourceopen",r,!1),a=re.attachMediaSource(Te,Se),Q.debug("MediaSource attached to element.  Waiting on open...")):((Te=re.createMediaSource()).addEventListener("sourceopen",r,!1),Te.addEventListener("webkitsourceopen",r,!1),a=re.attachMediaSource(Te,Se),Q.debug("MediaSource attached to element.  Waiting on open..."))}function M(e,t){var n;!(Re=me.activate(Te,t?Re:void 0))||0<(n=Object.keys(Re)).length&&Re[n[0]].changeType&&(Ne=!0),Ae||isNaN(e)||(e===Ce.getTime()?K.trigger(c.default.SEEK_TARGET,{time:e,streamId:me.getId()}):Ce.seek(e)),!_e&&Ae||Ce.play(),be=!1,K.trigger(c.default.PERIOD_SWITCH_COMPLETED,{toStreamInfo:$()})}function N(e){var t,n=e||$().manifestInfo.duration;n&&!isNaN(n)&&(t=re.setDuration(Te,n),Q.debug("Duration successfully set to: "+t))}function O(){try{!function(){var e=ne.getStreamsInfo();if(0===e.length)throw new Error("There are no streams");ie.updateManifestUpdateInfo({currentTime:Ce.getTime(),buffered:Se.getBufferRange(),presentationStartTime:e[0].start,clientTimeOffset:pe.getClientTimeOffset()}),0<ge.length&&(ge=ge.filter((function(t){var n=0<e.filter((function(e){return e.id===t.getId()})).length||t.getId()===me.getId();return n||Q.debug("Removing stream "+t.getId()),n})));for(var t,n,i,r=0,o=e.length;r<o;r++){var l=e[r],d=function(e){for(var t=0,n=ge.length;t<n;t++)if(ge[t].getId()===e.id)return ge[t];return null}(l);d?d.updateData(l):(d=(0,s.default)(Y).create({manifestModel:te,mediaPlayerModel:ke,dashMetrics:ie,manifestUpdater:Z,adapter:ne,timelineConverter:pe,capabilities:J,errHandler:he,baseURLController:oe,abrController:se,playbackController:Ce,eventController:de,mediaController:le,textController:ce,videoModel:Se,settings:Oe}),ge.push(d),d.initialize(l,ve)),ie.addManifestUpdateStreamInfo(l)}me||(ne.getIsDynamic()&&ge.length&&(t=e[0].manifestInfo,n=function(e,t){try{var n=NaN;return t&&!isNaN(t.maxFragmentDuration)&&isFinite(t.maxFragmentDuration)?t.maxFragmentDuration:(e&&1===e.length&&function(){var t=e[0],i=[a.default.VIDEO,a.default.AUDIO,a.default.FRAGMENTED_TEXT].reduce((function(e,n){var i=ne.getMediaInfoForType(t,n);return i&&e.push(i),e}),[]).reduce((function(e,t){var n=ne.getVoRepresentations(t);return n&&0<n.length&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=ne.convertDataToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(i))}(),isFinite(n)?n:NaN)}catch(t){return NaN}}(e,t),Ce.computeAndSetLiveDelay(n,t.DVRWindowSize,t.minBufferTime)),i=null,!(i=k(Ce.getStartTimeFromUriParameters(e[0].start,ne.getIsDynamic())))&&ne.getIsDynamic()&&ge.length&&(Q.debug("Dynamic stream: Trying to find the correct starting period"),i=function(){try{return k(pe.calcPresentationTimeFromWallTime(new Date,ne.getRegularPeriods()[0])-Ce.getLiveDelay())}catch(e){return null}}()),D(null!==i?i:ge[0],null,NaN),xe=xe||setInterval((function(){!be&&Ce.getTimeToStreamEnd()<=0&&K.trigger(c.default.PLAYBACK_ENDED,{isLast:$().isLast})}),200),w()),K.trigger(c.default.STREAMS_COMPOSED)}()}catch(e){he.error(new _.default(b.default.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",te.getValue())),we=!0,G()}}function P(){var e=te.getValue();ve&&(K.trigger(c.default.PROTECTION_CREATED,{controller:ve,manifest:e}),ve.setMediaElement(Se.getElement()),ye&&ve.setProtectionData(ye)),O()}function L(e){e.error?(we=!0,G()):function(){var t=e.manifest;ne.updatePeriods(t);var n=ne.getUTCTimingSources(),i=ne.getIsDynamic()?n.concat(ke.getUTCTimingSources()):n,r=fe.isHTTPS(e.manifest.url);i.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===ke.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(r?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),r?"https://":"http://"),Q.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),oe.initialize(t),ae.setConfig({dashMetrics:ie,baseURLController:oe}),ae.initialize(i,Oe.get().streaming.useManifestDateHeaderTimeSource)}()}function F(){return!!me&&me.getHasVideoTrack()}function j(){return!!me&&me.getHasAudioTrack()}function B(e,t){t=t||new Date,I().forEach((function(n){n.finalisePlayList(t,e)})),ie.addPlayList()}function U(e){ie.createPlaylistMetrics(1e3*Ce.getTime(),e)}function H(e){if(e.error){var t="";switch(e.error.code){case 1:t="MEDIA_ERR_ABORTED";break;case 2:t="MEDIA_ERR_NETWORK";break;case 3:t="MEDIA_ERR_DECODE";break;case 4:t="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:t="MEDIA_ERR_ENCRYPTED";break;default:t="UNKNOWN"}Ee=!0,e.error.message&&(t+=" ("+e.error.message+")"),e.error.msExtendedCode&&(t+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),Q.fatal("Video Element Error: "+t),e.error&&Q.fatal(e.error),he.error(new _.default(e.error.code,t)),G()}}function $(){return me?me.getStreamInfo():null}function q(){if(!(ee&&ee.hasOwnProperty("load")&&pe&&pe.hasOwnProperty("initialize")&&pe.hasOwnProperty("reset")&&pe.hasOwnProperty("getClientTimeOffset")&&te&&he&&ie&&Ce))throw new Error(a.default.MISSING_CONFIG_ERROR)}function z(e){isNaN(e.newDuration)||N(e.newDuration)}function V(){De=xe=me=ve=null,_e=!(Ie=!(Ae=!(we=Ee=be=!(ge=[])))),Me=[]}function G(){q(),ae.reset(),B(Ee||we?f.PlayListTrace.FAILURE_STOP_REASON:f.PlayListTrace.USER_REQUEST_STOP_REASON);for(var a=0,o=ge?ge.length:0;a<o;a++)ge[a].reset(Ee);!function(){K.off(c.default.PLAYBACK_TIME_UPDATED,e,this),K.off(c.default.PLAYBACK_SEEKING,t,this),K.off(c.default.GAP_CAUSED_SEEK_TO_PERIOD_END,n,this),K.off(c.default.PLAYBACK_ERROR,H,this),K.off(c.default.PLAYBACK_STARTED,i,this),K.off(c.default.PLAYBACK_PAUSED,r,this),K.off(c.default.PLAYBACK_ENDED,A,this),K.off(c.default.MANIFEST_UPDATED,L,this),K.off(c.default.STREAM_BUFFERING_COMPLETED,S,this),K.off(c.default.MANIFEST_VALIDITY_CHANGED,z,this),K.off(c.default.TIME_SYNCHRONIZATION_COMPLETED,P,this),K.off(m.default.METRIC_ADDED,W,this)}(),oe.reset(),Z.reset(),de.reset(),ie.clearAllCurrentMetrics(),te.setValue(null),ee.reset(),pe.reset(),ue.reset(),Te&&(re.detachMediaSource(Se),Te=null),Se=null,ve&&(ve.setMediaElement(null),ye=ve=null,te.getValue()&&K.trigger(c.default.PROTECTION_DESTROYED,{data:te.getValue().url})),u(),clearInterval(De),De=null,K.trigger(c.default.STREAM_TEARDOWN_COMPLETE),V()}function W(e){var t;e.metric===o.default.DVR_INFO&&(t=j()?a.default.AUDIO:a.default.VIDEO,e.mediaType===t&&re.setSeekable(Te,e.value.range.start,e.value.range.end))}var Y=this.context,K=(0,d.default)(Y).getInstance(),X=void 0,Q=void 0,J=void 0,Z=void 0,ee=void 0,te=void 0,ne=void 0,ie=void 0,re=void 0,ae=void 0,oe=void 0,se=void 0,le=void 0,de=void 0,ce=void 0,ue=void 0,fe=void 0,he=void 0,pe=void 0,ge=void 0,me=void 0,ve=void 0,ye=void 0,_e=void 0,be=void 0,Ee=void 0,we=void 0,Te=void 0,Se=void 0,Ce=void 0,ke=void 0,Ie=void 0,Ae=void 0,xe=void 0,De=void 0,Re=void 0,Me=void 0,Ne=void 0,Oe=void 0;return X={initialize:function(a,o){q(),_e=a,ye=o,pe.initialize(),(Z=(0,l.default)(Y).create()).setConfig({manifestModel:te,adapter:ne,manifestLoader:ee,errHandler:he,settings:Oe}),Z.initialize(),(de=(0,E.default)(Y).getInstance()).setConfig({manifestUpdater:Z,playbackController:Ce}),de.start(),function(){K.on(c.default.PLAYBACK_TIME_UPDATED,e,this),K.on(c.default.PLAYBACK_SEEKING,t,this),K.on(c.default.GAP_CAUSED_SEEK_TO_PERIOD_END,n,this),K.on(c.default.PLAYBACK_ERROR,H,this),K.on(c.default.PLAYBACK_STARTED,i,this),K.on(c.default.PLAYBACK_PAUSED,r,this),K.on(c.default.PLAYBACK_ENDED,A,this),K.on(c.default.MANIFEST_UPDATED,L,this),K.on(c.default.STREAM_BUFFERING_COMPLETED,S,this),K.on(c.default.MANIFEST_VALIDITY_CHANGED,z,this),K.on(c.default.TIME_SYNCHRONIZATION_COMPLETED,P,this),K.on(m.default.METRIC_ADDED,W,this)}()},getActiveStreamInfo:$,hasVideoTrack:F,hasAudioTrack:j,switchToVideoElement:function(e){me&&(Ce.initialize($()),R(e,!1,!0,!1))},getStreamById:function(e){return ge.filter((function(t){return t.getId()===e}))[0]},getStreamForTime:k,getTimeRelativeToStreamId:function(e,t){for(var n=null,i=0,r=0,a=null,o=0;o<ge.length;o++){if(r=(n=ge[o]).getStartTime(),a=n.getDuration(),Number.isFinite(r)&&(i=r),n.getId()===t)return e-i;Number.isFinite(a)&&(i+=a)}return null},load:function(e){q(),ee.load(e)},loadWithManifest:function(e){!function(){if(!Z||!Z.hasOwnProperty("setManifest"))throw new Error("initialize function has to be called previously")}(),Z.setManifest(e)},getActiveStreamProcessors:I,setConfig:function(e){e&&(e.capabilities&&(J=e.capabilities),e.manifestLoader&&(ee=e.manifestLoader),e.manifestModel&&(te=e.manifestModel),e.mediaPlayerModel&&(ke=e.mediaPlayerModel),e.protectionController&&(ve=e.protectionController),e.adapter&&(ne=e.adapter),e.dashMetrics&&(ie=e.dashMetrics),e.errHandler&&(he=e.errHandler),e.timelineConverter&&(pe=e.timelineConverter),e.videoModel&&(Se=e.videoModel),e.playbackController&&(Ce=e.playbackController),e.abrController&&(se=e.abrController),e.mediaController&&(le=e.mediaController),e.textController&&(ce=e.textController),e.settings&&(Oe=e.settings),e.baseURLController&&(oe=e.baseURLController))},setProtectionData:function(e){ye=e},getIsStreamSwitchInProgress:function(){return be},getHasMediaOrIntialisationError:function(){return Ee||we},hasStreamFinishedBuffering:T,getStreams:function(){return ge},getActiveStream:function(){return me},reset:G},Q=(0,h.default)(Y).getInstance().getLogger(X),ae=(0,v.default)(Y).getInstance(),re=(0,y.default)(Y).getInstance(),ue=(0,p.default)(Y).getInstance(),fe=(0,g.default)(Y).getInstance(),V(),X}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(109)),s=i(e(105)),l=i(e(99)),d=i(e(46)),c=i(e(54)),u=i(e(47)),f=e(244),h=i(e(45)),p=i(e(214)),g=i(e(221)),m=i(e(101)),v=i(e(123)),y=i(e(119)),_=i(e(226)),b=i(e(51)),E=i(e(115));r.__dashjs_factory_name="StreamController",n.default=u.default.getSingletonFactory(r),t.exports=n.default},{101:101,105:105,108:108,109:109,115:115,119:119,123:123,214:214,221:221,226:226,244:244,45:45,46:46,47:47,51:51,54:54,99:99}],123:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){S=e}function t(e){T=e}function n(e){var t,n,i,r=Date.parse(e);return isNaN(r)&&(n=t=void 0,i=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e),t=Date.UTC(parseInt(i[1],10),parseInt(i[2],10)-1,parseInt(i[3],10),parseInt(i[4],10),parseInt(i[5],10),i[6]&&(parseInt(i[6],10)||0),i[7]&&1e3*parseFloat(i[7])||0),i[9]&&i[10]&&(n=60*parseInt(i[9],10)+parseInt(i[10],10),t+=("+"===i[8]?-1:1)*n*60*1e3),r=new Date(t).getTime()),r}function i(e){return Date.parse(e)}function r(e){return Date.parse(e)}function c(e,t,n){n()}function h(e,t,i){var r=n(e);isNaN(r)?i():t(r)}function p(e,t,n,i,r){var a,s,l,d=!1,c=new XMLHttpRequest,u=r?o.HTTPRequest.HEAD:o.HTTPRequest.GET,f=t.match(/\S+/g);t=f.shift(),a=function(){d||(d=!0,f.length?p(e,f.join(" "),n,i,r):i())},s=function(){var t=void 0,i=void 0;200===c.status&&(t=r?c.getResponseHeader("Date"):c.response,i=e(t),isNaN(i)||(n(i),d=!0))},!b.isRelative(t)||(l=A.resolve())&&(t=b.resolve(t,l.url)),c.open(u,t),c.timeout=5e3,c.onload=s,c.onloadend=a,c.send()}function g(e,t,n){p(r,e,t,n,!0)}function m(){var e=I.getLatestMPDRequestHeaderValueByID("Date"),n=null!==e?new Date(e).getTime():Number.NaN;isNaN(n)?v(!0):(t(n-(new Date).getTime()),v(!1,n/1e3,T))}function v(t,n,i){e(!1),_.trigger(l.default.TIME_SYNCHRONIZATION_COMPLETED,{time:n,offset:i,error:t?new a.default(d.default.TIME_SYNC_FAILED_ERROR_CODE,d.default.TIME_SYNC_FAILED_ERROR_MESSAGE):null})}var y=this.context,_=(0,s.default)(y).getInstance(),b=(0,f.default)(y).getInstance(),E=void 0,w=void 0,T=void 0,S=void 0,C=void 0,k=void 0,I=void 0,A=void 0;return E={initialize:function(r,a){C=a,T=0,S=!1,k={"urn:mpeg:dash:utc:http-head:2014":g,"urn:mpeg:dash:utc:http-xsdate:2014":p.bind(null,n),"urn:mpeg:dash:utc:http-iso:2014":p.bind(null,i),"urn:mpeg:dash:utc:direct:2014":h,"urn:mpeg:dash:utc:http-head:2012":g,"urn:mpeg:dash:utc:http-xsdate:2012":p.bind(null,n),"urn:mpeg:dash:utc:http-iso:2012":p.bind(null,i),"urn:mpeg:dash:utc:direct:2012":h,"urn:mpeg:dash:utc:http-ntp:2014":c,"urn:mpeg:dash:utc:ntp:2014":c,"urn:mpeg:dash:utc:sntp:2014":c},S||function n(i,r){var a=r||0,o=i[a],s=function(e,t){var n=!e||!t;n&&C?m():v(n,e,t)};e(!0),o?k.hasOwnProperty(o.schemeIdUri)?k[o.schemeIdUri](o.value,(function(e){var n=(new Date).getTime(),i=e-n;t(i),w.info("Local time: "+new Date(n)),w.info("Server time: "+new Date(e)),w.info("Server Time - Local Time (ms): "+i),s(e,i)}),(function(){n(i,a+1)})):n(i,a+1):(t(0),s())}(r)},getOffsetToDeviceTimeMs:function(){return T},setConfig:function(e){e&&(e.dashMetrics&&(I=e.dashMetrics),e.baseURLController&&(A=e.baseURLController))},reset:function(){e(!1)}},w=(0,u.default)(y).getInstance().getLogger(E),E}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(226)),o=e(242),s=i(e(46)),l=i(e(54)),d=i(e(51)),c=i(e(47)),u=i(e(45)),f=i(e(221));r.__dashjs_factory_name="TimeSyncController";var h=c.default.getSingletonFactory(r);h.HTTP_TIMEOUT_MS=5e3,c.default.updateSingletonFactory(r.__dashjs_factory_name,h),n.default=h,t.exports=n.default},{221:221,226:226,242:242,45:45,46:46,47:47,51:51,54:54}],124:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e,t,n){var r={},a=void 0,o=void 0;r.elements=e,r.type=t,r.resolveType=n,0===r.elements.length&&i(r);for(var s=0;s<r.elements.length;s++)a=r.elements[s],o=p.isHTTPURL(a.url)?a.url:a.originalContent.BaseURL+a.url,b.load(o,a,r)}function n(e){var t,n=void 0,r="",a=(n=e.element,e.resolveObject);n.resolvedContent&&((t=0)===n.resolvedContent.indexOf("<?xml")&&(t=n.resolvedContent.indexOf("?>")+2),r=n.resolvedContent.substr(0,t)+"<response>"+n.resolvedContent.substr(t)+"</response>",n.resolvedContent=_.xml_str2json(r)),function(e){var t=void 0;for(t=0;t<e.elements.length;t++)if(!1===e.elements[t].resolved)return!1;return!0}(a)&&i(a)}function i(e){var n=[],i=void 0,a=void 0;if(function(e){var t=[],n=void 0,i=void 0,r=void 0,a=void 0,o=void 0,s=void 0;for(a=e.elements.length-1;0<=a;a--){if(i=(n=e.elements[a]).type+"_asArray",n.resolvedContent){if(n.resolvedContent)for(o=0;o<n.resolvedContent[i].length;o++)r=n.resolvedContent[i][o],t.push(r)}else delete n.originalContent["xlink:actuate"],delete n.originalContent["xlink:href"],t.push(n.originalContent);for(n.parentElement[i].splice(n.index,1),s=0;s<t.length;s++)n.parentElement[i].splice(n.index+s,0,t[s]);t=[]}0<e.elements.length&&v.run(y)}(e),"onActuate"===e.resolveType&&h.trigger(s.default.XLINK_READY,{manifest:y}),e.resolveType===f)switch(e.type){case u.default.PERIOD:for(i=0;i<y[u.default.PERIOD+"_asArray"].length;i++)(a=y[u.default.PERIOD+"_asArray"][i]).hasOwnProperty(u.default.ADAPTATION_SET+"_asArray")&&(n=n.concat(r(a[u.default.ADAPTATION_SET+"_asArray"],a,u.default.ADAPTATION_SET,f))),a.hasOwnProperty(u.default.EVENT_STREAM+"_asArray")&&(n=n.concat(r(a[u.default.EVENT_STREAM+"_asArray"],a,u.default.EVENT_STREAM,f)));t(n,u.default.ADAPTATION_SET,f);break;case u.default.ADAPTATION_SET:h.trigger(s.default.XLINK_READY,{manifest:y})}}function r(e,t,n,i){var r=[],a=void 0,o=void 0,s=void 0;for(o=e.length-1;0<=o;o--)(a=e[o]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===a["xlink:href"]&&e.splice(o,1);for(o=0;o<e.length;o++)(a=e[o]).hasOwnProperty("xlink:href")&&a.hasOwnProperty("xlink:actuate")&&a["xlink:actuate"]===i&&(s={url:a["xlink:href"],parentElement:t,type:n,index:o,resolveType:i,originalContent:a,resolvedContent:null,resolved:!1},r.push(s));return r}e=e||{};var l=this.context,h=(0,o.default)(l).getInstance(),p=(0,c.default)(l).getInstance(),g=void 0,m=void 0,v=void 0,y=void 0,_=void 0,b=void 0;return g={resolveManifestOnLoad:function(e){_=new d.default({escapeMode:!1,attributePrefix:"",arrayAccessForm:"property",emptyNodeForm:"object",stripWhitespaces:!1,enableToStringFunc:!1,ignoreRoot:!0,matchers:m}),t(r((y=e).Period_asArray,y,u.default.PERIOD,f),u.default.PERIOD,f)},setMatchers:function(e){e&&(m=e)},setIron:function(e){e&&(v=e)},reset:function(){h.off(s.default.XLINK_ELEMENT_LOADED,n,g),b&&(b.reset(),b=null)}},h.on(s.default.XLINK_ELEMENT_LOADED,n,g),b=(0,a.default)(l).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),g}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(107)),o=i(e(46)),s=i(e(54)),l=i(e(47)),d=i(e(3)),c=i(e(221)),u=i(e(61)),f="onLoad";r.__dashjs_factory_name="XlinkController",n.default=l.default.getClassFactory(r),t.exports=n.default},{107:107,221:221,3:3,46:46,47:47,54:54,61:61}],125:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=this.context;return{createMetricsReporting:function(t){return(0,a.default)(e).getInstance({eventBus:t.eventBus,dashMetrics:t.dashMetrics,metricsConstants:t.metricsConstants,events:t.events}),(0,s.default)(e).create(t)},getReportingFactory:function(){return(0,d.default)(e).getInstance()},getMetricsHandlerFactory:function(){return(0,l.default)(e).getInstance()}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(139)),o=i(e(126)),s=i(e(127)),l=i(e(132)),d=i(e(137));r.__dashjs_factory_name="MetricsReporting";var c=dashjs.FactoryMaker.getClassFactory(r);c.events=o.default,dashjs.FactoryMaker.updateClassFactory(r.__dashjs_factory_name,c),n.default=c,t.exports=n.default},{126:126,127:127,132:132,137:137,139:139}],126:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).call(this),this.METRICS_INITIALISATION_COMPLETE="internal_metricsReportingInitialized",this.BECAME_REPORTING_PLAYER="internal_becameReportingPlayer"}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=new(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,((r=e(55))&&r.__esModule?r:{default:r}).default),i);n.default=o,t.exports=n.default},{55:55}],127:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(t){var n;t.error||(n=Object.keys(i),(0,o.default)(r).getInstance({adapter:e.adapter,constants:e.constants}).getMetrics(t.manifest).forEach((function(t){var o=JSON.stringify(t);if(i.hasOwnProperty(o))n.splice(o,1);else try{var s=(0,a.default)(r).create(e);s.initialize(t),i[o]=s}catch(t){}})),n.forEach((function(e){i[e].reset(),delete i[e]})),l.trigger(s.default.METRICS_INITIALISATION_COMPLETE))}function n(){Object.keys(i).forEach((function(e){i[e].reset()})),i={}}e=e||{};var i={},r=this.context,l=e.eventBus,d=e.events;return l.on(d.MANIFEST_UPDATED,t),l.on(d.STREAM_TEARDOWN_COMPLETE,n),{reset:function(){l.off(d.MANIFEST_UPDATED,t),l.off(d.STREAM_TEARDOWN_COMPLETE,n)}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(128)),o=i(e(141)),s=i(e(126));r.__dashjs_factory_name="MetricsCollectionController",n.default=dashjs.FactoryMaker.getClassFactory(r),t.exports=n.default},{126:126,128:128,141:141}],128:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){n&&n.reset(),i&&i.reset(),r&&r.reset()}e=e||{};var n=void 0,i=void 0,r=void 0,l=this.context;return{initialize:function(d){try{(r=(0,a.default)(l).create({mediaElement:e.mediaElement})).initialize(d.Range),(i=(0,o.default)(l).create({debug:e.debug,metricsConstants:e.metricsConstants})).initialize(d.Reporting,r),(n=(0,s.default)(l).create({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants,events:e.events})).initialize(d.metrics,i)}catch(d){throw t(),d}},reset:t}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(130)),o=i(e(131)),s=i(e(129));r.__dashjs_factory_name="MetricsController",n.default=dashjs.FactoryMaker.getClassFactory(r),t.exports=n.default},{129:129,130:130,131:131}],129:[function(e,t,n){"use strict";function i(e){function t(e){n.forEach((function(t){t.handleNewMetric(e.metric,e.value,e.mediaType)}))}e=e||{};var n=[],i=void 0,r=this.context,o=e.eventBus,s=e.events,l=(0,a.default)(r).getInstance({debug:e.debug,eventBus:e.eventBus,metricsConstants:e.metricsConstants});return i={initialize:function(e,r){e.split(",").forEach((function(e,t,i){var a,o;-1===e.indexOf("(")||-1!==e.indexOf(")")||(o=i[t+1])&&-1===o.indexOf("(")&&-1!==o.indexOf(")")&&(e+=","+o,delete i[t+1]),(a=l.create(e,r))&&n.push(a)})),o.on(s.METRIC_ADDED,t,i),o.on(s.METRIC_UPDATED,t,i)},reset:function(){o.off(s.METRIC_ADDED,t,i),o.off(s.METRIC_UPDATED,t,i),n.forEach((function(e){return e.reset()})),n=[]}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(132))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="MetricsHandlersController",n.default=dashjs.FactoryMaker.getClassFactory(i),t.exports=n.default},{132:132}],130:[function(e,t,n){"use strict";function i(e){e=e||{};var t,n=!1,i=this.context,r=void 0,o=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,n=t+e.duration;r.add(t,n)})),n=!!e[0]._useWallClockTime)},reset:function(){r.clear()},isEnabled:function(){var e,t=r.length;if(!t)return!0;e=n?(new Date).getTime()/1e3:o.currentTime;for(var i=0;i<t;i+=1){var a=r.start(i),s=r.end(i);if(a<=e&&e<s)return!0}return!1}},r=(0,a.default)(i).create(),t}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(209))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="RangeController",n.default=dashjs.FactoryMaker.getClassFactory(i),t.exports=n.default},{209:209}],131:[function(e,t,n){"use strict";function i(e){var t=[],n=(0,a.default)(this.context).getInstance(e);return{initialize:function(e,i){e.some((function(e){var r=n.create(e,i);if(r)return t.push(r),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(137))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="ReportingController",n.default=dashjs.FactoryMaker.getClassFactory(i),t.exports=n.default},{137:137}],132:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=void 0,n=(e=e||{}).debug?e.debug.getLogger(t):{},i=/([a-zA-Z]*)(\(([0-9]*)(\,\s*([a-zA-Z]*))?\))?/,r=this.context,d={BufferLevel:a.default,DVBErrors:o.default,HttpList:s.default,PlayList:l.default,RepSwitchList:l.default,TcpList:l.default};return{create:function(t,a){var o,s=t.match(i);if(s){try{(o=d[s[1]](r).create({eventBus:e.eventBus,metricsConstants:e.metricsConstants})).initialize(s[1],a,s[3],s[5])}catch(t){o=null,n.error("MetricsHandlerFactory: Could not create handler for type "+s[1]+" with args "+s[3]+", "+s[5]+" ("+t.message+")")}return o}},register:function(e,t){d[e]=t},unregister:function(e){delete d[e]}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(133)),o=i(e(134)),s=i(e(136)),l=i(e(135));r.__dashjs_factory_name="MetricsHandlerFactory",n.default=dashjs.FactoryMaker.getSingletonFactory(r),t.exports=n.default},{133:133,134:134,135:135,136:136}],133:[function(e,t,n){"use strict";function i(e){function t(){var e=function(){try{return Object.keys(c).map((function(e){return c[e]})).reduce((function(e,t){return e.level<t.level?e:t}))}catch(e){return}}();e&&s!==e.t&&(s=e.t,n.report(r,e))}e=e||{};var n=void 0,i=void 0,r=void 0,o=void 0,s=void 0,l=this.context,d=(0,a.default)(l).getInstance(),c=[],u=e.metricsConstants;return{initialize:function(e,a,s){a&&(i=d.validateN(s),n=a,r=d.reconstructFullMetricName(e,s),o=setInterval(t,i))},reset:function(){clearInterval(o),i=0,s=n=o=null},handleNewMetric:function(e,t,n){e===u.BUFFER_LEVEL&&(c[n]=t)}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(140))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="BufferLevelHandler",n.default=dashjs.FactoryMaker.getClassFactory(i),t.exports=n.default},{140:140}],134:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=(i=e(126))&&i.__esModule?i:{default:i};n.default=dashjs.FactoryMaker.getClassFactory((function(e){function t(){i.off(r.default.METRICS_INITIALISATION_COMPLETE,t,this),i.trigger(r.default.BECAME_REPORTING_PLAYER)}var n=void 0,i=(e=e||{}).eventBus,a=e.metricsConstants;return{initialize:function(e,a){a&&(n=a,i.on(r.default.METRICS_INITIALISATION_COMPLETE,t,this))},reset:function(){n=null},handleNewMetric:function(e,t){e===a.DVB_ERRORS&&n&&n.report(e,t)}}})),t.exports=n.default},{126:126}],135:[function(e,t,n){"use strict";function i(){var e=void 0,t=void 0;return{initialize:function(n,i){e=n,t=i},reset:function(){t=null,e=void 0},handleNewMetric:function(n,i){n===e&&t&&t.report(e,i)}}}Object.defineProperty(n,"__esModule",{value:!0}),i.__dashjs_factory_name="GenericMetricHandler",n.default=dashjs.FactoryMaker.getClassFactory(i),t.exports=n.default},{}],136:[function(e,t,n){"use strict";function i(e){function t(){l.length&&n&&n.report(o,l),l=[]}e=e||{};var n=void 0,i=void 0,r=void 0,o=void 0,s=void 0,l=[],d=(0,a.default)(this.context).getInstance(),c=e.metricsConstants;return{initialize:function(e,a,l,c){a&&(i=d.validateN(l),n=a,c&&c.length&&(r=c),o=d.reconstructFullMetricName(e,l,c),s=setInterval(t,i))},reset:function(){clearInterval(s),l=[],n=r=i=s=null},handleNewMetric:function(e,t){e===c.HTTP_REQUEST&&(r&&r!==t.type||l.push(t))}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(140))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="HttpListHandler",n.default=dashjs.FactoryMaker.getClassFactory(i),t.exports=n.default},{140:140}],137:[function(e,t,n){"use strict";function i(e){e=e||{};var t={"urn:dvb:dash:reporting:2014":a.default},n=this.context,i=void 0,r=e.debug?e.debug.getLogger(i):{},o=e.metricsConstants;return{create:function(e,i){var a=void 0;try{(a=t[e.schemeIdUri](n).create({metricsConstants:o})).initialize(e,i)}catch(i){a=null,r.error("ReportingFactory: could not create Reporting with schemeIdUri "+e.schemeIdUri+" ("+i.message+")")}return a},register:function(e,n){t[e]=n},unregister:function(e){delete t[e]}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(138))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="ReportingFactory",n.default=dashjs.FactoryMaker.getSingletonFactory(i),t.exports=n.default},{138:138}],138:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e,t,n){function i(){var e=h.indexOf(r);-1!==e&&(h.splice(e,1),200<=r.status&&r.status<300?t&&t():n&&n())}var r=new XMLHttpRequest;h.push(r);try{r.open("GET",e),r.onloadend=i,r.onerror=i,r.send()}catch(e){r.onerror()}}function n(){c=d=!1,f=u=null}e=e||{};var i,r=this.context,s=void 0,l=void 0,d=void 0,c=void 0,u=void 0,f=void 0,h=[],p=e.metricsConstants;return i={report:function(e,n){Array.isArray(n)||(n=[n]),c&&f.isEnabled()&&n.forEach((function(n){var i=s.serialise(n);e!==p.DVB_ERRORS&&(i="metricname="+e+"&"+i),t(i=u+"?"+i,null,(function(){c=!1}))}))},initialize:function(e,t){var n=void 0;if(f=t,!(u=e["dvb:reportingUrl"]))throw new Error("required parameter missing (dvb:reportingUrl)");d||((n=e["dvb:probability"]||e["dvb:priority"]||0)&&(1e3===n||n/1e3>=l.random())&&(c=!0),d=!0)},reset:function(){n()}},s=(0,a.default)(r).getInstance(),l=(0,o.default)(r).getInstance(),n(),i}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(142)),o=i(e(143));r.__dashjs_factory_name="DVBReporting",n.default=dashjs.FactoryMaker.getClassFactory(r),t.exports=n.default},{142:142,143:143}],139:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){var t=new a.default;if(u){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.mpdurl||(t.mpdurl=u.originalUrl||u.url),t.terror||(t.terror=new Date),h.addDVBErrors(t)}}function n(e){e.error||(u=e.manifest)}function i(e){t({
errorcode:a.default.BASE_URL_CHANGED,servicelocation:e.entry})}function r(){t({errorcode:a.default.BECAME_REPORTER})}function s(e){switch(e.metric){case p.HTTP_REQUEST:(0===(n=e.value).responsecode||400<=n.responsecode||n.responsecode<100||600<=n.responsecode)&&t({errorcode:n.responsecode||a.default.CONNECTION_ERROR,url:n.url,terror:n.tresponse,servicelocation:n._serviceLocation})}var n}function l(e){var n=void 0;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:n=a.default.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:n=a.default.CORRUPT_MEDIA_OTHER;break;default:return}t({errorcode:n})}function d(){f.on(g.MANIFEST_UPDATED,n,c),f.on(g.SERVICE_LOCATION_BLACKLIST_CHANGED,i,c),f.on(g.METRIC_ADDED,s,c),f.on(g.METRIC_UPDATED,s,c),f.on(g.PLAYBACK_ERROR,l,c),f.on(o.default.BECAME_REPORTING_PLAYER,r,c)}var c=void 0,u=void 0,f=(e=e||{}).eventBus,h=e.dashMetrics,p=e.metricsConstants,g=e.events;return c={initialise:d,reset:function(){f.off(g.MANIFEST_UPDATED,n,c),f.off(g.SERVICE_LOCATION_BLACKLIST_CHANGED,i,c),f.off(g.METRIC_ADDED,s,c),f.off(g.METRIC_UPDATED,s,c),f.off(g.PLAYBACK_ERROR,l,c),f.off(o.default.BECAME_REPORTING_PLAYER,r,c)}},d(),c}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(144)),o=i(e(126));r.__dashjs_factory_name="DVBErrorsTranslator",n.default=dashjs.FactoryMaker.getSingletonFactory(r),t.exports=n.default},{126:126,144:144}],140:[function(e,t,n){"use strict";function i(){return{reconstructFullMetricName:function(e,t,n){var i=e;return t&&(i+="("+t,n&&n.length&&(i+=","+n),i+=")"),i},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}Object.defineProperty(n,"__esModule",{value:!0}),i.__dashjs_factory_name="HandlerHelpers",n.default=dashjs.FactoryMaker.getSingletonFactory(i),t.exports=n.default},{}],141:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=(e=e||{}).adapter,n=e.constants;return{getMetrics:function(e){var i=[];return e&&e.Metrics_asArray&&e.Metrics_asArray.forEach((function(r){var l=new a.default,d=t.getIsDynamic(e);r.hasOwnProperty("metrics")&&(l.metrics=r.metrics,r.Range_asArray&&r.Range_asArray.forEach((function(i){var r,a,s,c,u,f=new o.default;f.starttime=(r=e,a=i,c=s=void 0,u=0,d?u=t.getAvailabilityStartTime(r)/1e3:(s=t.getRegularPeriods(r)).length&&(u=s[0].start),c=u,a&&a.hasOwnProperty(n.START_TIME)&&(c+=a.starttime),c),i.hasOwnProperty("duration")?f.duration=i.duration:f.duration=t.getDuration(e),f._useWallClockTime=d,l.Range.push(f)})),r.Reporting_asArray&&(r.Reporting_asArray.forEach((function(e){var t=new s.default;if(e.hasOwnProperty(n.SCHEME_ID_URI)){for(var i in t.schemeIdUri=e.schemeIdUri,e)e.hasOwnProperty(i)&&(t[i]=e[i]);l.Reporting.push(t)}})),i.push(l)))})),i}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(145)),o=i(e(146)),s=i(e(147));r.__dashjs_factory_name="ManifestParsing",n.default=dashjs.FactoryMaker.getSingletonFactory(r),t.exports=n.default},{145:145,146:146,147:147}],142:[function(e,t,n){"use strict";function i(){return{serialise:function e(t){var n=[],i=[],r=void 0,a=void 0;for(r in t)if(t.hasOwnProperty(r)&&0!==r.indexOf("_")){if(null==(a=t[r])&&(a=""),Array.isArray(a)){if(!a.length)continue;i=[],a.forEach((function(t){var n="Object"!==Object.prototype.toString.call(t).slice(8,-1);i.push(n?t:e(t))})),a=i.map(encodeURIComponent).join(",")}else"string"==typeof a?a=encodeURIComponent(a):a instanceof Date?a=a.toISOString():"number"==typeof a&&(a=Math.round(a));n.push(r+"="+a)}return n.join("&")}}}Object.defineProperty(n,"__esModule",{value:!0}),i.__dashjs_factory_name="MetricSerialiser",n.default=dashjs.FactoryMaker.getSingletonFactory(i),t.exports=n.default},{}],143:[function(e,t,n){"use strict";function i(){function e(){n&&(o=o||new i(a),n.getRandomValues(o),s=0)}var t,n=window.crypto||window.msCrypto,i=Uint32Array,r=Math.pow(2,8*i.BYTES_PER_ELEMENT)-1,a=10,o=void 0,s=void 0;return t={random:function(t,i){var a=void 0;return t=t||0,i=i||1,n?(s===o.length&&e(),a=o[s]/r,s+=1):a=Math.random(),a*(i-t)+t}},e(),t}Object.defineProperty(n,"__esModule",{value:!0}),i.__dashjs_factory_name="RNG",n.default=dashjs.FactoryMaker.getSingletonFactory(i),t.exports=n.default},{}],144:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.mpdurl=null,this.errorcode=null,this.terror=null,this.url=null,this.ipaddress=null,this.servicelocation=null}Object.defineProperty(n,"__esModule",{value:!0}),i.SSL_CONNECTION_FAILED_PREFIX="SSL",i.DNS_RESOLUTION_FAILED="C00",i.HOST_UNREACHABLE="C01",i.CONNECTION_REFUSED="C02",i.CONNECTION_ERROR="C03",i.CORRUPT_MEDIA_ISOBMFF="M00",i.CORRUPT_MEDIA_OTHER="M01",i.BASE_URL_CHANGED="F00",i.BECAME_REPORTER="S00",n.default=i,t.exports=n.default},{}],145:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.metrics="",this.Range=[],this.Reporting=[]},t.exports=n.default},{}],146:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.starttime=0,this.duration=1/0,this._useWallClockTime=!1},t.exports=n.default},{}],147:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schemeIdUri="",this.value=""},t.exports=n.default},{}],148:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.data={baseUrls:e||null,selectedIdx:t||NaN},this.children=[]}function a(){function e(e,t,n){var i=s.getBaseURLsFromElement(n);e[t]?d.areEqual(i,e[t].data.baseUrls)||(e[t].data.baseUrls=i,e[t].data.selectedIdx=NaN):e[t]=new r(i)}function t(t){!function(){if(!s||!s.hasOwnProperty("getBaseURLsFromElement")||!s.hasOwnProperty("getRepresentationSortFunction"))throw new Error("setConfig function has to be called previously")}();var n=s.getBaseURLsFromElement(t);d.areEqual(n,a.data.baseUrls)||(a.data.baseUrls=n,a.data.selectedIdx=NaN),t&&t.Period_asArray&&t.Period_asArray.forEach((function(t,n){e(a.children,n,t),t.AdaptationSet_asArray&&t.AdaptationSet_asArray.forEach((function(t,i){e(a.children[n].children,i,t),t.Representation_asArray&&t.Representation_asArray.sort(s.getRepresentationSortFunction()).forEach((function(t,r){e(a.children[n].children[i].children,r,t)}))}))}))}function n(){a=new r}var i,a=void 0,s=void 0,l=this.context,d=(0,o.default)(l).getInstance();return i={reset:n,update:function(e){t(e)},getForPath:function(e){var t=a,n=[t.data];return e&&e.forEach((function(e){(t=t.children[e])&&n.push(t.data)})),n.filter((function(e){return e.baseUrls.length}))},invalidateSelectedIndexes:function(e){!function e(t,n){var i=n||a;t(i.data),i.children&&i.children.forEach((function(n){return e(t,n)}))}((function(t){isNaN(t.selectedIdx)||e===t.baseUrls[t.selectedIdx].serviceLocation&&(t.selectedIdx=NaN)}))},setConfig:function(e){e.adapter&&(s=e.adapter)}},n(),i}Object.defineProperty(n,"__esModule",{value:!0});var o=i(e(217)),s=i(e(47));a.__dashjs_factory_name="BaseURLTreeModel",n.default=s.default.getClassFactory(a),t.exports=n.default},{217:217,47:47}],149:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){x={pr:1,nor:null,st:null,sf:null,sid:""+f.default.generateUuid(),bs:{audio:g,video:g},cid:null,did:h}}function t(){var e={v:1};return e.sid=P.get().streaming.cmcd.sid?P.get().streaming.cmcd.sid:x.sid,e.cid=P.get().streaming.cmcd.cid?P.get().streaming.cmcd.cid:x.cid,e.did=P.get().streaming.cmcd.did?P.get().streaming.cmcd.did:x.did,e.sid='"'+e.sid+'"',e.cid='"'+e.cid+'"',e.did='"'+e.did+'"',isNaN(x.pr)||1===x.pr||null===x.pr||(e.pr=x.pr),x.st&&(e.st=x.st),x.sf&&(e.sf=x.sf),e}function n(e){try{x.pr=e.playbackRate}catch(e){}}function i(e){try{var t=s.getIsDynamic(e.data)?""+I:""+k,n=e.protocol&&"MSS"===e.protocol?""+C:""+S;x.st=t,x.sf=n}catch(e){}}function r(e){try{if(e.state&&e.mediaType){var t=null;switch(e.state){case o.default.BUFFER_LOADED:t=p;break;case o.default.BUFFER_EMPTY:M.isSeeking()&&(t=m),t=y}x.bs[e.mediaType]=t}}catch(e){}}var s=void 0,A=void 0,x=void 0,D=void 0,R=void 0,M=void 0,N=this.context,O=(0,a.default)(N).getInstance(),P=(0,d.default)(N).getInstance();return A={getQueryParameter:function(e){try{return P.get().streaming.cmcd&&P.get().streaming.cmcd.enabled?{key:"Common-Media-Client-Data",value:function(e){try{var t=function(){if(!e)return{v:null};var t=Object.keys(e),n=t.length;return{v:t.reduce((function(t,i,r){return t+=i+"="+e[i],r<n-1&&(t+=","),t}),"")}}();if("object"==typeof t)return t.v}catch(t){return null}}(function(e){try{return e.type===c.HTTPRequest.MPD_TYPE?(function(e){try{x.cid=""+f.default.generateHashCode(e.url)}catch(e){}}(e),function(){var e=t();return e.ot=""+_,e}()):e.type===c.HTTPRequest.MEDIA_SEGMENT_TYPE?function(e){var n=t(),i=function(e){try{var t=e.quality,n=e.mediaInfo.bitrateList;return parseInt(n[t].bandwidth/1e3)}catch(e){return null}}(e),r=function(e){try{return isNaN(e.duration)?null:Math.round(1e3*e.duration)}catch(e){return null}}(e),a="video"===e.mediaType?""+E:"audio"===e.mediaType?""+b:"fragmentedText"===e.mediaType?""+T:null,o=function(e){try{return Math.round(D.getThroughputHistory().getSafeAverageThroughput(e))}catch(e){return null}}(e.mediaType),s=function(e){try{var t=x.pr,n=R.getCurrentBufferLevel(e);return isNaN(t)||isNaN(n)?null:parseInt(n/t*1e3)}catch(e){return null}}(e.mediaType),l=function(e){try{var t=e.mediaType;return null!==x.bs[t]?x.bs[t]:R.getCurrentBufferLevel(t)<e.duration?v:p}catch(e){}}(e);return i&&(n.br=i),a&&(n.ot=a),isNaN(r)||(n.d=r),isNaN(o)||(n.mtp=o),isNaN(s)||(n.dl=s),isNaN(l)||null===l||(n.bs=l),n}(e):e.type===c.HTTPRequest.INIT_SEGMENT_TYPE?function(){var e=t();return e.ot=""+w,e}():null}catch(e){return null}}(e))}:null}catch(e){return null}},setConfig:function(e){e&&(e.abrController&&(D=e.abrController),e.dashMetrics&&(R=e.dashMetrics),e.playbackController&&(M=e.playbackController))},reset:function(){O.off(o.default.PLAYBACK_RATE_CHANGED,n,this),O.off(o.default.MANIFEST_LOADED,i,this),O.off(o.default.BUFFER_LEVEL_STATE_CHANGED,r,A),e()},initialize:function(){O.on(o.default.PLAYBACK_RATE_CHANGED,n,A),O.on(o.default.MANIFEST_LOADED,i,A),O.on(o.default.BUFFER_LEVEL_STATE_CHANGED,r,A)}},(0,l.default)(N).getInstance().getLogger(A),s=(0,u.default)(N).getInstance(),e(),A}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(46)),o=i(e(101)),s=i(e(47)),l=i(e(45)),d=i(e(48)),c=e(242),u=i(e(65)),f=i(e(49)),h="dash.js-v"+(0,e(50).getVersionString)(),p=null,g=1,m=2,v=3,y=4,_="m",b="a",E="v",w="i",T="c",S="d",C="s",k="v",I="l";r.__dashjs_factory_name="CmcdModel",n.default=s.default.getSingletonFactory(r),t.exports=n.default},{101:101,242:242,45:45,46:46,47:47,48:48,49:49,50:50,65:65}],150:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){var t;return!!e&&(t=!1,E.some((function(n){if(l=e,d=n,!isNaN(l.index)&&l.startTime===d.startTime&&l.adaptationIndex===d.adaptationIndex&&l.type===d.type||(a=e,s=n,isNaN(a.index)&&isNaN(s.index)&&a.quality===s.quality)||(r=n,(i=e).action===o.default.ACTION_COMPLETE&&i.action===r.action))return t=!0;var i,r,a,s,l,d})),t)}function n(e){return isNaN(e.duration)?.25:Math.min(e.duration/8,.5)}function i(e){E=E.filter((function(t){var i=n(t);return isNaN(t.startTime)||void 0!==e&&t.startTime>=e-i}))}function r(e,t){t<=e+.5||(E=E.filter((function(i){var r=n(i);return isNaN(i.startTime)||i.startTime>=t-r||isNaN(i.duration)||i.startTime+i.duration<=e+r})))}function a(e,t){m.addSchedulingInfo(e,t),m.addRequestsQueue(e.mediaType,w,E)}function d(e){e.sender===v&&(w.splice(w.indexOf(e.request),1),e.response&&!e.error&&E.push(e.request),a(e.request,e.error?"failed":l),p.trigger(g.FRAGMENT_LOADING_COMPLETED,{request:e.request,response:e.response,error:e.error,sender:this}))}function c(e){e.sender===v&&p.trigger(g.FRAGMENT_LOADING_PROGRESS,{request:e.request,response:e.response,error:e.error,sender:this})}function u(e){e.sender===v&&p.trigger(g.FRAGMENT_LOADING_ABANDONED,{streamId:_,request:e.request,mediaType:e.mediaType})}function f(){E=[],w=[]}var h,p=(e=e||{}).eventBus,g=e.events,m=e.dashMetrics,v=e.fragmentLoader,y=e.debug,_=e.streamId,b=void 0,E=void 0,w=void 0;return h={getRequests:function(e){var t=e?e.state instanceof Array?e.state:[e.state]:[],i=[];return t.forEach((function(t){var r=function(e){var t=void 0;switch(e){case s:t=w;break;case l:t=E;break;default:t=[]}return t}(t);i=i.concat(function(e,t){return t.hasOwnProperty("time")?[function(e,t,i){for(var r=e.length-1;0<=r;r--){var a=e[r],o=a.startTime,s=o+a.duration;if(i=isNaN(i)?n(a):i,!isNaN(o)&&!isNaN(s)&&o<=t+i&&t-i<s||isNaN(o)&&isNaN(t))return a}return null}(e,t.time,t.threshold)]:e.filter((function(e){for(var n in t)if("state"!==n&&t.hasOwnProperty(n)&&e[n]!=t[n])return!1;return!0}))}(r,e))})),i},isFragmentLoaded:t,isFragmentLoadedOrPending:function(e){var n=!1,i=0,r=void 0;if(!(n=t(e)))for(i=0;i<w.length;i++)r=w[i],e.url===r.url&&e.startTime===r.startTime&&(n=!0);return n},removeExecutedRequestsBeforeTime:i,removeExecutedRequestsAfterTime:function(e){E=E.filter((function(t){return isNaN(t.startTime)||void 0!==e&&t.startTime<e}))},syncExecutedRequestsWithBufferedRange:function(e,t){if(e&&0!==e.length){for(var n=0,a=0,o=e.length;a<o;a++)r(n,e.start(a)),n=e.end(a);0<t&&r(n,t)}else i()},abortRequests:function(){b.debug("abort requests"),v.abort(),w=[]},executeRequest:function(e){switch(e.action){case o.default.ACTION_COMPLETE:E.push(e),a(e,l),b.debug("STREAM_COMPLETED"),p.trigger(g.STREAM_COMPLETED,{request:e});break;case o.default.ACTION_DOWNLOAD:a(e,s),w.push(e),t=e,p.trigger(g.FRAGMENT_LOADING_STARTED,{streamId:_,request:t}),v.load(t);break;default:b.warn("Unknown request action.")}var t},reset:function(){p.off(g.LOADING_COMPLETED,d,this),p.off(g.LOADING_DATA_PROGRESS,c,this),p.off(g.LOADING_ABANDONED,u,this),v&&v.reset(),f()},addExecutedRequest:function(e){E.push(e)}},b=y.getLogger(h),f(),p.on(g.LOADING_COMPLETED,d,h),p.on(g.LOADING_DATA_PROGRESS,c,h),p.on(g.LOADING_ABANDONED,u,h),h}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(228)),s="loading",l="executed";r.__dashjs_factory_name="FragmentModel";var d=a.default.getClassFactory(r);d.FRAGMENT_MODEL_LOADING=s,d.FRAGMENT_MODEL_EXECUTED=l,d.FRAGMENT_MODEL_CANCELED="canceled",d.FRAGMENT_MODEL_FAILED="failed",a.default.updateClassFactory(r.__dashjs_factory_name,d),n.default=d,t.exports=n.default},{228:228,47:47}],151:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=this.context,t=(0,a.default)(e).getInstance(),n=void 0;return{getValue:function(){return n},setValue:function(e){(n=e)&&t.trigger(o.default.MANIFEST_LOADED,{data:e})}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(46)),o=i(e(54)),s=i(e(47));r.__dashjs_factory_name="ManifestModel",n.default=s.default.getSingletonFactory(r),t.exports=n.default},{46:46,47:47,54:54}],152:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){var t=void 0;for(t=0;t<f.length;t++)if(f[t].rulename===e)return t;return-1}function t(){return g.get().streaming.lowLatencyEnabled?g.get().streaming.liveDelay||3:g.get().streaming.liveDelay}function n(e,t){i(e,t);var n=new a.default;n.schemeIdUri=e,n.value=t,o.push(n)}function i(e,t){(0,c.checkParameterType)(e,"string"),(0,c.checkParameterType)(t,"string"),o.forEach((function(n,i){n.schemeIdUri===e&&n.value===t&&o.splice(i,1)}))}var r,o=void 0,u=void 0,f=void 0,h={scheme:"urn:mpeg:dash:utc:http-xsdate:2014",value:"http://time.akamai.com/?iso&ms"},p=this.context,g=(0,d.default)(p).getInstance();return r={getABRCustomRules:function(){return f},addABRCustomRule:function(t,n,i){if("string"!=typeof t||t!==l.default.ABANDON_FRAGMENT_RULES&&t!==l.default.QUALITY_SWITCH_RULES||"string"!=typeof n)throw s.default.BAD_ARGUMENT_ERROR;var r=e(n);-1===r?f.push({type:t,rulename:n,rule:i}):(f[r].type=t,f[r].rule=i)},removeABRCustomRule:function(t){var n;t?-1!==(n=e(t))&&f.splice(n,1):f=[]},getStableBufferTime:function(){if(g.get().streaming.lowLatencyEnabled)return.6*t();var e=g.get().streaming.stableBufferTime;return-1<e?e:g.get().streaming.fastSwitchEnabled?20:12},getRetryAttemptsForType:function(e){var t=isNaN(g.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:g.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return g.get().streaming.lowLatencyEnabled?g.get().streaming.retryAttempts[e]*t:g.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(g.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:g.get().streaming.retryIntervals.lowLatencyReductionFactor;return g.get().streaming.lowLatencyEnabled?g.get().streaming.retryIntervals[e]/t:g.get().streaming.retryIntervals[e]},getLiveDelay:t,getLiveCatchupLatencyThreshold:function(){try{var e=g.get().streaming.liveCatchupLatencyThreshold,n=t();if(null!==e&&!isNaN(e))return Math.max(e,n);var i=g.get().streaming.liveCatchUpMinDrift,r=!isNaN(n)&&n?isNaN(i)?t():g.get().streaming.liveCatchUpMinDrift+t():NaN;return r&&!isNaN(r)?2*r:NaN}catch(e){return NaN}},addUTCTimingSource:n,removeUTCTimingSource:i,getUTCTimingSources:function(){return o},clearDefaultUTCTimingSources:function(){o=[]},restoreDefaultUTCTimingSources:function(){n(h.scheme,h.value)},setXHRWithCredentialsForType:function e(t,n){t?u[t]=!!n:Object.keys(u).forEach((function(t){e(t,n)}))},getXHRWithCredentialsForType:function(e){var t=u[e];return void 0===t?u.default:t},getDefaultUtcTimingSource:function(){return h},reset:function(){}},u={default:!(o=[])},f=[],r}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(96)),o=i(e(47)),s=i(e(108)),l=i(e(190)),d=i(e(48)),c=e(219);r.__dashjs_factory_name="MediaPlayerModel",n.default=o.default.getSingletonFactory(r),t.exports=n.default},{108:108,190:190,219:219,47:47,48:48,96:96}],153:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){C.trigger(y.default.METRICS_CHANGED)}function n(e){C.trigger(y.default.METRIC_CHANGED,{mediaType:e}),t()}function i(e,t,i){C.trigger(y.default.METRIC_UPDATED,{mediaType:e,metric:t,value:i}),n(e)}function r(e,t,i){C.trigger(y.default.METRIC_ADDED,{mediaType:e,metric:t,value:i}),n(e)}function _(e,t){var n=null;return e&&(k.hasOwnProperty(e)?n=k[e]:t||(n=new s.default,k[e]=n)),n}function b(e,t,n){var i=_(e);null!==i&&(i[t].push(n),i[t].length>T.get().streaming.metricsMaxListDepth&&i[t].shift())}function E(e,t,n){b(e,t,n),r(e,t,n)}var w,T=(e=e||{}).settings,S=this.context,C=(0,m.default)(S).getInstance(),k=void 0;return w={clearCurrentMetricsForType:function(e){delete k[e],n(e)},clearAllCurrentMetrics:function(){k={},t()},getMetricsFor:_,addHttpRequest:function e(t,n,i,r,a,s,d,c,u,f,h,p,g,m,v){var y=new l.HTTPRequest;s&&s!==r&&(e(t,null,i,r,a,null,null,c,u,null,null,null,g,null,null),y.actualurl=s),y.tcpid=n,y.type=i,y.url=r,y.range=c,y.trequest=u,y.tresponse=f,y.responsecode=p,y._tfinish=h,y._stream=t,y._mediaduration=g,y._quality=a,y._responseHeaders=m,y._serviceLocation=d,v?v.forEach((function(e){var t,n,i,r,a;t=y,n=e.s,i=e.d,r=e.b,(a=new l.HTTPRequestTrace).s=n,a.d=i,a.b=r,t.trace.push(a),t.interval||(t.interval=0),t.interval+=i})):(delete y.interval,delete y.trace),E(t,o.default.HTTP_REQUEST,y)},addRepresentationSwitch:function(e,t,n,i,r){var a=new d.default;a.t=t,a.mt=n,a.to=i,r?a.lto=r:delete a.lto,E(e,o.default.TRACK_SWITCH,a)},addBufferLevel:function(e,t,n){var i=new c.default;i.t=t,i.level=n,E(e,o.default.BUFFER_LEVEL,i)},addBufferState:function(e,t,n){var i=new u.default;i.target=n,i.state=t,E(e,o.default.BUFFER_STATE,i)},addDVRInfo:function(e,t,n,i){var r=new f.default;r.time=t,r.range=i,r.manifestInfo=n,E(e,o.default.DVR_INFO,r)},addDroppedFrames:function(e,t){var n=new h.default,i=_(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,0<i.length&&i[i.length-1]==n||E(e,o.default.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,i,r,a,s,l,d){var c=new g.default;c.mediaType=e,c.t=t,c.type=n,c.startTime=i,c.availabilityStartTime=r,c.duration=a,c.quality=s,c.range=l,c.state=d,E(e,o.default.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var i=new v.default;i.loadingRequests=t,i.executedRequests=n,_(e).RequestsQueue=i,r(e,o.default.REQUESTS_QUEUE,i)},addManifestUpdate:function(e,t,n,i,s,l,d,c,u,f){var h=new p.ManifestUpdate;h.mediaType=e,h.type=t,h.requestTime=n,h.fetchTime=i,h.availabilityStartTime=s,h.presentationStartTime=l,h.clientTimeOffset=d,h.currentTime=c,h.buffered=u,h.latency=f,b(a.default.STREAM,o.default.MANIFEST_UPDATE,h),r(e,o.default.MANIFEST_UPDATE,h)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];i(e.mediaType,o.default.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,a){var s;e&&((s=new p.ManifestUpdateStreamInfo).id=t,s.index=n,s.start=r,s.duration=a,e.streamInfo.push(s),i(e.mediaType,o.default.MANIFEST_UPDATE_STREAM_INFO,e))},addManifestUpdateRepresentationInfo:function(e,t,n,r,a,s,l,d){var c;e&&e.representationInfo&&((c=new p.ManifestUpdateRepresentationInfo).id=t,c.index=n,c.streamIndex=r,c.mediaType=a,c.startNumber=l,c.fragmentInfoType=d,c.presentationTimeOffset=s,e.representationInfo.push(c),i(e.mediaType,o.default.MANIFEST_UPDATE_TRACK_INFO,e))},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,E(a.default.STREAM,o.default.PLAY_LIST,e)},addDVBErrors:function(e){E(a.default.STREAM,o.default.DVB_ERRORS,e)}},k={},w}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(109)),s=i(e(232)),l=e(242),d=i(e(245)),c=i(e(238)),u=i(e(239)),f=i(e(240)),h=i(e(241)),p=e(243),g=i(e(247)),m=i(e(46)),v=i(e(246)),y=i(e(54)),_=i(e(47));r.__dashjs_factory_name="MetricsModel",n.default=_.default.getSingletonFactory(r),t.exports=n.default},{108:108,109:109,232:232,238:238,239:239,240:240,241:241,242:242,243:243,245:245,246:246,247:247,46:46,47:47,54:54}],154:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=void 0;return{initialize:function(t){if(e=new a.default,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var i=t.substr(n+1).split("&"),r=0,o=i.length;r<o;++r){var s,l=i[r],d=l.indexOf("=");-1!==d&&(s=l.substring(0,d),e.hasOwnProperty(s)&&(e[s]=l.substr(d+1)))}},getURIFragmentData:function(){return e}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(237)),o=i(e(47));r.__dashjs_factory_name="URIFragmentModel",n.default=o.default.getSingletonFactory(r),t.exports=n.default},{237:237,47:47}],155:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){u&&(u.playbackRate=h||1,u.removeEventListener("canplay",e))}function t(t){u&&(u.readyState<=2&&0<t?u.addEventListener("canplay",e):u.playbackRate=t)}function n(){return 0<v.length}function i(){var e;u&&n()&&0===u.playbackRate&&((e=document.createEvent("Event")).initEvent("waiting",!0,!1),u.dispatchEvent(e))}function r(){return u?u.buffered:null}function a(e,t,n,i,r){if(u)for(var a=0;a<u.textTracks.length;a++)if(u.textTracks[a].kind===e&&(!t||u.textTracks[a].label==t)&&u.textTracks[a].language===n&&u.textTracks[a].isTTML===i&&u.textTracks[a].isEmbedded===r)return u.textTracks[a];return null}var d=void 0,c=void 0,u=void 0,f=void 0,h=void 0,p="element is not video or audio DOM type!",g=this.context,m=(0,o.default)(g).getInstance(),v=[];return d={initialize:function(){m.on(s.default.PLAYBACK_PLAYING,i,this)},setCurrentTime:function(e,t){if(u){if(u.currentTime==e)return;try{e=t?function(e){var t=r(),n=e,i=9999999999;if(t)for(var a=0;a<t.length;a++){var o=t.start(a),s=t.end(a),l=Math.abs(o-e),d=Math.abs(s-e);if(o<=e&&e<=s)return e;l<i&&(i=l,n=o),d<i&&(i=d,n=s)}return n}(e):e,u.currentTime=e}catch(t){0===u.readyState&&t.code===t.INVALID_STATE_ERR&&setTimeout((function(){u.currentTime=e}),400)}}},play:function(){var e;u&&(u.autoplay=!0,(e=u.play())&&e.catch&&"undefined"!=typeof Promise&&e.catch((function(e){"NotAllowedError"===e.name&&m.trigger(s.default.PLAYBACK_NOT_ALLOWED),c.warn("Caught pending play exception - continuing ("+e+")")})))},isPaused:function(){return u?u.paused:null},pause:function(){u&&(u.pause(),u.autoplay=!1)},isStalled:n,isSeeking:function(){return u?u.seeking:null},getTime:function(){return u?u.currentTime:null},getPlaybackRate:function(){return u?u.playbackRate:null},setPlaybackRate:t,getPlayedRanges:function(){return u?u.played:null},getEnded:function(){return u?u.ended:null},setStallState:function(e,i){(i?function(e){var n=void 0;null===e||u.seeking||-1!==v.indexOf(e)||(v.push(e),u&&1===v.length&&((n=document.createEvent("Event")).initEvent("waiting",!0,!1),h=u.playbackRate,t(0),u.dispatchEvent(n)))}:function(e){var i=v.indexOf(e),r=void 0;null!==e&&(-1!==i&&v.splice(i,1),u&&!1===n()&&0===u.playbackRate&&(t(h||1),u.paused||((r=document.createEvent("Event")).initEvent("playing",!0,!1),u.dispatchEvent(r))))})(e)},getElement:function(){return u},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw p;(u=e)&&(u.preload="auto")},setSource:function(e){u&&(e?u.src=e:(u.removeAttribute("src"),u.load()))},getSource:function(){return u?u.src:null},getTTMLRenderingDiv:function(){return f},setTTMLRenderingDiv:function(e){(f=e).style.position="absolute",f.style.display="flex",f.style.overflow="hidden",f.style.pointerEvents="none",f.style.top=0,f.style.left=0},getPlaybackQuality:function(){if(!u)return null;var e="webkitDroppedFrameCount"in u&&"webkitDecodedFrameCount"in u,t=null;return"getVideoPlaybackQuality"in u?t=u.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:u.webkitDroppedFrameCount,totalVideoFrames:u.webkitDroppedFrameCount+u.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:function(e,t){u&&u.addEventListener(e,t)},removeEventListener:function(e,t){u&&u.removeEventListener(e,t)},getReadyState:function(){return u?u.readyState:NaN},getBufferRange:r,getClientWidth:function(){return u?u.clientWidth:NaN},getClientHeight:function(){return u?u.clientHeight:NaN},getTextTracks:function(){return u?u.textTracks:[]},getTextTrack:a,addTextTrack:function(e,t,n,i,r){if(!u)return null;var o=a(e,t,n,i,r);return o||((o=u.addTextTrack(e,t,n)).isEmbedded=r,o.isTTML=i),o},appendChild:function(e){u&&(u.appendChild(e),void 0!==e.isTTML&&(u.textTracks[u.textTracks.length-1].isTTML=e.isTTML,u.textTracks[u.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){u&&u.removeChild(e)},getVideoWidth:function(){return u?u.videoWidth:NaN},getVideoHeight:function(){return u?u.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=u.parentNode.host||u.parentNode;return e?u.getBoundingClientRect().top-e.parentNode.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=u.parentNode.host||u.parentNode;return e?u.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},reset:function(){m.off(s.default.PLAYBACK_PLAYING,i,this)}},c=(0,l.default)(g).getInstance().getLogger(d),d}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(46)),s=i(e(54)),l=i(e(45));r.__dashjs_factory_name="VideoModel",n.default=a.default.getSingletonFactory(r),t.exports=n.default},{45:45,46:46,47:47,54:54}],156:[function(e,t,n){"use strict";function i(e){function t(e,t){e.reader.read().then(t).catch((function(t){e.onerror&&200===e.response.status&&e.onerror(t)}))}function n(e,t){if(1<(e=e.filter((function(n){return n.bytes>t/4/e.length}))).length){var n=(i=0,r=(e[e.length-1].ts-e[0].ts)/e.length,e.forEach((function(t,n){var a,o=e[n+1];o&&(a=o.ts-t.ts,i+=a<r?a:0)})),{v:i});if("object"==typeof n)return n.v}var i,r;return null}var i=(e=e||{}).requestModifier,r=e.boxParser;return{load:function(e){var a=new Date,o=e.request,s=new Headers;o.range&&s.append("Range","bytes="+o.range),o.requestStartDate||(o.requestStartDate=a),i&&i.modifyRequestHeader({setRequestHeader:function(e,t){s.append(e,t)}});var l=void 0;"function"==typeof window.AbortController&&(l=new AbortController,(e.abortController=l).signal.onabort=e.onabort);var d={method:e.method,headers:s,credentials:e.withCredentials?"include":void 0,signal:l?l.signal:void 0};fetch(e.url,d).then((function(i){e.response||(e.response={}),e.response.status=i.status,e.response.statusText=i.statusText,e.response.responseURL=i.url,i.ok||e.onerror();var a="",o=!0,s=!1,l=void 0;try{for(var d,c=i.headers.keys()[Symbol.iterator]();!(o=(d=c.next()).done);o=!0){var u=d.value;a+=u+": "+i.headers.get(u)+"\r\n"}}catch(i){s=!0,l=i}finally{try{!o&&c.return&&c.return()}finally{if(s)throw l}}if(e.response.responseHeaders=a,!i.body)return i.arrayBuffer().then((function(t){var n={loaded:(e.response.response=t).byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var f=parseInt(i.headers.get("Content-Length"),10),h=0,p=!1,g=new Uint8Array,m=0;e.reader=i.body.getReader();var v=[];t(e,(function i(a){var o,s,l,d=a.value;if(a.done)return g&&(e.progress({loaded:h,total:isNaN(f)?h:f,lengthComputable:!0,time:n(v,h),stream:!0}),e.response.response=g.buffer),e.onload(),void e.onend();d&&0<d.length&&(g=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(g,d),h+=d.length,v.push({ts:Date.now(),bytes:d.length}),(o=r.findLastTopIsoBoxCompleted(["moov","mdat"],g,m)).found?(s=o.lastCompletedOffset+o.size,l=void 0,g=s===g.length?(l=g,new Uint8Array):(l=new Uint8Array(g.subarray(0,s)),g.subarray(s)),e.progress({data:l.buffer,lengthComputable:!1,noTrace:!0}),m=0):(m=o.lastCompletedOffset,p||(e.progress({lengthComputable:!1,noTrace:!0}),p=!0))),t(e,i)}))})).catch((function(t){e.onerror&&e.onerror(t)}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:n}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="FetchLoader";var o=a.default.getClassFactory(i);n.default=o,t.exports=n.default},{47:47}],157:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e){function t(e,n){function i(e){C=!1,u.requestStartDate=k,u.requestEndDate=new Date,u.firstByteDate=u.firstByteDate||k,u.checkExistenceOnly||(h.addHttpRequest(u,x.response?x.response.responseURL:null,x.response?x.response.status:null,x.response&&x.response.getAllResponseHeaders?x.response.getAllResponseHeaders():x.response?x.response.responseHeaders:[],e?y:null),u.type===l.HTTPRequest.MPD_TYPE&&h.addManifestUpdate(u.type,u.requestStartDate,u.requestEndDate))}function r(){-1!==_.indexOf(x)&&(_.splice(_.indexOf(x),1),C&&(i(!1),0<n?function(){n--;var i={config:e};E.push(i),i.timeout=setTimeout((function(){-1!==E.indexOf(i)&&(E.splice(E.indexOf(i),1),t(e,n))}),p.getRetryIntervalsForType(u.type))}():(d.error(new c.default(w[u.type],u.url+" is not available",{request:u,response:x.response})),e.error&&e.error(u,"error",x.response.statusText),e.complete&&e.complete(u,x.response.statusText))))}var u=e.request,y=[],S=!0,C=!0,k=new Date,I=k,A=0,x=void 0;if(!g||!h||!d)throw new Error("config object is not correct or missing");var D,R=void 0,M=(R=v&&window.fetch&&"arraybuffer"===u.responseType&&u.type===l.HTTPRequest.MEDIA_SEGMENT_TYPE?(0,s.default)(a).create({requestModifier:g,boxParser:m}):(0,o.default)(a).create({requestModifier:g}),g.modifyRequestURL(u.url)),N=function(e){try{var t=[],n=T.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(u),O=(x={url:M=f.default.addAditionalQueryParameterToUrl(M,N),method:u.checkExistenceOnly?l.HTTPRequest.HEAD:l.HTTPRequest.GET,withCredentials:p.getXHRWithCredentialsForType(u.type),request:u,onload:function(){200<=x.response.status&&x.response.status<=299&&(i(!0),e.success&&e.success(x.response.response,x.response.statusText,x.response.responseURL),e.complete&&e.complete(u,x.response.statusText))},onend:r,onerror:r,progress:function(t){var n=new Date;S&&(S=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(u.firstByteDate=n)),
t.lengthComputable&&(u.bytesLoaded=t.loaded,u.bytesTotal=t.total),t.noTrace||(y.push({s:I,d:t.time?t.time:n.getTime()-I.getTime(),b:[t.loaded?t.loaded-A:0]}),I=n,A=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(u)},loader:R},(new Date).getTime());isNaN(u.delayLoadingTime)||O>=u.delayLoadingTime?(_.push(x),R.load(x)):(D={httpRequest:x},b.push(D),D.delayTimeout=setTimeout((function(){if(-1!==b.indexOf(D)){b.splice(b.indexOf(D),1);try{k=new Date,I=k,_.push(D.httpRequest),R.load(D.httpRequest)}catch(e){D.httpRequest.onerror()}}}),u.delayLoadingTime-O))}e=e||{};var n,i,a=this.context,d=e.errHandler,h=e.dashMetrics,p=e.mediaPlayerModel,g=e.requestModifier,m=e.boxParser,v=e.useFetch||!1,y=e.errors,_=void 0,b=void 0,E=void 0,w=void 0,T=void 0;return n={load:function(e){e.request?t(e,p.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){E.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),E=[],b.forEach((function(e){return clearTimeout(e.delayTimeout)})),b=[],_.forEach((function(e){e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e)})),_=[]}},_=[],b=[],E=[],T=(0,u.default)(a).getInstance(),r(i={},l.HTTPRequest.MPD_TYPE,y.DOWNLOAD_ERROR_ID_MANIFEST_CODE),r(i,l.HTTPRequest.XLINK_EXPANSION_TYPE,y.DOWNLOAD_ERROR_ID_XLINK_CODE),r(i,l.HTTPRequest.INIT_SEGMENT_TYPE,y.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),r(i,l.HTTPRequest.MEDIA_SEGMENT_TYPE,y.DOWNLOAD_ERROR_ID_CONTENT_CODE),r(i,l.HTTPRequest.INDEX_SEGMENT_TYPE,y.DOWNLOAD_ERROR_ID_CONTENT_CODE),r(i,l.HTTPRequest.BITSTREAM_SWITCHING_SEGMENT_TYPE,y.DOWNLOAD_ERROR_ID_CONTENT_CODE),r(i,l.HTTPRequest.OTHER_TYPE,y.DOWNLOAD_ERROR_ID_CONTENT_CODE),w=i,n}Object.defineProperty(n,"__esModule",{value:!0});var o=i(e(160)),s=i(e(156)),l=e(242),d=i(e(47)),c=i(e(226)),u=i(e(149)),f=i(e(49));a.__dashjs_factory_name="HTTPLoader";var h=d.default.getClassFactory(a);n.default=h,t.exports=n.default},{149:149,156:156,160:160,226:226,242:242,47:47,49:49}],158:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){n={}}function t(){e()}var n=void 0;return t(),{getLoader:function(e){for(var t in n)if(n.hasOwnProperty(t)&&e.startsWith(t))return n[t];return o.default},registerLoader:function(e,t){n[e]=t},unregisterLoader:function(e){n[e]&&delete n[e]},unregisterAllLoader:e,reset:t}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(157));r.__dashjs_factory_name="SchemeLoaderFactory";var s=a.default.getSingletonFactory(r);n.default=s,t.exports=n.default},{157:157,47:47}],159:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){e=e||{};var t=this.context,n=void 0,i=void 0;return n=(0,o.default)(t).getInstance(),{load:function(r){var a=n.getLoader(r&&r.request?r.request.url:null);(i=a(t).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,useFetch:e.useFetch||null,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,errors:e.errors})).load(r)},abort:function(){i&&i.abort()}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(158));r.__dashjs_factory_name="URLLoader";var s=a.default.getClassFactory(r);n.default=s,t.exports=n.default},{158:158,47:47}],160:[function(e,t,n){"use strict";function i(e){var t=(e=e||{}).requestModifier;return{load:function(e){var n=new Date,i=e.request,r=new XMLHttpRequest;r.open(e.method,e.url,!0),i.responseType&&(r.responseType=i.responseType),i.range&&r.setRequestHeader("Range","bytes="+i.range),i.requestStartDate||(i.requestStartDate=n),t&&(r=t.modifyRequestHeader(r)),r.withCredentials=e.withCredentials,r.onload=e.onload,r.onloadend=e.onend,r.onerror=e.onerror,r.onprogress=e.progress,r.onabort=e.onabort,r.send(),e.response=r},abort:function(e){var t=e.response;t.onloadend=t.onerror=t.onprogress=void 0,t.abort()}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="XHRLoader";var o=a.default.getClassFactory(i);n.default=o,t.exports=n.default},{47:47}],161:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r)}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,null,[{key:"findCencContentProtection",value:function(e){for(var t=null,n=0;n<e.length;++n){var i=e[n];"urn:mpeg:dash:mp4protection:2011"!==i.schemeIdUri.toLowerCase()||"cenc"!==i.value.toLowerCase()&&"cbcs"!==i.value.toLowerCase()||(t=i)}return t}},{key:"getPSSHData",value:function(e){var t=8,n=new DataView(e),i=n.getUint8(t);return t+=20,0<i&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(e,t){var n=r.parsePSSHList(t);return e&&n.hasOwnProperty(e.uuid.toLowerCase())?n[e.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},i=0;;){var r,a,o=void 0,s=i;if(i>=t.buffer.byteLength)break;if(r=i+t.getUint32(i),i+=4,1886614376===t.getUint32(i))if(i+=4,0===(a=t.getUint8(i))||1===a){i++,i+=3,o="";var l=void 0,d=void 0;for(l=0;l<4;l++)o+=1===(d=t.getUint8(i+l).toString(16)).length?"0"+d:d;for(i+=4,o+="-",l=0;l<2;l++)o+=1===(d=t.getUint8(i+l).toString(16)).length?"0"+d:d;for(i+=2,o+="-",l=0;l<2;l++)o+=1===(d=t.getUint8(i+l).toString(16)).length?"0"+d:d;for(i+=2,o+="-",l=0;l<2;l++)o+=1===(d=t.getUint8(i+l).toString(16)).length?"0"+d:d;for(i+=2,o+="-",l=0;l<6;l++)o+=1===(d=t.getUint8(i+l).toString(16)).length?"0"+d:d;i+=6,o=o.toLowerCase(),t.getUint32(i),i+=4,n[o]=t.buffer.slice(s,r),i=r}else i=r;else i=r}return n}}]),r);n.default=a,t.exports=n.default},{}],162:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];if("function"==typeof e[i[Object.keys(i)[0]]])return i}return null}var t=void 0,n=this.context;return t={createProtectionSystem:function(i){var r=null,s=(0,o.default)(n).getInstance();s.setConfig({debug:i.debug,BASE64:i.BASE64}),s.initialize();var l,p,g,m,v,y,_=(g=(p=(l=i).debug).getLogger(t),m=l.eventBus,v=l.errHandler,(y=l.videoModel?l.videoModel.getElement():null)&&void 0===y.onencrypted||y&&void 0===y.mediaKeys?e(y,h)?(g.info("EME detected on this user agent! (ProtectionModel_3Feb2014)"),(0,c.default)(n).create({debug:p,eventBus:m,events:l.events,api:e(y,h)})):e(y,f)?(g.info("EME detected on this user agent! (ProtectionModel_01b)"),(0,u.default)(n).create({debug:p,eventBus:m,errHandler:v,events:l.events,api:e(y,f)})):(g.warn("No supported version of EME detected on this user agent! - Attempts to play encrypted content will fail!"),null):(g.info("EME detected on this user agent! (ProtectionModel_21Jan2015)"),(0,d.default)(n).create({debug:p,eventBus:m,events:l.events})));return!r&&_&&(r=(0,a.default)(n).create({protectionModel:_,protectionKeyController:s,eventBus:i.eventBus,debug:i.debug,events:i.events,BASE64:i.BASE64,constants:i.constants}),i.capabilities.setEncryptedMediaSupported(!0)),r}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(164)),o=i(e(165)),s=i(e(163)),l=i(e(170)),d=i(e(172)),c=i(e(173)),u=i(e(171)),f=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],h=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];r.__dashjs_factory_name="Protection";var p=dashjs.FactoryMaker.getClassFactory(r);p.events=s.default,p.errors=l.default,dashjs.FactoryMaker.updateClassFactory(r.__dashjs_factory_name,p),n.default=p,t.exports=n.default},{163:163,164:164,165:165,170:170,171:171,172:172,173:173}],163:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).call(this),this.INTERNAL_KEY_MESSAGE="internalKeyMessage",this.INTERNAL_KEY_SYSTEM_SELECTED="internalKeySystemSelected",this.INTERNAL_KEY_STATUS_CHANGED="internalkeyStatusChanged",this.KEY_ADDED="public_keyAdded",this.KEY_ERROR="public_keyError",this.KEY_MESSAGE="public_keyMessage",this.KEY_SESSION_CLOSED="public_keySessionClosed",this.KEY_SESSION_CREATED="public_keySessionCreated",this.KEY_SESSION_REMOVED="public_keySessionRemoved",this.KEY_STATUSES_CHANGED="public_keyStatusesChanged",this.KEY_SYSTEM_ACCESS_COMPLETE="public_keySystemAccessComplete",this.KEY_SYSTEM_SELECTED="public_keySystemSelected",this.LICENSE_REQUEST_COMPLETE="public_licenseRequestComplete",this.NEED_KEY="needkey",this.PROTECTION_CREATED="public_protectioncreated",this.PROTECTION_DESTROYED="public_protectiondestroyed",this.SERVER_CERTIFICATE_UPDATED="serverCertificateUpdated",this.TEARDOWN_COMPLETE="protectionTeardownComplete",this.VIDEO_ELEMENT_SELECTED="videoElementSelected"}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=new(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,((r=e(55))&&r.__esModule?r:{default:r}).default),i);n.default=o,t.exports=n.default},{55:55}],164:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){if(!(E&&E.hasOwnProperty("on")&&_&&_.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function n(e,t){var n=a.default.getPSSHForKeySystem(N,e),i=c(N);if(n){for(var r=b.getAllInitData(),o=0;o<r.length;o++)if(_.initDataEquals(n,r[o]))return void I.warn("DRM: Ignoring initData because we have already seen it!");try{b.createKeySession(n,i,f(N),t)}catch(e){E.trigger(w.KEY_SESSION_CREATED,{data:null,error:new d.default(l.default.KEY_SESSION_CREATED_ERROR_CODE,l.default.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e?b.createKeySession(e,i,f(N),t):E.trigger(w.KEY_SESSION_CREATED,{data:null,error:new d.default(l.default.KEY_SESSION_CREATED_ERROR_CODE,l.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(N?N.systemString:null)+".  needkey/encrypted event contains no initData corresponding to that key system!")})}function i(e,n){t(),b.loadKeySession(e,n,f(N))}function r(e){t(),e?(b.setMediaElement(e),E.on(w.NEED_KEY,v,this)):null===e&&(b.setMediaElement(e),E.off(w.NEED_KEY,v,this))}function c(e){var t,n=null;return e&&(t=e.systemString,D&&(n=t in D?D[t]:null)),n}function u(e){var t=c(e),n=[],i=[],r=t&&t.audioRobustness&&0<t.audioRobustness.length?t.audioRobustness:M,a=t&&t.videoRobustness&&0<t.videoRobustness.length?t.videoRobustness:M,l=f(e),d=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",u=t&&t.persistentState?t.persistentState:"temporary"===l?"optional":"required";return x.forEach((function(e){e.type===C.AUDIO?n.push(new o.default(e.codec,r)):e.type===C.VIDEO&&i.push(new o.default(e.codec,a))})),new s.default(n,i,d,u,[l])}function f(e){var t=c(e);return t&&t.sessionType?t.sessionType:R}function h(e,t){var r=this,a=[];e=e.sort((function(t,n){return(D&&D[t.ks.systemString]&&0<=D[t.ks.systemString].priority?D[t.ks.systemString].priority:e.length)-(D&&D[n.ks.systemString]&&0<=D[n.ks.systemString].priority?D[n.ks.systemString].priority:e.length)}));var o,s=void 0;if(N)for(s=0;s<e.length&&(N!==e[s].ks||"break"!=(a.push({ks:e[s].ks,configs:[u(N)]}),E.on(w.KEY_SYSTEM_ACCESS_COMPLETE,(function a(o){var u,f;E.off(w.KEY_SYSTEM_ACCESS_COMPLETE,a,r),o.error?t||E.trigger(w.KEY_SYSTEM_SELECTED,{error:new d.default(l.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,l.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+o.error)}):(I.info("DRM: KeySystem Access Granted"),E.trigger(w.KEY_SYSTEM_SELECTED,{data:o.data}),u=c(N),_.isClearKey(N)&&u&&u.hasOwnProperty("clearkeys")&&(f={kids:Object.keys(u.clearkeys)},e[s].initData=(new TextEncoder).encode(JSON.stringify(f))),e[s].sessionId?i(e[s].sessionId,e[s].initData):e[s].initData&&n(e[s].initData,e[s].cdmData))}),r),b.requestKeySystemAccess(a),"break"));s++);else void 0===N?function(){function f(e){E.off(w.KEY_SYSTEM_ACCESS_COMPLETE,f,r),e.error?(N=void 0,E.off(w.INTERNAL_KEY_SYSTEM_SELECTED,o,r),t||E.trigger(w.KEY_SYSTEM_SELECTED,{data:null,error:new d.default(l.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,l.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+e.error)})):(p=e.data,I.info("DRM: KeySystem Access Granted ("+p.keySystem.systemString+")!  Selecting key system..."),b.selectKeySystem(p))}N=null,A.push(e);for(var h=0;h<e.length;h++)a.push({ks:e[h].ks,configs:[u(e[h].ks)]});var p=void 0;o=function e(a){if(E.off(w.INTERNAL_KEY_SYSTEM_SELECTED,e,r),E.off(w.KEY_SYSTEM_ACCESS_COMPLETE,f,r),a.error)N=void 0,t||E.trigger(w.KEY_SYSTEM_SELECTED,{data:null,error:new d.default(l.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE,l.default.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE+"Error selecting key system! -- "+a.error)});else{if(!b)return;N=b.getKeySystem(),E.trigger(w.KEY_SYSTEM_SELECTED,{data:p});var o=c(N);o&&o.serverCertificate&&0<o.serverCertificate.length&&b.setServerCertificate(S.decodeArray(o.serverCertificate).buffer);for(var u,h=0;h<A.length;h++)for(s=0;s<A[h].length;s++)if(N===A[h][s].ks){_.isClearKey(N)&&o&&o.hasOwnProperty("clearkeys")&&(u={kids:Object.keys(o.clearkeys)},A[h][s].initData=(new TextEncoder).encode(JSON.stringify(u))),A[h][s].sessionId?i(A[h][s].sessionId,A[h][s].initData):null!==A[h][s].initData&&n(A[h][s].initData,A[h][s].cdmData);break}}},E.on(w.INTERNAL_KEY_SYSTEM_SELECTED,o,r),E.on(w.KEY_SYSTEM_ACCESS_COMPLETE,f,r),b.requestKeySystemAccess(a)}():A.push(e)}function p(e,t){E.trigger(w.LICENSE_REQUEST_COMPLETE,{data:e,error:t})}function g(e){e.error?E.trigger(w.KEY_STATUSES_CHANGED,{data:null,error:e.error}):I.debug("DRM: key status = "+e.status)}function m(e){I.debug("DRM: onKeyMessage");var t=e.data;E.trigger(w.KEY_MESSAGE,{data:t});var n=t.messageType?t.messageType:"license-request",i=t.message,r=t.sessionToken,o=c(N),s=N?N.systemString:null,u=_.getLicenseServer(N,o,n),f={sessionToken:r,messageType:n};if(i&&0!==i.byteLength){if(!u)return I.debug("DRM: License server request not required for this message (type = "+e.data.messageType+").  Session ID = "+r.getSessionID()),void p(f);if(_.isClearKey(N)){var h=_.processClearKeyLicenseRequest(N,o,i);if(h)return I.debug("DRM: ClearKey license request handled by application!"),p(f),void b.updateKeySession(r,h)}var g,m,v,y,T,S,C,k,A,D,R=null;o&&o.serverURL?"string"==typeof(g=o.serverURL)&&""!==g?R=g:"object"==typeof g&&g.hasOwnProperty(n)&&(R=g[n]):R=o&&o.laURL&&""!==o.laURL?o.laURL:_.isClearKey(N)?N.getLicenseServerUrlFromMediaInfo(x):(m=a.default.getPSSHData(r.initData),(R=N.getLicenseServerURLFromInitData(m))||e.data.laURL),(R=u.getServerURLFromMessage(R,i,n))?(y=!(v={}),T=function(e){if(e)for(var t in e)"authorization"===t.toLowerCase()&&(y=!0),v[t]=e[t]},o&&T(o.httpRequestHeaders),T(N.getRequestHeadersFromMessage(i)),o&&"boolean"==typeof o.withCredentials&&(y=o.withCredentials),S=function(e,t,n,i){var r=e.response?u.getErrorResponse(e.response,n,i):"NONE";p(t,new d.default(l.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+n+' update, XHR complete. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState+".  Response is "+r))},C=N.getLicenseRequestFromMessage(i),k=u.getHTTPMethod(n),A=u.getResponseType(s,n),D=o&&!isNaN(o.httpTimeout)?o.httpTimeout:8e3,function e(t,n,i,r,a,o,s,l,d,c,u){var f=new XMLHttpRequest;for(var h in f.open(i,t,!0),f.responseType=r,f.withCredentials=a,0<l&&(f.timeout=l),n)f.setRequestHeader(h,n[h]);var p=function(){s--,setTimeout((function(){e(t,n,i,r,a,o,s,l,d,c,u)}),1e3)};f.onload=function(){200===this.status||s<=0?d(this):(I.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+s),p())},f.ontimeout=f.onerror=function(){s<=0?u(this):(I.warn("License request network request failed . Retrying it... Pending retries: "+s),p())},f.onabort=function(){c(this)},f.send(o)}(R,v,k,A,y,C,3,D,(function(e){var t;b&&(200===e.status&&null!==(t=u.getLicenseMessage(e.response,s,n))?(p(f),b.updateKeySession(r,t)):S(e,f,s,n))}),(function(e){p(f,new d.default(l.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+s+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))}),(function(e){p(f,new d.default(l.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+s+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))}))):p(f,new d.default(l.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}else p(f,new d.default(l.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,l.default.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function v(e,t){if(I.debug("DRM: onNeedKey"),"cenc"===e.key.initDataType)if(0===x.length&&(I.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))k.push(setTimeout((function(){v(e,t)}),500));else{var n=e.key.initData;if(ArrayBuffer.isView(n)&&(n=n.buffer),N){var i=a.default.getPSSHForKeySystem(N,n);if(i)for(var r=b.getAllInitData(),o=0;o<r.length;o++)if(_.initDataEquals(i,r[o]))return void I.warn("DRM: Ignoring initData because we have already seen it!")}I.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(n)));var s=_.getSupportedKeySystems(n,D);0!==s.length?h(s,!1):I.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}else I.warn("DRM:  Only 'cenc' initData is supported!  Ignoring initData of type: "+e.key.initDataType)}var y,_=(e=e||{}).protectionKeyController,b=e.protectionModel,E=e.eventBus,w=e.events,T=e.debug,S=e.BASE64,C=e.constants,k=[],I=void 0,A=void 0,x=void 0,D=void 0,R=void 0,M=void 0,N=void 0;return y={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");t(),E.on(w.INTERNAL_KEY_MESSAGE,m,this),E.on(w.INTERNAL_KEY_STATUS_CHANGED,g,this),x.push(e);var n=_.getSupportedKeySystemsFromContentProtection(e.contentProtection);n&&0<n.length&&h(n,!0)},createKeySession:n,loadKeySession:i,removeKeySession:function(e){t(),b.removeKeySession(e)},closeKeySession:function(e){t(),b.closeKeySession(e)},setServerCertificate:function(e){t(),b.setServerCertificate(e)},setMediaElement:r,setSessionType:function(e){R=e},setRobustnessLevel:function(e){M=e},setProtectionData:function(e){D=e,_.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return t(),_.getSupportedKeySystemsFromContentProtection(e)},getKeySystems:function(){return _?_.getKeySystems():[]},setKeySystems:function(e){_&&_.setKeySystems(e)},stop:function(){b&&b.stop()},reset:function(){t(),E.off(w.INTERNAL_KEY_MESSAGE,m,this),E.off(w.INTERNAL_KEY_STATUS_CHANGED,g,this),r(null),N=void 0,b&&(b.reset(),b=null),k.forEach((function(e){return clearTimeout(e)})),k=[],x=[]}},I=T.getLogger(y),A=[],x=[],R="temporary",M="",y}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(161)),o=i(e(183)),s=i(e(182)),l=i(e(170)),d=i(e(226));r.__dashjs_factory_name="ProtectionController",n.default=dashjs.FactoryMaker.getClassFactory(r),t.exports=n.default},{161:161,170:170,182:182,183:183,226:226}],165:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=this.context,t=void 0,n=void 0,i=void 0,r=void 0,g=void 0,m=void 0,v=void 0;return t={initialize:function(){r=[];var t=void 0;t=(0,d.default)(e).getInstance({BASE64:g});r.push(t),t=(0,l.default)(e).getInstance({BASE64:g}),r.push(t),t=(0,o.default)(e).getInstance({BASE64:g}),r.push(t),m=t,t=(0,s.default)(e).getInstance({BASE64:g,debug:n}),r.push(t),v=t},setProtectionData:function(e){for(var t,n,i=0;i<r.length;i++){var a=r[i];a.hasOwnProperty("init")&&a.init((t=a.systemString,n=void 0,n=null,e&&(n=t in e?e[t]:null),n))}},isClearKey:function(e){return e===m||e===v},initDataEquals:function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var n=new Uint8Array(e),i=new Uint8Array(t),r=0;r<n.length;r++)if(n[r]!==i[r])return!1;return!0},getKeySystems:function(){return r},setKeySystems:function(e){r=e},getKeySystemBySystemString:function(e){for(var t=0;t<r.length;t++)if(r[t].systemString===e)return r[t];return null},getSupportedKeySystemsFromContentProtection:function(e){var t=void 0,n=void 0,i=void 0,o=void 0,s=[];if(e){var l,d=a.default.findCencContentProtection(e);for(i=0;i<r.length;++i)for(n=r[i],o=0;o<e.length;++o)(t=e[o]).schemeIdUri.toLowerCase()===n.schemeIdURI&&(l=n.getInitData(t,d),s.push({ks:r[i],initData:l,cdmData:n.getCDMData(),sessionId:n.getSessionId(t)}))}return s},getSupportedKeySystems:function(e,t){for(var n=[],i=a.default.parsePSSHList(e),o=void 0,s=void 0,l=void 0,d=0;d<r.length;++d)s=(o=r[d]).systemString,l=!t||s in t,o.uuid in i&&l&&n.push({ks:o,initData:i[o.uuid],cdmData:o.getCDMData(),sessionId:o.getSessionId()});return n},getLicenseServer:function(t,n,i){if("license-release"===i||"individualization-request"===i)return null;var r=null;return n&&n.hasOwnProperty("drmtoday")?r=(0,c.default)(e).getInstance({BASE64:g}):t.systemString===p.default.WIDEVINE_KEYSTEM_STRING?r=(0,f.default)(e).getInstance():t.systemString===p.default.PLAYREADY_KEYSTEM_STRING?r=(0,u.default)(e).getInstance():t.systemString===p.default.CLEARKEY_KEYSTEM_STRING&&(r=(0,h.default)(e).getInstance()),r},processClearKeyLicenseRequest:function(e,t,n){try{return e.getClearKeysFromProtectionData(t,n)}catch(e){return i.error("Failed to retrieve clearkeys from ProtectionData"),null}},setConfig:function(e){e&&(e.debug&&(n=e.debug,i=n.getLogger(t)),e.BASE64&&(g=e.BASE64))}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(161)),o=i(e(166)),s=i(e(168)),l=i(e(169)),d=i(e(167)),c=i(e(175)),u=i(e(176)),f=i(e(177)),h=i(e(174)),p=i(e(110));r.__dashjs_factory_name="ProtectionKeyController",n.default=dashjs.FactoryMaker.getSingletonFactory(r),t.exports=n.default},{110:110,161:161,166:166,167:167,168:168,169:169,174:174,175:175,176:176,177:177}],166:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=(e=e||{}).BASE64,n={attributes:["Laurl","laurl"],prefixes:["clearkey","dashif"]};return{uuid:d,schemeIdURI:u,systemString:c,getInitData:function(e,n){try{var i,r=s.default.parseInitDataFromContentProtection(e,t);return!r&&n&&(i={kids:[function(e){try{var t=e.replace(/-/g,"");return(t=btoa(t.match(/\w{2}/g).map((function(e){return String.fromCharCode(parseInt(e,16))})).join(""))).replace(/=/g,"")}catch(e){return null}}(n["cenc:default_KID"])]},r=(new TextEncoder).encode(JSON.stringify(i))),r}catch(e){return null}},getRequestHeadersFromMessage:function(){return{"Content-Type":"application/json"}},getLicenseRequestFromMessage:function(e){return JSON.parse(String.fromCharCode.apply(null,new Uint8Array(e)))},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getLicenseServerUrlFromMediaInfo:function(e){try{if(!e||0===e.length)return null;for(var t=0,i=null;t<e.length&&!i;){var r=e[t];if(r&&r.contentProtection&&0<r.contentProtection.length){var a=r.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===u}));if(a&&0<a.length)for(var o=0;o<a.length&&!i;){for(var s=a[o],l=0;l<n.attributes.length&&!i;){for(var d=0,c=n.attributes[l];d<n.prefixes.length&&!i;){var f=n.prefixes[d];s[c]&&s[c].__prefix&&s[c].__prefix===f&&s[c].__text&&(i=s[c].__text),d+=1}l+=1}o+=1}}t+=1}return i}catch(e){return null}},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var i=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),r=[],s=0;s<i.kids.length;s++){var l=i.kids[s],d=e.clearkeys&&e.clearkeys.hasOwnProperty(l)?e.clearkeys[l]:null;if(!d)throw new Error("DRM: ClearKey keyID ("+l+") is not known!");r.push(new a.default(l,d))}n=new o.default(r)}return n}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(180)),o=i(e(178)),s=i(e(161)),l=i(e(110)),d="e2719d58-a985-b3c9-781a-b030af78d30e",c=l.default.CLEARKEY_KEYSTEM_STRING,u="urn:uuid:"+d;r.__dashjs_factory_name="KeySystemClearKey",n.default=dashjs.FactoryMaker.getSingletonFactory(r),t.exports=n.default},{110:110,161:161,178:178,180:180}],167:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){if(!i||!i.hasOwnProperty("decodeArray")||!i.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}var n="utf-16",i=(e=e||{}).BASE64;return{uuid:s,schemeIdURI:"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95",systemString:l,getInitData:function(e){var n,r,o,s=new Uint8Array([112,115,115,104,0,0,0,0]),l=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]),d=0,c=null,u=void 0,f=void 0;if(t(),!e)return null;if("pssh"in e)return a.default.parseInitDataFromContentProtection(e,i);if("pro"in e)c=i.decodeArray(e.pro.__text);else{if(!("prheader"in e))return null;c=i.decodeArray(e.prheader.__text)}return n=c.length,r=4+s.length+l.length+4+n,o=new ArrayBuffer(r),u=new Uint8Array(o),(f=new DataView(o)).setUint32(d,r),d+=4,u.set(s,d),d+=s.length,u.set(l,d),d+=l.length,f.setUint32(d,n),d+=4,u.set(c,d),d+=n,u.buffer},getRequestHeadersFromMessage:function(e){for(var t=void 0,i={},r=new DOMParser,a=new("utf-16"===n?Uint16Array:Uint8Array)(e),o=String.fromCharCode.apply(null,a),s=(t=r.parseFromString(o,"application/xml")).getElementsByTagName("name"),l=t.getElementsByTagName("value"),d=0;d<s.length;d++)i[s[d].childNodes[0].nodeValue]=l[d].childNodes[0].nodeValue;return i.hasOwnProperty("Content")&&(i["Content-Type"]=i.Content,delete i.Content),i.hasOwnProperty("Content-Type")||(i["Content-Type"]="text/xml; charset=utf-8"),i},getLicenseRequestFromMessage:function(e){var r=null,a=new DOMParser,o=new("utf-16"===n?Uint16Array:Uint8Array)(e);t();var s=String.fromCharCode.apply(null,o),l=a.parseFromString(s,"application/xml");if(!l.getElementsByTagName("PlayReadyKeyMessage")[0])return e;var d=l.getElementsByTagName("Challenge")[0].childNodes[0].nodeValue;return d&&(r=i.decode(d)),r},getLicenseServerURLFromInitData:function(e){if(e)for(var t=new DataView(e),n=t.getUint16(4,!0),i=6,r=new DOMParser,a=0;a<n;a++){var o=t.getUint16(i,!0);i+=2;var s=t.getUint16(i,!0);if(i+=2,1===o){var l=e.slice(i,i+s),d=String.fromCharCode.apply(null,new Uint16Array(l)),c=r.parseFromString(d,"application/xml");if(c.getElementsByTagName("LA_URL")[0]){var u=c.getElementsByTagName("LA_URL")[0].childNodes[0].nodeValue;if(u)return u}if(c.getElementsByTagName("LUI_URL")[0]){var f=c.getElementsByTagName("LUI_URL")[0].childNodes[0].nodeValue;if(f)return f}}else i+=s}return null},getCDMData:function(){var e=void 0,n=void 0,r=void 0,a=void 0;if(t(),d&&d.cdmData){for(e=[],a=0;a<d.cdmData.length;++a)e.push(d.cdmData.charCodeAt(a)),e.push(0);for(e=String.fromCharCode.apply(null,e),e=i.encode(e),n='<PlayReadyCDMData type="LicenseAcquisition"><LicenseAcquisition version="1.0" Proactive="false"><CustomData encoding="base64encoded">%CUSTOMDATA%</CustomData></LicenseAcquisition></PlayReadyCDMData>'.replace("%CUSTOMDATA%",e),r=[],a=0;a<n.length;++a)r.push(n.charCodeAt(a)),r.push(0);return new Uint8Array(r).buffer}return null},getSessionId:function(e){return d&&d.sessionId?d.sessionId:e&&e.sessionId?e.sessionId:null},setPlayReadyMessageFormat:function(e){if("utf-8"!==e&&"utf-16"!==e)throw new Error('Specified message format is not one of "utf-8" or "utf-16"');n=e},init:function(e){e&&(d=e)}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(161)),o=i(e(110)),s="9a04f079-9840-4286-ab92-e65be0885f95",l=o.default.PLAYREADY_KEYSTEM_STRING,d=void 0;r.__dashjs_factory_name="KeySystemPlayReady",n.default=dashjs.FactoryMaker.getSingletonFactory(r),t.exports=n.default},{110:110,161:161}],168:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=void 0,n=e.BASE64,i=e.debug.getLogger(t);return{uuid:d,schemeIdURI:"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",systemString:c,getInitData:function(e){return s.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(){return null},getClearKeysFromProtectionData:function(e,t){var n=null;if(e){for(var r=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t))),s=[],l=0;l<r.kids.length;l++){var d=r.kids[l],c=e.clearkeys&&e.clearkeys.hasOwnProperty(d)?e.clearkeys[d]:null;if(!c)throw new Error("DRM: ClearKey keyID ("+d+") is not known!");s.push(new a.default(d,c))}n=new o.default(s),i.warn("ClearKey schemeIdURI is using W3C Common PSSH systemID (1077efec-c0b2-4d02-ace3-3c1e52e2fb4b) in Content Protection. See DASH-IF IOP v4.1 section 7.6.2.4")}return n}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(180)),o=i(e(178)),s=i(e(161)),l=i(e(110)),d="1077efec-c0b2-4d02-ace3-3c1e52e2fb4b",c=l.default.CLEARKEY_KEYSTEM_STRING;r.__dashjs_factory_name="KeySystemW3CClearKey",n.default=dashjs.FactoryMaker.getSingletonFactory(r),t.exports=n.default},{110:110,161:161,178:178,180:180}],169:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=null,n=(e=e||{}).BASE64;return{uuid:s,schemeIdURI:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",systemString:l,init:function(e){e&&(t=e)},getInitData:function(e){return a.default.parseInitDataFromContentProtection(e,n)},getRequestHeadersFromMessage:function(){return null},getLicenseRequestFromMessage:function(e){return new Uint8Array(e)},getLicenseServerURLFromInitData:function(){return null},getCDMData:function(){return null},getSessionId:function(e){return t&&t.sessionId?t.sessionId:e&&e.sessionId?e.sessionId:null}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(161)),o=i(e(110)),s="edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",l=o.default.WIDEVINE_KEYSTEM_STRING;r.__dashjs_factory_name="KeySystemWidevine",n.default=dashjs.FactoryMaker.getSingletonFactory(r),t.exports=n.default},{110:110,161:161}],170:[function(e,t,n){"use strict";function i(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).call(this),this.MEDIA_KEYERR_CODE=100,this.MEDIA_KEYERR_UNKNOWN_CODE=101,this.MEDIA_KEYERR_CLIENT_CODE=102,this.MEDIA_KEYERR_SERVICE_CODE=103,this.MEDIA_KEYERR_OUTPUT_CODE=104,this.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,this.MEDIA_KEYERR_DOMAIN_CODE=106,this.MEDIA_KEY_MESSAGE_ERROR_CODE=107,this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,this.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,this.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,this.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,this.KEY_SESSION_CREATED_ERROR_CODE=113,this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,this.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",
this.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",this.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",this.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",this.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",this.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",this.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",this.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",this.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",this.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",this.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",this.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",this.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",this.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --"}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=new(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,((r=e(52))&&r.__esModule?r:{default:r}).default),i);n.default=o,t.exports=n.default},{52:52}],171:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){b&&r();for(var e=0;e<S.length;e++)n(S[e]);h.trigger(p.TEARDOWN_COMPLETE)}function n(e){try{b[m.cancelKeyRequest](E.systemString,e.sessionID)}catch(t){h.trigger(p.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.sessionID+") "+t.message})}}function i(e,t){if(t&&e){for(var n=e.length,i=0;i<n;i++)if(e[i].sessionID==t)return e[i];return null}return null}function r(){b.removeEventListener(m.keyerror,k),b.removeEventListener(m.needkey,k),b.removeEventListener(m.keymessage,k),b.removeEventListener(m.keyadded,k)}e=e||{};var f=this.context,h=e.eventBus,p=e.events,g=e.debug,m=e.api,v=e.errHandler,y=void 0,_=void 0,b=void 0,E=void 0,w=void 0,T=void 0,S=void 0,C=void 0,k=void 0;return y={getAllInitData:function(){for(var e=[],t=0;t<T.length;t++)e.push(T[t].initData);for(t=0;t<S.length;t++)e.push(S[t].initData);return e},requestKeySystemAccess:function(e){for(var t=(t=b)||document.createElement("video"),n=!1,i=0;i<e.length;i++)for(var r=e[i].ks.systemString,a=e[i].configs,o=null,s=null,l=0;l<a.length;l++){var u=a[l].videoCapabilities;if(u&&0!==u.length){s=[];for(var f=0;f<u.length;f++)""!==t.canPlayType(u[f].contentType,r)&&s.push(u[f])}if(s&&(!s||0!==s.length)){n=!0;var g=new d.default(o,s),m=w.getKeySystemBySystemString(r);h.trigger(p.KEY_SYSTEM_ACCESS_COMPLETE,{data:new c.default(m,g)});break}}n||h.trigger(p.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return E},selectKeySystem:function(e){E=e.keySystem,h.trigger(p.INTERNAL_KEY_SYSTEM_SELECTED)},setMediaElement:function(e){if(b!==e){if(b){r();for(var t=0;t<S.length;t++)n(S[t]);S=[]}(b=e)&&(b.addEventListener(m.keyerror,k),b.addEventListener(m.needkey,k),b.addEventListener(m.keymessage,k),b.addEventListener(m.keyadded,k),h.trigger(p.VIDEO_ELEMENT_SELECTED))}},createKeySession:function(e){if(!E)throw new Error("Can not create sessions until you have selected a key system");if(C||0===S.length){var t={sessionID:null,initData:e,getSessionID:function(){return this.sessionID},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"}};return T.push(t),b[m.generateKeyRequest](E.systemString,new Uint8Array(e)),t}throw new Error("Multiple sessions not allowed!")},updateKeySession:function(e,t){var n=e.sessionID;if(w.isClearKey(E))for(var i=0;i<t.keyPairs.length;i++)b[m.addKey](E.systemString,t.keyPairs[i].key,t.keyPairs[i].keyID,n);else b[m.addKey](E.systemString,new Uint8Array(t),new Uint8Array(e.initData),n)},closeKeySession:n,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:t,reset:t},_=g.getLogger(y),T=[],S=[],w=(E=b=null,a.default)(f).getInstance(),k={handleEvent:function(e){var t,n=null;switch(e.type){case m.needkey:var r=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;h.trigger(p.NEED_KEY,{key:new o.default(r,"cenc")});break;case m.keyerror:if(n=(n=i(S,e.sessionId))||i(T,e.sessionId)){var a=u.default.MEDIA_KEYERR_CODE,d="";switch(e.errorCode.code){case 1:a=u.default.MEDIA_KEYERR_UNKNOWN_CODE,d+="MEDIA_KEYERR_UNKNOWN - "+u.default.MEDIA_KEYERR_UNKNOWN_MESSAGE;break;case 2:a=u.default.MEDIA_KEYERR_CLIENT_CODE,d+="MEDIA_KEYERR_CLIENT - "+u.default.MEDIA_KEYERR_CLIENT_MESSAGE;break;case 3:a=u.default.MEDIA_KEYERR_SERVICE_CODE,d+="MEDIA_KEYERR_SERVICE - "+u.default.MEDIA_KEYERR_SERVICE_MESSAGE;break;case 4:a=u.default.MEDIA_KEYERR_OUTPUT_CODE,d+="MEDIA_KEYERR_OUTPUT - "+u.default.MEDIA_KEYERR_OUTPUT_MESSAGE;break;case 5:a=u.default.MEDIA_KEYERR_HARDWARECHANGE_CODE,d+="MEDIA_KEYERR_HARDWARECHANGE - "+u.default.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE;break;case 6:a=u.default.MEDIA_KEYERR_DOMAIN_CODE,d+="MEDIA_KEYERR_DOMAIN - "+u.default.MEDIA_KEYERR_DOMAIN_MESSAGE}d+="  System Code = "+e.systemCode,h.trigger(p.KEY_ERROR,{data:new s.default(a,d,n)})}else _.error("No session token found for key error");break;case m.keyadded:(n=(n=i(S,e.sessionId))||i(T,e.sessionId))?(_.debug("DRM: Key added."),h.trigger(p.KEY_ADDED,{data:n})):_.debug("No session token found for key added");break;case m.keymessage:(C=null!==e.sessionId&&void 0!==e.sessionId)?!(n=i(S,e.sessionId))&&0<T.length&&(n=T.shift(),S.push(n),n.sessionID=e.sessionId,h.trigger(p.KEY_SESSION_CREATED,{data:n})):0<T.length&&(n=T.shift(),S.push(n),0!==T.length&&v.error(new s.default(u.default.MEDIA_KEY_MESSAGE_ERROR_CODE,u.default.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),n?(t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message,n.keyMessage=t,h.trigger(p.INTERNAL_KEY_MESSAGE,{data:new l.default(n,t,e.defaultURL)})):_.warn("No session token found for key message")}}},y}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(165)),o=i(e(184)),s=i(e(226)),l=i(e(179)),d=i(e(182)),c=i(e(181)),u=i(e(170));r.__dashjs_factory_name="ProtectionModel_01b",n.default=dashjs.FactoryMaker.getClassFactory(r),t.exports=n.default},{165:165,170:170,179:179,181:181,182:182,184:184,226:226}],172:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){var t=e.session;return t.removeEventListener("keystatuseschange",e),t.removeEventListener("message",e),t.close()}function n(e){for(var t=0;t<E.length;t++)if(E[t]===e){E.splice(t,1);break}}function i(e){var t=void 0,n=void 0;return e&&0<e.length&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function r(e,t,r,a){var o={session:e,initData:t,sessionId:a,handleEvent:function(e){switch(e.type){case"keystatuseschange":h.trigger(p.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=i(arguments);switch(e.status){case"expired":h.trigger(p.INTERNAL_KEY_STATUS_CHANGED,{error:new l.default(s.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,s.default.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)});break;default:h.trigger(p.INTERNAL_KEY_STATUS_CHANGED,e)}}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;h.trigger(p.INTERNAL_KEY_MESSAGE,{data:new d.default(this,t,void 0,e.messageType)})}},getSessionID:function(){return e.sessionId},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){"usable"===i(arguments).status&&(t=!0)})),t},getSessionType:function(){return r}};return e.addEventListener("keystatuseschange",o),e.addEventListener("message",o),e.closed.then((function(){n(o),v.debug("DRM: Session closed.  SessionID = "+o.getSessionID()),h.trigger(p.KEY_SESSION_CLOSED,{data:o.getSessionID()})})),E.push(o),o}e=e||{};var f=this.context,h=e.eventBus,p=e.events,g=e.debug,m=void 0,v=void 0,y=void 0,_=void 0,b=void 0,E=void 0,w=void 0,T=void 0;return m={getAllInitData:function(){for(var e=[],t=0;t<E.length;t++)E[t].initData&&e.push(E[t].initData);return e},requestKeySystemAccess:function(e){!function e(t,n){void 0!==navigator.requestMediaKeySystemAccess&&"function"==typeof navigator.requestMediaKeySystemAccess?function(n){var i=t[n].ks,r=t[n].configs,a=i.systemString;a===u.default.PLAYREADY_KEYSTEM_STRING&&"required"===r[0].persistentState&&(a+=".recommendation"),navigator.requestMediaKeySystemAccess(a,r).then((function(e){var t="function"==typeof e.getConfiguration?e.getConfiguration():null,n=new c.default(i,t);n.mksa=e,h.trigger(p.KEY_SYSTEM_ACCESS_COMPLETE,{data:n})})).catch((function(i){++n<t.length?e(t,n):h.trigger(p.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! "+i.message})}))}(n):h.trigger(p.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Insecure origins are not allowed"})}(e,0)},getKeySystem:function(){return y},selectKeySystem:function(e){e.mksa.createMediaKeys().then((function(t){y=e.keySystem,b=t,_?_.setMediaKeys(b).then((function(){h.trigger(p.INTERNAL_KEY_SYSTEM_SELECTED)})):h.trigger(p.INTERNAL_KEY_SYSTEM_SELECTED)})).catch((function(){h.trigger(p.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+e.keySystem.systemString+")! Could not create MediaKeys -- TODO"})}))},setMediaElement:function(e){_!==e&&(_&&(_.removeEventListener("encrypted",w),_.setMediaKeys&&_.setMediaKeys(null)),(_=e)&&(_.addEventListener("encrypted",w),_.setMediaKeys&&b&&_.setMediaKeys(b)))},setServerCertificate:function(e){if(!y||!b)throw new Error("Can not set server certificate until you have selected a key system");b.setServerCertificate(e).then((function(){v.info("DRM: License server certificate successfully updated."),h.trigger(p.SERVER_CERTIFICATE_UPDATED)})).catch((function(e){h.trigger(p.SERVER_CERTIFICATE_UPDATED,{error:new l.default(s.default.SERVER_CERTIFICATE_UPDATED_ERROR_CODE,s.default.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE+e.name)})}))},createKeySession:function(e,t,i){if(!y||!b)throw new Error("Can not create sessions until you have selected a key system");var a=b.createSession(i),o=r(a,e,i),d=this.getKeySystem().systemString===u.default.CLEARKEY_KEYSTEM_STRING&&(e||t&&t.clearkeys)?"keyids":"cenc";a.generateRequest(d,e).then((function(){v.debug("DRM: Session created.  SessionID = "+o.getSessionID()),h.trigger(p.KEY_SESSION_CREATED,{data:o})})).catch((function(e){n(o),h.trigger(p.KEY_SESSION_CREATED,{data:null,error:new l.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Error generating key request -- "+e.name)})}))},updateKeySession:function(e,t){var n=e.session;T.isClearKey(y)&&(t=t.toJWK()),n.update(t).catch((function(t){h.trigger(p.KEY_ERROR,{data:new l.default(s.default.MEDIA_KEYERR_CODE,"Error sending update() message! "+t.name,e)})}))},loadKeySession:function(e,t,i){if(!y||!b)throw new Error("Can not load sessions until you have selected a key system");for(var a=0;a<E.length;a++)if(e===E[a].sessionId)return void v.warn("DRM: Ignoring session ID because we have already seen it!");var o=b.createSession(i),d=r(o,t,i,e);o.load(e).then((function(t){t?(v.debug("DRM: Session loaded.  SessionID = "+d.getSessionID()),h.trigger(p.KEY_SESSION_CREATED,{data:d})):(n(d),h.trigger(p.KEY_SESSION_CREATED,{data:null,error:new l.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session! Invalid Session ID ("+e+")")}))})).catch((function(t){n(d),h.trigger(p.KEY_SESSION_CREATED,{data:null,error:new l.default(s.default.KEY_SESSION_CREATED_ERROR_CODE,s.default.KEY_SESSION_CREATED_ERROR_MESSAGE+"Could not load session ("+e+")! "+t.name)})}))},removeKeySession:function(e){e.session.remove().then((function(){v.debug("DRM: Session removed.  SessionID = "+e.getSessionID()),h.trigger(p.KEY_SESSION_REMOVED,{data:e.getSessionID()})}),(function(t){h.trigger(p.KEY_SESSION_REMOVED,{data:null,error:"Error removing session ("+e.getSessionID()+"). "+t.name})}))},closeKeySession:function(e){t(e).catch((function(t){n(e),h.trigger(p.KEY_SESSION_CLOSED,{data:null,error:"Error closing session ("+e.getSessionID()+") "+t.name})}))},stop:function(){for(var e=void 0,i=0;i<E.length;i++)(e=E[i]).getUsable()||t(e).catch((function(){n(e)}))},reset:function(){var e=E.length,i=void 0;0!==e?function(){for(var r=function(e){n(e),0===E.length&&(_?(_.removeEventListener("encrypted",w),_.setMediaKeys(null).then((function(){h.trigger(p.TEARDOWN_COMPLETE)}))):h.trigger(p.TEARDOWN_COMPLETE))},a=0;a<e;a++)!function(e){i.session.closed.then((function(){r(e)})),t(i).catch((function(){r(e)}))}(i=E[a])}():h.trigger(p.TEARDOWN_COMPLETE)}},v=g.getLogger(m),E=[],T=(b=_=y=null,a.default)(f).getInstance(),w={handleEvent:function(e){switch(e.type){case"encrypted":var t;e.initData&&(t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData,h.trigger(p.NEED_KEY,{key:new o.default(t,e.initDataType)}))}}},m}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(165)),o=i(e(184)),s=i(e(170)),l=i(e(226)),d=i(e(179)),c=i(e(181)),u=i(e(110));r.__dashjs_factory_name="ProtectionModel_21Jan2015",n.default=dashjs.FactoryMaker.getClassFactory(r),t.exports=n.default},{110:110,165:165,170:170,179:179,181:181,184:184,226:226}],173:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){try{for(var e=0;e<w.length;e++)n(w[e]);y&&y.removeEventListener(g.needkey,T),f.trigger(h.TEARDOWN_COMPLETE)}catch(e){f.trigger(h.TEARDOWN_COMPLETE,{error:"Error tearing down key sessions and MediaKeys! -- "+e.message})}}function n(e){var t=e.session;t.removeEventListener(g.error,e),t.removeEventListener(g.message,e),t.removeEventListener(g.ready,e),t.removeEventListener(g.close,e);for(var n=0;n<w.length;n++)if(w[n]===e){w.splice(n,1);break}t[g.release]()}function i(){function e(){y.removeEventListener("loadedmetadata",t),y[g.setMediaKeys](b),f.trigger(h.VIDEO_ELEMENT_SELECTED)}var t=null;1<=y.readyState?e():(t=e.bind(this),y.addEventListener("loadedmetadata",t))}e=e||{};var r=this.context,f=e.eventBus,h=e.events,p=e.debug,g=e.api,m=void 0,v=void 0,y=void 0,_=void 0,b=void 0,E=void 0,w=void 0,T=void 0,S=void 0;return m={getAllInitData:function(){for(var e=[],t=0;t<w.length;t++)e.push(w[t].initData);return e},requestKeySystemAccess:function(e){for(var t=!1,n=0;n<e.length;n++)for(var i=e[n].ks.systemString,r=e[n].configs,a=null,o=null,s=0;s<r.length;s++){var l=r[s].audioCapabilities,d=r[s].videoCapabilities;if(l&&0!==l.length){a=[];for(var p=0;p<l.length;p++)window[g.MediaKeys].isTypeSupported(i,l[p].contentType)&&a.push(l[p])}if(d&&0!==d.length){o=[];for(var m=0;m<d.length;m++)window[g.MediaKeys].isTypeSupported(i,d[m].contentType)&&o.push(d[m])}if(!(!a&&!o||a&&0===a.length||o&&0===o.length)){t=!0;var v=new c.default(a,o),y=S.getKeySystemBySystemString(i);f.trigger(h.KEY_SYSTEM_ACCESS_COMPLETE,{data:new u.default(y,v)});break}}t||f.trigger(h.KEY_SYSTEM_ACCESS_COMPLETE,{error:"Key system access denied! -- No valid audio/video content configurations detected!"})},getKeySystem:function(){return _},selectKeySystem:function(e){try{b=e.mediaKeys=new window[g.MediaKeys](e.keySystem.systemString),_=e.keySystem,E=e,y&&i(),f.trigger(h.INTERNAL_KEY_SYSTEM_SELECTED)}catch(e){f.trigger(h.INTERNAL_KEY_SYSTEM_SELECTED,{error:"Error selecting keys system ("+_.systemString+")! Could not create MediaKeys -- TODO"})}},setMediaElement:function(e){y!==e&&(y&&y.removeEventListener(g.needkey,T),(y=e)&&(y.addEventListener(g.needkey,T),b&&i()))},createKeySession:function(e,t,n,i){if(!_||!b||!E)throw new Error("Can not create sessions until you have selected a key system");var r=null;if(E.ksConfiguration.videoCapabilities&&0<E.ksConfiguration.videoCapabilities.length&&(r=E.ksConfiguration.videoCapabilities[0]),null===r&&E.ksConfiguration.audioCapabilities&&0<E.ksConfiguration.audioCapabilities.length&&(r=E.ksConfiguration.audioCapabilities[0]),null===r)throw new Error("Can not create sessions for unknown content types.");var a=r.contentType,o=b.createSession(a,new Uint8Array(e),i?new Uint8Array(i):null),c={session:o,initData:e,getSessionID:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case g.error:f.trigger(h.KEY_ERROR,{data:new s.default(l.default.MEDIA_KEYERR_CODE,"KeyError",this)});break;case g.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;f.trigger(h.INTERNAL_KEY_MESSAGE,{data:new d.default(this,t,e.destinationURL)});break;case g.ready:v.debug("DRM: Key added."),f.trigger(h.KEY_ADDED);break;case g.close:v.debug("DRM: Session closed.  SessionID = "+this.getSessionID()),f.trigger(h.KEY_SESSION_CLOSED,{data:this.getSessionID()})}}};o.addEventListener(g.error,c),o.addEventListener(g.message,c),o.addEventListener(g.ready,c),o.addEventListener(g.close,c),w.push(c),v.debug("DRM: Session created.  SessionID = "+c.getSessionID()),f.trigger(h.KEY_SESSION_CREATED,{data:c})},updateKeySession:function(e,t){var n=e.session;S.isClearKey(_)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t))},closeKeySession:n,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:t,reset:t},v=p.getLogger(m),w=[],S=(E=b=_=y=null,a.default)(r).getInstance(),T={handleEvent:function(e){switch(e.type){case g.needkey:var t;e.initData&&(t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData,f.trigger(h.NEED_KEY,{key:new o.default(t,"cenc")}))}}},m}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(165)),o=i(e(184)),s=i(e(226)),l=i(e(170)),d=i(e(179)),c=i(e(182)),u=i(e(181));r.__dashjs_factory_name="ProtectionModel_3Feb2014",n.default=dashjs.FactoryMaker.getClassFactory(r),t.exports=n.default},{165:165,170:170,179:179,181:181,182:182,184:184,226:226}],174:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"json"},getLicenseMessage:function(e){if(!e.hasOwnProperty("keys"))return null;for(var t=[],n=0;n<e.keys.length;n++){var i=e.keys[n],r=i.kid.replace(/=/g,""),s=i.k.replace(/=/g,"");t.push(new a.default(r,s))}return new o.default(t)},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(180)),o=i(e(178));r.__dashjs_factory_name="ClearKey",n.default=dashjs.FactoryMaker.getSingletonFactory(r),t.exports=n.default},{178:178,180:180}],175:[function(e,t,n){"use strict";function i(e){var t=(e=e||{}).BASE64,n={};return n[a.default.WIDEVINE_KEYSTEM_STRING]={responseType:"json",getLicenseMessage:function(e){return t.decodeArray(e.license)},getErrorResponse:function(e){return e}},n[a.default.PLAYREADY_KEYSTEM_STRING]={responseType:"arraybuffer",getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}},{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(e){return n[e].responseType},getLicenseMessage:function(e,i){return function(){if(!t||!t.hasOwnProperty("decodeArray"))throw new Error("Missing config parameter(s)")}(),n[i].getLicenseMessage(e)},getErrorResponse:function(e,t){return n[t].getErrorResponse(e)}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(110))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="DRMToday",n.default=dashjs.FactoryMaker.getSingletonFactory(i),t.exports=n.default},{110:110}],176:[function(e,t,n){"use strict";function i(){function e(e){var t=String.fromCharCode.apply(null,new Uint8Array(e));return decodeURIComponent(escape(t))}var t="http://schemas.xmlsoap.org/soap/envelope/";return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(n){return function(n){if(window.DOMParser){var i=e(n),r=(new window.DOMParser).parseFromString(i,"text/xml"),a=r?r.getElementsByTagNameNS(t,"Envelope")[0]:null,o=a?a.getElementsByTagNameNS(t,"Body")[0]:null;if(o&&o.getElementsByTagNameNS(t,"Fault")[0])return null}return n}.call(this,n)},getErrorResponse:function(n){return function(n){var i="",r="",a="",o=-1,s=-1;if(window.DOMParser){var l=e(n),d=(new window.DOMParser).parseFromString(l,"text/xml"),c=d?d.getElementsByTagNameNS(t,"Envelope")[0]:null,u=c?c.getElementsByTagNameNS(t,"Body")[0]:null,f=u?u.getElementsByTagNameNS(t,"Fault")[0]:null,h=f?f.getElementsByTagName("detail")[0]:null,p=h?h.getElementsByTagName("Exception")[0]:null,g=null;if(null===f)return l;i=(g=f.getElementsByTagName("faultstring")[0].firstChild)?g.nodeValue:null,null!==p&&(r=(g=p.getElementsByTagName("StatusCode")[0])?g.firstChild.nodeValue:null,o=(a=(g=p.getElementsByTagName("Message")[0])?g.firstChild.nodeValue:null)?a.lastIndexOf("[")+1:-1,s=a?a.indexOf("]"):-1,a=a?a.substring(o,s):"")}var m="code: "+r+", name: "+i;return a&&(m+=", message: "+a),m}.call(this,n)}}}Object.defineProperty(n,"__esModule",{value:!0}),i.__dashjs_factory_name="PlayReady",n.default=dashjs.FactoryMaker.getSingletonFactory(i),t.exports=n.default},{}],177:[function(e,t,n){"use strict";function i(){return{getServerURLFromMessage:function(e){return e},getHTTPMethod:function(){return"POST"},getResponseType:function(){return"arraybuffer"},getLicenseMessage:function(e){return e},getErrorResponse:function(e){return String.fromCharCode.apply(null,new Uint8Array(e))}}}Object.defineProperty(n,"__esModule",{value:!0}),i.__dashjs_factory_name="Widevine",n.default=dashjs.FactoryMaker.getSingletonFactory(i),t.exports=n.default},{}],178:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),t&&"persistent"!==t&&"temporary"!==t)throw new Error("Invalid ClearKey key set type!  Must be one of 'persistent' or 'temporary'");this.keyPairs=e,this.type=t}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"toJWK",value:function(){var e=void 0,t=this.keyPairs.length,n={keys:[]};for(e=0;e<t;e++){var i={kty:"oct",alg:"A128KW",kid:this.keyPairs[e].keyID,k:this.keyPairs[e].key};n.keys.push(i)}this.type&&(n.type=this.type);var r=JSON.stringify(n),a=r.length,o=new ArrayBuffer(a),s=new Uint8Array(o);for(e=0;e<a;e++)s[e]=r.charCodeAt(e);return o}}]),r);n.default=a,t.exports=n.default},{}],179:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(t,n,i,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.sessionToken=t,this.message=n,this.defaultURL=i,this.messageType=r||"license-request"},t.exports=n.default},{}],180:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n},t.exports=n.default},{}],181:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keySystem=t,this.ksConfiguration=n},t.exports=n.default},{}],182:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(t,n,i,r,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=i,this.persistentState=r,this.sessionTypes=a},t.exports=n.default},{}],183:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n},t.exports=n.default},{}],184:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initData=t,this.initDataType=n},t.exports=n.default},{}],185:[function(e,t,n){"use strict";function i(){var e=[],t=0,n=0;return{push:function(i,r){var a=r&&r.droppedVideoFrames?r.droppedVideoFrames:0,o=r&&r.totalVideoFrames?r.totalVideoFrames:0,s=a-t;t=a;var l=o-n;n=o,isNaN(i)||(e[i]?(e[i].droppedVideoFrames+=s,e[i].totalVideoFrames+=l):e[i]={droppedVideoFrames:s,totalVideoFrames:l})},getFrameHistory:function(){return e},reset:function(i){e=[],t=i.droppedVideoFrames,n=i.totalVideoFrames}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="DroppedFramesHistory";var o=a.default.getClassFactory(i);n.default=o,t.exports=n.default},{47:47}],186:[function(e,t,n){"use strict";function i(e){function t(){return l?l.mediaInfo:null}var n=(e=e||{}).abrController,i=e.switchHistory,r=e.droppedFramesHistory,a=e.currentRequest,o=e.useBufferOccupancyABR,s=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null;return{getMediaType:function(){var e=t();return e?e.type:null},getMediaInfo:t,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return a},getSwitchHistory:function(){return i},getStreamInfo:function(){var e=t();return e?e.streamInfo:null},getScheduleController:function(){return s},getAbrController:function(){return n},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return o}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="RulesContext",n.default=a.default.getClassFactory(i),t.exports=n.default},{47:47}],187:[function(e,t,n){"use strict";function i(e,t,n){var i;return{quality:void 0===e?-1:e,reason:void 0===t?null:t,priority:(i=n)!==o.DEFAULT&&i!==o.STRONG&&i!==o.WEAK?o.DEFAULT:i}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r},o={DEFAULT:.5,STRONG:1,WEAK:0};i.__dashjs_factory_name="SwitchRequest";var s=a.default.getClassFactory(i);s.NO_CHANGE=-1,s.PRIORITY=o,a.default.updateClassFactory(i.__dashjs_factory_name,s),n.default=s,t.exports=n.default},{47:47}],188:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=[],t=[];return{push:function(n){n.newValue===o.default.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var i,r=n.newValue-n.oldValue,a=r<0?1:0,s=a?-r:0,l=a?0:1;e[n.oldValue].drops+=a,e[n.oldValue].dropSize+=s,e[n.oldValue].noDrops+=l,t.push({idx:n.oldValue,noDrop:l,drop:a,dropSize:s}),8<t.length&&(i=t.shift(),e[i.idx].drops-=i.drop,e[i.idx].dropSize-=i.dropSize,e[i.idx].noDrops-=i.noDrop)},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(187));r.__dashjs_factory_name="SwitchRequestHistory";var s=a.default.getClassFactory(r);n.default=s,t.exports=n.default},{187:187,47:47}],189:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e,t,n,i){var r=Math.pow(.5,n/i.fast);e.fastEstimate=(1-r)*t+r*e.fastEstimate;var a=Math.pow(.5,n/i.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function n(e,t,n){return f.get().streaming.abr.movingAverageMethod!==a.default.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?v.throughputHalfLife:v.latencyHalfLife,i=e?g[t]:m[t];if(!i||i.totalWeight<=0)return NaN;var r=i.fastEstimate/(1-Math.pow(.5,i.totalWeight/n.fast)),a=i.slowEstimate/(1-Math.pow(.5,i.totalWeight/n.slow));return e?Math.min(r,a):Math.max(r,a)}(e,t):(o=function(e,t,n){var i=void 0,r=void 0;r=e?(i=h[t],n?s:l):(i=p[t],d);if(i){if(r>=i.length)r=i.length;else if(e)for(var a=1;a<r;++a){var o=i[i.length-a]/i[i.length-a-1];if((u<=o||o<=1/c)&&(r+=1)===i.length)break}}else r=0;return r}(i=e,r=t,n),y=(i?h:p)[r],0!==o&&y&&0!==y.length?(y=y.slice(-o)).reduce((function(e,t){return e+t}))/y.length:NaN);var i,r,o,y}function i(e,t){return n(!0,e,t)}function r(e){h[e]=h[e]||[],p[e]=p[e]||[],g[e]=g[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},m[e]=m[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function o(){h={},p={},g={},m={}}var s=3,l=4,d=4,c=1.3,u=1.3,f=(e=e||{}).settings,h=void 0,p=void 0,g=void 0,m=void 0,v=void 0,y={push:function(e,n,i){if(n.trace&&n.trace.length){var o,s,l,d=n.tresponse.getTime()-n.trequest.getTime()||1,c=n._tfinish.getTime()-n.tresponse.getTime()||1,u=n.trace.reduce((function(e,t){return e+t.b[0]}),0),y=void 0,_=(y=f.get().streaming.lowLatencyEnabled?n.trace.reduce((function(e,t){return e+t.d}),0):i?c:d+c,Math.round(8*u/y));if(r(e),l=c,(s=e)===a.default.VIDEO?l<f.get().streaming.cacheLoadThresholds[a.default.VIDEO]:s===a.default.AUDIO&&l<f.get().streaming.cacheLoadThresholds[a.default.AUDIO]){if(0<h[e].length&&!h[e].hasCachedEntries)return;h[e].hasCachedEntries=!0}else h[e]&&h[e].hasCachedEntries&&(delete h[o=e],delete p[o],delete g[o],delete m[o],r(o));h[e].push(_),20<h[e].length&&h[e].shift(),p[e].push(d),20<p[e].length&&p[e].shift(),t(g[e],_,.001*c,v.throughputHalfLife),t(m[e],d,1,v.latencyHalfLife)}},getAverageThroughput:i,getSafeAverageThroughput:function(e,t){var n=i(e,t);return isNaN(n)||(n*=f.get().streaming.abr.bandwidthSafetyFactor),n},getAverageLatency:function(e){return n(!1,e)},reset:o};return v={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},o(),y}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(47));r.__dashjs_factory_name="ThroughputHistory",n.default=o.default.getClassFactory(r),t.exports=n.default},{108:108,47:47}],190:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){return e.filter((function(e){return e.quality>f.default.NO_CHANGE}))}function n(e){var t,n={},r=void 0,a=void 0,o=void 0,s=void 0;if(0!==e.length){for(n[f.default.PRIORITY.STRONG]=f.default.NO_CHANGE,n[f.default.PRIORITY.WEAK]=f.default.NO_CHANGE,n[f.default.PRIORITY.DEFAULT]=f.default.NO_CHANGE,r=0,t=e.length;r<t;r+=1)(a=e[r]).quality!==f.default.NO_CHANGE&&(n[a.priority]=n[a.priority]>f.default.NO_CHANGE?Math.min(n[a.priority],a.quality):a.quality);return n[f.default.PRIORITY.WEAK]!==f.default.NO_CHANGE&&(o=n[f.default.PRIORITY.WEAK]),n[f.default.PRIORITY.DEFAULT]!==f.default.NO_CHANGE&&(o=n[f.default.PRIORITY.DEFAULT]),n[f.default.PRIORITY.STRONG]!==f.default.NO_CHANGE&&(o=n[f.default.PRIORITY.STRONG]),o!==f.default.NO_CHANGE&&(s=o),(0,f.default)(i).create(s)}}e=e||{};var i=this.context,r=e.mediaPlayerModel,u=e.dashMetrics,g=e.settings,m=void 0,v=void 0;return{initialize:function(){m=[],v=[],g.get().streaming.abr.useDefaultABRRules&&(m.push((0,c.default)(i).create({dashMetrics:u,mediaPlayerModel:r,settings:g})),m.push((0,a.default)(i).create({dashMetrics:u})),m.push((0,o.default)(i).create({dashMetrics:u})),m.push((0,d.default)(i).create()),m.push((0,l.default)(i).create()),v.push((0,s.default)(i).create({dashMetrics:u,mediaPlayerModel:r,settings:g}))),r.getABRCustomRules().forEach((function(e){e.type===h&&m.push(e.rule(i).create()),e.type===p&&v.push(e.rule(i).create())}))},reset:function(){[m,v].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),m=[],v=[]},getMaxQuality:function(e){
return n(t(m.map((function(t){return t.getMaxIndex(e)}))))||(0,f.default)(i).create()},shouldAbandonFragment:function(e){return n(t(v.map((function(t){return t.shouldAbandon(e)}))))||(0,f.default)(i).create()}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(196)),o=i(e(194)),s=i(e(191)),l=i(e(193)),d=i(e(195)),c=i(e(192)),u=i(e(47)),f=i(e(187)),h="qualitySwitchRules",p="abandonFragmentRules";r.__dashjs_factory_name="ABRRulesCollection";var g=u.default.getClassFactory(r);g.QUALITY_SWITCH_RULES=h,g.ABANDON_FRAGMENT_RULES=p,u.default.updateSingletonFactory(r.__dashjs_factory_name,g),n.default=g,t.exports=n.default},{187:187,191:191,192:192,193:193,194:194,195:195,196:196,47:47}],191:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){u={},f={},h=[]}e=e||{};var n=this.context,i=e.mediaPlayerModel,o=e.dashMetrics,l=e.settings,d=void 0,c=void 0,u=void 0,f=void 0,h=void 0;return d={shouldAbandon:function(e){var t=(0,a.default)(n).create(a.default.NO_CHANGE,{name:r.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var s,d,p,g,m=e.getMediaInfo(),v=e.getMediaType(),y=e.getCurrentRequest();if(!isNaN(y.index)){if(p=v,g=y.index,u[p]=u[p]||{},u[p][g]=u[p][g]||{},i.getStableBufferTime()<o.getCurrentBufferLevel(v))return t;var _=u[v][y.index];if(null===_||null===y.firstByteDate||f.hasOwnProperty(_.id))return t;if(void 0===_.firstByteTime&&(h[v]=[],_.firstByteTime=y.firstByteDate.getTime(),_.segmentDuration=y.duration,_.bytesTotal=y.bytesTotal,_.id=y.index),_.bytesLoaded=y.bytesLoaded,_.elapsedTime=(new Date).getTime()-_.firstByteTime,0<_.bytesLoaded&&0<_.elapsedTime&&(s=v,d=Math.round(8*_.bytesLoaded/_.elapsedTime),h[s]=h[s]||[],h[s].push(d)),5<=h[v].length&&500<_.elapsedTime&&_.bytesLoaded<_.bytesTotal){var b,E,w,T,S,C,k=h[v].reduce((function(e,t){return e+t}),0);if(_.measuredBandwidthInKbps=Math.round(k/h[v].length),_.estimatedTimeOfDownload=+(8*_.bytesTotal/_.measuredBandwidthInKbps/1e3).toFixed(2),_.estimatedTimeOfDownload<1.8*_.segmentDuration||0===e.getRepresentationInfo().quality)return t;f.hasOwnProperty(_.id)||(b=e.getAbrController(),E=_.bytesTotal-_.bytesLoaded,w=b.getBitrateList(m),T=b.getQualityForBitrate(m,_.measuredBandwidthInKbps*l.get().streaming.abr.bandwidthSafetyFactor),C=void 0!==(S=b.getMinAllowedIndexFor(v))?Math.max(S,T):T,_.bytesTotal*w[C].bitrate/w[b.getQualityFor(v)].bitrate<E&&(t.quality=C,t.reason.throughput=_.measuredBandwidthInKbps,t.reason.fragmentID=_.id,f[_.id]=_,c.debug("["+v+"] frag id",_.id," is asking to abandon and switch to quality to ",C," measured bandwidth was",_.measuredBandwidthInKbps),delete u[v][_.id]))}else _.bytesLoaded===_.bytesTotal&&delete u[v][_.id]}return t},reset:t},c=(0,s.default)(n).getInstance().getLogger(d),t(),d}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(187)),o=i(e(47)),s=i(e(45));r.__dashjs_factory_name="AbandonRequestsRule",n.default=o.default.getClassFactory(r),t.exports=n.default},{187:187,45:45,47:47}],192:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e,t,n){var i=n.reduce((function(e,t,i){return t>n[e]?i:e}),0);if(0===i)return null;var r=Math.max(e,10+2*t.length),a=(n[i]-1)/(r/10-1);return{gp:a,Vp:10/a}}function n(e){var n={},r=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),a=(a=r.map((function(e){return Math.log(e)}))).map((function(e){return e-a[0]+1})),o=T.getStableBufferTime(),s=t(o,r,a);return s?(n.state=1,n.bitrates=r,n.utilities=a,n.stableBufferTime=o,n.Vp=s.Vp,n.gp=s.gp,n.lastQuality=0,i(n)):n.state=0,n}function i(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function r(e,n){var i,r,a,o=T.getStableBufferTime();e.stableBufferTime!==o&&((i=t(o,e.bitrates,e.utilities)).Vp===e.Vp&&i.gp===e.gp||(a=(r=w.getCurrentBufferLevel(n))+e.placeholderBuffer,a-=10,a*=i.Vp/e.Vp,a+=10,e.stableBufferTime=o,e.Vp=i.Vp,e.gp=i.gp,e.placeholderBuffer=Math.max(0,a-r)))}function s(e,t){return e.Vp*(e.utilities[t]+e.gp)}function f(e,t){for(var n,i,r,a=e.bitrates[t],o=e.utilities[t],s=0,l=t-1;0<=l;--l)e.utilities[l]<e.utilities[t]&&(n=e.bitrates[l],i=e.utilities[l],r=e.Vp*(e.gp+(a*i-n*o)/(a-n)),s=Math.max(s,r));return s}function h(){for(var e in I)I.hasOwnProperty(e)&&2===I[e].state&&(I[e].placeholderBuffer=0)}function p(){for(var e in I){var t;!I.hasOwnProperty(e)||0!==(t=I[e]).state&&(t.state=1,i(t))}}function g(e){var t,n;e&&e.chunk&&e.chunk.mediaInfo&&(t=I[e.chunk.mediaInfo.type])&&0!==t.state&&(n=e.chunk.start,isNaN(t.mostAdvancedSegmentStart)||n>t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,v(t,e.chunk.mediaInfo.type))}function m(e){var t;e&&e.metric===a.default.HTTP_REQUEST&&e.value&&e.value.type===l.HTTPRequest.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length&&(t=I[e.mediaType])&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),v(t,e.mediaType))}function v(e,t){var n,i,r;isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||isNaN(e.placeholderBuffer)||(e.placeholderBuffer*=.99,isNaN(e.lastSegmentFinishTimeMs)||(n=w.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),i=s(e,e.lastQuality),r=Math.max(0,i-n),e.placeholderBuffer=Math.min(r,e.placeholderBuffer)),e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function y(e){var t;!e||(t=I[e.mediaType])&&0!==t.state&&(t.abrQuality=e.newQuality)}function _(e){var t,n,i,r;!e||(t=I[e.mediaType])&&0!==t.state&&(n=w.getCurrentBufferLevel(e.mediaType),i=void 0,i=0<t.abrQuality?f(t,t.abrQuality):10,r=Math.max(0,i-n),t.placeholderBuffer=Math.min(t.placeholderBuffer,r))}function b(){I={}}e=e||{};var E=this.context,w=e.dashMetrics,T=e.mediaPlayerModel,S=(0,d.default)(E).getInstance(),C=void 0,k=void 0,I=void 0;return C={getMaxIndex:function(e){var t=(0,o.default)(E).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var a=e.getMediaInfo(),l=e.getMediaType(),d=e.getScheduleController(),c=e.getStreamInfo(),u=e.getAbrController(),h=u.getThroughputHistory(),p=c?c.id:null,g=c&&c.manifestInfo&&c.manifestInfo.isDynamic,m=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!m)return t;d.setTimeToLoadDelay(0);var v,y,_,b=(y=(v=e).getMediaType(),(_=I[y])?0!==_.state&&r(_,y):(_=n(v),I[y]=_),_);if(0===b.state)return t;var T,S,C,A,x=w.getCurrentBufferLevel(l),D=h.getAverageThroughput(l,g),R=h.getSafeAverageThroughput(l,g),M=h.getAverageLatency(l),N=void 0;if(t.reason.state=b.state,t.reason.throughput=D,t.reason.latency=M,isNaN(D))return t;switch(b.state){case 1:N=u.getQualityForBitrate(a,R,M),t.quality=N,t.reason.throughput=R,b.placeholderBuffer=Math.max(0,f(b,N)-x),b.lastQuality=N,!isNaN(b.lastSegmentDurationS)&&x>=b.lastSegmentDurationS&&(b.state=2);break;case 2:T=b,S=l,A=Date.now(),isNaN(T.lastSegmentFinishTimeMs)?isNaN(T.lastCallTimeMs)||(C=.001*(A-T.lastCallTimeMs),T.placeholderBuffer+=Math.max(0,C)):(C=.001*(A-T.lastSegmentFinishTimeMs),T.placeholderBuffer+=Math.max(0,C)),T.lastCallTimeMs=A,T.lastSegmentStart=NaN,T.lastSegmentRequestTimeMs=NaN,T.lastSegmentFinishTimeMs=NaN,r(T,S),N=function(e,t){for(var n=e.bitrates.length,i=NaN,r=NaN,a=0;a<n;++a){var o=(e.Vp*(e.utilities[a]+e.gp)-t)/e.bitrates[a];(isNaN(r)||r<=o)&&(r=o,i=a)}return i}(b,x+b.placeholderBuffer);var O=u.getQualityForBitrate(a,R,M);N>b.lastQuality&&O<N&&(N=Math.max(O,b.lastQuality));var P=Math.max(0,x+b.placeholderBuffer-s(b,N));P<=b.placeholderBuffer?(b.placeholderBuffer-=P,P=0):(P-=b.placeholderBuffer,b.placeholderBuffer=0,N<u.getTopQualityIndexFor(l,p)?d.setTimeToLoadDelay(1e3*P):P=0),t.quality=N,t.reason.throughput=D,t.reason.latency=M,t.reason.bufferLevel=x,t.reason.placeholderBuffer=b.placeholderBuffer,t.reason.delay=P,b.lastQuality=N;break;default:k.debug("BOLA ABR rule invoked in bad state."),t.quality=u.getQualityForBitrate(a,R,M),t.reason.state=b.state,t.reason.throughput=R,t.reason.latency=M,b.state=1,i(b)}return t},reset:function(){b(),S.off(c.default.BUFFER_EMPTY,h,C),S.off(c.default.PLAYBACK_SEEKING,p,C),S.off(c.default.MEDIA_FRAGMENT_LOADED,g,C),S.off(c.default.METRIC_ADDED,m,C),S.off(c.default.QUALITY_CHANGE_REQUESTED,y,C),S.off(c.default.FRAGMENT_LOADING_ABANDONED,_,C)}},k=(0,u.default)(E).getInstance().getLogger(C),b(),S.on(c.default.BUFFER_EMPTY,h,C),S.on(c.default.PLAYBACK_SEEKING,p,C),S.on(c.default.MEDIA_FRAGMENT_LOADED,g,C),S.on(c.default.METRIC_ADDED,m,C),S.on(c.default.QUALITY_CHANGE_REQUESTED,y,C),S.on(c.default.FRAGMENT_LOADING_ABANDONED,_,C),C}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(109)),o=i(e(187)),s=i(e(47)),l=e(242),d=i(e(46)),c=i(e(54)),u=i(e(45));r.__dashjs_factory_name="BolaRule",n.default=s.default.getClassFactory(r),t.exports=n.default},{109:109,187:187,242:242,45:45,46:46,47:47,54:54}],193:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){var i=(0,o.default)(e).create();if(!t||!t.hasOwnProperty("getDroppedFramesHistory"))return i;var r=t.getDroppedFramesHistory();if(r){for(var a=r.getFrameHistory(),s=0,l=0,d=o.default.NO_CHANGE,c=1;c<a.length;c++)if(a[c]&&(s=a[c].droppedVideoFrames,375<(l=a[c].totalVideoFrames)&&.15<s/l)){d=c-1,n.debug("index: "+d+" Dropped Frames: "+s+" Total Frames: "+l);break}return(0,o.default)(e).create(d,{droppedFrames:s})}return i}},n=(0,s.default)(e).getInstance().getLogger(t),t}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(187)),s=i(e(45));r.__dashjs_factory_name="DroppedFramesRule",n.default=a.default.getClassFactory(r),t.exports=n.default},{187:187,45:45,47:47}],194:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){(v={})[c.default.VIDEO]={ignoreCount:s},v[c.default.AUDIO]={ignoreCount:s}}function n(){t()}function i(e){isNaN(e.startTime)||e.mediaType!==c.default.AUDIO&&e.mediaType!==c.default.VIDEO||0<v[e.mediaType].ignoreCount&&v[e.mediaType].ignoreCount--}e=e||{};var r=.5,s=2,f=this.context,h=(0,a.default)(f).getInstance(),p=e.dashMetrics,g=void 0,m=void 0,v=void 0;return g={getMaxIndex:function(e){var t=(0,d.default)(f).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!p||!p.hasOwnProperty("getCurrentBufferLevel")||!p.hasOwnProperty("getCurrentBufferState"))throw new Error(c.default.MISSING_CONFIG_ERROR)}();var n,i,a,o,s,l,h,g=e.getMediaType(),y=p.getCurrentBufferState(g),_=e.getRepresentationInfo().fragmentDuration;return 0<v[g].ignoreCount||!_||(y&&y.state===u.default.BUFFER_EMPTY?(m.debug("["+g+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty"):(n=e.getMediaInfo(),a=(i=e.getAbrController()).getThroughputHistory(),o=p.getCurrentBufferLevel(g),s=a.getAverageThroughput(g),l=a.getAverageLatency(g),h=s*(o/_)*r,t.quality=i.getQualityForBitrate(n,h,l),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering")),t},reset:function(){t(),h.off(o.default.PLAYBACK_SEEKING,n,g),h.off(o.default.BYTES_APPENDED_END_FRAGMENT,i,g)}},m=(0,l.default)(f).getInstance().getLogger(g),t(),h.on(o.default.PLAYBACK_SEEKING,n,g),h.on(o.default.BYTES_APPENDED_END_FRAGMENT,i,g),g}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(46)),o=i(e(54)),s=i(e(47)),l=i(e(45)),d=i(e(187)),c=i(e(108)),u=i(e(109));r.__dashjs_factory_name="InsufficientBufferRule",n.default=s.default.getClassFactory(r),t.exports=n.default},{108:108,109:109,187:187,45:45,46:46,47:47,54:54}],195:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=this.context,t=void 0,n=void 0;return t={getMaxIndex:function(t){for(var i=t?t.getSwitchHistory():null,r=i?i.getSwitchRequests():[],a=0,o=0,l=0,d=(0,s.default)(e).create(),c=0;c<r.length;c++)if(void 0!==r[c]&&(a+=r[c].drops,o+=r[c].noDrops,l+=r[c].dropSize,6<=a+o&&.075<a/o)){d.quality=0<c&&0<r[c].drops?c-1:c,d.reason={index:d.quality,drops:a,noDrops:o,dropSize:l},n.debug("Switch history rule index: "+d.quality+" samples: "+(a+o)+" drops: "+a);break}return d}},n=(0,o.default)(e).getInstance().getLogger(t),t}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(45)),s=i(e(187));r.__dashjs_factory_name="SwitchHistoryRule",n.default=a.default.getClassFactory(r),t.exports=n.default},{187:187,45:45,47:47}],196:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){e=e||{};var t=this.context,n=e.dashMetrics,i=void 0,r=void 0;return i={getMaxIndex:function(e){var i=(0,s.default)(t).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("useBufferOccupancyABR")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("getScheduleController")))return i;!function(){if(!n||!n.hasOwnProperty("getCurrentBufferState"))throw new Error(l.default.MISSING_CONFIG_ERROR)}();var a=e.getMediaInfo(),o=e.getMediaType(),c=n.getCurrentBufferState(o),u=e.getScheduleController(),f=e.getAbrController(),h=e.getStreamInfo(),p=h&&h.manifestInfo?h.manifestInfo.isDynamic:null,g=f.getThroughputHistory(),m=g.getSafeAverageThroughput(o,p),v=g.getAverageLatency(o),y=e.useBufferOccupancyABR();return isNaN(m)||!c||y||f.getAbandonmentStateFor(o)!==d.default.ABANDON_LOAD&&(c.state!==d.default.BUFFER_LOADED&&!p||(i.quality=f.getQualityForBitrate(a,m,v),u.setTimeToLoadDelay(0),r.debug("["+o+"] requesting switch to index: ",i.quality,"Average throughput",Math.round(m),"kbps"),i.reason={throughput:m,latency:v})),i},reset:function(){}},r=(0,o.default)(t).getInstance().getLogger(i),i}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(45)),s=i(e(187)),l=i(e(108)),d=i(e(109));r.__dashjs_factory_name="ThroughputRule",n.default=a.default.getClassFactory(r),t.exports=n.default},{108:108,109:109,187:187,45:45,47:47}],197:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e,t){var d,c,u=NaN;return e&&t?u=e===a.default.FRAGMENTED_TEXT?r.isTextEnabled()?isNaN(t.fragmentDuration)?(d=n.getCurrentSchedulingInfo(s.default.SCHEDULING_INFO))?d.duration:0:t.fragmentDuration:0:(c=t.mediaInfo.streamInfo,o.isPlayingAtTopQuality(c)?c.manifestInfo.duration>=l.get().streaming.longFormContentDurationThreshold?l.get().streaming.bufferTimeAtTopQualityLongForm:l.get().streaming.bufferTimeAtTopQuality:i.getStableBufferTime()):u}var n=(e=e||{}).dashMetrics,i=e.mediaPlayerModel,r=e.textController,o=e.abrController,l=e.settings;return{execute:function(e,i){return!e||!i||n.getCurrentBufferLevel(e)<t(e,i)},getBufferTarget:t}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(47)),s=i(e(109));r.__dashjs_factory_name="BufferLevelRule",n.default=o.default.getClassFactory(r),t.exports=n.default},{108:108,109:109,47:47}],198:[function(e,t,n){"use strict";function i(){function e(e){return"red"===e?"rgb(255, 0, 0)":"green"===e?"rgb(0, 255, 0)":"blue"===e?"rgb(0, 0, 255)":"cyan"===e?"rgb(0, 255, 255)":"magenta"===e?"rgb(255, 0, 255)":"yellow"===e?"rgb(255, 255, 0)":"white"===e?"rgb(255, 255, 255)":"black"===e?"rgb(0, 0, 0)":e}function t(t,n){var i=t.videoHeight/15;return n?"font-size: "+i+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; color: "+(n.foreground?e(n.foreground):"rgb(255, 255, 255)")+"; font-style: "+(n.italics?"italic":"normal")+"; text-decoration: "+(n.underline?"underline":"none")+"; white-space: pre; background-color: "+(n.background?e(n.background):"transparent")+";":"font-size: "+i+"px; font-family: Menlo, Consolas, 'Cutive Mono', monospace; justify-content: flex-start; text-align: left; color: rgb(255, 255, 255); font-style: normal; white-space: pre; line-height: normal; font-weight: normal; text-decoration: none; width: 100%; display: flex;"}var n=0;return{createHTMLCaptionsFromScreen:function(e,i,r,a){var o=null,s=!1,l=-1,d={start:i,end:r,spans:[]},c="style_cea608_white_black",u={},f={},h=[],p=void 0,g=void 0;for(p=0;p<15;++p){var m=a.rows[p],v="",y=null;if(!1===m.isEmpty()){var _=function(e){for(var t="",n=0;n<e.length;++n)t+=e[n].uchar;return t.length-t.replace(/^\s+/,"").length}(m.chars);null===o&&(o={x:_,y1:p,y2:p+1,p:[]}),_!==l&&s&&(o.p.push(d),d={start:i,end:r,spans:[]},o.y2=p,o.name="region_"+o.x+"_"+o.y1+"_"+o.y2,!1===u.hasOwnProperty(o.name)?(h.push(o),u[o.name]=o):u[o.name].p.contat(o.p),o={x:_,y1:p,y2:p+1,p:[]});for(var b=0;b<m.chars.length;++b){var E,w=m.chars[b],T=w.penState;null!==y&&T.equals(y)||(0<v.trim().length&&(d.spans.push({name:c,line:v,row:p}),v=""),E="style_cea608_"+T.foreground+"_"+T.background,T.underline&&(E+="_underline"),T.italics&&(E+="_italics"),f.hasOwnProperty(E)||(f[E]=JSON.parse(JSON.stringify(T))),y=T,c=E),v+=w.uchar}0<v.trim().length&&d.spans.push({name:c,line:v,row:p}),s=!0,l=_}else s=!1,l=-1,o&&(o.p.push(d),d={start:i,end:r,spans:[]},o.y2=p,o.name="region_"+o.x+"_"+o.y1+"_"+o.y2,!1===u.hasOwnProperty(o.name)?(h.push(o),u[o.name]=o):u[o.name].p.contat(o.p),o=null)}o&&(o.p.push(d),o.y2=p+1,o.name="region_"+o.x+"_"+o.y1+"_"+o.y2,!1===u.hasOwnProperty(o.name)?(h.push(o),u[o.name]=o):u[o.name].p.contat(o.p),o=null);var S,C=[];for(p=0;p<h.length;++p){var k=h[p],I="sub_cea608_"+n++,A=document.createElement("div");A.id=I;var x="left: "+3.125*(S=k).x+"%; top: "+6.66*S.y1+"%; width: "+(100-3.125*S.x)+"%; height: "+6.66*Math.max(S.y2-1-S.y1,1)+"%; align-items: flex-start; overflow: visible; -webkit-writing-mode: horizontal-tb;";A.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+x;var D=document.createElement("div");D.className="paragraph bodyStyle",D.style.cssText=t(e);var R=document.createElement("div");R.className="cueUniWrapper",R.style.cssText="unicode-bidi: normal; direction: ltr;";for(var M=0;M<k.p.length;++M){var N=k.p[M],O=0;for(g=0;g<N.spans.length;++g){var P,L,F,j,B=N.spans[g];0<B.line.length&&(0!==g&&O!=B.row&&((P=document.createElement("br")).className="lineBreak",R.appendChild(P)),L=!1,O===B.row&&(L=!0),O=B.row,F=f[B.name],(j=document.createElement("span")).className="spanPadding "+B.name+" customSpanColor",j.style.cssText=t(e,F),0!==g&&L?g===N.spans.length-1?j.textContent=B.line.replace(/\s+$/g,""):j.textContent=B.line:1<N.spans.length&&g<N.spans.length-1&&B.row===N.spans[g+1].row?j.textContent=B.line.replace(/^\s+/g,""):j.textContent=B.line.trim(),R.appendChild(j))}}D.appendChild(R),A.appendChild(D);var U={bodyStyle:["%",90]};for(var H in f)f.hasOwnProperty(H)&&(U[H]=["%",90]);C.push({type:"html",start:i,end:r,cueHTMLElement:A,cueID:I,cellResolution:[32,15],isFromCEA608:!0,fontSize:U,lineHeight:{},linePadding:{}})}return C}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="EmbeddedTextHtmlRender",n.default=a.default.getSingletonFactory(i),t.exports=n.default},{47:47}],199:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){S=e}function n(e){e.sender.getStreamId()!==v.id||e.sender.getType()!==y||e.error||null===k.extract(v.id,e.currentRepresentation.id)&&(w=!1,l.trigger(s.default.INIT_FRAGMENT_NEEDED,{sender:E,streamId:v.id,mediaType:y,representationId:e.currentRepresentation.id}))}function i(e){e.chunk.streamId===v.id&&e.chunk.mediaInfo.type===y&&e.chunk.bytes&&(k.save(e.chunk),C.append(e.chunk),w=!0,l.trigger(s.default.STREAM_COMPLETED,{request:e.request}))}e=e||{};var r=this.context,l=(0,o.default)(r).getInstance(),g=(0,u.default)(r).getInstance(),m=e.errHandler,v=e.streamInfo,y=e.type,_=e.mimeType,b=e.fragmentModel,E=void 0,w=void 0,T=void 0,S=void 0,C=void 0,k=void 0;return E={getBufferControllerType:function(){return p},initialize:function(e){t(e),k=(0,d.default)(r).getInstance()},createBuffer:function(e){var t,n=e[0];try{return C=(0,c.default)(r).create(S,n),T||((t=C.getBuffer()).hasOwnProperty(a.default.INITIALIZE)&&t.initialize(_,v,e,b),T=!0),C}catch(e){if(n&&(n.isText||-1!==n.codec.indexOf('codecs="stpp')||-1!==n.codec.indexOf('codecs="wvtt')))try{C=g.getTextSourceBuffer()}catch(e){m.error(new f.default(h.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,h.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+y+" : "+e.message))}else m.error(new f.default(h.default.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,h.default.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+y))}},getType:function(){return y},getBuffer:function(){return C},getBufferLevel:function(){return 0},setMediaSource:t,getMediaSource:function(){return S},getIsBufferingCompleted:function(){return w},getIsPruningInProgress:function(){return!1},dischargePreBuffer:function(){},appendInitSegment:function(e){return null!==k.extract(v.id,e)},getRangeAt:function(){return null},reset:function(e){l.off(s.default.DATA_UPDATE_COMPLETED,n,E),l.off(s.default.INIT_FRAGMENT_LOADED,i,E),!e&&C&&(C.abort(),C.reset(),C=null)},updateTimestampOffset:function(e){C.timestampOffset===e||isNaN(e)||(C.timestampOffset=e)}},S=null,w=T=!1,l.on(s.default.DATA_UPDATE_COMPLETED,n,E),l.on(s.default.INIT_FRAGMENT_LOADED,i,E),E}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(46)),s=i(e(54)),l=i(e(47)),d=i(e(214)),c=i(e(104)),u=i(e(201)),f=i(e(226)),h=i(e(51)),p="NotFragmentedTextBufferController";r.__dashjs_factory_name=p,n.default=l.default.getClassFactory(r),t.exports=n.default},{104:104,108:108,201:201,214:214,226:226,46:46,47:47,51:51,54:54}],200:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){return r.getBuffer()}e=e||{};var n,i=this.context,r=void 0;return n={getBufferControllerType:function(){return r.getBufferControllerType()},initialize:function(e,t){return r.initialize(e,t)},createBuffer:function(e,t){return r.createBuffer(e,t)},getType:function(){return r.getType()},getBuffer:t,setBuffer:function(e){r.setBuffer(e)},getBufferLevel:function(){return r.getBufferLevel()},setMediaSource:function(e){r.setMediaSource(e)},getMediaSource:function(){return r.getMediaSource()},getIsBufferingCompleted:function(){return r.getIsBufferingCompleted()},getIsPruningInProgress:function(){return r.getIsPruningInProgress()},dischargePreBuffer:function(){return r.dischargePreBuffer()},appendInitSegment:function(e){r.appendInitSegment(e)},getRangeAt:function(e){return r.getRangeAt(e)},reset:function(e){r.reset(e)},updateTimestampOffset:function(e){var n=t();n.timestampOffset===e||isNaN(e)||(n.timestampOffset=e)},updateAppendWindow:function(){r.updateAppendWindow()}},r=e.type===a.default.FRAGMENTED_TEXT?(0,s.default)(i).create({streamInfo:e.streamInfo,type:e.type,mediaPlayerModel:e.mediaPlayerModel,manifestModel:e.manifestModel,fragmentModel:e.fragmentModel,errHandler:e.errHandler,mediaController:e.mediaController,representationController:e.representationController,adapter:e.adapter,textController:e.textController,abrController:e.abrController,playbackController:e.playbackController,settings:e.settings}):(0,l.default)(i).create({streamInfo:e.streamInfo,type:e.type,mimeType:e.mimeType,fragmentModel:e.fragmentModel,errHandler:e.errHandler}),n}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(47)),s=i(e(114)),l=i(e(199));r.__dashjs_factory_name="TextBufferController",n.default=o.default.getClassFactory(r),t.exports=n.default},{108:108,114:114,199:199,47:47}],201:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){void 0===L&&null!==e.fromStreamInfo&&(L=this.getCurrentTrackIdx())}function t(){void 0===L&&(L=this.getCurrentTrackIdx())}function n(){void 0!==L&&(this.setTextTrack(L),L=void 0)}function i(e){var t=this,n=e.tracks,i=e.index;A&&n.some((function(e,n){if(E.matchSettings(A,e))return t.setTextTrack(n),i=n,!0})),(!1===R||void 0===R&&!A||P)&&this.setTextTrack(-1),D=i,I.trigger(f.default.TEXT_TRACKS_ADDED,{enabled:o(),index:i,tracks:n}),O=!0}function r(e){var t;x||!e||!e.newMediaInfo||(t=e.newMediaInfo).type===a.default.FRAGMENTED_TEXT&&(A={lang:t.lang,role:t.roles[0],accessibility:t.accessibility[0]})}function o(){return!(M&&!N)}function p(){P=O=!(M=!0)}var g=this.context,m=void 0,v=void 0,y=void 0,_=void 0,b=void 0,E=void 0,w=void 0,T=void 0,S=void 0,C=void 0,k=void 0,I=void 0,A=void 0,x=void 0,D=void 0,R=void 0,M=void 0,N=void 0,O=void 0,P=void 0,L=void 0;return m={setConfig:function(e){e&&(e.errHandler&&(y=e.errHandler),e.adapter&&(_=e.adapter),e.manifestModel&&(b=e.manifestModel),e.mediaController&&(E=e.mediaController),e.videoModel&&(w=e.videoModel),e.streamController&&(T=e.streamController),e.textTracks&&(S=e.textTracks),e.vttParser&&(C=e.vttParser),e.ttmlParser&&(k=e.ttmlParser),v.setConfig({errHandler:y,adapter:_,manifestModel:b,mediaController:E,videoModel:w,streamController:T,textTracks:S,vttParser:C,ttmlParser:k}))},getTextSourceBuffer:function(){return v},getAllTracksAreDisabled:function(){return M},addEmbeddedTrack:function(e){v.addEmbeddedTrack(e)},getTextDefaultLanguage:function(){return A&&A.lang||""},setTextDefaultLanguage:function(e){(0,h.checkParameterType)(e,"string"),(A=A||{}).lang=e,x=!0},setTextDefaultEnabled:function(e){(0,h.checkParameterType)(e,"boolean"),(R=e)?M=!1:this.setTextTrack(-1)},getTextDefaultEnabled:function(){return void 0!==R&&R},setInitialSettings:function(e){A=e,x=!0},enableText:function(e){(0,h.checkParameterType)(e,"boolean"),!R&&e&&(R=!0),o()!==e&&(e&&this.setTextTrack(D),e||(D=this.getCurrentTrackIdx(),O?this.setTextTrack(-1):P=!0))},isTextEnabled:o,setTextTrack:function(e){var t=v.getConfig(),n=t.fragmentModel,i=t.fragmentedTracks,r=t.videoModel,o=void 0,s=void 0;M=-1===e;var l=S.getCurrentTrackIdx();if(l!==e){M&&E&&E.saveTextSettingsDisabled(),S.setModeForTrackIdx(l,a.default.TEXT_HIDDEN),S.setCurrentTrackIdx(e),S.setModeForTrackIdx(e,a.default.TEXT_SHOWING);var d=S.getCurrentTrackInfo();if(d&&d.isFragmented&&!d.isEmbedded)for(var c=0;c<i.length;c++){var u=i[c];if(d.lang===u.lang&&d.index===u.index&&(u.id?d.id===u.id:d.id===u.index))if(u!==E.getCurrentTrackFor(a.default.FRAGMENTED_TEXT,T.getActiveStreamInfo()))n.abortRequests(),n.removeExecutedRequestsBeforeTime(),v.remove(),S.deleteCuesFromTrackIdx(l),E.setTrack(u),v.setCurrentFragmentedTrackIdx(c);else if(-1===l){for(var f=T.getActiveStreamProcessors(),h=0;h<f.length;h++)if(f[h].getType()===a.default.FRAGMENTED_TEXT){s=f[h];break}s.setBufferingTime(r.getTime()),s.getScheduleController().start()}}else if(d&&!d.isFragmented){for(f=T.getActiveStreamProcessors(),c=0;c<f.length;c++)if(f[c].getType()===a.default.TEXT){o=(s=f[c]).getMediaInfoArr();break}if(s&&o)for(c=0;c<o.length;c++)if(o[c].index===d.index&&o[c].lang===d.lang){s.selectMediaInfo(o[c]);break}}}},getCurrentTrackIdx:function(){return S.getCurrentTrackIdx()},enableForcedTextStreaming:function(e){(0,h.checkParameterType)(e,"boolean"),N=e},reset:function(){p(),v.resetEmbedded(),v.reset()}},A=null,S=(P=x=O=N=!(D=-1),l.default)(g).getInstance(),C=(0,d.default)(g).getInstance(),k=(0,c.default)(g).getInstance(),v=(0,s.default)(g).getInstance(),I=(0,u.default)(g).getInstance(),S.initialize(),I.on(f.default.TEXT_TRACKS_QUEUE_INITIALIZED,i,m),I.on(f.default.CURRENT_TRACK_CHANGED,r,m),I.on(f.default.PERIOD_SWITCH_STARTED,e,m),I.on(f.default.STREAM_COMPLETED,t,m),I.on(f.default.PERIOD_SWITCH_COMPLETED,n,m),p(),m}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(47)),s=i(e(202)),l=i(e(203)),d=i(e(222)),c=i(e(220)),u=i(e(46)),f=i(e(54)),h=e(219);r.__dashjs_factory_name="TextController",n.default=o.default.getSingletonFactory(r),t.exports=n.default},{108:108,202:202,203:203,219:219,220:220,222:222,46:46,47:47,54:54}],202:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){U=NaN,z=j=null,B=!(H=[])}function t(){e(),L=[],N=null}function n(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&b(t.bytes,t)}function i(){G=[],(F=(0,f.default)(T).getInstance()).setConfig({videoModel:$}),F.initialize(),A=(0,l.default)(T).getInstance(),K=[],C=!(Y=V=null),X=(W=0,h.default)(T).getInstance();var e=q.getActiveStreamProcessors();for(var t in e)if("video"===e[t].getType()){Q=e[t].getRepresentationInfo().MSETimeOffset;break}S.on(v.default.VIDEO_CHUNK_RECEIVED,n,this),S.on(v.default.BUFFER_CLEARED,w,this)}function r(e){V=e}function c(e,t){var n,i,r=new s.default,o={subtitle:"subtitles",caption:"captions"};r.captionData=e,r.lang=t.lang,r.labels=t.labels,r.id=t.id?t.id:t.index,r.index=t.index,r.isTTML=(n=!1,t.codec&&0<=t.codec.search(a.default.STPP)&&(n=!0),t.mimeType&&0<=t.mimeType.search(a.default.TTML)&&(n=!0),n),r.defaultTrack=function(e){var t=!1;return 1<G.length&&e.isEmbedded?t=e.id&&e.id===a.default.CC1:1===G.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===G.length&&(t=e.index===L[0].index),t}(t),r.isFragmented=!D.getIsTextTrack(t.mimeType),r.isEmbedded=!!t.isEmbedded,r.kind=i=(i=0<t.roles.length?o[t.roles[0]]:o.caption)===o.caption||i===o.subtitle?i:o.caption,r.roles=t.roles,r.accessibility=t.accessibility;var l=(L?L.length:0)+G.length;F.addTextTrack(r,l)}function b(e,t){var n=void 0,i=void 0,r=void 0,s=void 0,l=void 0,d=void 0,u=void 0,f=t.mediaInfo,h=f.type,m=f.mimeType,v=f.codec||m;if(v){if(h===a.default.FRAGMENTED_TEXT)if(B||"InitializationSegment"!==t.segmentType){if(!B)return;if(i=(d=A.getSamplesInfo(e)).sampleList,null===z&&0<i.length&&(z=i[0].cts-t.start*U),0<=v.search(a.default.STPP))for(N=null!==N?N:E(v),r=0;r<i.length;r++){var b=(O=i[r]).cts,w=b-z;this.buffered.add(w/U,(w+O.duration)/U);var T=new DataView(e,O.offset,O.subSizes[0]),S=(u=p.default.Utils.dataViewToString(T,a.default.UTF8),[]),C=O.offset+O.subSizes[0];for(s=1;s<O.subSizes.length;s++){var k=new Uint8Array(e,C,O.subSizes[s]),D=String.fromCharCode.apply(null,k);S.push(D),C+=O.subSizes[s]}try{var M=R.getValue().ttmlTimeIsRelative?b/U:0;n=N.parse(u,M,b/U,(b+O.duration)/U,S);F.addCaptions(V,z/U,n)}catch(e){j.removeExecutedRequestsBeforeTime(),this.remove(),I.error("TTML parser error: "+e.message)}}else{var O,P=[];for(r=0;r<i.length;r++){(O=i[r]).cts-=z,this.buffered.add(O.cts/U,(O.cts+O.duration)/U);var L=e.slice(O.offset,O.offset+O.size),H=p.default.parseBuffer(L);for(s=0;s<H.boxes.length;s++){var q=H.boxes[s];if(I.debug("VTT box1: "+q.type),"vtte"!==q.type&&"vttc"===q.type)for(I.debug("VTT vttc boxes.length = "+q.boxes.length),l=0;l<q.boxes.length;l++){var J,Z,ee,te=q.boxes[l];I.debug("VTT box2: "+te.type),"payl"===te.type&&(J=te.cue_text,I.debug("VTT cue_text = "+J),Z=O.cts/U,ee=(O.cts+O.duration)/U,P.push({start:Z,end:ee,data:J,styles:{}}),I.debug("VTT "+Z+"-"+ee+" : "+J))}}}0<P.length&&F.addCaptions(V,0,P)}}else B=!0,U=A.getMediaTimescaleFromMoov(e);else if(h===a.default.TEXT){T=new DataView(e,0,e.byteLength),u=p.default.Utils.dataViewToString(T,a.default.UTF8);try{n=E(v).parse(u,0),F.addCaptions(F.getCurrentTrackIdx(),0,n)}catch(e){x.error(new y.default(_.default.TIMED_TEXT_ERROR_ID_PARSE_CODE,_.default.TIMED_TEXT_ERROR_MESSAGE_PARSE+e.message,u))}}else if(h===a.default.VIDEO)if(t.segmentType===o.HTTPRequest.INIT_SEGMENT_TYPE){if(0===W)for(W=A.getMediaTimescaleFromMoov(e),r=0;r<G.length;r++)c(null,G[r])}else{if(0===W)return void I.warn("CEA-608: No timescale for embeddedTextTrack yet");var ne=(d=A.getSamplesInfo(e)).lastSequenceNumber;if(!K[0]&&!K[1]){var ie=void 0,re=void 0;for(r=0;r<G.length;r++){if(G[r].id===a.default.CC1?re=F.getTrackIdxForId(a.default.CC1):G[r].id===a.default.CC3&&(re=F.getTrackIdxForId(a.default.CC3)),-1===re)return void I.warn("CEA-608: data before track is ready.");ie=function(e){return function(t,n,i){var r=null;(r=$.getTTMLRenderingDiv()?X.createHTMLCaptionsFromScreen($.getElement(),t,n,i):[{start:t,end:n,data:i.getDisplayText(),styles:{}}])&&F.addCaptions(e,0,r)}}(re),K[r]=new g.default.Cea608Parser(r+1,{newCue:ie},null)}}if(W){if(null!==Y&&ne!==Y+d.numSequences)for(r=0;r<K.length;r++)K[r]&&K[r].reset();for(var ae=function(e,t){if(0===t.length)return null;for(var n={splits:[],fields:[[],[]]
},i=new DataView(e),r=0;r<t.length;r++)for(var a=t[r],o=g.default.findCea608Nalus(i,a.offset,a.size),s=null,l=0,d=0;d<o.length;d++)for(var c=g.default.extractCea608DataFromRange(i,o[d]),u=0;u<2;u++)0<c[u].length&&(a.cts!==s?l=0:l+=1,n.fields[u].push([a.cts+Q*W,c[u],l]),s=a.cts);return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,d.sampleList),oe=0;oe<K.length;oe++){var se=ae.fields[oe],le=K[oe];if(le)for(r=0;r<se.length;r++)le.addData(se[r][0]/W,se[r][1])}Y=ne}}}else I.error("No text type defined")}function E(e){var t=void 0;return 0<=e.search(a.default.VTT)?t=O:(0<=e.search(a.default.TTML)||0<=e.search(a.default.STPP))&&(t=P),t}function w(e){G.forEach((function(t){var n=F.getTrackIdxForId(t.id);0<=n&&F.deleteCuesFromTrackIdx(n,e.from,e.to)}))}var T=this.context,S=(0,m.default)(T).getInstance(),C=!1,k=void 0,I=void 0,A=void 0,x=void 0,D=void 0,R=void 0,M=void 0,N=void 0,O=void 0,P=void 0,L=void 0,F=void 0,j=void 0,B=void 0,U=void 0,H=void 0,$=void 0,q=void 0,z=void 0,V=void 0,G=void 0,W=void 0,Y=void 0,K=void 0,X=void 0,Q=void 0;return k={initialize:function(e,t,n,o){C||i(),F.setConfig({videoModel:$}),F.initialize(),A=A||(0,l.default)(T).getInstance(),function(e,t,n,i){var o=!D.getIsTextTrack(e);if(L=L.concat(n),o){j=i,k.buffered=(0,d.default)(T).create(),H=M.getTracksFor(a.default.FRAGMENTED_TEXT,t);for(var s=M.getCurrentTrackFor(a.default.FRAGMENTED_TEXT,t),l=0;l<H.length;l++)if(H[l]===s){r(l);break}}for(l=0;l<L.length;l++)c(null,L[l])}(e,t,n,o)},append:b,abort:function(){F.deleteAllTextTracks(),e(),A=null,L=[]},addEmbeddedTrack:function(e){if(C||i(),e)if(e.id===a.default.CC1||e.id===a.default.CC3){for(var t=0;t<G.length;t++)if(G[t].id===e.id)return;G.push(e)}else I.warn("Embedded track "+e.id+" not supported!")},resetEmbedded:function(){S.off(v.default.VIDEO_CHUNK_RECEIVED,n,this),S.off(v.default.BUFFER_CLEARED,w,this),F&&F.deleteAllTextTracks(),C=!1,G=[],K=[null,null],Y=null},setConfig:function(e){e&&(e.errHandler&&(x=e.errHandler),e.adapter&&(D=e.adapter),e.manifestModel&&(R=e.manifestModel),e.mediaController&&(M=e.mediaController),e.videoModel&&($=e.videoModel),e.streamController&&(q=e.streamController),e.textTracks&&(F=e.textTracks),e.vttParser&&(O=e.vttParser),e.ttmlParser&&(P=e.ttmlParser))},getConfig:function(){return{fragmentModel:j,fragmentedTracks:H,videoModel:$}},setCurrentFragmentedTrackIdx:r,remove:function(e,t){void 0===e&&e===t&&(e=this.buffered.start(0),t=this.buffered.end(this.buffered.length-1)),this.buffered.remove(e,t)},reset:function(){t(),F=$=q=null}},I=(0,u.default)(T).getInstance().getLogger(k),t(),k}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=e(242),s=i(e(234)),l=i(e(207)),d=i(e(209)),c=i(e(47)),u=i(e(45)),f=i(e(203)),h=i(e(198)),p=i(e(9)),g=i(e(2)),m=i(e(46)),v=i(e(54)),y=i(e(226)),_=i(e(51));r.__dashjs_factory_name="TextSourceBuffer",n.default=c.default.getSingletonFactory(r),t.exports=n.default},{108:108,198:198,2:2,203:203,207:207,209:209,226:226,234:234,242:242,45:45,46:46,47:47,51:51,54:54,9:9}],203:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){var t=E[e].kind,n=void 0!==E[e].id?E[e].id:E[e].lang,i=E[e].lang,r=E[e].isTTML,a=E[e].isEmbedded;return b.addTextTrack(t,n,i,r,a)}function t(e,t){var n=b.getClientWidth(),i=b.getClientHeight(),r=b.getVideoWidth(),a=b.getVideoHeight(),o=b.getVideoRelativeOffsetTop(),l=b.getVideoRelativeOffsetLeft();if(0!==r&&0!==a){var d=r/a,c=!1;e.isFromCEA608&&(d=3.5/3,c=!0);var u,f=function(e,t,n,i,r,a){var o=0,s=0;n/i<e/t?o=(s=t)/i*n:s=(o=e)/n*i;var l,d,c=0,u=0;return r<o/s?c=(u=s)*r:u=(c=o)/r,l=(e-c)/2,d=(t-u)/2,a?{x:l+.1*c,y:d+.1*u,w:.8*c,h:.8*u}:{x:l,y:d,w:c,h:u}}.call(this,n,i,r,a,d,c),h=f.w,p=f.h,g=f.x,v=f.y;if(h!=k||p!=I||g!=S||v!=C||t){S=g+l,C=v+o,k=h,I=p,!A||(u=A.style)&&(u.left=S+"px",u.top=C+"px",u.width=k+"px",u.height=I+"px",u.zIndex=D&&document[D]||R?N:null,m.trigger(s.default.CAPTION_CONTAINER_RESIZE,{}));var y=e.activeCues;if(y)for(var _=y.length,E=0;E<_;++E){var w=y[E];w.scaleCue(w)}}}}function n(e){var t,n=void 0,r=void 0,a=void 0,o=void 0,s=void 0;if(e.cellResolution){var l=[k/e.cellResolution[0],I/e.cellResolution[1]];if(e.linePadding)for(n in e.linePadding)if(e.linePadding.hasOwnProperty(n)){r=(e.linePadding[n]*l[0]).toString();for(var d=document.getElementsByClassName("spanPadding"),c=0;c<d.length;c++)d[c].style.cssText=d[c].style.cssText.replace(/(padding-left\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r),d[c].style.cssText=d[c].style.cssText.replace(/(padding-right\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r)}if(e.fontSize){for(n in e.fontSize)if(e.fontSize.hasOwnProperty(n)){"%"===e.fontSize[n][0]?a=e.fontSize[n][1]/100:"c"===e.fontSize[n][0]&&(a=e.fontSize[n][1]),r=(a*l[1]).toString(),s="defaultFontSize"!==n?document.getElementsByClassName(n):document.getElementsByClassName("paragraph");for(var u=0;u<s.length;u++)s[u].style.cssText=s[u].style.cssText.replace(/(font-size\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r)}if(e.lineHeight)for(n in e.lineHeight)if(e.lineHeight.hasOwnProperty(n)){"%"===e.lineHeight[n][0]?o=e.lineHeight[n][1]/100:"c"===e.fontSize[n][0]&&(o=e.lineHeight[n][1]),r=(o*l[1]).toString(),s=document.getElementsByClassName(n);for(var f=0;f<s.length;f++)s[f].style.cssText=s[f].style.cssText.replace(/(line-height\s*:\s*)[\d.,]+(?=\s*px)/gi,"$1"+r)}}}e.isd&&((t=document.getElementById(e.cueID))&&A.removeChild(t),i(e))}function i(e){var t;A&&(t=document.createElement("div"),A.appendChild(t),M=(0,c.renderHTML)(e.isd,t,(function(t){var n=/^(urn:)(mpeg:[a-z0-9][a-z0-9-]{0,31}:)(subs:)([0-9]+)$/,i=/^#(.*)$/;if(n.test(t)){var r=n.exec(t),a=parseInt(r[4],10)-1;return"data:image/png;base64,"+btoa(e.images[a])}return i.test(t)?(a=(r=i.exec(t))[1],"data:image/png;base64,"+e.embeddedImages[a]):null}),A.clientHeight,A.clientWidth,!1,(function(e){y.info("renderCaption :",e)}),M,!0),t.id=e.cueID,m.trigger(s.default.CAPTION_RENDERED,{captionDiv:t,currentTrackIdx:T}))}function r(e){return 0<=e&&E[e]?b.getTextTrack(E[e].kind,E[e].id,E[e].lang,E[e].isTTML,E[e].isEmbedded):null}function l(e){var n;e!==T&&(n=r(T=e),function(e){p.call(this),e&&"html"===e.renderingType?function(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,n=b.getElement();try{n&&(n.id?t.insertRule("#"+n.id+"::cue {background: transparent}",0):0!==n.classList.length?t.insertRule("."+n.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){y.info(""+e.message)}}}.call(this):h.call(this)}.call(this,n),x&&(clearInterval(x),x=null),n&&"html"===n.renderingType&&(t.call(this,n,!0),x=setInterval(t.bind(this,n),500)))}function f(e,t,n){if(e.cues)for(var i=e.cues,r=i.length-1;0<=r;r--)a=i[r],o=t,s=n,(isNaN(o)||a.startTime>=o)&&(isNaN(s)||a.endTime<=s)&&e.removeCue(i[r]);var a,o,s}function h(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function p(){if(A)for(;A.firstChild;)A.removeChild(A.firstChild)}var g=this.context,m=(0,o.default)(g).getInstance(),v=void 0,y=void 0,_=void 0,b=void 0,E=void 0,w=void 0,T=void 0,S=void 0,C=void 0,k=void 0,I=void 0,A=void 0,x=void 0,D=void 0,R=void 0,M=void 0,N=void 0;return v={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(_=window.VTTCue||window.TextTrackCue,E=[],w=[],R=!(T=-1),N=2147483647,M=x=A=null,void(I=k=C=S=0)!==document.fullscreenElement?D="fullscreenElement":void 0!==document.webkitIsFullScreen?D="webkitIsFullScreen":document.msFullscreenElement?D="msFullscreenElement":document.mozFullScreen&&(D="mozFullScreen"))},setDisplayCConTop:function(e){(0,u.checkParameterType)(e,"boolean"),R=e,A&&!document[D]&&(A.style.zIndex=e?N:null)},addTextTrack:function(n,i){var o=this;E.length!==i?(E.push(n),E.length===i&&function(){E.sort((function(e,t){return e.index-t.index})),A=b.getTTMLRenderingDiv();for(var n=-1,i=0;i<E.length;i++){var d=e.call(o,i);w.push(d),E[i].defaultTrack&&(d.default=!0,n=i);var c=r(i);c&&(c.mode=a.default.TEXT_SHOWING,A&&(E[i].isTTML||E[i].isEmbedded)?c.renderingType="html":c.renderingType="default"),o.addCaptions(i,0,E[i].captionData),m.trigger(s.default.TEXT_TRACK_ADDED)}l.call(o,n),0<=n&&function(){m.on(s.default.PLAYBACK_METADATA_LOADED,(function e(){var i=r(n);i&&t.call(this,i,!0),m.off(s.default.PLAYBACK_METADATA_LOADED,e,this)}),o);for(var e=0;e<E.length;e++){var i=r(e);i&&(i.mode=e===n?a.default.TEXT_SHOWING:a.default.TEXT_HIDDEN)}}(),m.trigger(s.default.TEXT_TRACKS_QUEUE_INITIALIZED,{index:T,tracks:E})}()):y.error("Trying to add too many tracks.")},addCaptions:function(e,t,o){var l=r(e),d=this;if(l&&Array.isArray(o)&&0!==o.length)for(var c=0;c<o.length;c++){var u=void 0,h=o[c];l.cellResolution=h.cellResolution,l.isFromCEA608=h.isFromCEA608,"html"===h.type&&A?((u=new _(h.start-t,h.end-t,"")).cueHTMLElement=h.cueHTMLElement,u.isd=h.isd,u.images=h.images,u.embeddedImages=h.embeddedImages,u.cueID=h.cueID,u.scaleCue=n.bind(d),u.cellResolution=h.cellResolution,u.lineHeight=h.lineHeight,u.linePadding=h.linePadding,u.fontSize=h.fontSize,A.style.left=S+"px",A.style.top=C+"px",A.style.width=k+"px",A.style.height=I+"px",u.onenter=function(){l.mode===a.default.TEXT_SHOWING&&(this.isd?(i(this),y.debug("Cue enter id:"+this.cueID)):(A.appendChild(this.cueHTMLElement),n.call(d,this),m.trigger(s.default.CAPTION_RENDERED,{captionDiv:this.cueHTMLElement,currentTrackIdx:T})))},u.onexit=function(){if(A)for(var e=A.childNodes,t=0;t<e.length;++t)e[t].id===this.cueID&&(y.debug("Cue exit id:"+e[t].id),A.removeChild(e[t]),--t)}):h.data&&(u=new _(h.start-t,h.end-t,h.data),h.styles&&(void 0!==h.styles.align&&"align"in u&&(u.align=h.styles.align),void 0!==h.styles.line&&"line"in u&&(u.line=h.styles.line),void 0!==h.styles.position&&"position"in u&&(u.position=h.styles.position),void 0!==h.styles.size&&"size"in u&&(u.size=h.styles.size)),u.onenter=function(){l.mode===a.default.TEXT_SHOWING&&m.trigger(s.default.CAPTION_RENDERED,{currentTrackIdx:T})});try{u?l.addCue(u):y.error("impossible to display subtitles.")}catch(e){throw f(l),l.addCue(u),e}}},getCurrentTrackIdx:function(){return T},setCurrentTrackIdx:l,getTrackIdxForId:function(e){for(var t=-1,n=0;n<E.length;n++)if(E[n].id===e){t=n;break}return t},getCurrentTrackInfo:function(){return E[T]},setModeForTrackIdx:function(e,t){var n=r(e);n&&n.mode!==t&&(n.mode=t)},deleteCuesFromTrackIdx:function(e,t,n){var i=r(e);i&&f(i,t,n)},deleteAllTextTracks:function(){for(var e=w?w.length:0,t=0;t<e;t++){var n=r(t);n&&(f.call(this,n),n.mode="disabled")}w=[],E=[],x&&(clearInterval(x),x=null),T=-1,p.call(this)},deleteTextTrack:function(e){b.removeChild(w[e]),w.splice(e,1)},setConfig:function(e){e&&e.videoModel&&(b=e.videoModel)}},y=(0,d.default)(g).getInstance().getLogger(v),v}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(46)),s=i(e(54)),l=i(e(47)),d=i(e(45)),c=e(17),u=e(219);r.__dashjs_factory_name="TextTracks",n.default=l.default.getSingletonFactory(r),t.exports=n.default},{108:108,17:17,219:219,45:45,46:46,47:47,54:54}],204:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){r&&r.reset()}var n,i=this.context,r=void 0;return n={provide:function(e,t){if("function"==typeof t){var n,i=r.getCurrentTrack(),a=void 0;if(!i||i.segmentDuration<=0||null==e)t(null);else{isNaN(i.segmentDuration)&&(a=r.getThumbnailRequestForTime(e))&&(i.segmentDuration=a.duration),n=e%i.segmentDuration;var o,l,d,u,f=Math.floor(n*i.tilesHor*i.tilesVert/i.segmentDuration),h=new s.default;if(h.width=Math.floor(i.widthPerTile),h.height=Math.floor(i.heightPerTile),h.x=Math.floor(f%i.tilesHor)*i.widthPerTile,h.y=Math.floor(f/i.tilesHor)*i.heightPerTile,"readThumbnail"in i)return i.readThumbnail(e,(function(e){h.url=e,t(h)}));a?(h.url=a.url,i.segmentDuration=NaN):(o=Math.floor(e/i.segmentDuration),h.url=(d=o+(l=i).startNumber,u=(0,c.replaceTokenForTemplate)(l.templateUrl,"Number",d),u=(0,c.replaceTokenForTemplate)(u,"Time",(d-1)*l.segmentDuration),u=(0,c.replaceTokenForTemplate)(u,"Bandwidth",l.bandwidth),(0,c.unescapeDollarsInTemplate)(u))),t(h)}}},setTrackByIndex:function(e){r.setTrackByIndex(e)},getCurrentTrackIndex:function(){return r.getCurrentTrackIndex()},getBitrateList:function(){var e=r.getTracks(),t=0;return e.map((function(e){var n=new d.default;return n.mediaType=o.default.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:t},t(),r=(0,l.default)(i).create({streamInfo:e.streamInfo,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants}),n}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(108)),s=i(e(235)),l=i(e(205)),d=i(e(225)),c=e(80);r.__dashjs_factory_name="ThumbnailController",n.default=a.default.getClassFactory(r),t.exports=n.default},{108:108,205:205,225:225,235:235,47:47,80:80}],205:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(){i(),x=(0,h.default)(s).create({}),D=(0,f.default)(s).getInstance(),(k=(0,p.default)(s).create({timelineConverter:_,baseURLController:v,debug:b,eventBus:E,events:w,dashConstants:T,urlUtils:S})).initialize(!!m&&m.getIsDynamic()),function(){if(y&&m&&(A=m.getMediaInfoForType(y,a.default.IMAGE))){var e=m.getVoRepresentations(A);e&&0<e.length&&e.forEach((function(e){(e.segmentInfoType===o.default.SEGMENT_TEMPLATE&&0<e.segmentDuration&&e.media||e.segmentInfoType===o.default.SEGMENT_TIMELINE)&&n(e),e.segmentInfoType===o.default.SEGMENT_BASE&&n(e,!0)})),0<C.length&&(C.sort((function(e,t){return e.bitrate-t.bitrate})),I=C.length-1)}}()}function n(e,t){var n,i,r=new l.default;r.id=e.id,r.bitrate=e.bandwidth,r.width=e.width,r.height=e.height,r.tilesHor=1,r.tilesVert=1,e.essentialProperties&&e.essentialProperties.forEach((function(e){var t;0<=g.indexOf(e.schemeIdUri)&&e.value&&(2!==(t=e.value.split("x")).length||isNaN(t[0])||isNaN(t[1])||(r.tilesHor=parseInt(t[0],10),r.tilesVert=parseInt(t[1],10)))})),t?E.trigger(u.default.SEGMENTBASE_SEGMENTSLIST_REQUEST_NEEDED,{mimeType:A.mimeType,mediaType:a.default.IMAGE,representation:e,callback:function(e,t){var n=[];e=function(e,t){for(var n=[],i=0,r=void 0,a=void 0,o=void 0,s=(r=0,e.length);r<s;r++)a=e[r],(o=(0,c.getTimeBasedSegment)(_,m.getIsDynamic(),t,a.startTime,a.duration,a.timescale,a.media,a.mediaRange,i))&&(n.push(o),o=null,i++);return n}(e,t),r.segmentDuration=e[0].duration,r.readThumbnail=function(i,r){var a=null;n.some((function(e){if(e.start<=i&&e.end>i)return a=e.url,!0})),a?r(a):e.some((function(e){if(e.mediaStartTime<=i&&e.mediaStartTime+e.duration>i){var a=v.resolve(t.path);return x.load({method:"get",url:a.url,request:{range:e.mediaRange,responseType:"arraybuffer"},onload:function(t){var i=D.getSamplesInfo(t.target.response),a=new Blob([t.target.response.slice(i.sampleList[0].offset,i.sampleList[0].offset+i.sampleList[0].size)],{type:"image/jpeg"}),o=window.URL.createObjectURL(a);n.push({start:e.mediaStartTime,end:e.mediaStartTime+e.duration,url:o}),r&&r(o)}}),!0}}))}}}):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=(n=e,(i=S.isRelative(n.media)?S.resolve(n.media,v.resolve(n.path).url):n.media)?(0,c.replaceIDForTemplate)(i,n.id):"")),0<r.tilesHor&&0<r.tilesVert&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,C.push(r))}function i(){C=[],I=-1,A=null}var r,s=this.context,m=e.adapter,v=e.baseURLController,y=e.streamInfo,_=e.timelineConverter,b=e.debug,E=e.eventBus,w=e.events,T=e.dashConstants,S=(0,d.default)(s).getInstance(),C=void 0,k=void 0,I=void 0,A=void 0,x=void 0,D=void 0;return r={initialize:t,getTracks:function(){return C},reset:i,setTrackByIndex:function(e){C&&0!==C.length&&(e>=C.length&&(e=C.length-1),I=e)},getCurrentTrack:function(){return I<0?null:C[I]},getCurrentTrackIndex:function(){return I},getThumbnailRequestForTime:function(e){for(var t=void 0,n=m.getVoRepresentations(A),i=0;i<n.length;i++)if(C[I].id===n[i].id){t=n[i];break}return k.getSegmentRequestForTime(A,t,e)}},t(),r}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(108)),o=i(e(61)),s=i(e(47)),l=i(e(236)),d=i(e(221)),c=e(80),u=i(e(54)),f=i(e(207)),h=i(e(160)),p=i(e(57)),g=["http://dashif.org/thumbnail_tile","http://dashif.org/guidelines/thumbnail_tile"];n.THUMBNAILS_SCHEME_ID_URIS=g,r.__dashjs_factory_name="ThumbnailTracks",n.default=s.default.getClassFactory(r)},{108:108,160:160,207:207,221:221,236:236,47:47,54:54,57:57,61:61,80:80}],206:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(){r.reset()}var t,n=this.context,i=(0,o.default)(n).getInstance(),r=void 0,u=void 0,p=void 0,g=void 0;return t={chooseSelector:function(e){(0,h.checkParameterType)(e,"boolean"),g=e?p:u},select:function(t){if(t){var n=t.baseUrls,r=t.selectedIdx;if(!isNaN(r))return n[r];var o=g.select(n);return o?(t.selectedIdx=n.indexOf(o),o):(i.trigger(s.default.URL_RESOLUTION_FAILED,{error:new f.default(a.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE,a.default.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE)}),void(g===u&&e()))}},reset:e,setConfig:function(e){e.selector&&(g=e.selector)}},r=(0,l.default)(n).create({updateEventName:s.default.SERVICE_LOCATION_BLACKLIST_CHANGED,addBlacklistEventName:s.default.SERVICE_LOCATION_BLACKLIST_ADD}),u=(0,c.default)(n).create({blacklistController:r}),p=(0,d.default)(n).create({blacklistController:r}),g=u,t}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(51)),o=i(e(46)),s=i(e(54)),l=i(e(113)),d=i(e(224)),c=i(e(223)),u=i(e(47)),f=i(e(226)),h=e(219);r.__dashjs_factory_name="BaseURLSelector",n.default=u.default.getClassFactory(r),t.exports=n.default},{113:113,219:219,223:223,224:224,226:226,46:46,47:47,51:51,54:54}],207:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=l.default.parseBuffer(e),n=(0,o.default)(i).create();return n.setData(t),n}var t=void 0,n=void 0,i=this.context;return n={parse:e,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new d.default(0,!1);for(var i,r,a,o,s=t instanceof ArrayBuffer?new Uint8Array(t):t,l=void 0,c=0;n<s.byteLength;){var u=(a=s)[(o=n)+3]>>>0|a[o+2]<<8>>>0|a[o+1]<<16>>>0|a[o]<<24>>>0,f=(i=s,r=n+4,String.fromCharCode(i[r++])+String.fromCharCode(i[r++])+String.fromCharCode(i[r++])+String.fromCharCode(i[r]));if(0==u)break;n+u<=s.byteLength&&(0<=e.indexOf(f)?l=new d.default(n,!0,u):c=n+u),n+=u}return l||new d.default(c,!1)},getMediaTimescaleFromMoov:function(t){var n=e(t),i=n?n.getBox("mdhd"):void 0;return i?i.timescale:NaN},getSamplesInfo:function(t){if(!t||0===t.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var n=e(t),i=n.getBoxes("moof"),r=n.getBoxes("mfhd"),a=void 0,o=void 0,s=void 0,l=void 0,d=void 0,c=void 0,u=void 0,f=void 0,h=void 0,p=void 0,g=void 0,m=void 0,v=void 0,y=void 0,_=n.getBoxes("moof").length,b=r[r.length-1].sequence_number,E=(d=[],-1),w=-1;for(p=o=0;p<i.length;p++){var T=i[p],S=T.getChildBoxes("traf");for(f=0;f<S.length;f++){var C=S[f],k=C.getChildBox("tfhd"),I=C.getChildBox("tfdt"),A=(l=I.baseMediaDecodeTime,C.getChildBoxes("trun")),x=C.getChildBoxes("subs");for(h=0;h<A.length;h++){var D=A[h];for(o=D.sample_count,v=(k.base_data_offset||0)+(D.data_offset||0),u=0;u<o;u++){a=void 0!==(c=D.samples[u]).sample_duration?c.sample_duration:k.default_sample_duration,s=void 0!==c.sample_size?c.sample_size:k.default_sample_size;var R={dts:l,cts:l+(void 0!==c.sample_composition_time_offset?c.sample_composition_time_offset:0),duration:a,offset:T.offset+v,size:s,subSizes:[s]};if(x)for(g=0;g<x.length;g++){var M=x[g];if(E<M.entry_count-1&&w<u&&(E++,w+=M.entries[E].sample_delta),u==w){R.subSizes=[];var N=M.entries[E];for(m=0;m<N.subsample_count;m++)R.subSizes.push(N.subsamples[m].subsample_size)}}d.push(R),v+=s,l+=a}}y=l-I.baseMediaDecodeTime}}return{sampleList:d,lastSequenceNumber:b,totalDuration:y,numSequences:_}},findInitRange:function(n){var i=null,r=e(n);if(!r)return i;var a=r.getBox("ftyp"),o=r.getBox("moov");return t.debug("Searching for initialization."),o&&o.isComplete&&(i=(a?a.offset:o.offset)+"-"+(o.offset+o.size-1),t.debug("Found the initialization.  Range: "+i)),i}},t=(0,a.default)(i).getInstance().getLogger(n),n}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(45)),o=i(e(215)),s=i(e(47)),l=i(e(9)),d=i(e(231));r.__dashjs_factory_name="BoxParser",n.default=s.default.getSingletonFactory(r),t.exports=n.default},{215:215,231:231,45:45,47:47,9:9}],208:[function(e,t,n){"use strict";function i(){var e,t=void 0;return t=!(e={supportsMediaSource:function(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t},supportsEncryptedMedia:function(){return t},supportsCodec:function(e){return!(!("MediaSource"in window)||!MediaSource.isTypeSupported(e))||!(!("WebKitMediaSource"in window)||!WebKitMediaSource.isTypeSupported(e))},setEncryptedMediaSupported:function(e){t=e}}),e}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="Capabilities",n.default=a.default.getSingletonFactory(i),t.exports=n.default},{47:47}],209:[function(e,t,n){"use strict";function i(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;n<this.customTimeRangeArray.length&&e>this.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n<this.customTimeRangeArray.length-1;n++)this.mergeRanges(n,n+1)&&n--;this.length=this.customTimeRangeArray.length},clear:function(){this.customTimeRangeArray=[],this.length=0},remove:function(e,t){for(var n=0;n<this.customTimeRangeArray.length;n++)if(e<=this.customTimeRangeArray[n].start&&t>=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end){this.customTimeRangeArray.splice(n+1,0,{start:t,end:this.customTimeRangeArray[n].end}),this.customTimeRangeArray[n].end=e;break}e>this.customTimeRangeArray[n].start&&e<this.customTimeRangeArray[n].end?this.customTimeRangeArray[n].end=e:t>this.customTimeRangeArray[n].start&&t<this.customTimeRangeArray[n].end&&(this.customTimeRangeArray[n].start=t)}this.length=this.customTimeRangeArray.length},mergeRanges:function(e,t){var n=this.customTimeRangeArray[e],i=this.customTimeRangeArray[t];return n.start<=i.start&&i.start<=n.end&&n.end<=i.end?(n.end=i.end,this.customTimeRangeArray.splice(t,1),!0):i.start<=n.start&&n.start<=i.end&&i.end<=n.end?(n.start=i.start,this.customTimeRangeArray.splice(t,1),!0):i.start<=n.start&&n.start<=i.end&&n.end<=i.end?(this.customTimeRangeArray.splice(e,1),!0):n.start<=i.start&&i.start<=n.end&&i.end<=n.end&&(this.customTimeRangeArray.splice(t,1),!0)},start:function(e){return(0,o.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return(0,o.checkInteger)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r},o=e(219);i.__dashjs_factory_name="CustomTimeRanges",n.default=a.default.getClassFactory(i),t.exports=n.default},{219:219,47:47}],210:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){function t(e){if(void 0!==v)return v;v=!1;var t=void 0;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return m.warn("DOMStorage access denied: "+e.message),v}if(!t||e!==u&&"sessionStorage"!==e)return v;try{t.setItem("1","1"),t.removeItem("1"),v=!0}catch(e){m.warn("DOMStorage is supported, but cannot be used: "+e.message)}return v}function n(){return 6e5*Math.round((new Date).getTime()/6e5)}function i(e,n){return t(e)&&p.get().streaming[n+"CachingInfo"].enabled}function r(){if(!p)throw new Error(s.default.MISSING_CONFIG_ERROR)}e=e||{};var a=this.context,p=e.settings,g=void 0,m=void 0,v=void 0;return g={getSavedBitrateSettings:function(e){var t=NaN;if(r(),i(u,f)){var n=d.replace(/\?/,e);try{var a=JSON.parse(localStorage.getItem(n))||{},o=(new Date).getTime()-parseInt(a.timestamp,10)>=p.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(a.bitrate);isNaN(s)||o?o&&localStorage.removeItem(n):(t=s,m.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(i(u,f)&&t){var r=d.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:n()}))}catch(e){m.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(r(),i(u,h)){var n=c.replace(/\?/,e);try{var a=JSON.parse(localStorage.getItem(n))||{},o=(new Date).getTime()-parseInt(a.timestamp,10)>=p.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=a.settings;o&&(localStorage.removeItem(n),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(i(u,h)){var r=c.replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:n()}))}catch(e){m.error(e.message)}}}},m=(0,o.default)(a).getInstance().getLogger(g),t(u)&&l.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){m.error(e.message)}}})),g}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(45)),s=i(e(108)),l=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}],d="dashjs_?_bitrate",c="dashjs_?_settings",u="localStorage",f="lastBitrate",h="lastMediaSettings";r.__dashjs_factory_name="DOMStorage";var p=a.default.getSingletonFactory(r);n.default=p,t.exports=n.default},{108:108,45:45,47:47}],211:[function(e,t,n){"use strict";function i(){function e(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}}function t(e,t){var l=n;if(!t)return e;if(!a(e))return e;o(e)&&(l=i),s(e)&&(l=r);var d=l(t),c="/"!==d.charAt(d.length-1)&&"/"!==e.charAt(0)?"/":"";return[d,e].join(c)}function n(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function i(e){var t=e.match(f);return t?t[1]:""}function r(e){var t=e.match(d);return t?t[0]:""}function a(e){return!d.test(e)}function o(e){return a(e)&&"/"===e.charAt(0)}function s(e){return 0===e.indexOf("//")}var l=void 0,d=/^[a-z][a-z0-9+\-_.]*:/i,c=/^https?:\/\//i,u=/^https:\/\//i,f=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i;return function(){try{new window.URL("x","http://y"),l=e}catch(e){}finally{l=l||t}}(),{parseBaseUrl:n,parseOrigin:i,parseScheme:r,isRelative:a,isPathAbsolute:o,isSchemeRelative:s,isHTTPURL:function(e){return c.test(e)},isHTTPS:function(e){return u.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(e,t){return l(e,t)}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="DefaultURLUtils",n.default=a.default.getSingletonFactory(i),t.exports=n.default},{47:47}],212:[function(e,t,n){"use strict";function i(e){function t(e,t){var n=!0,i=0;if(void 0===t&&(t=!1),i=16777215<e.tag?(r.getUint32(a)!==e.tag&&(n=!1),4):65535<e.tag?(256*r.getUint16(a)+r.getUint8(a+2)!==e.tag&&(n=!1),3):255<e.tag?(r.getUint16(a)!==e.tag&&(n=!1),2):(r.getUint8(a)!==e.tag&&(n=!1),1),!n&&e.required&&!t)throw new Error("required tag not found");return n&&(a+=i),n}function n(e){var t=1,n=128,i=-1,o=0,s=r.getUint8(a),l=0;for(l=0;l<8;l+=1){if((s&n)===n){o=void 0===e?s&~n:s,i=l;break}n>>=1}for(l=0;l<i;l+=1,t+=1)o=o<<8|255&r.getUint8(a+t);return a+=t,o}e=e||{};var i=void 0,r=new DataView(e.data),a=0;return i={getPos:function(){return a},setPos:function(e){a=e},consumeTag:t,consumeTagAndSize:function(e,i){var r=t(e,i);return r&&n(),r},parseTag:function(e){var r;return t(e),r=n(),i[e.parse](r)},skipOverElement:function(e,i){var r=t(e,i),o=void 0;return r&&(o=n(),a+=o),r},getMatroskaCodedNum:n,getMatroskaFloat:function(e){var t=void 0;switch(e){case 4:t=r.getFloat32(a),a+=4;break;case 8:t=r.getFloat64(a),a+=8}return t},getMatroskaUint:function(e){for(var t=0,n=0;n<e;n+=1)t<<=8,t|=255&r.getUint8(a+n);return a+=e,t},moreData:function(){return a<r.byteLength}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="EBMLParser",n.default=a.default.getClassFactory(i),t.exports=n.default},{47:47}],213:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=this.context,t=(0,a.default)(e).getInstance();return{error:function(e){t.trigger(o.default.ERROR,{error:e})}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(46)),o=i(e(54)),s=i(e(47));r.__dashjs_factory_name="ErrorHandler",n.default=s.default.getSingletonFactory(r),t.exports=n.default},{46:46,47:47,54:54}],214:[function(e,t,n){"use strict";function i(){var e={};return{save:function(t){var n=t.streamId,i=t.representationId;e[n]=e[n]||{},e[n][i]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="InitCache",n.default=a.default.getSingletonFactory(i),t.exports=n.default},{47:47}],215:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){var i=[];if(!e||!n||"function"!=typeof n.fetchAll)return i;for(var r=n.fetchAll(e),a=void 0,o=0,s=r.length;o<s;o++)(a=t(r[o]))&&i.push(a);return i}function t(e){if(!e)return null;var t=new a.default(e);return e.hasOwnProperty("_incomplete")&&(t.isComplete=!e._incomplete),t}var n=void 0;return{getBox:function(e){return e&&n&&n.boxes&&0!==n.boxes.length&&"function"==typeof n.fetch?t(n.fetch(e)):null},getBoxes:e,setData:function(e){n=e},getLastBox:function(){if(!n||!n.boxes||!n.boxes.length)return null;var t=e(n.boxes[n.boxes.length-1].type);return 0<t.length?t[t.length-1]:null}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(230)),o=i(e(47));r.__dashjs_factory_name="IsoFile",n.default=o.default.getClassFactory(r),t.exports=n.default},{230:230,47:47}],216:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=(e=e||{}).timelineConverter;return{getLiveEdge:function(e){return function(){if(!t||!t.hasOwnProperty("getExpectedLiveEdge"))throw new Error(o.default.MISSING_CONFIG_ERROR)}(),e.DVRWindow?e.DVRWindow.end:0},reset:function(){t=null}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(108));r.__dashjs_factory_name="LiveEdgeFinder",n.default=a.default.getClassFactory(r),t.exports=n.default},{108:108,47:47}],217:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){return{areEqual:function(e,t){return(0,o.default)(e,t)}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(12));r.__dashjs_factory_name="ObjectUtils",n.default=a.default.getSingletonFactory(r),t.exports=n.default},{12:12,47:47}],218:[function(e,t,n){"use strict";function i(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="RequestModifier",n.default=a.default.getSingletonFactory(i),t.exports=n.default},{47:47}],219:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.checkParameterType=function(e,t){if(typeof e!==t)throw r.default.BAD_ARGUMENT_ERROR},n.checkInteger=function(e){if(null===e||isNaN(e)||e%1!=0)throw r.default.BAD_ARGUMENT_ERROR+" : argument is not an integer"},n.checkRange=function(e,t,n){if(e<t||n<e)throw r.default.BAD_ARGUMENT_ERROR+" : argument out of range"},n.checkIsVideoOrAudioType=function(e){if("string"!=typeof e||e!==r.default.AUDIO&&e!==r.default.VIDEO)throw r.default.BAD_ARGUMENT_ERROR};var i,r=(i=e(108))&&i.__esModule?i:{default:i}},{108:108}],220:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){var e=this.context,t=(0,s.default)(e).getInstance(),n=void 0,i=void 0,r=0;return n={parse:function(e,n,a,o,s){var c="",u=[],f=void 0,h=void 0,p=void 0,g={},m={},v="",y="",_={onOpenTag:function(e,t,n){
if("image"===t&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!n[" imageType"]||"PNG"!==n[" imageType"].value)return void i.warn("smpte-tt imageType != PNG. Discarded");v=n["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){v&&(m[v]=y.trim()),v=y=""},onText:function(e){v&&(y+=e)}};if(!e)throw c="no ttml data to parse",new Error(c);g.data=e,t.trigger(l.default.TTML_TO_PARSE,g);var b=(0,d.fromXML)(g.data,(function(e){c=e}),_);t.trigger(l.default.TTML_PARSED,{ttmlString:g.data,ttmlDoc:b});var E,w=b.getMediaTimeEvents();for(p=0;p<w.length;p++){var T=(0,d.generateISD)(b,w[p],(function(e){c=e}));T.contents.some((function(e){return e.contents.length}))&&(f=w[p]+n<a?a:w[p]+n)<(h=w[p+1]+n>o?o:w[p+1]+n)&&u.push({start:f,end:h,type:"html",cueID:(E="cue_TTML_"+r,r++,E),isd:T,images:s,embeddedImages:m})}if(""!==c)throw i.error(c),new Error(c);return u}},i=(0,o.default)(e).getInstance().getLogger(n),n}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(45)),s=i(e(46)),l=i(e(54)),d=e(17);r.__dashjs_factory_name="TTMLParser",n.default=a.default.getSingletonFactory(r),t.exports=n.default},{17:17,45:45,46:46,47:47,54:54}],221:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e,i,r){var a=function(e){var i=void 0;for(i=0;i<n.length;i++)if(n[i].regex.test(e))return n[i].utils;return t}(r||i);return a&&"function"==typeof a[e]?a[e](i,r):t[e](i,r)}var t=void 0,n=[],i=this.context;return t=(0,o.default)(i).getInstance(),{registerUrlRegex:function(e,t){n.push({regex:e,utils:t})},parseBaseUrl:function(t){return e("parseBaseUrl",t)},parseOrigin:function(t){return e("parseOrigin",t)},parseScheme:function(t){return e("parseScheme",t)},isRelative:function(t){return e("isRelative",t)},isPathAbsolute:function(t){return e("isPathAbsolute",t)},isSchemeRelative:function(t){return e("isSchemeRelative",t)},isHTTPURL:function(t){return e("isHTTPURL",t)},isHTTPS:function(t){return e("isHTTPS",t)},removeHostname:function(t){return e("removeHostname",t)},resolve:function(t,n){return e("resolve",t,n)}}}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(211));r.__dashjs_factory_name="URLUtils";var s=a.default.getSingletonFactory(r);n.default=s,t.exports=n.default},{211:211,47:47}],222:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(){function e(e){var t=e.split(":"),n=t.length-1;return e=60*parseInt(t[n-1],10)+parseFloat(t[n]),2==n&&(e+=3600*parseInt(t[0],10)),e}var t=this.context,n=void 0,i=void 0,r=void 0,a=void 0,s=void 0,l=void 0;return n={parse:function(t){var n,o=[],d=void 0;if(!t)return o;n=(t=t.split(r)).length,d=-1;for(var c,u,f=0;f<n;f++){var h,p,g,m,v,y,_=t[f];0<_.length&&"WEBVTT"!==_&&_.match(a)&&(u=c=void 0,(u=(c=_.split(a))[1].split(l)).shift(),c[1]=u[0],u.shift(),p=(h={cuePoints:c,styles:function(e){var t={};return e.forEach((function(e){var n;1<e.split(/:/).length&&((n=e.split(/:/)[1])&&-1!=n.search(/%/)&&(n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line=n),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n))})),t}(u)}).cuePoints,g=h.styles,m=function(e,t){for(var n,i=t,r="",o="";""!==e[i]&&i<e.length;)i++;if(1<(n=i-t))for(var s=0;s<n;s++){if((o=e[t+s]).match(a)){r="";break}r+=o,s!==n-1&&(r+="\n")}else(o=e[t]).match(a)||(r=o);return r}(t,f+1),v=e(p[0].replace(s,"")),y=e(p[1].replace(s,"")),!isNaN(v)&&!isNaN(y)&&d<=v&&v<y?""!==m?(d=v,o.push({start:v,end:y,data:m,styles:g})):i.error("Skipping cue due to empty/malformed cue text"):i.error("Skipping cue due to incorrect cue timing"))}return o}},i=(0,o.default)(t).getInstance().getLogger(n),r=/(?:\r\n|\r|\n)/gm,a=/-->/,s=/(^[\s]+|[\s]+$)/g,l=/\s\b/g,n}Object.defineProperty(n,"__esModule",{value:!0});var a=i(e(47)),o=i(e(45));r.__dashjs_factory_name="VTTParser",n.default=a.default.getSingletonFactory(r),t.exports=n.default},{45:45,47:47}],223:[function(e,t,n){"use strict";function i(e){var t=(e=e||{}).blacklistController;return{select:function(e){var n=0,i=void 0;return e&&e.some((function(e,i){return n=i,!t.contains(e.serviceLocation)}))&&(i=e[n]),i}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="BasicSelector",n.default=a.default.getClassFactory(i),t.exports=n.default},{47:47}],224:[function(e,t,n){"use strict";function i(e){var t=(e=e||{}).blacklistController;return{select:function(e){return e&&function(e){var t=0,n=[],i=0,r=void 0,a=void 0;if((a=e.sort((function(e,t){var n=e.dvb_priority-t.dvb_priority;return isNaN(n)?0:n})).filter((function(e,t,n){return!t||n[0].dvb_priority&&e.dvb_priority&&n[0].dvb_priority===e.dvb_priority}))).length)return 1<a.length&&(a.forEach((function(e){t+=e.dvb_weight,n.push(t)})),r=Math.floor(Math.random()*(t-1)),n.every((function(e,t){return i=t,!(r<e)}))),a[i]}((n=[],e.filter((function(e){return!t.contains(e.serviceLocation)||(e.dvb_priority&&n.push(e.dvb_priority),!1)})).filter((function(e){return!n.length||!e.dvb_priority||-1===n.indexOf(e.dvb_priority)}))));var n}}}Object.defineProperty(n,"__esModule",{value:!0});var r,a=(r=e(47))&&r.__esModule?r:{default:r};i.__dashjs_factory_name="DVBSelector",n.default=a.default.getClassFactory(i),t.exports=n.default},{47:47}],225:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN},t.exports=n.default},{}],226:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=i||null},t.exports=n.default},{}],227:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.streamId=null,this.mediaInfo=null,this.segmentType=null,this.quality=NaN,this.index=NaN,this.bytes=null,this.start=NaN,this.end=NaN,this.duration=NaN,this.representationId=null,this.endFragment=null},t.exports=n.default},{}],228:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.action=r.ACTION_DOWNLOAD,this.startTime=NaN,this.mediaType=null,this.mediaInfo=null,this.type=null,this.duration=NaN,this.timescale=NaN,this.range=null,this.url=e||null,this.serviceLocation=null,this.requestStartDate=null,this.firstByteDate=null,this.requestEndDate=null,this.quality=NaN,this.index=NaN,this.availabilityStartTime=null,this.availabilityEndTime=null,this.wallStartTime=null,this.bytesLoaded=NaN,this.bytesTotal=NaN,this.delayLoadingTime=NaN,this.responseType="arraybuffer",this.representationId=null}Object.defineProperty(n,"__esModule",{value:!0});var a=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e},o=e(242),s=(a(r,[{key:"isInitializationRequest",value:function(){return this.type&&this.type===o.HTTPRequest.INIT_SEGMENT_TYPE}},{key:"setInfo",value:function(e){this.type=e&&e.init?o.HTTPRequest.INIT_SEGMENT_TYPE:o.HTTPRequest.MEDIA_SEGMENT_TYPE,this.url=e&&e.url?e.url:null,this.range=e&&e.range?e.range.start+"-"+e.range.end:null,this.mediaType=e&&e.mediaType?e.mediaType:null}}]),r);s.ACTION_DOWNLOAD="download",s.ACTION_COMPLETE="complete",n.default=s,t.exports=n.default},{242:242}],229:[function(e,t,n){"use strict";function i(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),a(Object.getPrototypeOf(i.prototype),"constructor",this).call(this,e),this.checkForExistenceOnly=!0}Object.defineProperty(n,"__esModule",{value:!0});var r,a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(i,((r=e(228))&&r.__esModule?r:{default:r}).default),i);n.default=o,t.exports=n.default},{228:228}],230:[function(e,t,n){"use strict";function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),this.offset=e._offset,this.type=e.type,this.size=e.size,this.boxes=[],e.boxes)for(var t=0;t<e.boxes.length;t++)this.boxes.push(new r(e.boxes[t]));switch(this.isComplete=!0,e.type){case"sidx":if(this.timescale=e.timescale,this.earliest_presentation_time=e.earliest_presentation_time,this.first_offset=e.first_offset,this.references=e.references,e.references)for(this.references=[],t=0;t<e.references.length;t++){var n={reference_type:e.references[t].reference_type,referenced_size:e.references[t].referenced_size,subsegment_duration:e.references[t].subsegment_duration};this.references.push(n)}break;case"emsg":this.id=e.id,this.version=1===e.version?1:0,this.value=e.value,this.timescale=e.timescale,this.scheme_id_uri=e.scheme_id_uri,this.presentation_time_delta=1===e.version?e.presentation_time:e.presentation_time_delta,this.event_duration=e.event_duration,this.message_data=e.message_data;break;case"mdhd":this.timescale=e.timescale;break;case"mfhd":this.sequence_number=e.sequence_number;break;case"subs":this.entry_count=e.entry_count,this.entries=e.entries;break;case"tfhd":this.base_data_offset=e.base_data_offset,this.sample_description_index=e.sample_description_index,this.default_sample_duration=e.default_sample_duration,this.default_sample_size=e.default_sample_size,this.default_sample_flags=e.default_sample_flags,this.flags=e.flags;break;case"tfdt":this.version=e.version,this.baseMediaDecodeTime=e.baseMediaDecodeTime,this.flags=e.flags;break;case"trun":if(this.sample_count=e.sample_count,this.first_sample_flags=e.first_sample_flags,this.data_offset=e.data_offset,this.flags=e.flags,this.samples=e.samples,e.samples){this.samples=[];t=0;for(var i=e.samples.length;t<i;t++){var a={sample_size:e.samples[t].sample_size,sample_duration:e.samples[t].sample_duration,sample_composition_time_offset:e.samples[t].sample_composition_time_offset};this.samples.push(a)}}}}Object.defineProperty(n,"__esModule",{value:!0});var a=(function(e,t,n){t&&i(e.prototype,t),n&&i(e,n)}(r,[{key:"getChildBox",value:function(e){for(var t=0;t<this.boxes.length;t++)if(this.boxes[t].type===e)return this.boxes[t]}},{key:"getChildBoxes",value:function(e){for(var t=[],n=0;n<this.boxes.length;n++)this.boxes[n].type===e&&t.push(this.boxes[n]);return t}}]),r);n.default=a,t.exports=n.default},{}],231:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(t,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=i},t.exports=n.default},{}],232:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.TcpList=[],this.HttpList=[],this.RepSwitchList=[],this.BufferLevel=[],this.BufferState=[],this.PlayList=[],this.DroppedFrames=[],this.SchedulingInfo=[],this.DVRInfo=[],this.ManifestUpdate=[],this.RequestsQueue=null,this.DVBErrors=[]},t.exports=n.default},{}],233:[function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),a(Object.getPrototypeOf(r.prototype),"constructor",this).call(this),this.url=e||null,this.type=t||null,this.mediaType=o.default.STREAM,this.responseType=""}Object.defineProperty(n,"__esModule",{value:!0});var a=function(e,t,n){for(var i=!0;i;){var r=e,a=t,o=n;i=!1;null===r&&(r=Function.prototype);var s=Object.getOwnPropertyDescriptor(r,a);if(void 0!==s){if("value"in s)return s.value;var l=s.get;if(void 0===l)return;return l.call(o)}var d=Object.getPrototypeOf(r);if(null===d)return;e=d,t=a,n=o,i=!0,s=d=void 0}},o=i(e(108)),s=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,i(e(228)).default),r);n.default=s,t.exports=n.default},{108:108,228:228}],234:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.captionData=null,this.label=null,this.lang=null,this.defaultTrack=!1,this.kind=null,this.isFragmented=!1,this.isEmbedded=!1},t.exports=n.default},{}],235:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null},t.exports=n.default},{}],236:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bitrate=0,this.width=0,this.height=0,this.tilesHor=0,this.tilesVert=0,this.widthPerTile=0,this.heightPerTile=0,this.startNumber=0,this.segmentDuration=0,this.timescale=0,this.templateUrl="",this.id=""},t.exports=n.default},{}],237:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null},t.exports=n.default},{}],238:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.level=null},t.exports=n.default},{}],239:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i,r=(i=e(109))&&i.__esModule?i:{default:i};n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.target=null,this.state=r.default.BUFFER_EMPTY},t.exports=n.default},{109:109}],240:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.range=null,this.manifestInfo=null},t.exports=n.default},{}],241:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.time=null,this.droppedFrames=null},t.exports=n.default},{}],242:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(){i(this,r),this.tcpid=null,this.type=null,this.url=null,this.actualurl=null,this.range=null,this.trequest=null,this.tresponse=null,this.responsecode=null,this.interval=null,this.trace=[],this._stream=null,this._tfinish=null,this._mediaduration=null,this._quality=null,this._responseHeaders=null,this._serviceLocation=null}Object.defineProperty(n,"__esModule",{value:!0}),r.GET="GET",r.HEAD="HEAD",r.MPD_TYPE="MPD",r.XLINK_EXPANSION_TYPE="XLinkExpansion",r.INIT_SEGMENT_TYPE="InitializationSegment",r.INDEX_SEGMENT_TYPE="IndexSegment",r.MEDIA_SEGMENT_TYPE="MediaSegment",r.BITSTREAM_SWITCHING_SEGMENT_TYPE="BitstreamSwitchingSegment",r.OTHER_TYPE="other",n.HTTPRequest=r,n.HTTPRequestTrace=function e(){i(this,e),this.s=null,this.d=null,this.b=[]}},{}],243:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0}),n.ManifestUpdate=function e(){i(this,e),this.mediaType=null,this.type=null,this.requestTime=null,this.fetchTime=null,this.availabilityStartTime=null,this.presentationStartTime=0,this.clientTimeOffset=0,this.currentTime=null,this.buffered=null,this.latency=0,this.streamInfo=[],this.representationInfo=[]},n.ManifestUpdateStreamInfo=function e(){i(this,e),this.id=null,this.index=null,this.start=null,this.duration=null},n.ManifestUpdateRepresentationInfo=function e(){i(this,e),this.id=null,this.index=null,this.mediaType=null,this.streamIndex=null,this.presentationTimeOffset=null,this.startNumber=null,this.fragmentInfoType=null}},{}],244:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(){i(this,r),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]}function a(){i(this,a),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null}Object.defineProperty(n,"__esModule",{value:!0}),r.INITIAL_PLAYOUT_START_REASON="initial_playout",r.SEEK_START_REASON="seek",r.RESUME_FROM_PAUSE_START_REASON="resume",r.METRICS_COLLECTION_START_REASON="metrics_collection_start",a.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",a.REBUFFERING_REASON="rebuffering",a.USER_REQUEST_STOP_REASON="user_request",a.END_OF_PERIOD_STOP_REASON="end_of_period",a.END_OF_CONTENT_STOP_REASON="end_of_content",a.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",a.FAILURE_STOP_REASON="failure",n.PlayList=r,n.PlayListTrace=a},{}],245:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.mt=null,this.to=null,this.lto=null},t.exports=n.default},{}],246:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.loadingRequests=[],this.executedRequests=[]},t.exports=n.default},{}],247:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.t=null,this.type=null,this.startTime=null,this.availabilityStartTime=null,this.duration=null,this.quality=null,this.range=null,this.state=null},t.exports=n.default},{}]},{},[4]),function(e,t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):e.jQuery?e.jQuery:e.Zepto)}(this,(function(e,t){e.fn.jPlayer=function(n){var i="jPlayer",r="string"==typeof n,a=Array.prototype.slice.call(arguments,1),o=this;return n=!r&&a.length?e.extend.apply(null,[!0,n].concat(a)):n,r&&"_"===n.charAt(0)||this.each(r?function(){var r=e(this).data(i),s=r&&e.isFunction(r[n])?r[n].apply(r,a):r;return s!==r&&s!==t?(o=s,!1):void 0}:function(){var t=e(this).data(i);t?t.option(n||{}):e(this).data(i,new e.jPlayer(n,this))}),o},e.jPlayer=function(t,n){if(arguments.length){this.element=e(n),this.options=e.extend(!0,{},this.options,t);var i=this;this.element.bind("remove.jPlayer",(function(){i.destroy()})),this._init()}},"function"!=typeof e.fn.stop&&(e.fn.stop=function(){}),e.jPlayer.emulateMethods="load play pause",e.jPlayer.emulateStatus="src readyState networkState currentTime duration paused ended playbackRate",e.jPlayer.emulateOptions="muted volume",e.jPlayer.reservedEvent="ready flashreset resize repeat error warning",e.jPlayer.event={},e.each(["ready","setmedia","flashreset","resize","repeat","click","error","warning","loadstart","progress","suspend","abort","emptied","stalled","play","pause","loadedmetadata","loadeddata","waiting","playing","canplay","canplaythrough","seeking","seeked","timeupdate","ended","ratechange","durationchange","volumechange"],(function(){e.jPlayer.event[this]="jPlayer_"+this})),e.jPlayer.htmlEvent=["loadstart","abort","emptied","stalled","loadedmetadata","canplay","canplaythrough"],e.jPlayer.pause=function(){e.jPlayer.prototype.destroyRemoved(),e.each(e.jPlayer.prototype.instances,(function(e,t){t.data("jPlayer").status.srcSet&&t.jPlayer("pause")}))},e.jPlayer.timeFormat={showHour:!1,showMin:!0,showSec:!0,padHour:!1,padMin:!0,padSec:!0,sepHour:":",sepMin:":",sepSec:""};var n=function(){this.init()};n.prototype={init:function(){this.options={timeFormat:e.jPlayer.timeFormat}},time:function(e){e=e&&"number"==typeof e?e:0;var t=new Date(1e3*e),n=t.getUTCHours(),i=this.options.timeFormat.showHour?t.getUTCMinutes():t.getUTCMinutes()+60*n,r=this.options.timeFormat.showMin?t.getUTCSeconds():t.getUTCSeconds()+60*i,a=this.options.timeFormat.padHour&&10>n?"0"+n:n,o=this.options.timeFormat.padMin&&10>i?"0"+i:i,s=this.options.timeFormat.padSec&&10>r?"0"+r:r,l="";return l+=this.options.timeFormat.showHour?a+this.options.timeFormat.sepHour:"",(l+=this.options.timeFormat.showMin?o+this.options.timeFormat.sepMin:"")+(this.options.timeFormat.showSec?s+this.options.timeFormat.sepSec:"")}};var i=new n;e.jPlayer.convertTime=function(e){return i.time(e)},e.jPlayer.uaBrowser=function(e){var t=e.toLowerCase(),n=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,r=/(mozilla)(?:.*? rv:([\w.]+))?/,a=/(webkit)[ \/]([\w.]+)/.exec(t)||n.exec(t)||i.exec(t)||t.indexOf("compatible")<0&&r.exec(t)||[];return{browser:a[1]||"",version:a[2]||"0"}},e.jPlayer.uaPlatform=function(e){var t=e.toLowerCase(),n=/(ipad|playbook)/,i=/(android)/,r=/(mobile)/,a=/(ipad|iphone|ipod|android|blackberry|playbook|windows ce|webos)/.exec(t)||[],o=n.exec(t)||!r.exec(t)&&i.exec(t)||[];return a[1]&&(a[1]=a[1].replace(/\s/g,"_")),{platform:a[1]||"",tablet:o[1]||""}},e.jPlayer.browser={},e.jPlayer.platform={};var r=e.jPlayer.uaBrowser(navigator.userAgent);r.browser&&(e.jPlayer.browser[r.browser]=!0,e.jPlayer.browser.version=r.version);var a=e.jPlayer.uaPlatform(navigator.userAgent);a.platform&&(e.jPlayer.platform[a.platform]=!0,e.jPlayer.platform.mobile=!a.tablet,e.jPlayer.platform.tablet=!!a.tablet),e.jPlayer.getDocMode=function(){var t;return e.jPlayer.browser.msie&&(document.documentMode?t=document.documentMode:(t=5,document.compatMode&&"CSS1Compat"===document.compatMode&&(t=7))),t},e.jPlayer.browser.documentMode=e.jPlayer.getDocMode(),e.jPlayer.nativeFeatures={init:function(){var e,t,n,i=document,r=i.createElement("video"),a={w3c:["fullscreenEnabled","fullscreenElement","requestFullscreen","exitFullscreen","fullscreenchange","fullscreenerror"],moz:["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror"],webkit:["","webkitCurrentFullScreenElement","webkitRequestFullScreen","webkitCancelFullScreen","webkitfullscreenchange",""],webkitVideo:["webkitSupportsFullscreen","webkitDisplayingFullscreen","webkitEnterFullscreen","webkitExitFullscreen","",""],ms:["","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError"]},o=["w3c","moz","webkit","webkitVideo","ms"];for(this.fullscreen=e={support:{w3c:!!i[a.w3c[0]],moz:!!i[a.moz[0]],webkit:"function"==typeof i[a.webkit[3]],webkitVideo:"function"==typeof r[a.webkitVideo[2]],ms:"function"==typeof r[a.ms[2]]},used:{}},t=0,n=o.length;n>t;t++){var s=o[t];if(e.support[s]){e.spec=s,e.used[s]=!0;break}}if(e.spec){var l=a[e.spec];e.api={fullscreenEnabled:!0,fullscreenElement:function(e){return(e=e||i)[l[1]]},requestFullscreen:function(e){return e[l[2]]()},exitFullscreen:function(e){return(e=e||i)[l[3]]()}},e.event={fullscreenchange:l[4],fullscreenerror:l[5]}}else e.api={fullscreenEnabled:!1,fullscreenElement:function(){return null},requestFullscreen:function(){},exitFullscreen:function(){}},e.event={}}},e.jPlayer.nativeFeatures.init(),e.jPlayer.focus=null,e.jPlayer.keyIgnoreElementNames="A INPUT TEXTAREA SELECT BUTTON";var o=function(t){var n,i=e.jPlayer.focus;i&&(e.each(e.jPlayer.keyIgnoreElementNames.split(/\s+/g),(function(e,i){return t.target.nodeName.toUpperCase()===i.toUpperCase()?(n=!0,!1):void 0})),n||e.each(i.options.keyBindings,(function(n,r){return r&&e.isFunction(r.fn)&&("number"==typeof r.key&&t.which===r.key||"string"==typeof r.key&&t.key===r.key)?(t.preventDefault(),r.fn(i),!1):void 0})))};e.jPlayer.keys=function(t){var n="keydown.jPlayer";e(document.documentElement).unbind(n),t&&e(document.documentElement).bind(n,o)},e.jPlayer.keys(!0),e.jPlayer.prototype={count:0,version:{script:"2.9.2",needFlash:"2.9.0",flash:"unknown"},options:{swfPath:"js",solution:"html, flash",supplied:"mp3",auroraFormats:"wav",preload:"metadata",volume:.8,muted:!1,remainingDuration:!1,toggleDuration:!1,captureDuration:!0,playbackRate:1,defaultPlaybackRate:1,minPlaybackRate:.5,maxPlaybackRate:4,wmode:"opaque",backgroundColor:"#000000",cssSelectorAncestor:"#jp_container_1",cssSelector:{videoPlay:".jp-video-play",play:".jp-play",pause:".jp-pause",stop:".jp-stop",seekBar:".jp-seek-bar",playBar:".jp-play-bar",mute:".jp-mute",unmute:".jp-unmute",volumeBar:".jp-volume-bar",volumeBarValue:".jp-volume-bar-value",volumeMax:".jp-volume-max",playbackRateBar:".jp-playback-rate-bar",playbackRateBarValue:".jp-playback-rate-bar-value",currentTime:".jp-current-time",duration:".jp-duration",title:".jp-title",fullScreen:".jp-full-screen",restoreScreen:".jp-restore-screen",repeat:".jp-repeat",repeatOff:".jp-repeat-off",gui:".jp-gui",noSolution:".jp-no-solution"},stateClass:{playing:"jp-state-playing",seeking:"jp-state-seeking",muted:"jp-state-muted",looped:"jp-state-looped",fullScreen:"jp-state-full-screen",noVolume:"jp-state-no-volume"},useStateClassSkin:!1,autoBlur:!0,smoothPlayBar:!1,fullScreen:!1,fullWindow:!1,autohide:{restored:!1,full:!0,fadeIn:200,fadeOut:600,hold:1e3},loop:!1,repeat:function(t){t.jPlayer.options.loop?e(this).unbind(".jPlayerRepeat").bind(e.jPlayer.event.ended+".jPlayer.jPlayerRepeat",(function(){e(this).jPlayer("play")})):e(this).unbind(".jPlayerRepeat")},nativeVideoControls:{},noFullWindow:{msie:/msie [0-6]\./,ipad:/ipad.*?os [0-4]\./,iphone:/iphone/,ipod:/ipod/,android_pad:/android [0-3]\.(?!.*?mobile)/,android_phone:/(?=.*android)(?!.*chrome)(?=.*mobile)/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/},noVolume:{ipad:/ipad/,iphone:/iphone/,ipod:/ipod/,android_pad:/android(?!.*?mobile)/,android_phone:/android.*?mobile/,blackberry:/blackberry/,windows_ce:/windows ce/,iemobile:/iemobile/,webos:/webos/,playbook:/playbook/},timeFormat:{},keyEnabled:!1,audioFullScreen:!1,keyBindings:{play:{key:80,fn:function(e){e.status.paused?e.play():e.pause()}},fullScreen:{key:70,fn:function(e){(e.status.video||e.options.audioFullScreen)&&e._setOption("fullScreen",!e.options.fullScreen)}},muted:{key:77,fn:function(e){e._muted(!e.options.muted)}},volumeUp:{key:190,fn:function(e){e.volume(e.options.volume+.1)}},volumeDown:{key:188,fn:function(e){e.volume(e.options.volume-.1)}},loop:{key:76,fn:function(e){e._loop(!e.options.loop)}}},verticalVolume:!1,verticalPlaybackRate:!1,globalVolume:!1,idPrefix:"jp",noConflict:"jQuery",emulateHtml:!1,consoleAlerts:!0,errorAlerts:!1,warningAlerts:!1},optionsAudio:{size:{width:"0px",height:"0px",cssClass:""},sizeFull:{width:"0px",height:"0px",cssClass:""}},optionsVideo:{size:{width:"480px",height:"270px",cssClass:"jp-video-270p"},sizeFull:{width:"100%",height:"100%",cssClass:"jp-video-full"}},instances:{},status:{src:"",media:{},paused:!0,format:{},formatType:"",waitForPlay:!0,waitForLoad:!0,srcSet:!1,video:!1,seekPercent:0,currentPercentRelative:0,currentPercentAbsolute:0,currentTime:0,duration:0,remaining:0,videoWidth:0,videoHeight:0,readyState:0,networkState:0,playbackRate:1,ended:0},internal:{ready:!1},solution:{html:!0,aurora:!0,flash:!0},format:{mp3:{codec:"audio/mpeg",flashCanPlay:!0,media:"audio"},m4a:{codec:'audio/mp4; codecs="mp4a.40.2"',flashCanPlay:!0,media:"audio"},m3u8a:{codec:'application/vnd.apple.mpegurl; codecs="mp4a.40.2"',flashCanPlay:!1,media:"audio"},m3ua:{codec:"audio/mpegurl",flashCanPlay:!1,media:"audio"},oga:{codec:'audio/ogg; codecs="vorbis, opus"',flashCanPlay:!1,media:"audio"},flac:{codec:"audio/x-flac",flashCanPlay:!1,media:"audio"},wav:{codec:'audio/wav; codecs="1"',flashCanPlay:!1,media:"audio"},webma:{codec:'audio/webm; codecs="vorbis"',flashCanPlay:!1,media:"audio"},fla:{codec:"audio/x-flv",flashCanPlay:!0,media:"audio"},rtmpa:{codec:'audio/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"audio"},m4v:{codec:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!0,media:"video"},m3u8v:{codec:'application/vnd.apple.mpegurl; codecs="avc1.42E01E, mp4a.40.2"',flashCanPlay:!1,media:"video"},m3uv:{codec:"audio/mpegurl",flashCanPlay:!1,media:"video"},ogv:{codec:'video/ogg; codecs="theora, vorbis"',flashCanPlay:!1,media:"video"},webmv:{codec:'video/webm; codecs="vorbis, vp8"',flashCanPlay:!1,media:"video"},flv:{codec:"video/x-flv",flashCanPlay:!0,media:"video"},rtmpv:{codec:'video/rtmp; codecs="rtmp"',flashCanPlay:!0,media:"video"}},_init:function(){var n=this;if(this.element.empty(),this.status=e.extend({},this.status),this.internal=e.extend({},this.internal),this.options.timeFormat=e.extend({},e.jPlayer.timeFormat,this.options.timeFormat),this.internal.cmdsIgnored=e.jPlayer.platform.ipad||e.jPlayer.platform.iphone||e.jPlayer.platform.ipod,this.internal.domNode=this.element.get(0),this.options.keyEnabled&&!e.jPlayer.focus&&(e.jPlayer.focus=this),this.androidFix={setMedia:!1,play:!1,pause:!1,time:NaN},e.jPlayer.platform.android&&(this.options.preload="auto"!==this.options.preload?"metadata":"auto"),this.formats=[],this.solutions=[],this.require={},this.htmlElement={},this.html={},this.html.audio={},this.html.video={},this.aurora={},this.aurora.formats=[],this.aurora.properties=[],this.flash={},this.css={},this.css.cs={},this.css.jq={},this.ancestorJq=[],this.options.volume=this._limitValue(this.options.volume,0,1),e.each(this.options.supplied.toLowerCase().split(","),(function(t,i){var r=i.replace(/^\s+|\s+$/g,"");if(n.format[r]){var a=!1;e.each(n.formats,(function(e,t){return r===t?(a=!0,!1):void 0})),a||n.formats.push(r)}})),e.each(this.options.solution.toLowerCase().split(","),(function(t,i){var r=i.replace(/^\s+|\s+$/g,"");if(n.solution[r]){var a=!1;e.each(n.solutions,(function(e,t){return r===t?(a=!0,!1):void 0})),a||n.solutions.push(r)}})),e.each(this.options.auroraFormats.toLowerCase().split(","),(function(t,i){var r=i.replace(/^\s+|\s+$/g,"");if(n.format[r]){var a=!1;e.each(n.aurora.formats,(function(e,t){return r===t?(a=!0,!1):void 0})),a||n.aurora.formats.push(r)}})),this.internal.instance="jp_"+this.count,this.instances[this.internal.instance]=this.element,this.element.attr("id")||this.element.attr("id",this.options.idPrefix+"_jplayer_"+this.count),this.internal.self=e.extend({},{id:this.element.attr("id"),jq:this.element}),this.internal.audio=e.extend({},{id:this.options.idPrefix+"_audio_"+this.count,jq:t}),this.internal.video=e.extend({},{id:this.options.idPrefix+"_video_"+this.count,jq:t}),this.internal.flash=e.extend({},{id:this.options.idPrefix+"_flash_"+this.count,jq:t,swf:this.options.swfPath+(".swf"!==this.options.swfPath.toLowerCase().slice(-4)?(this.options.swfPath&&"/"!==this.options.swfPath.slice(-1)?"/":"")+"jquery.jplayer.swf":"")}),this.internal.poster=e.extend({},{id:this.options.idPrefix+"_poster_"+this.count,jq:t}),e.each(e.jPlayer.event,(function(e,i){n.options[e]!==t&&(n.element.bind(i+".jPlayer",n.options[e]),n.options[e]=t)})),this.require.audio=!1,this.require.video=!1,e.each(this.formats,(function(e,t){
n.require[n.format[t].media]=!0})),this.options=this.require.video?e.extend(!0,{},this.optionsVideo,this.options):e.extend(!0,{},this.optionsAudio,this.options),this._setSize(),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow),this.status.noVolume=this._uaBlocklist(this.options.noVolume),e.jPlayer.nativeFeatures.fullscreen.api.fullscreenEnabled&&this._fullscreenAddEventListeners(),this._restrictNativeVideoControls(),this.htmlElement.poster=document.createElement("img"),this.htmlElement.poster.id=this.internal.poster.id,this.htmlElement.poster.onload=function(){(!n.status.video||n.status.waitForPlay)&&n.internal.poster.jq.show()},this.element.append(this.htmlElement.poster),this.internal.poster.jq=e("#"+this.internal.poster.id),this.internal.poster.jq.css({width:this.status.width,height:this.status.height}),this.internal.poster.jq.hide(),this.internal.poster.jq.bind("click.jPlayer",(function(){n._trigger(e.jPlayer.event.click)})),this.html.audio.available=!1,this.require.audio&&(this.htmlElement.audio=document.createElement("audio"),this.htmlElement.audio.id=this.internal.audio.id,this.html.audio.available=!!this.htmlElement.audio.canPlayType&&this._testCanPlayType(this.htmlElement.audio)),this.html.video.available=!1,this.require.video&&(this.htmlElement.video=document.createElement("video"),this.htmlElement.video.id=this.internal.video.id,this.html.video.available=!!this.htmlElement.video.canPlayType&&this._testCanPlayType(this.htmlElement.video)),this.flash.available=this._checkForFlash(10.1),this.html.canPlay={},this.aurora.canPlay={},this.flash.canPlay={},e.each(this.formats,(function(t,i){n.html.canPlay[i]=n.html[n.format[i].media].available&&""!==n.htmlElement[n.format[i].media].canPlayType(n.format[i].codec),n.aurora.canPlay[i]=e.inArray(i,n.aurora.formats)>-1,n.flash.canPlay[i]=n.format[i].flashCanPlay&&n.flash.available})),this.html.desired=!1,this.aurora.desired=!1,this.flash.desired=!1,e.each(this.solutions,(function(t,i){if(0===t)n[i].desired=!0;else{var r=!1,a=!1;e.each(n.formats,(function(e,t){n[n.solutions[0]].canPlay[t]&&("video"===n.format[t].media?a=!0:r=!0)})),n[i].desired=n.require.audio&&!r||n.require.video&&!a}})),this.html.support={},this.aurora.support={},this.flash.support={},e.each(this.formats,(function(e,t){n.html.support[t]=n.html.canPlay[t]&&n.html.desired,n.aurora.support[t]=n.aurora.canPlay[t]&&n.aurora.desired,n.flash.support[t]=n.flash.canPlay[t]&&n.flash.desired})),this.html.used=!1,this.aurora.used=!1,this.flash.used=!1,e.each(this.solutions,(function(t,i){e.each(n.formats,(function(e,t){return n[i].support[t]?(n[i].used=!0,!1):void 0}))})),this._resetActive(),this._resetGate(),this._cssSelectorAncestor(this.options.cssSelectorAncestor),this.html.used||this.aurora.used||this.flash.used?this.css.jq.noSolution.length&&this.css.jq.noSolution.hide():(this._error({type:e.jPlayer.error.NO_SOLUTION,context:"{solution:'"+this.options.solution+"', supplied:'"+this.options.supplied+"'}",message:e.jPlayer.errorMsg.NO_SOLUTION,hint:e.jPlayer.errorHint.NO_SOLUTION}),this.css.jq.noSolution.length&&this.css.jq.noSolution.show()),this.flash.used){var i,r="jQuery="+encodeURI(this.options.noConflict)+"&id="+encodeURI(this.internal.self.id)+"&vol="+this.options.volume+"&muted="+this.options.muted;if(e.jPlayer.browser.msie&&(Number(e.jPlayer.browser.version)<9||e.jPlayer.browser.documentMode<9)){var a='<object id="'+this.internal.flash.id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="0" height="0" tabindex="-1"></object>',o=['<param name="movie" value="'+this.internal.flash.swf+'" />','<param name="FlashVars" value="'+r+'" />','<param name="allowScriptAccess" value="always" />','<param name="bgcolor" value="'+this.options.backgroundColor+'" />','<param name="wmode" value="'+this.options.wmode+'" />'];i=document.createElement(a);for(var s=0;s<o.length;s++)i.appendChild(document.createElement(o[s]))}else{var l=function(e,t,n){var i=document.createElement("param");i.setAttribute("name",t),i.setAttribute("value",n),e.appendChild(i)};(i=document.createElement("object")).setAttribute("id",this.internal.flash.id),i.setAttribute("name",this.internal.flash.id),i.setAttribute("data",this.internal.flash.swf),i.setAttribute("type","application/x-shockwave-flash"),i.setAttribute("width","1"),i.setAttribute("height","1"),i.setAttribute("tabindex","-1"),l(i,"flashvars",r),l(i,"allowscriptaccess","always"),l(i,"bgcolor",this.options.backgroundColor),l(i,"wmode",this.options.wmode)}this.element.append(i),this.internal.flash.jq=e(i)}this.status.playbackRateEnabled=!(!this.html.used||this.flash.used)&&this._testPlaybackRate("audio"),this._updatePlaybackRate(),this.html.used&&(this.html.audio.available&&(this._addHtmlEventListeners(this.htmlElement.audio,this.html.audio),this.element.append(this.htmlElement.audio),this.internal.audio.jq=e("#"+this.internal.audio.id)),this.html.video.available&&(this._addHtmlEventListeners(this.htmlElement.video,this.html.video),this.element.append(this.htmlElement.video),this.internal.video.jq=e("#"+this.internal.video.id),this.internal.video.jq.css(this.status.nativeVideoControls?{width:this.status.width,height:this.status.height}:{width:"0px",height:"0px"}),this.internal.video.jq.bind("click.jPlayer",(function(){n._trigger(e.jPlayer.event.click)})))),this.aurora.used,this.options.emulateHtml&&this._emulateHtmlBridge(),!this.html.used&&!this.aurora.used||this.flash.used||setTimeout((function(){n.internal.ready=!0,n.version.flash="n/a",n._trigger(e.jPlayer.event.repeat),n._trigger(e.jPlayer.event.ready)}),100),this._updateNativeVideoControls(),this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),e.jPlayer.prototype.count++},destroy:function(){this.clearMedia(),this._removeUiClass(),this.css.jq.currentTime.length&&this.css.jq.currentTime.text(""),this.css.jq.duration.length&&this.css.jq.duration.text(""),e.each(this.css.jq,(function(e,t){t.length&&t.unbind(".jPlayer")})),this.internal.poster.jq.unbind(".jPlayer"),this.internal.video.jq&&this.internal.video.jq.unbind(".jPlayer"),this._fullscreenRemoveEventListeners(),this===e.jPlayer.focus&&(e.jPlayer.focus=null),this.options.emulateHtml&&this._destroyHtmlBridge(),this.element.removeData("jPlayer"),this.element.unbind(".jPlayer"),this.element.empty(),delete this.instances[this.internal.instance]},destroyRemoved:function(){var t=this;e.each(this.instances,(function(e,n){t.element!==n&&(n.data("jPlayer")||(n.jPlayer("destroy"),delete t.instances[e]))}))},enable:function(){},disable:function(){},_testCanPlayType:function(e){try{return e.canPlayType(this.format.mp3.codec),!0}catch(e){return!1}},_testPlaybackRate:function(e){var t,n=.5;e="string"==typeof e?e:"audio",t=document.createElement(e);try{return"playbackRate"in t&&(t.playbackRate=n,t.playbackRate===n)}catch(e){return!1}},_uaBlocklist:function(t){var n=navigator.userAgent.toLowerCase(),i=!1;return e.each(t,(function(e,t){return t&&t.test(n)?(i=!0,!1):void 0})),i},_restrictNativeVideoControls:function(){this.require.audio&&this.status.nativeVideoControls&&(this.status.nativeVideoControls=!1,this.status.noFullWindow=!0)},_updateNativeVideoControls:function(){this.html.video.available&&this.html.used&&(this.htmlElement.video.controls=this.status.nativeVideoControls,this._updateAutohide(),this.status.nativeVideoControls&&this.require.video?(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})):this.status.waitForPlay&&this.status.video&&(this.internal.poster.jq.show(),this.internal.video.jq.css({width:"0px",height:"0px"})))},_addHtmlEventListeners:function(t,n){var i=this;t.preload=this.options.preload,t.muted=this.options.muted,t.volume=this.options.volume,this.status.playbackRateEnabled&&(t.defaultPlaybackRate=this.options.defaultPlaybackRate,t.playbackRate=this.options.playbackRate),t.addEventListener("progress",(function(){n.gate&&(i.internal.cmdsIgnored&&this.readyState>0&&(i.internal.cmdsIgnored=!1),i._getHtmlStatus(t),i._updateInterface(),i._trigger(e.jPlayer.event.progress))}),!1),t.addEventListener("loadeddata",(function(){n.gate&&(i.androidFix.setMedia=!1,i.androidFix.play&&(i.androidFix.play=!1,i.play(i.androidFix.time)),i.androidFix.pause&&(i.androidFix.pause=!1,i.pause(i.androidFix.time)),i._trigger(e.jPlayer.event.loadeddata))}),!1),t.addEventListener("timeupdate",(function(){n.gate&&(i._getHtmlStatus(t),i._updateInterface(),i._trigger(e.jPlayer.event.timeupdate))}),!1),t.addEventListener("durationchange",(function(){n.gate&&(i._getHtmlStatus(t),i._updateInterface(),i._trigger(e.jPlayer.event.durationchange))}),!1),t.addEventListener("play",(function(){n.gate&&(i._updateButtons(!0),i._html_checkWaitForPlay(),i._trigger(e.jPlayer.event.play))}),!1),t.addEventListener("playing",(function(){n.gate&&(i._updateButtons(!0),i._seeked(),i._trigger(e.jPlayer.event.playing))}),!1),t.addEventListener("pause",(function(){n.gate&&(i._updateButtons(!1),i._trigger(e.jPlayer.event.pause))}),!1),t.addEventListener("waiting",(function(){n.gate&&(i._seeking(),i._trigger(e.jPlayer.event.waiting))}),!1),t.addEventListener("seeking",(function(){n.gate&&(i._seeking(),i._trigger(e.jPlayer.event.seeking))}),!1),t.addEventListener("seeked",(function(){n.gate&&(i._seeked(),i._trigger(e.jPlayer.event.seeked))}),!1),t.addEventListener("volumechange",(function(){n.gate&&(i.options.volume=t.volume,i.options.muted=t.muted,i._updateMute(),i._updateVolume(),i._trigger(e.jPlayer.event.volumechange))}),!1),t.addEventListener("ratechange",(function(){n.gate&&(i.options.defaultPlaybackRate=t.defaultPlaybackRate,i.options.playbackRate=t.playbackRate,i._updatePlaybackRate(),i._trigger(e.jPlayer.event.ratechange))}),!1),t.addEventListener("suspend",(function(){n.gate&&(i._seeked(),i._trigger(e.jPlayer.event.suspend))}),!1),t.addEventListener("ended",(function(){n.gate&&(e.jPlayer.browser.webkit||(i.htmlElement.media.currentTime=0),i.htmlElement.media.pause(),i._updateButtons(!1),i._getHtmlStatus(t,!0),i._updateInterface(),i._trigger(e.jPlayer.event.ended))}),!1),t.addEventListener("error",(function(){n.gate&&(i._updateButtons(!1),i._seeked(),i.status.srcSet&&(clearTimeout(i.internal.htmlDlyCmdId),i.status.waitForLoad=!0,i.status.waitForPlay=!0,i.status.video&&!i.status.nativeVideoControls&&i.internal.video.jq.css({width:"0px",height:"0px"}),i._validString(i.status.media.poster)&&!i.status.nativeVideoControls&&i.internal.poster.jq.show(),i.css.jq.videoPlay.length&&i.css.jq.videoPlay.show(),i._error({type:e.jPlayer.error.URL,context:i.status.src,message:e.jPlayer.errorMsg.URL,hint:e.jPlayer.errorHint.URL})))}),!1),e.each(e.jPlayer.htmlEvent,(function(r,a){t.addEventListener(this,(function(){n.gate&&i._trigger(e.jPlayer.event[a])}),!1)}))},_addAuroraEventListeners:function(t,n){var i=this;t.volume=100*this.options.volume,t.on("progress",(function(){n.gate&&(i.internal.cmdsIgnored&&this.readyState>0&&(i.internal.cmdsIgnored=!1),i._getAuroraStatus(t),i._updateInterface(),i._trigger(e.jPlayer.event.progress),t.duration>0&&i._trigger(e.jPlayer.event.timeupdate))}),!1),t.on("ready",(function(){n.gate&&i._trigger(e.jPlayer.event.loadeddata)}),!1),t.on("duration",(function(){n.gate&&(i._getAuroraStatus(t),i._updateInterface(),i._trigger(e.jPlayer.event.durationchange))}),!1),t.on("end",(function(){n.gate&&(i._updateButtons(!1),i._getAuroraStatus(t,!0),i._updateInterface(),i._trigger(e.jPlayer.event.ended))}),!1),t.on("error",(function(){n.gate&&(i._updateButtons(!1),i._seeked(),i.status.srcSet&&(i.status.waitForLoad=!0,i.status.waitForPlay=!0,i.status.video&&!i.status.nativeVideoControls&&i.internal.video.jq.css({width:"0px",height:"0px"}),i._validString(i.status.media.poster)&&!i.status.nativeVideoControls&&i.internal.poster.jq.show(),i.css.jq.videoPlay.length&&i.css.jq.videoPlay.show(),i._error({type:e.jPlayer.error.URL,context:i.status.src,message:e.jPlayer.errorMsg.URL,hint:e.jPlayer.errorHint.URL})))}),!1)},_getHtmlStatus:function(e,t){var n=0,i=0,r=0,a=0;isFinite(e.duration)&&(this.status.duration=e.duration),n=e.currentTime,i=this.status.duration>0?100*n/this.status.duration:0,"object"==typeof e.seekable&&e.seekable.length>0?(r=this.status.duration>0?100*e.seekable.end(e.seekable.length-1)/this.status.duration:100,a=this.status.duration>0?100*e.currentTime/e.seekable.end(e.seekable.length-1):0):(r=100,a=i),t&&(n=0,a=0,i=0),this.status.seekPercent=r,this.status.currentPercentRelative=a,this.status.currentPercentAbsolute=i,this.status.currentTime=n,this.status.remaining=this.status.duration-this.status.currentTime,this.status.videoWidth=e.videoWidth,this.status.videoHeight=e.videoHeight,this.status.readyState=e.readyState,this.status.networkState=e.networkState,this.status.playbackRate=e.playbackRate,this.status.ended=e.ended},_getAuroraStatus:function(e,t){var n=0,i=0,r=0,a=0;this.status.duration=e.duration/1e3,n=e.currentTime/1e3,i=this.status.duration>0?100*n/this.status.duration:0,e.buffered>0?(r=this.status.duration>0?e.buffered*this.status.duration/this.status.duration:100,a=this.status.duration>0?n/(e.buffered*this.status.duration):0):(r=100,a=i),t&&(n=0,a=0,i=0),this.status.seekPercent=r,this.status.currentPercentRelative=a,this.status.currentPercentAbsolute=i,this.status.currentTime=n,this.status.remaining=this.status.duration-this.status.currentTime,this.status.readyState=4,this.status.networkState=0,this.status.playbackRate=1,this.status.ended=!1},_resetStatus:function(){this.status=e.extend({},this.status,e.jPlayer.prototype.status)},_trigger:function(t,n,i){var r=e.Event(t);r.jPlayer={},r.jPlayer.version=e.extend({},this.version),r.jPlayer.options=e.extend(!0,{},this.options),r.jPlayer.status=e.extend(!0,{},this.status),r.jPlayer.html=e.extend(!0,{},this.html),r.jPlayer.aurora=e.extend(!0,{},this.aurora),r.jPlayer.flash=e.extend(!0,{},this.flash),n&&(r.jPlayer.error=e.extend({},n)),i&&(r.jPlayer.warning=e.extend({},i)),this.element.trigger(r)},jPlayerFlashEvent:function(t,n){if(t===e.jPlayer.event.ready)if(this.internal.ready){if(this.flash.gate){if(this.status.srcSet){var i=this.status.currentTime,r=this.status.paused;this.setMedia(this.status.media),this.volumeWorker(this.options.volume),i>0&&(r?this.pause(i):this.play(i))}this._trigger(e.jPlayer.event.flashreset)}}else this.internal.ready=!0,this.internal.flash.jq.css({width:"0px",height:"0px"}),this.version.flash=n.version,this.version.needFlash!==this.version.flash&&this._error({type:e.jPlayer.error.VERSION,context:this.version.flash,message:e.jPlayer.errorMsg.VERSION+this.version.flash,hint:e.jPlayer.errorHint.VERSION}),this._trigger(e.jPlayer.event.repeat),this._trigger(t);if(this.flash.gate)switch(t){case e.jPlayer.event.progress:case e.jPlayer.event.timeupdate:this._getFlashStatus(n),this._updateInterface(),this._trigger(t);break;case e.jPlayer.event.play:this._seeked(),this._updateButtons(!0),this._trigger(t);break;case e.jPlayer.event.pause:case e.jPlayer.event.ended:this._updateButtons(!1),this._trigger(t);break;case e.jPlayer.event.click:this._trigger(t);break;case e.jPlayer.event.error:this.status.waitForLoad=!0,this.status.waitForPlay=!0,this.status.video&&this.internal.flash.jq.css({width:"0px",height:"0px"}),this._validString(this.status.media.poster)&&this.internal.poster.jq.show(),this.css.jq.videoPlay.length&&this.status.video&&this.css.jq.videoPlay.show(),this.status.video?this._flash_setVideo(this.status.media):this._flash_setAudio(this.status.media),this._updateButtons(!1),this._error({type:e.jPlayer.error.URL,context:n.src,message:e.jPlayer.errorMsg.URL,hint:e.jPlayer.errorHint.URL});break;case e.jPlayer.event.seeking:this._seeking(),this._trigger(t);break;case e.jPlayer.event.seeked:this._seeked(),this._trigger(t);break;case e.jPlayer.event.ready:break;default:this._trigger(t)}return!1},_getFlashStatus:function(e){this.status.seekPercent=e.seekPercent,this.status.currentPercentRelative=e.currentPercentRelative,this.status.currentPercentAbsolute=e.currentPercentAbsolute,this.status.currentTime=e.currentTime,this.status.duration=e.duration,this.status.remaining=e.duration-e.currentTime,this.status.videoWidth=e.videoWidth,this.status.videoHeight=e.videoHeight,this.status.readyState=4,this.status.networkState=0,this.status.playbackRate=1,this.status.ended=!1},_updateButtons:function(e){e===t?e=!this.status.paused:this.status.paused=!e,e?this.addStateClass("playing"):this.removeStateClass("playing"),!this.status.noFullWindow&&this.options.fullWindow?this.addStateClass("fullScreen"):this.removeStateClass("fullScreen"),this.options.loop?this.addStateClass("looped"):this.removeStateClass("looped"),this.css.jq.play.length&&this.css.jq.pause.length&&(e?(this.css.jq.play.hide(),this.css.jq.pause.show()):(this.css.jq.play.show(),this.css.jq.pause.hide())),this.css.jq.restoreScreen.length&&this.css.jq.fullScreen.length&&(this.status.noFullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.hide()):this.options.fullWindow?(this.css.jq.fullScreen.hide(),this.css.jq.restoreScreen.show()):(this.css.jq.fullScreen.show(),this.css.jq.restoreScreen.hide())),this.css.jq.repeat.length&&this.css.jq.repeatOff.length&&(this.options.loop?(this.css.jq.repeat.hide(),this.css.jq.repeatOff.show()):(this.css.jq.repeat.show(),this.css.jq.repeatOff.hide()))},_updateInterface:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.width(this.status.seekPercent+"%"),this.css.jq.playBar.length&&(this.options.smoothPlayBar?this.css.jq.playBar.stop().animate({width:this.status.currentPercentAbsolute+"%"},250,"linear"):this.css.jq.playBar.width(this.status.currentPercentRelative+"%"));this.css.jq.currentTime.length&&(this._convertTime(this.status.currentTime)!==this.css.jq.currentTime.text()&&this.css.jq.currentTime.text(this._convertTime(this.status.currentTime)));var e="",t=this.status.duration,n=this.status.remaining;this.css.jq.duration.length&&("string"==typeof this.status.media.duration?e=this.status.media.duration:("number"==typeof this.status.media.duration&&(n=(t=this.status.media.duration)-this.status.currentTime),e=this.options.remainingDuration?(n>0?"-":"")+this._convertTime(n):this._convertTime(t)),e!==this.css.jq.duration.text()&&this.css.jq.duration.text(e))},_convertTime:n.prototype.time,_seeking:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.addClass("jp-seeking-bg"),this.addStateClass("seeking")},_seeked:function(){this.css.jq.seekBar.length&&this.css.jq.seekBar.removeClass("jp-seeking-bg"),this.removeStateClass("seeking")},_resetGate:function(){this.html.audio.gate=!1,this.html.video.gate=!1,this.aurora.gate=!1,this.flash.gate=!1},_resetActive:function(){this.html.active=!1,this.aurora.active=!1,this.flash.active=!1},_escapeHtml:function(e){return e.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;").split('"').join("&quot;")},_qualifyURL:function(e){var t=document.createElement("div");return t.innerHTML='<a href="'+this._escapeHtml(e)+'">x</a>',t.firstChild.href},_absoluteMediaUrls:function(t){var n=this;return e.each(t,(function(e,i){i&&n.format[e]&&"data:"!==i.substr(0,5)&&(t[e]=n._qualifyURL(i))})),t},addStateClass:function(e){this.ancestorJq.length&&this.ancestorJq.addClass(this.options.stateClass[e])},removeStateClass:function(e){this.ancestorJq.length&&this.ancestorJq.removeClass(this.options.stateClass[e])},setMedia:function(t){var n=this,i=!1,r=this.status.media.poster!==t.poster;this._resetMedia(),this._resetGate(),this._resetActive(),this.androidFix.setMedia=!1,this.androidFix.play=!1,this.androidFix.pause=!1,t=this._absoluteMediaUrls(t),e.each(this.formats,(function(r,a){var o="video"===n.format[a].media;return e.each(n.solutions,(function(r,s){if(n[s].support[a]&&n._validString(t[a])){var l="html"===s,d="aurora"===s;return o?(l?(n.html.video.gate=!0,n._html_setVideo(t),n.html.active=!0):(n.flash.gate=!0,n._flash_setVideo(t),n.flash.active=!0),n.css.jq.videoPlay.length&&n.css.jq.videoPlay.show(),n.status.video=!0):(l?(n.html.audio.gate=!0,n._html_setAudio(t),n.html.active=!0,e.jPlayer.platform.android&&(n.androidFix.setMedia=!0)):d?(n.aurora.gate=!0,n._aurora_setAudio(t),n.aurora.active=!0):(n.flash.gate=!0,n._flash_setAudio(t),n.flash.active=!0),n.css.jq.videoPlay.length&&n.css.jq.videoPlay.hide(),n.status.video=!1),i=!0,!1}})),!i&&void 0})),i?(this.status.nativeVideoControls&&this.html.video.gate||this._validString(t.poster)&&(r?this.htmlElement.poster.src=t.poster:this.internal.poster.jq.show()),"string"==typeof t.title&&(this.css.jq.title.length&&this.css.jq.title.html(t.title),this.htmlElement.audio&&this.htmlElement.audio.setAttribute("title",t.title),this.htmlElement.video&&this.htmlElement.video.setAttribute("title",t.title)),this.status.srcSet=!0,this.status.media=e.extend({},t),this._updateButtons(!1),this._updateInterface(),this._trigger(e.jPlayer.event.setmedia)):this._error({type:e.jPlayer.error.NO_SUPPORT,context:"{supplied:'"+this.options.supplied+"'}",message:e.jPlayer.errorMsg.NO_SUPPORT,hint:e.jPlayer.errorHint.NO_SUPPORT})},_resetMedia:function(){this._resetStatus(),this._updateButtons(!1),this._updateInterface(),this._seeked(),this.internal.poster.jq.hide(),clearTimeout(this.internal.htmlDlyCmdId),this.html.active?this._html_resetMedia():this.aurora.active?this._aurora_resetMedia():this.flash.active&&this._flash_resetMedia()},clearMedia:function(){this._resetMedia(),this.html.active?this._html_clearMedia():this.aurora.active?this._aurora_clearMedia():this.flash.active&&this._flash_clearMedia(),this._resetGate(),this._resetActive()},load:function(){this.status.srcSet?this.html.active?this._html_load():this.aurora.active?this._aurora_load():this.flash.active&&this._flash_load():this._urlNotSetError("load")},focus:function(){this.options.keyEnabled&&(e.jPlayer.focus=this)},play:function(e){"object"==typeof e&&this.options.useStateClassSkin&&!this.status.paused?this.pause(e):(e="number"==typeof e?e:NaN,this.status.srcSet?(this.focus(),this.html.active?this._html_play(e):this.aurora.active?this._aurora_play(e):this.flash.active&&this._flash_play(e)):this._urlNotSetError("play"))},videoPlay:function(){this.play()},pause:function(e){e="number"==typeof e?e:NaN,this.status.srcSet?this.html.active?this._html_pause(e):this.aurora.active?this._aurora_pause(e):this.flash.active&&this._flash_pause(e):this._urlNotSetError("pause")},tellOthers:function(t,n){var i=this,r="function"==typeof n,a=Array.prototype.slice.call(arguments);"string"==typeof t&&(r&&a.splice(1,1),e.jPlayer.prototype.destroyRemoved(),e.each(this.instances,(function(){i.element!==this&&(!r||n.call(this.data("jPlayer"),i))&&this.jPlayer.apply(this,a)})))},pauseOthers:function(e){this.tellOthers("pause",(function(){return this.status.srcSet}),e)},stop:function(){this.status.srcSet?this.html.active?this._html_pause(0):this.aurora.active?this._aurora_pause(0):this.flash.active&&this._flash_pause(0):this._urlNotSetError("stop")},playHead:function(e){e=this._limitValue(e,0,100),this.status.srcSet?this.html.active?this._html_playHead(e):this.aurora.active?this._aurora_playHead(e):this.flash.active&&this._flash_playHead(e):this._urlNotSetError("playHead")},_muted:function(e){this.mutedWorker(e),this.options.globalVolume&&this.tellOthers("mutedWorker",(function(){return this.options.globalVolume}),e)},mutedWorker:function(t){this.options.muted=t,this.html.used&&this._html_setProperty("muted",t),this.aurora.used&&this._aurora_mute(t),this.flash.used&&this._flash_mute(t),this.html.video.gate||this.html.audio.gate||(this._updateMute(t),this._updateVolume(this.options.volume),this._trigger(e.jPlayer.event.volumechange))},mute:function(e){"object"==typeof e&&this.options.useStateClassSkin&&this.options.muted?this._muted(!1):(e=e===t||!!e,this._muted(e))},unmute:function(e){e=e===t||!!e,this._muted(!e)},_updateMute:function(e){e===t&&(e=this.options.muted),e?this.addStateClass("muted"):this.removeStateClass("muted"),this.css.jq.mute.length&&this.css.jq.unmute.length&&(this.status.noVolume?(this.css.jq.mute.hide(),this.css.jq.unmute.hide()):e?(this.css.jq.mute.hide(),this.css.jq.unmute.show()):(this.css.jq.mute.show(),this.css.jq.unmute.hide()))},volume:function(e){this.volumeWorker(e),this.options.globalVolume&&this.tellOthers("volumeWorker",(function(){return this.options.globalVolume}),e)},volumeWorker:function(t){t=this._limitValue(t,0,1),this.options.volume=t,this.html.used&&this._html_setProperty("volume",t),this.aurora.used&&this._aurora_volume(t),this.flash.used&&this._flash_volume(t),this.html.video.gate||this.html.audio.gate||(this._updateVolume(t),this._trigger(e.jPlayer.event.volumechange))},volumeBar:function(t){if(this.css.jq.volumeBar.length){var n=e(t.currentTarget),i=n.offset(),r=t.pageX-i.left,a=n.width(),o=n.height()-t.pageY+i.top,s=n.height();this.volume(this.options.verticalVolume?o/s:r/a)}this.options.muted&&this._muted(!1)},_updateVolume:function(e){e===t&&(e=this.options.volume),e=this.options.muted?0:e,this.status.noVolume?(this.addStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.hide(),this.css.jq.volumeBarValue.length&&this.css.jq.volumeBarValue.hide(),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.hide()):(this.removeStateClass("noVolume"),this.css.jq.volumeBar.length&&this.css.jq.volumeBar.show(),this.css.jq.volumeBarValue.length&&(this.css.jq.volumeBarValue.show(),this.css.jq.volumeBarValue[this.options.verticalVolume?"height":"width"](100*e+"%")),this.css.jq.volumeMax.length&&this.css.jq.volumeMax.show())},volumeMax:function(){this.volume(1),this.options.muted&&this._muted(!1)},_cssSelectorAncestor:function(t){var n=this;this.options.cssSelectorAncestor=t,this._removeUiClass(),this.ancestorJq=t?e(t):[],t&&1!==this.ancestorJq.length&&this._warning({type:e.jPlayer.warning.CSS_SELECTOR_COUNT,context:t,message:e.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.ancestorJq.length+" found for cssSelectorAncestor.",hint:e.jPlayer.warningHint.CSS_SELECTOR_COUNT}),this._addUiClass(),e.each(this.options.cssSelector,(function(e,t){n._cssSelector(e,t)})),this._updateInterface(),this._updateButtons(),this._updateAutohide(),this._updateVolume(),this._updateMute()},_cssSelector:function(t,n){var i=this;if("string"==typeof n)if(e.jPlayer.prototype.options.cssSelector[t]){if(this.css.jq[t]&&this.css.jq[t].length&&this.css.jq[t].unbind(".jPlayer"),this.options.cssSelector[t]=n,this.css.cs[t]=this.options.cssSelectorAncestor+" "+n,this.css.jq[t]=n?e(this.css.cs[t]):[],this.css.jq[t].length&&this[t]){var r=function(n){n.preventDefault(),i[t](n),i.options.autoBlur?e(this).blur():e(this).focus()};this.css.jq[t].bind("click.jPlayer",r)}n&&1!==this.css.jq[t].length&&this._warning({type:e.jPlayer.warning.CSS_SELECTOR_COUNT,context:this.css.cs[t],message:e.jPlayer.warningMsg.CSS_SELECTOR_COUNT+this.css.jq[t].length+" found for "+t+" method.",hint:e.jPlayer.warningHint.CSS_SELECTOR_COUNT})}else this._warning({type:e.jPlayer.warning.CSS_SELECTOR_METHOD,context:t,message:e.jPlayer.warningMsg.CSS_SELECTOR_METHOD,hint:e.jPlayer.warningHint.CSS_SELECTOR_METHOD});else this._warning({type:e.jPlayer.warning.CSS_SELECTOR_STRING,context:n,message:e.jPlayer.warningMsg.CSS_SELECTOR_STRING,hint:e.jPlayer.warningHint.CSS_SELECTOR_STRING})},duration:function(e){this.options.toggleDuration&&(this.options.captureDuration&&e.stopPropagation(),this._setOption("remainingDuration",!this.options.remainingDuration))},seekBar:function(t){if(this.css.jq.seekBar.length){var n=e(t.currentTarget),i=n.offset(),r=100*(t.pageX-i.left)/n.width();this.playHead(r)}},playbackRate:function(e){this._setOption("playbackRate",e)},playbackRateBar:function(t){if(this.css.jq.playbackRateBar.length){var n,i=e(t.currentTarget),r=i.offset(),a=t.pageX-r.left,o=i.width(),s=i.height()-t.pageY+r.top,l=i.height();n=(this.options.verticalPlaybackRate?s/l:a/o)*(this.options.maxPlaybackRate-this.options.minPlaybackRate)+this.options.minPlaybackRate,this.playbackRate(n)}},_updatePlaybackRate:function(){var e=(this.options.playbackRate-this.options.minPlaybackRate)/(this.options.maxPlaybackRate-this.options.minPlaybackRate);this.status.playbackRateEnabled?(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.show(),this.css.jq.playbackRateBarValue.length&&(this.css.jq.playbackRateBarValue.show(),this.css.jq.playbackRateBarValue[this.options.verticalPlaybackRate?"height":"width"](100*e+"%"))):(this.css.jq.playbackRateBar.length&&this.css.jq.playbackRateBar.hide(),this.css.jq.playbackRateBarValue.length&&this.css.jq.playbackRateBarValue.hide())},repeat:function(e){var t="object"==typeof e;this._loop(!(t&&this.options.useStateClassSkin&&this.options.loop))},repeatOff:function(){this._loop(!1)},_loop:function(t){this.options.loop!==t&&(this.options.loop=t,this._updateButtons(),this._trigger(e.jPlayer.event.repeat))},option:function(n,i){var r=n;if(0===arguments.length)return e.extend(!0,{},this.options);if("string"==typeof n){var a=n.split(".");if(i===t){for(var o=e.extend(!0,{},this.options),s=0;s<a.length;s++){if(o[a[s]]===t)return this._warning({type:e.jPlayer.warning.OPTION_KEY,context:n,message:e.jPlayer.warningMsg.OPTION_KEY,hint:e.jPlayer.warningHint.OPTION_KEY}),t;o=o[a[s]]}return o}for(var l=r={},d=0;d<a.length;d++)d<a.length-1?(l[a[d]]={},l=l[a[d]]):l[a[d]]=i}return this._setOptions(r),this},_setOptions:function(t){var n=this;return e.each(t,(function(e,t){n._setOption(e,t)})),this},_setOption:function(t,n){var i=this;switch(t){case"volume":this.volume(n);break;case"muted":this._muted(n);break;case"globalVolume":this.options[t]=n;break;case"cssSelectorAncestor":this._cssSelectorAncestor(n);break;case"cssSelector":e.each(n,(function(e,t){i._cssSelector(e,t)}));break;case"playbackRate":this.options[t]=n=this._limitValue(n,this.options.minPlaybackRate,this.options.maxPlaybackRate),this.html.used&&this._html_setProperty("playbackRate",n),this._updatePlaybackRate();break;case"defaultPlaybackRate":this.options[t]=n=this._limitValue(n,this.options.minPlaybackRate,this.options.maxPlaybackRate),this.html.used&&this._html_setProperty("defaultPlaybackRate",n),this._updatePlaybackRate();break;case"minPlaybackRate":this.options[t]=n=this._limitValue(n,.1,this.options.maxPlaybackRate-.1),this._updatePlaybackRate();break;case"maxPlaybackRate":this.options[t]=n=this._limitValue(n,this.options.minPlaybackRate+.1,16),this._updatePlaybackRate();break;case"fullScreen":if(this.options[t]!==n){var r=e.jPlayer.nativeFeatures.fullscreen.used.webkitVideo;(!r||r&&!this.status.waitForPlay)&&(r||(this.options[t]=n),n?this._requestFullscreen():this._exitFullscreen(),r||this._setOption("fullWindow",n))}break;case"fullWindow":this.options[t]!==n&&(this._removeUiClass(),this.options[t]=n,this._refreshSize());break;case"size":this.options.fullWindow||this.options[t].cssClass===n.cssClass||this._removeUiClass(),this.options[t]=e.extend({},this.options[t],n),this._refreshSize();break;case"sizeFull":this.options.fullWindow&&this.options[t].cssClass!==n.cssClass&&this._removeUiClass(),this.options[t]=e.extend({},this.options[t],n),this._refreshSize();break;case"autohide":this.options[t]=e.extend({},this.options[t],n),this._updateAutohide();break;case"loop":this._loop(n);break;case"remainingDuration":this.options[t]=n,this._updateInterface();break;case"toggleDuration":this.options[t]=n;break;case"nativeVideoControls":this.options[t]=e.extend({},this.options[t],n),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this._restrictNativeVideoControls(),this._updateNativeVideoControls();break;case"noFullWindow":this.options[t]=e.extend({},this.options[t],n),this.status.nativeVideoControls=this._uaBlocklist(this.options.nativeVideoControls),this.status.noFullWindow=this._uaBlocklist(this.options.noFullWindow),this._restrictNativeVideoControls(),this._updateButtons();break;case"noVolume":this.options[t]=e.extend({},this.options[t],n),this.status.noVolume=this._uaBlocklist(this.options.noVolume),this._updateVolume(),this._updateMute();break;case"emulateHtml":this.options[t]!==n&&(this.options[t]=n,n?this._emulateHtmlBridge():this._destroyHtmlBridge());break;case"timeFormat":this.options[t]=e.extend({},this.options[t],n);break;case"keyEnabled":this.options[t]=n,n||this!==e.jPlayer.focus||(e.jPlayer.focus=null);break;case"keyBindings":this.options[t]=e.extend(!0,{},this.options[t],n);break;case"audioFullScreen":this.options[t]=n;break;case"autoBlur":this.options[t]=n}return this},_refreshSize:function(){this._setSize(),this._addUiClass(),this._updateSize(),this._updateButtons(),this._updateAutohide(),this._trigger(e.jPlayer.event.resize)},_setSize:function(){this.options.fullWindow?(this.status.width=this.options.sizeFull.width,this.status.height=this.options.sizeFull.height,
this.status.cssClass=this.options.sizeFull.cssClass):(this.status.width=this.options.size.width,this.status.height=this.options.size.height,this.status.cssClass=this.options.size.cssClass),this.element.css({width:this.status.width,height:this.status.height})},_addUiClass:function(){this.ancestorJq.length&&this.ancestorJq.addClass(this.status.cssClass)},_removeUiClass:function(){this.ancestorJq.length&&this.ancestorJq.removeClass(this.status.cssClass)},_updateSize:function(){this.internal.poster.jq.css({width:this.status.width,height:this.status.height}),!this.status.waitForPlay&&this.html.active&&this.status.video||this.html.video.available&&this.html.used&&this.status.nativeVideoControls?this.internal.video.jq.css({width:this.status.width,height:this.status.height}):!this.status.waitForPlay&&this.flash.active&&this.status.video&&this.internal.flash.jq.css({width:this.status.width,height:this.status.height})},_updateAutohide:function(){var e=this,t=".jPlayerAutohide",n="mousemove.jPlayer"+t,i=function(t){var n,i,r=!1;void 0!==e.internal.mouse?(n=e.internal.mouse.x-t.pageX,i=e.internal.mouse.y-t.pageY,r=Math.floor(n)>0||Math.floor(i)>0):r=!0,e.internal.mouse={x:t.pageX,y:t.pageY},r&&e.css.jq.gui.fadeIn(e.options.autohide.fadeIn,(function(){clearTimeout(e.internal.autohideId),e.internal.autohideId=setTimeout((function(){e.css.jq.gui.fadeOut(e.options.autohide.fadeOut)}),e.options.autohide.hold)}))};this.css.jq.gui.length&&(this.css.jq.gui.stop(!0,!0),clearTimeout(this.internal.autohideId),delete this.internal.mouse,this.element.unbind(t),this.css.jq.gui.unbind(t),this.status.nativeVideoControls?this.css.jq.gui.hide():this.options.fullWindow&&this.options.autohide.full||!this.options.fullWindow&&this.options.autohide.restored?(this.element.bind(n,i),this.css.jq.gui.bind(n,i),this.css.jq.gui.hide()):this.css.jq.gui.show())},fullScreen:function(e){"object"==typeof e&&this.options.useStateClassSkin&&this.options.fullScreen?this._setOption("fullScreen",!1):this._setOption("fullScreen",!0)},restoreScreen:function(){this._setOption("fullScreen",!1)},_fullscreenAddEventListeners:function(){var t=this,n=e.jPlayer.nativeFeatures.fullscreen;n.api.fullscreenEnabled&&n.event.fullscreenchange&&("function"!=typeof this.internal.fullscreenchangeHandler&&(this.internal.fullscreenchangeHandler=function(){t._fullscreenchange()}),document.addEventListener(n.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1))},_fullscreenRemoveEventListeners:function(){var t=e.jPlayer.nativeFeatures.fullscreen;this.internal.fullscreenchangeHandler&&document.removeEventListener(t.event.fullscreenchange,this.internal.fullscreenchangeHandler,!1)},_fullscreenchange:function(){this.options.fullScreen&&!e.jPlayer.nativeFeatures.fullscreen.api.fullscreenElement()&&this._setOption("fullScreen",!1)},_requestFullscreen:function(){var t=this.ancestorJq.length?this.ancestorJq[0]:this.element[0],n=e.jPlayer.nativeFeatures.fullscreen;n.used.webkitVideo&&(t=this.htmlElement.video),n.api.fullscreenEnabled&&n.api.requestFullscreen(t)},_exitFullscreen:function(){var t,n=e.jPlayer.nativeFeatures.fullscreen;n.used.webkitVideo&&(t=this.htmlElement.video),n.api.fullscreenEnabled&&n.api.exitFullscreen(t)},_html_initMedia:function(t){var n=e(this.htmlElement.media).empty();e.each(t.track||[],(function(e,t){var i=document.createElement("track");i.setAttribute("kind",t.kind?t.kind:""),i.setAttribute("src",t.src?t.src:""),i.setAttribute("srclang",t.srclang?t.srclang:""),i.setAttribute("label",t.label?t.label:""),t.def&&i.setAttribute("default",t.def),n.append(i)})),this.htmlElement.media.src=this.status.src,"none"!==this.options.preload&&this._html_load(),this._trigger(e.jPlayer.event.timeupdate)},_html_setFormat:function(t){var n=this;e.each(this.formats,(function(e,i){return n.html.support[i]&&t[i]?(n.status.src=t[i],n.status.format[i]=!0,n.status.formatType=i,!1):void 0}))},_html_setAudio:function(e){this._html_setFormat(e),this.htmlElement.media=this.htmlElement.audio,this._html_initMedia(e)},_html_setVideo:function(e){this._html_setFormat(e),this.status.nativeVideoControls&&(this.htmlElement.video.poster=this._validString(e.poster)?e.poster:""),this.htmlElement.media=this.htmlElement.video,this._html_initMedia(e)},_html_resetMedia:function(){this.htmlElement.media&&(this.htmlElement.media.id!==this.internal.video.id||this.status.nativeVideoControls||this.internal.video.jq.css({width:"0px",height:"0px"}),this.htmlElement.media.pause())},_html_clearMedia:function(){this.htmlElement.media&&(this.htmlElement.media.src="about:blank",this.htmlElement.media.load())},_html_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.htmlElement.media.load()),clearTimeout(this.internal.htmlDlyCmdId)},_html_play:function(e){var t=this,n=this.htmlElement.media;if(this.androidFix.pause=!1,this._html_load(),this.androidFix.setMedia)this.androidFix.play=!0,this.androidFix.time=e;else if(isNaN(e))n.play();else{this.internal.cmdsIgnored&&n.play();try{if(n.seekable&&!("object"==typeof n.seekable&&n.seekable.length>0))throw 1;n.currentTime=e,n.play()}catch(n){return void(this.internal.htmlDlyCmdId=setTimeout((function(){t.play(e)}),250))}}this._html_checkWaitForPlay()},_html_pause:function(e){var t=this,n=this.htmlElement.media;if(this.androidFix.play=!1,e>0?this._html_load():clearTimeout(this.internal.htmlDlyCmdId),n.pause(),this.androidFix.setMedia)this.androidFix.pause=!0,this.androidFix.time=e;else if(!isNaN(e))try{if(n.seekable&&!("object"==typeof n.seekable&&n.seekable.length>0))throw 1;n.currentTime=e}catch(n){return void(this.internal.htmlDlyCmdId=setTimeout((function(){t.pause(e)}),250))}e>0&&this._html_checkWaitForPlay()},_html_playHead:function(e){var t=this,n=this.htmlElement.media;this._html_load();try{if("object"==typeof n.seekable&&n.seekable.length>0)n.currentTime=e*n.seekable.end(n.seekable.length-1)/100;else{if(!(n.duration>0)||isNaN(n.duration))throw"e";n.currentTime=e*n.duration/100}}catch(n){return void(this.internal.htmlDlyCmdId=setTimeout((function(){t.playHead(e)}),250))}this.status.waitForLoad||this._html_checkWaitForPlay()},_html_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.video.jq.css({width:this.status.width,height:this.status.height})))},_html_setProperty:function(e,t){this.html.audio.available&&(this.htmlElement.audio[e]=t),this.html.video.available&&(this.htmlElement.video[e]=t)},_aurora_setAudio:function(t){var n=this;e.each(this.formats,(function(e,i){return n.aurora.support[i]&&t[i]?(n.status.src=t[i],n.status.format[i]=!0,n.status.formatType=i,!1):void 0})),this.aurora.player=new AV.Player.fromURL(this.status.src),this._addAuroraEventListeners(this.aurora.player,this.aurora),"auto"===this.options.preload&&(this._aurora_load(),this.status.waitForLoad=!1)},_aurora_resetMedia:function(){this.aurora.player&&this.aurora.player.stop()},_aurora_clearMedia:function(){},_aurora_load:function(){this.status.waitForLoad&&(this.status.waitForLoad=!1,this.aurora.player.preload())},_aurora_play:function(t){this.status.waitForLoad||isNaN(t)||this.aurora.player.seek(t),this.aurora.player.playing||this.aurora.player.play(),this.status.waitForLoad=!1,this._aurora_checkWaitForPlay(),this._updateButtons(!0),this._trigger(e.jPlayer.event.play)},_aurora_pause:function(t){isNaN(t)||this.aurora.player.seek(1e3*t),this.aurora.player.pause(),t>0&&this._aurora_checkWaitForPlay(),this._updateButtons(!1),this._trigger(e.jPlayer.event.pause)},_aurora_playHead:function(e){this.aurora.player.duration>0&&this.aurora.player.seek(e*this.aurora.player.duration/100),this.status.waitForLoad||this._aurora_checkWaitForPlay()},_aurora_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1)},_aurora_volume:function(e){this.aurora.player.volume=100*e},_aurora_mute:function(e){e?(this.aurora.properties.lastvolume=this.aurora.player.volume,this.aurora.player.volume=0):this.aurora.player.volume=this.aurora.properties.lastvolume,this.aurora.properties.muted=e},_flash_setAudio:function(t){var n=this;try{e.each(this.formats,(function(e,i){if(n.flash.support[i]&&t[i]){switch(i){case"m4a":case"fla":n._getMovie().fl_setAudio_m4a(t[i]);break;case"mp3":n._getMovie().fl_setAudio_mp3(t[i]);break;case"rtmpa":n._getMovie().fl_setAudio_rtmp(t[i])}return n.status.src=t[i],n.status.format[i]=!0,n.status.formatType=i,!1}})),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(e){this._flashError(e)}},_flash_setVideo:function(t){var n=this;try{e.each(this.formats,(function(e,i){if(n.flash.support[i]&&t[i]){switch(i){case"m4v":case"flv":n._getMovie().fl_setVideo_m4v(t[i]);break;case"rtmpv":n._getMovie().fl_setVideo_rtmp(t[i])}return n.status.src=t[i],n.status.format[i]=!0,n.status.formatType=i,!1}})),"auto"===this.options.preload&&(this._flash_load(),this.status.waitForLoad=!1)}catch(e){this._flashError(e)}},_flash_resetMedia:function(){this.internal.flash.jq.css({width:"0px",height:"0px"}),this._flash_pause(NaN)},_flash_clearMedia:function(){try{this._getMovie().fl_clearMedia()}catch(e){this._flashError(e)}},_flash_load:function(){try{this._getMovie().fl_load()}catch(e){this._flashError(e)}this.status.waitForLoad=!1},_flash_play:function(e){try{this._getMovie().fl_play(e)}catch(e){this._flashError(e)}this.status.waitForLoad=!1,this._flash_checkWaitForPlay()},_flash_pause:function(e){try{this._getMovie().fl_pause(e)}catch(e){this._flashError(e)}e>0&&(this.status.waitForLoad=!1,this._flash_checkWaitForPlay())},_flash_playHead:function(e){try{this._getMovie().fl_play_head(e)}catch(e){this._flashError(e)}this.status.waitForLoad||this._flash_checkWaitForPlay()},_flash_checkWaitForPlay:function(){this.status.waitForPlay&&(this.status.waitForPlay=!1,this.css.jq.videoPlay.length&&this.css.jq.videoPlay.hide(),this.status.video&&(this.internal.poster.jq.hide(),this.internal.flash.jq.css({width:this.status.width,height:this.status.height})))},_flash_volume:function(e){try{this._getMovie().fl_volume(e)}catch(e){this._flashError(e)}},_flash_mute:function(e){try{this._getMovie().fl_mute(e)}catch(e){this._flashError(e)}},_getMovie:function(){return document[this.internal.flash.id]},_getFlashPluginVersion:function(){var e,t=0;if(window.ActiveXObject)try{if(e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")){var n=e.GetVariable("$version");n&&(n=n.split(" ")[1].split(","),t=parseInt(n[0],10)+"."+parseInt(n[1],10))}}catch(e){}else navigator.plugins&&navigator.mimeTypes.length>0&&((e=navigator.plugins["Shockwave Flash"])&&(t=navigator.plugins["Shockwave Flash"].description.replace(/.*\s(\d+\.\d+).*/,"$1")));return 1*t},_checkForFlash:function(e){var t=!1;return this._getFlashPluginVersion()>=e&&(t=!0),t},_validString:function(e){return e&&"string"==typeof e},_limitValue:function(e,t,n){return t>e?t:e>n?n:e},_urlNotSetError:function(t){this._error({type:e.jPlayer.error.URL_NOT_SET,context:t,message:e.jPlayer.errorMsg.URL_NOT_SET,hint:e.jPlayer.errorHint.URL_NOT_SET})},_flashError:function(t){var n;n=this.internal.ready?"FLASH_DISABLED":"FLASH",this._error({type:e.jPlayer.error[n],context:this.internal.flash.swf,message:e.jPlayer.errorMsg[n]+t.message,hint:e.jPlayer.errorHint[n]}),this.internal.flash.jq.css({width:"1px",height:"1px"})},_error:function(t){this._trigger(e.jPlayer.event.error,t),this.options.errorAlerts&&this._alert("Error!"+(t.message?"\n"+t.message:"")+(t.hint?"\n"+t.hint:"")+"\nContext: "+t.context)},_warning:function(n){this._trigger(e.jPlayer.event.warning,t,n),this.options.warningAlerts&&this._alert("Warning!"+(n.message?"\n"+n.message:"")+(n.hint?"\n"+n.hint:"")+"\nContext: "+n.context)},_alert:function(e){var t="jPlayer "+this.version.script+" : id='"+this.internal.self.id+"' : "+e;this.options.consoleAlerts?window.console&&window.console.log&&window.console.log(t):alert(t)},_emulateHtmlBridge:function(){var t=this;e.each(e.jPlayer.emulateMethods.split(/\s+/g),(function(e,n){t.internal.domNode[n]=function(e){t[n](e)}})),e.each(e.jPlayer.event,(function(n,i){var r=!0;e.each(e.jPlayer.reservedEvent.split(/\s+/g),(function(e,t){return t===n?(r=!1,!1):void 0})),r&&t.element.bind(i+".jPlayer.jPlayerHtml",(function(){t._emulateHtmlUpdate();var e=document.createEvent("Event");e.initEvent(n,!1,!0),t.internal.domNode.dispatchEvent(e)}))}))},_emulateHtmlUpdate:function(){var t=this;e.each(e.jPlayer.emulateStatus.split(/\s+/g),(function(e,n){t.internal.domNode[n]=t.status[n]})),e.each(e.jPlayer.emulateOptions.split(/\s+/g),(function(e,n){t.internal.domNode[n]=t.options[n]}))},_destroyHtmlBridge:function(){var t=this;this.element.unbind(".jPlayerHtml");var n=e.jPlayer.emulateMethods+" "+e.jPlayer.emulateStatus+" "+e.jPlayer.emulateOptions;e.each(n.split(/\s+/g),(function(e,n){delete t.internal.domNode[n]}))}},e.jPlayer.error={FLASH:"e_flash",FLASH_DISABLED:"e_flash_disabled",NO_SOLUTION:"e_no_solution",NO_SUPPORT:"e_no_support",URL:"e_url",URL_NOT_SET:"e_url_not_set",VERSION:"e_version"},e.jPlayer.errorMsg={FLASH:"jPlayer's Flash fallback is not configured correctly, or a command was issued before the jPlayer Ready event. Details: ",FLASH_DISABLED:"jPlayer's Flash fallback has been disabled by the browser due to the CSS rules you have used. Details: ",NO_SOLUTION:"No solution can be found by jPlayer in this browser. Neither HTML nor Flash can be used.",NO_SUPPORT:"It is not possible to play any media format provided in setMedia() on this browser using your current options.",URL:"Media URL could not be loaded.",URL_NOT_SET:"Attempt to issue media playback commands, while no media url is set.",VERSION:"jPlayer "+e.jPlayer.prototype.version.script+" needs Jplayer.swf version "+e.jPlayer.prototype.version.needFlash+" but found "},e.jPlayer.errorHint={FLASH:"Check your swfPath option and that Jplayer.swf is there.",FLASH_DISABLED:"Check that you have not display:none; the jPlayer entity or any ancestor.",NO_SOLUTION:"Review the jPlayer options: support and supplied.",NO_SUPPORT:"Video or audio formats defined in the supplied option are missing.",URL:"Check media URL is valid.",URL_NOT_SET:"Use setMedia() to set the media URL.",VERSION:"Update jPlayer files."},e.jPlayer.warning={CSS_SELECTOR_COUNT:"e_css_selector_count",CSS_SELECTOR_METHOD:"e_css_selector_method",CSS_SELECTOR_STRING:"e_css_selector_string",OPTION_KEY:"e_option_key"},e.jPlayer.warningMsg={CSS_SELECTOR_COUNT:"The number of css selectors found did not equal one: ",CSS_SELECTOR_METHOD:"The methodName given in jPlayer('cssSelector') is not a valid jPlayer method.",CSS_SELECTOR_STRING:"The methodCssSelector given in jPlayer('cssSelector') is not a String or is empty.",OPTION_KEY:"The option requested in jPlayer('option') is undefined."},e.jPlayer.warningHint={CSS_SELECTOR_COUNT:"Check your css selector and the ancestor.",CSS_SELECTOR_METHOD:"Check your method name.",CSS_SELECTOR_STRING:"Check your css selector is a string.",OPTION_KEY:"Check your option name."}})),function(e,t,n,i){var r=t.document,a=e(r),o=e(t),s=Array.prototype,l=1.41,d=!0,c=!1,u=navigator.userAgent.toLowerCase(),f=t.location.hash.replace(/#\//,""),h=t.location.protocol,p=Math,g=function(){},m=function(){return!1},v=function(){var e=3,t=r.createElement("div"),n=t.getElementsByTagName("i");do{t.innerHTML="<!--[if gt IE "+ ++e+"]><i></i><![endif]-->"}while(n[0]);return e>4?e:r.documentMode||i}(),y=function(){return{html:r.documentElement,body:r.body,head:r.getElementsByTagName("head")[0],title:r.title}},_=t.parent!==t.self,b="data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image",E=function(){var t=[];return e.each(b.split(" "),(function(e,n){t.push(n),/_/.test(n)&&t.push(n.replace(/_/g,""))})),t}(),w=function(t){var n;return"object"!=typeof t||e.each(t,(function(i,r){/^[a-z]+_/.test(i)&&(n="",e.each(i.split("_"),(function(e,t){n+=e>0?t.substr(0,1).toUpperCase()+t.substr(1):t})),t[n]=r,delete t[i])})),t},T=function(t){return e.inArray(t,E)>-1?n[t.toUpperCase()]:t},S={youtube:{reg:/https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&amp;(?:amp;)?)*v(?:&lt;[A-Z]+&gt;)?=([0-9a-zA-Z\-\_]+))/i,embed:function(){return"http://www.youtube.com/embed/"+this.id},getUrl:function(){return h+"//gdata.youtube.com/feeds/api/videos/"+this.id+"?v=2&alt=json-in-script&callback=?"},get_thumb:function(e){return e.entry.media$group.media$thumbnail[2].url},get_image:function(e){return e.entry.yt$hd?h+"//img.youtube.com/vi/"+this.id+"/maxresdefault.jpg":e.entry.media$group.media$thumbnail[3].url}},vimeo:{reg:/https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i,embed:function(){return"http://player.vimeo.com/video/"+this.id},getUrl:function(){return h+"//vimeo.com/api/v2/video/"+this.id+".json?callback=?"},get_thumb:function(e){return e[0].thumbnail_medium},get_image:function(e){return e[0].thumbnail_large}},dailymotion:{reg:/https?:\/\/(?:www\.)?(dailymotion\.com)\/video\/([^_]+)/,embed:function(){return h+"//www.dailymotion.com/embed/video/"+this.id},getUrl:function(){return"https://api.dailymotion.com/video/"+this.id+"?fields=thumbnail_240_url,thumbnail_720_url&callback=?"},get_thumb:function(e){return e.thumbnail_240_url},get_image:function(e){return e.thumbnail_720_url}},_inst:[]},C=function(t,n){for(var i=0;i<S._inst.length;i++)if(S._inst[i].id===n&&S._inst[i].type==t)return S._inst[i];this.type=t,this.id=n,this.readys=[],S._inst.push(this);var r=this;e.extend(this,S[t]),e.getJSON(this.getUrl(),(function(t){r.data=t,e.each(r.readys,(function(e,t){t(r.data)})),r.readys=[]})),this.getMedia=function(e,t,n){n=n||g;var i=this,r=function(n){t(i["get_"+e](n))};try{i.data?r(i.data):i.readys.push(r)}catch(e){n()}}},k=function(e){var t;for(var n in S)if((t=e&&S[n].reg&&e.match(S[n].reg))&&t.length)return{id:t[2],provider:n};return!1},I={support:function(){var e=y().html;return!_&&(e.requestFullscreen||e.msRequestFullscreen||e.mozRequestFullScreen||e.webkitRequestFullScreen)}(),callback:g,enter:function(e,t,n){this.instance=e,this.callback=t||g,(n=n||y().html).requestFullscreen?n.requestFullscreen():n.msRequestFullscreen?n.msRequestFullscreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.webkitRequestFullScreen&&n.webkitRequestFullScreen()},exit:function(e){this.callback=e||g,r.exitFullscreen?r.exitFullscreen():r.msExitFullscreen?r.msExitFullscreen():r.mozCancelFullScreen?r.mozCancelFullScreen():r.webkitCancelFullScreen&&r.webkitCancelFullScreen()},instance:null,listen:function(){if(this.support){var e=function(){if(I.instance){var e=I.instance._fullscreen;r.fullscreen||r.mozFullScreen||r.webkitIsFullScreen||r.msFullscreenElement&&null!==r.msFullscreenElement?e._enter(I.callback):e._exit(I.callback)}};r.addEventListener("fullscreenchange",e,!1),r.addEventListener("MSFullscreenChange",e,!1),r.addEventListener("mozfullscreenchange",e,!1),r.addEventListener("webkitfullscreenchange",e,!1)}}},A=[],x=[],D=!1,R=!1,M=[],N=[],O=function(t){N.push(t),e.each(M,(function(e,n){n._options.theme!=t.name&&(n._initialized||n._options.theme)||(n.theme=t,n._init.call(n))}))},P={clearTimer:function(t){e.each(n.get(),(function(){this.clearTimer(t)}))},addTimer:function(t){e.each(n.get(),(function(){this.addTimer(t)}))},array:function(e){return s.slice.call(e,0)},create:function(e,t){t=t||"div";var n=r.createElement(t);return n.className=e,n},removeFromArray:function(t,n){return e.each(t,(function(e,i){if(i==n)return t.splice(e,1),!1})),t},getScriptPath:function(t){var n=(t=t||e("script:last").attr("src")).split("/");return 1==n.length?"":(n.pop(),n.join("/")+"/")},animate:function(){var i,a,o,s,l,d,c,u=function(e){var n,i="transition WebkitTransition MozTransition OTransition".split(" ");if(t.opera)return!1;for(n=0;i[n];n++)if(void 0!==e[i[n]])return i[n];return!1}((r.body||r.documentElement).style),f={MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[u],h={_default:[.25,.1,.25,1],galleria:[.645,.045,.355,1],galleriaIn:[.55,.085,.68,.53],galleriaOut:[.25,.46,.45,.94],ease:[.25,0,.25,1],linear:[.25,.25,.75,.75],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},p=function(t,n,i){var r={};i=i||"transition",e.each("webkit moz ms o".split(" "),(function(){r["-"+this+"-"+i]=n})),t.css(r)},m=function(e){p(e,"none","transition"),n.WEBKIT&&n.TOUCH&&(p(e,"translate3d(0,0,0)","transform"),e.data("revert")&&(e.css(e.data("revert")),e.data("revert",null)))};return function(r,v,y){if(y=e.extend({duration:400,complete:g,stop:!1},y),r=e(r),!y.duration)return r.css(v),void y.complete.call(r[0]);u?(y.stop&&(r.off(f),m(r)),i=!1,e.each(v,(function(e,t){c=r.css(e),P.parseValue(c)!=P.parseValue(t)&&(i=!0),r.css(e,c)})),i?(a=[],o=y.easing in h?h[y.easing]:h._default,s=" "+y.duration+"ms cubic-bezier("+o.join(",")+")",t.setTimeout(function(t,i,r,o){return function(){t.one(i,function(e){return function(){m(e),y.complete.call(e[0])}}(t)),n.WEBKIT&&n.TOUCH&&(l={},d=[0,0,0],e.each(["left","top"],(function(e,n){n in r&&(d[e]=P.parseValue(r[n])-P.parseValue(t.css(n))+"px",l[n]=r[n],delete r[n])})),(d[0]||d[1])&&(t.data("revert",l),a.push("-webkit-transform"+o),p(t,"translate3d("+d.join(",")+")","transform"))),e.each(r,(function(e){a.push(e+o)})),p(t,a.join(",")),t.css(r)}}(r,f,v,s),2)):t.setTimeout((function(){y.complete.call(r[0])}),y.duration)):r.animate(v,y)}}(),removeAlpha:function(e){if(e instanceof jQuery&&(e=e[0]),v<9&&e){var t=e.style,n=e.currentStyle,i=n&&n.filter||t.filter||"";/alpha/.test(i)&&(t.filter=i.replace(/alpha\([^)]*\)/i,""))}},forceStyles:function(t,n){(t=e(t)).attr("style")&&t.data("styles",t.attr("style")).removeAttr("style"),t.css(n)},revertStyles:function(){e.each(P.array(arguments),(function(t,n){(n=e(n)).removeAttr("style"),n.attr("style",""),n.data("styles")&&n.attr("style",n.data("styles")).data("styles",null)}))},moveOut:function(e){P.forceStyles(e,{position:"absolute",left:-1e4})},moveIn:function(){P.revertStyles.apply(P,P.array(arguments))},hide:function(t,n,i){i=i||g;var r=e(t);t=r[0],r.data("opacity")||r.data("opacity",r.css("opacity"));var a={opacity:0};if(n){var o=v<9&&t?function(){P.removeAlpha(t),t.style.visibility="hidden",i.call(t)}:i;P.animate(t,a,{duration:n,complete:o,stop:!0})}else v<9&&t?(P.removeAlpha(t),t.style.visibility="hidden"):r.css(a)},show:function(t,n,i){i=i||g;var r=e(t);t=r[0];var a={opacity:parseFloat(r.data("opacity"))||1};if(n){v<9&&(r.css("opacity",0),t.style.visibility="visible");var o=v<9&&t?function(){1==a.opacity&&P.removeAlpha(t),i.call(t)}:i;P.animate(t,a,{duration:n,complete:o,stop:!0})}else v<9&&1==a.opacity&&t?(P.removeAlpha(t),t.style.visibility="visible"):r.css(a)},wait:function(i){n._waiters=n._waiters||[],i=e.extend({until:m,success:g,error:function(){n.raise("Could not complete wait function.")},timeout:3e3},i);var r,a,o,s=P.timestamp(),l=function(){return a=P.timestamp(),r=a-s,P.removeFromArray(n._waiters,o),i.until(r)?(i.success(),!1):"number"==typeof i.timeout&&a>=s+i.timeout?(i.error(),!1):void n._waiters.push(o=t.setTimeout(l,10))};n._waiters.push(o=t.setTimeout(l,10))},toggleQuality:function(e,t){7!==v&&8!==v||!e||"IMG"!=e.nodeName.toUpperCase()||(void 0===t&&(t="nearest-neighbor"===e.style.msInterpolationMode),e.style.msInterpolationMode=t?"bicubic":"nearest-neighbor")},insertStyleTag:function(t,n){if(!n||!e("#"+n).length){var i=r.createElement("style");if(n&&(i.id=n),y().head.appendChild(i),i.styleSheet)i.styleSheet.cssText=t;else{var a=r.createTextNode(t);i.appendChild(a)}}},loadScript:function(t,n){var i=!1,r=e("<script>").attr({src:t,async:!0}).get(0);r.onload=r.onreadystatechange=function(){i||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(i=!0,r.onload=r.onreadystatechange=null,"function"==typeof n&&n.call(this,this))},y().head.appendChild(r)},parseValue:function(e){if("number"==typeof e)return e;if("string"==typeof e){var t=e.match(/\-?\d|\./g);return t&&t.constructor===Array?1*t.join(""):0}return 0},timestamp:function(){return(new Date).getTime()},loadCSS:function(t,a,o){var s,l;if(e("link[rel=stylesheet]").each((function(){if(new RegExp(t).test(this.href))return s=this,!1})),"function"==typeof a&&(o=a,a=i),o=o||g,s)return o.call(s,s),s;if(l=r.styleSheets.length,e("#"+a).length)e("#"+a).attr("href",t),l--;else{s=e("<link>").attr({rel:"stylesheet",href:t,id:a}).get(0);var d=e('link[rel="stylesheet"], style');if(d.length?d.get(0).parentNode.insertBefore(s,d[0]):y().head.appendChild(s),v&&l>=31)return void n.raise("You have reached the browser stylesheet limit (31)",!0)}if("function"==typeof o){var c=e("<s>").attr("id","galleria-loader").hide().appendTo(y().body);P.wait({until:function(){return 1==c.height()},success:function(){c.remove(),o.call(s,s)},error:function(){c.remove(),n.raise("Theme CSS could not load after 20 sec. "+(n.QUIRK?"Your browser is in Quirks Mode, please add a correct doctype.":"Please download the latest theme at http://galleria.io/customer/."),!0)},timeout:5e3})}return s}},L=function(t){var n=".galleria-videoicon{width:60px;height:60px;position:absolute;top:50%;left:50%;z-index:1;margin:-30px 0 0 -30px;cursor:pointer;background:#000;background:rgba(0,0,0,.8);border-radius:3px;-webkit-transition:all 150ms}.galleria-videoicon i{width:0px;height:0px;border-style:solid;border-width:10px 0 10px 16px;display:block;border-color:transparent transparent transparent #ffffff;margin:20px 0 0 22px}.galleria-image:hover .galleria-videoicon{background:#000}";return P.insertStyleTag(n,"galleria-videoicon"),e(P.create("galleria-videoicon")).html("<i></i>").appendTo(t).click((function(){e(this).siblings("img").mouseup()}))},F=function(){var t=function(t,n,i,r){var a=this.getOptions("easing"),o=this.getStageWidth(),s={left:o*(t.rewind?-1:1)},l={left:0};i?(s.opacity=0,l.opacity=1):s.opacity=1,e(t.next).css(s),P.animate(t.next,l,{duration:t.speed,complete:function(e){return function(){n(),e.css({left:0})}}(e(t.next).add(t.prev)),queue:!1,easing:a}),r&&(t.rewind=!t.rewind),t.prev&&(s={left:0},l={left:o*(t.rewind?1:-1)},i&&(s.opacity=1,l.opacity=0),e(t.prev).css(s),P.animate(t.prev,l,{duration:t.speed,queue:!1,easing:a,complete:function(){e(this).css("opacity",0)}}))};return{active:!1,init:function(e,t,n){F.effects.hasOwnProperty(e)&&F.effects[e].call(this,t,n)},effects:{fade:function(t,n){e(t.next).css({opacity:0,left:0}),P.animate(t.next,{opacity:1},{duration:t.speed,complete:n}),t.prev&&(e(t.prev).css("opacity",1).show(),P.animate(t.prev,{opacity:0},{duration:t.speed}))},flash:function(t,n){e(t.next).css({opacity:0,left:0}),t.prev?P.animate(t.prev,{opacity:0},{duration:t.speed/2,complete:function(){P.animate(t.next,{opacity:1},{duration:t.speed,complete:n})}}):P.animate(t.next,{opacity:1},{duration:t.speed,complete:n})},pulse:function(t,n){t.prev&&e(t.prev).hide(),e(t.next).css({opacity:0,left:0}).show(),P.animate(t.next,{opacity:1},{duration:t.speed,complete:n})},slide:function(e,n){t.apply(this,P.array(arguments))},fadeslide:function(e,n){t.apply(this,P.array(arguments).concat([!0]))},doorslide:function(e,n){t.apply(this,P.array(arguments).concat([!1,!0]))}}}}();I.listen(),e.event.special["click:fast"]={propagate:!0,add:function(n){var i=function(e){if(e.touches&&e.touches.length){var t=e.touches[0];return{x:t.pageX,y:t.pageY}}},r={touched:!1,touchdown:!1,coords:{x:0,y:0},evObj:{}};e(this).data({clickstate:r,timer:0}).on("touchstart.fast",(function(n){t.clearTimeout(e(this).data("timer")),e(this).data("clickstate",{touched:!0,touchdown:!0,coords:i(n.originalEvent),evObj:n})})).on("touchmove.fast",(function(t){var n=i(t.originalEvent),r=e(this).data("clickstate");Math.max(Math.abs(r.coords.x-n.x),Math.abs(r.coords.y-n.y))>6&&e(this).data("clickstate",e.extend(r,{touchdown:!1}))})).on("touchend.fast",(function(i){var a=e(this);a.data("clickstate").touchdown&&n.handler.call(this,i),a.data("timer",t.setTimeout((function(){a.data("clickstate",r)}),400))})).on("click.fast",(function(t){if(e(this).data("clickstate").touched)return!1;e(this).data("clickstate",r),n.handler.call(this,t)}))},remove:function(){e(this).off("touchstart.fast touchmove.fast touchend.fast click.fast")}},o.on("orientationchange",(function(){e(this).resize()})),(n=function(){var s=this;this._options={},this._playing=!1,this._playtime=5e3,this._active=null,this._queue={length:0},this._data=[],this._dom={},this._thumbnails=[],this._layers=[],this._initialized=!1,this._firstrun=!1,this._stageWidth=0,this._stageHeight=0,this._target=i,this._binds=[],this._id=parseInt(1e4*p.random(),10);var l="container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter tooltip",d="current total";e.each(l.split(" "),(function(e,t){s._dom[t]=P.create("galleria-"+t)})),e.each(d.split(" "),(function(e,t){s._dom[t]=P.create("galleria-"+t,"span")}));var c=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:!1,press:function(e){var t=e.keyCode||e.which;t in c.map&&"function"==typeof c.map[t]&&c.map[t].call(s,e)},attach:function(e){var t,n;for(t in e)e.hasOwnProperty(t)&&((n=t.toUpperCase())in c.keys?c.map[c.keys[n]]=e[t]:c.map[n]=e[t]);c.bound||(c.bound=!0,a.on("keydown",c.press))},detach:function(){c.bound=!1,c.map={},a.off("keydown",c.press)}},f=this._controls={0:i,1:i,active:0,swap:function(){f.active=f.active?0:1},getActive:function(){return s._options.swipe?f.slides[s._active]:f[f.active]},getNext:function(){return s._options.swipe?f.slides[s.getNext(s._active)]:f[1-f.active]},slides:[],frames:[],layers:[]},h=this._carousel={next:s.$("thumb-nav-right"),prev:s.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var t=0,n=0,i=[0];e.each(s._thumbnails,(function(r,a){if(a.ready){t+=a.outerWidth||e(a.container).outerWidth(!0);var o=e(a.container).width();t+=o-p.floor(o),i[r+1]=t,n=p.max(n,a.outerHeight||e(a.container).outerHeight(!0))}})),s.$("thumbnails").css({width:t,height:n}),h.max=t,h.hooks=i,h.width=s.$("thumbnails-list").width(),h.setClasses(),s.$("thumbnails-container").toggleClass("galleria-carousel",t>h.width),h.width=s.$("thumbnails-list").width()},bindControls:function(){var e;h.next.on("click:fast",(function(t){if(t.preventDefault(),"auto"===s._options.carouselSteps){for(e=h.current;e<h.hooks.length;e++)if(h.hooks[e]-h.hooks[h.current]>h.width){h.set(e-2);break}}else h.set(h.current+s._options.carouselSteps)})),h.prev.on("click:fast",(function(t){if(t.preventDefault(),"auto"===s._options.carouselSteps)for(e=h.current;e>=0;e--){if(h.hooks[h.current]-h.hooks[e]>h.width){h.set(e+2);break}if(0===e){h.set(0);break}}else h.set(h.current-s._options.carouselSteps)}))},set:function(e){for(e=p.max(e,0);h.hooks[e-1]+h.width>=h.max&&e>=0;)e--;h.current=e,h.animate()},getLast:function(e){return(e||h.current)-1},follow:function(e){if(0!==e&&e!==h.hooks.length-2){for(var t=h.current;h.hooks[t]-h.hooks[h.current]<h.width&&t<=h.hooks.length;)t++;e-1<h.current?h.set(e-1):e+2>t&&h.set(e-t+h.current+2)}else h.set(e)},setClasses:function(){h.prev.toggleClass("disabled",!h.current),h.next.toggleClass("disabled",h.hooks[h.current]+h.width>=h.max)},animate:function(){h.setClasses();var t=-1*h.hooks[h.current];isNaN(t)||(s.$("thumbnails").css("left",(function(){return e(this).css("left")})),P.animate(s.get("thumbnails"),{left:t},{duration:s._options.carouselSpeed,easing:s._options.easing,queue:!1}))}},g=this._tooltip={initialized:!1,open:!1,timer:"tooltip"+s._id,swapTimer:"swap"+s._id,init:function(){g.initialized=!0;var e=".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3;opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}";P.insertStyleTag(e,"galleria-tooltip"),s.$("tooltip").css({opacity:.8,visibility:"visible",display:"none"})},move:function(e){var t=s.getMousePosition(e).x,n=s.getMousePosition(e).y,i=s.$("tooltip"),r=t,a=n,o=i.outerHeight(!0)+1,l=i.outerWidth(!0),d=o+15,c=s.$("container").width()-l-2,u=s.$("container").height()-o-2;isNaN(r)||isNaN(a)||(r+=10,a-=o+8,r=p.max(0,p.min(c,r)),a=p.max(0,p.min(u,a)),n<d&&(a=d),i.css({left:r,top:a}))},bind:function(t,i){if(!n.TOUCH){g.initialized||g.init();var r=function(){s.$("container").off("mousemove",g.move),s.clearTimer(g.timer),s.$("tooltip").stop().animate({opacity:0},200,(function(){s.$("tooltip").hide(),s.addTimer(g.swapTimer,(function(){g.open=!1}),1e3)}))},a=function(t,n){g.define(t,n),e(t).hover((function(){s.clearTimer(g.swapTimer),
s.$("container").off("mousemove",g.move).on("mousemove",g.move).trigger("mousemove"),g.show(t),s.addTimer(g.timer,(function(){s.$("tooltip").stop().show().animate({opacity:1}),g.open=!0}),g.open?0:500)}),r).click(r)};"string"==typeof i?a(t in s._dom?s.get(t):t,i):e.each(t,(function(e,t){a(s.get(e),t)}))}},show:function(n){var i=(n=e(n in s._dom?s.get(n):n)).data("tt"),r=function(e){t.setTimeout(function(e){return function(){g.move(e)}}(e),10),n.off("mouseup",r)};(i="function"==typeof i?i():i)&&(s.$("tooltip").html(i.replace(/\s/,"&#160;")),n.on("mouseup",r))},define:function(t,n){if("function"!=typeof n){var i=n;n=function(){return i}}t=e(t in s._dom?s.get(t):t).data("tt",n),g.show(t)}},m=this._fullscreen={scrolled:0,crop:i,active:!1,prev:e(),beforeEnter:function(e){e()},beforeExit:function(e){e()},keymap:s._keyboard.map,parseCallback:function(t,n){return F.active?function(){"function"==typeof t&&t.call(s);var i=s._controls.getActive(),r=s._controls.getNext();s._scaleImage(r),s._scaleImage(i),n&&s._options.trueFullscreen&&e(i.container).add(r.container).trigger("transitionend")}:t},enter:function(e){m.beforeEnter((function(){e=m.parseCallback(e,!0),s._options.trueFullscreen&&I.support?(m.active=!0,P.forceStyles(s.get("container"),{width:"100%",height:"100%"}),s.rescale(),n.MAC?n.SAFARI&&/version\/[1-5]/.test(u)?(s.$("stage").css("opacity",0),t.setTimeout((function(){m.scale(),s.$("stage").css("opacity",1)}),4)):(s.$("container").css("opacity",0).addClass("fullscreen"),t.setTimeout((function(){m.scale(),s.$("container").css("opacity",1)}),50)):s.$("container").addClass("fullscreen"),o.resize(m.scale),I.enter(s,e,s.get("container"))):(m.scrolled=o.scrollTop(),n.TOUCH||t.scrollTo(0,0),m._enter(e))}))},_enter:function(a){m.active=!0,_&&(m.iframe=function(){var i,a=r.referrer,o=r.createElement("a"),s=t.location;return o.href=a,o.protocol!=s.protocol||o.hostname!=s.hostname||o.port!=s.port?(n.raise("Parent fullscreen not available. Iframe protocol, domains and ports must match."),!1):(m.pd=t.parent.document,e(m.pd).find("iframe").each((function(){if((this.contentDocument||this.contentWindow.document)===r)return i=this,!1})),i)}()),P.hide(s.getActiveImage()),_&&m.iframe&&(m.iframe.scrolled=e(t.parent).scrollTop(),t.parent.scrollTo(0,0));var l=s.getData(),d=s._options,c=!s._options.trueFullscreen||!I.support,u={height:"100%",overflow:"hidden",margin:0,padding:0};if(c&&(s.$("container").addClass("fullscreen"),m.prev=s.$("container").prev(),m.prev.length||(m.parent=s.$("container").parent()),s.$("container").appendTo("body"),P.forceStyles(s.get("container"),{position:n.TOUCH?"absolute":"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e4}),P.forceStyles(y().html,u),P.forceStyles(y().body,u)),_&&m.iframe&&(P.forceStyles(m.pd.documentElement,u),P.forceStyles(m.pd.body,u),P.forceStyles(m.iframe,e.extend(u,{width:"100%",height:"100%",top:0,left:0,position:"fixed",zIndex:1e4,border:"none"}))),m.keymap=e.extend({},s._keyboard.map),s.attachKeyboard({escape:s.exitFullscreen,right:s.next,left:s.prev}),m.crop=d.imageCrop,d.fullscreenCrop!=i&&(d.imageCrop=d.fullscreenCrop),l&&l.big&&l.image!==l.big){var f=new n.Picture,h=f.isCached(l.big),p=s.getIndex(),g=s._thumbnails[p];s.trigger({type:n.LOADSTART,cached:h,rewind:!1,index:p,imageTarget:s.getActiveImage(),thumbTarget:g,galleriaData:l}),f.load(l.big,(function(t){s._scaleImage(t,{complete:function(t){s.trigger({type:n.LOADFINISH,cached:h,index:p,rewind:!1,imageTarget:t.image,thumbTarget:g});var i=s._controls.getActive().image;i&&e(i).width(t.image.width).height(t.image.height).attr("style",e(t.image).attr("style")).attr("src",t.image.src)}})}));var v=s.getNext(p),b=new n.Picture,E=s.getData(v);b.preload(s.isFullscreen()&&E.big?E.big:E.image)}s.rescale((function(){s.addTimer(!1,(function(){c&&P.show(s.getActiveImage()),"function"==typeof a&&a.call(s),s.rescale()}),100),s.trigger(n.FULLSCREEN_ENTER)})),c?o.resize(m.scale):P.show(s.getActiveImage())},scale:function(){s.rescale()},exit:function(e){m.beforeExit((function(){e=m.parseCallback(e),s._options.trueFullscreen&&I.support?I.exit(e):m._exit(e)}))},_exit:function(e){m.active=!1;var i=!s._options.trueFullscreen||!I.support,r=s.$("container").removeClass("fullscreen");if(m.parent?m.parent.prepend(r):r.insertAfter(m.prev),i){P.hide(s.getActiveImage()),P.revertStyles(s.get("container"),y().html,y().body),n.TOUCH||t.scrollTo(0,m.scrolled);var a=s._controls.frames[s._controls.active];a&&a.image&&(a.image.src=a.image.src)}_&&m.iframe&&(P.revertStyles(m.pd.documentElement,m.pd.body,m.iframe),m.iframe.scrolled&&t.parent.scrollTo(0,m.iframe.scrolled)),s.detachKeyboard(),s.attachKeyboard(m.keymap),s._options.imageCrop=m.crop;var l=s.getData().big,d=s._controls.getActive().image;!s.getData().iframe&&d&&l&&l==d.src&&t.setTimeout(function(e){return function(){d.src=e}}(s.getData().image),1),s.rescale((function(){s.addTimer(!1,(function(){i&&P.show(s.getActiveImage()),"function"==typeof e&&e.call(s),o.trigger("resize")}),50),s.trigger(n.FULLSCREEN_EXIT)})),o.off("resize",m.scale)}},b=this._idle={trunk:[],bound:!1,active:!1,add:function(t,i,r,a){if(t&&!n.TOUCH){b.bound||b.addEvent(),t=e(t),"boolean"==typeof r&&(a=r,r={}),r=r||{};var o,s={};for(o in i)i.hasOwnProperty(o)&&(s[o]=t.css(o));t.data("idle",{from:e.extend(s,r),to:i,complete:!0,busy:!1}),a?t.css(i):b.addTimer(),b.trunk.push(t)}},remove:function(t){t=e(t),e.each(b.trunk,(function(e,n){n&&n.length&&!n.not(t).length&&(t.css(t.data("idle").from),b.trunk.splice(e,1))})),b.trunk.length||(b.removeEvent(),s.clearTimer(b.timer))},addEvent:function(){b.bound=!0,s.$("container").on("mousemove click",b.showAll),"hover"==s._options.idleMode&&s.$("container").on("mouseleave",b.hide)},removeEvent:function(){b.bound=!1,s.$("container").on("mousemove click",b.showAll),"hover"==s._options.idleMode&&s.$("container").off("mouseleave",b.hide)},addTimer:function(){"hover"!=s._options.idleMode&&s.addTimer("idle",(function(){b.hide()}),s._options.idleTime)},hide:function(){if(s._options.idleMode&&!1!==s.getIndex()){s.trigger(n.IDLE_ENTER);var t=b.trunk.length;e.each(b.trunk,(function(e,n){var i=n.data("idle");i&&(n.data("idle").complete=!1,P.animate(n,i.to,{duration:s._options.idleSpeed,complete:function(){e==t-1&&(b.active=!1)}}))}))}},showAll:function(){s.clearTimer("idle"),e.each(b.trunk,(function(e,t){b.show(t)}))},show:function(t){var i=t.data("idle");b.active&&(i.busy||i.complete)||(i.busy=!0,s.trigger(n.IDLE_EXIT),s.clearTimer("idle"),P.animate(t,i.from,{duration:s._options.idleSpeed/2,complete:function(){b.active=!0,e(t).data("idle").busy=!1,e(t).data("idle").complete=!0}})),b.addTimer()}},E=this._lightbox={width:0,height:0,initialized:!1,active:null,image:null,elems:{},keymap:!1,init:function(){if(!E.initialized){E.initialized=!0;var t="overlay box content shadow title info close prevholder prev nextholder next counter image",i={},r=s._options,a="",o="position:absolute;",l="lightbox-",d={overlay:"position:fixed;display:none;opacity:"+r.overlayOpacity+";filter:alpha(opacity="+100*r.overlayOpacity+");top:0;left:0;width:100%;height:100%;background:"+r.overlayBackground+";z-index:99990",box:"position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",shadow:o+"background:#000;width:100%;height:100%;",content:o+"background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",info:o+"bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",close:o+"top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",image:o+"top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",prevholder:o+"width:50%;top:0;bottom:40px;cursor:pointer;",nextholder:o+"width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",prev:o+"top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;text-align:center;color:#000;font:bold 16px/36px arial,sans-serif",next:o+"top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;font:bold 16px/36px arial,sans-serif;text-align:center;color:#000",title:"float:left",counter:"float:right;margin-left:8px;"},c=function(t){return t.hover((function(){e(this).css("color","#bbb")}),(function(){e(this).css("color","#444")}))},u={},f="";f=v>7?v<9?"background:#000;filter:alpha(opacity=0);":"background:rgba(0,0,0,0);":"z-index:99999",d.nextholder+=f,d.prevholder+=f,e.each(d,(function(e,t){a+=".galleria-"+l+e+"{"+t+"}"})),a+=".galleria-"+l+"box.iframe .galleria-"+l+"prevholder,.galleria-"+l+"box.iframe .galleria-"+l+"nextholder{width:100px;height:100px;top:50%;margin-top:-70px}",P.insertStyleTag(a,"galleria-lightbox"),e.each(t.split(" "),(function(e,t){s.addElement("lightbox-"+t),i[t]=E.elems[t]=s.get("lightbox-"+t)})),E.image=new n.Picture,e.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},(function(t,n){var i=[];e.each(n.split(" "),(function(e,t){i.push(l+t)})),u[l+t]=i})),s.append(u),e(i.image).append(E.image.container),e(y().body).append(i.overlay,i.box),c(e(i.close).on("click:fast",E.hide).html("&#215;")),e.each(["Prev","Next"],(function(t,r){var a=e(i[r.toLowerCase()]).html(/v/.test(r)?"&#8249;&#160;":"&#160;&#8250;"),o=e(i[r.toLowerCase()+"holder"]);o.on("click:fast",(function(){E["show"+r]()})),v<8||n.TOUCH?a.show():o.hover((function(){a.show()}),(function(){a.stop().fadeOut(200)}))})),e(i.overlay).on("click:fast",E.hide),n.IPAD&&(s._options.lightboxTransitionSpeed=0)}},rescale:function(t){var i=p.min(o.width()-40,E.width),r=p.min(o.height()-60,E.height),a=p.min(i/E.width,r/E.height),l=p.round(E.width*a)+40,d=p.round(E.height*a)+60,c={width:l,height:d,"margin-top":-1*p.ceil(d/2),"margin-left":-1*p.ceil(l/2)};t?e(E.elems.box).css(c):e(E.elems.box).animate(c,{duration:s._options.lightboxTransitionSpeed,easing:s._options.easing,complete:function(){var t=E.image,i=s._options.lightboxFadeSpeed;s.trigger({type:n.LIGHTBOX_IMAGE,imageTarget:t.image}),e(t.container).show(),e(t.image).animate({opacity:1},i),P.show(E.elems.info,i)}})},hide:function(){E.image.image=null,o.off("resize",E.rescale),e(E.elems.box).hide().find("iframe").remove(),P.hide(E.elems.info),s.detachKeyboard(),s.attachKeyboard(E.keymap),E.keymap=!1,P.hide(E.elems.overlay,200,(function(){e(this).hide().css("opacity",s._options.overlayOpacity),s.trigger(n.LIGHTBOX_CLOSE)}))},showNext:function(){E.show(s.getNext(E.active))},showPrev:function(){E.show(s.getPrev(E.active))},show:function(i){E.active=i="number"==typeof i?i:s.getIndex()||0,E.initialized||E.init(),s.trigger(n.LIGHTBOX_OPEN),E.keymap||(E.keymap=e.extend({},s._keyboard.map),s.attachKeyboard({escape:E.hide,right:E.showNext,left:E.showPrev})),o.off("resize",E.rescale);var r,a,l,d=s.getData(i),c=s.getDataLength(),u=s.getNext(i);P.hide(E.elems.info);try{for(l=s._options.preload;l>0;l--)a=new n.Picture,r=s.getData(u),a.preload(r.big?r.big:r.image),u=s.getNext(u)}catch(e){}E.image.isIframe=d.iframe&&!d.image,e(E.elems.box).toggleClass("iframe",E.image.isIframe),e(E.image.container).find(".galleria-videoicon").remove(),E.image.load(d.big||d.image||d.iframe,(function(n){if(n.isIframe){var r=e(t).width(),a=e(t).height();if(n.video&&s._options.maxVideoSize){var l=p.min(s._options.maxVideoSize/r,s._options.maxVideoSize/a);l<1&&(r*=l,a*=l)}E.width=r,E.height=a}else E.width=n.original.width,E.height=n.original.height;if(e(n.image).css({width:n.isIframe?"100%":"100.1%",height:n.isIframe?"100%":"100.1%",top:0,bottom:0,zIndex:99998,opacity:0,visibility:"visible"}).parent().height("100%"),E.elems.title.innerHTML=d.title||"",E.elems.counter.innerHTML=i+1+" / "+c,o.resize(E.rescale),E.rescale(),d.image&&d.iframe){if(e(E.elems.box).addClass("iframe"),d.video){var u=L(n.container).hide();t.setTimeout((function(){u.fadeIn(200)}),200)}e(n.image).css("cursor","pointer").mouseup(function(t,n){return function(i){e(E.image.container).find(".galleria-videoicon").remove(),i.preventDefault(),n.isIframe=!0,n.load(t.iframe+(t.video?"&autoplay=1":""),{width:"100%",height:v<8?e(E.image.container).height():"100%"})}}(d,n))}})),e(E.elems.overlay).show().css("visibility","visible"),e(E.elems.box).show()}},w=this._timer={trunk:{},add:function(e,n,i,r){if(e=e||(new Date).getTime(),r=r||!1,this.clear(e),r){var a=n;n=function(){a(),w.add(e,n,i)}}this.trunk[e]=t.setTimeout(n,i)},clear:function(e){var n,i=function(e){t.clearTimeout(this.trunk[e]),delete this.trunk[e]};if(e&&e in this.trunk)i.call(this,e);else if(void 0===e)for(n in this.trunk)this.trunk.hasOwnProperty(n)&&i.call(this,n)}};return this}).prototype={constructor:n,init:function(t,r){if(r=w(r),this._original={target:t,options:r,data:null},this._target=this._dom.target=t.nodeName?t:e(t).get(0),this._original.html=this._target.innerHTML,x.push(this),this._target){if(this._options={autoplay:!1,carousel:!0,carouselFollow:!0,carouselSpeed:400,carouselSteps:"auto",clicknext:!1,dailymotion:{foreground:"%23EEEEEE",highlight:"%235BCEC5",background:"%23222222",logo:0,hideInfos:1},dataConfig:function(){return{}},dataSelector:"img",dataSort:!1,dataSource:this._target,debug:i,dummy:i,easing:"galleria",extend:function(){},fullscreenCrop:i,fullscreenDoubleTap:!0,fullscreenTransition:i,height:0,idleMode:!0,idleTime:3e3,idleSpeed:200,imageCrop:!1,imageMargin:0,imagePan:!1,imagePanSmoothness:12,imagePosition:"50%",imageTimeout:i,initialTransition:i,keepSource:!1,layerFollow:!0,lightbox:!1,lightboxFadeSpeed:200,lightboxTransitionSpeed:200,linkSourceImages:!0,maxScaleRatio:i,maxVideoSize:i,minScaleRatio:i,overlayOpacity:.85,overlayBackground:"#0b0b0b",pauseOnInteraction:!0,popupLinks:!1,preload:2,queue:!0,responsive:!0,show:0,showInfo:!0,showCounter:!0,showImagenav:!0,swipe:"auto",theme:null,thumbCrop:!0,thumbEventType:"click:fast",thumbMargin:0,thumbQuality:"auto",thumbDisplayOrder:!0,thumbPosition:"50%",thumbnails:!0,touchTransition:i,transition:"fade",transitionInitial:i,transitionSpeed:400,trueFullscreen:!0,useCanvas:!1,variation:"",videoPoster:!0,vimeo:{title:0,byline:0,portrait:0,color:"aaaaaa"},wait:5e3,width:"auto",youtube:{modestbranding:1,autohide:1,color:"white",hd:1,rel:0,showinfo:0}},this._options.initialTransition=this._options.initialTransition||this._options.transitionInitial,r&&(!1===r.debug&&(d=!1),"number"==typeof r.imageTimeout&&r.imageTimeout,"string"==typeof r.dummy&&(c=r.dummy),"string"==typeof r.theme&&(this._options.theme=r.theme)),e(this._target).children().hide(),n.QUIRK&&n.raise("Your page is in Quirks mode, Galleria may not render correctly. Please validate your HTML and add a correct doctype."),N.length)if(this._options.theme){for(var a=0;a<N.length;a++)if(this._options.theme===N[a].name){this.theme=N[a];break}}else this.theme=N[0];return"object"==typeof this.theme?this._init():M.push(this),this}n.raise("Target not found",!0)},_init:function(){var a=this,s=this._options;if(this._initialized)return n.raise("Init failed: Gallery instance already initialized."),this;if(this._initialized=!0,!this.theme)return n.raise("Init failed: No theme found.",!0),this;if(e.extend(!0,s,this.theme.defaults,this._original.options,n.configure.options),s.swipe=function(e){return"enforced"==e||!1!==e&&"disabled"!=e&&!!n.TOUCH}(s.swipe),s.swipe&&(s.clicknext=!1,s.imagePan=!1),function(e){"getContext"in e?R=R||{elem:e,context:e.getContext("2d"),cache:{},length:0}:e=null}(r.createElement("canvas")),this.bind(n.DATA,(function(){t.screen&&t.screen.width&&Array.prototype.forEach&&this._data.forEach((function(e){var n="devicePixelRatio"in t?t.devicePixelRatio:1;p.max(t.screen.width,t.screen.height)*n<1024&&(e.big=e.image)})),this._original.data=this._data,this.get("total").innerHTML=this.getDataLength();var e=this.$("container");a._options.height<2&&(a._userRatio=a._ratio=a._options.height);var i={width:0,height:0},r=function(){return a.$("stage").height()};P.wait({until:function(){return i=a._getWH(),e.width(i.width).height(i.height),r()&&i.width&&i.height>50},success:function(){a._width=i.width,a._height=i.height,a._ratio=a._ratio||i.height/i.width,n.WEBKIT?t.setTimeout((function(){a._run()}),1):a._run()},error:function(){r()?n.raise("Could not extract sufficient width/height of the gallery container. Traced measures: width:"+i.width+"px, height: "+i.height+"px.",!0):n.raise("Could not extract a stage height from the CSS. Traced height: "+r()+"px.",!0)},timeout:"number"==typeof this._options.wait&&this._options.wait})})),this.append({"info-text":["info-title","info-description"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list","thumb-nav-right"],container:["stage","thumbnails-container","info","tooltip"]}),P.hide(this.$("counter").append(this.get("current"),r.createTextNode(" / "),this.get("total"))),this.setCounter("&#8211;"),P.hide(a.get("tooltip")),this.$("container").addClass([n.TOUCH?"touch":"notouch",this._options.variation,"galleria-theme-"+this.theme.name].join(" ")),this._options.swipe||e.each(new Array(2),(function(t){var i=new n.Picture;e(i.container).css({position:"absolute",top:0,left:0}).prepend(a._layers[t]=e(P.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]),a.$("images").append(i.container),a._controls[t]=i;var r=new n.Picture;r.isIframe=!0,e(r.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(i.container),a._controls.frames[t]=r})),this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"}),s.swipe&&(this.$("images").css({position:"absolute",top:0,left:0,width:0,height:"100%"}),this.finger=new n.Finger(this.get("stage"),{onchange:function(e){a.pause().show(e)},oncomplete:function(t){var n=p.max(0,p.min(parseInt(t,10),a.getDataLength()-1)),i=a.getData(n);e(a._thumbnails[n].container).addClass("active").siblings(".active").removeClass("active"),i&&(a.$("images").find(".galleria-frame").css("opacity",0).hide().find("iframe").remove(),a._options.carousel&&a._options.carouselFollow&&a._carousel.follow(n))}}),this.bind(n.RESCALE,(function(){this.finger.setup()})),this.$("stage").on("click",(function(){var n=a.getData();if(n){if(n.iframe){a.isPlaying()&&a.pause();var r=a._controls.frames[a._active],o=a._stageWidth,s=a._stageHeight;if(e(r.container).find("iframe").length)return;return e(r.container).css({width:o,height:s,opacity:0}).show().animate({opacity:1},200),void t.setTimeout((function(){r.load(n.iframe+(n.video?"&autoplay=1":""),{width:o,height:s},(function(e){a.$("container").addClass("videoplay"),e.scale({width:a._stageWidth,height:a._stageHeight,iframelimit:n.video?a._options.maxVideoSize:i})}))}),100)}if(n.link)if(a._options.popupLinks)t.open(n.link,"_blank");else t.location.href=n.link;else;}})),this.bind(n.IMAGE,(function(t){a.setCounter(t.index),a.setInfo(t.index);var n=this.getNext(),i=this.getPrev(),r=[i,n];r.push(this.getNext(n),this.getPrev(i),a._controls.slides.length-1);var o=[];e.each(r,(function(t,n){-1==e.inArray(n,o)&&o.push(n)})),e.each(o,(function(t,n){var i=a.getData(n),r=a._controls.slides[n],o=a.isFullscreen()&&i.big?i.big:i.image||i.iframe;i.iframe&&!i.image&&(r.isIframe=!0),r.ready||a._controls.slides[n].load(o,(function(t){t.isIframe||e(t.image).css("visibility","hidden"),a._scaleImage(t,{complete:function(t){t.isIframe||e(t.image).css({opacity:0,visibility:"visible"}).animate({opacity:1},200)}})}))}))}))),this.$("thumbnails, thumbnails-list").css({overflow:"hidden",position:"relative"}),this.$("image-nav-right, image-nav-left").on("click:fast",(function(){s.pauseOnInteraction&&a.pause();var e=/right/.test(this.className)?"next":"prev";a[e]()})).on("click",(function(e){e.preventDefault(),(s.clicknext||s.swipe)&&e.stopPropagation()})),e.each(["info","counter","image-nav"],(function(e,t){!1===s["show"+t.substr(0,1).toUpperCase()+t.substr(1).replace(/-/,"")]&&P.moveOut(a.get(t.toLowerCase()))})),this.load(),s.keepSource||v||(this._target.innerHTML=""),this.get("errors")&&this.appendChild("target","errors"),this.appendChild("target","container"),s.carousel){var l=0,d=s.show;this.bind(n.THUMBNAIL,(function(){this.updateCarousel(),++l==this.getDataLength()&&"number"==typeof d&&d>0&&this._carousel.follow(d)}))}return s.responsive&&o.on("resize",(function(){a.isFullscreen()||a.resize()})),s.fullscreenDoubleTap&&this.$("stage").on("touchstart",function(){var e,t,n,i,r,o,s=function(e){return e.originalEvent.touches?e.originalEvent.touches[0]:e};return a.$("stage").on("touchmove",(function(){e=0})),function(l){if(!/(-left|-right)/.test(l.target.className)){if(o=P.timestamp(),t=s(l).pageX,n=s(l).pageY,l.originalEvent.touches.length<2&&o-e<300&&t-i<20&&n-r<20)return a.toggleFullscreen(),void l.preventDefault();e=o,i=t,r=n}}}()),e.each(n.on.binds,(function(t,n){-1==e.inArray(n.hash,a._binds)&&a.bind(n.type,n.callback)})),this},addTimer:function(){return this._timer.add.apply(this._timer,P.array(arguments)),this},clearTimer:function(){return this._timer.clear.apply(this._timer,P.array(arguments)),this},_getWH:function(){var t,n=this.$("container"),i=this.$("target"),r=this,a={};return e.each(["width","height"],(function(e,o){r._options[o]&&"number"==typeof r._options[o]?a[o]=r._options[o]:(t=[P.parseValue(n.css(o)),P.parseValue(i.css(o)),n[o](),i[o]()],r["_"+o]||t.splice(t.length,P.parseValue(n.css("min-"+o)),P.parseValue(i.css("min-"+o))),a[o]=p.max.apply(p,t))})),r._userRatio&&(a.height=a.width*r._userRatio),a},_createThumbnails:function(i){this.get("total").innerHTML=this.getDataLength();var a,o,s,l,d=this,c=this._options,u=i?this._data.length-i.length:0,f=u,h=[],p=0,g=v<8?"http://upload.wikimedia.org/wikipedia/commons/c/c0/Blank.gif":"data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw%3D%3D",m=function(){var e=d.$("thumbnails").find(".active");return!!e.length&&e.find("img").attr("src")}(),y="string"==typeof c.thumbnails?c.thumbnails.toLowerCase():null,_=function(e){return r.defaultView&&r.defaultView.getComputedStyle?r.defaultView.getComputedStyle(o.container,null)[e]:l.css(e)},b=function(t,i,r){return function(){e(r).append(t),d.trigger({type:n.THUMBNAIL,thumbTarget:t,index:i,galleriaData:d.getData(i)})}},E=function(t){c.pauseOnInteraction&&d.pause();var n=e(t.currentTarget).data("index");d.getIndex()!==n&&d.show(n),t.preventDefault()},w=function(t,i){e(t.container).css("visibility","visible"),d.trigger({type:n.THUMBNAIL,thumbTarget:t.image,index:t.data.order,galleriaData:d.getData(t.data.order)}),"function"==typeof i&&i.call(d,t)},T=function(t,n){t.scale({width:t.data.width,height:t.data.height,crop:c.thumbCrop,margin:c.thumbMargin,canvas:c.useCanvas,position:c.thumbPosition,complete:function(t){var i,r,a=["left","top"],o=["Width","Height"];d.getData(t.index);e.each(o,(function(n,o){i=o.toLowerCase(),!0===c.thumbCrop&&c.thumbCrop!==i||((r={})[i]=t[i],e(t.container).css(r),(r={})[a[n]]=0,e(t.image).css(r)),t["outer"+o]=e(t.container)["outer"+o](!0)})),P.toggleQuality(t.image,!0===c.thumbQuality||"auto"===c.thumbQuality&&t.original.width<3*t.width),c.thumbDisplayOrder&&!t.lazy?e.each(h,(function(e,t){if(e===p&&t.ready&&!t.displayed)return p++,t.displayed=!0,void w(t,n)})):w(t,n)}})};for(i||(this._thumbnails=[],this.$("thumbnails").empty());this._data[u];u++)a=(s=this._data[u]).thumb||s.image,!0!==c.thumbnails&&"lazy"!=y||!s.thumb&&!s.image?s.iframe&&null!==y||"empty"===y||"numbers"===y?(o={container:P.create("galleria-image"),image:P.create("img","span"),ready:!0,data:{order:u}},"numbers"===y&&e(o.image).text(u+1),s.iframe&&e(o.image).addClass("iframe"),this.$("thumbnails").append(o.container),t.setTimeout(b(o.image,u,o.container),50+20*u)):o={container:null,image:null}:((o=new n.Picture(u)).index=u,o.displayed=!1,o.lazy=!1,o.video=!1,this.$("thumbnails").append(o.container),(l=e(o.container)).css("visibility","hidden"),o.data={width:P.parseValue(_("width")),height:P.parseValue(_("height")),order:u,src:a},!0!==c.thumbCrop?l.css({width:"auto",height:"auto"}):l.css({width:o.data.width,height:o.data.height}),"lazy"==y?(l.addClass("lazy"),o.lazy=!0,o.load(g,{height:o.data.height,width:o.data.width})):o.load(a,T),"all"===c.preload&&o.preload(s.image)),e(o.container).add(c.keepSource&&c.linkSourceImages?s.original:null).data("index",u).on(c.thumbEventType,E).data("thumbload",T),m===a&&e(o.container).addClass("active"),this._thumbnails.push(o);return h=this._thumbnails.slice(f),this},lazyLoad:function(t,n){var i=t.constructor==Array?t:[t],r=this,a=0;return e.each(i,(function(t,o){if(!(o>r._thumbnails.length-1)){var s=r._thumbnails[o],l=s.data,d=function(){++a==i.length&&"function"==typeof n&&n.call(r)},c=e(s.container).data("thumbload");s.video?c.call(r,s,d):s.load(l.src,(function(e){c.call(r,e,d)}))}})),this},lazyLoadChunks:function(e,n){var i=this.getDataLength(),r=0,a=0,o=[],s=[],l=this;for(n=n||0;r<i;r++)s.push(r),++a!=e&&r!=i-1||(o.push(s),a=0,s=[]);var d=function(e){var i=o.shift();i&&t.setTimeout((function(){l.lazyLoad(i,(function(){d(!0)}))}),n&&e?n:0)};return d(!1),this},_run:function(){var r=this;r._createThumbnails(),P.wait({timeout:1e4,until:function(){return n.OPERA&&r.$("stage").css("display","inline-block"),r._stageWidth=r.$("stage").width(),r._stageHeight=r.$("stage").height(),r._stageWidth&&r._stageHeight>50},success:function(){if(A.push(r),r._options.swipe){var a=r.$("images").width(r.getDataLength()*r._stageWidth);e.each(new Array(r.getDataLength()),(function(t){var i=new n.Picture,o=r.getData(t);e(i.container).css({position:"absolute",top:0,left:r._stageWidth*t}).prepend(r._layers[t]=e(P.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]).appendTo(a),o.video&&L(i.container),r._controls.slides.push(i);var s=new n.Picture;s.isIframe=!0,e(s.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(i.container),r._controls.frames.push(s)})),r.finger.setup()}if(P.show(r.get("counter")),r._options.carousel&&r._carousel.bindControls(),r._options.autoplay&&(r.pause(),"number"==typeof r._options.autoplay&&(r._playtime=r._options.autoplay),r._playing=!0),r._firstrun)return r._options.autoplay&&r.trigger(n.PLAY),void("number"==typeof r._options.show&&r.show(r._options.show));r._firstrun=!0,n.History&&n.History.change((function(e){isNaN(e)?t.history.go(-1):r.show(e,i,!0)})),r.trigger(n.READY),r.theme.init.call(r,r._options),e.each(n.ready.callbacks,(function(e,t){"function"==typeof t&&t.call(r,r._options)})),r._options.extend.call(r,r._options),/^[0-9]{1,4}$/.test(f)&&n.History?r.show(f,i,!0):r._data[r._options.show]&&r.show(r._options.show),r._options.autoplay&&r.trigger(n.PLAY)},error:function(){n.raise("Stage width or height is too small to show the gallery. Traced measures: width:"+r._stageWidth+"px, height: "+r._stageHeight+"px.",!0)}})},load:function(t,i,r){var a=this,o=this._options;return this._data=[],this._thumbnails=[],this.$("thumbnails").empty(),"function"==typeof i&&(r=i,i=null),t=t||o.dataSource,i=i||o.dataSelector,r=r||o.dataConfig,e.isPlainObject(t)&&(t=[t]),e.isArray(t)?this.validate(t)?this._data=t:n.raise("Load failed: JSON Array not valid."):(i+=",.video,.iframe",e(t).find(i).each((function(t,n){n=e(n);var i={},o=n.parent(),s=o.attr("href"),l=o.attr("rel");s&&("IMG"==n[0].nodeName||n.hasClass("video"))&&k(s)?i.video=s:s&&n.hasClass("iframe")?i.iframe=s:i.image=i.big=s,l&&(i.big=l),e.each("big title description link layer image".split(" "),(function(e,t){n.data(t)&&(i[t]=n.data(t).toString())})),i.big||(i.big=i.image),a._data.push(e.extend({title:n.attr("title")||"",thumb:n.attr("src"),image:n.attr("src"),big:n.attr("src"),description:n.attr("alt")||"",link:n.attr("longdesc"),original:n.get(0)},i,r(n)))}))),"function"==typeof o.dataSort?s.sort.call(this._data,o.dataSort):"random"==o.dataSort&&this._data.sort((function(){return p.round(p.random())-.5})),this.getDataLength()&&this._parseData((function(){this.trigger(n.DATA)})),this},_parseData:function(t){var n,r=this,a=!1,o=function(){var n=!0;e.each(r._data,(function(e,t){if(t.loading)return n=!1,!1})),n&&!a&&(a=!0,t.call(r))};return e.each(this._data,(function(t,a){if(n=r._data[t],"thumb"in a==!1&&(n.thumb=a.image),a.big||(n.big=a.image),"video"in a){var s=k(a.video);s&&(n.iframe=new C(s.provider,s.id).embed()+function(){if("object"==typeof r._options[s.provider]){var t="?",n=[];return e.each(r._options[s.provider],(function(e,t){n.push(e+"="+t)})),"youtube"==s.provider&&(n=["wmode=opaque"].concat(n)),t+n.join("&")}return""}(),n.thumb&&n.image||e.each(["thumb","image"],(function(e,t){if("image"!=t||r._options.videoPoster){var a=new C(s.provider,s.id);n[t]||(n.loading=!0,a.getMedia(t,function(e,t){return function(n){e[t]=n,"image"!=t||e.big||(e.big=e.image),delete e.loading,o()}}(n,t)))}else n.image=i})))}})),o(),this},destroy:function(){return this.$("target").data("galleria",null),this.$("container").off("galleria"),this.get("target").innerHTML=this._original.html,this.clearTimer(),P.removeFromArray(x,this),P.removeFromArray(A,this),n._waiters.length&&e.each(n._waiters,(function(e,n){n&&t.clearTimeout(n)})),this},splice:function(){var e=this,n=P.array(arguments);return t.setTimeout((function(){s.splice.apply(e._data,n),e._parseData((function(){e._createThumbnails()}))}),2),e},push:function(){var e=this,n=P.array(arguments);return 1==n.length&&n[0].constructor==Array&&(n=n[0]),t.setTimeout((function(){s.push.apply(e._data,n),e._parseData((function(){e._createThumbnails(n)}))}),2),e},_getActive:function(){return this._controls.getActive()},validate:function(){return!0},bind:function(e,t){return e=T(e),this.$("container").on(e,this.proxy(t)),this},unbind:function(e){return e=T(e),this.$("container").off(e),this},trigger:function(t){return t="object"==typeof t?e.extend(t,{scope:this}):{type:T(t),scope:this},this.$("container").trigger(t),this},addIdleState:function(e,t,n,i){return this._idle.add.apply(this._idle,P.array(arguments)),this},removeIdleState:function(e){return this._idle.remove.apply(this._idle,P.array(arguments)),this},enterIdleMode:function(){return this._idle.hide(),this},exitIdleMode:function(){return this._idle.showAll(),this},enterFullscreen:function(e){return this._fullscreen.enter.apply(this,P.array(arguments)),this},exitFullscreen:function(e){return this._fullscreen.exit.apply(this,P.array(arguments)),this},toggleFullscreen:function(e){return this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,P.array(arguments)),this},bindTooltip:function(e,t){return this._tooltip.bind.apply(this._tooltip,P.array(arguments)),this},defineTooltip:function(e,t){return this._tooltip.define.apply(this._tooltip,P.array(arguments)),this},refreshTooltip:function(e){return this._tooltip.show.apply(this._tooltip,P.array(arguments)),this},openLightbox:function(){return this._lightbox.show.apply(this._lightbox,P.array(arguments)),this},closeLightbox:function(){return this._lightbox.hide.apply(this._lightbox,P.array(arguments)),this},hasVariation:function(t){return e.inArray(t,this._options.variation.split(/\s+/))>-1},getActiveImage:function(){var e=this._getActive();return e?e.image:i},getActiveThumb:function(){return this._thumbnails[this._active].image||i},getMousePosition:function(e){return{x:e.pageX-this.$("container").offset().left,y:e.pageY-this.$("container").offset().top}},addPan:function(t){if(!1!==this._options.imageCrop){t=e(t||this.getActiveImage());var n=this,i=t.width()/2,r=t.height()/2,a=parseInt(t.css("left"),10),o=parseInt(t.css("top"),10),s=a||0,l=o||0,d=0,c=0,u=!1,f=P.timestamp(),h=0,g=0,m=function(e,n,i){if(e>0&&(g=p.round(p.max(-1*e,p.min(0,n))),h!==g))if(h=g,8===v)t.parent()["scroll"+i](-1*g);else{var r={};r[i.toLowerCase()]=g,t.css(r)}},y=function(e){P.timestamp()-f<50||(u=!0,i=n.getMousePosition(e).x,r=n.getMousePosition(e).y)},_=function(){u&&(d=t.width()-n._stageWidth,c=t.height()-n._stageHeight,a=i/n._stageWidth*d*-1,o=r/n._stageHeight*c*-1,s+=(a-s)/n._options.imagePanSmoothness,l+=(o-l)/n._options.imagePanSmoothness,m(c,l,"Top"),m(d,s,"Left"))};return 8===v&&(t.parent().scrollTop(-1*l).scrollLeft(-1*s),t.css({top:0,left:0})),this.$("stage").off("mousemove",y).on("mousemove",y),this.addTimer("pan"+n._id,_,50,!0),this}},proxy:function(e,t){return"function"!=typeof e?g:(t=t||this,function(){return e.apply(t,P.array(arguments))})},getThemeName:function(){return this.theme.name},removePan:function(){return this.$("stage").off("mousemove"),this.clearTimer("pan"+this._id),this},addElement:function(t){var n=this._dom
;return e.each(P.array(arguments),(function(e,t){n[t]=P.create("galleria-"+t)})),this},attachKeyboard:function(e){return this._keyboard.attach.apply(this._keyboard,P.array(arguments)),this},detachKeyboard:function(){return this._keyboard.detach.apply(this._keyboard,P.array(arguments)),this},appendChild:function(e,t){return this.$(e).append(this.get(t)||t),this},prependChild:function(e,t){return this.$(e).prepend(this.get(t)||t),this},remove:function(e){return this.$(P.array(arguments).join(",")).remove(),this},append:function(e){var t,n;for(t in e)if(e.hasOwnProperty(t))if(e[t].constructor===Array)for(n=0;e[t][n];n++)this.appendChild(t,e[t][n]);else this.appendChild(t,e[t]);return this},_scaleImage:function(t,n){if(t=t||this._controls.getActive()){var i,r=function(t){e(t.container).children(":first").css({top:p.max(0,P.parseValue(t.image.style.top)),left:p.max(0,P.parseValue(t.image.style.left)),width:P.parseValue(t.image.width),height:P.parseValue(t.image.height)})};return n=e.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition,iframelimit:this._options.maxVideoSize},n),this._options.layerFollow&&!0!==this._options.imageCrop?"function"==typeof n.complete?(i=n.complete,n.complete=function(){i.call(t,t),r(t)}):n.complete=r:e(t.container).children(":first").css({top:0,left:0}),t.scale(n),this}},updateCarousel:function(){return this._carousel.update(),this},resize:function(t,n){"function"==typeof t&&(n=t,t=i),t=e.extend({width:0,height:0},t);var r=this,a=this.$("container");return e.each(t,(function(e,n){n||(a[e]("auto"),t[e]=r._getWH()[e])})),e.each(t,(function(e,t){a[e](t)})),this.rescale(n)},rescale:function(t,r,a){var o=this;return"function"==typeof t&&(a=t,t=i),function(){o._stageWidth=t||o.$("stage").width(),o._stageHeight=r||o.$("stage").height(),o._options.swipe?(e.each(o._controls.slides,(function(t,n){o._scaleImage(n),e(n.container).css("left",o._stageWidth*t)})),o.$("images").css("width",o._stageWidth*o.getDataLength())):o._scaleImage(),o._options.carousel&&o.updateCarousel(),o._controls.frames[o._controls.active]&&o._controls.frames[o._controls.active].scale({width:o._stageWidth,height:o._stageHeight,iframelimit:o._options.maxVideoSize}),o.trigger(n.RESCALE),"function"==typeof a&&a.call(o)}.call(o),this},refreshImage:function(){return this._scaleImage(),this._options.imagePan&&this.addPan(),this},_preload:function(){if(this._options.preload){var e,t,i,r=this.getNext();try{for(t=this._options.preload;t>0;t--)e=new n.Picture,i=this.getData(r),e.preload(this.isFullscreen()&&i.big?i.big:i.image),r=this.getNext(r)}catch(e){}}},show:function(i,r,a){var o=this._options.swipe;if(o||!(this._queue.length>3||!1===i||!this._options.queue&&this._queue.stalled)){if(i=p.max(0,p.min(parseInt(i,10),this.getDataLength()-1)),r=void 0!==r?!!r:i<this.getIndex(),(a=a||!1)||!n.History){if(this.finger&&i!==this._active&&(this.finger.to=-i*this.finger.width,this.finger.index=i),this._active=i,o){var l=this.getData(i),d=this;if(!l)return;var c=this.isFullscreen()&&l.big?l.big:l.image||l.iframe,u=this._controls.slides[i],f=u.isCached(c),h=this._thumbnails[i],g={cached:f,index:i,rewind:r,imageTarget:u.image,thumbTarget:h.image,galleriaData:l};this.trigger(e.extend(g,{type:n.LOADSTART})),d.$("container").removeClass("videoplay");var m=function(){d._layers[i].innerHTML=d.getData().layer||"",d.trigger(e.extend(g,{type:n.LOADFINISH})),d._playCheck()};d._preload(),t.setTimeout((function(){u.ready&&e(u.image).attr("src")==c?(d.trigger(e.extend(g,{type:n.IMAGE})),m()):(l.iframe&&!l.image&&(u.isIframe=!0),u.load(c,(function(t){g.imageTarget=t.image,d._scaleImage(t,m).trigger(e.extend(g,{type:n.IMAGE})),m()})))}),100)}else s.push.call(this._queue,{index:i,rewind:r}),this._queue.stalled||this._show();return this}n.History.set(i.toString())}},_show:function(){var r=this,a=this._queue[0],o=this.getData(a.index);if(o){var l=this.isFullscreen()&&o.big?o.big:o.image||o.iframe,d=this._controls.getActive(),c=this._controls.getNext(),u=c.isCached(l),f=this._thumbnails[a.index],h=function(){e(c.image).trigger("mouseup")};r.$("container").toggleClass("iframe",!!o.isIframe).removeClass("videoplay");var p=function(a,o,l,d,c){return function(){F.active=!1,P.toggleQuality(o.image,r._options.imageQuality),r._layers[r._controls.active].innerHTML="",e(l.container).css({zIndex:0,opacity:0}).show(),e(l.container).find("iframe, .galleria-videoicon").remove(),e(r._controls.frames[r._controls.active].container).hide(),e(o.container).css({zIndex:1,left:0,top:0}).show(),r._controls.swap(),r._options.imagePan&&r.addPan(o.image),(a.iframe&&a.image||a.link||r._options.lightbox||r._options.clicknext)&&e(o.image).css({cursor:"pointer"}).on("mouseup",(function(o){if(!("number"==typeof o.which&&o.which>1)){if(a.iframe){r.isPlaying()&&r.pause();var s=r._controls.frames[r._controls.active],l=r._stageWidth,d=r._stageHeight;return e(s.container).css({width:l,height:d,opacity:0}).show().animate({opacity:1},200),void t.setTimeout((function(){s.load(a.iframe+(a.video?"&autoplay=1":""),{width:l,height:d},(function(e){r.$("container").addClass("videoplay"),e.scale({width:r._stageWidth,height:r._stageHeight,iframelimit:a.video?r._options.maxVideoSize:i})}))}),100)}if(r._options.clicknext&&!n.TOUCH)return r._options.pauseOnInteraction&&r.pause(),void r.next();a.link?r._options.popupLinks?t.open(a.link,"_blank"):t.location.href=a.link:r._options.lightbox&&r.openLightbox()}})),r._playCheck(),r.trigger({type:n.IMAGE,index:d.index,imageTarget:o.image,thumbTarget:c.image,galleriaData:a}),s.shift.call(r._queue),r._queue.stalled=!1,r._queue.length&&r._show()}}(o,c,d,a,f);this._options.carousel&&this._options.carouselFollow&&this._carousel.follow(a.index),r._preload(),P.show(c.container),c.isIframe=o.iframe&&!o.image,e(r._thumbnails[a.index].container).addClass("active").siblings(".active").removeClass("active"),r.trigger({type:n.LOADSTART,cached:u,index:a.index,rewind:a.rewind,imageTarget:c.image,thumbTarget:f.image,galleriaData:o}),r._queue.stalled=!0,c.load(l,(function(t){var s=e(r._layers[1-r._controls.active]).html(o.layer||"").hide();r._scaleImage(t,{complete:function(t){"image"in d&&P.toggleQuality(d.image,!1),P.toggleQuality(t.image,!1),r.removePan(),r.setInfo(a.index),r.setCounter(a.index),o.layer&&(s.show(),(o.iframe&&o.image||o.link||r._options.lightbox||r._options.clicknext)&&s.css("cursor","pointer").off("mouseup").mouseup(h)),o.video&&o.image&&L(t.container);var l=r._options.transition;if(e.each({initial:null===d.image,touch:n.TOUCH,fullscreen:r.isFullscreen()},(function(e,t){if(t&&r._options[e+"Transition"]!==i)return l=r._options[e+"Transition"],!1})),l in F.effects==!1)p();else{var c={prev:d.container,next:t.container,rewind:a.rewind,speed:r._options.transitionSpeed||400};F.active=!0,F.init.call(r,l,c,p)}r.trigger({type:n.LOADFINISH,cached:u,index:a.index,rewind:a.rewind,imageTarget:t.image,thumbTarget:r._thumbnails[a.index].image,galleriaData:r.getData(a.index)})}})}))}},getNext:function(e){return(e="number"==typeof e?e:this.getIndex())===this.getDataLength()-1?0:e+1},getPrev:function(e){return 0===(e="number"==typeof e?e:this.getIndex())?this.getDataLength()-1:e-1},next:function(){return this.getDataLength()>1&&this.show(this.getNext(),!1),this},prev:function(){return this.getDataLength()>1&&this.show(this.getPrev(),!0),this},get:function(e){return e in this._dom?this._dom[e]:null},getData:function(e){return e in this._data?this._data[e]:this._data[this._active]},getDataLength:function(){return this._data.length},getIndex:function(){return"number"==typeof this._active&&this._active},getStageHeight:function(){return this._stageHeight},getStageWidth:function(){return this._stageWidth},getOptions:function(e){return void 0===e?this._options:this._options[e]},setOptions:function(t,n){return"object"==typeof t?e.extend(this._options,t):this._options[t]=n,this},play:function(e){return this._playing=!0,this._playtime=e||this._playtime,this._playCheck(),this.trigger(n.PLAY),this},pause:function(){return this._playing=!1,this.trigger(n.PAUSE),this},playToggle:function(e){return this._playing?this.pause():this.play(e)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var e=this,t=0,i=20,r=P.timestamp(),a="play"+this._id;if(this._playing){this.clearTimer(a);var o=function(){if((t=P.timestamp()-r)>=e._playtime&&e._playing)return e.clearTimer(a),void e.next();e._playing&&(e.trigger({type:n.PROGRESS,percent:p.ceil(t/e._playtime*100),seconds:p.floor(t/1e3),milliseconds:t}),e.addTimer(a,o,i))};e.addTimer(a,o,i)}},setPlaytime:function(e){return this._playtime=e,this},setIndex:function(e){return this._active=e,this},setCounter:function(e){if("number"==typeof e?e++:void 0===e&&(e=this.getIndex()+1),this.get("current").innerHTML=e,v){var t=this.$("counter"),n=t.css("opacity");1===parseInt(n,10)?P.removeAlpha(t[0]):this.$("counter").css("opacity",n)}return this},setInfo:function(t){var n=this,i=this.getData(t);return e.each(["title","description"],(function(e,t){var r=n.$("info-"+t);i[t]?r[i[t].length?"show":"hide"]().html(i[t]):r.empty().hide()})),this},hasInfo:function(e){var t,n="title description".split(" ");for(t=0;n[t];t++)if(this.getData(e)[n[t]])return!0;return!1},jQuery:function(t){var n=this,i=[];e.each(t.split(","),(function(t,r){r=e.trim(r),n.get(r)&&i.push(r)}));var r=e(n.get(i.shift()));return e.each(i,(function(e,t){r=r.add(n.get(t))})),r},$:function(e){return this.jQuery.apply(this,P.array(arguments))}},e.each(E,(function(e,t){var i=/_/.test(t)?t.replace(/_/g,""):t;n[t.toUpperCase()]="galleria."+i})),e.extend(n,{IE9:9===v,IE8:8===v,IE7:7===v,IE6:6===v,IE:v,WEBKIT:/webkit/.test(u),CHROME:/chrome/.test(u),SAFARI:/safari/.test(u)&&!/chrome/.test(u),QUIRK:v&&r.compatMode&&"BackCompat"===r.compatMode,MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!t.opera,IPHONE:/iphone/.test(u),IPAD:/ipad/.test(u),ANDROID:/android/.test(u),TOUCH:"ontouchstart"in r}),n.addTheme=function(i){i.name||n.raise("No theme name specified"),"object"!=typeof i.defaults?i.defaults={}:i.defaults=w(i.defaults);var r=!1;return"string"==typeof i.css?(e("link").each((function(e,t){if(new RegExp(i.css).test(t.href))return r=!0,O(i),!1})),r||e((function(){var a=0,o=function(){e("script").each((function(e,n){new RegExp("galleria\\."+i.name.toLowerCase()+"\\.").test(n.src)&&(r=n.src.replace(/[^\/]*$/,"")+i.css,t.setTimeout((function(){P.loadCSS(r,"galleria-theme-"+i.name,(function(){O(i)}))}),1))})),r||(a++>5?n.raise("No theme CSS loaded"):t.setTimeout(o,500))};o()}))):O(i),i},n.loadTheme=function(i){if(!e("script").filter((function(){return e(this).attr("src")==i})).length){var r,a=!1;return e(t).load((function(){a||(r=t.setTimeout((function(){a||n.raise("Galleria had problems loading theme at "+i+". Please check theme path or load manually.",!0)}),2e4))})),P.loadScript(i,(function(){a=!0,t.clearTimeout(r)})),n}},n.get=function(e){return x[e]?x[e]:"number"!=typeof e?x:void n.raise("Gallery index "+e+" not found")},n.configure=function(t,i){var r={};return"string"==typeof t&&i?(r[t]=i,t=r):e.extend(r,t),n.configure.options=r,e.each(n.get(),(function(e,t){t.setOptions(r)})),n},n.configure.options={},n.on=function(t,i){if(t){var r=t+(i=i||g).toString().replace(/\s/g,"")+P.timestamp();return e.each(n.get(),(function(e,n){n._binds.push(r),n.bind(t,i)})),n.on.binds.push({type:t,callback:i,hash:r}),n}},n.on.binds=[],n.run=function(t,i){return e.isFunction(i)&&(i={extend:i}),e(t||"#galleria").galleria(i),n},n.addTransition=function(e,t){return F.effects[e]=t,n},n.utils=P,n.log=function(){var n=P.array(arguments);if(!("console"in t)||!("log"in t.console))return t.alert(n.join("<br>"));try{return t.console.log.apply(t.console,n)}catch(i){e.each(n,(function(){t.console.log(this)}))}},n.ready=function(t){return"function"!=typeof t||(e.each(A,(function(e,n){t.call(n,n._options)})),n.ready.callbacks.push(t)),n},n.ready.callbacks=[],n.raise=function(t,n){var i=n?"Fatal error":"Error",r={color:"#fff",position:"absolute",top:0,left:0,zIndex:1e5},a=function(t){var a='<div style="padding:4px;margin:0 0 2px;background:#'+(n?"811":"222")+';">'+(n?"<strong>"+i+": </strong>":"")+t+"</div>";e.each(x,(function(){var e=this.$("errors"),t=this.$("target");e.length||(t.css("position","relative"),e=this.addElement("errors").appendChild("target","errors").$("errors").css(r)),e.append(a)})),x.length||e("<div>").css(e.extend(r,{position:"fixed"})).append(a).appendTo(y().body)};if(d){if(a(t),n)throw new Error(i+": "+t)}else if(n){if(D)return;D=!0,n=!1,a("Gallery could not load.")}},n.version=l,n.getLoadedThemes=function(){return e.map(N,(function(e){return e.name}))},n.requires=function(e,t){return t=t||"You need to upgrade Galleria to version "+e+" to use one or more components.",n.version<e&&n.raise(t,!0),n},n.Picture=function(t){this.id=t||null,this.image=null,this.container=P.create("galleria-image"),e(this.container).css({overflow:"hidden",position:"relative"}),this.original={width:0,height:0},this.ready=!1,this.isIframe=!1},n.Picture.prototype={cache:{},show:function(){P.show(this.image)},hide:function(){P.moveOut(this.image)},clear:function(){this.image=null},isCached:function(e){return!!this.cache[e]},preload:function(t){e(new Image).load(function(e,t){return function(){t[e]=e}}(t,this.cache)).attr("src",t)},load:function(i,r,a){if("function"==typeof r&&(a=r,r=null),this.isIframe){var o="if"+(new Date).getTime(),s=this.image=e("<iframe>",{src:i,frameborder:0,id:o,allowfullscreen:!0,css:{visibility:"hidden"}})[0];return r&&e(s).css(r),e(this.container).find("iframe,img").remove(),this.container.appendChild(this.image),e("#"+o).load(function(n,i){return function(){t.setTimeout((function(){e(n.image).css("visibility","visible"),"function"==typeof i&&i.call(n,n)}),10)}}(this,a)),this.container}this.image=new Image,n.IE8&&e(this.image).css("filter","inherit"),n.IE||n.CHROME||n.SAFARI||e(this.image).css("image-rendering","optimizequality");var l=!1,d=!1,u=e(this.container),f=e(this.image),h=function(){l?c?e(this).attr("src",c):n.raise("Image not found: "+i):(l=!0,t.setTimeout(function(e,t){return function(){e.attr("src",t+(t.indexOf("?")>-1?"&":"?")+P.timestamp())}}(e(this),i),50))},p=function(i,a,o){return function(){var s=function(){e(this).off("load"),i.original=r||{height:this.height,width:this.width},n.HAS3D&&(this.style.MozTransform=this.style.webkitTransform="translate3d(0,0,0)"),u.append(this),i.cache[o]=o,"function"==typeof a&&t.setTimeout((function(){a.call(i,i)}),1)};this.width&&this.height?s.call(this):function(t){P.wait({until:function(){return t.width&&t.height},success:function(){s.call(t)},error:function(){d?n.raise("Could not extract width/height from image: "+t.src+". Traced measures: width:"+t.width+"px, height: "+t.height+"px."):(e(new Image).load(p).attr("src",t.src),d=!0)},timeout:100})}(this)}}(this,a,i);return u.find("iframe,img").remove(),f.css("display","block"),P.hide(this.image),e.each("minWidth minHeight maxWidth maxHeight".split(" "),(function(e,t){f.css(t,/min/.test(t)?"0":"none")})),f.load(p).on("error",h).attr("src",i),this.container},scale:function(t){var r=this;if(t=e.extend({width:0,height:0,min:i,max:i,margin:0,complete:g,position:"center",crop:!1,canvas:!1,iframelimit:i},t),this.isIframe){var a,o,s=t.width,l=t.height;if(t.iframelimit){var d=p.min(t.iframelimit/s,t.iframelimit/l);d<1?(a=s*d,o=l*d,e(this.image).css({top:l/2-o/2,left:s/2-a/2,position:"absolute"})):e(this.image).css({top:0,left:0})}e(this.image).width(a||s).height(o||l).removeAttr("width").removeAttr("height"),e(this.container).width(s).height(l),t.complete.call(r,r);try{this.image.contentWindow&&e(this.image.contentWindow).trigger("resize")}catch(e){}return this.container}if(!this.image)return this.container;var c,u,f,h=e(r.container);return P.wait({until:function(){return c=t.width||h.width()||P.parseValue(h.css("width")),u=t.height||h.height()||P.parseValue(h.css("height")),c&&u},success:function(){var n=(c-2*t.margin)/r.original.width,i=(u-2*t.margin)/r.original.height,a=p.min(n,i),o=p.max(n,i),s={true:o,width:n,height:i,false:a,landscape:r.original.width>r.original.height?o:a,portrait:r.original.width<r.original.height?o:a}[t.crop.toString()],l="";t.max&&(s=p.min(t.max,s)),t.min&&(s=p.max(t.min,s)),e.each(["width","height"],(function(t,n){e(r.image)[n](r[n]=r.image[n]=p.round(r.original[n]*s))})),e(r.container).width(c).height(u),t.canvas&&R&&(R.elem.width=r.width,R.elem.height=r.height,l=r.image.src+":"+r.width+"x"+r.height,r.image.src=R.cache[l]||function(e){R.context.drawImage(r.image,0,0,r.original.width*s,r.original.height*s);try{return f=R.elem.toDataURL(),R.length+=f.length,R.cache[e]=f,f}catch(e){return r.image.src}}(l));var d={},h={},g=function(t,n,i){var a=0;if(/\%/.test(t)){var o=parseInt(t,10)/100,s=r.image[n]||e(r.image)[n]();a=p.ceil(-1*s*o+i*o)}else a=P.parseValue(t);return a},m={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};e.each(t.position.toLowerCase().split(" "),(function(e,t){"center"===t&&(t="50%"),d[e?"top":"left"]=t})),e.each(d,(function(t,n){m.hasOwnProperty(n)&&e.extend(h,m[n])})),d=d.top?e.extend(d,h):h,d=e.extend({top:"50%",left:"50%"},d),e(r.image).css({position:"absolute",top:g(d.top,"height",u),left:g(d.left,"width",c)}),r.show(),r.ready=!0,t.complete.call(r,r)},error:function(){n.raise("Could not scale image: "+r.image.src)},timeout:1e3}),this}},e.extend(e.easing,{galleria:function(e,t,n,i,r){return(t/=r/2)<1?i/2*t*t*t+n:i/2*((t-=2)*t*t+2)+n},galleriaIn:function(e,t,n,i,r){return i*(t/=r)*t+n},galleriaOut:function(e,t,n,i,r){return-i*(t/=r)*(t-2)+n}}),n.Finger=function(){p.abs;var i=n.HAS3D=function(){var t,n,i=r.createElement("p"),a=["webkit","O","ms","Moz",""],o=0,s="transform";for(y().html.insertBefore(i,null);a[o];o++)n=a[o]?a[o]+"Transform":s,void 0!==i.style[n]&&(i.style[n]="translate3d(1px,1px,1px)",t=e(i).css(a[o]?"-"+a[o].toLowerCase()+"-"+s:s));return y().html.removeChild(i),void 0!==t&&t.length>0&&"none"!==t}(),o=function(){var e="RequestAnimationFrame";return t.requestAnimationFrame||t["webkit"+e]||t["moz"+e]||t["o"+e]||t["ms"+e]||function(e){t.setTimeout(e,1e3/60)}}(),s=function(n,r){if(this.config={start:0,duration:500,onchange:function(){},oncomplete:function(){},easing:function(e,t,n,i,r){return-i*((t=t/r-1)*t*t*t-1)+n}},this.easeout=function(e,t,n,i,r){return i*((t=t/r-1)*t*t*t*t+1)+n},n.children.length){var a=this;e.extend(this.config,r),this.elem=n,this.child=n.children[0],this.to=this.pos=0,this.touching=!1,this.start={},this.index=this.config.start,this.anim=0,this.easing=this.config.easing,i||(this.child.style.position="absolute",this.elem.style.position="relative"),e.each(["ontouchstart","ontouchmove","ontouchend","setup"],(function(e,t){a[t]=function(e){return function(){e.apply(a,arguments)}}(a[t])})),this.setX=function(){var e=a.child.style;i?e.MozTransform=e.webkitTransform=e.transform="translate3d("+a.pos+"px,0,0)":e.left=a.pos+"px"},e(n).on("touchstart",this.ontouchstart),e(t).on("resize",this.setup),e(t).on("orientationchange",this.setup),this.setup(),function e(){o(e),a.loop.call(a)}()}};return s.prototype={constructor:s,setup:function(){this.width=e(this.elem).width(),this.length=p.ceil(e(this.child).width()/this.width),0!==this.index&&(this.index=p.max(0,p.min(this.index,this.length-1)),this.pos=this.to=-this.width*this.index)},setPosition:function(e){this.pos=e,this.to=e},ontouchstart:function(e){var t=e.originalEvent.touches;this.start={pageX:t[0].pageX,pageY:t[0].pageY,time:+new Date},this.isScrolling=null,this.touching=!0,this.deltaX=0,a.on("touchmove",this.ontouchmove),a.on("touchend",this.ontouchend)},ontouchmove:function(e){var t=e.originalEvent.touches;t&&t.length>1||e.scale&&1!==e.scale||(this.deltaX=t[0].pageX-this.start.pageX,null===this.isScrolling&&(this.isScrolling=!!(this.isScrolling||p.abs(this.deltaX)<p.abs(t[0].pageY-this.start.pageY))),this.isScrolling||(e.preventDefault(),this.deltaX/=!this.index&&this.deltaX>0||this.index==this.length-1&&this.deltaX<0?p.abs(this.deltaX)/this.width+1.8:1,this.to=this.deltaX-this.index*this.width),e.stopPropagation())},ontouchend:function(){this.touching=!1;var e=+new Date-this.start.time<250&&p.abs(this.deltaX)>40||p.abs(this.deltaX)>this.width/2,t=!this.index&&this.deltaX>0||this.index==this.length-1&&this.deltaX<0;this.isScrolling||this.show(this.index+(e&&!t?this.deltaX<0?1:-1:0)),a.off("touchmove",this.ontouchmove),a.off("touchend",this.ontouchend)},show:function(e){e!=this.index?this.config.onchange.call(this,e):this.to=-e*this.width},moveTo:function(e){e!=this.index&&(this.pos=this.to=-e*this.width,this.index=e)},loop:function(){var e=this.to-this.pos,t=1;if(this.width&&e&&(t=p.max(.5,p.min(1.5,p.abs(e/this.width)))),this.touching||p.abs(e)<=1)this.pos=this.to,e=0,this.anim&&!this.touching&&this.config.oncomplete(this.index),this.anim=0,this.easing=this.config.easing;else{this.anim||(this.anim={start:this.pos,time:+new Date,distance:e,factor:t,destination:this.to});var n=+new Date-this.anim.time,i=this.config.duration*this.anim.factor;if(n>i||this.anim.destination!=this.to)return this.anim=0,void(this.easing=this.easeout);this.pos=this.easing(null,n,this.anim.start,this.anim.distance,i)}this.setX()}},s}(),e.fn.galleria=function(t){var i=this.selector;return e(this).length?this.each((function(){e.data(this,"galleria")&&(e.data(this,"galleria").destroy(),e(this).find("*").hide()),e.data(this,"galleria",(new n).init(this,t))})):(e((function(){e(i).length?e(i).galleria(t):n.utils.wait({until:function(){return e(i).length},success:function(){e(i).galleria(t)},error:function(){n.raise('Init failed: Galleria could not find the element "'+i+'".')},timeout:5e3})})),this)},"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=n:(t.Galleria=n,"function"==typeof define&&define.amd&&define("galleria",["jquery"],(function(){return n})))}(jQuery,this),function(e){Galleria.addTheme({name:"classic",author:"Galleria",defaults:{transition:"slide",thumbCrop:"height",_toggleInfo:!0},init:function(t){Galleria.requires(1.4,"This version of Classic theme requires Galleria 1.4 or later"),this.addElement("info-link","info-close"),this.append({info:["info-link","info-close"]});var n=this.$("info-link,info-close,info-text"),i=Galleria.TOUCH;this.$("loader,counter").show().css("opacity",.4),i||(this.addIdleState(this.get("image-nav-left"),{left:-50}),this.addIdleState(this.get("image-nav-right"),{right:-50}),this.addIdleState(this.get("counter"),{opacity:0})),!0===t._toggleInfo?n.bind("click:fast",(function(){n.toggle()})):(n.show(),this.$("info-link, info-close").hide()),this.bind("thumbnail",(function(t){i?e(t.thumbTarget).css("opacity",this.getIndex()?1:.6).bind("click:fast",(function(){e(this).css("opacity",1).parent().siblings().children().css("opacity",.6)})):(e(t.thumbTarget).css("opacity",.6).parent().hover((function(){e(this).not(".active").children().stop().fadeTo(100,1)}),(function(){e(this).not(".active").children().stop().fadeTo(400,.6)})),t.index===this.getIndex()&&e(t.thumbTarget).css("opacity",1))}));var r=function(t){e(t.thumbTarget).css("opacity",1).parent().siblings().children().css("opacity",.6)};this.bind("loadstart",(function(e){e.cached||this.$("loader").show().fadeTo(200,.4),window.setTimeout((function(){r(e)}),i?300:0),this.$("info").toggle(this.hasInfo())})),this.bind("loadfinish",(function(){this.$("loader").fadeOut(200)}))}})}(jQuery),function(e,t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):e.lightbox=t(e.jQuery)}(this,(function(e){function t(t){this.album=[],this.currentImageIndex=void 0,this.init(),this.options=e.extend({},this.constructor.defaults),this.option(t)}return t.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:500,fitImagesInViewport:!0,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1},t.prototype.option=function(t){e.extend(this.options,t)},t.prototype.imageCountLabel=function(e,t){return this.options.albumLabel.replace(/%1/g,e).replace(/%2/g,t)},t.prototype.init=function(){this.enable(),this.build()},t.prototype.enable=function(){var t=this;e("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",(function(n){return t.start(e(n.currentTarget)),!1}))},t.prototype.build=function(){var t=this;e('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox" role="dialog"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" alt="" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" aria-label="previous"></a><a class="lb-next" href="" aria-label="next"></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo(e("body")),this.$lightbox=e("#lightbox"),this.$overlay=e("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",(function(){return t.end(),!1})),this.$lightbox.hide().on("click",(function(n){return"lightbox"===e(n.target).attr("id")&&t.end(),!1})),this.$outerContainer.on("click",(function(n){return"lightbox"===e(n.target).attr("id")&&t.end(),!1})),this.$lightbox.find(".lb-prev").on("click",(function(){return 0===t.currentImageIndex?t.changeImage(t.album.length-1):t.changeImage(t.currentImageIndex-1),!1})),this.$lightbox.find(".lb-next").on("click",(function(){return t.currentImageIndex===t.album.length-1?t.changeImage(0):t.changeImage(t.currentImageIndex+1),!1})),this.$lightbox.find(".lb-loader, .lb-close").on("click",(function(){return t.end(),!1}))},t.prototype.start=function(t){function n(e){i.album.push({link:e.attr("href"),title:e.attr("data-title")||e.attr("title")})}var i=this,r=e(window);r.on("resize",e.proxy(this.sizeOverlay,this)),e("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var a,o=0,s=t.attr("data-lightbox");if(s){a=e(t.prop("tagName")+'[data-lightbox="'+s+'"]');for(var l=0;l<a.length;l=++l)n(e(a[l])),a[l]===t[0]&&(o=l)}else if("lightbox"===t.attr("rel"))n(t);else{a=e(t.prop("tagName")+'[rel="'+t.attr("rel")+'"]');for(var d=0;d<a.length;d=++d)n(e(a[d])),a[d]===t[0]&&(o=d)}var c=r.scrollTop()+this.options.positionFromTop,u=r.scrollLeft();this.$lightbox.css({top:c+"px",left:u+"px"}).fadeIn(this.options.fadeDuration),this.changeImage(o)},t.prototype.changeImage=function(t){var n=this;this.disableKeyboardNav();var i=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration),e(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating");var r=new Image;r.onload=function(){var a,o,s,l,d,c;i.attr("src",n.album[t].link),e(r),i.width(r.width),i.height(r.height),n.options.fitImagesInViewport&&(c=e(window).width(),d=e(window).height(),l=c-n.containerLeftPadding-n.containerRightPadding-20,s=d-n.containerTopPadding-n.containerBottomPadding-120,n.options.maxWidth&&n.options.maxWidth<l&&(l=n.options.maxWidth),n.options.maxHeight&&n.options.maxHeight<l&&(s=n.options.maxHeight),(r.width>l||r.height>s)&&(r.width/l>r.height/s?(o=l,a=parseInt(r.height/(r.width/o),10),i.width(o),i.height(a)):(a=s,o=parseInt(r.width/(r.height/a),10),i.width(o),i.height(a)))),n.sizeContainer(i.width(),i.height())},r.src=this.album[t].link,this.currentImageIndex=t},t.prototype.sizeOverlay=function(){this.$overlay.width(e(window).width()).height(e(document).height())},t.prototype.sizeContainer=function(e,t){function n(){i.$lightbox.find(".lb-dataContainer").width(o),i.$lightbox.find(".lb-prevLink").height(s),i.$lightbox.find(".lb-nextLink").height(s),i.showImage()}var i=this,r=this.$outerContainer.outerWidth(),a=this.$outerContainer.outerHeight(),o=e+this.containerLeftPadding+this.containerRightPadding,s=t+this.containerTopPadding+this.containerBottomPadding;r!==o||a!==s?this.$outerContainer.animate({width:o,height:s},this.options.resizeDuration,"swing",(function(){n()})):n()},t.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide(),this.$lightbox.find(".lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},t.prototype.updateNav=function(){var e=!1;try{document.createEvent("TouchEvent"),e=!!this.options.alwaysShowNavOnTouchDevices}catch(e){}this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(e&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),e&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),e&&this.$lightbox.find(".lb-next").css("opacity","1"))))},t.prototype.updateDetails=function(){var t=this;if(void 0!==this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title&&this.$lightbox.find(".lb-caption").html(this.album[this.currentImageIndex].title).fadeIn("fast").find("a").on("click",(function(){void 0!==e(this).attr("target")?window.open(e(this).attr("href"),e(this).attr("target")):location.href=e(this).attr("href")})),this.album.length>1&&this.options.showImageNumberLabel){var n=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find(".lb-number").text(n).fadeIn("fast")}else this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,(function(){return t.sizeOverlay()}))},t.prototype.preloadNeighboringImages=function(){this.album.length>this.currentImageIndex+1&&((new Image).src=this.album[this.currentImageIndex+1].link);this.currentImageIndex>0&&((new Image).src=this.album[this.currentImageIndex-1].link)},t.prototype.enableKeyboardNav=function(){e(document).on("keyup.keyboard",e.proxy(this.keyboardAction,this))},t.prototype.disableKeyboardNav=function(){e(document).off(".keyboard")},t.prototype.keyboardAction=function(e){var t=27,n=37,i=39,r=e.keyCode,a=String.fromCharCode(r).toLowerCase();r===t||a.match(/x|o|c/)?this.end():"p"===a||r===n?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):("n"===a||r===i)&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},t.prototype.end=function(){this.disableKeyboardNav(),e(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),e("select, object, embed").css({visibility:"visible"})},new t})),
/**
 * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/jrburke/almond for details
 */
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// CodeMirror, copyright (c) by Marijn Haverbeke and others
/*!
 * HTMLHint v0.9.13
 * https://github.com/yaniswang/HTMLHint
 *
 * (c) 2014-2016 Yanis Wang <yanis.wang@gmail.com>.
 * MIT Licensed
 */
/**
 * @license RequireJS text 2.0.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
 * Available via the MIT or new BSD license.
 * see: http://github.com/requirejs/text for details
 */
function(e,t){"function"==typeof define&&define.amd?define([],t):e.Redactor=t()}(this,(function(){var e,t,n;return function(i){function r(e,t){return b.call(e,t)}function a(e,t){var n,i,r,a,o,s,l,d,c,u,f,h=t&&t.split("/"),p=y.map,g=p&&p["*"]||{};if(e&&"."===e.charAt(0))if(t){for(o=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[o])&&(e[o]=e[o].replace(w,"")),e=h.slice(0,h.length-1).concat(e),c=0;c<e.length;c+=1)if("."===(f=e[c]))e.splice(c,1),c-=1;else if(".."===f){if(1===c&&(".."===e[2]||".."===e[0]))break;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||g)&&p){for(c=(n=e.split("/")).length;c>0;c-=1){if(i=n.slice(0,c).join("/"),h)for(u=h.length;u>0;u-=1)if((r=p[h.slice(0,u).join("/")])&&(r=r[i])){a=r,s=c;break}if(a)break;!l&&g&&g[i]&&(l=g[i],d=c)}!a&&l&&(a=l,s=d),a&&(n.splice(0,s,a),e=n.join("/"))}return e}function o(e,t){return function(){var n=E.call(arguments,0);return"string"!=typeof n[0]&&1===n.length&&n.push(null),h.apply(i,n.concat([e,t]))}}function s(e){return function(t){return a(t,e)}}function l(e){return function(t){m[e]=t}}function d(e){if(r(v,e)){var t=v[e];delete v[e],_[e]=!0,f.apply(i,t)}if(!r(m,e)&&!r(_,e))throw new Error("No "+e);return m[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function u(e){return function(){return y&&y.config&&y.config[e]||{}}}var f,h,p,g,m={},v={},y={},_={},b=Object.prototype.hasOwnProperty,E=[].slice,w=/\.js$/;p=function(e,t){var n,i=c(e),r=i[0];return e=i[1],r&&(n=d(r=a(r,t))),r?e=n&&n.normalize?n.normalize(e,s(t)):a(e,t):(r=(i=c(e=a(e,t)))[0],e=i[1],r&&(n=d(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},g={require:function(e){return o(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:u(e)}}},f=function(e,t,n,a){var s,c,u,f,h,y,b=[],E=typeof n;if(a=a||e,"undefined"===E||"function"===E){for(t=!t.length&&n.length?["require","exports","module"]:t,h=0;h<t.length;h+=1)if("require"===(c=(f=p(t[h],a)).f))b[h]=g.require(e);else if("exports"===c)b[h]=g.exports(e),y=!0;else if("module"===c)s=b[h]=g.module(e);else if(r(m,c)||r(v,c)||r(_,c))b[h]=d(c);else{if(!f.p)throw new Error(e+" missing "+c);f.p.load(f.n,o(a,!0),l(c),{}),b[h]=m[c]}u=n?n.apply(m[e],b):void 0,e&&(s&&s.exports!==i&&s.exports!==m[e]?m[e]=s.exports:u===i&&y||(m[e]=u))}else e&&(m[e]=n)},e=t=h=function(e,t,n,r,a){if("string"==typeof e)return g[e]?g[e](t):d(p(e,t).f);if(!e.splice){if((y=e).deps&&h(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=i}return t=t||function(){},"function"==typeof n&&(n=r,r=a),r?f(i,e,t,n):setTimeout((function(){f(i,e,t,n)}),4),h},h.config=function(e){return h(e)},e._defined=m,(n=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),!r(m,e)&&!r(v,e)&&(v[e]=[e,t,n])}).amd={jQuery:!0}}(),n("lib/almond",(function(){})),n("jquery",[],(function(){return jQuery})),n("underscore",[],(function(){return _||FS._})),t.config({baseUrl:"src/js",packages:[{name:"codemirror",location:"lib/codeMirror",main:"lib/codemirror"}],paths:{text:"lib/text"}}),n("main",(function(){})),n("jquery-redactor-shim",["jquery"],(function(e){"use strict";e.fn.jquery.split(".")[0]<=1&&e.fn.jquery.split(".")[1]<9&&(e.fn.extend({addBack:function(e){return this.add(null===e?this.prevObject:this.prevObject.filter(e))}}),e.support.createHTMLDocument=function(){var e=document.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),e.parseHTML=function(t,n,i){if("string"!=typeof t)return[];"boolean"==typeof n&&(i=n,n=!1),n=n||(e.support.createHTMLDocument?document.implementation.createHTMLDocument(""):document);var r=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/.exec(t),a=!i&&[];return r?[n.createElement(r[1])]:(r=e.buildFragment([t],[n],a),a&&a.length&&e(a).remove(),e.merge([],r.fragment.childNodes))})})),n("options",["jquery"],(function(e){"use strict";return{browseFileURL:"",browseMediaURL:"",browseSiteURL:"",browseComposerSiteURL:"",codeOnly:!1,lang:"en",direction:"ltr",plugins:!1,focus:!1,focusEnd:!1,placeholder:!1,visual:!0,tabindex:!1,minHeight:!1,maxHeight:!1,linebreaks:!1,replaceDivs:!1,paragraphize:!1,cleanStyleOnEnter:!1,enterKey:!0,resizable:!1,cleanOnPaste:!0,cleanSpaces:!0,pastePlainText:!1,linkTooltip:!0,linkProtocol:"http",linkNofollow:!1,linkSize:50,imageEditable:!0,imageLink:!0,imagePosition:!0,imageFloatMargin:"10px",imageResizable:!0,imageUpload:null,imageUploadParam:"file",uploadImageField:!1,dragImageUpload:!0,fileUpload:null,fileUploadParam:"file",dragFileUpload:!0,s3:!1,convertLinks:!0,convertUrlLinks:!0,convertImageLinks:!0,convertVideoLinks:!0,preSpaces:4,tabAsSpaces:!1,tabKey:!0,scrollTarget:!1,toolbar:!0,toolbarFixed:!0,toolbarFixedTarget:document,toolbarFixedTopOffset:0,toolbarExternal:!1,toolbarOverflow:!1,source:!0,buttons:["html","undo","redo","formatting","styles","bold","italic","underline","deleted","unorderedlist","orderedlist","outdent","indent","image","media","embed","file","table","link","alignment","fontcolor","backcolor","fontfamily","fontsize","horizontalrule","textdirection","fullscreen"],buttonsHide:[],buttonsHideOnMobile:[],formatting:["p","blockquote","pre","h1","h2","h3","h4","h5","h6"],formattingAdd:!1,tabifier:!0,deniedTags:[],allowedTags:!1,paragraphizeBlocks:["table","div","pre","form","ul","ol","h1","h2","h3","h4","h5","h6","dl","blockquote","figcaption","address","section","header","footer","aside","article","object","style","script","iframe","select","input","textarea","button","option","map","area","math","hr","fieldset","legend","hgroup","nav","figure","details","menu","summary","p"],removeComments:!1,replaceTags:[["strike","del"],["b","strong"]],replaceStyles:[["font-weight:\\s?bold","strong"],["font-style:\\s?italic","em"],["text-decoration:\\s?underline","u"],["text-decoration:\\s?line-through","del"]],removeDataAttr:!1,removeAttr:!1,allowedAttr:!1,removeWithoutAttr:!1,removeEmpty:!1,activeButtons:["deleted","italic","bold","underline","unorderedlist","orderedlist","alignleft","aligncenter","alignright","justify"],activeButtonsStates:{b:"bold",strong:"bold",i:"italic",em:"italic",del:"deleted",strike:"deleted",ul:"unorderedlist",ol:"orderedlist",u:"underline"},shortcuts:{"ctrl+shift+m, meta+shift+m":{func:"inline.removeFormat"},"ctrl+b, meta+b":{func:"inline.format",params:["bold"]},"ctrl+i, meta+i":{func:"inline.format",params:["italic"]},"ctrl+h, meta+h":{func:"inline.format",params:["superscript"]},"ctrl+l, meta+l":{func:"inline.format",params:["subscript"]},"ctrl+k, meta+k":{func:"link.show"},"ctrl+shift+7":{func:"list.toggle",params:["orderedlist"]},"ctrl+shift+8":{func:"list.toggle",params:["unorderedlist"]}},shortcutsAdd:!1,buffer:[],rebuffer:[],emptyHtml:"<p>&#x200b;</p>",invisibleSpace:"&#x200b;",imageTypes:["image/png","image/jpeg","image/gif"],indentValue:parseFloat(e(document.body).css("font-size")),verifiedTags:["a","img","b","strong","sub","sup","i","em","u","small","strike","del","cite","ul","ol","li"],inlineTags:["strong","b","u","em","i","code","del","ins","samp","kbd","sup","sub","mark","var","cite","small"],alignmentTags:["P","H1","H2","H3","H4","H5","H6","DL","DT","DD","DIV","TD","BLOCKQUOTE","OUTPUT","FIGCAPTION","ADDRESS","SECTION","HEADER","FOOTER","ASIDE","ARTICLE"],blockLevelElements:["PRE","UL","OL","LI"],langs:{en:{add_head:"Add Head",alignment:"Alignment",align_center:"Center text",align_justify:"Justify text",align_left:"Align text to the left",align_right:"Align text to the right",anchor:"Anchor",backcolor:"Background Color",bold:"Bold",browse:"Browse",browse_composer:"Browse Composer",cancel:"Cancel",center:"Center",choose:"Choose",class:"Class",class_attr_description:"Optional; can be used to assign a particular CSS class to this link.",code:"Code",columns:"Columns",composer_site_page_browse_title:"Browse Composer Site Pages",deleted:"Deleted",delete_column:"Delete Column",delete_head:"Delete Head",delete_row:"Delete Row",delete_table:"Delete Table",download:"Download",drop_file_here:"Drop file here",edit:"Edit",embed:"Insert Embed",file:"Insert File",filename:"Name (optional)",fontcolor:"Font Color",formatting:"Formatting",header1:"Header 1",header2:"Header 2",header3:"Header 3",header4:"Header 4",header5:"Header 5",header6:"Header 6",horizontalrule:"Insert Horizontal Rule",html:"HTML",id_attr_description:"Give this link a unique ID, allowing users to jump directly to this element from a different spot on the page. Create the jump using another link that starts with a # and points to this ID.",indent:"Indent",insert:"Insert",insert_column_left:"Add Column Left",insert_column_right:"Add Column Right",insert_row_above:"Add Row Above",insert_row_below:"Add Row Below",insert_table:"Insert Table",image:"Insert Image",image_position:"Position",image_web_link:"Image Web Link",italic:"Italic",left:"Left",link:"Link",link_insert:"Insert link",link_edit:"Edit link",link_new_tab:"Open link in new tab",mailto:"Email",media:"Media",media_browse_title:"Browse Media",media_select:"Please select media",none:"None",orderedlist:"Ordered List",or_choose:"Or choose",outdent:"Outdent",paragraph:"Normal text",quote:"Quote",right:"Right",rows:"Rows",save:"Save",site_file:"Site File",site_file_select:"Please select a file",site_file_browse_title:"Browse Site Files",site_page:"Site Page",site_page_select:"Please select a site page",site_page_browse_title:"Browse Site Pages",style:"Style",table:"Table",text:"Text",title:"Title",title_attr_description:"Optional but strongly recommended. This text appears when users hover over the link; it's used to provide additional details about the link target. (Not related to SEO optimization.)",underline:"Underline",unlink:"Unlink",unorderedlist:"Unordered List",upload:"Upload",upload_label:"Drop file here or ",web:"URL",video:"Insert Embed",video_html_code:"Embed Code",_delete:"Delete"}},linkify:{regexps:{youtube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.\-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/gi,vimeo:/https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/,image:/((https?|www)[^\s]+\.)(jpe?g|png|gif)(\?[^\s-]+)?/gi,url:/(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi}},codemirror:!1}})),n("modules/alignment",["jquery"],(function(e){"use strict";function t(){}return t.prototype={left:function(){this.alignment.set("left")},right:function(){this.alignment.set("right")},center:function(){this.alignment.set("center")},justify:function(){this.alignment.set("justify")},set:function(e){this.utils.browser("msie")||this.$editor[0].focus(),this.buffer.set(),this.selection.save(),this.alignment.blocks=this.selection.getBlocks(),this.alignment.type=e,this.alignment.isLinebreaksOrNoBlocks()?this.alignment.setText():this.alignment.setBlocks(),this.selection.restore(),this.code.sync()},setText:function(){var t=this.selection.wrap("div");e(t).attr("data-tagblock","redactor").css("text-align",this.alignment.type)},setBlocks:function(){e.each(this.alignment.blocks,e.proxy((function(e,t){var n=this.utils.getAlignmentElement(t);n&&(this.alignment.isNeedReplaceElement(n)?this.alignment.replaceElement(n):this.alignment.alignElement(n))}),this))},isLinebreaksOrNoBlocks:function(){return this.opts.linebreaks||!1===this.alignment.blocks[0]},isNeedReplaceElement:function(e){return""===this.alignment.type&&void 0!==e.data("tagblock")},replaceElement:function(e){e.replaceWith(e.html())},alignElement:function(e){e.css("text-align",this.alignment.type),this.utils.removeEmptyAttr(e,"style")}},t})),n("modules/block",["jquery"],(function(e){"use strict";function t(){}return t.prototype={formatting:function(e){var t,n;this.block.clearStyle=!1,void 0!==this.formatting[e].data?t="data":void 0!==this.formatting[e].attr?t="attr":void 0!==this.formatting[e].class&&(t="class"),void 0!==this.formatting[e].clear&&(this.block.clearStyle=!0),t&&(n=this.formatting[e][t]),this.block.format(this.formatting[e].tag,t,n)},format:function(t,n,i){"quote"===t&&(t="blockquote");var r=["p","pre","blockquote","h1","h2","h3","h4","h5","h6"];-1!==e.inArray(t,r)&&(this.block.isRemoveInline="pre"===t||-1!==t.search(/h[1-6]/i),this.utils.browser("msie")||this.$editor[0].focus(),this.block.blocks=this.selection.getBlocks(),this.block.blocksSize=this.block.blocks.length,this.block.type=n,this.block.value=i,this.buffer.set(),this.selection.save(),this.block.set(t),this.selection.restore(),this.code.sync())},set:function(e){this.selection.get(),this.block.containerTag=this.range.commonAncestorContainer.tagName,this.range.collapsed?this.block.setCollapsed(e):this.block.setMultiple(e)},setCollapsed:function(t){var n=this.block.blocks[0];if(!1!==n)if("LI"!==n.tagName){if(("TD"===this.block.containerTag||"TH"===this.block.containerTag)&&!this.opts.linebreaks)document.execCommand("formatblock",!1,"<"+t+">"),n=this.selection.getBlock(),this.block.toggle(e(n));else if(n.tagName.toLowerCase()!==t)if(this.opts.linebreaks&&"p"===t)e(n).prepend("<br>").append("<br>"),this.utils.replaceWithContents(n);else{var i=this.utils.replaceToTag(n,t);this.block.toggle(i),"p"!==t&&"blockquote"!==t&&i.find("img").remove(),this.block.isRemoveInline&&this.utils.removeInlineTags(i),("p"===t||this.block.headTag)&&i.find("p").contents().unwrap(),this.block.formatTableWrapping(i)}else if("blockquote"===t&&n.tagName.toLowerCase()===t)if(this.opts.linebreaks)e(n).prepend("<br>").append("<br>"),this.utils.replaceWithContents(n);else{var r=this.utils.replaceToTag(n,"p");this.block.toggle(r)}else n.tagName.toLowerCase()===t&&this.block.toggle(e(n));void 0===this.block.type&&void 0===this.block.value&&e(n).removeAttr("class").removeAttr("style")}else{if("blockquote"!==t)return;this.block.formatListToBlockquote()}},setMultiple:function(t){var n=this.block.blocks[0],i="TD"===this.block.containerTag||"TH"===this.block.containerTag;if(!1!==n&&1===this.block.blocksSize)if(n.tagName.toLowerCase()===t&&"blockquote"===t)if(this.opts.linebreaks)e(n).prepend("<br>").append("<br>"),this.utils.replaceWithContents(n);else{var r=this.utils.replaceToTag(n,"p");this.block.toggle(r)}else if("LI"===n.tagName){if("blockquote"!==t)return;this.block.formatListToBlockquote()}else if("BLOCKQUOTE"===this.block.containerTag)this.block.formatBlockquote(t);else if(this.opts.linebreaks&&(i||this.range.commonAncestorContainer!==n))this.block.formatWrap(t);else if(this.opts.linebreaks&&"p"===t)e(n).prepend("<br>").append("<br>"),this.utils.replaceWithContents(n);else if("TD"===n.tagName)this.block.formatWrap(t);else{var a=this.utils.replaceToTag(n,t);this.block.toggle(a),this.block.isRemoveInline&&this.utils.removeInlineTags(a),("p"===t||this.block.headTag)&&a.find("p").contents().unwrap()}else if(this.opts.linebreaks||"p"!==t){if("blockquote"===t){for(var o=0,s=0;s<this.block.blocksSize;s++)"BLOCKQUOTE"===this.block.blocks[s].tagName&&o++;if(o===this.block.blocksSize)return void e.each(this.block.blocks,e.proxy((function(t,n){var i=!1;this.opts.linebreaks?(e(n).prepend("<br>").append("<br>"),i=this.utils.replaceWithContents(n)):i=this.utils.replaceToTag(n,"p"),i&&void 0===this.block.type&&void 0===this.block.value&&i.removeAttr("class").removeAttr("style")}),this))}this.block.formatWrap(t)}else{var l=0,d=!1;"class"===this.block.type&&(d="toggle",l=e(this.block.blocks).filter("."+this.block.value).length,this.block.blocksSize===l?d="toggle":(this.block.blocksSize>l||0===l)&&(d="set"));var c=["ul","ol","li","td","th","dl","dt","dd"];e.each(this.block.blocks,e.proxy((function(n,i){if(-1===e.inArray(i.tagName.toLowerCase(),c)){var r=this.utils.replaceToTag(i,t);d?"toggle"===d?this.block.toggle(r):"remove"===d?this.block.remove(r):"set"===d&&this.block.setForce(r):this.block.toggle(r),"p"!==t&&"blockquote"!==t&&r.find("img").remove(),this.block.isRemoveInline&&this.utils.removeInlineTags(r),("p"===t||this.block.headTag)&&r.find("p").contents().unwrap(),void 0===this.block.type&&void 0===this.block.value&&r.removeAttr("class").removeAttr("style")}}),this))}},setForce:function(e){this.block.clearStyle&&e.removeAttr("class").removeAttr("style"),"class"!==this.block.type?"attr"!==this.block.type&&"data"!==this.block.type||e.attr(this.block.value.name,this.block.value.value):e.addClass(this.block.value)},toggle:function(e){this.block.clearStyle&&e.removeAttr("class").removeAttr("style"),"class"!==this.block.type?"attr"!==this.block.type&&"data"!==this.block.type?e.removeAttr("style class"):e.attr(this.block.value.name)===this.block.value.value?e.removeAttr(this.block.value.name):e.attr(this.block.value.name,this.block.value.value):e.toggleClass(this.block.value)},remove:function(e){e.removeClass(this.block.value)},formatListToBlockquote:function(){var t=e(this.block.blocks[0]).closest("ul, ol",this.$editor[0]);e(t).find("ul, ol").contents().unwrap(),e(t).find("li").append(e("<br>")).contents().unwrap();var n=this.utils.replaceToTag(t,"blockquote");this.block.toggle(n)},formatBlockquote:function(t){document.execCommand("outdent"),document.execCommand("formatblock",!1,t),this.clean.clearUnverified(),this.$editor.find("p:empty").remove();var n=this.selection.getBlock();"p"!==t&&e(n).find("img").remove(),this.opts.linebreaks||this.block.toggle(e(n)),this.$editor.find("ul, ol, tr, blockquote, p").each(e.proxy(this.utils.removeEmpty,this)),this.opts.linebreaks&&"p"===t&&this.utils.replaceWithContents(n)},formatWrap:function(t){if("UL"===this.block.containerTag||"OL"===this.block.containerTag){if("blockquote"!==t)return;this.block.formatListToBlockquote()}var n=this.selection.wrap(t);if(!1!==n){var i=e(n);this.block.formatTableWrapping(i);var r=i.find(this.opts.blockLevelElements.join(",")+", td, table, thead, tbody, tfoot, th, tr");(this.opts.linebreaks&&"p"===t||"pre"===t||"blockquote"===t)&&r.append("<br />"),r.contents().unwrap(),"p"!==t&&"blockquote"!==t&&i.find("img").remove(),e.each(this.block.blocks,e.proxy(this.utils.removeEmpty,this)),i.append(this.selection.getMarker(2)),this.opts.linebreaks||this.block.toggle(i),this.$editor.find("ul, ol, tr, blockquote, p").each(e.proxy(this.utils.removeEmpty,this)),i.find("blockquote:empty").remove(),this.block.isRemoveInline&&this.utils.removeInlineTags(i),this.opts.linebreaks&&"p"===t&&this.utils.replaceWithContents(i)}},formatTableWrapping:function(e){0!==e.closest("table",this.$editor[0]).length&&(0===e.closest("tr",this.$editor[0]).length&&e.wrap("<tr>"),0===e.closest("td",this.$editor[0]).length&&0===e.closest("th").length&&e.wrap("<td>"))},removeData:function(t){var n=this.selection.getBlocks();e(n).removeAttr("data-"+t),this.code.sync()},setData:function(t,n){var i=this.selection.getBlocks();e(i).attr("data-"+t,n),this.code.sync()},toggleData:function(t,n){var i=this.selection.getBlocks();e.each(i,(function(){e(this).attr("data-"+t)?e(this).removeAttr("data-"+t):e(this).attr("data-"+t,n)}))},removeAttr:function(t){var n=this.selection.getBlocks();e(n).removeAttr(t),this.code.sync()},setAttr:function(t,n){var i=this.selection.getBlocks();e(i).attr(t,n),this.code.sync()},toggleAttr:function(t,n){var i=this.selection.getBlocks();e.each(i,(function(){e(this).attr(name)?e(this).removeAttr(name):e(this).attr(name,n)}))},removeClass:function(t){var n=this.selection.getBlocks();e(n).removeClass(t),this.utils.removeEmptyAttr(n,"class"),this.code.sync()},setClass:function(t){var n=this.selection.getBlocks();e(n).addClass(t),this.code.sync()},toggleClass:function(t){var n=this.selection.getBlocks();e(n).toggleClass(t),this.code.sync()}},t})),n("modules/buffer",["jquery"],(function(e){"use strict";function t(){}return t.prototype={set:function(e,t){void 0===e||"undo"===e?(this.buffer.setUndo(),t||this.buffer.clearRebuffer()):this.buffer.setRedo(),this.buffer.toggleUndoButtonStatus()},setUndo:function(){this.selection.save(),this.opts.buffer.push(this.$editor.html()),this.selection.restore()},getUndo:function(){this.$editor.html(this.opts.buffer.pop()),this.buffer.toggleUndoButtonStatus()},setRedo:function(){this.selection.save(),this.opts.rebuffer.push(this.$editor.html()),this.selection.restore()},getRedo:function(){this.$editor.html(this.opts.rebuffer.pop()),this.buffer.toggleUndoButtonStatus()},redo:function(){0!==this.opts.rebuffer.length&&(this.buffer.set("undo",!0),this.buffer.getRedo(),this.selection.restore(),setTimeout(e.proxy(this.observe.load,this),50))},clearBuffer:function(){for(;this.opts.buffer.length>0;)this.opts.buffer.pop();this.buffer.toggleUndoButtonStatus()},clearRebuffer:function(){for(;this.opts.rebuffer.length>0;)this.opts.rebuffer.pop();this.buffer.toggleUndoButtonStatus()},toggleUndoButtonStatus:function(){this.$toolbar.find(".re-undo").toggleClass("redactor-button-disabled",!this.opts.buffer.length),this.$toolbar.find(".re-redo").toggleClass("redactor-button-disabled",!this.opts.rebuffer.length)},add:function(){this.opts.buffer.push(this.$editor.html())},undo:function(){0!==this.opts.buffer.length&&(this.buffer.set("redo"),this.buffer.getUndo(),this.selection.restore(),setTimeout(e.proxy(this.observe.load,this),50))}},t})),n("modules/build",["jquery"],(function(e){"use strict";function t(){}return t.prototype={run:function(){this.build.createContainerBox(),this.build.loadContent(),this.build.loadEditor(),this.build.enableEditor(),this.build.setCodeAndCall()},isTextarea:function(){return"TEXTAREA"===this.$element[0].tagName},createContainerBox:function(){this.$box=e('<div class="redactor-box" />')},createTextarea:function(){this.$textarea=e("<textarea />").attr("name",this.build.getTextareaName())},getTextareaName:function(){return"undefined"==typeof name?"content-"+this.uuid:this.$element.attr("id")},loadContent:function(){if(this.$sourceTextarea=e("textarea.redactorContent",this.$element[0]),this.$sourceTextarea.length)return this.content=this.$sourceTextarea.val(),void this.$sourceTextarea.detach();if(this.$element.next("textarea").length)this.content=this.$element.next("textarea").val();else{var t=this.build.isTextarea()?"val":"html";this.content=e.trim(this.$element[t]())}},enableEditor:function(){this.$editor.attr({contenteditable:!0,dir:this.opts.direction})},loadEditor:function(){var e=this.build.isTextarea()?"fromTextarea":"fromElement";this.build[e]()},fromTextarea:function(){this.$editor=e("<div />"),this.$textarea=this.$element,this.$box.insertAfter(this.$element).append(this.$editor).append(this.$element),this.$editor.addClass("redactor-editor"),this.$element.hide()},fromElement:function(){this.$editor=this.$element,this.build.createTextarea(),this.$box.insertAfter(this.$editor).append(this.$editor).append(this.$textarea),this.$editor.addClass("redactor-editor"),this.$textarea.hide()},setCodeAndCall:function(){this.code.set(this.content),this.build.setOptions(),this.build.callEditor(),this.opts.visual||setTimeout(e.proxy(this.code.showCode,this),200)},callEditor:function(){this.build.disableMozillaEditing(),this.build.setEvents(),this.build.setHelpers(),this.opts.toolbar&&(this.opts.toolbar=this.toolbar.init(),this.toolbar.build()),this.modal.loadTemplates(),this.build.plugins(),setTimeout(e.proxy(this.observe.load,this),4),this.core.setCallback("init")},setOptions:function(){e(this.$textarea).attr("dir",this.opts.direction),this.opts.linebreaks&&this.$editor.addClass("redactor-linebreaks"),this.opts.tabindex&&this.$editor.attr("tabindex",this.opts.tabindex),this.opts.minHeight&&this.$editor.css("minHeight",this.opts.minHeight),this.opts.maxHeight&&this.$editor.css("maxHeight",this.opts.maxHeight)},setEventDropUpload:function(e){if(e.preventDefault(),this.opts.dragImageUpload&&this.opts.dragFileUpload){var t=e.dataTransfer.files;this.upload.directUpload(t[0],e)}},setEventDrop:function(e){this.code.sync(),setTimeout(this.clean.clearUnverified,1),this.core.setCallback("drop",e)},setEvents:function(){var t;this.$editor.on("drop.redactor",e.proxy((function(e){return e=e.originalEvent||e,void 0===window.FormData||!e.dataTransfer||(0===e.dataTransfer.files.length?this.build.setEventDrop(e):(this.build.setEventDropUpload(e),setTimeout(this.clean.clearUnverified,1),void this.core.setCallback("drop",e)))}),this)),this.$editor.on("click.redactor",e.proxy((function(e){var t=this.core.getEvent(),n="click"!==t&&"arrow"!==t&&"click";this.core.addEvent(n),this.utils.disableSelectAll(),this.core.setCallback("click",e)}),this)),this.$editor.on("paste.redactor",e.proxy(this.paste.init,this)),this.$editor.on("cut.redactor",e.proxy(this.code.sync,this)),this.$editor.on("keydown.redactor",e.proxy(this.keydown.init,this)),this.$editor.on("keyup.redactor",e.proxy(this.keyup.init,this)),e.isFunction(this.opts.codeKeydownCallback)&&this.$textarea.on("keydown.redactor-textarea",e.proxy(this.opts.codeKeydownCallback,this)),e.isFunction(this.opts.codeKeyupCallback)&&this.$textarea.on("keyup.redactor-textarea",e.proxy(this.opts.codeKeyupCallback,this)),e.isFunction(this.opts.focusCallback)&&this.$editor.on("focus.redactor",e.proxy(this.opts.focusCallback,this)),e(document).on("mousedown focusin",(function(e){t=e.target})),this.$editor.on("blur.redactor",e.proxy((function(n){this.rtePaste||this.build.isBlured(t)&&(this.code.sync(),this.$textarea.trigger("change"),this.utils.disableSelectAll(),e.isFunction(this.opts.blurCallback)&&this.core.setCallback("blur",n))}),this))},isBlured:function(t){var n=e(t);return!(!n.is(".redactor-editor")||n[0]===this.$editor[0])||!n.hasClass("redactor-toolbar, redactor-dropdown")&&!n.is("#redactor-modal")&&0===n.parents(".redactor-toolbar, .redactor-dropdown, #redactor-modal").length&&0===n.closest(this.$editor).length},setHelpers:function(){this.linkify.isEnabled()&&this.linkify.format(),this.placeholder.enable(),this.opts.focus&&setTimeout(this.focus.setStart,100),this.opts.focusEnd&&setTimeout(this.focus.setEnd,100)},plugins:function(){e.each(this.modules,e.proxy((function(t,n){e.isFunction(this[n].initialize)&&this[n].initialize()}),this))},disableMozillaEditing:function(){if(this.utils.browser("mozilla"))try{document.execCommand("enableObjectResizing",!1,!1),document.execCommand("enableInlineTableEditing",!1,!1)}catch(e){}}},t})),n("modules/button",["jquery"],(function(e){"use strict";function t(){}return t.prototype={build:function(t,n){var i=e('<a href="#" class="re-icon re-'+t+'" rel="'+t+'" />').attr("tabindex","-1");if((n.func||n.command||n.dropdown)&&this.button.setEvent(i,t,n),n.dropdown){var r=e('<div class="redactor-dropdown redactor-dropdown-'+this.uuid+" redactor-dropdown-box-"+t+'" style="display: none;">');i.data("dropdown",r),this.dropdown.build(t,r,n.dropdown)}return this.utils.isDesktop()&&this.button.createTooltip(i,t,n.title),i},setEvent:function(t,n,i){t.on("mousedown",(function(e){e.stopPropagation()})),t.on("touchstart click",e.proxy((function(e){if(t.hasClass("redactor-button-disabled"))return!1;var r="func",a=i.func;i.command?(r="command",a=i.command):i.dropdown&&(r="dropdown",a=!1),this.button.onClick(e,n,r,a)}),this))},createTooltip:function(t,n,i){var r=e("<span>").addClass("redactor-toolbar-tooltip redactor-toolbar-tooltip-"+n).hide().html(i);r.appendTo("body"),t.on("mouseover",(function(){if(!e(this).hasClass("redactor-button-disabled")){var n=t.offset();r.show(),r.css({top:n.top+t.innerHeight()+"px",left:n.left+t.innerWidth()/2-r.innerWidth()/2+"px"})}})),t.on("mouseout mouseup",(function(){r.hide()}))},onClick:function(e,t,n,i){this.button.caretOffset=this.caret.getOffset(),e.preventDefault(),this.utils.browser("msie")&&(e.returnValue=!1),"command"===n?this.inline.format(i):"dropdown"===n?this.dropdown.show(e,t):this.button.onClickCallback(e,i,t)},onClickCallback:function(t,n,i){var r;if(e.isFunction(n))n.call(this,i);else if("-1"!==n.search(/\./)){if(void 0===this[(r=n.split("."))[0]])return;this[r[0]][r[1]](i)}else this[n](i);this.observe.buttons(t,i)},get:function(e){return this.$toolbar.find("a.re-"+e)},setActive:function(e){this.button.get(e).addClass("redactor-act")},setInactive:function(e){this.button.get(e).removeClass("redactor-act")},setInactiveAll:function(e){void 0===e?this.$toolbar.find("a.re-icon").removeClass("redactor-act"):this.$toolbar.find("a.re-icon").not(".re-"+e).removeClass("redactor-act")},setActiveInVisual:function(){this.$toolbar.find("a.re-icon").not("a.re-html").removeClass("redactor-button-disabled")},setInactiveInCode:function(){this.$toolbar.find("a.re-icon").not("a.re-html").addClass("redactor-button-disabled")},changeIcon:function(e,t){this.button.get(e).addClass("re-"+t)},removeIcon:function(e,t){this.button.get(e).removeClass("re-"+t)},setAwesome:function(e,t){var n=this.button.get(e);n.removeClass("redactor-btn-image").addClass("fa-redactor-btn"),n.html('<i class="fa '+t+'"></i>')},addCallback:function(t,n){var i="dropdown"===n?"dropdown":"func",r=t.attr("rel");"dropdown"===i&&t.addClass("re-has-dropdown"),t.on("mousedown",(function(e){e.stopPropagation()})),t.on("touchstart click",e.proxy((function(e){if(t.hasClass("redactor-button-disabled"))return!1;this.button.onClick(e,r,i,n)}),this))},addDropdown:function(t,n){var i=t.attr("rel");this.button.addCallback(t,"dropdown");var r=e('<div class="redactor-dropdown redactor-dropdown-'+this.uuid+" redactor-dropdown-box-"+i+'" style="display: none;">');return t.data("dropdown",r),r.on("mousedown",(function(e){e.stopPropagation()})),n&&this.dropdown.build(i,r,n),r},add:function(t,n){if(this.opts.toolbar){var i=this.button.build(t,{title:n});return i.addClass("redactor-btn-image"),this.$toolbar.append(e("<li>").append(i)),i}},addFirst:function(t,n){if(this.opts.toolbar){var i=this.button.build(t,{title:n});return i.addClass("redactor-btn-image"),this.$toolbar.prepend(e("<li>").append(i)),i}},addAfter:function(t,n,i){if(this.opts.toolbar){var r=this.button.build(n,{title:i});r.addClass("redactor-btn-image");var a=this.button.get(t);return 0!==a.length?a.parent().after(e("<li>").append(r)):this.$toolbar.append(e("<li>").append(r)),r}},addBefore:function(t,n,i){if(this.opts.toolbar){var r=this.button.build(n,{title:i});r.addClass("redactor-btn-image");var a=this.button.get(t);return 0!==a.length?a.parent().before(e("<li>").append(r)):this.$toolbar.append(e("<li>").append(r)),r}},remove:function(e){this.button.get(e).remove()}},t})),n("modules/caret",["jquery"],(function(e){"use strict";function t(){}return t.prototype={setStart:function(t){if(this.utils.isInline(t)){var n=this.utils.createSpaceElement();e(t).prepend(n),this.caret.setEnd(n)}else this.caret.set(t,0,t,0)},setEnd:function(e){this.caret.set(e,1,e,1)},set:function(t,n,i,r){if(t=t[0]||t,i=i[0]||i,this.utils.isBlockTag(t.tagName)&&""===t.innerHTML&&(t.innerHTML=this.opts.invisibleSpace),"BR"===t.tagName&&!1===this.opts.linebreaks){var a=e(this.opts.emptyHtml)[0];e(t).replaceWith(a),i=t=a}this.selection.get();try{this.range.setStart(t,n),this.range.setEnd(i,r)}catch(e){}this.selection.addRange()},setAfter:function(t){try{var n=e(t)[0].tagName;if("BR"!==n&&this.utils.isInline(t)){var i=this.utils.createSpaceElement();e(t).after(i),this.caret.setEnd(i)}else"BR"!==n&&this.utils.browser("msie")?this.caret.setStart(e(t).next()):this.caret.setAfterOrBefore(t,"after")}catch(n){i=this.utils.createSpaceElement();e(t).after(i),this.caret.setEnd(i)}},setBefore:function(t){this.utils.isBlock(t)?this.caret.setEnd(e(t).prev()):this.caret.setAfterOrBefore(t,"before")},setAfterOrBefore:function(e,t){if(this.utils.browser("msie")||this.$editor[0].focus(),e=e[0]||e,this.selection.get(),"after"===t)try{this.range.setStartAfter(e),this.range.setEndAfter(e)}catch(e){}else try{this.range.setStartBefore(e),this.range.setEndBefore(e)}catch(e){}this.range.collapse(!1),this.selection.addRange()},getOffsetOfElement:function(t){t=t[0]||t,this.selection.get();var n=this.range.cloneRange();return n.selectNodeContents(t),n.setEnd(this.range.endContainer,this.range.endOffset),e.trim(n.toString()).length},getOffset:function(){var e=0;if(window.getSelection().rangeCount>0){var t=window.getSelection().getRangeAt(0),n=t.cloneRange();n.selectNodeContents(this.$editor[0]),n.setEnd(t.endContainer,t.endOffset),e=n.toString().length}return e},setOffset:function(e,t){void 0===t&&(t=e),this.focus.isFocused()||this.focus.setStart();for(var n,i=0,r=document.createTreeWalker(this.$editor[0],NodeFilter.SHOW_TEXT,null,null);n=r.nextNode();)if((i+=n.nodeValue.length)>e&&(this.range.setStart(n,n.nodeValue.length+e-i),e=1/0),i>=t){this.range.setEnd(n,n.nodeValue.length+t-i);break}this.range.collapse(!1),this.selection.addRange()},setToPoint:function(e,t){this.caret.setOffset(e,t)},getCoords:function(){return this.caret.getOffset()}},t})),n("modules/clean",["jquery"],(function(e){"use strict";function t(){}
var n=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","command","content","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","element","em","embed","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","image","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","multicol","nav","nobr","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","rtc","ruby","s","samp","script","section","select","shadow","small","source","span","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"];return t.prototype={onSet:function(t){t=this.clean.savePreCode(t),t=this.clean.convertPre(t,"redactor-script-tag","script",!0),t=(t=this.clean.convertPre(t,"redactor-noscript-tag","noscript")).replace(/<a href="([^>]*?)\xae([^>]*?)">/gi,'<a href="$1&reg$2">'),this.opts.replaceDivs&&(t=this.clean.replaceDivs(t)),this.opts.linebreaks&&(t=this.clean.replaceParagraphsToBr(t)),t=this.clean.saveFormTags(t);var n=e("<div>");n.html(t);var i=n.find("font[style]");return 0!==i.length&&(i.replaceWith((function(){var t=e(this);return e("<span>").attr("style",t.attr("style")).append(t.contents())})),t=n.html()),n.remove(),t=(t=t.replace(/<font([^<]*)>/gi,"")).replace(/<\/font>/gi,""),t=this.tidy.load(t),this.opts.paragraphize&&(t=this.paragraphize.load(t)),t=this.clean.setVerified(t),t=this.clean.convertInline(t)},onSync:function(t){if(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"")).replace(/&#x200b;/gi,""),this.opts.cleanSpaces&&(t=t.replace(/&nbsp;/gi," ")),-1!==t.search(/^<p>(||\s||<br\s?\/?>||&nbsp;)<\/p>$/i))return"";t=this.clean.restoreFormTags(t);var n={"\u2122":"&trade;","\xa9":"&copy;","\u2026":"&hellip;","\u2014":"&mdash;","\u2010":"&dash;"};return e.each(n,(function(e,n){t=t.replace(new RegExp(e,"g"),n)})),t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace(new RegExp("<br\\s?/?></li>","gi"),"</li>")).replace(new RegExp("</li><br\\s?/?>","gi"),"</li>")).replace(/<div([^>]*) data-tagblock="redactor"([^>]*)>/gi,"<div$1$2>")).replace(/<([^>]*) data-verified="redactor"([^>]*)>/gi,"<$1$2>")).replace(/<span([^>]*)\srel="([^>]*?)"([^>]*)>/gi,"<span$1$3>")).replace(/<img([^>]*)\srel="([^>]*?)"([^>]*)>/gi,"<img$1$3>")).replace(/<img([^>]*)\sstyle="" ([^>]*)>'/gi,"<img$1 $2>")).replace(/<img([^>]*)\sstyle ([^>]*)>'/gi,"<img$1 $2>")).replace(/<span class="redactor-invisible-space">([^<]*)<\/span>/gi,"$1")).replace(/ data-save-url="([^>]*?)"/gi,"")).replace(/<span([^>]*)id="redactor-image-box"([^>]*)>([\w\W]*?)<img([^>]*)><\/span>/gi,"$3<img$4>")).replace(/<span([^>]*)id="redactor-image-resizer"([^>]*)>([^<]*)<\/span>/gi,"")).replace(/<span([^>]*)id="redactor-image-editter"([^>]*)>([^<]*)<\/span>/gi,"")).replace(/<font([^>]*)>/gi,"")).replace(/<\/font>/gi,""),t=this.tidy.load(t),t=this.clean.reconvertPre(t,"redactor-script-tag","script",!0),t=this.clean.reconvertPre(t,"redactor-noscript-tag","noscript"),this.opts.linkNofollow&&(t=(t=t.replace(/<a([^>]*)rel="nofollow"([^>]*)>/gi,"<a$1$2>")).replace(/<a([^>]*)>/gi,'<a$1 rel="nofollow">')),t=(t=(t=t.replace(/\sdata-redactor-(tag|class|style)="([^>]*?)"/gi,"")).replace(new RegExp('<([^>]*) data-verified="redactor"([^>]*)>',"gi"),"<$1$2>")).replace(new RegExp('<([^>]*) data-verified="redactor">',"gi"),"<$1>")},convertPre:function(e,t,n,i){var r=new RegExp("<"+n+"([^>]*)>([\\w\\W]*?)</"+n+">","gi"),a=e.split(r);if(a.length<4)return e;for(var o=1;o<a.length;o+=3)a[o]='<pre class="'+t+'" style="display: none;"'+a[o]+">",a[o+1]=i?this.clean.encodeEntities(a[o+1]):a[o+1],a[o+2]="</pre>"+a[o+2];return a.join("")},reconvertPre:function(e,t,n,i){var r,a=new RegExp('<pre class="'+t+'" style="display: none;"([^>]*)>([\\w\\W]*?)</pre>',"gi"),o=e.split(a),s=0;if(o.length<4)return e;for(var l=1;l<o.length;l+=3)r=this.$editor.find("pre."+t+":eq("+s+")"),o[l]="<"+n+" "+o[l]+">",o[l+1]=i?r.text():r.html(),o[l+2]="</"+n+">"+o[l+2],s++;return o.join("")},onPaste:function(t,n){if(t=(t=(t=(t=(t=e.trim(t)).replace(/<span class="s1">/gi,"<span>")).replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi," ")).replace(/<span class="Apple-tab-span"[^>]*>\t<\/span>/gi,"\t")).replace(/<span[^>]*>(\s|&nbsp;)<\/span>/gi," "),this.opts.pastePlainText)return this.clean.getPlainText(t);if(!this.utils.isSelectAll()&&void 0===n){if(this.utils.isCurrentOrParent(["FIGCAPTION","A"]))return this.clean.getPlainText(t,!1);if(this.utils.isCurrentOrParent("PRE"))return t=(t=(t=(t=t.replace(/\u201d/g,'"')).replace(/\u201c/g,'"')).replace(/\u2018/g,"'")).replace(/\u2019/g,"'"),this.clean.getPreCode(t);if(this.utils.isCurrentOrParent(["BLOCKQUOTE","H1","H2","H3","H4","H5","H6"])){if(t=this.clean.getOnlyImages(t),!this.utils.browser("msie")){var i=this.selection.getBlock();i&&"P"===i.tagName&&(t=t.replace(/<img([^>]*)>/gi,"<p><img$1></p>"))}return t}if(this.utils.isCurrentOrParent(["TD"]))return t=this.clean.onPasteTidy(t,"td"),this.opts.linebreaks&&(t=this.clean.replaceParagraphsToBr(t)),t=this.clean.replaceDivsToBr(t);if(this.utils.isCurrentOrParent(["LI"]))return this.clean.onPasteTidy(t,"li")}return t=this.clean.isSingleLine(t,n),this.clean.singleLine||(this.opts.linebreaks&&(t=this.clean.replaceParagraphsToBr(t)),this.opts.replaceDivs&&(t=this.clean.replaceDivs(t)),t=this.clean.saveFormTags(t)),t=this.clean.onPasteWord(t),t=this.clean.onPasteExtra(t),t=this.clean.onPasteTidy(t,"strict"),!this.clean.singleLine&&this.opts.paragraphize&&(t=this.paragraphize.load(t)),t=this.clean.removeDirtyStyles(t),t=this.clean.onPasteRemoveSpans(t),t=this.clean.onPasteRemoveEmpty(t),t=this.clean.convertInline(t)},onPasteWord:function(e){return e=(e=e.replace(/<!--[\s\S]*?-->/gi,"")).replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(e)&&(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=this.clean.onPasteIeFixLinks(e)).replace(/<img([^>]*)v:shapes=([^>]*)>/gi,"")).replace(/src="file\:\/\/(.*?)"/,'src=""')).replace(/<p([^>]*)class="MsoListParagraphCxSpFirst"([\w\W]*?)<\/p>/gi,"<ul><li$2</li>")).replace(/<p([^>]*)class="MsoListParagraphCxSpMiddle"([\w\W]*?)<\/p>/gi,"<li$2</li>")).replace(/<p([^>]*)class="MsoListParagraphCxSpLast"([\w\W]*?)<\/p>/gi,"<li$2</li></ul>")).replace(/<p([^>]*)class="MsoListParagraph"([\w\W]*?)<\/p>/gi,"<ul><li$2</li></ul>")).replace(/\xb7/g,"")).replace(/<p class="Mso([^>]*?)"/gi,"<p")).replace(/ class=\"(mso[^\"]*)\"/gi,"")).replace(/ class=(mso\w+)/gi,"")).replace(/<o:p([^>]*)>([\w\W]*?)<\/o:p>/gi,"$2")).replace(/<w:sdt([^>]*)>([\w\W]*?)<\/w:sdt[^>]*>/gi,"$2")).replace(/<w:sdt([^>]*)>([\w\W]*?)<\/w:sdt[^>]*>/gi,"$2")).replace(/\n/g," ")).replace(/<p>\n?<li>/gi,"<li>")),this.opts.cleanSpaces&&(e=e.replace(/(\s|&nbsp;)+/g," ")),e},onPasteExtra:function(e){return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/<b\sid="internal-source-marker([^>]*?)">([\w\W]*?)<\/b>/gi,"$2")).replace(/<b([^>]*)id="docs-internal-guid([^>]*?)">([\w\W]*?)<\/b>/gi,"$3")).replace(/<span[^>]*(font-style: italic; font-weight: bold|font-weight: bold; font-style: italic)[^>]*>/gi,'<span style="font-weight: bold;"><span style="font-style: italic;">')).replace(/<span[^>]*font-style: italic[^>]*>/gi,'<span style="font-style: italic;">')).replace(/<span[^>]*font-weight: bold[^>]*>/gi,'<span style="font-weight: bold;">')).replace(/<span[^>]*text-decoration: underline[^>]*>/gi,'<span style="text-decoration: underline;">')).replace(/<img>/gi,"")).replace(/\n{3,}/gi,"\n")).replace(/<font([^>]*)>([\w\W]*?)<\/font>/gi,"$2")).replace(/<p><p>/gi,"<p>")).replace(/<\/p><\/p>/gi,"</p>")).replace(/<li>(\s*|\t*|\n*)<p>/gi,"<li>")).replace(/<\/p>(\s*|\t*|\n*)<\/li>/gi,"</li>")).replace(/<\/p>\s<p/gi,"</p><p")).replace(/<img src="webkit-fake-url\:\/\/([^>]*?)"([^>]*)>/gi,"")).replace(/<p>\u2022([\w\W]*?)<\/p>/gi,"<li>$1</li>"),this.utils.browser("mozilla")&&(e=e.replace(/<br\s?\/?>$/gi,"")),e},onPasteTidy:function(e,t){var i,r=n,a=!1,o=!1,s=[["a","*"],["img",["src","alt"]],["span",["class","rel","data-verified"]],["iframe","*"],["video","*"],["audio","*"],["embed","*"],["object","*"],["param","*"],["source","*"]];if("all"===t)for(a=["p","span","h1","h2","h3","h4","h5","h6"],s=[],i=0;i<r.length;i++)s.push([r[i],["*"]]);else if("strict"===t)for(a=["p","span","h1","h2","h3","h4","h5","h6"],s=[],o=[],i=0;i<r.length;i++)o.push([r[i],["style"]]);else"td"===t?r=["table","tr","td","tbody","thead","tfoot","colgroup","col","caption","ul","ol","li","span","a","small","em","strong","code","kbd","mark","cite","var","samp","dfn","sup","sub","b","i","u","del","ol","ul","li","dl","dt","dd","br","iframe","video","audio","embed","param","object","img","h1","h2","h3","h4","h5","h6"]:"li"===t&&(r=["ul","ol","li","span","a","small","em","strong","code","kbd","mark","cite","var","samp","dfn","sup","sub","b","i","u","del","br","iframe","video","audio","embed","param","object","img"]);var l={deniedTags:!!this.opts.deniedTags&&this.opts.deniedTags,allowedTags:this.opts.allowedTags?this.opts.allowedTags:r,removeComments:!0,removePhp:!0,removeAttr:this.opts.removeAttr?this.opts.removeAttr:o,allowedAttr:this.opts.allowedAttr?this.opts.allowedAttr:s,removeEmpty:a};return this.tidy.load(e,l)},onPasteRemoveEmpty:function(e){return e=e.replace(/<(p|h[1-6])>(|\s|\n|\t|<br\s?\/?>)<\/(p|h[1-6])>/gi,""),this.opts.linebreaks||(e=e.replace(/<br>$/i,"")),e},onPasteRemoveSpans:function(e){return e=(e=e.replace(/<span>([^<]*)<\/span>/gi,"$1")).replace(/<span[^>]*>\s|&nbsp;<\/span>/gi," ")},onPasteIeFixLinks:function(t){return this.utils.browser("msie")?(0===e.trim(t).search(/^<a([^>]*)>([^<]*)<\/a>$/i)&&(t=t.replace(/^<a([^>]*)>([^<]*)<\/a>$/i,"$2")),t):t},isSingleLine:function(e,t){if(this.clean.singleLine=!1,!this.utils.isSelectAll()&&void 0===t){var n=this.opts.blockLevelElements.join("|").replace("P|","").replace("DIV|",""),i=e.match(new RegExp("</("+n+")>","gi")),r=e.match(/<\/(p|div)>/gi);if(!i&&(null===r||r&&r.length<=1)){var a=e.match(/<br\s?\/?>/gi),o=e.match(/<img([^>]*)>/gi);!a&&!o&&(this.clean.singleLine=!0,e=e.replace(/<\/?(p|div)([^>]*)>/gi,""))}}return e},stripTags:function(e,t){t=(((t||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join("");var n=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;return e.replace(n,(function(e,n){return t.indexOf("<"+n.toLowerCase()+">")>-1?e:""}))},savePreCode:function(e){return e=this.clean.savePreFormatting(e),e=this.clean.saveCodeFormatting(e)},savePreFormatting:function(t){var n=t.match(/<pre([^>]*)>([\w\W]*?)<\/pre>/gi);return null!==n&&e.each(n,e.proxy((function(e,n){var i=n.match(/<pre([^>]*)>([\w\W]*?)<\/pre>/i);i[2]=i[2].replace(/<br\s?\/?>/g,"\n"),i[2]=i[2].replace(/&nbsp;/g," "),this.opts.preSpaces&&(i[2]=i[2].replace(/\t/g,new Array(this.opts.preSpaces+1).join(" "))),i[2]=this.clean.encodeEntities(i[2]),i[2]=i[2].replace(/\$/g,"&#36;"),t=t.replace(n,"<pre"+i[1]+">"+i[2]+"</pre>")}),this)),t},saveCodeFormatting:function(t){var n=t.match(/<code([^>]*)>([^<]*)<\/code>/gi);return null!==n&&e.each(n,e.proxy((function(e,n){var i=n.match(/<code([^>]*)>([^<]*)<\/code>/i);i[2]=i[2].replace(/&nbsp;/g," "),i[2]=this.clean.encodeEntities(i[2]),i[2]=i[2].replace(/\$/g,"&#36;"),t=t.replace(n,"<code"+i[1]+">"+i[2]+"</code>")}),this)),t},getTextFromHtml:function(t){t=t.replace(/<br\s?\/?>|<\/H[1-6]>|<\/p>|<\/div>|<\/li>|<\/td>/gi,"\n");var n=document.createElement("div");return n.innerHTML=t,t=n.textContent||n.innerText,e.trim(t)},getPlainText:function(e,t){return e=(e=this.clean.getTextFromHtml(e)).replace(/\n/g,"<br />"),this.opts.paragraphize&&void 0===t&&!this.utils.browser("mozilla")&&(e=this.paragraphize.load(e)),e},getPreCode:function(e){return e=(e=e.replace(/<img([^>]*) style="([^>]*?)"([^>]*)>/gi,"<img$1$3>")).replace(/<img([^>]*)>/gi,"&lt;img$1&gt;"),e=this.clean.getTextFromHtml(e),this.opts.preSpaces&&(e=e.replace(/\t/g,new Array(this.opts.preSpaces+1).join(" "))),e=this.clean.encodeEntities(e)},getOnlyImages:function(e){return e=(e=(e=e.replace(/<img([^>]*)>/gi,"[img$1]")).replace(/<([Ss]*?)>/gi,"")).replace(/\[img([^>]*)\]/gi,"<img$1>")},getOnlyLinksAndImages:function(e){return e=(e=(e=(e=(e=e.replace(/<a(.*?)href="(.*?)"(.*?)>([\w\W]*?)<\/a>/gi,'[a href="$2"]$4[/a]')).replace(/<img(.*?)>/gi,"[img$1]")).replace(/<(.*?)>/gi,"")).replace(/\[a href="(.*?)"\]([\w\W]*?)\[\/a\]/gi,'<a href="$1">$2</a>')).replace(/\[img(.*?)\]/gi,"<img$1>")},encodeEntities:function(e){return(e=String(e).replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"')).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},removeDirtyStyles:function(t){if(this.utils.browser("msie"))return t;var n=document.createElement("div");return n.innerHTML=t,this.clean.clearUnverifiedRemove(e(n)),t=n.innerHTML,e(n).remove(),t},clearUnverified:function(){if(!this.utils.browser("msie")){this.clean.clearUnverifiedRemove(this.$editor);var e=this.$editor.find("h1, h2, h3, h4, h5, h6");e.find("span").removeAttr("style"),e.find(this.opts.verifiedTags.join(", ")).removeAttr("style"),this.code.sync()}},clearUnverifiedRemove:function(t){t.find("span").not('[data-verified="redactor"]').contents().unwrap(),t.find('span[data-verified="redactor"], img[data-verified="redactor"]').each((function(t,n){var i=e(n);i.attr("style",i.attr("rel"))}))},cleanEmptyParagraph:function(){var e=this.$editor.find("p").first();this.utils.isEmpty(e.html())&&e.remove()},setVerified:function(e){if(this.utils.browser("msie"))return e;var t=(e=(e=e.replace(new RegExp("<img([^>]*)>","gi"),'<img$1 data-verified="redactor">')).replace(new RegExp("<span([^>]*)>","gi"),'<span$1 data-verified="redactor">')).match(new RegExp('<(span|img)([^>]*)style="([^"]*)"([^>]*)>',"gi"));if(t)for(var n=t.length,i=0;i<n;i++)try{var r=t[i].replace(/style="(.*?)"/i,'style="$1" rel="$1"');e=e.replace(t[i],r)}catch(e){}return e},convertInline:function(t){var n=e("<div />").html(t),i=this.opts.inlineTags;return i.push("span"),n.find(i.join(",")).each((function(){var t=e(this),n=this.tagName.toLowerCase();t.attr("data-redactor-tag",n),"span"===n&&(t.attr("style")?t.attr("data-redactor-style",t.attr("style")):t.attr("class")&&t.attr("data-redactor-class",t.attr("class")))})),t=n.html(),n.remove(),t},normalizeLists:function(){this.$editor.find("li").each((function(t,n){var i=e(n).next();0!==i.length&&("UL"===i[0].tagName||"OL"===i[0].tagName)&&e(n).append(i)}))},removeSpaces:function(e){return e},replaceDivs:function(e){return this.opts.linebreaks?e=(e=e.replace(/<div><br\s?\/?><\/div>/gi,"<br />")).replace(/<div(.*?)>([\w\W]*?)<\/div>/gi,"$2<br />"):e=e.replace(/<div(.*?)>([\w\W]*?)<\/div>/gi,"<p$1>$2</p>"),e=(e=e.replace(/<div([^>]*)>/gi,"")).replace(/<\/div>/gi,"")},replaceDivsToBr:function(e){return e=(e=(e=e.replace(/<div\s(.*?)>/gi,"<p>")).replace(/<div><br\s?\/?><\/div>/gi,"<br /><br />")).replace(/<div>([\w\W]*?)<\/div>/gi,"$1<br /><br />")},replaceParagraphsToBr:function(e){return e=(e=(e=(e=e.replace(/<p\s(.*?)>/gi,"<p>")).replace(/<p><br\s?\/?><\/p>/gi,"<br />")).replace(/<p>([\w\W]*?)<\/p>/gi,"$1<br /><br />")).replace(/(<br\s?\/?>){1,}\n?<\/blockquote>/gi,"</blockquote>")},saveFormTags:function(e){return e.replace(/<form(.*?)>([\w\W]*?)<\/form>/gi,'<section$1 rel="redactor-form-tag">$2</section>')},restoreFormTags:function(e){return e.replace(/<section(.*?) rel="redactor-form-tag"(.*?)>([\w\W]*?)<\/section>/gi,"<form$1$2>$3</form>")}},t})),n("modules/code",["jquery"],(function(e){"use strict";function t(){}return t.prototype={set:function(t){t=e.trim(t.toString()),t=this.clean.onSet(t),this.$editor.html(t),this.code.sync(),""!==t&&this.placeholder.remove(),setTimeout(e.proxy(this.buffer.add,this),15),!1===this.start&&this.observe.load()},get:function(){return this.$textarea.val()},sync:function(){var t=function(){this.code.syncTimeout=null,this.code.startSync.apply(this)};this.code.syncTimeout||this.code.startSync.apply(this),clearTimeout(this.code.syncTimeout),this.code.syncTimeout=setTimeout(e.proxy(t,this),50)},startSync:function(){var e=this.$editor.html();void 0!==this.code.syncCode&&this.code.syncCode===e||(this.utils.isIe11()&&"<br>"===e&&(e=""),this.code.syncCode=e,e=this.core.setCallback("syncBefore",e),e=this.clean.onSync(e),this.$textarea.val(e),this.core.setCallback("sync",e),e=this.$textarea.val(),!1===this.start&&this.core.setCallback("change",e),this.start=!1,this.opts.codemirror&&this.$textarea.next(".CodeMirror").each((function(t,n){n.CodeMirror.setValue(e)})))},toggle:function(){this.opts.visual?this.code.showCode():this.code.showVisual()},showCode:function(){this.code.offset=this.caret.getOffset();var t=e(window).scrollTop(),n=this.$editor.innerHeight();this.$editor.hide();var i=this.$textarea.val();this.modified=this.clean.removeSpaces(i),this.$textarea.val(i),this.opts.codemirror?this.$textarea.next(".CodeMirror").each((function(t,r){e(r).show(),r.CodeMirror.setValue(i),r.CodeMirror.setSize(null,n),r.CodeMirror.refresh(),r.CodeMirror.focus()})):(this.$textarea.height(n).show().get(0).focus(),this.$textarea.on("keydown.redactor-textarea-indenting",this.code.textareaIndenting),e(window).scrollTop(t),this.$textarea[0].setSelectionRange&&this.$textarea[0].setSelectionRange(0,0),this.$textarea[0].scrollTop=0),this.opts.visual=!1,this.button.setInactiveInCode(),this.button.setActive("html"),this.core.setCallback("source",i)},showVisual:function(){var e;this.opts.visual||(this.opts.codemirror?this.$textarea.next(".CodeMirror").each((function(t,n){e=n.CodeMirror.getValue()})):e=this.$textarea.hide().val(),this.modified!==this.clean.removeSpaces(e)&&this.code.set(e),this.opts.codemirror&&this.$textarea.next(".CodeMirror").hide(),this.$editor.show(),this.utils.isEmpty(e)||this.placeholder.remove(),this.caret.setOffset(this.code.offset),this.$textarea.off("keydown.redactor-textarea-indenting"),this.button.setActiveInVisual(),this.button.setInactive("html"),this.observe.load(),this.opts.visual=!0,this.core.setCallback("visual",e))},textareaIndenting:function(e){if(9!==e.keyCode)return!0;var t=this.$textarea,n=t.get(0).selectionStart;return t.val(t.val().substring(0,n)+"\t"+t.val().substring(t.get(0).selectionEnd)),t.get(0).selectionStart=t.get(0).selectionEnd=n+1,!1}},t})),function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof n&&n.amd)return n("codemirror/lib/codemirror",[],e);this.CodeMirror=e()}}((function(){"use strict";function e(n,i){if(!(this instanceof e))return new e(n,i);this.options=i=i?gr(i):{},gr(Ma,i,!1),p(i);var r=i.value;"string"==typeof r&&(r=new no(r,i.mode)),this.doc=r;var a=this.display=new t(n,r);for(var o in a.wrapper.CodeMirror=this,c(this),l(this),i.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),i.autofocus&&!da&&Ct(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new lr},Jr&&Zr<11&&setTimeout(mr(St,this,!0),20),At(this),Dr(),Ze(this),this.curOp.forceUpdate=!0,xi(this,r),i.autofocus&&!da||Sr()==a.input?setTimeout(mr(Qt,this),20):Jt(this),Na)Na.hasOwnProperty(o)&&Na[o](this,i[o],Oa);b(this);for(var s=0;s<ja.length;++s)ja[s](this);tt(this)}function t(e,t){var n=this,i=n.input=br("textarea",null,null,"position: absolute; padding: 0; width: 1px; height: 1em; outline: none");ea?i.style.width="1000px":i.setAttribute("wrap","off"),la&&(i.style.border="1px solid black"),i.setAttribute("autocorrect","off"),i.setAttribute("autocapitalize","off"),i.setAttribute("spellcheck","false"),n.inputDiv=br("div",[i],null,"overflow: hidden; position: relative; width: 3px; height: 0px;"),n.scrollbarH=br("div",[br("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar"),n.scrollbarV=br("div",[br("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n.scrollbarFiller=br("div",null,"CodeMirror-scrollbar-filler"),n.gutterFiller=br("div",null,"CodeMirror-gutter-filler"),n.lineDiv=br("div",null,"CodeMirror-code"),n.selectionDiv=br("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=br("div",null,"CodeMirror-cursors"),n.measure=br("div",null,"CodeMirror-measure"),n.lineMeasure=br("div",null,"CodeMirror-measure"),n.lineSpace=br("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none"),n.mover=br("div",[br("div",[n.lineSpace],"CodeMirror-lines")],null,"position: relative"),n.sizer=br("div",[n.mover],"CodeMirror-sizer"),n.heightForcer=br("div",null,null,"position: absolute; height: "+ho+"px; width: 1px;"),n.gutters=br("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=br("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=br("div",[n.inputDiv,n.scrollbarH,n.scrollbarV,n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),Jr&&Zr<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),la&&(i.style.width="0px"),ea||(n.scroller.draggable=!0),aa&&(n.inputDiv.style.height="1px",n.inputDiv.style.position="absolute"),Jr&&Zr<8&&(n.scrollbarH.style.minHeight=n.scrollbarV.style.minWidth="18px"),e.appendChild?e.appendChild(n.wrapper):e(n.wrapper),n.viewFrom=n.viewTo=t.first,n.view=[],n.externalMeasured=null,n.viewOffset=0,n.lastSizeC=0,n.updateLineNumbers=null,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.prevInput="",n.alignWidgets=!1,n.pollingFast=!1,n.poll=new lr,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.inaccurateSelection=!1,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),i(t)}function i(e){e.doc.iter((function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)})),e.doc.frontier=e.doc.first,we(e,100),e.state.modeGen++,e.curOp&&pt(e)}function r(e){e.options.lineWrapping?(Ir(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth=""):(kr(e.display.wrapper,"CodeMirror-wrap"),h(e)),o(e),pt(e),Ue(e),setTimeout((function(){v(e)}),100)}function a(e){var t=Qe(e.display),n=e.options.lineWrapping,i=n&&Math.max(5,e.display.scroller.clientWidth/Je(e.display)-3);return function(r){if(ni(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 n?a+(Math.ceil(r.text.length/i)||1)*t:a+t}}function o(e){var t=e.doc,n=a(e);t.iter((function(e){var t=n(e);t!=e.height&&Ni(e,t)}))}function s(e){var t=qa[e.options.keyMap].style;e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-keymap-\S+/g,"")+(t?" cm-keymap-"+t:"")}function l(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ue(e)}function d(e){c(e),pt(e),setTimeout((function(){_(e)}),20)}function c(e){var t=e.display.gutters,n=e.options.gutters;Er(t);for(var i=0;i<n.length;++i){var r=n[i],a=t.appendChild(br("div",null,"CodeMirror-gutter "+r));"CodeMirror-linenumbers"==r&&(e.display.lineGutter=a,a.style.width=(e.display.lineNumWidth||1)+"px")}t.style.display=i?"":"none",u(e)}function u(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px",e.display.scrollbarH.style.left=e.options.fixedGutter?t+"px":0}function f(e){if(0==e.height)return 0;for(var t,n=e.text.length,i=e;t=Kn(i);){i=(r=t.find(0,!0)).from.line,n+=r.from.ch-r.to.ch}for(i=e;t=Xn(i);){var r=t.find(0,!0);n-=i.text.length-r.from.ch,n+=(i=r.to.line).text.length-r.to.ch}return n}function h(e){var t=e.display,n=e.doc;t.maxLine=Di(n,n.first),t.maxLineLength=f(t.maxLine),t.maxLineChanged=!0,n.iter((function(e){var n=f(e);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}function p(e){var t=fr(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 g(e){return e.display.scroller.clientHeight-e.display.wrapper.clientHeight<ho-3}function m(e){var t=e.display.scroller;return{clientHeight:t.clientHeight,barHeight:e.display.scrollbarV.clientHeight,scrollWidth:t.scrollWidth,clientWidth:t.clientWidth,hScrollbarTakesSpace:g(e),barWidth:e.display.scrollbarH.clientWidth,docHeight:Math.round(e.doc.height+Ie(e.display))}}function v(e,t){t||(t=m(e));var n=e.display,i=Mr(n.measure),r=t.docHeight+ho,a=t.scrollWidth>t.clientWidth;a&&t.scrollWidth<=t.clientWidth+1&&i>0&&!t.hScrollbarTakesSpace&&(a=!1);var o=r>t.clientHeight;if(o?(n.scrollbarV.style.display="block",n.scrollbarV.style.bottom=a?i+"px":"0",n.scrollbarV.firstChild.style.height=Math.max(0,r-t.clientHeight+(t.barHeight||n.scrollbarV.clientHeight))+"px"):(n.scrollbarV.style.display="",n.scrollbarV.firstChild.style.height="0"),a?(n.scrollbarH.style.display="block",n.scrollbarH.style.right=o?i+"px":"0",n.scrollbarH.firstChild.style.width=t.scrollWidth-t.clientWidth+(t.barWidth||n.scrollbarH.clientWidth)+"px"):(n.scrollbarH.style.display="",n.scrollbarH.firstChild.style.width="0"),a&&o?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=n.scrollbarFiller.style.width=i+"px"):n.scrollbarFiller.style.display="",a&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=i+"px",n.gutterFiller.style.width=n.gutters.offsetWidth+"px"):n.gutterFiller.style.display="",!e.state.checkedOverlayScrollbar&&t.clientHeight>0){if(0===i){var s=ca&&!oa?"12px":"18px";n.scrollbarV.style.minWidth=n.scrollbarH.style.minHeight=s;var l=function(t){er(t)!=n.scrollbarV&&er(t)!=n.scrollbarH&&dt(e,Mt)(t)};lo(n.scrollbarV,"mousedown",l),lo(n.scrollbarH,"mousedown",l)}e.state.checkedOverlayScrollbar=!0}}function y(e,t,n){var i=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;i=Math.floor(i-ke(e));var r=n&&null!=n.bottom?n.bottom:i+e.wrapper.clientHeight,a=Pi(t,i),o=Pi(t,r);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;if(s<a)return{from:s,to:Pi(t,Li(Di(t,s))+e.wrapper.clientHeight)};if(Math.min(l,t.lastLine())>=o)return{from:Pi(t,Li(Di(t,l))-e.wrapper.clientHeight),to:l}}return{from:a,to:Math.max(o,a+1)}}function _(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=w(t)-t.scroller.scrollLeft+e.doc.scrollLeft,r=t.gutters.offsetWidth,a=i+"px",o=0;o<n.length;o++)if(!n[o].hidden){e.options.fixedGutter&&n[o].gutter&&(n[o].gutter.style.left=a);var s=n[o].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=i+r+"px")}}function b(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=E(e.options,t.first+t.size-1),i=e.display;if(n.length!=i.lineNumChars){var r=i.measure.appendChild(br("div",[br("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=r.firstChild.offsetWidth,o=r.offsetWidth-a;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(a,i.lineGutter.offsetWidth-o),i.lineNumWidth=i.lineNumInnerWidth+o,i.lineNumChars=i.lineNumInnerWidth?n.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",u(e),!0}return!1}function E(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function w(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function T(e,t,n){var i=e.display;this.viewport=t,this.visible=y(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.oldViewFrom=i.viewFrom,this.oldViewTo=i.viewTo,this.oldScrollerWidth=i.scroller.clientWidth,this.force=n,this.dims=R(e)}function S(e,t){var n=e.display,i=e.doc;if(t.editorIsHidden)return mt(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&0==bt(e))return!1;b(e)&&(mt(e),t.dims=R(e));var r=i.first+i.size,a=Math.max(t.visible.from-e.options.viewportMargin,i.first),o=Math.min(r,t.visible.to+e.options.viewportMargin);n.viewFrom<a&&a-n.viewFrom<20&&(a=Math.max(i.first,n.viewFrom)),n.viewTo>o&&n.viewTo-o<20&&(o=Math.min(r,n.viewTo)),ma&&(a=ei(e.doc,a),o=ti(e.doc,o));var s=a!=n.viewFrom||o!=n.viewTo||n.lastSizeC!=t.wrapperHeight;_t(e,a,o),n.viewOffset=Li(Di(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=bt(e);if(!s&&0==l&&!t.force&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var d=Sr();return l>4&&(n.lineDiv.style.display="none"),M(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),d&&Sr()!=d&&d.offsetHeight&&d.focus(),Er(n.cursorDiv),Er(n.selectionDiv),s&&(n.lastSizeC=t.wrapperHeight,we(e,400)),n.updateLineNumbers=null,!0}function C(e,t){t.force;for(var n=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldScrollerWidth!=e.display.scroller.clientWidth)!0;else if(!1,n&&null!=n.top&&(n={top:Math.min(e.doc.height+Ie(e.display)-ho-e.display.scroller.clientHeight,n.top)}),t.visible=y(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!S(e,t))break;x(e);var r=m(e);ye(e),I(e,r),v(e,r)}nr(e,"update",e),(e.display.viewFrom!=t.oldViewFrom||e.display.viewTo!=t.oldViewTo)&&nr(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo)}function k(e,t){var n=new T(e,t);if(S(e,n)){x(e),C(e,n);var i=m(e);ye(e),I(e,i),v(e,i)}}function I(e,t){e.display.sizer.style.minHeight=e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=Math.max(t.docHeight,t.clientHeight-ho)+"px"}function A(e,t){e.display.sizer.offsetWidth+e.display.gutters.offsetWidth<e.display.scroller.clientWidth-1&&(e.display.sizer.style.minHeight=e.display.heightForcer.style.top="0px",e.display.gutters.style.height=t.docHeight+"px")}function x(e){for(var t=e.display,n=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var r,a=t.view[i];if(!a.hidden){if(Jr&&Zr<8){var o=a.node.offsetTop+a.node.offsetHeight;r=o-n,n=o}else{var s=a.node.getBoundingClientRect();r=s.bottom-s.top}var l=a.line.height-r;if(r<2&&(r=Qe(t)),(l>.001||l<-.001)&&(Ni(a.line,r),D(a.line),a.rest))for(var d=0;d<a.rest.length;d++)D(a.rest[d])}}}function D(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t)e.widgets[t].height=e.widgets[t].node.offsetHeight}function R(e){for(var t=e.display,n={},i={},r=t.gutters.clientLeft,a=t.gutters.firstChild,o=0;a;a=a.nextSibling,++o)n[e.options.gutters[o]]=a.offsetLeft+a.clientLeft+r,i[e.options.gutters[o]]=a.clientWidth;return{fixedPos:w(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function M(e,t,n){function i(t){var n=t.nextSibling;return ea&&ca&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var r=e.display,a=e.options.lineNumbers,o=r.lineDiv,s=o.firstChild,l=r.view,d=r.viewFrom,c=0;c<l.length;c++){var u=l[c];if(!u.hidden)if(u.node){for(;s!=u.node;)s=i(s);var f=a&&null!=t&&t<=d&&u.lineNumber;u.changes&&(fr(u.changes,"gutter")>-1&&(f=!1),N(e,u,d,n)),f&&(Er(u.lineNumber),u.lineNumber.appendChild(document.createTextNode(E(e.options,d)))),s=u.node.nextSibling}else{var h=H(e,u,d,n);o.insertBefore(h,s)}d+=u.size}for(;s;)s=i(s)}function N(e,t,n,i){for(var r=0;r<t.changes.length;r++){var a=t.changes[r];"text"==a?F(e,t):"gutter"==a?B(e,t,n,i):"class"==a?j(t):"widget"==a&&U(t,i)}t.changes=null}function O(e){return e.node==e.text&&(e.node=br("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),Jr&&Zr<8&&(e.node.style.zIndex=2)),e.node}function P(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 n=O(e);e.background=n.insertBefore(br("div",null,t),n.firstChild)}}function L(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):vi(e,t)}function F(e,t){var n=t.text.className,i=L(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,j(t)):n&&(t.text.className=n)}function j(e){P(e),e.line.wrapClass?O(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 B(e,t,n,i){t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null);var r=t.line.gutterMarkers;if(e.options.lineNumbers||r){
var a=O(t),o=t.gutter=a.insertBefore(br("div",null,"CodeMirror-gutter-wrapper","position: absolute; left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px"),t.text);if(e.options.lineNumbers&&(!r||!r["CodeMirror-linenumbers"])&&(t.lineNumber=o.appendChild(br("div",E(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.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],d=r.hasOwnProperty(l)&&r[l];d&&o.appendChild(br("div",[d],"CodeMirror-gutter-elt","left: "+i.gutterLeft[l]+"px; width: "+i.gutterWidth[l]+"px"))}}}function U(e,t){e.alignable&&(e.alignable=null);for(var n=e.node.firstChild;n;n=i){var i=n.nextSibling;"CodeMirror-linewidget"==n.className&&e.node.removeChild(n)}$(e,t)}function H(e,t,n,i){var r=L(e,t);return t.text=t.node=r.pre,r.bgClass&&(t.bgClass=r.bgClass),r.textClass&&(t.textClass=r.textClass),j(t),B(e,t,n,i),$(t,i),t.node}function $(e,t){if(q(e.line,e,t,!0),e.rest)for(var n=0;n<e.rest.length;n++)q(e.rest[n],e,t,!1)}function q(e,t,n,i){if(e.widgets)for(var r=O(t),a=0,o=e.widgets;a<o.length;++a){var s=o[a],l=br("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||(l.ignoreEvents=!0),z(s,l,t,n),i&&s.above?r.insertBefore(l,t.gutter||t.text):r.appendChild(l),nr(s,"redraw")}}function z(e,t,n,i){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var r=i.wrapperWidth;t.style.left=i.fixedPos+"px",e.coverGutter||(r-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=r+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function V(e){return va(e.line,e.ch)}function G(e,t){return ya(e,t)<0?t:e}function W(e,t){return ya(e,t)<0?e:t}function Y(e,t){this.ranges=e,this.primIndex=t}function K(e,t){this.anchor=e,this.head=t}function X(e,t){var n=e[t];e.sort((function(e,t){return ya(e.from(),t.from())})),t=fr(e,n);for(var i=1;i<e.length;i++){var r=e[i],a=e[i-1];if(ya(a.to(),r.from())>=0){var o=W(a.from(),r.from()),s=G(a.to(),r.to()),l=a.empty()?r.from()==r.head:a.from()==a.head;i<=t&&--t,e.splice(--i,2,new K(l?s:o,l?o:s))}}return new Y(e,t)}function Q(e,t){return new Y([new K(e,t||e)],0)}function J(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Z(e,t){if(t.line<e.first)return va(e.first,0);var n=e.first+e.size-1;return t.line>n?va(n,Di(e,n).text.length):ee(t,Di(e,t.line).text.length)}function ee(e,t){var n=e.ch;return null==n||n>t?va(e.line,t):n<0?va(e.line,0):e}function te(e,t){return t>=e.first&&t<e.first+e.size}function ne(e,t){for(var n=[],i=0;i<t.length;i++)n[i]=Z(e,t[i]);return n}function ie(e,t,n,i){if(e.cm&&e.cm.display.shift||e.extend){var r=t.anchor;if(i){var a=ya(n,r)<0;a!=ya(i,r)<0?(r=n,n=i):a!=ya(n,i)<0&&(n=i)}return new K(r,n)}return new K(i||n,n)}function re(e,t,n,i){ce(e,new Y([ie(e,e.sel.primary(),t,n)],0),i)}function ae(e,t,n){for(var i=[],r=0;r<e.sel.ranges.length;r++)i[r]=ie(e,e.sel.ranges[r],t[r],null);ce(e,X(i,e.sel.primIndex),n)}function oe(e,t,n,i){var r=e.sel.ranges.slice(0);r[t]=n,ce(e,X(r,e.sel.primIndex),i)}function se(e,t,n,i){ce(e,Q(t,n),i)}function le(e,t){var n={ranges:t.ranges,update:function(t){this.ranges=[];for(var n=0;n<t.length;n++)this.ranges[n]=new K(Z(e,t[n].anchor),Z(e,t[n].head))}};return uo(e,"beforeSelectionChange",e,n),e.cm&&uo(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?X(n.ranges,n.ranges.length-1):t}function de(e,t,n){var i=e.history.done,r=ur(i);r&&r.ranges?(i[i.length-1]=t,ue(e,t,n)):ce(e,t,n)}function ce(e,t,n){ue(e,t,n),zi(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ue(e,t,n){(or(e,"beforeSelectionChange")||e.cm&&or(e.cm,"beforeSelectionChange"))&&(t=le(e,t));var i=n&&n.bias||(ya(t.primary().head,e.sel.primary().head)<0?-1:1);fe(e,pe(e,t,i,!0)),(!n||!1!==n.scroll)&&e.cm&&_n(e.cm)}function fe(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=e.cm.curOp.selectionChanged=!0,ar(e.cm)),nr(e,"cursorActivity",e))}function he(e){fe(e,pe(e,e.sel,null,!1),go)}function pe(e,t,n,i){for(var r,a=0;a<t.ranges.length;a++){var o=t.ranges[a],s=ge(e,o.anchor,n,i),l=ge(e,o.head,n,i);(r||s!=o.anchor||l!=o.head)&&(r||(r=t.ranges.slice(0,a)),r[a]=new K(s,l))}return r?X(r,t.primIndex):t}function ge(e,t,n,i){var r=!1,a=t,o=n||1;e.cantEdit=!1;e:for(;;){var s=Di(e,a.line);if(s.markedSpans)for(var l=0;l<s.markedSpans.length;++l){var d=s.markedSpans[l],c=d.marker;if((null==d.from||(c.inclusiveLeft?d.from<=a.ch:d.from<a.ch))&&(null==d.to||(c.inclusiveRight?d.to>=a.ch:d.to>a.ch))){if(i&&(uo(c,"beforeCursorEnter"),c.explicitlyCleared)){if(!s.markedSpans)break;--l;continue}if(!c.atomic)continue;var u=c.find(o<0?-1:1);if(0==ya(u,a)&&(u.ch+=o,u.ch<0?u=u.line>e.first?Z(e,va(u.line-1)):null:u.ch>s.text.length&&(u=u.line<e.first+e.size-1?va(u.line+1,0):null),!u)){if(r)return i?(e.cantEdit=!0,va(e.first,0)):ge(e,t,n,!0);r=!0,u=t,o=-o}a=u;continue e}}return a}}function me(e){for(var t=e.display,n=e.doc,i={},r=i.cursors=document.createDocumentFragment(),a=i.selection=document.createDocumentFragment(),o=0;o<n.sel.ranges.length;o++){var s=n.sel.ranges[o],l=s.empty();(l||e.options.showCursorWhenSelecting)&&_e(e,s,r),l||be(e,s,a)}if(e.options.moveInputWithCursor){var d=Ge(e,n.sel.primary().head,"div"),c=t.wrapper.getBoundingClientRect(),u=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+u.top-c.top)),i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+u.left-c.left))}return i}function ve(e,t){wr(e.display.cursorDiv,t.cursors),wr(e.display.selectionDiv,t.selection),null!=t.teTop&&(e.display.inputDiv.style.top=t.teTop+"px",e.display.inputDiv.style.left=t.teLeft+"px")}function ye(e){ve(e,me(e))}function _e(e,t,n){var i=Ge(e,t.head,"div",null,null,!e.options.singleCursorHeightPerLine),r=n.appendChild(br("div","\xa0","CodeMirror-cursor"));if(r.style.left=i.left+"px",r.style.top=i.top+"px",r.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var a=n.appendChild(br("div","\xa0","CodeMirror-cursor CodeMirror-secondarycursor"));a.style.display="",a.style.left=i.other.left+"px",a.style.top=i.other.top+"px",a.style.height=.85*(i.other.bottom-i.other.top)+"px"}}function be(e,t,n){function i(e,t,n,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),s.appendChild(br("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?c-e:n)+"px; height: "+(i-t)+"px"))}function r(t,n,r){function a(n,i){return Ve(e,va(t,n),"div",u,i)}var s,l,u=Di(o,t),f=u.text.length;return Lr(Fi(u),n||0,null==r?f:r,(function(e,t,o){var u,h,p,g=a(e,"left");if(e==t)u=g,h=p=g.left;else{if(u=a(t-1,"right"),"rtl"==o){var m=g;g=u,u=m}h=g.left,p=u.right}null==n&&0==e&&(h=d),u.top-g.top>3&&(i(h,g.top,null,g.bottom),h=d,g.bottom<u.top&&i(h,g.bottom,null,u.top)),null==r&&t==f&&(p=c),(!s||g.top<s.top||g.top==s.top&&g.left<s.left)&&(s=g),(!l||u.bottom>l.bottom||u.bottom==l.bottom&&u.right>l.right)&&(l=u),h<d+1&&(h=d),i(h,u.top,p-h,u.bottom)})),{start:s,end:l}}var a=e.display,o=e.doc,s=document.createDocumentFragment(),l=Ae(e.display),d=l.left,c=a.lineSpace.offsetWidth-l.right,u=t.from(),f=t.to();if(u.line==f.line)r(u.line,u.ch,f.ch);else{var h=Di(o,u.line),p=Di(o,f.line),g=Jn(h)==Jn(p),m=r(u.line,u.ch,g?h.text.length+1:null).end,v=r(f.line,g?0:null,f.ch).start;g&&(m.top<v.top-2?(i(m.right,m.top,null,m.bottom),i(d,v.top,v.left,v.bottom)):i(m.right,m.top,v.left-m.right,m.bottom)),m.bottom<v.top&&i(d,m.bottom,null,v.top)}n.appendChild(s)}function Ee(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval((function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function we(e,t){e.doc.mode.startState&&e.doc.frontier<e.display.viewTo&&e.state.highlight.set(t,mr(Te,e))}function Te(e){var t=e.doc;if(t.frontier<t.first&&(t.frontier=t.first),!(t.frontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,i=Ua(t.mode,Ce(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=hi(e,a,i,!0);a.styles=s.styles;var l=a.styleClasses,d=s.classes;d?a.styleClasses=d:l&&(a.styleClasses=null);for(var c=!o||o.length!=a.styles.length||l!=d&&(!l||!d||l.bgClass!=d.bgClass||l.textClass!=d.textClass),u=0;!c&&u<o.length;++u)c=o[u]!=a.styles[u];c&&r.push(t.frontier),a.stateAfter=Ua(t.mode,i)}else gi(e,a.text,i),a.stateAfter=t.frontier%5==0?Ua(t.mode,i):null;if(++t.frontier,+new Date>n)return we(e,e.options.workDelay),!0})),r.length&&lt(e,(function(){for(var t=0;t<r.length;t++)gt(e,r[t],"text")}))}}function Se(e,t,n){for(var i,r,a=e.doc,o=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>o;--s){if(s<=a.first)return a.first;var l=Di(a,s-1);if(l.stateAfter&&(!n||s<=a.frontier))return s;var d=yo(l.text,null,e.options.tabSize);(null==r||i>d)&&(r=s-1,i=d)}return r}function Ce(e,t,n){var i=e.doc,r=e.display;if(!i.mode.startState)return!0;var a=Se(e,t,n),o=a>i.first&&Di(i,a-1).stateAfter;return o=o?Ua(i.mode,o):Ha(i.mode),i.iter(a,t,(function(n){gi(e,n.text,o);var s=a==t-1||a%5==0||a>=r.viewFrom&&a<r.viewTo;n.stateAfter=s?Ua(i.mode,o):null,++a})),n&&(i.frontier=a),o}function ke(e){return e.lineSpace.offsetTop}function Ie(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ae(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=wr(e.measure,br("pre","x")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function xe(e,t,n){var i=e.options.lineWrapping,r=i&&e.display.scroller.clientWidth;if(!t.measure.heights||i&&t.measure.width!=r){var a=t.measure.heights=[];if(i){t.measure.width=r;for(var o=t.text.firstChild.getClientRects(),s=0;s<o.length-1;s++){var l=o[s],d=o[s+1];Math.abs(l.bottom-d.bottom)>2&&a.push((l.bottom+d.top)/2-n.top)}}a.push(n.bottom-n.top)}}function De(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(i=0;i<e.rest.length;i++)if(Oi(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Re(e,t){var n=Oi(t=Jn(t)),i=e.display.externalMeasured=new ft(e.doc,t,n);i.lineN=n;var r=i.built=vi(e,i);return i.text=r.pre,wr(e.display.lineMeasure,r.pre),i}function Me(e,t,n,i){return Pe(e,Oe(e,t),n,i)}function Ne(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[vt(e,t)];var n=e.display.externalMeasured;return n&&t>=n.lineN&&t<n.lineN+n.size?n:void 0}function Oe(e,t){var n=Oi(t),i=Ne(e,n);i&&!i.text?i=null:i&&i.changes&&N(e,i,n,R(e)),i||(i=Re(e,t));var r=De(i,t,n);return{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function Pe(e,t,n,i,r){t.before&&(n=-1);var a,o=n+(i||"");return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(xe(e,t.view,t.rect),t.hasHeights=!0),(a=Le(e,t,n,i)).bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:r?a.rtop:a.top,bottom:r?a.rbottom:a.bottom}}function Le(e,t,n,i){for(var r,a,o,s,l,d=t.map,c=0;c<d.length;c+=3){var u=d[c],f=d[c+1];if(n<u?(a=0,o=1,s="left"):n<f?o=(a=n-u)+1:(c==d.length-3||n==f&&d[c+3]>n)&&(a=(o=f-u)-1,n>=f&&(s="right")),null!=a){if(r=d[c+2],u==f&&i==(r.insertLeft?"left":"right")&&(s=i),"left"==i&&0==a)for(;c&&d[c-2]==d[c-3]&&d[c-1].insertLeft;)r=d[2+(c-=3)],s="left";if("right"==i&&a==f-u)for(;c<d.length-3&&d[c+3]==d[c+4]&&!d[c+5].insertLeft;)r=d[(c+=3)+2],s="right";break}}if(3==r.nodeType){for(c=0;c<4;c++){for(;a&&_r(t.line.text.charAt(u+a));)--a;for(;u+o<f&&_r(t.line.text.charAt(u+o));)++o;if(Jr&&Zr<9&&0==a&&o==f-u)l=r.parentNode.getBoundingClientRect();else if(Jr&&e.options.lineWrapping){l=(h=Eo(r,a,o).getClientRects()).length?h["right"==i?h.length-1:0]:wa}else l=Eo(r,a,o).getBoundingClientRect()||wa;if(l.left||l.right||0==a)break;o=a,a-=1,s="right"}Jr&&Zr<11&&(l=Fe(e.display.measure,l))}else{var h;a>0&&(s=i="right"),l=e.options.lineWrapping&&(h=r.getClientRects()).length>1?h["right"==i?h.length-1:0]:r.getBoundingClientRect()}if(Jr&&Zr<9&&!a&&(!l||!l.left&&!l.right)){var p=r.parentNode.getClientRects()[0];l=p?{left:p.left,right:p.left+Je(e.display),top:p.top,bottom:p.bottom}:wa}var g=l.top-t.rect.top,m=l.bottom-t.rect.top,v=(g+m)/2,y=t.view.measure.heights;for(c=0;c<y.length-1&&!(v<y[c]);c++);var _=c?y[c-1]:0,b=y[c],E={left:("right"==s?l.right:l.left)-t.rect.left,right:("left"==s?l.left:l.right)-t.rect.left,top:_,bottom:b};return!l.left&&!l.right&&(E.bogus=!0),e.options.singleCursorHeightPerLine||(E.rtop=g,E.rbottom=m),E}function Fe(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!Pr(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*i,bottom:t.bottom*i}}function je(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 Be(e){e.display.externalMeasure=null,Er(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)je(e.display.view[t])}function Ue(e){Be(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function He(){return window.pageXOffset||(document.documentElement||document.body).scrollLeft}function $e(){return window.pageYOffset||(document.documentElement||document.body).scrollTop}function qe(e,t,n,i){if(t.widgets)for(var r=0;r<t.widgets.length;++r)if(t.widgets[r].above){var a=ai(t.widgets[r]);n.top+=a,n.bottom+=a}if("line"==i)return n;i||(i="local");var o=Li(t);if("local"==i?o+=ke(e.display):o-=e.display.viewOffset,"page"==i||"window"==i){var s=e.display.lineSpace.getBoundingClientRect();o+=s.top+("window"==i?0:$e());var l=s.left+("window"==i?0:He());n.left+=l,n.right+=l}return n.top+=o,n.bottom+=o,n}function ze(e,t,n){if("div"==n)return t;var i=t.left,r=t.top;if("page"==n)i-=He(),r-=$e();else if("local"==n||!n){var a=e.display.sizer.getBoundingClientRect();i+=a.left,r+=a.top}var o=e.display.lineSpace.getBoundingClientRect();return{left:i-o.left,top:r-o.top}}function Ve(e,t,n,i,r){return i||(i=Di(e.doc,t.line)),qe(e,i,Me(e,i,t.ch,r),n)}function Ge(e,t,n,i,r,a){function o(t,o){var s=Pe(e,r,t,o?"right":"left",a);return o?s.left=s.right:s.right=s.left,qe(e,i,s,n)}function s(e,t){var n=l[t],i=n.level%2;return e==Fr(n)&&t&&n.level<l[t-1].level?(e=jr(n=l[--t])-(n.level%2?0:1),i=!0):e==jr(n)&&t<l.length-1&&n.level<l[t+1].level&&(e=Fr(n=l[++t])-n.level%2,i=!1),i&&e==n.to&&e>n.from?o(e-1):o(e,i)}i=i||Di(e.doc,t.line),r||(r=Oe(e,i));var l=Fi(i),d=t.ch;if(!l)return o(d);var c=s(d,Vr(l,d));return null!=Po&&(c.other=s(d,Po)),c}function We(e,t){var n=0;t=Z(e.doc,t);e.options.lineWrapping||(n=Je(e.display)*t.ch);var i=Di(e.doc,t.line),r=Li(i)+ke(e.display);return{left:n,right:n,top:r,bottom:r+i.height}}function Ye(e,t,n,i){var r=va(e,t);return r.xRel=i,n&&(r.outside=!0),r}function Ke(e,t,n){var i=e.doc;if((n+=e.display.viewOffset)<0)return Ye(i.first,0,!0,-1);var r=Pi(i,n),a=i.first+i.size-1;if(r>a)return Ye(i.first+i.size-1,Di(i,a).text.length,!0,1);t<0&&(t=0);for(var o=Di(i,r);;){var s=Xe(e,o,r,t,n),l=Xn(o),d=l&&l.find(0,!0);if(!l||!(s.ch>d.from.ch||s.ch==d.from.ch&&s.xRel>0))return s;r=Oi(o=d.to.line)}}function Xe(e,t,n,i,r){function a(i){var r=Ge(e,va(n,i),"line",t,d);return s=!0,o>r.bottom?r.left-l:o<r.top?r.left+l:(s=!1,r.left)}var o=r-Li(t),s=!1,l=2*e.display.wrapper.clientWidth,d=Oe(e,t),c=Fi(t),u=t.text.length,f=Br(t),h=Ur(t),p=a(f),g=s,m=a(h),v=s;if(i>m)return Ye(n,h,v,1);for(;;){if(c?h==f||h==Wr(t,f,1):h-f<=1){for(var y=i<p||i-p<=m-i?f:h,_=i-(y==f?p:m);_r(t.text.charAt(y));)++y;return Ye(n,y,y==f?g:v,_<-1?-1:_>1?1:0)}var b=Math.ceil(u/2),E=f+b;if(c){E=f;for(var w=0;w<b;++w)E=Wr(t,E,1)}var T=a(E);T>i?(h=E,m=T,(v=s)&&(m+=1e3),u=b):(f=E,p=T,g=s,u-=b)}}function Qe(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==_a){_a=br("pre");for(var t=0;t<49;++t)_a.appendChild(document.createTextNode("x")),_a.appendChild(br("br"));_a.appendChild(document.createTextNode("x"))}wr(e.measure,_a);var n=_a.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Er(e.measure),n||1}function Je(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=br("span","xxxxxxxxxx"),n=br("pre",[t]);wr(e.measure,n);var i=t.getBoundingClientRect(),r=(i.right-i.left)/10;return r>2&&(e.cachedCharWidth=r),r||10}function Ze(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:++Sa},Ta?Ta.ops.push(e.curOp):e.curOp.ownsGroup=Ta={ops:[e.curOp],delayedCallbacks:[]}}function et(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n]();for(var i=0;i<e.ops.length;i++){var r=e.ops[i];if(r.cursorActivityHandlers)for(;r.cursorActivityCalled<r.cursorActivityHandlers.length;)r.cursorActivityHandlers[r.cursorActivityCalled++](r.cm)}}while(n<t.length)}function tt(e){var t=e.curOp.ownsGroup;if(t)try{et(t)}finally{Ta=null;for(var n=0;n<t.ops.length;n++)t.ops[n].cm.curOp=null;nt(t)}}function nt(e){for(var t=e.ops,n=0;n<t.length;n++)it(t[n]);for(n=0;n<t.length;n++)rt(t[n]);for(n=0;n<t.length;n++)at(t[n]);for(n=0;n<t.length;n++)ot(t[n]);for(n=0;n<t.length;n++)st(t[n])}function it(e){var t=e.cm,n=t.display;e.updateMaxLine&&h(t),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new T(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function rt(e){e.updatedDisplay=e.mustUpdate&&S(e.cm,e.update)}function at(e){var t=e.cm,n=t.display;e.updatedDisplay&&x(t),e.barMeasure=m(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Me(t,n.maxLine,n.maxLine.text.length).left+3,e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo+ho-n.scroller.clientWidth)),(e.updatedDisplay||e.selectionChanged)&&(e.newSelectionNodes=me(t))}function ot(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Ht(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1),e.newSelectionNodes&&ve(t,e.newSelectionNodes),e.updatedDisplay&&I(t,e.barMeasure),(e.updatedDisplay||e.startHeight!=t.doc.height)&&v(t,e.barMeasure),e.selectionChanged&&Ee(t),t.state.focused&&e.updateInput&&St(t,e.typing)}function st(e){var t=e.cm,n=t.display,i=t.doc;if(null!=e.adjustWidthTo&&Math.abs(e.barMeasure.scrollWidth-t.display.scroller.scrollWidth)>1&&v(t),e.updatedDisplay&&C(t,e.update),null!=n.wheelStartX&&(null!=e.scrollTop||null!=e.scrollLeft||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),null!=e.scrollTop&&(n.scroller.scrollTop!=e.scrollTop||e.forceScroll)){var r=Math.max(0,Math.min(n.scroller.scrollHeight-n.scroller.clientHeight,e.scrollTop));n.scroller.scrollTop=n.scrollbarV.scrollTop=i.scrollTop=r}if(null!=e.scrollLeft&&(n.scroller.scrollLeft!=e.scrollLeft||e.forceScroll)){var a=Math.max(0,Math.min(n.scroller.scrollWidth-n.scroller.clientWidth,e.scrollLeft));n.scroller.scrollLeft=n.scrollbarH.scrollLeft=i.scrollLeft=a,_(t)}if(e.scrollToPos){var o=gn(t,Z(i,e.scrollToPos.from),Z(i,e.scrollToPos.to),e.scrollToPos.margin);e.scrollToPos.isCursor&&t.state.focused&&pn(t,o)}var s=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(s)for(var d=0;d<s.length;++d)s[d].lines.length||uo(s[d],"hide");if(l)for(d=0;d<l.length;++d)l[d].lines.length&&uo(l[d],"unhide");n.wrapper.offsetHeight&&(i.scrollTop=t.display.scroller.scrollTop),e.updatedDisplay&&ea&&(t.options.lineWrapping&&A(t,e.barMeasure),e.barMeasure.scrollWidth>e.barMeasure.clientWidth&&e.barMeasure.scrollWidth<e.barMeasure.clientWidth+1&&!g(t)&&v(t)),e.changeObjs&&uo(t,"changes",t,e.changeObjs)}function lt(e,t){if(e.curOp)return t();Ze(e);try{return t()}finally{tt(e)}}function dt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ze(e);try{return t.apply(e,arguments)}finally{tt(e)}}}function ct(e){return function(){if(this.curOp)return e.apply(this,arguments);Ze(this);try{return e.apply(this,arguments)}finally{tt(this)}}}function ut(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ze(t);try{return e.apply(this,arguments)}finally{tt(t)}}}function ft(e,t,n){this.line=t,this.rest=Zn(t),this.size=this.rest?Oi(ur(this.rest))-n+1:1,this.node=this.text=null,this.hidden=ni(e,t)}function ht(e,t,n){for(var i,r=[],a=t;a<n;a=i){var o=new ft(e.doc,Di(e.doc,a),a);i=a+o.size,r.push(o)}return r}function pt(e,t,n,i){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),i||(i=0);var r=e.display;if(i&&n<r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>t)&&(r.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=r.viewTo)ma&&ei(e.doc,t)<r.viewTo&&mt(e);else if(n<=r.viewFrom)ma&&ti(e.doc,n+i)>r.viewFrom?mt(e):(r.viewFrom+=i,r.viewTo+=i);else if(t<=r.viewFrom&&n>=r.viewTo)mt(e);else if(t<=r.viewFrom){(a=yt(e,n,n+i,1))?(r.view=r.view.slice(a.index),r.viewFrom=a.lineN,r.viewTo+=i):mt(e)}else if(n>=r.viewTo){var a;(a=yt(e,t,t,-1))?(r.view=r.view.slice(0,a.index),r.viewTo=a.lineN):mt(e)}else{var o=yt(e,t,t,-1),s=yt(e,n,n+i,1);o&&s?(r.view=r.view.slice(0,o.index).concat(ht(e,o.lineN,s.lineN)).concat(r.view.slice(s.index)),r.viewTo+=i):mt(e)}var l=r.externalMeasured;l&&(n<l.lineN?l.lineN+=i:t<l.lineN+l.size&&(r.externalMeasured=null))}function gt(e,t,n){e.curOp.viewChanged=!0;var i=e.display,r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size&&(i.externalMeasured=null),!(t<i.viewFrom||t>=i.viewTo)){var a=i.view[vt(e,t)];if(null!=a.node){var o=a.changes||(a.changes=[]);-1==fr(o,n)&&o.push(n)}}}function mt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vt(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,i=0;i<n.length;i++)if((t-=n[i].size)<0)return i}function yt(e,t,n,i){var r,a=vt(e,t),o=e.display.view;if(!ma||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(var s=0,l=e.display.viewFrom;s<a;s++)l+=o[s].size;if(l!=t){if(i>0){if(a==o.length-1)return null;r=l+o[a].size-t,a++}else r=l-t;t+=r,n+=r}for(;ei(e.doc,n)!=n;){if(a==(i<0?0:o.length-1))return null;n+=i*o[a-(i<0?1:0)].size,a+=i}return{index:a,lineN:n}}function _t(e,t,n){var i=e.display;0==i.view.length||t>=i.viewTo||n<=i.viewFrom?(i.view=ht(e,t,n),i.viewFrom=t):(i.viewFrom>t?i.view=ht(e,t,i.viewFrom).concat(i.view):i.viewFrom<t&&(i.view=i.view.slice(vt(e,t))),i.viewFrom=t,i.viewTo<n?i.view=i.view.concat(ht(e,i.viewTo,n)):i.viewTo>n&&(i.view=i.view.slice(0,vt(e,n)))),i.viewTo=n}function bt(e){for(var t=e.display.view,n=0,i=0;i<t.length;i++){var r=t[i];!r.hidden&&(!r.node||r.changes)&&++n}return n}function Et(e){e.display.pollingFast||e.display.poll.set(e.options.pollInterval,(function(){Tt(e),e.state.focused&&Et(e)}))}function wt(e){function t(){Tt(e)||n?(e.display.pollingFast=!1,Et(e)):(n=!0,e.display.poll.set(60,t))}var n=!1;e.display.pollingFast=!0,e.display.poll.set(20,t)}function Tt(e){var t=e.display.input,n=e.display.prevInput,i=e.doc;if(!e.state.focused||Ro(t)&&!n||It(e)||e.options.disableInput)return!1;e.state.pasteIncoming&&e.state.fakedLastChar&&(t.value=t.value.substring(0,t.value.length-1),e.state.fakedLastChar=!1);var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(Jr&&Zr>=9&&e.display.inputHasSelection===r||ca&&/[\uf700-\uf7ff]/.test(r))return St(e),!1;var a=!e.curOp;a&&Ze(e),e.display.shift=!1,8203==r.charCodeAt(0)&&i.sel==e.display.selForContextMenu&&!n&&(n="\u200b");for(var o=0,s=Math.min(n.length,r.length);o<s&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var l=r.slice(o),d=Do(l),c=null;e.state.pasteIncoming&&i.sel.ranges.length>1&&(Ca&&Ca.join("\n")==l?c=i.sel.ranges.length%Ca.length==0&&hr(Ca,Do):d.length==i.sel.ranges.length&&(c=hr(d,(function(e){return[e]}))));for(var u=i.sel.ranges.length-1;u>=0;u--){var f=i.sel.ranges[u],h=f.from(),p=f.to();o<n.length?h=va(h.line,h.ch-(n.length-o)):e.state.overwrite&&f.empty()&&!e.state.pasteIncoming&&(p=va(p.line,Math.min(Di(i,p.line).text.length,p.ch+ur(d).length)));var g=e.curOp.updateInput,m={from:h,to:p,text:c?c[u%c.length]:d,origin:e.state.pasteIncoming?"paste":e.state.cutIncoming?"cut":"+input"};if(sn(e.doc,m),nr(e,"inputRead",e,m),l&&!e.state.pasteIncoming&&e.options.electricChars&&e.options.smartIndent&&f.head.ch<100&&(!u||i.sel.ranges[u-1].head.line!=f.head.line)){var v=e.getModeAt(f.head),y=Ra(m);if(v.electricChars){for(var _=0;_<v.electricChars.length;_++)if(l.indexOf(v.electricChars.charAt(_))>-1){En(e,y.line,"smart");break}}else v.electricInput&&v.electricInput.test(Di(i,y.line).text.slice(0,y.ch))&&En(e,y.line,"smart")}}return _n(e),e.curOp.updateInput=g,e.curOp.typing=!0,r.length>1e3||r.indexOf("\n")>-1?t.value=e.display.prevInput="":e.display.prevInput=r,a&&tt(e),e.state.pasteIncoming=e.state.cutIncoming=!1,!0}function St(e,t){var n,i,r=e.doc;if(e.somethingSelected()){e.display.prevInput="";var a=r.sel.primary(),o=(n=Mo&&(a.to().line-a.from().line>100||(i=e.getSelection()).length>1e3))?"-":i||e.getSelection();e.display.input.value=o,e.state.focused&&bo(e.display.input),Jr&&Zr>=9&&(e.display.inputHasSelection=o)}else t||(e.display.prevInput=e.display.input.value="",Jr&&Zr>=9&&(e.display.inputHasSelection=null));e.display.inaccurateSelection=n}function Ct(e){"nocursor"!=e.options.readOnly&&(!da||Sr()!=e.display.input)&&e.display.input.focus()}function kt(e){e.state.focused||(Ct(e),Qt(e))}function It(e){return e.options.readOnly||e.doc.cantEdit}function At(e){function t(){e.state.focused&&setTimeout(mr(Ct,e),0)}function n(t){rr(e,t)||so(t)}function i(t){if(e.somethingSelected())Ca=e.getSelections(),r.inaccurateSelection&&(r.prevInput="",r.inaccurateSelection=!1,r.input.value=Ca.join("\n"),bo(r.input));else{for(var n=[],i=[],a=0;a<e.doc.sel.ranges.length;a++){var o=e.doc.sel.ranges[a].head.line,s={anchor:va(o,0),head:va(o+1,0)};i.push(s),n.push(e.getRange(s.anchor,s.head))}"cut"==t.type?e.setSelections(i,null,go):(r.prevInput="",r.input.value=n.join("\n"),bo(r.input)),Ca=n}"cut"==t.type&&(e.state.cutIncoming=!0)}var r=e.display;lo(r.scroller,"mousedown",dt(e,Mt)),lo(r.scroller,"dblclick",Jr&&Zr<11?dt(e,(function(t){if(!rr(e,t)){var n=Rt(e,t);if(n&&!Ft(e,t)&&!Dt(e.display,t)){ao(t);var i=e.findWordAt(n);re(e.doc,i.anchor,i.head)}}})):function(t){rr(e,t)||ao(t)}),lo(r.lineSpace,"selectstart",(function(e){Dt(r,e)||ao(e)})),pa||lo(r.scroller,"contextmenu",(function(t){Zt(e,t)})),lo(r.scroller,"scroll",(function(){r.scroller.clientHeight&&(Ut(e,r.scroller.scrollTop),Ht(e,r.scroller.scrollLeft,!0),uo(e,"scroll",e))})),lo(r.scrollbarV,"scroll",(function(){r.scroller.clientHeight&&Ut(e,r.scrollbarV.scrollTop)})),lo(r.scrollbarH,"scroll",(function(){r.scroller.clientHeight&&Ht(e,r.scrollbarH.scrollLeft)})),lo(r.scroller,"mousewheel",(function(t){$t(e,t)})),lo(r.scroller,"DOMMouseScroll",(function(t){$t(e,t)})),lo(r.scrollbarH,"mousedown",t),lo(r.scrollbarV,"mousedown",t),lo(r.wrapper,"scroll",(function(){r.wrapper.scrollTop=r.wrapper.scrollLeft=0})),lo(r.input,"keyup",(function(t){Kt.call(e,t)})),lo(r.input,"input",(function(){Jr&&Zr>=9&&e.display.inputHasSelection&&(e.display.inputHasSelection=null),wt(e)})),lo(r.input,"keydown",dt(e,Wt)),lo(r.input,"keypress",dt(e,Xt)),lo(r.input,"focus",mr(Qt,e)),lo(r.input,"blur",mr(Jt,e)),e.options.dragDrop&&(lo(r.scroller,"dragstart",(function(t){Bt(e,t)})),lo(r.scroller,"dragenter",n),lo(r.scroller,"dragover",n),lo(r.scroller,"drop",dt(e,jt))),lo(r.scroller,"paste",(function(t){Dt(r,t)||(e.state.pasteIncoming=!0,Ct(e),wt(e))})),lo(r.input,"paste",(function(){if(ea&&!e.state.fakedLastChar&&!(new Date-e.state.lastMiddleDown<200)){var t=r.input.selectionStart,n=r.input.selectionEnd;r.input.value+="$",r.input.selectionEnd=n,r.input.selectionStart=t,e.state.fakedLastChar=!0}e.state.pasteIncoming=!0,wt(e)})),lo(r.input,"cut",i),lo(r.input,"copy",i),aa&&lo(r.sizer,"mouseup",(function(){Sr()==r.input&&r.input.blur(),Ct(e)}))}function xt(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,e.setSize()}function Dt(e,t){for(var n=er(t);n!=e.wrapper;n=n.parentNode)if(!n||n.ignoreEvents||n.parentNode==e.sizer&&n!=e.mover)return!0}function Rt(e,t,n,i){var r=e.display;if(!n){var a=er(t);if(a==r.scrollbarH||a==r.scrollbarV||a==r.scrollbarFiller||a==r.gutterFiller)return null}var o,s,l=r.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,s=t.clientY-l.top}catch(t){return null}var d,c=Ke(e,o,s);if(i&&1==c.xRel&&(d=Di(e.doc,c.line).text).length==c.ch){var u=yo(d,d.length,e.options.tabSize)-d.length;c=va(c.line,Math.max(0,Math.round((o-Ae(e.display).left)/Je(e.display))-u))}return c}function Mt(e){if(!rr(this,e)){var t=this,n=t.display;if(n.shift=e.shiftKey,Dt(n,e))ea||(n.scroller.draggable=!1,setTimeout((function(){n.scroller.draggable=!0}),100));else if(!Ft(t,e)){var i=Rt(t,e);switch(window.focus(),tr(e)){case 1:i?Nt(t,e,i):er(e)==n.scroller&&ao(e);break;case 2:ea&&(t.state.lastMiddleDown=+new Date),i&&re(t.doc,i),setTimeout(mr(Ct,t),20),ao(e);break;case 3:pa&&Zt(t,e)}}}}function Nt(e,t,n){setTimeout(mr(kt,e),0);var i,r=+new Date;Ea&&Ea.time>r-400&&0==ya(Ea.pos,n)?i="triple":ba&&ba.time>r-400&&0==ya(ba.pos,n)?(i="double",Ea={time:r,pos:n}):(i="single",ba={time:r,pos:n});var a=e.doc.sel,o=ca?t.metaKey:t.ctrlKey;e.options.dragDrop&&xo&&!It(e)&&"single"==i&&a.contains(n)>-1&&a.somethingSelected()?Ot(e,t,n,o):Pt(e,t,n,i,o)}function Ot(e,t,n,i){var r=e.display,a=dt(e,(function(o){ea&&(r.scroller.draggable=!1),e.state.draggingText=!1,co(document,"mouseup",a),co(r.scroller,"drop",a),Math.abs(t.clientX-o.clientX)+Math.abs(t.clientY-o.clientY)<10&&(ao(o),i||re(e.doc,n),Ct(e),Jr&&9==Zr&&setTimeout((function(){document.body.focus(),Ct(e)}),20))}));ea&&(r.scroller.draggable=!0),e.state.draggingText=a,r.scroller.dragDrop&&r.scroller.dragDrop(),lo(document,"mouseup",a),lo(r.scroller,"drop",a)}function Pt(e,t,n,i,r){function a(t){if(0!=ya(g,t))if(g=t,"rect"==i){for(var r=[],a=e.options.tabSize,o=yo(Di(d,n.line).text,n.ch,a),s=yo(Di(d,t.line).text,t.ch,a),l=Math.min(o,s),h=Math.max(o,s),p=Math.min(n.line,t.line),m=Math.min(e.lastLine(),Math.max(n.line,t.line));p<=m;p++){var v=Di(d,p).text,y=dr(v,l,a);l==h?r.push(new K(va(p,y),va(p,y))):v.length>y&&r.push(new K(va(p,y),va(p,dr(v,h,a))))}r.length||r.push(new K(n,n)),ce(d,X(f.ranges.slice(0,u).concat(r),u),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var _=c,b=_.anchor,E=t;if("single"!=i){if("double"==i)var w=e.findWordAt(t);else w=new K(va(t.line,0),Z(d,va(t.line+1,0)));ya(w.anchor,b)>0?(E=w.head,b=W(_.from(),w.anchor)):(E=w.anchor,b=G(_.to(),w.head))}(r=f.ranges.slice(0))[u]=new K(Z(d,b),E),ce(d,X(r,u),mo)}}function o(t){var n=++v,r=Rt(e,t,!0,"rect"==i);if(r)if(0!=ya(r,g)){kt(e),a(r);var s=y(l,d);(r.line>=s.to||r.line<s.from)&&setTimeout(dt(e,(function(){v==n&&o(t)})),150)}else{var c=t.clientY<m.top?-20:t.clientY>m.bottom?20:0;c&&setTimeout(dt(e,(function(){v==n&&(l.scroller.scrollTop+=c,o(t))})),50)}}function s(t){v=1/0,ao(t),Ct(e),co(document,"mousemove",_),co(document,"mouseup",b),d.history.lastSelOrigin=null}var l=e.display,d=e.doc;ao(t);var c,u,f=d.sel;if(r&&!t.shiftKey?(u=d.sel.contains(n),c=u>-1?d.sel.ranges[u]:new K(n,n)):c=d.sel.primary(),t.altKey)i="rect",r||(c=new K(n,n)),n=Rt(e,t,!0,!0),u=-1;else if("double"==i){var h=e.findWordAt(n);c=e.display.shift||d.extend?ie(d,c,h.anchor,h.head):h}else if("triple"==i){var p=new K(va(n.line,0),Z(d,va(n.line+1,0)));c=e.display.shift||d.extend?ie(d,c,p.anchor,p.head):p}else c=ie(d,c,n);r?u>-1?oe(d,u,c,mo):(u=d.sel.ranges.length,ce(d,X(d.sel.ranges.concat([c]),u),{scroll:!1,origin:"*mouse"})):(u=0,ce(d,new Y([c],0),mo),f=d.sel);var g=n,m=l.wrapper.getBoundingClientRect(),v=0,_=dt(e,(function(e){tr(e)?o(e):s(e)})),b=dt(e,s);lo(document,"mousemove",_),lo(document,"mouseup",b)}function Lt(e,t,n,i,r){try{var a=t.clientX,o=t.clientY}catch(t){return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&ao(t);var s=e.display,l=s.lineDiv.getBoundingClientRect();if(o>l.bottom||!or(e,n))return Zi(t);o-=l.top-s.viewOffset;for(var d=0;d<e.options.gutters.length;++d){var c=s.gutters.childNodes[d];if(c&&c.getBoundingClientRect().right>=a)return r(e,n,e,Pi(e.doc,o),e.options.gutters[d],t),Zi(t)}}function Ft(e,t){return Lt(e,t,"gutterClick",!0,nr)}function jt(e){var t=this
;if(!rr(t,e)&&!Dt(t.display,e)){ao(e),Jr&&(ka=+new Date);var n=Rt(t,e,!0),i=e.dataTransfer.files;if(n&&!It(t))if(i&&i.length&&window.FileReader&&window.File)for(var r=i.length,a=Array(r),o=0,s=function(e,i){var s=new FileReader;s.onload=dt(t,(function(){if(a[i]=s.result,++o==r){var e={from:n=Z(t.doc,n),to:n,text:Do(a.join("\n")),origin:"paste"};sn(t.doc,e),de(t.doc,Q(n,Ra(e)))}})),s.readAsText(e)},l=0;l<r;++l)s(i[l],l);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(mr(Ct,t),20);try{if(a=e.dataTransfer.getData("Text")){if(t.state.draggingText&&(ca?!e.metaKey:!e.ctrlKey))var d=t.listSelections();if(ue(t.doc,Q(n,n)),d)for(l=0;l<d.length;++l)hn(t.doc,"",d[l].anchor,d[l].head,"drag");t.replaceSelection(a,"around","paste"),Ct(t)}}catch(e){}}}}function Bt(e,t){if(Jr&&(!e.state.draggingText||+new Date-ka<100))so(t);else if(!rr(e,t)&&!Dt(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.setDragImage&&!ra)){var n=br("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ia&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),ia&&n.parentNode.removeChild(n)}}function Ut(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Kr||k(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbarV.scrollTop!=t&&(e.display.scrollbarV.scrollTop=t),Kr&&k(e),we(e,100))}function Ht(e,t,n){(n?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,_(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbarH.scrollLeft!=t&&(e.display.scrollbarH.scrollLeft=t))}function $t(e,t){var n=t.wheelDeltaX,i=t.wheelDeltaY;null==n&&t.detail&&t.axis==t.HORIZONTAL_AXIS&&(n=t.detail),null==i&&t.detail&&t.axis==t.VERTICAL_AXIS?i=t.detail:null==i&&(i=t.wheelDelta);var r=e.display,a=r.scroller;if(n&&a.scrollWidth>a.clientWidth||i&&a.scrollHeight>a.clientHeight){if(i&&ca&&ea)e:for(var o=t.target,s=r.view;o!=a;o=o.parentNode)for(var l=0;l<s.length;l++)if(s[l].node==o){e.display.currentWheelTarget=o;break e}if(n&&!Kr&&!ia&&null!=Aa)return i&&Ut(e,Math.max(0,Math.min(a.scrollTop+i*Aa,a.scrollHeight-a.clientHeight))),Ht(e,Math.max(0,Math.min(a.scrollLeft+n*Aa,a.scrollWidth-a.clientWidth))),ao(t),void(r.wheelStartX=null);if(i&&null!=Aa){var d=i*Aa,c=e.doc.scrollTop,u=c+r.wrapper.clientHeight;d<0?c=Math.max(0,c+d-50):u=Math.min(e.doc.height,u+d+50),k(e,{top:c,bottom:u})}Ia<20&&(null==r.wheelStartX?(r.wheelStartX=a.scrollLeft,r.wheelStartY=a.scrollTop,r.wheelDX=n,r.wheelDY=i,setTimeout((function(){if(null!=r.wheelStartX){var e=a.scrollLeft-r.wheelStartX,t=a.scrollTop-r.wheelStartY,n=t&&r.wheelDY&&t/r.wheelDY||e&&r.wheelDX&&e/r.wheelDX;r.wheelStartX=r.wheelStartY=null,n&&(Aa=(Aa*Ia+n)/(Ia+1),++Ia)}}),200)):(r.wheelDX+=n,r.wheelDY+=i))}}function qt(e,t,n){if("string"==typeof t&&!(t=$a[t]))return!1;e.display.pollingFast&&Tt(e)&&(e.display.pollingFast=!1);var i=e.display.shift,r=!1;try{It(e)&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),r=t(e)!=po}finally{e.display.shift=i,e.state.suppressEdits=!1}return r}function zt(e){var t=e.state.keyMaps.slice(0);return e.options.extraKeys&&t.push(e.options.extraKeys),t.push(e.options.keyMap),t}function Vt(e,t){var n=In(e.options.keyMap),i=n.auto;clearTimeout(xa),i&&!Va(t)&&(xa=setTimeout((function(){In(e.options.keyMap)==n&&(e.options.keyMap=i.call?i.call(null,e):i,s(e))}),50));var r=Ga(t,!0),a=!1;if(!r)return!1;var o=zt(e);return(a=t.shiftKey?za("Shift-"+r,o,(function(t){return qt(e,t,!0)}))||za(r,o,(function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return qt(e,t)})):za(r,o,(function(t){return qt(e,t)})))&&(ao(t),Ee(e),nr(e,"keyHandled",e,r,t)),a}function Gt(e,t,n){var i=za("'"+n+"'",zt(e),(function(t){return qt(e,t,!0)}));return i&&(ao(t),Ee(e),nr(e,"keyHandled",e,"'"+n+"'",t)),i}function Wt(e){var t=this;if(kt(t),!rr(t,e)){Jr&&Zr<11&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var i=Vt(t,e);ia&&(Da=i?n:null,!i&&88==n&&!Mo&&(ca?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18==n&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Yt(t)}}function Yt(e){function t(e){18!=e.keyCode&&e.altKey||(kr(n,"CodeMirror-crosshair"),co(document,"keyup",t),co(document,"mouseover",t))}var n=e.display.lineDiv;Ir(n,"CodeMirror-crosshair"),lo(document,"keyup",t),lo(document,"mouseover",t)}function Kt(e){16==e.keyCode&&(this.doc.sel.shift=!1),rr(this,e)}function Xt(e){var t=this;if(!(rr(t,e)||e.ctrlKey&&!e.altKey||ca&&e.metaKey)){var n=e.keyCode,i=e.charCode;if(ia&&n==Da)return Da=null,void ao(e);if(!(ia&&(!e.which||e.which<10)||aa)||!Vt(t,e))Gt(t,e,String.fromCharCode(null==i?n:i))||(Jr&&Zr>=9&&(t.display.inputHasSelection=null),wt(t))}}function Qt(e){"nocursor"!=e.options.readOnly&&(e.state.focused||(uo(e,"focus",e),e.state.focused=!0,Ir(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(St(e),ea&&setTimeout(mr(St,e,!0),0))),Et(e),Ee(e))}function Jt(e){e.state.focused&&(uo(e,"blur",e),e.state.focused=!1,kr(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150)}function Zt(e,t){function n(){if(null!=r.input.selectionStart){var t=e.somethingSelected(),n=r.input.value="\u200b"+(t?r.input.value:"");r.prevInput=t?"":"\u200b",r.input.selectionStart=1,r.input.selectionEnd=n.length,r.selForContextMenu=e.doc.sel}}function i(){if(r.inputDiv.style.position="relative",r.input.style.cssText=s,Jr&&Zr<9&&(r.scrollbarV.scrollTop=r.scroller.scrollTop=o),Et(e),null!=r.input.selectionStart){(!Jr||Jr&&Zr<9)&&n();var t=0,i=function(){r.selForContextMenu==e.doc.sel&&0==r.input.selectionStart?dt(e,$a.selectAll)(e):t++<10?r.detectingSelectAll=setTimeout(i,500):St(e)};r.detectingSelectAll=setTimeout(i,200)}}if(!rr(e,t,"contextmenu")){var r=e.display;if(!Dt(r,t)&&!en(e,t)){var a=Rt(e,t),o=r.scroller.scrollTop;if(a&&!ia){e.options.resetSelectionOnContextMenu&&-1==e.doc.sel.contains(a)&&dt(e,ce)(e.doc,Q(a),go);var s=r.input.style.cssText;if(r.inputDiv.style.position="absolute",r.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(t.clientY-5)+"px; left: "+(t.clientX-5)+"px; z-index: 1000; background: "+(Jr?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",ea)var l=window.scrollY;if(Ct(e),ea&&window.scrollTo(null,l),St(e),e.somethingSelected()||(r.input.value=r.prevInput=" "),r.selForContextMenu=e.doc.sel,clearTimeout(r.detectingSelectAll),Jr&&Zr>=9&&n(),pa){so(t);var d=function(){co(window,"mouseup",d),setTimeout(i,20)};lo(window,"mouseup",d)}else setTimeout(i,50)}}}}function en(e,t){return!!or(e,"gutterContextMenu")&&Lt(e,t,"gutterContextMenu",!1,uo)}function tn(e,t){if(ya(e,t.from)<0)return e;if(ya(e,t.to)<=0)return Ra(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Ra(t).ch-t.to.ch),va(n,i)}function nn(e,t){for(var n=[],i=0;i<e.sel.ranges.length;i++){var r=e.sel.ranges[i];n.push(new K(tn(r.anchor,t),tn(r.head,t)))}return X(n,e.sel.primIndex)}function rn(e,t,n){return e.line==t.line?va(n.line,e.ch-t.ch+n.ch):va(n.line+(e.line-t.line),e.ch)}function an(e,t,n){for(var i=[],r=va(e.first,0),a=r,o=0;o<t.length;o++){var s=t[o],l=rn(s.from,r,a),d=rn(Ra(s),r,a);if(r=s.to,a=d,"around"==n){var c=e.sel.ranges[o],u=ya(c.head,c.anchor)<0;i[o]=new K(u?d:l,u?l:d)}else i[o]=new K(l,l)}return new Y(i,e.sel.primIndex)}function on(e,t,n){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){this.canceled=!0}};return n&&(i.update=function(t,n,i,r){t&&(this.from=Z(e,t)),n&&(this.to=Z(e,n)),i&&(this.text=i),void 0!==r&&(this.origin=r)}),uo(e,"beforeChange",e,i),e.cm&&uo(e.cm,"beforeChange",e.cm,i),i.canceled?null:{from:i.from,to:i.to,text:i.text,origin:i.origin}}function sn(e,t,n){if(e.cm){if(!e.cm.curOp)return dt(e.cm,sn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!(or(e,"beforeChange")||e.cm&&or(e.cm,"beforeChange"))||(t=on(e,t,!0))){var i=ga&&!n&&$n(e,t.from,t.to);if(i)for(var r=i.length-1;r>=0;--r)ln(e,{from:i[r].from,to:i[r].to,text:r?[""]:t.text});else ln(e,t)}}function ln(e,t){if(1!=t.text.length||""!=t.text[0]||0!=ya(t.from,t.to)){var n=nn(e,t);$i(e,t,n,e.cm?e.cm.curOp.id:NaN),un(e,t,n,Bn(e,t));var i=[];Ai(e,(function(e,n){!n&&-1==fr(i,e.history)&&(Ji(e.history,t),i.push(e.history)),un(e,t,null,Bn(e,t))}))}}function dn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var i,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&&(i=o[l],n?!i.ranges||i.equals(e.sel):i.ranges);l++);if(l!=o.length){for(r.lastOrigin=r.lastSelOrigin=null;(i=o.pop()).ranges;){if(Vi(i,s),n&&!i.equals(e.sel))return void ce(e,i,{clearRedo:!1});a=i}var d=[];Vi(a,s),s.push({changes:d,generation:r.generation}),r.generation=i.generation||++r.maxGeneration;var c=or(e,"beforeChange")||e.cm&&or(e.cm,"beforeChange");for(l=i.changes.length-1;l>=0;--l){var u=i.changes[l];if(u.origin=t,c&&!on(e,u,!1))return void(o.length=0);d.push(Bi(e,u));var f=l?nn(e,u):ur(o);un(e,u,f,Hn(e,u)),!l&&e.cm&&e.cm.scrollIntoView({from:u.from,to:Ra(u)});var h=[];Ai(e,(function(e,t){!t&&-1==fr(h,e.history)&&(Ji(e.history,u),h.push(e.history)),un(e,u,null,Hn(e,u))}))}}}}function cn(e,t){if(0!=t&&(e.first+=t,e.sel=new Y(hr(e.sel.ranges,(function(e){return new K(va(e.anchor.line+t,e.anchor.ch),va(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){pt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,i=n.viewFrom;i<n.viewTo;i++)gt(e.cm,i,"gutter")}}function un(e,t,n,i){if(e.cm&&!e.cm.curOp)return dt(e.cm,un)(e,t,n,i);if(t.to.line<e.first)cn(e,t.text.length-1-(t.to.line-t.from.line));else if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var r=t.text.length-1-(e.first-t.from.line);cn(e,r),t={from:va(e.first,0),to:va(t.to.line+r,t.to.ch),text:[ur(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:va(a,Di(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ri(e,t.from,t.to),n||(n=nn(e,t)),e.cm?fn(e.cm,t,i):Ci(e,t,i),ue(e,n,go)}}function fn(e,t,n){var i=e.doc,r=e.display,o=t.from,s=t.to,l=!1,d=o.line;e.options.lineWrapping||(d=Oi(Jn(Di(i,o.line))),i.iter(d,s.line+1,(function(e){if(e==r.maxLine)return l=!0,!0}))),i.sel.contains(t.from,t.to)>-1&&ar(e),Ci(i,t,n,a(e)),e.options.lineWrapping||(i.iter(d,o.line+t.text.length,(function(e){var t=f(e);t>r.maxLineLength&&(r.maxLine=e,r.maxLineLength=t,r.maxLineChanged=!0,l=!1)})),l&&(e.curOp.updateMaxLine=!0)),i.frontier=Math.min(i.frontier,o.line),we(e,400);var c=t.text.length-(s.line-o.line)-1;o.line!=s.line||1!=t.text.length||Si(e.doc,t)?pt(e,o.line,s.line+1,c):gt(e,o.line,"text");var u=or(e,"changes"),h=or(e,"change");if(h||u){var p={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};h&&nr(e,"change",e,p),u&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(p)}e.display.selForContextMenu=null}function hn(e,t,n,i,r){if(i||(i=n),ya(i,n)<0){var a=i;i=n,n=a}"string"==typeof t&&(t=Do(t)),sn(e,{from:n,to:i,text:t,origin:r})}function pn(e,t){var n=e.display,i=n.sizer.getBoundingClientRect(),r=null;if(t.top+i.top<0?r=!0:t.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null!=r&&!sa){var a=br("div","\u200b",null,"position: absolute; top: "+(t.top-n.viewOffset-ke(e.display))+"px; height: "+(t.bottom-t.top+ho)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(r),e.display.lineSpace.removeChild(a)}}function gn(e,t,n,i){null==i&&(i=0);for(var r=0;r<5;r++){var a=!1,o=Ge(e,t),s=n&&n!=t?Ge(e,n):o,l=vn(e,Math.min(o.left,s.left),Math.min(o.top,s.top)-i,Math.max(o.left,s.left),Math.max(o.bottom,s.bottom)+i),d=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=l.scrollTop&&(Ut(e,l.scrollTop),Math.abs(e.doc.scrollTop-d)>1&&(a=!0)),null!=l.scrollLeft&&(Ht(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(a=!0)),!a)return o}}function mn(e,t,n,i,r){var a=vn(e,t,n,i,r);null!=a.scrollTop&&Ut(e,a.scrollTop),null!=a.scrollLeft&&Ht(e,a.scrollLeft)}function vn(e,t,n,i,r){var a=e.display,o=Qe(e.display);n<0&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:a.scroller.scrollTop,l=a.scroller.clientHeight-ho,d={};r-n>l&&(r=n+l);var c=e.doc.height+Ie(a),u=n<o,f=r>c-o;if(n<s)d.scrollTop=u?0:n;else if(r>s+l){var h=Math.min(n,(f?c:r)-l);h!=s&&(d.scrollTop=h)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:a.scroller.scrollLeft,g=a.scroller.clientWidth-ho-a.gutters.offsetWidth,m=i-t>g;return m&&(i=t+g),t<10?d.scrollLeft=0:t<p?d.scrollLeft=Math.max(0,t-(m?0:10)):i>g+p-3&&(d.scrollLeft=i+(m?0:10)-g),d}function yn(e,t,n){(null!=t||null!=n)&&bn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function _n(e){bn(e);var t=e.getCursor(),n=t,i=t;e.options.lineWrapping||(n=t.ch?va(t.line,t.ch-1):t,i=va(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:i,margin:e.options.cursorScrollMargin,isCursor:!0}}function bn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=We(e,t.from),i=We(e,t.to),r=vn(e,Math.min(n.left,i.left),Math.min(n.top,i.top)-t.margin,Math.max(n.right,i.right),Math.max(n.bottom,i.bottom)+t.margin);e.scrollTo(r.scrollLeft,r.scrollTop)}}function En(e,t,n,i){var r,a=e.doc;null==n&&(n="add"),"smart"==n&&(a.mode.indent?r=Ce(e,t):n="prev");var o=e.options.tabSize,s=Di(a,t),l=yo(s.text,null,o);s.stateAfter&&(s.stateAfter=null);var d,c=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==n&&((d=a.mode.indent(r,s.text.slice(c.length),s.text))==po||d>150)){if(!i)return;n="prev"}}else d=0,n="not";"prev"==n?d=t>a.first?yo(Di(a,t-1).text,null,o):0:"add"==n?d=l+e.options.indentUnit:"subtract"==n?d=l-e.options.indentUnit:"number"==typeof n&&(d=l+n),d=Math.max(0,d);var u="",f=0;if(e.options.indentWithTabs)for(var h=Math.floor(d/o);h;--h)f+=o,u+="\t";if(f<d&&(u+=cr(d-f)),u!=c)hn(a,u,va(t,0),va(t,c.length),"+input");else for(h=0;h<a.sel.ranges.length;h++){var p=a.sel.ranges[h];if(p.head.line==t&&p.head.ch<c.length){oe(a,h,new K(f=va(t,c.length),f));break}}s.stateAfter=null}function wn(e,t,n,i){var r=t,a=t;return"number"==typeof t?a=Di(e,J(e,t)):r=Oi(t),null==r?null:(i(a,r)&&e.cm&&gt(e.cm,r,n),a)}function Tn(e,t){for(var n=e.doc.sel.ranges,i=[],r=0;r<n.length;r++){for(var a=t(n[r]);i.length&&ya(a.from,ur(i).to)<=0;){var o=i.pop();if(ya(o.from,a.from)<0){a.from=o.from;break}}i.push(a)}lt(e,(function(){for(var t=i.length-1;t>=0;t--)hn(e.doc,"",i[t].from,i[t].to,"+delete");_n(e)}))}function Sn(e,t,n,i,r){function a(){var t=s+n;return t<e.first||t>=e.first+e.size?u=!1:(s=t,c=Di(e,t))}function o(e){var t=(r?Wr:Yr)(c,l,n,!0);if(null==t){if(e||!a())return u=!1;l=r?(n<0?Ur:Br)(c):n<0?c.text.length:0}else l=t;return!0}var s=t.line,l=t.ch,d=n,c=Di(e,s),u=!0;if("char"==i)o();else if("column"==i)o(!0);else if("word"==i||"group"==i)for(var f=null,h="group"==i,p=e.cm&&e.cm.getHelper(t,"wordChars"),g=!0;!(n<0)||o(!g);g=!1){var m=c.text.charAt(l)||"\n",v=vr(m,p)?"w":h&&"\n"==m?"n":!h||/\s/.test(m)?null:"p";if(h&&!g&&!v&&(v="s"),f&&f!=v){n<0&&(n=1,o());break}if(v&&(f=v),n>0&&!o(!g))break}var y=ge(e,va(s,l),d,!0);return u||(y.hitSide=!0),y}function Cn(e,t,n,i){var r,a=e.doc,o=t.left;if("page"==i){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);r=t.top+n*(s-(n<0?1.5:.5)*Qe(e.display))}else"line"==i&&(r=n>0?t.bottom+3:t.top-3);for(;;){var l=Ke(e,o,r);if(!l.outside)break;if(n<0?r<=0:r>=a.height){l.hitSide=!0;break}r+=5*n}return l}function kn(t,n,i,r){e.defaults[t]=n,i&&(Na[t]=r?function(e,t,n){n!=Oa&&i(e,t,n)}:i)}function In(e){return"string"==typeof e?qa[e]:e}function An(e,t,n,i,r){if(i&&i.shared)return xn(e,t,n,i,r);if(e.cm&&!e.cm.curOp)return dt(e.cm,An)(e,t,n,i,r);var a=new Ya(e,r),o=ya(t,n);if(i&&gr(i,a,!1),o>0||0==o&&!1!==a.clearWhenEmpty)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=br("span",[a.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||(a.widgetNode.ignoreEvents=!0),i.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Qn(e,t.line,t,n,a)||t.line!=n.line&&Qn(e,n.line,t,n,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");ma=!0}a.addToHistory&&$i(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,d=e.cm;if(e.iter(l,n.line+1,(function(e){d&&a.collapsed&&!d.options.lineWrapping&&Jn(e)==d.display.maxLine&&(s=!0),a.collapsed&&l!=t.line&&Ni(e,0),Ln(e,new Nn(a,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l})),a.collapsed&&e.iter(t.line,n.line+1,(function(t){ni(e,t)&&Ni(t,0)})),a.clearOnEnter&&lo(a,"beforeCursorEnter",(function(){a.clear()})),a.readOnly&&(ga=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Ka,a.atomic=!0),d){if(s&&(d.curOp.updateMaxLine=!0),a.collapsed)pt(d,t.line,n.line+1);else if(a.className||a.title||a.startStyle||a.endStyle)for(var c=t.line;c<=n.line;c++)gt(d,c,"text");a.atomic&&he(d.doc),nr(d,"markerAdded",d,a)}return a}function xn(e,t,n,i,r){(i=gr(i)).shared=!1;var a=[An(e,t,n,i,r)],o=a[0],s=i.widgetNode;return Ai(e,(function(e){s&&(i.widgetNode=s.cloneNode(!0)),a.push(An(e,Z(e,t),Z(e,n),i,r));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;o=ur(a)})),new Xa(a,o)}function Dn(e){return e.findMarks(va(e.first,0),e.clipPos(va(e.lastLine())),(function(e){return e.parent}))}function Rn(e,t){for(var n=0;n<t.length;n++){var i=t[n],r=i.find(),a=e.clipPos(r.from),o=e.clipPos(r.to);if(ya(a,o)){var s=An(e,a,o,i.primary,i.primary.type);i.markers.push(s),s.parent=i}}}function Mn(e){for(var t=0;t<e.length;t++){var n=e[t],i=[n.primary.doc];Ai(n.primary.doc,(function(e){i.push(e)}));for(var r=0;r<n.markers.length;r++){var a=n.markers[r];-1==fr(i,a.doc)&&(a.parent=null,n.markers.splice(r--,1))}}}function Nn(e,t,n){this.marker=e,this.from=t,this.to=n}function On(e,t){if(e)for(var n=0;n<e.length;++n){var i=e[n];if(i.marker==t)return i}}function Pn(e,t){for(var n,i=0;i<e.length;++i)e[i]!=t&&(n||(n=[])).push(e[i]);return n}function Ln(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function Fn(e,t,n){if(e)for(var i,r=0;r<e.length;++r){var a=e[r],o=a.marker;if(null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t)||a.from==t&&"bookmark"==o.type&&(!n||!a.marker.insertLeft)){var s=null==a.to||(o.inclusiveRight?a.to>=t:a.to>t);(i||(i=[])).push(new Nn(o,a.from,s?null:a.to))}}return i}function jn(e,t,n){if(e)for(var i,r=0;r<e.length;++r){var a=e[r],o=a.marker;if(null==a.to||(o.inclusiveRight?a.to>=t:a.to>t)||a.from==t&&"bookmark"==o.type&&(!n||a.marker.insertLeft)){var s=null==a.from||(o.inclusiveLeft?a.from<=t:a.from<t);(i||(i=[])).push(new Nn(o,s?null:a.from-t,null==a.to?null:a.to-t))}}return i}function Bn(e,t){var n=te(e,t.from.line)&&Di(e,t.from.line).markedSpans,i=te(e,t.to.line)&&Di(e,t.to.line).markedSpans;if(!n&&!i)return null;var r=t.from.ch,a=t.to.ch,o=0==ya(t.from,t.to),s=Fn(n,r,o),l=jn(i,a,o),d=1==t.text.length,c=ur(t.text).length+(d?r:0);if(s)for(var u=0;u<s.length;++u){if(null==(f=s[u]).to)(h=On(l,f.marker))?d&&(f.to=null==h.to?null:h.to+c):f.to=r}if(l)for(u=0;u<l.length;++u){var f,h;if(null!=(f=l[u]).to&&(f.to+=c),null==f.from)(h=On(s,f.marker))||(f.from=c,d&&(s||(s=[])).push(f));else f.from+=c,d&&(s||(s=[])).push(f)}s&&(s=Un(s)),l&&l!=s&&(l=Un(l));var p=[s];if(!d){var g,m=t.text.length-2;if(m>0&&s)for(u=0;u<s.length;++u)null==s[u].to&&(g||(g=[])).push(new Nn(s[u].marker,null,null));for(u=0;u<m;++u)p.push(g);p.push(l)}return p}function Un(e){for(var t=0;t<e.length;++t){var n=e[t];null!=n.from&&n.from==n.to&&!1!==n.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Hn(e,t){var n=Yi(e,t),i=Bn(e,t);if(!n)return i;if(!i)return n;for(var r=0;r<n.length;++r){var a=n[r],o=i[r];if(a&&o)e:for(var s=0;s<o.length;++s){for(var l=o[s],d=0;d<a.length;++d)if(a[d].marker==l.marker)continue e;a.push(l)}else o&&(n[r]=o)}return n}function $n(e,t,n){var i=null;if(e.iter(t.line,n.line+1,(function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var n=e.markedSpans[t].marker;n.readOnly&&(!i||-1==fr(i,n))&&(i||(i=[])).push(n)}})),!i)return null;for(var r=[{from:t,to:n}],a=0;a<i.length;++a)for(var o=i[a],s=o.find(0),l=0;l<r.length;++l){var d=r[l];if(!(ya(d.to,s.from)<0||ya(d.from,s.to)>0)){var c=[l,1],u=ya(d.from,s.from),f=ya(d.to,s.to);(u<0||!o.inclusiveLeft&&!u)&&c.push({from:d.from,to:s.from}),(f>0||!o.inclusiveRight&&!f)&&c.push({from:s.to,to:d.to}),r.splice.apply(r,c),l+=c.length-1}}return r}function qn(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function zn(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Vn(e){return e.inclusiveLeft?-1:0}function Gn(e){return e.inclusiveRight?1:0}function Wn(e,t){var n=e.lines.length-t.lines.length;if(0!=n)return n;var i=e.find(),r=t.find(),a=ya(i.from,r.from)||Vn(e)-Vn(t);if(a)return-a;var o=ya(i.to,r.to)||Gn(e)-Gn(t);return o||t.id-e.id}function Yn(e,t){var n,i=ma&&e.markedSpans;if(i)for(var r,a=0;a<i.length;++a)(r=i[a]).marker.collapsed&&null==(t?r.from:r.to)&&(!n||Wn(n,r.marker)<0)&&(n=r.marker);return n}function Kn(e){return Yn(e,!0)}function Xn(e){return Yn(e,!1)}function Qn(e,t,n,i,r){var a=Di(e,t),o=ma&&a.markedSpans;if(o)for(var s=0;s<o.length;++s){var l=o[s];if(l.marker.collapsed){var d=l.marker.find(0),c=ya(d.from,n)||Vn(l.marker)-Vn(r),u=ya(d.to,i)||Gn(l.marker)-Gn(r);if(!(c>=0&&u<=0||c<=0&&u>=0)&&(c<=0&&(ya(d.to,n)>0||l.marker.inclusiveRight&&r.inclusiveLeft)||c>=0&&(ya(d.from,i)<0||l.marker.inclusiveLeft&&r.inclusiveRight)))return!0}}}function Jn(e){for(var t;t=Kn(e);)e=t.find(-1,!0).line;return e}function Zn(e){for(var t,n;t=Xn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ei(e,t){var n=Di(e,t),i=Jn(n);return n==i?t:Oi(i)}function ti(e,t){if(t>e.lastLine())return t;var n,i=Di(e,t);if(!ni(e,i))return t;for(;n=Xn(i);)i=n.find(1,!0).line;return Oi(i)+1}function ni(e,t){var n=ma&&t.markedSpans;if(n)for(var i,r=0;r<n.length;++r)if((i=n[r]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&ii(e,t,i))return!0}}function ii(e,t,n){if(null==n.to){var i=n.marker.find(1,!0);return ii(e,i.line,On(i.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var r,a=0;a<t.markedSpans.length;++a)if((r=t.markedSpans[a]).marker.collapsed&&!r.marker.widgetNode&&r.from==n.to&&(null==r.to||r.to!=n.from)&&(r.marker.inclusiveLeft||n.marker.inclusiveRight)&&ii(e,t,r))return!0}function ri(e,t,n){Li(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&yn(e,null,n)}function ai(e){if(null!=e.height)return e.height;if(!Tr(document.body,e.node)){var t="position: relative;";e.coverGutter&&(t+="margin-left: -"+e.cm.getGutterElement().offsetWidth+"px;"),wr(e.cm.display.measure,br("div",[e.node],null,t))}return e.height=e.node.offsetHeight}function oi(e,t,n,i){var r=new Qa(e,n,i);return r.noHScroll&&(e.display.alignWidgets=!0),wn(e.doc,t,"widget",(function(t){var n=t.widgets||(t.widgets=[]);if(null==r.insertAt?n.push(r):n.splice(Math.min(n.length-1,Math.max(0,r.insertAt)),0,r),r.line=t,!ni(e.doc,t)){var i=Li(t)<e.doc.scrollTop;Ni(t,t.height+ai(r)),i&&yn(e,null,r.height),e.curOp.forceUpdate=!0}return!0})),r}function si(e,t,n,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),qn(e),zn(e,n);var r=i?i(e):1;r!=e.height&&Ni(e,r)}function li(e){e.parent=null,qn(e)}function di(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var i=n[1]?"bgClass":"textClass";null==t[i]?t[i]=n[2]:new RegExp("(?:^|s)"+n[2]+"(?:$|s)").test(t[i])||(t[i]+=" "+n[2])}return e}function ci(t,n){if(t.blankLine)return t.blankLine(n);if(t.innerMode){var i=e.innerMode(t,n);return i.mode.blankLine?i.mode.blankLine(i.state):void 0}}function ui(e,t,n){for(var i=0;i<10;i++){var r=e.token(t,n);if(t.pos>t.start)return r}throw new Error("Mode "+e.name+" failed to advance stream.")}function fi(t,n,i,r,a,o,s){var l=i.flattenSpans;null==l&&(l=t.options.flattenSpans);var d,c=0,u=null,f=new Wa(n,t.options.tabSize);for(""==n&&di(ci(i,r),o);!f.eol();){if(f.pos>t.options.maxHighlightLength?(l=!1,s&&gi(t,n,r,f.pos),f.pos=n.length,d=null):d=di(ui(i,f,r),o),t.options.addModeClass){var h=e.innerMode(i,r).mode.name;h&&(d="m-"+(d?h+" "+d:h))}l&&u==d||(c<f.start&&a(f.start,u),c=f.start,u=d),f.start=f.pos}for(;c<f.pos;){var p=Math.min(f.pos,c+5e4);a(p,u),c=p}}function hi(e,t,n,i){var r=[e.state.modeGen],a={};fi(e,t.text,e.doc.mode,n,(function(e,t){r.push(e,t)}),a,i);for(var o=0;o<e.state.overlays.length;++o){var s=e.state.overlays[o],l=1,d=0;fi(e,t.text,s.mode,!0,(function(e,t){for(var n=l;d<e;){var i=r[l];i>e&&r.splice(l,1,e,r[l+1],i),l+=2,d=Math.min(e,i)}if(t)if(s.opaque)r.splice(n,l-n,e,"cm-overlay "+t),l=n+2;else for(;n<l;n+=2){var a=r[n+1];r[n+1]=(a?a+" ":"")+"cm-overlay "+t}}),a)}return{styles:r,classes:a.bgClass||a.textClass?a:null}}function pi(e,t){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=hi(e,t,t.stateAfter=Ce(e,Oi(t)));t.styles=n.styles,n.classes?t.styleClasses=n.classes:t.styleClasses&&(t.styleClasses=null)}return t.styles}function gi(e,t,n,i){var r=e.doc.mode,a=new Wa(t,e.options.tabSize);for(a.start=a.pos=i||0,""==t&&ci(r,n);!a.eol()&&a.pos<=e.options.maxHighlightLength;)ui(r,a,n),a.start=a.pos}function mi(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?eo:Za;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function vi(e,t){var n=br("span",null,null,ea?"padding-right: .1px":null),i={pre:br("pre",[n]),content:n,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;i.pos=0,i.addToken=_i,(Jr||ea)&&e.getOption("lineWrapping")&&(i.addToken=bi(i.addToken)),Or(e.display.measure)&&(a=Fi(o))&&(i.addToken=Ei(i.addToken,a)),i.map=[],Ti(o,i,pi(e,o)),o.styleClasses&&(o.styleClasses.bgClass&&(i.bgClass=Ar(o.styleClasses.bgClass,i.bgClass||"")),o.styleClasses.textClass&&(i.textClass=Ar(o.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Nr(e.display.measure))),0==r?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return uo(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=Ar(i.pre.className,i.textClass||"")),i}function yi(e){var t=br("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t}function _i(e,t,n,i,r,a){if(t){var o=e.cm.options.specialChars,s=!1;if(o.test(t)){p=document.createDocumentFragment();for(var l=0;;){o.lastIndex=l;var d=o.exec(t),c=d?d.index-l:t.length-l;if(c){var u=document.createTextNode(t.slice(l,l+c));Jr&&Zr<9?p.appendChild(br("span",[u])):p.appendChild(u),e.map.push(e.pos,e.pos+c,u),e.col+=c,e.pos+=c}if(!d)break;if(l+=c+1,"\t"==d[0]){var f=e.cm.options.tabSize,h=f-e.col%f;u=p.appendChild(br("span",cr(h),"cm-tab"));e.col+=h}else{u=e.cm.options.specialCharPlaceholder(d[0]);Jr&&Zr<9?p.appendChild(br("span",[u])):p.appendChild(u),e.col+=1}e.map.push(e.pos,e.pos+1,u),e.pos++}}else{e.col+=t.length;var p=document.createTextNode(t);e.map.push(e.pos,e.pos+t.length,p),Jr&&Zr<9&&(s=!0),e.pos+=t.length}if(n||i||r||s){var g=n||"";i&&(g+=i),r&&(g+=r);var m=br("span",[p],g);return a&&(m.title=a),e.content.appendChild(m)}e.content.appendChild(p)}}function bi(e){function t(e){for(var t=" ",n=0;n<e.length-2;++n)t+=n%2?" ":"\xa0";return t+=" "}return function(n,i,r,a,o,s){e(n,i.replace(/ {3,}/g,t),r,a,o,s)}}function Ei(e,t){return function(n,i,r,a,o,s){r=r?r+" cm-force-border":"cm-force-border";for(var l=n.pos,d=l+i.length;;){for(var c=0;c<t.length;c++){var u=t[c];if(u.to>l&&u.from<=l)break}if(u.to>=d)return e(n,i,r,a,o,s);e(n,i.slice(0,u.to-l),r,a,null,s),a=null,i=i.slice(u.to-l),l=u.to}}}function wi(e,t,n,i){var r=!i&&n.widgetNode;r&&(e.map.push(e.pos,e.pos+t,r),e.content.appendChild(r)),e.pos+=t}function Ti(e,t,n){var i=e.markedSpans,r=e.text,a=0;if(i)for(var o,s,l,d,c,u,f=r.length,h=0,p=(T=1,""),g=0;;){if(g==h){s=l=d=c="",u=null,g=1/0;for(var m=[],v=0;v<i.length;++v){var y=i[v],_=y.marker;y.from<=h&&(null==y.to||y.to>h)?(null!=y.to&&g>y.to&&(g=y.to,l=""),_.className&&(s+=" "+_.className),_.startStyle&&y.from==h&&(d+=" "+_.startStyle),_.endStyle&&y.to==g&&(l+=" "+_.endStyle),_.title&&!c&&(c=_.title),_.collapsed&&(!u||Wn(u.marker,_)<0)&&(u=y)):y.from>h&&g>y.from&&(g=y.from),"bookmark"==_.type&&y.from==h&&_.widgetNode&&m.push(_)}if(u&&(u.from||0)==h&&(wi(t,(null==u.to?f+1:u.to)-h,u.marker,null==u.from),null==u.to))return;if(!u&&m.length)for(v=0;v<m.length;++v)wi(t,0,m[v])}if(h>=f)break;for(var b=Math.min(f,g);;){if(p){var E=h+p.length;if(!u){var w=E>b?p.slice(0,b-h):p;t.addToken(t,w,o?o+s:s,d,h+w.length==g?l:"",c)}if(E>=b){p=p.slice(b-h),h=b;break}h=E,d=""}p=r.slice(a,a=n[T++]),o=mi(n[T++],t.cm.options)}}else for(var T=1;T<n.length;T+=2)t.addToken(t,r.slice(a,a=n[T]),mi(n[T+1],t.cm.options))}function Si(e,t){return 0==t.from.ch&&0==t.to.ch&&""==ur(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ci(e,t,n,i){function r(e){return n?n[e]:null}function a(e,n,r){si(e,n,r,i),nr(e,"change",e,t)}var o=t.from,s=t.to,l=t.text,d=Di(e,o.line),c=Di(e,s.line),u=ur(l),f=r(l.length-1),h=s.line-o.line;if(Si(e,t)){for(var p=0,g=[];p<l.length-1;++p)g.push(new Ja(l[p],r(p),i));a(c,c.text,f),h&&e.remove(o.line,h),g.length&&e.insert(o.line,g)}else if(d==c)if(1==l.length)a(d,d.text.slice(0,o.ch)+u+d.text.slice(s.ch),f);else{for(g=[],p=1;p<l.length-1;++p)g.push(new Ja(l[p],r(p),i));g.push(new Ja(u+d.text.slice(s.ch),f,i)),a(d,d.text.slice(0,o.ch)+l[0],r(0)),e.insert(o.line+1,g)}else if(1==l.length)a(d,d.text.slice(0,o.ch)+l[0]+c.text.slice(s.ch),r(0)),e.remove(o.line+1,h);else{a(d,d.text.slice(0,o.ch)+l[0],r(0)),a(c,u+c.text.slice(s.ch),f);for(p=1,g=[];p<l.length-1;++p)g.push(new Ja(l[p],r(p),i));h>1&&e.remove(o.line+1,h-1),e.insert(o.line+1,g)}nr(e,"change",e,t)}function ki(e){this.lines=e,this.parent=null;for(var t=0,n=0;t<e.length;++t)e[t].parent=this,n+=e[t].height;this.height=n}function Ii(e){this.children=e;for(var t=0,n=0,i=0;i<e.length;++i){var r=e[i];t+=r.chunkSize(),n+=r.height,r.parent=this}this.size=t,this.height=n,this.parent=null}function Ai(e,t,n){function i(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;n&&!l||(t(s.doc,l),i(s.doc,e,l))}}}i(e,null,!0)}function xi(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,o(e),n(e),e.options.lineWrapping||h(e),e.options.mode=t.modeOption,pt(e)}function Di(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 n=e;!n.lines;)for(var i=0;;++i){var r=n.children[i],a=r.chunkSize();if(t<a){n=r;break}t-=a}return n.lines[t]}function Ri(e,t,n){var i=[],r=t.line;return e.iter(t.line,n.line+1,(function(e){var a=e.text;r==n.line&&(a=a.slice(0,n.ch)),r==t.line&&(a=a.slice(t.ch)),i.push(a),++r})),i}function Mi(e,t,n){var i=[];return e.iter(t,n,(function(e){i.push(e.text)})),i}function Ni(e,t){var n=t-e.height;if(n)for(var i=e;i;i=i.parent)i.height+=n}function Oi(e){if(null==e.parent)return null;for(var t=e.parent,n=fr(t.lines,e),i=t.parent;i;t=i,i=i.parent)for(var r=0;i.children[r]!=t;++r)n+=i.children[r].chunkSize();return n+t.first}function Pi(e,t){var n=e.first;e:do{for(var i=0;i<e.children.length;++i){var r=e.children[i],a=r.height;if(t<a){e=r;continue e}t-=a,n+=r.chunkSize()}return n}while(!e.lines);for(i=0;i<e.lines.length;++i){var o=e.lines[i].height;if(t<o)break;t-=o}return n+i}function Li(e){for(var t=0,n=(e=Jn(e)).parent,i=0;i<n.lines.length;++i){var r=n.lines[i];if(r==e)break;t+=r.height}for(var a=n.parent;a;a=(n=a).parent)for(i=0;i<a.children.length;++i){var o=a.children[i];if(o==n)break;t+=o.height}return t}function Fi(e){var t=e.order;return null==t&&(t=e.order=Lo(e.text)),t}function ji(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 Bi(e,t){var n={from:V(t.from),to:Ra(t),text:Ri(e,t.from,t.to)};return Gi(e,n,t.from.line,t.to.line+1),Ai(e,(function(e){Gi(e,n,t.from.line,t.to.line+1)}),!0),n}function Ui(e){for(;e.length;){if(!ur(e).ranges)break;e.pop()}}function Hi(e,t){return t?(Ui(e.done),
ur(e.done)):e.done.length&&!ur(e.done).ranges?ur(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),ur(e.done)):void 0}function $i(e,t,n,i){var r=e.history;r.undone.length=0;var a,o=+new Date;if((r.lastOp==i||r.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&r.lastModTime>o-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(a=Hi(r,r.lastOp==i))){var s=ur(a.changes);0==ya(t.from,t.to)&&0==ya(t.from,s.to)?s.to=Ra(t):a.changes.push(Bi(e,t))}else{var l=ur(r.done);for((!l||!l.ranges)&&Vi(e.sel,r.done),a={changes:[Bi(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(n),r.generation=++r.maxGeneration,r.lastModTime=r.lastSelTime=o,r.lastOp=r.lastSelOp=i,r.lastOrigin=r.lastSelOrigin=t.origin,s||uo(e,"historyAdded")}function qi(e,t,n,i){var r=t.charAt(0);return"*"==r||"+"==r&&n.ranges.length==i.ranges.length&&n.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function zi(e,t,n,i){var r=e.history,a=i&&i.origin;n==r.lastSelOp||a&&r.lastSelOrigin==a&&(r.lastModTime==r.lastSelTime&&r.lastOrigin==a||qi(e,a,ur(r.done),t))?r.done[r.done.length-1]=t:Vi(t,r.done),r.lastSelTime=+new Date,r.lastSelOrigin=a,r.lastSelOp=n,i&&!1!==i.clearRedo&&Ui(r.undone)}function Vi(e,t){var n=ur(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Gi(e,t,n,i){var r=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,i),(function(n){n.markedSpans&&((r||(r=t["spans_"+e.id]={}))[a]=n.markedSpans),++a}))}function Wi(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function Yi(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var i=0,r=[];i<t.text.length;++i)r.push(Wi(n[i]));return r}function Ki(e,t,n){for(var i=0,r=[];i<e.length;++i){var a=e[i];if(a.ranges)r.push(n?Y.prototype.deepCopy.call(a):a);else{var o=a.changes,s=[];r.push({changes:s});for(var l=0;l<o.length;++l){var d,c=o[l];if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var u in c)(d=u.match(/^spans_(\d+)$/))&&fr(t,Number(d[1]))>-1&&(ur(s)[u]=c[u],delete c[u])}}}return r}function Xi(e,t,n,i){n<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function Qi(e,t,n,i){for(var r=0;r<e.length;++r){var a=e[r],o=!0;if(a.ranges){a.copied||((a=e[r]=a.deepCopy()).copied=!0);for(var s=0;s<a.ranges.length;s++)Xi(a.ranges[s].anchor,t,n,i),Xi(a.ranges[s].head,t,n,i)}else{for(s=0;s<a.changes.length;++s){var l=a.changes[s];if(n<l.from.line)l.from=va(l.from.line+i,l.from.ch),l.to=va(l.to.line+i,l.to.ch);else if(t<=l.to.line){o=!1;break}}o||(e.splice(0,r+1),r=0)}}}function Ji(e,t){var n=t.from.line,i=t.to.line,r=t.text.length-(i-n)-1;Qi(e.done,n,i,r),Qi(e.undone,n,i,r)}function Zi(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function er(e){return e.target||e.srcElement}function tr(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),ca&&e.ctrlKey&&1==t&&(t=3),t}function nr(e,t){function n(e){return function(){e.apply(null,a)}}var i=e._handlers&&e._handlers[t];if(i){var r,a=Array.prototype.slice.call(arguments,2);Ta?r=Ta.delayedCallbacks:fo?r=fo:(r=fo=[],setTimeout(ir,0));for(var o=0;o<i.length;++o)r.push(n(i[o]))}}function ir(){var e=fo;fo=null;for(var t=0;t<e.length;++t)e[t]()}function rr(e,t,n){return uo(e,n||t.type,e,t),Zi(t)||t.codemirrorIgnore}function ar(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==fr(n,t[i])&&n.push(t[i])}function or(e,t){var n=e._handlers&&e._handlers[t];return n&&n.length>0}function sr(e){e.prototype.on=function(e,t){lo(this,e,t)},e.prototype.off=function(e,t){co(this,e,t)}}function lr(){this.id=null}function dr(e,t,n){for(var i=0,r=0;;){var a=e.indexOf("\t",i);-1==a&&(a=e.length);var o=a-i;if(a==e.length||r+o>=t)return i+Math.min(o,t-r);if(r+=a-i,i=a+1,(r+=n-r%n)>=t)return i}}function cr(e){for(;_o.length<=e;)_o.push(ur(_o)+" ");return _o[e]}function ur(e){return e[e.length-1]}function fr(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}function hr(e,t){for(var n=[],i=0;i<e.length;i++)n[i]=t(e[i],i);return n}function pr(e,t){var n;if(Object.create)n=Object.create(e);else{var i=function(){};i.prototype=e,n=new i}return t&&gr(t,n),n}function gr(e,t,n){for(var i in t||(t={}),e)e.hasOwnProperty(i)&&(!1!==n||!t.hasOwnProperty(i))&&(t[i]=e[i]);return t}function mr(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function vr(e,t){return t?!!(t.source.indexOf("\\w")>-1&&To(e))||t.test(e):To(e)}function yr(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function _r(e){return e.charCodeAt(0)>=768&&So.test(e)}function br(e,t,n,i){var r=document.createElement(e);if(n&&(r.className=n),i&&(r.style.cssText=i),"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 Er(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function wr(e,t){return Er(e).appendChild(t)}function Tr(e,t){if(e.contains)return e.contains(t);for(;t=t.parentNode;)if(t==e)return!0}function Sr(){return document.activeElement}function Cr(e){return new RegExp("\\b"+e+"\\b\\s*")}function kr(e,t){var n=Cr(t);n.test(e.className)&&(e.className=e.className.replace(n,""))}function Ir(e,t){Cr(t).test(e.className)||(e.className+=" "+t)}function Ar(e,t){for(var n=e.split(" "),i=0;i<n.length;i++)n[i]&&!Cr(n[i]).test(t)&&(t+=" "+n[i]);return t}function xr(e){if(document.body.getElementsByClassName)for(var t=document.body.getElementsByClassName("CodeMirror"),n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&e(i)}}function Dr(){Ao||(Rr(),Ao=!0)}function Rr(){var e;lo(window,"resize",(function(){null==e&&(e=setTimeout((function(){e=null,Co=null,xr(xt)}),100))})),lo(window,"blur",(function(){xr(Jt)}))}function Mr(e){if(null!=Co)return Co;var t=br("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return wr(e,t),t.offsetWidth&&(Co=t.offsetHeight-t.clientHeight),Co||0}function Nr(e){if(null==ko){var t=br("span","\u200b");wr(e,br("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(ko=t.offsetWidth<=1&&t.offsetHeight>2&&!(Jr&&Zr<8))}return ko?br("span","\u200b"):br("span","\xa0",null,"display: inline-block; width: 1px; margin-right: -1px")}function Or(e){if(null!=Io)return Io;var t=wr(e,document.createTextNode("A\u062eA")),n=Eo(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var i=Eo(t,1,2).getBoundingClientRect();return Io=i.right-n.right<3}function Pr(e){if(null!=No)return No;var t=wr(e,br("span","x")),n=t.getBoundingClientRect(),i=Eo(t,0,1).getBoundingClientRect();return No=Math.abs(n.left-i.left)>1}function Lr(e,t,n,i){if(!e)return i(t,n,"ltr");for(var r=!1,a=0;a<e.length;++a){var o=e[a];(o.from<n&&o.to>t||t==n&&o.to==t)&&(i(Math.max(o.from,t),Math.min(o.to,n),1==o.level?"rtl":"ltr"),r=!0)}r||i(t,n,"ltr")}function Fr(e){return e.level%2?e.to:e.from}function jr(e){return e.level%2?e.from:e.to}function Br(e){var t=Fi(e);return t?Fr(t[0]):0}function Ur(e){var t=Fi(e);return t?jr(ur(t)):e.text.length}function Hr(e,t){var n=Di(e.doc,t),i=Jn(n);i!=n&&(t=Oi(i));var r=Fi(i),a=r?r[0].level%2?Ur(i):Br(i):0;return va(t,a)}function $r(e,t){for(var n,i=Di(e.doc,t);n=Xn(i);)i=n.find(1,!0).line,t=null;var r=Fi(i),a=r?r[0].level%2?Br(i):Ur(i):i.text.length;return va(null==t?Oi(i):t,a)}function qr(e,t){var n=Hr(e,t.line),i=Di(e.doc,n.line),r=Fi(i);if(!r||0==r[0].level){var a=Math.max(0,i.text.search(/\S/)),o=t.line==n.line&&t.ch<=a&&t.ch;return va(n.line,o?0:a)}return n}function zr(e,t,n){var i=e[0].level;return t==i||n!=i&&t<n}function Vr(e,t){Po=null;for(var n,i=0;i<e.length;++i){var r=e[i];if(r.from<t&&r.to>t)return i;if(r.from==t||r.to==t){if(null!=n)return zr(e,r.level,e[n].level)?(r.from!=r.to&&(Po=n),i):(r.from!=r.to&&(Po=i),n);n=i}}return n}function Gr(e,t,n,i){if(!i)return t+n;do{t+=n}while(t>0&&_r(e.text.charAt(t)));return t}function Wr(e,t,n,i){var r=Fi(e);if(!r)return Yr(e,t,n,i);for(var a=Vr(r,t),o=r[a],s=Gr(e,t,o.level%2?-n:n,i);;){if(s>o.from&&s<o.to)return s;if(s==o.from||s==o.to)return Vr(r,s)==a?s:n>0==(o=r[a+=n]).level%2?o.to:o.from;if(!(o=r[a+=n]))return null;s=n>0==o.level%2?Gr(e,o.to,-1,i):Gr(e,o.from,1,i)}}function Yr(e,t,n,i){var r=t+n;if(i)for(;r>0&&_r(e.text.charAt(r));)r+=n;return r<0||r>e.text.length?null:r}var Kr=/gecko\/\d/i.test(navigator.userAgent),Xr=/MSIE \d/.test(navigator.userAgent),Qr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Jr=Xr||Qr,Zr=Jr&&(Xr?document.documentMode||6:Qr[1]),ea=/WebKit\//.test(navigator.userAgent),ta=ea&&/Qt\/\d+\.\d+/.test(navigator.userAgent),na=/Chrome\//.test(navigator.userAgent),ia=/Opera\//.test(navigator.userAgent),ra=/Apple Computer/.test(navigator.vendor),aa=/KHTML\//.test(navigator.userAgent),oa=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),sa=/PhantomJS/.test(navigator.userAgent),la=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),da=la||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),ca=la||/Mac/.test(navigator.platform),ua=/win/i.test(navigator.platform),fa=ia&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);fa&&(fa=Number(fa[1])),fa&&fa>=15&&(ia=!1,ea=!0);var ha=ca&&(ta||ia&&(null==fa||fa<12.11)),pa=Kr||Jr&&Zr>=9,ga=!1,ma=!1,va=e.Pos=function(e,t){if(!(this instanceof va))return new va(e,t);this.line=e,this.ch=t},ya=e.cmpPos=function(e,t){return e.line-t.line||e.ch-t.ch};Y.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 n=this.ranges[t],i=e.ranges[t];if(0!=ya(n.anchor,i.anchor)||0!=ya(n.head,i.head))return!1}return!0},deepCopy:function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new K(V(this.ranges[t].anchor),V(this.ranges[t].head));return new Y(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 n=0;n<this.ranges.length;n++){var i=this.ranges[n];if(ya(t,i.from())>=0&&ya(e,i.to())<=0)return n}return-1}},K.prototype={from:function(){return W(this.anchor,this.head)},to:function(){return G(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var _a,ba,Ea,wa={left:0,right:0,top:0,bottom:0},Ta=null,Sa=0,Ca=null,ka=0,Ia=0,Aa=null;Jr?Aa=-.53:Kr?Aa=15:na?Aa=-.7:ra&&(Aa=-1/3);var xa,Da=null,Ra=e.changeEnd=function(e){return e.text?va(e.from.line+e.text.length-1,ur(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),Ct(this),wt(this)},setOption:function(e,t){var n=this.options,i=n[e];n[e]==t&&"mode"!=e||(n[e]=t,Na.hasOwnProperty(e)&&dt(this,Na[e])(this,t,i))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](e)},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;n<t.length;++n)if(t[n]==e||"string"!=typeof t[n]&&t[n].name==e)return t.splice(n,1),!0},addOverlay:ct((function(t,n){var i=t.token?t:e.getMode(this.options,t);if(i.startState)throw new Error("Overlays may not be stateful.");this.state.overlays.push({mode:i,modeSpec:t,opaque:n&&n.opaque}),this.state.modeGen++,pt(this)})),removeOverlay:ct((function(e){for(var t=this.state.overlays,n=0;n<t.length;++n){var i=t[n].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(n,1),this.state.modeGen++,void pt(this)}})),indentLine:ct((function(e,t,n){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),te(this.doc,e)&&En(this,e,t,n)})),indentSelection:ct((function(e){for(var t=this.doc.sel.ranges,n=-1,i=0;i<t.length;i++){var r=t[i];if(r.empty())r.head.line>n&&(En(this,r.head.line,e,!0),n=r.head.line,i==this.doc.sel.primIndex&&_n(this));else{var a=r.from(),o=r.to(),s=Math.max(n,a.line);n=Math.min(this.lastLine(),o.line-(o.ch?0:1))+1;for(var l=s;l<n;++l)En(this,l,e);var d=this.doc.sel.ranges;0==a.ch&&t.length==d.length&&d[i].from().ch>0&&oe(this.doc,i,new K(a,d[i].to()),go)}}})),getTokenAt:function(e,t){for(var n=this.doc,i=Ce(this,(e=Z(n,e)).line,t),r=this.doc.mode,a=Di(n,e.line),o=new Wa(a.text,this.options.tabSize);o.pos<e.ch&&!o.eol();){o.start=o.pos;var s=ui(r,o,i)}return{start:o.start,end:o.pos,string:o.current(),type:s||null,state:i}},getTokenTypeAt:function(e){e=Z(this.doc,e);var t,n=pi(this,Di(this.doc,e.line)),i=0,r=(n.length-1)/2,a=e.ch;if(0==a)t=n[2];else for(;;){var o=i+r>>1;if((o?n[2*o-1]:0)>=a)r=o;else{if(!(n[2*o+1]<a)){t=n[2*o+2];break}i=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 n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(t).state).mode:n},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var n=[];if(!Ba.hasOwnProperty(t))return Ba;var i=Ba[t],r=this.getModeAt(e);if("string"==typeof r[t])i[r[t]]&&n.push(i[r[t]]);else if(r[t])for(var a=0;a<r[t].length;a++){var o=i[r[t][a]];o&&n.push(o)}else r.helperType&&i[r.helperType]?n.push(i[r.helperType]):i[r.name]&&n.push(i[r.name]);for(a=0;a<i._global.length;a++){var s=i._global[a];s.pred(r,this)&&-1==fr(n,s.val)&&n.push(s.val)}return n},getStateAfter:function(e,t){var n=this.doc;return Ce(this,(e=J(n,null==e?n.first+n.size-1:e))+1,t)},cursorCoords:function(e,t){var n=this.doc.sel.primary();return Ge(this,null==e?n.head:"object"==typeof e?Z(this.doc,e):e?n.from():n.to(),t||"page")},charCoords:function(e,t){return Ve(this,Z(this.doc,e),t||"page")},coordsChar:function(e,t){return Ke(this,(e=ze(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=ze(this,{top:e,left:0},t||"page").top,Pi(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t){var n=!1,i=this.doc.first+this.doc.size-1;e<this.doc.first?e=this.doc.first:e>i&&(e=i,n=!0);var r=Di(this.doc,e);return qe(this,r,{top:0,left:0},t||"page").top+(n?this.doc.height-Li(r):0)},defaultTextHeight:function(){return Qe(this.display)},defaultCharWidth:function(){return Je(this.display)},setGutterMarker:ct((function(e,t,n){return wn(this.doc,e,"gutter",(function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return i[t]=n,!n&&yr(i)&&(e.gutterMarkers=null),!0}))})),clearGutter:ct((function(e){var t=this,n=t.doc,i=n.first;n.iter((function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,gt(t,i,"gutter"),yr(n.gutterMarkers)&&(n.gutterMarkers=null)),++i}))})),addLineWidget:ct((function(e,t,n){return oi(this,e,t,n)})),removeLineWidget:function(e){e.clear()},lineInfo:function(e){if("number"==typeof e){if(!te(this.doc,e))return null;var t=e;if(!(e=Di(this.doc,e)))return null}else{if(null==(t=Oi(e)))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,n,i,r){var a=this.display,o=(e=Ge(this,Z(this.doc,e))).bottom,s=e.left;if(t.style.position="absolute",a.sizer.appendChild(t),"over"==i)o=e.top;else if("above"==i||"near"==i){var l=Math.max(a.wrapper.clientHeight,this.doc.height),d=Math.max(a.sizer.clientWidth,a.lineSpace.clientWidth);("above"==i||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>d&&(s=d-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"),n&&mn(this,s,o,s+t.offsetWidth,o+t.offsetHeight)},triggerOnKeyDown:ct(Wt),triggerOnKeyPress:ct(Xt),triggerOnKeyUp:Kt,execCommand:function(e){if($a.hasOwnProperty(e))return $a[e](this)},findPosH:function(e,t,n,i){var r=1;t<0&&(r=-1,t=-t);for(var a=0,o=Z(this.doc,e);a<t&&!(o=Sn(this.doc,o,r,n,i)).hitSide;++a);return o},moveH:ct((function(e,t){var n=this;n.extendSelectionsBy((function(i){return n.display.shift||n.doc.extend||i.empty()?Sn(n.doc,i.head,e,t,n.options.rtlMoveVisually):e<0?i.from():i.to()}),vo)})),deleteH:ct((function(e,t){var n=this.doc.sel,i=this.doc;n.somethingSelected()?i.replaceSelection("",null,"+delete"):Tn(this,(function(n){var r=Sn(i,n.head,e,t,!1);return e<0?{from:r,to:n.head}:{from:n.head,to:r}}))})),findPosV:function(e,t,n,i){var r=1,a=i;t<0&&(r=-1,t=-t);for(var o=0,s=Z(this.doc,e);o<t;++o){var l=Ge(this,s,"div");if(null==a?a=l.left:l.left=a,(s=Cn(this,l,r,n)).hitSide)break}return s},moveV:ct((function(e,t){var n=this,i=this.doc,r=[],a=!n.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy((function(o){if(a)return e<0?o.from():o.to();var s=Ge(n,o.head,"div");null!=o.goalColumn&&(s.left=o.goalColumn),r.push(s.left);var l=Cn(n,s,e,t);return"page"==t&&o==i.sel.primary()&&yn(n,null,Ve(n,l,"div").top-s.top),l}),vo),r.length)for(var o=0;o<i.sel.ranges.length;o++)i.sel.ranges[o].goalColumn=r[o]})),findWordAt:function(e){var t=Di(this.doc,e.line).text,n=e.ch,i=e.ch;if(t){var r=this.getHelper(e,"wordChars");(e.xRel<0||i==t.length)&&n?--n:++i;for(var a=t.charAt(n),o=vr(a,r)?function(e){return vr(e,r)}:/\s/.test(a)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!vr(e)};n>0&&o(t.charAt(n-1));)--n;for(;i<t.length&&o(t.charAt(i));)++i}return new K(va(e.line,n),va(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ir(this.display.cursorDiv,"CodeMirror-overwrite"):kr(this.display.cursorDiv,"CodeMirror-overwrite"),uo(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return Sr()==this.display.input},scrollTo:ct((function(e,t){(null!=e||null!=t)&&bn(this),null!=e&&(this.curOp.scrollLeft=e),null!=t&&(this.curOp.scrollTop=t)})),getScrollInfo:function(){var e=this.display.scroller,t=ho;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-t,width:e.scrollWidth-t,clientHeight:e.clientHeight-t,clientWidth:e.clientWidth-t}},scrollIntoView:ct((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:va(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)bn(this),this.curOp.scrollToPos=e;else{var n=vn(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(n.scrollLeft,n.scrollTop)}})),setSize:ct((function(e,t){function n(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var i=this;null!=e&&(i.display.wrapper.style.width=n(e)),null!=t&&(i.display.wrapper.style.height=n(t)),i.options.lineWrapping&&Be(this);var r=i.display.viewFrom;i.doc.iter(r,i.display.viewTo,(function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){gt(i,r,"widget");break}++r})),i.curOp.forceUpdate=!0,uo(i,"refresh",this)})),operation:function(e){return lt(this,e)},refresh:ct((function(){var e=this.display.cachedTextHeight;pt(this),this.curOp.forceUpdate=!0,Ue(this),this.scrollTo(this.doc.scrollLeft,this.doc.scrollTop),u(this),(null==e||Math.abs(e-Qe(this.display))>.5)&&o(this),uo(this,"refresh",this)})),swapDoc:ct((function(e){var t=this.doc;return t.cm=null,xi(this,e),Ue(this),St(this),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,nr(this,"swapDoc",this,t),t})),getInputField:function(){return this.display.input},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},sr(e);var Ma=e.defaults={},Na=e.optionHandlers={},Oa=e.Init={toString:function(){return"CodeMirror.Init"}};kn("value","",(function(e,t){e.setValue(t)}),!0),kn("mode",null,(function(e,t){e.doc.modeOption=t,n(e)}),!0),kn("indentUnit",2,n,!0),kn("indentWithTabs",!1),kn("smartIndent",!0),kn("tabSize",4,(function(e){i(e),Ue(e),pt(e)}),!0),kn("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),kn("specialCharPlaceholder",yi,(function(e){e.refresh()}),!0),kn("electricChars",!0),kn("rtlMoveVisually",!ua),kn("wholeLineUpdateBefore",!0),kn("theme","default",(function(e){l(e),d(e)}),!0),kn("keyMap","default",s),kn("extraKeys",null),kn("lineWrapping",!1,r,!0),kn("gutters",[],(function(e){p(e.options),d(e)}),!0),kn("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?w(e.display)+"px":"0",e.refresh()}),!0),kn("coverGutterNextToScrollbar",!1,v,!0),kn("lineNumbers",!1,(function(e){p(e.options),d(e)}),!0),kn("firstLineNumber",1,d,!0),kn("lineNumberFormatter",(function(e){return e}),d,!0),kn("showCursorWhenSelecting",!1,ye,!0),kn("resetSelectionOnContextMenu",!0),kn("readOnly",!1,(function(e,t){"nocursor"==t?(Jt(e),e.display.input.blur(),e.display.disabled=!0):(e.display.disabled=!1,t||St(e))})),kn("disableInput",!1,(function(e,t){t||St(e)}),!0),kn("dragDrop",!0),kn("cursorBlinkRate",530),kn("cursorScrollMargin",0),kn("cursorHeight",1,ye,!0),kn("singleCursorHeightPerLine",!0,ye,!0),kn("workTime",100),kn("workDelay",100),kn("flattenSpans",!0,i,!0),kn("addModeClass",!1,i,!0),kn("pollInterval",100),kn("undoDepth",200,(function(e,t){e.doc.history.undoDepth=t})),kn("historyEventDelay",1250),kn("viewportMargin",10,(function(e){e.refresh()}),!0),kn("maxHighlightLength",1e4,i,!0),kn("moveInputWithCursor",!0,(function(e,t){t||(e.display.inputDiv.style.top=e.display.inputDiv.style.left=0)})),kn("tabindex",null,(function(e,t){e.display.input.tabIndex=t||""})),kn("autofocus",null);var Pa=e.modes={},La=e.mimeModes={};e.defineMode=function(t,n){!e.defaults.mode&&"null"!=t&&(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),Pa[t]=n},e.defineMIME=function(e,t){La[e]=t},e.resolveMode=function(t){if("string"==typeof t&&La.hasOwnProperty(t))t=La[t];else if(t&&"string"==typeof t.name&&La.hasOwnProperty(t.name)){var n=La[t.name];"string"==typeof n&&(n={name:n}),(t=pr(n,t)).name=n.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,n){n=e.resolveMode(n);var i=Pa[n.name];if(!i)return e.getMode(t,"text/plain");var r=i(t,n);if(Fa.hasOwnProperty(n.name)){var a=Fa[n.name];for(var o in a)a.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=a[o])}if(r.name=n.name,n.helperType&&(r.helperType=n.helperType),n.modeProps)for(var o in n.modeProps)r[o]=n.modeProps[o];return r},e.defineMode("null",(function(){return{token:function(e){e.skipToEnd()}}})),e.defineMIME("text/plain","null");var Fa=e.modeExtensions={};e.extendMode=function(e,t){gr(t,Fa.hasOwnProperty(e)?Fa[e]:Fa[e]={})},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){no.prototype[e]=t},e.defineOption=kn;var ja=[];e.defineInitHook=function(e){ja.push(e)};var Ba=e.helpers={};e.registerHelper=function(t,n,i){Ba.hasOwnProperty(t)||(Ba[t]=e[t]={_global:[]}),Ba[t][n]=i},e.registerGlobalHelper=function(t,n,i,r){e.registerHelper(t,n,r),Ba[t]._global.push({pred:i,val:r})};var Ua=e.copyState=function(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var i in t){var r=t[i];r instanceof Array&&(r=r.concat([])),n[i]=r}return n},Ha=e.startState=function(e,t,n){return!e.startState||e.startState(t,n)};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var $a=e.commands={selectAll:function(e){e.setSelection(va(e.firstLine(),0),va(e.lastLine()),go)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),go)},killLine:function(e){Tn(e,(function(t){if(t.empty()){var n=Di(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:va(t.head.line+1,0)}:{from:t.head,to:va(t.head.line,n)}}return{from:t.from(),to:t.to()}}))},deleteLine:function(e){Tn(e,(function(t){return{from:va(t.from().line,0),to:Z(e.doc,va(t.to().line+1,0))}}))},delLineLeft:function(e){Tn(e,(function(e){return{from:va(e.from().line,0),to:e.from()}}))},delWrappedLineLeft:function(e){Tn(e,(function(t){var n=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:n},"div"),to:t.from()}}))},delWrappedLineRight:function(e){Tn(e,(function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:i}}))},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(va(e.firstLine(),0))},goDocEnd:function(e){e.extendSelection(va(e.lastLine()))},goLineStart:function(e){e.extendSelectionsBy((function(t){return Hr(e,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(e){e.extendSelectionsBy((function(t){return qr(e,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(e){e.extendSelectionsBy((function(t){return $r(e,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(e){e.extendSelectionsBy((function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")}),vo)},goLineLeft:function(e){e.extendSelectionsBy((function(t){var n=e.charCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")}),vo)},goLineLeftSmart:function(e){e.extendSelectionsBy((function(t){var n=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:n},"div");return i.ch<e.getLine(i.line).search(/\S/)?qr(e,t.head):i}),vo)},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=[],n=e.listSelections(),i=e.options.tabSize,r=0;r<n.length;r++){var a=n[r].from(),o=yo(e.getLine(a.line),a.ch,i);t.push(new Array(i-o%i+1).join(" "))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){lt(e,(function(){for(var t=e.listSelections(),n=[],i=0;i<t.length;i++){var r=t[i].head,a=Di(e.doc,r.line).text;if(a)if(r.ch==a.length&&(r=new va(r.line,r.ch-1)),r.ch>0)r=new va(r.line,r.ch+1),e.replaceRange(a.charAt(r.ch-1)+a.charAt(r.ch-2),va(r.line,r.ch-2),r,"+transpose");else if(r.line>e.doc.first){var o=Di(e.doc,r.line-1).text;o&&e.replaceRange(a.charAt(0)+"\n"+o.charAt(o.length-1),va(r.line-1,o.length-1),va(r.line,1),"+transpose")}n.push(new K(r,r))}e.setSelections(n)}))},newlineAndIndent:function(e){lt(e,(function(){for(var t=e.listSelections().length,n=0;n<t;n++){var i=e.listSelections()[n];e.replaceRange("\n",i.anchor,i.head,"+input"),e.indentLine(i.from().line+1,null,!0),_n(e)}}))},toggleOverwrite:function(e){e.toggleOverwrite()}},qa=e.keyMap={};qa.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"},qa.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"},qa.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"]},qa.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"},qa.default=ca?qa.macDefault:qa.pcDefault;var za=e.lookupKey=function(e,t,n){function i(t){var r=(t=In(t))[e];if(!1===r)return"stop";if(null!=r&&n(r))return!0;if(t.nofallthrough)return"stop";var a=t.fallthrough;if(null==a)return!1;if("[object Array]"!=Object.prototype.toString.call(a))return i(a);for(var o=0;o<a.length;++o){var s=i(a[o]);if(s)return s}return!1}for(var r=0;r<t.length;++r){var a=i(t[r]);if(a)return"stop"!=a}},Va=e.isModifierKey=function(e){var t=Oo[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t},Ga=e.keyName=function(e,t){if(ia&&34==e.keyCode&&e.char)return!1;var n=Oo[e.keyCode];return null!=n&&!e.altGraphKey&&(e.altKey&&(n="Alt-"+n),(ha?e.metaKey:e.ctrlKey)&&(n="Ctrl-"+n),(ha?e.ctrlKey:e.metaKey)&&(n="Cmd-"+n),!t&&e.shiftKey&&(n="Shift-"+n),n)};e.fromTextArea=function(t,n){function i(){t.value=l.getValue()}if(n||(n={}),n.value=t.value,!n.tabindex&&t.tabindex&&(n.tabindex=t.tabindex),!n.placeholder&&t.placeholder&&(n.placeholder=t.placeholder),null==n.autofocus){var r=Sr();n.autofocus=r==t||null!=t.getAttribute("autofocus")&&r==document.body}if(t.form&&(lo(t.form,"submit",i),!n.leaveSubmitMethodAlone)){var a=t.form,o=a.submit;try{var s=a.submit=function(){i(),a.submit=o,a.submit(),a.submit=s}}catch(e){}}t.style.display="none";var l=e((function(e){t.parentNode.insertBefore(e,t.nextSibling)}),n);return l.save=i,l.getTextArea=function(){return t},l.toTextArea=function(){l.toTextArea=isNaN,i(),t.parentNode.removeChild(l.getWrapperElement()),t.style.display="",t.form&&(co(t.form,"submit",i),"function"==typeof t.form.submit&&(t.form.submit=o))},l};var Wa=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};Wa.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 n=t==e;else n=t&&(e.test?e.test(t):e(t));if(n)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=yo(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?yo(this.string,this.lineStart,this.tabSize):0)},indentation:function(){return yo(this.string,null,this.tabSize)-(this.lineStart?yo(this.string,this.lineStart,this.tabSize):0)},match:function(e,t,n){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}var r=function(e){return n?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 Ya=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e};sr(Ya),Ya.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ze(e),or(this,"clear")){var n=this.find();n&&nr(this,"clear",n.from,n.to)}for(var i=null,r=null,a=0;a<this.lines.length;++a){var o=this.lines[a],s=On(o.markedSpans,this);e&&!this.collapsed?gt(e,Oi(o),"text"):e&&(null!=s.to&&(r=Oi(o)),null!=s.from&&(i=Oi(o))),o.markedSpans=Pn(o.markedSpans,s),null==s.from&&this.collapsed&&!ni(this.doc,o)&&e&&Ni(o,Qe(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(a=0;a<this.lines.length;++a){var l=Jn(this.lines[a]),d=f(l);d>e.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=d,e.display.maxLineChanged=!0)}null!=i&&e&&this.collapsed&&pt(e,i,r+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&he(e.doc)),e&&nr(e,"markerCleared",e,this),t&&tt(e),this.parent&&this.parent.clear()}},Ya.prototype.find=function(e,t){var n,i;null==e&&"bookmark"==this.type&&(e=1);for(var r=0;r<this.lines.length;++r){var a=this.lines[r],o=On(a.markedSpans,this);if(null!=o.from&&(n=va(t?a:Oi(a),o.from),-1==e))return n;if(null!=o.to&&(i=va(t?a:Oi(a),o.to),1==e))return i}return n&&{from:n,to:i}},Ya.prototype.changed=function(){var e=this.find(-1,!0),t=this,n=this.doc.cm;e&&n&&lt(n,(function(){var i=e.line,r=Oi(e.line),a=Ne(n,r);if(a&&(je(a),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!ni(t.doc,i)&&null!=t.height){var o=t.height;t.height=null;var s=ai(t)-o;s&&Ni(i,i.height+s)}}))},Ya.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||-1==fr(t.maybeHiddenMarkers,this))&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Ya.prototype.detachLine=function(e){if(this.lines.splice(fr(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};var Ka=0,Xa=e.SharedTextMarker=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};sr(Xa),Xa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();nr(this,"clear")}},Xa.prototype.find=function(e,t){return this.primary.find(e,t)};var Qa=e.LineWidget=function(e,t,n){if(n)for(var i in n)n.hasOwnProperty(i)&&(this[i]=n[i]);this.cm=e,this.node=t};sr(Qa),Qa.prototype.clear=function(){var e=this.cm,t=this.line.widgets,n=this.line,i=Oi(n);if(null!=i&&t){for(var r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(n.widgets=null);var a=ai(this);lt(e,(function(){ri(e,n,-a),gt(e,i,"widget"),Ni(n,Math.max(0,n.height-a))}))}},Qa.prototype.changed=function(){var e=this.height,t=this.cm,n=this.line;this.height=null;var i=ai(this)-e;i&&lt(t,(function(){t.curOp.forceUpdate=!0,ri(t,n,i),Ni(n,n.height+i)}))};var Ja=e.Line=function(e,t,n){this.text=e,zn(this,t),this.height=n?n(this):1};sr(Ja),Ja.prototype.lineNo=function(){return Oi(this)};var Za={},eo={};ki.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,i=e+t;n<i;++n){var r=this.lines[n];this.height-=r.height,li(r),nr(r,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,n){for(var i=e+t;e<i;++e)if(n(this.lines[e]))return!0}},Ii.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var i=this.children[n],r=i.chunkSize();if(e<r){var a=Math.min(t,r-e),o=i.height;if(i.removeInner(e,a),this.height-=o-i.height,r==a&&(this.children.splice(n--,1),i.parent=null),0==(t-=a))break;e=0}else e-=r}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ki))){var s=[];this.collapse(s),this.children=[new ki(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,n){this.size+=t.length,this.height+=n;for(var i=0;i<this.children.length;++i){var r=this.children[i],a=r.chunkSize();if(e<=a){if(r.insertInner(e,t,n),r.lines&&r.lines.length>50){for(;r.lines.length>50;){var o=new ki(r.lines.splice(r.lines.length-25,25));r.height-=o.height,this.children.splice(i+1,0,o),o.parent=this}this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=new Ii(e.children.splice(e.children.length-5,5));if(e.parent){e.size-=t.size,e.height-=t.height;var n=fr(e.parent.children,e);e.parent.children.splice(n+1,0,t)}else{var i=new Ii(e.children);i.parent=e,e.children=[i,t],e=i}t.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var i=0;i<this.children.length;++i){var r=this.children[i],a=r.chunkSize();if(e<a){var o=Math.min(t,a-e);if(r.iterN(e,o,n))return!0;if(0==(t-=o))break;e=0}else e-=a}}};var to=0,no=e.Doc=function(e,t,n){if(!(this instanceof no))return new no(e,t,n);null==n&&(n=0),Ii.call(this,[new ki([new Ja("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=va(n,0);this.sel=Q(i),this.history=new ji(null),this.id=++to,this.modeOption=t,"string"==typeof e&&(e=Do(e)),Ci(this,{from:i,to:i,text:e}),ce(this,Q(i),go)};no.prototype=pr(Ii.prototype,{constructor:no,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,i=0;i<t.length;++i)n+=t[i].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Mi(this,this.first,this.first+this.size);return!1===e?t:t.join(e||"\n")},setValue:ut((function(e){var t=va(this.first,0),n=this.first+this.size-1;sn(this,{from:t,to:va(n,Di(this,n).text.length),text:Do(e),origin:"setValue"},!0),ce(this,Q(t))})),replaceRange:function(e,t,n,i){hn(this,e,t=Z(this,t),n=n?Z(this,n):t,i)},getRange:function(e,t,n){var i=Ri(this,Z(this,e),Z(this,t));return!1===n?i:i.join(n||"\n")},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(te(this,e))return Di(this,e)},getLineNumber:function(e){return Oi(e)},getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Di(this,e)),Jn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Z(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:ut((function(e,t,n){se(this,Z(this,"number"==typeof e?va(e,t||0):e),null,n)})),setSelection:ut((function(e,t,n){se(this,Z(this,e),Z(this,t||e),n)})),extendSelection:ut((function(e,t,n){re(this,Z(this,e),t&&Z(this,t),n)})),extendSelections:ut((function(e,t){ae(this,ne(this,e,t))})),extendSelectionsBy:ut((function(e,t){ae(this,hr(this.sel.ranges,e),t)})),setSelections:ut((function(e,t,n){if(e.length){for(var i=0,r=[];i<e.length;i++)r[i]=new K(Z(this,e[i].anchor),Z(this,e[i].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),ce(this,X(r,t),n)}})),addSelection:ut((function(e,t,n){var i=this.sel.ranges.slice(0);i.push(new K(Z(this,e),Z(this,t||e))),ce(this,X(i,i.length-1),n)})),getSelection:function(e){for(var t,n=this.sel.ranges,i=0;i<n.length;i++){var r=Ri(this,n[i].from(),n[i].to());t=t?t.concat(r):r}return!1===e?t:t.join(e||"\n")},getSelections:function(e){for(var t=[],n=this.sel.ranges,i=0;i<n.length;i++){var r=Ri(this,n[i].from(),n[i].to());!1!==e&&(r=r.join(e||"\n")),t[i]=r}return t},replaceSelection:function(e,t,n){for(var i=[],r=0;r<this.sel.ranges.length;r++)i[r]=e;this.replaceSelections(i,t,n||"+input")},replaceSelections:ut((function(e,t,n){for(var i=[],r=this.sel,a=0;a<r.ranges.length;a++){var o=r.ranges[a];i[a]={from:o.from(),to:o.to(),text:Do(e[a]),origin:n}}var s=t&&"end"!=t&&an(this,i,t);for(a=i.length-1;a>=0;a--)sn(this,i[a]);s?de(this,s):this.cm&&_n(this.cm)})),undo:ut((function(){dn(this,"undo")})),redo:ut((function(){dn(this,"redo")})),undoSelection:ut((function(){dn(this,"undo",!0)})),redoSelection:ut((function(){dn(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){this.history=new ji(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:Ki(this.history.done),undone:Ki(this.history.undone)}},setHistory:function(e){var t=this.history=new ji(this.history.maxGeneration);t.done=Ki(e.done.slice(0),null,!0),t.undone=Ki(e.undone.slice(0),null,!0)},addLineClass:ut((function(e,t,n){return wn(this,e,"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"wrapClass";if(e[i]){if(new RegExp("(?:^|\\s)"+n+"(?:$|\\s)").test(e[i]))return!1;e[i]+=" "+n}else e[i]=n;return!0}))})),removeLineClass:ut((function(e,t,n){return wn(this,e,"class",(function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"wrapClass",r=e[i];if(!r)return!1;if(null==n)e[i]=null;else{var a=r.match(new RegExp("(?:^|\\s+)"+n+"(?:$|\\s+)"));if(!a)return!1;var o=a.index+a[0].length;e[i]=r.slice(0,a.index)+(a.index&&o!=r.length?" ":"")+r.slice(o)||null}return!0}))})),markText:function(e,t,n){return An(this,Z(this,e),Z(this,t),n,"range")},setBookmark:function(e,t){var n={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared};return An(this,e=Z(this,e),e,n,"bookmark")},findMarksAt:function(e){var t=[],n=Di(this,(e=Z(this,e)).line).markedSpans;if(n)for(var i=0;i<n.length;++i){var r=n[i];(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,n){e=Z(this,e),t=Z(this,t);var i=[],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)&&(!n||n(l.marker))&&i.push(l.marker.parent||l.marker)}++r})),i},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var i=0;i<n.length;++i)null!=n[i].from&&e.push(n[i].marker)})),e},posFromIndex:function(e){var t,n=this.first;return this.iter((function(i){var r=i.text.length+1;if(r>e)return t=e,!0;e-=r,++n})),Z(this,va(n,t))},indexFromPos:function(e){var t=(e=Z(this,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 no(Mi(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,n=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<n&&(n=e.to);var i=new no(Mi(this,t,n),e.mode||this.modeOption,t);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Rn(i,Dn(this)),i},unlinkDoc:function(t){if(t instanceof e&&(t=t.doc),this.linked)for(var n=0;n<this.linked.length;++n){if(this.linked[n].doc==t){this.linked.splice(n,1),t.unlinkDoc(this),Mn(Dn(this));break}}if(t.history==this.history){var i=[t.id];Ai(t,(function(e){i.push(e.id)}),!0),t.history=new ji(null),t.history.done=Ki(this.history.done,i),t.history.undone=Ki(this.history.undone,i)}},iterLinkedDocs:function(e){Ai(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm}}),no.prototype.eachLine=no.prototype.iter;var io="iter insert remove copy getEditor".split(" ");for(var ro in no.prototype)no.prototype.hasOwnProperty(ro)&&fr(io,ro)<0&&(e.prototype[ro]=function(e){return function(){return e.apply(this.doc,arguments)}}(no.prototype[ro]));sr(no);var ao=e.e_preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},oo=e.e_stopPropagation=function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0},so=e.e_stop=function(e){ao(e),oo(e)},lo=e.on=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var i=e._handlers||(e._handlers={});(i[t]||(i[t]=[])).push(n)}},co=e.off=function(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var i=e._handlers&&e._handlers[t];if(!i)return;for(var r=0;r<i.length;++r)if(i[r]==n){i.splice(r,1);break}}},uo=e.signal=function(e,t){var n=e._handlers&&e._handlers[t];if(n)for(var i=Array.prototype.slice.call(arguments,2),r=0;r<n.length;++r)n[r].apply(null,i)},fo=null,ho=30,po=e.Pass={toString:function(){return"CodeMirror.Pass"}},go={scroll:!1},mo={origin:"*mouse"},vo={origin:"+move"};lr.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var yo=e.countColumn=function(e,t,n,i,r){null==t&&(-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length));for(var a=i||0,o=r||0;;){var s=e.indexOf("\t",a);if(s<0||s>=t)return o+(t-a);o+=s-a,o+=n-o%n,a=s+1}},_o=[""],bo=function(e){e.select()};la?bo=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:Jr&&(bo=function(e){try{e.select()}catch(e){}}),[].indexOf&&(fr=function(e,t){return e.indexOf(t)}),[].map&&(hr=function(e,t){return e.map(t)});var Eo,wo=/[\u00df\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,To=e.isWordChar=function(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||wo.test(e))},So=/[\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]/;Eo=document.createRange?function(e,t,n){var i=document.createRange();return i.setEnd(e,n),i.setStart(e,t),i}:function(e,t,n){var i=document.body.createTextRange();return i.moveToElementText(e.parentNode),i.collapse(!0),i.moveEnd("character",n),i.moveStart("character",t),i},Jr&&Zr<11&&(Sr=function(){try{return document.activeElement}catch(e){return document.body}});var Co,ko,Io,Ao=!1,xo=function(){if(Jr&&Zr<9)return!1;var e=br("div");return"draggable"in e||"dragDrop"in e}(),Do=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],i=e.length;t<=i;){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?(n.push(a.slice(0,o)),t+=o+1):(n.push(a),t=r+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ro=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)},Mo=function(){var e=br("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),No=null,Oo={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=Oo,function(){for(var e=0;e<10;e++)Oo[e+48]=Oo[e+96]=String(e);for(e=65;e<=90;e++)Oo[e]=String.fromCharCode(e);for(e=1;e<=12;e++)Oo[e+111]=Oo[e+63235]="F"+e}();var Po,Lo=function(){function e(e){return e<=247?n.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1773?i.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",i="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,d="L";return function(n){if(!r.test(n))return!1;for(var i=n.length,c=[],u=0;u<i;++u)c.push(v=e(n.charCodeAt(u)));u=0;for(var f=d;u<i;++u){"m"==(v=c[u])?c[u]=f:f=v}u=0;for(var h=d;u<i;++u){"1"==(v=c[u])&&"r"==h?c[u]="n":o.test(v)&&(h=v,"r"==v&&(c[u]="R"))}for(u=1,f=c[0];u<i-1;++u){"+"==(v=c[u])&&"1"==f&&"1"==c[u+1]?c[u]="1":","==v&&f==c[u+1]&&("1"==f||"n"==f)&&(c[u]=f),f=v}for(u=0;u<i;++u){if(","==(v=c[u]))c[u]="N";else if("%"==v){for(var p=u+1;p<i&&"%"==c[p];++p);for(var g=u&&"!"==c[u-1]||p<i&&"1"==c[p]?"1":"N",m=u;m<p;++m)c[m]=g;u=p-1}}for(u=0,h=d;u<i;++u){var v=c[u];"L"==h&&"1"==v?c[u]="L":o.test(v)&&(h=v)}for(u=0;u<i;++u)if(a.test(c[u])){for(p=u+1;p<i&&a.test(c[p]);++p);var y="L"==(u?c[u-1]:d),_="L"==(p<i?c[p]:d);for(g=y||_?"L":"R",m=u;m<p;++m)c[m]=g;u=p-1}var b,E=[];for(u=0;u<i;)if(s.test(c[u])){var w=u;for(++u;u<i&&s.test(c[u]);++u);E.push(new t(0,w,u))}else{var T=u,S=E.length;for(++u;u<i&&"L"!=c[u];++u);for(m=T;m<u;)if(l.test(c[m])){T<m&&E.splice(S,0,new t(1,T,m));var C=m;for(++m;m<u&&l.test(c[m]);++m);E.splice(S,0,new t(2,C,m)),T=m}else++m;T<u&&E.splice(S,0,new t(1,T,u))}return 1==E[0].level&&(b=n.match(/^\s+/))&&(E[0].from=b[0].length,E.unshift(new t(0,0,b[0].length))),1==ur(E).level&&(b=n.match(/\s+$/))&&(ur(E).to-=b[0].length,E.push(new t(0,i-b[0].length,i))),E[0].level!=ur(E).level&&E.push(new t(E[0].level,i,i)),E}}();return e.version="4.7.0",e})),n("codemirror",["codemirror/lib/codemirror"],(function(e){return e})),function(e){"object"==typeof exports&&"object"==typeof module?e(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n("codemirror/mode/xml/xml",["../../lib/codemirror"],e):e(CodeMirror)}((function(e){e.defineMode("xml",(function(t,n){function i(e,t){function n(n){return t.tokenize=n,n(e,t)}var i=e.next();return"<"==i?e.eat("!")?e.eat("[")?e.match("CDATA[")?n(o("atom","]]>")):null:e.match("--")?n(o("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(s(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=o("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=r,"tag bracket"):"&"==i?(e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"))?"atom":"error":(e.eatWhile(/[^&<]/),null)}function r(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=i,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=i,t.state=u,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=a(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=r;break}return"string"};return t.isInAttribute=!0,t}function o(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=i;break}n.next()}return e}}function s(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=s(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=i;break}return n.tokenize=s(e-1),n.tokenize(t,n)}}return"meta"}}function l(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(C.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function d(e){e.context&&(e.context=e.context.prev)}function c(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!C.contextGrabbers.hasOwnProperty(n)||!C.contextGrabbers[n].hasOwnProperty(t))return;d(e)}}function u(e,t,n){return"openTag"==e?(n.tagStart=t.column(),f):"closeTag"==e?h:u}function f(e,t,n){return"word"==e?(n.tagName=t.current(),S="tag",m):(S="error",f)}function h(e,t,n){if("word"==e){var i=t.current();return n.context&&n.context.tagName!=i&&C.implicitlyClosed.hasOwnProperty(n.context.tagName)&&d(n),n.context&&n.context.tagName==i?(S="tag",p):(S="tag error",g)}return S="error",g}function p(e,t,n){return"endTag"!=e?(S="error",p):(d(n),u)}function g(e,t,n){return S="error",p(e,t,n)}function m(e,t,n){if("word"==e)return S="attribute",v;if("endTag"==e||"selfcloseTag"==e){var i=n.tagName,r=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||C.autoSelfClosers.hasOwnProperty(i)?c(n,i):(c(n,i),n.context=new l(n,i,r==n.indented)),u}return S="error",m}function v(e,t,n){return"equals"==e?y:(C.allowMissing||(S="error"),m(e,t,n))}function y(e,t,n){return"string"==e?_:"word"==e&&C.allowUnquoted?(S="string",m):(S="error",m(e,t,n))}function _(e,t,n){return"string"==e?_:m(e,t,n)}var b=t.indentUnit,E=n.multilineTagIndentFactor||1,w=n.multilineTagIndentPastTag;null==w&&(w=!0);var T,S,C=n.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},k=n.alignCDATA;return{startState:function(){return{tokenize:i,state:u,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;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(S=null,t.state=t.state(T||n,e,t),S&&(n="error"==S?n+" error":S)),n},indent:function(t,n,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!=i)return a?a.match(/^(\s*)/)[0].length:0;if(t.tagName)return w?t.tagStart+t.tagName.length+2:t.tagStart+b*E;if(k&&/<!\[CDATA\[/.test(n))return 0;var s=n&&/^<(\/)?([\w_:\.-]*)/.exec(n);if(s&&s[1])for(;o;){if(o.tagName==s[2]){o=o.prev;break}if(!C.implicitlyClosed.hasOwnProperty(o.tagName))break;o=o.prev}else if(s)for(;o;){var l=C.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:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.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(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n("codemirror/mode/javascript/javascript",["../../lib/codemirror"],e):e(CodeMirror)}((function(e){e.defineMode("javascript",(function(t,n){function i(e){for(var t,n=!1,i=!1;null!=(t=e.next());){if(!n){if("/"==t&&!i)return;"["==t?i=!0:i&&"]"==t&&(i=!1)}n=!n&&"\\"==t}}function r(e,t,n){return pe=e,ge=n,t}function a(e,t){var n=e.next();if('"'==n||"'"==n)return t.tokenize=o(n),t.tokenize(e,t);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return r("number","number");if("."==n&&e.match(".."))return r("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return r(n);if("="==n&&e.eat(">"))return r("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),r("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),r("number","number");if("/"==n)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)?(i(e),e.eatWhile(/[gimy]/),r("regexp","string-2")):(e.eatWhile(Te),r("operator","operator",e.current()));if("`"==n)return t.tokenize=l,l(e,t);if("#"==n)return e.skipToEnd(),r("error","error");if(Te.test(n))return e.eatWhile(Te),r("operator","operator",e.current());if(Ee.test(n)){e.eatWhile(Ee);var a=e.current(),d=we.propertyIsEnumerable(a)&&we[a];return d&&"."!=t.lastType?r(d.type,d.style,a):r("variable","variable",a)}}function o(e){return function(t,n){var i,o=!1;if(ye&&"@"==t.peek()&&t.match(Se))return n.tokenize=a,r("jsonld-keyword","meta");for(;null!=(i=t.next())&&(i!=e||o);)o=!o&&"\\"==i;return o||(n.tokenize=a),r("string","string")}}function s(e,t){for(var n,i=!1;n=e.next();){if("/"==n&&i){t.tokenize=a;break}i="*"==n}return r("comment","comment")}function l(e,t){for(var n,i=!1;null!=(n=e.next());){if(!i&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=a;break}i=!i&&"\\"==n}return r("quasi","string-2",e.current())}function d(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){for(var i=0,r=!1,a=n-1;a>=0;--a){var o=e.string.charAt(a),s=Ce.indexOf(o);if(s>=0&&s<3){if(!i){++a;break}if(0==--i)break}else if(s>=3&&s<6)++i;else if(Ee.test(o))r=!0;else if(r&&!i){++a;break}}r&&!i&&(t.fatArrowAt=a)}}function c(e,t,n,i,r,a){this.indented=e,this.column=t,this.type=n,this.prev=r,this.info=a,null!=i&&(this.align=i)}function u(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var i=e.context;i;i=i.prev)for(n=i.vars;n;n=n.next)if(n.name==t)return!0}function f(e,t,n,i,r){var a=e.cc;for(Ie.state=e,Ie.stream=r,Ie.marked=null,Ie.cc=a,Ie.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){if((a.length?a.pop():_e?w:E)(n,i)){for(;a.length&&a[a.length-1].lex;)a.pop()();return Ie.marked?Ie.marked:"variable"==n&&u(e,i)?"variable-2":t}}}function h(){for(var e=arguments.length-1;e>=0;e--)Ie.cc.push(arguments[e])}function p(){return h.apply(null,arguments),!0}function g(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var i=Ie.state;if(i.context){if(Ie.marked="def",t(i.localVars))return;i.localVars={name:e,next:i.localVars}}else{if(t(i.globalVars))return;n.globalVars&&(i.globalVars={name:e,next:i.globalVars})}}function m(){Ie.state.context={prev:Ie.state.context,vars:Ie.state.localVars},Ie.state.localVars=Ae}function v(){Ie.state.localVars=Ie.state.context.vars,Ie.state.context=Ie.state.context.prev}function y(e,t){var n=function(){var n=Ie.state,i=n.indented;if("stat"==n.lexical.type)i=n.lexical.indented;else for(var r=n.lexical;r&&")"==r.type&&r.align;r=r.prev)i=r.indented;n.lexical=new c(i,Ie.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function _(){var e=Ie.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function b(e){function t(n){return n==e?p():";"==e?h():p(t)}return t}function E(e,t){return"var"==e?p(y("vardef",t.length),q,b(";"),_):"keyword a"==e?p(y("form"),w,E,_):"keyword b"==e?p(y("form"),E,_):"{"==e?p(y("}"),U,_):";"==e?p():"if"==e?("else"==Ie.state.lexical.info&&Ie.state.cc[Ie.state.cc.length-1]==_&&Ie.state.cc.pop()(),p(y("form"),w,E,_,Y)):"function"==e?p(ee):"for"==e?p(y("form"),K,E,_):"variable"==e?p(y("stat"),N):"switch"==e?p(y("form"),w,y("}","switch"),b("{"),U,_,_):"case"==e?p(w,b(":")):"default"==e?p(b(":")):"catch"==e?p(y("form"),m,b("("),te,b(")"),E,_,v):"module"==e?p(y("form"),m,oe,v,_):"class"==e?p(y("form"),ne,_):"export"==e?p(y("form"),se,_):"import"==e?p(y("form"),le,_):h(y("stat"),w,b(";"),_)}function w(e){return S(e,!1)}function T(e){return S(e,!0)}function S(e,t){if(Ie.state.fatArrowAt==Ie.stream.start){var n=t?M:R;if("("==e)return p(m,y(")"),j(z,")"),_,b("=>"),n,v);if("variable"==e)return h(m,z,b("=>"),n,v)}var i=t?A:I;return ke.hasOwnProperty(e)?p(i):"function"==e?p(ee,i):"keyword c"==e?p(t?k:C):"("==e?p(y(")"),C,he,b(")"),_,i):"operator"==e||"spread"==e?p(t?T:w):"["==e?p(y("]"),ue,_,i):"{"==e?B(P,"}",null,i):"quasi"==e?h(x,i):p()}function C(e){return e.match(/[;\}\)\],]/)?h():h(w)}function k(e){return e.match(/[;\}\)\],]/)?h():h(T)}function I(e,t){return","==e?p(w):A(e,t,!1)}function A(e,t,n){var i=0==n?I:A,r=0==n?w:T;return"=>"==e?p(m,n?M:R,v):"operator"==e?/\+\+|--/.test(t)?p(i):"?"==t?p(w,b(":"),r):p(r):"quasi"==e?h(x,i):";"!=e?"("==e?B(T,")","call",i):"."==e?p(O,i):"["==e?p(y("]"),C,b("]"),_,i):void 0:void 0}function x(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?p(x):p(w,D)}function D(e){if("}"==e)return Ie.marked="string-2",Ie.state.tokenize=l,p(x)}function R(e){return d(Ie.stream,Ie.state),h("{"==e?E:w)}function M(e){return d(Ie.stream,Ie.state),h("{"==e?E:T)}function N(e){return":"==e?p(_,E):h(I,b(";"),_)}function O(e){if("variable"==e)return Ie.marked="property",p()}function P(e,t){return"variable"==e||"keyword"==Ie.style?(Ie.marked="property",
p("get"==t||"set"==t?L:F)):"number"==e||"string"==e?(Ie.marked=ye?"property":Ie.style+" property",p(F)):"jsonld-keyword"==e?p(F):"["==e?p(w,b("]"),F):void 0}function L(e){return"variable"!=e?h(F):(Ie.marked="property",p(ee))}function F(e){return":"==e?p(T):"("==e?h(ee):void 0}function j(e,t){function n(i){if(","==i){var r=Ie.state.lexical;return"call"==r.info&&(r.pos=(r.pos||0)+1),p(e,n)}return i==t?p():p(b(t))}return function(i){return i==t?p():h(e,n)}}function B(e,t,n){for(var i=3;i<arguments.length;i++)Ie.cc.push(arguments[i]);return p(y(t,n),j(e,t),_)}function U(e){return"}"==e?p():h(E,U)}function H(e){if(be&&":"==e)return p($)}function $(e){if("variable"==e)return Ie.marked="variable-3",p()}function q(){return h(z,H,G,W)}function z(e,t){return"variable"==e?(g(t),p()):"["==e?B(z,"]"):"{"==e?B(V,"}"):void 0}function V(e,t){return"variable"!=e||Ie.stream.match(/^\s*:/,!1)?("variable"==e&&(Ie.marked="property"),p(b(":"),z,G)):(g(t),p(G))}function G(e,t){if("="==t)return p(T)}function W(e){if(","==e)return p(q)}function Y(e,t){if("keyword b"==e&&"else"==t)return p(y("form","else"),E,_)}function K(e){if("("==e)return p(y(")"),X,b(")"),_)}function X(e){return"var"==e?p(q,b(";"),J):";"==e?p(J):"variable"==e?p(Q):h(w,b(";"),J)}function Q(e,t){return"in"==t||"of"==t?(Ie.marked="keyword",p(w)):p(I,J)}function J(e,t){return";"==e?p(Z):"in"==t||"of"==t?(Ie.marked="keyword",p(w)):h(w,b(";"),Z)}function Z(e){")"!=e&&p(w)}function ee(e,t){return"*"==t?(Ie.marked="keyword",p(ee)):"variable"==e?(g(t),p(ee)):"("==e?p(m,y(")"),j(te,")"),_,E,v):void 0}function te(e){return"spread"==e?p(te):h(z,H)}function ne(e,t){if("variable"==e)return g(t),p(ie)}function ie(e,t){return"extends"==t?p(w,ie):"{"==e?p(y("}"),re,_):void 0}function re(e,t){return"variable"==e||"keyword"==Ie.style?(Ie.marked="property","get"==t||"set"==t?p(ae,ee,re):p(ee,re)):"*"==t?(Ie.marked="keyword",p(re)):";"==e?p(re):"}"==e?p():void 0}function ae(e){return"variable"!=e?h():(Ie.marked="property",p())}function oe(e,t){return"string"==e?p(E):"variable"==e?(g(t),p(ce)):void 0}function se(e,t){return"*"==t?(Ie.marked="keyword",p(ce,b(";"))):"default"==t?(Ie.marked="keyword",p(w,b(";"))):h(E)}function le(e){return"string"==e?p():h(de,ce)}function de(e,t){return"{"==e?B(de,"}"):("variable"==e&&g(t),p())}function ce(e,t){if("from"==t)return Ie.marked="keyword",p(w)}function ue(e){return"]"==e?p():h(T,fe)}function fe(e){return"for"==e?h(he,b("]")):","==e?p(j(k,"]")):h(j(T,"]"))}function he(e){return"for"==e?p(K,he):"if"==e?p(w,he):void 0}var pe,ge,me=t.indentUnit,ve=n.statementIndent,ye=n.jsonld,_e=n.json||ye,be=n.typescript,Ee=n.wordCharacters||/[\w$\xa1-\uffff]/,we=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),i=e("keyword c"),r=e("operator"),a={type:"atom",style:"atom"},o={if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:i,delete:i,throw:i,debugger:i,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:i,export:e("export"),import:e("import"),extends:i};if(be){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 d in l)o[d]=l[d]}return o}(),Te=/[+\-*&%=<>!?|~^]/,Se=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ce="([{}])",ke={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},Ie={state:null,column:null,marked:null,cc:null},Ae={name:"this",next:{name:"arguments"}};return _.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new c((e||0)-me,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),d(e,t)),t.tokenize!=s&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==pe?n:(t.lastType="operator"!=pe||"++"!=ge&&"--"!=ge?pe:"incdec",f(t,n,pe,ge,e))},indent:function(t,i){if(t.tokenize==s)return e.Pass;if(t.tokenize!=a)return 0;var r=i&&i.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(i))for(var l=t.cc.length-1;l>=0;--l){var d=t.cc[l];if(d==_)o=o.prev;else if(d!=Y)break}"stat"==o.type&&"}"==r&&(o=o.prev),ve&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var c=o.type,u=r==c;return"vardef"==c?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==c&&"{"==r?o.indented:"form"==c?o.indented+me:"stat"==c?o.indented+("operator"==t.lastType||","==t.lastType?ve||me:0):"switch"!=o.info||u||0==n.doubleIndentSwitch?o.align?o.column+(u?0:1):o.indented+(u?0:me):o.indented+(/^(?:case|default)\b/.test(i)?me:2*me)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:_e?null:"/*",blockCommentEnd:_e?null:"*/",lineComment:_e?null:"//",fold:"brace",helperType:_e?"json":"javascript",jsonldMode:ye,jsonMode:_e}})),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(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n("codemirror/mode/css/css",["../../lib/codemirror"],e):e(CodeMirror)}((function(e){function t(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=!0;return t}function n(e,t){for(var n,i=!1;null!=(n=e.next());){if(i&&"/"==n){t.tokenize=null;break}i="*"==n}return["comment","comment"]}function i(e,t){return e.skipTo("-->")?(e.match("-->"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}e.defineMode("css",(function(t,n){function i(e,t){return h=t,e}function r(e,t){var n=e.next();if(m[n]){var r=m[n](e,t);if(!1!==r)return r}return"@"==n?(e.eatWhile(/[\w\\\-]/),i("def",e.current())):"="==n||("~"==n||"|"==n)&&e.eat("=")?i(null,"compare"):'"'==n||"'"==n?(t.tokenize=a(n),t.tokenize(e,t)):"#"==n?(e.eatWhile(/[\w\\\-]/),i("atom","hash")):"!"==n?(e.match(/^\s*\w*/),i("keyword","important")):/\d/.test(n)||"."==n&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),i("number","unit")):"-"!==n?/[,+>*\/]/.test(n)?i(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?i("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?i(null,n):"u"==n&&e.match("rl(")?(e.backUp(1),t.tokenize=o,i("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),i("property","word")):i(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),i("number","unit")):e.match(/^\w+-/)?i("meta","meta"):void 0}function a(e){return function(t,n){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)&&(n.tokenize=null),i("string","string")}}function o(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=a(")"),i(null,"(")}function s(e,t,n){this.type=e,this.indent=t,this.prev=n}function l(e,t,n){return e.context=new s(n,t.indentation()+g,e.context),n}function d(e){return e.context=e.context.prev,e.context.type}function c(e,t,n){return C[n.context.type](e,t,n)}function u(e,t,n,i){for(var r=i||1;r>0;r--)n.context=n.context.prev;return c(e,t,n)}function f(e){var t=e.current().toLowerCase();p=w.hasOwnProperty(t)?"atom":E.hasOwnProperty(t)?"keyword":"variable"}n.propertyKeywords||(n=e.resolveMode("text/css"));var h,p,g=t.indentUnit,m=n.tokenHooks,v=n.mediaTypes||{},y=n.mediaFeatures||{},_=n.propertyKeywords||{},b=n.nonStandardPropertyKeywords||{},E=n.colorKeywords||{},w=n.valueKeywords||{},T=n.fontProperties||{},S=n.allowNested,C={top:function(e,t,n){if("{"==e)return l(n,t,"block");if("}"==e&&n.context.prev)return d(n);if("@media"==e)return l(n,t,"media");if("@font-face"==e)return"font_face_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(n,t,"at");if("hash"==e)p="builtin";else if("word"==e)p="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(n,t,"interpolation");if(":"==e)return"pseudo";if(S&&"("==e)return l(n,t,"parens")}return n.context.type},block:function(e,t,n){if("word"==e){var i=t.current().toLowerCase();return _.hasOwnProperty(i)?(p="property","maybeprop"):b.hasOwnProperty(i)?(p="string-2","maybeprop"):S?(p=t.match(/^\s*:/,!1)?"property":"tag","block"):(p+=" error","maybeprop")}return"meta"==e?"block":S||"hash"!=e&&"qualifier"!=e?C.top(e,t,n):(p="error","block")},maybeprop:function(e,t,n){return":"==e?l(n,t,"prop"):c(e,t,n)},prop:function(e,t,n){if(";"==e)return d(n);if("{"==e&&S)return l(n,t,"propBlock");if("}"==e||"{"==e)return u(e,t,n);if("("==e)return l(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)f(t);else if("interpolation"==e)return l(n,t,"interpolation")}else p+=" error";return"prop"},propBlock:function(e,t,n){return"}"==e?d(n):"word"==e?(p="property","maybeprop"):n.context.type},parens:function(e,t,n){return"{"==e||"}"==e?u(e,t,n):")"==e?d(n):"("==e?l(n,t,"parens"):("word"==e&&f(t),"parens")},pseudo:function(e,t,n){return"word"==e?(p="variable-3",n.context.type):c(e,t,n)},media:function(e,t,n){if("("==e)return l(n,t,"media_parens");if("}"==e)return u(e,t,n);if("{"==e)return d(n)&&l(n,t,S?"block":"top");if("word"==e){var i=t.current().toLowerCase();p="only"==i||"not"==i||"and"==i?"keyword":v.hasOwnProperty(i)?"attribute":y.hasOwnProperty(i)?"property":"error"}return n.context.type},media_parens:function(e,t,n){return")"==e?d(n):"{"==e||"}"==e?u(e,t,n,2):C.media(e,t,n)},font_face_before:function(e,t,n){return"{"==e?l(n,t,"font_face"):c(e,t,n)},font_face:function(e,t,n){return"}"==e?d(n):"word"==e?(p=T.hasOwnProperty(t.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},keyframes:function(e,t,n){return"word"==e?(p="variable","keyframes"):"{"==e?l(n,t,"top"):c(e,t,n)},at:function(e,t,n){return";"==e?d(n):"{"==e||"}"==e?u(e,t,n):("word"==e?p="tag":"hash"==e&&(p="builtin"),"at")},interpolation:function(e,t,n){return"}"==e?d(n):"{"==e||";"==e?u(e,t,n):("variable"!=e&&(p="error"),"interpolation")}};return{startState:function(e){return{tokenize:null,state:"top",context:new s("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||r)(e,t);return n&&"object"==typeof n&&(h=n[1],n=n[0]),p=n,t.state=C[t.state](h,e,t),p},indent:function(e,t){var n=e.context,i=t&&t.charAt(0),r=n.indent;return"prop"==n.type&&("}"==i||")"==i)&&(n=n.prev),n.prev&&("}"==i&&("block"==n.type||"top"==n.type||"interpolation"==n.type||"font_face"==n.type)||")"==i&&("parens"==n.type||"media_parens"==n.type)||"{"==i&&("at"==n.type||"media"==n.type))&&(r=n.indent-g,n=n.prev),r},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}}));var r=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(r),o=["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"],s=t(o),l=["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(l),c=["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"],u=t(c),f=["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"],h=t(f),p=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","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","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","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","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","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","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","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-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","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","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","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","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","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","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","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","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],g=t(p),m=t(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),v=r.concat(o).concat(l).concat(c).concat(f).concat(p);e.registerHelper("hintWords","css",v),e.defineMIME("text/css",{mediaTypes:a,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:u,colorKeywords:h,valueKeywords:g,fontProperties:m,tokenHooks:{"<":function(e,t){return!!e.match("!--")&&(t.tokenize=i,i(e,t))},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:u,colorKeywords:h,valueKeywords:g,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(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:a,mediaFeatures:s,propertyKeywords:d,nonStandardPropertyKeywords:u,colorKeywords:h,valueKeywords:g,fontProperties:m,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(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(t("../../lib/codemirror"),t("../xml/xml"),t("../javascript/javascript"),t("../css/css")):"function"==typeof n&&n.amd?n("codemirror/mode/htmlmixed/htmlmixed",["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}((function(e){e.defineMode("htmlmixed",(function(t,n){function i(e,t){var n=t.htmlState.tagName;n&&(n=n.toLowerCase());var i=s.token(e,t.htmlState);if("script"==n&&/\btag\b/.test(i)&&">"==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]:"")&&/[\"\']/.test(r.charAt(0))&&(r=r.slice(1,r.length-1));for(var c=0;c<d.length;++c){var u=d[c];if("string"==typeof u.matches?r==u.matches:u.matches.test(r)){u.mode&&(t.token=a,t.localMode=u.mode,t.localState=u.mode.startState&&u.mode.startState(s.indent(t.htmlState,"")));break}}}else"style"==n&&/\btag\b/.test(i)&&">"==e.current()&&(t.token=o,t.localMode=l,t.localState=l.startState(s.indent(t.htmlState,"")));return i}function r(e,t,n){var i=e.current(),r=i.search(t);return r>-1?e.backUp(i.length-r):i.match(/<\/?$/)&&(e.backUp(i.length),e.match(t,!1)||e.match(i)),n}function a(e,t){return e.match(/^<\/\s*script\s*>/i,!1)?(t.token=i,t.localState=t.localMode=null,i(e,t)):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=i,t.localState=t.localMode=null,i(e,t)):r(e,/<\/\s*style\s*>/,l.token(e,t.localState))}var s=e.getMode(t,{name:"xml",htmlMode:!0,multilineTagIndentFactor:n.multilineTagIndentFactor,multilineTagIndentPastTag:n.multilineTagIndentPastTag}),l=e.getMode(t,"css"),d=[],c=n&&n.scriptTypes;if(d.push({matches:/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^$/i,mode:e.getMode(t,"javascript")}),c)for(var u=0;u<c.length;++u){var f=c[u];d.push({matches:f.matches,mode:f.mode&&e.getMode(t,f.mode)})}return d.push({matches:/./,mode:e.getMode(t,"text/plain")}),{startState:function(){return{token:i,localMode:null,localState:null,htmlState:s.startState()}},copyState:function(t){if(t.localState)var n=e.copyState(t.localMode,t.localState);return{token:t.token,localMode:t.localMode,localState:n,htmlState:e.copyState(s,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?s.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):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(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n("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 n(e,t,n,i){this.line=t,this.ch=n,this.cm=e,this.text=e.getLine(t),this.min=i?i.from:e.firstLine(),this.max=i?i.to-1:e.lastLine()}function i(e,t){var n=e.cm.getTokenTypeAt(f(e.line,t));return n&&/\btag\b/.test(n)}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(i(e,t+1)){var n=e.text.lastIndexOf("/",t),a=n>-1&&!/\S/.test(e.text.slice(n+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(i(e,t+1)){p.lastIndex=t,e.ch=t;var n=p.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function l(e){for(;;){p.lastIndex=e.ch;var t=p.exec(e.text);if(!t){if(r(e))continue;return}if(i(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}function d(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(-1==t){if(a(e))continue;return}if(i(e,t+1)){var n=e.text.lastIndexOf("/",t),r=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,r?"selfClose":"regular"}e.ch=t}}function c(e,t){for(var n=[];;){var i,r=l(e),a=e.line,s=e.ch-(r?r[0].length:0);if(!r||!(i=o(e)))return;if("selfClose"!=i)if(r[1]){for(var d=n.length-1;d>=0;--d)if(n[d]==r[2]){n.length=d;break}if(d<0&&(!t||t==r[2]))return{tag:r[2],from:f(a,s),to:f(e.line,e.ch)}}else n.push(r[2])}}function u(e,t){for(var n=[];;){var i=d(e);if(!i)return;if("selfClose"!=i){var r=e.line,a=e.ch,o=s(e);if(!o)return;if(o[1])n.push(o[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==o[2]){n.length=l;break}if(l<0&&(!t||t==o[2]))return{tag:o[2],from:f(e.line,e.ch),to:f(r,a)}}}else s(e)}}var f=e.Pos,h="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",p=new RegExp("<(/?)(["+h+"]["+(h+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040")+"]*)","g");e.registerHelper("fold","xml",(function(e,t){for(var i=new n(e,t.line,0);;){var r,a=l(i);if(!a||i.line!=t.line||!(r=o(i)))return;if(!a[1]&&"selfClose"!=r){t=f(i.line,i.ch);var s=c(i,a[2]);return s&&{from:t,to:s.from}}}})),e.findMatchingTag=function(e,i,r){var a=new n(e,i.line,i.ch,r);if(-1!=a.text.indexOf(">")||-1!=a.text.indexOf("<")){var l=o(a),d=l&&f(a.line,a.ch),h=l&&s(a);if(l&&h&&!(t(a,i)>0)){var p={from:f(a.line,a.ch),to:d,tag:h[2]};return"selfClose"==l?{open:p,close:null,at:"open"}:h[1]?{open:u(a,h[2]),close:p,at:"close"}:{open:p,close:c(a=new n(e,d.line,d.ch,r),h[2]),at:"open"}}}},e.findEnclosingTag=function(e,t,i){for(var r=new n(e,t.line,t.ch,i);;){var a=u(r);if(!a)break;var o=c(new n(e,t.line,t.ch,i),a.tag);if(o)return{open:a,close:o}}},
e.scanForClosingTag=function(e,t,i,r){return c(new n(e,t.line,t.ch,r?{from:0,to:r}:null),i)}})),function(e){"object"==typeof exports&&"object"==typeof module?e(t("../../lib/codemirror"),t("../fold/xml-fold")):"function"==typeof n&&n.amd?n("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 n=t.listSelections(),s=[],l=0;l<n.length;l++){if(!n[l].empty())return e.Pass;var d=n[l].head,c=t.getTokenAt(d),u=e.innerMode(t.getMode(),c.state),f=u.state;if("xml"!=u.mode.name||!f.tagName)return e.Pass;var h=t.getOption("autoCloseTags"),p="html"==u.mode.configuration,g="object"==typeof h&&h.dontCloseTags||p&&a,m="object"==typeof h&&h.indentTags||p&&o,v=f.tagName;c.end>d.ch&&(v=v.slice(0,v.length-c.end+d.ch));var y=v.toLowerCase();if(!v||"string"==c.type&&(c.end!=d.ch||!/[\"\']/.test(c.string.charAt(c.string.length-1))||1==c.string.length)||"tag"==c.type&&"closeTag"==f.type||c.string.indexOf("/")==c.string.length-1||g&&i(g,y)>-1||r(t,v,d,f,!0))return e.Pass;var _=m&&i(m,y)>-1;s[l]={indent:_,text:">"+(_?"\n\n":"")+"</"+v+">",newPos:_?e.Pos(d.line+1,0):e.Pos(d.line,d.ch+1)}}for(l=n.length-1;l>=0;l--){var b=s[l];t.replaceRange(b.text,n[l].head,n[l].anchor,"+insert");var E=t.listSelections().slice(0);E[l]={head:b.newPos,anchor:b.newPos},t.setSelections(E),b.indent&&(t.indentLine(b.newPos.line,null,!0),t.indentLine(b.newPos.line+1,null,!0))}}function n(t){if(t.getOption("disableInput"))return e.Pass;for(var n=t.listSelections(),i=[],a=0;a<n.length;a++){if(!n[a].empty())return e.Pass;var o=n[a].head,s=t.getTokenAt(o),l=e.innerMode(t.getMode(),s.state),d=l.state;if("string"==s.type||"<"!=s.string.charAt(0)||s.start!=o.ch-1)return e.Pass;if("xml"!=l.mode.name)if("htmlmixed"==t.getMode().name&&"javascript"==l.mode.name)i[a]="/script>";else{if("htmlmixed"!=t.getMode().name||"css"!=l.mode.name)return e.Pass;i[a]="/style>"}else{if(!d.context||!d.context.tagName||r(t,d.context.tagName,o,d))return e.Pass;i[a]="/"+d.context.tagName+">"}}t.replaceSelections(i),n=t.listSelections();for(a=0;a<n.length;a++)(a==n.length-1||n[a].head.line<n[a+1].head.line)&&t.indentLine(n[a].head.line)}function i(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,i=e.length;n<i;++n)if(e[n]==t)return n;return-1}function r(t,n,i,r,a){if(!e.scanForClosingTag)return!1;var o=Math.min(t.lastLine()+1,i.line+500),s=e.scanForClosingTag(t,i,null,o);if(!s||s.tag!=n)return!1;for(var l=r.context,d=a?1:0;l&&l.tagName==n;l=l.prev)++d;i=s.to;for(var c=1;c<d;c++){var u=e.scanForClosingTag(t,i,null,o);if(!u||u.tag!=n)return!1;i=u.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 a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],o=["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"]})),function(e){"object"==typeof exports&&"object"==typeof module?e(t("../../lib/codemirror"),t("../fold/xml-fold")):"function"==typeof n&&n.amd?n("codemirror/addon/edit/matchtags",["../../lib/codemirror","../fold/xml-fold"],e):e(CodeMirror)}((function(e){"use strict";function t(e){e.state.tagHit&&e.state.tagHit.clear(),e.state.tagOther&&e.state.tagOther.clear(),e.state.tagHit=e.state.tagOther=null}function n(n){n.state.failedTagMatch=!1,n.operation((function(){if(t(n),!n.somethingSelected()){var i=n.getCursor(),r=n.getViewport();r.from=Math.min(r.from,i.line),r.to=Math.max(i.line+1,r.to);var a=e.findMatchingTag(n,i,r);if(a){if(n.state.matchBothTags){var o="open"==a.at?a.open:a.close;o&&(n.state.tagHit=n.markText(o.from,o.to,{className:"CodeMirror-matchingtag"}))}var s="close"==a.at?a.open:a.close;s?n.state.tagOther=n.markText(s.from,s.to,{className:"CodeMirror-matchingtag"}):n.state.failedTagMatch=!0}}}))}function i(e){e.state.failedTagMatch&&n(e)}e.defineOption("matchTags",!1,(function(r,a,o){o&&o!=e.Init&&(r.off("cursorActivity",n),r.off("viewportChange",i),t(r)),a&&(r.state.matchBothTags="object"==typeof a&&a.bothTags,r.on("cursorActivity",n),r.on("viewportChange",i),n(r))})),e.commands.toMatchingTag=function(t){var n=e.findMatchingTag(t,t.getCursor());if(n){var i="close"==n.at?n.open:n.close;i&&t.extendSelection(i.to,i.from)}}})),function(e){"object"==typeof exports&&"object"==typeof module?e(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n("codemirror/addon/hint/xml-hint",["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(t,i){var r=i&&i.schemaInfo,a=i&&i.quoteChar||'"';if(r){var o=t.getCursor(),s=t.getTokenAt(o),l=e.innerMode(t.getMode(),s.state);if("xml"==l.mode.name){var d,c,u=[],f=!1,h=/\btag\b/.test(s.type),p=h&&/^\w/.test(s.string);if(p){var g=t.getLine(o.line).slice(Math.max(0,s.start-2),s.start),m=/<\/$/.test(g)?"close":/<$/.test(g)?"open":null;m&&(c=s.start-("close"==m?2:1))}else h&&"<"==s.string?m="open":h&&"</"==s.string&&(m="close");if(!h&&!l.state.tagName||m){p&&(d=s.string),f=m;var v=l.state.context,y=v&&r[v.tagName],_=v?y&&y.children:r["!top"];if(_&&"close"!=m)for(var b=0;b<_.length;++b)(!d||0==_[b].lastIndexOf(d,0))&&u.push("<"+_[b]);else if("close"!=m)for(var E in r)r.hasOwnProperty(E)&&"!top"!=E&&"!attrs"!=E&&(!d||0==E.lastIndexOf(d,0))&&u.push("<"+E);v&&(!d||"close"==m&&0==v.tagName.lastIndexOf(d,0))&&u.push("</"+v.tagName+">")}else{var w=(y=r[l.state.tagName])&&y.attrs,T=r["!attrs"];if(!w&&!T)return;if(w){if(T){var S={};for(var C in T)T.hasOwnProperty(C)&&(S[C]=T[C]);for(var C in w)w.hasOwnProperty(C)&&(S[C]=w[C]);w=S}}else w=T;if("string"==s.type||"="==s.string){var k,I=(g=t.getRange(n(o.line,Math.max(0,o.ch-60)),n(o.line,"string"==s.type?s.start:s.end))).match(/([^\s\u00a0=<>\"\']+)=$/);if(!I||!w.hasOwnProperty(I[1])||!(k=w[I[1]]))return;if("function"==typeof k&&(k=k.call(this,t)),"string"==s.type){d=s.string;var A=0;/['"]/.test(s.string.charAt(0))&&(a=s.string.charAt(0),d=s.string.slice(1),A++);var x=s.string.length;/['"]/.test(s.string.charAt(x-1))&&(a=s.string.charAt(x-1),d=s.string.substr(A,x-2)),f=!0}for(b=0;b<k.length;++b)(!d||0==k[b].lastIndexOf(d,0))&&u.push(a+k[b]+a)}else for(var D in"attribute"==s.type&&(d=s.string,f=!0),w)w.hasOwnProperty(D)&&(!d||0==D.lastIndexOf(d,0))&&u.push(D)}return{list:u,from:f?n(o.line,null==c?s.start:c):o,to:f?n(o.line,s.end):o}}}}var n=e.Pos;e.registerHelper("hint","xml",t)})),function(e){"object"==typeof exports&&"object"==typeof module?e(t("../../lib/codemirror","./xml-hint")):"function"==typeof n&&n.amd?n("codemirror/addon/hint/html-hint",["../../lib/codemirror","./xml-hint"],e):e(CodeMirror)}((function(e){"use strict";function t(e){for(var t in u)u.hasOwnProperty(t)&&(e.attrs[t]=u[t])}function n(t,n){var i={schemaInfo:c};if(n)for(var r in n)i[r]=n[r];return e.hint.xml(t,i)}var i="ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" "),r=["_blank","_self","_top","_parent"],a=["ascii","utf-8","utf-16","latin1","latin1"],o=["get","post","put","delete"],s=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],l=["all","screen","print","embossed","braille","handheld","print","projection","screen","tty","tv","speech","3d-glasses","resolution [>][<][=] [X]","device-aspect-ratio: X/Y","orientation:portrait","orientation:landscape","device-height: [X]","device-width: [X]"],d={attrs:{}},c={a:{attrs:{href:null,ping:null,type:null,media:l,target:r,hreflang:i}},abbr:d,acronym:d,address:d,applet:d,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:l,hreflang:i,type:null,shape:["default","rect","circle","poly"]}},article:d,aside:d,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["","autoplay"],loop:["","loop"],controls:["","controls"]}},b:d,base:{attrs:{href:null,target:r}},basefont:d,bdi:d,bdo:d,big:d,blockquote:{attrs:{cite:null}},body:d,br:d,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["","autofocus"],disabled:["","autofocus"],formenctype:s,formmethod:o,formnovalidate:["","novalidate"],formtarget:r,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:d,center:d,cite:d,code:d,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["","disabled"],checked:["","checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["","disabled"],multiple:["","multiple"]}},datalist:{attrs:{data:null}},dd:d,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["","open"]}},dfn:d,dir:d,div:d,dl:d,dt:d,em:d,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["","disabled"],form:null,name:null}},figcaption:d,figure:d,font:d,footer:d,form:{attrs:{action:null,name:null,"accept-charset":a,autocomplete:["on","off"],enctype:s,method:o,novalidate:["","novalidate"],target:r}},frame:d,frameset:d,h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,head:{attrs:{},children:["title","base","link","style","meta","script","noscript","command"]},header:d,hgroup:d,hr:d,html:{attrs:{manifest:null},children:["head","body"]},i:d,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["","seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["","autofocus"],checked:["","checked"],disabled:["","disabled"],formenctype:s,formmethod:o,formnovalidate:["","novalidate"],formtarget:r,multiple:["","multiple"],readonly:["","readonly"],required:["","required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:d,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["","autofocus"],disabled:["","disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:d,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:i,media:l,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:d,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:a,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:d,noframes:d,noscript:d,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["","typemustmatch"]}},ol:{attrs:{reversed:["","reversed"],start:null,type:["1","a","A","i","I"]}},optgroup:{attrs:{disabled:["","disabled"],label:null}},option:{attrs:{disabled:["","disabled"],label:null,selected:["","selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:d,param:{attrs:{name:null,value:null}},pre:d,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:d,rt:d,ruby:d,s:d,samp:d,script:{attrs:{type:["text/javascript"],src:null,async:["","async"],defer:["","defer"],charset:a}},section:d,select:{attrs:{form:null,name:null,size:null,autofocus:["","autofocus"],disabled:["","disabled"],multiple:["","multiple"]}},small:d,source:{attrs:{src:null,type:null,media:null}},span:d,strike:d,strong:d,style:{attrs:{type:["text/css"],media:l,scoped:null}},sub:d,summary:d,sup:d,table:d,tbody:d,td:{attrs:{colspan:null,rowspan:null,headers:null}},textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["","autofocus"],disabled:["","disabled"],readonly:["","readonly"],required:["","required"],wrap:["soft","hard"]}},tfoot:d,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:d,time:{attrs:{datetime:null}},title:d,tr:d,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:i}},tt:d,u:d,ul:d,var:d,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["","autoplay"],mediagroup:["movie"],muted:["","muted"],controls:["","controls"]}},wbr:d},u={accesskey:["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","0","1","2","3","4","5","6","7","8","9"],class:null,contenteditable:["true","false"],contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["en","es"],spellcheck:["true","false"],style:null,tabindex:["1","2","3","4","5","6","7","8","9"],title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"]};for(var f in t(d),c)c.hasOwnProperty(f)&&c[f]!=d&&t(c[f]);e.htmlSchema=c,e.registerHelper("hint","html",n)})),function(e){"object"==typeof exports&&"object"==typeof module?e(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n("codemirror/addon/hint/show-hint",["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(e,t){this.cm=e,this.options=this.buildOptions(t),this.widget=this.onClose=null}function n(e){return"string"==typeof e?e:e.text}function i(e,t){function n(e,n){var r;r="string"!=typeof n?function(e){return n(e,t)}:i.hasOwnProperty(n)?i[n]:n,a[e]=r}var i={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close},r=e.options.customKeys,a=r?{}:i;if(r)for(var o in r)r.hasOwnProperty(o)&&n(o,r[o]);var s=e.options.extraKeys;if(s)for(var o in s)s.hasOwnProperty(o)&&n(o,s[o]);return a}function r(e,t){for(;t&&t!=e;){if("LI"===t.nodeName.toUpperCase()&&t.parentNode==e)return t;t=t.parentNode}}function a(t,a){this.completion=t,this.data=a;var l=this,d=t.cm,c=this.hints=document.createElement("ul");c.className="CodeMirror-hints",this.selectedHint=a.selectedHint||0;for(var u=a.list,f=0;f<u.length;++f){var h=c.appendChild(document.createElement("li")),p=u[f],g=o+(f!=this.selectedHint?"":" "+s);null!=p.className&&(g=p.className+" "+g),h.className=g,p.render?p.render(h,a,p):h.appendChild(document.createTextNode(p.displayText||n(p))),h.hintId=f}var m=d.cursorCoords(t.options.alignWithWord?a.from:null),v=m.left,y=m.bottom,_=!0;c.style.left=v+"px",c.style.top=y+"px";var b=window.innerWidth||Math.max(document.body.offsetWidth,document.documentElement.offsetWidth),E=window.innerHeight||Math.max(document.body.offsetHeight,document.documentElement.offsetHeight);(t.options.container||document.body).appendChild(c);var w=c.getBoundingClientRect();if(w.bottom-E>0){var T=w.bottom-w.top;if(m.top-(m.bottom-w.top)-T>0)c.style.top=(y=m.top-T)+"px",_=!1;else if(T>E){c.style.height=E-5+"px",c.style.top=(y=m.bottom-w.top)+"px";var S=d.getCursor();a.from.ch!=S.ch&&(m=d.cursorCoords(S),c.style.left=(v=m.left)+"px",w=c.getBoundingClientRect())}}var C,k=w.left-b;(k>0&&(w.right-w.left>b&&(c.style.width=b-5+"px",k-=w.right-w.left-b),c.style.left=(v=m.left-k)+"px"),d.addKeyMap(this.keyMap=i(t,{moveFocus:function(e,t){l.changeActive(l.selectedHint+e,t)},setFocus:function(e){l.changeActive(e)},menuSize:function(){return l.screenAmount()},length:u.length,close:function(){t.close()},pick:function(){l.pick()},data:a})),t.options.closeOnUnfocus)&&(d.on("blur",this.onBlur=function(){C=setTimeout((function(){t.close()}),100)}),d.on("focus",this.onFocus=function(){clearTimeout(C)}));var I=d.getScrollInfo();return d.on("scroll",this.onScroll=function(){var e=d.getScrollInfo(),n=d.getWrapperElement().getBoundingClientRect(),i=y+I.top-e.top,r=i-(window.pageYOffset||(document.documentElement||document.body).scrollTop);if(_||(r+=c.offsetHeight),r<=n.top||r>=n.bottom)return t.close();c.style.top=i+"px",c.style.left=v+I.left-e.left+"px"}),e.on(c,"dblclick",(function(e){var t=r(c,e.target||e.srcElement);t&&null!=t.hintId&&(l.changeActive(t.hintId),l.pick())})),e.on(c,"click",(function(e){var n=r(c,e.target||e.srcElement);n&&null!=n.hintId&&(l.changeActive(n.hintId),t.options.completeOnSingleClick&&l.pick())})),e.on(c,"mousedown",(function(){setTimeout((function(){d.focus()}),20)})),e.signal(a,"select",u[0],c.firstChild),!0}var o="CodeMirror-hint",s="CodeMirror-hint-active";e.showHint=function(e,t,n){if(!t)return e.showHint(n);n&&n.async&&(t.async=!0);var i={hint:t};if(n)for(var r in n)i[r]=n[r];return e.showHint(i)},e.defineExtension("showHint",(function(n){if(!(this.listSelections().length>1||this.somethingSelected())){this.state.completionActive&&this.state.completionActive.close();var i=this.state.completionActive=new t(this,n),r=i.options.hint;if(r){if(e.signal(this,"startCompletion",this),!r.async)return i.showHints(r(this,i.options));r(this,(function(e){i.showHints(e)}),i.options)}}})),t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.widget&&this.widget.close(),this.onClose&&this.onClose(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,i){var r=t.list[i];r.hint?r.hint(this.cm,t,r):this.cm.replaceRange(n(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),this.close()},showHints:function(e){if(!e||!e.list.length||!this.active())return this.close();this.options.completeSingle&&1==e.list.length?this.pick(e,0):this.showWidget(e)},showWidget:function(t){function n(){l||(l=!0,c.close(),c.cm.off("cursorActivity",s),t&&e.signal(t,"close"))}function i(){if(!l){e.signal(t,"update");var n=c.options.hint;n.async?n(c.cm,r,c.options):r(n(c.cm,c.options))}}function r(e){if(t=e,!l)return t&&t.list.length?(c.widget&&c.widget.close(),void(c.widget=new a(c,t))):n()}function o(){d&&(g(d),d=0)}function s(){o();var e=c.cm.getCursor(),t=c.cm.getLine(e.line);e.line!=f.line||t.length-e.ch!=h-f.ch||e.ch<f.ch||c.cm.somethingSelected()||e.ch&&u.test(t.charAt(e.ch-1))?c.close():(d=p(i),c.widget&&c.widget.close())}this.widget=new a(this,t),e.signal(t,"shown");var l,d=0,c=this,u=this.options.closeCharacters,f=this.cm.getCursor(),h=this.cm.getLine(f.line).length,p=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},g=window.cancelAnimationFrame||clearTimeout;this.cm.on("cursorActivity",s),this.onClose=n},buildOptions:function(e){var t=this.cm.options.hintOptions,n={};for(var i in l)n[i]=l[i];if(t)for(var i in t)void 0!==t[i]&&(n[i]=t[i]);if(e)for(var i in e)void 0!==e[i]&&(n[i]=e[i]);return n}},a.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm;this.completion.options.closeOnUnfocus&&(e.off("blur",this.onBlur),e.off("focus",this.onFocus)),e.off("scroll",this.onScroll)}},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(t,n){if(t>=this.data.list.length?t=n?this.data.list.length-1:0:t<0&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var i=this.hints.childNodes[this.selectedHint];i.className=i.className.replace(" "+s,""),(i=this.hints.childNodes[this.selectedHint=t]).className+=" "+s,i.offsetTop<this.hints.scrollTop?this.hints.scrollTop=i.offsetTop-3:i.offsetTop+i.offsetHeight>this.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=i.offsetTop+i.offsetHeight-this.hints.clientHeight+3),e.signal(this.data,"select",this.data.list[this.selectedHint],i)}},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1}},e.registerHelper("hint","auto",(function(t,n){var i,r=t.getHelpers(t.getCursor(),"hint");if(r.length)for(var a=0;a<r.length;a++){var o=r[a](t,n);if(o&&o.list.length)return o}else if(i=t.getHelper(t.getCursor(),"hintWords")){if(i)return e.hint.fromList(t,{words:i})}else if(e.hint.anyword)return e.hint.anyword(t,n)})),e.registerHelper("hint","fromList",(function(t,n){for(var i=t.getCursor(),r=t.getTokenAt(i),a=[],o=0;o<n.words.length;o++){var s=n.words[o];s.slice(0,r.string.length)==r.string&&a.push(s)}if(a.length)return{list:a,from:e.Pos(i.line,r.start),to:e.Pos(i.line,r.end)}})),e.commands.autocomplete=e.showHint;var l={hint:e.hint.auto,completeSingle:!0,alignWithWord:!0,closeCharacters:/[\s()\[\]{};:>,]/,closeOnUnfocus:!0,completeOnSingleClick:!1,container:null,customKeys:null,extraKeys:null};e.defineOption("hintOptions",null)})),function(e){"object"==typeof exports&&"object"==typeof module?e(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n("codemirror/addon/hint/lint",["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";function t(t,n){function i(t){if(!r.parentNode)return e.off(document,"mousemove",i);r.style.top=Math.max(0,t.clientY-r.offsetHeight-5)+"px",r.style.left=t.clientX+5+"px"}var r=document.createElement("div");return r.className="CodeMirror-lint-tooltip",r.appendChild(n.cloneNode(!0)),document.body.appendChild(r),e.on(document,"mousemove",i),i(t),null!=r.style.opacity&&(r.style.opacity=1),r}function n(e){e.parentNode&&e.parentNode.removeChild(e)}function i(e){e.parentNode&&(null==e.style.opacity&&n(e),e.style.opacity=0,setTimeout((function(){n(e)}),600))}function r(n,r,a){function o(){e.off(a,"mouseout",o),s&&(i(s),s=null)}var s=t(n,r),l=setInterval((function(){if(s)for(var e=a;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){o();break}}if(!s)return clearInterval(l)}),400);e.on(a,"mouseout",o)}function a(e,t,n){this.marked=[],this.options=t,this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){m(e,t)}}function o(t,n){if(n instanceof Function)return{getAnnotations:n};if(n&&!0!==n||(n={}),n.getAnnotations||(n.getAnnotations=t.getHelper(e.Pos(0,0),"lint")),!n.getAnnotations)throw new Error("Required option 'getAnnotations' missing (lint addon)");return n}function s(e){var t=e.state.lint;t.hasGutter&&e.clearGutter(v);for(var n=0;n<t.marked.length;++n)t.marked[n].clear();t.marked.length=0}function l(t,n,i,a){var o=document.createElement("div"),s=o;return o.className="CodeMirror-lint-marker-"+n,i&&((s=o.appendChild(document.createElement("div"))).className="CodeMirror-lint-marker-multiple"),0!=a&&e.on(s,"mouseover",(function(e){r(e,t,s)})),o}function d(e,t){return"error"==e?e:t}function c(e){for(var t=[],n=0;n<e.length;++n){var i=e[n],r=i.from.line;(t[r]||(t[r]=[])).push(i)}return t}function u(e){var t=e.severity;t||(t="error");var n=document.createElement("div");return n.className="CodeMirror-lint-message-"+t,n.appendChild(document.createTextNode(e.message)),n}function f(e){var t=e.state.lint.options,n=t.options||t;t.async||t.getAnnotations.async?t.getAnnotations(e.getValue(),h,n,e):h(e,t.getAnnotations(e.getValue(),n,e))}function h(e,t){s(e);for(var n=e.state.lint,i=n.options,r=c(t),a=0;a<r.length;++a){var o=r[a];if(o){for(var f=null,h=n.hasGutter&&document.createDocumentFragment(),p=0;p<o.length;++p){var g=o[p],m=g.severity;m||(m="error"),f=d(f,m),i.formatAnnotation&&(g=i.formatAnnotation(g)),n.hasGutter&&h.appendChild(u(g)),g.to&&n.marked.push(e.markText(g.from,g.to,{className:"CodeMirror-lint-mark-"+m,__annotation:g}))}n.hasGutter&&e.setGutterMarker(a,v,l(h,f,o.length>1,n.options.tooltips))}}i.onUpdateLinting&&i.onUpdateLinting(t,r,e)}function p(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){f(e)}),t.options.delay||500))}function g(e,t){var n=t.target||t.srcElement;r(t,u(e),n)}function m(e,t){var n=t.target||t.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className))for(var i=n.getBoundingClientRect(),r=(i.left+i.right)/2,a=(i.top+i.bottom)/2,o=e.findMarksAt(e.coordsChar({left:r,top:a},"client")),s=0;s<o.length;++s){var l=o[s].__annotation;if(l)return g(l,t)}}var v="CodeMirror-lint-markers";e.defineOption("lint",!1,(function(t,n,i){if(i&&i!=e.Init&&(s(t),t.off("change",p),e.off(t.getWrapperElement(),"mouseover",t.state.lint.onMouseOver),clearTimeout(t.state.lint.timeout),delete t.state.lint),n){for(var r=t.getOption("gutters"),l=!1,d=0;d<r.length;++d)r[d]==v&&(l=!0);var c=t.state.lint=new a(t,o(t,n),l);t.on("change",p),0!=c.options.tooltips&&e.on(t.getWrapperElement(),"mouseover",c.onMouseOver),f(t)}}))})),function(e){"object"==typeof exports&&"object"==typeof module?e(t("../../lib/codemirror")):"function"==typeof n&&n.amd?n("codemirror/addon/hint/html-lint",["../../lib/codemirror"],e):e(CodeMirror)}((function(e){"use strict";var n=function(e){function t(e,t){return Array(e+1).join(t||" ")}var n={version:"0.9.13",release:"20160501",rules:{},defaultRuleset:{"tagname-lowercase":!0,"attr-lowercase":!0,"attr-value-double-quotes":!0,"doctype-first":!0,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0,"title-require":!0},addRule:function(e){n.rules[e.id]=e},verify:function(t,r){(r===e||0===Object.keys(r).length)&&(r=n.defaultRuleset),t=t.replace(/^\s*<!--\s*htmlhint\s+([^\r\n]+?)\s*-->/i,(function(t,n){return r===e&&(r={}),n.replace(/(?:^|,)\s*([^:,]+)\s*(?:\:\s*([^,\s]+))?/g,(function(t,n,i){"false"===i?i=!1:"true"===i&&(i=!0),r[n]=i===e||i})),""}));var a,o=new i,s=new n.Reporter(t,r),l=n.rules;for(var d in r)(a=l[d])!==e&&!1!==r[d]&&a.init(o,s,r[d]);return o.parse(t),s.messages},format:function(e,n){var i=[],r={white:"",grey:"",red:"",reset:""};(n=n||{}).colors&&(r.white="\x1b[37m",r.grey="\x1b[90m",r.red="\x1b[31m",r.reset="\x1b[39m");var a=n.indent||0;return e.forEach((function(e){var n=40,o=n+20,s=e.evidence,l=e.line,d=e.col,c=s.length,u=d>n+1?d-n:1,f=s.length>d+o?d+o:c;n+1>d&&(f+=n-d+1),s=s.replace(/\t/g," ").substring(u-1,f),u>1&&(s="..."+s,u-=3),c>f&&(s+="..."),i.push(r.white+t(a)+"L"+l+" |"+r.grey+s+r.reset);var h=d-u,p=s.substring(0,h).match(/[^\u0000-\u00ff]/g);null!==p&&(h+=p.length),i.push(r.white+t(a)+t((l+"").length+3+h)+"^ "+r.red+e.message+" ("+e.rule.id+")"+r.reset)})),i}};return n}();"object"==typeof exports&&exports&&(exports.HTMLHint=n),function(e){var t=function(){var e=this;e._init.apply(e,arguments)};t.prototype={_init:function(e,t){var n=this;n.html=e,n.lines=e.split(/\r?\n/);var i=e.match(/\r?\n/);n.brLen=null!==i?i[0].length:0,n.ruleset=t,n.messages=[]},error:function(e,t,n,i,r){this.report("error",e,t,n,i,r)},warn:function(e,t,n,i,r){this.report("warning",e,t,n,i,r)},info:function(e,t,n,i,r){this.report("info",e,t,n,i,r)},report:function(e,t,n,i,r,a){for(var o,s,l=this,d=l.lines,c=l.brLen,u=n-1,f=d.length;f>u&&(i>(s=(o=d[u]).length)&&f>n);u++)n++,1!==(i-=s)&&(i-=c);l.messages.push({type:e,message:t,raw:a,evidence:o,line:n,col:i,rule:{id:r.id,description:r.description,link:"https://github.com/yaniswang/HTMLHint/wiki/"+r.id}})}},e.Reporter=t}(n);var i=function(e){var t=function(){var e=this;e._init.apply(e,arguments)};return t.prototype={_init:function(){var e=this;e._listeners={},e._mapCdataTags=e.makeMap("script,style"),e._arrBlocks=[],e.lastEvent=null},makeMap:function(e){for(var t={},n=e.split(","),i=0;n.length>i;i++)t[n[i]]=!0;return t},parse:function(t){function n(t,n,i,r){var a=i-y+1;for(r===e&&(r={}),r.raw=n,r.pos=i,r.line=_,r.col=a,b.push(r),u.fire(t,r);g.exec(n);)_++,y=i+g.lastIndex}var i,r,a,o,s,l,d,c,u=this,f=u._mapCdataTags,h=/<(?:\/([^\s>]+)\s*|!--([\s\S]*?)--|!([^>]*?)|([\w\-:]+)((?:\s+[^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s"'>]*))?)*?)\s*(\/?))>/g,p=/\s*([^\s"'>\/=\x00-\x0F\x7F\x80-\x9F]+)(?:\s*=\s*(?:(")([^"]*)"|(')([^']*)'|([^\s"'>]*)))?/g,g=/\r?\n/g,m=0,v=0,y=0,_=1,b=u._arrBlocks;for(u.fire("start",{pos:0,line:1,col:1});i=h.exec(t);)if((r=i.index)>m&&(c=t.substring(m,r),s?d.push(c):n("text",c,m)),m=h.lastIndex,!(a=i[1])||(s&&a===s&&(n("cdata",c=d.join(""),v,{tagName:s,attrs:l}),s=null,l=null,d=null),s))if(s)d.push(i[0]);else if(a=i[4]){o=[];for(var E,w=i[5],T=0;E=p.exec(w);){var S=E[1],C=E[2]?E[2]:E[4]?E[4]:"",k=E[3]?E[3]:E[5]?E[5]:E[6]?E[6]:"";o.push({name:S,value:k,quote:C,index:E.index,raw:E[0]}),T+=E[0].length}T===w.length?(n("tagstart",i[0],r,{tagName:a,attrs:o,close:i[6]}),f[a]&&(s=a,l=o.concat(),d=[],v=m)):n("text",i[0],r)}else(i[2]||i[3])&&n("comment",i[0],r,{content:i[2]||i[3],long:!!i[2]});else n("tagend",i[0],r,{tagName:a});t.length>m&&n("text",c=t.substring(m,t.length),m),u.fire("end",{pos:m,line:_,col:t.length-y+1})},addListener:function(t,n){for(var i,r=this._listeners,a=t.split(/[,\s]/),o=0,s=a.length;s>o;o++)r[i=a[o]]===e&&(r[i]=[]),r[i].push(n)},fire:function(t,n){n===e&&(n={}),n.type=t;var i=this,r=[],a=i._listeners[t],o=i._listeners.all;a!==e&&(r=r.concat(a)),o!==e&&(r=r.concat(o));var s=i.lastEvent;null!==s&&(delete s.lastEvent,n.lastEvent=s),i.lastEvent=n;for(var l=0,d=r.length;d>l;l++)r[l].call(i,n)},removeListener:function(t,n){var i=this._listeners[t];if(i!==e)for(var r=0,a=i.length;a>r;r++)if(i[r]===n){i.splice(r,1);break}},fixPos:function(e,t){var n,i=e.raw.substr(0,t).split(/\r?\n/),r=i.length-1,a=e.line;return r>0?(a+=r,n=i[r].length+1):n=e.col+t,{line:a,col:n}},getMapAttrs:function(e){for(var t,n={},i=0,r=e.length;r>i;i++)n[(t=e[i]).name]=t.value;return n}},t}();"object"==typeof exports&&exports&&(exports.HTMLParser=i),n.addRule({id:"alt-require",description:"The alt attribute of an <img> element must be present and alt attribute of area[href] and input[type=image] must have a value.",init:function(e,t){var n=this;e.addListener("tagstart",(function(i){var r,a=i.tagName.toLowerCase(),o=e.getMapAttrs(i.attrs),s=i.col+a.length+1;"img"!==a||"alt"in o?("area"===a&&"href"in o||"input"===a&&"image"===o.type)&&("alt"in o&&""!==o.alt||(r="area"===a?"area[href]":"input[type=image]",t.warn("The alt attribute of "+r+" must have a value.",i.line,s,n,i.raw))):t.warn("An alt attribute must be present on <img> elements.",i.line,s,n,i.raw)}))}}),n.addRule({id:"attr-lowercase",description:"All attribute names must be in lowercase.",init:function(e,t,n){var i=this,r=Array.isArray(n)?n:[];e.addListener("tagstart",(function(e){for(var n,a=e.attrs,o=e.col+e.tagName.length+1,s=0,l=a.length;l>s;s++){var d=(n=a[s]).name;-1===r.indexOf(d)&&d!==d.toLowerCase()&&t.error("The attribute name of [ "+d+" ] must be in lowercase.",e.line,o+n.index,i,n.raw)}}))}}),n.addRule({id:"attr-no-duplication",description:"Elements cannot have duplicate attributes.",init:function(e,t){var n=this;e.addListener("tagstart",(function(e){for(var i,r,a=e.attrs,o=e.col+e.tagName.length+1,s={},l=0,d=a.length;d>l;l++)!0===s[r=(i=a[l]).name]&&t.error("Duplicate of attribute name [ "+i.name+" ] was found.",e.line,o+i.index,n,i.raw),s[r]=!0}))}}),n.addRule({id:"attr-unsafe-chars",description:"Attribute values cannot contain unsafe chars.",init:function(e,t){var n=this;e.addListener("tagstart",(function(e){for(var i,r,a=e.attrs,o=e.col+e.tagName.length+1,s=/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/,l=0,d=a.length;d>l;l++)if(null!==(r=(i=a[l]).value.match(s))){var c=escape(r[0]).replace(/%u/,"\\u").replace(/%/,"\\x");t.warn("The value of attribute [ "+i.name+" ] cannot contain an unsafe char [ "+c+" ].",e.line,o+i.index,n,i.raw)}}))}}),n.addRule({id:"attr-value-double-quotes",description:"Attribute values must be in double quotes.",init:function(e,t){var n=this;e.addListener("tagstart",(function(e){
for(var i,r=e.attrs,a=e.col+e.tagName.length+1,o=0,s=r.length;s>o;o++)(""!==(i=r[o]).value&&'"'!==i.quote||""===i.value&&"'"===i.quote)&&t.error("The value of attribute [ "+i.name+" ] must be in double quotes.",e.line,a+i.index,n,i.raw)}))}}),n.addRule({id:"attr-value-not-empty",description:"All attributes must have values.",init:function(e,t){var n=this;e.addListener("tagstart",(function(e){for(var i,r=e.attrs,a=e.col+e.tagName.length+1,o=0,s=r.length;s>o;o++)""===(i=r[o]).quote&&""===i.value&&t.warn("The attribute [ "+i.name+" ] must have a value.",e.line,a+i.index,n,i.raw)}))}}),n.addRule({id:"csslint",description:"Scan css with csslint.",init:function(e,n,i){var r=this;e.addListener("cdata",(function(e){var a;if("style"===e.tagName.toLowerCase()&&(a="object"==typeof exports&&t?t("csslint").CSSLint.verify:CSSLint.verify,void 0!==i)){var o=e.line-1,s=e.col-1;try{a(e.raw,i).messages.forEach((function(e){var t=e.line;n["warning"===e.type?"warn":"error"]("["+e.rule.id+"] "+e.message,o+t,(1===t?s:0)+e.col,r,e.evidence)}))}catch(e){}}}))}}),n.addRule({id:"doctype-first",description:"Doctype must be declared first.",init:function(e,t){var n=this,i=function(r){"start"===r.type||"text"===r.type&&/^\s*$/.test(r.raw)||(("comment"!==r.type&&!1===r.long||!1===/^DOCTYPE\s+/i.test(r.content))&&t.error("Doctype must be declared first.",r.line,r.col,n,r.raw),e.removeListener("all",i))};e.addListener("all",i)}}),n.addRule({id:"doctype-html5",description:'Invalid doctype. Use: "<!DOCTYPE html>"',init:function(e,t){function n(e){!1===e.long&&"doctype html"!==e.content.toLowerCase()&&t.warn('Invalid doctype. Use: "<!DOCTYPE html>"',e.line,e.col,r,e.raw)}function i(){e.removeListener("comment",n),e.removeListener("tagstart",i)}var r=this;e.addListener("all",n),e.addListener("tagstart",i)}}),n.addRule({id:"head-script-disabled",description:"The <script> tag cannot be used in a <head> tag.",init:function(e,t){function n(n){var i=e.getMapAttrs(n.attrs).type,s=n.tagName.toLowerCase();"head"===s&&(o=!0),!0!==o||"script"!==s||i&&!0!==a.test(i)||t.warn("The <script> tag cannot be used in a <head> tag.",n.line,n.col,r,n.raw)}function i(t){"head"===t.tagName.toLowerCase()&&(e.removeListener("tagstart",n),e.removeListener("tagend",i))}var r=this,a=/^(text\/javascript|application\/javascript)$/i,o=!1;e.addListener("tagstart",n),e.addListener("tagend",i)}}),n.addRule({id:"href-abs-or-rel",description:"An href attribute must be either absolute or relative.",init:function(e,t,n){var i=this,r="abs"===n?"absolute":"relative";e.addListener("tagstart",(function(e){for(var n,a=e.attrs,o=e.col+e.tagName.length+1,s=0,l=a.length;l>s;s++)if("href"===(n=a[s]).name){("absolute"===r&&!1===/^\w+?:/.test(n.value)||"relative"===r&&!0===/^https?:\/\//.test(n.value))&&t.warn("The value of the href attribute [ "+n.value+" ] must be "+r+".",e.line,o+n.index,i,n.raw);break}}))}}),n.addRule({id:"id-class-ad-disabled",description:"The id and class attributes cannot use the ad keyword, it will be blocked by adblock software.",init:function(e,t){var n=this;e.addListener("tagstart",(function(e){for(var i,r,a=e.attrs,o=e.col+e.tagName.length+1,s=0,l=a.length;l>s;s++)r=(i=a[s]).name,/^(id|class)$/i.test(r)&&/(^|[-\_])ad([-\_]|$)/i.test(i.value)&&t.warn("The value of attribute "+r+" cannot use the ad keyword.",e.line,o+i.index,n,i.raw)}))}}),n.addRule({id:"id-class-value",description:"The id and class attribute values must meet the specified rules.",init:function(e,t,n){var i,r=this;if((i="string"==typeof n?{underline:{regId:/^[a-z\d]+(_[a-z\d]+)*$/,message:"The id and class attribute values must be in lowercase and split by an underscore."},dash:{regId:/^[a-z\d]+(-[a-z\d]+)*$/,message:"The id and class attribute values must be in lowercase and split by a dash."},hump:{regId:/^[a-z][a-zA-Z\d]*([A-Z][a-zA-Z\d]*)*$/,message:"The id and class attribute values must meet the camelCase style."}}[n]:n)&&i.regId){var a=i.regId,o=i.message;e.addListener("tagstart",(function(e){for(var n,i=e.attrs,s=e.col+e.tagName.length+1,l=0,d=i.length;d>l;l++)if("id"===(n=i[l]).name.toLowerCase()&&!1===a.test(n.value)&&t.warn(o,e.line,s+n.index,r,n.raw),"class"===n.name.toLowerCase())for(var c,u=n.value.split(/\s+/g),f=0,h=u.length;h>f;f++)(c=u[f])&&!1===a.test(c)&&t.warn(o,e.line,s+n.index,r,c)}))}}}),n.addRule({id:"id-unique",description:"The value of id attributes must be unique.",init:function(e,t){var n=this,i={};e.addListener("tagstart",(function(e){for(var r,a,o=e.attrs,s=e.col+e.tagName.length+1,l=0,d=o.length;d>l;l++)if("id"===(r=o[l]).name.toLowerCase()){(a=r.value)&&(void 0===i[a]?i[a]=1:i[a]++,i[a]>1&&t.error("The id value [ "+a+" ] must be unique.",e.line,s+r.index,n,r.raw));break}}))}}),n.addRule({id:"inline-script-disabled",description:"Inline script cannot be use.",init:function(e,t){var n=this;e.addListener("tagstart",(function(e){for(var i,r,a=e.attrs,o=e.col+e.tagName.length+1,s=/^on(unload|message|submit|select|scroll|resize|mouseover|mouseout|mousemove|mouseleave|mouseenter|mousedown|load|keyup|keypress|keydown|focus|dblclick|click|change|blur|error)$/i,l=0,d=a.length;d>l;l++)r=(i=a[l]).name.toLowerCase(),(!0===s.test(r)||("src"===r||"href"===r)&&/^\s*javascript:/i.test(i.value))&&t.warn("Inline script [ "+i.raw+" ] cannot be use.",e.line,o+i.index,n,i.raw)}))}}),n.addRule({id:"inline-style-disabled",description:"Inline style cannot be use.",init:function(e,t){var n=this;e.addListener("tagstart",(function(e){for(var i,r=e.attrs,a=e.col+e.tagName.length+1,o=0,s=r.length;s>o;o++)"style"===(i=r[o]).name.toLowerCase()&&t.warn("Inline style [ "+i.raw+" ] cannot be use.",e.line,a+i.index,n,i.raw)}))}}),n.addRule({id:"jshint",description:"Scan script with jshint.",init:function(e,n,i){var r=this;e.addListener("cdata",(function(a){if("script"===a.tagName.toLowerCase()){var o,s=e.getMapAttrs(a.attrs),l=s.type;if(void 0!==s.src||l&&!1===/^(text\/javascript)$/i.test(l))return;if(o="object"==typeof exports&&t?t("jshint").JSHINT:JSHINT,void 0!==i){var d=a.line-1,c=a.col-1,u=a.raw.replace(/\t/g," ");try{!1===o(u,i)&&o.errors.forEach((function(e){var t=e.line;n.warn(e.reason,d+t,(1===t?c:0)+e.character,r,e.evidence)}))}catch(e){}}}}))}}),n.addRule({id:"space-tab-mixed-disabled",description:"Do not mix tabs and spaces for indentation.",init:function(e,t,n){var i=this,r="nomix",a=null;if("string"==typeof n){var o=n.match(/^([a-z]+)(\d+)?/);r=o[1],a=o[2]&&parseInt(o[2],10)}e.addListener("text",(function(n){for(var o,s=n.raw,l=/(^|\r?\n)([ \t]+)/g;o=l.exec(s);){var d=e.fixPos(n,o.index+o[1].length);if(1===d.col){var c=o[2];"space"===r?a?(!1===/^ +$/.test(c)||0!=c.length%a)&&t.warn("Please use space for indentation and keep "+a+" length.",d.line,1,i,n.raw):!1===/^ +$/.test(c)&&t.warn("Please use space for indentation.",d.line,1,i,n.raw):"tab"===r&&!1===/^\t+$/.test(c)?t.warn("Please use tab for indentation.",d.line,1,i,n.raw):!0===/ +\t|\t+ /.test(c)&&t.warn("Do not mix tabs and spaces for indentation.",d.line,1,i,n.raw)}}}))}}),n.addRule({id:"spec-char-escape",description:"Special characters must be escaped.",init:function(e,t){var n=this;e.addListener("text",(function(i){for(var r,a=i.raw,o=/[<>]/g;r=o.exec(a);){var s=e.fixPos(i,r.index);t.error("Special characters must be escaped : [ "+r[0]+" ].",s.line,s.col,n,i.raw)}}))}}),n.addRule({id:"src-not-empty",description:"The src attribute of an img(script,link) must have a value.",init:function(e,t){var n=this;e.addListener("tagstart",(function(e){for(var i,r=e.tagName,a=e.attrs,o=e.col+r.length+1,s=0,l=a.length;l>s;s++)i=a[s],(!0===/^(img|script|embed|bgsound|iframe)$/.test(r)&&"src"===i.name||"link"===r&&"href"===i.name||"object"===r&&"data"===i.name)&&""===i.value&&t.error("The attribute [ "+i.name+" ] of the tag [ "+r+" ] must have a value.",e.line,o+i.index,n,i.raw)}))}}),n.addRule({id:"style-disabled",description:"<style> tags cannot be used.",init:function(e,t){var n=this;e.addListener("tagstart",(function(e){"style"===e.tagName.toLowerCase()&&t.warn("The <style> tag cannot be used.",e.line,e.col,n,e.raw)}))}}),n.addRule({id:"tag-pair",description:"Tag must be paired.",init:function(e,t){var n=this,i=[],r=e.makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");e.addListener("tagstart",(function(e){var t=e.tagName.toLowerCase();void 0!==r[t]||e.close||i.push({tagName:t,line:e.line,raw:e.raw})})),e.addListener("tagend",(function(e){for(var r=e.tagName.toLowerCase(),a=i.length-1;a>=0&&i[a].tagName!==r;a--);if(a>=0){for(var o=[],s=i.length-1;s>a;s--)o.push("</"+i[s].tagName+">");if(o.length>0){var l=i[i.length-1];t.error("Tag must be paired, missing: [ "+o.join("")+" ], start tag match failed [ "+l.raw+" ] on line "+l.line+".",e.line,e.col,n,e.raw)}i.length=a}else t.error("Tag must be paired, no start tag: [ "+e.raw+" ]",e.line,e.col,n,e.raw)})),e.addListener("end",(function(e){for(var r=[],a=i.length-1;a>=0;a--)r.push("</"+i[a].tagName+">");if(r.length>0){var o=i[i.length-1];t.error("Tag must be paired, missing: [ "+r.join("")+" ], open tag match failed [ "+o.raw+" ] on line "+o.line+".",e.line,e.col,n,"")}}))}}),n.addRule({id:"tag-self-close",description:"Empty tags must be self closed.",init:function(e,t){var n=this,i=e.makeMap("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,track,command,source,keygen,wbr");e.addListener("tagstart",(function(e){var r=e.tagName.toLowerCase();void 0!==i[r]&&(e.close||t.warn("The empty tag : [ "+r+" ] must be self closed.",e.line,e.col,n,e.raw))}))}}),n.addRule({id:"tagname-lowercase",description:"All html element names must be in lowercase.",init:function(e,t){var n=this;e.addListener("tagstart,tagend",(function(e){var i=e.tagName;i!==i.toLowerCase()&&t.error("The html element name of [ "+i+" ] must be in lowercase.",e.line,e.col,n,e.raw)}))}}),n.addRule({id:"title-require",description:"<title> must be present in <head> tag.",init:function(e,t){function n(e){var t=e.tagName.toLowerCase();"head"===t?a=!0:"title"===t&&a&&(o=!0)}function i(a){var s=a.tagName.toLowerCase();if(o&&"title"===s){var l=a.lastEvent;("text"!==l.type||"text"===l.type&&!0===/^\s*$/.test(l.raw))&&t.error("<title></title> must not be empty.",a.line,a.col,r,a.raw)}else"head"===s&&(!1===o&&t.error("<title> must be present in <head> tag.",a.line,a.col,r,a.raw),e.removeListener("tagstart",n),e.removeListener("tagend",i))}var r=this,a=!1,o=!1;e.addListener("tagstart",n),e.addListener("tagend",i)}});var r={"tagname-lowercase":!1,"attr-lowercase":!1,"attr-value-double-quotes":!1,"doctype-first":!1,"tag-pair":!0,"spec-char-escape":!0,"id-unique":!0,"src-not-empty":!0,"attr-no-duplication":!0};e.registerHelper("lint","html",(function(t){for(var i=[],a=n.verify(t,r),o=0;o<a.length;o++){var s=a[o],l=s.line-1,d=s.line-1,c=s.col-1,u=s.col;i.push({from:e.Pos(l,c),to:e.Pos(d,u),message:s.message,severity:s.type})}return i}))})),n("modules/codeMirror",["jquery","codemirror","codemirror/mode/htmlmixed/htmlmixed","codemirror/addon/edit/closetag","codemirror/addon/edit/matchtags","codemirror/addon/hint/html-hint","codemirror/addon/hint/show-hint","codemirror/addon/hint/lint","codemirror/addon/hint/html-lint"],(function(e,t){"use strict";function n(){}return window.CodeMirror=t,n.prototype={initialize:function(){this.opts.codeMirror=jQuery.extend({autoCloseTags:!1,extraKeys:{"Ctrl-J":"toMatchingTag","Ctrl-Space":"autocomplete"},gutters:["CodeMirror-lint-markers"],matchTags:{bothTags:!0},mode:"htmlmixed",lineNumbers:!0,lineWrapping:!0,lint:t.lint.html},this.opts.codeMirror),this.$toolbar.find("a.re-html,a.re-fullscreen").addClass("redactor-codemirror-button"),this.codeMirror.showCode_super=this.code.showCode,this.code.showCode=this.codeMirror.showCode,this.codeMirror.showVisual_super=this.code.showVisual,this.code.showVisual=this.codeMirror.showVisual,this.button.addCallback(this.button.addAfter("html","htmltidy","Beautify"),this.codeMirror.htmlTidy),this.button.addCallback(this.button.addAfter("html","code-undo","Undo"),e.proxy((function(){this.codeMirror.instance.undo()}),this)),this.button.addCallback(this.button.addAfter("code-undo","code-redo","Redo"),e.proxy((function(){this.codeMirror.instance.redo()}),this));var n=this.button.add("diff","Diff");this.$toolbar.find("a.re-diff").addClass("re-has-dropdown"),n.click(this.codeMirror.toggleDiff),this.$toolbar.find("a.re-htmltidy, a.re-code-undo, a.re-code-redo, a.re-diff").addClass("redactor-button-hidden redactor-codemirror-button")},destroy:function(){this.code.get=this.codeMirror.get_super,this.code.showCode=this.codeMirror.showCode_super,this.code.showVisual=this.codeMirror.showVisual_super},htmlTidy:function(){this.codeMirror.instance.setValue(this.tabifier.get(this.codeMirror.instance.getValue()))},toggleDiff:function(t){t.preventDefault(),e(".redactor-dropdown-box-diff").remove(),this.dropdown.hideAll(),this.button.addDropdown(e(t.currentTarget),this.codeMirror.getDiffDropdown()),this.dropdown.show(t,"diff"),window.diff_match_patch||(e(document.head).append('<link rel="stylesheet" rel="nofollow" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/4.7.0/addon/merge/merge.min.css" type="text/css" />'),e.getScript("//cdnjs.cloudflare.com/ajax/libs/diff_match_patch/20121119/diff_match_patch.js").done((function(){e.getScript("//cdnjs.cloudflare.com/ajax/libs/codemirror/4.7.0/addon/merge/merge.js")})).fail((function(){window.alert("Sorry, an error occurred trying to load the difference engine.")})))},validate:function(){return this.codeMirror.instance?this.codeMirror.instance.state.lint.marked:[]},getDiffDropdown:function(){var t={},n=this;t[0]={title:"Initial State",func:this.codeMirror.showDiff},t[this.opts.buffer.length-1]={title:"Last Change",func:this.codeMirror.showDiff},this.codeMirror.compareOptions={};var i=this.$element.data("compareoptions");return i&&e.each(i,(function(e,i){i.url?n.codeMirror.compareOptions[i.name]={bURL:!0,url:i.url}:n.codeMirror.compareOptions[i.name]=i.source,t[i.name]={title:i.title,func:n.codeMirror.showDiff}})),t},showDiff:function(n){var i=this,r=e.Deferred();if(this.codeMirror.diffInstance){if(!window.confirm("Any unsaved changes will be lost are you sure?"))return!1;this.codeMirror.hideDiff()}this.$box.append('<div id="redactor-code-diff"></div>');var a=e("#redactor-code-diff");this.$toolbar.append('<li class="redactor-diff-control"><a class="redactor-diff-save">Save</a></li><li class="redactor-diff-control"><a class="redactor-diff-cancel">Cancel</a></li>'),e(".redactor-diff-save").on("click",(function(){i.codeMirror.saveDiff(),i.codeMirror.hideDiff()})),e(".redactor-diff-cancel").on("click",(function(){i.codeMirror.hideDiff()})),this.$toolbar.find(".redactor-codemirror-button").not(".re-diff").addClass("redactor-button-disabled"),(n=this.codeMirror.compareOptions[n]||this.codeMirror.cleanBuffer(this.opts.buffer[n])||n).bURL?e.get(n.url).done((function(e){n=e,r.resolve()})):r.resolve(),r.done((function(){a.css("top",i.$toolbar.height()+"px"),i.codeMirror.diffInstance=t.MergeView(a[0],{lineNumbers:!0,mode:"text/html",highlightDifferences:!0,value:i.codeMirror.instance.getValue(),orig:n,lineWrapping:!0}),i.$box.bind("resize.codeMirror",(function(){var e=i.$box.height()-i.$toolbar.height();i.codeMirror.diffInstance.leftOriginal()&&i.codeMirror.diffInstance.leftOriginal().setSize(null,e),i.codeMirror.diffInstance.editor().setSize(null,e),i.codeMirror.diffInstance.rightOriginal()&&i.codeMirror.diffInstance.rightOriginal().setSize(null,e),i.codeMirror.diffInstance.wrap.style.height=e+"px"})).trigger("resize.codeMirror")}))},saveDiff:function(){this.codeMirror.instance.setValue(this.codeMirror.diffInstance.editor().getValue())},hideDiff:function(){this.$box.find("#redactor-code-diff").remove(),this.$toolbar.find(".redactor-diff-control").remove(),this.$toolbar.find(".redactor-codemirror-button").not(".re-diff").removeClass("redactor-button-disabled"),this.codeMirror.diffInstance=null},getSandboxedHTML:function(){var e=document.createElement("div");return e.innerHTML=this.codeMirror.instance.getValue(),e.innerHTML},showVisual:function(){var e=this.codeMirror.getSandboxedHTML();this.codeMirror.validate().length&&!confirm("HTML errors exist that can cause unexpected results. Are you sure you want to continue?")||(this.codeMirror.instance.toTextArea(),this.$textarea.val(e),this.$box.unbind("resize.codeMirror"),this.codeMirror.buttonActiveVisual(),this.codeMirror.showVisual_super.apply(this,arguments))},showCode:function(){var e=this;e.codeMirror.showCode_super.apply(e,arguments),e.codeMirror.buttonInactiveVisual(),e.codeMirror.instance=t.fromTextArea(e.$textarea[0],e.opts.codeMirror);for(var n=0;n<e.opts.buffer.length;n++)e.opts.buffer[n].length&&e.codeMirror.instance.setValue(e.codeMirror.cleanBuffer(e.opts.buffer[n]));e.codeMirror.instance.setValue(e.$textarea.val()),e.$box.bind("resize.codeMirror",(function(){e.codeMirror.instance.getWrapperElement().style.height=e.$box.height()-e.$toolbar.height()+"px",e.codeMirror.instance.refresh()})),e.$box.trigger("resize.codeMirror"),e.codeMirror.instance.on("change",(function(){e.$textarea.val(e.codeMirror.getSandboxedHTML())}))},cleanBuffer:function(e){return!!e&&(e=(e=this.clean.onSync(e)).replace(/<span(.*?)class="redactor-selection-marker"([^>])*>(.*?)<\/span>/gi,""))},buttonActiveVisual:function(){this.$toolbar.find("a.redactor-codemirror-button:not(.re-html,.re-fullscreen)").addClass("redactor-button-hidden"),this.codeMirror.$previousButtons.removeClass("redactor-button-hidden")},buttonInactiveVisual:function(){this.$toolbar.find("a.redactor-codemirror-button").removeClass("redactor-button-hidden redactor-button-disabled"),this.codeMirror.$previousButtons=this.$toolbar.find("a:not(.redactor-codemirror-button, .redactor-button-hidden)").addClass("redactor-button-hidden")}},n})),n("modules/core",["jquery"],(function(e){"use strict";function t(){}return t.prototype={getObject:function(){return e.extend({},this)},getEditor:function(){return this.$editor},getBox:function(){return this.$box},getElement:function(){return this.$element},getTextarea:function(){return this.$textarea},getToolbar:function(){return!!this.$toolbar&&this.$toolbar},addEvent:function(e){this.core.event=e},getEvent:function(){return this.core.event},setCallback:function(t,n,i){var r=this.opts[t+"Callback"];return this.$element.trigger(t+".redactor-api",n,i),e.isFunction(r)?void 0===i?r.call(this,n):r.call(this,n,i):void 0===i?n:i},destroy:function(){this.core.setCallback("destroy"),this.$element.off(".redactor").off(".redactor-api").removeData("redactor"),e(document).off(".redactor").off(".redactor-image-resize-hide").off(".redactor-image-delete").off(".redactor-media-resize-hide"),this.$editor.off(".redactor").off(".redactor-image-resize-hide").off(".redactor-image-delete").off(".redactor-media-resize-hide"),e(document).off("click.redactor-image-delete."+this.uuid),e(document).off("click.redactor-image-resize-hide."+this.uuid),e(document).off("touchstart.redactor."+this.uuid+" click.redactor."+this.uuid),e("body").off("scroll.redactor."+this.uuid),e(this.opts.toolbarFixedTarget).off("scroll.redactor."+this.uuid),this.$editor.removeClass("redactor-editor redactor-linebreaks redactor-placeholder"),this.$editor.removeAttr("contenteditable");var t=this.code.get();this.$toolbar.find("a").each((function(){var t=e(this);t.data("dropdown")&&(t.data("dropdown").remove(),t.data("dropdown",{}))})),this.build.isTextarea()?(this.$box.after(this.$element),this.$box.remove(),this.$element.val(t).show()):(this.$box.after(this.$editor),this.$box.remove(),this.$element.html(t).show(),this.$sourceTextarea.val(t).appendTo(this.$element)),this.$pasteBox&&this.$pasteBox.remove(),this.modal.close(),this.$modalBox&&this.$modalBox.remove(),this.$modalOverlay&&this.$modalOverlay.remove(),this.dropdown.hideAll(),e(".redactor-dropdown").remove(),e(".redactor-toolbar-tooltip").remove()}},t})),n("modules/dropdown",["jquery"],(function(e){"use strict";function t(){}return t.prototype={build:function(t,n,i){"formatting"===t&&this.opts.formattingAdd&&e.each(this.opts.formattingAdd,e.proxy((function(e,t){var n,r=t.tag;void 0!==t.class&&(r=r+"-"+t.class),t.type=this.utils.isBlockTag(t.tag)?"block":"inline",n=void 0!==t.func?t.func:"inline"===t.type?"inline.formatting":"block.formatting",this.opts.linebreaks&&"block"===t.type&&"p"===t.tag||(this.formatting[r]={tag:t.tag,style:t.style,class:t.class,attr:t.attr,data:t.data,clear:t.clear},i[r]={func:n,title:t.title})}),this)),e.each(i,e.proxy((function(i,r){var a=e('<a href="#" class="redactor-dropdown-'+i+'">'+r.title+"</a>");"formatting"===t&&a.addClass("redactor-formatting-"+i),a.on("click",e.proxy((function(e){e.preventDefault();var t="func",n=r.func;r.command?(t="command",n=r.command):r.dropdown&&(t="dropdown",n=r.dropdown),this.button.onClick(e,i,t,n),this.dropdown.hideAll()}),this)),n.append(a)}),this))},show:function(t,n){function i(){var t=e("<div>").css({visibility:"hidden",width:100,overflow:"scroll"}).appendTo("body"),n=e("<div>").css({width:"100%"}).appendTo(t).outerWidth();return t.remove(),100-n}var r,a=this.button.get(n),o=a.data("dropdown").appendTo(document.body);if(this.utils.isMobile()&&!this.utils.browser("msie")&&document.activeElement.blur(),a.hasClass("dropact"))this.dropdown.hideAll();else{this.dropdown.hideAll(),this.core.setCallback("dropdownShow",{dropdown:o,key:n,button:a}),this.button.setActive(n),a.addClass("dropact");var s=a.offset(),l=o.width();s.left+l>e(document).width()&&(s.left=Math.max(0,s.left-l));var d=s.left+"px";if(this.$toolbar.hasClass("toolbar-fixed-box")){r=this.$toolbar.innerHeight()+this.opts.toolbarFixedTopOffset;var c="fixed";this.opts.toolbarFixedTarget!==document&&(r=this.$toolbar.innerHeight()+this.$toolbar.offset().top+this.opts.toolbarFixedTopOffset,c="absolute"),o.css({position:c,left:d,top:r+"px"}).show()}else r=a.innerHeight()+s.top+"px",o.css({position:"absolute",left:d,top:r}).show();this.core.setCallback("dropdownShown",{dropdown:o,key:n,button:a})}e(document).one("click.redactor",e.proxy(this.dropdown.hide,this)),this.$editor.one("click",e.proxy(this.dropdown.hide,this));var u=e(document.body),f=i();o.on("mouseover",(function(){u.addClass("body-redactor-hidden"),u.css("margin-right",f+"px")})),o.on("mouseout",(function(){u.removeClass("body-redactor-hidden").css("margin-right",0)})),t.stopPropagation()},hideAll:function(){this.$toolbar.find("a.dropact").removeClass("redactor-act").removeClass("dropact"),e(document.body).removeClass("body-redactor-hidden").css("margin-right",0),e(".redactor-dropdown-"+this.uuid).hide(),this.core.setCallback("dropdownHide")},hide:function(t){var n=e(t.target);n.hasClass("dropact")||(n.removeClass("dropact"),this.dropdown.hideAll())}},t})),n("modules/embed",["jquery"],(function(e){"use strict";function t(){}return t.prototype={reUrlYoutube:/https?:\/\/(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube\.com\S*[^\w\-\s])([\w\-]{11})(?=[^\w\-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*/gi,reUrlVimeo:/https?:\/\/(www\.)?vimeo.com\/(\d+)($|\/)/,getTemplate:function(){return String()+'<section id="redactor-modal-embed-insert"><label>'+this.lang.get("embed_html_code")+'</label><textarea id="redactor-insert-embed-area" style="height: 160px; width: 100%"></textarea></section>'},show:function(){this.modal.addTemplate("embed",this.embed.getTemplate()),this.modal.load("embed",this.lang.get("embed"),700),this.modal.createCancelButton(),this.modal.createActionButton(this.lang.get("insert")).on("click",this.embed.insert),this.selection.save(),this.modal.show(),e("#redactor-insert-embed-area")[0].focus()},insert:function(){var t=e("#redactor-insert-embed-area").val();if(!t.match(/<iframe|<video|<object|<embed/gi)){var n='<iframe style="width: 500px; height: 281px;" src="',i='" frameborder="0" allowfullscreen></iframe>';(t=this.clean.stripTags(t)).match(this.embed.reUrlYoutube)?t=t.replace(this.embed.reUrlYoutube,n+"//www.youtube.com/embed/$1"+i):t.match(this.embed.reUrlVimeo)&&(t=t.replace(this.embed.reUrlVimeo,n+"//player.vimeo.com/video/$2"+i))}this.selection.restore(),this.modal.close();var r=this.selection.getBlock()||this.selection.getCurrent();r?e(r).after(t):this.insert.html(t),this.code.sync()}},t})),n("modules/file",["jquery"],(function(e){"use strict";function t(){}return t.prototype={show:function(){this.modal.load("file",this.lang.get("file"),700),this.upload.init("#redactor-modal-file-upload",this.opts.fileUpload,this.file.insert),this.selection.save(),this.selection.get();var t=this.sel.toString();e("#redactor-filename").val(t),this.modal.show()},insert:function(t,n,i){if(void 0!==t.error)return this.modal.close(),this.selection.restore(),void this.core.setCallback("fileUploadError",t);var r;if("string"==typeof t)r=t;else{var a=e("#redactor-filename").val();void 0!==a&&""!==a||(a=t.filename),r='<a href="'+t.filelink+'" id="filelink-marker">'+a+"</a>"}if(n){this.selection.removeMarkers();var o=this.selection.getMarker();this.insert.nodeToCaretPositionFromPoint(i,o)}else this.modal.close();if(this.selection.restore(),this.buffer.set(),this.insert.htmlWithoutClean(r),"string"!=typeof t){var s=e(this.$editor.find("a#filelink-marker"));0!==s.length?s.removeAttr("id").removeAttr("style"):s=!1,this.core.setCallback("fileUpload",s,t)}}},t})),n("modules/focus",["jquery"],(function(e){"use strict";function t(){}return t.prototype={setStart:function(){this.$editor[0].focus();var e=this.$editor.children().first();if(0!==e.length&&0!==e[0].length&&"BR"!==e[0].tagName&&3!==e[0].nodeType){if("UL"===e[0].tagName||"OL"===e[0].tagName){var t=e.find("li").first();if(!this.utils.isBlock(t)&&""===t.text())return void this.caret.setStart(t)}if(this.opts.linebreaks&&!this.utils.isBlockTag(e[0].tagName))return this.selection.get(),this.range.setStart(this.$editor[0],0),this.range.setEnd(this.$editor[0],0),void this.selection.addRange();this.caret.setStart(e)}},setEnd:function(){if(this.utils.browser("mozilla")||this.utils.browser("msie")){var e=this.$editor.children().last();this.$editor[0].focus(),this.caret.setEnd(e)}else{this.selection.get();try{this.range.selectNodeContents(this.$editor[0]),this.range.collapse(!1),this.selection.addRange()}catch(e){}}},isFocused:function(){var t=document.getSelection().focusNode;return null!==t&&(!(!this.opts.linebreaks||!e(t.parentNode).hasClass("redactor-linebreaks"))||!!this.utils.isRedactorParent(t.parentNode)&&this.$editor.is(":focus"))}},t})),n("modules/fontcolor",["jquery"],(function(e){"use strict";function t(){}return t.prototype={initialize:function(){for(var e=["fontcolor","backcolor"],t=0;t<2;t++){var n=e[t],i=this.button.get(n);if(i.length){var r=this.button.addDropdown(i);r.width(242),this.fs.buildPicker(r,n,this.fs.colors,this.fontcolor.set,this.fontcolor.remove)}}},set:function(t,n){this.fs.setInlineStyle((function(i){e(i).css(t,n)}))},remove:function(t){e.each(this.selection.getNodes(),(function(n,i){e(i).css(t,"")})),this.code.sync()}},t})),n("modules/fontfamily",["jquery"],(function(e){"use strict";function t(){}return t.prototype={initialize:function(){var t=["Arial","Arial Narrow","Arial Black","Helvetica","Georgia","Lucida","Monospace","Palatino","Tahoma","Times New Roman","Trebuchet","Verdana"],n=this,i={};e.each(t,(function(e,t){i["s"+e]={title:t,func:function(){n.fontfamily.set(t)}}})),i.remove={title:"Remove Font Family",func:n.fontfamily.reset};var r=this.button.get("fontfamily");this.button.addDropdown(r,i)},set:function(e){this.inline.format("span","style","font-family:"+e+";")},reset:function(){this.inline.removeStyleRule("font-family")}},t})),n("modules/fontsize",["jquery"],(function(e){"use strict";function t(){}return t.prototype={initialize:function(){var t=[10,11,12,14,16,18,20,24,28,30],n=this,i={};e.each(t,(function(e,t){i["s"+e]={title:t+"px",func:function(){n.fontsize.set(t)}}})),i.remove={title:"Remove Font Size",func:n.fontsize.reset};var r=this.button.get("fontsize");r.length&&this.button.addDropdown(r,i)},set:function(e){this.inline.format("span","style","font-size: "+e+"px;")},reset:function(){this.inline.removeStyleRule("font-size")}},t})),n("modules/fs",["jquery"],(function(e){"use strict";function t(){}return t.prototype={init:function(){this.opts.codeOnly&&this.button.remove("html"),this.buffer.clearRebuffer(),this.buffer.clearBuffer()},hidePluginButtons:function(){0!==this.opts.buttonsHide.length&&e.each(this.opts.buttonsHide,e.proxy((function(e,t){this.button.remove(t)}),this))},setInlineStyle:function(t){if(this.utils.browser("mozilla")&&this.focus.isFocused()&&this.$editor[0].focus(),this.buffer.set(),this.selection.get(),e("#redactor-overlay-box:not(.redactor-overlay-type-table)",this.$editor).length)return t(this.fs.$editTarget),void this.code.sync();var n=this.sel.getRangeAt(0);if(this.sel.isCollapsed){var i=n.commonAncestorContainer;i.nodeType===Node.TEXT_NODE&&(i=i.parentElement),this.range.selectNodeContents(i),this.selection.addRange()}var r=[];if(n.startContainer===n.endContainer){var a=document.createElement("span");n.surroundContents(a),r=e(a)}else{this.fs.setImageFloatFix(),document.execCommand("createLink",!1,"redactor-temporary"),this.fs.unsetImageFloatFix(),this.$editor.find('a[href="redactor-temporary"]').each((function(){var t=e(this),n=t.text().replace("redactor-temporary"," ");if(n!==t.parent().text()||t.parent().hasClass("redactor-editor"))if(n===t.children(":first").text())r.push(t.children(":first")[0]),t.replaceWith(this.childNodes);else{var i=e("<span/>").append(n);t.replaceWith(i),r.push(i[0])}else r.push(t.parent()[0]),t.replaceWith(this.childNodes)}))}t(r),this.caret.set(r[0],0,r[r.length-1],1),this.code.sync()},sync:function(){var e=this.$textarea.val();e=e.replace(/<span([^>]*)id="redactor-overlay-box"([^>]*)>(.*?)<\/span>/gi,""),this.$textarea.val(e)},buildPicker:function(t,n,i,r,a){for(var o="backcolor"===n?"background-color":"color",s=i.length,l=function(t){t.preventDefault(),t.stopPropagation(),r(e(this).data("rule"),e(this).attr("rel"))},d=0;d<s;d++){var c=i[d],u=e('<a rel="'+c+'" data-rule="'+o+'" href="#" style="float: left; font-size: 0; border: 2px solid #fff; padding: 0; margin: 0; width: 22px; height: 22px;"></a>');u.css("background-color",c),u.on("click",l),t.append(u)}var f=e('<a href="#" style="display: block; clear: both; padding: 5px; font-size: 12px; line-height: 1;"></a>').html(this.lang.get("none"));f.on("click",(function(e){e.preventDefault(),e.stopPropagation(),a(o)})),t.append(f)},cleanID:function(e){return e.replace(/[\s"']/g,"")},colors:["#ffffff","#000000","#eeece1","#1f497d","#4f81bd","#c0504d","#9bbb59","#8064a2","#4bacc6","#f79646","#ffff00","#f2f2f2","#7f7f7f","#ddd9c3","#c6d9f0","#dbe5f1","#f2dcdb","#ebf1dd","#e5e0ec","#dbeef3","#fdeada","#fff2ca","#d8d8d8","#595959","#c4bd97","#8db3e2","#b8cce4","#e5b9b7","#d7e3bc","#ccc1d9","#b7dde8","#fbd5b5","#ffe694","#bfbfbf","#3f3f3f","#938953","#548dd4","#95b3d7","#d99694","#c3d69b","#b2a2c7","#b7dde8","#fac08f","#f2c314","#a5a5a5","#262626","#494429","#17365d","#366092","#953734","#76923c","#5f497a","#92cddc","#e36c09","#c09100","#7f7f7f","#0c0c0c","#1d1b10","#0f243e","#244061","#632423","#4f6128","#3f3151","#31859b","#974806","#7f6000"],dropdownShow:function(t,n){if("formatting"===n.key){var i=e(".redactor-dropdown");i.find(".highlight").removeClass("highlight"),this.selection.getBlock()&&i.find(".redactor-dropdown-"+this.selection.getBlock().tagName.toLowerCase()).addClass("highlight")}this.$element.trigger("dropdownShow.redactor")},modalIframeBrowseInit:function(){this.$redactorModalBrowser=e("#redactor-modal-iframe-browser"),this.$redactorModalBrowser.length||(this.$modalBox.append('<div id="redactor-modal-iframe-browser"><iframe frameborder="0" height="100%" width="100%" /><footer><div style="width:100%;"><button type="button" class="redactor-button-modal-close">Cancel</button></div></footer></div>'),this.$redactorModalBrowser=e("#redactor-modal-iframe-browser",this.$modalBox)),e("#redactor-modal",this.$modal).css("left",0),this.$redactorModalBrowser.hide().css("left",this.$modal.outerWidth())},modalIframeBrowse:function(t,n,i){var r=e.proxy((function(){window.removeEventListener("message",a,!1),this.$redactorModalBrowser.off("click"),this.$editor.off("redactor.modalClose.iframeBrowser"),this.$redactorModalBrowser.css({opacity:0,"z-index":this.$modal.css("z-index")-1}),this.$modal.css("opacity",1);var e=this;setTimeout((function(){e.$redactorModalBrowser.find("iframe").removeAttr("src")}),500)}),this),a=e.proxy((function(e){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(e){return}(t.path&&t.name||t.id)&&(n.call(this,t),r())}),this);i=i||this.$modal.outerWidth(),window.addEventListener("message",a,!1),this.$redactorModalBrowser.on("click",".redactor-button-modal-close",e.proxy(r,this)),
this.$editor.on("redactor.modalClose.iframeBrowser",e.proxy(r,this)),this.$redactorModalBrowser.find("iframe").attr("src",t),this.$modal.css("opacity",0),this.$redactorModalBrowser.show().css({width:i,height:this.$modal.outerHeight(),left:parseInt(e(window).width()/2)-parseInt(i/2),opacity:1,top:this.$modal.css("marginTop"),"z-index":this.$modal.css("z-index")+1})},loadEditableControls:function(t){var n=this,i=t.element,r=e.extend({top:0,left:0},t.offset);this.fs.hideEditableControls(!1),t.bCancelSelection||(this.selection.get(),this.range.selectNode(i[0]),this.selection.addRange()),this.fs.$editBox=e('<span id="redactor-overlay-box" data-verified="redactor">'),this.fs.$editBox.attr("contenteditable","false"),this.fs.$editBox.attr("unselectable","on"),this.fs.$editControls=e("<ul></ul>"),this.fs.$editTarget=i,this.fs.$editTarget.data("offset",r),this.fs.$editBox.addClass("redactor-overlay-type-"+i[0].tagName.toLowerCase()),this.fs.editBoxOnHide=t.onHide,this.$editor.append(this.fs.$editBox),this.fs.$editBox.append(this.fs.$editControls),this.$editor.on("click.redactor.hideEditableControls",this.fs.hideEditableControls),e(document).on("click.redactor.hideEditableControls",this.fs.hideEditableControls),e(this.opts.toolbarFixedTarget).on("scroll.redactor.scrollEditableControls",this.fs.scrollEditableControls),e(document).on("mouseup.redactor.checkOverlay keyup.redactor.checkOverlay",this.fs.checkOverlay),this.$element.on("sync.redactor-api change.redactor-api",this.fs.checkOverlay),this.fs.positionControls(),e.each(t.buttons,(function(e,t){n.fs.addEditableButton(t)}))},positionControls:function(){var e=this.fs.$editTarget.data("offset");this.fs.$editBox.css({top:this.fs.$editTarget.position().top+parseInt(this.fs.$editTarget.css("marginTop"))+this.$editor[0].scrollTop+e.top,left:this.fs.$editTarget.position().left+parseInt(this.fs.$editTarget.css("marginLeft"))+e.left,width:this.fs.$editTarget.outerWidth(),height:this.fs.$editTarget.outerHeight()}),this.fs.$editControls.data("original-offset")||this.fs.$editControls.data("original-offset",this.fs.$editControls.offset()),this.fs.scrollEditableControls()},hideEditableControls:function(t){return(!t||t.target!==this.fs.$editTarget[0])&&((!t||!e(t.target).closest(".redactor-dropdown").length)&&(!(this.fs.editBoxOnHide&&!this.fs.editBoxOnHide(t))&&(this.$editor.off(".hideEditableControls"),e(document).off(".checkOverlay"),e(document).off(".hideEditableControls"),e(this.opts.toolbarFixedTarget).off(".scrollEditableControls"),this.fs.editBoxOnHide=!1,void e("#redactor-overlay-box").remove())))},checkOverlay:function(){this.fs.$editTarget.parent().length?(this.observe.images(),this.fs.positionControls()):this.fs.hideEditableControls()},scrollEditableControls:function(){var e=this.$toolbar.offset().top+this.$toolbar.height()-this.fs.$editControls.data("original-offset").top;e>0&&e<this.fs.$editBox.height()?this.fs.$editControls.css({top:e}):this.fs.$editControls.css({top:""})},addEditableButton:function(t){var n=this,i=e('<li><button type="button" class="re-icon '+t.class+'" title="'+t.title+'"/></li>');i.on("click",(function(e){e.stopPropagation(),e.preventDefault(),t.onClick(),n.fs.$editTarget.parent().length||n.fs.hideEditableControls(!1)})),this.fs.$editControls.append(i)},rgb2hex:function(e){function t(e){return("0"+parseInt(e).toString(16)).slice(-2)}return e?"#"+t((e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))[1])+t(e[2])+t(e[3]):""},setAttr:function(t,n,i){e.trim(i).length?t.attr(n,i):t.removeAttr(n)},setImageFloatFix:function(){e.each(this.selection.getNodes(),(function(t,n){if("IMG"===n.tagName){var i=e(n);"none"!==i.css("float")&&(i.attr("data-redactor-save-float",i.css("float")),i.css("float","none"))}}))},unsetImageFloatFix:function(){e.each(this.selection.getNodes(),(function(t,n){if("IMG"===n.tagName){var i=e(n);!i.attr("data-redactor-save-float")||(i.css("float",i.attr("data-redactor-save-float")),i.removeAttr("data-redactor-save-float"))}}))},snapSelectionToWord:function(){var e;if(window.getSelection&&(e=window.getSelection()).modify){if(!(e=window.getSelection()).isCollapsed){var t=document.createRange();t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset);var n=t.collapsed;t.detach();var i=e.focusNode,r=e.focusOffset;e.collapse(e.anchorNode,e.anchorOffset),n?(e.modify("move","forward","word"),e.extend(i,r),e.modify("extend","backward","word")):(e.modify("move","backward","word"),e.extend(i,r),e.modify("extend","forward","word"))}}else if((e=document.selection)&&"Control"!==e.type){var a=e.createRange();if(a.text){for(a.expand("word");/\s$/.test(a.text);)a.moveEnd("character",-1);a.select()}}}},t})),n("modules/fullscreen",["jquery"],(function(e){"use strict";function t(){}return t.prototype={initialize:function(){this.fullscreen.isOpen=!1,this.button.get("fullscreen").parent().css("float","right"),this.opts.fullscreen&&this.fullscreen.toggle()},enable:function(){var t=this;this.button.changeIcon("fullscreen","normalscreen"),this.button.setActive("fullscreen"),this.fullscreen.isOpen=!0,this.opts.toolbarExternal&&(this.fullscreen.toolcss={},this.fullscreen.boxcss={},this.fullscreen.toolcss.width=this.$toolbar.css("width"),this.fullscreen.toolcss.top=this.$toolbar.css("top"),this.fullscreen.toolcss.position=this.$toolbar.css("position"),this.fullscreen.boxcss.top=this.$box.css("top")),this.fullscreen.height=this.$editor.height(),this.opts.maxHeight&&this.$editor.css("max-height",""),this.opts.minHeight&&this.$editor.css("min-height",""),this.$fullscreenPlaceholder||(this.$fullscreenPlaceholder=e("<div/>")),this.$fullscreenPlaceholder.insertAfter(this.$box),"transparent"===this.$box.css("backgroundColor")&&e.each(this.$box.parents(),(function(){var n=e(this).css("backgroundColor");if("transparent"!==n&&"inherit"!==n)return t.$box.css("backgroundColor",n),!1})),this.$box.appendTo(document.body),this.$box.addClass("redactor-box-fullscreen"),e("body, html").css("overflow","hidden"),this.fullscreen.resize(),e(window).on("resize.redactor.fullscreen",e.proxy(this.fullscreen.resize,this)),e(document).scrollTop(0,0),this.$editor[0].focus(),this.observe.load()},disable:function(){this.button.removeIcon("fullscreen","normalscreen"),this.button.setInactive("fullscreen"),this.fullscreen.isOpen=!1,e(window).off("resize.redactor.fullscreen"),e("body, html").css("overflow",""),this.$box.css("backgroundColor",""),this.$box.insertBefore(this.$fullscreenPlaceholder),this.$fullscreenPlaceholder.remove(),this.$box.removeClass("redactor-box-fullscreen").css({width:"auto",height:"auto"}),this.code.sync(),this.opts.toolbarExternal&&(this.$box.css("top",this.fullscreen.boxcss.top),this.$toolbar.css({width:this.fullscreen.toolcss.width,top:this.fullscreen.toolcss.top,position:this.fullscreen.toolcss.position})),this.opts.minHeight&&this.$editor.css("minHeight",this.opts.minHeight),this.opts.maxHeight&&this.$editor.css("maxHeight",this.opts.maxHeight),this.$editor.css("height","auto"),this.$editor[0].focus(),this.observe.load()},toggle:function(){this.fullscreen.isOpen?this.fullscreen.disable():this.fullscreen.enable(),this.$box.trigger("resize")},resize:function(){if(this.fullscreen.isOpen){var t=this.$toolbar.height(),n=window.innerHeight-t;this.$box.width(e(window).width()-2).height(n+t),this.opts.toolbarExternal&&(this.$toolbar.css({top:"0px",position:"absolute",width:"100%"}),this.$box.css("top",t+"px")),this.$editor.height(n-14)}}},t})),n("modules/image",["jquery"],(function(e){"use strict";function t(){}return t.prototype={initialize:function(){this.opts.image=e.extend({onFileBrowseReturn:function(e){return e}},this.opts.image),this.$element.on("observed.redactor.img",this.image.setEditable),this.opts.modal_image_edit='<section>\t\t\t\t<div class="redactor-image-modalleftcol">\t\t\t\t\t<div class="redactor-image-preview">\t\t\t\t\t\t<img src="" style="max-width:100%; max-height:40%"/>\t\t\t\t\t</div>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<legend>Size (px)</legend>\t\t\t\t\t\t<label><input id="redactor-image-width" type="text" class="smallinput" /> Width</label>\t\t\t\t\t\t<label><input id="redactor-image-height" type="text" class="smallinput" /> Height</label>\t\t\t\t\t</fieldset>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<label><input id="redactor-image-border" type="number" min="0" class="smallinput" /> Border</label>\t\t\t\t\t</fieldset>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<legend>Margin</legend>\t\t\t\t\t\t<input id="redactor-image-marginTop" type="number" min="0" class="smallinput" />\t\t\t\t\t\t<label><select id="redactor-image-marginTop-unit"><option>px</option><option>em</option><option>%</option></select>\t\t\t\t\t\t\tTop\t\t\t\t\t\t</label>\t\t\t\t\t\t<input id="redactor-image-marginRight" type="number" min="0" class="smallinput" />\t\t\t\t\t\t<label><select id="redactor-image-marginRight-unit"><option>px</option><option>em</option><option>%</option></select>\t\t\t\t\t\t\tRight\t\t\t\t\t\t</label>\t\t\t\t\t\t<input id="redactor-image-marginBottom" type="number" min="0" class="smallinput" />\t\t\t\t\t\t<label><select id="redactor-image-marginBottom-unit"><option>px</option><option>em</option><option>%</option></select>\t\t\t\t\t\t\tBottom\t\t\t\t\t\t</label>\t\t\t\t\t\t<input id="redactor-image-marginLeft" type="number" min="0" class="smallinput" />\t\t\t\t\t\t<label><select id="redactor-image-marginLeft-unit"><option>px</option><option>em</option><option>%</option></select>\t\t\t\t\t\t\tLeft\t\t\t\t\t\t</label>\t\t\t\t\t</fieldset>\t\t\t\t</div>\t\t\t\t<div class="redactor-image-modalrightcol">\t\t\t\t\t<fieldset>\t\t\t\t\t\t<label for="redactor-image-url">File/URL</label>\t\t\t\t\t\t<input id="redactor-image-url" type="text" name="redactor-image-url" />\t\t\t\t\t\t<button type="button" class="redactor-modal-btn" id="redactor-image-browse">Browse</button>\t\t\t\t\t</fieldset>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<label for="redactor_image-align">Alignment</label>\t\t\t\t\t\t<ul id="redactor-image-align">\t\t\t\t\t\t\t<li><input id="redactor-image-align-none" name="redactor-image-align" type="radio" value="none"><label for="redactor-image-align-none">None</label></li>\t\t\t\t\t\t\t<li><input id="redactor-image-align-left" name="redactor-image-align" type="radio" value="left"><label for="redactor-image-align-left">Left</label></li>\t\t\t\t\t\t\t<li><input id="redactor-image-align-right" name="redactor-image-align" type="radio" value="right"><label for="redactor-image-align-right">Right</label></li>\t\t\t\t\t\t</ul>\t\t\t\t\t</fieldset>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<label for="redactor-image-alt">Alt text</label><input type="text" id="redactor-image-alt" />\t\t\t\t\t\t<label for="redactor-image-title">Title text</label><input type="text" id="redactor-image-title" />\t\t\t\t\t</fieldset>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<label for="redactor-image-class">Class</label>\t\t\t\t\t\t<input type="text" placeholder="Choose Style..." id="redactor-image-class">\t\t\t\t\t\t<label for="redactor-image-id">ID</label><input type="text" id="redactor-image-id" />\t\t\t\t\t</fieldset>\t\t\t\t</div>\t\t\t\t<div style="clear:both"></div>\t\t\t\t</section>'},setEditable:function(t,n){var i=this,r=e(n),a=[];if(a.push({name:"Settings",class:"re-cog",title:"Edit Image Properties",onClick:function(){return i.image.show(r),!1}}),window.Aviary){var o=e.extend(i.opts.aviary,{onSave:function(e,t){r.get(0).src=t}});i.featherEditor=i.featherEditor||new Aviary.Feather(o)}(!!this.opts.aviaryPopupURL||!!window.Aviary)&&a.push({name:"Edit",class:"re-pencil",title:"Edit",onClick:function(){if(i.opts.aviaryPopupURL){var e=i.opts.aviaryPopupURL.replace("{file}",r.attr("src")),t=r[0].naturalWidth;window.open(e,"_blank","width=960, height=700, scrollbars=1"),void 0===window.FS&&(window.FS={}),void 0===window.FS.editor&&(window.FS.editor={}),void 0===window.FS.editor.fileEditingComplete&&(window.FS.editor.fileEditingComplete=function(e){r.one("load",(function(){r[0].naturalWidth!==t&&r.attr("width",r[0].naturalWidth)})),r.attr("src",e.url.replace(/ /g,"%20"))})}else i.featherEditor.launch({image:r.get(0)});return!1}}),a.push({name:"Delete",title:"Delete",class:"re-trash",onClick:function(){if(!window.confirm("Are you sure you want to delete this image?"))return!1;r.remove(),i.code.sync()}}),r.off(".editcontrols").on("click.editcontrols touchstart.editcontrols",(function(e){e.stopPropagation(),i.fs.loadEditableControls({element:r,buttons:a})}))},show:function(t){this.modal.addTemplate("image",this.opts.modal_image_edit),this.modal.load("image",this.opts.curLang.image+" Settings",600),this.modal.createCancelButton();var n=this.modal.createDeleteButton("Delete"),i=this.modal.createActionButton("Save");e("#redactor-overlay-box.redactor-overlay-type-img").length&&(t=this.fs.$editTarget),"string"==typeof t&&(this.selection.save(),t=e('<img data-new="true"/>')),t.data("save-src",t.attr("src")),t.removeAttr("height");var r=this,a=e(".redactor-image-preview > img",this.$modal),o=t[0].style,s=t[0].naturalWidth/t[0].naturalHeight,l=/\d+/,d=/\D+$/;if(this.opts.browseFileURL.length?e("#redactor-image-browse",this.$modal).on("click",e.proxy((function(t){return t.preventDefault(),this.fs.modalIframeBrowse.call(this,this.opts.browseFileURL,e.proxy((function(t){t=this.opts.image.onFileBrowseReturn(t),e("#redactor-image-url",this.$modal).val(t.path).change()}),this)),!1}),this)):e("#redactor-image-browse",this.$modal).hide(),e("input[type=number],#redactor-image-width,#redactor-image-height",r.$modal).on("keydown",(function(e){(e.keyCode>57||e.keyCode<48)&&8!==e.keyCode&&9!==e.keyCode&&37!==e.keyCode&&39!==e.keyCode&&46!==e.keyCode&&13!==e.keyCode&&e.preventDefault()})),e("#redactor-image-width",this.$modal).val(t.width()).on("change keyup",(function(){e("#redactor-image-height",this.$modal).val(parseInt(this.value/s))})),e("#redactor-image-height",this.$modal).val(t.height()).on("change keyup",(function(){e("#redactor-image-width",this.$modal).val(parseInt(this.value*s))})),e("#redactor-image-border",this.$modal).val(o.borderWidth.match(l)).on("change",(function(){a.css("border",e(this).val()+"px solid #000")})).change(),e("#redactor-image-marginTop",this.$modal).val(o.marginTop.match(l)||0),e("#redactor-image-marginRight",this.$modal).val(o.marginRight.match(l)||0),e("#redactor-image-marginBottom",this.$modal).val(o.marginBottom.match(l)||0),e("#redactor-image-marginLeft",this.$modal).val(o.marginLeft.match(l)||0),e("#redactor-image-marginTop-unit",this.$modal).val(o.marginTop.match(d)||"px"),e("#redactor-image-marginRight-unit",this.$modal).val(o.marginRight.match(d)||"px"),e("#redactor-image-marginBottom-unit",this.$modal).val(o.marginBottom.match(d)||"px"),e("#redactor-image-marginLeft-unit",this.$modal).val(o.marginLeft.match(d)||"px"),e('input[name="redactor-image-align"][value="'+t.css("float")+'"]',this.$modal).prop("checked",!0),e("#redactor-image-alt",this.$modal).val(t.attr("alt")),e("#redactor-image-title",this.$modal).val(t.attr("title")),e("#redactor-image-id",this.$modal).val(t.attr("id")),e("#redactor-image-class",this.$modal).val(t.attr("class")),e.fn.selectize){var c=this.opts.classes?e.map(this.opts.classes,(function(e){return{value:e.class,text:e.name}})):[],u=e("#redactor-image-class").selectize({delimiter:" ",persist:!1,create:!0});u[0].selectize.addOption(c),u[0].selectize.$control.on("keyup",(function(e){e.stopPropagation()}))}e("#redactor-image-url",this.$modal).val(t.attr("src")).on("change",(function(){var n=e("#redactor-image-url",r.$modal).val();a.attr("src",n||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"),n!==t.data("save-src")&&t.removeAttr("width")})).change(),a.load((function(){s=a[0].naturalWidth/a[0].naturalHeight,t.attr("width")||(e("#redactor-image-width",this.$modal).val(a[0].naturalWidth),e("#redactor-image-height",this.$modal).val(a[0].naturalHeight))})),i.on("click",(function(){r.image.save(t)})),n.on("click",(function(){t.remove(),r.code.sync(),r.modal.close()})),this.modal.show()},save:function(t){this.selection.restore();var n=e("#redactor-image-alt").val(),i=e("#redactor-image-title").val(),r=e("#redactor-image-id").val(),a=e("#redactor-image-class").val(),o=e("#redactor-image-width").val(),s=e("#redactor-image-marginTop").val()||0,l=e("#redactor-image-marginRight").val()||0,d=e("#redactor-image-marginBottom").val()||0,c=e("#redactor-image-marginLeft").val()||0,u=e("#redactor-image-marginTop-unit").val(),f=e("#redactor-image-marginRight-unit").val(),h=e("#redactor-image-marginBottom-unit").val(),p=e("#redactor-image-marginLeft-unit").val(),g=e('input[name="redactor-image-align"]:checked').val(),m=e("#redactor-image-border").val();this.fs.setAttr(t,"alt",n),this.fs.setAttr(t,"title",i),this.fs.setAttr(t,"id",r),this.fs.setAttr(t,"class",a),!isNaN(o)&&o>0?t.attr("width",o):t.removeAttr("width"),t.removeAttr("height"),t.css("border",m>0?m+"px solid #000":""),t.attr("src",e("#redactor-image-url").val()),t.css("margin",s+l+d+c>0?s+u+" "+l+f+" "+d+h+" "+c+p:""),"left"===g?t.css("float","left"):"right"===g?t.css("float","right"):t.css("float",""),!t.data("new")||(t.removeData("new").removeAttr("data-new"),this.insert.html(t[0].outerHTML,!1)),this.modal.close(),this.observe.images(),this.code.sync()}},t})),n("modules/indent",["jquery"],(function(e){"use strict";function t(){}return t.prototype={increase:function(){this.utils.browser("msie")||this.$editor[0].focus(),this.buffer.set(),this.selection.save();var e=this.selection.getBlock();e&&"LI"===e.tagName?this.indent.increaseLists():!1===e&&this.opts.linebreaks?this.indent.increaseText():this.indent.increaseBlocks(),this.selection.restore(),this.code.sync()},increaseLists:function(){document.execCommand("indent"),this.indent.fixEmptyIndent(),this.clean.normalizeLists(),this.clean.clearUnverified()},increaseBlocks:function(){e.each(this.selection.getBlocks(),e.proxy((function(e,t){if("TD"!==t.tagName&&"TH"!==t.tagName){var n=this.utils.getAlignmentElement(t),i=parseFloat(n.css("font-size")),r=(this.utils.normalize(n.css("margin-left"))+i)/i;n.css("margin-left",r+"em")}}),this))},increaseText:function(){var t=this.selection.wrap("div");e(t).attr("data-tagblock","redactor"),e(t).css("margin-left",this.opts.indentValue/parseFloat(e(document.body).css("font-size")+"em"))},decrease:function(){this.buffer.set(),this.selection.save();var e=this.selection.getBlock();e&&"LI"===e.tagName?this.indent.decreaseLists():this.indent.decreaseBlocks(),this.selection.restore(),this.code.sync()},decreaseLists:function(){document.execCommand("outdent");var t=this.selection.getCurrent(),n=e(t).closest("li",this.$editor[0]),i=n.parent();0!==n.length&&0!==i.length&&"LI"===i[0].tagName&&i.after(n),this.indent.fixEmptyIndent(),!this.opts.linebreaks&&0===n.length&&(document.execCommand("formatblock",!1,"p"),this.$editor.find("ul, ol, blockquote, p").each(e.proxy(this.utils.removeEmpty,this))),this.clean.clearUnverified()},decreaseBlocks:function(){e.each(this.selection.getBlocks(),e.proxy((function(e,t){var n=this.utils.getAlignmentElement(t),i=parseFloat(n.css("font-size")),r=(this.utils.normalize(n.css("margin-left"))-i)/i;r<=0?this.opts.linebreaks&&void 0!==n.data("tagblock")?n.replaceWith(n.html()+"<br />"):(n.css("margin-left",""),this.utils.removeEmptyAttr(n,"style")):n.css("margin-left",r+"em")}),this))},fixEmptyIndent:function(){var t=this.selection.getBlock();if(this.range.collapsed&&t&&"LI"===t.tagName&&this.utils.isEmpty(e(t).text())){var n=e(t);n.find("span").not(".redactor-selection-marker").contents().unwrap(),n.append("<br>")}}},t})),n("modules/inline",["jquery"],(function(e){"use strict";function t(){}return t.prototype={formatting:function(e){var t,n;void 0!==this.formatting[e].style?t="style":void 0!==this.formatting[e].class&&(t="class"),t&&(n=this.formatting[e][t]),this.inline.format(this.formatting[e].tag,t,n)},format:function(t,n,i){if(!this.utils.isCurrentOrParent("PRE")){for(var r=["b","bold","i","italic","underline","strikethrough","deleted","superscript","subscript"],a=["strong","strong","em","em","u","del","del","sup","sub"],o=0;o<r.length;o++)t===r[o]&&(t=a[o]);if(this.opts.allowedTags){if(-1===e.inArray(t,this.opts.allowedTags))return}else if(-1!==e.inArray(t,this.opts.deniedTags))return;this.inline.type=n||!1,this.inline.value=i||!1,this.buffer.set(),this.utils.browser("msie")||this.$editor[0].focus(),this.selection.get(),this.range.collapsed?this.inline.formatCollapsed(t):this.inline.formatMultiple(t)}},formatCollapsed:function(t){var n=this.selection.getCurrent(),i=e(n).closest(t+"[data-redactor-tag="+t+"]",this.$editor[0]);if(0===i.length||"style"===this.inline.type||"SPAN"===i[0].tagName){var r=e("<"+t+">").attr("data-verified","redactor").attr("data-redactor-tag",t);r.html(this.opts.invisibleSpace),r=this.inline.setFormat(r),r=this.insert.node(r),this.caret.setEnd(r),this.code.sync()}else this.utils.isEmpty(i.text())?(this.caret.setAfter(i[0]),i.remove(),this.code.sync()):this.utils.isEndOfElement(i)&&this.caret.setAfter(i[0])},formatMultiple:function(t){if(this.inline.formatConvert(t),document.execCommand("strikethrough"),this.selection.save(),this.$editor.find("strike").each(e.proxy((function(n,i){var r,a=e(i);if(this.inline.formatRemoveSameChildren(a,t),this.inline.type?(r=e("<span>").attr("data-redactor-tag",t).attr("data-verified","redactor"),r=this.inline.setFormat(r)):r=e("<"+t+">").attr("data-redactor-tag",t).attr("data-verified","redactor"),a.replaceWith(r.html(a.contents())),"span"===t){var o=r.parent();if(o&&"SPAN"===o[0].tagName&&"style"===this.inline.type)for(var s=this.inline.value.split(";"),l=0;l<s.length;l++){if(""===s[l])return;var d=s[l].split(":");o.css(d[0],""),this.utils.removeEmptyAttr(o,"style")&&o.replaceWith(o.contents())}}}),this)),"span"!==t&&this.$editor.find(this.opts.inlineTags.join(", ")).each(e.proxy((function(t,n){var i=e(n);"line-through"===i.css("text-decoration")&&(i.css("text-decoration",""),this.utils.removeEmptyAttr(i,"style"))}),this)),"del"!==t){var n=this;this.$editor.find("inline").each((function(e,t){n.utils.replaceToTag(t,"del")}))}this.selection.restore(),this.code.sync()},formatRemoveSameChildren:function(t,n){var i=this;t.children(n).each((function(){var t=e(this);if(!t.hasClass("redactor-selection-marker"))if("style"===i.inline.type)for(var n=i.inline.value.split(";"),r=0;r<n.length;r++){if(""===n[r])return;var a=n[r].split(":");t.css(a[0],""),i.utils.removeEmptyAttr(t,"style")&&t.replaceWith(t.contents())}else t.contents().unwrap()}))},formatConvert:function(t){this.selection.save();var n="";"class"===this.inline.type?n="[data-redactor-class="+this.inline.value+"]":"style"===this.inline.type&&(n='[data-redactor-style="'+this.inline.value+'"]');var i=this;"del"!==t&&this.$editor.find("del").each((function(e,t){i.utils.replaceToTag(t,"inline")})),"span"!==t&&this.$editor.find(t).each((function(){var t=e(this);t.replaceWith(e("<strike />").html(t.contents()))})),this.$editor.find('[data-redactor-tag="'+t+'"]'+n).each((function(){if(""!==n||"span"!==t||this.tagName.toLowerCase()!==t){var i=e(this);i.replaceWith(e("<strike />").html(i.contents()))}})),this.selection.restore()},setFormat:function(e){switch(this.inline.type){case"class":e.hasClass(this.inline.value)?(e.removeClass(this.inline.value),e.removeAttr("data-redactor-class")):(e.addClass(this.inline.value),e.attr("data-redactor-class",this.inline.value));break;case"style":e[0].style.cssText=this.inline.value,e.attr("data-redactor-style",this.inline.value)}return e},removeStyle:function(){this.buffer.set();var t=this.selection.getCurrent(),n=this.selection.getInlines();if(this.selection.save(),t&&"SPAN"===t.tagName){var i=e(t);i.removeAttr("style"),0===i[0].attributes.length&&i.replaceWith(i.contents())}e.each(n,e.proxy((function(t,n){var i=e(n);-1!==e.inArray(n.tagName.toLowerCase(),this.opts.inlineTags)&&!i.hasClass("redactor-selection-marker")&&(i.removeAttr("style"),0===i[0].attributes.length&&i.replaceWith(i.contents()))}),this)),this.selection.restore(),this.code.sync()},removeStyleRule:function(t){this.buffer.set();var n=this.selection.getParent(),i=this.selection.getInlines();if(this.selection.save(),n&&"SPAN"===n.tagName){var r=e(n);r.css(t,""),this.utils.removeEmptyAttr(r,"style"),0===r[0].attributes.length&&r.replaceWith(r.contents())}e.each(i,e.proxy((function(n,i){var r=e(i);-1!==e.inArray(i.tagName.toLowerCase(),this.opts.inlineTags)&&!r.hasClass("redactor-selection-marker")&&(r.css(t,""),this.utils.removeEmptyAttr(r,"style"),0===r[0].attributes.length&&r.replaceWith(r.contents()))}),this)),this.selection.restore(),this.code.sync()},removeFormat:function(){this.buffer.set();var t=this.selection.getCurrent();this.selection.save(),document.execCommand("removeFormat"),t&&"SPAN"===t.tagName&&e(t).replaceWith(e(t).contents()),e.each(this.selection.getNodes(),e.proxy((function(t,n){var i=e(n);-1!==e.inArray(n.tagName.toLowerCase(),this.opts.inlineTags)&&!i.hasClass("redactor-selection-marker")&&i.replaceWith(i.contents())}),this)),this.selection.restore(),this.code.sync()},toggleClass:function(e){this.inline.format("span","class",e)},toggleStyle:function(e){this.inline.format("span","style",e)}},t})),n("modules/insert",["jquery"],(function(e){"use strict";function t(){}return t.prototype={set:function(t,n){this.placeholder.remove(),t=this.clean.setVerified(t),void 0===n&&(t=this.clean.onPaste(t,!1)),this.$editor.html(t),this.selection.remove(),this.focus.setEnd(),this.clean.normalizeLists(),this.code.sync(),this.observe.load(),void 0===n&&setTimeout(e.proxy(this.clean.clearUnverified,this),10)},text:function(t){if(this.placeholder.remove(),t=t.toString(),t=e.trim(t),t=this.clean.getPlainText(t,!1),this.$editor[0].focus(),this.utils.browser("msie"))this.insert.htmlIe(t);else{this.selection.get(),this.range.deleteContents();var n=document.createElement("div");n.innerHTML=t;for(var i,r,a=document.createDocumentFragment();i=n.firstChild;)r=a.appendChild(i);if(this.range.insertNode(a),r){var o=this.range.cloneRange();o.setStartAfter(r),o.collapse(!0),this.sel.removeAllRanges(),this.sel.addRange(o)}}this.code.sync(),this.clean.clearUnverified()},htmlWithoutClean:function(e){this.insert.html(e,!1)},html:function(t,n){this.placeholder.remove(),void 0===n&&(n=!0),this.$editor[0].focus(),t=this.clean.setVerified(t),n&&(t=this.clean.onPaste(t)),this.utils.browser("msie")?this.insert.htmlIe(t):(this.clean.singleLine?this.insert.execHtml(t):document.execCommand("insertHTML",!1,t),this.insert.htmlFixMozilla()),this.clean.normalizeLists(),this.opts.linebreaks||this.$editor.find("p").each(e.proxy(this.utils.removeEmpty,this)),this.code.sync(),this.observe.load(),n&&this.clean.clearUnverified()},htmlFixMozilla:function(){if(this.utils.browser("mozilla")){var t=e(this.selection.getBlock()).next();t.length>0&&"P"===t[0].tagName&&""===t.html()&&t.remove()}},htmlIe:function(t){if(this.utils.isIe11()){var n=this.utils.isCurrentOrParent("P"),i=e("<div>").append(t).contents().is("p, :header, dl, ul, ol, div, table, td, blockquote, pre, address, section, header, footer, aside, article");n&&i?this.insert.ie11FixInserting(n,t):this.insert.ie11PasteFrag(t)}else document.selection.createRange().pasteHTML(t)},execHtml:function(e){e=this.clean.setVerified(e),this.selection.get(),this.range.deleteContents();var t=document.createElement("div");t.innerHTML=e;for(var n,i,r=document.createDocumentFragment();n=t.firstChild;)i=r.appendChild(n);this.range.insertNode(r),this.range.collapse(!0),this.caret.setAfter(i)},node:function(t,n){t=t[0]||t;var i=this.utils.getOuterHtml(t);return null!==(i=this.clean.setVerified(i)).match(/</g)&&(t=e(i)[0]),this.selection.get(),!1!==n&&this.range.deleteContents(),this.range.insertNode(t),this.range.collapse(!1),this.selection.addRange(),t},nodeToPoint:function(e,t,n){var i;if(e=e[0]||e,this.selection.get(),document.caretPositionFromPoint){var r=document.caretPositionFromPoint(t,n);this.range.setStart(r.offsetNode,r.offset),this.range.collapse(!0),this.range.insertNode(e)}else if(document.caretRangeFromPoint)(i=document.caretRangeFromPoint(t,n)).insertNode(e);else if(void 0!==document.body.createTextRange){(i=document.body.createTextRange()).moveToPoint(t,n);var a=i.duplicate();a.moveToPoint(t,n),i.setEndPoint("EndToEnd",a),i.select()}},nodeToCaretPositionFromPoint:function(e,t){t=t[0]||t;var n,i=e.clientX,r=e.clientY;if(document.caretPositionFromPoint){var a=document.caretPositionFromPoint(i,r);(n=document.getSelection().getRangeAt(0)).setStart(a.offsetNode,a.offset),n.collapse(!0),n.insertNode(t)}else if(document.caretRangeFromPoint)(n=document.caretRangeFromPoint(i,r)).insertNode(t);else if(void 0!==document.body.createTextRange){(n=document.body.createTextRange()).moveToPoint(i,r);var o=n.duplicate();o.moveToPoint(i,r),n.setEndPoint("EndToEnd",o),n.select()}},ie11FixInserting:function(t,n){var i=document.createElement("span");i.className="redactor-ie-paste",this.insert.node(i);var r=e(t).html();r="<p>"+r.replace(/<span class="redactor-ie-paste"><\/span>/gi,"</p>"+n+"<p>")+"</p>",e(t).replaceWith(r)},ie11PasteFrag:function(e){this.selection.get(),this.range.deleteContents();var t=document.createElement("div");t.innerHTML=e;for(var n,i=document.createDocumentFragment();n=t.firstChild;)i.appendChild(n);this.range.insertNode(i),this.range.collapse(!1),this.selection.addRange()}},t})),n("modules/keydown",["jquery"],(function(e){"use strict";function t(){}return t.prototype={init:function(t){if(!this.rtePaste){var n,i=t.which,r=i>=37&&i<=40;if(this.keydown.ctrl=t.ctrlKey||t.metaKey,this.keydown.current=this.selection.getCurrent(),this.keydown.parent=this.selection.getParent(),this.keydown.block=this.selection.getBlock(),this.keydown.pre=this.utils.isTag(this.keydown.current,"pre"),this.keydown.blockquote=this.utils.isTag(this.keydown.current,"blockquote"),this.keydown.figcaption=this.utils.isTag(this.keydown.current,"figcaption"),this.shortcuts.init(t,i),this.keydown.checkEvents(r,i),this.keydown.setupBuffer(t,i),this.keydown.addArrowsEvent(r),this.keydown.setupSelectAll(t,i),!1===this.core.setCallback("keydown",t))return t.preventDefault(),!1;if(this.opts.enterKey&&(this.utils.browser("msie")||this.utils.browser("mozilla"))&&(i===this.keyCode.DOWN||i===this.keyCode.RIGHT)){var a=!1,o=!1;this.keydown.block&&"TD"===this.keydown.block.tagName&&(o=e(this.keydown.block).closest("table",this.$editor[0])),o&&o.find("td").last()[0]===this.keydown.block&&(a=!0),this.utils.isEndOfElement()&&a&&(n=e(this.opts.emptyHtml),o.after(n),this.caret.setStart(n))}if(this.opts.enterKey&&i===this.keyCode.DOWN&&this.keydown.onArrowDown(),!this.opts.enterKey&&i===this.keyCode.ENTER)return t.preventDefault(),void(this.range.collapsed||this.range.deleteContents());if(i===this.keyCode.ENTER&&!t.shiftKey&&!t.ctrlKey&&!t.metaKey){var s,l;if(!1===this.core.setCallback("enter",t))return t.preventDefault(),!1;if(this.keydown.blockquote&&!0===this.keydown.exitFromBlockquote(t))return!1;if(this.keydown.pre)return this.keydown.insertNewLine(t);if(this.keydown.blockquote||this.keydown.figcaption)return s=this.selection.getCurrent(),0!==(l=e(s).next()).length&&"BR"===l[0].tagName?this.keydown.insertBreakLine(t):this.utils.isEndOfElement()&&s&&"SPAN"!==s?this.keydown.insertDblBreakLine(t):this.keydown.insertBreakLine(t);if(this.opts.linebreaks&&!this.keydown.block)return s=this.selection.getCurrent(),0!==(l=e(this.keydown.current).next()).length&&"BR"===l[0].tagName?this.keydown.insertBreakLine(t):!1!==s&&e(s).hasClass("redactor-invisible-space")?(this.caret.setAfter(s),e(s).contents().unwrap(),this.keydown.insertDblBreakLine(t)):this.utils.isEndOfEditor()?this.keydown.insertDblBreakLine(t):(0===l.length&&!1===s&&l.context,this.keydown.insertBreakLine(t));if(this.opts.linebreaks&&this.keydown.block)setTimeout(e.proxy(this.keydown.replaceDivToBreakLine,this),1);else if(!this.opts.linebreaks&&this.keydown.block)if("LI"!==this.keydown.block.tagName)setTimeout(e.proxy(this.keydown.replaceDivToParagraph,this),1);else{s=this.selection.getCurrent();var d=e(s).closest("li",this.$editor[0]),c=d.closest("ul,ol",this.$editor[0]);if(0!==d.length&&this.utils.isEmpty(d.html())&&0===c.next().length&&this.utils.isEmpty(c.find("li").last().html()))return c.find("li").last().remove(),n=e(this.opts.emptyHtml),c.after(n),this.caret.setStart(n),!1}else if(!this.opts.linebreaks&&!this.keydown.block)return this.keydown.insertParagraph(t)}return i===this.keyCode.ENTER&&(t.ctrlKey||t.shiftKey)?this.keydown.onShiftEnter(t):i===this.keyCode.TAB||t.metaKey&&221===i||t.metaKey&&219===i?this.keydown.onTab(t,i):(i===this.keyCode.BACKSPACE&&(this.keydown.removeInvisibleSpace(),this.keydown.removeEmptyListInTable(t)),void this.code.sync())}},checkEvents:function(e,t){!e&&("click"===this.core.getEvent()||"arrow"===this.core.getEvent())&&(this.core.addEvent(!1),
this.keydown.checkKeyEvents(t)&&this.buffer.set())},checkKeyEvents:function(t){var n=this.keyCode,i=[n.BACKSPACE,n.DELETE,n.ENTER,n.SPACE,n.ESC,n.TAB,n.CTRL,n.META,n.ALT,n.SHIFT];return-1===e.inArray(t,i)},addArrowsEvent:function(e){e&&("click"!==this.core.getEvent()&&"arrow"!==this.core.getEvent()?this.core.addEvent("arrow"):this.core.addEvent(!1))},setupBuffer:function(e,t){return this.keydown.ctrl&&90===t&&!e.shiftKey&&!e.altKey&&this.opts.buffer.length?(e.preventDefault(),void this.buffer.undo()):this.keydown.ctrl&&90===t&&e.shiftKey&&!e.altKey&&0!==this.opts.rebuffer.length?(e.preventDefault(),void this.buffer.redo()):void(this.keydown.ctrl||(t===this.keyCode.BACKSPACE||t===this.keyCode.DELETE||t===this.keyCode.ENTER&&!e.ctrlKey&&!e.shiftKey||t===this.keyCode.SPACE)&&this.buffer.set())},setupSelectAll:function(e,t){this.keydown.ctrl&&65===t?this.utils.enableSelectAll():t!==this.keyCode.LEFT_WIN&&!this.keydown.ctrl&&this.utils.disableSelectAll()},onArrowDown:function(){for(var e=[this.keydown.blockquote,this.keydown.pre,this.keydown.figcaption],t=0;t<e.length;t++)if(e[t])return this.keydown.insertAfterLastElement(e[t]),!1},onShiftEnter:function(e){return this.buffer.set(),this.utils.isEndOfElement()?this.keydown.insertDblBreakLine(e):this.keydown.insertBreakLine(e)},onTab:function(e,t){return!this.opts.tabKey||(!(!this.utils.isEmpty(this.code.get())||!1!==this.opts.tabAsSpaces)||(e.preventDefault(),this.keydown.pre&&!e.shiftKey?(n=this.opts.preSpaces?document.createTextNode(new Array(this.opts.preSpaces+1).join("\xa0")):document.createTextNode("\t"),this.insert.node(n),this.code.sync()):!1!==this.opts.tabAsSpaces?(n=document.createTextNode(new Array(this.opts.tabAsSpaces+1).join("\xa0")),this.insert.node(n),this.code.sync()):e.metaKey&&219===t?this.indent.decrease():e.metaKey&&221===t?this.indent.increase():e.shiftKey?this.indent.decrease():this.indent.increase(),!1));var n},replaceDivToBreakLine:function(){var t=this.selection.getBlock(),n=t.innerHTML.replace(/<br\s?\/?>/gi,"");if(("DIV"===t.tagName||"P"===t.tagName)&&""===n&&!e(t).hasClass("redactor-editor")){var i=document.createElement("br");return e(t).replaceWith(i),this.caret.setBefore(i),this.code.sync(),!1}},replaceDivToParagraph:function(){var t=this.selection.getBlock(),n=t.innerHTML.replace(/<br\s?\/?>/gi,"");if("DIV"===t.tagName&&""===n&&!e(t).hasClass("redactor-editor")){var i=document.createElement("p");return i.innerHTML=this.opts.invisibleSpace,e(t).replaceWith(i),this.caret.setStart(i),this.code.sync(),!1}this.opts.cleanStyleOnEnter&&"P"===t.tagName&&e(t).removeAttr("class").removeAttr("style")},insertParagraph:function(e){var t;return e.preventDefault(),this.selection.get(),!1===this.selection.getParent()&&((t=document.createElement("p")).innerHTML=this.$editor.html(),this.selection.selectAll(),this.range.deleteContents(),this.range.insertNode(t),this.caret.setAfter(t)),(t=document.createElement("p")).innerHTML=this.opts.invisibleSpace,this.range.deleteContents(),this.range.insertNode(t),this.caret.setStart(t),this.code.sync(),!1},exitFromBlockquote:function(t){if(this.utils.isEndOfElement()){var n=e.trim(e(this.keydown.block).html());if(-1!==n.search(/(<br\s?\/?>){2}$/i)){if(t.preventDefault(),this.opts.linebreaks){var i=document.createElement("br");e(this.keydown.blockquote).after(i),this.caret.setBefore(i),e(this.keydown.block).html(n.replace(/<br\s?\/?>$/i,""))}else{var r=e(this.opts.emptyHtml);e(this.keydown.blockquote).after(r),this.caret.setStart(r)}return!0}}},insertAfterLastElement:function(t){if(this.utils.isEndOfElement())if(this.buffer.set(),this.opts.linebreaks){var n=e("<div>").append(e.trim(this.$editor.html())).contents(),i=n.last()[0];if("SPAN"===i.tagName&&""===i.innerHTML&&(i=n.prev()[0]),this.utils.getOuterHtml(i)!==this.utils.getOuterHtml(t))return;var r=document.createElement("br");e(t).after(r),this.caret.setAfter(r)}else{if(this.$editor.contents().last()[0]!==t)return;var a=e(this.opts.emptyHtml);e(t).after(a),this.caret.setStart(a)}},insertNewLine:function(e){e.preventDefault();var t=document.createTextNode("\n");return this.selection.get(),this.range.deleteContents(),this.range.insertNode(t),this.caret.setAfter(t),this.code.sync(),!1},insertBreakLine:function(e){return this.keydown.insertBreakLineProcessing(e)},insertDblBreakLine:function(e){return this.keydown.insertBreakLineProcessing(e,!0)},insertBreakLineProcessing:function(t,n){t.stopPropagation(),this.selection.get();var i=document.createElement("br");this.utils.browser("msie")?(this.range.collapse(!1),this.range.setEnd(this.range.endContainer,this.range.endOffset)):this.range.deleteContents(),this.range.insertNode(i);var r=e(i).parent("a");if(r.length>0&&(r.find(i).remove(),r.after(i)),!0===n){var a=e(i).next();if(0!==a.length&&"BR"===a[0].tagName&&this.utils.isEndOfEditor())return this.caret.setAfter(i),this.code.sync(),!1;var o=document.createElement("br");this.range.insertNode(o),this.caret.setAfter(o)}else this.keydown.insertBreakLineProcessingAfter(i);return this.code.sync(),!1},insertBreakLineProcessingAfter:function(t){var n=this.utils.createSpaceElement();e(t).after(n),this.selection.selectElement(n),e(n).replaceWith((function(){return e(this).contents()}))},removeInvisibleSpace:function(){var t=e(this.keydown.current);0===t.text().search(/^\u200B$/g)&&t.remove()},removeEmptyListInTable:function(t){var n=e(this.keydown.current),i=e(this.keydown.parent),r=n.closest("td",this.$editor[0]);if(0!==r.length&&n.closest("li",this.$editor[0])&&1===i.children("li").length){if(!this.utils.isEmpty(n.text()))return;t.preventDefault(),n.remove(),i.remove(),this.caret.setStart(r)}}},t})),n("modules/keyup",["jquery"],(function(e){"use strict";function t(){}return t.prototype={init:function(t){if(!this.rtePaste){var n=t.which;this.keyup.current=this.selection.getCurrent(),this.keyup.parent=this.selection.getParent();var i=this.utils.isRedactorParent(e(this.keyup.parent).parent());return this.code.sync(),!1===this.core.setCallback("keyup",t)?(t.preventDefault(),!1):(!this.opts.linebreaks&&3===this.keyup.current.nodeType&&this.keyup.current.length<=1&&(!1===this.keyup.parent||"BODY"===this.keyup.parent.tagName)&&this.keyup.replaceToParagraph(),!this.opts.linebreaks&&this.utils.isRedactorParent(this.keyup.current)&&"DIV"===this.keyup.current.tagName&&this.keyup.replaceToParagraph(!1),!this.opts.linebreaks&&e(this.keyup.parent).hasClass("redactor-invisible-space")&&(!1===i||"BODY"===i[0].tagName)&&(e(this.keyup.parent).contents().unwrap(),this.keyup.replaceToParagraph()),this.linkify.isEnabled()&&this.linkify.isKey(n)&&this.linkify.format(),n===this.keyCode.DELETE||n===this.keyCode.BACKSPACE?(this.clean.clearUnverified(),this.observe.image?(t.preventDefault(),this.image.hideResize(),this.buffer.set(),this.image.remove(this.observe.image),this.observe.image=!1,!1):(this.$editor.find("p").each(e.proxy((function(t,n){this.utils.removeEmpty(t,e(n).html())}),this)),this.opts.linebreaks&&this.keyup.current&&"DIV"===this.keyup.current.tagName&&this.utils.isEmpty(this.keyup.current.innerHTML)&&(e(this.keyup.current).after(this.selection.getMarkerAsHtml()),this.selection.restore(),e(this.keyup.current).remove()),this.keyup.formatEmpty(t))):void 0)}},replaceToParagraph:function(t){var n,i=e(this.keyup.current);n=!1===t?e("<p>").append(i.html()):e("<p>").append(i.clone()),i.replaceWith(n);var r=e(n).next();void 0!==r[0]&&"BR"===r[0].tagName&&r.remove(),this.caret.setEnd(n)},formatEmpty:function(t){var n=e.trim(this.$editor.html());if(this.utils.isEmpty(n))return t.preventDefault(),this.opts.linebreaks?(this.$editor.html(this.selection.getMarkerAsHtml()),this.selection.restore()):(n="<p><br /></p>",this.$editor.html(n),this.focus.setStart()),this.code.sync(),!1}},t})),n("modules/lang",[],(function(){"use strict";function e(){}return e.prototype={load:function(){this.opts.curLang=this.opts.langs[this.opts.lang]},get:function(e){return void 0!==this.opts.curLang[e]?this.opts.curLang[e]:""}},e})),n("modules/line",["jquery"],(function(e){"use strict";function t(){}return t.prototype={insert:function(){this.buffer.set();var e=this.selection.getBlocks();!1!==e[0]&&this.line.isExceptLastOrFirst(e)?this.utils.browser("msie")||this.$editor.focus():this.utils.browser("msie")?this.line.insertInIe():this.line.insertInOthersBrowsers()},isExceptLastOrFirst:function(t){var n=["li","td","th","blockquote","figcaption","pre","dl","dt","dd"],i=t[0].tagName.toLowerCase(),r=this.selection.getLastBlock();r=void 0===r?i:r.tagName.toLowerCase();var a=-1!==e.inArray(i,n),o=-1!==e.inArray(r,n);if(a&&o||a)return!0},insertInIe:function(){this.utils.saveScroll(),this.buffer.set(),this.insert.node(document.createElement("hr")),this.utils.restoreScroll(),this.code.sync()},insertInOthersBrowsers:function(){this.buffer.set();var e='<p id="redactor-insert-line"><br /></p>';this.opts.linebreaks&&(e='<br id="redactor-insert-line">'),document.execCommand("insertHTML",!1,"<hr>"+e),this.line.setFocus(),this.code.sync()},setFocus:function(){var t=this.$editor.find("#redactor-insert-line");e(t).next()[0]?(this.caret.setAfter(t),t.remove()):t.removeAttr("id")}},t})),n("text",["module"],(function(e){"use strict";var n,i,r,a,o,s=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],l=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,d=/<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,c="undefined"!=typeof location&&location.href,u=c&&location.protocol&&location.protocol.replace(/\:/,""),f=c&&location.hostname,h=c&&(location.port||void 0),p={},g=e.config&&e.config()||{};return n={version:"2.0.14",strip:function(e){if(e){var t=(e=e.replace(l,"")).match(d);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:g.createXhr||function(){var e,t,n;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(t=0;t<3;t+=1){n=s[t];try{e=new ActiveXObject(n)}catch(e){}if(e){s=[n];break}}return e},parseName:function(e){var t,n,i,r=!1,a=e.lastIndexOf("."),o=0===e.indexOf("./")||0===e.indexOf("../");return-1!==a&&(!o||a>1)?(t=e.substring(0,a),n=e.substring(a+1)):t=e,-1!==(a=(i=n||t).indexOf("!"))&&(r="strip"===i.substring(a+1),i=i.substring(0,a),n?n=i:t=i),{moduleName:t,ext:n,strip:r}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(e,t,i,r){var a,o,s,l=n.xdRegExp.exec(e);return!l||(a=l[2],s=(o=(o=l[3]).split(":"))[1],o=o[0],!(a&&a!==t||o&&o.toLowerCase()!==i.toLowerCase()||(s||o)&&s!==r))},finishLoad:function(e,t,i,r){i=t?n.strip(i):i,g.isBuild&&(p[e]=i),r(i)},load:function(e,t,i,r){if(r&&r.isBuild&&!r.inlineText)i();else{g.isBuild=r&&r.isBuild;var a=n.parseName(e),o=a.moduleName+(a.ext?"."+a.ext:""),s=t.toUrl(o),l=g.useXhr||n.useXhr;0!==s.indexOf("empty:")?!c||l(s,u,f,h)?n.get(s,(function(t){n.finishLoad(e,a.strip,t,i)}),(function(e){i.error&&i.error(e)})):t([o],(function(e){n.finishLoad(a.moduleName+"."+a.ext,a.strip,e,i)})):i()}},write:function(e,t,i){if(p.hasOwnProperty(t)){var r=n.jsEscape(p[t]);i.asModule(e+"!"+t,"define(function () { return '"+r+"';});\n")}},writeFile:function(e,t,i,r,a){var o=n.parseName(t),s=o.ext?"."+o.ext:"",l=o.moduleName+s,d=i.toUrl(o.moduleName+s)+".js";n.load(l,i,(function(){var t=function(e){return r(d,e)};t.asModule=function(e,t){return r.asModule(e,d,t)},n.write(e,l,t,a)}),a)}},"node"===g.env||!g.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"]?(i=t.nodeRequire("fs"),n.get=function(e,t,n){try{var r=i.readFileSync(e,"utf8");"\ufeff"===r[0]&&(r=r.substring(1)),t(r)}catch(e){n&&n(e)}}):"xhr"===g.env||!g.env&&n.createXhr()?n.get=function(e,t,i,r){var a,o=n.createXhr();if(o.open("GET",e,!0),r)for(a in r)r.hasOwnProperty(a)&&o.setRequestHeader(a.toLowerCase(),r[a]);g.onXhr&&g.onXhr(o,e),o.onreadystatechange=function(){var n,r;4===o.readyState&&((n=o.status||0)>399&&n<600?((r=new Error(e+" HTTP status: "+n)).xhr=o,i&&i(r)):t(o.responseText),g.onXhrComplete&&g.onXhrComplete(o,e))},o.send(null)}:"rhino"===g.env||!g.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?n.get=function(e,t){var n,i,r="utf-8",a=new java.io.File(e),o=java.lang.System.getProperty("line.separator"),s=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(a),r)),l="";try{for(n=new java.lang.StringBuffer,(i=s.readLine())&&i.length()&&65279===i.charAt(0)&&(i=i.substring(1)),null!==i&&n.append(i);null!==(i=s.readLine());)n.append(o),n.append(i);l=String(n.toString())}finally{s.close()}t(l)}:("xpconnect"===g.env||!g.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(r=Components.classes,a=Components.interfaces,Components.utils.import("resource://gre/modules/FileUtils.jsm"),o="@mozilla.org/windows-registry-key;1"in r,n.get=function(e,t){var n,i,s,l={};o&&(e=e.replace(/\//g,"\\")),s=new FileUtils.File(e);try{(n=r["@mozilla.org/network/file-input-stream;1"].createInstance(a.nsIFileInputStream)).init(s,1,0,!1),(i=r["@mozilla.org/intl/converter-input-stream;1"].createInstance(a.nsIConverterInputStream)).init(n,"utf-8",n.available(),a.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),i.readString(n.available(),l),i.close(),n.close(),t(l.value)}catch(e){throw new Error((s&&s.path||"")+": "+e)}}),n})),n("text!view/link/insert_anchor_modal.html",[],(function(){return'<section id="redactor-modal-link">\n\t<label for="redactor-link-id">ID</label>\n\t<input type="text" id="redactor-anchor-id" class="redactor-input" />\n</section>\n'})),n("text!view/link/link_modal.html",[],(function(){return'<section id="redactor-modal-link">\n\t<div class="redactor-tab redactor-tab1">\n\t\t<label>URL</label>\n\t\t<input type="text" id="redactor-link-url" class="redactor-input" />\n\t</div>\n\t<div class="redactor-tab redactor-tab2" style="display: none;">\n\t\t<label><%= curLang.site_page %></label>\n\t\t<div class="redactor-site-page-selected">\n\t\t\t<span class="redactor-site-page-selected-text"><%= curLang.site_page_select %></span>\n\t\t\t<button type="button" class="redactor-link-site-page-browse" title="<%= curLang.site_page_browse_title %>"><%= curLang.browse %></button>\n\t\t\t<% if (browseComposerSiteURL) { %>\n\t\t\t\t<button type="button" class="redactor-link-composer-site-page-browse" title="<%= curLang.composer_site_page_browse_title %>"><%= curLang.browse_composer %></button>\n\t\t\t<% } %>\n\t\t</div>\n\t</div>\n\t<div class="redactor-tab redactor-tab3" style="display: none;">\n\t\t<label><%= curLang.site_file %></label>\n\t\t<div class="redactor-site-file-selected">\n\t\t\t<span class="redactor-site-file-selected-text"><%= curLang.site_file_select %></span>\n\t\t\t<button type="button" class="redactor-link-site-file-browse" title="<%= curLang.site_file_browse_title %>"><%= curLang.browse %></button>\n\t\t</div>\n\t</div>\n\t<div class="redactor-tab redactor-tab4" style="display: none;">\n\t\t<label><%= curLang.media %></label>\n\t\t<div class="redactor-media-selected">\n\t\t\t<span class="redactor-media-selected-text"><%= curLang.media_select %></span>\n\t\t\t<button type="button" class="redactor-link-media-browse" title="<%= curLang.media_browse_title %>"><%= curLang.browse %></button>\n\t\t\t<input type="checkbox" id="redactor-link-media-show-title"> <label for="redactor-link-media-show-title">Display Media Title</label>\n\t\t\t<input type="checkbox" id="redactor-link-media-show-description"> <label for="redactor-link-media-show-description">Display Media Description</label>\n\t\t</div>\n\t</div>\n\t<div class="redactor-tab redactor-tab5" style="display: none;">\n\t\t<label for="redactor-anchor-id">Anchor</label>\n\t\t<select id="redactor-anchor-id">\n\t\t\t<option value="">Choose Anchor...</option>\n\t\t</select>\n\t</div>\n\t<input type="checkbox" class="redactor-link-blank" id="redactor-link-blank"><label for="redactor-link-blank"><%= curLang.link_new_tab %></label><br />\n\t<label for="redactor-link-title"><%= curLang.title %><span class="redactor-tooltip" data-title="<%= curLang.title_attr_description %>">?</span></label>\n\t<input type="text" id="redactor-link-title" class="redactor-input" />\n\t<label for="redactor-link-class"><%= curLang.class %> <span class="redactor-tooltip" data-title="<%= curLang.class_attr_description %>">?</span></label>\n\t<input type="text" id="redactor-link-class" placeholder="Choose Style..." class="redactor-input" />\n\t<label for="redactor-link-id">ID <span class="redactor-tooltip" data-title="<%= curLang.id_attr_description %>">?</span></label>\n\t<input type="text" id="redactor-link-id" class="redactor-input" />\n</section>\n'})),n("modules/link",["jquery","underscore","text!view/link/insert_anchor_modal.html","text!view/link/link_modal.html"],(function(e,t,n,i){"use strict";function r(){}return r.prototype={initialize:function(){this.link.show=this.link.show,this.$toolbar.find(".redactor-dropdown-box-link").remove();var r=this,a=this.$toolbar.find(".re-link").closest("li"),o={title:this.opts.curLang.link},s=this.button.build("link",o),l={"1editlink":{title:"Insert/Edit Link (ctrl + k)",func:this.link.show},"2editanchor":{title:"Add/Edit Anchor",func:this.link.showAnchor},"3hideshowanchors":{title:"Hide Anchors",func:this.link.toggleAnchors}};a.empty().append(s),this.button.addDropdown(s,l),e(s).on("click",(function(){r.$editor.hasClass("redactor-hide-anchors")?e(".redactor-dropdown-box-link .redactor-dropdown-3hideshowanchors").text("Show Anchors"):e(".redactor-dropdown-box-link .redactor-dropdown-3hideshowanchors").text("Hide Anchors")})),this.opts.link=e.extend({onMediaBrowseReturn:function(e){return e},onFileBrowseReturn:function(e){return e},onPageBrowseReturn:function(e){return e},anchorTest:/^#/,mediaTest:/^\/media\/\d/gi,siteFileTest:/^\/?(file.cfm|\/?uploaded)/gi,sitePageTest:/^\/pages\/\d/gi,anchorSelector:".redactor-editor [id]"},this.opts.link),this.opts.modal_insertAnchor=n,this.opts.modal_link=t.template(i)(this.opts)},show:function(){if(this.selectionHTML=this.selection.getHtml(),e(".redactor-link-tooltip").remove(),e("#redactor-overlay-box.redactor-overlay-type-img").length){var t=this.fs.$editTarget;this.fs.hideEditableControls(!1),this.selection.get(),this.range.selectNode(t.get(0)),this.selection.addRange()}this.modal.addTemplate("link",this.opts.modal_link),this.modal.load("link",this.opts.curLang.link+" Settings",540);var n=this.modal.getModal();this.modal.createTabber(n),this.modal.addTab(1,"URL","active"),this.modal.addTab(2,this.opts.curLang.site_page),this.modal.addTab(3,this.opts.curLang.site_file),this.modal.addTab(4,this.opts.curLang.media),this.modal.addTab(5,"Anchor"),this.modal.createCancelButton();var i=this.modal.createDeleteButton("Unlink"),r=this.modal.createActionButton("Save");this.selection.get(),this.link.getData();var a,o="",s="",l="",d="",c="",u="";if(this.link.$node&&(o=this.link.$node.attr("class"),s=this.link.$node.attr("title"),l=this.link.$node.attr("id"),d=this.link.$node.attr("data-page-name")||this.link.url,c=this.link.$node.attr("data-file-name")||this.link.url,u=this.link.$node.attr("data-media-name")||this.link.url,e("#redactor-link-title").val(s),e("#redactor-link-id").val(l),e("#redactor-link-class").val(o),e("#redactor-link-media-show-title").prop("checked",this.link.$node.attr("data-media-dialog-title")),e("#redactor-link-media-show-description").prop("checked",this.link.$node.attr("data-media-dialog-description")),this.link.$node.length>1&&e('#redactor-link-id, label[for="redactor-link-id"]').hide()),e.fn.selectize){var f=this.opts.classes?e.map(this.opts.classes,(function(e){return{value:e.class,text:e.name}})):[],h=e("#redactor-link-class").selectize({delimiter:" ",persist:!1,create:!0}),p=e.map(e(this.opts.link.anchorSelector),(function(e){return{value:e.id,text:e.id}}));a=e("#redactor-anchor-id").selectize({create:!0,onChange:function(t){e("#redactor-link-url").val("#"+t)}}),h[0].selectize.addOption(f),h[0].selectize.$control.on("keyup",(function(e){e.stopPropagation()})),a[0].selectize.addOption(p),a[0].selectize.$control.on("keyup",(function(e){e.stopPropagation()})),this.$element.one("modalClosed.redactor-api",(function(){h[0].selectize.destroy(),a[0].selectize.destroy()}))}var g=self.location.href.replace(/\/$/i,""),m=this.link.url.replace(g,"")||"http://";if(this.link.url.search(this.opts.link.sitePageTest)>=0)this.modal.$tabber.children(":eq(1)").click(),d&&e(".redactor-site-page-selected-text").text(d);else if(this.link.url.search(this.opts.link.siteFileTest)>=0)this.modal.$tabber.children(":eq(2)").click(),c&&e(".redactor-site-file-selected-text").text(c);else if(this.link.url.search(this.opts.link.mediaTest)>=0)this.modal.$tabber.children(":eq(3)").click(),u&&e(".redactor-media-selected-text").text(u);else if(this.link.url.search(this.opts.link.anchorTest)>=0&&(this.modal.$tabber.children(":eq(4)").click(),e.fn.selectize)){var v=this.link.url.replace("#","");a[0].selectize.addOption({value:v,text:v}),a[0].selectize.setValue(v)}e("#redactor-link-url").val(m),("_blank"===this.link.target||"http://"===m)&&e(".redactor-link-blank",this.$modal).prop("checked",!0),this.opts.browseComposerSiteURL.length>0&&this.$modal.on("click",".redactor-link-composer-site-page-browse",e.proxy((function(t){return t.preventDefault(),this.fs.modalIframeBrowse.call(this,this.opts.browseComposerSiteURL,e.proxy((function(t){t=this.opts.link.onPageBrowseReturn(t),e("#redactor-link-url").val(t.path),e(".redactor-site-page-selected-text",this.$modal).text(t.name)}),this)),!1}),this)),this.opts.browseSiteURL.length>0?this.$modal.on("click",".redactor-link-site-page-browse",e.proxy((function(t){return t.preventDefault(),this.fs.modalIframeBrowse.call(this,this.opts.browseSiteURL,e.proxy((function(t){t=this.opts.link.onPageBrowseReturn(t),e("#redactor-link-url").val(t.path),e(".redactor-site-page-selected-text",this.$modal).text(t.name)}),this)),!1}),this)):this.modal.$tabber.children(":eq(1)").hide(),this.opts.browseFileURL.length>0?this.$modal.on("click",".redactor-link-site-file-browse",e.proxy((function(t){return t.preventDefault(),this.fs.modalIframeBrowse.call(this,this.opts.browseFileURL,e.proxy((function(t){t=this.opts.link.onFileBrowseReturn(t),e("#redactor-link-url").val(t.path),e(".redactor-site-file-selected-text",this.$modal).text(t.name)}),this),620),!1}),this)):this.modal.$tabber.children(":eq(2)").hide(),this.opts.browseMediaURL.length>0?this.$modal.on("click",".redactor-link-media-browse",e.proxy((function(t){return t.preventDefault(),this.fs.modalIframeBrowse.call(this,this.opts.browseMediaURL,e.proxy((function(t){t=this.opts.link.onMediaBrowseReturn(t),e("#redactor-link-url").val(t.path),e(".redactor-media-selected-text",this.$modal).text(t.name),e("#redactor-link-url").data(t)}),this)),!1}),this)):this.modal.$tabber.children(":eq(3)").hide(),e("#redactor-modal-tabber",this.$modal).on("click","a",(function(){"http://"===m&&(1===e("#redactor-modal-tabber > a.active").index()||4===e("#redactor-modal-tabber > a.active").index()?e(".redactor-link-blank").prop("checked",!1):e(".redactor-link-blank").prop("checked",!0))})),r.on("click",this.link.linkProcess),i.on("click",e.proxy((function(){this.modal.close(),this.selection.restore(),this.link.unlink()}),this)),this.selection.save(),this.modal.show(),e("#redactor-link-url",this.$modal)[0].focus()},linkProcess:function(){var t=e.extend({class:"",href:"",target:"",title:"",id:"","data-page-name":"","data-file-name":"","data-media-name":"","data-media-dialog-title":"","data-media-dialog-description":""},e("#redactor-link-url").data("attributes")),n=e("#redactor-modal-tabber > a.active").index();if(t.href=e("#redactor-link-url").val()||"#",e(".redactor-link-blank",this.$modal).prop("checked")&&(t.target="_blank"),/^javascript:/.test(t.href)&&(t.target=""),"1"===n){var i=/((xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}/,r=new RegExp("^(http|ftp|https)://"+i,"i"),a=new RegExp("^"+i,"i");-1===t.href.search(r)&&0===t.href.search(a)&&this.opts.linkProtocol&&(t.href=this.opts.linkProtocol+t.href)}t["data-page-name"]=e(".redactor-site-page-selected-text:visible",this.$modal).text(),t["data-file-name"]=e(".redactor-site-file-selected-text:visible",this.$modal).text(),t["data-media-name"]=e(".redactor-media-selected-text:visible",this.$modal).text(),e("#redactor-link-media-show-title").is(":checked")&&(t["data-media-dialog-title"]="true"),e("#redactor-link-media-show-description").is(":checked")&&(t["data-media-dialog-description"]="true"),t.title=e.trim(this.clean.encodeEntities(e("#redactor-link-title").val())),t.class=e.trim(e("#redactor-link-class").val()),t.id=e.trim(this.fs.cleanID(e("#redactor-link-id").val())),this.link.linkInsert(t),this.modal.close()},linkInsert:function(t){var n,i=this;(this.selection.restore(),this.link.$node)?(this.buffer.set(),e.each(t,(function(e,t){i.fs.setAttr(i.link.$node,e,t)})),this.code.sync()):(this.selection.replaceWithHtml(""),this.fs.setImageFloatFix(),document.execCommand("createLink",!1,"redactor-temporary"),this.fs.unsetImageFloatFix(),(n=e('a[href="redactor-temporary"]',this.$editor)).length||(this.insert.html('<a id="redactor-inserted-link">'+t.href+"</a>"),n=e("#redactor-inserted-link").removeAttr("id")),this.selectionHTML&&n.html(this.selectionHTML),e.each(t,(function(e,t){i.fs.setAttr(n,e,t)})),""===this.link.text&&!this.link.hasImage()&&(n.text(t.href),this.selection.selectElement(n)),this.code.sync(),this.core.setCallback("insertedLink",n));setTimeout(e.proxy((function(){this.observe.links()}),this),5)},showAnchor:function(){var e=this;this.modal.addTemplate("insertAnchor",this.opts.modal_insertAnchor),this.modal.load("insertAnchor","Add/Edit Anchor",460),this.modal.createCancelButton();var t=this.modal.createActionButton("Save");this.modal.createDeleteButton("Remove").on("click",(function(){e.modal.close(),e.selection.restore(),e.link.anchorRemove()})),this.range.collapse(!0),this.selection.addRange(),t.on("click",this.link.anchorProcess),this.link.selectedAnchor=this.selection.getBlock(),this.selection.save(),this.modal.show(),e.link.selectedAnchor&&e.link.selectedAnchor.id.length&&e.$modal.find("#redactor-anchor-id").val(e.link.selectedAnchor.id)},anchorProcess:function(){var t=this.$modal.find("#redactor-anchor-id").val();if(this.$editor.find("#"+t).length&&t!==this.link.selectedAnchor.id)return this.$modal.find("p.error").remove().end().find("#redactor-anchor-id").addClass("error").after('<p class="error">ID is already in use. Please choose a different ID.</p>'),!1;this.modal.close(),this.selection.restore(),this.fs.setInlineStyle((function(n){e(n[0]).attr("id",t)}))},anchorRemove:function(){this.fs.setInlineStyle((function(t){e(t[0]).removeAttr("id")}))},toggleAnchors:function(){this.$editor.hasClass("redactor-hide-anchors")?this.$editor.removeClass("redactor-hide-anchors"):this.$editor.addClass("redactor-hide-anchors")},hasImage:function(){return e(this.selection.getNodes()).find("img").length},execUnlink:function(t,n){this.buffer.set();var i=this.currentOrParentIs("A");if(i)return e(i).replaceWith(e(i).html()),this.code.sync(),void this.callback("execCommand",t,n)},getData:function(){this.link.$node=!1;var t=e(this.selection.getCurrent()).closest("a",this.$editor[0]);0!==t.length&&"A"===t[0].tagName?(this.link.$node=t,this.link.url=t.attr("href")||"",this.link.text=t.text(),this.link.target=t.attr("target")):(this.link.text=this.sel.toString(),this.link.url="",this.link.target="")},unlink:function(t){e(".redactor-link-tooltip").remove(),void 0!==t&&t.preventDefault&&t.preventDefault();var n=this.selection.getNodes();if(n){this.buffer.set();for(var i=n.length,r=0;r<i;r++){var a=e(n[r]).closest("a",this.$editor[0]);a.replaceWith(a.contents())}e(".redactor-link-tooltip").remove(),this.code.sync()}}},r})),n("modules/linkify",["jquery"],(function(e){"use strict";function t(){}return t.prototype={isKey:function(e){return e===this.keyCode.ENTER||e===this.keyCode.SPACE},isEnabled:function(){return this.opts.convertLinks&&(this.opts.convertUrlLinks||this.opts.convertImageLinks||this.opts.convertVideoLinks)&&!this.utils.isCurrentOrParent("PRE")},format:function(){var t=this.linkify,n=this.opts;this.$editor.find(":not(iframe,img,a,pre)").addBack().contents().filter((function(){return 3===this.nodeType&&""!==e.trim(this.nodeValue)&&!e(this).parent().is("pre")&&(this.nodeValue.match(n.linkify.regexps.youtube)||this.nodeValue.match(n.linkify.regexps.vimeo)||this.nodeValue.match(n.linkify.regexps.image)||this.nodeValue.match(n.linkify.regexps.url))})).each((function(){var i=e(this).text(),r=i;n.convertVideoLinks&&(r.match(n.linkify.regexps.youtube)||r.match(n.linkify.regexps.vimeo))?r=t.convertVideoLinks(r):n.convertImageLinks&&r.match(n.linkify.regexps.image)?r=t.convertImages(r):n.convertUrlLinks&&(r=t.convertLinks(r)),e(this).before(i.replace(i,r)).remove()})),this.linkify.after()},convertVideoLinks:function(e){var t='<iframe width="500" height="281" src="',n='" frameborder="0" allowfullscreen></iframe>';return e.match(this.opts.linkify.regexps.youtube)&&(e=e.replace(this.opts.linkify.regexps.youtube,t+"//www.youtube.com/embed/$1"+n)),e.match(this.opts.linkify.regexps.vimeo)&&(e=e.replace(this.opts.linkify.regexps.vimeo,t+"//player.vimeo.com/video/$2"+n)),e},convertImages:function(e){var t=e.match(this.opts.linkify.regexps.image);return t&&(e=e.replace(e,'<img src="'+t+'" />')),e},convertLinks:function(t){var n=t.match(this.opts.linkify.regexps.url);if(n)for(var i=(n=e.grep(n,(function(t,i){return e.inArray(t,n)===i}))).length,r=0;r<i;r++){var a=n[r],o=a,s=this.opts.linkProtocol+"://";null!==a.match(/(https?|ftp):\/\//i)&&(s=""),o.length>this.opts.linkSize&&(o=o.substring(0,this.opts.linkSize)+"..."),o=decodeURIComponent(o);var l="\\b";-1!==e.inArray(a.slice(-1),["/","&","="])&&(l="");var d=new RegExp("("+a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")+l+")","g");t=t.replace(d,'<a href="'+s+e.trim(a)+'">'+e.trim(o)+"</a>")}return t},after:function(){this.observe.load(),this.code.sync()}},t})),n("modules/list",["jquery"],(function(e){"use strict";function t(){}return t.prototype={toggle:function(t){this.placeholder.remove(),this.utils.browser("msie")||this.$editor[0].focus(),this.buffer.set(),this.selection.save();var n=this.selection.getParent(),i=e(n).closest("ol, ul",this.$editor[0]);!this.utils.isRedactorParent(i)&&0!==i.length&&(i=!1);var r,a,o=!1;if(i&&i.length){o=!0;var s=i[0].tagName;r="orderedlist"===t&&"UL"===s,a="unorderedlist"===t&&"OL"===s}r?this.utils.replaceToTag(i,"ol"):a?this.utils.replaceToTag(i,"ul"):o?this.list.remove(t):this.list.insert(t),this.selection.restore(),this.code.sync()},insert:function(t){var n=this.selection.getParent(),i=this.selection.getCurrent(),r=e(i).closest("td, th",this.$editor[0]);this.utils.browser("msie")&&this.opts.linebreaks?this.list.insertInIe(t):document.execCommand("insert"+t);var a=e(this.selection.getParent()).closest("ol, ul",this.$editor[0]);if(0!==r.length){var o=r.prev(),s=r.html();r.html(""),!o||1!==o.length||"TD"!==o[0].tagName&&"TH"!==o[0].tagName?e(n).prepend(r):e(o).after(r),r.html(s)}if(this.utils.isEmpty(a.find("li").text())){var l=a.children("li");l.find("br").remove(),l.append(this.selection.getMarkerAsHtml())}if(a.length){var d=a.parent();this.utils.isRedactorParent(d)&&"LI"!==d[0].tagName&&this.utils.isBlock(d[0])&&d.replaceWith(d.contents())}this.utils.browser("msie")||this.$editor[0].focus(),this.clean.clearUnverified()},insertInIe:function(t){var n=this.selection.wrap("div"),i=e(n).html(),r=e("orderedlist"===t?"<ol>":"<ul>"),a=e("<li>");if(""===e.trim(i))a.append(this.selection.getMarkerAsHtml()),r.append(a),this.$editor.find("#selection-marker-1").replaceWith(r);else{var o=i.split(/<br\s?\/?>/gi);if(o)for(var s=0;s<o.length;s++)""!==e.trim(o[s])&&r.append(e("<li>").html(o[s]));else a.append(i),r.append(a);e(n).replaceWith(r)}},remove:function(t){document.execCommand("insert"+t);var n=e(this.selection.getCurrent());this.indent.fixEmptyIndent(),!this.opts.linebreaks&&0===n.closest("li, th, td",this.$editor[0]).length&&(document.execCommand("formatblock",!1,"p"),this.$editor.find("ul, ol, blockquote").each(e.proxy(this.utils.removeEmpty,this)));var i=e(this.selection.getCurrent()).closest("table",this.$editor[0]),r=i.prev();!this.opts.linebreaks&&0!==i.length&&0!==r.length&&"BR"===r[0].tagName&&r.remove(),this.clean.clearUnverified()}},t})),n("modules/media",["jquery"],(function(e){"use strict";function t(){}return t.prototype={initialize:function(){var t=this;this.$element.on("observed.redactor.video observed.redactor.audio observed.redactor.iframe",this.media.setEditable),
this.$toolbar.find("a.re-video").removeClass("re-video").addClass("re-embed"),this.$toolbar.find("a.re-media").addClass("re-video").removeClass("redactor-btn-image"),this.$box.on("resize",e.proxy((function(){clearTimeout(this.media.resizeDebouncer),this.media.resizeDebouncer=setTimeout(this.media.resizeMediaIframes,100)}),this)),e(window).on("blur.redactorIframeClick",(function(){t.media.iFrameMouseOver&&t.fs.loadEditableControls({element:t.media.iFrameMouseOver,buttons:t.media.iFrameButtons})})),this.opts.media=e.extend({onMediaBrowseReturn:function(e){return e},onFileBrowseReturn:function(e){return e}},this.opts.media),this.opts.modal_media_edit='<section class="redactor-media-modal">\t\t\t\t<div class="redactor-media-modalleftcol">\t\t\t\t\t<div id="redactor-media-preview">\t\t\t\t\t</div>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<legend>Size</legend>\t\t\t\t\t\t<label><input id="redactor-media-width" type="number" min="0" max="100" class="smallinput" value="100" />% Width</label>\t\t\t\t\t\t<div class="redactor-tab redactor-tab1">\t\t\t\t\t\t\t<select id="redactor-media-aspect-ratio-options" name="redactor-media-aspect-ratio">\t\t\t\t\t\t\t\t<option id="redactor-media-portrait-aspect-ratio"  type="radio" value="1.3333">Portrait (4:3)</option>\t\t\t\t\t\t\t\t<option id="redactor-media-portrait2-aspect-ratio" value="1.5">Portrait (3:2)</option>\t\t\t\t\t\t\t\t<option id="redactor-media-landscape-aspect-ratio" selected="selected" value=".5625">Landscape (16:9)</option>\t\t\t\t\t\t\t\t<option id="redactor-media-landscape2-aspect-ratio" value=".75">Landscape (4:3)</option>\t\t\t\t\t\t\t\t<option id="redactor-media-landscape3-aspect-ratio" value=".6667">Landscape (3:2)</option>\t\t\t\t\t\t\t</select>\t\t\t\t\t\t</div>\t\t\t\t\t</fieldset>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<legend>Margin</legend>\t\t\t\t\t\t<input id="redactor-media-marginTop" type="number" min="0" class="smallinput" />\t\t\t\t\t\t\t<label><select id="redactor-media-marginTop-unit"><option>px</option><option>em</option><option>%</option></select>\t\t\t\t\t\t\tTop\t\t\t\t\t\t\t</label>\t\t\t\t\t\t<input id="redactor-media-marginRight" type="number" min="0" class="smallinput" />\t\t\t\t\t\t\t<label><select id="redactor-media-marginRight-unit"><option>px</option><option>em</option><option>%</option></select>\t\t\t\t\t\t\tRight\t\t\t\t\t\t\t</label>\t\t\t\t\t\t<input id="redactor-media-marginBottom" type="number" min="0" class="smallinput" />\t\t\t\t\t\t\t<label><select id="redactor-media-marginBottom-unit"><option>px</option><option>em</option><option>%</option></select>\t\t\t\t\t\t\tBottom\t\t\t\t\t\t\t</label>\t\t\t\t\t\t<input id="redactor-media-marginLeft" type="number" min="0" class="smallinput" />\t\t\t\t\t\t\t<label><select id="redactor-media-marginLeft-unit"><option>px</option><option>em</option><option>%</option></select>\t\t\t\t\t\t\tLeft\t\t\t\t\t\t\t</label>\t\t\t\t\t</fieldset>\t\t\t\t</div>\t\t\t\t<div class="redactor-media-modalrightcol">\t\t\t\t\t<fieldset>\t\t\t\t\t\t<div class="redactor-tab redactor-tab1">\t\t\t\t\t\t\t<label>Media:</label>\t\t\t\t\t\t\t<div class="redactor-media-selected">\t\t\t\t\t\t\t\t<span class="redactor-media-selected-text">Please select from Media Manager</span>\t\t\t\t\t\t\t\t<button type="button" class="redactor-media-browse" title="Browse for media">'+this.opts.curLang.browse+'</button>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div class="redactor-tab redactor-tab2" style="display: none;">\t\t\t\t\t\t\t<label>Other Media:\t\t\t\t\t\t\t\t<span class="redactor-other-media-selected-text"></span>\t\t\t\t\t\t\t</label>\t\t\t\t\t\t\t<div class="redactor-other-media-selected">\t\t\t\t\t\t\t\t<input type="text" id="redactor-media-url" name="redactor-media-url"/>\t\t\t\t\t\t\t\t<button type="button" class="redactor-other-media-browse" title="Browse for media">'+this.opts.curLang.browse+'</button>\t\t\t\t\t\t\t\t<p class="error" style="display:none;">Only Flash, HTML5 Video & Audio files are accepted.</p>\t\t\t\t\t\t\t</div>\t\t\t\t\t\t</div>\t\t\t\t\t</fieldset>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<label for="redactor-media-align">Alignment</label>\t\t\t\t\t\t<ul id="redactor-media-align">\t\t\t\t\t\t\t<li><input id="redactor-media-align-none" name="redactor-media-align" type="radio" value="none"><label for="redactor-media-align-none">None</label></li>\t\t\t\t\t\t\t<li><input id="redactor-media-align-left" name="redactor-media-align" type="radio" value="left"><label for="redactor-media-align-left">Left</label></li>\t\t\t\t\t\t\t<li><input id="redactor-media-align-right" name="redactor-media-align" type="radio" value="right"><label for="redactor-media-align-right">Right</label></li>\t\t\t\t\t\t</ul>\t\t\t\t\t</fieldset>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<label for="redactor-media-id">ID</label><input id="redactor-media-id" />\t\t\t\t\t</fieldset>\t\t\t\t\t<fieldset>\t\t\t\t\t\t<label for="redactor-media-name">Name</label><input id="redactor-media-name" />\t\t\t\t\t</fieldset>\t\t\t\t</div>\t\t\t\t<div style="clear:both"></div>\t\t\t\t</section>'},show:function(t){var n=this;this.modal.addTemplate("media",this.opts.modal_media_edit),this.modal.load("media",this.opts.curLang.media+" Settings",600);var i=this.modal.getModal();this.modal.createTabber(i),this.modal.addTab(1,"Media Manager","active"),this.modal.addTab(2,"Other Media"),this.modal.createCancelButton();var r=this.modal.createDeleteButton("Delete"),a=this.modal.createActionButton("Save");if("string"==typeof(t=t||"media")&&this.selection.save(),e("#redactor-media-url,#redactor-media-aspect-ratio-options",this.$modal).on("change",(function(){var t=e("#redactor-media-url").val(),i=e("#redactor-media-aspect-ratio-options").val();e("#redactor-media-preview").empty(),n.media.isVideo(t)?e("#redactor-media-preview").append('<video controls="controls" src="'+t+'"/>'):n.media.isMediaEmbed(t)?(t=n.media.formatMediaURL(t,i),e("#redactor-media-preview").append('<iframe src="'+t+'" data-aspectratio="'+i+'" style="width:100%; height:'+e("#redactor-media-preview").width()*i+'px" scrolling="no" frameborder="0" class="fsEmbeddedMedia" />')):n.media.isAudio(t)&&e("#redactor-media-preview").append('<audio src="'+t+'"/>')})),1===t.length){var o=t.attr("src"),s=t[0].style,l=parseInt(s.width)||100,d=/\d+/,c=/\D+$/,u=t.attr("data-aspectratio")||".75";l>100&&(l=100),this.media.isMediaEmbed(o)||this.modal.$tabber.children(":eq(1)").click(),e("#redactor-media-url").val(o),e("#redactor-media-id").val(t.attr("id")),e("#redactor-media-name").val(t.attr("name")),e("#redactor-media-width").val(l),e("input[name=redactor-media-align][value="+t.css("float")+"]").click(),e("#redactor-media-aspect-ratio-options").val(u),e(".redactor-media-selected-text",this.$modal).text(t.attr("data-media-name")||"Please select from media manager"),e("#redactor-media-url",this.$modal).change(),e("input[type=number]",n.$modal).on("keydown",(function(e){(e.keyCode>57||e.keyCode<48)&&8!==e.keyCode&&9!==e.keyCode&&37!==e.keyCode&&39!==e.keyCode&&46!==e.keyCode&&e.preventDefault()})),e("#redactor-media-marginTop",n.$modal).val(s.marginTop.match(d)||0),e("#redactor-media-marginRight",n.$modal).val(s.marginRight.match(d)||0),e("#redactor-media-marginBottom",n.$modal).val(s.marginBottom.match(d)||0),e("#redactor-media-marginLeft",n.$modal).val(s.marginLeft.match(d)||0),e("#redactor-media-marginTop-unit",n.$modal).val(s.marginTop.match(c)||"px"),e("#redactor-media-marginRight-unit",n.$modal).val(s.marginRight.match(c)||"px"),e("#redactor-media-marginBottom-unit",n.$modal).val(s.marginBottom.match(c)||"px"),e("#redactor-media-marginLeft-unit",n.$modal).val(s.marginLeft.match(c)||"px")}this.opts.browseFileURL.length>0?this.$modal.on("click",".redactor-other-media-browse",e.proxy((function(t){return t.preventDefault(),this.fs.modalIframeBrowse.call(this,this.opts.browseFileURL,e.proxy((function(t){t=this.opts.media.onFileBrowseReturn(t),e("#redactor-media-url").val(t.path).change()}),this)),!1}),this)):this.$modal.find(".redactor-other-media-browse").hide(),this.opts.browseMediaURL.length>0?this.$modal.on("click",".redactor-media-browse",e.proxy((function(t){return t.preventDefault(),this.fs.modalIframeBrowse.call(this,this.opts.browseMediaURL,e.proxy((function(t){t=this.opts.media.onMediaBrowseReturn(t),e("#redactor-media-url").val(t.path).change(),e(".redactor-media-selected-text",this.$modal).text(t.name)}),this)),!1}),this)):(this.modal.$tabber.children(":eq(1)").click(),this.$modal.find("#redactor-modal-tabber").hide()),a.on("click",(function(){n.media.save(t)})),r.on("click",(function(){t.remove(),n.modal.close()})),this.modal.show()},save:function(t){var n,i=e("input[name=redactor-media-align]:checked").val(),r=e("#redactor-media-aspect-ratio-options").val(),a=!1,o=e("#redactor-media-id").val(),s=e("#redactor-media-width").val(),l=e("#redactor-media-marginTop").val()||0,d=e("#redactor-media-marginRight").val()||0,c=e("#redactor-media-marginBottom").val()||0,u=e("#redactor-media-marginLeft").val()||0,f=e("#redactor-media-marginTop-unit").val(),h=e("#redactor-media-marginRight-unit").val(),p=e("#redactor-media-marginBottom-unit").val(),g=e("#redactor-media-marginLeft-unit").val(),m=e("#redactor-media-name").val(),v=e(".redactor-media-selected-text",this.$modal).text(),y=e.trim(e("#redactor-media-url").val());if(!this.media.isVideo(y)&&!this.media.isMediaEmbed(y)&&!this.media.isAudio(y))return e(".redactor-other-media-selected p.error",this.$modal).show(),e("#redactor-media-url").addClass("error"),!1;this.selection.restore(),y.length&&("string"==typeof t&&(a=!0),this.media.isMediaEmbed(y)?(n=e('<iframe scrolling="no" frameborder="0" class="fsEmbeddedMedia fsEmbeddedMediaResponsive"></iframe>'),y=this.media.formatMediaURL(y,r)):this.media.isVideo(y)?n=e('<video controls="controls">HTML Video is not supported by your browser.</video>'):this.media.isAudio(y)&&(n=e('<audio controls="controls">HTML Audio is not supported by your browser.</audio>')),!a&&t[0].tagName!==n.tagName&&(e.each(t[0].attributes,(function(e,t){void 0===n[0].attributes[t.name]&&n.attr(t.name,t.value)})),t.replaceWith(n)),(t=n).attr("src",y).css("float",i).css("margin",l+d+c+u>0?l+f+" "+d+h+" "+c+p+" "+u+g:""),o.length&&this.fs.setAttr(t,"id",o),m.length&&this.fs.setAttr(t,"name",m),"IFRAME"===t[0].tagName&&t.attr("data-aspectratio",r),v.length&&this.fs.setAttr(t,"data-media-name",v),t[0].style.width=s+"%",a&&this.range.insertNode(t[0])),this.code.sync(),this.modal.close(),this.observe.images(),this.media.resizeMediaIframes()},formatMediaURL:function(e,t){return e.replace(/&responsive=true/gi,"").replace(/&aspectRatio=[^&]+/gi,"")+"&aspectRatio="+t+"&responsive=true"},setEditable:function(t,n){var i=this,r=e(n),a=[];a.push({name:"Settings",class:"re-cog",title:"Edit Media Properties",onClick:function(){return i.media.show(r),!1}}),a.push({name:"Delete",title:"Delete",class:"re-trash",onClick:function(){if(!confirm("Are you sure you want to delete this media object?"))return!1;r.remove(),i.code.sync()}}),"IFRAME"===r[0].tagName&&r.hasClass("fsEmbeddedMedia")?r.off("mouseover.redactorIframeOver").on("mouseover.redactorIframeOver",(function(){i.media.iFrameMouseOver=r,i.media.iFrameButtons=a})).off("mouseout.redactorIframeOut").on("mouseout.redactorIframeOut",(function(){i.media.iFrameMouseOver=!1,i.media.iFrameButtons=!1})):r.off(".editcontrols").on("click.editcontrols touchstart.editcontrols",(function(e){e.stopPropagation(),i.fs.loadEditableControls({element:r,buttons:a})}))},isVideo:function(e){return/\.(mp4|m4v|ogv|ogm|webm(\?.*)?)$/.test(e)},isMediaEmbed:function(e){return/embed\.cfm(\?.*)?$/.test(e)},isAudio:function(e){return/\.(mp3|m4a|ogg|oga|opus|flac|wav(\?.*)?)$/.test(e)},resizeMediaIframes:function(){this.$editor.find(".fsEmbeddedMediaResponsive").each((function(){var t=e(this);t.height(parseInt(t.width()*t.data("aspectratio")))}))}},t})),n("modules/modal",["jquery"],(function(e){"use strict";function t(){}return t.prototype={callbacks:{},loadTemplates:function(){this.opts.modal={imageEdit:String()+'<section id="redactor-modal-image-edit"><label>'+this.lang.get("title")+'</label><input type="text" id="redactor-image-title" /><label class="redactor-image-link-option">'+this.lang.get("link")+'</label><input type="text" id="redactor-image-link" class="redactor-image-link-option" /><label class="redactor-image-link-option"><input type="checkbox" id="redactor-image-link-blank"> '+this.lang.get("link_new_tab")+'</label><label class="redactor-image-position-option">'+this.lang.get("image_position")+'</label><select class="redactor-image-position-option" id="redactor-image-align"><option value="none">'+this.lang.get("none")+'</option><option value="left">'+this.lang.get("left")+'</option><option value="center">'+this.lang.get("center")+'</option><option value="right">'+this.lang.get("right")+"</option></select></section>",image:String()+'<section id="redactor-modal-image-insert"><div id="redactor-modal-image-droparea"></div></section>',file:String()+'<section id="redactor-modal-file-insert"><div id="redactor-modal-file-upload-box"><label>'+this.lang.get("filename")+'</label><input type="text" id="redactor-filename" /><br><br><div id="redactor-modal-file-upload"></div></div></section>',link:String()+'<section id="redactor-modal-link-insert"><label>URL</label><input type="url" id="redactor-link-url" /><label>'+this.lang.get("text")+'</label><input type="text" id="redactor-link-url-text" /><label><input type="checkbox" id="redactor-link-blank"> '+this.lang.get("link_new_tab")+"</label></section>"}},addCallback:function(e,t){this.modal.callbacks[e]=t},createTabber:function(t){this.modal.$tabber=e("<div>").attr("id","redactor-modal-tabber"),t.prepend(this.modal.$tabber)},addTab:function(t,n,i){var r=e('<a href="#" rel="tab'+t+'">').text(n);i&&r.addClass("active");var a=this;r.on("click",(function(t){t.preventDefault(),e(".redactor-tab").hide(),e(".redactor-"+e(this).attr("rel")).show(),a.modal.$tabber.find("a").removeClass("active"),e(this).addClass("active")})),this.modal.$tabber.append(r)},addTemplate:function(e,t){this.opts.modal[e]=t},getTemplate:function(e){return this.opts.modal[e]},getModal:function(){return this.$modalBody.find("section")},load:function(e,t,n){this.modal.templateName=e,this.modal.width=n,this.modal.build(),this.modal.enableEvents(),this.modal.setTitle(t),this.modal.setDraggable(),this.modal.setContent(),void 0!==this.modal.callbacks[e]&&this.modal.callbacks[e].call(this)},show:function(){this.utils.isMobile()&&!this.utils.browser("msie")&&document.activeElement.blur(),e(document.body).addClass("body-redactor-hidden"),this.utils.isMobile()?this.modal.showOnMobile():this.modal.showOnDesktop(),this.$modalOverlay.show(),this.$modalBox.show(),this.modal.setButtonsWidth(),this.utils.saveScroll(),this.utils.isMobile()||(setTimeout(e.proxy(this.modal.showOnDesktop,this),0),e(window).on("resize.redactor-modal",e.proxy(this.modal.resize,this))),this.core.setCallback("modalOpened",this.modal.templateName,this.$modal),e(document).off("focusin.modal"),this.$modal.find("input[type=text],input[type=url],input[type=email]").on("keydown.redactor-modal",e.proxy(this.modal.setEnter,this))},showOnDesktop:function(){var t=this.$modal.outerHeight(),n=window.innerHeight,i=e(window).width();this.modal.width>i?this.$modal.css({width:"96%",marginTop:n/2-t/2+"px"}):t>n?this.$modal.css({width:this.modal.width+"px",marginTop:"20px"}):this.$modal.css({width:this.modal.width+"px",marginTop:n/2-t/2+"px"})},showOnMobile:function(){this.$modal.css({width:"96%",marginTop:"2%"})},resize:function(){this.utils.isMobile()?this.modal.showOnMobile():this.modal.showOnDesktop()},setTitle:function(e){this.$modalHeader.html(e)},setContent:function(){this.$modalBody.html(this.modal.getTemplate(this.modal.templateName))},setDraggable:function(){void 0!==e.fn.draggable&&(this.$modal.draggable({handle:this.$modalHeader}),this.$modalHeader.css("cursor","move"))},setEnter:function(e){13===e.which&&(e.preventDefault(),this.$modal.find("button.redactor-modal-action-btn").click())},createCancelButton:function(){var t=e("<button>").addClass("redactor-modal-btn redactor-modal-close-btn").html(this.lang.get("cancel"));t.on("click",e.proxy(this.modal.close,this)),this.$modalFooter.append(t)},createDeleteButton:function(e){return this.modal.createButton(e,"delete")},createActionButton:function(e){return this.modal.createButton(e,"action")},createButton:function(t,n){var i=e("<button>").addClass("redactor-modal-btn").addClass("redactor-modal-"+n+"-btn").html(t);return this.$modalFooter.append(i),i},setButtonsWidth:function(){var e=this.$modalFooter.find("button"),t=e.length;0!==t&&e.css("width",100/t+"%")},build:function(){this.modal.buildOverlay(),this.$modalBox=e('<div id="redactor-modal-box" />').hide(),this.$modal=e('<div id="redactor-modal" />'),this.$modalHeader=e("<header />"),this.$modalClose=e('<span id="redactor-modal-close" />').html("&times;"),this.$modalBody=e('<div id="redactor-modal-body" />'),this.$modalFooter=e("<footer />"),this.$modal.append(this.$modalHeader),this.$modal.append(this.$modalClose),this.$modal.append(this.$modalBody),this.$modal.append(this.$modalFooter),this.$modalBox.append(this.$modal),this.$modalBox.appendTo(document.body)},buildOverlay:function(){this.$modalOverlay=e('<div id="redactor-modal-overlay">').hide(),e("body").prepend(this.$modalOverlay)},enableEvents:function(){this.$modalClose.on("click.redactor-modal",e.proxy(this.modal.close,this)),e(document).on("keyup.redactor-modal",e.proxy(this.modal.closeHandler,this)),this.$editor.on("keyup.redactor-modal",e.proxy(this.modal.closeHandler,this)),this.$modalBox.on("click.redactor-modal",e.proxy(this.modal.close,this))},disableEvents:function(){this.$modalClose.off("click.redactor-modal"),e(document).off("keyup.redactor-modal"),this.$editor.off("keyup.redactor-modal"),this.$modalBox.off("click.redactor-modal"),e(window).off("resize.redactor-modal")},closeHandler:function(e){e.which===this.keyCode.ESC&&this.modal.close(!1)},close:function(t){if(t){if(!e(t.target).hasClass("redactor-modal-close-btn")&&t.target!==this.$modalClose[0]&&t.target!==this.$modalBox[0])return;t.preventDefault()}this.$modalBox&&(this.modal.disableEvents(),this.$modalOverlay.remove(),this.$modalBox.fadeOut("fast",e.proxy((function(){this.$modalBox.remove(),setTimeout(e.proxy(this.utils.restoreScroll,this),0),void 0!==t&&this.selection.restore(),e(document.body).removeClass("body-redactor-hidden"),this.core.setCallback("modalClosed",this.modal.templateName)}),this)))}},t})),n("modules/observe",["jquery"],(function(e){"use strict";function t(){}return t.prototype={load:function(){this.observe.images(),this.observe.links()},buttons:function(t,n){var i=this.selection.getCurrent(),r=this.selection.getParent();if(!1!==t?this.button.setInactiveAll():this.button.setInactiveAll(n),!1!==t||"html"===n){e.each(this.opts.activeButtonsStates,e.proxy((function(t,n){var a=e(r).closest(t,this.$editor[0]),o=e(i).closest(t,this.$editor[0]);(0===a.length||this.utils.isRedactorParent(a))&&this.utils.isRedactorParent(o)&&(0!==a.length||0!==o.closest(t,this.$editor[0]).length)&&this.button.setActive(n)}),this));var a=e(r).closest(this.opts.alignmentTags.toString().toLowerCase(),this.$editor[0]);if(this.utils.isRedactorParent(r)&&a.length){var o=""===a.css("text-align")?"left":a.css("text-align");this.button.setActive("align"+o)}}else-1!==e.inArray(n,this.opts.activeButtons)&&this.button.toggleActive(n)},addButton:function(e,t){this.opts.activeButtons.push(t),this.opts.activeButtonsStates[e]=t},images:function(){var t=this;this.$editor.find("img,video,iframe,audio,table").each((function(n,i){var r=e(i);r.closest("a").on("click",(function(e){e.preventDefault()})),t.utils.browser("msie")&&r.attr("unselectable","on"),t.$element.trigger("observed.redactor."+i.tagName.toLowerCase(),i)}))},links:function(){this.opts.linkTooltip&&(this.$editor.find("a").on("touchstart.redactor."+this.uuid+" click.redactor."+this.uuid,e.proxy(this.observe.showTooltip,this)),this.$editor.on("touchstart.redactor."+this.uuid+" click.redactor."+this.uuid,e.proxy(this.observe.closeTooltip,this)),e(document).on("touchstart.redactor."+this.uuid+" click.redactor."+this.uuid,e.proxy(this.observe.closeTooltip,this)))},getTooltipPosition:function(e){return e.offset()},showTooltip:function(t){var n=e(t.target);if(t.stopPropagation(),"IMG"!==n[0].tagName&&("A"!==n[0].tagName&&(n=n.closest("a",this.$editor[0])),"A"===n[0].tagName)){var i=n,r=this.observe.getTooltipPosition(i),a=e('<span class="redactor-link-tooltip"></span>'),o=i.attr("href");void 0===o&&(o=""),o.length>24&&(o=o.substring(0,24)+"...");var s=e('<a href="'+i.attr("href")+'" target="_blank" />').html(o).addClass("redactor-link-tooltip-action"),l=e('<a href="#" />').html(this.lang.get("edit")).on("click",e.proxy(this.link.show,this)).addClass("redactor-link-tooltip-action"),d=e('<a href="#" />').html(this.lang.get("unlink")).on("click",e.proxy(this.link.unlink,this)).addClass("redactor-link-tooltip-action");a.append(s).append(" | ").append(l).append(" | ").append(d),a.css({top:r.top+(parseInt(i.css("line-height"),10)||parseInt(i.css("font-size"),10))+"px",left:r.left+"px"}),e(".redactor-link-tooltip").remove(),e(document.body).append(a)}},closeTooltip:function(t){var n=(t=t.originalEvent||t).target,i=e(n).closest("a",this.$editor[0]);0!==i.length&&"A"===i[0].tagName&&"A"!==n.tagName||"A"===n.tagName&&this.utils.isRedactorParent(n)||e(n).hasClass("redactor-link-tooltip-action")||e(".redactor-link-tooltip").remove()}},t})),n("modules/paragraphize",["jquery"],(function(e){"use strict";function t(){}return t.prototype={load:function(t){return this.opts.linebreaks?t:""===t||"<p></p>"===t?this.opts.emptyHtml:(t+="\n",this.paragraphize.safes=[],this.paragraphize.z=0,t=t.replace(/(<br\s?\/?>){1,}\n?<\/blockquote>/gi,"</blockquote>"),t=this.paragraphize.getSafes(t),t=this.paragraphize.getSafesComments(t),t=this.paragraphize.replaceBreaksToNewLines(t),t=this.paragraphize.replaceBreaksToParagraphs(t),t=this.paragraphize.clear(t),t=(t=this.paragraphize.restoreSafes(t)).replace(new RegExp("<br\\s?/?>\n?<("+this.opts.paragraphizeBlocks.join("|")+")([^>]*)>","gi"),"<p><br /></p>\n<$1$2>"),e.trim(t))},getSafes:function(t){var n=e("<div />").append(t);return n.find("blockquote p").replaceWith((function(){return e(this).append("<br />").contents()})),t=n.html(),n.find(this.opts.paragraphizeBlocks.join(", ")).each(e.proxy((function(e,n){this.paragraphize.z++,this.paragraphize.safes[this.paragraphize.z]=n.outerHTML,t=t.replace(n.outerHTML,"\n{replace"+this.paragraphize.z+"}")}),this)),t},getSafesComments:function(t){var n=t.match(/<!--([\w\W]*?)-->/gi);return n?(e.each(n,e.proxy((function(e,n){this.paragraphize.z++,this.paragraphize.safes[this.paragraphize.z]=n,t=t.replace(n,"\n{replace"+this.paragraphize.z+"}")}),this)),t):t},restoreSafes:function(t){return e.each(this.paragraphize.safes,(function(e,n){n=void 0!==n?n.replace(/\$/g,"&#36;"):n,t=t.replace("{replace"+e+"}",n)})),t},replaceBreaksToParagraphs:function(e){var t=e.split(new RegExp("\n","g"),-1);if(e="",t)for(var n=t.length,i=0;i<n;i++){if(!t.hasOwnProperty(i))return;-1===t[i].search("{replace")?(t[i]=t[i].replace(/<p>\n\t?<\/p>/gi,""),t[i]=t[i].replace(/<p><\/p>/gi,""),""!==t[i]&&(e+="<p>"+t[i].replace(/^\n+|\n+$/g,"")+"</p>")):e+=t[i]}return e},replaceBreaksToNewLines:function(e){return e=(e=(e=(e=(e=e.replace(/<br \/>\s*<br \/>/gi,"\n\n")).replace(/<br\s?\/?>\n?<br\s?\/?>/gi,"\n")).replace(new RegExp("\r\n","g"),"\n")).replace(new RegExp("\r","g"),"\n")).replace(new RegExp("/\n\n+/"),"g","\n\n")},clear:function(e){return e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(new RegExp("</blockquote></p>","gi"),"</blockquote>")).replace(new RegExp("<p></blockquote>","gi"),"</blockquote>")).replace(new RegExp("<p><blockquote>","gi"),"<blockquote>")).replace(new RegExp("<blockquote></p>","gi"),"<blockquote>")).replace(new RegExp("<p><p ","gi"),"<p ")).replace(new RegExp("<p><p>","gi"),"<p>")).replace(new RegExp("</p></p>","gi"),"</p>")).replace(new RegExp("<p>\\s?</p>","gi"),"")).replace(new RegExp("\n</p>","gi"),"</p>")).replace(new RegExp("<p>\t?\t?\n?<p>","gi"),"<p>")).replace(new RegExp("<p>\t*</p>","gi"),"")}},t})),n("modules/paste",["jquery"],(function(e){"use strict";function t(){}return t.prototype={init:function(){this.opts.cleanOnPaste?(this.rtePaste=!0,this.buffer.set(),this.selection.save(),this.utils.saveScroll(),this.paste.createPasteBox(),e(window).on("scroll.redactor-freeze",e.proxy((function(){e(window).scrollTop(this.saveBodyScroll)}),this)),setTimeout(e.proxy((function(){var t=this.$pasteBox.html();this.$pasteBox.remove(),this.selection.restore(),this.utils.restoreScroll(),this.paste.insert(t),e(window).off("scroll.redactor-freeze"),this.linkify.isEnabled()&&this.linkify.format()}),this),1)):setTimeout(e.proxy(this.code.sync,this),1)},createPasteBox:function(){this.$pasteBox=e("<div>").html("<p></p>").attr("contenteditable","true").css({position:"fixed",width:0,top:0,left:"-9999px"}),this.utils.browser("msie")?this.$box.append(this.$pasteBox):e("body").append(this.$pasteBox),this.$pasteBox[0].focus()},insert:function(t){t=this.core.setCallback("pasteBefore",t),t=this.utils.isSelectAll()?this.clean.onPaste(t,!1):this.clean.onPaste(t),t=this.core.setCallback("paste",t),t=this.paragraphize.load(t),this.utils.isSelectAll()?this.insert.set(t,!1):this.insert.html(t,!1),this.utils.disableSelectAll(),this.rtePaste=!1,setTimeout(e.proxy(this.clean.clearUnverified,this),10),setTimeout(e.proxy((function(){var t=this.$editor.find("span");e.each(t,(function(t,n){""===n.innerHTML.replace(/[\u200B-\u200D\uFEFF]/,"")&&0===n.attributes.length&&e(n).remove()}))}),this),10)}},t})),n("modules/placeholder",["jquery"],(function(e){"use strict";function t(){}return t.prototype={enable:function(){this.placeholder.is()&&(this.$editor.attr("placeholder",this.$element.attr("placeholder")),this.placeholder.toggle(),this.$editor.on("keyup.redactor-placeholder",e.proxy(this.placeholder.toggle,this)))},toggle:function(){var e="removeClass";this.utils.isEmpty(this.$editor.html(),!1)&&(e="addClass"),this.$editor[e]("redactor-placeholder")},remove:function(){this.$editor.removeClass("redactor-placeholder")},is:function(){return this.opts.placeholder?this.$element.attr("placeholder",this.opts.placeholder):void 0!==this.$element.attr("placeholder")&&""!==this.$element.attr("placeholder")}},t})),n("modules/progress",["jquery"],(function(e){"use strict";function t(){}return t.prototype={show:function(){e(document.body).append(e('<div id="redactor-progress"><span></span></div>')),e("#redactor-progress").fadeIn()},hide:function(){e("#redactor-progress").fadeOut(1500,(function(){e(this).remove()}))}},t})),n("modules/resize",["jquery"],(function(e){"use strict";function t(){}return t.prototype={initialize:function(){this.opts.resizable&&this.resize.buildResizer()},buildResizer:function(){if(!1===this.opts.resize)return!1;this.$resizer=e('<span class="redactor-resize-handle"></span>'),this.$dimensions=e('<div class="redactor-resize-dimensions"></div>'),this.$box.append(this.$resizer),this.$box.append(this.$dimensions),this.$resizer.mousedown(e.proxy(this.resize.initResize,this))},initResize:function(t){t.preventDefault&&t.preventDefault(),this.splitter=t.target,this.element_resize_parent=this.$box,this.opts.iframe?this.element_resize=this.$frame:this.element_resize=this.$editor,this.resize.stopResizeHdl=e.proxy(this.resize.stopResize,this),this.resize.startResizeHdl=e.proxy(this.resize.startResize,this),this.resize.resizeHdl=e.proxy(this.resize.doResize,this),e(document).mousedown(this.resize.startResizeHdl),e(document).mouseup(this.resize.stopResizeHdl),e(this.splitter).mouseup(this.resize.stopResizeHdl),this.null_pointX=!1,this.null_pointY=!1,this.h_new=!1,this.h=this.element_resize.height(),this.w_new=!1,this.w=this.element_resize.width()},startResize:function(){this.fs.hideEditableControls(),e(document).mousemove(this.resize.resizeHdl),this.$box.addClass("resize-outline"),this.$dimensions.show()},doResize:function(t){this.resize.resizeHoverIn.apply(this),t.preventDefault&&t.preventDefault();var n=t.pageY,i=t.pageX;!1===this.null_pointX&&(this.null_pointX=i),!1===this.null_pointY&&(this.null_pointY=n),!1===this.h_new&&(this.h_new=this.element_resize_parent.outerHeight()),!1===this.w_new&&(this.w_new=this.element_resize_parent.outerWidth());var r=this.h_new+n-this.null_pointY,a=this.w_new+i-this.null_pointX;r<=204&&(r=204),a<=204&&(a=204),r>=0&&(this.element_resize[0].style.height=r-this.$toolbar.height()+"px",this.element_resize_parent[0].style.height=r+"px",this.$textarea[0].style.height=r+"px"),a>=0&&(this.element_resize_parent[0].style.width=a+"px",this.$textarea[0].style.width=a+"px"),e(this.element_resize).trigger("resize")},stopResize:function(){e(document).unbind("mousemove",this.resize.resizeHdl),e(document).unbind("mousedown",this.resize.startResizeHdl),e(document).unbind("mouseup",this.resize.stopResizeHdl),e(this.splitter).unbind("mouseup",this.resize.stopResizeHdl),this.$box.removeClass("resize-outline"),this.$dimensions.hide()},resizeHoverIn:function(){this.$dimensions.show().html("<span>"+this.element_resize.width()+"px \xd7 "+this.element_resize.height()+"px </span>").css({top:this.element_resize.position().top,left:this.element_resize.position().left,lineHeight:this.element_resize.height()+"px",width:this.element_resize.outerWidth(),height:this.element_resize.outerHeight()})}},t})),n("modules/selection",["jquery"],(function(e){"use strict";function t(){}return t.prototype={get:function(){this.sel=document.getSelection(),document.getSelection&&this.sel.getRangeAt&&this.sel.rangeCount?this.range=this.sel.getRangeAt(0):this.range=document.createRange()},addRange:function(){try{this.sel.removeAllRanges()}catch(e){}this.sel.addRange(this.range)},getCurrent:function(){var e=!1;return this.selection.get(),this.sel&&this.sel.rangeCount>0&&(e=this.sel.getRangeAt(0).startContainer),this.utils.isRedactorParent(e)},getParent:function(t){return!!(t=t||this.selection.getCurrent())&&this.utils.isRedactorParent(e(t).parent()[0])},getBlock:function(t){for(t=t||this.selection.getCurrent();t;){if(this.utils.isBlockTag(t.tagName))return!e(t).hasClass("redactor-editor")&&t;t=t.parentNode}return!1},getInlines:function(t,n){if(this.selection.get(),this.range&&this.range.collapsed)return!1;var i=[];t=void 0===t||!1===t?this.selection.getNodes():t;var r=this.opts.inlineTags;if(r.push("span"),void 0!==n)for(var a=0;a<n.length;a++)r.push(n[a]);return e.each(t,e.proxy((function(t,n){-1!==e.inArray(n.tagName.toLowerCase(),r)&&i.push(n)}),this)),0!==i.length&&i},getInlinesTags:function(t){if(this.selection.get(),this.range&&this.range.collapsed)return!1;var n=[],i=this.selection.getNodes();return e.each(i,e.proxy((function(i,r){-1!==e.inArray(r.tagName.toLowerCase(),t)&&n.push(r)}),this)),0!==n.length&&n},getBlocks:function(t){if(this.selection.get(),this.range&&this.range.collapsed)return[this.selection.getBlock()];var n=[];return t=void 0===t?this.selection.getNodes():t,e.each(t,e.proxy((function(e,t){this.utils.isBlock(t)&&(this.selection.lastBlock=t,n.push(t))}),this)),0===n.length?[this.selection.getBlock()]:n},getLastBlock:function(){return this.selection.lastBlock},getNodes:function(){this.selection.get();var t=this.selection.getNodesMarker(1),n=this.selection.getNodesMarker(2),i=this.range.cloneRange();if(!1===this.range.collapsed){var r=i.startContainer,a=i.startOffset;this.selection.setNodesMarker(i,n,!1),i.setStart(r,a),this.selection.setNodesMarker(i,t,!0)}else this.selection.setNodesMarker(i,t,!0),n=t;var o=[],s=0,l=this;this.$editor.find("*").each((function(){if(this===t){var i=e(this).parent();0!==i.length&&"BODY"!==i[0].tagName&&l.utils.isRedactorParent(i[0])&&o.push(i[0]),o.push(this),s=1}else s>0&&(o.push(this),s+=1);if(this===n)return!1}));for(var d=[],c=o.length,u=0;u<c;u++)"nodes-marker-1"!==o[u].id&&"nodes-marker-2"!==o[u].id&&d.push(o[u]);return this.selection.removeNodesMarkers(),d},getNodesMarker:function(t){return e('<span id="nodes-marker-'+t+'" class="redactor-nodes-marker" data-verified="redactor">'+this.opts.invisibleSpace+"</span>")[0]},setNodesMarker:function(e,t,n){try{e.collapse(n),e.insertNode(t)}catch(e){}},removeNodesMarkers:function(){e(document).find("span.redactor-nodes-marker").remove(),this.$editor.find("span.redactor-nodes-marker").remove()},fromPoint:function(e,t){this.caret.setOffset(e,t)},wrap:function(e){if(this.selection.get(),this.range.collapsed)return!1;var t=document.createElement(e);return t.appendChild(this.range.extractContents()),this.range.insertNode(t),t},selectElement:function(e){this.caret.set(e,0,e,1)},selectAll:function(){this.selection.get(),this.range.selectNodeContents(this.$editor[0]),
this.selection.addRange()},remove:function(){this.selection.get(),this.sel.removeAllRanges()},save:function(){this.selection.createMarkers()},createMarkers:function(){this.selection.get();var e=this.selection.getMarker(1);if(this.selection.setMarker(this.range,e,!0),!1===this.range.collapsed){var t=this.selection.getMarker(2);this.selection.setMarker(this.range,t,!1)}this.savedSel=this.$editor.html()},getMarker:function(t){return void 0===t&&(t=1),e('<span id="selection-marker-'+t+'" class="redactor-selection-marker"  data-verified="redactor">'+this.opts.invisibleSpace+"</span>")[0]},getMarkerAsHtml:function(e){return this.utils.getOuterHtml(this.selection.getMarker(e))},setMarker:function(e,t,n){e=e.cloneRange();try{e.collapse(n),e.insertNode(t)}catch(e){this.focus.setStart()}},restore:function(){var e=this.$editor.find("span#selection-marker-1"),t=this.$editor.find("span#selection-marker-2");0!==e.length&&0!==t.length?this.caret.set(e,0,t,0):0!==e.length?this.caret.set(e,0,e,0):this.$editor[0].focus(),this.selection.removeMarkers(),this.savedSel=!1},removeMarkers:function(){this.$editor.find("span.redactor-selection-marker").each((function(t,n){""===e(n).text().replace(/[\u200B-\u200D\uFEFF]/g,"")?e(n).remove():e(n).replaceWith((function(){return e(this).contents()}))}))},getText:function(){return this.selection.get(),this.sel.toString()},getHtml:function(){var e="";if(this.selection.get(),this.sel.rangeCount){for(var t=document.createElement("div"),n=this.sel.rangeCount,i=0;i<n;++i)t.appendChild(this.sel.getRangeAt(i).cloneContents());e=t.innerHTML}return this.clean.onSync(e)},replaceWithHtml:function(e){if(e=this.selection.getMarkerAsHtml(1)+e+this.selection.getMarkerAsHtml(2),this.selection.get(),window.getSelection&&window.getSelection().getRangeAt){this.range.deleteContents();var t=document.createElement("div");t.innerHTML=e;for(var n,i=document.createDocumentFragment();n=t.firstChild;)i.appendChild(n);this.range.insertNode(i)}else document.selection&&document.selection.createRange&&this.range.pasteHTML(e);this.selection.restore(),this.code.sync()}},t})),n("modules/shortcuts",["jquery"],(function(e){"use strict";function t(){}return t.prototype={init:function(t,n){if(!this.opts.shortcuts)return(t.ctrlKey||t.metaKey)&&(66===n||73===n)&&t.preventDefault(),!1;e.each(this.opts.shortcuts,e.proxy((function(n,i){for(var r=n.split(","),a=r.length,o=0;o<a;o++)"string"==typeof r[o]&&this.shortcuts.handler(t,e.trim(r[o]),e.proxy((function(){var e;"-1"!==i.func.search(/\./)?void 0!==this[(e=i.func.split("."))[0]]&&this[e[0]][e[1]].apply(this,i.params):this[i.func].apply(this,i.params)}),this))}),this))},handler:function(t,n,i){var r={8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"};n=n.toLowerCase().split(" ");var o=r[t.keyCode],s=String.fromCharCode(t.which).toLowerCase(),l="",d={};e.each(["alt","ctrl","meta","shift"],(function(e,n){t[n+"Key"]&&o!==n&&(l+=n+"+")})),o&&(d[l+o]=!0),s&&(d[l+s]=!0,d[l+a[s]]=!0,"shift+"===l&&(d[a[s]]=!0));for(var c=0,u=n.length;c<u;c++)if(d[n[c]])return t.preventDefault(),i.apply(this,arguments)}},t})),n("modules/styles",["jquery"],(function(e){"use strict";function t(){}return t.prototype={applyStylePreview:function(t){var n,i=e("<span></span>"),r={},a=this,o=["background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left-color","border-left-style","border-left-width","border-right-color","border-right-style","border-right-width","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","color","font-family","font-kerning","font-size","font-style","font-variant","font-variant-ligatures","font-weight","text-align","text-decoration","text-indent","text-rendering","text-shadow","text-overflow","text-transform","line-height","outline-color","outline-offset","outline-style","outline-width","padding-bottom","padding-left","padding-right","padding-top"];r.RedactorClearStyle={title:"None",func:"styles.setStyle"},e.each(a.opts.classes,(function(e,t){r[t.class]={title:t.name,func:"styles.setStyle"}})),n=this.button.addDropdown(this.$toolbar.find(".re-styles"),r),this.dropdown.show(t,"styles"),i.appendTo(this.$editor),n.children("a").each((function(t,n){var r,a=n.className.replace("redactor-dropdown-","");i.removeClass().addClass(a),r=window.getComputedStyle(i.get(0)),e.each(r,(function(t,i){var a=r.getPropertyValue(i);"display"!==i||"none"!==a?("color"===i&&"rgb(255, 255, 255)"===a&&(a="rgb(0, 0, 0)"),-1!==e.inArray(i,o)&&(n.style[i]=a)):e(n).html(e(n).html()+" <em>(Hidden)</em>")}))})),i.remove(),t.preventDefault()},parseForClasses:function(){var t,n,i=this;i.opts.localStylesheet&&(e.each(document.styleSheets,(function(e,n){if(n.href&&n.href.indexOf(i.opts.localStylesheet)>=0)return t=n,!1})),t&&(n=t.cssRules||t.rules||[],e.each(n,(function(e,t){if(!t.selectorText)return!0;var n=t.selectorText.replace(/.redactor-editor/g,""),r=/\.[a-zA-Z0-9-_]+/.exec(n),a=/stylename_[a-zA-Z0-9-_]+/.exec(n);a&&(a=a[0].replace("stylename_","").replace(/__/g," ").replace(/\b[a-z]/g,(function(e){return e.toUpperCase()}))),r&&(r=r[0].replace(/^\./,"")),r&&r.length&&a&&a.length&&i.opts.classes.push({class:r,name:a})}))))},initialize:function(){if(this.opts.classes||(this.opts.classes=[]),this.styles.parseForClasses(),-1!==this.opts.buttons.indexOf("styles")){var e=this.button.addAfter("formatting","styles","Style",null,{});this.$toolbar.find("a.re-styles").addClass("fsredactor-icon fsredactor-style re-has-dropdown"),e.one("click",this.styles.applyStylePreview)}},clearStyles:function(){if(e("#redactor-overlay-box").length)return this.fs.$editTarget.removeAttr("class"),void this.code.sync();e.each(this.selection.getNodes(),(function(t,n){e(n).removeAttr("class")})),this.code.sync()},setStyle:function(t){"RedactorClearStyle"!==t?this.fs.setInlineStyle((function(n){e(n).addClass(t)})):this.styles.clearStyles()}},t})),n("modules/tabifier",[],(function(){"use strict";function e(){}return e.prototype={get:function(e){if(!this.opts.tabifier)return e;var t=["area","body","head","hr","i?frame","link","meta","noscript","style","script","table","tbody","thead","tfoot"],n=["li","dt","dt","h[1-6]","option","script"],i=["p","blockquote","div","dl","fieldset","form","frameset","map","ol","pre","select","td","th","tr","ul"];this.tabifier.lineBefore=new RegExp("^<(/?"+t.join("|/?")+"|"+n.join("|")+")[ >]"),this.tabifier.lineAfter=new RegExp("^<(br|/?"+t.join("|/?")+"|/"+n.join("|/")+")[ >]"),this.tabifier.newLevel=new RegExp("^</?("+i.join("|")+")[ >]");var r=0,a=e.length,o=0,s=null,l=null,d="",c="",u="";for(this.tabifier.cleanlevel=0;r<a;r++){if(o=r,-1===e.substr(r).indexOf("<"))return c+=e.substr(r),this.tabifier.finish(c);for(;o<a&&"<"!==e.charAt(o);)o++;for(r!==o&&((u=e.substr(r,o-r)).match(/^\s{2,}$/g)||("\n"===c.charAt(c.length-1)?c+=this.tabifier.getTabs():"\n"===u.charAt(0)&&(c+="\n"+this.tabifier.getTabs(),u=u.replace(/^\s+/,"")),c+=u),u.match(/\n/)&&(c+="\n"+this.tabifier.getTabs())),s=o;o<a&&">"!==e.charAt(o);)o++;var f;if(r=o,"!--"===(d=e.substr(s,o-s)).substr(1,3)){if(!d.match(/--$/)){for(;"-->"!==e.substr(o,3);)o++;o+=2,d=e.substr(s,o-s),r=o}"\n"!==c.charAt(c.length-1)&&(c+="\n"),c+=this.tabifier.getTabs(),c+=d+">\n"}else"!"===d[1]?c=this.tabifier.placeTag(d+">",c):"?"===d[1]?c+=d+">\n":(f=d.match(/^<(script|style|pre)/i))?(f[1]=f[1].toLowerCase(),d=this.tabifier.cleanTag(d),c=this.tabifier.placeTag(d,c),(l=String(e.substr(r+1)).toLowerCase().indexOf("</"+f[1]))&&(u=e.substr(r+1,l),r+=l,c+=u)):(d=this.tabifier.cleanTag(d),c=this.tabifier.placeTag(d,c))}return this.tabifier.finish(c)},getTabs:function(){for(var e="",t=0;t<this.tabifier.cleanlevel;t++)e+="\t";return e},finish:function(e){return e=(e=(e=(e=e.replace(/\n\s*\n/g,"\n")).replace(/^[\s\n]*/,"")).replace(/[\s\n]*$/,"")).replace(/<script(.*?)>\n<\/script>/gi,"<script$1></script>"),this.tabifier.cleanlevel=0,e},cleanTag:function(e){var t,n="",i="";for((e=(e=(e=e.replace(/\n/g," ")).replace(/\s{2,}/g," ")).replace(/^\s+|\s+$/g," ")).match(/\/$/)&&(i="/",e=e.replace(/\/+$/,""));t=/\s*([^= ]+)(?:=((['"']).*?\3|[^ ]+))?/.exec(e);)t[2]?n+=t[1].toLowerCase()+"="+t[2]:t[1]&&(n+=t[1].toLowerCase()),n+=" ",e=e.substr(t[0].length);return n.replace(/\s*$/,"")+i+">"},placeTag:function(e,t){var n=e.match(this.tabifier.newLevel);return(e.match(this.tabifier.lineBefore)||n)&&(t=t.replace(/\s*$/,""),t+="\n"),n&&"/"===e.charAt(1)&&this.tabifier.cleanlevel--,"\n"===t.charAt(t.length-1)&&(t+=this.tabifier.getTabs()),n&&"/"!==e.charAt(1)&&this.tabifier.cleanlevel++,t+=e,(e.match(this.tabifier.lineAfter)||e.match(this.tabifier.newLevel))&&(t=t.replace(/ *$/,"")),t}},e})),n("text!view/table/settings_modal.html",[],(function(){return'<section>\r\n\t<div class="redactor-table-column1-fieldset">\r\n\t\t<label for="redactor-table-columns">Columns</label><input id="redactor-table-columns" type="number"/>\r\n\t</div>\r\n\t<div class="redactor-table-column2-fieldset">\r\n\t\t<label for="redactor-table-rows">Rows</label><input id="redactor-table-rows" type="number"/>\r\n\t</div>\r\n\t<div class="redactor-table-column-clear"></div>\r\n\t<div class="redactor-table-column1-fieldset">\r\n\t\t<label for="redactor-table-cellspacing">Cellspacing</label><input id="redactor-table-cellspacing" type="number"/>px\r\n\t</div>\r\n\t<div class="redactor-table-column-clear"></div>\r\n\t<div class="redactor-table-column1-fieldset">\r\n\t\t<label for="redactor-table-width">Width</label><input id="redactor-table-width" placeholder="auto" type="number"/>\r\n\t\t\t<select id="redactor-table-width-unit"><option>%</option><option>px</option></select>\r\n\t</div>\r\n\t<div class="redactor-table-column2-fieldset">\r\n\t\t<label for="redactor-table-height">Height</label><input id="redactor-table-height" placeholder="auto" type="number"/>\r\n\t</div>\r\n\t<div class="redactor-table-column-clear"></div>\r\n\t<label for="redactor-table-align">Alignment</label>\r\n\t<ul id="redactor-table-align">\r\n\t\t<li><input id="redactor-table-align-none" name="redactor-table-align" type="radio" value=""><label for="redactor-table-align-none">None</label></li>\r\n\t\t<li><input id="redactor-table-align-left" name="redactor-table-align" type="radio" value="left"><label for="redactor-table-align-left">Left</label></li>\r\n\t\t<li><input id="redactor-table-align-center" name="redactor-table-align" type="radio" value="center"><label for="redactor-table-align-center">Center</label></li>\r\n\t\t<li><input id="redactor-table-align-right" name="redactor-table-align" type="radio" value="right"><label for="redactor-table-align-right">Right</label></li>\r\n\t</ul>\r\n\t<div class="redactor-table-column-double-fieldset">\r\n\t\t<label for="redactor-table-class">Class</label><input id="redactor-table-class" placeholder="Choose class..." type="text" />\r\n\t</div>\r\n\t<div class="redactor-table-column-double-fieldset">\r\n\t\t<label for="redactor-table-border">Border</label><input id="redactor-table-border" type="number"/>\r\n\t</div>\r\n\t<div class="redactor-table-column-clear"></div>\r\n\t<div class="redactor-table-column-double-fieldset">\r\n\t\t<label for="redactor-table-background-color">Background Color</label><input id="redactor-table-background-color" type="text"/><button type="button" for="redactor-table-background-color" class="redactor-color-picker-button"></button>\r\n\t</div>\r\n\t<div class="redactor-table-column-double-fieldset">\r\n\t\t<label for="redactor-table-border-color">Border Color</label><input id="redactor-table-border-color" type="text"/><button type="button" for="redactor-table-border-color" class="redactor-color-picker-button"></button>\r\n\t</div>\r\n\t<div class="redactor-table-column-clear"></div>\r\n</section>\r\n'})),n("text!view/table/border_dropdown.html",[],(function(){return'<label for="redactor-table-edit-border">Border</label>\r\n<input type="number" name="redactor-table-edit-border" id="redactor-table-edit-border" />px\r\n<div>\r\n\t<button type="button" class="redactor-table-edit-border-toggle" id="redactor-table-edit-border-top">Top</button>\r\n\t<button type="button" class="redactor-table-edit-border-toggle" id="redactor-table-edit-border-bottom">Bottom</button>\r\n</div>\r\n<div>\r\n\t<button type="button" class="redactor-table-edit-border-toggle" id="redactor-table-edit-border-left">Left</button>\r\n\t<button type="button" class="redactor-table-edit-border-toggle" id="redactor-table-edit-border-right">Right</button>\r\n</div>\r\n'})),n("text!view/table/width_dropdown.html",[],(function(){return'<label for="redactor-table-edit-width">Width</label><input type="number" name="redactor-table-edit-width" id="redactor-table-edit-width" />\r\n<label><select id="redactor-table-edit-width-unit"><option>%</option><option>px</option></select></label>\r\n'})),n("modules/table",["jquery","text!view/table/settings_modal.html","text!view/table/border_dropdown.html","text!view/table/width_dropdown.html"],(function(e,t,n,i){"use strict";function r(){}var a="redactor-table-cell-selected",o="."+a,s="td, th",l="&#8203;";return r.prototype={initialize:function(){var r=this,a={};a.insert_table={title:this.lang.get("insert_table"),func:this.table.show};var o=this.button.get("table");o.length&&(this.button.addDropdown(o,a),o=this.button.add("table-align","Alignment"),this.button.addDropdown(o,{left:{title:"Left",func:this.table.align},right:{title:"Right",func:this.table.align},center:{title:"Center",func:this.table.align}}),o=this.button.add("table-vertical-align","Vertical Alignment"),this.button.addDropdown(o,{top:{title:"Top",func:this.table.verticalAlign},middle:{title:"Middle",func:this.table.verticalAlign},bottom:{title:"Bottom",func:this.table.verticalAlign}}),o=this.button.add("table-rows-columns","Rows and Columns"),this.button.addDropdown(o,{addRowAbove:{title:"Add Row Above",func:this.table.addRowAbove},addRowBelow:{title:"Add Row Below",func:this.table.addRowBelow},addColumnBefore:{title:"Add Column Before",func:this.table.addColumnBefore},addColumnAfter:{title:"Add Column After",func:this.table.addColumnAfter},removeRow:{title:"Remove Row",func:this.table.removeRow},removeColumn:{title:"Remove Column",func:this.table.removeColumn},selectRow:{title:"Select Row",func:this.table.selectRow},selectColumn:{title:"Select Column",func:this.table.selectColumn},selectAll:{title:"Select All Cells",func:this.table.selectAllCells},toggleTH:{title:"Toggle as Table Headers",func:this.table.swapCellType}}),o=this.button.add("table-border","Border"),this.button.addDropdown(o),(a=o.data("dropdown")[0]).innerHTML=n,e(".re-table-border",this.$toolbar).on("click",(function(){var t=parseInt(r.table.getSelectionCommonProperty("borderTopWidth")),n=parseInt(r.table.getSelectionCommonProperty("borderRightWidth")),i=parseInt(r.table.getSelectionCommonProperty("borderBottomWidth")),a=parseInt(r.table.getSelectionCommonProperty("borderLeftWidth"));e("#redactor-table-edit-border").val(Math.max(1,t,n,i,a)),e("#redactor-table-edit-border-top").toggleClass("redactor-button-active",!!t),e("#redactor-table-edit-border-right").toggleClass("redactor-button-active",!!n),e("#redactor-table-edit-border-bottom").toggleClass("redactor-button-active",!!i),e("#redactor-table-edit-border-left").toggleClass("redactor-button-active",!!a)})),e(a).on("click",".redactor-table-edit-border-toggle",(function(){return e(this).toggleClass("redactor-button-active"),r.table.processBorder(e(this).closest(".redactor-dropdown")),!1})).on("click change keyup","#redactor-table-edit-border",(function(){return r.table.processBorder(e(this).closest(".redactor-dropdown")),!1})),o=this.button.add("table-border-color","Border Color"),(a=this.button.addDropdown(o)).width(242),this.fs.buildPicker(a,"borderColor",this.fs.colors,this.table.setBorderColor,this.table.removeBorderColor),o=this.button.add("table-background-color","Background Color"),(a=this.button.addDropdown(o)).width(242),this.fs.buildPicker(a,"backgroundColor",this.fs.colors,this.table.setBackgroundColor,this.table.removeBackgroundColor),o=this.button.add("table-width","Width"),this.button.addDropdown(o),(a=o.data("dropdown")[0]).innerHTML=i,e(".re-table-width",this.$toolbar).on("click",(function(){var t=r.table.getSelectionColumns(),n="100",i="%";if(t.length){var o=t[0].style.width;e.trim(o).length&&(n=parseInt(o),i=o.replace(/\d+/,""))}e("#redactor-table-edit-width",a).val(n),e("#redactor-table-edit-width-unit",a).val(i)})),e(a).on("click change keyup","#redactor-table-edit-width, #redactor-table-edit-width-unit",(function(){return r.table.processWidth(e(this).closest(".redactor-dropdown")),!1})),this.$toolbar.find(".re-table-align, .re-table-vertical-align, .re-table-rows-columns, .re-table-border, .re-table-border-color, .re-table-background-color, .re-table-width").addClass("redactor-table-edit-only-button redactor-button-hidden"),this.$toolbar.find(".re-table").addClass("redactor-table-edit-button"),this.table.modal_table_edit=t,this.$element.on("sync.redactor-api",this.table.onSync),this.$element.on("observed.redactor.table",this.table.setEditable))},onSync:function(){var e=this.$textarea.val();e=(e=e.replace(/(<table([^>]*)class="([^>]*))redactor-table-selected/gi,"$1")).replace(/(<table([^>]*)class="([^>]*))redactor-table-edit-mode/gi,"$1"),this.$textarea.val(e)},setEditable:function(t,n){var i=this,r=e(n),a=[];return a.push({name:"Delete",class:"re-trash",title:"Delete Table",onClick:function(){if(!confirm("Are you sure you want to delete this table?"))return!1;i.fs.hideEditableControls(),r.remove(),i.code.sync()}}),a.push({name:"Settings",class:"re-cog",title:"Edit Table Properties",onClick:function(){return i.table.show(r),!1}}),a.push({name:"Edit",class:"re-pencil",title:"Edit Table Cells",onClick:function(){return i.table.enableTableEditMode(r),!1}}),r.off(".editcontrols").on("click.editcontrols touchstart.editcontrols",(function(t){return(!r.closest(i.fs.$editTarget).length||!i.$editor.hasClass("redactor-table-edit-mode"))&&(e(t.target).closest("table")[0]!==i.table.getSelectedTable()[0]&&(i.table.tableCleanUp(r),i.table.setSelectedTable(r[0]),i.fs.loadEditableControls({bCancelSelection:!0,element:r,buttons:a,offset:{top:-20,left:-1},onHide:function(){return r[0]===i.table.getSelectedTable()[0]&&(i.table.disableTableEditMode(r),i.table.setSelectedTable(null)),!0}}),t.stopPropagation(),void t.preventDefault()))})),!1},enableTableEditMode:function(t){var n=this,i=e(this.selection.getNodes()).filter("td,th");this.$editor.hasClass("redactor-table-edit-mode")?this.table.disableTableEditMode(t):(this.$editor.addClass("redactor-table-edit-mode").prop("contenteditable",!1).prepend('<div class="redactor-table-edit-mode-overlay">'),this.$toolbar.find(".re-table").addClass("redactor-active").on("click.redactor-table-edit",(function(){return n.table.disableTableEditMode(t),n.dropdown.hideAll(),!1})),t.find("td,th").each((function(){e(this).attr("unselectable","on")})),this.table.$previousButtons=this.$toolbar.find("a:not(.redactor-table-edit-button, .redactor-button-hidden)"),this.table.$previousButtons.addClass("redactor-button-hidden"),this.$toolbar.find(".redactor-table-edit-only-button").removeClass("redactor-button-hidden"),t.addClass("redactor-table-edit-mode"),this.table.setLastSelected(null),this.selection.remove(),i.length&&this.table.setSelection(i),t.on("mousedown.redactor-table-edit",s,(function(){var i=e(this).parentsUntil(n.table.getSelectedTable()).filter("td:first")[0]||this,r=t.find(o);t.off("mouseover.redactor-table-edit").on("mouseover.redactor-table-edit",s,(function(o){var s=e(this).parentsUntil(n.table.getSelectedTable()).filter("td:first")[0]||this;n.table.expandSelection(t,i,s,!0),(o.ctrlKey||o.metaKey)&&r.addClass(a)})).on("mouseup.redactor-table-edit",(function(){t.off("mouseover.redactor-table-edit")})),n.dropdown.hideAll()})).on("click.redactor-table-edit",s,(function(i){var r=e(this).parentsUntil(n.table.getSelectedTable()).filter("td:first")[0]||this;i.shiftKey&&n.table.getLastSelected()?(!i.ctrlKey&&!i.metaKey&&n.table.resetSelection(t),n.table.expandSelection(t,n.table.getLastSelected(),r),n.table.setLastSelected(r)):i.ctrlKey||i.metaKey?(e(r).toggleClass(a),e(r).hasClass(a)&&n.table.setLastSelected(r)):(n.table.resetSelection(t),e(r).addClass(a),n.table.setLastSelected(r))})))},disableTableEditMode:function(t){if(!t.length)return!1;this.$editor.removeClass("redactor-table-edit-mode").prop("contenteditable",!0).find(".redactor-table-edit-mode-overlay").remove(),this.$toolbar.find(".re-table").removeClass("redactor-active").off(".redactor-table-edit"),this.$toolbar.find(".redactor-table-edit-only-button").addClass("redactor-button-hidden"),t.removeClass("redactor-table-edit-mode").find(o).removeClass(a),t.find("td,th").each((function(){e(this).removeAttr("unselectable")})),this.opts.visual&&this.table.$previousButtons&&this.table.$previousButtons.removeClass("redactor-button-hidden"),t.off(".redactor-table-edit"),this.code.sync()},tableCleanUp:function(t){t.find("td, th").each((function(){var t,n=e(this),i=n.contents();if(i.length)for(t in i)if(3!==i[t].nodeType)return;(!i.length||!/[\w]/.test(n.contents().text()))&&n.html(l)}))},align:function(e){this.table.getSelection().css("text-align",e)},verticalAlign:function(e){this.table.getSelection().css("vertical-align",e)},getLastSelected:function(){return this.table.lastSelected=this.table.lastSelected||this.table.getSelection().get(0),this.table.lastSelected},setLastSelected:function(e){this.table.lastSelected=e},setSelection:function(t,n){n&&this.table.resetSelection(this.table.getSelectedTable()),e(t).addClass(a)},getSelection:function(){return e(this.table.target).find(o)},getSelectionCommonProperty:function(e){var t;return this.table.getSelection().each((function(){if(t){if(t!==this.style[e])return t=!1,!1}else t=this.style[e]})),t},getSelectionColumns:function(){var t=this.table.getSelectionColumnIndexes(),n=e(),i=this.table.getSelectedTable();return e.each(t,(function(e,t){n=n.add(i.find("colgroup").children("col").eq(t))})),n},getSelectionColumnIndexes:function(){return e.unique(this.table.getSelection().map((function(){return e(this).index()}))).get()},setupColumns:function(){var t=this.table.getSelectedTable(),n=t.find("col").length,i=t.find("colgroup"),r=0;for(i.length||(t.prepend("<colgroup>"),i=t.find("colgroup")),e("tr:first",t).find("> td, > th").each((function(){e(this).attr("colspan")?r+=+e(this).attr("colspan"):r++}));n<r;n++)i.append("<col/>")},getSelectedTable:function(){return e(this.table.target)},setSelectedTable:function(t){this.table.target=t,this.$editor.find(".redactor-table-selected").removeClass("redactor-table-selected"),e(this.table.target).addClass("redactor-table-selected"),this.table.setupColumns(),this.table.setLastSelected(null)},resetSelection:function(e){e.find(o).removeClass(a)},expandSelection:function(e,t,n,i){var r,o,s=Math.min(t.cellIndex,n.cellIndex),l=Math.min(t.parentNode.rowIndex,n.parentNode.rowIndex),d=Math.max(t.cellIndex,n.cellIndex),c=Math.max(t.parentNode.rowIndex,n.parentNode.rowIndex);for(i&&this.table.resetSelection(e),o=l;o<=c;o++)for(r=s;r<=d;r++)e.find("> tr, > thead > tr, > tbody > tr, > tfoot > tr").eq(o).find("> td, > th").eq(r).addClass(a)},show:function(t){var n=this;"insert_table"===t&&(t=!1),this.modal.addTemplate("table",this.table.modal_table_edit),this.modal.load("table",this.lang.get("insert_table"),500),this.modal.createCancelButton(),this.modal.createActionButton(this.lang.get("save")).on("click",(function(){n.table.save(t)})),this.selection.save(),this.modal.show();var i=e('<div style="display:none; position:absolute; background: #fff"/>');if(this.$modal.append(i),this.$modal.on("keyup change","#redactor-table-background-color, #redactor-table-border-color",(function(){var t=e(this);t.next(".redactor-color-picker-button").css("backgroundColor",t.val())})),this.$modal.on("click",".redactor-color-picker-button",(function(){var t=e(this);return i.$triggerer=e("#"+t.attr("for")),i.show().css({top:t.position().top}),n.$modal.one("click",(function(){i.hide()})),!1})),this.fs.buildPicker(i,"tableSetting",this.fs.colors,(function(e,t){i.$triggerer.val(t).change(),i.hide()}),(function(){i.$triggerer.val("").change(),i.hide()})),t.length){var r=this.fs.rgb2hex(t[0].style.borderColor)||"#000000",a=this.fs.rgb2hex(t[0].style.backgroundColor);e("#redactor-table-rows").val(t[0].rows.length),e("#redactor-table-columns").val(t[0].rows[0].children.length),e("#redactor-table-cellspacing").val(parseInt(t[0].style.borderSpacing)||0),e("#redactor-table-width").val(parseInt(t[0].style.width)||""),e("#redactor-table-width-unit").val("px"===t[0].style.width.slice(-2)?"px":"%"),e("#redactor-table-height").val(parseInt(t[0].style.height)||""),e("#redactor-table-border").val(parseInt(t[0].style.borderWidth)||0),e("#redactor-table-border-color").val(r),e("#redactor-table-background-color").val(a),e("#redactor-table-align-"+("0px auto"===t[0].style.margin?"center":t[0].style.float)).prop("checked",!0),t.removeClass("redactor-table-selected"),t.removeClass("redactor-table-edit-mode"),e("#redactor-table-class").val(t[0].className),e('.redactor-color-picker-button[for="redactor-table-background-color"]').css("backgroundColor",a),e('.redactor-color-picker-button[for="redactor-table-border-color"]').css("backgroundColor",r)}if(e.fn.selectize){var o=this.opts.classes?e.map(this.opts.classes,(function(e){return{value:e.class,text:e.name}})):[],s=e("#redactor-table-class").selectize({delimiter:" ",persist:!1,create:!0});s[0].selectize.addOption(o),s[0].selectize.$control.on("keyup",(function(e){e.stopPropagation()}))}e("#redactor-table-columns")[0].focus()},save:function(t){var n,i,r,a,o=e("#redactor-table-rows").val(),s=e("#redactor-table-columns").val(),d=e("#redactor-table-cellspacing").val(),c=e("#redactor-table-width").val(),u=e("#redactor-table-width-unit").val(),f=e("#redactor-table-height").val(),h=e('input[name="redactor-table-align"]:checked',this.$modal).val(),p=e("#redactor-table-class").val(),g=e("#redactor-table-border").val(),m=e("#redactor-table-border-color").val()||"#000000",v=e("#redactor-table-background-color").val(),y=0,_=0,b=e("<div>"),E=Math.floor(99999*Math.random()),w=!0;if(t.length?(w=!1,y=t[0].rows.length,_=t[0].rows[0].children.length):t=e('<table id="table'+E+'"><tbody></tbody></table>'),t.css({borderCollapse:d>0?"separate":"collapse",borderSpacing:d?d+"px":"",borderWidth:g?g+"px":"",borderColor:m,borderStyle:g?"solid":"",backgroundColor:v,width:c?c+u:"",height:f?f+"px":"",float:"center"===h?"":h}).attr("class",p),"center"===h&&t.css("margin","0px auto"),t.find("tr").each((function(){var t=s-_;if(t>0)for(n=0;n<t;n++)e(this).append(e("<td>"+l+"</td>"));else for(n=0;n<-t;n++)e(this).find("th:last, td:last").remove()})),0===y||y<o)for(n=y;n<o;n++){for(i=e("<tr>"),r=0;r<s;r++)a=e("<td>"+l+"</td>"),0===n&&0===r&&a.append(this.selection.getMarker()),e(i).append(a);t.append(i)}else for(n=y;n>o;n--)t.find("tr:last").remove();if(this.modal.close(),this.selection.restore(),this.code.sync(),w){b.append(t);var T=b.html();this.buffer.set();var S=this.selection.getBlock()||this.selection.getCurrent();S&&"BODY"!==S.tagName&&"TD"!==S.tagName&&"TH"!==S.tagName?("LI"===S.tagName&&(S=e(S).closest("ul, ol")),e(S).after(T)):this.insert.html(T),this.selection.restore();var C=this.$editor.find("#table"+E);if(!this.opts.linebreaks&&(this.utils.browser("mozilla")||this.utils.browser("msie")))0===C.next().length&&C.after(this.opts.emptyHtml);this.observe.buttons(),this.observe.images(),C.find("span.redactor-selection-marker").remove(),C.removeAttr("id"),this.code.sync(),this.core.setCallback("insertedTable",C)}},getTable:function(){var t=e(this.selection.getParent()).closest("table");return!!this.utils.isRedactorParent(t)&&(0!==t.size()&&t)},addRowAbove:function(){var e=this.table.getCurrentRow();e.before(this.table.newRow(e[0].cells.length))},addRowBelow:function(){var e=this.table.getCurrentRow();e.after(this.table.newRow(e[0].cells.length))},removeRow:function(){this.table.getAllRows().has(o).remove()},getAllRows:function(){return this.table.getSelectedTable().find("> tr, > thead > tr, > tbody > tr, > tfoot > tr")},getCurrentRow:function(){return e(this.table.getLastSelected()).closest("tr")},newRow:function(t){var n,i=e("<tr></tr>");for(n=0;n<t;n++)i.append(e("<td>"+l+"</td>"));return i},addColumnAfter:function(){var t=e(this.table.getLastSelected()).index();this.table.getAllRows().each((function(){e("<td>"+l+"</td>").insertAfter(e("> td,> th",this).eq(t))})),this.table.getSelectedTable().find("> col, > colgroup > col").eq(t).after("<col/>")},addColumnBefore:function(){var t=e(this.table.getLastSelected()).index();this.table.getAllRows().each((function(){e("<td>"+l+"</td>").insertBefore(e("> td,> th",this).eq(t))})),this.table.getSelectedTable().find("> col, > colgroup > col").eq(t).before("<col/>")},removeColumn:function(){var t=this.table.getSelectionColumnIndexes().reverse(),n=this;e.each(t,(function(t,i){n.table.getAllRows().each((function(){e("> td,> th",this).eq(i).remove()}))}))},swapCellType:function(){var t=!1,n=function(t){return function(){var n=e(this),i=e(t),r=i[0];return r.className=this.className,e.extend(r.classList,this.classList),e.extend(r.attributes,this.attributes),i.append(n.contents())}};this.table.getSelection().each((function(i){0===i&&"TH"===this.tagName&&(t=!0),t&&"TD"!==this.tagName?e(this).replaceWith(n("<td>")):"TH"!==this.tagName&&e(this).replaceWith(n("<th>"))}))},selectRow:function(){this.table.setSelection(e(this.table.getLastSelected()).siblings("td,th").andSelf(),!0)},selectColumn:function(){var t=e(this.table.getLastSelected()).index();this.table.setSelection(e("td:eq("+t+"),th:eq("+t+")",this.table.getAllRows()),!0)},selectAllCells:function(){this.table.setSelection(e(s,this.table.getAllRows()),!0)},setBorderColor:function(e,t){this.table.getSelection().css("borderColor",t)},removeBorderColor:function(){this.table.getSelection().css("borderColor","")},setBackgroundColor:function(e,t){this.table.getSelection().css("backgroundColor",t)},removeBackgroundColor:function(){this.table.getSelection().css("backgroundColor","")},processBorder:function(t){var n=e("#redactor-table-edit-border-top",t).hasClass("redactor-button-active"),i=e("#redactor-table-edit-border-right",t).hasClass("redactor-button-active"),r=e("#redactor-table-edit-border-bottom",t).hasClass("redactor-button-active"),a=e("#redactor-table-edit-border-left",t).hasClass("redactor-button-active"),o=e("#redactor-table-edit-border",t).val()+"px"||"1px";this.table.getSelection().css({borderTopWidth:n?o:0,borderRightWidth:i?o:0,borderBottomWidth:r?o:0,borderLeftWidth:a?o:0,borderStyle:"solid"})},processWidth:function(t){var n=e("#redactor-table-edit-width",t).val(),i=e("#redactor-table-edit-width-unit",t).val();this.table.getSelectionColumns().css("width",n+i)},restoreAfterDelete:function(e){this.selection.restore(),e.find("span.redactor-selection-marker").remove(),this.code.sync()},deleteTable:function(){var e=this.table.getTable();if(e){this.buffer.set();var t=e.next();this.opts.linebreaks||0===t.length?this.caret.setAfter(e):this.caret.setStart(t),e.remove(),this.code.sync()}}},r})),n("modules/textdirection",[],(function(){"use strict";function e(){}return e.prototype={initialize:function(){var e=this,t={};t.ltr={title:"Left to Right",func:e.textdirection.setLtr},t.rtl={title:"Right to Left",func:e.textdirection.setRtl};var n=this.button.get("textdirection");n.length&&this.button.addDropdown(n,t)},setRtl:function(){this.buffer.set(),this.block.setAttr("dir","rtl")},setLtr:function(){this.buffer.set(),this.block.removeAttr("dir")}},e})),n("modules/tidy",["jquery"],(function(e){"use strict";function t(){}return t.prototype={
setupAllowed:function(){if(this.opts.allowedTags&&(this.opts.deniedTags=!1),this.opts.allowedAttr&&(this.opts.removeAttr=!1),!this.opts.linebreaks){var e=["p","section"];this.opts.allowedTags&&this.tidy.addToAllowed(e),this.opts.deniedTags&&this.tidy.removeFromDenied(e)}},addToAllowed:function(t){for(var n=t.length,i=0;i<n;i++)-1===e.inArray(t[i],this.opts.allowedTags)&&this.opts.allowedTags.push(t[i])},removeFromDenied:function(t){for(var n=t.length,i=0;i<n;i++){var r=e.inArray(t[i],this.opts.deniedTags);-1!==r&&this.opts.deniedTags.splice(r,1)}},load:function(t,n){return this.tidy.settings={deniedTags:this.opts.deniedTags,allowedTags:this.opts.allowedTags,removeComments:this.opts.removeComments,replaceTags:this.opts.replaceTags,replaceStyles:this.opts.replaceStyles,removeDataAttr:this.opts.removeDataAttr,removeAttr:this.opts.removeAttr,allowedAttr:this.opts.allowedAttr,removeWithoutAttr:this.opts.removeWithoutAttr,removeEmpty:this.opts.removeEmpty},e.extend(this.tidy.settings,n),t=this.tidy.removeComments(t),this.tidy.$div=e("<div />").append(t),this.tidy.replaceTags(),this.tidy.replaceStyles(),this.tidy.removeTags(),this.tidy.removeAttr(),this.tidy.removeEmpty(),this.tidy.removeParagraphsInLists(),this.tidy.removeDataAttr(),this.tidy.removeWithoutAttr(),t=this.tidy.$div.html(),this.tidy.$div.remove(),t},removeComments:function(e){return this.tidy.settings.removeComments?e.replace(/<!--[\s\S]*?-->/gi,""):e},replaceTags:function(t){if(!this.tidy.settings.replaceTags)return t;for(var n=this.tidy.settings.replaceTags.length,i=[],r=[],a=0;a<n;a++)r.push(this.tidy.settings.replaceTags[a][1]),i.push(this.tidy.settings.replaceTags[a][0]);e.each(i,e.proxy((function(t,n){this.tidy.$div.find(n).replaceWith((function(){return e("<"+r[t]+" />",{html:e(this).html()})}))}),this))},replaceStyles:function(){if(this.tidy.settings.replaceStyles){var t=this.tidy.settings.replaceStyles.length;this.tidy.$div.find("span").each(e.proxy((function(n,i){function r(t,n){var i=document.createElement(n);return e(i).append(e(t).contents())}for(var a=e(i),o=a.attr("style"),s=0;s<t;s++)if(o&&o.match(new RegExp("^"+this.tidy.settings.replaceStyles[s][0],"i"))){var l=this.tidy.settings.replaceStyles[s][1];a.replaceWith(r(a[0],l))}}),this))}},removeTags:function(){!this.tidy.settings.deniedTags&&this.tidy.settings.allowedTags&&this.tidy.$div.find("*").not(this.tidy.settings.allowedTags.join(",")).each((function(t,n){""===n.innerHTML?e(n).remove():e(n).contents().unwrap()})),this.tidy.settings.deniedTags&&this.tidy.$div.find(this.tidy.settings.deniedTags.join(",")).each((function(t,n){""===n.innerHTML?e(n).remove():e(n).contents().unwrap()}))},removeAttr:function(){var t,n;if(!this.tidy.settings.removeAttr&&this.tidy.settings.allowedAttr){var i=[],r=[];for(n=this.tidy.settings.allowedAttr.length,t=0;t<n;t++)i.push(this.tidy.settings.allowedAttr[t][0]),r.push(this.tidy.settings.allowedAttr[t][1]);this.tidy.$div.find("*").each(e.proxy((function(t,n){var a=e(n),o=e.inArray(a[0].tagName.toLowerCase(),i),s=this.tidy.removeAttrGetRemoves(o,r,a);s&&e.each(s,(function(e,t){a.removeAttr(t)}))}),this))}if(this.tidy.settings.removeAttr)for(n=this.tidy.settings.removeAttr.length,t=0;t<n;t++){var a=this.tidy.settings.removeAttr[t][1];e.isArray(a)&&(a=a.join(" ")),this.tidy.$div.find(this.tidy.settings.removeAttr[t][0]).removeAttr(a)}},removeAttrGetRemoves:function(t,n,i){var r=[];return-1===t?e.each(i[0].attributes,(function(e,t){r.push(t.name)})):"*"===n[t].toString()?r=[]:e.each(i[0].attributes,(function(i,a){e.isArray(n[t])?-1===e.inArray(a.name,n[t])&&r.push(a.name):n[t]!==a.name&&r.push(a.name)})),r},removeAttrs:function(t,n){return n=new RegExp(n,"g"),t.each((function(){for(var t=e(this),i=this.attributes.length-1;i>=0;i--){var r=this.attributes[i];r&&r.specified&&r.name.search(n)>=0&&t.removeAttr(r.name)}}))},removeEmpty:function(){this.tidy.settings.removeEmpty&&this.tidy.$div.find(this.tidy.settings.removeEmpty.join(",")).each((function(){var t=e(this),n=t.text();""===(n=(n=(n=n.replace(/[\u200B-\u200D\uFEFF]/g,"")).replace(/&nbsp;/gi,"")).replace(/\s/g,""))&&0===t.children().length&&t.remove()}))},removeParagraphsInLists:function(){this.tidy.$div.find("li p").contents().unwrap()},removeDataAttr:function(){if(this.tidy.settings.removeDataAttr){var t=this.tidy.settings.removeDataAttr;e.isArray(this.tidy.settings.removeDataAttr)&&(t=this.tidy.settings.removeDataAttr.join(",")),this.tidy.removeAttrs(this.tidy.$div.find(t),"^(data-)")}},removeWithoutAttr:function(){this.tidy.settings.removeWithoutAttr&&this.tidy.$div.find(this.tidy.settings.removeWithoutAttr.join(",")).each((function(){0===this.attributes.length&&e(this).contents().unwrap()}))}},t})),n("modules/toolbar",["jquery"],(function(e){"use strict";function t(){}return t.prototype={init:function(){return{backcolor:{title:this.lang.get("backcolor")},html:{title:this.lang.get("html"),func:"code.toggle"},formatting:{title:this.lang.get("formatting"),dropdown:{p:{title:this.lang.get("paragraph"),func:"block.format"},blockquote:{title:this.lang.get("quote"),func:"block.format"},pre:{title:this.lang.get("code"),func:"block.format"},h1:{title:this.lang.get("header1"),func:"block.format"},h2:{title:this.lang.get("header2"),func:"block.format"},h3:{title:this.lang.get("header3"),func:"block.format"},h4:{title:this.lang.get("header4"),func:"block.format"},h5:{title:this.lang.get("header5"),func:"block.format"},h6:{title:this.lang.get("header6"),func:"block.format"}}},fontcolor:{title:this.lang.get("fontcolor")},fontfamily:{title:"Change Font Family"},fontsize:{title:"Change Font Size"},fullscreen:{title:"Fullscreen",func:"fullscreen.toggle"},bold:{title:this.lang.get("bold"),func:"inline.format"},embed:{title:this.lang.get("embed"),func:"embed.show"},italic:{title:this.lang.get("italic"),func:"inline.format"},deleted:{title:this.lang.get("deleted"),func:"inline.format"},underline:{title:this.lang.get("underline"),func:"inline.format"},unorderedlist:{title:"&bull; "+this.lang.get("unorderedlist"),func:"list.toggle"},orderedlist:{title:"1. "+this.lang.get("orderedlist"),func:"list.toggle"},outdent:{title:"< "+this.lang.get("outdent"),func:"indent.decrease"},indent:{title:"> "+this.lang.get("indent"),func:"indent.increase"},image:{title:this.lang.get("image"),func:"image.show"},file:{title:this.lang.get("file"),func:"file.show"},link:{title:this.lang.get("link"),dropdown:{link:{title:this.lang.get("link_insert"),func:"link.show"},unlink:{title:this.lang.get("unlink"),func:"link.unlink"}}},media:{title:this.lang.get("media"),func:"media.show"},table:{title:this.lang.get("table")},textdirection:{title:"Change Text Direction"},alignment:{title:this.lang.get("alignment"),dropdown:{left:{title:this.lang.get("align_left"),func:"alignment.left"},center:{title:this.lang.get("align_center"),func:"alignment.center"},right:{title:this.lang.get("align_right"),func:"alignment.right"},justify:{title:this.lang.get("align_justify"),func:"alignment.justify"}}},horizontalrule:{title:this.lang.get("horizontalrule"),func:"line.insert"},undo:{title:"Undo",func:"buffer.undo"},redo:{title:"Redo",func:"buffer.redo"}}},build:function(){this.toolbar.hideButtons(),this.toolbar.hideButtonsOnMobile(),this.toolbar.isButtonSourceNeeded(),0!==this.opts.buttons.length&&(this.$toolbar=this.toolbar.createContainer(),this.toolbar.setOverflow(),this.toolbar.append(),this.toolbar.setFormattingTags(),this.toolbar.loadButtons(),this.toolbar.setFixed(),this.opts.activeButtons&&this.$editor.on("mouseup.redactor keyup.redactor focus.redactor",e.proxy(this.observe.buttons,this)))},createContainer:function(){return e("<ul>").addClass("redactor-toolbar").attr("id","redactor-toolbar-"+this.uuid)},setFormattingTags:function(){e.each(this.opts.toolbar.formatting.dropdown,e.proxy((function(t){-1===e.inArray(t,this.opts.formatting)&&delete this.opts.toolbar.formatting.dropdown[t]}),this))},loadButtons:function(){e.each(this.opts.buttons,e.proxy((function(t,n){if(this.opts.toolbar[n]){if("file"===n){if(!1===this.opts.fileUpload)return;if(!this.opts.fileUpload&&!1===this.opts.s3)return}var i=this.opts.toolbar[n];this.$toolbar.append(e("<li>").append(this.button.build(n,i)))}}),this))},append:function(){this.opts.toolbarExternal?(this.$toolbar.addClass("redactor-toolbar-external"),e(this.opts.toolbarExternal).html(this.$toolbar)):this.$box.prepend(this.$toolbar)},setFixed:function(){this.utils.isDesktop()&&(this.opts.toolbarExternal||this.opts.toolbarFixed&&(this.toolbar.observeScroll(),e(this.opts.toolbarFixedTarget).on("scroll.redactor."+this.uuid,e.proxy(this.toolbar.observeScroll,this))))},setOverflow:function(){this.utils.isMobile()&&this.opts.toolbarOverflow&&this.$toolbar.addClass("redactor-toolbar-overflow")},isButtonSourceNeeded:function(){if(!this.opts.source){var e=this.opts.buttons.indexOf("html");-1!==e&&this.opts.buttons.splice(e,1)}},hideButtons:function(){0!==this.opts.buttonsHide.length&&e.each(this.opts.buttonsHide,e.proxy((function(e,t){var n=this.opts.buttons.indexOf(t);n>=0&&this.opts.buttons.splice(n,1)}),this))},hideButtonsOnMobile:function(){this.utils.isMobile()&&0!==this.opts.buttonsHideOnMobile.length&&e.each(this.opts.buttonsHideOnMobile,e.proxy((function(e,t){var n=this.opts.buttons.indexOf(t);this.opts.buttons.splice(n,1)}),this))},observeScroll:function(){var t=e(this.opts.toolbarFixedTarget).scrollTop(),n=1;this.opts.toolbarFixedTarget===document&&(n=this.$box.offset().top),t>n?this.toolbar.observeScrollEnable(t,n):this.toolbar.observeScrollDisable()},observeScrollEnable:function(t,n){var i=this.$toolbar.height(),r=n+this.$box.height()-i,a=this.$box.innerWidth();this.$box.css("paddingTop",i+"px"),this.$toolbar.addClass("toolbar-fixed-box"),this.$toolbar.css({position:"fixed",width:a,top:0,left:this.$box.offset().left-e(this.opts.toolbarFixedTarget).scrollLeft()}),t>r&&e(".redactor-dropdown-"+this.uuid+":visible").hide(),this.toolbar.setDropdownsFixed(),this.$toolbar.css("visibility",t<r?"visible":"hidden")},observeScrollDisable:function(){this.$toolbar.css({position:"relative",width:"auto",top:0,left:0,visibility:"visible"}),this.$box.css("paddingTop",""),this.toolbar.unsetDropdownsFixed(),this.$toolbar.removeClass("toolbar-fixed-box")},setDropdownsFixed:function(){var t=this.$toolbar.innerHeight()+this.opts.toolbarFixedTopOffset,n="fixed";this.opts.toolbarFixedTarget!==document&&(t=this.$toolbar.innerHeight()+this.$toolbar.offset().top+this.opts.toolbarFixedTopOffset,n="absolute"),e(".redactor-dropdown-"+this.uuid).each((function(){e(this).css({position:n,top:t+"px"})}))},unsetDropdownsFixed:function(){var t=this.$toolbar.innerHeight()+this.$toolbar.offset().top;e(".redactor-dropdown-"+this.uuid).each((function(){e(this).css({position:"absolute",top:t+"px"})}))}},t})),n("modules/upload",["jquery"],(function(e){"use strict";function t(){}return t.prototype={init:function(t,n,i){this.upload.direct=!1,this.upload.callback=i,this.upload.url=n,this.upload.$el=e(t),this.upload.$droparea=e('<div id="redactor-droparea" />'),this.upload.$placeholdler=e('<div id="redactor-droparea-placeholder" />').text(this.lang.get("upload_label")),this.upload.$input=e('<input type="file" name="file" />'),this.upload.$placeholdler.append(this.upload.$input),this.upload.$droparea.append(this.upload.$placeholdler),this.upload.$el.append(this.upload.$droparea),this.upload.$droparea.off("redactor.upload"),this.upload.$input.off("redactor.upload"),this.upload.$droparea.on("dragover.redactor.upload",e.proxy(this.upload.onDrag,this)),this.upload.$droparea.on("dragleave.redactor.upload",e.proxy(this.upload.onDragLeave,this)),this.upload.$input.on("change.redactor.upload",e.proxy((function(e){e=e.originalEvent||e,this.upload.traverseFile(this.upload.$input[0].files[0],e)}),this)),this.upload.$droparea.on("drop.redactor.upload",e.proxy((function(e){e.preventDefault(),this.upload.$droparea.removeClass("drag-hover").addClass("drag-drop"),this.upload.onDrop(e)}),this))},directUpload:function(e,t){this.upload.direct=!0,this.upload.traverseFile(e,t)},onDrop:function(e){var t=(e=e.originalEvent||e).dataTransfer.files;this.upload.traverseFile(t[0],e)},traverseFile:function(e,t){if(this.opts.s3)return this.upload.setConfig(e),void this.upload.s3uploadFile(e);var n=window.FormData?new FormData:null;if(window.FormData){this.upload.setConfig(e);var i="image"===this.upload.type?this.opts.imageUploadParam:this.opts.fileUploadParam;n.append(i,e)}this.progress.show(),this.core.setCallback("uploadStart",t,n),this.upload.sendData(n,t)},setConfig:function(e){this.upload.getType(e),this.upload.direct&&(this.upload.url="image"===this.upload.type?this.opts.imageUpload:this.opts.fileUpload,this.upload.callback="image"===this.upload.type?this.image.insert:this.file.insert)},getType:function(e){this.upload.type="image",-1===this.opts.imageTypes.indexOf(e.type)&&(this.upload.type="file")},getHiddenFields:function(t,n){return!1===t||"object"!=typeof t||e.each(t,e.proxy((function(t,i){null!==i&&0===i.toString().indexOf("#")&&(i=e(i).val()),n.append(t,i)}),this)),n},sendData:function(t,n){"image"===this.upload.type?(t=this.upload.getHiddenFields(this.opts.uploadImageFields,t),t=this.upload.getHiddenFields(this.upload.imageFields,t)):(t=this.upload.getHiddenFields(this.opts.uploadFileFields,t),t=this.upload.getHiddenFields(this.upload.fileFields,t));var i=new XMLHttpRequest;i.open("POST",this.upload.url),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.onreadystatechange=e.proxy((function(){if(4===i.readyState){var t,r=i.responseText;r=(r=r.replace(/^\[/,"")).replace(/\]$/,"");try{t="string"==typeof r?e.parseJSON(r):r}catch(e){t={error:!0}}this.progress.hide(),this.upload.direct||this.upload.$droparea.removeClass("drag-drop"),this.upload.callback(t,this.upload.direct,n)}}),this),i.send(t)},onDrag:function(e){e.preventDefault(),this.upload.$droparea.addClass("drag-hover")},onDragLeave:function(e){e.preventDefault(),this.upload.$droparea.removeClass("drag-hover")},clearImageFields:function(){this.upload.imageFields={}},addImageFields:function(e,t){this.upload.imageFields[e]=t},removeImageFields:function(e){delete this.upload.imageFields[e]},clearFileFields:function(){this.upload.fileFields={}},addFileFields:function(e,t){this.upload.fileFields[e]=t},removeFileFields:function(e){delete this.upload.fileFields[e]},s3uploadFile:function(t){this.upload.s3executeOnSignedUrl(t,e.proxy((function(e){this.upload.s3uploadToS3(t,e)}),this))},s3executeOnSignedUrl:function(e,t){var n=new XMLHttpRequest,i="?";"-1"!==this.opts.s3.search(/\?/)&&(i="&"),n.open("GET",this.opts.s3+i+"name="+e.name+"&type="+e.type,!0),n.overrideMimeType&&n.overrideMimeType("text/plain; charset=x-user-defined");var r=this;n.onreadystatechange=function(){4===this.readyState&&200===this.status?(r.progress.show(),t(decodeURIComponent(this.responseText))):4===this.readyState&&this.status},n.send()},s3createCORSRequest:function(e,t){var n=new XMLHttpRequest;return"withCredentials"in n?n.open(e,t,!0):"undefined"!=typeof XDomainRequest?(n=new XDomainRequest).open(e,t):n=null,n},s3uploadToS3:function(t,n){var i=this.upload.s3createCORSRequest("PUT",n);!i||(i.onload=e.proxy((function(){if(200===i.status){this.progress.hide();var e=n.split("?");if(!e[0])return!1;this.upload.direct||this.upload.$droparea.removeClass("drag-drop");var t={filelink:e[0]};if("file"===this.upload.type){var r=e[0].split("/");t.filename=r[r.length-1]}this.upload.callback(t,this.upload.direct,!1)}}),this),i.onerror=function(){},i.upload.onprogress=function(){},i.setRequestHeader("Content-Type",t.type),i.setRequestHeader("x-amz-acl","public-read"),i.send(t))}},t})),n("modules/utils",["jquery"],(function(e){"use strict";function t(){}return t.prototype={isMobile:function(){return/(iPhone|iPod|BlackBerry|Android)/.test(navigator.userAgent)},isDesktop:function(){return!/(iPhone|iPod|iPad|BlackBerry|Android)/.test(navigator.userAgent)},isString:function(e){return"[object String]"===Object.prototype.toString.call(e)},isEmpty:function(t,n){return t=(t=(t=(t=(t=(t=(t=t.replace(/[\u200B-\u200D\uFEFF]/g,"")).replace(/&nbsp;/gi,"")).replace(/<\/?br\s?\/?>/g,"")).replace(/\s/g,"")).replace(/^<p>[^\W\w\D\d]*?<\/p>$/i,"")).replace(/<iframe([^>]*)>$/i,"iframe")).replace(/<source([^>]*)>$/i,"source"),!1!==n&&(t=(t=t.replace(/<[^\/>][^>]*><\/[^>]+>/gi,"")).replace(/<[^\/>][^>]*><\/[^>]+>/gi,"")),""===(t=e.trim(t))},normalize:function(e){return void 0===e?0:parseInt(e.replace("px",""),10)},hexToRgb:function(e){if(void 0!==e){if(-1===e.search(/^#/))return e;var t=/^#?([a-f\d])([a-f\d])([a-f\d])$/i;e=e.replace(t,(function(e,t,n,i){return t+t+n+n+i+i}));var n=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return"rgb("+parseInt(n[1],16)+", "+parseInt(n[2],16)+", "+parseInt(n[3],16)+")"}},getOuterHtml:function(t){return e("<div>").append(e(t).eq(0).clone()).html()},getAlignmentElement:function(t){return-1!==e.inArray(t.tagName,this.opts.alignmentTags)?e(t):e(t).closest(this.opts.alignmentTags.toString().toLowerCase(),this.$editor[0])},removeEmptyAttr:function(t,n){var i=e(t);return void 0===i.attr(n)||""===i.attr(n)&&(i.removeAttr(n),!0)},removeEmpty:function(t,n){var i=e(e.parseHTML(n));if(i.find(".redactor-invisible-space").removeAttr("style").removeAttr("class"),0===i.find("hr, br, img, video, iframe, source").length){var r=e.trim(i.text());this.utils.isEmpty(r,!1)&&i.remove()}},saveScroll:function(){this.saveEditorScroll=this.$editor.scrollTop(),this.saveBodyScroll=e(window).scrollTop(),this.opts.scrollTarget&&(this.saveTargetScroll=e(this.opts.scrollTarget).scrollTop())},restoreScroll:function(){void 0===this.saveScroll&&void 0===this.saveBodyScroll||(e(window).scrollTop(this.saveBodyScroll),this.$editor.scrollTop(this.saveEditorScroll),this.opts.scrollTarget&&e(this.opts.scrollTarget).scrollTop(this.saveTargetScroll))},createSpaceElement:function(){var e=document.createElement("span");return e.className="redactor-invisible-space",e.innerHTML=this.opts.invisibleSpace,e},removeInlineTags:function(t){var n=this.opts.inlineTags;n.push("span"),"PRE"===t.tagName&&n.push("a"),e(t).find(n.join(",")).not("span.redactor-selection-marker").contents().unwrap()},replaceWithContents:function(t,n){var i=this;return e(t).replaceWith((function(){return!0===n&&i.utils.removeInlineTags(this),e(this).contents()})),e(t)},replaceToTag:function(t,n,i){var r,a=this;return e(t).replaceWith((function(){r=e("<"+n+" />").append(e(this).contents());for(var t=0;t<this.attributes.length;t++)r.attr(this.attributes[t].name,this.attributes[t].value);return!0===i&&a.utils.removeInlineTags(r),r})),r},isStartOfElement:function(){var e=this.selection.getBlock();return!!e&&0===this.caret.getOffsetOfElement(e)},isEndOfElement:function(t){return!(void 0===t&&!(t=this.selection.getBlock()))&&this.caret.getOffsetOfElement(t)===e.trim(e(t).text()).replace(/\n\r\n/g,"").length},isEndOfEditor:function(){var t=this.$editor[0];return this.caret.getOffsetOfElement(t)===e.trim(e(t).html().replace(/(<([^>]+)>)/gi,"")).length},isBlock:function(e){return(e=e[0]||e)&&this.utils.isBlockTag(e.tagName)},isBlockTag:function(e){return void 0!==e&&this.reIsBlock.test(e)},isInline:function(e){return(e=e[0]||e)&&this.utils.isInlineTag(e.tagName)},isInlineTag:function(e){return void 0!==e&&this.reIsInline.test(e)},isTag:function(t,n){var i=e(t).closest(n,this.$editor[0]);return 1===i.length&&i[0]},isSelectAll:function(){return this.selectAll},enableSelectAll:function(){this.selectAll=!0},disableSelectAll:function(){this.selectAll=!1},isRedactorParent:function(t){return!!t&&(0!==e(t).parents(".redactor-editor").length&&!e(t).hasClass("redactor-editor")&&t)},isCurrentOrParentHeader:function(){return this.utils.isCurrentOrParent(["H1","H2","H3","H4","H5","H6"])},isCurrentOrParent:function(t){var n=this.selection.getParent(),i=this.selection.getCurrent();if(e.isArray(t)){var r=0;return e.each(t,e.proxy((function(e,t){this.utils.isCurrentOrParentOne(i,n,t)&&r++}),this)),0!==r}return this.utils.isCurrentOrParentOne(i,n,t)},isCurrentOrParentOne:function(e,t,n){return n=n.toUpperCase(),t&&t.tagName===n?t:!(!e||e.tagName!==n)&&e},isOldIe:function(){return!!(this.utils.browser("msie")&&parseInt(this.utils.browser("version"),10)<9)},isLessIe10:function(){return!!(this.utils.browser("msie")&&parseInt(this.utils.browser("version"),10)<10)},isIe11:function(){return!!navigator.userAgent.match(/Trident\/7\./)},browser:function(e){var t=navigator.userAgent.toLowerCase(),n=/(opr)[\/]([\w.]+)/.exec(t)||/(chrome)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(t)||/(webkit)[ \/]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return"safari"===e?void 0!==n[3]&&"safari"===n[3]:"version"===e?n[2]:"webkit"===e?"chrome"===n[1]||"opr"===n[1]||"webkit"===n[1]:"rv"===n[1]?"msie"===e:"opr"===n[1]?"webkit"===e:e===n[1]}},t})),n("Redactor",["require","jquery","jquery-redactor-shim","options","modules/alignment","modules/block","modules/buffer","modules/build","modules/button","modules/caret","modules/clean","modules/code","modules/codeMirror","modules/core","modules/dropdown","modules/embed","modules/file","modules/focus","modules/fontcolor","modules/fontfamily","modules/fontsize","modules/fs","modules/fullscreen","modules/image","modules/indent","modules/inline","modules/insert","modules/keydown","modules/keyup","modules/lang","modules/line","modules/link","modules/linkify","modules/list","modules/media","modules/modal","modules/observe","modules/paragraphize","modules/paste","modules/placeholder","modules/progress","modules/resize","modules/selection","modules/shortcuts","modules/styles","modules/tabifier","modules/table","modules/textdirection","modules/tidy","modules/toolbar","modules/upload","modules/utils"],(function(e){"use strict";function t(e,t){var r=this;this.beforeInit(t).always((function(t){if(r.$element=n(e),r.uuid=i++,r.rtePaste=!1,r.$pasteBox=!1,r.loadOptions(t),r.loadModules(r.modules),isNaN(r.opts.indentValue)&&(r.opts.indentValue=parseFloat(n(document.body).css("font-size"))),r.opts&&r.opts.codeOnly&&(r.opts.visual=!1),r.formatting={},n.merge(r.opts.blockLevelElements,r.opts.alignmentTags),r.reIsBlock=new RegExp("^("+r.opts.blockLevelElements.join("|")+")$","i"),r.reIsInline=new RegExp("^("+r.opts.inlineTags.join("|")+")$","i"),r.tidy.setupAllowed(),!1!==r.opts.deniedTags)for(var a=["html","head","link","body","meta","applet"],o=0;o<a.length;o++)r.opts.deniedTags.push(a[o]);r.lang.load(),n.extend(r.opts.shortcuts,r.opts.shortcutsAdd),r.core.setCallback("start"),r.start=!0,r.build.run(),r.fs.init(),r.fs.hidePluginButtons(),r.$element.on("modalOpened.redactor-api",r.fs.modalIframeBrowseInit),r.$element.on("dropdownShown.redactor-api",r.fs.dropdownShow),r.$element.on("sync.redactor-api",r.fs.sync)}))}var n=e("jquery"),i=0;return e("jquery-redactor-shim"),Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,i=function(){},r=function(){return n.apply(this instanceof i?this:e,t.concat(Array.prototype.slice.call(arguments)))};return i.prototype=this.prototype,r.prototype=new i,r}),n.fn.redactor=function(e){var i=[],r=Array.prototype.slice.call(arguments,1);return"string"==typeof e?this.each((function(){var t,a=n.data(this,"redactor");if(-1!==e.search(/\./)?void 0!==a[(t=e.split("."))[0]]&&(t=a[t[0]][t[1]]):t=a[e],void 0!==a&&n.isFunction(t)){var o=t.apply(a,r);void 0!==o&&o!==a&&i.push(o)}else n.error('No such method "'+e+'" for Redactor')})):this.each((function(){n.data(this,"redactor",{}),n.data(this,"redactor",new t(this,e))})),0===i.length?this:1===i.length?i[0]:i},window.hasRedactor=!0,window.Redactor=t.prototype={version:"1.1.3",keyCode:{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,SPACE:32,ESC:27,TAB:9,CTRL:17,META:91,SHIFT:16,ALT:18,RIGHT:39,LEFT:37,LEFT_WIN:91},opts:e("options"),modules:["alignment","block","buffer","build","button","caret","clean","code","codeMirror","core","dropdown","embed","file","focus","fs","fontcolor","fontfamily","fontsize","fullscreen","image","indent","inline","insert","keydown","keyup","lang","line","link","linkify","list","media","modal","observe","paragraphize","paste","placeholder","progress","resize","selection","shortcuts","styles","tabifier","table","textdirection","tidy","toolbar","upload","utils"],loadOptions:function(e){this.opts=n.extend({},n.extend(!0,{},this.opts),this.$element.data(),e)},beforeInit:function(e){var t=n.Deferred();return t.resolve(e),t},getModuleMethods:function(e){return Object.getOwnPropertyNames(Object.getPrototypeOf(e)).filter((function(t){return"function"==typeof e[t]}))},loadModules:function(e){for(var t=e.length,n=0;n<t;n++)this.bindModuleMethods(e[n])},bindModuleMethods:function(e){if(void 0!==this[e]){this[e]=new this[e];for(var t=this.getModuleMethods(this[e]),n=t.length,i=0;i<n;i++)this[e][t[i]]=this[e][t[i]].bind(this)}},alignment:e("modules/alignment"),block:e("modules/block"),buffer:e("modules/buffer"),build:e("modules/build"),button:e("modules/button"),caret:e("modules/caret"),clean:e("modules/clean"),code:e("modules/code"),codeMirror:e("modules/codeMirror"),core:e("modules/core"),dropdown:e("modules/dropdown"),embed:e("modules/embed"),file:e("modules/file"),focus:e("modules/focus"),fontcolor:e("modules/fontcolor"),fontfamily:e("modules/fontfamily"),fontsize:e("modules/fontsize"),fs:e("modules/fs"),fullscreen:e("modules/fullscreen"),image:e("modules/image"),indent:e("modules/indent"),inline:e("modules/inline"),insert:e("modules/insert"),keydown:e("modules/keydown"),keyup:e("modules/keyup"),lang:e("modules/lang"),line:e("modules/line"),link:e("modules/link"),linkify:e("modules/linkify"),list:e("modules/list"),media:e("modules/media"),modal:e("modules/modal"),observe:e("modules/observe"),paragraphize:e("modules/paragraphize"),paste:e("modules/paste"),placeholder:e("modules/placeholder"),progress:e("modules/progress"),resize:e("modules/resize"),selection:e("modules/selection"),shortcuts:e("modules/shortcuts"),styles:e("modules/styles"),tabifier:e("modules/tabifier"),table:e("modules/table"),textdirection:e("modules/textdirection"),tidy:e("modules/tidy"),toolbar:e("modules/toolbar"),upload:e("modules/upload"),utils:e("modules/utils")},t})),t("Redactor")})),function(e,t,n,i){"use strict";function r(e){e.buttonsHide=e.buttonsHide||[];var t={edit_background_color:"backcolor",edit_font_color:"fontcolor",edit_font_face:"fontfamily",edit_font_size:"fontsize",edit_html:"html",edit_images:"image",insert_tables:"table"};return n.each(t,(function(t,n){a[t]||e.buttonsHide.push(n)})),e.forceImage&&(e.buttonsHide=i.without(e.buttonsHide,"image")),e}var a;t.prototype.opts=n.extend(t.prototype.opts,{aviaryPopupURL:"/cf_filemanager/imageedit.cfm?mode=editor&file={file}&composer",browseFileURL:"/cf_filemanager/adminfiles.cfm?opener=iframe",browseMediaURL:"/fs/pages/media_picker",browseSiteURL:"/fs/pages/picker",localStylesheet:"styles.cfm",link:{anchorSelector:".fsContentEditable [id], .redactor-editor [id]",mediaTest:/^#media-playlist-link/,siteFileTest:/^(file.cfm|\/?uploaded)/gi,onMediaBrowseReturn:function(e){return e.path="#media-playlist-link",e}},media:{onMediaBrowseReturn:function(e){return e.path="/cf_media/embed.cfm?"+e.flashVars,e}}}),t.prototype.beforeInit=function(t){var i=n.Deferred();return(a=a||(window.FSApp?window.FSApp.currentUser.get("rights").editor:void 0))?i.resolve(r(t)):e.getInternalNS("user").getCurrentUser().always((function(e){a=e.rights?e.rights.editor:{},i.resolve(r(t))})),i.promise()}}(FS,Redactor,jQuery,_),((e,t)=>{let n="styles_ckeditor.cfm";t.FS.settings&&t.FS.settings.styleManagerEnabled&&(n="fs/styles/ck_editor.js");const i={baseFloatZIndex:1e5,baseurl:"/",isComposer:!0,maxLength:75e3,pagePickers:0,stylesSet:`fs_styles:/${n}`,toolbar:[{name:"document",items:["A11ychecker","fskitchensink","autoFormat","sourceUndo","sourceRedo","Undo","Redo","Bold","Italic","Format","Styles","JustifyGrouped","RemoveFormat","Table","HorizontalRule","fsLink","fsImage","fsmedia","BulletedList","NumberedList","Underline","IndentGrouped","BidiGrouped"]},{items:[],name:"styles"},{name:"otherthings",items:["Blockquote","SpecialChar","PasteCode","Mathjax","Superscript","Subscript","Strike","Abbr"]}]},r={...i,toolbar:[{name:"document",items:["fskitchensink","Undo","Redo"]},{name:"basicstyles",items:["Bold","Italic","Underline","Strike","Abbr"]},{name:"paragraph",items:["NumberedList","BulletedList","IndentGrouped","JustifyGrouped"]},{name:"links",items:["fsLink"]},{name:"styles",items:["Format","Styles"]}]},a={...i,codeOnly:!0,startupMode:"source",codemirror:{autoCloseBrackets:!0,autoCloseTags:!0,lint:!0,showAutoCompleteButton:!0,showHint:!0},toolbar:[{items:["autoFormat","sourceUndo","sourceRedo"],name:"document"}]};let o=!1;const s=()=>o?Promise.resolve():(o=!0,new Promise(((n,i)=>{let r=t.FSApp&&t.FSApp.currentUser.get("rights").editor;if(r)return n(r);e.getInternalNS("user").getCurrentUser().done((e=>n(e.rights?e.rights.editor:{}))).fail(i)})).then((e=>{e.edit_html&&(i.toolbar.find((({name:e})=>"document"===e)).items.unshift("Source"),r.toolbar.find((({name:e})=>"document"===e)).items.unshift("Source"));const t=i.toolbar.find((({name:e})=>"styles"===e)).items;e.edit_font_face&&t.push("Font"),e.edit_font_size&&t.push("FontSize"),e.edit_font_color&&t.push("TextColor"),e.edit_background_color&&t.push("BGColor")})));e.ckeditor={getConfig:(e=i)=>new Promise((n=>{s().then((()=>{"basic"===e?e=r:"source"===e?e=a:"object"==typeof e&&(e={...i,...e});const o=Array.from(document.styleSheets).map((({href:e})=>e)).filter((e=>e)),s=document.head.querySelector("style#fsHSLColors");s&&o.push(s.textContent);const l={...e,contentsCss:o,usePickerEvents:e.usePickerEvents||!!t.FSApp};if(e.disableCode){const e=l.toolbar.find((({name:e})=>"otherthings"===e));e&&(e.items=e.items.filter((e=>"PasteCode"!==e)));const t=l.toolbar.find((({name:e})=>"document"===e));t&&(t.items=t.items.filter((e=>"Source"!==e)))}n(l)}))}))}})(FS,window),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof exports?module.exports=e(require("jquery")):e(jQuery)}((function(e){"use strict";var t=window.Slick||{};(t=function(){function t(t,i){var r,a=this;a.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:e(t),appendDots:e(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(t,n){return e('<button type="button" />').text(n+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},a.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},e.extend(a,a.initials),a.activeBreakpoint=null,a.animType=null,a.animProp=null,a.breakpoints=[],a.breakpointSettings=[],a.cssTransitions=!1,a.focussed=!1,a.interrupted=!1,a.hidden="hidden",a.paused=!0,a.positionProp=null,a.respondTo=null,a.rowCount=1,a.shouldClick=!0,a.$slider=e(t),a.$slidesCache=null,a.transformType=null,a.transitionType=null,a.visibilityChange="visibilitychange",a.windowWidth=0,a.windowTimer=null,r=e(t).data("slick")||{},a.options=e.extend({},a.defaults,i,r),a.currentSlide=a.options.initialSlide,a.originalSettings=a.options,void 0!==document.mozHidden?(a.hidden="mozHidden",a.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(a.hidden="webkitHidden",a.visibilityChange="webkitvisibilitychange"),a.autoPlay=e.proxy(a.autoPlay,a),a.autoPlayClear=e.proxy(a.autoPlayClear,a),a.autoPlayIterator=e.proxy(a.autoPlayIterator,a),a.changeSlide=e.proxy(a.changeSlide,a),a.clickHandler=e.proxy(a.clickHandler,a),a.selectHandler=e.proxy(a.selectHandler,a),
a.setPosition=e.proxy(a.setPosition,a),a.swipeHandler=e.proxy(a.swipeHandler,a),a.dragHandler=e.proxy(a.dragHandler,a),a.keyHandler=e.proxy(a.keyHandler,a),a.instanceUid=n++,a.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,a.registerBreakpoints(),a.init(!0)}var n=0;return t}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},t.prototype.addSlide=t.prototype.slickAdd=function(t,n,i){var r=this;if("boolean"==typeof n)i=n,n=null;else if(n<0||n>=r.slideCount)return!1;r.unload(),"number"==typeof n?0===n&&0===r.$slides.length?e(t).appendTo(r.$slideTrack):i?e(t).insertBefore(r.$slides.eq(n)):e(t).insertAfter(r.$slides.eq(n)):!0===i?e(t).prependTo(r.$slideTrack):e(t).appendTo(r.$slideTrack),r.$slides=r.$slideTrack.children(this.options.slide),r.$slideTrack.children(this.options.slide).detach(),r.$slideTrack.append(r.$slides),r.$slides.each((function(t,n){e(n).attr("data-slick-index",t)})),r.$slidesCache=r.$slides,r.reinit()},t.prototype.animateHeight=function(){var e=this;if(1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical){var t=e.$slides.eq(e.currentSlide).outerHeight(!0);e.$list.animate({height:t},e.options.speed)}},t.prototype.animateSlide=function(t,n){var i={},r=this;r.animateHeight(),!0===r.options.rtl&&!1===r.options.vertical&&(t=-t),!1===r.transformsEnabled?!1===r.options.vertical?r.$slideTrack.animate({left:t},r.options.speed,r.options.easing,n):r.$slideTrack.animate({top:t},r.options.speed,r.options.easing,n):!1===r.cssTransitions?(!0===r.options.rtl&&(r.currentLeft=-r.currentLeft),e({animStart:r.currentLeft}).animate({animStart:t},{duration:r.options.speed,easing:r.options.easing,step:function(e){e=Math.ceil(e),!1===r.options.vertical?(i[r.animType]="translate("+e+"px, 0px)",r.$slideTrack.css(i)):(i[r.animType]="translate(0px,"+e+"px)",r.$slideTrack.css(i))},complete:function(){n&&n.call()}})):(r.applyTransition(),t=Math.ceil(t),!1===r.options.vertical?i[r.animType]="translate3d("+t+"px, 0px, 0px)":i[r.animType]="translate3d(0px,"+t+"px, 0px)",r.$slideTrack.css(i),n&&setTimeout((function(){r.disableTransition(),n.call()}),r.options.speed))},t.prototype.getNavTarget=function(){var t=this,n=t.options.asNavFor;return n&&null!==n&&(n=e(n).not(t.$slider)),n},t.prototype.asNavFor=function(t){var n=this.getNavTarget();null!==n&&"object"==typeof n&&n.each((function(){var n=e(this).slick("getSlick");n.unslicked||n.slideHandler(t,!0)}))},t.prototype.applyTransition=function(e){var t=this,n={};!1===t.options.fade?n[t.transitionType]=t.transformType+" "+t.options.speed+"ms "+t.options.cssEase:n[t.transitionType]="opacity "+t.options.speed+"ms "+t.options.cssEase,!1===t.options.fade?t.$slideTrack.css(n):t.$slides.eq(e).css(n)},t.prototype.autoPlay=function(){var e=this;e.autoPlayClear(),e.slideCount>e.options.slidesToShow&&(e.autoPlayTimer=setInterval(e.autoPlayIterator,e.options.autoplaySpeed))},t.prototype.autoPlayClear=function(){var e=this;e.autoPlayTimer&&clearInterval(e.autoPlayTimer)},t.prototype.autoPlayIterator=function(){var e=this,t=e.currentSlide+e.options.slidesToScroll;e.paused||e.interrupted||e.focussed||(!1===e.options.infinite&&(1===e.direction&&e.currentSlide+1===e.slideCount-1?e.direction=0:0===e.direction&&(t=e.currentSlide-e.options.slidesToScroll,e.currentSlide-1==0&&(e.direction=1))),e.slideHandler(t))},t.prototype.buildArrows=function(){var t=this;!0===t.options.arrows&&(t.$prevArrow=e(t.options.prevArrow).addClass("slick-arrow"),t.$nextArrow=e(t.options.nextArrow).addClass("slick-arrow"),t.slideCount>t.options.slidesToShow?(t.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.prependTo(t.options.appendArrows),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.appendTo(t.options.appendArrows),!0!==t.options.infinite&&t.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):t.$prevArrow.add(t.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},t.prototype.buildDots=function(){var t,n,i=this;if(!0===i.options.dots){for(i.$slider.addClass("slick-dotted"),n=e("<ul />").addClass(i.options.dotsClass),t=0;t<=i.getDotCount();t+=1)n.append(e("<li />").append(i.options.customPaging.call(this,i,t)));i.$dots=n.appendTo(i.options.appendDots),i.$dots.find("li").first().addClass("slick-active")}},t.prototype.buildOut=function(){var t=this;t.$slides=t.$slider.children(t.options.slide+":not(.slick-cloned)").addClass("slick-slide"),t.slideCount=t.$slides.length,t.$slides.each((function(t,n){e(n).attr("data-slick-index",t).data("originalStyling",e(n).attr("style")||"")})),t.$slider.addClass("slick-slider"),t.$slideTrack=0===t.slideCount?e('<div class="slick-track"/>').appendTo(t.$slider):t.$slides.wrapAll('<div class="slick-track"/>').parent(),t.$list=t.$slideTrack.wrap('<div class="slick-list"/>').parent(),t.$slideTrack.css("opacity",0),!0!==t.options.centerMode&&!0!==t.options.swipeToSlide||(t.options.slidesToScroll=1),e("img[data-lazy]",t.$slider).not("[src]").addClass("slick-loading"),t.setupInfinite(),t.buildArrows(),t.buildDots(),t.updateDots(),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),!0===t.options.draggable&&t.$list.addClass("draggable")},t.prototype.buildRows=function(){var e,t,n,i,r,a,o,s=this;if(i=document.createDocumentFragment(),a=s.$slider.children(),s.options.rows>1){for(o=s.options.slidesPerRow*s.options.rows,r=Math.ceil(a.length/o),e=0;e<r;e++){var l=document.createElement("div");for(t=0;t<s.options.rows;t++){var d=document.createElement("div");for(n=0;n<s.options.slidesPerRow;n++){var c=e*o+(t*s.options.slidesPerRow+n);a.get(c)&&d.appendChild(a.get(c))}l.appendChild(d)}i.appendChild(l)}s.$slider.empty().append(i),s.$slider.children().children().children().css({width:100/s.options.slidesPerRow+"%",display:"inline-block"})}},t.prototype.checkResponsive=function(t,n){var i,r,a,o=this,s=!1,l=o.$slider.width(),d=window.innerWidth||e(window).width();if("window"===o.respondTo?a=d:"slider"===o.respondTo?a=l:"min"===o.respondTo&&(a=Math.min(d,l)),o.options.responsive&&o.options.responsive.length&&null!==o.options.responsive){for(i in r=null,o.breakpoints)o.breakpoints.hasOwnProperty(i)&&(!1===o.originalSettings.mobileFirst?a<o.breakpoints[i]&&(r=o.breakpoints[i]):a>o.breakpoints[i]&&(r=o.breakpoints[i]));null!==r?null!==o.activeBreakpoint?(r!==o.activeBreakpoint||n)&&(o.activeBreakpoint=r,"unslick"===o.breakpointSettings[r]?o.unslick(r):(o.options=e.extend({},o.originalSettings,o.breakpointSettings[r]),!0===t&&(o.currentSlide=o.options.initialSlide),o.refresh(t)),s=r):(o.activeBreakpoint=r,"unslick"===o.breakpointSettings[r]?o.unslick(r):(o.options=e.extend({},o.originalSettings,o.breakpointSettings[r]),!0===t&&(o.currentSlide=o.options.initialSlide),o.refresh(t)),s=r):null!==o.activeBreakpoint&&(o.activeBreakpoint=null,o.options=o.originalSettings,!0===t&&(o.currentSlide=o.options.initialSlide),o.refresh(t),s=r),t||!1===s||o.$slider.trigger("breakpoint",[o,s])}},t.prototype.changeSlide=function(t,n){var i,r,a=this,o=e(t.currentTarget);switch(o.is("a")&&t.preventDefault(),o.is("li")||(o=o.closest("li")),i=a.slideCount%a.options.slidesToScroll!=0?0:(a.slideCount-a.currentSlide)%a.options.slidesToScroll,t.data.message){case"previous":r=0===i?a.options.slidesToScroll:a.options.slidesToShow-i,a.slideCount>a.options.slidesToShow&&a.slideHandler(a.currentSlide-r,!1,n);break;case"next":r=0===i?a.options.slidesToScroll:i,a.slideCount>a.options.slidesToShow&&a.slideHandler(a.currentSlide+r,!1,n);break;case"index":var s=0===t.data.index?0:t.data.index||o.index()*a.options.slidesToScroll;a.slideHandler(a.checkNavigable(s),!1,n),o.children().trigger("focus");break;default:return}},t.prototype.checkNavigable=function(e){var t,n;if(n=0,e>(t=this.getNavigableIndexes())[t.length-1])e=t[t.length-1];else for(var i in t){if(e<t[i]){e=n;break}n=t[i]}return e},t.prototype.cleanUpEvents=function(){var t=this;t.options.dots&&null!==t.$dots&&(e("li",t.$dots).off("click.slick",t.changeSlide).off("mouseenter.slick",e.proxy(t.interrupt,t,!0)).off("mouseleave.slick",e.proxy(t.interrupt,t,!1)),!0===t.options.accessibility&&t.$dots.off("keydown.slick",t.keyHandler)),t.$slider.off("focus.slick blur.slick"),!0===t.options.arrows&&t.slideCount>t.options.slidesToShow&&(t.$prevArrow&&t.$prevArrow.off("click.slick",t.changeSlide),t.$nextArrow&&t.$nextArrow.off("click.slick",t.changeSlide),!0===t.options.accessibility&&(t.$prevArrow&&t.$prevArrow.off("keydown.slick",t.keyHandler),t.$nextArrow&&t.$nextArrow.off("keydown.slick",t.keyHandler))),t.$list.off("touchstart.slick mousedown.slick",t.swipeHandler),t.$list.off("touchmove.slick mousemove.slick",t.swipeHandler),t.$list.off("touchend.slick mouseup.slick",t.swipeHandler),t.$list.off("touchcancel.slick mouseleave.slick",t.swipeHandler),t.$list.off("click.slick",t.clickHandler),e(document).off(t.visibilityChange,t.visibility),t.cleanUpSlideEvents(),!0===t.options.accessibility&&t.$list.off("keydown.slick",t.keyHandler),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().off("click.slick",t.selectHandler),e(window).off("orientationchange.slick.slick-"+t.instanceUid,t.orientationChange),e(window).off("resize.slick.slick-"+t.instanceUid,t.resize),e("[draggable!=true]",t.$slideTrack).off("dragstart",t.preventDefault),e(window).off("load.slick.slick-"+t.instanceUid,t.setPosition)},t.prototype.cleanUpSlideEvents=function(){var t=this;t.$list.off("mouseenter.slick",e.proxy(t.interrupt,t,!0)),t.$list.off("mouseleave.slick",e.proxy(t.interrupt,t,!1))},t.prototype.cleanUpRows=function(){var e,t=this;t.options.rows>1&&((e=t.$slides.children().children()).removeAttr("style"),t.$slider.empty().append(e))},t.prototype.clickHandler=function(e){!1===this.shouldClick&&(e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault())},t.prototype.destroy=function(t){var n=this;n.autoPlayClear(),n.touchObject={},n.cleanUpEvents(),e(".slick-cloned",n.$slider).detach(),n.$dots&&n.$dots.remove(),n.$prevArrow&&n.$prevArrow.length&&(n.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),n.htmlExpr.test(n.options.prevArrow)&&n.$prevArrow.remove()),n.$nextArrow&&n.$nextArrow.length&&(n.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),n.htmlExpr.test(n.options.nextArrow)&&n.$nextArrow.remove()),n.$slides&&(n.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each((function(){e(this).attr("style",e(this).data("originalStyling"))})),n.$slideTrack.children(this.options.slide).detach(),n.$slideTrack.detach(),n.$list.detach(),n.$slider.append(n.$slides)),n.cleanUpRows(),n.$slider.removeClass("slick-slider"),n.$slider.removeClass("slick-initialized"),n.$slider.removeClass("slick-dotted"),n.unslicked=!0,t||n.$slider.trigger("destroy",[n])},t.prototype.disableTransition=function(e){var t=this,n={};n[t.transitionType]="",!1===t.options.fade?t.$slideTrack.css(n):t.$slides.eq(e).css(n)},t.prototype.fadeSlide=function(e,t){var n=this;!1===n.cssTransitions?(n.$slides.eq(e).css({zIndex:n.options.zIndex}),n.$slides.eq(e).animate({opacity:1},n.options.speed,n.options.easing,t)):(n.applyTransition(e),n.$slides.eq(e).css({opacity:1,zIndex:n.options.zIndex}),t&&setTimeout((function(){n.disableTransition(e),t.call()}),n.options.speed))},t.prototype.fadeSlideOut=function(e){var t=this;!1===t.cssTransitions?t.$slides.eq(e).animate({opacity:0,zIndex:t.options.zIndex-2},t.options.speed,t.options.easing):(t.applyTransition(e),t.$slides.eq(e).css({opacity:0,zIndex:t.options.zIndex-2}))},t.prototype.filterSlides=t.prototype.slickFilter=function(e){var t=this;null!==e&&(t.$slidesCache=t.$slides,t.unload(),t.$slideTrack.children(this.options.slide).detach(),t.$slidesCache.filter(e).appendTo(t.$slideTrack),t.reinit())},t.prototype.focusHandler=function(){var t=this;t.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",(function(n){n.stopImmediatePropagation();var i=e(this);setTimeout((function(){t.options.pauseOnFocus&&(t.focussed=i.is(":focus"),t.autoPlay())}),0)}))},t.prototype.getCurrent=t.prototype.slickCurrentSlide=function(){return this.currentSlide},t.prototype.getDotCount=function(){var e=this,t=0,n=0,i=0;if(!0===e.options.infinite)if(e.slideCount<=e.options.slidesToShow)++i;else for(;t<e.slideCount;)++i,t=n+e.options.slidesToScroll,n+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;else if(!0===e.options.centerMode)i=e.slideCount;else if(e.options.asNavFor)for(;t<e.slideCount;)++i,t=n+e.options.slidesToScroll,n+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;else i=1+Math.ceil((e.slideCount-e.options.slidesToShow)/e.options.slidesToScroll);return i-1},t.prototype.getLeft=function(e){var t,n,i,r,a=this,o=0;return a.slideOffset=0,n=a.$slides.first().outerHeight(!0),!0===a.options.infinite?(a.slideCount>a.options.slidesToShow&&(a.slideOffset=a.slideWidth*a.options.slidesToShow*-1,r=-1,!0===a.options.vertical&&!0===a.options.centerMode&&(2===a.options.slidesToShow?r=-1.5:1===a.options.slidesToShow&&(r=-2)),o=n*a.options.slidesToShow*r),a.slideCount%a.options.slidesToScroll!=0&&e+a.options.slidesToScroll>a.slideCount&&a.slideCount>a.options.slidesToShow&&(e>a.slideCount?(a.slideOffset=(a.options.slidesToShow-(e-a.slideCount))*a.slideWidth*-1,o=(a.options.slidesToShow-(e-a.slideCount))*n*-1):(a.slideOffset=a.slideCount%a.options.slidesToScroll*a.slideWidth*-1,o=a.slideCount%a.options.slidesToScroll*n*-1))):e+a.options.slidesToShow>a.slideCount&&(a.slideOffset=(e+a.options.slidesToShow-a.slideCount)*a.slideWidth,o=(e+a.options.slidesToShow-a.slideCount)*n),a.slideCount<=a.options.slidesToShow&&(a.slideOffset=0,o=0),!0===a.options.centerMode&&a.slideCount<=a.options.slidesToShow?a.slideOffset=a.slideWidth*Math.floor(a.options.slidesToShow)/2-a.slideWidth*a.slideCount/2:!0===a.options.centerMode&&!0===a.options.infinite?a.slideOffset+=a.slideWidth*Math.floor(a.options.slidesToShow/2)-a.slideWidth:!0===a.options.centerMode&&(a.slideOffset=0,a.slideOffset+=a.slideWidth*Math.floor(a.options.slidesToShow/2)),t=!1===a.options.vertical?e*a.slideWidth*-1+a.slideOffset:e*n*-1+o,!0===a.options.variableWidth&&(i=a.slideCount<=a.options.slidesToShow||!1===a.options.infinite?a.$slideTrack.children(".slick-slide").eq(e):a.$slideTrack.children(".slick-slide").eq(e+a.options.slidesToShow),t=!0===a.options.rtl?i[0]?-1*(a.$slideTrack.width()-i[0].offsetLeft-i.width()):0:i[0]?-1*i[0].offsetLeft:0,!0===a.options.centerMode&&(i=a.slideCount<=a.options.slidesToShow||!1===a.options.infinite?a.$slideTrack.children(".slick-slide").eq(e):a.$slideTrack.children(".slick-slide").eq(e+a.options.slidesToShow+1),t=!0===a.options.rtl?i[0]?-1*(a.$slideTrack.width()-i[0].offsetLeft-i.width()):0:i[0]?-1*i[0].offsetLeft:0,t+=(a.$list.width()-i.outerWidth())/2)),t},t.prototype.getOption=t.prototype.slickGetOption=function(e){return this.options[e]},t.prototype.getNavigableIndexes=function(){var e,t=this,n=0,i=0,r=[];for(!1===t.options.infinite?e=t.slideCount:(n=-1*t.options.slidesToScroll,i=-1*t.options.slidesToScroll,e=2*t.slideCount);n<e;)r.push(n),n=i+t.options.slidesToScroll,i+=t.options.slidesToScroll<=t.options.slidesToShow?t.options.slidesToScroll:t.options.slidesToShow;return r},t.prototype.getSlick=function(){return this},t.prototype.getSlideCount=function(){var t,n,i=this;return n=!0===i.options.centerMode?i.slideWidth*Math.floor(i.options.slidesToShow/2):0,!0===i.options.swipeToSlide?(i.$slideTrack.find(".slick-slide").each((function(r,a){if(a.offsetLeft-n+e(a).outerWidth()/2>-1*i.swipeLeft)return t=a,!1})),Math.abs(e(t).attr("data-slick-index")-i.currentSlide)||1):i.options.slidesToScroll},t.prototype.goTo=t.prototype.slickGoTo=function(e,t){this.changeSlide({data:{message:"index",index:parseInt(e)}},t)},t.prototype.init=function(t){var n=this;e(n.$slider).hasClass("slick-initialized")||(e(n.$slider).addClass("slick-initialized"),n.buildRows(),n.buildOut(),n.setProps(),n.startLoad(),n.loadSlider(),n.initializeEvents(),n.updateArrows(),n.updateDots(),n.checkResponsive(!0),n.focusHandler()),t&&n.$slider.trigger("init",[n]),!0===n.options.accessibility&&n.initADA(),n.options.autoplay&&(n.paused=!1,n.autoPlay())},t.prototype.initADA=function(){var t=this,n=Math.ceil(t.slideCount/t.options.slidesToShow),i=t.getNavigableIndexes().filter((function(e){return e>=0&&e<t.slideCount}));t.$slides.add(t.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==t.$dots&&(t.$slides.not(t.$slideTrack.find(".slick-cloned")).each((function(n){var r=i.indexOf(n);e(this).attr({role:"tabpanel",id:"slick-slide"+t.instanceUid+n,tabindex:-1}),-1!==r&&e(this).attr({"aria-describedby":"slick-slide-control"+t.instanceUid+r})})),t.$dots.attr("role","tablist").find("li").each((function(r){var a=i[r];e(this).attr({role:"presentation"}),e(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+t.instanceUid+r,"aria-controls":"slick-slide"+t.instanceUid+a,"aria-label":r+1+" of "+n,"aria-selected":null,tabindex:"-1"})})).eq(t.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var r=t.currentSlide,a=r+t.options.slidesToShow;r<a;r++)t.$slides.eq(r).attr("tabindex",0);t.activateADA()},t.prototype.initArrowEvents=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},e.changeSlide),e.$nextArrow.off("click.slick").on("click.slick",{message:"next"},e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow.on("keydown.slick",e.keyHandler),e.$nextArrow.on("keydown.slick",e.keyHandler)))},t.prototype.initDotEvents=function(){var t=this;!0===t.options.dots&&(e("li",t.$dots).on("click.slick",{message:"index"},t.changeSlide),!0===t.options.accessibility&&t.$dots.on("keydown.slick",t.keyHandler)),!0===t.options.dots&&!0===t.options.pauseOnDotsHover&&e("li",t.$dots).on("mouseenter.slick",e.proxy(t.interrupt,t,!0)).on("mouseleave.slick",e.proxy(t.interrupt,t,!1))},t.prototype.initSlideEvents=function(){var t=this;t.options.pauseOnHover&&(t.$list.on("mouseenter.slick",e.proxy(t.interrupt,t,!0)),t.$list.on("mouseleave.slick",e.proxy(t.interrupt,t,!1)))},t.prototype.initializeEvents=function(){var t=this;t.initArrowEvents(),t.initDotEvents(),t.initSlideEvents(),t.$list.on("touchstart.slick mousedown.slick",{action:"start"},t.swipeHandler),t.$list.on("touchmove.slick mousemove.slick",{action:"move"},t.swipeHandler),t.$list.on("touchend.slick mouseup.slick",{action:"end"},t.swipeHandler),t.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},t.swipeHandler),t.$list.on("click.slick",t.clickHandler),e(document).on(t.visibilityChange,e.proxy(t.visibility,t)),!0===t.options.accessibility&&t.$list.on("keydown.slick",t.keyHandler),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().on("click.slick",t.selectHandler),e(window).on("orientationchange.slick.slick-"+t.instanceUid,e.proxy(t.orientationChange,t)),e(window).on("resize.slick.slick-"+t.instanceUid,e.proxy(t.resize,t)),e("[draggable!=true]",t.$slideTrack).on("dragstart",t.preventDefault),e(window).on("load.slick.slick-"+t.instanceUid,t.setPosition),e(t.setPosition)},t.prototype.initUI=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.show(),e.$nextArrow.show()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.show()},t.prototype.keyHandler=function(e){var t=this;e.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===e.keyCode&&!0===t.options.accessibility?t.changeSlide({data:{message:!0===t.options.rtl?"next":"previous"}}):39===e.keyCode&&!0===t.options.accessibility&&t.changeSlide({data:{message:!0===t.options.rtl?"previous":"next"}}))},t.prototype.lazyLoad=function(){function t(t){e("img[data-lazy]",t).each((function(){var t=e(this),n=e(this).attr("data-lazy"),i=e(this).attr("data-srcset"),r=e(this).attr("data-sizes")||a.$slider.attr("data-sizes"),o=document.createElement("img");o.onload=function(){t.animate({opacity:0},100,(function(){i&&(t.attr("srcset",i),r&&t.attr("sizes",r)),t.attr("src",n).animate({opacity:1},200,(function(){t.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")})),a.$slider.trigger("lazyLoaded",[a,t,n])}))},o.onerror=function(){t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),a.$slider.trigger("lazyLoadError",[a,t,n])},o.src=n}))}var n,i,r,a=this;if(!0===a.options.centerMode?!0===a.options.infinite?r=(i=a.currentSlide+(a.options.slidesToShow/2+1))+a.options.slidesToShow+2:(i=Math.max(0,a.currentSlide-(a.options.slidesToShow/2+1)),r=a.options.slidesToShow/2+1+2+a.currentSlide):(i=a.options.infinite?a.options.slidesToShow+a.currentSlide:a.currentSlide,r=Math.ceil(i+a.options.slidesToShow),!0===a.options.fade&&(i>0&&i--,r<=a.slideCount&&r++)),n=a.$slider.find(".slick-slide").slice(i,r),"anticipated"===a.options.lazyLoad)for(var o=i-1,s=r,l=a.$slider.find(".slick-slide"),d=0;d<a.options.slidesToScroll;d++)o<0&&(o=a.slideCount-1),n=(n=n.add(l.eq(o))).add(l.eq(s)),o--,s++;t(n),a.slideCount<=a.options.slidesToShow?t(a.$slider.find(".slick-slide")):a.currentSlide>=a.slideCount-a.options.slidesToShow?t(a.$slider.find(".slick-cloned").slice(0,a.options.slidesToShow)):0===a.currentSlide&&t(a.$slider.find(".slick-cloned").slice(-1*a.options.slidesToShow))},t.prototype.loadSlider=function(){var e=this;e.setPosition(),e.$slideTrack.css({opacity:1}),e.$slider.removeClass("slick-loading"),e.initUI(),"progressive"===e.options.lazyLoad&&e.progressiveLazyLoad()},t.prototype.next=t.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},t.prototype.orientationChange=function(){var e=this;e.checkResponsive(),e.setPosition()},t.prototype.pause=t.prototype.slickPause=function(){var e=this;e.autoPlayClear(),e.paused=!0},t.prototype.play=t.prototype.slickPlay=function(){var e=this;e.autoPlay(),e.options.autoplay=!0,e.paused=!1,e.focussed=!1,e.interrupted=!1},t.prototype.postSlide=function(t){var n=this;n.unslicked||(n.$slider.trigger("afterChange",[n,t]),n.animating=!1,n.slideCount>n.options.slidesToShow&&n.setPosition(),n.swipeLeft=null,n.options.autoplay&&n.autoPlay(),!0===n.options.accessibility&&(n.initADA(),n.options.focusOnChange&&e(n.$slides.get(n.currentSlide)).attr("tabindex",0).focus()))},t.prototype.prev=t.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},t.prototype.preventDefault=function(e){e.preventDefault()},t.prototype.progressiveLazyLoad=function(t){t=t||1;var n,i,r,a,o,s=this,l=e("img[data-lazy]",s.$slider);l.length?(n=l.first(),i=n.attr("data-lazy"),r=n.attr("data-srcset"),a=n.attr("data-sizes")||s.$slider.attr("data-sizes"),(o=document.createElement("img")).onload=function(){r&&(n.attr("srcset",r),a&&n.attr("sizes",a)),n.attr("src",i).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===s.options.adaptiveHeight&&s.setPosition(),s.$slider.trigger("lazyLoaded",[s,n,i]),s.progressiveLazyLoad()},o.onerror=function(){t<3?setTimeout((function(){s.progressiveLazyLoad(t+1)}),500):(n.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),s.$slider.trigger("lazyLoadError",[s,n,i]),s.progressiveLazyLoad())},o.src=i):s.$slider.trigger("allImagesLoaded",[s])},t.prototype.refresh=function(t){var n,i,r=this;i=r.slideCount-r.options.slidesToShow,!r.options.infinite&&r.currentSlide>i&&(r.currentSlide=i),r.slideCount<=r.options.slidesToShow&&(r.currentSlide=0),n=r.currentSlide,r.destroy(!0),e.extend(r,r.initials,{currentSlide:n}),r.init(),t||r.changeSlide({data:{message:"index",index:n}},!1)},t.prototype.registerBreakpoints=function(){var t,n,i,r=this,a=r.options.responsive||null;if("array"===e.type(a)&&a.length){for(t in r.respondTo=r.options.respondTo||"window",a)if(i=r.breakpoints.length-1,a.hasOwnProperty(t)){for(n=a[t].breakpoint;i>=0;)r.breakpoints[i]&&r.breakpoints[i]===n&&r.breakpoints.splice(i,1),i--;r.breakpoints.push(n),r.breakpointSettings[n]=a[t].settings}r.breakpoints.sort((function(e,t){return r.options.mobileFirst?e-t:t-e}))}},t.prototype.reinit=function(){var t=this;t.$slides=t.$slideTrack.children(t.options.slide).addClass("slick-slide"),t.slideCount=t.$slides.length,t.currentSlide>=t.slideCount&&0!==t.currentSlide&&(t.currentSlide=t.currentSlide-t.options.slidesToScroll),t.slideCount<=t.options.slidesToShow&&(t.currentSlide=0),t.registerBreakpoints(),t.setProps(),t.setupInfinite(),t.buildArrows(),t.updateArrows(),t.initArrowEvents(),t.buildDots(),t.updateDots(),t.initDotEvents(),t.cleanUpSlideEvents(),t.initSlideEvents(),t.checkResponsive(!1,!0),!0===t.options.focusOnSelect&&e(t.$slideTrack).children().on("click.slick",t.selectHandler),t.setSlideClasses("number"==typeof t.currentSlide?t.currentSlide:0),t.setPosition(),t.focusHandler(),t.paused=!t.options.autoplay,t.autoPlay(),t.$slider.trigger("reInit",[t])},t.prototype.resize=function(){var t=this;e(window).width()!==t.windowWidth&&(clearTimeout(t.windowDelay),t.windowDelay=window.setTimeout((function(){t.windowWidth=e(window).width(),t.checkResponsive(),t.unslicked||t.setPosition()}),50))},t.prototype.removeSlide=t.prototype.slickRemove=function(e,t,n){var i=this;if(e="boolean"==typeof e?!0===(t=e)?0:i.slideCount-1:!0===t?--e:e,i.slideCount<1||e<0||e>i.slideCount-1)return!1;i.unload(),!0===n?i.$slideTrack.children().remove():i.$slideTrack.children(this.options.slide).eq(e).remove(),i.$slides=i.$slideTrack.children(this.options.slide),i.$slideTrack.children(this.options.slide).detach(),i.$slideTrack.append(i.$slides),i.$slidesCache=i.$slides,i.reinit()},t.prototype.setCSS=function(e){var t,n,i=this,r={};!0===i.options.rtl&&(e=-e),t="left"==i.positionProp?Math.ceil(e)+"px":"0px",n="top"==i.positionProp?Math.ceil(e)+"px":"0px",r[i.positionProp]=e,!1===i.transformsEnabled?i.$slideTrack.css(r):(r={},!1===i.cssTransitions?(r[i.animType]="translate("+t+", "+n+")",i.$slideTrack.css(r)):(r[i.animType]="translate3d("+t+", "+n+", 0px)",i.$slideTrack.css(r)))},t.prototype.setDimensions=function(){var e=this;!1===e.options.vertical?!0===e.options.centerMode&&e.$list.css({padding:"0px "+e.options.centerPadding}):(e.$list.height(e.$slides.first().outerHeight(!0)*e.options.slidesToShow),!0===e.options.centerMode&&e.$list.css({padding:e.options.centerPadding+" 0px"})),e.listWidth=e.$list.width(),e.listHeight=e.$list.height(),!1===e.options.vertical&&!1===e.options.variableWidth?(e.slideWidth=Math.ceil(e.listWidth/e.options.slidesToShow),e.$slideTrack.width(Math.ceil(e.slideWidth*e.$slideTrack.children(".slick-slide").length))):!0===e.options.variableWidth?e.$slideTrack.width(5e3*e.slideCount):(e.slideWidth=Math.ceil(e.listWidth),e.$slideTrack.height(Math.ceil(e.$slides.first().outerHeight(!0)*e.$slideTrack.children(".slick-slide").length)));var t=e.$slides.first().outerWidth(!0)-e.$slides.first().width();!1===e.options.variableWidth&&e.$slideTrack.children(".slick-slide").width(e.slideWidth-t)},t.prototype.setFade=function(){var t,n=this;n.$slides.each((function(i,r){t=n.slideWidth*i*-1,!0===n.options.rtl?e(r).css({position:"relative",right:t,top:0,zIndex:n.options.zIndex-2,opacity:0}):e(r).css({position:"relative",left:t,top:0,zIndex:n.options.zIndex-2,opacity:0})})),n.$slides.eq(n.currentSlide).css({zIndex:n.options.zIndex-1,opacity:1})},t.prototype.setHeight=function(){var e=this;if(1===e.options.slidesToShow&&!0===e.options.adaptiveHeight&&!1===e.options.vertical){var t=e.$slides.eq(e.currentSlide).outerHeight(!0);e.$list.css("height",t)}},t.prototype.setOption=t.prototype.slickSetOption=function(){var t,n,i,r,a,o=this,s=!1;if("object"===e.type(arguments[0])?(i=arguments[0],s=arguments[1],a="multiple"):"string"===e.type(arguments[0])&&(i=arguments[0],r=arguments[1],s=arguments[2],"responsive"===arguments[0]&&"array"===e.type(arguments[1])?a="responsive":void 0!==arguments[1]&&(a="single")),"single"===a)o.options[i]=r;else if("multiple"===a)e.each(i,(function(e,t){o.options[e]=t}));else if("responsive"===a)for(n in r)if("array"!==e.type(o.options.responsive))o.options.responsive=[r[n]];else{for(t=o.options.responsive.length-1;t>=0;)o.options.responsive[t].breakpoint===r[n].breakpoint&&o.options.responsive.splice(t,1),t--;o.options.responsive.push(r[n])}s&&(o.unload(),o.reinit())},t.prototype.setPosition=function(){var e=this;e.setDimensions(),e.setHeight(),!1===e.options.fade?e.setCSS(e.getLeft(e.currentSlide)):e.setFade(),e.$slider.trigger("setPosition",[e])},t.prototype.setProps=function(){var e=this,t=document.body.style;e.positionProp=!0===e.options.vertical?"top":"left","top"===e.positionProp?e.$slider.addClass("slick-vertical"):e.$slider.removeClass("slick-vertical"),void 0===t.WebkitTransition&&void 0===t.MozTransition&&void 0===t.msTransition||!0===e.options.useCSS&&(e.cssTransitions=!0),e.options.fade&&("number"==typeof e.options.zIndex?e.options.zIndex<3&&(e.options.zIndex=3):e.options.zIndex=e.defaults.zIndex),void 0!==t.OTransform&&(e.animType="OTransform",e.transformType="-o-transform",e.transitionType="OTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.MozTransform&&(e.animType="MozTransform",e.transformType="-moz-transform",e.transitionType="MozTransition",void 0===t.perspectiveProperty&&void 0===t.MozPerspective&&(e.animType=!1)),void 0!==t.webkitTransform&&(e.animType="webkitTransform",e.transformType="-webkit-transform",e.transitionType="webkitTransition",void 0===t.perspectiveProperty&&void 0===t.webkitPerspective&&(e.animType=!1)),void 0!==t.msTransform&&(e.animType="msTransform",e.transformType="-ms-transform",e.transitionType="msTransition",void 0===t.msTransform&&(e.animType=!1)),void 0!==t.transform&&!1!==e.animType&&(e.animType="transform",e.transformType="transform",e.transitionType="transition"),e.transformsEnabled=e.options.useTransform&&null!==e.animType&&!1!==e.animType},t.prototype.setSlideClasses=function(e){var t,n,i,r,a=this;if(n=a.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),a.$slides.eq(e).addClass("slick-current"),!0===a.options.centerMode){var o=a.options.slidesToShow%2==0?1:0;t=Math.floor(a.options.slidesToShow/2),!0===a.options.infinite&&(e>=t&&e<=a.slideCount-1-t?a.$slides.slice(e-t+o,e+t+1).addClass("slick-active").attr("aria-hidden","false"):(i=a.options.slidesToShow+e,n.slice(i-t+1+o,i+t+2).addClass("slick-active").attr("aria-hidden","false")),0===e?n.eq(n.length-1-a.options.slidesToShow).addClass("slick-center"):e===a.slideCount-1&&n.eq(a.options.slidesToShow).addClass("slick-center")),a.$slides.eq(e).addClass("slick-center")}else e>=0&&e<=a.slideCount-a.options.slidesToShow?a.$slides.slice(e,e+a.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):n.length<=a.options.slidesToShow?n.addClass("slick-active").attr("aria-hidden","false"):(r=a.slideCount%a.options.slidesToShow,i=!0===a.options.infinite?a.options.slidesToShow+e:e,a.options.slidesToShow==a.options.slidesToScroll&&a.slideCount-e<a.options.slidesToShow?n.slice(i-(a.options.slidesToShow-r),i+r).addClass("slick-active").attr("aria-hidden","false"):n.slice(i,i+a.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==a.options.lazyLoad&&"anticipated"!==a.options.lazyLoad||a.lazyLoad()},t.prototype.setupInfinite=function(){var t,n,i,r=this;if(!0===r.options.fade&&(r.options.centerMode=!1),!0===r.options.infinite&&!1===r.options.fade&&(n=null,r.slideCount>r.options.slidesToShow)){for(i=!0===r.options.centerMode?r.options.slidesToShow+1:r.options.slidesToShow,t=r.slideCount;t>r.slideCount-i;t-=1)n=t-1,e(r.$slides[n]).clone(!0).attr("id","").attr("data-slick-index",n-r.slideCount).prependTo(r.$slideTrack).addClass("slick-cloned");for(t=0;t<i+r.slideCount;t+=1)n=t,e(r.$slides[n]).clone(!0).attr("id","").attr("data-slick-index",n+r.slideCount).appendTo(r.$slideTrack).addClass("slick-cloned");r.$slideTrack.find(".slick-cloned").find("[id]").each((function(){e(this).attr("id","")}))}},t.prototype.interrupt=function(e){var t=this;e||t.autoPlay(),t.interrupted=e},t.prototype.selectHandler=function(t){var n=this,i=e(t.target).is(".slick-slide")?e(t.target):e(t.target).parents(".slick-slide"),r=parseInt(i.attr("data-slick-index"));r||(r=0),
n.slideCount<=n.options.slidesToShow?n.slideHandler(r,!1,!0):n.slideHandler(r)},t.prototype.slideHandler=function(e,t,n){var i,r,a,o,s,l=null,d=this;if(t=t||!1,!(!0===d.animating&&!0===d.options.waitForAnimate||!0===d.options.fade&&d.currentSlide===e))if(!1===t&&d.asNavFor(e),i=e,l=d.getLeft(i),o=d.getLeft(d.currentSlide),d.currentLeft=null===d.swipeLeft?o:d.swipeLeft,!1===d.options.infinite&&!1===d.options.centerMode&&(e<0||e>d.getDotCount()*d.options.slidesToScroll))!1===d.options.fade&&(i=d.currentSlide,!0!==n?d.animateSlide(o,(function(){d.postSlide(i)})):d.postSlide(i));else if(!1===d.options.infinite&&!0===d.options.centerMode&&(e<0||e>d.slideCount-d.options.slidesToScroll))!1===d.options.fade&&(i=d.currentSlide,!0!==n?d.animateSlide(o,(function(){d.postSlide(i)})):d.postSlide(i));else{if(d.options.autoplay&&clearInterval(d.autoPlayTimer),r=i<0?d.slideCount%d.options.slidesToScroll!=0?d.slideCount-d.slideCount%d.options.slidesToScroll:d.slideCount+i:i>=d.slideCount?d.slideCount%d.options.slidesToScroll!=0?0:i-d.slideCount:i,d.animating=!0,d.$slider.trigger("beforeChange",[d,d.currentSlide,r]),a=d.currentSlide,d.currentSlide=r,d.setSlideClasses(d.currentSlide),d.options.asNavFor&&(s=(s=d.getNavTarget()).slick("getSlick")).slideCount<=s.options.slidesToShow&&s.setSlideClasses(d.currentSlide),d.updateDots(),d.updateArrows(),!0===d.options.fade)return!0!==n?(d.fadeSlideOut(a),d.fadeSlide(r,(function(){d.postSlide(r)}))):d.postSlide(r),void d.animateHeight();!0!==n?d.animateSlide(l,(function(){d.postSlide(r)})):d.postSlide(r)}},t.prototype.startLoad=function(){var e=this;!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow.hide(),e.$nextArrow.hide()),!0===e.options.dots&&e.slideCount>e.options.slidesToShow&&e.$dots.hide(),e.$slider.addClass("slick-loading")},t.prototype.swipeDirection=function(){var e,t,n,i,r=this;return e=r.touchObject.startX-r.touchObject.curX,t=r.touchObject.startY-r.touchObject.curY,n=Math.atan2(t,e),(i=Math.round(180*n/Math.PI))<0&&(i=360-Math.abs(i)),i<=45&&i>=0||i<=360&&i>=315?!1===r.options.rtl?"left":"right":i>=135&&i<=225?!1===r.options.rtl?"right":"left":!0===r.options.verticalSwiping?i>=35&&i<=135?"down":"up":"vertical"},t.prototype.swipeEnd=function(){var e,t,n=this;if(n.dragging=!1,n.swiping=!1,n.scrolling)return n.scrolling=!1,!1;if(n.interrupted=!1,n.shouldClick=!(n.touchObject.swipeLength>10),void 0===n.touchObject.curX)return!1;if(!0===n.touchObject.edgeHit&&n.$slider.trigger("edge",[n,n.swipeDirection()]),n.touchObject.swipeLength>=n.touchObject.minSwipe){switch(t=n.swipeDirection()){case"left":case"down":e=n.options.swipeToSlide?n.checkNavigable(n.currentSlide+n.getSlideCount()):n.currentSlide+n.getSlideCount(),n.currentDirection=0;break;case"right":case"up":e=n.options.swipeToSlide?n.checkNavigable(n.currentSlide-n.getSlideCount()):n.currentSlide-n.getSlideCount(),n.currentDirection=1}"vertical"!=t&&(n.slideHandler(e),n.touchObject={},n.$slider.trigger("swipe",[n,t]))}else n.touchObject.startX!==n.touchObject.curX&&(n.slideHandler(n.currentSlide),n.touchObject={})},t.prototype.swipeHandler=function(e){var t=this;if(!(!1===t.options.swipe||"ontouchend"in document&&!1===t.options.swipe||!1===t.options.draggable&&-1!==e.type.indexOf("mouse")))switch(t.touchObject.fingerCount=e.originalEvent&&void 0!==e.originalEvent.touches?e.originalEvent.touches.length:1,t.touchObject.minSwipe=t.listWidth/t.options.touchThreshold,!0===t.options.verticalSwiping&&(t.touchObject.minSwipe=t.listHeight/t.options.touchThreshold),e.data.action){case"start":t.swipeStart(e);break;case"move":t.swipeMove(e);break;case"end":t.swipeEnd(e)}},t.prototype.swipeMove=function(e){var t,n,i,r,a,o,s=this;return a=void 0!==e.originalEvent?e.originalEvent.touches:null,!(!s.dragging||s.scrolling||a&&1!==a.length)&&(t=s.getLeft(s.currentSlide),s.touchObject.curX=void 0!==a?a[0].pageX:e.clientX,s.touchObject.curY=void 0!==a?a[0].pageY:e.clientY,s.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(s.touchObject.curX-s.touchObject.startX,2))),o=Math.round(Math.sqrt(Math.pow(s.touchObject.curY-s.touchObject.startY,2))),!s.options.verticalSwiping&&!s.swiping&&o>4?(s.scrolling=!0,!1):(!0===s.options.verticalSwiping&&(s.touchObject.swipeLength=o),n=s.swipeDirection(),void 0!==e.originalEvent&&s.touchObject.swipeLength>4&&(s.swiping=!0,e.preventDefault()),r=(!1===s.options.rtl?1:-1)*(s.touchObject.curX>s.touchObject.startX?1:-1),!0===s.options.verticalSwiping&&(r=s.touchObject.curY>s.touchObject.startY?1:-1),i=s.touchObject.swipeLength,s.touchObject.edgeHit=!1,!1===s.options.infinite&&(0===s.currentSlide&&"right"===n||s.currentSlide>=s.getDotCount()&&"left"===n)&&(i=s.touchObject.swipeLength*s.options.edgeFriction,s.touchObject.edgeHit=!0),!1===s.options.vertical?s.swipeLeft=t+i*r:s.swipeLeft=t+i*(s.$list.height()/s.listWidth)*r,!0===s.options.verticalSwiping&&(s.swipeLeft=t+i*r),!0!==s.options.fade&&!1!==s.options.touchMove&&(!0===s.animating?(s.swipeLeft=null,!1):void s.setCSS(s.swipeLeft))))},t.prototype.swipeStart=function(e){var t,n=this;if(n.interrupted=!0,1!==n.touchObject.fingerCount||n.slideCount<=n.options.slidesToShow)return n.touchObject={},!1;void 0!==e.originalEvent&&void 0!==e.originalEvent.touches&&(t=e.originalEvent.touches[0]),n.touchObject.startX=n.touchObject.curX=void 0!==t?t.pageX:e.clientX,n.touchObject.startY=n.touchObject.curY=void 0!==t?t.pageY:e.clientY,n.dragging=!0},t.prototype.unfilterSlides=t.prototype.slickUnfilter=function(){var e=this;null!==e.$slidesCache&&(e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.appendTo(e.$slideTrack),e.reinit())},t.prototype.unload=function(){var t=this;e(".slick-cloned",t.$slider).remove(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove(),t.$nextArrow&&t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove(),t.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},t.prototype.unslick=function(e){var t=this;t.$slider.trigger("unslick",[t,e]),t.destroy()},t.prototype.updateArrows=function(){var e=this;Math.floor(e.options.slidesToShow/2),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===e.currentSlide?(e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):(e.currentSlide>=e.slideCount-e.options.slidesToShow&&!1===e.options.centerMode||e.currentSlide>=e.slideCount-1&&!0===e.options.centerMode)&&(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},t.prototype.updateDots=function(){var e=this;null!==e.$dots&&(e.$dots.find("li").removeClass("slick-active").end(),e.$dots.find("li").eq(Math.floor(e.currentSlide/e.options.slidesToScroll)).addClass("slick-active"))},t.prototype.visibility=function(){var e=this;e.options.autoplay&&(document[e.hidden]?e.interrupted=!0:e.interrupted=!1)},e.fn.slick=function(){var e,n,i=this,r=arguments[0],a=Array.prototype.slice.call(arguments,1),o=i.length;for(e=0;e<o;e++)if("object"==typeof r||void 0===r?i[e].slick=new t(i[e],r):n=i[e].slick[r].apply(i[e].slick,a),void 0!==n)return n;return i}})),
/*! jQuery UI - v1.11.4+CommonJS - 2015-08-28
* http://jqueryui.com
* Includes: widget.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}((function(e){
/*!
 * jQuery UI Widget 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/jQuery.widget/
 */
var t,n=0,i=Array.prototype.slice;e.cleanData=(t=e.cleanData,function(n){var i,r,a;for(a=0;null!=(r=n[a]);a++)try{(i=e._data(r,"events"))&&i.remove&&e(r).triggerHandler("remove")}catch(e){}t(n)}),e.widget=function(t,n,i){var r,a,o,s,l={},d=t.split(".")[0];return t=t.split(".")[1],r=d+"-"+t,i||(i=n,n=e.Widget),e.expr[":"][r.toLowerCase()]=function(t){return!!e.data(t,r)},e[d]=e[d]||{},a=e[d][t],o=e[d][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)},e.extend(o,a,{version:i.version,_proto:e.extend({},i),_childConstructors:[]}),(s=new n).options=e.widget.extend({},s.options),e.each(i,(function(t,i){var r,a;e.isFunction(i)?l[t]=(r=function(){return n.prototype[t].apply(this,arguments)},a=function(e){return n.prototype[t].apply(this,e)},function(){var e,t=this._super,n=this._superApply;return this._super=r,this._superApply=a,e=i.apply(this,arguments),this._super=t,this._superApply=n,e}):l[t]=i})),o.prototype=e.widget.extend(s,{widgetEventPrefix:a&&s.widgetEventPrefix||t},l,{constructor:o,namespace:d,widgetName:t,widgetFullName:r}),a?(e.each(a._childConstructors,(function(t,n){var i=n.prototype;e.widget(i.namespace+"."+i.widgetName,o,n._proto)})),delete a._childConstructors):n._childConstructors.push(o),e.widget.bridge(t,o),o},e.widget.extend=function(t){for(var n,r,a=i.call(arguments,1),o=0,s=a.length;o<s;o++)for(n in a[o])r=a[o][n],a[o].hasOwnProperty(n)&&void 0!==r&&(e.isPlainObject(r)?t[n]=e.isPlainObject(t[n])?e.widget.extend({},t[n],r):e.widget.extend({},r):t[n]=r);return t},e.widget.bridge=function(t,n){var r=n.prototype.widgetFullName||t;e.fn[t]=function(a){var o="string"==typeof a,s=i.call(arguments,1),l=this;return o?this.each((function(){var n,i=e.data(this,r);return"instance"===a?(l=i,!1):i?e.isFunction(i[a])&&"_"!==a.charAt(0)?(n=i[a].apply(i,s))!==i&&void 0!==n?(l=n&&n.jquery?l.pushStack(n.get()):n,!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+"'")})):(s.length&&(a=e.widget.extend.apply(null,[a].concat(s))),this.each((function(){var t=e.data(this,r);t?(t.option(a||{}),t._init&&t._init()):e.data(this,r,new n(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,i){i=e(i||this.defaultElement||this)[0],this.element=e(i),this.uuid=n++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=e(),this.hoverable=e(),this.focusable=e(),i!==this&&(e.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===i&&this.destroy()}}),this.document=e(i.style?i.ownerDocument:i.document||i),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),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.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,n){var i,r,a,o=t;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof t)if(o={},i=t.split("."),t=i.shift(),i.length){for(r=o[t]=e.widget.extend({},this.options[t]),a=0;a<i.length-1;a++)r[i[a]]=r[i[a]]||{},r=r[i[a]];if(t=i.pop(),1===arguments.length)return void 0===r[t]?null:r[t];r[t]=n}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=n}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",!!t),t&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus"))),this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,n,i){var r,a=this;"boolean"!=typeof t&&(i=n,n=t,t=!1),i?(n=r=e(n),this.bindings=this.bindings.add(n)):(i=n,n=this.element,r=this.widget()),e.each(i,(function(i,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=i.match(/^([\w:-]*)\s*(.*)$/),d=l[1]+a.eventNamespace,c=l[2];c?r.delegate(c,d,s):n.bind(d,s)}))},_off:function(t,n){n=(n||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(n).undelegate(n),this.bindings=e(this.bindings.not(t).get()),this.focusable=e(this.focusable.not(t).get()),this.hoverable=e(this.hoverable.not(t).get())},_delay:function(e,t){function n(){return("string"==typeof e?i[e]:e).apply(i,arguments)}var i=this;return setTimeout(n,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,n,i){var r,a,o=this.options[t];if(i=i||{},(n=e.Event(n)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],a=n.originalEvent)for(r in a)r in n||(n[r]=a[r]);return this.element.trigger(n,i),!(e.isFunction(o)&&!1===o.apply(this.element[0],[n].concat(i))||n.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},(function(t,n){e.Widget.prototype["_"+t]=function(i,r,a){"string"==typeof r&&(r={effect:r});var o,s=r?!0===r||"number"==typeof r?n:r.effect||n:t;"number"==typeof(r=r||{})&&(r={duration:r}),o=!e.isEmptyObject(r),r.complete=a,r.delay&&i.delay(r.delay),o&&e.effects&&e.effects.effect[s]?i[t](r):s!==t&&i[s]?i[s](r.duration,r.easing,a):i.queue((function(n){e(this)[t](),a&&a.call(i[0]),n()}))}}));e.widget})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";var t=0,n=e,i="parseJSON";"JSON"in window&&"parse"in JSON&&(n=JSON,i="parse"),e.ajaxTransport("iframe",(function(n){if(n.async){var i,r,a,o=n.initialIframeSrc||"javascript:false;";return{send:function(s,l){(i=e('<form style="display:none;"></form>')).attr("accept-charset",n.formAcceptCharset),a=/\?/.test(n.url)?"&":"?","DELETE"===n.type?(n.url=n.url+a+"_method=DELETE",n.type="POST"):"PUT"===n.type?(n.url=n.url+a+"_method=PUT",n.type="POST"):"PATCH"===n.type&&(n.url=n.url+a+"_method=PATCH",n.type="POST"),r=e('<iframe src="'+o+'" name="iframe-transport-'+(t+=1)+'"></iframe>').bind("load",(function(){var t,a=e.isArray(n.paramName)?n.paramName:[n.paramName];r.unbind("load").bind("load",(function(){var t;try{if(!(t=r.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('<iframe src="'+o+'"></iframe>').appendTo(i),window.setTimeout((function(){i.remove()}),0)})),i.prop("target",r.prop("name")).prop("action",n.url).prop("method",n.type),n.formData&&e.each(n.formData,(function(t,n){e('<input type="hidden"/>').prop("name",n.name).val(n.value).appendTo(i)})),n.fileInput&&n.fileInput.length&&"POST"===n.type&&(t=n.fileInput.clone(),n.fileInput.after((function(e){return t[e]})),n.paramName&&n.fileInput.each((function(t){e(this).prop("name",a[t]||n.paramName)})),i.append(n.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),n.fileInput.removeAttr("form")),i.submit(),t&&t.length&&n.fileInput.each((function(n,i){var r=e(t[n]);e(i).prop("name",r.prop("name")).attr("form",r.attr("form")),r.replaceWith(i)}))})),i.append(r).appendTo(document.body)},abort:function(){r&&r.unbind("load").prop("src",o),i&&i.remove()}}}})),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&n[i](e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var n=t&&t[0];return n&&e.isXMLDoc(n)?n:e.parseXML(n.XMLDocument&&n.XMLDocument.xml||e(n.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/ui/widget"],e):"object"==typeof exports?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}((function(e){"use strict";function t(t){var n="dragover"===t;return function(i){i.dataTransfer=i.originalEvent&&i.originalEvent.dataTransfer;var r=i.dataTransfer;r&&-1!==e.inArray("Files",r.types)&&!1!==this._trigger(t,e.Event(t,{delegatedEvent:i}))&&(i.preventDefault(),n&&(r.dropEffect="copy"))}}e.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||e('<input type="file">').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,n){return t=this.messages[t]||t.toString(),n&&e.each(n,(function(e,n){t=t.replace("{"+e+"}",n)})),t},formData:function(e){return e.serializeArray()},add:function(t,n){if(t.isDefaultPrevented())return!1;(n.autoUpload||!1!==n.autoUpload&&e(this).fileupload("option","autoUpload"))&&n.process().done((function(){n.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,n){var i=e-this.timestamp;return(!this.bitrate||!n||i>n)&&(this.bitrate=(t-this.loaded)*(1e3/i)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var n;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(n=[],e.each(t.formData,(function(e,t){n.push({name:e,value:t})})),n):[]},_getTotal:function(t){var n=0;return e.each(t,(function(e,t){n+=t.size||1})),n},_initProgressObject:function(t){var n={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,n):t._progress=n},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)e._response.hasOwnProperty(t)&&delete e._response[t];else e._response={}},_onProgress:function(t,n){if(t.lengthComputable){var i,r=Date.now?Date.now():(new Date).getTime();if(n._time&&n.progressInterval&&r-n._time<n.progressInterval&&t.loaded!==t.total)return;n._time=r,i=Math.floor(t.loaded/t.total*(n.chunkSize||n._progress.total))+(n.uploadedBytes||0),this._progress.loaded+=i-n._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(r,this._progress.loaded,n.bitrateInterval),n._progress.loaded=n.loaded=i,n._progress.bitrate=n.bitrate=n._bitrateTimer.getBitrate(r,i,n.bitrateInterval),this._trigger("progress",e.Event("progress",{delegatedEvent:t}),n),this._trigger("progressall",e.Event("progressall",{delegatedEvent:t}),this._progress)}},_initProgressListener:function(t){var n=this,i=t.xhr?t.xhr():e.ajaxSettings.xhr();i.upload&&(e(i.upload).bind("progress",(function(e){var i=e.originalEvent;e.lengthComputable=i.lengthComputable,e.loaded=i.loaded,e.total=i.total,n._onProgress(e,t)})),t.xhr=function(){return i})},_isInstanceOf:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},_initXHRData:function(t){var n,i=this,r=t.files[0],a=t.multipart||!e.support.xhrFileUpload,o="array"===e.type(t.paramName)?t.paramName[0]:t.paramName;t.headers=e.extend({},t.headers),t.contentRange&&(t.headers["Content-Range"]=t.contentRange),a&&!t.blob&&this._isInstanceOf("File",r)||(t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(r.name)+'"'),a?e.support.xhrFormDataFileUpload&&(t.postMessage?(n=this._getFormData(t),t.blob?n.push({name:o,value:t.blob}):e.each(t.files,(function(i,r){n.push({name:"array"===e.type(t.paramName)&&t.paramName[i]||o,value:r})}))):(i._isInstanceOf("FormData",t.formData)?n=t.formData:(n=new FormData,e.each(this._getFormData(t),(function(e,t){n.append(t.name,t.value)}))),t.blob?n.append(o,t.blob,r.name):e.each(t.files,(function(r,a){(i._isInstanceOf("File",a)||i._isInstanceOf("Blob",a))&&n.append("array"===e.type(t.paramName)&&t.paramName[r]||o,a,a.uploadName||a.name)}))),t.data=n):(t.contentType=r.type||"application/octet-stream",t.data=t.blob||r),t.blob=null},_initIframeSettings:function(t){var n=e("<a></a>").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&n&&n!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var n=e(t.fileInput),i=t.paramName;return i?e.isArray(i)||(i=[i]):(i=[],n.each((function(){for(var t=e(this),n=t.prop("name")||"files[]",r=(t.prop("files")||[1]).length;r;)i.push(n),r-=1})),i.length||(i=[n.prop("name")||"files[]"])),i},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var n=e.extend({},this.options,t);return this._initFormSettings(n),this._initDataSettings(n),n},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,n,i){var r=e.Deferred(),a=r.promise();return n=n||this.options.context||a,!0===t?r.resolveWith(n,i):!1===t&&r.rejectWith(n,i),a.abort=r.promise,this._enhancePromise(a)},_addConvenienceMethods:function(t,n){var i=this,r=function(t){return e.Deferred().resolveWith(i,t).promise()};n.process=function(t,a){return(t||a)&&(n._processQueue=this._processQueue=(this._processQueue||r([this])).then((function(){return n.errorThrown?e.Deferred().rejectWith(i,[n]).promise():r(arguments)})).then(t,a)),this._processQueue||r([this])},n.submit=function(){return"pending"!==this.state()&&(n.jqXHR=this.jqXHR=!1!==i._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&i._onSend(t,this)),this.jqXHR||i._getXHRPromise()},n.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",i._trigger("fail",null,this),i._getXHRPromise(!1))},n.state=function(){return this.jqXHR?i._getDeferredState(this.jqXHR):this._processQueue?i._getDeferredState(this._processQueue):void 0},n.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===i._getDeferredState(this._processQueue)},n.progress=function(){return this._progress},n.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),n=t&&t.split("-"),i=n&&n.length>1&&parseInt(n[1],10);return i&&i+1},_chunkedUpload:function(t,n){t.uploadedBytes=t.uploadedBytes||0;var i,r,a=this,o=t.files[0],s=o.size,l=t.uploadedBytes,d=t.maxChunkSize||s,c=this._blobSlice,u=e.Deferred(),f=u.promise();return!(!(this._isXHRUpload(t)&&c&&(l||("function"===e.type(d)?d(t):d)<s))||t.data)&&(!!n||(l>=s?(o.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",o.error])):(r=function(){var n=e.extend({},t),f=n._progress.loaded;n.blob=c.call(o,l,l+("function"===e.type(d)?d(n):d),o.type),n.chunkSize=n.blob.size,n.contentRange="bytes "+l+"-"+(l+n.chunkSize-1)+"/"+s,a._initXHRData(n),a._initProgressListener(n),i=(!1!==a._trigger("chunksend",null,n)&&e.ajax(n)||a._getXHRPromise(!1,n.context)).done((function(i,o,d){l=a._getUploadedBytes(d)||l+n.chunkSize,f+n.chunkSize-n._progress.loaded&&a._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-n.uploadedBytes,total:l-n.uploadedBytes}),n),t.uploadedBytes=n.uploadedBytes=l,n.result=i,n.textStatus=o,n.jqXHR=d,a._trigger("chunkdone",null,n),a._trigger("chunkalways",null,n),l<s?r():u.resolveWith(n.context,[i,o,d])})).fail((function(e,t,i){n.jqXHR=e,n.textStatus=t,n.errorThrown=i,a._trigger("chunkfail",null,n),a._trigger("chunkalways",null,n),u.rejectWith(n.context,[e,t,i])}))},this._enhancePromise(f),f.abort=function(){return i.abort()},r(),f)))},_beforeSend:function(e,t){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0),this._initResponseObject(t),this._initProgressObject(t),t._progress.loaded=t.loaded=t.uploadedBytes||0,t._progress.total=t.total=this._getTotal(t.files)||1,t._progress.bitrate=t.bitrate=0,this._active+=1,this._progress.loaded+=t.loaded,this._progress.total+=t.total},_onDone:function(t,n,i,r){var a=r._progress.total,o=r._response;r._progress.loaded<a&&this._onProgress(e.Event("progress",{lengthComputable:!0,loaded:a,total:a}),r),o.result=r.result=t,o.textStatus=r.textStatus=n,o.jqXHR=r.jqXHR=i,this._trigger("done",null,r)},_onFail:function(e,t,n,i){var r=i._response;i.recalculateProgress&&(this._progress.loaded-=i._progress.loaded,this._progress.total-=i._progress.total),r.jqXHR=i.jqXHR=e,r.textStatus=i.textStatus=t,r.errorThrown=i.errorThrown=n,this._trigger("fail",null,i)},_onAlways:function(e,t,n,i){this._trigger("always",null,i)},_onSend:function(t,n){n.submit||this._addConvenienceMethods(t,n);var i,r,a,o,s=this,l=s._getAJAXSettings(n),d=function(){return s._sending+=1,l._bitrateTimer=new s._BitrateTimer,i=i||((r||!1===s._trigger("send",e.Event("send",{delegatedEvent:t}),l))&&s._getXHRPromise(!1,l.context,r)||s._chunkedUpload(l)||e.ajax(l)).done((function(e,t,n){s._onDone(e,t,n,l)})).fail((function(e,t,n){s._onFail(e,t,n,l)})).always((function(e,t,n){if(s._onAlways(e,t,n,l),s._sending-=1,s._active-=1,l.limitConcurrentUploads&&l.limitConcurrentUploads>s._sending)for(var i=s._slots.shift();i;){if("pending"===s._getDeferredState(i)){i.resolve();break}i=s._slots.shift()}0===s._active&&s._trigger("stop")}))};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(a=e.Deferred(),this._slots.push(a),o=a.then(d)):(this._sequence=this._sequence.then(d,d),o=this._sequence),o.abort=function(){return r=[void 0,"abort","abort"],i?i.abort():(a&&a.rejectWith(l.context,r),d())},this._enhancePromise(o)):d()},_onAdd:function(t,n){var i,r,a,o,s=this,l=!0,d=e.extend({},this.options,n),c=n.files,u=c.length,f=d.limitMultiFileUploads,h=d.limitMultiFileUploadSize,p=d.limitMultiFileUploadSizeOverhead,g=0,m=this._getParamName(d),v=0;if(!u)return!1;if(h&&void 0===c[0].size&&(h=void 0),(d.singleFileUploads||f||h)&&this._isXHRUpload(d))if(d.singleFileUploads||h||!f)if(!d.singleFileUploads&&h)for(a=[],i=[],o=0;o<u;o+=1)g+=c[o].size+p,(o+1===u||g+c[o+1].size+p>h||f&&o+1-v>=f)&&(a.push(c.slice(v,o+1)),(r=m.slice(v,o+1)).length||(r=m),i.push(r),v=o+1,g=0);else i=m;else for(a=[],i=[],o=0;o<u;o+=f)a.push(c.slice(o,o+f)),(r=m.slice(o,o+f)).length||(r=m),i.push(r);else a=[c],i=[m];return n.originalFiles=c,e.each(a||c,(function(r,o){var d=e.extend({},n);return d.files=a?o:[o],d.paramName=i[r],s._initResponseObject(d),s._initProgressObject(d),s._addConvenienceMethods(t,d),l=s._trigger("add",e.Event("add",{delegatedEvent:t}),d)})),l},_replaceFileInput:function(t){var n=t.fileInput,i=n.clone(!0),r=n.is(document.activeElement);t.fileInputClone=i,e("<form></form>").append(i)[0].reset(),n.after(i).detach(),r&&i.focus(),e.cleanData(n.unbind("remove")),this.options.fileInput=this.options.fileInput.map((function(e,t){return t===n[0]?i[0]:t})),n[0]===this.element[0]&&(this.element=i)},_handleFileTreeEntry:function(t,n){var i,r=this,a=e.Deferred(),o=[],s=function(e){e&&!e.entry&&(e.entry=t),a.resolve([e])},l=function(e){r._handleFileTreeEntries(e,n+t.name+"/").done((function(e){a.resolve(e)})).fail(s)},d=function(){i.readEntries((function(e){e.length?(o=o.concat(e),d()):l(o)}),s)};return n=n||"",t.isFile?t._file?(t._file.relativePath=n,a.resolve(t._file)):t.file((function(e){e.relativePath=n,a.resolve(e)}),s):t.isDirectory?(i=t.createReader(),d()):a.resolve([]),a.promise()},_handleFileTreeEntries:function(t,n){var i=this;return e.when.apply(e,e.map(t,(function(e){return i._handleFileTreeEntry(e,n)}))).then((function(){return Array.prototype.concat.apply([],arguments)}))},_getDroppedFiles:function(t){var n=(t=t||{}).items;return n&&n.length&&(n[0].webkitGetAsEntry||n[0].getAsEntry)?this._handleFileTreeEntries(e.map(n,(function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()}))):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var n,i,r=(t=e(t)).prop("webkitEntries")||t.prop("entries");if(r&&r.length)return this._handleFileTreeEntries(r);if((n=e.makeArray(t.prop("files"))).length)void 0===n[0].name&&n[0].fileName&&e.each(n,(function(e,t){t.name=t.fileName,t.size=t.fileSize}));else{if(!(i=t.prop("value")))return e.Deferred().resolve([]).promise();n=[{name:i.replace(/^.*\\/,"")}]}return e.Deferred().resolve(n).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles)).then((function(){return Array.prototype.concat.apply([],arguments)})):this._getSingleFileInputFiles(t)},_onChange:function(t){var n=this,i={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(i.fileInput).always((function(r){i.files=r,n.options.replaceFileInput&&n._replaceFileInput(i),!1!==n._trigger("change",e.Event("change",{delegatedEvent:t}),i)&&n._onAdd(t,i)}))},_onPaste:function(t){var n=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,i={files:[]};n&&n.length&&(e.each(n,(function(e,t){var n=t.getAsFile&&t.getAsFile();n&&i.files.push(n)})),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),i)&&this._onAdd(t,i))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var n=this,i=t.dataTransfer,r={};i&&i.files&&i.files.length&&(t.preventDefault(),this._getDroppedFiles(i).always((function(i){r.files=i,!1!==n._trigger("drop",e.Event("drop",{delegatedEvent:t}),r)&&n._onAdd(t,r)})))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(t,n){var i=-1!==e.inArray(t,this._specialOptions);i&&this._destroyEventHandlers(),this._super(t,n),i&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),n=t.pop();return t.shift(),new RegExp(t.join("/"),n)},_isRegExpOption:function(t,n){return"url"!==t&&"string"===e.type(n)&&/^\/.*\/[igm]{0,3}$/.test(n)},_initDataAttributes:function(){var t=this,n=this.options,i=this.element.data();e.each(this.element[0].attributes,(function(e,r){var a,o=r.name.toLowerCase();/^data-/.test(o)&&(o=o.slice(5).replace(/-[a-z]/g,(function(e){return e.charAt(1).toUpperCase()})),a=i[o],t._isRegExpOption(o,a)&&(a=t._getRegExp(a)),n[o]=a)}))},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var n=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always((function(e){t.files=e,n._onAdd(null,t)})):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var n,i,r=this,a=e.Deferred(),o=a.promise();return o.abort=function(){return i=!0,n?n.abort():(a.reject(null,"abort","abort"),o)},this._getFileInputFiles(t.fileInput).always((function(e){i||(e.length?(t.files=e,(n=r._onSend(null,t)).then((function(e,t,n){a.resolve(e,t,n)}),(function(e,t,n){a.reject(e,t,n)}))):a.reject())})),this._enhancePromise(o)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})})),
/*!
 * JavaScript Cookie v2.0.3
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */
function(e){if("function"==typeof define&&define.amd)define(e);else if("object"==typeof exports)module.exports=e();else{var t=window.Cookies,n=window.Cookies=e();n.noConflict=function(){return window.Cookies=t,n}}}((function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}function t(n){function i(t,r,a){var o;if(arguments.length>1){if("number"==typeof(a=e({path:"/"},i.defaults,a)).expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*a.expires),a.expires=s}try{o=JSON.stringify(r),/^[\{\[]/.test(o)&&(r=o)}catch(e){}return r=(r=encodeURIComponent(String(r))).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[t,"=",r,a.expires&&"; expires="+a.expires.toUTCString(),a.path&&"; path="+a.path,a.domain&&"; domain="+a.domain,a.secure?"; secure":""].join("")}t||(o={});for(var l=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,c=0;c<l.length;c++){var u=l[c].split("="),f=u[0].replace(d,decodeURIComponent),h=u.slice(1).join("=");'"'===h.charAt(0)&&(h=h.slice(1,-1));try{if(h=n&&n(h,f)||h.replace(d,decodeURIComponent),this.json)try{h=JSON.parse(h)}catch(e){}if(t===f){o=h;break}t||(o[f]=h)}catch(e){}}return o}return i.get=i.set=i,i.getJSON=function(){return i.apply({json:!0},[].slice.call(arguments))},i.defaults={},i.remove=function(t,n){i(t,"",e(n,{expires:-1}))},i.withConverter=t,i}return t()})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,(function(){"use strict";function e(){return Ii.apply(null,arguments)}function t(e){Ii=e}function n(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function i(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function r(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(e.hasOwnProperty(t))return!1;return!0}function a(e){return void 0===e}function o(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function s(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function l(e,t){var n,i=[];for(n=0;n<e.length;++n)i.push(t(e[n],n));return i}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function c(e,t){for(var n in t)d(t,n)&&(e[n]=t[n]);return d(t,"toString")&&(e.toString=t.toString),d(t,"valueOf")&&(e.valueOf=t.valueOf),e}function u(e,t,n,i){return St(e,t,n,i,!0).utc()}function f(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function h(e){return null==e._pf&&(e._pf=f()),e._pf}function p(e){if(null==e._isValid){var t=h(e),n=Ai.call(t.parsedDateParts,(function(e){return null!=e})),i=!isNaN(e._d.getTime())&&t.overflow<0&&!t.empty&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||t.meridiem&&n);if(e._strict&&(i=i&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e))return i;e._isValid=i}return e._isValid}function g(e){var t=u(NaN);return null!=e?c(h(t),e):h(t).userInvalidated=!0,t}function m(e,t){var n,i,r;if(a(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),a(t._i)||(e._i=t._i),a(t._f)||(e._f=t._f),a(t._l)||(e._l=t._l),a(t._strict)||(e._strict=t._strict),a(t._tzm)||(e._tzm=t._tzm),a(t._isUTC)||(e._isUTC=t._isUTC),a(t._offset)||(e._offset=t._offset),a(t._pf)||(e._pf=h(t)),a(t._locale)||(e._locale=t._locale),Di.length>0)for(n=0;n<Di.length;n++)a(r=t[i=Di[n]])||(e[i]=r);return e}function v(t){m(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===Ri&&(Ri=!0,e.updateOffset(this),Ri=!1)}function y(e){return e instanceof v||null!=e&&null!=e._isAMomentObject}function _(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function b(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=_(t)),n}function E(e,t,n){var i,r=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),o=0;for(i=0;i<r;i++)(n&&e[i]!==t[i]||!n&&b(e[i])!==b(t[i]))&&o++;return o+a}function w(t){!1===e.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function T(t,n){var i=!0;return c((function(){if(null!=e.deprecationHandler&&e.deprecationHandler(null,t),i){for(var r,a=[],o=0;o<arguments.length;o++){if(r="","object"==typeof arguments[o]){for(var s in r+="\n["+o+"] ",arguments[0])r+=s+": "+arguments[0][s]+", ";r=r.slice(0,-2)}else r=arguments[o];a.push(r)}w(t+"\nArguments: "+Array.prototype.slice.call(a).join("")+"\n"+(new Error).stack),i=!1}return n.apply(this,arguments)}),n)}function S(t,n){null!=e.deprecationHandler&&e.deprecationHandler(t,n),Mi[t]||(w(n),Mi[t]=!0)}function C(e){return e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function k(e){var t,n;for(n in e)C(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function I(e,t){var n,r=c({},e);for(n in t)d(t,n)&&(i(e[n])&&i(t[n])?(r[n]={},c(r[n],e[n]),c(r[n],t[n])):null!=t[n]?r[n]=t[n]:delete r[n]);for(n in e)d(e,n)&&!d(t,n)&&i(e[n])&&(r[n]=c({},r[n]));return r}function A(e){null!=e&&this.set(e)}function x(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return C(i)?i.call(t,n):i}function D(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,(function(e){return e.slice(1)})),this._longDateFormat[e])}function R(){return this._invalidDate}function M(e){return this._ordinal.replace("%d",e)}function N(e,t,n,i){var r=this._relativeTime[n];return C(r)?r(e,t,n,i):r.replace(/%d/i,e)}function O(e,t){var n=this._relativeTime[e>0?"future":"past"];return C(n)?n(t):n.replace(/%s/i,t)}function P(e,t){var n=e.toLowerCase();Bi[n]=Bi[n+"s"]=Bi[t]=e}function L(e){return"string"==typeof e?Bi[e]||Bi[e.toLowerCase()]:void 0}function F(e){var t,n,i={};for(n in e)d(e,n)&&(t=L(n))&&(i[t]=e[n]);return i}function j(e,t){Ui[e]=t}function B(e){var t=[];for(var n in e)t.push({unit:n,priority:Ui[n]});return t.sort((function(e,t){return e.priority-t.priority})),t}function U(e,t,n){var i=""+Math.abs(e),r=t-i.length;return(e>=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}function H(e,t,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),e&&(zi[e]=r),t&&(zi[t[0]]=function(){return U(r.apply(this,arguments),t[1],t[2])}),n&&(zi[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function $(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function q(e){var t,n,i=e.match(Hi);for(t=0,n=i.length;t<n;t++)zi[i[t]]?i[t]=zi[i[t]]:i[t]=$(i[t]);return function(t){var r,a="";for(r=0;r<n;r++)a+=C(i[r])?i[r].call(t,e):i[r];return a}}function z(e,t){return e.isValid()?(t=V(t,e.localeData()),qi[t]=qi[t]||q(t),qi[t](e)):e.localeData().invalidDate()}function V(e,t){function n(e){return t.longDateFormat(e)||e}var i=5;for($i.lastIndex=0;i>=0&&$i.test(e);)e=e.replace($i,n),$i.lastIndex=0,i-=1;return e}function G(e,t,n){lr[e]=C(t)?t:function(e){return e&&n?n:t}}function W(e,t){return d(lr,e)?lr[e](t._strict,t._locale):new RegExp(Y(e))}function Y(e){return K(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,i,r){return t||n||i||r})))}function K(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function X(e,t){var n,i=t;for("string"==typeof e&&(e=[e]),o(t)&&(i=function(e,n){n[t]=b(e)}),n=0;n<e.length;n++)dr[e[n]]=i}function Q(e,t){X(e,(function(e,n,i,r){i._w=i._w||{},t(e,i._w,i,r)}))}function J(e,t,n){null!=t&&d(dr,e)&&dr[e](t,n._a,n,e)}function Z(e){return ee(e)?366:365}function ee(e){return e%4==0&&e%100!=0||e%400==0}function te(){return ee(this.year())}function ne(t,n){return function(i){return null!=i?(re(this,t,i),e.updateOffset(this,n),this):ie(this,t)}}function ie(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function re(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&ee(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),le(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function ae(e){return C(this[e=L(e)])?this[e]():this}function oe(e,t){if("object"==typeof e)for(var n=B(e=F(e)),i=0;i<n.length;i++)this[n[i].unit](e[n[i].unit]);else if(C(this[e=L(e)]))return this[e](t);return this}function se(e,t){return(e%t+t)%t}function le(e,t){if(isNaN(e)||isNaN(t))return NaN;var n=se(t,12);return e+=(t-n)/12,1===n?ee(e)?29:28:31-n%7%2}function de(e,t){return e?n(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Er).test(t)?"format":"standalone"][e.month()]:n(this._months)?this._months:this._months.standalone}function ce(e,t){return e?n(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Er.test(t)?"format":"standalone"][e.month()]:n(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ue(e,t,n){var i,r,a,o=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],i=0;i<12;++i)a=u([2e3,i]),this._shortMonthsParse[i]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[i]=this.months(a,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(r=_r.call(this._shortMonthsParse,o))?r:null:-1!==(r=_r.call(this._longMonthsParse,o))?r:null:"MMM"===t?-1!==(r=_r.call(this._shortMonthsParse,o))||-1!==(r=_r.call(this._longMonthsParse,o))?r:null:-1!==(r=_r.call(this._longMonthsParse,o))||-1!==(r=_r.call(this._shortMonthsParse,o))?r:null}function fe(e,t,n){var i,r,a;if(this._monthsParseExact)return ue.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=u([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(a="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}}function he(e,t){var n;if(!e.isValid())return e;if("string"==typeof t)if(/^\d+$/.test(t))t=b(t);else if(!o(t=e.localeData().monthsParse(t)))return e;return n=Math.min(e.date(),le(e.year(),t)),e._d["set"+(e._isUTC?"UTC":"")+"Month"](t,n),e}function pe(t){return null!=t?(he(this,t),e.updateOffset(this,!0),this):ie(this,"Month")}function ge(){return le(this.year(),this.month())}function me(e){return this._monthsParseExact?(d(this,"_monthsRegex")||ye.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=Sr),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function ve(e){return this._monthsParseExact?(d(this,"_monthsRegex")||ye.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=Cr),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function ye(){function e(e,t){return t.length-e.length}var t,n,i=[],r=[],a=[];for(t=0;t<12;t++)n=u([2e3,t]),i.push(this.monthsShort(n,"")),r.push(this.months(n,"")),a.push(this.months(n,"")),a.push(this.monthsShort(n,""));for(i.sort(e),r.sort(e),a.sort(e),t=0;t<12;t++)i[t]=K(i[t]),r[t]=K(r[t]);for(t=0;t<24;t++)a[t]=K(a[t]);this._monthsRegex=new RegExp("^("+a.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function _e(e,t,n,i,r,a,o){var s=new Date(e,t,n,i,r,a,o);return e<100&&e>=0&&isFinite(s.getFullYear())&&s.setFullYear(e),s}function be(e){var t=new Date(Date.UTC.apply(null,arguments));return e<100&&e>=0&&isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e),t}function Ee(e,t,n){var i=7+t-n;return-((7+be(e,0,i).getUTCDay()-t)%7)+i-1}function we(e,t,n,i,r){var a,o,s=1+7*(t-1)+(7+n-i)%7+Ee(e,i,r);return s<=0?o=Z(a=e-1)+s:s>Z(e)?(a=e+1,o=s-Z(e)):(a=e,o=s),{year:a,dayOfYear:o}}function Te(e,t,n){var i,r,a=Ee(e.year(),t,n),o=Math.floor((e.dayOfYear()-a-1)/7)+1;return o<1?i=o+Se(r=e.year()-1,t,n):o>Se(e.year(),t,n)?(i=o-Se(e.year(),t,n),r=e.year()+1):(r=e.year(),i=o),{week:i,year:r}}function Se(e,t,n){var i=Ee(e,t,n),r=Ee(e+1,t,n);return(Z(e)-i+r)/7}function Ce(e){return Te(e,this._week.dow,this._week.doy).week}function ke(){return this._week.dow}function Ie(){return this._week.doy}function Ae(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")}function xe(e){var t=Te(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")}function De(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}function Re(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Me(e,t){return e?n(this._weekdays)?this._weekdays[e.day()]:this._weekdays[this._weekdays.isFormat.test(t)?"format":"standalone"][e.day()]:n(this._weekdays)?this._weekdays:this._weekdays.standalone}function Ne(e){return e?this._weekdaysShort[e.day()]:this._weekdaysShort}function Oe(e){return e?this._weekdaysMin[e.day()]:this._weekdaysMin}function Pe(e,t,n){var i,r,a,o=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)a=u([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=_r.call(this._weekdaysParse,o))?r:null:"ddd"===t?-1!==(r=_r.call(this._shortWeekdaysParse,o))?r:null:-1!==(r=_r.call(this._minWeekdaysParse,o))?r:null:"dddd"===t?-1!==(r=_r.call(this._weekdaysParse,o))||-1!==(r=_r.call(this._shortWeekdaysParse,o))||-1!==(r=_r.call(this._minWeekdaysParse,o))?r:null:"ddd"===t?-1!==(r=_r.call(this._shortWeekdaysParse,o))||-1!==(r=_r.call(this._weekdaysParse,o))||-1!==(r=_r.call(this._minWeekdaysParse,o))?r:null:-1!==(r=_r.call(this._minWeekdaysParse,o))||-1!==(r=_r.call(this._weekdaysParse,o))||-1!==(r=_r.call(this._shortWeekdaysParse,o))?r:null}function Le(e,t,n){var i,r,a;if(this._weekdaysParseExact)return Pe.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=u([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(a="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}}function Fe(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=De(e,this.localeData()),this.add(e-t,"d")):t}function je(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")}function Be(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=Re(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7}function Ue(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Dr),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function He(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Rr),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function $e(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||qe.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Mr),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function qe(){function e(e,t){return t.length-e.length}var t,n,i,r,a,o=[],s=[],l=[],d=[];for(t=0;t<7;t++)n=u([2e3,1]).day(t),i=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),a=this.weekdays(n,""),o.push(i),s.push(r),l.push(a),d.push(i),d.push(r),d.push(a);for(o.sort(e),s.sort(e),l.sort(e),d.sort(e),t=0;t<7;t++)s[t]=K(s[t]),l[t]=K(l[t]),d[t]=K(d[t]);this._weekdaysRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+o.join("|")+")","i")}function ze(){return this.hours()%12||12}function Ve(){return this.hours()||24}function Ge(e,t){H(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function We(e,t){return t._meridiemParse}function Ye(e){return"p"===(e+"").toLowerCase().charAt(0)}function Ke(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"}function Xe(e){return e?e.toLowerCase().replace("_","-"):e}function Qe(e){for(var t,n,i,r,a=0;a<e.length;){for(t=(r=Xe(e[a]).split("-")).length,n=(n=Xe(e[a+1]))?n.split("-"):null;t>0;){if(i=Je(r.slice(0,t).join("-")))return i;if(n&&n.length>=t&&E(r,n,!0)>=t-1)break;t--}a++}return Nr}function Je(e){var t=null;if(!Fr[e]&&"undefined"!=typeof module&&module&&module.exports)try{t=Nr._abbr,require("./locale/"+e),Ze(t)}catch(e){}return Fr[e]}function Ze(e,t){var n;return e&&((n=a(t)?nt(e):et(e,t))?Nr=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),Nr._abbr}function et(e,t){if(null!==t){var n,i=Lr;if(t.abbr=e,null!=Fr[e])S("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=Fr[e]._config;else if(null!=t.parentLocale)if(null!=Fr[t.parentLocale])i=Fr[t.parentLocale]._config;else{if(null==(n=Je(t.parentLocale)))return jr[t.parentLocale]||(jr[t.parentLocale]=[]),jr[t.parentLocale].push({name:e,config:t}),null;i=n._config}return Fr[e]=new A(I(i,t)),jr[e]&&jr[e].forEach((function(e){et(e.name,e.config)})),Ze(e),Fr[e]}return delete Fr[e],null}function tt(e,t){if(null!=t){var n,i,r=Lr;null!=(i=Je(e))&&(r=i._config),(n=new A(t=I(r,t))).parentLocale=Fr[e],Fr[e]=n,Ze(e)}else null!=Fr[e]&&(null!=Fr[e].parentLocale?Fr[e]=Fr[e].parentLocale:null!=Fr[e]&&delete Fr[e]);return Fr[e]}function nt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return Nr;if(!n(e)){if(t=Je(e))return t;e=[e]}return Qe(e)}function it(){return xi(Fr)}function rt(e){var t,n=e._a;return n&&-2===h(e).overflow&&(t=n[ur]<0||n[ur]>11?ur:n[fr]<1||n[fr]>le(n[cr],n[ur])?fr:n[hr]<0||n[hr]>24||24===n[hr]&&(0!==n[pr]||0!==n[gr]||0!==n[mr])?hr:n[pr]<0||n[pr]>59?pr:n[gr]<0||n[gr]>59?gr:n[mr]<0||n[mr]>999?mr:-1,h(e)._overflowDayOfYear&&(t<cr||t>fr)&&(t=fr),h(e)._overflowWeeks&&-1===t&&(t=vr),h(e)._overflowWeekday&&-1===t&&(t=yr),h(e).overflow=t),e}function at(e,t,n){return null!=e?e:null!=t?t:n}function ot(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function st(e){var t,n,i,r,a,o=[];if(!e._d){for(i=ot(e),e._w&&null==e._a[fr]&&null==e._a[ur]&&lt(e),null!=e._dayOfYear&&(a=at(e._a[cr],i[cr]),(e._dayOfYear>Z(a)||0===e._dayOfYear)&&(h(e)._overflowDayOfYear=!0),n=be(a,0,e._dayOfYear),e._a[ur]=n.getUTCMonth(),e._a[fr]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=i[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[hr]&&0===e._a[pr]&&0===e._a[gr]&&0===e._a[mr]&&(e._nextDay=!0,e._a[hr]=0),e._d=(e._useUTC?be:_e).apply(null,o),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[hr]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(h(e).weekdayMismatch=!0)}}function lt(e){var t,n,i,r,a,o,s,l;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)a=1,o=4,n=at(t.GG,e._a[cr],Te(Ct(),1,4).year),i=at(t.W,1),((r=at(t.E,1))<1||r>7)&&(l=!0);else{a=e._locale._week.dow,o=e._locale._week.doy;var d=Te(Ct(),a,o);n=at(t.gg,e._a[cr],d.year),i=at(t.w,d.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+a,(t.e<0||t.e>6)&&(l=!0)):r=a}i<1||i>Se(n,a,o)?h(e)._overflowWeeks=!0:null!=l?h(e)._overflowWeekday=!0:(s=we(n,i,r,a,o),e._a[cr]=s.year,e._dayOfYear=s.dayOfYear)}function dt(e){var t,n,i,r,a,o,s=e._i,l=Br.exec(s)||Ur.exec(s);if(l){for(h(e).iso=!0,t=0,n=$r.length;t<n;t++)if($r[t][1].exec(l[1])){r=$r[t][0],i=!1!==$r[t][2];break}if(null==r)return void(e._isValid=!1);if(l[3]){for(t=0,n=qr.length;t<n;t++)if(qr[t][1].exec(l[3])){a=(l[2]||" ")+qr[t][0];break}if(null==a)return void(e._isValid=!1)}if(!i&&null!=a)return void(e._isValid=!1);if(l[4]){if(!Hr.exec(l[4]))return void(e._isValid=!1);o="Z"}e._f=r+(a||"")+(o||""),vt(e)}else e._isValid=!1}function ct(e,t,n,i,r,a){var o=[ut(e),Tr.indexOf(t),parseInt(n,10),parseInt(i,10),parseInt(r,10)];return a&&o.push(parseInt(a,10)),o}function ut(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function ft(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function ht(e,t,n){if(e&&Ar.indexOf(e)!==new Date(t[0],t[1],t[2]).getDay())return h(n).weekdayMismatch=!0,n._isValid=!1,!1;return!0}function pt(e,t,n){if(e)return Gr[e];if(t)return 0;var i=parseInt(n,10),r=i%100;return 60*((i-r)/100)+r}function gt(e){var t=Vr.exec(ft(e._i));if(t){var n=ct(t[4],t[3],t[2],t[5],t[6],t[7]);if(!ht(t[1],n,e))return;e._a=n,e._tzm=pt(t[8],t[9],t[10]),e._d=be.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),h(e).rfc2822=!0}else e._isValid=!1}function mt(t){var n=zr.exec(t._i);null===n?(dt(t),!1===t._isValid&&(delete t._isValid,gt(t),!1===t._isValid&&(delete t._isValid,e.createFromInputFallback(t)))):t._d=new Date(+n[1])}function vt(t){if(t._f!==e.ISO_8601)if(t._f!==e.RFC_2822){t._a=[],h(t).empty=!0;var n,i,r,a,o,s=""+t._i,l=s.length,d=0;for(r=V(t._f,t._locale).match(Hi)||[],n=0;n<r.length;n++)a=r[n],(i=(s.match(W(a,t))||[])[0])&&((o=s.substr(0,s.indexOf(i))).length>0&&h(t).unusedInput.push(o),s=s.slice(s.indexOf(i)+i.length),d+=i.length),zi[a]?(i?h(t).empty=!1:h(t).unusedTokens.push(a),J(a,i,t)):t._strict&&!i&&h(t).unusedTokens.push(a);h(t).charsLeftOver=l-d,s.length>0&&h(t).unusedInput.push(s),t._a[hr]<=12&&!0===h(t).bigHour&&t._a[hr]>0&&(h(t).bigHour=void 0),h(t).parsedDateParts=t._a.slice(0),h(t).meridiem=t._meridiem,t._a[hr]=yt(t._locale,t._a[hr],t._meridiem),st(t),rt(t)}else gt(t);else dt(t)}function yt(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}function _t(e){var t,n,i,r,a;if(0===e._f.length)return h(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;r<e._f.length;r++)a=0,t=m({},e),null!=e._useUTC&&(t._useUTC=e._useUTC),t._f=e._f[r],vt(t),p(t)&&(a+=h(t).charsLeftOver,a+=10*h(t).unusedTokens.length,h(t).score=a,(null==i||a<i)&&(i=a,n=t));c(e,n||t)}function bt(e){if(!e._d){var t=F(e._i);e._a=l([t.year,t.month,t.day||t.date,t.hour,t.minute,t.second,t.millisecond],(function(e){return e&&parseInt(e,10)})),st(e)}}function Et(e){var t=new v(rt(wt(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function wt(e){var t=e._i,i=e._f;return e._locale=e._locale||nt(e._l),null===t||void 0===i&&""===t?g({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),y(t)?new v(rt(t)):(s(t)?e._d=t:n(i)?_t(e):i?vt(e):Tt(e),p(e)||(e._d=null),e))}function Tt(t){var r=t._i;a(r)?t._d=new Date(e.now()):s(r)?t._d=new Date(r.valueOf()):"string"==typeof r?mt(t):n(r)?(t._a=l(r.slice(0),(function(e){return parseInt(e,10)})),st(t)):i(r)?bt(t):o(r)?t._d=new Date(r):e.createFromInputFallback(t)}function St(e,t,a,o,s){var l={};return!0!==a&&!1!==a||(o=a,a=void 0),(i(e)&&r(e)||n(e)&&0===e.length)&&(e=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=s,l._l=a,l._i=e,l._f=t,l._strict=o,Et(l)}function Ct(e,t,n,i){return St(e,t,n,i,!1)}function kt(e,t){var i,r;if(1===t.length&&n(t[0])&&(t=t[0]),!t.length)return Ct();for(i=t[0],r=1;r<t.length;++r)t[r].isValid()&&!t[r][e](i)||(i=t[r]);return i}function It(){return kt("isBefore",[].slice.call(arguments,0))}function At(){return kt("isAfter",[].slice.call(arguments,0))}function xt(e){for(var t in e)if(-1===_r.call(Xr,t)||null!=e[t]&&isNaN(e[t]))return!1;for(var n=!1,i=0;i<Xr.length;++i)if(e[Xr[i]]){if(n)return!1;parseFloat(e[Xr[i]])!==b(e[Xr[i]])&&(n=!0)}return!0}function Dt(){return this._isValid}function Rt(){return Xt(NaN)}function Mt(e){var t=F(e),n=t.year||0,i=t.quarter||0,r=t.month||0,a=t.week||0,o=t.day||0,s=t.hour||0,l=t.minute||0,d=t.second||0,c=t.millisecond||0;this._isValid=xt(t),this._milliseconds=+c+1e3*d+6e4*l+1e3*s*60*60,this._days=+o+7*a,this._months=+r+3*i+12*n,this._data={},this._locale=nt(),this._bubble()}function Nt(e){return e instanceof Mt}function Ot(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Pt(e,t){H(e,0,0,(function(){var e=this.utcOffset(),n="+";return e<0&&(e=-e,n="-"),n+U(~~(e/60),2)+t+U(~~e%60,2)}))}function Lt(e,t){var n=(t||"").match(e);if(null===n)return null;var i=((n[n.length-1]||[])+"").match(Qr)||["-",0,0],r=60*i[1]+b(i[2]);return 0===r?0:"+"===i[0]?r:-r}function Ft(t,n){var i,r;return n._isUTC?(i=n.clone(),r=(y(t)||s(t)?t.valueOf():Ct(t).valueOf())-i.valueOf(),i._d.setTime(i._d.valueOf()+r),e.updateOffset(i,!1),i):Ct(t).local()}function jt(e){return 15*-Math.round(e._d.getTimezoneOffset()/15)}function Bt(t,n,i){var r,a=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Lt(ar,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&n&&(r=jt(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),a!==t&&(!n||this._changeInProgress?tn(this,Xt(t-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?a:jt(this)}function Ut(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function Ht(e){return this.utcOffset(0,e)}function $t(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(jt(this),"m")),this}function qt(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=Lt(rr,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this}function zt(e){return!!this.isValid()&&(e=e?Ct(e).utcOffset():0,(this.utcOffset()-e)%60==0)}function Vt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Gt(){if(!a(this._isDSTShifted))return this._isDSTShifted;var e={};if(m(e,this),(e=wt(e))._a){var t=e._isUTC?u(e._a):Ct(e._a);this._isDSTShifted=this.isValid()&&E(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wt(){return!!this.isValid()&&!this._isUTC}function Yt(){return!!this.isValid()&&this._isUTC}function Kt(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Xt(e,t){var n,i,r,a=e,s=null;return Nt(e)?a={ms:e._milliseconds,d:e._days,M:e._months}:o(e)?(a={},t?a[t]=e:a.milliseconds=e):(s=Jr.exec(e))?(n="-"===s[1]?-1:1,a={y:0,d:b(s[fr])*n,h:b(s[hr])*n,m:b(s[pr])*n,s:b(s[gr])*n,ms:b(Ot(1e3*s[mr]))*n}):(s=Zr.exec(e))?(n="-"===s[1]?-1:(s[1],1),a={y:Qt(s[2],n),M:Qt(s[3],n),w:Qt(s[4],n),d:Qt(s[5],n),h:Qt(s[6],n),m:Qt(s[7],n),s:Qt(s[8],n)}):null==a?a={}:"object"==typeof a&&("from"in a||"to"in a)&&(r=Zt(Ct(a.from),Ct(a.to)),(a={}).ms=r.milliseconds,a.M=r.months),i=new Mt(a),Nt(e)&&d(e,"_locale")&&(i._locale=e._locale),i}function Qt(e,t){var n=e&&parseFloat(e.replace(",","."));return(isNaN(n)?0:n)*t}function Jt(e,t){var n={milliseconds:0,months:0};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function Zt(e,t){var n;return e.isValid()&&t.isValid()?(t=Ft(t,e),e.isBefore(t)?n=Jt(e,t):((n=Jt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function en(e,t){return function(n,i){var r;return null===i||isNaN(+i)||(S(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=n,n=i,i=r),tn(this,Xt(n="string"==typeof n?+n:n,i),e),this}}function tn(t,n,i,r){var a=n._milliseconds,o=Ot(n._days),s=Ot(n._months);t.isValid()&&(r=null==r||r,s&&he(t,ie(t,"Month")+s*i),o&&re(t,"Date",ie(t,"Date")+o*i),a&&t._d.setTime(t._d.valueOf()+a*i),r&&e.updateOffset(t,o||s))}function nn(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function rn(t,n){var i=t||Ct(),r=Ft(i,this).startOf("day"),a=e.calendarFormat(this,r)||"sameElse",o=n&&(C(n[a])?n[a].call(this,i):n[a]);return this.format(o||this.localeData().calendar(a,this,Ct(i)))}function an(){return new v(this)}function on(e,t){var n=y(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=L(a(t)?"millisecond":t))?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(t).valueOf())}function sn(e,t){var n=y(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=L(a(t)?"millisecond":t))?this.valueOf()<n.valueOf():this.clone().endOf(t).valueOf()<n.valueOf())}function ln(e,t,n,i){return("("===(i=i||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===i[1]?this.isBefore(t,n):!this.isAfter(t,n))}function dn(e,t){var n,i=y(e)?e:Ct(e);return!(!this.isValid()||!i.isValid())&&("millisecond"===(t=L(t||"millisecond"))?this.valueOf()===i.valueOf():(n=i.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf()))}function cn(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function un(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function fn(e,t,n){var i,r,a;if(!this.isValid())return NaN;if(!(i=Ft(e,this)).isValid())return NaN;switch(r=6e4*(i.utcOffset()-this.utcOffset()),t=L(t)){case"year":a=hn(this,i)/12;break;case"month":a=hn(this,i);break;case"quarter":a=hn(this,i)/3;break;case"second":a=(this-i)/1e3;break;case"minute":a=(this-i)/6e4;break;case"hour":a=(this-i)/36e5;break;case"day":a=(this-i-r)/864e5;break;case"week":a=(this-i-r)/6048e5;break;default:a=this-i}return n?a:_(a)}function hn(e,t){var n=12*(t.year()-e.year())+(t.month()-e.month()),i=e.clone().add(n,"months");return-(n+(t-i<0?(t-i)/(i-e.clone().add(n-1,"months")):(t-i)/(e.clone().add(n+1,"months")-i)))||0}function pn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function gn(e){if(!this.isValid())return null;var t=!0!==e,n=t?this.clone().utc():this;return n.year()<0||n.year()>9999?z(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",z(n,"Z")):z(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function mn(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',i=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",r="-MM-DD[T]HH:mm:ss.SSS",a=t+'[")]';return this.format(n+i+r+a)}function vn(t){t||(t=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var n=z(this,t);return this.localeData().postformat(n)}function yn(e,t){return this.isValid()&&(y(e)&&e.isValid()||Ct(e).isValid())?Xt({to:this,from:e
}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function _n(e){return this.from(Ct(),e)}function bn(e,t){return this.isValid()&&(y(e)&&e.isValid()||Ct(e).isValid())?Xt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function En(e){return this.to(Ct(),e)}function wn(e){var t;return void 0===e?this._locale._abbr:(null!=(t=nt(e))&&(this._locale=t),this)}function Tn(){return this._locale}function Sn(e){switch(e=L(e)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":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 Cn(e){return void 0===(e=L(e))||"millisecond"===e?this:("date"===e&&(e="day"),this.startOf(e).add(1,"isoWeek"===e?"week":e).subtract(1,"ms"))}function kn(){return this._d.valueOf()-6e4*(this._offset||0)}function In(){return Math.floor(this.valueOf()/1e3)}function An(){return new Date(this.valueOf())}function xn(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function Dn(){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 Rn(){return this.isValid()?this.toISOString():null}function Mn(){return p(this)}function Nn(){return c({},h(this))}function On(){return h(this).overflow}function Pn(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Ln(e,t){H(0,[e,e.length],0,t)}function Fn(e){return Hn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function jn(e){return Hn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function Bn(){return Se(this.year(),1,4)}function Un(){var e=this.localeData()._week;return Se(this.year(),e.dow,e.doy)}function Hn(e,t,n,i,r){var a;return null==e?Te(this,i,r).year:(t>(a=Se(e,i,r))&&(t=a),$n.call(this,e,t,n,i,r))}function $n(e,t,n,i,r){var a=we(e,t,n,i,r),o=be(a.year,0,a.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}function qn(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)}function zn(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 Vn(e,t){t[mr]=b(1e3*("0."+e))}function Gn(){return this._isUTC?"UTC":""}function Wn(){return this._isUTC?"Coordinated Universal Time":""}function Yn(e){return Ct(1e3*e)}function Kn(){return Ct.apply(null,arguments).parseZone()}function Xn(e){return e}function Qn(e,t,n,i){var r=nt(),a=u().set(i,t);return r[n](a,e)}function Jn(e,t,n){if(o(e)&&(t=e,e=void 0),e=e||"",null!=t)return Qn(e,t,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=Qn(e,i,n,"month");return r}function Zn(e,t,n,i){"boolean"==typeof e?(o(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,o(t)&&(n=t,t=void 0),t=t||"");var r,a=nt(),s=e?a._week.dow:0;if(null!=n)return Qn(t,(n+s)%7,i,"day");var l=[];for(r=0;r<7;r++)l[r]=Qn(t,(r+s)%7,i,"day");return l}function ei(e,t){return Jn(e,t,"months")}function ti(e,t){return Jn(e,t,"monthsShort")}function ni(e,t,n){return Zn(e,t,n,"weekdays")}function ii(e,t,n){return Zn(e,t,n,"weekdaysShort")}function ri(e,t,n){return Zn(e,t,n,"weekdaysMin")}function ai(){var e=this._data;return this._milliseconds=ca(this._milliseconds),this._days=ca(this._days),this._months=ca(this._months),e.milliseconds=ca(e.milliseconds),e.seconds=ca(e.seconds),e.minutes=ca(e.minutes),e.hours=ca(e.hours),e.months=ca(e.months),e.years=ca(e.years),this}function oi(e,t,n,i){var r=Xt(t,n);return e._milliseconds+=i*r._milliseconds,e._days+=i*r._days,e._months+=i*r._months,e._bubble()}function si(e,t){return oi(this,e,t,1)}function li(e,t){return oi(this,e,t,-1)}function di(e){return e<0?Math.floor(e):Math.ceil(e)}function ci(){var e,t,n,i,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*di(fi(s)+o),o=0,s=0),l.milliseconds=a%1e3,e=_(a/1e3),l.seconds=e%60,t=_(e/60),l.minutes=t%60,n=_(t/60),l.hours=n%24,o+=_(n/24),s+=r=_(ui(o)),o-=di(fi(r)),i=_(s/12),s%=12,l.days=o,l.months=s,l.years=i,this}function ui(e){return 4800*e/146097}function fi(e){return 146097*e/4800}function hi(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if("month"===(e=L(e))||"year"===e)return t=this._days+i/864e5,n=this._months+ui(t),"month"===e?n:n/12;switch(t=this._days+Math.round(fi(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}}function pi(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*b(this._months/12):NaN}function gi(e){return function(){return this.as(e)}}function mi(){return Xt(this)}function vi(e){return e=L(e),this.isValid()?this[e+"s"]():NaN}function yi(e){return function(){return this.isValid()?this._data[e]:NaN}}function _i(){return _(this.days()/7)}function bi(e,t,n,i,r){return r.relativeTime(t||1,!!n,e,i)}function Ei(e,t,n){var i=Xt(e).abs(),r=ka(i.as("s")),a=ka(i.as("m")),o=ka(i.as("h")),s=ka(i.as("d")),l=ka(i.as("M")),d=ka(i.as("y")),c=r<=Ia.ss&&["s",r]||r<Ia.s&&["ss",r]||a<=1&&["m"]||a<Ia.m&&["mm",a]||o<=1&&["h"]||o<Ia.h&&["hh",o]||s<=1&&["d"]||s<Ia.d&&["dd",s]||l<=1&&["M"]||l<Ia.M&&["MM",l]||d<=1&&["y"]||["yy",d];return c[2]=t,c[3]=+e>0,c[4]=n,bi.apply(null,c)}function wi(e){return void 0===e?ka:"function"==typeof e&&(ka=e,!0)}function Ti(e,t){return void 0!==Ia[e]&&(void 0===t?Ia[e]:(Ia[e]=t,"s"===e&&(Ia.ss=t-1),!0))}function Si(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=Ei(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)}function Ci(e){return(e>0)-(e<0)||+e}function ki(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Aa(this._milliseconds)/1e3,i=Aa(this._days),r=Aa(this._months);e=_(n/60),t=_(e/60),n%=60,e%=60;var a=_(r/12),o=r%=12,s=i,l=t,d=e,c=n?n.toFixed(3).replace(/\.?0+$/,""):"",u=this.asSeconds();if(!u)return"P0D";var f=u<0?"-":"",h=Ci(this._months)!==Ci(u)?"-":"",p=Ci(this._days)!==Ci(u)?"-":"",g=Ci(this._milliseconds)!==Ci(u)?"-":"";return f+"P"+(a?h+a+"Y":"")+(o?h+o+"M":"")+(s?p+s+"D":"")+(l||d||c?"T":"")+(l?g+l+"H":"")+(d?g+d+"M":"")+(c?g+c+"S":"")}var Ii,Ai;Ai=Array.prototype.some?Array.prototype.some:function(e){for(var t=Object(this),n=t.length>>>0,i=0;i<n;i++)if(i in t&&e.call(this,t[i],i,t))return!0;return!1};var xi,Di=e.momentProperties=[],Ri=!1,Mi={};e.suppressDeprecationWarnings=!1,e.deprecationHandler=null,xi=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)d(e,t)&&n.push(t);return n};var Ni={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Oi={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"},Pi="Invalid date",Li="%d",Fi=/\d{1,2}/,ji={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Bi={},Ui={},Hi=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,$i=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,qi={},zi={},Vi=/\d/,Gi=/\d\d/,Wi=/\d{3}/,Yi=/\d{4}/,Ki=/[+-]?\d{6}/,Xi=/\d\d?/,Qi=/\d\d\d\d?/,Ji=/\d\d\d\d\d\d?/,Zi=/\d{1,3}/,er=/\d{1,4}/,tr=/[+-]?\d{1,6}/,nr=/\d+/,ir=/[+-]?\d+/,rr=/Z|[+-]\d\d:?\d\d/gi,ar=/Z|[+-]\d\d(?::?\d\d)?/gi,or=/[+-]?\d+(\.\d{1,3})?/,sr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,lr={},dr={},cr=0,ur=1,fr=2,hr=3,pr=4,gr=5,mr=6,vr=7,yr=8;H("Y",0,0,(function(){var e=this.year();return e<=9999?""+e:"+"+e})),H(0,["YY",2],0,(function(){return this.year()%100})),H(0,["YYYY",4],0,"year"),H(0,["YYYYY",5],0,"year"),H(0,["YYYYYY",6,!0],0,"year"),P("year","y"),j("year",1),G("Y",ir),G("YY",Xi,Gi),G("YYYY",er,Yi),G("YYYYY",tr,Ki),G("YYYYYY",tr,Ki),X(["YYYYY","YYYYYY"],cr),X("YYYY",(function(t,n){n[cr]=2===t.length?e.parseTwoDigitYear(t):b(t)})),X("YY",(function(t,n){n[cr]=e.parseTwoDigitYear(t)})),X("Y",(function(e,t){t[cr]=parseInt(e,10)})),e.parseTwoDigitYear=function(e){return b(e)+(b(e)>68?1900:2e3)};var _r,br=ne("FullYear",!0);_r=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1},H("M",["MM",2],"Mo",(function(){return this.month()+1})),H("MMM",0,0,(function(e){return this.localeData().monthsShort(this,e)})),H("MMMM",0,0,(function(e){return this.localeData().months(this,e)})),P("month","M"),j("month",8),G("M",Xi),G("MM",Xi,Gi),G("MMM",(function(e,t){return t.monthsShortRegex(e)})),G("MMMM",(function(e,t){return t.monthsRegex(e)})),X(["M","MM"],(function(e,t){t[ur]=b(e)-1})),X(["MMM","MMMM"],(function(e,t,n,i){var r=n._locale.monthsParse(e,i,n._strict);null!=r?t[ur]=r:h(n).invalidMonth=e}));var Er=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,wr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Tr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Sr=sr,Cr=sr;H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),P("week","w"),P("isoWeek","W"),j("week",5),j("isoWeek",5),G("w",Xi),G("ww",Xi,Gi),G("W",Xi),G("WW",Xi,Gi),Q(["w","ww","W","WW"],(function(e,t,n,i){t[i.substr(0,1)]=b(e)}));var kr={dow:0,doy:6};H("d",0,"do","day"),H("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),H("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),H("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),P("day","d"),P("weekday","e"),P("isoWeekday","E"),j("day",11),j("weekday",11),j("isoWeekday",11),G("d",Xi),G("e",Xi),G("E",Xi),G("dd",(function(e,t){return t.weekdaysMinRegex(e)})),G("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),G("dddd",(function(e,t){return t.weekdaysRegex(e)})),Q(["dd","ddd","dddd"],(function(e,t,n,i){var r=n._locale.weekdaysParse(e,i,n._strict);null!=r?t.d=r:h(n).invalidWeekday=e})),Q(["d","e","E"],(function(e,t,n,i){t[i]=b(e)}));var Ir="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ar="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),xr="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Dr=sr,Rr=sr,Mr=sr;H("H",["HH",2],0,"hour"),H("h",["hh",2],0,ze),H("k",["kk",2],0,Ve),H("hmm",0,0,(function(){return""+ze.apply(this)+U(this.minutes(),2)})),H("hmmss",0,0,(function(){return""+ze.apply(this)+U(this.minutes(),2)+U(this.seconds(),2)})),H("Hmm",0,0,(function(){return""+this.hours()+U(this.minutes(),2)})),H("Hmmss",0,0,(function(){return""+this.hours()+U(this.minutes(),2)+U(this.seconds(),2)})),Ge("a",!0),Ge("A",!1),P("hour","h"),j("hour",13),G("a",We),G("A",We),G("H",Xi),G("h",Xi),G("k",Xi),G("HH",Xi,Gi),G("hh",Xi,Gi),G("kk",Xi,Gi),G("hmm",Qi),G("hmmss",Ji),G("Hmm",Qi),G("Hmmss",Ji),X(["H","HH"],hr),X(["k","kk"],(function(e,t){var n=b(e);t[hr]=24===n?0:n})),X(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),X(["h","hh"],(function(e,t,n){t[hr]=b(e),h(n).bigHour=!0})),X("hmm",(function(e,t,n){var i=e.length-2;t[hr]=b(e.substr(0,i)),t[pr]=b(e.substr(i)),h(n).bigHour=!0})),X("hmmss",(function(e,t,n){var i=e.length-4,r=e.length-2;t[hr]=b(e.substr(0,i)),t[pr]=b(e.substr(i,2)),t[gr]=b(e.substr(r)),h(n).bigHour=!0})),X("Hmm",(function(e,t){var n=e.length-2;t[hr]=b(e.substr(0,n)),t[pr]=b(e.substr(n))})),X("Hmmss",(function(e,t){var n=e.length-4,i=e.length-2;t[hr]=b(e.substr(0,n)),t[pr]=b(e.substr(n,2)),t[gr]=b(e.substr(i))}));var Nr,Or=/[ap]\.?m?\.?/i,Pr=ne("Hours",!0),Lr={calendar:Ni,longDateFormat:Oi,invalidDate:Pi,ordinal:Li,dayOfMonthOrdinalParse:Fi,relativeTime:ji,months:wr,monthsShort:Tr,week:kr,weekdays:Ir,weekdaysMin:xr,weekdaysShort:Ar,meridiemParse:Or},Fr={},jr={},Br=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ur=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Hr=/Z|[+-]\d\d(?::?\d\d)?/,$r=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],qr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],zr=/^\/?Date\((\-?\d+)/i,Vr=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Gr={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};e.createFromInputFallback=T("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))})),e.ISO_8601=function(){},e.RFC_2822=function(){};var Wr=T("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:g()})),Yr=T("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var e=Ct.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:g()})),Kr=function(){return Date.now?Date.now():+new Date},Xr=["year","quarter","month","week","day","hour","minute","second","millisecond"];Pt("Z",":"),Pt("ZZ",""),G("Z",ar),G("ZZ",ar),X(["Z","ZZ"],(function(e,t,n){n._useUTC=!0,n._tzm=Lt(ar,e)}));var Qr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var Jr=/^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/,Zr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;Xt.fn=Mt.prototype,Xt.invalid=Rt;var ea=en(1,"add"),ta=en(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var na=T("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)}));H(0,["gg",2],0,(function(){return this.weekYear()%100})),H(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Ln("gggg","weekYear"),Ln("ggggg","weekYear"),Ln("GGGG","isoWeekYear"),Ln("GGGGG","isoWeekYear"),P("weekYear","gg"),P("isoWeekYear","GG"),j("weekYear",1),j("isoWeekYear",1),G("G",ir),G("g",ir),G("GG",Xi,Gi),G("gg",Xi,Gi),G("GGGG",er,Yi),G("gggg",er,Yi),G("GGGGG",tr,Ki),G("ggggg",tr,Ki),Q(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,i){t[i.substr(0,2)]=b(e)})),Q(["gg","GG"],(function(t,n,i,r){n[r]=e.parseTwoDigitYear(t)})),H("Q",0,"Qo","quarter"),P("quarter","Q"),j("quarter",7),G("Q",Vi),X("Q",(function(e,t){t[ur]=3*(b(e)-1)})),H("D",["DD",2],"Do","date"),P("date","D"),j("date",9),G("D",Xi),G("DD",Xi,Gi),G("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),X(["D","DD"],fr),X("Do",(function(e,t){t[fr]=b(e.match(Xi)[0])}));var ia=ne("Date",!0);H("DDD",["DDDD",3],"DDDo","dayOfYear"),P("dayOfYear","DDD"),j("dayOfYear",4),G("DDD",Zi),G("DDDD",Wi),X(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=b(e)})),H("m",["mm",2],0,"minute"),P("minute","m"),j("minute",14),G("m",Xi),G("mm",Xi,Gi),X(["m","mm"],pr);var ra=ne("Minutes",!1);H("s",["ss",2],0,"second"),P("second","s"),j("second",15),G("s",Xi),G("ss",Xi,Gi),X(["s","ss"],gr);var aa,oa=ne("Seconds",!1);for(H("S",0,0,(function(){return~~(this.millisecond()/100)})),H(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),H(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),H(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),H(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),H(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),H(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),P("millisecond","ms"),j("millisecond",16),G("S",Zi,Vi),G("SS",Zi,Gi),G("SSS",Zi,Wi),aa="SSSS";aa.length<=9;aa+="S")G(aa,nr);for(aa="S";aa.length<=9;aa+="S")X(aa,Vn);var sa=ne("Milliseconds",!1);H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var la=v.prototype;la.add=ea,la.calendar=rn,la.clone=an,la.diff=fn,la.endOf=Cn,la.format=vn,la.from=yn,la.fromNow=_n,la.to=bn,la.toNow=En,la.get=ae,la.invalidAt=On,la.isAfter=on,la.isBefore=sn,la.isBetween=ln,la.isSame=dn,la.isSameOrAfter=cn,la.isSameOrBefore=un,la.isValid=Mn,la.lang=na,la.locale=wn,la.localeData=Tn,la.max=Yr,la.min=Wr,la.parsingFlags=Nn,la.set=oe,la.startOf=Sn,la.subtract=ta,la.toArray=xn,la.toObject=Dn,la.toDate=An,la.toISOString=gn,la.inspect=mn,la.toJSON=Rn,la.toString=pn,la.unix=In,la.valueOf=kn,la.creationData=Pn,la.year=br,la.isLeapYear=te,la.weekYear=Fn,la.isoWeekYear=jn,la.quarter=la.quarters=qn,la.month=pe,la.daysInMonth=ge,la.week=la.weeks=Ae,la.isoWeek=la.isoWeeks=xe,la.weeksInYear=Un,la.isoWeeksInYear=Bn,la.date=ia,la.day=la.days=Fe,la.weekday=je,la.isoWeekday=Be,la.dayOfYear=zn,la.hour=la.hours=Pr,la.minute=la.minutes=ra,la.second=la.seconds=oa,la.millisecond=la.milliseconds=sa,la.utcOffset=Bt,la.utc=Ht,la.local=$t,la.parseZone=qt,la.hasAlignedHourOffset=zt,la.isDST=Vt,la.isLocal=Wt,la.isUtcOffset=Yt,la.isUtc=Kt,la.isUTC=Kt,la.zoneAbbr=Gn,la.zoneName=Wn,la.dates=T("dates accessor is deprecated. Use date instead.",ia),la.months=T("months accessor is deprecated. Use month instead",pe),la.years=T("years accessor is deprecated. Use year instead",br),la.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ut),la.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Gt);var da=A.prototype;da.calendar=x,da.longDateFormat=D,da.invalidDate=R,da.ordinal=M,da.preparse=Xn,da.postformat=Xn,da.relativeTime=N,da.pastFuture=O,da.set=k,da.months=de,da.monthsShort=ce,da.monthsParse=fe,da.monthsRegex=ve,da.monthsShortRegex=me,da.week=Ce,da.firstDayOfYear=Ie,da.firstDayOfWeek=ke,da.weekdays=Me,da.weekdaysMin=Oe,da.weekdaysShort=Ne,da.weekdaysParse=Le,da.weekdaysRegex=Ue,da.weekdaysShortRegex=He,da.weekdaysMinRegex=$e,da.isPM=Ye,da.meridiem=Ke,Ze("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===b(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),e.lang=T("moment.lang is deprecated. Use moment.locale instead.",Ze),e.langData=T("moment.langData is deprecated. Use moment.localeData instead.",nt);var ca=Math.abs,ua=gi("ms"),fa=gi("s"),ha=gi("m"),pa=gi("h"),ga=gi("d"),ma=gi("w"),va=gi("M"),ya=gi("y"),_a=yi("milliseconds"),ba=yi("seconds"),Ea=yi("minutes"),wa=yi("hours"),Ta=yi("days"),Sa=yi("months"),Ca=yi("years"),ka=Math.round,Ia={ss:44,s:45,m:45,h:22,d:26,M:11},Aa=Math.abs,xa=Mt.prototype;return xa.isValid=Dt,xa.abs=ai,xa.add=si,xa.subtract=li,xa.as=hi,xa.asMilliseconds=ua,xa.asSeconds=fa,xa.asMinutes=ha,xa.asHours=pa,xa.asDays=ga,xa.asWeeks=ma,xa.asMonths=va,xa.asYears=ya,xa.valueOf=pi,xa._bubble=ci,xa.clone=mi,xa.get=vi,xa.milliseconds=_a,xa.seconds=ba,xa.minutes=Ea,xa.hours=wa,xa.days=Ta,xa.weeks=_i,xa.months=Sa,xa.years=Ca,xa.humanize=Si,xa.toISOString=ki,xa.toString=ki,xa.toJSON=ki,xa.locale=wn,xa.localeData=Tn,xa.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ki),xa.lang=na,H("X",0,0,"unix"),H("x",0,0,"valueOf"),G("x",ir),G("X",or),X("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))})),X("x",(function(e,t,n){n._d=new Date(b(e))})),e.version="2.22.2",t(Ct),e.fn=la,e.min=It,e.max=At,e.now=Kr,e.utc=u,e.unix=Yn,e.months=ei,e.isDate=s,e.locale=Ze,e.invalid=g,e.duration=Xt,e.isMoment=y,e.weekdays=ni,e.parseZone=Kn,e.localeData=nt,e.isDuration=Nt,e.monthsShort=ti,e.weekdaysMin=ri,e.defineLocale=et,e.updateLocale=tt,e.locales=it,e.weekdaysShort=ii,e.normalizeUnits=L,e.relativeTimeRounding=wi,e.relativeTimeThreshold=Ti,e.calendarFormat=nn,e.prototype=la,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"YYYY-[W]WW",MONTH:"YYYY-MM"},e})),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).rome=e()}}((function(){return function e(t,n,i){function r(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var c=n[o]={exports:{}};t[o][0].call(c.exports,(function(e){var n=t[o][1][e];return r(n||e)}),c,c.exports,e,t,n,i)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<i.length;o++)r(i[o]);return r}({1:[function(e,t){"use strict";function n(e,t,n){function o(){m.sleeping=!0}function s(){return l()}function l(e){var n=t.getBoundingClientRect(),i=document.body.scrollTop||document.documentElement.scrollTop;return v?{x:((e=v.read()).absolute?0:n.left)+e.x,y:(e.absolute?0:n.top)+i+e.y+20}:{x:n.left,y:n.top+i}}function d(e){c(e)}function c(n){if(p)throw new Error("Bullseye can't refresh after being destroyed. Create another instance instead.");if(v&&!n)return m.sleeping=!1,void v.refresh();var i=l(n);v||t===e||(i.y+=t.offsetHeight),e.style.left=i.x+"px",e.style.top=i.y+"px"}function u(){v&&v.destroy(),i.remove(window,"resize",g),p=!0}var f=n,h=t&&t.tagName;h||2!==arguments.length||(f=t),h||(t=e),f||(f={});var p=!1,g=r(c,30),m={update:!1!==f.autoupdateToCaret&&d},v=f.caret&&a(t,m);return c(),!1!==f.tracking&&i.add(window,"resize",g),{read:s,refresh:c,destroy:u,sleep:o}}var i=e("crossvent"),r=e("./throttle"),a=e("./tailormade");t.exports=n},{"./tailormade":11,"./throttle":12,crossvent:18}],2:[function(e,t){(function(n){"use strict";var i,r=n.document,a=e("./getSelectionRaw"),o=e("./getSelectionNullOp"),s=e("./getSelectionSynthetic");i=e("./isHost").method(n,"getSelection")?a:"object"==typeof r.selection&&r.selection?s:o,t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./getSelectionNullOp":3,"./getSelectionRaw":4,"./getSelectionSynthetic":5,"./isHost":6}],3:[function(e,t){"use strict";function n(){}function i(){return{removeAllRanges:n,addRange:n}}t.exports=i},{}],4:[function(e,t){(function(e){"use strict";function n(){return e.getSelection()}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(e,t){(function(n){"use strict";function i(e){var t=this,n=e.createRange();this._selection=e,this._ranges=[],"Control"===e.type?f(t):c(n)?u(t,n):s(t)}function r(e,t){for(var n,i=_.createControlRange(),r=0,a=t.length;a>r;++r){n=d(t[r]);try{i.add(n)}catch(e){throw new Error("setRanges(): Element could not be added to control selection")}}i.select(),f(e)}function a(e,t){var n=e.getAllRanges();e.removeAllRanges();for(var i=0,r=n.length;r>i;++i)p(t,n[i])||e.addRange(n[i]);e.rangeCount||s(e)}function o(e,t){var n="start",i="end";e.anchorNode=t[n+"Container"],e.anchorOffset=t[n+"Offset"],e.focusNode=t[i+"Container"],e.focusOffset=t[i+"Offset"]}function s(e){e.anchorNode=e.focusNode=null,e.anchorOffset=e.focusOffset=0,e.rangeCount=0,e.isCollapsed=!0,e._ranges.length=0}function l(e){if(!e.length||1!==e[0].nodeType)return!1;for(var t=1,n=e.length;n>t;++t)if(!g(e[0],e[t]))return!1;return!0}function d(e){var t=e.getNodes();if(!l(t))throw new Error("getSingleElementFromRange(): range did not consist of a single element");return t[0]}function c(e){return e&&void 0!==e.text}function u(e,t){e._ranges=[t],o(e,t,!1),e.rangeCount=1,e.isCollapsed=t.collapsed}function f(e){if(e._ranges.length=0,"None"===e._selection.type)s(e);else{var t=e._selection.createRange();if(c(t))u(e,t);else{e.rangeCount=t.length;for(var n,i=0;i<e.rangeCount;++i)(n=y.createRange()).selectNode(t.item(i)),e._ranges.push(n);e.isCollapsed=1===e.rangeCount&&e._ranges[0].collapsed,o(e,e._ranges[e.rangeCount-1],!1)}}}function h(e,t){for(var n=e._selection.createRange(),i=d(t),r=_.createControlRange(),a=0,o=n.length;o>a;++a)r.add(n.item(a));try{r.add(i)}catch(e){throw new Error("addRange(): Element could not be added to control selection")}r.select(),f(e)}function p(e,t){return e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function g(e,t){for(var n=t;n.parentNode;){if(n.parentNode===e)return!0;n=n.parentNode}return!1}function m(){return new i(n.document.selection)}var v=e("./rangeToTextRange"),y=n.document,_=y.body,b=i.prototype;b.removeAllRanges=function(){try{this._selection.empty(),"None"!==this._selection.type&&(_.createTextRange().select(),this._selection.empty())}catch(e){}s(this)},b.addRange=function(e){"Control"===this._selection.type?h(this,e):(v(e).select(),this._ranges[0]=e,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,o(this,e,!1))},b.setRanges=function(e){this.removeAllRanges();var t=e.length;t>1?r(this,e):t&&this.addRange(e[0])},b.getRangeAt=function(e){if(0>e||e>=this.rangeCount)throw new Error("getRangeAt(): index out of bounds");return this._ranges[e].cloneRange()},b.removeRange=function(e){if("Control"===this._selection.type){for(var t=this._selection.createRange(),n=d(e),i=_.createControlRange(),r=!1,o=0,s=t.length;s>o;++o)t.item(o)!==n||r?i.add(t.item(o)):r=!0;i.select(),f(this)}else a(this,e)},b.eachRange=function(e,t){var n=0,i=this._ranges.length;for(n=0;i>n;++n)if(e(this.getRangeAt(n)))return t},b.getAllRanges=function(){var e=[];return this.eachRange((function(t){e.push(t)})),e},b.setSingleRange=function(e){this.removeAllRanges(),this.addRange(e)},t.exports=m}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./rangeToTextRange":7}],6:[function(e,t){"use strict";function n(e,t){var n=typeof e[t];return"function"===n||!("object"!==n||!e[t])||"unknown"===n}function i(e,t){return void 0!==e[t]}function r(e){return function(t,n){for(var i=n.length;i--;)if(!e(t,n[i]))return!1;return!0}}t.exports={method:n,methods:r(n),property:i,properties:r(i)}},{}],7:[function(e,t){(function(e){"use strict";function n(e){if(e.collapsed)return r({node:e.startContainer,offset:e.startOffset},!0);var t=r({node:e.startContainer,offset:e.startOffset},!0),n=r({node:e.endContainer,offset:e.endOffset},!1),i=o.createTextRange();return i.setEndPoint("StartToStart",t),i.setEndPoint("EndToEnd",n),i}function i(e){var t=e.nodeType;return 3===t||4===t||8===t}function r(e,t){var n,r,s,l,d=e.offset,c=o.createTextRange(),u=i(e.node);return u?r=(n=e.node).parentNode:(n=d<(l=e.node.childNodes).length?l[d]:null,r=e.node),(s=a.createElement("span")).innerHTML="&#feff;",n?r.insertBefore(s,n):r.appendChild(s),c.moveToElementText(s),c.collapse(!t),r.removeChild(s),u&&c[t?"moveStart":"moveEnd"]("character",d),c}var a=e.document,o=a.body;t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t){"use strict";var n=e("./getSelection"),i=e("./setSelection");t.exports={get:n,set:i}},{"./getSelection":2,"./setSelection":9}],9:[function(e,t){(function(n){"use strict";function i(e){function t(){var t=r(),n=o.createRange();e.startContainer&&(e.endContainer?n.setEnd(e.endContainer,e.endOffset):n.setEnd(e.startContainer,e.startOffset),n.setStart(e.startContainer,e.startOffset),t.removeAllRanges(),t.addRange(n))}function n(){a(e).select()}o.createRange?t():n()}var r=e("./getSelection"),a=e("./rangeToTextRange"),o=n.document;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./getSelection":2,"./rangeToTextRange":7}],10:[function(e,t){"use strict";function n(e){return{start:e.selectionStart,end:e.selectionEnd}}function i(e){function t(t,i){return n!==e&&(n?n.focus():e.blur()),{start:t,end:i}}var n=document.activeElement;n!==e&&e.focus();var i=document.selection.createRange(),o=i.getBookmark(),s=e.value,l=r(s),d=i.parentElement();if(null===d||!a(d))return t(0,0);i.text=l+i.text+l;var c=e.value;return e.value=s,i.moveToBookmark(o),i.select(),t(c.indexOf(l),c.lastIndexOf(l)-l.length)}function r(e){var t;do{t="@@marker."+Math.random()*new Date}while(-1!==e.indexOf(t));return t}function a(e){return"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName}function o(e,t){e.selectionStart=l(e,t.start),e.selectionEnd=l(e,t.end)}function s(e,t){var n=e.createTextRange();"end"===t.start&&"end"===t.end?(n.collapse(!1),n.select()):(n.collapse(!0),n.moveEnd("character",l(e,t.end)),n.moveStart("character",l(e,t.start)),n.select())}function l(e,t){return"end"===t?e.value.length:t||0}function d(e,t){return 2===arguments.length&&u(e,t),c(e)}var c=n,u=o;document.selection&&document.selection.createRange&&(c=i,u=s),t.exports=d},{}],11:[function(e,t){(function(n){"use strict";function i(e,t){function n(){}function i(){return(E?h:p)()}function o(){return T.sleeping?void 0:(T.update||n)(i())}function h(){var t=r(e),n=v(),i=g(n,t.start);return u.body.removeChild(n.mirror),i}function p(){var e=l();if(e.rangeCount){var t=e.getRangeAt(0);if("P"===t.startContainer.nodeName&&0===t.startOffset)return{x:t.startContainer.offsetLeft,y:t.startContainer.offsetTop,absolute:!0};if(t.getClientRects){var n=t.getClientRects();if(n.length>0)return{x:n[0].left,y:n[0].top,absolute:!0}}}return{x:0,y:0}}function g(t,n){var i=u.createElement("span"),r=t.mirror,a=t.computed;return y(r,m(e).substring(0,n)),"INPUT"===e.tagName&&(r.textContent=r.textContent.replace(/\s/g,"\xa0")),y(i,m(e).substring(n)||"."),r.appendChild(i),{x:i.offsetLeft+parseInt(a.borderLeftWidth),y:i.offsetTop+parseInt(a.borderTopWidth)}}function m(e){return E?e.value:e.innerHTML}function v(){function t(e){r[e]=n[e]}var n=c.getComputedStyle?getComputedStyle(e):e.currentStyle,i=u.createElement("div"),r=i.style;return u.body.appendChild(i),"INPUT"!==e.tagName&&(r.wordWrap="break-word"),r.whiteSpace="pre-wrap",r.position="absolute",r.visibility="hidden",d.forEach(t),f?(r.width=parseInt(n.width)-2+"px",e.scrollHeight>parseInt(n.height)&&(r.overflowY="scroll")):r.overflow="hidden",{mirror:i,computed:n}}function y(e,t){E?e.textContent=t:e.innerHTML=t}function _(t){var n=t?"remove":"add";a[n](e,"keydown",w),a[n](e,"keyup",w),a[n](e,"input",w),a[n](e,"paste",w),a[n](e,"change",w)}function b(){_(!0)}var E="INPUT"===e.tagName||"TEXTAREA"===e.tagName,w=s(o,30),T=t||{};return _(),{read:i,refresh:w,destroy:b}}var r=e("sell"),a=e("crossvent"),o=e("seleccion"),s=e("./throttle"),l=o.get,d=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"],c=n,u=document,f=null!==c.mozInnerScreenX&&void 0!==c.mozInnerScreenX;t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./throttle":12,crossvent:18,seleccion:8,sell:10}],12:[function(e,t){
"use strict";function n(e,t){var n,i=-1/0;return function(){function r(){clearTimeout(n),n=null;var a=i+t,o=Date.now();o>a?(i=o,e()):n=setTimeout(r,a-o)}n||r()}}t.exports=n},{}],13:[function(e,t){"use strict";var n=e("ticky");t.exports=function(e,t,i){e&&n((function(){e.apply(i||null,t||[])}))}},{ticky:16}],14:[function(e,t){"use strict";var n=e("atoa"),i=e("./debounce");t.exports=function(e,t){var r=t||{},a={};return void 0===e&&(e={}),e.on=function(t,n){return a[t]?a[t].push(n):a[t]=[n],e},e.once=function(t,n){return n._once=!0,e.on(t,n),e},e.off=function(t,n){var i=arguments.length;if(1===i)delete a[t];else if(0===i)a={};else{var r=a[t];if(!r)return e;r.splice(r.indexOf(n),1)}return e},e.emit=function(){var t=n(arguments);return e.emitterSnapshot(t.shift()).apply(this,t)},e.emitterSnapshot=function(t){var o=(a[t]||[]).slice(0);return function(){var a=n(arguments),s=this||e;if("error"===t&&!1!==r.throws&&!o.length)throw 1===a.length?a[0]:a;return o.forEach((function(n){r.async?i(n,a,s):n.apply(s,a),n._once&&e.off(t,n)})),e}},e}},{"./debounce":13,atoa:15}],15:[function(e,t){t.exports=function(e,t){return Array.prototype.slice.call(e,t)}},{}],16:[function(e,t){var n;n="function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){setTimeout(e,0)},t.exports=n},{}],17:[function(e,t){(function(e){function n(){try{var e=new i("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}var i=e.CustomEvent;t.exports=n()?i:"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],18:[function(e,t){(function(n){"use strict";function i(e,t,n,i){return e.addEventListener(t,n,i)}function r(e,t,n){return e.attachEvent("on"+t,d(e,t,n))}function a(e,t,n,i){return e.removeEventListener(t,n,i)}function o(e,t,n){return e.detachEvent("on"+t,c(e,t,n))}function s(e,t,n){function i(){var e;return p.createEvent?(e=p.createEvent("Event")).initEvent(t,!0,!0):p.createEventObject&&(e=p.createEventObject()),e}function r(){return new f(t,{detail:n})}var a=-1===h.indexOf(t)?r():i();e.dispatchEvent?e.dispatchEvent(a):e.fireEvent("on"+t,a)}function l(e,t,i){return function(t){var r=t||n.event;r.target=r.target||r.srcElement,r.preventDefault=r.preventDefault||function(){r.returnValue=!1},r.stopPropagation=r.stopPropagation||function(){r.cancelBubble=!0},r.which=r.which||r.keyCode,i.call(e,r)}}function d(e,t,n){var i=c(e,t,n)||l(e,t,n);return v.push({wrapper:i,element:e,type:t,fn:n}),i}function c(e,t,n){var i=u(e,t,n);if(i){var r=v[i].wrapper;return v.splice(i,1),r}}function u(e,t,n){var i,r;for(i=0;i<v.length;i++)if((r=v[i]).element===e&&r.type===t&&r.fn===n)return i}var f=e("custom-event"),h=e("./eventmap"),p=document,g=i,m=a,v=[];n.addEventListener||(g=r,m=o),t.exports={add:g,remove:m,fabricate:s}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./eventmap":19,"custom-event":17}],19:[function(e,t){(function(e){"use strict";var n=[],i="",r=/^on/;for(i in e)r.test(i)&&n.push(i.slice(2));t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],20:[function(e,t){"use strict";function n(e,t){var n=l[e.id];return n&&n[t.id]}function i(e,t){var n=l[e.id];n||(n=l[e.id]={});var i=a(t);n[t.id]=i,e.on("data",i),e.on("destroyed",r.bind(null,e,t))}function r(e,t){var n=l[e.id];if(n){var i=n[t.id];e.off("data",i),delete n[t.id]}}function a(e){return function(){e.refresh()}}function o(e,t){s(t.associated)||n(e,t)||i(e,t)}var s=e("./isInput"),l={};t.exports={add:o,remove:r}},{"./isInput":30}],21:[function(e,t){"use strict";function n(e){function t(){return xe}function n(n){return ce=c(n||e,xe),he||(he=o({className:ce.styles.container})),pe=ce.weekdayFormat,ge=pe.length,ve=i,me=i,ye=i,_e=i,ce.appendTo.appendChild(he),W(he),Ce=!1,ue=ce.initialValue?ce.initialValue:u.moment(),fe=ue.clone(),xe.back=P,xe.container=he,xe.destroyed=!1,xe.destroy=g.bind(xe,!1),xe.emitValues=z,xe.getDate=se,xe.getDateString=le,xe.getMoment=de,xe.hide=D,xe.next=L,xe.options=v,xe.options.reset=y,xe.refresh=V,xe.restore=t,xe.setValue=G,xe.show=x,m(),p(),xe}function p(){xe.emit("ready",d(ce))}function g(e){he&&he.parentNode&&he.parentNode.removeChild(he),ce&&m(!0);var i=xe.emitterSnapshot("destroyed");return xe.back=h,xe.destroyed=!0,xe.destroy=t,xe.emitValues=t,xe.getDate=h,xe.getDateString=h,xe.getMoment=h,xe.hide=t,xe.next=h,xe.options=t,xe.options.reset=t,xe.refresh=t,xe.restore=n,xe.setValue=t,xe.show=t,xe.off(),!0!==e&&i(),xe}function m(e){var t=e?"remove":"add";ce.autoHideOnBlur&&r[t](document.documentElement,"focus",N,!0),ce.autoHideOnClick&&r[t](document,"click",O)}function v(e){return 0===arguments.length?d(ce):(g(),n(e),xe)}function y(){return v({appendTo:ce.appendTo})}function _(){Ce||(Ce=!0,b(),E(),xe.emit("render"))}function b(){function e(e){var t=o({className:ce.styles.month,parent:be});0===e&&(Ee=o({type:"button",className:ce.styles.back,attributes:{type:"button"},parent:t})),e===ce.monthsInCalendar-1&&(we=o({type:"button",className:ce.styles.next,attributes:{type:"button"},parent:t}));var n,i=o({className:ce.styles.monthLabel,parent:t}),r=o({type:"table",className:ce.styles.dayTable,parent:t}),a=o({type:"thead",className:ce.styles.dayHead,parent:r}),s=o({type:"tr",className:ce.styles.dayRow,parent:a}),l=o({type:"tbody",className:ce.styles.dayBody,parent:r});for(n=0;ge>n;n++)o({type:"th",className:ce.styles.dayHeadElem,parent:s,text:pe[w(n)]});l.setAttribute(ke,e),Ie.push({label:i,body:l})}if(ce.date){var t;for(Ie=[],be=o({className:ce.styles.date,parent:he}),t=0;t<ce.monthsInCalendar;t++)e(t);r.add(Ee,"click",P),r.add(we,"click",L),r.add(be,"click",ne)}}function E(){if(ce.time&&ce.timeInterval){var e=o({className:ce.styles.time,parent:he});Te=o({className:ce.styles.selectedTime,parent:e,text:ue.format(ce.timeFormat)}),r.add(Te,"click",S),Se=o({className:ce.styles.timeList,parent:e}),r.add(Se,"click",oe);for(var t=u.moment("00:00:00","HH:mm:ss"),n=t.clone().add(1,"days");t.isBefore(n);)o({className:ce.styles.timeOption,parent:Se,text:t.format(ce.timeFormat)}),t.add(ce.timeInterval,"seconds")}}function w(e,t){var n=t?-1:1,i=e+ce.weekStart*n;return(i>=ge||0>i)&&(i+=ge*-n),i}function T(){if(ce.time&&Ce){var e,t,n,i,r=Se.children,a=r.length;for(i=0;a>i;i++)n=r[i],t=u.moment(s(n),ce.timeFormat),e=ae(ue.clone(),t),n.style.display=X(e,!1,ce.timeValidator)?"block":"none"}}function S(e){("boolean"==typeof e?e:"none"===Se.style.display)?C():k()}function C(){Se&&(Se.style.display="block")}function k(){Se&&(Se.style.display="none")}function I(){he.style.display="inline-block",xe.emit("show")}function A(){"none"!==he.style.display&&(he.style.display="none",xe.emit("hide"))}function x(){return _(),V(),S(!ce.date),I(),xe}function D(){return k(),setTimeout(A,0),xe}function R(){return k(),f.contains(he,ce.styles.positioned)&&setTimeout(A,0),xe}function M(e){var t=e.target;if(t===xe.associated)return!0;for(;t;){if(t===he)return!0;t=t.parentNode}}function N(e){M(e)||R()}function O(e){M(e)||R()}function P(){F("subtract")}function L(){F("add")}function F(e){var t,n="add"===e?-1:1,i=ce.monthsInCalendar+n*re(_e);fe[e](i,"months"),t=Z(fe.clone()),ue=t||ue,t&&(fe=t.clone()),j(),xe.emit("add"===e?"next":"back",ue.month())}function j(e){B(),q(),!0!==e&&z(),T()}function B(){function e(e,t){var n=fe.clone().add(t,"months");s(e.label,n.format(ce.monthFormat)),W(e.body)}if(ce.date&&Ce){var t=fe.year(),n=fe.month();if(fe.date()!==ye||n!==ve||t!==me){var i=H();if(ye=fe.date(),ve=fe.month(),me=fe.year(),i)return void U();Ie.forEach(e),Y()}}}function U(){function e(e){var t,n=[];for(t=0;t<e.length;t++)n.push(e[t]);return n}function t(t){return e(t.children)}function n(e){return!f.contains(e,ce.styles.dayPrevMonth)&&!f.contains(e,ce.styles.dayNextMonth)}var i=fe.date()-1;ie(!1),Ie.forEach((function(r){var a;$(r.date,fe)&&(a=e(r.body.children).map(t),ie((a=Array.prototype.concat.apply([],a).filter(n))[i]))}))}function H(){function e(e){return!!me&&$(e.date,fe)}return Ie.some(e)}function $(e,t){return e&&t&&e.year()===t.year()&&e.month()===t.month()}function q(){ce.time&&Ce&&s(Te,ue.format(ce.timeFormat))}function z(){return xe.emit("data",le()),xe.emit("year",ue.year()),xe.emit("month",ue.month()),xe.emit("day",ue.day()),xe.emit("time",ue.format(ce.timeFormat)),xe}function V(){return me=!1,ve=!1,ye=!1,j(!0),xe}function G(e){var t=l(e,ce.inputFormat);if(null!==t)return ue=Z(t)||ue,fe=ue.clone(),j(!0),xe}function W(e,t){for(;e&&e.firstChild;)e.removeChild(e.firstChild);!0===t&&e.parentNode.removeChild(e)}function Y(){var e;for(e=0;e<ce.monthsInCalendar;e++)K(e)}function K(e){function t(e){var t,i,r;for(t=0;t<e.length;t++)f.children.length===ge&&(f=o({type:"tr",className:ce.styles.dayRow,parent:a.body})),i=e.base.clone().add(t,"days"),r=o({type:"td",parent:f,text:i.format(ce.dayFormat),className:n(i,e.cell.join(" ").split(" ")).join(" ")}),e.selectable&&i.date()===d&&ie(r)}function n(e,t){return X(e,!0,ce.dateValidator)||t.push(g),t}function i(e,t){return e&&t.push(ce.styles.dayConcealed),t}var r,a=Ie[e],s=fe.clone().add(e,"months"),l=s.daysInMonth(),d=s.month()!==ue.month()?-1:ue.date(),c=s.clone().date(1),u=w(c.day(),!0),f=o({type:"tr",className:ce.styles.dayRow,parent:a.body}),h=i(0!==e,[ce.styles.dayBodyElem,ce.styles.dayPrevMonth]),p=i(e!==ce.monthsInCalendar-1,[ce.styles.dayBodyElem,ce.styles.dayNextMonth]),g=ce.styles.dayDisabled;t({base:c.clone().subtract(u,"days"),length:u,cell:h}),t({base:c.clone(),length:l,cell:[ce.styles.dayBodyElem],selectable:!0}),t({base:r=c.clone().add(l,"days"),length:ge-f.children.length,cell:p}),Ee.disabled=!Q(c,!0),we.disabled=!J(r,!0),a.date=s.clone()}function X(e,t,n){return!!Q(e,t)&&(!!J(e,t)&&!1!==(n||Function.prototype).call(xe,e.toDate()))}function Q(e,t){var n=!!ce.min&&(t?ce.min.clone().startOf("day"):ce.min);return!n||!e.isBefore(n)}function J(e,t){var n=!!ce.max&&(t?ce.max.clone().endOf("day"):ce.max);return!n||!e.isAfter(n)}function Z(e){if(ce.min&&e.isBefore(ce.min))return Z(ce.min.clone());if(ce.max&&e.isAfter(ce.max))return Z(ce.max.clone());var t=e.clone().subtract(1,"days");return te(t,e,"add")?ee(t):te(t=e.clone(),e,"subtract")?ee(t):void 0}function ee(e){var t,n=e.clone().subtract(ce.timeInterval,"seconds"),i=Math.ceil(Ae/ce.timeInterval);for(t=0;i>t;t++)if(n.add(ce.timeInterval,"seconds"),n.date()>e.date()&&n.subtract(1,"days"),!1!==ce.timeValidator.call(xe,n.toDate()))return n}function te(e,t,n){for(var i=!1;!1===i&&(e[n](1,"days"),e.month()===t.month());)i=ce.dateValidator.call(xe,e.toDate());return!1!==i}function ne(e){var t=e.target;if(!f.contains(t,ce.styles.dayDisabled)&&f.contains(t,ce.styles.dayBodyElem)){var n=parseInt(s(t),10),i=f.contains(t,ce.styles.dayPrevMonth),r=f.contains(t,ce.styles.dayNextMonth),a=re(t)-re(_e);ue.add(a,"months"),(i||r)&&ue.add(i?-1:1,"months"),ie(t),ue.date(n),ae(ue,Z(ue)||ue),fe=ue.clone(),!0===ce.autoClose&&R(),j()}}function ie(e){_e&&f.remove(_e,ce.styles.selectedDay),e&&f.add(e,ce.styles.selectedDay),_e=e}function re(e){for(var t;e&&e.getAttribute;){if("string"==typeof(t=e.getAttribute(ke)))return parseInt(t,10);e=e.parentNode}return 0}function ae(e,t){return e.hour(t.hour()).minute(t.minute()).second(t.second()),e}function oe(e){var t=e.target;if(f.contains(t,ce.styles.timeOption)){var n=u.moment(s(t),ce.timeFormat);ae(ue,n),fe=ue.clone(),z(),q(),!ce.date&&!0===ce.autoClose||"time"===ce.autoClose?R():k()}}function se(){return ue.toDate()}function le(e){return ue.format(e||ce.inputFormat)}function de(){return ue.clone()}var ce,ue,fe,he,pe,ge,me,ve,ye,_e,be,Ee,we,Te,Se,Ce=!1,ke="data-rome-offset",Ie=[],Ae=86400,xe=a({associated:e.associated});return n(),setTimeout(p,0),xe}var i,r=e("crossvent"),a=e("contra/emitter"),o=e("./dom"),s=e("./text"),l=e("./parse"),d=e("./clone"),c=e("./defaults"),u=e("./momentum"),f=e("./classes"),h=e("./noop");t.exports=n},{"./classes":22,"./clone":23,"./defaults":25,"./dom":26,"./momentum":31,"./noop":32,"./parse":33,"./text":45,"contra/emitter":14,crossvent:18}],22:[function(e,t){"use strict";function n(e){return e.className.replace(s,"").split(l)}function i(e,t){e.className=t.join(" ")}function r(e,t){var n=a(e,t);n.push(t),i(e,n)}function a(e,t){var r=n(e),a=r.indexOf(t);return-1!==a&&(r.splice(a,1),i(e,r)),r}function o(e,t){return-1!==n(e).indexOf(t)}var s=/^\s+|\s+$/g,l=/\s+/;t.exports={add:r,remove:a,contains:o}},{}],23:[function(e,t){"use strict";function n(e){var t,r={};for(var a in e)t=e[a],r[a]=t?i.isMoment(t)?t.clone():t._isStylesConfiguration?n(t):t:t;return r}var i=e("./momentum");t.exports=n},{"./momentum":31}],24:[function(e,t){"use strict";function n(e,t){var n,s=i.find(e);return s||(n=o(e)?r(e,t):a(e,t),i.assign(e,n),n)}var i=e("./index"),r=e("./input"),a=e("./inline"),o=e("./isInput");t.exports=n},{"./index":27,"./inline":28,"./input":29,"./isInput":30}],25:[function(e,t){"use strict";function n(e,t){var n,o,s=e||{};if(s.autoHideOnClick===o&&(s.autoHideOnClick=!0),s.autoHideOnBlur===o&&(s.autoHideOnBlur=!0),s.autoClose===o&&(s.autoClose=!0),s.appendTo===o&&(s.appendTo=document.body),"parent"===s.appendTo){if(!r(t.associated))throw new Error("Inline calendars must be appended to a parent node explicitly.");s.appendTo=t.associated.parentNode}if(s.invalidate===o&&(s.invalidate=!0),s.required===o&&(s.required=!1),s.date===o&&(s.date=!0),s.time===o&&(s.time=!0),!1===s.date&&!1===s.time)throw new Error("At least one of `date` or `time` must be `true`.");if(s.inputFormat===o&&(s.inputFormat=s.date&&s.time?"YYYY-MM-DD HH:mm":s.date?"YYYY-MM-DD":"HH:mm"),s.initialValue=s.initialValue===o?null:i(s.initialValue,s.inputFormat),s.min=s.min===o?null:i(s.min,s.inputFormat),s.max=s.max===o?null:i(s.max,s.inputFormat),s.timeInterval===o&&(s.timeInterval=1800),s.min&&s.max)if(s.max.isBefore(s.min)&&(n=s.max,s.max=s.min,s.min=n),!0===s.date){if(s.max.clone().subtract(1,"days").isBefore(s.min))throw new Error("`max` must be at least one day after `min`")}else if(1e3*s.timeInterval-s.min%(1e3*s.timeInterval)>s.max-s.min)throw new Error("`min` to `max` range must allow for at least one time option that matches `timeInterval`");if(s.dateValidator===o&&(s.dateValidator=Function.prototype),s.timeValidator===o&&(s.timeValidator=Function.prototype),s.timeFormat===o&&(s.timeFormat="HH:mm"),s.weekStart===o&&(s.weekStart=a.moment().weekday(0).day()),s.weekdayFormat===o&&(s.weekdayFormat="min"),"long"===s.weekdayFormat)s.weekdayFormat=a.moment.weekdays();else if("short"===s.weekdayFormat)s.weekdayFormat=a.moment.weekdaysShort();else if("min"===s.weekdayFormat)s.weekdayFormat=a.moment.weekdaysMin();else if(!Array.isArray(s.weekdayFormat)||s.weekdayFormat.length<7)throw new Error("`weekdays` must be `min`, `short`, or `long`");s.monthsInCalendar===o&&(s.monthsInCalendar=1),s.monthFormat===o&&(s.monthFormat="MMMM YYYY"),s.dayFormat===o&&(s.dayFormat="DD"),s.styles===o&&(s.styles={}),s.styles._isStylesConfiguration=!0;var l=s.styles;return l.back===o&&(l.back="rd-back"),l.container===o&&(l.container="rd-container"),l.positioned===o&&(l.positioned="rd-container-attachment"),l.date===o&&(l.date="rd-date"),l.dayBody===o&&(l.dayBody="rd-days-body"),l.dayBodyElem===o&&(l.dayBodyElem="rd-day-body"),l.dayPrevMonth===o&&(l.dayPrevMonth="rd-day-prev-month"),l.dayNextMonth===o&&(l.dayNextMonth="rd-day-next-month"),l.dayDisabled===o&&(l.dayDisabled="rd-day-disabled"),l.dayConcealed===o&&(l.dayConcealed="rd-day-concealed"),l.dayHead===o&&(l.dayHead="rd-days-head"),l.dayHeadElem===o&&(l.dayHeadElem="rd-day-head"),l.dayRow===o&&(l.dayRow="rd-days-row"),l.dayTable===o&&(l.dayTable="rd-days"),l.month===o&&(l.month="rd-month"),l.monthLabel===o&&(l.monthLabel="rd-month-label"),l.next===o&&(l.next="rd-next"),l.selectedDay===o&&(l.selectedDay="rd-day-selected"),l.selectedTime===o&&(l.selectedTime="rd-time-selected"),l.time===o&&(l.time="rd-time"),l.timeList===o&&(l.timeList="rd-time-list"),l.timeOption===o&&(l.timeOption="rd-time-option"),s}var i=e("./parse"),r=e("./isInput"),a=e("./momentum");t.exports=n},{"./isInput":30,"./momentum":31,"./parse":33}],26:[function(e,t){"use strict";function n(e){var t=e||{};t.type||(t.type="div");var n=document.createElement(t.type);return t.className&&(n.className=t.className),t.text&&(n.innerText=n.textContent=t.text),t.attributes&&Object.keys(t.attributes).forEach((function(e){n.setAttribute(e,t.attributes[e])})),t.parent&&t.parent.appendChild(n),n}t.exports=n},{}],27:[function(e,t){"use strict";function n(e){if("number"!=typeof e&&e&&e.getAttribute)return n(e.getAttribute(a));var t=o[e];return t!==r?t:null}function i(e,t){e.setAttribute(a,t.id=o.push(t)-1)}var r,a="data-rome-id",o=[];t.exports={find:n,assign:i}},{}],28:[function(e,t){"use strict";function n(e,t){var n=t||{};n.appendTo=e,n.associated=e;var r=i(n);return r.show(),r}var i=e("./calendar");t.exports=n},{"./calendar":21}],29:[function(e,t){"use strict";function n(e,t){function n(t){b=o(t||b,S),d.add(S.container,b.styles.positioned),i.add(S.container,"mousedown",h),i.add(S.container,"click",f),S.getDate=_(S.getDate),S.getDateString=_(S.getDateString),S.getMoment=_(S.getMoment),b.initialValue&&(e.value=b.initialValue.format(b.inputFormat)),T=r(S.container,e),S.on("data",v),S.on("show",T.refresh),u(),C()}function c(){u(!0),T.destroy(),T=null}function u(t){var r=t?"remove":"add";i[r](e,"click",g),i[r](e,"touchend",g),i[r](e,"focusin",g),i[r](e,"change",C),i[r](e,"keypress",C),i[r](e,"keydown",C),i[r](e,"input",C),b.invalidate&&i[r](e,"blur",p),t?(S.once("ready",n),S.off("destroyed",c)):(S.off("ready",n),S.once("destroyed",c))}function f(){w=!0,e.focus(),w=!1}function h(){function e(){E=!1}E=!0,setTimeout(e,0)}function p(){E||y()||S.emitValues()}function g(){w||S.show()}function m(){var t=e.value.trim();if(!y()){var n=l.moment(t,b.inputFormat,b.strictParse);S.setValue(n)}}function v(t){e.value=t}function y(){return!1===b.required&&""===e.value.trim()}function _(e){return function(){return y()?null:e.apply(this,arguments)}}var b=t||{};b.associated=e;var E,w,T,S=s(b),C=a(m,30);return n(b),S}var i=e("crossvent"),r=e("bullseye"),a=e("./throttle"),o=(e("./clone"),e("./defaults")),s=e("./calendar"),l=e("./momentum"),d=e("./classes");t.exports=n},{"./calendar":21,"./classes":22,"./clone":23,"./defaults":25,"./momentum":31,"./throttle":46,bullseye:1,crossvent:18}],30:[function(e,t){"use strict";function n(e){return e&&e.nodeName&&"input"===e.nodeName.toLowerCase()}t.exports=n},{}],31:[function(e,t){"use strict";function n(e){return e&&Object.prototype.hasOwnProperty.call(e,"_isAMomentObject")}var i={moment:null,isMoment:n};t.exports=i},{}],32:[function(e,t){"use strict";function n(){}t.exports=n},{}],33:[function(e,t){"use strict";function n(e,t){return"string"==typeof e?r.moment(e,t):"[object Date]"===Object.prototype.toString.call(e)?r.moment(e):r.isMoment(e)?e.clone():void 0}function i(e,t){var i=n(e,"string"==typeof t?t:null);return i&&i.isValid()?i:null}var r=e("./momentum");t.exports=i},{"./momentum":31}],34:[function(){"use strict";Array.prototype.filter||(Array.prototype.filter=function(e,t){var n=[];return this.forEach((function(i,r,a){e.call(t,i,r,a)&&n.push(i)}),t),n})},{}],35:[function(){"use strict";Array.prototype.forEach||(Array.prototype.forEach=function(e,t){if(null==this||"function"!=typeof e)throw new TypeError;for(var n=this,i=n.length,r=0;i>r;r++)r in n&&e.call(t,n[r],r,n)})},{}],36:[function(){"use strict";Array.prototype.indexOf||(Array.prototype.indexOf=function(e,t){if(null==this)throw new TypeError;var n=this.length;for(t=+t||0,1/0===Math.abs(t)?t=0:0>t&&(0>(t+=n)&&(t=0));n>t;t++)if(this[t]===e)return t;return-1})},{}],37:[function(){"use strict";Array.isArray||(Array.isArray=function(e){return""+e!==e&&"[object Array]"===Object.prototype.toString.call(e)})},{}],38:[function(){"use strict";Array.prototype.map||(Array.prototype.map=function(e,t){var n,i,r;if(null==this)throw new TypeError("this is null or not defined");var a=Object(this),o=a.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),i=new Array(o),r=0;o>r;)r in a&&(i[r]=e.call(n,a[r],r,a)),r++;return i})},{}],39:[function(){"use strict";Array.prototype.some||(Array.prototype.some=function(e,t){var n,i;if(null==this)throw new TypeError("this is null or not defined");var r=Object(this),a=r.length>>>0;if("function"!=typeof e)throw new TypeError(e+" is not a function");for(arguments.length>1&&(n=t),i=0;a>i;){if(i in r)if(e.call(n,r[i],i,r))return!0;i++}return!1})},{}],40:[function(){"use strict";Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var t=Array.prototype.slice.call(arguments,1),n=this,i=function(){},r=function(){var r=this instanceof i&&e?this:e,a=t.concat(Array.prototype.slice.call(arguments));return n.apply(r,a)};return i.prototype=this.prototype,r.prototype=new i,r})},{}],41:[function(){"use strict";var e=Object.prototype.hasOwnProperty,t=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=n.length;Object.keys||(Object.keys=function(r){if("object"!=typeof r&&("function"!=typeof r||null===r))throw new TypeError("Object.keys called on non-object");var a,o,s=[];for(a in r)e.call(r,a)&&s.push(a);if(t)for(o=0;i>o;o++)e.call(r,n[o])&&s.push(n[o]);return s})},{}],42:[function(){"use strict";String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})},{}],43:[function(e,t){"use strict";e("./polyfills/function.bind"),e("./polyfills/array.foreach"),e("./polyfills/array.map"),e("./polyfills/array.filter"),e("./polyfills/array.isarray"),e("./polyfills/array.indexof"),e("./polyfills/array.some"),e("./polyfills/string.trim"),e("./polyfills/object.keys");var n=e("./core"),i=e("./index"),r=e("./use");n.use=r.bind(n),n.find=i.find,n.val=e("./validators"),t.exports=n},{"./core":24,"./index":27,"./polyfills/array.filter":34,"./polyfills/array.foreach":35,"./polyfills/array.indexof":36,"./polyfills/array.isarray":37,"./polyfills/array.map":38,"./polyfills/array.some":39,"./polyfills/function.bind":40,"./polyfills/object.keys":41,"./polyfills/string.trim":42,"./use":47,"./validators":48}],44:[function(e,t){(function(n){var i=e("./rome"),r=e("./momentum");if(i.use(n.moment),void 0===r.moment)throw new Error("rome depends on moment.js, you can get it at http://momentjs.com, or you could use the bundled distribution file instead.");t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./momentum":31,"./rome":43}],45:[function(e,t){"use strict";function n(e,t){return 2===arguments.length&&(e.innerText=e.textContent=t),e.innerText||e.textContent}t.exports=n},{}],46:[function(e,t){"use strict";t.exports=function(e,t){var n,i=-1/0;return function(){function r(){clearTimeout(n),n=null;var a=i+t,o=+new Date;o>a?(i=o,e.apply(this,arguments)):n=setTimeout(r,a-o)}n||r()}}},{}],47:[function(e,t){"use strict";function n(e){this.moment=i.moment=e}var i=e("./momentum");t.exports=n},{"./momentum":31}],48:[function(e,t){"use strict";function n(e){return function(t){var n=a(t);return function(i){var s=r.find(t),l=a(i),d=n||s&&s.getMoment();return!d||(s&&o.add(this,s),e(l,d))}}}function i(e,t){return function(n,i){function s(e){var t,n,i=r.find(e);return i?t=n=i.getMoment():Array.isArray(e)?(t=e[0],n=e[1]):t=n=e,i&&o.add(i,this),{start:a(t).startOf("day").toDate(),end:a(n).endOf("day").toDate()}}var l,d=arguments.length;return Array.isArray(n)?l=n:1===d?l=[n]:2===d&&(l=[[n,i]]),function(n){return l.map(s.bind(this))[e](t.bind(this,n))}}}var r=e("./index"),a=e("./parse"),o=e("./association"),s=n((function(e,t){return e>=t})),l=n((function(e,t){return e>t})),d=n((function(e,t){return t>=e})),c=n((function(e,t){return t>e})),u=i("every",(function(e,t){return t.start>e||t.end<e})),f=i("some",(function(e,t){return t.start<=e&&t.end>=e}));t.exports={afterEq:s,after:l,beforeEq:d,before:c,except:u,only:f}},{"./association":20,"./index":27,"./parse":33}]},{},[44])(44)})),function(){function e(n){this.extend(e,google.maps.OverlayView),this.b=[],this.d=null,this.g=100,this.m=!1,null==(n=n||{}).backgroundColor&&(n.backgroundColor=this.A),null==n.borderColor&&(n.borderColor=this.B),null==n.borderRadius&&(n.borderRadius=this.C),null==n.borderWidth&&(n.borderWidth=this.D),null==n.padding&&(n.padding=this.H),null==n.arrowPosition&&(n.arrowPosition=this.u),null==n.disableAutoPan&&(n.disableAutoPan=!1),null==n.disableAnimation&&(n.disableAnimation=!1),null==n.minWidth&&(n.minWidth=this.G),null==n.shadowStyle&&(n.shadowStyle=this.I),null==n.arrowSize&&(n.arrowSize=this.v),null==n.arrowStyle&&(n.arrowStyle=this.w),null==n.closeSrc&&(n.closeSrc=this.F),t(this),this.setValues(n)}function t(e){var t=e.c=document.createElement("DIV");t.style.position="absolute",t.style.zIndex=e.g,(e.i=document.createElement("DIV")).style.position="relative";var i=e.j=document.createElement("IMG");i.style.position="absolute",i.style.border=0,i.style.zIndex=e.g+1,i.style.cursor="pointer",i.src=e.get("closeSrc"),google.maps.event.addDomListener(i,"click",(function(){e.close(),google.maps.event.trigger(e,"closeclick")}));var r=e.e=document.createElement("DIV");r.style.overflowX="auto",r.style.overflowY="auto",r.style.cursor="default",r.style.clear="both",r.style.position="relative";var a=e.k=document.createElement("DIV");r.appendChild(a),(a=e.N=document.createElement("DIV")).style.position="relative";var s=e.n=document.createElement("DIV"),l=e.l=document.createElement("DIV"),d=n(e);s.style.position=l.style.position="absolute",s.style.left=l.style.left="50%",s.style.height=l.style.height="0",s.style.width=l.style.width="0",s.style.marginLeft=o(-d),s.style.borderWidth=o(d),s.style.borderBottomWidth=0,(d=e.a=document.createElement("DIV")).style.position="absolute",t.style.display=d.style.display="none",t.appendChild(e.i),t.appendChild(i),t.appendChild(r),a.appendChild(s),a.appendChild(l),t.appendChild(a),(t=document.createElement("style")).setAttribute("type","text/css"),e.h="_ibani_"+Math.round(1e4*Math.random()),t.textContent="."+e.h+"{-webkit-animation-name:"+e.h+";-webkit-animation-duration:0.5s;-webkit-animation-iteration-count:1;}@-webkit-keyframes "+e.h+" {from {-webkit-transform: scale(0)}50% {-webkit-transform: scale(1.2)}90% {-webkit-transform: scale(0.95)}to {-webkit-transform: scale(1)}}",document.getElementsByTagName("head")[0].appendChild(t)}function n(e){return parseInt(e.get("arrowSize"),10)||0}function i(e){return parseInt(e.get("borderRadius"),10)||0}function r(e){return parseInt(e.get("borderWidth"),10)||0}function a(e){return parseInt(e.get("padding"),10)||0}function o(e){return e?e+"px":e}function s(e){var t="mousedown mousemove mouseover mouseout mouseup mousewheel DOMMouseScroll touchstart touchend touchmove dblclick contextmenu click".split(" "),n=e.c;e.s=[];for(var i,r=0;i=t[r];r++)e.s.push(google.maps.event.addDomListener(n,i,(function(e){e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation()})))}function l(e,t,n){u(e),t&&e.setMap(t),n&&(e.set("anchor",n),e.bindTo("anchorPoint",n),e.bindTo("position",n)),e.c.style.display=e.a.style.display="",e.get("disableAnimation")||(e.c.className+=" "+e.h,e.a.className+=" "+e.h),v(e),e.m=!0,e.get("disableAutoPan")||window.setTimeout((function(){e.o()}),200)}function d(e){e=e.replace(/^\s*([\S\s]*)\b\s*$/,"$1");var t=document.createElement("DIV");if(t.innerHTML=e,1==t.childNodes.length)return t.removeChild(t.firstChild);for(e=document.createDocumentFragment();t.firstChild;)e.appendChild(t.firstChild);return e}function c(e){if(e)for(var t;t=e.firstChild;)e.removeChild(t)}function u(e){if(e.k){if(c(e.k),n=e.getContent()){"string"==typeof n&&(n=d(n)),e.k.appendChild(n);for(var t,n=e.k.getElementsByTagName("IMG"),i=0;t=n[i];i++)google.maps.event.addDomListener(t,"load",(function(){var t=!e.get("disableAutoPan");v(e),!t||0!=e.b.length&&0!=e.d.index||e.o()}));google.maps.event.trigger(e,"domready")}v(e)}}function f(e){if(e.b&&e.b.length){for(var t,n=0;t=e.b[n];n++)h(e,t.f);e.d.style.zIndex=e.g,n=r(e),t=a(e)/2,e.d.style.borderBottomWidth=0,e.d.style.paddingBottom=o(t+n)}}function h(e,t){var n=e.get("backgroundColor"),s=e.get("borderColor"),l=i(e),d=r(e),c=a(e),u=o(-Math.max(c,l)),f=(l=o(l),e.g);t.index&&(f-=t.index);var h;n={cssFloat:"left",position:"relative",cursor:"pointer",backgroundColor:n,border:o(d)+" solid "+s,padding:o(c/2)+" "+o(c),marginRight:u,whiteSpace:"nowrap",borderRadiusTopLeft:l,MozBorderRadiusTopleft:l,webkitBorderTopLeftRadius:l,borderRadiusTopRight:l,MozBorderRadiusTopright:l,webkitBorderTopRightRadius:l,zIndex:f,display:"inline"};for(h in n)t.style[h]=n[h];null!=(h=e.get("tabClassName"))&&(t.className+=" "+h)}function p(e,t){t.U=google.maps.event.addDomListener(t,"click",(function(){g(e,this)}))}function g(e,t){if(t){var n=a(e)/2,i=r(e);if(e.d){var s=e.d;s.style.zIndex=e.g-s.index,s.style.paddingBottom=o(n),s.style.borderBottomWidth=o(i)}t.style.zIndex=e.g,t.style.borderBottomWidth=0,t.style.marginBottomWidth="-10px",t.style.paddingBottom=o(n+i),e.setContent(e.b[t.index].content),u(e),e.d=t,v(e)}else e.setContent(""),u(e)}function m(e,t,n){var i=document.createElement("DIV");return i.style.display="inline",i.style.position="absolute",i.style.visibility="hidden","string"==typeof e?i.innerHTML=e:i.appendChild(e.cloneNode(!0)),document.body.appendChild(i),e=new google.maps.Size(i.offsetWidth,i.offsetHeight),t&&e.width>t&&(i.style.width=o(t),e=new google.maps.Size(i.offsetWidth,i.offsetHeight)),n&&e.height>n&&(i.style.height=o(n),e=new google.maps.Size(i.offsetWidth,i.offsetHeight)),document.body.removeChild(i),delete i,e}function v(e){if(c=e.get("map")){var t=a(e);r(e),i(e);var s=n(e),l=2*s,c=(u=c.getDiv()).offsetWidth-l,u=u.offsetHeight-l-y(e),f=(l=0,e.get("minWidth")||0),h=e.get("minHeight")||0,p=e.get("maxWidth")||0,g=e.get("maxHeight")||0,v=(p=Math.min(c,p),g=Math.min(u,g),0);if(e.b.length)for(var _,b=0;_=e.b[b];b++){var E=m(_.f,p,g);_=m(_.content,p,g),f<E.width&&(f=E.width),v+=E.width,h<E.height&&(h=E.height),E.height>l&&(l=E.height),f<_.width&&(f=_.width),h<_.height&&(h=_.height)}else"string"==typeof(b=e.get("content"))&&(b=d(b)),b&&(f<(_=m(b,p,g)).width&&(f=_.width),h<_.height&&(h=_.height));p&&(f=Math.min(f,p)),g&&(h=Math.min(h,g)),(f=Math.max(f,v))==v&&(f+=2*t),(f=Math.max(f,2*s))>c&&(f=c),h>u&&(h=u-l),e.i&&(e.t=l,e.i.style.width=o(v)),e.e.style.width=o(f),e.e.style.height=o(h)}i(e),t=r(e),c=2,e.b.length&&e.t&&(c+=e.t),s=2+t,(u=e.e)&&u.clientHeight<u.scrollHeight&&(s+=15),e.j.style.right=o(s),e.j.style.top=o(c+t),e.draw()}function y(e){return e.get("anchor")&&(e=e.get("anchorPoint"))?-1*e.y:0}var _;window.InfoBubble=e,(_=e.prototype).v=15,_.w=0,_.I=1,_.G=50,_.u=50,_.H=10,_.D=1,_.B="#ccc",_.C=10,_.A="#fff",_.F="https://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif",_.extend=function(e,t){return function(e){for(var t in e.prototype)this.prototype[t]=e.prototype[t];return this}.apply(e,[t])},_.ea=function(e){this.set("backgroundClassName",e)},e.prototype.setBackgroundClassName=e.prototype.ea,e.prototype.O=function(){this.k.className=this.get("backgroundClassName")},e.prototype.backgroundClassName_changed=e.prototype.O,e.prototype.pa=function(e){this.set("tabClassName",e)},e.prototype.setTabClassName=e.prototype.pa,e.prototype.sa=function(){f(this)},e.prototype.tabClassName_changed=e.prototype.sa,e.prototype.da=function(e){this.set("arrowStyle",e)},e.prototype.setArrowStyle=e.prototype.da,e.prototype.M=function(){this.p()},e.prototype.arrowStyle_changed=e.prototype.M,e.prototype.ca=function(e){this.set("arrowSize",e)},e.prototype.setArrowSize=e.prototype.ca,e.prototype.p=function(){this.r()},e.prototype.arrowSize_changed=e.prototype.p,e.prototype.ba=function(e){this.set("arrowPosition",e)},e.prototype.setArrowPosition=e.prototype.ba,e.prototype.L=function(){var e=parseInt(this.get("arrowPosition"),10)||0;this.n.style.left=this.l.style.left=e+"%",v(this)},e.prototype.arrowPosition_changed=e.prototype.L,e.prototype.setZIndex=function(e){this.set("zIndex",e)},e.prototype.setZIndex=e.prototype.setZIndex,e.prototype.getZIndex=function(){return parseInt(this.get("zIndex"),10)||this.g},e.prototype.ua=function(){var e=this.getZIndex()
;this.c.style.zIndex=this.g=e,this.j.style.zIndex=e+1},e.prototype.zIndex_changed=e.prototype.ua,e.prototype.na=function(e){this.set("shadowStyle",e)},e.prototype.setShadowStyle=e.prototype.na,e.prototype.qa=function(){var e="",t="",n="";switch(parseInt(this.get("shadowStyle"),10)||0){case 0:e="none";break;case 1:t="40px 15px 10px rgba(33,33,33,0.3)",n="transparent";break;case 2:t="0 0 2px rgba(33,33,33,0.3)",n="rgba(33,33,33,0.35)"}this.a.style.boxShadow=this.a.style.webkitBoxShadow=this.a.style.MozBoxShadow=t,this.a.style.backgroundColor=n,this.m&&(this.a.style.display=e,this.draw())},e.prototype.shadowStyle_changed=e.prototype.qa,e.prototype.ra=function(){this.set("hideCloseButton",!1)},e.prototype.showCloseButton=e.prototype.ra,e.prototype.R=function(){this.set("hideCloseButton",!0)},e.prototype.hideCloseButton=e.prototype.R,e.prototype.S=function(){this.j.style.display=this.get("hideCloseButton")?"none":""},e.prototype.hideCloseButton_changed=e.prototype.S,e.prototype.setBackgroundColor=function(e){e&&this.set("backgroundColor",e)},e.prototype.setBackgroundColor=e.prototype.setBackgroundColor,e.prototype.P=function(){var e=this.get("backgroundColor");this.e.style.backgroundColor=e,this.l.style.borderColor=e+" transparent transparent",f(this)},e.prototype.backgroundColor_changed=e.prototype.P,e.prototype.setBorderColor=function(e){e&&this.set("borderColor",e)},e.prototype.setBorderColor=e.prototype.setBorderColor,e.prototype.Q=function(){var e=this.get("borderColor"),t=this.e,n=this.n;t.style.borderColor=e,n.style.borderColor=e+" transparent transparent",t.style.borderStyle=n.style.borderStyle=this.l.style.borderStyle="solid",f(this)},e.prototype.borderColor_changed=e.prototype.Q,e.prototype.fa=function(e){this.set("borderRadius",e)},e.prototype.setBorderRadius=e.prototype.fa,e.prototype.q=function(){var e=i(this),t=r(this);this.e.style.borderRadius=this.e.style.MozBorderRadius=this.e.style.webkitBorderRadius=this.a.style.borderRadius=this.a.style.MozBorderRadius=this.a.style.webkitBorderRadius=o(e),this.i.style.paddingLeft=this.i.style.paddingRight=o(e+t),v(this)},e.prototype.borderRadius_changed=e.prototype.q,e.prototype.ga=function(e){this.set("borderWidth",e)},e.prototype.setBorderWidth=e.prototype.ga,e.prototype.r=function(){var e=r(this);this.e.style.borderWidth=o(e),this.i.style.top=o(e);e=r(this);var t=n(this),i=parseInt(this.get("arrowStyle"),10)||0,a=o(t),s=o(Math.max(0,t-e)),l=this.n,d=this.l;this.N.style.marginTop=o(-e),l.style.borderTopWidth=a,d.style.borderTopWidth=s,0==i||1==i?(l.style.borderLeftWidth=a,d.style.borderLeftWidth=s):l.style.borderLeftWidth=d.style.borderLeftWidth=0,0==i||2==i?(l.style.borderRightWidth=a,d.style.borderRightWidth=s):l.style.borderRightWidth=d.style.borderRightWidth=0,2>i?(l.style.marginLeft=o(-t),d.style.marginLeft=o(-(t-e))):l.style.marginLeft=d.style.marginLeft=0,l.style.display=0==e?"none":"",f(this),this.q(),v(this)},e.prototype.borderWidth_changed=e.prototype.r,e.prototype.ma=function(e){this.set("padding",e)},e.prototype.setPadding=e.prototype.ma,e.prototype.ha=function(e){e&&this.j&&(this.j.src=e)},e.prototype.setCloseSrc=e.prototype.ha,e.prototype.Z=function(){var e=a(this);this.e.style.padding=o(e),f(this),v(this)},e.prototype.padding_changed=e.prototype.Z,e.prototype.onAdd=function(){this.c||t(this),s(this);var e=this.getPanes();e&&(e.floatPane.appendChild(this.c),e.floatShadow.appendChild(this.a))},e.prototype.onAdd=e.prototype.onAdd,e.prototype.draw=function(){if(a=this.getProjection())if(s=this.get("position")){var e=0;this.d&&(e=this.d.offsetHeight);var t=y(this),i=n(this),r=(r=parseInt(this.get("arrowPosition"),10)||0)/100,a=a.fromLatLngToDivPixel(s),s=this.e.offsetWidth,l=this.c.offsetHeight;if(s){l=a.y-(l+i),t&&(l-=t);var d=a.x-s*r;switch(this.c.style.top=o(l),this.c.style.left=o(d),parseInt(this.get("shadowStyle"),10)){case 1:this.a.style.top=o(l+e-1),this.a.style.left=o(d),this.a.style.width=o(s),this.a.style.height=o(this.e.offsetHeight-i);break;case 2:s*=.8,this.a.style.top=o(t?a.y:a.y+i),this.a.style.left=o(a.x-s*r),this.a.style.width=o(s),this.a.style.height=o(2)}}}else this.close()},e.prototype.draw=e.prototype.draw,e.prototype.onRemove=function(){this.c&&this.c.parentNode&&this.c.parentNode.removeChild(this.c),this.a&&this.a.parentNode&&this.a.parentNode.removeChild(this.a);for(var e,t=0;e=this.s[t];t++)google.maps.event.removeListener(e)},e.prototype.onRemove=e.prototype.onRemove,e.prototype.T=function(){return this.m},e.prototype.isOpen=e.prototype.T,e.prototype.close=function(){this.c&&(this.c.style.display="none",this.c.className=this.c.className.replace(this.h,"")),this.a&&(this.a.style.display="none",this.a.className=this.a.className.replace(this.h,"")),this.m=!1},e.prototype.close=e.prototype.close,e.prototype.open=function(e,t){var n=this;window.setTimeout((function(){l(n,e,t)}),0)},e.prototype.open=e.prototype.open,e.prototype.setPosition=function(e){e&&this.set("position",e)},e.prototype.setPosition=e.prototype.setPosition,e.prototype.getPosition=function(){return this.get("position")},e.prototype.getPosition=e.prototype.getPosition,e.prototype.$=function(){this.draw()},e.prototype.position_changed=e.prototype.$,e.prototype.o=function(){var e=this.getProjection();if(e&&this.c){var t=y(this),n=this.c.offsetHeight+t,i=(t=this.get("map")).getDiv().offsetHeight,r=this.getPosition(),a=e.fromLatLngToContainerPixel(t.getCenter());r=e.fromLatLngToContainerPixel(r),n=a.y-n,i=i-a.y,a=0;0>n&&(a=(-1*n+i)/2),r.y-=a,r=e.fromContainerPixelToLatLng(r),t.getCenter()!=r&&t.panTo(r)}},e.prototype.panToView=e.prototype.o,e.prototype.setContent=function(e){this.set("content",e)},e.prototype.setContent=e.prototype.setContent,e.prototype.getContent=function(){return this.get("content")},e.prototype.getContent=e.prototype.getContent,e.prototype.oa=function(e){(e=this.b[e-1])&&g(this,e.f)},e.prototype.setTabActive=e.prototype.oa,e.prototype.ja=function(e){this.set("maxWidth",e)},e.prototype.setMaxWidth=e.prototype.ja,e.prototype.W=function(){v(this)},e.prototype.maxWidth_changed=e.prototype.W,e.prototype.ia=function(e){this.set("maxHeight",e)},e.prototype.setMaxHeight=e.prototype.ia,e.prototype.V=function(){v(this)},e.prototype.maxHeight_changed=e.prototype.V,e.prototype.la=function(e){this.set("minWidth",e)},e.prototype.setMinWidth=e.prototype.la,e.prototype.Y=function(){v(this)},e.prototype.minWidth_changed=e.prototype.Y,e.prototype.ka=function(e){this.set("minHeight",e)},e.prototype.setMinHeight=e.prototype.ka,e.prototype.X=function(){v(this)},e.prototype.minHeight_changed=e.prototype.X,e.prototype.J=function(e,t){var n=document.createElement("DIV");n.innerHTML=e,h(this,n),p(this,n),this.i.appendChild(n),this.b.push({label:e,content:t,f:n}),n.index=this.b.length-1,n.style.zIndex=this.g-n.index,this.d||g(this,n),n.className=n.className+" "+this.h,v(this)},e.prototype.addTab=e.prototype.J,e.prototype.ta=function(e,t,n){!this.b.length||0>e||e>=this.b.length||(e=this.b[e],null!=t&&(e.f.innerHTML=e.label=t),null!=n&&(e.content=n),this.d==e.f&&(this.setContent(e.content),u(this)),v(this))},e.prototype.updateTab=e.prototype.ta,e.prototype.aa=function(e){if(!(!this.b.length||0>e||e>=this.b.length)){var t=this.b[e];t.f.parentNode.removeChild(t.f),google.maps.event.removeListener(t.f.U),this.b.splice(e,1),delete t;for(var n,i=0;n=this.b[i];i++)n.f.index=i;t.f==this.d&&(this.d=this.b[e]?this.b[e].f:this.b[e-1]?this.b[e-1].f:void 0,g(this,this.d)),v(this)}},e.prototype.removeTab=e.prototype.aa,e.prototype.K=function(){this.draw()},e.prototype.anchorPoint_changed=e.prototype.K}(),function(e,t){"function"==typeof define&&define.amd?define(["jquery"],(function(e){return t(e)})):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,(function(e){var t=function(){"use strict";return{isMsie:function(){return!!/(msie|trident)/i.test(navigator.userAgent)&&navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]},isBlankString:function(e){return!e||/^\s*$/.test(e)},escapeRegExChars:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isArray:e.isArray,isFunction:e.isFunction,isObject:e.isPlainObject,isUndefined:function(e){return void 0===e},isElement:function(e){return!(!e||1!==e.nodeType)},isJQuery:function(t){return t instanceof e},toStr:function(e){return t.isUndefined(e)||null===e?"":e+""},bind:e.proxy,each:function(t,n){function i(e,t){return n(t,e)}e.each(t,i)},map:e.map,filter:e.grep,every:function(t,n){var i=!0;return t?(e.each(t,(function(e,r){if(!(i=n.call(null,r,e,t)))return!1})),!!i):i},some:function(t,n){var i=!1;return t?(e.each(t,(function(e,r){if(i=n.call(null,r,e,t))return!1})),!!i):i},mixin:e.extend,identity:function(e){return e},clone:function(t){return e.extend(!0,{},t)},getIdGenerator:function(){var e=0;return function(){return e++}},templatify:function(t){function n(){return String(t)}return e.isFunction(t)?t:n},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var i,r;return function(){var a,o,s=this,l=arguments;return a=function(){i=null,n||(r=e.apply(s,l))},o=n&&!i,clearTimeout(i),i=setTimeout(a,t),o&&(r=e.apply(s,l)),r}},throttle:function(e,t){var n,i,r,a,o,s;return o=0,s=function(){o=new Date,r=null,a=e.apply(n,i)},function(){var l=new Date,d=t-(l-o);return n=this,i=arguments,d<=0?(clearTimeout(r),r=null,o=l,a=e.apply(n,i)):r||(r=setTimeout(s,d)),a}},stringify:function(e){return t.isString(e)?e:JSON.stringify(e)},guid:function(){function e(e){var t=(Math.random().toString(16)+"000000000").substr(2,8);return e?"-"+t.substr(0,4)+"-"+t.substr(4,4):t}return"tt-"+e()+e(!0)+e(!0)+e()},noop:function(){}}}(),n=function(){"use strict";function e(e){var o,s;return s=t.mixin({},a,e),{css:(o={css:r(),classes:s,html:n(s),selectors:i(s)}).css,html:o.html,classes:o.classes,selectors:o.selectors,mixin:function(e){t.mixin(e,o)}}}function n(e){return{wrapper:'<span class="'+e.wrapper+'"></span>',menu:'<div role="listbox" class="'+e.menu+'"></div>'}}function i(e){var n={};return t.each(e,(function(e,t){n[t]="."+e})),n}function r(){var e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},menu:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),e}var a={wrapper:"twitter-typeahead",input:"tt-input",hint:"tt-hint",menu:"tt-menu",dataset:"tt-dataset",suggestion:"tt-suggestion",selectable:"tt-selectable",empty:"tt-empty",open:"tt-open",cursor:"tt-cursor",highlight:"tt-highlight"};return e}(),i=function(){"use strict";function n(t){t&&t.el||e.error("EventBus initialized without el"),this.$el=e(t.el)}var i,r;return i="typeahead:",r={render:"rendered",cursorchange:"cursorchanged",select:"selected",autocomplete:"autocompleted"},t.mixin(n.prototype,{_trigger:function(t,n){var r=e.Event(i+t);return this.$el.trigger.call(this.$el,r,n||[]),r},before:function(e){var t;return t=[].slice.call(arguments,1),this._trigger("before"+e,t).isDefaultPrevented()},trigger:function(e){var t;this._trigger(e,[].slice.call(arguments,1)),(t=r[e])&&this._trigger(t,[].slice.call(arguments,1))}}),n}(),r=function(){"use strict";function e(e,t,n,i){var r;if(!n)return this;for(t=t.split(s),n=i?o(n,i):n,this._callbacks=this._callbacks||{};r=t.shift();)this._callbacks[r]=this._callbacks[r]||{sync:[],async:[]},this._callbacks[r][e].push(n);return this}function t(t,n,i){return e.call(this,"async",t,n,i)}function n(t,n,i){return e.call(this,"sync",t,n,i)}function i(e){var t;if(!this._callbacks)return this;for(e=e.split(s);t=e.shift();)delete this._callbacks[t];return this}function r(e){var t,n,i,r,o;if(!this._callbacks)return this;for(e=e.split(s),i=[].slice.call(arguments,1);(t=e.shift())&&(n=this._callbacks[t]);)r=a(n.sync,this,[t].concat(i)),o=a(n.async,this,[t].concat(i)),r()&&l(o);return this}function a(e,t,n){function i(){for(var i,r=0,a=e.length;!i&&r<a;r+=1)i=!1===e[r].apply(t,n);return!i}return i}function o(e,t){return e.bind?e.bind(t):function(){e.apply(t,[].slice.call(arguments,0))}}var s=/\s+/,l=window.setImmediate?function(e){setImmediate((function(){e()}))}:function(e){setTimeout((function(){e()}),0)};return{onSync:n,onAsync:t,off:i,trigger:r}}(),a=function(e){"use strict";function n(e){return a[e.toUpperCase()]||e}function i(e,i,r,a){for(var o,s=[],l=0,d=e.length;l<d;l++){var c=t.escapeRegExChars(e[l]);a&&(c=c.replace(/\S/g,n)),s.push(c)}return o=r?"\\b("+s.join("|")+")\\b":"("+s.join("|")+")",i?new RegExp(o):new RegExp(o,"i")}var r={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1,diacriticInsensitive:!1},a={A:"[Aa\xaa\xc0-\xc5\xe0-\xe5\u0100-\u0105\u01cd\u01ce\u0200-\u0203\u0226\u0227\u1d2c\u1d43\u1e00\u1e01\u1e9a\u1ea0-\u1ea3\u2090\u2100\u2101\u213b\u249c\u24b6\u24d0\u3371-\u3374\u3380-\u3384\u3388\u3389\u33a9-\u33af\u33c2\u33ca\u33df\u33ff\uff21\uff41]",B:"[Bb\u1d2e\u1d47\u1e02-\u1e07\u212c\u249d\u24b7\u24d1\u3374\u3385-\u3387\u33c3\u33c8\u33d4\u33dd\uff22\uff42]",C:"[Cc\xc7\xe7\u0106-\u010d\u1d9c\u2100\u2102\u2103\u2105\u2106\u212d\u216d\u217d\u249e\u24b8\u24d2\u3376\u3388\u3389\u339d\u33a0\u33a4\u33c4-\u33c7\uff23\uff43]",D:"[Dd\u010e\u010f\u01c4-\u01c6\u01f1-\u01f3\u1d30\u1d48\u1e0a-\u1e13\u2145\u2146\u216e\u217e\u249f\u24b9\u24d3\u32cf\u3372\u3377-\u3379\u3397\u33ad-\u33af\u33c5\u33c8\uff24\uff44]",E:"[Ee\xc8-\xcb\xe8-\xeb\u0112-\u011b\u0204-\u0207\u0228\u0229\u1d31\u1d49\u1e18-\u1e1b\u1eb8-\u1ebd\u2091\u2121\u212f\u2130\u2147\u24a0\u24ba\u24d4\u3250\u32cd\u32ce\uff25\uff45]",F:"[Ff\u1da0\u1e1e\u1e1f\u2109\u2131\u213b\u24a1\u24bb\u24d5\u338a-\u338c\u3399\ufb00-\ufb04\uff26\uff46]",G:"[Gg\u011c-\u0123\u01e6\u01e7\u01f4\u01f5\u1d33\u1d4d\u1e20\u1e21\u210a\u24a2\u24bc\u24d6\u32cc\u32cd\u3387\u338d-\u338f\u3393\u33ac\u33c6\u33c9\u33d2\u33ff\uff27\uff47]",H:"[Hh\u0124\u0125\u021e\u021f\u02b0\u1d34\u1e22-\u1e2b\u1e96\u210b-\u210e\u24a3\u24bd\u24d7\u32cc\u3371\u3390-\u3394\u33ca\u33cb\u33d7\uff28\uff48]",I:"[Ii\xcc-\xcf\xec-\xef\u0128-\u0130\u0132\u0133\u01cf\u01d0\u0208-\u020b\u1d35\u1d62\u1e2c\u1e2d\u1ec8-\u1ecb\u2071\u2110\u2111\u2139\u2148\u2160-\u2163\u2165-\u2168\u216a\u216b\u2170-\u2173\u2175-\u2178\u217a\u217b\u24a4\u24be\u24d8\u337a\u33cc\u33d5\ufb01\ufb03\uff29\uff49]",J:"[Jj\u0132-\u0135\u01c7-\u01cc\u01f0\u02b2\u1d36\u2149\u24a5\u24bf\u24d9\u2c7c\uff2a\uff4a]",K:"[Kk\u0136\u0137\u01e8\u01e9\u1d37\u1d4f\u1e30-\u1e35\u212a\u24a6\u24c0\u24da\u3384\u3385\u3389\u338f\u3391\u3398\u339e\u33a2\u33a6\u33aa\u33b8\u33be\u33c0\u33c6\u33cd-\u33cf\uff2b\uff4b]",L:"[Ll\u0139-\u0140\u01c7-\u01c9\u02e1\u1d38\u1e36\u1e37\u1e3a-\u1e3d\u2112\u2113\u2121\u216c\u217c\u24a7\u24c1\u24db\u32cf\u3388\u3389\u33d0-\u33d3\u33d5\u33d6\u33ff\ufb02\ufb04\uff2c\uff4c]",M:"[Mm\u1d39\u1d50\u1e3e-\u1e43\u2120\u2122\u2133\u216f\u217f\u24a8\u24c2\u24dc\u3377-\u3379\u3383\u3386\u338e\u3392\u3396\u3399-\u33a8\u33ab\u33b3\u33b7\u33b9\u33bd\u33bf\u33c1\u33c2\u33ce\u33d0\u33d4-\u33d6\u33d8\u33d9\u33de\u33df\uff2d\uff4d]",N:"[Nn\xd1\xf1\u0143-\u0149\u01ca-\u01cc\u01f8\u01f9\u1d3a\u1e44-\u1e4b\u207f\u2115\u2116\u24a9\u24c3\u24dd\u3381\u338b\u339a\u33b1\u33b5\u33bb\u33cc\u33d1\uff2e\uff4e]",O:"[Oo\xba\xd2-\xd6\xf2-\xf6\u014c-\u0151\u01a0\u01a1\u01d1\u01d2\u01ea\u01eb\u020c-\u020f\u022e\u022f\u1d3c\u1d52\u1ecc-\u1ecf\u2092\u2105\u2116\u2134\u24aa\u24c4\u24de\u3375\u33c7\u33d2\u33d6\uff2f\uff4f]",P:"[Pp\u1d3e\u1d56\u1e54-\u1e57\u2119\u24ab\u24c5\u24df\u3250\u3371\u3376\u3380\u338a\u33a9-\u33ac\u33b0\u33b4\u33ba\u33cb\u33d7-\u33da\uff30\uff50]",Q:"[Qq\u211a\u24ac\u24c6\u24e0\u33c3\uff31\uff51]",R:"[Rr\u0154-\u0159\u0210-\u0213\u02b3\u1d3f\u1d63\u1e58-\u1e5b\u1e5e\u1e5f\u20a8\u211b-\u211d\u24ad\u24c7\u24e1\u32cd\u3374\u33ad-\u33af\u33da\u33db\uff32\uff52]",S:"[Ss\u015a-\u0161\u017f\u0218\u0219\u02e2\u1e60-\u1e63\u20a8\u2101\u2120\u24ae\u24c8\u24e2\u33a7\u33a8\u33ae-\u33b3\u33db\u33dc\ufb06\uff33\uff53]",T:"[Tt\u0162-\u0165\u021a\u021b\u1d40\u1d57\u1e6a-\u1e71\u1e97\u2121\u2122\u24af\u24c9\u24e3\u3250\u32cf\u3394\u33cf\ufb05\ufb06\uff34\uff54]",U:"[Uu\xd9-\xdc\xf9-\xfc\u0168-\u0173\u01af\u01b0\u01d3\u01d4\u0214-\u0217\u1d41\u1d58\u1d64\u1e72-\u1e77\u1ee4-\u1ee7\u2106\u24b0\u24ca\u24e4\u3373\u337a\uff35\uff55]",V:"[Vv\u1d5b\u1d65\u1e7c-\u1e7f\u2163-\u2167\u2173-\u2177\u24b1\u24cb\u24e5\u2c7d\u32ce\u3375\u33b4-\u33b9\u33dc\u33de\uff36\uff56]",W:"[Ww\u0174\u0175\u02b7\u1d42\u1e80-\u1e89\u1e98\u24b2\u24cc\u24e6\u33ba-\u33bf\u33dd\uff37\uff57]",X:"[Xx\u02e3\u1e8a-\u1e8d\u2093\u213b\u2168-\u216b\u2178-\u217b\u24b3\u24cd\u24e7\u33d3\uff38\uff58]",Y:"[Yy\xdd\xfd\xff\u0176-\u0178\u0232\u0233\u02b8\u1e8e\u1e8f\u1e99\u1ef2-\u1ef9\u24b4\u24ce\u24e8\u33c9\uff39\uff59]",Z:"[Zz\u0179-\u017e\u01f1-\u01f3\u1dbb\u1e90-\u1e95\u2124\u2128\u24b5\u24cf\u24e9\u3390-\u3394\uff3a\uff5a]"};return function(n){function a(t){var i,r,a;return(i=s.exec(t.data))&&(a=e.createElement(n.tagName),n.className&&(a.className=n.className),(r=t.splitText(i.index)).splitText(i[0].length),a.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(a,r)),!!i}function o(e,t){for(var n,i=0;i<e.childNodes.length;i++)3===(n=e.childNodes[i]).nodeType?i+=t(n)?1:0:o(n,t)}var s;(n=t.mixin({},r,n)).node&&n.pattern&&(n.pattern=t.isArray(n.pattern)?n.pattern:[n.pattern],s=i(n.pattern,n.caseSensitive,n.wordsOnly,n.diacriticInsensitive),o(n.node,a))}}(window.document),o=function(){"use strict";function n(n,r){var a;(n=n||{}).input||e.error("input is missing"),r.mixin(this),this.$hint=e(n.hint),this.$input=e(n.input),this.$menu=e(n.menu),a=this.$input.attr("id")||t.guid(),this.$menu.attr("id",a+"_listbox"),this.$hint.attr({"aria-hidden":!0}),this.$input.attr({"aria-owns":a+"_listbox",role:"combobox","aria-autocomplete":"list","aria-expanded":!1}),this.query=this.$input.val(),this.queryWhenFocused=this.hasFocus()?this.query:null,this.$overflowHelper=i(this.$input),this._checkLanguageDirection(),0===this.$hint.length&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop),this.onSync("cursorchange",this._updateDescendent)}function i(t){return e('<pre aria-hidden="true"></pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function a(e,t){return n.normalizeQuery(e)===n.normalizeQuery(t)}function o(e){return e.altKey||e.ctrlKey||e.metaKey||e.shiftKey}var s;return s={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},n.normalizeQuery=function(e){return t.toStr(e).replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(n.prototype,r,{_onBlur:function(){this.resetInputValue(),this.trigger("blurred")},_onFocus:function(){this.queryWhenFocused=this.query,this.trigger("focused")},_onKeydown:function(e){var t=s[e.which||e.keyCode];this._managePreventDefault(t,e),t&&this._shouldTrigger(t,e)&&this.trigger(t+"Keyed",e)},_onInput:function(){this._setQuery(this.getInputValue()),this.clearHintIfInvalid(),this._checkLanguageDirection()},_managePreventDefault:function(e,t){var n;switch(e){case"up":case"down":n=!o(t);break;default:n=!1}n&&t.preventDefault()},_shouldTrigger:function(e,t){var n;switch(e){case"tab":n=!o(t);break;default:n=!0}return n},_checkLanguageDirection:function(){var e=(this.$input.css("direction")||"ltr").toLowerCase();this.dir!==e&&(this.dir=e,this.$hint.attr("dir",e),this.trigger("langDirChanged",e))},_setQuery:function(e,t){var n,i;i=!!(n=a(e,this.query))&&this.query.length!==e.length,this.query=e,t||n?!t&&i&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},_updateDescendent:function(e,t){this.$input.attr("aria-activedescendant",t)},bind:function(){var e,n,i,r,a=this;return e=t.bind(this._onBlur,this),n=t.bind(this._onFocus,this),i=t.bind(this._onKeydown,this),r=t.bind(this._onInput,this),this.$input.on("blur.tt",e).on("focus.tt",n).on("keydown.tt",i),!t.isMsie()||t.isMsie()>9?this.$input.on("input.tt",r):this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",(function(e){s[e.which||e.keyCode]||t.defer(t.bind(a._onInput,a,e))})),this},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getLangDir:function(){return this.dir},getQuery:function(){return this.query||""},setQuery:function(e,t){this.setInputValue(e),this._setQuery(e,t)},hasQueryChangedSinceLastFocus:function(){return this.query!==this.queryWhenFocused},getInputValue:function(){return this.$input.val()},setInputValue:function(e){this.$input.val(e),this.clearHintIfInvalid(),this._checkLanguageDirection()},resetInputValue:function(){this.setInputValue(this.query)},getHint:function(){return this.$hint.val()},setHint:function(e){this.$hint.val(e)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var e,t,n;n=(e=this.getInputValue())!==(t=this.getHint())&&0===t.indexOf(e),!(""!==e&&n&&!this.hasOverflow())&&this.clearHint()},hasFocus:function(){return this.$input.is(":focus")},hasOverflow:function(){var e=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=e},isCursorAtEnd:function(){var e,n,i;return e=this.$input.val().length,n=this.$input[0].selectionStart,t.isNumber(n)?n===e:!document.selection||((i=document.selection.createRange()).moveStart("character",-e),e===i.text.length)},destroy:function(){this.$hint.off(".tt"),this.$input.off(".tt"),this.$overflowHelper.remove(),this.$hint=this.$input=this.$overflowHelper=e("<div>")},setAriaExpanded:function(e){this.$input.attr("aria-expanded",e)}}),n}(),s=function(){"use strict";function n(n,r){(n=n||{}).templates=n.templates||{},n.templates.notFound=n.templates.notFound||n.templates.empty,n.source||e.error("missing source"),n.node||e.error("missing node"),n.name&&!s(n.name)&&e.error("invalid dataset name: "+n.name),r.mixin(this),this.highlight=!!n.highlight,this.name=t.toStr(n.name||d()),this.limit=n.limit||5,this.displayFn=i(n.display||n.displayKey),this.templates=o(n.templates,this.displayFn),this.source=n.source.__ttAdapter?n.source.__ttAdapter():n.source,this.async=t.isUndefined(n.async)?this.source.length>2:!!n.async,this._resetLastSuggestion(),this.$el=e(n.node).attr("role","presentation").addClass(this.classes.dataset).addClass(this.classes.dataset+"-"+this.name)}function i(e){function n(t){return t[e]}return e=e||t.stringify,t.isFunction(e)?e:n}function o(n,i){function r(i){var r=n.suggestion;return e(r(i)).attr("id",t.guid())}function a(n){return e('<div role="option">').attr("id",t.guid()).text(i(n))}return{notFound:n.notFound&&t.templatify(n.notFound),pending:n.pending&&t.templatify(n.pending),header:n.header&&t.templatify(n.header),footer:n.footer&&t.templatify(n.footer),suggestion:n.suggestion?r:a}}function s(e){return/^[_a-zA-Z0-9-]+$/.test(e)}var l,d;return l={dataset:"tt-selectable-dataset",val:"tt-selectable-display",obj:"tt-selectable-object"},d=t.getIdGenerator(),n.extractData=function(t){var n=e(t);return n.data(l.obj)?{dataset:n.data(l.dataset)||"",val:n.data(l.val)||"",obj:n.data(l.obj)||null}:null},t.mixin(n.prototype,r,{_overwrite:function(e,t){(t=t||[]).length?this._renderSuggestions(e,t):this.async&&this.templates.pending?this._renderPending(e):!this.async&&this.templates.notFound?this._renderNotFound(e):this._empty(),this.trigger("rendered",t,!1,this.name)},_append:function(e,t){(t=t||[]).length&&this.$lastSuggestion.length?this._appendSuggestions(e,t):t.length?this._renderSuggestions(e,t):!this.$lastSuggestion.length&&this.templates.notFound&&this._renderNotFound(e),this.trigger("rendered",t,!0,this.name)},_renderSuggestions:function(e,t){var n;n=this._getSuggestionsFragment(e,t),this.$lastSuggestion=n.children().last(),this.$el.html(n).prepend(this._getHeader(e,t)).append(this._getFooter(e,t))},_appendSuggestions:function(e,t){var n,i;i=(n=this._getSuggestionsFragment(e,t)).children().last(),this.$lastSuggestion.after(n),this.$lastSuggestion=i},_renderPending:function(e){var t=this.templates.pending;this._resetLastSuggestion(),t&&this.$el.html(t({query:e,dataset:this.name}))},_renderNotFound:function(e){var t=this.templates.notFound;this._resetLastSuggestion(),t&&this.$el.html(t({query:e,dataset:this.name}))},_empty:function(){this.$el.empty(),this._resetLastSuggestion()},_getSuggestionsFragment:function(n,i){var r,o=this;return r=document.createDocumentFragment(),t.each(i,(function(t){var i,a;a=o._injectQuery(n,t),i=e(o.templates.suggestion(a)).data(l.dataset,o.name).data(l.obj,t).data(l.val,o.displayFn(t)).addClass(o.classes.suggestion+" "+o.classes.selectable),r.appendChild(i[0])})),this.highlight&&a({className:this.classes.highlight,node:r,pattern:n}),e(r)},_getFooter:function(e,t){return this.templates.footer?this.templates.footer({query:e,suggestions:t,dataset:this.name}):null},_getHeader:function(e,t){return this.templates.header?this.templates.header({query:e,suggestions:t,dataset:this.name}):null},_resetLastSuggestion:function(){this.$lastSuggestion=e()},_injectQuery:function(e,n){return t.isObject(n)?t.mixin({_query:e},n):n},update:function(t){function n(e){o||(o=!0,e=(e||[]).slice(0,r.limit),s=e.length,r._overwrite(t,e),s<r.limit&&r.async&&r.trigger("asyncRequested",t,r.name))}function i(n){if(n=n||[],!a&&s<r.limit){r.cancel=e.noop;var i=Math.abs(s-r.limit);s+=i,r._append(t,n.slice(0,i)),r.async&&r.trigger("asyncReceived",t,r.name)}}var r=this,a=!1,o=!1,s=0;this.cancel(),this.cancel=function(){a=!0,r.cancel=e.noop,r.async&&r.trigger("asyncCanceled",t,r.name)},this.source(t,n,i),!o&&n([])},cancel:e.noop,clear:function(){this._empty(),this.cancel(),this.trigger("cleared")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=e("<div>")}}),n}(),l=function(){"use strict";function n(n,i){function r(t){var n=a.$node.find(t.node).first();return t.node=n.length?n:e("<div>").appendTo(a.$node),new s(t,i)}var a=this;(n=n||{}).node||e.error("node is required"),i.mixin(this),this.$node=e(n.node),this.query=null,this.datasets=t.map(n.datasets,r)}return t.mixin(n.prototype,r,{_onSelectableClick:function(t){this.trigger("selectableClicked",e(t.currentTarget))},_onRendered:function(e,t,n,i){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetRendered",t,n,i)},_onCleared:function(){this.$node.toggleClass(this.classes.empty,this._allDatasetsEmpty()),this.trigger("datasetCleared")},_propagate:function(){this.trigger.apply(this,arguments)},_allDatasetsEmpty:function(){return t.every(this.datasets,t.bind((function(e){var t=e.isEmpty();return this.$node.attr("aria-expanded",!t),t}),this))},_getSelectables:function(){return this.$node.find(this.selectors.selectable)},_removeCursor:function(){var e=this.getActiveSelectable();e&&e.removeClass(this.classes.cursor)},_ensureVisible:function(e){var t,n,i,r;n=(t=e.position().top)+e.outerHeight(!0),i=this.$node.scrollTop(),r=this.$node.height()+parseInt(this.$node.css("paddingTop"),10)+parseInt(this.$node.css("paddingBottom"),10),t<0?this.$node.scrollTop(i+t):r<n&&this.$node.scrollTop(i+(n-r))},bind:function(){var n,i=this;return n=t.bind(this._onSelectableClick,this),this.$node.on("click.tt",this.selectors.selectable,n),this.$node.on("mouseover",this.selectors.selectable,(function(){i.setCursor(e(this))})),this.$node.on("mouseleave",(function(){i._removeCursor()})),t.each(this.datasets,(function(e){e.onSync("asyncRequested",i._propagate,i).onSync("asyncCanceled",i._propagate,i).onSync("asyncReceived",i._propagate,i).onSync("rendered",i._onRendered,i).onSync("cleared",i._onCleared,i)})),this},isOpen:function(){return this.$node.hasClass(this.classes.open)},open:function(){this.$node.scrollTop(0),this.$node.addClass(this.classes.open)},close:function(){this.$node.attr("aria-expanded",!1),this.$node.removeClass(this.classes.open),this._removeCursor()},setLanguageDirection:function(e){this.$node.attr("dir",e)},selectableRelativeToCursor:function(e){var t,n,i;return n=this.getActiveSelectable(),t=this._getSelectables(),-1===(i=(i=((i=(n?t.index(n):-1)+e)+1)%(t.length+1)-1)<-1?t.length-1:i)?null:t.eq(i)},setCursor:function(e){this._removeCursor(),(e=e&&e.first())&&(e.addClass(this.classes.cursor),this._ensureVisible(e))},getSelectableData:function(e){return e&&e.length?s.extractData(e):null},getActiveSelectable:function(){var e=this._getSelectables().filter(this.selectors.cursor).first();return e.length?e:null},getTopSelectable:function(){var e=this._getSelectables().first();return e.length?e:null},update:function(e){function n(t){t.update(e)}var i=e!==this.query;return i&&(this.query=e,t.each(this.datasets,n)),i},empty:function(){function e(e){e.clear()}t.each(this.datasets,e),this.query=null,this.$node.addClass(this.classes.empty)},destroy:function(){function n(e){e.destroy()}this.$node.off(".tt"),this.$node=e("<div>"),t.each(this.datasets,n)}}),n}(),d=function(){"use strict";function n(n){this.$el=e("<span></span>",{role:"status","aria-live":"polite"}).css({position:"absolute",padding:"0",border:"0",height:"1px",width:"1px","margin-bottom":"-1px","margin-right":"-1px",overflow:"hidden",clip:"rect(0 0 0 0)","white-space":"nowrap"}),n.$input.after(this.$el),t.each(n.menu.datasets,t.bind((function(e){e.onSync&&(e.onSync("rendered",t.bind(this.update,this)),e.onSync("cleared",t.bind(this.cleared,this)))}),this))}return t.mixin(n.prototype,{update:function(e,t){var n,i=t.length;n=1===i?{result:"result",is:"is"}:{result:"results",is:"are"},this.$el.text(i+" "+n.result+" "+n.is+" available, use up and down arrow keys to navigate.")},cleared:function(){this.$el.text("")}}),n}(),c=function(){"use strict";function e(){l.apply(this,[].slice.call(arguments,0))}var n=l.prototype;return t.mixin(e.prototype,l.prototype,{open:function(){return!this._allDatasetsEmpty()&&this._show(),n.open.apply(this,[].slice.call(arguments,0))},close:function(){return this._hide(),n.close.apply(this,[].slice.call(arguments,0))},_onRendered:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),n._onRendered.apply(this,[].slice.call(arguments,0))},_onCleared:function(){return this._allDatasetsEmpty()?this._hide():this.isOpen()&&this._show(),n._onCleared.apply(this,[].slice.call(arguments,0))},setLanguageDirection:function(e){return this.$node.css("ltr"===e?this.css.ltr:this.css.rtl),n.setLanguageDirection.apply(this,[].slice.call(arguments,0))},_hide:function(){this.$node.hide()},_show:function(){this.$node.css("display","block")}}),e}(),u=function(){"use strict";function n(n,r){var a,o,s,l,d,c,u,f,h,p,g;(n=n||{}).input||e.error("missing input"),n.menu||e.error("missing menu"),n.eventBus||e.error("missing event bus"),r.mixin(this),this.eventBus=n.eventBus,this.minLength=t.isNumber(n.minLength)?n.minLength:1,this.input=n.input,this.menu=n.menu,this.enabled=!0,this.autoselect=!!n.autoselect,this.active=!1,this.input.hasFocus()&&this.activate(),this.dir=this.input.getLangDir(),this._hacks(),this.menu.bind().onSync("selectableClicked",this._onSelectableClicked,this).onSync("asyncRequested",this._onAsyncRequested,this).onSync("asyncCanceled",this._onAsyncCanceled,this).onSync("asyncReceived",this._onAsyncReceived,this).onSync("datasetRendered",this._onDatasetRendered,this).onSync("datasetCleared",this._onDatasetCleared,this),a=i(this,"activate","open","_onFocused"),o=i(this,"deactivate","_onBlurred"),s=i(this,"isActive","isOpen","_onEnterKeyed"),l=i(this,"isActive","isOpen","_onTabKeyed"),d=i(this,"isActive","_onEscKeyed"),c=i(this,"isActive","open","_onUpKeyed"),u=i(this,"isActive","open","_onDownKeyed"),f=i(this,"isActive","isOpen","_onLeftKeyed"),h=i(this,"isActive","isOpen","_onRightKeyed"),p=i(this,"_openIfActive","_onQueryChanged"),g=i(this,"_openIfActive","_onWhitespaceChanged"),this.input.bind().onSync("focused",a,this).onSync("blurred",o,this).onSync("enterKeyed",s,this).onSync("tabKeyed",l,this).onSync("escKeyed",d,this).onSync("upKeyed",c,this).onSync("downKeyed",u,this).onSync("leftKeyed",f,this).onSync("rightKeyed",h,this).onSync("queryChanged",p,this).onSync("whitespaceChanged",g,this).onSync("langDirChanged",this._onLangDirChanged,this)}function i(e){var n=[].slice.call(arguments,1);return function(){var i=[].slice.call(arguments);t.each(n,(function(t){return e[t].apply(e,i)}))}}return t.mixin(n.prototype,{
_hacks:function(){var n,i;n=this.input.$input||e("<div>"),i=this.menu.$node||e("<div>"),n.on("blur.tt",(function(e){var r,a,o;r=document.activeElement,a=i.is(r),o=i.has(r).length>0,t.isMsie()&&(a||o)&&(e.preventDefault(),e.stopImmediatePropagation(),t.defer((function(){n.focus()})))})),i.on("mousedown.tt",(function(e){e.preventDefault()}))},_onSelectableClicked:function(e,t){this.select(t)},_onDatasetCleared:function(){this._updateHint()},_onDatasetRendered:function(e,t,n,i){if(this._updateHint(),this.autoselect){var r=this.selectors.cursor.substr(1);this.menu.$node.find(this.selectors.suggestion).first().addClass(r)}this.eventBus.trigger("render",t,n,i)},_onAsyncRequested:function(e,t,n){this.eventBus.trigger("asyncrequest",n,t)},_onAsyncCanceled:function(e,t,n){this.eventBus.trigger("asynccancel",n,t)},_onAsyncReceived:function(e,t,n){this.eventBus.trigger("asyncreceive",n,t)},_onFocused:function(){this._minLengthMet()&&this.menu.update(this.input.getQuery())},_onBlurred:function(){this.input.hasQueryChangedSinceLastFocus()&&this.eventBus.trigger("change",this.input.getQuery())},_onEnterKeyed:function(e,t){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&(t.preventDefault(),t.stopPropagation()):this.autoselect&&this.select(this.menu.getTopSelectable())&&(t.preventDefault(),t.stopPropagation())},_onTabKeyed:function(e,t){var n;(n=this.menu.getActiveSelectable())?this.select(n)&&t.preventDefault():this.autoselect&&(n=this.menu.getTopSelectable())&&this.autocomplete(n)&&t.preventDefault()},_onEscKeyed:function(){this.close()},_onUpKeyed:function(){this.moveCursor(-1)},_onDownKeyed:function(){this.moveCursor(1)},_onLeftKeyed:function(){"rtl"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onRightKeyed:function(){"ltr"===this.dir&&this.input.isCursorAtEnd()&&this.autocomplete(this.menu.getActiveSelectable()||this.menu.getTopSelectable())},_onQueryChanged:function(e,t){this._minLengthMet(t)?this.menu.update(t):this.menu.empty()},_onWhitespaceChanged:function(){this._updateHint()},_onLangDirChanged:function(e,t){this.dir!==t&&(this.dir=t,this.menu.setLanguageDirection(t))},_openIfActive:function(){this.isActive()&&this.open()},_minLengthMet:function(e){return(e=t.isString(e)?e:this.input.getQuery()||"").length>=this.minLength},_updateHint:function(){var e,n,i,r,a,s;e=this.menu.getTopSelectable(),n=this.menu.getSelectableData(e),i=this.input.getInputValue(),!n||t.isBlankString(i)||this.input.hasOverflow()?this.input.clearHint():(r=o.normalizeQuery(i),a=t.escapeRegExChars(r),(s=new RegExp("^(?:"+a+")(.+$)","i").exec(n.val))&&this.input.setHint(i+s[1]))},isEnabled:function(){return this.enabled},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},isActive:function(){return this.active},activate:function(){return!!this.isActive()||!(!this.isEnabled()||this.eventBus.before("active"))&&(this.active=!0,this.eventBus.trigger("active"),!0)},deactivate:function(){return!this.isActive()||!this.eventBus.before("idle")&&(this.active=!1,this.close(),this.eventBus.trigger("idle"),!0)},isOpen:function(){return this.menu.isOpen()},open:function(){return this.isOpen()||this.eventBus.before("open")||(this.input.setAriaExpanded(!0),this.menu.open(),this._updateHint(),this.eventBus.trigger("open")),this.isOpen()},close:function(){return this.isOpen()&&!this.eventBus.before("close")&&(this.input.setAriaExpanded(!1),this.menu.close(),this.input.clearHint(),this.input.resetInputValue(),this.eventBus.trigger("close")),!this.isOpen()},setVal:function(e){this.input.setQuery(t.toStr(e))},getVal:function(){return this.input.getQuery()},select:function(e){var t=this.menu.getSelectableData(e);return!(!t||this.eventBus.before("select",t.obj,t.dataset)||(this.input.setQuery(t.val,!0),this.eventBus.trigger("select",t.obj,t.dataset),this.close(),0))},autocomplete:function(e){var t,n;return t=this.input.getQuery(),!(!(n=this.menu.getSelectableData(e))||t===n.val||this.eventBus.before("autocomplete",n.obj,n.dataset)||(this.input.setQuery(n.val),this.eventBus.trigger("autocomplete",n.obj,n.dataset),0))},moveCursor:function(e){var t,n,i,r,a,o;return t=this.input.getQuery(),n=this.menu.selectableRelativeToCursor(e),r=(i=this.menu.getSelectableData(n))?i.obj:null,a=i?i.dataset:null,o=n?n.attr("id"):null,this.input.trigger("cursorchange",o),!(this._minLengthMet()&&this.menu.update(t)||this.eventBus.before("cursorchange",r,a)||(this.menu.setCursor(n),i?"string"==typeof i.val&&this.input.setInputValue(i.val):(this.input.resetInputValue(),this._updateHint()),this.eventBus.trigger("cursorchange",r,a),0))},destroy:function(){this.input.destroy(),this.menu.destroy()}}),n}();!function(){"use strict";function r(t,n){t.each((function(){var t,i=e(this);(t=i.data(m.typeahead))&&n(t,i)}))}function a(e,t){return e.clone().addClass(t.classes.hint).removeData().css(t.css.hint).css(f(e)).prop({readonly:!0,required:!1}).removeAttr("id name placeholder").removeClass("required").attr({spellcheck:"false",tabindex:-1})}function s(e,t){e.data(m.attrs,{dir:e.attr("dir"),autocomplete:e.attr("autocomplete"),spellcheck:e.attr("spellcheck"),style:e.attr("style")}),e.addClass(t.classes.input).attr({spellcheck:!1});try{!e.attr("dir")&&e.attr("dir","auto")}catch(e){}return e}function f(e){return{backgroundAttachment:e.css("background-attachment"),backgroundClip:e.css("background-clip"),backgroundColor:e.css("background-color"),backgroundImage:e.css("background-image"),backgroundOrigin:e.css("background-origin"),backgroundPosition:e.css("background-position"),backgroundRepeat:e.css("background-repeat"),backgroundSize:e.css("background-size")}}function h(e){var n,i;n=e.data(m.www),i=e.parent().filter(n.selectors.wrapper),t.each(e.data(m.attrs),(function(n,i){t.isUndefined(n)?e.removeAttr(i):e.attr(i,n)})),e.removeData(m.typeahead).removeData(m.www).removeData(m.attr).removeClass(n.classes.input),i.length&&(e.detach().insertAfter(i),i.remove())}function p(n){var i;return(i=t.isJQuery(n)||t.isElement(n)?e(n).first():[]).length?i:null}var g,m,v;g=e.fn.typeahead,m={www:"tt-www",attrs:"tt-attrs",typeahead:"tt-typeahead"},v={initialize:function(r,f){function h(){var n,h,v,y,_,b,E,w,T,S,C;t.each(f,(function(e){e.highlight=!!r.highlight})),n=e(this),h=e(g.html.wrapper),v=p(r.hint),y=p(r.menu),_=!1!==r.hint&&!v,b=!1!==r.menu&&!y,_&&(v=a(n,g)),b&&(y=e(g.html.menu).css(g.css.menu)),v&&v.val(""),n=s(n,g),(_||b)&&(h.css(g.css.wrapper),n.css(_?g.css.input:g.css.inputWithNoHint),n.wrap(h).parent().prepend(_?v:null).append(b?y:null)),C=b?c:l,E=new i({el:n}),w=new o({hint:v,input:n,menu:y},g),T=new C({node:y,datasets:f},g),new d({$input:n,menu:T}),S=new u({input:w,menu:T,eventBus:E,minLength:r.minLength,autoselect:r.autoselect},g),n.data(m.www,g),n.data(m.typeahead,S)}var g;return f=t.isArray(f)?f:[].slice.call(arguments,1),g=n((r=r||{}).classNames),this.each(h)},isEnabled:function(){var e;return r(this.first(),(function(t){e=t.isEnabled()})),e},enable:function(){return r(this,(function(e){e.enable()})),this},disable:function(){return r(this,(function(e){e.disable()})),this},isActive:function(){var e;return r(this.first(),(function(t){e=t.isActive()})),e},activate:function(){return r(this,(function(e){e.activate()})),this},deactivate:function(){return r(this,(function(e){e.deactivate()})),this},isOpen:function(){var e;return r(this.first(),(function(t){e=t.isOpen()})),e},open:function(){return r(this,(function(e){e.open()})),this},close:function(){return r(this,(function(e){e.close()})),this},select:function(t){var n=!1,i=e(t);return r(this.first(),(function(e){n=e.select(i)})),n},autocomplete:function(t){var n=!1,i=e(t);return r(this.first(),(function(e){n=e.autocomplete(i)})),n},moveCursor:function(e){var t=!1;return r(this.first(),(function(n){t=n.moveCursor(e)})),t},val:function(e){var n;return arguments.length?(r(this,(function(n){n.setVal(t.toStr(e))})),this):(r(this.first(),(function(e){n=e.getVal()})),n)},destroy:function(){return r(this,(function(e,t){h(t),e.destroy()})),this}},e.fn.typeahead=function(e){return v[e]?v[e].apply(this,[].slice.call(arguments,1)):v.initialize.apply(this,arguments)},e.fn.typeahead.noConflict=function(){return e.fn.typeahead=g,this}}()})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).firebase=t()}(this,(function(){"use strict";function e(t,n){if(!(n instanceof Object))return n;switch(n.constructor){case Date:return new Date(n.getTime());case Object:void 0===t&&(t={});break;case Array:t=[];break;default:return n}for(const i in n)n.hasOwnProperty(i)&&"__proto__"!==i&&(t[i]=e(t[i],n[i]));return t}function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function n(e,t){if(e===t)return 1;const r=Object.keys(e),a=Object.keys(t);for(const l of r){if(!a.includes(l))return;var o=e[l],s=t[l];if(i(o)&&i(s)){if(!n(o,s))return}else if(o!==s)return}for(const e of a)if(!r.includes(e))return;return 1}function i(e){return null!==e&&"object"==typeof e}function r(e,t){const n=new L(e,t);return n.subscribe.bind(n)}function a(){}function o(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(J=J||[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey]).includes(e)?function(...t){return e.apply(ae(this),t),l(Z.get(this))}:function(...t){return l(e.apply(ae(this),t))}:function(t,...n){var i=e.call(ae(this),t,...n);return te.set(i,t.sort?t.sort():[t]),l(i)}}function s(e){return"function"==typeof e?o(e):(e instanceof IDBTransaction&&(t=e,ee.has(t)||(n=new Promise(((e,n)=>{const i=()=>{t.removeEventListener("complete",r),t.removeEventListener("error",a),t.removeEventListener("abort",a)},r=()=>{e(),i()},a=()=>{n(t.error||new DOMException("AbortError","AbortError")),i()};t.addEventListener("complete",r),t.addEventListener("error",a),t.addEventListener("abort",a)})),ee.set(t,n))),X(e,Q=Q||[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])?new Proxy(e,re):e);var t,n}function l(e){if(e instanceof IDBRequest)return function(e){const t=new Promise(((t,n)=>{const i=()=>{e.removeEventListener("success",r),e.removeEventListener("error",a)},r=()=>{t(l(e.result)),i()},a=()=>{n(e.error),i()};e.addEventListener("success",r),e.addEventListener("error",a)}));return t.then((t=>{t instanceof IDBCursor&&Z.set(t,e)})).catch((()=>{})),ie.set(t,e),t}(e);if(ne.has(e))return ne.get(e);var t=s(e);return t!==e&&(ne.set(e,t),ie.set(t,e)),t}function d(e,t){if(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t){if(le.get(t))return le.get(t);const e=t.replace(/FromIndex$/,""),i=t!==e,r=se.includes(e);if(e in(i?IDBIndex:IDBObjectStore).prototype&&(r||oe.includes(e))){var n=async function(t,...n){var a=this.transaction(t,r?"readwrite":"readonly");let o=a.store;return i&&(o=o.index(n.shift())),(await Promise.all([o[e](...n),r&&a.done]))[0]};return le.set(t,n),n}}}function c(e,t){try{e.container.addComponent(t)}catch(n){ue.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function u(e,t){e.container.addOrOverwriteComponent(t)}function f(e){var t=e.name;if(me.has(t))return ue.debug(`There were multiple attempts to register component ${t}.`),!1;me.set(t,e);for(const t of ge.values())c(t,e);return!0}function h(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function p(e,t={}){let i=e;if("object"!=typeof t){t={name:t}}var r=Object.assign({name:he,automaticDataCollectionEnabled:!1},t);const a=r.name;if("string"!=typeof a||!a)throw ve.create("bad-app-name",{appName:String(a)});if(i=i||R(),!i)throw ve.create("no-options");var o=ge.get(a);if(o){if(n(i,o.options)&&n(r,o.config))return o;throw ve.create("duplicate-app",{appName:a})}const s=new U(a);for(const e of me.values())s.addComponent(e);return r=new ye(i,r,s),ge.set(a,r),r}async function g(e){var t=e.name;ge.has(t)&&(ge.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function m(e,t,n){let i=null!==(a=pe[e])&&void 0!==a?a:e;n&&(i+=`-${n}`);var r=i.match(/\s|\//),a=t.match(/\s|\//);if(r||a){const e=[`Unable to register library "${i}" with version "${t}":`];return r&&e.push(`library name "${i}" contains illegal characters (whitespace or "/")`),r&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void ue.warn(e.join(" "))}f(new F(`${i}-version`,(()=>({library:i,version:t})),"VERSION"))}function v(e,t){if(null!==e&&"function"!=typeof e)throw ve.create("invalid-log-argument");!function(e,t){for(const n of H){let i=null;t&&t.level&&(i=V[t.level]),n.userLogHandler=null===e?null:(t,n,...r)=>{var a=r.map((e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((e=>e)).join(" ");n>=(null!=i?i:t.logLevel)&&e({level:$[n].toLowerCase(),message:a,args:r,type:t.name})}}}(e,t)}function y(e){var t;t=e,H.forEach((e=>{e.setLogLevel(t)}))}function _(){return Te=Te||function(e,t,{blocked:n,upgrade:i,blocking:r,terminated:a}){const o=indexedDB.open(e,t),s=l(o);return i&&o.addEventListener("upgradeneeded",(e=>{i(l(o.result),e.oldVersion,e.newVersion,l(o.transaction))})),n&&o.addEventListener("blocked",(()=>n())),s.then((e=>{a&&e.addEventListener("close",(()=>a())),r&&e.addEventListener("versionchange",(()=>r()))})).catch((()=>{})),s}(be,Ee,{upgrade:(e,t)=>{0===t&&e.createObjectStore(we)}}).catch((e=>{throw ve.create("idb-open",{originalErrorMessage:e.message})})),Te}async function b(e,t){var n;try{const n=(await _()).transaction(we,"readwrite"),i=n.objectStore(we);return await i.put(t,E(e)),n.done}catch(e){e instanceof N?ue.warn(e.message):(n=ve.create("idb-set",{originalErrorMessage:null==e?void 0:e.message}),ue.warn(n.message))}}function E(e){return`${e.name}!${e.options.appId}`}function w(){return(new Date).toISOString().substring(0,10)}function T(e){return I(JSON.stringify({version:2,heartbeats:e})).length}function S(n){function i(e){if(!t(r,e=e||he))throw Ae.create("no-app",{appName:e});return r[e]}const r={},a={__esModule:!0,initializeApp:function(e,i={}){var o=p(e,i);if(t(r,o.name))return r[o.name];var s=new n(o,a);return r[o.name]=s},app:i,registerVersion:m,setLogLevel:y,onLog:v,apps:null,SDK_VERSION:_e,INTERNAL:{registerComponent:function(t){const r=t.name,o=r.replace("-compat","");var s;return f(t)&&"PUBLIC"===t.type&&(s=(e=i())=>{if("function"!=typeof e[o])throw Ae.create("invalid-app-argument",{appName:r});return e[o]()},void 0!==t.serviceProps&&e(s,t.serviceProps),a[o]=s,n.prototype[o]=function(...e){return this._getService.bind(this,r).apply(this,t.multipleInstances?e:[])}),"PUBLIC"===t.type?a[o]:null},removeApp:function(e){delete r[e]},useAsService:function(e,t){return"serverAuth"===t?null:t},modularAPIs:ke}};return a.default=a,Object.defineProperty(a,"apps",{get:function(){return Object.keys(r).map((e=>r[e]))}}),i.App=n,a}const C=function(e){const t=[];let n=0;for(let i=0;i<e.length;i++){let r=e.charCodeAt(i);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(55296==(64512&r)&&i+1<e.length&&56320==(64512&e.charCodeAt(i+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++i)),t[n++]=r>>18|240,t[n++]=r>>12&63|128):t[n++]=r>>12|224,t[n++]=r>>6&63|128),t[n++]=63&r|128)}return t},k={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_;const i=[];for(let t=0;t<e.length;t+=3){var r=e[t],a=t+1<e.length,o=a?e[t+1]:0,s=t+2<e.length,l=s?e[t+2]:0;let d=(15&o)<<2|l>>6,c=63&l;s||(c=64,a||(d=64)),i.push(n[r>>2],n[(3&r)<<4|o>>4],n[d],n[c])}return i.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(C(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,i=0;for(;n<e.length;){var r,a,o=e[n++];o<128?t[i++]=String.fromCharCode(o):191<o&&o<224?(r=e[n++],t[i++]=String.fromCharCode((31&o)<<6|63&r)):239<o&&o<365?(a=((7&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t[i++]=String.fromCharCode(55296+(a>>10)),t[i++]=String.fromCharCode(56320+(1023&a))):(r=e[n++],a=e[n++],t[i++]=String.fromCharCode((15&o)<<12|(63&r)<<6|63&a))}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();var n=t?this.charToByteMapWebSafe_:this.charToByteMap_;const i=[];for(let t=0;t<e.length;){var r=n[e.charAt(t++)],a=t<e.length?n[e.charAt(t)]:0;++t;var o=t<e.length?n[e.charAt(t)]:64;++t;var s=t<e.length?n[e.charAt(t)]:64;if(++t,null==r||null==a||null==o||null==s)throw Error();i.push(r<<2|a>>4),64!==o&&(i.push(a<<4&240|o>>2),64!==s&&i.push(o<<6&192|s))}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},I=function(e){return t=C(e=e),k.encodeByteArray(t,!0).replace(/\./g,"");var t},A=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,x=()=>{if("undefined"!=typeof document){let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}var e=t&&function(e){try{return k.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}(t[1]);return e&&JSON.parse(e)}},D=()=>{try{return A()||(()=>{if("undefined"!=typeof process&&void 0!==process.env){var e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0}})()||x()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},R=()=>{var e;return null===(e=D())||void 0===e?void 0:e.config};class M{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,n))}}}class N extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,N.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,O.prototype.create)}}class O{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){var n,i=t[0]||{},r=`${this.service}/${e}`,a=(a=this.errors[e])?(n=i,a.replace(P,((e,t)=>{var i=n[t];return null!=i?String(i):`<${t}?>`}))):"Error";a=`${this.serviceName}: ${a} (${r}).`;return new N(r,a,i)}}const P=/\{\$([^}]+)}/g;class L{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,n){let i;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");i=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===i.next&&(i.next=a),void 0===i.error&&(i.error=a),void 0===i.complete&&(i.complete=a);var r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch(e){}})),this.observers.push(i),r}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],--this.observerCount,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then((()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}}))}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}class F{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const j="[DEFAULT]";class B{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const i=new M;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{var n=this.getOrInitializeService({instanceIdentifier:t});n&&i.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(n=null==e?void 0:e.optional)&&void 0!==n&&n;if(!this.isInitialized(t)&&!this.shouldAutoInitialize()){if(n)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:t})}catch(e){if(n)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if("EAGER"===e.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:j})}catch(e){}for(var[t,n]of this.instancesDeferred.entries()){t=this.normalizeInstanceIdentifier(t);try{var i=this.getOrInitializeService({instanceIdentifier:t});n.resolve(i)}catch(e){}}}}clearInstance(e=j){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e=j){return this.instances.has(e)}getOptions(e=j){return this.instancesOptions.get(e)||{}}initialize(e={}){var{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);var i,r,a=this.getOrInitializeService({instanceIdentifier:n,options:t});for([i,r]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(i)&&r.resolve(a);return a}onInit(e,t){var n=this.normalizeInstanceIdentifier(t);const i=null!==(r=this.onInitCallbacks.get(n))&&void 0!==r?r:new Set;i.add(e),this.onInitCallbacks.set(n,i);var r=this.instances.get(n);return r&&e(r,n),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){var n=this.onInitCallbacks.get(t);if(n)for(const i of n)try{i(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(i=e)===j?void 0:i,options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var i;return n||null}normalizeInstanceIdentifier(e=j){return!this.component||this.component.multipleInstances?e:j}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class U{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);var t=new B(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}const H=[];var $,q,z;(q=$=$||{})[q.DEBUG=0]="DEBUG",q[q.VERBOSE=1]="VERBOSE",q[q.INFO=2]="INFO",q[q.WARN=3]="WARN",q[q.ERROR=4]="ERROR",q[q.SILENT=5]="SILENT";const V={debug:$.DEBUG,verbose:$.VERBOSE,info:$.INFO,warn:$.WARN,error:$.ERROR,silent:$.SILENT},G=$.INFO,W={[$.DEBUG]:"log",[$.VERBOSE]:"log",[$.INFO]:"info",[$.WARN]:"warn",[$.ERROR]:"error"},Y=(e,t,...n)=>{if(!(t<e.logLevel)){var i=(new Date).toISOString(),r=W[t];if(!r)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[r](`[${i}]  ${e.name}:`,...n)}};class K{constructor(e){this.name=e,this._logLevel=G,this._logHandler=Y,this._userLogHandler=null,H.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in $))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?V[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,$.DEBUG,...e),this._logHandler(this,$.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,$.VERBOSE,...e),this._logHandler(this,$.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,$.INFO,...e),this._logHandler(this,$.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,$.WARN,...e),this._logHandler(this,$.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,$.ERROR,...e),this._logHandler(this,$.ERROR,...e)}}const X=(e,t)=>t.some((t=>e instanceof t));let Q,J;const Z=new WeakMap,ee=new WeakMap,te=new WeakMap,ne=new WeakMap,ie=new WeakMap;let re={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return ee.get(e);if("objectStoreNames"===t)return e.objectStoreNames||te.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return l(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};const ae=e=>ie.get(e),oe=["get","getKey","getAll","getAllKeys","count"],se=["put","add","delete","clear"],le=new Map;re={...z=re,get:(e,t,n)=>d(e,t)||z.get(e,t,n),has:(e,t)=>!!d(e,t)||z.has(e,t)};class de{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map((e=>{return"VERSION"!==(null==(t=e.getComponent())?void 0:t.type)?null:`${(t=e.getImmediate()).library}/${t.version}`;var t})).filter((e=>e)).join(" ")}}const ce="@firebase/app",ue=new K("@firebase/app");var fe;const he="[DEFAULT]",pe={"@firebase/app":"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},ge=new Map,me=new Map,ve=new O("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."});class ye{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new F("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw ve.create("app-deleted",{appName:this._name})}}const _e="9.14.0",be="firebase-heartbeat-database",Ee=1,we="firebase-heartbeat-store";let Te=null;class Se{constructor(e){this.container=e,this._heartbeatsCache=null;var t=this.container.getProvider("app").getImmediate();this._storage=new Ce(t),this._heartbeatsCachePromise=this._storage.read().then((e=>this._heartbeatsCache=e))}async triggerHeartbeat(){var e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString();const t=w();if(null===this._heartbeatsCache&&(this._heartbeatsCache=await this._heartbeatsCachePromise),this._heartbeatsCache.lastSentHeartbeatDate!==t&&!this._heartbeatsCache.heartbeats.some((e=>e.date===t)))return this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter((e=>{var t=new Date(e.date).valueOf();return Date.now()-t<=2592e6})),this._storage.overwrite(this._heartbeatsCache)}async getHeartbeatsHeader(){if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null===this._heartbeatsCache||0===this._heartbeatsCache.heartbeats.length)return"";var e=w(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){const n=[];let i=e.slice();for(const r of e){const e=n.find((e=>e.agent===r.agent));if(e){if(e.dates.push(r.date),T(n)>t){e.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),T(n)>t){n.pop();break}i=i.slice(1)}return{heartbeatsToSend:n,unsentEntries:i}}(this._heartbeatsCache.heartbeats),t=I(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,0<n.length?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),t}}class Ce{constructor(e){this.app=e,
this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return"object"==typeof indexedDB&&new Promise(((e,t)=>{try{let n=!0;const i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(i),e(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{var e;t((null===(e=r.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})).then((()=>!0)).catch((()=>!1))}async read(){return await this._canUseIndexedDBPromise&&await async function(e){var t;try{return(await _()).transaction(we).objectStore(we).get(E(e))}catch(e){e instanceof N?ue.warn(e.message):(t=ve.create("idb-get",{originalErrorMessage:null==e?void 0:e.message}),ue.warn(t.message))}}(this.app)||{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){var n=await this.read();return b(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){var n=await this.read();return b(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}fe="",f(new F("platform-logger",(e=>new de(e)),"PRIVATE")),f(new F("heartbeat",(e=>new Se(e)),"PRIVATE")),m(ce,"0.8.4",fe),m(ce,"0.8.4","esm2017"),m("fire-js","");var ke=Object.freeze({__proto__:null,SDK_VERSION:_e,_DEFAULT_ENTRY_NAME:he,_addComponent:c,_addOrOverwriteComponent:u,_apps:ge,_clearComponents:function(){me.clear()},_components:me,_getProvider:h,_registerComponent:f,_removeServiceInstance:function(e,t,n=he){h(e,t).clearInstance(n)},deleteApp:g,getApp:function(e=he){var t=ge.get(e);if(!t&&e===he)return p();if(!t)throw ve.create("no-app",{appName:e});return t},getApps:function(){return Array.from(ge.values())},initializeApp:p,onLog:v,registerVersion:m,setLogLevel:y,FirebaseError:N});class Ie{constructor(e,t){this._delegate=e,this.firebase=t,c(e,new F("app-compat",(()=>this),"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise((e=>{this._delegate.checkDestroyed(),e()})).then((()=>(this.firebase.INTERNAL.removeApp(this.name),g(this._delegate))))}_getService(e,t=he){var n;this._delegate.checkDestroyed();const i=this._delegate.container.getProvider(e);return i.isInitialized()||"EXPLICIT"!==(null===(n=i.getComponent())||void 0===n?void 0:n.instantiationMode)||i.initialize(),i.getImmediate({identifier:t})}_removeServiceInstance(e,t=he){this._delegate.container.getProvider(e).clearInstance(t)}_addComponent(e){c(this._delegate,e)}_addOrOverwriteComponent(e){u(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}}const Ae=new O("app-compat","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."});var xe=function t(){const n=S(Ie);return n.INTERNAL=Object.assign(Object.assign({},n.INTERNAL),{createFirebaseNamespace:t,extendNamespace:function(t){e(n,t)},createSubscribe:r,ErrorFactory:O,deepExtend:e}),n}();const De=new K("@firebase/app-compat");if("object"==typeof self&&self.self===self&&void 0!==self.firebase){De.warn("\n    Warning: Firebase is already defined in the global scope. Please make sure\n    Firebase library is only loaded once.\n  ");const e=self.firebase.SDK_VERSION;e&&0<=e.indexOf("LITE")&&De.warn("\n    Warning: You are trying to load Firebase while using Firebase Performance standalone script.\n    You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.\n    ")}const Re=xe;return m("@firebase/app-compat","0.1.39",void 0),Re.registerVersion("firebase","9.14.0","app-compat-cdn"),Re})),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("@firebase/app-compat"),require("@firebase/app")):"function"==typeof define&&define.amd?define(["@firebase/app-compat","@firebase/app"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).firebase,e.firebase.INTERNAL.modularAPIs)}(this,(function(e,t){"use strict";try{(function(){function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function r(){try{return"[object process]"===Object.prototype.toString.call(global.process)}catch(e){return!1}}function a(){var e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function o(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function s(){const e=i();return 0<=e.indexOf("MSIE ")||0<=e.indexOf("Trident/")}function l(){return"object"==typeof indexedDB}function d(e){const t=[];for(const[n,i]of Object.entries(e))Array.isArray(i)?i.forEach((e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))})):t.push(encodeURIComponent(n)+"="+encodeURIComponent(i));return t.length?"&"+t.join("&"):""}function c(e){const t={};return e.replace(/^\?/,"").split("&").forEach((e=>{var n,i;e&&([n,i]=e.split("="),t[decodeURIComponent(n)]=decodeURIComponent(i))})),t}function u(e){var t=e.indexOf("?");if(!t)return"";var n=e.indexOf("#",t);return e.substring(t,0<n?n:void 0)}function f(){}function h(e){return e&&e._delegate?e._delegate:e}function p(e,t){var n={};for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function g(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}function m(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registed for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted.  Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance."}}function v(e,...n){rn.logLevel<=$t.ERROR&&rn.error(`Auth (${t.SDK_VERSION}): ${e}`,...n)}function y(e,...t){throw w(e,...t)}function _(e,...t){return w(e,...t)}function b(e,t,n){var i=Object.assign(Object.assign({},tn()),{[t]:n});return new Vt("auth","Firebase",i).create(t,{appName:e.name})}function E(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&y(e,"argument-error"),b(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function w(e,...t){if("string"==typeof e)return nn.create(e,...t);{var n=t[0];const i=[...t.slice(1)];return i[0]&&(i[0].appName=e.name),e._errorFactory.create(n,...i)}}function T(e,t,...n){if(!e)throw w(t,...n)}function S(e){var t="INTERNAL ASSERTION FAILED: "+e;throw v(t),new Error(t)}function C(e,t){e||S(t)}function k(e){C(e instanceof Function,"Expected a class definition");let t=an.get(e);return t?C(t instanceof e,"Instance stored in cache mismatched with class"):(t=new e,an.set(e,t)),t}function I(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function A(){return"http:"===x()||"https:"===x()}function x(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}function D(e,t){C(e.emulator,"Emulator should always be set here");var n=e.emulator.url;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}function R(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function M(e,t,n,i,r={}){return N(e,r,(async()=>{let r={},a={};i&&("GET"===t?a=i:r={body:JSON.stringify(i)});var o=d(Object.assign({key:e.config.apiKey},a)).slice(1);const s=await e._getAdditionalHeaders();return s["Content-Type"]="application/json",e.languageCode&&(s["X-Firebase-Locale"]=e.languageCode),sn.fetch()(P(e,e.config.apiHost,n,o),Object.assign({method:t,headers:s,referrerPolicy:"no-referrer"},r))}))}async function N(e,t,n){e._canInitEmulator=!1;var i=Object.assign(Object.assign({},ln),t);try{const t=new cn(e),o=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();var r=await o.json();if("needConfirmation"in r)throw L(e,"account-exists-with-different-credential",r);if(o.ok&&!("errorMessage"in r))return r;{const t=o.ok?r.errorMessage:r.error.message,[n,s]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw L(e,"credential-already-in-use",r);if("EMAIL_EXISTS"===n)throw L(e,"email-already-in-use",r);if("USER_DISABLED"===n)throw L(e,"user-disabled",r);var a=i[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(s)throw b(e,a,s);y(e,a)}}catch(t){if(t instanceof zt)throw t;y(e,"network-request-failed")}}async function O(e,t,n,i,r={}){var a=await M(e,t,n,i,r);return"mfaPendingCredential"in a&&y(e,"multi-factor-auth-required",{_serverResponse:a}),a}function P(e,t,n,i){var r=`${t}${n}?${i}`;return e.config.emulator?D(e.config,r):`${e.config.apiScheme}://${r}`}function L(e,t,n){const i={appName:e.name};n.email&&(i.email=n.email),n.phoneNumber&&(i.phoneNumber=n.phoneNumber);const r=_(e,t,i);return r.customData._tokenResponse=n,r}function F(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function j(e){return 1e3*Number(e)}function B(e){var[t,n,i]=e.split(".");if(void 0===t||void 0===n||void 0===i)return v("JWT malformed, contained fewer than 3 sections"),null;try{var r=jt(n);return r?JSON.parse(r):(v("Failed to decode base64 JWT payload"),null)}catch(e){return v("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}async function U(e,t,n=!1){if(n)return t;try{return t}catch(n){throw n instanceof zt&&("auth/user-disabled"===(t=n.code)||"auth/user-token-expired"===t)&&e.auth.currentUser===e&&await e.auth.signOut(),n}}async function H(e){var t=e.auth,n=await e.getIdToken();T(null==(o=await U(e,async function(e,t){return M(e,"POST","/v1/accounts:lookup",t)}(t,{idToken:n})))?void 0:o.users.length,t,"internal-error");var i=o.users[0];e._notifyReloadListener(i);t=null!==(n=i.providerUserInfo)&&void 0!==n&&n.length?i.providerUserInfo.map((e=>{var t=e.providerId,n=p(e,["providerId"]);return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})):[];var r,a,o=(r=e.providerData,a=t,[...r.filter((e=>!a.some((t=>t.providerId===e.providerId)))),...a]);n=e.isAnonymous,t=!(e.email&&i.passwordHash||null!==o&&o.length),t=!!n&&t,t={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new fn(i.createdAt,i.lastLoginAt),isAnonymous:t};Object.assign(e,t)}function $(e,t){T("string"==typeof e||void 0===e,"internal-error",{appName:t})}function q(e,t,n){return`firebase:${e}:${t}:${n}`}function z(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Y(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(V(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(X(t))return"Blackberry";if(Q(t))return"Webos";if(G(t))return"Safari";if((t.includes("chrome/")||W(t))&&!t.includes("edge/"))return"Chrome";if(K(t))return"Android";var n=e.match(/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/);return 2===(null==n?void 0:n.length)?n[1]:"Other"}function V(e=i()){return/firefox\//i.test(e)}function G(e=i()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function W(e=i()){return/crios\//i.test(e)}function Y(e=i()){return/iemobile/i.test(e)}function K(e=i()){return/android/i.test(e)}function X(e=i()){return/blackberry/i.test(e)}function Q(e=i()){return/webos/i.test(e)}function J(e=i()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function Z(e=i()){return J(e)||K(e)||Q(e)||X(e)||/windows phone/i.test(e)||Y(e)}function ee(e,n=[]){let r;switch(e){case"Browser":r=z(i());break;case"Worker":r=`${z(i())}-${e}`;break;default:r=e}var a=n.length?n.join(","):"FirebaseCore-web";return`${r}/JsCore/${t.SDK_VERSION}/${a}`}function te(e){return h(e)}function ne(e,t,n){const i=te(e);T(i._canInitEmulator,i,"emulator-config-failed"),T(/^https?:\/\//.test(t),i,"invalid-emulator-scheme");var r=!(null==n||!n.disableWarnings);const a=ie(t);var{host:o,port:s}=function(e){const t=ie(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const i=n[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(i);var a;if(r)return{host:a=r[1],port:re(i.substr(a.length+1))};var[o,a]=i.split(":");return{host:o,port:re(a)}}(t);i.config.emulator={url:`${a}//${o}${null===s?"":`:${s}`}/`},i.settings.appVerificationDisabledForTesting=!0,i.emulatorConfig=Object.freeze({host:o,port:s,protocol:a.replace(":",""),options:Object.freeze({disableWarnings:r})}),r||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&"function"==typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function ie(e){var t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function re(e){if(!e)return null;var t=Number(e);return isNaN(t)?null:t}async function ae(e,t){return M(e,"POST","/v1/accounts:resetPassword",R(e,t))}async function oe(e,t){return M(e,"POST","/v1/accounts:update",t)}async function se(e,t){return M(e,"POST","/v1/accounts:sendOobCode",R(e,t))}async function le(e,t){return O(e,"POST","/v1/accounts:signInWithIdp",R(e,t))}async function de(e,t){return O(e,"POST","/v1/accounts:signUp",R(e,t))}function ce(e){return e.providerId||("phoneNumber"in e?"phone":null)}function ue(e,t,n,i){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch((n=>{if("auth/multi-factor-auth-required"===n.code)throw jn._fromErrorAndOperation(e,n,t,i);throw n}))}function fe(e){return new Set(e.map((({providerId:e})=>e)).filter((e=>!!e)))}async function he(e,t){const n=h(e);await ge(!0,n,t);const i=fe((e=n.auth,t={idToken:await n.getIdToken(),deleteProvider:[t]},await M(e,"POST","/v1/accounts:update",t)).providerUserInfo||[]);return n.providerData=n.providerData.filter((e=>i.has(e.providerId))),i.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}async function pe(e,t,n=!1){var i=await U(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return Fn._forOperation(e,"link",i)}async function ge(e,t,n){await H(t);var i=!1===e?"provider-already-linked":"no-such-provider";T(fe(t.providerData).has(n)===e,t.auth,i)}async function me(e,t,n=!1){var i=e.auth,r="reauthenticate";try{var a=await U(e,ue(i,r,t,e),n);T(a.idToken,i,"internal-error");var o=B(a.idToken);T(o,i,"internal-error");var s=o.sub;return T(e.uid===s,i,"user-mismatch"),Fn._forOperation(e,r,a)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&y(i,"user-mismatch"),e}}async function ve(e,t,n=!1){var i=await ue(e,"signIn",t);i=await Fn._fromIdTokenResponse(e,"signIn",i);return n||await e._updateCurrentUser(i.user),i}async function ye(e,t){return ve(te(e),t)}async function _e(e,t){var n=h(e);return await ge(!1,n,t.providerId),pe(n,t)}async function be(e,t){return me(h(e),t)}async function Ee(e,t){const n=te(e);var i=await O(n,"POST","/v1/accounts:signInWithCustomToken",R(n,{token:t,returnSecureToken:!0}));i=await Fn._fromIdTokenResponse(n,"signIn",i);return await n._updateCurrentUser(i.user),i}function we(e,t,n){var i;T(0<(null===(i=n.url)||void 0===i?void 0:i.length),e,"invalid-continue-uri"),T(void 0===n.dynamicLinkDomain||0<n.dynamicLinkDomain.length,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(T(0<n.iOS.bundleId.length,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(T(0<n.android.packageName.length,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function Te(e,t,n){var i=h(e),r={requestType:"PASSWORD_RESET",email:t};n&&we(i,r,n),await se(i,r)}async function Se(e,t){await M(e=h(e),"POST","/v1/accounts:update",R(e,{oobCode:t}))}async function Ce(e,t){var n=h(e),i=await ae(n,{oobCode:t}),r=i.requestType;switch(T(r,n,"internal-error"),r){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":T(i.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":T(i.mfaInfo,n,"internal-error");default:T(i.email,n,"internal-error")}let a=null;return i.mfaInfo&&(a=Bn._fromServerResponse(te(n),i.mfaInfo)),{data:{email:("VERIFY_AND_CHANGE_EMAIL"===i.requestType?i.newEmail:i.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===i.requestType?i.email:i.newEmail)||null,multiFactorInfo:a},operation:r}}async function ke(e,t,n){var i=h(e),r={requestType:"EMAIL_SIGNIN",email:t};T(n.handleCodeInApp,i,"argument-error"),n&&we(i,r,n),await se(i,r)}async function Ie(e,t){var n=A()?I():"http://localhost";return(n=(await M(e=h(e),"POST","/v1/accounts:createAuthUri",R(e,{identifier:t,continueUri:n}))).signinMethods)||[]}async function Ae(e,t){var n=h(e),i={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&we(n.auth,i,t),(i=(await se(n.auth,i)).email)!==e.email&&await e.reload()}async function xe(e,t,n){var i=h(e),r={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};n&&we(i.auth,r,n),(r=(await se(i.auth,r)).email)!==e.email&&await e.reload()}async function De(e,{displayName:t,photoURL:n}){if(void 0!==t||void 0!==n){const r=h(e);var i=await r.getIdToken();i=await U(r,async function(e,t){return M(e,"POST","/v1/accounts:update",t)}(r.auth,{idToken:i,displayName:t,photoUrl:n,returnSecureToken:!0}));r.displayName=i.displayName||null,r.photoURL=i.photoUrl||null;const a=r.providerData.find((({providerId:e})=>"password"===e));a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(i)}}async function Re(e,t,n){var i=e.auth;const r={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(r.email=t),n&&(r.password=n),i=await U(e,oe(i,r)),await e._updateTokensIfNecessary(i,!0)}function Me(e){var{user:t,_tokenResponse:n}=e;return t.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:function(e){if(!e)return null;var t=e.providerId,n=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},i=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!t&&null!=e&&e.idToken){var r=null===(r=null===(r=B(e.idToken))||void 0===r?void 0:r.firebase)||void 0===r?void 0:r.sign_in_provider;if(r)return new Hn(i,r="anonymous"!==r&&"custom"!==r?r:null)}if(!t)return null;switch(t){case"facebook.com":return new qn(i,n);case"github.com":return new zn(i,n);case"google.com":return new Vn(i,n);case"twitter.com":return new Gn(i,n,e.screenName||null);case"custom":case"anonymous":return new Hn(i,null);default:return new Hn(i,t,n)}}(n)}function Ne(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}function Oe(){return window}function Pe(){return void 0!==Oe().WorkerGlobalScope&&"function"==typeof Oe().importScripts}function Le(e,t){return e.transaction([oi],t?"readwrite":"readonly").objectStore(oi)}function Fe(){const e=indexedDB.open(ai,1);return new Promise(((t,n)=>{e.addEventListener("error",(()=>{n(e.error)})),e.addEventListener("upgradeneeded",(()=>{const t=e.result;try{t.createObjectStore(oi,{keyPath:si})}catch(t){n(t)}})),e.addEventListener("success",(async()=>{const n=e.result;var i;n.objectStoreNames.contains(oi)?t(n):(n.close(),i=indexedDB.deleteDatabase(ai),await new li(i).toPromise(),t(await Fe()))}))}))}async function je(e,t,n){var i=Le(e,!0).put({fbase_key:t,value:n});return new li(i).toPromise()}function Be(e,t){var n=Le(e,!0).delete(t);return new li(n).toPromise()}function Ue(e){return new Promise(((t,n)=>{const i=document.createElement("script");var r;i.setAttribute("src",e),i.onload=t,i.onerror=e=>{const t=_("internal-error");t.customData=e,n(t)},i.type="text/javascript",i.charset="UTF-8",(null!==(r=null===(r=document.getElementsByTagName("head"))||void 0===r?void 0:r[0])&&void 0!==r?r:document).appendChild(i)}))}function He(e){return`__${e}${Math.floor(1e6*Math.random())}`}async function $e(e,t,n){var i,r,a,o,s,l,d=await n.verify();try{let f;if(T("string"==typeof d,e,"argument-error"),T(n.type===vi,e,"argument-error"),f="string"==typeof t?{phoneNumber:t}:t,"session"in f){var c=f.session;if("phoneNumber"in f)return T("enroll"===c.type,e,"internal-error"),(s=e,l={idToken:c.credential,phoneEnrollmentInfo:{phoneNumber:f.phoneNumber,recaptchaToken:d}},await M(s,"POST","/v2/accounts/mfaEnrollment:start",R(s,l))).phoneSessionInfo.sessionInfo;T("signin"===c.type,e,"internal-error");var u=(null===(i=f.multiFactorHint)||void 0===i?void 0:i.uid)||f.multiFactorUid;return T(u,e,"missing-multi-factor-info"),(o={mfaPendingCredential:c.credential,mfaEnrollmentId:u,phoneSignInInfo:{recaptchaToken:d}},
await M(e,"POST","/v2/accounts/mfaSignIn:start",R(e,o))).phoneResponseInfo.sessionInfo}return(r=e,a={phoneNumber:f.phoneNumber,recaptchaToken:d},await M(r,"POST","/v1/accounts:sendVerificationCode",R(r,a))).sessionInfo}finally{n._reset()}}function qe(e,t){return t?k(t):(T(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}function ze(e){return ve(e.auth,new wi(e),e.bypassAuthState)}function Ve(e){var{auth:t,user:n}=e;return T(n,t,"internal-error"),me(n,new wi(e),e.bypassAuthState)}async function Ge(e){var{auth:t,user:n}=e;return T(n,t,"internal-error"),pe(n,new wi(e),e.bypassAuthState)}async function We(e,t){return Ke(e)._set(Xe(t),"true")}function Ye(e,t){Ii.set(e._key(),t)}function Ke(e){return k(e._redirectPersistence)}function Xe(e){return q(ki,e.config.apiKey,e.name)}function Qe(e,t,n){return async function(e,t,n){var i=te(e);E(e,t,An);const r=qe(i,n);return await We(r,i),r._openRedirect(i,t,"signInViaRedirect")}(e,t,n)}function Je(e,t,n){return async function(e,t,n){var i=h(e);E(i.auth,t,An);const r=qe(i.auth,n);await We(r,i.auth);var a=await tt(i);return r._openRedirect(i.auth,t,"reauthViaRedirect",a)}(e,t,n)}function Ze(e,t,n){return async function(e,t,n){var i=h(e);E(i.auth,t,An);const r=qe(i.auth,n);await ge(!1,i,t.providerId),await We(r,i.auth);var a=await tt(i);return r._openRedirect(i.auth,t,"linkViaRedirect",a)}(e,t,n)}async function et(e,t,n=!1){const i=te(e);var r=qe(i,t);const a=new Ai(i,r,n),o=await a.execute();return o&&!n&&(delete o.user._redirectEventId,await i._persistUserIfCurrent(o.user),await i._setRedirectUser(null,t)),o}async function tt(e){var t=Ne(`${e.uid}:::`);return e._redirectEventId=t,await e.auth._setRedirectUser(e),await e.auth._persistUserIfCurrent(e),t}function nt(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter((e=>e)).join("-")}function it({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===(null==t?void 0:t.code)}async function rt(e,t={}){return M(e,"GET","/v1/projects",t)}async function at(e){if(!e.config.emulator){var t=(await rt(e)).authorizedDomains;for(const n of t)try{if(function(e){const t=I(),{protocol:n,hostname:i}=new URL(t);if(e.startsWith("chrome-extension://")){var r=new URL(e);return""===r.hostname&&""===i?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&r.hostname===i}if(!Ri.test(n))return!1;if(Di.test(e))return i===e;const a=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+a+"|"+a+")$","i").test(i)}(n))return}catch(e){}y(e,"unauthorized-domain")}}function ot(){const e=Oe().___jsl;if(null!=e&&e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}function st(e){var t;return Ni=Ni||(t=e,new Promise(((e,n)=>{function i(){ot(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{ot(),n(_(t,"network-request-failed"))},timeout:Mi.get()})}if(null!==(r=null===(r=Oe().gapi)||void 0===r?void 0:r.iframes)&&void 0!==r&&r.Iframe)e(gapi.iframes.getContext());else{if(null===(r=Oe().gapi)||void 0===r||!r.load){var r=He("iframefcb");return Oe()[r]=()=>{gapi.load?i():n(_(t,"network-request-failed"))},Ue(`https://apis.google.com/js/api.js?onload=${r}`).catch((e=>n(e)))}i()}})).catch((e=>{throw Ni=null,e}))),Ni}async function lt(e){const n=await st(e);var i=Oe().gapi;return T(i,e,"internal-error"),n.open({where:document.body,url:function(e){var n=e.config;T(n.authDomain,e,"auth-domain-config-required");var i=n.emulator?D(n,Li):`https://${e.config.authDomain}/${Pi}`;const r={apiKey:n.apiKey,appName:e.name,v:t.SDK_VERSION};(n=ji.get(e.config.apiHost))&&(r.eid=n);const a=e._getFrameworks();return a.length&&(r.fw=a.join(",")),`${i}?${d(r).slice(1)}`}(e),messageHandlersFilter:i.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Fi,dontclear:!0},(t=>new Promise((async(n,i)=>{function r(){Oe().clearTimeout(o),n(t)}await t.restyle({setHideOnLeave:!1});const a=_(e,"network-request-failed"),o=Oe().setTimeout((()=>{i(a)}),Oi.get());t.ping(r).then(r,(()=>{i(a)}))}))))}function dt(e,t,n,r=500,a=600){var o=Math.max((window.screen.availHeight-a)/2,0).toString(),s=Math.max((window.screen.availWidth-r)/2,0).toString();let l="";const d=Object.assign(Object.assign({},Bi),{width:r.toString(),height:a.toString(),top:o,left:s});o=i().toLowerCase(),n&&(l=W(o)?"_blank":n),V(o)&&(t=t||"http://localhost",d.scrollbars="yes");var c;s=Object.entries(d).reduce(((e,[t,n])=>`${e}${t}=${n},`),"");if([n=i()]=[o],J(n)&&null!==(c=window.navigator)&&void 0!==c&&c.standalone&&"_self"!==l)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(i)}(t||"",l),new Ui(null);const u=window.open(t||"",l,s);T(u,e,"popup-blocked");try{u.focus()}catch(e){}return new Ui(u)}function ct(e,n,i,r,a,o){T(e.config.authDomain,e,"auth-domain-config-required"),T(e.config.apiKey,e,"invalid-api-key");const s={apiKey:e.config.apiKey,appName:e.name,authType:i,redirectUrl:r,v:t.SDK_VERSION,eventId:a};if(n instanceof An)for(var[l,c]of(n.setDefaultLanguage(e.languageCode),s.providerId=n.providerId||"",function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return;return 1}(n.getCustomParameters())||(s.customParameters=JSON.stringify(n.getCustomParameters())),Object.entries(o||{})))s[l]=c;if(n instanceof xn){const e=n.getScopes().filter((e=>""!==e));0<e.length&&(s.scopes=e.join(","))}e.tenantId&&(s.tid=e.tenantId);const u=s;for(const e of Object.keys(u))void 0===u[e]&&delete u[e];return`${e=e.config,e.emulator?D(e,$i):`https://${e.authDomain}/${Hi}`}?${d(u).slice(1)}`}function ut(){return window}async function ft(e,t,n){var i=ut().BuildInfo;C(t.sessionId,"AuthEvent did not contain a session ID");var r=await async function(e){const t=function(e){if(C(/[0-9a-zA-Z]+/.test(e),"Can only convert alpha-numeric strings"),"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map((e=>e.toString(16).padStart(2,"0"))).join("")}(t.sessionId);const a={};return J()?a.ibi=i.packageName:K()?a.apn=i.packageName:y(e,"operation-not-supported-in-this-environment"),i.displayName&&(a.appDisplayName=i.displayName),a.sessionId=r,ct(e,n,t.type,void 0,null!==(r=t.eventId)&&void 0!==r?r:void 0,a)}function ht(e){const t=ut().cordova;return new Promise((n=>{t.plugins.browsertab.isAvailable((r=>{let a=null;r?t.plugins.browsertab.openUrl(e):a=t.InAppBrowser.open(e,(r=i(),/(iPad|iPhone|iPod).*OS 7_\d/i.test(r)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(r)?"_blank":"_system"),"location=yes"),n(a)}))}))}function pt(e,t,n=null){return{type:t,eventId:n,urlResponse:null,sessionId:function(){const e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let i=0;i<Zi;i++){var n=Math.floor(Math.random()*t.length);e.push(t.charAt(n))}return e.join("")}(),postBody:null,tenantId:e.tenantId,error:_(e,"no-auth-event")}}async function gt(e){var t=await vt()._get(yt(e));return t&&await vt()._remove(yt(e)),t}function mt(e,t){var n,i,r;const a=(n=_t(t=t),i=_t(o=n.link?decodeURIComponent(n.link):void 0).link,(n=_t(r=n.deep_link_id?decodeURIComponent(n.deep_link_id):void 0).link)||r||i||o||t);var o;return a.includes("/__/auth/callback")?(o=(o=null===(o=null===(o=null==(o=(o=_t(a)).firebaseError?function(e){try{return JSON.parse(e)}catch(e){return null}}(decodeURIComponent(o.firebaseError)):null)?void 0:o.code)||void 0===o?void 0:o.split("auth/"))||void 0===o?void 0:o[1])?_(o):null)?{type:e.type,eventId:e.eventId,tenantId:e.tenantId,error:o,urlResponse:null,sessionId:null,postBody:null}:{type:e.type,eventId:e.eventId,tenantId:e.tenantId,sessionId:e.sessionId,urlResponse:a,postBody:null}:null}function vt(){return k(ei)}function yt(e){return q("authEvent",e.config.apiKey,e.name)}function _t(e){if(null==e||!e.includes("?"))return{};const[,...t]=e.split("?");return c(t.join("?"))}function bt(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:_("no-auth-event")}}function Et(){var e;return(null===(e=null===self||void 0===self?void 0:self.location)||void 0===e?void 0:e.protocol)||null}function wt(e=i()){return!("file:"!==Et()&&"ionic:"!==Et()&&"capacitor:"!==Et()||!e.toLowerCase().match(/iphone|ipad|ipod|android/))}function Tt(e=i()){return s()&&11===(null===document||void 0===document?void 0:document.documentMode)||([e=i()]=[e],/Edge\/\d+/.test(e))}function St(){try{const t=self.localStorage;var e=Ne();if(t)return t.setItem(e,"1"),t.removeItem(e),!Tt()||l()}catch(e){return Ct()&&l()}return!1}function Ct(){return"undefined"!=typeof global&&"WorkerGlobalScope"in global&&"importScripts"in global}function kt(){return("http:"===Et()||"https:"===Et()||a()||wt())&&!(o()||r())&&St()&&!Ct()}function It(){return wt()&&"undefined"!=typeof document}async function At(e){await e._initializationPromise;const t=xt();var n=q(ar,e.config.apiKey,e.name);t&&t.setItem(n,e._getPersistence())}function xt(){var e;try{return(null===(e="undefined"!=typeof window?window:null)?void 0:e.sessionStorage)||null}catch(e){return null}}function Dt(e){return e.unwrap()}function Rt(e,t){var n,i,r,a=null===(i=t.customData)||void 0===i?void 0:i._tokenResponse;if("auth/multi-factor-auth-required"===(null==t?void 0:t.code)){t.resolver=new lr(e,(n=t,r=h(e),T((o=n).customData.operationType,r,"argument-error"),T(null===(i=o.customData._serverResponse)||void 0===i?void 0:i.mfaPendingCredential,r,"argument-error"),Yn._fromError(r,o)))}else if(a){var o=Mt(t);const e=t;o&&(e.credential=o,e.tenantId=a.tenantId||void 0,e.email=a.email||void 0,e.phoneNumber=a.phoneNumber||void 0)}}function Mt(e){var t=(e instanceof zt?e.customData:e)._tokenResponse;if(!t)return null;if(!(e instanceof zt)&&"temporaryProof"in t&&"phoneNumber"in t)return Ei.credentialFromResult(e);const n=t.providerId;if(!n||n===Zt.PASSWORD)return null;let i;switch(n){case Zt.GOOGLE:i=Mn;break;case Zt.FACEBOOK:i=Rn;break;case Zt.GITHUB:i=Nn;break;case Zt.TWITTER:i=Ln;break;default:var{oauthIdToken:r,oauthAccessToken:a,oauthTokenSecret:o,pendingToken:s,nonce:l}=t;return a||o||r||s?s?n.startsWith("saml.")?On._create(n,s):Tn._fromParams({providerId:n,signInMethod:n,pendingToken:s,idToken:r,accessToken:a}):new Dn(n).credential({idToken:r,accessToken:a,rawNonce:l}):null}return e instanceof zt?i.credentialFromError(e):i.credentialFromResult(e)}function Nt(e,t){return t.catch((t=>{throw t instanceof zt&&Rt(e,t),t})).then((e=>{var t=e.operationType,n=e.user;return{operationType:t,credential:Mt(e),additionalUserInfo:Me(e),user:dr.getOrCreate(n)}}))}async function Ot(e,t){const n=await t;return{verificationId:n.verificationId,confirm:t=>Nt(e,n.confirm(t))}}function Pt(e,t,n){let i=e;"function"!=typeof e&&({next:i,error:t,complete:n}=e);const r=i;return{next:e=>r(e&&dr.getOrCreate(e)),error:t,complete:n}}var Lt=n(e);const Ft={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();var n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_;const i=[];for(let t=0;t<e.length;t+=3){var r=e[t],a=t+1<e.length,o=a?e[t+1]:0,s=t+2<e.length,l=s?e[t+2]:0;let d=(15&o)<<2|l>>6,c=63&l;s||(c=64,a||(d=64)),i.push(n[r>>2],n[(3&r)<<4|o>>4],n[d],n[c])}return i.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(function(e){const t=[];let n=0;for(let i=0;i<e.length;i++){let r=e.charCodeAt(i);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(55296==(64512&r)&&i+1<e.length&&56320==(64512&e.charCodeAt(i+1))?(r=65536+((1023&r)<<10)+(1023&e.charCodeAt(++i)),t[n++]=r>>18|240,t[n++]=r>>12&63|128):t[n++]=r>>12|224,t[n++]=r>>6&63|128),t[n++]=63&r|128)}return t}(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,i=0;for(;n<e.length;){var r,a,o=e[n++];o<128?t[i++]=String.fromCharCode(o):191<o&&o<224?(r=e[n++],t[i++]=String.fromCharCode((31&o)<<6|63&r)):239<o&&o<365?(a=((7&o)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536,t[i++]=String.fromCharCode(55296+(a>>10)),t[i++]=String.fromCharCode(56320+(1023&a))):(r=e[n++],a=e[n++],t[i++]=String.fromCharCode((15&o)<<12|(63&r)<<6|63&a))}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();var n=t?this.charToByteMapWebSafe_:this.charToByteMap_;const i=[];for(let t=0;t<e.length;){var r=n[e.charAt(t++)],a=t<e.length?n[e.charAt(t)]:0;++t;var o=t<e.length?n[e.charAt(t)]:64;++t;var s=t<e.length?n[e.charAt(t)]:64;if(++t,null==r||null==a||null==o||null==s)throw Error();i.push(r<<2|a>>4),64!==o&&(i.push(a<<4&240|o>>2),64!==s&&i.push(o<<6&192|s))}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}},jt=function(e){try{return Ft.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},Bt=()=>function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__,Ut=()=>{if("undefined"!=typeof process&&void 0!==process.env){var e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0}},Ht=()=>{if("undefined"!=typeof document){let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}var e=t&&jt(t[1]);return e&&JSON.parse(e)}};var $t,qt;class zt extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,zt.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Vt.prototype.create)}}class Vt{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){var n,i=t[0]||{},r=`${this.service}/${e}`,a=(a=this.errors[e])?(n=i,a.replace(Gt,((e,t)=>{var i=n[t];return null!=i?String(i):`<${t}?>`}))):"Error";a=`${this.serviceName}: ${a} (${r}).`;return new zt(r,a,i)}}const Gt=/\{\$([^}]+)}/g;class Wt{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then((()=>{e(this)})).catch((e=>{this.error(e)}))}next(e){this.forEachObserver((t=>{t.next(e)}))}error(e){this.forEachObserver((t=>{t.error(e)})),this.close(e)}complete(){this.forEachObserver((e=>{e.complete()})),this.close()}subscribe(e,t,n){let i;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");i=function(e,t){if("object"!=typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===i.next&&(i.next=f),void 0===i.error&&(i.error=f),void 0===i.complete&&(i.complete=f);var r=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch(e){}})),this.observers.push(i),r}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],--this.observerCount,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then((()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}}))}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}(qt=$t=$t||{})[qt.DEBUG=0]="DEBUG",qt[qt.VERBOSE=1]="VERBOSE",qt[qt.INFO=2]="INFO",qt[qt.WARN=3]="WARN",qt[qt.ERROR=4]="ERROR",qt[qt.SILENT=5]="SILENT";const Yt={debug:$t.DEBUG,verbose:$t.VERBOSE,info:$t.INFO,warn:$t.WARN,error:$t.ERROR,silent:$t.SILENT},Kt=$t.INFO,Xt={[$t.DEBUG]:"log",[$t.VERBOSE]:"log",[$t.INFO]:"info",[$t.WARN]:"warn",[$t.ERROR]:"error"},Qt=(e,t,...n)=>{if(!(t<e.logLevel)){var i=(new Date).toISOString(),r=Xt[t];if(!r)throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`);console[r](`[${i}]  ${e.name}:`,...n)}};class Jt{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const Zt={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},en={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"},tn=g,nn=new Vt("auth","Firebase",g()),rn=new class{constructor(e){this.name=e,this._logLevel=Kt,this._logHandler=Qt,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in $t))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?Yt[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,$t.DEBUG,...e),this._logHandler(this,$t.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,$t.VERBOSE,...e),this._logHandler(this,$t.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,$t.INFO,...e),this._logHandler(this,$t.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,$t.WARN,...e),this._logHandler(this,$t.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,$t.ERROR,...e),this._logHandler(this,$t.ERROR,...e)}}("@firebase/auth"),an=new Map;class on{constructor(e,t){C((this.shortDelay=e)<(this.longDelay=t),"Short delay should be less than long delay!"),this.isMobile="undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(i())||o()}get(){return"undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(A()||a()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}class sn{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl||("undefined"!=typeof self&&"fetch"in self?self.fetch:void S("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill"))}static headers(){return this.headersImpl||("undefined"!=typeof self&&"Headers"in self?self.Headers:void S("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill"))}static response(){return this.responseImpl||("undefined"!=typeof self&&"Response"in self?self.Response:void S("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill"))}}const ln={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error"},dn=new on(3e4,6e4);class cn{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise(((e,t)=>{this.timer=setTimeout((()=>t(_(this.auth,"network-request-failed"))),dn.get())}))}clearNetworkTimeout(){clearTimeout(this.timer)}}class un{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){if(e){var t=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),t}return this.errorBackoff=3e4,t=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5,Math.max(0,t)}schedule(e=!1){var t;this.isRunning&&(t=this.getInterval(e),this.timerId=setTimeout((async()=>{await this.iteration()}),t))}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===(null==e?void 0:e.code)&&this.schedule(!0))}this.schedule()}}class fn{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=F(this.lastLoginAt),this.creationTime=F(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}class hn{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){T(e.idToken,"internal-error"),T(void 0!==e.idToken,"internal-error"),T(void 0!==e.refreshToken,"internal-error");var t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):(T(t=B(e.idToken),"internal-error"),T(void 0!==t.exp,"internal-error"),T(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat));this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return T(!this.accessToken||this.refreshToken,e,"user-token-expired"),t||!this.accessToken||this.isExpired?this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){var n,i,{accessToken:r,refreshToken:a,expiresIn:o}=(i=t,await{accessToken:(o=await N(n=e,{},(async()=>{var e=d({grant_type:"refresh_token",refresh_token:i}).slice(1),{tokenApiHost:t,apiKey:r}=n.config,r=P(n,t,"/v1/token",`key=${r}`);const a=await n._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",sn.fetch()(r,{method:"POST",headers:a,body:e})}))).access_token,expiresIn:o.expires_in,refreshToken:o.refresh_token});this.updateTokensAndExpiration(r,a,Number(o))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){var{refreshToken:n,accessToken:i,expirationTime:r}=t;const a=new hn;return n&&(T("string"==typeof n,"internal-error",{appName:e}),a.refreshToken=n),i&&(T("string"==typeof i,"internal-error",{appName:e}),a.accessToken=i),r&&(T("number"==typeof r,"internal-error",{appName:e}),a.expirationTime=r),a}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new hn,this.toJSON())}_performRefresh(){return S("not implemented")}}class pn{constructor(e){var{uid:t,auth:n,stsTokenManager:i}=e,r=p(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new un(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=r.displayName||null,this.email=r.email||null,this.emailVerified=r.emailVerified||!1,this.phoneNumber=r.phoneNumber||null,this.photoURL=r.photoURL||null,this.isAnonymous=r.isAnonymous||!1,this.tenantId=r.tenantId||null,this.providerData=r.providerData?[...r.providerData]:[],this.metadata=new fn(r.createdAt||void 0,r.lastLoginAt||void 0)}async getIdToken(e){var t=await U(this,this.stsTokenManager.getToken(this.auth,e));return T(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=h(e);var i=await n.getIdToken(t),r=B(i);T(r&&r.exp&&r.auth_time&&r.iat,n.auth,"internal-error");var a="object"==typeof r.firebase?r.firebase:void 0,o=null==a?void 0:a.sign_in_provider;return{claims:r,token:i,authTime:F(j(r.auth_time)),issuedAtTime:F(j(r.iat)),expirationTime:F(j(r.exp)),signInProvider:o||null,signInSecondFactor:(null==a?void 0:a.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=h(e);await H(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(T(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map((e=>Object.assign({},e))),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){return new pn(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}))}_onReload(e){T(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await H(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){var e=await this.getIdToken();return await U(this,async function(e,t){return M(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map((e=>Object.assign({},e))),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n=null!==(o=t.displayName)&&void 0!==o?o:void 0,i=null!==(g=t.email)&&void 0!==g?g:void 0,r=null!==(s=t.phoneNumber)&&void 0!==s?s:void 0,a=null!==(d=t.photoURL)&&void 0!==d?d:void 0,o=null!==(l=t.tenantId)&&void 0!==l?l:void 0,s=null!==(g=t._redirectEventId)&&void 0!==g?g:void 0,l=null!==(d=t.createdAt)&&void 0!==d?d:void 0,d=null!==(g=t.lastLoginAt)&&void 0!==g?g:void 0;const{uid:c,emailVerified:u,isAnonymous:f,providerData:h,stsTokenManager:p}=t;T(c&&p,e,"internal-error");var g=hn.fromJSON(this.name,p);T("string"==typeof c,e,"internal-error"),$(n,e.name),$(i,e.name),T("boolean"==typeof u,e,"internal-error"),T("boolean"==typeof f,e,"internal-error"),$(r,e.name),$(a,e.name),$(o,e.name),$(s,e.name),$(l,e.name),$(d,e.name);const m=new pn({uid:c,auth:e,email:i,emailVerified:u,displayName:n,isAnonymous:f,photoURL:a,phoneNumber:r,tenantId:o,stsTokenManager:g,createdAt:l,lastLoginAt:d});return h&&Array.isArray(h)&&(m.providerData=h.map((e=>Object.assign({},e)))),s&&(m._redirectEventId=s),m}static async _fromIdTokenResponse(e,t,n=!1){const i=new hn;i.updateFromServerResponse(t);var r=new pn({uid:t.localId,auth:e,stsTokenManager:i,isAnonymous:n});return await H(r),r}}class gn{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){var t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}gn.type="NONE";const mn=gn;class vn{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;var{config:i,name:r}=this.auth;this.fullUserKey=q(this.userKey,i.apiKey,r),this.fullPersistenceKey=q("persistence",i.apiKey,r),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){var e=await this.persistence._get(this.fullUserKey);return e?pn._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence!==e){var t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,n="authUser"){if(!t.length)return new vn(k(mn),e,n);const i=(await Promise.all(t.map((async e=>{if(await e._isAvailable())return e})))).filter((e=>e));let r=i[0]||k(mn);const a=q(n,e.config.apiKey,e.name);let o=null;for(const n of t)try{var s=await n._get(a);if(s){var l=pn._fromJSON(e,s);n!==r&&(o=l),r=n;break}}catch(e){}var d=i.filter((e=>e._shouldAllowMigration));return r._shouldAllowMigration&&d.length&&(r=d[0],o&&await r._set(a,o.toJSON()),await Promise.all(t.map((async e=>{if(e!==r)try{await e._remove(a)}catch(e){}})))),new vn(r,e,n)}}class yn{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){var n=t=>new Promise(((n,i)=>{try{n(e(t))}catch(n){i(n)}}));n.onAbort=t,this.queue.push(n);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser!==e){const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const n of t)try{n()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==e?void 0:e.message})}}}}class _n{constructor(e,t,n){this.app=e,this.heartbeatServiceProvider=t,this.config=n,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),
this.authStateSubscription=new bn(this),this.idTokenSubscription=new bn(this),this.beforeStateQueue=new yn(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=nn,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=n.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=k(t)),this._initializationPromise=this.queue((async()=>{var n;if(!this._deleted&&(this.persistenceManager=await vn.create(this,e),!this._deleted)){if(null!==(n=this._popupRedirectResolver)&&void 0!==n&&n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(n){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(n=this.currentUser)||void 0===n?void 0:n.uid)||null,this._deleted||(this._isInitialized=!0)}})),this._initializationPromise}async _onStorageEvent(){if(!this._deleted){var e=await this.assertedPersistence.getCurrentUser();if(this.currentUser||e)return this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0)}}async initializeCurrentUser(e){var t,n,i,r=await this.assertedPersistence.getCurrentUser();let a=r,o=!1;if(e&&this.config.authDomain&&(await this.getOrInitRedirectPersistenceManager(),t=null===(i=this.redirectUser)||void 0===i?void 0:i._redirectEventId,n=null==a?void 0:a._redirectEventId,i=await this.tryRedirectSignIn(e),t&&t!==n||null==i||!i.user||(a=i.user,o=!0)),!a)return this.directlySetCurrentUser(null);if(a._redirectEventId)return T(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===a._redirectEventId?this.directlySetCurrentUser(a):this.reloadAndSetCurrentUserOrClear(a);if(o)try{await this.beforeStateQueue.runMiddleware(a)}catch(e){a=r,this._popupRedirectResolver._overrideRedirectResult(this,(()=>Promise.reject(e)))}return a?this.reloadAndSetCurrentUserOrClear(a):this.directlySetCurrentUser(null)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await H(e)}catch(e){if("auth/network-request-failed"!==(null==e?void 0:e.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;var e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?h(e):null;return t&&T(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&T(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue((async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()}))}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue((async()=>{await this.assertedPersistence.setPersistence(k(e))}))}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new Vt("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){var t;return this.redirectPersistenceManager||(T(t=e&&k(e)||this._popupRedirectResolver,this,"argument-error"),this.redirectPersistenceManager=await vn.create(this,[k(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()),this.redirectPersistenceManager}async _redirectUserForId(e){var t;return this._isInitialized&&await this.queue((async()=>{})),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(e)))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e;this._isInitialized&&(this.idTokenSubscription.next(this.currentUser),e=null!==(e=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==e?e:null,this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser)))}registerStateListener(e,t,n,i){if(this._deleted)return()=>{};const r="function"==typeof t?t:t.next.bind(t),a=this._isInitialized?Promise.resolve():this._initializationPromise;return T(a,this,"internal-error"),a.then((()=>r(this.currentUser))),"function"==typeof t?e.addObserver(t,n,i):e.addObserver(t)}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),(this.currentUser=e)?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return T(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=ee(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);var t=await(null===(t=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===t?void 0:t.getHeartbeatsHeader());return t&&(e["X-Firebase-Client"]=t),e}}class bn{constructor(e){this.auth=e,this.observer=null,this.addObserver=function(e){const t=new Wt(e,void 0);return t.subscribe.bind(t)}((e=>this.observer=e))}get next(){return T(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}class En{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return S("not implemented")}_getIdTokenResponse(e){return S("not implemented")}_linkToIdToken(e,t){return S("not implemented")}_getReauthenticationResolver(e){return S("not implemented")}}class wn extends En{constructor(e,t,n,i=null){super("password",n),this._email=e,this._password=t,this._tenantId=i}static _fromEmailAndPassword(e,t){return new wn(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new wn(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){var t="string"==typeof e?JSON.parse(e):e;if(null!=t&&t.email&&null!=t&&t.password){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return async function(e,t){return O(e,"POST","/v1/accounts:signInWithPassword",R(e,t))}(e,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(e,t){return O(e,"POST","/v1/accounts:signInWithEmailLink",R(e,t))}(e,{email:this._email,oobCode:this._password});default:y(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return oe(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(e,t){return O(e,"POST","/v1/accounts:signInWithEmailLink",R(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:y(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}class Tn extends En{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Tn(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):y("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){var t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:i}=t;t=p(t,["providerId","signInMethod"]);if(!n||!i)return null;const r=new Tn(n,i);return r.idToken=t.idToken||void 0,r.accessToken=t.accessToken||void 0,r.secret=t.secret,r.nonce=t.nonce,r.pendingToken=t.pendingToken||null,r}_getIdTokenResponse(e){return le(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,le(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,le(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=d(t)}return e}}const Sn={USER_NOT_FOUND:"user-not-found"};class Cn extends En{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Cn({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Cn({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return O(e,"POST","/v1/accounts:signInWithPhoneNumber",R(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){var n=await O(e,"POST","/v1/accounts:signInWithPhoneNumber",R(e,t));if(n.temporaryProof)throw L(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return O(e,"POST","/v1/accounts:signInWithPhoneNumber",R(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),Sn)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){var{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:i}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:i}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){var{verificationId:t,verificationCode:n,phoneNumber:i,temporaryProof:r}=e="string"==typeof e?JSON.parse(e):e;return n||t||i||r?new Cn({verificationId:t,verificationCode:n,phoneNumber:i,temporaryProof:r}):null}}class kn{constructor(e){var t=c(u(e)),n=null!==(i=t.apiKey)&&void 0!==i?i:null,i=null!==(r=t.oobCode)&&void 0!==r?r:null,r=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=t.mode)&&void 0!==r?r:null);T(n&&i&&r,"argument-error"),this.apiKey=n,this.operation=r,this.code=i,this.continueUrl=null!==(i=t.continueUrl)&&void 0!==i?i:null,this.languageCode=null!==(i=t.languageCode)&&void 0!==i?i:null,this.tenantId=null!==(t=t.tenantId)&&void 0!==t?t:null}static parseLink(e){var t,n,i=(t=(i=c(u(e=e)).link)?c(u(i)).deep_link_id:null,((n=c(u(e)).deep_link_id)?c(u(n)).link:null)||n||t||i||e);try{return new kn(i)}catch(e){return null}}}class In{constructor(){this.providerId=In.PROVIDER_ID}static credential(e,t){return wn._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){var n=kn.parseLink(t);return T(n,"argument-error"),wn._fromEmailAndCode(e,n.code,n.tenantId)}}In.PROVIDER_ID="password",In.EMAIL_PASSWORD_SIGN_IN_METHOD="password",In.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class An{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class xn extends An{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Dn extends xn{static credentialFromJSON(e){var t="string"==typeof e?JSON.parse(e):e;return T("providerId"in t&&"signInMethod"in t,"argument-error"),Tn._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return T(e.idToken||e.accessToken,"argument-error"),Tn._fromParams(Object.assign(Object.assign({},e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return Dn.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return Dn.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;var{oauthIdToken:t,oauthAccessToken:n,oauthTokenSecret:i,pendingToken:r,nonce:a,providerId:o}=e;if(!(n||i||t||r))return null;if(!o)return null;try{return new Dn(o)._credential({idToken:t,accessToken:n,nonce:a,pendingToken:r})}catch(e){return null}}}class Rn extends xn{constructor(){super("facebook.com")}static credential(e){return Tn._fromParams({providerId:Rn.PROVIDER_ID,signInMethod:Rn.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Rn.credentialFromTaggedObject(e)}static credentialFromError(e){return Rn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Rn.credential(e.oauthAccessToken)}catch(e){return null}}}Rn.FACEBOOK_SIGN_IN_METHOD="facebook.com",Rn.PROVIDER_ID="facebook.com";class Mn extends xn{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Tn._fromParams({providerId:Mn.PROVIDER_ID,signInMethod:Mn.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Mn.credentialFromTaggedObject(e)}static credentialFromError(e){return Mn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;var{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return Mn.credential(t,n)}catch(e){return null}}}Mn.GOOGLE_SIGN_IN_METHOD="google.com",Mn.PROVIDER_ID="google.com";class Nn extends xn{constructor(){super("github.com")}static credential(e){return Tn._fromParams({providerId:Nn.PROVIDER_ID,signInMethod:Nn.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Nn.credentialFromTaggedObject(e)}static credentialFromError(e){return Nn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Nn.credential(e.oauthAccessToken)}catch(e){return null}}}Nn.GITHUB_SIGN_IN_METHOD="github.com",Nn.PROVIDER_ID="github.com";class On extends En{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return le(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,le(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,le(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){var{providerId:t,signInMethod:n,pendingToken:i}="string"==typeof e?JSON.parse(e):e;return t&&n&&i&&t===n?new On(t,i):null}static _create(e,t){return new On(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}class Pn extends An{constructor(e){T(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return Pn.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return Pn.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){var t=On.fromJSON(e);return T(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;var{pendingToken:t,providerId:n}=e;if(!t||!n)return null;try{return On._create(n,t)}catch(e){return null}}}class Ln extends xn{constructor(){super("twitter.com")}static credential(e,t){return Tn._fromParams({providerId:Ln.PROVIDER_ID,signInMethod:Ln.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return Ln.credentialFromTaggedObject(e)}static credentialFromError(e){return Ln.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;var{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return Ln.credential(t,n)}catch(e){return null}}}Ln.TWITTER_SIGN_IN_METHOD="twitter.com",Ln.PROVIDER_ID="twitter.com";class Fn{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,i=!1){var r=await pn._fromIdTokenResponse(e,n,i),a=ce(n);return new Fn({user:r,providerId:a,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);var i=ce(n);return new Fn({user:e,providerId:i,_tokenResponse:n,operationType:t})}}class jn extends zt{constructor(e,t,n,i){var r;super(t.code,t.message),this.operationType=n,this.user=i,Object.setPrototypeOf(this,jn.prototype),this.customData={appName:e.name,tenantId:null!==(r=e.tenantId)&&void 0!==r?r:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,i){return new jn(e,t,n,i)}}class Bn{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?Un._fromServerResponse(e,t):y(e,"internal-error")}}class Un extends Bn{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new Un(t)}}class Hn{constructor(e,t,n={}){this.isNewUser=e,this.providerId=t,this.profile=n}}class $n extends Hn{constructor(e,t,n,i){super(e,t,n),this.username=i}}class qn extends Hn{constructor(e,t){super(e,"facebook.com",t)}}class zn extends $n{constructor(e,t){super(e,"github.com",t,"string"==typeof(null==t?void 0:t.login)?null==t?void 0:t.login:null)}}class Vn extends Hn{constructor(e,t){super(e,"google.com",t)}}class Gn extends $n{constructor(e,t,n){super(e,"twitter.com",t,n)}}class Wn{constructor(e,t,n){this.type=e,this.credential=t,this.auth=n}static _fromIdtoken(e,t){return new Wn("enroll",e,t)}static _fromMfaPendingCredential(e){return new Wn("signin",e)}toJSON(){return{multiFactorSession:{["enroll"===this.type?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(e){var t;if(null!=e&&e.multiFactorSession){if(null!==(t=e.multiFactorSession)&&void 0!==t&&t.pendingCredential)return Wn._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(null!==(t=e.multiFactorSession)&&void 0!==t&&t.idToken)return Wn._fromIdtoken(e.multiFactorSession.idToken)}return null}}class Yn{constructor(e,t,n){this.session=e,this.hints=t,this.signInResolver=n}static _fromError(e,t){const n=te(e),i=t.customData._serverResponse;var r=(i.mfaInfo||[]).map((e=>Bn._fromServerResponse(n,e)));T(i.mfaPendingCredential,n,"internal-error");const a=Wn._fromMfaPendingCredential(i.mfaPendingCredential);return new Yn(a,r,(async e=>{var r=await e._process(n,a);delete i.mfaInfo,delete i.mfaPendingCredential;var o=Object.assign(Object.assign({},i),{idToken:r.idToken,refreshToken:r.refreshToken});switch(t.operationType){case"signIn":var s=await Fn._fromIdTokenResponse(n,t.operationType,o);return await n._updateCurrentUser(s.user),s;case"reauthenticate":return T(t.user,n,"internal-error"),Fn._forOperation(t.user,t.operationType,o);default:y(n,"internal-error")}}))}async resolveSignIn(e){return this.signInResolver(e)}}class Kn{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload((t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map((t=>Bn._fromServerResponse(e.auth,t))))}))}static _fromUser(e){return new Kn(e)}async getSession(){return Wn._fromIdtoken(await this.user.getIdToken(),this.user.auth)}async enroll(e,t){const n=e;var i=await this.getSession();i=await U(this.user,n._process(this.user.auth,i,t));return await this.user._updateTokensIfNecessary(i),this.user.reload()}async unenroll(e){const t="string"==typeof e?e:e.uid;var n,i=await this.user.getIdToken();i=await U(this.user,(n=this.user.auth,e={idToken:i,mfaEnrollmentId:t},M(n,"POST","/v2/accounts/mfaEnrollment:withdraw",R(n,e))));this.enrolledFactors=this.enrolledFactors.filter((({uid:e})=>e!==t)),await this.user._updateTokensIfNecessary(i);try{await this.user.reload()}catch(e){if("auth/user-token-expired"!==(null==e?void 0:e.code))throw e}}}const Xn=new WeakMap,Qn="__sak";class Jn{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Qn,"1"),this.storage.removeItem(Qn),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){var t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class Zn extends Jn{constructor(){var e;super((()=>window.localStorage),"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=(G(e=i())||J(e))&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),this.fallbackToPolling=Z(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const i of Object.keys(this.listeners)){var t=this.storage.getItem(i),n=this.localCache[i];t!==n&&e(i,n,t)}}onStorageEvent(e,t=!1){if(e.key){const i=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const n=this.storage.getItem(i);if(e.newValue!==n)null!==e.newValue?this.storage.setItem(i,e.newValue):this.storage.removeItem(i);else if(this.localCache[i]===e.newValue&&!t)return}var n=()=>{var e=this.storage.getItem(i);!t&&this.localCache[i]===e||this.notifyListeners(i,e)};const r=this.storage.getItem(i);s()&&10===document.documentMode&&r!==e.newValue&&e.newValue!==e.oldValue?setTimeout(n,10):n()}else this.forAllChangedKeys(((e,t,n)=>{this.notifyListeners(e,n)}))}notifyListeners(e,t){this.localCache[e]=t;var n=this.listeners[e];if(n)for(const e of Array.from(n))e(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval((()=>{this.forAllChangedKeys(((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)}))}),1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){var t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}Zn.type="LOCAL";const ei=Zn;class ti extends Jn{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(e,t){}_removeListener(e,t){}}ti.type="SESSION";const ni=ti;class ii{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){var t=this.receivers.find((t=>t.isListeningto(e)));return t||(t=new ii(e),this.receivers.push(t),t)}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:i,data:r}=t.data;var a=this.handlersMap[i];null!=a&&a.size&&(t.ports[0].postMessage({status:"ack",eventId:n,eventType:i}),a=Array.from(a).map((async e=>e(t.origin,r))),a=await Promise.all(a.map((async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}}))),t.ports[0].postMessage({status:"done",eventId:n,eventType:i,response:a}))}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}ii.receivers=[];class ri{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const i="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let r,a;return new Promise(((o,s)=>{const l=Ne("",20);i.port1.start();const d=setTimeout((()=>{s(new Error("unsupported_event"))}),n);a={messageChannel:i,onMessage(e){var t=e;if(t.data.eventId===l)switch(t.data.status){case"ack":clearTimeout(d),r=setTimeout((()=>{s(new Error("timeout"))}),3e3);break;case"done":clearTimeout(r),o(t.data.response);break;default:clearTimeout(d),clearTimeout(r),s(new Error("invalid_response"))}}},this.handlers.add(a),i.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[i.port2])})).finally((()=>{a&&this.removeMessageHandler(a)}))}}const ai="firebaseLocalStorageDb",oi="firebaseLocalStorage",si="fbase_key";class li{constructor(e){this.request=e}toPromise(){return new Promise(((e,t)=>{this.request.addEventListener("success",(()=>{e(this.request.result)})),this.request.addEventListener("error",(()=>{t(this.request.error)}))}))}}class di{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then((()=>{}),(()=>{}))}async _openDb(){return this.db||(this.db=await Fe(),this.db)}async _withRetries(e){let t=0;for(;;)try{return e(await this._openDb())}catch(e){if(3<t++)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Pe()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ii._getInstance(Pe()?self:null),this.receiver._subscribe("keyChanged",(async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)}))),this.receiver._subscribe("ping",(async()=>["keyChanged"]))}async initializeSender(){var e,t,n;this.activeServiceWorker=await async function(){if(null===navigator||void 0===navigator||!navigator.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),this.activeServiceWorker&&(this.sender=new ri(this.activeServiceWorker),(n=await this.sender._send("ping",{},800))&&null!==(e=n[0])&&void 0!==e&&e.fulfilled&&null!==(t=n[0])&&void 0!==t&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0))}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(e){}}async _isAvailable(){try{if(!indexedDB)return!1;var e=await Fe();return await je(e,Qn,"1"),await Be(e,Qn),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite((async()=>(await this._withRetries((n=>je(n,e,t))),this.localCache[e]=t,this.notifyServiceWorker(e))))}async _get(e){var t=await this._withRetries((t=>async function(e,t){var n=Le(e,!1).get(t);return void 0===(n=await new li(n).toPromise())?null:n.value}(t,e)));return this.localCache[e]=t}async _remove(e){return this._withPendingWrite((async()=>(await this._withRetries((t=>Be(t,e))),delete this.localCache[e],this.notifyServiceWorker(e))))}async _poll(){var e,t,n=await this._withRetries((e=>{var t=Le(e,!1).getAll();return new li(t).toPromise()}));if(!n)return[];if(0!==this.pendingWrites)return[];const i=[],r=new Set;for({fbase_key:e,value:t}of n)r.add(e),JSON.stringify(this.localCache[e])!==JSON.stringify(t)&&(this.notifyListeners(e,t),i.push(e));for(const e of Object.keys(this.localCache))this.localCache[e]&&!r.has(e)&&(this.notifyListeners(e,null),i.push(e));return i}notifyListeners(e,t){this.localCache[e]=t;var n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}di.type="LOCAL";const ci=di;class ui{constructor(e){this.auth=e,this.counter=1e12,this._widgets=new Map}render(e,t){var n=this.counter;return this._widgets.set(n,new fi(e,this.auth.name,t||{})),this.counter++,n}reset(e){var t,n=e||1e12;null===(t=this._widgets.get(n))||void 0===t||t.delete(),this._widgets.delete(n)}getResponse(e){var t;return(null===(t=this._widgets.get(e||1e12))||void 0===t?void 0:t.getResponse())||""}async execute(e){var t;return null===(t=this._widgets.get(e||1e12))||void 0===t||t.execute(),""}}class fi{constructor(e,t,n){this.params=n,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};var i="string"==typeof e?document.getElementById(e):e;T(i,"argument-error",{appName:t}),this.container=i,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){
this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout((()=>{this.responseToken=function(e){const t=[],n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let i=0;i<e;i++)t.push(n.charAt(Math.floor(Math.random()*n.length)));return t.join("")}(50);const{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(e){}this.timerId=window.setTimeout((()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(e){}this.isVisible&&this.execute()}),6e4)}),500))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}const hi=He("rcb"),pi=new on(3e4,6e4);class gi{constructor(){var e;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!(null===(e=Oe().grecaptcha)||void 0===e||!e.render)}load(e,t=""){var n;return T((n=t).length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(n),e,"argument-error"),this.shouldResolveImmediately(t)?Promise.resolve(Oe().grecaptcha):new Promise(((n,i)=>{const r=Oe().setTimeout((()=>{i(_(e,"network-request-failed"))}),pi.get());Oe()[hi]=()=>{Oe().clearTimeout(r),delete Oe()[hi];const a=Oe().grecaptcha;if(a){const e=a.render;a.render=(t,n)=>{var i=e(t,n);return this.counter++,i},this.hostLanguage=t,n(a)}else i(_(e,"internal-error"))},Ue(`https://www.google.com/recaptcha/api.js??${d({onload:hi,render:"explicit",hl:t})}`).catch((()=>{clearTimeout(r),i(_(e,"internal-error"))}))}))}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!(null===(t=Oe().grecaptcha)||void 0===t||!t.render)&&(e===this.hostLanguage||0<this.counter||this.librarySeparatelyLoaded)}}class mi{async load(e){return new ui(e)}clearedOneInstance(){}}const vi="recaptcha",yi={theme:"light",type:"image"};class _i{constructor(e,t=Object.assign({},yi),n){this.parameters=t,this.type=vi,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=te(n),this.isInvisible="invisible"===this.parameters.size,T("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment");var i="string"==typeof e?document.getElementById(e):e;T(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=new(this.auth.settings.appVerificationDisabledForTesting?mi:gi),this.validateStartingState()}async verify(){this.assertNotDestroyed();const e=await this.render(),t=this.getAssertedRecaptcha();return t.getResponse(e)||new Promise((n=>{const i=e=>{e&&(this.tokenChangeListeners.delete(i),n(e))};this.tokenChangeListeners.add(i),this.isInvisible&&t.execute(e)}))}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch((e=>{throw this.renderPromise=null,e})),this.renderPromise)}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach((e=>{this.container.removeChild(e)}))}validateStartingState(){T(!this.parameters.sitekey,this.auth,"argument-error"),T(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),T("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach((e=>e(t))),"function"==typeof e)e(t);else if("string"==typeof e){const n=Oe()[e];"function"==typeof n&&n(t)}}}assertNotDestroyed(){T(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let t=this.container;var e;this.isInvisible||(e=document.createElement("div"),t.appendChild(e),t=e),this.widgetId=this.getAssertedRecaptcha().render(t,this.parameters)}return this.widgetId}async init(){T(A()&&!Pe(),this.auth,"internal-error"),await function(){let e=null;return new Promise((t=>{"complete"!==document.readyState?(e=()=>t(),window.addEventListener("load",e)):t()})).catch((t=>{throw e&&window.removeEventListener("load",e),t}))}(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);var e=await((await M(this.auth,"GET","/v1/recaptchaParams")).recaptchaSiteKey||"");T(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return T(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class bi{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){var t=Cn._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}class Ei{constructor(e){this.providerId=Ei.PROVIDER_ID,this.auth=te(e)}verifyPhoneNumber(e,t){return $e(this.auth,e,h(t))}static credential(e,t){return Cn._fromVerification(e,t)}static credentialFromResult(e){var t=e;return Ei.credentialFromTaggedObject(t)}static credentialFromError(e){return Ei.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;var{phoneNumber:t,temporaryProof:n}=e;return t&&n?Cn._fromTokenResponse(t,n):null}}Ei.PROVIDER_ID="phone",Ei.PHONE_SIGN_IN_METHOD="phone";class wi extends En{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return le(e,this._buildIdpRequest())}_linkToIdToken(e,t){return le(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return le(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}class Ti{constructor(e,t,n,i,r=!1){this.auth=e,this.resolver=n,this.user=i,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise((async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}}))}async onAuthEvent(e){var{urlResponse:t,sessionId:n,postBody:i,tenantId:r,error:a,type:o}=e;if(a)this.reject(a);else{i={auth:this.auth,requestUri:t,sessionId:n,tenantId:r||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(i))}catch(e){this.reject(e)}}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return ze;case"linkViaPopup":case"linkViaRedirect":return Ge;case"reauthViaPopup":case"reauthViaRedirect":return Ve;default:y(this.auth,"internal-error")}}resolve(e){C(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){C(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const Si=new on(2e3,1e4);class Ci extends Ti{constructor(e,t,n,i,r){super(e,t,i,r),this.provider=n,this.authWindow=null,this.pollId=null,Ci.currentPopupAction&&Ci.currentPopupAction.cancel(),Ci.currentPopupAction=this}async executeNotNull(){var e=await this.execute();return T(e,this.auth,"internal-error"),e}async onExecution(){C(1===this.filter.length,"Popup operations only handle one event");var e=Ne();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch((e=>{this.reject(e)})),this.resolver._isIframeWebStorageSupported(this.auth,(e=>{e||this.reject(_(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(_(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Ci.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t;null!==(t=null===(t=this.authWindow)||void 0===t?void 0:t.window)&&void 0!==t&&t.closed?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(_(this.auth,"popup-closed-by-user"))}),2e3):this.pollId=window.setTimeout(e,Si.get())};e()}}Ci.currentPopupAction=null;const ki="pendingRedirect",Ii=new Map;class Ai extends Ti{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=Ii.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=Xe(t),i=Ke(e);if(!await i._isAvailable())return!1;var r="true"===await i._get(n);return await i._remove(n),r}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}Ii.set(this.auth._key(),e)}return this.bypassAuthState||Ii.set(this.auth._key(),(()=>Promise.resolve(null))),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){var t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}class xi{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach((n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))})),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return it(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;e.error&&!it(e)?(n=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error",t.onError(_(this.auth,n))):t.onAuthEvent(e)}isEventForConsumer(e,t){var n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return 6e5<=Date.now()-this.lastProcessedEventTime&&this.cachedEventUids.clear(),this.cachedEventUids.has(nt(e))}saveEventToCache(e){this.cachedEventUids.add(nt(e)),this.lastProcessedEventTime=Date.now()}}const Di=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ri=/^https?/,Mi=new on(3e4,6e4);let Ni=null;const Oi=new on(5e3,15e3),Pi="__/auth/iframe",Li="emulator/auth/iframe",Fi={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},ji=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]),Bi={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Ui{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}const Hi="__/auth/handler",$i="emulator/auth/handler",qi="webStorageSupport",zi=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ni,this._completeRedirectFn=et,this._overrideRedirectResult=Ye}async _openPopup(e,t,n,i){var r;return C(null===(r=this.eventManagers[e._key()])||void 0===r?void 0:r.manager,"_initialize() not called before _openPopup()"),dt(e,ct(e,t,n,I(),i),Ne())}async _openRedirect(e,t,n,i){return await this._originValidation(e),i=ct(e,t,n,I(),i),Oe().location.href=i,new Promise((()=>{}))}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(C(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch((()=>{delete this.eventManagers[t]})),n}async initAndGetManager(e){const t=await lt(e),n=new xi(e);return t.register("authEvent",(t=>(T(null==t?void 0:t.authEvent,e,"invalid-auth-event"),{status:n.onEvent(t.authEvent)?"ACK":"ERROR"})),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(qi,{type:qi},(n=>{var i=null===(i=null==n?void 0:n[0])||void 0===i?void 0:i[qi];void 0!==i&&t(!!i),y(e,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){var t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=at(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return Z()||G()||J()}};class Vi extends class{constructor(e){this.factorId=e}_process(e,t,n){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,n);case"signin":return this._finalizeSignIn(e,t.credential);default:return S("unexpected MultiFactorSessionType")}}}{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new Vi(e)}_finalizeEnroll(e,t,n){return M(e=e,"POST","/v2/accounts/mfaEnrollment:finalize",R(e,n={idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}_finalizeSignIn(e,t){return M(e=e,"POST","/v2/accounts/mfaSignIn:finalize",R(e,t={mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()}))}}class Gi{constructor(){}static assertion(e){return Vi._fromCredential(e)}}Gi.FACTOR_ID="phone";var Wi,Yi,Ki,Xi="@firebase/auth",Qi="0.20.11";class Ji{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){var t;this.assertAuthConfigured(),this.internalListeners.has(e)||(t=this.auth.onIdTokenChanged((t=>{e((null==t?void 0:t.stsTokenManager.accessToken)||null)})),this.internalListeners.set(e,t),this.updateProactiveRefresh())}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){T(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){0<this.internalListeners.size?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}Wi="authIdTokenMaxAge",null===(Yi=(()=>{try{return Bt()||Ut()||Ht()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}})())||void 0===Yi||Yi[`_${Wi}`],Ki="Browser",t._registerComponent(new Jt("auth",((e,{options:t})=>{var n=e.getProvider("app").getImmediate(),i=e.getProvider("heartbeat");const{apiKey:r,authDomain:a}=n.options;return((e,n)=>{T(r&&!r.includes(":"),"invalid-api-key",{appName:e.name}),T(!(null!=a&&a.includes(":")),"argument-error",{appName:e.name});var i={apiKey:r,authDomain:a,clientPlatform:Ki,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:ee(Ki)};return function(e,t){const n=(null==t?void 0:t.persistence)||[];var i=(Array.isArray(n)?n:[n]).map(k);null!=t&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(i,null==t?void 0:t.popupRedirectResolver)}(i=new _n(e,n,i),t),i})(n,i)}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e=>{e.getProvider("auth-internal").initialize()}))),t._registerComponent(new Jt("auth-internal",(e=>{var t=te(e.getProvider("auth").getImmediate());return new Ji(e=t)}),"PRIVATE").setInstantiationMode("EXPLICIT")),t.registerVersion(Xi,Qi,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(Ki)),t.registerVersion(Xi,Qi,"esm2017");const Zi=20;class er extends xi{constructor(){super(...arguments),this.passiveListeners=new Set,this.initPromise=new Promise((e=>{this.resolveInialized=e}))}addPassiveListener(e){this.passiveListeners.add(e)}removePassiveListener(e){this.passiveListeners.delete(e)}resetRedirect(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1}onEvent(e){return this.resolveInialized(),this.passiveListeners.forEach((t=>t(e))),super.onEvent(e)}async initialized(){await this.initPromise}}const tr=class{constructor(){this._redirectPersistence=ni,this._shouldInitProactively=!0,this.eventManagers=new Map,this.originValidationPromises={},this._completeRedirectFn=et,this._overrideRedirectResult=Ye}async _initialize(e){var t=e._key();let n=this.eventManagers.get(t);return n||(n=new er(e),this.eventManagers.set(t,n),this.attachCallbackListeners(e,n)),n}_openPopup(e){y(e,"operation-not-supported-in-this-environment")}async _openRedirect(e,t,n,i){var r,a;r=e,T("function"==typeof(null===(a=null==(s=ut())?void 0:s.universalLinks)||void 0===a?void 0:a.subscribe),r,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),T(void 0!==(null===(a=null==s?void 0:s.BuildInfo)||void 0===a?void 0:a.packageName),r,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),T("function"==typeof(null===(a=null===(a=null===(a=null==s?void 0:s.cordova)||void 0===a?void 0:a.plugins)||void 0===a?void 0:a.browsertab)||void 0===a?void 0:a.openUrl),r,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),T("function"==typeof(null===(a=null===(a=null===(a=null==s?void 0:s.cordova)||void 0===a?void 0:a.plugins)||void 0===a?void 0:a.browsertab)||void 0===a?void 0:a.isAvailable),r,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),T("function"==typeof(null===(s=null===(s=null==s?void 0:s.cordova)||void 0===s?void 0:s.InAppBrowser)||void 0===s?void 0:s.open),r,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"});const o=await this._initialize(e);await o.initialized(),o.resetRedirect(),Ii.clear(),await this._originValidation(e);var s=pt(e,n,i);return n=e,i=s,await vt()._set(yt(n),i),async function(e,t,n){const i=ut().cordova;let r=()=>{};try{await new Promise(((a,o)=>{function s(){var e;a();const t=null===(e=i.plugins.browsertab)||void 0===e?void 0:e.close;"function"==typeof t&&t(),"function"==typeof(null==n?void 0:n.close)&&n.close()}function l(){c=c||window.setTimeout((()=>{o(_(e,"redirect-cancelled-by-user"))}),2e3)}function d(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)&&l()}let c=null;t.addPassiveListener(s),document.addEventListener("resume",l,!1),K()&&document.addEventListener("visibilitychange",d,!1),r=()=>{t.removePassiveListener(s),document.removeEventListener("resume",l,!1),document.removeEventListener("visibilitychange",d,!1),c&&window.clearTimeout(c)}}))}finally{r()}}(e,o,s=await ht(await ft(e,s,t)))}_isIframeWebStorageSupported(e,t){throw new Error("Method not implemented.")}_originValidation(e){var t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=async function(e){var t=ut().BuildInfo;const n={};J()?n.iosBundleId=t.packageName:K()?n.androidPackageName=t.packageName:y(e,"operation-not-supported-in-this-environment"),await rt(e,n)}(e)),this.originValidationPromises[t]}attachCallbackListeners(e,t){const{universalLinks:n,handleOpenURL:i,BuildInfo:r}=ut(),a=setTimeout((async()=>{await gt(e),t.onEvent(bt())}),500),o=async n=>{clearTimeout(a);var i=await gt(e);let r=null;i&&null!=n&&n.url&&(r=mt(i,n.url)),t.onEvent(r||bt())};void 0!==n&&"function"==typeof n.subscribe&&n.subscribe(null,o);const s=i,l=`${r.packageName.toLowerCase()}://`;ut().handleOpenURL=async e=>{if(e.toLowerCase().startsWith(l)&&o({url:e}),"function"==typeof s)try{s(e)}catch(e){console.error(e)}}}};var nr;const ir={LOCAL:"local",NONE:"none",SESSION:"session"},rr=T,ar="persistence",or=T;class sr{constructor(){this.browserResolver=k(zi),this.cordovaResolver=k(tr),this.underlyingResolver=null,this._redirectPersistence=ni,this._completeRedirectFn=et,this._overrideRedirectResult=Ye}async _initialize(e){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._initialize(e)}async _openPopup(e,t,n,i){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openPopup(e,t,n,i)}async _openRedirect(e,t,n,i){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openRedirect(e,t,n,i)}_isIframeWebStorageSupported(e,t){this.assertedUnderlyingResolver._isIframeWebStorageSupported(e,t)}_originValidation(e){return this.assertedUnderlyingResolver._originValidation(e)}get _shouldInitProactively(){return It()||this.browserResolver._shouldInitProactively}get assertedUnderlyingResolver(){return or(this.underlyingResolver,"internal-error"),this.underlyingResolver}async selectUnderlyingResolver(){var e;this.underlyingResolver||(e=await(!!It()&&new Promise((e=>{const t=setTimeout((()=>{e(!1)}),1e3);document.addEventListener("deviceready",(()=>{clearTimeout(t),e(!0)}))}))),this.underlyingResolver=e?this.cordovaResolver:this.browserResolver)}}class lr{constructor(e,t){this.resolver=t,this.auth=e.wrapped()}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(e){return Nt(Dt(this.auth),this.resolver.resolveSignIn(e))}}class dr{constructor(e){var t;this._delegate=e,this.multiFactor=(t=h(e),Xn.has(t)||Xn.set(t,Kn._fromUser(t)),Xn.get(t))}static getOrCreate(e){return dr.USER_MAP.has(e)||dr.USER_MAP.set(e,new dr(e)),dr.USER_MAP.get(e)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(e){return this._delegate.getIdTokenResult(e)}getIdToken(e){return this._delegate.getIdToken(e)}linkAndRetrieveDataWithCredential(e){return this.linkWithCredential(e)}async linkWithCredential(e){return Nt(this.auth,_e(this._delegate,e))}async linkWithPhoneNumber(e,t){return Ot(this.auth,async function(e,t,n){const i=h(e);await ge(!1,i,"phone");var r=await $e(i.auth,t,h(n));return new bi(r,(e=>_e(i,e)))}(this._delegate,e,t))}async linkWithPopup(e){return Nt(this.auth,async function(e,t,n){var i=h(e);E(i.auth,t,An);var r=qe(i.auth,n);return new Ci(i.auth,"linkViaPopup",t,r,i).executeNotNull()}(this._delegate,e,sr))}async linkWithRedirect(e){return await At(te(this.auth)),Ze(this._delegate,e,sr)}reauthenticateAndRetrieveDataWithCredential(e){return this.reauthenticateWithCredential(e)}async reauthenticateWithCredential(e){return Nt(this.auth,be(this._delegate,e))}reauthenticateWithPhoneNumber(e,t){return Ot(this.auth,async function(e,t,n){const i=h(e);var r=await $e(i.auth,t,h(n));return new bi(r,(e=>be(i,e)))}(this._delegate,e,t))}reauthenticateWithPopup(e){return Nt(this.auth,async function(e,t,n){var i=h(e);E(i.auth,t,An);var r=qe(i.auth,n);return new Ci(i.auth,"reauthViaPopup",t,r,i).executeNotNull()}(this._delegate,e,sr))}async reauthenticateWithRedirect(e){return await At(te(this.auth)),Je(this._delegate,e,sr)}sendEmailVerification(e){return Ae(this._delegate,e)}async unlink(e){return await he(this._delegate,e),this}updateEmail(e){return Re(h(this._delegate),e,null)}updatePassword(e){return Re(h(this._delegate),null,e)}updatePhoneNumber(e){return async function(e,t){await pe(h(e),t)}(this._delegate,e)}updateProfile(e){return De(this._delegate,e)}verifyBeforeUpdateEmail(e,t){return xe(this._delegate,e,t)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}}dr.USER_MAP=new WeakMap;const cr=T;class ur{constructor(e,t){if(this.app=e,t.isInitialized())return this._delegate=t.getImmediate(),void this.linkUnderlyingAuth();var n=e.options.apiKey;cr(n,"invalid-api-key",{appName:e.name}),cr(n,"invalid-api-key",{appName:e.name});var i="undefined"!=typeof window?sr:void 0;this._delegate=t.initialize({options:{persistence:function(e,t){const n=function(e,t){const n=xt();if(!n)return[];var i=q(ar,e,t);switch(n.getItem(i)){case ir.NONE:return[mn];case ir.LOCAL:return[ci,ni];case ir.SESSION:return[ni];default:return[]}}(e,t);if("undefined"==typeof self||n.includes(ci)||n.push(ci),"undefined"!=typeof window)for(const e of[ei,ni])n.includes(e)||n.push(e);return n.includes(mn)||n.push(mn),n}(n,e.name),popupRedirectResolver:i}}),this._delegate._updateErrorMap(m),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?dr.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(e){this._delegate.languageCode=e}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(e){this._delegate.tenantId=e}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(e,t){ne(this._delegate,e,t)}applyActionCode(e){return Se(this._delegate,e)}checkActionCode(e){return Ce(this._delegate,e)}confirmPasswordReset(e,t){return async function(e,t,n){await ae(h(e),{oobCode:t,newPassword:n})}(this._delegate,e,t)}async createUserWithEmailAndPassword(e,t){return Nt(this._delegate,async function(e,t,n){const i=te(e);var r=await de(i,{returnSecureToken:!0,email:t,password:n});r=await Fn._fromIdTokenResponse(i,"signIn",r);return await i._updateCurrentUser(r.user),r}(this._delegate,e,t))}fetchProvidersForEmail(e){return this.fetchSignInMethodsForEmail(e)}fetchSignInMethodsForEmail(e){return Ie(this._delegate,e)}isSignInWithEmailLink(e){return this._delegate,e=e,"EMAIL_SIGNIN"===(null==(t=kn.parseLink(e))?void 0:t.operation);var t}async getRedirectResult(){cr(kt(),this._delegate,"operation-not-supported-in-this-environment");var e,t,n=(e=this._delegate,t=sr,await te(e)._initializationPromise,await et(e,t,!1));return n?Nt(this._delegate,Promise.resolve(n)):{credential:null,user:null}}addFrameworkForLogging(e){te(this._delegate)._logFramework(e)}onAuthStateChanged(e,t,n){var{next:i,error:r,complete:a}=Pt(e,t,n);return this._delegate.onAuthStateChanged(i,r,a)}onIdTokenChanged(e,t,n){var{next:i,error:r,complete:a}=Pt(e,t,n);return this._delegate.onIdTokenChanged(i,r,a)}sendSignInLinkToEmail(e,t){return ke(this._delegate,e,t)}sendPasswordResetEmail(e,t){return Te(this._delegate,e,t||void 0)}async setPersistence(e){var t,n;let i;switch(t=this._delegate,n=e,rr(Object.values(ir).includes(n),t,"invalid-persistence-type"),o()?rr(n!==ir.SESSION,t,"unsupported-persistence-type"):r()?rr(n===ir.NONE,t,"unsupported-persistence-type"):Ct()?rr(n===ir.NONE||n===ir.LOCAL&&l(),t,"unsupported-persistence-type"):rr(n===ir.NONE||St(),t,"unsupported-persistence-type"),e){case ir.SESSION:i=ni;break;case ir.LOCAL:i=await k(ci)._isAvailable()?ci:ei;break;case ir.NONE:i=mn;break;default:return y("argument-error",{appName:this._delegate.name})}return this._delegate.setPersistence(i)}signInAndRetrieveDataWithCredential(e){return this.signInWithCredential(e)}signInAnonymously(){return Nt(this._delegate,async function(e){const t=te(e);if(await t._initializationPromise,null!==(n=t.currentUser)&&void 0!==n&&n.isAnonymous)return new Fn({user:t.currentUser,providerId:null,operationType:"signIn"});var n=await de(t,{returnSecureToken:!0});n=await Fn._fromIdTokenResponse(t,"signIn",n,!0);return await t._updateCurrentUser(n.user),n}(this._delegate))}signInWithCredential(e){return Nt(this._delegate,ye(this._delegate,e))}signInWithCustomToken(e){return Nt(this._delegate,Ee(this._delegate,e))}signInWithEmailAndPassword(e,t){return Nt(this._delegate,(e=e,t=t,ye(h(this._delegate),In.credential(e,t))))}signInWithEmailLink(e,t){return Nt(this._delegate,async function(e,t,n){var i=h(e),r=In.credentialWithLink(t,n||I());return T(r._tenantId===(i.tenantId||null),i,"tenant-id-mismatch"),ye(i,r)}(this._delegate,e,t))}signInWithPhoneNumber(e,t){return Ot(this._delegate,async function(e,t,n){const i=te(e);var r=await $e(i,t,h(n));return new bi(r,(e=>ye(i,e)))}(this._delegate,e,t))}async signInWithPopup(e){return cr(kt(),this._delegate,"operation-not-supported-in-this-environment"),Nt(this._delegate,async function(e,t,n){var i=te(e);E(e,t,An);var r=qe(i,n);return new Ci(i,"signInViaPopup",t,r).executeNotNull()}(this._delegate,e,sr))}async signInWithRedirect(e){return cr(kt(),this._delegate,"operation-not-supported-in-this-environment"),await At(this._delegate),Qe(this._delegate,e,sr)}updateCurrentUser(e){return this._delegate.updateCurrentUser(e)}verifyPasswordResetCode(e){return async function(e,t){return(await Ce(h(e),t)).data.email}(this._delegate,e)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}ur.Persistence=ir;class fr{constructor(){this.providerId="phone",this._delegate=new Ei(Dt(Lt.default.auth()))}static credential(e,t){return Ei.credential(e,t)}verifyPhoneNumber(e,t){return this._delegate.verifyPhoneNumber(e,t)}unwrap(){return this._delegate}}fr.PHONE_SIGN_IN_METHOD=Ei.PHONE_SIGN_IN_METHOD,fr.PROVIDER_ID=Ei.PROVIDER_ID;const hr=T;class pr{constructor(e,t,n=Lt.default.app()){var i;hr(null===(i=n.options)||void 0===i?void 0:i.apiKey,"invalid-api-key",{appName:n.name}),this._delegate=new _i(e,t,n.auth()),this.type=this._delegate.type}clear(){this._delegate.clear()}render(){return this._delegate.render()}verify(){return this._delegate.verify()}}(nr=Lt.default).INTERNAL.registerComponent(new Jt("auth-compat",(e=>{var t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("auth");return new ur(t,n)}),"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:en.EMAIL_SIGNIN,PASSWORD_RESET:en.PASSWORD_RESET,RECOVER_EMAIL:en.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:en.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:en.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:en.VERIFY_EMAIL}},EmailAuthProvider:In,FacebookAuthProvider:Rn,GithubAuthProvider:Nn,GoogleAuthProvider:Mn,OAuthProvider:Dn,SAMLAuthProvider:Pn,PhoneAuthProvider:fr,PhoneMultiFactorGenerator:Gi,RecaptchaVerifier:pr,TwitterAuthProvider:Ln,Auth:ur,AuthCredential:En,Error:zt}).setInstantiationMode("LAZY").setMultipleInstances(!1)),nr.registerVersion("@firebase/auth-compat","0.2.24")}).apply(this,arguments)}catch(e){throw console.error(e),new Error("Cannot instantiate firebase-auth-compat.js - be sure to load firebase-app.js first.")}})),FS.cookies=Cookies.noConflict(),FS.dashjs=window.dashjs,FS.rome=window.rome,FS.moment=window.moment,function(e){"use strict";var t,n=".",i=e.getInternalNS("elements.constants");i.classes={elementContent:"fsElementContent",loadMoreButton:"fsLoadMoreButton",loadMoreClicked:"fsLoadMoreClicked",loadingDots:"fsLoadingDots",loadingDotsOverlay:"fsLoadingDotsOverlay",selectAll:"fsSelectAll",stateActive:"fsStateActive",stateExpanded:"fsStateExpanded",stateHidden:"fsStateHidden",stateOpen:"fsStateOpen",stateSelected:"fsStateSelected"},t=i.classes,i.selectors={elementContent:n+t.elementContent,loadMoreButton:n+t.loadMoreButton,loadingDotsOverlay:n+t.loadingDotsOverlay,selectAll:n+t.selectAll,stateActive:n+t.stateActive,stateExpanded:n+t.stateExpanded,stateHidden:n+t.stateHidden,stateOpen:n+t.stateOpen,stateSelected:n+t.stateSelected}}(FS),function(){function e(e){for(;e&&e!==document.body;){var t=window.getComputedStyle(e),n=function(e,n){return!(void 0===t[e]||t[e]===n)};if(t.opacity<1||n("zIndex","auto")||n("transform","none")||n("mixBlendMode","normal")||n("filter","none")||n("perspective","none")||"isolate"===t.isolation||"fixed"===t.position||"touch"===t.webkitOverflowScrolling)return!0;e=e.parentElement}return!1}function t(e){for(;e;){if("dialog"===e.localName)return e;e=e.parentElement}return null}function n(e){e&&e.blur&&e!==document.body&&e.blur()}function i(e,t){for(var n=0;n<e.length;++n)if(e[n]===t)return!0;return!1}function r(e){
return!(!e||!e.hasAttribute("method"))&&"dialog"===e.getAttribute("method").toLowerCase()}function a(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window){new MutationObserver(this.maybeHideModal.bind(this)).observe(e,{attributes:!0,attributeFilter:["open"]})}else{var t,n=!1,i=function(){n?this.downgradeModal():this.maybeHideModal(),n=!1}.bind(this),r=function(r){if(r.target===e){var a="DOMNodeRemoved";n|=r.type.substr(0,a.length)===a,window.clearTimeout(t),t=window.setTimeout(i,0)}};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach((function(t){e.addEventListener(t,r)}))}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="fsDialogBackdrop",this.backdrop_.addEventListener("click",this.backdropClick_.bind(this))}var o=window.CustomEvent;o&&"object"!=typeof o||((o=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),n}).prototype=window.Event.prototype),a.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&document.body.contains(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),s.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropClick_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var n=document.createEvent("MouseEvents");n.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(n),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");if(!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),!e){var t=["button","input","keygen","select","textarea"].map((function(e){return e+":not([disabled])"}));t.push('[tabindex]:not([disabled]):not([tabindex=""])'),e=this.dialog_.querySelector(t.join(", "))}n(document.activeElement),e&&e.focus()},updateZIndex:function(e,t){if(e<t)throw new Error("dialogZ should never be < backdropZ");this.dialog_.style.zIndex=e,this.backdrop_.style.zIndex=t},show:function(){this.dialog_.open||(this.setOpen(!0),this.focus_())},showModal:function(){if(this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'showModal' on dialog: The element is already open, and therefore cannot be opened modally.");if(!document.body.contains(this.dialog_))throw new Error("Failed to execute 'showModal' on dialog: The element is not in a Document.");if(!s.dm.pushDialog(this))throw new Error("Failed to execute 'showModal' on dialog: There are too many open modal dialogs.");e(this.dialog_.parentElement)&&console.warn("A dialog is being shown inside a stacking context. This may cause it to be unusable. For more information, see this link: https://github.com/GoogleChrome/dialog-polyfill/#stacking-context"),this.setOpen(!0),this.openAsModal_=!0,s.needsCentering(this.dialog_)?(s.reposition(this.dialog_),this.replacedStyleTop_=!0):this.replacedStyleTop_=!1,this.dialog_.parentNode.insertBefore(this.backdrop_,this.dialog_.nextSibling),this.focus_()},close:function(e){if(!this.dialog_.hasAttribute("open"))throw new Error("Failed to execute 'close' on dialog: The element does not have an 'open' attribute, and therefore cannot be closed.");this.setOpen(!1),void 0!==e&&(this.dialog_.returnValue=e);var t=new o("close",{bubbles:!1,cancelable:!1});this.dialog_.dispatchEvent(t)}};var s={reposition:function(e){var t=document.body.scrollTop||document.documentElement.scrollTop,n=t+(window.innerHeight-e.offsetHeight)/2;e.style.top=Math.max(t,n)+"px"},isInlinePositionSetByStylesheet:function(e){for(var t=0;t<document.styleSheets.length;++t){var n=document.styleSheets[t],r=null;try{r=n.cssRules}catch(e){}if(r)for(var a=0;a<r.length;++a){var o=r[a],s=null;try{s=document.querySelectorAll(o.selectorText)}catch(e){}if(s&&i(s,e)){var l=o.style.getPropertyValue("top"),d=o.style.getPropertyValue("bottom");if(l&&"auto"!==l||d&&"auto"!==d)return!0}}}return!1},needsCentering:function(e){return"absolute"===window.getComputedStyle(e).position&&(!("auto"!==e.style.top&&""!==e.style.top||"auto"!==e.style.bottom&&""!==e.style.bottom)&&!s.isInlinePositionSetByStylesheet(e))},forceRegisterDialog:function(e){if((window.HTMLDialogElement||e.showModal)&&console.warn("This browser already supports <dialog>, the polyfill may not work correctly",e),"dialog"!==e.localName)throw new Error("Failed to register dialog: The element is not a dialog.");new a(e)},registerDialog:function(e){e.showModal||s.forceRegisterDialog(e)},DialogManager:function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}.bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver((function(t){var n=[];t.forEach((function(e){for(var t,i=0;t=e.removedNodes[i];++i)t instanceof Element&&("dialog"===t.localName&&n.push(t),n=n.concat(t.querySelectorAll("dialog")))})),n.length&&e(n)})))}};if(s.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},s.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},s.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,n=0;e=this.pendingDialogStack[n];++n)e.updateZIndex(--t,--t),0===n&&(this.overlay.style.zIndex=--t);var i=this.pendingDialogStack[0];i?(i.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},s.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=t(e);){for(var n,i=0;n=this.pendingDialogStack[i];++i)if(n.dialog===e)return 0===i;e=e.parentElement}return!1},s.DialogManager.prototype.handleFocus_=function(e){if(!this.containedByTopDialog_(e.target)&&(e.preventDefault(),e.stopPropagation(),n(e.target),void 0!==this.forwardTab_)){var t=this.pendingDialogStack[0];return t.dialog.compareDocumentPosition(e.target)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?t.focus_():document.documentElement.focus()),!1}},s.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,27===e.keyCode){e.preventDefault(),e.stopPropagation();var t=new o("cancel",{bubbles:!1,cancelable:!0}),n=this.pendingDialogStack[0];n&&n.dialog.dispatchEvent(t)&&n.dialog.close()}else 9===e.keyCode&&(this.forwardTab_=!e.shiftKey)},s.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach((function(t){-1!==e.indexOf(t.dialog)?t.downgradeModal():t.maybeHideModal()}))},s.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return!(this.pendingDialogStack.length>=t)&&(1===this.pendingDialogStack.unshift(e)&&this.blockDocument(),this.updateStacking(),!0)},s.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);-1!==t&&(this.pendingDialogStack.splice(t,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},s.dm=new s.DialogManager,s.formSubmitter=null,s.useValue=null,void 0===window.HTMLDialogElement){var l=document.createElement("form");if(l.setAttribute("method","dialog"),"dialog"!==l.method){var d=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(d){var c=d.get;d.get=function(){return r(this)?"dialog":c.call(this)};var u=d.set;d.set=function(e){return"string"==typeof e&&"dialog"===e.toLowerCase()?this.setAttribute("method",e):u.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",d)}}document.addEventListener("click",(function(e){if(s.formSubmitter=null,s.useValue=null,!e.defaultPrevented){var n=e.target;if(n&&r(n.form)){if(!("submit"===n.type&&["button","input"].indexOf(n.localName)>-1)){if("input"!==n.localName||"image"!==n.type)return;s.useValue=e.offsetX+","+e.offsetY}t(n)&&(s.formSubmitter=n)}}}),!1);var f=HTMLFormElement.prototype.submit,h=function(){if(!r(this))return f.call(this);var e=t(this);e&&e.close()};HTMLFormElement.prototype.submit=h,document.addEventListener("submit",(function(e){var n=e.target;if(r(n)){e.preventDefault();var i=t(n);if(i){var a=s.formSubmitter;a&&a.form===n?i.close(s.useValue||a.value):i.close(),s.formSubmitter=null}}}),!0)}s.forceRegisterDialog=s.forceRegisterDialog,s.registerDialog=s.registerDialog,"function"==typeof define&&"amd"in define?define((function(){return s})):"object"==typeof module&&"object"==typeof module.exports?module.exports=s:window.dialogPolyfill=s}(),function(e,t,n){"use strict";var i=n.$,r=n._,a=i(e.body),o=n.getInternalNS("dialogs"),s=n.util,l=r.template('<dialog id="<%= id %>Dialog" class="fsDialog <%= dialogClass %>" aria-describedby="<%= id %>DialogContent"><button id="<%= id %>CloseButton" class="fsDialogCloseButton" type="button" aria-label="Close"></button><div id="<%= id %>DialogContent" class="fsDialogContent"><div class="fsLoadingDots"></div></div></dialog>');s.ensureDialog=e.createElement("DIALOG").showModal?n._.noop:t.dialogPolyfill.registerDialog,delete t.dialogPolyfill,o.Dialog=function(e){var t,n,o,d;return e.removeOnClose=!1!==e.removeOnClose,null===e.closeOnClick&&(e.closeOnClick=!1),e.id=e.id||"fs_"+r.uniqueId()+"_",n=i(l({dialogClass:e.dialogClass,id:e.id})),o=n.find(".fsDialogContent"),t=n[0],s.ensureDialog(t),n.on("close cancel",(function(){e.removeOnClose&&n.remove(),a.off("keydown.dialogClose"),a.off("mousedown.dialogClose"),n.hasClass("fsPagePopDialog")&&(d=i("#fsPagePopNotification")),d.is("body")?(a.attr("tabindex","-1"),a.focus(),a.removeAttr("tabindex")):d.focus(),a.removeClass("fsDialogOpen")})),n.find(".fsDialogCloseButton").click((function(){t.close()})),{addContent:function(e){o.append(e)},attachToPage:function(){a.has(n).length||a.append(n)},close:function(){t.close()},getContentElement:function(){return o},open:function(n){d=n,this.attachToPage(),t.showModal(),a.addClass("fsDialogOpen"),e.disableCloseOnEscape&&a.on("keydown.dialogClose",(function(e){if(27==e.keyCode)return!1})),e.closeOnClick&&a.on("mousedown.dialogClose",(function(e){i(e.target).closest(o).length||t.close()}))},setContent:function(e){o.html(e)},setLoading:function(){o.html('<div class="fsLoadingDots"></div>').attr("aria-busy","true")}}}}(document,window,FS),function(e,t){"use strict";function n(){function e(e){return n[e]||(n[e]=[null])}function t(e,t){var n=!1;return e==t||(e&&t&&(n=!0,J.each(e,(function(i){if(null==t[i]||e[i]!=t[i])return n=!1,!1}))),n)}var n={};this.addState=function(t,n){e(t).push(n)},this.getBackLinkState=function(n){for(var i=e(n),r=this.getCurrentState(n),a=0;a<i.length;a++)if(t(i[a],r))return a>0?i[a-1]:null;return null},this.getCurrentState=function(t){var n=e(t);return n.length>1?n[n.length-1]:null},this.didChangeState=function(e){return!t(ie.getCurrentHistoryState()[e],this.getCurrentState(e))},this.isStatesEmpty=function(){return J.isEmptyObject(n)}}function i(e){(e?e.find(xe):J(xe)).each((function(){var e=J(this);e.height(Math.round(e.width()*e.data("aspectratio")))}))}function r(e){return e.slice(0,1).toUpperCase()+e.slice(1)}function a(t,n,i){var r;if(t[0].dashPlayer)return i&&i.resolve(),void(n&&t[0].play());(r=e.dashjs.MediaPlayer().create()).on(e.dashjs.MediaPlayer.events.ERROR,(function(){t.one("error loadedmetadata",(function(){i&&i.resolve()})),t.attr("src",t.data("default-url")),n&&t[0].play()})),r.on(e.dashjs.MediaPlayer.events.PLAYBACK_METADATA_LOADED,(function(){i&&i.resolve()})),r.initialize(t[0],t.data("dash-url"),n),t[0].dashPlayer=r}function o(e,t,n,i,r,a,o){return J.ajax({cache:!1,type:"POST",url:he,data:{copy_element_id:a,copy_timestamp:o,element_type_id:i,is_organizational:n,page_id:r,parent_id:e,sibling_id:t},error:function(){alert("There was an error creating the element. Please try again.")}})}function s(e,t,n,i){var r,a,o,s={closeOnClick:!0,dialogClass:"fsElementDialog fs"+e+(i?" "+i:"")};return t&&(s.id="fsEl_"+t+"_"+(n||0)+"_",(a=J("#"+s.id+"Dialog")).length&&(a[0].close(),a.remove())),o=ae.Dialog(s),(r=o.getContentElement()).data("type",e.replace("Element","")),Z.extend(o,{setContentSuccess:function(e){o.setContent(e),te.triggerElementDialogShown(r)}})}function l(e,t,n){return n=Z.defaults(n||{},{elementUpdatedData:[],updateDOM:!0}),J.ajax({cache:!1,data:Z.defaults(t||{},{is_draft:T}),type:"GET",url:he+"/"+e}).then((function(t){var i=J(t),r=f(e);return i.data("overwrite-title")&&J(document.body).find("#fsPageContent > h1.fsPageTitle").html(i.find(".fsTitle").text()),r.attr("aria-busy",!1),n.updateDOM&&(r.replaceWith(i),n.elementUpdatedData.unshift(i),te.triggerElementUpdated.apply(null,n.elementUpdatedData)),i}))}function d(){return t.location.protocol+"//"+t.location.hostname}function c(){return t.history.state||{}}function u(e){return e.closest('[id^="fsEl_"]')}function f(e){return J("#fsEl_"+e)}function h(e){return e.attr("id").split("_")[1]}function p(e,t){var n,i,r=/\/~([\w-]+)\/([\w-]+(:[\w]+:[\w-]+:[\w]+:[\w]+)?)/,a=/^\/fs\/pages\/(\d+)/;return t||a.test(e)?(i=e.split("?")[1],t||(t=parseInt(e.match(a)[1])),r.test(e)&&(i=(n=e.match(r))[1].replace(/-/g,"_")+"="+n[2]+(i?"&"+i:"")),{pageID:t,queryString:i}):{}}function g(){return De.data("pageid")}function m(e){var n,i,r={};if(n=void 0===e?t.location.search.substring(1):(i=e.split("?")).length>0?i[1]:null)for(var a,o,s=0,l=n.split("&"),d=l.length;s<d;s++)o=l[s].split("="),(a=J.trim(decodeURIComponent(o[0])))&&(r[a]=decodeURIComponent(o[1]));return r}function v(){return J(we).find("> .fsElement.fsStateEditable[data-shared-id]")}function y(e){return parseInt(e.attr("id").split("_")[2])||0}function _(e){return e.closest("li").attr("id").split("-")[1]}function b(){return X||(X=J.Deferred(),J.get("/fs/sessions/user/csrf-token").done((function(e){X.resolve(J(e).val())})).fail((function(){X.reject(),X=void 0}))),X.promise()}function E(){return De.hasClass(le)}function w(){return De.hasClass(ue)}function T(){return De.hasClass(ce)}function S(){return De.hasClass(Ce)}function C(e){return e.hasClass("fsStateEditable")}function k(){return J(oe).length>0}function I(e,t){var n=Z.defaults(t,{is_draft:C(e),is_load_more:!0,parent_id:h(e)});return e.data("element-override")&&(n.element_override=e.data("element-override")),J.ajax({cache:!1,data:n,url:"/fs/elements/"+n.parent_id,error:function(){alert("There was an error with the element. Please try again."),e.children(ye).remove()}})}function A(e){var t,n,i,r=J(this),a={},o=["Constituent","EnotifyArchive"],s=r.data("start-row");t=u(r);for(var l=0;l<o.length;l++)if(t.hasClass("fs"+o[l])){i=o[l];break}if(!t)return!1;switch(n=t.children(fe),i){case"Constituent":e.preventDefault(),a.const_page=r.data("page"),a=J.extend(a,r.closest(".fsElementPagination").data("searchparams"));break;case"EnotifyArchive":a.start_row=s}x(n),I(t,a).done((function(e){var a=J(e);if("EnotifyArchive"==i){var o=a.find(fe).children(":not(.fsElementEmpty)");n.siblings(ye).remove(),n.append(o),t.addClass("fsLoadMoreClicked"),r.remove(),te.triggerElementMoreLoaded(t,o)}else t.replaceWith(a),te.triggerElementUpdated(a)}))}function x(e){e.closest(".fsElement").attr("aria-busy",!0),e.before('<div class="fsLoadingDotsOverlay" style="height:'+e.height()+"px; width: "+e.width()+'px">'+Ee+"</div>")}function D(){var e=J(this),t=e.find(".fsLoginUsername input"),n=e.find(".fsLoginPassword input");if(t.length){if(0==J.trim(t.val()).length)return alert("Please enter your username to log in."),t.val(""),t.focus(),!1;if(0==n.val().length)return alert("Please enter your password to log in."),n.val(""),n.focus(),!1}return x(e),!!e.find('input[name="authenticity_token"]').length||(J.get("/fs/sessions/user/csrf-token",(function(t){e.append(t).submit()})),!1)}function R(e){var t,n,i={items:"> li:not(:has(> .fsAddPanelGroupTab))",beforeActivate:function(e){e.preventDefault()},update:function(e,i){var r=J(i.item),a=r.prev(),o=f(_(r)),s=a.length?_(a):0,l=f(s);N(o,l,t).done((function(){0==s?n.after(o):l.after(o)}))}};e.hasClass("fsPageContent")?e.find(".fsPanelGroup:not(.fsAccordion)").each((function(){t=J(this),(n=t.children(fe).children(".fsTabsNav")).sortable(i)})):(n=(t=e).children(fe).children(".fsTabsNav")).sortable(i)}function M(e,t){e.find(Ie).addBack(Ie).sortable(ie.SORTABLE_CONFIG),e.find("> "+fe).sortable(J.extend({},ie.SORTABLE_CONFIG,{axis:"y",cancel:".fsElementEditSettings, .fsElementDelete, .fsStateRichTextEditing, .redactor-editor, .redactor-box",connectWith:!1,containment:"parent",cursorAt:!1,helper:"original",items:t,update:function(e,t){var n=J(t.item),i=n.prev(".fsElement"),r=J(this);N(n,i,n.parent().parent()).fail((function(){r.sortable("cancel")}))}}))}function N(t,n,i){var r=h(t),a=h(i),o=n.length?h(n):0;return J.ajax({cache:!1,dataType:"json",type:"PUT",url:he+"/"+r,data:{page_id:g(),element:{parent_id:a,sibling_id:o}},error:function(){alert("There was an error saving the element. Please refresh and try again.")},success:function(){e.events.triggerElementMoved(t,n),O("element:update",r)}})}function O(e,n){var i,r,a=0==e.indexOf("element:")&&"element:settings:display"!=e&&"element:delete:display"!=e&&"element:layout:display"!=e;E()&&a?((i=J(se)).find(".fsElementBannerPublish").removeClass(me),0==i.length&&(i=f(n)).addClass("fsBannerEdit"),r={data:h(i),event:"banner:update"}):r=S()&&a?{data:v().data("shared-id"),event:"sharedElement:update"}:{data:n,event:e},t.location.origin||(t.location.origin=d()+(t.location.port?":"+t.location.port:"")),t.parent.postMessage(JSON.stringify(r,(function(e,t){return"tabListItem"==e&&t?"#"+t.attr("id"):t})),t.location.origin)}function P(e,t){var n=s("AthleticsEvent");J.post({cache:!1,data:{action:"getAthleticEventDialogHTML",athleticOccurID:e},dataType:"html",url:"/cf_calendar/ajax/fullcalendar.cfm"}).done((function(e){n.setContentSuccess(e),t.data("use-alerts")||n.getContentElement().find("a.fsAlertIcon.fsAthleticsEvent").remove()})).fail((function(){n.setContent("<p>There was an error loading the Athletic Event Details.</p>")})),n.open(t)}function L(e,n,i){var r="/cf_directory/cp.cfm?eventtype="+e+"&eventid="+n;i&&(r+="&calendar_ids="+i),t.open(r,"","width=600,height=700")}function F(e,t,n,i){var r="Page "+e,a=J('<a href="#">').attr("aria-label",r).attr(i||{}).html(n).data("page",e);return e==t&&(a.attr({"aria-current":!0,"aria-label":r+", Current Page"}),a.prop("disabled",!0),a.addClass("fsStateActive")),a}function j(e,t,n,i){var r=Math.ceil(n/i);if(e.empty(),!(n<=i)){t>1&&e.append(F(t-1,t,"&lt;",{class:"fsPreviousPageLink"})),e.append(F(1,t,1,{class:"fsFirstPageLink"}));for(var a=t-1,o=[];a>1;){if(o.push(F(a,t,a)),t-a>1&&a>4&&r>10){o.push(F(Math.floor(t/2),t,"&hellip;"));break}a--}for(e.append(o.reverse()),a=Math.max(t,2);a<r;){if(e.append(F(a,t,a)),a-t>1&&r-a>3&&r>10){e.append(F(Math.floor((a+r)/2),t,"&hellip;"));break}a++}e.append(F(r,t,r,{class:"fsLastPageLink"})),t<r&&e.append(F(t+1,t,"&gt;",{class:"fsNextPageLink"})),e.append(J("<span>").text("showing "+((t-1)*i+1)+" - "+t*i+" of "+n))}}function B(e,t){return 1==e?t:t+"s"}function U(e,t){Z.each(e.data("linked-element-ids"),(function(e){f(e).length&&l(e,t)}))}function H(e){e.closest(".fsElement").attr("aria-busy",!1).find(ye).remove()}function $(e){e.each((function(){var e=J(this),t=J("<span>",{class:"fsClearInputContainer"}),n=J("<button></button>",{"aria-label":"Clear"});n.toggleClass(me,!e.val().length),e.on("change input",(function(){n.toggleClass(me,!e.val().length)})),n.on("click",(function(){e.val("").trigger("change").focus()})),e.wrap(t).after(n)}))}function q(e){e.on("click",pe,(function(){J(this).toggleClass(ge)}))}function z(e,t){e.on("click",Te,(function(){var e=J(this),t=e.text()==Se;e.parent().find(be).prop("checked",t),e.text(t?de:Se)})).on("change",ve,(function(){J(this).closest(t).find(Te).trigger("updateLabel")})).on("updateLabel",Te,(function(){var e=J(this);e.text(0==e.parent().find(be+_e).length?de:Se)}))}function V(e,t,n,i,r){var a=h(e),o=y(e),d=s(n,a,o,r);return o&&(t.shared_element_id=o),d.open(i),l(a,t,{updateDOM:!1}).done((function(e){d.setContentSuccess(e.find(".fsElementContent").html()),e.hasClass("fsResourceElement")&&d.getContentElement().find("audio, video").on("play pause",(function(e){var t=J(this),n=e.type.charAt(0).toUpperCase()+e.type.slice(1),i=t.data();W((t.is("video")?"resourceVideo":"resourceAudio")+n,i.resourceTitle,i.resourceUuid)}))})).fail((function(e,t,n){d.setContent("<p>An error occurred while retrieving the data:</p><p>"+n+"</p>")}))}function G(){return De.hasClass(Ae)}function W(e,t,n){var i={event:e,resourceTitle:t,url:d()+"/fs/resource-manager/view/"+n};re.push(i)}function Y(e){if(t.history.pushState){var n,i={},r=m();J.each(e,(function(e,t){null===t||"element_id"==e?delete r[e]:r[e]=t})),n=(n=J.param(r)).length>0?"?"+n:n,i[e.element_id]=e,t.history.pushState(J.extend(c(),i),"",n)}}function K(e){if(t.history.replaceState&&e){var n=t.location,i=n.pathname;e.virtualParam&&(i=i.split("~")[0].replace(/\/$/,"")+e.virtualParam),e.queryString?i+="?"+J.param(Z.extend(m(),e.queryString)):i+=n.search,t.history.replaceState({},"",i)}}var X,Q,J=e.$,Z=e._,ee=e.getInternalNS("elements.constants.classes"),te=e.events,ne=e.getInternalNS("elements.constants.selectors"),ie=e.getInternalNS("elements.utils"),re=t.dataLayer||[],ae=e.getInternalNS("dialogs"),oe="#fsAccountBar",se=".fsBannerEdit",le="fsBannerEditMode",de="Deselect All",ce="fsDraftMode",ue="fsComposeMode",fe="."+"fsElementContent",he="/fs/elements",pe=".fsStyleExpandable",ge="fsStateExpanded",me=ee.stateHidden,ve='input[type="checkbox"]',ye=".fsLoadingDotsOverlay",_e=":not(:checked)",be="li:not("+ne.stateHidden+") "+ve,Ee='<div class="fsLoadingDots"></div>',we="#fsPageContent",Te=ne.selectAll,Se="Select All",Ce="fsSharedElementEditMode",ke="> "+fe+".fsStateEditable",Ie=se+", .fsDiv.fsStateEditable, .fsPanel"+ne.stateOpen+" "+ke+", .fsContainer "+ke+", .fsTab.fsStateEditable, .fsPersonalizationPanelElement "+ke,Ae="fsSuppressGoogleMaps",xe=".fsEmbeddedMediaResponsive",De=J(document.body);Q={ElementHistory:n,SORTABLE_SELECTOR:Ie,adjustMediaAspectRatio:i,capitalize:r,createDashPlayer:a,createElement:o,fetchElementHTML:l,getCurrentHistoryState:c,getElement:u,getElementByID:f,getElementID:h,getInternalLinkProperties:p,getPageID:g,getQueryStringValues:m,getSharedElement:v,getTabID:_,getToken:b,inBannerEditMode:E,inComposeMode:w,inDraftMode:T,inSharedElementEditMode:S,isLoggedIn:k,loadElementData:I,loadMoreHandler:A,loadingOverlay:x,loginFormSubmitHandler:D,makePanelGroupTabsSortable:R,makeSubelementsSortable:M,moveBehind:N,notifyAdminInterface:O,openAthleticEventPopup:P,openCalendarAlertPopup:L,pagination:j,pluralize:B,populateLinkedElements:U,removeLoadingOverlay:H,setupClearInputButtons:$,setupExpandableHeaders:q,setupSelectAllButtons:z,showElementPopupDialog:V,suppressGoogleMaps:G,trackResourceEvent:W,updateQueryStringValueAndHistory:Y,updateURLParams:K},J.extend(ie,Q)}(FS,window),function(e,t){"use strict";function n(e,t,n){var i,a,o=Q.data("element"),s=te('<div id="newEl_'+(new Date).getTime()+'" class="'+He+'">'+ht+"</div>");o.hasClass(He)?"above"==Q.find("button."+Pt).val()?s.insertBefore(o):s.insertAfter(o):o.replaceWith(s),a=(i=s.prev($e)).length?fe(i):0,le(fe(ce(s.parent())),a,!1,te(e).data("type-id"),pe(),t,n).fail((function(){var e=ce(s.parent());s.remove(),r(e)})).done((function(e){var n=te(e);s.replaceWith(n),n.find(ie.SORTABLE_SELECTOR).sortable(nn),n.hasClass(Ee)?O(n):n.hasClass(Le)&&n.find(Ht).sortable(nn),_e("element:create",fe(n)),be.triggerElementAdded(n),t&&n.find($e).each((function(){be.triggerElementAdded(te(this))}))})),Q.dialog("close")}function i(){var e=te("#fsElementSettingShowBoards"),t=te("#fsElementSettingsDisplayBoardsMethod");e.click((function(){W(e.siblings("#fsConstituentSettingDisplayBoardsLinkContainer"),!this.checked)})),t.find("input:radio").click((function(){W(t.siblings(St),"fsElementSettingsOpenMethodFolders"!=this.id)})),te("#fsElementSettingLinkedPostFolderPicker").click((function(e){var t={id:e.originalEvent.target.id,pickerOptions:{selectedItemIDs:te(Tt).map((function(){return te(this).val()}))}};_e("postFolderPicker:open",t)}))}function r(e){var t;switch(e.data("type")){case"Banner":case"Div":case"Tab":t=e;break;case"Container":case"Panel":case"PersonalizationPanel":t=e.find("> "+qe);break;default:return}t.find($e).length?t.find("> "+tt).remove():t.append('<div class="fsElementAddWrapper '+et+'"><button class="fsElementAdd">ADD ELEMENT</button></div>')}function a(){sessionStorage.removeItem("copiedElement"),Vt.find(Ge).removeClass(Ve)}function o(){Vt.removeClass(De),K.hide()}function s(e){var t,n,i,r;e.data("editor")==Me?(n=y(b(e,Ne).attr("id")),i=te.trim(n.getData()),t=e.parent().parent().find(".fsContentOverlay"),ne.defer((function(){n.destroy()}))):(i=te.trim(e.redactor("code.get")),t=e.prev(".fsContentOverlay"),e.redactor("core.destroy")),r=""==i,t.toggleClass("fsStateEmpty",r).find(je).toggleClass(Se,r).text(r?"Click here to add content":"EDIT CONTENT"),e.closest(Fe).removeClass(Rt),Vt.removeClass(Rt),Yt.trigger("resize",{forceUpdate:!0})}function l(e){e?P(te(yt)):(re&&te(xe).find(".fsElementBannerExit").click(),X&&X.dialog("isOpen")&&X.dialog("close"),Vt.hasClass(Ze)&&Q.dialog("close"),f()),Vt.toggleClass(Pe,e),be.triggerComposeModeChanged(e)}function d(){return"true"==sessionStorage.getItem("composeModeEnabled")}function c(t){var n=te("#fsDateFilterSettingPostCount"),i=n.next("label"),r=te("#fsDateFilterSettingDisplayRange"),a=te("#fsDateFilterSettingDaysAfter"),o=te("#fsDateFilterSettingDaysBefore"),s={autoHideOnBlur:!1,inputFormat:"YYYY-MM-DD",time:!1},l=document.getElementById("fsDateFilterSettingStartDate"),d=document.getElementById("fsDateFilterSettingEndDate");"athletics"!=t&&(n.find("option[value='0']").remove(),r.find("option[value='5']").remove()),"news"==t?(r.find("option[value='1']").remove(),r.find("option[value='2']").remove(),W(a,!0),W(te('label[for="fsDateFilterSettingDaysAfter"]'),!0)):r.find("option[value='0']").remove(),l&&(e.rome(l,te.extend({dateValidator:e.rome.val.beforeEq(d)},s)),te(".rd-container").on("focusin",(function(e){e.stopPropagation()}))),d&&e.rome(d,te.extend({dateValidator:e.rome.val.afterEq(l)},s)),r.on("change",(function(){var e=te(this),r=e.val(),s=n.val(),l=(1==s?"item":"items")+" from",d=n.find("option[value='0']");W(e.siblings(".fsDateFilterSettingDateRange"),3!=r),W(e.siblings(".fsDateFilterSettingDayRange"),4!=r),W(e.parent().siblings(".fsDateFilterSettingEventYear"),5!=r),i.html(l),"athletics"==t&&(1==r||2==r||5==r?(d.length||(d=te('<option value="0">all</option>'),n.append(d)),5==r&&(d.prop("selected",!0),n.change())):(d.remove(),0==s&&n.change())),o.change(),a.change()})),o.on("change",(function(){W(te(".fsDisplayPastEventsToggleContainer"),4==r.val()&&o.val()>0)})),a.on("change",(function(){W(te(".fsDisplayUpcomingEventsToggleContainer"),4==r.val()&&a.val()>0)})),n.on("change",(function(){var e=te(this),t=(1==e.val()?"item":"items")+" from";i.html(t),W(te(".fsDateFilterSettingDisplayMoreContainer"),0==e.val())}))}function u(e,t){var n=ue(e),i=ce(n.parent());t&&t.remove(),be.triggerElementDeleted(n),n.remove(),r(i),_e("element:delete",e)}function f(){te(".ui-sortable").sortable("destroy")}function h(e){e?Wt.hasClass(Ue)||(Wt.addClass(Ue),Wt.on("mousewheel DOMMouseScroll",p)):(Wt.removeClass(Ue),Wt.off("mousewheel DOMMouseScroll",p))}function p(e){(e=t.event||e.originalEvent).stopPropagation?e.stopPropagation():e.cancelBubble=!0,Yt.scrollTop(Yt.scrollTop()+60*Math.max(-1,Math.min(1,-e.wheelDelta||e.detail)))}function g(e){if(0!=e.length){var t=fe(e),n=C(e);e.data("use-new")&&_e("element:layout:display",E(e,t,n))}}function m(e){if(0!=e.length){var t,n=fe(e),i=C(e),r=e.data("shared-id");e.data("use-new")?_e("element:settings:display",w(e,n,i,r)):(A(),X.dialog("option","title",i.split(/(?=[A-Z])/).join(" ")+("Banner"==i?"":" Element")+" Settings"),X.html(ht),X.dialog("open"),(t=X.parent().find(".ui-dialog-buttonset")).addClass(gt),r&&X.data(it,r),e.hasClass("fsSharedContainer")?X.html('<h3 class="fsSharedElementTitle">This container is shared!</h3><p>Shared containers can only be edited in the Shared Element editor</p>').append(te('<button class="fsSharedElementButton">Edit Shared</button>').on("click",(function(){_e("sharedElement:display",r)}))):te.ajax({cache:!1,dataType:"html",url:rt+"/"+n+"/settings"+(0==n?"/"+T(e):""),error:function(e){X.dialog("close"),403==e.status?alert(e.responseText):alert("There was an error loading the settings for this element. Please try again.")},success:function(a){X.data(Qe,n),0==n&&X.data(nt,T(e)),!r||oe&&fe(ge())==n?(x(a,i,!1),t.removeClass(gt)):X.html('<h3 class="fsSharedElementTitle">This element is shared!</h3><p>Would you like to orphan just this element or edit the shared element?</p>').append(te('<button class="fsSharedElementButton">Orphan and Edit</button>').on("click",(function(){x(a,i,!0),t.removeClass(gt)})),te('<button class="fsSharedElementButton">Edit Shared</button>').on("click",(function(){_e("sharedElement:display",r)})))}}))}}function v(){var e,t,i="fsElementLibraryWrapper",r="fsElementLocation";Q||(Q=te('<div id="fsElementLibrary"><div id="'+i+'">'+ht+'</div><div id="'+Je+'"><div class="fsElementCopiedItem"><span aria-hidden="true"></span><div><p class="name"></p><p class="message">Paste this Element</p></div></div><button value="clear" >Clear</button></div><button class="'+Pt+" "+r+'" value="below" >Place Below</button><button class="'+r+'" value="above">Place Above</button></div>'),t=Q.find("button."+r),Q.dialog(te.extend({},Zt,{appendTo:Vt,dialogClass:"fsElementsDialog",width:500,close:function(){Vt.removeClass(Ze),Q.data("element").removeClass(Te)},open:function(){Vt.addClass(Ze),Q.data("libraryLoaded")&&t.toggleClass(at,!Q.data("showLocation")),te(".ui-widget-overlay").bind("click",(function(){Q.dialog("close")}))}})),Q.siblings(".ui-dialog-titlebar").remove(),te.ajax({cache:!1,data:{page_id:pe()},dataType:"html",url:rt+"/library",error:function(){alert("There was an error loading the element library. Please try again."),Q.remove(),Q=!1},success:function(e){Q.find("#"+i).html(e),t.toggleClass(at,!Q.data("showLocation")),Q.data("libraryLoaded",!0);var a=Q.find(".fsElementLibraryCategoryShared");oe&&(a.find(".fsContainerIcon").parent().remove(),0==a.find(".fsElementLibraryItem").length&&(a.remove(),Q.find(".fsTab").eq(a.index()).remove())),se&&Q.find(".fsEmbeddedMapIcon").parent().remove(),Q.on("click","button."+r,(function(){te(this).hasClass(Pt)||t.toggleClass(Pt)})),Q.on("click",".fsTab",(function(){var e=te(this);return e.addClass(Pt).siblings().removeClass(Pt),Q.find(".fsElementLibraryCategory").addClass(at).eq(e.index()).removeClass(at),!1})),Q.on("click",".fsElementLibraryItem:not(.fsStateDisabled, .fsStateDeprecated)",(function(){n(this)}))}}),(e=te("#"+Je)).find("button[value=clear]").click((function(){a(),G()})),e.click((function(){var e=_();n(this,e.id,e.timestamp)})));return G(),Q}function y(e){return CKEDITOR.instances[e.replace(Re,"")]}function _(){var e=sessionStorage.getItem("copiedElement");if(e)return JSON.parse(e)}function b(e,t){return e.parent().parent().find(t)}function E(e,t,n){var i,r=ue(t).closest(".fsBanner");return i=r.length&&r.parent().hasClass("fsBannerLeft")?"Left Banner":r.length&&r.parent().hasClass("fsBannerRight")?"Right Banner":"Page",{elementID:t,pageID:pe(),parentType:i,settingsID:T(e),type:n}}function w(e,t,n,i){var r,a=ue(t).closest(".fsBanner")
;return r=a.length&&a.parent().hasClass("fsBannerLeft")?"Left Banner":a.length&&a.parent().hasClass("fsBannerRight")?"Right Banner":"Page",{bannerID:a.length?fe(a):0,elementID:t,inSharedElementEditMode:oe,isSharedContainer:e.hasClass("fsSharedContainer"),pageID:pe(),parentType:r,settingsID:T(e),sharedElementID:ge().length>0?fe(ge()):0,sharedElementTypeID:i,type:n}}function T(e){return parseInt(e.data("settings-id"))}function S(e){return e.attr("data-title")}function C(e){return e.attr("data-type")}function k(e){var t=X.primaryButtons,n=X.primaryTitle;J.after(e),J.switchClass(Ct,kt),e.removeClass(Ot,400),X.removeClass(Nt),n&&X.dialog("option","title",n),t&&X.dialog("option","buttons",t),X.dialog("open")}function I(){te("#fsDateSeparatorSetting").on("change",(function(){var e=te("#fsDateSeparatorSetting option:selected").val();te("#fsDateFormatSetting option").each((function(){var t=te(this);t.html(t.html().replace(/[/.-]|&nbsp;|\u2022/g,e))}))})),te("#fsDateFormatSetting").on("change",(function(){var e=te("#fsDateFormatSetting option:selected").val();W(te("#fsCustomDateContainer"),"custom"!=e)})),te(".fsToggleCustomFormatExample").on("click",(function(e){e.preventDefault(),te(".fsCustomFormatExample").toggleClass(at)}))}function A(){X||((X=te('<div id="fsPageDialog"></div>').appendTo(Vt)).dialog(te.extend({},Zt,{dialogClass:"fsElementSettingsDialog",buttons:[{text:"Cancel",click:function(){te(this).dialog("close")}},{id:"fsElementSettingSaveButton",text:"Save",click:function(){var e,n,i=te(this),r=i.data(Qe),a=rt+"/"+r+"/",o=pe(),s=ue(r).closest(".fsBanner"),l=i.data("orphan");i.hasClass(Ft)?(n={banner_id:s.length?fe(s):0,page_id:o,shared_element_name:i.find("#fsElementShareName").val()},q(!0,"Saving shared element settings"),te.ajax({cache:!1,data:n,dataType:"json",type:"POST",url:a+"shared",error:function(e){var t,n=e.responseJSON;t=403==e.status&&e.responseJSON.message?e.responseJSON.message:n&&n.name?"The shared element name "+n.name:"There was an error creating the shared element",alert(t)},success:function(e){_e("sharedElement:create",e),re?N(ue(r).closest(".fsBanner")).done((function(){i.dialog("close")})):t.location.reload()}}).always((function(){q(!1)}))):(e=te("#fsElementSettings, .fsSecondaryElementSettings").find("input,textarea,select"),n=e.serializeArray(),o&&n.push({name:"page_id",value:o}),l&&n.push({name:"orphan",value:!0}),q(!0,"Saving element settings"),te.ajax({cache:!1,data:n,type:"PUT",url:a+"settings"+(0==r?"/"+i.data(nt):""),error:function(e){var t=te.parseJSON(e.responseText);403==e.status?alert(t.message):422==e.status&&"has already been taken"==t.title?alert("This banner name is in use. Please change the name and try again."):alert("There was an error saving the settings for this element. Please try again.")},success:function(e){var t=te(e),a=!l&&i.data(it);if(i.dialog("close"),ue(r).replaceWith(t),i.removeData(it),t.hasClass("fsBanner")){for(var o,s={id:parseInt(r)},d=n.length,c=0;c<d;c++)(o=n[c].name.match(/settings\[(\w*)\]$/))&&(s[o[1]]=n[c].value);_e("banner:update",s),P(t)}else a?_e("sharedElement:update",a):oe?_e("sharedElement:update",ge().data("shared-id")):(_e("element:update",r),P(te(yt)));be.triggerElementUpdated(t)}}).always((function(){q(!1)})))}}],close:function(){te(this).hasClass(Ft)&&Y(),Yt.off("keyup.settingsDialog"),te(".fsSecondarySettingsDialog").dialog("close").dialog("destroy").remove(),Vt.removeClass("fsDialogOpen")},open:function(){Yt.on("keyup.settingsDialog",(function(e){13!=e.keyCode||te("#fsElementSettingSaveButton").hasClass(at)||"TEXTAREA"==document.activeElement.tagName||"true"==te(document.activeElement).attr("contenteditable")||te(".selectize-dropdown-content").is(":visible")||te("#fsElementSettingSaveButton").trigger("click")})),Vt.addClass("fsDialogOpen")}})),X.on("change","#fsElementSubtypeList input[type=radio]",(function(e){te("#fsSubtypeSettingsFlag").attr("class","fsSubtypeSelected"+te(e.target).val())})),X.on("click",".fsStyleAccordionHeader",(function(){te(this).toggleClass(Pt)})),X.on("click",'.fsStyleAccordionHeader input[type="radio"], .fsStyleAccordionHeader label',(function(e){e.stopPropagation(),te(this).closest(".fsStyleAccordionHeader").addClass(Pt)})),X.on("focus","#fsElementSettingTitle",(function(){te(this).select()})),X.on("change","#fsElementSettingShowTitle",(function(){te("#fsElementSettingTitle").toggleClass("fsElementTitleHidden",!this.checked)}))),te("#fsElementSettingSaveButton").addClass(at)}function x(e,n,i){var r,a=te('<div><div id="fsPageDialogContent">'+e+"</div></div>"),o=a.find(Lt);o.length&&a.prepend(o),X.html(a.html()).data("orphan",i),te("#fsElementSettingSaveButton").removeClass(at),te("select[multiple]").selectize({hideSelected:!1,plugins:["fsSelectize"],onInitialize:function(){var e=te(this);e[0].settings.create=e[0].$input.data("create");var t=e[0].$input.data("maxitems");isNaN(t)||(e[0].settings.maxItems=t)}}),J=te(It),tn[n]&&tn[n](),te(ke).on("change",(function(){te(Ie).attr("src",te(this).val())})),te("#fsElementSettingBackgroundImageFileManager").on("click",(function(){te(t).one("message.pageThumbnailSelected",(function(e){var t=JSON.parse(e.originalEvent.data);"fileManager:selected"==t.event&&te(ke).val(t.path).trigger("change")})),F("gif,png,jpg,jpeg,svg")})),r=te.extend({},en,{buttonsHide:["embed","media","table"],linebreaks:!0,paragraphize:!1}),te("#settings_header_text, #settings_footer_text").redactor(r),k(te(".fsSecondaryElementSettings")),ie.setupClearInputButtons(X.find(Oe))}function D(e){function t(t,r){var a,o=r||i.find(".fsGroupPickerTree").jstree(!0).get_selected(!0),s=o.length;e.multiple?a=0==s?"No Groups Selected":1==s?"1 Group Selected":s+" Groups Selected":(a=o[0].text,k(n)),te("#fsSelectedGroupsCount").text(a)}var n=te("#fsSelectGroupsDialogContent"),i=te("#fsSelectGroupsTree"),r={hiddenFieldName:"settings[group_ids][]"};e.multiple=0!=e.multiple,i.fsGroupPicker(te.extend(r,e)).on("groupPicker:selectionLoaded groupPicker:change",t),te("#fsOpenSelectGroupsDialogButton").click((function(){V(n,e.multiple?"Select Groups":"Choose Group")}))}function R(){te(Bt).change((function(){1==te(this).val()?te(jt).prop(Be,!0).val(1):te(jt).prop(Be,!1)}))}function M(){te(".fsSettingShowThumbnail").on("change",(function(){var e=te(this);W(e.siblings(".fsElementSettingThumbnailOptions"),!e.prop("checked"))})),te(".fsSettingThumbnailPosition").on("change",(function(){var e=te(this);W(e.siblings(".fsElementSettingThumbnailAlignShapeContainer"),e.val()>=2)}))}function N(e){return j(ce(e),!0).done((function(e){Vt.addClass(De),P(e),z(e.find(dt))}))}function O(e){ie.makeSubelementsSortable(e,bt)}function P(e){e.find(ie.SORTABLE_SELECTOR).addBack(ie.SORTABLE_SELECTOR).sortable(nn),O(e.find(we)),ie.makeSubelementsSortable(e.find(".fsPersonalizationElement"),".fsPersonalizationPanelElement"),ie.makePanelGroupTabsSortable(e)}function L(e){_e("contentElement:unsavedEdits",{unsavedEdits:Jt=e})}function F(e){var n="/cf_filemanager/adminfiles.cfm?do=refresh&opener=cmsAssets&ext="+e,i="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=750,height=550";t.open(n,"popupFileManager",i).focus()}function j(e,t){return de(fe(ce(e)),{in_draft_mode:!0,is_draft:t,page_id:pe()})}function B(){return Qt.enabled&&Qt.access?2:0}function U(e){let n,i,r,a,o=ce(e),l={},d=fe(o),c=Xt[d]||{},u=pe();e.data("editor")==Me?(n=y(b(e,Ne).attr("id")),a=n.getResourcesUsed(),ne.each(c.resources,(function(e){-1==a.indexOf(e.uuid)&&(e._destroy=!0,c.changed=!0)})),ne.each(a,(function(e){ne.find(c.resources,(function(t){return e==t.uuid}))||(c.resources.push({uuid:e}),c.changed=!0)})),n.validate&&(i=n.validate()),r=n.getData()):r=e.redactor("code.get"),r==Z?s(e):i?te(".fsAppModalDialogContent",t.top.document).is(":visible")||t.postMessage(JSON.stringify({event:"fsGlobal:alertDialog:open",options:{message:i,title:"Error in rich text content"}}),t.location.origin):(l.element_id=d,c&&c.resources&&(l.content_resources_attributes=c.resources),u&&(l.page_id=u),l.content=r,te.ajax({contentType:"application/json",data:JSON.stringify(l),dataType:"json",type:"PUT",url:"/fs/element-settings/"+T(o)}).done((function(t){L(!1),0==d?_e("sharedElement:update",o.data("shared-id")):_e("element:update",d),s(e),o.replaceWith(t.element_html)})).fail((function(e){403==e.status?alert(e.responseJSON.message):alert("An error occurred saving your content")})))}function H(e){te("#fsDateFilterSettingDisplayMoreItemsText").on("change",(function(){var t=te(this);""==t.val()&&t.val(e)}))}function $(){var e=te(vt);te("#fsElementSettingShowLink").on("change",(function(){var e=te(this).siblings(At);e.length&&W(e,!this.checked)})),e.find("input:radio").on("click",(function(){W(e.siblings(st),"fsElementSettingsOpenMethodPage"!=this.id),W(e.siblings(".fsLinkedElementContainer"),"fsElementSettingsOpenMethodElement"!=this.id)}))}function q(e,t){_e("showLoadingOverlay",{message:t,state:e})}function z(e){if(e.length){var t=e.map((function(){return te(this).data("title")})).get();_e("showMissingLinkedPageErrors",{errors:t})}}function V(e,t){X.primaryTitle=X.dialog("option","title"),X.primaryButtons=X.dialog("option","buttons"),J.after(e),J.switchClass(kt,Ct),e.addClass(Ot,400),X.addClass(Nt),X.dialog("option","buttons",[{text:"Back",click:function(){k(e)}}]),t&&X.dialog("option","title",t),X.dialog("open")}function G(){var e=te("#"+Je),t=_();t&&(e.find("p.name").text(t.title),e.find("span:first-child").attr("class","fs"+t.type+"Icon"),e.data("elementID",t.id)),e.toggleClass(at,!t)}function W(e,t){e.toggleClass(at,t)}function Y(){var e="Save";X.toggleClass(Ft),X.hasClass(Ft)&&(e+=" and Convert to Shared Element"),X.parent().find('button > span:contains("Save")').text(e)}var K,X,Q,J,Z,ee,te=e.$,ne=e._,ie=e.getInternalNS("elements.utils"),re=ie.inBannerEditMode(),ae=ie.inDraftMode(),oe=ie.inSharedElementEditMode(),se=ie.suppressGoogleMaps(),le=ie.createElement,de=ie.fetchElementHTML,ce=ie.getElement,ue=ie.getElementByID,fe=ie.getElementID,he=ie.getInternalLinkProperties,pe=ie.getPageID,ge=ie.getSharedElement,me=ie.getTabID,ve=e.getInternalNS("elements.media"),ye=ie.moveBehind,_e=ie.notifyAdminInterface,be=e.events,Ee="fsAccordion",we="."+Ee,Te="fsStateActive",Se="fsAdminWarning",Ce="."+Se,ke="#fsElementSettingBackgroundImagePath",Ie="#fsElementSettingBackgroundImagePreview",Ae="fsBannerEditOverlay",xe=".fsBannerEdit",De="fsBannerEditMode",Re="cke_",Me="cke",Ne="."+Me,Oe="."+"fsClearInput",Pe="fsComposeMode",Le="fsContainer",Fe=".fsContent",je=".fsContentOverlayText",Be="disabled",Ue="fsDevicePreviewMode",He="fsElement",$e="."+He,qe="."+"fsElementContent",ze=".fsContentEditable",Ve="fsElementCopied",Ge="."+Ve,We=".fsElementCopy",Ye="fsStateElementDragging",Ke=".fsElementEditLayout",Xe=".fsElementEditSettings",Qe="elementID",Je="fsElementLibraryClipboard",Ze="fsElementLibraryOpen",et="fsElementEmptyPlaceholder",tt="."+et,nt="elementSettingsID",it="sharedElementID",rt="/fs/elements",at="fsStateHidden",ot=".fsLinkedPageClearButton",st=".fsLinkedPageContainer",lt=".fsLinkedPageID",dt=".fsElementMissingLinkedPage",ct=".fsLinkedPageName",ut="fsLinkedPageNameDefault",ft=[".fsAthleticsEvent",".fsCalendar",".fsNews",".fsPostElement",".fsCommentList",".fsIssueElement",".fsMessagesElement",".fsLocalLiveElement"],ht='<div class="fsLoadingDots"></div>',pt=".fsMediaSettingsSelectedMediaNodes",gt="fsOneButton",mt="fsStateOpen",vt="#fsElementSettingsOpenMethod",yt="#fsPageContent",_t="fsPanel",bt="."+_t,Et="fsTabsNavItem",wt="."+"fsPanelGroup"+" "+".fsTabsNav",Tt=".fsLinkedPostFolderIDs",St="#fsElementSettingsDisplayPostFoldersMethod",Ct="fsElementSettingsOffScreen",kt="fsElementSettingsOnScreen",It="#fsElementSettings",At=".fsElementSettingShowReadMoreContainer",xt="redactor-editor",Dt="."+xt,Rt="fsStateRichTextEditing",Mt="."+Rt,Nt="fsSecondaryElementSettingsVisible",Ot="fsSecondaryElementSettingsOnScreen",Pt="fsStateSelected",Lt="#fsElementShareButton",Ft="fsElementShareSettings",jt="#settings_slideshow_slide_count",Bt="#settings_slideshow_transition_effect",Ut="."+"fsStateEditable",Ht="> "+qe+Ut,$t="#fsSelectedMediaName",qt="."+"fsTabs",zt=qt+" > "+qe,Vt=te(document.body),Gt=te(document),Wt=te("html"),Yt=te(t),Kt=te('meta[name="csrf-token"]').attr("content"),Xt={},Qt=e.getNS("managers.resources"),Jt=!1,Zt={autoOpen:!1,closeOnEscape:!0,draggable:!0,modal:!0,position:["center",15],resizable:!1},en={buttonsHide:["media"]},tn={Calendar:function(){c("calendar"),R(),I(),$(),H("Load More Events"),te("#fsCalendarSettingEndDate, #fsCalendarSettingStartDate").datepicker({dateFormat:"yy-mm-dd"}),te("#fsElementSettingSlideshowAutoplay").on("change",(function(){W(te(".fsElementSettingSlideshowDuration"),!te(this).prop("checked"))})),te("#fsCalendarSettingCombineWeekendDays").on("change",(function(){te("#fsCalendarSettingWeekStartsOnContainer").toggleClass(at,te(this).is(":checked"))})),te("#fsCalendarSettingDisplayAthleticEvents").on("change",(function(){te("#fsCalendarSettingsTeamsContainer").toggleClass(at,!te(this).is(":checked"))})),te(".fsCalendarSettingEventDisplayType").on("change",(function(){W(te(".fsCalendarSettingsCalendars"),1==te(this).val()),W(te(".fsCalendarSettingDisplayTypeSpecific"),0==te(this).val())})),te('input[name="settings[subtype]"]').on("change",(function(){var e="Event"==te(this).val();W(te(".fsCalendarSettingsCalendars"),e&&1==te(".fsCalendarSettingEventDisplayType:checked").val())}))},Constituent:function(){var e=te("#fsConstituentID"),t=te("#fsConstituentSettingName"),n=["#fsConstituentSettingSearchLocation","#fsConstituentSettingSearchDepartment"].join(", "),r="#fsConstituentSettingSearchLocationDepartment";M(),$(),i(),D({excludeRoles:!0}),te('input[name="settings[any_roles]"]').on("change",(function(){W(te("#fsConstituentSettingRoleSelect"),1==te(this).val())})),te('input[name="settings[use_default_format]"]').on("change",(function(){W(te(".fsConstituentCustomFormatSetting"),1==te(this).val())})),te('input[name="settings[display_degrees]"]').on("change",(function(){W(te("#fsConstituentSettingDegreeFields"))})),te('input[name="settings[custom_format_display_degrees]"]').on("change",(function(){W(te("#fsCustomFormatDegreeFields"))})),te("#fsConstituentSettingDisplayAddress").on("change",(function(){var e=te(this);e.siblings(".fsConstituentSettingAddressTypeContainer").toggleClass(at,!e.prop("checked"))})),te("#fsConstituentSettingCustomFormatDisplayAddresses").on("change",(function(){var e=te(this);e.siblings(".fsConstituentSettingCustomFormatAddressTypeContainer").toggleClass(at,!e.prop("checked"))})),te("#fsConstituentSettingDisplayDirectoryEmails, #fsConstituentSettingDisplayProfileEmails").on("change",(function(){var e=te(this);W(te(this).siblings(".fsElementSettingEmailOptions"),!e.prop("checked"))})),te(r).prop("disabled",!te(n).is(":checked")),te(n).on("change",(function(){var e=te(r);te(n).is(":checked")?e.prop("disabled",!1):(e.prop("checked",!1),e.prop("disabled",!0))})),te("#fsElementSettingShowLink").on("change",(function(){W(te("#fsConstituentSettingDisplayProfileLinkContainer"),!te(this).prop("checked"))})),te("#fsConstituentSettingDisplayProfileLink").on("change",(function(){te("#fsConstituentSettingProfileLinkText").prop("readonly",!te(this).prop("checked"))})),te('input[name="settings[subtype]"]').on("change",(function(){var e=te(this).val();"Directory"==e?te(".fsConstituentFormatSettings").html("<span></span>Pop-Up Details"):"Profile"==e&&te(".fsConstituentFormatSettings").html("<span></span>Field Details")})),t.attr("placeholder","Please enter a name..."),t.autocomplete({minLength:2,change:function(n,i){i.item||(t.val(""),e.val(""))},open:function(){t.autocomplete("widget").addClass("fsConstituentsSettingAutoComplete")},select:function(n,i){return n.stopPropagation(),n.preventDefault(),e.val(i.item.personid),t.val(i.item.name),!1},source:function(e,t){te.ajax({dataType:"json",url:"/fs/constituents-autosuggest",data:{filter:e.term},success:function(e){t(e)}})}}).data("ui-autocomplete")._renderItem=function(e,t){return te("<li>").data("item.autocomplete",t).append('<a><div><img src="'+t.avatar+'"> <span>'+t.name+"</span></div></a>").appendTo(e)}},Media:function(){var e,t=te("#fsSelectMediaDialogContent");te("#fsMediaSettingsPlayerControls").on("change",(function(){var e={disabled:2==te(this).val()};e.disabled&&(e.checked=!0),te("#fsMediaSettingsAutoPlay").prop(e)})),e=te(pt+" input:checked").next("label").text(),te($t).text((e||"No media")+" selected"),ve.initPicker(t),t.on("mediaPicker:change",(function(e,t){te($t).text(t+" selected")})),te("#fsShowSelectMediaSettingsButton").click((function(){V(t,"Select Media")}))},News:function(){c("news"),R(),I(),M(),$(),H("Load More News"),te("#fsElementSubtypeList").on("change",'input[name="settings[subtype]"]',(function(){te("#fsNewsSettingDisplayTypeNewsPost").prop("checked")&&"Post"!=te(this).val()&&te("#fsNewsSettingDisplayTypeNews").prop("checked",!0).change()})),te(".fsNewsSettingDisplayType").on("change",(function(){var e=te(this);W(e.closest(".fsNewsSettingGeneral").find(".fsNewsSettingCategories").insertAfter(e.parent()),2==e.val()||4==e.val())})),te("#fsNewsSettingShowBody").on("change",(function(){var e=te(this);W(e.siblings(".fsNewsSettingCalloutOption"),!e.prop("checked"))})),te("#fsNewsSettingShowComments").on("change",(function(){var e=te(this);W(e.siblings(".fsNewsSettingCommentOptions"),!e.prop("checked"))})),te("#fsElementSettingSlideshowAutoplay").on("change",(function(){W(te(".fsElementSettingSlideshowDuration"),!te(this).is(":checked"))})),te("#fsNewsSettingPostShowBody").on("change",(function(){var e=te(this);W(e.siblings(".fsNewsSettingPostCalloutOption"),!e.prop("checked"))}))}},nn={connectWith:ie.SORTABLE_SELECTOR,cursorAt:{left:5,top:5},distance:10,items:">"+$e+Ut+":not("+zt+" > "+bt+")",placeholder:"fsElementPlaceholder",scrollSensitivity:125,tolerance:"pointer",cancel:Mt+", :input:not(.fsElementMovable),.CodeMirror,.redactor-box,.fsEmbeddedGoogleMap,"+bt+" > header :header,.fsBannerOverlayWrapper",helper:function(e,t){return te("<div/>",{height:"auto",id:"fsElementDragHelper",text:t.data("title")+" Element",width:"250px"})},start:function(){te(this).sortable("refreshPositions"),Vt.addClass(Ye)},stop:function(){Vt.removeClass(Ye)},update:function(e,t){var n=te(this);if(r(ce(n)),this===t.item.parent()[0]){var i=te(t.item),a=i.parent(),o=i.prev($e),s=a.hasClass(Et);s&&(a=ue(me(a)),o=a.find("> "+qe+" > "+$e).last()),ye(i,o,ce(a)).fail((function(){n.sortable("cancel"),te(t.sender).sortable("cancel")})).success((function(){s&&(o.length?i.insertAfter(o):i.appendTo(a.find(qe)),r(ce(a))),be.triggerElementMoved(i)}))}else t.item.parent().parent().hasClass(Ee)&&!t.item.hasClass(_t)&&n.sortable("cancel")}};if(Gt.ajaxSend((function(e,t,n){!n.crossDomain&&/PUT|POST|PATCH|DELETE/.test(n.type)&&t.setRequestHeader("X-CSRF-Token",Kt)})),Gt.ajaxError((function(e,n){401==n.status&&(t.alert("You are not authorized. Please log in and try again."),top.location.href=ae?"/admin.cfm":"/fs/login")})),Vt.on("click",Fe+" > "+qe+Ut,(function(){var n,i,r=te(this),a=r.closest(Fe),o=r.find(ze),s=!1;if(sessionStorage.setItem("expandPageID",Vt.data("pageid")),Vt.hasClass(Pe)&&"undefined"!=typeof CKEDITOR)if(o.hasClass(xt)||a.hasClass(Rt)?s=!0:Vt.add(a).addClass(Rt),o.data("editor")==Me)s||(n={fsHasResources:B(),startupFocus:!0,usePickerEvents:!0,on:{blur:function(){t.cancelEditorBlurSave?t.console.warn("Editor blur fired but was cancelled because cancelEditorBlurSave is true."):te(".fsAppModalDialogContent",t.top.document).is(":visible")||U(o)},change:function(){Jt||L(!0)},instanceReady:function(){Z=this.getData(),i=fe(ce(r)),Xt[i]?(Xt[i].resources=[],Xt[i].changed=!1):Xt[i]={changed:!1,resources:[]},ne.each(o.data("resources"),(function(e){Xt[i].resources.push({id:e.id,uuid:e.uuid})}))}}},t.FS.ckeditor.getConfig(n).then((function(t){t.fsHasResourcesCompatibilityMode=e.managers.resources.compatibilityMode,t.fsHasResourcesRequireAltText=e.managers.resources.requireAltText,CKEDITOR.replace(o.get(0),t)})));else if(!o.hasClass(xt)){var l=te.extend({},en,{focus:!0,blurCallback:function(){te(".redactor-image-editter, .redactor-link-tooltip").is(":visible")||U(o)},changeCallback:function(){Jt||L(!0)},initCallback:function(){Vt.find(Mt).not(a).each((function(){U(te(this).find(ze))})),Z=this.code.get()}});o.redactor(l)}})),Vt.on("click",Fe+"[data-shared-id]:not([data-settings-id])",(function(e){var t=ce(te(this));Vt.hasClass(Pe)&&!te(e.target).hasClass("fsElementAdd")&&m(t)})),Vt.on("click",".fsElementAdd",(function(e){var t=te(this).parent(),n=t.hasClass(et),i=n?t:ce(t);i.addClass(Te),v().data("element",i).data("showLocation",!n).dialog("option","position",{at:"center",collision:"fit",my:"center top",of:e}).dialog("open")})),Vt.on("mousedown",".fsElementSave",(function(){return U(b(te(this),ze)),!1})),Vt.on("mousedown",".fsElementCancel",(function(){var e=b(te(this),ze);return e.data("editor")==Me?y(b(te(this),Ne).attr("id")).setData(Z):b(te(this),Dt).redactor("code.set",Z),s(e),L(!1),!1})),Vt.on("click",".fsElementBannerEdit",(function(){K||(K=te('<div id="'+Ae+'"></div>'),Vt.append(K)),K.show(),f(),N(te(this))})),Vt.on("click",".fsElementBannerExit, #"+Ae,(function(){f(),P(te(yt)),j(ce(te(xe)),!1).done(o)})),Vt.on("click",".fsElementBannerPublish",(function(){_e("banner:requestPublish",fe(ce(te(this))))})),Vt.on("click",Ke,(function(){var e=te(this);return g(ce(e)),!1})),Vt.on("click",Xe,(function(){var e=te(this);return m(e.is(zt+" > ul "+Xe)?ue(me(e)):ce(e)),!1})),Vt.on("click",We,(function(){var e,t=te(this),n=ce(t),i="fsElementCopySuccessful",r=C(n);return"SharedContainer"==r?r="Container":"PanelGroup"==r&&(n.hasClass("fsTabs")?r+="Tabs":r+="Accordion"),a(),e={id:fe(n),timestamp:Date.now(),title:S(n),type:r},sessionStorage.setItem("copiedElement",JSON.stringify(e)),t.addClass(Ve).addClass(i),setTimeout((function(){t.removeClass(i)}),1e3),!1})),Vt.on("click",".fsElementDelete",(function(){var e,t,n,i,r=te(this),a="",o=!1;if(r.is(zt+" > ul .fsElementDelete")||r.is(wt+" > .fsElementDelete")){if((n=r.closest("li")).parent().find(".fsTabsNavItem").length<2)return alert("Sorry, you cannot delete at this time. This element requires at least one panel."),!1;t=me(r),e=ue(t)}else e=ce(r),t=fe(e);i=S(e),e.find($e).not($e+bt).length>0&&(o=!0);var s=C(e);return _e("element:delete:display",{elementID:t,isParent:o,message:a,pageID:pe(),tabListItem:n,title:i,type:s}),!1})),Vt.on("click",".fsAddTab",(function(){var e=te(this),t=e.closest(qt),n=fe(t),i=e.parent().prev(),r=e.html();e.prop(Be,!0).html(ht),le(n,i.length>0?fe(i):0,!0).done((function(e){var r=te(e).addClass(mt),a=t.find("ul .fsElementActionButtonContainer").first().clone(),o=fe(te(e)),s=te("<li>",{id:"fsTab_"+o});s.append(te("<a>",{href:"#"+r.attr("id"),html:"New Tab"})).append(a).addClass(Et),s.insertAfter(i),t.find("> "+qe+" > .fsElement").last().after(r),be.triggerElementUpdated(t),be.triggerElementAdded(r),P(te(yt)),_e("element:create",n)})).always((function(){e.prop(Be,!1).html(r)}))})),Vt.on("click",$e+Ut+" "+Ce+":not("+je+"), "+$e+Ut+" .fsElementEmpty",(function(){var e=ce(te(this));ae&&d()&&e.find(Xe).length&&m(e)})),re&&P(te(xe)),oe&&P(te(yt)),ae&&d()&&!Vt.hasClass("fsBannerPreviewMode")&&l(!0),Vt.on("click",Lt,(function(){return Y(),!1})),Vt.on("click",ot,(function(e){var t=te(e.originalEvent.target),n=t.closest(st),i=n.find(ct);n.find(lt).val(0),i.data("defaulttext")?i.text(i.data("defaulttext")).addClass(ut):i.empty().addClass(at),t.closest(ot).addClass(at)})),Vt.on("click",".fsLinkedPagePickerButton",(function(e){var t=e.originalEvent.target,n={id:t.id,pickerOptions:{allowBranchSelection:!0,depth:te(t).attr("data-depth"),selectedPageIDs:[pe()]}};_e("pagePicker:open",n)})),ae){var rn=".redactor-box a, .redactor-dropdown a, .redactor-link-tooltip a, #redactor-modal a,.fsMediaGalleryObject a, .fsTabs a, .fsTabsNav .ui-tabs-anchor, .jstree-checkbox-selectall,.fsNotification a, .fsAlternateViewToggleLink, .fsElementPagination a, .juicer-feed a";Vt.on("click","a[href]:not("+rn+")",(function(){var e=te(this),n=e.attr("href"),i=he(n,e.data("page-id"));return!!/^(javascript:|mailto:|tel:|#)/.test(n)||(i.pageID?_e("page:show",{pageID:i.pageID,queryString:i.queryString}):t.open(n,"fsPopWin"),!1)}))}if(Yt.on("message",(function(e){var n;try{n=JSON.parse(e.originalEvent.data)}catch(e){n={event:""}}switch(n.event&&"fsGlobal:"==n.event.substr(0,9)&&t.parent.postMessage(JSON.stringify(n),t.location.origin),n.event){case"composeMode":l(n.data);break;case"devicePreview:open":h(!0);break;case"devicePreview:close":h(!1);break;case"element:deleted":u(n.data.elementID,n.data.tabItem);break;case"element:updated":var i=te(n.data.elementHtml),r=ue(n.data.elementID),a="linked-element-ids",o=i.data(a)||[],s=r.data(a)||[],d=r.closest(".fsBanner");n.data.elementHtml&&(r.replaceWith(i),ne.isEqual(o,s)||ne.each(ne.unique(o.concat(s)),(function(e){ue(e).length&&de(e)})),be.triggerElementUpdated(i)),d.length&&(i.is(".fsBanner")&&N(ue(n.data.elementID)).done((function(){te(this).find(".fsElementBannerPublish").removeClass(at)})),d.find(".fsElementBannerPublish").removeClass(at),ie.notifyAdminInterface("element:update",ie.getElementID(d)));break;case"pagePicker:return":var c=te("#"+n.data.target).closest(st);c.find(lt).val(n.data.pageID),c.find(ct).text(n.data.pageName).removeClass(at+" "+ut),c.find(ot).removeClass(at);break;case"postFolderPicker:return":var f=te("#"+n.data.target).closest(St),p=te("<input>",{class:"fsLinkedPostFolderIDs",multiple:"multiple",name:"settings[board_folder_ids][]",type:"hidden"}),g=n.data.selectedItemIDs;f.find(Tt).remove(),te.each(g,(function(e,t){f.append(p.clone().val(t))})),0==g.length&&f.append(p),f.find(".fsLinkedPostFoldersSelected").text(g.length+" folders selected")}e.preventDefault()})),Vt.on("click",".fsElementPagination a, .fsLoadMoreButton:not("+ft.map((function(e){return e+" .fsLoadMoreButton"})).join(",")+")",ie.loadMoreHandler),Yt.resize((function(){clearInterval(ee),ee=setTimeout(ie.adjustMediaAspectRatio,250)})),te.widget("ui.dialog",te.ui.dialog,{_allowInteraction:function(e){return!!this._super(e)||(e.target.ownerDocument!=this.document[0]||(!!te(e.target).closest("#redactor-modal, .redactor-dropdown, .redactor-link-tooltip, .redactor-box-fullscreen").length||void 0))},_moveToTop:function(e,t){e&&this.options.modal||this._super(e,t)}}),ae){var an=ne.debounce((function(){Vt.hasClass(Pe)&&te(yt).find(ie.SORTABLE_SELECTOR).sortable(nn)}),750);be.onElementShown("Panel",an),be.onElementHidden("Panel",an),te((function(){var e=_();if(ie.setupClearInputButtons(Vt.find(Oe)),z(Vt.find(dt)),e){var t=ue(e.id);t&&t.find(We+":first").addClass(Ve)}}))}ie.SORTABLE_CONFIG=nn}(FS,window),function(e){"use strict";function t(e,t,n,i,r){return e<n&&(r||n*i>=t)}function n(){function e(e,t){(e.length||t.length)&&(t.each((function(){var e=d(this);r(e)&&(e.removeClass(m),d(y,e).each((function(){a(d(this))})))})),e.each((function(){var e=d(this);r(e)&&(e.removeClass(_),a(e))})))}var t=d(b),n=d(v);(t.length||n.length)&&e(t,n),u.on("scroll.fsLazyLoadImages",c.throttle((function(){t=d(b),n=d(v),t.length||n.length?e(t,n):u.off("scroll.fsLazyLoadImages")}),100))}function i(e){for(var t=e.parent();t;){if("inline"!=t.css("display")&&parseInt(t.css("width"))>E&&!t.hasClass("fsImageCaptioned"))return t;t=t.parent()}return e}function r(e){return e.offset().top<2*u.height()+window.scrollY}function a(e){var n,r,a,o,s=e.closest(".fsDialog"),l=e.closest(".fsPanel"),d=e.attr("data-aspect-ratio"),u=e.data("cache-id"),h=f[u],p=e.attr("width"),g=JSON.parse(e.attr("data-image-sizes").replace(/%22/g,'"')),m=!1,v="IMG"==e.prop("tagName"),y=!1,_=e.get(0).style.height,b={alt:e.attr("alt"),style:e.attr("style")||""};g&&(l.length&&!l.hasClass("fsStateOpen")||s.length&&!s.attr("open")&&!s.hasClass("fsStateOpen")||(e.attr("alt","").css({height:0,margin:0,padding:0}),h||(m=!0,u=c.uniqueId(),h=f[u]={$parentElement:i(e),cachedSize:0,sizes:c.sortBy(g,"width")},e.data("cache-id",u)),a=e.width(),e.get(0).style.height=_,r=e.innerHeight(),(v&&!m||a<E)&&(y=!0,(a=h.$parentElement.width())>p&&(a=p)),o=y||r<E,e.attr(b),t(a,r,h.cachedSize,d,o)||(n=c.find(h.sizes,(function(e,n){return t(a,r,e.width,d,o)||n==h.sizes.length-1})),v&&e.attr("src")!=n.url?(e.one("load",(function(){e.data("image-loaded",!0),e.trigger("image:loaded")})),e.data("image-loaded",!1),e.attr("src",n.url),h.cachedSize=n.width):v||e.css("background-image").replace(/url\(['"]?([^'"]+)['"]?\)/,"$1")==n.url||(e.css("background-image","url('"+n.url+"')"),h.cachedSize=n.width))))}function o(e){var t=d(document.body).data("lazy-load-media");d(y).each((function(){var n=d(this),i=p.getElement(n);e&&i.attr("data-manual-resource-scaling")||(!t||r(n)?a(n):i.hasClass(w)?i.addClass(m):n.addClass(_))})),t&&e&&n()}function s(e){var t=d(document.body).data("lazy-load-media");e.find(y).addBack(y).each((function(){var e=d(this);!t||r(e)||e.parents(".fsElementSlideshow").length&&r(e.parents(".fsElementSlideshow"))?a(e):e.addClass(_)}))}var l,d=e.$,c=e._,u=d(window),f={},h=e.getNS("events"),p=e.getInternalNS("elements.utils"),g="all",m="fsDelayedImageContainer",v="."+m,y="[data-image-sizes]",_="fsDelayedImage",b="."+_,E=40,w="fsSlideshow";l=c.debounce(o,500),u.resize((function(){l(!1)})),h.onElementAdded(g,s),h.onElementDialogShown(g,s),h.onElementMoved(g,s),h.onElementShown(h.ALL_CONTAINERS_TYPE,s),h.onElementUpdated(g,s),o(!0),e.util.updateDynamicImages=s}(FS),function(e){"use strict";function t(t){return e(t).closest(f)}function n(e){var n=t(e);n.find(d).val(""),n.find(h+","+p).addClass(u),n.find(c).removeClass(u),n.find(d).focus()}function i(e){var n=t(e);n.find(c+","+p+","+g).addClass(u),n.find(h).removeClass(u).find(".fsLoginUsername").focus()}function r(e){var n=t(e);n.find(c+","+h).addClass(u),n.find(p).removeClass(u),n.find(p+" .fsLoginNewFirstName").focus()}function a(e){var n=t(e);n.find(b).removeClass(u),n.find(E).addClass(u),n.find(m).text(""),n.find(y).val(""),n.find(v).val(""),n.find(_).val(""),n.find(v).focus()}function o(e,n){var i=t(e);i.find(b).addClass(u),i.find(E).removeClass(u),i.find(m).text(n),i.find(y).val(n),i.find(_).focus()}function s(){return e(".fsStaggeredLogin").length>0}var l=FS.getInternalNS("elements.utils"),d=".fsLoginForgotEmail",c=".fsLoginForgotView",u="fsStateHidden",f=".fsAccount",h=".fsLoginMainView",p=".fsLoginNewView",g=".fsResetPasswordView",m=".fsStaggeredLoginUsernameDisplay",v='input[name="usernameCheck"]',y='input[name="username"]',_='input[name="password"]',b=".fsStaggeredLoginStage1",E=".fsStaggeredLoginStage2";e(".fsLoginForgotPasswordLink a").on("click",(function(){return"#"!=e(this).attr("href")||(n(this),!1)})),e(".fsLoginNewAccountLink a").on("click",(function(){return"#"!=e(this).attr("href")||(r(this),!1)})),e(".fsLoginForgotCancel, .fsLoginNewCancel, .fsResetCancel").on("click",(function(){i(this)})),s()?(e(".fsStaggeredLoginCheckAuthType").submit((function(t){t.preventDefault();var n=e(this),i=n.find(v).val();l.loadingOverlay(n),e.when(l.getToken()).then((function(t){e.ajax({dataType:"json",type:"POST",url:"/fs/auth/checkauthtype",data:{authenticity_token:t,username:i}}).done((function(e){if(e.oauth_redirect&&!e.oauth_is_popup)window.location=e.oauth_redirect;else if(e.oauth_is_popup)if("firebase/google"==e.authMethod){window.firebase.initializeApp({apiKey:e.oauth_popup_data.APIKEY,authDomain:e.oauth_popup_data.AUTHDOMAIN,projectId:e.oauth_popup_data.PROJECTID});const t=window.firebase.auth(),r=new window.firebase.auth.GoogleAuthProvider;r.setCustomParameters({login_hint:i}),t.signInWithPopup(r).then((t=>{const n=t.credential.accessToken;window.location.href="/integration/oauth/firebase/google.cfm?checksum="+e.checksum+"&verifytoken="+n})).catch((t=>{l.removeLoadingOverlay(n),t.message.includes("blocked")?window.location=e.oauth_redirect:alert("ERROR: \n\n"+t.message)}))}else alert("ERROR: \n\n auth method not supported");else l.removeLoadingOverlay(n),o(n,i)})).fail((function(e,t,i){l.removeLoadingOverlay(n),400==e.status?alert("Your username was missing. Please enter it and try again."):alert(i)}))}))})),e(".fsAccount form:not(.fsStaggeredLoginCheckAuthType)").submit(l.loginFormSubmitHandler),e(".fsStaggeredLoginGotoStage1").click((function(){a(e(this))}))):e(".fsAccount form").submit(l.loginFormSubmitHandler),e(".fsResetContinue").on("click",(function(){var n,r=e(this),a=t(r),o=a.find(".fsResetRequestKey"),s=a.find(".fsResetUsername"),l=a.find(".fsResetNewPassword"),d=a.find(".fsResetNewVerifyPassword"),c=e.trim(s.val()),f=e.trim(o.val()),h=e.trim(l.val()),p=e.trim(d.val());return a.find(".fsError").addClass(u),0==c.length?(n="Please enter your username to continue.",alert(n),s.next(".fsError").removeClass(u).html(n),void s.val("").focus()):0==h.length?(n="Please enter a password to continue.",alert(n),
l.next(".fsError").removeClass(u).html(n),void l.val("").focus()):0==p.length?(n="Please verify the password by typing it again.",alert(n),d.next(".fsError").removeClass(u).html(n),void d.val("").focus()):h!=p?(n="Please verify the password by ensuring that both passwords match.",l.next(".fsError").removeClass(u).html(n),d.next(".fsError").removeClass(u).html(n),void alert(n)):(r.prop("disabled",!0),void e.ajax({dataType:"json",type:"POST",url:"/cf_endpoints/routes.cfm/constituents/reset_password.json",data:{password:h,password_confirm:p,request_key:f,username:c},error:function(e,t,n){alert(n),r.prop("disabled",!1)},success:function(e){e.success?(alert("You have successfully updated your password. Please log in using your new password."),i(r)):alert(e.error),r.prop("disabled",!1)}}))})),e(".fsLoginForgotSubmit").on("click",(function(){var t=e(this),n=t.siblings(d),r=e.trim(n.val());if(0==r.length)return alert("Please enter an email address to continue."),n.val(""),void n.focus();t.prop("disabled",!0),e.ajax({data:{email:r},dataType:"json",type:"POST",url:"/cf_endpoints/routes.cfm/constituents/forgot.json",error:function(e,n,i){alert(i),t.prop("disabled",!1)},success:function(e){e.success?(alert("You have been sent an email with your login information."),i(t)):alert(e.error),t.prop("disabled",!1)}})})),e(".fsLoginNewContinue").on("click",(function(){var n=e(this),i=t(this),r=i.find('.fsLoginNewFirstName + input[type="text"]'),a=i.find('.fsLoginNewLastName + input[type="text"]'),o=i.find('.fsLoginNewEmail + input[type="text"]'),s=i.find('.fsLoginNewVerifyEmail + input[type="text"]'),l=i.find('.fsLoginNewPassword + input[type="password"]'),d=i.find('.fsLoginNewVerifyPassword + input[type="password"]'),c=i.find(".fsLoginNewCaptcha"),u=i.find('.fsLoginNewCaptcha textarea[name="g-recaptcha-response"]'),f=e.trim(r.val()),p=e.trim(a.val()),g=e.trim(o.val()),m=e.trim(s.val()),v=l.val(),b=d.val(),E="";if(0==f.length)return alert("Please enter your first name to continue."),void r.val("").focus();if(0==p.length)return alert("Please enter your last name to continue."),void a.val("").focus();if(0==g.length)return alert("Please enter your email address to continue."),void o.val("").focus();if(0==m.length)return alert("Please verify your email address by typing it again."),void s.val("").focus();if(g==m){if(0==v.length)return alert("Please enter a password to continue."),void l.val("").focus();if(0==b.length)return alert("Please verify the password by typing it again."),void d.val("").focus();if(v==b){if(c.length>0&&u.length>0&&0==(E=u.val()).length)return alert("Please complete the CAPTCHA to continue."),void u.focus();n.prop("disabled",!0);var w={email:g,first_name:f,last_name:p,password:v,verify_email:m,verify_password:b};E.length>0&&(w.captcha_response=E),e.ajax({data:w,dataType:"json",type:"POST",url:"/cf_endpoints/routes.cfm/constituents/new.json",error:function(e,t,i){alert(i),n.prop("disabled",!1)},success:function(e){e.success?(alert("You have been sent an email with your new account information."),i.find(y).val(g),i.find(_).val(v),i.find(h+" form").submit()):alert(e.error),n.prop("disabled",!1)}})}else alert("Please verify the password by ensuring that both passwords match.")}else alert("Please verify your email address by ensuring that both addresses match.")})),window.onAccountCaptchaLoadCallback=function(){var t=e("#g-recaptcha-response");t.attr("aria-hidden",!0),t.attr("aria-label","hidden grecaptcha response")}}(jQuery),function(e,t,n){"use strict";function i(){var i=e(this),r=n.getElement(i),o=r.children(a),d=r.hasClass("fsList")?r.find(".fsListItems"):r.find(".fsEventTable"),c={},u=i.data("start-row"),f=d.data("event-year");c.athletics_team_id=i.data("filter-id"),c.start_row=u,i.hasClass(s)?(c.is_load_more=!1,c.start_event_year=e(l).val()):f&&(c.start_event_year=f),n.loadingOverlay(o),n.loadElementData(r,c).done((function(n){var l,d=e(n);i.hasClass(s)?(l=d.find(a),o.replaceWith(l),o=r.children(a)):(r.hasClass("fsTable")?(l=d.find(".fsEventTable > tbody").children(),r.find(".fsLoadMoreButtonRow").replaceWith(l)):(l=d.find(a).children(":not(.fsElementEmpty)"),i.replaceWith(l)),r.addClass("fsLoadMoreClicked"),t.triggerElementMoreLoaded(r,l)),o.siblings(".fsLoadingDotsOverlay").remove()}))}function r(t){t.on("click",".fsLoadMoreButton",i).on("change",l,i).on("click",".fsAthleticsEventDetailLink, .fsAthleticsEventRecapLink, .fsAthleticsEventReadMoreLink",(function(t){var i=e(this),r=n.getElement(i),a=i.data("occurid");if("page"==i.data("linktype"))return!0;t.preventDefault(),r.data("linked-element-ids")?(n.populateLinkedElements(r,{occur_id:a}),n.updateURLParams({virtualParam:"/~occur-id/"+a})):"popup"==i.data("linktype")&&n.openAthleticEventPopup(a,i)})).on("click",".fsAlertIcon",(function(t){t.preventDefault(),window.open("/cf_directory/cp.cfm?eventtype=Athletics&eventid="+e(this).data("eventid"),"","width=600,height=600")})).on("click",".fsRSSIcon, .fsAlertsIcon",(function(e){e.preventDefault(),window.open("/cf_athletics/cms_athletic_feeds.cfm","","width=600,height=600")}))}var a="."+"fsElementContent",o="AthleticsEvent",s="fsSelectStartEventYear",l="."+s;t.onElementAdded(o,r),t.onElementUpdated(o,r),t.onElementDialogShown(o,r),r(e(".fs"+o))}(FS.$,FS.events,FS.getInternalNS("elements.utils")),function(e){"use strict";function t(e){e.find(".fsAthleticsBioLink").on("click",(function(){var e=i(this),t=e.closest(".fsElementTable"),n=e.text(),r=e.data("person-id"),a=t.data("team-id"),o=t.data("team-name"),s="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=520,height=400",l="/cf_athletics/components/display.cfc?method=outputBio&view=bio&personid="+r+"&teamID="+a+"&derivedName="+encodeURI(n)+"&teamName="+encodeURI(o);return window.open(l,"bioPop",s).focus(),!1}))}var n="AthleticsRoster",i=e.$,r=e.events;r.onElementAdded(n,t),r.onElementUpdated(n,t),t(i(".fs"+n))}(FS),function(e,t){"use strict";function n(e){e.on("change",".fsAthleticsTeamDirectory",(function(){var n=t(this),r=n.val();if(""==r)return!1;if(e.data("linked-element-ids"))i(e,r);else if(s){var a=o(r,n.data("page-id"));l("page:show",{pageID:a.pageID,queryString:a.queryString})}else window.location.href=r})).on("click",".fsAthleticsTeamName > a[data-team-id]",(function(){return i(e,t(this).data("team-id")),!1}))}function i(e,t){a.populateLinkedElements(e,{athletics_team_id:t}),a.updateURLParams({virtualParam:"/~athletics-team-id/"+t})}var r=e.events,a=e.getInternalNS("elements.utils"),o=a.getInternalLinkProperties,s=a.inDraftMode(),l=a.notifyAdminInterface;t(".fsAthleticsTeam").each((function(){n(t(this))})),r.onElementAdded("athleticsteam",n),r.onElementUpdated("athleticsteam",n)}(FS,FS.$),function(e){"use strict";var t=e.$,n=e.events,i=t("body"),r=".fsMenu",a="fsStateMenuOpen";e.menu={hide:function(){i.hasClass(a)&&(i.removeClass(a),n.triggerElementHidden(t(r)))},show:function(){i.hasClass(a)||(i.addClass(a),n.triggerElementShown(t(r)))},toggle:function(){i.hasClass(a)?e.menu.hide():e.menu.show()}},n.onElementUpdated("Banner",(function(e){e.find(".fsElement").each((function(){n.triggerElementUpdated(t(this))}))}))}(FS),function(e){"use strict";function t(e){e.on("click",".fsBoardLink[data-slug][data-opens-in=element]",(function(){var e=n(this),t=r.getElement(e);return r.populateLinkedElements(t,{board_id:e.data("board-id"),page_id:r.getPageID()}),r.updateURLParams({virtualParam:"/~board/"+e.data("slug")}),!1}))}var n=e.$,i=e.events,r=e.getInternalNS("elements.utils"),a="Board";i.onElementAdded(a,t),i.onElementUpdated(a,t),i.onElementDialogShown(a,t),n(".fs"+a+"Element").each((function(){t(n(this))}))}(FS),function(e){"use strict";var t=e.$,n=e._,i=e.getInternalNS("elements.calendar.utils"),r=e.getInternalNS("elements.constants.classes"),a=e.getInternalNS("elements.utils"),o=e.moment,s="fsCalendarGridShowMonthPickerButton",l="."+s,d=".fsCalendarMonthYearPicker";i.getCalendarFilterDialogTemplate=function(){return n.template('<div class="fsCalendarFilterDialogContent">\t\t\t\t<h2>Calendar Filter</h2>\t\t\t\t<div class="fsCalendarFilterDialogCalendars"><div class="fsLoadingDots"></div></div>\t\t\t\t<div class="fsCalendarFilterDialogTeams"><div class="fsLoadingDots"></div></div>\t\t\t\t<div class="fsDialogFooterButtons">\t\t\t\t\t<button class="fsDialogCancelButton">Cancel</button>\t\t\t\t\t<button class="fsAppModalApplyButton">Apply</button>\t\t\t\t</div>\t\t\t</div>')()},i.getDateDivFromMoment=function(e,t){return e.find('.fsCalendarDate[data-day="'+t.date()+'"][data-year="'+t.year()+'"][data-month="'+t.month()+'"]')},i.getMomentFromDateDiv=function(e){return o({date:e.data("day"),month:e.data("month"),year:e.data("year")})},i.monthPickerClickHandler=function(n,i){var c,u=n.find(d);if(u.length)u.toggleClass(r.stateHidden);else{var f,h,p=n.find(l),g=p.data("month"),m=p.data("year"),v=a.getElementID(n);u=t('<div class="fsCalendarMonthYearPicker" tabindex="0"><div class="fsCalendarMonthPicker"><ul/></div><div class="fsCalendarYearPicker"><ul/></div><button class="fsStyleUpdateButton" disabled>GO</button></div>'),c=u.find(".fsCalendarMonthPicker ul"),h=u.find(".fsCalendarYearPicker ul"),f=u.find("button"),e._.each(o.months(),(function(e,n){var i="fsCalendarGridMonthPickerInput"+e+"-"+v,r=n+1,a=t("<li>"),o=t("<label>",{for:i,text:e}),s=t("<input>",{checked:r==g,id:i,name:"fsCalendarMonthInput-"+v,type:"radio",value:r<10?"0"+r:r});a.append(s),a.append(o),c.append(a)}));for(var y=m-5;y<=m+5;y++){var _="fsElementGridYearPickerInput"+y+"-"+v,b=t("<label>",{for:_,text:y}),E=t("<li>"),w=t("<input>",{checked:y==m,id:_,name:"fsCalendarYearInput-"+v,type:"radio",value:y});E.append(w),E.append(b),h.append(E)}u.on("change","input",(function(){var e=c.find("input:checked").val(),t=h.find("input:checked").val();f.prop("disabled",!1).val(t+"-"+e+"-01")})),f.click((function(){u.addClass(r.stateHidden),t(document).off("click.monthPicker")})).click(i),p.parent().append(u.wrap("<div/>").parent())}u.length&&!u.hasClass(r.stateHidden)&&((c=u.find(".fsCalendarMonthPicker ul")).find("input:checked").focus(),t("body").on("focusin.calendarMonthPickerFocus",(function(e){t(e.target).closest(u).length||(u.addClass(r.stateHidden),t(this).off("focusin.calendarMonthPickerFocus"))}))),t(document).on("click.monthPicker",(function(e){var n=t(e.target);n.closest(u).length||n.hasClass(s)||(u.addClass(r.stateHidden),t(document).off("click.monthPicker"))}))}}(FS),function(e,t){"use strict";function n(e,t,n){var i=e.find(M),r=e.find(".fsCalendarNextMonth"),a=e.find(".fsCalendarPrevMonth"),o="fsCalendar"+t+"Browser";e.find('.fsDisplayNavigation button[aria-selected="true"]').attr("aria-selected",!1),e.find(".fsDisplayNavigation button[data-view="+t+"]").attr("aria-selected",!0),r.attr("aria-label","Next "+t),a.attr("aria-label","Previous "+t),i.removeClass("fsCalendarMonthBrowser fsCalendarWeekBrowser fsCalendarDayBrowser").addClass(o),"Week"==t?m(e,n):"Day"==t?h(e,n):g(e)}function i(e){var t=e.find(A),n=e.find(I);return t.length?t:H.getDateDivFromMoment(e,H.getMomentFromDateDiv(n))}function r(e){var t=e.find(M);return t.hasClass("fsCalendarDayBrowser")?"Day":t.hasClass("fsCalendarWeekBrowser")?"Week":"Month"}function a(e){return($.get(e)||"").split(":").filter((function(e){return""!=e}))}function o(e){var t=E(e.target),i=G.getElement(t),a=i.children(D),o=t.val(),s=r(i),l=U(t.val()),d=q[G.getElementID(i)].filters,u=t.data("start-row");if(o&&(d.cal_date=o),u&&(d.start_row=u),s.match(/^(Day|Week)$/)&&H.getDateDivFromMoment(i,l).length)return n(i,s,l),!1;G.loadingOverlay(a),G.loadElementData(i,d).done((function(e){var t=E(e);i.replaceWith(t),z.triggerElementUpdated(t,s,l),V.triggerUpdated(G.getElementID(i),d),c(i,l)}))}function s(e){"complete"==document.readyState?d(e):e.data("willResizeOnLoad")||(e.data("willResizeOnLoad",!0),E(t).one("load",(function(){d(e)})))}function l(e,t,n,i,r,a,o){var s=E("<ul>"),l=E("<span><strong>"+o+"</strong></span>"),d=t.length>0?"Select All":"Deselect All",c=E('<button class="fsSelectAll fsStyleDefaultButton fsStyleFloatRight">'+d+"</button>");E.each(e,(function(e,a){var o=E("<li>"),l=a[n],d=r+l;o.append(E("<input>",{checked:-1==t.indexOf(l.toString()),id:d,type:"checkbox",value:l})),o.append(E("<label>",{for:d,text:a[i]})),s.append(o)})),a.html(s).prepend(c).prepend(l),G.setupSelectAllButtons(a,a)}function d(t){t.find(".fsCalendarRow").each((function(){var t,n=E(".fsCalendarDaybox",this);n.css("height",""),t=e._.reduce(n,(function(e,t){var n,i,r=E(t);return r.hasClass("fsCalendarWeekendDayBox")?(i=r.children("div"),n=2*Math.max(E(i[0]).outerHeight(),E(i[1]).outerHeight())):n=r.outerHeight(),Math.max(e,n)}),0),n.css("height",t+"px")}))}function c(e,t){var n=q[G.getElementID(e)],i=t.format(P);G.updateURLParams({queryString:{cal_date:i}}),n.filters.cal_date=i,n.date=t}function u(e,t,n,i){e.find(I).data({day:t,month:n,year:i})}function f(e,i,d){var c=e.attr("data-calendar-ids")||"",u=G.getElementID(e),f=e.attr("data-team-ids")||"",h=e.data("trigger-element-ids");if(i&&d&&e.hasClass("fsGrid")&&n(e,i,d),h){var g=q[u];V.triggerUpdated(u,g.filters),V.onFilter(u,h,(function(t,i){var a=r(e),o=!0;if(w.has(i,"calendarIDsToHide")){var s="hide_cals_el_"+u;i.calendarIDsToHide.length>0?$.set(s,i.calendarIDsToHide.join(":")):$.remove(s)}if(w.has(i,"teamIDsToHide")){var l="hide_teams_el_"+u;i.teamIDsToHide.length>0?$.set(l,i.teamIDsToHide.join(":")):$.remove(l)}if(w.has(i,"date")&&(g.date=i.date,g.filters.cal_date=i.date.format(P),e.hasClass("fsList"))){var d=i.date.format(P);g.filters.start_date=d,g.filters.end_date=d}if(w.has(i,"keywords")&&(g.filters.keywords=i.keywords),w.has(i,"rangeStart")&&(g.filters.start_date=i.rangeStart?i.rangeStart.format(P):null),w.has(i,"rangeEnd")&&(g.filters.end_date=i.rangeEnd?i.rangeEnd.format(P):null),w.isEqual(w.keys(i),["date"])){var c=H.getDateDivFromMoment(e,i.date);c.length&&!c.parent().hasClass("fsCalendarOutOfRange")&&(o=!1)}o?(G.loadingOverlay(e.find(D)),G.fetchElementHTML(u,g.filters,{elementUpdatedData:[a,g.date]}).done((function(){V.triggerUpdated(u,g.filters,t),G.removeLoadingOverlay(e.find(D))}))):n(e,a,g.date)}))}e.on("click",".fsAlertIcon",(function(e){var t=E(this);e.preventDefault(),G.openCalendarAlertPopup(t.siblings(".fsCalendarEventLink").data("ath-id")?"athletics":"calendar",t.data("eventid"))})).on("click",".fsAlertsIcon",(function(e){e.preventDefault(),G.openCalendarAlertPopup("calendar","all",G.getElement(E(this)).data("calendar-ids"))})).on("click",".fsAlternateViewToggleLink",(function(n){n.preventDefault();var i=E(this),r=e.find(".fsDayContainer:first > article > time"),a=e.hasClass("fsGrid")?H.getMomentFromDateDiv(e.find(I)):U(r.attr("datetime")),o="element_override="+(e.data("element-override")?e.data("element-override"):G.getElementID(e))+"&cal_date="+a.format(P);G.inDraftMode()?G.notifyAdminInterface("page:show",{pageID:i.data("page-id"),queryString:o}):t.location.href=i.attr("href")+"?"+o})).on("click",".fsLoadMoreButton",(function(){var t=E(this),n=e.find(D),i={},r=G.getQueryStringValues(),a=t.data("start-row");r.cal_date&&r.cal_date.length&&(i.cal_date=r.cal_date),a&&(i.start_row=a),w.extend(i,q[u].filters),G.loadingOverlay(n),G.loadElementData(e,i).done((function(i){var r=E(i).find(D).children(":not(.fsElementEmpty)");n.siblings(".fsLoadingDotsOverlay").remove(),n.append(r),e.addClass("fsLoadMoreClicked"),t.remove(),z.triggerElementMoreLoaded(e,r)}))})).on("click",".fsRSSIcon",(function(e){var n=G.getElement(E(this));if(e.preventDefault(),t.FS.settings.calendarsEnabled){var i=n.data("calendar-ids").toString().split(",").map((function(e){return"calendar_ids[]="+e})).join("&");t.open("/fs/calendar-manager/events.ics?"+i)}else t.open("/cf_calendar/cms_calendar_feeds.cfm?element_id="+u+"&calendar_ids="+n.data("calendar-ids")+"&team_ids="+n.data("team-ids"),"","width=550,height=625")})).on("click",".fsRequestEventControl",(function(e){e.preventDefault(),t.open("/cf_calendar/postEvent.cfm?calendar_ids="+E(this).data("calendarids"),"","width=625,height=725")})).on("click",".fsDisplayNavigation button",(function(){n(e,E(this).data("view"))})).on("click",".fsCalendarFilter",(function(e){var i,o=E(this),s=o.closest(".fsElement"),d=o.data("element-id"),h="hide_cals_el_"+d,p="hide_teams_el_"+d;e.preventDefault();var g,m=S.Dialog({dialogClass:"fsCalendarFilterDialog[data-element-id='"+d+"']",id:"fsCalendarFilter_"+d+"_"});if(g=E(H.getCalendarFilterDialogTemplate()),m.setContent(g),m.open(o),m.getContentElement().on("click",".fsDialogCancelButton",(function(){var e,t=a(h),n=a(p);g.find("fsCalendarFilterDialogCalendars input").each((function(){(e=E(this)).prop("checked",-1==t.indexOf(e.val()))})),g.find("fsCalendarFilterDialogTeams input").each((function(){(e=E(this)).prop("checked",-1==n.indexOf(e.val()))})),m.close()})),m.getContentElement().on("click",".fsAppModalApplyButton",(function(){var e=r(s),t=q[u],i=g.find(".fsCalendarFilterDialogCalendars input:checkbox:not(:checked)").map((function(){return this.value})).get(),a=g.find(".fsCalendarFilterDialogTeams input:checkbox:not(:checked)").map((function(){return this.value})).get();i.length>0?$.set(h,i.join(":")):$.remove(h),a.length>0?$.set(p,a.join(":")):$.remove(p),m.close(),s.html('<div class="fsLoadingDots"></div>'),G.fetchElementHTML(d,t.filters).done((function(i){n(s=i,e,t.date)}))})),c.length){if(t.FS.settings.calendarsEnabled)i="/fs/calendar-manager/calendars.json?legacy_element=true"+c.split(",").map((function(e){return"&calendar_ids[]="+e})).join();else i="/cf_endpoints/routes.cfm/calendars.json?calendar_ids="+c;s.data("display-group-calendars")&&(i+="&include_group_calendars=true"),E.getJSON(i).done((function(e){l(e,a(h),"calendarid","calendarname","calendar_filter_id_",g.find(".fsCalendarFilterDialogCalendars"),"Display Calendar Events")}))}else g.find(".fsCalendarFilterDialogCalendars").html("");f.length?E.getJSON("/cf_endpoints/routes.cfm/athletics/teams.json?team_ids="+f).done((function(e){l(e,a(p),"id","name","team_filter_id_",g.find(".fsCalendarFilterDialogTeams"),"Display Athletic Events by Team")})):g.find(".fsCalendarFilterDialogTeams").html("")})).on("click keypress",F,p).on("click",".fsCalendarPrevMonth, .fsCalendarNextMonth",o),s(e)}function h(e,n){var r,a;t.FS.settings.calendarsEnabled?(r=n?H.getDateDivFromMoment(e,n):i(e),n=H.getMomentFromDateDiv(r),a=r.parent().find(".fsCalendarDayViewEvent"),e.find(".fsCalendarRow").removeClass(O),e.find(".fsCalendarEventGrid").addClass(O),u(e,r.data(x),r.data(L),r.data(j)),e.find(I).html(a.length?a.clone().removeClass(O):"<em>no events to show</em>").removeClass(O),y(e,n),V.triggerDisplayChanged(G.getElementID(e),"Day",n),v(e,r,"days")):(r=n?H.getDateDivFromMoment(e,n):i(e),n=H.getMomentFromDateDiv(r),a=r.parent().find(".fsCalendarInfo"),e.find(".fsCalendarRow").removeClass(O),e.find(".fsCalendarEventGrid").addClass(O),u(e,r.data(x),r.data(L),r.data(j)),e.find(I).html(a.length?a.clone():"<em>no events to show</em>").removeClass(O),y(e,n),V.triggerDisplayChanged(G.getElementID(e),"Day",n),v(e,r,"days"))}function p(){var e=G.getElement(E(this));return"Month"!=r(e)||H.monthPickerClickHandler(e,o),!1}function g(e){var t=e.find('.fsCalendarDaybox:not(.fsCalendarOutOfRange) .fsCalendarDate[data-day="1"]');e.find(".fsCalendarEventGrid, .fsCalendarRow").removeClass(O),u(e,t.data(x),t.data(L),t.data(j)),e.find(I).addClass(O),_(e),V.triggerDisplayChanged(G.getElementID(e),"Month"),v(e,t,"months")}function m(e,t){var n,r;r=(t?H.getDateDivFromMoment(e,t):i(e)).parents(".fsCalendarRow"),e.find(".fsCalendarEventGrid").removeClass(O),r.removeClass(O).siblings(".fsCalendarRow").addClass(O),u(e,(n=r.find(k+":first")).data(x),n.data(L),n.data(j)),e.find(I).addClass(O),b(e),V.triggerDisplayChanged(G.getElementID(e),"Week",H.getMomentFromDateDiv(n)),v(e,n,"weeks")}function v(e,t,n){var i=U([t.data(j),t.data(L),t.data(x)]),r=i.clone().add(1,n),a=i.clone().subtract(1,n);e.find(".fsCalendarNextMonth").val(r.format(P)),e.find(".fsCalendarPrevMonth").val(a.format(P))}function y(t,n){var i="md"==e.currentPage.dateFormat?"MMMM D, YYYY":"D MMMM, YYYY";t.find(N).html(n.format(i)),c(t,n)}function _(e){var t=e.find('.fsCalendarDaybox:not(.fsCalendarOutOfRange) .fsCalendarDate[data-day="1"]');e.find(N).html(H.getMomentFromDateDiv(t).format("MMMM YYYY"))}function b(t){var n=t.find(".fsCalendarRow:not(."+O+")"),i=n.find(k+":first"),r=n.find(k+":last"),a=t.find(N),o="dm"==e.currentPage.dateFormat?"D MMMM":"MMMM D",s=H.getMomentFromDateDiv(i);a.html(s.format(o)+" - "+H.getMomentFromDateDiv(r).format(o)),c(t,s)}var E=e.$,w=e._,T=e.getInternalNS("elements.constants.classes"),S=e.getInternalNS("dialogs"),C=e.getInternalNS("elements.constants.selectors"),k=".fsCalendarDate",I=".fsCalendarDayView",A=".fsCalendarToday > .fsCalendarDate",x="day",D=C.elementContent,R="Calendar",M=".fsCalendarGridBrowser",N=".fsCalendarGridBrowser > span",O=T.stateHidden,P="YYYY-MM-DD",L="month",F="."+"fsCalendarGridShowMonthPickerButton",j="year",B=E(document.body),U=e.moment,H=e.getInternalNS("elements.calendar.utils"),$=e.cookies,q={},z=e.events,V=e.getInternalNS("elements.linkedEvents"),G=e.getInternalNS("elements.utils");z.onElementAdded(R,f),z.onElementUpdated(R,f),z.onElementDialogShown(R,f),z.onElementShown(z.ALL_CONTAINERS_TYPE,s),E(".fs"+R).each((function(){var e=E(this);q[G.getElementID(e)]={filters:{}},f(e)})),B.on("click",'.fsCalendarEventLink[href="#"]',(function(e){var t=E(this),n=G.getElement(t),i=t.data("occur-id");return e.preventDefault(),t.data("ath-id")?G.openAthleticEventPopup(i,t):n.data("linked-element-ids")?(G.populateLinkedElements(n,{occur_id:i}),G.updateURLParams({virtualParam:"/~occur_id/"+i})):G.showElementPopupDialog(n,{occur_id:i,show_event:!0},R,t),!1}))}(FS,window),function(e){"use strict";var t=e.getInternalNS("elements.element_tools.utils"),n=e.getInternalNS("elements.linkedEvents"),i=e.getInternalNS("elements.utils");t.setupSearch=function(t){function r(){var e={};d&&(e.rangeStart=o.getMoment(),e.rangeEnd=a.getMoment()),c&&(e.keywords=l.val()),n.triggerFilter(i.getElementID(t),e)}var a,o,s=t.find(".fsElementToolsDateRange"),l=t.find(".fsElementToolsKeyword > input"),d=s.length>0,c=l.length>0;if(d){var u=s.find(".fsElementToolsDateRangeStart"),f=s.find(".fsElementToolsDateRangeEnd");o=e.rome(u[0],{dateValidator:e.rome.val.beforeEq(f[0]),time:!1}),a=e.rome(f[0],{dateValidator:e.rome.val.afterEq(u[0]),time:!1})}c&&t.on("click",".fsButtonClear",(function(){l.val("")})),l.on("keydown",(function(e){13==e.keyCode&&r()})),t.on("click",".fsElementToolsSearchButton",r)}}(FS),function(e){"use strict";function t(e){var t=s(e.target),i=t.val(),r=m.getElement(t),a=m.getElementID(r),o={cal_date:i},l=d(i);m.loadingOverlay(r.find(_)),m.fetchElementHTML(a,o).done(n),p.triggerFilter(m.getElementID(r),{date:l,rangeEnd:l.clone().endOf("month"),rangeStart:l.clone().startOf("month")})}function n(e){var t=m.getElementID(e),n=C[t]||{};if(e.find(".fsCalendarDaybox").removeClass(v),l.has(n,"displayMode")&&l.has(n,"momentObject")&&"Month"!=n.displayMode){var i=c.getDateDivFromMoment(e,n.momentObject).parent();i.addClass(v),"Week"==n.displayMode&&i.siblings(".fsCalendarDaybox").addClass(v)}}function i(e){e.hasClass("fsLegend")?r(e):e.hasClass("fsSearch")?f.setupSearch(e):e.hasClass("fsMiniGrid")&&a(e)}function r(e){var t=m.getElementID(e),n=e.data("linked-element-ids");n&&p.onUpdated(t,n,(function(n,i){m.loadingOverlay(e.find(_)),m.fetchElementHTML(t,i).done((function(){m.removeLoadingOverlay(e.find(_))}))})),1==e.find(S).length&&(e.on("click",".fsUpdateFilters",(function(){var t=e.find(S+" input:checked"),n=e.find(w+T);p.triggerFilter(m.getElementID(e),{calendarIDsToHide:n.not(y).map((function(){return this.value})).get(),teamIDsToHide:n.filter(y).map((function(){return this.value})).get()}),"selected"==t.val()&&t.trigger("change")})).on("change",S+" input",(function(){var t=e.find(".fsCalendarGroups > li");"all"==s(this).val()?e.find("li").removeClass(E):(e.find(".fsToolsList > li").each((function(){var e=s(this);e.toggleClass(E,e.find(w).is(T))})),t.each((function(){var e=s(this);e.toggleClass(E,0==e.find(w+":checked").length)}))),t.each((function(){s(this).find(g.selectAll).trigger("updateLabel")}))})),m.setupExpandableHeaders(e),m.setupSelectAllButtons(e,".fsCalendarGroups > li"))}function a(e){var i=m.getElementID(e),r=e.data("linked-element-ids");e.on("click",".fsCalendarDaybox",(function(){var t=s(this),n=c.getMomentFromDateDiv(t.find(".fsCalendarDate"));p.triggerFilter(m.getElementID(e),{date:n}),t.hasClass("fsCalendarOutOfRange")&&(m.loadingOverlay(e.find(_)),m.fetchElementHTML(m.getElementID(e),{cal_date:n.format("YYYY-MM-DD")}))})),e.on("click keypress",".fsCalendarGridShowMonthPickerButton",o).on("click",".fsCalendarPrevMonth, .fsCalendarNextMonth",t),r&&(p.onUpdated(i,r,(function(t,r,a){a!=i&&(m.loadingOverlay(e.find(_)),m.fetchElementHTML(i,l.omit(r,["end_date","start_date"])).done(n))})),p.onDisplayChanged(i,r,(function(t,r,a){C[i]={displayMode:r,momentObject:a},n(e)})))}function o(){return c.monthPickerClickHandler(m.getElement(s(this)),t),!1}var s=e.$,l=e._,d=e.moment,c=e.getInternalNS("elements.calendar.utils"),u=e.getInternalNS("elements.constants.classes"),f=e.getInternalNS("elements.element_tools.utils"),h=e.getNS("events"),p=e.getInternalNS("elements.linkedEvents"),g=e.getInternalNS("elements.constants.selectors"),m=e.getInternalNS("elements.utils"),v=u.stateActive,y=".fsCalendarFilterInput[data-calendartype=athletics]",_=g.elementContent,b="CalendarTools",E=u.stateHidden,w=".fsCalendarFilterInput",T=":not(:checked)",S=".fsElementControls",C={};h.onElementAdded(b,i),h.onElementUpdated(b,i),s(".fs"+b).each((function(){i(s(this))}))}(FS),function(e){"use strict";function t(e){e.find(o).change((function(e){var t=e.target.id.split("_")[2],i=t.charAt(0).toUpperCase()+t.slice(1),r=n("[data-loc-dept="+i+"]");n(".fsConstituent"+i+":not(:checked)").length?r.text(l):r.text(d)})),e.find(s).click((function(e){var t=n(this),i=".fsConstituent"+t.data("loc-dept");e.preventDefault(),n(i+":not(:checked)").length?(n(i).prop("checked",!0),t.text(d)):(n(i).prop("checked",!1),t.text(l))})),e.find(r).click((function(){n(this).toggleClass(a)}))}var n=e.$,i="Constituent",r=".fsStyleExpandable",a="fsStateExpanded",o=".fsConstituentLocation, .fsConstituentDepartment",s=".fsSelectAll",l="Select All",d="Select None",c=n(document.body),u=e.events,f=e.getInternalNS("elements.utils");u.onElementAdded(i,t),u.onElementUpdated(i,t),n(".fs"+i).each((function(){t(n(this))})),c.on("click",'.fsConstituentProfileLink[href="#"]',(function(e){var t=n(this),r=f.getElement(t),a=t.data("constituent-id");return e.preventDefault(),r.data("linked-element-ids")?(f.populateLinkedElements(r,{const_id:a}),f.updateURLParams({virtualParam:"/~const-id/"+a})):f.showElementPopupDialog(r,{const_id:a,show_profile:!0},i,t),!1}))}(FS,window),function(e){"use strict";function t(e){var t=p(e);t.bubbles.forEach((function(e){e.setMap(null)})),t.markers.forEach((function(e){e.setMap(null)})),t.markers=[],t.bubbles=[]}function n(e){var t=p(e);t.startInfoBubble.close(),t.bubbles.forEach((function(e){e.close()}))}function i(e,t,n){return new google.maps.Circle({center:t,radius:1609.344*u(e,n)})}function r(e,t){var i=new InfoBubble(N),r="",a=e.data("link-email"),o=e.data("link-profile"),s=p(e),l=e.data("profile-url"),d=new google.maps.Marker({icon:"https://maps.google.com/mapfiles/ms/icons/green-dot.png",map:s.map,position:{lat:t.latitude,lng:t.longitude}});t.people.forEach((function(e){r+="<div>",o&&e.is_parent&&(r+='<a href="'+l+"/~const-id/"+e.person_id+'" target="_blank">'),r+=e.first_name+" "+e.last_name,o&&e.is_parent?(r+="</a>",a&&e.email&&(r+=' <a href="mailto:'+e.email+'"><span class="fsEmailIcon"><span class="fsStyleSROnly">'+e.email+"</span></span></a>")):e.current_grade.length&&(r+=", Grade "+e.current_grade),r+="</div>"})),r+='<div class="'+C+'">'+t.address+"</div>",i.setContent(r),s.markers.push(d),s.bubbles.push(i),google.maps.event.addListener(d,"click",(function(){n(e),i.open(s.map,d)}))}function a(e,i,a){var o,s=e.data("map-distance-unit"),d=s?"mile":"kilometer",c=d+"s",f=p(e),g=f.errorInfoBubble,m=f.map,v=f.startMarker,y=f.startInfoBubble,_=D("<div>",{html:'<div>Find families within <a href="#" data-radius=".25">0.25 '+c+'</a>, <a href="#" data-radius=".5">0.50 '+c+'</a>, <a href="#" data-radius="1">1 '+d+'</a>, <a href="#" data-radius="5">5 '+c+'</a>, <a href="#" data-radius="10">10 '+c+'</a>, or <a href="#" data-radius="20">20 '+c+'</a> of</div><div class="'+C+'">'+a+"</div>"});v.setMap(m),v.setPosition(i),y.setContent(_[0]),google.maps.event.addListener(v,"click",(function(){n(e),y.open(m,v)})),_.on("click","a",(function(){var n=D(this).data("radius");return n=u(s,n),m.setZoom(h(n)),m.setCenter(i),y.close(),l(e,i,n).done((function(n){t(e),n.length?n.forEach((function(t){r(e,t)})):((o=D("<div>",{html:'<p>There are no households to display in the specified area.</p><p><a href="#">Try again</a></p>'})).on("click","a",(function(){return g.close(),y.open(m,v),!1})),g.setContent(o[0]),g.open(m,v))})).fail((function(){alert("Sorry, there was a problem retrieving the households for the specified bounds. Please try again."),f.startInfoBubble.open()})),!1})),google.maps.event.addListenerOnce(m,"idle",(function(){y.open(m,v)})),m.setCenter(i),e.find(I).val(a)}function o(e){var t=e.data("location"),n=e.data("location-latitude"),i=e.data("location-longitude");a(e,{lat:n,lng:i},t)}function s(e){return D.ajax({data:{key:_,latlng:e.latitude+","+e.longitude},dataType:"json",method:"GET",url:T})}function l(e,t,n){var r=i(e.data("map-distance-unit"),t,n);return D.ajax({dataType:"json",method:"GET",url:"/cf_endpoints/routes.cfm/constituents/household_geolocation.json",data:{bounds:r.getBounds().toUrlValue(),group_ids:e.data("group-ids"),search_by_role:"student"}})}function d(e){var t,n="";return["address_1","address_2","address_3","city","state_short","zip_code","country_short"].forEach((function(i){(t=e[i]).length&&(n.length&&(n+="zip_code"==i?" ":", "),n+=t)})),n}function c(e){return D.ajax({data:{address:e,key:_},dataType:"json",method:"GET",url:T})}function u(e,t){return e?t:t/1.609344}function f(){return D.ajax({dataType:"json",method:"GET",url:"/cf_endpoints/routes.cfm/constituents/current/home_address.json"})}function h(e){return Math.round(14-Math.log(e)/Math.LN2)}function p(e){return M[e.attr("id")]}function g(e){var n=D(e.target).closest(w);navigator.geolocation&&(y(n,!0),navigator.geolocation.getCurrentPosition((function(i){s(i.coords).done((function(r){r.results&&r.results.length&&(t(n),a(D(e.target).closest(w),{lat:i.coords.latitude,lng:i.coords.longitude},r.results[0].formatted_address))})).always((function(){y(n,!1)}))}),(function(e){y(n,!1),alert(e.message)}),{timeout:1e4}))}function m(e){var n=D(e.target).closest(w),i=n.find(I).val();i.length?(y(n,!0),c(i).done((function(e){e.results&&e.results.length&&(t(n),a(n,e.results[0].geometry.location,i))})).always((function(){y(n,!1)}))):alert("Please enter an address first")}function v(t){_=t.data("map-key");var n=t.find(A),i=t.data("map-distance-unit"),r=t.data("map-start-radius"),s=1==t.data("map-start"),l={bubbles:[],errorInfoBubble:new InfoBubble(N),markers:[],startInfoBubble:new InfoBubble(N),startMarker:new google.maps.Marker,map:new google.maps.Map(n[0],{clickableIcons:!1,zoom:10})};M[t.attr("id")]=l,r=u(i,r),l.map.setZoom(h(r)),s?f().done((function(e){var n=d(e);n.length?e.location?a(t,e.location,n):c(n).done((function(e){e.results&&e.results.length&&a(t,e.results[0].geometry.location,e.results[0].formatted_address)})).fail((function(){o(t)})):o(t)})).fail((function(){o(t)})):o(t),navigator.geolocation&&t.find(b).removeClass(S),t.find(x).on("click",m),t.find(b).on("click",g),t.find(I).on("keyup",(function(e){13==e.keyCode&&m(e)})),t.on("click",".fsEmbeddedMapHideAddress",(function(){return e.util.popup("/cf_directory/cp.cfm","updateProfile",620,600),!1}))}function y(e,t){e.find(k).toggleClass(S,!t)}var _,b=".fsEmbeddedMapCurrentLocationButton",E="ConstituentMap",w=".fsConstituentMap",T="https://maps.googleapis.com/maps/api/geocode/json",S=e.getInternalNS("elements.constants.classes").stateHidden,C="fsGoogleMapInfoBubbleAddress",k=".fsLoadingDotsOverlay",I=".fsEmbeddedMapLocationInput",A=".fsEmbeddedGoogleMap",x=".fsEmbeddedMapUpdateButton",D=e.$,R=e.events,M={},N={backgroundClassName:"fsGoogleMapInfoBubble",borderRadius:0,maxHeight:130,maxWidth:250,minHeight:130,minWidth:250};R.onElementAdded(E,v),R.onElementUpdated(E,v),R.onElementDialogShown(E,v),R.onGoogleMapsReady((function(){D(w).each((function(){v(D(this))}))}))}(FS),function(e){"use strict";function t(e){
return r.template('<div class="fsBoardRSSLinks">\t\t\t\t<ul>\t\t\t\t\t<% _.each(boards, function(board) {  %>\t\t\t\t\t\t<li><a href="/fs/post-manager/boards/<%= board.id%>/posts/feed" target="blank"><%= board.name%></a></li>\t\t\t\t\t<% }); %>\t\t\t\t</ul>\t\t\t</div>',{variable:"boards"})(e)}function n(e,n,r,u){var f,h=a.Dialog({dialogClass:r,id:"fsAlertsForEl_"+e+"_"}),p=r==d,g={models:n,preselects:[]};if(p){var m=s.getItem(c+e);g.preselects=m?m.split(",").map(Number):[],f=i(o.getSubscriptionDialogTemplate(g,"board"))}else f=i(t(n));h.setContent(f),h.open(u),h.getContentElement().on("click",".fsDialogCancelButton",(function(){s.removeItem(c+e),h.close()})),p&&(f.find(".fsDialogNextButton").prop("disabled",!g.preselects.length),f.on("click",".fsDialogNextButton",(function(){var e=f.find(l+":checked").map((function(){return i(this).val()})).get();o.showSubscriptionsEmailInfoForm(e,h,"board")})).on("click",l,(function(){var e=0==f.find(l+":checked").length;f.find(".fsDialogNextButton").prop("disabled",e)})))}var i=e.$,r=e._,a=e.getInternalNS("dialogs"),o=e.getInternalNS("elements.subscribe.utils"),s=e.localStorage,l="input[name=fsSelectedMailingList]",d="fsBoardSubscriptions",c="boardAlertSubscriptions_";a.showBoardAlertsDialog=n}(FS,window),function(e){"use strict";function t(e,t,l){var d,c=i.Dialog({dialogClass:"fsListSubscriptions",id:"fsSubscriptionsForEl_"+e+"_"}),u={models:JSON.parse(decodeURI(t)),preselects:[]},f=a.getItem(s+e);u.preselects=f?f.split(",").map(Number):[],d=n(r.getSubscriptionDialogTemplate(u,"list")),c.setContent(d),c.open(l),c.getContentElement().on("click",".fsDialogCancelButton",(function(){a.removeItem(s+e),c.close()})),d.find(".fsDialogNextButton").prop("disabled",!u.preselects.length),d.on("click",".fsDialogNextButton",(function(){var e=d.find(o+":checked").map((function(){return n(this).val()})).get();r.showSubscriptionsEmailInfoForm(e,c,"list")})).on("click",o,(function(){var e=0==d.find(o+":checked").length;d.find(".fsDialogNextButton").prop("disabled",e)}))}var n=e.$,i=e.getInternalNS("dialogs"),r=e.getInternalNS("elements.subscribe.utils"),a=e.localStorage,o="input[name=fsSelectedMailingList]",s="mailingListSubscriptions_";i.showListSubscribeDialog=t}(FS),function(e){"use strict";var t,n=e.$,i=e._,r=e.getInternalNS("elements.utils"),a=e.getInternalNS("elements.subscribe.utils"),o=e.localStorage,s={board:{altType:"alerts",entity:"email alerts",instructions:"Select the board(s) for which you would like to receive an email alert when a new post is added.",localStorageKey:"boardAlertSubscriptions_",subscriptionRequestUrl:"/fs/post-manager/boards/subscribe"},list:{altType:"mailing lists",entity:"messages",instructions:"Select the mailing list(s) for which you would like to receive an email when a new message is added.",localStorageKey:"mailingListSubscriptions_",subscriptionRequestUrl:"/fs/comms-manager/lists/subscribe"}},l="input[name=fsSelectedBoardAlertEmails]";a.getEmailSelectionDialogTemplate=function(e,t,n){return i.template('<div class="fsBoardSubscriptionEmailSelection">\t\t\t\t<h2>Subscriptions</h2>\t\t\t\t<p>\t\t\t\t\tYou are subscribing to <%= modelCount %> <%= modelLabel %>. \t\t\t\t\tWhere would you like to receive these <%= confirmEntity %>?\t\t\t\t</p>\t\t\t\t<ul>\t\t\t\t\t<% _.each(emails, function(email) {  %>\t\t\t\t\t\t<li>\t\t\t\t\t\t\t<input name="fsSelectedBoardAlertEmails" type="checkbox" \t\t\t\t\t\t\t\tid="fsBoardAlertEmailLink_<%= email.person_email_id%>" value="<%= email.person_email_id%>">\t\t\t\t\t\t\t<label for="fsBoardAlertEmailLink_<%= email.person_email_id%>">\t\t\t\t\t\t\t\t<span class="fsBoardAlertEmailType"><%= email.label || "Email" %></span>\t\t\t\t\t\t\t\t<span class="fsBoardAlertEmailAddress"><%= email.email %></span>\t\t\t\t\t\t\t</label>\t\t\t\t\t\t</li>\t\t\t\t\t<% }); %>\t\t\t\t</ul>\t\t\t\t<div class="fsDialogFooterButtons">\t\t\t\t\t<button class="fsDialogCancelButton">Cancel</button>\t\t\t\t\t<button class="fsDialogSubscribeButton" disabled="disabled">Subscribe</button>\t\t\t\t</div>\t\t\t</div>')({confirmEntity:s[n].entity,emails:t,modelCount:e.length,modelLabel:r.pluralize(e.length,"board"==n?n:"mailing list")})},a.getSubscriptionDialogResponseTemplate=function(e){return i.template('<div class="fsBoardSubscriptionLinks">\t\t\t\t<h2>Subscriptions</h2>\t\t\t\t<p>\t\t\t\t\t<%= data.message%>\t\t\t\t</p>\t\t\t\t<ul>\t\t\t\t\t<% _.each(data.subscriptions, function(name) {  %>\t\t\t\t\t\t<li><strong><%= name%></strong></li>\t\t\t\t\t<% }); %>\t\t\t\t</ul>\t\t\t\t<div class="fsDialogFooterButtons">\t\t\t\t\t<button class="fsDialogCancelButton">Close</button>\t\t\t\t</div>\t\t\t</div>',{variable:"data"})(e)},a.getSubscriptionDialogSignupTemplate=function(e,n){t=i.random(1);var a=window.location.pathname+window.location.search,o={captchaModifier:0==t?"":"not",confirmEntity:s[n].entity,modelCount:e.length,modelLabel:r.pluralize(e.length,"board"==n?n:"mailing list"),models:e},l=i.template('<div class="fsBoardSubscriptionSignup">\t\t\t\t\t\t<h2>Subscriptions</h2>\t\t\t\t\t\t<p>You are subscribing to <%= modelCount %> <%= modelLabel %>. Where would you like to receive these <%= confirmEntity %>?</p>\t\t\t\t\t\t<div class="fsFormFieldWrapper">\t\t\t\t\t\t\t<label class="fsFieldLabel" for="fsAlertSignupFirstName">First Name</label>\t\t\t\t\t\t\t<input id="fsAlertSignupFirstName" class="fsStyleDefaultField">\t\t\t\t\t\t</div>\t\t\t\t\t\t<div class="fsFormFieldWrapper">\t\t\t\t\t\t\t<label class="fsFieldLabel" for="fsAlertSignupLastName">Last Name</label>\t\t\t\t\t\t\t<input id="fsAlertSignupLastName" class="fsStyleDefaultField">\t\t\t\t\t\t</div>\t\t\t\t\t\t<div class="fsFormFieldWrapper">\t\t\t\t\t\t\t<label class="fsFieldLabel" for="fsAlertSignupEmail">Email Address</label>\t\t\t\t\t\t\t<input id="fsAlertSignupEmail" class="fsStyleDefaultField">\t\t\t\t\t\t</div>\t\t\t\t\t\t<div class="fsFormFieldWrapper" id="fsAlertCaptchaSection">\t\t\t\t\t\t\t<input type="checkbox" id="fsAlertCaptcha">\t\t\t\t\t\t\t<label class="fsStyleCheckboxLabel" for="fsAlertCaptcha">I am <%= captchaModifier %> a human</label>\t\t\t\t\t\t</div>\t\t\t\t\t\t<div><p><a id="fsLoginRedirect" href="/fs/login?login_destination=<%= login_destination %>">Already have an account?</a></p></div>\t\t\t\t\t\t<div class="fsDialogFooterButtons">\t\t\t\t\t\t\t<button class="fsDialogCancelButton">Close</button>\t\t\t\t\t\t\t<button class="fsDialogAlertSignupButton">Signup</button>\t\t\t\t\t\t</div>\t\t\t\t\t</div>');return"board"==n&&-1===a.indexOf("showBoardAlertsDialog=true")?a+=(window.location.search.length?"&":"?")+"showBoardAlertsDialog=true":"list"==n&&-1===a.indexOf("showListSubscribeDialog=true")&&(a+=(window.location.search.length?"&":"?")+"showListSubscribeDialog=true"),o.login_destination=encodeURIComponent(a),l(o)},a.getSubscriptionDialogTemplate=function(e,t){var r=n.extend(e,{instructions:s[t].instructions});return i.template('<div class="fsBoardSubscriptionLinks">\t\t\t\t\t<h2>Subscriptions</h2>\t\t\t\t\t<p>\t\t\t\t\t\t<%= instructions %> When finished click the "Next" button.\t\t\t\t\t</p>\t\t\t\t\t<ul>\t\t\t\t\t\t<% _.each(models, function(model) {  %>\t\t\t\t\t\t\t<li>\t\t\t\t\t\t\t\t<input name="fsSelectedMailingList" type="checkbox" \t\t\t\t\t\t\t\t\t<%= (preselects.indexOf(model.id) >= 0 ? "checked=checked" : "") %> \t\t\t\t\t\t\t\t\tid="fsBoardSubscriptionLink_<%= model.id%>" value="<%= model.id%>">\t\t\t\t\t\t\t\t<label for="fsBoardSubscriptionLink_<%= model.id%>"><%= model.name%></label>\t\t\t\t\t\t\t</li>\t\t\t\t\t\t<% }); %>\t\t\t\t\t</ul>\t\t\t\t\t<div class="fsDialogFooterButtons">\t\t\t\t\t\t<button class="fsDialogCancelButton">Cancel</button>\t\t\t\t\t\t<button class="fsDialogNextButton" disabled="disabled">Next</button>\t\t\t\t\t</div>\t\t\t\t</div>')(r)},a.subscriptionRequest=function(e,t,i){var r=s[i].subscriptionRequestUrl,o="There was a problem creating subscriptions for these "+s[i].altType+". Please try again.";n.ajax({data:e,dataType:"json",method:"PUT",url:r}).done((function(e){var i=n(a.getSubscriptionDialogResponseTemplate(e));t.setContent(i)})).fail((function(e){e&&e.responseJSON&&e.responseJSON.message?window.alert(e.responseJSON.message):window.alert(o),t.close()}))},a.subscribeToModels=function(e,t,n,i){n.setLoading(),r.getToken().done((function(r){var o={authenticity_token:r,email_ids:t,model_ids:e};a.subscriptionRequest(o,n,i)}))},a.showSubscriptionEmailSelectionForm=function(e,t,i){t.setLoading(),n.ajax({dataType:"json",method:"GET",url:"/fs/sessions/user/emails"}).done((function(r){var o=n(a.getEmailSelectionDialogTemplate(e,r,i));t.setContent(o),o.on("click",".fsDialogSubscribeButton",(function(){var r=o.find(l+":checked").map((function(){return n(this).val()})).get();a.subscribeToModels(e,r,t,i)})).on("click",l,(function(){var e=0==o.find(l+":checked").length;o.find(".fsDialogSubscribeButton").prop("disabled",e)}))})).fail((function(){window.alert("There was a problem fetching your email information. Please try again."),t.close()}))},a.showSubscriptionSignupForm=function(e,i,l){var d=Number(i.getContentElement()[0].id.replace(/[^0-9.-]+/g,"")),c=n(a.getSubscriptionDialogSignupTemplate(e,l));o.setItem(s[l].localStorageKey+d,e),i.setContent(c),c.on("click",".fsDialogAlertSignupButton",(function(){var o,s,d,u=c.find("#fsAlertCaptchaSection"),f=u.find("#fsAlertCaptcha");if(u.find(".fsError").remove(),0==t&&!f.prop("checked")||1==t&&f.prop("checked"))u.append('<div class="fsError" role="alert">Please confirm that you are not a robot.</div>');else{if(o=c.find("#fsAlertSignupEmail"),s=c.find("#fsAlertSignupFirstName"),d=c.find("#fsAlertSignupLastName"),0==s.val().length)return window.alert("Please enter your first name to continue."),void s.val("").focus();if(0==d.val().length)return window.alert("Please enter your last name to continue."),void d.val("").focus();if(0==o.val().length)return window.alert("Please enter your email address to continue."),void o.val("").focus();i.setLoading(),n.when(r.getToken()).then((function(t){var n={authenticity_token:t,email:o.val(),first:s.val(),last:d.val(),model_ids:e};a.subscriptionRequest(n,i,l)}))}}))},a.showSubscriptionsEmailInfoForm=function(e,t,n){r.isLoggedIn()?a.showSubscriptionEmailSelectionForm(e,t,n):a.showSubscriptionSignupForm(e,t,n)}}(FS),function(e){"use strict";function t(e){var t=e.find(r),n={lat:e.data("location-latitude"),lng:e.data("location-longitude")},i=new google.maps.Map(t[0],{center:n,zoom:10});new google.maps.Marker({map:i,position:n})}var n="EmbeddedMap",i=".fsEmbeddedMap",r=".fsEmbeddedGoogleMap",a=e.$,o=e.events;o.onElementAdded(n,t),o.onElementUpdated(n,t),o.onElementDialogShown(n,t),o.onGoogleMapsReady((function(){a(i).each((function(){t(a(this))}))}))}(FS),function(e,t){function n(t){if(t.length){if(window.Juicer)Juicer.initialize();else if(!i){const e=document.createElement("script");i=!0,e.type="text/javascript",e.src="//assets.juicer.io/embed-amd-no-slick.js",e.async=!0,e.onload=e.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(e.onload=e.onreadystatechange=null,Juicer.initialize(),Juicer.Constants.FACEBOOK_APP_ID=0x66ce12943f58e)},document.body.appendChild(e)}t.on("click",".fsSlideshowPlay",(function(){const t=e(this).closest(d);t.removeClass(s),t.addClass(l),t.find(o).slick("slickSetOption","autoplay",!0),t.find(o).slick("slickPlay"),t.find(".fsSlideshowPause").attr("aria-hidden","false").removeClass(r.stateHidden),t.find(".fsSlideshowPlay").attr("aria-hidden","true").addClass(r.stateHidden)})),t.on("click",".fsSlideshowPause",(function(){const t=e(this).closest(d);t.removeClass(l),t.addClass(s),t.find(o).slick("slickSetOption","autoplay",!1),t.find(o).slick("slickPause"),t.find(".fsSlideshowPause").attr("aria-hidden","true").addClass(r.stateHidden),t.find(".fsSlideshowPlay").attr("aria-hidden","false").removeClass(r.stateHidden)}))}}let i=!1,r=FS.getInternalNS("elements.constants.classes"),a="Feeds",o="."+"juicer-feed",s="fsStatePaused",l="fsStatePlaying",d="."+"fsElementSlideshow";t.onElementUpdated(a,n),t.onElementAdded(a,n),t.onElementShown(t.ALL_CONTAINERS_TYPE,n),n(e(".fs"+a))}(FS.$,FS.events),function(e,t){"use strict";function n(e){e.find("iframe").iFrameResize({checkOrigin:!1})}var i="Form";t.onElementAdded(i,n),t.onElementUpdated(i,n),t.onElementUpdated(t.ALL_CONTAINERS_TYPE,n),n(e(".fs"+i))}(FS.$,FS.events),function(e,t){"use strict";function n(e,n,i,o){for(var s,l={},d=0;d<n.length;d++)s=n[d].field_id,l[s]=e.find('[name^="field_'+s+'"]');t.isEmpty(l)||Object.keys(l).forEach((function(t){var s=l[t],d="text"===s[0].type||"email"===s[0].type?c.INPUT:c.CHANGE;s.each((function(e,n){var i=a(n);i.data(c.DEFAULT)&&i.is(":visible")&&(i.prop(c.CHECKED,!0),c.fieldsToTrigger[t]||(c.fieldsToTrigger[t]={element:s,event:d}))})),n.forEach((function(e){("not_all"==e.operator||"not_any"==e.operator)&&s.data(c.DEFAULT)||c.fieldsToTrigger[t]||(c.fieldsToTrigger[t]={element:s,event:d})})),s.on(d,(function(){r(e,n,i,o,l)}))}))}function i(e,t,n){for(var i=[],r=!1,a=0;a<e.length;a++)r=u[e[a].operator](e[a],n[e[a].field_id]),i.push(r);return!!("all_rules"===t&&!i.includes(!1)||"any_rules"===t&&i.includes(!0))}function r(e,t,n,r,o){var d=r.find("input, select, textarea");i(t,n,o)?(d.each((function(e,t){var n=a(t);n.is(":visible")||(l.setDefaultValue(t),n.trigger(c.CHANGE).trigger(c.INPUT))})),r.removeClass(c.HIDDEN_CLASS)):r.hasClass(c.HIDDEN_CLASS)?d.each((function(e,t){var n=a(t);("fee"==n.data("type")&&null===n.data(c.PREVIOUS_VALUE)||void 0===n.data(c.PREVIOUS_VALUE)&&"radio"!==n.attr("type")&&"checkbox"!==n.attr("type"))&&(n.data(c.PREVIOUS_VALUE,n.val()),n.val(""))})):(d.each((function(e,t){var n=a(t);t.type==c.RADIO||t.type==c.CHECKBOX?(n.data(c.PREVIOUSLY_CHECKED,n.prop(c.CHECKED)),n.prop(c.CHECKED,!1)):(n.data(c.PREVIOUS_VALUE,n.val()),n.val("")),n.trigger(c.CHANGE).trigger(c.INPUT)})),r.addClass(c.HIDDEN_CLASS)),l.toggleRequiredHidden(e),s.updatePaymentTotal(e)}const a=e.$,o=e.getInternalNS("forms.currency"),s=e.getInternalNS("forms.payments"),l=e.getInternalNS("forms.utils");let d=e.getInternalNS("forms.conditionals"),c=e.getInternalNS("forms.variables");var u={all:function(e,n){var i=a(n).closest("fieldset, select"),r=a(i).find("input:checked, option:selected").map((function(){return this.value.match(/%22/)?decodeURIComponent(this.value):this.value})).get();return t.isEqual(e.values.sort(),r.sort())},any:function(e,n){var i=a(n).closest("fieldset, select"),r=a(i).find("input:checked, option:selected").map((function(){var e=a(this).attr("data-type")==c.FIELDS_TYPES.rsvp?a(this).attr("data-value"):this.value;return e.match(/%22/)?decodeURIComponent(e):e})).get();return t.intersection(e.values,r).length>0},contains:function(e,t){return t.length>1?t.toArray().some((function(t){return a(t).val().includes(e.values)})):t.val().includes(e.values)},equals:function(e,t){var n=t.val();return t.length>1?t.toArray().some((function(t){return e.values.includes(a(t).val())})):("currency"==t.attr("data-type")&&(n=o.currencyValue(n).toString()),e.values.includes(n))},greater:function(e,t){return o.currencyCompare(e.values[0],t.val(),(function(e,t){return e>t}))},greater_eq:function(e,t){return o.currencyCompare(e.values[0],t.val(),(function(e,t){return e>=t}))},less:function(e,t){return o.currencyCompare(e.values[0],t.val(),(function(e,t){return e<t}))},less_eq:function(e,t){return o.currencyCompare(e.values[0],t.val(),(function(e,t){return e<=t}))},not_all:function(e,t){return!u.all(e,t)},not_any:function(e,t){return!u.any(e,t)},not_contain:function(e,t){return!u.contains(e,t)}};d.attachConditionalListeners=function(e){e.find("[data-conditional-rules]").each((function(){var t=a(this),i=JSON.parse(decodeURIComponent(t.data(c.CONDITIONAL_RULES))),r=t.data("conditional-operator");l.isElementInDateRange(t)&&(i?n(e,i,r,t):t.removeClass(c.HIDDEN_CLASS))}))}}(FS,FS._),function(e){"use strict";let t=e.getInternalNS("forms.currency"),n=e.getInternalNS("forms.variables");t.currencyCompare=function(e,n,i){return null!==n&&(e=t.currencyValue(e),i(n=t.currencyValue(n),e))},t.currencyValue=function(e){return parseFloat(e.replace(/[^0-9.]/g,""))},t.initializeCurrency=function(e){return new Intl.NumberFormat("en-US",{currency:e.data(n.CURRENCY)||n.DEFAULT_CURRENCY,style:"currency"})}}(FS),function(e){"use strict";function t(e){return n.ajax({dataType:"json",url:"/fs/form-manager/payment-types/"+e+"/payment-fields-token"}).done((function(e){o.bsToken=e.token}))}const n=e.$,i=e.getInternalNS("forms.currency"),r=e.getInternalNS("elements.utils");let a=e.getInternalNS("forms.payments"),o=e.getInternalNS("forms.variables"),s=e.getInternalNS("forms.utils"),l=e.getInternalNS("forms.submission");a.hpciChangeStyle=function(e,t,n,i){a.hpciPostMessage("msgCmd=changestyle&elementId="+e+"&propName="+encodeURIComponent(t)+"&propValue="+encodeURIComponent(n),i)},a.hpciMessageHandler=function(e,t){const{$form:n,$iframe:i,$paymentError:s}=o.formElements(t);var d,c,u=e.originalEvent,f="?"+u.data;if(u.origin!=o.HPCI_3DS_FRAME_HOST){if(u.origin==o.HPCI_FRAME_HOST&&u.source==i[0].contentWindow)if(d=a.hpciUrlParam("hpciErrMsg",f),c=a.hpciUrlParam("hpciRespMode",f),"success"==a.hpciUrlParam("hpciStatus",f))switch(c){case"ccprelim":o.ccValid="Y"==a.hpciUrlParam("hpciCCValid",f),n.find(".fsFormPaymentCardTypes > span").removeClass(o.SELECTED_CLASS),o.cardType=a.hpciUrlParam("hpciCCType",f),"unknown"!=o.cardType&&n.find(".fsFormPaymentCardType"+r.capitalize(o.cardType)).addClass(o.SELECTED_CLASS);break;case"cvvprelim":o.cvvValid="Y"==a.hpciUrlParam("hpciCVVValid",f);break;default:if(!n.data(o.SUBMITTED))return;o.submissionData.three_ds_cruise_session_id=a.hpciUrlParam("cruiseSessionId",f),o.submissionData.three_ds_order_id=a.hpciUrlParam("threeDSOrderId",f),o.submissionData.payment_card_type=o.cardType,o.submissionData.payment_cc_bin=a.hpciUrlParam("hpciCCBIN",f),o.submissionData.payment_cc_cvv=a.hpciUrlParam("hpciCVV",f),o.submissionData.payment_cc_num=a.hpciUrlParam("hpciCC",f),l.submitForm(t)}else n.data(o.SUBMITTED)&&s.removeClass(o.HIDDEN_CLASS).text(d)}else"success"==a.hpciUrlParam("hpciStatus",f)&&"reportpinverify"==a.hpciUrlParam("hpci3DSec",f)&&(o.threeDSIframeDialog.close(),l.submitForm(t))},a.hpciUrlParam=function(e,t){var n=new RegExp("[\\?&]"+e+"=([^&#]*)").exec(t);return n&&decodeURIComponent(n[1])||""},a.hpciPostMessage=function(e,t){t[0].contentWindow.postMessage(e,t.attr("src"))},a.setupBlueSnap=function(){function e(t,a){bluesnap.hostedPaymentFieldsCreate({"3DS":a,token:t,onFieldEventHandler:{onBlur:function(){},onError:function(n,r,a){var s=i.find(".fsPaymentError");"14100"!=r?"10"!=r&&s.removeClass(o.HIDDEN_CLASS).text(a):e(t,!1)},onFocus:function(){},onValid:function(e){"ccn"==e?o.bsValidCC=!0:"cvv"==e?o.bsValidCVV=!0:"exp"==e&&(o.bsValidExp=!0)},setupComplete:function(){var e=n("iframe#bluesnap-hosted-iframe-ccn").closest("form");n(o.BLUESNAP_FORM_SELECTOR).not(i).replaceWith(o.BLUESNAP_FORM_ERR_DIV),e.data(o.BLUESNAP_ID)!=i.data(o.BLUESNAP_ID)&&e.replaceWith(o.BLUESNAP_FORM_ERR_DIV),o.bs3DSEnabled=a},threeDsChallengeExecuted:function(){}},style:{input:{color:r.css("color"),"font-size":r.css("fontSize")},".invalid":{color:"red"}}})}var i=n(o.BLUESNAP_FORM_SELECTOR+":last"),r=i.find(".fsFormPaymentBlueSnapContainer");0!=i.length&&t(i.data(o.BLUESNAP_ID)).done((function(t){e(t.token,!0)})).fail((function(){n(o.BLUESNAP_FORM_SELECTOR).replaceWith('<div class="fsError">An error occurred while fetching the BlueSnap Hosted Payment Fields token.</div>')}))},a.submitBlueSnap=function(e){const{$form:t,$loadingDots:n,$paymentError:i}=o.formElements(e);var r;if(o.formStatus[t.prop(o.ID)]==o.READY){if(s.updateFormStatus(t,o.SUBMITTING),n.removeClass(o.HIDDEN_CLASS),o.bs3DSEnabled){r={amount:o.submissionData.payment_total,billingAddress:o.submissionData.payment_address,billingCity:o.submissionData.payment_city,billingCountry:o.submissionData.payment_country,billingFirstName:o.submissionData.payment_first_name,billingLastName:o.submissionData.payment_last_name,billingZip:o.submissionData.payment_zip_code,currency:t.data(o.CURRENCY)};var a=o.submissionData.payment_email||t.find('[name="field_'+t.attr("data-notify-submitter-id")+'"]').val();a&&(r.email=a)}bluesnap.hostedPaymentFieldsSubmitData((function(r){if(n.addClass(o.HIDDEN_CLASS),r.cardData){var a=r.cardData.exp.split("/");o.submissionData.payment_card_type=r.cardData.ccType.toLowerCase(),o.submissionData.payment_cc_bin=r.cardData.ccBin,o.submissionData.payment_cc_num=r.cardData.last4Digits,o.submissionData.payment_cc_token=o.bsToken,o.submissionData.payment_exp_month=a[0],o.submissionData.payment_exp_year=a[1],s.updateFormStatus(t,o.READY),l.submitForm(e)}else s.resetCaptcha(),s.updateFormStatus(t,o.READY),r.error.forEach((function(e){s.showPaymentError(e.errorDescription,i)}))}),r)}},a.updatePaymentTotal=function(e){var t=0,r=e.find('[data-type="currency"]'),a=e.find('[data-type="discount"]'),s=e.find('[data-type="fee"]'),l=e.find('[data-type="quantity"]'),d=e.find(".fsFormPaymentSection"),c=d.find('[name="payment_email"]'),u=d.find(".fsFormPaymentTotal"),f=d.find('[name="payment_type"]'),h=e.find("[data-price]:checked");if(o.currencyFormatter=i.initializeCurrency(e),l.each((function(){var e=n(this).val(),i=n(this).attr("data-price");!isNaN(e)&&!isNaN(i)&&e>0&&(t+=e*i*100)})),r.each((function(){var e=i.currencyValue(n(this).val());isNaN(e)||(t+=100*e)})),s.each((function(){isNaN(i.currencyValue(n(this).val()))||(t+=100*o.prices[this.id])})),a.each((function(){isNaN(i.currencyValue(n(this).val()))||(t-=100*o.prices[this.id])})),h.each((function(e,i){n(i).parents(".fsFormFieldWrapper").hasClass(o.HIDDEN_CLASS)||(t+=100*o.prices[this.id])})),(t/=100)<0&&(t=0),u.text("Total: "+o.currencyFormatter.format(t)),0==t){var p=d.find(o.PAYMENT_AREA_SELECTOR);d.addClass(o.HIDDEN_CLASS),p.addClass(o.HIDDEN_CLASS),p.find(o.INPUT+","+o.SELECT).val("").removeAttr(o.REQUIRED),c.val("").removeAttr(o.REQUIRED),f.removeAttr(o.REQUIRED),f.prop(o.CHECKED,!1)}else{if(d.hasClass(o.HIDDEN_CLASS)){var g=f.first(),m=g.closest(".fsFormPaymentTypes").find("#"+g.data("instructions-id"));g.prop(o.CHECKED,!0),m.removeClass(o.HIDDEN_CLASS),d.removeClass(o.HIDDEN_CLASS)}c.attr(o.REQUIRED,o.REQUIRED),f.attr(o.REQUIRED,o.REQUIRED)}return t},a.updatePaymentArea=function(e,t){var i=e.find(".fsFormPaymentTypes");if(t){var r=e.find(".fsFormPaymentSection"),a=r.find('[name="payment_type"]').first(),s=a.closest(".fsFormPaymentTypes").find("#"+a.data("instructions-id"));e.find('input[data-type="fee"]').each((function(){n(this).closest(".fsFormFieldWrapper").data(o.CONDITIONAL_RULES)||r.removeClass(o.HIDDEN_CLASS)})),i.removeClass(o.HIDDEN_CLASS),s.removeClass(o.HIDDEN_CLASS),a.prop(o.CHECKED,!0)}else i.addClass(o.HIDDEN_CLASS),e.find(".fsFormPaymentCaptchaWarning").removeClass(o.HIDDEN_CLASS)}}(FS),function(e){"use strict";const t=e.$;let n=e.getInternalNS("forms.registration");n.extendRegistrationLock=function(e,n,i){return t.ajax({contentType:"application/json",data:JSON.stringify({authenticity_token:e,field_id:n,submission_uuid:i}),dataType:"json",global:!1,type:"POST",url:"/fs/form-manager/update-lock-expiration"})},n.lockRegistrationCount=function(e,n,i,r,a){return t.ajax({contentType:"application/json",data:JSON.stringify({authenticity_token:e,field_id:n,quantity:i,submission_uuid:r}),dataType:"json",global:!1,type:"POST",url:`/fs/form-manager/${a}-registration-locks`})}}(FS),function(e,t,n){"use strict";function i(e,t,n){var i,r=n.policy_fields,a=g.submissionData[e].find((function(e){return e.name==n.file_name})),o=new FormData;return i=g.filesObjects[e].find((function(t){var i=t.files[0];return t.fileInputClone.prop("name")==e&&i.name==n.file_name})),Object.keys(r).forEach((function(e){o.append(e,r[e])})),o.append("Content-Type",i.files[0].type),o.append("Content-Disposition",'attachment; filename="'+i.files[0].name+'"'),i.fileInputClone.fileupload("option",{formData:o,url:n.policy_url}),i.submit().done((function(){var e=n.policy_fields.key;a.file_path=e,i.file_path=e})).fail((function(e){return 403==e.status?h.fileUploadFailure("Unauthorized request when uploading file",t):400==e.status?h.fileUploadFailure("Bad request when uploading file",t):h.fileUploadFailure("Unknown error when uploading file",t)}))}function r(e){const{$loadingDots:t,$form:n,$requiredLegend:i,$submit:r,$circle:a,$submission:o,$submissionMessage:s}=g.formElements(e);t.addClass(g.HIDDEN_CLASS),n.addClass(g.HIDDEN_CLASS),i.addClass(g.HIDDEN_CLASS),r.prop(g.DISABLED,g.DISABLED),a.removeClass(g.HIDDEN_CLASS),o.removeClass(g.HIDDEN_CLASS),s.removeClass(g.ERROR_CLASS).empty()}function a(e,t){var n=g.HPCI_FRAME_HOST+"/iSynSApp/appUserVerify3DResp!verificationForm.action"+"?sid="+d.hpciUrlParam("sid",e)+"&authTxnId="+t+"&fullParentHost="+d.hpciUrlParam("fullParentHost",e)+"&fullParentQStr="+d.hpciUrlParam("fullParentQStr",e),i=s('<iframe id="fsForm3dsChallengeIFrame" name="fsForm3dsChallengeIFrame" frameborder="0" height="450px" width="100%" src="'+n+'"></iframe>');g.threeDSIframeDialog=l.Dialog({disableCloseOnEscape:!0,id:"fsForm3dsChallengeDialog"}),g.threeDSIframeDialog.setContent(s('<div class="fsForm3dsChallengeDialog"></div>').append(i)),g.threeDSIframeDialog.attachToPage(),s(document.body).find("#fsForm3dsChallengeDialogCloseButton").remove(),g.threeDSIframeDialog.open(s(document.body))}function o(e,t,n){const{$form:i,$submit:r,$loadingDots:a,$circle:o,$requiredLegend:s,$submissionMessage:l}=g.formElements(e);u.enableElementsDisabledByUpload(i),r.prop(g.DISABLED,null),a.addClass(g.HIDDEN_CLASS),o.addClass(g.HIDDEN_CLASS),i.removeClass(g.HIDDEN_CLASS),s.removeClass(g.HIDDEN_CLASS),n&&e.find(".fsFormCaptcha").removeClass("fsHPDirectDatabaseInput"),l.addClass(g.ERROR_CLASS),l.html(t)}const s=e.$,l=e.getInternalNS("dialogs"),d=e.getInternalNS("forms.payments"),c=e.getInternalNS("forms.currency"),u=e.getInternalNS("forms.utils"),f=e.getInternalNS("elements.utils");let h=e.getInternalNS("forms.submission"),p=e.getInternalNS("forms.conditionals"),g=e.getInternalNS("forms.variables");h.addAttendee=function(e,t,n,i,r,a){t.attr("readonly",!0),n.text("Add Attendee"),e.find(".fsFormRegistrationContainer input").addClass(g.HIDDEN_CLASS);for(var o=0;o<i;o++){var l=e.find(".fsFormRegistrationAttendeeHiddenTemplate").clone().html();e.find(".fsFormRegistrationFieldChildren").append('<div class="fsFormRegistrationAttendeeFields">'+l+"</div>");var d=e.find(".fsFormRegistrationFieldChildren .fsFormRegistrationAttendeeFields");d.last().find("input, select").each((function(e,t){s(t).removeAttr(g.DISABLED);var n=s(t).attr("name")+"_"+d.length;s(t).attr("name",n),s(t).attr("id",n),"select-one"==t.type&&u.setDefaultValue(t)}))}h.updateRegistrationCount(t,r+i,e),e.find(".fsFormRegistrationAttendeeFields .fsFormFieldBody").first().children("input, select").focus(),p.attachConditionalListeners(a)},h.deleteOnlinePaymentFields=function(){delete g.submissionData.payment_address,delete g.submissionData.payment_card_type,delete g.submissionData.payment_cc_bin,delete g.submissionData.payment_cc_cvv,delete g.submissionData.payment_cc_num,delete g.submissionData.payment_cc_token,delete g.submissionData.payment_city,delete g.submissionData.payment_country,delete g.submissionData.payment_exp_month,delete g.submissionData.payment_exp_year,delete g.submissionData.payment_first_name,delete g.submissionData.payment_last_name,delete g.submissionData.payment_state,delete g.submissionData.payment_zip_code},h.resetForm=function(){var e=l.Dialog({closeOnClick:!1,dialogClass:"fsResourceDialog",disableCloseOnEscape:!0,id:"fsResource",removeOnClose:!0}),n='<div>\t\t        <h2><b>Reservation Has Expired.</b></h2>\t\t        <p>Reservation has been lost. Reservation will be reset.</p>\t\t        <div class="fsDialogFooterButtons">\t\t          <button class="fsDialogCancelButton">Ok</button>\t\t        </div>\t\t      </div>';e.setContent(n),e.getContentElement().on("click",".fsDialogCancelButton",(function(){e.close(),t.location.reload()})),e.attachToPage(),s("dialog.fsResourceDialog > #fsResourceCloseButton").addClass(g.HIDDEN_CLASS),e.open(s(document.body))},h.fileUploadFailure=function(e,t){const{$loadingDots:n,$form:i,$submit:r,$circle:a,$submission:o,$submissionMessage:s}=g.formElements(t);r.prop(g.DISABLED,null),a.addClass(g.HIDDEN_CLASS),n.addClass(g.HIDDEN_CLASS),o.removeClass(g.HIDDEN_CLASS),s.addClass(g.ERROR_CLASS),s.html(e),u.resetCaptcha(),u.updateFormStatus(i,g.READY),u.enableElementsDisabledByUpload(i)},h.submitForm=function(e){function l(t,n,i){var r=t.responseJSON&&t.responseJSON.message||i,a=t.responseJSON&&t.responseJSON.check_captcha||!1;u.resetCaptcha(),u.updateFormStatus(c,g.READY),o(e,r,a)}const{$loadingDots:d,$form:c,$submit:h,$circle:p,$submission:m,$submissionMessage:v,$iframe:y,$checkmark:_}=g.formElements(e);var b=c.find(".g-recaptcha-element").attr("data-captcha-valid"),E=c.find('[type="file"]').map((function(){return this.name})).get(),w={},T=s.Deferred();g.formStatus[c.prop(g.ID)]==g.READY&&(u.updateFormStatus(c,g.SUBMITTING),E.forEach((function(e){if(g.filesObjects[e]){var t=g.filesObjects[e].filter((function(e){return!e.file_path}));(t=t.map((function(e){var t=e.files[0];return{name:t.name,size:t.size,type:t.type}}))).length&&(w[e]=t)}})),h.prop(g.DISABLED,g.DISABLED),p.addClass(g.HIDDEN_CLASS),m.removeClass(g.HIDDEN_CLASS),n.isEmpty(w)?(r(e),T.resolve()):(d.removeClass(g.HIDDEN_CLASS),u.disableElementsForUpload(c)),u.cleanHiddenFieldsValue(c),u.generatePostObjects(w,e).done((function(t){var a=[];Object.keys(t).forEach((function(r){var o=t[r].map(n.partial(i,r,e));a=a.concat(o)})),s.when.apply(s,a).done((function(){r(e),T.resolve()}))})).fail(l),T.done((function(){f.getToken().done((function(n){g.submissionData.authenticity_token=n,g.submissionData.captcha_valid=b,s.ajax({contentType:"application/json",data:JSON.stringify(g.submissionData),dataType:"json",global:!1,method:"POST",url:"/fs/form-manager/forms/"+e.data("form-id")+"/submissions"}).done((function(e){if(e.three_ds_transaction_id)return g.submissionData.three_ds_action_name="verifyresp",g.submissionData.three_ds_transaction_id=e.three_ds_transaction_id,g.submissionData.three_ds_message_id=e.three_ds_message_id,g.submissionData.three_ds_acs_url=e.three_ds_acs_url,a(y[0].src,e.three_ds_transaction_id),void u.updateFormStatus(c,g.READY);e.message&&(_.show(),p.addClass("fsCircleLoaderComplete"),v.addClass("fsFormSubmissionSuccess"),v.text(e.message),v.attr("tabindex","-1"),v.focus()),e.redirect&&(f.inDraftMode()?(p.addClass(g.HIDDEN_CLASS),m.append('<div class="fsWarning">On the published page, this form would have redirected to <a href="'+e.redirect+'" rel="noopener noreferrer" target="_blank">another page</a>.</div>')):(c[0].reset(),t.location=e.redirect)),u.updateFormStatus(c,g.SUBMITTED),u.clearTimer(c)})).fail(l)})).fail(l)})))},h.updateRegistrationCount=function(e,t,n,i=!1){0==t&&(t=""),n.find(".fsFormRegistrationAttendeeItem > legend").each((function(e){if(s(this).text("Attendee "+e+" Info"),i){s(this).parent().find("input, select").not(".fsFormRegistrationAttendeeHiddenTemplate input, .fsFormRegistrationAttendeeHiddenTemplate select").each((function(t,n){var i=s(n).attr("name"),r=i.substring(0,i.lastIndexOf("_"))+"_"+e;s(n).attr("name",r),s(n).attr("id",r)}))}})),e.val(t).trigger("change")},h.validateFormData=function(t){var i=t.find("input[name], select[name], textarea[name]").not(".fsFormRegistrationAttendeeHiddenTemplate input[name], .fsFormRegistrationAttendeeHiddenTemplate select[name]");return n.every(u.getUniqueFieldNames(i),(function(i){var r,a=t.find('[name="'+i+'"]'),o=a.attr("type"),l=a.attr("maxlength"),d=a.attr("minlength"),f=a.attr("pattern");switch(o||(o=a[0].tagName.toLowerCase()),o){case g.CHECKBOX:if(g.submissionData[i]=a.filter(":checked").map((function(){return s(this).val()})).get(),0==g.submissionData[i].length&&(g.submissionData[i]="",(r=a.closest("fieldset")).attr(g.REQUIRED)))return alert('At least one choice must be checked for "'+r.find("legend").text().split("*required").join("")+'"'),a.focus(),!1;g.submissionData[i]=u.decodeDoubleQuotes(g.submissionData[i]);break;case g.FILE:g.submissionData[i]=n.map(g.filesObjects[i],(function(e){var t=e.files[0];return{file_path:e.file_path,name:t.name,size:t.size,type:t.type}}));var h=a.parent(),p=h.find(".fsFormFileUploadPicker"),m=h.find("label").contents().first().text();if(0==g.submissionData[i].length&&p.data("required"))return alert(m+" field is required."),p.focus(),!1;var v=u.validateFiles(a,g.submissionData[i]);if(v.length){var y=m+" field has the following validation errors:\n"+v.join("\n");return alert(y),p.focus(),!1}0==g.submissionData[i].length&&(g.submissionData[i]="");break;case g.RADIO:var _=a.filter(":checked");if(g.submissionData[i]=u.decodeDoubleQuotes(_.val()||""),
"rsvp"==_.attr("data-type")){var b=s(`label[for=${_.attr("id")}]`).text(),E=_.attr("data-price");if(E&&"0"!==E){var w=b.split(" ");w.pop(),g.submissionData[i+"_choice"]=w.join(" ")}else g.submissionData[i+"_choice"]=b}break;case g.SELECT:g.submissionData[i]=u.decodeDoubleQuotes(a.val());break;default:if("quantity"==a.attr("data-type")&&1==a.data("display-type")){if(a.closest("fieldset").find(".fsFormRegistrationFieldChildren .fsFormRegistrationAttendeeFields").length!=a.val())return a.get(0).setCustomValidity("Please fill out this field and press the 'Add Attendee(s)' button"),a.get(0).reportValidity(),a.focus(),!1}g.submissionData[i]=a.val()}if(a.prop(g.REQUIRED)&&0==g.submissionData[i].length)return alert("Field is required."),a.focus(),!1;if(g.submissionData[i].length>0){if(g.submissionData[i].length>l)return alert("Must be "+l+" characters or less."),a.focus(),!1;if(d>0&&g.submissionData[i].length<d)return alert("Must be at least "+d+" characters."),a.focus(),!1;if(f&&g.submissionData[i].match(new RegExp(f,"g")).join("")!=g.submissionData[i])return alert("Please match the requested format.\n"+a.attr("title")),a.focus(),!1;if(a.data("type")==g.CURRENCY&&(g.submissionData[i]=c.currencyValue(g.submissionData[i])),"fee"==a.data("type")&&(g.submissionData[i]=g.prices[a.prop(g.ID)]),"date"==a.data("type")&&(g.submissionData[i]=e.rome.find(a[0]).getMoment().format("YYYY-MM-DD")),a.data(g.PRICE)||a.data(g.CONTAINS_PRICE)){var T=i+"_price";Array.isArray(g.submissionData[i])?g.submissionData[T]=a.filter(":checked").map((function(){return g.prices[this.id]})).get():a.data(g.CONTAINS_PRICE)?g.submissionData[T]=g.prices[a.find("option:selected").prop(g.ID)]:a.length>1?g.submissionData[T]=g.prices[a.filter(":checked").prop(g.ID)]:g.submissionData[T]=g.prices[a.prop(g.ID)]}}return!0}))}}(FS,window,FS._),function(e,t,n){"use strict";function i(e,t){e.attr("aria-invalid",!0),e.on("blur",(function(){var n=e.val().length>0&&0==e.val().replace(t,"").length;e.attr("aria-invalid",!n)}))}const r=e.$,a=e.getInternalNS("dialogs"),o=e.getInternalNS("elements.utils"),s=e.getInternalNS("forms.submission"),l=e.getInternalNS("forms.registration");let d=e.getInternalNS("forms.utils"),c=e.getInternalNS("forms.variables");d.cleanHiddenFieldsValue=function(e){const t=e[0],n=`.fsFormFieldWrapper.${c.HIDDEN_CLASS} input.fsFormField`;t.querySelectorAll(`${n}[type='text'][data-required='false']`).forEach((e=>{e.value=""})),t.querySelectorAll(`${n}[type='number'][data-type='quantity']`).forEach((e=>{e.value="",c.submissionData[e.name]=""}))},d.clearTimer=function(e){clearTimeout(c.timerDisplayTimeout);var t=e.find(".fsFormTimer"),n=e.find(".fsFormTimer > .fsFormTimeClock");t.addClass(c.HIDDEN_CLASS),n.html("")},d.decodeDoubleQuotes=function(e){return Array.isArray(e)?n.map(e,(function(e){return e.replace(/%22/g,'"')})):e.replace(/%22/g,'"')},d.disableElementsForUpload=function(e){e.find(":input:not(:disabled)").attr(c.DISABLED_BY_UPLOAD,!0).prop(c.DISABLED,!0)},d.displayTimer=function(e,t,n,i){var d=i.find(".fsFormTimer"),u=i.find(".fsFormTimer > .fsFormTimeClock");if(u.text().trim().length>0)return;var f=r('<div role="alert" aria-live="assertive" class="fsRegistrationAlertTimer"></div>'),h=new Date(e),p=new Date(e),g=!1,m=!1,v=a.Dialog({closeOnClick:!1,dialogClass:"fsResourceDialog",disableCloseOnEscape:!0,id:"fsResource",removeOnClose:!1});let y='\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<h2><b>Increase Reservation Timer</b></h2>\n\t\t\t\t\t\t<p>Reservation will expire in 1 minute. Would you like more time?</p>\n\t\t\t\t\t\t<p class="fsDialogTimeClock"></p>\n\t\t\t\t\t\t<div class="fsDialogFooterButtons">\n\t\t\t\t\t\t\t<button class="fsDialogCancelButton">Cancel</button>\n\t\t\t\t\t\t\t<button class="fsDialogExtendButton">Extend Timer</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t';p.setMinutes(p.getMinutes()-1),f.insertAfter(d),function e(){if(h<new Date)return d.addClass(c.HIDDEN_CLASS),u.html(""),void s.resetForm();p<new Date&&!g&&!m&&(g=!0,v.setContent(y),v.attachToPage(),r("dialog.fsResourceDialog > #fsResourceCloseButton").addClass(c.HIDDEN_CLASS),v.open(r(document.body))),c.timerDisplayTimeout=setTimeout((function(){var t=parseInt(Math.abs(h.getTime()-new Date)/6e4%60).toString().padStart(2,"0"),n=parseInt(Math.abs(h.getTime()-new Date)/1e3%60).toString().padStart(2,"0"),i="Reservation expires in 00:"+t+":"+n,r="Reservation expires in "+t+":"+n;d.removeClass(c.HIDDEN_CLASS),u.html("<b>"+r+"</b>"),v.getContentElement().find(".fsDialogTimeClock").html("<b>"+r+"</b>"),0==f.text().trim().length&&f.html(i),(t>=5&&t%5==0&&"00"==n||t>=1&&t<5&&"00"==n||t<1&&n%10==0)&&f.html(i),e()}),1e3)}(),v.getContentElement().on("click",".fsDialogCancelButton",(function(){v.close(),m=!0,g=!1})),v.getContentElement().on("click",".fsDialogExtendButton",(function(){v.close(),o.getToken().done((function(e){r.when(l.extendRegistrationLock(e,t,n)).done((function(e){e.success&&(p=new Date(h.valueOf()),h.setMinutes(h.getMinutes()+2),p.setMinutes(p.getMinutes()+1))})).fail((function(e){m=!0,422==e.status&&alert(e.responseJSON.message)})).always((function(){g=!1}))}))}))},d.enableElementsDisabledByUpload=function(e){e.find("["+c.DISABLED_BY_UPLOAD+'="true"]').prop(c.DISABLED,null).removeAttr(c.DISABLED_BY_UPLOAD)},d.formatFileSize=function(e){return e>=1e6?(e/1e6).toFixed(1)+"MB":(e/1e3).toFixed(0)+"KB"},d.generatePostObjects=function(e,t){var i=r.Deferred();return n.isEmpty(e)?i.resolve(e):(o.getToken().done((function(n){r.ajax({contentType:"application/json",data:JSON.stringify({authenticity_token:n,file_fields:e}),dataType:"json",global:!1,method:"POST",url:"/fs/form-manager/forms/"+t.data("form-id")+"/generate-post-objects"}).done((function(e){i.resolve(e)})).fail((function(e){i.reject(e)}))})).fail((function(e){i.reject(e)})),i.promise())},d.getUniqueFieldNames=function(e){return n.uniq(e.map((function(){return this.name})))},d.isElementInDateRange=function(t){var n=r(t),i=n.attr("data-visible-start"),a=n.attr("data-visible-end");return!i&&!a||(i&&(i=e.moment(i).toISOString()),a&&(a=e.moment(a).toISOString()),c.TODAY_ISO>=i&&c.TODAY_ISO<=a||c.TODAY_ISO>=i&&!a||c.TODAY_ISO<=a&&!i)},d.resetCaptcha=function(){t.grecaptcha.enterprise&&t.grecaptcha.enterprise.reset()},d.setDefaultValue=function(e){var t=r(e);e.type!=c.RADIO&&e.type!=c.CHECKBOX?t.data(c.PREVIOUS_VALUE)?t.val(t.data(c.PREVIOUS_VALUE)):"select-one"==e.type&&t.val(t.find('[data-default="true"]').val()):t.prop(c.CHECKED,t.data(c.PREVIOUSLY_CHECKED)||null==t.data(c.PREVIOUSLY_CHECKED)&&t.data(c.DEFAULT))},d.setupAriaInvalidAttr=function(e){(e.is('input[type="text"]')||e.is("textarea")||e.is('input[type="email"]'))&&(e.attr("aria-invalid",!1),e.attr("pattern")?i(e,new RegExp(e.attr("pattern"),"g")):e.is('input[type="email"]')&&i(e,new RegExp(c.EMAIL_REGEX,"i")))},d.showPaymentError=function(e,t){t.removeClass(c.HIDDEN_CLASS).text(e)},d.toggleDisabledChoicesByLimit=function(e,t){e.filter(":checked").length>=t?e.filter(":not(:checked)").prop(c.DISABLED,!0):e.prop(c.DISABLED,!1)},d.toggleRequiredHidden=function(e){var t=e.find("[data-required=false]:visible"),n=e.find("[data-required=true]:hidden");t.length>0&&t.each((function(e,t){r(t).prop(c.REQUIRED,!0),r(t).attr(c.DATA_REQUIRED,!0)})),n.length>0&&n.each((function(e,t){r(t).removeAttr(c.REQUIRED),r(t).attr(c.DATA_REQUIRED,!1)}))},d.updateFormStatus=function(e,t){c.formStatus[e.prop(c.ID)]=t},d.validateFiles=function(e,t){var n=e.data("file-limit"),i=e.data("file-max-size"),r=e.data("file-type-audio")&&e.data("file-type-document")&&e.data("file-type-image")&&e.data("file-type-video"),a=[],o=[];return t.length>n&&o.push("You may only upload "+n+" files"),r?a=c.EXT_ALL:(e.data("file-type-audio")&&(a=a.concat(c.EXT_AUDIO)),e.data("file-type-document")&&(a=a.concat(c.EXT_DOCUMENT)),e.data("file-type-image")&&(a=a.concat(c.EXT_IMAGE)),e.data("file-type-video")&&(a=a.concat(c.EXT_VIDEO)),e.data("file-type-other")&&(a=a.concat(e.data("file-type-other_extensions").split(",")))),t.forEach((function(e){var t=e.name.split(".").pop().toLowerCase();a.includes(t)||o.push(e.name+" is not an allowed file type for this field"),e.size>i&&o.push(e.name+" is too large. Max size per file is "+i/1e6+"MB")})),o}}(FS,window,FS._),function(e){"use strict";const t=["aac","flac","mp3","wav"],n=["csv","doc","docx","odt","key","pages","pdf","pps","ppt","pptx","rtf","tex","txt","wpd","wps","xlr","xls","xlsx","xml"],i=["bmp","flif","gif","hdp","ico","j2k","jp2","jpc","jpe","jpeg","jpg","jxr","png","svg","tga","tif","tiff","wdp","webp"],r=["3g2","3gp","avi","flv","m4v","mkv","mov","mp4","mpeg","mpg","ogv","webm","wmv"];let a=e.getInternalNS("forms.variables");a.bsValidCC=!1,a.bsValidCVV=!1,a.bsValidExp=!1,a.bs3DSEnabled=!1,a.formStatus={},a.monthDayFormat="md"==e.currentPage.dateFormat,a.prices={},a.cardType="",a.cardTypes=[],a.ccValid=!1,a.cvvValid=!1,a.fieldsToTrigger={},a.filesObjects={},a.submissionData={},a.timerDisplayTimeout={},a.BLUESNAP="bluesnap",a.BLUESNAP_FORM_ERR_DIV='<div class="fsError">Only a single form on a page may use Finalsite Payments powered by BlueSnap!</div>',a.BLUESNAP_FORM_SELECTOR="form[data-bluesnap-id]",a.BLUESNAP_ID="bluesnap-id",a.BORDER_COLOR="border-color",a.BORDER_RADIUS="border-radius",a.BORDER_WIDTH="border-width",a.BOX_SHADOW="box-shadow",a.BOX_SIZING="box-sizing",a.CC_CVV="ccCVV",a.CC_NUM="ccNum",a.CHANGE="change",a.CHECKBOX="checkbox",a.CHECKED="checked",a.CONDITIONAL_RULES="conditional-rules",a.CONTAINS_PRICE="contains-price",a.CURRENCY="currency",a.DATA_CARD_TYPES="data-card-types",a.DATA_REQUIRED="data-required",a.DEFAULT="default",a.DEFAULT_CURRENCY="USD",a.DISABLED="disabled",a.DISABLED_BY_UPLOAD="data-disabled-by-upload",a.ELEMENT_TYPE="Forms",a.EMAIL_REGEX="[\\w'+\\-.]+@[a-z\\d-.]+\\.[a-z]+",a.ERROR_CLASS="fsError",a.EXT_ALL=t.concat(n,i,r),a.EXT_AUDIO=t,a.EXT_DOCUMENT=n,a.EXT_IMAGE=i,a.EXT_VIDEO=r,a.FIELDS_TYPES={rsvp:"rsvp"},a.FILE="file",a.FONT_FAMILY="font-family",a.FONT_SIZE="font-size",a.HIDDEN_CLASS=e.getInternalNS("elements.constants.classes").stateHidden,a.HPCI="hpci",a.HPCI_3DS_FRAME_HOST="https://cc.hostedpci.com",a.HPCI_FRAME_HOST="https://ccframe.hostedpci.com",a.ID="id",a.INPUT="input",a.MARGIN_LEFT="margin-left",a.MAX_WIDTH="max-width",a.ONE_PIXEL="1px",a.PADDING="padding",a.PAYMENT_AREA_SELECTOR=".fsFormPaymentArea",a.PAYMENT_TYPE="payment-type",a.PREVIOUS_VALUE="previous-value",a.PREVIOUSLY_CHECKED="previously-checked",a.PRICE="price",a.RADIO="radio",a.READY="ready",a.REQUIRED="required",a.SELECT="select",a.SELECTED_CLASS="fsStateSelected",a.SUBMITTED="submitted",a.SUBMITTING="submitting",a.TODAY_ISO=e.moment().toISOString(),a.UPDATE_CC="updatecc",a.formElements=function(e){const t=e.find("form"),n=e.find(".fsFormSubmission");return{$checkmark:n.find(".fsCircleLoaderCheckmark"),$circle:n.find(".fsCircleLoader"),$fields:t.find("fieldset, input, select, textarea"),$form:t,$iframe:t.find('iframe[name="ccframe"]'),$loadingDots:t.find(".fsFormSubmitLoadingDots"),$paymentError:t.find(".fsPaymentError"),$paymentField:t.find(".fsFormPaymentCardholder input"),$paymentTypes:t.find('input[name="payment_type"]'),$requiredLegend:e.find(".fsFormsRequiredLegend"),$submission:n,$submissionMessage:n.find(".fsFormSubmissionMessage"),$submit:t.find(".fsFormSubmitButton")}}}(FS),function(e,t,n){"use strict";function i(t){const{$form:i,$fields:g,$iframe:m,$paymentError:v,$paymentField:y,$paymentTypes:_,$submit:b}=o.formElements(t);0!=i.length&&(o.currencyFormatter=d.initializeCurrency(i),i.attr(o.DATA_CARD_TYPES)&&(o.cardTypes=JSON.parse(u.decodeDoubleQuotes(i.attr(o.DATA_CARD_TYPES)))),m.length>0&&(m.on("load",(function(){s.hpciChangeStyle(o.UPDATE_CC,o.FONT_FAMILY,y.css(o.FONT_FAMILY),m),s.hpciChangeStyle(o.UPDATE_CC,o.FONT_SIZE,y.css(o.FONT_SIZE),m),s.hpciChangeStyle(o.CC_NUM,o.BORDER_COLOR,y.css(o.BORDER_COLOR),m),s.hpciChangeStyle(o.CC_CVV,o.BORDER_COLOR,y.css(o.BORDER_COLOR),m),s.hpciChangeStyle(o.CC_NUM,o.BORDER_RADIUS,y.css(o.BORDER_RADIUS),m),s.hpciChangeStyle(o.CC_CVV,o.BORDER_RADIUS,y.css(o.BORDER_RADIUS),m),s.hpciChangeStyle(o.CC_NUM,o.BORDER_WIDTH,y.css(o.BORDER_WIDTH),m),s.hpciChangeStyle(o.CC_CVV,o.BORDER_WIDTH,y.css(o.BORDER_WIDTH),m),s.hpciChangeStyle(o.CC_NUM,o.BOX_SIZING,"border-box",m),s.hpciChangeStyle(o.CC_CVV,o.BOX_SIZING,"border-box",m),s.hpciChangeStyle(o.CC_NUM,o.BOX_SHADOW,y.css(o.BOX_SHADOW),m),s.hpciChangeStyle(o.CC_CVV,o.BOX_SHADOW,y.css(o.BOX_SHADOW),m),s.hpciChangeStyle(o.CC_CVV,o.MARGIN_LEFT,o.ONE_PIXEL,m),s.hpciChangeStyle(o.CC_NUM,o.MARGIN_LEFT,o.ONE_PIXEL,m),s.hpciChangeStyle(o.CC_NUM,o.MAX_WIDTH,"98%",m),s.hpciChangeStyle(o.CC_CVV,o.MAX_WIDTH,"98%",m),s.hpciChangeStyle(o.CC_NUM,o.PADDING,y.css(o.PADDING),m),s.hpciChangeStyle(o.CC_CVV,o.PADDING,y.css(o.PADDING),m),(navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i))&&(s.hpciChangeStyle(o.CC_NUM,"-webkit-appearance","none",m),s.hpciChangeStyle(o.CC_CVV,"-webkit-appearance","none",m))})),e(window).on("message",(function(e){s.hpciMessageHandler(e,t)}))),i.find('[name="submission_uuid"]').val((window.crypto||window.msCrypto).randomUUID()),i.find("option[data-price]").each((function(){o.prices[this.id]=parseFloat(e(this).data(o.PRICE))})),i.find('[name="payment_type"]').on(o.CHANGE,(function(){var t=e(this),n=t.closest(".fsFormPaymentTypes"),i=n.find(o.PAYMENT_AREA_SELECTOR),r=n.find("#"+t.data("instructions-id")),a=t.data(o.PAYMENT_TYPE);i.addClass(o.HIDDEN_CLASS),r.removeClass(o.HIDDEN_CLASS),a==o.BLUESNAP||a==o.HPCI?r.find(o.INPUT+","+o.SELECT).prop(o.REQUIRED,!0):i.find(o.INPUT+","+o.SELECT).val("").removeAttr(o.REQUIRED)})),i.find('[data-type="quantity"]').on(o.CHANGE,(function(){var t=e(this).val(),n=e(this).attr("data-price"),i=e(this).attr("data-currency");if(!isNaN(t)&&!isNaN(n)&&n>0){var r=t*n;e(this).parent().siblings("label.fsQuantityTotalPrice").html(`(${i}${r.toFixed(2)})`)}else e(this).parent().siblings("label.fsQuantityTotalPrice").html("")})),e(".fsFormRegistrationAttendeeHiddenTemplate").find("input, select").each((function(t,n){e(n).attr(o.DISABLED,o.DISABLED)})),g.each((function(){var t=e(this),l=t.closest(".fsFormFieldWrapper"),f=t.is("[data-price]");if(t.attr("placeholder")&&t.attr("placeholder",u.decodeDoubleQuotes(t.attr("placeholder"))),!l.data(o.CONDITIONAL_RULES)&&u.isElementInDateRange(l)&&u.setDefaultValue(this),t.is("[data-required]")&&(t.prop(o.REQUIRED,!0),u.setupAriaInvalidAttr(t)),t.is(".fsFormPaymentTypes")&&t.find(".fsFormPaymentArea").each((function(){var t=e(this).find(".fsFormPaymentCardInstructions");0===t.length?e(this)[0].innerHTML=e(this)[0].innerText:t[0].innerHTML=t[0].innerText})),(f||t.data(o.CONTAINS_PRICE))&&(f&&(o.prices[this.id]=parseFloat(t.data(o.PRICE))),t.on(o.CHANGE,(function(){s.updatePaymentTotal(i)}))),t.is("fieldset[data-choice-limit]")){var h=t.find('input[type="checkbox"]'),p=t.data("choice-limit");h.on(o.CHANGE,(function(){u.toggleDisabledChoicesByLimit(h,p)})),u.toggleDisabledChoicesByLimit(h,p)}if(t.is('[data-type="currency"]')){var g=parseFloat(t.attr("max")),m=parseFloat(t.data("min"));t.on("blur",(function(e){var n=d.currencyValue(e.target.value);if(isNaN(n))return t.val(""),void s.updatePaymentTotal(i);n<m?n=m:g>0&&n>g&&(n=g),t.val(o.currencyFormatter.format(n)).trigger(o.INPUT),s.updatePaymentTotal(i)}))}if(t.is('[data-type="fee"]')&&(o.prices[this.id]=parseFloat(t.val()),u.isElementInDateRange(t.closest(".fsFormFieldWrapper"))||t.val(""),t.on(o.CHANGE,(function(){s.updatePaymentTotal(i)}))),t.is('[type="file"]')){t.fileupload({autoUpload:!1,dataType:"json",dropZone:null,limitConcurrentUploads:3,paramName:"file",type:"POST"});var v=t.parent(),y=v.find(".fsFormFileUploadPickerQty"),_=v.find(".fsFormFileUploadSelectedFiles"),b=t.prop("id"),E=t.prop("name");v.find(".fsFormFileUploadPicker").click((function(e){e.preventDefault(),e.stopPropagation(),v.find("#"+b).click()})),t.on("fileuploadadd",(function(t,i){_.removeClass(o.HIDDEN_CLASS);var r=e('<button class="fsFormFileUploadFileCancelBtn" aria-label="Remove File"></button>');r.click((function(e){if(e.preventDefault(),e.stopPropagation(),o.filesObjects[E]=o.filesObjects[E].filter((function(e){return e.files!==i.files})),i.context.remove(),n.isEmpty(o.filesObjects[E]))y.text("No file chosen"),_.addClass(o.HIDDEN_CLASS);else{var t=o.filesObjects[E].length;y.text(t>0?t+" files selected":"1 file selected")}}));var a=e('<progress class="fsFormFileUploadFileProgressBar" value="50" max="100"></progress>').addClass(o.HIDDEN_CLASS);if(i.context=e('<div class="fsFormFileUploadFileWrapper"></div>').append(e("<div><span>"+i.files[0].name+"</span><span>("+u.formatFileSize(i.files[0].size)+")</span></div>")).append(r).append(a).appendTo(_),o.filesObjects[E]){var s=o.filesObjects[E].filter((function(e){var t=i.originalFiles===e.originalFiles;return t||e.context.remove(),t}));o.filesObjects[E]=s.concat(i)}else o.filesObjects[E]=[i]})),t.on("fileuploadchange",(function(n,i){var r=i.files.length;if(0==r)return o.filesObjects[E]=[],y.text("No file chosen"),_.empty().addClass(o.HIDDEN_CLASS),!1;_.find(".fsFormFileUploadValidationError").remove();var a=u.validateFiles(t,i.files);if(a.length)return _.removeClass(o.HIDDEN_CLASS),a.forEach((function(t){var n=e('<div class="fsFormFileUploadValidationError">'+t+"</div>");_.prepend(n)})),!1;y.text(r>0?r+" files selected":"1 file selected")})),t.on("fileuploadfail",(function(e,t){t.context.find(".fsFormFileUploadFileProgressBar").addClass(o.HIDDEN_CLASS).val(0),t.context.append('<div class="fsFormFileUploadError">Error uploading file. Please try again</div>')})),t.on("fileuploaddone",(function(e,t){t.context.find(".fsFormFileUploadFileCancelBtn").replaceWith('<span class="fsFormFileUploadFileCancelBtn fsFormFileUploadFileCheckIcon"></span>'),t.context.find(".fsFormFileUploadFileProgressBar").remove()})),t.on("fileuploadprogress",(function(e,t){var n=t.loaded/t.total*100;t.context.find(".fsFormFileUploadFileProgressBar").val(n)})),t.on("fileuploadsubmit",(function(e,t){t.context.find(".fsFormFileUploadError").remove(),t.context.find(".fsFormFileUploadFileProgressBar").removeClass(o.HIDDEN_CLASS)}))}if(t.is('[data-type="date"]')){var w=o.monthDayFormat?"M/D/YYYY":"D/M/YYYY",T=t.data("disallowed-days"),S=t.data("end-date"),C={inputFormat:w,time:!1},k=t.data("start-date");k&&(C.min=FS.moment(k).format(w)),S&&(C.max=FS.moment(S).format(w)),T&&(C.dateValidator=function(e){return!n.contains(T,FS.moment(e).day())}),FS.rome(this,C)}if(t.is('[data-type="quantity"]')){var I=1==t.data("display-type"),A=t.closest("fieldset"),x=parseFloat(t.attr("max")),D=t.data("required-field")?1:0,R=t.data("field-id"),M=i.find('[name="submission_uuid"]').val(),N=!1;if(I){t.on("invalid",(function(){t.get(0).setCustomValidity("Please fill out this field and press the 'Add Attendee(s)' button")}));var O=A.find(".fsFormRegistrationAddAttendee"),P="button.fsFormRegistrationSubtractAttendee";A.find("div.fsFormRegistrationFieldChildren").on("click",P,(function(){var n=e(this);if(A.find(".fsFormRegistrationWarning").hasClass(o.HIDDEN_CLASS)||(A.find(".fsFormRegistrationWarning").addClass(o.HIDDEN_CLASS),O.attr(o.DISABLED,!1),N=!1),t.data("capacity-set")){var s=-1;a.getToken().done((function(a){A.find(".fsFormProcessingContainer").removeClass(o.HIDDEN_CLASS),e.when(c.lockRegistrationCount(a,R,s,M,"quantity")).done((function(e){if(e.success){var a=A.find(".fsFormRegistrationFieldChildren .fsFormRegistrationAttendeeFields").length;u.displayTimer(e.lock_expires_at,R,M,i),a==x&&(A.find(".fsFormRegistrationWarning").addClass(o.HIDDEN_CLASS),O.attr(o.DISABLED,!1)),1==a&&(t.attr("readonly",!1),A.find(".fsFormRegistrationContainer input").removeClass(o.HIDDEN_CLASS));var s=n.closest(".fsFormRegistrationAttendeeFields");s.find(o.INPUT).val("").trigger(o.INPUT),s.find(o.SELECT).val("").trigger(o.SELECT),s.remove(),r.updateRegistrationCount(t,a-1,A,!0)}})).fail((function(e){422==e.status&&(t.get(0).setCustomValidity(e.responseJSON.message),t.get(0).reportValidity())})).always((function(){A.find(".fsFormProcessingContainer").addClass(o.HIDDEN_CLASS)}))}))}else{var l=A.find(".fsFormRegistrationFieldChildren .fsFormRegistrationAttendeeFields").length;1==l&&(t.attr("readonly",!1),A.find(".fsFormRegistrationContainer input").removeClass(o.HIDDEN_CLASS));var d=n.closest(".fsFormRegistrationAttendeeFields");d.find(o.INPUT).val("").trigger(o.INPUT),d.find(o.SELECT).val("").trigger(o.SELECT),d.remove(),A.find(".fsFormRegistrationWarning").hasClass(o.HIDDEN_CLASS)||(A.find(".fsFormRegistrationWarning").addClass(o.HIDDEN_CLASS),O.attr(o.DISABLED,!1)),r.updateRegistrationCount(t,l-1,A,!0)}})),O.on("click",(function(){var n,s=A.find(".fsFormRegistrationFieldChildren .fsFormRegistrationAttendeeFields").length,l=parseInt(t.val())||0;if(0==s){if(0==l)return t.get(0).setCustomValidity("Please fill out this field and press the 'Add Attendee(s)' button"),void t.get(0).reportValidity();n=l}else n=1;t.data("capacity-set")&&x>0&&(parseInt(t.val())||0)<=x?a.getToken().done((function(a){A.find(".fsFormProcessingContainer").removeClass(o.HIDDEN_CLASS),O.attr(o.DISABLED,!0),e.when(c.lockRegistrationCount(a,R,n,M,"quantity")).done((function(e){e.success&&(u.displayTimer(e.lock_expires_at,R,M,i),r.addAttendee(A,t,O,n,s,i))})).fail((function(e){422==e.status&&(t.get(0).setCustomValidity(e.responseJSON.message),t.get(0).reportValidity(),e.responseJSON.current_max==s&&(A.find(".fsFormRegistrationWarning").removeClass(o.HIDDEN_CLASS),N=!0))})).always((function(){A.find(".fsFormProcessingContainer").addClass(o.HIDDEN_CLASS),N||O.attr(o.DISABLED,!1),s+n==x&&(A.find(".fsFormRegistrationWarning").removeClass(o.HIDDEN_CLASS),O.attr(o.DISABLED,!0))}))})):s+n>x?(t.get(0).setCustomValidity("Capacity is limited to  "+x+"."),t.get(0).reportValidity()):(r.addAttendee(A,t,O,n,s,i),s+n==x&&(A.find(".fsFormRegistrationWarning").removeClass(o.HIDDEN_CLASS),O.attr(o.DISABLED,!0)))}))}t.on("blur",(function(n){t.get(0).setCustomValidity("");var r=n.target.value;if(isNaN(r)||""==r)t.val("");else if((r<D||x<=0)&&(r=D),x>0&&(parseInt(t.val())||0)>x)t.get(0).setCustomValidity("Capacity is limited to  "+x+"."),t.get(0).reportValidity();else if(t.data("capacity-set")&&!I){var s=parseInt(t.data("previous-value"))||0,l=r-s;a.getToken().done((function(n){A.find(".fsFormProcessingContainer").removeClass(o.HIDDEN_CLASS),e.when(c.lockRegistrationCount(n,R,l,M,"quantity")).done((function(e){e.success&&(t.data("previous-value",s+l),u.displayTimer(e.lock_expires_at,R,M,i),t.val(r).trigger(o.INPUT),i.find('[data-type="quantity"]').trigger(o.CHANGE))})).fail((function(e){422==e.status&&(t.data("capacity-set",e.responseJSON.capacity_set),t.get(0).setCustomValidity(e.responseJSON.message),t.get(0).reportValidity())})).always((function(){A.find(".fsFormProcessingContainer").addClass(o.HIDDEN_CLASS)}))}))}else t.val(r).trigger(o.INPUT),i.find('[data-type="quantity"]').trigger(o.CHANGE)}))}if(t.is('[data-type="rsvp"]')){let n=parseFloat(t.data("capacity")),r=t.data("field-id"),s=i.find('[name="submission_uuid"]').val();n>0&&t.on(o.CHANGE,(function(){let n=t.closest("fieldset"),o=parseInt(n.data("previous-value"))||0,l=(parseInt(t.data("quantity"))||0)-o,d=n.find(".fsFormFieldOption input");a.getToken().done((function(a){e.when(c.lockRegistrationCount(a,r,l,s,"rsvp")).done((function(e){e.success&&(n.data("previous-value",l+o),u.displayTimer(e.lock_expires_at,r,s,i),d.each((function(e){d[e].setCustomValidity("")})),t.get(0).reportValidity())})).fail((function(e){422==e.status&&(d.each((function(e){d[e].setCustomValidity("")})),t.get(0).setCustomValidity(e.responseJSON.message),t.get(0).reportValidity())}))}))}))}if(t.is("textarea")){var L=t.siblings("span.fsFormFieldCharacterCount"),F=t.attr("maxlength");L.length>0&&t.on(o.INPUT,(function(t){L.text(e(t.target).val().length+" / "+F)}))}if(t.is('[data-type="rating"]')){var j=t.find(".fsFormFieldOption"),B=t.find(".fsFormFieldElementRatingButtons");j.on("click",(function(t){var n=e(t.currentTarget),i=n.find('input[type="radio"]');i.prop(o.CHECKED,!0),i.trigger("change"),B.removeClass("fsFormFieldElementRatingsButtonsPristine"),j.removeClass("fsRatingSelected"),n.addClass("fsRatingSelected")}))}})),l.attachConditionalListeners(i),Object.keys(o.fieldsToTrigger).forEach((function(e){var t=o.fieldsToTrigger[e];t.element.trigger(t.event)})),i.find("[data-visible-start], [data-visible-end]").each((function(){var t=e(this);u.isElementInDateRange(t)&&!t[0].dataset.conditionalRules&&t.removeClass(o.HIDDEN_CLASS),u.toggleRequiredHidden(i)})),s.updatePaymentTotal(i),i[0].addEventListener("invalid",(function(){if(e(".fsFixedNav").length){var t=i.find(":invalid").first().parents(".fsFormFieldWrapper").length?i.find(":invalid").first().parents(".fsFormFieldWrapper").first():i.find(":invalid").first(),n=0;e(".fsFixedNav").each((function(){n+=e(this).outerHeight()})),e("html, body").animate({scrollTop:t.offset().top-n},0)}}),!0),i.submit((function(){var n=t.find(".fsFormCaptcha"),a=t.find(".g-recaptcha-response"),l=t.find(".fsHPDirectDatabaseInput").length>0,d=s.updatePaymentTotal(i),c="",f="";if(o.submissionData={},i.data(o.SUBMITTED,!0),v.addClass(o.HIDDEN_CLASS).text(""),!r.validateFormData(i))return!1;if(_.each((function(){var t=e(this);t.is(":checked")&&(c=t.data(o.PAYMENT_TYPE),f=t.data("payment-type-id"))})),d>0?(o.submissionData.payment_total=d,o.submissionData.payment_type_id=f,"offline"==c&&r.deleteOnlinePaymentFields()):(delete o.submissionData.payment_type,r.deleteOnlinePaymentFields()),n.length>0&&a.length>0&&!l&&0==a.val().length)return alert("Please complete the CAPTCHA to continue."),a.focus(),!1;if(c==o.BLUESNAP){if(!o.bsValidCC)return u.showPaymentError("The credit card number is not valid.",v),!1;if(!o.bsValidExp)return u.showPaymentError("The credit card expiration is not valid.",v),!1;if(!o.bsValidCVV)return u.showPaymentError("The CVV number is not valid.",v),!1;s.submitBlueSnap(t)}else if(c==o.HPCI){if(!o.ccValid)return u.showPaymentError("The credit card number is not valid.",v),!1;if(!o.cardTypes.includes(o.cardType))return u.showPaymentError("The credit card type ("+o.cardType+") is not accepted.",v),!1;if(!o.cvvValid)return u.showPaymentError("The CVV number is not valid.",v),!1;s.hpciPostMessage("mapcc-url="+encodeURIComponent(window.location),m)}else r.submitForm(t);return!1})),window.onCaptchaLoadCallback=function(){p||document.querySelectorAll(".g-recaptcha-element").forEach((e=>{var t=window.grecaptcha.enterprise.render(e,{sitekey:e.getAttribute("data-sitekey")});e.setAttribute("data-widget-id",t);const n=e.querySelector(".g-recaptcha-response");n&&(n.setAttribute("aria-hidden",!0),n.setAttribute("aria-label","hidden grecaptcha response"))})),p=!0},window.onCaptchaSubmitCallback=function(t){var n,i;e(".g-recaptcha-element").each((function(){if(window.grecaptcha.enterprise.getResponse(e(this).attr("data-widget-id"))===t)return n=e(this),!1})),i=n.closest(".fs"+o.ELEMENT_TYPE+"Element"),a.getToken().done((function(r){e.ajax({contentType:"application/json",data:JSON.stringify({authenticity_token:r,recaptcha_action:"form_action",recaptcha_token:t,type:"checkbox"}),dataType:"json",global:!1,type:"POST",url:"/fs/form-manager/create-recaptcha-assessment"}).success((function(){n.attr("data-captcha-valid",!0),h||(i.find(".fsFormPaymentTypes").removeClass(o.HIDDEN_CLASS),i.find(".fsFormPaymentCaptchaWarning").addClass(o.HIDDEN_CLASS),s.updatePaymentArea(i,!0),f||(s.setupBlueSnap(),f=!0))})).fail((function(e){e&&e.responseJSON&&e.responseJSON.message?window.alert(e.responseJSON.message):window.alert("There was a problem validating the reCAPTCHA. Please try again."),u.resetCaptcha()}))}))},window.onCaptchaExpiredCallback=function(){e(".g-recaptcha-element").each((function(){window.grecaptcha.enterprise.getResponse(e(this).attr("data-widget-id"))||e(this).attr("data-captcha-valid",!1)}))},window.onbeforeunload=function(){let t=i.find('[name="submission_uuid"]').val();a.getToken().done((function(n){e.ajax({contentType:"application/json",data:JSON.stringify({authenticity_token:n,submission_uuid:t}),dataType:"json",global:!1,type:"POST",url:"/fs/form-manager/release-locks"})}))},u.updateFormStatus(i,o.READY),b.prop(o.DISABLED,null))}let r=FS.getInternalNS("forms.submission"),a=FS.getInternalNS("elements.utils"),o=FS.getInternalNS("forms.variables"),s=FS.getInternalNS("forms.payments"),l=FS.getInternalNS("forms.conditionals"),d=FS.getInternalNS("forms.currency"),c=FS.getInternalNS("forms.registration"),u=FS.getInternalNS("forms.utils");var f=!1,h=!1,p=!1,g=!1;t.onElementAdded(o.ELEMENT_TYPE,i),t.onElementUpdated(o.ELEMENT_TYPE,i),t.onElementUpdated(t.ALL_CONTAINERS_TYPE,i);var m=[];e(".fs"+o.ELEMENT_TYPE+"Element").each((function(){var t=e(this),n=t.find(".fsHPDirectDatabaseInput").length>0,r=t.find(".fsFormCaptcha");i(t),t.find(".fsFormPaymentSection").length&&r.length>0&&!n&&(m.push(t),t.find(".fsFormPaymentTypes").addClass(o.HIDDEN_CLASS))})),window.onCaptchaLoadScoreCallback=function(){document.querySelectorAll(".grecaptcha-badge").forEach((function(e){let t=e.querySelector(".g-recaptcha-response");t&&(t.setAttribute("aria-hidden","true"),t.setAttribute("aria-label","hidden grecaptcha response"))})),m.length>0&&!g&&(window.grecaptcha.enterprise.ready((async()=>{var t=e(".g-recaptcha-score-element").data("sitekey");await window.grecaptcha.enterprise.execute(t,{action:"payment_form_action"}).then((function(t){a.getToken().done((function(n){e.ajax({contentType:"application/json",dataType:"json",global:!1,type:"POST",url:"/fs/form-manager/create-recaptcha-assessment",data:JSON.stringify({authenticity_token:n,recaptcha_action:"payment_form_action",recaptcha_token:t,type:"score"})}).success((function(){s.setupBlueSnap(),m.forEach((function(e){s.updatePaymentArea(e,!0)})),h=!0})).fail((function(){m.forEach((function(e){s.updatePaymentArea(e,!1)})),h=!1})).always((function(){e(".g-recaptcha-element").each((function(){e(this).removeClass(o.HIDDEN_CLASS)}))}))}))}))})),g=!0)},0==m.length&&(e(".g-recaptcha-element").each((function(){e(this).removeClass(o.HIDDEN_CLASS)})),h=!0)}(FS.$,FS.events,FS._),function(e){"use strict";function t(e){var t=r.getElementID(e),s=e.data("trigger-element-ids");e.on("click",".fsLoadMoreButton",(function(){var t=$(this),n=e.find(i.elementContent),o={},s=t.data("start-row");s&&(o.start_row=s),r.loadingOverlay(n),r.loadElementData(e,o).done((function(i){var r=$(i),o=r.find(".fsListItems").children(),s=r.find(".fsLoadMoreButton");n.siblings(".fsLoadingDotsOverlay").remove(),n.find(".fsListItems").append(o),t.replaceWith(s),e.addClass("fsLoadMoreClicked"),a.triggerElementMoreLoaded(e,o)}))})),e.on("click",".fsIssueLink[data-opens-in=element]",(function(){return n({issue_id:$(this).data("issue-id"),preview:$(this).data("preview")},e)})),e.on("change",".fsIssueDropdownSelection",(function(){return n({issue_id:$(this).val(),preview:$(this).data("preview")},e)})),s&&o.onFilter(t,s,(function(a,s){if(a==t)return!1;"keywords"in s&&(e.data("keywords",s.keywords),n(null,e)),r.loadingOverlay(e.find(i.elementContent)),r.fetchElementHTML(t,s).done((function(){o.triggerUpdated(t,null,a)}))}))}function n(e,t){var n={keywords:t.data("keywords")};return e&&($.extend(n,e),r.updateURLParams({virtualParam:"/~issue-id/"+e.issue_id})),o.triggerFilter(r.getElementID(t),n),!1}var i=e.getInternalNS("elements.constants.selectors"),r=e.getInternalNS("elements.utils"),a=e.events,o=e.getInternalNS("elements.linkedEvents"),s="Issue";$(".fs"+s+"Element").each((function(){t($(this))})),a.onElementAdded(s,t),a.onElementUpdated(s,t),a.onElementDialogShown(s,t)}(FS,window),function(e){"use strict";function t(e){i.setupSearch(e)}var n=e.$,i=e.getInternalNS("elements.element_tools.utils"),r=e.getNS("events"),a="IssueTools";r.onElementAdded(a,t),r.onElementUpdated(a,t),n(".fs"+a+"Element").each((function(){t(n(this))}))}(FS),function(e){"use strict";function t(e,t,n){var i=t.data().eventid,a={event_id:i,subtype:"SingleItem"};d.showElementPopupDialog(e,a,u+"Element",t).done((function(){r("#fsStreamIframeID_"+n+"_"+i).iFrameResize({checkOrigin:!1})}))}function n(e){var n=d.getElementID(e),i=e.data("trigger-element-ids");if(e.on("click",".fsLoadMoreButton",(function(){var t=r(this),n=e.find(c),i={},a=t.data("next");a&&(i.next=a),d.loadingOverlay(n),d.loadElementData(e,i).done((function(i){var a=r(i).find(".fsStyleDefaultList").children();n.siblings(".fsLoadingDotsOverlay").remove(),n.find(".fsStyleDefaultList").append(a),t.parent().remove(),e.addClass("fsLoadMoreClicked"),o.triggerElementMoreLoaded(e,a)}))})),e.hasClass("fsSingleItem")){e.find("iframe").iFrameResize({checkOrigin:!1});var a=e.data("trigger-element-ids");a&&s.onFilter(n,a,(function(t,i){return d.loadingOverlay(e.find(c)),d.fetchElementHTML(n,i),!1}))}if(e.hasClass("fsListNav")){var u=!1,f=e.data("linked-element-ids");f&&(u=f.some((function(e){
return d.getElementByID(e).length}))),e.on("click","a.fsStreamEventLink",(function(){if(u){var i={event_id:r(this).data().eventid,ll_event_type:r(this).data().eventtype};s.triggerFilter(n,i)}else t(e,r(this),n);return!1}))}i&&s.onFilter(n,i,(function(t,i){if(t==n)return!1;d.loadingOverlay(e.find(l.elementContent)),d.fetchElementHTML(n,i).done((function(){s.triggerUpdated(n,null,t)}))}))}function i(e){e.find(".fs"+u+"Element").each((function(){n(r(this))}))}var r=e.$,a=e.getInternalNS("elements"),o=e.events,s=a.linkedEvents,l=a.constants.selectors,d=a.utils,c=l.elementContent,u="LocalLive";o.onElementAdded(u,n),o.onElementAdded("sharedcontainer",i),o.onElementUpdated(u,n),o.onElementUpdated("sharedcontainer",i),i(r(document.body))}(FS),function(e){"use strict";function t(e){function t(){var t={};t.sport=o.val(),t.level=i.val(),t.gender=n.val(),r.triggerFilter(a.getElementID(e),t)}var n=e.find("#fsLocalLiveDisplayFiltergender"),i=e.find("#fsLocalLiveDisplayFilterlevel"),o=e.find("#fsLocalLiveDisplayFiltersport");e.on("click",".fsStyleUpdateButton",t)}var n=e.$,i=e.getNS("events"),r=e.getInternalNS("elements.linkedEvents"),a=e.getInternalNS("elements.utils"),o="LocalLiveTools";i.onElementAdded(o,t),i.onElementUpdated(o,t),n(".fs"+o+"Element").each((function(){t(n(this))}))}(FS),function(e,t,n,i,r){"use strict";function a(e){var t=z(e).find(ot),n=t.find(Rt),i=t.find(Me).length>0,r=c(e),a=t.find(K).length>0,o=t.width(),s=o<qe,l=i||r.mediaType==Ue||r.mediaType==$e&&o<ze,d=i&&o<Ge+(a?30:0)||!i&&(r.mediaType==Ue&&o<Ve||r.mediaType==$e&&o<We),u=i&&!a||o<Ye;n.toggleClass(Pe,d).css("left",i&&a?130:""),t.find(mt).toggleClass(Pe,l),t.find(Fe+","+Xe+","+ft).toggleClass(Pe,s),t.find(Bt).toggleClass(Pe,u).css("left",s?40:"")}function o(e){var t=z(e),n=t.find(Q);return h()?W.height():p(t)?j.find(pe).height():Math.round(n.width()*parseFloat(n.data("aspectratio")))}function s(e,i,r,a){var o,s,c,m,v,_,b,C=0,k=z(e),I=[],A=k.find(Q)[0],P=0,B=z(A),U=B.data("autoplay"),H=B.data("loop"),V=B.data("randomstart");B.data("setup-started")||(B.data("setup-started",!0),c=B.data("videoresolution"),m=parseInt(B.data("playercontrols")),_=parseInt(B.data("playlistid")),b=parseInt(B.data("posterscaling")),w(k),isNaN(_)||_<=0?D(B):z.ajax("/cf_endpoints/routes.cfm/media/groups/"+_+"/objects.json",{error:function(e){404==e.status?D(B):t.alert("An error occurred while attempting to retrieve the media data.")},success:function(t){var _,D,G={},W="";for(C=0;C<Zt.length;C++)if("function"==typeof A[Zt[C]]){Jt=Zt[C];break}for(C=0;C<Xt.length;C++)if("function"==typeof document[Xt[C]]){Kt=Xt[C];break}switch(B.find("noscript").remove(),s=z(en.replace("#{timestamp}",(new Date).getTime())),o=s.find(Lt),s.find(tt).toggleClass(Pe,m!=at),s.find(ee).toggleClass(Pe,m!=it),s.find(re).toggleClass(Pe,m==rt),B.append(s),v=s.attr("id"),t.group_type){case Ue:B.addClass("fsMediaPlaylistAudio");break;case He:B.addClass("fsMediaPlaylistImage");break;case $e:B.addClass("fsMediaPlaylistVideo")}if(Vt||(s.find(Ze).attr("aria-label","Play"),s.find(ft).attr("aria-label","Previous"),s.find(Xe).attr("aria-label","Next"),s.find(Bt).attr("aria-label","Mute"),s.find(mt).attr("aria-label","Quality"),s.find(Fe).attr("aria-label","Description"),s.find(Re).attr("aria-label","Enter Fullscreen")),(a||!l()&&p(s))&&s.find(Re).addClass(Te).removeAttr("aria-label"),t.group_type==He){for(C=0;C<t.objects.length;C++)G={description:t.objects[C].object_description,image:t.objects[C].display_path,objectID:t.objects[C].object_id,thumb:t.objects[C].thumbnail_path,title:t.objects[C].object_title},I.push(G);if(V&&I.length&&(P=Math.floor(Math.random()*I.length)),!isNaN(parseInt(i)))for(C=0;C<I.length;C++)if(I[C].objectID==i){P=C;break}if(n.run(o[0],{autoplay:U,dataSource:I,show:P,showCounter:!1,showImagenav:!1,showInfo:!1,thumbnails:!1,transition:"fade",transitionSpeed:600,extend:function(){var e=!1;this.bind("pause",(function(){s.find(K).jPlayer("pause")})),this.bind("play",(function(){s.find(K).jPlayer("play")})),this.bind("image",(function(t){var n=z(t.imageTarget);0==t.index&&e&&!H&&(this.pause(),x(k),s.find(K).jPlayer("pause",0),s.find(Ze).removeClass(Qe),e=!1),t.index==I.length-1&&(e=!0),p(o)||(o.find(Oe+" "+Ne+" img").css("cursor","pointer"),n.click(this.proxy((function(e){e.stopPropagation(),h()||this.openLightbox()})))),n.attr("alt",t.galleriaData.title),O("mediaPlayerImageDisplayed",t.galleriaData.title,n.attr("src"))})),this.bind("loadstart",(function(e){var t=e.galleriaData,n=t.description&&t.description.length>0?t.description:"No description available",i=t.title&&t.title.length>0?t.title:"&nbsp;";s.find(Rt).text(e.index+1+" / "+I.length),s.find(Nt).html(i),s.find(de).html(n),p(s)&&(j.find(be).html(i),j.find(ve).html(n))})),this.bind("lightbox_image",(function(e){var t=z(".galleria-lightbox-title").text(),n=z(e.imageTarget);n.attr("alt",t),m!=rt&&this.pause(),s.find(Ze).removeClass(Qe),Vt||s.find(Ze).attr("aria-label","Play"),O("mediaPlayerLightboxImageDisplayed",t,n.attr("src"))}))}}),o.find(Oe).css("bottom",0).css("left",0).css("right",0).css("top",0),t.song_path){D=t.song_path.split("."),W=D[D.length-1].split("?")[0];var X,Q={loop:!0,preload:m==it?"metadata":"none",solution:"html,flash",supplied:W,swfPath:"/assets/jplayer",volume:1,ready:function(){var e=z(this),n={};"m4a"==W?n.m4a=t.song_path:n.mp3=t.song_path,e.jPlayer("setMedia",n),U&&e.jPlayer("play")}};X=z("<div>",{class:Y}),o.prepend(X),X.jPlayer(Q)}else s.find(Bt).addClass(Pe);U&&(s.find(tt).addClass(Pe),s.find(Ze).addClass(Qe),Vt||s.find(Ze).attr("aria-label","Pause"),m!=rt&&s.find(ne).removeClass(Pe),u(k,!0))}else if(t.group_type==Ue||t.group_type==$e){var J,Z=[],te=U&&t.group_type==$e;if(b==lt&&t.objects.length){var ie=t.objects.length>P?P:0;L(e,t.group_type==Ue?t.objects[ie].thumbnail_path:t.objects[ie].display_path)}else f(e);for(C=0;C<t.objects.length;C++)G={desc:t.objects[C].object_description,displayPath:t.objects[C].display_path,objectID:t.objects[C].object_id,title:t.objects[C].object_title,video1080:"",video360:"",video480:"",video720:""},t.group_type==Ue?("m4a"==(_=(D=t.objects[C].song_path.split("."))[D.length-1].split("?")[0])?(-1==W.indexOf("m4a")&&(W.length&&(W+=","),W+="m4a"),G.m4a=t.objects[C].song_path):(-1==W.indexOf("mp3")&&(W.length&&(W+=","),W+="mp3"),G.mp3=t.objects[C].song_path),b==dt&&(G.poster=t.objects[C].thumbnail_path)):(_=(D=t.objects[C].normal_video_path.split("."))[D.length-1].split("?")[0],b==dt&&(G.poster=t.objects[C].display_path),t.objects[C].mobile_video_path&&t.objects[C].mobile_video_path.length&&(G.video360=t.objects[C].mobile_video_path),t.objects[C].normal_video_path&&t.objects[C].normal_video_path.length&&(G.video480=t.objects[C].normal_video_path),t.objects[C].hd_video_path&&t.objects[C].hd_video_path.length&&(G.video720=t.objects[C].hd_video_path),t.objects[C].fullhd_video_path&&t.objects[C].fullhd_video_path.length&&(G.video1080=t.objects[C].fullhd_video_path),"flv"==_?-1==W.indexOf("flv")&&(W.length&&(W+=","),W+="flv"):-1==W.indexOf("m4v")&&(W.length&&(W+=","),W+="m4v")),Z.push(G);if(V&&Z.length&&(P=Math.floor(Math.random()*Z.length)),!isNaN(parseInt(i)))for(C=0;C<Z.length;C++)if(Z[C].objectID==i){P=C;break}Wt[v]={index:P,mediaType:t.group_type,playing:!1,playlist:Z,quality:c||Qt.getItem(je)||"1080p"},te&&((J=s.find(Bt)).addClass(Ut),Vt||J.attr("aria-label","Unmute")),o.jPlayer({muted:te,preload:m==it?"metadata":"none",solution:"html,flash",supplied:W,swfPath:"/assets/jplayer",volume:1,size:{height:"100%",width:"100%"},ended:function(){y(k),Wt[v].index>0||H?o.jPlayer("play"):(b==lt&&B.find(ct).removeClass(Pe),x(k))},error:function(e){e.jPlayer.error.type==z.jPlayer.error.NO_SOLUTION&&(s.addClass(Pe),B.append('<div class="fsMediaSetupError"><h3>Media Error</h3><p>No solution was found for playing this media. You will need to upgrade your browser to one that is compatible with HTML 5 media and supports H.264 video and MP3 audio or you will need to <a href="https://get.adobe.com/flashplayer/" target="_blank">install the latest version of Adobe Flash player </a>.</p></div>'))},loadedmetadata:function(e){F(k,e)},pause:function(e){var n=e.jPlayer.status;Wt[v].playing=!1,e.jPlayer.status.ended&&Wt[v].index!=Wt[v].playlist.length-1||(s.find(Ze).removeClass(Qe),Vt||s.find(Ze).attr("aria-label","Play"),e.jPlayer.status.ended||O(t.group_type==$e?"mediaPlayerVideoPaused":"mediaPlayerAudioPaused",n.media.title,n.src,{currentTime:n.currentTime}))},play:function(n){var i,r=n.jPlayer.status;Wt[v].playing=!0,s.find(Ze).addClass(Qe),t.group_type==$e?(f(e),i="mediaPlayerVideoPlayed"):i="mediaPlayerAudioPlayed",O(i,r.media.title,r.src,{currentTime:r.currentTime})},progress:function(e){var t,n,i=0;e.jPlayer.html.active?(t=(n=o.find("audio, video")[0].buffered).length>0?n.end(n.length-1):0,i=Math.round(t/e.jPlayer.status.duration*100)):i=Math.round(e.jPlayer.status.seekPercent),s.find(pt).css("width",i+"%")},ready:function(){Wt[v].index=P,g(k),U?(o.jPlayer("play",r),u(k,!0),s.find(tt).addClass(Pe),m!=rt&&s.find(ne).removeClass(Pe)):o.jPlayer("pause",r)},timeupdate:function(e){F(k,e)}})}s.on("click",Ze,(function(e){e.stopPropagation(),N(k)})),s.on("click",tt,(function(){N(k),z(this).addClass(Pe),s.find(ee).removeClass(Pe)})),s.on("click",ne+","+Lt,(function(){m!=rt&&(1==++Gt?$=setTimeout((function(){N(k),Gt=0}),250):(Gt=0,clearTimeout($),s.find(Re).hasClass(Te)||M(k)))})),s.on("click",ft,(function(e){e.stopPropagation(),E(k)})),s.on("click",Xe,(function(e){e.stopPropagation(),y(k)})),s.on("click",yt+" div",(function(e){e.stopPropagation(),S(k,z(this).data("resolution"))})),s.on("click",le+","+Fe,(function(e){e.stopPropagation(),R(k)})),s.on("click",Bt,(function(e){var t=z(this);e.stopPropagation(),t.hasClass(Ut)?(t.removeClass(Ut),Vt||t.attr("aria-label","Mute"),T(k,!1)):(t.addClass(Ut),Vt||t.attr("aria-label","Unmute"),T(k,!0))})),s.on("click mousemove",(function(){clearTimeout(q),x(k),q=setTimeout((function(){u(k)}),3e3)})),s.on("mouseleave",(function(){u(k)})),s.on("click",mt,(function(e){var t=s.find(ne),n=s.find(yt);e.stopPropagation(),t.addClass(Pe),n.removeClass(Pe),n.height(.5625*n.width())})),s.on("click",It,(function(e){var t=z(this),n=(e.pageX-t.offset().left)/t.width()*100;e.stopPropagation(),o.jPlayer("playHead",n)})),s.on("mouseleave",It,(function(){var e=z(this);e.removeAttr("aria-label"),e.find(Et+","+Tt).width(0),s.find(Ct).css("opacity",0)})),s.on("mousemove",It,(function(e){var t,n,i=z(this),r=i.find(Et),a=i.find(Tt),l=i.find(xt),c=o.data("jPlayer").status.duration,u={left:0,opacity:90,width:80},f=e.pageX-i.offset().left;if(f>=l.width()?(r.width(0),a.width(f)):(r.width(f),a.width(0)),c>0){switch(t=s.find(Ct),(n=d(Math.round(c*(f/i.width())))).length){case 4:u.width=50;break;case 5:u.width=60;break;case 7:u.width=70}u.left=f-u.width/2+parseInt(t.css("padding-left")),t.css(u).html(n)}})),s.on("click",Re,(function(e){e.stopPropagation(),z(this).hasClass(Te)||M(k)})),w(k,!0)}}))}function l(){return Jt.length}function d(e){var t,n,i,r="";return t=e>3600?e%3600:0,n=parseInt(e/60)-(t>0?60*t:0),t>0&&(r+=t+":"+(n<10?"0":"")),r+=n+":"+((i=e-(t>0?60*t:0)-60*n)<10?"0":"")+i}function c(e){return Wt[z(e).find(ot).attr("id")]}function u(e,t){var n,i,r=z(e).find(ot),a=!0;a=r.find(Me).length?r.find(Lt).data("galleria")._playing:!!(i=c(e))&&i.playing,(t||a)&&(n=r.find(ne),r.addClass(Ot),"opacity"in document.body.style?n.css("opacity",0):n.addClass(Pe))}function f(e){z(e).find(ct).addClass(Pe)}function h(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement}function p(e){return e.closest(j).length>0}function g(e,t){var n=z(e),i=n.find(Lt),r=n.find(ot),a=n.find(yt),o=n.find(mt),s=r.attr("id"),l=Wt[s].playlist,d=Wt[s].index,c=Wt[s].quality,u=l[d].video360.split("."),f=u[u.length-1].split("?")[0],h="1080p,720p,480p,360p",p=parseInt(c),g=Wt[s].playing,m="";if(a.empty().removeClass("fsMediaResolutionFullHD fsMediaResolutionHD fsMediaResolutionStandard"),l[d].video1080.length?a.addClass("fsMediaResolutionFullHD"):l[d].video720.length?a.addClass("fsMediaResolutionHD"):a.addClass("fsMediaResolutionStandard"),m+=l[d].video1080.length>0?'<div data-resolution="1080p"></div>':"",m+=l[d].video720.length>0?'<div data-resolution="720p"></div>':"",m+='<div data-resolution="480p"></div>',m+='<div data-resolution="360p"></div>',m+='<div class="fsMediaResolutionClose">X</div>',a.append(m),"flv"==f)l[d].flv=l[d].video360;else if("mp4"==f)for(var v=0;v<4;v++){var y=h.split(",")[v],_=parseInt(y);if(l[d]["video"+_]&&_<=p){c=y,l[d].m4v=l[d]["video"+_];break}}o.html(c),i.jPlayer("setMedia",l[d]),i.find("video, object").removeAttr("title"),g?i.jPlayer("play",t):i.jPlayer("pause",t),P(n)}function m(e,n){var i=z(e),r=i.closest(Ce),a=r.children(Se),o=r.attr("id").split("_").pop(),s={element_id:o,media_category_id:"",media_channel_id:"",media_group_id:""},l="",d=z.extend({},s);i.hasClass("fsMediaFolderLink")?(d[i.data("type")]=i.data("id"),qt.updateQueryStringValueAndHistory(d),l=i.attr("href")):i.hasClass("fsMediaBackLink")?(l=i.attr("href"),i.data("id")&&(d[i.data("type")]=i.data("id")),qt.updateQueryStringValueAndHistory(d)):l=n?"?"+z.param(n):t.location.search,Yt.addState(o,z.extend(s,qt.getQueryStringValues(l))),b(a),z.ajax({cache:!1,url:"/fs/elements/"+o+l+(l?"&":"?")+"is_draft="+r.hasClass("fsStateEditable")}).done((function(e){a.html(z(e).find(Se).html());var t=a.find("a.fsMediaBackLink"),n=Yt.getBackLinkState(o);t.attr("href",n?"?"+z.param(n):""),n&&(n.media_channel_id?t.data("type","media_channel_id").data("id",n.media_channel_id):n.media_category_id&&t.data("type","media_category_id").data("id",n.media_category_id)),C(r)})).fail((function(){r.children(".fsLoadingDotsOverlay").remove(),t.alert("There was an error with the element. Please try again.")}))}function v(e,n){var i,r,a,o=505;-1!=navigator.userAgent.indexOf("Chrome")&&-1!=navigator.userAgent.indexOf("Mac OS")&&(o=555),i="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=805,height="+(o+n/1),-1!=e.indexOf("grp=")&&(e=e.replace("grp=","g=")),r="/cf_media/index.cfm?"+e,!(a=t.open(r,"popupmedia",i))||a.closed||void 0===a.closed?t.alert("The media link popup didn't open! Check your popup blocker settings and try again."):a.focus()}function y(e){var t=z(e),n=t.find(ot),i=t.find(Lt);if(n.find(Me).length)i.data("galleria").pause().next(),n.find(Ze).removeClass(Qe);else{var r=n.attr("id"),a=Wt[r].mediaType,o=Wt[r].playing,s=Wt[r].playlist,l=parseInt(t.find(Q).data("posterscaling")),d=Wt[r].index;d<s.length-1?d++:d=0,l!=lt||a!=$e||o||L(e,s[d].displayPath),Wt[r].index=d,g(t)}}function _(e,t,n,i,a,o,l,d,c){var u="";I(),e&&(t==r&&(t=0),n==r&&(n=!1),o==r&&(o=!1),a||(a=""),j.removeClass(),c&&j.addClass(c),j.toggleClass(we,l),l&&(u+='<div id="'+_e+'"></div>'),u+='<div id="'+he+'"><div class="'+ke+'"><div class="'+X+'" data-autoplay="'+n+'" data-aspectratio="0.5625" data-playercontrols="1" data-playlistid="'+e+'" data-posterscaling="1" data-videoresolution="'+a+'"></div></div></div>',j.toggleClass(Ee,d),d&&(u+='<div id="'+me+'"></div>'),B.html(u),H.showModal(),s(B,t,i,o))}function b(e){e.prepend('<div class="fsLoadingDotsOverlay" style="height:'+e.height()+'px"><div class="fsLoadingDots"></div></div>')}function E(e){var t=z(e),n=t.find(ot),i=t.find(Lt);if(n.find(Me).length)i.data("galleria").pause().prev(),n.find(Ze).removeClass(Qe);else{var r=n.attr("id"),a=Wt[r].mediaType,o=Wt[r].playing,s=Wt[r].playlist,l=parseInt(t.find(Q).data("posterscaling")),d=Wt[r].index;d>0?d--:d=s.length-1,l!=lt||a!=$e||o||L(e,s[d].displayPath),Wt[r].index=d,g(t)}}function w(e,t){var n,i=z(e),r=i.find(ot);r.length&&(r.closest(Q).height(o(i)),t&&a(i),(n=i.find(Lt)).find(Me).length&&n.data("galleria").resize())}function T(e,t){var n=z(e).find(Lt);n.jPlayer("mute",t),n.find(K).jPlayer("mute",t)}function S(e,t){var n=z(e),i=n.find(Lt),a=n.find(ot),o=a.find(ne);a.find(yt).addClass(Pe),o.removeClass(Pe),t!=r&&(Wt[a.attr("id")].quality=t,Qt.setItem(je,t),g(n,i.data("jPlayer").status.currentTime))}function C(e){var t,n;e?t=(n=z(e)).find(Be):(t=z(Be),n=z(Ce)),t.each((function(){var e=z(this),t=e.data("mediatype"),n=e.data("playlistid");t!=He&&e.on("click",".fsMediaGalleryObject[data-objectid]",(function(t){var i=z(this),r=e.data("videoresolution"),a=e.data("dialog-show-description"),o=e.data("dialog-show-title");return _(n,i.data("objectid"),!0,0,r,zt,o,a,"fsMediaGalleryDialog"),t.preventDefault(),!1}))})),n.find(".fsMediaFolderLink, .fsMediaBackLink").on("click",(function(e){if(-1==z(this).attr("href").indexOf("history.back"))return m(this),e.preventDefault(),!1}))}function k(){Yt.isStatesEmpty()&&W.on("popstate",(function(e){z(Ce).each((function(){if(e.originalEvent.state){var t=z(this),n=t.attr("id").split("_").pop(),i=e.originalEvent.state[n];Yt.didChangeState(n)&&m(t,i)}else m(this)}))}))}function I(){j||(j=z("<dialog>",{id:ye}),B=z("<div>",{id:ge}),(U=z("<button>",{"aria-label":"close media player",id:fe})).click((function(){B.empty(),H.close()})),V.append(j.append(B).append(U)),H=j[0],e.util.ensureDialog(H))}function A(e){z(Q+":visible",e).each((function(){var e=z(this);e.hasClass(ae)||e.closest(Ie).each((function(){s(this)}))}))}function x(e){var t=z(e).find(ot),n=t.find(ne);t.removeClass(Ot),"opacity"in document.body.style?n.css("opacity",.9):n.removeClass(Pe)}function D(e){z(e).append('<div class="fsAdminWarning">Select a media playlist</div>')}function R(e){var t,n,i=z(e),r=i.find(ne),a=i.find(ue),o=i.find(Lt),s="",l="";a.is(":visible")?(r.removeClass(Pe),a.addClass(Pe)):(r.addClass(Pe),a.removeClass(Pe),t=o.data("galleria"),n=o.data("jPlayer"),t?(l=t.getData().title,s=z(t.getActiveImage()).attr("src")):n&&(l=n.status.media.title,s=n.status.src),O("mediaPlayerDescriptionDisplayed",l,s))}function M(e){var t,n,i,r,a,o=z(e),s=o.find(Lt),d=o.find(ot),c=o.find(Q)[0];h()?document[Kt]():l()?c[Jt]():(s.find(Me).length?(t=s.data("galleria").getIndex(),r=s.data("galleria")._playing,a=s.data("galleria").getData(t).objectID):(t=Wt[d.attr("id")].index,n=Wt[d.attr("id")].quality,i=s.data("jPlayer").status.currentTime,r=Wt[d.attr("id")].playing,a=Wt[d.attr("id")].playlist[t].objectID),_(o.find(Q).data("playlistid"),a,r,i,n,!0))}function N(e){var t=z(e),n=t.find(Lt),i=t.find(Ze);if(i.hasClass(Qe))i.removeClass(Qe),Vt||i.attr("aria-label","Play"),i.closest(ot).find(Me).length?n.data("galleria").pause():n.jPlayer("pause");else{if(t.width()<300&&!p(t)&&!t.find(Me).length){var r=c(t);if(r.mediaType==$e){var a=n.data("jPlayer").status.currentTime,o=r.quality,s=r.playlist[r.index].objectID;return void _(t.find(Q).data("playlistid"),s,!0,a,o,zt)}}i.addClass(Qe),Vt||i.attr("aria-label","Pause"),i.closest(ot).find(Me).length?n.data("galleria").play(5e3):n.jPlayer("play")}}function O(e,t,n,i){var r={event:e,mediaTitle:t,url:n};i&&z.extend(r,i),Ht.push(r)}function P(e){var t=z(e).find(ot),n=t.attr("id"),i=Wt[n].playlist,r=Wt[n].index,a=z.trim(i[r].desc).length?i[r].desc:"No description available";t.find(Nt).text(i[r].title),t.find(de).html(a),t.find("img").attr("alt",a),p(t)&&(j.find(be).text(i[r].title),j.find(ve).html(i[r].desc))}function L(e,t){z(e).find(ct).removeClass(Pe).css("background-image",'url("'+t+'")')}function F(e,t){var n=z(e),i=d(Math.round(t.jPlayer.status.currentTime))+" / "+d(Math.round(t.jPlayer.status.duration));n.find(Rt).html(i),n.find(xt).css("width",Math.round(t.jPlayer.status.currentPercentAbsolute)+"%")}var j,B,U,H,$,q,z=e.$,V=z(document.body),G=z(document),W=z(t),Y="fsMediaBackgroundAudio",K="."+Y,X="fsMediaContainer",Q="."+X,J="fsMediaControl",Z="fsMediaControlsBottom",ee="."+Z,te="fsMediaControlsContainer",ne="."+te,ie="fsMediaControlsTop",re="."+ie,ae="fsMediaCustomPlayer",oe="fsMediaDescription",se="fsMediaDescriptionClose",le="."+se,de="."+oe,ce="fsMediaDescriptionContainer",ue="."+ce,fe="fsMediaPlayerDialogCloseButton",he="fsMediaPlayerDialogContainer",pe="#"+he,ge="fsMediaPlayerDialogContent",me="fsMediaPlayerDialogDescription",ve="#"+me,ye="fsMediaPlayerDialog",_e="fsMediaPlayerDialogTitle",be="#"+_e,Ee="fsMediaPlayerDialogWithDescription",we="fsMediaPlayerDialogWithTitle",Te="fsDisabled",Se="."+"fsElementContent",Ce="."+"fsGallery",ke="fsMedia",Ie="."+ke,Ae="media",xe="fsMediaExitFullscreen",De="fsMediaFullscreen",Re="."+De,Me=".galleria-container",Ne=".galleria-image",Oe=".galleria-stage",Pe="fsStateHidden",Le="fsMediaInfo",Fe="."+Le,je="mediaPlayerQuality",Be="."+"fsMediaGallery",Ue=2,He=1,$e=3,qe=200,ze=260,Ve=315,Ge=290,We=375,Ye=115,Ke="fsMediaNext",Xe="."+Ke,Qe="fsMediaPause",Je="fsMediaPlay",Ze="."+Je,et="fsMediaPlayOverlay",tt="."+et,nt="fsMediaPlayer",it=1,rt=2,at=0,ot="."+nt,st="fsMediaPoster",lt=1,dt=0,ct="."+st,ut="fsMediaPrevious",ft="."+ut,ht="fsMediaProgressBar",pt="."+ht,gt="fsMediaQuality",mt="."+gt,vt="fsMediaQualityMenu",yt="."+vt,_t="fsMediaSeekBar",bt="fsMediaSeekBarBack",Et="."+bt,wt="fsMediaSeekBarForward",Tt="."+wt,St="fsMediaSeekPreview",Ct="."+St,kt="fsMediaStatusBar",It="."+kt,At="fsMediaTimeBar",xt="."+At,Dt="fsMediaTimeLabel",Rt="."+Dt,Mt="fsMediaTitle",Nt="."+Mt,Ot="fsMediaTransparentCursor",Pt="fsMediaView",Lt="."+Pt,Ft="fsMediaViewContainer",jt="fsMediaVolume",Bt="."+jt,Ut="fsMediaVolumeMuted",Ht=t.dataLayer||[],$t=e.events,qt=e.getInternalNS("elements.utils"),zt=qt.inDraftMode(),Vt=!1,Gt=0,Wt={},Yt=new qt.ElementHistory,Kt="",Xt=["exitFullscreen","msExitFullscreen","mozCancelFullScreen","webkitExitFullscreen"],Qt=e.localStorage,Jt="",Zt=["requestFullscreen","msRequestFullscreen","mozRequestFullScreen","webkitRequestFullscreen"],en='<div id="fsMediaPlayer-#{timestamp}" class="'+nt+'"><div class="'+Ft+'"><div class="'+Pt+'">Loading media...</div><div class="fsCroppedImage '+st+'"></div></div><div class="'+ie+" "+te+'"><div class="'+Mt+'">&nbsp;</div></div><div class="'+Z+" "+te+" "+Pe+'"><div class="'+St+'"></div><div class="'+kt+'"><div class="'+_t+'"></div><div class="'+ht+'"></div><div class="'+wt+'"></div><div class="'+At+'"></div><div class="'+bt+'"></div></div><div class="fsMediaControls"><button class="'+Je+" "+J+'"></button><button class="'+ut+" "+J+'"></button><button class="'+Ke+" "+J+'"></button><button class="'+jt+" "+J+'"></button><button class="'+gt+" "+J+'"><span></span></button><button class="'+Le+" "+J+'"></button><button class="'+De+" "+J+'"></button><div class="'+Dt+'"></div></div></div><div class="'+ce+" "+Pe+'"><div class="fsMediaDescriptionTransparentLayer"></div><div class="'+oe+'"></div><div class="'+se+'">X</div></div><div class="'+vt+" "+Pe+'"></div><button class="'+et+'" aria-label="View"></button></div>';W.resize((function(){z(Ie).each((function(){w(this,!0)}))})),G.on("fullscreenchange mozfullscreenchange webkitfullscreenchange MSFullscreenChange",(function(){var e=z(Re),t=z(ot+" "+Oe+" "+Ne+" img"),n=h(),i=(n?"Exit":"Enter")+" Fullscreen",r=n?"default":"pointer";e.toggleClass(xe,n),Vt||e.attr("aria-label",i),t.css("cursor",r)})),G.on("fullscreenerror mozfullscreenerror webkitfullscreenerror MSFullscreenError",(function(e){var t,n,i,r,a,o=z(e.originalEvent.srcElement),s=o.find(Lt),l=0;o.find(Me).length?(t=s.data("galleria").getIndex(),r=s.data("galleria").getData(t).objectID,i=s.data("galleria")._playing,o.find(Ze).removeClass(Qe),s.data("galleria").pause()):(a=o.find(ot).attr("id"),t=Wt[a].index,n=Wt[a].quality,l=s.data("jPlayer").status.currentTime,i=Wt[a].playing,r=Wt[a].playlist[t].objectID,s.jPlayer("pause")),_(o.data("playlistid"),r,i,l,n,!0)})),$t.onElementAdded(Ae,(function(e){var t=e.find(Q);t.length&&!t.hasClass(ae)&&s(e)})),$t.onElementHidden($t.ALL_CONTAINERS_TYPE,(function(e){e.find(Lt).each((function(){var e=z(this).data("galleria");e&&e.destroy()})),e.find(ot).remove(),e.find(Q).data("setup-started",!1)})),$t.onElementMoved(Ae,(function(){W.resize()})),$t.onElementShown($t.ALL_CONTAINERS_TYPE,A),$t.onElementUpdated(Ae,(function(e){var t=e.find(Q),n=e.find(ot);t.length&&!t.hasClass(ae)?(n.off("click mouseleave mousemove"),s(e)):(C(e),1==z(Ce).length&&k())})),V.on("mediaPlayer.loadPlaylist",(function(e,t){var n=z("#"+t.player).closest(".fsElement"),i=n.find(Q),r=n.find(ot);i.data("playlistid",t.playlist),r.off("click mouseleave mousemove"),s(n)})),i.option({resizeDuration:200,wrapAround:!0}),z((function(){try{document.createEvent("TouchEvent"),Vt=!0}catch(e){Vt=!1}V.on("click","a[data-media-playlist-id], a[href*=popMedia\\(]",(function(){var e,t,n=z(this),i=n.data("media-playlist-id"),r=/popMedia\(['"]+((g|cat|chnl)=(\d+))['"]+\)/,a=!!n.data("media-dialog-description"),o=!!n.data("media-dialog-title");if(!i){if("g"!=(t=r.exec(n.prop("href")))[2])return b(e=n.closest("article")),z.ajax("/cf_media/popheight.cfm").done((function(e){v(t[1],e)})).fail((function(){v(t[1],80)})).always((function(){e.children(".fsLoadingDotsOverlay").remove()})),!1;i=t[3]}return _(i,null,!0,0,null,zt,o,a,"fsMediaLinkDialog"),!1})),A(),C(),z(Ce).length&&k()}))}(FS,window,Galleria,lightbox),function(e){"use strict";function t(e){var t=s.getElementID(e),d=s.getQueryStringValues();e.on("click",o.elementContent+">"+o.loadMoreButton,(function(){var t=n(this),r=e.find(o.elementContent),d={},c=t.data("start-row");c&&(d.start_row=c),s.loadingOverlay(r),s.loadElementData(e,d).done((function(s){var d=n(s),c=d.find(l).children(),u=d.find(o.loadMoreButton);r.siblings(o.loadingDotsOverlay).remove(),r.find(l).append(c),t.replaceWith(u),e.addClass(i.loadMoreClicked),t.remove(),a.triggerElementMoreLoaded(e,c)}))})).on("click",".fsAlertsIcon",(function(){var e=n(this);return r.showListSubscribeDialog(t,e.data("lists"),e),!1})),d.showListSubscribeDialog&&r.showListSubscribeDialog(t,e.find(".fsAlertsIcon").data("lists"),e)}var n=e.$,i=e.getInternalNS("elements.constants.classes"),r=e.getInternalNS("dialogs"),a=e.events,o=e.getInternalNS("elements.constants.selectors"),s=e.getInternalNS("elements.utils"),l="ul.fsListLevel1",d="Messages";a.onElementAdded(d,t),a.onElementUpdated(d,t),a.onElementDialogShown(d,t),n(".fs"+d+"Element").each((function(){t(n(this))}))}(FS,window),function(e,t){"use strict";function n(e){var n=d.getElementID(e),a=e.data("trigger-element-ids");e.on("click",".fsAlertsIcon",(function(e){e.preventDefault(),t.open("/cf_directory/cp.cfm?news=0","","width=600,height=700")})).on("click",".fsRSSIcon",(function(e){e.preventDefault(),t.open("/cf_news/rss.cfm","","width=600,height=700")})).on("click",".fsCommentCount",(function(){var e=i(this),t=e.siblings(".fsCommentList");t.toggleClass(f),e.toggleClass(p,t.hasClass(f))})).on("click",".fsLoadMoreButton",(function(){var t=i(this),a=e.find(c),s={},l=t.data("start-row");l&&(s.start_row=l),r.extend(s,m[n].filters),d.loadingOverlay(a),d.loadElementData(e,s).done((function(n){var r=i(n),s=r.find(".fsListItems").children(),l=r.find(".fsLoadMoreButton");a.siblings(".fsLoadingDotsOverlay").remove(),a.find(".fsListItems").append(s),t.replaceWith(l),e.addClass("fsLoadMoreClicked"),o.triggerElementMoreLoaded(e,s)}))})).on("click",".fsPostComment",(function(){var e=i(this),t=e.closest(".fsComments").find(".fsCommentCount"),n=e.siblings(".fsMyComment"),r=e.closest(".fsCommentForm"),a=i.trim(n.val()),o=parseInt(e.closest(".fsComments").data("newsid"));isNaN(o)||o<=0?alert("Sorry, we are unable to determine what news post you are commenting on."):0==a.length?(alert("Please type a comment before submitting!"),n.val(""),n.focus()):(e.prop("disabled",!0),i.ajax({data:{comment:a},dataType:"json",type:"POST",url:"/cf_endpoints/routes.cfm/news/posts/"+o+".json",error:function(t,n,i){alert(i),e.prop("disabled",!1)},success:function(i){if(i.success)if(i.warnings.length>0)r.after('<div class="fsCommentWarning">'+i.warnings+"</div>");else{var o='<div class="fsComment"><div><span class="fsName">';o+=r.find(".fsName").text(),o+="</span></div><div>"+a+"</div></div>",r.after(o)}else alert(i.warnings);var s=r.siblings(".fsComment").length;t.text(s+" Comment"+(1!=s?"s":"")),n.val(""),e.prop("disabled",!1)}}))})),a&&s.onFilter(n,a,(function(t,i){var a=m[n];i.categoryIDs&&(a.filters.category_ids=i.categoryIDs.length?i.categoryIDs:void 0),r.has(i,"keywords")&&(a.filters.keywords=i.keywords.length?i.keywords:void 0),r.has(i,"rangeStart")&&(a.filters.start_date=i.rangeStart?i.rangeStart.format(h):void 0),r.has(i,"rangeEnd")&&(a.filters.end_date=i.rangeEnd?i.rangeEnd.format(h):void 0),d.loadingOverlay(e.find(c)),d.fetchElementHTML(n,a.filters).done((function(){s.triggerUpdated(n,a.filters,t)}))})),i(t).resize()}var i=e.$,r=e._,a=e.getInternalNS("elements.constants.classes"),o=e.events,s=e.getInternalNS("elements.linkedEvents"),l=e.getInternalNS("elements.constants.selectors"),d=e.getInternalNS("elements.utils"),c=l.elementContent,u="News",f=a.stateExpanded,h="YYYY-MM-DD",p=a.stateSelected,g=i(document.body),m={};o.onElementAdded(u,n),o.onElementUpdated(u,n),o.onElementDialogShown(u,n),i(".fs"+u).each((function(){var e=i(this);m[d.getElementID(e)]={filters:{}},n(e)})),g.on("click",'.fsNewsPostLink[href="#"]',(function(e){var t=i(this),n=t.closest("article"),r=d.getElement(t),a=n.data("news-id");return e.preventDefault(),r.data("linked-element-ids")?(d.populateLinkedElements(r,{news_id:a}),d.updateURLParams({virtualParam:n.data("post-lookup")})):d.showElementPopupDialog(r,{news_id:a,page_id:d.getPageID(),show_post:!0},u,t),!1}))}(FS,window),function(e){"use strict";function t(e){e.hasClass("fsCategoryFilter")?n(e):e.hasClass("fsSearch")&&r.setupSearch(e)}function n(e){e.data("linked-element-ids")&&(s.setupSelectAllButtons(e,".fsElementContent"),e.on("click",".fsStyleUpdateButton",(function(){o.triggerFilter(s.getElementID(e),{categoryIDs:e.find("input:checked").map((function(){return this.value})).get()})})))}var i=e.$,r=e.getInternalNS("elements.element_tools.utils"),a=e.getNS("events"),o=e.getInternalNS("elements.linkedEvents"),s=e.getInternalNS("elements.utils"),l="NewsTools";a.onElementAdded(l,t),a.onElementUpdated(l,t),i(".fs"+l).each((function(){t(i(this))}))}(FS),function(e){"use strict";function t(){var e=!!window.location.hash&&window.location.hash.match(/^#fs-panel-([0-9_]+)$/);return!!e&&e[1]}function n(e){var n=e.find("> "+m+" > .fsPanel.fsStateOpen:first"),i=e.parents(".fsSharedContainer"),r=i.length?"_"+u(i):"";if(e.children(m).children(".fsTabsNav").children(S).removeClass(y),n.length)s(C+u(n)+r).addClass(y);else if(e.hasClass(k)&&e.find("ul.fsTabsNav:not(:hidden)").length){var a=t(),o=e.find("> "+m+" > #fsEl_"+a+".fsPanel");if(a&&o.addClass(_).length)s(C+a).addClass(y),l.triggerElementShown(o);else{var d=e.find("> "+m+" > .fsPanel:first");d.addClass(_),s(C+u(d)+r).addClass(y),l.triggerElementShown(d)}}}function i(e){var i,o=s(e),y=o.hasClass(k),E=o.data("one-panel");if(o.on("click","> "+m+" > .fsTabsNav > "+S+" > a",(function(e){e.preventDefault();var t=s(this),i=f(t.parent()),r=c(i),a=o.find(b+":first");o.children(m).children(".fsPanel").removeClass(_),r.addClass(_),n(o),l.triggerElementHidden(a),l.triggerElementShown(r)})).on("click","> "+m+" > .fsPanel > header",(function(){var e=s(this).parent();return E&&(i=o.find(b)).length&&(a(i),u(i)==u(e))||(a(e),n(o)),!1})).on("click","> "+m+" > .fsAddPanel, .fsAddPanelGroupTab:first",(function(){var e=s(this),t=e.parents(T).first(),i=t.hasClass(k),r=u(t),a=t.children(m).children(".fsPanel").last(),o=t.children(m).children(".fsTabsNav").children(S).last(),l=o.clone(),c=e.html();e.prop(g,!0).html(v),h(r,a.length>0?u(a):0,!0).always((function(){e.prop(g,!1).html(c)})).done((function(r){var c=s(r).addClass(_),f=u(c);i?(t.children(m).children(".fsPanel").removeClass(_),c.insertAfter(a)):e.before(c),l.attr("id","fsTab-"+f),l.find("a").attr("href","#fs-panel-"+u(c)).html(c.data("title")),l.insertAfter(o),c.find(m).sortable(d.SORTABLE_CONFIG),p("element:create",f),i&&n(t)}))})),y)n(o),r(o);else{var w=t();if(w){var C=o.find("#fsEl_"+w);C.find(m).is(":hidden")&&C.find("> header").click()}(i=o.find(b)).length&&l.triggerElementShown(i)}d.inComposeMode()&&d.makePanelGroupTabsSortable(o)}function r(e){function t(e){var t=s(e),n="#"+t.attr("aria-controls");i.each((function(){s(this).attr("tabindex","-1"),s(this).attr("aria-selected","false")})),r.each((function(){s(this).find(".fsElementContent").first().removeAttr("tabindex")})),t.removeAttr("tabindex"),t.attr("aria-selected","true"),s(n).find(".fsElementContent").first().attr("tabindex","0")}var n={37:-1,39:1},i=e.find(".fsTabsNav a"),r=e.find(".fsPanel");t(i[0]),i.each((function(e){s(this)[0].index=e,s(this).on("click",(function(){t(s(this))})),s(this).on("keyup",(function(e){if(37==e.keyCode||39==e.keyCode){var t=e.target;i[t.index+n[e.keyCode]]?i[t.index+n[e.keyCode]].focus():37==e.keyCode?i[i.length-1].focus():39==e.keyCode&&i[0].focus()}}))}))}function a(e){e.find("> "+m).slideToggle({always:function(){var e=s(this);e.is(":hidden")&&e.css("display","")}}),e.toggleClass(_),
e.hasClass(_)?e.find(".fsElementContent").first().attr("tabindex",0):e.find(".fsElementContent").first().removeAttr("tabindex"),l["triggerElement"+(e.hasClass(_)?"Shown":"Hidden")](e)}function o(e,t){s("a[href='#fs-panel-"+u(e)+"']").each((function(){var e=s(this);e[0].hasAttribute("aria-expanded")?e.attr("aria-expanded",t):e[0].hasAttribute("aria-selected")&&e.attr("aria-selected",t)})),e.find("> .fsElementContent").attr("aria-hidden",!t)}var s=e.$,l=e.events,d=e.getInternalNS("elements.utils"),c=d.getElementByID,u=d.getElementID,f=d.getTabID,h=d.createElement,p=d.notifyAdminInterface,g="disabled",m=".fsElementContent",v='<div class="fsLoadingDots"></div>',y="fsStateSelected",_="fsStateOpen",b="> "+m+" > .fsPanel."+_,E="panel",w="panelgroup",T=".fsPanelGroup",S="."+"fsTabsNavItem",C="#fsTab-",k="fsTabs";l.onElementAdded(w,i),l.onElementUpdated(w,i),l.onElementUpdated(E,(function(e){0==e.siblings(".fsPanel."+_).length&&(e.addClass(_),l.triggerElementShown(e)),s(C+u(e)).find("a").html(e.data("title"))})),l.onElementMoved(E,(function(e,t){var n=u(e),i=t.length?u(t):0,r=s(C+n);if(!r)return!1;0==i?r.parent().prepend(r):s(C+i).after(r)})),l.onElementDeleted(E,(function(e){s(C+u(e)).remove()})),l.onElementShown(E,(function(e){var t=e.find(T);o(e,!0),t.length&&t.each((function(){n(s(this))}))})),l.onElementHidden(E,(function(e){o(e,!1)})),s(window).resize(e._.debounce((function(){s(T).each((function(){n(s(this))}))}),250)),s(T).each((function(){i(s(this))}))}(FS,window),function(e){"use strict";var t=e.$;t(".fsPersonalReports").on("click","a",(function(){return e.util.popup("/cf_group/report.cfm?reportid="+t(this).data("report-id"),"personalReportsPopup",700,600),!1}))}(FS),function(e){"use strict";function t(){var e=r(_);e.find(o.SORTABLE_SELECTOR).addBack(o.SORTABLE_SELECTOR).sortable(o.SORTABLE_CONFIG),o.makeSubelementsSortable(e,m+".fsStateEditable")}function n(e){var t=e.find(m+'[data-matched="true"]').first();e.find(m).each((function(){var e=r(this);e.toggleClass(y,o.inDraftMode()&&!e.is(t))}))}function i(e){var i=r(e);i.find(".fsAddPanel").click((function(){var e=r(this),t=e.parents(_).first(),a=d(t),s=t.children(f).children(m).last(),l=e.html();e.prop(u,!0).html(h),c(a,s.length>0?d(s):0,!0).always((function(){e.prop(u,!1).html(l)})).done((function(t){var a=r(t).addClass(p);e.before(a),n(i),a.find(f).sortable(o.SORTABLE_CONFIG),o.notifyAdminInterface("element:create",d(a))}))})),n(i),t()}var r=e.$,a=e.events,o=e.getInternalNS("elements.utils"),s=e.getInternalNS("elements.constants.classes"),l=e.getInternalNS("elements.constants.selectors"),d=o.getElementID,c=o.createElement,u="disabled",f=l.elementContent,h='<div class="fsLoadingDots"></div>',p=s.stateOpen,g="PersonalizationPanel",m=".fsPersonalizationPanelElement",v="Personalization",y="fsPersonalizationHiddenPanel",_=".fsPersonalizationElement.fsStateEditable";a.onElementAdded(v,i),a.onElementUpdated(v,i),a.onElementUpdated(g,(function(e){n(e.parents(_)),t()})),a.onElementMoved(g,(function(e){n(e.parents(_))})),r(_).each((function(){i(r(this))}))}(FS,window),function(e){"use strict";function t(e){return{draft_page:g.inDraftMode(),element_id:g.getElementID(e),page_id:e.closest("body").data("pageid")}}function n(e,n,i){var a=e.closest(_).prev("article").data("post-id"),o=s("<div/>",{class:d.loadingDots});e.append(o),s.get("/fs/post-manager/posts/"+a+"/comments",s.extend(t(n),{comments_date:i,is_popup:!!e.closest("dialog").length})).done((function(t){r(t,e)})).fail((function(){window.alert("There was an error retrieving the comments. Please try again.")})).always((function(){o.remove()}))}function i(e,t){var n,i="";return null!==e.author_cf_id&&e.author_avatar_hash&&(i=m({avatar_hash:e.author_avatar_hash,cf_id:e.author_cf_id})),n=s(v({author:e.author,avatar:i,body:e.formatted_body,datetime:e.created_at,formattedDate:e.formatted_date,formattedTime:e.formatted_time})),t&&n.addClass("fsNewComment"),n}function r(e,t){var n=s();if(!t.find(".fsCommentForm").length){var r=s('<div class="fsCommentForm" />');if(!g.inDraftMode()){var a=s('<textarea class="fsMyComment fsStyleDefaultTextarea" placeholder="Comment..."></textarea>\t\t\t\t\t<button class="fsPostComment fsStyleUpdateButton">Comment</button>'),o=g.getElement(t).attr("id").split("_").splice(1).join("_");s(S).length?r.append(a):t.closest(_).prev("article").data("authenticated-comments")||(r.append('<label for="fsPostElementMyCommentNameField'+o+'" class="fsFieldLabel fsMyCommentFieldName">Name</label>\t\t\t\t\t\t<input id="fsPostElementMyCommentNameField'+o+'" class="fsMyCommentName fsStyleDefaultField">\t\t\t\t\t\t<label for="fsPostElementMyCommentEmailField'+o+'" class="fsFieldLabel fsMyCommentFieldEmail">Email</label>\t\t\t\t\t\t<input id="fsPostElementMyCommentEmailField'+o+'" class="fsMyCommentEmail fsStyleDefaultField">'),r.append(a))}t.prepend(r)}l.each(e,(function(e){n=n.add(i(e,!1))})),t.append(n),t.next(p.loadMoreButton).remove(),10==e.length&&t.after(y({commentsDate:e[e.length-1].created_at}))}function a(r){var a=g.getElementID(r),o=g.getQueryStringValues(),m=r.data("trigger-element-ids");r.find("article").each((function(e,t){var n,i,r=s(t),a=[];r.find(".fsTitle .fsPostLink").length>0?i=r.find(".fsTitle .fsPostLink"):r.find(".fsReadMoreLink.fsPostLink").length>0&&(i=r.find(".fsReadMoreLink.fsPostLink")),n=i?r.find(".fsPostLink").not(i):r.find(".fsPostLink"),i&&a.push(i.attr("href")),n.each((function(e,t){var n=s(t).attr("href");-1==a.indexOf(n)?a.push(n):s(t).attr("tabindex","-1")}))})),r.on("click",p.elementContent+">"+p.loadMoreButton,(function(){var t=s(this),n=r.find(p.elementContent),i=l.clone(h[g.getElementID(r)]),a=t.data("start-row");a&&(i.start_row=a),r.data("selected-board")&&(i.board=r.data("selected-board")),g.loadingOverlay(n),g.loadElementData(r,i).done((function(i){var a=s(i),o=a.find(".fsListItems").children(),l=a.find(".fsLoadMoreButton");n.siblings(p.loadingDotsOverlay).remove(),n.find(".fsListItems").append(o),t.replaceWith(l),r.addClass(d.loadMoreClicked),t.remove(),e.util.updateDynamicImages(o),u.triggerElementMoreLoaded(r,o)}))})).on("click",".fsCommentCount",(function(){var e=s(this),t=e.next(".fsCommentList");t.toggleClass(E),t.next(p.loadMoreButton).toggleClass(d.stateHidden),e.toggleClass(T,t.hasClass(E)),t.hasClass(E)&&!t.find("div.fsComment").length&&n(t,r)})).on("click",".fsPostComment",(function(){var e=s(this),n=e.closest(_).prev("article"),a=e.parent(),o=a.find(".fsMyComment"),l=e.add(o),d=a.find(".fsMyCommentName").val(),c=a.find(".fsMyCommentEmail").val(),u=o.val();n.data("authenticated-comments")||s(S).length||d.length&&c.length?u?(l.attr("disabled","disabled"),s.when(g.getToken()).then((function(a){s.post("/fs/post-manager/posts/"+n.data("post-id")+"/comments.json",s.extend(t(r),{authenticity_token:a,author_email:c,author_name:d,body:u,is_popup:!!e.closest("dialog").length})).done((function(t){var n=e.closest(".fsCommentForm");t.pending_approval?n.next(".fsCommentPendingApproval").length||n.after(s("<p>",{class:"fsCommentPendingApproval fsNotification",text:"Your comment is pending approval."})):n.after(i(t,!0)),o.val("")})).fail((function(e){var t="",n=e.responseJSON;n&&(n.message&&(t=". "+n.message),n.length&&(t=": "+n.join(". "))),window.alert("There was a problem posting your comment"+t+". Please try again.")})).always((function(){l.removeAttr("disabled")}))}))):window.alert("Comment text is required."):window.alert("Name and Email are required.")})).on("click",_+" "+p.loadMoreButton,(function(){n(s(this).prev(".fsCommentList"),r,s(this).data("comments-date"))})).on("submit",".fsCommentLoginForm",(function(){var e=s(this);return e.find('input[name="login_destination"]').length||(e.append(s("<input>",{name:"login_destination",type:"hidden",value:window.location.pathname})),e.append(s("<input>",{name:"failure_redirect_to_login",type:"hidden",value:!0}))),g.loginFormSubmitHandler.bind(this)()})).on("click",".fsPostLink[data-slug][data-opens-in=element]",(function(){var e=s(this),t=e.closest("article").data("post-id");return g.populateLinkedElements(r,{element_id:g.getElementID(r),page_id:g.getPageID(),post_id:t}),g.updateURLParams({virtualParam:"/~board/"+e.data("slug")}),!1})).on("click",".fsRSSIcon",(function(){var e=s(this);return c.showBoardAlertsDialog(a,e.data("boards"),"fsRSSFeed",e),!1})).on("click",".fsAlertsIcon",(function(){var e=s(this);return c.showBoardAlertsDialog(a,e.data("boards"),C,e),!1})).on("click",".fsPostLink[data-opens-in=popup]",(function(){var e=s(this),t=e.closest("article").data("post-id");return g.showElementPopupDialog(g.getElement(e),{is_popup:!0,post_id:t,show_post:!0},b+"Element",e),!1})),m&&f.onFilter(a,m,(function(e,t){var n=r.data("board-id");h[a]=l.defaults({board_id:n,current_post_id:r.find("article").first().data("post-id"),end_date:t.rangeEnd?t.rangeEnd.format(w):null,issue_id:t.issue_id,keywords:t.keywords,post_category_id:t.post_category_id,preview:t.preview,start_date:t.rangeStart?t.rangeStart.format(w):null,tag_id:t.tag_id},h[a]),h[a]=l.omit(h[a],(function(e){return!e})),g.loadingOverlay(r.find(p.elementContent)),g.fetchElementHTML(a,l.extend({navigate:t.navigate},h[a])).done((function(){f.triggerUpdated(a,null,e)})).fail((function(n){t.navigate&&404==n.status&&(r.find(".fsLoadingDotsOverlay").remove(),f.triggerUpdated(a,{navigationFailed:t.navigate},e))}))})),o.showBoardAlertsDialog&&c.showBoardAlertsDialog(a,r.find(".fsAlertsIcon").data("boards"),C,r),g.adjustMediaAspectRatio(r),g.inDraftMode()&&s(".fsAlertsIcon").addClass("fsStateDisabled").prop("disabled",!0).attr("aria-label","This feature is not accessible in the admin view. To subscribe, please use the published view.")}function o(e){var t=g.getElementID(e);h[t]={},e.data("category-id")>0&&(h[t].post_category_id=e.data("category-id")),e.data("tag-ids")>0&&(h[t].tag_id=e.data("tag-ids")),e.data("issue-id")>0&&(h[t].issue_id=e.data("issue-id"))}var s=e.$,l=e._,d=e.getInternalNS("elements.constants.classes"),c=e.getInternalNS("dialogs"),u=e.events,f=e.getInternalNS("elements.linkedEvents"),h={},p=e.getInternalNS("elements.constants.selectors"),g=e.getInternalNS("elements.utils"),m=l.template('<img class="fsAvatar" src="/cf_social/serveAvatar.cfm?id=<%= cf_id%>&auth_code=<%= avatar_hash%>">'),v=l.template('<div class="fsCommentContainer fsStyleAutoclear">\t\t\t\t<div class="fsCommentDetails">\t\t\t\t\t<%= avatar%>\t\t\t\t\t<span class="fsName"><%= author%></span>\t\t\t\t\t<span class="fsSeparator">-</span>\t\t\t\t\t<span class="fsDateTime">\t\t\t\t\t\t<time class="fsDate" datetime="<%= datetime %>"><%= formattedDate%></time>\t\t\t\t\t\t<time class="fsTime" datetime="<%= datetime %>"><%= formattedTime%></time>\t\t\t\t\t</span>\t\t\t\t</div>\t\t\t\t<div class="fsComment"><%= body%></div>\t\t\t</div>'),y=l.template('<button class="fsLoadMoreButton" data-comments-date="<%= commentsDate%>">Load More</button>'),_=".fsComments",b="Post",E=d.stateExpanded,w="YYYY-MM-DD",T=d.stateSelected,S="#fsAccountBar",C="fsBoardSubscriptions";u.onElementAdded(b,a),u.onElementUpdated(b,a),u.onElementDialogShown(b,a),u.onElementUpdated(b,(function(e){g.populateLinkedElements(e,{element_id:g.getElementID(e),page_id:g.getPageID(),post_id:e.find(p.elementContent+" > article").data("post-id")})})),s(".fs"+b+"Element").each((function(){var e=s(this);a(e),o(e)}))}(FS,window),function(e){"use strict";function t(e){e.hasClass("fsCategoryFilter")||e.hasClass("fsTagFilter")?n(e):e.hasClass("fsSearch")?s.setupSearch(e):e.hasClass("fsNavigation")&&i(e)}function n(e){var t=c.getElementID(e);e.on("click",".fsCategoryLink",(function(){var n=a(this).data("category-id"),i={element_id:t,post_category_id:n},o=c.getCurrentHistoryState();return o[t]&&o[t].post_category_id==n||(c.updateQueryStringValueAndHistory(i),r(e,i)),!1})),e.on("click",".fsTagLink",(function(){var n=a(this).data("tag-id"),i={element_id:t,tag_id:n},o=c.getCurrentHistoryState();return o[t]&&o[t].tag_id==n||(c.updateQueryStringValueAndHistory(i),r(e,i)),!1})),a(window).off("popstate.element_"+t).on("popstate.element_"+t,(function(n){var i=n.originalEvent.state;u.didChangeState(t)&&r(e,i?i[t]:null)}))}function i(e){var t=c.getElementID(e);e.on("click",".fsPreviousButton",(function(){e.find(".fsNotification").remove(),d.triggerFilter(c.getElementID(e),{element_id:t,navigate:"previous"})})),e.on("click",".fsNextButton",(function(){e.find(".fsNotification").remove(),d.triggerFilter(c.getElementID(e),{element_id:t,navigate:"next"})})),d.onUpdated(t,e.data("linked-element-ids"),(function(t,n){e.find(".fsNotification").remove(),n&&n.navigationFailed&&e.find(o.selectors.elementContent).append(a('<div class="fsNotification">No '+n.navigationFailed+" post available</div>"))}))}function r(e,t){var n=c.getElementID(e),i=t||{element_id:n,post_category_id:"",tag_id:""},r=i.hasOwnProperty("tag_id")?"tag_id":"post_category_id";u.addState(n,i),i[r]=i[r]||"",d.triggerFilter(n,i),e.find(".fsToolsList > li").removeClass(o.classes.stateSelected).find("["+("tag_id"==r?"data-tag-id":"data-category-id")+'="'+i[r]+'"]').closest("li").addClass(o.classes.stateSelected)}var a=e.$,o=e.getInternalNS("elements.constants"),s=e.getInternalNS("elements.element_tools.utils"),l=e.getNS("events"),d=e.getInternalNS("elements.linkedEvents"),c=e.getInternalNS("elements.utils"),u=new c.ElementHistory,f="PostTools";l.onElementAdded(f,t),l.onElementUpdated(f,t),a(".fs"+f+"Element").each((function(){t(a(this))}))}(FS),function(e,t){"use strict";function n(e){if(e&&e.data("autoplay")){var t=e[0];o(t)?S.ytelements[t.id].done((function(e){e.playVideo()})):t.play()}}function i(){var e=y.Dialog({closeOnClick:!0,dialogClass:"fsResourceDialog",id:"fsResource",removeOnClose:!1}),t="<p>You are not authorized to access this resource.</p>";e.setContent(t),e.attachToPage(),e.open(m(document.body))}function r(e,t,n,i,r,a,s){var l,d,c,u=t.data("item-count"),f=t.data("page-index"),h=t.data(),p="resource"+h.resourceType+"LightboxDisplay",v={collection_id:h.resourceCollectionId,display_in_dialog:!0,element_id:i,page_id:r,post_id:a,resource:n};s&&(v.preview=!0),v.collection_id&&(d=N),e.hasClass(D)?(c=t.closest("ul").find("> li.fsResource a.fsResourceLink"),l=c.index(t)):e.hasClass(N)?l=t.closest("article.slick-slide").data("slick-index"):(c=e.find("a.fsResourceLink:not(.fsTitle .fsResourceLink)"),l=c.index(c.filter('[data-resource-uuid="'+t.data("resource-uuid")+'"]'))),u&&f&&(l+=(f-1)*u),C.trackResourceEvent(p,h.resourceTitle,n),C.showElementPopupDialog(e,v,x+"Element",t,d).done((function(){var e,t="article.slick-active audio, article.slick-active video, article.slick-active .ytplayer",n=m(".fsElementDialog.fsResourceElement"),i=n.find(A);i.on("init",(function(){i.find(t).each((function(e,t){var n=m(t);n.data().autoplay&&(o(t)?S.ytelements[t.id].done((function(e){e.playVideo()})):n.on("canplay",(function(){this.play()})))})),(e=i.find(".slick-current").find(".fsVideoPlayOverlay"))&&e.attr("tabindex","0")})),i.on("beforeChange",(function(){e=i.find(".slick-current").find(".fsVideoPlayOverlay"),i.find(t).each((function(){var e=this;o(e)?S.ytelements[e.id].done((function(e){e.pauseVideo()})):this.paused||this.pause()})),e&&e.removeAttr("tabindex")})),i.on("afterChange",(function(){(e=i.find(".slick-current").find(".fsVideoPlayOverlay"))&&!e.hasClass("fsStateHidden")?(e.attr("tabindex","0"),e.focus()):i.find(t).focus(),setTimeout((function(){g(i)}),10)})),i.slick({accessibility:!0,adaptiveHeight:!1,arrows:!0,infinite:!0,initialSlide:l,nextArrow:n.find(".fsNextButton"),prevArrow:n.find(".fsPrevButton"),slide:"article",slidesToScroll:1,slidesToShow:1,vertical:!1}),g(i)})),e.hasClass("fsStatePlaying")&&t.hasClass("fsResourceLink")&&e.find(".fsSlideshowPause").trigger("click")}function a(){this.currentTime>=R&&(this.controls?(this.pause(),this.removeEventListener("timeupdate",a)):this.currentTime=0)}function o(e){return"IFRAME"==e.tagName}function s(e){var t=e.find(".fsResource"),n=20;if(t.length>n)for(var i=n;i<t.length;i++)t[i].remove()}function l(e){e.find("video:not([data-"+k+"])").each((function(){function e(){n.addClass(v.stateHidden),t[0].play(),t.attr("tabindex","0"),t.focus()}var t=m(this),n=t.siblings(".fsPlayOverlay");n.length>0&&(n.on("click",e),n.on("keypress",(function(t){13==t.which&&e()})))}))}function d(a){var o=C.getElementID(a),d=a.find(".fsResourceCollectionLink"),u=a.data("linked-element-ids"),f=!!a.find(".fsResourceLink").data("preview"),g=a.find(".fsResourceLink").data("permitted-user"),y=a.data("source-element-id"),_=a.data("source-page-id"),S=a.data("source-post-id"),k=a.data("trigger-element-ids"),I=m(document.body).data("logged-in"),A=a.find('div.ytplayer, a[data-resource-type="Youtube"]'),x=document.createElement("script"),R=document.getElementsByTagName("script")[0];A.length&&(x.src="https://www.youtube.com/iframe_api",R.parentNode.insertBefore(x,R)),(g||d||I)&&("/"==t.location.pathname&&m("body").data("resourceOptimizations")&&s(a),0==a.parents(".fsDialog").length&&a.find(".fsVideoPlayOverlay").each((function(){m(this).attr("tabindex","0")})),b&&h(),c(a),p(a),l(a),a.find(".fsElementContent").on("click","a[data-resource-uuid]",(function(){var e=m(this),t=e.data("permitted-user"),n=e.data("resource-uuid"),s={display_in_element:!0,element_id:y,page_id:_,post_id:S,resource:n};if(!e.closest("figcaption, .fsDescription").length||e.hasClass("fsResourceLink")){if(t)return u?E.triggerFilter(o,s):r(a,e,n,y,_,S,f),!1;i()}})).on("click","a[data-resource-collection-id]",(function(){var e=m(this),t=e.data("resource-collection-id"),n=e.data("collection-loading"),i=a.hasClass(D),r={depth:e.parentsUntil(a).filter("ul").length+1,display_in_element:!0,element_id:y,page_id:_,post_id:S,resource_collection:t};return e.data("collection-navigates")&&(n?e.closest("li").toggleClass(v.stateExpanded):(e.data("collection-loading",!0),C.loadingOverlay(a.find(T.elementContent)),C.fetchElementHTML(o,r,{updateDOM:!i}).done((function(t){if(i){var n=m(t).find(".fsElementContent > ul");0==n.length&&(n=m('<ul class="fsStyleDefaultList"><li class="fsListItem"><div class="fsNotification"></div></li></ul>')).find(".fsNotification").text(m(t).find(".fsElementEmpty").text()),e.closest("li").append(n).addClass(v.stateExpanded),C.removeLoadingOverlay(a)}else C.updateURLParams({virtualParam:"/~resource-collection/"+e.data("resource-collection-id")})})))),u&&E.triggerFilter(o,r),!1})).on("click",".fsElementPagination a",(function(){var e=a.find(T.elementContent),t={element_id:y,page_id:_,post_id:S,resource_collection:a.data("resource-collection-id")};return t["element_"+o+"_page"]=m(this).data("page"),C.loadingOverlay(e),C.updateQueryStringValueAndHistory(t),C.fetchElementHTML(o,t),!1})).on("click",".fsResourceLink",(function(){var t,n=m(this).data();e._.includes(["Document","Pdf","Raw"],n.resourceType)&&(t="resource"+n.resourceType+"Download",C.trackResourceEvent(t,n.resourceTitle,n.resourceUuid))})),a.hasClass(N)||a.find("audio, video").on("play pause",(function(e){var t,n=m(e.target),i=n.data(),r=e.type.charAt(0).toUpperCase()+e.type.slice(1);e.target.autoplay&&!w[i.resourceUuid]&&(w[i.resourceUuid]=!0,r="Autoplay"),t=n.is("video")?"resourceVideo"+r:"resourceAudio"+r,C.trackResourceEvent(t,i.resourceTitle,i.resourceUuid)})),k&&E.onFilter(o,k,(function(e,t){var i=a.hasClass(M),s=Object.prototype.hasOwnProperty.call(t,"resource_collection")&&i;Object.prototype.hasOwnProperty.call(t,"resource")&&!i&&e!=o?r(a,a,t.resource,e,_,S,f):s||u&&e==o||(C.loadingOverlay(a.find(T.elementContent)),C.fetchElementHTML(o,t).done((function(){n(C.getElementByID(o).find("audio, video").first()),E.triggerUpdated(o,null,e)})))})),a.find("picture img").each((function(){var e=m(this).data(),t="resourceSingleImageDisplay";a.hasClass(N)?t="resourceSlideshowImageDisplay":a.hasClass("fsGrid")&&(t="resourceGridImageDisplay"),C.trackResourceEvent(t,e.resourceTitle,e.resourceUuid)})))}function c(e){e.find("video[data-"+k+"]").each((function(){function e(){var e=m.Deferred();t.css("height",n.height()),C.createDashPlayer(t,!0,e),e.done((function(){n.addClass(v.stateHidden)})),t.attr("tabindex","0"),t.focus()}var t=m(this),n=t.siblings(".fsPlayOverlay"),i=!(!t.prop("autoplay")&&!t.data("autoplay"));n.length>0&&(n.on("click",e),n.on("keypress",(function(t){13==t.which&&e()}))),i&&(t.closest(I).length>0||0==t.closest(A).length)&&C.createDashPlayer(t,!0)}))}function u(e){var i,r,a=m(".fsResourceElement.fsElementDialog");c(e),h(),l(e),i=e.find("audio, video, .ytplayer").first(),r=e.find("img[data-image-sizes]"),a.hasClass(N)||(n(i),a.toggleClass("fsResourceAudioOnly",i&&"AUDIO"==i.prop("tagName"))),r.length&&m(t).trigger("resize",{forceUpdate:!0})}function f(e){e.find(".fs"+x+"Element").each((function(){d(m(this))}))}function h(){m(document).find("div.ytplayer").each((function(){function e(){i.css("height",r.height()),n.playVideo(),r.addClass(v.stateHidden),i.attr("tabindex","0"),i.focus()}if(this.id){var n,i=m(this),r=i.siblings(".fsPlayOverlay"),a=!!i.attr("autoplay"),o=i.attr("controls")?1:0,s=!!i.attr("loop"),l=!!i.attr("muted"),d=i.data("video-id"),c=i.attr("caption")?1:0;S.ytelements[this.id]=m.Deferred(),m(this).parent().wrapInner('<div class="fsAspectRatioWrapper" />'),n=new YT.Player(this.id,{videoId:d,events:{onReady:function(e){var t=e.target.getIframe();S.ytelements[t.id].resolve(e.target),t.width="100%",t.height="100%"}},playerVars:{autoplay:a,cc_lang_pref:"en",cc_load_policy:c,color:"white",controls:o,disablekb:o,loop:s,modestbranding:1,mute:l,playlist:d,playsinline:1,rel:0,widget_referrer:t.location.href}}),r.length>0&&(r.on("click",e),r.on("keypress",(function(t){13==t.which&&e()})))}}))}function p(n){"/"==t.location.pathname&&e.currentPage.homepageVideoOptimization&&n.find("video").each((function(){var e=m(this);!(!e.prop("autoplay")&&!e.data("autoplay"))&&!e.closest(A).length&&e[0].addEventListener("timeupdate",a)}))}function g(e){var t=e.closest(".fsSlideshow"),n=e.find(".slick-current");e.find(".slick-track").attr("aria-label",t.attr("aria-label")||"Slideshow"),e.find(".slick-list[aria-live]")&&e.find(".slick-list[aria-live]").removeAttr("aria-live"),n.hasClass("fsResourceTypeVideo")&&n.removeAttr("tabindex")}var m=e.$,v=e.getInternalNS("elements.constants.classes"),y=e.getInternalNS("dialogs"),_=e.events,b=!1,E=e.getInternalNS("elements.linkedEvents"),w={},T=e.getInternalNS("elements.constants.selectors"),S=e.getInternalNS("elements.youtubeUtils"),C=e.getInternalNS("elements.utils"),k="dash-url",I=".fsElementDialog",A=".fsElementSlideshow",x="Resource",D="fsListNav",R=30,M="fsSingleItem",N="fsSlideshow";S.ytelements={},S.youtubeApiLoader=m.Deferred(),_.onElementAdded(x,d),_.onElementAdded("sharedcontainer",f),_.onElementUpdated(x,d),_.onElementUpdated("sharedcontainer",f),_.onElementDialogShown(x,u),f(m(document.body)),t.onYouTubeIframeAPIReady=function(){b=!0,S.youtubeApiLoader.resolve(),h()}}(FS,window),function(e,t){"use strict";function n(e,t,n,r,a){var o,c="",u="";if(0==e.hits.length)a.prepend(s);else{o=e.hits,a.prepend(d(i(o.shift()))),g.each(o,(function(e){c+=d(i(e))})),n.prepend(c);for(var f=1;f<=e.nbPages;f++)u+=l({count:f,selected:e.page==f-1});t.html(u),r.html("About "+e.nbHits+" results ("+e.processingTimeMS+" milliseconds)")}}function i(e){return e.fileType="",e.titleBlock=c,e.snippet=r(e),e.pageURL=t.location.protocol+"//"+t.location.hostname+e.page_path,e}function r(e){for(var t=_.length,n=e._snippetResult,i=0;i<t;i++){var r=n[_[i]];if(r&&r.value&&"none"!=r.matchLevel)return r.value}}function a(e,t,i,r,a,o,s){s.find(".gsc-webResult").remove(),r.empty().data("searchterm",e),o.empty(),algoliasearch(i.data("app-id"),i.data("api-key")).initIndex(i.data("index")).search(e,{highlightPostTag:"</strong>",highlightPreTag:"<strong>",hitsPerPage:10,maxValuesPerFacet:100,page:t,restrictSearchableAttributes:["content","title"],snippetEllipsisText:"&hellip;"}).then((function(e){n(e,r,a,o,s)}),(function(){alert("Error, please try again.")}))}function o(e){var t=e.find(".gsst_a"),n=e.find(".gsc-cursor-box"),i=e.find(".gsc-expansionArea"),r=e.find("input.gsc-input"),o=e.find(".gsc-result-info"),s=e.find(".gsc-results"),l=e.find(".gsc-control-cse[data-displaypart=2]").length,d=b.getQueryStringValues(),c=!!d.q&&decodeURIComponent(d.q.replace(/\+/g,"%20"));t.length&&(t.hide(),t.click((function(){r.val("").focus(),t.hide()})),r.keyup((function(){t.toggle(r.val().length>0)}))),s.length&&c&&(r.length&&(r.val(c),t.show()),a(c,0,e,n,i,o,s)),e.find(".gsc-search-box").submit((function(){return!l||(a(r.val(),0,e,n,i,o,s),!1)})),n.on("click",".gsc-cursor-page",(function(){var t=Number(m(this).html());a(n.data("searchterm"),t-1,e,n,i,o,s)}))}function s(e){return u||(u=g.template(m("#fsSearchNoResultsTemplate").html())),u(e)}function l(e){return f||(f=g.template(m("#fsSearchPagingTemplate").html())),f(e)}function d(e){return h||(h=g.template(m("#fsSearchResultTemplate").html())),h(e)}function c(e){return p||(p=g.template(m("#fsSearchTitleBlock").html())),p(e)}var u,f,h,p,g=e._,m=e.$,v="Search",y=e.events,_=["title","content"],b=e.getInternalNS("elements.utils");y.onElementAdded(v,o),y.onElementUpdated(v,o),m(".fsSearch").each((function(){o(m(this))}))}(FS,window),function(e){"use strict";function t(e){e.find(w+", "+T+", "+S).empty()}function n(e){if(!e.data(_)){var t=algoliasearch(e.data(m),e.data(g));e.data(_,t.initIndex(e.data(b)+"pages"))}return e.data(_)}function i(e){for(var t=e._snippetResult,n=0;n<R;n++)for(var i=0;i<N;i++){var r=t[M[i]];if(r&&r.value&&r.matchLevel==D[n])return r.value}}function r(e,t,n){var i="https://"+(n[e.domain_id]||window.location.hostname);return"pages"==t?i+e.page_path:"resources"==t?i+e.view_url:i+"/fs/pages/search-results-item/"+t.slice(0,-1)+"/"+e.id}function a(e,t){var n=e.find(y),a=e.find(T);a.empty(),n.empty(),t.userData&&u.each(t.userData,(function(t){n.append(F(e,".fsSearchCustomResultTemplate")(t))})),e.find(w).html(F(e,".fsSearchResultInfoTemplate")({label:P.pluralize(t[p],"result"),timing:t[h]+" "+P.pluralize(t[h],"millisecond"),total:t[p]})),t[p]>0&&u.each(t.hits,(function(t){a.append(F(e,".fsSearchResultTemplate")({snippet:i(t),title:t.page_name,url:r(t,"pages",e.data(v))}))})),P.pagination(e.find(S),t.page+1,t[p],t.hitsPerPage),a.removeClass(I.classes.stateHidden)}function o(e){return function(t,n,i){e.search(t,u.defaults({optionalWords:t},L)).then((function(e){i(e.hits)}))}}function s(e,i,r){var o=n(e);if(0==(i=f.trim(i)).length)return t(e);e.data(E,i),o.search(i,u.defaults({optionalWords:i,page:r||0},L)).then((function(t){a(e,t)}),(function(){alert("Error, please try again.")}))}function l(e){e.hasClass("fsSearchForm")?d(e):e.hasClass("fsList")&&c(e)}function d(e){function t(){c.toggleClass(I.classes.stateHidden,""==d.val())}var n=e.data(g),a=e.data(v)||{},s=P.getElementID(e),l=e.data("linked-element-ids"),d=e.find(".fsStyleSearchField"),c=e.find(".fsButtonClear");l&&(P.getElementByID(l[0]).length&&e.on("submit","form",(function(){return x.triggerFilter(s,{query:f("#fsSearchInput_"+s).val()}),!1})));if(n){var u=e.data(m),h=[{highlight:!0,minLength:2}],p=P.inDraftMode(),y=e.data(b);n.pages&&h.push({async:!0,display:"page_name",limit:3,name:"pages",source:o(algoliasearch(u,n.pages).initIndex(y+"pages")),templates:{header:"Pages",suggestion:function(t){return F(e,".fsSearchSuggestionTemplate")({snippet:i(t),title:t.page_name,url:r(t,"pages",a)})}}}),n.posts&&h.push({async:!0,display:"title",limit:3,name:"posts",source:o(algoliasearch(u,n.posts).initIndex(y+"posts")),templates:{header:"Posts",suggestion:function(t){return F(e,".fsSearchSuggestionTemplate")({snippet:i(t),title:t.title,url:""})}}}),n.resources&&h.push({async:!0,display:"title",limit:3,name:"resources",source:o(algoliasearch(u,n.resources).initIndex(y+"resources")),templates:{header:"Resources",suggestion:function(t){return F(e,".fsSearchSuggestionTemplate")({snippet:i(t),title:t.filename,url:""})}}}),d.typeahead.apply(d,h),d.on("typeahead:select",(function(e,t,n){p&&"pages"==n?P.notifyAdminInterface("page:show",{pageID:t.page_id}):p?window.open(r(t,n,a),"_blank"):window.location=r(t,n,a)}))}d.on("keyup click change",(function(){t()})),c.on("click",(function(){d.attr("value","").focus(),t()}))}function c(e){var t=P.getElementID(e),n=e.data(E),i=e.data("trigger-element-ids");i&&x.onFilter(t,i,(function(t,n){s(e,n.query)})),n&&s(e,n),e.on("click",S+" a",(function(){return s(e,e.data(E),f(this).data("page")-1),!1}))}var u=e._,f=e.$,h="processingTimeMS",p="nbHits",g="api-key",m="app-id",v="domains",y=".fsSearchCustomResults",_="algolia-index",b="index-prefix",E="search-term",w=".fsSearchResultInfo",T=".fsListItems",S=".fsElementPagination",C="Search",k=e.getInternalNS("elements"),I=k.constants,A=e.events,x=k.linkedEvents,D=["full","partial","none"],R=D.length,M=["title","content"],N=M.length,O={interpolate:/{(.+?)}/g},P=k.utils,L={highlightPostTag:"</span>",highlightPreTag:'<span class="fsSearchResultMatch">',hitsPerPage:10,page:0,snippetEllipsisText:"&hellip;"},F=u.memoize((function(e,t){return u.template(e.find(t).html(),O)}),(function(e,t){return t+P.getElementID(e)}));f(".fsSearchElement").each((function(){l(f(this))})),A.onElementAdded(C,l),A.onElementUpdated(C,l)}(FS),function(e,t,n){"use strict";function i(e){return e.find("article.slick-active audio, article.slick-active video, article.slick-active .ytplayer")}function r(t){return e(t.currentTarget).find("article.slick-active picture img")}function a(e){return YT.get(e.id)}function o(e){return e.getPlayerState()}function s(e,t){1==t&&i(e).each(l)}function l(t,n){var i,r=e(n).data(),a=f(n);("ytplayer"!=n.className||a)&&r.autoplay&&(i=a?"Youtube":"VIDEO"==n.tagName?"Video":"Audio",C[r.resourceUuid]||(C[r.resourceUuid]=!0,S.trackResourceEvent("resourceSlideshow"+i+"Autoplay",r.resourceTitle,r.resourceUuid)),"/"==window.location.pathname&&FS.currentPage.homepageVideoOptimization&&"VIDEO"==n.tagName&&!r.reachedMaxVideoLength&&n.addEventListener("timeupdate",d),r.reachedMaxVideoLength||(a?T.ytelements[n.id].done((function(e){e.playVideo()})):n.play(!0)))}function d(){this.currentTime>=k&&(this.controls?e(this).data("reachedMaxVideoLength",!0):this.currentTime=0,e(this).trigger("ended"),this.removeEventListener("timeupdate",d))}function c(e){e.hasClass(R)&&m(e)}function u(t){t.find(M).each((function(){m(e(this))}))}function f(e){return"IFRAME"==e.tagName}function h(e){var t=a(e);1==o(t)?t.pauseVideo():t.playVideo()}function p(t){e(t).find(".fsElementSlideshow").each((function(){var t=e(this).get(0).slick;t&&(t.setPosition(),t.slickGoTo(0,!0))}))}function g(t){t.each((function(){var t=e(this).children().not("fieldset").not(".fsElementControls");t.height(e(FS._.max(t,(function(t){return e(t).height()}))).height())}))}function m(t,n){var o=t.find("img[data-image-sizes], video, div.ytplayer"),l=t.find(".fsElementSlideshow"),d=t.find(".fsLeftArrow, .fsRightArrow"),c=l.data("arrows"),u=l.data("autoplay"),p=l.data("fade"),m=!1,y=l.data("slides-to-show"),b=l.children().length,E=!1,k=l.data("vertical");!o.length||n?(k&&g(l),l.on("init",(function(e,t){d.toggleClass("fsStateHidden",b<=t.options.slidesToShow),s(l,y)})),l.on("breakpoint",(function(e,t){d.toggleClass("fsStateHidden",b<=t.options.slidesToShow)})),l.on("click keypress",".fsSlideshowPlay, .fsSlideshowPause",(function(t){var n=e(this).hasClass("fsSlideshowPlay"),r=e(this).closest(n?A:D);if(E=!n,r.removeClass(n?I:x),r.addClass(n?x:I),l.slick(n?"slickPlay":"slickPause"),n&&m&&(m=!1,l.slick("slickNext")),1==y&&i(l).each((function(){f(this)?h(this):this[n?"play":"pause"]()})),r.find(".fsSlideshowPause").attr("aria-hidden",!n).toggleClass(w.stateHidden),r.find(".fsSlideshowPlay").attr("aria-hidden",n).toggleClass(w.stateHidden),"keypress"===t.type&&13===t.which){var a=n?".fsSlideshowPause":".fsSlideshowPlay";r.find(a).focus()}})),l.on("beforeChange",(function(){i(l).each((function(){f(this)?a(this).pauseVideo():this.paused||this.pause()}))})),l.on("afterChange",(function(){l.closest(D).length&&s(l,y),r(l).each((function(){var t=e(this).data();C[t.resourceUuid]||(C[t.resourceUuid]=!0,S.trackResourceEvent("resourceSlideshowImageDisplay",t.resourceTitle,t.resourceUuid))})),setTimeout((function(){v(l)}),10)})),T.youtubeApiLoader.done((function(){l.find("iframe.ytplayer").each((function(){var e=a(this);e.addEventListener("onStateChange",(function(t){1==t.data?l.slick("slickPause"):0==t.data&&u&&(E?m=!0:(1==y&&l.slick("slickNext"),l.slick("slickPlay")),e.pauseVideo(),e.seekTo(0))}))}))})),l.find("audio, video").on("playing",(function(){l.slick("slickPause")})).on("ended",(function(){u&&(E?m=!0:(1==y&&l.slick("slickNext"),l.slick("slickPlay")),e(this).is("video")&&(e(this)[0].currentTime=0))})),l.slick({accessibility:!0,adaptiveHeight:l.data("adaptive-height"),arrows:c,autoplay:u,autoplaySpeed:l.data("autoplay-speed"),dots:l.data("dots"),dotsClass:"fsPager",fade:p,infinite:!0,
nextArrow:c?t.find(".fsNextButton"):"",prevArrow:c?t.find(".fsPrevButton"):"",slide:"article",slidesToScroll:y,slidesToShow:y,vertical:k&&!p,responsive:[{breakpoint:N,settings:{arrows:!0,nextArrow:c?t.find(".fsNextButton"):"",prevArrow:c?t.find(".fsPrevButton"):"",slidesToScroll:y>=2?2:y,slidesToShow:y>=2?2:y}},{breakpoint:O,settings:{arrows:!0,nextArrow:c?t.find(".fsNextButton"):"",prevArrow:c?t.find(".fsPrevButton"):"",slidesToScroll:1,slidesToShow:1}}]}),v(l),o.length&&e(window).trigger("resize")):_(t,o)}function v(e){var t=e.closest(M),n=e.find(".slick-current");e.find(".slick-track").attr("aria-label",t.attr("aria-label")||"Slideshow"),e.find(".slick-list[aria-live]")&&e.find(".slick-list[aria-live]").removeAttr("aria-live"),(n.hasClass("fsResourceTypeVideo")||n.hasClass("fsResourceTypeYoutube"))&&n.removeAttr("tabindex"),e.siblings(".fsNextButton").attr("aria-label","Next"),e.siblings(".fsPrevButton").attr("aria-label","Previous")}function y(e,t){e.data("image-loaded")?t.resolve():e.one("image:loaded",(function(){t.resolve()}))}function _(t,n){var i=n.map((function(){var t=e(this),n=e.Deferred();return"VIDEO"==t.prop("tagName")?t.data("dash-url")?S.createDashPlayer(t,!1,n):b(t,n):"DIV"==t.prop("tagName")?E(t,n):y(t,n),n})).get();e.when.apply(null,i).then((function(){m(t,!0)}))}function b(e,t){e[0].readyState>=3?t.resolve():e[0].addEventListener("loadedmetadata",(function(){t.resolve()}))}function E(t,n){T.youtubeApiLoader.done((function(){function n(){a.css("height",o.height()),i.playVideo(),o.addClass(w.stateHidden),a.attr("tabindex","0"),a.focus()}var i,r=t[0].id,a=t,o=a.siblings(".fsPlayOverlay"),s=!!a.attr("autoplay"),d=a.attr("controls")?1:0,c=!!a.attr("loop"),u=!!a.attr("muted"),f=a.data("video-id"),h=a.attr("caption")?1:0;T.ytelements[r]=e.Deferred(),i=new YT.Player(r,{videoId:f,events:{onReady:function(t){var n=t.target.getIframe();T.ytelements[n.id].resolve(t.target),0==e(n).parent().data("slick-index")&&l(0,n),n.width="100%",n.height=n.clientWidth*(9/16)}},playerVars:{autoplay:s,cc_lang_pref:"en",cc_load_policy:h,color:"white",controls:d,disablekb:d,loop:c,modestbranding:1,mute:u,playlist:f,playsinline:1,rel:0,widget_referrer:window.location.href}}),o.length>0&&(o.on("click",n),o.on("keypress",(function(e){13==e.which&&n()})))})),n.resolve()}var w=FS.getInternalNS("elements.constants.classes"),T=FS.getInternalNS("elements.youtubeUtils"),S=FS.getInternalNS("elements.utils"),C={},k=30,I="fsStatePaused",A="."+I,x="fsStatePlaying",D="."+x,R="fsSlideshow",M="."+R,N=800,O=600;n.each(["News","Calendar","Feeds","Post","Resource","Issue"],(function(e){t.onElementAdded(e,c),t.onElementUpdated(e,c)})),t.onElementShown("Panel",p),t.onElementUpdated(t.ALL_CONTAINERS_TYPE,u),u(e(document.body))}(FS.$,FS.events,FS._),function(e,t,n){"use strict";function i(t){var n,i="https://graph.facebook.com/",r=t.data();r.id&&(n=t.find(".fsElementContent"),""==r.accesstoken&&n.html(s("Unable to connect to Facebook at this time. Please try refreshing in a couple of minutes.")),e.ajax({data:{fields:u,limit:r.maxposts},dataType:"jsonp",url:i+r.id+"/"+r.posttype+"?access_token="+r.accesstoken,error:function(){n.html(s("An error occurred while connecting to the Facebook API"))},success:function(t){var i="https://www.facebook.com/"+r.id;if(!t.error){t.link&&(i=t.link);var a,o,s,l,d=0,c=e("<ul>",{class:"fsFacebookList"}),u=e('<li class="fsFacebookListItem"></li>');for(t=t.data;d<t.length;d++){if(u.html('<span class="fsFacebookFrom">'+t[d].from.name+"</span>"),t[d].to&&t[d].to.name&&u.append(' <strong>to</strong> <span class="fsFacebookTo">'+t[d].to.name+"</span>"),t[d].message){for(o in l=t[d].message.match(/https?:\/\/[^\s|"|'|>]*/i),s=(s=t[d].message.replace("<","&lt;")).replace(">","&gt;"),l)"index"!=o&&"input"!=o&&"lastIndex"!=o&&(s=s.replace(l[o],'<a href="'+l[o]+'" target="_blank">'+l[o]+"</a>"));u.append("&nbsp;"+s)}switch(a=!1,s=e("<div>",{class:"fsFacebookExtras fsStyleAutoclear"}),t[d].picture&&(s.append('<img class="fsFacebookThumb" src="'+t[d].picture+'">'),a=!0),t[d].type){case"link":case"photo":case"video":t[d].name?(s.append('<a target="_blank" class="fsFacebookTitle" href="'+t[d].link+'">'+t[d].name+"</a>"),a=!0):t[d].link&&(s.append('<a target="_blank" class="fsFacebookTitle" href="'+t[d].link+'">'+t[d].link+"</a>"),a=!0)}t[d].caption&&(s.append('<div class="fsFacebookCaption">'+t[d].caption+"</div>"),a=!0),t[d].description&&(s.append('<div class="fsFacebookDesc">'+t[d].description+"</div>"),a=!0),t[d].likes&&t[d].likes.data&&(s.append('<div class="fsFacebookLikes">'+t[d].likes.data.length+" likes</div>"),a=!0),a&&u.append(s),u.clone().appendTo(c)}e('<li class="fsFacebookFollow"><a href="'+i+'" target="_blank">View facebook page</a></li>').appendTo(c),n.html(c)}}}))}function r(t){function i(e,t){let i="?byline=0&api=1";t&&(i+=`&h=${t}`),l(a,n.location.protocol+"//player.vimeo.com/video/"+e+i,o.title)}function r(t){e.ajax({dataType:"jsonp",url:n.location.protocol+"//vimeo.com/api/v2/"+t+o.id+"/videos.json",error:function(){a.html(s("An error occurred while connecting to the Vimeo API"))},success:function(n){var r,l,d=0;if(n.length){if(i(n[0].id),!o.mostrecent){for(r=e('<ul class="fsVimeoList">'),l=e('<li class="fsVimeoListItem fsStyleAutoclear"><img class="fsVimeoThumb"><div class="fsVimeoTitle"></div><div class="fsVimeoViews"></div><div class="fsVimeoDesc"></div></li>');d<n.length&&(l.find("img").attr({alt:"",role:"presentation",src:n[d].thumbnail_medium}),l.find(".fsVimeoViews").html(n[d].stats_number_of_plays+" views"),l.find(".fsVimeoTitle").html(n[d].title),l.find(".fsVimeoDesc").html(n[d].description),l.clone().click((function(){i(n[e(this).index()].id)})).appendTo(r),d!=o.maxvideos-1);d++);e('<li class="vimeo_view_link"><a href="https://www.vimeo.com/'+t.replace(/(channel|group)/,"$1s")+o.id+'" class="fsStyleDefaultButton" target="_blank">View on vimeo</a></li>').appendTo(r),a.append(r)}}else a.html(s("No videos found"))}})}var a,o=t.data();if(o.id&&o.videotype)switch(a=t.find(".fsElementContent"),o.videotype){case"album":r("album/");break;case"channel":r("channel/");break;case"group":r("group/");break;case"user":r("");break;case"video":i(o.id,o.privateVideoHash)}}function a(t){var i,r=t.data(),a=function(t){o(t.data.video,!0),e(t.originalEvent.target).closest(".fsElement")[0].scrollIntoView()},o=function(e,t){l(i,n.location.protocol+"//www.youtube.com/embed/"+e+"?enablejsapi=1"+(t?"&autoplay=1":"")+"&origin="+n.location.protocol+n.location.hostname,r.title)},d=function(t,n){e.ajax({cache:!0,dataType:"jsonp",url:"/fs/proxies/youtube/"+t+"?"+n,data:{alt:"json",maxResults:r.mostrecent?1:r.maxvideos,order:"date",part:"channels"==t?"contentDetails":"snippet",type:"video"},error:function(){i.html(s("An error occurred while connecting to the YouTube API"))},success:function(t){var n;if(t.error){var r=t.error.errors.map((function(e){return e.reason+": "+e.message}));i.html(s(r.join("<br>")))}if("youtube#channelListResponse"!=t.kind)if(t.items.length){if(o(t.items[0].id.videoId||t.items[0].snippet.resourceId.videoId),t.items.length>1){var l=e("<ul>",{class:"fsYoutubeList"});for(n=0;n<t.items.length;n++){var c=e("<li>",{class:"fsYoutubeListItem fsStyleAutoclear"});c.append(e("<img>",{alt:"",class:"fsYoutubeThumb fsStyleFloatLeft",role:"presentation",src:t.items[n].snippet.thumbnails.default.url})),c.append(e("<div>",{class:"fsYoutubeTitle",text:t.items[n].snippet.title})),c.append(e("<div>",{class:"fsYoutubeDesc",text:t.items[n].snippet.description})),c.click({video:t.items[n].id.videoId||t.items[n].snippet.resourceId.videoId},a),l.append(c)}i.append(l)}}else i.html(s("No videos found"));else t.items.length?t.items[0].contentDetails.relatedPlaylists&&t.items[0].contentDetails.relatedPlaylists.uploads?d("playlistItems","playlistId="+t.items[0].contentDetails.relatedPlaylists.uploads):i.html(s("The channel does not have any uploaded videos.")):i.html(s("No channels found for the specified user"))}})};if(r.id)switch((i=t.find(".fsElementContent")).html("Loading from YouTube..."),r.videotype){case"channel":d("channels","id="+r.id);break;case"playlist":d("playlistItems","playlistId="+r.id);break;case"user":d("channels","forUsername="+r.id);break;case"video":o(r.id)}}function o(e){return Math.round(e/16*9)}function s(e){return'<div class="fsElementEmpty">'+e+"</div>"}function l(e,t,n){var i=e.find("iframe"),r='<iframe class="fsSocialVideoFrame" type="text/html" height="'+o(e.width())+'" src="'+t+'" webkitAllowFullScreen mozallowfullscreen allowFullScreen title="'+(n||"Embedded video player")+'"></iframe>';i.length?i.replaceWith(r):e.html(r)}function d(e){e.hasClass("fsFacebook")?i(e):e.hasClass("fsVimeo")?r(e):e.hasClass("fsYoutube")&&a(e)}function c(t){t.find(".fsVimeo, .fsYoutube").each((function(){var t=e(this).find("iframe");t.height(o(t.outerWidth()))}))}var u="caption,description,from,likes,link,message,name,picture,to,type";e((function(){e(".fsFacebook, .fsVimeo, .fsYoutube").each((function(){d(e(this))}))})),t.onElementUpdated("facebook",d),t.onElementUpdated("vimeo",d),t.onElementUpdated("youtube",d),t.onElementShown("panel",c),e(n).resize((function(){c(e("body"))}))}(FS.$,FS.events,window),function(e){"use strict";function t(e){var t=e.find("> .fsElementContent");t.data("ui-tabs")?t.tabs("refresh"):t.tabs({activate:function(e,t){a.triggerElementHidden(t.oldPanel),a.triggerElementShown(t.newPanel)}}),o.inComposeMode()&&e.find(".ui-tabs-nav").sortable({axis:"x",items:"> li:not(:has(> .fsAddTab))",beforeActivate:function(e){e.preventDefault()},update:function(e,t){var n=r(t.item);o.moveBehind(n,n.prev(),n.closest(".fsElement"))}})}var n="tab",i="tabs",r=e.$,a=e.events,o=e.getInternalNS("elements.utils");a.onElementUpdated(i,t),a.onElementUpdated(i,t),a.onElementUpdated(n,(function(e){var n=e.parent().find("#fsTab_"+o.getElementID(e)+" > a"),i=e.data("title");n.text(i),e.find("> .fsElementActionButtonContainer").remove(),t(e.closest(".fsTabs"))})),a.onElementAdded(n,(function(e){e.closest(".fsElementContent").tabs({active:-1})})),r(".fsTabs:not(.fsPanelGroup)").each((function(){t(r(this))}))}(FS),function(e,t){"use strict";function n(){return r.template('\t\t\t<div class="fsMessagesNotifications">\t\t\t\t<iframe src="/fs/dialogs/notifications" frameborder="0"></iframe>\t\t\t</div>\t\t')()}var i,r=e._,a=e.$,o=e.getInternalNS("managers.messages"),s=e.getInternalNS("dialogs");o.showNotificationsModal=function(){return!!a(t.body).data("logged-in")&&(i||((i=s.Dialog({id:"fsMessagesNotifications",removeOnClose:!1})).setContent(n()),window.addEventListener("message",(function(e){var t;try{t=JSON.parse(e.data)}catch(e){t={event:""}}"close"==t.event&&i.close()}))),i.open(a(t.body)),!1)}}(FS,document),function(e){"use strict";function t(e){return e.find(f+":checked").val()}function n(e){i(e),e.find(f).change((function(){i(e)})),l.showNotificationsModal&&s.showNotificationsModal(),e.find(".fsUnsubscribeButton").click((function(){var n,i=t(e),o={global:1==i},s=window.location.href,l=s.indexOf("key=")>=0?s.split("key=")[1]:s.substr(s.lastIndexOf("/")+1),d=0==i?".fsUnsubscribeSuccessNotification":".fsGlobalUnsubscribeSuccessNotification",c=[],f=e.find('.fsUnsubscribeFromList input[type="checkbox"]');if(0==i&&f.length>0){if(0==(n=f.filter(":checked")).length)return void alert("Please select one or more lists to unsubscribe from.");n.each((function(){c.push(r(this).val())})),o.subscription_ids=c}a.loadingOverlay(e.find(u.elementContent)),r.when(a.getToken()).then((function(t){o.authenticity_token=t,r.ajax({data:o,dataType:"json",type:"POST",url:"/fs/comms-manager/unsubscribe/"+l}).error((function(e){window.alert(e.responseJSON.message)})).done((function(){e.find(d).removeClass(h),e.find(".fsUnsubscribeForm").addClass(h)})).always((function(){a.removeLoadingOverlay(e)}))}))})),e.find(".fsManagePreferencesButton").click((function(){a.isLoggedIn()?s.showNotificationsModal():window.location="/fs/login?login_destination=/fs/pages/unsubscribe?showNotificationsModal=true"}))}function i(e){var n=t(e);e.find("div.fsUnsubscribeFromList > div.fsUnsubscribeOptions").toggleClass(h,0!=n),e.find("div.fsUnsubscribeFromAll > div.fsUnsubscribeOptions").toggleClass(h,1!=n)}var r=e.$,a=e.getInternalNS("elements.utils"),o=e.getNS("events"),s=e.getInternalNS("managers.messages"),l=a.getQueryStringValues(),d="UnsubscribeForm",c=e.getInternalNS("elements.constants.classes"),u=e.getInternalNS("elements.constants.selectors"),f='input[name="fsUnsubscribeOptions"]',h=c.stateHidden;o.onElementAdded(d,n),o.onElementUpdated(d,n),r(".fs"+d+"Element").each((function(){n(r(this))}))}(FS),
/*!
 * jsTree {{VERSION}}
 * http://jstree.com/
 *
 * Copyright (c) 2014 Ivan Bozhanov (http://vakata.com)
 *
 * Licensed same as jquery - under the terms of the MIT License
 *   http://www.opensource.org/licenses/mit-license.php
 */
/*!
 * if using jslint please allow for the jQuery global and use following options: 
 * jslint: browser: true, ass: true, bitwise: true, continue: true, nomen: true, plusplus: true, regexp: true, unparam: true, todo: true, white: true
 */
function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(jQuery)}((function(e,t){"use strict";if(!e.jstree){var n,i,r=0,a=!1,o=!1,s=!1,l=[],d=e("script:last").attr("src"),c=document,u=c.createElement("LI");u.setAttribute("role","treeitem"),(n=c.createElement("I")).className="jstree-icon jstree-ocl",n.setAttribute("role","presentation"),u.appendChild(n),(n=c.createElement("A")).className="jstree-anchor",n.setAttribute("href","#"),n.setAttribute("tabindex","-1"),(i=c.createElement("I")).className="jstree-icon jstree-themeicon",i.setAttribute("role","presentation"),n.appendChild(i),u.appendChild(n),n=i=null,e.jstree={version:"{{VERSION}}",defaults:{plugins:[]},plugins:{},path:d&&-1!==d.indexOf("/")?d.replace(/\/[^\/]+$/,""):"",idregex:/[\\:&!^|()\[\]<>@*'+~#";.,=\- \/${}%?`]/g},e.jstree.create=function(t,n){var i=new e.jstree.core(++r),a=n;return n=e.extend(!0,{},e.jstree.defaults,n),a&&a.plugins&&(n.plugins=a.plugins),e.each(n.plugins,(function(e,t){"core"!==e&&(i=i.plugin(t,n[t]))})),i.init(t,n),i},e.jstree.destroy=function(){e(".jstree:jstree").jstree("destroy"),e(document).off(".jstree")},e.jstree.core=function(e){this._id=e,this._cnt=0,this._wrk=null,this._data={core:{themes:{name:!1,dots:!1,icons:!1},selected:[],last_error:{},working:!1,worker_queue:[],focused:null}}},e.jstree.reference=function(t){var n=null,i=null;if(t&&t.id&&(t=t.id),!i||!i.length)try{i=e(t)}catch(e){}if(!i||!i.length)try{i=e("#"+t.replace(e.jstree.idregex,"\\$&"))}catch(e){}return i&&i.length&&(i=i.closest(".jstree")).length&&(i=i.data("jstree"))?n=i:e(".jstree").each((function(){var i=e(this).data("jstree");if(i&&i._model.data[t])return n=i,!1})),n},e.fn.jstree=function(n){var i="string"==typeof n,r=Array.prototype.slice.call(arguments,1),a=null;return!(!0===n&&!this.length)&&(this.each((function(){var o=e.jstree.reference(this),s=i&&o?o[n]:null;if(a=i&&s?s.apply(o,r):null,o||i||n!==t&&!e.isPlainObject(n)||e(this).data("jstree",new e.jstree.create(this,n)),(o&&!i||!0===n)&&(a=o||!1),null!==a&&a!==t)return!1})),null!==a&&a!==t?a:this)},e.expr[":"].jstree=e.expr.createPseudo((function(){return function(n){return e(n).hasClass("jstree")&&e(n).data("jstree")!==t}})),e.jstree.defaults.core={data:!1,strings:!1,check_callback:!1,error:e.noop,animation:200,multiple:!0,themes:{name:!1,url:!1,dir:!1,dots:!0,icons:!0,stripes:!1,variant:!1,responsive:!1},expand_selected_onload:!0,worker:!0,force_text:!1,dblclick_toggle:!0},e.jstree.core.prototype={plugin:function(t,n){var i=e.jstree.plugins[t];return i?(this._data[t]={},i.prototype=this,new i(n,this)):this},init:function(t,n){this._model={data:{"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}},changed:[],force_full_redraw:!1,redraw_timeout:!1,default_state:{loaded:!0,opened:!1,selected:!1,disabled:!1}},this.element=e(t).addClass("jstree jstree-"+this._id),this.settings=n,this._data.core.ready=!1,this._data.core.loaded=!1,this._data.core.rtl="rtl"===this.element.css("direction"),this.element[this._data.core.rtl?"addClass":"removeClass"]("jstree-rtl"),this.element.attr("role","tree"),this.settings.core.multiple&&this.element.attr("aria-multiselectable",!0),this.element.attr("tabindex")||this.element.attr("tabindex","0"),this.bind(),this.trigger("init"),this._data.core.original_container_html=this.element.find(" > ul > li").clone(!0),this._data.core.original_container_html.find("li").addBack().contents().filter((function(){return 3===this.nodeType&&(!this.nodeValue||/^\s+$/.test(this.nodeValue))})).remove(),this.element.html("<ul class='jstree-container-ul jstree-children' role='group'><li id='j"+this._id+"_loading' class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='tree-item'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading"),this._data.core.li_height=this.get_container_ul().children("li").first().height()||24,this.trigger("loading"),this.load_node("#")},destroy:function(e){if(this._wrk)try{window.URL.revokeObjectURL(this._wrk),this._wrk=null}catch(e){}e||this.element.empty(),this.teardown()},teardown:function(){this.unbind(),this.element.removeClass("jstree").removeData("jstree").find("[class^='jstree']").addBack().attr("class",(function(){return this.className.replace(/jstree[^ ]*|$/gi,"")})),this.element=null},bind:function(){var t="",n=null,i=0;this.element.on("dblclick.jstree",(function(){if(document.selection&&document.selection.empty)document.selection.empty();else if(window.getSelection){var e=window.getSelection();try{e.removeAllRanges(),e.collapse()}catch(e){}}})).on("mousedown.jstree",e.proxy((function(e){e.target===this.element[0]&&(e.preventDefault(),i=+new Date)}),this)).on("mousedown.jstree",".jstree-ocl",(function(e){e.preventDefault()})).on("click.jstree",".jstree-ocl",e.proxy((function(e){this.toggle_node(e.target)}),this)).on("dblclick.jstree",".jstree-anchor",e.proxy((function(e){this.settings.core.dblclick_toggle&&this.toggle_node(e.target)}),this)).on("click.jstree",".jstree-anchor",e.proxy((function(t){t.preventDefault(),t.currentTarget!==document.activeElement&&e(t.currentTarget).focus(),this.activate_node(t.currentTarget,t)}),this)).on("keydown.jstree",".jstree-anchor",e.proxy((function(t){if("INPUT"===t.target.tagName)return!0;var n=null;switch(this._data.core.rtl&&(37===t.which?t.which=39:39===t.which&&(t.which=37)),t.which){case 32:t.ctrlKey&&(t.type="click",e(t.currentTarget).trigger(t));break;case 13:t.type="click",e(t.currentTarget).trigger(t);break;case 37:t.preventDefault(),this.is_open(t.currentTarget)?this.close_node(t.currentTarget):(n=this.get_parent(t.currentTarget))&&"#"!==n.id&&this.get_node(n,!0).children(".jstree-anchor").focus();break;case 38:t.preventDefault(),(n=this.get_prev_dom(t.currentTarget))&&n.length&&n.children(".jstree-anchor").focus();break;case 39:t.preventDefault(),this.is_closed(t.currentTarget)?this.open_node(t.currentTarget,(function(e){this.get_node(e,!0).children(".jstree-anchor").focus()})):this.is_open(t.currentTarget)&&(n=this.get_node(t.currentTarget,!0).children(".jstree-children")[0])&&e(this._firstChild(n)).children(".jstree-anchor").focus();break;case 40:t.preventDefault(),(n=this.get_next_dom(t.currentTarget))&&n.length&&n.children(".jstree-anchor").focus();break;case 106:this.open_all();break;case 36:t.preventDefault(),(n=this._firstChild(this.get_container_ul()[0]))&&e(n).children(".jstree-anchor").filter(":visible").focus();break;case 35:t.preventDefault(),this.element.find(".jstree-anchor").filter(":visible").last().focus()}}),this)).on("load_node.jstree",e.proxy((function(t,n){n.status&&("#"!==n.node.id||this._data.core.loaded||(this._data.core.loaded=!0,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.trigger("loaded")),this._data.core.ready||setTimeout(e.proxy((function(){if(!this.get_container_ul().find(".jstree-loading").length){if(this._data.core.ready=!0,this._data.core.selected.length){if(this.settings.core.expand_selected_onload){var t,n,i=[];for(t=0,n=this._data.core.selected.length;t<n;t++)i=i.concat(this._model.data[this._data.core.selected[t]].parents);for(t=0,n=(i=e.vakata.array_unique(i)).length;t<n;t++)this.open_node(i[t],!1,0)}this.trigger("changed",{action:"ready",selected:this._data.core.selected})}this.trigger("ready")}}),this),0))}),this)).on("keypress.jstree",e.proxy((function(i){if("INPUT"===i.target.tagName)return!0;n&&clearTimeout(n),n=setTimeout((function(){t=""}),500);var r=String.fromCharCode(i.which).toLowerCase(),a=this.element.find(".jstree-anchor").filter(":visible"),o=a.index(document.activeElement)||0,s=!1;if((t+=r).length>1){if(a.slice(o).each(e.proxy((function(n,i){if(0===e(i).text().toLowerCase().indexOf(t))return e(i).focus(),s=!0,!1}),this)),s)return;if(a.slice(0,o).each(e.proxy((function(n,i){if(0===e(i).text().toLowerCase().indexOf(t))return e(i).focus(),s=!0,!1}),this)),s)return}if(new RegExp("^"+r+"+$").test(t)){if(a.slice(o+1).each(e.proxy((function(t,n){if(e(n).text().toLowerCase().charAt(0)===r)return e(n).focus(),s=!0,!1}),this)),s)return;if(a.slice(0,o+1).each(e.proxy((function(t,n){if(e(n).text().toLowerCase().charAt(0)===r)return e(n).focus(),s=!0,!1}),this)),s)return}}),this)).on("init.jstree",e.proxy((function(){var e=this.settings.core.themes;this._data.core.themes.dots=e.dots,this._data.core.themes.stripes=e.stripes,this._data.core.themes.icons=e.icons,this.set_theme(e.name||"default",e.url),this.set_theme_variant(e.variant)}),this)).on("loading.jstree",e.proxy((function(){this[this._data.core.themes.dots?"show_dots":"hide_dots"](),this[this._data.core.themes.icons?"show_icons":"hide_icons"](),this[this._data.core.themes.stripes?"show_stripes":"hide_stripes"]()}),this)).on("blur.jstree",".jstree-anchor",e.proxy((function(t){this._data.core.focused=null,e(t.currentTarget).filter(".jstree-hovered").mouseleave(),this.element.attr("tabindex","0")}),this)).on("focus.jstree",".jstree-anchor",e.proxy((function(t){var n=this.get_node(t.currentTarget);n&&n.id&&(this._data.core.focused=n.id),this.element.find(".jstree-hovered").not(t.currentTarget).mouseleave(),e(t.currentTarget).mouseenter(),this.element.attr("tabindex","-1")}),this)).on("focus.jstree",e.proxy((function(){+new Date-i>500&&!this._data.core.focused&&(i=0,this.get_node(this.element.attr("aria-activedescendant"),!0).find("> .jstree-anchor").focus())}),this)).on("mouseenter.jstree",".jstree-anchor",e.proxy((function(e){this.hover_node(e.currentTarget)}),this)).on("mouseleave.jstree",".jstree-anchor",e.proxy((function(e){this.dehover_node(e.currentTarget)}),this))},unbind:function(){this.element.off(".jstree"),e(document).off(".jstree-"+this._id)},trigger:function(e,t){t||(t={}),t.instance=this,this.element.triggerHandler(e.replace(".jstree","")+".jstree",t)},get_container:function(){return this.element},get_container_ul:function(){return this.element.children(".jstree-children").first()},get_string:function(t){var n=this.settings.core.strings;return e.isFunction(n)?n.call(this,t):n&&n[t]?n[t]:t},_firstChild:function(e){for(e=e?e.firstChild:null;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},_nextSibling:function(e){for(e=e?e.nextSibling:null;null!==e&&1!==e.nodeType;)e=e.nextSibling;return e},_previousSibling:function(e){for(e=e?e.previousSibling:null;null!==e&&1!==e.nodeType;)e=e.previousSibling;return e},get_node:function(t,n){var i;t&&t.id&&(t=t.id);try{if(this._model.data[t])t=this._model.data[t];else if("string"==typeof t&&this._model.data[t.replace(/^#/,"")])t=this._model.data[t.replace(/^#/,"")];else if("string"==typeof t&&(i=e("#"+t.replace(e.jstree.idregex,"\\$&"),this.element)).length&&this._model.data[i.closest(".jstree-node").attr("id")])t=this._model.data[i.closest(".jstree-node").attr("id")];else if((i=e(t,this.element)).length&&this._model.data[i.closest(".jstree-node").attr("id")])t=this._model.data[i.closest(".jstree-node").attr("id")];else{if(!(i=e(t,this.element)).length||!i.hasClass("jstree"))return!1;t=this._model.data["#"]}return n&&(t="#"===t.id?this.element:e("#"+t.id.replace(e.jstree.idregex,"\\$&"),this.element)),t}catch(e){return!1}},get_path:function(e,t,n){if(!(e=e.parents?e:this.get_node(e))||"#"===e.id||!e.parents)return!1;var i,r,a=[];for(a.push(n?e.id:e.text),i=0,r=e.parents.length;i<r;i++)a.push(n?e.parents[i]:this.get_text(e.parents[i]));return a=a.reverse().slice(1),t?a.join(t):a},get_next_dom:function(t,n){var i;if((t=this.get_node(t,!0))[0]===this.element[0]){for(i=this._firstChild(this.get_container_ul()[0]);i&&0===i.offsetHeight;)i=this._nextSibling(i);return!!i&&e(i)}if(!t||!t.length)return!1;if(n){i=t[0];do{i=this._nextSibling(i)}while(i&&0===i.offsetHeight);return!!i&&e(i)}if(t.hasClass("jstree-open")){for(i=this._firstChild(t.children(".jstree-children")[0]);i&&0===i.offsetHeight;)i=this._nextSibling(i);if(null!==i)return e(i)}i=t[0];do{i=this._nextSibling(i)}while(i&&0===i.offsetHeight);return null!==i?e(i):t.parentsUntil(".jstree",".jstree-node").next(".jstree-node:visible").first()},get_prev_dom:function(t,n){var i;if((t=this.get_node(t,!0))[0]===this.element[0]){for(i=this.get_container_ul()[0].lastChild;i&&0===i.offsetHeight;)i=this._previousSibling(i);return!!i&&e(i)}if(!t||!t.length)return!1;if(n){i=t[0];do{i=this._previousSibling(i)}while(i&&0===i.offsetHeight);return!!i&&e(i)}i=t[0];do{i=this._previousSibling(i)}while(i&&0===i.offsetHeight);if(null!==i){for(t=e(i);t.hasClass("jstree-open");)t=t.children(".jstree-children").first().children(".jstree-node:visible:last");return t}return!(!(i=t[0].parentNode.parentNode)||!i.className||-1===i.className.indexOf("jstree-node"))&&e(i)},get_parent:function(e){return!(!(e=this.get_node(e))||"#"===e.id)&&e.parent},get_children_dom:function(e){return(e=this.get_node(e,!0))[0]===this.element[0]?this.get_container_ul().children(".jstree-node"):!(!e||!e.length)&&e.children(".jstree-children").children(".jstree-node")},is_parent:function(e){return(e=this.get_node(e))&&(!1===e.state.loaded||e.children.length>0)},is_loaded:function(e){return(e=this.get_node(e))&&e.state.loaded},is_loading:function(e){return(e=this.get_node(e))&&e.state&&e.state.loading},is_open:function(e){return(e=this.get_node(e))&&e.state.opened},is_closed:function(e){return(e=this.get_node(e))&&this.is_parent(e)&&!e.state.opened},is_leaf:function(e){return!this.is_parent(e)},load_node:function(t,n){var i,r,a,o,s;if(e.isArray(t))return this._load_nodes(t.slice(),n),!0;if(!(t=this.get_node(t)))return n&&n.call(this,t,!1),!1;if(t.state.loaded){for(t.state.loaded=!1,i=0,r=t.children_d.length;i<r;i++){for(a=0,o=t.parents.length;a<o;a++)this._model.data[t.parents[a]].children_d=e.vakata.array_remove_item(this._model.data[t.parents[a]].children_d,t.children_d[i]);this._model.data[t.children_d[i]].state.selected&&(s=!0,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,t.children_d[i])),delete this._model.data[t.children_d[i]]}t.children=[],t.children_d=[],s&&this.trigger("changed",{action:"load_node",node:t,selected:this._data.core.selected})}return t.state.loading=!0,this.get_node(t,!0).addClass("jstree-loading").attr("aria-busy",!0),this._load_node(t,e.proxy((function(e){(t=this._model.data[t.id]).state.loading=!1,t.state.loaded=e;var i=this.get_node(t,!0);t.state.loaded&&!t.children.length&&i&&i.length&&!i.hasClass("jstree-leaf")&&i.removeClass("jstree-closed jstree-open").addClass("jstree-leaf"),i.removeClass("jstree-loading").attr("aria-busy",!1),this.trigger("load_node",{node:t,status:e}),n&&n.call(this,t,e)}),this)),!0},_load_nodes:function(e,t,n){var i,r,a=!0,o=function(){this._load_nodes(e,t,!0)},s=this._model.data;for(i=0,r=e.length;i<r;i++)!s[e[i]]||s[e[i]].state.loaded&&n||(this.is_loading(e[i])||this.load_node(e[i],o),a=!1);a&&t&&!t.done&&(t.call(this,e),t.done=!0)},load_all:function(e,t){if(e||(e="#"),!(e=this.get_node(e)))return!1;var n,i,r=[],a=this._model.data,o=a[e.id].children_d;for(e.state&&!e.state.loaded&&r.push(e.id),n=0,i=o.length;n<i;n++)a[o[n]]&&a[o[n]].state&&!a[o[n]].state.loaded&&r.push(o[n]);r.length?this._load_nodes(r,(function(){this.load_all(e,t)})):(t&&t.call(this,e),this.trigger("load_all",{node:e}))},_load_node:function(t,n){var i,r=this.settings.core.data;return r?e.isFunction(r)?r.call(this,t,e.proxy((function(i){!1===i&&n.call(this,!1),this["string"==typeof i?"_append_html_data":"_append_json_data"](t,"string"==typeof i?e(i):i,(function(e){n.call(this,e)}))}),this)):"object"==typeof r?r.url?(r=e.extend(!0,{},r),e.isFunction(r.url)&&(r.url=r.url.call(this,t)),e.isFunction(r.data)&&(r.data=r.data.call(this,t)),e.ajax(r).done(e.proxy((function(i,r,a){var o=a.getResponseHeader("Content-Type");return-1!==o.indexOf("json")||"object"==typeof i?this._append_json_data(t,i,(function(e){n.call(this,e)})):-1!==o.indexOf("html")||"string"==typeof i?this._append_html_data(t,e(i),(function(e){n.call(this,e)})):(this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:a})},this.settings.core.error.call(this,this._data.core.last_error),n.call(this,!1))}),this)).fail(e.proxy((function(e){n.call(this,!1),this._data.core.last_error={error:"ajax",plugin:"core",id:"core_04",reason:"Could not load node",data:JSON.stringify({id:t.id,xhr:e})},this.settings.core.error.call(this,this._data.core.last_error)}),this))):(i=e.isArray(r)||e.isPlainObject(r)?JSON.parse(JSON.stringify(r)):r,"#"===t.id?this._append_json_data(t,i,(function(e){n.call(this,e)})):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_05",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),n.call(this,!1))):"string"==typeof r?"#"===t.id?this._append_html_data(t,e(r),(function(e){n.call(this,e)})):(this._data.core.last_error={error:"nodata",plugin:"core",id:"core_06",reason:"Could not load node",data:JSON.stringify({id:t.id})},this.settings.core.error.call(this,this._data.core.last_error),n.call(this,!1)):n.call(this,!1):"#"===t.id?this._append_html_data(t,this._data.core.original_container_html.clone(!0),(function(e){n.call(this,e)})):n.call(this,!1)},_node_changed:function(e){(e=this.get_node(e))&&this._model.changed.push(e.id)},_append_html_data:function(t,n,i){(t=this.get_node(t)).children=[],t.children_d=[];var r,a,o,s=n.is("ul")?n.children():n,l=t.id,d=[],c=[],u=this._model.data,f=u[l],h=this._data.core.selected.length;for(s.each(e.proxy((function(t,n){(r=this._parse_model_from_html(e(n),l,f.parents.concat()))&&(d.push(r),c.push(r),u[r].children_d.length&&(c=c.concat(u[r].children_d)))}),this)),f.children=d,f.children_d=c,a=0,o=f.parents.length;a<o;a++)u[f.parents[a]].children_d=u[f.parents[a]].children_d.concat(c);this.trigger("model",{nodes:c,parent:l}),"#"!==l?(this._node_changed(l),this.redraw()):(this.get_container_ul().children(".jstree-initial-node").remove(),this.redraw(!0)),this._data.core.selected.length!==h&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),i.call(this,!0)},_append_json_data:function(t,n,i,r){(t=this.get_node(t)).children=[],t.children_d=[],n.d&&"string"==typeof(n=n.d)&&(n=JSON.parse(n)),e.isArray(n)||(n=[n]);var a=null,o={df:this._model.default_state,dat:n,par:t.id,m:this._model.data,t_id:this._id,t_cnt:this._cnt,sel:this._data.core.selected},s=function(e,t){e.data&&(e=e.data);var n,i,r,a,o=e.dat,s=e.par,l=[],d=[],c=[],u=e.df,f=e.t_id,h=e.t_cnt,p=e.m,g=p[s],m=e.sel,v=function(e,n,i){i=i?i.concat():[],n&&i.unshift(n);var r,a,o,s,l=e.id.toString(),d={id:l,text:e.text||"",icon:e.icon===t||e.icon,parent:n,parents:i,children:e.children||[],children_d:e.children_d||[],data:e.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(r in u)u.hasOwnProperty(r)&&(d.state[r]=u[r]);if(e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(d.icon=e.data.jstree.icon),e&&e.data&&(d.data=e.data,e.data.jstree))for(r in e.data.jstree)e.data.jstree.hasOwnProperty(r)&&(d.state[r]=e.data.jstree[r]);if(e&&"object"==typeof e.state)for(r in e.state)e.state.hasOwnProperty(r)&&(d.state[r]=e.state[r]);if(e&&"object"==typeof e.li_attr)for(r in e.li_attr)e.li_attr.hasOwnProperty(r)&&(d.li_attr[r]=e.li_attr[r]);if(d.li_attr.id||(d.li_attr.id=l),e&&"object"==typeof e.a_attr)for(r in e.a_attr)e.a_attr.hasOwnProperty(r)&&(d.a_attr[r]=e.a_attr[r]);for(e&&e.children&&!0===e.children&&(d.state.loaded=!1,d.children=[],d.children_d=[]),p[d.id]=d,r=0,a=d.children.length;r<a;r++)o=v(p[d.children[r]],d.id,i),s=p[o],d.children_d.push(o),s.children_d.length&&(d.children_d=d.children_d.concat(s.children_d));return delete e.data,delete e.children,p[d.id].original=e,d.state.selected&&c.push(d.id),d.id},y=function(e,n,i){i=i?i.concat():[],n&&i.unshift(n);var r,a,o,s,l,d=!1;do{d="j"+f+"_"+ ++h}while(p[d]);for(r in l={id:!1,text:"string"==typeof e?e:"",icon:"object"!=typeof e||e.icon===t||e.icon,parent:n,parents:i,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},u)u.hasOwnProperty(r)&&(l.state[r]=u[r]);if(e&&e.id&&(l.id=e.id.toString()),e&&e.text&&(l.text=e.text),e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(l.icon=e.data.jstree.icon),e&&e.data&&(l.data=e.data,e.data.jstree))for(r in e.data.jstree)e.data.jstree.hasOwnProperty(r)&&(l.state[r]=e.data.jstree[r]);if(e&&"object"==typeof e.state)for(r in e.state)e.state.hasOwnProperty(r)&&(l.state[r]=e.state[r]);if(e&&"object"==typeof e.li_attr)for(r in e.li_attr)e.li_attr.hasOwnProperty(r)&&(l.li_attr[r]=e.li_attr[r]);if(l.li_attr.id&&!l.id&&(l.id=l.li_attr.id.toString()),l.id||(l.id=d),l.li_attr.id||(l.li_attr.id=l.id),e&&"object"==typeof e.a_attr)for(r in e.a_attr)e.a_attr.hasOwnProperty(r)&&(l.a_attr[r]=e.a_attr[r]);if(e&&e.children&&e.children.length){for(r=0,a=e.children.length;r<a;r++)o=y(e.children[r],l.id,i),s=p[o],l.children.push(o),s.children_d.length&&(l.children_d=l.children_d.concat(s.children_d));l.children_d=l.children_d.concat(l.children)}return e&&e.children&&!0===e.children&&(l.state.loaded=!1,l.children=[],l.children_d=[]),delete e.data,delete e.children,l.original=e,p[l.id]=l,l.state.selected&&c.push(l.id),l.id};if(o.length&&o[0].id!==t&&o[0].parent!==t){for(i=0,r=o.length;i<r;i++)o[i].children||(o[i].children=[]),p[o[i].id.toString()]=o[i];for(i=0,r=o.length;i<r;i++)p[o[i].parent.toString()].children.push(o[i].id.toString()),g.children_d.push(o[i].id.toString());for(i=0,r=g.children.length;i<r;i++)n=v(p[g.children[i]],s,g.parents.concat()),d.push(n),p[n].children_d.length&&(d=d.concat(p[n].children_d));for(i=0,r=g.parents.length;i<r;i++)p[g.parents[i]].children_d=p[g.parents[i]].children_d.concat(d);a={cnt:h,mod:p,sel:m,par:s,dpc:d,add:c}}else{for(i=0,r=o.length;i<r;i++)(n=y(o[i],s,g.parents.concat()))&&(l.push(n),d.push(n),p[n].children_d.length&&(d=d.concat(p[n].children_d)));for(g.children=l,g.children_d=d,i=0,r=g.parents.length;i<r;i++)p[g.parents[i]].children_d=p[g.parents[i]].children_d.concat(d);a={cnt:h,mod:p,sel:m,par:s,dpc:d,add:c}}if("undefined"!=typeof window&&void 0!==window.document)return a;postMessage(a)},l=function(t,n){if(this._cnt=t.cnt,this._model.data=t.mod,n){var r,a,o=t.add,s=t.sel,l=this._data.core.selected.slice(),d=this._model.data;if(s.length!==l.length||e.vakata.array_unique(s.concat(l)).length!==s.length){for(r=0,a=s.length;r<a;r++)-1===e.inArray(s[r],o)&&-1===e.inArray(s[r],l)&&(d[s[r]].state.selected=!1);for(r=0,a=l.length;r<a;r++)-1===e.inArray(l[r],s)&&(d[l[r]].state.selected=!0)}}t.add.length&&(this._data.core.selected=this._data.core.selected.concat(t.add)),this.trigger("model",{nodes:t.dpc,parent:t.par}),"#"!==t.par?(this._node_changed(t.par),this.redraw()):this.redraw(!0),t.add.length&&this.trigger("changed",{action:"model",selected:this._data.core.selected}),i.call(this,!0)};if(this.settings.core.worker&&window.Blob&&window.URL&&window.Worker)try{null===this._wrk&&(this._wrk=window.URL.createObjectURL(new window.Blob(["self.onmessage = "+s.toString()],{type:"text/javascript"}))),!this._data.core.working||r?(this._data.core.working=!0,(a=new window.Worker(this._wrk)).onmessage=e.proxy((function(e){l.call(this,e.data,!0);try{a.terminate(),a=null}catch(e){}this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}),this),o.par?a.postMessage(o):this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1):this._data.core.worker_queue.push([t,n,i,!0])}catch(e){l.call(this,s(o),!1),this._data.core.worker_queue.length?this._append_json_data.apply(this,this._data.core.worker_queue.shift()):this._data.core.working=!1}else l.call(this,s(o),!1)},_parse_model_from_html:function(t,n,i){i=i?[].concat(i):[],n&&i.unshift(n);var r,a,o,s,l,d=this._model.data,c={id:!1,text:!1,icon:!0,parent:n,parents:i,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(o in this._model.default_state)this._model.default_state.hasOwnProperty(o)&&(c.state[o]=this._model.default_state[o]);if(s=e.vakata.attributes(t,!0),e.each(s,(function(t,n){if(!(n=e.trim(n)).length)return!0;c.li_attr[t]=n,"id"===t&&(c.id=n.toString())})),(s=t.children("a").first()).length&&(s=e.vakata.attributes(s,!0),e.each(s,(function(t,n){(n=e.trim(n)).length&&(c.a_attr[t]=n)}))),(s=t.children("a").first().length?t.children("a").first().clone():t.clone()).children("ins, i, ul").remove(),s=s.html(),s=e("<div />").html(s),c.text=this.settings.core.force_text?s.text():s.html(),s=t.data(),c.data=s?e.extend(!0,{},s):null,c.state.opened=t.hasClass("jstree-open"),c.state.selected=t.children("a").hasClass("jstree-clicked"),c.state.disabled=t.children("a").hasClass("jstree-disabled"),c.data&&c.data.jstree)for(o in c.data.jstree)c.data.jstree.hasOwnProperty(o)&&(c.state[o]=c.data.jstree[o]);(s=t.children("a").children(".jstree-themeicon")).length&&(c.icon=!s.hasClass("jstree-themeicon-hidden")&&s.attr("rel")),c.state.icon&&(c.icon=c.state.icon),s=t.children("ul").children("li");do{l="j"+this._id+"_"+ ++this._cnt}while(d[l]);return c.id=c.li_attr.id?c.li_attr.id.toString():l,s.length?(s.each(e.proxy((function(t,n){r=this._parse_model_from_html(e(n),c.id,i),a=this._model.data[r],c.children.push(r),a.children_d.length&&(c.children_d=c.children_d.concat(a.children_d))}),this)),c.children_d=c.children_d.concat(c.children)):t.hasClass("jstree-closed")&&(c.state.loaded=!1),c.li_attr.class&&(c.li_attr.class=c.li_attr.class.replace("jstree-closed","").replace("jstree-open","")),c.a_attr.class&&(c.a_attr.class=c.a_attr.class.replace("jstree-clicked","").replace("jstree-disabled","")),d[c.id]=c,c.state.selected&&this._data.core.selected.push(c.id),c.id},_parse_model_from_flat_json:function(e,n,i){i=i?i.concat():[],n&&i.unshift(n);var r,a,o,s,l=e.id.toString(),d=this._model.data,c=this._model.default_state,u={id:l,text:e.text||"",icon:e.icon===t||e.icon,parent:n,parents:i,children:e.children||[],children_d:e.children_d||[],data:e.data,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1};for(r in c)c.hasOwnProperty(r)&&(u.state[r]=c[r]);if(e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(u.icon=e.data.jstree.icon),e&&e.data&&(u.data=e.data,e.data.jstree))for(r in e.data.jstree)e.data.jstree.hasOwnProperty(r)&&(u.state[r]=e.data.jstree[r]);if(e&&"object"==typeof e.state)for(r in e.state)e.state.hasOwnProperty(r)&&(u.state[r]=e.state[r]);if(e&&"object"==typeof e.li_attr)for(r in e.li_attr)e.li_attr.hasOwnProperty(r)&&(u.li_attr[r]=e.li_attr[r]);if(u.li_attr.id||(u.li_attr.id=l),e&&"object"==typeof e.a_attr)for(r in e.a_attr)e.a_attr.hasOwnProperty(r)&&(u.a_attr[r]=e.a_attr[r]);for(e&&e.children&&!0===e.children&&(u.state.loaded=!1,u.children=[],u.children_d=[]),d[u.id]=u,r=0,a=u.children.length;r<a;r++)s=d[o=this._parse_model_from_flat_json(d[u.children[r]],u.id,i)],u.children_d.push(o),s.children_d.length&&(u.children_d=u.children_d.concat(s.children_d));return delete e.data,delete e.children,d[u.id].original=e,u.state.selected&&this._data.core.selected.push(u.id),u.id},_parse_model_from_json:function(e,n,i){i=i?i.concat():[],n&&i.unshift(n);var r,a,o,s,l,d=!1,c=this._model.data,u=this._model.default_state;do{d="j"+this._id+"_"+ ++this._cnt}while(c[d]);for(r in l={id:!1,text:"string"==typeof e?e:"",icon:"object"!=typeof e||e.icon===t||e.icon,parent:n,parents:i,children:[],children_d:[],data:null,state:{},li_attr:{id:!1},a_attr:{href:"#"},original:!1},u)u.hasOwnProperty(r)&&(l.state[r]=u[r]);if(e&&e.id&&(l.id=e.id.toString()),e&&e.text&&(l.text=e.text),e&&e.data&&e.data.jstree&&e.data.jstree.icon&&(l.icon=e.data.jstree.icon),e&&e.data&&(l.data=e.data,e.data.jstree))for(r in e.data.jstree)e.data.jstree.hasOwnProperty(r)&&(l.state[r]=e.data.jstree[r]);if(e&&"object"==typeof e.state)for(r in e.state)e.state.hasOwnProperty(r)&&(l.state[r]=e.state[r]);if(e&&"object"==typeof e.li_attr)for(r in e.li_attr)e.li_attr.hasOwnProperty(r)&&(l.li_attr[r]=e.li_attr[r]);if(l.li_attr.id&&!l.id&&(l.id=l.li_attr.id.toString()),l.id||(l.id=d),l.li_attr.id||(l.li_attr.id=l.id),e&&"object"==typeof e.a_attr)for(r in e.a_attr)e.a_attr.hasOwnProperty(r)&&(l.a_attr[r]=e.a_attr[r]);if(e&&e.children&&e.children.length){for(r=0,a=e.children.length;r<a;r++)s=c[o=this._parse_model_from_json(e.children[r],l.id,i)],l.children.push(o),s.children_d.length&&(l.children_d=l.children_d.concat(s.children_d));l.children_d=l.children_d.concat(l.children)}return e&&e.children&&!0===e.children&&(l.state.loaded=!1,l.children=[],l.children_d=[]),delete e.data,delete e.children,l.original=e,c[l.id]=l,l.state.selected&&this._data.core.selected.push(l.id),l.id},_redraw:function(){var e,t,n,i=this._model.force_full_redraw?this._model.data["#"].children.concat([]):this._model.changed.concat([]),r=document.createElement("UL"),a=this._data.core.focused;for(t=0,n=i.length;t<n;t++)(e=this.redraw_node(i[t],!0,this._model.force_full_redraw))&&this._model.force_full_redraw&&r.appendChild(e);this._model.force_full_redraw&&(r.className=this.get_container_ul()[0].className,r.setAttribute("role","group"),this.element.empty().append(r)),null!==a&&((e=this.get_node(a,!0))&&e.length&&e.children(".jstree-anchor")[0]!==document.activeElement?e.children(".jstree-anchor").focus():this._data.core.focused=null),this._model.force_full_redraw=!1,this._model.changed=[],this.trigger("redraw",{nodes:i})},redraw:function(e){e&&(this._model.force_full_redraw=!0),this._redraw()},draw_children:function(e){var t=this.get_node(e),n=!1,i=!1,r=!1,a=document;if(!t)return!1;if("#"===t.id)return this.redraw(!0);if(!(e=this.get_node(e,!0))||!e.length)return!1;if(e.children(".jstree-children").remove(),e=e[0],t.children.length&&t.state.loaded){for((r=a.createElement("UL")).setAttribute("role","group"),r.className="jstree-children",n=0,i=t.children.length;n<i;n++)r.appendChild(this.redraw_node(t.children[n],!0,!0));e.appendChild(r)}},redraw_node:function(t,n,i,r){var a=this.get_node(t),o=!1,s=!1,l=!1,d=!1,c=!1,f=!1,h="",p=document,g=this._model.data,m=!1,v=null,y=0,_=0;if(!a)return!1;if("#"===a.id)return this.redraw(!0);if(n=n||0===a.children.length,t=document.querySelector?this.element[0].querySelector("#"+(-1!=="0123456789".indexOf(a.id[0])?"\\3"+a.id[0]+" "+a.id.substr(1).replace(e.jstree.idregex,"\\$&"):a.id.replace(e.jstree.idregex,"\\$&"))):document.getElementById(a.id))t=e(t),i||((o=t.parent().parent()[0])===this.element[0]&&(o=null),s=t.index()),n||!a.children.length||t.children(".jstree-children").length||(n=!0),n||(l=t.children(".jstree-children")[0]),m=t.children(".jstree-anchor")[0]===document.activeElement,t.remove();else if(n=!0,!i){if(!(null===(o="#"!==a.parent?e("#"+a.parent.replace(e.jstree.idregex,"\\$&"),this.element)[0]:null)||o&&g[a.parent].state.opened))return!1;s=e.inArray(a.id,null===o?g["#"].children:g[a.parent].children)}for(d in t=u.cloneNode(!0),h="jstree-node ",a.li_attr)if(a.li_attr.hasOwnProperty(d)){if("id"===d)continue;"class"!==d?t.setAttribute(d,a.li_attr[d]):h+=a.li_attr[d]}for(c in a.a_attr.id||(a.a_attr.id=a.id+"_anchor"),t.setAttribute("aria-selected",!!a.state.selected),t.setAttribute("aria-level",a.parents.length),t.setAttribute("aria-labelledby",a.a_attr.id),a.state.disabled&&t.setAttribute("aria-disabled",!0),a.state.loaded&&!a.children.length?h+=" jstree-leaf":(h+=a.state.opened&&a.state.loaded?" jstree-open":" jstree-closed",t.setAttribute("aria-expanded",a.state.opened&&a.state.loaded)),null!==a.parent&&g[a.parent].children[g[a.parent].children.length-1]===a.id&&(h+=" jstree-last"),t.id=a.id,t.className=h,h=(a.state.selected?" jstree-clicked":"")+(a.state.disabled?" jstree-disabled":""),a.a_attr)if(a.a_attr.hasOwnProperty(c)){if("href"===c&&"#"===a.a_attr[c])continue;"class"!==c?t.childNodes[1].setAttribute(c,a.a_attr[c]):h+=" "+a.a_attr[c]}if(h.length&&(t.childNodes[1].className="jstree-anchor "+h),(a.icon&&!0!==a.icon||!1===a.icon)&&(!1===a.icon?t.childNodes[1].childNodes[0].className+=" jstree-themeicon-hidden":-1===a.icon.indexOf("/")&&-1===a.icon.indexOf(".")?t.childNodes[1].childNodes[0].className+=" "+a.icon+" jstree-themeicon-custom":(t.childNodes[1].childNodes[0].style.backgroundImage="url("+a.icon+")",t.childNodes[1].childNodes[0].style.backgroundPosition="center center",t.childNodes[1].childNodes[0].style.backgroundSize="auto",t.childNodes[1].childNodes[0].className+=" jstree-themeicon-custom")),this.settings.core.force_text?t.childNodes[1].appendChild(p.createTextNode(a.text)):t.childNodes[1].innerHTML+=a.text,n&&a.children.length&&(a.state.opened||r)&&a.state.loaded){
for((f=p.createElement("UL")).setAttribute("role","group"),f.className="jstree-children",d=0,c=a.children.length;d<c;d++)f.appendChild(this.redraw_node(a.children[d],n,!0));t.appendChild(f)}if(l&&t.appendChild(l),!i){for(o||(o=this.element[0]),d=0,c=o.childNodes.length;d<c;d++)if(o.childNodes[d]&&o.childNodes[d].className&&-1!==o.childNodes[d].className.indexOf("jstree-children")){v=o.childNodes[d];break}v||((v=p.createElement("UL")).setAttribute("role","group"),v.className="jstree-children",o.appendChild(v)),s<(o=v).childNodes.length?o.insertBefore(t,o.childNodes[s]):o.appendChild(t),m&&(y=this.element[0].scrollTop,_=this.element[0].scrollLeft,t.childNodes[1].focus(),this.element[0].scrollTop=y,this.element[0].scrollLeft=_)}return a.state.opened&&!a.state.loaded&&(a.state.opened=!1,setTimeout(e.proxy((function(){this.open_node(a.id,!1,0)}),this),0)),t},open_node:function(n,i,r){var a,o,s,l;if(e.isArray(n)){for(a=0,o=(n=n.slice()).length;a<o;a++)this.open_node(n[a],i,r);return!0}if(!(n=this.get_node(n))||"#"===n.id)return!1;if(r=r===t?this.settings.core.animation:r,!this.is_closed(n))return i&&i.call(this,n,!1),!1;if(this.is_loaded(n))s=this.get_node(n,!0),l=this,s.length&&(r&&s.children(".jstree-children").length&&s.children(".jstree-children").stop(!0,!0),n.children.length&&!this._firstChild(s.children(".jstree-children")[0])&&this.draw_children(n),r?(this.trigger("before_open",{node:n}),s.children(".jstree-children").css("display","none").end().removeClass("jstree-closed").addClass("jstree-open").attr("aria-expanded",!0).children(".jstree-children").stop(!0,!0).slideDown(r,(function(){this.style.display="",l.trigger("after_open",{node:n})}))):(this.trigger("before_open",{node:n}),s[0].className=s[0].className.replace("jstree-closed","jstree-open"),s[0].setAttribute("aria-expanded",!0))),n.state.opened=!0,i&&i.call(this,n,!0),s.length||this.trigger("before_open",{node:n}),this.trigger("open_node",{node:n}),r&&s.length||this.trigger("after_open",{node:n});else{if(this.is_loading(n))return setTimeout(e.proxy((function(){this.open_node(n,i,r)}),this),500);this.load_node(n,(function(e,t){return t?this.open_node(e,i,r):!!i&&i.call(this,e,!1)}))}},_open_to:function(t){if(!(t=this.get_node(t))||"#"===t.id)return!1;var n,i,r=t.parents;for(n=0,i=r.length;n<i;n+=1)"#"!==n&&this.open_node(r[n],!1,0);return e("#"+t.id.replace(e.jstree.idregex,"\\$&"),this.element)},close_node:function(n,i){var r,a,o,s;if(e.isArray(n)){for(r=0,a=(n=n.slice()).length;r<a;r++)this.close_node(n[r],i);return!0}return!(!(n=this.get_node(n))||"#"===n.id)&&(!this.is_closed(n)&&(i=i===t?this.settings.core.animation:i,o=this,(s=this.get_node(n,!0)).length&&(i?s.children(".jstree-children").attr("style","display:block !important").end().removeClass("jstree-open").addClass("jstree-closed").attr("aria-expanded",!1).children(".jstree-children").stop(!0,!0).slideUp(i,(function(){this.style.display="",s.children(".jstree-children").remove(),o.trigger("after_close",{node:n})})):(s[0].className=s[0].className.replace("jstree-open","jstree-closed"),s.attr("aria-expanded",!1).children(".jstree-children").remove())),n.state.opened=!1,this.trigger("close_node",{node:n}),void(i&&s.length||this.trigger("after_close",{node:n}))))},toggle_node:function(t){var n,i;if(e.isArray(t)){for(n=0,i=(t=t.slice()).length;n<i;n++)this.toggle_node(t[n]);return!0}return this.is_closed(t)?this.open_node(t):this.is_open(t)?this.close_node(t):void 0},open_all:function(e,t,n){if(e||(e="#"),!(e=this.get_node(e)))return!1;var i,r,a,o="#"===e.id?this.get_container_ul():this.get_node(e,!0);if(!o.length){for(i=0,r=e.children_d.length;i<r;i++)this.is_closed(this._model.data[e.children_d[i]])&&(this._model.data[e.children_d[i]].state.opened=!0);return this.trigger("open_all",{node:e})}n=n||o,a=this,(o=this.is_closed(e)?o.find(".jstree-closed").addBack():o.find(".jstree-closed")).each((function(){a.open_node(this,(function(e,i){i&&this.is_parent(e)&&this.open_all(e,t,n)}),t||0)})),0===n.find(".jstree-closed").length&&this.trigger("open_all",{node:this.get_node(n)})},close_all:function(t,n){if(t||(t="#"),!(t=this.get_node(t)))return!1;var i,r,a="#"===t.id?this.get_container_ul():this.get_node(t,!0),o=this;if(!a.length){for(i=0,r=t.children_d.length;i<r;i++)this._model.data[t.children_d[i]].state.opened=!1;return this.trigger("close_all",{node:t})}a=this.is_open(t)?a.find(".jstree-open").addBack():a.find(".jstree-open"),e(a.get().reverse()).each((function(){o.close_node(this,n||0)})),this.trigger("close_all",{node:t})},is_disabled:function(e){return(e=this.get_node(e))&&e.state&&e.state.disabled},enable_node:function(t){var n,i;if(e.isArray(t)){for(n=0,i=(t=t.slice()).length;n<i;n++)this.enable_node(t[n]);return!0}if(!(t=this.get_node(t))||"#"===t.id)return!1;t.state.disabled=!1,this.get_node(t,!0).children(".jstree-anchor").removeClass("jstree-disabled").attr("aria-disabled",!1),this.trigger("enable_node",{node:t})},disable_node:function(t){var n,i;if(e.isArray(t)){for(n=0,i=(t=t.slice()).length;n<i;n++)this.disable_node(t[n]);return!0}if(!(t=this.get_node(t))||"#"===t.id)return!1;t.state.disabled=!0,this.get_node(t,!0).children(".jstree-anchor").addClass("jstree-disabled").attr("aria-disabled",!0),this.trigger("disable_node",{node:t})},activate_node:function(e,n){if(this.is_disabled(e))return!1;if(this._data.core.last_clicked=this._data.core.last_clicked&&this._data.core.last_clicked.id!==t?this.get_node(this._data.core.last_clicked.id):null,this._data.core.last_clicked&&!this._data.core.last_clicked.state.selected&&(this._data.core.last_clicked=null),!this._data.core.last_clicked&&this._data.core.selected.length&&(this._data.core.last_clicked=this.get_node(this._data.core.selected[this._data.core.selected.length-1])),this.settings.core.multiple&&(n.metaKey||n.ctrlKey||n.shiftKey)&&(!n.shiftKey||this._data.core.last_clicked&&this.get_parent(e)&&this.get_parent(e)===this._data.core.last_clicked.parent))if(n.shiftKey){var i,r,a=this.get_node(e).id,o=this._data.core.last_clicked.id,s=this.get_node(this._data.core.last_clicked.parent).children,l=!1;for(i=0,r=s.length;i<r;i+=1)s[i]===a&&(l=!l),s[i]===o&&(l=!l),l||s[i]===a||s[i]===o?this.select_node(s[i],!0,!1,n):this.deselect_node(s[i],!0,n);this.trigger("changed",{action:"select_node",node:this.get_node(e),selected:this._data.core.selected,event:n})}else this.is_selected(e)?this.deselect_node(e,!1,n):this.select_node(e,!1,!1,n);else!this.settings.core.multiple&&(n.metaKey||n.ctrlKey||n.shiftKey)&&this.is_selected(e)?this.deselect_node(e,!1,n):(this.deselect_all(!0),this.select_node(e,!1,!1,n),this._data.core.last_clicked=this.get_node(e));this.trigger("activate_node",{node:this.get_node(e)})},hover_node:function(e){if(!(e=this.get_node(e,!0))||!e.length||e.children(".jstree-hovered").length)return!1;var t=this.element.find(".jstree-hovered"),n=this.element;t&&t.length&&this.dehover_node(t),e.children(".jstree-anchor").addClass("jstree-hovered"),this.trigger("hover_node",{node:this.get_node(e)}),setTimeout((function(){n.attr("aria-activedescendant",e[0].id)}),0)},dehover_node:function(e){if(!(e=this.get_node(e,!0))||!e.length||!e.children(".jstree-hovered").length)return!1;e.children(".jstree-anchor").removeClass("jstree-hovered"),this.trigger("dehover_node",{node:this.get_node(e)})},select_node:function(t,n,i,r){var a,o,s;if(e.isArray(t)){for(o=0,s=(t=t.slice()).length;o<s;o++)this.select_node(t[o],n,i,r);return!0}if(!(t=this.get_node(t))||"#"===t.id)return!1;a=this.get_node(t,!0),t.state.selected||(t.state.selected=!0,this._data.core.selected.push(t.id),i||(a=this._open_to(t)),a&&a.length&&a.attr("aria-selected",!0).children(".jstree-anchor").addClass("jstree-clicked"),this.trigger("select_node",{node:t,selected:this._data.core.selected,event:r}),n||this.trigger("changed",{action:"select_node",node:t,selected:this._data.core.selected,event:r}))},deselect_node:function(t,n,i){var r,a,o;if(e.isArray(t)){for(r=0,a=(t=t.slice()).length;r<a;r++)this.deselect_node(t[r],n,i);return!0}if(!(t=this.get_node(t))||"#"===t.id)return!1;o=this.get_node(t,!0),t.state.selected&&(t.state.selected=!1,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,t.id),o.length&&o.attr("aria-selected",!1).children(".jstree-anchor").removeClass("jstree-clicked"),this.trigger("deselect_node",{node:t,selected:this._data.core.selected,event:i}),n||this.trigger("changed",{action:"deselect_node",node:t,selected:this._data.core.selected,event:i}))},select_all:function(e){var t,n,i=this._data.core.selected.concat([]);for(this._data.core.selected=this._model.data["#"].children_d.concat(),t=0,n=this._data.core.selected.length;t<n;t++)this._model.data[this._data.core.selected[t]]&&(this._model.data[this._data.core.selected[t]].state.selected=!0);this.redraw(!0),this.trigger("select_all",{selected:this._data.core.selected}),e||this.trigger("changed",{action:"select_all",selected:this._data.core.selected,old_selection:i})},deselect_all:function(e){var t,n,i=this._data.core.selected.concat([]);for(t=0,n=this._data.core.selected.length;t<n;t++)this._model.data[this._data.core.selected[t]]&&(this._model.data[this._data.core.selected[t]].state.selected=!1);this._data.core.selected=[],this.element.find(".jstree-clicked").removeClass("jstree-clicked").parent().attr("aria-selected",!1),this.trigger("deselect_all",{selected:this._data.core.selected,node:i}),e||this.trigger("changed",{action:"deselect_all",selected:this._data.core.selected,old_selection:i})},is_selected:function(e){return!(!(e=this.get_node(e))||"#"===e.id)&&e.state.selected},get_selected:function(t){return t?e.map(this._data.core.selected,e.proxy((function(e){return this.get_node(e)}),this)):this._data.core.selected.slice()},get_top_selected:function(t){var n,i,r,a,o=this.get_selected(!0),s={};for(n=0,i=o.length;n<i;n++)s[o[n].id]=o[n];for(n=0,i=o.length;n<i;n++)for(r=0,a=o[n].children_d.length;r<a;r++)s[o[n].children_d[r]]&&delete s[o[n].children_d[r]];for(n in o=[],s)s.hasOwnProperty(n)&&o.push(n);return t?e.map(o,e.proxy((function(e){return this.get_node(e)}),this)):o},get_bottom_selected:function(t){var n,i,r=this.get_selected(!0),a=[];for(n=0,i=r.length;n<i;n++)r[n].children.length||a.push(r[n].id);return t?e.map(a,e.proxy((function(e){return this.get_node(e)}),this)):a},get_state:function(){var e,t={core:{open:[],scroll:{left:this.element.scrollLeft(),top:this.element.scrollTop()},
/*!
					'themes' : {
						'name' : this.get_theme(),
						'icons' : this._data.core.themes.icons,
						'dots' : this._data.core.themes.dots
					},
					*/
selected:[]}};for(e in this._model.data)this._model.data.hasOwnProperty(e)&&"#"!==e&&(this._model.data[e].state.opened&&t.core.open.push(e),this._model.data[e].state.selected&&t.core.selected.push(e));return t},set_state:function(n,i){if(n){if(n.core){var r,a,o;if(n.core.open)return e.isArray(n.core.open)?(r=!0,!1,a=this,e.each(n.core.open.concat([]),(function(t,o){a.get_node(o)&&(a.is_loaded(o)?(a.is_closed(o)&&a.open_node(o,!1,0),n&&n.core&&n.core.open&&e.vakata.array_remove_item(n.core.open,o)):(a.is_loading(o)||a.open_node(o,e.proxy((function(t,r){!r&&n&&n.core&&n.core.open&&e.vakata.array_remove_item(n.core.open,t.id),this.set_state(n,i)}),a),0),r=!1))})),r&&(delete n.core.open,this.set_state(n,i)),!1):(delete n.core.open,this.set_state(n,i),!1);if(n.core.scroll)return n.core.scroll&&n.core.scroll.left!==t&&this.element.scrollLeft(n.core.scroll.left),n.core.scroll&&n.core.scroll.top!==t&&this.element.scrollTop(n.core.scroll.top),delete n.core.scroll,this.set_state(n,i),!1;
/*!
					if(state.core.themes) {
						if(state.core.themes.name) {
							this.set_theme(state.core.themes.name);
						}
						if(typeof state.core.themes.dots !== 'undefined') {
							this[ state.core.themes.dots ? "show_dots" : "hide_dots" ]();
						}
						if(typeof state.core.themes.icons !== 'undefined') {
							this[ state.core.themes.icons ? "show_icons" : "hide_icons" ]();
						}
						delete state.core.themes;
						delete state.core.open;
						this.set_state(state, callback);
						return false;
					}
					*/if(n.core.selected)return o=this,this.deselect_all(),e.each(n.core.selected,(function(e,t){o.select_node(t)})),delete n.core.selected,this.set_state(n,i),!1;if(e.isEmptyObject(n.core))return delete n.core,this.set_state(n,i),!1}return!e.isEmptyObject(n)||(n=null,i&&i.call(this),this.trigger("set_state"),!1)}return!1},refresh:function(t,n){this._data.core.state=!0===n?{}:this.get_state(),n&&e.isFunction(n)&&(this._data.core.state=n.call(this,this._data.core.state)),this._cnt=0,this._model.data={"#":{id:"#",parent:null,parents:[],children:[],children_d:[],state:{loaded:!1}}};var i=this.get_container_ul()[0].className;t||(this.element.html("<ul class='"+i+"' role='group'><li class='jstree-initial-node jstree-loading jstree-leaf jstree-last' role='treeitem' id='j"+this._id+"_loading'><i class='jstree-icon jstree-ocl'></i><a class='jstree-anchor' href='#'><i class='jstree-icon jstree-themeicon-hidden'></i>"+this.get_string("Loading ...")+"</a></li></ul>"),this.element.attr("aria-activedescendant","j"+this._id+"_loading")),this.load_node("#",(function(t,n){n&&(this.get_container_ul()[0].className=i,this._firstChild(this.get_container_ul()[0])&&this.element.attr("aria-activedescendant",this._firstChild(this.get_container_ul()[0]).id),this.set_state(e.extend(!0,{},this._data.core.state),(function(){this.trigger("refresh")}))),this._data.core.state=null}))},refresh_node:function(t){if(!(t=this.get_node(t))||"#"===t.id)return!1;var n=[],i=[];this._data.core.selected.concat([]);i.push(t.id),!0===t.state.opened&&n.push(t.id),this.get_node(t,!0).find(".jstree-open").each((function(){n.push(this.id)})),this._load_nodes(i,e.proxy((function(e){this.open_node(n,!1,0),this.select_node(this._data.core.selected),this.trigger("refresh_node",{node:t,nodes:e})}),this))},set_id:function(t,n){if(!(t=this.get_node(t))||"#"===t.id)return!1;var i,r,a=this._model.data;for(n=n.toString(),a[t.parent].children[e.inArray(t.id,a[t.parent].children)]=n,i=0,r=t.parents.length;i<r;i++)a[t.parents[i]].children_d[e.inArray(t.id,a[t.parents[i]].children_d)]=n;for(i=0,r=t.children.length;i<r;i++)a[t.children[i]].parent=n;for(i=0,r=t.children_d.length;i<r;i++)a[t.children_d[i]].parents[e.inArray(t.id,a[t.children_d[i]].parents)]=n;return-1!==(i=e.inArray(t.id,this._data.core.selected))&&(this._data.core.selected[i]=n),(i=this.get_node(t.id,!0))&&i.attr("id",n),delete a[t.id],t.id=n,a[n]=t,!0},get_text:function(e){return!(!(e=this.get_node(e))||"#"===e.id)&&e.text},set_text:function(t,n){var i,r;if(e.isArray(t)){for(i=0,r=(t=t.slice()).length;i<r;i++)this.set_text(t[i],n);return!0}return!(!(t=this.get_node(t))||"#"===t.id)&&(t.text=n,this.get_node(t,!0).length&&this.redraw_node(t.id),this.trigger("set_text",{obj:t,text:n}),!0)},get_json:function(t,n,i){if(!(t=this.get_node(t||"#")))return!1;n&&n.flat&&!i&&(i=[]);var r,a,o={id:t.id,text:t.text,icon:this.get_icon(t),li_attr:e.extend(!0,{},t.li_attr),a_attr:e.extend(!0,{},t.a_attr),state:{},data:(!n||!n.no_data)&&e.extend(!0,{},t.data)};if(n&&n.flat?o.parent=t.parent:o.children=[],!n||!n.no_state)for(r in t.state)t.state.hasOwnProperty(r)&&(o.state[r]=t.state[r]);if(n&&n.no_id&&(delete o.id,o.li_attr&&o.li_attr.id&&delete o.li_attr.id,o.a_attr&&o.a_attr.id&&delete o.a_attr.id),n&&n.flat&&"#"!==t.id&&i.push(o),!n||!n.no_children)for(r=0,a=t.children.length;r<a;r++)n&&n.flat?this.get_json(t.children[r],n,i):o.children.push(this.get_json(t.children[r],n));return n&&n.flat?i:"#"===t.id?o.children:o},create_node:function(n,i,r,a,o){if(null===n&&(n="#"),!(n=this.get_node(n)))return!1;if(!(r=r===t?"last":r).toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(n))return this.load_node(n,(function(){this.create_node(n,i,r,a,!0)}));var s,l,d,c;switch(i||(i={text:this.get_string("New node")}),"string"==typeof i&&(i={text:i}),i.text===t&&(i.text=this.get_string("New node")),"#"===n.id&&("before"===r&&(r="first"),"after"===r&&(r="last")),r){case"before":s=this.get_node(n.parent),r=e.inArray(n.id,s.children),n=s;break;case"after":s=this.get_node(n.parent),r=e.inArray(n.id,s.children)+1,n=s;break;case"inside":case"first":r=0;break;case"last":r=n.children.length;break;default:r||(r=0)}if(r>n.children.length&&(r=n.children.length),i.id||(i.id=!0),!this.check("create_node",i,n,r))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!0===i.id&&delete i.id,!(i=this._parse_model_from_json(i,n.id,n.parents.concat())))return!1;for(s=this.get_node(i),(l=[]).push(i),l=l.concat(s.children_d),this.trigger("model",{nodes:l,parent:n.id}),n.children_d=n.children_d.concat(l),d=0,c=n.parents.length;d<c;d++)this._model.data[n.parents[d]].children_d=this._model.data[n.parents[d]].children_d.concat(l);for(i=s,s=[],d=0,c=n.children.length;d<c;d++)s[d>=r?d+1:d]=n.children[d];return s[r]=i.id,n.children=s,this.redraw_node(n,!0),a&&a.call(this,this.get_node(i)),this.trigger("create_node",{node:this.get_node(i),parent:n.id,position:r}),i.id},rename_node:function(t,n){var i,r,a;if(e.isArray(t)){for(i=0,r=(t=t.slice()).length;i<r;i++)this.rename_node(t[i],n);return!0}return!(!(t=this.get_node(t))||"#"===t.id)&&(a=t.text,this.check("rename_node",t,this.get_parent(t),n)?(this.set_text(t,n),this.trigger("rename_node",{node:t,text:n,old:a}),!0):(this.settings.core.error.call(this,this._data.core.last_error),!1))},delete_node:function(t){var n,i,r,a,o,s,l,d,c,u;if(e.isArray(t)){for(n=0,i=(t=t.slice()).length;n<i;n++)this.delete_node(t[n]);return!0}if(!(t=this.get_node(t))||"#"===t.id)return!1;if(r=this.get_node(t.parent),a=e.inArray(t.id,r.children),u=!1,!this.check("delete_node",t,r,a))return this.settings.core.error.call(this,this._data.core.last_error),!1;for(-1!==a&&(r.children=e.vakata.array_remove(r.children,a)),(o=t.children_d.concat([])).push(t.id),d=0,c=o.length;d<c;d++){for(s=0,l=t.parents.length;s<l;s++)-1!==(a=e.inArray(o[d],this._model.data[t.parents[s]].children_d))&&(this._model.data[t.parents[s]].children_d=e.vakata.array_remove(this._model.data[t.parents[s]].children_d,a));this._model.data[o[d]].state.selected&&(u=!0,-1!==(a=e.inArray(o[d],this._data.core.selected))&&(this._data.core.selected=e.vakata.array_remove(this._data.core.selected,a)))}for(this.trigger("delete_node",{node:t,parent:r.id}),u&&this.trigger("changed",{action:"delete_node",node:t,selected:this._data.core.selected,parent:r.id}),d=0,c=o.length;d<c;d++)delete this._model.data[o[d]];return this.redraw_node(r,!0),!0},check:function(t,n,i,r,a){n=n&&n.id?n:this.get_node(n),i=i&&i.id?i:this.get_node(i);var o=t.match(/^move_node|copy_node|create_node$/i)?i:n,s=this.settings.core.check_callback;return"move_node"!==t&&"copy_node"!==t||a&&a.is_multi||n.id!==i.id&&e.inArray(n.id,i.children)!==r&&-1===e.inArray(i.id,n.children_d)?(o&&o.data&&(o=o.data),o&&o.functions&&(!1===o.functions[t]||!0===o.functions[t])?(!1===o.functions[t]&&(this._data.core.last_error={error:"check",plugin:"core",id:"core_02",reason:"Node data prevents function: "+t,data:JSON.stringify({chk:t,pos:r,obj:!(!n||!n.id)&&n.id,par:!(!i||!i.id)&&i.id})}),o.functions[t]):!(!1===s||e.isFunction(s)&&!1===s.call(this,t,n,i,r,a)||s&&!1===s[t])||(this._data.core.last_error={error:"check",plugin:"core",id:"core_03",reason:"User config for core.check_callback prevents function: "+t,data:JSON.stringify({chk:t,pos:r,obj:!(!n||!n.id)&&n.id,par:!(!i||!i.id)&&i.id})},!1)):(this._data.core.last_error={error:"check",plugin:"core",id:"core_01",reason:"Moving parent inside child",data:JSON.stringify({chk:t,pos:r,obj:!(!n||!n.id)&&n.id,par:!(!i||!i.id)&&i.id})},!1)},last_error:function(){return this._data.core.last_error},move_node:function(n,i,r,a,o,s){var l,d,c,u,f,h,p,g,m,v,y,_,b,E;if(i=this.get_node(i),r=r===t?0:r,!i)return!1;if(!r.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(i))return this.load_node(i,(function(){this.move_node(n,i,r,a,!0)}));if(e.isArray(n)){for(l=0,d=(n=n.slice()).length;l<d;l++)this.move_node(n[l],i,r,a,o,!0)&&(i=n[l],r="after");return this.redraw(),!0}if(!(n=n&&n.id?n:this.get_node(n))||"#"===n.id)return!1;if(c=(n.parent||"#").toString(),f=r.toString().match(/^(before|after)$/)&&"#"!==i.id?this.get_node(i.parent):i,p=!(h=n.instance?n.instance:this._model.data[n.id]?this:e.jstree.reference(n.id))||!h._id||this._id!==h._id,u=h&&h._id&&c&&h._model.data[c]&&h._model.data[c].children?e.inArray(n.id,h._model.data[c].children):-1,p)return!!this.copy_node(n,i,r,a,o)&&(h&&h.delete_node(n),!0);switch("#"===i.id&&("before"===r&&(r="first"),"after"===r&&(r="last")),r){case"before":r=e.inArray(i.id,f.children);break;case"after":r=e.inArray(i.id,f.children)+1;break;case"inside":case"first":r=0;break;case"last":r=f.children.length;break;default:r||(r=0)}if(r>f.children.length&&(r=f.children.length),!this.check("move_node",n,f,r,{core:!0,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(n.parent===f.id){for(g=f.children.concat(),-1!==(m=e.inArray(n.id,g))&&(g=e.vakata.array_remove(g,m),r>m&&r--),m=[],v=0,y=g.length;v<y;v++)m[v>=r?v+1:v]=g[v];m[r]=n.id,f.children=m,this._node_changed(f.id),this.redraw("#"===f.id)}else{for((m=n.children_d.concat()).push(n.id),v=0,y=n.parents.length;v<y;v++){for(g=[],_=0,b=(E=h._model.data[n.parents[v]].children_d).length;_<b;_++)-1===e.inArray(E[_],m)&&g.push(E[_]);h._model.data[n.parents[v]].children_d=g}for(h._model.data[c].children=e.vakata.array_remove_item(h._model.data[c].children,n.id),v=0,y=f.parents.length;v<y;v++)this._model.data[f.parents[v]].children_d=this._model.data[f.parents[v]].children_d.concat(m);for(g=[],v=0,y=f.children.length;v<y;v++)g[v>=r?v+1:v]=f.children[v];for(g[r]=n.id,f.children=g,f.children_d.push(n.id),f.children_d=f.children_d.concat(n.children_d),n.parent=f.id,(m=f.parents.concat()).unshift(f.id),E=n.parents.length,n.parents=m,m=m.concat(),v=0,y=n.children_d.length;v<y;v++)this._model.data[n.children_d[v]].parents=this._model.data[n.children_d[v]].parents.slice(0,-1*E),Array.prototype.push.apply(this._model.data[n.children_d[v]].parents,m);"#"!==c&&"#"!==f.id||(this._model.force_full_redraw=!0),this._model.force_full_redraw||(this._node_changed(c),this._node_changed(f.id)),s||this.redraw()}return a&&a.call(this,n,f,r),this.trigger("move_node",{node:n,parent:f.id,position:r,old_parent:c,old_position:u,is_multi:h&&h._id&&h._id!==this._id,is_foreign:!h||!h._id,old_instance:h,new_instance:this}),!0},copy_node:function(n,i,r,a,o,s){var l,d,c,u,f,h,p,g,m,v;if(i=this.get_node(i),r=r===t?0:r,!i)return!1;if(!r.toString().match(/^(before|after)$/)&&!o&&!this.is_loaded(i))return this.load_node(i,(function(){this.copy_node(n,i,r,a,!0)}));if(e.isArray(n)){for(l=0,d=(n=n.slice()).length;l<d;l++)(u=this.copy_node(n[l],i,r,a,o,!0))&&(i=u,r="after");return this.redraw(),!0}if(!(n=n&&n.id?n:this.get_node(n))||"#"===n.id)return!1;switch(g=(n.parent||"#").toString(),m=r.toString().match(/^(before|after)$/)&&"#"!==i.id?this.get_node(i.parent):i,!(v=n.instance?n.instance:this._model.data[n.id]?this:e.jstree.reference(n.id))||!v._id||this._id!==v._id,"#"===i.id&&("before"===r&&(r="first"),"after"===r&&(r="last")),r){case"before":r=e.inArray(i.id,m.children);break;case"after":r=e.inArray(i.id,m.children)+1;break;case"inside":case"first":r=0;break;case"last":r=m.children.length;break;default:r||(r=0)}if(r>m.children.length&&(r=m.children.length),!this.check("copy_node",n,m,r,{core:!0,is_multi:v&&v._id&&v._id!==this._id,is_foreign:!v||!v._id}))return this.settings.core.error.call(this,this._data.core.last_error),!1;if(!(p=v?v.get_json(n,{no_id:!0,no_data:!0,no_state:!0}):n))return!1;if(!0===p.id&&delete p.id,!(p=this._parse_model_from_json(p,m.id,m.parents.concat())))return!1;for(u=this.get_node(p),n&&n.state&&!1===n.state.loaded&&(u.state.loaded=!1),(c=[]).push(p),c=c.concat(u.children_d),this.trigger("model",{nodes:c,parent:m.id}),f=0,h=m.parents.length;f<h;f++)this._model.data[m.parents[f]].children_d=this._model.data[m.parents[f]].children_d.concat(c);for(c=[],f=0,h=m.children.length;f<h;f++)c[f>=r?f+1:f]=m.children[f];return c[r]=u.id,m.children=c,m.children_d.push(u.id),m.children_d=m.children_d.concat(u.children_d),"#"===m.id&&(this._model.force_full_redraw=!0),this._model.force_full_redraw||this._node_changed(m.id),s||this.redraw("#"===m.id),a&&a.call(this,u,m,r),this.trigger("copy_node",{node:u,original:n,parent:m.id,position:r,old_parent:g,old_position:v&&v._id&&g&&v._model.data[g]&&v._model.data[g].children?e.inArray(n.id,v._model.data[g].children):-1,is_multi:v&&v._id&&v._id!==this._id,is_foreign:!v||!v._id,old_instance:v,new_instance:this}),u.id},cut:function(t){if(t||(t=this._data.core.selected.concat()),e.isArray(t)||(t=[t]),!t.length)return!1;var n,i,r,l=[];for(i=0,r=t.length;i<r;i++)(n=this.get_node(t[i]))&&n.id&&"#"!==n.id&&l.push(n);if(!l.length)return!1;a=l,s=this,o="move_node",this.trigger("cut",{node:t})},copy:function(t){if(t||(t=this._data.core.selected.concat()),e.isArray(t)||(t=[t]),!t.length)return!1;var n,i,r,l=[];for(i=0,r=t.length;i<r;i++)(n=this.get_node(t[i]))&&n.id&&"#"!==n.id&&l.push(n);if(!l.length)return!1;a=l,s=this,o="copy_node",this.trigger("copy",{node:t})},get_buffer:function(){return{mode:o,node:a,inst:s}},can_paste:function(){return!1!==o&&!1!==a},paste:function(e,t){if(!((e=this.get_node(e))&&o&&o.match(/^(copy_node|move_node)$/)&&a))return!1;this[o](a,e,t)&&this.trigger("paste",{parent:e.id,node:a,mode:o}),a=!1,o=!1,s=!1},clear_buffer:function(){a=!1,o=!1,s=!1,this.trigger("clear_buffer")},edit:function(t,n){if(!(t=this.get_node(t)))return!1;if(!1===this.settings.core.check_callback)return this._data.core.last_error={error:"check",plugin:"core",id:"core_07",reason:"Could not edit node because of check_callback"},this.settings.core.error.call(this,this._data.core.last_error),!1;n="string"==typeof n?n:t.text,this.set_text(t,""),t=this._open_to(t);var i=this._data.core.rtl,r=this.element.width(),a=t.children(".jstree-anchor"),o=e("<span>"),
/*!
				oi = obj.children("i:visible"),
				ai = a.children("i:visible"),
				w1 = oi.width() * oi.length,
				w2 = ai.width() * ai.length,
				*/
s=n,l=e("<div />",{css:{position:"absolute",top:"-200px",left:i?"0px":"-1000px",visibility:"hidden"}}).appendTo("body"),d=e("<input />",{value:s,class:"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:e.proxy((function(){var n=o.children(".jstree-rename-input").val();""===n&&(n=s),l.remove(),o.replaceWith(a),o.remove(),this.set_text(t,s),!1===this.rename_node(t,e("<div></div>").text(n)[this.settings.core.force_text?"text":"html"]())&&this.set_text(t,s)}),this),keydown:function(e){var t=e.which;27===t&&(this.value=s),27!==t&&13!==t&&37!==t&&38!==t&&39!==t&&40!==t&&32!==t||e.stopImmediatePropagation(),27!==t&&13!==t||(e.preventDefault(),this.blur())},click:function(e){e.stopImmediatePropagation()},mousedown:function(e){e.stopImmediatePropagation()},keyup:function(){d.width(Math.min(l.text("pW"+this.value).width(),r))},keypress:function(e){if(13===e.which)return!1}}),c={fontFamily:a.css("fontFamily")||"",fontSize:a.css("fontSize")||"",fontWeight:a.css("fontWeight")||"",fontStyle:a.css("fontStyle")||"",fontStretch:a.css("fontStretch")||"",fontVariant:a.css("fontVariant")||"",letterSpacing:a.css("letterSpacing")||"",wordSpacing:a.css("wordSpacing")||""};o.attr("class",a.attr("class")).append(a.contents().clone()).append(d),a.replaceWith(o),l.css(c),d.css(c).width(Math.min(l.text("pW"+d[0].value).width(),r))[0].select()},set_theme:function(t,n){if(!t)return!1;if(!0===n){var i=this.settings.core.themes.dir;i||(i=e.jstree.path+"/themes"),n=i+"/"+t+"/style.css"}n&&-1===e.inArray(n,l)&&(e("head").append('<link rel="stylesheet" href="'+n+'" type="text/css" />'),l.push(n)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=t,this.element.addClass("jstree-"+t),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+t+"-responsive"),this.trigger("set_theme",{theme:t})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(e){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),this._data.core.themes.variant=e,e&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},set_icon:function(t,n){var i,r,a,o;if(e.isArray(t)){for(i=0,r=(t=t.slice()).length;i<r;i++)this.set_icon(t[i],n);return!0}return!(!(t=this.get_node(t))||"#"===t.id)&&(o=t.icon,t.icon=n,a=this.get_node(t,!0).children(".jstree-anchor").children(".jstree-themeicon"),!1===n?this.hide_icon(t):!0===n?(a.removeClass("jstree-themeicon-custom "+o).css("background","").removeAttr("rel"),!1===o&&this.show_icon(t)):-1===n.indexOf("/")&&-1===n.indexOf(".")?(a.removeClass(o).css("background",""),a.addClass(n+" jstree-themeicon-custom").attr("rel",n),!1===o&&this.show_icon(t)):(a.removeClass(o).css("background",""),a.addClass("jstree-themeicon-custom").css("background","url('"+n+"') center center no-repeat").attr("rel",n),!1===o&&this.show_icon(t)),!0)},get_icon:function(e){return!(!(e=this.get_node(e))||"#"===e.id)&&e.icon},hide_icon:function(t){var n,i;if(e.isArray(t)){for(n=0,i=(t=t.slice()).length;n<i;n++)this.hide_icon(t[n]);return!0}return!(!(t=this.get_node(t))||"#"===t)&&(t.icon=!1,this.get_node(t,!0).children(".jstree-anchor").children(".jstree-themeicon").addClass("jstree-themeicon-hidden"),!0)},show_icon:function(t){var n,i,r;if(e.isArray(t)){for(n=0,i=(t=t.slice()).length;n<i;n++)this.show_icon(t[n]);return!0}return!(!(t=this.get_node(t))||"#"===t)&&(r=this.get_node(t,!0),t.icon=!r.length||r.children(".jstree-anchor").children(".jstree-themeicon").attr("rel"),t.icon||(t.icon=!0),r.children(".jstree-anchor").children(".jstree-themeicon").removeClass("jstree-themeicon-hidden"),!0)}},e.vakata={},e.vakata.attributes=function(t,n){t=e(t)[0];var i=n?{}:[];return t&&t.attributes&&e.each(t.attributes,(function(t,r){-1===e.inArray(r.name.toLowerCase(),["style","contenteditable","hasfocus","tabindex"])&&null!==r.value&&""!==e.trim(r.value)&&(n?i[r.name]=r.value:i.push(r.name))})),i},e.vakata.array_unique=function(e){var t,n,i,r=[];for(t=0,i=e.length;t<i;t++){for(n=0;n<=t&&e[t]!==e[n];n++);n===t&&r.push(e[t])}return r},e.vakata.array_remove=function(e,t,n){var i=e.slice((n||t)+1||e.length);return e.length=t<0?e.length+t:t,e.push.apply(e,i),e},e.vakata.array_remove_item=function(t,n){var i=e.inArray(n,t);return-1!==i?e.vakata.array_remove(t,i):t}}})),function(e){"use strict";"function"==typeof define&&define.amd?define("jstree.wholerow",["jquery","jstree"],e):"object"==typeof exports?e(require("jquery"),require("jstree")):e(jQuery,jQuery.jstree)}((function(e){"use strict";if(!e.jstree.plugins.wholerow){var t=document.createElement("DIV");t.setAttribute("unselectable","on"),t.setAttribute("role","presentation"),t.className="jstree-wholerow",t.innerHTML="&#160;",e.jstree.plugins.wholerow=function(n,i){this.bind=function(){i.bind.call(this),this.element.on("ready.jstree set_state.jstree",e.proxy((function(){this.hide_dots()}),this)).on("init.jstree loading.jstree ready.jstree",e.proxy((function(){this.get_container_ul().addClass("jstree-wholerow-ul")}),this)).on("deselect_all.jstree",e.proxy((function(){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked")}),this)).on("changed.jstree",e.proxy((function(e,t){this.element.find(".jstree-wholerow-clicked").removeClass("jstree-wholerow-clicked");var n,i,r=!1;for(n=0,i=t.selected.length;n<i;n++)(r=this.get_node(t.selected[n],!0))&&r.length&&r.children(".jstree-wholerow").addClass("jstree-wholerow-clicked")}),this)).on("open_node.jstree",e.proxy((function(e,t){this.get_node(t.node,!0).find(".jstree-clicked").parent().children(".jstree-wholerow").addClass("jstree-wholerow-clicked")}),this)).on("hover_node.jstree dehover_node.jstree",e.proxy((function(e,t){"hover_node"===e.type&&this.is_disabled(t.node)||this.get_node(t.node,!0).children(".jstree-wholerow")["hover_node"===e.type?"addClass":"removeClass"]("jstree-wholerow-hovered")}),this)).on("contextmenu.jstree",".jstree-wholerow",e.proxy((function(t){t.preventDefault();var n=e.Event("contextmenu",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,pageX:t.pageX,pageY:t.pageY});e(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(n)}),this)).on("click.jstree",".jstree-wholerow",(function(t){t.stopImmediatePropagation();var n=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(n).focus()})).on("click.jstree",".jstree-leaf > .jstree-ocl",e.proxy((function(t){t.stopImmediatePropagation();var n=e.Event("click",{metaKey:t.metaKey,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey});e(t.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(n).focus()}),this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",e.proxy((function(e){return e.stopImmediatePropagation(),this.is_disabled(e.currentTarget)||this.hover_node(e.currentTarget),!1}),this)).on("mouseleave.jstree",".jstree-node",e.proxy((function(e){this.dehover_node(e.currentTarget)}),this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),i.teardown.call(this)},this.redraw_node=function(n,r,a,o){if(n=i.redraw_node.apply(this,arguments)){var s=t.cloneNode(!0);-1!==e.inArray(n.id,this._data.core.selected)&&(s.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===n.id&&(s.className+=" jstree-wholerow-hovered"),n.insertBefore(s,n.childNodes[0])}return n}}}})),function(e){"use strict";"function"==typeof define&&define.amd?define("jstree.checkbox",["jquery","jstree"],e):"object"==typeof exports?e(require("jquery"),require("jstree")):e(jQuery,jQuery.jstree)}((function(e){"use strict";if(!e.jstree.plugins.checkbox){var t=document.createElement("I"),n=document.createElement("a");t.className="jstree-icon jstree-checkbox",n.className="jstree-checkbox-selectall",e.jstree.defaults.checkbox={cascadeDown:!0,cascadeUp:!1,keep_selected_style:!0,select_all_includes_self:!1,select_and_deselect_all_controls:!0,select_and_disable_children:!0,three_state:!0,visible:!0,whole_node:!0},e.jstree.plugins.checkbox=function(i,r){this.bind=function(){r.bind.call(this),this._data.checkbox.uto=!1,this.element.on("init.jstree",e.proxy((function(){this._data.checkbox.visible=this.settings.checkbox.visible,this.settings.checkbox.keep_selected_style||this.element.addClass("jstree-checkbox-no-clicked"),this.settings.checkbox.select_and_disable_children&&this.element.addClass("jstree-select-and-disable-children"),this.settings.checkbox.show_disabled_checkbox_controls&&this.element.addClass("show-disabled-checkbox-controls")}),this)).on("loading.jstree",e.proxy((function(){this[this._data.checkbox.visible?"show_checkboxes":"hide_checkboxes"]()}),this)),this.settings.checkbox.select_and_deselect_all_controls&&this.element.on("click",".jstree-checkbox-selectall",e.proxy((function(t){var n=e(t.target),i=e.makeArray(e(t.target).parent().find("li.jstree-node").not((function(t,n){return e(n).children().is(".jstree-disabled")})));this.settings.checkbox.select_all_includes_self&&!n.siblings(".jstree-anchor").is(".jstree-disabled")&&(i=[n,i]),n.hasClass("jstree-checkbox-deselectall")?this.deselect_node(i):this.select_node(i)}),this)),this.element.on("changed.jstree move_node.jstree copy_node.jstree redraw.jstree open_node.jstree close_node.jstree",e.proxy((function(){this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(e.proxy(this._undetermined,this),50)}),this)).on("model.jstree",e.proxy((function(t,n){var i,r,a,o,s,l,d=this._model.data,c=d[n.parent],u=n.nodes,f=[];if(this.settings.checkbox.cascadeDown)if(c.state.selected){for(r=0,a=u.length;r<a;r++)d[u[r]].state.selected=!0,this.settings.checkbox.select_and_disable_children&&(d[u[r]].state.selected=!1,d[u[r]].state.disabled=!0);this.settings.checkbox.select_and_disable_children||(this._data.core.selected=this._data.core.selected.concat(u))}else for(r=0,a=u.length;r<a;r++)if(d[u[r]].state.selected){for(o=0,s=d[u[r]].children_d.length;o<s;o++)d[d[u[r]].children_d[o]].state.selected=!0;this.settings.checkbox.select_and_disable_children||(this._data.core.selected=this._data.core.selected.concat(d[u[r]].children_d))}if(!this.settings.checkbox.select_and_disable_children&&this.settings.checkbox.cascadeUp){for(r=0,a=c.children_d.length;r<a;r++)d[c.children_d[r]].children.length||f.push(d[c.children_d[r]].parent);for(o=0,s=(f=e.vakata.array_unique(f)).length;o<s;o++)for(c=d[f[o]];c&&"#"!==c.id;){for(i=0,r=0,a=c.children.length;r<a;r++)i+=d[c.children[r]].state.selected;if(i!==a)break;c.state.selected=!0,this._data.core.selected.push(c.id),(l=this.get_node(c,!0))&&l.length&&l.children(".jstree-anchor").andSelf().addClass("jstree-clicked"),c=this.get_node(c.parent)}}this._data.core.selected=e.vakata.array_unique(this._data.core.selected)}),this)).on("select_node.jstree",e.proxy((function(t,n){var i,r,a,o,s=n.node,l=this._model.data,d=this.get_node(s.parent),c=this.get_node(s,!0);if(this.open_node(s),this.settings.checkbox.cascadeDown)for(this.settings.checkbox.select_and_disable_children||(this._data.core.selected=e.vakata.array_unique(this._data.core.selected.concat(s.children_d))),i=0,r=s.children_d.length;i<r;i++)(o=l[s.children_d[i]]).state.selected=!0,this.settings.checkbox.select_and_disable_children&&(o.state.selected=!1,o.state.disabled=!0,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,o.id)),o&&o.original&&o.original.state&&o.original.state.undetermined&&(o.original.state.undetermined=!1);if(!this.settings.checkbox.select_and_deselect_all_controls&&this.settings.checkbox.cascadeUp)for(;d&&"#"!==d.id;){for(a=0,i=0,r=d.children.length;i<r;i++)a+=l[d.children[i]].state.selected;if(a!==r)break;d.state.selected=!0,this._data.core.selected.push(d.id),(o=this.get_node(d,!0))&&o.length&&o.children(".jstree-anchor").not(".jstree-disabled").andSelf().addClass("jstree-clicked"),d=this.get_node(d.parent)}this.settings.checkbox.cascadeDown&&c.length&&(c.find(".jstree-anchor").not(".jstree-disabled").not(".jstree-disabled").addClass("jstree-clicked"),this.settings.checkbox.select_and_disable_children&&c.find(".jstree-children .jstree-anchor").addClass("jstree-disabled"))}),this)).on("deselect_all.jstree",e.proxy((function(){var e,t,n,i=this.get_node("#"),r=this._model.data;for(e=0,t=i.children_d.length;e<t;e++)(n=r[i.children_d[e]])&&n.original&&n.original.state&&n.original.state.undetermined&&(n.original.state.undetermined=!1)}),this)).on("deselect_node.jstree",e.proxy((function(t,n){var i,r,a,o=n.node,s=this.get_node(o,!0);if(o&&o.original&&o.original.state&&o.original.state.undetermined&&(o.original.state.undetermined=!1),this.settings.checkbox.cascadeDown)for(i=0,r=o.children_d.length;i<r;i++)(a=this._model.data[o.children_d[i]]).state.selected=!1,this.settings.checkbox.select_and_disable_children&&(a.state.disabled=!1),a&&a.original&&a.original.state&&a.original.state.undetermined&&(a.original.state.undetermined=!1),this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,a.id);if(this.settings.checkbox.cascadeUp)for(i=0,r=o.parents.length;i<r;i++)(a=this._model.data[o.parents[i]])&&a.original&&a.original.state&&a.original.state.undetermined&&(a.original.state.undetermined=!1),(a=this.get_node(o.parents[i],!0))&&a.length&&a.children(".jstree-anchor").not(".jstree-disabled").removeClass("jstree-clicked");if(a=[],!this.settings.checkbox.select_and_deselect_all_controls){for(i=0,r=this._data.core.selected.length;i<r;i++)-1===e.inArray(this._data.core.selected[i],o.children_d)&&-1===e.inArray(this._data.core.selected[i],o.parents)&&a.push(this._data.core.selected[i]);this._data.core.selected=e.vakata.array_unique(a)}this.settings.checkbox.cascadeDown&&s.length&&s.length&&s.find(".jstree-anchor, .jstree-node").andSelf().removeClass("jstree-clicked jstree-disabled")}),this)).on("delete_node.jstree",e.proxy((function(e,t){for(var n,i,r,a,o=this.get_node(t.parent),s=this._model.data;o&&"#"!==o.id;){for(r=0,n=0,i=o.children.length;n<i;n++)r+=s[o.children[n]].state.selected;if(r!==i)break;o.state.selected=!0,this._data.core.selected.push(o.id),(a=this.get_node(o,!0))&&a.length&&a.children(".jstree-anchor").andSelf().addClass("jstree-clicked"),o=this.get_node(o.parent)}}),this)).on("move_node.jstree",e.proxy((function(t,n){var i,r,a,o,s,l=n.is_multi,d=n.old_parent,c=this.get_node(n.parent),u=this._model.data;if(!l)for(i=this.get_node(d);i&&"#"!==i.id;){for(r=0,a=0,o=i.children.length;a<o;a++)r+=u[i.children[a]].state.selected;if(r!==o)break;i.state.selected=!0,this._data.core.selected.push(i.id),(s=this.get_node(i,!0))&&s.length&&s.children(".jstree-anchor").andSelf().addClass("jstree-clicked"),i=this.get_node(i.parent)}for(i=c;i&&"#"!==i.id;){for(r=0,a=0,o=i.children.length;a<o;a++)r+=u[i.children[a]].state.selected;if(r===o)i.state.selected||(i.state.selected=!0,this._data.core.selected.push(i.id),(s=this.get_node(i,!0))&&s.length&&s.children(".jstree-anchor").andSelf().addClass("jstree-clicked"));else{if(!i.state.selected)break;i.state.selected=!1,this._data.core.selected=e.vakata.array_remove_item(this._data.core.selected,i.id),(s=this.get_node(i,!0))&&s.length&&s.children(".jstree-anchor").andSelf().removeClass("jstree-clicked")}i=this.get_node(i.parent)}}),this))},this._undetermined=function(){var t,n,i=this._model.data,r=this._data.core.selected,a=[],o=this;for(t=0,n=r.length;t<n;t++)i[r[t]]&&i[r[t]].parents&&(a=a.concat(i[r[t]].parents));if(this.element.find(".jstree-closed").not(":has(.jstree-children)").each((function(){var e,r=o.get_node(this);if(r.state.loaded)for(t=0,n=r.children_d.length;t<n;t++)!(e=i[r.children_d[t]]).state.loaded&&e.original&&e.original.state&&e.original.state.undetermined&&!0===e.original.state.undetermined&&(a.push(e.id),a=a.concat(e.parents));else r.original&&r.original.state&&r.original.state.undetermined&&!0===r.original.state.undetermined&&(a.push(r.id),a=a.concat(r.parents))})),a=e.vakata.array_unique(a),a=e.vakata.array_remove_item(a,"#"),this.element.find(".jstree-undetermined").andSelf().removeClass("jstree-undetermined"),this.settings.checkbox.select_and_deselect_all_controls){var s=this.element.find(".jstree-checkbox-selectall");s.removeClass("jstree-checkbox-deselectall fsStateHidden"),s.filter((function(){var t=e(this).siblings(".jstree-anchor");return(!o.settings.checkbox.select_all_includes_self||t.is(".jstree-clicked")||t.is(".jstree-disabled"))&&0==e(this).siblings(".jstree-children").find(".jstree-anchor").not(".jstree-disabled").not(".jstree-clicked").length})).addClass("jstree-checkbox-deselectall"),s.filter((function(){var t=e(this).siblings(".jstree-children");return t.find(".jstree-anchor.jstree-disabled").not(".jstree-clicked").length>0&&0==t.find(".jstree-open").find(".jstree-anchor").not(".jstree-disabled").length})).addClass("fsStateHidden")}if(this.settings.checkbox.select_and_disable_children&&this.element.find(".jstree-clicked .jstree-children .jstree-anchor").addClass("jstree-clicked"),this.settings.checkbox.three_state)for(t=0,n=a.length;t<n;t++)(r=this.get_node(a[t],!0))&&r.length&&(i[a[t]].state.selected||r&&r.length&&(r.children(".jstree-anchor").children(".jstree-checkbox").addClass("jstree-undetermined"),r.addClass("jstree-undetermined")));this.element.trigger("after_redraw")},this.redraw_node=function(i,a,o){var s=this.get_node(i).id;if(i=r.redraw_node.call(this,i,a,o)){var l,d,c=null;for(l=0,d=i.childNodes.length;l<d;l++)if(i.childNodes[l]&&i.childNodes[l].className&&-1!==i.childNodes[l].className.indexOf("jstree-anchor")){c=i.childNodes[l];break}c&&(c.insertBefore(t.cloneNode(!1),c.childNodes[0]),this.settings.checkbox.select_and_deselect_all_controls&&-1==i.className.indexOf("jstree-leaf")&&i.insertBefore(n.cloneNode(!0),c.nextSibling)),this._model.data[s]&&this._model.data[s].state.selected&&(i.className=[i.className,"jstree-clicked"].join(" "))}return!o&&this.settings.checkbox.three_state&&(this._data.checkbox.uto&&clearTimeout(this._data.checkbox.uto),this._data.checkbox.uto=setTimeout(e.proxy(this._undetermined,this),50)),this.settings.checkbox.node_class_function&&(i.className=[i.className,this.settings.checkbox.node_class_function(this._model.data[s].data)].join(" ")),i},this.activate_node=function(t,n){return(this.settings.checkbox.whole_node||e(n.target).hasClass("jstree-checkbox"))&&(n.ctrlKey=!0),r.activate_node.call(this,t,n)},this.show_checkboxes=function(){this._data.core.themes.checkboxes=!0,this.get_container_ul().removeClass("jstree-no-checkboxes")},this.hide_checkboxes=function(){this._data.core.themes.checkboxes=!1,this.get_container_ul().addClass("jstree-no-checkboxes")},this.toggle_checkboxes=function(){this._data.core.themes.checkboxes?this.hide_checkboxes():this.show_checkboxes()}}}})),function(e){"use strict";function t(t,n){for(var i,r,a=-1;a<n.length;)for(a=n.length,i=0;i<t.length;i++)r=parseInt(t[i].id.replace(/^\D+/g,"")),n.indexOf(r)>-1&&null!==t[i].parent_id&&-1==n.indexOf(t[i].parent_id)&&n.push(t[i].parent_id);return e.grep(t,(function(e){var t=parseInt(e.id.replace(/^\D+/g,""));return n.indexOf(t)>-1}))}function n(t){return e.makeArray(t.find("."+a).map((function(){return FSApp.utils.isUuid(this.value)?this.value:parseInt(this.value)})))}function i(t,n,r,a,o,s,l=[]){r=r||[],e.each(t,(function(e,t){var c=t.id;if(t.state=t.state||{},0==c&&(t.li_attr={class:"fsGroupPickerRoles"}),t.id=n+c,o&&"parent_id"in t?t.parent=null===t.parent_id?"#":n+t.parent_id:!("children"in t)&&"has_children"in t&&(t.children=t.has_children),!("text"in t)&&"name"in t&&(t.text=t.name),t.state.disabled=a||!!t.disabled||s.indexOf(c)>-1,t.state.selected=r.indexOf(c)>-1&&!t.disabled,l.length>0&&l.indexOf(c)<0&&"Locations"!==t.name){let e=t.li_attr||{};e.class=e.class?e.class.concat(" ",d):d,t.li_attr=e,t.state.disabled=!0}"children"in t&&"object"==typeof t.children&&i(t.children,n,r,a,o,s,l)}))}var r="fsGroupPickerField",a="fsGroupPickerFieldItem",o="fsGroupPickerTree",s="fsGroupPickerInheritedTree",l="fsGroupPickerSelectedTree",d="fsStateHidden";e.fn.fsGroupPicker=function(c){var u=(c=c||{}).hiddenFieldName||"selectedGroup",f=c.modelsText||"collections",h=0!=c.multiple,p=1==c.readOnly,g=0!=c.topLevelDisabled,m=c.preselectedValues||[],v=c.inheritedValues||[],y=c.visibleNodes||[];return"string"==typeof m&&e.trim(m).length&&(m=m.split(",")),this.each((function(){var _=e(this),b=e('<input type="hidden" multiple="multiple" id="'+r+'" name="'+u+'">'),E=e('<div class="'+o+'">'),w=e('<div class="'+s+'"></div>'),T=e('<div class="'+s+'Container"><h2>Groups inherited from parent '+f+"</h2></div>"),S=e('<div class="'+l+" "+d+'">'),C=n(_),k=e('<button class="fsGroupPickerViewButton">View Selected</button>').on("click",(function(){var t=e(this),n="View Selected"==e.trim(t.text());t.text(n?"View All":"View Selected"),E.toggleClass(d,n),S.toggleClass(d,!n),n?(S.jstree(!0)._data.core.ready=!1,S.jstree(!0).load_node("#")):0==_.find("."+a).length&&k.prop("disabled",!0)}));if(h&&_.prepend(k,S),_.prepend(E,b),m.length>0)for(var I=0;I<m.length;I++)_.append('<input type="hidden" multiple="multiple" class="'+a+'" name="'+u+'" value="'+m[I]+'">');else 0==_.find("."+a).length&&k.prop("disabled",!0);h&&_.find("."+a).length&&(S.removeClass(d),E.addClass(d),k.text("View All")),h&&v.length&&(T.append(w),_.prepend(T)),E.jstree({plugins:h?["checkbox","wholerow"]:["wholerow"],checkbox:{cascadeDown:!1,select_and_disable_children:!1},core:{data:function(t,r){var a,s=e.merge(n(_),v);a=c.onlyRoles?"/0/children":"#"==t.id?"":"/"+t.id.replace(o,"")+"/children",e.getJSON("/fs/people-manager/groups"+a+".json?"+(g?"":"top_level_disabled=false&")+(c.onlyGroupSpaces?"only_group_spaces=true&":"")+(c.onlySystemGroup?"only_system_group="+c.onlySystemGroup:"")).done((function(e){c.excludeRoles&&"#"==t.id&&e.splice(0,1),i(e,o,s,p,!1,v,y),r(e)}))}}}).on("select_node.jstree",(function(e,t){h||b.nextAll("."+a).remove(),b.after(b.clone().val(t.node.id.replace(o,"")).removeAttr("id").addClass(a)),k.prop("disabled",!1),_.trigger("groupPicker:change",t.node)})).on("deselect_node.jstree",(function(e,t){b.nextAll("."+a+"[value="+t.node.id.replace(o,"")+"]").remove(),0==_.find("."+a).length&&E.is(":visible")&&k.prop("disabled",!0),_.trigger("groupPicker:change",t.node)})),h?S.jstree({plugins:["checkbox","wholerow"],checkbox:{cascadeDown:!1,select_and_disable_children:!1},core:{data:function(r,a){var o=e.merge(n(_),v);o.length&&e.getJSON("/fs/people-manager/groups.json?include_ancestors=true&group_ids="+o).done((function(e){i(e,l,o,p,!0,v,y),_.trigger("groupPicker:selectionLoaded",[e]),a(e),v.length&&w.jstree({core:{data:t(e,v)}})}))}}}).on("select_node.jstree",(function(e,t){var n=t.node.id.replace(l,"");E.find("#"+o+n).length?E.jstree(!0).select_node(o+n):b.after(b.clone().val(n).removeAttr("id").addClass(a)),_.trigger("groupPicker:change",t.node)})).on("deselect_node.jstree",(function(e,t){var n=t.node.id.replace(l,"");E.find("#"+o+n).length?E.jstree(!0).deselect_node(o+n):b.nextAll("."+a+"[value="+n+"]").remove(),_.trigger("groupPicker:change",t.node)})):C.length&&e.getJSON("/fs/people-manager/groups.json?include_ancestors=true&group_ids="+C).done((function(e){i(e,"",[],p),_.trigger("groupPicker:selectionLoaded",[e])}))}))}}(jQuery),function(e){"use strict";function t(e,t){return e.find(d+'[data-mediatype="'+t+'"]').length>0}var n=e.$,i="fsStateHidden",r=".fsMediaSettingsChannel",a=r+"Node",o=".fsMediaSettingsFolder",s=o+"Node",l=".fsMediaSettingsPlaylist",d=l+"Node",c=".fsMediaSettingsSelectedMediaNodes",u="fsStateSelected";e.getInternalNS("elements.media").initPicker=function(e){e.find(".fsMediaSettingsSelectedMedia input:checked").parents("ul").siblings(".fsStyleAccordionHeader").addClass(u),n(".fsElementSettingMediaPlayer, .fsElementSettingMediaGallery").on("change",'input[name="settings[subtype]"]',(function(){var t=n(c),a=t.find(r+":checked"),s=t.find(o+":checked"),d="Player"==n(this).val();if(n(r+":not(#fsMediaChannelAll), "+o).toggleClass(i,d),n("#fsMediaSettingsAllChannelsNode").toggleClass(i,d),d){var f,h,p,g=".fsStyleAccordionHeader:first";a.length>0?p=a:s.length>0&&(p=s),p&&(h="fsMediaChannelAll"==a.attr("id")?p.closest("ul").siblings("ul").first().children("li").first():p.closest("li"),p==a&&(g+=", ul "+g),p.prop("checked",!1),h.find(g).addClass(u),(f=h.find(l+":first")).prop("checked",!0),e.trigger("mediaPicker:change",f.next("label").text()))}})),e.find(".fsMediaSettingsSelectedMediaNodes").on("change",r,(function(t){var r=n(this);r.hasClass(i)?r.prop("checked",!1):(n(c).find(o+":checked, "+l+":checked").prop("checked",!1),e.trigger("mediaPicker:change",n(t.target).next("label").text()))})).on("change",o,(function(t){var a=n(this);a.hasClass(i)?a.prop("checked",!1):(n(c).find(r+":checked, "+l+":checked").prop("checked",!1),e.trigger("mediaPicker:change",n(t.target).next("label").text()))})).on("change",l,(function(t){n(c).find(r+":checked, "+o+":checked").prop("checked",!1),e.trigger("mediaPicker:change",n(t.target).next("label").text())})),e.on("click",".fsStyleAccordionHeader",(function(e){e.stopPropagation(),n(this).toggleClass(u)})),e.on("click",'.fsStyleAccordionHeader input[type="radio"], .fsStyleAccordionHeader label',(function(e){e.stopPropagation(),n(this).closest(".fsStyleAccordionHeader").addClass(u)})),e.find(".fsMediaSettingsTypes").on("change","input[type=radio]",(function(){var e=n(this).val();n(a+", "+s+", "+d).removeClass(i),e>=1&&e<=3&&n(a).each((function(){var r=n(this);t(r,e)?r.find(s).each((function(){var r=n(this);t(r,e)?r.find(d+'[data-mediatype!="'+e+'"]').addClass(i):r.addClass(i)})):r.addClass(i)}))}))}}(FS),
/**
 * sifter.js
 * Copyright (c) 2013 Brian Reavis & contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the License at:
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
 * ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 *
 * @author Brian Reavis <brian@thirdroute.com>
 */
function(e,t){"function"==typeof define&&define.amd?define("sifter",t):"object"==typeof exports?module.exports=t():e.Sifter=t()}(this,(function(){var e=function(e,t){this.items=e,this.settings=t||{diacritics:!0}};e.prototype.tokenize=function(e){if(!(e=r(String(e||"").toLowerCase()))||!e.length)return[];var t,n,i,o,l=[],d=e.split(/ +/);for(t=0,n=d.length;t<n;t++){if(i=a(d[t]),this.settings.diacritics)for(o in s)s.hasOwnProperty(o)&&(i=i.replace(new RegExp(o,"g"),s[o]));l.push({string:d[t],regex:new RegExp(i,"i")})}return l},e.prototype.iterator=function(e,t){(o(e)?Array.prototype.forEach||function(e){for(var t=0,n=this.length;t<n;t++)e(this[t],t,this)}:function(e){for(var t in this)this.hasOwnProperty(t)&&e(this[t],t,this)}).apply(e,[t])},e.prototype.getScoreFunction=function(e,t){var n,r,a,o;e=this.prepareSearch(e,t),r=e.tokens,n=e.options.fields,a=r.length,o=e.options.nesting;var s,l=function(e,t){var n,i;return e?-1===(i=(e=String(e||"")).search(t.regex))?0:(n=t.string.length/e.length,0===i&&(n+=.5),n):0},d=(s=n.length)?1===s?function(e,t){return l(i(t,n[0],o),e)}:function(e,t){for(var r=0,a=0;r<s;r++)a+=l(i(t,n[r],o),e);return a/s}:function(){return 0};return a?1===a?function(e){return d(r[0],e)}:"and"===e.options.conjunction?function(e){for(var t,n=0,i=0;n<a;n++){if((t=d(r[n],e))<=0)return 0;i+=t}return i/a}:function(e){for(var t=0,n=0;t<a;t++)n+=d(r[t],e);return n/a}:function(){return 0}},e.prototype.getSortFunction=function(e,n){var r,a,o,s,l,d,c,u,f,h,p;if(p=!(e=(o=this).prepareSearch(e,n)).query&&n.sort_empty||n.sort,f=function(e,t){return"$score"===e?t.score:i(o.items[t.id],e,n.nesting)},l=[],p)for(r=0,a=p.length;r<a;r++)(e.query||"$score"!==p[r].field)&&l.push(p[r]);if(e.query){for(h=!0,r=0,a=l.length;r<a;r++)if("$score"===l[r].field){h=!1;break}h&&l.unshift({field:"$score",direction:"desc"})}else for(r=0,a=l.length;r<a;r++)if("$score"===l[r].field){l.splice(r,1);break}for(u=[],r=0,a=l.length;r<a;r++)u.push("desc"===l[r].direction?-1:1);return(d=l.length)?1===d?(s=l[0].field,c=u[0],function(e,n){return c*t(f(s,e),f(s,n))}):function(e,n){var i,r,a;for(i=0;i<d;i++)if(a=l[i].field,r=u[i]*t(f(a,e),f(a,n)))return r;return 0}:null},e.prototype.prepareSearch=function(e,t){if("object"==typeof e)return e;var i=(t=n({},t)).fields,r=t.sort,a=t.sort_empty;return i&&!o(i)&&(t.fields=[i]),r&&!o(r)&&(t.sort=[r]),a&&!o(a)&&(t.sort_empty=[a]),{options:t,query:String(e||"").toLowerCase(),tokens:this.tokenize(e),total:0,items:[]}},e.prototype.search=function(e,t){var n,i,r,a,o=this;return i=this.prepareSearch(e,t),t=i.options,e=i.query,a=t.score||o.getScoreFunction(i),e.length?o.iterator(o.items,(function(e,r){n=a(e),(!1===t.filter||n>0)&&i.items.push({score:n,id:r})})):o.iterator(o.items,(function(e,t){i.items.push({score:1,id:t})})),(r=o.getSortFunction(i,t))&&i.items.sort(r),i.total=i.items.length,"number"==typeof t.limit&&(i.items=i.items.slice(0,t.limit)),i};var t=function(e,t){return"number"==typeof e&&"number"==typeof t?e>t?1:e<t?-1:0:(e=l(String(e||"")))>(t=l(String(t||"")))?1:t>e?-1:0},n=function(e){var t,n,i,r;for(t=1,n=arguments.length;t<n;t++)if(r=arguments[t])for(i in r)r.hasOwnProperty(i)&&(e[i]=r[i]);return e},i=function(e,t,n){if(e&&t){if(!n)return e[t];for(var i=t.split(".");i.length&&(e=e[i.shift()]););return e}},r=function(e){return(e+"").replace(/^\s+|\s+$|/g,"")},a=function(e){return(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")},o=Array.isArray||"undefined"!=typeof $&&$.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},s={a:"[a\u1e00\u1e01\u0102\u0103\xc2\xe2\u01cd\u01ce\u023a\u2c65\u0226\u0227\u1ea0\u1ea1\xc4\xe4\xc0\xe0\xc1\xe1\u0100\u0101\xc3\xe3\xc5\xe5\u0105\u0104\xc3\u0105\u0104]",b:"[b\u2422\u03b2\u0392B\u0e3f\ud800\udf01\u16d2]",c:"[c\u0106\u0107\u0108\u0109\u010c\u010d\u010a\u010bC\u0304c\u0304\xc7\xe7\u1e08\u1e09\u023b\u023c\u0187\u0188\u0255\u1d04\uff23\uff43]",d:"[d\u010e\u010f\u1e0a\u1e0b\u1e10\u1e11\u1e0c\u1e0d\u1e12\u1e13\u1e0e\u1e0f\u0110\u0111D\u0326d\u0326\u0189\u0256\u018a\u0257\u018b\u018c\u1d6d\u1d81\u1d91\u0221\u1d05\uff24\uff44\xf0]",e:"[e\xc9\xe9\xc8\xe8\xca\xea\u1e18\u1e19\u011a\u011b\u0114\u0115\u1ebc\u1ebd\u1e1a\u1e1b\u1eba\u1ebb\u0116\u0117\xcb\xeb\u0112\u0113\u0228\u0229\u0118\u0119\u1d92\u0246\u0247\u0204\u0205\u1ebe\u1ebf\u1ec0\u1ec1\u1ec4\u1ec5\u1ec2\u1ec3\u1e1c\u1e1d\u1e16\u1e17\u1e14\u1e15\u0206\u0207\u1eb8\u1eb9\u1ec6\u1ec7\u2c78\u1d07\uff25\uff45\u0258\u01dd\u018f\u0190\u03b5]",f:"[f\u0191\u0192\u1e1e\u1e1f]",g:"[g\u0262\u20b2\u01e4\u01e5\u011c\u011d\u011e\u011f\u0122\u0123\u0193\u0260\u0120\u0121]",h:"[h\u0124\u0125\u0126\u0127\u1e28\u1e29\u1e96\u1e96\u1e24\u1e25\u1e22\u1e23\u0266\u02b0\u01f6\u0195]",i:"[i\xcd\xed\xcc\xec\u012c\u012d\xce\xee\u01cf\u01d0\xcf\xef\u1e2e\u1e2f\u0128\u0129\u012e\u012f\u012a\u012b\u1ec8\u1ec9\u0208\u0209\u020a\u020b\u1eca\u1ecb\u1e2c\u1e2d\u0197\u0268\u0268\u0306\u1d7b\u1d96\u0130iI\u0131\u026a\uff29\uff49]",j:"[j\u0237\u0134\u0135\u0248\u0249\u029d\u025f\u02b2]",k:"[k\u0198\u0199\ua740\ua741\u1e30\u1e31\u01e8\u01e9\u1e32\u1e33\u1e34\u1e35\u03ba\u03f0\u20ad]",l:"[l\u0141\u0142\u013d\u013e\u013b\u013c\u0139\u013a\u1e36\u1e37\u1e38\u1e39\u1e3c\u1e3d\u1e3a\u1e3b\u013f\u0140\u023d\u019a\u2c60\u2c61\u2c62\u026b\u026c\u1d85\u026d\u0234\u029f\uff2c\uff4c]",n:"[n\u0143\u0144\u01f8\u01f9\u0147\u0148\xd1\xf1\u1e44\u1e45\u0145\u0146\u1e46\u1e47\u1e4a\u1e4b\u1e48\u1e49N\u0308n\u0308\u019d\u0272\u0220\u019e\u1d70\u1d87\u0273\u0235\u0274\uff2e\uff4e\u014a\u014b]",o:"[o\xd8\xf8\xd6\xf6\xd3\xf3\xd2\xf2\xd4\xf4\u01d1\u01d2\u0150\u0151\u014e\u014f\u022e\u022f\u1ecc\u1ecd\u019f\u0275\u01a0\u01a1\u1ece\u1ecf\u014c\u014d\xd5\xf5\u01ea\u01eb\u020c\u020d\u0555\u0585]",p:"[p\u1e54\u1e55\u1e56\u1e57\u2c63\u1d7d\u01a4\u01a5\u1d71]",q:"[q\ua756\ua757\u02a0\u024a\u024b\ua758\ua759q\u0303]",r:"[r\u0154\u0155\u024c\u024d\u0158\u0159\u0156\u0157\u1e58\u1e59\u0210\u0211\u0212\u0213\u1e5a\u1e5b\u2c64\u027d]",s:"[s\u015a\u015b\u1e60\u1e61\u1e62\u1e63\ua7a8\ua7a9\u015c\u015d\u0160\u0161\u015e\u015f\u0218\u0219S\u0308s\u0308]",t:"[t\u0164\u0165\u1e6a\u1e6b\u0162\u0163\u1e6c\u1e6d\u01ae\u0288\u021a\u021b\u1e70\u1e71\u1e6e\u1e6f\u01ac\u01ad]",u:"[u\u016c\u016d\u0244\u0289\u1ee4\u1ee5\xdc\xfc\xda\xfa\xd9\xf9\xdb\xfb\u01d3\u01d4\u0170\u0171\u016c\u016d\u01af\u01b0\u1ee6\u1ee7\u016a\u016b\u0168\u0169\u0172\u0173\u0214\u0215\u222a]",v:"[v\u1e7c\u1e7d\u1e7e\u1e7f\u01b2\u028b\ua75e\ua75f\u2c71\u028b]",w:"[w\u1e82\u1e83\u1e80\u1e81\u0174\u0175\u1e84\u1e85\u1e86\u1e87\u1e88\u1e89]",x:"[x\u1e8c\u1e8d\u1e8a\u1e8b\u03c7]",y:"[y\xdd\xfd\u1ef2\u1ef3\u0176\u0177\u0178\xff\u1ef8\u1ef9\u1e8e\u1e8f\u1ef4\u1ef5\u024e\u024f\u01b3\u01b4]",z:"[z\u0179\u017a\u1e90\u1e91\u017d\u017e\u017b\u017c\u1e92\u1e93\u1e94\u1e95\u01b5\u01b6]"},l=function(){var e,t,n,i,r="",a={};for(n in s)if(s.hasOwnProperty(n))for(r+=i=s[n].substring(2,s[n].length-1),e=0,t=i.length;e<t;e++)a[i.charAt(e)]=n;var o=new RegExp("["+r+"]","g");return function(e){return e.replace(o,(function(e){return a[e]})).toLowerCase()}}();return e})),
/**
 * microplugin.js
 * Copyright (c) 2013 Brian Reavis & contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the License at:
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
 * ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 *
 * @author Brian Reavis <brian@thirdroute.com>
 */
function(e,t){"function"==typeof define&&define.amd?define("microplugin",t):"object"==typeof exports?module.exports=t():e.MicroPlugin=t()}(this,(function(){var e={mixin:function(e){e.plugins={},e.prototype.initializePlugins=function(e){var n,i,r,a=this,o=[];if(a.plugins={names:[],settings:{},requested:{},loaded:{}},t.isArray(e))for(n=0,i=e.length;n<i;n++)"string"==typeof e[n]?o.push(e[n]):(a.plugins.settings[e[n].name]=e[n].options,o.push(e[n].name));else if(e)for(r in e)e.hasOwnProperty(r)&&(a.plugins.settings[r]=e[r],o.push(r));for(;o.length;)a.require(o.shift())},e.prototype.loadPlugin=function(t){var n=this,i=n.plugins,r=e.plugins[t];if(!e.plugins.hasOwnProperty(t))throw new Error('Unable to find "'+t+'" plugin');i.requested[t]=!0,i.loaded[t]=r.fn.apply(n,[n.plugins.settings[t]||{}]),i.names.push(t)},e.prototype.require=function(e){var t=this,n=t.plugins;if(!t.plugins.loaded.hasOwnProperty(e)){if(n.requested[e])throw new Error('Plugin has circular dependency ("'+e+'")');t.loadPlugin(e)}return n.loaded[e]},e.define=function(t,n){e.plugins[t]={name:t,fn:n}}}},t={isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}};return e})),
/**
 * selectize.js (v0.12.3)
 * Copyright (c) 2013–2015 Brian Reavis & contributors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the License at:
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
 * ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 *
 * @author Brian Reavis <brian@thirdroute.com>
 */
function(e,t){"function"==typeof define&&define.amd?define("selectize",["jquery","sifter","microplugin"],t):"object"==typeof exports?module.exports=t(require("jquery"),require("sifter"),require("microplugin")):e.Selectize=t(e.jQuery,e.Sifter,e.MicroPlugin)}(this,(function(e,t,n){"use strict";var i=function(e,t){if("string"!=typeof t||t.length){var n="string"==typeof t?new RegExp(t,"i"):t,i=function(e){var t=0;if(3===e.nodeType){var r=e.data.search(n);if(r>=0&&e.data.length>0){var a=e.data.match(n),o=document.createElement("span");o.className="highlight";var s=e.splitText(r),l=(s.splitText(a[0].length),s.cloneNode(!0));o.appendChild(l),s.parentNode.replaceChild(o,s),t=1}}else if(1===e.nodeType&&e.childNodes&&!/(script|style)/i.test(e.tagName))for(var d=0;d<e.childNodes.length;++d)d+=i(e.childNodes[d]);return t};return e.each((function(){i(this)}))}};jQuery.fn.removeHighlight=function(){return this.find("span.highlight").each((function(){this.parentNode.firstChild.nodeName;var e=this.parentNode;e.replaceChild(this.firstChild,this),e.normalize()})).end()};var r=function(){};r.prototype={on:function(e,t){this._events=this._events||{},this._events[e]=this._events[e]||[],this._events[e].push(t)},off:function(e,t){var n=arguments.length;return 0===n?delete this._events:1===n?delete this._events[e]:(this._events=this._events||{},void(e in this._events!=!1&&this._events[e].splice(this._events[e].indexOf(t),1)))},trigger:function(e){if(this._events=this._events||{},e in this._events!=!1)for(var t=0;t<this._events[e].length;t++)this._events[e][t].apply(this,Array.prototype.slice.call(arguments,1))}},r.mixin=function(e){for(var t=["on","off","trigger"],n=0;n<t.length;n++)e.prototype[t[n]]=r.prototype[t[n]]};var a=/Mac/.test(navigator.userAgent),o=65,s=13,l=27,d=37,c=38,u=80,f=39,h=40,p=78,g=8,m=46,v=16,y=a?91:17,_=a?18:17,b=9,E=1,w=2,T=!/android/i.test(window.navigator.userAgent)&&!!document.createElement("input").validity,S=function(e){return void 0!==e},C=function(e){return null==e?null:"boolean"==typeof e?e?"1":"0":e+""},k=function(e){return(e+"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},I={before:function(e,t,n){var i=e[t];e[t]=function(){return n.apply(e,arguments),i.apply(e,arguments)}},after:function(e,t,n){var i=e[t];e[t]=function(){var t=i.apply(e,arguments);return n.apply(e,arguments),t}}},A=function(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}},x=function(e,t){var n;return function(){var i=this,r=arguments;window.clearTimeout(n),n=window.setTimeout((function(){e.apply(i,r)}),t)}},D=function(e,t,n){var i,r=e.trigger,a={};for(i in e.trigger=function(){var n=arguments[0];if(-1===t.indexOf(n))return r.apply(e,arguments);a[n]=arguments},n.apply(e,[]),e.trigger=r,a)a.hasOwnProperty(i)&&r.apply(e,a[i])},R=function(e,t,n,i){e.on(t,n,(function(t){for(var n=t.target;n&&n.parentNode!==e[0];)n=n.parentNode;return t.currentTarget=n,i.apply(this,[t])}))},M=function(e){var t={};if("selectionStart"in e)t.start=e.selectionStart,t.length=e.selectionEnd-t.start;else if(document.selection){e.focus();var n=document.selection.createRange(),i=document.selection.createRange().text.length;n.moveStart("character",-e.value.length),t.start=n.text.length-i,t.length=i}return t},N=function(e,t,n){var i,r,a={};if(n)for(i=0,r=n.length;i<r;i++)a[n[i]]=e.css(n[i]);else a=e.css();t.css(a)},O=function(t,n){if(!t)return 0;var i=e("<test>").css({position:"absolute",top:-99999,left:-99999,width:"auto",padding:0,whiteSpace:"pre"}).text(t).appendTo("body");N(n,i,["letterSpacing","fontSize","fontFamily","fontWeight","textTransform"]);var r=i.width();return i.remove(),r},P=function(e){var t=null,n=function(n,i){var r,a,o,s,l,d,c,u;i=i||{},(n=n||window.event||{}).metaKey||n.altKey||(i.force||!1!==e.data("grow"))&&(r=e.val(),n.type&&"keydown"===n.type.toLowerCase()&&(o=(a=n.keyCode)>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57||32===a,a===m||a===g?(u=M(e[0])).length?r=r.substring(0,u.start)+r.substring(u.start+u.length):a===g&&u.start?r=r.substring(0,u.start-1)+r.substring(u.start+1):a===m&&void 0!==u.start&&(r=r.substring(0,u.start)+r.substring(u.start+1)):o&&(d=n.shiftKey,c=String.fromCharCode(n.keyCode),r+=c=d?c.toUpperCase():c.toLowerCase())),s=e.attr("placeholder"),!r&&s&&(r=s),(l=O(r,e)+4)!==t&&(t=l,e.width(l),e.triggerHandler("resize")))};e.on("keydown keyup update blur",n),n()},L=function(e){var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML},F=function(e,t){t||(t={});var n="Selectize";console.error(n+": "+e),t.explanation&&(console.group&&console.group(),console.error(t.explanation),console.group&&console.groupEnd())},j=function(n,i){var r,a,o,s,l=this;(s=n[0]).selectize=l;var d=window.getComputedStyle&&window.getComputedStyle(s,null);if(o=(o=d?d.getPropertyValue("direction"):s.currentStyle&&s.currentStyle.direction)||n.parents("[dir]:first").attr("dir")||"",e.extend(l,{order:0,settings:i,$input:n,tabIndex:n.attr("tabindex")||"",tagType:"select"===s.tagName.toLowerCase()?E:w,rtl:/rtl/i.test(o),eventNS:".selectize"+ ++j.count,highlightedValue:null,isOpen:!1,isDisabled:!1,isRequired:n.is("[required]"),isInvalid:!1,isLocked:!1,isFocused:!1,isInputHidden:!1,isSetup:!1,isShiftDown:!1,isCmdDown:!1,isCtrlDown:!1,ignoreFocus:!1,ignoreBlur:!1,ignoreHover:!1,hasOptions:!1,currentResults:null,lastValue:"",caretPos:0,loading:0,loadedSearches:{},$activeOption:null,$activeItems:[],optgroups:{},options:{},userOptions:{},items:[],renderCache:{},onSearchChange:null===i.loadThrottle?l.onSearchChange:x(l.onSearchChange,i.loadThrottle)}),l.sifter=new t(this.options,{diacritics:i.diacritics}),l.settings.options){for(r=0,a=l.settings.options.length;r<a;r++)l.registerOption(l.settings.options[r]);delete l.settings.options}if(l.settings.optgroups){for(r=0,a=l.settings.optgroups.length;r<a;r++)l.registerOptionGroup(l.settings.optgroups[r]);delete l.settings.optgroups}l.settings.mode=l.settings.mode||(1===l.settings.maxItems?"single":"multi"),"boolean"!=typeof l.settings.hideSelected&&(l.settings.hideSelected="multi"===l.settings.mode),l.initializePlugins(l.settings.plugins),l.setupCallbacks(),l.setupTemplates(),l.setup()};return r.mixin(j),void 0!==n?n.mixin(j):F("Dependency MicroPlugin is missing",{explanation:'Make sure you either: (1) are using the "standalone" version of Selectize, or (2) require MicroPlugin before you load Selectize.'}),e.extend(j.prototype,{setup:function(){var t,n,i,r,o,s,l,d,c,u,f=this,h=f.settings,p=f.eventNS,g=e(window),m=e(document),b=f.$input;if(l=f.settings.mode,d=b.attr("class")||"",t=e("<div>").addClass(h.wrapperClass).addClass(d).addClass(l),n=e("<div>").addClass(h.inputClass).addClass("items").appendTo(t),i=e('<input type="text" autocomplete="off" />').appendTo(n).attr("tabindex",b.is(":disabled")?"-1":f.tabIndex),s=e(h.dropdownParent||t),r=e("<div>").addClass(h.dropdownClass).addClass(l).hide().appendTo(s),o=e("<div>").addClass(h.dropdownContentClass).appendTo(r),(u=b.attr("id"))&&(i.attr("id",u+"-selectized"),e("label[for='"+u+"']").attr("for",u+"-selectized")),f.settings.copyClassesToDropdown&&r.addClass(d),t.css({width:b[0].style.width}),f.plugins.names.length&&(c="plugin-"+f.plugins.names.join(" plugin-"),t.addClass(c),r.addClass(c)),(null===h.maxItems||h.maxItems>1)&&f.tagType===E&&b.attr("multiple","multiple"),f.settings.placeholder&&i.attr("placeholder",h.placeholder),!f.settings.splitOn&&f.settings.delimiter){var w=f.settings.delimiter.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");f.settings.splitOn=new RegExp("\\s*"+w+"+\\s*")}b.attr("autocorrect")&&i.attr("autocorrect",b.attr("autocorrect")),b.attr("autocapitalize")&&i.attr("autocapitalize",b.attr("autocapitalize")),f.$wrapper=t,f.$control=n,f.$control_input=i,f.$dropdown=r,f.$dropdown_content=o,r.on("mouseenter","[data-selectable]",(function(){return f.onOptionHover.apply(f,arguments)})),r.on("mousedown click","[data-selectable]",(function(){return f.onOptionSelect.apply(f,arguments)})),R(n,"mousedown","*:not(input)",(function(){return f.onItemSelect.apply(f,arguments)})),P(i),n.on({mousedown:function(){return f.onMouseDown.apply(f,arguments)},click:function(){return f.onClick.apply(f,arguments)}}),i.on({mousedown:function(e){e.stopPropagation()},keydown:function(){return f.onKeyDown.apply(f,arguments)},keyup:function(){return f.onKeyUp.apply(f,arguments)},keypress:function(){return f.onKeyPress.apply(f,arguments)},resize:function(){f.positionDropdown.apply(f,[])},blur:function(){return f.onBlur.apply(f,arguments)},focus:function(){return f.ignoreBlur=!1,f.onFocus.apply(f,arguments)},paste:function(){return f.onPaste.apply(f,arguments)}}),m.on("keydown"+p,(function(e){f.isCmdDown=e[a?"metaKey":"ctrlKey"],f.isCtrlDown=e[a?"altKey":"ctrlKey"],f.isShiftDown=e.shiftKey})),m.on("keyup"+p,(function(e){e.keyCode===_&&(f.isCtrlDown=!1),e.keyCode===v&&(f.isShiftDown=!1),e.keyCode===y&&(f.isCmdDown=!1)})),m.on("mousedown"+p,(function(e){if(f.isFocused){if(e.target===f.$dropdown[0]||e.target.parentNode===f.$dropdown[0])return!1;f.$control.has(e.target).length||e.target===f.$control[0]||f.blur(e.target)}})),g.on(["scroll"+p,"resize"+p].join(" "),(function(){f.isOpen&&f.positionDropdown.apply(f,arguments)})),g.on("mousemove"+p,(function(){f.ignoreHover=!1})),this.revertSettings={$children:b.children().detach(),tabindex:b.attr("tabindex")},b.attr("tabindex",-1).hide().after(f.$wrapper),e.isArray(h.items)&&(f.setValue(h.items),delete h.items),T&&b.on("invalid"+p,(function(e){e.preventDefault(),f.isInvalid=!0,f.refreshState()})),f.updateOriginalInput(),f.refreshItems(),f.refreshState(),f.updatePlaceholder(),f.isSetup=!0,b.is(":disabled")&&f.disable(),f.on("change",this.onChange),b.data("selectize",f),b.addClass("selectized"),f.trigger("initialize"),!0===h.preload&&f.onSearchChange("")},setupTemplates:function(){var t=this,n=t.settings.labelField,i=t.settings.optgroupLabelField,r={optgroup:function(e){return'<div class="optgroup">'+e.html+"</div>"},optgroup_header:function(e,t){return'<div class="optgroup-header">'+t(e[i])+"</div>"},option:function(e,t){return`<div class="option ${e.disabled?"fsStateHidden":""}">${t(e[n])}</div>`},item:function(e,t){return'<div class="item">'+t(e[n])+"</div>"},option_create:function(e,t){return'<div class="create">Add <strong>'+t(e.input)+"</strong>&hellip;</div>"}};t.settings.render=e.extend({},r,t.settings.render)},setupCallbacks:function(){var e,t,n={initialize:"onInitialize",change:"onChange",item_add:"onItemAdd",item_remove:"onItemRemove",clear:"onClear",option_add:"onOptionAdd",option_remove:"onOptionRemove",option_clear:"onOptionClear",optgroup_add:"onOptionGroupAdd",optgroup_remove:"onOptionGroupRemove",optgroup_clear:"onOptionGroupClear",dropdown_open:"onDropdownOpen",dropdown_close:"onDropdownClose",type:"onType",load:"onLoad",focus:"onFocus",blur:"onBlur"};for(e in n)n.hasOwnProperty(e)&&(t=this.settings[n[e]])&&this.on(e,t)},onClick:function(e){var t=this;t.isFocused||(t.focus(),e.preventDefault())},onMouseDown:function(t){var n=this,i=t.isDefaultPrevented();e(t.target);if(n.isFocused){if(t.target!==n.$control_input[0])return"single"===n.settings.mode?n.isOpen?n.close():n.open():i||n.setActiveItem(null),!1}else i||window.setTimeout((function(){n.focus()}),0)},onChange:function(){this.$input.trigger("change")},onPaste:function(t){var n=this;n.isFull()||n.isInputHidden||n.isLocked?t.preventDefault():n.settings.splitOn&&setTimeout((function(){var t=n.$control_input.val();if(t.match(n.settings.splitOn))for(var i=e.trim(t).split(n.settings.splitOn),r=0,a=i.length;r<a;r++)n.createItem(i[r])}),0)},onKeyPress:function(e){if(this.isLocked)return e&&e.preventDefault();var t=String.fromCharCode(e.keyCode||e.which);return this.settings.create&&"multi"===this.settings.mode&&t===this.settings.delimiter?(this.createItem(),e.preventDefault(),!1):void 0},onKeyDown:function(e){e.target,this.$control_input[0];var t=this;if(t.isLocked)e.keyCode!==b&&e.preventDefault();else{switch(e.keyCode){case o:if(t.isCmdDown)return void t.selectAll();break;case l:return void(t.isOpen&&(e.preventDefault(),e.stopPropagation(),t.close()));case p:if(!e.ctrlKey||e.altKey)break;case h:if(!t.isOpen&&t.hasOptions)t.open();else if(t.$activeOption){t.ignoreHover=!0;var n=t.getAdjacentOption(t.$activeOption,1);n.length&&t.setActiveOption(n,!0,!0)}return void e.preventDefault();case u:if(!e.ctrlKey||e.altKey)break;case c:if(t.$activeOption){t.ignoreHover=!0;var i=t.getAdjacentOption(t.$activeOption,-1);i.length&&t.setActiveOption(i,!0,!0)}return void e.preventDefault();case s:return void(t.isOpen&&t.$activeOption&&(t.onOptionSelect({currentTarget:t.$activeOption}),e.preventDefault()));case d:return void t.advanceSelection(-1,e);case f:return void t.advanceSelection(1,e);case b:return t.settings.selectOnTab&&t.isOpen&&t.$activeOption&&(t.onOptionSelect({currentTarget:t.$activeOption}),t.isFull()||e.preventDefault()),void(t.settings.create&&t.createItem()&&e.preventDefault());case g:case m:return void t.deleteSelection(e)}!t.isFull()&&!t.isInputHidden||(a?e.metaKey:e.ctrlKey)||e.preventDefault()}},onKeyUp:function(e){var t=this;if(t.isLocked)return e&&e.preventDefault();var n=t.$control_input.val()||"";t.lastValue!==n&&(t.lastValue=n,t.onSearchChange(n),t.refreshOptions(),t.trigger("type",n))},onSearchChange:function(e){var t=this,n=t.settings.load;n&&(t.loadedSearches.hasOwnProperty(e)||(t.loadedSearches[e]=!0,t.load((function(i){n.apply(t,[e,i])}))))},onFocus:function(e){var t=this,n=t.isFocused;if(t.isDisabled)return t.blur(),e&&e.preventDefault(),!1;t.ignoreFocus||(t.isFocused=!0,"focus"===t.settings.preload&&t.onSearchChange(""),n||t.trigger("focus"),t.$activeItems.length||(t.showInput(),t.setActiveItem(null),t.refreshOptions(!!t.settings.openOnFocus)),t.refreshState())},onBlur:function(e,t){var n=this;if(n.isFocused&&(n.isFocused=!1,!n.ignoreFocus)){if(!n.ignoreBlur&&document.activeElement===n.$dropdown_content[0])return n.ignoreBlur=!0,void n.onFocus(e);var i=function(){n.close(),n.setTextboxValue(""),n.setActiveItem(null),n.setActiveOption(null),n.setCaret(n.items.length),n.refreshState(),t&&t.focus(),n.ignoreFocus=!1,n.trigger("blur")};n.ignoreFocus=!0,n.settings.create&&n.settings.createOnBlur?n.createItem(null,!1,i):i()}},onOptionHover:function(e){this.ignoreHover||this.setActiveOption(e.currentTarget,!1)},onOptionSelect:function(t){var n,i,r=this;t.preventDefault&&(t.preventDefault(),t.stopPropagation()),(i=e(t.currentTarget)).hasClass("create")?r.createItem(null,(function(){r.settings.closeAfterSelect&&r.close()})):void 0!==(n=i.attr("data-value"))&&(r.lastQuery=null,r.setTextboxValue(""),r.addItem(n),r.settings.closeAfterSelect?r.close():!r.settings.hideSelected&&t.type&&/mouse/.test(t.type)&&r.setActiveOption(r.getOption(n)))},onItemSelect:function(e){var t=this;t.isLocked||"multi"===t.settings.mode&&(e.preventDefault(),t.setActiveItem(e.currentTarget,e))},load:function(e){var t=this,n=t.$wrapper.addClass(t.settings.loadingClass);t.loading++,e.apply(t,[function(e){t.loading=Math.max(t.loading-1,0),e&&e.length&&(t.addOption(e),t.refreshOptions(t.isFocused&&!t.isInputHidden)),t.loading||n.removeClass(t.settings.loadingClass),t.trigger("load",e)}])},setTextboxValue:function(e){var t=this.$control_input;t.val()!==e&&(t.val(e).triggerHandler("update"),this.lastValue=e)},getValue:function(){return this.tagType===E&&this.$input.attr("multiple")?this.items:this.items.join(this.settings.delimiter)},setValue:function(e,t){D(this,t?[]:["change"],(function(){this.clear(t),this.addItems(e,t)}))},setActiveItem:function(t,n){var i,r,a,o,s,l,d,c,u=this;if("single"!==u.settings.mode){if(!(t=e(t)).length)return e(u.$activeItems).removeClass("active"),u.$activeItems=[],void(u.isFocused&&u.showInput());if("mousedown"===(i=n&&n.type.toLowerCase())&&u.isShiftDown&&u.$activeItems.length){for(c=u.$control.children(".active:last"),(o=Array.prototype.indexOf.apply(u.$control[0].childNodes,[c[0]]))>(s=Array.prototype.indexOf.apply(u.$control[0].childNodes,[t[0]]))&&(d=o,o=s,s=d),r=o;r<=s;r++)l=u.$control[0].childNodes[r],-1===u.$activeItems.indexOf(l)&&(e(l).addClass("active"),u.$activeItems.push(l));n.preventDefault()}else"mousedown"===i&&u.isCtrlDown||"keydown"===i&&this.isShiftDown?t.hasClass("active")?(a=u.$activeItems.indexOf(t[0]),u.$activeItems.splice(a,1),t.removeClass("active")):u.$activeItems.push(t.addClass("active")[0]):(e(u.$activeItems).removeClass("active"),u.$activeItems=[t.addClass("active")[0]]);u.hideInput(),this.isFocused||u.focus()}},setActiveOption:function(t,n,i){var r,a,o,s,l,d=this;d.$activeOption&&d.$activeOption.removeClass("active"),d.$activeOption=null,(t=e(t)).length&&(d.$activeOption=t.addClass("active"),!n&&S(n)||(r=d.$dropdown_content.height(),a=d.$activeOption.outerHeight(!0),n=d.$dropdown_content.scrollTop()||0,s=o=d.$activeOption.offset().top-d.$dropdown_content.offset().top+n,l=o-r+a,o+a>r+n?d.$dropdown_content.stop().animate({scrollTop:l},i?d.settings.scrollDuration:0):o<n&&d.$dropdown_content.stop().animate({scrollTop:s},i?d.settings.scrollDuration:0)))},selectAll:function(){var e=this;"single"!==e.settings.mode&&(e.$activeItems=Array.prototype.slice.apply(e.$control.children(":not(input)").addClass("active")),e.$activeItems.length&&(e.hideInput(),e.close()),e.focus())},hideInput:function(){var e=this;e.setTextboxValue(""),e.$control_input.css({opacity:0,position:"absolute",left:e.rtl?1e4:-1e4}),e.isInputHidden=!0},showInput:function(){this.$control_input.css({opacity:1,position:"relative",left:0}),this.isInputHidden=!1},focus:function(){var e=this;e.isDisabled||(e.ignoreFocus=!0,e.$control_input[0].focus(),window.setTimeout((function(){e.ignoreFocus=!1,e.onFocus()}),0))},blur:function(e){this.$control_input[0].blur(),this.onBlur(null,e)},getScoreFunction:function(e){return this.sifter.getScoreFunction(e,this.getSearchOptions())},getSearchOptions:function(){var e=this.settings,t=e.sortField;return"string"==typeof t&&(t=[{field:t}]),{fields:e.searchField,conjunction:e.searchConjunction,sort:t}},search:function(t){var n,i,r,a=this,o=a.settings,s=this.getSearchOptions();if(o.score&&"function"!=typeof(r=a.settings.score.apply(this,[t])))throw new Error('Selectize "score" setting must be a function that returns a function');if(t!==a.lastQuery?(a.lastQuery=t,i=a.sifter.search(t,e.extend(s,{score:r})),a.currentResults=i):i=e.extend(!0,{},a.currentResults),o.hideSelected)for(n=i.items.length-1;n>=0;n--)-1!==a.items.indexOf(C(i.items[n].id))&&i.items.splice(n,1);return i},refreshOptions:function(t){var n,r,a,o,s,l,d,c,u,f,h,p,g,m,v,y;void 0===t&&(t=!0);var _=this,b=e.trim(_.$control_input.val()),E=_.search(b),w=_.$dropdown_content,T=_.$activeOption&&C(_.$activeOption.attr("data-value"));for(o=E.items.length,"number"==typeof _.settings.maxOptions&&(o=Math.min(o,_.settings.maxOptions)),s={},l=[],n=0;n<o;n++)for(d=_.options[E.items[n].id],c=_.render("option",d),u=d[_.settings.optgroupField]||"",r=0,a=(f=e.isArray(u)?u:[u])&&f.length;r<a;r++)u=f[r],_.optgroups.hasOwnProperty(u)||(u=""),s.hasOwnProperty(u)||(s[u]=document.createDocumentFragment(),l.push(u)),s[u].appendChild(c);for(this.settings.lockOptgroupOrder&&l.sort((function(e,t){return(_.optgroups[e].$order||0)-(_.optgroups[t].$order||0)})),h=document.createDocumentFragment(),n=0,o=l.length;n<o;n++)u=l[n],_.optgroups.hasOwnProperty(u)&&s[u].childNodes.length?((p=document.createDocumentFragment()).appendChild(_.render("optgroup_header",_.optgroups[u])),p.appendChild(s[u]),h.appendChild(_.render("optgroup",e.extend({},_.optgroups[u],{html:L(p),dom:p})))):h.appendChild(s[u]);if(w.html(h),_.settings.highlight&&E.query.length&&E.tokens.length)for(w.removeHighlight(),n=0,o=E.tokens.length;n<o;n++)i(w,E.tokens[n].regex);if(!_.settings.hideSelected)for(n=0,o=_.items.length;n<o;n++)_.getOption(_.items[n]).addClass("selected");(g=_.canCreate(b))&&(w.prepend(_.render("option_create",{input:b})),y=e(w[0].childNodes[0])),_.hasOptions=E.items.length>0||g,_.hasOptions?(E.items.length>0?((v=T&&_.getOption(T))&&v.length?m=v:"single"===_.settings.mode&&_.items.length&&(m=_.getOption(_.items[0])),m&&m.length||(m=y&&!_.settings.addPrecedence?_.getAdjacentOption(y,1):w.find("[data-selectable]:first"))):m=y,_.setActiveOption(m),t&&!_.isOpen&&_.open()):(_.setActiveOption(null),t&&_.isOpen&&_.close())},addOption:function(t){var n,i,r,a=this;if(e.isArray(t))for(n=0,i=t.length;n<i;n++)a.addOption(t[n]);else(r=a.registerOption(t))&&(a.userOptions[r]=!0,a.lastQuery=null,a.trigger("option_add",r,t))},registerOption:function(e){var t=C(e[this.settings.valueField]);return null!=t&&!this.options.hasOwnProperty(t)&&(e.$order=e.$order||++this.order,this.options[t]=e,t)},registerOptionGroup:function(e){var t=C(e[this.settings.optgroupValueField]);return!!t&&(e.$order=e.$order||++this.order,this.optgroups[t]=e,t)},addOptionGroup:function(e,t){t[this.settings.optgroupValueField]=e,(e=this.registerOptionGroup(t))&&this.trigger("optgroup_add",e,t)},removeOptionGroup:function(e){this.optgroups.hasOwnProperty(e)&&(delete this.optgroups[e],this.renderCache={},this.trigger("optgroup_remove",e))},clearOptionGroups:function(){this.optgroups={},this.renderCache={},this.trigger("optgroup_clear")},updateOption:function(t,n){var i,r,a,o,s,l,d,c=this;if(t=C(t),a=C(n[c.settings.valueField]),null!==t&&c.options.hasOwnProperty(t)){if("string"!=typeof a)throw new Error("Value must be set in option data");d=c.options[t].$order,a!==t&&(delete c.options[t],-1!==(o=c.items.indexOf(t))&&c.items.splice(o,1,a)),n.$order=n.$order||d,c.options[a]=n,s=c.renderCache.item,l=c.renderCache.option,s&&(delete s[t],delete s[a]),l&&(delete l[t],delete l[a]),-1!==c.items.indexOf(a)&&(i=c.getItem(t),r=e(c.render("item",n)),i.hasClass("active")&&r.addClass("active"),i.replaceWith(r)),c.lastQuery=null,c.isOpen&&c.refreshOptions(!1)}},removeOption:function(e,t){var n=this;e=C(e);var i=n.renderCache.item,r=n.renderCache.option;i&&delete i[e],r&&delete r[e],delete n.userOptions[e],delete n.options[e],n.lastQuery=null,n.trigger("option_remove",e),n.removeItem(e,t)},clearOptions:function(e){var t=this;t.loadedSearches={},t.userOptions={},t.renderCache={},t.options=t.sifter.items={},t.lastQuery=null,t.trigger("option_clear"),t.clear(e)},getOption:function(e){return this.getElementWithValue(e,this.$dropdown_content.find("[data-selectable]"))},getAdjacentOption:function(t,n){var i=this.$dropdown.find("[data-selectable]"),r=i.index(t)+n;return r>=0&&r<i.length?i.eq(r):e()},getElementWithValue:function(t,n){if(null!=(t=C(t)))for(var i=0,r=n.length;i<r;i++)if(n[i].getAttribute("data-value")===t)return e(n[i]);return e()},getItem:function(e){return this.getElementWithValue(e,this.$control.children())},addItems:function(t,n){for(var i=e.isArray(t)?t:[t],r=0,a=i.length;r<a;r++)this.isPending=r<a-1,this.addItem(i[r],n)},addItem:function(t,n){D(this,n?[]:["change"],(function(){var i,r,a,o,s,l=this,d=l.settings.mode;t=C(t),-1===l.items.indexOf(t)?l.options.hasOwnProperty(t)&&("single"===d&&l.clear(n),"multi"===d&&l.isFull()||(i=e(l.render("item",l.options[t])),s=l.isFull(),l.items.splice(l.caretPos,0,t),l.insertAtCaret(i),(!l.isPending||!s&&l.isFull())&&l.refreshState(),l.isSetup&&(a=l.$dropdown_content.find("[data-selectable]"),l.isPending||(r=l.getOption(t),o=l.getAdjacentOption(r,1).attr("data-value"),l.refreshOptions(l.isFocused&&"single"!==d),o&&l.setActiveOption(l.getOption(o))),!a.length||l.isFull()?l.close():l.positionDropdown(),l.updatePlaceholder(),l.trigger("item_add",t,i),l.updateOriginalInput({silent:n})))):"single"===d&&l.close()}))},removeItem:function(e,t){var n,i,r,a=this;n="object"==typeof e?e:a.getItem(e),e=C(n.attr("data-value")),-1!==(i=a.items.indexOf(e))&&(n.remove(),n.hasClass("active")&&(r=a.$activeItems.indexOf(n[0]),a.$activeItems.splice(r,1)),a.items.splice(i,1),a.lastQuery=null,!a.settings.persist&&a.userOptions.hasOwnProperty(e)&&a.removeOption(e,t),i<a.caretPos&&a.setCaret(a.caretPos-1),a.refreshState(),a.updatePlaceholder(),a.updateOriginalInput({silent:t}),a.positionDropdown(),a.trigger("item_remove",e,n))},createItem:function(t,n){var i=this,r=i.caretPos;t=t||e.trim(i.$control_input.val()||"");var a=arguments[arguments.length-1];if("function"!=typeof a&&(a=function(){}),"boolean"!=typeof n&&(n=!0),!i.canCreate(t))return a(),!1;i.lock();var o="function"==typeof i.settings.create?this.settings.create:function(e){var t={};return t[i.settings.labelField]=e,t[i.settings.valueField]=e,t},s=A((function(e){if(i.unlock(),!e||"object"!=typeof e)return a();var t=C(e[i.settings.valueField]);if("string"!=typeof t)return a();i.setTextboxValue(""),i.addOption(e),i.setCaret(r),i.addItem(t),i.refreshOptions(n&&"single"!==i.settings.mode),a(e)})),l=o.apply(this,[t,s]);return void 0!==l&&s(l),!0},refreshItems:function(){this.lastQuery=null,this.isSetup&&this.addItem(this.items),this.refreshState(),this.updateOriginalInput()},refreshState:function(){this.refreshValidityState(),this.refreshClasses()},refreshValidityState:function(){if(!this.isRequired)return!1;var e=!this.items.length;this.isInvalid=e,this.$control_input.prop("required",e),this.$input.prop("required",!e)},refreshClasses:function(){var t=this,n=t.isFull(),i=t.isLocked;t.$wrapper.toggleClass("rtl",t.rtl),t.$control.toggleClass("focus",t.isFocused).toggleClass("disabled",t.isDisabled).toggleClass("required",t.isRequired).toggleClass("invalid",t.isInvalid).toggleClass("locked",i).toggleClass("full",n).toggleClass("not-full",!n).toggleClass("input-active",t.isFocused&&!t.isInputHidden).toggleClass("dropdown-active",t.isOpen).toggleClass("has-options",!e.isEmptyObject(t.options)).toggleClass("has-items",t.items.length>0),t.$control_input.data("grow",!n&&!i)},isFull:function(){return null!==this.settings.maxItems&&this.items.length>=this.settings.maxItems},updateOriginalInput:function(e){var t,n,i,r,a=this;if(e=e||{},a.tagType===E){for(i=[],t=0,n=a.items.length;t<n;t++)r=a.options[a.items[t]][a.settings.labelField]||"",i.push('<option value="'+k(a.items[t])+'" selected="selected">'+k(r)+"</option>");i.length||this.$input.attr("multiple")||i.push('<option value="" selected="selected"></option>'),a.$input.html(i.join(""))}else a.$input.val(a.getValue()),a.$input.attr("value",a.$input.val());a.isSetup&&(e.silent||a.trigger("change",a.$input.val()))},updatePlaceholder:function(){if(this.settings.placeholder){var e=this.$control_input;this.items.length?e.removeAttr("placeholder"):e.attr("placeholder",this.settings.placeholder),e.triggerHandler("update",{force:!0})}},open:function(){var e=this;e.isLocked||e.isOpen||"multi"===e.settings.mode&&e.isFull()||(e.focus(),e.isOpen=!0,e.refreshState(),e.$dropdown.css({visibility:"hidden",display:"block"}),e.positionDropdown(),e.$dropdown.css({visibility:"visible"}),e.trigger("dropdown_open",e.$dropdown))},close:function(){var e=this,t=e.isOpen;"single"===e.settings.mode&&e.items.length&&(e.hideInput(),e.$control_input.blur()),e.isOpen=!1,e.$dropdown.hide(),e.setActiveOption(null),e.refreshState(),t&&e.trigger("dropdown_close",e.$dropdown)},positionDropdown:function(){var e=this.$control,t="body"===this.settings.dropdownParent?e.offset():e.position();t.top+=e.outerHeight(!0),this.$dropdown.css({width:e.outerWidth(),top:t.top,left:t.left})},clear:function(e){var t=this;t.items.length&&(t.$control.children(":not(input)").remove(),t.items=Object.values(t.options).length?t.items.filter((e=>t.options[e].disabled)):[],t.lastQuery=null,t.setCaret(0),t.setActiveItem(null),t.updatePlaceholder(),t.updateOriginalInput({silent:e}),t.refreshState(),t.showInput(),t.trigger("clear"))},insertAtCaret:function(t){var n=Math.min(this.caretPos,this.items.length);0===n?this.$control.prepend(t):e(this.$control[0].childNodes[n]).before(t),this.setCaret(n+1)},deleteSelection:function(t){var n,i,r,a,o,s,l,d,c,u=this;if(r=t&&t.keyCode===g?-1:1,a=M(u.$control_input[0]),u.$activeOption&&!u.settings.hideSelected&&(l=u.getAdjacentOption(u.$activeOption,-1).attr("data-value")),o=[],u.$activeItems.length){for(c=u.$control.children(".active:"+(r>0?"last":"first")),s=u.$control.children(":not(input)").index(c),r>0&&s++,n=0,i=u.$activeItems.length;n<i;n++)o.push(e(u.$activeItems[n]).attr("data-value"));t&&(t.preventDefault(),t.stopPropagation())}else(u.isFocused||"single"===u.settings.mode)&&u.items.length&&(r<0&&0===a.start&&0===a.length?o.push(u.items[u.caretPos-1]):r>0&&a.start===u.$control_input.val().length&&o.push(u.items[u.caretPos]));if(!o.length||"function"==typeof u.settings.onDelete&&!1===u.settings.onDelete.apply(u,[o]))return!1;for(void 0!==s&&u.setCaret(s);o.length;)u.removeItem(o.pop());return u.showInput(),u.positionDropdown(),u.refreshOptions(!0),l&&(d=u.getOption(l)).length&&u.setActiveOption(d),!0},advanceSelection:function(e,t){var n,i,r,a,o,s=this;0!==e&&(s.rtl&&(e*=-1),n=e>0?"last":"first",i=M(s.$control_input[0]),s.isFocused&&!s.isInputHidden?(a=s.$control_input.val().length,(e<0?0===i.start&&0===i.length:i.start===a)&&!a&&s.advanceCaret(e,t)):(o=s.$control.children(".active:"+n)).length&&(r=s.$control.children(":not(input)").index(o),s.setActiveItem(null),s.setCaret(e>0?r+1:r)))},advanceCaret:function(e,t){var n,i,r=this;0!==e&&(n=e>0?"next":"prev",r.isShiftDown?(i=r.$control_input[n]()).length&&(r.hideInput(),r.setActiveItem(i),t&&t.preventDefault()):r.setCaret(r.caretPos+e))},setCaret:function(t){var n,i,r,a,o=this;if(t="single"===o.settings.mode?o.items.length:Math.max(0,Math.min(o.items.length,t)),!o.isPending)for(n=0,i=(r=o.$control.children(":not(input)")).length;n<i;n++)a=e(r[n]).detach(),n<t?o.$control_input.before(a):o.$control.append(a);o.caretPos=t},lock:function(){this.close(),this.isLocked=!0,this.refreshState()},unlock:function(){this.isLocked=!1,this.refreshState()},disable:function(){var e=this;e.$input.prop("disabled",!0),e.$control_input.prop("disabled",!0).prop("tabindex",-1),e.isDisabled=!0,e.lock()},enable:function(){var e=this;e.$input.prop("disabled",!1),e.$control_input.prop("disabled",!1).prop("tabindex",e.tabIndex),e.isDisabled=!1,e.unlock()},destroy:function(){var t=this,n=t.eventNS,i=t.revertSettings;t.trigger("destroy"),t.off(),t.$wrapper.remove(),t.$dropdown.remove(),t.$input.html("").append(i.$children).removeAttr("tabindex").removeClass("selectized").attr({tabindex:i.tabindex}).show(),t.$control_input.removeData("grow"),t.$input.removeData("selectize"),e(window).off(n),e(document).off(n),e(document.body).off(n),delete t.$input[0].selectize},render:function(t,n){var i,r,a="",o=!1,s=this;return"option"!==t&&"item"!==t||(o=!!(i=C(n[s.settings.valueField]))),o&&(S(s.renderCache[t])||(s.renderCache[t]={}),s.renderCache[t].hasOwnProperty(i))?s.renderCache[t][i]:(a=e(s.settings.render[t].apply(this,[n,k])),"option"===t||"option_create"===t?a.attr("data-selectable",""):"optgroup"===t&&(r=n[s.settings.optgroupValueField]||"",a.attr("data-group",r)),"option"!==t&&"item"!==t||a.attr("data-value",i||""),o&&(s.renderCache[t][i]=a[0]),a[0])},clearCache:function(e){var t=this;void 0===e?t.renderCache={}:delete t.renderCache[e]},canCreate:function(e){var t=this;if(!t.settings.create)return!1;var n=t.settings.createFilter;return e.length&&("function"!=typeof n||n.apply(t,[e]))&&("string"!=typeof n||new RegExp(n).test(e))&&(!(n instanceof RegExp)||n.test(e))}}),j.count=0,j.defaults={options:[],optgroups:[],plugins:[],delimiter:",",splitOn:null,persist:!0,diacritics:!0,create:!1,createOnBlur:!1,createFilter:null,highlight:!0,openOnFocus:!0,maxOptions:1e3,maxItems:null,hideSelected:null,addPrecedence:!1,selectOnTab:!1,preload:!1,allowEmptyOption:!1,closeAfterSelect:!1,scrollDuration:60,loadThrottle:300,loadingClass:"loading",dataAttr:"data-data",optgroupField:"optgroup",valueField:"value",labelField:"text",disabledField:"disabled",optgroupLabelField:"label",optgroupValueField:"value",lockOptgroupOrder:!1,sortField:"$order",searchField:["text"],searchConjunction:"and",mode:null,wrapperClass:"selectize-control",inputClass:"selectize-input",dropdownClass:"selectize-dropdown",dropdownContentClass:"selectize-dropdown-content",dropdownParent:null,copyClassesToDropdown:!0,render:{}},e.fn.selectize=function(t){var n=e.fn.selectize.defaults,i=e.extend({},n,t),r=i.dataAttr,a=i.labelField,o=i.valueField,s=i.disabledField,l=i.optgroupField,d=i.optgroupLabelField,c=i.optgroupValueField,u=function(t,n){var s,l,d,c,u=t.attr(r);if(u)for(n.options=JSON.parse(u),s=0,l=n.options.length;s<l;s++)n.items.push(n.options[s][o]);else{var f=e.trim(t.val()||"");if(!i.allowEmptyOption&&!f.length)return;for(s=0,l=(d=f.split(i.delimiter)).length;s<l;s++)(c={})[a]=d[s],c[o]=d[s],n.options.push(c);n.items=d}},f=function(t,n){var u,f,h,p,g=n.options,m={},v=function(e){var t=r&&e.attr(r);return"string"==typeof t&&t.length?JSON.parse(t):null},y=function(t,r){t=e(t);var d=C(t.val());if(d||i.allowEmptyOption)if(m.hasOwnProperty(d)){if(r){var c=m[d][l]
;c?e.isArray(c)?c.push(r):m[d][l]=[c,r]:m[d][l]=r}}else{var u=v(t)||{};u[a]=u[a]||t.text(),u[o]=u[o]||d,u[l]=u[l]||r,u[s]=t.prop(s),m[d]=u,g.push(u),t.is(":selected")&&n.items.push(d)}},_=function(t){var i,r,a,o,s;for((a=(t=e(t)).attr("label"))&&((o=v(t)||{})[d]=a,o[c]=a,n.optgroups.push(o)),i=0,r=(s=e("option",t)).length;i<r;i++)y(s[i],a)};for(n.maxItems=t.attr("multiple")?null:1,u=0,f=(p=t.children()).length;u<f;u++)"optgroup"===(h=p[u].tagName.toLowerCase())?_(p[u]):"option"===h&&y(p[u])};return this.each((function(){if(!this.selectize){var r=e(this),a=this.tagName.toLowerCase(),o=r.attr("placeholder")||r.attr("data-placeholder");o||i.allowEmptyOption||(o=r.children('option[value=""]').text());var s={placeholder:o,options:[],optgroups:[],items:[]};"select"===a?f(r,s):u(r,s),new j(r,e.extend(!0,{},n,s,t))}}))},e.fn.selectize.defaults=j.defaults,e.fn.selectize.support={validity:T},j.define("drag_drop",(function(){if(!e.fn.sortable)throw new Error('The "drag_drop" plugin requires jQuery UI "sortable".');if("multi"===this.settings.mode){var t,n=this;n.lock=(t=n.lock,function(){var e=n.$control.data("sortable");return e&&e.disable(),t.apply(n,arguments)}),n.unlock=function(){var e=n.unlock;return function(){var t=n.$control.data("sortable");return t&&t.enable(),e.apply(n,arguments)}}(),n.setup=function(){var t=n.setup;return function(){t.apply(this,arguments);var i=n.$control.sortable({items:"[data-value]",forcePlaceholderSize:!0,disabled:n.isLocked,start:function(e,t){t.placeholder.css("width",t.helper.css("width")),i.css({overflow:"visible"})},stop:function(){i.css({overflow:"hidden"});var t=n.$activeItems?n.$activeItems.slice():null,r=[];i.children("[data-value]").each((function(){r.push(e(this).attr("data-value"))})),n.setValue(r),n.setActiveItem(t)}})}}()}})),j.define("dropdown_header",(function(t){var n,i=this;t=e.extend({title:"Untitled",headerClass:"selectize-dropdown-header",titleRowClass:"selectize-dropdown-header-title",labelClass:"selectize-dropdown-header-label",closeClass:"selectize-dropdown-header-close",html:function(e){return'<div class="'+e.headerClass+'"><div class="'+e.titleRowClass+'"><span class="'+e.labelClass+'">'+e.title+'</span><a href="javascript:void(0)" class="'+e.closeClass+'">&times;</a></div></div>'}},t),i.setup=(n=i.setup,function(){n.apply(i,arguments),i.$dropdown_header=e(t.html(t)),i.$dropdown.prepend(i.$dropdown_header)})})),j.define("optgroup_columns",(function(t){var n,i=this;t=e.extend({equalizeWidth:!0,equalizeHeight:!0},t),this.getAdjacentOption=function(t,n){var i=t.closest("[data-group]").find("[data-selectable]"),r=i.index(t)+n;return r>=0&&r<i.length?i.eq(r):e()},this.onKeyDown=(n=i.onKeyDown,function(e){var t,r,a,o;return!this.isOpen||e.keyCode!==d&&e.keyCode!==f?n.apply(this,arguments):(i.ignoreHover=!0,t=(o=this.$activeOption.closest("[data-group]")).find("[data-selectable]").index(this.$activeOption),void((r=(a=(o=e.keyCode===d?o.prev("[data-group]"):o.next("[data-group]")).find("[data-selectable]")).eq(Math.min(a.length-1,t))).length&&this.setActiveOption(r)))});var r=function(){var e,t=r.width,n=document;return void 0===t&&((e=n.createElement("div")).innerHTML='<div style="width:50px;height:50px;position:absolute;left:-50px;top:-50px;overflow:auto;"><div style="width:1px;height:100px;"></div></div>',e=e.firstChild,n.body.appendChild(e),t=r.width=e.offsetWidth-e.clientWidth,n.body.removeChild(e)),t},a=function(){var n,a,o,s,l,d,c;if((a=(c=e("[data-group]",i.$dropdown_content)).length)&&i.$dropdown_content.width()){if(t.equalizeHeight){for(o=0,n=0;n<a;n++)o=Math.max(o,c.eq(n).height());c.css({height:o})}t.equalizeWidth&&(d=i.$dropdown_content.innerWidth()-r(),s=Math.round(d/a),c.css({width:s}),a>1&&(l=d-s*(a-1),c.eq(a-1).css({width:l})))}};(t.equalizeHeight||t.equalizeWidth)&&(I.after(this,"positionDropdown",a),I.after(this,"refreshOptions",a))})),j.define("remove_button",(function(t){t=e.extend({label:"&times;",title:"Remove",className:"remove",append:!0},t);var n=function(t,n){n.className="remove-single";var i,r=t,a='<a href="javascript:void(0)" class="'+n.className+'" tabindex="-1" title="'+k(n.title)+'">'+n.label+"</a>",o=function(e,t){return e+t};t.setup=(i=r.setup,function(){if(n.append){var s=e(r.$input.context).attr("id"),l=(e("#"+s),r.settings.render.item);r.settings.render.item=function(e){return o(l.apply(t,arguments),a)}}i.apply(t,arguments),t.$control.on("click","."+n.className,(function(e){e.preventDefault(),r.isLocked||r.clear()}))})},i=function(t,n){var i,r=t,a='<a href="javascript:void(0)" class="'+n.className+'" tabindex="-1" title="'+k(n.title)+'">'+n.label+"</a>",o=function(e,t){var n=e.search(/(<\/[^>]+>\s*)$/);return e.substring(0,n)+t+e.substring(n)};t.setup=(i=r.setup,function(){if(n.append){var s=r.settings.render.item;r.settings.render.item=function(e){return o(s.apply(t,arguments),a)}}i.apply(t,arguments),t.$control.on("click","."+n.className,(function(t){if(t.preventDefault(),!r.isLocked){var n=e(t.currentTarget).parent();r.setActiveItem(n),r.deleteSelection()&&r.setCaret(r.items.length)}}))})};"single"!==this.settings.mode?i(this,t):n(this,t)})),j.define("restore_on_backspace",(function(e){var t,n=this;e.text=e.text||function(e){return e[this.settings.labelField]},this.onKeyDown=(t=n.onKeyDown,function(n){var i,r;return n.keyCode===g&&""===this.$control_input.val()&&!this.$activeItems.length&&(i=this.caretPos-1)>=0&&i<this.items.length?(r=this.options[this.items[i]],this.deleteSelection(n)&&(this.setTextboxValue(e.text.apply(this,[r])),this.refreshOptions(!0)),void n.preventDefault()):t.apply(this,arguments)})})),j})),Selectize.define("fsSelectize",(function(){"use strict";function e(e){var t,i;n.settings.showSelected||n.settings.showSelectedLabel?(n.$control.find(".fsSelected").remove(),e.forEach((function(e){var t=n.settings.showSelectedLabel?n.options[e].text:e;n.$control.prepend('<div class="fsSelected">'+t+"</div>")}))):(i=n.$control.find(".fsNumSelected"),t=e.length+" selected",i.length?e.length>0?i.html(t):i.remove():n.$control.prepend('<div class="fsNumSelected">'+t+"</div>"))}var t,n=this,i=37,r=39,a=8,o=46;n.onKeyDown=(t=n.onKeyDown,function(e){switch(e.keyCode){case a:case o:"single"==n.settings.mode?n.clear():$(e.target.parentElement).find(".active").length>0&&(n.clear(),n.trigger("item_remove","multiselect-none"));break;case i:case r:return;default:return t.apply(n,[e])}}),n.onOptionSelect=function(){var t=n.onOptionSelect,i=!1;return function(r){var a;if(r.preventDefault&&(r.preventDefault(),r.stopPropagation()),"mousedown"==r.type)i=!0;else if("click"==r.type&&i)return void(i=!1);if(a=$(r.currentTarget),$(n.$dropdown_content[0]).find(".option.selected")&&"single"==n.settings.mode&&$(n.$dropdown_content[0]).find(".option.selected").removeClass("selected"),a.hasClass("selected")){if("single"==n.settings.mode)return;n.removeItem(a),a.removeClass("selected"),n.refreshOptions(),e(n.items),n.positionDropdown()}else{var o=a.attr("data-value");"selectAll"==o?(n.addAllItems(),n.trigger("item_add","multiselect-all","x")):"selectNone"==o?(n.clear(),$(n.$dropdown_content[0]).find(".option.selected").removeClass("selected"),n.trigger("item_remove","multiselect-none")):t.apply(n,[r])}}}(),n.refreshOptions=function(){var e=n.refreshOptions;return function(t){if(e.apply(n,[t]),"multi"==n.settings.mode&&0==n.$control_input.val().length){var i,r=$(n)[0].$input.data("maxitems"),a=$(n.$dropdown_content[0]).find(".option:not(.fsSelectAll)").length;a==n.items.length?i="None":(null===r||a<r)&&(i="All"),i&&!n.settings.hideSelectAll&&$('<div class="fsSelectAll option" data-selectable="" data-value="select'+i+'"> - Select '+i+" - </div>").prependTo(n.$dropdown_content)}var o=$.map(n.items,(function(e){return n.options[e].text}));$(n.$control).prop("title",o.join(", "))}}(),n.addItem=function(){var e=n.addItem;return function(){if("multi"==n.settings.mode){if(n.isFull())return void alert("This field is limited to "+n.settings.maxItems+" items.");var t=n.settings.maxItems;n.settings.maxItems=null,e.apply(n,arguments),n.settings.maxItems=t}else e.apply(n,arguments)}}(),n.open=function(){var e=n.open;return function(){var t=n.settings.maxItems;n.settings.maxItems=null,e.apply(n),n.settings.maxItems=t}}(),n.insertAtCaret=function(){e(n.items)},n.clear=function(){var e=n.clear;return function(){var t=n.items.length;e.apply(n,arguments),t&&(n.refreshOptions(),n.positionDropdown())}}(),n.addAllItems=function(){var t;$(n.$dropdown_content[0]).find(".option:not(.selected, .fsSelectAll)").each((function(e,i){t=$(i).attr("data-value"),-1==n.items.indexOf(t)&&n.options.hasOwnProperty(t)&&!n.isFull()&&n.items.splice(n.caretPos,0,t)})),e(n.items),n.refreshState(),n.positionDropdown(),n.updatePlaceholder(),n.updateOriginalInput(),n.refreshOptions()}})),((e,t,n)=>{function i(e,t,n,i){return e.empty().append(t),n.setContent(e),e.removeAttr("hidden"),n.addContent(i),[t,n]}function r(t,n,i,r){n.open(r),d(i,t),e.util.updateDynamicImages(i)}function a(e,t,n){_('<button id="fsPagePopHideButton">Don\'t Show Again</button>').appendTo(e).click((()=>{const e=t.getContentElement().find(".slick-current");C.setItem(m(e.length>0?e:n),new Date),t.close()}))}function o(e){return y.filter(e,(e=>["","scroll"].includes(_(e).data("delay-option"))))}function s(e){return y.filter(e,(e=>""===_(e).data("delay-option")))}function l(){return[_('<div id="fsPagePopControls"></div>'),w.Dialog({closeOnClick:!0,dialogClass:"fsPagePopDialog",id:"fsPagePop"}),!1]}function d(e,t){if(e.length<=1)return;const n=_('<span id="fsPagePopDotsContainer"></span>'),i=_('<button data-role="none" id="fsPagePopNextButton" aria-label="Next" tabindex="0" role="button"><span>&#8250;</span></button>'),r=_('<button data-role="none" id="fsPagePopPrevButton" aria-label="Previous" tabindex="0" role="button"><span>&#8249;</span></button>'),a=e.parent();_("#fsPagePopPaging").remove(),_('<div id="fsPagePopPaging"></div>').append(r).append(n).append(i).prependTo(t),a.slick({appendDots:n,dots:!0,dotsClass:"fsPagePopDots",infinite:!1,nextArrow:i,prevArrow:r}).resize()}function c(){return E.scrollTop()>=(b.height()-E.height())/2}function u(e,t,n,r,o){a(e,n,t),[t,r]=g(t,r);const s=t.parent().clone(),l=t.clone();[t,n]=i(s,l,n,e),!S&&r&&(n.attachToPage(),o(e,n,t))}function f(e){return y.filter(e,(e=>"scroll"===_(e).data("delay-option")))}function h(e,t,i){E.on("scroll.pagepops",y.throttle((()=>{c()&&(E.off("scroll.pagepops"),r(e,t,i,_(n.body)))}),1e3))}function p(e,t,i,a){setTimeout((()=>{r(e,t,i,_(n.body))}),a)}function g(e,t){if(e.length>1)e=e.get().sort(((e,n)=>{const i=_(e),r=_(n),a=C.getItem(m(i)),o=C.getItem(m(r)),s=i.data("reset-at"),l=r.data("reset-at");let d,c,u=!!a,f=!!o;return s&&u&&new Date(s)>new Date(a)&&(u=!1),l&&f&&new Date(l)>new Date(o)&&(f=!1),t=t||!u||!f,u==f?(d=new Date(i.data("visible-at")),c=new Date(r.data("visible-at")),c-d):a?1:-1}));else{const n=e.first(),i=C.getItem(m(n)),r=!!i,a=n.data("reset-at");t=!r||new Date(a)>new Date(i)}return[_(e),t]}function m(e){return"page_pop_"+e.data("id")}function v(e){return y.filter(e,(e=>"time"===_(e).data("delay-option")))}const y=e._,_=e.$,b=_(n),E=_(t),w=e.getInternalNS("dialogs"),T=n.getElementById("fsPagePopCollection"),S=e.getInternalNS("elements.utils").inDraftMode(),C=e.localStorage;T&&_((()=>{const e=_(T).find(".fsPagePop");let t,d,c,m,w={};w.allPagePops=e,w.immediatePagePops=_(E.height()>=b.height()?o(e):s(e)),w.scrollPagePops=_(E.height()>=b.height()?[]:f(e)),w.timePagePops=_(v(e)),y.each(w,((e,o)=>{if(e.length)switch(o){case"allPagePops":_(`<button id="fsPagePopNotification" aria-label="View Page Pops"><span>${e.length}</span></button>`).appendTo(n.body).click((function(){[t,d,c]=l();let n=e.parent().clone(),o=e.clone();[o,c]=g(o,c),[o,d]=i(n,o,d,t),a(t,d,o),r(t,d,o,_(this))}));break;case"immediatePagePops":[t,d,c]=l(),u(t,e,d,c,((e,t,i)=>{r(e,t,i,_(n.body))}));break;case"scrollPagePops":[t,d,c]=l(),u(t,e,d,c,((e,t,n)=>{h(e,t,n)}));break;case"timePagePops":m=y.groupBy(e,(e=>_(e).data("delay-time"))),y.each(m,((e,n)=>{[t,d,c]=l(),u(t,_(e),d,c,((e,t,i)=>{p(e,t,i,1e3*parseInt(n))}))}))}}))}))})(FS,window,document),function(e){"use strict";var t,n=e.$,i=e.getNS("SSO"),r="fsStateLoaded";i.embedFaria=function(){var e=n(".fsFariaLinks:not(."+r+")");e.length&&(t||(t=n.get("/fs/sso/fariaLinks.cfm")),t.done((function(t){e.addClass(r).html(t)})))}}(FS),window.jQuery=FS._jQueryTemp;