| Server IP : 54.36.91.62 / Your IP : 216.73.217.94 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/media/com_comment/cache/ |
Upload File : |
/*!
* Vue.js v2.6.11
* (c) 2014-2019 Evan You
* Released under the MIT License.
*/!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Vue=t()}(this,function(){"use strict";var e=Object.freeze({});function t(e){return null==e}function n(e){return null!=e}function r(e){return!0===e}function i(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function o(e){return null!==e&&"object"==typeof e}var a=Object.prototype.toString;function s(e){return"[object Object]"===a.call(e)}function c(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function u(e){return n(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function l(e){return null==e?"":Array.isArray(e)||s(e)&&e.toString===a?JSON.stringify(e,null,2):String(e)}function f(e){var t=parseFloat(e);return isNaN(t)?e:t}function p(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var d=p("slot,component",!0),v=p("key,ref,slot,slot-scope,is");function h(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}var m=Object.prototype.hasOwnProperty;function y(e,t){return m.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var _=/-(\w)/g,b=g(function(e){return e.replace(_,function(e,t){return t?t.toUpperCase():""})}),$=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),w=/\B([A-Z])/g,C=g(function(e){return e.replace(w,"-$1").toLowerCase()});var x=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function k(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n<e.length;n++)e[n]&&A(t,e[n]);return t}function S(e,t,n){}var T=function(e,t,n){return!1},E=function(e){return e};function N(e,t){if(e===t)return!0;var n=o(e),r=o(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),a=Array.isArray(t);if(i&&a)return e.length===t.length&&e.every(function(e,n){return N(e,t[n])});if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(i||a)return!1;var s=Object.keys(e),c=Object.keys(t);return s.length===c.length&&s.every(function(n){return N(e[n],t[n])})}catch(e){return!1}}function j(e,t){for(var n=0;n<e.length;n++)if(N(e[n],t))return n;return-1}function D(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}var L="data-server-rendered",M=["component","directive","filter"],I=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured","serverPrefetch"],F={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:T,isReservedAttr:T,isUnknownElement:T,getTagNamespace:S,parsePlatformTagName:E,mustUseProp:T,async:!0,_lifecycleHooks:I},P=/a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;function R(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}var H=new RegExp("[^"+P.source+".$_\\d]");var B,U="__proto__"in{},z="undefined"!=typeof window,V="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,K=V&&WXEnvironment.platform.toLowerCase(),J=z&&window.navigator.userAgent.toLowerCase(),q=J&&/msie|trident/.test(J),W=J&&J.indexOf("msie 9.0")>0,Z=J&&J.indexOf("edge/")>0,G=(J&&J.indexOf("android"),J&&/iphone|ipad|ipod|ios/.test(J)||"ios"===K),X=(J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J),J&&J.match(/firefox\/(\d+)/)),Y={}.watch,Q=!1;if(z)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){Q=!0}}),window.addEventListener("test-passive",null,ee)}catch(e){}var te=function(){return void 0===B&&(B=!z&&!V&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),B},ne=z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function re(e){return"function"==typeof e&&/native code/.test(e.toString())}var ie,oe="undefined"!=typeof Symbol&&re(Symbol)&&"undefined"!=typeof Reflect&&re(Reflect.ownKeys);ie="undefined"!=typeof Set&&re(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ae=S,se=0,ce=function(){this.id=se++,this.subs=[]};ce.prototype.addSub=function(e){this.subs.push(e)},ce.prototype.removeSub=function(e){h(this.subs,e)},ce.prototype.depend=function(){ce.target&&ce.target.addDep(this)},ce.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},ce.target=null;var ue=[];function le(e){ue.push(e),ce.target=e}function fe(){ue.pop(),ce.target=ue[ue.length-1]}var pe=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},de={child:{configurable:!0}};de.child.get=function(){return this.componentInstance},Object.defineProperties(pe.prototype,de);var ve=function(e){void 0===e&&(e="");var t=new pe;return t.text=e,t.isComment=!0,t};function he(e){return new pe(void 0,void 0,void 0,String(e))}function me(e){var t=new pe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ye=Array.prototype,ge=Object.create(ye);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=ye[e];R(ge,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var _e=Object.getOwnPropertyNames(ge),be=!0;function $e(e){be=e}var we=function(e){var t;this.value=e,this.dep=new ce,this.vmCount=0,R(e,"__ob__",this),Array.isArray(e)?(U?(t=ge,e.__proto__=t):function(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];R(e,o,t[o])}}(e,ge,_e),this.observeArray(e)):this.walk(e)};function Ce(e,t){var n;if(o(e)&&!(e instanceof pe))return y(e,"__ob__")&&e.__ob__ instanceof we?n=e.__ob__:be&&!te()&&(Array.isArray(e)||s(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new we(e)),t&&n&&n.vmCount++,n}function xe(e,t,n,r,i){var o=new ce,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,c=a&&a.set;s&&!c||2!==arguments.length||(n=e[t]);var u=!i&&Ce(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return ce.target&&(o.depend(),u&&(u.dep.depend(),Array.isArray(t)&&function e(t){for(var n=void 0,r=0,i=t.length;r<i;r++)(n=t[r])&&n.__ob__&&n.__ob__.dep.depend(),Array.isArray(n)&&e(n)}(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!=t&&r!=r||s&&!c||(c?c.call(e,t):n=t,u=!i&&Ce(t),o.notify())}})}}function ke(e,t,n){if(Array.isArray(e)&&c(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(xe(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function Ae(e,t){if(Array.isArray(e)&&c(t))e.splice(t,1);else{var n=e.__ob__;e._isVue||n&&n.vmCount||y(e,t)&&(delete e[t],n&&n.dep.notify())}}we.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)xe(e,t[n])},we.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)Ce(e[t])};var Oe=F.optionMergeStrategies;function Se(e,t){if(!t)return e;for(var n,r,i,o=oe?Reflect.ownKeys(t):Object.keys(t),a=0;a<o.length;a++)"__ob__"!==(n=o[a])&&(r=e[n],i=t[n],y(e,n)?r!==i&&s(r)&&s(i)&&Se(r,i):ke(e,n,i));return e}function Te(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,i="function"==typeof e?e.call(n,n):e;return r?Se(r,i):i}:t?e?function(){return Se("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function Ee(e,t){var n=t?e?e.concat(t):Array.isArray(t)?t:[t]:e;return n?function(e){for(var t=[],n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t}(n):n}function Ne(e,t,n,r){var i=Object.create(e||null);return t?A(i,t):i}Oe.data=function(e,t,n){return n?Te(e,t,n):t&&"function"!=typeof t?e:Te(e,t)},I.forEach(function(e){Oe[e]=Ee}),M.forEach(function(e){Oe[e+"s"]=Ne}),Oe.watch=function(e,t,n,r){if(e===Y&&(e=void 0),t===Y&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};for(var o in A(i,e),t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Oe.props=Oe.methods=Oe.inject=Oe.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return A(i,e),t&&A(i,t),i},Oe.provide=Te;var je=function(e,t){return void 0===t?e:t};function De(e,t,n){if("function"==typeof t&&(t=t.options),function(e,t){var n=e.props;if(n){var r,i,o={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o[b(i)]={type:null});else if(s(n))for(var a in n)i=n[a],o[b(a)]=s(i)?i:{type:i};e.props=o}}(t),function(e,t){var n=e.inject;if(n){var r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(s(n))for(var o in n){var a=n[o];r[o]=s(a)?A({from:o},a):{from:a}}}}(t),function(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}(t),!t._base&&(t.extends&&(e=De(e,t.extends,n)),t.mixins))for(var r=0,i=t.mixins.length;r<i;r++)e=De(e,t.mixins[r],n);var o,a={};for(o in e)c(o);for(o in t)y(e,o)||c(o);function c(r){var i=Oe[r]||je;a[r]=i(e[r],t[r],n,r)}return a}function Le(e,t,n,r){if("string"==typeof n){var i=e[t];if(y(i,n))return i[n];var o=b(n);if(y(i,o))return i[o];var a=$(o);return y(i,a)?i[a]:i[n]||i[o]||i[a]}}function Me(e,t,n,r){var i=t[e],o=!y(n,e),a=n[e],s=Pe(Boolean,i.type);if(s>-1)if(o&&!y(i,"default"))a=!1;else if(""===a||a===C(e)){var c=Pe(String,i.type);(c<0||s<c)&&(a=!0)}if(void 0===a){a=function(e,t,n){if(!y(t,"default"))return;var r=t.default;if(e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n])return e._props[n];return"function"==typeof r&&"Function"!==Ie(t.type)?r.call(e):r}(r,i,e);var u=be;$e(!0),Ce(a),$e(u)}return a}function Ie(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function Fe(e,t){return Ie(e)===Ie(t)}function Pe(e,t){if(!Array.isArray(t))return Fe(t,e)?0:-1;for(var n=0,r=t.length;n<r;n++)if(Fe(t[n],e))return n;return-1}function Re(e,t,n){le();try{if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{if(!1===i[o].call(r,e,t,n))return}catch(e){Be(e,r,"errorCaptured hook")}}Be(e,t,n)}finally{fe()}}function He(e,t,n,r,i){var o;try{(o=n?e.apply(t,n):e.call(t))&&!o._isVue&&u(o)&&!o._handled&&(o.catch(function(e){return Re(e,r,i+" (Promise/async)")}),o._handled=!0)}catch(e){Re(e,r,i)}return o}function Be(e,t,n){if(F.errorHandler)try{return F.errorHandler.call(null,e,t,n)}catch(t){t!==e&&Ue(t,null,"config.errorHandler")}Ue(e,t,n)}function Ue(e,t,n){if(!z&&!V||"undefined"==typeof console)throw e;console.error(e)}var ze,Ve=!1,Ke=[],Je=!1;function qe(){Je=!1;var e=Ke.slice(0);Ke.length=0;for(var t=0;t<e.length;t++)e[t]()}if("undefined"!=typeof Promise&&re(Promise)){var We=Promise.resolve();ze=function(){We.then(qe),G&&setTimeout(S)},Ve=!0}else if(q||"undefined"==typeof MutationObserver||!re(MutationObserver)&&"[object MutationObserverConstructor]"!==MutationObserver.toString())ze="undefined"!=typeof setImmediate&&re(setImmediate)?function(){setImmediate(qe)}:function(){setTimeout(qe,0)};else{var Ze=1,Ge=new MutationObserver(qe),Xe=document.createTextNode(String(Ze));Ge.observe(Xe,{characterData:!0}),ze=function(){Ze=(Ze+1)%2,Xe.data=String(Ze)},Ve=!0}function Ye(e,t){var n;if(Ke.push(function(){if(e)try{e.call(t)}catch(e){Re(e,t,"nextTick")}else n&&n(t)}),Je||(Je=!0,ze()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}var Qe=new ie;function et(e){!function e(t,n){var r,i;var a=Array.isArray(t);if(!a&&!o(t)||Object.isFrozen(t)||t instanceof pe)return;if(t.__ob__){var s=t.__ob__.dep.id;if(n.has(s))return;n.add(s)}if(a)for(r=t.length;r--;)e(t[r],n);else for(i=Object.keys(t),r=i.length;r--;)e(t[i[r]],n)}(e,Qe),Qe.clear()}var tt=g(function(e){var t="&"===e.charAt(0),n="~"===(e=t?e.slice(1):e).charAt(0),r="!"===(e=n?e.slice(1):e).charAt(0);return{name:e=r?e.slice(1):e,once:n,capture:r,passive:t}});function nt(e,t){function n(){var e=arguments,r=n.fns;if(!Array.isArray(r))return He(r,null,arguments,t,"v-on handler");for(var i=r.slice(),o=0;o<i.length;o++)He(i[o],null,e,t,"v-on handler")}return n.fns=e,n}function rt(e,n,i,o,a,s){var c,u,l,f;for(c in e)u=e[c],l=n[c],f=tt(c),t(u)||(t(l)?(t(u.fns)&&(u=e[c]=nt(u,s)),r(f.once)&&(u=e[c]=a(f.name,u,f.capture)),i(f.name,u,f.capture,f.passive,f.params)):u!==l&&(l.fns=u,e[c]=l));for(c in n)t(e[c])&&o((f=tt(c)).name,n[c],f.capture)}function it(e,i,o){var a;e instanceof pe&&(e=e.data.hook||(e.data.hook={}));var s=e[i];function c(){o.apply(this,arguments),h(a.fns,c)}t(s)?a=nt([c]):n(s.fns)&&r(s.merged)?(a=s).fns.push(c):a=nt([s,c]),a.merged=!0,e[i]=a}function ot(e,t,r,i,o){if(n(t)){if(y(t,r))return e[r]=t[r],o||delete t[r],!0;if(y(t,i))return e[r]=t[i],o||delete t[i],!0}return!1}function at(e){return i(e)?[he(e)]:Array.isArray(e)?function e(o,a){var s=[];var c,u,l,f;for(c=0;c<o.length;c++)t(u=o[c])||"boolean"==typeof u||(l=s.length-1,f=s[l],Array.isArray(u)?u.length>0&&(st((u=e(u,(a||"")+"_"+c))[0])&&st(f)&&(s[l]=he(f.text+u[0].text),u.shift()),s.push.apply(s,u)):i(u)?st(f)?s[l]=he(f.text+u):""!==u&&s.push(he(u)):st(u)&&st(f)?s[l]=he(f.text+u.text):(r(o._isVList)&&n(u.tag)&&t(u.key)&&n(a)&&(u.key="__vlist"+a+"_"+c+"__"),s.push(u)));return s}(e):void 0}function st(e){return n(e)&&n(e.text)&&!1===e.isComment}function ct(e,t){if(e){for(var n=Object.create(null),r=oe?Reflect.ownKeys(e):Object.keys(e),i=0;i<r.length;i++){var o=r[i];if("__ob__"!==o){for(var a=e[o].from,s=t;s;){if(s._provided&&y(s._provided,a)){n[o]=s._provided[a];break}s=s.$parent}if(!s&&"default"in e[o]){var c=e[o].default;n[o]="function"==typeof c?c.call(t):c}}}return n}}function ut(e,t){if(!e||!e.length)return{};for(var n={},r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,c=n[s]||(n[s]=[]);"template"===o.tag?c.push.apply(c,o.children||[]):c.push(o)}}for(var u in n)n[u].every(lt)&&delete n[u];return n}function lt(e){return e.isComment&&!e.asyncFactory||" "===e.text}function ft(t,n,r){var i,o=Object.keys(n).length>0,a=t?!!t.$stable:!o,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==e&&s===r.$key&&!o&&!r.$hasNormal)return r;for(var c in i={},t)t[c]&&"$"!==c[0]&&(i[c]=pt(n,c,t[c]))}else i={};for(var u in n)u in i||(i[u]=dt(n,u));return t&&Object.isExtensible(t)&&(t._normalized=i),R(i,"$stable",a),R(i,"$key",s),R(i,"$hasNormal",o),i}function pt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"==typeof e&&!Array.isArray(e)?[e]:at(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function dt(e,t){return function(){return e[t]}}function vt(e,t){var r,i,a,s,c;if(Array.isArray(e)||"string"==typeof e)for(r=new Array(e.length),i=0,a=e.length;i<a;i++)r[i]=t(e[i],i);else if("number"==typeof e)for(r=new Array(e),i=0;i<e;i++)r[i]=t(i+1,i);else if(o(e))if(oe&&e[Symbol.iterator]){r=[];for(var u=e[Symbol.iterator](),l=u.next();!l.done;)r.push(t(l.value,r.length)),l=u.next()}else for(s=Object.keys(e),r=new Array(s.length),i=0,a=s.length;i<a;i++)c=s[i],r[i]=t(e[c],c,i);return n(r)||(r=[]),r._isVList=!0,r}function ht(e,t,n,r){var i,o=this.$scopedSlots[e];o?(n=n||{},r&&(n=A(A({},r),n)),i=o(n)||t):i=this.$slots[e]||t;var a=n&&n.slot;return a?this.$createElement("template",{slot:a},i):i}function mt(e){return Le(this.$options,"filters",e)||E}function yt(e,t){return Array.isArray(e)?-1===e.indexOf(t):e!==t}function gt(e,t,n,r,i){var o=F.keyCodes[t]||n;return i&&r&&!F.keyCodes[t]?yt(i,r):o?yt(o,e):r?C(r)!==t:void 0}function _t(e,t,n,r,i){if(n)if(o(n)){var a;Array.isArray(n)&&(n=O(n));var s=function(o){if("class"===o||"style"===o||v(o))a=e;else{var s=e.attrs&&e.attrs.type;a=r||F.mustUseProp(t,s,o)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}var c=b(o),u=C(o);c in a||u in a||(a[o]=n[o],i&&((e.on||(e.on={}))["update:"+o]=function(e){n[o]=e}))};for(var c in n)s(c)}else;return e}function bt(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?r:(wt(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),"__static__"+e,!1),r)}function $t(e,t,n){return wt(e,"__once__"+t+(n?"_"+n:""),!0),e}function wt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&Ct(e[r],t+"_"+r,n);else Ct(e,t,n)}function Ct(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function xt(e,t){if(t)if(s(t)){var n=e.on=e.on?A({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function kt(e,t,n,r){t=t||{$stable:!n};for(var i=0;i<e.length;i++){var o=e[i];Array.isArray(o)?kt(o,t,n):o&&(o.proxy&&(o.fn.proxy=!0),t[o.key]=o.fn)}return r&&(t.$key=r),t}function At(e,t){for(var n=0;n<t.length;n+=2){var r=t[n];"string"==typeof r&&r&&(e[t[n]]=t[n+1])}return e}function Ot(e,t){return"string"==typeof e?t+e:e}function St(e){e._o=$t,e._n=f,e._s=l,e._l=vt,e._t=ht,e._q=N,e._i=j,e._m=bt,e._f=mt,e._k=gt,e._b=_t,e._v=he,e._e=ve,e._u=kt,e._g=xt,e._d=At,e._p=Ot}function Tt(t,n,i,o,a){var s,c=this,u=a.options;y(o,"_uid")?(s=Object.create(o))._original=o:(s=o,o=o._original);var l=r(u._compiled),f=!l;this.data=t,this.props=n,this.children=i,this.parent=o,this.listeners=t.on||e,this.injections=ct(u.inject,o),this.slots=function(){return c.$slots||ft(t.scopedSlots,c.$slots=ut(i,o)),c.$slots},Object.defineProperty(this,"scopedSlots",{enumerable:!0,get:function(){return ft(t.scopedSlots,this.slots())}}),l&&(this.$options=u,this.$slots=this.slots(),this.$scopedSlots=ft(t.scopedSlots,this.$slots)),u._scopeId?this._c=function(e,t,n,r){var i=Pt(s,e,t,n,r,f);return i&&!Array.isArray(i)&&(i.fnScopeId=u._scopeId,i.fnContext=o),i}:this._c=function(e,t,n,r){return Pt(s,e,t,n,r,f)}}function Et(e,t,n,r,i){var o=me(e);return o.fnContext=n,o.fnOptions=r,t.slot&&((o.data||(o.data={})).slot=t.slot),o}function Nt(e,t){for(var n in t)e[b(n)]=t[n]}St(Tt.prototype);var jt={init:function(e,t){if(e.componentInstance&&!e.componentInstance._isDestroyed&&e.data.keepAlive){var r=e;jt.prepatch(r,r)}else{(e.componentInstance=function(e,t){var r={_isComponent:!0,_parentVnode:e,parent:t},i=e.data.inlineTemplate;n(i)&&(r.render=i.render,r.staticRenderFns=i.staticRenderFns);return new e.componentOptions.Ctor(r)}(e,Wt)).$mount(t?e.elm:void 0,t)}},prepatch:function(t,n){var r=n.componentOptions;!function(t,n,r,i,o){var a=i.data.scopedSlots,s=t.$scopedSlots,c=!!(a&&!a.$stable||s!==e&&!s.$stable||a&&t.$scopedSlots.$key!==a.$key),u=!!(o||t.$options._renderChildren||c);t.$options._parentVnode=i,t.$vnode=i,t._vnode&&(t._vnode.parent=i);if(t.$options._renderChildren=o,t.$attrs=i.data.attrs||e,t.$listeners=r||e,n&&t.$options.props){$e(!1);for(var l=t._props,f=t.$options._propKeys||[],p=0;p<f.length;p++){var d=f[p],v=t.$options.props;l[d]=Me(d,v,n,t)}$e(!0),t.$options.propsData=n}r=r||e;var h=t.$options._parentListeners;t.$options._parentListeners=r,qt(t,r,h),u&&(t.$slots=ut(o,i.context),t.$forceUpdate())}(n.componentInstance=t.componentInstance,r.propsData,r.listeners,n,r.children)},insert:function(e){var t,n=e.context,r=e.componentInstance;r._isMounted||(r._isMounted=!0,Yt(r,"mounted")),e.data.keepAlive&&(n._isMounted?((t=r)._inactive=!1,en.push(t)):Xt(r,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?function e(t,n){if(n&&(t._directInactive=!0,Gt(t)))return;if(!t._inactive){t._inactive=!0;for(var r=0;r<t.$children.length;r++)e(t.$children[r]);Yt(t,"deactivated")}}(t,!0):t.$destroy())}},Dt=Object.keys(jt);function Lt(i,a,s,c,l){if(!t(i)){var f=s.$options._base;if(o(i)&&(i=f.extend(i)),"function"==typeof i){var p;if(t(i.cid)&&void 0===(i=function(e,i){if(r(e.error)&&n(e.errorComp))return e.errorComp;if(n(e.resolved))return e.resolved;var a=Ht;a&&n(e.owners)&&-1===e.owners.indexOf(a)&&e.owners.push(a);if(r(e.loading)&&n(e.loadingComp))return e.loadingComp;if(a&&!n(e.owners)){var s=e.owners=[a],c=!0,l=null,f=null;a.$on("hook:destroyed",function(){return h(s,a)});var p=function(e){for(var t=0,n=s.length;t<n;t++)s[t].$forceUpdate();e&&(s.length=0,null!==l&&(clearTimeout(l),l=null),null!==f&&(clearTimeout(f),f=null))},d=D(function(t){e.resolved=Bt(t,i),c?s.length=0:p(!0)}),v=D(function(t){n(e.errorComp)&&(e.error=!0,p(!0))}),m=e(d,v);return o(m)&&(u(m)?t(e.resolved)&&m.then(d,v):u(m.component)&&(m.component.then(d,v),n(m.error)&&(e.errorComp=Bt(m.error,i)),n(m.loading)&&(e.loadingComp=Bt(m.loading,i),0===m.delay?e.loading=!0:l=setTimeout(function(){l=null,t(e.resolved)&&t(e.error)&&(e.loading=!0,p(!1))},m.delay||200)),n(m.timeout)&&(f=setTimeout(function(){f=null,t(e.resolved)&&v(null)},m.timeout)))),c=!1,e.loading?e.loadingComp:e.resolved}}(p=i,f)))return function(e,t,n,r,i){var o=ve();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}(p,a,s,c,l);a=a||{},$n(i),n(a.model)&&function(e,t){var r=e.model&&e.model.prop||"value",i=e.model&&e.model.event||"input";(t.attrs||(t.attrs={}))[r]=t.model.value;var o=t.on||(t.on={}),a=o[i],s=t.model.callback;n(a)?(Array.isArray(a)?-1===a.indexOf(s):a!==s)&&(o[i]=[s].concat(a)):o[i]=s}(i.options,a);var d=function(e,r,i){var o=r.options.props;if(!t(o)){var a={},s=e.attrs,c=e.props;if(n(s)||n(c))for(var u in o){var l=C(u);ot(a,c,u,l,!0)||ot(a,s,u,l,!1)}return a}}(a,i);if(r(i.options.functional))return function(t,r,i,o,a){var s=t.options,c={},u=s.props;if(n(u))for(var l in u)c[l]=Me(l,u,r||e);else n(i.attrs)&&Nt(c,i.attrs),n(i.props)&&Nt(c,i.props);var f=new Tt(i,c,a,o,t),p=s.render.call(null,f._c,f);if(p instanceof pe)return Et(p,i,f.parent,s);if(Array.isArray(p)){for(var d=at(p)||[],v=new Array(d.length),h=0;h<d.length;h++)v[h]=Et(d[h],i,f.parent,s);return v}}(i,d,a,s,c);var v=a.on;if(a.on=a.nativeOn,r(i.options.abstract)){var m=a.slot;a={},m&&(a.slot=m)}!function(e){for(var t=e.hook||(e.hook={}),n=0;n<Dt.length;n++){var r=Dt[n],i=t[r],o=jt[r];i===o||i&&i._merged||(t[r]=i?Mt(o,i):o)}}(a);var y=i.options.name||l;return new pe("vue-component-"+i.cid+(y?"-"+y:""),a,void 0,void 0,void 0,s,{Ctor:i,propsData:d,listeners:v,tag:l,children:c},p)}}}function Mt(e,t){var n=function(n,r){e(n,r),t(n,r)};return n._merged=!0,n}var It=1,Ft=2;function Pt(e,a,s,c,u,l){return(Array.isArray(s)||i(s))&&(u=c,c=s,s=void 0),r(l)&&(u=Ft),function(e,i,a,s,c){if(n(a)&&n(a.__ob__))return ve();n(a)&&n(a.is)&&(i=a.is);if(!i)return ve();Array.isArray(s)&&"function"==typeof s[0]&&((a=a||{}).scopedSlots={default:s[0]},s.length=0);c===Ft?s=at(s):c===It&&(s=function(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}(s));var u,l;if("string"==typeof i){var f;l=e.$vnode&&e.$vnode.ns||F.getTagNamespace(i),u=F.isReservedTag(i)?new pe(F.parsePlatformTagName(i),a,s,void 0,void 0,e):a&&a.pre||!n(f=Le(e.$options,"components",i))?new pe(i,a,s,void 0,void 0,e):Lt(f,a,e,s,i)}else u=Lt(i,a,e,s);return Array.isArray(u)?u:n(u)?(n(l)&&function e(i,o,a){i.ns=o;"foreignObject"===i.tag&&(o=void 0,a=!0);if(n(i.children))for(var s=0,c=i.children.length;s<c;s++){var u=i.children[s];n(u.tag)&&(t(u.ns)||r(a)&&"svg"!==u.tag)&&e(u,o,a)}}(u,l),n(a)&&function(e){o(e.style)&&et(e.style);o(e.class)&&et(e.class)}(a),u):ve()}(e,a,s,c,u)}var Rt,Ht=null;function Bt(e,t){return(e.__esModule||oe&&"Module"===e[Symbol.toStringTag])&&(e=e.default),o(e)?t.extend(e):e}function Ut(e){return e.isComment&&e.asyncFactory}function zt(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var r=e[t];if(n(r)&&(n(r.componentOptions)||Ut(r)))return r}}function Vt(e,t){Rt.$on(e,t)}function Kt(e,t){Rt.$off(e,t)}function Jt(e,t){var n=Rt;return function r(){null!==t.apply(null,arguments)&&n.$off(e,r)}}function qt(e,t,n){Rt=e,rt(t,n||{},Vt,Kt,Jt,e),Rt=void 0}var Wt=null;function Zt(e){var t=Wt;return Wt=e,function(){Wt=t}}function Gt(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function Xt(e,t){if(t){if(e._directInactive=!1,Gt(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)Xt(e.$children[n]);Yt(e,"activated")}}function Yt(e,t){le();var n=e.$options[t],r=t+" hook";if(n)for(var i=0,o=n.length;i<o;i++)He(n[i],e,null,e,r);e._hasHookEvent&&e.$emit("hook:"+t),fe()}var Qt=[],en=[],tn={},nn=!1,rn=!1,on=0;var an=0,sn=Date.now;if(z&&!q){var cn=window.performance;cn&&"function"==typeof cn.now&&sn()>document.createEvent("Event").timeStamp&&(sn=function(){return cn.now()})}function un(){var e,t;for(an=sn(),rn=!0,Qt.sort(function(e,t){return e.id-t.id}),on=0;on<Qt.length;on++)(e=Qt[on]).before&&e.before(),t=e.id,tn[t]=null,e.run();var n=en.slice(),r=Qt.slice();on=Qt.length=en.length=0,tn={},nn=rn=!1,function(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,Xt(e[t],!0)}(n),function(e){var t=e.length;for(;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&!r._isDestroyed&&Yt(r,"updated")}}(r),ne&&F.devtools&&ne.emit("flush")}var ln=0,fn=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ln,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new ie,this.newDepIds=new ie,this.expression="","function"==typeof t?this.getter=t:(this.getter=function(e){if(!H.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}(t),this.getter||(this.getter=S)),this.value=this.lazy?void 0:this.get()};fn.prototype.get=function(){var e;le(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;Re(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&et(e),fe(),this.cleanupDeps()}return e},fn.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},fn.prototype.cleanupDeps=function(){for(var e=this.deps.length;e--;){var t=this.deps[e];this.newDepIds.has(t.id)||t.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},fn.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():function(e){var t=e.id;if(null==tn[t]){if(tn[t]=!0,rn){for(var n=Qt.length-1;n>on&&Qt[n].id>e.id;)n--;Qt.splice(n+1,0,e)}else Qt.push(e);nn||(nn=!0,Ye(un))}}(this)},fn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||o(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Re(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},fn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||h(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var pn={enumerable:!0,configurable:!0,get:S,set:S};function dn(e,t,n){pn.get=function(){return this[t][n]},pn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,pn)}function vn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[];e.$parent&&$e(!1);var o=function(o){i.push(o);var a=Me(o,t,n,e);xe(r,o,a),o in e||dn(e,"_props",o)};for(var a in t)o(a);$e(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?S:x(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;s(t=e._data="function"==typeof t?function(e,t){le();try{return e.call(t,t)}catch(e){return Re(e,t,"data()"),{}}finally{fe()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&y(r,o)||(a=void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&dn(e,"_data",o))}var a;Ce(t,!0)}(e):Ce(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=te();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new fn(e,a||S,S,hn)),i in e||mn(e,i,o)}}(e,t.computed),t.watch&&t.watch!==Y&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)_n(e,n,r[i]);else _n(e,n,r)}}(e,t.watch)}var hn={lazy:!0};function mn(e,t,n){var r=!te();"function"==typeof n?(pn.get=r?yn(t):gn(n),pn.set=S):(pn.get=n.get?r&&!1!==n.cache?yn(t):gn(n.get):S,pn.set=n.set||S),Object.defineProperty(e,t,pn)}function yn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),ce.target&&t.depend(),t.value}}function gn(e){return function(){return e.call(this,this)}}function _n(e,t,n,r){return s(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}var bn=0;function $n(e){var t=e.options;if(e.super){var n=$n(e.super);if(n!==e.superOptions){e.superOptions=n;var r=function(e){var t,n=e.options,r=e.sealedOptions;for(var i in n)n[i]!==r[i]&&(t||(t={}),t[i]=n[i]);return t}(e);r&&A(e.extendOptions,r),(t=e.options=De(n,e.extendOptions)).name&&(t.components[t.name]=e)}}return t}function wn(e){this._init(e)}function Cn(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return(a.prototype=Object.create(n.prototype)).constructor=a,a.cid=t++,a.options=De(n.options,e),a.super=n,a.options.props&&function(e){var t=e.options.props;for(var n in t)dn(e.prototype,"_props",n)}(a),a.options.computed&&function(e){var t=e.options.computed;for(var n in t)mn(e.prototype,n,t[n])}(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,M.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=A({},a.options),i[r]=a,a}}function xn(e){return e&&(e.Ctor.options.name||e.tag)}function kn(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:(n=e,"[object RegExp]"===a.call(n)&&e.test(t));var n}function An(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=xn(a.componentOptions);s&&!t(s)&&On(n,o,r,i)}}}function On(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,h(n,t)}!function(t){t.prototype._init=function(t){var n=this;n._uid=bn++,n._isVue=!0,t&&t._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(n,t):n.$options=De($n(n.constructor),t||{},n),n._renderProxy=n,n._self=n,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(n),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&qt(e,t)}(n),function(t){t._vnode=null,t._staticTrees=null;var n=t.$options,r=t.$vnode=n._parentVnode,i=r&&r.context;t.$slots=ut(n._renderChildren,i),t.$scopedSlots=e,t._c=function(e,n,r,i){return Pt(t,e,n,r,i,!1)},t.$createElement=function(e,n,r,i){return Pt(t,e,n,r,i,!0)};var o=r&&r.data;xe(t,"$attrs",o&&o.attrs||e,null,!0),xe(t,"$listeners",n._parentListeners||e,null,!0)}(n),Yt(n,"beforeCreate"),function(e){var t=ct(e.$options.inject,e);t&&($e(!1),Object.keys(t).forEach(function(n){xe(e,n,t[n])}),$e(!0))}(n),vn(n),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(n),Yt(n,"created"),n.$options.el&&n.$mount(n.$options.el)}}(wn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=ke,e.prototype.$delete=Ae,e.prototype.$watch=function(e,t,n){if(s(t))return _n(this,e,t,n);(n=n||{}).user=!0;var r=new fn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Re(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(wn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++)r.$on(e[i],n);else(r._events[e]||(r._events[e]=[])).push(n),t.test(e)&&(r._hasHookEvent=!0);return r},e.prototype.$once=function(e,t){var n=this;function r(){n.$off(e,r),t.apply(n,arguments)}return r.fn=t,n.$on(e,r),n},e.prototype.$off=function(e,t){var n=this;if(!arguments.length)return n._events=Object.create(null),n;if(Array.isArray(e)){for(var r=0,i=e.length;r<i;r++)n.$off(e[r],t);return n}var o,a=n._events[e];if(!a)return n;if(!t)return n._events[e]=null,n;for(var s=a.length;s--;)if((o=a[s])===t||o.fn===t){a.splice(s,1);break}return n},e.prototype.$emit=function(e){var t=this._events[e];if(t){t=t.length>1?k(t):t;for(var n=k(arguments,1),r='event handler for "'+e+'"',i=0,o=t.length;i<o;i++)He(t[i],this,n,this,r)}return this}}(wn),function(e){e.prototype._update=function(e,t){var n=this,r=n.$el,i=n._vnode,o=Zt(n);n._vnode=e,n.$el=i?n.__patch__(i,e):n.__patch__(n.$el,e,t,!1),o(),r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){this._watcher&&this._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Yt(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||h(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Yt(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(wn),function(e){St(e.prototype),e.prototype.$nextTick=function(e){return Ye(e,this)},e.prototype._render=function(){var e,t=this,n=t.$options,r=n.render,i=n._parentVnode;i&&(t.$scopedSlots=ft(i.data.scopedSlots,t.$slots,t.$scopedSlots)),t.$vnode=i;try{Ht=t,e=r.call(t._renderProxy,t.$createElement)}catch(n){Re(n,t,"render"),e=t._vnode}finally{Ht=null}return Array.isArray(e)&&1===e.length&&(e=e[0]),e instanceof pe||(e=ve()),e.parent=i,e}}(wn);var Sn=[String,RegExp,Array],Tn={KeepAlive:{name:"keep-alive",abstract:!0,props:{include:Sn,exclude:Sn,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)On(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",function(t){An(e,function(e){return kn(t,e)})}),this.$watch("exclude",function(t){An(e,function(e){return!kn(t,e)})})},render:function(){var e=this.$slots.default,t=zt(e),n=t&&t.componentOptions;if(n){var r=xn(n),i=this.include,o=this.exclude;if(i&&(!r||!kn(i,r))||o&&r&&kn(o,r))return t;var a=this.cache,s=this.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;a[c]?(t.componentInstance=a[c].componentInstance,h(s,c),s.push(c)):(a[c]=t,s.push(c),this.max&&s.length>parseInt(this.max)&&On(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,"config",t),e.util={warn:ae,extend:A,mergeOptions:De,defineReactive:xe},e.set=ke,e.delete=Ae,e.nextTick=Ye,e.observable=function(e){return Ce(e),e},e.options=Object.create(null),M.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,A(e.options.components,Tn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=k(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),Cn(e),function(e){M.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&s(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}(e)}(wn),Object.defineProperty(wn.prototype,"$isServer",{get:te}),Object.defineProperty(wn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(wn,"FunctionalRenderContext",{value:Tt}),wn.version="2.6.11";var En=p("style,class"),Nn=p("input,textarea,option,select,progress"),jn=function(e,t,n){return"value"===n&&Nn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Dn=p("contenteditable,draggable,spellcheck"),Ln=p("events,caret,typing,plaintext-only"),Mn=function(e,t){return Hn(t)||"false"===t?"false":"contenteditable"===e&&Ln(t)?t:"true"},In=p("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Fn="http://www.w3.org/1999/xlink",Pn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Rn=function(e){return Pn(e)?e.slice(6,e.length):""},Hn=function(e){return null==e||!1===e};function Bn(e){for(var t=e.data,r=e,i=e;n(i.componentInstance);)(i=i.componentInstance._vnode)&&i.data&&(t=Un(i.data,t));for(;n(r=r.parent);)r&&r.data&&(t=Un(t,r.data));return function(e,t){if(n(e)||n(t))return zn(e,Vn(t));return""}(t.staticClass,t.class)}function Un(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:n(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+" "+t:e:t||""}function Vn(e){return Array.isArray(e)?function(e){for(var t,r="",i=0,o=e.length;i<o;i++)n(t=Vn(e[i]))&&""!==t&&(r&&(r+=" "),r+=t);return r}(e):o(e)?function(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}(e):"string"==typeof e?e:""}var Kn={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Jn=p("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),qn=p("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Wn=function(e){return Jn(e)||qn(e)};function Zn(e){return qn(e)?"svg":"math"===e?"math":void 0}var Gn=Object.create(null);var Xn=p("text,number,password,search,email,tel,url");function Yn(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}var Qn=Object.freeze({createElement:function(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)},createElementNS:function(e,t){return document.createElementNS(Kn[e],t)},createTextNode:function(e){return document.createTextNode(e)},createComment:function(e){return document.createComment(e)},insertBefore:function(e,t,n){e.insertBefore(t,n)},removeChild:function(e,t){e.removeChild(t)},appendChild:function(e,t){e.appendChild(t)},parentNode:function(e){return e.parentNode},nextSibling:function(e){return e.nextSibling},tagName:function(e){return e.tagName},setTextContent:function(e,t){e.textContent=t},setStyleScope:function(e,t){e.setAttribute(t,"")}}),er={create:function(e,t){tr(t)},update:function(e,t){e.data.ref!==t.data.ref&&(tr(e,!0),tr(t))},destroy:function(e){tr(e,!0)}};function tr(e,t){var r=e.data.ref;if(n(r)){var i=e.context,o=e.componentInstance||e.elm,a=i.$refs;t?Array.isArray(a[r])?h(a[r],o):a[r]===o&&(a[r]=void 0):e.data.refInFor?Array.isArray(a[r])?a[r].indexOf(o)<0&&a[r].push(o):a[r]=[o]:a[r]=o}}var nr=new pe("",{},[]),rr=["create","activate","update","remove","destroy"];function ir(e,i){return e.key===i.key&&(e.tag===i.tag&&e.isComment===i.isComment&&n(e.data)===n(i.data)&&function(e,t){if("input"!==e.tag)return!0;var r,i=n(r=e.data)&&n(r=r.attrs)&&r.type,o=n(r=t.data)&&n(r=r.attrs)&&r.type;return i===o||Xn(i)&&Xn(o)}(e,i)||r(e.isAsyncPlaceholder)&&e.asyncFactory===i.asyncFactory&&t(i.asyncFactory.error))}function or(e,t,r){var i,o,a={};for(i=t;i<=r;++i)n(o=e[i].key)&&(a[o]=i);return a}var ar={create:sr,update:sr,destroy:function(e){sr(e,nr)}};function sr(e,t){(e.data.directives||t.data.directives)&&function(e,t){var n,r,i,o=e===nr,a=t===nr,s=ur(e.data.directives,e.context),c=ur(t.data.directives,t.context),u=[],l=[];for(n in c)r=s[n],i=c[n],r?(i.oldValue=r.value,i.oldArg=r.arg,fr(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(fr(i,"bind",t,e),i.def&&i.def.inserted&&u.push(i));if(u.length){var f=function(){for(var n=0;n<u.length;n++)fr(u[n],"inserted",t,e)};o?it(t,"insert",f):f()}l.length&&it(t,"postpatch",function(){for(var n=0;n<l.length;n++)fr(l[n],"componentUpdated",t,e)});if(!o)for(n in s)c[n]||fr(s[n],"unbind",e,e,a)}(e,t)}var cr=Object.create(null);function ur(e,t){var n,r,i=Object.create(null);if(!e)return i;for(n=0;n<e.length;n++)(r=e[n]).modifiers||(r.modifiers=cr),i[lr(r)]=r,r.def=Le(t.$options,"directives",r.name);return i}function lr(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function fr(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(r){Re(r,n.context,"directive "+e.name+" "+t+" hook")}}var pr=[er,ar];function dr(e,r){var i=r.componentOptions;if(!(n(i)&&!1===i.Ctor.options.inheritAttrs||t(e.data.attrs)&&t(r.data.attrs))){var o,a,s=r.elm,c=e.data.attrs||{},u=r.data.attrs||{};for(o in n(u.__ob__)&&(u=r.data.attrs=A({},u)),u)a=u[o],c[o]!==a&&vr(s,o,a);for(o in(q||Z)&&u.value!==c.value&&vr(s,"value",u.value),c)t(u[o])&&(Pn(o)?s.removeAttributeNS(Fn,Rn(o)):Dn(o)||s.removeAttribute(o))}}function vr(e,t,n){e.tagName.indexOf("-")>-1?hr(e,t,n):In(t)?Hn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Dn(t)?e.setAttribute(t,Mn(t,n)):Pn(t)?Hn(n)?e.removeAttributeNS(Fn,Rn(t)):e.setAttributeNS(Fn,t,n):hr(e,t,n)}function hr(e,t,n){if(Hn(n))e.removeAttribute(t);else{if(q&&!W&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var mr={create:dr,update:dr};function yr(e,r){var i=r.elm,o=r.data,a=e.data;if(!(t(o.staticClass)&&t(o.class)&&(t(a)||t(a.staticClass)&&t(a.class)))){var s=Bn(r),c=i._transitionClasses;n(c)&&(s=zn(s,Vn(c))),s!==i._prevClass&&(i.setAttribute("class",s),i._prevClass=s)}}var gr,_r,br,$r,wr,Cr,xr={create:yr,update:yr},kr=/[\w).+\-_$\]]/;function Ar(e){var t,n,r,i,o,a=!1,s=!1,c=!1,u=!1,l=0,f=0,p=0,d=0;for(r=0;r<e.length;r++)if(n=t,t=e.charCodeAt(r),a)39===t&&92!==n&&(a=!1);else if(s)34===t&&92!==n&&(s=!1);else if(c)96===t&&92!==n&&(c=!1);else if(u)47===t&&92!==n&&(u=!1);else if(124!==t||124===e.charCodeAt(r+1)||124===e.charCodeAt(r-1)||l||f||p){switch(t){case 34:s=!0;break;case 39:a=!0;break;case 96:c=!0;break;case 40:p++;break;case 41:p--;break;case 91:f++;break;case 93:f--;break;case 123:l++;break;case 125:l--}if(47===t){for(var v=r-1,h=void 0;v>=0&&" "===(h=e.charAt(v));v--);h&&kr.test(h)||(u=!0)}}else void 0===i?(d=r+1,i=e.slice(0,r).trim()):m();function m(){(o||(o=[])).push(e.slice(d,r).trim()),d=r+1}if(void 0===i?i=e.slice(0,r).trim():0!==d&&m(),o)for(r=0;r<o.length;r++)i=Or(i,o[r]);return i}function Or(e,t){var n=t.indexOf("(");if(n<0)return'_f("'+t+'")('+e+")";var r=t.slice(0,n),i=t.slice(n+1);return'_f("'+r+'")('+e+(")"!==i?","+i:i)}function Sr(e,t){console.error("[Vue compiler]: "+e)}function Tr(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function Er(e,t,n,r,i){(e.props||(e.props=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function Nr(e,t,n,r,i){(i?e.dynamicAttrs||(e.dynamicAttrs=[]):e.attrs||(e.attrs=[])).push(Rr({name:t,value:n,dynamic:i},r)),e.plain=!1}function jr(e,t,n,r){e.attrsMap[t]=n,e.attrsList.push(Rr({name:t,value:n},r))}function Dr(e,t,n,r,i,o,a,s){(e.directives||(e.directives=[])).push(Rr({name:t,rawName:n,value:r,arg:i,isDynamicArg:o,modifiers:a},s)),e.plain=!1}function Lr(e,t,n){return n?"_p("+t+',"'+e+'")':e+t}function Mr(t,n,r,i,o,a,s,c){var u;(i=i||e).right?c?n="("+n+")==='click'?'contextmenu':("+n+")":"click"===n&&(n="contextmenu",delete i.right):i.middle&&(c?n="("+n+")==='click'?'mouseup':("+n+")":"click"===n&&(n="mouseup")),i.capture&&(delete i.capture,n=Lr("!",n,c)),i.once&&(delete i.once,n=Lr("~",n,c)),i.passive&&(delete i.passive,n=Lr("&",n,c)),i.native?(delete i.native,u=t.nativeEvents||(t.nativeEvents={})):u=t.events||(t.events={});var l=Rr({value:r.trim(),dynamic:c},s);i!==e&&(l.modifiers=i);var f=u[n];Array.isArray(f)?o?f.unshift(l):f.push(l):u[n]=f?o?[l,f]:[f,l]:l,t.plain=!1}function Ir(e,t,n){var r=Fr(e,":"+t)||Fr(e,"v-bind:"+t);if(null!=r)return Ar(r);if(!1!==n){var i=Fr(e,t);if(null!=i)return JSON.stringify(i)}}function Fr(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Pr(e,t){for(var n=e.attrsList,r=0,i=n.length;r<i;r++){var o=n[r];if(t.test(o.name))return n.splice(r,1),o}}function Rr(e,t){return t&&(null!=t.start&&(e.start=t.start),null!=t.end&&(e.end=t.end)),e}function Hr(e,t,n){var r=n||{},i=r.number,o="$$v";r.trim&&(o="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(o="_n("+o+")");var a=Br(t,o);e.model={value:"("+t+")",expression:JSON.stringify(t),callback:"function ($$v) {"+a+"}"}}function Br(e,t){var n=function(e){if(e=e.trim(),gr=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<gr-1)return($r=e.lastIndexOf("."))>-1?{exp:e.slice(0,$r),key:'"'+e.slice($r+1)+'"'}:{exp:e,key:null};_r=e,$r=wr=Cr=0;for(;!zr();)Vr(br=Ur())?Jr(br):91===br&&Kr(br);return{exp:e.slice(0,wr),key:e.slice(wr+1,Cr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Ur(){return _r.charCodeAt(++$r)}function zr(){return $r>=gr}function Vr(e){return 34===e||39===e}function Kr(e){var t=1;for(wr=$r;!zr();)if(Vr(e=Ur()))Jr(e);else if(91===e&&t++,93===e&&t--,0===t){Cr=$r;break}}function Jr(e){for(var t=e;!zr()&&(e=Ur())!==t;);}var qr,Wr="__r",Zr="__c";function Gr(e,t,n){var r=qr;return function i(){null!==t.apply(null,arguments)&&Qr(e,i,n,r)}}var Xr=Ve&&!(X&&Number(X[1])<=53);function Yr(e,t,n,r){if(Xr){var i=an,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=i||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}qr.addEventListener(e,t,Q?{capture:n,passive:r}:n)}function Qr(e,t,n,r){(r||qr).removeEventListener(e,t._wrapper||t,n)}function ei(e,r){if(!t(e.data.on)||!t(r.data.on)){var i=r.data.on||{},o=e.data.on||{};qr=r.elm,function(e){if(n(e[Wr])){var t=q?"change":"input";e[t]=[].concat(e[Wr],e[t]||[]),delete e[Wr]}n(e[Zr])&&(e.change=[].concat(e[Zr],e.change||[]),delete e[Zr])}(i),rt(i,o,Yr,Qr,Gr,r.context),qr=void 0}}var ti,ni={create:ei,update:ei};function ri(e,r){if(!t(e.data.domProps)||!t(r.data.domProps)){var i,o,a=r.elm,s=e.data.domProps||{},c=r.data.domProps||{};for(i in n(c.__ob__)&&(c=r.data.domProps=A({},c)),s)i in c||(a[i]="");for(i in c){if(o=c[i],"textContent"===i||"innerHTML"===i){if(r.children&&(r.children.length=0),o===s[i])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===i&&"PROGRESS"!==a.tagName){a._value=o;var u=t(o)?"":String(o);ii(a,u)&&(a.value=u)}else if("innerHTML"===i&&qn(a.tagName)&&t(a.innerHTML)){(ti=ti||document.createElement("div")).innerHTML="<svg>"+o+"</svg>";for(var l=ti.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;l.firstChild;)a.appendChild(l.firstChild)}else if(o!==s[i])try{a[i]=o}catch(e){}}}}function ii(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var r=e.value,i=e._vModifiers;if(n(i)){if(i.number)return f(r)!==f(t);if(i.trim)return r.trim()!==t.trim()}return r!==t}(e,t))}var oi={create:ri,update:ri},ai=g(function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach(function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t});function si(e){var t=ci(e.style);return e.staticStyle?A(e.staticStyle,t):t}function ci(e){return Array.isArray(e)?O(e):"string"==typeof e?ai(e):e}var ui,li=/^--/,fi=/\s*!important$/,pi=function(e,t,n){if(li.test(t))e.style.setProperty(t,n);else if(fi.test(n))e.style.setProperty(C(t),n.replace(fi,""),"important");else{var r=vi(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},di=["Webkit","Moz","ms"],vi=g(function(e){if(ui=ui||document.createElement("div").style,"filter"!==(e=b(e))&&e in ui)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<di.length;n++){var r=di[n]+t;if(r in ui)return r}});function hi(e,r){var i=r.data,o=e.data;if(!(t(i.staticStyle)&&t(i.style)&&t(o.staticStyle)&&t(o.style))){var a,s,c=r.elm,u=o.staticStyle,l=o.normalizedStyle||o.style||{},f=u||l,p=ci(r.data.style)||{};r.data.normalizedStyle=n(p.__ob__)?A({},p):p;var d=function(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=si(i.data))&&A(r,n);(n=si(e.data))&&A(r,n);for(var o=e;o=o.parent;)o.data&&(n=si(o.data))&&A(r,n);return r}(r,!0);for(s in f)t(d[s])&&pi(c,s,"");for(s in d)(a=d[s])!==f[s]&&pi(c,s,null==a?"":a)}}var mi={create:hi,update:hi},yi=/\s+/;function gi(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(yi).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function _i(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(yi).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function bi(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&A(t,$i(e.name||"v")),A(t,e),t}return"string"==typeof e?$i(e):void 0}}var $i=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),wi=z&&!W,Ci="transition",xi="animation",ki="transition",Ai="transitionend",Oi="animation",Si="animationend";wi&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ki="WebkitTransition",Ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Oi="WebkitAnimation",Si="webkitAnimationEnd"));var Ti=z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ei(e){Ti(function(){Ti(e)})}function Ni(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),gi(e,t))}function ji(e,t){e._transitionClasses&&h(e._transitionClasses,t),_i(e,t)}function Di(e,t,n){var r=Mi(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===Ci?Ai:Si,c=0,u=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++c>=a&&u()};setTimeout(function(){c<a&&u()},o+1),e.addEventListener(s,l)}var Li=/\b(transform|all)(,|$)/;function Mi(e,t){var n,r=window.getComputedStyle(e),i=(r[ki+"Delay"]||"").split(", "),o=(r[ki+"Duration"]||"").split(", "),a=Ii(i,o),s=(r[Oi+"Delay"]||"").split(", "),c=(r[Oi+"Duration"]||"").split(", "),u=Ii(s,c),l=0,f=0;return t===Ci?a>0&&(n=Ci,l=a,f=o.length):t===xi?u>0&&(n=xi,l=u,f=c.length):f=(n=(l=Math.max(a,u))>0?a>u?Ci:xi:null)?n===Ci?o.length:c.length:0,{type:n,timeout:l,propCount:f,hasTransform:n===Ci&&Li.test(r[ki+"Property"])}}function Ii(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return Fi(t)+Fi(e[n])}))}function Fi(e){return 1e3*Number(e.slice(0,-1).replace(",","."))}function Pi(e,r){var i=e.elm;n(i._leaveCb)&&(i._leaveCb.cancelled=!0,i._leaveCb());var a=bi(e.data.transition);if(!t(a)&&!n(i._enterCb)&&1===i.nodeType){for(var s=a.css,c=a.type,u=a.enterClass,l=a.enterToClass,p=a.enterActiveClass,d=a.appearClass,v=a.appearToClass,h=a.appearActiveClass,m=a.beforeEnter,y=a.enter,g=a.afterEnter,_=a.enterCancelled,b=a.beforeAppear,$=a.appear,w=a.afterAppear,C=a.appearCancelled,x=a.duration,k=Wt,A=Wt.$vnode;A&&A.parent;)k=A.context,A=A.parent;var O=!k._isMounted||!e.isRootInsert;if(!O||$||""===$){var S=O&&d?d:u,T=O&&h?h:p,E=O&&v?v:l,N=O&&b||m,j=O&&"function"==typeof $?$:y,L=O&&w||g,M=O&&C||_,I=f(o(x)?x.enter:x),F=!1!==s&&!W,P=Bi(j),R=i._enterCb=D(function(){F&&(ji(i,E),ji(i,T)),R.cancelled?(F&&ji(i,S),M&&M(i)):L&&L(i),i._enterCb=null});e.data.show||it(e,"insert",function(){var t=i.parentNode,n=t&&t._pending&&t._pending[e.key];n&&n.tag===e.tag&&n.elm._leaveCb&&n.elm._leaveCb(),j&&j(i,R)}),N&&N(i),F&&(Ni(i,S),Ni(i,T),Ei(function(){ji(i,S),R.cancelled||(Ni(i,E),P||(Hi(I)?setTimeout(R,I):Di(i,c,R)))})),e.data.show&&(r&&r(),j&&j(i,R)),F||P||R()}}}function Ri(e,r){var i=e.elm;n(i._enterCb)&&(i._enterCb.cancelled=!0,i._enterCb());var a=bi(e.data.transition);if(t(a)||1!==i.nodeType)return r();if(!n(i._leaveCb)){var s=a.css,c=a.type,u=a.leaveClass,l=a.leaveToClass,p=a.leaveActiveClass,d=a.beforeLeave,v=a.leave,h=a.afterLeave,m=a.leaveCancelled,y=a.delayLeave,g=a.duration,_=!1!==s&&!W,b=Bi(v),$=f(o(g)?g.leave:g),w=i._leaveCb=D(function(){i.parentNode&&i.parentNode._pending&&(i.parentNode._pending[e.key]=null),_&&(ji(i,l),ji(i,p)),w.cancelled?(_&&ji(i,u),m&&m(i)):(r(),h&&h(i)),i._leaveCb=null});y?y(C):C()}function C(){w.cancelled||(!e.data.show&&i.parentNode&&((i.parentNode._pending||(i.parentNode._pending={}))[e.key]=e),d&&d(i),_&&(Ni(i,u),Ni(i,p),Ei(function(){ji(i,u),w.cancelled||(Ni(i,l),b||(Hi($)?setTimeout(w,$):Di(i,c,w)))})),v&&v(i,w),_||b||w())}}function Hi(e){return"number"==typeof e&&!isNaN(e)}function Bi(e){if(t(e))return!1;var r=e.fns;return n(r)?Bi(Array.isArray(r)?r[0]:r):(e._length||e.length)>1}function Ui(e,t){!0!==t.data.show&&Pi(t)}var zi=function(e){var o,a,s={},c=e.modules,u=e.nodeOps;for(o=0;o<rr.length;++o)for(s[rr[o]]=[],a=0;a<c.length;++a)n(c[a][rr[o]])&&s[rr[o]].push(c[a][rr[o]]);function l(e){var t=u.parentNode(e);n(t)&&u.removeChild(t,e)}function f(e,t,i,o,a,c,l){if(n(e.elm)&&n(c)&&(e=c[l]=me(e)),e.isRootInsert=!a,!function(e,t,i,o){var a=e.data;if(n(a)){var c=n(e.componentInstance)&&a.keepAlive;if(n(a=a.hook)&&n(a=a.init)&&a(e,!1),n(e.componentInstance))return d(e,t),v(i,e.elm,o),r(c)&&function(e,t,r,i){for(var o,a=e;a.componentInstance;)if(a=a.componentInstance._vnode,n(o=a.data)&&n(o=o.transition)){for(o=0;o<s.activate.length;++o)s.activate[o](nr,a);t.push(a);break}v(r,e.elm,i)}(e,t,i,o),!0}}(e,t,i,o)){var f=e.data,p=e.children,m=e.tag;n(m)?(e.elm=e.ns?u.createElementNS(e.ns,m):u.createElement(m,e),g(e),h(e,p,t),n(f)&&y(e,t),v(i,e.elm,o)):r(e.isComment)?(e.elm=u.createComment(e.text),v(i,e.elm,o)):(e.elm=u.createTextNode(e.text),v(i,e.elm,o))}}function d(e,t){n(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,m(e)?(y(e,t),g(e)):(tr(e),t.push(e))}function v(e,t,r){n(e)&&(n(r)?u.parentNode(r)===e&&u.insertBefore(e,t,r):u.appendChild(e,t))}function h(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)f(t[r],n,e.elm,null,!0,t,r);else i(e.text)&&u.appendChild(e.elm,u.createTextNode(String(e.text)))}function m(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return n(e.tag)}function y(e,t){for(var r=0;r<s.create.length;++r)s.create[r](nr,e);n(o=e.data.hook)&&(n(o.create)&&o.create(nr,e),n(o.insert)&&t.push(e))}function g(e){var t;if(n(t=e.fnScopeId))u.setStyleScope(e.elm,t);else for(var r=e;r;)n(t=r.context)&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t),r=r.parent;n(t=Wt)&&t!==e.context&&t!==e.fnContext&&n(t=t.$options._scopeId)&&u.setStyleScope(e.elm,t)}function _(e,t,n,r,i,o){for(;r<=i;++r)f(n[r],o,e,t,!1,n,r)}function b(e){var t,r,i=e.data;if(n(i))for(n(t=i.hook)&&n(t=t.destroy)&&t(e),t=0;t<s.destroy.length;++t)s.destroy[t](e);if(n(t=e.children))for(r=0;r<e.children.length;++r)b(e.children[r])}function $(e,t,r){for(;t<=r;++t){var i=e[t];n(i)&&(n(i.tag)?(w(i),b(i)):l(i.elm))}}function w(e,t){if(n(t)||n(e.data)){var r,i=s.remove.length+1;for(n(t)?t.listeners+=i:t=function(e,t){function n(){0==--n.listeners&&l(e)}return n.listeners=t,n}(e.elm,i),n(r=e.componentInstance)&&n(r=r._vnode)&&n(r.data)&&w(r,t),r=0;r<s.remove.length;++r)s.remove[r](e,t);n(r=e.data.hook)&&n(r=r.remove)?r(e,t):t()}else l(e.elm)}function C(e,t,r,i){for(var o=r;o<i;o++){var a=t[o];if(n(a)&&ir(e,a))return o}}function x(e,i,o,a,c,l){if(e!==i){n(i.elm)&&n(a)&&(i=a[c]=me(i));var p=i.elm=e.elm;if(r(e.isAsyncPlaceholder))n(i.asyncFactory.resolved)?O(e.elm,i,o):i.isAsyncPlaceholder=!0;else if(r(i.isStatic)&&r(e.isStatic)&&i.key===e.key&&(r(i.isCloned)||r(i.isOnce)))i.componentInstance=e.componentInstance;else{var d,v=i.data;n(v)&&n(d=v.hook)&&n(d=d.prepatch)&&d(e,i);var h=e.children,y=i.children;if(n(v)&&m(i)){for(d=0;d<s.update.length;++d)s.update[d](e,i);n(d=v.hook)&&n(d=d.update)&&d(e,i)}t(i.text)?n(h)&&n(y)?h!==y&&function(e,r,i,o,a){for(var s,c,l,p=0,d=0,v=r.length-1,h=r[0],m=r[v],y=i.length-1,g=i[0],b=i[y],w=!a;p<=v&&d<=y;)t(h)?h=r[++p]:t(m)?m=r[--v]:ir(h,g)?(x(h,g,o,i,d),h=r[++p],g=i[++d]):ir(m,b)?(x(m,b,o,i,y),m=r[--v],b=i[--y]):ir(h,b)?(x(h,b,o,i,y),w&&u.insertBefore(e,h.elm,u.nextSibling(m.elm)),h=r[++p],b=i[--y]):ir(m,g)?(x(m,g,o,i,d),w&&u.insertBefore(e,m.elm,h.elm),m=r[--v],g=i[++d]):(t(s)&&(s=or(r,p,v)),t(c=n(g.key)?s[g.key]:C(g,r,p,v))?f(g,o,e,h.elm,!1,i,d):ir(l=r[c],g)?(x(l,g,o,i,d),r[c]=void 0,w&&u.insertBefore(e,l.elm,h.elm)):f(g,o,e,h.elm,!1,i,d),g=i[++d]);p>v?_(e,t(i[y+1])?null:i[y+1].elm,i,d,y,o):d>y&&$(r,p,v)}(p,h,y,o,l):n(y)?(n(e.text)&&u.setTextContent(p,""),_(p,null,y,0,y.length-1,o)):n(h)?$(h,0,h.length-1):n(e.text)&&u.setTextContent(p,""):e.text!==i.text&&u.setTextContent(p,i.text),n(v)&&n(d=v.hook)&&n(d=d.postpatch)&&d(e,i)}}}function k(e,t,i){if(r(i)&&n(e.parent))e.parent.data.pendingInsert=t;else for(var o=0;o<t.length;++o)t[o].data.hook.insert(t[o])}var A=p("attrs,class,staticClass,staticStyle,key");function O(e,t,i,o){var a,s=t.tag,c=t.data,u=t.children;if(o=o||c&&c.pre,t.elm=e,r(t.isComment)&&n(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(n(c)&&(n(a=c.hook)&&n(a=a.init)&&a(t,!0),n(a=t.componentInstance)))return d(t,i),!0;if(n(s)){if(n(u))if(e.hasChildNodes())if(n(a=c)&&n(a=a.domProps)&&n(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var l=!0,f=e.firstChild,p=0;p<u.length;p++){if(!f||!O(f,u[p],i,o)){l=!1;break}f=f.nextSibling}if(!l||f)return!1}else h(t,u,i);if(n(c)){var v=!1;for(var m in c)if(!A(m)){v=!0,y(t,i);break}!v&&c.class&&et(c.class)}}else e.data!==t.text&&(e.data=t.text);return!0}return function(e,i,o,a){if(!t(i)){var c,l=!1,p=[];if(t(e))l=!0,f(i,p);else{var d=n(e.nodeType);if(!d&&ir(e,i))x(e,i,p,null,null,a);else{if(d){if(1===e.nodeType&&e.hasAttribute(L)&&(e.removeAttribute(L),o=!0),r(o)&&O(e,i,p))return k(i,p,!0),e;c=e,e=new pe(u.tagName(c).toLowerCase(),{},[],void 0,c)}var v=e.elm,h=u.parentNode(v);if(f(i,p,v._leaveCb?null:h,u.nextSibling(v)),n(i.parent))for(var y=i.parent,g=m(i);y;){for(var _=0;_<s.destroy.length;++_)s.destroy[_](y);if(y.elm=i.elm,g){for(var w=0;w<s.create.length;++w)s.create[w](nr,y);var C=y.data.hook.insert;if(C.merged)for(var A=1;A<C.fns.length;A++)C.fns[A]()}else tr(y);y=y.parent}n(h)?$([e],0,0):n(e.tag)&&b(e)}}return k(i,p,l),i.elm}n(e)&&b(e)}}({nodeOps:Qn,modules:[mr,xr,ni,oi,mi,z?{create:Ui,activate:Ui,remove:function(e,t){!0!==e.data.show?Ri(e,t):t()}}:{}].concat(pr)});W&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&Xi(e,"input")});var Vi={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?it(n,"postpatch",function(){Vi.componentUpdated(e,t,n)}):Ki(e,t,n.context),e._vOptions=[].map.call(e.options,Wi)):("textarea"===n.tag||Xn(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",Zi),e.addEventListener("compositionend",Gi),e.addEventListener("change",Gi),W&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){Ki(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,Wi);if(i.some(function(e,t){return!N(e,r[t])}))(e.multiple?t.value.some(function(e){return qi(e,i)}):t.value!==t.oldValue&&qi(t.value,i))&&Xi(e,"change")}}};function Ki(e,t,n){Ji(e,t,n),(q||Z)&&setTimeout(function(){Ji(e,t,n)},0)}function Ji(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,c=e.options.length;s<c;s++)if(a=e.options[s],i)o=j(r,Wi(a))>-1,a.selected!==o&&(a.selected=o);else if(N(Wi(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function qi(e,t){return t.every(function(t){return!N(t,e)})}function Wi(e){return"_value"in e?e._value:e.value}function Zi(e){e.target.composing=!0}function Gi(e){e.target.composing&&(e.target.composing=!1,Xi(e.target,"input"))}function Xi(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Yi(e){return!e.componentInstance||e.data&&e.data.transition?e:Yi(e.componentInstance._vnode)}var Qi={model:Vi,show:{bind:function(e,t,n){var r=t.value,i=(n=Yi(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,Pi(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Yi(n)).data&&n.data.transition?(n.data.show=!0,r?Pi(n,function(){e.style.display=e.__vOriginalDisplay}):Ri(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}}},eo={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function to(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?to(zt(t.children)):e}function no(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[b(o)]=i[o];return t}function ro(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var io=function(e){return e.tag||Ut(e)},oo=function(e){return"show"===e.name},ao={name:"transition",props:eo,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(io)).length){var r=this.mode,o=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return o;var a=to(o);if(!a)return o;if(this._leaving)return ro(e,o);var s="__transition-"+this._uid+"-";a.key=null==a.key?a.isComment?s+"comment":s+a.tag:i(a.key)?0===String(a.key).indexOf(s)?a.key:s+a.key:a.key;var c=(a.data||(a.data={})).transition=no(this),u=this._vnode,l=to(u);if(a.data.directives&&a.data.directives.some(oo)&&(a.data.show=!0),l&&l.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(a,l)&&!Ut(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=A({},c);if("out-in"===r)return this._leaving=!0,it(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),ro(e,o);if("in-out"===r){if(Ut(a))return u;var p,d=function(){p()};it(c,"afterEnter",d),it(c,"enterCancelled",d),it(f,"delayLeave",function(e){p=e})}}return o}}},so=A({tag:String,moveClass:String},eo);function co(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function uo(e){e.data.newPos=e.elm.getBoundingClientRect()}function lo(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}delete so.mode;var fo={Transition:ao,TransitionGroup:{props:so,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var i=Zt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,i(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=no(this),s=0;s<i.length;s++){var c=i[s];c.tag&&null!=c.key&&0!==String(c.key).indexOf("__vlist")&&(o.push(c),n[c.key]=c,(c.data||(c.data={})).transition=a)}if(r){for(var u=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?u.push(p):l.push(p)}this.kept=e(t,null,u),this.removed=l}return e(t,null,o)},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(co),e.forEach(uo),e.forEach(lo),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;Ni(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Ai,n._moveCb=function e(r){r&&r.target!==n||r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Ai,e),n._moveCb=null,ji(n,t))})}}))},methods:{hasMove:function(e,t){if(!wi)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){_i(n,e)}),gi(n,t),n.style.display="none",this.$el.appendChild(n);var r=Mi(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}}};wn.config.mustUseProp=jn,wn.config.isReservedTag=Wn,wn.config.isReservedAttr=En,wn.config.getTagNamespace=Zn,wn.config.isUnknownElement=function(e){if(!z)return!0;if(Wn(e))return!1;if(e=e.toLowerCase(),null!=Gn[e])return Gn[e];var t=document.createElement(e);return e.indexOf("-")>-1?Gn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Gn[e]=/HTMLUnknownElement/.test(t.toString())},A(wn.options.directives,Qi),A(wn.options.components,fo),wn.prototype.__patch__=z?zi:S,wn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ve),Yt(e,"beforeMount"),r=function(){e._update(e._render(),n)},new fn(e,r,S,{before:function(){e._isMounted&&!e._isDestroyed&&Yt(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Yt(e,"mounted")),e}(this,e=e&&z?Yn(e):void 0,t)},z&&setTimeout(function(){F.devtools&&ne&&ne.emit("init",wn)},0);var po=/\{\{((?:.|\r?\n)+?)\}\}/g,vo=/[-.*+?^${}()|[\]\/\\]/g,ho=g(function(e){var t=e[0].replace(vo,"\\$&"),n=e[1].replace(vo,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")});var mo={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=Fr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Ir(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var yo,go={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=Fr(e,"style");n&&(e.staticStyle=JSON.stringify(ai(n)));var r=Ir(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},_o=function(e){return(yo=yo||document.createElement("div")).innerHTML=e,yo.textContent},bo=p("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),$o=p("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),wo=p("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Co=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,xo=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ko="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+P.source+"]*",Ao="((?:"+ko+"\\:)?"+ko+")",Oo=new RegExp("^<"+Ao),So=/^\s*(\/?)>/,To=new RegExp("^<\\/"+Ao+"[^>]*>"),Eo=/^<!DOCTYPE [^>]+>/i,No=/^<!\--/,jo=/^<!\[/,Do=p("script,style,textarea",!0),Lo={},Mo={"<":"<",">":">",""":'"',"&":"&"," ":"\n","	":"\t","'":"'"},Io=/&(?:lt|gt|quot|amp|#39);/g,Fo=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Po=p("pre,textarea",!0),Ro=function(e,t){return e&&Po(e)&&"\n"===t[0]};function Ho(e,t){var n=t?Fo:Io;return e.replace(n,function(e){return Mo[e]})}var Bo,Uo,zo,Vo,Ko,Jo,qo,Wo,Zo=/^@|^v-on:/,Go=/^v-|^@|^:|^#/,Xo=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Yo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Qo=/^\(|\)$/g,ea=/^\[.*\]$/,ta=/:(.*)$/,na=/^:|^\.|^v-bind:/,ra=/\.[^.\]]+(?=[^\]]*$)/g,ia=/^v-slot(:|$)|^#/,oa=/[\r\n]/,aa=/\s+/g,sa=g(_o),ca="_empty_";function ua(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ma(t),rawAttrsMap:{},parent:n,children:[]}}function la(e,t){Bo=t.warn||Sr,Jo=t.isPreTag||T,qo=t.mustUseProp||T,Wo=t.getTagNamespace||T;t.isReservedTag;zo=Tr(t.modules,"transformNode"),Vo=Tr(t.modules,"preTransformNode"),Ko=Tr(t.modules,"postTransformNode"),Uo=t.delimiters;var n,r,i=[],o=!1!==t.preserveWhitespace,a=t.whitespace,s=!1,c=!1;function u(e){if(l(e),s||e.processed||(e=fa(e,t)),i.length||e===n||n.if&&(e.elseif||e.else)&&da(n,{exp:e.elseif,block:e}),r&&!e.forbidden)if(e.elseif||e.else)a=e,(u=function(e){var t=e.length;for(;t--;){if(1===e[t].type)return e[t];e.pop()}}(r.children))&&u.if&&da(u,{exp:a.elseif,block:a});else{if(e.slotScope){var o=e.slotTarget||'"default"';(r.scopedSlots||(r.scopedSlots={}))[o]=e}r.children.push(e),e.parent=r}var a,u;e.children=e.children.filter(function(e){return!e.slotScope}),l(e),e.pre&&(s=!1),Jo(e.tag)&&(c=!1);for(var f=0;f<Ko.length;f++)Ko[f](e,t)}function l(e){if(!c)for(var t;(t=e.children[e.children.length-1])&&3===t.type&&" "===t.text;)e.children.pop()}return function(e,t){for(var n,r,i=[],o=t.expectHTML,a=t.isUnaryTag||T,s=t.canBeLeftOpenTag||T,c=0;e;){if(n=e,r&&Do(r)){var u=0,l=r.toLowerCase(),f=Lo[l]||(Lo[l]=new RegExp("([\\s\\S]*?)(</"+l+"[^>]*>)","i")),p=e.replace(f,function(e,n,r){return u=r.length,Do(l)||"noscript"===l||(n=n.replace(/<!\--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),Ro(l,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});c+=e.length-p.length,e=p,A(l,c-u,c)}else{var d=e.indexOf("<");if(0===d){if(No.test(e)){var v=e.indexOf("--\x3e");if(v>=0){t.shouldKeepComment&&t.comment(e.substring(4,v),c,c+v+3),C(v+3);continue}}if(jo.test(e)){var h=e.indexOf("]>");if(h>=0){C(h+2);continue}}var m=e.match(Eo);if(m){C(m[0].length);continue}var y=e.match(To);if(y){var g=c;C(y[0].length),A(y[1],g,c);continue}var _=x();if(_){k(_),Ro(_.tagName,e)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(d>=0){for($=e.slice(d);!(To.test($)||Oo.test($)||No.test($)||jo.test($)||(w=$.indexOf("<",1))<0);)d+=w,$=e.slice(d);b=e.substring(0,d)}d<0&&(b=e),b&&C(b.length),t.chars&&b&&t.chars(b,c-b.length,c)}if(e===n){t.chars&&t.chars(e);break}}function C(t){c+=t,e=e.substring(t)}function x(){var t=e.match(Oo);if(t){var n,r,i={tagName:t[1],attrs:[],start:c};for(C(t[0].length);!(n=e.match(So))&&(r=e.match(xo)||e.match(Co));)r.start=c,C(r[0].length),r.end=c,i.attrs.push(r);if(n)return i.unarySlash=n[1],C(n[0].length),i.end=c,i}}function k(e){var n=e.tagName,c=e.unarySlash;o&&("p"===r&&wo(n)&&A(r),s(n)&&r===n&&A(n));for(var u=a(n)||!!c,l=e.attrs.length,f=new Array(l),p=0;p<l;p++){var d=e.attrs[p],v=d[3]||d[4]||d[5]||"",h="a"===n&&"href"===d[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;f[p]={name:d[1],value:Ho(v,h)}}u||(i.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:f,start:e.start,end:e.end}),r=n),t.start&&t.start(n,f,u,e.start,e.end)}function A(e,n,o){var a,s;if(null==n&&(n=c),null==o&&(o=c),e)for(s=e.toLowerCase(),a=i.length-1;a>=0&&i[a].lowerCasedTag!==s;a--);else a=0;if(a>=0){for(var u=i.length-1;u>=a;u--)t.end&&t.end(i[u].tag,n,o);i.length=a,r=a&&i[a-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,o):"p"===s&&(t.start&&t.start(e,[],!1,n,o),t.end&&t.end(e,n,o))}A()}(e,{warn:Bo,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,o,a,l,f){var p=r&&r.ns||Wo(e);q&&"svg"===p&&(o=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];ya.test(r.name)||(r.name=r.name.replace(ga,""),t.push(r))}return t}(o));var d,v=ua(e,o,r);p&&(v.ns=p),"style"!==(d=v).tag&&("script"!==d.tag||d.attrsMap.type&&"text/javascript"!==d.attrsMap.type)||te()||(v.forbidden=!0);for(var h=0;h<Vo.length;h++)v=Vo[h](v,t)||v;s||(!function(e){null!=Fr(e,"v-pre")&&(e.pre=!0)}(v),v.pre&&(s=!0)),Jo(v.tag)&&(c=!0),s?function(e){var t=e.attrsList,n=t.length;if(n)for(var r=e.attrs=new Array(n),i=0;i<n;i++)r[i]={name:t[i].name,value:JSON.stringify(t[i].value)},null!=t[i].start&&(r[i].start=t[i].start,r[i].end=t[i].end);else e.pre||(e.plain=!0)}(v):v.processed||(pa(v),function(e){var t=Fr(e,"v-if");if(t)e.if=t,da(e,{exp:t,block:e});else{null!=Fr(e,"v-else")&&(e.else=!0);var n=Fr(e,"v-else-if");n&&(e.elseif=n)}}(v),function(e){null!=Fr(e,"v-once")&&(e.once=!0)}(v)),n||(n=v),a?u(v):(r=v,i.push(v))},end:function(e,t,n){var o=i[i.length-1];i.length-=1,r=i[i.length-1],u(o)},chars:function(e,t,n){if(r&&(!q||"textarea"!==r.tag||r.attrsMap.placeholder!==e)){var i,u,l,f=r.children;if(e=c||e.trim()?"script"===(i=r).tag||"style"===i.tag?e:sa(e):f.length?a?"condense"===a&&oa.test(e)?"":" ":o?" ":"":"")c||"condense"!==a||(e=e.replace(aa," ")),!s&&" "!==e&&(u=function(e,t){var n=t?ho(t):po;if(n.test(e)){for(var r,i,o,a=[],s=[],c=n.lastIndex=0;r=n.exec(e);){(i=r.index)>c&&(s.push(o=e.slice(c,i)),a.push(JSON.stringify(o)));var u=Ar(r[1].trim());a.push("_s("+u+")"),s.push({"@binding":u}),c=i+r[0].length}return c<e.length&&(s.push(o=e.slice(c)),a.push(JSON.stringify(o))),{expression:a.join("+"),tokens:s}}}(e,Uo))?l={type:2,expression:u.expression,tokens:u.tokens,text:e}:" "===e&&f.length&&" "===f[f.length-1].text||(l={type:3,text:e}),l&&f.push(l)}},comment:function(e,t,n){if(r){var i={type:3,text:e,isComment:!0};r.children.push(i)}}}),n}function fa(e,t){var n,r;(r=Ir(n=e,"key"))&&(n.key=r),e.plain=!e.key&&!e.scopedSlots&&!e.attrsList.length,function(e){var t=Ir(e,"ref");t&&(e.ref=t,e.refInFor=function(e){var t=e;for(;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}(e))}(e),function(e){var t;"template"===e.tag?(t=Fr(e,"scope"),e.slotScope=t||Fr(e,"slot-scope")):(t=Fr(e,"slot-scope"))&&(e.slotScope=t);var n=Ir(e,"slot");n&&(e.slotTarget='""'===n?'"default"':n,e.slotTargetDynamic=!(!e.attrsMap[":slot"]&&!e.attrsMap["v-bind:slot"]),"template"===e.tag||e.slotScope||Nr(e,"slot",n,function(e,t){return e.rawAttrsMap[":"+t]||e.rawAttrsMap["v-bind:"+t]||e.rawAttrsMap[t]}(e,"slot")));if("template"===e.tag){var r=Pr(e,ia);if(r){var i=va(r),o=i.name,a=i.dynamic;e.slotTarget=o,e.slotTargetDynamic=a,e.slotScope=r.value||ca}}else{var s=Pr(e,ia);if(s){var c=e.scopedSlots||(e.scopedSlots={}),u=va(s),l=u.name,f=u.dynamic,p=c[l]=ua("template",[],e);p.slotTarget=l,p.slotTargetDynamic=f,p.children=e.children.filter(function(e){if(!e.slotScope)return e.parent=p,!0}),p.slotScope=s.value||ca,e.children=[],e.plain=!1}}}(e),function(e){"slot"===e.tag&&(e.slotName=Ir(e,"name"))}(e),function(e){var t;(t=Ir(e,"is"))&&(e.component=t);null!=Fr(e,"inline-template")&&(e.inlineTemplate=!0)}(e);for(var i=0;i<zo.length;i++)e=zo[i](e,t)||e;return function(e){var t,n,r,i,o,a,s,c,u=e.attrsList;for(t=0,n=u.length;t<n;t++)if(r=i=u[t].name,o=u[t].value,Go.test(r))if(e.hasBindings=!0,(a=ha(r.replace(Go,"")))&&(r=r.replace(ra,"")),na.test(r))r=r.replace(na,""),o=Ar(o),(c=ea.test(r))&&(r=r.slice(1,-1)),a&&(a.prop&&!c&&"innerHtml"===(r=b(r))&&(r="innerHTML"),a.camel&&!c&&(r=b(r)),a.sync&&(s=Br(o,"$event"),c?Mr(e,'"update:"+('+r+")",s,null,!1,0,u[t],!0):(Mr(e,"update:"+b(r),s,null,!1,0,u[t]),C(r)!==b(r)&&Mr(e,"update:"+C(r),s,null,!1,0,u[t])))),a&&a.prop||!e.component&&qo(e.tag,e.attrsMap.type,r)?Er(e,r,o,u[t],c):Nr(e,r,o,u[t],c);else if(Zo.test(r))r=r.replace(Zo,""),(c=ea.test(r))&&(r=r.slice(1,-1)),Mr(e,r,o,a,!1,0,u[t],c);else{var l=(r=r.replace(Go,"")).match(ta),f=l&&l[1];c=!1,f&&(r=r.slice(0,-(f.length+1)),ea.test(f)&&(f=f.slice(1,-1),c=!0)),Dr(e,r,i,o,f,c,a,u[t])}else Nr(e,r,JSON.stringify(o),u[t]),!e.component&&"muted"===r&&qo(e.tag,e.attrsMap.type,r)&&Er(e,r,"true",u[t])}(e),e}function pa(e){var t;if(t=Fr(e,"v-for")){var n=function(e){var t=e.match(Xo);if(!t)return;var n={};n.for=t[2].trim();var r=t[1].trim().replace(Qo,""),i=r.match(Yo);i?(n.alias=r.replace(Yo,"").trim(),n.iterator1=i[1].trim(),i[2]&&(n.iterator2=i[2].trim())):n.alias=r;return n}(t);n&&A(e,n)}}function da(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function va(e){var t=e.name.replace(ia,"");return t||"#"!==e.name[0]&&(t="default"),ea.test(t)?{name:t.slice(1,-1),dynamic:!0}:{name:'"'+t+'"',dynamic:!1}}function ha(e){var t=e.match(ra);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function ma(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}var ya=/^xmlns:NS\d+/,ga=/^NS\d+:/;function _a(e){return ua(e.tag,e.attrsList.slice(),e.parent)}var ba=[mo,go,{preTransformNode:function(e,t){if("input"===e.tag){var n,r=e.attrsMap;if(!r["v-model"])return;if((r[":type"]||r["v-bind:type"])&&(n=Ir(e,"type")),r.type||n||!r["v-bind"]||(n="("+r["v-bind"]+").type"),n){var i=Fr(e,"v-if",!0),o=i?"&&("+i+")":"",a=null!=Fr(e,"v-else",!0),s=Fr(e,"v-else-if",!0),c=_a(e);pa(c),jr(c,"type","checkbox"),fa(c,t),c.processed=!0,c.if="("+n+")==='checkbox'"+o,da(c,{exp:c.if,block:c});var u=_a(e);Fr(u,"v-for",!0),jr(u,"type","radio"),fa(u,t),da(c,{exp:"("+n+")==='radio'"+o,block:u});var l=_a(e);return Fr(l,"v-for",!0),jr(l,":type",n),fa(l,t),da(c,{exp:i,block:l}),a?c.else=!0:s&&(c.elseif=s),c}}}}];var $a,wa,Ca={expectHTML:!0,modules:ba,directives:{model:function(e,t,n){var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Hr(e,r,i),!1;if("select"===o)!function(e,t,n){var r='var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(n&&n.number?"_n(val)":"val")+"});";r=r+" "+Br(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),Mr(e,"change",r,null,!0)}(e,r,i);else if("input"===o&&"checkbox"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,"value")||"null",o=Ir(e,"true-value")||"true",a=Ir(e,"false-value")||"false";Er(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Mr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Br(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Br(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Br(t,"$$c")+"}",null,!0)}(e,r,i);else if("input"===o&&"radio"===a)!function(e,t,n){var r=n&&n.number,i=Ir(e,"value")||"null";Er(e,"checked","_q("+t+","+(i=r?"_n("+i+")":i)+")"),Mr(e,"change",Br(t,i),null,!0)}(e,r,i);else if("input"===o||"textarea"===o)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,u=o?"change":"range"===r?Wr:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Br(t,l);c&&(f="if($event.target.composing)return;"+f),Er(e,"value","("+t+")"),Mr(e,u,f,null,!0),(s||a)&&Mr(e,"blur","$forceUpdate()")}(e,r,i);else if(!F.isReservedTag(o))return Hr(e,r,i),!1;return!0},text:function(e,t){t.value&&Er(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Er(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:bo,mustUseProp:jn,canBeLeftOpenTag:$o,isReservedTag:Wn,getTagNamespace:Zn,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(ba)},xa=g(function(e){return p("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))});function ka(e,t){e&&($a=xa(t.staticKeys||""),wa=t.isReservedTag||T,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||d(e.tag)||!wa(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every($a)))}(t);if(1===t.type){if(!wa(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n<r;n++){var i=t.children[n];e(i),i.static||(t.static=!1)}if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++){var s=t.ifConditions[o].block;e(s),s.static||(t.static=!1)}}}(e),function e(t,n){if(1===t.type){if((t.static||t.once)&&(t.staticInFor=n),t.static&&t.children.length&&(1!==t.children.length||3!==t.children[0].type))return void(t.staticRoot=!0);if(t.staticRoot=!1,t.children)for(var r=0,i=t.children.length;r<i;r++)e(t.children[r],n||!!t.for);if(t.ifConditions)for(var o=1,a=t.ifConditions.length;o<a;o++)e(t.ifConditions[o].block,n)}}(e,!1))}var Aa=/^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/,Oa=/\([^)]*?\);*$/,Sa=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ta={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ea={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Na=function(e){return"if("+e+")return null;"},ja={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Na("$event.target !== $event.currentTarget"),ctrl:Na("!$event.ctrlKey"),shift:Na("!$event.shiftKey"),alt:Na("!$event.altKey"),meta:Na("!$event.metaKey"),left:Na("'button' in $event && $event.button !== 0"),middle:Na("'button' in $event && $event.button !== 1"),right:Na("'button' in $event && $event.button !== 2")};function Da(e,t){var n=t?"nativeOn:":"on:",r="",i="";for(var o in e){var a=La(e[o]);e[o]&&e[o].dynamic?i+=o+","+a+",":r+='"'+o+'":'+a+","}return r="{"+r.slice(0,-1)+"}",i?n+"_d("+r+",["+i.slice(0,-1)+"])":n+r}function La(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return La(e)}).join(",")+"]";var t=Sa.test(e.value),n=Aa.test(e.value),r=Sa.test(e.value.replace(Oa,""));if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(ja[s])o+=ja[s],Ta[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=Na(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Ma).join("&&")+")return null;"}(a)),o&&(i+=o),"function($event){"+i+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Ma(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ta[e],r=Ea[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ia={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:S},Fa=function(e){this.options=e,this.warn=e.warn||Sr,this.transforms=Tr(e.modules,"transformCode"),this.dataGenFns=Tr(e.modules,"genData"),this.directives=A(A({},Ia),e.directives);var t=e.isReservedTag||T;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Pa(e,t){var n=new Fa(t);return{render:"with(this){return "+(e?Ra(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ra(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Ha(e,t);if(e.once&&!e.onceProcessed)return Ba(e,t);if(e.for&&!e.forProcessed)return za(e,t);if(e.if&&!e.ifProcessed)return Ua(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=qa(e,t),i="_t("+n+(r?","+r:""),o=e.attrs||e.dynamicAttrs?Ga((e.attrs||[]).concat(e.dynamicAttrs||[]).map(function(e){return{name:b(e.name),value:e.value,dynamic:e.dynamic}})):null,a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:qa(t,n,!0);return"_c("+e+","+Va(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Va(e,t));var i=e.inlineTemplate?null:qa(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return qa(e,t)||"void 0"}function Ha(e,t){e.staticProcessed=!0;var n=t.pre;return e.pre&&(t.pre=e.pre),t.staticRenderFns.push("with(this){return "+Ra(e,t)+"}"),t.pre=n,"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function Ba(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return Ua(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+Ra(e,t)+","+t.onceId+++","+n+")":Ra(e,t)}return Ha(e,t)}function Ua(e,t,n,r){return e.ifProcessed=!0,function e(t,n,r,i){if(!t.length)return i||"_e()";var o=t.shift();return o.exp?"("+o.exp+")?"+a(o.block)+":"+e(t,n,r,i):""+a(o.block);function a(e){return r?r(e,n):e.once?Ba(e,n):Ra(e,n)}}(e.ifConditions.slice(),t,n,r)}function za(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||Ra)(e,t)+"})"}function Va(e,t){var n="{",r=function(e,t){var n=e.directives;if(!n)return;var r,i,o,a,s="directives:[",c=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var u=t.directives[o.name];u&&(a=!!u(e,o,t.warn)),a&&(c=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?",arg:"+(o.isDynamicArg?o.arg:'"'+o.arg+'"'):"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}if(c)return s.slice(0,-1)+"]"}(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:"+Ga(e.attrs)+","),e.props&&(n+="domProps:"+Ga(e.props)+","),e.events&&(n+=Da(e.events,!1)+","),e.nativeEvents&&(n+=Da(e.nativeEvents,!0)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=function(e,t,n){var r=e.for||Object.keys(t).some(function(e){var n=t[e];return n.slotTargetDynamic||n.if||n.for||Ka(n)}),i=!!e.if;if(!r)for(var o=e.parent;o;){if(o.slotScope&&o.slotScope!==ca||o.for){r=!0;break}o.if&&(i=!0),o=o.parent}var a=Object.keys(t).map(function(e){return Ja(t[e],n)}).join(",");return"scopedSlots:_u(["+a+"]"+(r?",null,true":"")+(!r&&i?",null,false,"+function(e){var t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return t>>>0}(a):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=function(e,t){var n=e.children[0];if(n&&1===n.type){var r=Pa(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Ga(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Ka(e){return 1===e.type&&("slot"===e.tag||e.children.some(Ka))}function Ja(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Ua(e,t,Ja,"null");if(e.for&&!e.forProcessed)return za(e,t,Ja);var r=e.slotScope===ca?"":String(e.slotScope),i="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(qa(e,t)||"undefined")+":undefined":qa(e,t)||"undefined":Ra(e,t))+"}",o=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+i+o+"}"}function qa(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?t.maybeComponent(a)?",1":",0":"";return""+(r||Ra)(a,t)+s}var c=n?function(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(Wa(i)||i.ifConditions&&i.ifConditions.some(function(e){return Wa(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}(o,t.maybeComponent):0,u=i||Za;return"["+o.map(function(e){return u(e,t)}).join(",")+"]"+(c?","+c:"")}}function Wa(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function Za(e,t){return 1===e.type?Ra(e,t):3===e.type&&e.isComment?(r=e,"_e("+JSON.stringify(r.text)+")"):"_v("+(2===(n=e).type?n.expression:Xa(JSON.stringify(n.text)))+")";var n,r}function Ga(e){for(var t="",n="",r=0;r<e.length;r++){var i=e[r],o=Xa(i.value);i.dynamic?n+=i.name+","+o+",":t+='"'+i.name+'":'+o+","}return t="{"+t.slice(0,-1)+"}",n?"_d("+t+",["+n.slice(0,-1)+"])":t}function Xa(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b");function Ya(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),S}}function Qa(e){var t=Object.create(null);return function(n,r,i){(r=A({},r)).warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r),s={},c=[];return s.render=Ya(a.render,c),s.staticRenderFns=a.staticRenderFns.map(function(e){return Ya(e,c)}),t[o]=s}}var es,ts,ns=(es=function(e,t){var n=la(e.trim(),t);!1!==t.optimize&&ka(n,t);var r=Pa(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}},function(e){function t(t,n){var r=Object.create(e),i=[],o=[];if(n)for(var a in n.modules&&(r.modules=(e.modules||[]).concat(n.modules)),n.directives&&(r.directives=A(Object.create(e.directives||null),n.directives)),n)"modules"!==a&&"directives"!==a&&(r[a]=n[a]);r.warn=function(e,t,n){(n?o:i).push(e)};var s=es(t.trim(),r);return s.errors=i,s.tips=o,s}return{compile:t,compileToFunctions:Qa(t)}})(Ca),rs=(ns.compile,ns.compileToFunctions);function is(e){return(ts=ts||document.createElement("div")).innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',ts.innerHTML.indexOf(" ")>0}var os=!!z&&is(!1),as=!!z&&is(!0),ss=g(function(e){var t=Yn(e);return t&&t.innerHTML}),cs=wn.prototype.$mount;return wn.prototype.$mount=function(e,t){if((e=e&&Yn(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ss(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){var i=rs(r,{outputSourceRange:!1,shouldDecodeNewlines:os,shouldDecodeNewlinesForHref:as,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return cs.call(this,e,t)},wn.compile=rs,wn});(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=global||self,global.Vuex=factory());}(this,function(){'use strict';function applyMixin(Vue){var version=Number(Vue.version.split('.')[0]);if(version>=2){Vue.mixin({beforeCreate:vuexInit});}else{var _init=Vue.prototype._init;Vue.prototype._init=function(options){if(options===void 0)options={};options.init=options.init?[vuexInit].concat(options.init):vuexInit;_init.call(this,options);};}
function vuexInit(){var options=this.$options;if(options.store){this.$store=typeof options.store==='function'?options.store():options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}}
var target=typeof window!=='undefined'?window:typeof global!=='undefined'?global:{};var devtoolHook=target.__VUE_DEVTOOLS_GLOBAL_HOOK__;function devtoolPlugin(store){if(!devtoolHook){return}
store._devtoolHook=devtoolHook;devtoolHook.emit('vuex:init',store);devtoolHook.on('vuex:travel-to-state',function(targetState){store.replaceState(targetState);});store.subscribe(function(mutation,state){devtoolHook.emit('vuex:mutation',mutation,state);});}
function forEachValue(obj,fn){Object.keys(obj).forEach(function(key){return fn(obj[key],key);});}
function isObject(obj){return obj!==null&&typeof obj==='object'}
function isPromise(val){return val&&typeof val.then==='function'}
function assert(condition,msg){if(!condition){throw new Error(("[vuex] "+msg))}}
function partial(fn,arg){return function(){return fn(arg)}}
var Module=function Module(rawModule,runtime){this.runtime=runtime;this._children=Object.create(null);this._rawModule=rawModule;var rawState=rawModule.state;this.state=(typeof rawState==='function'?rawState():rawState)||{};};var prototypeAccessors={namespaced:{configurable:true}};prototypeAccessors.namespaced.get=function(){return!!this._rawModule.namespaced};Module.prototype.addChild=function addChild(key,module){this._children[key]=module;};Module.prototype.removeChild=function removeChild(key){delete this._children[key];};Module.prototype.getChild=function getChild(key){return this._children[key]};Module.prototype.update=function update(rawModule){this._rawModule.namespaced=rawModule.namespaced;if(rawModule.actions){this._rawModule.actions=rawModule.actions;}
if(rawModule.mutations){this._rawModule.mutations=rawModule.mutations;}
if(rawModule.getters){this._rawModule.getters=rawModule.getters;}};Module.prototype.forEachChild=function forEachChild(fn){forEachValue(this._children,fn);};Module.prototype.forEachGetter=function forEachGetter(fn){if(this._rawModule.getters){forEachValue(this._rawModule.getters,fn);}};Module.prototype.forEachAction=function forEachAction(fn){if(this._rawModule.actions){forEachValue(this._rawModule.actions,fn);}};Module.prototype.forEachMutation=function forEachMutation(fn){if(this._rawModule.mutations){forEachValue(this._rawModule.mutations,fn);}};Object.defineProperties(Module.prototype,prototypeAccessors);var ModuleCollection=function ModuleCollection(rawRootModule){this.register([],rawRootModule,false);};ModuleCollection.prototype.get=function get(path){return path.reduce(function(module,key){return module.getChild(key)},this.root)};ModuleCollection.prototype.getNamespace=function getNamespace(path){var module=this.root;return path.reduce(function(namespace,key){module=module.getChild(key);return namespace+(module.namespaced?key+'/':'')},'')};ModuleCollection.prototype.update=function update$1(rawRootModule){update([],this.root,rawRootModule);};ModuleCollection.prototype.register=function register(path,rawModule,runtime){var this$1=this;if(runtime===void 0)runtime=true;{assertRawModule(path,rawModule);}
var newModule=new Module(rawModule,runtime);if(path.length===0){this.root=newModule;}else{var parent=this.get(path.slice(0,-1));parent.addChild(path[path.length-1],newModule);}
if(rawModule.modules){forEachValue(rawModule.modules,function(rawChildModule,key){this$1.register(path.concat(key),rawChildModule,runtime);});}};ModuleCollection.prototype.unregister=function unregister(path){var parent=this.get(path.slice(0,-1));var key=path[path.length-1];if(!parent.getChild(key).runtime){return}
parent.removeChild(key);};function update(path,targetModule,newModule){{assertRawModule(path,newModule);}
targetModule.update(newModule);if(newModule.modules){for(var key in newModule.modules){if(!targetModule.getChild(key)){{console.warn("[vuex] trying to add a new module '"+key+"' on hot reloading, "+'manual reload is needed');}
return}
update(path.concat(key),targetModule.getChild(key),newModule.modules[key]);}}}
var functionAssert={assert:function(value){return typeof value==='function';},expected:'function'};var objectAssert={assert:function(value){return typeof value==='function'||(typeof value==='object'&&typeof value.handler==='function');},expected:'function or object with "handler" function'};var assertTypes={getters:functionAssert,mutations:functionAssert,actions:objectAssert};function assertRawModule(path,rawModule){Object.keys(assertTypes).forEach(function(key){if(!rawModule[key]){return}
var assertOptions=assertTypes[key];forEachValue(rawModule[key],function(value,type){assert(assertOptions.assert(value),makeAssertionMessage(path,key,type,value,assertOptions.expected));});});}
function makeAssertionMessage(path,key,type,value,expected){var buf=key+" should be "+expected+" but \""+key+"."+type+"\"";if(path.length>0){buf+=" in module \""+(path.join('.'))+"\"";}
buf+=" is "+(JSON.stringify(value))+".";return buf}
var Vue;var Store=function Store(options){var this$1=this;if(options===void 0)options={};if(!Vue&&typeof window!=='undefined'&&window.Vue){install(window.Vue);}{assert(Vue,"must call Vue.use(Vuex) before creating a store instance.");assert(typeof Promise!=='undefined',"vuex requires a Promise polyfill in this browser.");assert(this instanceof Store,"store must be called with the new operator.");}
var plugins=options.plugins;if(plugins===void 0)plugins=[];var strict=options.strict;if(strict===void 0)strict=false;this._committing=false;this._actions=Object.create(null);this._actionSubscribers=[];this._mutations=Object.create(null);this._wrappedGetters=Object.create(null);this._modules=new ModuleCollection(options);this._modulesNamespaceMap=Object.create(null);this._subscribers=[];this._watcherVM=new Vue();this._makeLocalGettersCache=Object.create(null);var store=this;var ref=this;var dispatch=ref.dispatch;var commit=ref.commit;this.dispatch=function boundDispatch(type,payload){return dispatch.call(store,type,payload)};this.commit=function boundCommit(type,payload,options){return commit.call(store,type,payload,options)};this.strict=strict;var state=this._modules.root.state;installModule(this,state,[],this._modules.root);resetStoreVM(this,state);plugins.forEach(function(plugin){return plugin(this$1);});var useDevtools=options.devtools!==undefined?options.devtools:Vue.config.devtools;if(useDevtools){devtoolPlugin(this);}};var prototypeAccessors$1={state:{configurable:true}};prototypeAccessors$1.state.get=function(){return this._vm._data.$$state};prototypeAccessors$1.state.set=function(v){{assert(false,"use store.replaceState() to explicit replace store state.");}};Store.prototype.commit=function commit(_type,_payload,_options){var this$1=this;var ref=unifyObjectStyle(_type,_payload,_options);var type=ref.type;var payload=ref.payload;var options=ref.options;var mutation={type:type,payload:payload};var entry=this._mutations[type];if(!entry){{console.error(("[vuex] unknown mutation type: "+type));}
return}
this._withCommit(function(){entry.forEach(function commitIterator(handler){handler(payload);});});this._subscribers.forEach(function(sub){return sub(mutation,this$1.state);});if(options&&options.silent){console.warn("[vuex] mutation type: "+type+". Silent option has been removed. "+'Use the filter functionality in the vue-devtools');}};Store.prototype.dispatch=function dispatch(_type,_payload){var this$1=this;var ref=unifyObjectStyle(_type,_payload);var type=ref.type;var payload=ref.payload;var action={type:type,payload:payload};var entry=this._actions[type];if(!entry){{console.error(("[vuex] unknown action type: "+type));}
return}
try{this._actionSubscribers.filter(function(sub){return sub.before;}).forEach(function(sub){return sub.before(action,this$1.state);});}catch(e){{console.warn("[vuex] error in before action subscribers: ");console.error(e);}}
var result=entry.length>1?Promise.all(entry.map(function(handler){return handler(payload);})):entry[0](payload);return result.then(function(res){try{this$1._actionSubscribers.filter(function(sub){return sub.after;}).forEach(function(sub){return sub.after(action,this$1.state);});}catch(e){{console.warn("[vuex] error in after action subscribers: ");console.error(e);}}
return res})};Store.prototype.subscribe=function subscribe(fn){return genericSubscribe(fn,this._subscribers)};Store.prototype.subscribeAction=function subscribeAction(fn){var subs=typeof fn==='function'?{before:fn}:fn;return genericSubscribe(subs,this._actionSubscribers)};Store.prototype.watch=function watch(getter,cb,options){var this$1=this;{assert(typeof getter==='function',"store.watch only accepts a function.");}
return this._watcherVM.$watch(function(){return getter(this$1.state,this$1.getters);},cb,options)};Store.prototype.replaceState=function replaceState(state){var this$1=this;this._withCommit(function(){this$1._vm._data.$$state=state;});};Store.prototype.registerModule=function registerModule(path,rawModule,options){if(options===void 0)options={};if(typeof path==='string'){path=[path];}{assert(Array.isArray(path),"module path must be a string or an Array.");assert(path.length>0,'cannot register the root module by using registerModule.');}
this._modules.register(path,rawModule);installModule(this,this.state,path,this._modules.get(path),options.preserveState);resetStoreVM(this,this.state);};Store.prototype.unregisterModule=function unregisterModule(path){var this$1=this;if(typeof path==='string'){path=[path];}{assert(Array.isArray(path),"module path must be a string or an Array.");}
this._modules.unregister(path);this._withCommit(function(){var parentState=getNestedState(this$1.state,path.slice(0,-1));Vue.delete(parentState,path[path.length-1]);});resetStore(this);};Store.prototype.hotUpdate=function hotUpdate(newOptions){this._modules.update(newOptions);resetStore(this,true);};Store.prototype._withCommit=function _withCommit(fn){var committing=this._committing;this._committing=true;fn();this._committing=committing;};Object.defineProperties(Store.prototype,prototypeAccessors$1);function genericSubscribe(fn,subs){if(subs.indexOf(fn)<0){subs.push(fn);}
return function(){var i=subs.indexOf(fn);if(i>-1){subs.splice(i,1);}}}
function resetStore(store,hot){store._actions=Object.create(null);store._mutations=Object.create(null);store._wrappedGetters=Object.create(null);store._modulesNamespaceMap=Object.create(null);var state=store.state;installModule(store,state,[],store._modules.root,true);resetStoreVM(store,state,hot);}
function resetStoreVM(store,state,hot){var oldVm=store._vm;store.getters={};store._makeLocalGettersCache=Object.create(null);var wrappedGetters=store._wrappedGetters;var computed={};forEachValue(wrappedGetters,function(fn,key){computed[key]=partial(fn,store);Object.defineProperty(store.getters,key,{get:function(){return store._vm[key];},enumerable:true});});var silent=Vue.config.silent;Vue.config.silent=true;store._vm=new Vue({data:{$$state:state},computed:computed});Vue.config.silent=silent;if(store.strict){enableStrictMode(store);}
if(oldVm){if(hot){store._withCommit(function(){oldVm._data.$$state=null;});}
Vue.nextTick(function(){return oldVm.$destroy();});}}
function installModule(store,rootState,path,module,hot){var isRoot=!path.length;var namespace=store._modules.getNamespace(path);if(module.namespaced){if(store._modulesNamespaceMap[namespace]&&"development"!=='production'){console.error(("[vuex] duplicate namespace "+namespace+" for the namespaced module "+(path.join('/'))));}
store._modulesNamespaceMap[namespace]=module;}
if(!isRoot&&!hot){var parentState=getNestedState(rootState,path.slice(0,-1));var moduleName=path[path.length-1];store._withCommit(function(){{if(moduleName in parentState){console.warn(("[vuex] state field \""+moduleName+"\" was overridden by a module with the same name at \""+(path.join('.'))+"\""));}}
Vue.set(parentState,moduleName,module.state);});}
var local=module.context=makeLocalContext(store,namespace,path);module.forEachMutation(function(mutation,key){var namespacedType=namespace+key;registerMutation(store,namespacedType,mutation,local);});module.forEachAction(function(action,key){var type=action.root?key:namespace+key;var handler=action.handler||action;registerAction(store,type,handler,local);});module.forEachGetter(function(getter,key){var namespacedType=namespace+key;registerGetter(store,namespacedType,getter,local);});module.forEachChild(function(child,key){installModule(store,rootState,path.concat(key),child,hot);});}
function makeLocalContext(store,namespace,path){var noNamespace=namespace==='';var local={dispatch:noNamespace?store.dispatch:function(_type,_payload,_options){var args=unifyObjectStyle(_type,_payload,_options);var payload=args.payload;var options=args.options;var type=args.type;if(!options||!options.root){type=namespace+type;if(!store._actions[type]){console.error(("[vuex] unknown local action type: "+(args.type)+", global type: "+type));return}}
return store.dispatch(type,payload)},commit:noNamespace?store.commit:function(_type,_payload,_options){var args=unifyObjectStyle(_type,_payload,_options);var payload=args.payload;var options=args.options;var type=args.type;if(!options||!options.root){type=namespace+type;if(!store._mutations[type]){console.error(("[vuex] unknown local mutation type: "+(args.type)+", global type: "+type));return}}
store.commit(type,payload,options);}};Object.defineProperties(local,{getters:{get:noNamespace?function(){return store.getters;}:function(){return makeLocalGetters(store,namespace);}},state:{get:function(){return getNestedState(store.state,path);}}});return local}
function makeLocalGetters(store,namespace){if(!store._makeLocalGettersCache[namespace]){var gettersProxy={};var splitPos=namespace.length;Object.keys(store.getters).forEach(function(type){if(type.slice(0,splitPos)!==namespace){return}
var localType=type.slice(splitPos);Object.defineProperty(gettersProxy,localType,{get:function(){return store.getters[type];},enumerable:true});});store._makeLocalGettersCache[namespace]=gettersProxy;}
return store._makeLocalGettersCache[namespace]}
function registerMutation(store,type,handler,local){var entry=store._mutations[type]||(store._mutations[type]=[]);entry.push(function wrappedMutationHandler(payload){handler.call(store,local.state,payload);});}
function registerAction(store,type,handler,local){var entry=store._actions[type]||(store._actions[type]=[]);entry.push(function wrappedActionHandler(payload){var res=handler.call(store,{dispatch:local.dispatch,commit:local.commit,getters:local.getters,state:local.state,rootGetters:store.getters,rootState:store.state},payload);if(!isPromise(res)){res=Promise.resolve(res);}
if(store._devtoolHook){return res.catch(function(err){store._devtoolHook.emit('vuex:error',err);throw err})}else{return res}});}
function registerGetter(store,type,rawGetter,local){if(store._wrappedGetters[type]){{console.error(("[vuex] duplicate getter key: "+type));}
return}
store._wrappedGetters[type]=function wrappedGetter(store){return rawGetter(local.state,local.getters,store.state,store.getters)};}
function enableStrictMode(store){store._vm.$watch(function(){return this._data.$$state},function(){{assert(store._committing,"do not mutate vuex store state outside mutation handlers.");}},{deep:true,sync:true});}
function getNestedState(state,path){return path.length?path.reduce(function(state,key){return state[key];},state):state}
function unifyObjectStyle(type,payload,options){if(isObject(type)&&type.type){options=payload;payload=type;type=type.type;}{assert(typeof type==='string',("expects string as the type, but found "+(typeof type)+"."));}
return{type:type,payload:payload,options:options}}
function install(_Vue){if(Vue&&_Vue===Vue){{console.error('[vuex] already installed. Vue.use(Vuex) should be called only once.');}
return}
Vue=_Vue;applyMixin(Vue);}
var mapState=normalizeNamespace(function(namespace,states){var res={};if(!isValidMap(states)){console.error('[vuex] mapState: mapper parameter must be either an Array or an Object');}
normalizeMap(states).forEach(function(ref){var key=ref.key;var val=ref.val;res[key]=function mappedState(){var state=this.$store.state;var getters=this.$store.getters;if(namespace){var module=getModuleByNamespace(this.$store,'mapState',namespace);if(!module){return}
state=module.context.state;getters=module.context.getters;}
return typeof val==='function'?val.call(this,state,getters):state[val]};res[key].vuex=true;});return res});var mapMutations=normalizeNamespace(function(namespace,mutations){var res={};if(!isValidMap(mutations)){console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object');}
normalizeMap(mutations).forEach(function(ref){var key=ref.key;var val=ref.val;res[key]=function mappedMutation(){var args=[],len=arguments.length;while(len--)args[len]=arguments[len];var commit=this.$store.commit;if(namespace){var module=getModuleByNamespace(this.$store,'mapMutations',namespace);if(!module){return}
commit=module.context.commit;}
return typeof val==='function'?val.apply(this,[commit].concat(args)):commit.apply(this.$store,[val].concat(args))};});return res});var mapGetters=normalizeNamespace(function(namespace,getters){var res={};if(!isValidMap(getters)){console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object');}
normalizeMap(getters).forEach(function(ref){var key=ref.key;var val=ref.val;val=namespace+val;res[key]=function mappedGetter(){if(namespace&&!getModuleByNamespace(this.$store,'mapGetters',namespace)){return}
if(!(val in this.$store.getters)){console.error(("[vuex] unknown getter: "+val));return}
return this.$store.getters[val]};res[key].vuex=true;});return res});var mapActions=normalizeNamespace(function(namespace,actions){var res={};if(!isValidMap(actions)){console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object');}
normalizeMap(actions).forEach(function(ref){var key=ref.key;var val=ref.val;res[key]=function mappedAction(){var args=[],len=arguments.length;while(len--)args[len]=arguments[len];var dispatch=this.$store.dispatch;if(namespace){var module=getModuleByNamespace(this.$store,'mapActions',namespace);if(!module){return}
dispatch=module.context.dispatch;}
return typeof val==='function'?val.apply(this,[dispatch].concat(args)):dispatch.apply(this.$store,[val].concat(args))};});return res});var createNamespacedHelpers=function(namespace){return({mapState:mapState.bind(null,namespace),mapGetters:mapGetters.bind(null,namespace),mapMutations:mapMutations.bind(null,namespace),mapActions:mapActions.bind(null,namespace)});};function normalizeMap(map){if(!isValidMap(map)){return[]}
return Array.isArray(map)?map.map(function(key){return({key:key,val:key});}):Object.keys(map).map(function(key){return({key:key,val:map[key]});})}
function isValidMap(map){return Array.isArray(map)||isObject(map)}
function normalizeNamespace(fn){return function(namespace,map){if(typeof namespace!=='string'){map=namespace;namespace='';}else if(namespace.charAt(namespace.length-1)!=='/'){namespace+='/';}
return fn(namespace,map)}}
function getModuleByNamespace(store,helper,namespace){var module=store._modulesNamespaceMap[namespace];if(!module){console.error(("[vuex] module namespace not found in "+helper+"(): "+namespace));}
return module}
var index={Store:Store,install:install,version:'3.1.2',mapState:mapState,mapMutations:mapMutations,mapGetters:mapGetters,mapActions:mapActions,createNamespacedHelpers:createNamespacedHelpers};return index;}));
/*! js-cookie v2.1.4 | MIT */!function(a){var b=!1;if("function"==typeof define&&define.amd&&(define(a),b=!0),"object"==typeof exports&&(module.exports=a(),b=!0),!b){var c=window.Cookies,d=window.Cookies=a();d.noConflict=function(){return window.Cookies=c,d}}}(function(){function a(){for(var a=0,b={};a<arguments.length;a++){var c=arguments[a];for(var d in c)b[d]=c[d]}return b}function b(c){function d(b,e,f){var g;if("undefined"!=typeof document){if(arguments.length>1){if(f=a({path:"/"},d.defaults,f),"number"==typeof f.expires){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}f.expires=f.expires?f.expires.toUTCString():"";try{g=JSON.stringify(e),/^[\{\[]/.test(g)&&(e=g)}catch(p){}e=c.write?c.write(e,b):encodeURIComponent(e+"").replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),b=encodeURIComponent(b+""),b=b.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),b=b.replace(/[\(\)]/g,escape);var i="";for(var j in f)f[j]&&(i+="; "+j,!0!==f[j]&&(i+="="+f[j]));return document.cookie=b+"="+e+i}b||(g={});for(var k=document.cookie?document.cookie.split("; "):[],l=0;l<k.length;l++){var m=k[l].split("="),n=m.slice(1).join("=");'"'===n.charAt(0)&&(n=n.slice(1,-1));try{var o=m[0].replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent);if(n=c.read?c.read(n,o):c(n,o)||n.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent),this.json)try{n=JSON.parse(n)}catch(p){}if(b===o){g=n;break}b||(g[o]=n)}catch(p){}}return g}}return d.set=d,d.get=function(a){return d.call(d,a)},d.getJSON=function(){return d.apply({json:!0},[].slice.call(arguments))},d.defaults={},d.remove=function(b,c){d(b,"",a(c,{expires:-1}))},d.withConverter=b,d}return b(function(){})});!function(t,e,i,n){var a=e.document,o=t(a),r=t(e),s=Array.prototype,l=!0,c=3e4,h=!1,u=navigator.userAgent.toLowerCase(),d=e.location.hash.replace(/#\//,""),p="file:"==e.location.protocol?"http:":e.location.protocol,f=Math,g=function(){},m=function(){return!1},v=function(){var t=3,e=a.createElement("div"),i=e.getElementsByTagName("i");do{e.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e"}while(i[0]);return t>4?t:a.documentMode||n}(),y=function(){return{html:a.documentElement,body:a.body,head:a.getElementsByTagName("head")[0],title:a.title}},_=e.parent!==e.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",w=function(){var e=[];return t.each(b.split(" "),function(t,i){e.push(i),/_/.test(i)&&e.push(i.replace(/_/g,""))}),e}(),x=function(e){var i;return"object"!=typeof e?e:(t.each(e,function(n,a){/^[a-z]+_/.test(n)&&(i="",t.each(n.split("_"),function(t,e){i+=t>0?e.substr(0,1).toUpperCase()+e.substr(1):e}),e[i]=a,delete e[n])}),e)},T=function(e){return t.inArray(e,w)>-1?i[e.toUpperCase()]:e},k={youtube:{reg:/https?:\/\/(?:[a-zA_Z]{2,3}.)?(?:youtube\.com\/watch\?)((?:[\w\d\-\_\=]+&(?:amp;)?)*v(?:<[A-Z]+>)?=([0-9a-zA-Z\-\_]+))/i,embed:function(){return p+"//www.youtube.com/embed/"+this.id},get_thumb:function(t){return p+"//img.youtube.com/vi/"+this.id+"/default.jpg"},get_image:function(t){return p+"//img.youtube.com/vi/"+this.id+"/hqdefault.jpg"}},vimeo:{reg:/https?:\/\/(?:www\.)?(vimeo\.com)\/(?:hd#)?([0-9]+)/i,embed:function(){return p+"//player.vimeo.com/video/"+this.id},getUrl:function(){return p+"//vimeo.com/api/v2/video/"+this.id+".json?callback=?"},get_thumb:function(t){return t[0].thumbnail_medium},get_image:function(t){return t[0].thumbnail_large}},dailymotion:{reg:/https?:\/\/(?:www\.)?(dailymotion\.com)\/video\/([^_]+)/,embed:function(){return p+"//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(t){return t.thumbnail_240_url},get_image:function(t){return t.thumbnail_720_url}},_inst:[]},C=function(i,n){for(var a=0;a<k._inst.length;a++)if(k._inst[a].id===n&&k._inst[a].type==i)return k._inst[a];this.type=i,this.id=n,this.readys=[],k._inst.push(this);var o=this;t.extend(this,k[i]),_videoThumbs=function(e){o.data=e,t.each(o.readys,function(t,e){e(o.data)}),o.readys=[]},this.hasOwnProperty("getUrl")?t.getJSON(this.getUrl(),_videoThumbs):e.setTimeout(_videoThumbs,400),this.getMedia=function(t,e,i){i=i||g;var n=this,a=function(i){e(n["get_"+t](i))};try{n.data?a(n.data):n.readys.push(a)}catch(t){i()}}},I=function(t){var e;for(var i in k)if((e=t&&k[i].reg&&t.match(k[i].reg))&&e.length)return{id:e[2],provider:i};return!1},S={support:function(){var t=y().html;return!_&&(t.requestFullscreen||t.msRequestFullscreen||t.mozRequestFullScreen||t.webkitRequestFullScreen)}(),callback:g,enter:function(t,e,i){this.instance=t,this.callback=e||g,i=i||y().html,i.requestFullscreen?i.requestFullscreen():i.msRequestFullscreen?i.msRequestFullscreen():i.mozRequestFullScreen?i.mozRequestFullScreen():i.webkitRequestFullScreen&&i.webkitRequestFullScreen()},exit:function(t){this.callback=t||g,a.exitFullscreen?a.exitFullscreen():a.msExitFullscreen?a.msExitFullscreen():a.mozCancelFullScreen?a.mozCancelFullScreen():a.webkitCancelFullScreen&&a.webkitCancelFullScreen()},instance:null,listen:function(){if(this.support){var t=function(){if(S.instance){var t=S.instance._fullscreen;a.fullscreen||a.mozFullScreen||a.webkitIsFullScreen||a.msFullscreenElement&&null!==a.msFullscreenElement?t._enter(S.callback):t._exit(S.callback)}};a.addEventListener("fullscreenchange",t,!1),a.addEventListener("MSFullscreenChange",t,!1),a.addEventListener("mozfullscreenchange",t,!1),a.addEventListener("webkitfullscreenchange",t,!1)}}},A=[],E=[],D=!1,L=!1,$=[],P=[],z=function(e){P.push(e),t.each($,function(t,i){i._options.theme!=e.name&&(i._initialized||i._options.theme)||(i.theme=e,i._init.call(i))})},F=function(){return{clearTimer:function(e){t.each(i.get(),function(){this.clearTimer(e)})},addTimer:function(e){t.each(i.get(),function(){this.addTimer(e)})},array:function(t){return s.slice.call(t,0)},create:function(t,e){e=e||"div";var i=a.createElement(e);return i.className=t,i},removeFromArray:function(e,i){return t.each(e,function(t,n){if(n==i)return e.splice(t,1),!1}),e},getScriptPath:function(e){e=e||t("script:last").attr("src");var i=e.split("/");return 1==i.length?"":(i.pop(),i.join("/")+"/")},animate:function(){var n,o,r,s,l,c,h,u=function(t){var i,n="transition WebkitTransition MozTransition OTransition".split(" ");if(e.opera)return!1;for(i=0;n[i];i++)if(void 0!==t[n[i]])return n[i];return!1}((a.body||a.documentElement).style),d={MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[u],p={_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]},f=function(e,i,n){var a={};n=n||"transition",t.each("webkit moz ms o".split(" "),function(){a["-"+this+"-"+n]=i}),e.css(a)},m=function(t){f(t,"none","transition"),i.WEBKIT&&i.TOUCH&&(f(t,"translate3d(0,0,0)","transform"),t.data("revert")&&(t.css(t.data("revert")),t.data("revert",null)))};return function(a,v,y){return y=t.extend({duration:400,complete:g,stop:!1},y),a=t(a),y.duration?u?(y.stop&&(a.off(d),m(a)),n=!1,t.each(v,function(t,e){h=a.css(t),F.parseValue(h)!=F.parseValue(e)&&(n=!0),a.css(t,h)}),n?(o=[],r=y.easing in p?p[y.easing]:p._default,s=" "+y.duration+"ms cubic-bezier("+r.join(",")+")",void e.setTimeout(function(e,n,a,r){return function(){e.one(n,function(t){return function(){m(t),y.complete.call(t[0])}}(e)),i.WEBKIT&&i.TOUCH&&(l={},c=[0,0,0],t.each(["left","top"],function(t,i){i in a&&(c[t]=F.parseValue(a[i])-F.parseValue(e.css(i))+"px",l[i]=a[i],delete a[i])}),(c[0]||c[1])&&(e.data("revert",l),o.push("-webkit-transform"+r),f(e,"translate3d("+c.join(",")+")","transform"))),t.each(a,function(t,e){o.push(t+r)}),f(e,o.join(",")),e.css(a)}}(a,d,v,s),2)):void e.setTimeout(function(){y.complete.call(a[0])},y.duration)):void a.animate(v,y):(a.css(v),void y.complete.call(a[0]))}}(),removeAlpha:function(t){if(t instanceof jQuery&&(t=t[0]),v<9&&t){var e=t.style,i=t.currentStyle,n=i&&i.filter||e.filter||"";/alpha/.test(n)&&(e.filter=n.replace(/alpha\([^)]*\)/i,""))}},forceStyles:function(e,i){e=t(e),e.attr("style")&&e.data("styles",e.attr("style")).removeAttr("style"),e.css(i)},revertStyles:function(){t.each(F.array(arguments),function(e,i){i=t(i),i.removeAttr("style"),i.attr("style",""),i.data("styles")&&i.attr("style",i.data("styles")).data("styles",null)})},moveOut:function(t){F.forceStyles(t,{position:"absolute",left:-1e4})},moveIn:function(){F.revertStyles.apply(F,F.array(arguments))},hide:function(e,i,n){n=n||g;var a=t(e);e=a[0],a.data("opacity")||a.data("opacity",a.css("opacity"));var o={opacity:0};if(i){var r=v<9&&e?function(){F.removeAlpha(e),e.style.visibility="hidden",n.call(e)}:n;F.animate(e,o,{duration:i,complete:r,stop:!0})}else v<9&&e?(F.removeAlpha(e),e.style.visibility="hidden"):a.css(o)},show:function(e,i,n){n=n||g;var a=t(e);e=a[0];var o=parseFloat(a.data("opacity"))||1,r={opacity:o};if(i){v<9&&(a.css("opacity",0),e.style.visibility="visible");var s=v<9&&e?function(){1==r.opacity&&F.removeAlpha(e),n.call(e)}:n;F.animate(e,r,{duration:i,complete:s,stop:!0})}else v<9&&1==r.opacity&&e?(F.removeAlpha(e),e.style.visibility="visible"):a.css(r)},wait:function(n){i._waiters=i._waiters||[],n=t.extend({until:m,success:g,error:function(){i.raise("Could not complete wait function.")},timeout:3e3},n);var a,o,r,s=F.timestamp(),l=function(){return o=F.timestamp(),a=o-s,F.removeFromArray(i._waiters,r),n.until(a)?(n.success(),!1):"number"==typeof n.timeout&&o>=s+n.timeout?(n.error(),!1):void i._waiters.push(r=e.setTimeout(l,10))};i._waiters.push(r=e.setTimeout(l,10))},toggleQuality:function(t,e){7!==v&&8!==v||!t||"IMG"!=t.nodeName.toUpperCase()||(void 0===e&&(e="nearest-neighbor"===t.style.msInterpolationMode),t.style.msInterpolationMode=e?"bicubic":"nearest-neighbor")},insertStyleTag:function(e,i){if(!i||!t("#"+i).length){var n=a.createElement("style");if(i&&(n.id=i),y().head.appendChild(n),n.styleSheet)n.styleSheet.cssText=e;else{var o=a.createTextNode(e);n.appendChild(o)}}},loadScript:function(e,i){var n=!1,a=t("<script>").attr({src:e,async:!0}).get(0);a.onload=a.onreadystatechange=function(){n||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(n=!0,a.onload=a.onreadystatechange=null,"function"==typeof i&&i.call(this,this))},y().head.appendChild(a)},parseValue:function(t){if("number"==typeof t)return t;if("string"==typeof t){var e=t.match(/\-?\d|\./g);return e&&e.constructor===Array?1*e.join(""):0}return 0},timestamp:function(){return(new Date).getTime()},loadCSS:function(e,o,r){var s,l;if(t("link[rel=stylesheet]").each(function(){if(new RegExp(e).test(this.href))return s=this,!1}),"function"==typeof o&&(r=o,o=n),r=r||g,s)return r.call(s,s),s;if(l=a.styleSheets.length,t("#"+o).length)t("#"+o).attr("href",e),l--;else{s=t("<link>").attr({rel:"stylesheet",href:e,id:o}).get(0);var c=t('link[rel="stylesheet"], style');if(c.length?c.get(0).parentNode.insertBefore(s,c[0]):y().head.appendChild(s),v&&l>=31)return void i.raise("You have reached the browser stylesheet limit (31)",!0)}if("function"==typeof r){var h=t("<s>").attr("id","galleria-loader").hide().appendTo(y().body);F.wait({until:function(){return h.height()>0},success:function(){h.remove(),r.call(s,s)},error:function(){h.remove(),i.raise("Theme CSS could not load after 20 sec. "+(i.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}}}(),H=function(e){return F.insertStyleTag(".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}","galleria-videoicon"),t(F.create("galleria-videoicon")).html("<i></i>").appendTo(e).click(function(){t(this).siblings("img").mouseup()})},O=function(){var e=function(e,i,n,a){var o=this.getOptions("easing"),r=this.getStageWidth(),s={left:r*(e.rewind?-1:1)},l={left:0};n?(s.opacity=0,l.opacity=1):s.opacity=1,t(e.next).css(s),F.animate(e.next,l,{duration:e.speed,complete:function(t){return function(){i(),t.css({left:0})}}(t(e.next).add(e.prev)),queue:!1,easing:o}),a&&(e.rewind=!e.rewind),e.prev&&(s={left:0},l={left:r*(e.rewind?1:-1)},n&&(s.opacity=1,l.opacity=0),t(e.prev).css(s),F.animate(e.prev,l,{duration:e.speed,queue:!1,easing:o,complete:function(){t(this).css("opacity",0)}}))};return{active:!1,init:function(t,e,i){O.effects.hasOwnProperty(t)&&O.effects[t].call(this,e,i)},effects:{fade:function(e,i){t(e.next).css({opacity:0,left:0}),F.animate(e.next,{opacity:1},{duration:e.speed,complete:i}),e.prev&&(t(e.prev).css("opacity",1).show(),F.animate(e.prev,{opacity:0},{duration:e.speed}))},flash:function(e,i){t(e.next).css({opacity:0,left:0}),e.prev?F.animate(e.prev,{opacity:0},{duration:e.speed/2,complete:function(){F.animate(e.next,{opacity:1},{duration:e.speed,complete:i})}}):F.animate(e.next,{opacity:1},{duration:e.speed,complete:i})},pulse:function(e,i){e.prev&&t(e.prev).hide(),t(e.next).css({opacity:0,left:0}).show(),F.animate(e.next,{opacity:1},{duration:e.speed,complete:i})},slide:function(t,i){e.apply(this,F.array(arguments))},fadeslide:function(t,i){e.apply(this,F.array(arguments).concat([!0]))},doorslide:function(t,i){e.apply(this,F.array(arguments).concat([!1,!0]))}}}}();S.listen(),t.event.special["click:fast"]={propagate:!0,add:function(i){var n=function(t){if(t.touches&&t.touches.length){var e=t.touches[0];return{x:e.pageX,y:e.pageY}}},a={touched:!1,touchdown:!1,coords:{x:0,y:0},evObj:{}};t(this).data({clickstate:a,timer:0}).on("touchstart.fast",function(i){e.clearTimeout(t(this).data("timer")),t(this).data("clickstate",{touched:!0,touchdown:!0,coords:n(i.originalEvent),evObj:i})}).on("touchmove.fast",function(e){var i=n(e.originalEvent),a=t(this).data("clickstate");Math.max(Math.abs(a.coords.x-i.x),Math.abs(a.coords.y-i.y))>6&&t(this).data("clickstate",t.extend(a,{touchdown:!1}))}).on("touchend.fast",function(n){var o=t(this);o.data("clickstate").touchdown&&i.handler.call(this,n),o.data("timer",e.setTimeout(function(){o.data("clickstate",a)},400))}).on("click.fast",function(e){if(t(this).data("clickstate").touched)return!1;t(this).data("clickstate",a),i.handler.call(this,e)})},remove:function(){t(this).off("touchstart.fast touchmove.fast touchend.fast click.fast")}},r.on("orientationchange",function(){t(this).resize()}),i=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=n,this._binds=[],this._id=parseInt(1e4*f.random(),10),t.each("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".split(" "),function(t,e){s._dom[e]=F.create("galleria-"+e)}),t.each("current total".split(" "),function(t,e){s._dom[e]=F.create("galleria-"+e,"span")});var l=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:!1,press:function(t){var e=t.keyCode||t.which;e in l.map&&"function"==typeof l.map[e]&&l.map[e].call(s,t)},attach:function(t){var e,i;for(e in t)t.hasOwnProperty(e)&&(i=e.toUpperCase(),i in l.keys?l.map[l.keys[i]]=t[e]:l.map[i]=t[e]);l.bound||(l.bound=!0,o.on("keydown",l.press))},detach:function(){l.bound=!1,l.map={},o.off("keydown",l.press)}},c=this._controls={0:n,1:n,active:0,swap:function(){c.active=c.active?0:1},getActive:function(){return s._options.swipe?c.slides[s._active]:c[c.active]},getNext:function(){return s._options.swipe?c.slides[s.getNext(s._active)]:c[1-c.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 e=0,i=0,n=[0];t.each(s._thumbnails,function(a,o){if(o.ready){e+=o.outerWidth||t(o.container).outerWidth(!0);var r=t(o.container).width();e+=r-f.floor(r),n[a+1]=e,i=f.max(i,o.outerHeight||t(o.container).outerHeight(!0))}}),s.$("thumbnails").css({width:e,height:i}),h.max=e,h.hooks=n,h.width=s.$("thumbnails-list").width(),h.setClasses(),s.$("thumbnails-container").toggleClass("galleria-carousel",e>h.width),h.width=s.$("thumbnails-list").width()},bindControls:function(){var t;h.next.on("click:fast",function(e){if(e.preventDefault(),"auto"===s._options.carouselSteps){for(t=h.current;t<h.hooks.length;t++)if(h.hooks[t]-h.hooks[h.current]>h.width){h.set(t-2);break}}else h.set(h.current+s._options.carouselSteps)}),h.prev.on("click:fast",function(e){if(e.preventDefault(),"auto"===s._options.carouselSteps)for(t=h.current;t>=0;t--){if(h.hooks[h.current]-h.hooks[t]>h.width){h.set(t+2);break}if(0===t){h.set(0);break}}else h.set(h.current-s._options.carouselSteps)})},set:function(t){for(t=f.max(t,0);h.hooks[t-1]+h.width>=h.max&&t>=0;)t--;h.current=t,h.animate()},getLast:function(t){return(t||h.current)-1},follow:function(t){if(0===t||t===h.hooks.length-2)return void h.set(t);for(var e=h.current;h.hooks[e]-h.hooks[h.current]<h.width&&e<=h.hooks.length;)e++;t-1<h.current?h.set(t-1):t+2>e&&h.set(t-e+h.current+2)},setClasses:function(){h.prev.toggleClass("disabled",!h.current),h.next.toggleClass("disabled",h.hooks[h.current]+h.width>=h.max)},animate:function(e){h.setClasses();var i=-1*h.hooks[h.current];isNaN(i)||(s.$("thumbnails").css("left",function(){return t(this).css("left")}),F.animate(s.get("thumbnails"),{left:i},{duration:s._options.carouselSpeed,easing:s._options.easing,queue:!1}))}},d=this._tooltip={initialized:!1,open:!1,timer:"tooltip"+s._id,swapTimer:"swap"+s._id,init:function(){d.initialized=!0;F.insertStyleTag(".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);}","galleria-tooltip"),s.$("tooltip").css({opacity:.8,visibility:"visible",display:"none"})},move:function(t){var e=s.getMousePosition(t).x,i=s.getMousePosition(t).y,n=s.$("tooltip"),a=e,o=i,r=n.outerHeight(!0)+1,l=n.outerWidth(!0),c=r+15,h=s.$("container").width()-l-2,u=s.$("container").height()-r-2;isNaN(a)||isNaN(o)||(a+=10,o-=r+8,a=f.max(0,f.min(h,a)),o=f.max(0,f.min(u,o)),i<c&&(o=c),n.css({left:a,top:o}))},bind:function(e,n){if(!i.TOUCH){d.initialized||d.init();var a=function(){s.$("container").off("mousemove",d.move),s.clearTimer(d.timer),s.$("tooltip").stop().animate({opacity:0},200,function(){s.$("tooltip").hide(),s.addTimer(d.swapTimer,function(){d.open=!1},1e3)})},o=function(e,i){d.define(e,i),t(e).hover(function(){s.clearTimer(d.swapTimer),s.$("container").off("mousemove",d.move).on("mousemove",d.move).trigger("mousemove"),d.show(e),s.addTimer(d.timer,function(){s.$("tooltip").stop().show().animate({opacity:1}),d.open=!0},d.open?0:500)},a).click(a)};"string"==typeof n?o(e in s._dom?s.get(e):e,n):t.each(e,function(t,e){o(s.get(t),e)})}},show:function(i){i=t(i in s._dom?s.get(i):i);var n=i.data("tt"),a=function(t){e.setTimeout(function(t){return function(){d.move(t)}}(t),10),i.off("mouseup",a)};(n="function"==typeof n?n():n)&&(s.$("tooltip").html(n.replace(/\s/," ")),i.on("mouseup",a))},define:function(e,i){if("function"!=typeof i){var n=i;i=function(){return n}}e=t(e in s._dom?s.get(e):e).data("tt",i),d.show(e)}},p=this._fullscreen={scrolled:0,crop:n,active:!1,prev:t(),beforeEnter:function(t){t()},beforeExit:function(t){t()},keymap:s._keyboard.map,parseCallback:function(e,i){return O.active?function(){"function"==typeof e&&e.call(s);var n=s._controls.getActive(),a=s._controls.getNext();s._scaleImage(a),s._scaleImage(n),i&&s._options.trueFullscreen&&t(n.container).add(a.container).trigger("transitionend")}:e},enter:function(t){p.beforeEnter(function(){t=p.parseCallback(t,!0),s._options.trueFullscreen&&S.support?(p.active=!0,F.forceStyles(s.get("container"),{width:"100%",height:"100%"}),s.rescale(),i.MAC?i.SAFARI&&/version\/[1-5]/.test(u)?(s.$("stage").css("opacity",0),e.setTimeout(function(){p.scale(),s.$("stage").css("opacity",1)},4)):(s.$("container").css("opacity",0).addClass("fullscreen"),e.setTimeout(function(){p.scale(),s.$("container").css("opacity",1)},50)):s.$("container").addClass("fullscreen"),r.resize(p.scale),S.enter(s,t,s.get("container"))):(p.scrolled=r.scrollTop(),i.TOUCH||e.scrollTo(0,0),p._enter(t))})},_enter:function(o){p.active=!0,_&&(p.iframe=function(){var n,o=a.referrer,r=a.createElement("a"),s=e.location;return r.href=o,r.protocol!=s.protocol||r.hostname!=s.hostname||r.port!=s.port?(i.raise("Parent fullscreen not available. Iframe protocol, domains and ports must match."),!1):(p.pd=e.parent.document,t(p.pd).find("iframe").each(function(){if((this.contentDocument||this.contentWindow.document)===a)return n=this,!1}),n)}()),F.hide(s.getActiveImage()),_&&p.iframe&&(p.iframe.scrolled=t(e.parent).scrollTop(),e.parent.scrollTo(0,0));var l=s.getData(),c=s._options,h=!s._options.trueFullscreen||!S.support,u={height:"100%",overflow:"hidden",margin:0,padding:0};if(h&&(s.$("container").addClass("fullscreen"),p.prev=s.$("container").prev(),p.prev.length||(p.parent=s.$("container").parent()),s.$("container").appendTo("body"),F.forceStyles(s.get("container"),{position:i.TOUCH?"absolute":"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1e4}),F.forceStyles(y().html,u),F.forceStyles(y().body,u)),_&&p.iframe&&(F.forceStyles(p.pd.documentElement,u),F.forceStyles(p.pd.body,u),F.forceStyles(p.iframe,t.extend(u,{width:"100%",height:"100%",top:0,left:0,position:"fixed",zIndex:1e4,border:"none"}))),p.keymap=t.extend({},s._keyboard.map),s.attachKeyboard({escape:s.exitFullscreen,right:s.next,left:s.prev}),p.crop=c.imageCrop,c.fullscreenCrop!=n&&(c.imageCrop=c.fullscreenCrop),l&&l.big&&l.image!==l.big){var d=new i.Picture,f=d.isCached(l.big),g=s.getIndex(),m=s._thumbnails[g];s.trigger({type:i.LOADSTART,cached:f,rewind:!1,index:g,imageTarget:s.getActiveImage(),thumbTarget:m,galleriaData:l}),d.load(l.big,function(e){s._scaleImage(e,{complete:function(e){s.trigger({type:i.LOADFINISH,cached:f,index:g,rewind:!1,imageTarget:e.image,thumbTarget:m});var n=s._controls.getActive().image;n&&t(n).width(e.image.width).height(e.image.height).attr("style",t(e.image).attr("style")).attr("src",e.image.src)}})});var v=s.getNext(g),b=new i.Picture,w=s.getData(v);b.preload(s.isFullscreen()&&w.big?w.big:w.image)}s.rescale(function(){s.addTimer(!1,function(){h&&F.show(s.getActiveImage()),"function"==typeof o&&o.call(s),s.rescale()},100),s.trigger(i.FULLSCREEN_ENTER)}),h?r.resize(p.scale):F.show(s.getActiveImage())},scale:function(){s.rescale()},exit:function(t){p.beforeExit(function(){t=p.parseCallback(t),s._options.trueFullscreen&&S.support?S.exit(t):p._exit(t)})},_exit:function(t){p.active=!1;var n=!s._options.trueFullscreen||!S.support,a=s.$("container").removeClass("fullscreen");if(p.parent?p.parent.prepend(a):a.insertAfter(p.prev),n){F.hide(s.getActiveImage()),F.revertStyles(s.get("container"),y().html,y().body),i.TOUCH||e.scrollTo(0,p.scrolled);var o=s._controls.frames[s._controls.active];o&&o.image&&(o.image.src=o.image.src)}_&&p.iframe&&(F.revertStyles(p.pd.documentElement,p.pd.body,p.iframe),p.iframe.scrolled&&e.parent.scrollTo(0,p.iframe.scrolled)),s.detachKeyboard(),s.attachKeyboard(p.keymap),s._options.imageCrop=p.crop;var l=s.getData().big,c=s._controls.getActive().image;!s.getData().iframe&&c&&l&&l==c.src&&e.setTimeout(function(t){return function(){c.src=t}}(s.getData().image),1),s.rescale(function(){s.addTimer(!1,function(){n&&F.show(s.getActiveImage()),"function"==typeof t&&t.call(s),r.trigger("resize")},50),s.trigger(i.FULLSCREEN_EXIT)}),r.off("resize",p.scale)}},g=this._idle={trunk:[],bound:!1,active:!1,add:function(e,n,a,o){if(e&&!i.TOUCH){g.bound||g.addEvent(),e=t(e),"boolean"==typeof a&&(o=a,a={}),a=a||{};var r,s={};for(r in n)n.hasOwnProperty(r)&&(s[r]=e.css(r));e.data("idle",{from:t.extend(s,a),to:n,complete:!0,busy:!1}),o?e.css(n):g.addTimer(),g.trunk.push(e)}},remove:function(e){e=t(e),t.each(g.trunk,function(t,i){i&&i.length&&!i.not(e).length&&(e.css(e.data("idle").from),g.trunk.splice(t,1))}),g.trunk.length||(g.removeEvent(),s.clearTimer(g.timer))},addEvent:function(){g.bound=!0,s.$("container").on("mousemove click",g.showAll),"hover"==s._options.idleMode&&s.$("container").on("mouseleave",g.hide)},removeEvent:function(){g.bound=!1,s.$("container").on("mousemove click",g.showAll),"hover"==s._options.idleMode&&s.$("container").off("mouseleave",g.hide)},addTimer:function(){"hover"!=s._options.idleMode&&s.addTimer("idle",function(){g.hide()},s._options.idleTime)},hide:function(){if(s._options.idleMode&&!1!==s.getIndex()){s.trigger(i.IDLE_ENTER);var e=g.trunk.length;t.each(g.trunk,function(t,i){var n=i.data("idle");n&&(i.data("idle").complete=!1,F.animate(i,n.to,{duration:s._options.idleSpeed,complete:function(){t==e-1&&(g.active=!1)}}))})}},showAll:function(){s.clearTimer("idle"),t.each(g.trunk,function(t,e){g.show(e)})},show:function(e){var n=e.data("idle");g.active&&(n.busy||n.complete)||(n.busy=!0,s.trigger(i.IDLE_EXIT),s.clearTimer("idle"),F.animate(e,n.from,{duration:s._options.idleSpeed/2,complete:function(){g.active=!0,t(e).data("idle").busy=!1,t(e).data("idle").complete=!0}})),g.addTimer()}},m=this._lightbox={width:0,height:0,initialized:!1,active:null,image:null,elems:{},keymap:!1,init:function(){if(!m.initialized){m.initialized=!0;var e={},n=s._options,a="",o="position:absolute;",r="lightbox-",l={overlay:"position:fixed;display:none;opacity:"+n.overlayOpacity+";filter:alpha(opacity="+100*n.overlayOpacity+");top:0;left:0;width:100%;height:100%;background:"+n.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={},h="";h=v>7?v<9?"background:#000;filter:alpha(opacity=0);":"background:rgba(0,0,0,0);":"z-index:99999",l.nextholder+=h,l.prevholder+=h,t.each(l,function(t,e){a+=".galleria-"+r+t+"{"+e+"}"}),a+=".galleria-lightbox-box.iframe .galleria-lightbox-prevholder,.galleria-lightbox-box.iframe .galleria-lightbox-nextholder{width:100px;height:100px;top:50%;margin-top:-70px}",F.insertStyleTag(a,"galleria-lightbox"),t.each("overlay box content shadow title info close prevholder prev nextholder next counter image".split(" "),function(t,i){s.addElement("lightbox-"+i),e[i]=m.elems[i]=s.get("lightbox-"+i)}),m.image=new i.Picture,t.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(e,i){var n=[];t.each(i.split(" "),function(t,e){n.push(r+e)}),c[r+e]=n}),s.append(c),t(e.image).append(m.image.container),t(y().body).append(e.overlay,e.box),function(e){e.hover(function(){t(this).css("color","#bbb")},function(){t(this).css("color","#444")})}(t(e.close).on("click:fast",m.hide).html("×")),t.each(["Prev","Next"],function(n,a){var o=t(e[a.toLowerCase()]).html(/v/.test(a)?"‹ ":" ›"),r=t(e[a.toLowerCase()+"holder"]);if(r.on("click:fast",function(){m["show"+a]()}),v<8||i.TOUCH)return void o.show();r.hover(function(){o.show()},function(t){o.stop().fadeOut(200)})}),t(e.overlay).on("click:fast",m.hide),i.IPAD&&(s._options.lightboxTransitionSpeed=0)}},rescale:function(e){var n=f.min(r.width()-40,m.width),a=f.min(r.height()-60,m.height),o=f.min(n/m.width,a/m.height),l=f.round(m.width*o)+40,c=f.round(m.height*o)+60,h={width:l,height:c,"margin-top":-1*f.ceil(c/2),"margin-left":-1*f.ceil(l/2)};e?t(m.elems.box).css(h):t(m.elems.box).animate(h,{duration:s._options.lightboxTransitionSpeed,easing:s._options.easing,complete:function(){var e=m.image,n=s._options.lightboxFadeSpeed;s.trigger({type:i.LIGHTBOX_IMAGE,imageTarget:e.image}),t(e.container).show(),t(e.image).animate({opacity:1},n),F.show(m.elems.info,n)}})},hide:function(){m.image.image=null,r.off("resize",m.rescale),t(m.elems.box).hide().find("iframe").remove(),F.hide(m.elems.info),s.detachKeyboard(),s.attachKeyboard(m.keymap),m.keymap=!1,F.hide(m.elems.overlay,200,function(){t(this).hide().css("opacity",s._options.overlayOpacity),s.trigger(i.LIGHTBOX_CLOSE)})},showNext:function(){m.show(s.getNext(m.active))},showPrev:function(){m.show(s.getPrev(m.active))},show:function(n){m.active=n="number"==typeof n?n:s.getIndex()||0,m.initialized||m.init(),s.trigger(i.LIGHTBOX_OPEN),m.keymap||(m.keymap=t.extend({},s._keyboard.map),s.attachKeyboard({escape:m.hide,right:m.showNext,left:m.showPrev})),r.off("resize",m.rescale);var a,o,l,c=s.getData(n),h=s.getDataLength(),u=s.getNext(n);F.hide(m.elems.info);try{for(l=s._options.preload;l>0;l--)o=new i.Picture,a=s.getData(u),o.preload(a.big?a.big:a.image),u=s.getNext(u)}catch(t){}m.image.isIframe=c.iframe&&!c.image,t(m.elems.box).toggleClass("iframe",m.image.isIframe),t(m.image.container).find(".galleria-videoicon").remove(),m.image.load(c.big||c.image||c.iframe,function(i){if(i.isIframe){var a=t(e).width(),o=t(e).height();if(i.video&&s._options.maxVideoSize){var l=f.min(s._options.maxVideoSize/a,s._options.maxVideoSize/o);l<1&&(a*=l,o*=l)}m.width=a,m.height=o}else m.width=i.original.width,m.height=i.original.height;if(t(i.image).css({width:i.isIframe?"100%":"100.1%",height:i.isIframe?"100%":"100.1%",top:0,bottom:0,zIndex:99998,opacity:0,visibility:"visible"}).parent().height("100%"),m.elems.title.innerHTML=c.title||"",m.elems.counter.innerHTML=n+1+" / "+h,r.resize(m.rescale),m.rescale(),c.image&&c.iframe){if(t(m.elems.box).addClass("iframe"),c.video){var u=H(i.container).hide();e.setTimeout(function(){u.fadeIn(200)},200)}t(i.image).css("cursor","pointer").mouseup(function(e,i){return function(n){t(m.image.container).find(".galleria-videoicon").remove(),n.preventDefault(),i.isIframe=!0,i.load(e.iframe+(e.video?"&autoplay=1":""),{width:"100%",height:v<8?t(m.image.container).height():"100%"})}}(c,i))}}),t(m.elems.overlay).show().css("visibility","visible"),t(m.elems.box).show()}},b=this._timer={trunk:{},add:function(t,i,n,a){if(t=t||(new Date).getTime(),a=a||!1,this.clear(t),a){var o=i;i=function(){o(),b.add(t,i,n)}}this.trunk[t]=e.setTimeout(i,n)},clear:function(t){var i,n=function(t){e.clearTimeout(this.trunk[t]),delete this.trunk[t]};if(t&&t in this.trunk)n.call(this,t);else if(void 0===t)for(i in this.trunk)this.trunk.hasOwnProperty(i)&&n.call(this,i)}};return this},i.prototype={constructor:i,init:function(e,a){if(a=x(a),this._original={target:e,options:a,data:null},this._target=this._dom.target=e.nodeName?e:t(e).get(0),this._original.html=this._target.innerHTML,E.push(this),!this._target)return void i.raise("Target not found",!0);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(t){return{}},dataSelector:"img",dataSort:!1,dataSource:this._target,debug:n,dummy:n,easing:"galleria",extend:function(t){},fullscreenCrop:n,fullscreenDoubleTap:!0,fullscreenTransition:n,height:0,idleMode:!0,idleTime:3e3,idleSpeed:200,imageCrop:!1,imageMargin:0,imagePan:!1,imagePanSmoothness:12,imagePosition:"50%",imageTimeout:n,initialTransition:n,keepSource:!1,layerFollow:!0,lightbox:!1,lightboxFadeSpeed:200,lightboxTransitionSpeed:200,linkSourceImages:!0,maxScaleRatio:n,maxVideoSize:n,minScaleRatio:n,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:n,transition:"fade",transitionInitial:n,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,a&&(!1===a.debug&&(l=!1),"number"==typeof a.imageTimeout&&(c=a.imageTimeout),"string"==typeof a.dummy&&(h=a.dummy),"string"==typeof a.theme&&(this._options.theme=a.theme)),t(this._target).children().hide(),i.QUIRK&&i.raise("Your page is in Quirks mode, Galleria may not render correctly. Please validate your HTML and add a correct doctype."),P.length)if(this._options.theme){for(var o=0;o<P.length;o++)if(this._options.theme===P[o].name){this.theme=P[o];break}}else this.theme=P[0];return"object"==typeof this.theme?this._init():$.push(this),this},_init:function(){var o=this,s=this._options;if(this._initialized)return i.raise("Init failed: Gallery instance already initialized."),this;if(this._initialized=!0,!this.theme)return i.raise("Init failed: No theme found.",!0),this;if(t.extend(!0,s,this.theme.defaults,this._original.options,i.configure.options),s.swipe=function(t){return"enforced"==t||!1!==t&&"disabled"!=t&&!!i.TOUCH}(s.swipe),s.swipe&&(s.clicknext=!1,s.imagePan=!1),function(t){if(!("getContext"in t))return void(t=null);L=L||{elem:t,context:t.getContext("2d"),cache:{},length:0}}(a.createElement("canvas")),this.bind(i.DATA,function(){e.screen&&e.screen.width&&Array.prototype.forEach&&this._data.forEach(function(t){var i="devicePixelRatio"in e?e.devicePixelRatio:1;f.max(e.screen.width,e.screen.height)*i<1024&&(t.big=t.image)}),this._original.data=this._data,this.get("total").innerHTML=this.getDataLength();var t=this.$("container");o._options.height<2&&(o._userRatio=o._ratio=o._options.height);var n={width:0,height:0},a=function(){return o.$("stage").height()};F.wait({until:function(){return n=o._getWH(),t.width(n.width).height(n.height),a()&&n.width&&n.height>50},success:function(){o._width=n.width,o._height=n.height,o._ratio=o._ratio||n.height/n.width,i.WEBKIT?e.setTimeout(function(){o._run()},1):o._run()},error:function(){a()?i.raise("Could not extract sufficient width/height of the gallery container. Traced measures: width:"+n.width+"px, height: "+n.height+"px.",!0):i.raise("Could not extract a stage height from the CSS. Traced height: "+a()+"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"]}),F.hide(this.$("counter").append(this.get("current"),a.createTextNode(" / "),this.get("total"))),this.setCounter("–"),F.hide(o.get("tooltip")),this.$("container").addClass([i.TOUCH?"touch":"notouch",this._options.variation,"galleria-theme-"+this.theme.name].join(" ")),this._options.swipe||t.each(new Array(2),function(e){var n=new i.Picture;t(n.container).css({position:"absolute",top:0,left:0}).prepend(o._layers[e]=t(F.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]),o.$("images").append(n.container),o._controls[e]=n;var a=new i.Picture;a.isIframe=!0,t(a.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(n.container),o._controls.frames[e]=a}),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 i.Finger(this.get("stage"),{onchange:function(t){o.pause().show(t)},oncomplete:function(e){var i=f.max(0,f.min(parseInt(e,10),o.getDataLength()-1)),n=o.getData(i);t(o._thumbnails[i].container).addClass("active").siblings(".active").removeClass("active"),n&&(o.$("images").find(".galleria-frame").css("opacity",0).hide().find("iframe").remove(),o._options.carousel&&o._options.carouselFollow&&o._carousel.follow(i))}}),this.bind(i.RESCALE,function(){this.finger.setup()}),this.$("stage").on("click",function(i){var a=o.getData();if(a){if(a.iframe){o.isPlaying()&&o.pause();var r=o._controls.frames[o._active],s=o._stageWidth,l=o._stageHeight;if(t(r.container).find("iframe").length)return;return t(r.container).css({width:s,height:l,opacity:0}).show().animate({opacity:1},200),void e.setTimeout(function(){r.load(a.iframe+(a.video?"&autoplay=1":""),{width:s,height:l},function(t){o.$("container").addClass("videoplay"),t.scale({width:o._stageWidth,height:o._stageHeight,iframelimit:a.video?o._options.maxVideoSize:n})})},100)}if(a.link)if(o._options.popupLinks){e.open(a.link,"_blank")}else e.location.href=a.link;else;}}),this.bind(i.IMAGE,function(e){o.setCounter(e.index),o.setInfo(e.index);var i=this.getNext(),n=this.getPrev(),a=[n,i];a.push(this.getNext(i),this.getPrev(n),o._controls.slides.length-1);var r=[];t.each(a,function(e,i){-1==t.inArray(i,r)&&r.push(i)}),t.each(r,function(e,i){var n=o.getData(i),a=o._controls.slides[i],r=o.isFullscreen()&&n.big?n.big:n.image||n.iframe;n.iframe&&!n.image&&(a.isIframe=!0),a.ready||o._controls.slides[i].load(r,function(e){e.isIframe||t(e.image).css("visibility","hidden"),o._scaleImage(e,{complete:function(e){e.isIframe||t(e.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(t){s.pauseOnInteraction&&o.pause();var e=/right/.test(this.className)?"next":"prev";o[e]()}).on("click",function(t){t.preventDefault(),(s.clicknext||s.swipe)&&t.stopPropagation()}),t.each(["info","counter","image-nav"],function(t,e){!1===s["show"+e.substr(0,1).toUpperCase()+e.substr(1).replace(/-/,"")]&&F.moveOut(o.get(e.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,c=s.show;this.bind(i.THUMBNAIL,function(){this.updateCarousel(),++l==this.getDataLength()&&"number"==typeof c&&c>0&&this._carousel.follow(c)})}return s.responsive&&r.on("resize",function(){o.isFullscreen()||o.resize()}),s.fullscreenDoubleTap&&this.$("stage").on("touchstart",function(){var t,e,i,n,a,r,s=function(t){return t.originalEvent.touches?t.originalEvent.touches[0]:t};return o.$("stage").on("touchmove",function(){t=0}),function(l){if(!/(-left|-right)/.test(l.target.className)){if(r=F.timestamp(),e=s(l).pageX,i=s(l).pageY,l.originalEvent.touches.length<2&&r-t<300&&e-n<20&&i-a<20)return o.toggleFullscreen(),void l.preventDefault();t=r,n=e,a=i}}}()),t.each(i.on.binds,function(e,i){-1==t.inArray(i.hash,o._binds)&&o.bind(i.type,i.callback)}),this},addTimer:function(){return this._timer.add.apply(this._timer,F.array(arguments)),this},clearTimer:function(){return this._timer.clear.apply(this._timer,F.array(arguments)),this},_getWH:function(){var e,i=this.$("container"),n=this.$("target"),a=this,o={};return t.each(["width","height"],function(t,r){a._options[r]&&"number"==typeof a._options[r]?o[r]=a._options[r]:(e=[F.parseValue(i.css(r)),F.parseValue(n.css(r)),i[r](),n[r]()],a["_"+r]||e.splice(e.length,F.parseValue(i.css("min-"+r)),F.parseValue(n.css("min-"+r))),o[r]=f.max.apply(f,e))}),a._userRatio&&(o.height=o.width*a._userRatio),o},_createThumbnails:function(n){this.get("total").innerHTML=this.getDataLength();var o,r,s,l,c=this,h=this._options,u=n?this._data.length-n.length:0,d=u,p=[],f=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 t=c.$("thumbnails").find(".active");return!!t.length&&t.find("img").attr("src")}(),y="string"==typeof h.thumbnails?h.thumbnails.toLowerCase():null,_=function(t){return a.defaultView&&a.defaultView.getComputedStyle?a.defaultView.getComputedStyle(r.container,null)[t]:l.css(t)},b=function(e){h.pauseOnInteraction&&c.pause();var i=t(e.currentTarget).data("index");c.getIndex()!==i&&c.show(i),e.preventDefault()},w=function(e,n){t(e.container).css("visibility","visible"),c.trigger({type:i.THUMBNAIL,thumbTarget:e.image,index:e.data.order,galleriaData:c.getData(e.data.order)}),"function"==typeof n&&n.call(c,e)},x=function(e,i){e.scale({width:e.data.width,height:e.data.height,crop:h.thumbCrop,margin:h.thumbMargin,canvas:h.useCanvas,position:h.thumbPosition,complete:function(e){var n,a,o=["left","top"],r=["Width","Height"];c.getData(e.index);t.each(r,function(i,r){n=r.toLowerCase(),!0===h.thumbCrop&&h.thumbCrop!==n||(a={},a[n]=e[n],t(e.container).css(a),a={},a[o[i]]=0,t(e.image).css(a)),e["outer"+r]=t(e.container)["outer"+r](!0)}),F.toggleQuality(e.image,!0===h.thumbQuality||"auto"===h.thumbQuality&&e.original.width<3*e.width),h.thumbDisplayOrder&&!e.lazy?t.each(p,function(t,e){if(t===f&&e.ready&&!e.displayed)return f++,e.displayed=!0,void w(e,i)}):w(e,i)}})};for(n||(this._thumbnails=[],this.$("thumbnails").empty());this._data[u];u++)s=this._data[u],o=s.thumb||s.image,!0!==h.thumbnails&&"lazy"!=y||!s.thumb&&!s.image?s.iframe&&null!==y||"empty"===y||"numbers"===y?(r={container:F.create("galleria-image"),image:F.create("img","span"),ready:!0,data:{order:u}},"numbers"===y&&t(r.image).text(u+1),s.iframe&&t(r.image).addClass("iframe"),this.$("thumbnails").append(r.container),e.setTimeout(function(e,n,a){return function(){t(a).append(e),c.trigger({type:i.THUMBNAIL,thumbTarget:e,index:n,galleriaData:c.getData(n)})}}(r.image,u,r.container),50+20*u)):r={container:null,image:null}:(r=new i.Picture(u),r.index=u,r.displayed=!1,r.lazy=!1,r.video=!1,this.$("thumbnails").append(r.container),l=t(r.container),l.css("visibility","hidden"),r.data={width:F.parseValue(_("width")),height:F.parseValue(_("height")),order:u,src:o},!0!==h.thumbCrop?l.css({width:"auto",height:"auto"}):l.css({width:r.data.width,height:r.data.height}),"lazy"==y?(l.addClass("lazy"),r.lazy=!0,r.load(g,{height:r.data.height,width:r.data.width})):r.load(o,x),"all"===h.preload&&r.preload(s.image)),t(r.container).add(h.keepSource&&h.linkSourceImages?s.original:null).data("index",u).on(h.thumbEventType,b).data("thumbload",x),m===o&&t(r.container).addClass("active"),this._thumbnails.push(r);return p=this._thumbnails.slice(d),this},lazyLoad:function(e,i){var n=e.constructor==Array?e:[e],a=this,o=0;return t.each(n,function(e,r){if(!(r>a._thumbnails.length-1)){var s=a._thumbnails[r],l=s.data,c=function(){++o==n.length&&"function"==typeof i&&i.call(a)},h=t(s.container).data("thumbload");s.video?h.call(a,s,c):s.load(l.src,function(t){h.call(a,t,c)})}}),this},lazyLoadChunks:function(t,i){var n=this.getDataLength(),a=0,o=0,r=[],s=[],l=this;for(i=i||0;a<n;a++)s.push(a),++o!=t&&a!=n-1||(r.push(s),o=0,s=[]);var c=function(t){var n=r.shift();n&&e.setTimeout(function(){l.lazyLoad(n,function(){c(!0)})},i&&t?i:0)};return c(!1),this},_run:function(){var a=this;a._createThumbnails(),F.wait({timeout:1e4,until:function(){return i.OPERA&&a.$("stage").css("display","inline-block"),a._stageWidth=a.$("stage").width(),a._stageHeight=a.$("stage").height(),a._stageWidth&&a._stageHeight>50},success:function(){if(A.push(a),a._options.swipe){var o=a.$("images").width(a.getDataLength()*a._stageWidth);t.each(new Array(a.getDataLength()),function(e){var n=new i.Picture,r=a.getData(e);t(n.container).css({position:"absolute",top:0,left:a._stageWidth*e}).prepend(a._layers[e]=t(F.create("galleria-layer")).css({position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2})[0]).appendTo(o),r.video&&H(n.container),a._controls.slides.push(n);var s=new i.Picture;s.isIframe=!0,t(s.container).attr("class","galleria-frame").css({position:"absolute",top:0,left:0,zIndex:4,background:"#000",display:"none"}).appendTo(n.container),a._controls.frames.push(s)}),a.finger.setup()}if(F.show(a.get("counter")),a._options.carousel&&a._carousel.bindControls(),a._options.autoplay&&(a.pause(),"number"==typeof a._options.autoplay&&(a._playtime=a._options.autoplay),a._playing=!0),a._firstrun)return a._options.autoplay&&a.trigger(i.PLAY),void("number"==typeof a._options.show&&a.show(a._options.show));a._firstrun=!0,i.History&&i.History.change(function(t){isNaN(t)?e.history.go(-1):a.show(t,n,!0)}),a.trigger(i.READY),a.theme.init.call(a,a._options),t.each(i.ready.callbacks,function(t,e){"function"==typeof e&&e.call(a,a._options)}),a._options.extend.call(a,a._options),/^[0-9]{1,4}$/.test(d)&&i.History?a.show(d,n,!0):a._data[a._options.show]&&a.show(a._options.show),a._options.autoplay&&a.trigger(i.PLAY)},error:function(){i.raise("Stage width or height is too small to show the gallery. Traced measures: width:"+a._stageWidth+"px, height: "+a._stageHeight+"px.",!0)}})},load:function(e,n,a){var o=this,r=this._options;return this._data=[],this._thumbnails=[],this.$("thumbnails").empty(),"function"==typeof n&&(a=n,n=null),e=e||r.dataSource,n=n||r.dataSelector,a=a||r.dataConfig,t.isPlainObject(e)&&(e=[e]),t.isArray(e)?this.validate(e)?this._data=e:i.raise("Load failed: JSON Array not valid."):(n+=",.video,.iframe",t(e).find(n).each(function(e,i){i=t(i);var n={},r=i.parent(),s=r.attr("href"),l=r.attr("rel");s&&("IMG"==i[0].nodeName||i.hasClass("video"))&&I(s)?n.video=s:s&&i.hasClass("iframe")?n.iframe=s:n.image=n.big=s,l&&(n.big=l),t.each("big title description link layer image".split(" "),function(t,e){i.data(e)&&(n[e]=i.data(e).toString())}),n.big||(n.big=n.image),o._data.push(t.extend({title:i.attr("title")||"",thumb:i.attr("src"),image:i.attr("src"),big:i.attr("src"),description:i.attr("alt")||"",link:i.attr("longdesc"),original:i.get(0)},n,a(i)))})),"function"==typeof r.dataSort?s.sort.call(this._data,r.dataSort):"random"==r.dataSort&&this._data.sort(function(){return f.round(f.random())-.5}),this.getDataLength()&&this._parseData(function(){this.trigger(i.DATA)}),this},_parseData:function(e){var i,a=this,o=!1,r=function(){var i=!0;t.each(a._data,function(t,e){if(e.loading)return i=!1,!1}),i&&!o&&(o=!0,e.call(a))};return t.each(this._data,function(e,o){if(i=a._data[e],"thumb"in o==!1&&(i.thumb=o.image),o.big||(i.big=o.image),"video"in o){var s=I(o.video);s&&(i.iframe=new C(s.provider,s.id).embed()+function(){if("object"==typeof a._options[s.provider]){var e=[];return t.each(a._options[s.provider],function(t,i){e.push(t+"="+i)}),"youtube"==s.provider&&(e=["wmode=opaque"].concat(e)),"?"+e.join("&")}return""}(),i.thumb&&i.image||t.each(["thumb","image"],function(t,e){if("image"==e&&!a._options.videoPoster)return void(i.image=n);var o=new C(s.provider,s.id);i[e]||(i.loading=!0,o.getMedia(e,function(t,e){return function(i){t[e]=i,"image"!=e||t.big||(t.big=t.image),delete t.loading,r()}}(i,e)))}))}}),r(),this},destroy:function(){return this.$("target").data("galleria",null),this.$("container").off("galleria"),this.get("target").innerHTML=this._original.html,this.clearTimer(),F.removeFromArray(E,this),F.removeFromArray(A,this),i._waiters.length&&t.each(i._waiters,function(t,i){i&&e.clearTimeout(i)}),this},splice:function(){var t=this,i=F.array(arguments);return e.setTimeout(function(){s.splice.apply(t._data,i),t._parseData(function(){t._createThumbnails()})},2),t},push:function(){var t=this,i=F.array(arguments);return 1==i.length&&i[0].constructor==Array&&(i=i[0]),e.setTimeout(function(){s.push.apply(t._data,i),t._parseData(function(){t._createThumbnails(i)})},2),t},_getActive:function(){return this._controls.getActive()},validate:function(t){return!0},bind:function(t,e){return t=T(t),this.$("container").on(t,this.proxy(e)),this},unbind:function(t){return t=T(t),this.$("container").off(t),this},trigger:function(e){return e="object"==typeof e?t.extend(e,{scope:this}):{type:T(e),scope:this},this.$("container").trigger(e),this},addIdleState:function(t,e,i,n){return this._idle.add.apply(this._idle,F.array(arguments)),this},removeIdleState:function(t){return this._idle.remove.apply(this._idle,F.array(arguments)),this},enterIdleMode:function(){return this._idle.hide(),this},exitIdleMode:function(){return this._idle.showAll(),this},enterFullscreen:function(t){return this._fullscreen.enter.apply(this,F.array(arguments)),this},exitFullscreen:function(t){return this._fullscreen.exit.apply(this,F.array(arguments)),this},toggleFullscreen:function(t){return this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,F.array(arguments)),this},bindTooltip:function(t,e){return this._tooltip.bind.apply(this._tooltip,F.array(arguments)),this},defineTooltip:function(t,e){return this._tooltip.define.apply(this._tooltip,F.array(arguments)),this},refreshTooltip:function(t){return this._tooltip.show.apply(this._tooltip,F.array(arguments)),this},openLightbox:function(){return this._lightbox.show.apply(this._lightbox,F.array(arguments)),this},closeLightbox:function(){return this._lightbox.hide.apply(this._lightbox,F.array(arguments)),this},hasVariation:function(e){return t.inArray(e,this._options.variation.split(/\s+/))>-1},getActiveImage:function(){var t=this._getActive();return t?t.image:n},getActiveThumb:function(){return this._thumbnails[this._active].image||n},getMousePosition:function(t){return{x:t.pageX-this.$("container").offset().left,y:t.pageY-this.$("container").offset().top}},addPan:function(e){if(!1!==this._options.imageCrop){e=t(e||this.getActiveImage());var i=this,n=e.width()/2,a=e.height()/2,o=parseInt(e.css("left"),10),r=parseInt(e.css("top"),10),s=o||0,l=r||0,c=0,h=0,u=!1,d=F.timestamp(),p=0,g=0,m=function(t,i,n){if(t>0&&(g=f.round(f.max(-1*t,f.min(0,i))),p!==g))if(p=g,8===v)e.parent()["scroll"+n](-1*g);else{var a={};a[n.toLowerCase()]=g,e.css(a)}},y=function(t){F.timestamp()-d<50||(u=!0,n=i.getMousePosition(t).x,a=i.getMousePosition(t).y)},_=function(t){u&&(c=e.width()-i._stageWidth,h=e.height()-i._stageHeight,o=n/i._stageWidth*c*-1,r=a/i._stageHeight*h*-1,s+=(o-s)/i._options.imagePanSmoothness,l+=(r-l)/i._options.imagePanSmoothness,m(h,l,"Top"),m(c,s,"Left"))};return 8===v&&(e.parent().scrollTop(-1*l).scrollLeft(-1*s),e.css({top:0,left:0})),this.$("stage").off("mousemove",y).on("mousemove",y),this.addTimer("pan"+i._id,_,50,!0),this}},proxy:function(t,e){return"function"!=typeof t?g:(e=e||this,function(){return t.apply(e,F.array(arguments))})},getThemeName:function(){return this.theme.name},removePan:function(){return this.$("stage").off("mousemove"),this.clearTimer("pan"+this._id),this},addElement:function(e){var i=this._dom;return t.each(F.array(arguments),function(t,e){i[e]=F.create("galleria-"+e)}),this},attachKeyboard:function(t){return this._keyboard.attach.apply(this._keyboard,F.array(arguments)),this},detachKeyboard:function(){return this._keyboard.detach.apply(this._keyboard,F.array(arguments)),this},appendChild:function(t,e){return this.$(t).append(this.get(e)||e),this},prependChild:function(t,e){return this.$(t).prepend(this.get(e)||e),this},remove:function(t){return this.$(F.array(arguments).join(",")).remove(),this},append:function(t){var e,i;for(e in t)if(t.hasOwnProperty(e))if(t[e].constructor===Array)for(i=0;t[e][i];i++)this.appendChild(e,t[e][i]);else this.appendChild(e,t[e]);return this},_scaleImage:function(e,i){if(e=e||this._controls.getActive()){var n,a=function(e){t(e.container).children(":first").css({top:f.max(0,F.parseValue(e.image.style.top)),left:f.max(0,F.parseValue(e.image.style.left)),width:F.parseValue(e.image.width),height:F.parseValue(e.image.height)})};return i=t.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},i),this._options.layerFollow&&!0!==this._options.imageCrop?"function"==typeof i.complete?(n=i.complete,i.complete=function(){n.call(e,e),a(e)}):i.complete=a:t(e.container).children(":first").css({top:0,left:0}),e.scale(i),this}},updateCarousel:function(){return this._carousel.update(),this},resize:function(e,i){"function"==typeof e&&(i=e,e=n),e=t.extend({width:0,height:0},e);var a=this,o=this.$("container");return t.each(e,function(t,i){i||(o[t]("auto"),e[t]=a._getWH()[t])}),t.each(e,function(t,e){o[t](e)}),this.rescale(i)},rescale:function(e,a,o){var r=this;return"function"==typeof e&&(o=e,e=n),function(){r._stageWidth=e||r.$("stage").width(),r._stageHeight=a||r.$("stage").height(),r._options.swipe?(t.each(r._controls.slides,function(e,i){r._scaleImage(i),t(i.container).css("left",r._stageWidth*e)}),r.$("images").css("width",r._stageWidth*r.getDataLength())):r._scaleImage(),r._options.carousel&&r.updateCarousel(),r._controls.frames[r._controls.active]&&r._controls.frames[r._controls.active].scale({width:r._stageWidth,height:r._stageHeight,iframelimit:r._options.maxVideoSize}),r.trigger(i.RESCALE),"function"==typeof o&&o.call(r)}.call(r),this},refreshImage:function(){return this._scaleImage(),this._options.imagePan&&this.addPan(),this},_preload:function(){if(this._options.preload){var t,e,n,a=this.getNext();try{for(e=this._options.preload;e>0;e--)t=new i.Picture,n=this.getData(a),t.preload(this.isFullscreen()&&n.big?n.big:n.image),a=this.getNext(a)}catch(t){}}},show:function(n,a,o){var r=this._options.swipe;if(r||!(this._queue.length>3||!1===n||!this._options.queue&&this._queue.stalled)){if(n=f.max(0,f.min(parseInt(n,10),this.getDataLength()-1)),a=void 0!==a?!!a:n<this.getIndex(),!(o=o||!1)&&i.History)return void i.History.set(n.toString());if(this.finger&&n!==this._active&&(this.finger.to=-n*this.finger.width,this.finger.index=n),this._active=n,r){var l=this.getData(n),c=this;if(!l)return;var h=this.isFullscreen()&&l.big?l.big:l.image||l.iframe,u=this._controls.slides[n],d=u.isCached(h),p=this._thumbnails[n],g={cached:d,index:n,rewind:a,imageTarget:u.image,thumbTarget:p.image,galleriaData:l};this.trigger(t.extend(g,{type:i.LOADSTART})),c.$("container").removeClass("videoplay");var m=function(){c._layers[n].innerHTML=c.getData().layer||"",c.trigger(t.extend(g,{type:i.LOADFINISH})),c._playCheck()};c._preload(),e.setTimeout(function(){u.ready&&t(u.image).attr("src")==h?(c.trigger(t.extend(g,{type:i.IMAGE})),m()):(l.iframe&&!l.image&&(u.isIframe=!0),u.load(h,function(e){g.imageTarget=e.image,c._scaleImage(e,m).trigger(t.extend(g,{type:i.IMAGE})),m()}))},100)}else s.push.call(this._queue,{index:n,rewind:a}),this._queue.stalled||this._show();return this}},_show:function(){var a=this,o=this._queue[0],r=this.getData(o.index);if(r){var l=this.isFullscreen()&&r.big?r.big:r.image||r.iframe,c=this._controls.getActive(),h=this._controls.getNext(),u=h.isCached(l),d=this._thumbnails[o.index],p=function(){t(h.image).trigger("mouseup")};a.$("container").toggleClass("iframe",!!r.isIframe).removeClass("videoplay");var f=function(o,r,l,c,h){return function(){var u;O.active=!1,F.toggleQuality(r.image,a._options.imageQuality),a._layers[a._controls.active].innerHTML="",t(l.container).css({zIndex:0,opacity:0}).show(),t(l.container).find("iframe, .galleria-videoicon").remove(),t(a._controls.frames[a._controls.active].container).hide(),t(r.container).css({zIndex:1,left:0,top:0}).show(),a._controls.swap(),a._options.imagePan&&a.addPan(r.image),(o.iframe&&o.image||o.link||a._options.lightbox||a._options.clicknext)&&t(r.image).css({cursor:"pointer"}).on("mouseup",function(r){if(!("number"==typeof r.which&&r.which>1)){if(o.iframe){a.isPlaying()&&a.pause();var s=a._controls.frames[a._controls.active],l=a._stageWidth,c=a._stageHeight;return t(s.container).css({width:l,height:c,opacity:0}).show().animate({opacity:1},200),void e.setTimeout(function(){s.load(o.iframe+(o.video?"&autoplay=1":""),{width:l,height:c},function(t){a.$("container").addClass("videoplay"),t.scale({width:a._stageWidth,height:a._stageHeight,iframelimit:o.video?a._options.maxVideoSize:n})})},100)}return a._options.clicknext&&!i.TOUCH?(a._options.pauseOnInteraction&&a.pause(),void a.next()):o.link?void(a._options.popupLinks?u=e.open(o.link,"_blank"):e.location.href=o.link):void(a._options.lightbox&&a.openLightbox())}}),a._playCheck(),a.trigger({type:i.IMAGE,index:c.index,imageTarget:r.image,thumbTarget:h.image,galleriaData:o}),s.shift.call(a._queue),a._queue.stalled=!1,a._queue.length&&a._show()}}(r,h,c,o,d);this._options.carousel&&this._options.carouselFollow&&this._carousel.follow(o.index),a._preload(),F.show(h.container),h.isIframe=r.iframe&&!r.image,t(a._thumbnails[o.index].container).addClass("active").siblings(".active").removeClass("active"),a.trigger({type:i.LOADSTART,cached:u,index:o.index,rewind:o.rewind,imageTarget:h.image,thumbTarget:d.image,galleriaData:r}),a._queue.stalled=!0,h.load(l,function(e){var s=t(a._layers[1-a._controls.active]).html(r.layer||"").hide();a._scaleImage(e,{complete:function(e){"image"in c&&F.toggleQuality(c.image,!1),F.toggleQuality(e.image,!1),a.removePan(),a.setInfo(o.index),a.setCounter(o.index),r.layer&&(s.show(),(r.iframe&&r.image||r.link||a._options.lightbox||a._options.clicknext)&&s.css("cursor","pointer").off("mouseup").mouseup(p)),r.video&&r.image&&H(e.container);var l=a._options.transition;if(t.each({initial:null===c.image,touch:i.TOUCH,fullscreen:a.isFullscreen()},function(t,e){if(e&&a._options[t+"Transition"]!==n)return l=a._options[t+"Transition"],!1}),l in O.effects==!1)f();else{var h={prev:c.container,next:e.container,rewind:o.rewind,speed:a._options.transitionSpeed||400};O.active=!0,O.init.call(a,l,h,f)}a.trigger({type:i.LOADFINISH,cached:u,index:o.index,rewind:o.rewind,imageTarget:e.image,thumbTarget:a._thumbnails[o.index].image,galleriaData:a.getData(o.index)})}})})}},getNext:function(t){return t="number"==typeof t?t:this.getIndex(),t===this.getDataLength()-1?0:t+1},getPrev:function(t){return t="number"==typeof t?t:this.getIndex(),0===t?this.getDataLength()-1:t-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(t){return t in this._dom?this._dom[t]:null},getData:function(t){return t in this._data?this._data[t]: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(t){return void 0===t?this._options:this._options[t]},setOptions:function(e,i){return"object"==typeof e?t.extend(this._options,e):this._options[e]=i,this},play:function(t){return this._playing=!0,this._playtime=t||this._playtime,this._playCheck(),this.trigger(i.PLAY),this},pause:function(){return this._playing=!1,this.trigger(i.PAUSE),this},playToggle:function(t){return this._playing?this.pause():this.play(t)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var t=this,e=0,n=F.timestamp(),a="play"+this._id;if(this._playing){this.clearTimer(a);var o=function(){if((e=F.timestamp()-n)>=t._playtime&&t._playing)return t.clearTimer(a),void t.next();t._playing&&(t.trigger({type:i.PROGRESS,percent:f.ceil(e/t._playtime*100),seconds:f.floor(e/1e3),milliseconds:e}),t.addTimer(a,o,20))};t.addTimer(a,o,20)}},setPlaytime:function(t){return this._playtime=t,this},setIndex:function(t){return this._active=t,this},setCounter:function(t){if("number"==typeof t?t++:void 0===t&&(t=this.getIndex()+1),this.get("current").innerHTML=t,v){var e=this.$("counter"),i=e.css("opacity");1===parseInt(i,10)?F.removeAlpha(e[0]):this.$("counter").css("opacity",i)}return this},setInfo:function(e){var i=this,n=this.getData(e);return t.each(["title","description"],function(t,e){var a=i.$("info-"+e);n[e]?a[n[e].length?"show":"hide"]().html(n[e]):a.empty().hide()}),this},hasInfo:function(t){var e,i="title description".split(" ");for(e=0;i[e];e++)if(this.getData(t)[i[e]])return!0;return!1},jQuery:function(e){var i=this,n=[];t.each(e.split(","),function(e,a){a=t.trim(a),i.get(a)&&n.push(a)});var a=t(i.get(n.shift()));return t.each(n,function(t,e){a=a.add(i.get(e))}),a},$:function(t){return this.jQuery.apply(this,F.array(arguments))}},t.each(w,function(t,e){var n=/_/.test(e)?e.replace(/_/g,""):e;i[e.toUpperCase()]="galleria."+n}),t.extend(i,{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&&a.compatMode&&"BackCompat"===a.compatMode,MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!e.opera,IPHONE:/iphone/.test(u),IPAD:/ipad/.test(u),ANDROID:/android/.test(u),TOUCH:"ontouchstart"in a}),i.addTheme=function(n){n.name||i.raise("No theme name specified"),(!n.version||parseInt(10*i.version)>parseInt(10*n.version))&&i.raise("This version of Galleria requires "+n.name+" theme version "+parseInt(10*i.version)/10+" or later",!0),"object"!=typeof n.defaults?n.defaults={}:n.defaults=x(n.defaults);var a,o,r=!1;return"string"==typeof n.css?(t("link").each(function(t,e){if(a=new RegExp(n.css),a.test(e.href))return r=!0,z(n),!1}),r||t(function(){var s=0,l=function(){t("script").each(function(t,i){a=new RegExp("galleria\\."+n.name.toLowerCase()+"\\."),o=new RegExp("galleria\\.io\\/theme\\/"+n.name.toLowerCase()+"\\/(\\d*\\.*)?(\\d*\\.*)?(\\d*\\/)?js"),(a.test(i.src)||o.test(i.src))&&(r=i.src.replace(/[^\/]*$/,"")+n.css,e.setTimeout(function(){F.loadCSS(r,"galleria-theme-"+n.name,function(){z(n)})},1))}),r||(s++>5?i.raise("No theme CSS loaded"):e.setTimeout(l,500))};l()})):z(n),n},i.loadTheme=function(n,a){if(!t("script").filter(function(){return t(this).attr("src")==n}).length){var o,r=!1;return t(e).on("load",function(){r||(o=e.setTimeout(function(){r||i.raise("Galleria had problems loading theme at "+n+". Please check theme path or load manually.",!0)},2e4))}),F.loadScript(n,function(){r=!0,e.clearTimeout(o)}),i}},i.get=function(t){return E[t]?E[t]:"number"!=typeof t?E:void i.raise("Gallery index "+t+" not found")},i.configure=function(e,n){var a={};return"string"==typeof e&&n?(a[e]=n,e=a):t.extend(a,e),i.configure.options=a,t.each(i.get(),function(t,e){e.setOptions(a)}),i},i.configure.options={},i.on=function(e,n){if(e){n=n||g;var a=e+n.toString().replace(/\s/g,"")+F.timestamp();return t.each(i.get(),function(t,i){i._binds.push(a),i.bind(e,n)}),i.on.binds.push({type:e,callback:n,hash:a}),i}},i.on.binds=[],i.run=function(e,n){return t.isFunction(n)&&(n={extend:n}),t(e||"#galleria").galleria(n),i},i.addTransition=function(t,e){return O.effects[t]=e,i},i.utils=F,i.log=function(){var i=F.array(arguments);if(!("console"in e&&"log"in e.console))return e.alert(i.join("<br>"));try{return e.console.log.apply(e.console,i)}catch(n){t.each(i,function(){e.console.log(this)})}},i.ready=function(e){return"function"!=typeof e?i:(t.each(A,function(t,i){e.call(i,i._options)}),i.ready.callbacks.push(e),i)},i.ready.callbacks=[],i.raise=function(e,i){var n=i?"Fatal error":"Error",a={color:"#fff",position:"absolute",top:0,left:0,zIndex:1e5},o=function(e){var o='<div style="padding:4px;margin:0 0 2px;background:#'+(i?"811":"222")+';">'+(i?"<strong>"+n+": </strong>":"")+e+"</div>";t.each(E,function(){var t=this.$("errors"),e=this.$("target");t.length||(e.css("position","relative"),t=this.addElement("errors").appendChild("target","errors").$("errors").css(a)),t.append(o)}),E.length||t("<div>").css(t.extend(a,{position:"fixed"})).append(o).appendTo(y().body)};if(l){if(o(e),i)throw new Error(n+": "+e)}else if(i){if(D)return;D=!0,i=!1,o("Gallery could not load.")}},i.version=1.56,i.getLoadedThemes=function(){return t.map(P,function(t){return t.name})},i.requires=function(t,e){return e=e||"You need to upgrade Galleria to version "+t+" to use one or more components.",i.version<t&&i.raise(e,!0),i},i.Picture=function(e){this.id=e||null,this.image=null,this.container=F.create("galleria-image"),t(this.container).css({overflow:"hidden",position:"relative"}),this.original={width:0,height:0},this.ready=!1,this.isIframe=!1},i.Picture.prototype={cache:{},show:function(){F.show(this.image)},hide:function(){F.moveOut(this.image)},clear:function(){this.image=null},isCached:function(t){return!!this.cache[t]},preload:function(e){t(new Image).on("load",function(t,e){return function(){e[t]=t}}(e,this.cache)).attr("src",e)},load:function(n,a,o){if("function"==typeof a&&(o=a,a=null),this.isIframe){var r="if"+(new Date).getTime(),s=this.image=t("<iframe>",{src:n,frameborder:0,id:r,allowfullscreen:!0,css:{visibility:"hidden"}})[0];return a&&t(s).css(a),t(this.container).find("iframe,img").remove(),this.container.appendChild(this.image),t("#"+r).on("load",function(i,n){return function(){e.setTimeout(function(){t(i.image).css("visibility","visible"),"function"==typeof n&&n.call(i,i)},10)}}(this,o)),this.container}this.image=new Image,i.IE8&&t(this.image).css("filter","inherit"),i.IE||i.CHROME||i.SAFARI||t(this.image).css("image-rendering","optimizequality");var l=!1,c=!1,u=t(this.container),d=t(this.image),p=function(){l?h?t(this).attr("src",h):i.raise("Image not found: "+n):(l=!0,e.setTimeout(function(t,e){return function(){t.attr("src",e+(e.indexOf("?")>-1?"&":"?")+F.timestamp())}}(t(this),n),50))},f=function(n,o,r){return function(){var s=function(){t(this).off("load"),n.original=a||{height:this.height,width:this.width},i.HAS3D&&(this.style.MozTransform=this.style.webkitTransform="translate3d(0,0,0)"),u.append(this),n.cache[r]=r,"function"==typeof o&&e.setTimeout(function(){o.call(n,n)},1)};this.width&&this.height?s.call(this):function(e){F.wait({until:function(){return e.width&&e.height},success:function(){s.call(e)},error:function(){c?i.raise("Could not extract width/height from image: "+e.src+". Traced measures: width:"+e.width+"px, height: "+e.height+"px."):(t(new Image).on("load",f).attr("src",e.src),c=!0)},timeout:100})}(this)}}(this,o,n);return u.find("iframe,img").remove(),d.css("display","block"),F.hide(this.image),t.each("minWidth minHeight maxWidth maxHeight".split(" "),function(t,e){d.css(e,/min/.test(e)?"0":"none")}),d.on("load",f).on("error",p).attr("src",n),this.container},scale:function(e){var a=this;if(e=t.extend({width:0,height:0,min:n,max:n,margin:0,complete:g,position:"center",crop:!1,canvas:!1,iframelimit:n},e),this.isIframe){var o,r,s=e.width,l=e.height;if(e.iframelimit){var c=f.min(e.iframelimit/s,e.iframelimit/l);c<1?(o=s*c,r=l*c,t(this.image).css({top:l/2-r/2,left:s/2-o/2,position:"absolute"})):t(this.image).css({top:0,left:0})}t(this.image).width(o||s).height(r||l).removeAttr("width").removeAttr("height"),t(this.container).width(s).height(l),e.complete.call(a,a);try{this.image.contentWindow&&t(this.image.contentWindow).trigger("resize")}catch(t){}return this.container}if(!this.image)return this.container;var h,u,d,p=t(a.container);return F.wait({until:function(){return h=e.width||p.width()||F.parseValue(p.css("width")),u=e.height||p.height()||F.parseValue(p.css("height")),h&&u},success:function(){var i=(h-2*e.margin)/a.original.width,n=(u-2*e.margin)/a.original.height,o=f.min(i,n),r=f.max(i,n),s={true:r,width:i,height:n,false:o,landscape:a.original.width>a.original.height?r:o,portrait:a.original.width<a.original.height?r:o},l=s[e.crop.toString()],c="";e.max&&(l=f.min(e.max,l)),e.min&&(l=f.max(e.min,l)),t.each(["width","height"],function(e,i){t(a.image)[i](a[i]=a.image[i]=f.round(a.original[i]*l))}),t(a.container).width(h).height(u),e.canvas&&L&&(L.elem.width=a.width,L.elem.height=a.height,c=a.image.src+":"+a.width+"x"+a.height,a.image.src=L.cache[c]||function(t){L.context.drawImage(a.image,0,0,a.original.width*l,a.original.height*l);try{return d=L.elem.toDataURL(),L.length+=d.length,L.cache[t]=d,d}catch(t){return a.image.src}}(c));var p={},g={},m=function(e,i,n){var o=0;if(/\%/.test(e)){var r=parseInt(e,10)/100,s=a.image[i]||t(a.image)[i]();o=f.ceil(-1*s*r+n*r)}else o=F.parseValue(e);return o},v={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};t.each(e.position.toLowerCase().split(" "),function(t,e){"center"===e&&(e="50%"),p[t?"top":"left"]=e}),t.each(p,function(e,i){v.hasOwnProperty(i)&&t.extend(g,v[i])}),p=p.top?t.extend(p,g):g,p=t.extend({top:"50%",left:"50%"},p),t(a.image).css({position:"absolute",top:m(p.top,"height",u),left:m(p.left,"width",h)}),a.show(),a.ready=!0,e.complete.call(a,a)},error:function(){i.raise("Could not scale image: "+a.image.src)},timeout:1e3}),this}},t.extend(t.easing,{galleria:function(t,e,i,n,a){return(e/=a/2)<1?n/2*e*e*e+i:n/2*((e-=2)*e*e+2)+i},galleriaIn:function(t,e,i,n,a){return n*(e/=a)*e+i},galleriaOut:function(t,e,i,n,a){return-n*(e/=a)*(e-2)+i}}),i.Finger=function(){var n=(f.abs,i.HAS3D=function(){var e,i,n=a.createElement("p"),o=["webkit","O","ms","Moz",""],r=0,s="transform";for(y().html.insertBefore(n,null);o[r];r++)i=o[r]?o[r]+"Transform":s,void 0!==n.style[i]&&(n.style[i]="translate3d(1px,1px,1px)",e=t(n).css(o[r]?"-"+o[r].toLowerCase()+"-"+s:s));return y().html.removeChild(n),void 0!==e&&e.length>0&&"none"!==e}()),r=function(){var t="RequestAnimationFrame";return e.requestAnimationFrame||e["webkit"+t]||e["moz"+t]||e["o"+t]||e["ms"+t]||function(t){e.setTimeout(t,1e3/60)}}(),s=function(i,a){if(this.config={start:0,duration:500,onchange:function(){},oncomplete:function(){},easing:function(t,e,i,n,a){return-n*((e=e/a-1)*e*e*e-1)+i}},this.easeout=function(t,e,i,n,a){return n*((e=e/a-1)*e*e*e*e+1)+i},i.children.length){var o=this;t.extend(this.config,a),this.elem=i,this.child=i.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,n||(this.child.style.position="absolute",this.elem.style.position="relative"),t.each(["ontouchstart","ontouchmove","ontouchend","setup"],function(t,e){o[e]=function(t){return function(){t.apply(o,arguments)}}(o[e])}),this.setX=function(){var t=o.child.style;if(!n)return void(t.left=o.pos+"px");t.MozTransform=t.webkitTransform=t.transform="translate3d("+o.pos+"px,0,0)"},t(i).on("touchstart",this.ontouchstart),t(e).on("resize",this.setup),t(e).on("orientationchange",this.setup),this.setup(),function t(){r(t),o.loop.call(o)}()}};return s.prototype={constructor:s,setup:function(){this.width=t(this.elem).width(),this.length=f.ceil(t(this.child).width()/this.width),0!==this.index&&(this.index=f.max(0,f.min(this.index,this.length-1)),this.pos=this.to=-this.width*this.index)},setPosition:function(t){this.pos=t,this.to=t},ontouchstart:function(t){var e=t.originalEvent.touches;this.start={pageX:e[0].pageX,pageY:e[0].pageY,time:+new Date},this.isScrolling=null,this.touching=!0,this.deltaX=0,o.on("touchmove",this.ontouchmove),o.on("touchend",this.ontouchend)},ontouchmove:function(t){var e=t.originalEvent.touches;e&&e.length>1||t.scale&&1!==t.scale||(this.deltaX=e[0].pageX-this.start.pageX,null===this.isScrolling&&(this.isScrolling=!!(this.isScrolling||f.abs(this.deltaX)<f.abs(e[0].pageY-this.start.pageY))),this.isScrolling||(t.preventDefault(),this.deltaX/=!this.index&&this.deltaX>0||this.index==this.length-1&&this.deltaX<0?f.abs(this.deltaX)/this.width+1.8:1,this.to=this.deltaX-this.index*this.width),t.stopPropagation())},ontouchend:function(t){this.touching=!1;var e=+new Date-this.start.time<250&&f.abs(this.deltaX)>40||f.abs(this.deltaX)>this.width/2,i=!this.index&&this.deltaX>0||this.index==this.length-1&&this.deltaX<0;this.isScrolling||this.show(this.index+(e&&!i?this.deltaX<0?1:-1:0)),o.off("touchmove",this.ontouchmove),o.off("touchend",this.ontouchend)},show:function(t){t!=this.index?this.config.onchange.call(this,t):this.to=-t*this.width},moveTo:function(t){t!=this.index&&(this.pos=this.to=-t*this.width,this.index=t)},loop:function(){var t=this.to-this.pos,e=1;if(this.width&&t&&(e=f.max(.5,f.min(1.5,f.abs(t/this.width)))),this.touching||f.abs(t)<=1)this.pos=this.to,t=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:t,factor:e,destination:this.to});var i=+new Date-this.anim.time,n=this.config.duration*this.anim.factor;if(i>n||this.anim.destination!=this.to)return this.anim=0,void(this.easing=this.easeout);this.pos=this.easing(null,i,this.anim.start,this.anim.distance,n)}this.setX()}},s}(),t.fn.galleria=function(e){var n=this.selector;return t(this).length?this.each(function(){t.data(this,"galleria")&&(t.data(this,"galleria").destroy(),t(this).find("*").hide()),t.data(this,"galleria",(new i).init(this,e))}):(t(function(){t(n).length?t(n).galleria(e):i.utils.wait({until:function(){return t(n).length},success:function(){t(n).galleria(e)},error:function(){i.raise('Init failed: Galleria could not find the element "'+n+'".')},timeout:5e3})}),this)},"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=i:(e.Galleria=i,"function"==typeof define&&define.amd&&define("galleria",["jquery"],function(){return i}))}(jQuery,this);!function(t){Galleria.addTheme({name:"compojoom",author:"Daniel Dimitrov daniel@compojoom.com",version:1.5,defaults:{transition:"pulse",imageCrop:"landscape",carousel:!0,transitionSpeed:500,_showFullscreen:!0,_showPopout:!0,_showProgress:!0,_showTooltip:!0,_toggleInfo:!0},init:function(i){this.addElement("info-link","info-close","bar","fullscreen fa fa-arrows-alt","progress"),this.append({stage:"progress",container:"bar",info:["info-link","info-close"],bar:["thumbnails-container","fullscreen fa fa-arrows-alt"]});var e=this,n=this.$("thumbnails-container"),s=this.$("fullscreen fa fa-arrows-alt"),o=i.transition,a=this.$("bar"),l=!1,c=!1;this.bind("image",function(i){t(i.imageTarget).unbind("dblclick").on("dblclick",function(){e.toggleFullscreen()})}),s.click(function(){c?e.exitFullscreen():e.enterFullscreen()}),toggleThumbs=function(t){l&&CONTINUE?e.play():(CONTINUE=PLAYING,e.pause()),Galleria.utils.animate(n,{top:l?e.getStageHeight()+30:0},{easing:"galleria",duration:400,complete:function(){e.defineTooltip("thumblink",l?lang.show_thumbnails:lang.hide_thumbnails),thumb_link[l?"removeClass":"addClass"]("open"),l=!l}})};var r=this.$("info-link,info-close,info-text"),h=Galleria.TOUCH;this.$("loader,counter").show().css("opacity",.4),h||(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===i._toggleInfo?r.bind("click:fast",function(){r.toggle()}):(r.show(),this.$("info-link, info-close").hide()),this.bind("thumbnail",function(i){h?t(i.thumbTarget).css("opacity",this.getIndex()?1:.6).bind("click:fast",function(){t(this).css("opacity",1).parent().siblings().children().css("opacity",.6)}):(t(i.thumbTarget).css("opacity",.6).parent().hover(function(){t(this).not(".active").children().stop().fadeTo(100,1)},function(){t(this).not(".active").children().stop().fadeTo(400,.6)}),i.index===this.getIndex()&&t(i.thumbTarget).css("opacity",1))});var f=function(i){t(i.thumbTarget).css("opacity",1).parent().siblings().children().css("opacity",.6)};this.bind("loadstart",function(t){t.cached||this.$("loader").show().fadeTo(200,.4),window.setTimeout(function(){f(t)},h?300:0),this.$("info").toggle(this.hasInfo())}),this.bind("loadfinish",function(t){this.$("loader").fadeOut(200)}),this.bind("fullscreen_enter",function(t){c=!0,e.setOptions("transition",!1),s.addClass("open"),a.css("bottom",0),this.defineTooltip("fullscreen","afullscreen enter")}),this.bind("fullscreen_exit",function(t){c=!1,Galleria.utils.clearTimer("bar"),e.setOptions("transition",o),s.removeClass("open"),a.css("bottom",0),this.defineTooltip("fullscreen","fullscreen leave")})}})}(jQuery);/*! 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(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else if(typeof exports==="object"){factory(require("jquery"));}else{factory(jQuery);}}(function($){
/*!
* 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 widget_uuid=0,widget_slice=Array.prototype.slice;$.cleanData=(function(orig){return function(elems){var events,elem,i;for(i=0;(elem=elems[i])!=null;i++){try{events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove");}}catch(e){}}
orig(elems);};})($.cleanData);$.widget=function(name,base,prototype){var fullName,existingConstructor,constructor,basePrototype,proxiedPrototype={},namespace=name.split(".")[0];name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;}
$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName);};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this._createWidget){return new constructor(options,element);}
if(arguments.length){this._createWidget(options,element);}};$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});basePrototype=new base();basePrototype.options=$.widget.extend({},basePrototype.options);$.each(prototype,function(prop,value){if(!$.isFunction(value)){proxiedPrototype[prop]=value;return;}
proxiedPrototype[prop]=(function(){var _super=function(){return base.prototype[prop].apply(this,arguments);},_superApply=function(args){return base.prototype[prop].apply(this,args);};return function(){var __super=this._super,__superApply=this._superApply,returnValue;this._super=_super;this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;this._superApply=__superApply;return returnValue;};})();});constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?(basePrototype.widgetEventPrefix||name):name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto);});delete existingConstructor._childConstructors;}else{base._childConstructors.push(constructor);}
$.widget.bridge(name,constructor);return constructor;};$.widget.extend=function(target){var input=widget_slice.call(arguments,1),inputIndex=0,inputLength=input.length,key,value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[inputIndex][key];if(input[inputIndex].hasOwnProperty(key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value);}else{target[key]=value;}}}}
return target;};$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall=typeof options==="string",args=widget_slice.call(arguments,1),returnValue=this;if(isMethodCall){this.each(function(){var methodValue,instance=$.data(this,fullName);if(options==="instance"){returnValue=instance;return false;}
if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'");}
if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance");}
methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args));}
this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{});if(instance._init){instance._init();}}else{$.data(this,fullName,new object(options,this));}});}
return returnValue;};};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0];this.element=$(element);this.uuid=widget_uuid++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=$();this.hoverable=$();this.focusable=$();if(element!==this){$.data(element,this.widgetFullName,this);this._on(true,this.element,{remove:function(event){if(event.target===element){this.destroy();}}});this.document=$(element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0].defaultView||this.document[0].parentWindow);}
this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this._create();this._trigger("create",null,this._getCreateEventData());this._init();},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.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:$.noop,widget:function(){return this.element;},option:function(key,value){var options=key,parts,curOption,i;if(arguments.length===0){return $.widget.extend({},this.options);}
if(typeof key==="string"){options={};parts=key.split(".");key=parts.shift();if(parts.length){curOption=options[key]=$.widget.extend({},this.options[key]);for(i=0;i<parts.length-1;i++){curOption[parts[i]]=curOption[parts[i]]||{};curOption=curOption[parts[i]];}
key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key];}
curOption[key]=value;}else{if(arguments.length===1){return this.options[key]===undefined?null:this.options[key];}
options[key]=value;}}
this._setOptions(options);return this;},_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key]);}
return this;},_setOption:function(key,value){this.options[key]=value;if(key==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled",!!value);if(value){this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");}}
return this;},enable:function(){return this._setOptions({disabled:false});},disable:function(){return this._setOptions({disabled:true});},_on:function(suppressDisabledCheck,element,handlers){var delegateElement,instance=this;if(typeof suppressDisabledCheck!=="boolean"){handlers=element;element=suppressDisabledCheck;suppressDisabledCheck=false;}
if(!handlers){handlers=element;element=this.element;delegateElement=this.widget();}else{element=delegateElement=$(element);this.bindings=this.bindings.add(element);}
$.each(handlers,function(event,handler){function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===true||$(this).hasClass("ui-state-disabled"))){return;}
return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);}
if(typeof handler!=="string"){handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++;}
var match=event.match(/^([\w:-]*)\s*(.*)$/),eventName=match[1]+instance.eventNamespace,selector=match[2];if(selector){delegateElement.delegate(selector,eventName,handlerProxy);}else{element.bind(eventName,handlerProxy);}});},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+
this.eventNamespace;element.unbind(eventName).undelegate(eventName);this.bindings=$(this.bindings.not(element).get());this.focusable=$(this.focusable.not(element).get());this.hoverable=$(this.hoverable.not(element).get());},_delay:function(handler,delay){function handlerProxy(){return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);}
var instance=this;return setTimeout(handlerProxy,delay||0);},_hoverable:function(element){this.hoverable=this.hoverable.add(element);this._on(element,{mouseenter:function(event){$(event.currentTarget).addClass("ui-state-hover");},mouseleave:function(event){$(event.currentTarget).removeClass("ui-state-hover");}});},_focusable:function(element){this.focusable=this.focusable.add(element);this._on(element,{focusin:function(event){$(event.currentTarget).addClass("ui-state-focus");},focusout:function(event){$(event.currentTarget).removeClass("ui-state-focus");}});},_trigger:function(type,event,data){var prop,orig,callback=this.options[type];data=data||{};event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();event.target=this.element[0];orig=event.originalEvent;if(orig){for(prop in orig){if(!(prop in event)){event[prop]=orig[prop];}}}
this.element.trigger(event,data);return!($.isFunction(callback)&&callback.apply(this.element[0],[event].concat(data))===false||event.isDefaultPrevented());}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(typeof options==="string"){options={effect:options};}
var hasOptions,effectName=!options?method:options===true||typeof options==="number"?defaultEffect:options.effect||defaultEffect;options=options||{};if(typeof options==="number"){options={duration:options};}
hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){element.delay(options.delay);}
if(hasOptions&&$.effects&&$.effects.effect[effectName]){element[method](options);}else if(effectName!==method&&element[effectName]){element[effectName](options.duration,options.easing,callback);}else{element.queue(function(next){$(this)[method]();if(callback){callback.call(element[0]);}
next();});}};});var widget=$.widget;}));!function(a){"use strict";var b=function(a,c){var d=/[^\w\-\.:]/.test(a)?new Function(b.arg+",tmpl","var _e=tmpl.encode"+b.helper+",_s='"+a.replace(b.regexp,b.func)+"';return _s;"):b.cache[a]=b.cache[a]||b(b.load(a));return c?d(c,b):function(a){return d(a,b)}};b.cache={},b.load=function(a){return document.getElementById(a).innerHTML},b.regexp=/([\s'\\])(?!(?:[^{]|\{(?!%))*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,b.func=function(a,b,c,d,e,f){return b?{"\n":"\\n","\r":"\\r"," ":"\\t"," ":" "}[b]||"\\"+b:c?"="===c?"'+_e("+d+")+'":"'+("+d+"==null?'':"+d+")+'":e?"';":f?"_s+='":void 0},b.encReg=/[<>&"'\x00]/g,b.encMap={"<":"<",">":">","&":"&",'"':""","'":"'"},b.encode=function(a){return(null==a?"":""+a).replace(b.encReg,function(a){return b.encMap[a]||""})},b.arg="o",b.helper=",print=function(s,e){_s+=e?(s==null?'':s):_e(s);},include=function(s,d){_s+=tmpl(s,d);}","function"==typeof define&&define.amd?define(function(){return b}):a.tmpl=b}(this);!function(a){"use strict";var b=a.HTMLCanvasElement&&a.HTMLCanvasElement.prototype,c=a.Blob&&function(){try{return Boolean(new Blob)}catch(a){return!1}}(),d=c&&a.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(a){return!1}}(),e=a.BlobBuilder||a.WebKitBlobBuilder||a.MozBlobBuilder||a.MSBlobBuilder,f=(c||e)&&a.atob&&a.ArrayBuffer&&a.Uint8Array&&function(a){var b,f,g,h,i,j;for(b=a.split(",")[0].indexOf("base64")>=0?atob(a.split(",")[1]):decodeURIComponent(a.split(",")[1]),f=new ArrayBuffer(b.length),g=new Uint8Array(f),h=0;h<b.length;h+=1)g[h]=b.charCodeAt(h);return i=a.split(",")[0].split(":")[1].split(";")[0],c?new Blob([d?g:f],{type:i}):(j=new e,j.append(f),j.getBlob(i))};a.HTMLCanvasElement&&!b.toBlob&&(b.mozGetAsFile?b.toBlob=function(a,c,d){d&&b.toDataURL&&f?a(f(this.toDataURL(c,d))):a(this.mozGetAsFile("blob",c))}:b.toDataURL&&f&&(b.toBlob=function(a,b,c){a(f(this.toDataURL(b,c)))})),"function"==typeof define&&define.amd?define(function(){return f}):a.dataURLtoBlob=f}(this);!function(a){"use strict";var b=function(a,c,d){var e,f,g=document.createElement("img");if(g.onerror=c,g.onload=function(){!f||d&&d.noRevoke||b.revokeObjectURL(f),c&&c(b.scale(g,d))},b.isInstanceOf("Blob",a)||b.isInstanceOf("File",a))e=f=b.createObjectURL(a),g._type=a.type;else{if("string"!=typeof a)return!1;e=a,d&&d.crossOrigin&&(g.crossOrigin=d.crossOrigin)}return e?(g.src=e,g):b.readFile(a,function(a){var b=a.target;b&&b.result?g.src=b.result:c&&c(a)})},c=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&URL||window.webkitURL&&webkitURL;b.isInstanceOf=function(a,b){return Object.prototype.toString.call(b)==="[object "+a+"]"},b.transformCoordinates=function(){},b.getTransformedOptions=function(a,b){var c,d,e,f,g=b.aspectRatio;if(!g)return b;c={};for(d in b)b.hasOwnProperty(d)&&(c[d]=b[d]);return c.crop=!0,e=a.naturalWidth||a.width,f=a.naturalHeight||a.height,e/f>g?(c.maxWidth=f*g,c.maxHeight=f):(c.maxWidth=e,c.maxHeight=e/g),c},b.renderImageToCanvas=function(a,b,c,d,e,f,g,h,i,j){return a.getContext("2d").drawImage(b,c,d,e,f,g,h,i,j),a},b.hasCanvasOption=function(a){return a.canvas||a.crop||a.aspectRatio},b.scale=function(a,c){c=c||{};var d,e,f,g,h,i,j,k,l,m=document.createElement("canvas"),n=a.getContext||b.hasCanvasOption(c)&&m.getContext,o=a.naturalWidth||a.width,p=a.naturalHeight||a.height,q=o,r=p,s=function(){var a=Math.max((f||q)/q,(g||r)/r);a>1&&(q*=a,r*=a)},t=function(){var a=Math.min((d||q)/q,(e||r)/r);1>a&&(q*=a,r*=a)};return n&&(c=b.getTransformedOptions(a,c),j=c.left||0,k=c.top||0,c.sourceWidth?(h=c.sourceWidth,void 0!==c.right&&void 0===c.left&&(j=o-h-c.right)):h=o-j-(c.right||0),c.sourceHeight?(i=c.sourceHeight,void 0!==c.bottom&&void 0===c.top&&(k=p-i-c.bottom)):i=p-k-(c.bottom||0),q=h,r=i),d=c.maxWidth,e=c.maxHeight,f=c.minWidth,g=c.minHeight,n&&d&&e&&c.crop?(q=d,r=e,l=h/i-d/e,0>l?(i=e*h/d,void 0===c.top&&void 0===c.bottom&&(k=(p-i)/2)):l>0&&(h=d*i/e,void 0===c.left&&void 0===c.right&&(j=(o-h)/2))):((c.contain||c.cover)&&(f=d=d||f,g=e=e||g),c.cover?(t(),s()):(s(),t())),n?(m.width=q,m.height=r,b.transformCoordinates(m,c),b.renderImageToCanvas(m,a,j,k,h,i,0,0,q,r)):(a.width=q,a.height=r,a)},b.createObjectURL=function(a){return c?c.createObjectURL(a):!1},b.revokeObjectURL=function(a){return c?c.revokeObjectURL(a):!1},b.readFile=function(a,b,c){if(window.FileReader){var d=new FileReader;if(d.onload=d.onerror=b,c=c||"readAsDataURL",d[c])return d[c](a),d}return!1},"function"==typeof define&&define.amd?define(function(){return b}):a.loadImage=b}(this),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image"],a):a(window.loadImage)}(function(a){"use strict";if(window.navigator&&window.navigator.platform&&/iP(hone|od|ad)/.test(window.navigator.platform)){var b=a.renderImageToCanvas;a.detectSubsampling=function(a){var b,c;return a.width*a.height>1048576?(b=document.createElement("canvas"),b.width=b.height=1,c=b.getContext("2d"),c.drawImage(a,-a.width+1,0),0===c.getImageData(0,0,1,1).data[3]):!1},a.detectVerticalSquash=function(a,b){var c,d,e,f,g,h=a.naturalHeight||a.height,i=document.createElement("canvas"),j=i.getContext("2d");for(b&&(h/=2),i.width=1,i.height=h,j.drawImage(a,0,0),c=j.getImageData(0,0,1,h).data,d=0,e=h,f=h;f>d;)g=c[4*(f-1)+3],0===g?e=f:d=f,f=e+d>>1;return f/h||1},a.renderImageToCanvas=function(c,d,e,f,g,h,i,j,k,l){if("image/jpeg"===d._type){var m,n,o,p,q=c.getContext("2d"),r=document.createElement("canvas"),s=1024,t=r.getContext("2d");if(r.width=s,r.height=s,q.save(),m=a.detectSubsampling(d),m&&(e/=2,f/=2,g/=2,h/=2),n=a.detectVerticalSquash(d,m),m||1!==n){for(f*=n,k=Math.ceil(s*k/g),l=Math.ceil(s*l/h/n),j=0,p=0;h>p;){for(i=0,o=0;g>o;)t.clearRect(0,0,s,s),t.drawImage(d,e,f,g,h,-o,-p,g,h),q.drawImage(r,0,0,s,s,i,j,k,l),o+=s,i+=k;p+=s,j+=l}return q.restore(),c}}return b(c,d,e,f,g,h,i,j,k,l)}}}),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image"],a):a(window.loadImage)}(function(a){"use strict";var b=a.hasCanvasOption,c=a.transformCoordinates,d=a.getTransformedOptions;a.hasCanvasOption=function(c){return b.call(a,c)||c.orientation},a.transformCoordinates=function(b,d){c.call(a,b,d);var e=b.getContext("2d"),f=b.width,g=b.height,h=d.orientation;if(h&&!(h>8))switch(h>4&&(b.width=g,b.height=f),h){case 2:e.translate(f,0),e.scale(-1,1);break;case 3:e.translate(f,g),e.rotate(Math.PI);break;case 4:e.translate(0,g),e.scale(1,-1);break;case 5:e.rotate(.5*Math.PI),e.scale(1,-1);break;case 6:e.rotate(.5*Math.PI),e.translate(0,-g);break;case 7:e.rotate(.5*Math.PI),e.translate(f,-g),e.scale(-1,1);break;case 8:e.rotate(-.5*Math.PI),e.translate(-f,0)}},a.getTransformedOptions=function(b,c){var e,f,g=d.call(a,b,c),h=g.orientation;if(!h||h>8||1===h)return g;e={};for(f in g)g.hasOwnProperty(f)&&(e[f]=g[f]);switch(g.orientation){case 2:e.left=g.right,e.right=g.left;break;case 3:e.left=g.right,e.top=g.bottom,e.right=g.left,e.bottom=g.top;break;case 4:e.top=g.bottom,e.bottom=g.top;break;case 5:e.left=g.top,e.top=g.left,e.right=g.bottom,e.bottom=g.right;break;case 6:e.left=g.top,e.top=g.right,e.right=g.bottom,e.bottom=g.left;break;case 7:e.left=g.bottom,e.top=g.right,e.right=g.top,e.bottom=g.left;break;case 8:e.left=g.bottom,e.top=g.left,e.right=g.top,e.bottom=g.right}return g.orientation>4&&(e.maxWidth=g.maxHeight,e.maxHeight=g.maxWidth,e.minWidth=g.minHeight,e.minHeight=g.minWidth,e.sourceWidth=g.sourceHeight,e.sourceHeight=g.sourceWidth),e}}),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image"],a):a(window.loadImage)}(function(a){"use strict";var b=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);a.blobSlice=b&&function(){var a=this.slice||this.webkitSlice||this.mozSlice;return a.apply(this,arguments)},a.metaDataParsers={jpeg:{65505:[]}},a.parseMetaData=function(b,c,d){d=d||{};var e=this,f=d.maxMetaDataSize||262144,g={},h=!(window.DataView&&b&&b.size>=12&&"image/jpeg"===b.type&&a.blobSlice);(h||!a.readFile(a.blobSlice.call(b,0,f),function(b){if(b.target.error)return console.log(b.target.error),void c(g);var f,h,i,j,k=b.target.result,l=new DataView(k),m=2,n=l.byteLength-4,o=m;if(65496===l.getUint16(0)){for(;n>m&&(f=l.getUint16(m),f>=65504&&65519>=f||65534===f);){if(h=l.getUint16(m+2)+2,m+h>l.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(i=a.metaDataParsers.jpeg[f])for(j=0;j<i.length;j+=1)i[j].call(e,l,m,h,g,d);m+=h,o=m}!d.disableImageHead&&o>6&&(g.imageHead=k.slice?k.slice(0,o):new Uint8Array(k).subarray(0,o))}else console.log("Invalid JPEG file: Missing JPEG marker.");c(g)},"readAsArrayBuffer"))&&c(g)}}),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image","load-image-meta"],a):a(window.loadImage)}(function(a){"use strict";a.ExifMap=function(){return this},a.ExifMap.prototype.map={Orientation:274},a.ExifMap.prototype.get=function(a){return this[a]||this[this.map[a]]},a.getExifThumbnail=function(a,b,c){var d,e,f;if(!c||b+c>a.byteLength)return void console.log("Invalid Exif data: Invalid thumbnail data.");for(d=[],e=0;c>e;e+=1)f=a.getUint8(b+e),d.push((16>f?"0":"")+f.toString(16));return"data:image/jpeg,%"+d.join("%")},a.exifTagTypes={1:{getValue:function(a,b){return a.getUint8(b)},size:1},2:{getValue:function(a,b){return String.fromCharCode(a.getUint8(b))},size:1,ascii:!0},3:{getValue:function(a,b,c){return a.getUint16(b,c)},size:2},4:{getValue:function(a,b,c){return a.getUint32(b,c)},size:4},5:{getValue:function(a,b,c){return a.getUint32(b,c)/a.getUint32(b+4,c)},size:8},9:{getValue:function(a,b,c){return a.getInt32(b,c)},size:4},10:{getValue:function(a,b,c){return a.getInt32(b,c)/a.getInt32(b+4,c)},size:8}},a.exifTagTypes[7]=a.exifTagTypes[1],a.getExifValue=function(b,c,d,e,f,g){var h,i,j,k,l,m,n=a.exifTagTypes[e];if(!n)return void console.log("Invalid Exif data: Invalid tag type.");if(h=n.size*f,i=h>4?c+b.getUint32(d+8,g):d+8,i+h>b.byteLength)return void console.log("Invalid Exif data: Invalid data offset.");if(1===f)return n.getValue(b,i,g);for(j=[],k=0;f>k;k+=1)j[k]=n.getValue(b,i+k*n.size,g);if(n.ascii){for(l="",k=0;k<j.length&&(m=j[k],"\x00"!==m);k+=1)l+=m;return l}return j},a.parseExifTag=function(b,c,d,e,f){var g=b.getUint16(d,e);f.exif[g]=a.getExifValue(b,c,d,b.getUint16(d+2,e),b.getUint32(d+4,e),e)},a.parseExifTags=function(a,b,c,d,e){var f,g,h;if(c+6>a.byteLength)return void console.log("Invalid Exif data: Invalid directory offset.");if(f=a.getUint16(c,d),g=c+2+12*f,g+4>a.byteLength)return void console.log("Invalid Exif data: Invalid directory size.");for(h=0;f>h;h+=1)this.parseExifTag(a,b,c+2+12*h,d,e);return a.getUint32(g,d)},a.parseExifData=function(b,c,d,e,f){if(!f.disableExif){var g,h,i,j=c+10;if(1165519206===b.getUint32(c+4)){if(j+8>b.byteLength)return void console.log("Invalid Exif data: Invalid segment size.");if(0!==b.getUint16(c+8))return void console.log("Invalid Exif data: Missing byte alignment offset.");switch(b.getUint16(j)){case 18761:g=!0;break;case 19789:g=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}if(42!==b.getUint16(j+2,g))return void console.log("Invalid Exif data: Missing TIFF marker.");h=b.getUint32(j+4,g),e.exif=new a.ExifMap,h=a.parseExifTags(b,j,j+h,g,e),h&&!f.disableExifThumbnail&&(i={exif:{}},h=a.parseExifTags(b,j,j+h,g,i),i.exif[513]&&(e.exif.Thumbnail=a.getExifThumbnail(b,j+i.exif[513],i.exif[514]))),e.exif[34665]&&!f.disableExifSub&&a.parseExifTags(b,j,j+e.exif[34665],g,e),e.exif[34853]&&!f.disableExifGps&&a.parseExifTags(b,j,j+e.exif[34853],g,e)}}},a.metaDataParsers.jpeg[65505].push(a.parseExifData)}),function(a){"use strict";"function"==typeof define&&define.amd?define(["load-image","load-image-exif"],a):a(window.loadImage)}(function(a){"use strict";a.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},a.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}},a.ExifMap.prototype.getText=function(a){var b=this.get(a);switch(a){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[a][b];case"ExifVersion":case"FlashpixVersion":return String.fromCharCode(b[0],b[1],b[2],b[3]);case"ComponentsConfiguration":return this.stringValues[a][b[0]]+this.stringValues[a][b[1]]+this.stringValues[a][b[2]]+this.stringValues[a][b[3]];case"GPSVersionID":return b[0]+"."+b[1]+"."+b[2]+"."+b[3]}return String(b)},function(a){var b,c=a.tags,d=a.map;for(b in c)c.hasOwnProperty(b)&&(d[c[b]]=b)}(a.ExifMap.prototype),a.ExifMap.prototype.getAll=function(){var a,b,c={};for(a in this)this.hasOwnProperty(a)&&(b=this.tags[a],b&&(c[b]=this.getText(b)));return c}});!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 i="dragover"===t;return function(r){r.dataTransfer=r.originalEvent&&r.originalEvent.dataTransfer;var n=r.dataTransfer;n&&-1!==e.inArray("Files",n.types)&&!1!==this._trigger(t,e.Event(t,{delegatedEvent:r}))&&(r.preventDefault(),i&&(n.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,i){return t=this.messages[t]||t.toString(),i&&e.each(i,function(e,i){t=t.replace("{"+e+"}",i)}),t},formData:function(e){return e.serializeArray()},add:function(t,i){if(t.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&e(this).fileupload("option","autoUpload"))&&i.process().done(function(){i.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,i){var r=e-this.timestamp;return(!this.bitrate||!i||r>i)&&(this.bitrate=(t-this.loaded)*(1e3/r)*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 i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,function(e,t){i.push({name:e,value:t})}),i):[]},_getTotal:function(t){var i=0;return e.each(t,function(e,t){i+=t.size||1}),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_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,i){if(t.lengthComputable){var r,n=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&n-i._time<i.progressInterval&&t.loaded!==t.total)return;i._time=n,r=Math.floor(t.loaded/t.total*(i.chunkSize||i._progress.total))+(i.uploadedBytes||0),this._progress.loaded+=r-i._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(n,this._progress.loaded,i.bitrateInterval),i._progress.loaded=i.loaded=r,i._progress.bitrate=i.bitrate=i._bitrateTimer.getBitrate(n,r,i.bitrateInterval),this._trigger("progress",e.Event("progress",{delegatedEvent:t}),i),this._trigger("progressall",e.Event("progressall",{delegatedEvent:t}),this._progress)}},_initProgressListener:function(t){var i=this,r=t.xhr?t.xhr():e.ajaxSettings.xhr();r.upload&&(e(r.upload).bind("progress",function(e){var r=e.originalEvent;e.lengthComputable=r.lengthComputable,e.loaded=r.loaded,e.total=r.total,i._onProgress(e,t)}),t.xhr=function(){return r})},_isInstanceOf:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},_initXHRData:function(t){var i,r=this,n=t.files[0],o=t.multipart||!e.support.xhrFileUpload,s="array"===e.type(t.paramName)?t.paramName[0]:t.paramName;t.headers=e.extend({},t.headers),t.contentRange&&(t.headers["Content-Range"]=t.contentRange),o&&!t.blob&&this._isInstanceOf("File",n)||(t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(n.name)+'"'),o?e.support.xhrFormDataFileUpload&&(t.postMessage?(i=this._getFormData(t),t.blob?i.push({name:s,value:t.blob}):e.each(t.files,function(r,n){i.push({name:"array"===e.type(t.paramName)&&t.paramName[r]||s,value:n})})):(r._isInstanceOf("FormData",t.formData)?i=t.formData:(i=new FormData,e.each(this._getFormData(t),function(e,t){i.append(t.name,t.value)})),t.blob?i.append(s,t.blob,n.name):e.each(t.files,function(n,o){(r._isInstanceOf("File",o)||r._isInstanceOf("Blob",o))&&i.append("array"===e.type(t.paramName)&&t.paramName[n]||s,o,o.uploadName||o.name)})),t.data=i):(t.contentType=n.type||"application/octet-stream",t.data=t.blob||n),t.blob=null},_initIframeSettings:function(t){var i=e("<a></a>").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==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 i=e(t.fileInput),r=t.paramName;return r?e.isArray(r)||(r=[r]):(r=[],i.each(function(){for(var t=e(this),i=t.prop("name")||"files[]",n=(t.prop("files")||[1]).length;n;)r.push(i),n-=1}),r.length||(r=[i.prop("name")||"files[]"])),r},_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 i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_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,i,r){var n=e.Deferred(),o=n.promise();return i=i||this.options.context||o,!0===t?n.resolveWith(i,r):!1===t&&n.rejectWith(i,r),o.abort=n.promise,this._enhancePromise(o)},_addConvenienceMethods:function(t,i){var r=this,n=function(t){return e.Deferred().resolveWith(r,t).promise()};i.process=function(t,o){return(t||o)&&(i._processQueue=this._processQueue=(this._processQueue||n([this])).then(function(){return i.errorThrown?e.Deferred().rejectWith(r,[i]).promise():n(arguments)}).then(t,o)),this._processQueue||n([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==r._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&r._onSend(t,this)),this.jqXHR||r._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",r._trigger("fail",null,this),r._getXHRPromise(!1))},i.state=function(){return this.jqXHR?r._getDeferredState(this.jqXHR):this._processQueue?r._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===r._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),r=i&&i.length>1&&parseInt(i[1],10);return r&&r+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var r,n,o=this,s=t.files[0],a=s.size,l=t.uploadedBytes,p=t.maxChunkSize||a,u=this._blobSlice,d=e.Deferred(),h=d.promise();return!(!(this._isXHRUpload(t)&&u&&(l||p<a))||t.data)&&(!!i||(l>=a?(s.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",s.error])):(n=function(){var i=e.extend({},t),h=i._progress.loaded;i.blob=u.call(s,l,l+p,s.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+a,o._initXHRData(i),o._initProgressListener(i),r=(!1!==o._trigger("chunksend",null,i)&&e.ajax(i)||o._getXHRPromise(!1,i.context)).done(function(r,s,p){l=o._getUploadedBytes(p)||l+i.chunkSize,h+i.chunkSize-i._progress.loaded&&o._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=r,i.textStatus=s,i.jqXHR=p,o._trigger("chunkdone",null,i),o._trigger("chunkalways",null,i),l<a?n():d.resolveWith(i.context,[r,s,p])}).fail(function(e,t,r){i.jqXHR=e,i.textStatus=t,i.errorThrown=r,o._trigger("chunkfail",null,i),o._trigger("chunkalways",null,i),d.rejectWith(i.context,[e,t,r])})},this._enhancePromise(h),h.abort=function(){return r.abort()},n(),h)))},_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,i,r,n){var o=n._progress.total,s=n._response;n._progress.loaded<o&&this._onProgress(e.Event("progress",{lengthComputable:!0,loaded:o,total:o}),n),s.result=n.result=t,s.textStatus=n.textStatus=i,s.jqXHR=n.jqXHR=r,this._trigger("done",null,n)},_onFail:function(e,t,i,r){var n=r._response;r.recalculateProgress&&(this._progress.loaded-=r._progress.loaded,this._progress.total-=r._progress.total),n.jqXHR=r.jqXHR=e,n.textStatus=r.textStatus=t,n.errorThrown=r.errorThrown=i,this._trigger("fail",null,r)},_onAlways:function(e,t,i,r){this._trigger("always",null,r)},_onSend:function(t,i){i.submit||this._addConvenienceMethods(t,i);var r,n,o,s,a=this,l=a._getAJAXSettings(i),p=function(){return a._sending+=1,l._bitrateTimer=new a._BitrateTimer,r=r||((n||!1===a._trigger("send",e.Event("send",{delegatedEvent:t}),l))&&a._getXHRPromise(!1,l.context,n)||a._chunkedUpload(l)||e.ajax(l)).done(function(e,t,i){a._onDone(e,t,i,l)}).fail(function(e,t,i){a._onFail(e,t,i,l)}).always(function(e,t,i){if(a._onAlways(e,t,i,l),a._sending-=1,a._active-=1,l.limitConcurrentUploads&&l.limitConcurrentUploads>a._sending)for(var r=a._slots.shift();r;){if("pending"===a._getDeferredState(r)){r.resolve();break}r=a._slots.shift()}0===a._active&&a._trigger("stop")})};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(o=e.Deferred(),this._slots.push(o),s=o.then(p)):(this._sequence=this._sequence.then(p,p),s=this._sequence),s.abort=function(){return n=[void 0,"abort","abort"],r?r.abort():(o&&o.rejectWith(l.context,n),p())},this._enhancePromise(s)):p()},_onAdd:function(t,i){var r,n,o,s,a=this,l=!0,p=e.extend({},this.options,i),u=i.files,d=u.length,h=p.limitMultiFileUploads,c=p.limitMultiFileUploadSize,f=p.limitMultiFileUploadSizeOverhead,g=0,_=this._getParamName(p),m=0;if(!d)return!1;if(c&&void 0===u[0].size&&(c=void 0),(p.singleFileUploads||h||c)&&this._isXHRUpload(p))if(p.singleFileUploads||c||!h)if(!p.singleFileUploads&&c)for(o=[],r=[],s=0;s<d;s+=1)g+=u[s].size+f,(s+1===d||g+u[s+1].size+f>c||h&&s+1-m>=h)&&(o.push(u.slice(m,s+1)),n=_.slice(m,s+1),n.length||(n=_),r.push(n),m=s+1,g=0);else r=_;else for(o=[],r=[],s=0;s<d;s+=h)o.push(u.slice(s,s+h)),n=_.slice(s,s+h),n.length||(n=_),r.push(n);else o=[u],r=[_];return i.originalFiles=u,e.each(o||u,function(n,s){var p=e.extend({},i);return p.files=o?s:[s],p.paramName=r[n],a._initResponseObject(p),a._initProgressObject(p),a._addConvenienceMethods(t,p),l=a._trigger("add",e.Event("add",{delegatedEvent:t}),p)}),l},_replaceFileInput:function(t){var i=t.fileInput,r=i.clone(!0),n=i.is(document.activeElement);t.fileInputClone=r,e("<form></form>").append(r)[0].reset(),i.after(r).detach(),n&&r.focus(),e.cleanData(i.unbind("remove")),this.options.fileInput=this.options.fileInput.map(function(e,t){return t===i[0]?r[0]:t}),i[0]===this.element[0]&&(this.element=r)},_handleFileTreeEntry:function(t,i){var r,n=this,o=e.Deferred(),s=[],a=function(e){e&&!e.entry&&(e.entry=t),o.resolve([e])},l=function(e){n._handleFileTreeEntries(e,i+t.name+"/").done(function(e){o.resolve(e)}).fail(a)},p=function(){r.readEntries(function(e){e.length?(s=s.concat(e),p()):l(s)},a)};return i=i||"",t.isFile?t._file?(t._file.relativePath=i,o.resolve(t._file)):t.file(function(e){e.relativePath=i,o.resolve(e)},a):t.isDirectory?(r=t.createReader(),p()):o.resolve([]),o.promise()},_handleFileTreeEntries:function(t,i){var r=this;return e.when.apply(e,e.map(t,function(e){return r._handleFileTreeEntry(e,i)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(t){t=t||{};var i=t.items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,function(e){var t;return e.webkitGetAsEntry?(t=e.webkitGetAsEntry(),t&&(t._file=e.getAsFile()),t):e.getAsEntry()})):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){t=e(t);var i,r,n=t.prop("webkitEntries")||t.prop("entries");if(n&&n.length)return this._handleFileTreeEntries(n);if(i=e.makeArray(t.prop("files")),i.length)void 0===i[0].name&&i[0].fileName&&e.each(i,function(e,t){t.name=t.fileName,t.size=t.fileSize});else{if(!(r=t.prop("value")))return e.Deferred().resolve([]).promise();i=[{name:r.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).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 i=this,r={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(r.fileInput).always(function(n){r.files=n,i.options.replaceFileInput&&i._replaceFileInput(r),!1!==i._trigger("change",e.Event("change",{delegatedEvent:t}),r)&&i._onAdd(t,r)})},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,r={files:[]};i&&i.length&&(e.each(i,function(e,t){var i=t.getAsFile&&t.getAsFile();i&&r.files.push(i)}),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),r)&&this._onAdd(t,r))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,r=t.dataTransfer,n={};r&&r.files&&r.files.length&&(t.preventDefault(),this._getDroppedFiles(r).always(function(r){n.files=r,!1!==i._trigger("drop",e.Event("drop",{delegatedEvent:t}),n)&&i._onAdd(t,n)}))},_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,i){var r=-1!==e.inArray(t,this._specialOptions);r&&this._destroyEventHandlers(),this._super(t,i),r&&(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("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,r=this.element.data();e.each(this.element[0].attributes,function(e,n){var o,s=n.name.toLowerCase();/^data-/.test(s)&&(s=s.slice(5).replace(/-[a-z]/g,function(e){return e.charAt(1).toUpperCase()}),o=r[s],t._isRegExpOption(s,o)&&(o=t._getRegExp(o)),i[s]=o)})},_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 i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always(function(e){t.files=e,i._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 i,r,n=this,o=e.Deferred(),s=o.promise();return s.abort=function(){return r=!0,i?i.abort():(o.reject(null,"abort","abort"),s)},this._getFileInputFiles(t.fileInput).always(function(e){if(!r){if(!e.length)return void o.reject();t.files=e,i=n._onSend(null,t),i.then(function(e,t,i){o.resolve(e,t,i)},function(e,t,i){o.reject(e,t,i)})}}),this._enhancePromise(s)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})});!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload"],e):"object"==typeof exports?e(require("jquery"),require("./jquery.fileupload")):e(window.jQuery)}(function(e){"use strict";var r=e.blueimp.fileupload.prototype.options.add;e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{processQueue:[],add:function(s,i){var o=e(this);i.process(function(){return o.fileupload("process",i)}),r.call(this,s,i)}},processActions:{},_processFile:function(r,s){var i=this,o=e.Deferred().resolveWith(i,[r]),t=o.promise();return this._trigger("process",null,r),e.each(r.processQueue,function(r,o){var n=function(r){return s.errorThrown?e.Deferred().rejectWith(i,[s]).promise():i.processActions[o.action].call(i,r,o)};t=t.then(n,o.always&&n)}),t.done(function(){i._trigger("processdone",null,r),i._trigger("processalways",null,r)}).fail(function(){i._trigger("processfail",null,r),i._trigger("processalways",null,r)}),t},_transformProcessQueue:function(r){var s=[];e.each(r.processQueue,function(){var i={},o=this.action,t=!0===this.prefix?o:this.prefix;e.each(this,function(s,o){"string"===e.type(o)&&"@"===o.charAt(0)?i[s]=r[o.slice(1)||(t?t+s.charAt(0).toUpperCase()+s.slice(1):s)]:i[s]=o}),s.push(i)}),r.processQueue=s},processing:function(){return this._processing},process:function(r){var s=this,i=e.extend({},this.options,r);return i.processQueue&&i.processQueue.length&&(this._transformProcessQueue(i),0===this._processing&&this._trigger("processstart"),e.each(r.files,function(o){var t=o?e.extend({},i):i,n=function(){return r.errorThrown?e.Deferred().rejectWith(s,[r]).promise():s._processFile(t,r)};t.index=o,s._processing+=1,s._processingQueue=s._processingQueue.then(n,n).always(function(){s._processing-=1,0===s._processing&&s._trigger("processstop")})})),this._processingQueue},_create:function(){this._super(),this._processing=0,this._processingQueue=e.Deferred().resolveWith(this).promise()}})});!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","load-image","load-image-meta","load-image-scale","load-image-exif","canvas-to-blob","./jquery.fileupload-process"],e):"object"==typeof exports?e(require("jquery"),require("blueimp-load-image/js/load-image"),require("blueimp-load-image/js/load-image-meta"),require("blueimp-load-image/js/load-image-scale"),require("blueimp-load-image/js/load-image-exif"),require("blueimp-canvas-to-blob"),require("./jquery.fileupload-process")):e(window.jQuery,window.loadImage)}(function(e,i){"use strict";e.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadImageMetaData",disableImageHead:"@",disableExif:"@",disableExifThumbnail:"@",disableExifSub:"@",disableExifGps:"@",disabled:"@disableImageMetaDataLoad"},{action:"loadImage",prefix:!0,fileTypes:"@",maxFileSize:"@",noRevoke:"@",disabled:"@disableImageLoad"},{action:"resizeImage",prefix:"image",maxWidth:"@",maxHeight:"@",minWidth:"@",minHeight:"@",crop:"@",orientation:"@",forceResize:"@",disabled:"@disableImageResize"},{action:"saveImage",quality:"@imageQuality",type:"@imageType",disabled:"@disableImageResize"},{action:"saveImageMetaData",disabled:"@disableImageMetaDataSave"},{action:"resizeImage",prefix:"preview",maxWidth:"@",maxHeight:"@",minWidth:"@",minHeight:"@",crop:"@",orientation:"@",thumbnail:"@",canvas:"@",disabled:"@disableImagePreview"},{action:"setImage",name:"@imagePreviewName",disabled:"@disableImagePreview"},{action:"deleteImageReferences",disabled:"@disableImageReferencesDeletion"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{loadImageFileTypes:/^image\/(gif|jpeg|png|svg\+xml)$/,loadImageMaxFileSize:1e7,imageMaxWidth:1920,imageMaxHeight:1080,imageOrientation:!1,imageCrop:!1,disableImageResize:!0,previewMaxWidth:80,previewMaxHeight:80,previewOrientation:!0,previewThumbnail:!0,previewCrop:!1,previewCanvas:!0},processActions:{loadImage:function(a,t){if(t.disabled)return a;var n=this,r=a.files[a.index],s=e.Deferred();return"number"===e.type(t.maxFileSize)&&r.size>t.maxFileSize||t.fileTypes&&!t.fileTypes.test(r.type)||!i(r,function(e){e.src&&(a.img=e),s.resolveWith(n,[a])},t)?a:s.promise()},resizeImage:function(a,t){if(t.disabled||!a.canvas&&!a.img)return a;t=e.extend({canvas:!0},t);var n,r=this,s=e.Deferred(),l=t.canvas&&a.canvas||a.img,o=function(e){e&&(e.width!==l.width||e.height!==l.height||t.forceResize)&&(a[e.getContext?"canvas":"img"]=e),a.preview=e,s.resolveWith(r,[a])};if(a.exif){if(!0===t.orientation&&(t.orientation=a.exif.get("Orientation")),t.thumbnail&&(n=a.exif.get("Thumbnail")))return i(n,o,t),s.promise();a.orientation?delete t.orientation:a.orientation=t.orientation}return l?(o(i.scale(l,t)),s.promise()):a},saveImage:function(i,a){if(!i.canvas||a.disabled)return i;var t=this,n=i.files[i.index],r=e.Deferred();return i.canvas.toBlob?(i.canvas.toBlob(function(e){e.name||(n.type===e.type?e.name=n.name:n.name&&(e.name=n.name.replace(/\.\w+$/,"."+e.type.substr(6)))),n.type!==e.type&&delete i.imageHead,i.files[i.index]=e,r.resolveWith(t,[i])},a.type||n.type,a.quality),r.promise()):i},loadImageMetaData:function(a,t){if(t.disabled)return a;var n=this,r=e.Deferred();return i.parseMetaData(a.files[a.index],function(i){e.extend(a,i),r.resolveWith(n,[a])},t),r.promise()},saveImageMetaData:function(e,i){if(!(e.imageHead&&e.canvas&&e.canvas.toBlob)||i.disabled)return e;var a=e.files[e.index],t=new Blob([e.imageHead,this._blobSlice.call(a,20)],{type:a.type});return t.name=a.name,e.files[e.index]=t,e},setImage:function(e,i){return e.preview&&!i.disabled&&(e.files[e.index][i.name||"preview"]=e.preview),e},deleteImageReferences:function(e,i){return i.disabled||(delete e.img,delete e.canvas,delete e.preview,delete e.imageHead),e}}})});!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload-process"],e):"object"==typeof exports?e(require("jquery"),require("./jquery.fileupload-process")):e(window.jQuery)}(function(e){"use strict";e.blueimp.fileupload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"}),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{getNumberOfFiles:e.noop,messages:{maxNumberOfFiles:"Maximum number of files exceeded",acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small"}},processActions:{validate:function(i,r){if(r.disabled)return i;var l,s=e.Deferred(),t=this.options,o=i.files[i.index];return(r.minFileSize||r.maxFileSize)&&(l=o.size),"number"===e.type(r.maxNumberOfFiles)&&(t.getNumberOfFiles()||0)+i.files.length>r.maxNumberOfFiles?o.error=t.i18n("maxNumberOfFiles"):!r.acceptFileTypes||r.acceptFileTypes.test(o.type)||r.acceptFileTypes.test(o.name)?l>r.maxFileSize?o.error=t.i18n("maxFileSize"):"number"===e.type(l)&&l<r.minFileSize?o.error=t.i18n("minFileSize"):delete o.error:o.error=t.i18n("acceptFileTypes"),o.error||i.files.error?(i.files.error=!0,s.rejectWith(this,[i])):s.resolveWith(this,[i]),s.promise()}}})});!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","blueimp-tmpl","./jquery.fileupload-image","./jquery.fileupload-audio","./jquery.fileupload-video","./jquery.fileupload-validate"],e):"object"==typeof exports?e(require("jquery"),require("blueimp-tmpl"),require("./jquery.fileupload-image"),require("./jquery.fileupload-video"),require("./jquery.fileupload-validate")):e(window.jQuery,window.tmpl)}(function(e,t){"use strict";e.blueimp.fileupload.prototype._specialOptions.push("filesContainer","uploadTemplateId","downloadTemplateId"),e.widget("blueimp.fileupload",e.blueimp.fileupload,{options:{autoUpload:!1,uploadTemplateId:"template-upload",downloadTemplateId:"template-download",filesContainer:void 0,prependFiles:!1,dataType:"json",messages:{unknownError:"Unknown error"},getNumberOfFiles:function(){return this.filesContainer.children().not(".processing").length},getFilesFromResponse:function(t){return t.result&&e.isArray(t.result.files)?t.result.files:[]},add:function(t,i){if(t.isDefaultPrevented())return!1;var n=e(this),r=n.data("blueimp-fileupload")||n.data("fileupload"),o=r.options;i.context=r._renderUpload(i.files).data("data",i).addClass("processing"),o.filesContainer[o.prependFiles?"prepend":"append"](i.context),r._forceReflow(i.context),r._transition(i.context),i.process(function(){return n.fileupload("process",i)}).always(function(){i.context.each(function(t){e(this).find(".size").text(r._formatFileSize(i.files[t].size))}).removeClass("processing"),r._renderPreviews(i)}).done(function(){i.context.find(".start").prop("disabled",!1),!1!==r._trigger("added",t,i)&&(o.autoUpload||i.autoUpload)&&!1!==i.autoUpload&&i.submit()}).fail(function(){i.files.error&&i.context.each(function(t){var n=i.files[t].error;n&&e(this).find(".error").text(n)})})},send:function(t,i){if(t.isDefaultPrevented())return!1;var n=e(this).data("blueimp-fileupload")||e(this).data("fileupload");return i.context&&i.dataType&&"iframe"===i.dataType.substr(0,6)&&i.context.find(".progress").addClass(!e.support.transition&&"progress-animated").attr("aria-valuenow",100).children().first().css("width","100%"),n._trigger("sent",t,i)},done:function(t,i){if(t.isDefaultPrevented())return!1;var n,r,o=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),a=i.getFilesFromResponse||o.options.getFilesFromResponse,s=a(i);i.context?i.context.each(function(a){var d=s[a]||{error:"Empty file upload result"};r=o._addFinishedDeferreds(),o._transition(e(this)).done(function(){var a=e(this);n=o._renderDownload([d]).replaceAll(a),o._forceReflow(n),o._transition(n).done(function(){i.context=e(this),o._trigger("completed",t,i),o._trigger("finished",t,i),r.resolve()})})}):(n=o._renderDownload(s)[o.options.prependFiles?"prependTo":"appendTo"](o.options.filesContainer),o._forceReflow(n),r=o._addFinishedDeferreds(),o._transition(n).done(function(){i.context=e(this),o._trigger("completed",t,i),o._trigger("finished",t,i),r.resolve()}))},fail:function(t,i){if(t.isDefaultPrevented())return!1;var n,r,o=e(this).data("blueimp-fileupload")||e(this).data("fileupload");i.context?i.context.each(function(a){if("abort"!==i.errorThrown){var s=i.files[a];s.error=s.error||i.errorThrown||i.i18n("unknownError"),r=o._addFinishedDeferreds(),o._transition(e(this)).done(function(){var a=e(this);n=o._renderDownload([s]).replaceAll(a),o._forceReflow(n),o._transition(n).done(function(){i.context=e(this),o._trigger("failed",t,i),o._trigger("finished",t,i),r.resolve()})})}else r=o._addFinishedDeferreds(),o._transition(e(this)).done(function(){e(this).remove(),o._trigger("failed",t,i),o._trigger("finished",t,i),r.resolve()})}):"abort"!==i.errorThrown?(i.context=o._renderUpload(i.files)[o.options.prependFiles?"prependTo":"appendTo"](o.options.filesContainer).data("data",i),o._forceReflow(i.context),r=o._addFinishedDeferreds(),o._transition(i.context).done(function(){i.context=e(this),o._trigger("failed",t,i),o._trigger("finished",t,i),r.resolve()})):(o._trigger("failed",t,i),o._trigger("finished",t,i),o._addFinishedDeferreds().resolve())},progress:function(t,i){if(t.isDefaultPrevented())return!1;var n=Math.floor(i.loaded/i.total*100);i.context&&i.context.each(function(){e(this).find(".progress").attr("aria-valuenow",n).children().first().css("width",n+"%")})},progressall:function(t,i){if(t.isDefaultPrevented())return!1;var n=e(this),r=Math.floor(i.loaded/i.total*100),o=n.find(".fileupload-progress"),a=o.find(".progress-extended");a.length&&a.html((n.data("blueimp-fileupload")||n.data("fileupload"))._renderExtendedProgress(i)),o.find(".progress").attr("aria-valuenow",r).children().first().css("width",r+"%")},start:function(t){if(t.isDefaultPrevented())return!1;var i=e(this).data("blueimp-fileupload")||e(this).data("fileupload");i._resetFinishedDeferreds(),i._transition(e(this).find(".fileupload-progress")).done(function(){i._trigger("started",t)})},stop:function(t){if(t.isDefaultPrevented())return!1;var i=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),n=i._addFinishedDeferreds();e.when.apply(e,i._getFinishedDeferreds()).done(function(){i._trigger("stopped",t)}),i._transition(e(this).find(".fileupload-progress")).done(function(){e(this).find(".progress").attr("aria-valuenow","0").children().first().css("width","0%"),e(this).find(".progress-extended").html(" "),n.resolve()})},processstart:function(t){if(t.isDefaultPrevented())return!1;e(this).addClass("fileupload-processing")},processstop:function(t){if(t.isDefaultPrevented())return!1;e(this).removeClass("fileupload-processing")},destroy:function(t,i){if(t.isDefaultPrevented())return!1;var n=e(this).data("blueimp-fileupload")||e(this).data("fileupload"),r=function(){n._transition(i.context).done(function(){e(this).remove(),n._trigger("destroyed",t,i)})};i.url?(i.dataType=i.dataType||n.options.dataType,e.ajax(i).done(r).fail(function(){n._trigger("destroyfailed",t,i)})):r()}},_resetFinishedDeferreds:function(){this._finishedUploads=[]},_addFinishedDeferreds:function(t){return t||(t=e.Deferred()),this._finishedUploads.push(t),t},_getFinishedDeferreds:function(){return this._finishedUploads},_enableDragToDesktop:function(){var t=e(this),i=t.prop("href"),n=t.prop("download");t.bind("dragstart",function(e){try{e.originalEvent.dataTransfer.setData("DownloadURL",["application/octet-stream",n,i].join(":"))}catch(e){}})},_formatFileSize:function(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"},_formatBitrate:function(e){return"number"!=typeof e?"":e>=1e9?(e/1e9).toFixed(2)+" Gbit/s":e>=1e6?(e/1e6).toFixed(2)+" Mbit/s":e>=1e3?(e/1e3).toFixed(2)+" kbit/s":e.toFixed(2)+" bit/s"},_formatTime:function(e){var t=new Date(1e3*e),i=Math.floor(e/86400);return(i=i?i+"d ":"")+("0"+t.getUTCHours()).slice(-2)+":"+("0"+t.getUTCMinutes()).slice(-2)+":"+("0"+t.getUTCSeconds()).slice(-2)},_formatPercentage:function(e){return(100*e).toFixed(2)+" %"},_renderExtendedProgress:function(e){return this._formatBitrate(e.bitrate)+" | "+this._formatTime(8*(e.total-e.loaded)/e.bitrate)+" | "+this._formatPercentage(e.loaded/e.total)+" | "+this._formatFileSize(e.loaded)+" / "+this._formatFileSize(e.total)},_renderTemplate:function(t,i){if(!t)return e();var n=t({files:i,formatFileSize:this._formatFileSize,options:this.options});return n instanceof e?n:e(this.options.templatesContainer).html(n).children()},_renderPreviews:function(t){t.context.find(".preview").each(function(i,n){e(n).append(t.files[i].preview)})},_renderUpload:function(e){return this._renderTemplate(this.options.uploadTemplate,e)},_renderDownload:function(e){return this._renderTemplate(this.options.downloadTemplate,e).find("a[download]").each(this._enableDragToDesktop).end()},_startHandler:function(t){t.preventDefault();var i=e(t.currentTarget),n=i.closest(".template-upload"),r=n.data("data");i.prop("disabled",!0),r&&r.submit&&r.submit()},_cancelHandler:function(t){t.preventDefault();var i=e(t.currentTarget).closest(".template-upload,.template-download"),n=i.data("data")||{};n.context=n.context||i,n.abort?n.abort():(n.errorThrown="abort",this._trigger("fail",t,n))},_deleteHandler:function(t){t.preventDefault();var i=e(t.currentTarget);this._trigger("destroy",t,e.extend({context:i.closest(".template-download"),type:"DELETE"},i.data()))},_forceReflow:function(t){return e.support.transition&&t.length&&t[0].offsetWidth},_transition:function(t){var i=e.Deferred();return e.support.transition&&t.hasClass("fade")&&t.is(":visible")?t.bind(e.support.transition.end,function(n){n.target===t[0]&&(t.unbind(e.support.transition.end),i.resolveWith(t))}).toggleClass("in"):(t.toggleClass("in"),i.resolveWith(t)),i},_initButtonBarEventHandlers:function(){var t=this.element.find(".fileupload-buttonbar"),i=this.options.filesContainer;this._on(t.find(".start"),{click:function(e){e.preventDefault(),i.find(".start").click()}}),this._on(t.find(".cancel"),{click:function(e){e.preventDefault(),i.find(".cancel").click()}}),this._on(t.find(".delete"),{click:function(e){e.preventDefault(),i.find(".toggle:checked").closest(".template-download").find(".delete").click(),t.find(".toggle").prop("checked",!1)}}),this._on(t.find(".toggle"),{change:function(t){i.find(".toggle").prop("checked",e(t.currentTarget).is(":checked"))}})},_destroyButtonBarEventHandlers:function(){this._off(this.element.find(".fileupload-buttonbar").find(".start, .cancel, .delete"),"click"),this._off(this.element.find(".fileupload-buttonbar .toggle"),"change.")},_initEventHandlers:function(){this._super(),this._on(this.options.filesContainer,{"click .start":this._startHandler,"click .cancel":this._cancelHandler,"click .delete":this._deleteHandler}),this._initButtonBarEventHandlers()},_destroyEventHandlers:function(){this._destroyButtonBarEventHandlers(),this._off(this.options.filesContainer,"click"),this._super()},_enableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!1).parent().removeClass("disabled")},_disableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!0).parent().addClass("disabled")},_initTemplates:function(){var e=this.options;e.templatesContainer=this.document[0].createElement(e.filesContainer.prop("nodeName")),t&&(e.uploadTemplateId&&(e.uploadTemplate=t(e.uploadTemplateId)),e.downloadTemplateId&&(e.downloadTemplate=t(e.downloadTemplateId)))},_initFilesContainer:function(){var t=this.options;void 0===t.filesContainer?t.filesContainer=this.element.find(".files"):t.filesContainer instanceof e||(t.filesContainer=e(t.filesContainer))},_initSpecialOptions:function(){this._super(),this._initFilesContainer(),this._initTemplates()},_create:function(){this._super(),this._resetFinishedDeferreds(),e.support.fileInput||this._disableFileInputButton()},enable:function(){var e=!1;this.options.disabled&&(e=!0),this._super(),e&&(this.element.find("input, button").prop("disabled",!1),this._enableFileInputButton())},disable:function(){this.options.disabled||(this.element.find("input, button").prop("disabled",!0),this._disableFileInputButton()),this._super()}})});(function($){"use strict";$=$&&$.hasOwnProperty("default")?$["default"]:$;function isTypeof(type,arg){return typeof arg===type}var isString=isTypeof.bind(null,"string");var isUndefined=isTypeof.bind(null,"undefined");var isFunction=isTypeof.bind(null,"function");var isNumber=isTypeof.bind(null,"number");function isEmptyObject(obj){return!Object.keys(obj).length}function extend(targetArg,sourceArg){var isTargetBoolean=targetArg===!!targetArg;var i=isTargetBoolean?2:1;var target=isTargetBoolean?sourceArg:targetArg;var isDeep=isTargetBoolean?targetArg:false;for(;i<arguments.length;i++){var source=arguments[i];for(var key in source){var value=source[key];if(!isUndefined(value)){var isObject=value!==null&&typeof value==="object"&&Object.getPrototypeOf(value)===Object.prototype;var isArray=Array.isArray(value);if(isDeep&&(isObject||isArray)){target[key]=extend(true,target[key]||(isArray?[]:{}),value)}else{target[key]=value}}}}return target}function arrayRemove(arr,item){var i=arr.indexOf(item);if(i>-1){arr.splice(i,1)}}function each(obj,fn){if(Array.isArray(obj)||"length"in obj&&isNumber(obj.length)){for(var i=0;i<obj.length;i++){fn(i,obj[i])}}else{Object.keys(obj).forEach(function(key){fn(key,obj[key])})}}var cssPropertyNameCache={};var ELEMENT_NODE=1;var TEXT_NODE=3;function toFloat(value){value=parseFloat(value);return isFinite(value)?value:0}function createElement(tag,attributes,context){var node=(context||document).createElement(tag);each(attributes||{},function(key,value){if(key==="style"){node.style.cssText=value}else if(key in node){node[key]=value}else{node.setAttribute(key,value)}});return node}function parent(node,selector){var parent=node||{};while((parent=parent.parentNode)&&!/(9|11)/.test(parent.nodeType)){if(!selector||is(parent,selector)){return parent}}}function closest(node,selector){return is(node,selector)?node:parent(node,selector)}function remove(node){if(node.parentNode){node.parentNode.removeChild(node)}}function appendChild(node,child){node.appendChild(child)}function find(node,selector){return node.querySelectorAll(selector)}var EVENT_CAPTURE=true;function on(node,events,selector,fn,capture){events.split(" ").forEach(function(event){var handler;if(isString(selector)){handler=fn["_sce-event-"+event+selector]||function(e){var target=e.target;while(target&&target!==node){if(is(target,selector)){fn.call(target,e);return}target=target.parentNode}};fn["_sce-event-"+event+selector]=handler}else{handler=selector;capture=fn}node.addEventListener(event,handler,capture||false)})}function off(node,events,selector,fn,capture){events.split(" ").forEach(function(event){var handler;if(isString(selector)){handler=fn["_sce-event-"+event+selector]}else{handler=selector;capture=fn}node.removeEventListener(event,handler,capture||false)})}function attr(node,attr,value){if(arguments.length<3){return node.getAttribute(attr)}if(value==null){removeAttr(node,attr)}else{node.setAttribute(attr,value)}}function removeAttr(node,attr){node.removeAttribute(attr)}function hide(node){css(node,"display","none")}function show(node){css(node,"display","")}function toggle(node){if(isVisible(node)){hide(node)}else{show(node)}}function css(node,rule,value){if(arguments.length<3){if(isString(rule)){return node.nodeType===1?getComputedStyle(node)[rule]:null}each(rule,function(key,value){css(node,key,value)})}else{var isNumeric=(value||value===0)&&!isNaN(value);node.style[rule]=isNumeric?value+"px":value}}function data(node,key,value){var argsLength=arguments.length;var data={};if(node.nodeType===ELEMENT_NODE){if(argsLength===1){each(node.attributes,function(_,attr){if(/^data\-/i.test(attr.name)){data[attr.name.substr(5)]=attr.value}});return data}if(argsLength===2){return attr(node,"data-"+key)}attr(node,"data-"+key,String(value))}}function is(node,selector){var result=false;if(node&&node.nodeType===ELEMENT_NODE){result=(node.matches||node.msMatchesSelector||node.webkitMatchesSelector).call(node,selector)}return result}function contains(node,child){return node!==child&&node.contains&&node.contains(child)}function previousElementSibling(node,selector){var prev=node.previousElementSibling;if(selector&&prev){return is(prev,selector)?prev:null}return prev}function insertBefore(node,refNode){return refNode.parentNode.insertBefore(node,refNode)}function classes(node){return node.className.trim().split(/\s+/)}function hasClass(node,className){return is(node,"."+className)}function addClass(node,className){var classList=classes(node);if(classList.indexOf(className)<0){classList.push(className)}node.className=classList.join(" ")}function removeClass(node,className){var classList=classes(node);arrayRemove(classList,className);node.className=classList.join(" ")}function toggleClass(node,className,state){state=isUndefined(state)?!hasClass(node,className):state;if(state){addClass(node,className)}else{removeClass(node,className)}}function width(node,value){if(isUndefined(value)){var cs=getComputedStyle(node);var padding=toFloat(cs.paddingLeft)+toFloat(cs.paddingRight);var border=toFloat(cs.borderLeftWidth)+toFloat(cs.borderRightWidth);return node.offsetWidth-padding-border}css(node,"width",value)}function height(node,value){if(isUndefined(value)){var cs=getComputedStyle(node);var padding=toFloat(cs.paddingTop)+toFloat(cs.paddingBottom);var border=toFloat(cs.borderTopWidth)+toFloat(cs.borderBottomWidth);return node.offsetHeight-padding-border}css(node,"height",value)}function trigger(node,eventName,data){var event;if(isFunction(window.CustomEvent)){event=new CustomEvent(eventName,{bubbles:true,cancelable:true,detail:data})}else{event=node.ownerDocument.createEvent("CustomEvent");event.initCustomEvent(eventName,true,true,data)}node.dispatchEvent(event)}function isVisible(node){return!!node.getClientRects().length}function camelCase(string){return string.replace(/^-ms-/,"ms-").replace(/-(\w)/g,function(match,char){return char.toUpperCase()})}function traverse(node,func,innermostFirst,siblingsOnly,reverse){node=reverse?node.lastChild:node.firstChild;while(node){var next=reverse?node.previousSibling:node.nextSibling;if(!innermostFirst&&func(node)===false||!siblingsOnly&&traverse(node,func,innermostFirst,siblingsOnly,reverse)===false||innermostFirst&&func(node)===false){return false}node=next}}function rTraverse(node,func,innermostFirst,siblingsOnly){traverse(node,func,innermostFirst,siblingsOnly,true)}function parseHTML(html,context){context=context||document;var ret=context.createDocumentFragment();var tmp=createElement("div",{},context);tmp.innerHTML=html;while(tmp.firstChild){appendChild(ret,tmp.firstChild)}return ret}function hasStyling(node){return node&&(!is(node,"p,div")||node.className||attr(node,"style")||!isEmptyObject(data(node)))}function convertElement(element,toTagName){var newElement=createElement(toTagName,{},element.ownerDocument);each(element.attributes,function(_,attribute){try{attr(newElement,attribute.name,attribute.value)}catch(ex){}});while(element.firstChild){appendChild(newElement,element.firstChild)}element.parentNode.replaceChild(newElement,element);return newElement}var blockLevelList="|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|"+"form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|blockquote|center|";function canHaveChildren(node){if(!/11?|9/.test(node.nodeType)){return false}return("|iframe|area|base|basefont|br|col|frame|hr|img|input|wbr"+"|isindex|link|meta|param|command|embed|keygen|source|track|"+"object|").indexOf("|"+node.nodeName.toLowerCase()+"|")<0}function isInline(elm,includeCodeAsBlock){var tagName,nodeType=(elm||{}).nodeType||TEXT_NODE;if(nodeType!==ELEMENT_NODE){return nodeType===TEXT_NODE}tagName=elm.tagName.toLowerCase();if(tagName==="code"){return!includeCodeAsBlock}return blockLevelList.indexOf("|"+tagName+"|")<0}function copyCSS(from,to){to.style.cssText=from.style.cssText+to.style.cssText}function fixNesting(node){var getLastInlineParent=function(node){while(isInline(node.parentNode,true)){node=node.parentNode}return node};traverse(node,function(node){var list="ul,ol",isBlock=!isInline(node,true);if(isBlock&&isInline(node.parentNode,true)){var parent=getLastInlineParent(node),before=extractContents(parent,node),middle=node;copyCSS(parent,middle);insertBefore(before,parent);insertBefore(middle,parent)}if(isBlock&&is(node,list)&&is(node.parentNode,list)){var li=previousElementSibling(node,"li");if(!li){li=createElement("li");insertBefore(li,node)}appendChild(li,node)}})}function findCommonAncestor(node1,node2){while(node1=node1.parentNode){if(contains(node1,node2)){return node1}}}function getSibling(node,previous){if(!node){return null}return(previous?node.previousSibling:node.nextSibling)||getSibling(node.parentNode,previous)}function removeWhiteSpace(root){var nodeValue,nodeType,next,previous,previousSibling,nextNode,trimStart,cssWhiteSpace=css(root,"whiteSpace"),preserveNewLines=/line$/i.test(cssWhiteSpace),node=root.firstChild;if(/pre(\-wrap)?$/i.test(cssWhiteSpace)){return}while(node){nextNode=node.nextSibling;nodeValue=node.nodeValue;nodeType=node.nodeType;if(nodeType===ELEMENT_NODE&&node.firstChild){removeWhiteSpace(node)}if(nodeType===TEXT_NODE){next=getSibling(node);previous=getSibling(node,true);trimStart=false;while(hasClass(previous,"sceditor-ignore")){previous=getSibling(previous,true)}if(isInline(node)&&previous){previousSibling=previous;while(previousSibling.lastChild){previousSibling=previousSibling.lastChild;while(hasClass(previousSibling,"sceditor-ignore")){previousSibling=getSibling(previousSibling,true)}}trimStart=previousSibling.nodeType===TEXT_NODE?/[\t\n\r ]$/.test(previousSibling.nodeValue):!isInline(previousSibling)}nodeValue=nodeValue.replace(/\u200B/g,"");if(!previous||!isInline(previous)||trimStart){nodeValue=nodeValue.replace(preserveNewLines?/^[\t ]+/:/^[\t\n\r ]+/,"")}if(!next||!isInline(next)){nodeValue=nodeValue.replace(preserveNewLines?/[\t ]+$/:/[\t\n\r ]+$/,"")}if(!nodeValue.length){remove(node)}else{node.nodeValue=nodeValue.replace(preserveNewLines?/[\t ]+/g:/[\t\n\r ]+/g," ")}}node=nextNode}}function extractContents(startNode,endNode){var range=startNode.ownerDocument.createRange();range.setStartBefore(startNode);range.setEndAfter(endNode);return range.extractContents()}function getOffset(node){var left=0,top=0;while(node){left+=node.offsetLeft;top+=node.offsetTop;node=node.offsetParent}return{left:left,top:top}}function getStyle(elm,property){var direction,styleValue,elmStyle=elm.style;if(!cssPropertyNameCache[property]){cssPropertyNameCache[property]=camelCase(property)}property=cssPropertyNameCache[property];styleValue=elmStyle[property];if("textAlign"===property){direction=elmStyle.direction;styleValue=styleValue||css(elm,property);if(css(elm.parentNode,property)===styleValue||css(elm,"display")!=="block"||is(elm,"hr,th")){return""}if(/right/i.test(styleValue)&&direction==="rtl"||/left/i.test(styleValue)&&direction==="ltr"){return""}}return styleValue}function hasStyle(elm,property,values){var styleValue=getStyle(elm,property);if(!styleValue){return false}return!values||styleValue===values||Array.isArray(values)&&values.indexOf(styleValue)>-1}var defaultOptions={toolbar:"bold,italic,underline,strike,subscript,superscript|"+"left,center,right,justify|font,size,color,removeformat|"+"cut,copy,pastetext|bulletlist,orderedlist,indent,outdent|"+"table|code,quote|horizontalrule,image,email,link,unlink|"+"emoticon,youtube,date,time|ltr,rtl|print,maximize,source",toolbarExclude:null,style:"jquery.sceditor.default.css",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,"+"Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",colors:"#000000,#44B8FF,#1E92F7,#0074D9,#005DC2,#00369B,#b3d5f4|"+"#444444,#C3FFFF,#9DF9FF,#7FDBFF,#68C4E8,#419DC1,#d9f4ff|"+"#666666,#72FF84,#4CEA5E,#2ECC40,#17B529,#008E02,#c0f0c6|"+"#888888,#FFFF44,#FFFA1E,#FFDC00,#E8C500,#C19E00,#fff5b3|"+"#aaaaaa,#FFC95F,#FFA339,#FF851B,#E86E04,#C14700,#ffdbbb|"+"#cccccc,#FF857A,#FF5F54,#FF4136,#E82A1F,#C10300,#ffc6c3|"+"#eeeeee,#FF56FF,#FF30DC,#F012BE,#D900A7,#B20080,#fbb8ec|"+"#ffffff,#F551FF,#CF2BE7,#B10DC9,#9A00B2,#9A00B2,#e8b6ef",locale:attr(document.documentElement,"lang")||"en",charset:"utf-8",emoticonsCompat:false,emoticonsEnabled:true,emoticonsRoot:"",emoticons:{dropdown:{":)":"emoticons/smile.png",":angel:":"emoticons/angel.png",":angry:":"emoticons/angry.png","8-)":"emoticons/cool.png",":'(":"emoticons/cwy.png",":ermm:":"emoticons/ermm.png",":D":"emoticons/grin.png","<3":"emoticons/heart.png",":(":"emoticons/sad.png",":O":"emoticons/shocked.png",":P":"emoticons/tongue.png",";)":"emoticons/wink.png"},more:{":alien:":"emoticons/alien.png",":blink:":"emoticons/blink.png",":blush:":"emoticons/blush.png",":cheerful:":"emoticons/cheerful.png",":devil:":"emoticons/devil.png",":dizzy:":"emoticons/dizzy.png",":getlost:":"emoticons/getlost.png",":happy:":"emoticons/happy.png",":kissing:":"emoticons/kissing.png",":ninja:":"emoticons/ninja.png",":pinch:":"emoticons/pinch.png",":pouty:":"emoticons/pouty.png",":sick:":"emoticons/sick.png",":sideways:":"emoticons/sideways.png",":silly:":"emoticons/silly.png",":sleeping:":"emoticons/sleeping.png",":unsure:":"emoticons/unsure.png",":woot:":"emoticons/w00t.png",":wassat:":"emoticons/wassat.png"},hidden:{":whistling:":"emoticons/whistling.png",":love:":"emoticons/wub.png"}},width:null,height:null,resizeEnabled:true,resizeMinWidth:null,resizeMinHeight:null,resizeMaxHeight:null,resizeMaxWidth:null,resizeHeight:true,resizeWidth:true,dateFormat:"year-month-day",toolbarContainer:null,enablePasteFiltering:false,disablePasting:false,readOnly:false,rtl:false,autofocus:false,autofocusEnd:true,autoExpand:false,autoUpdate:false,spellcheck:true,runWithoutWysiwygSupport:false,startInSourceMode:false,id:null,plugins:"",zIndex:null,bbcodeTrim:false,disableBlockRemove:false,parserOptions:{},dropDownCss:{}};var USER_AGENT=navigator.userAgent;var ie=function(){var undef,v=3,doc=document,div=doc.createElement("div"),all=div.getElementsByTagName("i");do{div.innerHTML="\x3c!--[if gt IE "+ ++v+"]><i></i><![endif]--\x3e"}while(all[0]);if(doc.documentMode&&doc.all&&window.atob){v=10}if(v===4&&doc.documentMode){v=11}return v>4?v:undef}();var edge="-ms-ime-align"in document.documentElement.style;var ios=/iPhone|iPod|iPad| wosbrowser\//i.test(USER_AGENT);var isWysiwygSupported=function(){var match,isUnsupported;var div=document.createElement("div");div.contentEditable=true;if(!("contentEditable"in document.documentElement)||div.contentEditable!=="true"){return false}isUnsupported=/Opera Mobi|Opera Mini/i.test(USER_AGENT);if(/Android/i.test(USER_AGENT)){isUnsupported=true;if(/Safari/.test(USER_AGENT)){match=/Safari\/(\d+)/.exec(USER_AGENT);isUnsupported=!match||!match[1]?true:match[1]<534}}if(/ Silk\//i.test(USER_AGENT)){match=/AppleWebKit\/(\d+)/.exec(USER_AGENT);isUnsupported=!match||!match[1]?true:match[1]<534}if(ios){isUnsupported=/OS [0-4](_\d)+ like Mac/i.test(USER_AGENT)}if(/Firefox/i.test(USER_AGENT)){isUnsupported=false}if(/OneBrowser/i.test(USER_AGENT)){isUnsupported=false}if(navigator.vendor==="UCWEB"){isUnsupported=false}if(ie<=9){isUnsupported=true}return!isUnsupported}();var VALID_SCHEME_REGEX=/^(https?|s?ftp|mailto|spotify|skype|ssh|teamspeak|tel):|(\/\/)|data:image\/(png|bmp|gif|p?jpe?g);/i;function regex(str){return str.replace(/([\-.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function entities(str,noQuotes){if(!str){return str}var replacements={"&":"&","<":"<",">":">"," ":" ","\r\n":"<br />","\r":"<br />","\n":"<br />"};if(noQuotes!==false){replacements['"']=""";replacements["'"]="'";replacements["`"]="`"}str=str.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(match){return replacements[match]||match});return str}function uriScheme(url){var path,hasScheme=/^[^\/]*:/i,location=window.location;if(!url||!hasScheme.test(url)||VALID_SCHEME_REGEX.test(url)){return url}path=location.pathname.split("/");path.pop();return location.protocol+"//"+location.host+path.join("/")+"/"+url}var _templates={html:"<!DOCTYPE html>"+"<html{attrs}>"+"<head>"+"<style>.ie * {min-height: auto !important} "+".ie table td {height:15px} "+"@supports (-ms-ime-align:auto) { "+"* { min-height: auto !important; } "+"}"+"</style>"+'<meta http-equiv="Content-Type" '+'content="text/html;charset={charset}" />'+'<link rel="stylesheet" type="text/css" href="{style}" />'+"</head>"+'<body contenteditable="true" {spellcheck}><p></p></body>'+"</html>",toolbarButton:'<a class="sceditor-button sceditor-button-{name}" '+'data-sceditor-command="{name}" unselectable="on">'+'<div unselectable="on">{dispName}</div></a>',emoticon:'<img src="{url}" data-sceditor-emoticon="{key}" '+'alt="{key}" title="{tooltip}" />',fontOpt:'<a class="sceditor-font-option" href="#" '+'data-font="{font}"><font face="{font}">{font}</font></a>',sizeOpt:'<a class="sceditor-fontsize-option" data-size="{size}" '+'href="#"><font size="{size}">{size}</font></a>',pastetext:'<div><label for="txt">{label}</label> '+'<textarea cols="20" rows="7" id="txt"></textarea></div>'+'<div><input type="button" class="button" value="{insert}" />'+"</div>",table:'<div><label for="rows">{rows}</label><input type="text" '+'id="rows" value="2" /></div>'+'<div><label for="cols">{cols}</label><input type="text" '+'id="cols" value="2" /></div>'+'<div><input type="button" class="button" value="{insert}"'+" /></div>",image:'<div><label for="link">{url}</label> '+'<input type="text" id="image" dir="ltr" placeholder="https://" /></div>'+'<div><label for="width">{width}</label> '+'<input type="text" id="width" size="2" dir="ltr" /></div>'+'<div><label for="height">{height}</label> '+'<input type="text" id="height" size="2" dir="ltr" /></div>'+'<div><input type="button" class="button" value="{insert}" />'+"</div>",email:'<div><label for="email">{label}</label> '+'<input type="text" id="email" dir="ltr" /></div>'+'<div><label for="des">{desc}</label> '+'<input type="text" id="des" /></div>'+'<div><input type="button" class="button" value="{insert}" />'+"</div>",link:'<div><label for="link">{url}</label> '+'<input type="text" id="link" dir="ltr" placeholder="https://" /></div>'+'<div><label for="des">{desc}</label> '+'<input type="text" id="des" /></div>'+'<div><input type="button" class="button" value="{ins}" /></div>',youtubeMenu:'<div><label for="link">{label}</label> '+'<input type="text" id="link" dir="ltr" placeholder="https://" /></div>'+'<div><input type="button" class="button" value="{insert}" />'+"</div>",youtube:'<iframe width="560" height="315" frameborder="0" allowfullscreen '+'src="https://www.youtube.com/embed/{id}?wmode=opaque&start={time}" '+'data-youtube-id="{id}"></iframe>'};function _tmpl(name,params,createHtml){var template=_templates[name];Object.keys(params).forEach(function(name){template=template.replace(new RegExp(regex("{"+name+"}"),"g"),params[name])});if(createHtml){template=parseHTML(template)}return template}var IE_BR_FIX=ie&&ie<11;function fixFirefoxListBug(editor){if("mozHidden"in document){var node=editor.getBody();var next;while(node){next=node;if(next.firstChild){next=next.firstChild}else{while(next&&!next.nextSibling){next=next.parentNode}if(next){next=next.nextSibling}}if(node.nodeType===3&&/[\n\r\t]+/.test(node.nodeValue)){if(!/^pre/.test(css(node.parentNode,"whiteSpace"))){remove(node)}}node=next}}}var defaultCmds={bold:{exec:"bold",tooltip:"Bold",shortcut:"Ctrl+B"},italic:{exec:"italic",tooltip:"Italic",shortcut:"Ctrl+I"},underline:{exec:"underline",tooltip:"Underline",shortcut:"Ctrl+U"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{state:function(node){if(node&&node.nodeType===3){node=node.parentNode}if(node){var isLtr=css(node,"direction")==="ltr";var align=css(node,"textAlign");return align==="left"||align===(isLtr?"start":"end")}},exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{state:function(node){if(node&&node.nodeType===3){node=node.parentNode}if(node){var isLtr=css(node,"direction")==="ltr";var align=css(node,"textAlign");return align==="right"||align===(isLtr?"end":"start")}},exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(editor,caller,callback){var content=createElement("div");on(content,"click","a",function(e){callback(data(this,"font"));editor.closeDropDown(true);e.preventDefault()});editor.opts.fonts.split(",").forEach(function(font){appendChild(content,_tmpl("fontOpt",{font:font},true))});editor.createDropDown(caller,"font-picker",content)},exec:function(caller){var editor=this;defaultCmds.font._dropDown(editor,caller,function(fontName){editor.execCommand("fontname",fontName)})},tooltip:"Font Name"},size:{_dropDown:function(editor,caller,callback){var content=createElement("div");on(content,"click","a",function(e){callback(data(this,"size"));editor.closeDropDown(true);e.preventDefault()});for(var i=1;i<=7;i++){appendChild(content,_tmpl("sizeOpt",{size:i},true))}editor.createDropDown(caller,"fontsize-picker",content)},exec:function(caller){var editor=this;defaultCmds.size._dropDown(editor,caller,function(fontSize){editor.execCommand("fontsize",fontSize)})},tooltip:"Font Size"},color:{_dropDown:function(editor,caller,callback){var content=createElement("div"),html="",cmd=defaultCmds.color;if(!cmd._htmlCache){editor.opts.colors.split("|").forEach(function(column){html+='<div class="sceditor-color-column">';column.split(",").forEach(function(color){html+='<a href="#" class="sceditor-color-option"'+' style="background-color: '+color+'"'+' data-color="'+color+'"></a>'});html+="</div>"});cmd._htmlCache=html}appendChild(content,parseHTML(cmd._htmlCache));on(content,"click","a",function(e){callback(data(this,"color"));editor.closeDropDown(true);e.preventDefault()});editor.createDropDown(caller,"color-picker",content)},exec:function(caller){var editor=this;defaultCmds.color._dropDown(editor,caller,function(color){editor.execCommand("forecolor",color)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. "+"Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. "+"Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. "+"Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(caller){var val,content=createElement("div"),editor=this;appendChild(content,_tmpl("pastetext",{label:editor._("Paste your text inside the following box:"),insert:editor._("Insert")},true));on(content,"click",".button",function(e){val=find(content,"#txt")[0].value;if(val){editor.wysiwygEditorInsertText(val)}editor.closeDropDown(true);e.preventDefault()});editor.createDropDown(caller,"pastetext",content)},tooltip:"Paste Text"},bulletlist:{exec:function(){fixFirefoxListBug(this);this.execCommand("insertunorderedlist")},tooltip:"Bullet list"},orderedlist:{exec:function(){fixFirefoxListBug(this);this.execCommand("insertorderedlist")},tooltip:"Numbered list"},indent:{state:function(parent$$1,firstBlock){var range,startParent,endParent;if(is(firstBlock,"li")){return 0}if(is(firstBlock,"ul,ol,menu")){range=this.getRangeHelper().selectedRange();startParent=range.startContainer.parentNode;endParent=range.endContainer.parentNode;if(startParent!==startParent.parentNode.firstElementChild||is(endParent,"li")&&endParent!==endParent.parentNode.lastElementChild){return 0}}return-1},exec:function(){var editor=this,block=editor.getRangeHelper().getFirstBlockParent();editor.focus();if(closest(block,"ul,ol,menu")){editor.execCommand("indent")}},tooltip:"Add indent"},outdent:{state:function(parents$$1,firstBlock){return closest(firstBlock,"ul,ol,menu")?0:-1},exec:function(){var block=this.getRangeHelper().getFirstBlockParent();if(closest(block,"ul,ol,menu")){this.execCommand("outdent")}},tooltip:"Remove one indent"},table:{exec:function(caller){var editor=this,content=createElement("div");appendChild(content,_tmpl("table",{rows:editor._("Rows:"),cols:editor._("Cols:"),insert:editor._("Insert")},true));on(content,"click",".button",function(e){var rows=Number(find(content,"#rows")[0].value),cols=Number(find(content,"#cols")[0].value),html="<table>";if(rows>0&&cols>0){html+=Array(rows+1).join("<tr>"+Array(cols+1).join("<td>"+(IE_BR_FIX?"":"<br />")+"</td>")+"</tr>");html+="</table>";editor.wysiwygEditorInsertHtml(html);editor.closeDropDown(true);e.preventDefault()}});editor.createDropDown(caller,"inserttable",content)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{exec:function(){this.wysiwygEditorInsertHtml("<code>",(IE_BR_FIX?"":"<br />")+"</code>")},tooltip:"Code"},image:{_dropDown:function(editor,caller,selected,cb){var content=createElement("div");appendChild(content,_tmpl("image",{url:editor._("URL:"),width:editor._("Width (optional):"),height:editor._("Height (optional):"),insert:editor._("Insert")},true));var urlInput=find(content,"#image")[0];urlInput.value=selected;on(content,"click",".button",function(e){if(urlInput.value){cb(urlInput.value,find(content,"#width")[0].value,find(content,"#height")[0].value)}editor.closeDropDown(true);e.preventDefault()});editor.createDropDown(caller,"insertimage",content)},exec:function(caller){var editor=this;defaultCmds.image._dropDown(editor,caller,"",function(url,width$$1,height$$1){var attrs="";if(width$$1){attrs+=' width="'+width$$1+'"'}if(height$$1){attrs+=' height="'+height$$1+'"'}editor.wysiwygEditorInsertHtml("<img"+attrs+' src="'+url+'" />')})},tooltip:"Insert an image"},email:{_dropDown:function(editor,caller,cb){var content=createElement("div");appendChild(content,_tmpl("email",{label:editor._("E-mail:"),desc:editor._("Description (optional):"),insert:editor._("Insert")},true));on(content,"click",".button",function(e){var email=find(content,"#email")[0].value;if(email){cb(email,find(content,"#des")[0].value)}editor.closeDropDown(true);e.preventDefault()});editor.createDropDown(caller,"insertemail",content)},exec:function(caller){var editor=this;defaultCmds.email._dropDown(editor,caller,function(email,text){editor.focus();if(!editor.getRangeHelper().selectedHtml()||text){editor.wysiwygEditorInsertHtml('<a href="'+"mailto:"+email+'">'+(text||email)+"</a>")}else{editor.execCommand("createlink","mailto:"+email)}})},tooltip:"Insert an email"},link:{_dropDown:function(editor,caller,cb){var content=createElement("div");appendChild(content,_tmpl("link",{url:editor._("URL:"),desc:editor._("Description (optional):"),ins:editor._("Insert")},true));var linkInput=find(content,"#link")[0];function insertUrl(e){if(linkInput.value){cb(linkInput.value,find(content,"#des")[0].value)}editor.closeDropDown(true);e.preventDefault()}on(content,"click",".button",insertUrl);on(content,"keypress",function(e){if(e.which===13&&linkInput.value){insertUrl(e)}},EVENT_CAPTURE);editor.createDropDown(caller,"insertlink",content)},exec:function(caller){var editor=this;defaultCmds.link._dropDown(editor,caller,function(url,text){editor.focus();if(text||!editor.getRangeHelper().selectedHtml()){text=text||url;editor.wysiwygEditorInsertHtml('<a href="'+url+'">'+text+"</a>")}else{editor.execCommand("createlink",url)}})},tooltip:"Insert a link"},unlink:{state:function(){return closest(this.currentNode(),"a")?0:-1},exec:function(){var anchor=closest(this.currentNode(),"a");if(anchor){while(anchor.firstChild){insertBefore(anchor.firstChild,anchor)}remove(anchor)}},tooltip:"Unlink"},quote:{exec:function(caller,html,author){var before="<blockquote>",end="</blockquote>";if(html){author=author?"<cite>"+author+"</cite>":"";before=before+author+html+end;end=null}else if(this.getRangeHelper().selectedHtml()===""){end=(IE_BR_FIX?"":"<br />")+end}this.wysiwygEditorInsertHtml(before,end)},tooltip:"Insert a Quote"},emoticon:{exec:function(caller){var editor=this;var createContent=function(includeMore){var moreLink,opts=editor.opts,emoticonsRoot=opts.emoticonsRoot||"",emoticonsCompat=opts.emoticonsCompat,rangeHelper=editor.getRangeHelper(),startSpace=emoticonsCompat&&rangeHelper.getOuterText(true,1)!==" "?" ":"",endSpace=emoticonsCompat&&rangeHelper.getOuterText(false,1)!==" "?" ":"",content=createElement("div"),line=createElement("div"),perLine=0,emoticons=extend({},opts.emoticons.dropdown,includeMore?opts.emoticons.more:{});appendChild(content,line);perLine=Math.sqrt(Object.keys(emoticons).length);on(content,"click","img",function(e){editor.insert(startSpace+attr(this,"alt")+endSpace,null,false).closeDropDown(true);e.preventDefault()});each(emoticons,function(code,emoticon){appendChild(line,createElement("img",{src:emoticonsRoot+(emoticon.url||emoticon),alt:code,title:emoticon.tooltip||code}));if(line.children.length>=perLine){line=createElement("div");appendChild(content,line)}});if(!includeMore&&opts.emoticons.more){moreLink=createElement("a",{className:"sceditor-more"});appendChild(moreLink,document.createTextNode(editor._("More")));on(moreLink,"click",function(e){editor.createDropDown(caller,"more-emoticons",createContent(true));e.preventDefault()});appendChild(content,moreLink)}return content};editor.createDropDown(caller,"emoticons",createContent(false))},txtExec:function(caller){defaultCmds.emoticon.exec.call(this,caller)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(editor,caller,callback){var content=createElement("div");appendChild(content,_tmpl("youtubeMenu",{label:editor._("Video URL:"),insert:editor._("Insert")},true));on(content,"click",".button",function(e){var val=find(content,"#link")[0].value;var idMatch=val.match(/(?:v=|v\/|embed\/|youtu.be\/)(.{11})/);var timeMatch=val.match(/[&|?](?:star)?t=((\d+[hms]?){1,3})/);var time=0;if(timeMatch){each(timeMatch[1].split(/[hms]/),function(i,val){if(val!==""){time=time*60+Number(val)}})}if(idMatch&&/^[a-zA-Z0-9_\-]{11}$/.test(idMatch[1])){callback(idMatch[1],time)}editor.closeDropDown(true);e.preventDefault()});editor.createDropDown(caller,"insertlink",content)},exec:function(btn){var editor=this;defaultCmds.youtube._dropDown(editor,btn,function(id,time){editor.wysiwygEditorInsertHtml(_tmpl("youtube",{id:id,time:time}))})},tooltip:"Insert a YouTube video"},date:{_date:function(editor){var now=new Date,year=now.getYear(),month=now.getMonth()+1,day=now.getDate();if(year<2e3){year=1900+year}if(month<10){month="0"+month}if(day<10){day="0"+day}return editor.opts.dateFormat.replace(/year/i,year).replace(/month/i,month).replace(/day/i,day)},exec:function(){this.insertText(defaultCmds.date._date(this))},txtExec:function(){this.insertText(defaultCmds.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var now=new Date,hours=now.getHours(),mins=now.getMinutes(),secs=now.getSeconds();if(hours<10){hours="0"+hours}if(mins<10){mins="0"+mins}if(secs<10){secs="0"+secs}return hours+":"+mins+":"+secs},exec:function(){this.insertText(defaultCmds.time._time())},txtExec:function(){this.insertText(defaultCmds.time._time())},tooltip:"Insert current time"},ltr:{state:function(parents$$1,firstBlock){return firstBlock&&firstBlock.style.direction==="ltr"},exec:function(){var editor=this,rangeHelper=editor.getRangeHelper(),node=rangeHelper.getFirstBlockParent();editor.focus();if(!node||is(node,"body")){editor.execCommand("formatBlock","p");node=rangeHelper.getFirstBlockParent();if(!node||is(node,"body")){return}}var toggleValue=css(node,"direction")==="ltr"?"":"ltr";css(node,"direction",toggleValue)},tooltip:"Left-to-Right"},rtl:{state:function(parents$$1,firstBlock){return firstBlock&&firstBlock.style.direction==="rtl"},exec:function(){var editor=this,rangeHelper=editor.getRangeHelper(),node=rangeHelper.getFirstBlockParent();editor.focus();if(!node||is(node,"body")){editor.execCommand("formatBlock","p");node=rangeHelper.getFirstBlockParent();if(!node||is(node,"body")){return}}var toggleValue=css(node,"direction")==="rtl"?"":"rtl";css(node,"direction",toggleValue)},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize())},txtExec:function(){this.maximize(!this.maximize())},tooltip:"Maximize",shortcut:"Ctrl+Shift+M"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode()},txtExec:function(){this.toggleSourceMode()},tooltip:"View source",shortcut:"Ctrl+Shift+S"},ignore:{}};var plugins={};function PluginManager(thisObj){var base=this;var registeredPlugins=[];var formatSignalName=function(signal){return"signal"+signal.charAt(0).toUpperCase()+signal.slice(1)};var callHandlers=function(args,returnAtFirst){args=[].slice.call(args);var idx,ret,signal=formatSignalName(args.shift());for(idx=0;idx<registeredPlugins.length;idx++){if(signal in registeredPlugins[idx]){ret=registeredPlugins[idx][signal].apply(thisObj,args);if(returnAtFirst){return ret}}}};base.call=function(){callHandlers(arguments,false)};base.callOnlyFirst=function(){return callHandlers(arguments,true)};base.hasHandler=function(signal){var i=registeredPlugins.length;signal=formatSignalName(signal);while(i--){if(signal in registeredPlugins[i]){return true}}return false};base.exists=function(plugin){if(plugin in plugins){plugin=plugins[plugin];return typeof plugin==="function"&&typeof plugin.prototype==="object"}return false};base.isRegistered=function(plugin){if(base.exists(plugin)){var idx=registeredPlugins.length;while(idx--){if(registeredPlugins[idx]instanceof plugins[plugin]){return true}}}return false};base.register=function(plugin){if(!base.exists(plugin)||base.isRegistered(plugin)){return false}plugin=new plugins[plugin];registeredPlugins.push(plugin);if("init"in plugin){plugin.init.call(thisObj)}return true};base.deregister=function(plugin){var removedPlugin,pluginIdx=registeredPlugins.length,removed=false;if(!base.isRegistered(plugin)){return removed}while(pluginIdx--){if(registeredPlugins[pluginIdx]instanceof plugins[plugin]){removedPlugin=registeredPlugins.splice(pluginIdx,1)[0];removed=true;if("destroy"in removedPlugin){removedPlugin.destroy.call(thisObj)}}}return removed};base.destroy=function(){var i=registeredPlugins.length;while(i--){if("destroy"in registeredPlugins[i]){registeredPlugins[i].destroy.call(thisObj)}}registeredPlugins=[];thisObj=null}}PluginManager.plugins=plugins;var IE_BR_FIX$1=ie&&ie<11;var outerText=function(range,isLeft,length){var nodeValue,remaining,start,end,node,text="",next=range.startContainer,offset=range.startOffset;if(next&&next.nodeType!==3){next=next.childNodes[offset];offset=0}start=end=offset;while(length>text.length&&next&&next.nodeType===3){nodeValue=next.nodeValue;remaining=length-text.length;if(node){end=nodeValue.length;start=0}node=next;if(isLeft){start=Math.max(end-remaining,0);offset=start;text=nodeValue.substr(start,end-start)+text;next=node.previousSibling}else{end=Math.min(remaining,nodeValue.length);offset=start+end;text+=nodeValue.substr(start,end);next=node.nextSibling}}return{node:node||next,offset:offset,text:text}};function RangeHelper(win,d){var _createMarker,_prepareInput,doc=d||win.contentDocument||win.document,startMarker="sceditor-start-marker",endMarker="sceditor-end-marker",base=this;base.insertHTML=function(html,endHTML){var node,div,range=base.selectedRange();if(!range){return false}if(endHTML){html+=base.selectedHtml()+endHTML}div=createElement("p",{},doc);node=doc.createDocumentFragment();div.innerHTML=html;while(div.firstChild){appendChild(node,div.firstChild)}base.insertNode(node)};_prepareInput=function(node,endNode,returnHtml){var lastChild,frag=doc.createDocumentFragment();if(typeof node==="string"){if(endNode){node+=base.selectedHtml()+endNode}frag=parseHTML(node)}else{appendChild(frag,node);if(endNode){appendChild(frag,base.selectedRange().extractContents());appendChild(frag,endNode)}}if(!(lastChild=frag.lastChild)){return}while(!isInline(lastChild.lastChild,true)){lastChild=lastChild.lastChild}if(canHaveChildren(lastChild)){if(!lastChild.lastChild){appendChild(lastChild,document.createTextNode("​"))}}else{lastChild=frag}base.removeMarkers();appendChild(lastChild,_createMarker(startMarker));appendChild(lastChild,_createMarker(endMarker));if(returnHtml){var div=createElement("div");appendChild(div,frag);return div.innerHTML}return frag};base.insertNode=function(node,endNode){var input=_prepareInput(node,endNode),range=base.selectedRange(),parent$$1=range.commonAncestorContainer;if(!input){return false}range.deleteContents();if(parent$$1&&parent$$1.nodeType!==3&&!canHaveChildren(parent$$1)){insertBefore(input,parent$$1)}else{range.insertNode(input)}base.restoreRange()};base.cloneSelected=function(){var range=base.selectedRange();if(range){return range.cloneRange()}};base.selectedRange=function(){var range,firstChild,sel=win.getSelection();if(!sel){return}if(sel.rangeCount<=0){firstChild=doc.body;while(firstChild.firstChild){firstChild=firstChild.firstChild}range=doc.createRange();range.setStartBefore(firstChild);sel.addRange(range)}if(sel.rangeCount>0){range=sel.getRangeAt(0)}return range};base.hasSelection=function(){var sel=win.getSelection();return sel&&sel.rangeCount>0};base.selectedHtml=function(){var div,range=base.selectedRange();if(range){div=createElement("p",{},doc);appendChild(div,range.cloneContents());return div.innerHTML}return""};base.parentNode=function(){var range=base.selectedRange();if(range){return range.commonAncestorContainer}};base.getFirstBlockParent=function(node){var func=function(elm){if(!isInline(elm,true)){return elm}elm=elm?elm.parentNode:null;return elm?func(elm):elm};return func(node||base.parentNode())};base.insertNodeAt=function(start,node){var currentRange=base.selectedRange(),range=base.cloneSelected();if(!range){return false}range.collapse(start);range.insertNode(node);base.selectRange(currentRange)};_createMarker=function(id){base.removeMarker(id);var marker=createElement("span",{id:id,className:"sceditor-selection sceditor-ignore",style:"display:none;line-height:0"},doc);marker.innerHTML=" ";return marker};base.insertMarkers=function(){var currentRange=base.selectedRange();var startNode=_createMarker(startMarker);base.removeMarkers();base.insertNodeAt(true,startNode);if(currentRange&¤tRange.collapsed){startNode.parentNode.insertBefore(_createMarker(endMarker),startNode.nextSibling)}else{base.insertNodeAt(false,_createMarker(endMarker))}};base.getMarker=function(id){return doc.getElementById(id)};base.removeMarker=function(id){var marker=base.getMarker(id);if(marker){remove(marker)}};base.removeMarkers=function(){base.removeMarker(startMarker);base.removeMarker(endMarker)};base.saveRange=function(){base.insertMarkers()};base.selectRange=function(range){var lastChild;var sel=win.getSelection();var container=range.endContainer;if(!IE_BR_FIX$1&&range.collapsed&&container&&!isInline(container,true)){lastChild=container.lastChild;while(lastChild&&is(lastChild,".sceditor-ignore")){lastChild=lastChild.previousSibling}if(is(lastChild,"br")){var rng=doc.createRange();rng.setEndAfter(lastChild);rng.collapse(false);if(base.compare(range,rng)){range.setStartBefore(lastChild);range.collapse(true)}}}if(sel){base.clear();sel.addRange(range)}};base.restoreRange=function(){var isCollapsed,range=base.selectedRange(),start=base.getMarker(startMarker),end=base.getMarker(endMarker);if(!start||!end||!range){return false}isCollapsed=start.nextSibling===end;range=doc.createRange();range.setStartBefore(start);range.setEndAfter(end);if(isCollapsed){range.collapse(true)}base.selectRange(range);base.removeMarkers()};base.selectOuterText=function(left,right){var start,end,range=base.cloneSelected();if(!range){return false}range.collapse(false);start=outerText(range,true,left);end=outerText(range,false,right);range.setStart(start.node,start.offset);range.setEnd(end.node,end.offset);base.selectRange(range)};base.getOuterText=function(before,length){var range=base.cloneSelected();if(!range){return""}range.collapse(!before);return outerText(range,before,length).text};base.replaceKeyword=function(keywords,includeAfter,keywordsSorted,longestKeyword,requireWhitespace,keypressChar){if(!keywordsSorted){keywords.sort(function(a,b){return a[0].length-b[0].length})}var outerText,match,matchPos,startIndex,leftLen,charsLeft,keyword,keywordLen,whitespaceRegex="(^|[\\s    ])",keywordIdx=keywords.length,whitespaceLen=requireWhitespace?1:0,maxKeyLen=longestKeyword||keywords[keywordIdx-1][0].length;if(requireWhitespace){maxKeyLen++}keypressChar=keypressChar||"";outerText=base.getOuterText(true,maxKeyLen);leftLen=outerText.length;outerText+=keypressChar;if(includeAfter){outerText+=base.getOuterText(false,maxKeyLen)}while(keywordIdx--){keyword=keywords[keywordIdx][0];keywordLen=keyword.length;startIndex=Math.max(0,leftLen-keywordLen-whitespaceLen);matchPos=-1;if(requireWhitespace){match=outerText.substr(startIndex).match(new RegExp(whitespaceRegex+regex(keyword)+whitespaceRegex));if(match){matchPos=match.index+startIndex+match[1].length}}else{matchPos=outerText.indexOf(keyword,startIndex)}if(matchPos>-1){if(matchPos<=leftLen&&matchPos+keywordLen+whitespaceLen>=leftLen){charsLeft=leftLen-matchPos;base.selectOuterText(charsLeft,keywordLen-charsLeft-(/^\S/.test(keypressChar)?1:0));base.insertHTML(keywords[keywordIdx][1]);return true}}}return false};base.compare=function(rngA,rngB){if(!rngB){rngB=base.selectedRange()}if(!rngA||!rngB){return!rngA&&!rngB}return rngA.compareBoundaryPoints(Range.END_TO_END,rngB)===0&&rngA.compareBoundaryPoints(Range.START_TO_START,rngB)===0};base.clear=function(){var sel=win.getSelection();if(sel){if(sel.removeAllRanges){sel.removeAllRanges()}else if(sel.empty){sel.empty()}}}}function checkWhitespace(node,rangeHelper){var noneWsRegex=/[^\s\xA0\u2002\u2003\u2009\u00a0]+/;var emoticons=node&&find(node,"img[data-sceditor-emoticon]");if(!node||!emoticons.length){return}for(var i=0;i<emoticons.length;i++){var emoticon=emoticons[i];var parent$$1=emoticon.parentNode;var prev=emoticon.previousSibling;var next=emoticon.nextSibling;if((!prev||!noneWsRegex.test(prev.nodeValue.slice(-1)))&&(!next||!noneWsRegex.test((next.nodeValue||"")[0]))){continue}var range=rangeHelper.cloneSelected();var rangeStart=-1;var rangeStartContainer=range.startContainer;var previousText=prev.nodeValue;if(previousText===null){previousText=prev.innerText||""}previousText+=data(emoticon,"sceditor-emoticon");if(rangeStartContainer===next){rangeStart=previousText.length+range.startOffset}if(rangeStartContainer===node&&node.childNodes[range.startOffset]===next){rangeStart=previousText.length}if(rangeStartContainer===prev){rangeStart=range.startOffset}if(!next||next.nodeType!==TEXT_NODE){next=parent$$1.insertBefore(parent$$1.ownerDocument.createTextNode(""),next)}next.insertData(0,previousText);remove(prev);remove(emoticon);if(rangeStart>-1){range.setStart(next,rangeStart);range.collapse(true);rangeHelper.selectRange(range)}}}function replace(root,emoticons,emoticonsCompat){var doc=root.ownerDocument;var space="(^|\\s| | | | |$)";var emoticonCodes=[];var emoticonRegex={};if(parent(root,"code")){return}each(emoticons,function(key){emoticonRegex[key]=new RegExp(space+regex(key)+space);emoticonCodes.push(key)});emoticonCodes.sort(function(a,b){return b.length-a.length});(function convert(node){node=node.firstChild;while(node){if(node.nodeType===ELEMENT_NODE&&!is(node,"code")){convert(node)}if(node.nodeType===TEXT_NODE){for(var i=0;i<emoticonCodes.length;i++){var text=node.nodeValue;var key=emoticonCodes[i];var index=emoticonsCompat?text.search(emoticonRegex[key]):text.indexOf(key);if(index>-1){var startIndex=text.indexOf(key,index);var fragment=parseHTML(emoticons[key],doc);var after=text.substr(startIndex+key.length);fragment.appendChild(doc.createTextNode(after));node.nodeValue=text.substr(0,startIndex);node.parentNode.insertBefore(fragment,node.nextSibling)}}}node=node.nextSibling}})(root)}var globalWin=window;var globalDoc=document;var IE_VER=ie;var IE_BR_FIX$2=IE_VER&&IE_VER<11;var IMAGE_MIME_REGEX=/^image\/(p?jpe?g|gif|png|bmp)$/i;function wrapInlines(body,doc){var wrapper;traverse(body,function(node){if(isInline(node,true)){if(!wrapper){wrapper=createElement("p",{},doc);insertBefore(wrapper,node)}if(node.nodeType!==TEXT_NODE||node.nodeValue!==""){appendChild(wrapper,node)}}else{wrapper=null}},false,true)}function SCEditor(original,userOptions){var base=this;var format;var editorContainer;var eventHandlers={};var toolbar;var wysiwygEditor;var wysiwygWindow;var wysiwygBody;var wysiwygDocument;var sourceEditor;var dropdown;var lastRange;var isComposing;var valueChangedKeyUpTimer;var locale;var preLoadCache=[];var rangeHelper;var btnStateHandlers=[];var pluginManager;var currentNode;var currentBlockNode;var currentSelection;var isSelectionCheckPending;var isRequired;var inlineCss;var shortcutHandlers={};var autoExpandBounds;var autoExpandThrottle;var toolbarButtons={};var maximizeScrollPosition;var pasteContentFragment;var allEmoticons={};var icons;var init,replaceEmoticons,handleCommand,saveRange,initEditor,initPlugins,initLocale,initToolBar,initOptions,initEvents,initResize,initEmoticons,handlePasteEvt,handlePasteData,handleKeyDown,handleBackSpace,handleKeyPress,handleFormReset,handleMouseDown,handleComposition,handleEvent,handleDocumentClick,updateToolBar,updateActiveButtons,sourceEditorSelectedText,appendNewLine,checkSelectionChanged,checkNodeChanged,autofocus,emoticonsKeyPress,emoticonsCheckWhitespace,currentStyledBlockNode,triggerValueChanged,valueChangedBlur,valueChangedKeyUp,autoUpdate,autoExpand;base.commands=extend(true,{},userOptions.commands||defaultCmds);var options=base.opts=extend(true,{},defaultOptions,userOptions);base.opts.emoticons=userOptions.emoticons||defaultOptions.emoticons;init=function(){original._sceditor=base;if(options.locale&&options.locale!=="en"){initLocale()}editorContainer=createElement("div",{className:"sceditor-container"});insertBefore(editorContainer,original);css(editorContainer,"z-index",options.zIndex);if(IE_VER){addClass(editorContainer,"ie ie"+IE_VER)}isRequired=original.required;original.required=false;var FormatCtor=SCEditor.formats[options.format];format=FormatCtor?new FormatCtor:{};if("init"in format){format.init.call(base)}initPlugins();initEmoticons();initToolBar();initEditor();initOptions();initEvents();if(!isWysiwygSupported){base.toggleSourceMode()}updateActiveButtons();var loaded=function(){off(globalWin,"load",loaded);if(options.autofocus){autofocus()}autoExpand();appendNewLine();pluginManager.call("ready");if("onReady"in format){format.onReady.call(base)}};on(globalWin,"load",loaded);if(globalDoc.readyState==="complete"){loaded()}};initPlugins=function(){var plugins=options.plugins;plugins=plugins?plugins.toString().split(","):[];pluginManager=new PluginManager(base);plugins.forEach(function(plugin){pluginManager.register(plugin.trim())})};initLocale=function(){var lang;locale=SCEditor.locale[options.locale];if(!locale){lang=options.locale.split("-");locale=SCEditor.locale[lang[0]]}if(locale&&locale.dateFormat){options.dateFormat=locale.dateFormat}};initEditor=function(){sourceEditor=createElement("textarea");wysiwygEditor=createElement("iframe",{frameborder:0,allowfullscreen:true});if(options.startInSourceMode){addClass(editorContainer,"sourceMode");hide(wysiwygEditor)}else{addClass(editorContainer,"wysiwygMode");hide(sourceEditor)}if(!options.spellcheck){attr(editorContainer,"spellcheck","false")}if(globalWin.location.protocol==="https:"){attr(wysiwygEditor,"src","javascript:false")}appendChild(editorContainer,wysiwygEditor);appendChild(editorContainer,sourceEditor);base.dimensions(options.width||width(original),options.height||height(original));var className=IE_VER?"ie ie"+IE_VER:"";className+=ios?" ios":"";wysiwygDocument=wysiwygEditor.contentDocument;wysiwygDocument.open();wysiwygDocument.write(_tmpl("html",{attrs:' class="'+className+'"',spellcheck:options.spellcheck?"":'spellcheck="false"',charset:options.charset,style:options.style}));wysiwygDocument.close();wysiwygBody=wysiwygDocument.body;wysiwygWindow=wysiwygEditor.contentWindow;base.readOnly(!!options.readOnly);if(ios||edge||IE_VER){height(wysiwygBody,"100%");if(!IE_VER){on(wysiwygBody,"touchend",base.focus)}}var tabIndex=attr(original,"tabindex");attr(sourceEditor,"tabindex",tabIndex);attr(wysiwygEditor,"tabindex",tabIndex);rangeHelper=new RangeHelper(wysiwygWindow);hide(original);base.val(original.value);var placeholder=options.placeholder||attr(original,"placeholder");if(placeholder){sourceEditor.placeholder=placeholder;attr(wysiwygBody,"placeholder",placeholder)}};initOptions=function(){if(options.autoUpdate){on(wysiwygBody,"blur",autoUpdate);on(sourceEditor,"blur",autoUpdate)}if(options.rtl===null){options.rtl=css(sourceEditor,"direction")==="rtl"}base.rtl(!!options.rtl);if(options.autoExpand){on(wysiwygBody,"load",autoExpand,EVENT_CAPTURE);on(wysiwygBody,"input keyup",autoExpand)}if(options.resizeEnabled){initResize()}attr(editorContainer,"id",options.id);base.emoticons(options.emoticonsEnabled)};initEvents=function(){var form=original.form;var compositionEvents="compositionstart compositionend";var eventsToForward="keydown keyup keypress focus blur contextmenu";var checkSelectionEvents="onselectionchange"in wysiwygDocument?"selectionchange":"keyup focus blur contextmenu mouseup touchend click";on(globalDoc,"click",handleDocumentClick);if(form){on(form,"reset",handleFormReset);on(form,"submit",base.updateOriginal,EVENT_CAPTURE)}on(wysiwygBody,"keypress",handleKeyPress);on(wysiwygBody,"keydown",handleKeyDown);on(wysiwygBody,"keydown",handleBackSpace);on(wysiwygBody,"keyup",appendNewLine);on(wysiwygBody,"blur",valueChangedBlur);on(wysiwygBody,"keyup",valueChangedKeyUp);on(wysiwygBody,"paste",handlePasteEvt);on(wysiwygBody,compositionEvents,handleComposition);on(wysiwygBody,checkSelectionEvents,checkSelectionChanged);on(wysiwygBody,eventsToForward,handleEvent);if(options.emoticonsCompat&&globalWin.getSelection){on(wysiwygBody,"keyup",emoticonsCheckWhitespace)}on(wysiwygBody,"blur",function(){if(!base.val()){addClass(wysiwygBody,"placeholder")}});on(wysiwygBody,"focus",function(){removeClass(wysiwygBody,"placeholder")});on(sourceEditor,"blur",valueChangedBlur);on(sourceEditor,"keyup",valueChangedKeyUp);on(sourceEditor,"keydown",handleKeyDown);on(sourceEditor,compositionEvents,handleComposition);on(sourceEditor,eventsToForward,handleEvent);on(wysiwygDocument,"mousedown",handleMouseDown);on(wysiwygDocument,checkSelectionEvents,checkSelectionChanged);on(wysiwygDocument,"beforedeactivate keyup mouseup",saveRange);on(wysiwygDocument,"keyup",appendNewLine);on(wysiwygDocument,"focus",function(){lastRange=null});on(editorContainer,"selectionchanged",checkNodeChanged);on(editorContainer,"selectionchanged",updateActiveButtons);on(editorContainer,"selectionchanged valuechanged nodechanged pasteraw paste",handleEvent)};initToolBar=function(){var group,commands=base.commands,exclude=(options.toolbarExclude||"").split(","),groups=options.toolbar.split("|");toolbar=createElement("div",{className:"sceditor-toolbar",unselectable:"on"});if(options.icons in SCEditor.icons){icons=new SCEditor.icons[options.icons]}each(groups,function(_,menuItems){group=createElement("div",{className:"sceditor-group"});each(menuItems.split(","),function(_,commandName){var button,shortcut,command=commands[commandName];if(!command||exclude.indexOf(commandName)>-1){return}shortcut=command.shortcut;button=_tmpl("toolbarButton",{name:commandName,dispName:base._(command.name||command.tooltip||commandName)},true).firstChild;if(icons&&icons.create){var icon=icons.create(commandName);if(icon){insertBefore(icons.create(commandName),button.firstChild);addClass(button,"has-icon")}}button._sceTxtMode=!!command.txtExec;button._sceWysiwygMode=!!command.exec;toggleClass(button,"disabled",!command.exec);on(button,"click",function(e){if(!hasClass(button,"disabled")){handleCommand(button,command)}updateActiveButtons();e.preventDefault()});on(button,"mousedown",function(e){base.closeDropDown();e.preventDefault()});if(command.tooltip){attr(button,"title",base._(command.tooltip)+(shortcut?" ("+shortcut+")":""))}if(shortcut){base.addShortcut(shortcut,commandName)}if(command.state){btnStateHandlers.push({name:commandName,state:command.state})}else if(isString(command.exec)){btnStateHandlers.push({name:commandName,state:command.exec})}appendChild(group,button);toolbarButtons[commandName]=button});if(group.firstChild){appendChild(toolbar,group)}});appendChild(options.toolbarContainer||editorContainer,toolbar)};initResize=function(){var minHeight,maxHeight,minWidth,maxWidth,mouseMoveFunc,mouseUpFunc,grip=createElement("div",{className:"sceditor-grip"}),cover=createElement("div",{className:"sceditor-resize-cover"}),moveEvents="touchmove mousemove",endEvents="touchcancel touchend mouseup",startX=0,startY=0,newX=0,newY=0,startWidth=0,startHeight=0,origWidth=width(editorContainer),origHeight=height(editorContainer),isDragging=false,rtl=base.rtl();minHeight=options.resizeMinHeight||origHeight/1.5;maxHeight=options.resizeMaxHeight||origHeight*2.5;minWidth=options.resizeMinWidth||origWidth/1.25;maxWidth=options.resizeMaxWidth||origWidth*1.25;mouseMoveFunc=function(e){if(e.type==="touchmove"){e=globalWin.event;newX=e.changedTouches[0].pageX;newY=e.changedTouches[0].pageY}else{newX=e.pageX;newY=e.pageY}var newHeight=startHeight+(newY-startY),newWidth=rtl?startWidth-(newX-startX):startWidth+(newX-startX);if(maxWidth>0&&newWidth>maxWidth){newWidth=maxWidth}if(minWidth>0&&newWidth<minWidth){newWidth=minWidth}if(!options.resizeWidth){newWidth=false}if(maxHeight>0&&newHeight>maxHeight){newHeight=maxHeight}if(minHeight>0&&newHeight<minHeight){newHeight=minHeight}if(!options.resizeHeight){newHeight=false}if(newWidth||newHeight){base.dimensions(newWidth,newHeight)}e.preventDefault()};mouseUpFunc=function(e){if(!isDragging){return}isDragging=false;hide(cover);removeClass(editorContainer,"resizing");off(globalDoc,moveEvents,mouseMoveFunc);off(globalDoc,endEvents,mouseUpFunc);e.preventDefault()};if(icons&&icons.create){var icon=icons.create("grip");if(icon){appendChild(grip,icon);addClass(grip,"has-icon")}}appendChild(editorContainer,grip);appendChild(editorContainer,cover);hide(cover);on(grip,"touchstart mousedown",function(e){if(e.type==="touchstart"){e=globalWin.event;startX=e.touches[0].pageX;startY=e.touches[0].pageY}else{startX=e.pageX;startY=e.pageY}startWidth=width(editorContainer);startHeight=height(editorContainer);isDragging=true;addClass(editorContainer,"resizing");show(cover);on(globalDoc,moveEvents,mouseMoveFunc);on(globalDoc,endEvents,mouseUpFunc);e.preventDefault()})};initEmoticons=function(){var emoticons=options.emoticons;var root=options.emoticonsRoot||"";if(emoticons){allEmoticons=extend({},emoticons.more,emoticons.dropdown,emoticons.hidden)}each(allEmoticons,function(key,url){allEmoticons[key]=_tmpl("emoticon",{key:key,url:root+(url.url||url),tooltip:url.tooltip||key});if(options.emoticonsEnabled){preLoadCache.push(createElement("img",{src:root+(url.url||url)}))}})};autofocus=function(){var range,txtPos,node=wysiwygBody.firstChild,focusEnd=!!options.autofocusEnd;if(!isVisible(editorContainer)){return}if(base.sourceMode()){txtPos=focusEnd?sourceEditor.value.length:0;sourceEditor.setSelectionRange(txtPos,txtPos);return}removeWhiteSpace(wysiwygBody);if(focusEnd){if(!(node=wysiwygBody.lastChild)){node=createElement("p",{},wysiwygDocument);appendChild(wysiwygBody,node)}while(node.lastChild){node=node.lastChild;if(!IE_BR_FIX$2&&is(node,"br")&&node.previousSibling){node=node.previousSibling}}}range=wysiwygDocument.createRange();if(!canHaveChildren(node)){range.setStartBefore(node);if(focusEnd){range.setStartAfter(node)}}else{range.selectNodeContents(node)}range.collapse(!focusEnd);rangeHelper.selectRange(range);currentSelection=range;if(focusEnd){wysiwygBody.scrollTop=wysiwygBody.scrollHeight}base.focus()};base.readOnly=function(readOnly){if(typeof readOnly!=="boolean"){return!sourceEditor.readonly}wysiwygBody.contentEditable=!readOnly;sourceEditor.readonly=!readOnly;updateToolBar(readOnly);return base};base.rtl=function(rtl){var dir=rtl?"rtl":"ltr";if(typeof rtl!=="boolean"){return attr(sourceEditor,"dir")==="rtl"}attr(wysiwygBody,"dir",dir);attr(sourceEditor,"dir",dir);removeClass(editorContainer,"rtl");removeClass(editorContainer,"ltr");addClass(editorContainer,dir);if(icons&&icons.rtl){icons.rtl(rtl)}return base};updateToolBar=function(disable){var mode=base.inSourceMode()?"_sceTxtMode":"_sceWysiwygMode";each(toolbarButtons,function(_,button){toggleClass(button,"disabled",disable||!button[mode])})};base.width=function(width$$1,saveWidth){if(!width$$1&&width$$1!==0){return width(editorContainer)}base.dimensions(width$$1,null,saveWidth);return base};base.dimensions=function(width$$1,height$$1,save){width$$1=!width$$1&&width$$1!==0?false:width$$1;height$$1=!height$$1&&height$$1!==0?false:height$$1;if(width$$1===false&&height$$1===false){return{width:base.width(),height:base.height()}}if(width$$1!==false){if(save!==false){options.width=width$$1}width(editorContainer,width$$1)}if(height$$1!==false){if(save!==false){options.height=height$$1}height(editorContainer,height$$1)}return base};base.height=function(height$$1,saveHeight){if(!height$$1&&height$$1!==0){return height(editorContainer)}base.dimensions(null,height$$1,saveHeight);return base};base.maximize=function(maximize){var maximizeSize="sceditor-maximize";if(isUndefined(maximize)){return hasClass(editorContainer,maximizeSize)}maximize=!!maximize;if(maximize){maximizeScrollPosition=globalWin.pageYOffset}toggleClass(globalDoc.documentElement,maximizeSize,maximize);toggleClass(globalDoc.body,maximizeSize,maximize);toggleClass(editorContainer,maximizeSize,maximize);base.width(maximize?"100%":options.width,false);base.height(maximize?"100%":options.height,false);if(!maximize){globalWin.scrollTo(0,maximizeScrollPosition)}autoExpand();return base};autoExpand=function(){if(options.autoExpand&&!autoExpandThrottle){autoExpandThrottle=setTimeout(base.expandToContent,200)}};base.expandToContent=function(ignoreMaxHeight){if(base.maximize()){return}clearTimeout(autoExpandThrottle);autoExpandThrottle=false;if(!autoExpandBounds){var height$$1=options.resizeMinHeight||options.height||height(original);autoExpandBounds={min:height$$1,max:options.resizeMaxHeight||height$$1*2}}var range=globalDoc.createRange();range.selectNodeContents(wysiwygBody);var rect=range.getBoundingClientRect();var current=wysiwygDocument.documentElement.clientHeight-1;var spaceNeeded=rect.bottom-rect.top;var newHeight=base.height()+1+(spaceNeeded-current);if(!ignoreMaxHeight&&autoExpandBounds.max!==-1){newHeight=Math.min(newHeight,autoExpandBounds.max)}base.height(Math.ceil(Math.max(newHeight,autoExpandBounds.min)))};base.destroy=function(){if(!pluginManager){return}pluginManager.destroy();rangeHelper=null;lastRange=null;pluginManager=null;if(dropdown){remove(dropdown)}off(globalDoc,"click",handleDocumentClick);var form=original.form;if(form){off(form,"reset",handleFormReset);off(form,"submit",base.updateOriginal)}remove(sourceEditor);remove(toolbar);remove(editorContainer);delete original._sceditor;show(original);original.required=isRequired};base.createDropDown=function(menuItem,name,content,ieFix){var dropDownCss,dropDownClass="sceditor-"+name;base.closeDropDown(true);if(dropdown&&hasClass(dropdown,dropDownClass)){return}if(ieFix!==false){each(find(content,":not(input):not(textarea)"),function(_,node){if(node.nodeType===ELEMENT_NODE){attr(node,"unselectable","on")}})}dropDownCss=extend({top:menuItem.offsetTop,left:menuItem.offsetLeft,marginTop:menuItem.clientHeight},options.dropDownCss);dropdown=createElement("div",{className:"sceditor-dropdown "+dropDownClass});css(dropdown,dropDownCss);appendChild(dropdown,content);appendChild(editorContainer,dropdown);on(dropdown,"click focusin",function(e){e.stopPropagation()});setTimeout(function(){if(dropdown){var first=find(dropdown,"input,textarea")[0];if(first){first.focus()}}})};handleDocumentClick=function(e){if(e.which!==3&&dropdown&&!e.defaultPrevented){autoUpdate();base.closeDropDown()}};handlePasteEvt=function(e){var isIeOrEdge=IE_VER||edge;var editable=wysiwygBody;var clipboard=e.clipboardData;var loadImage=function(file){var reader=new FileReader;reader.onload=function(e){handlePasteData({html:'<img src="'+e.target.result+'" />'})};reader.readAsDataURL(file)};if(clipboard&&!isIeOrEdge){var data$$1={};var types=clipboard.types;var items=clipboard.items;e.preventDefault();for(var i=0;i<types.length;i++){if(globalWin.FileReader&&items&&IMAGE_MIME_REGEX.test(items[i].type)){return loadImage(clipboard.items[i].getAsFile())}data$$1[types[i]]=clipboard.getData(types[i])}data$$1.text=data$$1["text/plain"];data$$1.html=data$$1["text/html"];handlePasteData(data$$1)}else if(!pasteContentFragment){var scrollTop=editable.scrollTop;rangeHelper.saveRange();pasteContentFragment=globalDoc.createDocumentFragment();while(editable.firstChild){appendChild(pasteContentFragment,editable.firstChild)}setTimeout(function(){var html=editable.innerHTML;editable.innerHTML="";appendChild(editable,pasteContentFragment);editable.scrollTop=scrollTop;pasteContentFragment=false;rangeHelper.restoreRange();handlePasteData({html:html})},0)}};handlePasteData=function(data$$1){var pasteArea=createElement("div",{},wysiwygDocument);pluginManager.call("pasteRaw",data$$1);trigger(editorContainer,"pasteraw",data$$1);if(data$$1.html){pasteArea.innerHTML=data$$1.html;fixNesting(pasteArea)}else{pasteArea.innerHTML=entities(data$$1.text||"")}var paste={val:pasteArea.innerHTML};if("fragmentToSource"in format){paste.val=format.fragmentToSource(paste.val,wysiwygDocument,currentNode)}pluginManager.call("paste",paste);trigger(editorContainer,"paste",paste);if("fragmentToHtml"in format){paste.val=format.fragmentToHtml(paste.val,currentNode)}pluginManager.call("pasteHtml",paste);base.wysiwygEditorInsertHtml(paste.val,null,true)};base.closeDropDown=function(focus){if(dropdown){remove(dropdown);dropdown=null}if(focus===true){base.focus()}};base.wysiwygEditorInsertHtml=function(html,endHtml,overrideCodeBlocking){var marker,scrollTop,scrollTo,editorHeight=height(wysiwygEditor);base.focus();if(!overrideCodeBlocking&&closest(currentBlockNode,"code")){return}rangeHelper.insertHTML(html,endHtml);rangeHelper.saveRange();replaceEmoticons();marker=find(wysiwygBody,"#sceditor-end-marker")[0];show(marker);scrollTop=wysiwygBody.scrollTop;scrollTo=getOffset(marker).top+marker.offsetHeight*1.5-editorHeight;hide(marker);if(scrollTo>scrollTop||scrollTo+editorHeight<scrollTop){wysiwygBody.scrollTop=scrollTo}triggerValueChanged(false);rangeHelper.restoreRange();appendNewLine()};base.wysiwygEditorInsertText=function(text,endText){base.wysiwygEditorInsertHtml(entities(text),entities(endText))};base.insertText=function(text,endText){if(base.inSourceMode()){base.sourceEditorInsertText(text,endText)}else{base.wysiwygEditorInsertText(text,endText)}return base};base.sourceEditorInsertText=function(text,endText){var scrollTop,currentValue,startPos=sourceEditor.selectionStart,endPos=sourceEditor.selectionEnd;scrollTop=sourceEditor.scrollTop;sourceEditor.focus();currentValue=sourceEditor.value;if(endText){text+=currentValue.substring(startPos,endPos)+endText}sourceEditor.value=currentValue.substring(0,startPos)+text+currentValue.substring(endPos,currentValue.length);sourceEditor.selectionStart=startPos+text.length-(endText?endText.length:0);sourceEditor.selectionEnd=sourceEditor.selectionStart;sourceEditor.scrollTop=scrollTop;sourceEditor.focus();triggerValueChanged()};base.getRangeHelper=function(){return rangeHelper};base.sourceEditorCaret=function(position){sourceEditor.focus();if(position){sourceEditor.selectionStart=position.start;sourceEditor.selectionEnd=position.end;return this}return{start:sourceEditor.selectionStart,end:sourceEditor.selectionEnd}};base.val=function(val,filter){if(!isString(val)){return base.inSourceMode()?base.getSourceEditorValue(false):base.getWysiwygEditorValue(filter)}if(!base.inSourceMode()){if(filter!==false&&"toHtml"in format){val=format.toHtml(val)}base.setWysiwygEditorValue(val)}else{base.setSourceEditorValue(val)}return base};base.insert=function(start,end,filter,convertEmoticons,allowMixed){if(base.inSourceMode()){base.sourceEditorInsertText(start,end);return base}if(end){var html=rangeHelper.selectedHtml();if(filter!==false&&"fragmentToSource"in format){html=format.fragmentToSource(html,wysiwygDocument,currentNode)}start+=html+end}if(filter!==false&&"fragmentToHtml"in format){start=format.fragmentToHtml(start,currentNode)}if(filter!==false&&allowMixed===true){start=start.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}base.wysiwygEditorInsertHtml(start);return base};base.getWysiwygEditorValue=function(filter){var html;var tmp=createElement("div",{},wysiwygDocument);var childNodes=wysiwygBody.childNodes;for(var i=0;i<childNodes.length;i++){appendChild(tmp,childNodes[i].cloneNode(true))}appendChild(wysiwygBody,tmp);fixNesting(tmp);remove(tmp);html=tmp.innerHTML;if(filter!==false&&format.hasOwnProperty("toSource")){html=format.toSource(html,wysiwygDocument)}return html};base.getBody=function(){return wysiwygBody};base.getContentAreaContainer=function(){return wysiwygEditor};base.getSourceEditorValue=function(filter){var val=sourceEditor.value;if(filter!==false&&"toHtml"in format){val=format.toHtml(val)}return val};base.setWysiwygEditorValue=function(value){if(!value){value="<p>"+(IE_VER?"":"<br />")+"</p>"}wysiwygBody.innerHTML=value;replaceEmoticons();appendNewLine();triggerValueChanged();autoExpand()};base.setSourceEditorValue=function(value){sourceEditor.value=value;triggerValueChanged()};base.updateOriginal=function(){original.value=base.val()};replaceEmoticons=function(){if(options.emoticonsEnabled){replace(wysiwygBody,allEmoticons,options.emoticonsCompat)}};base.inSourceMode=function(){return hasClass(editorContainer,"sourceMode")};base.sourceMode=function(enable){var inSourceMode=base.inSourceMode();if(typeof enable!=="boolean"){return inSourceMode}if(inSourceMode&&!enable||!inSourceMode&&enable){base.toggleSourceMode()}return base};base.toggleSourceMode=function(){var isInSourceMode=base.inSourceMode();if(!isWysiwygSupported&&isInSourceMode){return}if(!isInSourceMode){rangeHelper.saveRange();rangeHelper.clear()}base.blur();if(isInSourceMode){base.setWysiwygEditorValue(base.getSourceEditorValue())}else{base.setSourceEditorValue(base.getWysiwygEditorValue())}lastRange=null;toggle(sourceEditor);toggle(wysiwygEditor);toggleClass(editorContainer,"wysiwygMode",isInSourceMode);toggleClass(editorContainer,"sourceMode",!isInSourceMode);updateToolBar();updateActiveButtons()};sourceEditorSelectedText=function(){sourceEditor.focus();return sourceEditor.value.substring(sourceEditor.selectionStart,sourceEditor.selectionEnd)};handleCommand=function(caller,cmd){if(base.inSourceMode()){if(cmd.txtExec){if(Array.isArray(cmd.txtExec)){base.sourceEditorInsertText.apply(base,cmd.txtExec)}else{cmd.txtExec.call(base,caller,sourceEditorSelectedText())}}}else if(cmd.exec){if(isFunction(cmd.exec)){cmd.exec.call(base,caller)}else{base.execCommand(cmd.exec,cmd.hasOwnProperty("execParam")?cmd.execParam:null)}}};saveRange=function(){if(IE_VER){lastRange=rangeHelper.selectedRange()}};base.execCommand=function(command,param){var executed=false,commandObj=base.commands[command];base.focus();if(closest(rangeHelper.parentNode(),"code")){return}try{executed=wysiwygDocument.execCommand(command,false,param)}catch(ex){}if(!executed&&commandObj&&commandObj.errorMessage){alert(base._(commandObj.errorMessage))}updateActiveButtons()};checkSelectionChanged=function(){function check(){if(wysiwygWindow.getSelection()&&wysiwygWindow.getSelection().rangeCount<=0){currentSelection=null}else if(rangeHelper&&!rangeHelper.compare(currentSelection)){currentSelection=rangeHelper.cloneSelected();if(currentSelection&¤tSelection.collapsed){var parent$$1=currentSelection.startContainer;var offset=currentSelection.startOffset;if(offset&&parent$$1.nodeType!==TEXT_NODE){parent$$1=parent$$1.childNodes[offset]}while(parent$$1&&parent$$1.parentNode!==wysiwygBody){parent$$1=parent$$1.parentNode}if(parent$$1&&isInline(parent$$1,true)){rangeHelper.saveRange();wrapInlines(wysiwygBody,wysiwygDocument);rangeHelper.restoreRange()}}trigger(editorContainer,"selectionchanged")}isSelectionCheckPending=false}if(isSelectionCheckPending){return}isSelectionCheckPending=true;if("onselectionchange"in wysiwygDocument){check()}else{setTimeout(check,100)}};checkNodeChanged=function(){var oldNode,node=rangeHelper.parentNode();if(currentNode!==node){oldNode=currentNode;currentNode=node;currentBlockNode=rangeHelper.getFirstBlockParent(node);trigger(editorContainer,"nodechanged",{oldNode:oldNode,newNode:currentNode})}};base.currentNode=function(){return currentNode};base.currentBlockNode=function(){return currentBlockNode};updateActiveButtons=function(){var firstBlock,parent$$1;var activeClass="active";var doc=wysiwygDocument;var isSource=base.sourceMode();if(base.readOnly()){each(find(toolbar,activeClass),function(_,menuItem){removeClass(menuItem,activeClass)});return}if(!isSource){parent$$1=rangeHelper.parentNode();firstBlock=rangeHelper.getFirstBlockParent(parent$$1)}for(var j=0;j<btnStateHandlers.length;j++){var state=0;var btn=toolbarButtons[btnStateHandlers[j].name];var stateFn=btnStateHandlers[j].state;var isDisabled=isSource&&!btn._sceTxtMode||!isSource&&!btn._sceWysiwygMode;if(isString(stateFn)){if(!isSource){try{state=doc.queryCommandEnabled(stateFn)?0:-1;if(state>-1){state=doc.queryCommandState(stateFn)?1:0}}catch(ex){}}}else if(!isDisabled){state=stateFn.call(base,parent$$1,firstBlock)}toggleClass(btn,"disabled",isDisabled||state<0);toggleClass(btn,activeClass,state>0)}if(icons&&icons.update){icons.update(isSource,parent$$1,firstBlock)}};handleKeyPress=function(e){if(e.defaultPrevented){return}base.closeDropDown();if(e.which===13){var LIST_TAGS="li,ul,ol";if(!is(currentBlockNode,LIST_TAGS)&&hasStyling(currentBlockNode)){lastRange=null;var br=createElement("br",{},wysiwygDocument);rangeHelper.insertNode(br);if(!IE_BR_FIX$2){var parent$$1=br.parentNode;var lastChild=parent$$1.lastChild;if(lastChild&&lastChild.nodeType===TEXT_NODE&&lastChild.nodeValue===""){remove(lastChild);lastChild=parent$$1.lastChild}if(!isInline(parent$$1,true)&&lastChild===br&&isInline(br.previousSibling)){rangeHelper.insertHTML("<br>")}}e.preventDefault()}}};appendNewLine=function(){rTraverse(wysiwygBody,function(node){if(node.nodeType===ELEMENT_NODE&&!/inline/.test(css(node,"display"))){if(!is(node,".sceditor-nlf")&&hasStyling(node)){var paragraph=createElement("p",{},wysiwygDocument);paragraph.className="sceditor-nlf";paragraph.innerHTML=!IE_BR_FIX$2?"<br />":"";appendChild(wysiwygBody,paragraph);return false}}if(node.nodeType===3&&!/^\s*$/.test(node.nodeValue)||is(node,"br")){return false}})};handleFormReset=function(){base.val(original.value)};handleMouseDown=function(){base.closeDropDown();lastRange=null};base._=function(){var undef,args=arguments;if(locale&&locale[args[0]]){args[0]=locale[args[0]]}return args[0].replace(/\{(\d+)\}/g,function(str,p1){return args[p1-0+1]!==undef?args[p1-0+1]:"{"+p1+"}"})};handleEvent=function(e){if(pluginManager){pluginManager.call(e.type+"Event",e,base)}var name=(e.target===sourceEditor?"scesrc":"scewys")+e.type;if(eventHandlers[name]){eventHandlers[name].forEach(function(fn){fn.call(base,e)})}};base.bind=function(events,handler,excludeWysiwyg,excludeSource){events=events.split(" ");var i=events.length;while(i--){if(isFunction(handler)){var wysEvent="scewys"+events[i];var srcEvent="scesrc"+events[i];if(!excludeWysiwyg){eventHandlers[wysEvent]=eventHandlers[wysEvent]||[];eventHandlers[wysEvent].push(handler)}if(!excludeSource){eventHandlers[srcEvent]=eventHandlers[srcEvent]||[];eventHandlers[srcEvent].push(handler)}if(events[i]==="valuechanged"){triggerValueChanged.hasHandler=true}}}return base};base.unbind=function(events,handler,excludeWysiwyg,excludeSource){events=events.split(" ");var i=events.length;while(i--){if(isFunction(handler)){if(!excludeWysiwyg){arrayRemove(eventHandlers["scewys"+events[i]]||[],handler)}if(!excludeSource){arrayRemove(eventHandlers["scesrc"+events[i]]||[],handler)}}}return base};base.blur=function(handler,excludeWysiwyg,excludeSource){if(isFunction(handler)){base.bind("blur",handler,excludeWysiwyg,excludeSource)}else if(!base.sourceMode()){wysiwygBody.blur()}else{sourceEditor.blur()}return base};base.focus=function(handler,excludeWysiwyg,excludeSource){if(isFunction(handler)){base.bind("focus",handler,excludeWysiwyg,excludeSource)}else if(!base.inSourceMode()){if(find(wysiwygDocument,":focus").length){return}var container;var rng=rangeHelper.selectedRange();if(!currentSelection){autofocus()}if(!IE_BR_FIX$2&&rng&&rng.endOffset===1&&rng.collapsed){container=rng.endContainer;if(container&&container.childNodes.length===1&&is(container.firstChild,"br")){rng.setStartBefore(container.firstChild);rng.collapse(true);rangeHelper.selectRange(rng)}}wysiwygWindow.focus();wysiwygBody.focus();if(lastRange){rangeHelper.selectRange(lastRange);lastRange=null}}else{sourceEditor.focus()}updateActiveButtons();return base};base.keyDown=function(handler,excludeWysiwyg,excludeSource){return base.bind("keydown",handler,excludeWysiwyg,excludeSource)};base.keyPress=function(handler,excludeWysiwyg,excludeSource){return base.bind("keypress",handler,excludeWysiwyg,excludeSource)};base.keyUp=function(handler,excludeWysiwyg,excludeSource){return base.bind("keyup",handler,excludeWysiwyg,excludeSource)};base.nodeChanged=function(handler){return base.bind("nodechanged",handler,false,true)};base.selectionChanged=function(handler){return base.bind("selectionchanged",handler,false,true)};base.valueChanged=function(handler,excludeWysiwyg,excludeSource){return base.bind("valuechanged",handler,excludeWysiwyg,excludeSource)};emoticonsKeyPress=function(e){var replacedEmoticon,cachePos=0,emoticonsCache=base.emoticonsCache,curChar=String.fromCharCode(e.which);if(closest(currentBlockNode,"code")){return}if(!emoticonsCache){emoticonsCache=[];each(allEmoticons,function(key,html){emoticonsCache[cachePos++]=[key,html]});emoticonsCache.sort(function(a,b){return a[0].length-b[0].length});base.emoticonsCache=emoticonsCache;base.longestEmoticonCode=emoticonsCache[emoticonsCache.length-1][0].length}replacedEmoticon=rangeHelper.replaceKeyword(base.emoticonsCache,true,true,base.longestEmoticonCode,options.emoticonsCompat,curChar);if(replacedEmoticon){if(!options.emoticonsCompat||!/^\s$/.test(curChar)){e.preventDefault()}}};emoticonsCheckWhitespace=function(){checkWhitespace(currentBlockNode,rangeHelper)};base.emoticons=function(enable){if(!enable&&enable!==false){return options.emoticonsEnabled}options.emoticonsEnabled=enable;if(enable){on(wysiwygBody,"keypress",emoticonsKeyPress);if(!base.sourceMode()){rangeHelper.saveRange();replaceEmoticons();triggerValueChanged(false);rangeHelper.restoreRange()}}else{var emoticons=find(wysiwygBody,"img[data-sceditor-emoticon]");each(emoticons,function(_,img){var text=data(img,"sceditor-emoticon");var textNode=wysiwygDocument.createTextNode(text);img.parentNode.replaceChild(textNode,img)});off(wysiwygBody,"keypress",emoticonsKeyPress);triggerValueChanged()}return base};base.css=function(css$$1){if(!inlineCss){inlineCss=createElement("style",{id:"inline"},wysiwygDocument);appendChild(wysiwygDocument.head,inlineCss)}if(!isString(css$$1)){return inlineCss.styleSheet?inlineCss.styleSheet.cssText:inlineCss.innerHTML}if(inlineCss.styleSheet){inlineCss.styleSheet.cssText=css$$1}else{inlineCss.innerHTML=css$$1}return base};handleKeyDown=function(e){var shortcut=[],SHIFT_KEYS={"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|","[":"{","]":"}"},SPECIAL_KEYS={8:"backspace",9:"tab",13:"enter",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",91:"win",92:"win",93:"select",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:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},NUMPAD_SHIFT_KEYS={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},which=e.which,character=SPECIAL_KEYS[which]||String.fromCharCode(which).toLowerCase();if(e.ctrlKey||e.metaKey){shortcut.push("ctrl")}if(e.altKey){shortcut.push("alt")}if(e.shiftKey){shortcut.push("shift");if(NUMPAD_SHIFT_KEYS[which]){character=NUMPAD_SHIFT_KEYS[which]}else if(SHIFT_KEYS[character]){character=SHIFT_KEYS[character]}}if(character&&(which<16||which>18)){shortcut.push(character)}shortcut=shortcut.join("+");if(shortcutHandlers[shortcut]&&shortcutHandlers[shortcut].call(base)===false){e.stopPropagation();e.preventDefault()}};base.addShortcut=function(shortcut,cmd){shortcut=shortcut.toLowerCase();if(isString(cmd)){shortcutHandlers[shortcut]=function(){handleCommand(toolbarButtons[cmd],base.commands[cmd]);return false}}else{shortcutHandlers[shortcut]=cmd}return base};base.removeShortcut=function(shortcut){delete shortcutHandlers[shortcut.toLowerCase()];return base};handleBackSpace=function(e){var node,offset,range,parent$$1;if(options.disableBlockRemove||e.which!==8||!(range=rangeHelper.selectedRange())){return}node=range.startContainer;offset=range.startOffset;if(offset!==0||!(parent$$1=currentStyledBlockNode())||is(parent$$1,"body")){return}while(node!==parent$$1){while(node.previousSibling){node=node.previousSibling;if(node.nodeType!==TEXT_NODE||node.nodeValue){return}}if(!(node=node.parentNode)){return}}base.clearBlockFormatting(parent$$1);e.preventDefault()};currentStyledBlockNode=function(){var block=currentBlockNode;while(!hasStyling(block)||isInline(block,true)){if(!(block=block.parentNode)||is(block,"body")){return}}return block};base.clearBlockFormatting=function(block){block=block||currentStyledBlockNode();if(!block||is(block,"body")){return base}rangeHelper.saveRange();block.className="";lastRange=null;attr(block,"style","");if(!is(block,"p,div,td")){convertElement(block,"p")}rangeHelper.restoreRange();return base};triggerValueChanged=function(saveRange){if(!pluginManager||!pluginManager.hasHandler("valuechangedEvent")&&!triggerValueChanged.hasHandler){return}var currentHtml,sourceMode=base.sourceMode(),hasSelection=!sourceMode&&rangeHelper.hasSelection();isComposing=false;saveRange=saveRange!==false&&!wysiwygDocument.getElementById("sceditor-start-marker");if(valueChangedKeyUpTimer){clearTimeout(valueChangedKeyUpTimer);valueChangedKeyUpTimer=false}if(hasSelection&&saveRange){rangeHelper.saveRange()}currentHtml=sourceMode?sourceEditor.value:wysiwygBody.innerHTML;if(currentHtml!==triggerValueChanged.lastVal){triggerValueChanged.lastVal=currentHtml;trigger(editorContainer,"valuechanged",{rawValue:sourceMode?base.val():currentHtml})}if(hasSelection&&saveRange){rangeHelper.removeMarkers()}};valueChangedBlur=function(){if(valueChangedKeyUpTimer){triggerValueChanged()}};valueChangedKeyUp=function(e){var which=e.which,lastChar=valueChangedKeyUp.lastChar,lastWasSpace=lastChar===13||lastChar===32,lastWasDelete=lastChar===8||lastChar===46;valueChangedKeyUp.lastChar=which;if(isComposing){return}if(which===13||which===32){if(!lastWasSpace){triggerValueChanged()}else{valueChangedKeyUp.triggerNext=true}}else if(which===8||which===46){if(!lastWasDelete){triggerValueChanged()}else{valueChangedKeyUp.triggerNext=true}}else if(valueChangedKeyUp.triggerNext){triggerValueChanged();valueChangedKeyUp.triggerNext=false}clearTimeout(valueChangedKeyUpTimer);valueChangedKeyUpTimer=setTimeout(function(){if(!isComposing){triggerValueChanged()}},1500)};handleComposition=function(e){isComposing=/start/i.test(e.type);if(!isComposing){triggerValueChanged()}};autoUpdate=function(){base.updateOriginal()};init()}SCEditor.locale={};SCEditor.formats={};SCEditor.icons={};SCEditor.command={get:function(name){return defaultCmds[name]||null},set:function(name,cmd){if(!name||!cmd){return false}cmd=extend(defaultCmds[name]||{},cmd);cmd.remove=function(){SCEditor.command.remove(name)};defaultCmds[name]=cmd;return this},remove:function(name){if(defaultCmds[name]){delete defaultCmds[name]}return this}};window.sceditor={command:SCEditor.command,commands:defaultCmds,defaultOptions:defaultOptions,ie:ie,ios:ios,isWysiwygSupported:isWysiwygSupported,regexEscape:regex,escapeEntities:entities,escapeUriScheme:uriScheme,dom:{css:css,attr:attr,removeAttr:removeAttr,is:is,closest:closest,width:width,height:height,traverse:traverse,rTraverse:rTraverse,parseHTML:parseHTML,hasStyling:hasStyling,convertElement:convertElement,blockLevelList:blockLevelList,canHaveChildren:canHaveChildren,isInline:isInline,copyCSS:copyCSS,fixNesting:fixNesting,findCommonAncestor:findCommonAncestor,getSibling:getSibling,removeWhiteSpace:removeWhiteSpace,extractContents:extractContents,getOffset:getOffset,getStyle:getStyle,hasStyle:hasStyle},locale:SCEditor.locale,icons:SCEditor.icons,utils:{each:each,isEmptyObject:isEmptyObject,extend:extend},plugins:PluginManager.plugins,formats:SCEditor.formats,create:function(textarea,options){options=options||{};if(parent(textarea,".sceditor-container")){return}if(options.runWithoutWysiwygSupport||isWysiwygSupported){new SCEditor(textarea,options)}},instance:function(textarea){return textarea._sceditor}};$.sceditor=window.sceditor;$.fn.sceditor=function(options){var instance;var ret=[];this.each(function(){instance=this._sceditor;if(options==="state"){ret.push(!!instance)}else if(options==="instance"){ret.push(instance)}else if(!instance){$.sceditor.create(this,options)}});if(!ret.length){return this}return ret.length===1?ret[0]:ret}})(jQuery);(function(sceditor){"use strict";var escapeEntities=sceditor.escapeEntities;var escapeUriScheme=sceditor.escapeUriScheme;var dom=sceditor.dom;var utils=sceditor.utils;var css=dom.css;var attr=dom.attr;var is=dom.is;var extend=utils.extend;var each=utils.each;var IE_VER=sceditor.ie;var IE_BR_FIX=IE_VER&&IE_VER<11;var EMOTICON_DATA_ATTR="data-sceditor-emoticon";var getEditorCommand=sceditor.command.get;var QuoteType={always:1,never:2,auto:3};var defaultCommandsOverrides={bold:{txtExec:["[b]","[/b]"]},italic:{txtExec:["[i]","[/i]"]},underline:{txtExec:["[u]","[/u]"]},strike:{txtExec:["[s]","[/s]"]},subscript:{txtExec:["[sub]","[/sub]"]},superscript:{txtExec:["[sup]","[/sup]"]},left:{txtExec:["[left]","[/left]"]},center:{txtExec:["[center]","[/center]"]},right:{txtExec:["[right]","[/right]"]},justify:{txtExec:["[justify]","[/justify]"]},font:{txtExec:function(caller){var editor=this;getEditorCommand("font")._dropDown(editor,caller,function(fontName){editor.insertText("[font="+fontName+"]","[/font]")})}},size:{txtExec:function(caller){var editor=this;getEditorCommand("size")._dropDown(editor,caller,function(fontSize){editor.insertText("[size="+fontSize+"]","[/size]")})}},color:{txtExec:function(caller){var editor=this;getEditorCommand("color")._dropDown(editor,caller,function(color){editor.insertText("[color="+color+"]","[/color]")})}},bulletlist:{txtExec:function(caller,selected){var content="";each(selected.split(/\r?\n/),function(){content+=(content?"\n":"")+"[li]"+this+"[/li]"});this.insertText("[ul]\n"+content+"\n[/ul]")}},orderedlist:{txtExec:function(caller,selected){var content="";each(selected.split(/\r?\n/),function(){content+=(content?"\n":"")+"[li]"+this+"[/li]"});this.insertText("[ol]\n"+content+"\n[/ol]")}},table:{txtExec:["[table][tr][td]","[/td][/tr][/table]"]},horizontalrule:{txtExec:["[hr]"]},code:{txtExec:["[code]","[/code]"]},image:{txtExec:function(caller,selected){var editor=this;getEditorCommand("image")._dropDown(editor,caller,selected,function(url,width,height){var attrs="";if(width){attrs+=" width="+width}if(height){attrs+=" height="+height}editor.insertText("[img"+attrs+"]"+url+"[/img]")})}},email:{txtExec:function(caller,selected){var editor=this;getEditorCommand("email")._dropDown(editor,caller,function(url,text){editor.insertText("[email="+url+"]"+(text||selected||url)+"[/email]")})}},link:{txtExec:function(caller,selected){var editor=this;getEditorCommand("link")._dropDown(editor,caller,function(url,text){editor.insertText("[url="+url+"]"+(text||selected||url)+"[/url]")})}},quote:{txtExec:["[quote]","[/quote]"]},youtube:{txtExec:function(caller){var editor=this;getEditorCommand("youtube")._dropDown(editor,caller,function(id){editor.insertText("[youtube]"+id+"[/youtube]")})}},rtl:{txtExec:["[rtl]","[/rtl]"]},ltr:{txtExec:["[ltr]","[/ltr]"]}};var bbcodeHandlers={b:{tags:{b:null,strong:null},styles:{"font-weight":["bold","bolder","401","700","800","900"]},format:"[b]{0}[/b]",html:"<strong>{0}</strong>"},i:{tags:{i:null,em:null},styles:{"font-style":["italic","oblique"]},format:"[i]{0}[/i]",html:"<em>{0}</em>"},u:{tags:{u:null},styles:{"text-decoration":["underline"]},format:"[u]{0}[/u]",html:"<u>{0}</u>"},s:{tags:{s:null,strike:null},styles:{"text-decoration":["line-through"]},format:"[s]{0}[/s]",html:"<s>{0}</s>"},sub:{tags:{sub:null},format:"[sub]{0}[/sub]",html:"<sub>{0}</sub>"},sup:{tags:{sup:null},format:"[sup]{0}[/sup]",html:"<sup>{0}</sup>"},font:{tags:{font:{face:null}},styles:{"font-family":null},quoteType:QuoteType.never,format:function(element,content){var font;if(!is(element,"font")||!(font=attr(element,"face"))){font=css(element,"font-family")}return"[font="+_stripQuotes(font)+"]"+content+"[/font]"},html:'<font face="{defaultattr}">{0}</font>'},size:{tags:{font:{size:null}},styles:{"font-size":null},format:function(element,content){var fontSize=attr(element,"size"),size=2;if(!fontSize){fontSize=css(element,"fontSize")}if(fontSize.indexOf("px")>-1){fontSize=fontSize.replace("px","")-0;if(fontSize<12){size=1}if(fontSize>15){size=3}if(fontSize>17){size=4}if(fontSize>23){size=5}if(fontSize>31){size=6}if(fontSize>47){size=7}}else{size=fontSize}return"[size="+size+"]"+content+"[/size]"},html:'<font size="{defaultattr}">{!0}</font>'},color:{tags:{font:{color:null}},styles:{color:null},quoteType:QuoteType.never,format:function(elm,content){var color;if(!is(elm,"font")||!(color=attr(elm,"color"))){color=elm.style.color||css(elm,"color")}return"[color="+_normaliseColour(color)+"]"+content+"[/color]"},html:function(token,attrs,content){return'<font color="'+escapeEntities(_normaliseColour(attrs.defaultattr),true)+'">'+content+"</font>"}},ul:{tags:{ul:null},breakStart:true,isInline:false,skipLastLineBreak:true,format:"[ul]{0}[/ul]",html:"<ul>{0}</ul>"},list:{breakStart:true,isInline:false,skipLastLineBreak:true,html:"<ul>{0}</ul>"},ol:{tags:{ol:null},breakStart:true,isInline:false,skipLastLineBreak:true,format:"[ol]{0}[/ol]",html:"<ol>{0}</ol>"},li:{tags:{li:null},isInline:false,closedBy:["/ul","/ol","/list","*","li"],format:"[li]{0}[/li]",html:"<li>{0}</li>"},"*":{isInline:false,closedBy:["/ul","/ol","/list","*","li"],html:"<li>{0}</li>"},table:{tags:{table:null},isInline:false,isHtmlInline:true,skipLastLineBreak:true,format:"[table]{0}[/table]",html:"<table>{0}</table>"},tr:{tags:{tr:null},isInline:false,skipLastLineBreak:true,format:"[tr]{0}[/tr]",html:"<tr>{0}</tr>"},th:{tags:{th:null},allowsEmpty:true,isInline:false,format:"[th]{0}[/th]",html:"<th>{0}</th>"},td:{tags:{td:null},allowsEmpty:true,isInline:false,format:"[td]{0}[/td]",html:"<td>{0}</td>"},emoticon:{allowsEmpty:true,tags:{img:{src:null,"data-sceditor-emoticon":null}},format:function(element,content){return attr(element,EMOTICON_DATA_ATTR)+content},html:"{0}"},hr:{tags:{hr:null},allowsEmpty:true,isSelfClosing:true,isInline:false,format:"[hr]{0}",html:"<hr />"},img:{allowsEmpty:true,tags:{img:{src:null}},allowedChildren:["#"],quoteType:QuoteType.never,format:function(element,content){var width,height,attribs="",style=function(name){return element.style?element.style[name]:null};if(attr(element,EMOTICON_DATA_ATTR)){return content}width=attr(element,"width")||style("width");height=attr(element,"height")||style("height");if(element.complete&&(width||height)||width&&height){attribs="="+dom.width(element)+"x"+dom.height(element)}return"[img"+attribs+"]"+attr(element,"src")+"[/img]"},html:function(token,attrs,content){var undef,width,height,match,attribs="";width=attrs.width;height=attrs.height;if(attrs.defaultattr){match=attrs.defaultattr.split(/x/i);width=match[0];height=match.length===2?match[1]:match[0]}if(width!==undef){attribs+=' width="'+escapeEntities(width,true)+'"'}if(height!==undef){attribs+=' height="'+escapeEntities(height,true)+'"'}return"<img"+attribs+' src="'+escapeUriScheme(content)+'" />'}},url:{allowsEmpty:true,tags:{a:{href:null}},quoteType:QuoteType.never,format:function(element,content){var url=attr(element,"href");if(url.substr(0,7)==="mailto:"){return'[email="'+url.substr(7)+'"]'+content+"[/email]"}return"[url="+url+"]"+content+"[/url]"},html:function(token,attrs,content){attrs.defaultattr=escapeEntities(attrs.defaultattr,true)||content;return'<a href="'+escapeUriScheme(attrs.defaultattr)+'">'+content+"</a>"}},email:{quoteType:QuoteType.never,html:function(token,attrs,content){return'<a href="mailto:'+(escapeEntities(attrs.defaultattr,true)||content)+'">'+content+"</a>"}},quote:{tags:{blockquote:null},isInline:false,quoteType:QuoteType.never,format:function(element,content){var authorAttr="data-author";var author="";var cite;var children=element.children;for(var i=0;!cite&&i<children.length;i++){if(is(children[i],"cite")){cite=children[i]}}if(cite||attr(element,authorAttr)){author=cite&&cite.textContent||attr(element,authorAttr);attr(element,authorAttr,author);if(cite){element.removeChild(cite)}content=this.elementToBbcode(element);author="="+author.replace(/(^\s+|\s+$)/g,"");if(cite){element.insertBefore(cite,element.firstChild)}}return"[quote"+author+"]"+content+"[/quote]"},html:function(token,attrs,content){if(attrs.defaultattr){content="<cite>"+escapeEntities(attrs.defaultattr)+"</cite>"+content}return"<blockquote>"+content+"</blockquote>"}},code:{tags:{code:null},isInline:false,allowedChildren:["#","#newline"],format:"[code]{0}[/code]",html:"<code>{0}</code>"},left:{styles:{"text-align":["left","-webkit-left","-moz-left","-khtml-left"]},isInline:false,format:"[left]{0}[/left]",html:'<div align="left">{0}</div>'},center:{styles:{"text-align":["center","-webkit-center","-moz-center","-khtml-center"]},isInline:false,format:"[center]{0}[/center]",html:'<div align="center">{0}</div>'},right:{styles:{"text-align":["right","-webkit-right","-moz-right","-khtml-right"]},isInline:false,format:"[right]{0}[/right]",html:'<div align="right">{0}</div>'},justify:{styles:{"text-align":["justify","-webkit-justify","-moz-justify","-khtml-justify"]},isInline:false,format:"[justify]{0}[/justify]",html:'<div align="justify">{0}</div>'},youtube:{allowsEmpty:true,tags:{iframe:{"data-youtube-id":null}},format:function(element,content){element=attr(element,"data-youtube-id");return element?"[youtube]"+element+"[/youtube]":content},html:'<iframe width="560" height="315" frameborder="0" '+'src="https://www.youtube.com/embed/{0}?wmode=opaque" '+'data-youtube-id="{0}" allowfullscreen></iframe>'},rtl:{styles:{direction:["rtl"]},isInline:false,format:"[rtl]{0}[/rtl]",html:'<div style="direction: rtl">{0}</div>'},ltr:{styles:{direction:["ltr"]},isInline:false,format:"[ltr]{0}[/ltr]",html:'<div style="direction: ltr">{0}</div>'},ignore:{}};function formatBBCodeString(str,obj){return str.replace(/\{([^}]+)\}/g,function(match,group){var undef,escape=true;if(group.charAt(0)==="!"){escape=false;group=group.substring(1)}if(group==="0"){escape=false}if(obj[group]===undef){return match}return escape?escapeEntities(obj[group],true):obj[group]})}function removeFirstLastDiv(html){var node,next,removeDiv,output=document.createElement("div");removeDiv=function(node,isFirst){if(dom.hasStyling(node)){return}if(IE_BR_FIX||(node.childNodes.length!==1||!is(node.firstChild,"br"))){while(next=node.firstChild){output.insertBefore(next,node)}}if(isFirst){var lastChild=output.lastChild;if(node!==lastChild&&is(lastChild,"div")&&node.nextSibling===lastChild){output.insertBefore(document.createElement("br"),node)}}output.removeChild(node)};css(output,"display","none");output.innerHTML=html.replace(/<\/div>\n/g,"</div>");if((node=output.firstChild)&&is(node,"div")){removeDiv(node,true)}if((node=output.lastChild)&&is(node,"div")){removeDiv(node)}return output.innerHTML}function isFunction(fn){return typeof fn==="function"}function _stripQuotes(str){return str?str.replace(/\\(.)/g,"$1").replace(/^(["'])(.*?)\1$/,"$2"):str}function _formatString(str){var undef;var args=arguments;return str.replace(/\{(\d+)\}/g,function(_,matchNum){return args[matchNum-0+1]!==undef?args[matchNum-0+1]:"{"+matchNum+"}"})}var TOKEN_OPEN="open";var TOKEN_CONTENT="content";var TOKEN_NEWLINE="newline";var TOKEN_CLOSE="close";function TokenizeToken(type,name,val,attrs,children,closing){var base=this;base.type=type;base.name=name;base.val=val;base.attrs=attrs||{};base.children=children||[];base.closing=closing||null}TokenizeToken.prototype={clone:function(){var base=this;return new TokenizeToken(base.type,base.name,base.val,extend({},base.attrs),[],base.closing?base.closing.clone():null)},splitAt:function(splitAt){var offsetLength;var base=this;var clone=base.clone();var offset=base.children.indexOf(splitAt);if(offset>-1){offsetLength=base.children.length-offset;clone.children=base.children.splice(offset,offsetLength)}return clone}};function BBCodeParser(options){var base=this;base.opts=extend({},BBCodeParser.defaults,options);base.tokenize=function(str){var matches,type,i;var tokens=[];var tokenTypes=[{type:TOKEN_CONTENT,regex:/^([^\[\r\n]+|\[)/},{type:TOKEN_NEWLINE,regex:/^(\r\n|\r|\n)/},{type:TOKEN_OPEN,regex:/^\[[^\[\]]+\]/},{type:TOKEN_CLOSE,regex:/^\[\/[^\[\]]+\]/}];strloop:while(str.length){i=tokenTypes.length;while(i--){type=tokenTypes[i].type;if(!(matches=str.match(tokenTypes[i].regex))||!matches[0]){continue}tokens.push(tokenizeTag(type,matches[0]));str=str.substr(matches[0].length);continue strloop}if(str.length){tokens.push(tokenizeTag(TOKEN_CONTENT,str))}str=""}return tokens};function tokenizeTag(type,val){var matches,attrs,name,openRegex=/\[([^\]\s=]+)(?:([^\]]+))?\]/,closeRegex=/\[\/([^\[\]]+)\]/;if(type===TOKEN_OPEN&&(matches=val.match(openRegex))){name=lower(matches[1]);if(matches[2]&&(matches[2]=matches[2].trim())){attrs=tokenizeAttrs(matches[2])}}if(type===TOKEN_CLOSE&&(matches=val.match(closeRegex))){name=lower(matches[1])}if(type===TOKEN_NEWLINE){name="#newline"}if(!name||(type===TOKEN_OPEN||type===TOKEN_CLOSE)&&!bbcodeHandlers[name]){type=TOKEN_CONTENT;name="#"}return new TokenizeToken(type,name,val,attrs)}function tokenizeAttrs(attrs){var matches,attrRegex=/([^\s=]+)=(?:(?:(["'])((?:\\\2|[^\2])*?)\2)|((?:.(?!\s\S+=))*.))/g,ret={};if(attrs.charAt(0)==="="&&attrs.indexOf("=",1)<0){ret.defaultattr=_stripQuotes(attrs.substr(1))}else{if(attrs.charAt(0)==="="){attrs="defaultattr"+attrs}while(matches=attrRegex.exec(attrs)){ret[lower(matches[1])]=_stripQuotes(matches[3])||matches[4]}}return ret}base.parse=function(str,preserveNewLines){var ret=parseTokens(base.tokenize(str));var opts=base.opts;if(opts.fixInvalidNesting){fixNesting(ret)}normaliseNewLines(ret,null,preserveNewLines);if(opts.removeEmptyTags){removeEmpty(ret)}return ret};function hasTag(name,type,arr){var i=arr.length;while(i--){if(arr[i].type===type&&arr[i].name===name){return true}}return false}function isChildAllowed(parent,child){var parentBBCode=parent?bbcodeHandlers[parent.name]:{},allowedChildren=parentBBCode.allowedChildren;if(base.opts.fixInvalidChildren&&allowedChildren){return allowedChildren.indexOf(child.name||"#")>-1}return true}function parseTokens(toks){var token,bbcode,curTok,clone,i,next,cloned=[],output=[],openTags=[],currentTag=function(){return last(openTags)},addTag=function(token){if(currentTag()){currentTag().children.push(token)}else{output.push(token)}},closesCurrentTag=function(name){return currentTag()&&(bbcode=bbcodeHandlers[currentTag().name])&&bbcode.closedBy&&bbcode.closedBy.indexOf(name)>-1};while(token=toks.shift()){next=toks[0];if(!isChildAllowed(currentTag(),token)){if(token.type!==TOKEN_CLOSE||!currentTag()||token.name!==currentTag().name){token.name="#";token.type=TOKEN_CONTENT}}switch(token.type){case TOKEN_OPEN:if(closesCurrentTag(token.name)){openTags.pop()}addTag(token);bbcode=bbcodeHandlers[token.name];if(bbcode&&!bbcode.isSelfClosing&&(bbcode.closedBy||hasTag(token.name,TOKEN_CLOSE,toks))){openTags.push(token)}else if(!bbcode||!bbcode.isSelfClosing){token.type=TOKEN_CONTENT}break;case TOKEN_CLOSE:if(currentTag()&&token.name!==currentTag().name&&closesCurrentTag("/"+token.name)){openTags.pop()}if(currentTag()&&token.name===currentTag().name){currentTag().closing=token;openTags.pop()}else if(hasTag(token.name,TOKEN_OPEN,openTags)){while(curTok=openTags.pop()){if(curTok.name===token.name){curTok.closing=token;break}clone=curTok.clone();if(cloned.length){clone.children.push(last(cloned))}cloned.push(clone)}if(next&&next.type===TOKEN_NEWLINE){bbcode=bbcodeHandlers[token.name];if(bbcode&&bbcode.isInline===false){addTag(next);toks.shift()}}addTag(last(cloned));i=cloned.length;while(i--){openTags.push(cloned[i])}cloned.length=0}else{token.type=TOKEN_CONTENT;addTag(token)}break;case TOKEN_NEWLINE:if(currentTag()&&next&&closesCurrentTag((next.type===TOKEN_CLOSE?"/":"")+next.name)){if(!(next.type===TOKEN_CLOSE&&next.name===currentTag().name)){bbcode=bbcodeHandlers[currentTag().name];if(bbcode&&bbcode.breakAfter){openTags.pop()}else if(bbcode&&bbcode.isInline===false&&base.opts.breakAfterBlock&&bbcode.breakAfter!==false){openTags.pop()}}}addTag(token);break;default:addTag(token);break}}return output}function normaliseNewLines(children,parent,onlyRemoveBreakAfter){var token,left,right,parentBBCode,bbcode,removedBreakEnd,removedBreakBefore,remove;var childrenLength=children.length;if(parent){parentBBCode=bbcodeHandlers[parent.name]}var i=childrenLength;while(i--){if(!(token=children[i])){continue}if(token.type===TOKEN_NEWLINE){left=i>0?children[i-1]:null;right=i<childrenLength-1?children[i+1]:null;remove=false;if(!onlyRemoveBreakAfter&&parentBBCode&&parentBBCode.isSelfClosing!==true){if(!left){if(parentBBCode.isInline===false&&base.opts.breakStartBlock&&parentBBCode.breakStart!==false){remove=true}if(parentBBCode.breakStart){remove=true}}else if(!removedBreakEnd&&!right){if(parentBBCode.isInline===false&&base.opts.breakEndBlock&&parentBBCode.breakEnd!==false){remove=true}if(parentBBCode.breakEnd){remove=true}removedBreakEnd=remove}}if(left&&left.type===TOKEN_OPEN){if(bbcode=bbcodeHandlers[left.name]){if(!onlyRemoveBreakAfter){if(bbcode.isInline===false&&base.opts.breakAfterBlock&&bbcode.breakAfter!==false){remove=true}if(bbcode.breakAfter){remove=true}}else if(bbcode.isInline===false){remove=true}}}if(!onlyRemoveBreakAfter&&!removedBreakBefore&&right&&right.type===TOKEN_OPEN){if(bbcode=bbcodeHandlers[right.name]){if(bbcode.isInline===false&&base.opts.breakBeforeBlock&&bbcode.breakBefore!==false){remove=true}if(bbcode.breakBefore){remove=true}removedBreakBefore=remove;if(remove){children.splice(i,1);continue}}}if(remove){children.splice(i,1)}removedBreakBefore=false}else if(token.type===TOKEN_OPEN){normaliseNewLines(token.children,token,onlyRemoveBreakAfter)}}}function fixNesting(children,parents,insideInline,rootArr){var token,i,parent,parentIndex,parentParentChildren,right;var isInline=function(token){var bbcode=bbcodeHandlers[token.name];return!bbcode||bbcode.isInline!==false};parents=parents||[];rootArr=rootArr||children;for(i=0;i<children.length;i++){if(!(token=children[i])||token.type!==TOKEN_OPEN){continue}if(insideInline&&!isInline(token)){parent=last(parents);right=parent.splitAt(token);parentParentChildren=parents.length>1?parents[parents.length-2].children:rootArr;if(isChildAllowed(token,parent)){var clone=parent.clone();clone.children=token.children;token.children=[clone]}parentIndex=parentParentChildren.indexOf(parent);if(parentIndex>-1){right.children.splice(0,1);parentParentChildren.splice(parentIndex+1,0,token,right);var next=right.children[0];if(next&&next.type===TOKEN_NEWLINE){if(!isInline(token)){right.children.splice(0,1);parentParentChildren.splice(parentIndex+2,0,next)}}return}}parents.push(token);fixNesting(token.children,parents,insideInline||isInline(token),rootArr);parents.pop()}}function removeEmpty(tokens){var token,bbcode;var isTokenWhiteSpace=function(children){var j=children.length;while(j--){var type=children[j].type;if(type===TOKEN_OPEN||type===TOKEN_CLOSE){return false}if(type===TOKEN_CONTENT&&/\S|\u00A0/.test(children[j].val)){return false}}return true};var i=tokens.length;while(i--){if(!(token=tokens[i])||token.type!==TOKEN_OPEN){continue}bbcode=bbcodeHandlers[token.name];removeEmpty(token.children);if(isTokenWhiteSpace(token.children)&&bbcode&&!bbcode.isSelfClosing&&!bbcode.allowsEmpty){tokens.splice.apply(tokens,[i,1].concat(token.children))}}}base.toHTML=function(str,preserveNewLines){return convertToHTML(base.parse(str,preserveNewLines),true)};function convertToHTML(tokens,isRoot){var undef,token,bbcode,content,html,needsBlockWrap,blockWrapOpen,isInline,lastChild,ret=[];isInline=function(bbcode){return(!bbcode||(bbcode.isHtmlInline!==undef?bbcode.isHtmlInline:bbcode.isInline))!==false};while(tokens.length>0){if(!(token=tokens.shift())){continue}if(token.type===TOKEN_OPEN){lastChild=token.children[token.children.length-1]||{};bbcode=bbcodeHandlers[token.name];needsBlockWrap=isRoot&&isInline(bbcode);content=convertToHTML(token.children,false);if(bbcode&&bbcode.html){if(!isInline(bbcode)&&isInline(bbcodeHandlers[lastChild.name])&&!bbcode.isPreFormatted&&!bbcode.skipLastLineBreak){if(!IE_BR_FIX){content+="<br />"}}if(!isFunction(bbcode.html)){token.attrs["0"]=content;html=formatBBCodeString(bbcode.html,token.attrs)}else{html=bbcode.html.call(base,token,token.attrs,content)}}else{html=token.val+content+(token.closing?token.closing.val:"")}}else if(token.type===TOKEN_NEWLINE){if(!isRoot){ret.push("<br />");continue}if(!blockWrapOpen){ret.push("<div>")}if(!IE_BR_FIX){ret.push("<br />")}if(!tokens.length){ret.push("<br />")}ret.push("</div>\n");blockWrapOpen=false;continue}else{needsBlockWrap=isRoot;html=escapeEntities(token.val,true)}if(needsBlockWrap&&!blockWrapOpen){ret.push("<div>");blockWrapOpen=true}else if(!needsBlockWrap&&blockWrapOpen){ret.push("</div>\n");blockWrapOpen=false}ret.push(html)}if(blockWrapOpen){ret.push("</div>\n")}return ret.join("")}base.toBBCode=function(str,preserveNewLines){return convertToBBCode(base.parse(str,preserveNewLines))};function convertToBBCode(toks){var token,attr,bbcode,isBlock,isSelfClosing,quoteType,breakBefore,breakStart,breakEnd,breakAfter,ret=[];while(toks.length>0){if(!(token=toks.shift())){continue}bbcode=bbcodeHandlers[token.name];isBlock=!(!bbcode||bbcode.isInline!==false);isSelfClosing=bbcode&&bbcode.isSelfClosing;breakBefore=isBlock&&base.opts.breakBeforeBlock&&bbcode.breakBefore!==false||bbcode&&bbcode.breakBefore;breakStart=isBlock&&!isSelfClosing&&base.opts.breakStartBlock&&bbcode.breakStart!==false||bbcode&&bbcode.breakStart;breakEnd=isBlock&&base.opts.breakEndBlock&&bbcode.breakEnd!==false||bbcode&&bbcode.breakEnd;breakAfter=isBlock&&base.opts.breakAfterBlock&&bbcode.breakAfter!==false||bbcode&&bbcode.breakAfter;quoteType=(bbcode?bbcode.quoteType:null)||base.opts.quoteType||QuoteType.auto;if(!bbcode&&token.type===TOKEN_OPEN){ret.push(token.val);if(token.children){ret.push(convertToBBCode(token.children))}if(token.closing){ret.push(token.closing.val)}}else if(token.type===TOKEN_OPEN){if(breakBefore){ret.push("\n")}ret.push("["+token.name);if(token.attrs){if(token.attrs.defaultattr){ret.push("=",quote(token.attrs.defaultattr,quoteType,"defaultattr"));delete token.attrs.defaultattr}for(attr in token.attrs){if(token.attrs.hasOwnProperty(attr)){ret.push(" ",attr,"=",quote(token.attrs[attr],quoteType,attr))}}}ret.push("]");if(breakStart){ret.push("\n")}if(token.children){ret.push(convertToBBCode(token.children))}if(!isSelfClosing&&!bbcode.excludeClosing){if(breakEnd){ret.push("\n")}ret.push("[/"+token.name+"]")}if(breakAfter){ret.push("\n")}if(token.closing&&isSelfClosing){ret.push(token.closing.val)}}else{ret.push(token.val)}}return ret.join("")}function quote(str,quoteType,name){var needsQuotes=/\s|=/.test(str);if(isFunction(quoteType)){return quoteType(str,name)}if(quoteType===QuoteType.never||quoteType===QuoteType.auto&&!needsQuotes){return str}return'"'+str.replace("\\","\\\\").replace('"','\\"')+'"'}function last(arr){if(arr.length){return arr[arr.length-1]}return null}function lower(str){return str.toLowerCase()}}BBCodeParser.QuoteType=QuoteType;BBCodeParser.defaults={breakBeforeBlock:false,breakStartBlock:false,breakEndBlock:false,breakAfterBlock:true,removeEmptyTags:true,fixInvalidNesting:true,fixInvalidChildren:true,quoteType:QuoteType.auto};function toHex(number){number=parseInt(number,10);if(isNaN(number)){return"00"}number=Math.max(0,Math.min(number,255)).toString(16);return number.length<2?"0"+number:number}function _normaliseColour(colorStr){var match;colorStr=colorStr||"#000";if(match=colorStr.match(/rgb\((\d{1,3}),\s*?(\d{1,3}),\s*?(\d{1,3})\)/i)){return"#"+toHex(match[1])+toHex(match[2])+toHex(match[3])}if(match=colorStr.match(/#([0-f])([0-f])([0-f])\s*?$/i)){return"#"+match[1]+match[1]+match[2]+match[2]+match[3]+match[3]}return colorStr}function bbcodeFormat(){var base=this;base.stripQuotes=_stripQuotes;var tagsToBBCodes={};var stylesToBBCodes={};var validChildren={ul:["li","ol","ul"],ol:["li","ol","ul"],table:["tr"],tr:["td","th"],code:["br","p","div"]};function buildBbcodeCache(){each(bbcodeHandlers,function(bbcode){var isBlock,tags=bbcodeHandlers[bbcode].tags,styles=bbcodeHandlers[bbcode].styles;if(tags){each(tags,function(tag,values){isBlock=bbcodeHandlers[bbcode].isInline===false;tagsToBBCodes[tag]=tagsToBBCodes[tag]||{};tagsToBBCodes[tag][isBlock]=tagsToBBCodes[tag][isBlock]||{};tagsToBBCodes[tag][isBlock][bbcode]=values})}if(styles){each(styles,function(style,values){isBlock=bbcodeHandlers[bbcode].isInline===false;stylesToBBCodes[isBlock]=stylesToBBCodes[isBlock]||{};stylesToBBCodes[isBlock][style]=stylesToBBCodes[isBlock][style]||{};stylesToBBCodes[isBlock][style][bbcode]=values})}})}function handleStyles(element,content,blockLevel){var styleValue,format,getStyle=dom.getStyle;blockLevel=!!blockLevel;if(!stylesToBBCodes[blockLevel]){return content}each(stylesToBBCodes[blockLevel],function(property,bbcodes){styleValue=getStyle(element,property);if(!styleValue||getStyle(element.parentNode,property)===styleValue){return}each(bbcodes,function(bbcode,values){if(!values||values.indexOf(styleValue.toString())>-1){format=bbcodeHandlers[bbcode].format;if(isFunction(format)){content=format.call(base,element,content)}else{content=_formatString(format,content)}}})});return content}function handleBlockNewlines(element,content){var tag=element.nodeName.toLowerCase();var isInline=dom.isInline;if(!isInline(element,true)||tag==="br"){var isLastBlockChild,parent,parentLastChild,previousSibling=element.previousSibling;while(previousSibling&&previousSibling.nodeType===1&&!is(previousSibling,"br")&&isInline(previousSibling,true)&&!previousSibling.firstChild){previousSibling=previousSibling.previousSibling}do{parent=element.parentNode;parentLastChild=parent&&parent.lastChild;isLastBlockChild=parentLastChild===element;element=parent}while(parent&&isLastBlockChild&&isInline(parent,true));if(!isLastBlockChild||tag==="li"||tag==="br"&&IE_BR_FIX){content+="\n"}if(tag!=="br"&&previousSibling&&!is(previousSibling,"br")&&isInline(previousSibling,true)){content="\n"+content}}return content}function handleTags(element,content,blockLevel){var convertBBCode,format,tag=element.nodeName.toLowerCase();blockLevel=!!blockLevel;if(tagsToBBCodes[tag]&&tagsToBBCodes[tag][blockLevel]){each(tagsToBBCodes[tag][blockLevel],function(bbcode,bbcodeAttribs){if(bbcodeAttribs){convertBBCode=false;each(bbcodeAttribs,function(attrib,values){if(!attr(element,attrib)||values&&values.indexOf(attr(element,attrib))<0){return}convertBBCode=true;return false});if(!convertBBCode){return}}format=bbcodeHandlers[bbcode].format;if(isFunction(format)){content=format.call(base,element,content)}else{content=_formatString(format,content)}})}return content}function elementToBbcode(element){var toBBCode=function(node,vChildren){var ret="";dom.traverse(node,function(node){var curTag="",nodeType=node.nodeType,tag=node.nodeName.toLowerCase(),vChild=validChildren[tag],firstChild=node.firstChild,isValidChild=true;if(typeof vChildren==="object"){isValidChild=vChildren.indexOf(tag)>-1;if(is(node,"img")&&attr(node,EMOTICON_DATA_ATTR)){isValidChild=true}if(!isValidChild){vChild=vChildren}}if(nodeType!==3&&nodeType!==1){return}if(nodeType===1){if(is(node,".sceditor-nlf")){if(!firstChild||!IE_BR_FIX&&node.childNodes.length===1&&/br/i.test(firstChild.nodeName)){return}}if(tag!=="iframe"){curTag=toBBCode(node,vChild)}if(isValidChild){if(tag!=="code"){curTag=handleStyles(node,curTag);curTag=handleTags(node,curTag);curTag=handleStyles(node,curTag,true)}curTag=handleTags(node,curTag,true);ret+=handleBlockNewlines(node,curTag)}else{ret+=curTag}}else{ret+=node.nodeValue}},false,true);return ret};return toBBCode(element)}base.init=function(){base.opts=this.opts;base.elementToBbcode=elementToBbcode;buildBbcodeCache();this.commands=extend(true,{},defaultCommandsOverrides,this.commands);this.toBBCode=base.toSource;this.fromBBCode=base.toHtml};function toHtml(asFragment,source,legacyAsFragment){var parser=new BBCodeParser(base.opts.parserOptions);var html=parser.toHTML(base.opts.bbcodeTrim?source.trim():source);return asFragment||legacyAsFragment?removeFirstLastDiv(html):html}function toSource(asFragment,html,context,parent){context=context||document;var bbcode,elements;var containerParent=context.createElement("div");var container=context.createElement("div");var parser=new BBCodeParser(base.opts.parserOptions);container.innerHTML=html;css(containerParent,"visibility","hidden");containerParent.appendChild(container);context.body.appendChild(containerParent);if(asFragment){containerParent.insertBefore(context.createTextNode("#"),containerParent.firstChild);containerParent.appendChild(context.createTextNode("#"))}if(parent){css(container,"whiteSpace",css(parent,"whiteSpace"))}elements=container.getElementsByClassName("sceditor-ignore");while(elements.length){elements[0].parentNode.removeChild(elements[0])}dom.removeWhiteSpace(containerParent);bbcode=elementToBbcode(container);context.body.removeChild(containerParent);bbcode=parser.toBBCode(bbcode,true);if(base.opts.bbcodeTrim){bbcode=bbcode.trim()}return bbcode}base.toHtml=toHtml.bind(null,false);base.fragmentToHtml=toHtml.bind(null,true);base.toSource=toSource.bind(null,false);base.fragmentToSource=toSource.bind(null,true)}bbcodeFormat.get=function(name){return bbcodeHandlers[name]||null};bbcodeFormat.set=function(name,bbcode){if(name&&bbcode){bbcode=extend(bbcodeHandlers[name]||{},bbcode);bbcode.remove=function(){delete bbcodeHandlers[name]};bbcodeHandlers[name]=bbcode}return this};bbcodeFormat.rename=function(name,newName){if(name in bbcodeHandlers){bbcodeHandlers[newName]=bbcodeHandlers[name];delete bbcodeHandlers[name]}return this};bbcodeFormat.remove=function(name){if(name in bbcodeHandlers){delete bbcodeHandlers[name]}return this};bbcodeFormat.formatBBCodeString=formatBBCodeString;sceditor.formats.bbcode=bbcodeFormat;sceditor.BBCodeParser=BBCodeParser})(sceditor);(function(sceditor){"use strict";var escapeEntities=sceditor.escapeEntities;var escapeUriScheme=sceditor.escapeUriScheme;var dom=sceditor.dom;var utils=sceditor.utils;var css=dom.css;var attr=dom.attr;var is=dom.is;var extend=utils.extend;var each=utils.each;var IE_VER=sceditor.ie;var IE_BR_FIX=IE_VER&&IE_VER<11;var EMOTICON_DATA_ATTR="data-sceditor-emoticon";var getEditorCommand=sceditor.command.get;var QuoteType={always:1,never:2,auto:3};var defaultCommandsOverrides={bold:{txtExec:["[b]","[/b]"]},italic:{txtExec:["[i]","[/i]"]},underline:{txtExec:["[u]","[/u]"]},strike:{txtExec:["[s]","[/s]"]},subscript:{txtExec:["[sub]","[/sub]"]},superscript:{txtExec:["[sup]","[/sup]"]},left:{txtExec:["[left]","[/left]"]},center:{txtExec:["[center]","[/center]"]},right:{txtExec:["[right]","[/right]"]},justify:{txtExec:["[justify]","[/justify]"]},font:{txtExec:function(caller){var editor=this;getEditorCommand("font")._dropDown(editor,caller,function(fontName){editor.insertText("[font="+fontName+"]","[/font]")})}},size:{txtExec:function(caller){var editor=this;getEditorCommand("size")._dropDown(editor,caller,function(fontSize){editor.insertText("[size="+fontSize+"]","[/size]")})}},color:{txtExec:function(caller){var editor=this;getEditorCommand("color")._dropDown(editor,caller,function(color){editor.insertText("[color="+color+"]","[/color]")})}},bulletlist:{txtExec:function(caller,selected){var content="";each(selected.split(/\r?\n/),function(){content+=(content?"\n":"")+"[li]"+this+"[/li]"});this.insertText("[ul]\n"+content+"\n[/ul]")}},orderedlist:{txtExec:function(caller,selected){var content="";each(selected.split(/\r?\n/),function(){content+=(content?"\n":"")+"[li]"+this+"[/li]"});this.insertText("[ol]\n"+content+"\n[/ol]")}},table:{txtExec:["[table][tr][td]","[/td][/tr][/table]"]},horizontalrule:{txtExec:["[hr]"]},code:{txtExec:["[code]","[/code]"]},image:{txtExec:function(caller,selected){var editor=this;getEditorCommand("image")._dropDown(editor,caller,selected,function(url,width,height){var attrs="";if(width){attrs+=" width="+width}if(height){attrs+=" height="+height}editor.insertText("[img"+attrs+"]"+url+"[/img]")})}},email:{txtExec:function(caller,selected){var editor=this;getEditorCommand("email")._dropDown(editor,caller,function(url,text){editor.insertText("[email="+url+"]"+(text||selected||url)+"[/email]")})}},link:{txtExec:function(caller,selected){var editor=this;getEditorCommand("link")._dropDown(editor,caller,function(url,text){editor.insertText("[url="+url+"]"+(text||selected||url)+"[/url]")})}},quote:{txtExec:["[quote]","[/quote]"]},youtube:{txtExec:function(caller){var editor=this;getEditorCommand("youtube")._dropDown(editor,caller,function(id){editor.insertText("[youtube]"+id+"[/youtube]")})}},rtl:{txtExec:["[rtl]","[/rtl]"]},ltr:{txtExec:["[ltr]","[/ltr]"]}};var bbcodeHandlers={b:{tags:{b:null,strong:null},styles:{"font-weight":["bold","bolder","401","700","800","900"]},format:"[b]{0}[/b]",html:"<strong>{0}</strong>"},i:{tags:{i:null,em:null},styles:{"font-style":["italic","oblique"]},format:"[i]{0}[/i]",html:"<em>{0}</em>"},u:{tags:{u:null},styles:{"text-decoration":["underline"]},format:"[u]{0}[/u]",html:"<u>{0}</u>"},s:{tags:{s:null,strike:null},styles:{"text-decoration":["line-through"]},format:"[s]{0}[/s]",html:"<s>{0}</s>"},sub:{tags:{sub:null},format:"[sub]{0}[/sub]",html:"<sub>{0}</sub>"},sup:{tags:{sup:null},format:"[sup]{0}[/sup]",html:"<sup>{0}</sup>"},font:{tags:{font:{face:null}},styles:{"font-family":null},quoteType:QuoteType.never,format:function(element,content){var font;if(!is(element,"font")||!(font=attr(element,"face"))){font=css(element,"font-family")}return"[font="+_stripQuotes(font)+"]"+content+"[/font]"},html:'<font face="{defaultattr}">{0}</font>'},size:{tags:{font:{size:null}},styles:{"font-size":null},format:function(element,content){var fontSize=attr(element,"size"),size=2;if(!fontSize){fontSize=css(element,"fontSize")}if(fontSize.indexOf("px")>-1){fontSize=fontSize.replace("px","")-0;if(fontSize<12){size=1}if(fontSize>15){size=3}if(fontSize>17){size=4}if(fontSize>23){size=5}if(fontSize>31){size=6}if(fontSize>47){size=7}}else{size=fontSize}return"[size="+size+"]"+content+"[/size]"},html:'<font size="{defaultattr}">{!0}</font>'},color:{tags:{font:{color:null}},styles:{color:null},quoteType:QuoteType.never,format:function(elm,content){var color;if(!is(elm,"font")||!(color=attr(elm,"color"))){color=elm.style.color||css(elm,"color")}return"[color="+_normaliseColour(color)+"]"+content+"[/color]"},html:function(token,attrs,content){return'<font color="'+escapeEntities(_normaliseColour(attrs.defaultattr),true)+'">'+content+"</font>"}},ul:{tags:{ul:null},breakStart:true,isInline:false,skipLastLineBreak:true,format:"[ul]{0}[/ul]",html:"<ul>{0}</ul>"},list:{breakStart:true,isInline:false,skipLastLineBreak:true,html:"<ul>{0}</ul>"},ol:{tags:{ol:null},breakStart:true,isInline:false,skipLastLineBreak:true,format:"[ol]{0}[/ol]",html:"<ol>{0}</ol>"},li:{tags:{li:null},isInline:false,closedBy:["/ul","/ol","/list","*","li"],format:"[li]{0}[/li]",html:"<li>{0}</li>"},"*":{isInline:false,closedBy:["/ul","/ol","/list","*","li"],html:"<li>{0}</li>"},table:{tags:{table:null},isInline:false,isHtmlInline:true,skipLastLineBreak:true,format:"[table]{0}[/table]",html:"<table>{0}</table>"},tr:{tags:{tr:null},isInline:false,skipLastLineBreak:true,format:"[tr]{0}[/tr]",html:"<tr>{0}</tr>"},th:{tags:{th:null},allowsEmpty:true,isInline:false,format:"[th]{0}[/th]",html:"<th>{0}</th>"},td:{tags:{td:null},allowsEmpty:true,isInline:false,format:"[td]{0}[/td]",html:"<td>{0}</td>"},emoticon:{allowsEmpty:true,tags:{img:{src:null,"data-sceditor-emoticon":null}},format:function(element,content){return attr(element,EMOTICON_DATA_ATTR)+content},html:"{0}"},hr:{tags:{hr:null},allowsEmpty:true,isSelfClosing:true,isInline:false,format:"[hr]{0}",html:"<hr />"},img:{allowsEmpty:true,tags:{img:{src:null}},allowedChildren:["#"],quoteType:QuoteType.never,format:function(element,content){var width,height,attribs="",style=function(name){return element.style?element.style[name]:null};if(attr(element,EMOTICON_DATA_ATTR)){return content}width=attr(element,"width")||style("width");height=attr(element,"height")||style("height");if(element.complete&&(width||height)||width&&height){attribs="="+dom.width(element)+"x"+dom.height(element)}return"[img"+attribs+"]"+attr(element,"src")+"[/img]"},html:function(token,attrs,content){var undef,width,height,match,attribs="";width=attrs.width;height=attrs.height;if(attrs.defaultattr){match=attrs.defaultattr.split(/x/i);width=match[0];height=match.length===2?match[1]:match[0]}if(width!==undef){attribs+=' width="'+escapeEntities(width,true)+'"'}if(height!==undef){attribs+=' height="'+escapeEntities(height,true)+'"'}return"<img"+attribs+' src="'+escapeUriScheme(content)+'" />'}},url:{allowsEmpty:true,tags:{a:{href:null}},quoteType:QuoteType.never,format:function(element,content){var url=attr(element,"href");if(url.substr(0,7)==="mailto:"){return'[email="'+url.substr(7)+'"]'+content+"[/email]"}return"[url="+url+"]"+content+"[/url]"},html:function(token,attrs,content){attrs.defaultattr=escapeEntities(attrs.defaultattr,true)||content;return'<a href="'+escapeUriScheme(attrs.defaultattr)+'">'+content+"</a>"}},email:{quoteType:QuoteType.never,html:function(token,attrs,content){return'<a href="mailto:'+(escapeEntities(attrs.defaultattr,true)||content)+'">'+content+"</a>"}},quote:{tags:{blockquote:null},isInline:false,quoteType:QuoteType.never,format:function(element,content){var authorAttr="data-author";var author="";var cite;var children=element.children;for(var i=0;!cite&&i<children.length;i++){if(is(children[i],"cite")){cite=children[i]}}if(cite||attr(element,authorAttr)){author=cite&&cite.textContent||attr(element,authorAttr);attr(element,authorAttr,author);if(cite){element.removeChild(cite)}content=this.elementToBbcode(element);author="="+author.replace(/(^\s+|\s+$)/g,"");if(cite){element.insertBefore(cite,element.firstChild)}}return"[quote"+author+"]"+content+"[/quote]"},html:function(token,attrs,content){if(attrs.defaultattr){content="<cite>"+escapeEntities(attrs.defaultattr)+"</cite>"+content}return"<blockquote>"+content+"</blockquote>"}},code:{tags:{code:null},isInline:false,allowedChildren:["#","#newline"],format:"[code]{0}[/code]",html:"<code>{0}</code>"},left:{styles:{"text-align":["left","-webkit-left","-moz-left","-khtml-left"]},isInline:false,format:"[left]{0}[/left]",html:'<div align="left">{0}</div>'},center:{styles:{"text-align":["center","-webkit-center","-moz-center","-khtml-center"]},isInline:false,format:"[center]{0}[/center]",html:'<div align="center">{0}</div>'},right:{styles:{"text-align":["right","-webkit-right","-moz-right","-khtml-right"]},isInline:false,format:"[right]{0}[/right]",html:'<div align="right">{0}</div>'},justify:{styles:{"text-align":["justify","-webkit-justify","-moz-justify","-khtml-justify"]},isInline:false,format:"[justify]{0}[/justify]",html:'<div align="justify">{0}</div>'},youtube:{allowsEmpty:true,tags:{iframe:{"data-youtube-id":null}},format:function(element,content){element=attr(element,"data-youtube-id");return element?"[youtube]"+element+"[/youtube]":content},html:'<iframe width="560" height="315" frameborder="0" '+'src="https://www.youtube.com/embed/{0}?wmode=opaque" '+'data-youtube-id="{0}" allowfullscreen></iframe>'},rtl:{styles:{direction:["rtl"]},isInline:false,format:"[rtl]{0}[/rtl]",html:'<div style="direction: rtl">{0}</div>'},ltr:{styles:{direction:["ltr"]},isInline:false,format:"[ltr]{0}[/ltr]",html:'<div style="direction: ltr">{0}</div>'},ignore:{}};function formatBBCodeString(str,obj){return str.replace(/\{([^}]+)\}/g,function(match,group){var undef,escape=true;if(group.charAt(0)==="!"){escape=false;group=group.substring(1)}if(group==="0"){escape=false}if(obj[group]===undef){return match}return escape?escapeEntities(obj[group],true):obj[group]})}function removeFirstLastDiv(html){var node,next,removeDiv,output=document.createElement("div");removeDiv=function(node,isFirst){if(dom.hasStyling(node)){return}if(IE_BR_FIX||(node.childNodes.length!==1||!is(node.firstChild,"br"))){while(next=node.firstChild){output.insertBefore(next,node)}}if(isFirst){var lastChild=output.lastChild;if(node!==lastChild&&is(lastChild,"div")&&node.nextSibling===lastChild){output.insertBefore(document.createElement("br"),node)}}output.removeChild(node)};css(output,"display","none");output.innerHTML=html.replace(/<\/div>\n/g,"</div>");if((node=output.firstChild)&&is(node,"div")){removeDiv(node,true)}if((node=output.lastChild)&&is(node,"div")){removeDiv(node)}return output.innerHTML}function isFunction(fn){return typeof fn==="function"}function _stripQuotes(str){return str?str.replace(/\\(.)/g,"$1").replace(/^(["'])(.*?)\1$/,"$2"):str}function _formatString(str){var undef;var args=arguments;return str.replace(/\{(\d+)\}/g,function(_,matchNum){return args[matchNum-0+1]!==undef?args[matchNum-0+1]:"{"+matchNum+"}"})}var TOKEN_OPEN="open";var TOKEN_CONTENT="content";var TOKEN_NEWLINE="newline";var TOKEN_CLOSE="close";function TokenizeToken(type,name,val,attrs,children,closing){var base=this;base.type=type;base.name=name;base.val=val;base.attrs=attrs||{};base.children=children||[];base.closing=closing||null}TokenizeToken.prototype={clone:function(){var base=this;return new TokenizeToken(base.type,base.name,base.val,extend({},base.attrs),[],base.closing?base.closing.clone():null)},splitAt:function(splitAt){var offsetLength;var base=this;var clone=base.clone();var offset=base.children.indexOf(splitAt);if(offset>-1){offsetLength=base.children.length-offset;clone.children=base.children.splice(offset,offsetLength)}return clone}};function BBCodeParser(options){var base=this;base.opts=extend({},BBCodeParser.defaults,options);base.tokenize=function(str){var matches,type,i;var tokens=[];var tokenTypes=[{type:TOKEN_CONTENT,regex:/^([^\[\r\n]+|\[)/},{type:TOKEN_NEWLINE,regex:/^(\r\n|\r|\n)/},{type:TOKEN_OPEN,regex:/^\[[^\[\]]+\]/},{type:TOKEN_CLOSE,regex:/^\[\/[^\[\]]+\]/}];strloop:while(str.length){i=tokenTypes.length;while(i--){type=tokenTypes[i].type;if(!(matches=str.match(tokenTypes[i].regex))||!matches[0]){continue}tokens.push(tokenizeTag(type,matches[0]));str=str.substr(matches[0].length);continue strloop}if(str.length){tokens.push(tokenizeTag(TOKEN_CONTENT,str))}str=""}return tokens};function tokenizeTag(type,val){var matches,attrs,name,openRegex=/\[([^\]\s=]+)(?:([^\]]+))?\]/,closeRegex=/\[\/([^\[\]]+)\]/;if(type===TOKEN_OPEN&&(matches=val.match(openRegex))){name=lower(matches[1]);if(matches[2]&&(matches[2]=matches[2].trim())){attrs=tokenizeAttrs(matches[2])}}if(type===TOKEN_CLOSE&&(matches=val.match(closeRegex))){name=lower(matches[1])}if(type===TOKEN_NEWLINE){name="#newline"}if(!name||(type===TOKEN_OPEN||type===TOKEN_CLOSE)&&!bbcodeHandlers[name]){type=TOKEN_CONTENT;name="#"}return new TokenizeToken(type,name,val,attrs)}function tokenizeAttrs(attrs){var matches,attrRegex=/([^\s=]+)=(?:(?:(["'])((?:\\\2|[^\2])*?)\2)|((?:.(?!\s\S+=))*.))/g,ret={};if(attrs.charAt(0)==="="&&attrs.indexOf("=",1)<0){ret.defaultattr=_stripQuotes(attrs.substr(1))}else{if(attrs.charAt(0)==="="){attrs="defaultattr"+attrs}while(matches=attrRegex.exec(attrs)){ret[lower(matches[1])]=_stripQuotes(matches[3])||matches[4]}}return ret}base.parse=function(str,preserveNewLines){var ret=parseTokens(base.tokenize(str));var opts=base.opts;if(opts.fixInvalidNesting){fixNesting(ret)}normaliseNewLines(ret,null,preserveNewLines);if(opts.removeEmptyTags){removeEmpty(ret)}return ret};function hasTag(name,type,arr){var i=arr.length;while(i--){if(arr[i].type===type&&arr[i].name===name){return true}}return false}function isChildAllowed(parent,child){var parentBBCode=parent?bbcodeHandlers[parent.name]:{},allowedChildren=parentBBCode.allowedChildren;if(base.opts.fixInvalidChildren&&allowedChildren){return allowedChildren.indexOf(child.name||"#")>-1}return true}function parseTokens(toks){var token,bbcode,curTok,clone,i,next,cloned=[],output=[],openTags=[],currentTag=function(){return last(openTags)},addTag=function(token){if(currentTag()){currentTag().children.push(token)}else{output.push(token)}},closesCurrentTag=function(name){return currentTag()&&(bbcode=bbcodeHandlers[currentTag().name])&&bbcode.closedBy&&bbcode.closedBy.indexOf(name)>-1};while(token=toks.shift()){next=toks[0];if(!isChildAllowed(currentTag(),token)){if(token.type!==TOKEN_CLOSE||!currentTag()||token.name!==currentTag().name){token.name="#";token.type=TOKEN_CONTENT}}switch(token.type){case TOKEN_OPEN:if(closesCurrentTag(token.name)){openTags.pop()}addTag(token);bbcode=bbcodeHandlers[token.name];if(bbcode&&!bbcode.isSelfClosing&&(bbcode.closedBy||hasTag(token.name,TOKEN_CLOSE,toks))){openTags.push(token)}else if(!bbcode||!bbcode.isSelfClosing){token.type=TOKEN_CONTENT}break;case TOKEN_CLOSE:if(currentTag()&&token.name!==currentTag().name&&closesCurrentTag("/"+token.name)){openTags.pop()}if(currentTag()&&token.name===currentTag().name){currentTag().closing=token;openTags.pop()}else if(hasTag(token.name,TOKEN_OPEN,openTags)){while(curTok=openTags.pop()){if(curTok.name===token.name){curTok.closing=token;break}clone=curTok.clone();if(cloned.length){clone.children.push(last(cloned))}cloned.push(clone)}if(next&&next.type===TOKEN_NEWLINE){bbcode=bbcodeHandlers[token.name];if(bbcode&&bbcode.isInline===false){addTag(next);toks.shift()}}addTag(last(cloned));i=cloned.length;while(i--){openTags.push(cloned[i])}cloned.length=0}else{token.type=TOKEN_CONTENT;addTag(token)}break;case TOKEN_NEWLINE:if(currentTag()&&next&&closesCurrentTag((next.type===TOKEN_CLOSE?"/":"")+next.name)){if(!(next.type===TOKEN_CLOSE&&next.name===currentTag().name)){bbcode=bbcodeHandlers[currentTag().name];if(bbcode&&bbcode.breakAfter){openTags.pop()}else if(bbcode&&bbcode.isInline===false&&base.opts.breakAfterBlock&&bbcode.breakAfter!==false){openTags.pop()}}}addTag(token);break;default:addTag(token);break}}return output}function normaliseNewLines(children,parent,onlyRemoveBreakAfter){var token,left,right,parentBBCode,bbcode,removedBreakEnd,removedBreakBefore,remove;var childrenLength=children.length;if(parent){parentBBCode=bbcodeHandlers[parent.name]}var i=childrenLength;while(i--){if(!(token=children[i])){continue}if(token.type===TOKEN_NEWLINE){left=i>0?children[i-1]:null;right=i<childrenLength-1?children[i+1]:null;remove=false;if(!onlyRemoveBreakAfter&&parentBBCode&&parentBBCode.isSelfClosing!==true){if(!left){if(parentBBCode.isInline===false&&base.opts.breakStartBlock&&parentBBCode.breakStart!==false){remove=true}if(parentBBCode.breakStart){remove=true}}else if(!removedBreakEnd&&!right){if(parentBBCode.isInline===false&&base.opts.breakEndBlock&&parentBBCode.breakEnd!==false){remove=true}if(parentBBCode.breakEnd){remove=true}removedBreakEnd=remove}}if(left&&left.type===TOKEN_OPEN){if(bbcode=bbcodeHandlers[left.name]){if(!onlyRemoveBreakAfter){if(bbcode.isInline===false&&base.opts.breakAfterBlock&&bbcode.breakAfter!==false){remove=true}if(bbcode.breakAfter){remove=true}}else if(bbcode.isInline===false){remove=true}}}if(!onlyRemoveBreakAfter&&!removedBreakBefore&&right&&right.type===TOKEN_OPEN){if(bbcode=bbcodeHandlers[right.name]){if(bbcode.isInline===false&&base.opts.breakBeforeBlock&&bbcode.breakBefore!==false){remove=true}if(bbcode.breakBefore){remove=true}removedBreakBefore=remove;if(remove){children.splice(i,1);continue}}}if(remove){children.splice(i,1)}removedBreakBefore=false}else if(token.type===TOKEN_OPEN){normaliseNewLines(token.children,token,onlyRemoveBreakAfter)}}}function fixNesting(children,parents,insideInline,rootArr){var token,i,parent,parentIndex,parentParentChildren,right;var isInline=function(token){var bbcode=bbcodeHandlers[token.name];return!bbcode||bbcode.isInline!==false};parents=parents||[];rootArr=rootArr||children;for(i=0;i<children.length;i++){if(!(token=children[i])||token.type!==TOKEN_OPEN){continue}if(insideInline&&!isInline(token)){parent=last(parents);right=parent.splitAt(token);parentParentChildren=parents.length>1?parents[parents.length-2].children:rootArr;if(isChildAllowed(token,parent)){var clone=parent.clone();clone.children=token.children;token.children=[clone]}parentIndex=parentParentChildren.indexOf(parent);if(parentIndex>-1){right.children.splice(0,1);parentParentChildren.splice(parentIndex+1,0,token,right);var next=right.children[0];if(next&&next.type===TOKEN_NEWLINE){if(!isInline(token)){right.children.splice(0,1);parentParentChildren.splice(parentIndex+2,0,next)}}return}}parents.push(token);fixNesting(token.children,parents,insideInline||isInline(token),rootArr);parents.pop()}}function removeEmpty(tokens){var token,bbcode;var isTokenWhiteSpace=function(children){var j=children.length;while(j--){var type=children[j].type;if(type===TOKEN_OPEN||type===TOKEN_CLOSE){return false}if(type===TOKEN_CONTENT&&/\S|\u00A0/.test(children[j].val)){return false}}return true};var i=tokens.length;while(i--){if(!(token=tokens[i])||token.type!==TOKEN_OPEN){continue}bbcode=bbcodeHandlers[token.name];removeEmpty(token.children);if(isTokenWhiteSpace(token.children)&&bbcode&&!bbcode.isSelfClosing&&!bbcode.allowsEmpty){tokens.splice.apply(tokens,[i,1].concat(token.children))}}}base.toHTML=function(str,preserveNewLines){return convertToHTML(base.parse(str,preserveNewLines),true)};function convertToHTML(tokens,isRoot){var undef,token,bbcode,content,html,needsBlockWrap,blockWrapOpen,isInline,lastChild,ret=[];isInline=function(bbcode){return(!bbcode||(bbcode.isHtmlInline!==undef?bbcode.isHtmlInline:bbcode.isInline))!==false};while(tokens.length>0){if(!(token=tokens.shift())){continue}if(token.type===TOKEN_OPEN){lastChild=token.children[token.children.length-1]||{};bbcode=bbcodeHandlers[token.name];needsBlockWrap=isRoot&&isInline(bbcode);content=convertToHTML(token.children,false);if(bbcode&&bbcode.html){if(!isInline(bbcode)&&isInline(bbcodeHandlers[lastChild.name])&&!bbcode.isPreFormatted&&!bbcode.skipLastLineBreak){if(!IE_BR_FIX){content+="<br />"}}if(!isFunction(bbcode.html)){token.attrs["0"]=content;html=formatBBCodeString(bbcode.html,token.attrs)}else{html=bbcode.html.call(base,token,token.attrs,content)}}else{html=token.val+content+(token.closing?token.closing.val:"")}}else if(token.type===TOKEN_NEWLINE){if(!isRoot){ret.push("<br />");continue}if(!blockWrapOpen){ret.push("<div>")}if(!IE_BR_FIX){ret.push("<br />")}if(!tokens.length){ret.push("<br />")}ret.push("</div>\n");blockWrapOpen=false;continue}else{needsBlockWrap=isRoot;html=escapeEntities(token.val,true)}if(needsBlockWrap&&!blockWrapOpen){ret.push("<div>");blockWrapOpen=true}else if(!needsBlockWrap&&blockWrapOpen){ret.push("</div>\n");blockWrapOpen=false}ret.push(html)}if(blockWrapOpen){ret.push("</div>\n")}return ret.join("")}base.toBBCode=function(str,preserveNewLines){return convertToBBCode(base.parse(str,preserveNewLines))};function convertToBBCode(toks){var token,attr,bbcode,isBlock,isSelfClosing,quoteType,breakBefore,breakStart,breakEnd,breakAfter,ret=[];while(toks.length>0){if(!(token=toks.shift())){continue}bbcode=bbcodeHandlers[token.name];isBlock=!(!bbcode||bbcode.isInline!==false);isSelfClosing=bbcode&&bbcode.isSelfClosing;breakBefore=isBlock&&base.opts.breakBeforeBlock&&bbcode.breakBefore!==false||bbcode&&bbcode.breakBefore;breakStart=isBlock&&!isSelfClosing&&base.opts.breakStartBlock&&bbcode.breakStart!==false||bbcode&&bbcode.breakStart;breakEnd=isBlock&&base.opts.breakEndBlock&&bbcode.breakEnd!==false||bbcode&&bbcode.breakEnd;breakAfter=isBlock&&base.opts.breakAfterBlock&&bbcode.breakAfter!==false||bbcode&&bbcode.breakAfter;quoteType=(bbcode?bbcode.quoteType:null)||base.opts.quoteType||QuoteType.auto;if(!bbcode&&token.type===TOKEN_OPEN){ret.push(token.val);if(token.children){ret.push(convertToBBCode(token.children))}if(token.closing){ret.push(token.closing.val)}}else if(token.type===TOKEN_OPEN){if(breakBefore){ret.push("\n")}ret.push("["+token.name);if(token.attrs){if(token.attrs.defaultattr){ret.push("=",quote(token.attrs.defaultattr,quoteType,"defaultattr"));delete token.attrs.defaultattr}for(attr in token.attrs){if(token.attrs.hasOwnProperty(attr)){ret.push(" ",attr,"=",quote(token.attrs[attr],quoteType,attr))}}}ret.push("]");if(breakStart){ret.push("\n")}if(token.children){ret.push(convertToBBCode(token.children))}if(!isSelfClosing&&!bbcode.excludeClosing){if(breakEnd){ret.push("\n")}ret.push("[/"+token.name+"]")}if(breakAfter){ret.push("\n")}if(token.closing&&isSelfClosing){ret.push(token.closing.val)}}else{ret.push(token.val)}}return ret.join("")}function quote(str,quoteType,name){var needsQuotes=/\s|=/.test(str);if(isFunction(quoteType)){return quoteType(str,name)}if(quoteType===QuoteType.never||quoteType===QuoteType.auto&&!needsQuotes){return str}return'"'+str.replace("\\","\\\\").replace('"','\\"')+'"'}function last(arr){if(arr.length){return arr[arr.length-1]}return null}function lower(str){return str.toLowerCase()}}BBCodeParser.QuoteType=QuoteType;BBCodeParser.defaults={breakBeforeBlock:false,breakStartBlock:false,breakEndBlock:false,breakAfterBlock:true,removeEmptyTags:true,fixInvalidNesting:true,fixInvalidChildren:true,quoteType:QuoteType.auto};function toHex(number){number=parseInt(number,10);if(isNaN(number)){return"00"}number=Math.max(0,Math.min(number,255)).toString(16);return number.length<2?"0"+number:number}function _normaliseColour(colorStr){var match;colorStr=colorStr||"#000";if(match=colorStr.match(/rgb\((\d{1,3}),\s*?(\d{1,3}),\s*?(\d{1,3})\)/i)){return"#"+toHex(match[1])+toHex(match[2])+toHex(match[3])}if(match=colorStr.match(/#([0-f])([0-f])([0-f])\s*?$/i)){return"#"+match[1]+match[1]+match[2]+match[2]+match[3]+match[3]}return colorStr}function bbcodeFormat(){var base=this;base.stripQuotes=_stripQuotes;var tagsToBBCodes={};var stylesToBBCodes={};var validChildren={ul:["li","ol","ul"],ol:["li","ol","ul"],table:["tr"],tr:["td","th"],code:["br","p","div"]};function buildBbcodeCache(){each(bbcodeHandlers,function(bbcode){var isBlock,tags=bbcodeHandlers[bbcode].tags,styles=bbcodeHandlers[bbcode].styles;if(tags){each(tags,function(tag,values){isBlock=bbcodeHandlers[bbcode].isInline===false;tagsToBBCodes[tag]=tagsToBBCodes[tag]||{};tagsToBBCodes[tag][isBlock]=tagsToBBCodes[tag][isBlock]||{};tagsToBBCodes[tag][isBlock][bbcode]=values})}if(styles){each(styles,function(style,values){isBlock=bbcodeHandlers[bbcode].isInline===false;stylesToBBCodes[isBlock]=stylesToBBCodes[isBlock]||{};stylesToBBCodes[isBlock][style]=stylesToBBCodes[isBlock][style]||{};stylesToBBCodes[isBlock][style][bbcode]=values})}})}function handleStyles(element,content,blockLevel){var styleValue,format,getStyle=dom.getStyle;blockLevel=!!blockLevel;if(!stylesToBBCodes[blockLevel]){return content}each(stylesToBBCodes[blockLevel],function(property,bbcodes){styleValue=getStyle(element,property);if(!styleValue||getStyle(element.parentNode,property)===styleValue){return}each(bbcodes,function(bbcode,values){if(!values||values.indexOf(styleValue.toString())>-1){format=bbcodeHandlers[bbcode].format;if(isFunction(format)){content=format.call(base,element,content)}else{content=_formatString(format,content)}}})});return content}function handleBlockNewlines(element,content){var tag=element.nodeName.toLowerCase();var isInline=dom.isInline;if(!isInline(element,true)||tag==="br"){var isLastBlockChild,parent,parentLastChild,previousSibling=element.previousSibling;while(previousSibling&&previousSibling.nodeType===1&&!is(previousSibling,"br")&&isInline(previousSibling,true)&&!previousSibling.firstChild){previousSibling=previousSibling.previousSibling}do{parent=element.parentNode;parentLastChild=parent&&parent.lastChild;isLastBlockChild=parentLastChild===element;element=parent}while(parent&&isLastBlockChild&&isInline(parent,true));if(!isLastBlockChild||tag==="li"||tag==="br"&&IE_BR_FIX){content+="\n"}if(tag!=="br"&&previousSibling&&!is(previousSibling,"br")&&isInline(previousSibling,true)){content="\n"+content}}return content}function handleTags(element,content,blockLevel){var convertBBCode,format,tag=element.nodeName.toLowerCase();blockLevel=!!blockLevel;if(tagsToBBCodes[tag]&&tagsToBBCodes[tag][blockLevel]){each(tagsToBBCodes[tag][blockLevel],function(bbcode,bbcodeAttribs){if(bbcodeAttribs){convertBBCode=false;each(bbcodeAttribs,function(attrib,values){if(!attr(element,attrib)||values&&values.indexOf(attr(element,attrib))<0){return}convertBBCode=true;return false});if(!convertBBCode){return}}format=bbcodeHandlers[bbcode].format;if(isFunction(format)){content=format.call(base,element,content)}else{content=_formatString(format,content)}})}return content}function elementToBbcode(element){var toBBCode=function(node,vChildren){var ret="";dom.traverse(node,function(node){var curTag="",nodeType=node.nodeType,tag=node.nodeName.toLowerCase(),vChild=validChildren[tag],firstChild=node.firstChild,isValidChild=true;if(typeof vChildren==="object"){isValidChild=vChildren.indexOf(tag)>-1;if(is(node,"img")&&attr(node,EMOTICON_DATA_ATTR)){isValidChild=true}if(!isValidChild){vChild=vChildren}}if(nodeType!==3&&nodeType!==1){return}if(nodeType===1){if(is(node,".sceditor-nlf")){if(!firstChild||!IE_BR_FIX&&node.childNodes.length===1&&/br/i.test(firstChild.nodeName)){return}}if(tag!=="iframe"){curTag=toBBCode(node,vChild)}if(isValidChild){if(tag!=="code"){curTag=handleStyles(node,curTag);curTag=handleTags(node,curTag);curTag=handleStyles(node,curTag,true)}curTag=handleTags(node,curTag,true);ret+=handleBlockNewlines(node,curTag)}else{ret+=curTag}}else{ret+=node.nodeValue}},false,true);return ret};return toBBCode(element)}base.init=function(){base.opts=this.opts;base.elementToBbcode=elementToBbcode;buildBbcodeCache();this.commands=extend(true,{},defaultCommandsOverrides,this.commands);this.toBBCode=base.toSource;this.fromBBCode=base.toHtml};function toHtml(asFragment,source,legacyAsFragment){var parser=new BBCodeParser(base.opts.parserOptions);var html=parser.toHTML(base.opts.bbcodeTrim?source.trim():source);return asFragment||legacyAsFragment?removeFirstLastDiv(html):html}function toSource(asFragment,html,context,parent){context=context||document;var bbcode,elements;var containerParent=context.createElement("div");var container=context.createElement("div");var parser=new BBCodeParser(base.opts.parserOptions);container.innerHTML=html;css(containerParent,"visibility","hidden");containerParent.appendChild(container);context.body.appendChild(containerParent);if(asFragment){containerParent.insertBefore(context.createTextNode("#"),containerParent.firstChild);containerParent.appendChild(context.createTextNode("#"))}if(parent){css(container,"whiteSpace",css(parent,"whiteSpace"))}elements=container.getElementsByClassName("sceditor-ignore");while(elements.length){elements[0].parentNode.removeChild(elements[0])}dom.removeWhiteSpace(containerParent);bbcode=elementToBbcode(container);context.body.removeChild(containerParent);bbcode=parser.toBBCode(bbcode,true);if(base.opts.bbcodeTrim){bbcode=bbcode.trim()}return bbcode}base.toHtml=toHtml.bind(null,false);base.fragmentToHtml=toHtml.bind(null,true);base.toSource=toSource.bind(null,false);base.fragmentToSource=toSource.bind(null,true)}bbcodeFormat.get=function(name){return bbcodeHandlers[name]||null};bbcodeFormat.set=function(name,bbcode){if(name&&bbcode){bbcode=extend(bbcodeHandlers[name]||{},bbcode);bbcode.remove=function(){delete bbcodeHandlers[name]};bbcodeHandlers[name]=bbcode}return this};bbcodeFormat.rename=function(name,newName){if(name in bbcodeHandlers){bbcodeHandlers[newName]=bbcodeHandlers[name];delete bbcodeHandlers[name]}return this};bbcodeFormat.remove=function(name){if(name in bbcodeHandlers){delete bbcodeHandlers[name]}return this};bbcodeFormat.formatBBCodeString=formatBBCodeString;sceditor.formats.bbcode=bbcodeFormat;sceditor.BBCodeParser=BBCodeParser})(sceditor);!function(e,t){"use strict";function n(e){return'<iframe width="560" height="315" frameborder="0" src="https://www.youtube-nocookie.com/embed/'+e+'" data-youtube-id="'+e+'" allowfullscreen></iframe>'}function o(t){for(var s=t.firstChild;s;){if(3===s.nodeType){var u=s.nodeValue,a=s.parentNode,c=u.match(r);c&&(a.insertBefore(e.createTextNode(u.substr(0,c.index)+c[1]),s),a.insertBefore(i.parseHTML(n(c[2])),s),s.nodeValue=c[3]+u.substr(c.index+c[0].length))}else i.is(s,"code")||o(s);s=s.nextSibling}}var i=t.dom,r=/(^|\s)(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/watch\?v=)([^"&?\/ ]{11})(?:\&[\&_\?0-9a-z\#]+)?(\s|$)/i;t.plugins.autoyoutube=function(){this.signalPasteRaw=function(t){if(!i.closest(this.currentNode(),"code")&&(t.html||t.text)){var n=e.createElement("div");t.html?n.innerHTML=t.html:n.textContent=t.text,o(n),t.html=n.innerHTML}}}}(document,sceditor);!function(t){"use strict";var n=t.utils.extend;t.plugins.plaintext=function(){var t=!0;this.init=function(){var e=this.commands,i=this.opts;i&&i.plaintext&&i.plaintext.addButton&&(t=i.plaintext.enabled,e.pastetext=n(e.pastetext||{},{state:function(){return t?1:0},exec:function(){t=!t}}))},this.signalPasteRaw=function(n){if(t){if(n.html&&!n.text){var e=document.createElement("div");e.innerHTML=n.html,n.text=e.innerText}n.html=null}}}}(sceditor);!function(n){"use strict";function t(n,t){var r=(65535&n)+(65535&t);return(n>>16)+(t>>16)+(r>>16)<<16|65535&r}function r(n,t){return n<<t|n>>>32-t}function e(n,e,o,u,c,f){return t(r(t(t(e,n),t(u,f)),c),o)}function o(n,t,r,o,u,c,f){return e(t&r|~t&o,n,t,u,c,f)}function u(n,t,r,o,u,c,f){return e(t&o|r&~o,n,t,u,c,f)}function c(n,t,r,o,u,c,f){return e(t^r^o,n,t,u,c,f)}function f(n,t,r,o,u,c,f){return e(r^(t|~o),n,t,u,c,f)}function i(n,r){n[r>>5]|=128<<r%32,n[14+(r+64>>>9<<4)]=r;var e,i,a,h,d,l=1732584193,g=-271733879,v=-1732584194,m=271733878;for(e=0;e<n.length;e+=16)i=l,a=g,h=v,d=m,l=o(l,g,v,m,n[e],7,-680876936),m=o(m,l,g,v,n[e+1],12,-389564586),v=o(v,m,l,g,n[e+2],17,606105819),g=o(g,v,m,l,n[e+3],22,-1044525330),l=o(l,g,v,m,n[e+4],7,-176418897),m=o(m,l,g,v,n[e+5],12,1200080426),v=o(v,m,l,g,n[e+6],17,-1473231341),g=o(g,v,m,l,n[e+7],22,-45705983),l=o(l,g,v,m,n[e+8],7,1770035416),m=o(m,l,g,v,n[e+9],12,-1958414417),v=o(v,m,l,g,n[e+10],17,-42063),g=o(g,v,m,l,n[e+11],22,-1990404162),l=o(l,g,v,m,n[e+12],7,1804603682),m=o(m,l,g,v,n[e+13],12,-40341101),v=o(v,m,l,g,n[e+14],17,-1502002290),g=o(g,v,m,l,n[e+15],22,1236535329),l=u(l,g,v,m,n[e+1],5,-165796510),m=u(m,l,g,v,n[e+6],9,-1069501632),v=u(v,m,l,g,n[e+11],14,643717713),g=u(g,v,m,l,n[e],20,-373897302),l=u(l,g,v,m,n[e+5],5,-701558691),m=u(m,l,g,v,n[e+10],9,38016083),v=u(v,m,l,g,n[e+15],14,-660478335),g=u(g,v,m,l,n[e+4],20,-405537848),l=u(l,g,v,m,n[e+9],5,568446438),m=u(m,l,g,v,n[e+14],9,-1019803690),v=u(v,m,l,g,n[e+3],14,-187363961),g=u(g,v,m,l,n[e+8],20,1163531501),l=u(l,g,v,m,n[e+13],5,-1444681467),m=u(m,l,g,v,n[e+2],9,-51403784),v=u(v,m,l,g,n[e+7],14,1735328473),g=u(g,v,m,l,n[e+12],20,-1926607734),l=c(l,g,v,m,n[e+5],4,-378558),m=c(m,l,g,v,n[e+8],11,-2022574463),v=c(v,m,l,g,n[e+11],16,1839030562),g=c(g,v,m,l,n[e+14],23,-35309556),l=c(l,g,v,m,n[e+1],4,-1530992060),m=c(m,l,g,v,n[e+4],11,1272893353),v=c(v,m,l,g,n[e+7],16,-155497632),g=c(g,v,m,l,n[e+10],23,-1094730640),l=c(l,g,v,m,n[e+13],4,681279174),m=c(m,l,g,v,n[e],11,-358537222),v=c(v,m,l,g,n[e+3],16,-722521979),g=c(g,v,m,l,n[e+6],23,76029189),l=c(l,g,v,m,n[e+9],4,-640364487),m=c(m,l,g,v,n[e+12],11,-421815835),v=c(v,m,l,g,n[e+15],16,530742520),g=c(g,v,m,l,n[e+2],23,-995338651),l=f(l,g,v,m,n[e],6,-198630844),m=f(m,l,g,v,n[e+7],10,1126891415),v=f(v,m,l,g,n[e+14],15,-1416354905),g=f(g,v,m,l,n[e+5],21,-57434055),l=f(l,g,v,m,n[e+12],6,1700485571),m=f(m,l,g,v,n[e+3],10,-1894986606),v=f(v,m,l,g,n[e+10],15,-1051523),g=f(g,v,m,l,n[e+1],21,-2054922799),l=f(l,g,v,m,n[e+8],6,1873313359),m=f(m,l,g,v,n[e+15],10,-30611744),v=f(v,m,l,g,n[e+6],15,-1560198380),g=f(g,v,m,l,n[e+13],21,1309151649),l=f(l,g,v,m,n[e+4],6,-145523070),m=f(m,l,g,v,n[e+11],10,-1120210379),v=f(v,m,l,g,n[e+2],15,718787259),g=f(g,v,m,l,n[e+9],21,-343485551),l=t(l,i),g=t(g,a),v=t(v,h),m=t(m,d);return[l,g,v,m]}function a(n){var t,r="",e=32*n.length;for(t=0;t<e;t+=8)r+=String.fromCharCode(n[t>>5]>>>t%32&255);return r}function h(n){var t,r=[];for(r[(n.length>>2)-1]=void 0,t=0;t<r.length;t+=1)r[t]=0;var e=8*n.length;for(t=0;t<e;t+=8)r[t>>5]|=(255&n.charCodeAt(t/8))<<t%32;return r}function d(n){return a(i(h(n),8*n.length))}function l(n,t){var r,e,o=h(n),u=[],c=[];for(u[15]=c[15]=void 0,o.length>16&&(o=i(o,8*n.length)),r=0;r<16;r+=1)u[r]=909522486^o[r],c[r]=1549556828^o[r];return e=i(u.concat(h(t)),512+8*t.length),a(i(c.concat(e),640))}function g(n){var t,r,e="0123456789abcdef",o="";for(r=0;r<n.length;r+=1)t=n.charCodeAt(r),o+=e.charAt(t>>>4&15)+e.charAt(15&t);return o}function v(n){return unescape(encodeURIComponent(n))}function m(n){return d(v(n))}function p(n){return g(m(n))}function s(n,t){return l(v(n),v(t))}function C(n,t){return g(s(n,t))}function A(n,t,r){return t?r?s(t,n):C(t,n):r?m(n):p(n)}"function"==typeof define&&define.amd?define(function(){return A}):"object"==typeof module&&module.exports?module.exports=A:n.md5=A}(this);var store=new Vuex.Store({state:{comments:[],commentsById:{},user:{name:"",username:"",email:"",notify:1,loggedin:window.compojoom.ccomment.user.loggedin,avatar:window.compojoom.ccomment.user.avatar},pagination:{total:0,total_with_children:0,offset:window.compojoom.ccomment.config.comments_per_page,current_page:1,last_page:0,from:1,to:9},editComment:{},quoteComment:{},itemConfig:window.compojoom.ccomment.item,userConfig:window.compojoom.ccomment.user,config:window.compojoom.ccomment.config,token:jQuery("#ccomment-token").find("input").attr("name"),activeForm:null},mutations:{activeForm:function(state,form){Vue.set(state,"activeForm",form)},UPDATE_COMMENTS:function(state,comments){state.comments.splice(0);comments.forEach(function(comment){state.commentsById[comment.id]=comment;state.comments.push(comment)})},UPDATE_PAGINATION:function(state,info){Vue.set(state.pagination,"total",info.countParents);Vue.set(state.pagination,"total_with_children",info.total);Vue.set(state.pagination,"current_page",info.page);Vue.set(state.pagination,"last_page",state.pagination.offset?Math.ceil(info.countParents/state.pagination.offset):0)},editComment:function(state,comment){Vue.set(state,"editComment",comment)},quoteComment:function(state,comment){Vue.set(state,"quoteComment",comment)},addComment:function(state,comment){if(comment.parentid!==-1){state.commentsById[comment.parentid].children.push(comment.id)}state.commentsById[comment.id]=comment;if(state.config.sort===1){state.comments.unshift(comment);return}state.comments.push(comment)},removeComment:function(state,id){var index=state.comments.findIndex(function(element){if(element.id===id){return true}});delete state.commentsById[id];if(index>-1){state.comments.splice(index,1)}},updateComment:function(state,comment){var id=comment.id;Object.keys(comment).forEach(function(value){Vue.set(state.commentsById[id],value,comment[value])})},updateDefaultName:function(state,name){if(!state.loggedin){Cookies.set("compojoom.ccomment.user.name",name);if(state.config.use_name){state.user.name=name}else{state.user.username=name}}},updateUserEmail:function(state,email){Cookies.set("compojoom.ccomment.user.email",email);state.user.email=email}},getters:{getName:function(state){var name=state.config.use_name?state.user.name:state.user.username;if(!name){name=Cookies.get("compojoom.ccomment.user.name")}if(state.loggedin){Cookies.remove("compojoom.ccomment.user.name")}return name},getDefaultName:function(state,getters){var name=getters.getName;if(!name){name=Joomla.JText._("COM_COMMENT_ANONYMOUS","Anonymous")}return name},getAvatar:function(state,getters){var avatar=state.user.avatar,email=getters.getEmail;if(!state.loggedin){if(state.config.gravatar){if(email){avatar="https://www.gravatar.com/avatar/"+md5(email)}}}return avatar},getEmail:function(state){var email=state.user.email;if(!email){email=Cookies.get("compojoom.ccomment.user.email")}if(state.user.loggedin){Cookies.remove("compojoom.ccomment.user.email")}return email}},actions:{fetchComments:function(props,queryParams){var config=props.state.config,itemConfig=props.state.itemConfig;queryParams=queryParams?queryParams:{start:props.state.pagination.current_page};return jQuery.ajax(config.baseUrl+"?option=com_comment&task=comments.getcomments&format=json&lang="+config.langCode+"&contentid="+itemConfig.contentid+"&component="+itemConfig.component,{dataType:"json",data:queryParams}).done(function(data){props.commit("UPDATE_COMMENTS",data.models);props.commit("UPDATE_PAGINATION",data.info)})},putComment:function(props,comment){if(props.state.commentsById[comment.id]){props.commit("updateComment",comment)}else{props.commit("addComment",comment)}},editComment:function(props,comment){props.commit("editComment",comment)},resetComments:function(props,data){props.commit("UPDATE_COMMENTS",data.models);props.commit("UPDATE_PAGINATION",data.info)}}});Vue.component("ccomment-user-name",{template:"#ccomment-user-name",props:{name:String,profileLink:String}});Vue.component("ccomment-created",{template:"#ccomment-created",props:{date:String,id:Number}});Vue.component("ccomment-customfields",{template:"#ccomment-customfields",props:{customfields:Array}});"use strict";var pagination=Vue.extend({template:"#ccomment-pagination",props:{pagination:{type:Object,required:!0},callback:{type:Function,required:!0},options:{type:Object}},computed:{array:function(){if(this.pagination.last_page<=0)return[];var t=this.pagination.current_page-this.pagination.offset;t<1&&(t=1);var a=t+this.pagination.to;a>=this.pagination.last_page&&(a=this.pagination.last_page);for(var i=[];t<=a;)i.push(t),t++;return i},config:function(){return Object.assign({offset:3,alwaysShowPrevNext:!0},this.options)}},methods:{showPrevious:function(){return this.config.alwaysShowPrevNext||this.pagination.current_page>1},showNext:function(){return this.config.alwaysShowPrevNext||this.pagination.current_page<this.pagination.last_page},changePage:function(t){this.pagination.current_page!==t&&(this.$set(this.pagination,"current_page",t),this.callback())}}});Vue.component("ccomment-avatar",{template:"#ccomment-avatar",props:{avatar:String,profileLink:String}});Vue.component("ccomment-menu",{template:"#ccomment-menu",data:function(){return{pagination:this.$store.state.pagination}},methods:{newComment:function(){bus.$emit("newComment")}}});Vue.component("ccomment-comment",{template:"#ccomment-template",props:{model:Object},data:function(){return{open:false,reply:false}},mounted:function(){if(this.model.galleria){Galleria.run(jQuery(this.$el).find(".js-ccomment-galleria"),{dataSource:this.model.galleria})}},updated:function(){if(this.model.galleria){Galleria.run(jQuery(this.$el).find(".js-ccomment-galleria"),{dataSource:this.model.galleria})}},computed:{hasChildren:function(){return this.model.children&&this.model.children.length},showReply:function(){if(this.model.level===0&&this.model.parentid!==-1){return false}return this.$store.state.config.tree_depth>this.model.level}},methods:{getChild:function(){var self=this;if(this.model.children&&this.model.children.length){var comments=this.model.children.map(function(id){return self.$store.state.commentsById[id]});return comments}return[]},changeState:function(state,id){var self=this;var config=this.$store.state.config;var url=config.baseUrl+"?option=com_comment&task=comment.changestate&id="+id+"&format=json&"+this.$store.state.token+"=1"+"&state="+state+"&lang="+config.langCode;jQuery.ajax(url,{type:"get"}).done(function(response){if(response.status==="success"){if(state===-1){self.$store.commit("removeComment",id)}else{self.$store.commit("updateComment",{id:id,published:state})}}})},vote:function(vote,id){var self=this;var config=this.$store.state.config;var url=config.baseUrl+"?option=com_comment&task=comment.vote&vote="+vote+"&id="+id+"&format=json&"+this.$store.state.token+"=1"+"&lang="+config.langCode;jQuery.ajax(url,{type:"get",dataType:"json"}).done(function(response){self.$store.commit("updateComment",{id:id,votes:response.votes})})},edit:function(id){var self=this;var config=this.$store.state.config;var url=config.baseUrl+"?option=com_comment&task=comment.edit&format=json&id="+id+"&"+this.$store.state.token+"=1&component="+this.$store.state.itemConfig.component+"&lang="+config.langCode;jQuery.ajax(url,{method:"GET",dataType:"json"}).done(function(comment){if(comment!=undefined){self.$store.dispatch("editComment",comment)}})},quote:function(id){var self=this;var config=this.$store.state.config;var url=config.baseUrl+"?option=com_comment&task=comment.quote&format=json&id="+id+"&lang="+config.langCode;jQuery.ajax(url,{method:"GET",dataType:"json"}).done(function(comment){self.$store.commit("quoteComment",comment)})}}});Vue.component("ccomment-form",{store:store,template:"#ccomment-form",props:["focus"],data:function(){return{error:false,errorMessage:"",info:false,infoMessage:"",recaptcha:false,display:false,active:false,notify:false,itemConfig:this.$store.state.itemConfig,config:this.$store.state.config,uploadImage:false,upload:false,isSending:false}},watch:{notify:function(val){if(this.displayingNameFormRequired()){this.display=true;return}this.display=val}},computed:{getName:function(){return this.$store.getters.getName},getEmail:function(){return this.$store.getters.getEmail},getDefaultName:function(){return this.$store.getters.getDefaultName},getAvatar:function(){return this.$store.getters.getAvatar},page:function(){return this.$store.state.pagination.current_page}},created:function(){var self=this;this.$store.watch(function(state){return state.editComment},function(){self.handleEdit()});this.$store.watch(function(state){return state.quoteComment},function(){self.handleQuote()});this.$store.watch(function(state){return state.pagination.current_page},function(){self.$store.commit("activeForm",null)});bus.$on("newComment",function(){if(self.isActiveForm()){jQuery("html, body").animate({scrollTop:jQuery(self.$el).offset().top},{duration:400,complete:function(){var commentTextarea=jQuery(self.$el).find("textarea.js-ccomment-textarea");commentTextarea.focus()}})}})},mounted:function(){if(this.focus){this.toggle()}},methods:{isActiveForm:function(){if(this.$store.state.activeForm===null||this.$store.state.activeForm===this._uid){return true}return false},handleEdit:function(){var state=this.$store.state;if(this.isActiveForm()){this.reset();this.toggle();var comment=state.editComment;var form=jQuery(this.$el);if(comment.name==""){comment.name="COM_COMMENT_ANONYMOUS"}Object.keys(comment).forEach(function(key){if(key==="customfields"){comment.customfields.forEach(function(field){var formField=form.find('[name="jform[customfields]['+field.name+']"]');if(formField){formField.val(field.value)}})}else{if(key==="notify"){form.find('[name="jform['+key+']"]').attr("checked",parseInt(comment.notify)?true:false)}else if(key==="id"){if(form.find('[name="jform[id]"]').length>0){form.find('[name="jform[id]"]').val(comment.id)}else{form.append('<input type="hidden" value="'+comment.id+'" name="jform[id]" />')}}else{form.find('[name="jform['+key+']"]').val(comment[key])}}});form.find("textarea.js-ccomment-textarea").focus();this.sce.sceditor("instance").val(comment.comment);this.loadExistingFiles(comment.id)}},handleQuote:function(){if(this.isActiveForm()){var comment=this.$store.state.quoteComment,text;var commentTextarea=jQuery(this.$el).find("textarea.js-ccomment-textarea");commentTextarea.focus();if(comment!=undefined){if(comment.name==""){comment.name="COM_COMMENT_ANONYMOUS"}text="[quote="+comment.name+"]"+comment.comment+"[/quote]"}else{text="failed to fetch comment"}if(!this.sce){commentTextarea.val(commentTextarea.val()+text)}else{this.sce.sceditor("instance").insert(text)}}},displayingNameFormRequired:function(){if(this.config.name_required&&!this.$store.getters.getName){return true}if(this.config.email_required&&!this.$store.getters.getEmail){return true}return false},toggle:function(){if(this.displayingNameFormRequired()){this.display=true}this.$store.commit("activeForm",this._uid);this.active=true;if(this.config.support_ubb&&!this.sce){this.sce=this.initBBCodeEditor()}else{autosize(jQuery(this.$el).find("textarea"))}if(this.config.captcha_pub_key&&this.recaptcha===false){this.recaptcha=grecaptcha.render(jQuery(this.$el).find("div.ccomment-recaptcha-placeholder")[0],{sitekey:this.config.captcha_pub_key})}this.fileupload=this.initFileUpload()},getToken:function(){return this.$store.state.token},updateDefaultName:function(e){this.$store.commit("updateDefaultName",e.target.value)},updateUserEmail:function(e){this.$store.commit("updateUserEmail",e.target.value)},onSubmit:function(){var self=this;var url=this.config.baseUrl+"?option=com_comment&task=comment.insert&format=json&"+this.getToken()+"=1&lang="+this.config.langCode;var inputArray=jQuery(this.$el).serializeArray();jQuery.ajax(url,{method:"POST",data:inputArray,beforeSend:function(){self.isSending=true;self.error=false}}).done(function(response){self.isSending=false;if(response.status&&response.status==="error"){self.error=true;self.errorMessage=response.message;return}if(response.status&&response.status==="info"){self.info=true;self.infoMessage=response.message;self.reset();return}if(response.info){self.$store.dispatch("resetComments",response);location.hash="#ccomment-page="+self.$store.state.pagination.current_page;self.$nextTick(function(){jQuery("html, body").animate({scrollTop:jQuery("#ccomment-comment-"+response.info.insertedId).offset().top},200)})}else{self.$store.dispatch("putComment",response);self.$store.commit("UPDATE_PAGINATION",Object.assign({},self.$store.state.pagination,{total:parseInt(self.$store.state.pagination.total_with_children)+1}));self.$nextTick(function(){jQuery("html, body").animate({scrollTop:jQuery("#ccomment-comment-"+response.id).offset().top},200)})}self.reset()})},reset:function(){this.display=false;this.active=false;this.uploadImage=false;this.$parent.reply=false;jQuery(this.$el).find('[name="jform[id]"]').remove();jQuery(this.$el).trigger("reset");if(this.config.support_ubb&&this.sce){this.sce.sceditor("instance").destroy();this.sce=false}if(this.recaptcha!==false){grecaptcha.reset(this.recaptcha)}if(this.fileupload){jQuery(this.$el).find(".fileupload").fileupload("destroy");jQuery(this.$el).find(".fileupload").replaceWith(this.fileUploadNode);this.fileupload=null}},initBBCodeEditor:function(){var sce,self=this,textarea=jQuery(this.$el).find("textarea.js-ccomment-textarea"),config=this.config,emoticon=config.support_emoticons?"emoticon":"",picture=config.support_picture?"image":"";jQuery.sceditor.command.set("imageFileUpload",{exec:function(caller){var editor=this;self.uploadImage=!self.uploadImage},state:function(){return self.uploadImage}});var toolbar=emoticon+"|bold,italic,underline,strike|"+picture+",link,youtube|quote,code|color,size|source|imageFileUpload";if(jQuery(window).width()<380){toolbar=emoticon+"|bold,italic,underline,strike|"}sce=textarea.sceditor({format:"bbcode",plugins:"autoyoutube,plaintext",toolbar:toolbar,style:"/media/com_comment/js/vendor/sceditor/jquery.sceditor.default.min.css",height:150,width:"100%",autofocus:true,autoExpand:true,autoUpdate:true,resizeEnabled:false,resizeMaxHeight:300,emoticonsCompat:true,emoticonsRoot:config.baseUrl,emoticons:config.emoticons_pack,emoticonsEnabled:config.support_emoticons});sce.sceditor("instance").focus(function(e){self.$store.commit("activeForm",self._uid)});return sce},initFileUpload:function(){var fileupload,self=this,el=jQuery(this.$el),fileUploadEl=el.find(".fileupload"),ccommentFileUpload=this.config.file_upload,numFilesEl=fileUploadEl.find(".compojoom-max-number-files");fileUploadEl.find(".js-file-upload-fake")[0].addEventListener("click",function(){fileUploadEl.find(".js-ccomment-file-upload-real")[0].click()});var $=jQuery;this.fileUploadNode=fileUploadEl.clone();fileupload=fileUploadEl.fileupload({formData:{},dropZone:el,autoUpload:true,maxFileSize:ccommentFileUpload.maxSize+"M",maxNumberOfFiles:ccommentFileUpload.maxNumberOfFiles,url:ccommentFileUpload.url+"&"+this.$store.state.token+"=1",disableImageResize:false,imageMaxWidth:ccommentFileUpload.imageSize.x,imageMaxHeight:ccommentFileUpload.imageSize.y,start:function(e){self.uploadImage=true},finished:function(e,data){if($(this).fileupload("option").getNumberOfFiles()>=ccommentFileUpload.maxNumberOfFiles){numFilesEl.removeClass("hide d-none")}else{numFilesEl.addClass("hide d-none")}},destroyed:function(e,data){if($(this).fileupload("option").getNumberOfFiles()>=ccommentFileUpload.maxNumberOfFiles){numFilesEl.removeClass("hide d-none")}else{numFilesEl.addClass("hide d-none")}}}).on("destroyed",function(e,data){if($(this).fileupload("option").getNumberOfFiles()>=ccommentFileUpload.maxNumberOfFiles){numFilesEl.removeClass("hide d-none")}else{numFilesEl.addClass("hide d-none")}}).on("fileuploadadd",function(e,data){$(".fileupload-progress.hide").removeClass("hide d-none")});return fileupload},loadExistingFiles:function(id){var self=this,$=jQuery,fileUploadEl=$(this.$el).find(".fileupload");fileUploadEl.addClass("fileupload-processing");$.ajax({url:this.config.file_upload.url+"&"+this.$store.state.token+"=1&id="+id,dataType:"json",context:fileUploadEl}).always(function(){$(this).removeClass("fileupload-processing")}).done(function(result){if(result.files.length){self.uploadImage=true}$(this).fileupload("option","done").call(this,$.Event("done"),{result:result})})}}});var bus=new Vue;var demo=new Vue({el:"#ccomment",store:store,data:{comments:store.state.comments,pagination:store.state.pagination,paginationOptions:{}},created:function(){var self=this;this.$store.dispatch("fetchComments",this.getQueryHashParam()).then(function(){if(location.hash.indexOf("#ccomment-comment=")===0){var comment=location.hash.replace("#ccomment-comment=","");self.$nextTick(function(){jQuery("html, body").animate({scrollTop:jQuery("#ccomment-comment-"+comment).offset().top},200)})}})},components:{pagination:pagination},methods:{newComment:function(){console.log("capture new comment in parent")},loadData:function(){this.$store.dispatch("fetchComments",{start:this.pagination.current_page});location.hash="#ccomment-page="+this.pagination.current_page;jQuery("html, body").animate({scrollTop:jQuery(".ccomment").offset().top},200)},getQueryHashParam:function(){if(location.hash.indexOf("#ccomment-page=")===0){return{start:location.hash.replace("#ccomment-page=","")}}if(location.hash.indexOf("#ccomment-comment=")===0){return{comment:location.hash.replace("#ccomment-comment=","")}}}}});