UNPKG

react-selectize

Version:

A Stateless & Flexible Select component for React inspired by Selectize

1 lines 47.8 kB
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).reactSelectize=e()}}(function(){return function e(t,n,o){function r(s,p){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!p&&u)return u(s,!0);if(i)return i(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var a=n[s]={exports:{}};t[s][0].call(a.exports,function(e){var n=t[s][1][e];return r(n||e)},a,a.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){(function(e){(function(){function n(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function o(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}var r,i;r=("undefined"!=typeof window?window.ReactDOMFactories:void 0!==e?e.ReactDOMFactories:null).div,i="undefined"!=typeof window?window.React:void 0!==e?e.React:null,t.exports=function(e){function t(){t.superclass.apply(this,arguments)}n((o(t,e).displayName="DivWrapper",t),e).prototype;return t.defaultProps={className:"",onHeightChange:function(){}},t.prototype.render=function(){return r({className:this.props.className,ref:"dropdown"},this.props.children)},t.prototype.componentDidMount=function(){this.props.onHeightChange(this.refs.dropdown.offsetHeight)},t.prototype.componentDidUpdate=function(){this.props.onHeightChange(this.refs.dropdown.offsetHeight)},t.prototype.componentWillUnmount=function(){this.props.onHeightChange(0)},t}(i.Component)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){(function(n){(function(){function o(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function r(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}function i(e,t,n){function o(e,t,i){var u,l,a,c,d,h,f,g;if(null==e||null==t)return e===t;if(e.__placeholder__||t.__placeholder__)return!0;if(e===t)return 0!==e||1/e==1/t;if(u=r.call(e),r.call(t)!=u)return!1;switch(u){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if("object"!=typeof e||"object"!=typeof t)return!1;for(l=i.length;l--;)if(i[l]==e)return!0;if(i.push(e),a=0,c=!0,"[object Array]"==u){if(d=e.length,h=t.length,p){switch(n){case"===":c=d===h;break;case"<==":c=d<=h;break;case"<<=":c=d<h}a=d,p=!1}else c=d===h,a=d;if(c)for(;a--&&(c=a in e==a in t&&o(e[a],t[a],i)););}else{if("constructor"in e!="constructor"in t||e.constructor!=t.constructor)return!1;for(f in e)if(s(e,f)&&(a++,!(c=s(t,f)&&o(e[f],t[f],i))))break;if(c){g=0;for(f in t)s(t,f)&&++g;p?c="<<="===n?a<g:"<=="===n?a<=g:a===g:(p=!1,c=a===g)}}return i.pop(),c}var r={}.toString,i={}.hasOwnProperty,s=function(e,t){return i.call(e,t)},p=!0;return o(e,t,[])}var s,p,u,l,a,c,d,h,f,g,y,v,w,m,O,b;s=e("prelude-ls"),p=s.filter,u=s.id,l=s.map,a=("undefined"!=typeof window?window.preludeExtension:void 0!==n?n.preludeExtension:null).isEqualToObject,d=(c="undefined"!=typeof window?window.React:void 0!==n?n.React:null).createFactory,s="undefined"!=typeof window?window.ReactDOMFactories:void 0!==n?n.ReactDOMFactories:null,h=s.div,s.input,f=s.span,g=("undefined"!=typeof window?window.ReactDOM:void 0!==n?n.ReactDOM:null).findDOMNode,y=d("undefined"!=typeof window?window.React.addons.CSSTransitionGroup:void 0!==n?n.React.addons.CSSTransitionGroup:null),v=d(e("./ReactTether")),w=d(e("./DivWrapper")),m=d(e("./OptionWrapper")),s=e("./utils"),O=s.cancelEvent,b=s.classNameFromObject,t.exports=function(e){function t(){t.superclass.apply(this,arguments)}o((r(t,e).displayName="DropdownMenu",t),e).prototype;return t.defaultProps={className:"",dropdownDirection:1,groupId:function(e){return e.groupId},groupsAsColumns:!1,highlightedUid:void 0,onHighlightedUidChange:function(e,t){},onOptionClick:function(e){},onScrollLockChange:function(e){},options:[],renderNoResultsFound:function(){return h({className:"no-results-found"},"No results found")},renderGroupTitle:function(e,t){var n,o;return null!=t&&(n=t.groupId,o=t.title),h({className:"simple-group-title",key:n},o)},renderOption:function(e){var t,n,o,r;return null!=e&&(t=e.label,n=e.newOption,o=e.selectable),r=void 0===o||o,h({className:"simple-option "+(r?"":"not-selectable")},f(null,n?"Add "+t+" ...":t))},scrollLock:!1,style:{},tether:!1,tetherProps:{},theme:"default",transitionEnter:!1,transitionLeave:!1,transitionEnterTimeout:200,transitionLeaveTimeout:200,uid:u},t.prototype.render=function(){var e,t;return e=b((t={},t[this.props.theme+""]=1,t[this.props.className+""]=1,t.flipped=-1===this.props.dropdownDirection,t.tethered=this.props.tether,t)),this.props.tether?v((t=r({},this.props.tetherProps),t.options={attachment:"top left",targetAttachment:"bottom left",constraints:[{to:"scrollParent"}]},t),this.renderAnimatedDropdown({dynamicClassName:e})):this.renderAnimatedDropdown({dynamicClassName:e})},t.prototype.renderAnimatedDropdown=function(e){var t;return t=e.dynamicClassName,this.props.transitionEnter||this.props.transitionLeave?y({ref:"dropdownMenuWrapper",component:"div",transitionName:"custom",transitionEnter:this.props.transitionEnter,transitionLeave:this.props.transitionLeave,transitionEnterTimeout:this.props.transitionEnterTimeout,transitionLeaveTimeout:this.props.transitionLeaveTimeout,className:"dropdown-menu-wrapper "+t},this.renderDropdown(e)):this.renderDropdown(e)},t.prototype.renderOptions=function(e){var t=this;return l(function(n){var o,i;return o=e[n],i=t.props.uid(o),m(r({uid:i,ref:function(e){t["option-"+t.uidToString(i)]=e},key:t.uidToString(i),item:o,highlight:a(t.props.highlightedUid,i),selectable:null!=o?o.selectable:void 0,onMouseMove:function(e){e.currentTarget,t.props.scrollLock&&t.props.onScrollLockChange(!1)},onMouseOut:function(){t.props.scrollLock||t.props.onHighlightedUidChange(void 0,function(){})},renderItem:t.props.renderOption},function(){switch(!1){case!("boolean"==typeof(null!=o?o.selectable:void 0)&&!o.selectable):return{onClick:O};default:return{onClick:function(){t.props.scrollLock||t.props.onHighlightedUidChange(i,function(){}),t.props.onOptionClick(t.props.highlightedUid)},onMouseOver:function(e){if(e.currentTarget,"ontouchstart"in window)return!1;t.props.scrollLock||t.props.onHighlightedUidChange(i,function(){})}}}}()))})(function(){var t,n,o=[];for(t=0,n=e.length;t<n;++t)o.push(t);return o}())},t.prototype.renderDropdown=function(e){var t,n,o,r,i=this;return t=e.dynamicClassName,this.props.open?w({className:"dropdown-menu "+t,ref:function(e){!!e&&(i.dropdownMenu=e)},onHeightChange:function(e){i.refs.dropdownMenuWrapper&&(g(i.refs.dropdownMenuWrapper).style.height=e+"px")}},0===this.props.options.length?this.props.renderNoResultsFound():(null!=(n=this.props)&&null!=(o=n.groups)?o.length:void 0)>0?(r=l(function(e){var t,n,o;return t=i.props.groups[e],n=t.groupId,o=p(function(e){return i.props.groupId(e)===n})(i.props.options),{index:e,group:t,options:o}})(function(){var e,t,n=[];for(e=0,t=this.props.groups.length;e<t;++e)n.push(e);return n}.call(this)),h({className:"groups "+(this.props.groupsAsColumns?"as-columns":"")},l(function(e){var t,n,o,r;return t=e.index,n=e.group,o=n.groupId,r=e.options,h({key:o},i.props.renderGroupTitle(t,n,r),h({className:"options"},i.renderOptions(r)))})(p(function(e){return e.options.length>0})(r)))):this.renderOptions(this.props.options)):null},t.prototype.componentDidUpdate=function(e){var t,n,o;!i(e.dropdownDirection,this.props.dropdownDirection,"===")&&this.props.open&&null!=(t=n=g(null!=(o=this.refs.dropdownMenuWrapper)?o:this.dropdownMenu))&&(t.style.bottom=function(){switch(!1){case-1!==this.props.dropdownDirection:return this.props.bottomAnchor().offsetHeight+n.style.marginBottom+"px";default:return""}}.call(this))},t.prototype.highlightAndScrollToOption=function(e,t){var n,o=this;null==t&&(t=function(){}),n=this.props.uid(this.props.options[e]),this.props.onHighlightedUidChange(n,function(){var e,r,i,s;return null!=(e=g(null!=o?o["option-"+o.uidToString(n)]:void 0))&&(r=e),r&&(i=r.parentElement,s=r.offsetHeight-1,r.offsetTop-i.scrollTop>=i.offsetHeight?i.scrollTop=r.offsetTop-i.offsetHeight+s:r.offsetTop-i.scrollTop+s<=0&&(i.scrollTop=r.offsetTop)),t()})},t.prototype.highlightAndScrollToSelectableOption=function(e,t,n){var o,r,i;null==n&&(n=function(){}),e<0||e>=this.props.options.length?this.props.onHighlightedUidChange(void 0,function(){return n(!1)}):"boolean"!=typeof(null!=(o=null!=(r=this.props)&&null!=(i=r.options)?i[e]:void 0)?o.selectable:void 0)||o.selectable?this.highlightAndScrollToOption(e,function(){return n(!0)}):this.highlightAndScrollToSelectableOption(e+t,t,n)},t.prototype.uidToString=function(e){return("object"==typeof e?JSON.stringify:u)(e)},t}(c.PureComponent)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./DivWrapper":1,"./OptionWrapper":5,"./ReactTether":7,"./utils":15,"prelude-ls":void 0}],3:[function(e,t,n){(function(n){(function(){function o(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function r(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}var i,s,p,u,l;i="undefined"!=typeof window?window.React:void 0!==n?n.React:null,s="undefined"!=typeof window?window.ReactDOMFactories:void 0!==n?n.ReactDOMFactories:null,p=s.div,u=s.span,l=e("prelude-ls").map,t.exports=function(e){function t(){t.superclass.apply(this,arguments)}o((r(t,e).displayName="HighlightedText",t),e).prototype;return t.defaultProps={partitions:[],text:"",style:{},highlightStyle:{}},t.prototype.render=function(){var e=this;return p({className:"highlighted-text",style:this.props.style},l(function(t){var n,o,r;return n=t[0],o=t[1],r=t[2],u({key:e.props.text+""+n+o+r,className:r?"highlight":"",style:r?e.props.highlightStyle:{}},e.props.text.substring(n,o))})(this.props.partitions))},t}(i.Component)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"prelude-ls":void 0}],4:[function(e,t,n){(function(n){(function(){function o(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function r(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}function i(e,t){for(var n=-1,o=t.length>>>0;++n<o;)if(e===t[n])return!0;return!1}function s(e,t){var n,o=function(r){return e.length>1?function(){var i=r?r.concat():[];return n=t?n||this:this,i.push.apply(i,arguments)<e.length&&arguments.length?o.call(n,i):e.apply(n,i)}:e};return o()}var p,u,l,a,c,d,h,f,g,y,v,w,m,O={}.toString;p=e("prelude-ls"),u=p.all,p.any,l=p.camelize,p.difference,a=p.drop,c=p.filter,p.find,p.findIndex,d=p.id,h=p.last,f=p.map,g=p.reject,("undefined"!=typeof window?window.preludeExtension:void 0!==n?n.preludeExtension:null).isEqualToObject,v=(y="undefined"!=typeof window?window.React:void 0!==n?n.React:null).createFactory,(p="undefined"!=typeof window?window.ReactDOMFactories:void 0!==n?n.ReactDOMFactories:null).div,p.img,p.span,w=v(e("./ReactSelectize")),m=e("./utils").cancelEvent,t.exports=function(e){function t(e){t.superclass.call(this,e),this.state={anchor:this.props.values?h(this.props.values):void 0,highlightedUid:void 0,open:!1,scrollLock:!1,search:"",values:this.props.defaultValues}}o((r(t,e).displayName="MultiSelect",t),e).prototype;return t.defaultProps={className:"",closeOnSelect:!1,defaultValues:[],delimiters:[],filterOptions:s(function(e,t,n){return c(function(e){return e.label.toLowerCase().trim().indexOf(n.toLowerCase().trim())>-1})(g(function(e){return i(e.label.trim(),f(function(e){return e.label.trim()},null!=t?t:[]))})(e))}),firstOptionIndexToHighlight:d,onBlur:function(e){},onFocus:function(e){},onPaste:function(e){},serialize:f(function(e){return null!=e?e.value:void 0}),tether:!1},t.prototype.render=function(){var e,t,n,o,i,s,p,u,l,a,c,d,f,g,y,v,O,b,S,C,T,x,R,P,D,M,F,N,E,U,L,A,k,H,I,B,z,j=this;return e=this.getComputedState(),t=e.anchor,e.filteredOptions,n=e.highlightedUid,o=e.onAnchorChange,i=e.onOpenChange,s=e.onHighlightedUidChange,p=e.onSearchChange,u=e.onValuesChange,l=e.search,a=e.open,c=e.options,d=e.values,null!=(e=this.props)&&(f=e.autofocus,g=e.autosize,y=e.cancelKeyboardEventOnSelection,v=e.delimiters,O=e.disabled,b=e.dropdownDirection,S=e.groupId,C=e.groups,T=e.groupsAsColumns,x=e.hideResetButton,R=e.inputProps,P=e.name,D=e.onKeyboardSelectionFailed,M=e.renderToggleButton,F=e.renderGroupTitle,N=e.renderResetButton,E=e.serialize,U=e.tether,L=e.tetherProps,A=e.theme,k=e.transitionEnter,H=e.transitionLeave,I=e.transitionEnterTimeout,B=e.transitionLeaveTimeout,z=e.uid),w(r(r({autofocus:f,autosize:g,cancelKeyboardEventOnSelection:y,className:"multi-select "+this.props.className,delimiters:v,disabled:O,dropdownDirection:b,groupId:S,groups:C,groupsAsColumns:T,hideResetButton:x,highlightedUid:n,onHighlightedUidChange:s,inputProps:R,name:P,onKeyboardSelectionFailed:D,renderGroupTitle:F,renderResetButton:N,renderToggleButton:M,scrollLock:this.state.scrollLock,onScrollLockChange:function(e){return j.setState({scrollLock:e})},tether:U,tetherProps:L,theme:A,transitionEnter:k,transitionEnterTimeout:I,transitionLeave:H,transitionLeaveTimeout:B,uid:z,ref:"select",anchor:t,onAnchorChange:o,open:a,onOpenChange:i,options:c,renderOption:this.props.renderOption,firstOptionIndexToHighlight:function(){return j.firstOptionIndexToHighlight(c)},search:l,onSearchChange:function(e,t){return p(j.props.maxValues&&d.length>=j.props.maxValues?"":e,t)},values:d,onValuesChange:function(e,t){return u(e,function(){if(t(),j.props.closeOnSelect||j.props.maxValues&&j.values().length>=j.props.maxValues)return i(!1,function(){})})},renderValue:this.props.renderValue,serialize:E,onBlur:function(e){p("",function(){return j.props.onBlur({open:a,values:d,originalEvent:e})})},onFocus:function(e){j.props.onFocus({open:a,values:d,originalEvent:e})},onPaste:function(){var e;switch(!1){case void 0!==(null!=(e=this.props)?e.valuesFromPaste:void 0):return this.props.onPaste;default:return function(e){var t;return t=e.clipboardData,function(){var e;e=d.concat(j.props.valuesFromPaste(c,d,t.getData("text"))),u(e,function(){return o(h(e))})}(),m(e)}}}.call(this),placeholder:this.props.placeholder,style:this.props.style},function(){switch(!1){case"function"!=typeof this.props.restoreOnBackspace:return{restoreOnBackspace:this.props.restoreOnBackspace};default:return{}}}.call(this)),function(){switch(!1){case"function"!=typeof this.props.renderNoResultsFound:return{renderNoResultsFound:function(){return j.props.renderNoResultsFound(d,l)}};default:return{}}}.call(this)))},t.prototype.getComputedState=function(){var e,t,n,o,i,s,p,u,a,c,d,h,g,y,v,w,m=this;return e=this.props.hasOwnProperty("anchor")?this.props.anchor:this.state.anchor,t=this.props.hasOwnProperty("highlightedUid")?this.props.highlightedUid:this.state.highlightedUid,n=this.isOpen(),o=this.props.hasOwnProperty("search")?this.props.search:this.state.search,i=this.values(),s=f(function(e){switch(!1){case!(m.props.hasOwnProperty(e)&&m.props.hasOwnProperty(l("on-"+e+"-change"))):return function(t,n){return m.props[l("on-"+e+"-change")](t,function(){}),m.setState({},n)};case!(m.props.hasOwnProperty(e)&&!m.props.hasOwnProperty(l("on-"+e+"-change"))):return function(e,t){return t()};case!(!m.props.hasOwnProperty(e)&&m.props.hasOwnProperty(l("on-"+e+"-change"))):return function(t,n){var o;return m.setState((o={},o[e+""]=t,o),function(){return n(),m.props[l("on-"+e+"-change")](t,function(){})})};case!(!m.props.hasOwnProperty(e)&&!m.props.hasOwnProperty(l("on-"+e+"-change"))):return function(t,n){var o;return m.setState((o={},o[e+""]=t,o),n)}}})(["anchor","highlightedUid","open","search","values"]),p=s[0],u=s[1],a=s[2],c=s[3],d=s[4],h=function(){var e;switch(!1){case!(null!=(e=this.props)&&e.children):return f(function(e){var t,n,o;return null!=e&&(t=e.props),null!=t&&(n=t.value,o=t.children),{label:o,value:n}})("Array"===O.call(this.props.children).slice(8,-1)?this.props.children:[this.props.children]);default:return[]}}.call(this),g=this.props.hasOwnProperty("options")?null!=(s=this.props.options)?s:[]:h,y=this.props.filterOptions(g,i,o),v=function(){switch(!1){case"function"!=typeof this.props.createFromSearch:return this.props.createFromSearch(y,i,o);default:return null}}.call(this),w=(v?[(s=r({},v),s.newOption=!0,s)]:[]).concat(y),{anchor:e,highlightedUid:t,search:o,values:i,onAnchorChange:p,onHighlightedUidChange:u,open:n,onOpenChange:function(e,t){a(function(){switch(!1){case!(void 0!==this.props.maxValues&&this.values().length>=this.props.maxValues):return!1;default:return e}}.call(m),t)},onSearchChange:c,onValuesChange:d,filteredOptions:y,options:w}},t.prototype.firstOptionIndexToHighlight=function(e){var t,n;return t=function(){var t;switch(!1){case 1!==e.length:case void 0!==(null!=(t=e[0])?t.newOption:void 0):return 0;default:return u(function(e){return"boolean"==typeof e.selectable&&!e.selectable})(a(1)(e))?0:1}}(),n=this.props.hasOwnProperty("search")?this.props.search:this.state.search,this.props.firstOptionIndexToHighlight(t,e,this.values(),n)},t.prototype.focus=function(){this.refs.select.focus()},t.prototype.blur=function(){this.refs.select.blur()},t.prototype.highlightFirstSelectableOption=function(){this.state.open&&this.refs.select.highlightAndScrollToSelectableOption(this.firstOptionIndexToHighlight(this.getComputedState().options),1)},t.prototype.values=function(){return this.props.hasOwnProperty("values")?this.props.values:this.state.values},t.prototype.isOpen=function(){return this.props.hasOwnProperty("open")?this.props.open:this.state.open},t}(y.Component)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./ReactSelectize":6,"./utils":15,"prelude-ls":void 0}],5:[function(e,t,n){(function(n){(function(){function o(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function r(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}var i,s,p,u;i="undefined"!=typeof window?window.React:void 0!==n?n.React:null,s=("undefined"!=typeof window?window.ReactDOMFactories:void 0!==n?n.ReactDOMFactories:null).div,p=("undefined"!=typeof window?window.preludeExtension:void 0!==n?n.preludeExtension:null).isEqualToObject,u=e("./utils").cancelEvent,t.exports=function(e){function t(){t.superclass.apply(this,arguments)}o((r(t,e).displayName="OptionWrapper",t),e).prototype;return t.defaultProps={},t.prototype.render=function(){var e=this;return s({className:"option-wrapper "+(this.props.highlight?"highlight":""),onMouseDown:function(t){var n;return n=function(t){return e.props.onClick(t),window.removeEventListener("mouseup",n)},window.addEventListener("mouseup",n),u(t)},onMouseMove:this.props.onMouseMove,onMouseOut:this.props.onMouseOut,onMouseOver:this.props.onMouseOver},this.props.renderItem(this.props.item))},t.prototype.shouldComponentUpdate=function(e){var t,n,o;return!p(null!=e?e.uid:void 0,null!=(t=this.props)?t.uid:void 0)||(null!=e?e.highlight:void 0)!==(null!=(n=this.props)?n.highlight:void 0)||(null!=e?e.selectable:void 0)!==(null!=(o=this.props)?o.selectable:void 0)},t}(i.Component)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./utils":15}],6:[function(e,t,n){(function(n){(function(){function o(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function r(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}function i(e,t){for(var n=-1,o=t.length>>>0;++n<o;)if(e===t[n])return!0;return!1}var s,p,u,l,a,c,d,h,f,g,y,v,w,m,O,b,S,C,T,x,R,P;(s=e("prelude-ls")).each,s.filter,p=s.find,u=s.findIndex,l=s.id,s.initial,a=s.last,c=s.map,s.objToPairs,s.partition,d=s.reject,s.reverse,s.Str,s.sortBy,s.sum,s.values,s="undefined"!=typeof window?window.preludeExtension:void 0!==n?n.preludeExtension:null,h=s.clamp,f=s.isEqualToObject,y=(g="undefined"!=typeof window?window.React:void 0!==n?n.React:null).createFactory,s="undefined"!=typeof window?window.ReactDOMFactories:void 0!==n?n.ReactDOMFactories:null,v=s.div,w=s.input,s.path,m=s.span,s.svg,O=("undefined"!=typeof window?window.ReactDOM:void 0!==n?n.ReactDOM:null).findDOMNode,b=y(e("./ToggleButton")),S=y(e("./DropdownMenu")),y(e("./OptionWrapper")),C=y(e("./ValueWrapper")),T=y(e("./ResetButton")),x=y(e("./ResizableInput")),s=e("./utils"),R=s.cancelEvent,P=s.classNameFromObject,t.exports=function(e){function t(){t.superclass.apply(this,arguments)}o((r(t,e).displayName="ReactSelectize",t),e).prototype;return t.prototype.focusLock=!1,t.defaultProps={anchor:null,autofocus:!1,cancelKeyboardEventOnSelection:!0,delimiters:[],disabled:!1,dropdownDirection:1,firstOptionIndexToHighlight:function(e){return 0},groupId:function(e){return e.groupId},groupsAsColumns:!1,highlightedUid:void 0,inputProps:{},onAnchorChange:function(e){},onBlur:function(e){},onEnter:function(e){},onFocus:function(e){},onHighlightedUidChange:function(e,t){},onKeyboardSelectionFailed:function(e){},onOpenChange:function(e,t){},onPaste:function(e){},onScrollLockChange:function(e){},onSearchChange:function(e,t){},onValuesChange:function(e,t){},open:!1,hideResetButton:!1,renderValue:function(e){var t;return t=e.label,v({className:"simple-value"},m(null,t))},renderToggleButton:b,renderResetButton:T,scrollLock:!1,search:"",style:{},theme:"default",uid:l,values:[]},t.prototype.render=function(){var e,t,n,o,i,s=this;return e=function(){var e;switch(!1){case!(void 0===this.props.anchor||null===this.props.anchor):return-1;default:return null!=(e=u(function(e){return s.isEqualToObject(e,s.props.anchor)},this.props.values))?e:this.props.values.length-1}}.call(this),t=function(e){return c(function(e){var t,n;return t=s.props.values[e],n=s.props.uid(t),C({key:s.uidToString(n),uid:n,item:t,renderItem:s.props.renderValue})})(e)},n=-1===this.props.dropdownDirection,v({className:P((o={"react-selectize":1},o[this.props.theme+""]=1,o["root-node"]=1,o[this.props.className+""]=1,o.disabled=this.props.disabled,o.open=this.props.open,o.flipped=n,o.tethered=this.props.tether,o)),style:this.props.style},this.props.name?w({type:"hidden",name:this.props.name,value:this.props.serialize(this.props.values)}):void 0,v({className:"react-selectize-control",ref:"control",onMouseDown:function(e){if(s.props.onAnchorChange(a(s.props.values),function(){return s.onOpenChange(!0,function(){})}),!s.props.open)return R(e)}},0===this.props.search.length&&0===this.props.values.length?v({className:"react-selectize-placeholder"},this.props.placeholder):void 0,v({className:"react-selectize-search-field-and-selected-values"},t(function(){var t,n,o=[];for(t=0,n=e;t<=n;++t)o.push(t);return o}()),x((o=r({disabled:this.props.disabled},this.props.inputProps),o.ref="search",o.type="text",o.value=this.props.search,o.onChange=function(e){var t;return t=e.currentTarget.value,s.props.onSearchChange(t,function(){return s.highlightAndScrollToSelectableOption(s.props.firstOptionIndexToHighlight(s.props.options),1)})},o.onFocus=function(e){!function(e){s.focusLock?e(s.focusLock=!1):s.onOpenChange(!0,function(){return e(!0)})}(function(){return s.props.onFocus(e)})},o.onBlur=function(e){if(!s.refs.dropdownMenu||document.activeElement!==O(s.refs.dropdownMenu))return s.closeDropdown(function(){return s.props.onBlur(e)})},o.onPaste=this.props.onPaste,o.onKeyDown=function(t){return s.handleKeydown({anchorIndex:e},t)},o)),t(function(){var t,n,o=[];for(t=e+1,n=this.props.values.length;t<n;++t)o.push(t);return o}.call(this))),this.props.values.length>0&&!this.props.hideResetButton?v({className:"react-selectize-reset-button-container",onClick:function(e){return s.props.onValuesChange([],function(){return s.props.onSearchChange("",function(){return s.highlightAndFocus()})}),R(e)}},this.props.renderResetButton()):void 0,v({className:"react-selectize-toggle-button-container",onMouseDown:function(e){return s.props.open?s.onOpenChange(!1,function(){}):s.props.onAnchorChange(a(s.props.values),function(){return s.onOpenChange(!0,function(){})}),R(e)}},this.props.renderToggleButton({open:this.props.open,flipped:n}))),S((o=r({},this.props),o.ref="dropdownMenu",o.className=P((i={"react-selectize":1},i[this.props.className+""]=1,i)),o.theme=this.props.theme,o.scrollLock=this.props.scrollLock,o.onScrollChange=this.props.onScrollChange,o.bottomAnchor=function(){return O(s.refs.control)},o.tetherProps=(i=r({},this.props.tetherProps),i.target=function(){return O(s.refs.control)},i),o.highlightedUid=this.props.highlightedUid,o.onHighlightedUidChange=this.props.onHighlightedUidChange,o.onOptionClick=function(t){s.selectHighlightedUid(e,function(){})},o)))},t.prototype.handleKeydown=function(e,t){var n,o,r=this;switch(n=e.anchorIndex,t.persist(),t.which){case 8:if(this.props.search.length>0||-1===n)return;!function(){var e,t,o,i;e=n,t=n-1<0?void 0:r.props.values[n-1],o=r.props.values[n],r.props.onValuesChange(null!=(i=d(function(e){return r.isEqualToObject(e,o)})(r.props.values))?i:[],function(){return function(e){return void 0===p(function(e){return r.isEqualToObject(e,o)},r.props.values)?r.props.restoreOnBackspace?r.props.onSearchChange(r.props.restoreOnBackspace(o),function(){return e(!0)}):e(!0):e(!1)}(function(o){if(o&&(r.highlightAndScrollToSelectableOption(r.props.firstOptionIndexToHighlight(r.props.options),1),n===e&&(void 0===t||p(function(e){return r.isEqualToObject(e,t)})(r.props.values))))return r.props.onAnchorChange(t,function(){})})})}(),R(t);break;case 27:(r.props.open?function(e){return r.onOpenChange(!1,e)}:function(e){return r.props.onValuesChange([],e)})(function(){return r.props.onSearchChange("",function(){return r.focusOnInput()})})}if(this.props.open&&i(t.which,[13].concat(this.props.delimiters))&&!(null!=t&&t.metaKey||null!=t&&t.ctrlKey||null!=t&&t.shiftKey)&&this.selectHighlightedUid(n,function(e){if(void 0===e)return r.props.onKeyboardSelectionFailed(t.which)})&&this.props.cancelKeyboardEventOnSelection)return R(t);if(0===this.props.search.length)switch(t.which){case 37:this.props.onAnchorChange(n-1<0||t.metaKey?void 0:this.props.values[h(n-1,0,this.props.values.length-1)],function(){});break;case 39:this.props.onAnchorChange(t.metaKey?a(this.props.values):this.props.values[h(n+1,0,this.props.values.length-1)],function(){})}switch(t.which){case 38:return this.props.onScrollLockChange(!0),o=function(){switch(!1){case void 0!==this.props.highlightedUid:return 0;default:return-1+this.optionIndexFromUid(this.props.highlightedUid)}}.call(this),this.highlightAndScrollToSelectableOption(o,-1,function(e){if(!e)return r.highlightAndScrollToSelectableOption(r.props.options.length-1,-1)});case 40:return this.props.onScrollLockChange(!0),o=function(){switch(!1){case void 0!==this.props.highlightedUid:return 0;default:return 1+this.optionIndexFromUid(this.props.highlightedUid)}}.call(this),this.highlightAndScrollToSelectableOption(o,1,function(e){if(!e)return r.highlightAndScrollToSelectableOption(0,1)})}},t.prototype.componentDidMount=function(){this.props.autofocus&&this.focus(),this.props.open&&this.highlightAndFocus()},t.prototype.componentDidUpdate=function(e){this.props.open&&!e.open&&void 0===this.props.highlightedUid&&this.highlightAndFocus(),!this.props.open&&e.open&&this.props.onHighlightedUidChange(void 0,function(){})},t.prototype.componentWillReceiveProps=function(e){void 0!==this.props.disabled&&!1!==this.props.disabled||void 0===e.disabled||!0!==e.disabled||this.onOpenChange(!1,function(){})},t.prototype.optionIndexFromUid=function(e){var t=this;return u(function(n){return f(e,t.props.uid(n))})(this.props.options)},t.prototype.closeDropdown=function(e){var t=this;this.onOpenChange(!1,function(){return t.props.onAnchorChange(a(t.props.values),e)})},t.prototype.blur=function(){this.refs.search.blur()},t.prototype.focus=function(){this.refs.search.focus()},t.prototype.focusOnInput=function(){var e;(e=O(this.refs.search))!==document.activeElement&&(this.focusLock=!0,e.focus(),e.value=e.value)},t.prototype.highlightAndFocus=function(){this.highlightAndScrollToSelectableOption(this.props.firstOptionIndexToHighlight(this.props.options),1),this.focusOnInput()},t.prototype.highlightAndScrollToOption=function(e,t){null==t&&(t=function(){}),this.refs.dropdownMenu.highlightAndScrollToOption(e,t)},t.prototype.highlightAndScrollToSelectableOption=function(e,t,n){var o=this;null==n&&(n=function(){}),(o.props.open?function(e){return e()}:function(e){return o.onOpenChange(!0,e)})(function(){return o.refs.dropdownMenu.highlightAndScrollToSelectableOption(e,t,n)})},t.prototype.isEqualToObject=function(){return f(this.props.uid(arguments[0]),this.props.uid(arguments[1]))},t.prototype.onOpenChange=function(e,t){return this.props.onOpenChange(!this.props.disabled&&e,t)},t.prototype.selectHighlightedUid=function(e,t){var n,o,r=this;return void 0===this.props.highlightedUid?(t(),!1):"number"!=typeof(n=this.optionIndexFromUid(this.props.highlightedUid))?(t(),!1):(o=this.props.options[n],r.props.onValuesChange(c(function(e){return r.props.values[e]},function(){var t,n,o=[];for(t=0,n=e;t<=n;++t)o.push(t);return o}()).concat([o],c(function(e){return r.props.values[e]},function(){var t,n,o=[];for(t=e+1,n=this.props.values.length;t<n;++t)o.push(t);return o}.call(r))),function(){var e;if(e=p(function(e){return r.isEqualToObject(e,o)},r.props.values))return r.props.onSearchChange("",function(){return r.props.onAnchorChange(e,function(){if(r.props.open)return r.highlightAndScrollToSelectableOption(n,1,function(n){if(!n)return r.highlightAndScrollToSelectableOption(r.props.firstOptionIndexToHighlight(r.props.options),1,function(n){return n?t(e):r.onOpenChange(!1,function(){return t(e)})});t(e)});t(e)})});t()}),!0)},t.prototype.uidToString=function(e){return("object"==typeof e?JSON.stringify:l)(e)},t}(g.Component)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./DropdownMenu":2,"./OptionWrapper":5,"./ResetButton":8,"./ResizableInput":9,"./ToggleButton":12,"./ValueWrapper":13,"./utils":15,"prelude-ls":void 0}],7:[function(e,t,n){(function(e){(function(){function n(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function o(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}var r,i,s,p,u,l;r="undefined"!=typeof window?window.React:void 0!==e?e.React:null,i="undefined"!=typeof window?window.ReactDOM:void 0!==e?e.ReactDOM:null,s=i.render,p=i.unmountComponentAtNode,u="undefined"!=typeof window?window.Tether:void 0!==e?e.Tether:null,l=function(e){function t(){t.superclass.apply(this,arguments)}n((o(t,e).displayName="ReactTether",t),e).prototype;return t.defaultProps={parentElement:function(){return document.body}},t.prototype.render=function(){return null},t.prototype.initTether=function(e){var t=this;this.node=document.createElement("div"),this.props.parentElement().appendChild(this.node),this.tether=new u(o({element:this.node,target:e.target()},e.options)),s(e.children,this.node,function(){return t.tether.position()})},t.prototype.destroyTether=function(){this.tether&&this.tether.destroy(),this.node&&(p(this.node),this.node.parentElement.removeChild(this.node)),this.node=this.tether=void 0},t.prototype.componentDidMount=function(){this.props.children&&this.initTether(this.props)},t.prototype.componentWillReceiveProps=function(e){var t=this;this.props.children&&!e.children?this.destroyTether():e.children&&!this.props.children?this.initTether(e):e.children&&(this.tether.setOptions(o({element:this.node,target:e.target()},e.options)),s(e.children,this.node,function(){return t.tether.position()}))},t.prototype.componentWillUnmount=function(){this.destroyTether()},t}(r.PureComponent),t.exports=l}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t,n){(function(n){(function(){function o(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function r(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}var i,s,p,u;s=(i="undefined"!=typeof window?window.React:void 0!==n?n.React:null).createFactory,p=("undefined"!=typeof window?window.ReactDOMFactories:void 0!==n?n.ReactDOMFactories:null).path,u=s(e("./SvgWrapper")),t.exports=function(e){function t(){t.superclass.apply(this,arguments)}o((r(t,e).displayName="ResetButton",t),e).prototype;return t.prototype.render=function(){return u({className:"react-selectize-reset-button",style:{width:8,height:8}},p({d:"M0 0 L8 8 M8 0 L 0 8"}))},t}(i.PureComponent)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./SvgWrapper":11}],9:[function(e,t,n){(function(n){(function(){function o(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function r(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}var i,s,p,u,l,a;i=e("prelude-ls"),s=i.each,p=i.objToPairs,(u="undefined"!=typeof window?window.React:void 0!==n?n.React:null).createFactory,l=("undefined"!=typeof window?window.ReactDOMFactories:void 0!==n?n.ReactDOMFactories:null).input,a=("undefined"!=typeof window?window.ReactDOM:void 0!==n?n.ReactDOM:null).findDOMNode,t.exports=function(e){function t(){t.superclass.apply(this,arguments)}o((r(t,e).displayName="ResizableInput",t),e).prototype;return t.prototype.render=function(){var e;return l((e=r({},this.props),e.type="input",e.className="resizable-input",e))},t.prototype.autosize=function(){var e,t,n,o,r;return e=t=a(this),e.style.width="0px",0===t.value.length?t.style.width=null!=t&&t.currentStyle?"4px":"2px":t.scrollWidth>0?t.style.width=2+t.scrollWidth+"px":(n=o=document.createElement("div"),n.innerHTML=t.value,function(){var e;e=o.style,e.display="inline-block",e.width=""}(s(function(e){var t,n;return t=e[0],n=e[1],o.style[t]=n})(p(t.currentStyle?t.currentStyle:null!=(r=document.defaultView)?r:window.getComputedStyle(t)))),document.body.appendChild(o),t.style.width=4+o.clientWidth+"px",document.body.removeChild(o))},t.prototype.componentDidMount=function(){this.autosize()},t.prototype.componentDidUpdate=function(){this.autosize()},t.prototype.blur=function(){return a(this).blur()},t.prototype.focus=function(){return a(this).focus()},t}(u.PureComponent)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"prelude-ls":void 0}],10:[function(e,t,n){(function(n){(function(){function o(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function r(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}function i(e,t){var n,o=function(r){return e.length>1?function(){var i=r?r.concat():[];return n=t?n||this:this,i.push.apply(i,arguments)<e.length&&arguments.length?o.call(n,i):e.apply(n,i)}:e};return o()}var s,p,u,l,a,c,d,h,f,g,y,v,w,m,O,b,S={}.toString;s=e("prelude-ls"),p=s.all,s.any,u=s.drop,l=s.camelize,s.difference,a=s.filter,s.find,c=s.findIndex,d=s.id,h=s.last,f=s.map,s.reject,g=("undefined"!=typeof window?window.preludeExtension:void 0!==n?n.preludeExtension:null).isEqualToObject,v=(y="undefined"!=typeof window?window.React:void 0!==n?n.React:null).createFactory,s="undefined"!=typeof window?window.ReactDOMFactories:void 0!==n?n.ReactDOMFactories:null,w=s.div,s.img,m=s.span,O=v(e("./ReactSelectize")),b=e("./utils").cancelEvent,t.exports=function(e){function t(e){var n;t.superclass.call(this,e),this.state={highlightedUid:void 0,open:!1,scrollLock:!1,search:"",value:null!=(n=this.props)?n.defaultValue:void 0}}o((r(t,e).displayName="SimpleSelect",t),e).prototype;return t.defaultProps={delimiters:[],filterOptions:i(function(e,t){return a(function(e){return e.label.toLowerCase().trim().indexOf(t.toLowerCase().trim())>-1})(e)}),firstOptionIndexToHighlight:d,onBlur:function(e){},onBlurResetsInput:!0,onFocus:function(e){},onKeyboardSelectionFailed:function(e){},onPaste:function(e){},placeholder:"",renderValue:function(e){var t;return t=e.label,w({className:"simple-value"},m(null,t))},serialize:function(e){return null!=e?e.value:void 0},style:{},tether:!1,uid:d},t.prototype.render=function(){var e,t,n,o,i,s,p,u,l,a,c,d,f,y,v,w,m,S,C,T,x,R,P,D,M,F,N,E,U,L,A,k,H,I,B,z=this;return e=this.getComputedState(),e.filteredOptions,t=e.highlightedUid,n=e.onHighlightedUidChange,o=e.onOpenChange,i=e.onSearchChange,s=e.onValueChange,p=e.open,u=e.options,l=e.search,a=e.value,c=e.values,null!=(e=this.props)&&(d=e.autofocus,f=e.autosize,y=e.cancelKeyboardEventOnSelection,v=e.delimiters,w=e.disabled,m=e.dropdownDirection,S=e.groupId,C=e.groups,T=e.groupsAsColumns,x=e.hideResetButton,R=e.name,P=e.inputProps,D=e.onBlurResetsInput,M=e.renderToggleButton,F=e.renderGroupTitle,N=e.renderResetButton,E=e.serialize,U=e.tether,L=e.tetherProps,A=e.theme,k=e.transitionEnter,H=e.transitionLeave,I=e.transitionEnterTimeout,B=e.transitionLeaveTimeout,e.uid),O(r(r({autofocus:d,autosize:f,cancelKeyboardEventOnSelection:y,className:"simple-select"+(this.props.className?" "+this.props.className:""),delimiters:v,disabled:w,dropdownDirection:m,groupId:S,groups:C,groupsAsColumns:T,hideResetButton:x,highlightedUid:t,onHighlightedUidChange:n,inputProps:P,name:R,onBlurResetsInput:D,renderGroupTitle:F,renderResetButton:N,renderToggleButton:M,scrollLock:this.state.scrollLock,onScrollLockChange:function(e){return z.setState({scrollLock:e})},tether:U,tetherProps:L,theme:A,transitionEnter:k,transitionEnterTimeout:I,transitionLeave:H,transitionLeaveTimeout:B,ref:"select",anchor:h(c),onAnchorChange:function(e,t){return t()},open:p,onOpenChange:o,firstOptionIndexToHighlight:function(){return z.firstOptionIndexToHighlight(u,a)},options:u,renderOption:this.props.renderOption,renderNoResultsFound:this.props.renderNoResultsFound,search:l,onSearchChange:function(e,t){return i(e,t)},values:c,onValuesChange:function(e,t){var n,r;return 0===e.length?s(void 0,function(){return t()}):(n=h(e),r=!g(n,a),function(e){return r?s(n,e):e()}(function(){return t(),o(!1,function(){})}))},renderValue:function(e){return p&&(z.props.editable||l.length>0)?null:z.props.renderValue(e)},onKeyboardSelectionFailed:function(e){return i("",function(){return o(!1,function(){return z.props.onKeyboardSelectionFailed(e)})})},uid:function(e){return{uid:z.props.uid(e),open:p,search:l}},serialize:function(e){return E(e[0])},onBlur:function(e){var t;t=z.props.onBlurResetsInput,function(e){l.length>0&&t?i("",e):e()}(function(){return z.props.onBlur({value:a,open:p,originalEvent:e})})},onFocus:function(e){z.props.onFocus({value:a,open:p,originalEvent:e})},onPaste:function(){var e;switch(!1){case void 0!==(null!=(e=this.props)?e.valueFromPaste:void 0):return this.props.onPaste;default:return function(e){var t,n;if(t=e.clipboardData,n=z.props.valueFromPaste(u,a,t.getData("text")))return s(n,function(){return i("",function(){return o(!1)})}),b(e)}}}.call(this),placeholder:this.props.placeholder,style:this.props.style},function(){switch(!1){case"function"!=typeof this.props.restoreOnBackspace:return{restoreOnBackspace:this.props.restoreOnBackspace};default:return{}}}.call(this)),function(){switch(!1){case"function"!=typeof this.props.renderNoResultsFound:return{renderNoResultsFound:function(){return z.props.renderNoResultsFound(a,l)}};default:return{}}}.call(this)))},t.prototype.getComputedState=function(){var e,t,n,o,i,s,p,u,a,c,d,h,g,y,v,w=this;return e=this.props.hasOwnProperty("highlightedUid")?this.props.highlightedUid:this.state.highlightedUid,t=this.isOpen(),n=this.props.hasOwnProperty("search")?this.props.search:this.state.search,o=this.value(),i=o||0===o?[o]:[],s=f(function(e){return function(){switch(!1){case!(this.props.hasOwnProperty(e)&&this.props.hasOwnProperty(l("on-"+e+"-change"))):return function(t,n){return w.props[l("on-"+e+"-change")](t,function(){}),w.setState({},n)};case!(this.props.hasOwnProperty(e)&&!this.props.hasOwnProperty(l("on-"+e+"-change"))):return function(e,t){return t()};case!(!this.props.hasOwnProperty(e)&&this.props.hasOwnProperty(l("on-"+e+"-change"))):return function(t,n){var o;return w.setState((o={},o[e+""]=t,o),function(){return n(),w.props[l("on-"+e+"-change")](t,function(){})})};case!(!this.props.hasOwnProperty(e)&&!this.props.hasOwnProperty(l("on-"+e+"-change"))):return function(t,n){var o;return w.setState((o={},o[e+""]=t,o),n)}}}.call(w)})(["highlightedUid","open","search","value"]),p=s[0],u=s[1],a=s[2],c=s[3],d=function(){var e;switch(!1){case!(null!=(e=this.props)&&e.children):return f(function(e){var t,n,o;return null!=(t=null!=e?e.props:void 0)&&(n=t.value,o=t.children),{label:o,value:n}})("Array"===S.call(this.props.children).slice(8,-1)?this.props.children:[this.props.children]);default:return[]}}.call(this),h=this.props.hasOwnProperty("options")?null!=(s=this.props.options)?s:[]:d,g=this.props.filterOptions(h,n),y=function(){switch(!1){case"function"!=typeof this.props.createFromSearch:return this.props.createFromSearch(g,n);default:return null}}.call(this),v=(y?[(s=r({},y),s.newOption=!0,s)]:[]).concat(g),{highlightedUid:e,open:t,search:n,value:o,values:i,onHighlightedUidChange:p,onOpenChange:function(e,t){u(e,function(){if(t(),w.props.editable&&w.isOpen()&&o)return a(w.props.editable(o)+""+(1===n.length?n:""),function(){return w.highlightFirstSelectableOption(function(){})})})},onSearchChange:a,onValueChange:c,filteredOptions:g,options:v}},t.prototype.firstOptionIndexToHighlight=function(e,t){var n,o,r;return n=t?c(function(e){return g(e,t)},e):void 0,o=function(){var t;switch(!1){case void 0===n:return n;case 1!==e.length:case void 0!==(null!=(t=e[0])?t.newOption:void 0):return 0;default:return p(function(e){return"boolean"==typeof e.selectable&&!e.selectable})(u(1)(e))?0:1}}(),r=this.props.hasOwnProperty("search")?this.props.search:this.state.search,this.props.firstOptionIndexToHighlight(o,e,t,r)},t.prototype.focus=function(){this.refs.select.focus()},t.prototype.blur=function(){this.refs.select.blur()},t.prototype.highlightFirstSelectableOption=function(e){var t,n,o;null==e&&(e=function(){}),this.state.open?(n=(t=this.getComputedState()).options,o=t.value,this.refs.select.highlightAndScrollToSelectableOption(this.firstOptionIndexToHighlight(n,o),1,e)):e()},t.prototype.value=function(){return this.props.hasOwnProperty("value")?this.props.value:this.state.value},t.prototype.isOpen=function(){return this.props.hasOwnProperty("open")?this.props.open:this.state.open},t}(y.Component)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./ReactSelectize":6,"./utils":15,"prelude-ls":void 0}],11:[function(e,t,n){(function(e){(function(){function n(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function o(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}var r,i,s;r="undefined"!=typeof window?window.React:void 0!==e?e.React:null,i=("undefined"!=typeof window?window.ReactDOMFactories:void 0!==e?e.ReactDOMFactories:null).svg,s=("undefined"!=typeof window?window.ReactDOM:void 0!==e?e.ReactDOM:null).findDOMNode,t.exports=function(e){function t(){t.superclass.apply(this,arguments)}n((o(t,e).displayName="SvgWrapper",t),e).prototype;return t.prototype.render=function(){return i(this.props)},t.prototype.componentDidMount=function(){s(this).setAttribute("focusable",!1)},t}(r.PureComponent)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],12:[function(e,t,n){(function(n){(function(){function o(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function r(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}var i,s,p,u;s=(i="undefined"!=typeof window?window.React:void 0!==n?n.React:null).createFactory,p=("undefined"!=typeof window?window.ReactDOMFactories:void 0!==n?n.ReactDOMFactories:null).path,u=s(e("./SvgWrapper")),t.exports=function(e){function t(){t.superclass.apply(this,arguments)}o((r(t,e).displayName="ToggleButton",t),e).prototype;return t.defaultProps={open:!1,flipped:!1},t.prototype.render=function(){return u({className:"react-selectize-toggle-button",style:{width:10,height:8}},p({d:function(){switch(!1){case!(this.props.open&&!this.props.flipped||!this.props.open&&this.props.flipped):return"M0 6 L5 1 L10 6 Z";default:return"M0 1 L5 6 L10 1 Z"}}.call(this)}))},t}(i.PureComponent)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./SvgWrapper":11}],13:[function(e,t,n){(function(e){(function(){function n(e,t){function n(){}return n.prototype=(e.superclass=t).prototype,(e.prototype=new n).constructor=e,"function"==typeof t.extended&&t.extended(e),e}function o(e,t){var n={}.hasOwnProperty;for(var o in t)n.call(t,o)&&(e[o]=t[o]);return e}var r,i,s;r="undefined"!=typeof window?window.React:void 0!==e?e.React:null,i=("undefined"!=typeof window?window.ReactDOMFactories:void 0!==e?e.ReactDOMFactories:null).div,s=("undefined"!=typeof window?window.preludeExtension:void 0!==e?e.preludeExtension:null).isEqualToObject,t.exports=function(e){function t(){t.superclass.apply(this,arguments)}n((o(t,e).displayName="ValueWrapper",t),e).prototype;return t.defaultProps={},t.prototype.render=function(){return i({className:"value-wrapper"},this.props.renderItem(this.props.item))},t.prototype.shouldComponentUpdate=function(e){var t;return!s(null!=e?e.uid:void 0,null!=(t=this.props)?t.uid:void 0)},t}(r.Component)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(e,t,n){(function(){var n,o,r,i;n=e("./HighlightedText"),o=e("./SimpleSelect"),r=e("./MultiSelect"),i=e("./ReactSelectize"),t.exports={HighlightedText:n,SimpleSelect:o,MultiSelect:r,ReactSelectize:i}}).call(this)},{"./HighlightedText":3,"./MultiSelect":4,"./ReactSelectize":6,"./SimpleSelect":10}],15:[function(e,t,n){(function(){var t,o,r,i,s,p=void 0!==n&&n||this;t=e("prelude-ls"),o=t.filter,r=t.map,i=t.objToPairs,s=t.Str,p.cancelEvent=function(e){e.preventDefault(),e.stopPropagation()},p.classNameFromObject=function(e){return s.join(" ")(r(function(e){return e[0]})(o(function(e){return!!e[1]})(i(e))))}}).call(this)},{"prelude-ls":void 0}]},{},[14])(14)});