webpackJsonp([8],{0:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}s(291);var a=s(3),o=n(a),r=s(1),i=n(r),l=s(12),u=n(l),d=s(10),p=s(183),c=n(p),f=s(198),h=n(f),m=s(189),y=n(m),v=s(193),g=n(v),b=s(182),P=n(b);window.PTL=window.PTL||{};var T={user:h.default,language:y.default,project:g.default};PTL.userAdmin={init:function(){(0,o.default)(document).ready(function(){var e=function(e){var t={results:o.default.map(e.items.results,function(e){var t={id:e.id,text:e.text};return t})};return t.pagination={more:e.items.more_results},t};(0,o.default)(".js-s2-new-members").on("s2-process-data",function(e,t){return PTL.s2.processData(t)}),(0,o.default)(".js-s2-new-members").on("s2-process-results",function(t,s){return e(s)}),(0,o.default)(".js-s2-new-members").on("s2-template-result",function(e,t){return PTL.s2.templateResult(t)})})}},PTL.admin={init:function(e){if(!T.hasOwnProperty(e.itemType))throw new Error("Invalid `itemType`.");u.default.render(i.default.createElement(c.default,{adminModule:T[e.itemType],appRoot:e.appRoot,formChoices:e.formChoices||{},router:new P.default}),(0,d.q)(".js-admin-app"))}}},9:function(e,t,s){var n,a;/*!
	  Copyright (c) 2016 Jed Watson.
	  Licensed under the MIT License (MIT), see
	  http://jedwatson.github.io/classnames
	*/
!function(){"use strict";function s(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n))e.push(s.apply(null,n));else if("object"===a)for(var r in n)o.call(n,r)&&n[r]&&e.push(r)}}return e.join(" ")}var o={}.hasOwnProperty;"undefined"!=typeof e&&e.exports?e.exports=s:(n=[],a=function(){return s}.apply(t,n),!(void 0!==a&&(e.exports=a)))}()},10:function(e,t){"use strict";function s(e){return document.querySelector(e)}function n(e){var t=document.querySelectorAll(e);return Array.prototype.slice.call(t)}Object.defineProperty(t,"__esModule",{value:!0}),t.q=s,t.qAll=n},16:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},o=s(1),r=n(o),i=s(34),l=n(i),u=s(36),d=n(u),p=s(35),c=n(p),f=r.default.createClass({displayName:"FormElement",propTypes:{type:r.default.PropTypes.string,label:r.default.PropTypes.string.isRequired,multiple:r.default.PropTypes.bool,name:r.default.PropTypes.string.isRequired,handleChange:r.default.PropTypes.func.isRequired,value:r.default.PropTypes.oneOfType([r.default.PropTypes.array,r.default.PropTypes.bool,r.default.PropTypes.number,r.default.PropTypes.string,r.default.PropTypes.array]).isRequired,help:r.default.PropTypes.string,errors:r.default.PropTypes.array},getDefaultProps:function(){return{type:"text"}},render:function(){var e=this.props.errors,t="id_"+this.props.name,s=this.props.help,n={text:d.default,email:d.default,password:d.default,textarea:d.default,checkbox:l.default,radio:l.default,select:c.default}[this.props.type];return r.default.createElement("div",{className:"field-wrapper"},r.default.createElement("label",{htmlFor:t},this.props.label),r.default.createElement(n,a({id:t},this.props)),e&&r.default.createElement("ul",{className:"errorlist"},e.map(function(e,t){return r.default.createElement("li",{key:t},e)})),s&&r.default.createElement("span",{className:"helptext"},s))}});t.default=f},18:function(e,t,s){/*!
	  Copyright (c) 2015 Jed Watson.
	  Licensed under the MIT License (MIT), see
	  http://jedwatson.github.io/classnames
	*/
function n(){for(var e,t="",s=0;s<arguments.length;s++)if(e=arguments[s])if("string"==typeof e||"number"==typeof e)t+=" "+e;else if("[object Array]"===Object.prototype.toString.call(e))t+=" "+n.apply(null,e);else if("object"==typeof e)for(var a in e)e.hasOwnProperty(a)&&e[a]&&(t+=" "+a);return t.substr(1)}var a,o;"undefined"!=typeof e&&e.exports&&(e.exports=n),a=[],o=function(){return n}.apply(t,a),!(void 0!==o&&(e.exports=o))},23:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.FormMixin=void 0;var a=s(6),o=n(a),r=s(56),i=n(r),l=t.FormMixin={mixins:[i.default],getInitialState:function(){return{isDirty:!1}},handleChange:function(e,t){var s=o.default.extend({},this.state.formData);s[e]=t;var n=!o.default.isEqual(s,this.initialData);this.setState({isDirty:n,formData:s})},handleFormSuccess:function(){this.clearValidation(),this.initialData=o.default.extend({},this.state.formData),this.setState({isDirty:!1}),this.handleSuccess&&this.handleSuccess(this.getResource())},handleFormError:function(e){this.validateResponse(e),this.handleError&&this.handleError(e)}};t.default=l},27:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},o=s(32),r=n(o),i=s(1),l=n(i),u=l.default.createClass({displayName:"AutosizeTextarea",componentDidMount:function(){(0,r.default)(this.refs.textarea)},componentDidUpdate:function(){var e=this;setTimeout(function(){return r.default.update(e.refs.textarea)},0)},componentWillUnmount:function(){r.default.destroy(this.refs.textarea)},render:function(){return l.default.createElement("textarea",a({ref:"textarea"},this.props))}});t.default=u},32:function(e,t,s){var n,a,o;/*!
		Autosize 3.0.21
		license: MIT
		http://www.jacklmoore.com/autosize
	*/
!function(s,r){a=[t,e],n=r,o="function"==typeof n?n.apply(t,a):n,!(void 0!==o&&(e.exports=o))}(this,function(e,t){"use strict";function s(e){function t(){var t=window.getComputedStyle(e,null);"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),l="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(l)&&(l=0),i()}function s(t){var s=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=s,e.style.overflowY=t}function n(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 a(){var t=e.style.height,s=n(e),a=document.documentElement&&document.documentElement.scrollTop;e.style.height="auto";var o=e.scrollHeight+l;return 0===e.scrollHeight?void(e.style.height=t):(e.style.height=o+"px",u=e.clientWidth,s.forEach(function(e){e.node.scrollTop=e.scrollTop}),void(a&&(document.documentElement.scrollTop=a)))}function i(){a();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),o="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(o!==t?"hidden"===n.overflowY&&(s("scroll"),a(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(s("hidden"),a(),o="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),d!==o){d=o;var i=r("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!o.has(e)){var l=null,u=e.clientWidth,d=null,p=function(){e.clientWidth!==u&&i()},c=function(t){window.removeEventListener("resize",p,!1),e.removeEventListener("input",i,!1),e.removeEventListener("keyup",i,!1),e.removeEventListener("autosize:destroy",c,!1),e.removeEventListener("autosize:update",i,!1),Object.keys(t).forEach(function(s){e.style[s]=t[s]}),o.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",c,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",i,!1),window.addEventListener("resize",p,!1),e.addEventListener("input",i,!1),e.addEventListener("autosize:update",i,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",o.set(e,{destroy:c,update:i}),t()}}function n(e){var t=o.get(e);t&&t.destroy()}function a(e){var t=o.get(e);t&&t.update()}var o="function"==typeof Map?new Map:function(){var e=[],t=[];return{has:function(t){return e.indexOf(t)>-1},get:function(s){return t[e.indexOf(s)]},set:function(s,n){e.indexOf(s)===-1&&(e.push(s),t.push(n))},delete:function(s){var n=e.indexOf(s);n>-1&&(e.splice(n,1),t.splice(n,1))}}}(),r=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){r=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var i=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(i=function(e){return e},i.destroy=function(e){return e},i.update=function(e){return e}):(i=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return s(e,t)}),e},i.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],n),e},i.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.exports=i})},34:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},o=s(1),r=n(o),i=r.default.createClass({displayName:"FormCheckedInput",propTypes:{handleChange:r.default.PropTypes.func.isRequired,value:r.default.PropTypes.bool.isRequired},handleChange:function(e){this.props.handleChange(e.target.name,e.target.checked)},render:function(){return r.default.createElement("input",a({checked:this.props.value,onChange:this.handleChange},this.props))}});t.default=i},35:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},o=s(1),r=n(o),i=s(41),l=n(i),u=r.default.createClass({displayName:"FormSelectInput",propTypes:{handleChange:r.default.PropTypes.func.isRequired,multiple:r.default.PropTypes.bool,name:r.default.PropTypes.string.isRequired,options:r.default.PropTypes.array.isRequired,value:r.default.PropTypes.oneOfType([r.default.PropTypes.array,r.default.PropTypes.number,r.default.PropTypes.string,r.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 r.default.createElement(l.default,a({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=u},36:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},o=s(1),r=n(o),i=s(27),l=n(i),u=r.default.createClass({displayName:"FormValueInput",propTypes:{handleChange:r.default.PropTypes.func.isRequired,autosize:r.default.PropTypes.bool,type:r.default.PropTypes.string,value:r.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?r.default.createElement(l.default,a({onChange:this.handleChange},this.props)):r.default.createElement("textarea",a({onChange:this.handleChange},this.props)):r.default.createElement("input",a({onChange:this.handleChange},this.props))}});t.default=u},39:function(e,t,s){"use strict";var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},a=s(1),o={position:"absolute",visibility:"hidden",height:0,width:0,overflow:"scroll",whiteSpace:"pre"},r=("undefined"!=typeof window?function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}().bind(window):void 0,a.createClass({displayName:"AutosizeInput",propTypes:{value:a.PropTypes.any,defaultValue:a.PropTypes.any,onChange:a.PropTypes.func,style:a.PropTypes.object,className:a.PropTypes.string,minWidth:a.PropTypes.oneOfType([a.PropTypes.number,a.PropTypes.string]),inputStyle:a.PropTypes.object,inputClassName:a.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 s=this.refs.placeholderSizer;s.style.fontSize=e.fontSize,s.style.fontFamily=e.fontFamily,s.style.fontWeight=e.fontWeight,s.style.fontStyle=e.fontStyle,s.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 s=n({},this.props.inputStyle);s.width=this.state.inputWidth+"px",s.boxSizing="content-box";var r=this.props.placeholder?a.createElement("div",{ref:"placeholderSizer",style:o},this.props.placeholder):null;return a.createElement("div",{className:this.props.className,style:t},a.createElement("input",n({},this.props,{ref:"input",className:this.props.inputClassName,style:s})),a.createElement("div",{ref:"sizer",style:o},e),r)}}));e.exports=r},40:function(e,t,s){"use strict";var n=s(1),a=s(9),o=n.createClass({displayName:"Option",propTypes:{addLabelText:n.PropTypes.string,className:n.PropTypes.string,mouseDown:n.PropTypes.func,mouseEnter:n.PropTypes.func,mouseLeave:n.PropTypes.func,option:n.PropTypes.object.isRequired,renderFunc:n.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),s=a(this.props.className,e.className);return e.disabled?n.createElement("div",{className:s,onMouseDown:this.blockEvent,onClick:this.blockEvent},t):n.createElement("div",{className:s,style:e.style,onMouseDown:this.handleMouseDown,onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,onClick:this.handleMouseDown,title:e.title},t)}});e.exports=o},41:function(e,t,s){"use strict";function n(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},o=s(1),r=s(12),i=s(39),l=s(9),u=s(43),d=s(42),p=s(40),c=0,f=o.createClass({displayName:"Select",propTypes:{addLabelText:o.PropTypes.string,allowCreate:o.PropTypes.bool,asyncOptions:o.PropTypes.func,autoload:o.PropTypes.bool,backspaceRemoves:o.PropTypes.bool,cacheAsyncResults:o.PropTypes.bool,className:o.PropTypes.string,clearAllText:o.PropTypes.string,clearValueText:o.PropTypes.string,clearable:o.PropTypes.bool,delimiter:o.PropTypes.string,disabled:o.PropTypes.bool,filterOption:o.PropTypes.func,filterOptions:o.PropTypes.func,ignoreCase:o.PropTypes.bool,inputProps:o.PropTypes.object,isLoading:o.PropTypes.bool,labelKey:o.PropTypes.string,matchPos:o.PropTypes.string,matchProp:o.PropTypes.string,multi:o.PropTypes.bool,name:o.PropTypes.string,newOptionCreator:o.PropTypes.func,noResultsText:o.PropTypes.string,onBlur:o.PropTypes.func,onChange:o.PropTypes.func,onFocus:o.PropTypes.func,onInputChange:o.PropTypes.func,onOptionLabelClick:o.PropTypes.func,optionComponent:o.PropTypes.func,optionRenderer:o.PropTypes.func,options:o.PropTypes.array,placeholder:o.PropTypes.string,searchable:o.PropTypes.bool,searchingText:o.PropTypes.string,searchPromptText:o.PropTypes.string,singleValueComponent:o.PropTypes.func,value:o.PropTypes.any,valueComponent:o.PropTypes.func,valueKey:o.PropTypes.string,valueRenderer:o.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:p,options:void 0,placeholder:"Select...",searchable:!0,searchingText:"Searching...",searchPromptText:"Type to search",singleValueComponent:d,value:void 0,valueComponent:u,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 s=r.findDOMNode(e.refs.selectMenuContainer),n=r.findDOMNode(e.refs.control),a=e.clickedOutsideElement(s,t),o=e.clickedOutsideElement(n,t);a&&o&&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,s=!1;if(JSON.stringify(e.options)!==JSON.stringify(this.props.options)&&(s=!0,this.setState({options:e.options,filteredOptions:this.filterOptions(e.options)})),e.value!==this.state.value||e.placeholder!==this.props.placeholder||s){var n=function(s){t.setState(t.getStateFromValue(e.value,s&&s.options||e.options,e.placeholder))};this.props.asyncOptions?this.loadAsyncOptions(e.value,{},n):n()}},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=r.findDOMNode(this.refs.focused),s=r.findDOMNode(this.refs.menu),n=t.getBoundingClientRect(),a=s.getBoundingClientRect();(n.bottom>a.bottom||n.top<a.top)&&(s.scrollTop=t.offsetTop+t.clientHeight-s.offsetHeight)}this._focusedOptionReveal=!1}},focus:function(){this.getInputNode().focus()},clickedOutsideElement:function(e,t){for(var s=t.target?t.target:t.srcElement;null!=s;){if(s===e)return!1;s=s.offsetParent}return!0},getStateFromValue:function(e,t,s){var n=this;t||(t=this.state.options),s||(s=this.props.placeholder),this._optionsFilterString="";var a,o=this.initValuesArray(e,t),r=this.filterOptions(t,o),i=null;return!this.props.multi&&o.length?(a=o[0],i=o[0][this.props.valueKey]):(a=this.getFirstFocusableOption(r),i=o.map(function(e){return e[n.props.valueKey]}).join(this.props.delimiter)),{value:i,values:o,inputValue:"",filteredOptions:r,placeholder:!this.props.multi&&o.length?o[0][this.props.labelKey]:s,focusedOption:a}},getFirstFocusableOption:function(e){for(var t=0;t<e.length;++t)if(!e[t].disabled)return e[t]},initValuesArray:function(e,t){var s=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 a;for(var o in t)if(t.hasOwnProperty(o)&&t[o]&&(t[o][s.props.valueKey]===e||"number"==typeof t[o][s.props.valueKey]&&t[o][s.props.valueKey].toString()===e))return t[o];return a={},n(a,s.props.valueKey,e),n(a,s.props.labelKey,e),a}return e})},setValue:function(e,t){(t||void 0===t)&&(this._focusAfterUpdate=!0);var s=this.getStateFromValue(e);s.isOpen=!1,this.fireChangeEvent(s),this.setState(s)},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:r.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,s=this.state.isOpen||this._openAfterFocus;this.setState({isFocused:!0,isOpen:s},function(){s?t._bindCloseMenuIfClickedOutside():t._unbindCloseMenuIfClickedOutside()}),this._openAfterFocus=!1,this.props.onFocus&&this.props.onFocus(e)},handleInputBlur:function(e){var t=this,s=r.findDOMNode(this.refs.menu);document.activeElement.isEqualNode(s)||(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,s){void 0===e&&(e="");var n=this,a=this._currentRequestId=c++;if(this.props.cacheAsyncResults)for(var o=0;o<=e.length;o++){var r=e.slice(0,o);if(this._optionsCache[r]&&(e===r||this._optionsCache[r].complete)){var i=this._optionsCache[r].options,l=this.filterOptions(i),u={options:i,filteredOptions:l,focusedOption:this._getNewFocusedOption(l)};for(var d in t)t.hasOwnProperty(d)&&(u[d]=t[d]);return this.setState(u),void(s&&s.call(this,u))}}var p=function(o,r){if(o)throw o;if(n.props.cacheAsyncResults&&(n._optionsCache[e]=r),a===n._currentRequestId){var i=n.filterOptions(r.options),l={options:r.options,filteredOptions:i,focusedOption:n._getNewFocusedOption(i)};for(var u in t)t.hasOwnProperty(u)&&(l[u]=t[u]);n.setState(l),s&&s.call(n,l)}},f=this.props.asyncOptions(e,p);f&&"function"==typeof f.then&&f.then(function(e){p(null,e)},function(e){p(e)})},filterOptions:function(e,t){var s=this,n=this._optionsFilterString,a=(t||this.state.values).map(function(e){return e[s.props.valueKey]});if(this.props.filterOptions)return this.props.filterOptions.call(this,e,n,a);var o=function(e){if(this.props.multi&&a.indexOf(e[this.props.valueKey])>-1)return!1;if(this.props.filterOption)return this.props.filterOption.call(this,e,n);var t=String(e[this.props.valueKey]),s=String(e[this.props.labelKey]);return this.props.ignoreCase&&(t=t.toLowerCase(),s=s.toLowerCase(),n=n.toLowerCase()),n&&"start"!==this.props.matchPos?"label"!==this.props.matchProp&&t.indexOf(n)>=0||"value"!==this.props.matchProp&&s.indexOf(n)>=0:"label"!==this.props.matchProp&&t.substr(0,n.length)===n||"value"!==this.props.matchProp&&s.substr(0,n.length)===n};return(e||[]).filter(o,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 s=-1,n=0;n<t.length;n++)if(this.state.focusedOption===t[n]){s=n;break}var a=t[0];"next"===e&&s>-1&&s<t.length-1?a=t[s+1]:"previous"===e&&(a=s>0?t[s-1]:t[t.length-1]),this.setState({focusedOption:a})}},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 s=this.state.filteredOptions;if(this.props.allowCreate&&this.state.inputValue.trim()){var n=this.state.inputValue;s=s.slice();var a=this.props.newOptionCreator?this.props.newOptionCreator(n):{value:n,label:n,create:!0};s.unshift(a)}var r=Object.keys(s).map(function(n){var a=s[n],r=this.state.value===a[this.props.valueKey],i=e===a[this.props.valueKey],u=l({"Select-option":!0,"is-selected":r,"is-focused":i,"is-disabled":a.disabled}),d=i?"focused":null,p=o.createElement(this.props.optionComponent,{key:"option-"+a[this.props.valueKey],className:u,renderFunc:t,mouseDown:this.selectValue,mouseEnter:this.focusOption,mouseLeave:this.unfocusOption,addLabelText:this.props.addLabelText,option:a,ref:d});return p},this);if(r.length)return r;var i,u;return this.isLoading()?(u="Select-searching",i=this.props.searchingText):this.state.inputValue||!this.props.asyncOptions?(u="Select-noresults",i=this.props.noResultsText):(u="Select-search-prompt",i=this.props.searchPromptText),o.createElement("div",{className:u},i)},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=l("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 s=this.props.valueRenderer||this.renderOptionLabel,n=this.handleOptionLabelClick.bind(this,e),a=this.removeValue.bind(this,e),r=o.createElement(this.props.valueComponent,{key:e[this.props.valueKey],option:e,renderer:s,optionLabelClick:!!this.props.onOptionLabelClick,onOptionLabelClick:n,onRemove:a,disabled:this.props.disabled});t.push(r)},this),!(this.state.inputValue||this.props.multi&&t.length)){var s=this.state.values[0]||null;if(this.props.valueRenderer&&this.state.values.length)t.push(o.createElement(u,{key:0,option:s,renderer:this.props.valueRenderer,disabled:this.props.disabled}));else{var n=o.createElement(this.props.singleValueComponent,{key:"placeholder",value:s,placeholder:this.state.placeholder});t.push(n)}}var r,d,p=this.isLoading()?o.createElement("span",{className:"Select-loading-zone","aria-hidden":"true"},o.createElement("span",{className:"Select-loading"})):null,c=this.props.clearable&&this.state.value&&!this.props.disabled&&!this.isLoading()?o.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},o.createElement("span",{className:"Select-clear",dangerouslySetInnerHTML:{__html:"&times;"}})):null,f=o.createElement("span",{className:"Select-arrow-zone",onMouseDown:this.handleMouseDownOnArrow},o.createElement("span",{className:"Select-arrow",onMouseDown:this.handleMouseDownOnArrow}));this.state.isOpen&&(d={ref:"menu",className:"Select-menu",onMouseDown:this.handleMouseDownOnMenu},r=o.createElement("div",{ref:"selectMenuContainer",className:"Select-menu-outer"},o.createElement("div",d,this.buildMenu())));var h,m={ref:"input",className:"Select-input "+(this.props.inputProps.className||""),tabIndex:this.props.tabIndex||0,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur};for(var y in this.props.inputProps)this.props.inputProps.hasOwnProperty(y)&&"className"!==y&&(m[y]=this.props.inputProps[y]);return this.props.disabled?this.props.multi&&this.state.values.length||(h=o.createElement("div",{className:"Select-input"}," ")):h=this.props.searchable?o.createElement(i,a({value:this.state.inputValue,onChange:this.handleInputChange,minWidth:"5"},m)):o.createElement("div",m," "),o.createElement("div",{ref:"wrapper",className:e},o.createElement("input",{type:"hidden",ref:"value",name:this.props.name,value:this.state.value,disabled:this.props.disabled}),o.createElement("div",{className:"Select-control",ref:"control",onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchEnd:this.handleMouseDown},t,h,p,c,f),r)}});e.exports=f},42:function(e,t,s){"use strict";var n=s(1),a=s(9),o=n.createClass({displayName:"SingleValue",propTypes:{placeholder:n.PropTypes.string,value:n.PropTypes.object},render:function(){var e=a("Select-placeholder",this.props.value&&this.props.value.className);return n.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=o},43:function(e,t,s){"use strict";var n=s(1),a=s(9),o=n.createClass({displayName:"Value",propTypes:{disabled:n.PropTypes.bool,onOptionLabelClick:n.PropTypes.func,onRemove:n.PropTypes.func,option:n.PropTypes.object.isRequired,optionLabelClick:n.PropTypes.bool,renderer:n.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=n.createElement("a",{className:a("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)),n.createElement("div",{className:a("Select-item",this.props.option.className),style:this.props.option.style,title:this.props.option.title},n.createElement("span",{className:"Select-item-icon",onMouseDown:this.blockEvent,onClick:this.handleOnRemove,onTouchEnd:this.handleOnRemove},"×"),n.createElement("span",{className:"Select-item-label"},e))):n.createElement("div",{className:a("Select-value",this.props.option.className),style:this.props.option.style,title:this.props.option.title},e)}});e.exports=o},55:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(15),o=n(a),r=s(6),i=n(r),l=o.default.Model.extend({defaults:{text:"",level:"info",language:"en"}}),u=o.default.Collection.extend({model:l}),d=o.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}}),p=o.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 d({model:e});this.subViews.push(t),this.$el.prepend(t.render().el)},remove:function(e){var t=i.default.find(this.subViews,function(t){return t.model===e});this.subViews=(0,i.default)(this.subViews).without(t),t.$el.fadeOut(3500,function(){t.remove()})}}),c=new u,f=void 0,h={show:function(e){f||(f=new p({collection:c}));var t=new l(e);c.add(t),window.setTimeout(function(){c.remove(t)},2e3)}};t.default=h},56:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.FormValidationMixin=void 0;var a=s(1),o=n(a),r=t.FormValidationMixin={getInitialState:function(){return{errors:{}}},clearValidation:function(){this.setState({errors:{}})},validateResponse:function(e){var t=JSON.parse(e.responseText);this.setState({errors:t.errors})},renderSingleError:function(e,t){return o.default.createElement("li",{key:t},e)},renderAllFormErrors:function(){var e=this.state.errors;return e.hasOwnProperty("__all__")?o.default.createElement("ul",{className:"errorlist errorlist-all"},e.__all__.map(this.renderSingleError)):null}};t.default=r},57:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ModelFormMixin=void 0;var a=s(1),o=n(a),r=s(6),i=n(r),l=s(91),u=n(l),d=s(23),p=n(d),c=t.ModelFormMixin={mixins:[u.default,p.default],propTypes:{model:o.default.PropTypes.object.isRequired},getInitialState:function(){return this.initialData=i.default.pick(this.getResource().toJSON(),this.fields),{formData:i.default.extend({},this.initialData)}},componentDidMount:function(){if(i.default.isUndefined(this.fields))throw new Error("To use ModelFormMixin, you must define a `fields` property.");if(!i.default.isArray(this.fields))throw new Error("The `fields` property must be an array.")},getResource:function(){return this.props.model},handleFormSubmit:function(e){e.preventDefault(),this.getResource().save(this.state.formData,{wait:!0}).done(this.handleFormSuccess).error(this.handleFormError)}};t.default=c},58:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(6),o=n(a),r={initialize:function(){this.count=0,
this.page=0,this.keywords="",this.on("add",this.incrCount),this.on("remove",this.decrCount)},parse:function(e){return this.count=e.count,e.models},comparator:"-id",incrCount:function(){this.count++},decrCount:function(){this.count--},fetchNextPage:function(e){var t=this,s=this.page+1,n=1===s?{}:{p:s},a=""===this.keywords?{}:{q:this.keywords},r=o.default.extend({},n,a),i={remove:!1,silent:!0,data:r};return o.default.defaults(i,e),this.fetch(i).done(function(){t.page=s})},search:function(e){var t={};return e!==this.keywords&&(this.setSearch(e),t.reset=!0),this.fetchNextPage(t)},setSearch:function(e){this.keywords=e,this.page=0}};t.default=r},81:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=o.default.createClass({displayName:"ItemDelete",propTypes:{item:o.default.PropTypes.object.isRequired,helpText:o.default.PropTypes.string,onDelete:o.default.PropTypes.func.isRequired},getInitialState:function(){return{buttonDisabled:!0}},toggleButton:function(){this.setState({buttonDisabled:!this.state.buttonDisabled})},handleClick:function(e){e.preventDefault(),this.props.item.destroy().then(this.props.onDelete)},render:function(){return o.default.createElement("div",{className:"item-delete"},o.default.createElement("input",{type:"checkbox",checked:!this.state.buttonDisabled,onChange:this.toggleButton}),o.default.createElement("button",{className:"btn btn-danger",disabled:this.state.buttonDisabled,onClick:this.handleClick},gettext("Delete")),this.props.helpText&&o.default.createElement("span",{className:"helptext"},this.props.helpText))}});t.default=r},82:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(18),o=n(a),r=s(1),i=n(r),l=s(184),u=n(l),d=s(194),p=n(d),c=i.default.createClass({displayName:"Search",propTypes:{fields:i.default.PropTypes.array.isRequired,onSearch:i.default.PropTypes.func.isRequired,onSelectItem:i.default.PropTypes.func.isRequired,items:i.default.PropTypes.object.isRequired,selectedItem:i.default.PropTypes.object,searchLabel:i.default.PropTypes.string.isRequired,searchPlaceholder:i.default.PropTypes.string.isRequired,resultsCaption:i.default.PropTypes.string.isRequired,searchQuery:i.default.PropTypes.string.isRequired},getInitialState:function(){return{isLoading:!1}},onResultsFetched:function(){this.setState({isLoading:!1})},fetchResults:function(e){this.setState({isLoading:!0}),this.props.onSearch(e).then(this.onResultsFetched)},loadMore:function(){this.fetchResults(this.props.searchQuery)},render:function(){var e=this.state.isLoading,t=this.props.items,s=void 0;t.count>0&&t.length<t.count&&(s=i.default.createElement("button",{className:"btn",onClick:this.loadMore},gettext("Load More")));var n=(0,o.default)({"search-results":!0,loading:e});return i.default.createElement("div",{className:"search"},i.default.createElement("div",{className:"hd"},i.default.createElement("h2",null,this.props.searchLabel)),i.default.createElement("div",{className:"bd"},i.default.createElement("div",{className:"search-box"},i.default.createElement(p.default,{onSearch:this.props.onSearch,placeholder:this.props.searchPlaceholder,searchQuery:this.props.searchQuery})),i.default.createElement("div",{className:n},e&&0===this.props.items.length?i.default.createElement("div",null,gettext("Loading...")):i.default.createElement("div",null,i.default.createElement(u.default,{fields:this.props.fields,items:t,resultsCaption:this.props.resultsCaption,selectedItem:this.props.selectedItem,onSelectItem:this.props.onSelectItem}),s))))}});t.default=c},91:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s={componentDidMount:function(){this._boundForceUpdate=this.forceUpdate.bind(this,null),this.getResource().on("all",this._boundForceUpdate,this)},componentWillUnmount:function(){this.getResource().off("all",this._boundForceUpdate)}};t.default=s},92:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.UserSet=t.User=void 0;var a=s(15),o=n(a),r=s(6),i=n(r),u=s(58),d=n(u),p=["nobody","default","system"],c=t.User=o.default.Model.extend({defaults:{username:"",is_active:!0,password:"",full_name:"",email:"",is_superuser:!1,twitter:"",linkedin:"",website:"",bio:""},initialize:function(e,t){t&&t.urlRoot&&(this.urlRoot=t.urlRoot)},urlRoot:l("/xhr/admin/users/"),getProfileUrl:function(){return l("/user/"+this.get("username")+"/")},getSettingsUrl:function(){return l("/user/"+this.get("username")+"/settings/")},isMeta:function(){return p.indexOf(this.get("username"))!==-1}});t.UserSet=o.default.Collection.extend(i.default.extend({},d.default,{model:c,url:l("/xhr/admin/users/")}))},121:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(16),i=n(r),l=s(57),u=n(l),d=s(81),p=n(d),c=o.default.createClass({displayName:"LanguageForm",propTypes:{collection:o.default.PropTypes.object.isRequired,onDelete:o.default.PropTypes.func,onSuccess:o.default.PropTypes.func.isRequired},mixins:[u.default],fields:["code","fullname","specialchars","nplurals","pluralequation"],handleSuccess:function(e){this.props.onSuccess(e)},render:function(){var e=this.getResource(),t=this.state.errors,s=this.state.formData;return o.default.createElement("form",{method:"post",id:"item-form",onSubmit:this.handleFormSubmit},o.default.createElement("div",{className:"fields"},o.default.createElement(i.default,{autoFocus:!0,disabled:e.hasOwnProperty("id"),label:gettext("Code"),handleChange:this.handleChange,name:"code",errors:t.code,value:s.code}),o.default.createElement(i.default,{label:gettext("Full Name"),handleChange:this.handleChange,name:"fullname",errors:t.fullname,value:s.fullname}),o.default.createElement(i.default,{label:gettext("Special Characters"),handleChange:this.handleChange,name:"specialchars",errors:t.specialchars,value:s.specialchars}),o.default.createElement(i.default,{type:"select",clearable:!1,options:e.getFieldChoices("nplurals"),label:gettext("Number of Plurals"),handleChange:this.handleChange,name:"nplurals",errors:t.nplurals,value:s.nplurals}),o.default.createElement(i.default,{label:gettext("Plural Equation"),handleChange:this.handleChange,name:"pluralequation",errors:t.pluralequation,value:s.pluralequation})),o.default.createElement("div",{className:"buttons"},o.default.createElement("input",{type:"submit",className:"btn btn-primary",disabled:!this.state.isDirty,value:gettext("Save")}),e.id&&o.default.createElement("ul",{className:"action-links"},o.default.createElement("li",null,o.default.createElement("a",{href:e.getAbsoluteUrl()},gettext("Overview"))),o.default.createElement("li",null,o.default.createElement("a",{href:e.getTeamUrl()},gettext("Team"))))),this.props.onDelete&&o.default.createElement("div",null,o.default.createElement("p",{className:"divider"}),o.default.createElement("div",{className:"buttons"},o.default.createElement(p.default,{item:e,onDelete:this.props.onDelete}))))}});t.default=c},122:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(16),i=n(r),l=s(57),u=n(l),d=s(81),p=n(d),c=o.default.createClass({displayName:"ProjectForm",propTypes:{collection:o.default.PropTypes.object.isRequired,onDelete:o.default.PropTypes.func,onSuccess:o.default.PropTypes.func.isRequired},mixins:[u.default],fields:["code","fullname","checkstyle","filetypes","source_language","ignoredfiles","report_email","screenshot_search_prefix","disabled"],handleSuccess:function(e){this.props.onSuccess(e)},render:function(){var e=this.getResource(),t=this.state.errors,s=this.state.formData;return o.default.createElement("form",{method:"post",id:"item-form",onSubmit:this.handleFormSubmit},o.default.createElement("div",{className:"fields"},o.default.createElement(i.default,{autoFocus:!0,disabled:e.hasOwnProperty("id"),label:gettext("Code"),handleChange:this.handleChange,name:"code",errors:t.code,value:s.code}),o.default.createElement(i.default,{label:gettext("Full Name"),handleChange:this.handleChange,name:"fullname",errors:t.fullname,value:s.fullname}),o.default.createElement(i.default,{type:"select",clearable:!1,options:e.getFieldChoices("checkstyle"),label:gettext("Quality Checks"),handleChange:this.handleChange,name:"checkstyle",errors:t.checkstyle,value:s.checkstyle}),o.default.createElement(i.default,{type:"select",multiple:!0,clearable:!1,options:e.getFieldChoices("filetypes"),label:gettext("File types"),handleChange:this.handleChange,name:"filetypes",errors:t.filetypes,value:s.filetypes}),o.default.createElement(i.default,{type:"select",clearable:!1,options:e.getFieldChoices("source_language"),label:gettext("Source Language"),handleChange:this.handleChange,name:"source_language",errors:t.source_language,value:s.source_language}),o.default.createElement(i.default,{label:gettext("Ignore Files"),handleChange:this.handleChange,name:"ignoredfiles",errors:t.ignoredfiles,value:s.ignoredfiles}),o.default.createElement(i.default,{type:"email",label:gettext("String Errors Contact"),handleChange:this.handleChange,name:"report_email",errors:t.report_email,value:s.report_email}),o.default.createElement(i.default,{label:gettext("Screenshot Search Prefix"),handleChange:this.handleChange,name:"screenshot_search_prefix",errors:t.screenshot_search_prefix,value:s.screenshot_search_prefix}),o.default.createElement(i.default,{type:"checkbox",label:gettext("Disabled"),handleChange:this.handleChange,name:"disabled",errors:t.disabled,value:!!s.disabled})),o.default.createElement("div",{className:"buttons"},o.default.createElement("input",{type:"submit",className:"btn btn-primary",disabled:!this.state.isDirty,value:gettext("Save")}),e.id&&o.default.createElement("ul",{className:"action-links"},o.default.createElement("li",null,o.default.createElement("a",{href:e.getAbsoluteUrl()},gettext("Overview"))),o.default.createElement("li",null,o.default.createElement("a",{href:e.getLanguagesUrl()},gettext("Languages"))),o.default.createElement("li",null,o.default.createElement("a",{href:e.getPermissionsUrl()},gettext("Permissions"))),o.default.createElement("li",null,o.default.createElement("a",{href:e.getFSUrl()},gettext("Filesystems"))))),this.props.onDelete&&o.default.createElement("div",null,o.default.createElement("p",{className:"divider"}),o.default.createElement("div",{className:"buttons"},o.default.createElement(p.default,{item:e,onDelete:this.props.onDelete}))))}});t.default=c},123:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(16),i=n(r),l=s(57),u=n(l),d=s(81),p=n(d),c=o.default.createClass({displayName:"UserForm",propTypes:{collection:o.default.PropTypes.object.isRequired,onDelete:o.default.PropTypes.func,onSuccess:o.default.PropTypes.func.isRequired},mixins:[u.default],fields:["username","is_active","password","full_name","email","is_superuser","twitter","linkedin","website","bio"],handleSuccess:function(e){this.props.onSuccess(e)},render:function(){var e=this.getResource(),t=this.state.errors,s=this.state.formData,n=gettext("Note: when deleting a user their contributions to the site, e.g. comments, suggestions and translations, are attributed to the anonymous user (nobody).");return o.default.createElement("form",{method:"post",id:"item-form",autoComplete:"off",onSubmit:this.handleFormSubmit},o.default.createElement("div",{className:"fields"},o.default.createElement(i.default,{autoFocus:!e.isMeta(),readOnly:e.isMeta(),label:gettext("Username"),handleChange:this.handleChange,name:"username",errors:t.username,value:s.username}),!e.isMeta()&&o.default.createElement("div",{className:"no-meta"},o.default.createElement(i.default,{type:"checkbox",label:gettext("Active"),handleChange:this.handleChange,name:"is_active",errors:t.is_active,value:s.is_active}),o.default.createElement(i.default,{type:"password",label:gettext("Password"),placeholder:gettext("Set a new password"),handleChange:this.handleChange,name:"password",errors:t.password,value:s.password})),o.default.createElement(i.default,{autoFocus:e.isMeta(),label:gettext("Full Name"),handleChange:this.handleChange,name:"full_name",errors:t.full_name,value:s.full_name}),o.default.createElement(i.default,{label:gettext("Email"),handleChange:this.handleChange,name:"email",errors:t.email,value:s.email}),!e.isMeta()&&o.default.createElement("div",{className:"no-meta"},o.default.createElement(i.default,{type:"checkbox",label:gettext("Administrator"),handleChange:this.handleChange,name:"is_superuser",errors:t.is_superuser,value:s.is_superuser}),o.default.createElement("p",{className:"divider"}),o.default.createElement(i.default,{label:gettext("Twitter"),handleChange:this.handleChange,placeholder:gettext("Twitter username"),maxLength:"15",name:"twitter",errors:t.twitter,value:s.twitter}),o.default.createElement(i.default,{label:gettext("LinkedIn"),handleChange:this.handleChange,placeholder:gettext("LinkedIn profile URL"),name:"linkedin",errors:t.linkedin,value:s.linkedin}),o.default.createElement(i.default,{label:gettext("Website"),handleChange:this.handleChange,placeholder:gettext("Personal website URL"),name:"website",errors:t.website,value:s.website}),o.default.createElement(i.default,{type:"textarea",label:gettext("Short Bio"),handleChange:this.handleChange,placeholder:gettext("Personal description"),name:"bio",errors:t.bio,value:s.bio}))),o.default.createElement("div",{className:"buttons"},o.default.createElement("input",{type:"submit",className:"btn btn-primary",disabled:!this.state.isDirty,value:gettext("Save")}),e.id&&o.default.createElement("ul",{className:"action-links"},o.default.createElement("li",null,o.default.createElement("a",{href:e.getProfileUrl()},gettext("Public Profile"))),o.default.createElement("li",null,o.default.createElement("a",{href:e.getSettingsUrl()},gettext("Settings"))))),this.props.onDelete&&!e.isMeta()&&o.default.createElement("div",null,o.default.createElement("p",{className:"divider"}),o.default.createElement("div",{className:"buttons"},o.default.createElement(p.default,{item:e,onDelete:this.props.onDelete,helpText:n}))))}});t.default=c},182:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(15),o=n(a),r=o.default.Router.extend({routes:{"?q=:searchQuery":"main","":"main",":id(/)":"edit"}});t.default=r},183:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(15),o=n(a),r=s(3),i=n(r),l=s(1),u=n(l),d=s(6),p=n(d),c=s(55),f=n(c),h=u.default.createClass({displayName:"AdminController",propTypes:{adminModule:u.default.PropTypes.object.isRequired,appRoot:u.default.PropTypes.string.isRequired,formChoices:u.default.PropTypes.object.isRequired,router:u.default.PropTypes.object.isRequired},getInitialState:function(){return{items:new this.props.adminModule.Collection,selectedItem:null,searchQuery:"",view:"edit"}},componentWillMount:function(){this.setupRoutes(this.props.router),o.default.history.start({pushState:!0,root:this.props.appRoot})},componentWillUpdate:function(e,t){t.searchQuery===this.state.searchQuery&&t.selectedItem===this.state.selectedItem||this.handleURL(t)},setupRoutes:function(e){var t=this;e.on("route:main",function(e){var s=e;void 0!==e&&null!==e||(s=""),t.handleSearch(s)}),e.on("route:edit",function(e){t.handleSelectItem(e)})},handleSearch:function(e,t){var s=this,n=t||{};return e!==this.state.searchQuery&&(n.searchQuery=e,n.selectedItem=null),this.state.items.search(e).then(function(){n.items=s.state.items,s.setState(n)})},handleSelectItem:function(e){var t=this,s=this.state.items.get(e);if(s)this.setState({selectedItem:s,view:"edit"});else{var n=this.state.items;n.search("").then(function(){var s=i.default.Deferred(),a=n.get(e);return void 0!==a?s.resolve(a):(a=new t.props.adminModule.Model({id:e}),a.fetch({success:function(){s.resolve(a)}})),s.promise()}).then(function(e){n.unshift(e,{merge:!0}),t.setState({items:n,selectedItem:e,view:"edit"})})}},handleAdd:function(){this.setState({selectedItem:null,view:"add"})},handleCancel:function(){this.setState({selectedItem:null,view:"edit"})},handleSave:function(e){var t=this.state.items;t.unshift(e,{merge:!0}),t.move(e,0),this.setState({items:t,selectedItem:e,view:"edit"}),f.default.show({text:gettext("Saved successfully."),level:"success"})},handleDelete:function(){this.setState({selectedItem:null}),f.default.show({text:gettext("Deleted successfully."),level:"danger"})},handleURL:function(e){var t=this.props.router,s=e.searchQuery,n=void 0;n=e.selectedItem?"/"+e.selectedItem.id+"/":""===s?"/":"?q="+encodeURIComponent(s),t.navigate(n)},render:function(){var e=this.props.adminModule.Model;p.default.defaults(e.prototype,{fieldChoices:{}}),p.default.extend(e.prototype.fieldChoices,this.props.formChoices),p.default.extend(e.prototype.defaults,this.props.formChoices.defaults);var t={items:this.state.items,selectedItem:this.state.selectedItem,searchQuery:this.state.searchQuery,view:this.state.view,collection:this.props.adminModule.collection,model:e,onSearch:this.handleSearch,onSelectItem:this.handleSelectItem,onAdd:this.handleAdd,onCancel:this.handleCancel,onSuccess:this.handleSave,onDelete:this.handleDelete};return u.default.createElement("div",{className:"admin-app"},u.default.createElement(this.props.adminModule.Controller,t))}});t.default=h},184:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(185),i=n(r),l=o.default.createClass({displayName:"ItemTable",propTypes:{fields:o.default.PropTypes.array.isRequired,items:o.default.PropTypes.object.isRequired,resultsCaption:o.default.PropTypes.string.isRequired,selectedItem:o.default.PropTypes.object,onSelectItem:o.default.PropTypes.func.isRequired},render:function(){function e(e,t){return o.default.createElement(i.default,{fields:this.props.fields,key:e.id,item:e,index:t,selectedItem:this.props.selectedItem,onSelectItem:this.props.onSelectItem})}return o.default.createElement("table",null,o.default.createElement("caption",null,this.props.resultsCaption),o.default.createElement("tbody",null,this.props.items.map(e.bind(this))))}});t.default=l},185:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(18),o=n(a),r=s(1),i=n(r),l=i.default.createClass({displayName:"ItemTableRow",propTypes:{fields:i.default.PropTypes.array.isRequired,item:i.default.PropTypes.object.isRequired,index:i.default.PropTypes.number.isRequired,selectedItem:i.default.PropTypes.object,onSelectItem:i.default.PropTypes.func.isRequired},render:function(){function e(e,t){return i.default.createElement("td",{key:t},r[e])}var t=this,s=this.props.item,n=this.props.selectedItem,a=this.props.index,r=s.toJSON();r.index=a+1;var l=(0,o.default)({"is-selected":n&&s.id===n.id,"is-disabled":s.get("disabled"),"row-divider":0!==a&&a%10===0});return i.default.createElement("tr",{className:l,key:s.id,onClick:function(){return t.props.onSelectItem(s.id)}},this.props.fields.map(e))}});t.default=l},186:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(121),i=n(r),l=o.default.createClass({displayName:"LanguageAdd",propTypes:{collection:o.default.PropTypes.object.isRequired,model:o.default.PropTypes.func.isRequired,onCancel:o.default.PropTypes.func.isRequired,onSuccess:o.default.PropTypes.func.isRequired},render:function(){var e=this.props.model;return o.default.createElement("div",{className:"item-add"},o.default.createElement("div",{className:"hd"},o.default.createElement("h2",null,gettext("Add Language")),o.default.createElement("button",{onClick:this.props.onCancel,className:"btn btn-primary"},gettext("Cancel"))),o.default.createElement("div",{className:"bd"},o.default.createElement(i.default,{model:new e,collection:this.props.collection,onSuccess:this.props.onSuccess})))}});t.default=l},187:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(82),i=n(r),l=s(186),u=n(l),d=s(188),p=n(d),c=o.default.createClass({displayName:"LanguageController",propTypes:{items:o.default.PropTypes.object.isRequired,model:o.default.PropTypes.func.isRequired,onAdd:o.default.PropTypes.func.isRequired,onCancel:o.default.PropTypes.func.isRequired,onDelete:o.default.PropTypes.func.isRequired,onSearch:o.default.PropTypes.func.isRequired,onSelectItem:o.default.PropTypes.func.isRequired,onSuccess:o.default.PropTypes.func.isRequired,searchQuery:o.default.PropTypes.string.isRequired,selectedItem:o.default.PropTypes.object,view:o.default.PropTypes.string.isRequired},render:function(){var e={add:o.default.createElement(u.default,{model:this.props.model,collection:this.props.items,onSuccess:this.props.onSuccess,onCancel:this.props.onCancel}),edit:o.default.createElement(p.default,{model:this.props.selectedItem,collection:this.props.items,onAdd:this.props.onAdd,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete})},t={count:this.props.items.count},s=void 0;s=this.props.searchQuery?ngettext("%(count)s language matches your query.","%(count)s languages match your query.",t.count):ngettext("There is %(count)s language.","There are %(count)s languages. Below are the most recently added ones.",t.count);var n=interpolate(s,t,!0);return o.default.createElement("div",{className:"admin-app-languages"},o.default.createElement("div",{className:"module first"},o.default.createElement(i.default,{fields:["index","code","fullname"],onSearch:this.props.onSearch,onSelectItem:this.props.onSelectItem,items:this.props.items,selectedItem:this.props.selectedItem,searchLabel:gettext("Search Languages"),searchPlaceholder:gettext("Find language by name, code"),resultsCaption:n,searchQuery:this.props.searchQuery})),o.default.createElement("div",{className:"module admin-content"},e[this.props.view]))}});t.default=c},188:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(121),i=n(r),l=o.default.createClass({displayName:"LanguageEdit",propTypes:{collection:o.default.PropTypes.object.isRequired,model:o.default.PropTypes.object,onAdd:o.default.PropTypes.func.isRequired,onDelete:o.default.PropTypes.func.isRequired,onSuccess:o.default.PropTypes.func.isRequired},render:function(){return o.default.createElement("div",{className:"item-edit"},o.default.createElement("div",{className:"hd"},o.default.createElement("h2",null,gettext("Edit Language")),o.default.createElement("button",{onClick:this.props.onAdd,className:"btn btn-primary"},gettext("Add Language"))),o.default.createElement("div",{className:"bd"},this.props.model?o.default.createElement(i.default,{key:this.props.model.id,model:this.props.model,collection:this.props.collection,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete}):o.default.createElement("p",null,gettext("Use the search form to find the language, then click on a language to edit."))))}});t.default=l},189:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(255),o=s(187),r=n(o);t.default={Controller:r.default,Model:a.Language,Collection:a.LanguageSet}},190:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(122),i=n(r),l=o.default.createClass({displayName:"ProjectAdd",propTypes:{collection:o.default.PropTypes.object.isRequired,model:o.default.PropTypes.func.isRequired,onCancel:o.default.PropTypes.func.isRequired,onSuccess:o.default.PropTypes.func.isRequired},render:function(){var e=this.props.model;return o.default.createElement("div",{className:"item-add"},o.default.createElement("div",{className:"hd"},o.default.createElement("h2",null,gettext("Add Project")),o.default.createElement("button",{onClick:this.props.onCancel,className:"btn btn-primary"},gettext("Cancel"))),o.default.createElement("div",{className:"bd"},o.default.createElement(i.default,{model:new e,collection:this.props.collection,onSuccess:this.props.onSuccess})))}});t.default=l},191:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(82),i=n(r),l=s(190),u=n(l),d=s(192),p=n(d),c=o.default.createClass({displayName:"ProjectController",propTypes:{items:o.default.PropTypes.object.isRequired,model:o.default.PropTypes.func.isRequired,onAdd:o.default.PropTypes.func.isRequired,onCancel:o.default.PropTypes.func.isRequired,onDelete:o.default.PropTypes.func.isRequired,onSearch:o.default.PropTypes.func.isRequired,onSelectItem:o.default.PropTypes.func.isRequired,onSuccess:o.default.PropTypes.func.isRequired,searchQuery:o.default.PropTypes.string.isRequired,selectedItem:o.default.PropTypes.object,view:o.default.PropTypes.string.isRequired},render:function(){var e={add:o.default.createElement(u.default,{model:this.props.model,collection:this.props.items,onSuccess:this.props.onSuccess,onCancel:this.props.onCancel}),edit:o.default.createElement(p.default,{model:this.props.selectedItem,collection:this.props.items,onAdd:this.props.onAdd,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete})},t={count:this.props.items.count},s=void 0;s=this.props.searchQuery?ngettext("%(count)s project matches your query.","%(count)s projects match your query.",t.count):ngettext("There is %(count)s project.","There are %(count)s projects. Below are the most recently added ones.",t.count);var n=interpolate(s,t,!0);return o.default.createElement("div",{className:"admin-app-projects"},o.default.createElement("div",{className:"module first"},o.default.createElement(i.default,{fields:["index","code","fullname","disabled"],onSearch:this.props.onSearch,onSelectItem:this.props.onSelectItem,items:this.props.items,selectedItem:this.props.selectedItem,searchLabel:gettext("Search Projects"),searchPlaceholder:gettext("Find project by name, code"),resultsCaption:n,searchQuery:this.props.searchQuery})),o.default.createElement("div",{className:"module admin-content"},e[this.props.view]))}});t.default=c},192:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(122),i=n(r),l=o.default.createClass({displayName:"ProjectEdit",propTypes:{collection:o.default.PropTypes.object.isRequired,model:o.default.PropTypes.object,onAdd:o.default.PropTypes.func.isRequired,onDelete:o.default.PropTypes.func.isRequired,onSuccess:o.default.PropTypes.func.isRequired},render:function(){return o.default.createElement("div",{className:"item-edit"},o.default.createElement("div",{className:"hd"},o.default.createElement("h2",null,gettext("Edit Project")),o.default.createElement("button",{onClick:this.props.onAdd,className:"btn btn-primary"},gettext("Add Project"))),o.default.createElement("div",{className:"bd"},this.props.model?o.default.createElement(i.default,{key:this.props.model.id,model:this.props.model,collection:this.props.collection,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete}):o.default.createElement("p",null,gettext("Use the search form to find the project, then click on a project to edit."))))}});t.default=l},193:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(256),o=s(191),r=n(o);t.default={Controller:r.default,Model:a.Project,Collection:a.ProjectSet}},194:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n])}return e},o=s(1),r=n(o),i=s(6),l=n(i),u=r.default.createClass({displayName:"SearchBox",propTypes:{onSearch:r.default.PropTypes.func.isRequired,placeholder:r.default.PropTypes.string,searchQuery:r.default.PropTypes.string},getInitialState:function(){return{searchQuery:this.props.searchQuery}},componentWillMount:function(){var e=this;this.handleSearchDebounced=l.default.debounce(function(){e.props.onSearch.apply(e,[e.state.searchQuery])},300)},componentDidMount:function(){this.refs.input.focus()},componentWillReceiveProps:function(e){e.searchQuery!==this.state.searchQuery&&this.setState({searchQuery:e.searchQuery})},handleKeyUp:function(e){var t=e.nativeEvent.keyCode;27===t&&this.refs.input.blur()},handleChange:function(){this.setState({searchQuery:this.refs.input.value}),this.handleSearchDebounced()},render:function(){return r.default.createElement("input",a({type:"text",ref:"input",value:this.state.searchQuery,onChange:this.handleChange,onKeyUp:this.handleKeyUp},this.props))}});t.default=u},195:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(123),i=n(r),l=o.default.createClass({displayName:"UserAdd",propTypes:{collection:o.default.PropTypes.object.isRequired,model:o.default.PropTypes.func.isRequired,onCancel:o.default.PropTypes.func.isRequired,onSuccess:o.default.PropTypes.func.isRequired},render:function(){var e=this.props.model;return o.default.createElement("div",{className:"item-add"},o.default.createElement("div",{className:"hd"},o.default.createElement("h2",null,gettext("Add User")),o.default.createElement("button",{onClick:this.props.onCancel,className:"btn btn-primary"},gettext("Cancel"))),o.default.createElement("div",{className:"bd"},o.default.createElement(i.default,{model:new e,collection:this.props.collection,onSuccess:this.props.onSuccess})))}});t.default=l},196:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(82),i=n(r),l=s(195),u=n(l),d=s(197),p=n(d),c=o.default.createClass({displayName:"UserController",propTypes:{items:o.default.PropTypes.object.isRequired,model:o.default.PropTypes.func.isRequired,onAdd:o.default.PropTypes.func.isRequired,onCancel:o.default.PropTypes.func.isRequired,onDelete:o.default.PropTypes.func.isRequired,onSearch:o.default.PropTypes.func.isRequired,onSelectItem:o.default.PropTypes.func.isRequired,onSuccess:o.default.PropTypes.func.isRequired,searchQuery:o.default.PropTypes.string.isRequired,selectedItem:o.default.PropTypes.object,view:o.default.PropTypes.string.isRequired},render:function(){var e={add:o.default.createElement(u.default,{model:this.props.model,collection:this.props.items,onSuccess:this.props.onSuccess,onCancel:this.props.onCancel}),edit:o.default.createElement(p.default,{model:this.props.selectedItem,collection:this.props.items,onAdd:this.props.onAdd,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete})},t={count:this.props.items.count},s=void 0;s=this.props.searchQuery?ngettext("%(count)s user matches your query.","%(count)s users match your query.",t.count):ngettext("There is %(count)s user.","There are %(count)s users. Below are the most recently added ones.",t.count);var n=interpolate(s,t,!0);return o.default.createElement("div",{className:"admin-app-users"},o.default.createElement("div",{className:"module first"},o.default.createElement(i.default,{fields:["index","full_name","username","email"],onSearch:this.props.onSearch,onSelectItem:this.props.onSelectItem,items:this.props.items,selectedItem:this.props.selectedItem,searchLabel:gettext("Search Users"),searchPlaceholder:gettext("Find user by name, email, properties"),
resultsCaption:n,searchQuery:this.props.searchQuery})),o.default.createElement("div",{className:"module admin-content"},e[this.props.view]))}});t.default=c},197:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(1),o=n(a),r=s(123),i=n(r),l=o.default.createClass({displayName:"UserEdit",propTypes:{collection:o.default.PropTypes.object.isRequired,model:o.default.PropTypes.object,onAdd:o.default.PropTypes.func.isRequired,onDelete:o.default.PropTypes.func.isRequired,onSuccess:o.default.PropTypes.func.isRequired},render:function(){return o.default.createElement("div",{className:"item-edit"},o.default.createElement("div",{className:"hd"},o.default.createElement("h2",null,gettext("Edit User")),o.default.createElement("button",{onClick:this.props.onAdd,className:"btn btn-primary"},gettext("Add User"))),o.default.createElement("div",{className:"bd"},this.props.model?o.default.createElement(i.default,{key:this.props.model.id,model:this.props.model,collection:this.props.collection,onSuccess:this.props.onSuccess,onDelete:this.props.onDelete}):o.default.createElement("p",null,gettext("Use the search form to find the user, then click on a user to edit."))))}});t.default=l},198:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var a=s(92),o=s(196),r=n(o);t.default={Controller:r.default,Model:a.User,Collection:a.UserSet}},255:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.LanguageSet=t.Language=void 0;var a=s(15),o=n(a),r=s(6),i=n(r),u=s(58),d=n(u),p=t.Language=o.default.Model.extend({defaults:{code:"",fullname:"",specialchars:"",nplurals:"0",pluralequation:""},fieldChoices:{nplurals:[[0,"Unknown"],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6]]},urlRoot:function(){return l("/xhr/admin/languages/")},getAbsoluteUrl:function(){return l(["",this.get("code"),""].join("/"))},getTeamUrl:function(){return l(["",this.get("code"),"admin","team",""].join("/"))},getFieldChoices:function(e){return this.fieldChoices&&this.fieldChoices.hasOwnProperty(e)?this.fieldChoices[e].map(function(e){return{value:e[0].toString(),label:e[1]}}):[]}});t.LanguageSet=o.default.Collection.extend(i.default.extend({},d.default,{model:p,url:l("/xhr/admin/languages/")}))},256:function(e,t,s){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ProjectSet=t.Project=void 0;var a=s(15),o=n(a),r=s(6),i=n(r),u=s(58),d=n(u),p=t.Project=o.default.Model.extend({defaults:{code:"",fullname:"",checkstyle:"standard",source_language:"",ignoredfiles:"",filetypes:[],screenshot_search_prefix:"",disabled:!1},urlRoot:function(){return l("/xhr/admin/projects/")},getAbsoluteUrl:function(){return l(["","projects",this.get("code"),""].join("/"))},getLanguagesUrl:function(){return l(["","projects",this.get("code"),"admin","languages",""].join("/"))},getPermissionsUrl:function(){return l(["","projects",this.get("code"),"admin","permissions",""].join("/"))},getFSUrl:function(){return l(["","admin","projects",this.get("code"),"fs",""].join("/"))},getFieldChoices:function(e){return this.fieldChoices&&this.fieldChoices.hasOwnProperty(e)?this.fieldChoices[e].map(function(e){return{value:e[0].toString(),label:e[1]}}):[]},toJSON:function(){var e=i.default.clone(this.attributes);return e.disabled=e.disabled?gettext("disabled"):"",e}});t.ProjectSet=o.default.Collection.extend(i.default.extend({},d.default,{model:p,url:l("/xhr/admin/projects/")}))},291:function(e,t,s){var n=s(15);n.Collection.prototype.move=function(e,t){var s=this.indexOf(e);if(s==-1)throw new Error("Can't move a model that's not in the collection");s!==t&&this.models.splice(t,0,this.models.splice(s,1)[0])}}});