webpackJsonp([7],{0:function(e,t,n){e.exports=n(230)},7:function(e,t){"use strict";function n(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=Object.assign||function(e,t){for(var i,r,s=n(e),o=1;o<arguments.length;o++){i=arguments[o],r=Object.keys(Object(i));for(var a=0;a<r.length;a++)s[r[a]]=i[r[a]]}return s}},9:function(e,t,n){var i,r;/*!
	  Copyright (c) 2016 Jed Watson.
	  Licensed under the MIT License (MIT), see
	  http://jedwatson.github.io/classnames
	*/
!function(){"use strict";function n(){for(var e=[],t=0;t<arguments.length;t++){var i=arguments[t];if(i){var r=typeof i;if("string"===r||"number"===r)e.push(i);else if(Array.isArray(i))e.push(n.apply(null,i));else if("object"===r)for(var o in i)s.call(i,o)&&i[o]&&e.push(o)}}return e.join(" ")}var s={}.hasOwnProperty;"undefined"!=typeof e&&e.exports?e.exports=n:(i=[],r=function(){return n}.apply(t,i),!(void 0!==r&&(e.exports=r)))}()},10:function(e,t){"use strict";function n(e){return document.querySelector(e)}function i(e){var t=document.querySelectorAll(e);return Array.prototype.slice.call(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.q=n,t.qAll=i},16:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=i(s),a=n(34),u=i(a),l=n(36),c=i(l),d=n(35),p=i(d),h=o.default.createClass({displayName:"FormElement",propTypes:{type:o.default.PropTypes.string,label:o.default.PropTypes.string.isRequired,multiple:o.default.PropTypes.bool,name:o.default.PropTypes.string.isRequired,handleChange:o.default.PropTypes.func.isRequired,value:o.default.PropTypes.oneOfType([o.default.PropTypes.array,o.default.PropTypes.bool,o.default.PropTypes.number,o.default.PropTypes.string,o.default.PropTypes.array]).isRequired,help:o.default.PropTypes.string,errors:o.default.PropTypes.array},getDefaultProps:function(){return{type:"text"}},render:function(){var e=this.props.errors,t="id_"+this.props.name,n=this.props.help,i={text:c.default,email:c.default,password:c.default,textarea:c.default,checkbox:u.default,radio:u.default,select:p.default}[this.props.type];return o.default.createElement("div",{className:"field-wrapper"},o.default.createElement("label",{htmlFor:t},this.props.label),o.default.createElement(i,r({id:t},this.props)),e&&o.default.createElement("ul",{className:"errorlist"},e.map(function(e,t){return o.default.createElement("li",{key:t},e)})),n&&o.default.createElement("span",{className:"helptext"},n))}});t.default=h},18:function(e,t,n){/*!
	  Copyright (c) 2015 Jed Watson.
	  Licensed under the MIT License (MIT), see
	  http://jedwatson.github.io/classnames
	*/
function i(){for(var e,t="",n=0;n<arguments.length;n++)if(e=arguments[n])if("string"==typeof e||"number"==typeof e)t+=" "+e;else if("[object Array]"===Object.prototype.toString.call(e))t+=" "+i.apply(null,e);else if("object"==typeof e)for(var r in e)e.hasOwnProperty(r)&&e[r]&&(t+=" "+r);return t.substr(1)}var r,s;"undefined"!=typeof e&&e.exports&&(e.exports=i),r=[],s=function(){return i}.apply(t,r),!(void 0!==s&&(e.exports=s))},21:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){return(e||window).location.toString().split("#",2)[1]||""}function s(e){return decodeURIComponent(e.replace(/\+/g," "))}function o(e){var t={},n=/([^&;=]+)=?([^&;]*)/g,i=e;void 0===i&&(i=r());for(var o=n.exec(i);null!==o;)t[s(o[1])]=s(o[2]),o=n.exec(i);return t}function a(e,t,n,i){var o=/([^&;=]+)=?([^&;]*)/g,a=[],u=i;void 0===u&&(u=r());for(var l=!1,c=o.exec(u);null!==c;){var d=s(c[1]);d===e?(a.push([c[1],encodeURIComponent(t)].join("=")),l=!0):y.default.inArray(d,n)===-1&&a.push([c[1],c[2]].join("=")),c=o.exec(u)}return l||a.push([encodeURIComponent(e),encodeURIComponent(t)].join("=")),a.join("&")}function u(e,t){var n=void 0;return n=e===t?0:e<t?-1:1}function l(e){return(0,C.nl2br)((0,C.highlightEscapes)((0,C.highlightHtml)((0,w.raw2sym)(e.replace(/\r\n/g,"\n")))))}function c(e){return(0,C.highlightSymbols)((0,C.nl2br)((0,C.highlightPunctuation)((0,C.highlightEscapes)((0,C.highlightHtml)((0,w.raw2sym)(e.replace(/\r\n/g,"\n")),"js-editor-copytext"),"js-editor-copytext"),"js-editor-copytext")),"js-editor-copytext")}function d(e,t){(0,b.qAll)(e).forEach(function(e){var n=e.dataset.string,i=n?JSON.parse('"'+n+'"'):e.textContent;e.innerHTML=t(i)})}function p(e){return d(e,l)}function h(e){return d(e,c)}function f(e,t,n,i){var r=(0,y.default)(e);r.length&&(r.select2(t).on("select2:unselecting",function(){(0,y.default)(this).data("state","unselected")}).on("select2:open",function(){"unselected"===(0,y.default)(this).data("state")&&((0,y.default)(this).removeData("state"),(0,y.default)(this).select2("close"))}),r.on("change",n),r.on("select2-selecting",i),(0,y.default)(".select2-selection__rendered").removeAttr("title"))}function g(e,t){for(var n=e.split("."),i=n.pop(),r=t,s=0;s<n.length;s++)r=r[n[s]];for(var o=arguments.length,a=Array(o>2?o-2:0),u=2;u<o;u++)a[u-2]=arguments[u];return r[i].apply(this,a)}function m(e,t,n,i){e.toggleClass(t),n>1&&setTimeout(function(){return m(e,t,n-1,i)},i)}Object.defineProperty(t,"__esModule",{value:!0}),t.getHash=r,t.getParsedHash=o,t.updateHashPart=a,t.strCmp=u,t.highlightRO=l,t.highlightRW=c,t.highlightRONodes=p,t.highlightRWNodes=h,t.makeSelectableInput=f,t.executeFunctionByName=g,t.blinkClass=m;var v=n(3),y=i(v);n(51);var b=n(10),C=n(48),w=n(47);t.default={blinkClass:m,executeFunctionByName:g,highlightRO:l,highlightRW:c,highlightRONodes:p,highlightRWNodes:h,getHash:r,getParsedHash:o,makeSelectableInput:f,strCmp:u,updateHashPart:a}},27:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(32),o=i(s),a=n(1),u=i(a),l=u.default.createClass({displayName:"AutosizeTextarea",componentDidMount:function(){(0,o.default)(this.refs.textarea)},componentDidUpdate:function(){var e=this;setTimeout(function(){return o.default.update(e.refs.textarea)},0)},componentWillUnmount:function(){o.default.destroy(this.refs.textarea)},render:function(){return u.default.createElement("textarea",r({ref:"textarea"},this.props))}});t.default=l},28:function(e,t){"use strict";function n(e){var t=null;if(document.cookie&&""!==document.cookie)for(var n=document.cookie.split(";"),i=0;i<n.length;i++){var r=n[i].trim();if(r.substring(0,e.length+1)===e+"="){t=decodeURIComponent(r.substring(e.length+1));break}}return t}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=null===t?"":t,r=null===t?-1:n.expires,s="";if(r&&("number"==typeof r||r.toUTCString)){var o=void 0;"number"==typeof r?(o=new Date,o.setTime(o.getTime()+24*r*60*60*1e3)):o=n.expiryDate,s="; expires="+o.toUTCString()}var a=n.path?"; path="+n.path:"",u=n.domain?"; domain="+n.domain:"",l=n.secure?"; secure":"";document.cookie=e+"="+encodeURIComponent(i)+(""+s+a+u+l)}function r(e,t,r){return void 0===t?n(e):i(e,t,r)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r},29:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=e.url,n=e.body,i=e.method,r=void 0===i?"GET":i,s=e.dataType,u=void 0===s?"json":s,c=e.queue,d=void 0===c?null:c,p=e.crossDomain,h=void 0!==p&&p,f=d||t;return a[f]&&a[f].abort(),a[f]=o.default.ajax({crossDomain:h,method:r,dataType:u,url:l(t),data:n}),a[f].done(function(){a[f]=null}),a[f]}Object.defineProperty(t,"__esModule",{value:!0});var s=n(3),o=i(s),a={};t.default=r},32:function(e,t,n){var i,r,s;/*!
		Autosize 3.0.21
		license: MIT
		http://www.jacklmoore.com/autosize
	*/
!function(n,o){r=[t,e],i=o,s="function"==typeof i?i.apply(t,r):i,!(void 0!==s&&(e.exports=s))}(this,function(e,t){"use strict";function n(e){function t(){var t=window.getComputedStyle(e,null);"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),u="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(u)&&(u=0),a()}function n(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function i(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}function r(){var t=e.style.height,n=i(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="auto";var s=e.scrollHeight+u;return 0===e.scrollHeight?void(e.style.height=t):(e.style.height=s+"px",l=e.clientWidth,n.forEach(function(e){e.node.scrollTop=e.scrollTop}),void(r&&(document.documentElement.scrollTop=r)))}function a(){r();var t=Math.round(parseFloat(e.style.height)),i=window.getComputedStyle(e,null),s="content-box"===i.boxSizing?Math.round(parseFloat(i.height)):e.offsetHeight;if(s!==t?"hidden"===i.overflowY&&(n("scroll"),r(),s="content-box"===i.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==i.overflowY&&(n("hidden"),r(),s="content-box"===i.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),c!==s){c=s;var a=o("autosize:resized");try{e.dispatchEvent(a)}catch(e){}}}if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!s.has(e)){var u=null,l=e.clientWidth,c=null,d=function(){e.clientWidth!==l&&a()},p=function(t){window.removeEventListener("resize",d,!1),e.removeEventListener("input",a,!1),e.removeEventListener("keyup",a,!1),e.removeEventListener("autosize:destroy",p,!1),e.removeEventListener("autosize:update",a,!1),Object.keys(t).forEach(function(n){e.style[n]=t[n]}),s.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",p,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",a,!1),window.addEventListener("resize",d,!1),e.addEventListener("input",a,!1),e.addEventListener("autosize:update",a,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",s.set(e,{destroy:p,update:a}),t()}}function i(e){var t=s.get(e);t&&t.destroy()}function r(e){var t=s.get(e);t&&t.update()}var s="function"==typeof Map?new Map:function(){var e=[],t=[];return{has:function(t){return e.indexOf(t)>-1},get:function(n){return t[e.indexOf(n)]},set:function(n,i){e.indexOf(n)===-1&&(e.push(n),t.push(i))},delete:function(n){var i=e.indexOf(n);i>-1&&(e.splice(i,1),t.splice(i,1))}}}(),o=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){o=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var a=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(a=function(e){return e},a.destroy=function(e){return e},a.update=function(e){return e}):(a=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return n(e,t)}),e},a.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},a.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e}),t.exports=a})},34:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=i(s),a=o.default.createClass({displayName:"FormCheckedInput",propTypes:{handleChange:o.default.PropTypes.func.isRequired,value:o.default.PropTypes.bool.isRequired},handleChange:function(e){this.props.handleChange(e.target.name,e.target.checked)},render:function(){return o.default.createElement("input",r({checked:this.props.value,onChange:this.handleChange},this.props))}});t.default=a},35:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=i(s),a=n(41),u=i(a),l=o.default.createClass({displayName:"FormSelectInput",propTypes:{handleChange:o.default.PropTypes.func.isRequired,multiple:o.default.PropTypes.bool,name:o.default.PropTypes.string.isRequired,options:o.default.PropTypes.array.isRequired,value:o.default.PropTypes.oneOfType([o.default.PropTypes.array,o.default.PropTypes.number,o.default.PropTypes.string,o.default.PropTypes.array]).isRequired},handleChange:function(e){var t=this.props.multiple?e.split(","):e;this.props.handleChange(this.props.name,t)},render:function(){var e=this.props.value,t=this.props.multiple?e:e.toString();return o.default.createElement(u.default,r({clearAllText:gettext("Clear all"),clearValueText:gettext("Clear value"),noResultsText:gettext("No results found"),onChange:this.handleChange,placeholder:gettext("Select..."),searchPromptText:gettext("Type to search")},this.props,{multi:this.props.multiple,value:t}))}});t.default=l},36:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=i(s),a=n(27),u=i(a),l=o.default.createClass({displayName:"FormValueInput",propTypes:{handleChange:o.default.PropTypes.func.isRequired,autosize:o.default.PropTypes.bool,type:o.default.PropTypes.string,value:o.default.PropTypes.string},getDefaultProps:function(){return{autosize:!0}},handleChange:function(e){this.props.handleChange(e.target.name,e.target.value)},render:function(){return"textarea"===this.props.type?this.props.autosize?o.default.createElement(u.default,r({onChange:this.handleChange},this.props)):o.default.createElement("textarea",r({onChange:this.handleChange},this.props)):o.default.createElement("input",r({onChange:this.handleChange},this.props))}});t.default=l},37:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){for(var n=[],i=0,r=e,s=[];r;){if(s=/^[^\x25]+/.exec(r),null!==s)n.push(s[0]);else{if(s=/^\x25\(([^\)]+)\)s/.exec(r),null===s)throw new Error("Wrong format");if(s[1]){var o=t[s[1]];l.default.isValidElement(o)?n.push(l.default.cloneElement(o,{key:i++})):n.push(o)}}r=r.substring(s[0].length)}return n}function s(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t?r(gettext(e),t):[gettext(e)]}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t?interpolate(gettext(e),t,!0):gettext(e)}function a(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return i?interpolate(ngettext(e,t,n),i,!0):ngettext(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0}),t.tct=s,t.t=o,t.nt=a;var u=n(1),l=i(u)},39:function(e,t,n){"use strict";var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},r=n(1),s={position:"absolute",visibility:"hidden",height:0,width:0,overflow:"scroll",whiteSpace:"pre"},o=("undefined"!=typeof window?function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}().bind(window):void 0,r.createClass({displayName:"AutosizeInput",propTypes:{value:r.PropTypes.any,defaultValue:r.PropTypes.any,onChange:r.PropTypes.func,style:r.PropTypes.object,className:r.PropTypes.string,minWidth:r.PropTypes.oneOfType([r.PropTypes.number,r.PropTypes.string]),inputStyle:r.PropTypes.object,inputClassName:r.PropTypes.string},getDefaultProps:function(){return{minWidth:1}},getInitialState:function(){return{inputWidth:this.props.minWidth}},componentDidMount:function(){this.copyInputStyles(),this.updateInputWidth()},componentDidUpdate:function(){this.updateInputWidth()},copyInputStyles:function(){if(this.isMounted()&&window.getComputedStyle){var e=window.getComputedStyle(this.refs.input);if(e){var t=this.refs.sizer;if(t.style.fontSize=e.fontSize,t.style.fontFamily=e.fontFamily,t.style.fontWeight=e.fontWeight,t.style.fontStyle=e.fontStyle,t.style.letterSpacing=e.letterSpacing,this.props.placeholder){var n=this.refs.placeholderSizer;n.style.fontSize=e.fontSize,n.style.fontFamily=e.fontFamily,n.style.fontWeight=e.fontWeight,n.style.fontStyle=e.fontStyle,n.style.letterSpacing=e.letterSpacing}}}},updateInputWidth:function(){if(this.isMounted()&&"undefined"!=typeof this.refs.sizer.scrollWidth){var e=void 0;e=this.props.placeholder?Math.max(this.refs.sizer.scrollWidth,this.refs.placeholderSizer.scrollWidth)+2:this.refs.sizer.scrollWidth+2,e<this.props.minWidth&&(e=this.props.minWidth),e!==this.state.inputWidth&&this.setState({inputWidth:e})}},getInput:function(){return this.refs.input},focus:function(){this.refs.input.focus()},blur:function(){this.refs.input.blur()},select:function(){this.refs.input.select()},render:function(){var e=this.props.defaultValue||this.props.value||"",t=this.props.style||{};t.display||(t.display="inline-block");var n=i({},this.props.inputStyle);n.width=this.state.inputWidth+"px",n.boxSizing="content-box";var o=this.props.placeholder?r.createElement("div",{ref:"placeholderSizer",style:s},this.props.placeholder):null;return r.createElement("div",{className:this.props.className,style:t},r.createElement("input",i({},this.props,{ref:"input",className:this.props.inputClassName,style:n})),r.createElement("div",{ref:"sizer",style:s},e),o)}}));e.exports=o},40:function(e,t,n){"use strict";var i=n(1),r=n(9),s=i.createClass({displayName:"Option",propTypes:{addLabelText:i.PropTypes.string,className:i.PropTypes.string,mouseDown:i.PropTypes.func,mouseEnter:i.PropTypes.func,mouseLeave:i.PropTypes.func,option:i.PropTypes.object.isRequired,renderFunc:i.PropTypes.func},blockEvent:function(e){e.preventDefault(),"A"===e.target.tagName&&"href"in e.target&&(e.target.target?window.open(e.target.href):window.location.href=e.target.href)},handleMouseDown:function(e){this.props.mouseDown(this.props.option,e)},handleMouseEnter:function(e){this.props.mouseEnter(this.props.option,e)},handleMouseLeave:function(e){this.props.mouseLeave(this.props.option,e)},render:function(){var e=this.props.option,t=e.create?this.props.addLabelText.replace("{label}",e.label):this.props.renderFunc(e),n=r(this.props.className,e.className);return e.disabled?i.createElement("div",{className:n,onMouseDown:this.blockEvent,onClick:this.blockEvent},t):i.createElement("div",{className:n,style:e.style,onMouseDown:this.handleMouseDown,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onClick:this.handleMouseDown,title:e.title},t)}});e.exports=s},41:function(e,t,n){"use strict";function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=n(12),a=n(39),u=n(9),l=n(43),c=n(42),d=n(40),p=0,h=s.createClass({displayName:"Select",propTypes:{addLabelText:s.PropTypes.string,allowCreate:s.PropTypes.bool,asyncOptions:s.PropTypes.func,autoload:s.PropTypes.bool,backspaceRemoves:s.PropTypes.bool,cacheAsyncResults:s.PropTypes.bool,className:s.PropTypes.string,clearAllText:s.PropTypes.string,clearValueText:s.PropTypes.string,clearable:s.PropTypes.bool,delimiter:s.PropTypes.string,disabled:s.PropTypes.bool,filterOption:s.PropTypes.func,filterOptions:s.PropTypes.func,ignoreCase:s.PropTypes.bool,inputProps:s.PropTypes.object,isLoading:s.PropTypes.bool,labelKey:s.PropTypes.string,matchPos:s.PropTypes.string,matchProp:s.PropTypes.string,multi:s.PropTypes.bool,name:s.PropTypes.string,newOptionCreator:s.PropTypes.func,noResultsText:s.PropTypes.string,onBlur:s.PropTypes.func,onChange:s.PropTypes.func,onFocus:s.PropTypes.func,onInputChange:s.PropTypes.func,onOptionLabelClick:s.PropTypes.func,optionComponent:s.PropTypes.func,optionRenderer:s.PropTypes.func,options:s.PropTypes.array,placeholder:s.PropTypes.string,searchable:s.PropTypes.bool,searchingText:s.PropTypes.string,searchPromptText:s.PropTypes.string,singleValueComponent:s.PropTypes.func,value:s.PropTypes.any,valueComponent:s.PropTypes.func,valueKey:s.PropTypes.string,valueRenderer:s.PropTypes.func},getDefaultProps:function(){return{addLabelText:'Add "{label}"?',allowCreate:!1,asyncOptions:void 0,autoload:!0,backspaceRemoves:!0,cacheAsyncResults:!0,className:void 0,clearAllText:"Clear all",clearValueText:"Clear value",clearable:!0,delimiter:",",disabled:!1,ignoreCase:!0,inputProps:{},isLoading:!1,labelKey:"label",matchPos:"any",matchProp:"any",name:void 0,newOptionCreator:void 0,noResultsText:"No results found",onChange:void 0,onInputChange:void 0,onOptionLabelClick:void 0,optionComponent:d,options:void 0,placeholder:"Select...",searchable:!0,searchingText:"Searching...",searchPromptText:"Type to search",singleValueComponent:c,value:void 0,valueComponent:l,valueKey:"value"}},getInitialState:function(){return{isFocused:!1,isLoading:!1,isOpen:!1,options:this.props.options}},componentWillMount:function(){var e=this;this._optionsCache={},this._optionsFilterString="",this._closeMenuIfClickedOutside=function(t){if(e.state.isOpen){var n=o.findDOMNode(e.refs.selectMenuContainer),i=o.findDOMNode(e.refs.control),r=e.clickedOutsideElement(n,t),s=e.clickedOutsideElement(i,t);r&&s&&e.setState({isOpen:!1},e._unbindCloseMenuIfClickedOutside)}},this._bindCloseMenuIfClickedOutside=function(){!document.addEventListener&&document.attachEvent?document.attachEvent("onclick",e._closeMenuIfClickedOutside):document.addEventListener("click",e._closeMenuIfClickedOutside)},this._unbindCloseMenuIfClickedOutside=function(){!document.removeEventListener&&document.detachEvent?document.detachEvent("onclick",e._closeMenuIfClickedOutside):document.removeEventListener("click",e._closeMenuIfClickedOutside)},this.setState(this.getStateFromValue(this.props.value))},componentDidMount:function(){this.props.asyncOptions&&this.props.autoload&&this.autoloadAsyncOptions()},componentWillUnmount:function(){clearTimeout(this._blurTimeout),clearTimeout(this._focusTimeout),this.state.isOpen&&this._unbindCloseMenuIfClickedOutside()},componentWillReceiveProps:function(e){var t=this,n=!1;if(JSON.stringify(e.options)!==JSON.stringify(this.props.options)&&(n=!0,this.setState({options:e.options,filteredOptions:this.filterOptions(e.options)})),e.value!==this.state.value||e.placeholder!==this.props.placeholder||n){var i=function(n){t.setState(t.getStateFromValue(e.value,n&&n.options||e.options,e.placeholder))};this.props.asyncOptions?this.loadAsyncOptions(e.value,{},i):i()}},componentDidUpdate:function(){var e=this;if(!this.props.disabled&&this._focusAfterUpdate&&(clearTimeout(this._blurTimeout),clearTimeout(this._focusTimeout),this._focusTimeout=setTimeout(function(){e.isMounted()&&(e.getInputNode().focus(),e._focusAfterUpdate=!1)},50)),this._focusedOptionReveal){if(this.refs.focused&&this.refs.menu){var t=o.findDOMNode(this.refs.focused),n=o.findDOMNode(this.refs.menu),i=t.getBoundingClientRect(),r=n.getBoundingClientRect();(i.bottom>r.bottom||i.top<r.top)&&(n.scrollTop=t.offsetTop+t.clientHeight-n.offsetHeight)}this._focusedOptionReveal=!1}},focus:function(){this.getInputNode().focus()},clickedOutsideElement:function(e,t){for(var n=t.target?t.target:t.srcElement;null!=n;){if(n===e)return!1;n=n.offsetParent}return!0},getStateFromValue:function(e,t,n){var i=this;t||(t=this.state.options),n||(n=this.props.placeholder),this._optionsFilterString="";var r,s=this.initValuesArray(e,t),o=this.filterOptions(t,s),a=null;return!this.props.multi&&s.length?(r=s[0],a=s[0][this.props.valueKey]):(r=this.getFirstFocusableOption(o),a=s.map(function(e){return e[i.props.valueKey]}).join(this.props.delimiter)),{value:a,values:s,inputValue:"",filteredOptions:o,placeholder:!this.props.multi&&s.length?s[0][this.props.labelKey]:n,focusedOption:r}},getFirstFocusableOption:function(e){for(var t=0;t<e.length;++t)if(!e[t].disabled)return e[t]},initValuesArray:function(e,t){var n=this;return Array.isArray(e)||(e="string"==typeof e?""===e?[]:this.props.multi?e.split(this.props.delimiter):[e]:void 0!==e&&null!==e?[e]:[]),e.map(function(e){if("string"==typeof e||"number"==typeof e){var r;for(var s in t)if(t.hasOwnProperty(s)&&t[s]&&(t[s][n.props.valueKey]===e||"number"==typeof t[s][n.props.valueKey]&&t[s][n.props.valueKey].toString()===e))return t[s];return r={},i(r,n.props.valueKey,e),i(r,n.props.labelKey,e),r}return e})},setValue:function(e,t){(t||void 0===t)&&(this._focusAfterUpdate=!0);var n=this.getStateFromValue(e);n.isOpen=!1,this.fireChangeEvent(n),this.setState(n)},selectValue:function(e){this.props.multi?e&&this.addValue(e):this.setValue(e),this._unbindCloseMenuIfClickedOutside()},addValue:function(e){this.setValue(this.state.values.concat(e))},popValue:function(){this.setValue(this.state.values.slice(0,this.state.values.length-1))},removeValue:function(e){this.setValue(this.state.values.filter(function(t){return t!==e}))},clearValue:function(e){e&&"mousedown"===e.type&&0!==e.button||(e.stopPropagation(),e.preventDefault(),this.setValue(null))},resetValue:function(){this.setValue(""===this.state.value?null:this.state.value)},getInputNode:function(){var e=this.refs.input;return this.props.searchable?e:o.findDOMNode(e)},fireChangeEvent:function(e){e.value!==this.state.value&&this.props.onChange&&this.props.onChange(e.value,e.values)},handleMouseDown:function(e){if(!(this.props.disabled||"mousedown"===e.type&&0!==e.button))return e.stopPropagation(),e.preventDefault(),this.state.isOpen&&!this.props.searchable?void this.setState({isOpen:!1},this._unbindCloseMenuIfClickedOutside):void(this.state.isFocused?this.setState({isOpen:!0},this._bindCloseMenuIfClickedOutside):(this._openAfterFocus=!0,this.getInputNode().focus()))},handleMouseDownOnMenu:function(e){this.props.disabled||"mousedown"===e.type&&0!==e.button||(e.stopPropagation(),e.preventDefault())},handleMouseDownOnArrow:function(e){this.props.disabled||"mousedown"===e.type&&0!==e.button||this.state.isOpen&&(e.stopPropagation(),e.preventDefault(),this.setState({isOpen:!1},this._unbindCloseMenuIfClickedOutside))},handleInputFocus:function(e){var t=this,n=this.state.isOpen||this._openAfterFocus;this.setState({isFocused:!0,isOpen:n},function(){n?t._bindCloseMenuIfClickedOutside():t._unbindCloseMenuIfClickedOutside()}),this._openAfterFocus=!1,this.props.onFocus&&this.props.onFocus(e)},handleInputBlur:function(e){var t=this,n=o.findDOMNode(this.refs.menu);document.activeElement.isEqualNode(n)||(this._blurTimeout=setTimeout(function(){!t._focusAfterUpdate&&t.isMounted()&&t.setState({inputValue:"",isFocused:!1,isOpen:!1})},50),this.props.onBlur&&this.props.onBlur(e))},handleKeyDown:function(e){if(!this.props.disabled){switch(e.keyCode){case 8:return void(!this.state.inputValue&&this.props.backspaceRemoves&&(e.preventDefault(),this.popValue()));case 9:if(e.shiftKey||!this.state.isOpen||!this.state.focusedOption)return;this.selectFocusedOption();break;case 13:if(!this.state.isOpen)return;this.selectFocusedOption();break;case 27:this.state.isOpen?this.resetValue():this.props.clearable&&this.clearValue(e);break;case 38:this.focusPreviousOption();break;case 40:this.focusNextOption();break;case 188:if(!this.props.allowCreate||!this.props.multi)return;e.preventDefault(),e.stopPropagation(),this.selectFocusedOption();break;default:return}e.preventDefault()}},_getNewFocusedOption:function(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t]===this.state.focusedOption)return e[t];return this.getFirstFocusableOption(e)},handleInputChange:function(e){if(this._optionsFilterString=e.target.value,this.props.onInputChange&&this.props.onInputChange(e.target.value),this.props.asyncOptions)this.setState({isLoading:!0,inputValue:e.target.value}),this.loadAsyncOptions(e.target.value,{isLoading:!1,isOpen:!0},this._bindCloseMenuIfClickedOutside);else{var t=this.filterOptions(this.state.options);this.setState({isOpen:!0,inputValue:e.target.value,filteredOptions:t,focusedOption:this._getNewFocusedOption(t)},this._bindCloseMenuIfClickedOutside)}},autoloadAsyncOptions:function(){var e=this;this.setState({isLoading:!0}),this.loadAsyncOptions("",{isLoading:!1},function(){e.setValue(e.props.value,!1)})},loadAsyncOptions:function(e,t,n){void 0===e&&(e="");var i=this,r=this._currentRequestId=p++;if(this.props.cacheAsyncResults)for(var s=0;s<=e.length;s++){var o=e.slice(0,s);if(this._optionsCache[o]&&(e===o||this._optionsCache[o].complete)){var a=this._optionsCache[o].options,u=this.filterOptions(a),l={options:a,filteredOptions:u,focusedOption:this._getNewFocusedOption(u)};for(var c in t)t.hasOwnProperty(c)&&(l[c]=t[c]);return this.setState(l),void(n&&n.call(this,l))}}var d=function(s,o){if(s)throw s;if(i.props.cacheAsyncResults&&(i._optionsCache[e]=o),r===i._currentRequestId){var a=i.filterOptions(o.options),u={options:o.options,filteredOptions:a,focusedOption:i._getNewFocusedOption(a)};for(var l in t)t.hasOwnProperty(l)&&(u[l]=t[l]);i.setState(u),n&&n.call(i,u)}},h=this.props.asyncOptions(e,d);h&&"function"==typeof h.then&&h.then(function(e){d(null,e)},function(e){d(e)})},filterOptions:function(e,t){var n=this,i=this._optionsFilterString,r=(t||this.state.values).map(function(e){return e[n.props.valueKey]});if(this.props.filterOptions)return this.props.filterOptions.call(this,e,i,r);var s=function(e){if(this.props.multi&&r.indexOf(e[this.props.valueKey])>-1)return!1;if(this.props.filterOption)return this.props.filterOption.call(this,e,i);var t=String(e[this.props.valueKey]),n=String(e[this.props.labelKey]);return this.props.ignoreCase&&(t=t.toLowerCase(),n=n.toLowerCase(),i=i.toLowerCase()),i&&"start"!==this.props.matchPos?"label"!==this.props.matchProp&&t.indexOf(i)>=0||"value"!==this.props.matchProp&&n.indexOf(i)>=0:"label"!==this.props.matchProp&&t.substr(0,i.length)===i||"value"!==this.props.matchProp&&n.substr(0,i.length)===i};return(e||[]).filter(s,this)},selectFocusedOption:function(){return this.props.allowCreate&&!this.state.focusedOption?this.selectValue(this.state.inputValue):this.state.focusedOption?this.selectValue(this.state.focusedOption):void 0},focusOption:function(e){this.setState({focusedOption:e})},focusNextOption:function(){this.focusAdjacentOption("next")},focusPreviousOption:function(){this.focusAdjacentOption("previous")},focusAdjacentOption:function(e){this._focusedOptionReveal=!0;var t=this.state.filteredOptions.filter(function(e){return!e.disabled});if(!this.state.isOpen)return void this.setState({isOpen:!0,inputValue:"",focusedOption:this.state.focusedOption||t["next"===e?0:t.length-1]},this._bindCloseMenuIfClickedOutside);if(t.length){for(var n=-1,i=0;i<t.length;i++)if(this.state.focusedOption===t[i]){n=i;break}var r=t[0];"next"===e&&n>-1&&n<t.length-1?r=t[n+1]:"previous"===e&&(r=n>0?t[n-1]:t[t.length-1]),this.setState({focusedOption:r})}},unfocusOption:function(e){this.state.focusedOption===e&&this.setState({focusedOption:null})},renderOptionLabel:function(e){return e[this.props.labelKey]},buildMenu:function(){var e=this.state.focusedOption?this.state.focusedOption[this.props.valueKey]:null,t=this.props.optionRenderer||this.renderOptionLabel;this.state.filteredOptions.length>0&&(e=null==e?this.state.filteredOptions[0]:e);var n=this.state.filteredOptions;if(this.props.allowCreate&&this.state.inputValue.trim()){var i=this.state.inputValue;n=n.slice();var r=this.props.newOptionCreator?this.props.newOptionCreator(i):{value:i,label:i,create:!0};n.unshift(r)}var o=Object.keys(n).map(function(i){var r=n[i],o=this.state.value===r[this.props.valueKey],a=e===r[this.props.valueKey],l=u({"Select-option":!0,"is-selected":o,"is-focused":a,"is-disabled":r.disabled}),c=a?"focused":null,d=s.createElement(this.props.optionComponent,{key:"option-"+r[this.props.valueKey],className:l,renderFunc:t,mouseDown:this.selectValue,mouseEnter:this.focusOption,mouseLeave:this.unfocusOption,addLabelText:this.props.addLabelText,option:r,ref:c});return d},this);if(o.length)return o;var a,l;return this.isLoading()?(l="Select-searching",a=this.props.searchingText):this.state.inputValue||!this.props.asyncOptions?(l="Select-noresults",a=this.props.noResultsText):(l="Select-search-prompt",a=this.props.searchPromptText),s.createElement("div",{className:l},a)},handleOptionLabelClick:function(e,t){this.props.onOptionLabelClick&&this.props.onOptionLabelClick(e,t)},isLoading:function(){return this.props.isLoading||this.state.isLoading},render:function(){var e=u("Select",this.props.className,{"Select--multi":this.props.multi,"is-searchable":this.props.searchable,"is-open":this.state.isOpen,"is-focused":this.state.isFocused,"is-loading":this.isLoading(),"is-disabled":this.props.disabled,"has-value":this.state.value}),t=[];if(this.props.multi&&this.state.values.forEach(function(e){var n=this.props.valueRenderer||this.renderOptionLabel,i=this.handleOptionLabelClick.bind(this,e),r=this.removeValue.bind(this,e),o=s.createElement(this.props.valueComponent,{key:e[this.props.valueKey],option:e,renderer:n,optionLabelClick:!!this.props.onOptionLabelClick,onOptionLabelClick:i,onRemove:r,disabled:this.props.disabled});t.push(o)},this),!(this.state.inputValue||this.props.multi&&t.length)){var n=this.state.values[0]||null;if(this.props.valueRenderer&&this.state.values.length)t.push(s.createElement(l,{key:0,option:n,renderer:this.props.valueRenderer,disabled:this.props.disabled}));else{var i=s.createElement(this.props.singleValueComponent,{key:"placeholder",value:n,placeholder:this.state.placeholder});t.push(i)}}var o,c,d=this.isLoading()?s.createElement("span",{className:"Select-loading-zone","aria-hidden":"true"},s.createElement("span",{className:"Select-loading"})):null,p=this.props.clearable&&this.state.value&&!this.props.disabled&&!this.isLoading()?s.createElement("span",{className:"Select-clear-zone",title:this.props.multi?this.props.clearAllText:this.props.clearValueText,"aria-label":this.props.multi?this.props.clearAllText:this.props.clearValueText,onMouseDown:this.clearValue,onTouchEnd:this.clearValue,onClick:this.clearValue},s.createElement("span",{className:"Select-clear",dangerouslySetInnerHTML:{__html:"&times;"}})):null,h=s.createElement("span",{className:"Select-arrow-zone",onMouseDown:this.handleMouseDownOnArrow},s.createElement("span",{className:"Select-arrow",onMouseDown:this.handleMouseDownOnArrow}));this.state.isOpen&&(c={ref:"menu",className:"Select-menu",onMouseDown:this.handleMouseDownOnMenu},o=s.createElement("div",{ref:"selectMenuContainer",className:"Select-menu-outer"},s.createElement("div",c,this.buildMenu())));var f,g={ref:"input",className:"Select-input "+(this.props.inputProps.className||""),tabIndex:this.props.tabIndex||0,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur};for(var m in this.props.inputProps)this.props.inputProps.hasOwnProperty(m)&&"className"!==m&&(g[m]=this.props.inputProps[m]);return this.props.disabled?this.props.multi&&this.state.values.length||(f=s.createElement("div",{className:"Select-input"}," ")):f=this.props.searchable?s.createElement(a,r({value:this.state.inputValue,onChange:this.handleInputChange,minWidth:"5"},g)):s.createElement("div",g," "),s.createElement("div",{ref:"wrapper",className:e},s.createElement("input",{type:"hidden",ref:"value",name:this.props.name,value:this.state.value,disabled:this.props.disabled}),s.createElement("div",{className:"Select-control",ref:"control",onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchEnd:this.handleMouseDown},t,f,d,p,h),o)}});e.exports=h},42:function(e,t,n){"use strict";var i=n(1),r=n(9),s=i.createClass({displayName:"SingleValue",propTypes:{placeholder:i.PropTypes.string,value:i.PropTypes.object},render:function(){var e=r("Select-placeholder",this.props.value&&this.props.value.className);return i.createElement("div",{className:e,style:this.props.value&&this.props.value.style,title:this.props.value&&this.props.value.title},this.props.placeholder)}});e.exports=s},43:function(e,t,n){"use strict";var i=n(1),r=n(9),s=i.createClass({displayName:"Value",propTypes:{disabled:i.PropTypes.bool,onOptionLabelClick:i.PropTypes.func,onRemove:i.PropTypes.func,option:i.PropTypes.object.isRequired,optionLabelClick:i.PropTypes.bool,renderer:i.PropTypes.func},blockEvent:function(e){e.stopPropagation()},handleOnRemove:function(e){this.props.disabled||this.props.onRemove(e)},render:function(){var e=this.props.option.label;return this.props.renderer&&(e=this.props.renderer(this.props.option)),this.props.onRemove||this.props.optionLabelClick?(this.props.optionLabelClick&&(e=i.createElement("a",{className:r("Select-item-label__a",this.props.option.className),onMouseDown:this.blockEvent,onTouchEnd:this.props.onOptionLabelClick,onClick:this.props.onOptionLabelClick,style:this.props.option.style,title:this.props.option.title},e)),i.createElement("div",{className:r("Select-item",this.props.option.className),style:this.props.option.style,title:this.props.option.title},i.createElement("span",{className:"Select-item-icon",onMouseDown:this.blockEvent,onClick:this.handleOnRemove,onTouchEnd:this.handleOnRemove},"×"),i.createElement("span",{className:"Select-item-label"},e))):i.createElement("div",{className:r("Select-value",this.props.option.className),style:this.props.option.style,title:this.props.option.title},e)}});e.exports=s},47:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return Array(e.length+1).join(T.SPACE)}function o(e){return x.LF+s(e.substring(1))}function a(e){return e.substring(0).replace(/ +/g,s)}function u(e){return s(e.substring(1))+x.LF}function l(e,t,n){var i=t.indexOf(e);return i>=0?n.charAt(i):e}function c(e){return l(e,M,k)}function d(e){return l(e,k,M)}function p(e){return l(e,A,P)}function h(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isRawMode,i=void 0!==n&&n,r=i?e.replace(/ +/g,s):e.replace(/ {2,}/g,s);return r=r.replace(/\n /g,o),r=r.replace(/ \n/g,u),r=r.replace(/ [\t\u00A0]/g,a),r=r.replace(/[\t\u00A0] /g,a),r=r.replace(/ [:!?]/g,a),r=r.replace(/^ /,s),r=r.replace(/ $/,s),r=r.replace(/\n/g,""+T.LF+x.LF),r=i?r.replace(F,d):r.replace(D,p)}function f(e){var t=e.replace(/\u240A\n/g,x.LF);return t=t.replace(/\u240A/g,x.LF),t=t.replace(/\u2420/g,x.SPACE),t=t.replace(R,c)}Object.defineProperty(t,"__esModule",{value:!0}),t.RE_BASE_REVERSE=t.BASE_MAP_REVERSE_HL=t.FULL_MAP=t.BASE_MAP=t.SYMBOLS=t.CHARACTERS=void 0;var g,m,v,y;t.raw2sym=h,t.sym2raw=f;var b=n(7),C=i(b),w=n(6),_=i(w),x=t.CHARACTERS={NULL:"\0",BELL:"",BS:"\b",TAB:"\t",VT:"\v",FF:"\f",ESC:"",NBSP:" ",LF:"\n",CR:"\r",SPACE:" ",ALM:"؜",ZWS:"​",ZWNJ:"‌",ZWJ:"‍",LRM:"‎",RLM:"‏",LRE:"‪",RLE:"‫",PDF:"‬",LRO:"‭",RLO:"‮",WJ:"⁠",LRI:"⁦",RLI:"⁧",FSI:"⁨",PDI:"⁩"},T=t.SYMBOLS={NULL:"␀",BELL:"␇",BS:"␈",TAB:"␉",VT:"␋",FF:"␌",ESC:"␛",NBSP:"␣",LF:"␊",CR:"␍",SPACE:"␠",ALM:"",ZWS:"",ZWNJ:"",ZWJ:"",LRM:"",RLM:"",LRE:"",RLE:"",PDF:"",LRO:"",RLO:"",WJ:"",LRI:"",RLI:"",FSI:"",PDI:""},S=t.BASE_MAP=(g={},r(g,x.NULL,T.NULL),r(g,x.BELL,T.BELL),r(g,x.BS,T.BS),r(g,x.TAB,T.TAB),r(g,x.VT,T.VT),r(g,x.FF,T.FF),r(g,x.ESC,T.ESC),r(g,x.NBSP,T.NBSP),r(g,x.CR,T.CR),g),O=t.FULL_MAP=(0,C.default)({},S,(m={},r(m,x.ALM,T.ALM),r(m,x.ZWS,T.ZWS),r(m,x.ZWNJ,T.ZWNJ),r(m,x.ZWJ,T.ZWJ),r(m,x.LRM,T.LRM),r(m,x.RLM,T.RLM),r(m,x.LRE,T.LRE),r(m,x.RLE,T.RLE),
r(m,x.PDF,T.PDF),r(m,x.LRO,T.LRO),r(m,x.RLO,T.RLO),r(m,x.WJ,T.WJ),r(m,x.LRI,T.LRI),r(m,x.RLI,T.RLI),r(m,x.FSI,T.FSI),r(m,x.PDI,T.PDI),m)),E=(0,C.default)({},_.default.invert(S),(v={},r(v,T.LF,""),r(v,T.CR,""),v)),A=(t.BASE_MAP_REVERSE_HL=(0,C.default)({},E,(y={},r(y,T.LF,x.LF),r(y,T.CR,x.CR),y)),t.RE_BASE_REVERSE=new RegExp("["+Object.keys(E).join("")+"]","g"),Object.keys(S).join("")),P=Object.keys(_.default.invert(S)).join(""),k=Object.keys(O).join(""),M=Object.keys(_.default.invert(O)).join(""),D=new RegExp("["+A+"]","g"),F=new RegExp("["+k+"]","g"),R=new RegExp("["+M+"]","g")},48:function(e,t,n){"use strict";function i(e){return"target_f_"+e}Object.defineProperty(t,"__esModule",{value:!0});var r=n(85);Object.defineProperty(t,"decodeEntities",{enumerable:!0,get:function(){return r.decodeEntities}});var s=n(84);Object.defineProperty(t,"highlightPunctuation",{enumerable:!0,get:function(){return s.highlightPunctuation}}),Object.defineProperty(t,"highlightEscapes",{enumerable:!0,get:function(){return s.highlightEscapes}}),Object.defineProperty(t,"highlightHtml",{enumerable:!0,get:function(){return s.highlightHtml}}),Object.defineProperty(t,"highlightSymbols",{enumerable:!0,get:function(){return s.highlightSymbols}}),Object.defineProperty(t,"nl2br",{enumerable:!0,get:function(){return s.nl2br}});var o=n(86);Object.defineProperty(t,"normalizeCode",{enumerable:!0,get:function(){return o.normalizeCode}});var a=n(54);Object.defineProperty(t,"escapeUnsafeRegexSymbols",{enumerable:!0,get:function(){return a.escapeUnsafeRegexSymbols}}),Object.defineProperty(t,"makeRegexForMultipleWords",{enumerable:!0,get:function(){return a.makeRegexForMultipleWords}}),t.getAreaId=i},51:function(e,t,n){var i,r,s;/*!
	 * Select2 4.0.3
	 * https://select2.github.io
	 *
	 * Released under the MIT license
	 * https://github.com/select2/select2/blob/master/LICENSE.md
	 */
!function(o){r=[n(3)],i=o,s="function"==typeof i?i.apply(t,r):i,!(void 0!==s&&(e.exports=s))}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var t;return function(){if(!t||!t.requirejs){t?n=t:t={};/**
	 * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
	 * Available via the MIT or new BSD license.
	 * see: http://github.com/jrburke/almond for details
	 */
var e,n,i;!function(t){function r(e,t){return C.call(e,t)}function s(e,t){var n,i,r,s,o,a,u,l,c,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),o=e.length-1,y.nodeIdCompat&&_.test(e[o])&&(e[o]=e[o].replace(_,"")),e=h.slice(0,h.length-1).concat(e),c=0;c<e.length;c+=1)if(p=e[c],"."===p)e.splice(c,1),c-=1;else if(".."===p){if(1===c&&(".."===e[2]||".."===e[0]))break;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||g)&&f){for(n=e.split("/"),c=n.length;c>0;c-=1){if(i=n.slice(0,c).join("/"),h)for(d=h.length;d>0;d-=1)if(r=f[h.slice(0,d).join("/")],r&&(r=r[i])){s=r,a=c;break}if(s)break;!u&&g&&g[i]&&(u=g[i],l=c)}!s&&u&&(s=u,a=l),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function o(e,n){return function(){var i=w.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),h.apply(t,i.concat([e,n]))}}function a(e){return function(t){return s(t,e)}}function u(e){return function(t){m[e]=t}}function l(e){if(r(v,e)){var n=v[e];delete v[e],b[e]=!0,p.apply(t,n)}if(!r(m,e)&&!r(b,e))throw new Error("No "+e);return m[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function d(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,h,f,g,m={},v={},y={},b={},C=Object.prototype.hasOwnProperty,w=[].slice,_=/\.js$/;f=function(e,t){var n,i=c(e),r=i[0];return e=i[1],r&&(r=s(r,t),n=l(r)),r?e=n&&n.normalize?n.normalize(e,a(t)):s(e,t):(e=s(e,t),i=c(e),r=i[0],e=i[1],r&&(n=l(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},g={require:function(e){return o(e)},exports:function(e){var t=m[e];return"undefined"!=typeof t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:d(e)}}},p=function(e,n,i,s){var a,c,d,p,h,y,C=[],w=typeof i;if(s=s||e,"undefined"===w||"function"===w){for(n=!n.length&&i.length?["require","exports","module"]:n,h=0;h<n.length;h+=1)if(p=f(n[h],s),c=p.f,"require"===c)C[h]=g.require(e);else if("exports"===c)C[h]=g.exports(e),y=!0;else if("module"===c)a=C[h]=g.module(e);else if(r(m,c)||r(v,c)||r(b,c))C[h]=l(c);else{if(!p.p)throw new Error(e+" missing "+c);p.p.load(p.n,o(s,!0),u(c),{}),C[h]=m[c]}d=i?i.apply(m[e],C):void 0,e&&(a&&a.exports!==t&&a.exports!==m[e]?m[e]=a.exports:d===t&&y||(m[e]=d))}else e&&(m[e]=i)},e=n=h=function(e,n,i,r,s){if("string"==typeof e)return g[e]?g[e](n):l(f(e,n).f);if(!e.splice){if(y=e,y.deps&&h(y.deps,y.callback),!n)return;n.splice?(e=n,n=i,i=null):e=t}return n=n||function(){},"function"==typeof i&&(i=r,r=s),r?p(t,e,n,i):setTimeout(function(){p(t,e,n,i)},4),h},h.config=function(e){return h(e)},e._defined=m,i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),r(m,e)||r(v,e)||(v[e]=[e,t,n])},i.amd={jQuery:!0}}(),t.requirejs=e,t.require=n,t.define=i}}(),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2/utils",["jquery"],function(e){function t(e){var t=e.prototype,n=[];for(var i in t){var r=t[i];"function"==typeof r&&"constructor"!==i&&n.push(i)}return n}var n={};n.Extend=function(e,t){function n(){this.constructor=e}var i={}.hasOwnProperty;for(var r in t)i.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},n.Decorate=function(e,n){function i(){var t=Array.prototype.unshift,i=n.prototype.constructor.length,r=e.prototype.constructor;i>0&&(t.call(arguments,e.prototype.constructor),r=n.prototype.constructor),r.apply(this,arguments)}function r(){this.constructor=i}var s=t(n),o=t(e);n.displayName=e.displayName,i.prototype=new r;for(var a=0;a<o.length;a++){var u=o[a];i.prototype[u]=e.prototype[u]}for(var l=(function(e){var t=function(){};e in i.prototype&&(t=i.prototype[e]);var r=n.prototype[e];return function(){var e=Array.prototype.unshift;return e.call(arguments,t),r.apply(this,arguments)}}),c=0;c<s.length;c++){var d=s[c];i.prototype[d]=l(d)}return i};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},n.Observable=i,n.generateChars=function(e){for(var t="",n=0;n<e;n++){var i=Math.floor(36*Math.random());t+=i.toString(36)}return t},n.bind=function(e,t){return function(){e.apply(t,arguments)}},n._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var s=n[r];s=s.substring(0,1).toLowerCase()+s.substring(1),s in i||(i[s]={}),r==n.length-1&&(i[s]=e[t]),i=i[s]}delete e[t]}}return e},n.hasScroll=function(t,n){var i=e(n),r=n.style.overflowX,s=n.style.overflowY;return(r!==s||"hidden"!==s&&"visible"!==s)&&("scroll"===r||"scroll"===s||(i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth))},n.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},n.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(n,function(e){i=i.add(e)}),n=i}t.append(n)},n}),t.define("select2/results",["jquery","./utils"],function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),r=this.options.get("translations").get(t.message);i.append(n(r(t.args))),i[0].className+=" select2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null==e.results||0===e.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],r=this.option(i);t.push(r)}this.$results.append(t)},n.prototype.position=function(e,t){var n=t.find(".select2-results");n.append(e)},n.prototype.sort=function(e){var t=this.options.get("sorter");return t(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var t=this;this.data.current(function(n){var i=e.map(n,function(e){return e.id.toString()}),r=t.$results.find(".select2-results__option[aria-selected]");r.each(function(){var t=e(this),n=e.data(this,"data"),r=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(r,i)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")})})},n.prototype.showLoading=function(e){this.hideLoading();var t=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:t(e)},i=this.option(n);i.className+=" loading-results",this.$results.prepend(i)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(t){var n=document.createElement("li");n.className="select2-results__option";var i={role:"treeitem","aria-selected":"false"};t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==t.id&&delete i["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]);for(var r in i){var s=i[r];n.setAttribute(r,s)}if(t.children){var o=e(n),a=document.createElement("strong");a.className="select2-results__group";e(a);this.template(t,a);for(var u=[],l=0;l<t.children.length;l++){var c=t.children[l],d=this.option(c);u.push(d)}var p=e("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});p.append(u),o.append(a),o.append(p)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t,n){var i=this,r=t.id+"-results";this.$results.attr("id",r),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(i.setClasses(),i.highlightFirstItem())}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=i.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e);if(0!==n){var r=n-1;0===e.length&&(r=0);var s=t.eq(r);s.trigger("mouseenter");var o=i.$results.offset().top,a=s.offset().top,u=i.$results.scrollTop()+(a-o);0===r?i.$results.scrollTop(0):a-o<0&&i.$results.scrollTop(u)}}),t.on("results:next",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e),r=n+1;if(!(r>=t.length)){var s=t.eq(r);s.trigger("mouseenter");var o=i.$results.offset().top+i.$results.outerHeight(!1),a=s.offset().top+s.outerHeight(!1),u=i.$results.scrollTop()+a-o;0===r?i.$results.scrollTop(0):a>o&&i.$results.scrollTop(u)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){i.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,r=e.deltaY>0&&t-e.deltaY<=0,s=e.deltaY<0&&n<=i.$results.height();r?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):s&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(t){var n=e(this),r=n.data("data");return"true"===n.attr("aria-selected")?void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:t,data:r}):i.trigger("close",{})):void i.trigger("select",{originalEvent:t,data:r})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(t){var n=e(this).data("data");i.getHighlightedResults().removeClass("select2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){var e=this.$results.find(".select2-results__option--highlighted");return e},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]"),n=t.index(e),i=this.$results.offset().top,r=e.offset().top,s=this.$results.scrollTop()+(r-i),o=r-i;s-=2*e.outerHeight(!1),n<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(s)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),s=i(t,n);null==s?n.style.display="none":"string"==typeof s?n.innerHTML=r(s):e(n).append(s)},n}),t.define("select2/keys",[],function(){var e={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return e}),t.define("select2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},i.prototype.bind=function(e,t){var i=this,r=(e.id+"-container",e.id+"-results");this.container=e,this.$selection.on("focus",function(e){i.trigger("focus",e)}),this.$selection.on("blur",function(e){i._handleBlur(e)}),this.$selection.on("keydown",function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){i.update(e.data)}),e.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",r),i._attachCloseHandler(e)}),e.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(e)}),e.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),e.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(t){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)},1)},i.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.select2."+t.id,function(t){var n=e(t.target),i=n.closest(".select2"),r=e(".select2.select2-container--open");r.each(function(){var t=e(this);if(this!=i[0]){var n=t.data("element");n.select2("close")}})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},i.prototype.position=function(e,t){var n=t.find(".selection");n.append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i}),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("focus",function(t){e.isOpen()||n.$selection.focus()}),e.on("selection:update",function(e){n.update(e.data)})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},r.prototype.selectionContainer=function(){return e("<span></span>")},r.prototype.update=function(e){if(0===e.length)return void this.clear();var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)},r}),t.define("select2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},i.prototype.bind=function(t,n){var r=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(t){if(!r.options.get("disabled")){var n=e(this),i=n.parent(),s=i.data("data");r.trigger("unselect",{originalEvent:t,data:s})}})},i.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},i.prototype.selectionContainer=function(){var t=e('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return t},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i<e.length;i++){var r=e[i],s=this.selectionContainer(),o=this.display(r,s);s.append(o),s.prop("title",r.title||r.text),s.data("data",r),t.push(s)}var a=this.$selection.find(".select2-selection__rendered");n.appendMany(a,t)}},i}),t.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id,i=t.length>1;if(i||n)return e.call(this,t);this.clear();var r=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(r)},t}),t.define("select2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),r=0;r<i.length;r++){var s={data:i[r]};if(this.trigger("unselect",s),s.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},n.prototype.update=function(t,n){if(t.call(this,n),!(this.$selection.find(".select2-selection__placeholder").length>0||0===n.length)){var i=e('<span class="select2-selection__clear">&times;</span>');i.data("data",n),this.$selection.find(".select2-selection__rendered").prepend(i)}},n}),t.define("select2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=e('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,t,i){var r=this;e.call(this,t,i),t.on("open",function(){r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){r.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented();var t=e.which;if(t===n.BACKSPACE&&""===r.$search.val()){var i=r.$searchContainer.prev(".select2-selection__choice");if(i.length>0){var s=i.data("data");r.searchRemoveChoice(s),e.preventDefault()}}});var s=document.documentMode,o=s&&s<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){return o?void r.$selection.off("input.search input.searchcheck"):void r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(o&&"input"===e.type)return void r.$selection.off("input.search input.searchcheck");var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&r.handleSearch(e)})},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";if(""!==this.$search.attr("placeholder"))e=this.$selection.find(".select2-selection__rendered").innerWidth();else{var t=this.$search.val().length+1;e=.75*t+"em"}this.$search.css("width",e)},i}),t.define("select2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,i){var r=this,s=["open","opening","close","closing","select","selecting","unselect","unselecting"],o=["opening","closing","selecting","unselecting"];t.call(this,n,i),n.on("*",function(t,n){if(e.inArray(t,s)!==-1){n=n||{};var i=e.Event("select2:"+t,{params:n});r.$element.trigger(i),e.inArray(t,o)!==-1&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("select2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n}),t.define("select2/diacritics",[],function(){var e={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return e}),t.define("select2/data/base",["../utils"],function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),i+=null!=n.id?"-"+n.id.toString():"-"+e.generateChars(4)},t}),t.define("select2/data/select",["./base","../utils","jquery"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each(function(){var e=n(this),r=i.item(e);t.push(r)}),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var r=[];e=[e],e.push.apply(e,i);for(var s=0;s<e.length;s++){var o=e[s].id;n.inArray(o,r)===-1&&r.push(o)}t.$element.val(r),t.$element.trigger("change")});else{var i=e.id;this.$element.val(i),this.$element.trigger("change");
}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple"))return e.selected=!1,n(e.element).is("option")?(e.element.selected=!1,void this.$element.trigger("change")):void this.current(function(i){for(var r=[],s=0;s<i.length;s++){var o=i[s].id;o!==e.id&&n.inArray(o,r)===-1&&r.push(o)}t.$element.val(r),t.$element.trigger("change")})},i.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},i.prototype.query=function(e,t){var i=[],r=this,s=this.$element.children();s.each(function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var s=r.item(t),o=r.matches(e,s);null!==o&&i.push(o)}}),t({results:i})},i.prototype.addOptions=function(e){t.appendMany(this.$element,e)},i.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup"),t.label=e.text):(t=document.createElement("option"),void 0!==t.textContent?t.textContent=e.text:t.innerText=e.text),e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var i=n(t),r=this._normalizeItem(e);return r.element=t,n.data(t,"data",r),i},i.prototype.item=function(e){var t={};if(t=n.data(e[0],"data"),null!=t)return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var i=e.children("option"),r=[],s=0;s<i.length;s++){var o=n(i[s]),a=this.item(o);r.push(a)}t.children=r}return t=this._normalizeItem(t),t.element=e[0],n.data(e[0],"data",t),t},i.prototype._normalizeItem=function(e){n.isPlainObject(e)||(e={id:e,text:e}),e=n.extend({},{text:""},e);var t={selected:!1,disabled:!1};return null!=e.id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},t,e)},i.prototype.matches=function(e,t){var n=this.options.get("matcher");return n(e,t)},i}),t.define("select2/data/array",["./select","../utils","jquery"],function(e,t,n){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return t.Extend(i,e),i.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,n){return n.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){function i(e){return function(){return n(this).val()==e.id}}for(var r=this,s=this.$element.find("option"),o=s.map(function(){return r.item(n(this)).id}).get(),a=[],u=0;u<e.length;u++){var l=this._normalizeItem(e[u]);if(n.inArray(l.id,o)>=0){var c=s.filter(i(l)),d=this.item(c),p=n.extend(!0,{},l,d),h=this.option(p);c.replaceWith(h)}else{var f=this.option(l);if(l.children){var g=this.convertToOptions(l.children);t.appendMany(f,g)}a.push(f)}}return a},i}),t.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var r=n.ajax(e);return r.then(t),r.fail(i),r}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){function i(){var i=s.transport(s,function(i){var s=r.processResults(i,e);r.options.get("debug")&&window.console&&console.error&&(s&&s.results&&n.isArray(s.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(s)},function(){i.status&&"0"===i.status||r.trigger("results:message",{message:"errorLoading"})});r._request=i}var r=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var s=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof s.url&&(s.url=s.url.call(this.$element,e)),"function"==typeof s.data&&(s.data=s.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),t.define("select2/data/tags",["jquery"],function(e){function t(t,n,i){var r=i.get("tags"),s=i.get("createTag");void 0!==s&&(this.createTag=s);var o=i.get("insertTag");if(void 0!==o&&(this.insertTag=o),t.call(this,n,i),e.isArray(r))for(var a=0;a<r.length;a++){var u=r[a],l=this._normalizeItem(u),c=this.option(l);this.$element.append(c)}}return t.prototype.query=function(e,t,n){function i(e,s){for(var o=e.results,a=0;a<o.length;a++){var u=o[a],l=null!=u.children&&!i({results:u.children},!0),c=u.text===t.term;if(c||l)return!s&&(e.data=o,void n(e))}if(s)return!0;var d=r.createTag(t);if(null!=d){var p=r.option(d);p.attr("data-select2-tag",!0),r.addOptions([p]),r.insertTag(o,d)}e.results=o,n(e)}var r=this;return this._removeOldTags(),null==t.term||null!=t.page?void e.call(this,t,n):void e.call(this,t,i)},t.prototype.createTag=function(t,n){var i=e.trim(n.term);return""===i?null:{id:i,text:i}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){var n=(this._lastTag,this.$element.find("option[data-select2-tag]"));n.each(function(){this.selected||e(this).remove()})},t}),t.define("select2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,n,i){function r(t){var n=o._normalizeItem(t),i=o.$element.find("option").filter(function(){return e(this).val()===n.id});if(!i.length){var r=o.option(n);r.attr("data-select2-tag",!0),o._removeOldTags(),o.addOptions([r])}s(n)}function s(e){o.trigger("select",{data:e})}var o=this;n.term=n.term||"";var a=this.tokenizer(n,this.options,r);a.term!==n.term&&(this.$search.length&&(this.$search.val(a.term),this.$search.focus()),n.term=a.term),t.call(this,n,i)},t.prototype.tokenizer=function(t,n,i,r){for(var s=i.get("tokenSeparators")||[],o=n.term,a=0,u=this.createTag||function(e){return{id:e.term,text:e.term}};a<o.length;){var l=o[a];if(e.inArray(l,s)!==-1){var c=o.substr(0,a),d=e.extend({},n,{term:c}),p=u(d);null!=p?(r(p),o=o.substr(a+1)||"",a=0):a++}else a++}return{term:o}},t}),t.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",t.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var i=this;this.current(function(r){var s=null!=r?r.length:0;return i.maximumSelectionLength>0&&s>=i.maximumSelectionLength?void i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):void e.call(i,t,n)})},e}),t.define("select2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("select2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(t,n,i){var r=this;t.call(this,n,i),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),n.on("open",function(){r.$search.attr("tabindex",0),r.$search.focus(),window.setTimeout(function(){r.$search.focus()},0)}),n.on("close",function(){r.$search.attr("tabindex",-1),r.$search.val("")}),n.on("focus",function(){n.isOpen()&&r.$search.focus()}),n.on("results:all",function(e){if(null==e.query.term||""===e.query.term){var t=r.showSearch(e);t?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide")}})},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n}),t.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),t.define("select2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,n,i){var r=this;t.call(this,n,i),n.on("query",function(e){r.lastParams=e,r.loading=!0}),n.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,r.$loadingMore[0]);if(!r.loading&&t){var n=r.$results.offset().top+r.$results.outerHeight(!1),i=r.$loadingMore.offset().top+r.$loadingMore.outerHeight(!1);n+50>=i&&r.loadMore()}})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("select2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,i){this.$dropdownParent=i.get("dropdownParent")||e(document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this,r=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),r||(r=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var r=this,s="scroll.select2."+i.id,o="resize.select2."+i.id,a="orientationchange.select2."+i.id,u=this.$container.parents().filter(t.hasScroll);u.each(function(){e(this).data("select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),u.on(s,function(t){var n=e(this).data("select2-scroll-position");e(this).scrollTop(n.y)}),e(window).on(s+" "+o+" "+a,function(e){r._positionDropdown(),r._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var r="scroll.select2."+i.id,s="resize.select2."+i.id,o="orientationchange.select2."+i.id,a=this.$container.parents().filter(t.hasScroll);a.off(r),e(window).off(r+" "+s+" "+o)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("select2-dropdown--above"),i=this.$dropdown.hasClass("select2-dropdown--below"),r=null,s=this.$container.offset();s.bottom=s.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=s.top,o.bottom=s.top+o.height;var a={height:this.$dropdown.outerHeight(!1)},u={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},l=u.top<s.top-a.height,c=u.bottom>s.bottom+a.height,d={left:s.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,n||i||(r="below"),c||!l||n?!l&&c&&n&&(r="below"):r="above",("above"==r||n&&"below"!==r)&&(d.top=o.top-h.top-a.height),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),t.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];r.children?n+=e(r.children):n++}return n}function t(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t}),t.define("select2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(e){i._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var r=i.data("data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},e}),t.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),t.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(e,t,n,i,r,s,o,a,u,l,c,d,p,h,f,g,m,v,y,b,C,w,_,x,T,S,O,E,A){function P(){this.reset()}P.prototype.apply=function(d){if(d=e.extend(!0,{},this.defaults,d),null==d.dataAdapter){if(null!=d.ajax?d.dataAdapter=f:null!=d.data?d.dataAdapter=h:d.dataAdapter=p,d.minimumInputLength>0&&(d.dataAdapter=l.Decorate(d.dataAdapter,v)),d.maximumInputLength>0&&(d.dataAdapter=l.Decorate(d.dataAdapter,y)),d.maximumSelectionLength>0&&(d.dataAdapter=l.Decorate(d.dataAdapter,b)),d.tags&&(d.dataAdapter=l.Decorate(d.dataAdapter,g)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=l.Decorate(d.dataAdapter,m)),null!=d.query){var A=t(d.amdBase+"compat/query");d.dataAdapter=l.Decorate(d.dataAdapter,A)}if(null!=d.initSelection){var P=t(d.amdBase+"compat/initSelection");d.dataAdapter=l.Decorate(d.dataAdapter,P)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=l.Decorate(d.resultsAdapter,x)),null!=d.placeholder&&(d.resultsAdapter=l.Decorate(d.resultsAdapter,_)),d.selectOnClose&&(d.resultsAdapter=l.Decorate(d.resultsAdapter,O))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=C;else{var k=l.Decorate(C,w);d.dropdownAdapter=k}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=l.Decorate(d.dropdownAdapter,S)),d.closeOnSelect&&(d.dropdownAdapter=l.Decorate(d.dropdownAdapter,E)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var M=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=l.Decorate(d.dropdownAdapter,M)}d.dropdownAdapter=l.Decorate(d.dropdownAdapter,T)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=r:d.selectionAdapter=i,null!=d.placeholder&&(d.selectionAdapter=l.Decorate(d.selectionAdapter,s)),d.allowClear&&(d.selectionAdapter=l.Decorate(d.selectionAdapter,o)),d.multiple&&(d.selectionAdapter=l.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var D=t(d.amdBase+"compat/containerCss");d.selectionAdapter=l.Decorate(d.selectionAdapter,D)}d.selectionAdapter=l.Decorate(d.selectionAdapter,u)}if("string"==typeof d.language)if(d.language.indexOf("-")>0){var F=d.language.split("-"),R=F[0];d.language=[d.language,R]}else d.language=[d.language];if(e.isArray(d.language)){var I=new c;d.language.push("en");for(var j=d.language,L=0;L<j.length;L++){var N=j[L],$={};try{$=c.loadPath(N)}catch(e){try{N=this.defaults.amdLanguageBase+N,$=c.loadPath(N)}catch(e){d.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+N+'" could not be automatically loaded. A fallback will be used instead.');continue}}I.extend($)}d.translations=I}else{var B=c.loadPath(this.defaults.amdLanguageBase+"en"),z=new c(d.language);z.extend(B),d.translations=z}return d},P.prototype.reset=function(){function t(e){function t(e){return d[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function n(i,r){if(""===e.trim(i.term))return r;if(r.children&&r.children.length>0){for(var s=e.extend(!0,{},r),o=r.children.length-1;o>=0;o--){var a=r.children[o],u=n(i,a);null==u&&s.children.splice(o,1)}return s.children.length>0?s:n(i,s)}var l=t(r.text).toUpperCase(),c=t(i.term).toUpperCase();return l.indexOf(c)>-1?r:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:l.escapeMarkup,language:A,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},P.prototype.set=function(t,n){var i=e.camelCase(t),r={};r[i]=n;var s=l._convertData(r);e.extend(this.defaults,s)};var k=new P;return k}),t.define("select2/options",["require","jquery","./defaults","./utils"],function(e,t,n,i){function r(t,r){if(this.options=t,null!=r&&this.fromElement(r),this.options=n.apply(this.options),r&&r.is("input")){var s=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,s)}}return r.prototype.fromElement=function(e){var n=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("select2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var r={};r=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var s=t.extend(!0,{},r);s=i._convertData(s);for(var o in s)t.inArray(o,n)>-1||(t.isPlainObject(this.options[o])?t.extend(this.options[o],s[o]):this.options[o]=s[o]);return this},r.prototype.get=function(e){return this.options[e]},r.prototype.set=function(e,t){this.options[e]=t},r}),t.define("select2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var r=function(e,n){null!=e.data("select2")&&e.data("select2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),r.__super__.constructor.call(this);var i=e.attr("tabindex")||0;e.data("old-tabindex",i),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var o=this.render();this._placeContainer(o);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,o);var u=this.options.get("dropdownAdapter");this.dropdown=new u(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,o);var l=this.options.get("resultsAdapter");this.results=new l(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var c=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){c.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("select2",this)};return n.Extend(r,n.Observable),r.prototype._generateId=function(e){var t="";return t=null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4),t=t.replace(/(:|\.|\[|\]|,)/g,""),t="select2-"+t},r.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},r.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var r=e.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"==t){var s=e.attr("style");if("string"!=typeof s)return null;for(var o=s.split(";"),a=0,u=o.length;a<u;a+=1){var l=o[a].replace(/\s/g,""),c=l.match(n);if(null!==c&&c.length>=1)return c[1]}return null}return t},r.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},r.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){e.each(n,t._syncA),e.each(n,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},r.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,n){e.trigger(t,n)})},r.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(i,r){e.inArray(i,n)===-1&&t.trigger(i,r)})},r.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,n){e.trigger(t,n)})},r.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,n){e.trigger(t,n)})},r.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("select2-container--open")}),this.on("close",function(){e.$container.removeClass("select2-container--open")}),this.on("enable",function(){e.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){e.$container.addClass("select2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("select2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(n){e.trigger("results:all",{data:n,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(n){e.trigger("results:append",{data:n,query:t})})}),this.on("keypress",function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&t.altKey?(e.close(),t.preventDefault()):n===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},r.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},r.prototype._syncSubtree=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&t.addedNodes.length>0)for(var r=0;r<t.addedNodes.length;r++){var s=t.addedNodes[r];s.selected&&(n=!0)}else t.removedNodes&&t.removedNodes.length>0&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})}},r.prototype.trigger=function(e,t){var n=r.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===t&&(t={}),e in i){var s=i[e],o={prevented:!1,name:e,args:t};if(n.call(this,s,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},r.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},r.prototype.open=function(){this.isOpen()||this.trigger("query",{})},r.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},r.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},r.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},r.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},r.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},r.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,function(e){return e.toString()})),this.$element.val(n).trigger("change")},r.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},r.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),
t.data("element",this.$element),t},r}),t.define("jquery-mousewheel",["jquery"],function(e){return e}),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(e,t,n,i){if(null==e.fn.select2){var r=["open","close","destroy"];e.fn.select2=function(t){if(t=t||{},"object"==typeof t)return this.each(function(){var i=e.extend(!0,{},t);new n(e(this),i)}),this;if("string"==typeof t){var i,s=Array.prototype.slice.call(arguments,1);return this.each(function(){var n=e(this).data("select2");null==n&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),i=n[t].apply(n,s)}),e.inArray(t,r)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n})},52:function(e,t){!function(e){var t,n,i,r,s,o,a,u="Close",l="BeforeClose",c="AfterClose",d="BeforeAppend",p="MarkupParse",h="Open",f="Change",g="mfp",m="."+g,v="mfp-ready",y="mfp-removing",b="mfp-prevent-close",C=function(){},w=!!window.jQuery,_=e(window),x=function(e,n){t.ev.on(g+e+m,n)},T=function(t,n,i,r){var s=document.createElement("div");return s.className="mfp-"+t,i&&(s.innerHTML=i),r?n&&n.appendChild(s):(s=e(s),n&&s.appendTo(n)),s},S=function(n,i){t.ev.triggerHandler(g+n,i),t.st.callbacks&&(n=n.charAt(0).toLowerCase()+n.slice(1),t.st.callbacks[n]&&t.st.callbacks[n].apply(t,e.isArray(i)?i:[i]))},O=function(n){return n===a&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),a=n),t.currTemplate.closeBtn},E=function(){e.magnificPopup.instance||(t=new C,t.init(),e.magnificPopup.instance=t)},A=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1};C.prototype={constructor:C,init:function(){var n=navigator.appVersion;t.isIE7=n.indexOf("MSIE 7.")!==-1,t.isIE8=n.indexOf("MSIE 8.")!==-1,t.isLowIE=t.isIE7||t.isIE8,t.isAndroid=/android/gi.test(n),t.isIOS=/iphone|ipad|ipod/gi.test(n),t.supportsTransition=A(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),r=e(document),t.popupsCache={}},open:function(n){i||(i=e(document.body));var s;if(n.isObj===!1){t.items=n.items.toArray(),t.index=0;var a,u=n.items;for(s=0;s<u.length;s++)if(a=u[s],a.parsed&&(a=a.el[0]),a===n.el[0]){t.index=s;break}}else t.items=e.isArray(n.items)?n.items:[n.items],t.index=n.index||0;if(t.isOpen)return void t.updateItemHTML();t.types=[],o="",n.mainEl&&n.mainEl.length?t.ev=n.mainEl.eq(0):t.ev=r,n.key?(t.popupsCache[n.key]||(t.popupsCache[n.key]={}),t.currTemplate=t.popupsCache[n.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,n),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=T("bg").on("click"+m,function(){t.close()}),t.wrap=T("wrap").attr("tabindex",-1).on("click"+m,function(e){t._checkIfClose(e.target)&&t.close()}),t.container=T("container",t.wrap)),t.contentContainer=T("content"),t.st.preloader&&(t.preloader=T("preloader",t.container,t.st.tLoading));var l=e.magnificPopup.modules;for(s=0;s<l.length;s++){var c=l[s];c=c.charAt(0).toUpperCase()+c.slice(1),t["init"+c].call(t)}S("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(x(p,function(e,t,n,i){n.close_replaceWith=O(i.type)}),o+=" mfp-close-btn-in"):t.wrap.append(O())),t.st.alignTop&&(o+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:_.scrollTop(),position:"absolute"}),(t.st.fixedBgPos===!1||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:r.height(),position:"absolute"}),t.st.enableEscapeKey&&r.on("keyup"+m,function(e){27===e.keyCode&&t.close()}),_.on("resize"+m,function(){t.updateSize()}),t.st.closeOnContentClick||(o+=" mfp-auto-cursor"),o&&t.wrap.addClass(o);var d=t.wH=_.height(),f={};if(t.fixedContentPos&&t._hasScrollBar(d)){var g=t._getScrollbarSize();g&&(f.marginRight=g)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):f.overflow="hidden");var y=t.st.mainClass;return t.isIE7&&(y+=" mfp-ie7"),y&&t._addClassToMFP(y),t.updateItemHTML(),S("BuildControls"),e("html").css(f),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||i),t._lastFocusedEl=document.activeElement,setTimeout(function(){t.content?(t._addClassToMFP(v),t._setFocus()):t.bgOverlay.addClass(v),r.on("focusin"+m,t._onFocusIn)},16),t.isOpen=!0,t.updateSize(d),S(h),n},close:function(){t.isOpen&&(S(l),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP(y),setTimeout(function(){t._close()},t.st.removalDelay)):t._close())},_close:function(){S(u);var n=y+" "+v+" ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(n+=t.st.mainClass+" "),t._removeClassFromMFP(n),t.fixedContentPos){var i={marginRight:""};t.isIE7?e("body, html").css("overflow",""):i.overflow="",e("html").css(i)}r.off("keyup"+m+" focusin"+m),t.ev.off(m),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&t.currTemplate[t.currItem.type]!==!0||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,S(c)},updateSize:function(e){if(t.isIOS){var n=document.documentElement.clientWidth/window.innerWidth,i=window.innerHeight*n;t.wrap.css("height",i),t.wH=i}else t.wH=e||_.height();t.fixedContentPos||t.wrap.css("height",t.wH),S("Resize")},updateItemHTML:function(){var n=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),n.parsed||(n=t.parseEl(t.index));var i=n.type;if(S("BeforeChange",[t.currItem?t.currItem.type:"",i]),t.currItem=n,!t.currTemplate[i]){var r=!!t.st[i]&&t.st[i].markup;S("FirstMarkupParse",r),r?t.currTemplate[i]=e(r):t.currTemplate[i]=!0}s&&s!==n.type&&t.container.removeClass("mfp-"+s+"-holder");var o=t["get"+i.charAt(0).toUpperCase()+i.slice(1)](n,t.currTemplate[i]);t.appendContent(o,i),n.preloaded=!0,S(f,n),s=n.type,t.container.prepend(t.contentContainer),S("AfterChange")},appendContent:function(e,n){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&t.currTemplate[n]===!0?t.content.find(".mfp-close").length||t.content.append(O()):t.content=e:t.content="",S(d),t.container.addClass("mfp-"+n+"-holder"),t.contentContainer.append(t.content)},parseEl:function(n){var i,r=t.items[n];if(r.tagName?r={el:e(r)}:(i=r.type,r={data:r,src:r.src}),r.el){for(var s=t.types,o=0;o<s.length;o++)if(r.el.hasClass("mfp-"+s[o])){i=s[o];break}r.src=r.el.attr("data-mfp-src"),r.src||(r.src=r.el.attr("href"))}return r.type=i||t.st.type||"inline",r.index=n,r.parsed=!0,t.items[n]=r,S("ElementParse",r),t.items[n]},addGroup:function(e,n){var i=function(i){i.mfpEl=this,t._openClick(i,e,n)};n||(n={});var r="click.magnificPopup";n.mainEl=e,n.items?(n.isObj=!0,e.off(r).on(r,i)):(n.isObj=!1,n.delegate?e.off(r).on(r,n.delegate,i):(n.items=e,e.off(r).on(r,i)))},_openClick:function(n,i,r){var s=void 0!==r.midClick?r.midClick:e.magnificPopup.defaults.midClick;if(s||2!==n.which&&!n.ctrlKey&&!n.metaKey){var o=void 0!==r.disableOn?r.disableOn:e.magnificPopup.defaults.disableOn;if(o)if(e.isFunction(o)){if(!o.call(t))return!0}else if(_.width()<o)return!0;n.type&&(n.preventDefault(),t.isOpen&&n.stopPropagation()),r.el=e(n.mfpEl),r.delegate&&(r.items=i.find(r.delegate)),t.open(r)}},updateStatus:function(e,i){if(t.preloader){n!==e&&t.container.removeClass("mfp-s-"+n),i||"loading"!==e||(i=t.st.tLoading);var r={status:e,text:i};S("UpdateStatus",r),e=r.status,i=r.text,t.preloader.html(i),t.preloader.find("a").on("click",function(e){e.stopImmediatePropagation()}),t.container.addClass("mfp-s-"+e),n=e}},_checkIfClose:function(n){if(!e(n).hasClass(b)){var i=t.st.closeOnContentClick,r=t.st.closeOnBgClick;if(i&&r)return!0;if(!t.content||e(n).hasClass("mfp-close")||t.preloader&&n===t.preloader[0])return!0;if(n===t.content[0]||e.contains(t.content[0],n)){if(i)return!0}else if(r&&e.contains(document,n))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?r.height():document.body.scrollHeight)>(e||_.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(n){if(n.target!==t.wrap[0]&&!e.contains(t.wrap[0],n.target))return t._setFocus(),!1},_parseMarkup:function(t,n,i){var r;i.data&&(n=e.extend(i.data,n)),S(p,[t,n,i]),e.each(n,function(e,n){if(void 0===n||n===!1)return!0;if(r=e.split("_"),r.length>1){var i=t.find(m+"-"+r[0]);if(i.length>0){var s=r[1];"replaceWith"===s?i[0]!==n[0]&&i.replaceWith(n):"img"===s?i.is("img")?i.attr("src",n):i.replaceWith('<img src="'+n+'" class="'+i.attr("class")+'" />'):i.attr(r[1],n)}}else t.find(m+"-"+e).html(n)})},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.id="mfp-sbm",e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:C.prototype,modules:[],open:function(t,n){return E(),t=t?e.extend(!0,{},t):{},t.isObj=!0,t.index=n||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,n){n.options&&(e.magnificPopup.defaults[t]=n.options),e.extend(this.proto,n.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">&times;</button>',tClose:"Close (Esc)",tLoading:"Loading..."}},e.fn.magnificPopup=function(n){E();var i=e(this);if("string"==typeof n)if("open"===n){var r,s=w?i.data("magnificPopup"):i[0].magnificPopup,o=parseInt(arguments[1],10)||0;s.items?r=s.items[o]:(r=i,s.delegate&&(r=r.find(s.delegate)),r=r.eq(o)),t._openClick({mfpEl:r},i,s)}else t.isOpen&&t[n].apply(t,Array.prototype.slice.call(arguments,1));else n=e.extend(!0,{},n),w?i.data("magnificPopup",n):i[0].magnificPopup=n,t.addGroup(i,n);return i};var P,k,M,D="inline",F=function(){M&&(k.after(M.addClass(P)).detach(),M=null)};e.magnificPopup.registerModule(D,{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push(D),x(u+"."+D,function(){F()})},getInline:function(n,i){if(F(),n.src){var r=t.st.inline,s=e(n.src);if(s.length){var o=s[0].parentNode;o&&o.tagName&&(k||(P=r.hiddenClass,k=T(P),P="mfp-"+P),M=s.after(k).detach().removeClass(P)),t.updateStatus("ready")}else t.updateStatus("error",r.tNotFound),s=e("<div>");return n.inlineElement=s,s}return t.updateStatus("ready"),t._parseMarkup(i,{},n),i}}});var R,I="ajax",j=function(){R&&i.removeClass(R)},L=function(){j(),t.req&&t.req.abort()};e.magnificPopup.registerModule(I,{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push(I),R=t.st.ajax.cursor,x(u+"."+I,L),x("BeforeChange."+I,L)},getAjax:function(n){R&&i.addClass(R),t.updateStatus("loading");var r=e.extend({url:n.src,success:function(i,r,s){var o={data:i,xhr:s};S("ParseAjax",o),t.appendContent(e(o.data),I),n.finished=!0,j(),t._setFocus(),setTimeout(function(){t.wrap.addClass(v)},16),t.updateStatus("ready"),S("AjaxContentAdded")},error:function(){j(),n.finished=n.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",n.src))}},t.st.ajax.settings);return t.req=e.ajax(r),""}}});var N,$=function(n){if(n.data&&void 0!==n.data.title)return n.data.title;var i=t.st.image.titleSrc;if(i){if(e.isFunction(i))return i.call(t,n);if(n.el)return n.el.attr(i)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var e=t.st.image,n=".image";t.types.push("image"),x(h+n,function(){"image"===t.currItem.type&&e.cursor&&i.addClass(e.cursor)}),x(u+n,function(){e.cursor&&i.removeClass(e.cursor),_.off("resize"+m)}),x("Resize"+n,t.resizeImage),t.isLowIE&&x("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var n=0;t.isLowIE&&(n=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-n)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,N&&clearInterval(N),e.isCheckingImgSize=!1,S("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var n=0,i=e.img[0],r=function(s){N&&clearInterval(N),N=setInterval(function(){return i.naturalWidth>0?void t._onImageHasSize(e):(n>200&&clearInterval(N),n++,void(3===n?r(10):40===n?r(50):100===n&&r(500)))},s)};r(1)},getImage:function(n,i){var r=0,s=function(){n&&(n.img[0].complete?(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("ready")),n.hasSize=!0,n.loaded=!0,S("ImageLoadComplete")):(r++,r<200?setTimeout(s,100):o()))},o=function(){n&&(n.img.off(".mfploader"),n===t.currItem&&(t._onImageHasSize(n),t.updateStatus("error",a.tError.replace("%url%",n.src))),n.hasSize=!0,n.loaded=!0,n.loadError=!0)},a=t.st.image,u=i.find(".mfp-img");if(u.length){var l=document.createElement("img");l.className="mfp-img",n.img=e(l).on("load.mfploader",s).on("error.mfploader",o),l.src=n.src,u.is("img")&&(n.img=n.img.clone()),l=n.img[0],l.naturalWidth>0?n.hasSize=!0:l.width||(n.hasSize=!1)}return t._parseMarkup(i,{title:$(n),img_replaceWith:n.img},n),t.resizeImage(),n.hasSize?(N&&clearInterval(N),n.loadError?(i.addClass("mfp-loading"),t.updateStatus("error",a.tError.replace("%url%",n.src))):(i.removeClass("mfp-loading"),t.updateStatus("ready")),i):(t.updateStatus("loading"),n.loading=!0,n.hasSize||(n.imgHidden=!0,i.addClass("mfp-loading"),t.findImageSize(n)),i)}}});var B,z=function(){return void 0===B&&(B=void 0!==document.createElement("p").style.MozTransform),B};e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,n=t.st.zoom,i=".zoom";if(n.enabled&&t.supportsTransition){var r,s,o=n.duration,a=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),i="all "+n.duration/1e3+"s "+n.easing,r={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},s="transition";return r["-webkit-"+s]=r["-moz-"+s]=r["-o-"+s]=r[s]=i,t.css(r),t},c=function(){t.content.css("visibility","visible")};x("BuildControls"+i,function(){if(t._allowZoom()){if(clearTimeout(r),t.content.css("visibility","hidden"),e=t._getItemToZoom(),!e)return void c();s=a(e),s.css(t._getOffset()),t.wrap.append(s),r=setTimeout(function(){s.css(t._getOffset(!0)),r=setTimeout(function(){c(),setTimeout(function(){s.remove(),e=s=null,S("ZoomAnimationEnded")},16)},o)},16)}}),x(l+i,function(){if(t._allowZoom()){if(clearTimeout(r),t.st.removalDelay=o,!e){if(e=t._getItemToZoom(),!e)return;s=a(e)}s.css(t._getOffset(!0)),t.wrap.append(s),t.content.css("visibility","hidden"),setTimeout(function(){s.css(t._getOffset())},16)}}),x(u+i,function(){t._allowZoom()&&(c(),s&&s.remove(),e=null)})}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return!!t.currItem.hasSize&&t.currItem.img},_getOffset:function(n){var i;i=n?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem);var r=i.offset(),s=parseInt(i.css("padding-top"),10),o=parseInt(i.css("padding-bottom"),10);r.top-=e(window).scrollTop()-s;var a={width:i.width(),height:(w?i.innerHeight():i[0].offsetHeight)-o-s};return z()?a["-moz-transform"]=a.transform="translate("+r.left+"px,"+r.top+"px)":(a.left=r.left,a.top=r.top),a}}});var q="iframe",U="//about:blank",V=function(e){if(t.currTemplate[q]){var n=t.currTemplate[q].find("iframe");n.length&&(e||(n[0].src=U),t.isIE8&&n.css("display",e?"block":"none"))}};e.magnificPopup.registerModule(q,{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push(q),x("BeforeChange",function(e,t,n){t!==n&&(t===q?V():n===q&&V(!0))}),x(u+"."+q,function(){V()})},getIframe:function(n,i){var r=n.src,s=t.st.iframe;e.each(s.patterns,function(){if(r.indexOf(this.index)>-1)return this.id&&(r="string"==typeof this.id?r.substr(r.lastIndexOf(this.id)+this.id.length,r.length):this.id.call(this,r)),r=this.src.replace("%id%",r),!1});var o={};return s.srcAction&&(o[s.srcAction]=r),t._parseMarkup(i,o,n),t.updateStatus("ready"),i}}});var H=function(e){var n=t.items.length;return e>n-1?e-n:e<0?n+e:e},W=function(e,t,n){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,n)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var n=t.st.gallery,i=".mfp-gallery",s=Boolean(e.fn.mfpFastClick);return t.direction=!0,!(!n||!n.enabled)&&(o+=" mfp-gallery",x(h+i,function(){n.navigateByImgClick&&t.wrap.on("click"+i,".mfp-img",function(){if(t.items.length>1)return t.next(),!1}),r.on("keydown"+i,function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()})}),x("UpdateStatus"+i,function(e,n){n.text&&(n.text=W(n.text,t.currItem.index,t.items.length))}),x(p+i,function(e,i,r,s){var o=t.items.length;r.counter=o>1?W(n.tCounter,s.index,o):""}),x("BuildControls"+i,function(){if(t.items.length>1&&n.arrows&&!t.arrowLeft){var i=n.arrowMarkup,r=t.arrowLeft=e(i.replace(/%title%/gi,n.tPrev).replace(/%dir%/gi,"left")).addClass(b),o=t.arrowRight=e(i.replace(/%title%/gi,n.tNext).replace(/%dir%/gi,"right")).addClass(b),a=s?"mfpFastClick":"click";r[a](function(){t.prev()}),o[a](function(){t.next()}),t.isIE7&&(T("b",r[0],!1,!0),T("a",r[0],!1,!0),T("b",o[0],!1,!0),T("a",o[0],!1,!0)),t.container.append(r.add(o))}}),x(f+i,function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout(function(){t.preloadNearbyImages(),t._preloadTimeout=null},16)}),void x(u+i,function(){r.off(i),t.wrap.off("click"+i),t.arrowLeft&&s&&t.arrowLeft.add(t.arrowRight).destroyMfpFastClick(),t.arrowRight=t.arrowLeft=null}))},next:function(){t.direction=!0,t.index=H(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=H(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,n=t.st.gallery.preload,i=Math.min(n[0],t.items.length),r=Math.min(n[1],t.items.length);for(e=1;e<=(t.direction?r:i);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?i:r);e++)t._preloadItem(t.index-e)},_preloadItem:function(n){if(n=H(n),!t.items[n].preloaded){var i=t.items[n];i.parsed||(i=t.parseEl(n)),S("LazyLoad",i),"image"===i.type&&(i.img=e('<img class="mfp-img" />').on("load.mfploader",function(){i.hasSize=!0}).on("error.mfploader",function(){i.hasSize=!0,i.loadError=!0,S("LazyLoadError",i)}).attr("src",i.src)),i.preloaded=!0}}}});var K="retina";e.magnificPopup.registerModule(K,{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,function(e){return"@2x"+e})},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,n=e.ratio;n=isNaN(n)?n():n,n>1&&(x("ImageHasSize."+K,function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/n,width:"100%"})}),x("ElementParse."+K,function(t,i){i.src=e.replaceSrc(i,n)}))}}}}),E()}(window.jQuery||window.Zepto)},53:function(e,t){/*!
	 * jQuery serializeObject - v0.2 - 1/20/2010
	 * http://benalman.com/projects/jquery-misc-plugins/
	 * 
	 * Copyright (c) 2010 "Cowboy" Ben Alman
	 * Dual licensed under the MIT and GPL licenses.
	 * http://benalman.com/about/license/
	 */
!function(e,t){"$:nomunge";e.fn.serializeObject=function(){var n={};return e.each(this.serializeArray(),function(i,r){var s=r.name,o=r.value;n[s]=n[s]===t?o:e.isArray(n[s])?n[s].concat(o):[n[s],o]}),n}}(jQuery)},54:function(e,t){"use strict";function n(e){return e.replace(/[!$&(-+\-.:<-?\[-^{-}]/g,"\\$&")}function i(e){return e.replace(/\$/g,"$$$$")}function r(e){return["(",n(e).trim().replace(/ +/g,"|"),")"].join("")}Object.defineProperty(t,"__esModule",{value:!0}),t.escapeUnsafeRegexSymbols=n,t.escapeRegexReplacementSymbols=i,t.makeRegexForMultipleWords=r},55:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(15),s=i(r),o=n(6),a=i(o),u=s.default.Model.extend({defaults:{text:"",level:"info",language:"en"}}),l=s.default.Collection.extend({model:u}),c=s.default.View.extend({className:"alert alert-block",render:function(){return this.$el.addClass(["alert",this.model.get("level")].join("-")),this.$el.attr("lang",this.model.get("language")),this.$el.html(this.model.get("text")).hide().fadeIn(300),this}}),d=s.default.View.extend({el:".js-alerts",initialize:function(){this.subViews=[],this.listenTo(this.collection,"add",this.add),this.listenTo(this.collection,"remove",this.remove)},add:function(e){var t=new c({model:e});this.subViews.push(t),this.$el.prepend(t.render().el)},remove:function(e){var t=a.default.find(this.subViews,function(t){return t.model===e});this.subViews=(0,a.default)(this.subViews).without(t),t.$el.fadeOut(3500,function(){t.remove()})}}),p=new l,h=void 0,f={show:function(e){h||(h=new d({collection:p}));var t=new u(e);p.add(t),window.setTimeout(function(){p.remove(t)},2e3)}};t.default=f},60:function(e,t,n){var i;!function(r,s,o){function a(e,t,n){return e.addEventListener?void e.addEventListener(t,n,!1):void e.attachEvent("on"+t,n)}function u(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return w[e.which]?w[e.which]:_[e.which]?_[e.which]:String.fromCharCode(e.which).toLowerCase()}function l(e,t){return e.sort().join(",")===t.sort().join(",")}function c(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}function d(e){return e.preventDefault?void e.preventDefault():void(e.returnValue=!1)}function p(e){return e.stopPropagation?void e.stopPropagation():void(e.cancelBubble=!0)}function h(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function f(){if(!C){C={};for(var e in w)e>95&&e<112||w.hasOwnProperty(e)&&(C[w[e]]=e)}return C}function g(e,t,n){return n||(n=f()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function m(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus"),e.split("+"))}function v(e,t){var n,i,r,s=[];for(n=m(e),r=0;r<n.length;++r)i=n[r],T[i]&&(i=T[i]),t&&"keypress"!=t&&x[i]&&(i=x[i],s.push("shift")),h(i)&&s.push(i);return t=g(i,s,t),{key:i,modifiers:s,action:t}}function y(e,t){return null!==e&&e!==s&&(e===t||y(e.parentNode,t))}function b(e){function t(e){e=e||{};var t,n=!1;for(t in C)e[t]?n=!0:C[t]=0;n||(x=!1)}function n(e,t,n,i,r,s){var o,a,u=[],c=n.type;if(!m._callbacks[e])return[];for("keyup"==c&&h(e)&&(t=[e]),o=0;o<m._callbacks[e].length;++o)if(a=m._callbacks[e][o],(i||!a.seq||C[a.seq]==a.level)&&c==a.action&&("keypress"==c&&!n.metaKey&&!n.ctrlKey||l(t,a.modifiers))){var d=!i&&a.combo==r,p=i&&a.seq==i&&a.level==s;(d||p)&&m._callbacks[e].splice(o,1),u.push(a)}return u}function i(e,t,n,i){m.stopCallback(t,t.target||t.srcElement,n,i)||e(t,n)===!1&&(d(t),p(t))}function r(e){"number"!=typeof e.which&&(e.which=e.keyCode);var t=u(e);if(t)return"keyup"==e.type&&w===t?void(w=!1):void m.handleKey(t,c(e),e)}function o(){clearTimeout(y),y=setTimeout(t,1e3)}function f(e,n,r,s){function a(t){return function(){x=t,++C[e],o()}}function l(n){i(r,n,e),"keyup"!==s&&(w=u(n)),setTimeout(t,10)}C[e]=0;for(var c=0;c<n.length;++c){var d=c+1===n.length,p=d?l:a(s||v(n[c+1]).action);g(n[c],p,s,e,c)}}function g(e,t,i,r,s){m._directMap[e+":"+i]=t,e=e.replace(/\s+/g," ");var o,a=e.split(" ");return a.length>1?void f(e,a,t,i):(o=v(e,i),m._callbacks[o.key]=m._callbacks[o.key]||[],n(o.key,o.modifiers,{type:o.action},r,e,s),void m._callbacks[o.key][r?"unshift":"push"]({callback:t,modifiers:o.modifiers,action:o.action,seq:r,level:s,combo:e}))}var m=this;if(e=e||s,!(m instanceof b))return new b(e);m.target=e,m._callbacks={},m._directMap={};var y,C={},w=!1,_=!1,x=!1;m._handleKey=function(e,r,s){var o,a=n(e,r,s),u={},l=0,c=!1;for(o=0;o<a.length;++o)a[o].seq&&(l=Math.max(l,a[o].level));for(o=0;o<a.length;++o)if(a[o].seq){if(a[o].level!=l)continue;c=!0,u[a[o].seq]=1,i(a[o].callback,s,a[o].combo,a[o].seq)}else c||i(a[o].callback,s,a[o].combo);var d="keypress"==s.type&&_;s.type!=x||h(e)||d||t(u),_=c&&"keydown"==s.type},m._bindMultiple=function(e,t,n){for(var i=0;i<e.length;++i)g(e[i],t,n)},a(e,"keypress",r),a(e,"keydown",r),a(e,"keyup",r)}if(r){for(var C,w={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},_={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},x={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},T={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},S=1;S<20;++S)w[111+S]="f"+S;for(S=0;S<=9;++S)w[S+96]=S.toString();b.prototype.bind=function(e,t,n){var i=this;return e=e instanceof Array?e:[e],i._bindMultiple.call(i,e,t,n),i},b.prototype.unbind=function(e,t){var n=this;return n.bind.call(n,e,function(){},t)},b.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},b.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},b.prototype.stopCallback=function(e,t){var n=this;return!((" "+t.className+" ").indexOf(" mousetrap ")>-1)&&(!y(t,n.target)&&("INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable))},b.prototype.handleKey=function(){var e=this;return e._handleKey.apply(e,arguments)},b.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(w[t]=e[t]);C=null},b.init=function(){var e=b(s);for(var t in e)"_"!==t.charAt(0)&&(b[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},b.init(),r.Mousetrap=b,"undefined"!=typeof e&&e.exports&&(e.exports=b),i=function(){return b}.call(t,n,t,e),!(i!==o&&(e.exports=i))}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)},67:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){e.length===e.filter(":checked").length?t.prop("disabled",!1):t.prop("disabled",!0)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(3),o=i(s),a={fixSidebarHeight:function(){var e=(0,o.default)("#body"),t=e.height(),n=parseInt(e.css("padding-bottom"),10),i=(0,o.default)("#wrapper").height()-e.offset().top-n;(0,o.default)("#sidebar").css("width","30%");var r=(0,o.default)("#sidebar #sidebar-content").height()+(0,o.default)("#footer").height()+n,s=Math.max(i,r);(0,o.default)("#sidebar").css("width",""),t<s&&e.css("height",s)},updateInputState:function(e,t){var n=(0,o.default)(e);if(n.length){var i=(0,o.default)(t);r(n,i),n.change(function(){r(n,i)})}}};t.default=a},79:function(e,t,n){var i=n(80);!function(e){e.fn.spin=function(t){return this.each(function(){var n=e(this),r=n.data();r.spinner&&(r.spinner.stop(),delete r.spinner),t!==!1&&(r.spinner=new i(e.extend({color:n.css("color")},t)).spin(this))}),this}}(jQuery)},80:function(e,t,n){!function(t,n){e.exports=n()}(this,function(){"use strict";function e(e,t){var n,i=document.createElement(e||"div");for(n in t)i[n]=t[n];return i}function t(e){for(var t=1,n=arguments.length;t<n;t++)e.appendChild(arguments[t]);return e}function n(e,t,n,i){var r=["opacity",t,~~(100*e),n,i].join("-"),s=.01+n/i*100,o=Math.max(1-(1-e)/t*(100-s),e),a=c.substring(0,c.indexOf("Animation")).toLowerCase(),u=a&&"-"+a+"-"||"";return p[r]||(h.insertRule("@"+u+"keyframes "+r+"{0%{opacity:"+o+"}"+s+"%{opacity:"+e+"}"+(s+.01)+"%{opacity:1}"+(s+t)%100+"%{opacity:"+e+"}100%{opacity:"+o+"}}",h.cssRules.length),p[r]=1),r}function i(e,t){var n,i,r=e.style;for(t=t.charAt(0).toUpperCase()+t.slice(1),i=0;i<d.length;i++)if(n=d[i]+t,void 0!==r[n])return n;if(void 0!==r[t])return t}function r(e,t){for(var n in t)e.style[i(e,n)||n]=t[n];return e}function s(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)void 0===e[i]&&(e[i]=n[i])}return e}function o(e){for(var t={x:e.offsetLeft,y:e.offsetTop};e=e.offsetParent;)t.x+=e.offsetLeft,t.y+=e.offsetTop;return t}function a(e,t){return"string"==typeof e?e:e[t%e.length]}function u(e){return"undefined"==typeof this?new u(e):void(this.opts=s(e||{},u.defaults,f))}function l(){function n(t,n){return e("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',n)}h.addRule(".spin-vml","behavior:url(#default#VML)"),u.prototype.lines=function(e,i){function s(){return r(n("group",{coordsize:c+" "+c,coordorigin:-l+" "+-l}),{width:c,height:c})}function o(e,o,u){t(p,t(r(s(),{rotation:360/i.lines*e+"deg",left:~~o}),t(r(n("roundrect",{arcsize:i.corners}),{width:l,height:i.width,left:i.radius,top:-i.width>>1,filter:u}),n("fill",{color:a(i.color,e),opacity:i.opacity}),n("stroke",{opacity:0}))))}var u,l=i.length+i.width,c=2*l,d=2*-(i.width+i.length)+"px",p=r(s(),{position:"absolute",top:d,left:d});if(i.shadow)for(u=1;u<=i.lines;u++)o(u,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(u=1;u<=i.lines;u++)o(u);return t(e,p)},u.prototype.opacity=function(e,t,n,i){var r=e.firstChild;i=i.shadow&&i.lines||0,r&&t+i<r.childNodes.length&&(r=r.childNodes[t+i],r=r&&r.firstChild,r=r&&r.firstChild,r&&(r.opacity=n))}}var c,d=["webkit","Moz","ms","O"],p={},h=function(){var n=e("style",{type:"text/css"});return t(document.getElementsByTagName("head")[0],n),n.sheet||n.styleSheet}(),f={lines:12,length:7,width:5,radius:10,rotate:0,corners:1,color:"#000",direction:1,speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto",position:"relative"};u.defaults={},s(u.prototype,{spin:function(t){this.stop();var n,i,s=this,a=s.opts,u=s.el=r(e(0,{className:a.className}),{position:a.position,width:0,zIndex:a.zIndex}),l=a.radius+a.length+a.width;if(t&&(t.insertBefore(u,t.firstChild||null),i=o(t),n=o(u),r(u,{left:("auto"==a.left?i.x-n.x+(t.offsetWidth>>1):parseInt(a.left,10)+l)+"px",top:("auto"==a.top?i.y-n.y+(t.offsetHeight>>1):parseInt(a.top,10)+l)+"px"})),u.setAttribute("role","progressbar"),s.lines(u,s.opts),!c){var d,p=0,h=(a.lines-1)*(1-a.direction)/2,f=a.fps,g=f/a.speed,m=(1-a.opacity)/(g*a.trail/100),v=g/a.lines;!function e(){p++;for(var t=0;t<a.lines;t++)d=Math.max(1-(p+(a.lines-t)*v)%g*m,a.opacity),s.opacity(u,t*a.direction+h,d,a);s.timeout=s.el&&setTimeout(e,~~(1e3/f))}()}return s},stop:function(){var e=this.el;return e&&(clearTimeout(this.timeout),e.parentNode&&e.parentNode.removeChild(e),this.el=void 0),this},lines:function(i,s){function o(t,n){return r(e(),{position:"absolute",width:s.length+s.width+"px",height:s.width+"px",background:t,boxShadow:n,transformOrigin:"left",transform:"rotate("+~~(360/s.lines*l+s.rotate)+"deg) translate("+s.radius+"px,0)",borderRadius:(s.corners*s.width>>1)+"px"})}for(var u,l=0,d=(s.lines-1)*(1-s.direction)/2;l<s.lines;l++)u=r(e(),{position:"absolute",top:1+~(s.width/2)+"px",transform:s.hwaccel?"translate3d(0,0,0)":"",opacity:s.opacity,animation:c&&n(s.opacity,s.trail,d+l*s.direction,s.lines)+" "+1/s.speed+"s linear infinite"}),s.shadow&&t(u,r(o("#000","0 0 4px #000"),{top:"2px"})),t(i,t(u,o(a(s.color,l),"0 0 1px rgba(0,0,0,.1)")));return i},opacity:function(e,t,n){t<e.childNodes.length&&(e.childNodes[t].style.opacity=n)}});var g=r(e("group"),{behavior:"url(#default#VML)"});return!i(g,"transform")&&g.adj?l():c=i(g,"animation"),u})},83:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){402===e.status?o(e.responseText):p.default.executeFunctionByName(t,window,e)}function s(e){e.preventDefault();var t=(0,u.default)(this),n=(0,c.default)(PTL.captcha.postData,t.serializeObject()),i=n.sfn,s=n.efn,o=t.attr("action");u.default.ajax({url:o,type:"POST",data:n,success:function(){p.default.executeFunctionByName(i,window,e),u.default.magnificPopup.close()},error:function(e){r(e,s)}})}function o(e){(0,u.default)(document).off("submit","#js-captcha"),(0,u.default)(document).on("submit","#js-captcha",s),u.default.magnificPopup.open({items:{src:e,type:"inline"},focus:"#id_captcha_answer"})}Object.defineProperty(t,"__esModule",{value:!0});var a=n(3),u=i(a);n(52),n(53);var l=n(7),c=i(l),d=n(21),p=i(d);t.default={onError:r,postData:{}}},84:function(e,t,n){"use strict";function i(e){function t(e){return'<span class="highlight-punctuation '+n+'">'+e+"</span>"}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.replace(c,t)}function r(e){function t(e){var t={"\\r":i.replace(/%s/,"\\r"),"\\n":i.replace(/%s/,"\\n"),"\\t":i.replace(/%s/,"\\t")};return t[e]}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i='<span class="highlight-escape '+n+'">%s</span>';return e.replace(d,t)}function s(e){return e.replace(p,"$&<br/>")}function o(e){function t(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;"},n=t[e];if(void 0===n){var r=e.slice(1,e.length-1);n=i.replace(/%s/,(0,l.escapeRegexReplacementSymbols)(o(r)))}return n}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i='<span class="highlight-html '+n+'">&lt;%s&gt;</span>';return e.replace(h,t)}function a(e){function t(e){var t=u.BASE_MAP_REVERSE_HL[e].charCodeAt().toString(16),i="0".repeat(4-t.length),r="\\u"+i+t.toUpperCase();return'<span class="'+n+'" data-codepoint="'+r+'">'+e+"</span>"}var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.replace(u.RE_BASE_REVERSE,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.highlightPunctuation=i,t.highlightEscapes=r,t.nl2br=s,t.highlightHtml=o,t.highlightSymbols=a;var u=n(47),l=n(54),c=/[™©®]|[℃℉°]|[±πθ×÷−√∞∆Σ′″]|[‘’ʼ‚‛“”„‟]|[«»]|[£¥€]|…|—|–|[ ]/g,d=/\\r|\\n|\\t/gm,p=/\r\n|[\r\n]/gm,h=/<[^>]+>|[&<>]/gm},85:function(e,t){"use strict";function n(e){var t=document.createElement("textarea");return t.innerHTML=e,t.textContent}Object.defineProperty(t,"__esModule",{value:!0}),t.decodeEntities=n},86:function(e,t){"use strict";function n(e){if(!e)return e;var t=e.indexOf("@"),n=e.replace("_","-");return t!==-1&&(n=n.slice(0,t)),n}Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeCode=n},87:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),s=i(r),o=n(60),a=i(o),u=n(7),l=i(u),c=n(28),d=i(c),p="pootle-search",h={init:function(e){var t=this,n=this;this.state={searchText:"",searchFields:["source","target"],searchOptions:[]},this.$form=(0,s.default)("#search-form"),this.$container=(0,s.default)(".js-search-container"),this.$fields=(0,s.default)(".js-search-fields"),this.$options=(0,s.default)(".js-search-options"),this.$input=(0,s.default)("#id_search"),this.settings=(0,l.default)({onSearch:this.onSearch},e),(0,a.default)(document.body).bind("mod+shift+s",function(e){e.preventDefault(),t.$input.focus()}),(0,a.default)(this.$form[0]).bind("esc",function(e){e.preventDefault(),t.$form.hasClass("focused")&&(t.$input.blur(),t.toggleFields(e))}),this.$input.mouseup(function(e){e.preventDefault()}).focus(function(){t.$input.select(),t.$form.addClass("focused")}).blur(function(){""===t.$input.val()&&t.$input.val(t.state.searchText),t.$form.removeClass("focused")}),this.$input.click(function(e){h.isOpen()||t.toggleFields(e)}),this.$input.on("keypress",function(e){13===e.which&&t.$form.trigger("submit")}),this.$form.on("submit",this.handleSearch.bind(this)),(0,s.default)(document).mouseup(function(e){t.isOpen()&&e.target!==n.$input.get(0)&&!t.$container.find(e.target).length&&t.toggleFields(e)})},setState:function(e){this.state=(0,l.default)({},this.state,e),this.updateUI()},toggleFields:function(e){e.preventDefault(),this.$container.toggle()},isOpen:function(){return this.$container.is(":visible")},buildSearchQuery:function(){var e=this.state,t=e.searchText,n=e.searchFields,i=e.searchOptions,r=encodeURIComponent(t);if(n.length&&(r+="&sfields="+n.join(",")),i.length&&(r+="&soptions="+i.join(",")),n.length||i.length){var s={};n.length&&(s.sfields=n),i.length&&(s.soptions=i),(0,d.default)(p,JSON.stringify(s),{path:"/"})}return r},handleSearch:function(e){e.preventDefault();var t=this.$input.val(),n=[],i=[];this.$fields.find("input:checked").each(function(){i.push((0,s.default)(this).val())}),this.$options.find("input:checked").each(function(){n.push((0,s.default)(this).val())}),i.length||(i=["source","target"]),this.setState({searchText:t,searchFields:i,searchOptions:n}),this.settings.onSearch.call(this,this.state.searchText)},onSearch:function(e){if(!e)return!1;var t="#search="+this.buildSearchQuery();return window.location=this.$form[0].action+t,!1},updateUI:function(){this.$input.val(this.state.searchText).focus();var e=this.state,t=e.searchFields,n=e.searchOptions;this.$fields.find("input").each(function(){(0,s.default)(this).prop("checked",t.indexOf(this.value)!==-1)}),this.$options.find("input").each(function(){(0,s.default)(this).prop("checked",n.indexOf(this.value)!==-1)})}};t.default=h},93:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=u.diff_main(e,t),i=[];u.diff_cleanupSemantic(n);for(var r=0;r<n.length;r++){var s=n[r][0],l=(0,a.highlightRO)(n[r][1]);s===o.default.DIFF_INSERT?i[r]='<span class="diff-insert">'+l+"</span>":s===o.default.DIFF_DELETE?i[r]='<span class="diff-delete">'+l+"</span>":s===o.default.DIFF_EQUAL&&(i[r]=l)}return i.join("")}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var s=n(97),o=i(s),a=n(21),u=new o.default},97:function(e,t){"use strict";function n(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32}var i=-1,r=1,s=0;n.Diff,n.prototype.diff_main=function(e,t,n,i){"undefined"==typeof i&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var r=i;if(null==e||null==t)throw new Error("Null input. (diff_main)");if(e==t)return e?[[s,e]]:[];"undefined"==typeof n&&(n=!0);var o=n,a=this.diff_commonPrefix(e,t),u=e.substring(0,a);e=e.substring(a),t=t.substring(a),a=this.diff_commonSuffix(e,t);var l=e.substring(e.length-a);e=e.substring(0,e.length-a),t=t.substring(0,t.length-a);var c=this.diff_compute_(e,t,o,r);return u&&c.unshift([s,u]),l&&c.push([s,l]),this.diff_cleanupMerge(c),c},n.prototype.diff_compute_=function(e,t,n,o){var a;if(!e)return[[r,t]];if(!t)return[[i,e]];var u=e.length>t.length?e:t,l=e.length>t.length?t:e,c=u.indexOf(l);if(c!=-1)return a=[[r,u.substring(0,c)],[s,l],[r,u.substring(c+l.length)]],e.length>t.length&&(a[0][0]=a[2][0]=i),a;if(1==l.length)return[[i,e],[r,t]];var d=this.diff_halfMatch_(e,t);if(d){var p=d[0],h=d[1],f=d[2],g=d[3],m=d[4],v=this.diff_main(p,f,n,o),y=this.diff_main(h,g,n,o);return v.concat([[s,m]],y)}return n&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,o):this.diff_bisect_(e,t,o)},n.prototype.diff_lineMode_=function(e,t,n){var o=this.diff_linesToChars_(e,t);e=o.chars1,t=o.chars2;var a=o.lineArray,u=this.diff_main(e,t,!1,n);this.diff_charsToLines_(u,a),this.diff_cleanupSemantic(u),u.push([s,""]);for(var l=0,c=0,d=0,p="",h="";l<u.length;){switch(u[l][0]){case r:d++,h+=u[l][1];break;case i:c++,p+=u[l][1];break;case s:if(c>=1&&d>=1){u.splice(l-c-d,c+d),l=l-c-d;for(var o=this.diff_main(p,h,!1,n),f=o.length-1;f>=0;f--)u.splice(l,0,o[f]);l+=o.length}d=0,c=0,p="",h=""}l++}return u.pop(),u},n.prototype.diff_bisect_=function(e,t,n){for(var s=e.length,o=t.length,a=Math.ceil((s+o)/2),u=a,l=2*a,c=new Array(l),d=new Array(l),p=0;p<l;p++)c[p]=-1,d[p]=-1;c[u+1]=0,d[u+1]=0;for(var h=s-o,f=h%2!=0,g=0,m=0,v=0,y=0,b=0;b<a&&!((new Date).getTime()>n);b++){for(var C=-b+g;C<=b-m;C+=2){var w,_=u+C;w=C==-b||C!=b&&c[_-1]<c[_+1]?c[_+1]:c[_-1]+1;for(var x=w-C;w<s&&x<o&&e.charAt(w)==t.charAt(x);)w++,x++;if(c[_]=w,w>s)m+=2;else if(x>o)g+=2;else if(f){var T=u+h-C;if(T>=0&&T<l&&d[T]!=-1){var S=s-d[T];if(w>=S)return this.diff_bisectSplit_(e,t,w,x,n)}}}for(var O=-b+v;O<=b-y;O+=2){var S,T=u+O;S=O==-b||O!=b&&d[T-1]<d[T+1]?d[T+1]:d[T-1]+1;for(var E=S-O;S<s&&E<o&&e.charAt(s-S-1)==t.charAt(o-E-1);)S++,E++;if(d[T]=S,S>s)y+=2;else if(E>o)v+=2;else if(!f){var _=u+h-O;if(_>=0&&_<l&&c[_]!=-1){var w=c[_],x=u+w-_;if(S=s-S,w>=S)return this.diff_bisectSplit_(e,t,w,x,n)}}}}return[[i,e],[r,t]]},n.prototype.diff_bisectSplit_=function(e,t,n,i,r){var s=e.substring(0,n),o=t.substring(0,i),a=e.substring(n),u=t.substring(i),l=this.diff_main(s,o,!1,r),c=this.diff_main(a,u,!1,r);return l.concat(c)},n.prototype.diff_linesToChars_=function(e,t){function n(e){for(var t="",n=0,s=-1,o=i.length;s<e.length-1;){s=e.indexOf("\n",n),s==-1&&(s=e.length-1);var a=e.substring(n,s+1);n=s+1,(r.hasOwnProperty?r.hasOwnProperty(a):void 0!==r[a])?t+=String.fromCharCode(r[a]):(t+=String.fromCharCode(o),r[a]=o,i[o++]=a)}return t}var i=[],r={};i[0]="";var s=n(e),o=n(t);return{chars1:s,chars2:o,lineArray:i}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var i=e[n][1],r=[],s=0;s<i.length;s++)r[s]=t[i.charCodeAt(s)];e[n][1]=r.join("")}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,i=Math.min(e.length,t.length),r=i,s=0;n<r;)e.substring(s,r)==t.substring(s,r)?(n=r,s=n):i=r,r=Math.floor((i-n)/2+n);return r},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,i=Math.min(e.length,t.length),r=i,s=0;n<r;)e.substring(e.length-r,e.length-s)==t.substring(t.length-r,t.length-s)?(n=r,s=n):i=r,r=Math.floor((i-n)/2+n);return r},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,i=t.length;if(0==n||0==i)return 0;n>i?e=e.substring(n-i):n<i&&(t=t.substring(0,n));var r=Math.min(n,i);if(e==t)return r;for(var s=0,o=1;;){var a=e.substring(r-o),u=t.indexOf(a);if(u==-1)return s;o+=u,0!=u&&e.substring(r-o)!=t.substring(0,o)||(s=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){function n(e,t,n){for(var i,r,s,a,u=e.substring(n,n+Math.floor(e.length/4)),l=-1,c="";(l=t.indexOf(u,l+1))!=-1;){var d=o.diff_commonPrefix(e.substring(n),t.substring(l)),p=o.diff_commonSuffix(e.substring(0,n),t.substring(0,l));c.length<p+d&&(c=t.substring(l-p,l)+t.substring(l,l+d),i=e.substring(0,n-p),r=e.substring(n+d),s=t.substring(0,l-p),a=t.substring(l+d))}return 2*c.length>=e.length?[i,r,s,a,c]:null}if(this.Diff_Timeout<=0)return null;var i=e.length>t.length?e:t,r=e.length>t.length?t:e;if(i.length<4||2*r.length<i.length)return null;var s,o=this,a=n(i,r,Math.ceil(i.length/4)),u=n(i,r,Math.ceil(i.length/2));if(!a&&!u)return null;s=u?a&&a[4].length>u[4].length?a:u:a;var l,c,d,p;e.length>t.length?(l=s[0],c=s[1],d=s[2],p=s[3]):(d=s[0],p=s[1],l=s[2],c=s[3]);var h=s[4];return[l,c,d,p,h]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,n=[],o=0,a=null,u=0,l=0,c=0,d=0,p=0;u<e.length;)e[u][0]==s?(n[o++]=u,l=d,c=p,d=0,p=0,a=e[u][1]):(e[u][0]==r?d+=e[u][1].length:p+=e[u][1].length,a&&a.length<=Math.max(l,c)&&a.length<=Math.max(d,p)&&(e.splice(n[o-1],0,[i,a]),e[n[o-1]+1][0]=r,o--,o--,u=o>0?n[o-1]:-1,l=0,c=0,d=0,p=0,a=null,t=!0)),u++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),u=1;u<e.length;){if(e[u-1][0]==i&&e[u][0]==r){var h=e[u-1][1],f=e[u][1],g=this.diff_commonOverlap_(h,f),m=this.diff_commonOverlap_(f,h);g>=m?(g>=h.length/2||g>=f.length/2)&&(e.splice(u,0,[s,f.substring(0,g)]),e[u-1][1]=h.substring(0,h.length-g),e[u+1][1]=f.substring(g),u++):(m>=h.length/2||m>=f.length/2)&&(e.splice(u,0,[s,h.substring(0,m)]),e[u-1][0]=r,e[u-1][1]=f.substring(0,f.length-m),e[u+1][0]=i,e[u+1][1]=h.substring(m),u++),u++}u++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var i=e.charAt(e.length-1),r=t.charAt(0),s=i.match(n.nonAlphaNumericRegex_),o=r.match(n.nonAlphaNumericRegex_),a=s&&i.match(n.whitespaceRegex_),u=o&&r.match(n.whitespaceRegex_),l=a&&i.match(n.linebreakRegex_),c=u&&r.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),p=c&&t.match(n.blanklineStartRegex_);return d||p?5:l||c?4:s&&!a&&u?3:a||u?2:s||o?1:0}for(var i=1;i<e.length-1;){if(e[i-1][0]==s&&e[i+1][0]==s){var r=e[i-1][1],o=e[i][1],a=e[i+1][1],u=this.diff_commonSuffix(r,o);if(u){var l=o.substring(o.length-u);r=r.substring(0,r.length-u),o=l+o.substring(0,o.length-u),a=l+a}for(var c=r,d=o,p=a,h=t(r,o)+t(o,a);o.charAt(0)===a.charAt(0);){r+=o.charAt(0),o=o.substring(1)+a.charAt(0),a=a.substring(1);var f=t(r,o)+t(o,a);f>=h&&(h=f,c=r,d=o,p=a)}e[i-1][1]!=c&&(c?e[i-1][1]=c:(e.splice(i-1,1),i--),e[i][1]=d,p?e[i+1][1]=p:(e.splice(i+1,1),i--))}i++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,n=[],o=0,a=null,u=0,l=!1,c=!1,d=!1,p=!1;u<e.length;)e[u][0]==s?(e[u][1].length<this.Diff_EditCost&&(d||p)?(n[o++]=u,l=d,c=p,a=e[u][1]):(o=0,a=null),d=p=!1):(e[u][0]==i?p=!0:d=!0,a&&(l&&c&&d&&p||a.length<this.Diff_EditCost/2&&l+c+d+p==3)&&(e.splice(n[o-1],0,[i,a]),e[n[o-1]+1][0]=r,o--,a=null,l&&c?(d=p=!0,o=0):(o--,u=o>0?n[o-1]:-1,d=p=!1),t=!0)),u++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push([s,""]);for(var t,n=0,o=0,a=0,u="",l="";n<e.length;)switch(e[n][0]){case r:a++,l+=e[n][1],n++;break;case i:o++,u+=e[n][1],n++;break;case s:o+a>1?(0!==o&&0!==a&&(t=this.diff_commonPrefix(l,u),0!==t&&(n-o-a>0&&e[n-o-a-1][0]==s?e[n-o-a-1][1]+=l.substring(0,t):(e.splice(0,0,[s,l.substring(0,t)]),n++),l=l.substring(t),u=u.substring(t)),t=this.diff_commonSuffix(l,u),0!==t&&(e[n][1]=l.substring(l.length-t)+e[n][1],l=l.substring(0,l.length-t),u=u.substring(0,u.length-t))),0===o?e.splice(n-a,o+a,[r,l]):0===a?e.splice(n-o,o+a,[i,u]):e.splice(n-o-a,o+a,[i,u],[r,l]),n=n-o-a+(o?1:0)+(a?1:0)+1):0!==n&&e[n-1][0]==s?(e[n-1][1]+=e[n][1],e.splice(n,1)):n++,a=0,o=0,u="",l=""}""===e[e.length-1][1]&&e.pop();var c=!1;for(n=1;n<e.length-1;)e[n-1][0]==s&&e[n+1][0]==s&&(e[n][1].substring(e[n][1].length-e[n-1][1].length)==e[n-1][1]?(e[n][1]=e[n-1][1]+e[n][1].substring(0,e[n][1].length-e[n-1][1].length),e[n+1][1]=e[n-1][1]+e[n+1][1],e.splice(n-1,1),c=!0):e[n][1].substring(0,e[n+1][1].length)==e[n+1][1]&&(e[n-1][1]+=e[n+1][1],e[n][1]=e[n][1].substring(e[n+1][1].length)+e[n+1][1],e.splice(n+1,1),c=!0)),n++;c&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n,s=0,o=0,a=0,u=0;for(n=0;n<e.length&&(e[n][0]!==r&&(s+=e[n][1].length),e[n][0]!==i&&(o+=e[n][1].length),!(s>t));n++)a=s,u=o;return e.length!=n&&e[n][0]===i?u:u+(t-a)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,a=/>/g,u=/\n/g,l=0;l<e.length;l++){var c=e[l][0],d=e[l][1],p=d.replace(n,"&amp;").replace(o,"&lt;").replace(a,"&gt;").replace(u,"&para;<br>");switch(c){case r:t[l]='<ins style="background:#e6ffe6;">'+p+"</ins>";break;case i:t[l]='<del style="background:#ffe6e6;">'+p+"</del>";break;case s:t[l]="<span>"+p+"</span>"}}return t.join("")},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join("")},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join("")},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,a=0;a<e.length;a++){var u=e[a][0],l=e[a][1];switch(u){case r:n+=l.length;break;case i:o+=l.length;break;case s:t+=Math.max(n,o),n=0,o=0}}return t+=Math.max(n,o)},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case r:t[n]="+"+encodeURI(e[n][1]);break;case i:t[n]="-"+e[n][1].length;break;case s:t[n]="="+e[n][1].length}return t.join("\t").replace(/%20/g," ")},n.prototype.diff_fromDelta=function(e,t){for(var n=[],o=0,a=0,u=t.split(/\t/g),l=0;l<u.length;l++){var c=u[l].substring(1);switch(u[l].charAt(0)){case"+":try{n[o++]=[r,decodeURI(c)]}catch(e){throw new Error("Illegal escape in diff_fromDelta: "+c)}break;case"-":case"=":var d=parseInt(c,10);if(isNaN(d)||d<0)throw new Error("Invalid number in diff_fromDelta: "+c);var p=e.substring(a,a+=d);"="==u[l].charAt(0)?n[o++]=[s,p]:n[o++]=[i,p];break;default:if(u[l])throw new Error("Invalid diff operation in diff_fromDelta: "+u[l])}}if(a!=e.length)throw new Error("Delta length ("+a+") does not equal source text length ("+e.length+").");return n},n.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){function i(e,i){var r=e/t.length,o=Math.abs(n-i);return s.Match_Distance?r+o/s.Match_Distance:o?1:r}if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),s=this,o=this.Match_Threshold,a=e.indexOf(t,n);a!=-1&&(o=Math.min(i(0,a),o),a=e.lastIndexOf(t,n+t.length),a!=-1&&(o=Math.min(i(0,a),o)));var u=1<<t.length-1;a=-1;for(var l,c,d,p=t.length+e.length,h=0;h<t.length;h++){for(l=0,c=p;l<c;)i(h,n+c)<=o?l=c:p=c,c=Math.floor((p-l)/2+l);p=c;var f=Math.max(1,n-c+1),g=Math.min(n+c,e.length)+t.length,m=Array(g+2);m[g+1]=(1<<h)-1;for(var v=g;v>=f;v--){var y=r[e.charAt(v-1)];if(0===h?m[v]=(m[v+1]<<1|1)&y:m[v]=(m[v+1]<<1|1)&y|((d[v+1]|d[v])<<1|1)|d[v+1],m[v]&u){var b=i(h,v-1);if(b<=o){if(o=b,a=v-1,!(a>n))break;f=Math.max(1,2*n-a)}}}if(i(h+1,n)>o)break;d=m}return a},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(0!=t.length){for(var n=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(n)!=t.lastIndexOf(n)&&n.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,n=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var r=t.substring(e.start2-i,e.start2);r&&e.diffs.unshift([s,r]);var o=t.substring(e.start2+e.length1,e.start2+e.length1+i);o&&e.diffs.push([s,o]),e.start1-=r.length,e.start2-=r.length,e.length1+=r.length+o.length,e.length2+=r.length+o.length}},n.prototype.patch_make=function(e,t,o){var a,u;if("string"==typeof e&&"string"==typeof t&&"undefined"==typeof o)a=e,u=this.diff_main(a,t,!0),u.length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(e&&"object"==typeof e&&"undefined"==typeof t&&"undefined"==typeof o)u=e,a=this.diff_text1(u);else if("string"==typeof e&&t&&"object"==typeof t&&"undefined"==typeof o)a=e,u=t;else{if("string"!=typeof e||"string"!=typeof t||!o||"object"!=typeof o)throw new Error("Unknown call format to patch_make.");a=e,u=o}if(0===u.length)return[];for(var l=[],c=new n.patch_obj,d=0,p=0,h=0,f=a,g=a,m=0;m<u.length;m++){var v=u[m][0],y=u[m][1];switch(d||v===s||(c.start1=p,c.start2=h),v){case r:c.diffs[d++]=u[m],c.length2+=y.length,g=g.substring(0,h)+y+g.substring(h);break;case i:c.length1+=y.length,c.diffs[d++]=u[m],g=g.substring(0,h)+g.substring(h+y.length);break;case s:y.length<=2*this.Patch_Margin&&d&&u.length!=m+1?(c.diffs[d++]=u[m],c.length1+=y.length,c.length2+=y.length):y.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(c,f),l.push(c),c=new n.patch_obj,d=0,f=g,p=h)}v!==r&&(p+=y.length),v!==i&&(h+=y.length)}return d&&(this.patch_addContext_(c,f),l.push(c)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],i=0;i<e.length;i++){var r=e[i],s=new n.patch_obj;
s.diffs=[];for(var o=0;o<r.diffs.length;o++)s.diffs[o]=r.diffs[o].slice();s.start1=r.start1,s.start2=r.start2,s.length1=r.length1,s.length2=r.length2,t[i]=s}return t},n.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,a=[],u=0;u<e.length;u++){var l,c=e[u].start2+o,d=this.diff_text1(e[u].diffs),p=-1;if(d.length>this.Match_MaxBits?(l=this.match_main(t,d.substring(0,this.Match_MaxBits),c),l!=-1&&(p=this.match_main(t,d.substring(d.length-this.Match_MaxBits),c+d.length-this.Match_MaxBits),(p==-1||l>=p)&&(l=-1))):l=this.match_main(t,d,c),l==-1)a[u]=!1,o-=e[u].length2-e[u].length1;else{a[u]=!0,o=l-c;var h;if(h=p==-1?t.substring(l,l+d.length):t.substring(l,p+this.Match_MaxBits),d==h)t=t.substring(0,l)+this.diff_text2(e[u].diffs)+t.substring(l+d.length);else{var f=this.diff_main(d,h,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(f)/d.length>this.Patch_DeleteThreshold)a[u]=!1;else{this.diff_cleanupSemanticLossless(f);for(var g,m=0,v=0;v<e[u].diffs.length;v++){var y=e[u].diffs[v];y[0]!==s&&(g=this.diff_xIndex(f,m)),y[0]===r?t=t.substring(0,l+g)+y[1]+t.substring(l+g):y[0]===i&&(t=t.substring(0,l+g)+t.substring(l+this.diff_xIndex(f,m+y[1].length))),y[0]!==i&&(m+=y[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,a]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,n="",i=1;i<=t;i++)n+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var r=e[0],o=r.diffs;if(0==o.length||o[0][0]!=s)o.unshift([s,n]),r.start1-=t,r.start2-=t,r.length1+=t,r.length2+=t;else if(t>o[0][1].length){var a=t-o[0][1].length;o[0][1]=n.substring(o[0][1].length)+o[0][1],r.start1-=a,r.start2-=a,r.length1+=a,r.length2+=a}if(r=e[e.length-1],o=r.diffs,0==o.length||o[o.length-1][0]!=s)o.push([s,n]),r.length1+=t,r.length2+=t;else if(t>o[o.length-1][1].length){var a=t-o[o.length-1][1].length;o[o.length-1][1]+=n.substring(0,a),r.length1+=a,r.length2+=a}return n},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var a=e[o];e.splice(o--,1);for(var u=a.start1,l=a.start2,c="";0!==a.diffs.length;){var d=new n.patch_obj,p=!0;for(d.start1=u-c.length,d.start2=l-c.length,""!==c&&(d.length1=d.length2=c.length,d.diffs.push([s,c]));0!==a.diffs.length&&d.length1<t-this.Patch_Margin;){var h=a.diffs[0][0],f=a.diffs[0][1];h===r?(d.length2+=f.length,l+=f.length,d.diffs.push(a.diffs.shift()),p=!1):h===i&&1==d.diffs.length&&d.diffs[0][0]==s&&f.length>2*t?(d.length1+=f.length,u+=f.length,p=!1,d.diffs.push([h,f]),a.diffs.shift()):(f=f.substring(0,t-d.length1-this.Patch_Margin),d.length1+=f.length,u+=f.length,h===s?(d.length2+=f.length,l+=f.length):p=!1,d.diffs.push([h,f]),f==a.diffs[0][1]?a.diffs.shift():a.diffs[0][1]=a.diffs[0][1].substring(f.length))}c=this.diff_text2(d.diffs),c=c.substring(c.length-this.Patch_Margin);var g=this.diff_text1(a.diffs).substring(0,this.Patch_Margin);""!==g&&(d.length1+=g.length,d.length2+=g.length,0!==d.diffs.length&&d.diffs[d.diffs.length-1][0]===s?d.diffs[d.diffs.length-1][1]+=g:d.diffs.push([s,g])),p||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split("\n"),a=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;a<o.length;){var l=o[a].match(u);if(!l)throw new Error("Invalid patch string: "+o[a]);var c=new n.patch_obj;for(t.push(c),c.start1=parseInt(l[1],10),""===l[2]?(c.start1--,c.length1=1):"0"==l[2]?c.length1=0:(c.start1--,c.length1=parseInt(l[2],10)),c.start2=parseInt(l[3],10),""===l[4]?(c.start2--,c.length2=1):"0"==l[4]?c.length2=0:(c.start2--,c.length2=parseInt(l[4],10)),a++;a<o.length;){var d=o[a].charAt(0);try{var p=decodeURI(o[a].substring(1))}catch(e){throw new Error("Illegal escape in patch_fromText: "+p)}if("-"==d)c.diffs.push([i,p]);else if("+"==d)c.diffs.push([r,p]);else if(" "==d)c.diffs.push([s,p]);else{if("@"==d)break;if(""!==d)throw new Error('Invalid patch mode "'+d+'" in: '+p)}a++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){var e,t;e=0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1,t=0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2;for(var n,o=["@@ -"+e+" +"+t+" @@\n"],a=0;a<this.diffs.length;a++){switch(this.diffs[a][0]){case r:n="+";break;case i:n="-";break;case s:n=" "}o[a+1]=n+encodeURI(this.diffs[a][1])+"\n"}return o.join("").replace(/%20/g," ")},e.exports=n,e.exports.diff_match_patch=n,e.exports.DIFF_DELETE=i,e.exports.DIFF_INSERT=r,e.exports.DIFF_EQUAL=s},125:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(7),o=i(s),a=n(60),u=i(a),l=n(1),c=i(l),d=n(12),p=i(d),h=n(6),f=i(h),g=n(27),m=i(g),v=n(130),y="mod+z",b="mod+shift+z",C=c.default.createClass({displayName:"RawFontTextarea",propTypes:{autoFocus:c.default.PropTypes.bool,id:c.default.PropTypes.string,initialValue:c.default.PropTypes.string,isDisabled:c.default.PropTypes.bool,isRawMode:c.default.PropTypes.bool,onChange:c.default.PropTypes.func.isRequired,style:c.default.PropTypes.object},contextTypes:{currentLocaleCode:c.default.PropTypes.string,currentLocaleDir:c.default.PropTypes.string},getDefaultProps:function(){return{initialValue:""}},getInitialState:function(){return{done:[],undone:[]}},componentWillMount:function(){this.saveSnapshot=f.default.debounce(this.saveSnapshot,300,!0)},componentDidMount:function(){this.mousetrap=new u.default(this._textareaNode),this.mousetrap.bind(y,this.handleUndo),this.mousetrap.bind(b,this.handleRedo);var e=this.props.isRawMode,t="rtl"===this.context.currentLocaleDir&&!e;this.rawFont=new v.RawFontAware(this._textareaNode,{isRawMode:e,isRtlMode:t}),this.previousSnapshot=this.rawFont.setSnapshot({value:this.props.initialValue})},componentWillReceiveProps:function(e){if(this.props.isRawMode!==e.isRawMode){var t="rtl"===this.context.currentLocaleDir&&!e.isRawMode;this.rawFont.setMode({isRtlMode:t,isRawMode:e.isRawMode}),this.rawFont.update()}},shouldComponentUpdate:function(e,t){return this.isRawMode!==e.isRawMode||!f.default.isEqual(this.state.done,t.done)&&!f.default.isEqual(this.state.undone,t.undone)},componentDidUpdate:function(){this.rawFont.focus()},componentWillUnmount:function(){this.mousetrap.unbind(y),this.mousetrap.unbind(b),this.rawFont.destroy()},saveSnapshot:function(e){var t=this;this.setState(function(t){return{done:[].concat(r(t.done),[e]),undone:[]}},function(){t.previousSnapshot=t.rawFont.getSnapshot()})},handleChange:function(){this.saveSnapshot(this.previousSnapshot),this.props.onChange(this.rawFont.getValue())},handleUndo:function(e){var t=this;if(e.preventDefault(),0!==this.state.done.length){var n=this.state.done.slice(-1)[0];this.setState(function(e){return{done:e.done.slice(0,-1),undone:[].concat(r(e.undone),[t.rawFont.getSnapshot()])}},function(){t.previousSnapshot=t.rawFont.setSnapshot(n),t.props.onChange(t.rawFont.getValue())})}},handleRedo:function(e){var t=this;if(e.preventDefault(),0!==this.state.undone.length){var n=this.state.undone.slice(-1)[0];this.setState(function(e){return{done:[].concat(r(e.done),[t.rawFont.getSnapshot()]),undone:e.undone.slice(0,-1)}},function(){t.previousSnapshot=t.rawFont.setSnapshot(n),t.props.onChange(t.rawFont.getValue())})}},render:function(){var e=this,t=(0,o.default)({},{boxSizing:"border-box",margin:"0 0 0.5em 0",padding:"0.3em"},this.props.style);return c.default.createElement(m.default,{autoFocus:this.props.autoFocus,className:"translation focusthis js-translation-area",defaultValue:this.props.initialValue,dir:this.context.currentLocaleDir,disabled:this.props.isDisabled,id:this.props.id,lang:this.context.currentLocaleCode,onChange:this.handleChange,ref:function(t){null!==t&&(e._textareaNode=p.default.findDOMNode(t))},style:t,value:void 0})}});t.default=C},130:function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){var n=void 0;try{n=new Event(t,{bubbles:!0})}catch(e){n=document.createEvent("HTMLEvents"),n.initEvent("input",!0,!1)}e.dispatchEvent(n)}function s(e){return(0,c.sym2raw)(e.value)}function o(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.isRawMode,o=void 0!==i&&i,a=n.triggerChange,u=void 0!==a&&a;return e.value=(0,c.raw2sym)(t,{isRawMode:o}),u&&r(e,"input"),s(e)}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.isRawMode,s=void 0!==i&&i,o=n.triggerChange,a=void 0!==o&&o,u=e.selectionStart,l=e.selectionEnd,d=e.value,p=t||"",h=null!==t?u:l,f=d.substring(0,h),g=d.substring(l),m=(0,c.raw2sym)((0,c.sym2raw)(f+p),{isRawMode:s}),v=m.length-f.length-(l-h),y=(0,c.raw2sym)((0,c.sym2raw)(f+p+g),{isRawMode:s});d!==y&&(e.value=y,e.selectionEnd=l+v,u===l&&(e.selectionStart=l+v),(a||null!==t)&&r(e,"input"))}function u(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.isRawMode,r=void 0!==i&&i,o=n.triggerChange,u=void 0!==o&&o;return a(e,t,{isRawMode:r,triggerChange:u}),s(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.RawFontAware=t.insertAtCaret=t.setValue=void 0;var l=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),c=n(47),d=8,p=39,h=37,f=46,g=66,m=70;t.setValue=o,t.insertAtCaret=u;t.RawFontAware=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=r.isRawMode,o=void 0!==s&&s,a=r.isRtlMode,u=void 0!==a&&a;i(this,e),this.element=t,this.isRawMode=o,this.isRtlMode=u,t.addEventListener("input",function(e){return n.onInput(e)}),t.addEventListener("keydown",function(e){return n.onKeyDown(e)}),t.addEventListener("mousedown",function(e){return n.onMouseDown(e)}),t.addEventListener("mouseup",function(e){return n.onMouseUp(e)}),t.addEventListener("copy",function(e){return n.onCopyOrCut(e)}),t.addEventListener("cut",function(e){return n.onCopyOrCut(e)}),t.addEventListener("compositionstart",function(){return n.onCompositionStart()}),t.addEventListener("compositionend",function(){return n.onCompositionEnd()})}return l(e,[{key:"destroy",value:function(){var e=this.element;this.clearDeferTimer(),e.removeEventListener("input",this.onInput),e.removeEventListener("keydown",this.onKeyDown),e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("copy",this.onCopyOrCut),e.removeEventListener("cut",this.onCopyOrCut),e.removeEventListener("compositionstart",this.onCompositionStart),e.removeEventListener("compositionend",this.onCompositionEnd),this.element=null}},{key:"clearDeferTimer",value:function(){this.deferTimer&&(clearTimeout(this.deferTimer),this.deferTimer=void 0)}},{key:"defer",value:function(e){this.clearDeferTimer(),this.deferTimer=setTimeout(e,0)}},{key:"setMode",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.isRawMode,n=void 0!==t&&t,i=e.isRtlMode,r=void 0!==i&&i;this.isRawMode=n,this.isRtlMode=r}},{key:"focus",value:function(){this.element.focus()}},{key:"getValue",value:function(){return s(this.element)}},{key:"setValue",value:function(e){return o(this.element,e,{isRawMode:this.isRawMode})}},{key:"getSnapshot",value:function(){return{selectionStart:this.element.selectionStart,selectionEnd:this.element.selectionEnd,value:this.getValue()}}},{key:"setSnapshot",value:function(e){var t=this.element;return this.setValue(e.value),t.selectionStart=e.selectionStart||t.value.length,t.selectionEnd=e.selectionEnd||t.value.length,this.getSnapshot()}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a(this.element,e,{isRawMode:this.isRawMode})}},{key:"raw2sym",value:function(e){return(0,c.raw2sym)(e,{isRawMode:this.isRawMode})}},{key:"sym2raw",value:function(e){return(0,c.sym2raw)(e)}},{key:"onMouseDown",value:function(){var e=this;this.defer(function(){e.adjustSelection()})}},{key:"onMouseUp",value:function(){this.adjustSelection()}},{key:"onKeyDown",value:function(e){var t=this,n=e.target,i=void 0;i=this.isRtlMode?e.keyCode===h&&!e.metaKey||e.ctrlKey&&e.keyCode===g:e.keyCode===p&&!e.metaKey||e.ctrlKey&&e.keyCode===m,this.defer(function(){t.adjustSelection(i)});var r=n.selectionStart,s=n.selectionEnd,o=n.value;r>o.length&&(r=o.length),s>o.length&&(s=o.length);var a=o.substr(s-1,1),u=o.substr(s,1);if(r===s){if(e.keyCode===f&&u===c.SYMBOLS.LF)return void(n.selectionEnd=s+2);e.keyCode===d&&a===c.CHARACTERS.LF&&(n.selectionStart=r-2)}}},{key:"onCopyOrCut",value:function(e){e.preventDefault();var t=e.target,n=t.selectionStart,i=t.selectionEnd,r=this.sym2raw(t.value.substring(n,i));e.clipboardData?e.clipboardData.setData("text/plain",r):window.clipboardData.setData("Text",r),"cut"===e.type&&this.insertAtCaret("")}},{key:"onInput",value:function(){this.isComposing||this.update(),this.requestUpdate=!1}},{key:"onCompositionStart",value:function(){this.isComposing=!0}},{key:"onCompositionEnd",value:function(){var e=this;this.isComposing=!1,this.requestUpdate=!0,this.defer(function(){e.requestUpdate&&e.update()})}},{key:"adjustSelection",value:function(e){var t=this.element,n=t.selectionStart,i=t.selectionEnd,r=t.value,s=r.substr(i-1,1),o=r.substr(i,1),a=s===c.SYMBOLS.LF&&o===c.CHARACTERS.LF,u=r.substring(n,i);return u===c.CHARACTERS.LF&&r.substr(n-1,1)===c.SYMBOLS.LF?void(t.selectionStart=t.selectionStart-1):void(a&&(t.selectionEnd=e?i+1:i-1,n===i&&(t.selectionStart=t.selectionEnd)))}},{key:"insertAtCaret",value:function(e){return u(this.element,e)}}]),e}()},131:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=i(s),a=n(8),u=o.default.createClass({displayName:"TimeSince",propTypes:{dateTime:s.PropTypes.string.isRequired,relativeTime:s.PropTypes.string.isRequired,title:s.PropTypes.string.isRequired},mixins:[a.PureRenderMixin],render:function(){return o.default.createElement("time",r({className:"extra-item-meta",title:this.props.title,dateTime:this.props.dateTime},this.props),this.props.relativeTime)}});t.default=u},132:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),s=i(r),o={nodes:[],render:function(e,t){return this.nodes.push(t),s.default.render(e,t)},unmountComponents:function(){this.nodes.forEach(function(e){return s.default.unmountComponentAtNode(e)}),this.nodes=[]}};t.default=o},226:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.UnitSet=void 0;var r=n(15),s=i(r),o=n(245);t.UnitSet=s.default.Collection.extend({model:o.Unit,initialize:function(e,t){this.chunkSize=t.chunkSize,this.uIds=[],this.total=0,this.frozenTotal=0},comparator:function(e){return this.uIds.indexOf(e.id)},getByUnitId:function(e){return e>0?this.get(e):this.at(0)},getCurrent:function(){return this.activeUnit},setCurrent:function(e){return this.activeUnit=e instanceof this.model?e:this.getByUnitId(e),this.activeUnit},fetchedIds:function(){return this.map(function(e){return e.id})},next:function(){var e=this.indexOf(this.getCurrent());return e+1===this.length?null:this.at(e+1)},hasNext:function(){return null!==this.next()},prev:function(){var e=this.indexOf(this.getCurrent());return 0===e?null:this.at(e-1)},hasPrev:function(){return null!==this.prev()}})},230:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){var t=(0,u.default)(".js-unit-checks"),n=(0,u.default)(".focusthis")[0];t.html(e).show(),W.default.blinkClass(t,"blink",4,200),n.focus()}var o=function(){function e(e,t){var n=[],i=!0,r=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(i=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,s=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=n(3),u=i(a),l=n(6),c=i(l),d=n(1),p=i(d),h=n(131),f=i(h),g=n(132),m=i(g);n(376),n(377),n(378),n(379),n(53),n(79);var v=n(18),y=i(v),b=n(381),C=i(b),w=n(60),_=i(w),x=n(7),T=i(x),S=n(249),O=i(S),E=n(28),A=i(E),P=n(10),k=n(29),M=i(k),D=n(258),F=i(D),R=n(237),I=i(R),j=n(83),L=i(j),N=n(226),$=n(67),B=i($),z=n(55),q=i(z),U=n(87),V=i(U),H=n(21),W=i(H),K=n(48),Q=n(242),G=i(Q);PTL.reactEditor=G.default;var Y=1,Z=["oldest","newest","default"],J=function(e,t){var n=void 0,i=void 0;return function(){for(var r=arguments.length,s=Array(r),o=0;o<r;o++)s[o]=arguments[o];var a=this,u=function(){n=null,i||e.apply(a,s)},l=!n;clearTimeout(n),n=setTimeout(u,t),l?(i=!0,e.apply(a,s)):i=!1}},X={dropdownAutoWidth:!0,width:"off"},ee=(0,T.default)({minimumResultsForSearch:-1},X),te=[];window.PTL=window.PTL||{},PTL.editor={init:function(e){var t=this;this.settings={mt:[],displayPriority:!1},e&&(0,T.default)(this.settings,e),this.formats={},this.setActiveUnit=J(function(e,n){t.fetchUnits().always(function(){O.default.fetchUnit(n.id,e).then(function(e){t.setEditUnit(e),t.renderUnit()},t.error)})},250),this.backToBrowserEl=(0,P.q)(".js-back-to-browser"),this.$editorActivity=(0,u.default)("#js-editor-act"),this.$editorBody=(0,u.default)(".js-editor-body"),this.editorTableEl=(0,P.q)(".js-editor-table"),this.$filterStatus=(0,u.default)("#js-filter-status"),this.$filterChecks=(0,u.default)("#js-filter-checks"),this.$filterChecksWrapper=(0,u.default)(".js-filter-checks-wrapper"),this.$filterSortBy=(0,u.default)("#js-filter-sort"),this.$msgOverlay=(0,u.default)("#js-editor-msg-overlay"),this.$navNext=(0,u.default)("#js-nav-next"),this.$navPrev=(0,u.default)("#js-nav-prev"),this.unitCountEl=(0,P.q)(".js-unit-count"),this.unitIndexEl=(0,P.q)(".js-unit-index"),this.offsetRequested=0,this.units=new N.UnitSet([],{chunkSize:this.settings.chunkSize}),this.editorRow=null,this.filter="all",this.checks=[],this.sortBy="default",this.modifiedSince=null,this.user=null,this.ctxGap=0,this.ctxQty=parseInt((0,A.default)("ctxQty"),10)||1,this.preventNavigation=!1,this.isUnitDirty=!1,this.isLoading=!0,this.showActivity(),this.fetchingOffsets=[],this.wordComparer=new C.default({compare:"words"}),this.tmpl={tm:c.default.template((0,u.default)("#tm_suggestions").html()),editCtx:c.default.template((0,u.default)("#editCtx").html()),msg:c.default.template((0,u.default)("#js-editor-msg").html())},V.default.init({onSearch:this.onSearch}),e.displayPriority&&Z.push("priority"),this.$filterStatus.select2(X),this.$filterSortBy.select2(ee),(0,u.default)(".select2-selection__rendered").removeAttr("title"),(0,u.default)("#editor").on("click",".js-dev-img",function(e){e.preventDefault(),(0,u.default)(this).magnificPopup({type:"image",gallery:{enabled:!0}}).magnificPopup("open")}),(0,u.default)("#toolbar").on("keypress",".js-unit-index",function(e){return t.gotoIndex(e)}),(0,u.default)("#toolbar").on("dblclick click",".js-unit-index",function(e){return t.unitIndex(e)}),(0,u.default)("#toolbar").on("click","#js-nav-prev",function(){return t.gotoPrev()}),(0,u.default)("#toolbar").on("click","#js-nav-next",function(){return t.gotoNext()}),(0,u.default)("#toolbar").on("change","#js-filter-sort",function(){return t.filterSort()}),(0,u.default)("#actions").on("change","#js-filter-status",function(){return t.filterStatus()}),(0,u.default)("#actions").on("change","#js-filter-checks",function(){return t.filterChecks()}),(0,u.default)("#editor").on("change","input.fuzzycheck",function(){return t.onStateChange()}),(0,u.default)("#editor").on("click","input.fuzzycheck",function(){return t.onStateClick()}),(0,u.default)("#editor").on("input","#id_translator_comment",function(){return t.handleTranslationChange()}),(0,u.default)("#editor").on("click",".switch-suggest-mode a",function(e){return t.toggleSuggestMode(e)}),(0,u.default)("#editor").on("focus",".focusthis",function(e){PTL.editor.focused=e.target}),(0,u.default)("#editor").on("focus",".js-translation-area",function(e){(0,u.default)(e.target).closest(".js-editor-area-wrapper").addClass("is-focused")}),(0,u.default)("#editor").on("blur",".js-translation-area",function(e){(0,u.default)(e.target).closest(".js-editor-area-wrapper").removeClass("is-focused")}),(0,u.default)("#editor").on("click",".js-editor-reload",function(e){e.preventDefault(),u.default.history.load("")}),(0,u.default)("#editor").on("keydown",".js-auto-matched-translation",function(e){17!==e.keyCode&&((0,u.default)(".js-auto-matched-translation").toggleClass("js-auto-matched-translation",!1),(0,u.default)(".js-auto-match-msg").slideUp(200,"easeOutQuad"))}),(0,u.default)("#editor").on("click",".js-editor-copytext",function(e){return t.copyText(e)}),(0,u.default)("#editor").on("click",".js-editor-copy-tm-text",function(e){return t.copyTMText(e)}),(0,u.default)("#editor").on("click",".js-editor-copy-comment",function(e){var n=e.currentTarget.dataset.string;t.copyComment(n)}),(0,u.default)("#editor").on("click",".js-copyoriginal",function(e){t.copyOriginal(e.currentTarget.dataset.languageCode)}),(0,u.default)("#editor").on("mouseup","tr.view-row, tr.ctx-row",this.gotoUnit),(0,u.default)("#editor").on("click","input.submit",function(e){e.preventDefault(),t.handleSubmit()}),(0,u.default)("#editor").on("click","input.suggest",function(e){e.preventDefault(),t.handleSuggest()}),(0,u.default)("#editor").on("click",".js-suggestion-reject",function(e){e.stopPropagation(),t.rejectSuggestion(e.currentTarget.dataset.suggId)}),(0,u.default)("#editor").on("click",".js-suggestion-accept",function(e){e.stopPropagation(),t.acceptSuggestion(e.currentTarget.dataset.suggId)}),(0,u.default)("#editor").on("click",".js-suggestion-toggle",function(e){return t.toggleSuggestion(e,{canHide:!0})}),this.settings.canReview&&(0,u.default)("#editor").on("click",".js-user-suggestion",function(e){return t.toggleSuggestion(e,{canHide:!1})}),(0,u.default)("#editor").on("click",".js-translate-lightbox",function(){return t.closeSuggestion()}),(0,u.default)("#editor").on("click","#js-toggle-timeline",function(e){return t.toggleTimeline(e)}),(0,u.default)("#editor").on("click",".js-toggle-check",function(e){t.toggleCheck(e.currentTarget.dataset.checkId)}),(0,u.default)("#editor").on("click",".js-more-ctx",function(){return t.moreContext()}),(0,u.default)("#editor").on("click",".js-less-ctx",function(){return t.lessContext()}),(0,u.default)("#editor").on("click",".js-show-ctx",function(){return t.showContext()}),(0,u.default)("#editor").on("click",".js-hide-ctx",function(){return t.hideContext()}),(0,u.default)("#editor").on("click",".js-editor-comment",function(e){e.preventDefault();var t=(0,u.default)(".js-editor-comment-form"),n=(0,u.default)(".js-editor-comment");n.toggleClass("selected"),n.hasClass("selected")?(t.css("display","inline-block"),(0,u.default)("#id_translator_comment").focus()):t.css("display","none")}),(0,u.default)("#editor").on("submit","#js-comment-form",function(e){return t.addComment(e)}),(0,u.default)("#editor").on("click",".js-comment-remove",function(e){return t.removeComment(e)}),(0,u.default)(document).on("click",".js-editor-msg-hide",function(){return t.hideMsg()}),(0,u.default)("#editor").on("click",".js-toggle-raw",function(e){e.preventDefault(),(0,u.default)(".js-translate-translation").toggleClass("raw");var t=document.querySelector(".js-toggle-raw");t.classList.toggle("selected"),G.default.setProps({isRawMode:t.classList.contains("selected")})}),window.addEventListener("beforeunload",function(e){(PTL.editor.isUnitDirty||PTL.editor.isSuggestionFeedbackFormDirty)&&(e.returnValue=gettext("You have unsaved changes in this string. Navigating away will discard those changes."))});var i=(0,_.default)(document.body);i.bind("esc",function(e){e.preventDefault(),void 0!==t.selectedSuggestionId&&t.closeSuggestion()}),i.bind("ctrl+return",function(e){e.preventDefault(),t.isSuggestMode()?t.handleSuggest():t.handleSubmit()}),i.bind("ctrl+space",function(e){e.preventDefault(),t.toggleState()}),i.bind("ctrl+shift+space",function(e){e.preventDefault(),t.toggleSuggestMode(e)}),i.bind(["ctrl+up","ctrl+,"],function(e){e.preventDefault(),t.gotoPrev()}),i.bind(["ctrl+down","ctrl+."],function(e){e.preventDefault(),t.gotoNext({isSubmission:!1})}),navigator.platform.toUpperCase().indexOf("MAC")>=0&&(this.$navNext.attr("title",gettext("Go to the next string (Ctrl+.)<br/><br/>Also:<br/>Next page: Ctrl+Shift+.<br/>Last page: Ctrl+Shift+End")),this.$navPrev.attr("title",gettext("Go to the previous string (Ctrl+,)<br/><br/>Also:<br/>Previous page: Ctrl+Shift+,<br/>First page: Ctrl+Shift+Home"))),i.bind("ctrl+shift+n",function(e){e.preventDefault(),t.unitIndex(e)}),(0,u.default)(document).ajaxStart(function(){clearTimeout(t.delayedActivityTimer),t.isLoading||(t.delayedActivityTimer=setTimeout(function(){t.showActivity()},3e3))}),(0,u.default)(document).ajaxStop(function(){clearTimeout(t.delayedActivityTimer),t.isLoading||t.hideActivity()}),this.settings.mt.forEach(function(e){n.e(1,function(){var t=e.name.split("_").map(function(e){return e[0]+e.slice(1).toLowerCase()}).join(""),i=n(180)("./"+t).default;te.push(new i(e.key))})}),u.default.history.init(function(e){var n=W.default.getParsedHash(e),i=!0,r=0,s=0;if(void 0!==t.selectedSuggestionId&&t.closeSuggestion({checkIfCanNavigate:!1}),n.unit){var o=parseInt(n.unit,10);if(o&&!isNaN(o)){var a=t.units.getCurrent(),l=t.units.get(o);if(l&&l!==a)return void t.setUnit(l);r=o,i=!t.units.length}}if(n.offset){var c=parseInt(n.offset,10);c&&!isNaN(c)&&(s=t.getStartOfChunk(c))}if(t.filter="all",t.checks=[],t.category=[],t.sortBy="default","filter"in n){var d=n.filter;if(t.filter=d,"checks"===d&&"checks"in n&&(t.checks=n.checks.split(",")),"checks"===d&&"category"in n&&(t.category=n.category),"sort"in n){var p=n.sort;t.sortBy=Z.indexOf(p)!==-1?p:"default"}}if("modified-since"in n?t.modifiedSince=n["modified-since"]:t.modifiedSince=null,"month"in n?t.month=n.month:t.month=null,"user"in n&&0===t.filter.indexOf("user-")){t.user=encodeURIComponent(n.user);var h=t.user,f={"user-suggestions":interpolate(gettext("%s's pending suggestions"),[h]),"user-suggestions-accepted":interpolate(gettext("%s's accepted suggestions"),[h]),"user-suggestions-rejected":interpolate(gettext("%s's rejected suggestions"),[h]),"user-submissions":interpolate(gettext("%s's submissions"),[h]),"user-submissions-overwritten":interpolate(gettext("%s's overwritten submissions"),[h])},g=[];for(var m in f)f.hasOwnProperty(m)&&g.push('\n            <option value="'+m+'" data-user="'+h+'" class="js-user-filter">\n              '+f[m]+"\n            </option>\n          ");(0,u.default)(".js-user-filter").remove(),t.$filterStatus.append(g.join(""))}if("search"in n){t.filter="search";var v={searchText:n.search};"sfields"in n&&(v.searchFields=n.sfields.split(",")),"soptions"in n&&(v.searchOptions=n.soptions.split(",")),V.default.setState(v)}t.preventNavigation=!0;var y="search"===t.filter?"all":t.filter;t.$filterStatus.val(y).trigger("change.select2"),"checks"===t.filter&&t.$filterChecks.is(":hidden")&&t.getCheckOptions(),t.$filterSortBy.val(t.sortBy).trigger("change.select2"),"search"===t.filter&&t.$filterChecksWrapper.hide(),(0,u.default)(".select2-selection__rendered").removeAttr("title"),t.preventNavigation=!1,t.fetchUnits({uId:r,initialOffset:s,initial:i}).then(function(e){e&&(t.units.uIds.indexOf(r)===-1&&(r=t.offsetRequested>t.initialOffset&&t.offsetRequested<=t.getOffsetOfLastUnit()?t.units.uIds[t.offsetRequested-t.initialOffset-1]:t.units.uIds[0]),t.offsetRequested=0,t.setUnit(r))})},{unescape:!0})},ready:function(){var e=this.units.getCurrent();e.get("isObsolete")&&this.displayObsoleteMsg(),(0,u.default)(".extra-item-comment").filter(":not([dir])").bidi();var t=(0,u.default)(".js-developer-comments");if(t.html((0,F.default)(t.html())),"search"===this.filter&&this.hlSearch(),""!==this.settings.tmUrl&&this.getTMUnits(),null!==this.tmData){var n=this.getTMUnitsContent(this.tmData);(0,u.default)("#extras-container").append(n)}this.runHooks(),this.isUnitDirty=!1,this.keepState=!1,this.isLoading=!1,this.hideActivity()},noResults:function(){this.displayMsg({body:gettext("No results.")}),this.reDraw()},canNavigate:function(){return!this.isUnitDirty&&!this.isSuggestionFeedbackFormDirty||window.confirm(gettext("You have unsaved changes in this string. Navigating away will discard those changes."))},hlSearch:function(){var e=V.default.state,t=e.searchText,n=e.searchFields,i=e.searchOptions,r={notes:"div.developer-comments",locations:"div.translate-locations",source:"td.translate-original, .original .js-translation-text",target:"td.translate-translation"},s=n.map(function(e){return["tr.edit-row "+r[e],"tr.view-row "+r[e]]}).reduce(function(e,t){return e.concat(t)},[]),o=void 0;o=i.indexOf("phrase")>=0?i.indexOf("case")>=0?new RegExp("("+(0,K.escapeUnsafeRegexSymbols)(t)+")","i"):new RegExp("("+(0,K.escapeUnsafeRegexSymbols)(t)+")"):i.indexOf("case")>=0?new RegExp((0,K.makeRegexForMultipleWords)(t),"i"):new RegExp((0,K.makeRegexForMultipleWords)(t)),(0,u.default)(s.join(", ")).highlightRegex(o)},copyText:function(e){var t=(0,u.default)(e.currentTarget),n=t.data("action"),i=t.data("codepoint")&&JSON.parse('"'+t.data("codepoint")+'"')||t.data("string")||t.data("translation-aid")||t.text();"overwrite"===n?G.default.setValueFor(this.focused||0,i):G.default.insertAtCaretFor(this.focused||0,i)},copyTMText:function(e){""===window.getSelection().toString()&&this.copyText(e)},copyOriginal:function(e){var t=this.units.getCurrent().get("sources")[e];G.default.setValues(t),this.goFuzzy()},copyComment:function(e){var t=(0,P.q)(".js-editor-comment"),n=(0,P.q)(".js-editor-comment-form"),i=(0,P.q)("#id_translator_comment");t.classList.contains("selected")||(n.style.display="inline-block",t.classList.add("selected")),i.focus(),i.value=e},doFuzzyStyle:function(){(0,u.default)("tr.edit-row").addClass("fuzzy-unit")},undoFuzzyStyle:function(){(0,u.default)("tr.edit-row").removeClass("fuzzy-unit")},doFuzzyBox:function(){var e=(0,u.default)("input.fuzzycheck");e.prop("checked",!0),this.settings.isAdmin||(this.isSuggestMode()||(0,u.default)(".js-fuzzy-block").show(),e[0].defaultChecked=!0),e.trigger("change")},undoFuzzyBox:function(){var e=(0,u.default)("input.fuzzycheck");e.prop("checked",!1),e.trigger("change")},goFuzzy:function(){this.isFuzzy()||(this.doFuzzyStyle(),this.doFuzzyBox())},ungoFuzzy:function(){this.isFuzzy()&&(this.undoFuzzyStyle(),this.undoFuzzyBox())},isFuzzy:function(){return(0,u.default)("input.fuzzycheck").prop("checked")},toggleFuzzyStyle:function(){this.isFuzzy()?this.doFuzzyStyle():this.undoFuzzyStyle()},toggleState:function(){(0,u.default)("input.fuzzycheck:visible").blur().click()},updateUnitDefaultProperties:function(){G.default.setProps({initialValues:G.default.stateValues.slice()});var e=(0,P.q)("#id_is_fuzzy");e.defaultChecked=e.checked,this.handleTranslationChange()},updateCommentDefaultProperties:function(){var e=(0,P.q)("#id_translator_comment");e.defaultValue=e.value,this.handleTranslationChange()},handleTranslationChange:function(){var e=(0,P.q)("#id_translator_comment"),t=null!==e&&e.value!==e.defaultValue,n=(0,
P.q)(".js-submit"),i=(0,P.q)(".js-suggest"),r=(0,u.default)(".js-user-suggestion").map(function(){return(0,u.default)(this).data("translation-aid")}).get(),s=(0,P.q)("#id_is_fuzzy"),o=s.defaultChecked!==s.checked,a=!1,l=!1;this.settings.isAdmin||(a=s.checked===!0);var c=this.isTextareaValueDirty(),d=G.default.stateValues;if(r.length)for(var p=0;p<d.length&&!l;p++)l=r.indexOf(d[p])!==-1;this.isUnitDirty=c||o||t,null!==n&&(n.disabled=!(o||c)||a),null!==i&&(i.disabled=!c||l)},onStateChange:function(){this.handleTranslationChange(),this.toggleFuzzyStyle()},onStateClick:function(){this.keepState=!0},onTextareaChange:function(){var e=this;this.handleTranslationChange(),this.isTextareaValueDirty()&&!this.keepState&&this.ungoFuzzy(),clearTimeout(this.similarityTimer),this.similarityTimer=setTimeout(function(){e.checkSimilarTranslations(),e.similarityTimer=null},200)},isTextareaValueDirty:function(){return!c.default.isEqual(G.default.props.initialValues,G.default.stateValues)},calculateSimilarity:function(e,t,n){for(var i=0,r=null,s=0;s<t.length;s++){var o=t.eq(s),a=o.data(n),u=this.wordComparer.similarity(e,a);u>i&&(i=u,r=o.hasClass("js-translation-area")?null:o.val("id"))}return{boxId:r,max:i}},checkSimilarTranslations:function(){var e="translation-aid",t="translation-aid-mt",n=(0,u.default)("[data-"+t+"]"),i="[data-"+e+"]";this.settings.isAnonymous||(i+="[data-suggestor-id!="+this.settings.userId+"]");var r=(0,u.default)(i);if(!r.length&&!n.length)return!1;var s=G.default.stateValues[0],o={max:0,boxId:null},a={max:0,boxId:null};r.length&&(o=this.calculateSimilarity(s,r,e)),n.length&&(a=this.calculateSimilarity(s,n,t));var l=o.max>a.max?o:a;return this.highlightBox(l.boxId,1===l.max),!0},highlightBox:function(e,t){var n,i="best-match",s="case-match";return(0,u.default)(".translate-table").find("."+i).removeClass(i+" "+s),null!==e&&((0,u.default)(e).addClass((0,y.default)((n={},r(n,i,!0),r(n,s,t),n))),!0)},doSuggestMode:function(){this.editorTableEl.classList.add("suggest-mode")},undoSuggestMode:function(){this.editorTableEl.classList.remove("suggest-mode")},isSuggestMode:function(){return this.editorTableEl.classList.contains("suggest-mode")},toggleSuggestMode:function(e){e.preventDefault(),this.isSuggestMode()?this.undoSuggestMode():this.doSuggestMode()},showActivity:function(){this.hideMsg(),this.$editorActivity.spin().fadeIn(300)},hideActivity:function(){this.$editorActivity.spin(!1).fadeOut(300)},displayMsg:function(e){var t=e.showClose,n=void 0===t||t,i=e.body,r=void 0===i?null:i;this.hideActivity(),B.default.fixSidebarHeight(),this.$msgOverlay.html(this.tmpl.msg({showClose:n,body:r})).fadeIn(300)},hideMsg:function(){this.$msgOverlay.length&&this.$msgOverlay.fadeOut(300)},displayError:function(e){this.hideActivity(),q.default.show({text:e,level:"error"})},error:function(e,t){var n="";if("abort"!==t){if(0===e.status)n=gettext("Error while connecting to the server");else{if(402===e.status)return void L.default.onError(e,"PTL.editor.error");n=404===e.status?gettext("Not found"):500===e.status?gettext("Server error"):"timeout"===t?gettext("The server seems down. Try again later."):u.default.parseJSON(e.responseText).msg}PTL.editor.displayError(n)}},displayObsoleteMsg:function(){var e=gettext("This string no longer exists."),t=gettext("Go back to browsing"),n=this.backToBrowserEl.getAttribute("href"),i=gettext("Reload page"),r=["<div>",e,"</div>",'<div class="editor-msg-btns">','<a class="btn btn-xs js-editor-reload" href="#">',i,"</a>",'<a class="btn btn-xs" href="',n,'">',t,"</a>","</div>"].join("");this.displayMsg({body:r,showClose:!1})},getOffsetOfUid:function(e){return this.initialOffset+this.units.uIds.indexOf(e)},getStartOfChunk:function(e){return e-e%(2*this.units.chunkSize)},needsNextUnitBatch:function(){var e=2*Math.round(2/3*this.units.chunkSize);return this.units.uIds.slice(-e).indexOf(this.units.activeUnit.id)!==-1&&this.getOffsetOfLastUnit()<this.units.frozenTotal},needsPreviousUnitBatch:function(){return this.units.uIds.slice(0,7).indexOf(this.units.activeUnit.id)!==-1&&this.initialOffset>0},getPreviousUids:function(){return this.units.uIds.slice(-(2*this.units.chunkSize))},setOffset:function(e){var t=this.getOffsetOfUid(e);t!==-1&&u.default.history.load(W.default.updateHashPart("offset",this.getStartOfChunk(t)))},getOffsetOfLastUnit:function(){return this.initialOffset+this.units.uIds.length},markAsFetching:function(e){this.fetchingOffsets.push(e)},markAsFetched:function(e){this.fetchingOffsets.indexOf(e)!==-1&&this.fetchingOffsets.splice(this.fetchingOffsets.indexOf(e),1)},isBeingFetched:function(e){return this.fetchingOffsets.indexOf(e)!==-1},getReqData:function(){var e={};if("checks"===this.filter&&this.checks.length&&(e.checks=this.checks.join(",")),"checks"===this.filter&&this.category.length&&(e.category=this.category),"search"===this.filter){var t=V.default.state,n=t.searchText,i=t.searchFields,r=t.searchOptions;e.search=n,e.sfields=i,e.soptions=r}else e.filter=this.filter,"default"!==this.sortBy&&(e.sort=this.sortBy);return null!==this.modifiedSince&&(e["modified-since"]=this.modifiedSince),null!==this.month&&(e.month=this.month),this.user&&(e.user=this.user),e},getValueStateData:function(e){for(var t={},n=0;n<e.length;n++)t[(0,K.getAreaId)(n)]=e[n];return t},getCheckedStateData:function(){var e=document.querySelector("#id_is_fuzzy");return r({},e.name,e.checked?1:0)},renderRow:function(e){var t=this.viewUnits[e];return'\n      <tr\n        id="row'+e+'"\n        class="view-row"\n        data-id="'+e+'"\n        data-target="'+t.url+'"\n      ><td></td><td></td></tr>\n    '},renderEditorRow:function(e){var t=(0,y.default)("edit-row",{"fuzzy-unit":e.get("isfuzzy"),"with-ctx":"all"!==this.filter}),n=this.renderCtxControls({hasData:!1}),i=o(n,2),r=i[0],s=i[1];return"\n      "+("all"!==this.filter?r:"")+'\n      <tr id="row'+e.id+'" class="'+t+'">\n        '+this.editorRow+"\n      </tr>\n      "+("all"!==this.filter?s:"")+"\n    "},renderRows:function(){var e=this,t=this.getUnitGroups(),n=this.units.getCurrent(),i=[];return this.viewUnits={},this.viewCtxUnits={},t.forEach(function(r){1!==t.length&&i.push('<tr class="delimiter-row"><td colspan="2">'+('<div class="hd"><h2>'+c.default.escape(r.path)+"</h2></div>")+"</td></tr>");for(var s=0;s<r.units.length;s++){var o=r.units[s];o.id===n.id?i.push(e.renderEditorRow(o)):(e.viewUnits[o.id]=o.toJSON(),i.push(e.renderRow(o.id)))}}),i.join("")},renderCtxRows:function(e,t){for(var n=this.units.getCurrent(),i="",r=0;r<e.length;r++){var s=(0,T.default)({},n.toJSON(),e[r]);this.viewCtxUnits[s.id]=s,i+='\n        <tr\n          id="ctx'+s.id+'"\n          data-id="'+s.id+'"\n          data-target="'+s.url+'"\n          class="ctx-row '+t+'"\n        ><td></td><td></td></tr>\n      '}return i},getUnitGroups:function(){var e=this.units.length,t=this.units.getCurrent(),n=this.units.indexOf(t),i=1,r=n-i,s=n+this.units.chunkSize-1,o=null;return r<0?(s-=r,r=0):s>e&&(s=e),this.units.slice(r,s).reduce(function(e,t){var n=t.get("pootlePath");return n===o?e[e.length-1].units.push(t):e.push({path:n,units:[t]}),o=n,e},[])},renderUnit:function(){this.units.length&&(this.hideMsg(),this.reDraw(this.renderRows()))},reDraw:function(e){this.$editorBody.find("tr").remove(),void 0!==e&&(this.$editorBody.html(e),this.renderViewRowValues(".view-row",this.viewUnits),this.ready())},renderViewRowValues:function(e,t){for(var n=document.querySelectorAll(e),i=0;i<n.length;i++){var r=t[n[i].dataset.id],s={dir:r.store.source_dir,language:r.store.source_lang,values:r.source,type:"original",fileType:r.store.filetype,hasPlurals:r.source.length>1},o={isFuzzy:r.isfuzzy,dir:r.store.target_dir,language:r.store.target_lang,values:r.target,fileType:r.store.filetype,type:"translation",hasPlurals:r.target.length>1};G.default.renderViewUnitComponent(s,n[i].cells[0]),G.default.renderViewUnitComponent(o,n[i].cells[1])}},updateNavButton:function(e,t){e.is(":disabled")&&t||e.is(":enabled")&&!t||(t?(e.data("title",e.attr("title")),e.removeAttr("title")):e.attr("title",e.data("title")),e.prop("disabled",t))},updateNavigation:function(){this.updateNavButton(this.$navPrev,0===this.initialOffset&&!this.units.hasPrev()),this.updateNavButton(this.$navNext,!this.units.hasNext()),this.unitCountEl.textContent=this.units.frozenTotal;var e=this.units.getCurrent();void 0!==e&&0===this.offsetRequested&&(this.unitIndexEl.textContent=this.units.uIds.indexOf(e.id)+1+this.initialOffset)},fetchUnits:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.initial,i=void 0!==n&&n,r=t.uId,s=void 0===r?0:r,o=t.initialOffset,a=void 0===o?0:o,l=-1,c=-1,d=[];if(i?(this.initialOffset=-1,this.offset=0,s>0&&(c=s),a>0&&(l=a,this.initialOffset=a)):this.units.length&&this.units.total&&(this.needsNextUnitBatch()?(d=this.getPreviousUids(),l=this.offset):this.needsPreviousUnitBatch()&&(l=Math.max(this.initialOffset-2*this.units.chunkSize,0))),i||c>-1||l>-1&&!this.isBeingFetched(l)){var p={path:this.settings.pootlePath};return(0,T.default)(p,this.getReqData()),l>-1&&(this.markAsFetching(l),l>0&&(p.offset=l)),c>-1&&(p.uids=c),d.length>0&&(p.previous_uids=d),O.default.fetchUnits(p).then(function(t){return e.storeUnitData(t,{isInitial:i})},this.error).always(function(){return e.markAsFetched(l)})}return u.default.Deferred(function(e){return e.reject(!1)})},storeUnitData:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.isInitial,r=void 0!==i&&i,s=e.total,o=e.start,a=e.end,u=e.unitGroups,l=!1;if(!u.length&&r)return this.noResults(),!1;0===this.offset&&(this.units.reset(),this.units.uIds=[],this.units.frozenTotal=s),this.initialOffset===-1?(this.initialOffset=o,this.units.frozenTotal=s):o<this.initialOffset&&(this.initialOffset=o,l=!0,u=u.reverse());for(var c=0;c<u.length;c++){var d=u[c],p=function(e){if(!d.hasOwnProperty(e))return"continue";var n=d[e],i=(0,T.default)({pootlePath:e},n.meta),r=n.units.map(function(e){return(0,T.default)(e,{store:i})});l?(t.units.set(r,{remove:!1,at:0}),r.reverse().map(function(e){return t.units.uIds.unshift(e.id)})):(t.units.set(r,{remove:!1,at:t.units.length}),r.map(function(e){return t.units.uIds.push(e.id)}))};for(var h in d){p(h)}}return this.offset=a,this.units.total=s,this.updateNavigation(),!0},setEditUnit:function(e){var t=this.units.getCurrent();t.set("isObsolete",e.is_obsolete),t.set("sources",e.sources),this.tmData=e.tm_suggestions||null,this.editorRow=e.editor},setUnit:function(e){var t=this.units.setCurrent(e),n={};this.settings.vFolder&&(n.vfolder=this.settings.vFolder),this.updateNavigation(),this.setActiveUnit(n,t)},handleSubmit:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.translations,i=void 0===n?null:n,r=t.comment,s=void 0===r?"":r,o=(0,P.q)("input.submit"),a=null!==i?i:G.default.stateValues,l=this.getValueStateData(a),d=l[0],p=(0,u.default)(".js-user-suggestion").map(function(){return{text:this.dataset.translationAid,id:this.dataset.suggId}}).get(),h={sfn:"PTL.editor.processSubmission",efn:"PTL.editor.error"};this.updateUnitDefaultProperties();var f=c.default.pluck(p,"id"),g=c.default.pluck(p,"text"),m=g.indexOf(d);if(m!==-1&&!this.isFuzzy()){if(this.settings.canReview)return void this.acceptSuggestion(f[m],{skipToNext:!0});this.selectedSuggestionId=f[m]}null!==this.similarityTimer&&(clearTimeout(this.similarityTimer),this.checkSimilarTranslations());var v=(0,T.default)({},this.getCheckedStateData(),l,this.getReqData(),h);if(o.disabled=!0,void 0!==this.selectedSuggestionId){var y={suggestion:this.selectedSuggestionId,comment:s};(0,T.default)(v,y)}O.default.addTranslation(this.units.getCurrent().id,v).then(function(t){return e.processSubmission(t)},this.error)},processSubmission:function(e){if(void 0!==this.selectedSuggestionId)return void this.processAcceptSuggestion(e,this.selectedSuggestionId);var t=this.units.getCurrent(),n=e.critical_checks_active;t.setTranslation(e.newtargets),t.set("isfuzzy",this.isFuzzy()),(0,u.default)(".translate-container").toggleClass("error",n),n?s(e.checks):this.gotoNext()},handleSuggest:function(){var e=this,t={sfn:"PTL.editor.processSuggestion",efn:"PTL.editor.error"};this.updateUnitDefaultProperties();var n=(0,T.default)({},this.getValueStateData(G.default.stateValues),this.getReqData(),t);O.default.addSuggestion(this.units.getCurrent().id,n).then(function(t){return e.processSuggestion(t)},this.error)},processSuggestion:function(){PTL.editor.gotoNext()},gotoPrev:function(){if(!this.canNavigate())return!1;var e=this.units.prev();if(e){var t=W.default.updateHashPart("unit",e.id);u.default.history.load(t),this.setOffset(e.id)}return!0},gotoNext:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isSubmission:!0};if(!this.canNavigate())return!1;var t=this.units.next();if(t){var n=W.default.updateHashPart("unit",t.id);u.default.history.load(n),this.setOffset(t.id)}else e.isSubmission&&((0,A.default)("finished","1",{path:"/"}),window.location.href=this.backToBrowserEl.getAttribute("href"));return!0},gotoUnit:function(e){if(e.preventDefault(),!PTL.editor.canNavigate())return!1;var t="TR"!==e.target.nodeName?(0,u.default)(e.target).parents("tr"):(0,u.default)(e.target);if(e.ctrlKey||e.altKey||e.metaKey||2===e.which)return window.open(t.data("target"),"_blank"),!1;if(""!==window.getSelection().toString()||3===e.which)return!1;var n=this.id.match(/(row|ctx)([0-9]+)/);if(n){var i=n[1],r=parseInt(n[2],10),s=void 0;s="row"===i?W.default.updateHashPart("unit",r):"unit="+encodeURIComponent(r);var o=PTL.editor.getOffsetOfUid(r);if(o===-1)return window.location.href=t.data("target"),!1;u.default.history.load(s),PTL.editor.setOffset(r)}return!0},unitIndex:function(e){e.preventDefault();var t=window.getSelection(),n=document.createRange();n.selectNodeContents(this.unitIndexEl),t.removeAllRanges(),t.addRange(n),this.unitIndexEl.focus()},gotoIndex:function(e){if(13===e.which){e.preventDefault();var t=parseInt(this.unitIndexEl.textContent,10);if(!isNaN(t)&&(t=Math.max(0,t-1),t>=0&&t<=this.units.total))if(t<this.initialOffset||t>=this.getOffsetOfLastUnit())this.initialOffset=-1,this.offset=0,this.offsetRequested=t+1,u.default.history.load(W.default.updateHashPart("offset",this.getStartOfChunk(t),["unit"]));else{var n=this.units.uIds[t-this.initialOffset],i=W.default.updateHashPart("unit",n);u.default.history.load(W.default.updateHashPart("offset",this.getStartOfChunk(t),[],i))}}},getCheckOptions:function(){var e=this.$filterChecks,t="none";t=this.category&&this.category.length?[this.category,"-category"].join(""):this.checks[0]||"none",e.select2(X),e.val(t).trigger("change.select2"),this.$filterChecksWrapper.css("display","inline-block")},filterChecks:function e(){if(this.preventNavigation)return!1;if(!this.canNavigate())return!1;var e=this.$filterChecks.val();if("none"!==e){var t=this.$filterSortBy.val(),n={};n=e.endsWith("-category")?{filter:"checks",category:e.slice(0,-9)}:{filter:"checks",checks:e},"default"!==t&&(n.sort=t),u.default.history.load(u.default.param(n))}return!0},filterSort:function(){var e=this.$filterStatus.val(),t=this.$filterChecks.val()||this.checks.join(","),n=this.$filterSortBy.val(),i=this.user||null,r={filter:e};this.category.length?r.category=this.category:"none"!==t&&(r.checks=t),"default"!==n&&(r.sort=n),null!==i&&(r.user=i),u.default.history.load(u.default.param(r))},filterStatus:function(){if(!this.canNavigate())return!1;var e=this.$filterStatus.find("option:selected"),t=e.val();if("checks"===t)this.getCheckOptions();else if(this.$filterChecksWrapper.hide(),!this.preventNavigation){var n={filter:t},i=e.data("user");this.user&&i?n.user=this.user:(this.user=null,(0,u.default)(".js-user-filter").remove(),"default"!==this.sortBy&&(n.sort=this.sortBy)),u.default.history.load(u.default.param(n))}return!0},renderCtxControls:function(e){var t=e.hasData,n=void 0!==t&&t,i=this.tmpl.editCtx({hasData:n,extraCls:"before"}),r=this.tmpl.editCtx({hasData:n,extraCls:"after"});return[i,r]},replaceCtxControls:function(e){var t=o(e,2),n=t[0],i=t[1];(0,u.default)("tr.edit-ctx.before").replaceWith(n),(0,u.default)("tr.edit-ctx.after").replaceWith(i)},handleContextSuccess:function(e){if(e.ctx.before.length||e.ctx.after.length){this.ctxGap+=Math.max(e.ctx.before.length,e.ctx.after.length),(0,A.default)("ctxQty",this.ctxGap,{path:"/"});var t=this.renderCtxRows(e.ctx.before,"before"),n=this.renderCtxRows(e.ctx.after,"after"),i=(0,u.default)("tr.edit-ctx");i.first().after(t),i.last().before(n),this.renderViewRowValues(".ctx-row",this.viewCtxUnits)}},moreContext:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y;return O.default.getContext(this.units.getCurrent().id,{gap:this.ctxGap,qty:t}).then(function(t){return e.handleContextSuccess(t)},this.error)},lessContext:function(){var e=(0,u.default)(".ctx-row.before"),t=(0,u.default)(".ctx-row.after");(e.length||t.length)&&(e.length===this.ctxGap&&e.slice(0,Y).remove(),t.length===this.ctxGap&&t.slice(-Y).remove(),this.ctxGap-=Y,this.ctxGap>=0&&(0===this.ctxGap&&this.replaceCtxControls(this.renderCtxControls({hasData:!1})),(0,A.default)("ctxQty",this.ctxGap,{path:"/"})))},showContext:function(){var e=this,t=(0,u.default)(".ctx-row.before"),n=(0,u.default)(".ctx-row.after");t.length||n.length?(t.show(),n.show(),this.replaceCtxControls(this.renderCtxControls({hasData:!0}))):this.ctxQty>0&&(this.ctxGap=0,this.moreContext(this.ctxQty).then(function(){e.replaceCtxControls(e.renderCtxControls({hasData:!0}))}))},hideContext:function(){var e=(0,u.default)(".ctx-row.before"),t=(0,u.default)(".ctx-row.after");e.hide(),t.hide(),this.replaceCtxControls(this.renderCtxControls({hasData:!1}))},onSearch:function(e){if(!PTL.editor.canNavigate())return!1;var t=void 0;if(e){var n=this.buildSearchQuery();t="search="+n}else t=W.default.updateHashPart("filter","all",["search","sfields","soptions"]);return u.default.history.load(t),!0},addComment:function(e){var t=this;e.preventDefault(),this.updateCommentDefaultProperties(),O.default.addComment(this.units.getCurrent().id,(0,u.default)(e.target).serializeObject()).then(function(e){return t.processAddComment(e)},this.error)},processAddComment:function(e){(0,u.default)(".js-editor-comment").removeClass("selected"),(0,u.default)("#editor-comment").fadeOut(200),(0,u.default)("#translator-comment").length?(0,u.default)(e.comment).hide().prependTo("#translator-comment").delay(200).animate({height:"show"},1e3,"easeOutQuad"):(0,u.default)("<div id='translator-comment'>"+e.comment+"</div>").prependTo("#extras-container").delay(200).hide().animate({height:"show"},1e3,"easeOutQuad")},removeComment:function(e){e.preventDefault(),O.default.removeComment(this.units.getCurrent().id).then(function(){return(0,u.default)(".js-comment-first").fadeOut(200)},this.error)},showTimeline:function(){var e=this,t=(0,u.default)("#timeline-results");if(t.length)return void t.slideDown(1e3,"easeOutQuad");var n=(0,u.default)(".translate-container");n.spin(),O.default.getTimeline(this.units.getCurrent().id).then(function(t){return e.renderTimeline(t)},this.error).always(function(){return n.spin(!1)})},renderTimeline:function(e){var t=e.uid;e.timeline&&t===this.units.getCurrent().id&&((0,u.default)("#translator-comment").length?(0,u.default)(e.timeline).hide().insertAfter("#translator-comment").slideDown(1e3,"easeOutQuad"):(0,u.default)(e.timeline).hide().prependTo("#extras-container").slideDown(1e3,"easeOutQuad"),(0,P.qAll)(".js-mount-timesince").forEach(function(t,n){var i={title:e.event_groups[n].display_datetime,dateTime:e.event_groups[n].iso_datetime,relativeTime:e.event_groups[n].relative_time};e.event_groups[n].via_upload?m.default.render(p.default.createElement(I.default,i),t):m.default.render(p.default.createElement(f.default,i),t)}),W.default.highlightRONodes(".js-unit-highlight"),(0,u.default)(".timeline-field-body").filter(":not([dir])").bidi(),(0,u.default)("#js-show-timeline").addClass("selected"))},toggleTimeline:function(e){e.preventDefault();var t=(0,u.default)("#js-toggle-timeline");t.toggleClass("selected"),t.hasClass("selected")?this.showTimeline():(0,u.default)("#timeline-results").slideUp(1e3,"easeOutQuad")},filterTMResults:function(e,t){var n=[];if(e.length>0&&e[0].source===t){var i=this.settings.canSuggest||this.settings.canTranslate;if(""===G.default.stateValues[0]&&i){var r=this.isUnitDirty,s=e[0].target;G.default.setValueFor(this.focused||0,s),this.isUnitDirty=r,(0,u.default)(".js-mount-editor").toggleClass("js-auto-matched-translation",!0),(0,u.default)(".js-auto-match-msg").slideDown(200,"easeOutQuad")}}for(var o=0;o<e.length&&o<3;o++){var a=e[o],l=a.fullname;"nobody"===a.username?l=gettext("some anonymous user"):a.fullname||(l=a.username?a.username:gettext("someone")),a.fullname=c.default.escape(l),a.project=c.default.escape(a.project),a.path=c.default.escape(a.path),n.push(a)}return n},getTMUnitsContent:function(e){var t=this.units.getCurrent(),n=t.get("store"),i=t.get("source")[0],r=this.filterTMResults(e,i),s=gettext("Similar translations");return r.length?this.tmpl.tm({name:s,store:n,unit:t.toJSON(),suggs:r}):""},getTMUnits:function(){var e=this,t=this.units.getCurrent(),n=t.get("source")[0],i=t.get("store"),r=i.source_lang,s=i.target_lang;if(n.length&&r!==s&&!(void 0===this.settings.tmSourceLanguages||this.settings.tmSourceLanguages.indexOf(r)<0)){var o=i.project_style,a=""+this.settings.tmUrl+r+"/"+s+"/unit/?source="+encodeURIComponent(n);o.length&&"standard"!==o&&(a+="&style="+o),(0,M.default)({url:a,crossDomain:!0}).then(function(n){return e.handleTmResults(n,i,t)},function(e,t){return console.error("HTTP "+e.status+" ("+t+"): "+a)})}},handleTmResults:function(e,t,n){if(!e.length)return!1;var i=n.get("source")[0],r=PTL.editor.filterTMResults(e,i),s=gettext("Similar translations"),o=PTL.editor.tmpl.tm({name:s,store:t,unit:n.toJSON(),suggs:r});return(0,u.default)(o).hide().appendTo("#extras-container").slideDown(1e3,"easeOutQuad"),!0},handleRejectSuggestion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requestData,i=void 0===n?{}:n;this.rejectSuggestion(e,{requestData:i})},rejectSuggestion:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.requestData,r=void 0===i?{}:i;O.default.rejectSuggestion(this.units.getCurrent().id,e,r).then(function(n){return t.processRejectSuggestion(n,e)},this.error)},processRejectSuggestion:function(e,t){(0,u.default)("#suggestion-"+t).fadeOut(200,function(){PTL.editor.closeSuggestion({checkIfCanNavigate:!1}),(0,u.default)(this).remove(),(0,u.default)(".js-user-suggestion").length||PTL.editor.gotoNext()})},handleAcceptSuggestion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.requestData,i=void 0===n?{}:n,r=t.isSuggestionChanged,s=void 0!==r&&r;s?(this.undoFuzzyBox(),this.handleSubmit(i)):this.acceptSuggestion(e,{requestData:i})},acceptSuggestion:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.requestData,r=void 0===i?{}:i,s=n.skipToNext,o=void 0!==s&&s;O.default.acceptSuggestion(this.units.getCurrent().id,e,r).then(function(n){return t.processAcceptSuggestion(n,e,o)},this.error)},processAcceptSuggestion:function(e,t,n){void 0!==e.newtargets&&G.default.setValues(e.newtargets),this.updateUnitDefaultProperties();var i=this.units.getCurrent();i.setTranslation(G.default.stateValues),i.set("isfuzzy",!1),G.default.renderSuggestions(e.newtargets);var r=!!e.checks;(0,u.default)(".translate-container").toggleClass("error",r),r&&s(e.checks),(0,u.default)("#suggestion-"+t).fadeOut(200,function(){PTL.editor.closeSuggestion({checkIfCanNavigate:!1}),(0,u.default)(this).remove(),r||!n&&(0,u.default)(".js-user-suggestion").length||PTL.editor.gotoNext()})},toggleCheck:function(e){var t=this,n=(0,u.default)(".js-check-"+e),i=n.hasClass("false-positive"),r=i?null:{mute:1};O.default.toggleCheck(this.units.getCurrent().id,e,r).then(function(){return t.processToggleCheck(e,i)},this.error)},processToggleCheck:function(e,t){(0,u.default)(".js-check-"+e).toggleClass("false-positive",!t);var n=(0,u.default)("#translate-checks-block .check").not(".false-positive").size()>0;(0,u.default)(".translate-container").toggleClass("error",n)},runHooks:function(){var e=this;te.forEach(function(t){return t.init({unit:e.units.getCurrent().toJSON()})})},setTranslation:function(e){var t=e.translation;return void 0===t&&e.msg?(this.displayError(e.msg),!1):(G.default.setValueFor(this.focused||0,(0,K.decodeEntities)(t)),this.focused.dataset.translationAidMt=t,this.goFuzzy(),!0)},openSuggestion:function(e){this.selectedSuggestionId=e;var t=".js-mnt-suggestion-feedback-"+e,n=(0,P.q)(t),i=(0,P.q)(".js-editor-body .translate-full"),r=document.getElementById("suggestion-"+e),s={suggId:e,onAcceptSuggestion:this.handleAcceptSuggestion.bind(this),onRejectSuggestion:this.handleRejectSuggestion.bind(this),onChange:this.handleSuggestionFeedbackChange.bind(this)};r.classList.add("suggestion-expanded"),i.classList.add("suggestion-expanded"),this.isSuggestionFeedbackFormDirty=!1,G.default.renderSuggestionFeedbackForm(s,n)},toggleSuggestion:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.canHide,i=void 0!==n&&n;if(void 0===this.selectedSuggestionId){e.stopPropagation();var r=parseInt(e.currentTarget.dataset.suggId,10);this.openSuggestion(r)}else i&&(e.stopPropagation(),this.closeSuggestion())},handleSuggestionFeedbackChange:function(e){this.isSuggestionFeedbackFormDirty=e},closeSuggestion:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.checkIfCanNavigate,n=void 0===t||t;if(void 0!==this.selectedSuggestionId&&(!n||this.canNavigate())){var i=(0,P.q)("#suggestion-"+this.selectedSuggestionId),r=(0,P.q)(".js-editor-body .translate-full");r.classList.remove("suggestion-expanded"),i.classList.remove("suggestion-expanded"),this.selectedSuggestionId=void 0,this.isSuggestionFeedbackFormDirty=!1,G.default.unmountSuggestionFeedbackForm()}},addFormats:function(e){this.formats=(0,T.default)(this.formats,e)}}},231:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),s=i(r),o=n(1),a=i(o),u=function(e){var t=e.isDisabled,n=e.children,i=(0,s.default)("editor-area-wrapper js-editor-area-wrapper",{"is-disabled":t});return a.default.createElement("div",{className:i},n)};u.propTypes={children:a.default.PropTypes.oneOfType([a.default.PropTypes.array,a.default.PropTypes.element]),isDisabled:a.default.PropTypes.bool.isRequired},t.default=u},232:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=i(s),a=n(231),u=i(a),l=n(233),c=i(l),d=n(125),p=i(d),h=n(48),f=o.default.createClass({displayName:"Editor",propTypes:{initialValues:o.default.PropTypes.array,isDisabled:o.default.PropTypes.bool,isRawMode:o.default.PropTypes.bool,onChange:o.default.PropTypes.func.isRequired,style:o.default.PropTypes.object,targetNplurals:o.default.PropTypes.number.isRequired,textareaComponent:o.default.PropTypes.func,textareaHeaderActionCallback:o.default.PropTypes.func,textareaHeaderComponent:o.default.PropTypes.func,getTextareaHeaderProps:o.default.PropTypes.func,values:o.default.PropTypes.array},getDefaultProps:function(){return{initialValues:[],textareaComponent:p.default,textareaHeaderComponent:c.default,getTextareaHeaderProps:function(){return null},textareaHeaderActionCallback:function(){return null}}},render:function(){for(var e=this,t=[],n=function(n){var i={};void 0!==e.props.isRawMode&&(i.isRawMode=e.props.isRawMode),t.push(o.default.createElement(u.default,{isDisabled:e.props.isDisabled,key:n},o.default.createElement(e.props.textareaHeaderComponent,{count:e.props.targetNplurals,index:n,actionCallback:function(t){return e.props.textareaHeaderActionCallback(n,t)},getProps:function(){return e.props.getTextareaHeaderProps(n)}}),o.default.createElement(e.props.textareaComponent,r({autoFocus:0===n,id:(0,h.getAreaId)(n),initialValue:e.props.initialValues[n],isDisabled:e.props.isDisabled,onChange:function(t){return e.props.onChange(n,t)},value:e.props.values[n]},i))))},i=0;i<this.props.targetNplurals;i++)n(i);return o.default.createElement("div",null,t)}});t.default=f},233:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),s=i(r),o=n(37),a=s.default.createClass({displayName:"EditorPluralFormHeader",propTypes:{count:s.default.PropTypes.number.isRequired,index:s.default.PropTypes.number.isRequired},render:function(){return 1===this.props.count?null:s.default.createElement("div",{className:"subheader"},(0,o.t)("Plural form %(index)s",{index:this.props.index}))}});t.default=a},234:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),s=i(r),o=n(1),a=i(o),u=n(7),l=i(u),c=n(16),d=i(c),p=a.default.createClass({displayName:"SuggestionFeedBackForm",propTypes:{suggId:a.default.PropTypes.number.isRequired,initialSuggestionValues:a.default.PropTypes.array.isRequired,onAcceptSuggestion:a.default.PropTypes.func.isRequired,onRejectSuggestion:a.default.PropTypes.func.isRequired,onChange:a.default.PropTypes.func.isRequired,editorComponent:a.default.PropTypes.func.isRequired,isDisabled:a.default.PropTypes.bool.isRequired,sourceValues:a.default.PropTypes.array.isRequired,currentLocaleCode:a.default.PropTypes.string.isRequired,currentLocaleDir:a.default.PropTypes.string.isRequired,targetNplurals:a.default.PropTypes.number},getInitialState:function(){return this.initialData={comment:"",translations:this.props.initialSuggestionValues},{formData:this.initialData}},handleAccept:function(e){var t=this.state.formData.translations!==this.props.initialSuggestionValues;e.preventDefault(),this.props.onAcceptSuggestion(this.props.suggId,{requestData:this.state.formData,isSuggestionChanged:t})},handleReject:function(e){e.preventDefault(),this.props.onRejectSuggestion(this.props.suggId,{requestData:this.state.formData})},handleChange:function(e){var t=!s.default.isEqual(e,this.initialData),n=(0,l.default)(this.state.formData,{translations:e});this.setState({isDirty:t,formData:n}),this.props.onChange(t)},handleCommentChange:function(e,t){var n=""!==t,i=(0,l.default)(this.state.formData,{comment:t});this.setState({isDirty:n,formData:i}),this.props.onChange(n)},render:function(){var e=this.state.formData;return a.default.createElement("form",{id:"suggestion-feedback-form"},a.default.createElement("div",{className:"fields"},a.default.createElement("div",{className:"field-wrapper suggestion-editor"},a.default.createElement("label",{htmlFor:"suggestion-editor"},gettext("Edit the suggestion before accepting, if necessary")),a.default.createElement(this.props.editorComponent,{currentLocaleCode:this.props.currentLocaleCode,currentLocaleDir:this.props.currentLocaleDir,initialValues:e.translations,onChange:this.handleChange,sourceValues:this.props.sourceValues,targetNplurals:this.props.targetNplurals,isDisabled:this.props.isDisabled})),a.default.createElement(d.default,{type:"textarea",label:gettext("Provide optional comment (will be publicly visible)"),placeholder:"",name:"comment",handleChange:this.handleCommentChange,value:e.comment,className:"comment"})),a.default.createElement("p",{className:"buttons"},a.default.createElement("button",{className:"btn btn-success",onClick:this.handleAccept},a.default.createElement("i",{className:"icon-accept-white"}),gettext("Accept")),a.default.createElement("button",{className:"btn btn-danger",onClick:this.handleReject},a.default.createElement("i",{className:"icon-reject-white"}),gettext("Reject"))),a.default.createElement("div",{className:"clear"}))}});t.default=p},235:function(e,t,n){"use strict";
function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),s=i(r),o=n(93),a=i(o),u=function(e){var t=e.value,n=e.initialValue;return s.default.createElement("div",{dangerouslySetInnerHTML:{__html:(0,a.default)(n,t)}})};u.propTypes={value:s.default.PropTypes.string.isRequired,initialValue:s.default.PropTypes.string.isRequired};var l=s.default.createClass({displayName:"SuggestionValue",propTypes:{id:s.default.PropTypes.number.isRequired,values:s.default.PropTypes.array.isRequired,getPluralFormName:s.default.PropTypes.func,hasPlurals:s.default.PropTypes.bool.isRequired,currentLocaleCode:s.default.PropTypes.string,currentLocaleDir:s.default.PropTypes.string,innerComponent:s.default.PropTypes.func,initialValues:s.default.PropTypes.array.isRequired},getDefaultProps:function(){return{innerComponent:u,initialValues:[]}},getPluralFormName:function(e){return void 0!==this.props.getPluralFormName?this.props.getPluralFormName(e):"["+e+"]"},createItem:function(e,t){var n=this.props.initialValues.length>t?this.props.initialValues[t]:"";return s.default.createElement("div",{key:"source-value-"+t,className:"extra-item-content"},s.default.createElement("div",{className:"extra-item"},this.props.hasPlurals&&s.default.createElement("div",{className:"plural-form-label"},this.getPluralFormName(t)),s.default.createElement("div",{className:"js-suggestion-text suggestion-translation","data-string":e,lang:this.props.currentLocaleCode,dir:this.props.currentLocaleDir},s.default.createElement(this.props.innerComponent,{value:e,initialValue:n}))))},render:function(){return s.default.createElement("div",null,this.props.values.map(this.createItem))}});t.default=l},236:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=i(s),a=n(37),u=n(21),l=function(e){var t=e.value;return o.default.createElement("div",{dangerouslySetInnerHTML:{__html:(0,u.highlightRW)(t)}})};l.propTypes={value:o.default.PropTypes.string.isRequired};var c=o.default.createClass({displayName:"UnitSource",propTypes:{id:o.default.PropTypes.number.isRequired,values:o.default.PropTypes.array.isRequired,getPluralFormName:o.default.PropTypes.func,hasPlurals:o.default.PropTypes.bool.isRequired,sourceLocaleCode:o.default.PropTypes.string,sourceLocaleDir:o.default.PropTypes.string,innerComponent:o.default.PropTypes.func},getDefaultProps:function(){return{innerComponent:l}},getPluralFormName:function(e){return void 0!==this.props.getPluralFormName?this.props.getPluralFormName(e):(0,a.t)("Plural form %(index)s",{index:e})},createItem:function(e,t){var n={lang:this.props.sourceLocaleCode,dir:this.props.sourceLocaleDir};return o.default.createElement("div",{key:"source-value-"+t},this.props.hasPlurals&&o.default.createElement("div",{className:"plural-form-label"},this.getPluralFormName(t)),o.default.createElement("div",r({className:"translation-text js-translation-text","data-string":e},n),o.default.createElement(this.props.innerComponent,{value:e})))},render:function(){return o.default.createElement("div",{id:"js-unit-"+this.props.id,className:"translate-original"},this.props.values.map(this.createItem))}});t.default=c},237:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s=n(1),o=i(s),a=n(8),u=n(131),l=i(u),c=n(37),d=o.default.createClass({displayName:"UploadTimeSince",propTypes:{dateTime:s.PropTypes.string.isRequired,relativeTime:s.PropTypes.string.isRequired,title:s.PropTypes.string.isRequired},mixins:[a.PureRenderMixin],render:function(){var e=o.default.createElement(l.default,r({className:""},this.props));return o.default.createElement("span",{className:"extra-item-meta"},(0,c.tct)("%(timeSince)s via file upload",{timeSince:e}))}});t.default=d},238:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(18),s=i(r),o=n(1),a=i(o),u=n(21),l=function(e){var t=e.value;return a.default.createElement("div",{className:"view-unit-value",dangerouslySetInnerHTML:{__html:(0,u.highlightRO)(t)}})};l.propTypes={value:a.default.PropTypes.string.isRequired};var c=a.default.createClass({displayName:"ViewUnit",propTypes:{dir:o.PropTypes.string.isRequired,isFuzzy:o.PropTypes.bool,language:o.PropTypes.string.isRequired,values:o.PropTypes.array.isRequired,type:o.PropTypes.string.isRequired,innerComponent:a.default.PropTypes.func,getPluralFormName:a.default.PropTypes.func,hasPlurals:a.default.PropTypes.bool.isRequired},getDefaultProps:function(){return{innerComponent:l,isFuzzy:!1}},getPluralFormName:function(e){return void 0!==this.props.getPluralFormName?this.props.getPluralFormName(e):"["+e+"]"},createValue:function(e,t){return a.default.createElement("div",{className:"translation-text",dir:this.props.dir,key:this.props.type+"-value-"+t,lang:this.props.language},this.props.hasPlurals&&a.default.createElement("div",{className:"plural-form-label"},this.getPluralFormName(t)),a.default.createElement(this.props.innerComponent,{value:e}))},render:function(){var e=(0,s.default)("translate-"+this.props.type,"translate-view",{"fuzzy-unit":this.props.isFuzzy});return a.default.createElement("div",{dir:this.props.dir,className:e},this.props.values.map(this.createValue))}});t.default=c},239:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),s=i(r),o=n(10),a=n(232),u=i(a),l=n(125),c=i(l),d=s.default.createClass({displayName:"EditorContainer",propTypes:{currentLocaleCode:s.default.PropTypes.string.isRequired,currentLocaleDir:s.default.PropTypes.string.isRequired,initialValues:s.default.PropTypes.array,isDisabled:s.default.PropTypes.bool,isRawMode:s.default.PropTypes.bool,onChange:s.default.PropTypes.func.isRequired,sourceValues:s.default.PropTypes.array,style:s.default.PropTypes.object,targetNplurals:s.default.PropTypes.number.isRequired,textareaComponent:s.default.PropTypes.func,editorComponent:s.default.PropTypes.func},childContextTypes:{currentLocaleCode:s.default.PropTypes.string,currentLocaleDir:s.default.PropTypes.string},getDefaultProps:function(){return{initialValues:[],textareaComponent:c.default,editorComponent:u.default}},getInitialState:function(){return{values:this.props.initialValues}},getChildContext:function(){return{currentLocaleCode:this.props.currentLocaleCode,currentLocaleDir:this.props.currentLocaleDir}},componentDidMount:function(){this.areas=(0,o.qAll)(".js-translation-area")},getAreas:function(){return this.areas},getAreaValues:function(e){return e},getStateValues:function(){return this.state.values},handleChange:function(e,t){var n=this,i=this.state.values.slice();i[e]=t,this.setState({values:i},function(){return n.props.onChange(i)})},render:function(){return s.default.createElement(this.props.editorComponent,{isDisabled:this.props.isDisabled,isRawMode:this.props.isRawMode,style:this.props.style,targetNplurals:this.props.targetNplurals,textareaComponent:this.props.textareaComponent,initialValues:this.props.initialValues,onChange:this.handleChange,sourceValues:this.props.sourceValues,values:this.state.values})}});t.default=d},240:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(239),s=i(r),o=n(235),a=i(o),u=n(236),l=i(u),c=n(238),d=i(c),p={editorComponent:s.default,suggestionValueComponent:a.default,unitSourceComponent:l.default,viewUnitComponent:d.default};t.default=p},241:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=(0,o.default)({},e);delete n.fileType;var i=PTL.editor.formats[e.fileType];void 0!==i?i(n,t):t(n,u.default)}Object.defineProperty(t,"__esModule",{value:!0}),t.loadFormatAdaptor=r;var s=n(7),o=i(s),a=n(240),u=i(a)},242:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o=n(7),a=i(o),u=n(1),l=i(u),c=n(12),d=i(c),p=n(132),h=i(p),f=n(10),g=n(234),m=i(g),v=n(241),y=n(244),b=n(130),C={init:function(e){var t=this;this.node=(0,f.q)(".js-mount-editor"),this.sourceNode=(0,f.q)(".js-mount-editor-original-src"),this.alternativeSourceNodes=(0,f.qAll)(".js-mount-editor-alt-src"),this.suggestionValueNodes=(0,f.qAll)(".js-mnt-suggestion"),this.props={},this.hasCRLF=e.sourceValues.some(y.hasCRLF),h.default.unmountComponents(),(0,v.loadFormatAdaptor)(e,function(e,n){t.formatAdaptor=n,t.setProps(e),t.renderSuggestions(e.initialValues)})},setProps:function(e){this.props=(0,a.default)(this.props,e);var t={};this.hasCRLF&&e.hasOwnProperty("initialValues")&&(t.initialValues=(0,y.normalize)(e.initialValues)),this.editorInstance=h.default.render(l.default.createElement(this.formatAdaptor.editorComponent,s({onChange:this.handleChange},this.props,t)),this.node),h.default.render(l.default.createElement(this.formatAdaptor.unitSourceComponent,{id:this.props.unitId,values:this.props.sourceValues,hasPlurals:this.props.hasPlurals,sourceLocaleCode:this.props.sourceLocaleCode,sourceLocaleDir:this.props.sourceLocaleDir}),this.sourceNode);for(var n=0;n<this.alternativeSourceNodes.length;n++){var i=this.alternativeSourceNodes[n],r=this.props.alternativeSources[i.dataset.id];h.default.render(l.default.createElement(this.formatAdaptor.unitSourceComponent,{id:r.id,values:r.target,hasPlurals:r.has_plurals,sourceLocaleCode:r.language_code,sourceLocaleDir:r.language_direction}),i)}},renderViewUnitComponent:function(e,t){(0,v.loadFormatAdaptor)(e,function(e,n){h.default.render(l.default.createElement(n.viewUnitComponent,e),t)})},renderSuggestions:function(e){for(var t=0;t<this.suggestionValueNodes.length;t++){var n=this.suggestionValueNodes[t],i=this.props.suggestions[n.dataset.id];h.default.render(l.default.createElement(this.formatAdaptor.suggestionValueComponent,{id:i.id,values:i.target,hasPlurals:this.props.hasPlurals,currentLocaleCode:this.props.currentLocaleCode,currentLocaleDir:this.props.currentLocaleDir,initialValues:e}),n)}},renderSuggestionFeedbackForm:function(e,t){var n=this.props.suggestions[e.suggId];this.feedbackMountNode=t,this.suggestionEditorInstance=d.default.render(l.default.createElement(m.default,s({initialSuggestionValues:n.target,sourceValues:this.props.sourceValues,editorComponent:this.formatAdaptor.editorComponent,currentLocaleCode:this.props.currentLocaleCode,currentLocaleDir:this.props.currentLocaleDir,targetNplurals:this.props.targetNplurals,isDisabled:this.props.isDisabled},e)),t)},unmountSuggestionFeedbackForm:function(){this.feedbackMountNode&&(d.default.unmountComponentAtNode(this.feedbackMountNode),this.feedbackMountNode=void 0)},get stateValues(){return this._stateValues(this.editorInstance)},get stateSuggestionValues(){return this._stateValues(this.suggestionEditorInstance)},_stateValues:function(e){var t=e.getStateValues();return this.hasCRLF?(0,y.denormalize)(t):t},handleChange:function(){PTL.editor.onTextareaChange()},setValueFor:function(e,t){if(!this.props.isDisabled){var n=this.editorInstance.getAreas(),i="object"===("undefined"==typeof e?"undefined":r(e))?n.indexOf(e):e;(0,b.setValue)(n[i],t,{isRawMode:this.props.isRawMode,triggerChange:!0}),n[i].focus()}},setValues:function(e){for(var t=this.editorInstance.getAreaValues(e),n=0;n<t.length;n++)C.setValueFor(n,t[n])},insertAtCaretFor:function(e,t){var n=this.editorInstance.getAreas(),i="object"===("undefined"==typeof e?"undefined":r(e))?n.indexOf(e):e;(0,b.insertAtCaret)(n[i],t,{isRawMode:this.props.isRawMode,triggerChange:!0}),n[i].focus()}};t.default=C},244:function(e,t){"use strict";function n(e){return"string"==typeof e&&e.indexOf("\r\n")!==-1}function i(e){return Array.isArray(e)?e.map(function(e){return e.replace(/\r\n/g,"\n")}):[]}function r(e){return Array.isArray(e)?e.map(function(e){return e.replace(/\n/g,"\r\n")}):[]}Object.defineProperty(t,"__esModule",{value:!0}),t.hasCRLF=n,t.normalize=i,t.denormalize=r},245:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.Unit=void 0;var r=n(15),s=i(r),o=n(6),a=i(o);t.Unit=s.default.Model.extend({setTranslation:function(e){var t=e;a.default.isArray(e)||(t=[e]),this.set("target",t)}})},249:function(e,t,n){"use strict";function i(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(29),s=i(r);window.PTL=window.PTL||{};var o={apiRoot:PTL.unitApiRoot,fetchUnits:function(e){return(0,s.default)({body:e,url:this.apiRoot})},fetchUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,s.default)({body:t,queue:"unitWidget",url:""+this.apiRoot+e+"/edit/"})},addTranslation:function(e,t){return(0,s.default)({body:t,method:"POST",url:""+this.apiRoot+e})},getContext:function(e,t){return(0,s.default)({body:t,url:""+this.apiRoot+e+"/context/"})},getTimeline:function(e){return(0,s.default)({url:""+this.apiRoot+e+"/timeline/"})},addComment:function(e,t){return(0,s.default)({body:t,method:"POST",url:""+this.apiRoot+e+"/comment/"})},removeComment:function(e){return(0,s.default)({method:"DELETE",url:""+this.apiRoot+e+"/comment/"})},addSuggestion:function(e,t){return(0,s.default)({body:t,method:"POST",url:""+this.apiRoot+e+"/suggestions/"})},acceptSuggestion:function(e,t,n){return(0,s.default)({body:n,method:"POST",url:""+this.apiRoot+e+"/suggestions/"+t+"/"})},rejectSuggestion:function(e,t,n){return(0,s.default)({body:n,method:"DELETE",url:""+this.apiRoot+e+"/suggestions/"+t+"/"})},toggleCheck:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,s.default)({body:n,method:"POST",url:""+this.apiRoot+e+"/checks/"+t+"/toggle/"})}};t.default=o},258:function(e,t){"use strict";function n(e){var t=window.location.toString().split("#",2)[0],n=encodeURIComponent(e);return t+"#search="+n+"&sfields=notes"}function i(e){return e?e.replace(r,function(e,t,i){return t+'<a href="'+n(i)+'">'+i+"</a>"}):""}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=/(^|\s+|>)(#[0-9a-z_\-]+)/gi},376:function(e,t){NOT_UNICODE_LETTER=/[^\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0523\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0621-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971\u0972\u097B-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39\u0D3D\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC\u0EDD\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8B\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10D0-\u10FA\u10FC\u1100-\u1159\u115F-\u11A2\u11A8-\u11F9\u1200-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u1676\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19A9\u19C1-\u19C7\u1A00-\u1A16\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u2094\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2C6F\u2C71-\u2C7D\u2C80-\u2CE4\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31B7\u31F0-\u31FF\u3400\u4DB5\u4E00\u9FC3\uA000-\uA48C\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA65F\uA662-\uA66E\uA67F-\uA697\uA717-\uA71F\uA722-\uA788\uA78B\uA78C\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA90A-\uA925\uA930-\uA946\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAC00\uD7A3\uF900-\uFA2D\uFA30-\uFA6A\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/g,UNICODE_RTL=/^[\u0590-\u05FF\u0600-\u06FF\u0750-\u077F\uFB50-\uFDFF\uFE70-\uFEFF]/,function(e){e.fn.bidi=function(){return this.each(function(){var t=e(this),n=t.text().replace(NOT_UNICODE_LETTER,"");n&&UNICODE_RTL.test(n)?t.css("direction","rtl"):t.css("direction","ltr")})}}(jQuery)},377:function(e,t){jQuery.easing.jswing=jQuery.easing.swing,jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,t,n,i,r){return jQuery.easing[jQuery.easing.def](e,t,n,i,r)},easeInQuad:function(e,t,n,i,r){return i*(t/=r)*t+n},easeOutQuad:function(e,t,n,i,r){return-i*(t/=r)*(t-2)+n},easeInOutQuad:function(e,t,n,i,r){return(t/=r/2)<1?i/2*t*t+n:-i/2*(--t*(t-2)-1)+n},easeInCubic:function(e,t,n,i,r){return i*(t/=r)*t*t+n},easeOutCubic:function(e,t,n,i,r){return i*((t=t/r-1)*t*t+1)+n},easeInOutCubic:function(e,t,n,i,r){return(t/=r/2)<1?i/2*t*t*t+n:i/2*((t-=2)*t*t+2)+n},easeInQuart:function(e,t,n,i,r){return i*(t/=r)*t*t*t+n},easeOutQuart:function(e,t,n,i,r){return-i*((t=t/r-1)*t*t*t-1)+n},easeInOutQuart:function(e,t,n,i,r){return(t/=r/2)<1?i/2*t*t*t*t+n:-i/2*((t-=2)*t*t*t-2)+n},easeInQuint:function(e,t,n,i,r){return i*(t/=r)*t*t*t*t+n},easeOutQuint:function(e,t,n,i,r){return i*((t=t/r-1)*t*t*t*t+1)+n},easeInOutQuint:function(e,t,n,i,r){return(t/=r/2)<1?i/2*t*t*t*t*t+n:i/2*((t-=2)*t*t*t*t+2)+n},easeInSine:function(e,t,n,i,r){return-i*Math.cos(t/r*(Math.PI/2))+i+n},easeOutSine:function(e,t,n,i,r){return i*Math.sin(t/r*(Math.PI/2))+n},easeInOutSine:function(e,t,n,i,r){return-i/2*(Math.cos(Math.PI*t/r)-1)+n},easeInExpo:function(e,t,n,i,r){return 0==t?n:i*Math.pow(2,10*(t/r-1))+n},easeOutExpo:function(e,t,n,i,r){return t==r?n+i:i*(-Math.pow(2,-10*t/r)+1)+n},easeInOutExpo:function(e,t,n,i,r){return 0==t?n:t==r?n+i:(t/=r/2)<1?i/2*Math.pow(2,10*(t-1))+n:i/2*(-Math.pow(2,-10*--t)+2)+n},easeInCirc:function(e,t,n,i,r){return-i*(Math.sqrt(1-(t/=r)*t)-1)+n},easeOutCirc:function(e,t,n,i,r){return i*Math.sqrt(1-(t=t/r-1)*t)+n},easeInOutCirc:function(e,t,n,i,r){return(t/=r/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+n:i/2*(Math.sqrt(1-(t-=2)*t)+1)+n},easeInElastic:function(e,t,n,i,r){var s=1.70158,o=0,a=i;if(0==t)return n;if(1==(t/=r))return n+i;if(o||(o=.3*r),a<Math.abs(i)){a=i;var s=o/4}else var s=o/(2*Math.PI)*Math.asin(i/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*r-s)*(2*Math.PI)/o))+n},easeOutElastic:function(e,t,n,i,r){var s=1.70158,o=0,a=i;if(0==t)return n;if(1==(t/=r))return n+i;if(o||(o=.3*r),a<Math.abs(i)){a=i;var s=o/4}else var s=o/(2*Math.PI)*Math.asin(i/a);return a*Math.pow(2,-10*t)*Math.sin((t*r-s)*(2*Math.PI)/o)+i+n},easeInOutElastic:function(e,t,n,i,r){var s=1.70158,o=0,a=i;if(0==t)return n;if(2==(t/=r/2))return n+i;if(o||(o=r*(.3*1.5)),a<Math.abs(i)){a=i;var s=o/4}else var s=o/(2*Math.PI)*Math.asin(i/a);return t<1?-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*r-s)*(2*Math.PI)/o))+n:a*Math.pow(2,-10*(t-=1))*Math.sin((t*r-s)*(2*Math.PI)/o)*.5+i+n},easeInBack:function(e,t,n,i,r,s){return void 0==s&&(s=1.70158),i*(t/=r)*t*((s+1)*t-s)+n},easeOutBack:function(e,t,n,i,r,s){return void 0==s&&(s=1.70158),i*((t=t/r-1)*t*((s+1)*t+s)+1)+n},easeInOutBack:function(e,t,n,i,r,s){return void 0==s&&(s=1.70158),(t/=r/2)<1?i/2*(t*t*(((s*=1.525)+1)*t-s))+n:i/2*((t-=2)*t*(((s*=1.525)+1)*t+s)+2)+n},easeInBounce:function(e,t,n,i,r){return i-jQuery.easing.easeOutBounce(e,r-t,0,i,r)+n},easeOutBounce:function(e,t,n,i,r){return(t/=r)<1/2.75?i*(7.5625*t*t)+n:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+n:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+n:i*(7.5625*(t-=2.625/2.75)*t+.984375)+n},easeInOutBounce:function(e,t,n,i,r){return t<r/2?.5*jQuery.easing.easeInBounce(e,2*t,0,i,r)+n:.5*jQuery.easing.easeOutBounce(e,2*t-r,0,i,r)+.5*i+n}})},378:function(e,t){!function(e){e.fn.highlightRegex=function(t){return void 0==t||""==t.source?e(this).find("span.highlight").each(function(){e(this).replaceWith(e(this).text()),e(this).parent().each(function(){node=e(this).get(0),node.normalize&&node.normalize()})}):e(this).each(function(){elt=e(this).get(0),elt.normalize(),e.each(e.makeArray(elt.childNodes),function(n,i){if(3==i.nodeType)for(var r=i;(pos=r.data.search(t))>=0&&(match=r.data.slice(pos).match(t)[0],0!=match.length);){var s=document.createElement("span");s.className="highlight";var o=r.splitText(pos),r=o.splitText(match.length),a=o.cloneNode(!0);s.appendChild(a),r.parentNode.replaceChild(s,o)}else e(i).highlightRegex(t)})}),e(this)}}(jQuery)},379:function(e,t){!function(e){function t(t){function i(e){return e===!0?function(e){return e}:"string"==typeof e&&(e=r(e.split("")))||"function"==typeof e?function(t){return e(encodeURIComponent(t))}:encodeURIComponent}function r(t){var n=new RegExp(e.map(t,encodeURIComponent).join("|"),"ig");return function(e){return e.replace(n,decodeURIComponent)}}t=e.extend({unescape:!1},t||{}),n.encoder=i(t.unescape)}var n={put:function(e,t){(t||window).location.hash=this.encoder(e)},get:function(e){return(e||window).location.toString().split("#",2)[1]||""},encoder:encodeURIComponent};e.history={callback:void 0,type:void 0,check:function(){this.callback(n.get())},load:function(e){n.put(e)},init:function(e,n){t(n),this.callback=e,this._options=n,this._init()},_init:function(){this.callback(n.get()),e(window).bind("hashchange",this.check.bind(this))},_options:{}}}(jQuery)},381:function(e,t,n){var i,r,s;!function(n,o){r=[],i=o,s="function"==typeof i?i.apply(t,r):i,!(void 0!==s&&(e.exports=s))}(this,function(){"use strict";var e=function(e){return e.replace(/\s+/g," ").split(" ")},t=function(t,n){return null===t||void 0===t?t="":("string"!=typeof t||!t instanceof String)&&(t=t.toString()),"words"===n?e(t):t},n=function(e,t){return 1-e/t},i=function(e,t){if(0===e.length)return t.length;if(0===t.length)return e.length;var n,i,r,s=[],o=[];for(n=0;n<t.length+1;++n)s[n]=n;for(n=0;n<e.length;n++){for(o[0]=n+1,i=0;i<t.length;i++)r=e[n]===t[i]?0:1,o[i+1]=Math.min(o[i]+1,s[i+1]+1,s[i]+r);for(i=0;i<o.length;i++)s[i]=o[i]}return o[t.length]},r=function(e){e=e||{},this.opts={compare:e.compare||"strings"}};return r.fn=r.prototype,r.fn.prepareInput=t,r.fn.distance=function(e,n){var e=t(e,this.opts.compare),n=t(n,this.opts.compare);return i(e,n)},r.fn.similarity=function(e,r){var e=t(e,this.opts.compare),r=t(r,this.opts.compare);return n(i(e,r),Math.max(e.length,r.length))},r})}});